Merge
diff --git a/.hgtags b/.hgtags
index 0012050..a6cb07b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -399,3 +399,13 @@
 8c70d170e62c0c58b5bc3ba666bd140399b98c9c jdk-10+0
 45b751afd11e6c05991cf4913c5a0ac3304fcc4e jdk-9+154
 f4aff695ffe05cfdb69d8af25a4ddc6a029754ea jdk-9+155
+06bce0388880b5ff8e040e4a9d72a3ea11dac321 jdk-9+156
+fa3e76b477829afc4476f0b725cfaa440a6fd917 jdk-9+157
+b5015f742ba648184bb7fc547197bd33ebfde30d jdk-9+158
+fd1497902bbe3aa24b21f270ecdcb8de5f7aa9ac jdk-9+159
+6aa8be0c4e054fe8b3ab016ae00d16d680f92145 jdk-9+160
+f6883b1a5a6478437cd4181c4bd45328ab24feaf jdk-9+161
+d16aebbb56d37f12e0c0b0a4fb427db65e1fb1a8 jdk-9+162
+18c41483a082e097ac2f5f983c1226ed94aa4215 jdk-9+163
+32db52c675e7d5bc413605d2e89b68b608b19be0 jdk-9+164
+3965b747cfe1e6cbd66b8739da5a1ea6ec6985e9 jdk-9+165
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 3d81f13..5b87678 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -398,3 +398,13 @@
 816a6d03a7c44edfbd8780110529f1bdc3964fb9 jdk-9+153
 8d26916eaa21b689835ffc1c0dbf12470aa9be61 jdk-9+154
 688a3863c00ebc089ab17ee1fc46272cbbd96815 jdk-9+155
+783ec7542cf7154e5d2b87f55bb97d28f81e9ada jdk-9+156
+4eb77fb98952dc477a4229575c81d2263a9ce711 jdk-9+157
+a4087bc10a88a43ea3ad0919b5b4af1c86977221 jdk-9+158
+fe8466adaef8178dba94be53c789a0aaa87d13bb jdk-9+159
+4d29ee32d926ebc960072d51a3bc558f95c1cbad jdk-9+160
+cda60babd152d889aba4d8f20a8f643ab151d3de jdk-9+161
+21b063d75b3edbffb9bebc8872d990920c4ae1e5 jdk-9+162
+c38c6b270ccc8e2b86d1631bcf42248241b54d2c jdk-9+163
+7810f75d016a52e32295c4233009de5ca90e31af jdk-9+164
+aff4f339acd40942d3dab499846b52acd87b3af1 jdk-9+165
diff --git a/README b/README
index 477b388..537dea3 100644
--- a/README
+++ b/README
@@ -1,40 +1,10 @@
-README:
-  This file should be located at the top of the OpenJDK Mercurial root
-  repository. A full OpenJDK repository set (forest) should also include
-  the following 7 nested repositories:
-    "jdk", "hotspot", "langtools", "nashorn", "corba", "jaxws"  and "jaxp".
+Welcome to OpenJDK!
+===================
 
-  The root repository can be obtained with something like:
-    hg clone http://hg.openjdk.java.net/jdk9/jdk9 openjdk9
+For information about building OpenJDK, including how to fully retrieve all
+source code, please see either of these:
 
-  You can run the get_source.sh script located in the root repository to get
-  the other needed repositories:
-    cd openjdk9 && sh ./get_source.sh
+  * common/doc/building.html   (html version)
+  * common/doc/building.md     (markdown version)
 
-  People unfamiliar with Mercurial should read the first few chapters of
-  the Mercurial book: http://hgbook.red-bean.com/read/
-
-  See http://openjdk.java.net/ for more information about OpenJDK.
-
-Simple Build Instructions:
-
-  0. Get the necessary system software/packages installed on your system, see
-     http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html
-
-  1. If you don't have a jdk8 or newer jdk, download and install it from
-     http://java.sun.com/javase/downloads/index.jsp
-     Add the /bin directory of this installation to your PATH environment
-     variable.
-
-  2. Configure the build:
-       bash ./configure
-
-  3. Build the OpenJDK:
-       make all
-     The resulting JDK image should be found in build/*/images/jdk
-
-where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually
-is 3.81 or newer. Note that on Solaris, GNU make is called "gmake".
-
-Complete details are available in the file:
-     http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html
+See http://openjdk.java.net/ for more information about OpenJDK.
diff --git a/README-builds.html b/README-builds.html
deleted file mode 100644
index 6d7d5b5..0000000
--- a/README-builds.html
+++ /dev/null
@@ -1,1406 +0,0 @@
-<html>
-  <head>
-    <title>OpenJDK Build README</title>
-  </head>
-  <body>
-<p><img src="http://openjdk.java.net/images/openjdk.png" alt="OpenJDK" title="" /></p>
-
-<h1>OpenJDK Build README</h1>
-
-<hr />
-
-<p><a name="introduction"></a></p>
-
-<h2>Introduction</h2>
-
-<p>This README file contains build instructions for the
-<a href="http://openjdk.java.net">OpenJDK</a>. Building the source code for the OpenJDK
-requires a certain degree of technical expertise.</p>
-
-<h3>!!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!</h3>
-
-<p>Some Headlines:</p>
-
-<ul>
-<li>The build is now a "<code>configure &amp;&amp; make</code>" style build</li>
-<li>Any GNU make 3.81 or newer should work, except on Windows where 4.0 or newer
-is recommended.</li>
-<li>The build should scale, i.e. more processors should cause the build to be
-done in less wall-clock time</li>
-<li>Nested or recursive make invocations have been significantly reduced,
-as has the total fork/exec or spawning of sub processes during the build</li>
-<li>Windows MKS usage is no longer supported</li>
-<li>Windows Visual Studio <code>vsvars*.bat</code> and <code>vcvars*.bat</code> files are run
-automatically</li>
-<li>Ant is no longer used when building the OpenJDK</li>
-<li>Use of ALT_* environment variables for configuring the build is no longer
-supported</li>
-</ul>
-
-<hr />
-
-<h2>Contents</h2>
-
-<ul>
-<li><a href="#introduction">Introduction</a></li>
-<li><a href="#hg">Use of Mercurial</a>
-<ul>
-<li><a href="#get_source">Getting the Source</a></li>
-<li><a href="#repositories">Repositories</a></li>
-</ul></li>
-<li><a href="#building">Building</a>
-<ul>
-<li><a href="#setup">System Setup</a>
-<ul>
-<li><a href="#linux">Linux</a></li>
-<li><a href="#solaris">Solaris</a></li>
-<li><a href="#macosx">Mac OS X</a></li>
-<li><a href="#windows">Windows</a></li>
-</ul></li>
-<li><a href="#configure">Configure</a></li>
-<li><a href="#make">Make</a></li>
-</ul></li>
-<li><a href="#testing">Testing</a></li>
-</ul>
-
-<hr />
-
-<ul>
-<li><a href="#hints">Appendix A: Hints and Tips</a>
-<ul>
-<li><a href="#faq">FAQ</a></li>
-<li><a href="#performance">Build Performance Tips</a></li>
-<li><a href="#troubleshooting">Troubleshooting</a></li>
-</ul></li>
-<li><a href="#gmake">Appendix B: GNU Make Information</a></li>
-<li><a href="#buildenvironments">Appendix C: Build Environments</a></li>
-</ul>
-
-<hr />
-
-<p><a name="hg"></a></p>
-
-<h2>Use of Mercurial</h2>
-
-<p>The OpenJDK sources are maintained with the revision control system
-<a href="http://mercurial.selenic.com/wiki/Mercurial">Mercurial</a>. If you are new to
-Mercurial, please see the <a href="http://mercurial.selenic.com/wiki/
-BeginnersGuides">Beginner Guides</a> or refer to the <a href="http://hgbook.red-bean.com/">Mercurial Book</a>.
-The first few chapters of the book provide an excellent overview of Mercurial,
-what it is and how it works.</p>
-
-<p>For using Mercurial with the OpenJDK refer to the <a href="http://openjdk.java.net/guide/
-repositories.html#installConfig">Developer Guide: Installing
-and Configuring Mercurial</a> section for more information.</p>
-
-<p><a name="get_source"></a></p>
-
-<h3>Getting the Source</h3>
-
-<p>To get the entire set of OpenJDK Mercurial repositories use the script
-<code>get_source.sh</code> located in the root repository:</p>
-
-<pre><code>  hg clone http://hg.openjdk.java.net/jdk9/jdk9 YourOpenJDK
-  cd YourOpenJDK
-  bash ./get_source.sh
-</code></pre>
-
-<p>Once you have all the repositories, keep in mind that each repository is its
-own independent repository. You can also re-run <code>./get_source.sh</code> anytime to
-pull over all the latest changesets in all the repositories. This set of
-nested repositories has been given the term "forest" and there are various
-ways to apply the same <code>hg</code> command to each of the repositories. For
-example, the script <code>make/scripts/hgforest.sh</code> can be used to repeat the
-same <code>hg</code> command on every repository, e.g.</p>
-
-<pre><code>  cd YourOpenJDK
-  bash ./make/scripts/hgforest.sh status
-</code></pre>
-
-<p><a name="repositories"></a></p>
-
-<h3>Repositories</h3>
-
-<p>The set of repositories and what they contain:</p>
-
-<ul>
-<li><strong>. (root)</strong> contains common configure and makefile logic</li>
-<li><strong>hotspot</strong> contains source code and make files for building the OpenJDK
-Hotspot Virtual Machine</li>
-<li><strong>langtools</strong> contains source code for the OpenJDK javac and language tools</li>
-<li><strong>jdk</strong> contains source code and make files for building the OpenJDK runtime
-libraries and misc files</li>
-<li><strong>jaxp</strong> contains source code for the OpenJDK JAXP functionality</li>
-<li><strong>jaxws</strong> contains source code for the OpenJDK JAX-WS functionality</li>
-<li><strong>corba</strong> contains source code for the OpenJDK Corba functionality</li>
-<li><strong>nashorn</strong> contains source code for the OpenJDK JavaScript implementation</li>
-</ul>
-
-<h3>Repository Source Guidelines</h3>
-
-<p>There are some very basic guidelines:</p>
-
-<ul>
-<li>Use of whitespace in source files (.java, .c, .h, .cpp, and .hpp files) is
-restricted. No TABs, no trailing whitespace on lines, and files should not
-terminate in more than one blank line.</li>
-<li>Files with execute permissions should not be added to the source
-repositories.</li>
-<li>All generated files need to be kept isolated from the files maintained or
-managed by the source control system. The standard area for generated files
-is the top level <code>build/</code> directory.</li>
-<li>The default build process should be to build the product and nothing else,
-in one form, e.g. a product (optimized), debug (non-optimized, -g plus
-assert logic), or fastdebug (optimized, -g plus assert logic).</li>
-<li>The <code>.hgignore</code> file in each repository must exist and should include
-<code>^build/</code>, <code>^dist/</code> and optionally any <code>nbproject/private</code> directories. <strong>It
-should NEVER</strong> include anything in the <code>src/</code> or <code>test/</code> or any managed
-directory area of a repository.</li>
-<li>Directory names and file names should never contain blanks or non-printing
-characters.</li>
-<li>Generated source or binary files should NEVER be added to the repository
-(that includes <code>javah</code> output). There are some exceptions to this rule, in
-particular with some of the generated configure scripts.</li>
-<li>Files not needed for typical building or testing of the repository should
-not be added to the repository.</li>
-</ul>
-
-<hr />
-
-<p><a name="building"></a></p>
-
-<h2>Building</h2>
-
-<p>The very first step in building the OpenJDK is making sure the system itself
-has everything it needs to do OpenJDK builds. Once a system is setup, it
-generally doesn't need to be done again.</p>
-
-<p>Building the OpenJDK is now done with running a <code>configure</code> script which will
-try and find and verify you have everything you need, followed by running
-<code>make</code>, e.g.</p>
-
-<blockquote>
-  <p><strong><code>bash ./configure</code></strong> <br />
- <strong><code>make all</code></strong></p>
-</blockquote>
-
-<p>Where possible the <code>configure</code> script will attempt to located the various
-components in the default locations or via component specific variable
-settings. When the normal defaults fail or components cannot be found,
-additional <code>configure</code> options may be necessary to help <code>configure</code> find the
-necessary tools for the build, or you may need to re-visit the setup of your
-system due to missing software packages.</p>
-
-<p><strong>NOTE:</strong> The <code>configure</code> script file does not have execute permissions and
-will need to be explicitly run with <code>bash</code>, see the source guidelines.</p>
-
-<hr />
-
-<p><a name="setup"></a></p>
-
-<h3>System Setup</h3>
-
-<p>Before even attempting to use a system to build the OpenJDK there are some very
-basic system setups needed. For all systems:</p>
-
-<ul>
-<li><p>Be sure the GNU make utility is version 3.81 (4.0 on windows) or newer, e.g.
-run "<code>make -version</code>"</p>
-
-<p><a name="bootjdk"></a></p></li>
-<li><p>Install a Bootstrap JDK. All OpenJDK builds require access to a previously
-released JDK called the <em>bootstrap JDK</em> or <em>boot JDK.</em> The general rule is
-that the bootstrap JDK must be an instance of the previous major release of
-the JDK. In addition, there may be a requirement to use a release at or
-beyond a particular update level.</p>
-
-<p><strong><em>Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as
-the boot JDK, to ensure that JDK 9 dependencies are not introduced into the
-parts of the system that are built with JDK 8.</em></strong></p>
-
-<p>The JDK 8 binaries can be downloaded from Oracle's <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 8 download
-site</a>.
-For build performance reasons it is very important that this bootstrap JDK
-be made available on the local disk of the machine doing the build. You
-should add its <code>bin</code> directory to the <code>PATH</code> environment variable. If
-<code>configure</code> has any issues finding this JDK, you may need to use the
-<code>configure</code> option <code>--with-boot-jdk</code>.</p></li>
-<li><p>Ensure that GNU make, the Bootstrap JDK, and the compilers are all in your
-PATH environment variable.</p></li>
-</ul>
-
-<p>And for specific systems:</p>
-
-<ul>
-<li><p><strong>Linux</strong></p>
-
-<p>Install all the software development packages needed including
-<a href="#alsa">alsa</a>, <a href="#freetype">freetype</a>, <a href="#cups">cups</a>, and
-<a href="#xrender">xrender</a>. See <a href="#SDBE">specific system packages</a>.</p></li>
-<li><p><strong>Solaris</strong></p>
-
-<p>Install all the software development packages needed including <a href="#studio">Studio
-Compilers</a>, <a href="#freetype">freetype</a>, <a href="#cups">cups</a>, and
-<a href="#xrender">xrender</a>. See <a href="#SDBE">specific system packages</a>.</p></li>
-<li><p><strong>Windows</strong></p>
-
-<ul>
-<li>Install one of <a href="#cygwin">CYGWIN</a> or <a href="#msys">MinGW/MSYS</a></li>
-<li>Install <a href="#vs2013">Visual Studio 2013</a></li>
-</ul></li>
-<li><p><strong>Mac OS X</strong></p>
-
-<p>Install <a href="https://developer.apple.com/xcode/">XCode 6.3</a></p></li>
-</ul>
-
-<p><a name="linux"></a></p>
-
-<h4>Linux</h4>
-
-<p>With Linux, try and favor the system packages over building your own or getting
-packages from other areas. Most Linux builds should be possible with the
-system's available packages.</p>
-
-<p>Note that some Linux systems have a habit of pre-populating your environment
-variables for you, for example <code>JAVA_HOME</code> might get pre-defined for you to
-refer to the JDK installed on your Linux system. You will need to unset
-<code>JAVA_HOME</code>. It's a good idea to run <code>env</code> and verify the environment variables
-you are getting from the default system settings make sense for building the
-OpenJDK.</p>
-
-<p><a name="solaris"></a></p>
-
-<h4>Solaris</h4>
-
-<p><a name="studio"></a></p>
-
-<h5>Studio Compilers</h5>
-
-<p>At a minimum, the <a href="http://www.oracle.com/
-technetwork/server-storage/solarisstudio/downloads/index.htm">Studio 12 Update 4 Compilers</a> (containing
-version 5.13 of the C and C++ compilers) is required, including specific
-patches.</p>
-
-<p>The Solaris Studio installation should contain at least these packages:</p>
-
-<blockquote>
-  <p><table border="1">
-     <thead>
-       <tr>
-         <td><strong>Package</strong></td>
-         <td><strong>Version</strong></td>
-       </tr>
-     </thead>
-     <tbody>
-       <tr>
-         <td>developer/solarisstudio-124/backend</td>
-         <td>12.4-1.0.6.0</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/c++</td>
-         <td>12.4-1.0.10.0</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/cc</td>
-         <td>12.4-1.0.4.0</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/library/c++-libs</td>
-         <td>12.4-1.0.10.0</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/library/math-libs</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/library/studio-gccrt</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/studio-common</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/studio-ja</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/studio-legal</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/studio-zhCN</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-     </tbody>
-   </table></p>
-</blockquote>
-
-<p>In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc
-version.</p>
-
-<p>Place the <code>bin</code> directory in <code>PATH</code>.</p>
-
-<p>The Oracle Solaris Studio Express compilers at: <a href="http://www.oracle.com/technetwork/server-storage/solarisstudio/
-downloads/index-jsp-142582.html">Oracle Solaris Studio Express
-Download site</a> are also an option, although these compilers
-have not been extensively used yet.</p>
-
-<p><a name="windows"></a></p>
-
-<h4>Windows</h4>
-
-<h5>Windows Unix Toolkit</h5>
-
-<p>Building on Windows requires a Unix-like environment, notably a Unix-like
-shell. There are several such environments available of which
-<a href="http://www.cygwin.com/">Cygwin</a> and
-<a href="http://www.mingw.org/wiki/MSYS">MinGW/MSYS</a> are currently supported for the
-OpenJDK build. One of the differences of these systems from standard Windows
-tools is the way they handle Windows path names, particularly path names which
-contain spaces, backslashes as path separators and possibly drive letters.
-Depending on the use case and the specifics of each environment these path
-problems can be solved by a combination of quoting whole paths, translating
-backslashes to forward slashes, escaping backslashes with additional
-backslashes and translating the path names to their <a href="http://en.wikipedia.org/wiki/8.3_filename">"8.3"
-version</a>.</p>
-
-<p><a name="cygwin"></a></p>
-
-<h6>CYGWIN</h6>
-
-<p>CYGWIN is an open source, Linux-like environment which tries to emulate a
-complete POSIX layer on Windows. It tries to be smart about path names and can
-usually handle all kinds of paths if they are correctly quoted or escaped
-although internally it maps drive letters <code>&lt;drive&gt;:</code> to a virtual directory
-<code>/cygdrive/&lt;drive&gt;</code>.</p>
-
-<p>You can always use the <code>cygpath</code> utility to map pathnames with spaces or the
-backslash character into the <code>C:/</code> style of pathname (called 'mixed'), e.g.
-<code>cygpath -s -m "&lt;path&gt;"</code>.</p>
-
-<p>Note that the use of CYGWIN creates a unique problem with regards to setting
-<a href="#path"><code>PATH</code></a>. Normally on Windows the <code>PATH</code> variable contains directories
-separated with the ";" character (Solaris and Linux use ":"). With CYGWIN, it
-uses ":", but that means that paths like "C:/path" cannot be placed in the
-CYGWIN version of <code>PATH</code> and instead CYGWIN uses something like
-<code>/cygdrive/c/path</code> which CYGWIN understands, but only CYGWIN understands.</p>
-
-<p>The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about
-CYGWIN can be obtained from the CYGWIN website at
-<a href="http://www.cygwin.com">www.cygwin.com</a>.</p>
-
-<p>By default CYGWIN doesn't install all the tools required for building the
-OpenJDK. Along with the default installation, you need to install the following
-tools.</p>
-
-<blockquote>
-  <p><table border="1">
-     <thead>
-       <tr>
-         <td>Binary Name</td>
-         <td>Category</td>
-         <td>Package</td>
-         <td>Description</td>
-      </tr>
-     </thead>
-     <tbody>
-       <tr>
-         <td>ar.exe</td>
-         <td>Devel</td>
-         <td>binutils</td>
-         <td>The GNU assembler, linker and binary utilities</td>
-       </tr>
-       <tr>
-         <td>make.exe</td>
-         <td>Devel</td>
-         <td>make</td>
-         <td>The GNU version of the 'make' utility built for CYGWIN</td>
-       </tr>
-       <tr>
-         <td>m4.exe</td>
-         <td>Interpreters</td>
-         <td>m4</td>
-         <td>GNU implementation of the traditional Unix macro processor</td>
-       </tr>
-       <tr>
-         <td>cpio.exe</td>
-         <td>Utils</td>
-         <td>cpio</td>
-         <td>A program to manage archives of files</td>
-       </tr>
-       <tr>
-         <td>gawk.exe</td>
-         <td>Utils</td>
-         <td>awk</td>
-         <td>Pattern-directed scanning and processing language</td>
-       </tr>
-       <tr>
-         <td>file.exe</td>
-         <td>Utils</td>
-         <td>file</td>
-         <td>Determines file type using 'magic' numbers</td>
-       </tr>
-       <tr>
-         <td>zip.exe</td>
-         <td>Archive</td>
-         <td>zip</td>
-         <td>Package and compress (archive) files</td>
-       </tr>
-       <tr>
-         <td>unzip.exe</td>
-         <td>Archive</td>
-         <td>unzip</td>
-         <td>Extract compressed files in a ZIP archive</td>
-       </tr>
-       <tr>
-         <td>free.exe</td>
-         <td>System</td>
-         <td>procps</td>
-         <td>Display amount of free and used memory in the system</td>
-       </tr>
-     </tbody>
-   </table></p>
-</blockquote>
-
-<p>Note that the CYGWIN software can conflict with other non-CYGWIN software on
-your Windows system. CYGWIN provides a <a href="http://cygwin.com/faq/
-faq.using.html">FAQ</a> for known issues and problems, of particular interest is the
-section on <a href="http://cygwin.com/faq/faq.using.html#faq.using.bloda">BLODA (applications that interfere with
-CYGWIN)</a>.</p>
-
-<p><a name="msys"></a></p>
-
-<h6>MinGW/MSYS</h6>
-
-<p>MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific
-header files and import libraries combined with GNU toolsets that allow one to
-produce native Windows programs that do not rely on any 3rd-party C runtime
-DLLs. MSYS is a supplement to MinGW which allows building applications and
-programs which rely on traditional UNIX tools to be present. Among others this
-includes tools like <code>bash</code> and <code>make</code>. See <a href="http://www.mingw.org/
-wiki/MSYS">MinGW/MSYS</a> for more information.</p>
-
-<p>Like Cygwin, MinGW/MSYS can handle different types of path formats. They are
-internally converted to paths with forward slashes and drive letters
-<code>&lt;drive&gt;:</code> replaced by a virtual directory <code>/&lt;drive&gt;</code>. Additionally, MSYS
-automatically detects binaries compiled for the MSYS environment and feeds them
-with the internal, Unix-style path names. If native Windows applications are
-called from within MSYS programs their path arguments are automatically
-converted back to Windows style path names with drive letters and backslashes
-as path separators. This may cause problems for Windows applications which use
-forward slashes as parameter separator (e.g. <code>cl /nologo /I</code>) because MSYS may
-wrongly <a href="http://mingw.org/wiki/
-Posix_path_conversion">replace such parameters by drive letters</a>.</p>
-
-<p>In addition to the tools which will be installed by default, you have to
-manually install the <code>msys-zip</code> and <code>msys-unzip</code> packages. This can be easily
-done with the MinGW command line installer:</p>
-
-<pre><code>  mingw-get.exe install msys-zip
-  mingw-get.exe install msys-unzip
-</code></pre>
-
-<p><a name="vs2013"></a></p>
-
-<h5>Visual Studio 2013 Compilers</h5>
-
-<p>The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio
-C++ 2013 (VS2013) Professional Edition or Express compiler. The compiler and
-other tools are expected to reside in the location defined by the variable
-<code>VS120COMNTOOLS</code> which is set by the Microsoft Visual Studio installer.</p>
-
-<p>Only the C++ part of VS2013 is needed. Try to let the installation go to the
-default install directory. Always reboot your system after installing VS2013.
-The system environment variable VS120COMNTOOLS should be set in your
-environment.</p>
-
-<p>Make sure that TMP and TEMP are also set in the environment and refer to
-Windows paths that exist, like <code>C:\temp</code>, not <code>/tmp</code>, not <code>/cygdrive/c/temp</code>,
-and not <code>C:/temp</code>. <code>C:\temp</code> is just an example, it is assumed that this area
-is private to the user, so by default after installs you should see a unique
-user path in these variables.</p>
-
-<p><a name="macosx"></a></p>
-
-<h4>Mac OS X</h4>
-
-<p>Make sure you get the right XCode version.</p>
-
-<hr />
-
-<p><a name="configure"></a></p>
-
-<h3>Configure</h3>
-
-<p>The basic invocation of the <code>configure</code> script looks like:</p>
-
-<blockquote>
-  <p><strong><code>bash ./configure [options]</code></strong></p>
-</blockquote>
-
-<p>This will create an output directory containing the "configuration" and setup
-an area for the build result. This directory typically looks like:</p>
-
-<blockquote>
-  <p><strong><code>build/linux-x64-normal-server-release</code></strong></p>
-</blockquote>
-
-<p><code>configure</code> will try to figure out what system you are running on and where all
-necessary build components are. If you have all prerequisites for building
-installed, it should find everything. If it fails to detect any component
-automatically, it will exit and inform you about the problem. When this
-happens, read more below in <a href="#configureoptions">the <code>configure</code> options</a>.</p>
-
-<p>Some examples:</p>
-
-<blockquote>
-  <p><strong>Windows 32bit build with freetype specified:</strong> <br />
- <code>bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-
-bits=32</code></p>
-
-<p><strong>Debug 64bit Build:</strong> <br />
- <code>bash ./configure --enable-debug --with-target-bits=64</code></p>
-</blockquote>
-
-<p><a name="configureoptions"></a></p>
-
-<h4>Configure Options</h4>
-
-<p>Complete details on all the OpenJDK <code>configure</code> options can be seen with:</p>
-
-<blockquote>
-  <p><strong><code>bash ./configure --help=short</code></strong></p>
-</blockquote>
-
-<p>Use <code>-help</code> to see all the <code>configure</code> options available. You can generate any
-number of different configurations, e.g. debug, release, 32, 64, etc.</p>
-
-<p>Some of the more commonly used <code>configure</code> options are:</p>
-
-<blockquote>
-  <p><strong><code>--enable-debug</code></strong> <br />
- set the debug level to fastdebug (this is a shorthand for <code>--with-debug-
-   level=fastdebug</code>)</p>
-</blockquote>
-
-<p><a name="alsa"></a></p>
-
-<blockquote>
-  <p><strong><code>--with-alsa=</code></strong><em>path</em> <br />
- select the location of the Advanced Linux Sound Architecture (ALSA)</p>
-
-<p>Version 0.9.1 or newer of the ALSA files are required for building the
-   OpenJDK on Linux. These Linux files are usually available from an "alsa" of
-   "libasound" development package, and it's highly recommended that you try
-   and use the package provided by the particular version of Linux that you are
-   using.</p>
-
-<p><strong><code>--with-boot-jdk=</code></strong><em>path</em> <br />
- select the <a href="#bootjdk">Bootstrap JDK</a></p>
-
-<p><strong><code>--with-boot-jdk-jvmargs=</code></strong>"<em>args</em>" <br />
- provide the JVM options to be used to run the <a href="#bootjdk">Bootstrap JDK</a></p>
-
-<p><strong><code>--with-cacerts=</code></strong><em>path</em> <br />
- select the path to the cacerts file.</p>
-
-<p>See <a href="http://en.wikipedia.org/wiki/
-   Certificate_Authority">Certificate Authority on Wikipedia</a> for a better understanding of the Certificate
-   Authority (CA). A certificates file named "cacerts" represents a system-wide
-   keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts"
-   file contains root CA certificates from several public CAs (e.g., VeriSign,
-   Thawte, and Baltimore). The source contain a cacerts file without CA root
-   certificates. Formal JDK builders will need to secure permission from each
-   public CA and include the certificates into their own custom cacerts file.
-   Failure to provide a populated cacerts file will result in verification
-   errors of a certificate chain during runtime. By default an empty cacerts
-   file is provided and that should be fine for most JDK developers.</p>
-</blockquote>
-
-<p><a name="cups"></a></p>
-
-<blockquote>
-  <p><strong><code>--with-cups=</code></strong><em>path</em> <br />
- select the CUPS install location</p>
-
-<p>The Common UNIX Printing System (CUPS) Headers are required for building the
-   OpenJDK on Solaris and Linux. The Solaris header files can be obtained by
-   installing the package <strong>print/cups</strong>.</p>
-
-<p>The CUPS header files can always be downloaded from
-   <a href="http://www.cups.org">www.cups.org</a>.</p>
-
-<p><strong><code>--with-cups-include=</code></strong><em>path</em> <br />
- select the CUPS include directory location</p>
-
-<p><strong><code>--with-debug-level=</code></strong><em>level</em> <br />
- select the debug information level of release, fastdebug, or slowdebug</p>
-
-<p><strong><code>--with-dev-kit=</code></strong><em>path</em> <br />
- select location of the compiler install or developer install location</p>
-</blockquote>
-
-<p><a name="freetype"></a></p>
-
-<blockquote>
-  <p><strong><code>--with-freetype=</code></strong><em>path</em> <br />
- select the freetype files to use.</p>
-
-<p>Expecting the freetype libraries under <code>lib/</code> and the headers under
-   <code>include/</code>.</p>
-
-<p>Version 2.3 or newer of FreeType is required. On Unix systems required files
-   can be available as part of your distribution (while you still may need to
-   upgrade them). Note that you need development version of package that
-   includes both the FreeType library and header files.</p>
-
-<p>You can always download latest FreeType version from the <a href="http://www.freetype.org">FreeType
-   website</a>. Building the freetype 2 libraries from
-   scratch is also possible, however on Windows refer to the <a href="http://freetype.freedesktop.org/wiki/FreeType_DLL">Windows FreeType
-   DLL build instructions</a>.</p>
-
-<p>Note that by default FreeType is built with byte code hinting support
-   disabled due to licensing restrictions. In this case, text appearance and
-   metrics are expected to differ from Sun's official JDK build. See the
-   <a href="http://freetype.sourceforge.net/freetype2">SourceForge FreeType2 Home Page</a>
-   for more information.</p>
-
-<p><strong><code>--with-import-hotspot=</code></strong><em>path</em> <br />
- select the location to find hotspot binaries from a previous build to avoid
-   building hotspot</p>
-
-<p><strong><code>--with-target-bits=</code></strong><em>arg</em> <br />
- select 32 or 64 bit build</p>
-
-<p><strong><code>--with-jvm-variants=</code></strong><em>variants</em> <br />
- select the JVM variants to build from, comma separated list that can
-   include: server, client, kernel, zero and zeroshark</p>
-
-<p><strong><code>--with-memory-size=</code></strong><em>size</em> <br />
- select the RAM size that GNU make will think this system has</p>
-
-<p><strong><code>--with-msvcr-dll=</code></strong><em>path</em> <br />
- select the <code>msvcr100.dll</code> file to include in the Windows builds (C/C++
-   runtime library for Visual Studio).</p>
-
-<p>This is usually picked up automatically from the redist directories of
-   Visual Studio 2013.</p>
-
-<p><strong><code>--with-num-cores=</code></strong><em>cores</em> <br />
- select the number of cores to use (processor count or CPU count)</p>
-</blockquote>
-
-<p><a name="xrender"></a></p>
-
-<blockquote>
-  <p><strong><code>--with-x=</code></strong><em>path</em> <br />
- select the location of the X11 and xrender files.</p>
-
-<p>The XRender Extension Headers are required for building the OpenJDK on
-   Solaris and Linux. The Linux header files are usually available from a
-   "Xrender" development package, it's recommended that you try and use the
-   package provided by the particular distribution of Linux that you are using.
-   The Solaris XRender header files is included with the other X11 header files
-   in the package <strong>SFWxwinc</strong> on new enough versions of Solaris and will be
-   installed in <code>/usr/X11/include/X11/extensions/Xrender.h</code> or
-   <code>/usr/openwin/share/include/X11/extensions/Xrender.h</code></p>
-</blockquote>
-
-<hr />
-
-<p><a name="make"></a></p>
-
-<h3>Make</h3>
-
-<p>The basic invocation of the <code>make</code> utility looks like:</p>
-
-<blockquote>
-  <p><strong><code>make all</code></strong></p>
-</blockquote>
-
-<p>This will start the build to the output directory containing the
-"configuration" that was created by the <code>configure</code> script. Run <code>make help</code> for
-more information on the available targets.</p>
-
-<p>There are some of the make targets that are of general interest:</p>
-
-<blockquote>
-  <p><em>empty</em> <br />
- build everything but no images</p>
-
-<p><strong><code>all</code></strong> <br />
- build everything including images</p>
-
-<p><strong><code>all-conf</code></strong> <br />
- build all configurations</p>
-
-<p><strong><code>images</code></strong> <br />
- create complete j2sdk and j2re images</p>
-
-<p><strong><code>install</code></strong> <br />
- install the generated images locally, typically in <code>/usr/local</code></p>
-
-<p><strong><code>clean</code></strong> <br />
- remove all files generated by make, but not those generated by <code>configure</code></p>
-
-<p><strong><code>dist-clean</code></strong> <br />
- remove all files generated by both and <code>configure</code> (basically killing the
-   configuration)</p>
-
-<p><strong><code>help</code></strong> <br />
- give some help on using <code>make</code>, including some interesting make targets</p>
-</blockquote>
-
-<hr />
-
-<p><a name="testing"></a></p>
-
-<h2>Testing</h2>
-
-<p>When the build is completed, you should see the generated binaries and
-associated files in the <code>j2sdk-image</code> directory in the output directory. In
-particular, the <code>build/*/images/j2sdk-image/bin</code> directory should contain
-executables for the OpenJDK tools and utilities for that configuration. The
-testing tool <code>jtreg</code> will be needed and can be found at: <a href="http://openjdk.java.net/jtreg/">the jtreg
-site</a>. The provided regression tests in the
-repositories can be run with the command:</p>
-
-<blockquote>
-  <p><strong><code>cd test &amp;&amp; make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all</code></strong></p>
-</blockquote>
-
-<hr />
-
-<p><a name="hints"></a></p>
-
-<h2>Appendix A: Hints and Tips</h2>
-
-<p><a name="faq"></a></p>
-
-<h3>FAQ</h3>
-
-<p><strong>Q:</strong> The <code>generated-configure.sh</code> file looks horrible! How are you going to
-edit it? <br />
-<strong>A:</strong> The <code>generated-configure.sh</code> file is generated (think "compiled") by the
-autoconf tools. The source code is in <code>configure.ac</code> and various .m4 files in
-common/autoconf, which are much more readable.</p>
-
-<p><strong>Q:</strong> Why is the <code>generated-configure.sh</code> file checked in, if it is 
-generated? <br />
-<strong>A:</strong> If it was not generated, every user would need to have the autoconf
-tools installed, and re-generate the <code>configure</code> file as the first step. Our
-goal is to minimize the work needed to be done by the user to start building
-OpenJDK, and to minimize the number of external dependencies required.</p>
-
-<p><strong>Q:</strong> Do you require a specific version of autoconf for regenerating
-<code>generated-configure.sh</code>? <br />
-<strong>A:</strong> Yes, version 2.69 is required and should be easy enough to aquire on all
-supported operating systems. The reason for this is to avoid large spurious
-changes in <code>generated-configure.sh</code>.</p>
-
-<p><strong>Q:</strong> How do you regenerate <code>generated-configure.sh</code> after making changes to
-the input files? <br />
-<strong>A:</strong> Regnerating <code>generated-configure.sh</code> should always be done using the
-script <code>common/autoconf/autogen.sh</code> to ensure that the correct files get
-updated. This script should also be run after mercurial tries to merge
-<code>generated-configure.sh</code> as a merge of the generated file is not guaranteed to
-be correct.</p>
-
-<p><strong>Q:</strong> What are the files in <code>common/makefiles/support/*</code> for? They look like
-gibberish. <br />
-<strong>A:</strong> They are a somewhat ugly hack to compensate for command line length
-limitations on certain platforms (Windows, Solaris). Due to a combination of
-limitations in make and the shell, command lines containing too many files will
-not work properly. These helper files are part of an elaborate hack that will
-compress the command line in the makefile and then uncompress it safely. We're
-not proud of it, but it does fix the problem. If you have any better
-suggestions, we're all ears! :-)</p>
-
-<p><strong>Q:</strong> I want to see the output of the commands that make runs, like in the old
-build. How do I do that? <br />
-<strong>A:</strong> You specify the <code>LOG</code> variable to make. There are several log levels:</p>
-
-<ul>
-<li><strong><code>warn</code></strong> -- Default and very quiet.</li>
-<li><strong><code>info</code></strong> -- Shows more progress information than warn.</li>
-<li><strong><code>debug</code></strong> -- Echos all command lines and prints all macro calls for
-compilation definitions.</li>
-<li><strong><code>trace</code></strong> -- Echos all $(shell) command lines as well.</li>
-</ul>
-
-<p><strong>Q:</strong> When do I have to re-run <code>configure</code>? <br />
-<strong>A:</strong> Normally you will run <code>configure</code> only once for creating a
-configuration. You need to re-run configuration only if you want to change any
-configuration options, or if you pull down changes to the <code>configure</code> script.</p>
-
-<p><strong>Q:</strong> I have added a new source file. Do I need to modify the makefiles? <br />
-<strong>A:</strong> Normally, no. If you want to create e.g. a new native library, you will
-need to modify the makefiles. But for normal file additions or removals, no
-changes are needed. There are certan exceptions for some native libraries where
-the source files are spread over many directories which also contain sources
-for other libraries. In these cases it was simply easier to create include
-lists rather than excludes.</p>
-
-<p><strong>Q:</strong> When I run <code>configure --help</code>, I see many strange options, like
-<code>--dvidir</code>. What is this? <br />
-<strong>A:</strong> Configure provides a slew of options by default, to all projects that
-use autoconf. Most of them are not used in OpenJDK, so you can safely ignore
-them. To list only OpenJDK specific features, use <code>configure --help=short</code>
-instead.</p>
-
-<p><strong>Q:</strong> <code>configure</code> provides OpenJDK-specific features such as <code>--with-
-builddeps-server</code> that are not described in this document. What about those? <br />
-<strong>A:</strong> Try them out if you like! But be aware that most of these are
-experimental features. Many of them don't do anything at all at the moment; the
-option is just a placeholder. Others depend on pieces of code or infrastructure
-that is currently not ready for prime time.</p>
-
-<p><strong>Q:</strong> How will you make sure you don't break anything? <br />
-<strong>A:</strong> We have a script that compares the result of the new build system with
-the result of the old. For most part, we aim for (and achieve) byte-by-byte
-identical output. There are however technical issues with e.g. native binaries,
-which might differ in a byte-by-byte comparison, even when building twice with
-the old build system. For these, we compare relevant aspects (e.g. the symbol
-table and file size). Note that we still don't have 100% equivalence, but we're
-close.</p>
-
-<p><strong>Q:</strong> I noticed this thing X in the build that looks very broken by design.
-Why don't you fix it? <br />
-<strong>A:</strong> Our goal is to produce a build output that is as close as technically
-possible to the old build output. If things were weird in the old build, they
-will be weird in the new build. Often, things were weird before due to
-obscurity, but in the new build system the weird stuff comes up to the surface.
-The plan is to attack these things at a later stage, after the new build system
-is established.</p>
-
-<p><strong>Q:</strong> The code in the new build system is not that well-structured. Will you
-fix this? <br />
-<strong>A:</strong> Yes! The new build system has grown bit by bit as we converted the old
-system. When all of the old build system is converted, we can take a step back
-and clean up the structure of the new build system. Some of this we plan to do
-before replacing the old build system and some will need to wait until after.</p>
-
-<p><strong>Q:</strong> Is anything able to use the results of the new build's default make
-target? <br />
-<strong>A:</strong> Yes, this is the minimal (or roughly minimal) set of compiled output
-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. The packaging stuff that is part of the <code>images</code> target is not needed for
-a normal developer who wants to test his new code. Even if it's quite fast,
-it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-)
-(Or, well, at least single-digit seconds...)</p>
-
-<p><strong>Q:</strong> I usually set a specific environment variable when building, but I can't
-find the equivalent in the new build. What should I do? <br />
-<strong>A:</strong> It might very well be that we have neglected to add support for an
-option that was actually used from outside the build system. Email us and we
-will add support for it!</p>
-
-<p><a name="performance"></a></p>
-
-<h3>Build Performance Tips</h3>
-
-<p>Building OpenJDK 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><strong><code>--with-num-cores</code></strong> -- number of cores in the build system, e.g.
-<code>--with-num-cores=8</code></li>
-<li><strong><code>--with-memory-size</code></strong> -- memory (in MB) available in the build system,
-e.g. <code>--with-memory-size=1024</code></li>
-</ul>
-
-<p>It might also be necessary to specify the JVM arguments passed to the Bootstrap
-JDK, using e.g. <code>--with-boot-jdk-jvmargs="-Xmx8G -enableassertions"</code>. Doing
-this will override the default JVM arguments passed to the Bootstrap JDK.</p>
-
-<p>One of the top goals of the new build system is to improve the build
-performance and decrease the time needed to build. This will soon also apply to
-the java compilation when the Smart Javac wrapper is fully supported.</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>
-
-<h4>Building with ccache</h4>
-
-<p>The OpenJDK 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>
-
-<h4>Building on local disk</h4>
-
-<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. The performance penalty is
-extremely high for building on a network share, close to unusable.</p>
-
-<h4>Building only one JVM</h4>
-
-<p>The old build builds multiple JVMs on 32-bit systems (client and server; and on
-Windows kernel as well). In the new build we have changed this default to only
-build server when it's available. This improves build times for those not
-interested in multiple JVMs. To mimic the old behavior on platforms that
-support it, use <code>--with-jvm-variants=client,server</code>.</p>
-
-<h4>Selecting the number of cores to build on</h4>
-
-<p>By default, <code>configure</code> will analyze your machine and run the make process in
-parallel with as many threads as you have cores. This behavior can be
-overridden, either "permanently" (on a <code>configure</code> basis) using
-<code>--with-num-cores=N</code> or for a single build only (on a make basis), using
-<code>make JOBS=N</code>.</p>
-
-<p>If you want to make a slower build just this time, to save some CPU power for
-other processes, you can run e.g. <code>make JOBS=2</code>. This will force the makefiles
-to only run 2 parallel processes, or even <code>make JOBS=1</code> which will disable
-parallelism.</p>
-
-<p>If you want to have it the other way round, namely having slow builds default
-and override with fast if you're impatient, you should call <code>configure</code> with
-<code>--with-num-cores=2</code>, making 2 the default. If you want to run with more cores,
-run <code>make JOBS=8</code></p>
-
-<p><a name="troubleshooting"></a></p>
-
-<h3>Troubleshooting</h3>
-
-<h4>Solving build problems</h4>
-
-<p>If the build fails (and it's not due to a compilation error in a source file
-you've changed), the first thing you should do is to re-run the build with more
-verbosity. Do this by adding <code>LOG=debug</code> to your make command line.</p>
-
-<p>The build log (with both stdout and stderr intermingled, basically the same as
-you see on your console) can be found as <code>build.log</code> in your build directory.</p>
-
-<p>You can ask for help on build problems with the new build system on either the
-<a href="http://mail.openjdk.java.net/mailman/listinfo/build-dev">build-dev</a> or the
-<a href="http://mail.openjdk.java.net/mailman/listinfo/build-infra-dev">build-infra-dev</a>
-mailing lists. Please include the relevant parts of the build log.</p>
-
-<p>A build can fail for any number of reasons. Most failures are a result of
-trying to build in an environment in which all the pre-build requirements have
-not been met. The first step in troubleshooting a build failure is to recheck
-that you have satisfied all the pre-build requirements for your platform.
-Scanning the <code>configure</code> log is a good first step, making sure that what it
-found makes sense for your system. Look for strange error messages or any
-difficulties that <code>configure</code> had in finding things.</p>
-
-<p>Some of the more common problems with builds are briefly described below, with
-suggestions for remedies.</p>
-
-<ul>
-<li><p><strong>Corrupted Bundles on Windows:</strong> <br />
-Some virus scanning software has been known to corrupt the downloading of
-zip bundles. It may be necessary to disable the 'on access' or 'real time'
-virus scanning features to prevent this corruption. This type of 'real time'
-virus scanning can also slow down the build process significantly.
-Temporarily disabling the feature, or excluding the build output directory
-may be necessary to get correct and faster builds.</p></li>
-<li><p><strong>Slow Builds:</strong> <br />
-If your build machine seems to be overloaded from too many simultaneous C++
-compiles, try setting the <code>JOBS=1</code> on the <code>make</code> command line. Then try
-increasing the count slowly to an acceptable level for your system. Also:</p>
-
-<p>Creating the javadocs can be very slow, if you are running javadoc, consider
-skipping that step.</p>
-
-<p>Faster CPUs, more RAM, and a faster DISK usually helps. The VM build tends
-to be CPU intensive (many C++ compiles), and the rest of the JDK will often
-be disk intensive.</p>
-
-<p>Faster compiles are possible using a tool called
-<a href="http://ccache.samba.org/">ccache</a>.</p></li>
-<li><p><strong>File time issues:</strong> <br />
-If you see warnings that refer to file time stamps, e.g.</p>
-
-<blockquote>
-  <p><em>Warning message:</em> <code>File 'xxx' has modification time in the future.</code> <br />
-<em>Warning message:</em> <code>Clock skew detected. Your build may be incomplete.</code></p>
-</blockquote>
-
-<p>These warnings can occur when the clock on the build machine is out of sync
-with the timestamps on the source files. Other errors, apparently unrelated
-but in fact caused by the clock skew, can occur along with the clock skew
-warnings. These secondary errors may tend to obscure the fact that the true
-root cause of the problem is an out-of-sync clock.</p>
-
-<p>If you see these warnings, reset the clock on the build machine, run
-"<code>gmake clobber</code>" or delete the directory containing the build output, and
-restart the build from the beginning.</p></li>
-<li><p><strong>Error message: <code>Trouble writing out table to disk</code></strong> <br />
-Increase the amount of swap space on your build machine. This could be
-caused by overloading the system and it may be necessary to use:</p>
-
-<blockquote>
-  <p><code>make JOBS=1</code></p>
-</blockquote>
-
-<p>to reduce the load on the system.</p></li>
-<li><p><strong>Error Message: <code>libstdc++ not found</code>:</strong> <br />
-This is caused by a missing libstdc++.a library. This is installed as part
-of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit
-Linux versions (e.g. Fedora) only install the 64-bit version of the
-libstdc++ package. Various parts of the JDK build require a static link of
-the C++ runtime libraries to allow for maximum portability of the built
-images.</p></li>
-<li><p><strong>Linux Error Message: <code>cannot restore segment prot after reloc</code></strong> <br />
-This is probably an issue with SELinux (See <a href="http://en.wikipedia.org/wiki/SELinux">SELinux on
-Wikipedia</a>). Parts of the VM is built
-without the <code>-fPIC</code> for performance reasons.</p>
-
-<p>To completely disable SELinux:</p>
-
-<ol>
-<li><code>$ su root</code></li>
-<li><code># system-config-securitylevel</code></li>
-<li><code>In the window that appears, select the SELinux tab</code></li>
-<li><code>Disable SELinux</code></li>
-</ol>
-
-<p>Alternatively, instead of completely disabling it you could disable just
-this one check.</p>
-
-<ol>
-<li>Select System->Administration->SELinux Management</li>
-<li>In the SELinux Management Tool which appears, select "Boolean" from the
-menu on the left</li>
-<li>Expand the "Memory Protection" group</li>
-<li>Check the first item, labeled "Allow all unconfined executables to use
-libraries requiring text relocation ..."</li>
-</ol></li>
-<li><p><strong>Windows Error Messages:</strong> <br />
-<code>*** fatal error - couldn't allocate heap, ...</code> <br />
-<code>rm fails with "Directory not empty"</code> <br />
-<code>unzip fails with "cannot create ... Permission denied"</code> <br />
-<code>unzip fails with "cannot create ... Error 50"</code></p>
-
-<p>The CYGWIN software can conflict with other non-CYGWIN software. See the
-CYGWIN FAQ section on <a href="http://cygwin.com/faq/faq.using.html#faq.using.bloda">BLODA (applications that interfere with
-CYGWIN)</a>.</p></li>
-<li><p><strong>Windows Error Message: <code>spawn failed</code></strong> <br />
-Try rebooting the system, or there could be some kind of issue with the disk
-or disk partition being used. Sometimes it comes with a "Permission Denied"
-message.</p></li>
-</ul>
-
-<hr />
-
-<p><a name="gmake"></a></p>
-
-<h2>Appendix B: GNU make</h2>
-
-<p>The Makefiles in the OpenJDK are only valid when used with the GNU version of
-the utility command <code>make</code> (usually called <code>gmake</code> on Solaris). A few notes
-about using GNU make:</p>
-
-<ul>
-<li>You need GNU make version 3.81 or newer. On Windows 4.0 or newer is
-recommended. If the GNU make utility on your systems is not of a suitable
-version, see "<a href="#buildgmake">Building GNU make</a>".</li>
-<li>Place the location of the GNU make binary in the <code>PATH</code>.</li>
-<li><strong>Solaris:</strong> Do NOT use <code>/usr/bin/make</code> on Solaris. If your Solaris system
-has the software from the Solaris Developer Companion CD installed, you
-should try and use <code>/usr/bin/gmake</code> or <code>/usr/gnu/bin/make</code>.</li>
-<li><strong>Windows:</strong> Make sure you start your build inside a bash shell.</li>
-<li><strong>Mac OS X:</strong> The XCode "command line tools" must be installed on your Mac.</li>
-</ul>
-
-<p>Information on GNU make, and access to ftp download sites, are available on the
-<a href="http://www.gnu.org/software/make/make.html">GNU make web site </a>. The latest
-source to GNU make is available at
-<a href="http://ftp.gnu.org/pub/gnu/make/">ftp.gnu.org/pub/gnu/make/</a>.</p>
-
-<p><a name="buildgmake"></a></p>
-
-<h3>Building GNU make</h3>
-
-<p>First step is to get the GNU make 3.81 or newer source from
-<a href="http://ftp.gnu.org/pub/gnu/make/">ftp.gnu.org/pub/gnu/make/</a>. Building is a
-little different depending on the OS but is basically done with:</p>
-
-<pre><code>  bash ./configure
-  make
-</code></pre>
-
-<hr />
-
-<p><a name="buildenvironments"></a></p>
-
-<h2>Appendix C: Build Environments</h2>
-
-<h3>Minimum Build Environments</h3>
-
-<p>This file often describes specific requirements for what we call the "minimum
-build environments" (MBE) for this specific release of the JDK. What is listed
-below is what the Oracle Release Engineering Team will use to build the Oracle
-JDK product. Building with the MBE will hopefully generate the most compatible
-bits that install on, and run correctly on, the most variations of the same
-base OS and hardware architecture. In some cases, these represent what is often
-called the least common denominator, but each Operating System has different
-aspects to it.</p>
-
-<p>In all cases, the Bootstrap JDK version minimum is critical, we cannot
-guarantee builds will work with older Bootstrap JDK's. Also in all cases, more
-RAM and more processors is better, the minimums listed below are simply
-recommendations.</p>
-
-<p>With Solaris and Mac OS X, the version listed below is the oldest release we
-can guarantee builds and works, and the specific version of the compilers used
-could be critical.</p>
-
-<p>With Windows the critical aspect is the Visual Studio compiler used, which due
-to it's runtime, generally dictates what Windows systems can do the builds and
-where the resulting bits can be used.</p>
-
-<p><strong>NOTE: We expect a change here off these older Windows OS releases and to a
-'less older' one, probably Windows 2008R2 X64.</strong></p>
-
-<p>With Linux, it was just a matter of picking a stable distribution that is a
-good representative for Linux in general.</p>
-
-<p>It is understood that most developers will NOT be using these specific
-versions, and in fact creating these specific versions may be difficult due to
-the age of some of this software. It is expected that developers are more often
-using the more recent releases and distributions of these operating systems.</p>
-
-<p>Compilation problems with newer or different C/C++ compilers is a common
-problem. Similarly, compilation problems related to changes to the
-<code>/usr/include</code> or system header files is also a common problem with older,
-newer, or unreleased OS versions. Please report these types of problems as bugs
-so that they can be dealt with accordingly.</p>
-
-<blockquote>
-  <p><table border="1">
-     <thead>
-       <tr>
-         <th>Base OS and Architecture</th>
-         <th>OS</th>
-         <th>C/C++ Compiler</th>
-         <th>Bootstrap JDK</th>
-         <th>Processors</th>
-         <th>RAM Minimum</th>
-         <th>DISK Needs</th>
-       </tr>
-     </thead>
-     <tbody>
-       <tr>
-         <td>Linux X86 (32-bit) and X64 (64-bit)</td>
-         <td>Oracle Enterprise Linux 6.4</td>
-         <td>gcc 4.9.2 </td>
-         <td>JDK 8</td>
-         <td>2 or more</td>
-         <td>1 GB</td>
-         <td>6 GB</td>
-       </tr>
-       <tr>
-         <td>Solaris SPARCV9 (64-bit)</td>
-         <td>Solaris 11 Update 1</td>
-         <td>Studio 12 Update 4 + patches</td>
-         <td>JDK 8</td>
-         <td>4 or more</td>
-         <td>4 GB</td>
-         <td>8 GB</td>
-       </tr>
-       <tr>
-         <td>Solaris X64 (64-bit)</td>
-         <td>Solaris 11 Update 1</td>
-         <td>Studio 12 Update 4 + patches</td>
-         <td>JDK 8</td>
-         <td>4 or more</td>
-         <td>4 GB</td>
-         <td>8 GB</td>
-       </tr>
-       <tr>
-         <td>Windows X86 (32-bit)</td>
-         <td>Windows Server 2012 R2 x64</td>
-         <td>Microsoft Visual Studio C++ 2013 Professional Edition</td>
-         <td>JDK 8</td>
-         <td>2 or more</td>
-         <td>2 GB</td>
-         <td>6 GB</td>
-       </tr>
-       <tr>
-         <td>Windows X64 (64-bit)</td>
-         <td>Windows Server 2012 R2 x64</td>
-         <td>Microsoft Visual Studio C++ 2013 Professional Edition</td>
-         <td>JDK 8</td>
-         <td>2 or more</td>
-         <td>2 GB</td>
-         <td>6 GB</td>
-       </tr>
-       <tr>
-         <td>Mac OS X X64 (64-bit)</td>
-         <td>Mac OS X 10.9 "Mavericks"</td>
-         <td>Xcode 6.3 or newer</td>
-         <td>JDK 8</td>
-         <td>2 or more</td>
-         <td>4 GB</td>
-         <td>6 GB</td>
-       </tr>
-     </tbody>
-   </table></p>
-</blockquote>
-
-<hr />
-
-<p><a name="SDBE"></a></p>
-
-<h3>Specific Developer Build Environments</h3>
-
-<p>We won't be listing all the possible environments, but we will try to provide
-what information we have available to us.</p>
-
-<p><strong>NOTE: The community can help out by updating this part of the document.</strong></p>
-
-<h4>Fedora</h4>
-
-<p>After installing the latest <a href="http://fedoraproject.org">Fedora</a> you need to
-install several build dependencies. The simplest way to do it is to execute the
-following commands as user <code>root</code>:</p>
-
-<pre><code>  yum-builddep java-1.7.0-openjdk
-  yum install gcc gcc-c++
-</code></pre>
-
-<p>In addition, it's necessary to set a few environment variables for the build:</p>
-
-<pre><code>  export LANG=C
-  export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
-</code></pre>
-
-<h4>CentOS 5.5</h4>
-
-<p>After installing <a href="http://www.centos.org/">CentOS 5.5</a> you need to make sure you
-have the following Development bundles installed:</p>
-
-<ul>
-<li>Development Libraries</li>
-<li>Development Tools</li>
-<li>Java Development</li>
-<li>X Software Development (Including XFree86-devel)</li>
-</ul>
-
-<p>Plus the following packages:</p>
-
-<ul>
-<li>cups devel: Cups Development Package</li>
-<li>alsa devel: Alsa Development Package</li>
-<li>Xi devel: libXi.so Development Package</li>
-</ul>
-
-<p>The freetype 2.3 packages don't seem to be available, but the freetype 2.3
-sources can be downloaded, built, and installed easily enough from <a href="http://downloads.sourceforge.net/freetype">the
-freetype site</a>. Build and install
-with something like:</p>
-
-<pre><code>  bash ./configure
-  make
-  sudo -u root make install
-</code></pre>
-
-<p>Mercurial packages could not be found easily, but a Google search should find
-ones, and they usually include Python if it's needed.</p>
-
-<h4>Debian 5.0 (Lenny)</h4>
-
-<p>After installing <a href="http://debian.org">Debian</a> 5 you need to install several
-build dependencies. The simplest way to install the build dependencies is to
-execute the following commands as user <code>root</code>:</p>
-
-<pre><code>  aptitude build-dep openjdk-7
-  aptitude install openjdk-7-jdk libmotif-dev
-</code></pre>
-
-<p>In addition, it's necessary to set a few environment variables for the build:</p>
-
-<pre><code>  export LANG=C
-  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-</code></pre>
-
-<h4>Ubuntu 12.04</h4>
-
-<p>After installing <a href="http://ubuntu.org">Ubuntu</a> 12.04 you need to install several
-build dependencies. The simplest way to do it is to execute the following
-commands:</p>
-
-<pre><code>  sudo aptitude build-dep openjdk-7
-  sudo aptitude install openjdk-7-jdk
-</code></pre>
-
-<p>In addition, it's necessary to set a few environment variables for the build:</p>
-
-<pre><code>  export LANG=C
-  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-</code></pre>
-
-<h4>OpenSUSE 11.1</h4>
-
-<p>After installing <a href="http://opensuse.org">OpenSUSE</a> 11.1 you need to install
-several build dependencies. The simplest way to install the build dependencies
-is to execute the following commands:</p>
-
-<pre><code>  sudo zypper source-install -d java-1_7_0-openjdk
-  sudo zypper install make
-</code></pre>
-
-<p>In addition, it is necessary to set a few environment variables for the build:</p>
-
-<pre><code>  export LANG=C
-  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
-</code></pre>
-
-<p>Finally, you need to unset the <code>JAVA_HOME</code> environment variable:</p>
-
-<pre><code>  export -n JAVA_HOME`
-</code></pre>
-
-<h4>Mandriva Linux One 2009 Spring</h4>
-
-<p>After installing <a href="http://mandriva.org">Mandriva</a> Linux One 2009 Spring you need
-to install several build dependencies. The simplest way to install the build
-dependencies is to execute the following commands as user <code>root</code>:</p>
-
-<pre><code>  urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
-    libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
-    libxtst6-devel libxi-devel
-</code></pre>
-
-<p>In addition, it is necessary to set a few environment variables for the build:</p>
-
-<pre><code>  export LANG=C
-  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
-</code></pre>
-
-<h4>OpenSolaris 2009.06</h4>
-
-<p>After installing <a href="http://opensolaris.org">OpenSolaris</a> 2009.06 you need to
-install several build dependencies. The simplest way to install the build
-dependencies is to execute the following commands:</p>
-
-<pre><code>  pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
-    SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
-</code></pre>
-
-<p>In addition, it is necessary to set a few environment variables for the build:</p>
-
-<pre><code>  export LANG=C
-  export PATH="/opt/SunStudioExpress/bin:${PATH}"
-</code></pre>
-
-<hr />
-
-<p>End of the OpenJDK build README document.</p>
-
-<p>Please come again!</p>
-  </body>
-</html>
diff --git a/README-builds.md b/README-builds.md
deleted file mode 100644
index c6907cd..0000000
--- a/README-builds.md
+++ /dev/null
@@ -1,1285 +0,0 @@
-![OpenJDK](http://openjdk.java.net/images/openjdk.png)
-# OpenJDK Build README
-
-*****
-
-<a name="introduction"></a>
-## Introduction
-
-This README file contains build instructions for the
-[OpenJDK](http://openjdk.java.net). Building the source code for the OpenJDK
-requires a certain degree of technical expertise.
-
-### !!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!
-
-Some Headlines:
-
- * The build is now a "`configure && make`" style build
- * Any GNU make 3.81 or newer should work, except on Windows where 4.0 or newer
-   is recommended.
- * The build should scale, i.e. more processors should cause the build to be
-   done in less wall-clock time
- * Nested or recursive make invocations have been significantly reduced,
-   as has the total fork/exec or spawning of sub processes during the build
- * Windows MKS usage is no longer supported
- * Windows Visual Studio `vsvars*.bat` and `vcvars*.bat` files are run
-   automatically
- * Ant is no longer used when building the OpenJDK
- * Use of ALT_* environment variables for configuring the build is no longer
-   supported
-
-*****
-
-## Contents
-
-  * [Introduction](#introduction)
-  * [Use of Mercurial](#hg)
-    * [Getting the Source](#get_source)
-    * [Repositories](#repositories)
-  * [Building](#building)
-    * [System Setup](#setup)
-      * [Linux](#linux)
-      * [Solaris](#solaris)
-      * [Mac OS X](#macosx)
-      * [Windows](#windows)
-    * [Configure](#configure)
-    * [Make](#make)
-  * [Testing](#testing)
-
-*****
-
-  * [Appendix A: Hints and Tips](#hints)
-    * [FAQ](#faq)
-    * [Build Performance Tips](#performance)
-    * [Troubleshooting](#troubleshooting)
-  * [Appendix B: GNU Make Information](#gmake)
-  * [Appendix C: Build Environments](#buildenvironments)
-
-*****
-
-<a name="hg"></a>
-## Use of Mercurial
-
-The OpenJDK sources are maintained with the revision control system
-[Mercurial](http://mercurial.selenic.com/wiki/Mercurial). If you are new to
-Mercurial, please see the [Beginner Guides](http://mercurial.selenic.com/wiki/
-BeginnersGuides) or refer to the [Mercurial Book](http://hgbook.red-bean.com/).
-The first few chapters of the book provide an excellent overview of Mercurial,
-what it is and how it works.
-
-For using Mercurial with the OpenJDK refer to the [Developer Guide: Installing
-and Configuring Mercurial](http://openjdk.java.net/guide/
-repositories.html#installConfig) section for more information.
-
-<a name="get_source"></a>
-### Getting the Source
-
-To get the entire set of OpenJDK Mercurial repositories use the script
-`get_source.sh` located in the root repository:
-
-      hg clone http://hg.openjdk.java.net/jdk9/jdk9 YourOpenJDK
-      cd YourOpenJDK
-      bash ./get_source.sh
-
-Once you have all the repositories, keep in mind that each repository is its
-own independent repository. You can also re-run `./get_source.sh` anytime to
-pull over all the latest changesets in all the repositories. This set of
-nested repositories has been given the term "forest" and there are various
-ways to apply the same `hg` command to each of the repositories. For
-example, the script `make/scripts/hgforest.sh` can be used to repeat the
-same `hg` command on every repository, e.g.
-
-      cd YourOpenJDK
-      bash ./make/scripts/hgforest.sh status
-
-<a name="repositories"></a>
-### Repositories
-
-The set of repositories and what they contain:
-
- * **. (root)** contains common configure and makefile logic
- * **hotspot** contains source code and make files for building the OpenJDK
-   Hotspot Virtual Machine
- * **langtools** contains source code for the OpenJDK javac and language tools
- * **jdk** contains source code and make files for building the OpenJDK runtime
-   libraries and misc files
- * **jaxp** contains source code for the OpenJDK JAXP functionality
- * **jaxws** contains source code for the OpenJDK JAX-WS functionality
- * **corba** contains source code for the OpenJDK Corba functionality
- * **nashorn** contains source code for the OpenJDK JavaScript implementation
-
-### Repository Source Guidelines
-
-There are some very basic guidelines:
-
- * Use of whitespace in source files (.java, .c, .h, .cpp, and .hpp files) is
-   restricted. No TABs, no trailing whitespace on lines, and files should not
-   terminate in more than one blank line.
- * Files with execute permissions should not be added to the source
-   repositories.
- * All generated files need to be kept isolated from the files maintained or
-   managed by the source control system. The standard area for generated files
-   is the top level `build/` directory.
- * The default build process should be to build the product and nothing else,
-   in one form, e.g. a product (optimized), debug (non-optimized, -g plus
-   assert logic), or fastdebug (optimized, -g plus assert logic).
- * The `.hgignore` file in each repository must exist and should include
-   `^build/`, `^dist/` and optionally any `nbproject/private` directories. **It
-   should NEVER** include anything in the `src/` or `test/` or any managed
-   directory area of a repository.
- * Directory names and file names should never contain blanks or non-printing
-   characters.
- * Generated source or binary files should NEVER be added to the repository
-   (that includes `javah` output). There are some exceptions to this rule, in
-   particular with some of the generated configure scripts.
- * Files not needed for typical building or testing of the repository should
-   not be added to the repository.
-
-*****
-
-<a name="building"></a>
-## Building
-
-The very first step in building the OpenJDK is making sure the system itself
-has everything it needs to do OpenJDK builds. Once a system is setup, it
-generally doesn't need to be done again.
-
-Building the OpenJDK is now done with running a `configure` script which will
-try and find and verify you have everything you need, followed by running
-`make`, e.g.
-
->  **`bash ./configure`**  
->  **`make all`**
-
-Where possible the `configure` script will attempt to located the various
-components in the default locations or via component specific variable
-settings. When the normal defaults fail or components cannot be found,
-additional `configure` options may be necessary to help `configure` find the
-necessary tools for the build, or you may need to re-visit the setup of your
-system due to missing software packages.
-
-**NOTE:** The `configure` script file does not have execute permissions and
-will need to be explicitly run with `bash`, see the source guidelines.
-
-*****
-
-<a name="setup"></a>
-### System Setup
-
-Before even attempting to use a system to build the OpenJDK there are some very
-basic system setups needed. For all systems:
-
- * Be sure the GNU make utility is version 3.81 (4.0 on windows) or newer, e.g.
-   run "`make -version`"
-
-   <a name="bootjdk"></a>
- * Install a Bootstrap JDK. All OpenJDK builds require access to a previously
-   released JDK called the _bootstrap JDK_ or _boot JDK._ The general rule is
-   that the bootstrap JDK must be an instance of the previous major release of
-   the JDK. In addition, there may be a requirement to use a release at or
-   beyond a particular update level.
-
-   **_Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as
-   the boot JDK, to ensure that JDK 9 dependencies are not introduced into the
-   parts of the system that are built with JDK 8._**
-
-   The JDK 8 binaries can be downloaded from Oracle's [JDK 8 download
-   site](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
-   For build performance reasons it is very important that this bootstrap JDK
-   be made available on the local disk of the machine doing the build. You
-   should add its `bin` directory to the `PATH` environment variable. If
-   `configure` has any issues finding this JDK, you may need to use the
-   `configure` option `--with-boot-jdk`.
-
- * Ensure that GNU make, the Bootstrap JDK, and the compilers are all in your
-   PATH environment variable.
-
-And for specific systems:
-
- * **Linux**
-
-   Install all the software development packages needed including
-   [alsa](#alsa), [freetype](#freetype), [cups](#cups), and
-   [xrender](#xrender). See [specific system packages](#SDBE).
-
- * **Solaris**
-
-   Install all the software development packages needed including [Studio
-   Compilers](#studio), [freetype](#freetype), [cups](#cups), and
-   [xrender](#xrender). See [specific system packages](#SDBE).
-
- * **Windows**
-
-   * Install one of [CYGWIN](#cygwin) or [MinGW/MSYS](#msys)
-   * Install [Visual Studio 2013](#vs2013)
-
- * **Mac OS X**
-
-   Install [XCode 6.3](https://developer.apple.com/xcode/)
-
-<a name="linux"></a>
-#### Linux
-
-With Linux, try and favor the system packages over building your own or getting
-packages from other areas. Most Linux builds should be possible with the
-system's available packages.
-
-Note that some Linux systems have a habit of pre-populating your environment
-variables for you, for example `JAVA_HOME` might get pre-defined for you to
-refer to the JDK installed on your Linux system. You will need to unset
-`JAVA_HOME`. It's a good idea to run `env` and verify the environment variables
-you are getting from the default system settings make sense for building the
-OpenJDK.
-
-<a name="solaris"></a>
-#### Solaris
-
-<a name="studio"></a>
-##### Studio Compilers
-
-At a minimum, the [Studio 12 Update 4 Compilers](http://www.oracle.com/
-technetwork/server-storage/solarisstudio/downloads/index.htm) (containing
-version 5.13 of the C and C++ compilers) is required, including specific
-patches.
-
-The Solaris Studio installation should contain at least these packages:
-
->  <table border="1">
-     <thead>
-       <tr>
-         <td>**Package**</td>
-         <td>**Version**</td>
-       </tr>
-     </thead>
-     <tbody>
-       <tr>
-         <td>developer/solarisstudio-124/backend</td>
-         <td>12.4-1.0.6.0</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/c++</td>
-         <td>12.4-1.0.10.0</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/cc</td>
-         <td>12.4-1.0.4.0</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/library/c++-libs</td>
-         <td>12.4-1.0.10.0</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/library/math-libs</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/library/studio-gccrt</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/studio-common</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/studio-ja</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/studio-legal</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-       <tr>
-         <td>developer/solarisstudio-124/studio-zhCN</td>
-         <td>12.4-1.0.0.1</td>
-       </tr>
-     </tbody>
-   </table>
-
-In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc
-version.
-
-Place the `bin` directory in `PATH`.
-
-The Oracle Solaris Studio Express compilers at: [Oracle Solaris Studio Express
-Download site](http://www.oracle.com/technetwork/server-storage/solarisstudio/
-downloads/index-jsp-142582.html) are also an option, although these compilers
-have not been extensively used yet.
-
-<a name="windows"></a>
-#### Windows
-
-##### Windows Unix Toolkit
-
-Building on Windows requires a Unix-like environment, notably a Unix-like
-shell. There are several such environments available of which
-[Cygwin](http://www.cygwin.com/) and
-[MinGW/MSYS](http://www.mingw.org/wiki/MSYS) are currently supported for the
-OpenJDK build. One of the differences of these systems from standard Windows
-tools is the way they handle Windows path names, particularly path names which
-contain spaces, backslashes as path separators and possibly drive letters.
-Depending on the use case and the specifics of each environment these path
-problems can be solved by a combination of quoting whole paths, translating
-backslashes to forward slashes, escaping backslashes with additional
-backslashes and translating the path names to their ["8.3"
-version](http://en.wikipedia.org/wiki/8.3_filename).
-
-<a name="cygwin"></a>
-###### CYGWIN
-
-CYGWIN is an open source, Linux-like environment which tries to emulate a
-complete POSIX layer on Windows. It tries to be smart about path names and can
-usually handle all kinds of paths if they are correctly quoted or escaped
-although internally it maps drive letters `<drive>:` to a virtual directory
-`/cygdrive/<drive>`.
-
-You can always use the `cygpath` utility to map pathnames with spaces or the
-backslash character into the `C:/` style of pathname (called 'mixed'), e.g.
-`cygpath -s -m "<path>"`.
-
-Note that the use of CYGWIN creates a unique problem with regards to setting
-[`PATH`](#path). Normally on Windows the `PATH` variable contains directories
-separated with the ";" character (Solaris and Linux use ":"). With CYGWIN, it
-uses ":", but that means that paths like "C:/path" cannot be placed in the
-CYGWIN version of `PATH` and instead CYGWIN uses something like
-`/cygdrive/c/path` which CYGWIN understands, but only CYGWIN understands.
-
-The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about
-CYGWIN can be obtained from the CYGWIN website at
-[www.cygwin.com](http://www.cygwin.com).
-
-By default CYGWIN doesn't install all the tools required for building the
-OpenJDK. Along with the default installation, you need to install the following
-tools.
-
->  <table border="1">
-     <thead>
-       <tr>
-         <td>Binary Name</td>
-         <td>Category</td>
-         <td>Package</td>
-         <td>Description</td>
-      </tr>
-     </thead>
-     <tbody>
-       <tr>
-         <td>ar.exe</td>
-         <td>Devel</td>
-         <td>binutils</td>
-         <td>The GNU assembler, linker and binary utilities</td>
-       </tr>
-       <tr>
-         <td>make.exe</td>
-         <td>Devel</td>
-         <td>make</td>
-         <td>The GNU version of the 'make' utility built for CYGWIN</td>
-       </tr>
-       <tr>
-         <td>m4.exe</td>
-         <td>Interpreters</td>
-         <td>m4</td>
-         <td>GNU implementation of the traditional Unix macro processor</td>
-       </tr>
-       <tr>
-         <td>cpio.exe</td>
-         <td>Utils</td>
-         <td>cpio</td>
-         <td>A program to manage archives of files</td>
-       </tr>
-       <tr>
-         <td>gawk.exe</td>
-         <td>Utils</td>
-         <td>awk</td>
-         <td>Pattern-directed scanning and processing language</td>
-       </tr>
-       <tr>
-         <td>file.exe</td>
-         <td>Utils</td>
-         <td>file</td>
-         <td>Determines file type using 'magic' numbers</td>
-       </tr>
-       <tr>
-         <td>zip.exe</td>
-         <td>Archive</td>
-         <td>zip</td>
-         <td>Package and compress (archive) files</td>
-       </tr>
-       <tr>
-         <td>unzip.exe</td>
-         <td>Archive</td>
-         <td>unzip</td>
-         <td>Extract compressed files in a ZIP archive</td>
-       </tr>
-       <tr>
-         <td>free.exe</td>
-         <td>System</td>
-         <td>procps</td>
-         <td>Display amount of free and used memory in the system</td>
-       </tr>
-     </tbody>
-   </table>
-
-Note that the CYGWIN software can conflict with other non-CYGWIN software on
-your Windows system. CYGWIN provides a [FAQ](http://cygwin.com/faq/
-faq.using.html) for known issues and problems, of particular interest is the
-section on [BLODA (applications that interfere with
-CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda).
-
-<a name="msys"></a>
-###### MinGW/MSYS
-
-MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific
-header files and import libraries combined with GNU toolsets that allow one to
-produce native Windows programs that do not rely on any 3rd-party C runtime
-DLLs. MSYS is a supplement to MinGW which allows building applications and
-programs which rely on traditional UNIX tools to be present. Among others this
-includes tools like `bash` and `make`. See [MinGW/MSYS](http://www.mingw.org/
-wiki/MSYS) for more information.
-
-Like Cygwin, MinGW/MSYS can handle different types of path formats. They are
-internally converted to paths with forward slashes and drive letters
-`<drive>:` replaced by a virtual directory `/<drive>`. Additionally, MSYS
-automatically detects binaries compiled for the MSYS environment and feeds them
-with the internal, Unix-style path names. If native Windows applications are
-called from within MSYS programs their path arguments are automatically
-converted back to Windows style path names with drive letters and backslashes
-as path separators. This may cause problems for Windows applications which use
-forward slashes as parameter separator (e.g. `cl /nologo /I`) because MSYS may
-wrongly [replace such parameters by drive letters](http://mingw.org/wiki/
-Posix_path_conversion).
-
-In addition to the tools which will be installed by default, you have to
-manually install the `msys-zip` and `msys-unzip` packages. This can be easily
-done with the MinGW command line installer:
-
-      mingw-get.exe install msys-zip
-      mingw-get.exe install msys-unzip
-
-<a name="vs2013"></a>
-##### Visual Studio 2013 Compilers
-
-The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio
-C++ 2013 (VS2013) Professional Edition or Express compiler. The compiler and
-other tools are expected to reside in the location defined by the variable
-`VS120COMNTOOLS` which is set by the Microsoft Visual Studio installer.
-
-Only the C++ part of VS2013 is needed. Try to let the installation go to the
-default install directory. Always reboot your system after installing VS2013.
-The system environment variable VS120COMNTOOLS should be set in your
-environment.
-
-Make sure that TMP and TEMP are also set in the environment and refer to
-Windows paths that exist, like `C:\temp`, not `/tmp`, not `/cygdrive/c/temp`,
-and not `C:/temp`. `C:\temp` is just an example, it is assumed that this area
-is private to the user, so by default after installs you should see a unique
-user path in these variables.
-
-<a name="macosx"></a>
-#### Mac OS X
-
-Make sure you get the right XCode version.
-
-*****
-
-<a name="configure"></a>
-### Configure
-
-The basic invocation of the `configure` script looks like:
-
->  **`bash ./configure [options]`**
-
-This will create an output directory containing the "configuration" and setup
-an area for the build result. This directory typically looks like:
-
->  **`build/linux-x64-normal-server-release`**
-
-`configure` will try to figure out what system you are running on and where all
-necessary build components are. If you have all prerequisites for building
-installed, it should find everything. If it fails to detect any component
-automatically, it will exit and inform you about the problem. When this
-happens, read more below in [the `configure` options](#configureoptions).
-
-Some examples:
-
->  **Windows 32bit build with freetype specified:**  
->  `bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-
-bits=32`
-
->  **Debug 64bit Build:**  
->  `bash ./configure --enable-debug --with-target-bits=64`
-
-<a name="configureoptions"></a>
-#### Configure Options
-
-Complete details on all the OpenJDK `configure` options can be seen with:
-
->  **`bash ./configure --help=short`**
-
-Use `-help` to see all the `configure` options available. You can generate any
-number of different configurations, e.g. debug, release, 32, 64, etc.
-
-Some of the more commonly used `configure` options are:
-
->  **`--enable-debug`**  
->  set the debug level to fastdebug (this is a shorthand for `--with-debug-
-   level=fastdebug`)
-
-<a name="alsa"></a>
->  **`--with-alsa=`**_path_  
->  select the location of the Advanced Linux Sound Architecture (ALSA)
-
->  Version 0.9.1 or newer of the ALSA files are required for building the
-   OpenJDK on Linux. These Linux files are usually available from an "alsa" of
-   "libasound" development package, and it's highly recommended that you try
-   and use the package provided by the particular version of Linux that you are
-   using.
-
->  **`--with-boot-jdk=`**_path_  
->  select the [Bootstrap JDK](#bootjdk)
-
->  **`--with-boot-jdk-jvmargs=`**"_args_"  
->  provide the JVM options to be used to run the [Bootstrap JDK](#bootjdk)
-
->  **`--with-cacerts=`**_path_  
->  select the path to the cacerts file.
-
->  See [Certificate Authority on Wikipedia](http://en.wikipedia.org/wiki/
-   Certificate_Authority) for a better understanding of the Certificate
-   Authority (CA). A certificates file named "cacerts" represents a system-wide
-   keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts"
-   file contains root CA certificates from several public CAs (e.g., VeriSign,
-   Thawte, and Baltimore). The source contain a cacerts file without CA root
-   certificates. Formal JDK builders will need to secure permission from each
-   public CA and include the certificates into their own custom cacerts file.
-   Failure to provide a populated cacerts file will result in verification
-   errors of a certificate chain during runtime. By default an empty cacerts
-   file is provided and that should be fine for most JDK developers.
-
-<a name="cups"></a>
->  **`--with-cups=`**_path_  
->  select the CUPS install location
-
->  The Common UNIX Printing System (CUPS) Headers are required for building the
-   OpenJDK on Solaris and Linux. The Solaris header files can be obtained by
-   installing the package **print/cups**.
-
->  The CUPS header files can always be downloaded from
-   [www.cups.org](http://www.cups.org).
-
->  **`--with-cups-include=`**_path_  
->  select the CUPS include directory location
-
->  **`--with-debug-level=`**_level_  
->  select the debug information level of release, fastdebug, or slowdebug
-
->  **`--with-dev-kit=`**_path_  
->  select location of the compiler install or developer install location
-
-<a name="freetype"></a>
->  **`--with-freetype=`**_path_  
->  select the freetype files to use.
-
->  Expecting the freetype libraries under `lib/` and the headers under
-   `include/`.
-
->  Version 2.3 or newer of FreeType is required. On Unix systems required files
-   can be available as part of your distribution (while you still may need to
-   upgrade them). Note that you need development version of package that
-   includes both the FreeType library and header files.
-
->  You can always download latest FreeType version from the [FreeType
-   website](http://www.freetype.org). Building the freetype 2 libraries from
-   scratch is also possible, however on Windows refer to the [Windows FreeType
-   DLL build instructions](http://freetype.freedesktop.org/wiki/FreeType_DLL).
-
->  Note that by default FreeType is built with byte code hinting support
-   disabled due to licensing restrictions. In this case, text appearance and
-   metrics are expected to differ from Sun's official JDK build. See the
-   [SourceForge FreeType2 Home Page](http://freetype.sourceforge.net/freetype2)
-   for more information.
-
->  **`--with-import-hotspot=`**_path_  
->  select the location to find hotspot binaries from a previous build to avoid
-   building hotspot
-
->  **`--with-target-bits=`**_arg_  
->  select 32 or 64 bit build
-
->  **`--with-jvm-variants=`**_variants_  
->  select the JVM variants to build from, comma separated list that can
-   include: server, client, kernel, zero and zeroshark
-
->  **`--with-memory-size=`**_size_  
->  select the RAM size that GNU make will think this system has
-
->  **`--with-msvcr-dll=`**_path_  
->  select the `msvcr100.dll` file to include in the Windows builds (C/C++
-   runtime library for Visual Studio).
-
->  This is usually picked up automatically from the redist directories of
-   Visual Studio 2013.
-
->  **`--with-num-cores=`**_cores_  
->  select the number of cores to use (processor count or CPU count)
-
-<a name="xrender"></a>
->  **`--with-x=`**_path_  
->  select the location of the X11 and xrender files.
-
->  The XRender Extension Headers are required for building the OpenJDK on
-   Solaris and Linux. The Linux header files are usually available from a
-   "Xrender" development package, it's recommended that you try and use the
-   package provided by the particular distribution of Linux that you are using.
-   The Solaris XRender header files is included with the other X11 header files
-   in the package **SFWxwinc** on new enough versions of Solaris and will be
-   installed in `/usr/X11/include/X11/extensions/Xrender.h` or
-   `/usr/openwin/share/include/X11/extensions/Xrender.h`
-
-*****
-
-<a name="make"></a>
-### Make
-
-The basic invocation of the `make` utility looks like:
-
->  **`make all`**
-
-This will start the build to the output directory containing the
-"configuration" that was created by the `configure` script. Run `make help` for
-more information on the available targets.
-
-There are some of the make targets that are of general interest:
-
->  _empty_  
->  build everything but no images
-
->  **`all`**  
->  build everything including images
-
->  **`all-conf`**  
->  build all configurations
-
->  **`images`**  
->  create complete j2sdk and j2re images
-
->  **`install`**  
->  install the generated images locally, typically in `/usr/local`
-
->  **`clean`**  
->  remove all files generated by make, but not those generated by `configure`
-
->  **`dist-clean`**  
->  remove all files generated by both and `configure` (basically killing the
-   configuration)
-
->  **`help`**  
->  give some help on using `make`, including some interesting make targets
-
-*****
-
-<a name="testing"></a>
-## Testing
-
-When the build is completed, you should see the generated binaries and
-associated files in the `j2sdk-image` directory in the output directory. In
-particular, the `build/*/images/j2sdk-image/bin` directory should contain
-executables for the OpenJDK tools and utilities for that configuration. The
-testing tool `jtreg` will be needed and can be found at: [the jtreg
-site](http://openjdk.java.net/jtreg/). The provided regression tests in the
-repositories can be run with the command:
-
->  **``cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all``**
-
-*****
-
-<a name="hints"></a>
-## Appendix A: Hints and Tips
-
-<a name="faq"></a>
-### FAQ
-
-**Q:** The `generated-configure.sh` file looks horrible! How are you going to
-edit it?  
-**A:** The `generated-configure.sh` file is generated (think "compiled") by the
-autoconf tools. The source code is in `configure.ac` and various .m4 files in
-common/autoconf, which are much more readable.
-
-**Q:** Why is the `generated-configure.sh` file checked in, if it is 
-generated?  
-**A:** If it was not generated, every user would need to have the autoconf
-tools installed, and re-generate the `configure` file as the first step. Our
-goal is to minimize the work needed to be done by the user to start building
-OpenJDK, and to minimize the number of external dependencies required.
-
-**Q:** Do you require a specific version of autoconf for regenerating
-`generated-configure.sh`?  
-**A:** Yes, version 2.69 is required and should be easy enough to aquire on all
-supported operating systems. The reason for this is to avoid large spurious
-changes in `generated-configure.sh`.
-
-**Q:** How do you regenerate `generated-configure.sh` after making changes to
-the input files?  
-**A:** Regnerating `generated-configure.sh` should always be done using the
-script `common/autoconf/autogen.sh` to ensure that the correct files get
-updated. This script should also be run after mercurial tries to merge
-`generated-configure.sh` as a merge of the generated file is not guaranteed to
-be correct.
-
-**Q:** What are the files in `common/makefiles/support/*` for? They look like
-gibberish.  
-**A:** They are a somewhat ugly hack to compensate for command line length
-limitations on certain platforms (Windows, Solaris). Due to a combination of
-limitations in make and the shell, command lines containing too many files will
-not work properly. These helper files are part of an elaborate hack that will
-compress the command line in the makefile and then uncompress it safely. We're
-not proud of it, but it does fix the problem. If you have any better
-suggestions, we're all ears! :-)
-
-**Q:** I want to see the output of the commands that make runs, like in the old
-build. How do I do that?  
-**A:** You specify the `LOG` variable to make. There are several log levels:
-
- * **`warn`** -- Default and very quiet.
- * **`info`** -- Shows more progress information than warn.
- * **`debug`** -- Echos all command lines and prints all macro calls for
-   compilation definitions.
- * **`trace`** -- Echos all $(shell) command lines as well.
-
-**Q:** When do I have to re-run `configure`?  
-**A:** Normally you will run `configure` only once for creating a
-configuration. You need to re-run configuration only if you want to change any
-configuration options, or if you pull down changes to the `configure` script.
-
-**Q:** I have added a new source file. Do I need to modify the makefiles?  
-**A:** Normally, no. If you want to create e.g. a new native library, you will
-need to modify the makefiles. But for normal file additions or removals, no
-changes are needed. There are certan exceptions for some native libraries where
-the source files are spread over many directories which also contain sources
-for other libraries. In these cases it was simply easier to create include
-lists rather than excludes.
-
-**Q:** When I run `configure --help`, I see many strange options, like
-`--dvidir`. What is this?  
-**A:** Configure provides a slew of options by default, to all projects that
-use autoconf. Most of them are not used in OpenJDK, so you can safely ignore
-them. To list only OpenJDK specific features, use `configure --help=short`
-instead.
-
-**Q:** `configure` provides OpenJDK-specific features such as `--with-
-builddeps-server` that are not described in this document. What about those?  
-**A:** Try them out if you like! But be aware that most of these are
-experimental features. Many of them don't do anything at all at the moment; the
-option is just a placeholder. Others depend on pieces of code or infrastructure
-that is currently not ready for prime time.
-
-**Q:** How will you make sure you don't break anything?  
-**A:** We have a script that compares the result of the new build system with
-the result of the old. For most part, we aim for (and achieve) byte-by-byte
-identical output. There are however technical issues with e.g. native binaries,
-which might differ in a byte-by-byte comparison, even when building twice with
-the old build system. For these, we compare relevant aspects (e.g. the symbol
-table and file size). Note that we still don't have 100% equivalence, but we're
-close.
-
-**Q:** I noticed this thing X in the build that looks very broken by design.
-Why don't you fix it?  
-**A:** Our goal is to produce a build output that is as close as technically
-possible to the old build output. If things were weird in the old build, they
-will be weird in the new build. Often, things were weird before due to
-obscurity, but in the new build system the weird stuff comes up to the surface.
-The plan is to attack these things at a later stage, after the new build system
-is established.
-
-**Q:** The code in the new build system is not that well-structured. Will you
-fix this?  
-**A:** Yes! The new build system has grown bit by bit as we converted the old
-system. When all of the old build system is converted, we can take a step back
-and clean up the structure of the new build system. Some of this we plan to do
-before replacing the old build system and some will need to wait until after.
-
-**Q:** Is anything able to use the results of the new build's default make
-target?  
-**A:** Yes, this is the minimal (or roughly minimal) set of compiled output
-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. The packaging stuff that is part of the `images` target is not needed for
-a normal developer who wants to test his new code. Even if it's quite fast,
-it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-)
-(Or, well, at least single-digit seconds...)
-
-**Q:** I usually set a specific environment variable when building, but I can't
-find the equivalent in the new build. What should I do?  
-**A:** It might very well be that we have neglected to add support for an
-option that was actually used from outside the build system. Email us and we
-will add support for it!
-
-<a name="performance"></a>
-### Build Performance Tips
-
-Building OpenJDK 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 `configure` 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:
-
- * **`--with-num-cores`** -- number of cores in the build system, e.g.
-   `--with-num-cores=8`
- * **`--with-memory-size`** -- memory (in MB) available in the build system,
-    e.g. `--with-memory-size=1024`
-
-It might also be necessary to specify the JVM arguments passed to the Bootstrap
-JDK, using e.g. `--with-boot-jdk-jvmargs="-Xmx8G -enableassertions"`. Doing
-this will override the default JVM arguments passed to the Bootstrap JDK.
-
-One of the top goals of the new build system is to improve the build
-performance and decrease the time needed to build. This will soon also apply to
-the java compilation when the Smart Javac wrapper is fully supported.
-
-At the end of a successful execution of `configure`, 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!
-
-#### Building with ccache
-
-The OpenJDK 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
-`--enable-ccache`.
-
-#### Building on local disk
-
-If you are using network shares, e.g. via NFS, for your source code, make sure
-the build directory is situated on local disk. The performance penalty is
-extremely high for building on a network share, close to unusable.
-
-#### Building only one JVM
-
-The old build builds multiple JVMs on 32-bit systems (client and server; and on
-Windows kernel as well). In the new build we have changed this default to only
-build server when it's available. This improves build times for those not
-interested in multiple JVMs. To mimic the old behavior on platforms that
-support it, use `--with-jvm-variants=client,server`.
-
-#### Selecting the number of cores to build on
-
-By default, `configure` will analyze your machine and run the make process in
-parallel with as many threads as you have cores. This behavior can be
-overridden, either "permanently" (on a `configure` basis) using
-`--with-num-cores=N` or for a single build only (on a make basis), using
-`make JOBS=N`.
-
-If you want to make a slower build just this time, to save some CPU power for
-other processes, you can run e.g. `make JOBS=2`. This will force the makefiles
-to only run 2 parallel processes, or even `make JOBS=1` which will disable
-parallelism.
-
-If you want to have it the other way round, namely having slow builds default
-and override with fast if you're impatient, you should call `configure` with
-`--with-num-cores=2`, making 2 the default. If you want to run with more cores,
-run `make JOBS=8`
-
-<a name="troubleshooting"></a>
-### Troubleshooting
-
-#### Solving build problems
-
-If the build fails (and it's not due to a compilation error in a source file
-you've changed), the first thing you should do is to re-run the build with more
-verbosity. Do this by adding `LOG=debug` to your make command line.
-
-The build log (with both stdout and stderr intermingled, basically the same as
-you see on your console) can be found as `build.log` in your build directory.
-
-You can ask for help on build problems with the new build system on either the
-[build-dev](http://mail.openjdk.java.net/mailman/listinfo/build-dev) or the
-[build-infra-dev](http://mail.openjdk.java.net/mailman/listinfo/build-infra-dev)
-mailing lists. Please include the relevant parts of the build log.
-
-A build can fail for any number of reasons. Most failures are a result of
-trying to build in an environment in which all the pre-build requirements have
-not been met. The first step in troubleshooting a build failure is to recheck
-that you have satisfied all the pre-build requirements for your platform.
-Scanning the `configure` log is a good first step, making sure that what it
-found makes sense for your system. Look for strange error messages or any
-difficulties that `configure` had in finding things.
-
-Some of the more common problems with builds are briefly described below, with
-suggestions for remedies.
-
- * **Corrupted Bundles on Windows:**  
-   Some virus scanning software has been known to corrupt the downloading of
-   zip bundles. It may be necessary to disable the 'on access' or 'real time'
-   virus scanning features to prevent this corruption. This type of 'real time'
-   virus scanning can also slow down the build process significantly.
-   Temporarily disabling the feature, or excluding the build output directory
-   may be necessary to get correct and faster builds.
-
- * **Slow Builds:**  
-   If your build machine seems to be overloaded from too many simultaneous C++
-   compiles, try setting the `JOBS=1` on the `make` command line. Then try
-   increasing the count slowly to an acceptable level for your system. Also:
-
-   Creating the javadocs can be very slow, if you are running javadoc, consider
-   skipping that step.
-
-   Faster CPUs, more RAM, and a faster DISK usually helps. The VM build tends
-   to be CPU intensive (many C++ compiles), and the rest of the JDK will often
-   be disk intensive.
-
-   Faster compiles are possible using a tool called
-   [ccache](http://ccache.samba.org/).
-
- * **File time issues:**  
-   If you see warnings that refer to file time stamps, e.g.
-
-   > _Warning message:_ ` File 'xxx' has modification time in the future.`  
-   > _Warning message:_ ` Clock skew detected. Your build may be incomplete.`
-
-   These warnings can occur when the clock on the build machine is out of sync
-   with the timestamps on the source files. Other errors, apparently unrelated
-   but in fact caused by the clock skew, can occur along with the clock skew
-   warnings. These secondary errors may tend to obscure the fact that the true
-   root cause of the problem is an out-of-sync clock.
-
-   If you see these warnings, reset the clock on the build machine, run
-   "`gmake clobber`" or delete the directory containing the build output, and
-   restart the build from the beginning.
-
- * **Error message: `Trouble writing out table to disk`**  
-   Increase the amount of swap space on your build machine. This could be
-   caused by overloading the system and it may be necessary to use:
-
-   > `make JOBS=1`
-
-   to reduce the load on the system.
-
- * **Error Message: `libstdc++ not found`:**  
-   This is caused by a missing libstdc++.a library. This is installed as part
-   of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit
-   Linux versions (e.g. Fedora) only install the 64-bit version of the
-   libstdc++ package. Various parts of the JDK build require a static link of
-   the C++ runtime libraries to allow for maximum portability of the built
-   images.
-
- * **Linux Error Message: `cannot restore segment prot after reloc`**  
-   This is probably an issue with SELinux (See [SELinux on
-   Wikipedia](http://en.wikipedia.org/wiki/SELinux)). Parts of the VM is built
-   without the `-fPIC` for performance reasons.
-
-   To completely disable SELinux:
-
-   1. `$ su root`
-   2. `# system-config-securitylevel`
-   3. `In the window that appears, select the SELinux tab`
-   4. `Disable SELinux`
-
-   Alternatively, instead of completely disabling it you could disable just
-   this one check.
-
-   1. Select System->Administration->SELinux Management
-   2. In the SELinux Management Tool which appears, select "Boolean" from the
-      menu on the left
-   3. Expand the "Memory Protection" group
-   4. Check the first item, labeled "Allow all unconfined executables to use
-      libraries requiring text relocation ..."
-
- * **Windows Error Messages:**  
-   `*** fatal error - couldn't allocate heap, ... `  
-   `rm fails with "Directory not empty"`  
-   `unzip fails with "cannot create ... Permission denied"`  
-   `unzip fails with "cannot create ... Error 50"`
-
-   The CYGWIN software can conflict with other non-CYGWIN software. See the
-   CYGWIN FAQ section on [BLODA (applications that interfere with
-   CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda).
-
- * **Windows Error Message: `spawn failed`**  
-   Try rebooting the system, or there could be some kind of issue with the disk
-   or disk partition being used. Sometimes it comes with a "Permission Denied"
-   message.
-
-*****
-
-<a name="gmake"></a>
-## Appendix B: GNU make
-
-The Makefiles in the OpenJDK are only valid when used with the GNU version of
-the utility command `make` (usually called `gmake` on Solaris). A few notes
-about using GNU make:
-
- * You need GNU make version 3.81 or newer. On Windows 4.0 or newer is
-   recommended. If the GNU make utility on your systems is not of a suitable
-   version, see "[Building GNU make](#buildgmake)".
- * Place the location of the GNU make binary in the `PATH`.
- * **Solaris:** Do NOT use `/usr/bin/make` on Solaris. If your Solaris system
-   has the software from the Solaris Developer Companion CD installed, you
-   should try and use `/usr/bin/gmake` or `/usr/gnu/bin/make`.
- * **Windows:** Make sure you start your build inside a bash shell.
- * **Mac OS X:** The XCode "command line tools" must be installed on your Mac.
-
-Information on GNU make, and access to ftp download sites, are available on the
-[GNU make web site ](http://www.gnu.org/software/make/make.html). The latest
-source to GNU make is available at
-[ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/).
-
-<a name="buildgmake"></a>
-### Building GNU make
-
-First step is to get the GNU make 3.81 or newer source from
-[ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/). Building is a
-little different depending on the OS but is basically done with:
-
-      bash ./configure
-      make
-
-*****
-
-<a name="buildenvironments"></a>
-## Appendix C: Build Environments
-
-### Minimum Build Environments
-
-This file often describes specific requirements for what we call the "minimum
-build environments" (MBE) for this specific release of the JDK. What is listed
-below is what the Oracle Release Engineering Team will use to build the Oracle
-JDK product. Building with the MBE will hopefully generate the most compatible
-bits that install on, and run correctly on, the most variations of the same
-base OS and hardware architecture. In some cases, these represent what is often
-called the least common denominator, but each Operating System has different
-aspects to it.
-
-In all cases, the Bootstrap JDK version minimum is critical, we cannot
-guarantee builds will work with older Bootstrap JDK's. Also in all cases, more
-RAM and more processors is better, the minimums listed below are simply
-recommendations.
-
-With Solaris and Mac OS X, the version listed below is the oldest release we
-can guarantee builds and works, and the specific version of the compilers used
-could be critical.
-
-With Windows the critical aspect is the Visual Studio compiler used, which due
-to it's runtime, generally dictates what Windows systems can do the builds and
-where the resulting bits can be used.
-
-**NOTE: We expect a change here off these older Windows OS releases and to a
-'less older' one, probably Windows 2008R2 X64.**
-
-With Linux, it was just a matter of picking a stable distribution that is a
-good representative for Linux in general.
-
-It is understood that most developers will NOT be using these specific
-versions, and in fact creating these specific versions may be difficult due to
-the age of some of this software. It is expected that developers are more often
-using the more recent releases and distributions of these operating systems.
-
-Compilation problems with newer or different C/C++ compilers is a common
-problem. Similarly, compilation problems related to changes to the
-`/usr/include` or system header files is also a common problem with older,
-newer, or unreleased OS versions. Please report these types of problems as bugs
-so that they can be dealt with accordingly.
-
->  <table border="1">
-     <thead>
-       <tr>
-         <th>Base OS and Architecture</th>
-         <th>OS</th>
-         <th>C/C++ Compiler</th>
-         <th>Bootstrap JDK</th>
-         <th>Processors</th>
-         <th>RAM Minimum</th>
-         <th>DISK Needs</th>
-       </tr>
-     </thead>
-     <tbody>
-       <tr>
-         <td>Linux X86 (32-bit) and X64 (64-bit)</td>
-         <td>Oracle Enterprise Linux 6.4</td>
-         <td>gcc 4.9.2 </td>
-         <td>JDK 8</td>
-         <td>2 or more</td>
-         <td>1 GB</td>
-         <td>6 GB</td>
-       </tr>
-       <tr>
-         <td>Solaris SPARCV9 (64-bit)</td>
-         <td>Solaris 11 Update 1</td>
-         <td>Studio 12 Update 4 + patches</td>
-         <td>JDK 8</td>
-         <td>4 or more</td>
-         <td>4 GB</td>
-         <td>8 GB</td>
-       </tr>
-       <tr>
-         <td>Solaris X64 (64-bit)</td>
-         <td>Solaris 11 Update 1</td>
-         <td>Studio 12 Update 4 + patches</td>
-         <td>JDK 8</td>
-         <td>4 or more</td>
-         <td>4 GB</td>
-         <td>8 GB</td>
-       </tr>
-       <tr>
-         <td>Windows X86 (32-bit)</td>
-         <td>Windows Server 2012 R2 x64</td>
-         <td>Microsoft Visual Studio C++ 2013 Professional Edition</td>
-         <td>JDK 8</td>
-         <td>2 or more</td>
-         <td>2 GB</td>
-         <td>6 GB</td>
-       </tr>
-       <tr>
-         <td>Windows X64 (64-bit)</td>
-         <td>Windows Server 2012 R2 x64</td>
-         <td>Microsoft Visual Studio C++ 2013 Professional Edition</td>
-         <td>JDK 8</td>
-         <td>2 or more</td>
-         <td>2 GB</td>
-         <td>6 GB</td>
-       </tr>
-       <tr>
-         <td>Mac OS X X64 (64-bit)</td>
-         <td>Mac OS X 10.9 "Mavericks"</td>
-         <td>Xcode 6.3 or newer</td>
-         <td>JDK 8</td>
-         <td>2 or more</td>
-         <td>4 GB</td>
-         <td>6 GB</td>
-       </tr>
-     </tbody>
-   </table>
-
-*****
-
-<a name="SDBE"></a>
-### Specific Developer Build Environments
-
-We won't be listing all the possible environments, but we will try to provide
-what information we have available to us.
-
-**NOTE: The community can help out by updating this part of the document.**
-
-#### Fedora
-
-After installing the latest [Fedora](http://fedoraproject.org) you need to
-install several build dependencies. The simplest way to do it is to execute the
-following commands as user `root`:
-
-      yum-builddep java-1.7.0-openjdk
-      yum install gcc gcc-c++
-
-In addition, it's necessary to set a few environment variables for the build:
-
-      export LANG=C
-      export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
-
-#### CentOS 5.5
-
-After installing [CentOS 5.5](http://www.centos.org/) you need to make sure you
-have the following Development bundles installed:
-
- * Development Libraries
- * Development Tools
- * Java Development
- * X Software Development (Including XFree86-devel)
-
-Plus the following packages:
-
- * cups devel: Cups Development Package
- * alsa devel: Alsa Development Package
- * Xi devel: libXi.so Development Package
-
-The freetype 2.3 packages don't seem to be available, but the freetype 2.3
-sources can be downloaded, built, and installed easily enough from [the
-freetype site](http://downloads.sourceforge.net/freetype). Build and install
-with something like:
-
-      bash ./configure
-      make
-      sudo -u root make install
-
-Mercurial packages could not be found easily, but a Google search should find
-ones, and they usually include Python if it's needed.
-
-#### Debian 5.0 (Lenny)
-
-After installing [Debian](http://debian.org) 5 you need to install several
-build dependencies. The simplest way to install the build dependencies is to
-execute the following commands as user `root`:
-
-      aptitude build-dep openjdk-7
-      aptitude install openjdk-7-jdk libmotif-dev
-
-In addition, it's necessary to set a few environment variables for the build:
-
-      export LANG=C
-      export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
-#### Ubuntu 12.04
-
-After installing [Ubuntu](http://ubuntu.org) 12.04 you need to install several
-build dependencies. The simplest way to do it is to execute the following
-commands:
-
-      sudo aptitude build-dep openjdk-7
-      sudo aptitude install openjdk-7-jdk
-
-In addition, it's necessary to set a few environment variables for the build:
-
-      export LANG=C
-      export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
-#### OpenSUSE 11.1
-
-After installing [OpenSUSE](http://opensuse.org) 11.1 you need to install
-several build dependencies. The simplest way to install the build dependencies
-is to execute the following commands:
-
-      sudo zypper source-install -d java-1_7_0-openjdk
-      sudo zypper install make
-
-In addition, it is necessary to set a few environment variables for the build:
-
-      export LANG=C
-      export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
-
-Finally, you need to unset the `JAVA_HOME` environment variable:
-
-      export -n JAVA_HOME`
-
-#### Mandriva Linux One 2009 Spring
-
-After installing [Mandriva](http://mandriva.org) Linux One 2009 Spring you need
-to install several build dependencies. The simplest way to install the build
-dependencies is to execute the following commands as user `root`:
-
-      urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
-        libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
-        libxtst6-devel libxi-devel
-
-In addition, it is necessary to set a few environment variables for the build:
-
-      export LANG=C
-      export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
-
-#### OpenSolaris 2009.06
-
-After installing [OpenSolaris](http://opensolaris.org) 2009.06 you need to
-install several build dependencies. The simplest way to install the build
-dependencies is to execute the following commands:
-
-      pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
-        SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
-
-In addition, it is necessary to set a few environment variables for the build:
-
-      export LANG=C
-      export PATH="/opt/SunStudioExpress/bin:${PATH}"
-
-*****
-
-End of the OpenJDK build README document.
-
-Please come again!
diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4
index 35e835c..20180c4 100644
--- a/common/autoconf/basics.m4
+++ b/common/autoconf/basics.m4
@@ -530,6 +530,7 @@
   BASIC_PATH_PROGS(DF, df)
   BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
   BASIC_PATH_PROGS(NICE, nice)
+  BASIC_PATH_PROGS(PANDOC, pandoc)
 ])
 
 # Setup basic configuration paths, and platform-specific stuff related to PATHs.
@@ -1202,6 +1203,18 @@
 # Check for support for specific options in bash
 AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
 [
+  # Check bash version
+  # Extra [ ] to stop m4 mangling
+  [ BASH_VER=`$BASH --version | $SED -n  -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` ]
+  AC_MSG_CHECKING([bash version])
+  AC_MSG_RESULT([$BASH_VER])
+
+  BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1`
+  BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2`
+  if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then
+    AC_MSG_ERROR([bash version 3.2 or better is required])
+  fi
+
   # Test if bash supports pipefail.
   AC_MSG_CHECKING([if bash supports pipefail])
   if ${BASH} -c 'set -o pipefail'; then
diff --git a/common/autoconf/basics_windows.m4 b/common/autoconf/basics_windows.m4
index 1a79bf8..2ae6e34 100644
--- a/common/autoconf/basics_windows.m4
+++ b/common/autoconf/basics_windows.m4
@@ -329,8 +329,8 @@
       AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
     fi
     AC_MSG_CHECKING([cygwin root directory as unix-style path])
-    # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
-    cygwin_winpath_root=`cd / ; cmd /c cd | $GREP ".*"`
+    # The cmd output ends with Windows line endings (CR/LF)
+    cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'`
     # Force cygpath to report the proper root by including a trailing space, and then stripping it off again.
     CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "`
     AC_MSG_RESULT([$CYGWIN_ROOT_PATH])
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index ca7f625..a96b74b 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -355,7 +355,7 @@
         SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
         JVM_CFLAGS="$JVM_CFLAGS $PICFLAG"
       fi
-      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
@@ -375,7 +375,7 @@
       # Linking is different on MacOSX
       PICFLAG=''
       SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
-      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 917181a..f7ee60e 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -994,6 +994,7 @@
 OPENJDK_TARGET_CPU_LEGACY_LIB
 OPENJDK_TARGET_CPU_LEGACY
 REQUIRED_OS_VERSION
+REQUIRED_OS_ARCH
 REQUIRED_OS_NAME
 COMPILE_TYPE
 OPENJDK_TARGET_CPU_ENDIAN
@@ -1024,6 +1025,7 @@
 build_vendor
 build_cpu
 build
+PANDOC
 NICE
 CPIO
 DF
@@ -1281,6 +1283,7 @@
 DF
 CPIO
 NICE
+PANDOC
 MAKE
 UNZIP
 ZIPEXE
@@ -2244,6 +2247,7 @@
   DF          Override default value for DF
   CPIO        Override default value for CPIO
   NICE        Override default value for NICE
+  PANDOC      Override default value for PANDOC
   MAKE        Override default value for MAKE
   UNZIP       Override default value for UNZIP
   ZIPEXE      Override default value for ZIPEXE
@@ -5043,7 +5047,7 @@
 #
 # $1 = compiler to test (CC or CXX)
 # $2 = human readable name of compiler (C or C++)
-# $3 = list of compiler names to search for
+# $3 = compiler name to search for
 
 
 # Detect the core components of the toolchain, i.e. the compilers (CC and CXX),
@@ -5170,7 +5174,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1486175373
+DATE_WHEN_GENERATED=1490856742
 
 ###############################################################################
 #
@@ -15358,6 +15362,203 @@
 
 
 
+  # Publish this variable in the help.
+
+
+  if [ -z "${PANDOC+x}" ]; then
+    # The variable is not set by user, try to locate tool using the code snippet
+    for ac_prog in pandoc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PANDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PANDOC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PANDOC=$ac_cv_path_PANDOC
+if test -n "$PANDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5
+$as_echo "$PANDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PANDOC" && break
+done
+
+  else
+    # The variable is set, but is it from the command line or the environment?
+
+    # Try to remove the string !PANDOC! from our list.
+    try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!PANDOC!/}
+    if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
+      # If it failed, the variable was not from the command line. Ignore it,
+      # but warn the user (except for BASH, which is always set by the calling BASH).
+      if test "xPANDOC" != xBASH; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&5
+$as_echo "$as_me: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&2;}
+      fi
+      # Try to locate tool using the code snippet
+      for ac_prog in pandoc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PANDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PANDOC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PANDOC=$ac_cv_path_PANDOC
+if test -n "$PANDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5
+$as_echo "$PANDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PANDOC" && break
+done
+
+    else
+      # If it succeeded, then it was overridden by the user. We will use it
+      # for the tool.
+
+      # First remove it from the list of overridden variables, so we can test
+      # for unknown variables in the end.
+      CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
+
+      # Check if we try to supply an empty value
+      if test "x$PANDOC" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool PANDOC= (no value)" >&5
+$as_echo "$as_me: Setting user supplied tool PANDOC= (no value)" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5
+$as_echo_n "checking for PANDOC... " >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+      else
+        # Check if the provided tool contains a complete path.
+        tool_specified="$PANDOC"
+        tool_basename="${tool_specified##*/}"
+        if test "x$tool_basename" = "x$tool_specified"; then
+          # A command without a complete path is provided, search $PATH.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool PANDOC=$tool_basename" >&5
+$as_echo "$as_me: Will search for user supplied tool PANDOC=$tool_basename" >&6;}
+          # Extract the first word of "$tool_basename", so it can be a program name with args.
+set dummy $tool_basename; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PANDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PANDOC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PANDOC=$ac_cv_path_PANDOC
+if test -n "$PANDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5
+$as_echo "$PANDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+          if test "x$PANDOC" = x; then
+            as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
+          fi
+        else
+          # Otherwise we believe it is a complete path. Use it as it is.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool PANDOC=$tool_specified" >&5
+$as_echo "$as_me: Will use user supplied tool PANDOC=$tool_specified" >&6;}
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5
+$as_echo_n "checking for PANDOC... " >&6; }
+          if test ! -x "$tool_specified"; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+            as_fn_error $? "User supplied tool PANDOC=$tool_specified does not exist or is not executable" "$LINENO" 5
+          fi
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
+$as_echo "$tool_specified" >&6; }
+        fi
+      fi
+    fi
+
+  fi
+
+
+
+
 # Now we can determine OpenJDK build and target platforms. This is required to
 # have early on.
 # Make sure we can run config.sub.
@@ -15838,13 +16039,15 @@
     fi
   fi
   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
-    REQUIRED_OS_NAME=Darwin
+    REQUIRED_OS_NAME="Mac OS X"
     REQUIRED_OS_VERSION=11.2
   fi
   if test "x$OPENJDK_TARGET_OS" = "xaix"; then
     REQUIRED_OS_NAME=AIX
     REQUIRED_OS_VERSION=7.1
   fi
+  REQUIRED_OS_ARCH=${OPENJDK_TARGET_CPU}
+
 
 
 
@@ -16200,8 +16403,8 @@
     fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin root directory as unix-style path" >&5
 $as_echo_n "checking cygwin root directory as unix-style path... " >&6; }
-    # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
-    cygwin_winpath_root=`cd / ; cmd /c cd | $GREP ".*"`
+    # The cmd output ends with Windows line endings (CR/LF)
+    cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'`
     # Force cygpath to report the proper root by including a trailing space, and then stripping it off again.
     CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "`
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_ROOT_PATH" >&5
@@ -24092,6 +24295,20 @@
   fi
 
 
+  # Check bash version
+  # Extra [ ] to stop m4 mangling
+   BASH_VER=`$BASH --version | $SED -n  -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking bash version" >&5
+$as_echo_n "checking bash version... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH_VER" >&5
+$as_echo "$BASH_VER" >&6; }
+
+  BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1`
+  BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2`
+  if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then
+    as_fn_error $? "bash version 3.2 or better is required" "$LINENO" 5
+  fi
+
   # Test if bash supports pipefail.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports pipefail" >&5
 $as_echo_n "checking if bash supports pipefail... " >&6; }
@@ -33124,10 +33341,9 @@
     if test -n "$TOOLCHAIN_PATH"; then
       PATH_save="$PATH"
       PATH="$TOOLCHAIN_PATH"
-      for ac_prog in $SEARCH_LIST
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args.
+set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if ${ac_cv_path_TOOLCHAIN_PATH_CC+:} false; then :
@@ -33166,20 +33382,73 @@
 fi
 
 
-  test -n "$TOOLCHAIN_PATH_CC" && break
+fi
+if test -z "$ac_cv_path_TOOLCHAIN_PATH_CC"; then
+  ac_pt_TOOLCHAIN_PATH_CC=$TOOLCHAIN_PATH_CC
+  # Extract the first word of "$SEARCH_LIST", so it can be a program name with args.
+set dummy $SEARCH_LIST; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_TOOLCHAIN_PATH_CC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC="$ac_pt_TOOLCHAIN_PATH_CC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_TOOLCHAIN_PATH_CC=$ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC
+if test -n "$ac_pt_TOOLCHAIN_PATH_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_TOOLCHAIN_PATH_CC" >&5
+$as_echo "$ac_pt_TOOLCHAIN_PATH_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_TOOLCHAIN_PATH_CC" = x; then
+    TOOLCHAIN_PATH_CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    TOOLCHAIN_PATH_CC=$ac_pt_TOOLCHAIN_PATH_CC
+  fi
+else
+  TOOLCHAIN_PATH_CC="$ac_cv_path_TOOLCHAIN_PATH_CC"
+fi
 
       CC=$TOOLCHAIN_PATH_CC
       PATH="$PATH_save"
     fi
 
-    # AC_PATH_PROGS can't be run multiple times with the same variable,
+    # AC_PATH_TOOL can't be run multiple times with the same variable,
     # so create a new name for this run.
     if test "x$CC" = x; then
-      for ac_prog in $SEARCH_LIST
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args.
+set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if ${ac_cv_path_POTENTIAL_CC+:} false; then :
@@ -33218,8 +33487,62 @@
 fi
 
 
-  test -n "$POTENTIAL_CC" && break
+fi
+if test -z "$ac_cv_path_POTENTIAL_CC"; then
+  ac_pt_POTENTIAL_CC=$POTENTIAL_CC
+  # Extract the first word of "$SEARCH_LIST", so it can be a program name with args.
+set dummy $SEARCH_LIST; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_POTENTIAL_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_POTENTIAL_CC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_POTENTIAL_CC="$ac_pt_POTENTIAL_CC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_POTENTIAL_CC=$ac_cv_path_ac_pt_POTENTIAL_CC
+if test -n "$ac_pt_POTENTIAL_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_POTENTIAL_CC" >&5
+$as_echo "$ac_pt_POTENTIAL_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_POTENTIAL_CC" = x; then
+    POTENTIAL_CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    POTENTIAL_CC=$ac_pt_POTENTIAL_CC
+  fi
+else
+  POTENTIAL_CC="$ac_cv_path_POTENTIAL_CC"
+fi
 
       CC=$POTENTIAL_CC
     fi
@@ -34425,10 +34748,9 @@
     if test -n "$TOOLCHAIN_PATH"; then
       PATH_save="$PATH"
       PATH="$TOOLCHAIN_PATH"
-      for ac_prog in $SEARCH_LIST
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args.
+set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if ${ac_cv_path_TOOLCHAIN_PATH_CXX+:} false; then :
@@ -34467,20 +34789,73 @@
 fi
 
 
-  test -n "$TOOLCHAIN_PATH_CXX" && break
+fi
+if test -z "$ac_cv_path_TOOLCHAIN_PATH_CXX"; then
+  ac_pt_TOOLCHAIN_PATH_CXX=$TOOLCHAIN_PATH_CXX
+  # Extract the first word of "$SEARCH_LIST", so it can be a program name with args.
+set dummy $SEARCH_LIST; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_TOOLCHAIN_PATH_CXX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX="$ac_pt_TOOLCHAIN_PATH_CXX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_TOOLCHAIN_PATH_CXX=$ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX
+if test -n "$ac_pt_TOOLCHAIN_PATH_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_TOOLCHAIN_PATH_CXX" >&5
+$as_echo "$ac_pt_TOOLCHAIN_PATH_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_TOOLCHAIN_PATH_CXX" = x; then
+    TOOLCHAIN_PATH_CXX=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    TOOLCHAIN_PATH_CXX=$ac_pt_TOOLCHAIN_PATH_CXX
+  fi
+else
+  TOOLCHAIN_PATH_CXX="$ac_cv_path_TOOLCHAIN_PATH_CXX"
+fi
 
       CXX=$TOOLCHAIN_PATH_CXX
       PATH="$PATH_save"
     fi
 
-    # AC_PATH_PROGS can't be run multiple times with the same variable,
+    # AC_PATH_TOOL can't be run multiple times with the same variable,
     # so create a new name for this run.
     if test "x$CXX" = x; then
-      for ac_prog in $SEARCH_LIST
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+      if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args.
+set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if ${ac_cv_path_POTENTIAL_CXX+:} false; then :
@@ -34519,8 +34894,62 @@
 fi
 
 
-  test -n "$POTENTIAL_CXX" && break
+fi
+if test -z "$ac_cv_path_POTENTIAL_CXX"; then
+  ac_pt_POTENTIAL_CXX=$POTENTIAL_CXX
+  # Extract the first word of "$SEARCH_LIST", so it can be a program name with args.
+set dummy $SEARCH_LIST; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_POTENTIAL_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_POTENTIAL_CXX in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_POTENTIAL_CXX="$ac_pt_POTENTIAL_CXX" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_POTENTIAL_CXX=$ac_cv_path_ac_pt_POTENTIAL_CXX
+if test -n "$ac_pt_POTENTIAL_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_POTENTIAL_CXX" >&5
+$as_echo "$ac_pt_POTENTIAL_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_POTENTIAL_CXX" = x; then
+    POTENTIAL_CXX=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    POTENTIAL_CXX=$ac_pt_POTENTIAL_CXX
+  fi
+else
+  POTENTIAL_CXX="$ac_cv_path_POTENTIAL_CXX"
+fi
 
       CXX=$POTENTIAL_CXX
     fi
@@ -49060,7 +49489,7 @@
         SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
         JVM_CFLAGS="$JVM_CFLAGS $PICFLAG"
       fi
-      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or $1,/.)'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1'
@@ -49080,7 +49509,7 @@
       # Linking is different on MacOSX
       PICFLAG=''
       SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
-      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or $1,/.)'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1'
@@ -52629,12 +53058,12 @@
     # Only enable AOT on linux-X64.
     if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then
       if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then
-        if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then
+        if test -e "$HOTSPOT_TOPDIR/src/jdk.internal.vm.compiler"; then
           ENABLE_AOT="true"
         else
           ENABLE_AOT="false"
           if test "x$enable_aot" = "xyes"; then
-            as_fn_error $? "Cannot build AOT without hotspot/src/jdk.vm.compiler sources. Remove --enable-aot." "$LINENO" 5
+            as_fn_error $? "Cannot build AOT without hotspot/src/jdk.internal.vm.compiler sources. Remove --enable-aot." "$LINENO" 5
           fi
         fi
       else
@@ -64365,8 +64794,8 @@
     JVM_FEATURES_jvmci=""
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jdk.vm.compiler should be built" >&5
-$as_echo_n "checking if jdk.vm.compiler should be built... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jdk.internal.vm.compiler should be built" >&5
+$as_echo_n "checking if jdk.internal.vm.compiler should be built... " >&6; }
   if   [[ " $JVM_FEATURES " =~ " graal " ]]  ; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
 $as_echo "yes, forced" >&6; }
diff --git a/common/autoconf/hotspot.m4 b/common/autoconf/hotspot.m4
index b295b01..acf2a5f 100644
--- a/common/autoconf/hotspot.m4
+++ b/common/autoconf/hotspot.m4
@@ -215,12 +215,12 @@
     # Only enable AOT on linux-X64.
     if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then
       if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then
-        if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then
+        if test -e "$HOTSPOT_TOPDIR/src/jdk.internal.vm.compiler"; then
           ENABLE_AOT="true"
         else
           ENABLE_AOT="false"
           if test "x$enable_aot" = "xyes"; then
-            AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.vm.compiler sources. Remove --enable-aot.])
+            AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.internal.vm.compiler sources. Remove --enable-aot.])
           fi
         fi
       else
@@ -327,7 +327,7 @@
     JVM_FEATURES_jvmci=""
   fi
 
-  AC_MSG_CHECKING([if jdk.vm.compiler should be built])
+  AC_MSG_CHECKING([if jdk.internal.vm.compiler should be built])
   if HOTSPOT_CHECK_JVM_FEATURE(graal); then
     AC_MSG_RESULT([yes, forced])
     if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then
diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
index 6101027..80d1656 100644
--- a/common/autoconf/platform.m4
+++ b/common/autoconf/platform.m4
@@ -452,15 +452,17 @@
     fi
   fi
   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
-    REQUIRED_OS_NAME=Darwin
+    REQUIRED_OS_NAME="Mac OS X"
     REQUIRED_OS_VERSION=11.2
   fi
   if test "x$OPENJDK_TARGET_OS" = "xaix"; then
     REQUIRED_OS_NAME=AIX
     REQUIRED_OS_VERSION=7.1
   fi
+  REQUIRED_OS_ARCH=${OPENJDK_TARGET_CPU}
 
   AC_SUBST(REQUIRED_OS_NAME)
+  AC_SUBST(REQUIRED_OS_ARCH)
   AC_SUBST(REQUIRED_OS_VERSION)
 ])
 
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index bb6d220..ffb3168 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -101,8 +101,9 @@
 OPENJDK_BUILD_CPU_BITS:=@OPENJDK_BUILD_CPU_BITS@
 OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@
 
-# Legacy OS values for use in release file.
+# OS values for use in release file.
 REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@
+REQUIRED_OS_ARCH:=@REQUIRED_OS_ARCH@
 REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@
 
 LIBM:=@LIBM@
@@ -574,20 +575,31 @@
 # Use ?= as this can be overridden from bootcycle-spec.gmk
 BOOT_JDK_MODULAR ?= @BOOT_JDK_MODULAR@
 
-INTERIM_OVERRIDE_MODULES := java.compiler jdk.compiler \
-    jdk.jdeps jdk.javadoc jdk.rmic
+INTERIM_LANGTOOLS_OVERRIDE_MODULES := java.compiler jdk.compiler \
+    jdk.jdeps jdk.javadoc
+INTERIM_RMIC_OVERRIDE_MODULES := jdk.rmic
 ifeq ($(BOOT_JDK_MODULAR), true)
-  INTERIM_OVERRIDE_MODULES_ARGS = $(foreach m, $(INTERIM_OVERRIDE_MODULES), \
+  INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS = $(foreach m, \
+      $(INTERIM_LANGTOOLS_OVERRIDE_MODULES), \
       --patch-module $m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m)
-  INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS)
+  INTERIM_RMIC_OVERRIDE_MODULES_ARGS = $(foreach m, \
+      $(INTERIM_LANGTOOLS_OVERRIDE_MODULES) \
+      $(INTERIM_RMIC_OVERRIDE_MODULES), \
+      --patch-module $m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m)
+  INTERIM_LANGTOOLS_ARGS = $(INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS)
   JAVAC_MAIN_CLASS = -m jdk.compiler/com.sun.tools.javac.Main
   JAVADOC_MAIN_CLASS = -m jdk.javadoc/jdk.javadoc.internal.tool.Main
 else
-  INTERIM_OVERRIDE_MODULES_ARGS = \
+  INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS = \
       -Xbootclasspath/p:$(call PathList, \
           $(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \
-              $(INTERIM_OVERRIDE_MODULES)))
-  INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS) \
+              $(INTERIM_LANGTOOLS_OVERRIDE_MODULES)))
+  INTERIM_RMIC_OVERRIDE_MODULES_ARGS = \
+      -Xbootclasspath/p:$(call PathList, \
+          $(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \
+              $(INTERIM_LANGTOOLS_OVERRIDE_MODULES) \
+              $(INTERIM_RMIC_OVERRIDE_MODULES)))
+  INTERIM_LANGTOOLS_ARGS = $(INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS) \
       -cp $(BUILDTOOLS_OUTPUTDIR)/override_modules/jdk.compiler
   JAVAC_MAIN_CLASS = com.sun.tools.javac.Main
   JAVADOC_MAIN_CLASS = jdk.javadoc.internal.tool.Main
@@ -637,6 +649,7 @@
 MV:=@MV@
 NAWK:=@NAWK@
 NICE:=@NICE@
+PANDOC:=@PANDOC@
 PATCH:=@PATCH@
 PRINTF:=@PRINTF@
 RM:=@RM@
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
index 16b0df0..29ebea9 100644
--- a/common/autoconf/toolchain.m4
+++ b/common/autoconf/toolchain.m4
@@ -440,7 +440,7 @@
 #
 # $1 = compiler to test (CC or CXX)
 # $2 = human readable name of compiler (C or C++)
-# $3 = list of compiler names to search for
+# $3 = compiler name to search for
 AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
 [
   COMPILER_NAME=$2
@@ -482,15 +482,15 @@
     if test -n "$TOOLCHAIN_PATH"; then
       PATH_save="$PATH"
       PATH="$TOOLCHAIN_PATH"
-      AC_PATH_PROGS(TOOLCHAIN_PATH_$1, $SEARCH_LIST)
+      AC_PATH_TOOL(TOOLCHAIN_PATH_$1, $SEARCH_LIST)
       $1=$TOOLCHAIN_PATH_$1
       PATH="$PATH_save"
     fi
 
-    # AC_PATH_PROGS can't be run multiple times with the same variable,
+    # AC_PATH_TOOL can't be run multiple times with the same variable,
     # so create a new name for this run.
     if test "x[$]$1" = x; then
-      AC_PATH_PROGS(POTENTIAL_$1, $SEARCH_LIST)
+      AC_PATH_TOOL(POTENTIAL_$1, $SEARCH_LIST)
       $1=$POTENTIAL_$1
     fi
 
diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt
index e5fe5af..73ccb0a 100644
--- a/common/bin/unshuffle_list.txt
+++ b/common/bin/unshuffle_list.txt
@@ -361,8 +361,8 @@
 jdk/src/java.base/share/native/libverify/check_format.c : jdk/src/share/native/common/check_format.c
 jdk/src/java.base/share/native/libverify/opcodes.in_out : jdk/src/share/native/common/opcodes.in_out
 jdk/src/java.base/share/native/libzip : jdk/src/share/native/java/util/zip
-jdk/src/java.base/share/native/libzip/zlib-1.2.8 : jdk/src/share/native/java/util/zip/zlib-1.2.8
-jdk/src/java.base/share/native/libzip/zlib-1.2.8/patches/ChangeLog_java : jdk/src/share/native/java/util/zip/zlib-1.2.8/patches/ChangeLog_java
+jdk/src/java.base/share/native/libzip/zlib : jdk/src/share/native/java/util/zip/zlib
+jdk/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java : jdk/src/share/native/java/util/zip/zlib/patches/ChangeLog_java
 jdk/src/java.base/unix/classes/java/io : jdk/src/solaris/classes/java/io
 jdk/src/java.base/unix/classes/java/lang : jdk/src/solaris/classes/java/lang
 jdk/src/java.base/unix/classes/java/net : jdk/src/solaris/classes/java/net
diff --git a/common/bin/update-build-readme.sh b/common/bin/update-build-readme.sh
deleted file mode 100644
index 9d1968a..0000000
--- a/common/bin/update-build-readme.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-
-# Get an absolute path to this script, since that determines the top-level
-# directory.
-this_script_dir=`dirname $0`
-TOPDIR=`cd $this_script_dir/../.. > /dev/null && pwd`
-
-GREP=grep
-MD_FILE=$TOPDIR/README-builds.md
-HTML_FILE=$TOPDIR/README-builds.html
-
-# Locate the markdown processor tool and check that it is the correct version.
-locate_markdown_processor() {
-  if [ -z "$MARKDOWN" ]; then
-    MARKDOWN=`which markdown 2> /dev/null`
-    if [ -z "$MARKDOWN" ]; then
-      echo "Error: Cannot locate markdown processor" 1>&2
-      exit 1
-    fi
-  fi
-
-  # Test version
-  MARKDOWN_VERSION=`$MARKDOWN -version | $GREP version`
-  if [ "x$MARKDOWN_VERSION" != "xThis is Markdown, version 1.0.1." ]; then
-    echo "Error: Expected markdown version 1.0.1." 1>&2
-    echo "Actual version found: $MARKDOWN_VERSION" 1>&2
-    echo "Download markdown here: https://daringfireball.net/projects/markdown/"  1>&2
-    exit 1
-  fi
-
-}
-
-# Verify that the source markdown file looks sound.
-verify_source_code() {
-  TOO_LONG_LINES=`$GREP -E -e '^.{80}.+$' $MD_FILE`
-  if [ "x$TOO_LONG_LINES" != x ]; then
-    echo "Warning: The following lines are longer than 80 characters:"
-    $GREP -E -e '^.{80}.+$' $MD_FILE
-  fi
-}
-
-# Convert the markdown file to html format.
-process_source() {
-  echo "Generating html file from markdown"
-  cat > $HTML_FILE << END
-<html>
-  <head>
-    <title>OpenJDK Build README</title>
-  </head>
-  <body>
-END
-  markdown $MD_FILE >> $HTML_FILE
-  cat >> $HTML_FILE <<END
-  </body>
-</html>
-END
-  echo "Done"
-}
-
-locate_markdown_processor
-verify_source_code
-process_source
diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js
index ff86de2..1ffff5d 100644
--- a/common/conf/jib-profiles.js
+++ b/common/conf/jib-profiles.js
@@ -231,7 +231,8 @@
     // List of the main profile names used for iteration
     common.main_profile_names = [
         "linux-x64", "linux-x86", "macosx-x64", "solaris-x64",
-        "solaris-sparcv9", "windows-x64", "windows-x86"
+        "solaris-sparcv9", "windows-x64", "windows-x86",
+        "linux-arm64", "linux-arm-vfp-hflt", "linux-arm-vfp-hflt-dyn"
     ];
 
     // These are the base setttings for all the main build profiles.
@@ -391,7 +392,7 @@
     // on such hardware.
     if (input.build_cpu == "sparcv9") {
        var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\"");
-       if (cpu_brand.trim() == 'SPARC-M7') {
+       if (cpu_brand.trim().match('SPARC-.7')) {
            boot_jdk_revision = "8u20";
            boot_jdk_subdirpart = "1.8.0_20";
        }
@@ -401,6 +402,8 @@
     common.boot_jdk_home = input.get("boot_jdk", "home_path") + "/jdk"
         + common.boot_jdk_subdirpart
         + (input.build_os == "macosx" ? ".jdk/Contents/Home" : "");
+    common.boot_jdk_platform = input.build_os + "-"
+        + (input.build_cpu == "x86" ? "i586" : input.build_cpu);
 
     return common;
 };
@@ -469,8 +472,43 @@
             build_cpu: "x64",
             dependencies: ["devkit", "freetype"],
             configure_args: concat(common.configure_args_32bit),
+        },
+
+        "linux-arm64": {
+            target_os: "linux",
+            target_cpu: "aarch64",
+            build_cpu: "x64",
+            dependencies: ["devkit", "build_devkit", "cups", "headless_stubs"],
+            configure_args: [
+                "--with-cpu-port=arm64",
+                "--with-jvm-variants=server",
+                "--openjdk-target=aarch64-linux-gnu",
+                "--enable-headless-only"
+            ],
+        },
+
+        "linux-arm-vfp-hflt": {
+            target_os: "linux",
+            target_cpu: "arm",
+            build_cpu: "x64",
+            dependencies: ["devkit", "build_devkit", "cups"],
+            configure_args: [
+                "--with-jvm-variants=minimal1,client",
+                "--with-x=" + input.get("devkit", "install_path") + "/arm-linux-gnueabihf/libc/usr/X11R6-PI",
+                "--openjdk-target=arm-linux-gnueabihf",
+                "--with-abi-profile=arm-vfp-hflt"
+            ],
+        },
+
+        // Special version of the SE profile adjusted to be testable on arm64 hardware.
+        "linux-arm-vfp-hflt-dyn": {
+            configure_args: "--with-stdc++lib=dynamic"
         }
     };
+    // Let linux-arm-vfp-hflt-dyn inherit everything from linux-arm-vfp-hflt
+    profiles["linux-arm-vfp-hflt-dyn"] = concatObjects(
+        profiles["linux-arm-vfp-hflt-dyn"], profiles["linux-arm-vfp-hflt"]);
+
     // Add the base settings to all the main profiles
     common.main_profile_names.forEach(function (name) {
         profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
@@ -656,16 +694,28 @@
         "windows-x86": {
             platform: "windows-x86",
             demo_ext: "zip"
+        },
+       "linux-arm64": {
+            platform: "linux-arm64-vfp-hflt",
+            demo_ext: "tar.gz"
+        },
+        "linux-arm-vfp-hflt": {
+            platform: "linux-arm32-vfp-hflt",
+            demo_ext: "tar.gz"
+        },
+        "linux-arm-vfp-hflt-dyn": {
+            platform: "linux-arm32-vfp-hflt-dyn",
+            demo_ext: "tar.gz"
         }
     }
     // Generate common artifacts for all main profiles
-    common.main_profile_names.forEach(function (name) {
+    Object.keys(artifactData).forEach(function (name) {
         profiles[name] = concatObjects(profiles[name],
             common.main_profile_artifacts(artifactData[name].platform, artifactData[name].demo_ext));
     });
 
     // Generate common artifacts for all debug profiles
-    common.main_profile_names.forEach(function (name) {
+    Object.keys(artifactData).forEach(function (name) {
         var debugName = name + common.debug_suffix;
         profiles[debugName] = concatObjects(profiles[debugName],
             common.debug_profile_artifacts(artifactData[name].platform));
@@ -832,15 +882,16 @@
  */
 var getJibProfilesDependencies = function (input, common) {
 
-    var boot_jdk_platform = input.build_os + "-"
-        + (input.build_cpu == "x86" ? "i586" : input.build_cpu);
-
     var devkit_platform_revisions = {
         linux_x64: "gcc4.9.2-OEL6.4+1.1",
         macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
         solaris_x64: "SS12u4-Solaris11u1+1.0",
         solaris_sparcv9: "SS12u4-Solaris11u1+1.0",
-        windows_x64: "VS2013SP4+1.0"
+        windows_x64: "VS2013SP4+1.0",
+        linux_aarch64: "gcc-linaro-aarch64-linux-gnu-4.8-2013.11_linux+1.0",
+        linux_arm: (input.profile != null && input.profile.indexOf("hflt") >= 0
+                    ? "gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux+1.0"
+                    : "arm-linaro-4.7+1.0")
     };
 
     var devkit_platform = (input.target_cpu == "x86"
@@ -853,9 +904,9 @@
             server: "javare",
             module: "jdk",
             revision: common.boot_jdk_revision,
-            checksum_file: boot_jdk_platform + "/MD5_VALUES",
-            file: boot_jdk_platform + "/jdk-" + common.boot_jdk_revision
-                + "-" + boot_jdk_platform + ".tar.gz",
+            checksum_file: common.boot_jdk_platform + "/MD5_VALUES",
+            file: common.boot_jdk_platform + "/jdk-" + common.boot_jdk_revision
+                + "-" + common.boot_jdk_platform + ".tar.gz",
             configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
             environment_path: common.boot_jdk_home + "/bin"
         },
@@ -883,7 +934,7 @@
         jtreg: {
             server: "javare",
             revision: "4.2",
-            build_number: "b05",
+            build_number: "b07",
             checksum_file: "MD5_VALUES",
             file: "jtreg_bin-4.2.zip",
             environment_name: "JT_HOME",
@@ -911,7 +962,7 @@
         freetype: {
             organization: common.organization,
             ext: "tar.gz",
-            revision: "2.3.4+1.0",
+            revision: "2.7.1-v120+1.0",
             module: "freetype-" + input.target_platform
         }
     };
diff --git a/common/doc/building.html b/common/doc/building.html
new file mode 100644
index 0000000..f44bceb
--- /dev/null
+++ b/common/doc/building.html
@@ -0,0 +1,749 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <meta http-equiv="Content-Style-Type" content="text/css" />
+  <meta name="generator" content="pandoc" />
+  <title>OpenJDK Build README</title>
+  <style type="text/css">code{white-space: pre;}</style>
+</head>
+<body>
+<div id="header">
+<h1 class="title">OpenJDK Build README</h1>
+</div>
+<div class="figure">
+<img src="http://openjdk.java.net/images/openjdk.png" alt="OpenJDK" />
+<p class="caption">OpenJDK</p>
+</div>
+<hr />
+<h2 id="introduction">Introduction</h2>
+<p>This README file contains build instructions for the <a href="http://openjdk.java.net">OpenJDK</a>. Building the source code for the OpenJDK requires a certain degree of technical expertise.</p>
+<h3 id="this-is-a-major-re-write-of-this-document.">!!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!</h3>
+<p>Some Headlines:</p>
+<ul>
+<li>The build is now a &quot;<code>configure &amp;&amp; make</code>&quot; style build</li>
+<li>Any GNU make 3.81 or newer should work, except on Windows where 4.0 or newer is recommended.</li>
+<li>The build should scale, i.e. more processors should cause the build to be done in less wall-clock time</li>
+<li>Nested or recursive make invocations have been significantly reduced, as has the total fork/exec or spawning of sub processes during the build</li>
+<li>Windows MKS usage is no longer supported</li>
+<li>Windows Visual Studio <code>vsvars*.bat</code> and <code>vcvars*.bat</code> files are run automatically</li>
+<li>Ant is no longer used when building the OpenJDK</li>
+<li>Use of ALT_* environment variables for configuring the build is no longer supported</li>
+</ul>
+<hr />
+<h2 id="contents">Contents</h2>
+<ul>
+<li><a href="#introduction">Introduction</a></li>
+<li><a href="#hg">Use of Mercurial</a>
+<ul>
+<li><a href="#get_source">Getting the Source</a></li>
+<li><a href="#repositories">Repositories</a></li>
+</ul></li>
+<li><a href="#building">Building</a>
+<ul>
+<li><a href="#setup">System Setup</a>
+<ul>
+<li><a href="#linux">Linux</a></li>
+<li><a href="#solaris">Solaris</a></li>
+<li><a href="#macosx">Mac OS X</a></li>
+<li><a href="#windows">Windows</a></li>
+</ul></li>
+<li><a href="#configure">Configure</a></li>
+<li><a href="#make">Make</a></li>
+</ul></li>
+<li><a href="#testing">Testing</a></li>
+</ul>
+<hr />
+<ul>
+<li><a href="#hints">Appendix A: Hints and Tips</a>
+<ul>
+<li><a href="#faq">FAQ</a></li>
+<li><a href="#performance">Build Performance Tips</a></li>
+<li><a href="#troubleshooting">Troubleshooting</a></li>
+</ul></li>
+<li><a href="#gmake">Appendix B: GNU Make Information</a></li>
+<li><a href="#buildenvironments">Appendix C: Build Environments</a></li>
+</ul>
+<hr />
+<h2 id="use-of-mercurial">Use of Mercurial</h2>
+<p>The OpenJDK sources are maintained with the revision control system <a href="http://mercurial.selenic.com/wiki/Mercurial">Mercurial</a>. If you are new to Mercurial, please see the <a href="http://mercurial.selenic.com/wiki/BeginnersGuides">Beginner Guides</a> or refer to the <a href="http://hgbook.red-bean.com/">Mercurial Book</a>. The first few chapters of the book provide an excellent overview of Mercurial, what it is and how it works.</p>
+<p>For using Mercurial with the OpenJDK refer to the <a href="http://openjdk.java.net/guide/repositories.html#installConfig">Developer Guide: Installing and Configuring Mercurial</a> section for more information.</p>
+<h3 id="getting-the-source">Getting the Source</h3>
+<p>To get the entire set of OpenJDK Mercurial repositories use the script <code>get_source.sh</code> located in the root repository:</p>
+<pre><code>  hg clone http://hg.openjdk.java.net/jdk9/jdk9 YourOpenJDK
+  cd YourOpenJDK
+  bash ./get_source.sh</code></pre>
+<p>Once you have all the repositories, keep in mind that each repository is its own independent repository. You can also re-run <code>./get_source.sh</code> anytime to pull over all the latest changesets in all the repositories. This set of nested repositories has been given the term &quot;forest&quot; and there are various ways to apply the same <code>hg</code> command to each of the repositories. For example, the script <code>make/scripts/hgforest.sh</code> can be used to repeat the same <code>hg</code> command on every repository, e.g.</p>
+<pre><code>  cd YourOpenJDK
+  bash ./make/scripts/hgforest.sh status</code></pre>
+<h3 id="repositories">Repositories</h3>
+<p>The set of repositories and what they contain:</p>
+<ul>
+<li><strong>. (root)</strong> contains common configure and makefile logic</li>
+<li><strong>hotspot</strong> contains source code and make files for building the OpenJDK Hotspot Virtual Machine</li>
+<li><strong>langtools</strong> contains source code for the OpenJDK javac and language tools</li>
+<li><strong>jdk</strong> contains source code and make files for building the OpenJDK runtime libraries and misc files</li>
+<li><strong>jaxp</strong> contains source code for the OpenJDK JAXP functionality</li>
+<li><strong>jaxws</strong> contains source code for the OpenJDK JAX-WS functionality</li>
+<li><strong>corba</strong> contains source code for the OpenJDK Corba functionality</li>
+<li><strong>nashorn</strong> contains source code for the OpenJDK JavaScript implementation</li>
+</ul>
+<h3 id="repository-source-guidelines">Repository Source Guidelines</h3>
+<p>There are some very basic guidelines:</p>
+<ul>
+<li>Use of whitespace in source files (.java, .c, .h, .cpp, and .hpp files) is restricted. No TABs, no trailing whitespace on lines, and files should not terminate in more than one blank line.</li>
+<li>Files with execute permissions should not be added to the source repositories.</li>
+<li>All generated files need to be kept isolated from the files maintained or managed by the source control system. The standard area for generated files is the top level <code>build/</code> directory.</li>
+<li>The default build process should be to build the product and nothing else, in one form, e.g. a product (optimized), debug (non-optimized, -g plus assert logic), or fastdebug (optimized, -g plus assert logic).</li>
+<li>The <code>.hgignore</code> file in each repository must exist and should include <code>^build/</code>, <code>^dist/</code> and optionally any <code>nbproject/private</code> directories. <strong>It should NEVER</strong> include anything in the <code>src/</code> or <code>test/</code> or any managed directory area of a repository.</li>
+<li>Directory names and file names should never contain blanks or non-printing characters.</li>
+<li>Generated source or binary files should NEVER be added to the repository (that includes <code>javah</code> output). There are some exceptions to this rule, in particular with some of the generated configure scripts.</li>
+<li>Files not needed for typical building or testing of the repository should not be added to the repository.</li>
+</ul>
+<hr />
+<h2 id="building">Building</h2>
+<p>The very first step in building the OpenJDK is making sure the system itself has everything it needs to do OpenJDK builds. Once a system is setup, it generally doesn't need to be done again.</p>
+<p>Building the OpenJDK is now done with running a <code>configure</code> script which will try and find and verify you have everything you need, followed by running <code>make</code>, e.g.</p>
+<blockquote>
+<p><strong><code>bash ./configure</code></strong><br />
+<strong><code>make all</code></strong></p>
+</blockquote>
+<p>Where possible the <code>configure</code> script will attempt to located the various components in the default locations or via component specific variable settings. When the normal defaults fail or components cannot be found, additional <code>configure</code> options may be necessary to help <code>configure</code> find the necessary tools for the build, or you may need to re-visit the setup of your system due to missing software packages.</p>
+<p><strong>NOTE:</strong> The <code>configure</code> script file does not have execute permissions and will need to be explicitly run with <code>bash</code>, see the source guidelines.</p>
+<hr />
+<h3 id="system-setup">System Setup</h3>
+<p>Before even attempting to use a system to build the OpenJDK there are some very basic system setups needed. For all systems:</p>
+<ul>
+<li>Be sure the GNU make utility is version 3.81 (4.0 on windows) or newer, e.g. run &quot;<code>make -version</code>&quot;</li>
+</ul>
+<p><a name="bootjdk"></a> * Install a Bootstrap JDK. All OpenJDK builds require access to a previously released JDK called the <em>bootstrap JDK</em> or <em>boot JDK.</em> The general rule is that the bootstrap JDK must be an instance of the previous major release of the JDK. In addition, there may be a requirement to use a release at or beyond a particular update level.</p>
+<p><strong><em>Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as the boot JDK, to ensure that JDK 9 dependencies are not introduced into the parts of the system that are built with JDK 8.</em></strong></p>
+<p>The JDK 8 binaries can be downloaded from Oracle's <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 8 download site</a>. For build performance reasons it is very important that this bootstrap JDK be made available on the local disk of the machine doing the build. You should add its <code>bin</code> directory to the <code>PATH</code> environment variable. If <code>configure</code> has any issues finding this JDK, you may need to use the <code>configure</code> option <code>--with-boot-jdk</code>.</p>
+<ul>
+<li>Ensure that GNU make, the Bootstrap JDK, and the compilers are all in your PATH environment variable.</li>
+</ul>
+<p>And for specific systems:</p>
+<ul>
+<li><strong>Linux</strong></li>
+</ul>
+<p>Install all the software development packages needed including <a href="#alsa">alsa</a>, <a href="#freetype">freetype</a>, <a href="#cups">cups</a>, and <a href="#xrender">xrender</a>. See <a href="#SDBE">specific system packages</a>.</p>
+<ul>
+<li><strong>Solaris</strong></li>
+</ul>
+<p>Install all the software development packages needed including <a href="#studio">Studio Compilers</a>, <a href="#freetype">freetype</a>, <a href="#cups">cups</a>, and <a href="#xrender">xrender</a>. See <a href="#SDBE">specific system packages</a>.</p>
+<ul>
+<li><p><strong>Windows</strong></p></li>
+<li>Install one of <a href="#cygwin">CYGWIN</a> or <a href="#msys">MinGW/MSYS</a></li>
+<li><p>Install <a href="#vs2013">Visual Studio 2013</a></p></li>
+<li><p><strong>Mac OS X</strong></p></li>
+</ul>
+<p>Install <a href="https://developer.apple.com/xcode/">XCode 6.3</a></p>
+<h4 id="linux">Linux</h4>
+<p>With Linux, try and favor the system packages over building your own or getting packages from other areas. Most Linux builds should be possible with the system's available packages.</p>
+<p>Note that some Linux systems have a habit of pre-populating your environment variables for you, for example <code>JAVA_HOME</code> might get pre-defined for you to refer to the JDK installed on your Linux system. You will need to unset <code>JAVA_HOME</code>. It's a good idea to run <code>env</code> and verify the environment variables you are getting from the default system settings make sense for building the OpenJDK.</p>
+<h4 id="solaris">Solaris</h4>
+<h5 id="studio-compilers">Studio Compilers</h5>
+<p>At a minimum, the <a href="http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.htm">Studio 12 Update 4 Compilers</a> (containing version 5.13 of the C and C++ compilers) is required, including specific patches.</p>
+<p>The Solaris Studio installation should contain at least these packages:</p>
+<table>
+<thead>
+<tr class="header">
+<th align="left">Package</th>
+<th align="left">Version</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td align="left">developer/solarisstudio-124/backend</td>
+<td align="left">12.4-1.0.6.0</td>
+</tr>
+<tr class="even">
+<td align="left">developer/solarisstudio-124/c++</td>
+<td align="left">12.4-1.0.10.0</td>
+</tr>
+<tr class="odd">
+<td align="left">developer/solarisstudio-124/cc</td>
+<td align="left">12.4-1.0.4.0</td>
+</tr>
+<tr class="even">
+<td align="left">developer/solarisstudio-124/library/c++-libs</td>
+<td align="left">12.4-1.0.10.0</td>
+</tr>
+<tr class="odd">
+<td align="left">developer/solarisstudio-124/library/math-libs</td>
+<td align="left">12.4-1.0.0.1</td>
+</tr>
+<tr class="even">
+<td align="left">developer/solarisstudio-124/library/studio-gccrt</td>
+<td align="left">12.4-1.0.0.1</td>
+</tr>
+<tr class="odd">
+<td align="left">developer/solarisstudio-124/studio-common</td>
+<td align="left">12.4-1.0.0.1</td>
+</tr>
+<tr class="even">
+<td align="left">developer/solarisstudio-124/studio-ja</td>
+<td align="left">12.4-1.0.0.1</td>
+</tr>
+<tr class="odd">
+<td align="left">developer/solarisstudio-124/studio-legal</td>
+<td align="left">12.4-1.0.0.1</td>
+</tr>
+<tr class="even">
+<td align="left">developer/solarisstudio-124/studio-zhCN</td>
+<td align="left">12.4-1.0.0.1</td>
+</tr>
+</tbody>
+</table>
+<p>In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc version.</p>
+<p>Place the <code>bin</code> directory in <code>PATH</code>.</p>
+<p>The Oracle Solaris Studio Express compilers at: <a href="http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-142582.html">Oracle Solaris Studio Express Download site</a> are also an option, although these compilers have not been extensively used yet.</p>
+<h4 id="windows">Windows</h4>
+<h5 id="windows-unix-toolkit">Windows Unix Toolkit</h5>
+<p>Building on Windows requires a Unix-like environment, notably a Unix-like shell. There are several such environments available of which <a href="http://www.cygwin.com/">Cygwin</a> and <a href="http://www.mingw.org/wiki/MSYS">MinGW/MSYS</a> are currently supported for the OpenJDK build. One of the differences of these systems from standard Windows tools is the way they handle Windows path names, particularly path names which contain spaces, backslashes as path separators and possibly drive letters. Depending on the use case and the specifics of each environment these path problems can be solved by a combination of quoting whole paths, translating backslashes to forward slashes, escaping backslashes with additional backslashes and translating the path names to their <a href="http://en.wikipedia.org/wiki/8.3_filename">&quot;8.3&quot; version</a>.</p>
+<h6 id="cygwin">CYGWIN</h6>
+<p>CYGWIN is an open source, Linux-like environment which tries to emulate a complete POSIX layer on Windows. It tries to be smart about path names and can usually handle all kinds of paths if they are correctly quoted or escaped although internally it maps drive letters <code>&lt;drive&gt;:</code> to a virtual directory <code>/cygdrive/&lt;drive&gt;</code>.</p>
+<p>You can always use the <code>cygpath</code> utility to map pathnames with spaces or the backslash character into the <code>C:/</code> style of pathname (called 'mixed'), e.g. <code>cygpath -s -m &quot;&lt;path&gt;&quot;</code>.</p>
+<p>Note that the use of CYGWIN creates a unique problem with regards to setting <a href="#path"><code>PATH</code></a>. Normally on Windows the <code>PATH</code> variable contains directories separated with the &quot;;&quot; character (Solaris and Linux use &quot;:&quot;). With CYGWIN, it uses &quot;:&quot;, but that means that paths like &quot;C:/path&quot; cannot be placed in the CYGWIN version of <code>PATH</code> and instead CYGWIN uses something like <code>/cygdrive/c/path</code> which CYGWIN understands, but only CYGWIN understands.</p>
+<p>The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about CYGWIN can be obtained from the CYGWIN website at <a href="http://www.cygwin.com">www.cygwin.com</a>.</p>
+<p>By default CYGWIN doesn't install all the tools required for building the OpenJDK. Along with the default installation, you need to install the following tools.</p>
+<table>
+<thead>
+<tr class="header">
+<th align="left">Binary Name</th>
+<th align="left">Category</th>
+<th align="left">Package</th>
+<th align="left">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td align="left">ar.exe</td>
+<td align="left">Devel</td>
+<td align="left">binutils</td>
+<td align="left">The GNU assembler, linker and binary utilities</td>
+</tr>
+<tr class="even">
+<td align="left">make.exe</td>
+<td align="left">Devel</td>
+<td align="left">make</td>
+<td align="left">The GNU version of the 'make' utility built for CYGWIN</td>
+</tr>
+<tr class="odd">
+<td align="left">m4.exe</td>
+<td align="left">Interpreters</td>
+<td align="left">m4</td>
+<td align="left">GNU implementation of the traditional Unix macro processor</td>
+</tr>
+<tr class="even">
+<td align="left">cpio.exe</td>
+<td align="left">Utils</td>
+<td align="left">cpio</td>
+<td align="left">A program to manage archives of files</td>
+</tr>
+<tr class="odd">
+<td align="left">gawk.exe</td>
+<td align="left">Utils</td>
+<td align="left">awk</td>
+<td align="left">Pattern-directed scanning and processing language</td>
+</tr>
+<tr class="even">
+<td align="left">file.exe</td>
+<td align="left">Utils</td>
+<td align="left">file</td>
+<td align="left">Determines file type using 'magic' numbers</td>
+</tr>
+<tr class="odd">
+<td align="left">zip.exe</td>
+<td align="left">Archive</td>
+<td align="left">zip</td>
+<td align="left">Package and compress (archive) files</td>
+</tr>
+<tr class="even">
+<td align="left">unzip.exe</td>
+<td align="left">Archive</td>
+<td align="left">unzip</td>
+<td align="left">Extract compressed files in a ZIP archive</td>
+</tr>
+<tr class="odd">
+<td align="left">free.exe</td>
+<td align="left">System</td>
+<td align="left">procps</td>
+<td align="left">Display amount of free and used memory in the system</td>
+</tr>
+</tbody>
+</table>
+<p>Note that the CYGWIN software can conflict with other non-CYGWIN software on your Windows system. CYGWIN provides a <a href="http://cygwin.com/faq/faq.using.html">FAQ</a> for known issues and problems, of particular interest is the section on <a href="http://cygwin.com/faq/faq.using.html#faq.using.bloda">BLODA (applications that interfere with CYGWIN)</a>.</p>
+<h6 id="mingwmsys">MinGW/MSYS</h6>
+<p>MinGW (&quot;Minimalist GNU for Windows&quot;) is a collection of free Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building applications and programs which rely on traditional UNIX tools to be present. Among others this includes tools like <code>bash</code> and <code>make</code>. See <a href="http://www.mingw.org/wiki/MSYS">MinGW/MSYS</a> for more information.</p>
+<p>Like Cygwin, MinGW/MSYS can handle different types of path formats. They are internally converted to paths with forward slashes and drive letters <code>&lt;drive&gt;:</code> replaced by a virtual directory <code>/&lt;drive&gt;</code>. Additionally, MSYS automatically detects binaries compiled for the MSYS environment and feeds them with the internal, Unix-style path names. If native Windows applications are called from within MSYS programs their path arguments are automatically converted back to Windows style path names with drive letters and backslashes as path separators. This may cause problems for Windows applications which use forward slashes as parameter separator (e.g. <code>cl /nologo /I</code>) because MSYS may wrongly <a href="http://mingw.org/wiki/Posix_path_conversion">replace such parameters by drive letters</a>.</p>
+<p>In addition to the tools which will be installed by default, you have to manually install the <code>msys-zip</code> and <code>msys-unzip</code> packages. This can be easily done with the MinGW command line installer:</p>
+<pre><code>  mingw-get.exe install msys-zip
+  mingw-get.exe install msys-unzip</code></pre>
+<h5 id="visual-studio-2013-compilers">Visual Studio 2013 Compilers</h5>
+<p>The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio C++ 2013 (VS2013) Professional Edition or Express compiler. The compiler and other tools are expected to reside in the location defined by the variable <code>VS120COMNTOOLS</code> which is set by the Microsoft Visual Studio installer.</p>
+<p>Only the C++ part of VS2013 is needed. Try to let the installation go to the default install directory. Always reboot your system after installing VS2013. The system environment variable VS120COMNTOOLS should be set in your environment.</p>
+<p>Make sure that TMP and TEMP are also set in the environment and refer to Windows paths that exist, like <code>C:\temp</code>, not <code>/tmp</code>, not <code>/cygdrive/c/temp</code>, and not <code>C:/temp</code>. <code>C:\temp</code> is just an example, it is assumed that this area is private to the user, so by default after installs you should see a unique user path in these variables.</p>
+<h4 id="mac-os-x">Mac OS X</h4>
+<p>Make sure you get the right XCode version.</p>
+<hr />
+<h3 id="configure">Configure</h3>
+<p>The basic invocation of the <code>configure</code> script looks like:</p>
+<blockquote>
+<p><strong><code>bash ./configure [options]</code></strong></p>
+</blockquote>
+<p>This will create an output directory containing the &quot;configuration&quot; and setup an area for the build result. This directory typically looks like:</p>
+<blockquote>
+<p><strong><code>build/linux-x64-normal-server-release</code></strong></p>
+</blockquote>
+<p><code>configure</code> will try to figure out what system you are running on and where all necessary build components are. If you have all prerequisites for building installed, it should find everything. If it fails to detect any component automatically, it will exit and inform you about the problem. When this happens, read more below in <a href="#configureoptions">the <code>configure</code> options</a>.</p>
+<p>Some examples:</p>
+<blockquote>
+<p><strong>Windows 32bit build with freetype specified:</strong><br />
+<code>bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32</code></p>
+</blockquote>
+<blockquote>
+<p><strong>Debug 64bit Build:</strong><br />
+<code>bash ./configure --enable-debug --with-target-bits=64</code></p>
+</blockquote>
+<h4 id="configure-options">Configure Options</h4>
+<p>Complete details on all the OpenJDK <code>configure</code> options can be seen with:</p>
+<blockquote>
+<p><strong><code>bash ./configure --help=short</code></strong></p>
+</blockquote>
+<p>Use <code>-help</code> to see all the <code>configure</code> options available. You can generate any number of different configurations, e.g. debug, release, 32, 64, etc.</p>
+<p>Some of the more commonly used <code>configure</code> options are:</p>
+<blockquote>
+<p><strong><code>--enable-debug</code></strong><br />
+set the debug level to fastdebug (this is a shorthand for <code>--with-debug-level=fastdebug</code>)</p>
+</blockquote>
+<p><a name="alsa"></a></p>
+<blockquote>
+<p><strong><code>--with-alsa=</code></strong><em>path</em><br />
+select the location of the Advanced Linux Sound Architecture (ALSA)</p>
+</blockquote>
+<blockquote>
+<p>Version 0.9.1 or newer of the ALSA files are required for building the OpenJDK on Linux. These Linux files are usually available from an &quot;alsa&quot; of &quot;libasound&quot; development package, and it's highly recommended that you try and use the package provided by the particular version of Linux that you are using.</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-boot-jdk=</code></strong><em>path</em><br />
+select the <a href="#bootjdk">Bootstrap JDK</a></p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-boot-jdk-jvmargs=</code></strong>&quot;<em>args</em>&quot;<br />
+provide the JVM options to be used to run the <a href="#bootjdk">Bootstrap JDK</a></p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-cacerts=</code></strong><em>path</em><br />
+select the path to the cacerts file.</p>
+</blockquote>
+<blockquote>
+<p>See <a href="http://en.wikipedia.org/wiki/Certificate_Authority">Certificate Authority on Wikipedia</a> for a better understanding of the Certificate Authority (CA). A certificates file named &quot;cacerts&quot; represents a system-wide keystore with CA certificates. In JDK and JRE binary bundles, the &quot;cacerts&quot; file contains root CA certificates from several public CAs (e.g., VeriSign, Thawte, and Baltimore). The source contain a cacerts file without CA root certificates. Formal JDK builders will need to secure permission from each public CA and include the certificates into their own custom cacerts file. Failure to provide a populated cacerts file will result in verification errors of a certificate chain during runtime. By default an empty cacerts file is provided and that should be fine for most JDK developers.</p>
+</blockquote>
+<p><a name="cups"></a></p>
+<blockquote>
+<p><strong><code>--with-cups=</code></strong><em>path</em><br />
+select the CUPS install location</p>
+</blockquote>
+<blockquote>
+<p>The Common UNIX Printing System (CUPS) Headers are required for building the OpenJDK on Solaris and Linux. The Solaris header files can be obtained by installing the package <strong>print/cups</strong>.</p>
+</blockquote>
+<blockquote>
+<p>The CUPS header files can always be downloaded from <a href="http://www.cups.org">www.cups.org</a>.</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-cups-include=</code></strong><em>path</em><br />
+select the CUPS include directory location</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-debug-level=</code></strong><em>level</em><br />
+select the debug information level of release, fastdebug, or slowdebug</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-dev-kit=</code></strong><em>path</em><br />
+select location of the compiler install or developer install location</p>
+</blockquote>
+<p><a name="freetype"></a></p>
+<blockquote>
+<p><strong><code>--with-freetype=</code></strong><em>path</em><br />
+select the freetype files to use.</p>
+</blockquote>
+<blockquote>
+<p>Expecting the freetype libraries under <code>lib/</code> and the headers under <code>include/</code>.</p>
+</blockquote>
+<blockquote>
+<p>Version 2.3 or newer of FreeType is required. On Unix systems required files can be available as part of your distribution (while you still may need to upgrade them). Note that you need development version of package that includes both the FreeType library and header files.</p>
+</blockquote>
+<blockquote>
+<p>You can always download latest FreeType version from the <a href="http://www.freetype.org">FreeType website</a>. Building the freetype 2 libraries from scratch is also possible, however on Windows refer to the <a href="http://freetype.freedesktop.org/wiki/FreeType_DLL">Windows FreeType DLL build instructions</a>.</p>
+</blockquote>
+<blockquote>
+<p>Note that by default FreeType is built with byte code hinting support disabled due to licensing restrictions. In this case, text appearance and metrics are expected to differ from Sun's official JDK build. See the <a href="http://freetype.sourceforge.net/freetype2">SourceForge FreeType2 Home Page</a> for more information.</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-import-hotspot=</code></strong><em>path</em><br />
+select the location to find hotspot binaries from a previous build to avoid building hotspot</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-target-bits=</code></strong><em>arg</em><br />
+select 32 or 64 bit build</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-jvm-variants=</code></strong><em>variants</em><br />
+select the JVM variants to build from, comma separated list that can include: server, client, kernel, zero and zeroshark</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-memory-size=</code></strong><em>size</em><br />
+select the RAM size that GNU make will think this system has</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-msvcr-dll=</code></strong><em>path</em><br />
+select the <code>msvcr100.dll</code> file to include in the Windows builds (C/C++ runtime library for Visual Studio).</p>
+</blockquote>
+<blockquote>
+<p>This is usually picked up automatically from the redist directories of Visual Studio 2013.</p>
+</blockquote>
+<blockquote>
+<p><strong><code>--with-num-cores=</code></strong><em>cores</em><br />
+select the number of cores to use (processor count or CPU count)</p>
+</blockquote>
+<p><a name="xrender"></a></p>
+<blockquote>
+<p><strong><code>--with-x=</code></strong><em>path</em><br />
+select the location of the X11 and xrender files.</p>
+</blockquote>
+<blockquote>
+<p>The XRender Extension Headers are required for building the OpenJDK on Solaris and Linux. The Linux header files are usually available from a &quot;Xrender&quot; development package, it's recommended that you try and use the package provided by the particular distribution of Linux that you are using. The Solaris XRender header files is included with the other X11 header files in the package <strong>SFWxwinc</strong> on new enough versions of Solaris and will be installed in <code>/usr/X11/include/X11/extensions/Xrender.h</code> or <code>/usr/openwin/share/include/X11/extensions/Xrender.h</code></p>
+</blockquote>
+<hr />
+<h3 id="make">Make</h3>
+<p>The basic invocation of the <code>make</code> utility looks like:</p>
+<blockquote>
+<p><strong><code>make all</code></strong></p>
+</blockquote>
+<p>This will start the build to the output directory containing the &quot;configuration&quot; that was created by the <code>configure</code> script. Run <code>make help</code> for more information on the available targets.</p>
+<p>There are some of the make targets that are of general interest:</p>
+<blockquote>
+<p><em>empty</em><br />
+build everything but no images</p>
+</blockquote>
+<blockquote>
+<p><strong><code>all</code></strong><br />
+build everything including images</p>
+</blockquote>
+<blockquote>
+<p><strong><code>all-conf</code></strong><br />
+build all configurations</p>
+</blockquote>
+<blockquote>
+<p><strong><code>images</code></strong><br />
+create complete j2sdk and j2re images</p>
+</blockquote>
+<blockquote>
+<p><strong><code>install</code></strong><br />
+install the generated images locally, typically in <code>/usr/local</code></p>
+</blockquote>
+<blockquote>
+<p><strong><code>clean</code></strong><br />
+remove all files generated by make, but not those generated by <code>configure</code></p>
+</blockquote>
+<blockquote>
+<p><strong><code>dist-clean</code></strong><br />
+remove all files generated by both and <code>configure</code> (basically killing the configuration)</p>
+</blockquote>
+<blockquote>
+<p><strong><code>help</code></strong><br />
+give some help on using <code>make</code>, including some interesting make targets</p>
+</blockquote>
+<hr />
+<h2 id="testing">Testing</h2>
+<p>When the build is completed, you should see the generated binaries and associated files in the <code>j2sdk-image</code> directory in the output directory. In particular, the <code>build/*/images/j2sdk-image/bin</code> directory should contain executables for the OpenJDK tools and utilities for that configuration. The testing tool <code>jtreg</code> will be needed and can be found at: <a href="http://openjdk.java.net/jtreg/">the jtreg site</a>. The provided regression tests in the repositories can be run with the command:</p>
+<blockquote>
+<p><strong><code>cd test &amp;&amp; make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all</code></strong></p>
+</blockquote>
+<hr />
+<h2 id="appendix-a-hints-and-tips">Appendix A: Hints and Tips</h2>
+<h3 id="faq">FAQ</h3>
+<p><strong>Q:</strong> The <code>generated-configure.sh</code> file looks horrible! How are you going to edit it?<br />
+<strong>A:</strong> The <code>generated-configure.sh</code> file is generated (think &quot;compiled&quot;) by the autoconf tools. The source code is in <code>configure.ac</code> and various .m4 files in common/autoconf, which are much more readable.</p>
+<p><strong>Q:</strong> Why is the <code>generated-configure.sh</code> file checked in, if it is generated?<br />
+<strong>A:</strong> If it was not generated, every user would need to have the autoconf tools installed, and re-generate the <code>configure</code> file as the first step. Our goal is to minimize the work needed to be done by the user to start building OpenJDK, and to minimize the number of external dependencies required.</p>
+<p><strong>Q:</strong> Do you require a specific version of autoconf for regenerating <code>generated-configure.sh</code>?<br />
+<strong>A:</strong> Yes, version 2.69 is required and should be easy enough to aquire on all supported operating systems. The reason for this is to avoid large spurious changes in <code>generated-configure.sh</code>.</p>
+<p><strong>Q:</strong> How do you regenerate <code>generated-configure.sh</code> after making changes to the input files?<br />
+<strong>A:</strong> Regnerating <code>generated-configure.sh</code> should always be done using the script <code>common/autoconf/autogen.sh</code> to ensure that the correct files get updated. This script should also be run after mercurial tries to merge <code>generated-configure.sh</code> as a merge of the generated file is not guaranteed to be correct.</p>
+<p><strong>Q:</strong> What are the files in <code>common/makefiles/support/*</code> for? They look like gibberish.<br />
+<strong>A:</strong> They are a somewhat ugly hack to compensate for command line length limitations on certain platforms (Windows, Solaris). Due to a combination of limitations in make and the shell, command lines containing too many files will not work properly. These helper files are part of an elaborate hack that will compress the command line in the makefile and then uncompress it safely. We're not proud of it, but it does fix the problem. If you have any better suggestions, we're all ears! :-)</p>
+<p><strong>Q:</strong> I want to see the output of the commands that make runs, like in the old build. How do I do that?<br />
+<strong>A:</strong> You specify the <code>LOG</code> variable to make. There are several log levels:</p>
+<ul>
+<li><strong><code>warn</code></strong> -- Default and very quiet.</li>
+<li><strong><code>info</code></strong> -- Shows more progress information than warn.</li>
+<li><strong><code>debug</code></strong> -- Echos all command lines and prints all macro calls for compilation definitions.</li>
+<li><strong><code>trace</code></strong> -- Echos all $(shell) command lines as well.</li>
+</ul>
+<p><strong>Q:</strong> When do I have to re-run <code>configure</code>?<br />
+<strong>A:</strong> Normally you will run <code>configure</code> only once for creating a configuration. You need to re-run configuration only if you want to change any configuration options, or if you pull down changes to the <code>configure</code> script.</p>
+<p><strong>Q:</strong> I have added a new source file. Do I need to modify the makefiles?<br />
+<strong>A:</strong> Normally, no. If you want to create e.g. a new native library, you will need to modify the makefiles. But for normal file additions or removals, no changes are needed. There are certan exceptions for some native libraries where the source files are spread over many directories which also contain sources for other libraries. In these cases it was simply easier to create include lists rather than excludes.</p>
+<p><strong>Q:</strong> When I run <code>configure --help</code>, I see many strange options, like <code>--dvidir</code>. What is this?<br />
+<strong>A:</strong> Configure provides a slew of options by default, to all projects that use autoconf. Most of them are not used in OpenJDK, so you can safely ignore them. To list only OpenJDK specific features, use <code>configure --help=short</code> instead.</p>
+<p><strong>Q:</strong> <code>configure</code> provides OpenJDK-specific features such as <code>--with-builddeps-server</code> that are not described in this document. What about those?<br />
+<strong>A:</strong> Try them out if you like! But be aware that most of these are experimental features. Many of them don't do anything at all at the moment; the option is just a placeholder. Others depend on pieces of code or infrastructure that is currently not ready for prime time.</p>
+<p><strong>Q:</strong> How will you make sure you don't break anything?<br />
+<strong>A:</strong> We have a script that compares the result of the new build system with the result of the old. For most part, we aim for (and achieve) byte-by-byte identical output. There are however technical issues with e.g. native binaries, which might differ in a byte-by-byte comparison, even when building twice with the old build system. For these, we compare relevant aspects (e.g. the symbol table and file size). Note that we still don't have 100% equivalence, but we're close.</p>
+<p><strong>Q:</strong> I noticed this thing X in the build that looks very broken by design. Why don't you fix it?<br />
+<strong>A:</strong> Our goal is to produce a build output that is as close as technically possible to the old build output. If things were weird in the old build, they will be weird in the new build. Often, things were weird before due to obscurity, but in the new build system the weird stuff comes up to the surface. The plan is to attack these things at a later stage, after the new build system is established.</p>
+<p><strong>Q:</strong> The code in the new build system is not that well-structured. Will you fix this?<br />
+<strong>A:</strong> Yes! The new build system has grown bit by bit as we converted the old system. When all of the old build system is converted, we can take a step back and clean up the structure of the new build system. Some of this we plan to do before replacing the old build system and some will need to wait until after.</p>
+<p><strong>Q:</strong> Is anything able to use the results of the new build's default make target?<br />
+<strong>A:</strong> Yes, this is the minimal (or roughly minimal) set of compiled output 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. The packaging stuff that is part of the <code>images</code> target is not needed for a normal developer who wants to test his new code. Even if it's quite fast, it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-) (Or, well, at least single-digit seconds...)</p>
+<p><strong>Q:</strong> I usually set a specific environment variable when building, but I can't find the equivalent in the new build. What should I do?<br />
+<strong>A:</strong> It might very well be that we have neglected to add support for an option that was actually used from outside the build system. Email us and we will add support for it!</p>
+<h3 id="build-performance-tips">Build Performance Tips</h3>
+<p>Building OpenJDK 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><strong><code>--with-num-cores</code></strong> -- number of cores in the build system, e.g. <code>--with-num-cores=8</code></li>
+<li><strong><code>--with-memory-size</code></strong> -- memory (in MB) available in the build system, e.g. <code>--with-memory-size=1024</code></li>
+</ul>
+<p>It might also be necessary to specify the JVM arguments passed to the Bootstrap JDK, using e.g. <code>--with-boot-jdk-jvmargs=&quot;-Xmx8G -enableassertions&quot;</code>. Doing this will override the default JVM arguments passed to the Bootstrap JDK.</p>
+<p>One of the top goals of the new build system is to improve the build performance and decrease the time needed to build. This will soon also apply to the java compilation when the Smart Javac wrapper is fully supported.</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>
+<h4 id="building-with-ccache">Building with ccache</h4>
+<p>The OpenJDK 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>
+<h4 id="building-on-local-disk">Building on local disk</h4>
+<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. The performance penalty is extremely high for building on a network share, close to unusable.</p>
+<h4 id="building-only-one-jvm">Building only one JVM</h4>
+<p>The old build builds multiple JVMs on 32-bit systems (client and server; and on Windows kernel as well). In the new build we have changed this default to only build server when it's available. This improves build times for those not interested in multiple JVMs. To mimic the old behavior on platforms that support it, use <code>--with-jvm-variants=client,server</code>.</p>
+<h4 id="selecting-the-number-of-cores-to-build-on">Selecting the number of cores to build on</h4>
+<p>By default, <code>configure</code> will analyze your machine and run the make process in parallel with as many threads as you have cores. This behavior can be overridden, either &quot;permanently&quot; (on a <code>configure</code> basis) using <code>--with-num-cores=N</code> or for a single build only (on a make basis), using <code>make JOBS=N</code>.</p>
+<p>If you want to make a slower build just this time, to save some CPU power for other processes, you can run e.g. <code>make JOBS=2</code>. This will force the makefiles to only run 2 parallel processes, or even <code>make JOBS=1</code> which will disable parallelism.</p>
+<p>If you want to have it the other way round, namely having slow builds default and override with fast if you're impatient, you should call <code>configure</code> with <code>--with-num-cores=2</code>, making 2 the default. If you want to run with more cores, run <code>make JOBS=8</code></p>
+<h3 id="troubleshooting">Troubleshooting</h3>
+<h4 id="solving-build-problems">Solving build problems</h4>
+<p>If the build fails (and it's not due to a compilation error in a source file you've changed), the first thing you should do is to re-run the build with more verbosity. Do this by adding <code>LOG=debug</code> to your make command line.</p>
+<p>The build log (with both stdout and stderr intermingled, basically the same as you see on your console) can be found as <code>build.log</code> in your build directory.</p>
+<p>You can ask for help on build problems with the new build system on either the <a href="http://mail.openjdk.java.net/mailman/listinfo/build-dev">build-dev</a> or the <a href="http://mail.openjdk.java.net/mailman/listinfo/build-infra-dev">build-infra-dev</a> mailing lists. Please include the relevant parts of the build log.</p>
+<p>A build can fail for any number of reasons. Most failures are a result of trying to build in an environment in which all the pre-build requirements have not been met. The first step in troubleshooting a build failure is to recheck that you have satisfied all the pre-build requirements for your platform. Scanning the <code>configure</code> log is a good first step, making sure that what it found makes sense for your system. Look for strange error messages or any difficulties that <code>configure</code> had in finding things.</p>
+<p>Some of the more common problems with builds are briefly described below, with suggestions for remedies.</p>
+<ul>
+<li><p><strong>Corrupted Bundles on Windows:</strong><br />
+Some virus scanning software has been known to corrupt the downloading of zip bundles. It may be necessary to disable the 'on access' or 'real time' virus scanning features to prevent this corruption. This type of 'real time' virus scanning can also slow down the build process significantly. Temporarily disabling the feature, or excluding the build output directory may be necessary to get correct and faster builds.</p></li>
+<li><p><strong>Slow Builds:</strong><br />
+If your build machine seems to be overloaded from too many simultaneous C++ compiles, try setting the <code>JOBS=1</code> on the <code>make</code> command line. Then try increasing the count slowly to an acceptable level for your system. Also:</p></li>
+</ul>
+<p>Creating the javadocs can be very slow, if you are running javadoc, consider skipping that step.</p>
+<p>Faster CPUs, more RAM, and a faster DISK usually helps. The VM build tends to be CPU intensive (many C++ compiles), and the rest of the JDK will often be disk intensive.</p>
+<p>Faster compiles are possible using a tool called <a href="http://ccache.samba.org/">ccache</a>.</p>
+<ul>
+<li><strong>File time issues:</strong><br />
+If you see warnings that refer to file time stamps, e.g.</li>
+</ul>
+<blockquote>
+<p><em>Warning message:</em> <code>File 'xxx' has modification time in the future.</code><br />
+<em>Warning message:</em> <code>Clock skew detected. Your build may be incomplete.</code></p>
+</blockquote>
+<p>These warnings can occur when the clock on the build machine is out of sync with the timestamps on the source files. Other errors, apparently unrelated but in fact caused by the clock skew, can occur along with the clock skew warnings. These secondary errors may tend to obscure the fact that the true root cause of the problem is an out-of-sync clock.</p>
+<p>If you see these warnings, reset the clock on the build machine, run &quot;<code>gmake clobber</code>&quot; or delete the directory containing the build output, and restart the build from the beginning.</p>
+<ul>
+<li><strong>Error message: <code>Trouble writing out table to disk</code></strong><br />
+Increase the amount of swap space on your build machine. This could be caused by overloading the system and it may be necessary to use:</li>
+</ul>
+<blockquote>
+<p><code>make JOBS=1</code></p>
+</blockquote>
+<p>to reduce the load on the system.</p>
+<ul>
+<li><p><strong>Error Message: <code>libstdc++ not found</code>:</strong><br />
+This is caused by a missing libstdc++.a library. This is installed as part of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit Linux versions (e.g. Fedora) only install the 64-bit version of the libstdc++ package. Various parts of the JDK build require a static link of the C++ runtime libraries to allow for maximum portability of the built images.</p></li>
+<li><p><strong>Linux Error Message: <code>cannot restore segment prot after reloc</code></strong><br />
+This is probably an issue with SELinux (See <a href="http://en.wikipedia.org/wiki/SELinux">SELinux on Wikipedia</a>). Parts of the VM is built without the <code>-fPIC</code> for performance reasons.</p></li>
+</ul>
+<p>To completely disable SELinux:</p>
+<ol style="list-style-type: decimal">
+<li><code>$ su root</code></li>
+<li><code># system-config-securitylevel</code></li>
+<li><code>In the window that appears, select the SELinux tab</code></li>
+<li><code>Disable SELinux</code></li>
+</ol>
+<p>Alternatively, instead of completely disabling it you could disable just this one check.</p>
+<ol style="list-style-type: decimal">
+<li>Select System-&gt;Administration-&gt;SELinux Management</li>
+<li>In the SELinux Management Tool which appears, select &quot;Boolean&quot; from the menu on the left</li>
+<li>Expand the &quot;Memory Protection&quot; group</li>
+<li>Check the first item, labeled &quot;Allow all unconfined executables to use libraries requiring text relocation ...&quot;</li>
+</ol>
+<ul>
+<li><strong>Windows Error Messages:</strong><br />
+<code>*** fatal error - couldn't allocate heap, ...</code><br />
+<code>rm fails with &quot;Directory not empty&quot;</code><br />
+<code>unzip fails with &quot;cannot create ... Permission denied&quot;</code><br />
+<code>unzip fails with &quot;cannot create ... Error 50&quot;</code></li>
+</ul>
+<p>The CYGWIN software can conflict with other non-CYGWIN software. See the CYGWIN FAQ section on <a href="http://cygwin.com/faq/faq.using.html#faq.using.bloda">BLODA (applications that interfere with CYGWIN)</a>.</p>
+<ul>
+<li><strong>Windows Error Message: <code>spawn failed</code></strong><br />
+Try rebooting the system, or there could be some kind of issue with the disk or disk partition being used. Sometimes it comes with a &quot;Permission Denied&quot; message.</li>
+</ul>
+<hr />
+<h2 id="appendix-b-gnu-make">Appendix B: GNU make</h2>
+<p>The Makefiles in the OpenJDK are only valid when used with the GNU version of the utility command <code>make</code> (usually called <code>gmake</code> on Solaris). A few notes about using GNU make:</p>
+<ul>
+<li>You need GNU make version 3.81 or newer. On Windows 4.0 or newer is recommended. If the GNU make utility on your systems is not of a suitable version, see &quot;<a href="#buildgmake">Building GNU make</a>&quot;.</li>
+<li>Place the location of the GNU make binary in the <code>PATH</code>.</li>
+<li><strong>Solaris:</strong> Do NOT use <code>/usr/bin/make</code> on Solaris. If your Solaris system has the software from the Solaris Developer Companion CD installed, you should try and use <code>/usr/bin/gmake</code> or <code>/usr/gnu/bin/make</code>.</li>
+<li><strong>Windows:</strong> Make sure you start your build inside a bash shell.</li>
+<li><strong>Mac OS X:</strong> The XCode &quot;command line tools&quot; must be installed on your Mac.</li>
+</ul>
+<p>Information on GNU make, and access to ftp download sites, are available on the <a href="http://www.gnu.org/software/make/make.html">GNU make web site</a>. The latest source to GNU make is available at <a href="http://ftp.gnu.org/pub/gnu/make/">ftp.gnu.org/pub/gnu/make/</a>.</p>
+<h3 id="building-gnu-make">Building GNU make</h3>
+<p>First step is to get the GNU make 3.81 or newer source from <a href="http://ftp.gnu.org/pub/gnu/make/">ftp.gnu.org/pub/gnu/make/</a>. Building is a little different depending on the OS but is basically done with:</p>
+<pre><code>  bash ./configure
+  make</code></pre>
+<hr />
+<h2 id="appendix-c-build-environments">Appendix C: Build Environments</h2>
+<h3 id="minimum-build-environments">Minimum Build Environments</h3>
+<p>This file often describes specific requirements for what we call the &quot;minimum build environments&quot; (MBE) for this specific release of the JDK. What is listed below is what the Oracle Release Engineering Team will use to build the Oracle JDK product. Building with the MBE will hopefully generate the most compatible bits that install on, and run correctly on, the most variations of the same base OS and hardware architecture. In some cases, these represent what is often called the least common denominator, but each Operating System has different aspects to it.</p>
+<p>In all cases, the Bootstrap JDK version minimum is critical, we cannot guarantee builds will work with older Bootstrap JDK's. Also in all cases, more RAM and more processors is better, the minimums listed below are simply recommendations.</p>
+<p>With Solaris and Mac OS X, the version listed below is the oldest release we can guarantee builds and works, and the specific version of the compilers used could be critical.</p>
+<p>With Windows the critical aspect is the Visual Studio compiler used, which due to it's runtime, generally dictates what Windows systems can do the builds and where the resulting bits can be used.</p>
+<p><strong>NOTE: We expect a change here off these older Windows OS releases and to a 'less older' one, probably Windows 2008R2 X64.</strong></p>
+<p>With Linux, it was just a matter of picking a stable distribution that is a good representative for Linux in general.</p>
+<p>It is understood that most developers will NOT be using these specific versions, and in fact creating these specific versions may be difficult due to the age of some of this software. It is expected that developers are more often using the more recent releases and distributions of these operating systems.</p>
+<p>Compilation problems with newer or different C/C++ compilers is a common problem. Similarly, compilation problems related to changes to the <code>/usr/include</code> or system header files is also a common problem with older, newer, or unreleased OS versions. Please report these types of problems as bugs so that they can be dealt with accordingly.</p>
+<p>Bootstrap JDK: JDK 8</p>
+<table>
+<thead>
+<tr class="header">
+<th align="left">Base OS and Architecture</th>
+<th align="left">OS</th>
+<th align="left">C/C++ Compiler</th>
+<th align="left">Processors</th>
+<th align="left">RAM Minimum</th>
+<th align="left">DISK Needs</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td align="left">Linux X86 (32-bit) and X64 (64-bit)</td>
+<td align="left">Oracle Enterprise Linux 6.4</td>
+<td align="left">gcc 4.9.2</td>
+<td align="left">2 or more</td>
+<td align="left">1 GB</td>
+<td align="left">6 GB</td>
+</tr>
+<tr class="even">
+<td align="left">Solaris SPARCV9 (64-bit)</td>
+<td align="left">Solaris 11 Update 1</td>
+<td align="left">Studio 12 Update 4 + patches</td>
+<td align="left">4 or more</td>
+<td align="left">4 GB</td>
+<td align="left">8 GB</td>
+</tr>
+<tr class="odd">
+<td align="left">Solaris X64 (64-bit)</td>
+<td align="left">Solaris 11 Update 1</td>
+<td align="left">Studio 12 Update 4 + patches</td>
+<td align="left">4 or more</td>
+<td align="left">4 GB</td>
+<td align="left">8 GB</td>
+</tr>
+<tr class="even">
+<td align="left">Windows X86 (32-bit)</td>
+<td align="left">Windows Server 2012 R2 x64</td>
+<td align="left">Microsoft Visual Studio C++ 2013 Professional Edition</td>
+<td align="left">2 or more</td>
+<td align="left">2 GB</td>
+<td align="left">6 GB</td>
+</tr>
+<tr class="odd">
+<td align="left">Windows X64 (64-bit)</td>
+<td align="left">Windows Server 2012 R2 x64</td>
+<td align="left">Microsoft Visual Studio C++ 2013 Professional Edition</td>
+<td align="left">2 or more</td>
+<td align="left">2 GB</td>
+<td align="left">6 GB</td>
+</tr>
+<tr class="even">
+<td align="left">Mac OS X X64 (64-bit)</td>
+<td align="left">Mac OS X 10.9 &quot;Mavericks&quot;</td>
+<td align="left">Xcode 6.3 or newer</td>
+<td align="left">2 or more</td>
+<td align="left">4 GB</td>
+<td align="left">6 GB</td>
+</tr>
+</tbody>
+</table>
+<hr />
+<h3 id="specific-developer-build-environments">Specific Developer Build Environments</h3>
+<p>We won't be listing all the possible environments, but we will try to provide what information we have available to us.</p>
+<p><strong>NOTE: The community can help out by updating this part of the document.</strong></p>
+<h4 id="fedora">Fedora</h4>
+<p>After installing the latest <a href="http://fedoraproject.org">Fedora</a> you need to install several build dependencies. The simplest way to do it is to execute the following commands as user <code>root</code>:</p>
+<pre><code>  yum-builddep java-1.7.0-openjdk
+  yum install gcc gcc-c++</code></pre>
+<p>In addition, it's necessary to set a few environment variables for the build:</p>
+<pre><code>  export LANG=C
+  export PATH=&quot;/usr/lib/jvm/java-openjdk/bin:${PATH}&quot;</code></pre>
+<h4 id="centos-5.5">CentOS 5.5</h4>
+<p>After installing <a href="http://www.centos.org/">CentOS 5.5</a> you need to make sure you have the following Development bundles installed:</p>
+<ul>
+<li>Development Libraries</li>
+<li>Development Tools</li>
+<li>Java Development</li>
+<li>X Software Development (Including XFree86-devel)</li>
+</ul>
+<p>Plus the following packages:</p>
+<ul>
+<li>cups devel: Cups Development Package</li>
+<li>alsa devel: Alsa Development Package</li>
+<li>Xi devel: libXi.so Development Package</li>
+</ul>
+<p>The freetype 2.3 packages don't seem to be available, but the freetype 2.3 sources can be downloaded, built, and installed easily enough from <a href="http://downloads.sourceforge.net/freetype">the freetype site</a>. Build and install with something like:</p>
+<pre><code>  bash ./configure
+  make
+  sudo -u root make install</code></pre>
+<p>Mercurial packages could not be found easily, but a Google search should find ones, and they usually include Python if it's needed.</p>
+<h4 id="debian-5.0-lenny">Debian 5.0 (Lenny)</h4>
+<p>After installing <a href="http://debian.org">Debian</a> 5 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user <code>root</code>:</p>
+<pre><code>  aptitude build-dep openjdk-7
+  aptitude install openjdk-7-jdk libmotif-dev</code></pre>
+<p>In addition, it's necessary to set a few environment variables for the build:</p>
+<pre><code>  export LANG=C
+  export PATH=&quot;/usr/lib/jvm/java-7-openjdk/bin:${PATH}&quot;</code></pre>
+<h4 id="ubuntu-12.04">Ubuntu 12.04</h4>
+<p>After installing <a href="http://ubuntu.org">Ubuntu</a> 12.04 you need to install several build dependencies. The simplest way to do it is to execute the following commands:</p>
+<pre><code>  sudo aptitude build-dep openjdk-7
+  sudo aptitude install openjdk-7-jdk</code></pre>
+<p>In addition, it's necessary to set a few environment variables for the build:</p>
+<pre><code>  export LANG=C
+  export PATH=&quot;/usr/lib/jvm/java-7-openjdk/bin:${PATH}&quot;</code></pre>
+<h4 id="opensuse-11.1">OpenSUSE 11.1</h4>
+<p>After installing <a href="http://opensuse.org">OpenSUSE</a> 11.1 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands:</p>
+<pre><code>  sudo zypper source-install -d java-1_7_0-openjdk
+  sudo zypper install make</code></pre>
+<p>In addition, it is necessary to set a few environment variables for the build:</p>
+<pre><code>  export LANG=C
+  export PATH=&quot;/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}&quot;</code></pre>
+<p>Finally, you need to unset the <code>JAVA_HOME</code> environment variable:</p>
+<pre><code>  export -n JAVA_HOME`</code></pre>
+<h4 id="mandriva-linux-one-2009-spring">Mandriva Linux One 2009 Spring</h4>
+<p>After installing <a href="http://mandriva.org">Mandriva</a> Linux One 2009 Spring you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands as user <code>root</code>:</p>
+<pre><code>  urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
+    libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
+    libxtst6-devel libxi-devel</code></pre>
+<p>In addition, it is necessary to set a few environment variables for the build:</p>
+<pre><code>  export LANG=C
+  export PATH=&quot;/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}&quot;</code></pre>
+<h4 id="opensolaris-2009.06">OpenSolaris 2009.06</h4>
+<p>After installing <a href="http://opensolaris.org">OpenSolaris</a> 2009.06 you need to install several build dependencies. The simplest way to install the build dependencies is to execute the following commands:</p>
+<pre><code>  pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
+    SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2</code></pre>
+<p>In addition, it is necessary to set a few environment variables for the build:</p>
+<pre><code>  export LANG=C
+  export PATH=&quot;/opt/SunStudioExpress/bin:${PATH}&quot;</code></pre>
+<hr />
+<p>End of the OpenJDK build README document.</p>
+<p>Please come again!</p>
+</body>
+</html>
diff --git a/common/doc/building.md b/common/doc/building.md
new file mode 100644
index 0000000..3eb96df
--- /dev/null
+++ b/common/doc/building.md
@@ -0,0 +1,1115 @@
+% OpenJDK Build README
+
+![OpenJDK](http://openjdk.java.net/images/openjdk.png)
+
+--------------------------------------------------------------------------------
+
+## Introduction
+
+This README file contains build instructions for the
+[OpenJDK](http://openjdk.java.net). Building the source code for the OpenJDK
+requires a certain degree of technical expertise.
+
+### !!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!
+
+Some Headlines:
+
+ * The build is now a "`configure && make`" style build
+ * Any GNU make 3.81 or newer should work, except on Windows where 4.0 or newer
+   is recommended.
+ * The build should scale, i.e. more processors should cause the build to be
+   done in less wall-clock time
+ * Nested or recursive make invocations have been significantly reduced, as
+   has the total fork/exec or spawning of sub processes during the build
+ * Windows MKS usage is no longer supported
+ * Windows Visual Studio `vsvars*.bat` and `vcvars*.bat` files are run
+   automatically
+ * Ant is no longer used when building the OpenJDK
+ * Use of ALT\_\* environment variables for configuring the build is no longer
+   supported
+
+-------------------------------------------------------------------------------
+
+## Contents
+
+  * [Introduction](#introduction)
+  * [Use of Mercurial](#hg)
+      * [Getting the Source](#get_source)
+      * [Repositories](#repositories)
+  * [Building](#building)
+      * [System Setup](#setup)
+          * [Linux](#linux)
+          * [Solaris](#solaris)
+          * [Mac OS X](#macosx)
+          * [Windows](#windows)
+      * [Configure](#configure)
+      * [Make](#make)
+  * [Testing](#testing)
+
+-------------------------------------------------------------------------------
+
+  * [Appendix A: Hints and Tips](#hints)
+    * [FAQ](#faq)
+    * [Build Performance Tips](#performance)
+    * [Troubleshooting](#troubleshooting)
+  * [Appendix B: GNU Make Information](#gmake)
+  * [Appendix C: Build Environments](#buildenvironments)
+
+-------------------------------------------------------------------------------
+
+## Use of Mercurial
+
+The OpenJDK sources are maintained with the revision control system
+[Mercurial](http://mercurial.selenic.com/wiki/Mercurial). If you are new to
+Mercurial, please see the [Beginner
+Guides](http://mercurial.selenic.com/wiki/BeginnersGuides) or refer to the
+[Mercurial Book](http://hgbook.red-bean.com/). The first few chapters of the
+book provide an excellent overview of Mercurial, what it is and how it works.
+
+For using Mercurial with the OpenJDK refer to the [Developer Guide: Installing
+and Configuring
+Mercurial](http://openjdk.java.net/guide/repositories.html#installConfig)
+section for more information.
+
+### Getting the Source
+
+To get the entire set of OpenJDK Mercurial repositories use the script
+`get_source.sh` located in the root repository:
+
+      hg clone http://hg.openjdk.java.net/jdk9/jdk9 YourOpenJDK
+      cd YourOpenJDK
+      bash ./get_source.sh
+
+Once you have all the repositories, keep in mind that each repository is its
+own independent repository. You can also re-run `./get_source.sh` anytime to
+pull over all the latest changesets in all the repositories. This set of nested
+repositories has been given the term "forest" and there are various ways to
+apply the same `hg` command to each of the repositories. For example, the
+script `make/scripts/hgforest.sh` can be used to repeat the same `hg` command
+on every repository, e.g.
+
+      cd YourOpenJDK
+      bash ./make/scripts/hgforest.sh status
+
+### Repositories
+
+The set of repositories and what they contain:
+
+ * **. (root)** contains common configure and makefile logic
+ * **hotspot** contains source code and make files for building the OpenJDK
+   Hotspot Virtual Machine
+ * **langtools** contains source code for the OpenJDK javac and language tools
+ * **jdk** contains source code and make files for building the OpenJDK runtime
+   libraries and misc files
+ * **jaxp** contains source code for the OpenJDK JAXP functionality
+ * **jaxws** contains source code for the OpenJDK JAX-WS functionality
+ * **corba** contains source code for the OpenJDK Corba functionality
+ * **nashorn** contains source code for the OpenJDK JavaScript implementation
+
+### Repository Source Guidelines
+
+There are some very basic guidelines:
+
+ * Use of whitespace in source files (.java, .c, .h, .cpp, and .hpp files) is
+   restricted. No TABs, no trailing whitespace on lines, and files should not
+   terminate in more than one blank line.
+ * Files with execute permissions should not be added to the source
+   repositories.
+ * All generated files need to be kept isolated from the files maintained or
+   managed by the source control system. The standard area for generated files
+   is the top level `build/` directory.
+ * The default build process should be to build the product and nothing else,
+   in one form, e.g. a product (optimized), debug (non-optimized, -g plus
+   assert logic), or fastdebug (optimized, -g plus assert logic).
+ * The `.hgignore` file in each repository must exist and should include
+   `^build/`, `^dist/` and optionally any `nbproject/private` directories. **It
+   should NEVER** include anything in the `src/` or `test/` or any managed
+   directory area of a repository.
+ * Directory names and file names should never contain blanks or non-printing
+   characters.
+ * Generated source or binary files should NEVER be added to the repository
+   (that includes `javah` output). There are some exceptions to this rule, in
+   particular with some of the generated configure scripts.
+ * Files not needed for typical building or testing of the repository should
+   not be added to the repository.
+
+-------------------------------------------------------------------------------
+
+## Building
+
+The very first step in building the OpenJDK is making sure the system itself
+has everything it needs to do OpenJDK builds. Once a system is setup, it
+generally doesn't need to be done again.
+
+Building the OpenJDK is now done with running a `configure` script which will
+try and find and verify you have everything you need, followed by running
+`make`, e.g.
+
+>  **`bash ./configure`** \
+>  **`make all`**
+
+Where possible the `configure` script will attempt to located the various
+components in the default locations or via component specific variable
+settings. When the normal defaults fail or components cannot be found,
+additional `configure` options may be necessary to help `configure` find the
+necessary tools for the build, or you may need to re-visit the setup of your
+system due to missing software packages.
+
+**NOTE:** The `configure` script file does not have execute permissions and
+will need to be explicitly run with `bash`, see the source guidelines.
+
+-------------------------------------------------------------------------------
+
+### System Setup
+
+Before even attempting to use a system to build the OpenJDK there are some very
+basic system setups needed. For all systems:
+
+ * Be sure the GNU make utility is version 3.81 (4.0 on windows) or newer, e.g.
+   run "`make -version`"
+
+   <a name="bootjdk"></a>
+ * Install a Bootstrap JDK. All OpenJDK builds require access to a previously
+   released JDK called the *bootstrap JDK* or *boot JDK.* The general rule is
+   that the bootstrap JDK must be an instance of the previous major release of
+   the JDK. In addition, there may be a requirement to use a release at or
+   beyond a particular update level.
+
+   ***Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as
+   the boot JDK, to ensure that JDK 9 dependencies are not introduced into the
+   parts of the system that are built with JDK 8.***
+
+   The JDK 8 binaries can be downloaded from Oracle's [JDK 8 download
+   site](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
+   For build performance reasons it is very important that this bootstrap JDK
+   be made available on the local disk of the machine doing the build. You
+   should add its `bin` directory to the `PATH` environment variable. If
+   `configure` has any issues finding this JDK, you may need to use the
+   `configure` option `--with-boot-jdk`.
+
+ * Ensure that GNU make, the Bootstrap JDK, and the compilers are all in your
+   PATH environment variable.
+
+And for specific systems:
+
+ * **Linux**
+
+   Install all the software development packages needed including
+   [alsa](#alsa), [freetype](#freetype), [cups](#cups), and
+   [xrender](#xrender). See [specific system packages](#SDBE).
+
+ * **Solaris**
+
+   Install all the software development packages needed including [Studio
+   Compilers](#studio), [freetype](#freetype), [cups](#cups), and
+   [xrender](#xrender). See [specific system packages](#SDBE).
+
+ * **Windows**
+
+   * Install one of [CYGWIN](#cygwin) or [MinGW/MSYS](#msys)
+   * Install [Visual Studio 2013](#vs2013)
+
+ * **Mac OS X**
+
+   Install [XCode 6.3](https://developer.apple.com/xcode/)
+
+#### Linux
+
+With Linux, try and favor the system packages over building your own or getting
+packages from other areas. Most Linux builds should be possible with the
+system's available packages.
+
+Note that some Linux systems have a habit of pre-populating your environment
+variables for you, for example `JAVA_HOME` might get pre-defined for you to
+refer to the JDK installed on your Linux system. You will need to unset
+`JAVA_HOME`. It's a good idea to run `env` and verify the environment variables
+you are getting from the default system settings make sense for building the
+OpenJDK.
+
+#### Solaris
+
+##### Studio Compilers
+
+At a minimum, the [Studio 12 Update 4
+Compilers](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.htm)
+(containing version 5.13 of the C and C++ compilers) is required, including
+specific patches.
+
+The Solaris Studio installation should contain at least these packages:
+
+  Package                                            Version
+  -------------------------------------------------- ---------------
+  developer/solarisstudio-124/backend                12.4-1.0.6.0
+  developer/solarisstudio-124/c++                    12.4-1.0.10.0
+  developer/solarisstudio-124/cc                     12.4-1.0.4.0
+  developer/solarisstudio-124/library/c++-libs       12.4-1.0.10.0
+  developer/solarisstudio-124/library/math-libs      12.4-1.0.0.1
+  developer/solarisstudio-124/library/studio-gccrt   12.4-1.0.0.1
+  developer/solarisstudio-124/studio-common          12.4-1.0.0.1
+  developer/solarisstudio-124/studio-ja              12.4-1.0.0.1
+  developer/solarisstudio-124/studio-legal           12.4-1.0.0.1
+  developer/solarisstudio-124/studio-zhCN            12.4-1.0.0.1
+
+In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc
+version.
+
+Place the `bin` directory in `PATH`.
+
+The Oracle Solaris Studio Express compilers at: [Oracle Solaris Studio Express
+Download
+site](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-142582.html)
+are also an option, although these compilers have not been extensively used
+yet.
+
+#### Windows
+
+##### Windows Unix Toolkit
+
+Building on Windows requires a Unix-like environment, notably a Unix-like
+shell. There are several such environments available of which
+[Cygwin](http://www.cygwin.com/) and
+[MinGW/MSYS](http://www.mingw.org/wiki/MSYS) are currently supported for the
+OpenJDK build. One of the differences of these systems from standard Windows
+tools is the way they handle Windows path names, particularly path names which
+contain spaces, backslashes as path separators and possibly drive letters.
+Depending on the use case and the specifics of each environment these path
+problems can be solved by a combination of quoting whole paths, translating
+backslashes to forward slashes, escaping backslashes with additional
+backslashes and translating the path names to their ["8.3"
+version](http://en.wikipedia.org/wiki/8.3_filename).
+
+###### CYGWIN
+
+CYGWIN is an open source, Linux-like environment which tries to emulate a
+complete POSIX layer on Windows. It tries to be smart about path names and can
+usually handle all kinds of paths if they are correctly quoted or escaped
+although internally it maps drive letters `<drive>:` to a virtual directory
+`/cygdrive/<drive>`.
+
+You can always use the `cygpath` utility to map pathnames with spaces or the
+backslash character into the `C:/` style of pathname (called 'mixed'), e.g.
+`cygpath -s -m "<path>"`.
+
+Note that the use of CYGWIN creates a unique problem with regards to setting
+[`PATH`](#path). Normally on Windows the `PATH` variable contains directories
+separated with the ";" character (Solaris and Linux use ":"). With CYGWIN, it
+uses ":", but that means that paths like "C:/path" cannot be placed in the
+CYGWIN version of `PATH` and instead CYGWIN uses something like
+`/cygdrive/c/path` which CYGWIN understands, but only CYGWIN understands.
+
+The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about
+CYGWIN can be obtained from the CYGWIN website at
+[www.cygwin.com](http://www.cygwin.com).
+
+By default CYGWIN doesn't install all the tools required for building the
+OpenJDK. Along with the default installation, you need to install the following
+tools.
+
+  Binary Name   Category       Package    Description
+  ------------- -------------- ---------- ------------------------------------------------------------
+  ar.exe        Devel          binutils   The GNU assembler, linker and binary utilities
+  make.exe      Devel          make       The GNU version of the 'make' utility built for CYGWIN
+  m4.exe        Interpreters   m4         GNU implementation of the traditional Unix macro processor
+  cpio.exe      Utils          cpio       A program to manage archives of files
+  gawk.exe      Utils          awk        Pattern-directed scanning and processing language
+  file.exe      Utils          file       Determines file type using 'magic' numbers
+  zip.exe       Archive        zip        Package and compress (archive) files
+  unzip.exe     Archive        unzip      Extract compressed files in a ZIP archive
+  free.exe      System         procps     Display amount of free and used memory in the system
+
+Note that the CYGWIN software can conflict with other non-CYGWIN software on
+your Windows system. CYGWIN provides a
+[FAQ](http://cygwin.com/faq/faq.using.html) for known issues and problems,
+of particular interest is the section on [BLODA (applications that interfere
+with CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda).
+
+###### MinGW/MSYS
+
+MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific
+header files and import libraries combined with GNU toolsets that allow one to
+produce native Windows programs that do not rely on any 3rd-party C runtime
+DLLs. MSYS is a supplement to MinGW which allows building applications and
+programs which rely on traditional UNIX tools to be present. Among others this
+includes tools like `bash` and `make`. See
+[MinGW/MSYS](http://www.mingw.org/wiki/MSYS) for more information.
+
+Like Cygwin, MinGW/MSYS can handle different types of path formats. They are
+internally converted to paths with forward slashes and drive letters `<drive>:`
+replaced by a virtual directory `/<drive>`. Additionally, MSYS automatically
+detects binaries compiled for the MSYS environment and feeds them with the
+internal, Unix-style path names. If native Windows applications are called from
+within MSYS programs their path arguments are automatically converted back to
+Windows style path names with drive letters and backslashes as path separators.
+This may cause problems for Windows applications which use forward slashes as
+parameter separator (e.g. `cl /nologo /I`) because MSYS may wrongly [replace
+such parameters by drive
+letters](http://mingw.org/wiki/Posix_path_conversion).
+
+In addition to the tools which will be installed by default, you have to
+manually install the `msys-zip` and `msys-unzip` packages. This can be easily
+done with the MinGW command line installer:
+
+      mingw-get.exe install msys-zip
+      mingw-get.exe install msys-unzip
+
+##### Visual Studio 2013 Compilers
+
+The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio
+C++ 2013 (VS2013) Professional Edition or Express compiler. The compiler and
+other tools are expected to reside in the location defined by the variable
+`VS120COMNTOOLS` which is set by the Microsoft Visual Studio installer.
+
+Only the C++ part of VS2013 is needed. Try to let the installation go to the
+default install directory. Always reboot your system after installing VS2013.
+The system environment variable VS120COMNTOOLS should be set in your
+environment.
+
+Make sure that TMP and TEMP are also set in the environment and refer to
+Windows paths that exist, like `C:\temp`, not `/tmp`, not `/cygdrive/c/temp`,
+and not `C:/temp`. `C:\temp` is just an example, it is assumed that this area
+is private to the user, so by default after installs you should see a unique
+user path in these variables.
+
+#### Mac OS X
+
+Make sure you get the right XCode version.
+
+-------------------------------------------------------------------------------
+
+### Configure
+
+The basic invocation of the `configure` script looks like:
+
+>  **`bash ./configure [options]`**
+
+This will create an output directory containing the "configuration" and setup
+an area for the build result. This directory typically looks like:
+
+>  **`build/linux-x64-normal-server-release`**
+
+`configure` will try to figure out what system you are running on and where all
+necessary build components are. If you have all prerequisites for building
+installed, it should find everything. If it fails to detect any component
+automatically, it will exit and inform you about the problem. When this
+happens, read more below in [the `configure` options](#configureoptions).
+
+Some examples:
+
+>  **Windows 32bit build with freetype specified:** \
+>  `bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32`
+
+>  **Debug 64bit Build:** \
+>  `bash ./configure --enable-debug --with-target-bits=64`
+
+#### Configure Options
+
+Complete details on all the OpenJDK `configure` options can be seen with:
+
+>  **`bash ./configure --help=short`**
+
+Use `-help` to see all the `configure` options available. You can generate any
+number of different configurations, e.g. debug, release, 32, 64, etc.
+
+Some of the more commonly used `configure` options are:
+
+>  **`--enable-debug`** \
+>  set the debug level to fastdebug (this is a shorthand for 
+>  `--with-debug-level=fastdebug`)
+
+<a name="alsa"></a>
+
+>  **`--with-alsa=`**_path_ \
+>  select the location of the Advanced Linux Sound Architecture (ALSA)
+
+>  Version 0.9.1 or newer of the ALSA files are required for building the
+   OpenJDK on Linux. These Linux files are usually available from an "alsa" of
+   "libasound" development package, and it's highly recommended that you try
+   and use the package provided by the particular version of Linux that you are
+   using.
+
+>  **`--with-boot-jdk=`**_path_ \
+>  select the [Bootstrap JDK](#bootjdk)
+
+>  **`--with-boot-jdk-jvmargs=`**"_args_" \
+>  provide the JVM options to be used to run the [Bootstrap JDK](#bootjdk)
+
+>  **`--with-cacerts=`**_path_ \
+>  select the path to the cacerts file.
+
+>  See [Certificate Authority on
+   Wikipedia](http://en.wikipedia.org/wiki/Certificate_Authority) for a
+   better understanding of the Certificate Authority (CA). A certificates file
+   named "cacerts" represents a system-wide keystore with CA certificates. In
+   JDK and JRE binary bundles, the "cacerts" file contains root CA certificates
+   from several public CAs (e.g., VeriSign, Thawte, and Baltimore). The source
+   contain a cacerts file without CA root certificates. Formal JDK builders will
+   need to secure permission from each public CA and include the certificates
+   into their own custom cacerts file. Failure to provide a populated cacerts
+   file will result in verification errors of a certificate chain during
+   runtime. By default an empty cacerts file is provided and that should be fine
+   for most JDK developers.
+
+<a name="cups"></a>
+
+>  **`--with-cups=`**_path_ \
+>  select the CUPS install location
+
+>  The Common UNIX Printing System (CUPS) Headers are required for building the
+   OpenJDK on Solaris and Linux. The Solaris header files can be obtained by
+   installing the package **print/cups**.
+
+>  The CUPS header files can always be downloaded from
+   [www.cups.org](http://www.cups.org).
+
+>  **`--with-cups-include=`**_path_ \
+>  select the CUPS include directory location
+
+>  **`--with-debug-level=`**_level_ \
+>  select the debug information level of release, fastdebug, or slowdebug
+
+>  **`--with-dev-kit=`**_path_ \
+>  select location of the compiler install or developer install location
+
+<a name="freetype"></a>
+
+>  **`--with-freetype=`**_path_ \
+>  select the freetype files to use.
+
+>  Expecting the freetype libraries under `lib/` and the headers under
+   `include/`.
+
+>  Version 2.3 or newer of FreeType is required. On Unix systems required files
+   can be available as part of your distribution (while you still may need to
+   upgrade them). Note that you need development version of package that
+   includes both the FreeType library and header files.
+
+>  You can always download latest FreeType version from the [FreeType
+   website](http://www.freetype.org). Building the freetype 2 libraries from
+   scratch is also possible, however on Windows refer to the [Windows FreeType
+   DLL build instructions](http://freetype.freedesktop.org/wiki/FreeType_DLL).
+
+>  Note that by default FreeType is built with byte code hinting support
+   disabled due to licensing restrictions. In this case, text appearance and
+   metrics are expected to differ from Sun's official JDK build. See the
+   [SourceForge FreeType2 Home Page](http://freetype.sourceforge.net/freetype2)
+   for more information.
+
+>  **`--with-import-hotspot=`**_path_ \
+>  select the location to find hotspot binaries from a previous build to avoid
+   building hotspot
+
+>  **`--with-target-bits=`**_arg_ \
+>  select 32 or 64 bit build
+
+>  **`--with-jvm-variants=`**_variants_ \
+>  select the JVM variants to build from, comma separated list that can
+   include: server, client, kernel, zero and zeroshark
+
+>  **`--with-memory-size=`**_size_ \
+>  select the RAM size that GNU make will think this system has
+
+>  **`--with-msvcr-dll=`**_path_ \
+>  select the `msvcr100.dll` file to include in the Windows builds (C/C++
+   runtime library for Visual Studio).
+
+>  This is usually picked up automatically from the redist directories of
+   Visual Studio 2013.
+
+>  **`--with-num-cores=`**_cores_ \
+>  select the number of cores to use (processor count or CPU count)
+
+<a name="xrender"></a>
+
+>  **`--with-x=`**_path_ \
+>  select the location of the X11 and xrender files.
+
+>  The XRender Extension Headers are required for building the OpenJDK on
+   Solaris and Linux. The Linux header files are usually available from a
+   "Xrender" development package, it's recommended that you try and use the
+   package provided by the particular distribution of Linux that you are using.
+   The Solaris XRender header files is included with the other X11 header files
+   in the package **SFWxwinc** on new enough versions of Solaris and will be
+   installed in `/usr/X11/include/X11/extensions/Xrender.h` or
+   `/usr/openwin/share/include/X11/extensions/Xrender.h`
+
+-------------------------------------------------------------------------------
+
+### Make
+
+The basic invocation of the `make` utility looks like:
+
+>  **`make all`**
+
+This will start the build to the output directory containing the
+"configuration" that was created by the `configure` script. Run `make help` for
+more information on the available targets.
+
+There are some of the make targets that are of general interest:
+
+>  _empty_ \
+>  build everything but no images
+
+>  **`all`** \
+>  build everything including images
+
+>  **`all-conf`** \
+>  build all configurations
+
+>  **`images`** \
+>  create complete j2sdk and j2re images
+
+>  **`install`** \
+>  install the generated images locally, typically in `/usr/local`
+
+>  **`clean`** \
+>  remove all files generated by make, but not those generated by `configure`
+
+>  **`dist-clean`** \
+>  remove all files generated by both and `configure` (basically killing the
+   configuration)
+
+>  **`help`** \
+>  give some help on using `make`, including some interesting make targets
+
+-------------------------------------------------------------------------------
+
+## Testing
+
+When the build is completed, you should see the generated binaries and
+associated files in the `j2sdk-image` directory in the output directory. In
+particular, the `build/*/images/j2sdk-image/bin` directory should contain
+executables for the OpenJDK tools and utilities for that configuration. The
+testing tool `jtreg` will be needed and can be found at: [the jtreg
+site](http://openjdk.java.net/jtreg/). The provided regression tests in the
+repositories can be run with the command:
+
+>  **``cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all``**
+
+-------------------------------------------------------------------------------
+
+## Appendix A: Hints and Tips
+
+### FAQ
+
+**Q:** The `generated-configure.sh` file looks horrible! How are you going to
+edit it? \
+**A:** The `generated-configure.sh` file is generated (think "compiled") by the
+autoconf tools. The source code is in `configure.ac` and various .m4 files in
+common/autoconf, which are much more readable.
+
+**Q:** Why is the `generated-configure.sh` file checked in, if it is
+generated? \
+**A:** If it was not generated, every user would need to have the autoconf
+tools installed, and re-generate the `configure` file as the first step. Our
+goal is to minimize the work needed to be done by the user to start building
+OpenJDK, and to minimize the number of external dependencies required.
+
+**Q:** Do you require a specific version of autoconf for regenerating
+`generated-configure.sh`? \
+**A:** Yes, version 2.69 is required and should be easy enough to aquire on all
+supported operating systems. The reason for this is to avoid large spurious
+changes in `generated-configure.sh`.
+
+**Q:** How do you regenerate `generated-configure.sh` after making changes to
+the input files? \
+**A:** Regnerating `generated-configure.sh` should always be done using the
+script `common/autoconf/autogen.sh` to ensure that the correct files get
+updated. This script should also be run after mercurial tries to merge
+`generated-configure.sh` as a merge of the generated file is not guaranteed to
+be correct.
+
+**Q:** What are the files in `common/makefiles/support/*` for? They look like
+gibberish. \
+**A:** They are a somewhat ugly hack to compensate for command line length
+limitations on certain platforms (Windows, Solaris). Due to a combination of
+limitations in make and the shell, command lines containing too many files will
+not work properly. These helper files are part of an elaborate hack that will
+compress the command line in the makefile and then uncompress it safely. We're
+not proud of it, but it does fix the problem. If you have any better
+suggestions, we're all ears! :-)
+
+**Q:** I want to see the output of the commands that make runs, like in the old
+build. How do I do that? \
+**A:** You specify the `LOG` variable to make. There are several log levels:
+
+ * **`warn`** -- Default and very quiet.
+ * **`info`** -- Shows more progress information than warn.
+ * **`debug`** -- Echos all command lines and prints all macro calls for
+   compilation definitions.
+ * **`trace`** -- Echos all \$(shell) command lines as well.
+
+**Q:** When do I have to re-run `configure`? \
+**A:** Normally you will run `configure` only once for creating a
+configuration. You need to re-run configuration only if you want to change any
+configuration options, or if you pull down changes to the `configure` script.
+
+**Q:** I have added a new source file. Do I need to modify the makefiles? \
+**A:** Normally, no. If you want to create e.g. a new native library, you will
+need to modify the makefiles. But for normal file additions or removals, no
+changes are needed. There are certan exceptions for some native libraries where
+the source files are spread over many directories which also contain sources
+for other libraries. In these cases it was simply easier to create include
+lists rather than excludes.
+
+**Q:** When I run `configure --help`, I see many strange options, like
+`--dvidir`. What is this? \
+**A:** Configure provides a slew of options by default, to all projects that
+use autoconf. Most of them are not used in OpenJDK, so you can safely ignore
+them. To list only OpenJDK specific features, use `configure --help=short`
+instead.
+
+**Q:** `configure` provides OpenJDK-specific features such as
+`--with-builddeps-server` that are not described in this document. What about
+those? \
+**A:** Try them out if you like! But be aware that most of these are
+experimental features. Many of them don't do anything at all at the moment; the
+option is just a placeholder. Others depend on pieces of code or infrastructure
+that is currently not ready for prime time.
+
+**Q:** How will you make sure you don't break anything? \
+**A:** We have a script that compares the result of the new build system with
+the result of the old. For most part, we aim for (and achieve) byte-by-byte
+identical output. There are however technical issues with e.g. native binaries,
+which might differ in a byte-by-byte comparison, even when building twice with
+the old build system. For these, we compare relevant aspects (e.g. the symbol
+table and file size). Note that we still don't have 100% equivalence, but we're
+close.
+
+**Q:** I noticed this thing X in the build that looks very broken by design.
+Why don't you fix it? \
+**A:** Our goal is to produce a build output that is as close as technically
+possible to the old build output. If things were weird in the old build, they
+will be weird in the new build. Often, things were weird before due to
+obscurity, but in the new build system the weird stuff comes up to the surface.
+The plan is to attack these things at a later stage, after the new build system
+is established.
+
+**Q:** The code in the new build system is not that well-structured. Will you
+fix this? \
+**A:** Yes! The new build system has grown bit by bit as we converted the old
+system. When all of the old build system is converted, we can take a step back
+and clean up the structure of the new build system. Some of this we plan to do
+before replacing the old build system and some will need to wait until after.
+
+**Q:** Is anything able to use the results of the new build's default make
+target? \
+**A:** Yes, this is the minimal (or roughly minimal) set of compiled output
+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. The packaging stuff that is part of the `images` target is not needed for
+a normal developer who wants to test his new code. Even if it's quite fast,
+it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-)
+(Or, well, at least single-digit seconds...)
+
+**Q:** I usually set a specific environment variable when building, but I can't
+find the equivalent in the new build. What should I do? \
+**A:** It might very well be that we have neglected to add support for an
+option that was actually used from outside the build system. Email us and we
+will add support for it!
+
+### Build Performance Tips
+
+Building OpenJDK 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 `configure` 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:
+
+ * **`--with-num-cores`** -- number of cores in the build system, e.g.
+   `--with-num-cores=8`
+ * **`--with-memory-size`** -- memory (in MB) available in the build system,
+    e.g. `--with-memory-size=1024`
+
+It might also be necessary to specify the JVM arguments passed to the Bootstrap
+JDK, using e.g. `--with-boot-jdk-jvmargs="-Xmx8G -enableassertions"`. Doing
+this will override the default JVM arguments passed to the Bootstrap JDK.
+
+One of the top goals of the new build system is to improve the build
+performance and decrease the time needed to build. This will soon also apply to
+the java compilation when the Smart Javac wrapper is fully supported.
+
+At the end of a successful execution of `configure`, 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!
+
+#### Building with ccache
+
+The OpenJDK 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
+`--enable-ccache`.
+
+#### Building on local disk
+
+If you are using network shares, e.g. via NFS, for your source code, make sure
+the build directory is situated on local disk. The performance penalty is
+extremely high for building on a network share, close to unusable.
+
+#### Building only one JVM
+
+The old build builds multiple JVMs on 32-bit systems (client and server; and on
+Windows kernel as well). In the new build we have changed this default to only
+build server when it's available. This improves build times for those not
+interested in multiple JVMs. To mimic the old behavior on platforms that
+support it, use `--with-jvm-variants=client,server`.
+
+#### Selecting the number of cores to build on
+
+By default, `configure` will analyze your machine and run the make process in
+parallel with as many threads as you have cores. This behavior can be
+overridden, either "permanently" (on a `configure` basis) using
+`--with-num-cores=N` or for a single build only (on a make basis), using
+`make JOBS=N`.
+
+If you want to make a slower build just this time, to save some CPU power for
+other processes, you can run e.g. `make JOBS=2`. This will force the makefiles
+to only run 2 parallel processes, or even `make JOBS=1` which will disable
+parallelism.
+
+If you want to have it the other way round, namely having slow builds default
+and override with fast if you're impatient, you should call `configure` with
+`--with-num-cores=2`, making 2 the default. If you want to run with more cores,
+run `make JOBS=8`
+
+### Troubleshooting
+
+#### Solving build problems
+
+If the build fails (and it's not due to a compilation error in a source file
+you've changed), the first thing you should do is to re-run the build with more
+verbosity. Do this by adding `LOG=debug` to your make command line.
+
+The build log (with both stdout and stderr intermingled, basically the same as
+you see on your console) can be found as `build.log` in your build directory.
+
+You can ask for help on build problems with the new build system on either the
+[build-dev](http://mail.openjdk.java.net/mailman/listinfo/build-dev) or the
+[build-infra-dev](http://mail.openjdk.java.net/mailman/listinfo/build-infra-dev)
+mailing lists. Please include the relevant parts of the build log.
+
+A build can fail for any number of reasons. Most failures are a result of
+trying to build in an environment in which all the pre-build requirements have
+not been met. The first step in troubleshooting a build failure is to recheck
+that you have satisfied all the pre-build requirements for your platform.
+Scanning the `configure` log is a good first step, making sure that what it
+found makes sense for your system. Look for strange error messages or any
+difficulties that `configure` had in finding things.
+
+Some of the more common problems with builds are briefly described below, with
+suggestions for remedies.
+
+ * **Corrupted Bundles on Windows:** \
+   Some virus scanning software has been known to corrupt the downloading of
+   zip bundles. It may be necessary to disable the 'on access' or 'real time'
+   virus scanning features to prevent this corruption. This type of 'real time'
+   virus scanning can also slow down the build process significantly.
+   Temporarily disabling the feature, or excluding the build output directory
+   may be necessary to get correct and faster builds.
+
+ * **Slow Builds:** \
+   If your build machine seems to be overloaded from too many simultaneous C++
+   compiles, try setting the `JOBS=1` on the `make` command line. Then try
+   increasing the count slowly to an acceptable level for your system. Also:
+
+   Creating the javadocs can be very slow, if you are running javadoc, consider
+   skipping that step.
+
+   Faster CPUs, more RAM, and a faster DISK usually helps. The VM build tends
+   to be CPU intensive (many C++ compiles), and the rest of the JDK will often
+   be disk intensive.
+
+   Faster compiles are possible using a tool called
+   [ccache](http://ccache.samba.org/).
+
+ * **File time issues:** \
+   If you see warnings that refer to file time stamps, e.g.
+
+   > _Warning message:_ ` File 'xxx' has modification time in the future.` \
+   > _Warning message:_ ` Clock skew detected. Your build may be incomplete.`
+
+   These warnings can occur when the clock on the build machine is out of sync
+   with the timestamps on the source files. Other errors, apparently unrelated
+   but in fact caused by the clock skew, can occur along with the clock skew
+   warnings. These secondary errors may tend to obscure the fact that the true
+   root cause of the problem is an out-of-sync clock.
+
+   If you see these warnings, reset the clock on the build machine, run
+   "`gmake clobber`" or delete the directory containing the build output, and
+   restart the build from the beginning.
+
+ * **Error message: `Trouble writing out table to disk`** \
+   Increase the amount of swap space on your build machine. This could be
+   caused by overloading the system and it may be necessary to use:
+
+   > `make JOBS=1`
+
+   to reduce the load on the system.
+
+ * **Error Message: `libstdc++ not found`:** \
+   This is caused by a missing libstdc++.a library. This is installed as part
+   of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit
+   Linux versions (e.g. Fedora) only install the 64-bit version of the
+   libstdc++ package. Various parts of the JDK build require a static link of
+   the C++ runtime libraries to allow for maximum portability of the built
+   images.
+
+ * **Linux Error Message: `cannot restore segment prot after reloc`** \
+   This is probably an issue with SELinux (See [SELinux on
+   Wikipedia](http://en.wikipedia.org/wiki/SELinux)). Parts of the VM is built
+   without the `-fPIC` for performance reasons.
+
+   To completely disable SELinux:
+
+   1. `$ su root`
+   2. `# system-config-securitylevel`
+   3. `In the window that appears, select the SELinux tab`
+   4. `Disable SELinux`
+
+   Alternatively, instead of completely disabling it you could disable just
+   this one check.
+
+   1. Select System-&gt;Administration-&gt;SELinux Management
+   2. In the SELinux Management Tool which appears, select "Boolean" from the
+      menu on the left
+   3. Expand the "Memory Protection" group
+   4. Check the first item, labeled "Allow all unconfined executables to use
+      libraries requiring text relocation ..."
+
+ * **Windows Error Messages:** \
+   `*** fatal error - couldn't allocate heap, ... ` \
+   `rm fails with "Directory not empty"` \
+   `unzip fails with "cannot create ... Permission denied"` \
+   `unzip fails with "cannot create ... Error 50"`
+
+   The CYGWIN software can conflict with other non-CYGWIN software. See the
+   CYGWIN FAQ section on [BLODA (applications that interfere with
+   CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda).
+
+ * **Windows Error Message: `spawn failed`** \
+   Try rebooting the system, or there could be some kind of issue with the disk
+   or disk partition being used. Sometimes it comes with a "Permission Denied"
+   message.
+
+-------------------------------------------------------------------------------
+
+## Appendix B: GNU make
+
+The Makefiles in the OpenJDK are only valid when used with the GNU version of
+the utility command `make` (usually called `gmake` on Solaris). A few notes
+about using GNU make:
+
+ * You need GNU make version 3.81 or newer. On Windows 4.0 or newer is
+   recommended. If the GNU make utility on your systems is not of a suitable
+   version, see "[Building GNU make](#buildgmake)".
+ * Place the location of the GNU make binary in the `PATH`.
+ * **Solaris:** Do NOT use `/usr/bin/make` on Solaris. If your Solaris system
+   has the software from the Solaris Developer Companion CD installed, you
+   should try and use `/usr/bin/gmake` or `/usr/gnu/bin/make`.
+ * **Windows:** Make sure you start your build inside a bash shell.
+ * **Mac OS X:** The XCode "command line tools" must be installed on your Mac.
+
+Information on GNU make, and access to ftp download sites, are available on the
+[GNU make web site](http://www.gnu.org/software/make/make.html). The latest
+source to GNU make is available at
+[ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/).
+
+### Building GNU make
+
+First step is to get the GNU make 3.81 or newer source from
+[ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/). Building is a
+little different depending on the OS but is basically done with:
+
+      bash ./configure
+      make
+
+-------------------------------------------------------------------------------
+
+## Appendix C: Build Environments
+
+### Minimum Build Environments
+
+This file often describes specific requirements for what we call the "minimum
+build environments" (MBE) for this specific release of the JDK. What is listed
+below is what the Oracle Release Engineering Team will use to build the Oracle
+JDK product. Building with the MBE will hopefully generate the most compatible
+bits that install on, and run correctly on, the most variations of the same
+base OS and hardware architecture. In some cases, these represent what is often
+called the least common denominator, but each Operating System has different
+aspects to it.
+
+In all cases, the Bootstrap JDK version minimum is critical, we cannot
+guarantee builds will work with older Bootstrap JDK's. Also in all cases, more
+RAM and more processors is better, the minimums listed below are simply
+recommendations.
+
+With Solaris and Mac OS X, the version listed below is the oldest release we
+can guarantee builds and works, and the specific version of the compilers used
+could be critical.
+
+With Windows the critical aspect is the Visual Studio compiler used, which due
+to it's runtime, generally dictates what Windows systems can do the builds and
+where the resulting bits can be used.
+
+**NOTE: We expect a change here off these older Windows OS releases and to a
+'less older' one, probably Windows 2008R2 X64.**
+
+With Linux, it was just a matter of picking a stable distribution that is a
+good representative for Linux in general.
+
+It is understood that most developers will NOT be using these specific
+versions, and in fact creating these specific versions may be difficult due to
+the age of some of this software. It is expected that developers are more often
+using the more recent releases and distributions of these operating systems.
+
+Compilation problems with newer or different C/C++ compilers is a common
+problem. Similarly, compilation problems related to changes to the
+`/usr/include` or system header files is also a common problem with older,
+newer, or unreleased OS versions. Please report these types of problems as bugs
+so that they can be dealt with accordingly.
+
+Bootstrap JDK: JDK 8
+
+  Base OS and Architecture              OS                            C/C++ Compiler                                          Processors   RAM Minimum   DISK Needs
+  ------------------------------------- ----------------------------- ------------------------------------------------------- ------------ ------------- ------------
+  Linux X86 (32-bit) and X64 (64-bit)   Oracle Enterprise Linux 6.4   gcc 4.9.2                                               2 or more    1 GB          6 GB
+  Solaris SPARCV9 (64-bit)              Solaris 11 Update 1           Studio 12 Update 4 + patches                            4 or more    4 GB          8 GB
+  Solaris X64 (64-bit)                  Solaris 11 Update 1           Studio 12 Update 4 + patches                            4 or more    4 GB          8 GB
+  Windows X86 (32-bit)                  Windows Server 2012 R2 x64    Microsoft Visual Studio C++ 2013 Professional Edition   2 or more    2 GB          6 GB
+  Windows X64 (64-bit)                  Windows Server 2012 R2 x64    Microsoft Visual Studio C++ 2013 Professional Edition   2 or more    2 GB          6 GB
+  Mac OS X X64 (64-bit)                 Mac OS X 10.9 "Mavericks"     Xcode 6.3 or newer                                      2 or more    4 GB          6 GB
+
+-------------------------------------------------------------------------------
+
+### Specific Developer Build Environments
+
+We won't be listing all the possible environments, but we will try to provide
+what information we have available to us.
+
+**NOTE: The community can help out by updating this part of the document.**
+
+#### Fedora
+
+After installing the latest [Fedora](http://fedoraproject.org) you need to
+install several build dependencies. The simplest way to do it is to execute the
+following commands as user `root`:
+
+      yum-builddep java-1.7.0-openjdk
+      yum install gcc gcc-c++
+
+In addition, it's necessary to set a few environment variables for the build:
+
+      export LANG=C
+      export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
+
+#### CentOS 5.5
+
+After installing [CentOS 5.5](http://www.centos.org/) you need to make sure you
+have the following Development bundles installed:
+
+ * Development Libraries
+ * Development Tools
+ * Java Development
+ * X Software Development (Including XFree86-devel)
+
+Plus the following packages:
+
+ * cups devel: Cups Development Package
+ * alsa devel: Alsa Development Package
+ * Xi devel: libXi.so Development Package
+
+The freetype 2.3 packages don't seem to be available, but the freetype 2.3
+sources can be downloaded, built, and installed easily enough from [the
+freetype site](http://downloads.sourceforge.net/freetype). Build and install
+with something like:
+
+      bash ./configure
+      make
+      sudo -u root make install
+
+Mercurial packages could not be found easily, but a Google search should find
+ones, and they usually include Python if it's needed.
+
+#### Debian 5.0 (Lenny)
+
+After installing [Debian](http://debian.org) 5 you need to install several
+build dependencies. The simplest way to install the build dependencies is to
+execute the following commands as user `root`:
+
+      aptitude build-dep openjdk-7
+      aptitude install openjdk-7-jdk libmotif-dev
+
+In addition, it's necessary to set a few environment variables for the build:
+
+      export LANG=C
+      export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+
+#### Ubuntu 12.04
+
+After installing [Ubuntu](http://ubuntu.org) 12.04 you need to install several
+build dependencies. The simplest way to do it is to execute the following
+commands:
+
+      sudo aptitude build-dep openjdk-7
+      sudo aptitude install openjdk-7-jdk
+
+In addition, it's necessary to set a few environment variables for the build:
+
+      export LANG=C
+      export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+
+#### OpenSUSE 11.1
+
+After installing [OpenSUSE](http://opensuse.org) 11.1 you need to install
+several build dependencies. The simplest way to install the build dependencies
+is to execute the following commands:
+
+      sudo zypper source-install -d java-1_7_0-openjdk
+      sudo zypper install make
+
+In addition, it is necessary to set a few environment variables for the build:
+
+      export LANG=C
+      export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
+
+Finally, you need to unset the `JAVA_HOME` environment variable:
+
+      export -n JAVA_HOME`
+
+#### Mandriva Linux One 2009 Spring
+
+After installing [Mandriva](http://mandriva.org) Linux One 2009 Spring you need
+to install several build dependencies. The simplest way to install the build
+dependencies is to execute the following commands as user `root`:
+
+      urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
+        libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
+        libxtst6-devel libxi-devel
+
+In addition, it is necessary to set a few environment variables for the build:
+
+      export LANG=C
+      export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
+
+#### OpenSolaris 2009.06
+
+After installing [OpenSolaris](http://opensolaris.org) 2009.06 you need to
+install several build dependencies. The simplest way to install the build
+dependencies is to execute the following commands:
+
+      pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
+        SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
+
+In addition, it is necessary to set a few environment variables for the build:
+
+      export LANG=C
+      export PATH="/opt/SunStudioExpress/bin:${PATH}"
+
+-------------------------------------------------------------------------------
+
+End of the OpenJDK build README document.
+
+Please come again!
diff --git a/common/doc/testing.html b/common/doc/testing.html
new file mode 100644
index 0000000..71965f3
--- /dev/null
+++ b/common/doc/testing.html
@@ -0,0 +1,112 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <meta http-equiv="Content-Style-Type" content="text/css" />
+  <meta name="generator" content="pandoc" />
+  <title>Testing OpenJDK</title>
+  <style type="text/css">code{white-space: pre;}</style>
+  <link rel="stylesheet" href="http://openjdk.java.net/page.css" type="text/css" />
+  <style type="text/css">pre, code, tt { color: #1d6ae5; }</style>
+  <style type="text/css">pre { font-size: 10pt; }</style>
+</head>
+<body>
+<div id="header">
+<h1 class="title">Testing OpenJDK</h1>
+</div>
+<div id="TOC">
+<ul>
+<li><a href="#using-the-run-test-framework">Using the run-test framework</a></li>
+<li><a href="#test-selection">Test selection</a><ul>
+<li><a href="#jtreg">JTreg</a></li>
+<li><a href="#gtest">Gtest</a></li>
+</ul></li>
+<li><a href="#test-results-and-summary">Test results and summary</a></li>
+<li><a href="#test-suite-control">Test suite control</a><ul>
+<li><a href="#jtreg-keywords">JTreg keywords</a></li>
+<li><a href="#gtest-keywords">Gtest keywords</a></li>
+</ul></li>
+</ul>
+</div>
+<h2 id="using-the-run-test-framework">Using the run-test framework</h2>
+<p>This new way of running tests is developer-centric. It assumes that you have built a jdk locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.</p>
+<p>Some example command-lines:</p>
+<pre><code>$ make run-test-tier1
+$ make run-test-jdk_lang JTREG=&quot;JOBS=8&quot;
+$ make run-test TEST=jdk_lang
+$ make run-test-only TEST=&quot;gtest:LogTagSet gtest:LogTagSetDescriptions&quot; GTEST=&quot;REPEAT=-1&quot;
+$ make run-test TEST=&quot;hotspot/test:hotspot_gc&quot; JTREG=&quot;JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;
+$ make run-test TEST=&quot;jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java&quot;</code></pre>
+<h2 id="test-selection">Test selection</h2>
+<p>All functionality is available using the run-test make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, run-test-only can be used instead, which do not depend on the source and test image build.</p>
+<p>For some common top-level tests, direct make targets have been generated. This includes all JTreg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make run-test-tier1</code> is equivalent to <code>make run-test TEST=&quot;tier1&quot;</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>run-test TEST=&quot;x&quot;</code> solution needs to be used.</p>
+<p>The test specifications given in <code>TEST</code> is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, <code>:tier1</code> will expand to <code>jtreg:jdk/test:tier1 jtreg:langtools/test:tier1 jtreg:nashorn/test:tier1 jtreg:jaxp/test:tier1</code>. You can always submit a list of fully qualified test descriptors in the <code>TEST</code> variable if you want to shortcut the parser.</p>
+<h3 id="jtreg">JTreg</h3>
+<p>JTreg test groups can be specified either without a test root, e.g. <code>:tier1</code> (or <code>tier1</code>, the initial colon is optional), or with, e.g. <code>hotspot/test:tier1</code>, <code>jdk/test:jdk_util</code>.</p>
+<p>When specified without a test root, all matching groups from all tests roots will be added. Otherwise, only the group from the specified test root will be added.</p>
+<p>Individual JTreg tests or directories containing JTreg tests can also be specified, like <code>hotspot/test/native_sanity/JniVersion.java</code> or <code>hotspot/test/native_sanity</code>. You can also specify an absolute path, to point to a JTreg test outside the source tree.</p>
+<p>As long as the test groups or test paths can be uniquely resolved, you do not need to enter the <code>jtreg:</code> prefix. If this is not possible, or if you want to use a fully qualified test descriptor, add <code>jtreg:</code>, e.g. <code>jtreg:hotspot/test/native_sanity</code>.</p>
+<h3 id="gtest">Gtest</h3>
+<p>Since the Hotspot Gtest suite is so quick, the default is to run all tests. This is specified by just <code>gtest</code>, or as a fully qualified test descriptor <code>gtest:all</code>.</p>
+<p>If you want, you can single out an individual test or a group of tests, for instance <code>gtest:LogDecorations</code> or <code>gtest:LogDecorations.level_test_vm</code>. This can be particularly useful if you want to run a shaky test repeatedly.</p>
+<h2 id="test-results-and-summary">Test results and summary</h2>
+<p>At the end of the test run, a summary of all tests run will be presented. This will have a consistent look, regardless of what test suites were used. This is a sample summary:</p>
+<pre><code>==============================
+Test summary
+==============================
+   TEST                                          TOTAL  PASS  FAIL ERROR
+&gt;&gt; jtreg:jdk/test:tier1                           1867  1865     2     0 &lt;&lt;
+   jtreg:langtools/test:tier1                     4711  4711     0     0
+   jtreg:nashorn/test:tier1                        133   133     0     0
+==============================
+TEST FAILURE</code></pre>
+<p>Tests where the number of TOTAL tests does not equal the number of PASSed tests will be considered a test failure. These are marked with the <code>&gt;&gt; ... &lt;&lt;</code> marker for easy identification.</p>
+<p>The classification of non-passed tests differs a bit between test suites. In the summary, ERROR is used as a catch-all for tests that neither passed nor are classified as failed by the framework. This might indicate test framework error, timeout or other problems.</p>
+<p>In case of test failures, <code>make run-test</code> will exit with a non-zero exit value.</p>
+<p>All tests have their result stored in <code>build/$BUILD/test-result/$TEST_ID</code>, where TEST_ID is a path-safe conversion from the fully qualified test descriptor, e.g. for <code>jtreg:jdk/test:tier1</code> the TEST_ID is <code>jtreg_jdk_test_tier1</code>. This path is also printed in the log at the end of the test run.</p>
+<p>Additional work data is stored in <code>build/$BUILD/test-support/$TEST_ID</code>. For some frameworks, this directory might contain information that is useful in determining the cause of a failed test.</p>
+<h2 id="test-suite-control">Test suite control</h2>
+<p>It is possible to control various aspects of the test suites using make control variables.</p>
+<p>These variables use a keyword=value approach to allow multiple values to be set. So, for instance, <code>JTREG=&quot;JOBS=1;TIMEOUT=8&quot;</code> will set the JTreg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT=8</code>, but using the keyword format means that the <code>JTREG</code> variable is parsed and verified for correctness, so <code>JTREG=&quot;TMIEOUT=8&quot;</code> would give an error, while <code>JTREG_TMIEOUT=8</code> would just pass unnoticed.</p>
+<p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG=&quot;...;...&quot;</code>. This will also make sure spaces are preserved, as in <code>JTREG=&quot;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;</code>.</p>
+<p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=VM_OTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
+<p>As far as possible, the names of the keywords have been standardized between test suites.</p>
+<h3 id="jtreg-keywords">JTreg keywords</h3>
+<h4 id="jobs">JOBS</h4>
+<p>The test concurrency (<code>-concurrency</code>).</p>
+<p>Defaults to TEST_JOBS (if set by <code>--with-test-jobs=</code>), otherwise it defaults to JOBS, except for Hotspot, where the default is <em>number of CPU cores/2</em>, but never more than 12.</p>
+<h4 id="timeout">TIMEOUT</h4>
+<p>The timeout factor (<code>-timeoutFactor</code>).</p>
+<p>Defaults to 4.</p>
+<h4 id="test_mode">TEST_MODE</h4>
+<p>The test mode (<code>-agentvm</code>, <code>-samevm</code> or <code>-othervm</code>).</p>
+<p>Defaults to <code>-agentvm</code>.</p>
+<h4 id="assert">ASSERT</h4>
+<p>Enable asserts (<code>-ea -esa</code>, or none).</p>
+<p>Set to <code>true</code> or <code>false</code>. If true, adds <code>-ea -esa</code>. Defaults to true, except for hotspot.</p>
+<h4 id="verbose">VERBOSE</h4>
+<p>The verbosity level (<code>-verbose</code>).</p>
+<p>Defaults to <code>fail,error,summary</code>.</p>
+<h4 id="retain">RETAIN</h4>
+<p>What test data to retain (<code>-retain</code>).</p>
+<p>Defaults to <code>fail,error</code>.</p>
+<h4 id="max_mem">MAX_MEM</h4>
+<p>Limit memory consumption (<code>-Xmx</code> and <code>-vmoption:-Xmx</code>, or none).</p>
+<p>Limit memory consumption for JTreg test framework and VM under test. Set to 0 to disable the limits.</p>
+<p>Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).</p>
+<h4 id="options">OPTIONS</h4>
+<p>Additional options to the JTreg test framework.</p>
+<p>Use <code>JTREG=&quot;OPTIONS=--help all&quot;</code> to see all available JTreg options.</p>
+<h4 id="java_options">JAVA_OPTIONS</h4>
+<p>Additional Java options to JTreg (<code>-javaoption</code>).</p>
+<h4 id="vm_options">VM_OPTIONS</h4>
+<p>Additional VM options to JTreg (<code>-vmoption</code>).</p>
+<h3 id="gtest-keywords">Gtest keywords</h3>
+<h4 id="repeat">REPEAT</h4>
+<p>The number of times to repeat the tests (<code>--gtest_repeat</code>).</p>
+<p>Default is 1. Set to -1 to repeat indefinitely. This can be especially useful combined with <code>OPTIONS=--gtest_break_on_failure</code> to reproduce an intermittent problem.</p>
+<h4 id="options-1">OPTIONS</h4>
+<p>Additional options to the Gtest test framework.</p>
+<p>Use <code>GTEST=&quot;OPTIONS=--help&quot;</code> to see all available Gtest options.</p>
+</body>
+</html>
diff --git a/common/doc/testing.md b/common/doc/testing.md
new file mode 100644
index 0000000..46f32f9
--- /dev/null
+++ b/common/doc/testing.md
@@ -0,0 +1,207 @@
+% Testing OpenJDK
+
+## Using the run-test framework
+
+This new way of running tests is developer-centric. It assumes that you have
+built a jdk locally and want to test it. Running common test targets is simple,
+and more complex ad-hoc combination of tests is possible. The user interface is
+forgiving, and clearly report errors it cannot resolve.
+
+Some example command-lines:
+
+    $ make run-test-tier1
+    $ make run-test-jdk_lang JTREG="JOBS=8"
+    $ make run-test TEST=jdk_lang
+    $ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
+    $ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug"
+    $ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"
+
+## Test selection
+
+All functionality is available using the run-test make target. In this use
+case, the test or tests to be executed is controlled using the `TEST` variable.
+To speed up subsequent test runs with no source code changes, run-test-only can
+be used instead, which do not depend on the source and test image build.
+
+For some common top-level tests, direct make targets have been generated. This
+includes all JTreg test groups, the hotspot gtest, and custom tests (if
+present). This means that `make run-test-tier1` is equivalent to `make run-test
+TEST="tier1"`, but the latter is more tab-completion friendly. For more complex
+test runs, the `run-test TEST="x"` solution needs to be used.
+
+The test specifications given in `TEST` is parsed into fully qualified test
+descriptors, which clearly and unambigously show which tests will be run. As an
+example, `:tier1` will expand to `jtreg:jdk/test:tier1
+jtreg:langtools/test:tier1 jtreg:nashorn/test:tier1 jtreg:jaxp/test:tier1`. You
+can always submit a list of fully qualified test descriptors in the `TEST`
+variable if you want to shortcut the parser.
+
+### JTreg
+
+JTreg test groups can be specified either without a test root, e.g. `:tier1`
+(or `tier1`, the initial colon is optional), or with, e.g.
+`hotspot/test:tier1`, `jdk/test:jdk_util`.
+
+When specified without a test root, all matching groups from all tests roots
+will be added. Otherwise, only the group from the specified test root will be
+added.
+
+Individual JTreg tests or directories containing JTreg tests can also be
+specified, like `hotspot/test/native_sanity/JniVersion.java` or
+`hotspot/test/native_sanity`. You can also specify an absolute path, to point
+to a JTreg test outside the source tree.
+
+As long as the test groups or test paths can be uniquely resolved, you do not
+need to enter the `jtreg:` prefix. If this is not possible, or if you want to
+use a fully qualified test descriptor, add `jtreg:`, e.g.
+`jtreg:hotspot/test/native_sanity`.
+
+### Gtest
+
+Since the Hotspot Gtest suite is so quick, the default is to run all tests.
+This is specified by just `gtest`, or as a fully qualified test descriptor
+`gtest:all`.
+
+If you want, you can single out an individual test or a group of tests, for
+instance `gtest:LogDecorations` or `gtest:LogDecorations.level_test_vm`. This
+can be particularly useful if you want to run a shaky test repeatedly.
+
+## Test results and summary
+
+At the end of the test run, a summary of all tests run will be presented. This
+will have a consistent look, regardless of what test suites were used. This is
+a sample summary:
+
+    ==============================
+    Test summary
+    ==============================
+       TEST                                          TOTAL  PASS  FAIL ERROR
+    >> jtreg:jdk/test:tier1                           1867  1865     2     0 <<
+       jtreg:langtools/test:tier1                     4711  4711     0     0
+       jtreg:nashorn/test:tier1                        133   133     0     0
+    ==============================
+    TEST FAILURE
+
+Tests where the number of TOTAL tests does not equal the number of PASSed tests
+will be considered a test failure. These are marked with the `>> ... <<` marker
+for easy identification.
+
+The classification of non-passed tests differs a bit between test suites. In
+the summary, ERROR is used as a catch-all for tests that neither passed nor are
+classified as failed by the framework. This might indicate test framework
+error, timeout or other problems.
+
+In case of test failures, `make run-test` will exit with a non-zero exit value.
+
+All tests have their result stored in `build/$BUILD/test-result/$TEST_ID`,
+where TEST_ID is a path-safe conversion from the fully qualified test
+descriptor, e.g. for `jtreg:jdk/test:tier1` the TEST_ID is
+`jtreg_jdk_test_tier1`. This path is also printed in the log at the end of the
+test run.
+
+Additional work data is stored in `build/$BUILD/test-support/$TEST_ID`. For
+some frameworks, this directory might contain information that is useful in
+determining the cause of a failed test.
+
+## Test suite control
+
+It is possible to control various aspects of the test suites using make control
+variables.
+
+These variables use a keyword=value approach to allow multiple values to be
+set. So, for instance, `JTREG="JOBS=1;TIMEOUT=8"` will set the JTreg
+concurrency level to 1 and the timeout factor to 8. This is equivalent to
+setting `JTREG_JOBS=1 JTREG_TIMEOUT=8`, but using the keyword format means that
+the `JTREG` variable is parsed and verified for correctness, so
+`JTREG="TMIEOUT=8"` would give an error, while `JTREG_TMIEOUT=8` would just
+pass unnoticed.
+
+To separate multiple keyword=value pairs, use `;` (semicolon). Since the shell
+normally eats `;`, the recommended usage is to write the assignment inside
+qoutes, e.g. `JTREG="...;..."`. This will also make sure spaces are preserved,
+as in `JTREG="VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug"`.
+
+(Other ways are possible, e.g. using backslash: `JTREG=JOBS=1\;TIMEOUT=8`.
+Also, as a special technique, the string `%20` will be replaced with space for
+certain options, e.g. `JTREG=VM_OTIONS=-XshowSettings%20-Xlog:gc+ref=debug`.
+This can be useful if you have layers of scripts and have trouble getting
+proper quoting of command line arguments through.)
+
+As far as possible, the names of the keywords have been standardized between
+test suites.
+
+### JTreg keywords
+
+#### JOBS
+The test concurrency (`-concurrency`).
+
+Defaults to TEST_JOBS (if set by `--with-test-jobs=`), otherwise it defaults to
+JOBS, except for Hotspot, where the default is *number of CPU cores/2*, but
+never more than 12.
+
+#### TIMEOUT
+The timeout factor (`-timeoutFactor`).
+
+Defaults to 4.
+
+#### TEST_MODE
+The test mode (`-agentvm`, `-samevm` or `-othervm`).
+
+Defaults to `-agentvm`.
+
+#### ASSERT
+Enable asserts (`-ea -esa`, or none).
+
+Set to `true` or `false`. If true, adds `-ea -esa`. Defaults to true, except
+for hotspot.
+
+#### VERBOSE
+The verbosity level (`-verbose`).
+
+Defaults to `fail,error,summary`.
+
+#### RETAIN
+What test data to retain (`-retain`).
+
+Defaults to `fail,error`.
+
+#### MAX_MEM
+Limit memory consumption (`-Xmx` and `-vmoption:-Xmx`, or none).
+
+Limit memory consumption for JTreg test framework and VM under test. Set to 0
+to disable the limits.
+
+Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).
+
+#### OPTIONS
+Additional options to the JTreg test framework.
+
+Use `JTREG="OPTIONS=--help all"` to see all available JTreg options.
+
+#### JAVA_OPTIONS
+Additional Java options to JTreg (`-javaoption`).
+
+#### VM_OPTIONS
+Additional VM options to JTreg (`-vmoption`).
+
+### Gtest keywords
+
+#### REPEAT
+The number of times to repeat the tests (`--gtest_repeat`).
+
+Default is 1. Set to -1 to repeat indefinitely. This can be especially useful
+combined with `OPTIONS=--gtest_break_on_failure` to reproduce an intermittent
+problem.
+
+#### OPTIONS
+Additional options to the Gtest test framework.
+
+Use `GTEST="OPTIONS=--help"` to see all available Gtest options.
+
+---
+# Override some definitions in http://openjdk.java.net/page.css that are
+# unsuitable for this document.
+header-includes:
+ - '<style type="text/css">pre, code, tt { color: #1d6ae5; }</style>'
+ - '<style type="text/css">pre { font-size: 10pt; }</style>'
+---
diff --git a/common/nb_native/nbproject/configurations.xml b/common/nb_native/nbproject/configurations.xml
index 170dc36..934a95f 100644
--- a/common/nb_native/nbproject/configurations.xml
+++ b/common/nb_native/nbproject/configurations.xml
@@ -1223,7 +1223,7 @@
                   <in>check_format.c</in>
                 </df>
                 <df name="libzip">
-                  <df name="zlib-1.2.8">
+                  <df name="zlib">
                     <in>compress.c</in>
                     <in>deflate.c</in>
                     <in>gzclose.c</in>
@@ -38283,7 +38283,7 @@
             <pElem>../../jdk/src/java.base/unix/native/include</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../build/support/headers/java.base</pElem>
             <pElem>../../make</pElem>
           </incDir>
@@ -38304,7 +38304,7 @@
             <pElem>../../jdk/src/java.base/unix/native/include</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../build/support/headers/java.base</pElem>
             <pElem>../../make</pElem>
           </incDir>
@@ -38325,7 +38325,7 @@
             <pElem>../../jdk/src/java.base/unix/native/include</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../build/support/headers/java.base</pElem>
             <pElem>../../make</pElem>
           </incDir>
@@ -38346,7 +38346,7 @@
             <pElem>../../jdk/src/java.base/unix/native/include</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../build/support/headers/java.base</pElem>
             <pElem>../../make</pElem>
           </incDir>
@@ -38367,7 +38367,7 @@
             <pElem>../../jdk/src/java.base/unix/native/include</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../build/support/headers/java.base</pElem>
             <pElem>../../make</pElem>
           </incDir>
@@ -38377,14 +38377,14 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/compress.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/compress.c"
             ex="false"
             tool="0"
             flavor2="0">
         <cTool flags="4">
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/deflate.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38394,7 +38394,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzclose.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/gzclose.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38404,7 +38404,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzlib.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/gzlib.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38414,7 +38414,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzread.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/gzread.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38424,7 +38424,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzwrite.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/gzwrite.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38434,7 +38434,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/infback.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/infback.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38444,7 +38444,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/inffast.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38454,7 +38454,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/inflate.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38464,7 +38464,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/inftrees.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38474,7 +38474,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/trees.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38484,7 +38484,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/uncompr.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/uncompr.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38494,7 +38494,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/zadler32.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/zadler32.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38504,7 +38504,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/zcrc32.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/zcrc32.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -38514,7 +38514,7 @@
           </preprocessorList>
         </cTool>
       </item>
-      <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.c"
+      <item path="../../jdk/src/java.base/share/native/libzip/zlib/zutil.c"
             ex="false"
             tool="0"
             flavor2="0">
@@ -41203,7 +41203,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41232,7 +41232,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41261,7 +41261,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41290,7 +41290,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41319,7 +41319,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41348,7 +41348,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41377,7 +41377,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41406,7 +41406,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41435,7 +41435,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41464,7 +41464,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41493,7 +41493,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41522,7 +41522,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41551,7 +41551,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41580,7 +41580,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41609,7 +41609,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41638,7 +41638,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41667,7 +41667,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41696,7 +41696,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41725,7 +41725,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41754,7 +41754,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41783,7 +41783,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41812,7 +41812,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41841,7 +41841,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41870,7 +41870,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41899,7 +41899,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41928,7 +41928,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41957,7 +41957,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -41986,7 +41986,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42015,7 +42015,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42044,7 +42044,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42073,7 +42073,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42102,7 +42102,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42131,7 +42131,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42160,7 +42160,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42189,7 +42189,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42218,7 +42218,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42247,7 +42247,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42276,7 +42276,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42305,7 +42305,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42334,7 +42334,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42363,7 +42363,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42413,7 +42413,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42442,7 +42442,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -42471,7 +42471,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -46557,7 +46557,7 @@
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjli</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjli</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../make</pElem>
           </incDir>
           <preprocessorList>
@@ -46639,7 +46639,7 @@
           </preprocessorList>
         </cTool>
       </folder>
-      <folder path="0/jdk/src/java.base/share/native/libzip/zlib-1.2.8">
+      <folder path="0/jdk/src/java.base/share/native/libzip/zlib">
         <cTool>
           <incDir>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/giflib</pElem>
@@ -46647,7 +46647,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -46712,7 +46712,7 @@
           <incDir>
             <pElem>../../jdk/src/java.base/unix/native/libjli</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjli</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../make</pElem>
           </incDir>
           <preprocessorList>
@@ -47250,7 +47250,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -47598,7 +47598,7 @@
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem>
             <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem>
             <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
@@ -47996,7 +47996,7 @@
             <pElem>../../jdk/src/jdk.pack/share/native/common-unpack</pElem>
             <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
             <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem>
+            <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem>
             <pElem>../../jdk/src/java.base/share/native/include</pElem>
             <pElem>../../jdk/src/java.base/linux/native/include</pElem>
             <pElem>../../jdk/src/java.base/unix/native/include</pElem>
diff --git a/corba/.hgtags b/corba/.hgtags
index 7a24e3f..e7ec5da 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -398,3 +398,11 @@
 68a8e8658511093b322a46ed04b2a321e1da2a43 jdk-9+153
 078ebe23b584466dc8346e620d7821d91751e5a9 jdk-9+154
 a545f54babfa31aa7eb611f36031609acd617cbc jdk-9+155
+907c26240cd481579e919bfd23740797ff8ce1c8 jdk-9+156
+9383da04b385cca46b7ca67f3a39ac1b673e09fe jdk-9+157
+de6bdf38935fa753183ca288bed5c06a23c0bb12 jdk-9+158
+6feea77d2083c99e44aa3e272d07b7fb3b801683 jdk-9+159
+c7688f2fa07936b089ca0e9a0a0eff68ff37a542 jdk-9+160
+18f02bc43fe96aef36791d0df7aca748485210cc jdk-9+161
+18ffcf99a3b4a10457853d94190e825bdf07e39b jdk-9+162
+493011dee80e51c2a2b064d049183c047df36d80 jdk-9+163
diff --git a/corba/README b/corba/README
deleted file mode 100644
index 56825f5..0000000
--- a/corba/README
+++ /dev/null
@@ -1,14 +0,0 @@
-README:
-  This file should be located at the top of the corba Mercurial repository.
-
-  See http://openjdk.java.net/ for more information about the OpenJDK.
-
-  See ../README-builds.html for complete details on build machine requirements.
-
-Simple Build Instructions:
-
-    cd make && gnumake
-     
-  The files that will be imported into the jdk build will be in the "dist"
-  directory.
-
diff --git a/corba/src/java.corba/share/classes/module-info.java b/corba/src/java.corba/share/classes/module-info.java
index 10a26f0..0d3fbe2 100644
--- a/corba/src/java.corba/share/classes/module-info.java
+++ b/corba/src/java.corba/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the Java binding of the OMG CORBA APIs, and the RMI-IIOP API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 @Deprecated(since="9", forRemoval=true)
 module java.corba {
diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java
index 8a75455..ccbf4bc 100644
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java
+++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java
@@ -106,13 +106,13 @@
  *
  *     <LI>check in properties parameter, if any
  *
- *     <LI>check in the System properties
+ *     <LI>check in the System properties, if any
  *
  *     <LI>check in the orb.properties file located in the user.home
- *         directory (if any)
+ *         directory, if any
  *
- *     <LI>check in the orb.properties file located in the java.home/lib
- *         directory (if any)
+ *     <LI>check in the orb.properties file located in the run-time image,
+ *         if any
  *
  *     <LI>fall back on a hardcoded default behavior (use the Java&nbsp;IDL
  *         implementation)
@@ -170,9 +170,15 @@
  * Thus, where appropriate, it is necessary that
  * the classes for this alternative ORBSingleton are available on the application's class path.
  * It should be noted that the singleton ORB is system wide.
- *
+ * <P>
  * When a per-application ORB is created via the 2-arg init methods,
  * then it will be located using the thread context class loader.
+ * <P>
+ * The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location,
+ * in the Java run-time image, to search for orb.properties.
+ * This location is not intended for user editable configuration files.
+ * Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties,
+ * and thereafter the ${java.home}/lib directory.
  *
  * @since   JDK1.2
  */
@@ -271,14 +277,25 @@
                     }
 
                     String javaHome = System.getProperty("java.home");
-                    fileName = javaHome + File.separator
-                        + "lib" + File.separator + "orb.properties";
-                    props = getFileProperties( fileName ) ;
+
+                    fileName = javaHome + File.separator + "conf"
+                            + File.separator + "orb.properties";
+                    props = getFileProperties(fileName);
+
+                    if (props != null) {
+                        String value = props.getProperty(name);
+                        if (value != null)
+                            return value;
+                    }
+
+                    fileName = javaHome + File.separator + "lib"
+                            + File.separator + "orb.properties";
+                    props = getFileProperties(fileName);
 
                     if (props == null)
-                        return null ;
+                        return null;
                     else
-                        return props.getProperty( name ) ;
+                        return props.getProperty(name);
                 }
             }
         );
diff --git a/corba/src/java.corba/share/classes/sun/corba/Bridge.java b/corba/src/java.corba/share/classes/sun/corba/Bridge.java
index 1b3a086..e22240e 100644
--- a/corba/src/java.corba/share/classes/sun/corba/Bridge.java
+++ b/corba/src/java.corba/share/classes/sun/corba/Bridge.java
@@ -59,10 +59,10 @@
  * </ul>
  * The code that calls Bridge.get() must have the following Permissions:
  * <ul>
- * <li>RuntimePermission "reflectionFactoryAccess"</li>
  * <li>BridgePermission "getBridge"</li>
  * <li>ReflectPermission "suppressAccessChecks"</li>
- * <li>StackFramePermission "retainClassReference"</li>
+ * <li>RuntimePermission "getStackWalkerWithClassReference"</li>
+ * <li>RuntimePermission "reflectionFactoryAccess"</li>
  * </ul>
  * <p>
  * All of these permissions are required to obtain and correctly initialize
@@ -105,10 +105,10 @@
     /** Fetch the Bridge singleton.  This requires the following
      * permissions:
      * <ul>
-     * <li>RuntimePermission "reflectionFactoryAccess"</li>
      * <li>BridgePermission "getBridge"</li>
      * <li>ReflectPermission "suppressAccessChecks"</li>
-     * <li>StackFramePermission "retainClassReference"</li>
+     * <li>RuntimePermission "getStackWalkerWithClassReference"</li>
+     * <li>RuntimePermission "reflectionFactoryAccess"</li>
      * </ul>
      * @return The singleton instance of the Bridge class
      * @throws SecurityException if the caller does not have the
diff --git a/hotspot/.hgignore b/hotspot/.hgignore
index 0c053ad..db11ccf 100644
--- a/hotspot/.hgignore
+++ b/hotspot/.hgignore
@@ -15,10 +15,10 @@
 ^\.mx.jvmci/hotspot/eclipse/.*
 ^\.idea/
 ^workingsets.xml
-^src/jdk.vm.ci/share/classes/\w[\w\.]*/.*\.xml
-^src/jdk.vm.ci/share/classes/\w[\w\.]*/.*\.iml
-^src/jdk.vm.ci/share/classes/\w[\w\.]*/nbproject
-^src/jdk.vm.ci/share/classes/\w[\w\.]*/\..*
+^src/jdk.internal.vm.ci/share/classes/\w[\w\.]*/.*\.xml
+^src/jdk.internal.vm.ci/share/classes/\w[\w\.]*/.*\.iml
+^src/jdk.internal.vm.ci/share/classes/\w[\w\.]*/nbproject
+^src/jdk.internal.vm.ci/share/classes/\w[\w\.]*/\..*
 ^test/compiler/jvmci/\w[\w\.]*/.*\.xml
 ^test/compiler/jvmci/\w[\w\.]*/.*\.iml
 ^test/compiler/jvmci/\w[\w\.]*/nbproject
@@ -27,15 +27,15 @@
 ^test/compiler/aot/\w[\w\.]*/.*\.iml
 ^test/compiler/aot/\w[\w\.]*/nbproject
 ^test/compiler/aot/\w[\w\.]*/\..*
-^src/jdk.vm.compiler/\.mx.graal/env
-^src/jdk.vm.compiler/\.mx.graal/.*\.pyc
-^src/jdk.vm.compiler/\.mx.graal/eclipse-launches/.*
+^src/jdk.internal.vm.compiler/\.mx.graal/env
+^src/jdk.internal.vm.compiler/\.mx.graal/.*\.pyc
+^src/jdk.internal.vm.compiler/\.mx.graal/eclipse-launches/.*
 ^src/jdk.aot/share/classes/\w[\w\.]*/.*\.xml
 ^src/jdk.aot/share/classes/\w[\w\.]*/.*\.iml
 ^src/jdk.aot/share/classes/\w[\w\.]*/nbproject
 ^src/jdk.aot/share/classes/\w[\w\.]*/\..*
-^src/jdk.vm.compiler/share/classes/\w[\w\.]*/.*\.xml
-^src/jdk.vm.compiler/share/classes/\w[\w\.]*/.*\.iml
-^src/jdk.vm.compiler/share/classes/\w[\w\.]*/nbproject
-^src/jdk.vm.compiler/share/classes/\w[\w\.]*/\..*
+^src/jdk.internal.vm.compiler/share/classes/\w[\w\.]*/.*\.xml
+^src/jdk.internal.vm.compiler/share/classes/\w[\w\.]*/.*\.iml
+^src/jdk.internal.vm.compiler/share/classes/\w[\w\.]*/nbproject
+^src/jdk.internal.vm.compiler/share/classes/\w[\w\.]*/\..*
 
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 66afb5e..6207adc 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -558,3 +558,13 @@
 217ba81b9a4ce8698200370175aa2db86a39f66c jdk-9+153
 a9fdfd55835ef9dccb7f317b07249bd66653b874 jdk-9+154
 f3b3d77a1751897413aae43ac340a130b6fa2ae1 jdk-9+155
+43139c588ea48b6504e52b6c3dec530b17b1fdb4 jdk-9+156
+b2d0a906afd73dcf27f572217eb1be0f196ec16c jdk-9+157
+4e78f30935229f13ce7c43089621cf7169f5abac jdk-9+158
+9211c2e89c1cd11ec2d5752b0f97131a7d7525c7 jdk-9+159
+94b4e2e5331d38eab6a3639c3511b2e0715df0e9 jdk-9+160
+191ffbdb3d7b734288daa7fb76b37a0a85dfe7eb jdk-9+161
+b01c519b715ef6f785d0631adee0a6537cf6c12e jdk-9+162
+983fe207555724d98f4876991e1cbafbcf2733e8 jdk-9+163
+0af429be8bbaeaaf0cb838e9af28c953dda6a9c8 jdk-9+164
+c92c6416ca03b1464d5ed99cf6201e52b5ba0a70 jdk-9+165
diff --git a/hotspot/.mx.jvmci/mx_jvmci.py b/hotspot/.mx.jvmci/mx_jvmci.py
index daa27f5..b87bab7 100644
--- a/hotspot/.mx.jvmci/mx_jvmci.py
+++ b/hotspot/.mx.jvmci/mx_jvmci.py
@@ -158,8 +158,8 @@
         # JDK9 must be bootstrapped with a JDK8
         compliance = mx.JavaCompliance('8')
         jdk8 = mx.get_jdk(compliance.exactMatch, versionDescription=compliance.value)
-        cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=external', '--disable-precompiled-headers',
-               '--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk8.home]
+        cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=external', '--disable-precompiled-headers', '--with-jvm-features=graal',
+               '--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk8.home, '--with-jvm-features=graal']
         mx.run(cmd, cwd=_jdkSourceRoot)
     cmd = [mx.gmake_cmd(), 'CONF=' + _vm.debugLevel]
     if mx.get_opts().verbose:
@@ -176,66 +176,6 @@
 
     mx.run(cmd, cwd=_jdkSourceRoot)
 
-    if 'images' in cmd:
-        jdkImageDir = join(jdkBuildDir, 'images', 'jdk')
-
-        # The OpenJDK build creates an empty cacerts file so copy one from
-        # the default JDK (which is assumed to be an OracleJDK)
-        srcCerts = join(mx.get_jdk(tag='default').home, 'lib', 'security', 'cacerts')
-        if not exists(srcCerts):
-            # Might be building with JDK8 which has cacerts under jre/
-            srcCerts = join(mx.get_jdk(tag='default').home, 'jre', 'lib', 'security', 'cacerts')
-        dstCerts = join(jdkImageDir, 'lib', 'security', 'cacerts')
-        if srcCerts != dstCerts:
-            shutil.copyfile(srcCerts, dstCerts)
-
-        _create_jdk_bundle(jdkBuildDir, _vm.debugLevel, jdkImageDir)
-
-def _get_jdk_bundle_arches():
-    """
-    Gets a list of names that will be the part of a JDK bundle's file name denoting the architecture.
-    The first element in the list is the canonical name. Symlinks should be created for the
-    remaining names.
-    """
-    cpu = mx.get_arch()
-    if cpu == 'amd64':
-        return ['x64', 'x86_64', 'amd64']
-    elif cpu == 'sparcv9':
-        return ['sparcv9']
-    mx.abort('Unsupported JDK bundle arch: ' + cpu)
-
-def _create_jdk_bundle(jdkBuildDir, debugLevel, jdkImageDir):
-    """
-    Creates a tar.gz JDK archive, an accompanying tar.gz.sha1 file with its
-    SHA1 signature plus symlinks to the archive for non-canonical architecture names.
-    """
-
-    arches = _get_jdk_bundle_arches()
-    jdkTgzPath = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}-{}.tar.gz'.format(debugLevel, _get_openjdk_os(), arches[0]))
-    with mx.Archiver(jdkTgzPath, kind='tgz') as arc:
-        mx.log('Creating ' + jdkTgzPath)
-        for root, _, filenames in os.walk(jdkImageDir):
-            for name in filenames:
-                f = join(root, name)
-                arcname = 'jdk1.9.0/' + os.path.relpath(f, jdkImageDir)
-                arc.zf.add(name=f, arcname=arcname, recursive=False)
-
-    with open(jdkTgzPath + '.sha1', 'w') as fp:
-        mx.log('Creating ' + jdkTgzPath + '.sha1')
-        fp.write(mx.sha1OfFile(jdkTgzPath))
-
-    def _create_link(source, link_name):
-        if exists(link_name):
-            os.remove(link_name)
-        mx.log('Creating ' + link_name + ' -> ' + source)
-        os.symlink(source, link_name)
-
-    for arch in arches[1:]:
-        link_name = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}-{}.tar.gz'.format(debugLevel, _get_openjdk_os(), arch))
-        jdkTgzName = os.path.basename(jdkTgzPath)
-        _create_link(jdkTgzName, link_name)
-        _create_link(jdkTgzName + '.sha1', link_name + '.sha1')
-
 def _runmultimake(args):
     """run the JDK make process for one or more configurations"""
 
diff --git a/hotspot/.mx.jvmci/suite.py b/hotspot/.mx.jvmci/suite.py
index 359c2b2..9415623 100644
--- a/hotspot/.mx.jvmci/suite.py
+++ b/hotspot/.mx.jvmci/suite.py
@@ -43,7 +43,7 @@
     # ------------- JVMCI:Service -------------
 
     "jdk.vm.ci.services" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "javaCompliance" : "9",
       "workingSets" : "API,JVMCI",
@@ -52,7 +52,7 @@
     # ------------- JVMCI:API -------------
 
     "jdk.vm.ci.common" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "checkstyle" : "jdk.vm.ci.services",
       "javaCompliance" : "9",
@@ -60,7 +60,7 @@
     },
 
     "jdk.vm.ci.meta" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "checkstyle" : "jdk.vm.ci.services",
       "javaCompliance" : "9",
@@ -68,7 +68,7 @@
     },
 
     "jdk.vm.ci.code" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : ["jdk.vm.ci.meta"],
       "checkstyle" : "jdk.vm.ci.services",
@@ -92,7 +92,7 @@
     },
 
     "jdk.vm.ci.runtime" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : [
         "jdk.vm.ci.code",
@@ -119,7 +119,7 @@
     # ------------- JVMCI:HotSpot -------------
 
     "jdk.vm.ci.aarch64" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : ["jdk.vm.ci.code"],
       "checkstyle" : "jdk.vm.ci.services",
@@ -128,7 +128,7 @@
     },
 
     "jdk.vm.ci.amd64" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : ["jdk.vm.ci.code"],
       "checkstyle" : "jdk.vm.ci.services",
@@ -137,7 +137,7 @@
     },
 
     "jdk.vm.ci.sparc" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : ["jdk.vm.ci.code"],
       "checkstyle" : "jdk.vm.ci.services",
@@ -146,7 +146,7 @@
     },
 
     "jdk.vm.ci.hotspot" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : [
         "jdk.vm.ci.common",
@@ -175,7 +175,7 @@
     },
 
     "jdk.vm.ci.hotspot.aarch64" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : [
         "jdk.vm.ci.aarch64",
@@ -187,7 +187,7 @@
     },
 
     "jdk.vm.ci.hotspot.amd64" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : [
         "jdk.vm.ci.amd64",
@@ -199,7 +199,7 @@
     },
 
     "jdk.vm.ci.hotspot.sparc" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : [
         "jdk.vm.ci.sparc",
@@ -221,12 +221,12 @@
     # ------------- Distributions -------------
 
     "JVMCI_SERVICES" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "dependencies" : ["jdk.vm.ci.services"],
     },
 
     "JVMCI_API" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "dependencies" : [
         "jdk.vm.ci.runtime",
         "jdk.vm.ci.common",
@@ -240,7 +240,7 @@
     },
 
     "JVMCI_HOTSPOT" : {
-      "subDir" : "src/jdk.vm.ci/share/classes",
+      "subDir" : "src/jdk.internal.vm.ci/share/classes",
       "dependencies" : [
         "jdk.vm.ci.hotspot.aarch64",
         "jdk.vm.ci.hotspot.amd64",
diff --git a/hotspot/README b/hotspot/README
deleted file mode 100644
index 19afb26..0000000
--- a/hotspot/README
+++ /dev/null
@@ -1,14 +0,0 @@
-README:
-  This file should be located at the top of the hotspot Mercurial repository.
-
-  See http://openjdk.java.net/ for more information about the OpenJDK.
-
-  See ../README-builds.html for complete details on build machine requirements.
-
-Simple Build Instructions:
-
-    cd make && gnumake
-     
-  The files that will be imported into the jdk build will be in the "build"
-  directory.
-
diff --git a/hotspot/make/CompileTools.gmk b/hotspot/make/CompileTools.gmk
index ea6c504..c806322 100644
--- a/hotspot/make/CompileTools.gmk
+++ b/hotspot/make/CompileTools.gmk
@@ -38,9 +38,9 @@
 $(eval $(call IncludeCustomExtension, hotspot, CompileTools.gmk))
 
 ifeq ($(INCLUDE_GRAAL), true)
-  VM_CI_SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes
+  VM_CI_SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.internal.vm.ci/share/classes
 
-  SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.vm.compiler/share/classes
+  SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.internal.vm.compiler/share/classes
 
   ##############################################################################
   # Compile the annotation processors
diff --git a/hotspot/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk b/hotspot/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk
new file mode 100644
index 0000000..a8e6030
--- /dev/null
+++ b/hotspot/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk
@@ -0,0 +1,153 @@
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+
+$(eval $(call IncludeCustomExtension, hotspot, gensrc/Gensrc-jdk.internal.vm.compiler.gmk))
+
+GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)
+SRC_DIR := $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes
+
+################################################################################
+
+PROC_SRC_SUBDIRS := \
+    org.graalvm.compiler.code \
+    org.graalvm.compiler.common \
+    org.graalvm.compiler.core \
+    org.graalvm.compiler.core.aarch64 \
+    org.graalvm.compiler.core.amd64 \
+    org.graalvm.compiler.core.common \
+    org.graalvm.compiler.core.sparc \
+    org.graalvm.compiler.debug \
+    org.graalvm.compiler.hotspot \
+    org.graalvm.compiler.hotspot.aarch64 \
+    org.graalvm.compiler.hotspot.amd64 \
+    org.graalvm.compiler.hotspot.sparc \
+    org.graalvm.compiler.graph \
+    org.graalvm.compiler.java \
+    org.graalvm.compiler.lir \
+    org.graalvm.compiler.lir.amd64 \
+    org.graalvm.compiler.loop \
+    org.graalvm.compiler.loop.phases \
+    org.graalvm.compiler.nodes \
+    org.graalvm.compiler.replacements \
+    org.graalvm.compiler.replacements.aarch64 \
+    org.graalvm.compiler.replacements.amd64 \
+    org.graalvm.compiler.phases \
+    org.graalvm.compiler.phases.common \
+    org.graalvm.compiler.printer \
+    org.graalvm.compiler.virtual \
+    #
+
+PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS))
+
+PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
+
+ALL_SRC_DIRS := $(wildcard $(SRC_DIR)/*/src)
+SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))
+
+PROCESSOR_JARS := \
+    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor.jar \
+    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor.jar \
+    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.options.processor.jar \
+    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar \
+    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor.jar \
+    #
+PROCESSOR_PATH := $(call PathList, $(PROCESSOR_JARS))
+
+ADD_EXPORTS := \
+    --add-modules jdk.internal.vm.ci \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.events=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspotvmconfig=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.inittimer=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=ALL-UNNAMED \
+    #
+
+$(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) $(PROCESSOR_JARS)
+	$(call MakeDir, $(@D))
+	$(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files))
+	$(JAVA_SMALL) $(NEW_JAVAC) \
+	    -XDignore.symbol.file \
+	    --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \
+	    $(ADD_EXPORTS) \
+	    -sourcepath $(SOURCEPATH) \
+	    -implicit:none \
+	    -proc:only \
+	    -processorpath $(PROCESSOR_PATH) \
+	    -d $(GENSRC_DIR) \
+	    -s $(GENSRC_DIR) \
+	    @$(@D)/_gensrc_proc_files
+	$(TOUCH) $@
+
+TARGETS += $(GENSRC_DIR)/_gensrc_proc_done
+
+################################################################################
+
+$(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done
+	($(CD) $(GENSRC_DIR)/META-INF/providers && \
+	    p=""; \
+	    for i in $$($(LS)); do \
+	      c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
+	      if test x$$p != x$$c; then \
+                if test x$$p != x; then \
+	          $(ECHO) "    ;" >> $@; \
+	        fi; \
+	        $(ECHO) "provides $$c with" >> $@; \
+                p=$$c; \
+	      fi; \
+	      $(ECHO) "    $$i," >> $@; \
+	    done); \
+            $(ECHO) "    ;" >> $@; \
+	$(ECHO) "uses org.graalvm.compiler.options.OptionDescriptors;" >> $@; \
+	$(ECHO) "provides org.graalvm.compiler.options.OptionDescriptors with" >> $@; \
+	for i in $$($(FIND) $(GENSRC_DIR) -name '*_OptionDescriptors.java'); do \
+	    c=$$($(ECHO) $$i | $(SED) 's:.*/jdk\.internal\.vm\.compiler/\(.*\)\.java:\1:' | $(TR) '/' '.'); \
+	    $(ECHO) "    $$c," >> $@; \
+	done; \
+	$(ECHO) "    ;" >> $@;
+
+TARGETS += $(GENSRC_DIR)/module-info.java.extra
+
+################################################################################
+
+all: $(TARGETS)
+
+.PHONY: default all
diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.compiler.gmk b/hotspot/make/gensrc/Gensrc-jdk.vm.compiler.gmk
deleted file mode 100644
index f12a2e9..0000000
--- a/hotspot/make/gensrc/Gensrc-jdk.vm.compiler.gmk
+++ /dev/null
@@ -1,152 +0,0 @@
-#
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
-
-$(eval $(call IncludeCustomExtension, hotspot, gensrc/Gensrc-jdk.vm.compiler.gmk))
-
-GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)
-SRC_DIR := $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes
-
-################################################################################
-
-PROC_SRC_SUBDIRS := \
-    org.graalvm.compiler.code \
-    org.graalvm.compiler.common \
-    org.graalvm.compiler.core \
-    org.graalvm.compiler.core.aarch64 \
-    org.graalvm.compiler.core.amd64 \
-    org.graalvm.compiler.core.common \
-    org.graalvm.compiler.core.sparc \
-    org.graalvm.compiler.debug \
-    org.graalvm.compiler.hotspot \
-    org.graalvm.compiler.hotspot.aarch64 \
-    org.graalvm.compiler.hotspot.amd64 \
-    org.graalvm.compiler.hotspot.sparc \
-    org.graalvm.compiler.graph \
-    org.graalvm.compiler.java \
-    org.graalvm.compiler.lir \
-    org.graalvm.compiler.lir.amd64 \
-    org.graalvm.compiler.loop \
-    org.graalvm.compiler.loop.phases \
-    org.graalvm.compiler.nodes \
-    org.graalvm.compiler.replacements \
-    org.graalvm.compiler.replacements.aarch64 \
-    org.graalvm.compiler.replacements.amd64 \
-    org.graalvm.compiler.phases \
-    org.graalvm.compiler.phases.common \
-    org.graalvm.compiler.printer \
-    org.graalvm.compiler.virtual \
-    #
-
-PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS))
-
-PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
-
-ALL_SRC_DIRS := $(wildcard $(SRC_DIR)/*/src)
-SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))
-
-PROCESSOR_JARS := \
-    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor.jar \
-    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor.jar \
-    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.options.processor.jar \
-    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar \
-    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor.jar \
-    #
-PROCESSOR_PATH := $(call PathList, $(PROCESSOR_JARS))
-
-ADD_EXPORTS := \
-    --add-exports jdk.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.hotspot.aarch64=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.hotspot.amd64=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.hotspot.events=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.hotspot.sparc=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.hotspotvmconfig=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.inittimer=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
-    --add-exports jdk.vm.ci/jdk.vm.ci.sparc=ALL-UNNAMED \
-    #
-
-$(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) $(PROCESSOR_JARS)
-	$(call MakeDir, $(@D))
-	$(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files))
-	$(JAVA_SMALL) $(NEW_JAVAC) \
-	    -XDignore.symbol.file \
-	    --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \
-	    $(ADD_EXPORTS) \
-	    -sourcepath $(SOURCEPATH) \
-	    -implicit:none \
-	    -proc:only \
-	    -processorpath $(PROCESSOR_PATH) \
-	    -d $(GENSRC_DIR) \
-	    -s $(GENSRC_DIR) \
-	    @$(@D)/_gensrc_proc_files
-	$(TOUCH) $@
-
-TARGETS += $(GENSRC_DIR)/_gensrc_proc_done
-
-################################################################################
-
-$(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done
-	($(CD) $(GENSRC_DIR)/META-INF/providers && \
-	    p=""; \
-	    for i in $$($(LS)); do \
-	      c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
-	      if test x$$p != x$$c; then \
-                if test x$$p != x; then \
-	          $(ECHO) "    ;" >> $@; \
-	        fi; \
-	        $(ECHO) "provides $$c with" >> $@; \
-                p=$$c; \
-	      fi; \
-	      $(ECHO) "    $$i," >> $@; \
-	    done); \
-            $(ECHO) "    ;" >> $@; \
-	$(ECHO) "uses org.graalvm.compiler.options.OptionDescriptors;" >> $@; \
-	$(ECHO) "provides org.graalvm.compiler.options.OptionDescriptors with" >> $@; \
-	for i in $$($(FIND) $(GENSRC_DIR) -name '*_OptionDescriptors.java'); do \
-	    c=$$($(ECHO) $$i | $(SED) 's:.*/jdk\.vm\.compiler/\(.*\)\.java:\1:' | $(TR) '/' '.'); \
-	    $(ECHO) "    $$c," >> $@; \
-	done; \
-	$(ECHO) "    ;" >> $@;
-
-TARGETS += $(GENSRC_DIR)/module-info.java.extra
-
-################################################################################
-
-all: $(TARGETS)
-
-.PHONY: default all
diff --git a/hotspot/make/ide/CreateVSProject.gmk b/hotspot/make/ide/CreateVSProject.gmk
index db0aca8..2a9da91 100644
--- a/hotspot/make/ide/CreateVSProject.gmk
+++ b/hotspot/make/ide/CreateVSProject.gmk
@@ -112,8 +112,10 @@
       -relativeSrcInclude src \
       -hidePath .hg \
       -hidePath .jcheck \
+      -hidePath jdk.aot \
       -hidePath jdk.hotspot.agent \
-      -hidePath jdk.vm.ci \
+      -hidePath jdk.internal.vm.ci \
+      -hidePath jdk.internal.vm.compiler \
       -hidePath jdk.jfr \
       -compiler VC10 \
       -jdkTargetRoot $(call FixPath, $(JDK_OUTPUTDIR)) \
diff --git a/hotspot/make/lib/CompileJvm.gmk b/hotspot/make/lib/CompileJvm.gmk
index 36d9558..4eb2cbc 100644
--- a/hotspot/make/lib/CompileJvm.gmk
+++ b/hotspot/make/lib/CompileJvm.gmk
@@ -118,6 +118,12 @@
   OPENJDK_TARGET_CPU_VM_VERSION := amd64
 else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
   OPENJDK_TARGET_CPU_VM_VERSION := sparc
+else ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm)
+  ifeq ($(OPENJDK_TARGET_CPU), aarch64)
+    # This sets the Oracle Aarch64 port to use arm64
+    # while the original Aarch64 port uses aarch64
+    OPENJDK_TARGET_CPU_VM_VERSION := arm64
+  endif
 else
   OPENJDK_TARGET_CPU_VM_VERSION := $(OPENJDK_TARGET_CPU)
 endif
diff --git a/hotspot/make/test/JtregNative.gmk b/hotspot/make/test/JtregNative.gmk
index 7223733..42eb76a 100644
--- a/hotspot/make/test/JtregNative.gmk
+++ b/hotspot/make/test/JtregNative.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,8 @@
     $(HOTSPOT_TOPDIR)/test/runtime/jni/PrivateInterfaceMethods \
     $(HOTSPOT_TOPDIR)/test/runtime/jni/ToStringInInterfaceTest \
     $(HOTSPOT_TOPDIR)/test/runtime/jni/CalleeSavedRegisters \
+    $(HOTSPOT_TOPDIR)/test/runtime/jni/CallWithJNIWeak \
+    $(HOTSPOT_TOPDIR)/test/runtime/jni/ReturnJNIWeak \
     $(HOTSPOT_TOPDIR)/test/runtime/modules/getModuleJNI \
     $(HOTSPOT_TOPDIR)/test/runtime/SameObject \
     $(HOTSPOT_TOPDIR)/test/runtime/BoolReturn \
diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad
index 37e63dc..4360e8c 100644
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad
@@ -15501,7 +15501,7 @@
 %}
 
 instruct string_indexofUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2,
-       iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr)
+       iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
 %{
   predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
@@ -15520,7 +15520,7 @@
 %}
 
 instruct string_indexofLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2,
-       iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr)
+       iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
 %{
   predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
@@ -15539,7 +15539,7 @@
 %}
 
 instruct string_indexofUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2,
-       iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr)
+       iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
 %{
   predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
@@ -15558,7 +15558,7 @@
 %}
 
 instruct string_indexofLU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2,
-       iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr)
+       iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
 %{
   predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LU);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2)));
@@ -15577,8 +15577,8 @@
 %}
 
 instruct string_indexof_conUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2,
-                 immI_le_4 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2,
-                 iRegI tmp3, iRegI tmp4, rFlagsReg cr)
+                 immI_le_4 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,
+                 iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
 %{
   predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
@@ -15598,8 +15598,8 @@
 %}
 
 instruct string_indexof_conLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2,
-                 immI_le_4 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2,
-                 iRegI tmp3, iRegI tmp4, rFlagsReg cr)
+                 immI_le_4 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,
+                 iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
 %{
   predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
@@ -15619,8 +15619,8 @@
 %}
 
 instruct string_indexof_conUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2,
-                 immI_1 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2,
-                 iRegI tmp3, iRegI tmp4, rFlagsReg cr)
+                 immI_1 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,
+                 iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
 %{
   predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
@@ -15640,8 +15640,8 @@
 %}
 
 instruct string_indexof_conLU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2,
-                 immI_1 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2,
-                 iRegI tmp3, iRegI tmp4, rFlagsReg cr)
+                 immI_1 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,
+                 iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr)
 %{
   predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LU);
   match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2)));
@@ -15661,8 +15661,8 @@
 %}
 
 instruct string_indexofU_char(iRegP_R1 str1, iRegI_R2 cnt1, iRegI_R3 ch,
-                              iRegI_R0 result, iRegI tmp1, iRegI tmp2,
-                              iRegI tmp3, rFlagsReg cr)
+                              iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2,
+                              iRegINoSp tmp3, rFlagsReg cr)
 %{
   match(Set result (StrIndexOfChar (Binary str1 cnt1) ch));
   effect(USE_KILL str1, USE_KILL cnt1, USE_KILL ch,
@@ -16101,7 +16101,7 @@
 
 // ====================REDUCTION ARITHMETIC====================================
 
-instruct reduce_add2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegI tmp, iRegI tmp2)
+instruct reduce_add2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegINoSp tmp, iRegINoSp tmp2)
 %{
   match(Set dst (AddReductionVI src1 src2));
   ins_cost(INSN_COST);
@@ -16120,7 +16120,7 @@
   ins_pipe(pipe_class_default);
 %}
 
-instruct reduce_add4I(iRegINoSp dst, iRegIorL2I src1, vecX src2, vecX tmp, iRegI tmp2)
+instruct reduce_add4I(iRegINoSp dst, iRegIorL2I src1, vecX src2, vecX tmp, iRegINoSp tmp2)
 %{
   match(Set dst (AddReductionVI src1 src2));
   ins_cost(INSN_COST);
@@ -16138,7 +16138,7 @@
   ins_pipe(pipe_class_default);
 %}
 
-instruct reduce_mul2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegI tmp)
+instruct reduce_mul2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegINoSp tmp)
 %{
   match(Set dst (MulReductionVI src1 src2));
   ins_cost(INSN_COST);
@@ -16157,7 +16157,7 @@
   ins_pipe(pipe_class_default);
 %}
 
-instruct reduce_mul4I(iRegINoSp dst, iRegIorL2I src1, vecX src2, vecX tmp, iRegI tmp2)
+instruct reduce_mul4I(iRegINoSp dst, iRegIorL2I src1, vecX src2, vecX tmp, iRegINoSp tmp2)
 %{
   match(Set dst (MulReductionVI src1 src2));
   ins_cost(INSN_COST);
diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
index b139a44..0016aa9 100644
--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
@@ -1922,12 +1922,17 @@
     }
 
     if (opr2->is_constant()) {
+      bool is_32bit = false; // width of register operand
       jlong imm;
+
       switch(opr2->type()) {
+      case T_INT:
+        imm = opr2->as_constant_ptr()->as_jint();
+        is_32bit = true;
+        break;
       case T_LONG:
         imm = opr2->as_constant_ptr()->as_jlong();
         break;
-      case T_INT:
       case T_ADDRESS:
         imm = opr2->as_constant_ptr()->as_jint();
         break;
@@ -1942,14 +1947,14 @@
       }
 
       if (Assembler::operand_valid_for_add_sub_immediate(imm)) {
-        if (type2aelembytes(opr1->type()) <= 4)
+        if (is_32bit)
           __ cmpw(reg1, imm);
         else
           __ cmp(reg1, imm);
         return;
       } else {
         __ mov(rscratch1, imm);
-        if (type2aelembytes(opr1->type()) <= 4)
+        if (is_32bit)
           __ cmpw(reg1, rscratch1);
         else
           __ cmp(reg1, rscratch1);
diff --git a/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp
index b2f2103..a09c523 100644
--- a/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, 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.
  *
@@ -82,6 +82,11 @@
   __ eor(robj, robj, rcounter);               // obj, since
                                               // robj ^ rcounter ^ rcounter == robj
                                               // robj is address dependent on rcounter.
+
+  // If mask changes we need to ensure that the inverse is still encodable as an immediate
+  STATIC_ASSERT(JNIHandles::weak_tag_mask == 1);
+  __ andr(robj, robj, ~JNIHandles::weak_tag_mask);
+
   __ ldr(robj, Address(robj, 0));             // *obj
   __ lsr(roffset, c_rarg2, 2);                // offset
 
diff --git a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
index 01e0eeb..a286102 100644
--- a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -2052,13 +2052,31 @@
 
   __ reset_last_Java_frame(false);
 
-  // Unpack oop result
+  // Unbox oop result, e.g. JNIHandles::resolve result.
   if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
-      Label L;
-      __ cbz(r0, L);
-      __ ldr(r0, Address(r0, 0));
-      __ bind(L);
-      __ verify_oop(r0);
+    Label done, not_weak;
+    __ cbz(r0, done);           // Use NULL as-is.
+    STATIC_ASSERT(JNIHandles::weak_tag_mask == 1u);
+    __ tbz(r0, 0, not_weak);    // Test for jweak tag.
+    // Resolve jweak.
+    __ ldr(r0, Address(r0, -JNIHandles::weak_tag_value));
+    __ verify_oop(r0);
+#if INCLUDE_ALL_GCS
+    if (UseG1GC) {
+      __ g1_write_barrier_pre(noreg /* obj */,
+                              r0 /* pre_val */,
+                              rthread /* thread */,
+                              rscratch1 /* tmp */,
+                              true /* tosca_live */,
+                              true /* expand_call */);
+    }
+#endif // INCLUDE_ALL_GCS
+    __ b(done);
+    __ bind(not_weak);
+    // Resolve (untagged) jobject.
+    __ ldr(r0, Address(r0, 0));
+    __ verify_oop(r0);
+    __ bind(done);
   }
 
   if (CheckJNICalls) {
diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
index 90dcd6c..6f44292 100644
--- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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.
  *
@@ -1399,13 +1399,32 @@
   // and result handler will pick it up
 
   {
-    Label no_oop, store_result;
+    Label no_oop, not_weak, store_result;
     __ adr(t, ExternalAddress(AbstractInterpreter::result_handler(T_OBJECT)));
     __ cmp(t, result_handler);
     __ br(Assembler::NE, no_oop);
-    // retrieve result
+    // Unbox oop result, e.g. JNIHandles::resolve result.
     __ pop(ltos);
-    __ cbz(r0, store_result);
+    __ cbz(r0, store_result);   // Use NULL as-is.
+    STATIC_ASSERT(JNIHandles::weak_tag_mask == 1u);
+    __ tbz(r0, 0, not_weak);    // Test for jweak tag.
+    // Resolve jweak.
+    __ ldr(r0, Address(r0, -JNIHandles::weak_tag_value));
+#if INCLUDE_ALL_GCS
+    if (UseG1GC) {
+      __ enter();                   // Barrier may call runtime.
+      __ g1_write_barrier_pre(noreg /* obj */,
+                              r0 /* pre_val */,
+                              rthread /* thread */,
+                              t /* tmp */,
+                              true /* tosca_live */,
+                              true /* expand_call */);
+      __ leave();
+    }
+#endif // INCLUDE_ALL_GCS
+    __ b(store_result);
+    __ bind(not_weak);
+    // Resolve (untagged) jobject.
     __ ldr(r0, Address(r0, 0));
     __ bind(store_result);
     __ str(r0, Address(rfp, frame::interpreter_frame_oop_temp_offset*wordSize));
diff --git a/hotspot/src/cpu/arm/vm/c1_Runtime1_arm.cpp b/hotspot/src/cpu/arm/vm/c1_Runtime1_arm.cpp
index 9f17c8f..5e793e1 100644
--- a/hotspot/src/cpu/arm/vm/c1_Runtime1_arm.cpp
+++ b/hotspot/src/cpu/arm/vm/c1_Runtime1_arm.cpp
@@ -618,7 +618,7 @@
         Address buffer(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() +
                                          DirtyCardQueue::byte_offset_of_buf()));
 
-        AddressLiteral cardtable((address)ct->byte_map_base);
+        AddressLiteral cardtable((address)ct->byte_map_base, relocInfo::none);
         assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
 
         // save at least the registers that need saving if the runtime is called
@@ -645,7 +645,7 @@
         // Note: there is a comment in x86 code about not using
         // ExternalAddress / lea, due to relocation not working
         // properly for that address. Should be OK for arm, where we
-        // explicitly specify that 'cartable' has a relocInfo::none
+        // explicitly specify that 'cardtable' has a relocInfo::none
         // type.
         __ lea(r_card_base_1, cardtable);
         __ add(r_card_addr_0, r_card_base_1, AsmOperand(r_obj_0, lsr, CardTableModRefBS::card_shift));
diff --git a/hotspot/src/cpu/arm/vm/compiledIC_arm.cpp b/hotspot/src/cpu/arm/vm/compiledIC_arm.cpp
index de7249f..abbd673 100644
--- a/hotspot/src/cpu/arm/vm/compiledIC_arm.cpp
+++ b/hotspot/src/cpu/arm/vm/compiledIC_arm.cpp
@@ -85,17 +85,17 @@
 }
 #undef __
 
-// size of C2 call stub, compiled java to interpretor
-int CompiledStaticCall::to_interp_stub_size() {
-  return 8 * NativeInstruction::instruction_size;
-}
-
 // Relocation entries for call stub, compiled java to interpreter.
 int CompiledStaticCall::reloc_to_interp_stub() {
   return 10;  // 4 in emit_to_interp_stub + 1 in Java_Static_Call
 }
 #endif // COMPILER2 || JVMCI
 
+// size of C2 call stub, compiled java to interpretor
+int CompiledStaticCall::to_interp_stub_size() {
+  return 8 * NativeInstruction::instruction_size;
+}
+
 void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) {
   address stub = find_stub(/*is_aot*/ false);
   guarantee(stub != NULL, "stub not found");
@@ -125,6 +125,8 @@
   method_holder->set_data((intptr_t)callee());
   jump->set_jump_destination(entry);
 
+  ICache::invalidate_range(stub, to_interp_stub_size());
+
   // Update jump to call.
   set_destination_mt_safe(stub);
 }
diff --git a/hotspot/src/cpu/arm/vm/interp_masm_arm.cpp b/hotspot/src/cpu/arm/vm/interp_masm_arm.cpp
index 2f41b10..96df37c 100644
--- a/hotspot/src/cpu/arm/vm/interp_masm_arm.cpp
+++ b/hotspot/src/cpu/arm/vm/interp_masm_arm.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -476,185 +476,6 @@
 }
 
 //////////////////////////////////////////////////////////////////////////////////
-#if INCLUDE_ALL_GCS
-
-// G1 pre-barrier.
-// Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR).
-// If store_addr != noreg, then previous value is loaded from [store_addr];
-// in such case store_addr and new_val registers are preserved;
-// otherwise pre_val register is preserved.
-void InterpreterMacroAssembler::g1_write_barrier_pre(Register store_addr,
-                                                     Register new_val,
-                                                     Register pre_val,
-                                                     Register tmp1,
-                                                     Register tmp2) {
-  Label done;
-  Label runtime;
-
-  if (store_addr != noreg) {
-    assert_different_registers(store_addr, new_val, pre_val, tmp1, tmp2, noreg);
-  } else {
-    assert (new_val == noreg, "should be");
-    assert_different_registers(pre_val, tmp1, tmp2, noreg);
-  }
-
-  Address in_progress(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() +
-                                        SATBMarkQueue::byte_offset_of_active()));
-  Address index(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() +
-                                  SATBMarkQueue::byte_offset_of_index()));
-  Address buffer(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() +
-                                   SATBMarkQueue::byte_offset_of_buf()));
-
-  // Is marking active?
-  assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "adjust this code");
-  ldrb(tmp1, in_progress);
-  cbz(tmp1, done);
-
-  // Do we need to load the previous value?
-  if (store_addr != noreg) {
-    load_heap_oop(pre_val, Address(store_addr, 0));
-  }
-
-  // Is the previous value null?
-  cbz(pre_val, done);
-
-  // Can we store original value in the thread's buffer?
-  // Is index == 0?
-  // (The index field is typed as size_t.)
-
-  ldr(tmp1, index);           // tmp1 := *index_adr
-  ldr(tmp2, buffer);
-
-  subs(tmp1, tmp1, wordSize); // tmp1 := tmp1 - wordSize
-  b(runtime, lt);             // If negative, goto runtime
-
-  str(tmp1, index);           // *index_adr := tmp1
-
-  // Record the previous value
-  str(pre_val, Address(tmp2, tmp1));
-  b(done);
-
-  bind(runtime);
-
-  // save the live input values
-#ifdef AARCH64
-  if (store_addr != noreg) {
-    raw_push(store_addr, new_val);
-  } else {
-    raw_push(pre_val, ZR);
-  }
-#else
-  if (store_addr != noreg) {
-    // avoid raw_push to support any ordering of store_addr and new_val
-    push(RegisterSet(store_addr) | RegisterSet(new_val));
-  } else {
-    push(pre_val);
-  }
-#endif // AARCH64
-
-  if (pre_val != R0) {
-    mov(R0, pre_val);
-  }
-  mov(R1, Rthread);
-
-  call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), R0, R1);
-
-#ifdef AARCH64
-  if (store_addr != noreg) {
-    raw_pop(store_addr, new_val);
-  } else {
-    raw_pop(pre_val, ZR);
-  }
-#else
-  if (store_addr != noreg) {
-    pop(RegisterSet(store_addr) | RegisterSet(new_val));
-  } else {
-    pop(pre_val);
-  }
-#endif // AARCH64
-
-  bind(done);
-}
-
-// G1 post-barrier.
-// Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR).
-void InterpreterMacroAssembler::g1_write_barrier_post(Register store_addr,
-                                                      Register new_val,
-                                                      Register tmp1,
-                                                      Register tmp2,
-                                                      Register tmp3) {
-
-  Address queue_index(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() +
-                                        DirtyCardQueue::byte_offset_of_index()));
-  Address buffer(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() +
-                                   DirtyCardQueue::byte_offset_of_buf()));
-
-  BarrierSet* bs = Universe::heap()->barrier_set();
-  CardTableModRefBS* ct = (CardTableModRefBS*)bs;
-  Label done;
-  Label runtime;
-
-  // Does store cross heap regions?
-
-  eor(tmp1, store_addr, new_val);
-#ifdef AARCH64
-  logical_shift_right(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes);
-  cbz(tmp1, done);
-#else
-  movs(tmp1, AsmOperand(tmp1, lsr, HeapRegion::LogOfHRGrainBytes));
-  b(done, eq);
-#endif
-
-  // crosses regions, storing NULL?
-
-  cbz(new_val, done);
-
-  // storing region crossing non-NULL, is card already dirty?
-  const Register card_addr = tmp1;
-  assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
-
-  mov_address(tmp2, (address)ct->byte_map_base, symbolic_Relocation::card_table_reference);
-  add(card_addr, tmp2, AsmOperand(store_addr, lsr, CardTableModRefBS::card_shift));
-
-  ldrb(tmp2, Address(card_addr));
-  cmp(tmp2, (int)G1SATBCardTableModRefBS::g1_young_card_val());
-  b(done, eq);
-
-  membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreLoad), tmp2);
-
-  assert(CardTableModRefBS::dirty_card_val() == 0, "adjust this code");
-  ldrb(tmp2, Address(card_addr));
-  cbz(tmp2, done);
-
-  // storing a region crossing, non-NULL oop, card is clean.
-  // dirty card and log.
-
-  strb(zero_register(tmp2), Address(card_addr));
-
-  ldr(tmp2, queue_index);
-  ldr(tmp3, buffer);
-
-  subs(tmp2, tmp2, wordSize);
-  b(runtime, lt); // go to runtime if now negative
-
-  str(tmp2, queue_index);
-
-  str(card_addr, Address(tmp3, tmp2));
-  b(done);
-
-  bind(runtime);
-
-  if (card_addr != R0) {
-    mov(R0, card_addr);
-  }
-  mov(R1, Rthread);
-  call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), R0, R1);
-
-  bind(done);
-}
-
-#endif // INCLUDE_ALL_GCS
-//////////////////////////////////////////////////////////////////////////////////
 
 
 // Java Expression Stack
diff --git a/hotspot/src/cpu/arm/vm/interp_masm_arm.hpp b/hotspot/src/cpu/arm/vm/interp_masm_arm.hpp
index 5c75375..39e6022 100644
--- a/hotspot/src/cpu/arm/vm/interp_masm_arm.hpp
+++ b/hotspot/src/cpu/arm/vm/interp_masm_arm.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -146,27 +146,6 @@
 
   void set_card(Register card_table_base, Address card_table_addr, Register tmp);
 
-#if INCLUDE_ALL_GCS
-  // G1 pre-barrier.
-  // Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR).
-  // If store_addr != noreg, then previous value is loaded from [store_addr];
-  // in such case store_addr and new_val registers are preserved;
-  // otherwise pre_val register is preserved.
-  void g1_write_barrier_pre(Register store_addr,
-                            Register new_val,
-                            Register pre_val,
-                            Register tmp1,
-                            Register tmp2);
-
-  // G1 post-barrier.
-  // Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR).
-  void g1_write_barrier_post(Register store_addr,
-                             Register new_val,
-                             Register tmp1,
-                             Register tmp2,
-                             Register tmp3);
-#endif // INCLUDE_ALL_GCS
-
   void pop_ptr(Register r);
   void pop_i(Register r = R0_tos);
 #ifdef AARCH64
diff --git a/hotspot/src/cpu/arm/vm/jniFastGetField_arm.cpp b/hotspot/src/cpu/arm/vm/jniFastGetField_arm.cpp
index f9bd9f3..65f929b 100644
--- a/hotspot/src/cpu/arm/vm/jniFastGetField_arm.cpp
+++ b/hotspot/src/cpu/arm/vm/jniFastGetField_arm.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -119,6 +119,14 @@
   __ ldr_s32(Rsafept_cnt, Address(Rsafepoint_counter_addr));
   __ tbnz(Rsafept_cnt, 0, slow_case);
 
+#ifdef AARCH64
+  // If mask changes we need to ensure that the inverse is still encodable as an immediate
+  STATIC_ASSERT(JNIHandles::weak_tag_mask == 1);
+  __ andr(R1, R1, ~JNIHandles::weak_tag_mask);
+#else
+  __ bic(R1, R1, JNIHandles::weak_tag_mask);
+#endif
+
   if (os::is_MP()) {
     // Address dependency restricts memory access ordering. It's cheaper than explicit LoadLoad barrier
     __ andr(Rtmp1, Rsafept_cnt, (unsigned)1);
diff --git a/hotspot/src/cpu/arm/vm/macroAssembler_arm.cpp b/hotspot/src/cpu/arm/vm/macroAssembler_arm.cpp
index ada7d3f..2eb2a55 100644
--- a/hotspot/src/cpu/arm/vm/macroAssembler_arm.cpp
+++ b/hotspot/src/cpu/arm/vm/macroAssembler_arm.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2211,6 +2211,219 @@
   b(done, eq);
 }
 
+
+void MacroAssembler::resolve_jobject(Register value,
+                                     Register tmp1,
+                                     Register tmp2) {
+  assert_different_registers(value, tmp1, tmp2);
+  Label done, not_weak;
+  cbz(value, done);             // Use NULL as-is.
+  STATIC_ASSERT(JNIHandles::weak_tag_mask == 1u);
+  tbz(value, 0, not_weak);      // Test for jweak tag.
+  // Resolve jweak.
+  ldr(value, Address(value, -JNIHandles::weak_tag_value));
+  verify_oop(value);
+#if INCLUDE_ALL_GCS
+  if (UseG1GC) {
+    g1_write_barrier_pre(noreg, // store_addr
+                         noreg, // new_val
+                         value, // pre_val
+                         tmp1,  // tmp1
+                         tmp2); // tmp2
+    }
+#endif // INCLUDE_ALL_GCS
+  b(done);
+  bind(not_weak);
+  // Resolve (untagged) jobject.
+  ldr(value, Address(value));
+  verify_oop(value);
+  bind(done);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////
+
+#if INCLUDE_ALL_GCS
+
+// G1 pre-barrier.
+// Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR).
+// If store_addr != noreg, then previous value is loaded from [store_addr];
+// in such case store_addr and new_val registers are preserved;
+// otherwise pre_val register is preserved.
+void MacroAssembler::g1_write_barrier_pre(Register store_addr,
+                                          Register new_val,
+                                          Register pre_val,
+                                          Register tmp1,
+                                          Register tmp2) {
+  Label done;
+  Label runtime;
+
+  if (store_addr != noreg) {
+    assert_different_registers(store_addr, new_val, pre_val, tmp1, tmp2, noreg);
+  } else {
+    assert (new_val == noreg, "should be");
+    assert_different_registers(pre_val, tmp1, tmp2, noreg);
+  }
+
+  Address in_progress(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() +
+                                        SATBMarkQueue::byte_offset_of_active()));
+  Address index(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() +
+                                  SATBMarkQueue::byte_offset_of_index()));
+  Address buffer(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() +
+                                   SATBMarkQueue::byte_offset_of_buf()));
+
+  // Is marking active?
+  assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "adjust this code");
+  ldrb(tmp1, in_progress);
+  cbz(tmp1, done);
+
+  // Do we need to load the previous value?
+  if (store_addr != noreg) {
+    load_heap_oop(pre_val, Address(store_addr, 0));
+  }
+
+  // Is the previous value null?
+  cbz(pre_val, done);
+
+  // Can we store original value in the thread's buffer?
+  // Is index == 0?
+  // (The index field is typed as size_t.)
+
+  ldr(tmp1, index);           // tmp1 := *index_adr
+  ldr(tmp2, buffer);
+
+  subs(tmp1, tmp1, wordSize); // tmp1 := tmp1 - wordSize
+  b(runtime, lt);             // If negative, goto runtime
+
+  str(tmp1, index);           // *index_adr := tmp1
+
+  // Record the previous value
+  str(pre_val, Address(tmp2, tmp1));
+  b(done);
+
+  bind(runtime);
+
+  // save the live input values
+#ifdef AARCH64
+  if (store_addr != noreg) {
+    raw_push(store_addr, new_val);
+  } else {
+    raw_push(pre_val, ZR);
+  }
+#else
+  if (store_addr != noreg) {
+    // avoid raw_push to support any ordering of store_addr and new_val
+    push(RegisterSet(store_addr) | RegisterSet(new_val));
+  } else {
+    push(pre_val);
+  }
+#endif // AARCH64
+
+  if (pre_val != R0) {
+    mov(R0, pre_val);
+  }
+  mov(R1, Rthread);
+
+  call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), R0, R1);
+
+#ifdef AARCH64
+  if (store_addr != noreg) {
+    raw_pop(store_addr, new_val);
+  } else {
+    raw_pop(pre_val, ZR);
+  }
+#else
+  if (store_addr != noreg) {
+    pop(RegisterSet(store_addr) | RegisterSet(new_val));
+  } else {
+    pop(pre_val);
+  }
+#endif // AARCH64
+
+  bind(done);
+}
+
+// G1 post-barrier.
+// Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR).
+void MacroAssembler::g1_write_barrier_post(Register store_addr,
+                                           Register new_val,
+                                           Register tmp1,
+                                           Register tmp2,
+                                           Register tmp3) {
+
+  Address queue_index(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() +
+                                        DirtyCardQueue::byte_offset_of_index()));
+  Address buffer(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() +
+                                   DirtyCardQueue::byte_offset_of_buf()));
+
+  BarrierSet* bs = Universe::heap()->barrier_set();
+  CardTableModRefBS* ct = (CardTableModRefBS*)bs;
+  Label done;
+  Label runtime;
+
+  // Does store cross heap regions?
+
+  eor(tmp1, store_addr, new_val);
+#ifdef AARCH64
+  logical_shift_right(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes);
+  cbz(tmp1, done);
+#else
+  movs(tmp1, AsmOperand(tmp1, lsr, HeapRegion::LogOfHRGrainBytes));
+  b(done, eq);
+#endif
+
+  // crosses regions, storing NULL?
+
+  cbz(new_val, done);
+
+  // storing region crossing non-NULL, is card already dirty?
+  const Register card_addr = tmp1;
+  assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
+
+  mov_address(tmp2, (address)ct->byte_map_base, symbolic_Relocation::card_table_reference);
+  add(card_addr, tmp2, AsmOperand(store_addr, lsr, CardTableModRefBS::card_shift));
+
+  ldrb(tmp2, Address(card_addr));
+  cmp(tmp2, (int)G1SATBCardTableModRefBS::g1_young_card_val());
+  b(done, eq);
+
+  membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreLoad), tmp2);
+
+  assert(CardTableModRefBS::dirty_card_val() == 0, "adjust this code");
+  ldrb(tmp2, Address(card_addr));
+  cbz(tmp2, done);
+
+  // storing a region crossing, non-NULL oop, card is clean.
+  // dirty card and log.
+
+  strb(zero_register(tmp2), Address(card_addr));
+
+  ldr(tmp2, queue_index);
+  ldr(tmp3, buffer);
+
+  subs(tmp2, tmp2, wordSize);
+  b(runtime, lt); // go to runtime if now negative
+
+  str(tmp2, queue_index);
+
+  str(card_addr, Address(tmp3, tmp2));
+  b(done);
+
+  bind(runtime);
+
+  if (card_addr != R0) {
+    mov(R0, card_addr);
+  }
+  mov(R1, Rthread);
+  call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), R0, R1);
+
+  bind(done);
+}
+
+#endif // INCLUDE_ALL_GCS
+
+//////////////////////////////////////////////////////////////////////////////////
+
 #ifdef AARCH64
 
 void MacroAssembler::load_sized_value(Register dst, Address src, size_t size_in_bytes, bool is_signed) {
diff --git a/hotspot/src/cpu/arm/vm/macroAssembler_arm.hpp b/hotspot/src/cpu/arm/vm/macroAssembler_arm.hpp
index 770bba6..e6f7335 100644
--- a/hotspot/src/cpu/arm/vm/macroAssembler_arm.hpp
+++ b/hotspot/src/cpu/arm/vm/macroAssembler_arm.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -402,6 +402,29 @@
   void biased_locking_enter_with_cas(Register obj_reg, Register old_mark_reg, Register new_mark_reg,
                                      Register tmp, Label& slow_case, int* counter_addr);
 
+  void resolve_jobject(Register value, Register tmp1, Register tmp2);
+
+#if INCLUDE_ALL_GCS
+  // G1 pre-barrier.
+  // Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR).
+  // If store_addr != noreg, then previous value is loaded from [store_addr];
+  // in such case store_addr and new_val registers are preserved;
+  // otherwise pre_val register is preserved.
+  void g1_write_barrier_pre(Register store_addr,
+                            Register new_val,
+                            Register pre_val,
+                            Register tmp1,
+                            Register tmp2);
+
+  // G1 post-barrier.
+  // Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR).
+  void g1_write_barrier_post(Register store_addr,
+                             Register new_val,
+                             Register tmp1,
+                             Register tmp2,
+                             Register tmp3);
+#endif // INCLUDE_ALL_GCS
+
 #ifndef AARCH64
   void nop() {
     mov(R0, R0);
diff --git a/hotspot/src/cpu/arm/vm/sharedRuntime_arm.cpp b/hotspot/src/cpu/arm/vm/sharedRuntime_arm.cpp
index 9b37b4f..48f0964 100644
--- a/hotspot/src/cpu/arm/vm/sharedRuntime_arm.cpp
+++ b/hotspot/src/cpu/arm/vm/sharedRuntime_arm.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1732,14 +1732,7 @@
   case T_FLOAT  : // fall through
   case T_DOUBLE : /* nothing to do */          break;
   case T_OBJECT : // fall through
-  case T_ARRAY  : {
-    Label L;
-    __ cbz(R0, L);
-    __ ldr(R0, Address(R0));
-    __ verify_oop(R0);
-    __ bind(L);
-    break;
-  }
+  case T_ARRAY  : break; // See JNIHandles::resolve below
   default:
     ShouldNotReachHere();
   }
@@ -1748,14 +1741,15 @@
   if (CheckJNICalls) {
     __ str(__ zero_register(Rtemp), Address(Rthread, JavaThread::pending_jni_exception_check_fn_offset()));
   }
-
-  // Unhandle the result
-  if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
-    __ cmp(R0, 0);
-    __ ldr(R0, Address(R0), ne);
-  }
 #endif // AARCH64
 
+  // Unbox oop result, e.g. JNIHandles::resolve value in R0.
+  if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
+    __ resolve_jobject(R0,      // value
+                       Rtemp,   // tmp1
+                       R1_tmp); // tmp2
+  }
+
   // Any exception pending?
   __ ldr(Rtemp, Address(Rthread, Thread::pending_exception_offset()));
   __ mov(SP, FP);
diff --git a/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp b/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp
index 743510e..7fda747 100644
--- a/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp
+++ b/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1240,28 +1240,25 @@
     __ str(__ zero_register(Rtemp), Address(Rthread, JavaThread::pending_jni_exception_check_fn_offset()));
   }
 
-  // Unbox if the result is non-zero object
-#ifdef AARCH64
+  // Unbox oop result, e.g. JNIHandles::resolve result if it's an oop.
   {
-    Label L, Lnull;
+    Label Lnot_oop;
+#ifdef AARCH64
     __ mov_slow(Rtemp, AbstractInterpreter::result_handler(T_OBJECT));
     __ cmp(Rresult_handler, Rtemp);
-    __ b(L, ne);
-    __ cbz(Rsaved_result, Lnull);
-    __ ldr(Rsaved_result, Address(Rsaved_result));
-    __ bind(Lnull);
-    // Store oop on the stack for GC
-    __ str(Rsaved_result, Address(FP, frame::interpreter_frame_oop_temp_offset * wordSize));
-    __ bind(L);
+    __ b(Lnot_oop, ne);
+#else // !AARCH64
+    // For ARM32, Rresult_handler is -1 for oop result, 0 otherwise.
+    __ cbz(Rresult_handler, Lnot_oop);
+#endif // !AARCH64
+    Register value = AARCH64_ONLY(Rsaved_result) NOT_AARCH64(Rsaved_result_lo);
+    __ resolve_jobject(value,   // value
+                       Rtemp,   // tmp1
+                       R1_tmp); // tmp2
+    // Store resolved result in frame for GC visibility.
+    __ str(value, Address(FP, frame::interpreter_frame_oop_temp_offset * wordSize));
+    __ bind(Lnot_oop);
   }
-#else
-  __ tst(Rsaved_result_lo, Rresult_handler);
-  __ ldr(Rsaved_result_lo, Address(Rsaved_result_lo), ne);
-
-  // Store oop on the stack for GC
-  __ cmp(Rresult_handler, 0);
-  __ str(Rsaved_result_lo, Address(FP, frame::interpreter_frame_oop_temp_offset * wordSize), ne);
-#endif // AARCH64
 
 #ifdef AARCH64
   // Restore SP (drop native parameters area), to keep SP in sync with extended_sp in frame
diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
index 131a931..b6a5386 100644
--- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -171,10 +171,7 @@
     switch (method->result_type()) {
       case T_OBJECT:
       case T_ARRAY: {
-        oop* obj_p = *(oop**)lresult;
-        oop obj = (obj_p == NULL) ? (oop)NULL : *obj_p;
-        assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check");
-        *oop_result = obj;
+        *oop_result = JNIHandles::resolve(*(jobject*)lresult);
         break;
       }
       // We use std/stfd to store the values.
diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
index a5d5613..6eb27c7 100644
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3033,6 +3033,34 @@
   stbx(R0, Rtmp, Robj);
 }
 
+// Kills R31 if value is a volatile register.
+void MacroAssembler::resolve_jobject(Register value, Register tmp1, Register tmp2, bool needs_frame) {
+  Label done;
+  cmpdi(CCR0, value, 0);
+  beq(CCR0, done);         // Use NULL as-is.
+
+  clrrdi(tmp1, value, JNIHandles::weak_tag_size);
+#if INCLUDE_ALL_GCS
+  if (UseG1GC) { andi_(tmp2, value, JNIHandles::weak_tag_mask); }
+#endif
+  ld(value, 0, tmp1);      // Resolve (untagged) jobject.
+
+#if INCLUDE_ALL_GCS
+  if (UseG1GC) {
+    Label not_weak;
+    beq(CCR0, not_weak);   // Test for jweak tag.
+    verify_oop(value);
+    g1_write_barrier_pre(noreg, // obj
+                         noreg, // offset
+                         value, // pre_val
+                         tmp1, tmp2, needs_frame);
+    bind(not_weak);
+  }
+#endif // INCLUDE_ALL_GCS
+  verify_oop(value);
+  bind(done);
+}
+
 #if INCLUDE_ALL_GCS
 // General G1 pre-barrier generator.
 // Goal: record the previous value if it is not null.
@@ -3094,7 +3122,7 @@
 
   bind(runtime);
 
-  // VM call need frame to access(write) O register.
+  // May need to preserve LR. Also needed if current frame is not compatible with C calling convention.
   if (needs_frame) {
     save_LR_CR(Rtmp1);
     push_frame_reg_args(0, Rtmp2);
diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp
index 11b966a..0b1b2a0 100644
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -649,6 +649,8 @@
   void card_write_barrier_post(Register Rstore_addr, Register Rnew_val, Register Rtmp);
   void card_table_write(jbyte* byte_map_base, Register Rtmp, Register Robj);
 
+  void resolve_jobject(Register value, Register tmp1, Register tmp2, bool needs_frame);
+
 #if INCLUDE_ALL_GCS
   // General G1 pre-barrier generator.
   void g1_write_barrier_pre(Register Robj, RegisterOrConstant offset, Register Rpre_val,
diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
index 784595f..dc36aa7 100644
--- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2477,16 +2477,11 @@
 
   __ reset_last_Java_frame();
 
-  // Unpack oop result.
+  // Unbox oop result, e.g. JNIHandles::resolve value.
   // --------------------------------------------------------------------------
 
   if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
-    Label skip_unboxing;
-    __ cmpdi(CCR0, R3_RET, 0);
-    __ beq(CCR0, skip_unboxing);
-    __ ld(R3_RET, 0, R3_RET);
-    __ bind(skip_unboxing);
-    __ verify_oop(R3_RET);
+    __ resolve_jobject(R3_RET, r_temp_1, r_temp_2, /* needs_frame */ false); // kills R31
   }
 
   if (CheckJNICalls) {
diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
index 5681093..ab87c20 100644
--- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2015, 2016 SAP SE. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -401,11 +401,8 @@
   case T_LONG:
      break;
   case T_OBJECT:
-    // unbox result if not null
-    __ cmpdi(CCR0, R3_RET, 0);
-    __ beq(CCR0, done);
-    __ ld(R3_RET, 0, R3_RET);
-    __ verify_oop(R3_RET);
+    // JNIHandles::resolve result.
+    __ resolve_jobject(R3_RET, R11_scratch1, R12_scratch2, /* needs_frame */ true); // kills R31
     break;
   case T_FLOAT:
      break;
diff --git a/hotspot/src/cpu/s390/vm/c1_Runtime1_s390.cpp b/hotspot/src/cpu/s390/vm/c1_Runtime1_s390.cpp
index 7b65476..4f3c095 100644
--- a/hotspot/src/cpu/s390/vm/c1_Runtime1_s390.cpp
+++ b/hotspot/src/cpu/s390/vm/c1_Runtime1_s390.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2016 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
diff --git a/hotspot/src/cpu/s390/vm/macroAssembler_s390.cpp b/hotspot/src/cpu/s390/vm/macroAssembler_s390.cpp
index 0f78e5a..d577611 100644
--- a/hotspot/src/cpu/s390/vm/macroAssembler_s390.cpp
+++ b/hotspot/src/cpu/s390/vm/macroAssembler_s390.cpp
@@ -3439,6 +3439,34 @@
   z_mvi(0, store_addr, 0); // Store byte 0.
 }
 
+void MacroAssembler::resolve_jobject(Register value, Register tmp1, Register tmp2) {
+  NearLabel Ldone;
+  z_ltgr(tmp1, value);
+  z_bre(Ldone);          // Use NULL result as-is.
+
+  z_nill(value, ~JNIHandles::weak_tag_mask);
+  z_lg(value, 0, value); // Resolve (untagged) jobject.
+
+#if INCLUDE_ALL_GCS
+  if (UseG1GC) {
+    NearLabel Lnot_weak;
+    z_tmll(tmp1, JNIHandles::weak_tag_mask); // Test for jweak tag.
+    z_braz(Lnot_weak);
+    verify_oop(value);
+    g1_write_barrier_pre(noreg /* obj */,
+                         noreg /* offset */,
+                         value /* pre_val */,
+                         noreg /* val */,
+                         tmp1  /* tmp1 */,
+                         tmp2  /* tmp2 */,
+                         true  /* pre_val_needed */);
+    bind(Lnot_weak);
+  }
+#endif // INCLUDE_ALL_GCS
+  verify_oop(value);
+  bind(Ldone);
+}
+
 #if INCLUDE_ALL_GCS
 
 //------------------------------------------------------
diff --git a/hotspot/src/cpu/s390/vm/macroAssembler_s390.hpp b/hotspot/src/cpu/s390/vm/macroAssembler_s390.hpp
index 588bde6..2b4002a 100644
--- a/hotspot/src/cpu/s390/vm/macroAssembler_s390.hpp
+++ b/hotspot/src/cpu/s390/vm/macroAssembler_s390.hpp
@@ -726,6 +726,8 @@
   // Write to card table for modification at store_addr - register is destroyed afterwards.
   void card_write_barrier_post(Register store_addr, Register tmp);
 
+  void resolve_jobject(Register value, Register tmp1, Register tmp2);
+
 #if INCLUDE_ALL_GCS
   // General G1 pre-barrier generator.
   // Purpose: record the previous value if it is not null.
diff --git a/hotspot/src/cpu/s390/vm/sharedRuntime_s390.cpp b/hotspot/src/cpu/s390/vm/sharedRuntime_s390.cpp
index ea498e3..89c3ae4 100644
--- a/hotspot/src/cpu/s390/vm/sharedRuntime_s390.cpp
+++ b/hotspot/src/cpu/s390/vm/sharedRuntime_s390.cpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2016 SAP SE. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2272,13 +2272,9 @@
 
   __ reset_last_Java_frame();
 
-  // Unpack oop result
+  // Unpack oop result, e.g. JNIHandles::resolve result.
   if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
-    NearLabel L;
-    __ compare64_and_branch(Z_RET, (RegisterOrConstant)0L, Assembler::bcondEqual, L);
-    __ z_lg(Z_RET, 0, Z_RET);
-    __ bind(L);
-    __ verify_oop(Z_RET);
+    __ resolve_jobject(Z_RET, /* tmp1 */ Z_R13, /* tmp2 */ Z_R7);
   }
 
   if (CheckJNICalls) {
diff --git a/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp b/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp
index 2084f36..20a9a3e 100644
--- a/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp
+++ b/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2016 SAP SE. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1695,14 +1695,11 @@
   // from the jni handle to z_ijava_state.oop_temp. This is
   // necessary, because we reset the jni handle block below.
   // NOTE: frame::interpreter_frame_result() depends on this, too.
-  { NearLabel no_oop_result, store_oop_result;
+  { NearLabel no_oop_result;
   __ load_absolute_address(Z_R1, AbstractInterpreter::result_handler(T_OBJECT));
   __ compareU64_and_branch(Z_R1, Rresult_handler, Assembler::bcondNotEqual, no_oop_result);
-  __ compareU64_and_branch(Rlresult, (intptr_t)0L, Assembler::bcondEqual, store_oop_result);
-  __ z_lg(Rlresult, 0, Rlresult);  // unbox
-  __ bind(store_oop_result);
+  __ resolve_jobject(Rlresult, /* tmp1 */ Rmethod, /* tmp2 */ Z_R1);
   __ z_stg(Rlresult, oop_tmp_offset, Z_fp);
-  __ verify_oop(Rlresult);
   __ bind(no_oop_result);
   }
 
diff --git a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
index 6d3f05a..ff9fcd6 100644
--- a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,6 +68,7 @@
   __ andcc (G4, 1, G0);
   __ br (Assembler::notZero, false, Assembler::pn, label1);
   __ delayed()->srl (O2, 2, O4);
+  __ andn (O1, JNIHandles::weak_tag_mask, O1);
   __ ld_ptr (O1, 0, O5);
 
   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
@@ -147,6 +148,7 @@
   __ andcc (G4, 1, G0);
   __ br (Assembler::notZero, false, Assembler::pn, label1);
   __ delayed()->srl (O2, 2, O4);
+  __ andn (O1, JNIHandles::weak_tag_mask, O1);
   __ ld_ptr (O1, 0, O5);
   __ add (O5, O4, O5);
 
@@ -219,6 +221,7 @@
   __ andcc (G4, 1, G0);
   __ br (Assembler::notZero, false, Assembler::pn, label1);
   __ delayed()->srl (O2, 2, O4);
+  __ andn (O1, JNIHandles::weak_tag_mask, O1);
   __ ld_ptr (O1, 0, O5);
 
   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
index 7b4dcf1..613e662d 100644
--- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2754,15 +2754,30 @@
   __ verify_thread(); // G2_thread must be correct
   __ reset_last_Java_frame();
 
-  // Unpack oop result
+  // Unbox oop result, e.g. JNIHandles::resolve value in I0.
   if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
-      Label L;
-      __ addcc(G0, I0, G0);
-      __ brx(Assembler::notZero, true, Assembler::pt, L);
-      __ delayed()->ld_ptr(I0, 0, I0);
-      __ mov(G0, I0);
-      __ bind(L);
-      __ verify_oop(I0);
+    Label done, not_weak;
+    __ br_null(I0, false, Assembler::pn, done); // Use NULL as-is.
+    __ delayed()->andcc(I0, JNIHandles::weak_tag_mask, G0); // Test for jweak
+    __ brx(Assembler::zero, true, Assembler::pt, not_weak);
+    __ delayed()->ld_ptr(I0, 0, I0); // Maybe resolve (untagged) jobject.
+    // Resolve jweak.
+    __ ld_ptr(I0, -JNIHandles::weak_tag_value, I0);
+#if INCLUDE_ALL_GCS
+    if (UseG1GC) {
+      // Copy to O0 because macro doesn't allow pre_val in input reg.
+      __ mov(I0, O0);
+      __ g1_write_barrier_pre(noreg /* obj */,
+                              noreg /* index */,
+                              0 /* offset */,
+                              O0 /* pre_val */,
+                              G3_scratch /* tmp */,
+                              true /* preserve_o_regs */);
+    }
+#endif // INCLUDE_ALL_GCS
+    __ bind(not_weak);
+    __ verify_oop(I0);
+    __ bind(done);
   }
 
   if (CheckJNICalls) {
diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp
index b677a1d..fd4e3ff 100644
--- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1516,11 +1516,23 @@
 
     __ set((intptr_t)AbstractInterpreter::result_handler(T_OBJECT), G3_scratch);
     __ cmp_and_brx_short(G3_scratch, Lscratch, Assembler::notEqual, Assembler::pt, no_oop);
-    __ addcc(G0, O0, O0);
-    __ brx(Assembler::notZero, true, Assembler::pt, store_result);     // if result is not NULL:
-    __ delayed()->ld_ptr(O0, 0, O0);                                   // unbox it
-    __ mov(G0, O0);
-
+    // Unbox oop result, e.g. JNIHandles::resolve value in O0.
+    __ br_null(O0, false, Assembler::pn, store_result); // Use NULL as-is.
+    __ delayed()->andcc(O0, JNIHandles::weak_tag_mask, G0); // Test for jweak
+    __ brx(Assembler::zero, true, Assembler::pt, store_result);
+    __ delayed()->ld_ptr(O0, 0, O0); // Maybe resolve (untagged) jobject.
+    // Resolve jweak.
+    __ ld_ptr(O0, -JNIHandles::weak_tag_value, O0);
+#if INCLUDE_ALL_GCS
+    if (UseG1GC) {
+      __ g1_write_barrier_pre(noreg /* obj */,
+                              noreg /* index */,
+                              0 /* offset */,
+                              O0 /* pre_val */,
+                              G3_scratch /* tmp */,
+                              true /* preserve_o_regs */);
+    }
+#endif // INCLUDE_ALL_GCS
     __ bind(store_result);
     // Store it where gc will look for it and result handler expects it.
     __ st_ptr(O0, FP, (frame::interpreter_frame_oop_temp_offset*wordSize) + STACK_BIAS);
diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp
index c819ffe..3c6d7b5 100644
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp
@@ -917,7 +917,7 @@
     break;
 
   case 0x62: // EVEX_4bytes
-    assert((UseAVX > 0), "shouldn't have EVEX prefix");
+    assert(VM_Version::supports_evex(), "shouldn't have EVEX prefix");
     assert(ip == inst+1, "no prefixes allowed");
     // no EVEX collisions, all instructions that have 0x62 opcodes
     // have EVEX versions and are subopcodes of 0x66
diff --git a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp
index a45e0eb..719bf8c 100644
--- a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,6 +85,9 @@
     __ movptr (rdx, Address(rsp, 2*wordSize));  // obj
   }
   __ movptr(rax, Address(rsp, 3*wordSize));  // jfieldID
+
+  __ clear_jweak_tag(rdx);
+
   __ movptr(rdx, Address(rdx, 0));           // *obj
   __ shrptr (rax, 2);                         // offset
 
@@ -202,6 +205,9 @@
     __ movptr(rdx, Address(rsp, 3*wordSize));  // obj
   }
   __ movptr(rsi, Address(rsp, 4*wordSize));  // jfieldID
+
+  __ clear_jweak_tag(rdx);
+
   __ movptr(rdx, Address(rdx, 0));           // *obj
   __ shrptr(rsi, 2);                         // offset
 
@@ -291,6 +297,9 @@
     __ movptr(rdx, Address(rsp, 2*wordSize)); // obj
   }
   __ movptr(rax, Address(rsp, 3*wordSize));  // jfieldID
+
+  __ clear_jweak_tag(rdx);
+
   __ movptr(rdx, Address(rdx, 0));           // *obj
   __ shrptr(rax, 2);                         // offset
 
diff --git a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp
index 7286fd1..f18aa68 100644
--- a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,9 @@
                                                 // robj ^ rcounter ^ rcounter == robj
                                                 // robj is data dependent on rcounter.
   }
+
+  __ clear_jweak_tag(robj);
+
   __ movptr(robj, Address(robj, 0));             // *obj
   __ mov   (roffset, c_rarg2);
   __ shrptr(roffset, 2);                         // offset
@@ -178,6 +181,9 @@
                                                 // robj ^ rcounter ^ rcounter == robj
                                                 // robj is data dependent on rcounter.
   }
+
+  __ clear_jweak_tag(robj);
+
   __ movptr(robj, Address(robj, 0));             // *obj
   __ mov   (roffset, c_rarg2);
   __ shrptr(roffset, 2);                         // offset
diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
index b6d3263..f2c8393 100644
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -5129,6 +5129,43 @@
 }
 
 
+void MacroAssembler::resolve_jobject(Register value,
+                                     Register thread,
+                                     Register tmp) {
+  assert_different_registers(value, thread, tmp);
+  Label done, not_weak;
+  testptr(value, value);
+  jcc(Assembler::zero, done);                // Use NULL as-is.
+  testptr(value, JNIHandles::weak_tag_mask); // Test for jweak tag.
+  jcc(Assembler::zero, not_weak);
+  // Resolve jweak.
+  movptr(value, Address(value, -JNIHandles::weak_tag_value));
+  verify_oop(value);
+#if INCLUDE_ALL_GCS
+  if (UseG1GC) {
+    g1_write_barrier_pre(noreg /* obj */,
+                         value /* pre_val */,
+                         thread /* thread */,
+                         tmp /* tmp */,
+                         true /* tosca_live */,
+                         true /* expand_call */);
+  }
+#endif // INCLUDE_ALL_GCS
+  jmp(done);
+  bind(not_weak);
+  // Resolve (untagged) jobject.
+  movptr(value, Address(value, 0));
+  verify_oop(value);
+  bind(done);
+}
+
+void MacroAssembler::clear_jweak_tag(Register possibly_jweak) {
+  const int32_t inverted_jweak_mask = ~static_cast<int32_t>(JNIHandles::weak_tag_mask);
+  STATIC_ASSERT(inverted_jweak_mask == -2); // otherwise check this code
+  // The inverted mask is sign-extended
+  andptr(possibly_jweak, inverted_jweak_mask);
+}
+
 //////////////////////////////////////////////////////////////////////////////////
 #if INCLUDE_ALL_GCS
 
diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
index a3e81e5..39b2e1a 100644
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -297,6 +297,9 @@
   void store_check(Register obj);                // store check for obj - register is destroyed afterwards
   void store_check(Register obj, Address dst);   // same as above, dst is exact store location (reg. is destroyed)
 
+  void resolve_jobject(Register value, Register thread, Register tmp);
+  void clear_jweak_tag(Register possibly_jweak);
+
 #if INCLUDE_ALL_GCS
 
   void g1_write_barrier_pre(Register obj,
diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp
index cb8c08f..fc7fcba 100644
--- a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp
@@ -365,6 +365,10 @@
     NOT_LP64(assert((0xC0 & ubyte_at(1)) == 0xC0, "shouldn't have LDS and LES instructions"));
     return 3;
   }
+  if (instr_0 == instruction_EVEX_prefix_4bytes) {
+    assert(VM_Version::supports_evex(), "shouldn't have EVEX prefix");
+    return 4;
+  }
 
   // First check to see if we have a (prefixed or not) xor
   if (instr_0 >= instruction_prefix_wide_lo && // 0x40
diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp
index 7db3ccb..ef87c17 100644
--- a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp
@@ -356,6 +356,7 @@
 
     instruction_VEX_prefix_2bytes       = Assembler::VEX_2bytes,
     instruction_VEX_prefix_3bytes       = Assembler::VEX_3bytes,
+    instruction_EVEX_prefix_4bytes      = Assembler::EVEX_4bytes,
 
     instruction_size                    = 4,
     instruction_offset                  = 0,
diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
index ed31755..47b9fe5 100644
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2226,14 +2226,11 @@
 
   __ reset_last_Java_frame(thread, false);
 
-  // Unpack oop result
+  // Unbox oop result, e.g. JNIHandles::resolve value.
   if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
-      Label L;
-      __ cmpptr(rax, (int32_t)NULL_WORD);
-      __ jcc(Assembler::equal, L);
-      __ movptr(rax, Address(rax, 0));
-      __ bind(L);
-      __ verify_oop(rax);
+    __ resolve_jobject(rax /* value */,
+                       thread /* thread */,
+                       rcx /* tmp */);
   }
 
   if (CheckJNICalls) {
diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
index 4587b8c..d81e965 100644
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2579,14 +2579,11 @@
 
   __ reset_last_Java_frame(false);
 
-  // Unpack oop result
+  // Unbox oop result, e.g. JNIHandles::resolve value.
   if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
-      Label L;
-      __ testptr(rax, rax);
-      __ jcc(Assembler::zero, L);
-      __ movptr(rax, Address(rax, 0));
-      __ bind(L);
-      __ verify_oop(rax);
+    __ resolve_jobject(rax /* value */,
+                       r15_thread /* thread */,
+                       rcx /* tmp */);
   }
 
   if (CheckJNICalls) {
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp
index eb5661b..9c02d44 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1193,16 +1193,16 @@
   // and result handler will pick it up
 
   {
-    Label no_oop, store_result;
+    Label no_oop, not_weak, store_result;
     __ lea(t, ExternalAddress(AbstractInterpreter::result_handler(T_OBJECT)));
     __ cmpptr(t, Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize));
     __ jcc(Assembler::notEqual, no_oop);
     // retrieve result
     __ pop(ltos);
-    __ testptr(rax, rax);
-    __ jcc(Assembler::zero, store_result);
-    __ movptr(rax, Address(rax, 0));
-    __ bind(store_result);
+    // Unbox oop result, e.g. JNIHandles::resolve value.
+    __ resolve_jobject(rax /* value */,
+                       thread /* thread */,
+                       t /* tmp */);
     __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset*wordSize), rax);
     // keep stack depth as expected by pushing oop which will eventually be discarded
     __ push(ltos);
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp
index 5f1c935..3d2f57f 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2210,7 +2210,6 @@
       // Out-of-line code to allocate method data oop.
       __ bind(profile_method);
       __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
-      __ load_unsigned_byte(rbx, Address(rbcp, 0));  // restore target bytecode
       __ set_method_data_pointer_for_bcp();
       __ jmp(dispatch);
     }
@@ -2225,10 +2224,8 @@
                  CAST_FROM_FN_PTR(address,
                                   InterpreterRuntime::frequency_counter_overflow),
                  rdx);
-      __ load_unsigned_byte(rbx, Address(rbcp, 0));  // restore target bytecode
 
       // rax: osr nmethod (osr ok) or NULL (osr not possible)
-      // rbx: target bytecode
       // rdx: scratch
       // r14: locals pointer
       // r13: bcp
@@ -2238,12 +2235,13 @@
       __ cmpb(Address(rax, nmethod::state_offset()), nmethod::in_use);
       __ jcc(Assembler::notEqual, dispatch);
 
-      // We have the address of an on stack replacement routine in rax
-      // We need to prepare to execute the OSR method. First we must
-      // migrate the locals and monitors off of the stack.
+      // We have the address of an on stack replacement routine in rax.
+      // In preparation of invoking it, first we must migrate the locals
+      // and monitors from off the interpreter frame on the stack.
+      // Ensure to save the osr nmethod over the migration call,
+      // it will be preserved in rbx.
+      __ mov(rbx, rax);
 
-      LP64_ONLY(__ mov(r13, rax));                             // save the nmethod
-      NOT_LP64(__ mov(rbx, rax));                             // save the nmethod
       NOT_LP64(__ get_thread(rcx));
 
       call_VM(noreg, CAST_FROM_FN_PTR(address, SharedRuntime::OSR_migration_begin));
@@ -2258,7 +2256,6 @@
       const Register retaddr   = LP64_ONLY(j_rarg2) NOT_LP64(rdi);
       const Register sender_sp = LP64_ONLY(j_rarg1) NOT_LP64(rdx);
 
-
       // pop the interpreter frame
       __ movptr(sender_sp, Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize)); // get sender sp
       __ leave();                                // remove frame anchor
@@ -2274,8 +2271,7 @@
       __ push(retaddr);
 
       // and begin the OSR nmethod
-      LP64_ONLY(__ jmp(Address(r13, nmethod::osr_entry_point_offset())));
-      NOT_LP64(__ jmp(Address(rbx, nmethod::osr_entry_point_offset())));
+      __ jmp(Address(rbx, nmethod::osr_entry_point_offset()));
     }
   }
 }
diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
index 7bed107..bba9656 100644
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
@@ -850,6 +850,12 @@
 
 #if INCLUDE_RTM_OPT
   if (UseRTMLocking) {
+    if (is_client_compilation_mode_vm()) {
+      // Only C2 does RTM locking optimization.
+      // Can't continue because UseRTMLocking affects UseBiasedLocking flag
+      // setting during arguments processing. See use_biased_locking().
+      vm_exit_during_initialization("RTM locking optimization is not supported in emulated client VM");
+    }
     if (is_intel_family_core()) {
       if ((_model == CPU_MODEL_HASWELL_E3) ||
           (_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) ||
diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
index 1fcf7d9..f7c5109 100644
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -406,10 +406,12 @@
   // oop_temp where the garbage collector can see it before
   // we release the handle it might be protected by.
   if (handler->result_type() == &ffi_type_pointer) {
-    if (result[0])
-      istate->set_oop_temp(*(oop *) result[0]);
-    else
+    if (result[0] == 0) {
       istate->set_oop_temp(NULL);
+    } else {
+      jobject handle = reinterpret_cast<jobject>(result[0]);
+      istate->set_oop_temp(JNIHandles::resolve(handle));
+    }
   }
 
   // Reset handle block
diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java
index b7ba5e8..1eabbdc 100644
--- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java
+++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java
@@ -25,6 +25,7 @@
 
 import org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.core.target.Backend;
+import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder;
 import org.graalvm.compiler.hotspot.stubs.Stub;
 
 import jdk.vm.ci.hotspot.HotSpotCompiledCode;
@@ -48,7 +49,7 @@
     }
 
     public HotSpotCompiledCode compiledCode(CompilationResult result) {
-        return stub.getCompiledCode(backend);
+        return HotSpotCompiledCodeBuilder.createCompiledCode(null, null, result);
     }
 
 }
diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java
index 68f86ef..5fce078 100644
--- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java
+++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java
@@ -59,12 +59,6 @@
         addExternalPltToGotRelocation(binaryContainer, symbol, relocationOffset);
     }
 
-    protected static void addMetaspaceGotRelocation(BinaryContainer binaryContainer, String symbolName, int symbolOffset, int relocationOffset) {
-        ByteContainer container = binaryContainer.getMetaspaceGotContainer();
-        Symbol symbol = container.createGotSymbol(symbolOffset, symbolName);
-        addExternalPltToGotRelocation(binaryContainer, symbol, relocationOffset);
-    }
-
     /**
      * Add an {@link RelocType#EXTERNAL_GOT_TO_PLT} relocation to the
      * {@link BinaryContainer#getExtLinkageGOTContainer()}.
diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java
index 350ee46..159955c 100644
--- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java
+++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java
@@ -70,8 +70,8 @@
      */
     private void fillVMAddresses(HotSpotVMConfigStore config) {
         for (VMField vmField : config.getFields().values()) {
-            if (vmField.value != null) {
-                final long address = vmField.value;
+            if (vmField.value != null && vmField.value instanceof Long) {
+                final long address = (Long) vmField.value;
                 String value = vmField.name;
                 /*
                  * Some fields don't contain addresses but integer values. At least don't add zero
diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java
index a14049d..f589610 100644
--- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java
+++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java
@@ -37,6 +37,7 @@
 final class JavaCallSiteRelocationSymbol extends CallSiteRelocationSymbol {
 
     private static final byte[] zeroSlot = new byte[8];
+    // -1 represents Universe::non_oop_word() value
     private static final byte[] minusOneSlot = {-1, -1, -1, -1, -1, -1, -1, -1};
 
     public JavaCallSiteRelocationSymbol(CompiledMethodInfo mi, Call call, CallSiteRelocationInfo callSiteRelocation, BinaryContainer binaryContainer) {
@@ -79,30 +80,39 @@
         }
 
         // Add relocation to GOT cell for call resolution jump.
+        // This GOT cell will be initialized during JVM startup with address
+        // of JVM runtime call resolution function.
         String gotSymbolName = "got." + getResolveSymbolName(binaryContainer, mi, call);
         Symbol gotSymbol = binaryContainer.getGotSymbol(gotSymbolName);
         addExternalPltToGotRelocation(binaryContainer, gotSymbol, stub.getResolveJumpOffset());
 
         // Add relocation to resolve call jump instruction address for GOT cell.
+        // This GOT cell will be initialized with address of resolution jump instruction and
+        // will be updated with call destination address by JVM runtime call resolution code.
         String pltJmpSymbolName = relocationSymbolName("plt.jmp", mi, call, callSiteRelocation);
         addCodeContainerRelocation(binaryContainer, pltJmpSymbolName, stub.getResolveJumpStart(), gotStartOffset);
 
         // Add relocation to GOT cell for dispatch jump.
+        // The dispatch jump loads destination address from this GOT cell.
         String gotEntrySymbolName = relocationSymbolName("got.entry", mi, call, callSiteRelocation);
         addExtLinkageGotContainerRelocation(binaryContainer, gotEntrySymbolName, gotStartOffset, stub.getDispatchJumpOffset());
 
-        // Virtual call needs initial -1 value.
+        // Virtual call needs initial -1 value for Klass pointer.
+        // Non virtual call needs initial 0 value for Method pointer to call c2i adapter.
         byte[] slot = isVirtualCall ? minusOneSlot : zeroSlot;
-        final int gotMetaOffset = binaryContainer.appendMetaspaceGotBytes(slot, 0, slot.length);
+        final int gotMetaOffset = binaryContainer.appendExtLinkageGotBytes(slot, 0, slot.length);
 
         // Add relocation to GOT cell for move instruction (Klass* for virtual, Method* otherwise).
         String gotMoveSymbolName = relocationSymbolName("got.move", mi, call, callSiteRelocation);
-        addMetaspaceGotRelocation(binaryContainer, gotMoveSymbolName, gotMetaOffset, stub.getMovOffset());
+        addExtLinkageGotContainerRelocation(binaryContainer, gotMoveSymbolName, gotMetaOffset, stub.getMovOffset());
 
         if (isVirtualCall) {
             // Nothing.
         } else {
             // Add relocation to GOT cell for c2i adapter jump.
+            // The c2i jump instruction loads destination address from this GOT cell.
+            // This GOT cell is initialized with -1 and will be updated
+            // by JVM runtime call resolution code.
             String gotC2ISymbolName = relocationSymbolName("got.c2i", mi, call, callSiteRelocation);
             addExtLinkageGotContainerRelocation(binaryContainer, gotC2ISymbolName, gotStartOffset + 8, stub.getC2IJumpOffset());
         }
diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java
index a98dc8d..933e91a 100644
--- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java
+++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java
@@ -625,7 +625,9 @@
 
     private void reportError(Throwable e) {
         log.println("Error: " + e.getMessage());
-        e.printStackTrace(log);
+        if (options.info) {
+            e.printStackTrace(log);
+        }
         log.flush();
     }
 
diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java
index 3fd63b2..603da03 100644
--- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java
+++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java
@@ -77,7 +77,7 @@
         }
 
         if (found == null) {
-            throw new InternalError("Failed to find: " + searchFor.toString());
+            throw new InternalError("Failed to find " + searchFor.getType() + " file: " + searchFor.getName());
         }
         return found;
     }
diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java
index 49e0cdd..cf6a583 100644
--- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java
+++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java
@@ -27,7 +27,7 @@
     private final String type;
 
     public SearchFor(String name) {
-        this(name, "unknown");
+        this(name, "");
     }
 
     public SearchFor(String name, String type) {
@@ -36,7 +36,7 @@
     }
 
     public boolean isUnknown() {
-        return "unknown".equals(type);
+        return "".equals(type);
     }
 
     public String getType() {
@@ -49,6 +49,6 @@
 
     @Override
     public String toString() {
-        return type + ":" + name;
+        return type + ": " + name;
     }
 }
diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java
index b5bc280..e460608 100644
--- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java
+++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java
@@ -31,7 +31,7 @@
 import java.nio.file.Paths;
 
 public class ClassNameSourceProvider implements SourceProvider {
-    public final static String TYPE = "classname";
+    public final static String TYPE = "class";
     private final ClassLoader classLoader;
 
     public ClassNameSourceProvider(FileSupport fileSupport) {
@@ -47,6 +47,10 @@
 
     @Override
     public ClassSource findSource(String name, SearchPath searchPath) {
+        Path path = Paths.get(name);
+        if (ClassSource.pathIsClassFile(path)) {
+            name = ClassSource.makeClassName(path);
+        }
         try {
             classLoader.loadClass(name);
             return new ClassNameSource(name, classLoader);
diff --git a/hotspot/src/jdk.aot/share/classes/module-info.java b/hotspot/src/jdk.aot/share/classes/module-info.java
index 3105d8b..14d1119 100644
--- a/hotspot/src/jdk.aot/share/classes/module-info.java
+++ b/hotspot/src/jdk.aot/share/classes/module-info.java
@@ -25,6 +25,6 @@
 
 module jdk.aot {
     requires jdk.management;
-    requires jdk.vm.ci;
-    requires jdk.vm.compiler;
+    requires jdk.internal.vm.ci;
+    requires jdk.internal.vm.compiler;
 }
diff --git a/hotspot/src/jdk.aot/unix/native/libjelfshim/jdk_tools_jaotc_jnilibelf_JNILibELFAPI.c b/hotspot/src/jdk.aot/unix/native/libjelfshim/jdk_tools_jaotc_jnilibelf_JNILibELFAPI.c
index d6d69cb..b64bc2d 100644
--- a/hotspot/src/jdk.aot/unix/native/libjelfshim/jdk_tools_jaotc_jnilibelf_JNILibELFAPI.c
+++ b/hotspot/src/jdk.aot/unix/native/libjelfshim/jdk_tools_jaotc_jnilibelf_JNILibELFAPI.c
@@ -70,18 +70,17 @@
  */
 
 static jlong getNativeAddress(JNIEnv* env, jobject ptrObj) {
-   jclass ptrClass;
-   jfieldID fidNumber;
    jlong nativeAddress = -1;
-    assert (ptrObj != NULL);
+   assert (ptrObj != NULL);
    // Get a reference to ptr object's class
-   ptrClass = (*env)->GetObjectClass(env, ptrObj);
-
-   // Get the Field ID of the instance variables "address"
-   fidNumber = (*env)->GetFieldID(env, ptrClass, "address", "J");
-   if (fidNumber != NULL) {
-       // Get the long given the Field ID
-       nativeAddress = (*env)->GetLongField(env, ptrObj, fidNumber);
+   jclass ptrClass = (*env)->GetObjectClass(env, ptrObj);
+   if (ptrClass != NULL) {
+       // Get the Field ID of the instance variables "address"
+       jfieldID fidNumber = (*env)->GetFieldID(env, ptrClass, "address", "J");
+       if (fidNumber != NULL) {
+           // Get the long given the Field ID
+           nativeAddress = (*env)->GetLongField(env, ptrObj, fidNumber);
+       }
    }
    // fprintf(stderr, "Native address : %lx\n", nativeAddress);
    return nativeAddress;
@@ -91,10 +90,15 @@
  * Box the nativeAddress as a Pointer object.
  */
 static jobject makePointerObject(JNIEnv* env, jlong nativeAddr) {
+   jobject retObj = NULL;
    jclass ptrClass = (*env)->FindClass(env, "jdk/tools/jaotc/jnilibelf/Pointer");
-   // Call back constructor to allocate a Pointer object, with an int argument
-   jmethodID constructorId = (*env)->GetMethodID(env, ptrClass, "<init>", "(J)V");
-   jobject retObj = (*env)->NewObject(env, ptrClass, constructorId, nativeAddr);
+   if (ptrClass != NULL) {
+       // Call back constructor to allocate a Pointer object, with an int argument
+       jmethodID constructorId = (*env)->GetMethodID(env, ptrClass, "<init>", "(J)V");
+       if (constructorId != NULL) {
+           retObj = (*env)->NewObject(env, ptrClass, constructorId, nativeAddr);
+       }
+   }
    return retObj;
 }
 
diff --git a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h
index 15bf640..2dc0b61 100644
--- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h
+++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h
@@ -33,6 +33,7 @@
 #define ELF_NHDR        Elf64_Nhdr
 #define ELF_DYN         Elf64_Dyn
 #define ELF_ADDR        Elf64_Addr
+#define ELF_AUXV        Elf64_auxv_t
 
 #define ELF_ST_TYPE     ELF64_ST_TYPE
 
@@ -45,6 +46,7 @@
 #define ELF_NHDR        Elf32_Nhdr
 #define ELF_DYN         Elf32_Dyn
 #define ELF_ADDR        Elf32_Addr
+#define ELF_AUXV        Elf32_auxv_t
 
 #define ELF_ST_TYPE     ELF32_ST_TYPE
 
diff --git a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c
index c12f82d..3e3758b 100644
--- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c
+++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
   }
 
 
-  if (strlen(alt_root) + strlen(name) < PATH_MAX) {
+  if (strlen(alt_root) + strlen(name) > PATH_MAX) {
     // Buffer too small.
     return -1;
   }
diff --git a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c
index 6c39d0c..12a6347 100644
--- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c
+++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c
@@ -642,6 +642,18 @@
         if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) {
           return false;
         }
+      } else if (notep->n_type == NT_AUXV) {
+        // Get first segment from entry point
+        ELF_AUXV *auxv = (ELF_AUXV *)descdata;
+        while (auxv->a_type != AT_NULL) {
+          if (auxv->a_type == AT_ENTRY) {
+            // Set entry point address to address of dynamic section.
+            // We will adjust it in read_exec_segments().
+            ph->core->dynamic_addr = auxv->a_un.a_val;
+            break;
+          }
+          auxv++;
+        }
       }
       p = descdata + ROUNDUP(notep->n_descsz, 4);
    }
@@ -832,7 +844,13 @@
 
     // from PT_DYNAMIC we want to read address of first link_map addr
     case PT_DYNAMIC: {
-      ph->core->dynamic_addr = exec_php->p_vaddr;
+      if (exec_ehdr->e_type == ET_EXEC) {
+        ph->core->dynamic_addr = exec_php->p_vaddr;
+      } else { // ET_DYN
+        // dynamic_addr has entry point of executable.
+        // Thus we should substract it.
+        ph->core->dynamic_addr += exec_php->p_vaddr - exec_ehdr->e_entry;
+      }
       print_debug("address of _DYNAMIC is 0x%lx\n", ph->core->dynamic_addr);
       break;
     }
@@ -1030,8 +1048,9 @@
     goto err;
   }
 
-  if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) {
-    print_debug("executable file is not a valid ELF ET_EXEC file\n");
+  if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true ||
+      ((exec_ehdr.e_type != ET_EXEC) && (exec_ehdr.e_type != ET_DYN))) {
+    print_debug("executable file is not a valid ELF file\n");
     goto err;
   }
 
diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java
index 5dbf898..eb3aad9 100644
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -114,6 +114,8 @@
                     }
                 });
 
+                writeHeapRecordPrologue();
+
                 // write JavaThreads
                 writeJavaThreads();
 
diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
index 9da4374..5d23da0 100644
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,8 +45,8 @@
  * WARNING: This format is still under development, and is subject to
  * change without notice.
  *
- * header    "JAVA PROFILE 1.0.1" or "JAVA PROFILE 1.0.2" (0-terminated)
- * u4        size of identifiers. Identifiers are used to represent
+ * header     "JAVA PROFILE 1.0.2" (0-terminated)
+ * u4         size of identifiers. Identifiers are used to represent
  *            UTF8 strings, objects, stack traces, etc. They usually
  *            have the same size as host pointers. For example, on
  *            Solaris and Win32, the size is 4.
@@ -294,10 +294,9 @@
  *                u2        stack trace depth
  *
  *
- * When the header is "JAVA PROFILE 1.0.2" a heap dump can optionally
- * be generated as a sequence of heap dump segments. This sequence is
- * terminated by an end record. The additional tags allowed by format
- * "JAVA PROFILE 1.0.2" are:
+ * A heap dump can optionally be generated as a sequence of heap dump
+ * segments. This sequence is terminated by an end record. The additional
+ * tags allowed by format "JAVA PROFILE 1.0.2" are:
  *
  * HPROF_HEAP_DUMP_SEGMENT  denote a heap dump segment
  *
@@ -310,8 +309,6 @@
 
 public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
 
-    // The heap size threshold used to determine if segmented format
-    // ("JAVA PROFILE 1.0.2") should be used.
     private static final long HPROF_SEGMENTED_HEAP_DUMP_THRESHOLD = 2L * 0x40000000;
 
     // The approximate size of a heap segment. Used to calculate when to create
@@ -319,7 +316,6 @@
     private static final long HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE = 1L * 0x40000000;
 
     // hprof binary file header
-    private static final String HPROF_HEADER_1_0_1 = "JAVA PROFILE 1.0.1";
     private static final String HPROF_HEADER_1_0_2 = "JAVA PROFILE 1.0.2";
 
     // constants in enum HprofTag
@@ -380,6 +376,7 @@
     private static final int JVM_SIGNATURE_ARRAY   = '[';
     private static final int JVM_SIGNATURE_CLASS   = 'L';
 
+    private static final long MAX_U4_VALUE = 0xFFFFFFFFL;
     int serialNum = 1;
 
     public synchronized void write(String fileName) throws IOException {
@@ -469,7 +466,6 @@
             // length later - hprof format requires length.
             out.flush();
             currentSegmentStart = fos.getChannel().position();
-
             // write dummy length of 0 and we'll fix it later.
             out.writeInt(0);
         }
@@ -479,7 +475,7 @@
     protected void writeHeapRecordEpilogue() throws IOException {
         if (useSegmentedHeapDump) {
             out.flush();
-            if ((fos.getChannel().position() - currentSegmentStart - 4) >= HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE) {
+            if ((fos.getChannel().position() - currentSegmentStart - 4L) >= HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE) {
                 fillInHeapRecordLength();
                 currentSegmentStart = 0;
             }
@@ -488,14 +484,14 @@
 
     private void fillInHeapRecordLength() throws IOException {
 
-        // now get current position to calculate length
+        // now get the current position to calculate length
         long dumpEnd = fos.getChannel().position();
 
-        // calculate length of heap data
+        // calculate the length of heap data
         long dumpLenLong = (dumpEnd - currentSegmentStart - 4L);
 
         // Check length boundary, overflow could happen but is _very_ unlikely
-        if(dumpLenLong >= (4L * 0x40000000)){
+        if (dumpLenLong >= (4L * 0x40000000)) {
             throw new RuntimeException("Heap segment size overflow.");
         }
 
@@ -517,6 +513,71 @@
         fos.getChannel().position(currentPosition);
     }
 
+    // get the size in bytes for the requested type
+    private long getSizeForType(int type) throws IOException {
+        switch (type) {
+            case TypeArrayKlass.T_BOOLEAN:
+                return BOOLEAN_SIZE;
+            case TypeArrayKlass.T_INT:
+                return INT_SIZE;
+            case TypeArrayKlass.T_CHAR:
+                return CHAR_SIZE;
+            case TypeArrayKlass.T_SHORT:
+                return SHORT_SIZE;
+            case TypeArrayKlass.T_BYTE:
+                return BYTE_SIZE;
+            case TypeArrayKlass.T_LONG:
+                return LONG_SIZE;
+            case TypeArrayKlass.T_FLOAT:
+                return FLOAT_SIZE;
+            case TypeArrayKlass.T_DOUBLE:
+                return DOUBLE_SIZE;
+            default:
+                throw new RuntimeException(
+                    "Should not reach here: Unknown type: " + type);
+         }
+    }
+
+    private int getArrayHeaderSize(boolean isObjectAarray) {
+        return isObjectAarray?
+            ((int) BYTE_SIZE + 2 * (int) INT_SIZE + 2 * (int) OBJ_ID_SIZE):
+            (2 * (int) BYTE_SIZE + 2 * (int) INT_SIZE + (int) OBJ_ID_SIZE);
+    }
+
+    // Check if we need to truncate an array
+    private int calculateArrayMaxLength(long originalArrayLength,
+                                        int headerSize,
+                                        long typeSize,
+                                        String typeName) throws IOException {
+
+        long length = originalArrayLength;
+
+        // now get the current position to calculate length
+        long dumpEnd = fos.getChannel().position();
+        long originalLengthInBytes = originalArrayLength * typeSize;
+
+        // calculate the length of heap data
+        long currentRecordLength = (dumpEnd - currentSegmentStart - 4L);
+        if (currentRecordLength > 0 &&
+            (currentRecordLength + headerSize + originalLengthInBytes) > MAX_U4_VALUE) {
+            fillInHeapRecordLength();
+            currentSegmentStart = 0;
+            writeHeapRecordPrologue();
+            currentRecordLength = 0;
+        }
+
+        // Calculate the max bytes we can use.
+        long maxBytes = (MAX_U4_VALUE - (headerSize + currentRecordLength));
+
+        if (originalLengthInBytes > maxBytes) {
+            length = maxBytes/typeSize;
+            System.err.println("WARNING: Cannot dump array of type " + typeName
+                               + " with length " + originalArrayLength
+                               + "; truncating to length " + length);
+        }
+        return (int) length;
+    }
+
     private void writeClassDumpRecords() throws IOException {
         SystemDictionary sysDict = VM.getVM().getSystemDictionary();
         ClassLoaderDataGraph cldGraph = VM.getVM().getClassLoaderDataGraph();
@@ -694,12 +755,16 @@
     }
 
     protected void writeObjectArray(ObjArray array) throws IOException {
+        int headerSize = getArrayHeaderSize(true);
+        final int length = calculateArrayMaxLength(array.getLength(),
+                                                   headerSize,
+                                                   OBJ_ID_SIZE,
+                                                   "Object");
         out.writeByte((byte) HPROF_GC_OBJ_ARRAY_DUMP);
         writeObjectID(array);
         out.writeInt(DUMMY_STACK_TRACE_ID);
-        out.writeInt((int) array.getLength());
+        out.writeInt(length);
         writeObjectID(array.getKlass().getJavaMirror());
-        final int length = (int) array.getLength();
         for (int index = 0; index < length; index++) {
             OopHandle handle = array.getOopHandleAt(index);
             writeObjectID(getAddressValue(handle));
@@ -707,101 +772,101 @@
     }
 
     protected void writePrimitiveArray(TypeArray array) throws IOException {
+        int headerSize = getArrayHeaderSize(false);
+        TypeArrayKlass tak = (TypeArrayKlass) array.getKlass();
+        final int type = (int) tak.getElementType();
+        final String typeName = tak.getElementTypeName();
+        final long typeSize = getSizeForType(type);
+        final int length = calculateArrayMaxLength(array.getLength(),
+                                                   headerSize,
+                                                   typeSize,
+                                                   typeName);
         out.writeByte((byte) HPROF_GC_PRIM_ARRAY_DUMP);
         writeObjectID(array);
         out.writeInt(DUMMY_STACK_TRACE_ID);
-        out.writeInt((int) array.getLength());
-        TypeArrayKlass tak = (TypeArrayKlass) array.getKlass();
-        final int type = (int) tak.getElementType();
+        out.writeInt(length);
         out.writeByte((byte) type);
         switch (type) {
             case TypeArrayKlass.T_BOOLEAN:
-                writeBooleanArray(array);
+                writeBooleanArray(array, length);
                 break;
             case TypeArrayKlass.T_CHAR:
-                writeCharArray(array);
+                writeCharArray(array, length);
                 break;
             case TypeArrayKlass.T_FLOAT:
-                writeFloatArray(array);
+                writeFloatArray(array, length);
                 break;
             case TypeArrayKlass.T_DOUBLE:
-                writeDoubleArray(array);
+                writeDoubleArray(array, length);
                 break;
             case TypeArrayKlass.T_BYTE:
-                writeByteArray(array);
+                writeByteArray(array, length);
                 break;
             case TypeArrayKlass.T_SHORT:
-                writeShortArray(array);
+                writeShortArray(array, length);
                 break;
             case TypeArrayKlass.T_INT:
-                writeIntArray(array);
+                writeIntArray(array, length);
                 break;
             case TypeArrayKlass.T_LONG:
-                writeLongArray(array);
+                writeLongArray(array, length);
                 break;
             default:
-                throw new RuntimeException("should not reach here");
+                throw new RuntimeException(
+                    "Should not reach here: Unknown type: " + type);
         }
     }
 
-    private void writeBooleanArray(TypeArray array) throws IOException {
-        final int length = (int) array.getLength();
+    private void writeBooleanArray(TypeArray array, int length) throws IOException {
         for (int index = 0; index < length; index++) {
              long offset = BOOLEAN_BASE_OFFSET + index * BOOLEAN_SIZE;
              out.writeBoolean(array.getHandle().getJBooleanAt(offset));
         }
     }
 
-    private void writeByteArray(TypeArray array) throws IOException {
-        final int length = (int) array.getLength();
+    private void writeByteArray(TypeArray array, int length) throws IOException {
         for (int index = 0; index < length; index++) {
              long offset = BYTE_BASE_OFFSET + index * BYTE_SIZE;
              out.writeByte(array.getHandle().getJByteAt(offset));
         }
     }
 
-    private void writeShortArray(TypeArray array) throws IOException {
-        final int length = (int) array.getLength();
+    private void writeShortArray(TypeArray array, int length) throws IOException {
         for (int index = 0; index < length; index++) {
              long offset = SHORT_BASE_OFFSET + index * SHORT_SIZE;
              out.writeShort(array.getHandle().getJShortAt(offset));
         }
     }
 
-    private void writeIntArray(TypeArray array) throws IOException {
-        final int length = (int) array.getLength();
+    private void writeIntArray(TypeArray array, int length) throws IOException {
         for (int index = 0; index < length; index++) {
              long offset = INT_BASE_OFFSET + index * INT_SIZE;
              out.writeInt(array.getHandle().getJIntAt(offset));
         }
     }
 
-    private void writeLongArray(TypeArray array) throws IOException {
-        final int length = (int) array.getLength();
+    private void writeLongArray(TypeArray array, int length) throws IOException {
         for (int index = 0; index < length; index++) {
              long offset = LONG_BASE_OFFSET + index * LONG_SIZE;
              out.writeLong(array.getHandle().getJLongAt(offset));
         }
     }
 
-    private void writeCharArray(TypeArray array) throws IOException {
-        final int length = (int) array.getLength();
+    private void writeCharArray(TypeArray array, int length) throws IOException {
         for (int index = 0; index < length; index++) {
              long offset = CHAR_BASE_OFFSET + index * CHAR_SIZE;
              out.writeChar(array.getHandle().getJCharAt(offset));
         }
     }
 
-    private void writeFloatArray(TypeArray array) throws IOException {
-        final int length = (int) array.getLength();
+    private void writeFloatArray(TypeArray array, int length) throws IOException {
         for (int index = 0; index < length; index++) {
              long offset = FLOAT_BASE_OFFSET + index * FLOAT_SIZE;
              out.writeFloat(array.getHandle().getJFloatAt(offset));
         }
     }
 
-    private void writeDoubleArray(TypeArray array) throws IOException {
-        final int length = (int) array.getLength();
+    private void writeDoubleArray(TypeArray array, int length) throws IOException {
         for (int index = 0; index < length; index++) {
              long offset = DOUBLE_BASE_OFFSET + index * DOUBLE_SIZE;
              out.writeDouble(array.getHandle().getJDoubleAt(offset));
@@ -996,12 +1061,7 @@
     // writes hprof binary file header
     private void writeFileHeader() throws IOException {
         // version string
-        if(useSegmentedHeapDump) {
-            out.writeBytes(HPROF_HEADER_1_0_2);
-        }
-        else {
-            out.writeBytes(HPROF_HEADER_1_0_1);
-        }
+        out.writeBytes(HPROF_HEADER_1_0_2);
         out.writeByte((byte)'\0');
 
         // write identifier size. we use pointers as identifiers.
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/overview.html b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/overview.html
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/overview.html
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/overview.html
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BailoutException.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BailoutException.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BailoutException.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BailoutException.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequest.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequest.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequest.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequest.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DebugInfo.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DebugInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DebugInfo.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DebugInfo.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InstalledCode.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InstalledCode.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InstalledCode.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InstalledCode.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InvalidInstalledCodeException.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InvalidInstalledCodeException.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InvalidInstalledCodeException.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InvalidInstalledCodeException.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Location.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Location.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Location.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Location.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/MemoryBarriers.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/MemoryBarriers.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/MemoryBarriers.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/MemoryBarriers.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ReferenceMap.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ReferenceMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ReferenceMap.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ReferenceMap.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterSaveLayout.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterSaveLayout.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterSaveLayout.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterSaveLayout.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterValue.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterValue.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterValue.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/SuppressFBWarnings.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/SuppressFBWarnings.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/SuppressFBWarnings.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueKindFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueKindFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueKindFactory.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueKindFactory.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualObject.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualObject.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualObject.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualObject.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrame.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrame.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrame.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrame.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrameVisitor.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrameVisitor.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrameVisitor.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrameVisitor.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/JVMCIError.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/JVMCIError.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/JVMCIError.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/JVMCIError.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/SuppressFBWarnings.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/SuppressFBWarnings.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/SuppressFBWarnings.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java
new file mode 100644
index 0000000..a5c0c7c
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java
@@ -0,0 +1,647 @@
+/*
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.vm.ci.hotspot;
+
+import static jdk.vm.ci.common.InitTimer.timer;
+import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
+
+import java.lang.reflect.Executable;
+
+import jdk.vm.ci.code.BytecodeFrame;
+import jdk.vm.ci.code.InstalledCode;
+import jdk.vm.ci.code.InvalidInstalledCodeException;
+import jdk.vm.ci.code.TargetDescription;
+import jdk.vm.ci.common.InitTimer;
+import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.meta.JavaType;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+
+/**
+ * Calls from Java into HotSpot. The behavior of all the methods in this class that take a native
+ * pointer as an argument (e.g., {@link #getSymbol(long)}) is undefined if the argument does not
+ * denote a valid native object.
+ */
+final class CompilerToVM {
+    /**
+     * Initializes the native part of the JVMCI runtime.
+     */
+    private static native void registerNatives();
+
+    static {
+        initialize();
+    }
+
+    @SuppressWarnings("try")
+    private static void initialize() {
+        try (InitTimer t = timer("CompilerToVM.registerNatives")) {
+            registerNatives();
+        }
+    }
+
+    /**
+     * Gets the {@link CompilerToVM} instance associated with the singleton
+     * {@link HotSpotJVMCIRuntime} instance.
+     */
+    public static CompilerToVM compilerToVM() {
+        return runtime().getCompilerToVM();
+    }
+
+    /**
+     * Copies the original bytecode of {@code method} into a new byte array and returns it.
+     *
+     * @return a new byte array containing the original bytecode of {@code method}
+     */
+    native byte[] getBytecode(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Gets the number of entries in {@code method}'s exception handler table or 0 if it has no
+     * exception handler table.
+     */
+    native int getExceptionTableLength(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Gets the address of the first entry in {@code method}'s exception handler table.
+     *
+     * Each entry is a native object described by these fields:
+     *
+     * <ul>
+     * <li>{@link HotSpotVMConfig#exceptionTableElementSize}</li>
+     * <li>{@link HotSpotVMConfig#exceptionTableElementStartPcOffset}</li>
+     * <li>{@link HotSpotVMConfig#exceptionTableElementEndPcOffset}</li>
+     * <li>{@link HotSpotVMConfig#exceptionTableElementHandlerPcOffset}</li>
+     * <li>{@link HotSpotVMConfig#exceptionTableElementCatchTypeIndexOffset}
+     * </ul>
+     *
+     * @return 0 if {@code method} has no exception handlers (i.e.
+     *         {@code getExceptionTableLength(method) == 0})
+     */
+    native long getExceptionTableStart(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Determines whether {@code method} is currently compilable by the JVMCI compiler being used by
+     * the VM. This can return false if JVMCI compilation failed earlier for {@code method}, a
+     * breakpoint is currently set in {@code method} or {@code method} contains other bytecode
+     * features that require special handling by the VM.
+     */
+    native boolean isCompilable(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Determines if {@code method} is targeted by a VM directive (e.g.,
+     * {@code -XX:CompileCommand=dontinline,<pattern>}) or annotation (e.g.,
+     * {@code jdk.internal.vm.annotation.DontInline}) that specifies it should not be inlined.
+     */
+    native boolean hasNeverInlineDirective(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Determines if {@code method} should be inlined at any cost. This could be because:
+     * <ul>
+     * <li>a CompileOracle directive may forces inlining of this methods</li>
+     * <li>an annotation forces inlining of this method</li>
+     * </ul>
+     */
+    native boolean shouldInlineMethod(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Used to implement {@link ResolvedJavaType#findUniqueConcreteMethod(ResolvedJavaMethod)}.
+     *
+     * @param method the method on which to base the search
+     * @param actualHolderType the best known type of receiver
+     * @return the method result or 0 is there is no unique concrete method for {@code method}
+     */
+    native HotSpotResolvedJavaMethodImpl findUniqueConcreteMethod(HotSpotResolvedObjectTypeImpl actualHolderType, HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Gets the implementor for the interface class {@code type}.
+     *
+     * @return the implementor if there is a single implementor, 0 if there is no implementor, or
+     *         {@code type} itself if there is more than one implementor
+     */
+    native HotSpotResolvedObjectTypeImpl getImplementor(HotSpotResolvedObjectTypeImpl type);
+
+    /**
+     * Determines if {@code method} is ignored by security stack walks.
+     */
+    native boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Converts a name to a type.
+     *
+     * @param name a well formed Java type in {@linkplain JavaType#getName() internal} format
+     * @param accessingClass the context of resolution (must not be null)
+     * @param resolve force resolution to a {@link ResolvedJavaType}. If true, this method will
+     *            either return a {@link ResolvedJavaType} or throw an exception
+     * @return the type for {@code name} or 0 if resolution failed and {@code resolve == false}
+     * @throws LinkageError if {@code resolve == true} and the resolution failed
+     */
+    native HotSpotResolvedObjectTypeImpl lookupType(String name, Class<?> accessingClass, boolean resolve);
+
+    /**
+     * Resolves the entry at index {@code cpi} in {@code constantPool} to an object.
+     *
+     * The behavior of this method is undefined if {@code cpi} does not denote one of the following
+     * entry types: {@code JVM_CONSTANT_MethodHandle}, {@code JVM_CONSTANT_MethodHandleInError},
+     * {@code JVM_CONSTANT_MethodType} and {@code JVM_CONSTANT_MethodTypeInError}.
+     */
+    native Object resolveConstantInPool(HotSpotConstantPool constantPool, int cpi);
+
+    /**
+     * Resolves the entry at index {@code cpi} in {@code constantPool} to an object, looking in the
+     * constant pool cache first.
+     *
+     * The behavior of this method is undefined if {@code cpi} does not denote a
+     * {@code JVM_CONSTANT_String} entry.
+     */
+    native Object resolvePossiblyCachedConstantInPool(HotSpotConstantPool constantPool, int cpi);
+
+    /**
+     * Gets the {@code JVM_CONSTANT_NameAndType} index from the entry at index {@code cpi} in
+     * {@code constantPool}.
+     *
+     * The behavior of this method is undefined if {@code cpi} does not denote an entry containing a
+     * {@code JVM_CONSTANT_NameAndType} index.
+     */
+    native int lookupNameAndTypeRefIndexInPool(HotSpotConstantPool constantPool, int cpi);
+
+    /**
+     * Gets the name of the {@code JVM_CONSTANT_NameAndType} entry referenced by another entry
+     * denoted by {@code which} in {@code constantPool}.
+     *
+     * The behavior of this method is undefined if {@code which} does not denote a entry that
+     * references a {@code JVM_CONSTANT_NameAndType} entry.
+     */
+    native String lookupNameInPool(HotSpotConstantPool constantPool, int which);
+
+    /**
+     * Gets the signature of the {@code JVM_CONSTANT_NameAndType} entry referenced by another entry
+     * denoted by {@code which} in {@code constantPool}.
+     *
+     * The behavior of this method is undefined if {@code which} does not denote a entry that
+     * references a {@code JVM_CONSTANT_NameAndType} entry.
+     */
+    native String lookupSignatureInPool(HotSpotConstantPool constantPool, int which);
+
+    /**
+     * Gets the {@code JVM_CONSTANT_Class} index from the entry at index {@code cpi} in
+     * {@code constantPool}.
+     *
+     * The behavior of this method is undefined if {@code cpi} does not denote an entry containing a
+     * {@code JVM_CONSTANT_Class} index.
+     */
+    native int lookupKlassRefIndexInPool(HotSpotConstantPool constantPool, int cpi);
+
+    /**
+     * Looks up a class denoted by the {@code JVM_CONSTANT_Class} entry at index {@code cpi} in
+     * {@code constantPool}. This method does not perform any resolution.
+     *
+     * The behavior of this method is undefined if {@code cpi} does not denote a
+     * {@code JVM_CONSTANT_Class} entry.
+     *
+     * @return the resolved class entry or a String otherwise
+     */
+    native Object lookupKlassInPool(HotSpotConstantPool constantPool, int cpi);
+
+    /**
+     * Looks up a method denoted by the entry at index {@code cpi} in {@code constantPool}. This
+     * method does not perform any resolution.
+     *
+     * The behavior of this method is undefined if {@code cpi} does not denote an entry representing
+     * a method.
+     *
+     * @param opcode the opcode of the instruction for which the lookup is being performed or
+     *            {@code -1}. If non-negative, then resolution checks specific to the bytecode it
+     *            denotes are performed if the method is already resolved. Should any of these
+     *            checks fail, 0 is returned.
+     * @return the resolved method entry, 0 otherwise
+     */
+    native HotSpotResolvedJavaMethodImpl lookupMethodInPool(HotSpotConstantPool constantPool, int cpi, byte opcode);
+
+    /**
+     * Ensures that the type referenced by the specified {@code JVM_CONSTANT_InvokeDynamic} entry at
+     * index {@code cpi} in {@code constantPool} is loaded and initialized.
+     *
+     * The behavior of this method is undefined if {@code cpi} does not denote a
+     * {@code JVM_CONSTANT_InvokeDynamic} entry.
+     */
+    native void resolveInvokeDynamicInPool(HotSpotConstantPool constantPool, int cpi);
+
+    /**
+     * If {@code cpi} denotes an entry representing a
+     * <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html#jvms-2.9">signature
+     * polymorphic</a> method, this method ensures that the type referenced by the entry is loaded
+     * and initialized. It {@code cpi} does not denote a signature polymorphic method, this method
+     * does nothing.
+     */
+    native void resolveInvokeHandleInPool(HotSpotConstantPool constantPool, int cpi);
+
+    /**
+     * Gets the list of type names (in the format of {@link JavaType#getName()}) denoting the
+     * classes that define signature polymorphic methods.
+     */
+    native String[] getSignaturePolymorphicHolders();
+
+    /**
+     * Gets the resolved type denoted by the entry at index {@code cpi} in {@code constantPool}.
+     *
+     * The behavior of this method is undefined if {@code cpi} does not denote an entry representing
+     * a class.
+     *
+     * @throws LinkageError if resolution failed
+     */
+    native HotSpotResolvedObjectTypeImpl resolveTypeInPool(HotSpotConstantPool constantPool, int cpi) throws LinkageError;
+
+    /**
+     * Looks up and attempts to resolve the {@code JVM_CONSTANT_Field} entry for at index
+     * {@code cpi} in {@code constantPool}. For some opcodes, checks are performed that require the
+     * {@code method} that contains {@code opcode} to be specified. The values returned in
+     * {@code info} are:
+     *
+     * <pre>
+     *     [ flags,  // fieldDescriptor::access_flags()
+     *       offset, // fieldDescriptor::offset()
+     *       index   // fieldDescriptor::index()
+     *     ]
+     * </pre>
+     *
+     * The behavior of this method is undefined if {@code cpi} does not denote a
+     * {@code JVM_CONSTANT_Field} entry.
+     *
+     * @param info an array in which the details of the field are returned
+     * @return the type defining the field if resolution is successful, 0 otherwise
+     */
+    native HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, int cpi, HotSpotResolvedJavaMethodImpl method, byte opcode, int[] info);
+
+    /**
+     * Converts {@code cpci} from an index into the cache for {@code constantPool} to an index
+     * directly into {@code constantPool}.
+     *
+     * The behavior of this method is undefined if {@code ccpi} is an invalid constant pool cache
+     * index.
+     */
+    native int constantPoolRemapInstructionOperandFromCache(HotSpotConstantPool constantPool, int cpci);
+
+    /**
+     * Gets the appendix object (if any) associated with the entry at index {@code cpi} in
+     * {@code constantPool}.
+     */
+    native Object lookupAppendixInPool(HotSpotConstantPool constantPool, int cpi);
+
+    /**
+     * Installs the result of a compilation into the code cache.
+     *
+     * @param target the target where this code should be installed
+     * @param compiledCode the result of a compilation
+     * @param code the details of the installed CodeBlob are written to this object
+     * @return the outcome of the installation which will be one of
+     *         {@link HotSpotVMConfig#codeInstallResultOk},
+     *         {@link HotSpotVMConfig#codeInstallResultCacheFull},
+     *         {@link HotSpotVMConfig#codeInstallResultCodeTooLarge},
+     *         {@link HotSpotVMConfig#codeInstallResultDependenciesFailed} or
+     *         {@link HotSpotVMConfig#codeInstallResultDependenciesInvalid}.
+     * @throws JVMCIError if there is something wrong with the compiled code or the associated
+     *             metadata.
+     */
+    native int installCode(TargetDescription target, HotSpotCompiledCode compiledCode, InstalledCode code, HotSpotSpeculationLog speculationLog);
+
+    /**
+     * Generates the VM metadata for some compiled code and copies them into {@code metaData}. This
+     * method does not install anything into the code cache.
+     *
+     * @param target the target where this code would be installed
+     * @param compiledCode the result of a compilation
+     * @param metaData the metadata is written to this object
+     * @return the outcome of the installation which will be one of
+     *         {@link HotSpotVMConfig#codeInstallResultOk},
+     *         {@link HotSpotVMConfig#codeInstallResultCacheFull},
+     *         {@link HotSpotVMConfig#codeInstallResultCodeTooLarge},
+     *         {@link HotSpotVMConfig#codeInstallResultDependenciesFailed} or
+     *         {@link HotSpotVMConfig#codeInstallResultDependenciesInvalid}.
+     * @throws JVMCIError if there is something wrong with the compiled code or the metadata
+     */
+    native int getMetadata(TargetDescription target, HotSpotCompiledCode compiledCode, HotSpotMetaData metaData);
+
+    /**
+     * Resets all compilation statistics.
+     */
+    native void resetCompilationStatistics();
+
+    /**
+     * Reads the database of VM info. The return value encodes the info in a nested object array
+     * that is described by the pseudo Java object {@code info} below:
+     *
+     * <pre>
+     *     info = [
+     *         VMField[] vmFields,
+     *         [String name, Long size, ...] vmTypeSizes,
+     *         [String name, Long value, ...] vmConstants,
+     *         [String name, Long value, ...] vmAddresses,
+     *         VMFlag[] vmFlags
+     *         VMIntrinsicMethod[] vmIntrinsics
+     *     ]
+     * </pre>
+     *
+     * @return VM info as encoded above
+     */
+    native Object[] readConfiguration();
+
+    /**
+     * Resolves the implementation of {@code method} for virtual dispatches on objects of dynamic
+     * type {@code exactReceiver}. This resolution process only searches "up" the class hierarchy of
+     * {@code exactReceiver}.
+     *
+     * @param caller the caller or context type used to perform access checks
+     * @return the link-time resolved method (might be abstract) or {@code null} if it is either a
+     *         signature polymorphic method or can not be linked.
+     */
+    native HotSpotResolvedJavaMethodImpl resolveMethod(HotSpotResolvedObjectTypeImpl exactReceiver, HotSpotResolvedJavaMethodImpl method, HotSpotResolvedObjectTypeImpl caller);
+
+    /**
+     * Gets the static initializer of {@code type}.
+     *
+     * @return 0 if {@code type} has no static initializer
+     */
+    native HotSpotResolvedJavaMethodImpl getClassInitializer(HotSpotResolvedObjectTypeImpl type);
+
+    /**
+     * Determines if {@code type} or any of its currently loaded subclasses overrides
+     * {@code Object.finalize()}.
+     */
+    native boolean hasFinalizableSubclass(HotSpotResolvedObjectTypeImpl type);
+
+    /**
+     * Gets the method corresponding to {@code executable}.
+     */
+    native HotSpotResolvedJavaMethodImpl asResolvedJavaMethod(Executable executable);
+
+    /**
+     * Gets the maximum absolute offset of a PC relative call to {@code address} from any position
+     * in the code cache.
+     *
+     * @param address an address that may be called from any code in the code cache
+     * @return -1 if {@code address == 0}
+     */
+    native long getMaxCallTargetOffset(long address);
+
+    /**
+     * Gets a textual disassembly of {@code codeBlob}.
+     *
+     * @return a non-zero length string containing a disassembly of {@code codeBlob} or null if
+     *         {@code codeBlob} could not be disassembled for some reason
+     */
+    // The HotSpot disassembler seems not to be thread safe so it's better to synchronize its usage
+    synchronized native String disassembleCodeBlob(InstalledCode installedCode);
+
+    /**
+     * Gets a stack trace element for {@code method} at bytecode index {@code bci}.
+     */
+    native StackTraceElement getStackTraceElement(HotSpotResolvedJavaMethodImpl method, int bci);
+
+    /**
+     * Executes some {@code installedCode} with arguments {@code args}.
+     *
+     * @return the result of executing {@code installedCode}
+     * @throws InvalidInstalledCodeException if {@code installedCode} has been invalidated
+     */
+    native Object executeInstalledCode(Object[] args, InstalledCode installedCode) throws InvalidInstalledCodeException;
+
+    /**
+     * Gets the line number table for {@code method}. The line number table is encoded as (bci,
+     * source line number) pairs.
+     *
+     * @return the line number table for {@code method} or null if it doesn't have one
+     */
+    native long[] getLineNumberTable(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Gets the number of entries in the local variable table for {@code method}.
+     *
+     * @return the number of entries in the local variable table for {@code method}
+     */
+    native int getLocalVariableTableLength(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Gets the address of the first entry in the local variable table for {@code method}.
+     *
+     * Each entry is a native object described by these fields:
+     *
+     * <ul>
+     * <li>{@link HotSpotVMConfig#localVariableTableElementSize}</li>
+     * <li>{@link HotSpotVMConfig#localVariableTableElementLengthOffset}</li>
+     * <li>{@link HotSpotVMConfig#localVariableTableElementNameCpIndexOffset}</li>
+     * <li>{@link HotSpotVMConfig#localVariableTableElementDescriptorCpIndexOffset}</li>
+     * <li>{@link HotSpotVMConfig#localVariableTableElementSlotOffset}
+     * <li>{@link HotSpotVMConfig#localVariableTableElementStartBciOffset}
+     * </ul>
+     *
+     * @return 0 if {@code method} does not have a local variable table
+     */
+    native long getLocalVariableTableStart(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Determines if {@code method} should not be inlined or compiled.
+     */
+    native void doNotInlineOrCompile(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Invalidates the profiling information for {@code method} and (re)initializes it such that
+     * profiling restarts upon its next invocation.
+     */
+    native void reprofile(HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Invalidates {@code installedCode} such that {@link InvalidInstalledCodeException} will be
+     * raised the next time {@code installedCode} is executed.
+     */
+    native void invalidateInstalledCode(InstalledCode installedCode);
+
+    /**
+     * Collects the current values of all JVMCI benchmark counters, summed up over all threads.
+     */
+    native long[] collectCounters();
+
+    /**
+     * Determines if {@code metaspaceMethodData} is mature.
+     */
+    native boolean isMature(long metaspaceMethodData);
+
+    /**
+     * Generate a unique id to identify the result of the compile.
+     */
+    native int allocateCompileId(HotSpotResolvedJavaMethodImpl method, int entryBCI);
+
+    /**
+     * Determines if {@code method} has OSR compiled code identified by {@code entryBCI} for
+     * compilation level {@code level}.
+     */
+    native boolean hasCompiledCodeForOSR(HotSpotResolvedJavaMethodImpl method, int entryBCI, int level);
+
+    /**
+     * Gets the value of {@code metaspaceSymbol} as a String.
+     */
+    native String getSymbol(long metaspaceSymbol);
+
+    /**
+     * Looks for the next Java stack frame matching an entry in {@code methods}.
+     *
+     * @param frame the starting point of the search, where {@code null} refers to the topmost frame
+     * @param methods the methods to look for, where {@code null} means that any frame is returned
+     * @return the frame, or {@code null} if the end of the stack was reached during the search
+     */
+    native HotSpotStackFrameReference getNextStackFrame(HotSpotStackFrameReference frame, ResolvedJavaMethod[] methods, int initialSkip);
+
+    /**
+     * Materializes all virtual objects within {@code stackFrame} and updates its locals.
+     *
+     * @param invalidate if {@code true}, the compiled method for the stack frame will be
+     *            invalidated
+     */
+    native void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate);
+
+    /**
+     * Gets the v-table index for interface method {@code method} in the receiver {@code type} or
+     * {@link HotSpotVMConfig#invalidVtableIndex} if {@code method} is not in {@code type}'s
+     * v-table.
+     *
+     * @throws InternalError if {@code type} is an interface or {@code method} is not held by an
+     *             interface or class represented by {@code type} is not initialized
+     */
+    native int getVtableIndexForInterfaceMethod(HotSpotResolvedObjectTypeImpl type, HotSpotResolvedJavaMethodImpl method);
+
+    /**
+     * Determines if debug info should also be emitted at non-safepoint locations.
+     */
+    native boolean shouldDebugNonSafepoints();
+
+    /**
+     * Writes {@code length} bytes from {@code bytes} starting at offset {@code offset} to the
+     * HotSpot's log stream.
+     *
+     * @exception NullPointerException if {@code bytes == null}
+     * @exception IndexOutOfBoundsException if copying would cause access of data outside array
+     *                bounds
+     */
+    native void writeDebugOutput(byte[] bytes, int offset, int length);
+
+    /**
+     * Flush HotSpot's log stream.
+     */
+    native void flushDebugOutput();
+
+    /**
+     * Read a HotSpot Method* value from the memory location described by {@code base} plus
+     * {@code displacement} and return the {@link HotSpotResolvedJavaMethodImpl} wrapping it. This
+     * method does no checking that the memory location actually contains a valid pointer and may
+     * crash the VM if an invalid location is provided. If the {@code base} is null then
+     * {@code displacement} is used by itself. If {@code base} is a
+     * {@link HotSpotResolvedJavaMethodImpl}, {@link HotSpotConstantPool} or
+     * {@link HotSpotResolvedObjectTypeImpl} then the metaspace pointer is fetched from that object
+     * and added to {@code displacement}. Any other non-null object type causes an
+     * {@link IllegalArgumentException} to be thrown.
+     *
+     * @param base an object to read from or null
+     * @param displacement
+     * @return null or the resolved method for this location
+     */
+    native HotSpotResolvedJavaMethodImpl getResolvedJavaMethod(Object base, long displacement);
+
+    /**
+     * Gets the {@code ConstantPool*} associated with {@code object} and returns a
+     * {@link HotSpotConstantPool} wrapping it.
+     *
+     * @param object a {@link HotSpotResolvedJavaMethodImpl} or
+     *            {@link HotSpotResolvedObjectTypeImpl} object
+     * @return a {@link HotSpotConstantPool} wrapping the {@code ConstantPool*} associated with
+     *         {@code object}
+     * @throws NullPointerException if {@code object == null}
+     * @throws IllegalArgumentException if {@code object} is neither a
+     *             {@link HotSpotResolvedJavaMethodImpl} nor a {@link HotSpotResolvedObjectTypeImpl}
+     */
+    native HotSpotConstantPool getConstantPool(Object object);
+
+    /**
+     * Read a HotSpot Klass* value from the memory location described by {@code base} plus
+     * {@code displacement} and return the {@link HotSpotResolvedObjectTypeImpl} wrapping it. This
+     * method does no checking that the memory location actually contains a valid pointer and may
+     * crash the VM if an invalid location is provided. If the {@code base} is null then
+     * {@code displacement} is used by itself. If {@code base} is a
+     * {@link HotSpotResolvedJavaMethodImpl}, {@link HotSpotConstantPool} or
+     * {@link HotSpotResolvedObjectTypeImpl} then the metaspace pointer is fetched from that object
+     * and added to {@code displacement}. Any other non-null object type causes an
+     * {@link IllegalArgumentException} to be thrown.
+     *
+     * @param base an object to read from or null
+     * @param displacement
+     * @param compressed true if the location contains a compressed Klass*
+     * @return null or the resolved method for this location
+     */
+    native HotSpotResolvedObjectTypeImpl getResolvedJavaType(Object base, long displacement, boolean compressed);
+
+    /**
+     * Return the size of the HotSpot ProfileData* pointed at by {@code position}. If
+     * {@code position} is outside the space of the MethodData then an
+     * {@link IllegalArgumentException} is thrown. A {@code position} inside the MethodData but that
+     * isn't pointing at a valid ProfileData will crash the VM.
+     *
+     * @param metaspaceMethodData
+     * @param position
+     * @return the size of the ProfileData item pointed at by {@code position}
+     * @throws IllegalArgumentException if an out of range position is given
+     */
+    native int methodDataProfileDataSize(long metaspaceMethodData, int position);
+
+    /**
+     * Gets the fingerprint for a given Klass*
+     *
+     * @param metaspaceKlass
+     * @return the value of the fingerprint (zero for arrays and synthetic classes).
+     */
+    native long getFingerprint(long metaspaceKlass);
+
+    /**
+     * Return the amount of native stack required for the interpreter frames represented by
+     * {@code frame}. This is used when emitting the stack banging code to ensure that there is
+     * enough space for the frames during deoptimization.
+     *
+     * @param frame
+     * @return the number of bytes required for deoptimization of this frame state
+     */
+    native int interpreterFrameSize(BytecodeFrame frame);
+
+    /**
+     * Invokes non-public method {@code java.lang.invoke.LambdaForm.compileToBytecode()} on
+     * {@code lambdaForm} (which must be a {@code java.lang.invoke.LambdaForm} instance).
+     */
+    native void compileToBytecode(Object lambdaForm);
+
+    /**
+     * Gets the value of the VM flag named {@code name}.
+     *
+     * @param name name of a VM option
+     * @return {@code this} if the named VM option doesn't exist, a {@link String} or {@code null}
+     *         if its type is {@code ccstr} or {@code ccstrlist}, a {@link Double} if its type is
+     *         {@code double}, a {@link Boolean} if its type is {@code bool} otherwise a
+     *         {@link Long}
+     */
+    native Object getFlagValue(String name);
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java
new file mode 100644
index 0000000..b77ed14
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import java.util.Map;
+
+import jdk.vm.ci.code.BailoutException;
+import jdk.vm.ci.code.BytecodeFrame;
+import jdk.vm.ci.code.CodeCacheProvider;
+import jdk.vm.ci.code.CompiledCode;
+import jdk.vm.ci.code.InstalledCode;
+import jdk.vm.ci.code.RegisterConfig;
+import jdk.vm.ci.code.TargetDescription;
+import jdk.vm.ci.code.site.Call;
+import jdk.vm.ci.code.site.Mark;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.SpeculationLog;
+
+/**
+ * HotSpot implementation of {@link CodeCacheProvider}.
+ */
+public class HotSpotCodeCacheProvider implements CodeCacheProvider {
+
+    protected final HotSpotJVMCIRuntimeProvider runtime;
+    protected final HotSpotVMConfig config;
+    protected final TargetDescription target;
+    protected final RegisterConfig regConfig;
+
+    public HotSpotCodeCacheProvider(HotSpotJVMCIRuntimeProvider runtime, HotSpotVMConfig config, TargetDescription target, RegisterConfig regConfig) {
+        this.runtime = runtime;
+        this.config = config;
+        this.target = target;
+        this.regConfig = regConfig;
+    }
+
+    @Override
+    public String getMarkName(Mark mark) {
+        int markId = (int) mark.id;
+        HotSpotVMConfigStore store = runtime.getConfigStore();
+        for (Map.Entry<String, Long> e : store.getConstants().entrySet()) {
+            String name = e.getKey();
+            if (name.startsWith("MARKID_") && e.getValue() == markId) {
+                return name;
+            }
+        }
+        return CodeCacheProvider.super.getMarkName(mark);
+    }
+
+    /**
+     * Decodes a call target to a mnemonic if possible.
+     */
+    @Override
+    public String getTargetName(Call call) {
+        if (call.target instanceof HotSpotForeignCallTarget) {
+            long address = ((HotSpotForeignCallTarget) call.target).address;
+            HotSpotVMConfigStore store = runtime.getConfigStore();
+            for (Map.Entry<String, VMField> e : store.getFields().entrySet()) {
+                VMField field = e.getValue();
+                if (field.isStatic() && field.value != null && field.value instanceof Long && ((Long) field.value) == address) {
+                    return e.getValue() + ":0x" + Long.toHexString(address);
+                }
+            }
+        }
+        return CodeCacheProvider.super.getTargetName(call);
+    }
+
+    @Override
+    public RegisterConfig getRegisterConfig() {
+        return regConfig;
+    }
+
+    @Override
+    public int getMinimumOutgoingSize() {
+        return runtime.getConfig().runtimeCallStackSize;
+    }
+
+    private InstalledCode logOrDump(InstalledCode installedCode, CompiledCode compiledCode) {
+        ((HotSpotJVMCIRuntime) runtime).notifyInstall(this, installedCode, compiledCode);
+        return installedCode;
+    }
+
+    public InstalledCode installCode(ResolvedJavaMethod method, CompiledCode compiledCode, InstalledCode installedCode, SpeculationLog log, boolean isDefault) {
+        InstalledCode resultInstalledCode;
+        if (installedCode == null) {
+            if (method == null) {
+                // Must be a stub
+                resultInstalledCode = new HotSpotRuntimeStub(((HotSpotCompiledCode) compiledCode).getName());
+            } else {
+                resultInstalledCode = new HotSpotNmethod((HotSpotResolvedJavaMethod) method, ((HotSpotCompiledCode) compiledCode).getName(), isDefault);
+            }
+        } else {
+            resultInstalledCode = installedCode;
+        }
+
+        HotSpotSpeculationLog speculationLog = (log != null && log.hasSpeculations()) ? (HotSpotSpeculationLog) log : null;
+
+        int result = runtime.getCompilerToVM().installCode(target, (HotSpotCompiledCode) compiledCode, resultInstalledCode, speculationLog);
+        if (result != config.codeInstallResultOk) {
+            String resultDesc = config.getCodeInstallResultDescription(result);
+            if (compiledCode instanceof HotSpotCompiledNmethod) {
+                HotSpotCompiledNmethod compiledNmethod = (HotSpotCompiledNmethod) compiledCode;
+                String msg = compiledNmethod.getInstallationFailureMessage();
+                if (msg != null) {
+                    msg = String.format("Code installation failed: %s%n%s", resultDesc, msg);
+                } else {
+                    msg = String.format("Code installation failed: %s", resultDesc);
+                }
+                if (result == config.codeInstallResultDependenciesInvalid) {
+                    throw new AssertionError(resultDesc + " " + msg);
+                }
+                throw new BailoutException(result != config.codeInstallResultDependenciesFailed, msg);
+            } else {
+                throw new BailoutException("Error installing %s: %s", ((HotSpotCompiledCode) compiledCode).getName(), resultDesc);
+            }
+        }
+        return logOrDump(resultInstalledCode, compiledCode);
+    }
+
+    public void invalidateInstalledCode(InstalledCode installedCode) {
+        runtime.getCompilerToVM().invalidateInstalledCode(installedCode);
+    }
+
+    @Override
+    public TargetDescription getTarget() {
+        return target;
+    }
+
+    public String disassemble(InstalledCode code) {
+        if (code.isValid()) {
+            return runtime.getCompilerToVM().disassembleCodeBlob(code);
+        }
+        return null;
+    }
+
+    public SpeculationLog createSpeculationLog() {
+        return new HotSpotSpeculationLog();
+    }
+
+    public long getMaxCallTargetOffset(long address) {
+        return runtime.getCompilerToVM().getMaxCallTargetOffset(address);
+    }
+
+    public boolean shouldDebugNonSafepoints() {
+        return runtime.getCompilerToVM().shouldDebugNonSafepoints();
+    }
+
+    public int interpreterFrameSize(BytecodeFrame pos) {
+        return runtime.getCompilerToVM().interpreterFrameSize(pos);
+    }
+
+    /**
+     * Resets all compilation statistics.
+     */
+    public void resetCompilationStatistics() {
+        runtime.getCompilerToVM().resetCompilationStatistics();
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequest.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequest.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequest.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequest.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstant.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java
new file mode 100644
index 0000000..d88a846
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java
@@ -0,0 +1,742 @@
+/*
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
+import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
+import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
+import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
+
+import java.lang.invoke.MethodHandle;
+
+import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.meta.ConstantPool;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.JavaField;
+import jdk.vm.ci.meta.JavaMethod;
+import jdk.vm.ci.meta.JavaType;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import jdk.vm.ci.meta.Signature;
+
+/**
+ * Implementation of {@link ConstantPool} for HotSpot.
+ */
+final class HotSpotConstantPool implements ConstantPool, MetaspaceWrapperObject {
+
+    /**
+     * Subset of JVM bytecode opcodes used by {@link HotSpotConstantPool}.
+     */
+    public static class Bytecodes {
+        public static final int LDC = 18; // 0x12
+        public static final int LDC_W = 19; // 0x13
+        public static final int LDC2_W = 20; // 0x14
+        public static final int GETSTATIC = 178; // 0xB2
+        public static final int PUTSTATIC = 179; // 0xB3
+        public static final int GETFIELD = 180; // 0xB4
+        public static final int PUTFIELD = 181; // 0xB5
+        public static final int INVOKEVIRTUAL = 182; // 0xB6
+        public static final int INVOKESPECIAL = 183; // 0xB7
+        public static final int INVOKESTATIC = 184; // 0xB8
+        public static final int INVOKEINTERFACE = 185; // 0xB9
+        public static final int INVOKEDYNAMIC = 186; // 0xBA
+        public static final int NEW = 187; // 0xBB
+        public static final int NEWARRAY = 188; // 0xBC
+        public static final int ANEWARRAY = 189; // 0xBD
+        public static final int CHECKCAST = 192; // 0xC0
+        public static final int INSTANCEOF = 193; // 0xC1
+        public static final int MULTIANEWARRAY = 197; // 0xC5
+
+        static boolean isInvoke(int opcode) {
+            switch (opcode) {
+                case INVOKEVIRTUAL:
+                case INVOKESPECIAL:
+                case INVOKESTATIC:
+                case INVOKEINTERFACE:
+                case INVOKEDYNAMIC:
+                    return true;
+                default:
+                    return false;
+            }
+        }
+
+        /**
+         * See: {@code Rewriter::maybe_rewrite_invokehandle}.
+         */
+        static boolean isInvokeHandleAlias(int opcode) {
+            switch (opcode) {
+                case INVOKEVIRTUAL:
+                case INVOKESPECIAL:
+                    return true;
+                default:
+                    return false;
+            }
+        }
+    }
+
+    /**
+     * Enum of all {@code JVM_CONSTANT} constants used in the VM. This includes the public and
+     * internal ones.
+     */
+    private enum JVM_CONSTANT {
+        // @formatter:off
+        Utf8(config().jvmConstantUtf8),
+        Integer(config().jvmConstantInteger),
+        Long(config().jvmConstantLong),
+        Float(config().jvmConstantFloat),
+        Double(config().jvmConstantDouble),
+        Class(config().jvmConstantClass),
+        UnresolvedClass(config().jvmConstantUnresolvedClass),
+        UnresolvedClassInError(config().jvmConstantUnresolvedClassInError),
+        String(config().jvmConstantString),
+        Fieldref(config().jvmConstantFieldref),
+        MethodRef(config().jvmConstantMethodref),
+        InterfaceMethodref(config().jvmConstantInterfaceMethodref),
+        NameAndType(config().jvmConstantNameAndType),
+        MethodHandle(config().jvmConstantMethodHandle),
+        MethodHandleInError(config().jvmConstantMethodHandleInError),
+        MethodType(config().jvmConstantMethodType),
+        MethodTypeInError(config().jvmConstantMethodTypeInError),
+        InvokeDynamic(config().jvmConstantInvokeDynamic);
+        // @formatter:on
+
+        private final int tag;
+
+        private static final int ExternalMax = config().jvmConstantExternalMax;
+        private static final int InternalMin = config().jvmConstantInternalMin;
+        private static final int InternalMax = config().jvmConstantInternalMax;
+
+        JVM_CONSTANT(int tag) {
+            this.tag = tag;
+        }
+
+        /**
+         * Maps JVM_CONSTANT tags to {@link JVM_CONSTANT} values. Using a separate class for lazy
+         * initialization.
+         */
+        static class TagValueMap {
+            private static final JVM_CONSTANT[] table = new JVM_CONSTANT[ExternalMax + 1 + (InternalMax - InternalMin) + 1];
+
+            static {
+                assert InternalMin > ExternalMax;
+                for (JVM_CONSTANT e : values()) {
+                    table[indexOf(e.tag)] = e;
+                }
+            }
+
+            private static int indexOf(int tag) {
+                if (tag >= InternalMin) {
+                    return tag - InternalMin + ExternalMax + 1;
+                } else {
+                    assert tag <= ExternalMax;
+                }
+                return tag;
+            }
+
+            static JVM_CONSTANT get(int tag) {
+                JVM_CONSTANT res = table[indexOf(tag)];
+                if (res != null) {
+                    return res;
+                }
+                throw new JVMCIError("Unknown JVM_CONSTANT tag %s", tag);
+            }
+        }
+
+        public static JVM_CONSTANT getEnum(int tag) {
+            return TagValueMap.get(tag);
+        }
+    }
+
+    private static class LookupTypeCacheElement {
+        int lastCpi = Integer.MIN_VALUE;
+        JavaType javaType;
+
+        LookupTypeCacheElement(int lastCpi, JavaType javaType) {
+            super();
+            this.lastCpi = lastCpi;
+            this.javaType = javaType;
+        }
+    }
+
+    /**
+     * Reference to the C++ ConstantPool object.
+     */
+    private final long metaspaceConstantPool;
+    private volatile LookupTypeCacheElement lastLookupType;
+
+    /**
+     * Gets the JVMCI mirror from a HotSpot constant pool.The VM is responsible for ensuring that
+     * the ConstantPool is kept alive for the duration of this call and the
+     * {@link HotSpotJVMCIMetaAccessContext} keeps it alive after that.
+     *
+     * Called from the VM.
+     *
+     * @param metaspaceConstantPool a metaspace ConstantPool object
+     * @return the {@link HotSpotConstantPool} corresponding to {@code metaspaceConstantPool}
+     */
+    @SuppressWarnings("unused")
+    private static HotSpotConstantPool fromMetaspace(long metaspaceConstantPool) {
+        HotSpotConstantPool cp = new HotSpotConstantPool(metaspaceConstantPool);
+        runtime().metaAccessContext.add(cp);
+        return cp;
+    }
+
+    private HotSpotConstantPool(long metaspaceConstantPool) {
+        this.metaspaceConstantPool = metaspaceConstantPool;
+    }
+
+    /**
+     * Gets the holder for this constant pool as {@link HotSpotResolvedObjectTypeImpl}.
+     *
+     * @return holder for this constant pool
+     */
+    private HotSpotResolvedObjectType getHolder() {
+        return compilerToVM().getResolvedJavaType(this, config().constantPoolHolderOffset, false);
+    }
+
+    /**
+     * Converts a raw index from the bytecodes to a constant pool index by adding a
+     * {@link HotSpotVMConfig#constantPoolCpCacheIndexTag constant}.
+     *
+     * @param rawIndex index from the bytecode
+     * @param opcode bytecode to convert the index for
+     * @return constant pool index
+     */
+    private static int rawIndexToConstantPoolIndex(int rawIndex, int opcode) {
+        int index;
+        if (opcode == Bytecodes.INVOKEDYNAMIC) {
+            index = rawIndex;
+            // See: ConstantPool::is_invokedynamic_index
+            assert index < 0 : "not an invokedynamic constant pool index " + index;
+        } else {
+            assert opcode == Bytecodes.GETFIELD || opcode == Bytecodes.PUTFIELD || opcode == Bytecodes.GETSTATIC || opcode == Bytecodes.PUTSTATIC || opcode == Bytecodes.INVOKEINTERFACE ||
+                            opcode == Bytecodes.INVOKEVIRTUAL || opcode == Bytecodes.INVOKESPECIAL || opcode == Bytecodes.INVOKESTATIC : "unexpected invoke opcode " + opcode;
+            index = rawIndex + config().constantPoolCpCacheIndexTag;
+        }
+        return index;
+    }
+
+    /**
+     * Decode a constant pool cache index to a constant pool index.
+     *
+     * See {@code ConstantPool::decode_cpcache_index}.
+     *
+     * @param index constant pool cache index
+     * @return decoded index
+     */
+    private static int decodeConstantPoolCacheIndex(int index) {
+        if (isInvokedynamicIndex(index)) {
+            return decodeInvokedynamicIndex(index);
+        } else {
+            return index - config().constantPoolCpCacheIndexTag;
+        }
+    }
+
+    /**
+     * See {@code ConstantPool::is_invokedynamic_index}.
+     */
+    private static boolean isInvokedynamicIndex(int index) {
+        return index < 0;
+    }
+
+    /**
+     * See {@code ConstantPool::decode_invokedynamic_index}.
+     */
+    private static int decodeInvokedynamicIndex(int i) {
+        assert isInvokedynamicIndex(i) : i;
+        return ~i;
+    }
+
+    long getMetaspaceConstantPool() {
+        return metaspaceConstantPool;
+    }
+
+    public long getMetaspacePointer() {
+        return getMetaspaceConstantPool();
+    }
+
+    /**
+     * Gets the constant pool tag at index {@code index}.
+     *
+     * @param index constant pool index
+     * @return constant pool tag
+     */
+    private JVM_CONSTANT getTagAt(int index) {
+        assert checkBounds(index);
+        HotSpotVMConfig config = config();
+        final long metaspaceConstantPoolTags = UNSAFE.getAddress(getMetaspaceConstantPool() + config.constantPoolTagsOffset);
+        final int tag = UNSAFE.getByteVolatile(null, metaspaceConstantPoolTags + config.arrayU1DataOffset + index);
+        if (tag == 0) {
+            return null;
+        }
+        return JVM_CONSTANT.getEnum(tag);
+    }
+
+    /**
+     * Gets the constant pool entry at index {@code index}.
+     *
+     * @param index constant pool index
+     * @return constant pool entry
+     */
+    long getEntryAt(int index) {
+        assert checkBounds(index);
+        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
+        return UNSAFE.getAddress(getMetaspaceConstantPool() + config().constantPoolSize + offset);
+    }
+
+    /**
+     * Gets the integer constant pool entry at index {@code index}.
+     *
+     * @param index constant pool index
+     * @return integer constant pool entry at index
+     */
+    private int getIntAt(int index) {
+        assert checkTag(index, JVM_CONSTANT.Integer);
+        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
+        return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + offset);
+    }
+
+    /**
+     * Gets the long constant pool entry at index {@code index}.
+     *
+     * @param index constant pool index
+     * @return long constant pool entry
+     */
+    private long getLongAt(int index) {
+        assert checkTag(index, JVM_CONSTANT.Long);
+        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
+        return UNSAFE.getLong(getMetaspaceConstantPool() + config().constantPoolSize + offset);
+    }
+
+    /**
+     * Gets the float constant pool entry at index {@code index}.
+     *
+     * @param index constant pool index
+     * @return float constant pool entry
+     */
+    private float getFloatAt(int index) {
+        assert checkTag(index, JVM_CONSTANT.Float);
+        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
+        return UNSAFE.getFloat(getMetaspaceConstantPool() + config().constantPoolSize + offset);
+    }
+
+    /**
+     * Gets the double constant pool entry at index {@code index}.
+     *
+     * @param index constant pool index
+     * @return float constant pool entry
+     */
+    private double getDoubleAt(int index) {
+        assert checkTag(index, JVM_CONSTANT.Double);
+        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
+        return UNSAFE.getDouble(getMetaspaceConstantPool() + config().constantPoolSize + offset);
+    }
+
+    /**
+     * Gets the {@code JVM_CONSTANT_NameAndType} constant pool entry at index {@code index}.
+     *
+     * @param index constant pool index
+     * @return {@code JVM_CONSTANT_NameAndType} constant pool entry
+     */
+    private int getNameAndTypeAt(int index) {
+        assert checkTag(index, JVM_CONSTANT.NameAndType);
+        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
+        return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + offset);
+    }
+
+    /**
+     * Gets the {@code JVM_CONSTANT_NameAndType} reference index constant pool entry at index
+     * {@code index}.
+     *
+     * @param index constant pool index
+     * @return {@code JVM_CONSTANT_NameAndType} reference constant pool entry
+     */
+    private int getNameAndTypeRefIndexAt(int index) {
+        return compilerToVM().lookupNameAndTypeRefIndexInPool(this, index);
+    }
+
+    /**
+     * Gets the name of a {@code JVM_CONSTANT_NameAndType} constant pool entry referenced by another
+     * entry denoted by {@code which}.
+     *
+     * @param which constant pool index or constant pool cache index
+     * @return name as {@link String}
+     */
+    private String getNameOf(int which) {
+        return compilerToVM().lookupNameInPool(this, which);
+    }
+
+    /**
+     * Gets the name reference index of a {@code JVM_CONSTANT_NameAndType} constant pool entry at
+     * index {@code index}.
+     *
+     * @param index constant pool index
+     * @return name reference index
+     */
+    private int getNameRefIndexAt(int index) {
+        final int refIndex = getNameAndTypeAt(index);
+        // name ref index is in the low 16-bits.
+        return refIndex & 0xFFFF;
+    }
+
+    /**
+     * Gets the signature of a {@code JVM_CONSTANT_NameAndType} constant pool entry referenced by
+     * another entry denoted by {@code which}.
+     *
+     * @param which constant pool index or constant pool cache index
+     * @return signature as {@link String}
+     */
+    private String getSignatureOf(int which) {
+        return compilerToVM().lookupSignatureInPool(this, which);
+    }
+
+    /**
+     * Gets the signature reference index of a {@code JVM_CONSTANT_NameAndType} constant pool entry
+     * at index {@code index}.
+     *
+     * @param index constant pool index
+     * @return signature reference index
+     */
+    private int getSignatureRefIndexAt(int index) {
+        final int refIndex = getNameAndTypeAt(index);
+        // signature ref index is in the high 16-bits.
+        return refIndex >>> 16;
+    }
+
+    /**
+     * Gets the klass reference index constant pool entry at index {@code index}.
+     *
+     * @param index constant pool index
+     * @return klass reference index
+     */
+    private int getKlassRefIndexAt(int index) {
+        return compilerToVM().lookupKlassRefIndexInPool(this, index);
+    }
+
+    /**
+     * Gets the uncached klass reference index constant pool entry at index {@code index}. See:
+     * {@code ConstantPool::uncached_klass_ref_index_at}.
+     *
+     * @param index constant pool index
+     * @return klass reference index
+     */
+    private int getUncachedKlassRefIndexAt(int index) {
+        assert checkTagIsFieldOrMethod(index);
+        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
+        final int refIndex = UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + offset);
+        // klass ref index is in the low 16-bits.
+        return refIndex & 0xFFFF;
+    }
+
+    /**
+     * Checks that the constant pool index {@code index} is in the bounds of the constant pool.
+     *
+     * @param index constant pool index
+     * @throws AssertionError if the check fails
+     */
+    private boolean checkBounds(int index) {
+        assert 0 <= index && index < length() : "index " + index + " not between 0 and " + length();
+        return true;
+    }
+
+    /**
+     * Checks that the constant pool tag at index {@code index} is equal to {@code tag}.
+     *
+     * @param index constant pool index
+     * @param tag expected tag
+     * @throws AssertionError if the check fails
+     */
+    private boolean checkTag(int index, JVM_CONSTANT tag) {
+        final JVM_CONSTANT tagAt = getTagAt(index);
+        assert tagAt == tag : "constant pool tag at index " + index + " is " + tagAt + " but expected " + tag;
+        return true;
+    }
+
+    /**
+     * Asserts that the constant pool tag at index {@code index} is a {@link JVM_CONSTANT#Fieldref},
+     * or a {@link JVM_CONSTANT#MethodRef}, or a {@link JVM_CONSTANT#InterfaceMethodref}.
+     *
+     * @param index constant pool index
+     * @throws AssertionError if the check fails
+     */
+    private boolean checkTagIsFieldOrMethod(int index) {
+        final JVM_CONSTANT tagAt = getTagAt(index);
+        assert tagAt == JVM_CONSTANT.Fieldref || tagAt == JVM_CONSTANT.MethodRef || tagAt == JVM_CONSTANT.InterfaceMethodref : tagAt;
+        return true;
+    }
+
+    @Override
+    public int length() {
+        return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolLengthOffset);
+    }
+
+    @Override
+    public Object lookupConstant(int cpi) {
+        assert cpi != 0;
+        final JVM_CONSTANT tag = getTagAt(cpi);
+        switch (tag) {
+            case Integer:
+                return JavaConstant.forInt(getIntAt(cpi));
+            case Long:
+                return JavaConstant.forLong(getLongAt(cpi));
+            case Float:
+                return JavaConstant.forFloat(getFloatAt(cpi));
+            case Double:
+                return JavaConstant.forDouble(getDoubleAt(cpi));
+            case Class:
+            case UnresolvedClass:
+            case UnresolvedClassInError:
+                final int opcode = -1;  // opcode is not used
+                return lookupType(cpi, opcode);
+            case String:
+                /*
+                 * Normally, we would expect a String here, but anonymous classes can have
+                 * "pseudo strings" (arbitrary live objects) patched into a String entry. Such
+                 * entries do not have a symbol in the constant pool slot.
+                 */
+                Object string = compilerToVM().resolvePossiblyCachedConstantInPool(this, cpi);
+                return HotSpotObjectConstantImpl.forObject(string);
+            case MethodHandle:
+            case MethodHandleInError:
+            case MethodType:
+            case MethodTypeInError:
+                Object obj = compilerToVM().resolveConstantInPool(this, cpi);
+                return HotSpotObjectConstantImpl.forObject(obj);
+            default:
+                throw new JVMCIError("Unknown constant pool tag %s", tag);
+        }
+    }
+
+    @Override
+    public String lookupUtf8(int cpi) {
+        assert checkTag(cpi, JVM_CONSTANT.Utf8);
+        return compilerToVM().getSymbol(getEntryAt(cpi));
+    }
+
+    @Override
+    public Signature lookupSignature(int cpi) {
+        return new HotSpotSignature(runtime(), lookupUtf8(cpi));
+    }
+
+    @Override
+    public JavaConstant lookupAppendix(int cpi, int opcode) {
+        assert Bytecodes.isInvoke(opcode);
+        final int index = rawIndexToConstantPoolIndex(cpi, opcode);
+        Object appendix = compilerToVM().lookupAppendixInPool(this, index);
+        if (appendix == null) {
+            return null;
+        } else {
+            return HotSpotObjectConstantImpl.forObject(appendix);
+        }
+    }
+
+    /**
+     * Gets a {@link JavaType} corresponding a given resolved or unresolved type.
+     *
+     * @param type either a ResolvedJavaType or a String naming a unresolved type.
+     */
+    private static JavaType getJavaType(final Object type) {
+        if (type instanceof String) {
+            String name = (String) type;
+            return HotSpotUnresolvedJavaType.create(runtime(), "L" + name + ";");
+        } else {
+            return (JavaType) type;
+        }
+    }
+
+    @Override
+    public JavaMethod lookupMethod(int cpi, int opcode) {
+        final int index = rawIndexToConstantPoolIndex(cpi, opcode);
+        final HotSpotResolvedJavaMethod method = compilerToVM().lookupMethodInPool(this, index, (byte) opcode);
+        if (method != null) {
+            return method;
+        } else {
+            // Get the method's name and signature.
+            String name = getNameOf(index);
+            HotSpotSignature signature = new HotSpotSignature(runtime(), getSignatureOf(index));
+            if (opcode == Bytecodes.INVOKEDYNAMIC) {
+                HotSpotResolvedObjectType holder = HotSpotResolvedObjectTypeImpl.fromObjectClass(MethodHandle.class);
+                return new HotSpotMethodUnresolved(name, signature, holder);
+            } else {
+                final int klassIndex = getKlassRefIndexAt(index);
+                final Object type = compilerToVM().lookupKlassInPool(this, klassIndex);
+                JavaType holder = getJavaType(type);
+                return new HotSpotMethodUnresolved(name, signature, holder);
+            }
+        }
+    }
+
+    @Override
+    public JavaType lookupType(int cpi, int opcode) {
+        final LookupTypeCacheElement elem = this.lastLookupType;
+        if (elem != null && elem.lastCpi == cpi) {
+            return elem.javaType;
+        } else {
+            final Object type = compilerToVM().lookupKlassInPool(this, cpi);
+            JavaType result = getJavaType(type);
+            if (result instanceof ResolvedJavaType) {
+                this.lastLookupType = new LookupTypeCacheElement(cpi, result);
+            }
+            return result;
+        }
+    }
+
+    @Override
+    public JavaField lookupField(int cpi, ResolvedJavaMethod method, int opcode) {
+        final int index = rawIndexToConstantPoolIndex(cpi, opcode);
+        final int nameAndTypeIndex = getNameAndTypeRefIndexAt(index);
+        final int typeIndex = getSignatureRefIndexAt(nameAndTypeIndex);
+        String typeName = lookupUtf8(typeIndex);
+        JavaType type = runtime().lookupType(typeName, getHolder(), false);
+
+        final int holderIndex = getKlassRefIndexAt(index);
+        JavaType holder = lookupType(holderIndex, opcode);
+
+        if (holder instanceof HotSpotResolvedObjectTypeImpl) {
+            int[] info = new int[3];
+            HotSpotResolvedObjectTypeImpl resolvedHolder;
+            try {
+                resolvedHolder = compilerToVM().resolveFieldInPool(this, index, (HotSpotResolvedJavaMethodImpl) method, (byte) opcode, info);
+            } catch (Throwable t) {
+                /*
+                 * If there was an exception resolving the field we give up and return an unresolved
+                 * field.
+                 */
+                return new HotSpotUnresolvedField(holder, lookupUtf8(getNameRefIndexAt(nameAndTypeIndex)), type);
+            }
+            final int flags = info[0];
+            final int offset = info[1];
+            final int fieldIndex = info[2];
+            HotSpotResolvedJavaField result = resolvedHolder.createField(type, offset, flags, fieldIndex);
+            return result;
+        } else {
+            return new HotSpotUnresolvedField(holder, lookupUtf8(getNameRefIndexAt(nameAndTypeIndex)), type);
+        }
+    }
+
+    @Override
+    @SuppressWarnings("fallthrough")
+    public void loadReferencedType(int cpi, int opcode) {
+        int index;
+        switch (opcode) {
+            case Bytecodes.CHECKCAST:
+            case Bytecodes.INSTANCEOF:
+            case Bytecodes.NEW:
+            case Bytecodes.ANEWARRAY:
+            case Bytecodes.MULTIANEWARRAY:
+            case Bytecodes.LDC:
+            case Bytecodes.LDC_W:
+            case Bytecodes.LDC2_W:
+                index = cpi;
+                break;
+            case Bytecodes.INVOKEDYNAMIC: {
+                // invokedynamic instructions point to a constant pool cache entry.
+                index = decodeConstantPoolCacheIndex(cpi) + config().constantPoolCpCacheIndexTag;
+                index = compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index);
+                break;
+            }
+            case Bytecodes.GETSTATIC:
+            case Bytecodes.PUTSTATIC:
+            case Bytecodes.GETFIELD:
+            case Bytecodes.PUTFIELD:
+            case Bytecodes.INVOKEVIRTUAL:
+            case Bytecodes.INVOKESPECIAL:
+            case Bytecodes.INVOKESTATIC:
+            case Bytecodes.INVOKEINTERFACE: {
+                // invoke and field instructions point to a constant pool cache entry.
+                index = rawIndexToConstantPoolIndex(cpi, opcode);
+                index = compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index);
+                break;
+            }
+            default:
+                throw JVMCIError.shouldNotReachHere("Unexpected opcode " + opcode);
+        }
+
+        final JVM_CONSTANT tag = getTagAt(index);
+        if (tag == null) {
+            assert getTagAt(index - 1) == JVM_CONSTANT.Double || getTagAt(index - 1) == JVM_CONSTANT.Long;
+            return;
+        }
+        switch (tag) {
+            case MethodRef:
+            case Fieldref:
+            case InterfaceMethodref:
+                index = getUncachedKlassRefIndexAt(index);
+                // Read the tag only once because it could change between multiple reads.
+                final JVM_CONSTANT klassTag = getTagAt(index);
+                assert klassTag == JVM_CONSTANT.Class || klassTag == JVM_CONSTANT.UnresolvedClass || klassTag == JVM_CONSTANT.UnresolvedClassInError : klassTag;
+                // fall through
+            case Class:
+            case UnresolvedClass:
+            case UnresolvedClassInError:
+                final HotSpotResolvedObjectTypeImpl type = compilerToVM().resolveTypeInPool(this, index);
+                Class<?> klass = type.mirror();
+                if (!klass.isPrimitive() && !klass.isArray()) {
+                    UNSAFE.ensureClassInitialized(klass);
+                }
+                if (tag == JVM_CONSTANT.MethodRef) {
+                    if (Bytecodes.isInvokeHandleAlias(opcode) && isSignaturePolymorphicHolder(type)) {
+                        final int methodRefCacheIndex = rawIndexToConstantPoolIndex(cpi, opcode);
+                        assert checkTag(compilerToVM().constantPoolRemapInstructionOperandFromCache(this, methodRefCacheIndex), JVM_CONSTANT.MethodRef);
+                        compilerToVM().resolveInvokeHandleInPool(this, methodRefCacheIndex);
+                    }
+                }
+
+                break;
+            case InvokeDynamic:
+                if (isInvokedynamicIndex(cpi)) {
+                    compilerToVM().resolveInvokeDynamicInPool(this, cpi);
+                }
+                break;
+            default:
+                // nothing
+                break;
+        }
+
+    }
+
+    // Lazily initialized.
+    private static String[] signaturePolymorphicHolders;
+
+    /**
+     * Determines if {@code type} contains signature polymorphic methods.
+     */
+    static boolean isSignaturePolymorphicHolder(final ResolvedJavaType type) {
+        String name = type.getName();
+        if (signaturePolymorphicHolders == null) {
+            signaturePolymorphicHolders = compilerToVM().getSignaturePolymorphicHolders();
+        }
+        for (String holder : signaturePolymorphicHolders) {
+            if (name.equals(holder)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        HotSpotResolvedObjectType holder = getHolder();
+        return "HotSpotConstantPool<" + holder.toJavaName() + ">";
+    }
+}
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java
new file mode 100644
index 0000000..1256cf0
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import java.lang.reflect.Array;
+import java.util.Objects;
+
+import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.meta.Constant;
+import jdk.vm.ci.meta.ConstantReflectionProvider;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.MemoryAccessProvider;
+import jdk.vm.ci.meta.MethodHandleAccessProvider;
+import jdk.vm.ci.meta.ResolvedJavaField;
+import jdk.vm.ci.meta.ResolvedJavaType;
+
+/**
+ * HotSpot implementation of {@link ConstantReflectionProvider}.
+ */
+public class HotSpotConstantReflectionProvider implements ConstantReflectionProvider {
+
+    protected final HotSpotJVMCIRuntimeProvider runtime;
+    protected final HotSpotMethodHandleAccessProvider methodHandleAccess;
+    protected final HotSpotMemoryAccessProviderImpl memoryAccess;
+
+    public HotSpotConstantReflectionProvider(HotSpotJVMCIRuntimeProvider runtime) {
+        this.runtime = runtime;
+        this.methodHandleAccess = new HotSpotMethodHandleAccessProvider(this);
+        this.memoryAccess = new HotSpotMemoryAccessProviderImpl(runtime);
+    }
+
+    public MethodHandleAccessProvider getMethodHandleAccess() {
+        return methodHandleAccess;
+    }
+
+    @Override
+    public MemoryAccessProvider getMemoryAccessProvider() {
+        return memoryAccess;
+    }
+
+    @Override
+    public Boolean constantEquals(Constant x, Constant y) {
+        if (x == y) {
+            return true;
+        } else if (x instanceof HotSpotObjectConstantImpl) {
+            return y instanceof HotSpotObjectConstantImpl && ((HotSpotObjectConstantImpl) x).object() == ((HotSpotObjectConstantImpl) y).object();
+        } else {
+            return Objects.equals(x, y);
+        }
+    }
+
+    @Override
+    public Integer readArrayLength(JavaConstant array) {
+        if (array == null || array.getJavaKind() != JavaKind.Object || array.isNull()) {
+            return null;
+        }
+
+        Object arrayObject = ((HotSpotObjectConstantImpl) array).object();
+        if (!arrayObject.getClass().isArray()) {
+            return null;
+        }
+        return Array.getLength(arrayObject);
+    }
+
+    @Override
+    public JavaConstant readArrayElement(JavaConstant array, int index) {
+        if (array == null || array.getJavaKind() != JavaKind.Object || array.isNull()) {
+            return null;
+        }
+        Object a = ((HotSpotObjectConstantImpl) array).object();
+
+        if (!a.getClass().isArray() || index < 0 || index >= Array.getLength(a)) {
+            return null;
+        }
+
+        if (a instanceof Object[]) {
+            Object element = ((Object[]) a)[index];
+            return HotSpotObjectConstantImpl.forObject(element);
+        } else {
+            return JavaConstant.forBoxedPrimitive(Array.get(a, index));
+        }
+    }
+
+    /**
+     * Check if the constant is a boxed value that is guaranteed to be cached by the platform.
+     * Otherwise the generated code might be the only reference to the boxed value and since object
+     * references from nmethods are weak this can cause GC problems.
+     *
+     * @param source
+     * @return true if the box is cached
+     */
+    private static boolean isBoxCached(JavaConstant source) {
+        switch (source.getJavaKind()) {
+            case Boolean:
+                return true;
+            case Char:
+                return source.asInt() <= 127;
+            case Byte:
+            case Short:
+            case Int:
+                return source.asInt() >= -128 && source.asInt() <= 127;
+            case Long:
+                return source.asLong() >= -128 && source.asLong() <= 127;
+            case Float:
+            case Double:
+                return false;
+            default:
+                throw new IllegalArgumentException("unexpected kind " + source.getJavaKind());
+        }
+    }
+
+    @Override
+    public JavaConstant boxPrimitive(JavaConstant source) {
+        if (source == null || !source.getJavaKind().isPrimitive() || !isBoxCached(source)) {
+            return null;
+        }
+        return HotSpotObjectConstantImpl.forObject(source.asBoxedPrimitive());
+    }
+
+    @Override
+    public JavaConstant unboxPrimitive(JavaConstant source) {
+        if (source == null || !source.getJavaKind().isObject()) {
+            return null;
+        }
+        if (source.isNull()) {
+            return null;
+        }
+        return JavaConstant.forBoxedPrimitive(((HotSpotObjectConstantImpl) source).object());
+    }
+
+    public JavaConstant forString(String value) {
+        return HotSpotObjectConstantImpl.forObject(value);
+    }
+
+    public JavaConstant forObject(Object value) {
+        return HotSpotObjectConstantImpl.forObject(value);
+    }
+
+    @Override
+    public ResolvedJavaType asJavaType(Constant constant) {
+        if (constant instanceof HotSpotObjectConstant) {
+            Object obj = ((HotSpotObjectConstantImpl) constant).object();
+            if (obj instanceof Class) {
+                return runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType((Class<?>) obj);
+            }
+        }
+        if (constant instanceof HotSpotMetaspaceConstant) {
+            MetaspaceWrapperObject obj = HotSpotMetaspaceConstantImpl.getMetaspaceObject(constant);
+            if (obj instanceof HotSpotResolvedObjectTypeImpl) {
+                return (ResolvedJavaType) obj;
+            }
+        }
+        return null;
+    }
+
+    public JavaConstant readFieldValue(ResolvedJavaField field, JavaConstant receiver) {
+        HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field;
+        if (hotspotField.isStatic()) {
+            HotSpotResolvedJavaType holder = (HotSpotResolvedJavaType) hotspotField.getDeclaringClass();
+            if (holder.isInitialized()) {
+                return memoryAccess.readFieldValue(hotspotField, holder.mirror());
+            }
+        } else {
+            if (receiver.isNonNull()) {
+                Object object = ((HotSpotObjectConstantImpl) receiver).object();
+                if (hotspotField.isInObject(object)) {
+                    return memoryAccess.readFieldValue(hotspotField, object);
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public JavaConstant asJavaClass(ResolvedJavaType type) {
+        return HotSpotObjectConstantImpl.forObject(((HotSpotResolvedJavaType) type).mirror());
+    }
+
+    @Override
+    public Constant asObjectHub(ResolvedJavaType type) {
+        if (type instanceof HotSpotResolvedObjectType) {
+            return ((HotSpotResolvedObjectType) type).klass();
+        } else {
+            throw JVMCIError.unimplemented();
+        }
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotForeignCallTarget.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotForeignCallTarget.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotForeignCallTarget.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotForeignCallTarget.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotInstalledCode.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotInstalledCode.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotInstalledCode.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotInstalledCode.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java
new file mode 100644
index 0000000..cf5ef10
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
+import java.util.Arrays;
+import java.util.Iterator;
+
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.ResolvedJavaType;
+
+/**
+ * This class manages the set of metadata roots that must be scanned during garbage collection.
+ * Because of class redefinition Method* and ConstantPool* can be freed if they don't appear to be
+ * in use so they must be tracked when there are live references to them from Java.
+ *
+ * The general theory of operation is that all {@link MetaspaceWrapperObject}s are created by
+ * calling into the VM which calls back out to actually create the wrapper instance. During the call
+ * the VM keeps the metadata reference alive through the use of metadata handles. Once the call
+ * completes the wrapper object is registered here and will be scanned during metadata scanning. The
+ * weakness of the reference to the wrapper object allows them to be reclaimed when they are no
+ * longer used.
+ *
+ */
+public class HotSpotJVMCIMetaAccessContext {
+
+    /**
+     * The set of currently live contexts used for tracking of live metadata. Examined from the VM
+     * during garbage collection.
+     */
+    private static WeakReference<?>[] allContexts = new WeakReference<?>[0];
+
+    /**
+     * This is a chunked list of metadata roots. It can be read from VM native code so it's been
+     * marked volatile to ensure the order of updates are respected.
+     */
+    private volatile Object[] metadataRoots;
+
+    private ChunkedList<WeakReference<MetaspaceWrapperObject>> list = new ChunkedList<>();
+
+    /**
+     * The number of weak references freed since the last time the list was shrunk.
+     */
+    private int freed;
+
+    /**
+     * The {@link ReferenceQueue} tracking the weak references created by this context.
+     */
+    private final ReferenceQueue<MetaspaceWrapperObject> queue = new ReferenceQueue<>();
+
+    static synchronized void add(HotSpotJVMCIMetaAccessContext context) {
+        for (int i = 0; i < allContexts.length; i++) {
+            if (allContexts[i] == null || allContexts[i].get() == null) {
+                allContexts[i] = new WeakReference<>(context);
+                return;
+            }
+        }
+        int index = allContexts.length;
+        allContexts = Arrays.copyOf(allContexts, index + 2);
+        allContexts[index] = new WeakReference<>(context);
+    }
+
+    HotSpotJVMCIMetaAccessContext() {
+        add(this);
+    }
+
+    /**
+     * Periodically trim the list of tracked metadata. A new list is created to replace the old to
+     * avoid concurrent scanning issues.
+     */
+    private void clean() {
+        Reference<?> ref = queue.poll();
+        if (ref == null) {
+            return;
+        }
+        while (ref != null) {
+            freed++;
+            ref = queue.poll();
+        }
+        if (freed > list.size() / 2) {
+            ChunkedList<WeakReference<MetaspaceWrapperObject>> newList = new ChunkedList<>();
+            for (WeakReference<MetaspaceWrapperObject> element : list) {
+                /*
+                 * The referent could become null anywhere in here but it doesn't matter. It will
+                 * get cleaned up next time.
+                 */
+                if (element != null && element.get() != null) {
+                    newList.add(element);
+                }
+            }
+            list = newList;
+            metadataRoots = list.getHead();
+            freed = 0;
+        }
+    }
+
+    /**
+     * Add a {@link MetaspaceWrapperObject} to tracked by the GC. It's assumed that the caller is
+     * responsible for keeping the reference alive for the duration of the call. Once registration
+     * is complete then the VM will ensure it's kept alive.
+     *
+     * @param metaspaceObject
+     */
+
+    public synchronized void add(MetaspaceWrapperObject metaspaceObject) {
+        clean();
+        list.add(new WeakReference<>(metaspaceObject, queue));
+        if (list.getHead() != metadataRoots) {
+            /*
+             * The list enlarged so update the head.
+             */
+            metadataRoots = list.getHead();
+        }
+        assert isRegistered(metaspaceObject);
+    }
+
+    protected ResolvedJavaType createClass(Class<?> javaClass) {
+        if (javaClass.isPrimitive()) {
+            JavaKind kind = JavaKind.fromJavaClass(javaClass);
+            return new HotSpotResolvedPrimitiveType(kind);
+        } else {
+            return new HotSpotResolvedObjectTypeImpl(javaClass, this);
+        }
+    }
+
+    private final ClassValue<WeakReference<ResolvedJavaType>> resolvedJavaType = new ClassValue<WeakReference<ResolvedJavaType>>() {
+        @Override
+        protected WeakReference<ResolvedJavaType> computeValue(Class<?> type) {
+            return new WeakReference<>(createClass(type));
+        }
+    };
+
+    /**
+     * Gets the JVMCI mirror for a {@link Class} object.
+     *
+     * @return the {@link ResolvedJavaType} corresponding to {@code javaClass}
+     */
+    public ResolvedJavaType fromClass(Class<?> javaClass) {
+        ResolvedJavaType javaType = null;
+        while (javaType == null) {
+            WeakReference<ResolvedJavaType> type = resolvedJavaType.get(javaClass);
+            javaType = type.get();
+            if (javaType == null) {
+                /*
+                 * If the referent has become null, clear out the current value
+                 * and let computeValue above create a new value.  Reload the
+                 * value in a loop because in theory the WeakReference referent
+                 * can be reclaimed at any point.
+                 */
+                resolvedJavaType.remove(javaClass);
+            }
+        }
+        return javaType;
+    }
+
+    /**
+     * A very simple append only chunked list implementation.
+     */
+    static class ChunkedList<T> implements Iterable<T> {
+        private static final int CHUNK_SIZE = 32;
+
+        private static final int NEXT_CHUNK_INDEX = CHUNK_SIZE - 1;
+
+        private Object[] head;
+        private int index;
+        private int size;
+
+        ChunkedList() {
+            head = new Object[CHUNK_SIZE];
+            index = 0;
+        }
+
+        void add(T element) {
+            if (index == NEXT_CHUNK_INDEX) {
+                Object[] newHead = new Object[CHUNK_SIZE];
+                newHead[index] = head;
+                head = newHead;
+                index = 0;
+            }
+            head[index++] = element;
+            size++;
+        }
+
+        Object[] getHead() {
+            return head;
+        }
+
+        public Iterator<T> iterator() {
+            return new ChunkIterator<>();
+        }
+
+        int size() {
+            return size;
+        }
+
+        class ChunkIterator<V> implements Iterator<V> {
+
+            ChunkIterator() {
+                currentChunk = head;
+                currentIndex = -1;
+                next = findNext();
+            }
+
+            Object[] currentChunk;
+            int currentIndex;
+            V next;
+
+            @SuppressWarnings("unchecked")
+            V findNext() {
+                V result;
+                do {
+                    currentIndex++;
+                    if (currentIndex == NEXT_CHUNK_INDEX) {
+                        currentChunk = (Object[]) currentChunk[currentIndex];
+                        currentIndex = 0;
+                        if (currentChunk == null) {
+                            return null;
+                        }
+                    }
+                    result = (V) currentChunk[currentIndex];
+                } while (result == null);
+                return result;
+            }
+
+            public boolean hasNext() {
+                return next != null;
+            }
+
+            public V next() {
+                V result = next;
+                next = findNext();
+                return result;
+            }
+
+        }
+
+    }
+
+    synchronized boolean isRegistered(MetaspaceWrapperObject wrapper) {
+        for (WeakReference<MetaspaceWrapperObject> m : list) {
+            if (m != null && m.get() == wrapper) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java
new file mode 100644
index 0000000..473eb18
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java
@@ -0,0 +1,554 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import static jdk.vm.ci.common.InitTimer.timer;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.TreeMap;
+
+import jdk.internal.misc.VM;
+import jdk.vm.ci.code.Architecture;
+import jdk.vm.ci.code.CompilationRequestResult;
+import jdk.vm.ci.code.CompiledCode;
+import jdk.vm.ci.code.InstalledCode;
+import jdk.vm.ci.common.InitTimer;
+import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory.CompilationLevel;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.JavaType;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import jdk.vm.ci.runtime.JVMCI;
+import jdk.vm.ci.runtime.JVMCIBackend;
+import jdk.vm.ci.runtime.JVMCICompiler;
+import jdk.vm.ci.runtime.JVMCICompilerFactory;
+import jdk.vm.ci.services.JVMCIServiceLocator;
+import jdk.vm.ci.services.Services;
+
+/**
+ * HotSpot implementation of a JVMCI runtime.
+ *
+ * The initialization of this class is very fragile since it's initialized both through
+ * {@link JVMCI#initialize()} or through calling {@link HotSpotJVMCIRuntime#runtime()} and
+ * {@link HotSpotJVMCIRuntime#runtime()} is also called by {@link JVMCI#initialize()}. So this class
+ * can't have a static initializer and any required initialization must be done as part of
+ * {@link #runtime()}. This allows the initialization to funnel back through
+ * {@link JVMCI#initialize()} without deadlocking.
+ */
+public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider {
+
+    @SuppressWarnings("try")
+    static class DelayedInit {
+        private static final HotSpotJVMCIRuntime instance;
+
+        static {
+            try (InitTimer t = timer("HotSpotJVMCIRuntime.<init>")) {
+                instance = new HotSpotJVMCIRuntime();
+            }
+        }
+    }
+
+    /**
+     * Gets the singleton {@link HotSpotJVMCIRuntime} object.
+     */
+    public static HotSpotJVMCIRuntime runtime() {
+        JVMCI.initialize();
+        return DelayedInit.instance;
+    }
+
+    /**
+     * A list of all supported JVMCI options.
+     */
+    public enum Option {
+        // @formatter:off
+        Compiler(String.class, null, "Selects the system compiler."),
+        // Note: The following one is not used (see InitTimer.ENABLED). It is added here
+        // so that -XX:+JVMCIPrintProperties shows the option.
+        InitTimer(Boolean.class, false, "Specifies if initialization timing is enabled."),
+        PrintConfig(Boolean.class, false, "Prints VM configuration available via JVMCI."),
+        TraceMethodDataFilter(String.class, null,
+                        "Enables tracing of profiling info when read by JVMCI.",
+                        "Empty value: trace all methods",
+                        "Non-empty value: trace methods whose fully qualified name contains the value."),
+        UseProfilingInformation(Boolean.class, true, "");
+        // @formatter:on
+
+        /**
+         * The prefix for system properties that are JVMCI options.
+         */
+        private static final String JVMCI_OPTION_PROPERTY_PREFIX = "jvmci.";
+
+        /**
+         * Marker for uninitialized flags.
+         */
+        private static final String UNINITIALIZED = "UNINITIALIZED";
+
+        private final Class<?> type;
+        private Object value;
+        private final Object defaultValue;
+        private boolean isDefault;
+        private final String[] helpLines;
+
+        Option(Class<?> type, Object defaultValue, String... helpLines) {
+            assert Character.isUpperCase(name().charAt(0)) : "Option name must start with upper-case letter: " + name();
+            this.type = type;
+            this.value = UNINITIALIZED;
+            this.defaultValue = defaultValue;
+            this.helpLines = helpLines;
+        }
+
+        @SuppressFBWarnings(value = "ES_COMPARING_STRINGS_WITH_EQ", justification = "sentinel must be String since it's a static final in an enum")
+        private Object getValue() {
+            if (value == UNINITIALIZED) {
+                String propertyValue = VM.getSavedProperty(getPropertyName());
+                if (propertyValue == null) {
+                    this.value = defaultValue;
+                    this.isDefault = true;
+                } else {
+                    if (type == Boolean.class) {
+                        this.value = Boolean.parseBoolean(propertyValue);
+                    } else if (type == String.class) {
+                        this.value = propertyValue;
+                    } else {
+                        throw new JVMCIError("Unexpected option type " + type);
+                    }
+                    this.isDefault = false;
+                }
+                // Saved properties should not be interned - let's be sure
+                assert value != UNINITIALIZED;
+            }
+            return value;
+        }
+
+        /**
+         * Gets the name of system property from which this option gets its value.
+         */
+        public String getPropertyName() {
+            return JVMCI_OPTION_PROPERTY_PREFIX + name();
+        }
+
+        /**
+         * Returns the option's value as boolean.
+         *
+         * @return option's value
+         */
+        public boolean getBoolean() {
+            return (boolean) getValue();
+        }
+
+        /**
+         * Returns the option's value as String.
+         *
+         * @return option's value
+         */
+        public String getString() {
+            return (String) getValue();
+        }
+
+        private static final int PROPERTY_LINE_WIDTH = 80;
+        private static final int PROPERTY_HELP_INDENT = 10;
+
+        /**
+         * Prints a description of the properties used to configure shared JVMCI code.
+         *
+         * @param out stream to print to
+         */
+        public static void printProperties(PrintStream out) {
+            out.println("[JVMCI properties]");
+            Option[] values = values();
+            for (Option option : values) {
+                Object value = option.getValue();
+                if (value instanceof String) {
+                    value = '"' + String.valueOf(value) + '"';
+                }
+
+                String name = option.getPropertyName();
+                String assign = option.isDefault ? "=" : ":=";
+                String typeName = option.type.getSimpleName();
+                String linePrefix = String.format("%s %s %s ", name, assign, value);
+                int typeStartPos = PROPERTY_LINE_WIDTH - typeName.length();
+                int linePad = typeStartPos - linePrefix.length();
+                if (linePad > 0) {
+                    out.printf("%s%-" + linePad + "s[%s]%n", linePrefix, "", typeName);
+                } else {
+                    out.printf("%s[%s]%n", linePrefix, typeName);
+                }
+                for (String line : option.helpLines) {
+                    out.printf("%" + PROPERTY_HELP_INDENT + "s%s%n", "", line);
+                }
+            }
+        }
+    }
+
+    public static HotSpotJVMCIBackendFactory findFactory(String architecture) {
+        for (HotSpotJVMCIBackendFactory factory : Services.load(HotSpotJVMCIBackendFactory.class)) {
+            if (factory.getArchitecture().equalsIgnoreCase(architecture)) {
+                return factory;
+            }
+        }
+
+        throw new JVMCIError("No JVMCI runtime available for the %s architecture", architecture);
+    }
+
+    /**
+     * Gets the kind of a word value on the {@linkplain #getHostJVMCIBackend() host} backend.
+     */
+    public static JavaKind getHostWordKind() {
+        return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordJavaKind;
+    }
+
+    protected final CompilerToVM compilerToVm;
+
+    protected final HotSpotVMConfigStore configStore;
+    protected final HotSpotVMConfig config;
+    private final JVMCIBackend hostBackend;
+
+    private final JVMCICompilerFactory compilerFactory;
+    private final HotSpotJVMCICompilerFactory hsCompilerFactory;
+    private volatile JVMCICompiler compiler;
+    protected final HotSpotJVMCIMetaAccessContext metaAccessContext;
+
+    /**
+     * Stores the result of {@link HotSpotJVMCICompilerFactory#getCompilationLevelAdjustment} so
+     * that it can be read from the VM.
+     */
+    @SuppressWarnings("unused") private final int compilationLevelAdjustment;
+
+    private final Map<Class<? extends Architecture>, JVMCIBackend> backends = new HashMap<>();
+
+    private volatile List<HotSpotVMEventListener> vmEventListeners;
+
+    private Iterable<HotSpotVMEventListener> getVmEventListeners() {
+        if (vmEventListeners == null) {
+            synchronized (this) {
+                if (vmEventListeners == null) {
+                    vmEventListeners = JVMCIServiceLocator.getProviders(HotSpotVMEventListener.class);
+                }
+            }
+        }
+        return vmEventListeners;
+    }
+
+    /**
+     * Stores the result of {@link HotSpotJVMCICompilerFactory#getTrivialPrefixes()} so that it can
+     * be read from the VM.
+     */
+    @SuppressWarnings("unused") private final String[] trivialPrefixes;
+
+    @SuppressWarnings("try")
+    private HotSpotJVMCIRuntime() {
+        compilerToVm = new CompilerToVM();
+
+        try (InitTimer t = timer("HotSpotVMConfig<init>")) {
+            configStore = new HotSpotVMConfigStore(compilerToVm);
+            config = new HotSpotVMConfig(configStore);
+        }
+
+        String hostArchitecture = config.getHostArchitectureName();
+
+        HotSpotJVMCIBackendFactory factory;
+        try (InitTimer t = timer("find factory:", hostArchitecture)) {
+            factory = findFactory(hostArchitecture);
+        }
+
+        try (InitTimer t = timer("create JVMCI backend:", hostArchitecture)) {
+            hostBackend = registerBackend(factory.createJVMCIBackend(this, null));
+        }
+
+        metaAccessContext = new HotSpotJVMCIMetaAccessContext();
+
+        compilerFactory = HotSpotJVMCICompilerConfig.getCompilerFactory();
+        if (compilerFactory instanceof HotSpotJVMCICompilerFactory) {
+            hsCompilerFactory = (HotSpotJVMCICompilerFactory) compilerFactory;
+            trivialPrefixes = hsCompilerFactory.getTrivialPrefixes();
+            switch (hsCompilerFactory.getCompilationLevelAdjustment()) {
+                case None:
+                    compilationLevelAdjustment = config.compLevelAdjustmentNone;
+                    break;
+                case ByHolder:
+                    compilationLevelAdjustment = config.compLevelAdjustmentByHolder;
+                    break;
+                case ByFullSignature:
+                    compilationLevelAdjustment = config.compLevelAdjustmentByFullSignature;
+                    break;
+                default:
+                    compilationLevelAdjustment = config.compLevelAdjustmentNone;
+                    break;
+            }
+        } else {
+            hsCompilerFactory = null;
+            trivialPrefixes = null;
+            compilationLevelAdjustment = config.compLevelAdjustmentNone;
+        }
+
+        if (config.getFlag("JVMCIPrintProperties", Boolean.class)) {
+            PrintStream out = new PrintStream(getLogStream());
+            Option.printProperties(out);
+            compilerFactory.printProperties(out);
+            System.exit(0);
+        }
+
+        if (Option.PrintConfig.getBoolean()) {
+            printConfig(configStore, compilerToVm);
+        }
+    }
+
+    private JVMCIBackend registerBackend(JVMCIBackend backend) {
+        Class<? extends Architecture> arch = backend.getCodeCache().getTarget().arch.getClass();
+        JVMCIBackend oldValue = backends.put(arch, backend);
+        assert oldValue == null : "cannot overwrite existing backend for architecture " + arch.getSimpleName();
+        return backend;
+    }
+
+    public ResolvedJavaType fromClass(Class<?> javaClass) {
+        return metaAccessContext.fromClass(javaClass);
+    }
+
+    public HotSpotVMConfigStore getConfigStore() {
+        return configStore;
+    }
+
+    public HotSpotVMConfig getConfig() {
+        return config;
+    }
+
+    public CompilerToVM getCompilerToVM() {
+        return compilerToVm;
+    }
+
+    public JVMCICompiler getCompiler() {
+        if (compiler == null) {
+            synchronized (this) {
+                if (compiler == null) {
+                    compiler = compilerFactory.createCompiler(this);
+                }
+            }
+        }
+        return compiler;
+    }
+
+    public JavaType lookupType(String name, HotSpotResolvedObjectType accessingType, boolean resolve) {
+        Objects.requireNonNull(accessingType, "cannot resolve type without an accessing class");
+        // If the name represents a primitive type we can short-circuit the lookup.
+        if (name.length() == 1) {
+            JavaKind kind = JavaKind.fromPrimitiveOrVoidTypeChar(name.charAt(0));
+            return fromClass(kind.toJavaClass());
+        }
+
+        // Resolve non-primitive types in the VM.
+        HotSpotResolvedObjectTypeImpl hsAccessingType = (HotSpotResolvedObjectTypeImpl) accessingType;
+        final HotSpotResolvedObjectTypeImpl klass = compilerToVm.lookupType(name, hsAccessingType.mirror(), resolve);
+
+        if (klass == null) {
+            assert resolve == false;
+            return HotSpotUnresolvedJavaType.create(this, name);
+        }
+        return klass;
+    }
+
+    public JVMCIBackend getHostJVMCIBackend() {
+        return hostBackend;
+    }
+
+    public <T extends Architecture> JVMCIBackend getJVMCIBackend(Class<T> arch) {
+        assert arch != Architecture.class;
+        return backends.get(arch);
+    }
+
+    public Map<Class<? extends Architecture>, JVMCIBackend> getJVMCIBackends() {
+        return Collections.unmodifiableMap(backends);
+    }
+
+    /**
+     * Called from the VM.
+     */
+    @SuppressWarnings({"unused"})
+    private int adjustCompilationLevel(Class<?> declaringClass, String name, String signature, boolean isOsr, int level) {
+        CompilationLevel curLevel;
+        if (level == config.compilationLevelNone) {
+            curLevel = CompilationLevel.None;
+        } else if (level == config.compilationLevelSimple) {
+            curLevel = CompilationLevel.Simple;
+        } else if (level == config.compilationLevelLimitedProfile) {
+            curLevel = CompilationLevel.LimitedProfile;
+        } else if (level == config.compilationLevelFullProfile) {
+            curLevel = CompilationLevel.FullProfile;
+        } else if (level == config.compilationLevelFullOptimization) {
+            curLevel = CompilationLevel.FullOptimization;
+        } else {
+            throw JVMCIError.shouldNotReachHere();
+        }
+
+        switch (hsCompilerFactory.adjustCompilationLevel(declaringClass, name, signature, isOsr, curLevel)) {
+            case None:
+                return config.compilationLevelNone;
+            case Simple:
+                return config.compilationLevelSimple;
+            case LimitedProfile:
+                return config.compilationLevelLimitedProfile;
+            case FullProfile:
+                return config.compilationLevelFullProfile;
+            case FullOptimization:
+                return config.compilationLevelFullOptimization;
+            default:
+                return level;
+        }
+    }
+
+    /**
+     * Called from the VM.
+     */
+    @SuppressWarnings({"unused"})
+    private HotSpotCompilationRequestResult compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) {
+        CompilationRequestResult result = getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id));
+        assert result != null : "compileMethod must always return something";
+        HotSpotCompilationRequestResult hsResult;
+        if (result instanceof HotSpotCompilationRequestResult) {
+            hsResult = (HotSpotCompilationRequestResult) result;
+        } else {
+            Object failure = result.getFailure();
+            if (failure != null) {
+                boolean retry = false; // Be conservative with unknown compiler
+                hsResult = HotSpotCompilationRequestResult.failure(failure.toString(), retry);
+            } else {
+                int inlinedBytecodes = -1;
+                hsResult = HotSpotCompilationRequestResult.success(inlinedBytecodes);
+            }
+        }
+
+        return hsResult;
+    }
+
+    /**
+     * Shuts down the runtime.
+     *
+     * Called from the VM.
+     */
+    @SuppressWarnings({"unused"})
+    private void shutdown() throws Exception {
+        for (HotSpotVMEventListener vmEventListener : getVmEventListeners()) {
+            vmEventListener.notifyShutdown();
+        }
+    }
+
+    /**
+     * Notify on completion of a bootstrap.
+     *
+     * Called from the VM.
+     */
+    @SuppressWarnings({"unused"})
+    private void bootstrapFinished() throws Exception {
+        for (HotSpotVMEventListener vmEventListener : getVmEventListeners()) {
+            vmEventListener.notifyBootstrapFinished();
+        }
+    }
+
+    /**
+     * Notify on successful install into the CodeCache.
+     *
+     * @param hotSpotCodeCacheProvider
+     * @param installedCode
+     * @param compiledCode
+     */
+    void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompiledCode compiledCode) {
+        for (HotSpotVMEventListener vmEventListener : getVmEventListeners()) {
+            vmEventListener.notifyInstall(hotSpotCodeCacheProvider, installedCode, compiledCode);
+        }
+    }
+
+    @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING", justification = "no localization here please!")
+    private static void printConfigLine(CompilerToVM vm, String format, Object... args) {
+        String line = String.format(format, args);
+        byte[] lineBytes = line.getBytes();
+        vm.writeDebugOutput(lineBytes, 0, lineBytes.length);
+        vm.flushDebugOutput();
+    }
+
+    private static void printConfig(HotSpotVMConfigStore store, CompilerToVM vm) {
+        TreeMap<String, VMField> fields = new TreeMap<>(store.getFields());
+        for (VMField field : fields.values()) {
+            if (!field.isStatic()) {
+                printConfigLine(vm, "[vmconfig:instance field] %s %s {offset=%d[0x%x]}%n", field.type, field.name, field.offset, field.offset);
+            } else {
+                String value = field.value == null ? "null" : field.value instanceof Boolean ? field.value.toString() : String.format("%d[0x%x]", field.value, field.value);
+                printConfigLine(vm, "[vmconfig:static field] %s %s = %s {address=0x%x}%n", field.type, field.name, value, field.address);
+            }
+        }
+        TreeMap<String, VMFlag> flags = new TreeMap<>(store.getFlags());
+        for (VMFlag flag : flags.values()) {
+            printConfigLine(vm, "[vmconfig:flag] %s %s = %s%n", flag.type, flag.name, flag.value);
+        }
+        TreeMap<String, Long> addresses = new TreeMap<>(store.getAddresses());
+        for (Map.Entry<String, Long> e : addresses.entrySet()) {
+            printConfigLine(vm, "[vmconfig:address] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue());
+        }
+        TreeMap<String, Long> constants = new TreeMap<>(store.getConstants());
+        for (Map.Entry<String, Long> e : constants.entrySet()) {
+            printConfigLine(vm, "[vmconfig:constant] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue());
+        }
+        for (VMIntrinsicMethod e : store.getIntrinsics()) {
+            printConfigLine(vm, "[vmconfig:intrinsic] %d = %s.%s %s%n", e.id, e.declaringClass, e.name, e.descriptor);
+        }
+    }
+
+    public OutputStream getLogStream() {
+        return new OutputStream() {
+
+            @Override
+            public void write(byte[] b, int off, int len) throws IOException {
+                if (b == null) {
+                    throw new NullPointerException();
+                } else if (off < 0 || off > b.length || len < 0 || (off + len) > b.length || (off + len) < 0) {
+                    throw new IndexOutOfBoundsException();
+                } else if (len == 0) {
+                    return;
+                }
+                compilerToVm.writeDebugOutput(b, off, len);
+            }
+
+            @Override
+            public void write(int b) throws IOException {
+                write(new byte[]{(byte) b}, 0, 1);
+            }
+
+            @Override
+            public void flush() throws IOException {
+                compilerToVm.flushDebugOutput();
+            }
+        };
+    }
+
+    /**
+     * Collects the current values of all JVMCI benchmark counters, summed up over all threads.
+     */
+    public long[] collectCounters() {
+        return compilerToVm.collectCounters();
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJavaType.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJavaType.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJavaType.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java
new file mode 100644
index 0000000..15250e2
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import jdk.vm.ci.meta.Constant;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.MemoryAccessProvider;
+
+/**
+ * HotSpot specific extension of {@link MemoryAccessProvider}.
+ */
+public interface HotSpotMemoryAccessProvider extends MemoryAccessProvider {
+
+    /**
+     * @throws IllegalArgumentException if the address computed from {@code base} and
+     *             {@code displacement} does not denote a location holding a narrow oop
+     */
+    JavaConstant readNarrowOopConstant(Constant base, long displacement);
+
+    Constant readKlassPointerConstant(Constant base, long displacement);
+
+    Constant readNarrowKlassPointerConstant(Constant base, long displacement);
+
+    Constant readMethodPointerConstant(Constant base, long displacement);
+}
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java
new file mode 100644
index 0000000..9f262aa
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java
@@ -0,0 +1,339 @@
+/*
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset;
+import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale;
+import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
+
+import java.lang.reflect.Array;
+
+import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.meta.Constant;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.MemoryAccessProvider;
+import jdk.vm.ci.meta.MetaAccessProvider;
+import jdk.vm.ci.meta.PrimitiveConstant;
+import jdk.vm.ci.meta.ResolvedJavaField;
+import jdk.vm.ci.meta.ResolvedJavaType;
+
+/**
+ * HotSpot implementation of {@link MemoryAccessProvider}.
+ */
+class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider {
+
+    protected final HotSpotJVMCIRuntimeProvider runtime;
+
+    HotSpotMemoryAccessProviderImpl(HotSpotJVMCIRuntimeProvider runtime) {
+        this.runtime = runtime;
+    }
+
+    /**
+     * Gets the object boxed by {@code base} that is about to have a value of kind {@code kind} read
+     * from it at the offset {@code displacement}.
+     *
+     * @param base constant value containing the base address for a pending read
+     * @return {@code null} if {@code base} does not box an object otherwise the object boxed in
+     *         {@code base}
+     */
+    private Object asObject(Constant base, JavaKind kind, long displacement) {
+        if (base instanceof HotSpotObjectConstantImpl) {
+            HotSpotObjectConstantImpl constant = (HotSpotObjectConstantImpl) base;
+            HotSpotResolvedObjectType type = constant.getType();
+            Object object = constant.object();
+            checkRead(kind, displacement, type, object);
+            return object;
+        }
+        return null;
+    }
+
+    /**
+     * Offset of injected {@code java.lang.Class::oop_size} field. No need to make {@code volatile}
+     * as initialization is idempotent.
+     */
+    private long oopSizeOffset;
+
+    private static int computeOopSizeOffset(HotSpotJVMCIRuntimeProvider runtime) {
+        MetaAccessProvider metaAccess = runtime.getHostJVMCIBackend().getMetaAccess();
+        ResolvedJavaType staticType = metaAccess.lookupJavaType(Class.class);
+        for (ResolvedJavaField f : staticType.getInstanceFields(false)) {
+            if (f.getName().equals("oop_size")) {
+                int offset = ((HotSpotResolvedJavaField) f).offset();
+                assert offset != 0 : "not expecting offset of java.lang.Class::oop_size to be 0";
+                return offset;
+            }
+        }
+        throw new JVMCIError("Could not find injected java.lang.Class::oop_size field");
+    }
+
+    private boolean checkRead(JavaKind kind, long displacement, HotSpotResolvedObjectType type, Object object) {
+        if (type.isArray()) {
+            ResolvedJavaType componentType = type.getComponentType();
+            JavaKind componentKind = componentType.getJavaKind();
+            final int headerSize = getArrayBaseOffset(componentKind);
+            int sizeOfElement = getArrayIndexScale(componentKind);
+            int length = Array.getLength(object);
+            long arrayEnd = headerSize + (sizeOfElement * length);
+            boolean aligned = ((displacement - headerSize) % sizeOfElement) == 0;
+            if (displacement < 0 || displacement > (arrayEnd - sizeOfElement) || (kind == JavaKind.Object && !aligned)) {
+                int index = (int) ((displacement - headerSize) / sizeOfElement);
+                throw new AssertionError("Unsafe array access: reading element of kind " + kind +
+                                " at offset " + displacement + " (index ~ " + index + ") in " +
+                                type.toJavaName() + " object of length " + length);
+            }
+        } else if (kind != JavaKind.Object) {
+            long size;
+            if (object instanceof Class) {
+                if (oopSizeOffset == 0) {
+                    oopSizeOffset = computeOopSizeOffset(runtime);
+                }
+                int wordSize = runtime.getHostJVMCIBackend().getCodeCache().getTarget().wordSize;
+                size = UNSAFE.getInt(object, oopSizeOffset) * wordSize;
+            } else {
+                size = Math.abs(type.instanceSize());
+            }
+            int bytesToRead = kind.getByteCount();
+            if (displacement + bytesToRead > size || displacement < 0) {
+                throw new IllegalArgumentException("Unsafe access: reading " + bytesToRead + " bytes at offset " + displacement + " in " +
+                                type.toJavaName() + " object of size " + size);
+            }
+        } else {
+            ResolvedJavaField field = type.findInstanceFieldWithOffset(displacement, JavaKind.Object);
+            if (field == null && object instanceof Class) {
+                // Read of a static field
+                MetaAccessProvider metaAccess = runtime.getHostJVMCIBackend().getMetaAccess();
+                HotSpotResolvedObjectTypeImpl staticFieldsHolder = (HotSpotResolvedObjectTypeImpl) metaAccess.lookupJavaType((Class<?>) object);
+                field = staticFieldsHolder.findStaticFieldWithOffset(displacement, JavaKind.Object);
+            }
+            if (field == null) {
+                throw new IllegalArgumentException("Unsafe object access: field not found for read of kind Object" +
+                                " at offset " + displacement + " in " + type.toJavaName() + " object");
+            }
+            if (field.getJavaKind() != JavaKind.Object) {
+                throw new IllegalArgumentException("Unsafe object access: field " + field.format("%H.%n:%T") + " not of expected kind Object" +
+                                " at offset " + displacement + " in " + type.toJavaName() + " object");
+            }
+        }
+        return true;
+    }
+
+    private boolean isValidObjectFieldDisplacement(Constant base, long displacement) {
+        if (base instanceof HotSpotMetaspaceConstant) {
+            MetaspaceWrapperObject metaspaceObject = HotSpotMetaspaceConstantImpl.getMetaspaceObject(base);
+            if (metaspaceObject instanceof HotSpotResolvedObjectTypeImpl) {
+                if (displacement == runtime.getConfig().classMirrorOffset) {
+                    // Klass::_java_mirror is valid for all Klass* values
+                    return true;
+                }
+            } else {
+                throw new IllegalArgumentException(String.valueOf(metaspaceObject));
+            }
+        }
+        return false;
+    }
+
+    private static long asRawPointer(Constant base) {
+        if (base instanceof HotSpotMetaspaceConstantImpl) {
+            MetaspaceWrapperObject meta = HotSpotMetaspaceConstantImpl.getMetaspaceObject(base);
+            return meta.getMetaspacePointer();
+        } else if (base instanceof PrimitiveConstant) {
+            PrimitiveConstant prim = (PrimitiveConstant) base;
+            if (prim.getJavaKind().isNumericInteger()) {
+                return prim.asLong();
+            }
+        }
+        throw new IllegalArgumentException(String.valueOf(base));
+    }
+
+    private long readRawValue(Constant baseConstant, long displacement, JavaKind kind, int bits) {
+        Object base = asObject(baseConstant, kind, displacement);
+        if (base != null) {
+            switch (bits) {
+                case Byte.SIZE:
+                    return UNSAFE.getByte(base, displacement);
+                case Short.SIZE:
+                    return UNSAFE.getShort(base, displacement);
+                case Integer.SIZE:
+                    return UNSAFE.getInt(base, displacement);
+                case Long.SIZE:
+                    return UNSAFE.getLong(base, displacement);
+                default:
+                    throw new IllegalArgumentException(String.valueOf(bits));
+            }
+        } else {
+            long pointer = asRawPointer(baseConstant);
+            switch (bits) {
+                case Byte.SIZE:
+                    return UNSAFE.getByte(pointer + displacement);
+                case Short.SIZE:
+                    return UNSAFE.getShort(pointer + displacement);
+                case Integer.SIZE:
+                    return UNSAFE.getInt(pointer + displacement);
+                case Long.SIZE:
+                    return UNSAFE.getLong(pointer + displacement);
+                default:
+                    throw new IllegalArgumentException(String.valueOf(bits));
+            }
+        }
+    }
+
+    private boolean verifyReadRawObject(Object expected, Constant base, long displacement) {
+        if (base instanceof HotSpotMetaspaceConstant) {
+            MetaspaceWrapperObject metaspaceObject = HotSpotMetaspaceConstantImpl.getMetaspaceObject(base);
+            if (metaspaceObject instanceof HotSpotResolvedObjectTypeImpl) {
+                if (displacement == runtime.getConfig().classMirrorOffset) {
+                    assert expected == ((HotSpotResolvedObjectTypeImpl) metaspaceObject).mirror();
+                }
+            }
+        }
+        return true;
+    }
+
+    private Object readRawObject(Constant baseConstant, long initialDisplacement, boolean compressed) {
+        long displacement = initialDisplacement;
+        Object ret;
+        Object base = asObject(baseConstant, JavaKind.Object, displacement);
+        if (base == null) {
+            assert !compressed;
+            displacement += asRawPointer(baseConstant);
+            ret = UNSAFE.getUncompressedObject(displacement);
+            assert verifyReadRawObject(ret, baseConstant, initialDisplacement);
+        } else {
+            assert runtime.getConfig().useCompressedOops == compressed;
+            ret = UNSAFE.getObject(base, displacement);
+        }
+        return ret;
+    }
+
+    JavaConstant readFieldValue(HotSpotResolvedJavaField field, Object obj) {
+        assert obj != null;
+        assert !field.isStatic() || obj instanceof Class;
+        long displacement = field.offset();
+        assert checkRead(field.getJavaKind(), displacement, (HotSpotResolvedObjectType) runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType(obj.getClass()), obj);
+        if (field.getJavaKind() == JavaKind.Object) {
+            Object o = UNSAFE.getObject(obj, displacement);
+            return HotSpotObjectConstantImpl.forObject(o);
+        } else {
+            JavaKind kind = field.getJavaKind();
+            switch (kind) {
+                case Boolean:
+                    return JavaConstant.forBoolean(UNSAFE.getBoolean(obj, displacement));
+                case Byte:
+                    return JavaConstant.forByte(UNSAFE.getByte(obj, displacement));
+                case Char:
+                    return JavaConstant.forChar(UNSAFE.getChar(obj, displacement));
+                case Short:
+                    return JavaConstant.forShort(UNSAFE.getShort(obj, displacement));
+                case Int:
+                    return JavaConstant.forInt(UNSAFE.getInt(obj, displacement));
+                case Long:
+                    return JavaConstant.forLong(UNSAFE.getLong(obj, displacement));
+                case Float:
+                    return JavaConstant.forFloat(UNSAFE.getFloat(obj, displacement));
+                case Double:
+                    return JavaConstant.forDouble(UNSAFE.getDouble(obj, displacement));
+                default:
+                    throw new IllegalArgumentException("Unsupported kind: " + kind);
+            }
+        }
+    }
+
+    @Override
+    public JavaConstant readPrimitiveConstant(JavaKind kind, Constant baseConstant, long initialDisplacement, int bits) {
+        try {
+            long rawValue = readRawValue(baseConstant, initialDisplacement, kind, bits);
+            switch (kind) {
+                case Boolean:
+                    return JavaConstant.forBoolean(rawValue != 0);
+                case Byte:
+                    return JavaConstant.forByte((byte) rawValue);
+                case Char:
+                    return JavaConstant.forChar((char) rawValue);
+                case Short:
+                    return JavaConstant.forShort((short) rawValue);
+                case Int:
+                    return JavaConstant.forInt((int) rawValue);
+                case Long:
+                    return JavaConstant.forLong(rawValue);
+                case Float:
+                    return JavaConstant.forFloat(Float.intBitsToFloat((int) rawValue));
+                case Double:
+                    return JavaConstant.forDouble(Double.longBitsToDouble(rawValue));
+                default:
+                    throw new IllegalArgumentException("Unsupported kind: " + kind);
+            }
+        } catch (NullPointerException e) {
+            return null;
+        }
+    }
+
+    @Override
+    public JavaConstant readObjectConstant(Constant base, long displacement) {
+        if (base instanceof HotSpotObjectConstantImpl) {
+            Object o = readRawObject(base, displacement, runtime.getConfig().useCompressedOops);
+            return HotSpotObjectConstantImpl.forObject(o);
+        }
+        if (!isValidObjectFieldDisplacement(base, displacement)) {
+            return null;
+        }
+        return HotSpotObjectConstantImpl.forObject(readRawObject(base, displacement, false));
+    }
+
+    @Override
+    public JavaConstant readNarrowOopConstant(Constant base, long displacement) {
+        return HotSpotObjectConstantImpl.forObject(readRawObject(base, displacement, true), true);
+    }
+
+    private HotSpotResolvedObjectTypeImpl readKlass(Constant base, long displacement, boolean compressed) {
+        assert (base instanceof HotSpotMetaspaceConstantImpl) || (base instanceof HotSpotObjectConstantImpl) : base.getClass();
+        Object baseObject = (base instanceof HotSpotMetaspaceConstantImpl) ? ((HotSpotMetaspaceConstantImpl) base).asResolvedJavaType() : ((HotSpotObjectConstantImpl) base).object();
+        return runtime.getCompilerToVM().getResolvedJavaType(baseObject, displacement, compressed);
+    }
+
+    @Override
+    public Constant readKlassPointerConstant(Constant base, long displacement) {
+        HotSpotResolvedObjectTypeImpl klass = readKlass(base, displacement, false);
+        if (klass == null) {
+            return JavaConstant.NULL_POINTER;
+        }
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(klass, false);
+    }
+
+    @Override
+    public Constant readNarrowKlassPointerConstant(Constant base, long displacement) {
+        HotSpotResolvedObjectTypeImpl klass = readKlass(base, displacement, true);
+        if (klass == null) {
+            return HotSpotCompressedNullConstant.COMPRESSED_NULL;
+        }
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(klass, true);
+    }
+
+    @Override
+    public Constant readMethodPointerConstant(Constant base, long displacement) {
+        assert (base instanceof HotSpotObjectConstantImpl);
+        Object baseObject = ((HotSpotObjectConstantImpl) base).object();
+        HotSpotResolvedJavaMethodImpl method = runtime.getCompilerToVM().getResolvedJavaMethod(baseObject, displacement);
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(method, false);
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaData.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaData.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaData.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaData.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java
new file mode 100644
index 0000000..aca3b3d
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import static java.util.FormattableFlags.ALTERNATE;
+import static java.util.FormattableFlags.LEFT_JUSTIFY;
+import static java.util.FormattableFlags.UPPERCASE;
+
+import java.util.Formattable;
+import java.util.Formatter;
+
+import jdk.vm.ci.meta.JavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+
+abstract class HotSpotMethod implements JavaMethod, Formattable {
+
+    public static String applyFormattingFlagsAndWidth(String s, int flags, int width) {
+        if (flags == 0 && width < 0) {
+            return s;
+        }
+        StringBuilder sb = new StringBuilder(s);
+
+        // apply width and justification
+        int len = sb.length();
+        if (len < width) {
+            for (int i = 0; i < width - len; i++) {
+                if ((flags & LEFT_JUSTIFY) == LEFT_JUSTIFY) {
+                    sb.append(' ');
+                } else {
+                    sb.insert(0, ' ');
+                }
+            }
+        }
+
+        String res = sb.toString();
+        if ((flags & UPPERCASE) == UPPERCASE) {
+            res = res.toUpperCase();
+        }
+        return res;
+    }
+
+    /**
+     * Controls whether {@link #toString()} includes the qualified or simple name of the class in
+     * which the method is declared.
+     */
+    public static final boolean FULLY_QUALIFIED_METHOD_NAME = false;
+
+    @Override
+    public final String toString() {
+        char h = FULLY_QUALIFIED_METHOD_NAME ? 'H' : 'h';
+        String suffix = this instanceof ResolvedJavaMethod ? "" : ", unresolved";
+        String fmt = String.format("HotSpotMethod<%%%c.%%n(%%p)%s>", h, suffix);
+        return format(fmt);
+    }
+
+    public void formatTo(Formatter formatter, int flags, int width, int precision) {
+        String base = (flags & ALTERNATE) == ALTERNATE ? getName() : toString();
+        formatter.format(applyFormattingFlagsAndWidth(base, flags & ~ALTERNATE, width));
+    }
+
+    public JavaMethod asJavaMethod() {
+        return this;
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java
new file mode 100644
index 0000000..7eb4379
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import jdk.vm.ci.meta.JavaMethod;
+import jdk.vm.ci.meta.JavaType;
+import jdk.vm.ci.meta.Signature;
+
+/**
+ * Implementation of {@link JavaMethod} for unresolved HotSpot methods.
+ */
+final class HotSpotMethodUnresolved extends HotSpotMethod {
+
+    private final String name;
+    private final Signature signature;
+    protected JavaType holder;
+
+    HotSpotMethodUnresolved(String name, Signature signature, JavaType holder) {
+        this.name = name;
+        this.holder = holder;
+        this.signature = signature;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public Signature getSignature() {
+        return signature;
+    }
+
+    @Override
+    public JavaType getDeclaringClass() {
+        return holder;
+    }
+
+    @Override
+    public int hashCode() {
+        return super.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null || !(obj instanceof HotSpotMethodUnresolved)) {
+            return false;
+        }
+        HotSpotMethodUnresolved that = (HotSpotMethodUnresolved) obj;
+        return this.name.equals(that.name) && this.signature.equals(that.signature) && this.holder.equals(that.holder);
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotModifiers.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotModifiers.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotModifiers.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotModifiers.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotNmethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotNmethod.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotNmethod.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotNmethod.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotReferenceMap.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotReferenceMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotReferenceMap.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotReferenceMap.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java
new file mode 100644
index 0000000..737135a
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmFieldModifiers;
+import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+
+import jdk.internal.vm.annotation.Stable;
+import jdk.vm.ci.meta.JavaType;
+import jdk.vm.ci.meta.ResolvedJavaType;
+
+/**
+ * Represents a field in a HotSpot type.
+ */
+class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField {
+
+    private final HotSpotResolvedObjectTypeImpl holder;
+    private JavaType type;
+    private final int offset;
+    private final short index;
+
+    /**
+     * This value contains all flags as stored in the VM including internal ones.
+     */
+    private final int modifiers;
+
+    HotSpotResolvedJavaFieldImpl(HotSpotResolvedObjectTypeImpl holder, JavaType type, long offset, int modifiers, int index) {
+        this.holder = holder;
+        this.type = type;
+        this.index = (short) index;
+        assert this.index == index;
+        assert offset != -1;
+        assert offset == (int) offset : "offset larger than int";
+        this.offset = (int) offset;
+        this.modifiers = modifiers;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof HotSpotResolvedJavaField) {
+            HotSpotResolvedJavaFieldImpl that = (HotSpotResolvedJavaFieldImpl) obj;
+            if (that.offset != this.offset || that.isStatic() != this.isStatic()) {
+                return false;
+            } else if (this.holder.equals(that.holder)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return offset ^ modifiers;
+    }
+
+    @Override
+    public int getModifiers() {
+        return modifiers & jvmFieldModifiers();
+    }
+
+    @Override
+    public boolean isInternal() {
+        return (modifiers & config().jvmAccFieldInternal) != 0;
+    }
+
+    /**
+     * Determines if a given object contains this field.
+     *
+     * @return true iff this is a non-static field and its declaring class is assignable from
+     *         {@code object}'s class
+     */
+    public boolean isInObject(Object object) {
+        if (isStatic()) {
+            return false;
+        }
+        return getDeclaringClass().isAssignableFrom(HotSpotResolvedObjectTypeImpl.fromObjectClass(object.getClass()));
+    }
+
+    @Override
+    public HotSpotResolvedObjectTypeImpl getDeclaringClass() {
+        return holder;
+    }
+
+    @Override
+    public String getName() {
+        return holder.createFieldInfo(index).getName();
+    }
+
+    @Override
+    public JavaType getType() {
+        // Pull field into local variable to prevent a race causing
+        // a ClassCastException below
+        JavaType currentType = type;
+        if (currentType instanceof HotSpotUnresolvedJavaType) {
+            // Don't allow unresolved types to hang around forever
+            HotSpotUnresolvedJavaType unresolvedType = (HotSpotUnresolvedJavaType) currentType;
+            ResolvedJavaType resolved = unresolvedType.reresolve(holder);
+            if (resolved != null) {
+                type = resolved;
+            }
+        }
+        return type;
+    }
+
+    public int offset() {
+        return offset;
+    }
+
+    @Override
+    public String toString() {
+        return format("HotSpotField<%H.%n %t:") + offset + ">";
+    }
+
+    @Override
+    public boolean isSynthetic() {
+        return (config().jvmAccSynthetic & modifiers) != 0;
+    }
+
+    /**
+     * Checks if this field has the {@link Stable} annotation.
+     *
+     * @return true if field has {@link Stable} annotation, false otherwise
+     */
+    public boolean isStable() {
+        return (config().jvmAccFieldStable & modifiers) != 0;
+    }
+
+    @Override
+    public Annotation[] getAnnotations() {
+        Field javaField = toJava();
+        if (javaField != null) {
+            return javaField.getAnnotations();
+        }
+        return new Annotation[0];
+    }
+
+    @Override
+    public Annotation[] getDeclaredAnnotations() {
+        Field javaField = toJava();
+        if (javaField != null) {
+            return javaField.getDeclaredAnnotations();
+        }
+        return new Annotation[0];
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        Field javaField = toJava();
+        if (javaField != null) {
+            return javaField.getAnnotation(annotationClass);
+        }
+        return null;
+    }
+
+    private Field toJava() {
+        if (isInternal()) {
+            return null;
+        }
+        try {
+            return holder.mirror().getDeclaredField(getName());
+        } catch (NoSuchFieldException | NoClassDefFoundError e) {
+            return null;
+        }
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java
new file mode 100644
index 0000000..f831db4
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java
@@ -0,0 +1,780 @@
+/*
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
+import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
+import static jdk.vm.ci.hotspot.HotSpotModifiers.BRIDGE;
+import static jdk.vm.ci.hotspot.HotSpotModifiers.SYNTHETIC;
+import static jdk.vm.ci.hotspot.HotSpotModifiers.VARARGS;
+import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmMethodModifiers;
+import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
+import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Executable;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option;
+import jdk.vm.ci.meta.Constant;
+import jdk.vm.ci.meta.ConstantPool;
+import jdk.vm.ci.meta.DefaultProfilingInfo;
+import jdk.vm.ci.meta.ExceptionHandler;
+import jdk.vm.ci.meta.JavaMethod;
+import jdk.vm.ci.meta.JavaType;
+import jdk.vm.ci.meta.LineNumberTable;
+import jdk.vm.ci.meta.Local;
+import jdk.vm.ci.meta.LocalVariableTable;
+import jdk.vm.ci.meta.ProfilingInfo;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import jdk.vm.ci.meta.Signature;
+import jdk.vm.ci.meta.SpeculationLog;
+import jdk.vm.ci.meta.TriState;
+
+/**
+ * Implementation of {@link JavaMethod} for resolved HotSpot methods.
+ */
+final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSpotResolvedJavaMethod, MetaspaceWrapperObject {
+
+    /**
+     * Reference to metaspace Method object.
+     */
+    private final long metaspaceMethod;
+
+    private final HotSpotResolvedObjectTypeImpl holder;
+    private final HotSpotConstantPool constantPool;
+    private final HotSpotSignature signature;
+    private HotSpotMethodData methodData;
+    private byte[] code;
+    private Executable toJavaCache;
+
+    /**
+     * Only 30% of {@link HotSpotResolvedJavaMethodImpl}s have their name accessed so compute it
+     * lazily and cache it.
+     */
+    private String nameCache;
+
+    /**
+     * Gets the holder of a HotSpot metaspace method native object.
+     *
+     * @param metaspaceMethod a metaspace Method object
+     * @return the {@link ResolvedJavaType} corresponding to the holder of the
+     *         {@code metaspaceMethod}
+     */
+    private static HotSpotResolvedObjectTypeImpl getHolder(long metaspaceMethod) {
+        HotSpotVMConfig config = config();
+        final long metaspaceConstMethod = UNSAFE.getAddress(metaspaceMethod + config.methodConstMethodOffset);
+        final long metaspaceConstantPool = UNSAFE.getAddress(metaspaceConstMethod + config.constMethodConstantsOffset);
+        return compilerToVM().getResolvedJavaType(null, metaspaceConstantPool + config.constantPoolHolderOffset, false);
+    }
+
+    /**
+     * Gets the JVMCI mirror from a HotSpot method. The VM is responsible for ensuring that the
+     * Method* is kept alive for the duration of this call and the
+     * {@link HotSpotJVMCIMetaAccessContext} keeps it alive after that.
+     *
+     * Called from the VM.
+     *
+     * @param metaspaceMethod a metaspace Method object
+     * @return the {@link ResolvedJavaMethod} corresponding to {@code metaspaceMethod}
+     */
+    @SuppressWarnings("unused")
+    private static HotSpotResolvedJavaMethod fromMetaspace(long metaspaceMethod) {
+        HotSpotResolvedObjectTypeImpl holder = getHolder(metaspaceMethod);
+        return holder.createMethod(metaspaceMethod);
+    }
+
+    HotSpotResolvedJavaMethodImpl(HotSpotResolvedObjectTypeImpl holder, long metaspaceMethod) {
+        this.metaspaceMethod = metaspaceMethod;
+        this.holder = holder;
+
+        HotSpotVMConfig config = config();
+        final long constMethod = getConstMethod();
+
+        /*
+         * Get the constant pool from the metaspace method. Some methods (e.g. intrinsics for
+         * signature-polymorphic method handle methods) have their own constant pool instead of the
+         * one from their holder.
+         */
+        final long metaspaceConstantPool = UNSAFE.getAddress(constMethod + config.constMethodConstantsOffset);
+        if (metaspaceConstantPool == holder.getConstantPool().getMetaspaceConstantPool()) {
+            this.constantPool = holder.getConstantPool();
+        } else {
+            this.constantPool = compilerToVM().getConstantPool(this);
+        }
+
+        final int signatureIndex = UNSAFE.getChar(constMethod + config.constMethodSignatureIndexOffset);
+        this.signature = (HotSpotSignature) constantPool.lookupSignature(signatureIndex);
+    }
+
+    /**
+     * Returns a pointer to this method's constant method data structure (
+     * {@code Method::_constMethod}). This pointer isn't wrapped since it should be safe to use it
+     * within the context of this HotSpotResolvedJavaMethodImpl since the Method* and ConstMethod*
+     * are kept alive as a pair.
+     *
+     * @return pointer to this method's ConstMethod
+     */
+    private long getConstMethod() {
+        assert metaspaceMethod != 0;
+        return UNSAFE.getAddress(metaspaceMethod + config().methodConstMethodOffset);
+    }
+
+    @Override
+    public String getName() {
+        if (nameCache == null) {
+            final int nameIndex = UNSAFE.getChar(getConstMethod() + config().constMethodNameIndexOffset);
+            nameCache = constantPool.lookupUtf8(nameIndex);
+        }
+        return nameCache;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof HotSpotResolvedJavaMethodImpl) {
+            HotSpotResolvedJavaMethodImpl that = (HotSpotResolvedJavaMethodImpl) obj;
+            return that.metaspaceMethod == metaspaceMethod;
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return (int) metaspaceMethod;
+    }
+
+    /**
+     * Returns this method's flags ({@code Method::_flags}).
+     *
+     * @return flags of this method
+     */
+    private int getFlags() {
+        return UNSAFE.getShort(metaspaceMethod + config().methodFlagsOffset);
+    }
+
+    /**
+     * Returns this method's constant method flags ({@code ConstMethod::_flags}).
+     *
+     * @return flags of this method's ConstMethod
+     */
+    private int getConstMethodFlags() {
+        return UNSAFE.getChar(getConstMethod() + config().constMethodFlagsOffset);
+    }
+
+    @Override
+    public HotSpotResolvedObjectTypeImpl getDeclaringClass() {
+        return holder;
+    }
+
+    /**
+     * Gets the address of the C++ Method object for this method.
+     */
+    public Constant getMetaspaceMethodConstant() {
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(this, false);
+    }
+
+    public long getMetaspacePointer() {
+        return metaspaceMethod;
+    }
+
+    @Override
+    public Constant getEncoding() {
+        return getMetaspaceMethodConstant();
+    }
+
+    /**
+     * Gets the complete set of modifiers for this method which includes the JVM specification
+     * modifiers as well as the HotSpot internal modifiers.
+     */
+    public int getAllModifiers() {
+        return UNSAFE.getInt(metaspaceMethod + config().methodAccessFlagsOffset);
+    }
+
+    @Override
+    public int getModifiers() {
+        return getAllModifiers() & jvmMethodModifiers();
+    }
+
+    @Override
+    public boolean canBeStaticallyBound() {
+        return (isFinal() || isPrivate() || isStatic() || holder.isLeaf()) && isConcrete();
+    }
+
+    @Override
+    public byte[] getCode() {
+        if (getCodeSize() == 0) {
+            return null;
+        }
+        if (code == null && holder.isLinked()) {
+            code = compilerToVM().getBytecode(this);
+            assert code.length == getCodeSize() : "expected: " + getCodeSize() + ", actual: " + code.length;
+        }
+        return code;
+    }
+
+    @Override
+    public int getCodeSize() {
+        return UNSAFE.getChar(getConstMethod() + config().constMethodCodeSizeOffset);
+    }
+
+    @Override
+    public ExceptionHandler[] getExceptionHandlers() {
+        final boolean hasExceptionTable = (getConstMethodFlags() & config().constMethodHasExceptionTable) != 0;
+        if (!hasExceptionTable) {
+            return new ExceptionHandler[0];
+        }
+
+        HotSpotVMConfig config = config();
+        final int exceptionTableLength = compilerToVM().getExceptionTableLength(this);
+        ExceptionHandler[] handlers = new ExceptionHandler[exceptionTableLength];
+        long exceptionTableElement = compilerToVM().getExceptionTableStart(this);
+
+        for (int i = 0; i < exceptionTableLength; i++) {
+            final int startPc = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementStartPcOffset);
+            final int endPc = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementEndPcOffset);
+            final int handlerPc = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementHandlerPcOffset);
+            int catchTypeIndex = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementCatchTypeIndexOffset);
+
+            JavaType catchType;
+            if (catchTypeIndex == 0) {
+                catchType = null;
+            } else {
+                final int opcode = -1;  // opcode is not used
+                catchType = constantPool.lookupType(catchTypeIndex, opcode);
+
+                // Check for Throwable which catches everything.
+                if (catchType instanceof HotSpotResolvedObjectTypeImpl) {
+                    HotSpotResolvedObjectTypeImpl resolvedType = (HotSpotResolvedObjectTypeImpl) catchType;
+                    if (resolvedType.mirror() == Throwable.class) {
+                        catchTypeIndex = 0;
+                        catchType = null;
+                    }
+                }
+            }
+            handlers[i] = new ExceptionHandler(startPc, endPc, handlerPc, catchTypeIndex, catchType);
+
+            // Go to the next ExceptionTableElement
+            exceptionTableElement += config.exceptionTableElementSize;
+        }
+
+        return handlers;
+    }
+
+    /**
+     * Returns true if this method has a {@code CallerSensitive} annotation.
+     *
+     * @return true if CallerSensitive annotation present, false otherwise
+     */
+    public boolean isCallerSensitive() {
+        return (getFlags() & config().methodFlagsCallerSensitive) != 0;
+    }
+
+    /**
+     * Returns true if this method has a {@code ForceInline} annotation.
+     *
+     * @return true if ForceInline annotation present, false otherwise
+     */
+    public boolean isForceInline() {
+        return (getFlags() & config().methodFlagsForceInline) != 0;
+    }
+
+    /**
+     * Returns true if this method has a {@code ReservedStackAccess} annotation.
+     *
+     * @return true if ReservedStackAccess annotation present, false otherwise
+     */
+    public boolean hasReservedStackAccess() {
+        return (getFlags() & config().methodFlagsReservedStackAccess) != 0;
+    }
+
+    /**
+     * Manually adds a DontInline annotation to this method.
+     */
+    public void setNotInlineable() {
+        compilerToVM().doNotInlineOrCompile(this);
+    }
+
+    /**
+     * Returns true if this method is one of the special methods that is ignored by security stack
+     * walks.
+     *
+     * @return true if special method ignored by security stack walks, false otherwise
+     */
+    public boolean ignoredBySecurityStackWalk() {
+        return compilerToVM().methodIsIgnoredBySecurityStackWalk(this);
+    }
+
+    @Override
+    public boolean isClassInitializer() {
+        if (isStatic()) {
+            final int nameIndex = UNSAFE.getChar(getConstMethod() + config().constMethodNameIndexOffset);
+            long nameSymbol = constantPool.getEntryAt(nameIndex);
+            long clinitSymbol = config().symbolClinit;
+            return nameSymbol == clinitSymbol;
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isConstructor() {
+        if (!isStatic()) {
+            final int nameIndex = UNSAFE.getChar(getConstMethod() + config().constMethodNameIndexOffset);
+            long nameSymbol = constantPool.getEntryAt(nameIndex);
+            long initSymbol = config().symbolInit;
+            return nameSymbol == initSymbol;
+        }
+        return false;
+    }
+
+    @Override
+    public int getMaxLocals() {
+        if (isAbstract() || isNative()) {
+            return 0;
+        }
+        HotSpotVMConfig config = config();
+        return UNSAFE.getChar(getConstMethod() + config.methodMaxLocalsOffset);
+    }
+
+    @Override
+    public int getMaxStackSize() {
+        if (isAbstract() || isNative()) {
+            return 0;
+        }
+        HotSpotVMConfig config = config();
+        return config.extraStackEntries + UNSAFE.getChar(getConstMethod() + config.constMethodMaxStackOffset);
+    }
+
+    @Override
+    public StackTraceElement asStackTraceElement(int bci) {
+        if (bci < 0 || bci >= getCodeSize()) {
+            // HotSpot code can only construct stack trace elements for valid bcis
+            StackTraceElement ste = compilerToVM().getStackTraceElement(this, 0);
+            return new StackTraceElement(ste.getClassName(), ste.getMethodName(), ste.getFileName(), -1);
+        }
+        return compilerToVM().getStackTraceElement(this, bci);
+    }
+
+    public ResolvedJavaMethod uniqueConcreteMethod(HotSpotResolvedObjectType receiver) {
+        if (receiver.isInterface()) {
+            // Cannot trust interfaces. Because of:
+            // interface I { void foo(); }
+            // class A { public void foo() {} }
+            // class B extends A implements I { }
+            // class C extends B { public void foo() { } }
+            // class D extends B { }
+            // Would lead to identify C.foo() as the unique concrete method for I.foo() without
+            // seeing A.foo().
+            return null;
+        }
+        if (this.isDefault()) {
+            // CHA for default methods doesn't work and may crash the VM
+            return null;
+        }
+        return compilerToVM().findUniqueConcreteMethod(((HotSpotResolvedObjectTypeImpl) receiver), this);
+    }
+
+    @Override
+    public HotSpotSignature getSignature() {
+        return signature;
+    }
+
+    /**
+     * Gets the value of {@code Method::_code}.
+     *
+     * @return the value of {@code Method::_code}
+     */
+    private long getCompiledCode() {
+        HotSpotVMConfig config = config();
+        return UNSAFE.getAddress(metaspaceMethod + config.methodCodeOffset);
+    }
+
+    /**
+     * Returns whether this method has compiled code.
+     *
+     * @return true if this method has compiled code, false otherwise
+     */
+    public boolean hasCompiledCode() {
+        return getCompiledCode() != 0L;
+    }
+
+    /**
+     * @param level
+     * @return true if the currently installed code was generated at {@code level}.
+     */
+    public boolean hasCompiledCodeAtLevel(int level) {
+        long compiledCode = getCompiledCode();
+        if (compiledCode != 0) {
+            return UNSAFE.getInt(compiledCode + config().nmethodCompLevelOffset) == level;
+        }
+        return false;
+    }
+
+    @Override
+    public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR) {
+        ProfilingInfo info;
+
+        if (Option.UseProfilingInformation.getBoolean() && methodData == null) {
+            long metaspaceMethodData = UNSAFE.getAddress(metaspaceMethod + config().methodDataOffset);
+            if (metaspaceMethodData != 0) {
+                methodData = new HotSpotMethodData(metaspaceMethodData, this);
+                String methodDataFilter = Option.TraceMethodDataFilter.getString();
+                if (methodDataFilter != null && this.format("%H.%n").contains(methodDataFilter)) {
+                    System.out.println(methodData.toString());
+                }
+            }
+        }
+
+        if (methodData == null || (!methodData.hasNormalData() && !methodData.hasExtraData())) {
+            // Be optimistic and return false for exceptionSeen. A methodDataOop is allocated in
+            // case of a deoptimization.
+            info = DefaultProfilingInfo.get(TriState.FALSE);
+        } else {
+            info = new HotSpotProfilingInfo(methodData, this, includeNormal, includeOSR);
+        }
+        return info;
+    }
+
+    @Override
+    public void reprofile() {
+        compilerToVM().reprofile(this);
+    }
+
+    @Override
+    public ConstantPool getConstantPool() {
+        return constantPool;
+    }
+
+    @Override
+    public Parameter[] getParameters() {
+        Executable javaMethod = toJava();
+        if (javaMethod == null) {
+            return null;
+        }
+
+        java.lang.reflect.Parameter[] javaParameters = javaMethod.getParameters();
+        Parameter[] res = new Parameter[javaParameters.length];
+        for (int i = 0; i < res.length; i++) {
+            java.lang.reflect.Parameter src = javaParameters[i];
+            String paramName = src.isNamePresent() ? src.getName() : null;
+            res[i] = new Parameter(paramName, src.getModifiers(), this, i);
+        }
+        return res;
+    }
+
+    @Override
+    public Annotation[][] getParameterAnnotations() {
+        Executable javaMethod = toJava();
+        return javaMethod == null ? new Annotation[signature.getParameterCount(false)][0] : javaMethod.getParameterAnnotations();
+    }
+
+    @Override
+    public Annotation[] getAnnotations() {
+        Executable javaMethod = toJava();
+        if (javaMethod != null) {
+            return javaMethod.getAnnotations();
+        }
+        return new Annotation[0];
+    }
+
+    @Override
+    public Annotation[] getDeclaredAnnotations() {
+        Executable javaMethod = toJava();
+        if (javaMethod != null) {
+            return javaMethod.getDeclaredAnnotations();
+        }
+        return new Annotation[0];
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        Executable javaMethod = toJava();
+        return javaMethod == null ? null : javaMethod.getAnnotation(annotationClass);
+    }
+
+    public boolean isBridge() {
+        return (BRIDGE & getModifiers()) != 0;
+    }
+
+    @Override
+    public boolean isSynthetic() {
+        return (SYNTHETIC & getModifiers()) != 0;
+    }
+
+    public boolean isVarArgs() {
+        return (VARARGS & getModifiers()) != 0;
+    }
+
+    public boolean isDefault() {
+        // Copied from java.lang.Method.isDefault()
+        int mask = Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC;
+        return ((getModifiers() & mask) == Modifier.PUBLIC) && getDeclaringClass().isInterface();
+    }
+
+    @Override
+    public Type[] getGenericParameterTypes() {
+        Executable javaMethod = toJava();
+        return javaMethod == null ? null : javaMethod.getGenericParameterTypes();
+    }
+
+    public Class<?>[] signatureToTypes() {
+        Signature sig = getSignature();
+        int count = sig.getParameterCount(false);
+        Class<?>[] result = new Class<?>[count];
+        for (int i = 0; i < result.length; ++i) {
+            JavaType parameterType = sig.getParameterType(i, holder);
+            HotSpotResolvedJavaType resolvedParameterType = (HotSpotResolvedJavaType) parameterType.resolve(holder);
+            result[i] = resolvedParameterType.mirror();
+        }
+        return result;
+    }
+
+    private static Method searchMethods(Method[] methods, String name, Class<?> returnType, Class<?>[] parameterTypes) {
+        for (Method m : methods) {
+            if (m.getName().equals(name) && returnType.equals(m.getReturnType()) && Arrays.equals(m.getParameterTypes(), parameterTypes)) {
+                return m;
+            }
+        }
+        return null;
+    }
+
+    private Executable toJava() {
+        if (toJavaCache != null) {
+            return toJavaCache;
+        }
+        try {
+            Class<?>[] parameterTypes = signatureToTypes();
+            Class<?> returnType = ((HotSpotResolvedJavaType) getSignature().getReturnType(holder).resolve(holder)).mirror();
+
+            Executable result;
+            if (isConstructor()) {
+                result = holder.mirror().getDeclaredConstructor(parameterTypes);
+            } else {
+                // Do not use Method.getDeclaredMethod() as it can return a bridge method
+                // when this.isBridge() is false and vice versa.
+                result = searchMethods(holder.mirror().getDeclaredMethods(), getName(), returnType, parameterTypes);
+            }
+            toJavaCache = result;
+            return result;
+        } catch (NoSuchMethodException | NoClassDefFoundError e) {
+            return null;
+        }
+    }
+
+    @Override
+    public boolean canBeInlined() {
+        if (hasNeverInlineDirective()) {
+            return false;
+        }
+        return compilerToVM().isCompilable(this);
+    }
+
+    @Override
+    public boolean hasNeverInlineDirective() {
+        return compilerToVM().hasNeverInlineDirective(this);
+    }
+
+    @Override
+    public boolean shouldBeInlined() {
+        if (isForceInline()) {
+            return true;
+        }
+        return compilerToVM().shouldInlineMethod(this);
+    }
+
+    @Override
+    public LineNumberTable getLineNumberTable() {
+        final boolean hasLineNumberTable = (getConstMethodFlags() & config().constMethodHasLineNumberTable) != 0;
+        if (!hasLineNumberTable) {
+            return null;
+        }
+
+        long[] values = compilerToVM().getLineNumberTable(this);
+        if (values == null || values.length == 0) {
+            // Empty table so treat is as non-existent
+            return null;
+        }
+        assert values.length % 2 == 0;
+        int[] bci = new int[values.length / 2];
+        int[] line = new int[values.length / 2];
+
+        for (int i = 0; i < values.length / 2; i++) {
+            bci[i] = (int) values[i * 2];
+            line[i] = (int) values[i * 2 + 1];
+        }
+
+        return new LineNumberTable(line, bci);
+    }
+
+    @Override
+    public LocalVariableTable getLocalVariableTable() {
+        final boolean hasLocalVariableTable = (getConstMethodFlags() & config().constMethodHasLocalVariableTable) != 0;
+        if (!hasLocalVariableTable) {
+            return null;
+        }
+
+        HotSpotVMConfig config = config();
+        long localVariableTableElement = compilerToVM().getLocalVariableTableStart(this);
+        final int localVariableTableLength = compilerToVM().getLocalVariableTableLength(this);
+        Local[] locals = new Local[localVariableTableLength];
+
+        for (int i = 0; i < localVariableTableLength; i++) {
+            final int startBci = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementStartBciOffset);
+            final int endBci = startBci + UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementLengthOffset);
+            final int nameCpIndex = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementNameCpIndexOffset);
+            final int typeCpIndex = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementDescriptorCpIndexOffset);
+            final int slot = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementSlotOffset);
+
+            String localName = getConstantPool().lookupUtf8(nameCpIndex);
+            String localType = getConstantPool().lookupUtf8(typeCpIndex);
+
+            locals[i] = new Local(localName, runtime().lookupType(localType, holder, false), startBci, endBci, slot);
+
+            // Go to the next LocalVariableTableElement
+            localVariableTableElement += config.localVariableTableElementSize;
+        }
+
+        return new LocalVariableTable(locals);
+    }
+
+    /**
+     * Returns the offset of this method into the v-table. The method must have a v-table entry as
+     * indicated by {@link #isInVirtualMethodTable(ResolvedJavaType)}, otherwise an exception is
+     * thrown.
+     *
+     * @return the offset of this method into the v-table
+     */
+    public int vtableEntryOffset(ResolvedJavaType resolved) {
+        if (!isInVirtualMethodTable(resolved)) {
+            throw new JVMCIError("%s does not have a vtable entry in type %s", this, resolved);
+        }
+        HotSpotVMConfig config = config();
+        final int vtableIndex = getVtableIndex((HotSpotResolvedObjectTypeImpl) resolved);
+        return config.klassVtableStartOffset + vtableIndex * config.vtableEntrySize + config.vtableEntryMethodOffset;
+    }
+
+    @Override
+    public boolean isInVirtualMethodTable(ResolvedJavaType resolved) {
+        if (resolved instanceof HotSpotResolvedObjectTypeImpl) {
+            HotSpotResolvedObjectTypeImpl hotspotResolved = (HotSpotResolvedObjectTypeImpl) resolved;
+            int vtableIndex = getVtableIndex(hotspotResolved);
+            return vtableIndex >= 0 && vtableIndex < hotspotResolved.getVtableLength();
+        }
+        return false;
+    }
+
+    private int getVtableIndex(HotSpotResolvedObjectTypeImpl resolved) {
+        if (!holder.isLinked()) {
+            return config().invalidVtableIndex;
+        }
+        if (holder.isInterface()) {
+            if (resolved.isInterface()) {
+                return config().invalidVtableIndex;
+            }
+            return getVtableIndexForInterfaceMethod(resolved);
+        }
+        return getVtableIndex();
+    }
+
+    /**
+     * Returns this method's virtual table index.
+     *
+     * @return virtual table index
+     */
+    private int getVtableIndex() {
+        assert !holder.isInterface();
+        HotSpotVMConfig config = config();
+        int result = UNSAFE.getInt(metaspaceMethod + config.methodVtableIndexOffset);
+        assert result >= config.nonvirtualVtableIndex : "must be linked";
+        return result;
+    }
+
+    private int getVtableIndexForInterfaceMethod(ResolvedJavaType resolved) {
+        HotSpotResolvedObjectTypeImpl hotspotType = (HotSpotResolvedObjectTypeImpl) resolved;
+        return compilerToVM().getVtableIndexForInterfaceMethod(hotspotType, this);
+    }
+
+    /**
+     * The {@link SpeculationLog} for methods compiled by JVMCI hang off this per-declaring-type
+     * {@link ClassValue}. The raw Method* value is safe to use as a key in the map as a) it is
+     * never moves and b) we never read from it.
+     * <p>
+     * One implication is that we will preserve {@link SpeculationLog}s for methods that have been
+     * redefined via class redefinition. It's tempting to periodically flush such logs but we cannot
+     * read the JVM_ACC_IS_OBSOLETE bit (or anything else) via the raw pointer as obsoleted methods
+     * are subject to clean up and deletion (see InstanceKlass::purge_previous_versions_internal).
+     */
+    private static final ClassValue<Map<Long, SpeculationLog>> SpeculationLogs = new ClassValue<Map<Long, SpeculationLog>>() {
+        @Override
+        protected Map<Long, SpeculationLog> computeValue(java.lang.Class<?> type) {
+            return new HashMap<>(4);
+        }
+    };
+
+    public SpeculationLog getSpeculationLog() {
+        Map<Long, SpeculationLog> map = SpeculationLogs.get(holder.mirror());
+        synchronized (map) {
+            SpeculationLog log = map.get(this.metaspaceMethod);
+            if (log == null) {
+                log = new HotSpotSpeculationLog();
+                map.put(metaspaceMethod, log);
+            }
+            return log;
+        }
+    }
+
+    public int intrinsicId() {
+        HotSpotVMConfig config = config();
+        return UNSAFE.getChar(metaspaceMethod + config.methodIntrinsicIdOffset);
+    }
+
+    public boolean isIntrinsicCandidate() {
+        return (getFlags() & config().methodFlagsIntrinsicCandidate) != 0;
+    }
+
+    /**
+     * Allocates a compile id for this method by asking the VM for one.
+     *
+     * @param entryBCI entry bci
+     * @return compile id
+     */
+    public int allocateCompileId(int entryBCI) {
+        return compilerToVM().allocateCompileId(this, entryBCI);
+    }
+
+    public boolean hasCodeAtLevel(int entryBCI, int level) {
+        if (entryBCI == config().invocationEntryBci) {
+            return hasCompiledCodeAtLevel(level);
+        }
+        return compilerToVM().hasCompiledCodeForOSR(this, entryBCI, level);
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java
new file mode 100644
index 0000000..8d969a4
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java
@@ -0,0 +1,930 @@
+/*
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import static java.util.Objects.requireNonNull;
+import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
+import static jdk.vm.ci.hotspot.HotSpotConstantPool.isSignaturePolymorphicHolder;
+import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
+import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmClassModifiers;
+import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
+import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.nio.ByteOrder;
+import java.util.HashMap;
+
+import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.meta.Assumptions.AssumptionResult;
+import jdk.vm.ci.meta.Assumptions.ConcreteMethod;
+import jdk.vm.ci.meta.Assumptions.ConcreteSubtype;
+import jdk.vm.ci.meta.Assumptions.LeafType;
+import jdk.vm.ci.meta.Assumptions.NoFinalizableSubclass;
+import jdk.vm.ci.meta.Constant;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.JavaType;
+import jdk.vm.ci.meta.ResolvedJavaField;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+
+/**
+ * Implementation of {@link JavaType} for resolved non-primitive HotSpot classes.
+ */
+final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implements HotSpotResolvedObjectType, MetaspaceWrapperObject {
+
+    private static final HotSpotResolvedJavaField[] NO_FIELDS = new HotSpotResolvedJavaField[0];
+    private static final int METHOD_CACHE_ARRAY_CAPACITY = 8;
+
+    /**
+     * The Java class this type represents.
+     */
+    private final Class<?> javaClass;
+    private HotSpotResolvedJavaMethodImpl[] methodCacheArray;
+    private HashMap<Long, HotSpotResolvedJavaMethodImpl> methodCacheHashMap;
+    private HotSpotResolvedJavaField[] instanceFields;
+    private HotSpotResolvedObjectTypeImpl[] interfaces;
+    private HotSpotConstantPool constantPool;
+    final HotSpotJVMCIMetaAccessContext context;
+    private HotSpotResolvedObjectType arrayOfType;
+
+    /**
+     * Gets the JVMCI mirror for a {@link Class} object.
+     *
+     * @return the {@link HotSpotResolvedJavaType} corresponding to {@code javaClass}
+     */
+    static HotSpotResolvedObjectTypeImpl fromObjectClass(Class<?> javaClass) {
+        return (HotSpotResolvedObjectTypeImpl) runtime().fromClass(javaClass);
+    }
+
+    /**
+     * Gets the JVMCI mirror from a HotSpot type. Since {@link Class} is already a proxy for the
+     * underlying Klass*, it is used instead of the raw Klass*.
+     *
+     * Called from the VM.
+     *
+     * @param javaClass a {@link Class} object
+     * @return the {@link ResolvedJavaType} corresponding to {@code javaClass}
+     */
+    @SuppressWarnings("unused")
+    private static HotSpotResolvedObjectTypeImpl fromMetaspace(Class<?> javaClass) {
+        return fromObjectClass(javaClass);
+    }
+
+    /**
+     * Creates the JVMCI mirror for a {@link Class} object.
+     *
+     * <p>
+     * <b>NOTE</b>: Creating an instance of this class does not install the mirror for the
+     * {@link Class} type. Use {@link #fromObjectClass(Class)} or {@link #fromMetaspace(Class)}
+     * instead.
+     * </p>
+     *
+     * @param javaClass the Class to create the mirror for
+     * @param context
+     */
+    HotSpotResolvedObjectTypeImpl(Class<?> javaClass, HotSpotJVMCIMetaAccessContext context) {
+        super(getSignatureName(javaClass));
+        this.javaClass = javaClass;
+        this.context = context;
+        assert getName().charAt(0) != '[' || isArray() : getName();
+    }
+
+    /**
+     * Returns the name of this type as it would appear in a signature.
+     */
+    private static String getSignatureName(Class<?> javaClass) {
+        if (javaClass.isArray()) {
+            return javaClass.getName().replace('.', '/');
+        }
+        return "L" + javaClass.getName().replace('.', '/') + ";";
+    }
+
+    /**
+     * Gets the metaspace Klass for this type.
+     */
+    long getMetaspaceKlass() {
+        if (HotSpotJVMCIRuntime.getHostWordKind() == JavaKind.Long) {
+            return UNSAFE.getLong(javaClass, config().klassOffset);
+        }
+        return UNSAFE.getInt(javaClass, config().klassOffset) & 0xFFFFFFFFL;
+    }
+
+    @Override
+    public long getMetaspacePointer() {
+        return getMetaspaceKlass();
+    }
+
+    /**
+     * The Klass* for this object is kept alive by the direct reference to {@link #javaClass} so no
+     * extra work is required.
+     */
+    @Override
+    public boolean isRegistered() {
+        return true;
+    }
+
+    @Override
+    public int getModifiers() {
+        if (isArray()) {
+            return (getElementalType().getModifiers() & (Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED)) | Modifier.FINAL | Modifier.ABSTRACT;
+        } else {
+            return getAccessFlags() & jvmClassModifiers();
+        }
+    }
+
+    public int getAccessFlags() {
+        HotSpotVMConfig config = config();
+        return UNSAFE.getInt(getMetaspaceKlass() + config.klassAccessFlagsOffset);
+    }
+
+    @Override
+    public HotSpotResolvedObjectType getArrayClass() {
+        if (arrayOfType == null) {
+            arrayOfType = fromObjectClass(Array.newInstance(mirror(), 0).getClass());
+        }
+        return arrayOfType;
+    }
+
+    @Override
+    public ResolvedJavaType getComponentType() {
+        Class<?> javaComponentType = mirror().getComponentType();
+        return javaComponentType == null ? null : runtime().fromClass(javaComponentType);
+    }
+
+    @Override
+    public AssumptionResult<ResolvedJavaType> findLeafConcreteSubtype() {
+        if (isLeaf()) {
+            // No assumptions are required.
+            return new AssumptionResult<>(this);
+        }
+        HotSpotVMConfig config = config();
+        if (isArray()) {
+            ResolvedJavaType elementalType = getElementalType();
+            AssumptionResult<ResolvedJavaType> elementType = elementalType.findLeafConcreteSubtype();
+            if (elementType != null && elementType.getResult().equals(elementalType)) {
+                /*
+                 * If the elementType is leaf then the array is leaf under the same assumptions but
+                 * only if the element type is exactly the leaf type. The element type can be
+                 * abstract even if there is only one implementor of the abstract type.
+                 */
+                AssumptionResult<ResolvedJavaType> result = new AssumptionResult<>(this);
+                result.add(elementType);
+                return result;
+            }
+            return null;
+        } else if (isInterface()) {
+            HotSpotResolvedObjectTypeImpl implementor = getSingleImplementor();
+            /*
+             * If the implementor field contains itself that indicates that the interface has more
+             * than one implementors (see: InstanceKlass::add_implementor).
+             */
+            if (implementor == null || implementor.equals(this)) {
+                return null;
+            }
+
+            assert !implementor.isInterface();
+            if (implementor.isAbstract() || !implementor.isLeafClass()) {
+                AssumptionResult<ResolvedJavaType> leafConcreteSubtype = implementor.findLeafConcreteSubtype();
+                if (leafConcreteSubtype != null) {
+                    assert !leafConcreteSubtype.getResult().equals(implementor);
+                    AssumptionResult<ResolvedJavaType> newResult = new AssumptionResult<>(leafConcreteSubtype.getResult(), new ConcreteSubtype(this, implementor));
+                    // Accumulate leaf assumptions and return the combined result.
+                    newResult.add(leafConcreteSubtype);
+                    return newResult;
+                }
+                return null;
+            }
+            return concreteSubtype(implementor);
+        } else {
+            HotSpotResolvedObjectTypeImpl type = this;
+            while (type.isAbstract()) {
+                HotSpotResolvedObjectTypeImpl subklass = type.getSubklass();
+                if (subklass == null || UNSAFE.getAddress(subklass.getMetaspaceKlass() + config.nextSiblingOffset) != 0) {
+                    return null;
+                }
+                type = subklass;
+            }
+            if (type.isAbstract() || type.isInterface() || !type.isLeafClass()) {
+                return null;
+            }
+            if (this.isAbstract()) {
+                return concreteSubtype(type);
+            } else {
+                assert this.equals(type);
+                return new AssumptionResult<>(type, new LeafType(type));
+            }
+        }
+    }
+
+    private AssumptionResult<ResolvedJavaType> concreteSubtype(HotSpotResolvedObjectTypeImpl type) {
+        if (type.isLeaf()) {
+            return new AssumptionResult<>(type, new ConcreteSubtype(this, type));
+        } else {
+            return new AssumptionResult<>(type, new LeafType(type), new ConcreteSubtype(this, type));
+        }
+    }
+
+    /**
+     * Returns if type {@code type} is a leaf class. This is the case if the
+     * {@code Klass::_subklass} field of the underlying class is zero.
+     *
+     * @return true if the type is a leaf class
+     */
+    private boolean isLeafClass() {
+        return UNSAFE.getLong(this.getMetaspaceKlass() + config().subklassOffset) == 0;
+    }
+
+    /**
+     * Returns the {@code Klass::_subklass} field of the underlying metaspace klass for the given
+     * type {@code type}.
+     *
+     * @return value of the subklass field as metaspace klass pointer
+     */
+    private HotSpotResolvedObjectTypeImpl getSubklass() {
+        return compilerToVM().getResolvedJavaType(this, config().subklassOffset, false);
+    }
+
+    @Override
+    public HotSpotResolvedObjectTypeImpl getSuperclass() {
+        Class<?> javaSuperclass = mirror().getSuperclass();
+        return javaSuperclass == null ? null : fromObjectClass(javaSuperclass);
+    }
+
+    @Override
+    public HotSpotResolvedObjectTypeImpl[] getInterfaces() {
+        if (interfaces == null) {
+            Class<?>[] javaInterfaces = mirror().getInterfaces();
+            HotSpotResolvedObjectTypeImpl[] result = new HotSpotResolvedObjectTypeImpl[javaInterfaces.length];
+            for (int i = 0; i < javaInterfaces.length; i++) {
+                result[i] = fromObjectClass(javaInterfaces[i]);
+            }
+            interfaces = result;
+        }
+        return interfaces;
+    }
+
+    @Override
+    public HotSpotResolvedObjectTypeImpl getSingleImplementor() {
+        if (!isInterface()) {
+            throw new JVMCIError("Cannot call getSingleImplementor() on a non-interface type: %s", this);
+        }
+        return compilerToVM().getImplementor(this);
+    }
+
+    public HotSpotResolvedObjectTypeImpl getSupertype() {
+        if (isArray()) {
+            ResolvedJavaType componentType = getComponentType();
+            if (mirror() == Object[].class || componentType.isPrimitive()) {
+                return fromObjectClass(Object.class);
+            }
+            return (HotSpotResolvedObjectTypeImpl) ((HotSpotResolvedObjectTypeImpl) componentType).getSupertype().getArrayClass();
+        }
+        if (isInterface()) {
+            return fromObjectClass(Object.class);
+        }
+        return getSuperclass();
+    }
+
+    @Override
+    public HotSpotResolvedObjectType findLeastCommonAncestor(ResolvedJavaType otherType) {
+        if (otherType.isPrimitive()) {
+            return null;
+        } else {
+            HotSpotResolvedObjectTypeImpl t1 = this;
+            HotSpotResolvedObjectTypeImpl t2 = (HotSpotResolvedObjectTypeImpl) otherType;
+            while (true) {
+                if (t1.isAssignableFrom(t2)) {
+                    return t1;
+                }
+                if (t2.isAssignableFrom(t1)) {
+                    return t2;
+                }
+                t1 = t1.getSupertype();
+                t2 = t2.getSupertype();
+            }
+        }
+    }
+
+    @Override
+    public AssumptionResult<Boolean> hasFinalizableSubclass() {
+        assert !isArray();
+        if (!compilerToVM().hasFinalizableSubclass(this)) {
+            return new AssumptionResult<>(false, new NoFinalizableSubclass(this));
+        }
+        return new AssumptionResult<>(true);
+    }
+
+    @Override
+    public boolean hasFinalizer() {
+        return (getAccessFlags() & config().jvmAccHasFinalizer) != 0;
+    }
+
+    @Override
+    public boolean isPrimitive() {
+        return false;
+    }
+
+    @Override
+    public boolean isArray() {
+        return mirror().isArray();
+    }
+
+    @Override
+    public boolean isInitialized() {
+        return isArray() ? true : getInitState() == config().instanceKlassStateFullyInitialized;
+    }
+
+    @Override
+    public boolean isLinked() {
+        return isArray() ? true : getInitState() >= config().instanceKlassStateLinked;
+    }
+
+    /**
+     * Returns the value of the state field {@code InstanceKlass::_init_state} of the metaspace
+     * klass.
+     *
+     * @return state field value of this type
+     */
+    private int getInitState() {
+        assert !isArray() : "_init_state only exists in InstanceKlass";
+        return UNSAFE.getByte(getMetaspaceKlass() + config().instanceKlassInitStateOffset) & 0xFF;
+    }
+
+    @Override
+    public void initialize() {
+        if (!isInitialized()) {
+            UNSAFE.ensureClassInitialized(mirror());
+            assert isInitialized();
+        }
+    }
+
+    @Override
+    public boolean isInstance(JavaConstant obj) {
+        if (obj.getJavaKind() == JavaKind.Object && !obj.isNull()) {
+            return mirror().isInstance(((HotSpotObjectConstantImpl) obj).object());
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isInstanceClass() {
+        return !isArray() && !isInterface();
+    }
+
+    @Override
+    public boolean isInterface() {
+        return mirror().isInterface();
+    }
+
+    @Override
+    public boolean isAssignableFrom(ResolvedJavaType other) {
+        assert other != null;
+        if (other instanceof HotSpotResolvedObjectTypeImpl) {
+            HotSpotResolvedObjectTypeImpl otherType = (HotSpotResolvedObjectTypeImpl) other;
+            return mirror().isAssignableFrom(otherType.mirror());
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isJavaLangObject() {
+        return javaClass.equals(Object.class);
+    }
+
+    @Override
+    public JavaKind getJavaKind() {
+        return JavaKind.Object;
+    }
+
+    @Override
+    public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType) {
+        assert !callerType.isArray();
+        if (isInterface()) {
+            // Methods can only be resolved against concrete types
+            return null;
+        }
+        if (method.isConcrete() && method.getDeclaringClass().equals(this) && method.isPublic() && !isSignaturePolymorphicHolder(method.getDeclaringClass())) {
+            return method;
+        }
+        if (!method.getDeclaringClass().isAssignableFrom(this)) {
+            return null;
+        }
+        HotSpotResolvedJavaMethodImpl hotSpotMethod = (HotSpotResolvedJavaMethodImpl) method;
+        HotSpotResolvedObjectTypeImpl hotSpotCallerType = (HotSpotResolvedObjectTypeImpl) callerType;
+        return compilerToVM().resolveMethod(this, hotSpotMethod, hotSpotCallerType);
+    }
+
+    public HotSpotConstantPool getConstantPool() {
+        if (constantPool == null || !isArray() && UNSAFE.getAddress(getMetaspaceKlass() + config().instanceKlassConstantsOffset) != constantPool.getMetaspaceConstantPool()) {
+            /*
+             * If the pointer to the ConstantPool has changed since this was last read refresh the
+             * HotSpotConstantPool wrapper object. This ensures that uses of the constant pool are
+             * operating on the latest one and that HotSpotResolvedJavaMethodImpls will be able to
+             * use the shared copy instead of creating their own instance.
+             */
+            constantPool = compilerToVM().getConstantPool(this);
+        }
+        return constantPool;
+    }
+
+    /**
+     * Gets the instance size of this type. If an instance of this type cannot be fast path
+     * allocated, then the returned value is negative (its absolute value gives the size). Must not
+     * be called if this is an array or interface type.
+     */
+    public int instanceSize() {
+        assert !isArray();
+        assert !isInterface();
+
+        HotSpotVMConfig config = config();
+        final int layoutHelper = layoutHelper();
+        assert layoutHelper > config.klassLayoutHelperNeutralValue : "must be instance";
+
+        // See: Klass::layout_helper_size_in_bytes
+        int size = layoutHelper & ~config.klassLayoutHelperInstanceSlowPathBit;
+
+        // See: Klass::layout_helper_needs_slow_path
+        boolean needsSlowPath = (layoutHelper & config.klassLayoutHelperInstanceSlowPathBit) != 0;
+
+        return needsSlowPath ? -size : size;
+    }
+
+    public int layoutHelper() {
+        HotSpotVMConfig config = config();
+        return UNSAFE.getInt(getMetaspaceKlass() + config.klassLayoutHelperOffset);
+    }
+
+    @Override
+    public long getFingerprint() {
+        return compilerToVM().getFingerprint(getMetaspaceKlass());
+    }
+
+    synchronized HotSpotResolvedJavaMethod createMethod(long metaspaceMethod) {
+        // Maintain cache as array.
+        if (methodCacheArray == null) {
+            methodCacheArray = new HotSpotResolvedJavaMethodImpl[METHOD_CACHE_ARRAY_CAPACITY];
+        }
+
+        int i = 0;
+        for (; i < methodCacheArray.length; ++i) {
+            HotSpotResolvedJavaMethodImpl curMethod = methodCacheArray[i];
+            if (curMethod == null) {
+                HotSpotResolvedJavaMethodImpl newMethod = new HotSpotResolvedJavaMethodImpl(this, metaspaceMethod);
+                methodCacheArray[i] = newMethod;
+                context.add(newMethod);
+                return newMethod;
+            } else if (curMethod.getMetaspacePointer() == metaspaceMethod) {
+                return curMethod;
+            }
+        }
+
+        // Fall-back to hash table.
+        if (methodCacheHashMap == null) {
+            methodCacheHashMap = new HashMap<>();
+        }
+
+        HotSpotResolvedJavaMethodImpl lookupResult = methodCacheHashMap.get(metaspaceMethod);
+        if (lookupResult == null) {
+            HotSpotResolvedJavaMethodImpl newMethod = new HotSpotResolvedJavaMethodImpl(this, metaspaceMethod);
+            methodCacheHashMap.put(metaspaceMethod, newMethod);
+            context.add(lookupResult);
+            return newMethod;
+        } else {
+            return lookupResult;
+        }
+    }
+
+    public int getVtableLength() {
+        HotSpotVMConfig config = config();
+        if (isInterface() || isArray()) {
+            /* Everything has the core vtable of java.lang.Object */
+            return config.baseVtableLength();
+        }
+        int result = UNSAFE.getInt(getMetaspaceKlass() + config.klassVtableLengthOffset) / (config.vtableEntrySize / config.heapWordSize);
+        assert result >= config.baseVtableLength() : UNSAFE.getInt(getMetaspaceKlass() + config.klassVtableLengthOffset) + " " + config.vtableEntrySize;
+        return result;
+    }
+
+    synchronized HotSpotResolvedJavaField createField(JavaType type, long offset, int rawFlags, int index) {
+        return new HotSpotResolvedJavaFieldImpl(this, type, offset, rawFlags, index);
+    }
+
+    @Override
+    public AssumptionResult<ResolvedJavaMethod> findUniqueConcreteMethod(ResolvedJavaMethod method) {
+        HotSpotResolvedJavaMethod hmethod = (HotSpotResolvedJavaMethod) method;
+        HotSpotResolvedObjectType declaredHolder = hmethod.getDeclaringClass();
+        /*
+         * Sometimes the receiver type in the graph hasn't stabilized to a subtype of declared
+         * holder, usually because of phis, so make sure that the type is related to the declared
+         * type before using it for lookup. Unlinked types should also be ignored because we can't
+         * resolve the proper method to invoke. Generally unlinked types in invokes should result in
+         * a deopt instead since they can't really be used if they aren't linked yet.
+         */
+        if (!declaredHolder.isAssignableFrom(this) || this.isArray() || this.equals(declaredHolder) || !isLinked() || isInterface()) {
+            ResolvedJavaMethod result = hmethod.uniqueConcreteMethod(declaredHolder);
+            if (result != null) {
+                return new AssumptionResult<>(result, new ConcreteMethod(method, declaredHolder, result));
+            }
+            return null;
+        }
+        /*
+         * The holder may be a subtype of the declaredHolder so make sure to resolve the method to
+         * the correct method for the subtype.
+         */
+        HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) resolveMethod(hmethod, this);
+        if (resolvedMethod == null) {
+            // The type isn't known to implement the method.
+            return null;
+        }
+
+        ResolvedJavaMethod result = resolvedMethod.uniqueConcreteMethod(this);
+        if (result != null) {
+            return new AssumptionResult<>(result, new ConcreteMethod(method, this, result));
+        }
+        return null;
+    }
+
+    FieldInfo createFieldInfo(int index) {
+        return new FieldInfo(index);
+    }
+
+    /**
+     * This class represents the field information for one field contained in the fields array of an
+     * {@code InstanceKlass}. The implementation is similar to the native {@code FieldInfo} class.
+     */
+    class FieldInfo {
+        /**
+         * Native pointer into the array of Java shorts.
+         */
+        private final long metaspaceData;
+
+        /**
+         * Creates a field info for the field in the fields array at index {@code index}.
+         *
+         * @param index index to the fields array
+         */
+        FieldInfo(int index) {
+            HotSpotVMConfig config = config();
+            // Get Klass::_fields
+            final long metaspaceFields = UNSAFE.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
+            assert config.fieldInfoFieldSlots == 6 : "revisit the field parsing code";
+            int offset = config.fieldInfoFieldSlots * Short.BYTES * index;
+            metaspaceData = metaspaceFields + config.arrayU2DataOffset + offset;
+        }
+
+        private int getAccessFlags() {
+            return readFieldSlot(config().fieldInfoAccessFlagsOffset);
+        }
+
+        private int getNameIndex() {
+            return readFieldSlot(config().fieldInfoNameIndexOffset);
+        }
+
+        private int getSignatureIndex() {
+            return readFieldSlot(config().fieldInfoSignatureIndexOffset);
+        }
+
+        public int getOffset() {
+            HotSpotVMConfig config = config();
+            final int lowPacked = readFieldSlot(config.fieldInfoLowPackedOffset);
+            final int highPacked = readFieldSlot(config.fieldInfoHighPackedOffset);
+            final int offset = ((highPacked << Short.SIZE) | lowPacked) >> config.fieldInfoTagSize;
+            return offset;
+        }
+
+        /**
+         * Helper method to read an entry (slot) from the field array. Currently field info is laid
+         * on top an array of Java shorts.
+         */
+        private int readFieldSlot(int index) {
+            int offset = Short.BYTES * index;
+            return UNSAFE.getChar(metaspaceData + offset);
+        }
+
+        /**
+         * Returns the name of this field as a {@link String}. If the field is an internal field the
+         * name index is pointing into the vmSymbols table.
+         */
+        public String getName() {
+            final int nameIndex = getNameIndex();
+            return isInternal() ? config().symbolAt(nameIndex) : getConstantPool().lookupUtf8(nameIndex);
+        }
+
+        /**
+         * Returns the signature of this field as {@link String}. If the field is an internal field
+         * the signature index is pointing into the vmSymbols table.
+         */
+        public String getSignature() {
+            final int signatureIndex = getSignatureIndex();
+            return isInternal() ? config().symbolAt(signatureIndex) : getConstantPool().lookupUtf8(signatureIndex);
+        }
+
+        public JavaType getType() {
+            String signature = getSignature();
+            return runtime().lookupType(signature, HotSpotResolvedObjectTypeImpl.this, false);
+        }
+
+        private boolean isInternal() {
+            return (getAccessFlags() & config().jvmAccFieldInternal) != 0;
+        }
+
+        public boolean isStatic() {
+            return Modifier.isStatic(getAccessFlags());
+        }
+
+        public boolean hasGenericSignature() {
+            return (getAccessFlags() & config().jvmAccFieldHasGenericSignature) != 0;
+        }
+    }
+
+    @Override
+    public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses) {
+        if (instanceFields == null) {
+            if (isArray() || isInterface()) {
+                instanceFields = NO_FIELDS;
+            } else {
+                HotSpotResolvedJavaField[] prepend = NO_FIELDS;
+                if (getSuperclass() != null) {
+                    prepend = (HotSpotResolvedJavaField[]) getSuperclass().getInstanceFields(true);
+                }
+                instanceFields = getFields(false, prepend);
+            }
+        }
+        if (!includeSuperclasses && getSuperclass() != null) {
+            int superClassFieldCount = getSuperclass().getInstanceFields(true).length;
+            if (superClassFieldCount == instanceFields.length) {
+                // This class does not have any instance fields of its own.
+                return NO_FIELDS;
+            } else if (superClassFieldCount != 0) {
+                HotSpotResolvedJavaField[] result = new HotSpotResolvedJavaField[instanceFields.length - superClassFieldCount];
+                System.arraycopy(instanceFields, superClassFieldCount, result, 0, result.length);
+                return result;
+            } else {
+                // The super classes of this class do not have any instance fields.
+            }
+        }
+        return instanceFields;
+    }
+
+    @Override
+    public ResolvedJavaField[] getStaticFields() {
+        if (isArray()) {
+            return new HotSpotResolvedJavaField[0];
+        } else {
+            return getFields(true, NO_FIELDS);
+        }
+    }
+
+    /**
+     * Gets the instance or static fields of this class.
+     *
+     * @param retrieveStaticFields specifies whether to return instance or static fields
+     * @param prepend an array to be prepended to the returned result
+     */
+    private HotSpotResolvedJavaField[] getFields(boolean retrieveStaticFields, HotSpotResolvedJavaField[] prepend) {
+        HotSpotVMConfig config = config();
+        final long metaspaceFields = UNSAFE.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
+        int metaspaceFieldsLength = UNSAFE.getInt(metaspaceFields + config.arrayU1LengthOffset);
+        int resultCount = 0;
+        int index = 0;
+        for (int i = 0; i < metaspaceFieldsLength; i += config.fieldInfoFieldSlots, index++) {
+            FieldInfo field = new FieldInfo(index);
+            if (field.hasGenericSignature()) {
+                metaspaceFieldsLength--;
+            }
+
+            if (field.isStatic() == retrieveStaticFields) {
+                resultCount++;
+            }
+        }
+
+        if (resultCount == 0) {
+            return prepend;
+        }
+
+        int prependLength = prepend.length;
+        resultCount += prependLength;
+
+        HotSpotResolvedJavaField[] result = new HotSpotResolvedJavaField[resultCount];
+        if (prependLength != 0) {
+            System.arraycopy(prepend, 0, result, 0, prependLength);
+        }
+
+        int resultIndex = prependLength;
+        for (int i = 0; i < index; ++i) {
+            FieldInfo field = new FieldInfo(i);
+            if (field.isStatic() == retrieveStaticFields) {
+                int offset = field.getOffset();
+                HotSpotResolvedJavaField resolvedJavaField = createField(field.getType(), offset, field.getAccessFlags(), i);
+
+                // Make sure the result is sorted by offset.
+                int j;
+                for (j = resultIndex - 1; j >= prependLength && result[j].offset() > offset; j--) {
+                    result[j + 1] = result[j];
+                }
+                result[j + 1] = resolvedJavaField;
+                resultIndex++;
+            }
+        }
+
+        return result;
+    }
+
+    @Override
+    public Class<?> mirror() {
+        return javaClass;
+    }
+
+    @Override
+    public String getSourceFileName() {
+        HotSpotVMConfig config = config();
+        final int sourceFileNameIndex = UNSAFE.getChar(getMetaspaceKlass() + config.instanceKlassSourceFileNameIndexOffset);
+        if (sourceFileNameIndex == 0) {
+            return null;
+        }
+        return getConstantPool().lookupUtf8(sourceFileNameIndex);
+    }
+
+    @Override
+    public Annotation[] getAnnotations() {
+        return mirror().getAnnotations();
+    }
+
+    @Override
+    public Annotation[] getDeclaredAnnotations() {
+        return mirror().getDeclaredAnnotations();
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        return mirror().getAnnotation(annotationClass);
+    }
+
+    /**
+     * Performs a fast-path check that this type is resolved in the context of a given accessing
+     * class. A negative result does not mean this type is not resolved with respect to
+     * {@code accessingClass}. That can only be determined by
+     * {@linkplain HotSpotJVMCIRuntime#lookupType(String, HotSpotResolvedObjectType, boolean)
+     * re-resolving} the type.
+     */
+    public boolean isDefinitelyResolvedWithRespectTo(ResolvedJavaType accessingClass) {
+        assert accessingClass != null;
+        ResolvedJavaType elementType = getElementalType();
+        if (elementType.isPrimitive()) {
+            // Primitive type resolution is context free.
+            return true;
+        }
+        if (elementType.getName().startsWith("Ljava/")) {
+            // Classes in a java.* package can only be defined by the
+            // boot class loader. This is enforced by ClassLoader.preDefineClass()
+            assert mirror().getClassLoader() == null;
+            return true;
+        }
+        ClassLoader thisCl = mirror().getClassLoader();
+        ClassLoader accessingClassCl = ((HotSpotResolvedObjectTypeImpl) accessingClass).mirror().getClassLoader();
+        return thisCl == accessingClassCl;
+    }
+
+    @Override
+    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
+        if (isDefinitelyResolvedWithRespectTo(requireNonNull(accessingClass))) {
+            return this;
+        }
+        HotSpotResolvedObjectTypeImpl accessingType = (HotSpotResolvedObjectTypeImpl) accessingClass;
+        return (ResolvedJavaType) runtime().lookupType(getName(), accessingType, true);
+    }
+
+    /**
+     * Gets the metaspace Klass boxed in a {@link JavaConstant}.
+     */
+    public Constant klass() {
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(this, false);
+    }
+
+    public boolean isPrimaryType() {
+        return config().secondarySuperCacheOffset != superCheckOffset();
+    }
+
+    public int superCheckOffset() {
+        HotSpotVMConfig config = config();
+        return UNSAFE.getInt(getMetaspaceKlass() + config.superCheckOffsetOffset);
+    }
+
+    public long prototypeMarkWord() {
+        HotSpotVMConfig config = config();
+        if (isArray()) {
+            return config.arrayPrototypeMarkWord();
+        } else {
+            return UNSAFE.getAddress(getMetaspaceKlass() + config.prototypeMarkWordOffset);
+        }
+    }
+
+    @Override
+    public ResolvedJavaField findInstanceFieldWithOffset(long offset, JavaKind expectedEntryKind) {
+        ResolvedJavaField[] declaredFields = getInstanceFields(true);
+        return findFieldWithOffset(offset, expectedEntryKind, declaredFields);
+    }
+
+    public ResolvedJavaField findStaticFieldWithOffset(long offset, JavaKind expectedEntryKind) {
+        ResolvedJavaField[] declaredFields = getStaticFields();
+        return findFieldWithOffset(offset, expectedEntryKind, declaredFields);
+    }
+
+    private static ResolvedJavaField findFieldWithOffset(long offset, JavaKind expectedEntryKind, ResolvedJavaField[] declaredFields) {
+        for (ResolvedJavaField field : declaredFields) {
+            HotSpotResolvedJavaField resolvedField = (HotSpotResolvedJavaField) field;
+            long resolvedFieldOffset = resolvedField.offset();
+            // @formatter:off
+            if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN  &&
+                            expectedEntryKind.isPrimitive() &&
+                            !expectedEntryKind.equals(JavaKind.Void) &&
+                            resolvedField.getJavaKind().isPrimitive()) {
+                resolvedFieldOffset +=
+                                resolvedField.getJavaKind().getByteCount() -
+                                Math.min(resolvedField.getJavaKind().getByteCount(), 4 + expectedEntryKind.getByteCount());
+            }
+            if (resolvedFieldOffset == offset) {
+                return field;
+            }
+            // @formatter:on
+        }
+        return null;
+    }
+
+    @Override
+    public boolean isLocal() {
+        return mirror().isLocalClass();
+    }
+
+    @Override
+    public boolean isMember() {
+        return mirror().isMemberClass();
+    }
+
+    @Override
+    public HotSpotResolvedObjectTypeImpl getEnclosingType() {
+        final Class<?> encl = mirror().getEnclosingClass();
+        return encl == null ? null : fromObjectClass(encl);
+    }
+
+    @Override
+    public ResolvedJavaMethod[] getDeclaredConstructors() {
+        Constructor<?>[] constructors = mirror().getDeclaredConstructors();
+        ResolvedJavaMethod[] result = new ResolvedJavaMethod[constructors.length];
+        for (int i = 0; i < constructors.length; i++) {
+            result[i] = runtime().getHostJVMCIBackend().getMetaAccess().lookupJavaMethod(constructors[i]);
+            assert result[i].isConstructor();
+        }
+        return result;
+    }
+
+    @Override
+    public ResolvedJavaMethod[] getDeclaredMethods() {
+        Method[] methods = mirror().getDeclaredMethods();
+        ResolvedJavaMethod[] result = new ResolvedJavaMethod[methods.length];
+        for (int i = 0; i < methods.length; i++) {
+            result[i] = runtime().getHostJVMCIBackend().getMetaAccess().lookupJavaMethod(methods[i]);
+            assert !result[i].isConstructor();
+        }
+        return result;
+    }
+
+    public ResolvedJavaMethod getClassInitializer() {
+        return compilerToVM().getClassInitializer(this);
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotType<" + getName() + ", resolved>";
+    }
+
+    @Override
+    public boolean isCloneableWithAllocation() {
+        return (getAccessFlags() & config().jvmAccIsCloneableFast) != 0;
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotRuntimeStub.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotRuntimeStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotRuntimeStub.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotRuntimeStub.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
new file mode 100644
index 0000000..25f6153
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
@@ -0,0 +1,376 @@
+/*
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
+import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
+
+import jdk.internal.misc.Unsafe;
+
+/**
+ * Used to access native configuration details.
+ *
+ * All non-static, public fields in this class are so that they can be compiled as constants.
+ */
+class HotSpotVMConfig extends HotSpotVMConfigAccess {
+
+    /**
+     * Gets the configuration associated with the singleton {@link HotSpotJVMCIRuntime}.
+     */
+    static HotSpotVMConfig config() {
+        return runtime().getConfig();
+    }
+
+    private final String osArch = getHostArchitectureName();
+
+    HotSpotVMConfig(HotSpotVMConfigStore store) {
+        super(store);
+    }
+
+    /**
+     * Gets the host architecture name for the purpose of finding the corresponding
+     * {@linkplain HotSpotJVMCIBackendFactory backend}.
+     */
+    String getHostArchitectureName() {
+        String arch = System.getProperty("os.arch");
+        switch (arch) {
+            case "x86_64":
+                return "amd64";
+
+            case "sparcv9":
+                return "sparc";
+            default:
+                return arch;
+        }
+    }
+
+    final boolean useDeferredInitBarriers = getFlag("ReduceInitialCardMarks", Boolean.class);
+
+    final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
+
+    final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, "markOop");
+    final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*");
+    final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*");
+    final int superCheckOffsetOffset = getFieldOffset("Klass::_super_check_offset", Integer.class, "juint");
+    final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*");
+
+    /**
+     * The offset of the _java_mirror field (of type {@link Class}) in a Klass.
+     */
+    final int classMirrorOffset = getFieldOffset("Klass::_java_mirror", Integer.class, "oop");
+
+    final int klassAccessFlagsOffset = getFieldOffset("Klass::_access_flags", Integer.class, "AccessFlags");
+    final int klassLayoutHelperOffset = getFieldOffset("Klass::_layout_helper", Integer.class, "jint");
+
+    final int klassLayoutHelperNeutralValue = getConstant("Klass::_lh_neutral_value", Integer.class);
+    final int klassLayoutHelperInstanceSlowPathBit = getConstant("Klass::_lh_instance_slow_path_bit", Integer.class);
+
+    final int vtableEntrySize = getFieldValue("CompilerToVM::Data::sizeof_vtableEntry", Integer.class, "int");
+    final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*");
+
+    final int instanceKlassSourceFileNameIndexOffset = getFieldOffset("InstanceKlass::_source_file_name_index", Integer.class, "u2");
+    final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1");
+    final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*");
+    final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*");
+    final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int");
+    final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int");
+
+    final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class);
+    final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class);
+
+    final int arrayU1LengthOffset = getFieldOffset("Array<int>::_length", Integer.class, "int");
+    final int arrayU1DataOffset = getFieldOffset("Array<u1>::_data", Integer.class);
+    final int arrayU2DataOffset = getFieldOffset("Array<u2>::_data", Integer.class);
+
+    final int fieldInfoAccessFlagsOffset = getConstant("FieldInfo::access_flags_offset", Integer.class);
+    final int fieldInfoNameIndexOffset = getConstant("FieldInfo::name_index_offset", Integer.class);
+    final int fieldInfoSignatureIndexOffset = getConstant("FieldInfo::signature_index_offset", Integer.class);
+    final int fieldInfoLowPackedOffset = getConstant("FieldInfo::low_packed_offset", Integer.class);
+    final int fieldInfoHighPackedOffset = getConstant("FieldInfo::high_packed_offset", Integer.class);
+    final int fieldInfoFieldSlots = getConstant("FieldInfo::field_slots", Integer.class);
+
+    final int fieldInfoTagSize = getConstant("FIELDINFO_TAG_SIZE", Integer.class);
+
+    final int jvmAccHasFinalizer = getConstant("JVM_ACC_HAS_FINALIZER", Integer.class);
+    final int jvmAccFieldInternal = getConstant("JVM_ACC_FIELD_INTERNAL", Integer.class);
+    final int jvmAccFieldStable = getConstant("JVM_ACC_FIELD_STABLE", Integer.class);
+    final int jvmAccFieldHasGenericSignature = getConstant("JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE", Integer.class);
+    final int jvmAccIsCloneableFast = getConstant("JVM_ACC_IS_CLONEABLE_FAST", Integer.class);
+
+    // These modifiers are not public in Modifier so we get them via vmStructs.
+    final int jvmAccSynthetic = getConstant("JVM_ACC_SYNTHETIC", Integer.class);
+    final int jvmAccAnnotation = getConstant("JVM_ACC_ANNOTATION", Integer.class);
+    final int jvmAccBridge = getConstant("JVM_ACC_BRIDGE", Integer.class);
+    final int jvmAccVarargs = getConstant("JVM_ACC_VARARGS", Integer.class);
+    final int jvmAccEnum = getConstant("JVM_ACC_ENUM", Integer.class);
+
+    // This is only valid on AMD64.
+    final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, osArch.equals("amd64") ? null : 0);
+
+    private final int markWordNoHashInPlace = getConstant("markOopDesc::no_hash_in_place", Integer.class);
+    private final int markWordNoLockInPlace = getConstant("markOopDesc::no_lock_in_place", Integer.class);
+
+    /**
+     * See {@code markOopDesc::prototype()}.
+     */
+    long arrayPrototypeMarkWord() {
+        return markWordNoHashInPlace | markWordNoLockInPlace;
+    }
+
+    final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags");
+    final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*");
+    final int methodIntrinsicIdOffset = getFieldOffset("Method::_intrinsic_id", Integer.class, "u2");
+    final int methodFlagsOffset = getFieldOffset("Method::_flags", Integer.class, "u2");
+    final int methodVtableIndexOffset = getFieldOffset("Method::_vtable_index", Integer.class, "int");
+
+    final int methodDataOffset = getFieldOffset("Method::_method_data", Integer.class, "MethodData*");
+    final int methodCodeOffset = getFieldOffset("Method::_code", Integer.class, "CompiledMethod*");
+
+    final int methodFlagsCallerSensitive = getConstant("Method::_caller_sensitive", Integer.class);
+    final int methodFlagsForceInline = getConstant("Method::_force_inline", Integer.class);
+    final int methodFlagsIntrinsicCandidate = getConstant("Method::_intrinsic_candidate", Integer.class);
+    final int methodFlagsDontInline = getConstant("Method::_dont_inline", Integer.class);
+    final int methodFlagsReservedStackAccess = getConstant("Method::_reserved_stack_access", Integer.class);
+    final int nonvirtualVtableIndex = getConstant("Method::nonvirtual_vtable_index", Integer.class);
+    final int invalidVtableIndex = getConstant("Method::invalid_vtable_index", Integer.class);
+
+    final int methodDataSize = getFieldOffset("MethodData::_size", Integer.class, "int");
+    final int methodDataDataSize = getFieldOffset("MethodData::_data_size", Integer.class, "int");
+    final int methodDataOopDataOffset = getFieldOffset("MethodData::_data[0]", Integer.class, "intptr_t");
+    final int methodDataOopTrapHistoryOffset = getFieldOffset("MethodData::_trap_hist._array[0]", Integer.class, "u1");
+    final int methodDataIRSizeOffset = getFieldOffset("MethodData::_jvmci_ir_size", Integer.class, "int");
+
+    final int methodDataDecompiles = getFieldOffset("MethodData::_nof_decompiles", Integer.class, "uint");
+    final int methodDataOverflowRecompiles = getFieldOffset("MethodData::_nof_overflow_recompiles", Integer.class, "uint");
+    final int methodDataOverflowTraps = getFieldOffset("MethodData::_nof_overflow_traps", Integer.class, "uint");
+
+    final int nmethodCompLevelOffset = getFieldOffset("nmethod::_comp_level", Integer.class, "int");
+
+    final int compilationLevelNone = getConstant("CompLevel_none", Integer.class);
+    final int compilationLevelSimple = getConstant("CompLevel_simple", Integer.class);
+    final int compilationLevelLimitedProfile = getConstant("CompLevel_limited_profile", Integer.class);
+    final int compilationLevelFullProfile = getConstant("CompLevel_full_profile", Integer.class);
+    final int compilationLevelFullOptimization = getConstant("CompLevel_full_optimization", Integer.class);
+
+    final int compLevelAdjustmentNone = getConstant("JVMCIRuntime::none", Integer.class);
+    final int compLevelAdjustmentByHolder = getConstant("JVMCIRuntime::by_holder", Integer.class);
+    final int compLevelAdjustmentByFullSignature = getConstant("JVMCIRuntime::by_full_signature", Integer.class);
+
+    final int invocationEntryBci = getConstant("InvocationEntryBci", Integer.class);
+
+    final int extraStackEntries = getFieldValue("CompilerToVM::Data::Method_extra_stack_entries", Integer.class, "int");
+
+    final int constMethodConstantsOffset = getFieldOffset("ConstMethod::_constants", Integer.class, "ConstantPool*");
+    final int constMethodFlagsOffset = getFieldOffset("ConstMethod::_flags", Integer.class, "u2");
+    final int constMethodCodeSizeOffset = getFieldOffset("ConstMethod::_code_size", Integer.class, "u2");
+    final int constMethodNameIndexOffset = getFieldOffset("ConstMethod::_name_index", Integer.class, "u2");
+    final int constMethodSignatureIndexOffset = getFieldOffset("ConstMethod::_signature_index", Integer.class, "u2");
+    final int constMethodMaxStackOffset = getFieldOffset("ConstMethod::_max_stack", Integer.class, "u2");
+    final int methodMaxLocalsOffset = getFieldOffset("ConstMethod::_max_locals", Integer.class, "u2");
+
+    final int constMethodHasLineNumberTable = getConstant("ConstMethod::_has_linenumber_table", Integer.class);
+    final int constMethodHasLocalVariableTable = getConstant("ConstMethod::_has_localvariable_table", Integer.class);
+    final int constMethodHasExceptionTable = getConstant("ConstMethod::_has_exception_table", Integer.class);
+
+    final int exceptionTableElementSize = getFieldValue("CompilerToVM::Data::sizeof_ExceptionTableElement", Integer.class, "int");
+    final int exceptionTableElementStartPcOffset = getFieldOffset("ExceptionTableElement::start_pc", Integer.class, "u2");
+    final int exceptionTableElementEndPcOffset = getFieldOffset("ExceptionTableElement::end_pc", Integer.class, "u2");
+    final int exceptionTableElementHandlerPcOffset = getFieldOffset("ExceptionTableElement::handler_pc", Integer.class, "u2");
+    final int exceptionTableElementCatchTypeIndexOffset = getFieldOffset("ExceptionTableElement::catch_type_index", Integer.class, "u2");
+
+    final int localVariableTableElementSize = getFieldValue("CompilerToVM::Data::sizeof_LocalVariableTableElement", Integer.class, "int");
+    final int localVariableTableElementStartBciOffset = getFieldOffset("LocalVariableTableElement::start_bci", Integer.class, "u2");
+    final int localVariableTableElementLengthOffset = getFieldOffset("LocalVariableTableElement::length", Integer.class, "u2");
+    final int localVariableTableElementNameCpIndexOffset = getFieldOffset("LocalVariableTableElement::name_cp_index", Integer.class, "u2");
+    final int localVariableTableElementDescriptorCpIndexOffset = getFieldOffset("LocalVariableTableElement::descriptor_cp_index", Integer.class, "u2");
+    final int localVariableTableElementSlotOffset = getFieldOffset("LocalVariableTableElement::slot", Integer.class, "u2");
+
+    final int constantPoolSize = getFieldValue("CompilerToVM::Data::sizeof_ConstantPool", Integer.class, "int");
+    final int constantPoolTagsOffset = getFieldOffset("ConstantPool::_tags", Integer.class, "Array<u1>*");
+    final int constantPoolHolderOffset = getFieldOffset("ConstantPool::_pool_holder", Integer.class, "InstanceKlass*");
+    final int constantPoolLengthOffset = getFieldOffset("ConstantPool::_length", Integer.class, "int");
+
+    final int constantPoolCpCacheIndexTag = getConstant("ConstantPool::CPCACHE_INDEX_TAG", Integer.class);
+
+    final int jvmConstantUtf8 = getConstant("JVM_CONSTANT_Utf8", Integer.class);
+    final int jvmConstantInteger = getConstant("JVM_CONSTANT_Integer", Integer.class);
+    final int jvmConstantLong = getConstant("JVM_CONSTANT_Long", Integer.class);
+    final int jvmConstantFloat = getConstant("JVM_CONSTANT_Float", Integer.class);
+    final int jvmConstantDouble = getConstant("JVM_CONSTANT_Double", Integer.class);
+    final int jvmConstantClass = getConstant("JVM_CONSTANT_Class", Integer.class);
+    final int jvmConstantUnresolvedClass = getConstant("JVM_CONSTANT_UnresolvedClass", Integer.class);
+    final int jvmConstantUnresolvedClassInError = getConstant("JVM_CONSTANT_UnresolvedClassInError", Integer.class);
+    final int jvmConstantString = getConstant("JVM_CONSTANT_String", Integer.class);
+    final int jvmConstantFieldref = getConstant("JVM_CONSTANT_Fieldref", Integer.class);
+    final int jvmConstantMethodref = getConstant("JVM_CONSTANT_Methodref", Integer.class);
+    final int jvmConstantInterfaceMethodref = getConstant("JVM_CONSTANT_InterfaceMethodref", Integer.class);
+    final int jvmConstantNameAndType = getConstant("JVM_CONSTANT_NameAndType", Integer.class);
+    final int jvmConstantMethodHandle = getConstant("JVM_CONSTANT_MethodHandle", Integer.class);
+    final int jvmConstantMethodHandleInError = getConstant("JVM_CONSTANT_MethodHandleInError", Integer.class);
+    final int jvmConstantMethodType = getConstant("JVM_CONSTANT_MethodType", Integer.class);
+    final int jvmConstantMethodTypeInError = getConstant("JVM_CONSTANT_MethodTypeInError", Integer.class);
+    final int jvmConstantInvokeDynamic = getConstant("JVM_CONSTANT_InvokeDynamic", Integer.class);
+
+    final int jvmConstantExternalMax = getConstant("JVM_CONSTANT_ExternalMax", Integer.class);
+    final int jvmConstantInternalMin = getConstant("JVM_CONSTANT_InternalMin", Integer.class);
+    final int jvmConstantInternalMax = getConstant("JVM_CONSTANT_InternalMax", Integer.class);
+
+    final int heapWordSize = getConstant("HeapWordSize", Integer.class);
+
+    final int symbolPointerSize = getFieldValue("CompilerToVM::Data::sizeof_SymbolPointer", Integer.class, "int");
+
+    final long vmSymbolsSymbols = getFieldAddress("vmSymbols::_symbols[0]", "Symbol*");
+    final int vmSymbolsFirstSID = getConstant("vmSymbols::FIRST_SID", Integer.class);
+    final int vmSymbolsSIDLimit = getConstant("vmSymbols::SID_LIMIT", Integer.class);
+
+    final long symbolInit = getFieldValue("CompilerToVM::Data::symbol_init", Long.class);
+    final long symbolClinit = getFieldValue("CompilerToVM::Data::symbol_clinit", Long.class);
+
+    /**
+     * Returns the symbol in the {@code vmSymbols} table at position {@code index} as a
+     * {@link String}.
+     *
+     * @param index position in the symbol table
+     * @return the symbol at position id
+     */
+    String symbolAt(int index) {
+        HotSpotJVMCIRuntimeProvider runtime = runtime();
+        assert vmSymbolsFirstSID <= index && index < vmSymbolsSIDLimit : "index " + index + " is out of bounds";
+        assert symbolPointerSize == Unsafe.ADDRESS_SIZE : "the following address read is broken";
+        int offset = index * symbolPointerSize;
+        return runtime.getCompilerToVM().getSymbol(UNSAFE.getAddress(vmSymbolsSymbols + offset));
+    }
+
+    final int universeBaseVtableSize = getFieldValue("CompilerToVM::Data::Universe_base_vtable_size", Integer.class, "int");
+
+    final int baseVtableLength() {
+        return universeBaseVtableSize / (vtableEntrySize / heapWordSize);
+    }
+
+    final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int");
+
+    /**
+     * The DataLayout header size is the same as the cell size.
+     */
+    final int dataLayoutHeaderSize = getConstant("DataLayout::cell_size", Integer.class);
+    final int dataLayoutTagOffset = getFieldOffset("DataLayout::_header._struct._tag", Integer.class, "u1");
+    final int dataLayoutFlagsOffset = getFieldOffset("DataLayout::_header._struct._flags", Integer.class, "u1");
+    final int dataLayoutBCIOffset = getFieldOffset("DataLayout::_header._struct._bci", Integer.class, "u2");
+    final int dataLayoutCellSize = getConstant("DataLayout::cell_size", Integer.class);
+
+    final int dataLayoutNoTag = getConstant("DataLayout::no_tag", Integer.class);
+    final int dataLayoutBitDataTag = getConstant("DataLayout::bit_data_tag", Integer.class);
+    final int dataLayoutCounterDataTag = getConstant("DataLayout::counter_data_tag", Integer.class);
+    final int dataLayoutJumpDataTag = getConstant("DataLayout::jump_data_tag", Integer.class);
+    final int dataLayoutReceiverTypeDataTag = getConstant("DataLayout::receiver_type_data_tag", Integer.class);
+    final int dataLayoutVirtualCallDataTag = getConstant("DataLayout::virtual_call_data_tag", Integer.class);
+    final int dataLayoutRetDataTag = getConstant("DataLayout::ret_data_tag", Integer.class);
+    final int dataLayoutBranchDataTag = getConstant("DataLayout::branch_data_tag", Integer.class);
+    final int dataLayoutMultiBranchDataTag = getConstant("DataLayout::multi_branch_data_tag", Integer.class);
+    final int dataLayoutArgInfoDataTag = getConstant("DataLayout::arg_info_data_tag", Integer.class);
+    final int dataLayoutCallTypeDataTag = getConstant("DataLayout::call_type_data_tag", Integer.class);
+    final int dataLayoutVirtualCallTypeDataTag = getConstant("DataLayout::virtual_call_type_data_tag", Integer.class);
+    final int dataLayoutParametersTypeDataTag = getConstant("DataLayout::parameters_type_data_tag", Integer.class);
+    final int dataLayoutSpeculativeTrapDataTag = getConstant("DataLayout::speculative_trap_data_tag", Integer.class);
+
+    final int bciProfileWidth = getFlag("BciProfileWidth", Integer.class);
+    final int typeProfileWidth = getFlag("TypeProfileWidth", Integer.class);
+    final int methodProfileWidth = getFlag("MethodProfileWidth", Integer.class);
+
+    final int deoptReasonNone = getConstant("Deoptimization::Reason_none", Integer.class);
+    final int deoptReasonNullCheck = getConstant("Deoptimization::Reason_null_check", Integer.class);
+    final int deoptReasonRangeCheck = getConstant("Deoptimization::Reason_range_check", Integer.class);
+    final int deoptReasonClassCheck = getConstant("Deoptimization::Reason_class_check", Integer.class);
+    final int deoptReasonArrayCheck = getConstant("Deoptimization::Reason_array_check", Integer.class);
+    final int deoptReasonUnreached0 = getConstant("Deoptimization::Reason_unreached0", Integer.class);
+    final int deoptReasonTypeCheckInlining = getConstant("Deoptimization::Reason_type_checked_inlining", Integer.class);
+    final int deoptReasonOptimizedTypeCheck = getConstant("Deoptimization::Reason_optimized_type_check", Integer.class);
+    final int deoptReasonNotCompiledExceptionHandler = getConstant("Deoptimization::Reason_not_compiled_exception_handler", Integer.class);
+    final int deoptReasonUnresolved = getConstant("Deoptimization::Reason_unresolved", Integer.class);
+    final int deoptReasonJsrMismatch = getConstant("Deoptimization::Reason_jsr_mismatch", Integer.class);
+    final int deoptReasonDiv0Check = getConstant("Deoptimization::Reason_div0_check", Integer.class);
+    final int deoptReasonConstraint = getConstant("Deoptimization::Reason_constraint", Integer.class);
+    final int deoptReasonLoopLimitCheck = getConstant("Deoptimization::Reason_loop_limit_check", Integer.class);
+    final int deoptReasonAliasing = getConstant("Deoptimization::Reason_aliasing", Integer.class);
+    final int deoptReasonTransferToInterpreter = getConstant("Deoptimization::Reason_transfer_to_interpreter", Integer.class);
+    final int deoptReasonOSROffset = getConstant("Deoptimization::Reason_LIMIT", Integer.class);
+
+    final int deoptActionNone = getConstant("Deoptimization::Action_none", Integer.class);
+    final int deoptActionMaybeRecompile = getConstant("Deoptimization::Action_maybe_recompile", Integer.class);
+    final int deoptActionReinterpret = getConstant("Deoptimization::Action_reinterpret", Integer.class);
+    final int deoptActionMakeNotEntrant = getConstant("Deoptimization::Action_make_not_entrant", Integer.class);
+    final int deoptActionMakeNotCompilable = getConstant("Deoptimization::Action_make_not_compilable", Integer.class);
+
+    final int deoptimizationActionBits = getConstant("Deoptimization::_action_bits", Integer.class);
+    final int deoptimizationReasonBits = getConstant("Deoptimization::_reason_bits", Integer.class);
+    final int deoptimizationDebugIdBits = getConstant("Deoptimization::_debug_id_bits", Integer.class);
+    final int deoptimizationActionShift = getConstant("Deoptimization::_action_shift", Integer.class);
+    final int deoptimizationReasonShift = getConstant("Deoptimization::_reason_shift", Integer.class);
+    final int deoptimizationDebugIdShift = getConstant("Deoptimization::_debug_id_shift", Integer.class);
+
+    final int vmIntrinsicInvokeBasic = getConstant("vmIntrinsics::_invokeBasic", Integer.class);
+    final int vmIntrinsicLinkToVirtual = getConstant("vmIntrinsics::_linkToVirtual", Integer.class);
+    final int vmIntrinsicLinkToStatic = getConstant("vmIntrinsics::_linkToStatic", Integer.class);
+    final int vmIntrinsicLinkToSpecial = getConstant("vmIntrinsics::_linkToSpecial", Integer.class);
+    final int vmIntrinsicLinkToInterface = getConstant("vmIntrinsics::_linkToInterface", Integer.class);
+
+    final int codeInstallResultOk = getConstant("JVMCIEnv::ok", Integer.class);
+    final int codeInstallResultDependenciesFailed = getConstant("JVMCIEnv::dependencies_failed", Integer.class);
+    final int codeInstallResultDependenciesInvalid = getConstant("JVMCIEnv::dependencies_invalid", Integer.class);
+    final int codeInstallResultCacheFull = getConstant("JVMCIEnv::cache_full", Integer.class);
+    final int codeInstallResultCodeTooLarge = getConstant("JVMCIEnv::code_too_large", Integer.class);
+
+    String getCodeInstallResultDescription(int codeInstallResult) {
+        if (codeInstallResult == codeInstallResultOk) {
+            return "ok";
+        }
+        if (codeInstallResult == codeInstallResultDependenciesFailed) {
+            return "dependencies failed";
+        }
+        if (codeInstallResult == codeInstallResultDependenciesInvalid) {
+            return "dependencies invalid";
+        }
+        if (codeInstallResult == codeInstallResultCacheFull) {
+            return "code cache is full";
+        }
+        if (codeInstallResult == codeInstallResultCodeTooLarge) {
+            return "code is too large";
+        }
+        assert false : codeInstallResult;
+        return "unknown";
+    }
+
+    final int bitDataExceptionSeenFlag = getConstant("BitData::exception_seen_flag", Integer.class);
+    final int bitDataNullSeenFlag = getConstant("BitData::null_seen_flag", Integer.class);
+    final int methodDataCountOffset = getConstant("CounterData::count_off", Integer.class);
+    final int jumpDataTakenOffset = getConstant("JumpData::taken_off_set", Integer.class);
+    final int jumpDataDisplacementOffset = getConstant("JumpData::displacement_off_set", Integer.class);
+    final int receiverTypeDataNonprofiledCountOffset = getConstant("ReceiverTypeData::nonprofiled_count_off_set", Integer.class);
+    final int receiverTypeDataReceiverTypeRowCellCount = getConstant("ReceiverTypeData::receiver_type_row_cell_count", Integer.class);
+    final int receiverTypeDataReceiver0Offset = getConstant("ReceiverTypeData::receiver0_offset", Integer.class);
+    final int receiverTypeDataCount0Offset = getConstant("ReceiverTypeData::count0_offset", Integer.class);
+    final int branchDataNotTakenOffset = getConstant("BranchData::not_taken_off_set", Integer.class);
+    final int arrayDataArrayLenOffset = getConstant("ArrayData::array_len_off_set", Integer.class);
+    final int arrayDataArrayStartOffset = getConstant("ArrayData::array_start_off_set", Integer.class);
+    final int multiBranchDataPerCaseCellCount = getConstant("MultiBranchData::per_case_cell_count", Integer.class);
+}
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java
new file mode 100644
index 0000000..33a07bc
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java
@@ -0,0 +1,334 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import jdk.vm.ci.common.JVMCIError;
+
+/**
+ * Access to VM configuration data.
+ */
+public class HotSpotVMConfigAccess {
+
+    /**
+     * Gets the available configuration data.
+     */
+    public HotSpotVMConfigStore getStore() {
+        return store;
+    }
+
+    /**
+     * Gets the address of a C++ symbol.
+     *
+     * @param name name of C++ symbol
+     * @param notPresent if non-null and the symbol is not present then this value is returned
+     * @return the address of the symbol
+     * @throws JVMCIError if the symbol is not present and {@code notPresent == null}
+     */
+    public long getAddress(String name, Long notPresent) {
+        Long entry = store.vmAddresses.get(name);
+        if (entry == null) {
+            if (notPresent != null) {
+                return notPresent;
+            }
+            throw new JVMCIError("expected VM symbol not found: " + name);
+        }
+        return entry;
+    }
+
+    /**
+     * Gets the address of a C++ symbol.
+     *
+     * @param name name of C++ symbol
+     * @return the address of the symbol
+     * @throws JVMCIError if the symbol is not present
+     */
+    public long getAddress(String name) {
+        return getAddress(name, null);
+    }
+
+    /**
+     * Gets the value of a C++ constant.
+     *
+     * @param name name of the constant (e.g., {@code "frame::arg_reg_save_area_bytes"})
+     * @param type the boxed type to which the constant value will be converted
+     * @param notPresent if non-null and the constant is not present then this value is returned
+     * @return the constant value converted to {@code type}
+     * @throws JVMCIError if the constant is not present and {@code notPresent == null}
+     */
+    public <T> T getConstant(String name, Class<T> type, T notPresent) {
+        Long c = store.vmConstants.get(name);
+        if (c == null) {
+            if (notPresent != null) {
+                return notPresent;
+            }
+            throw new JVMCIError("expected VM constant not found: " + name);
+        }
+        return type.cast(convertValue(name, type, c, null));
+    }
+
+    /**
+     * Gets the value of a C++ constant.
+     *
+     * @param name name of the constant (e.g., {@code "frame::arg_reg_save_area_bytes"})
+     * @param type the boxed type to which the constant value will be converted
+     * @return the constant value converted to {@code type}
+     * @throws JVMCIError if the constant is not present
+     */
+    public <T> T getConstant(String name, Class<T> type) {
+        return getConstant(name, type, null);
+    }
+
+    /**
+     * Gets the offset of a non-static C++ field.
+     *
+     * @param name fully qualified name of the field
+     * @param type the boxed type to which the offset value will be converted (must be
+     *            {@link Integer} or {@link Long})
+     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
+     * @param notPresent if non-null and the field is not present then this value is returned
+     * @return the offset in bytes of the requested field
+     * @throws JVMCIError if the field is static or not present and {@code notPresent} is null
+     */
+    public <T> T getFieldOffset(String name, Class<T> type, String cppType, T notPresent) {
+        assert type == Integer.class || type == Long.class;
+        VMField entry = getField(name, cppType, notPresent == null);
+        if (entry == null) {
+            return notPresent;
+        }
+        if (entry.address != 0) {
+            throw new JVMCIError("cannot get offset of static field " + name);
+        }
+        return type.cast(convertValue(name, type, entry.offset, cppType));
+    }
+
+    /**
+     * Gets the offset of a non-static C++ field.
+     *
+     * @param name fully qualified name of the field
+     * @param type the boxed type to which the offset value will be converted (must be
+     *            {@link Integer} or {@link Long})
+     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
+     * @return the offset in bytes of the requested field
+     * @throws JVMCIError if the field is static or not present
+     */
+    public <T> T getFieldOffset(String name, Class<T> type, String cppType) {
+        return getFieldOffset(name, type, cppType, null);
+    }
+
+    /**
+     * Gets the offset of a non-static C++ field.
+     *
+     * @param name fully qualified name of the field
+     * @param type the boxed type to which the offset value will be converted (must be
+     *            {@link Integer} or {@link Long})
+     * @return the offset in bytes of the requested field
+     * @throws JVMCIError if the field is static or not present
+     */
+    public <T> T getFieldOffset(String name, Class<T> type) {
+        return getFieldOffset(name, type, null, null);
+    }
+
+    /**
+     * Gets the address of a static C++ field.
+     *
+     * @param name fully qualified name of the field
+     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
+     * @param notPresent if non-null and the field is not present then this value is returned
+     * @return the address of the requested field
+     * @throws JVMCIError if the field is not static or not present and {@code notPresent} is null
+     */
+    public long getFieldAddress(String name, String cppType, Long notPresent) {
+        VMField entry = getField(name, cppType, notPresent == null);
+        if (entry == null) {
+            return notPresent;
+        }
+        if (entry.address == 0) {
+            throw new JVMCIError(name + " is not a static field");
+        }
+        return entry.address;
+    }
+
+    /**
+     * Gets the address of a static C++ field.
+     *
+     * @param name fully qualified name of the field
+     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
+     * @return the address of the requested field
+     * @throws JVMCIError if the field is not static or not present
+     */
+    public long getFieldAddress(String name, String cppType) {
+        return getFieldAddress(name, cppType, null);
+    }
+
+    /**
+     * Gets the value of a static C++ field.
+     *
+     * @param name fully qualified name of the field
+     * @param type the boxed type to which the constant value will be converted
+     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
+     * @param notPresent if non-null and the field is not present then this value is returned
+     * @return the value of the requested field
+     * @throws JVMCIError if the field is not static or not present and {@code notPresent} is null
+     */
+    public <T> T getFieldValue(String name, Class<T> type, String cppType, T notPresent) {
+        VMField entry = getField(name, cppType, notPresent == null);
+        if (entry == null) {
+            return notPresent;
+        }
+        if (entry.value == null) {
+            throw new JVMCIError(name + " is not a static field");
+        }
+        return type.cast(convertValue(name, type, entry.value, cppType));
+    }
+
+    /**
+     * Gets the value of a static C++ field.
+     *
+     * @param name fully qualified name of the field
+     * @param type the boxed type to which the constant value will be converted
+     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
+     * @return the value of the requested field
+     * @throws JVMCIError if the field is not static or not present
+     */
+    public <T> T getFieldValue(String name, Class<T> type, String cppType) {
+        return getFieldValue(name, type, cppType, null);
+    }
+
+    /**
+     * Gets the value of a static C++ field.
+     *
+     * @param name fully qualified name of the field
+     * @param type the boxed type to which the constant value will be converted
+     * @return the value of the requested field
+     * @throws JVMCIError if the field is not static or not present
+     */
+    public <T> T getFieldValue(String name, Class<T> type) {
+        return getFieldValue(name, type, null, null);
+    }
+
+    /**
+     * Gets a C++ field.
+     *
+     * @param name fully qualified name of the field
+     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
+     * @param required specifies if the field must be present
+     * @return the field
+     * @throws JVMCIError if the field is not present and {@code required == true}
+     */
+    private VMField getField(String name, String cppType, boolean required) {
+        VMField entry = store.vmFields.get(name);
+        if (entry == null) {
+            if (!required) {
+                return null;
+            }
+            throw new JVMCIError("expected VM field not found: " + name);
+        }
+
+        // Make sure the native type is still the type we expect.
+        if (cppType != null && !cppType.equals(entry.type)) {
+            throw new JVMCIError("expected type " + cppType + " but VM field " + name + " is of type " + entry.type);
+        }
+        return entry;
+    }
+
+    /**
+     * Gets a VM flag value.
+     *
+     * @param name name of the flag (e.g., {@code "CompileTheWorldStartAt"})
+     * @param type the boxed type to which the flag's value will be converted
+     * @return the flag's value converted to {@code type} or {@code notPresent} if the flag is not
+     *         present
+     * @throws JVMCIError if the flag is not present
+     */
+    public <T> T getFlag(String name, Class<T> type) {
+        return getFlag(name, type, null);
+    }
+
+    /**
+     * Gets a VM flag value.
+     *
+     * @param name name of the flag (e.g., {@code "CompileTheWorldStartAt"})
+     * @param type the boxed type to which the flag's value will be converted
+     * @param notPresent if non-null and the flag is not present then this value is returned
+     * @return the flag's value converted to {@code type} or {@code notPresent} if the flag is not
+     *         present
+     * @throws JVMCIError if the flag is not present and {@code notPresent == null}
+     */
+    public <T> T getFlag(String name, Class<T> type, T notPresent) {
+        VMFlag entry = store.vmFlags.get(name);
+        Object value;
+        String cppType;
+        if (entry == null) {
+            // Fall back to VM call
+            value = store.compilerToVm.getFlagValue(name);
+            if (value == store.compilerToVm) {
+                if (notPresent != null) {
+                    return notPresent;
+                }
+                throw new JVMCIError("expected VM flag not found: " + name);
+            } else {
+                cppType = null;
+            }
+        } else {
+            value = entry.value;
+            cppType = entry.type;
+        }
+        return type.cast(convertValue(name, type, value, cppType));
+    }
+
+    private static <T> Object convertValue(String name, Class<T> toType, Object value, String cppType) throws JVMCIError {
+        if (toType == Boolean.class) {
+            if (value instanceof String) {
+                return Boolean.valueOf((String) value);
+            } else if (value instanceof Boolean) {
+                return value;
+            } else if (value instanceof Long) {
+                return ((long) value) != 0;
+            }
+        } else if (toType == Byte.class) {
+            if (value instanceof Long) {
+                return (byte) (long) value;
+            }
+        } else if (toType == Integer.class) {
+            if (value instanceof Integer) {
+                return value;
+            } else if (value instanceof Long) {
+                return (int) (long) value;
+            }
+        } else if (toType == String.class) {
+            if (value == null || value instanceof String) {
+                return value;
+            }
+        } else if (toType == Long.class) {
+            return value;
+        }
+
+        throw new JVMCIError("cannot convert " + name + " of type " + value.getClass().getSimpleName() + (cppType == null ? "" : " [" + cppType + "]") + " to " + toType.getSimpleName());
+    }
+
+    private final HotSpotVMConfigStore store;
+
+    public HotSpotVMConfigAccess(HotSpotVMConfigStore store) {
+        this.store = store;
+    }
+}
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java
new file mode 100644
index 0000000..c388bbf
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+import static jdk.vm.ci.common.InitTimer.timer;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jdk.vm.ci.common.InitTimer;
+
+/**
+ * Access to VM configuration data.
+ */
+public final class HotSpotVMConfigStore {
+
+    /**
+     * Gets the C++ symbols whose addresses are exposed by this object.
+     *
+     * @return an unmodifiable map from the symbol names to their addresses
+     */
+    public Map<String, Long> getAddresses() {
+        return Collections.unmodifiableMap(vmAddresses);
+    }
+
+    /**
+     * Gets the C++ constants exposed by this object.
+     *
+     * @return an unmodifiable map from the names of C++ constants to their values
+     */
+    public Map<String, Long> getConstants() {
+        return Collections.unmodifiableMap(vmConstants);
+    }
+
+    /**
+     * Gets the VM flags exposed by this object.
+     *
+     * @return an unmodifiable map from VM flag names to {@link VMFlag} objects
+     */
+    public Map<String, VMFlag> getFlags() {
+        return Collections.unmodifiableMap(vmFlags);
+    }
+
+    /**
+     * Gets the C++ fields exposed by this object.
+     *
+     * @return an unmodifiable map from VM field names to {@link VMField} objects
+     */
+    public Map<String, VMField> getFields() {
+        return Collections.unmodifiableMap(vmFields);
+    }
+
+    /**
+     * Gets the VM intrinsic descriptions exposed by this object.
+     */
+    public List<VMIntrinsicMethod> getIntrinsics() {
+        return Collections.unmodifiableList(vmIntrinsics);
+    }
+
+    final HashMap<String, VMField> vmFields;
+    final HashMap<String, Long> vmConstants;
+    final HashMap<String, Long> vmAddresses;
+    final HashMap<String, VMFlag> vmFlags;
+    final List<VMIntrinsicMethod> vmIntrinsics;
+    final CompilerToVM compilerToVm;
+
+    /**
+     * Reads the database of VM info. The return value encodes the info in a nested object array
+     * that is described by the pseudo Java object {@code info} below:
+     *
+     * <pre>
+     *     info = [
+     *         VMField[] vmFields,
+     *         [String name, Long value, ...] vmConstants,
+     *         [String name, Long value, ...] vmAddresses,
+     *         VMFlag[] vmFlags
+     *         VMIntrinsicMethod[] vmIntrinsics
+     *     ]
+     * </pre>
+     */
+    @SuppressWarnings("try")
+    HotSpotVMConfigStore(CompilerToVM compilerToVm) {
+        this.compilerToVm = compilerToVm;
+        Object[] data;
+        try (InitTimer t = timer("CompilerToVm readConfiguration")) {
+            data = compilerToVm.readConfiguration();
+        }
+        assert data.length == 5 : data.length;
+
+        // @formatter:off
+        VMField[] vmFieldsInfo    = (VMField[]) data[0];
+        Object[] vmConstantsInfo  = (Object[])  data[1];
+        Object[] vmAddressesInfo  = (Object[])  data[2];
+        VMFlag[] vmFlagsInfo      = (VMFlag[])  data[3];
+
+        vmFields     = new HashMap<>(vmFieldsInfo.length);
+        vmConstants  = new HashMap<>(vmConstantsInfo.length);
+        vmAddresses  = new HashMap<>(vmAddressesInfo.length);
+        vmFlags      = new HashMap<>(vmFlagsInfo.length);
+        vmIntrinsics = Arrays.asList((VMIntrinsicMethod[]) data[4]);
+        // @formatter:on
+
+        try (InitTimer t = timer("HotSpotVMConfigStore<init> fill maps")) {
+            for (VMField vmField : vmFieldsInfo) {
+                vmFields.put(vmField.name, vmField);
+            }
+
+            for (int i = 0; i < vmConstantsInfo.length / 2; i++) {
+                String name = (String) vmConstantsInfo[i * 2];
+                Long value = (Long) vmConstantsInfo[i * 2 + 1];
+                vmConstants.put(name, value);
+            }
+
+            for (int i = 0; i < vmAddressesInfo.length / 2; i++) {
+                String name = (String) vmAddressesInfo[i * 2];
+                Long value = (Long) vmAddressesInfo[i * 2 + 1];
+                vmAddresses.put(name, value);
+            }
+
+            for (VMFlag vmFlag : vmFlagsInfo) {
+                vmFlags.put(vmFlag.name, vmFlag);
+            }
+        }
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/MetaspaceWrapperObject.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/MetaspaceWrapperObject.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/MetaspaceWrapperObject.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/MetaspaceWrapperObject.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/SuppressFBWarnings.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/SuppressFBWarnings.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/SuppressFBWarnings.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java
new file mode 100644
index 0000000..ce8b541
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.hotspot;
+
+/**
+ * Describes a C++ field exposed via {@link HotSpotVMConfigAccess}.
+ */
+public final class VMField {
+
+    /**
+     * Fully qualified name of the represented field (e.g., "Klass::_name").
+     */
+    public final String name;
+
+    /**
+     * The represented field's type (e.g., "Symbol*"). This may be {@code null}.
+     */
+    public final String type;
+
+    /**
+     * If the represented field is non-static, this is its offset within the containing structure.
+     */
+    public final long offset;
+
+    /**
+     * If the represented field is static, this is its address. Otherwise, this is 0.
+     */
+    public final long address;
+
+    /**
+     * Value of the field represented as a boxed boolean if its C++ type is bool otherwise as a
+     * boxed long; only valid for non-oop static fields. This value is only captured once, during
+     * JVMCI initialization. If {@link #type} cannot be meaningfully (e.g., a struct) or safely
+     * (e.g., an oop) expressed as a boxed object, this is {@code null}.
+     */
+    public final Object value;
+
+    /**
+     * Determines if the represented field is static.
+     */
+    public boolean isStatic() {
+        return address != 0;
+    }
+
+    /**
+     * Creates a description of a non-static field.
+     */
+    public VMField(String name, String type, long offset) {
+        this.name = name;
+        this.type = type;
+        this.offset = offset;
+        this.address = 0;
+        this.value = null;
+    }
+
+    /**
+     * Creates a description of a static field.
+     */
+    public VMField(String name, String type, long address, Long value) {
+        this.name = name;
+        this.type = type;
+        this.offset = 0;
+        this.address = address;
+        this.value = value;
+    }
+
+    @Override
+    public String toString() {
+        String val = value == null ? "null" : String.format("0x%x", value);
+        return String.format("Field[name=%s, type=%s, offset=%d, address=0x%x, value=%s]", name, type, offset, address, val);
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMFlag.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMFlag.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMFlag.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMFlag.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMIntrinsicMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMIntrinsicMethod.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMIntrinsicMethod.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMIntrinsicMethod.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/overview.html b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/overview.html
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/overview.html
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/overview.html
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractJavaProfile.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractJavaProfile.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractJavaProfile.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractJavaProfile.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractProfiledItem.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractProfiledItem.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractProfiledItem.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractProfiledItem.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AllocatableValue.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AllocatableValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AllocatableValue.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AllocatableValue.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Constant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Constant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Constant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Constant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationAction.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationAction.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationAction.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationAction.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationReason.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationReason.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationReason.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationReason.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ExceptionHandler.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ExceptionHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ExceptionHandler.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ExceptionHandler.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/InvokeTarget.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/InvokeTarget.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/InvokeTarget.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/InvokeTarget.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethod.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethod.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethod.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethodProfile.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethodProfile.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethodProfile.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethodProfile.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaType.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaType.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaType.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaTypeProfile.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaTypeProfile.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaTypeProfile.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaTypeProfile.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaValue.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaValue.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaValue.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Local.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Local.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Local.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Local.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java
new file mode 100644
index 0000000..9eba9d0
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.meta;
+
+/**
+ * Provides memory access operations for the target VM.
+ */
+public interface MemoryAccessProvider {
+
+    /**
+     * Reads a primitive value using a base address and a displacement.
+     *
+     * @param kind the {@link JavaKind} of the returned {@link JavaConstant} object
+     * @param base the base address from which the value is read
+     * @param displacement the displacement within the object in bytes
+     * @param bits the number of bits to read from memory
+     * @return the read value encapsulated in a {@link JavaConstant} object of {@link JavaKind} kind
+     * @throws IllegalArgumentException if the read is out of bounds of the object or {@code kind}
+     *             is {@link JavaKind#Void} or not {@linkplain JavaKind#isPrimitive() primitive}
+     *             kind or {@code bits} is not 8, 16, 32 or 64
+     */
+    JavaConstant readPrimitiveConstant(JavaKind kind, Constant base, long displacement, int bits) throws IllegalArgumentException;
+
+    /**
+     * Reads a Java {@link Object} value using a base address and a displacement.
+     *
+     * @param base the base address from which the value is read
+     * @param displacement the displacement within the object in bytes
+     * @return the read value encapsulated in a {@link Constant} object
+     * @throws IllegalArgumentException if the address computed from {@code base} and
+     *             {@code displacement} does not denote a location holding an {@code Object} value
+     */
+    JavaConstant readObjectConstant(Constant base, long displacement);
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MethodHandleAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MethodHandleAccessProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MethodHandleAccessProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MethodHandleAccessProvider.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/NullConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/NullConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/NullConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/NullConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PlatformKind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PlatformKind.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PlatformKind.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PlatformKind.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PrimitiveConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PrimitiveConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PrimitiveConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PrimitiveConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ProfilingInfo.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ProfilingInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ProfilingInfo.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ProfilingInfo.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/RawConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/RawConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/RawConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/RawConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SerializableConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SerializableConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SerializableConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SerializableConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Signature.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Signature.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Signature.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Signature.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SuppressFBWarnings.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SuppressFBWarnings.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SuppressFBWarnings.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/TriState.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/TriState.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/TriState.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/TriState.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/VMConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/VMConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/VMConstant.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/VMConstant.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/package-info.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/package-info.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/package-info.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIBackend.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIBackend.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIBackend.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIBackend.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompilerFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompilerFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompilerFactory.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompilerFactory.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIRuntime.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIRuntime.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIRuntime.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIRuntime.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIPermission.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIPermission.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIPermission.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIPermission.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java
new file mode 100644
index 0000000..851fd30
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.services;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Formatter;
+import java.util.Iterator;
+import java.util.ServiceConfigurationError;
+import java.util.ServiceLoader;
+import java.util.Set;
+
+/**
+ * A mechanism for accessing service providers via JVMCI.
+ */
+public final class Services {
+
+    private Services() {
+    }
+
+    private static int getJavaSpecificationVersion() {
+        String value = System.getProperty("java.specification.version");
+        if (value.startsWith("1.")) {
+            value = value.substring(2);
+        }
+        return Integer.parseInt(value);
+    }
+
+    /**
+     * The integer value corresponding to the value of the {@code java.specification.version} system
+     * property after any leading {@code "1."} has been stripped.
+     */
+    public static final int JAVA_SPECIFICATION_VERSION = getJavaSpecificationVersion();
+
+    // Use reflection so that this compiles on Java 8
+    private static final Method getModule;
+    private static final Method getPackages;
+    private static final Method addUses;
+    private static final Method isExported;
+    private static final Method addExports;
+
+    static {
+        if (JAVA_SPECIFICATION_VERSION >= 9) {
+            try {
+                getModule = Class.class.getMethod("getModule");
+                Class<?> moduleClass = getModule.getReturnType();
+                getPackages = moduleClass.getMethod("getPackages");
+                addUses = moduleClass.getMethod("addUses", Class.class);
+                isExported = moduleClass.getMethod("isExported", String.class, moduleClass);
+                addExports = moduleClass.getMethod("addExports", String.class, moduleClass);
+            } catch (NoSuchMethodException | SecurityException e) {
+                throw new InternalError(e);
+            }
+        } else {
+            getModule = null;
+            getPackages = null;
+            addUses = null;
+            isExported = null;
+            addExports = null;
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    static <T> T invoke(Method method, Object receiver, Object... args) {
+        try {
+            return (T) method.invoke(receiver, args);
+        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+            throw new InternalError(e);
+        }
+    }
+
+    /**
+     * Performs any required security checks and dynamic reconfiguration to allow the module of a
+     * given class to access the classes in the JVMCI module.
+     *
+     * Note: This API uses {@link Class} instead of {@code Module} to provide backwards
+     * compatibility for JVMCI clients compiled against a JDK release earlier than 9.
+     *
+     * @param requestor a class requesting access to the JVMCI module for its module
+     * @throws SecurityException if a security manager is present and it denies
+     *             {@link JVMCIPermission}
+     */
+    public static void exportJVMCITo(Class<?> requestor) {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new JVMCIPermission());
+        }
+        if (JAVA_SPECIFICATION_VERSION >= 9) {
+            Object jvmci = invoke(getModule, Services.class);
+            Object requestorModule = invoke(getModule, requestor);
+            if (jvmci != requestorModule) {
+                Set<String> packages = invoke(getPackages, jvmci);
+                for (String pkg : packages) {
+                    // Export all JVMCI packages dynamically instead
+                    // of requiring a long list of --add-exports
+                    // options on the JVM command line.
+                    boolean exported = invoke(isExported, jvmci, pkg, requestorModule);
+                    if (!exported) {
+                        invoke(addExports, jvmci, pkg, requestorModule);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Gets an {@link Iterable} of the JVMCI providers available for a given service.
+     *
+     * @throws SecurityException if a security manager is present and it denies
+     *             {@link JVMCIPermission}
+     */
+    public static <S> Iterable<S> load(Class<S> service) {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new JVMCIPermission());
+        }
+        if (JAVA_SPECIFICATION_VERSION >= 9) {
+            Object jvmci = invoke(getModule, Services.class);
+            invoke(addUses, jvmci, service);
+        }
+
+        // Restrict JVMCI clients to be on the class path or module path
+        return ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
+    }
+
+    /**
+     * Gets the JVMCI provider for a given service for which at most one provider must be available.
+     *
+     * @param service the service whose provider is being requested
+     * @param required specifies if an {@link InternalError} should be thrown if no provider of
+     *            {@code service} is available
+     * @throws SecurityException if a security manager is present and it denies
+     *             {@link JVMCIPermission}
+     */
+    public static <S> S loadSingle(Class<S> service, boolean required) {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new JVMCIPermission());
+        }
+        if (JAVA_SPECIFICATION_VERSION >= 9) {
+            Object jvmci = invoke(getModule, Services.class);
+            invoke(addUses, jvmci, service);
+        }
+        // Restrict JVMCI clients to be on the class path or module path
+        Iterable<S> providers = ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
+        S singleProvider = null;
+        try {
+            for (Iterator<S> it = providers.iterator(); it.hasNext();) {
+                singleProvider = it.next();
+                if (it.hasNext()) {
+                    throw new InternalError(String.format("Multiple %s providers found", service.getName()));
+                }
+            }
+        } catch (ServiceConfigurationError e) {
+            // If the service is required we will bail out below.
+        }
+        if (singleProvider == null && required) {
+            String javaHome = System.getProperty("java.home");
+            String vmName = System.getProperty("java.vm.name");
+            Formatter errorMessage = new Formatter();
+            errorMessage.format("The VM does not expose required service %s.%n", service.getName());
+            errorMessage.format("Currently used Java home directory is %s.%n", javaHome);
+            errorMessage.format("Currently used VM configuration is: %s", vmName);
+            throw new UnsupportedOperationException(errorMessage.toString());
+        }
+        return singleProvider;
+    }
+}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java
similarity index 100%
rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java
rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java
diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/module-info.java b/hotspot/src/jdk.internal.vm.ci/share/classes/module-info.java
new file mode 100644
index 0000000..441651a
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/module-info.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module jdk.internal.vm.ci {
+    exports jdk.vm.ci.services to jdk.internal.vm.compiler;
+
+    uses jdk.vm.ci.services.JVMCIServiceLocator;
+    uses jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;
+
+    provides jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory with
+        jdk.vm.ci.hotspot.aarch64.AArch64HotSpotJVMCIBackendFactory,
+        jdk.vm.ci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory,
+        jdk.vm.ci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory;
+
+    exports jdk.vm.ci.aarch64 to
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.amd64 to
+        jdk.aot,
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.code to
+        jdk.aot,
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.code.site to
+        jdk.aot,
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.code.stack to
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.common to
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.hotspot to
+        jdk.aot,
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.hotspot.aarch64 to
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.hotspot.amd64 to
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.hotspot.sparc to
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.meta to
+        jdk.aot,
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.runtime to
+        jdk.aot,
+        jdk.internal.vm.compiler;
+    exports jdk.vm.ci.sparc to
+        jdk.internal.vm.compiler;
+}
diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/.project b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/.project
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/.mx.graal/.project
rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/.project
diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/.pydevproject b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/.pydevproject
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/.mx.graal/.pydevproject
rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/.pydevproject
diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/eclipse-settings/org.eclipse.jdt.core.prefs b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/eclipse-settings/org.eclipse.jdt.core.prefs
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/.mx.graal/eclipse-settings/org.eclipse.jdt.core.prefs
rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/eclipse-settings/org.eclipse.jdt.core.prefs
diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal.py
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal.py
rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal.py
diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal_9.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal_9.py
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal_9.py
rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal_9.py
diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal_bench.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal_bench.py
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal_bench.py
rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal_bench.py
diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/outputparser.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/outputparser.py
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/.mx.graal/outputparser.py
rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/outputparser.py
diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/sanitycheck.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/sanitycheck.py
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/.mx.graal/sanitycheck.py
rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/sanitycheck.py
diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/suite.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/suite.py
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/.mx.graal/suite.py
rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/suite.py
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java
new file mode 100644
index 0000000..783eef0
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module jdk.internal.vm.compiler {
+    requires java.instrument;
+    requires java.management;
+    requires jdk.management;
+    requires jdk.internal.vm.ci;
+
+    // sun.misc.Unsafe is used
+    requires jdk.unsupported;
+
+    uses org.graalvm.compiler.code.DisassemblerProvider;
+    uses org.graalvm.compiler.core.match.MatchStatementSet;
+    uses org.graalvm.compiler.debug.DebugConfigCustomizer;
+    uses org.graalvm.compiler.debug.DebugInitializationParticipant;
+    uses org.graalvm.compiler.debug.TTYStreamProvider;
+    uses org.graalvm.compiler.hotspot.CompilerConfigurationFactory;
+    uses org.graalvm.compiler.hotspot.HotSpotBackendFactory;
+    uses org.graalvm.compiler.nodes.graphbuilderconf.NodeIntrinsicPluginFactory;
+
+    exports org.graalvm.compiler.api.directives         to jdk.aot;
+    exports org.graalvm.compiler.api.runtime            to jdk.aot;
+    exports org.graalvm.compiler.api.replacements       to jdk.aot;
+    exports org.graalvm.compiler.asm.amd64              to jdk.aot;
+    exports org.graalvm.compiler.bytecode               to jdk.aot;
+    exports org.graalvm.compiler.code                   to jdk.aot;
+    exports org.graalvm.compiler.core                   to jdk.aot;
+    exports org.graalvm.compiler.core.common            to jdk.aot;
+    exports org.graalvm.compiler.core.target            to jdk.aot;
+    exports org.graalvm.compiler.debug                  to jdk.aot;
+    exports org.graalvm.compiler.debug.internal         to jdk.aot;
+    exports org.graalvm.compiler.graph                  to jdk.aot;
+    exports org.graalvm.compiler.hotspot                to jdk.aot;
+    exports org.graalvm.compiler.hotspot.meta           to jdk.aot;
+    exports org.graalvm.compiler.hotspot.replacements   to jdk.aot;
+    exports org.graalvm.compiler.hotspot.stubs          to jdk.aot;
+    exports org.graalvm.compiler.hotspot.word           to jdk.aot;
+    exports org.graalvm.compiler.java                   to jdk.aot;
+    exports org.graalvm.compiler.lir.asm                to jdk.aot;
+    exports org.graalvm.compiler.lir.phases             to jdk.aot;
+    exports org.graalvm.compiler.nodes                  to jdk.aot;
+    exports org.graalvm.compiler.nodes.graphbuilderconf to jdk.aot;
+    exports org.graalvm.compiler.options                to jdk.aot;
+    exports org.graalvm.compiler.phases                 to jdk.aot;
+    exports org.graalvm.compiler.phases.tiers           to jdk.aot;
+    exports org.graalvm.compiler.runtime                to jdk.aot;
+    exports org.graalvm.compiler.replacements           to jdk.aot;
+    exports org.graalvm.compiler.word                   to jdk.aot;
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/CollectionsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/CollectionsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/CollectionsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/CollectionsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/DefaultCollectionsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/DefaultCollectionsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/DefaultCollectionsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/DefaultCollectionsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/AllocationInstrumentationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/AllocationInstrumentationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/AllocationInstrumentationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/AllocationInstrumentationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IsMethodInlineDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IsMethodInlineDirectiveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IsMethodInlineDirectiveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IsMethodInlineDirectiveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/LockInstrumentationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/LockInstrumentationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/LockInstrumentationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/LockInstrumentationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/RootNameDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/RootNameDirectiveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/RootNameDirectiveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/RootNameDirectiveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/TinyInstrumentor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/TinyInstrumentor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/TinyInstrumentor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/TinyInstrumentor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/NumUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/NumUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/NumUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/NumUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/PermanentBailoutException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/PermanentBailoutException.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/PermanentBailoutException.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/PermanentBailoutException.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/RetryableBailoutException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/RetryableBailoutException.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/RetryableBailoutException.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/RetryableBailoutException.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLowering.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLowering.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLowering.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLowering.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CollectionsFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CollectionsFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CollectionsFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CollectionsFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LinkedIdentityHashMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LinkedIdentityHashMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LinkedIdentityHashMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LinkedIdentityHashMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LocationIdentity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LocationIdentity.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LocationIdentity.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LocationIdentity.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArrayMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArrayMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArrayMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArrayMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArraySet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArraySet.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArraySet.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArraySet.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java
new file mode 100644
index 0000000..8facd19
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.core.common.util;
+
+import static org.graalvm.compiler.core.common.util.Util.JAVA_SPECIFICATION_VERSION;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+/**
+ * Reflection based access to the Module API introduced by JDK 9. This allows the API to be used in
+ * code that must be compiled on a JDK prior to 9. Use of this class must be guarded by a test for
+ * JDK 9 or later. For example:
+ *
+ * <pre>
+ * if (Util.JAVA_SPECIFICATION_VERSION >= 9) {
+ *     // Use of ModuleAPI
+ * }
+ * </pre>
+ */
+public final class ModuleAPI {
+
+    private ModuleAPI(Method method) {
+        this.method = method;
+    }
+
+    private final Method method;
+
+    /**
+     * {@code Class.getModule()}.
+     */
+    public static final ModuleAPI getModule;
+
+    /**
+     * {@code jdk.internal.module.Modules.addExports(Module, String, Module)}.
+     */
+    public static final ModuleAPI addExports;
+
+    /**
+     * {@code java.lang.Module.getResourceAsStream(String)}.
+     */
+    public static final ModuleAPI getResourceAsStream;
+
+    /**
+     * {@code java.lang.Module.canRead(Module)}.
+     */
+    public static final ModuleAPI canRead;
+
+    /**
+     * {@code java.lang.Module.isExported(String)}.
+     */
+    public static final ModuleAPI isExported;
+
+    /**
+     * {@code java.lang.Module.isExported(String, Module)}.
+     */
+    public static final ModuleAPI isExportedTo;
+
+    /**
+     * Invokes the static Module API method represented by this object.
+     */
+    @SuppressWarnings("unchecked")
+    public <T> T invokeStatic(Object... args) {
+        checkAvailability();
+        assert Modifier.isStatic(method.getModifiers());
+        try {
+            return (T) method.invoke(null, args);
+        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+            throw new InternalError(e);
+        }
+    }
+
+    /**
+     * Invokes the non-static Module API method represented by this object.
+     */
+    @SuppressWarnings("unchecked")
+    public <T> T invoke(Object receiver, Object... args) {
+        checkAvailability();
+        assert !Modifier.isStatic(method.getModifiers());
+        try {
+            return (T) method.invoke(receiver, args);
+        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+            throw new InternalError(e);
+        }
+    }
+
+    private void checkAvailability() throws InternalError {
+        if (method == null) {
+            throw new InternalError("Cannot use Module API on JDK " + JAVA_SPECIFICATION_VERSION);
+        }
+    }
+
+    static {
+        if (JAVA_SPECIFICATION_VERSION >= 9) {
+            try {
+                getModule = new ModuleAPI(Class.class.getMethod("getModule"));
+                Class<?> moduleClass = getModule.method.getReturnType();
+                Class<?> modulesClass = Class.forName("jdk.internal.module.Modules");
+                getResourceAsStream = new ModuleAPI(moduleClass.getMethod("getResourceAsStream", String.class));
+                canRead = new ModuleAPI(moduleClass.getMethod("canRead", moduleClass));
+                isExported = new ModuleAPI(moduleClass.getMethod("isExported", String.class));
+                isExportedTo = new ModuleAPI(moduleClass.getMethod("isExported", String.class, moduleClass));
+                addExports = new ModuleAPI(modulesClass.getDeclaredMethod("addExports", moduleClass, String.class, moduleClass));
+            } catch (NoSuchMethodException | SecurityException | ClassNotFoundException e) {
+                throw new InternalError(e);
+            }
+        } else {
+            ModuleAPI unavailable = new ModuleAPI(null);
+            getModule = unavailable;
+            getResourceAsStream = unavailable;
+            canRead = unavailable;
+            isExported = unavailable;
+            isExportedTo = unavailable;
+            addExports = unavailable;
+        }
+
+    }
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/META-INF/services/javax.annotation.processing.Processor
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/META-INF/services/javax.annotation.processing.Processor
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/META-INF/services/javax.annotation.processing.Processor
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationLoadFieldConstantFoldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationLoadFieldConstantFoldTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationLoadFieldConstantFoldTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationLoadFieldConstantFoldTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CooperativePhaseTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CooperativePhaseTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CooperativePhaseTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CooperativePhaseTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardEliminationCornerCasesTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardEliminationCornerCasesTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardEliminationCornerCasesTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardEliminationCornerCasesTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest4.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest4.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest4.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest5.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest5.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest5.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest5.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest6.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest6.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest6.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest6.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/RecursiveInliningTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/RecursiveInliningTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/RecursiveInliningTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/RecursiveInliningTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalDebugInitializationParticipant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalDebugInitializationParticipant.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalDebugInitializationParticipant.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalDebugInitializationParticipant.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugHistogramTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugHistogramTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugHistogramTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugHistogramTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugTimerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugTimerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugTimerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugTimerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Debug.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Debug.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Debug.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Debug.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigCustomizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigCustomizer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigCustomizer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigCustomizer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigScope.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigScope.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigScope.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigScope.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCounter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCounter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCounter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCounter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugEnvironment.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugEnvironment.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugEnvironment.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugEnvironment.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHistogram.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHistogram.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHistogram.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHistogram.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugInitializationParticipant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugInitializationParticipant.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugInitializationParticipant.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugInitializationParticipant.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMethodMetrics.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMethodMetrics.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMethodMetrics.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMethodMetrics.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugTimer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugTimer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugTimer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugTimer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugValueFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugValueFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugValueFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugValueFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DelegatingDebugConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DelegatingDebugConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DelegatingDebugConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DelegatingDebugConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Fingerprint.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Fingerprint.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Fingerprint.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Fingerprint.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalDebugConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalDebugConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalDebugConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalDebugConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Management.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Management.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Management.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Management.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TopLevelDebugConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TopLevelDebugConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TopLevelDebugConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TopLevelDebugConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/AccumulatedDebugValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/AccumulatedDebugValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/AccumulatedDebugValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/AccumulatedDebugValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CloseableCounterImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CloseableCounterImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CloseableCounterImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CloseableCounterImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CounterImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CounterImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CounterImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CounterImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramAsciiPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramAsciiPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramAsciiPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramAsciiPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramRPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramRPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramRPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramRPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugScope.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugScope.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugScope.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugScope.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValueMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValueMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValueMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValuesPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValuesPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValuesPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValuesPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/KeyRegistry.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/KeyRegistry.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/KeyRegistry.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/KeyRegistry.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/MemUseTrackerImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/MemUseTrackerImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/MemUseTrackerImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/MemUseTrackerImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/TimerImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/TimerImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/TimerImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/TimerImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsInlineeScopeInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsInlineeScopeInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsInlineeScopeInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsInlineeScopeInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsRootScopeInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsRootScopeInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsRootScopeInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsRootScopeInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/.checkstyle_checks.xml b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/.checkstyle_checks.xml
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/.checkstyle_checks.xml
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/.checkstyle_checks.xml
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/DefaultNodeCollectionsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/DefaultNodeCollectionsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/DefaultNodeCollectionsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/DefaultNodeCollectionsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeCollectionsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeCollectionsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeCollectionsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeCollectionsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeNodeMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeNodeMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeNodeMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeNodeMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRKindTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRKindTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRKindTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArchHotSpotNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArchHotSpotNodeCostProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArchHotSpotNodeCostProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArchHotSpotNodeCostProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizationStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizationStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizationStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizationStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotArithmeticLIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotArithmeticLIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotArithmeticLIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
new file mode 100644
index 0000000..bd87349
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
@@ -0,0 +1,737 @@
+/*
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.hotspot.amd64;
+
+import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
+import static org.graalvm.compiler.hotspot.HotSpotBackend.INITIALIZE_KLASS_BY_SYMBOL;
+import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_KLASS_BY_SYMBOL;
+import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_METHOD_BY_SYMBOL_AND_LOAD_COUNTERS;
+import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_STRING_BY_SYMBOL;
+import static org.graalvm.compiler.hotspot.HotSpotBackend.FETCH_UNROLL_INFO;
+import static org.graalvm.compiler.hotspot.HotSpotBackend.UNCOMMON_TRAP;
+import static jdk.vm.ci.amd64.AMD64.rbp;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.graalvm.compiler.asm.amd64.AMD64Address.Scale;
+import org.graalvm.compiler.core.amd64.AMD64ArithmeticLIRGenerator;
+import org.graalvm.compiler.core.amd64.AMD64LIRGenerator;
+import org.graalvm.compiler.core.amd64.AMD64MoveFactoryBase.BackupSlotProvider;
+import org.graalvm.compiler.core.common.LIRKind;
+import org.graalvm.compiler.core.common.spi.ForeignCallLinkage;
+import org.graalvm.compiler.core.common.spi.LIRKindTool;
+import org.graalvm.compiler.debug.Debug;
+import org.graalvm.compiler.debug.GraalError;
+import org.graalvm.compiler.hotspot.CompressEncoding;
+import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
+import org.graalvm.compiler.hotspot.HotSpotBackend;
+import org.graalvm.compiler.hotspot.HotSpotDebugInfoBuilder;
+import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
+import org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult;
+import org.graalvm.compiler.hotspot.HotSpotLIRGenerator;
+import org.graalvm.compiler.hotspot.HotSpotLockStack;
+import org.graalvm.compiler.hotspot.debug.BenchmarkCounters;
+import org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction;
+import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
+import org.graalvm.compiler.hotspot.nodes.type.HotSpotLIRKindTool;
+import org.graalvm.compiler.hotspot.stubs.Stub;
+import org.graalvm.compiler.lir.LIR;
+import org.graalvm.compiler.lir.LIRFrameState;
+import org.graalvm.compiler.lir.LIRInstruction;
+import org.graalvm.compiler.lir.LIRInstructionClass;
+import org.graalvm.compiler.lir.LabelRef;
+import org.graalvm.compiler.lir.StandardOp.NoOp;
+import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
+import org.graalvm.compiler.lir.SwitchStrategy;
+import org.graalvm.compiler.lir.Variable;
+import org.graalvm.compiler.lir.VirtualStackSlot;
+import org.graalvm.compiler.lir.amd64.AMD64AddressValue;
+import org.graalvm.compiler.lir.amd64.AMD64CCall;
+import org.graalvm.compiler.lir.amd64.AMD64ControlFlow.StrategySwitchOp;
+import org.graalvm.compiler.lir.amd64.AMD64FrameMapBuilder;
+import org.graalvm.compiler.lir.amd64.AMD64Move;
+import org.graalvm.compiler.lir.amd64.AMD64Move.MoveFromRegOp;
+import org.graalvm.compiler.lir.amd64.AMD64PrefetchOp;
+import org.graalvm.compiler.lir.amd64.AMD64ReadTimestampCounter;
+import org.graalvm.compiler.lir.amd64.AMD64RestoreRegistersOp;
+import org.graalvm.compiler.lir.amd64.AMD64SaveRegistersOp;
+import org.graalvm.compiler.lir.amd64.AMD64VZeroUpper;
+import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
+import org.graalvm.compiler.lir.framemap.FrameMapBuilder;
+import org.graalvm.compiler.lir.gen.LIRGenerationResult;
+
+import jdk.vm.ci.amd64.AMD64;
+import jdk.vm.ci.amd64.AMD64Kind;
+import jdk.vm.ci.code.CallingConvention;
+import jdk.vm.ci.code.Register;
+import jdk.vm.ci.code.RegisterConfig;
+import jdk.vm.ci.code.RegisterValue;
+import jdk.vm.ci.code.StackSlot;
+import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
+import jdk.vm.ci.hotspot.HotSpotObjectConstant;
+import jdk.vm.ci.meta.AllocatableValue;
+import jdk.vm.ci.meta.Constant;
+import jdk.vm.ci.meta.DeoptimizationAction;
+import jdk.vm.ci.meta.DeoptimizationReason;
+import jdk.vm.ci.meta.JavaConstant;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.PlatformKind;
+import jdk.vm.ci.meta.PrimitiveConstant;
+import jdk.vm.ci.meta.Value;
+
+/**
+ * LIR generator specialized for AMD64 HotSpot.
+ */
+public class AMD64HotSpotLIRGenerator extends AMD64LIRGenerator implements HotSpotLIRGenerator {
+
+    final GraalHotSpotVMConfig config;
+    private HotSpotDebugInfoBuilder debugInfoBuilder;
+
+    protected AMD64HotSpotLIRGenerator(HotSpotProviders providers, GraalHotSpotVMConfig config, LIRGenerationResult lirGenRes) {
+        this(providers, config, lirGenRes, new BackupSlotProvider(lirGenRes.getFrameMapBuilder()));
+    }
+
+    private AMD64HotSpotLIRGenerator(HotSpotProviders providers, GraalHotSpotVMConfig config, LIRGenerationResult lirGenRes, BackupSlotProvider backupSlotProvider) {
+        this(new AMD64HotSpotLIRKindTool(), new AMD64HotSpotArithmeticLIRGenerator(), new AMD64HotSpotMoveFactory(backupSlotProvider), providers, config, lirGenRes);
+    }
+
+    protected AMD64HotSpotLIRGenerator(LIRKindTool lirKindTool, AMD64ArithmeticLIRGenerator arithmeticLIRGen, MoveFactory moveFactory, HotSpotProviders providers, GraalHotSpotVMConfig config,
+                    LIRGenerationResult lirGenRes) {
+        super(lirKindTool, arithmeticLIRGen, moveFactory, providers, lirGenRes);
+        assert config.basicLockSize == 8;
+        this.config = config;
+    }
+
+    @Override
+    public HotSpotProviders getProviders() {
+        return (HotSpotProviders) super.getProviders();
+    }
+
+    /**
+     * Utility for emitting the instruction to save RBP.
+     */
+    class SaveRbp {
+
+        final NoOp placeholder;
+
+        /**
+         * The slot reserved for saving RBP.
+         */
+        final StackSlot reservedSlot;
+
+        SaveRbp(NoOp placeholder) {
+            this.placeholder = placeholder;
+            AMD64FrameMapBuilder frameMapBuilder = (AMD64FrameMapBuilder) getResult().getFrameMapBuilder();
+            this.reservedSlot = frameMapBuilder.allocateRBPSpillSlot();
+        }
+
+        /**
+         * Replaces this operation with the appropriate move for saving rbp.
+         *
+         * @param useStack specifies if rbp must be saved to the stack
+         */
+        public AllocatableValue finalize(boolean useStack) {
+            AllocatableValue dst;
+            if (useStack) {
+                dst = reservedSlot;
+            } else {
+                ((AMD64FrameMapBuilder) getResult().getFrameMapBuilder()).freeRBPSpillSlot();
+                dst = newVariable(LIRKind.value(AMD64Kind.QWORD));
+            }
+
+            placeholder.replace(getResult().getLIR(), new MoveFromRegOp(AMD64Kind.QWORD, dst, rbp.asValue(LIRKind.value(AMD64Kind.QWORD))));
+            return dst;
+        }
+    }
+
+    private SaveRbp saveRbp;
+
+    protected void emitSaveRbp() {
+        NoOp placeholder = new NoOp(getCurrentBlock(), getResult().getLIR().getLIRforBlock(getCurrentBlock()).size());
+        append(placeholder);
+        saveRbp = new SaveRbp(placeholder);
+    }
+
+    protected SaveRbp getSaveRbp() {
+        return saveRbp;
+    }
+
+    /**
+     * Helper instruction to reserve a stack slot for the whole method. Note that the actual users
+     * of the stack slot might be inserted after stack slot allocation. This dummy instruction
+     * ensures that the stack slot is alive and gets a real stack slot assigned.
+     */
+    private static final class RescueSlotDummyOp extends LIRInstruction {
+        public static final LIRInstructionClass<RescueSlotDummyOp> TYPE = LIRInstructionClass.create(RescueSlotDummyOp.class);
+
+        @Alive({OperandFlag.STACK, OperandFlag.UNINITIALIZED}) private AllocatableValue slot;
+
+        RescueSlotDummyOp(FrameMapBuilder frameMapBuilder, LIRKind kind) {
+            super(TYPE);
+            slot = frameMapBuilder.allocateSpillSlot(kind);
+        }
+
+        public AllocatableValue getSlot() {
+            return slot;
+        }
+
+        @Override
+        public void emitCode(CompilationResultBuilder crb) {
+        }
+    }
+
+    private RescueSlotDummyOp rescueSlotOp;
+
+    private AllocatableValue getOrInitRescueSlot() {
+        RescueSlotDummyOp op = getOrInitRescueSlotOp();
+        return op.getSlot();
+    }
+
+    private RescueSlotDummyOp getOrInitRescueSlotOp() {
+        if (rescueSlotOp == null) {
+            // create dummy instruction to keep the rescue slot alive
+            rescueSlotOp = new RescueSlotDummyOp(getResult().getFrameMapBuilder(), getLIRKindTool().getWordKind());
+        }
+        return rescueSlotOp;
+    }
+
+    /**
+     * List of epilogue operations that need to restore RBP.
+     */
+    List<AMD64HotSpotRestoreRbpOp> epilogueOps = new ArrayList<>(2);
+
+    @Override
+    public <I extends LIRInstruction> I append(I op) {
+        I ret = super.append(op);
+        if (op instanceof AMD64HotSpotRestoreRbpOp) {
+            epilogueOps.add((AMD64HotSpotRestoreRbpOp) op);
+        }
+        return ret;
+    }
+
+    @Override
+    public VirtualStackSlot getLockSlot(int lockDepth) {
+        return getLockStack().makeLockSlot(lockDepth);
+    }
+
+    private HotSpotLockStack getLockStack() {
+        assert debugInfoBuilder != null && debugInfoBuilder.lockStack() != null;
+        return debugInfoBuilder.lockStack();
+    }
+
+    private Register findPollOnReturnScratchRegister() {
+        RegisterConfig regConfig = getProviders().getCodeCache().getRegisterConfig();
+        for (Register r : regConfig.getAllocatableRegisters()) {
+            if (!r.equals(regConfig.getReturnRegister(JavaKind.Long)) && !r.equals(AMD64.rbp)) {
+                return r;
+            }
+        }
+        throw GraalError.shouldNotReachHere();
+    }
+
+    private Register pollOnReturnScratchRegister;
+
+    @Override
+    public void emitReturn(JavaKind kind, Value input) {
+        AllocatableValue operand = Value.ILLEGAL;
+        if (input != null) {
+            operand = resultOperandFor(kind, input.getValueKind());
+            emitMove(operand, input);
+        }
+        if (pollOnReturnScratchRegister == null) {
+            pollOnReturnScratchRegister = findPollOnReturnScratchRegister();
+        }
+        append(new AMD64HotSpotReturnOp(operand, getStub() != null, pollOnReturnScratchRegister, config));
+    }
+
+    @Override
+    public boolean needOnlyOopMaps() {
+        // Stubs only need oop maps
+        return getResult().getStub() != null;
+    }
+
+    private LIRFrameState currentRuntimeCallInfo;
+
+    @Override
+    protected void emitForeignCallOp(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info) {
+        currentRuntimeCallInfo = info;
+        HotSpotForeignCallLinkage hsLinkage = (HotSpotForeignCallLinkage) linkage;
+        AMD64 arch = (AMD64) target().arch;
+        if (arch.getFeatures().contains(AMD64.CPUFeature.AVX) && hsLinkage.mayContainFP() && !hsLinkage.isCompiledStub()) {
+            /*
+             * If the target may contain FP ops, and it is not compiled by us, we may have an
+             * AVX-SSE transition.
+             *
+             * We exclude the argument registers from the zeroing LIR instruction since it violates
+             * the LIR semantics of @Temp that values must not be live. Note that the emitted
+             * machine instruction actually zeros _all_ XMM registers which is fine since we know
+             * that their upper half is not used.
+             */
+            append(new AMD64VZeroUpper(arguments));
+        }
+        super.emitForeignCallOp(linkage, result, arguments, temps, info);
+    }
+
+    @Override
+    public void emitLeaveCurrentStackFrame(SaveRegistersOp saveRegisterOp) {
+        append(new AMD64HotSpotLeaveCurrentStackFrameOp(saveRegisterOp));
+    }
+
+    @Override
+    public void emitLeaveDeoptimizedStackFrame(Value frameSize, Value initialInfo) {
+        Variable frameSizeVariable = load(frameSize);
+        Variable initialInfoVariable = load(initialInfo);
+        append(new AMD64HotSpotLeaveDeoptimizedStackFrameOp(frameSizeVariable, initialInfoVariable));
+    }
+
+    @Override
+    public void emitEnterUnpackFramesStackFrame(Value framePc, Value senderSp, Value senderFp, SaveRegistersOp saveRegisterOp) {
+        Register threadRegister = getProviders().getRegisters().getThreadRegister();
+        Variable framePcVariable = load(framePc);
+        Variable senderSpVariable = load(senderSp);
+        Variable senderFpVariable = load(senderFp);
+        append(new AMD64HotSpotEnterUnpackFramesStackFrameOp(threadRegister, config.threadLastJavaSpOffset(), config.threadLastJavaPcOffset(), config.threadLastJavaFpOffset(), framePcVariable,
+                        senderSpVariable, senderFpVariable, saveRegisterOp));
+    }
+
+    @Override
+    public void emitLeaveUnpackFramesStackFrame(SaveRegistersOp saveRegisterOp) {
+        Register threadRegister = getProviders().getRegisters().getThreadRegister();
+        append(new AMD64HotSpotLeaveUnpackFramesStackFrameOp(threadRegister, config.threadLastJavaSpOffset(), config.threadLastJavaPcOffset(), config.threadLastJavaFpOffset(), saveRegisterOp));
+    }
+
+    /**
+     * @param savedRegisters the registers saved by this operation which may be subject to pruning
+     * @param savedRegisterLocations the slots to which the registers are saved
+     * @param supportsRemove determines if registers can be pruned
+     */
+    protected AMD64SaveRegistersOp emitSaveRegisters(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
+        AMD64SaveRegistersOp save = new AMD64SaveRegistersOp(savedRegisters, savedRegisterLocations, supportsRemove);
+        append(save);
+        return save;
+    }
+
+    /**
+     * Allocate a stack slot for saving a register.
+     */
+    protected VirtualStackSlot allocateSaveRegisterLocation(Register register) {
+        PlatformKind kind = target().arch.getLargestStorableKind(register.getRegisterCategory());
+        if (kind.getVectorLength() > 1) {
+            // we don't use vector registers, so there is no need to save them
+            kind = AMD64Kind.DOUBLE;
+        }
+        return getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(kind));
+    }
+
+    /**
+     * Adds a node to the graph that saves all allocatable registers to the stack.
+     *
+     * @param supportsRemove determines if registers can be pruned
+     * @return the register save node
+     */
+    private AMD64SaveRegistersOp emitSaveAllRegisters(Register[] savedRegisters, boolean supportsRemove) {
+        AllocatableValue[] savedRegisterLocations = new AllocatableValue[savedRegisters.length];
+        for (int i = 0; i < savedRegisters.length; i++) {
+            savedRegisterLocations[i] = allocateSaveRegisterLocation(savedRegisters[i]);
+        }
+        return emitSaveRegisters(savedRegisters, savedRegisterLocations, supportsRemove);
+    }
+
+    @Override
+    public SaveRegistersOp emitSaveAllRegisters() {
+        // We are saving all registers.
+        // TODO Save upper half of YMM registers.
+        return emitSaveAllRegisters(target().arch.getAvailableValueRegisters().toArray(), false);
+    }
+
+    protected void emitRestoreRegisters(AMD64SaveRegistersOp save) {
+        append(new AMD64RestoreRegistersOp(save.getSlots().clone(), save));
+    }
+
+    /**
+     * Gets the {@link Stub} this generator is generating code for or {@code null} if a stub is not
+     * being generated.
+     */
+    public Stub getStub() {
+        return getResult().getStub();
+    }
+
+    @Override
+    public HotSpotLIRGenerationResult getResult() {
+        return ((HotSpotLIRGenerationResult) super.getResult());
+    }
+
+    public void setDebugInfoBuilder(HotSpotDebugInfoBuilder debugInfoBuilder) {
+        this.debugInfoBuilder = debugInfoBuilder;
+    }
+
+    @Override
+    public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState state, Value... args) {
+        HotSpotForeignCallLinkage hotspotLinkage = (HotSpotForeignCallLinkage) linkage;
+        boolean destroysRegisters = hotspotLinkage.destroysRegisters();
+
+        AMD64SaveRegistersOp save = null;
+        Stub stub = getStub();
+        if (destroysRegisters) {
+            if (stub != null && stub.preservesRegisters()) {
+                Register[] savedRegisters = getResult().getFrameMapBuilder().getRegisterConfig().getAllocatableRegisters().toArray();
+                save = emitSaveAllRegisters(savedRegisters, true);
+            }
+        }
+
+        Variable result;
+        LIRFrameState debugInfo = null;
+        if (hotspotLinkage.needsDebugInfo()) {
+            debugInfo = state;
+            assert debugInfo != null || stub != null;
+        }
+
+        if (hotspotLinkage.needsJavaFrameAnchor()) {
+            Register thread = getProviders().getRegisters().getThreadRegister();
+            append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
+            result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
+            append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), config.threadLastJavaPcOffset(), thread));
+        } else {
+            result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
+        }
+
+        if (destroysRegisters) {
+            if (stub != null) {
+                if (stub.preservesRegisters()) {
+                    HotSpotLIRGenerationResult generationResult = getResult();
+                    assert !generationResult.getCalleeSaveInfo().containsKey(currentRuntimeCallInfo);
+                    generationResult.getCalleeSaveInfo().put(currentRuntimeCallInfo, save);
+                    emitRestoreRegisters(save);
+                }
+            }
+        }
+
+        return result;
+    }
+
+    @Override
+    public Value emitLoadObjectAddress(Constant constant) {
+        HotSpotObjectConstant objectConstant = (HotSpotObjectConstant) constant;
+        HotSpotLIRKindTool kindTool = (HotSpotLIRKindTool) getLIRKindTool();
+        LIRKind kind = objectConstant.isCompressed() ? kindTool.getNarrowOopKind() : kindTool.getObjectKind();
+        Variable result = newVariable(kind);
+        append(new AMD64HotSpotLoadAddressOp(result, constant, HotSpotConstantLoadAction.RESOLVE));
+        return result;
+    }
+
+    @Override
+    public Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
+        HotSpotMetaspaceConstant metaspaceConstant = (HotSpotMetaspaceConstant) constant;
+        HotSpotLIRKindTool kindTool = (HotSpotLIRKindTool) getLIRKindTool();
+        LIRKind kind = metaspaceConstant.isCompressed() ? kindTool.getNarrowPointerKind() : kindTool.getWordKind();
+        Variable result = newVariable(kind);
+        append(new AMD64HotSpotLoadAddressOp(result, constant, action));
+        return result;
+    }
+
+    @Override
+    public Value emitObjectConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
+        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(RESOLVE_STRING_BY_SYMBOL);
+        Constant[] constants = new Constant[]{constant};
+        AllocatableValue[] constantDescriptions = new AllocatableValue[]{asAllocatable(constantDescription)};
+        Object[] notes = new Object[]{HotSpotConstantLoadAction.RESOLVE};
+        append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
+        AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
+        return emitMove(result);
+    }
+
+    @Override
+    public Value emitMetaspaceConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
+        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(RESOLVE_KLASS_BY_SYMBOL);
+        Constant[] constants = new Constant[]{constant};
+        AllocatableValue[] constantDescriptions = new AllocatableValue[]{asAllocatable(constantDescription)};
+        Object[] notes = new Object[]{HotSpotConstantLoadAction.RESOLVE};
+        append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
+        AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
+        return emitMove(result);
+    }
+
+    @Override
+    public Value emitResolveMethodAndLoadCounters(Constant method, Value klassHint, Value methodDescription, LIRFrameState frameState) {
+        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(RESOLVE_METHOD_BY_SYMBOL_AND_LOAD_COUNTERS);
+        Constant[] constants = new Constant[]{method};
+        AllocatableValue[] constantDescriptions = new AllocatableValue[]{asAllocatable(klassHint), asAllocatable(methodDescription)};
+        Object[] notes = new Object[]{HotSpotConstantLoadAction.LOAD_COUNTERS};
+        append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
+        AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
+        return emitMove(result);
+
+    }
+
+    @Override
+    public Value emitKlassInitializationAndRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
+        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(INITIALIZE_KLASS_BY_SYMBOL);
+        Constant[] constants = new Constant[]{constant};
+        AllocatableValue[] constantDescriptions = new AllocatableValue[]{asAllocatable(constantDescription)};
+        Object[] notes = new Object[]{HotSpotConstantLoadAction.INITIALIZE};
+        append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
+        AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
+        return emitMove(result);
+    }
+
+    @Override
+    public Value emitLoadConfigValue(int markId, LIRKind kind) {
+        Variable result = newVariable(kind);
+        append(new AMD64HotSpotLoadConfigValueOp(markId, result));
+        return result;
+    }
+
+    @Override
+    public Value emitRandomSeed() {
+        AMD64ReadTimestampCounter timestamp = new AMD64ReadTimestampCounter();
+        append(timestamp);
+        return emitMove(timestamp.getLowResult());
+    }
+
+    @Override
+    public Value emitUncommonTrapCall(Value trapRequest, Value mode, SaveRegistersOp saveRegisterOp) {
+        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(UNCOMMON_TRAP);
+
+        Register thread = getProviders().getRegisters().getThreadRegister();
+        append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
+        Variable result = super.emitForeignCall(linkage, null, thread.asValue(LIRKind.value(AMD64Kind.QWORD)), trapRequest, mode);
+        append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), config.threadLastJavaPcOffset(), thread));
+
+        Map<LIRFrameState, SaveRegistersOp> calleeSaveInfo = getResult().getCalleeSaveInfo();
+        assert !calleeSaveInfo.containsKey(currentRuntimeCallInfo);
+        calleeSaveInfo.put(currentRuntimeCallInfo, saveRegisterOp);
+
+        return result;
+    }
+
+    @Override
+    public Value emitDeoptimizationFetchUnrollInfoCall(Value mode, SaveRegistersOp saveRegisterOp) {
+        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(FETCH_UNROLL_INFO);
+
+        Register thread = getProviders().getRegisters().getThreadRegister();
+        append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
+        Variable result = super.emitForeignCall(linkage, null, thread.asValue(LIRKind.value(AMD64Kind.QWORD)), mode);
+        append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), config.threadLastJavaPcOffset(), thread));
+
+        Map<LIRFrameState, SaveRegistersOp> calleeSaveInfo = getResult().getCalleeSaveInfo();
+        assert !calleeSaveInfo.containsKey(currentRuntimeCallInfo);
+        calleeSaveInfo.put(currentRuntimeCallInfo, saveRegisterOp);
+
+        return result;
+    }
+
+    @Override
+    public void emitTailcall(Value[] args, Value address) {
+        append(new AMD64TailcallOp(args, address));
+    }
+
+    @Override
+    public void emitCCall(long address, CallingConvention nativeCallingConvention, Value[] args, int numberOfFloatingPointArguments) {
+        Value[] argLocations = new Value[args.length];
+        getResult().getFrameMapBuilder().callsMethod(nativeCallingConvention);
+        // TODO(mg): in case a native function uses floating point varargs, the ABI requires that
+        // RAX contains the length of the varargs
+        PrimitiveConstant intConst = JavaConstant.forInt(numberOfFloatingPointArguments);
+        AllocatableValue numberOfFloatingPointArgumentsRegister = AMD64.rax.asValue(LIRKind.value(AMD64Kind.DWORD));
+        emitMoveConstant(numberOfFloatingPointArgumentsRegister, intConst);
+        for (int i = 0; i < args.length; i++) {
+            Value arg = args[i];
+            AllocatableValue loc = nativeCallingConvention.getArgument(i);
+            emitMove(loc, arg);
+            argLocations[i] = loc;
+        }
+        Value ptr = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(address));
+        append(new AMD64CCall(nativeCallingConvention.getReturn(), ptr, numberOfFloatingPointArgumentsRegister, argLocations));
+    }
+
+    @Override
+    public void emitUnwind(Value exception) {
+        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER);
+        CallingConvention outgoingCc = linkage.getOutgoingCallingConvention();
+        assert outgoingCc.getArgumentCount() == 2;
+        RegisterValue exceptionParameter = (RegisterValue) outgoingCc.getArgument(0);
+        emitMove(exceptionParameter, exception);
+        append(new AMD64HotSpotUnwindOp(exceptionParameter));
+    }
+
+    private void moveDeoptValuesToThread(Value actionAndReason, Value speculation) {
+        moveValueToThread(actionAndReason, config.pendingDeoptimizationOffset);
+        moveValueToThread(speculation, config.pendingFailedSpeculationOffset);
+    }
+
+    private void moveValueToThread(Value v, int offset) {
+        LIRKind wordKind = LIRKind.value(target().arch.getWordKind());
+        RegisterValue thread = getProviders().getRegisters().getThreadRegister().asValue(wordKind);
+        AMD64AddressValue address = new AMD64AddressValue(wordKind, thread, offset);
+        arithmeticLIRGen.emitStore(v.getValueKind(), address, v, null);
+    }
+
+    @Override
+    public void emitDeoptimize(Value actionAndReason, Value speculation, LIRFrameState state) {
+        moveDeoptValuesToThread(actionAndReason, speculation);
+        append(new AMD64DeoptimizeOp(state));
+    }
+
+    @Override
+    public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) {
+        Value actionAndReason = emitJavaConstant(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0));
+        Value nullValue = emitConstant(LIRKind.reference(AMD64Kind.QWORD), JavaConstant.NULL_POINTER);
+        moveDeoptValuesToThread(actionAndReason, nullValue);
+        append(new AMD64HotSpotDeoptimizeCallerOp());
+    }
+
+    @Override
+    public void beforeRegisterAllocation() {
+        super.beforeRegisterAllocation();
+        boolean hasDebugInfo = getResult().getLIR().hasDebugInfo();
+        AllocatableValue savedRbp = saveRbp.finalize(hasDebugInfo);
+        if (hasDebugInfo) {
+            getResult().setDeoptimizationRescueSlot(((AMD64FrameMapBuilder) getResult().getFrameMapBuilder()).allocateDeoptimizationRescueSlot());
+        }
+
+        getResult().setMaxInterpreterFrameSize(debugInfoBuilder.maxInterpreterFrameSize());
+
+        for (AMD64HotSpotRestoreRbpOp op : epilogueOps) {
+            op.setSavedRbp(savedRbp);
+        }
+        if (BenchmarkCounters.enabled) {
+            // ensure that the rescue slot is available
+            LIRInstruction op = getOrInitRescueSlotOp();
+            // insert dummy instruction into the start block
+            LIR lir = getResult().getLIR();
+            List<LIRInstruction> instructions = lir.getLIRforBlock(lir.getControlFlowGraph().getStartBlock());
+            instructions.add(1, op);
+            Debug.dump(Debug.INFO_LOG_LEVEL, lir, "created rescue dummy op");
+        }
+    }
+
+    @Override
+    public void emitPushInterpreterFrame(Value frameSize, Value framePc, Value senderSp, Value initialInfo) {
+        Variable frameSizeVariable = load(frameSize);
+        Variable framePcVariable = load(framePc);
+        Variable senderSpVariable = load(senderSp);
+        Variable initialInfoVariable = load(initialInfo);
+        append(new AMD64HotSpotPushInterpreterFrameOp(frameSizeVariable, framePcVariable, senderSpVariable, initialInfoVariable, config));
+    }
+
+    @Override
+    public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
+        LIRKind inputKind = pointer.getValueKind(LIRKind.class);
+        assert inputKind.getPlatformKind() == AMD64Kind.QWORD;
+        if (inputKind.isReference(0)) {
+            // oop
+            Variable result = newVariable(LIRKind.reference(AMD64Kind.DWORD));
+            append(new AMD64HotSpotMove.CompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
+            return result;
+        } else {
+            // metaspace pointer
+            Variable result = newVariable(LIRKind.value(AMD64Kind.DWORD));
+            AllocatableValue base = Value.ILLEGAL;
+            if (encoding.base != 0 || GeneratePIC.getValue()) {
+                if (GeneratePIC.getValue()) {
+                    Variable baseAddress = newVariable(LIRKind.value(AMD64Kind.QWORD));
+                    AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
+                    append(move);
+                    base = baseAddress;
+                } else {
+                    base = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(encoding.base));
+                }
+            }
+            append(new AMD64HotSpotMove.CompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
+            return result;
+        }
+    }
+
+    @Override
+    public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
+        LIRKind inputKind = pointer.getValueKind(LIRKind.class);
+        assert inputKind.getPlatformKind() == AMD64Kind.DWORD;
+        if (inputKind.isReference(0)) {
+            // oop
+            Variable result = newVariable(LIRKind.reference(AMD64Kind.QWORD));
+            append(new AMD64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
+            return result;
+        } else {
+            // metaspace pointer
+            Variable result = newVariable(LIRKind.value(AMD64Kind.QWORD));
+            AllocatableValue base = Value.ILLEGAL;
+            if (encoding.base != 0 || GeneratePIC.getValue()) {
+                if (GeneratePIC.getValue()) {
+                    Variable baseAddress = newVariable(LIRKind.value(AMD64Kind.QWORD));
+                    AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
+                    append(move);
+                    base = baseAddress;
+                } else {
+                    base = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(encoding.base));
+                }
+            }
+            append(new AMD64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
+            return result;
+        }
+    }
+
+    @Override
+    public void emitNullCheck(Value address, LIRFrameState state) {
+        if (address.getValueKind().getPlatformKind() == AMD64Kind.DWORD) {
+            CompressEncoding encoding = config.getOopEncoding();
+            Value uncompressed;
+            if (encoding.shift <= 3) {
+                LIRKind wordKind = LIRKind.unknownReference(target().arch.getWordKind());
+                uncompressed = new AMD64AddressValue(wordKind, getProviders().getRegisters().getHeapBaseRegister().asValue(wordKind), asAllocatable(address), Scale.fromInt(1 << encoding.shift), 0);
+            } else {
+                uncompressed = emitUncompress(address, encoding, false);
+            }
+            append(new AMD64Move.NullCheckOp(asAddressValue(uncompressed), state));
+        } else {
+            super.emitNullCheck(address, state);
+        }
+    }
+
+    @Override
+    public LIRInstruction createBenchmarkCounter(String name, String group, Value increment) {
+        if (BenchmarkCounters.enabled) {
+            return new AMD64HotSpotCounterOp(name, group, increment, getProviders().getRegisters(), config, getOrInitRescueSlot());
+        }
+        throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
+    }
+
+    @Override
+    public LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments) {
+        if (BenchmarkCounters.enabled) {
+            return new AMD64HotSpotCounterOp(names, groups, increments, getProviders().getRegisters(), config, getOrInitRescueSlot());
+        }
+        throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
+    }
+
+    @Override
+    public void emitPrefetchAllocate(Value address) {
+        append(new AMD64PrefetchOp(asAddressValue(address), config.allocatePrefetchInstr));
+    }
+
+    @Override
+    protected StrategySwitchOp createStrategySwitchOp(SwitchStrategy strategy, LabelRef[] keyTargets, LabelRef defaultTarget, Variable key, AllocatableValue temp) {
+        return new AMD64HotSpotStrategySwitchOp(strategy, keyTargets, defaultTarget, key, temp);
+    }
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java
new file mode 100644
index 0000000..24b1123
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.hotspot.amd64;
+
+import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
+import static jdk.vm.ci.code.ValueUtil.asRegister;
+
+import jdk.vm.ci.amd64.AMD64Kind;
+import jdk.vm.ci.code.Register;
+import jdk.vm.ci.meta.AllocatableValue;
+
+import org.graalvm.compiler.asm.amd64.AMD64Address;
+import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler;
+import org.graalvm.compiler.debug.GraalError;
+import org.graalvm.compiler.lir.LIRInstructionClass;
+import org.graalvm.compiler.lir.amd64.AMD64LIRInstruction;
+import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
+
+public final class AMD64HotSpotLoadConfigValueOp extends AMD64LIRInstruction {
+
+    public static final LIRInstructionClass<AMD64HotSpotLoadConfigValueOp> TYPE = LIRInstructionClass.create(AMD64HotSpotLoadConfigValueOp.class);
+
+    @Def({OperandFlag.REG}) protected AllocatableValue result;
+    private final int markId;
+
+    public AMD64HotSpotLoadConfigValueOp(int markId, AllocatableValue result) {
+        super(TYPE);
+        this.result = result;
+        this.markId = markId;
+    }
+
+    @Override
+    public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
+        if (GeneratePIC.getValue()) {
+            AMD64Kind kind = (AMD64Kind) result.getPlatformKind();
+            Register reg = asRegister(result);
+            AMD64Address placeholder = masm.getPlaceholder(-1);
+            switch (kind) {
+                case BYTE:
+                    masm.movsbl(reg, placeholder);
+                    break;
+                case WORD:
+                    masm.movswl(reg, placeholder);
+                    break;
+                case DWORD:
+                    masm.movl(reg, placeholder);
+                    break;
+                case QWORD:
+                    masm.movq(reg, placeholder);
+                    break;
+                default:
+                    throw GraalError.unimplemented();
+            }
+        } else {
+            throw GraalError.unimplemented();
+        }
+        crb.recordMark(markId);
+    }
+
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeCostProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeCostProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeCostProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64RawNativeCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64RawNativeCallNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64RawNativeCallNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64RawNativeCallNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64UncommonTrapStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64UncommonTrapStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64UncommonTrapStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64UncommonTrapStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizationStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizationStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizationStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizationStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRKindTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRKindTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRKindTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeCostProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeCostProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeCostProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCUncommonTrapStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCUncommonTrapStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCUncommonTrapStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCUncommonTrapStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorldOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorldOptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorldOptions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorldOptions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompressEncoding.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompressEncoding.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompressEncoding.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompressEncoding.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/FingerprintUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/FingerprintUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/FingerprintUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/FingerprintUtil.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
new file mode 100644
index 0000000..40cd58c
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
@@ -0,0 +1,793 @@
+/*
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.hotspot;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import org.graalvm.compiler.api.replacements.Fold;
+import org.graalvm.compiler.api.replacements.Fold.InjectedParameter;
+import org.graalvm.compiler.hotspot.nodes.GraalHotSpotVMConfigNode;
+
+import jdk.vm.ci.common.JVMCIError;
+import jdk.vm.ci.hotspot.HotSpotVMConfigAccess;
+import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
+
+/**
+ * Used to access native configuration details.
+ */
+public class GraalHotSpotVMConfig extends HotSpotVMConfigAccess {
+
+    /**
+     * Sentinel value to use for an {@linkplain InjectedParameter injected}
+     * {@link GraalHotSpotVMConfig} parameter to a {@linkplain Fold foldable} method.
+     */
+    public static final GraalHotSpotVMConfig INJECTED_VMCONFIG = null;
+
+    private final boolean isJDK8 = System.getProperty("java.specification.version").compareTo("1.9") < 0;
+    public final String osName = getHostOSName();
+    public final String osArch = getHostArchitectureName();
+    public final boolean windowsOs = System.getProperty("os.name", "").startsWith("Windows");
+    public final boolean linuxOs = System.getProperty("os.name", "").startsWith("Linux");
+
+    GraalHotSpotVMConfig(HotSpotVMConfigStore store) {
+        super(store);
+
+        oopEncoding = new CompressEncoding(narrowOopBase, narrowOopShift, logMinObjAlignment());
+        klassEncoding = new CompressEncoding(narrowKlassBase, narrowKlassShift, logKlassAlignment);
+
+        assert check();
+    }
+
+    /**
+     * Gets the value of a static C++ field under two possible names. {@code name} is the preferred
+     * name and will be checked first.
+     *
+     * @param name fully qualified name of the field
+     * @param alternateName fully qualified alternate name of the field
+     * @param type the boxed type to which the constant value will be converted
+     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
+     * @return the value of the requested field
+     * @throws JVMCIError if the field is not static or not present
+     */
+    public <T> T getFieldValueWithAlternate(String name, String alternateName, Class<T> type, String cppType) {
+        try {
+            return getFieldValue(name, type, cppType);
+        } catch (JVMCIError e) {
+            try {
+                return getFieldValue(alternateName, type, cppType);
+            } catch (JVMCIError e2) {
+                throw new JVMCIError("expected VM field not found: " + name + " or " + alternateName);
+            }
+        }
+    }
+
+    private final CompressEncoding oopEncoding;
+    private final CompressEncoding klassEncoding;
+
+    public CompressEncoding getOopEncoding() {
+        return oopEncoding;
+    }
+
+    public CompressEncoding getKlassEncoding() {
+        return klassEncoding;
+    }
+
+    /**
+     * Gets the host operating system name.
+     */
+    private static String getHostOSName() {
+        String osName = System.getProperty("os.name");
+        switch (osName) {
+            case "Linux":
+                osName = "linux";
+                break;
+            case "SunOS":
+                osName = "solaris";
+                break;
+            case "Mac OS X":
+                osName = "bsd";
+                break;
+            default:
+                // Of course Windows is different...
+                if (osName.startsWith("Windows")) {
+                    osName = "windows";
+                } else {
+                    throw new JVMCIError("Unexpected OS name: " + osName);
+                }
+        }
+        return osName;
+    }
+
+    private static String getHostArchitectureName() {
+        String arch = System.getProperty("os.arch");
+        switch (arch) {
+            case "x86_64":
+                arch = "amd64";
+                break;
+            case "sparcv9":
+                arch = "sparc";
+                break;
+        }
+        return arch;
+    }
+
+    private final Integer intRequiredOnAMD64 = osArch.equals("amd64") ? null : 0;
+    private final Integer intNotPresentInJDK8 = isJDK8 ? 0 : null;
+    private final Long longNotPresentInJDK8 = isJDK8 ? 0L : null;
+
+    public final boolean cAssertions = getConstant("ASSERT", Boolean.class);
+
+    public final int codeEntryAlignment = getFlag("CodeEntryAlignment", Integer.class);
+    public final boolean enableContended = getFlag("EnableContended", Boolean.class);
+    public final boolean restrictContended = getFlag("RestrictContended", Boolean.class);
+    public final int contendedPaddingWidth = getFlag("ContendedPaddingWidth", Integer.class);
+    public final int fieldsAllocationStyle = getFlag("FieldsAllocationStyle", Integer.class);
+    public final boolean compactFields = getFlag("CompactFields", Boolean.class);
+    public final boolean verifyOops = getFlag("VerifyOops", Boolean.class);
+    public final boolean ciTime = getFlag("CITime", Boolean.class);
+    public final boolean ciTimeEach = getFlag("CITimeEach", Boolean.class);
+    public final int compileTheWorldStartAt = getFlag("CompileTheWorldStartAt", Integer.class, 1);
+    public final int compileTheWorldStopAt = getFlag("CompileTheWorldStopAt", Integer.class, Integer.MAX_VALUE);
+    public final boolean dontCompileHugeMethods = getFlag("DontCompileHugeMethods", Boolean.class);
+    public final int hugeMethodLimit = getFlag("HugeMethodLimit", Integer.class);
+    public final boolean printInlining = getFlag("PrintInlining", Boolean.class);
+    public final boolean inline = getFlag("Inline", Boolean.class);
+    public final boolean useFastLocking = getFlag("JVMCIUseFastLocking", Boolean.class);
+    public final boolean forceUnreachable = getFlag("ForceUnreachable", Boolean.class);
+    public final int codeSegmentSize = getFlag("CodeCacheSegmentSize", Integer.class);
+    public final boolean foldStableValues = getFlag("FoldStableValues", Boolean.class);
+
+    public final boolean useTLAB = getFlag("UseTLAB", Boolean.class);
+    public final boolean useBiasedLocking = getFlag("UseBiasedLocking", Boolean.class);
+    public final boolean usePopCountInstruction = getFlag("UsePopCountInstruction", Boolean.class);
+    public final boolean useAESIntrinsics = getFlag("UseAESIntrinsics", Boolean.class);
+    public final boolean useCRC32Intrinsics = getFlag("UseCRC32Intrinsics", Boolean.class);
+
+    private final boolean useMultiplyToLenIntrinsic = getFlag("UseMultiplyToLenIntrinsic", Boolean.class);
+    private final boolean useSHA1Intrinsics = getFlag("UseSHA1Intrinsics", Boolean.class);
+    private final boolean useSHA256Intrinsics = getFlag("UseSHA256Intrinsics", Boolean.class);
+    private final boolean useSHA512Intrinsics = getFlag("UseSHA512Intrinsics", Boolean.class);
+    private final boolean useMontgomeryMultiplyIntrinsic = getFlag("UseMontgomeryMultiplyIntrinsic", Boolean.class, false);
+    private final boolean useMontgomerySquareIntrinsic = getFlag("UseMontgomerySquareIntrinsic", Boolean.class, false);
+    private final boolean useMulAddIntrinsic = getFlag("UseMulAddIntrinsic", Boolean.class, false);
+    private final boolean useSquareToLenIntrinsic = getFlag("UseSquareToLenIntrinsic", Boolean.class, false);
+
+    /*
+     * These are methods because in some JDKs the flags are visible but the stubs themselves haven't
+     * been exported so we have to check both if the flag is on and if we have the stub.
+     */
+    public boolean useMultiplyToLenIntrinsic() {
+        return useMultiplyToLenIntrinsic && multiplyToLen != 0;
+    }
+
+    public boolean useSHA1Intrinsics() {
+        return useSHA1Intrinsics && sha1ImplCompress != 0;
+    }
+
+    public boolean useSHA256Intrinsics() {
+        return useSHA256Intrinsics && sha256ImplCompress != 0;
+    }
+
+    public boolean useSHA512Intrinsics() {
+        return useSHA512Intrinsics && sha512ImplCompress != 0;
+    }
+
+    public boolean useMontgomeryMultiplyIntrinsic() {
+        return useMontgomeryMultiplyIntrinsic && montgomeryMultiply != 0;
+    }
+
+    public boolean useMontgomerySquareIntrinsic() {
+        return useMontgomerySquareIntrinsic && montgomerySquare != 0;
+    }
+
+    public boolean useMulAddIntrinsic() {
+        return useMulAddIntrinsic && mulAdd != 0;
+    }
+
+    public boolean useSquareToLenIntrinsic() {
+        return useSquareToLenIntrinsic && squareToLen != 0;
+    }
+
+    public final boolean useG1GC = getFlag("UseG1GC", Boolean.class);
+    public final boolean useCMSGC = getFlag("UseConcMarkSweepGC", Boolean.class);
+
+    public final int allocatePrefetchStyle = getFlag("AllocatePrefetchStyle", Integer.class);
+    public final int allocatePrefetchInstr = getFlag("AllocatePrefetchInstr", Integer.class);
+    public final int allocatePrefetchLines = getFlag("AllocatePrefetchLines", Integer.class);
+    public final int allocateInstancePrefetchLines = getFlag("AllocateInstancePrefetchLines", Integer.class);
+    public final int allocatePrefetchStepSize = getFlag("AllocatePrefetchStepSize", Integer.class);
+    public final int allocatePrefetchDistance = getFlag("AllocatePrefetchDistance", Integer.class);
+
+    private final long universeCollectedHeap = getFieldValue("CompilerToVM::Data::Universe_collectedHeap", Long.class, "CollectedHeap*");
+    private final int collectedHeapTotalCollectionsOffset = getFieldOffset("CollectedHeap::_total_collections", Integer.class, "unsigned int");
+
+    public long gcTotalCollectionsAddress() {
+        return universeCollectedHeap + collectedHeapTotalCollectionsOffset;
+    }
+
+    public final boolean useDeferredInitBarriers = getFlag("ReduceInitialCardMarks", Boolean.class);
+
+    // Compressed Oops related values.
+    public final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
+    public final boolean useCompressedClassPointers = getFlag("UseCompressedClassPointers", Boolean.class);
+
+    public final long narrowOopBase = getFieldValue("CompilerToVM::Data::Universe_narrow_oop_base", Long.class, "address");
+    public final int narrowOopShift = getFieldValue("CompilerToVM::Data::Universe_narrow_oop_shift", Integer.class, "int");
+    public final int objectAlignment = getFlag("ObjectAlignmentInBytes", Integer.class);
+
+    public final int minObjAlignment() {
+        return objectAlignment / heapWordSize;
+    }
+
+    public final int logMinObjAlignment() {
+        return (int) (Math.log(objectAlignment) / Math.log(2));
+    }
+
+    public final int narrowKlassSize = getFieldValue("CompilerToVM::Data::sizeof_narrowKlass", Integer.class, "int");
+    public final long narrowKlassBase = getFieldValue("CompilerToVM::Data::Universe_narrow_klass_base", Long.class, "address");
+    public final int narrowKlassShift = getFieldValue("CompilerToVM::Data::Universe_narrow_klass_shift", Integer.class, "int");
+    public final int logKlassAlignment = getConstant("LogKlassAlignmentInBytes", Integer.class);
+
+    public final int stackShadowPages = getFlag("StackShadowPages", Integer.class);
+    public final int stackReservedPages = getFlag("StackReservedPages", Integer.class, 0);
+    public final boolean useStackBanging = getFlag("UseStackBanging", Boolean.class);
+    public final int stackBias = getConstant("STACK_BIAS", Integer.class);
+    public final int vmPageSize = getFieldValue("CompilerToVM::Data::vm_page_size", Integer.class, "int");
+
+    public final int markOffset = getFieldOffset("oopDesc::_mark", Integer.class, "markOop");
+    public final int hubOffset = getFieldOffset("oopDesc::_metadata._klass", Integer.class, "Klass*");
+
+    public final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, "markOop");
+    public final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*");
+    public final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*");
+    public final int superCheckOffsetOffset = getFieldOffset("Klass::_super_check_offset", Integer.class, "juint");
+    public final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*");
+    public final int secondarySupersOffset = getFieldOffset("Klass::_secondary_supers", Integer.class, "Array<Klass*>*");
+
+    public final int classMirrorOffset = getFieldOffset("Klass::_java_mirror", Integer.class, "oop");
+
+    public final int klassSuperKlassOffset = getFieldOffset("Klass::_super", Integer.class, "Klass*");
+    public final int klassModifierFlagsOffset = getFieldOffset("Klass::_modifier_flags", Integer.class, "jint");
+    public final int klassAccessFlagsOffset = getFieldOffset("Klass::_access_flags", Integer.class, "AccessFlags");
+    public final int klassLayoutHelperOffset = getFieldOffset("Klass::_layout_helper", Integer.class, "jint");
+
+    public final int klassLayoutHelperNeutralValue = getConstant("Klass::_lh_neutral_value", Integer.class);
+    public final int layoutHelperLog2ElementSizeShift = getConstant("Klass::_lh_log2_element_size_shift", Integer.class);
+    public final int layoutHelperLog2ElementSizeMask = getConstant("Klass::_lh_log2_element_size_mask", Integer.class);
+    public final int layoutHelperElementTypeShift = getConstant("Klass::_lh_element_type_shift", Integer.class);
+    public final int layoutHelperElementTypeMask = getConstant("Klass::_lh_element_type_mask", Integer.class);
+    public final int layoutHelperHeaderSizeShift = getConstant("Klass::_lh_header_size_shift", Integer.class);
+    public final int layoutHelperHeaderSizeMask = getConstant("Klass::_lh_header_size_mask", Integer.class);
+    public final int layoutHelperArrayTagShift = getConstant("Klass::_lh_array_tag_shift", Integer.class);
+    public final int layoutHelperArrayTagTypeValue = getConstant("Klass::_lh_array_tag_type_value", Integer.class);
+    public final int layoutHelperArrayTagObjectValue = getConstant("Klass::_lh_array_tag_obj_value", Integer.class);
+
+    /**
+     * This filters out the bit that differentiates a type array from an object array.
+     */
+    public int layoutHelperElementTypePrimitiveInPlace() {
+        return (layoutHelperArrayTagTypeValue & ~layoutHelperArrayTagObjectValue) << layoutHelperArrayTagShift;
+    }
+
+    public final int vtableEntrySize = getFieldValue("CompilerToVM::Data::sizeof_vtableEntry", Integer.class, "int");
+    public final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*");
+
+    public final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1");
+    public final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*");
+    public final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*");
+    public final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int");
+    public final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int");
+
+    public final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class);
+    public final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class);
+
+    public final int arrayOopDescSize = getFieldValue("CompilerToVM::Data::sizeof_arrayOopDesc", Integer.class, "int");
+
+    /**
+     * The offset of the array length word in an array object's header.
+     *
+     * See {@code arrayOopDesc::length_offset_in_bytes()}.
+     */
+    public final int arrayOopDescLengthOffset() {
+        return useCompressedClassPointers ? hubOffset + narrowKlassSize : arrayOopDescSize;
+    }
+
+    public final int arrayU1LengthOffset = getFieldOffset("Array<int>::_length", Integer.class, "int");
+    public final int arrayU1DataOffset = getFieldOffset("Array<u1>::_data", Integer.class);
+    public final int arrayU2DataOffset = getFieldOffset("Array<u2>::_data", Integer.class);
+    public final int metaspaceArrayLengthOffset = getFieldOffset("Array<Klass*>::_length", Integer.class, "int");
+    public final int metaspaceArrayBaseOffset = getFieldOffset("Array<Klass*>::_data[0]", Integer.class, "Klass*");
+
+    public final int arrayClassElementOffset = getFieldOffset("ObjArrayKlass::_element_klass", Integer.class, "Klass*");
+
+    public final int fieldInfoAccessFlagsOffset = getConstant("FieldInfo::access_flags_offset", Integer.class);
+    public final int fieldInfoNameIndexOffset = getConstant("FieldInfo::name_index_offset", Integer.class);
+    public final int fieldInfoSignatureIndexOffset = getConstant("FieldInfo::signature_index_offset", Integer.class);
+    public final int fieldInfoInitvalIndexOffset = getConstant("FieldInfo::initval_index_offset", Integer.class);
+    public final int fieldInfoLowPackedOffset = getConstant("FieldInfo::low_packed_offset", Integer.class);
+    public final int fieldInfoHighPackedOffset = getConstant("FieldInfo::high_packed_offset", Integer.class);
+    public final int fieldInfoFieldSlots = getConstant("FieldInfo::field_slots", Integer.class);
+
+    public final int fieldInfoTagSize = getConstant("FIELDINFO_TAG_SIZE", Integer.class);
+
+    public final int jvmAccMonitorMatch = getConstant("JVM_ACC_MONITOR_MATCH", Integer.class);
+    public final int jvmAccHasMonitorBytecodes = getConstant("JVM_ACC_HAS_MONITOR_BYTECODES", Integer.class);
+    public final int jvmAccHasFinalizer = getConstant("JVM_ACC_HAS_FINALIZER", Integer.class);
+    public final int jvmAccFieldInternal = getConstant("JVM_ACC_FIELD_INTERNAL", Integer.class);
+    public final int jvmAccFieldStable = getConstant("JVM_ACC_FIELD_STABLE", Integer.class);
+    public final int jvmAccFieldHasGenericSignature = getConstant("JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE", Integer.class);
+    public final int jvmAccWrittenFlags = getConstant("JVM_ACC_WRITTEN_FLAGS", Integer.class);
+    public final int jvmAccSynthetic = getConstant("JVM_ACC_SYNTHETIC", Integer.class);
+
+    public final int threadTlabOffset = getFieldOffset("Thread::_tlab", Integer.class, "ThreadLocalAllocBuffer");
+    public final int javaThreadAnchorOffset = getFieldOffset("JavaThread::_anchor", Integer.class, "JavaFrameAnchor");
+    public final int threadObjectOffset = getFieldOffset("JavaThread::_threadObj", Integer.class, "oop");
+    public final int osThreadOffset = getFieldOffset("JavaThread::_osthread", Integer.class, "OSThread*");
+    public final int javaThreadDirtyCardQueueOffset = getFieldOffset("JavaThread::_dirty_card_queue", Integer.class, "DirtyCardQueue");
+    public final int threadIsMethodHandleReturnOffset = getFieldOffset("JavaThread::_is_method_handle_return", Integer.class, "int");
+    public final int javaThreadSatbMarkQueueOffset = getFieldOffset("JavaThread::_satb_mark_queue", Integer.class);
+    public final int threadObjectResultOffset = getFieldOffset("JavaThread::_vm_result", Integer.class, "oop");
+    public final int jvmciCountersThreadOffset = getFieldOffset("JavaThread::_jvmci_counters", Integer.class, "jlong*");
+    public final int javaThreadReservedStackActivationOffset = getFieldOffset("JavaThread::_reserved_stack_activation", Integer.class, "address", intNotPresentInJDK8);
+
+    /**
+     * An invalid value for {@link #rtldDefault}.
+     */
+    public static final long INVALID_RTLD_DEFAULT_HANDLE = 0xDEADFACE;
+
+    /**
+     * Address of the library lookup routine. The C signature of this routine is:
+     *
+     * <pre>
+     *     void* (const char *filename, char *ebuf, int ebuflen)
+     * </pre>
+     */
+    public final long dllLoad = getAddress("os::dll_load");
+
+    /**
+     * Address of the library lookup routine. The C signature of this routine is:
+     *
+     * <pre>
+     *     void* (void* handle, const char* name)
+     * </pre>
+     */
+    public final long dllLookup = getAddress("os::dll_lookup");
+
+    /**
+     * A pseudo-handle which when used as the first argument to {@link #dllLookup} means lookup will
+     * return the first occurrence of the desired symbol using the default library search order. If
+     * this field is {@value #INVALID_RTLD_DEFAULT_HANDLE}, then this capability is not supported on
+     * the current platform.
+     */
+    public final long rtldDefault = getAddress("RTLD_DEFAULT", osName.equals("bsd") || osName.equals("linux") ? null : INVALID_RTLD_DEFAULT_HANDLE);
+
+    /**
+     * This field is used to pass exception objects into and out of the runtime system during
+     * exception handling for compiled code.
+     */
+    public final int threadExceptionOopOffset = getFieldOffset("JavaThread::_exception_oop", Integer.class, "oop");
+    public final int threadExceptionPcOffset = getFieldOffset("JavaThread::_exception_pc", Integer.class, "address");
+    public final int pendingExceptionOffset = getFieldOffset("ThreadShadow::_pending_exception", Integer.class, "oop");
+
+    public final int pendingDeoptimizationOffset = getFieldOffset("JavaThread::_pending_deoptimization", Integer.class, "int");
+    public final int pendingFailedSpeculationOffset = getFieldOffset("JavaThread::_pending_failed_speculation", Integer.class, "oop");
+    public final int pendingTransferToInterpreterOffset = getFieldOffset("JavaThread::_pending_transfer_to_interpreter", Integer.class, "bool");
+
+    private final int javaFrameAnchorLastJavaSpOffset = getFieldOffset("JavaFrameAnchor::_last_Java_sp", Integer.class, "intptr_t*");
+    private final int javaFrameAnchorLastJavaPcOffset = getFieldOffset("JavaFrameAnchor::_last_Java_pc", Integer.class, "address");
+
+    public int threadLastJavaSpOffset() {
+        return javaThreadAnchorOffset + javaFrameAnchorLastJavaSpOffset;
+    }
+
+    public int threadLastJavaPcOffset() {
+        return javaThreadAnchorOffset + javaFrameAnchorLastJavaPcOffset;
+    }
+
+    public int threadLastJavaFpOffset() {
+        assert osArch.equals("aarch64") || osArch.equals("amd64");
+        return javaThreadAnchorOffset + getFieldOffset("JavaFrameAnchor::_last_Java_fp", Integer.class, "intptr_t*");
+    }
+
+    public int threadJavaFrameAnchorFlagsOffset() {
+        assert osArch.equals("sparc");
+        return javaThreadAnchorOffset + getFieldOffset("JavaFrameAnchor::_flags", Integer.class, "int");
+    }
+
+    public final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, intRequiredOnAMD64);
+    public final int frameInterpreterFrameSenderSpOffset = getConstant("frame::interpreter_frame_sender_sp_offset", Integer.class, intRequiredOnAMD64);
+    public final int frameInterpreterFrameLastSpOffset = getConstant("frame::interpreter_frame_last_sp_offset", Integer.class, intRequiredOnAMD64);
+
+    private final int dirtyCardQueueBufferOffset = isJDK8 ? getFieldOffset("PtrQueue::_buf", Integer.class, "void**") : getConstant("dirtyCardQueueBufferOffset", Integer.class);
+    private final int dirtyCardQueueIndexOffset = isJDK8 ? getFieldOffset("PtrQueue::_index", Integer.class, "size_t") : getConstant("dirtyCardQueueIndexOffset", Integer.class);
+
+    private final int satbMarkQueueBufferOffset = getConstant("satbMarkQueueBufferOffset", Integer.class, intNotPresentInJDK8);
+    private final int satbMarkQueueIndexOffset = getConstant("satbMarkQueueIndexOffset", Integer.class, intNotPresentInJDK8);
+    private final int satbMarkQueueActiveOffset = isJDK8 ? getFieldOffset("PtrQueue::_active", Integer.class, "bool") : getConstant("satbMarkQueueActiveOffset", Integer.class, intNotPresentInJDK8);
+
+    public final int osThreadInterruptedOffset = getFieldOffset("OSThread::_interrupted", Integer.class, "jint");
+
+    public final long markOopDescHashShift = getConstant("markOopDesc::hash_shift", Long.class);
+
+    public final int biasedLockMaskInPlace = getConstant("markOopDesc::biased_lock_mask_in_place", Integer.class);
+    public final int ageMaskInPlace = getConstant("markOopDesc::age_mask_in_place", Integer.class);
+    public final int epochMaskInPlace = getConstant("markOopDesc::epoch_mask_in_place", Integer.class);
+    public final long markOopDescHashMask = getConstant("markOopDesc::hash_mask", Long.class);
+    public final long markOopDescHashMaskInPlace = getConstant("markOopDesc::hash_mask_in_place", Long.class);
+
+    public final int unlockedMask = getConstant("markOopDesc::unlocked_value", Integer.class);
+    public final int biasedLockPattern = getConstant("markOopDesc::biased_lock_pattern", Integer.class);
+
+    public final int markWordNoHashInPlace = getConstant("markOopDesc::no_hash_in_place", Integer.class);
+    public final int markWordNoLockInPlace = getConstant("markOopDesc::no_lock_in_place", Integer.class);
+
+    /**
+     * See {@code markOopDesc::prototype()}.
+     */
+    public long arrayPrototypeMarkWord() {
+        return markWordNoHashInPlace | markWordNoLockInPlace;
+    }
+
+    /**
+     * See {@code markOopDesc::copy_set_hash()}.
+     */
+    public long tlabIntArrayMarkWord() {
+        long tmp = arrayPrototypeMarkWord() & (~markOopDescHashMaskInPlace);
+        tmp |= ((0x2 & markOopDescHashMask) << markOopDescHashShift);
+        return tmp;
+    }
+
+    /**
+     * Mark word right shift to get identity hash code.
+     */
+    public final int identityHashCodeShift = getConstant("markOopDesc::hash_shift", Integer.class);
+
+    /**
+     * Identity hash code value when uninitialized.
+     */
+    public final int uninitializedIdentityHashCodeValue = getConstant("markOopDesc::no_hash", Integer.class);
+
+    public final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags");
+    public final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*");
+    public final int methodIntrinsicIdOffset = getFieldOffset("Method::_intrinsic_id", Integer.class, isJDK8 ? "u1" : "u2");
+    public final int methodFlagsOffset = getFieldOffset("Method::_flags", Integer.class, isJDK8 ? "u1" : "u2");
+    public final int methodVtableIndexOffset = getFieldOffset("Method::_vtable_index", Integer.class, "int");
+
+    public final int methodCountersOffset = getFieldOffset("Method::_method_counters", Integer.class, "MethodCounters*");
+    public final int methodDataOffset = getFieldOffset("Method::_method_data", Integer.class, "MethodData*");
+    public final int methodCompiledEntryOffset = getFieldOffset("Method::_from_compiled_entry", Integer.class, "address");
+    public final int methodCodeOffset = getFieldOffset("Method::_code", Integer.class, isJDK8 ? "nmethod*" : "CompiledMethod*");
+
+    public final int methodFlagsCallerSensitive = getConstant("Method::_caller_sensitive", Integer.class);
+    public final int methodFlagsForceInline = getConstant("Method::_force_inline", Integer.class);
+    public final int methodFlagsDontInline = getConstant("Method::_dont_inline", Integer.class);
+    public final int methodFlagsHidden = getConstant("Method::_hidden", Integer.class);
+    public final int nonvirtualVtableIndex = getConstant("Method::nonvirtual_vtable_index", Integer.class);
+    public final int invalidVtableIndex = getConstant("Method::invalid_vtable_index", Integer.class);
+
+    public final int invocationCounterOffset = getFieldOffset("MethodCounters::_invocation_counter", Integer.class, "InvocationCounter");
+    public final int backedgeCounterOffset = getFieldOffset("MethodCounters::_backedge_counter", Integer.class, "InvocationCounter");
+    public final int invocationCounterIncrement = getConstant("InvocationCounter::count_increment", Integer.class, intNotPresentInJDK8);
+    public final int invocationCounterShift = getConstant("InvocationCounter::count_shift", Integer.class, intNotPresentInJDK8);
+
+    public final int nmethodEntryOffset = getFieldOffset("nmethod::_verified_entry_point",
+                    Integer.class, "address");
+    public final int compilationLevelFullOptimization = getConstant("CompLevel_full_optimization",
+                    Integer.class);
+
+    public final int constantPoolSize = getFieldValue("CompilerToVM::Data::sizeof_ConstantPool", Integer.class, "int");
+    public final int constantPoolLengthOffset = getFieldOffset("ConstantPool::_length",
+                    Integer.class, "int");
+
+    public final int heapWordSize = getConstant("HeapWordSize", Integer.class);
+
+    /**
+     * Bit pattern that represents a non-oop. Neither the high bits nor the low bits of this value
+     * are allowed to look like (respectively) the high or low bits of a real oop.
+     */
+    public final long nonOopBits = getFieldValue("CompilerToVM::Data::Universe_non_oop_bits", Long.class, "void*");
+
+    public final long verifyOopCounterAddress = getFieldAddress("StubRoutines::_verify_oop_count", "jint");
+    public final long verifyOopMask = getFieldValue("CompilerToVM::Data::Universe_verify_oop_mask", Long.class, "uintptr_t");
+    public final long verifyOopBits = getFieldValue("CompilerToVM::Data::Universe_verify_oop_bits", Long.class, "uintptr_t");
+
+    public final int logOfHRGrainBytes = getFieldValue("HeapRegion::LogOfHRGrainBytes", Integer.class, "int");
+
+    public final byte dirtyCardValue = isJDK8 ? getFieldValue("CompilerToVM::Data::dirty_card", Byte.class, "int") : getConstant("CardTableModRefBS::dirty_card", Byte.class);
+    public final byte g1YoungCardValue = isJDK8 ? getFieldValue("CompilerToVM::Data::g1_young_card", Byte.class, "int") : getConstant("G1SATBCardTableModRefBS::g1_young_gen", Byte.class);
+
+    public final long cardtableStartAddress = getFieldValue("CompilerToVM::Data::cardtable_start_address", Long.class, "jbyte*");
+    public final int cardtableShift = getFieldValue("CompilerToVM::Data::cardtable_shift", Integer.class, "int");
+
+    /**
+     * This is the largest stack offset encodeable in an OopMapValue. Offsets larger than this will
+     * throw an exception during code installation.
+     */
+    public final int maxOopMapStackOffset = getFieldValueWithAlternate("CompilerToVM::Data::_max_oop_map_stack_offset", "JVMCIRuntime::max_oop_map_stack_offset", Integer.class, "int");
+
+    public final long safepointPollingAddress = getFieldValue("os::_polling_page", Long.class, "address");
+
+    // G1 Collector Related Values.
+
+    public int g1CardQueueIndexOffset() {
+        return javaThreadDirtyCardQueueOffset + dirtyCardQueueIndexOffset;
+    }
+
+    public int g1CardQueueBufferOffset() {
+        return javaThreadDirtyCardQueueOffset + dirtyCardQueueBufferOffset;
+    }
+
+    public int g1SATBQueueMarkingOffset() {
+        return javaThreadSatbMarkQueueOffset + satbMarkQueueActiveOffset;
+    }
+
+    public int g1SATBQueueIndexOffset() {
+        return javaThreadSatbMarkQueueOffset + (isJDK8 ? dirtyCardQueueIndexOffset : satbMarkQueueIndexOffset);
+    }
+
+    public int g1SATBQueueBufferOffset() {
+        return javaThreadSatbMarkQueueOffset + (isJDK8 ? dirtyCardQueueBufferOffset : satbMarkQueueBufferOffset);
+    }
+
+    public final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int");
+    public final int arrayKlassOffset = getFieldValue("java_lang_Class::_array_klass_offset", Integer.class, "int");
+
+    public final int basicLockSize = getFieldValue("CompilerToVM::Data::sizeof_BasicLock", Integer.class, "int");
+    public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, "markOop");
+
+    public final int threadAllocatedBytesOffset = getFieldOffset("Thread::_allocated_bytes", Integer.class, "jlong");
+
+    public final int tlabRefillWasteIncrement = getFlag("TLABWasteIncrement", Integer.class);
+
+    private final int threadLocalAllocBufferStartOffset = getFieldOffset("ThreadLocalAllocBuffer::_start", Integer.class, "HeapWord*");
+    private final int threadLocalAllocBufferEndOffset = getFieldOffset("ThreadLocalAllocBuffer::_end", Integer.class, "HeapWord*");
+    private final int threadLocalAllocBufferTopOffset = getFieldOffset("ThreadLocalAllocBuffer::_top", Integer.class, "HeapWord*");
+    private final int threadLocalAllocBufferPfTopOffset = getFieldOffset("ThreadLocalAllocBuffer::_pf_top", Integer.class, "HeapWord*");
+    private final int threadLocalAllocBufferSlowAllocationsOffset = getFieldOffset("ThreadLocalAllocBuffer::_slow_allocations", Integer.class, "unsigned");
+    private final int threadLocalAllocBufferFastRefillWasteOffset = getFieldOffset("ThreadLocalAllocBuffer::_fast_refill_waste", Integer.class, "unsigned");
+    private final int threadLocalAllocBufferNumberOfRefillsOffset = getFieldOffset("ThreadLocalAllocBuffer::_number_of_refills", Integer.class, "unsigned");
+    private final int threadLocalAllocBufferRefillWasteLimitOffset = getFieldOffset("ThreadLocalAllocBuffer::_refill_waste_limit", Integer.class, "size_t");
+    private final int threadLocalAllocBufferDesiredSizeOffset = getFieldOffset("ThreadLocalAllocBuffer::_desired_size", Integer.class, "size_t");
+
+    public int tlabSlowAllocationsOffset() {
+        return threadTlabOffset + threadLocalAllocBufferSlowAllocationsOffset;
+    }
+
+    public int tlabFastRefillWasteOffset() {
+        return threadTlabOffset + threadLocalAllocBufferFastRefillWasteOffset;
+    }
+
+    public int tlabNumberOfRefillsOffset() {
+        return threadTlabOffset + threadLocalAllocBufferNumberOfRefillsOffset;
+    }
+
+    public int tlabRefillWasteLimitOffset() {
+        return threadTlabOffset + threadLocalAllocBufferRefillWasteLimitOffset;
+    }
+
+    public int threadTlabSizeOffset() {
+        return threadTlabOffset + threadLocalAllocBufferDesiredSizeOffset;
+    }
+
+    public int threadTlabStartOffset() {
+        return threadTlabOffset + threadLocalAllocBufferStartOffset;
+    }
+
+    public int threadTlabEndOffset() {
+        return threadTlabOffset + threadLocalAllocBufferEndOffset;
+    }
+
+    public int threadTlabTopOffset() {
+        return threadTlabOffset + threadLocalAllocBufferTopOffset;
+    }
+
+    public int threadTlabPfTopOffset() {
+        return threadTlabOffset + threadLocalAllocBufferPfTopOffset;
+    }
+
+    public final int tlabAlignmentReserve = getFieldValue("CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve", Integer.class, "size_t");
+
+    public final boolean tlabStats = getFlag("TLABStats", Boolean.class);
+
+    // FIXME This is only temporary until the GC code is changed.
+    public final boolean inlineContiguousAllocationSupported = getFieldValue("CompilerToVM::Data::_supports_inline_contig_alloc", Boolean.class);
+    public final long heapEndAddress = getFieldValue("CompilerToVM::Data::_heap_end_addr", Long.class, "HeapWord**");
+    public final long heapTopAddress = getFieldValue("CompilerToVM::Data::_heap_top_addr", Long.class, isJDK8 ? "HeapWord**" : "HeapWord* volatile*");
+
+    public final long inlineCacheMissStub = getFieldValue("CompilerToVM::Data::SharedRuntime_ic_miss_stub", Long.class, "address");
+    public final long handleWrongMethodStub = getFieldValue("CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", Long.class, "address");
+
+    public final long handleDeoptStub = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", Long.class, "address");
+    public final long uncommonTrapStub = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", Long.class, "address");
+
+    public final long codeCacheLowBound = getFieldValue(isJDK8 ? "CompilerToVM::Data::CodeCache_low_bound" : "CodeCache::_low_bound", Long.class, "address");
+    public final long codeCacheHighBound = getFieldValue(isJDK8 ? "CompilerToVM::Data::CodeCache_high_bound" : "CodeCache::_high_bound", Long.class, "address");
+
+    public final long aescryptEncryptBlockStub = getFieldValue("StubRoutines::_aescrypt_encryptBlock", Long.class, "address");
+    public final long aescryptDecryptBlockStub = getFieldValue("StubRoutines::_aescrypt_decryptBlock", Long.class, "address");
+    public final long cipherBlockChainingEncryptAESCryptStub = getFieldValue("StubRoutines::_cipherBlockChaining_encryptAESCrypt", Long.class, "address");
+    public final long cipherBlockChainingDecryptAESCryptStub = getFieldValue("StubRoutines::_cipherBlockChaining_decryptAESCrypt", Long.class, "address");
+    public final long updateBytesCRC32Stub = getFieldValue("StubRoutines::_updateBytesCRC32", Long.class, "address");
+    public final long crcTableAddress = getFieldValue("StubRoutines::_crc_table_adr", Long.class, "address");
+
+    public final long sha1ImplCompress = getFieldValue("StubRoutines::_sha1_implCompress", Long.class, "address", 0L);
+    public final long sha1ImplCompressMB = getFieldValue("StubRoutines::_sha1_implCompressMB", Long.class, "address", 0L);
+    public final long sha256ImplCompress = getFieldValue("StubRoutines::_sha256_implCompress", Long.class, "address", 0L);
+    public final long sha256ImplCompressMB = getFieldValue("StubRoutines::_sha256_implCompressMB", Long.class, "address", 0L);
+    public final long sha512ImplCompress = getFieldValue("StubRoutines::_sha512_implCompress", Long.class, "address", 0L);
+    public final long sha512ImplCompressMB = getFieldValue("StubRoutines::_sha512_implCompressMB", Long.class, "address", 0L);
+    public final long multiplyToLen = getFieldValue("StubRoutines::_multiplyToLen", Long.class, "address", 0L);
+
+    public final long counterModeAESCrypt = getFieldValue("StubRoutines::_counterMode_AESCrypt", Long.class, "address", 0L);
+    public final long ghashProcessBlocks = getFieldValue("StubRoutines::_ghash_processBlocks", Long.class, "address", 0L);
+    public final long crc32cTableTddr = getFieldValue("StubRoutines::_crc32c_table_addr", Long.class, "address", 0L);
+    public final long updateBytesCRC32C = getFieldValue("StubRoutines::_updateBytesCRC32C", Long.class, "address", 0L);
+    public final long updateBytesAdler32 = getFieldValue("StubRoutines::_updateBytesAdler32", Long.class, "address", 0L);
+    public final long squareToLen = getFieldValue("StubRoutines::_squareToLen", Long.class, "address", 0L);
+    public final long mulAdd = getFieldValue("StubRoutines::_mulAdd", Long.class, "address", 0L);
+    public final long montgomeryMultiply = getFieldValue("StubRoutines::_montgomeryMultiply", Long.class, "address", 0L);
+    public final long montgomerySquare = getFieldValue("StubRoutines::_montgomerySquare", Long.class, "address", 0L);
+    public final long vectorizedMismatch = getFieldValue("StubRoutines::_vectorizedMismatch", Long.class, "address", 0L);
+
+    public final long throwDelayedStackOverflowErrorEntry = getFieldValue("StubRoutines::_throw_delayed_StackOverflowError_entry", Long.class, "address", longNotPresentInJDK8);
+
+    public final long jbyteArraycopy = getFieldValue("StubRoutines::_jbyte_arraycopy", Long.class, "address");
+    public final long jshortArraycopy = getFieldValue("StubRoutines::_jshort_arraycopy", Long.class, "address");
+    public final long jintArraycopy = getFieldValue("StubRoutines::_jint_arraycopy", Long.class, "address");
+    public final long jlongArraycopy = getFieldValue("StubRoutines::_jlong_arraycopy", Long.class, "address");
+    public final long oopArraycopy = getFieldValue("StubRoutines::_oop_arraycopy", Long.class, "address");
+    public final long oopArraycopyUninit = getFieldValue("StubRoutines::_oop_arraycopy_uninit", Long.class, "address");
+    public final long jbyteDisjointArraycopy = getFieldValue("StubRoutines::_jbyte_disjoint_arraycopy", Long.class, "address");
+    public final long jshortDisjointArraycopy = getFieldValue("StubRoutines::_jshort_disjoint_arraycopy", Long.class, "address");
+    public final long jintDisjointArraycopy = getFieldValue("StubRoutines::_jint_disjoint_arraycopy", Long.class, "address");
+    public final long jlongDisjointArraycopy = getFieldValue("StubRoutines::_jlong_disjoint_arraycopy", Long.class, "address");
+    public final long oopDisjointArraycopy = getFieldValue("StubRoutines::_oop_disjoint_arraycopy", Long.class, "address");
+    public final long oopDisjointArraycopyUninit = getFieldValue("StubRoutines::_oop_disjoint_arraycopy_uninit", Long.class, "address");
+    public final long jbyteAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_jbyte_arraycopy", Long.class, "address");
+    public final long jshortAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_jshort_arraycopy", Long.class, "address");
+    public final long jintAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_jint_arraycopy", Long.class, "address");
+    public final long jlongAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_jlong_arraycopy", Long.class, "address");
+    public final long oopAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_oop_arraycopy", Long.class, "address");
+    public final long oopAlignedArraycopyUninit = getFieldValue("StubRoutines::_arrayof_oop_arraycopy_uninit", Long.class, "address");
+    public final long jbyteAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_jbyte_disjoint_arraycopy", Long.class, "address");
+    public final long jshortAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_jshort_disjoint_arraycopy", Long.class, "address");
+    public final long jintAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_jint_disjoint_arraycopy", Long.class, "address");
+    public final long jlongAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_jlong_disjoint_arraycopy", Long.class, "address");
+    public final long oopAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_oop_disjoint_arraycopy", Long.class, "address");
+    public final long oopAlignedDisjointArraycopyUninit = getFieldValue("StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit", Long.class, "address");
+    public final long checkcastArraycopy = getFieldValue("StubRoutines::_checkcast_arraycopy", Long.class, "address");
+    public final long checkcastArraycopyUninit = getFieldValue("StubRoutines::_checkcast_arraycopy_uninit", Long.class, "address");
+    public final long unsafeArraycopy = getFieldValue("StubRoutines::_unsafe_arraycopy", Long.class, "address");
+    public final long genericArraycopy = getFieldValue("StubRoutines::_generic_arraycopy", Long.class, "address");
+
+    public final long newInstanceAddress = getAddress("JVMCIRuntime::new_instance");
+    public final long newArrayAddress = getAddress("JVMCIRuntime::new_array");
+    public final long newMultiArrayAddress = getAddress("JVMCIRuntime::new_multi_array");
+    public final long dynamicNewArrayAddress = getAddress("JVMCIRuntime::dynamic_new_array");
+    public final long dynamicNewInstanceAddress = getAddress("JVMCIRuntime::dynamic_new_instance");
+
+    public final long threadIsInterruptedAddress = getAddress("JVMCIRuntime::thread_is_interrupted");
+    public final long vmMessageAddress = getAddress("JVMCIRuntime::vm_message");
+    public final long identityHashCodeAddress = getAddress("JVMCIRuntime::identity_hash_code");
+    public final long exceptionHandlerForPcAddress = getAddress("JVMCIRuntime::exception_handler_for_pc");
+    public final long monitorenterAddress = getAddress("JVMCIRuntime::monitorenter");
+    public final long monitorexitAddress = getAddress("JVMCIRuntime::monitorexit");
+    public final long throwAndPostJvmtiExceptionAddress = getAddress("JVMCIRuntime::throw_and_post_jvmti_exception");
+    public final long throwKlassExternalNameExceptionAddress = getAddress("JVMCIRuntime::throw_klass_external_name_exception");
+    public final long throwClassCastExceptionAddress = getAddress("JVMCIRuntime::throw_class_cast_exception");
+    public final long logPrimitiveAddress = getAddress("JVMCIRuntime::log_primitive");
+    public final long logObjectAddress = getAddress("JVMCIRuntime::log_object");
+    public final long logPrintfAddress = getAddress("JVMCIRuntime::log_printf");
+    public final long vmErrorAddress = getAddress("JVMCIRuntime::vm_error");
+    public final long loadAndClearExceptionAddress = getAddress("JVMCIRuntime::load_and_clear_exception");
+    public final long writeBarrierPreAddress = getAddress("JVMCIRuntime::write_barrier_pre");
+    public final long writeBarrierPostAddress = getAddress("JVMCIRuntime::write_barrier_post");
+    public final long validateObject = getAddress("JVMCIRuntime::validate_object");
+
+    public final long testDeoptimizeCallInt = getAddress("JVMCIRuntime::test_deoptimize_call_int");
+
+    public final long registerFinalizerAddress = getAddress("SharedRuntime::register_finalizer");
+    public final long exceptionHandlerForReturnAddressAddress = getAddress("SharedRuntime::exception_handler_for_return_address");
+    public final long osrMigrationEndAddress = getAddress("SharedRuntime::OSR_migration_end");
+    public final long enableStackReservedZoneAddress = getAddress("SharedRuntime::enable_stack_reserved_zone", longNotPresentInJDK8);
+
+    public final long javaTimeMillisAddress = getAddress("os::javaTimeMillis");
+    public final long javaTimeNanosAddress = getAddress("os::javaTimeNanos");
+    public final long arithmeticSinAddress = getFieldValue("CompilerToVM::Data::dsin", Long.class, "address");
+    public final long arithmeticCosAddress = getFieldValue("CompilerToVM::Data::dcos", Long.class, "address");
+    public final long arithmeticTanAddress = getFieldValue("CompilerToVM::Data::dtan", Long.class, "address");
+    public final long arithmeticExpAddress = getFieldValue("CompilerToVM::Data::dexp", Long.class, "address");
+    public final long arithmeticLogAddress = getFieldValue("CompilerToVM::Data::dlog", Long.class, "address");
+    public final long arithmeticLog10Address = getFieldValue("CompilerToVM::Data::dlog10", Long.class, "address");
+    public final long arithmeticPowAddress = getFieldValue("CompilerToVM::Data::dpow", Long.class, "address");
+
+    public final long fremAddress = getAddress("SharedRuntime::frem");
+    public final long dremAddress = getAddress("SharedRuntime::drem");
+
+    public final int jvmciCountersSize = getFlag("JVMCICounterSize", Integer.class);
+
+    public final long deoptimizationFetchUnrollInfo = getAddress("Deoptimization::fetch_unroll_info");
+    public final long deoptimizationUncommonTrap = getAddress("Deoptimization::uncommon_trap");
+    public final long deoptimizationUnpackFrames = getAddress("Deoptimization::unpack_frames");
+
+    public final int deoptimizationUnpackDeopt = getConstant("Deoptimization::Unpack_deopt", Integer.class);
+    public final int deoptimizationUnpackException = getConstant("Deoptimization::Unpack_exception", Integer.class);
+    public final int deoptimizationUnpackUncommonTrap = getConstant("Deoptimization::Unpack_uncommon_trap", Integer.class);
+    public final int deoptimizationUnpackReexecute = getConstant("Deoptimization::Unpack_reexecute", Integer.class);
+
+    public final int deoptimizationUnrollBlockSizeOfDeoptimizedFrameOffset = getFieldOffset("Deoptimization::UnrollBlock::_size_of_deoptimized_frame", Integer.class, "int");
+    public final int deoptimizationUnrollBlockCallerAdjustmentOffset = getFieldOffset("Deoptimization::UnrollBlock::_caller_adjustment", Integer.class, "int");
+    public final int deoptimizationUnrollBlockNumberOfFramesOffset = getFieldOffset("Deoptimization::UnrollBlock::_number_of_frames", Integer.class, "int");
+    public final int deoptimizationUnrollBlockTotalFrameSizesOffset = getFieldOffset("Deoptimization::UnrollBlock::_total_frame_sizes", Integer.class, "int");
+    public final int deoptimizationUnrollBlockUnpackKindOffset = getFieldOffset("Deoptimization::UnrollBlock::_unpack_kind", Integer.class, "int");
+    public final int deoptimizationUnrollBlockFrameSizesOffset = getFieldOffset("Deoptimization::UnrollBlock::_frame_sizes", Integer.class, "intptr_t*");
+    public final int deoptimizationUnrollBlockFramePcsOffset = getFieldOffset("Deoptimization::UnrollBlock::_frame_pcs", Integer.class, "address*");
+    public final int deoptimizationUnrollBlockInitialInfoOffset = getFieldOffset("Deoptimization::UnrollBlock::_initial_info", Integer.class, "intptr_t");
+
+    // Checkstyle: stop
+    public final int MARKID_VERIFIED_ENTRY = getConstant("CodeInstaller::VERIFIED_ENTRY", Integer.class);
+    public final int MARKID_UNVERIFIED_ENTRY = getConstant("CodeInstaller::UNVERIFIED_ENTRY", Integer.class);
+    public final int MARKID_OSR_ENTRY = getConstant("CodeInstaller::OSR_ENTRY", Integer.class);
+    public final int MARKID_EXCEPTION_HANDLER_ENTRY = getConstant("CodeInstaller::EXCEPTION_HANDLER_ENTRY", Integer.class);
+    public final int MARKID_DEOPT_HANDLER_ENTRY = getConstant("CodeInstaller::DEOPT_HANDLER_ENTRY", Integer.class);
+    public final int MARKID_INVOKEINTERFACE = getConstant("CodeInstaller::INVOKEINTERFACE", Integer.class);
+    public final int MARKID_INVOKEVIRTUAL = getConstant("CodeInstaller::INVOKEVIRTUAL", Integer.class);
+    public final int MARKID_INVOKESTATIC = getConstant("CodeInstaller::INVOKESTATIC", Integer.class);
+    public final int MARKID_INVOKESPECIAL = getConstant("CodeInstaller::INVOKESPECIAL", Integer.class);
+    public final int MARKID_INLINE_INVOKE = getConstant("CodeInstaller::INLINE_INVOKE", Integer.class);
+    public final int MARKID_POLL_NEAR = getConstant("CodeInstaller::POLL_NEAR", Integer.class);
+    public final int MARKID_POLL_RETURN_NEAR = getConstant("CodeInstaller::POLL_RETURN_NEAR", Integer.class);
+    public final int MARKID_POLL_FAR = getConstant("CodeInstaller::POLL_FAR", Integer.class);
+    public final int MARKID_POLL_RETURN_FAR = getConstant("CodeInstaller::POLL_RETURN_FAR", Integer.class);
+    public final int MARKID_CARD_TABLE_SHIFT = getConstant("CodeInstaller::CARD_TABLE_SHIFT", Integer.class);
+    public final int MARKID_CARD_TABLE_ADDRESS = getConstant("CodeInstaller::CARD_TABLE_ADDRESS", Integer.class);
+    public final int MARKID_INVOKE_INVALID = getConstant("CodeInstaller::INVOKE_INVALID", Integer.class);
+
+    /**
+     * The following constants are given default values here since they are missing in the native
+     * JVMCI-8 code but are still required for {@link GraalHotSpotVMConfigNode#canonical} to work in
+     * a JDK8 environment.
+     */
+    public final int MARKID_HEAP_TOP_ADDRESS = getConstant("CodeInstaller::HEAP_TOP_ADDRESS", Integer.class, 17);
+    public final int MARKID_HEAP_END_ADDRESS = getConstant("CodeInstaller::HEAP_END_ADDRESS", Integer.class, 18);
+    public final int MARKID_NARROW_KLASS_BASE_ADDRESS = getConstant("CodeInstaller::NARROW_KLASS_BASE_ADDRESS", Integer.class, 19);
+    public final int MARKID_NARROW_OOP_BASE_ADDRESS = getConstant("CodeInstaller::NARROW_OOP_BASE_ADDRESS", Integer.class, 20);
+    public final int MARKID_CRC_TABLE_ADDRESS = getConstant("CodeInstaller::CRC_TABLE_ADDRESS", Integer.class, 21);
+    public final int MARKID_LOG_OF_HEAP_REGION_GRAIN_BYTES = getConstant("CodeInstaller::LOG_OF_HEAP_REGION_GRAIN_BYTES", Integer.class, 22);
+    public final int MARKID_INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED = getConstant("CodeInstaller::INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED", Integer.class, 23);
+
+    // Checkstyle: resume
+
+    protected boolean check() {
+        for (Field f : getClass().getDeclaredFields()) {
+            int modifiers = f.getModifiers();
+            if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers)) {
+                assert Modifier.isFinal(modifiers) : "field should be final: " + f;
+            }
+        }
+
+        assert codeEntryAlignment > 0 : codeEntryAlignment;
+        return true;
+    }
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java
new file mode 100644
index 0000000..f2f45e2
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.hotspot;
+
+import org.graalvm.compiler.core.common.LIRKind;
+import org.graalvm.compiler.debug.GraalError;
+import org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction;
+import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
+import org.graalvm.compiler.hotspot.nodes.DeoptimizationFetchUnrollInfoCallNode;
+import org.graalvm.compiler.hotspot.nodes.EnterUnpackFramesStackFrameNode;
+import org.graalvm.compiler.hotspot.nodes.GraalHotSpotVMConfigNode;
+import org.graalvm.compiler.hotspot.nodes.LeaveCurrentStackFrameNode;
+import org.graalvm.compiler.hotspot.nodes.LeaveDeoptimizedStackFrameNode;
+import org.graalvm.compiler.hotspot.nodes.LeaveUnpackFramesStackFrameNode;
+import org.graalvm.compiler.hotspot.nodes.PushInterpreterFrameNode;
+import org.graalvm.compiler.hotspot.nodes.SaveAllRegistersNode;
+import org.graalvm.compiler.hotspot.nodes.UncommonTrapCallNode;
+import org.graalvm.compiler.hotspot.nodes.aot.LoadConstantIndirectlyNode;
+import org.graalvm.compiler.hotspot.nodes.aot.ResolveConstantNode;
+import org.graalvm.compiler.hotspot.nodes.aot.ResolveMethodAndLoadCountersNode;
+import org.graalvm.compiler.hotspot.nodes.profiling.RandomSeedNode;
+import org.graalvm.compiler.hotspot.replacements.EncodedSymbolConstant;
+import org.graalvm.compiler.lir.LIRFrameState;
+import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
+import org.graalvm.compiler.lir.VirtualStackSlot;
+import org.graalvm.compiler.lir.gen.LIRGenerator;
+import org.graalvm.compiler.lir.gen.LIRGeneratorTool;
+
+import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
+import jdk.vm.ci.hotspot.HotSpotObjectConstant;
+import jdk.vm.ci.meta.Constant;
+import jdk.vm.ci.meta.DeoptimizationAction;
+import jdk.vm.ci.meta.DeoptimizationReason;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.Value;
+
+/**
+ * This interface defines the contract a HotSpot backend LIR generator needs to fulfill in addition
+ * to abstract methods from {@link LIRGenerator} and {@link LIRGeneratorTool}.
+ */
+public interface HotSpotLIRGenerator extends LIRGeneratorTool {
+
+    /**
+     * Emits an operation to make a tail call.
+     *
+     * @param args the arguments of the call
+     * @param address the target address of the call
+     */
+    void emitTailcall(Value[] args, Value address);
+
+    void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason);
+
+    /**
+     * Emits code for a {@link SaveAllRegistersNode}.
+     *
+     * @return a {@link SaveRegistersOp} operation
+     */
+    SaveRegistersOp emitSaveAllRegisters();
+
+    /**
+     * Emits code for a {@link LeaveCurrentStackFrameNode}.
+     *
+     * @param saveRegisterOp saved registers
+     */
+    default void emitLeaveCurrentStackFrame(SaveRegistersOp saveRegisterOp) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link LeaveDeoptimizedStackFrameNode}.
+     *
+     * @param frameSize
+     * @param initialInfo
+     */
+    default void emitLeaveDeoptimizedStackFrame(Value frameSize, Value initialInfo) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link EnterUnpackFramesStackFrameNode}.
+     *
+     * @param framePc
+     * @param senderSp
+     * @param senderFp
+     * @param saveRegisterOp
+     */
+    default void emitEnterUnpackFramesStackFrame(Value framePc, Value senderSp, Value senderFp, SaveRegistersOp saveRegisterOp) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link LeaveUnpackFramesStackFrameNode}.
+     *
+     * @param saveRegisterOp
+     */
+    default void emitLeaveUnpackFramesStackFrame(SaveRegistersOp saveRegisterOp) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link PushInterpreterFrameNode}.
+     *
+     * @param frameSize
+     * @param framePc
+     * @param senderSp
+     * @param initialInfo
+     */
+    default void emitPushInterpreterFrame(Value frameSize, Value framePc, Value senderSp, Value initialInfo) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link LoadConstantIndirectlyNode}.
+     *
+     * @param constant
+     * @return value of loaded address in register
+     */
+    default Value emitLoadObjectAddress(Constant constant) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link LoadConstantIndirectlyNode}.
+     *
+     * @param constant original constant
+     * @param action action to perform on the metaspace object
+     * @return Value of loaded address in register
+     */
+    default Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link GraalHotSpotVMConfigNode}.
+     *
+     * @param markId id of the value to load
+     * @param kind type of the value to load
+     * @return value of loaded global in register
+     */
+    default Value emitLoadConfigValue(int markId, LIRKind kind) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotObjectConstant}.
+     *
+     * @param constant original constant
+     * @param constantDescription a description of the string that need to be materialized (and
+     *            interned) as java.lang.String, generated with {@link EncodedSymbolConstant}
+     * @param frameState frame state for the runtime call
+     * @return Returns the address of the requested constant.
+     */
+    default Value emitObjectConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotMetaspaceConstant}.
+     *
+     * @param constant original constant
+     * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
+     *            generated by {@link EncodedSymbolConstant}
+     * @param frameState frame state for the runtime call
+     * @return Returns the address of the requested constant.
+     */
+    default Value emitMetaspaceConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link ResolveMethodAndLoadCountersNode} to resolve a
+     * {@link HotSpotMetaspaceConstant} that represents a {@link ResolvedJavaMethod} and return the
+     * corresponding MethodCounters object.
+     *
+     * @param method original constant
+     * @param klassHint a klass in which the method is declared
+     * @param methodDescription is symbolic description of the constant generated by
+     *            {@link EncodedSymbolConstant}
+     * @param frameState frame state for the runtime call
+     * @return Returns the address of the requested constant.
+     */
+    default Value emitResolveMethodAndLoadCounters(Constant method, Value klassHint, Value methodDescription, LIRFrameState frameState) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link ResolveConstantNode} to resolve a klass
+     * {@link HotSpotMetaspaceConstant} and run static initializer.
+     *
+     *
+     * @param constant original constant
+     * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
+     *            generated by {@link EncodedSymbolConstant}
+     * @param frameState frame state for the runtime call
+     * @return Returns the address of the requested constant.
+     */
+    default Value emitKlassInitializationAndRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link RandomSeedNode}.
+     *
+     * @return value of the counter
+     */
+    default Value emitRandomSeed() {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link UncommonTrapCallNode}.
+     *
+     * @param trapRequest
+     * @param mode
+     * @param saveRegisterOp
+     * @return a {@code Deoptimization::UnrollBlock} pointer
+     */
+    default Value emitUncommonTrapCall(Value trapRequest, Value mode, SaveRegistersOp saveRegisterOp) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Emits code for a {@link DeoptimizationFetchUnrollInfoCallNode}.
+     *
+     * @param mode
+     * @param saveRegisterOp
+     * @return a {@code Deoptimization::UnrollBlock} pointer
+     */
+    default Value emitDeoptimizationFetchUnrollInfoCall(Value mode, SaveRegistersOp saveRegisterOp) {
+        throw GraalError.unimplemented();
+    }
+
+    /**
+     * Gets a stack slot for a lock at a given lock nesting depth.
+     */
+    VirtualStackSlot getLockSlot(int lockDepth);
+
+    @Override
+    HotSpotProviders getProviders();
+
+    Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull);
+
+    Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull);
+
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOption.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOption.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOption.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOption.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CompressionNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CompressionNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CompressionNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CompressionNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DirectCompareAndSwapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DirectCompareAndSwapNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DirectCompareAndSwapNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DirectCompareAndSwapNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EnterUnpackFramesStackFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EnterUnpackFramesStackFrameNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EnterUnpackFramesStackFrameNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EnterUnpackFramesStackFrameNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java
new file mode 100644
index 0000000..8d0575f
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.hotspot.nodes;
+
+import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
+import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG;
+import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1;
+import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_1;
+
+import org.graalvm.compiler.api.replacements.Fold;
+import org.graalvm.compiler.api.replacements.Fold.InjectedParameter;
+import org.graalvm.compiler.core.common.type.StampFactory;
+import org.graalvm.compiler.graph.Node;
+import org.graalvm.compiler.graph.NodeClass;
+import org.graalvm.compiler.graph.spi.Canonicalizable;
+import org.graalvm.compiler.graph.spi.CanonicalizerTool;
+import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
+import org.graalvm.compiler.hotspot.HotSpotLIRGenerator;
+import org.graalvm.compiler.nodeinfo.NodeInfo;
+import org.graalvm.compiler.nodes.ConstantNode;
+import org.graalvm.compiler.nodes.calc.FloatingNode;
+import org.graalvm.compiler.nodes.spi.LIRLowerable;
+import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
+
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.Value;
+
+/**
+ * Represents {@link GraalHotSpotVMConfig} values that may change after compilation.
+ */
+@NodeInfo(cycles = CYCLES_1, size = SIZE_1)
+public class GraalHotSpotVMConfigNode extends FloatingNode implements LIRLowerable, Canonicalizable {
+    public static final NodeClass<GraalHotSpotVMConfigNode> TYPE = NodeClass.create(GraalHotSpotVMConfigNode.class);
+
+    private final GraalHotSpotVMConfig config;
+    protected final int markId;
+
+    /**
+     * Constructor for {@link #areConfigValuesConstant()}.
+     *
+     * @param config
+     */
+    public GraalHotSpotVMConfigNode(@InjectedNodeParameter GraalHotSpotVMConfig config) {
+        super(TYPE, StampFactory.forKind(JavaKind.Boolean));
+        this.config = config;
+        this.markId = 0;
+    }
+
+    /**
+     * Constructor for node intrinsics below.
+     *
+     * @param config
+     * @param markId id of the config value
+     */
+    public GraalHotSpotVMConfigNode(@InjectedNodeParameter GraalHotSpotVMConfig config, int markId) {
+        super(TYPE, StampFactory.forNodeIntrinsic());
+        this.config = config;
+        this.markId = markId;
+    }
+
+    /**
+     * Constructor with explicit type specification.
+     *
+     * @param config
+     * @param markId id of the config value
+     * @param kind explicit type of the node
+     */
+    public GraalHotSpotVMConfigNode(@InjectedNodeParameter GraalHotSpotVMConfig config, int markId, JavaKind kind) {
+        super(TYPE, StampFactory.forKind(kind));
+        this.config = config;
+        this.markId = markId;
+    }
+
+    @Override
+    public void generate(NodeLIRBuilderTool generator) {
+        Value res = ((HotSpotLIRGenerator) generator.getLIRGeneratorTool()).emitLoadConfigValue(markId, generator.getLIRGeneratorTool().getLIRKind(stamp));
+        generator.setResult(this, res);
+    }
+
+    @NodeIntrinsic
+    private static native boolean areConfigValuesConstant();
+
+    @NodeIntrinsic(setStampFromReturnType = true)
+    private static native long loadLongConfigValue(@ConstantNodeParameter int markId);
+
+    @NodeIntrinsic(setStampFromReturnType = true)
+    private static native int loadIntConfigValue(@ConstantNodeParameter int markId);
+
+    @NodeIntrinsic(setStampFromReturnType = true)
+    private static native byte loadByteConfigValue(@ConstantNodeParameter int markId);
+
+    public static long cardTableAddress() {
+        return loadLongConfigValue(cardTableAddressMark(INJECTED_VMCONFIG));
+    }
+
+    public static boolean isCardTableAddressConstant() {
+        return areConfigValuesConstant();
+    }
+
+    public static long heapTopAddress() {
+        return loadLongConfigValue(heapTopAddressMark(INJECTED_VMCONFIG));
+    }
+
+    public static long heapEndAddress() {
+        return loadLongConfigValue(heapEndAddressMark(INJECTED_VMCONFIG));
+    }
+
+    public static long crcTableAddress() {
+        return loadLongConfigValue(crcTableAddressMark(INJECTED_VMCONFIG));
+    }
+
+    public static int logOfHeapRegionGrainBytes() {
+        return loadIntConfigValue(logOfHeapRegionGrainBytesMark(INJECTED_VMCONFIG));
+    }
+
+    public static boolean inlineContiguousAllocationSupported() {
+        return loadByteConfigValue(inlineContiguousAllocationSupportedMark(INJECTED_VMCONFIG)) != 0;
+    }
+
+    @Fold
+    public static int cardTableAddressMark(@InjectedParameter GraalHotSpotVMConfig config) {
+        return config.MARKID_CARD_TABLE_ADDRESS;
+    }
+
+    @Fold
+    public static int heapTopAddressMark(@InjectedParameter GraalHotSpotVMConfig config) {
+        return config.MARKID_HEAP_TOP_ADDRESS;
+    }
+
+    @Fold
+    public static int heapEndAddressMark(@InjectedParameter GraalHotSpotVMConfig config) {
+        return config.MARKID_HEAP_END_ADDRESS;
+    }
+
+    @Fold
+    public static int crcTableAddressMark(@InjectedParameter GraalHotSpotVMConfig config) {
+        return config.MARKID_CRC_TABLE_ADDRESS;
+    }
+
+    @Fold
+    public static int logOfHeapRegionGrainBytesMark(@InjectedParameter GraalHotSpotVMConfig config) {
+        return config.MARKID_LOG_OF_HEAP_REGION_GRAIN_BYTES;
+    }
+
+    @Fold
+    public static int inlineContiguousAllocationSupportedMark(@InjectedParameter GraalHotSpotVMConfig config) {
+        return config.MARKID_INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED;
+    }
+
+    @Override
+    public Node canonical(CanonicalizerTool tool) {
+        if (markId == 0) {
+            return ConstantNode.forBoolean(!GeneratePIC.getValue());
+        }
+        if (!GeneratePIC.getValue()) {
+            if (markId == cardTableAddressMark(config)) {
+                return ConstantNode.forLong(config.cardtableStartAddress);
+            } else if (markId == heapTopAddressMark(config)) {
+                return ConstantNode.forLong(config.heapTopAddress);
+            } else if (markId == heapEndAddressMark(config)) {
+                return ConstantNode.forLong(config.heapEndAddress);
+            } else if (markId == crcTableAddressMark(config)) {
+                return ConstantNode.forLong(config.crcTableAddress);
+            } else if (markId == logOfHeapRegionGrainBytesMark(config)) {
+                return ConstantNode.forInt(config.logOfHRGrainBytes);
+            } else if (markId == inlineContiguousAllocationSupportedMark(config)) {
+                return ConstantNode.forBoolean(config.inlineContiguousAllocationSupported);
+            } else {
+                assert false;
+            }
+        }
+        return this;
+    }
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotNodeCostProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotNodeCostProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotNodeCostProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveCurrentStackFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveCurrentStackFrameNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveCurrentStackFrameNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveCurrentStackFrameNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveUnpackFramesStackFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveUnpackFramesStackFrameNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveUnpackFramesStackFrameNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveUnpackFramesStackFrameNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PushInterpreterFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PushInterpreterFrameNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PushInterpreterFrameNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PushInterpreterFrameNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SaveAllRegistersNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SaveAllRegistersNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SaveAllRegistersNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SaveAllRegistersNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetAnchorNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetAnchorNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetAnchorNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetLocationProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetLocationProxyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetLocationProxyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetLocationProxyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/UncommonTrapCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/UncommonTrapCallNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/UncommonTrapCallNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/UncommonTrapCallNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotLIRKindTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotLIRKindTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotLIRKindTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/NarrowOopStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/NarrowOopStamp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/NarrowOopStamp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/NarrowOopStamp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java
new file mode 100644
index 0000000..caa04c2
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.hotspot.phases.aot;
+
+import static org.graalvm.compiler.nodes.ConstantNode.getConstantNodes;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map.Entry;
+
+import org.graalvm.compiler.graph.Node;
+import org.graalvm.compiler.graph.iterators.NodeIterable;
+import org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode;
+import org.graalvm.compiler.nodes.ConstantNode;
+import org.graalvm.compiler.nodes.FixedWithNextNode;
+import org.graalvm.compiler.nodes.Invoke;
+import org.graalvm.compiler.nodes.StructuredGraph;
+import org.graalvm.compiler.nodes.cfg.Block;
+import org.graalvm.compiler.nodes.cfg.ControlFlowGraph;
+import org.graalvm.compiler.phases.BasePhase;
+import org.graalvm.compiler.phases.tiers.PhaseContext;
+
+import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
+import jdk.vm.ci.meta.Constant;
+
+public class EliminateRedundantInitializationPhase extends BasePhase<PhaseContext> {
+    /**
+     * Find blocks with class initializing nodes for the class identified the by the constant node.
+     * Return the map of a block to a list of initializing nodes in that block.
+     *
+     * @param cfg an instance of the {@link ControlFlowGraph}.
+     * @param constant common input to the instances of {@link InitializeKlassNode}.
+     * @return map of blocks to lists of initializing nodes.
+     */
+    private static HashMap<Block, ArrayList<Node>> findBlocksWithInitializers(ControlFlowGraph cfg, ConstantNode constant) {
+        // node is ConstantNode representing a metaspace constant (a klass reference).
+        // InitializeKlassNodes for the same class would share the same ConstantNode input.
+        NodeIterable<?> initializers = constant.usages().filter(InitializeKlassNode.class);
+        // Map the found nodes to blocks
+        HashMap<Block, ArrayList<Node>> blockToInits = new HashMap<>();
+        for (Node i : initializers) {
+            Block b = cfg.blockFor(i);
+            ArrayList<Node> initsInBlock = blockToInits.get(b);
+            if (initsInBlock == null) {
+                initsInBlock = new ArrayList<>();
+            }
+            initsInBlock.add(i);
+            blockToInits.put(b, initsInBlock);
+        }
+        return blockToInits;
+    }
+
+    /**
+     * Process the block-to-initializers map and produce a list of blocks that contain more than one
+     * instance of {@link InitializeKlassNode}.
+     *
+     * @param blockToInits a map of blocks to lists of {@link InitializeKlassNode} instances.
+     * @return list of blocks that contain multiple instances of {@link InitializeKlassNode}.
+     */
+    private static ArrayList<Block> findBlocksWithMultipleInitializers(HashMap<Block, ArrayList<Node>> blockToInits) {
+        ArrayList<Block> result = new ArrayList<>();
+        // Select the blocks from the blocksToInits map that have more than one InitializeKlassNode
+        for (Entry<Block, ArrayList<Node>> e : blockToInits.entrySet()) {
+            if (e.getValue().size() > 1) {
+                result.add(e.getKey());
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Iterate through blocks with multiple instances of {@link InitializeKlassNode} and identify
+     * redundant instances. Remove redundant instances from the block-to-list-of-initializer map.
+     *
+     * @param blockToInits a map of blocks to lists of {@link InitializeKlassNode} instances.
+     * @param blocksWithMultipleInits a list of blocks that contain multiple instances of
+     *            {@link InitializeKlassNode}.
+     * @param constant common input to the instances of {@link InitializeKlassNode}.
+     * @return list of {@link InitializeKlassNode} instances that can be removed.
+     */
+    private static ArrayList<Node> findRedundantLocalInitializers(HashMap<Block, ArrayList<Node>> blockToInits, ArrayList<Block> blocksWithMultipleInits, ConstantNode constant) {
+        ArrayList<Node> result = new ArrayList<>();
+        for (Block b : blocksWithMultipleInits) {
+            // First initializer for our constant in the block
+            InitializeKlassNode first = null;
+            for (Node n : b.getNodes()) {
+                if (n instanceof InitializeKlassNode) {
+                    InitializeKlassNode i = (InitializeKlassNode) n;
+                    if (i.value() == constant) {
+                        if (first == null) {
+                            // First instance of {@link InitializeKlassNode} stays.
+                            first = i;
+                        } else {
+                            // All the following instances of {@link InitializeKlassNode} can be
+                            // removed.
+                            result.add(i);
+                        }
+                    }
+                }
+            }
+            assert first != null;
+
+            // Replace the entry in the initsInBlock map to contain just a single initializer
+            ArrayList<Node> initsInBlock = new ArrayList<>();
+            initsInBlock.add(first);
+            blockToInits.put(b, initsInBlock);
+        }
+        return result;
+    }
+
+    /**
+     * Find cases when one {@link InitializeKlassNode} instance dominates another. The dominated
+     * instance can be removed.
+     *
+     * @param blockToInits a map of blocks to lists of {@link InitializeKlassNode} instances.
+     * @return list of {@link InitializeKlassNode} instances that can be removed.
+     */
+    private static ArrayList<Node> findRedundantGlobalInitializers(HashMap<Block, ArrayList<Node>> blockToInits) {
+        ArrayList<Node> result = new ArrayList<>();
+        for (Entry<Block, ArrayList<Node>> e : blockToInits.entrySet()) {
+            Block currentBlock = e.getKey();
+            ArrayList<Node> nodesInCurrent = e.getValue();
+            if (nodesInCurrent != null) { // if the list is null, the initializer has already been
+                                          // eliminated.
+                for (Block d : currentBlock.getDominated()) {
+                    ArrayList<Node> nodesInDominated = blockToInits.get(d);
+                    if (nodesInDominated != null) { // if the list is null, the initializer has
+                                                    // already been eliminated.
+                        assert nodesInDominated.size() == 1;
+                        Node n = nodesInDominated.iterator().next();
+                        result.add(n);
+                        blockToInits.put(d, null);
+                    }
+                }
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Compute the list of redundant {@link InitializeKlassNode} instances that have the common
+     * {@link ConstantNode}.
+     *
+     * @param cfg an instance of the {@link ControlFlowGraph}.
+     * @param constant common input to the instances of {@link InitializeKlassNode}.
+     * @return list of {@link InitializeKlassNode} instances that can be removed.
+     */
+    private static ArrayList<Node> processConstantNode(ControlFlowGraph cfg, ConstantNode constant) {
+        HashMap<Block, ArrayList<Node>> blockToInits = findBlocksWithInitializers(cfg, constant);
+        ArrayList<Block> blocksWithMultipleInits = findBlocksWithMultipleInitializers(blockToInits);
+        ArrayList<Node> redundantInits = findRedundantLocalInitializers(blockToInits, blocksWithMultipleInits, constant);
+        // At this point each block has at most one initializer for this constant
+        if (blockToInits.size() > 1) {
+            redundantInits.addAll(findRedundantGlobalInitializers(blockToInits));
+        }
+        return redundantInits;
+    }
+
+    /**
+     * Find each {@link Invoke} that has a corresponding {@link InitializeKlassNode}. These
+     * {@link InitializeKlassNode} are redundant and are removed.
+     *
+     */
+    private static void removeInitsAtStaticCalls(StructuredGraph graph) {
+        for (Invoke invoke : graph.getInvokes()) {
+            if (invoke.classInit() != null) {
+                Node classInit = invoke.classInit();
+                classInit.replaceAtUsages(null);
+                graph.removeFixed((FixedWithNextNode) classInit);
+            }
+        }
+    }
+
+    /**
+     * Find {@link InitializeKlassNode} instances that can be removed because there is an existing
+     * dominating initialization.
+     *
+     * @param graph the program graph.
+     */
+    private static void removeRedundantInits(StructuredGraph graph) {
+        // Create cfg, we need blocks and dominators.
+        ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, false, true, false);
+        ArrayList<Node> redundantInits = new ArrayList<>();
+        for (ConstantNode node : getConstantNodes(graph)) {
+            Constant constant = node.asConstant();
+            if (constant instanceof HotSpotMetaspaceConstant) {
+                redundantInits.addAll(processConstantNode(cfg, node));
+            }
+        }
+        // Remove redundant instances of {@link InitializeKlassNode} from the graph.
+        for (Node n : redundantInits) {
+            graph.removeFixed((FixedWithNextNode) n);
+        }
+    }
+
+    @Override
+    protected void run(StructuredGraph graph, PhaseContext context) {
+        removeInitsAtStaticCalls(graph);
+        removeRedundantInits(graph);
+    }
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyUnrollNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyUnrollNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyUnrollNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyUnrollNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DeoptimizationStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DeoptimizationStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DeoptimizationStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DeoptimizationStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
new file mode 100644
index 0000000..8857bd4
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
@@ -0,0 +1,290 @@
+/*
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.hotspot.stubs;
+
+import static org.graalvm.compiler.core.GraalCompiler.emitBackEnd;
+import static org.graalvm.compiler.core.GraalCompiler.emitFrontEnd;
+import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
+import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Set;
+
+import org.graalvm.compiler.code.CompilationResult;
+import org.graalvm.compiler.core.common.CompilationIdentifier;
+import org.graalvm.compiler.core.target.Backend;
+import org.graalvm.compiler.debug.Debug;
+import org.graalvm.compiler.debug.Debug.Scope;
+import org.graalvm.compiler.debug.internal.DebugScope;
+import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder;
+import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
+import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
+import org.graalvm.compiler.hotspot.nodes.StubStartNode;
+import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory;
+import org.graalvm.compiler.lir.phases.LIRPhase;
+import org.graalvm.compiler.lir.phases.LIRSuites;
+import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext;
+import org.graalvm.compiler.lir.profiling.MoveProfilingPhase;
+import org.graalvm.compiler.nodes.StructuredGraph;
+import org.graalvm.compiler.phases.OptimisticOptimizations;
+import org.graalvm.compiler.phases.PhaseSuite;
+import org.graalvm.compiler.phases.tiers.Suites;
+
+import jdk.vm.ci.code.CodeCacheProvider;
+import jdk.vm.ci.code.InstalledCode;
+import jdk.vm.ci.code.Register;
+import jdk.vm.ci.code.RegisterConfig;
+import jdk.vm.ci.code.site.Call;
+import jdk.vm.ci.code.site.ConstantReference;
+import jdk.vm.ci.code.site.DataPatch;
+import jdk.vm.ci.code.site.Infopoint;
+import jdk.vm.ci.hotspot.HotSpotCompiledCode;
+import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
+import jdk.vm.ci.meta.DefaultProfilingInfo;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.TriState;
+
+//JaCoCo Exclude
+
+/**
+ * Base class for implementing some low level code providing the out-of-line slow path for a snippet
+ * and/or a callee saved call to a HotSpot C/C++ runtime function or even a another compiled Java
+ * method.
+ */
+public abstract class Stub {
+
+    private static final List<Stub> stubs = new ArrayList<>();
+
+    /**
+     * The linkage information for a call to this stub from compiled code.
+     */
+    protected final HotSpotForeignCallLinkage linkage;
+
+    /**
+     * The code installed for the stub.
+     */
+    protected InstalledCode code;
+
+    /**
+     * The registers destroyed by this stub (from the caller's perspective).
+     */
+    private Set<Register> destroyedCallerRegisters;
+
+    public void initDestroyedCallerRegisters(Set<Register> registers) {
+        assert registers != null;
+        assert destroyedCallerRegisters == null || registers.equals(destroyedCallerRegisters) : "cannot redefine";
+        destroyedCallerRegisters = registers;
+    }
+
+    /**
+     * Gets the registers destroyed by this stub from a caller's perspective. These are the
+     * temporaries of this stub and must thus be caller saved by a callers of this stub.
+     */
+    public Set<Register> getDestroyedCallerRegisters() {
+        assert destroyedCallerRegisters != null : "not yet initialized";
+        return destroyedCallerRegisters;
+    }
+
+    /**
+     * Determines if this stub preserves all registers apart from those it
+     * {@linkplain #getDestroyedCallerRegisters() destroys}.
+     */
+    public boolean preservesRegisters() {
+        return true;
+    }
+
+    protected final HotSpotProviders providers;
+
+    /**
+     * Creates a new stub.
+     *
+     * @param linkage linkage details for a call to the stub
+     */
+    public Stub(HotSpotProviders providers, HotSpotForeignCallLinkage linkage) {
+        this.linkage = linkage;
+        this.providers = providers;
+        stubs.add(this);
+    }
+
+    /**
+     * Gets an immutable view of all stubs that have been created.
+     */
+    public static Collection<Stub> getStubs() {
+        return Collections.unmodifiableList(stubs);
+    }
+
+    /**
+     * Gets the linkage for a call to this stub from compiled code.
+     */
+    public HotSpotForeignCallLinkage getLinkage() {
+        return linkage;
+    }
+
+    public RegisterConfig getRegisterConfig() {
+        return null;
+    }
+
+    /**
+     * Gets the graph that from which the code for this stub will be compiled.
+     *
+     * @param compilationId unique compilation id for the stub
+     */
+    protected abstract StructuredGraph getGraph(CompilationIdentifier compilationId);
+
+    @Override
+    public String toString() {
+        return "Stub<" + linkage.getDescriptor() + ">";
+    }
+
+    /**
+     * Gets the method the stub's code will be associated with once installed. This may be null.
+     */
+    protected abstract ResolvedJavaMethod getInstalledCodeOwner();
+
+    /**
+     * Gets a context object for the debug scope created when producing the code for this stub.
+     */
+    protected abstract Object debugScopeContext();
+
+    /**
+     * Gets the code for this stub, compiling it first if necessary.
+     */
+    @SuppressWarnings("try")
+    public synchronized InstalledCode getCode(final Backend backend) {
+        if (code == null) {
+            try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) {
+                CodeCacheProvider codeCache = providers.getCodeCache();
+                CompilationResult compResult = buildCompilationResult(backend);
+                try (Scope s = Debug.scope("CodeInstall", compResult)) {
+                    assert destroyedCallerRegisters != null;
+                    // Add a GeneratePIC check here later, we don't want to install
+                    // code if we don't have a corresponding VM global symbol.
+                    HotSpotCompiledCode compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(null, null, compResult);
+                    code = codeCache.installCode(null, compiledCode, null, null, false);
+                } catch (Throwable e) {
+                    throw Debug.handle(e);
+                }
+            } catch (Throwable e) {
+                throw Debug.handle(e);
+            }
+            assert code != null : "error installing stub " + this;
+        }
+
+        return code;
+    }
+
+    @SuppressWarnings("try")
+    private CompilationResult buildCompilationResult(final Backend backend) {
+        CompilationResult compResult = new CompilationResult(toString(), GeneratePIC.getValue());
+        final StructuredGraph graph = getGraph(getStubCompilationId());
+
+        // Stubs cannot be recompiled so they cannot be compiled with assumptions
+        assert graph.getAssumptions() == null;
+
+        if (!(graph.start() instanceof StubStartNode)) {
+            StubStartNode newStart = graph.add(new StubStartNode(Stub.this));
+            newStart.setStateAfter(graph.start().stateAfter());
+            graph.replaceFixed(graph.start(), newStart);
+        }
+
+        try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) {
+            Suites suites = createSuites();
+            emitFrontEnd(providers, backend, graph, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites);
+            LIRSuites lirSuites = createLIRSuites();
+            emitBackEnd(graph, Stub.this, getInstalledCodeOwner(), backend, compResult, CompilationResultBuilderFactory.Default, getRegisterConfig(), lirSuites);
+            assert checkStubInvariants(compResult);
+        } catch (Throwable e) {
+            throw Debug.handle(e);
+        }
+        return compResult;
+    }
+
+    /**
+     * Gets a {@link CompilationResult} that can be used for code generation. Required for AOT.
+     */
+    @SuppressWarnings("try")
+    public CompilationResult getCompilationResult(final Backend backend) {
+        try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) {
+            return buildCompilationResult(backend);
+        } catch (Throwable e) {
+            throw Debug.handle(e);
+        }
+    }
+
+    public CompilationIdentifier getStubCompilationId() {
+        return new StubCompilationIdentifier(this);
+    }
+
+    /**
+     * Checks the conditions a compilation must satisfy to be installed as a RuntimeStub.
+     */
+    private boolean checkStubInvariants(CompilationResult compResult) {
+        assert compResult.getExceptionHandlers().isEmpty() : this;
+
+        // Stubs cannot be recompiled so they cannot be compiled with
+        // assumptions and there is no point in recording evol_method dependencies
+        assert compResult.getAssumptions() == null : "stubs should not use assumptions: " + this;
+
+        for (DataPatch data : compResult.getDataPatches()) {
+            if (data.reference instanceof ConstantReference) {
+                ConstantReference ref = (ConstantReference) data.reference;
+                if (ref.getConstant() instanceof HotSpotMetaspaceConstant) {
+                    HotSpotMetaspaceConstant c = (HotSpotMetaspaceConstant) ref.getConstant();
+                    if (c.asResolvedJavaType() != null && c.asResolvedJavaType().getName().equals("[I")) {
+                        // special handling for NewArrayStub
+                        // embedding the type '[I' is safe, since it is never unloaded
+                        continue;
+                    }
+                }
+            }
+
+            assert !(data.reference instanceof ConstantReference) : this + " cannot have embedded object or metadata constant: " + data.reference;
+        }
+        for (Infopoint infopoint : compResult.getInfopoints()) {
+            assert infopoint instanceof Call : this + " cannot have non-call infopoint: " + infopoint;
+            Call call = (Call) infopoint;
+            assert call.target instanceof HotSpotForeignCallLinkage : this + " cannot have non runtime call: " + call.target;
+            HotSpotForeignCallLinkage callLinkage = (HotSpotForeignCallLinkage) call.target;
+            assert !callLinkage.isCompiledStub() || callLinkage.getDescriptor().equals(UNCOMMON_TRAP_HANDLER) : this + " cannot call compiled stub " + callLinkage;
+        }
+        return true;
+    }
+
+    protected Suites createSuites() {
+        Suites defaultSuites = providers.getSuites().getDefaultSuites();
+        return new Suites(new PhaseSuite<>(), defaultSuites.getMidTier(), defaultSuites.getLowTier());
+    }
+
+    protected LIRSuites createLIRSuites() {
+        LIRSuites lirSuites = new LIRSuites(providers.getSuites().getDefaultLIRSuites());
+        ListIterator<LIRPhase<PostAllocationOptimizationContext>> moveProfiling = lirSuites.getPostAllocationOptimizationStage().findPhase(MoveProfilingPhase.class);
+        if (moveProfiling != null) {
+            moveProfiling.remove();
+        }
+        return lirSuites;
+    }
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UncommonTrapStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UncommonTrapStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UncommonTrapStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UncommonTrapStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceIntervalWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceIntervalWalker.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceIntervalWalker.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceIntervalWalker.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/FastSSIBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/FastSSIBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/FastSSIBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/FastSSIBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilderBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilderBase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilderBase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilderBase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIConstructionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIConstructionPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIConstructionPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIConstructionPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/MathFunctionBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/MathFunctionBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/MathFunctionBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/MathFunctionBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/package-info.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/package-info.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMH.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMH.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMH.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMH.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/DivNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/DivNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/DivNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/DivNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationBeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationBeginNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationBeginNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationBeginNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationEndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationEndNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationEndNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationEndNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationInliningCallback.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationInliningCallback.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationInliningCallback.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationInliningCallback.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/IsMethodInlinedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/IsMethodInlinedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/IsMethodInlinedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/IsMethodInlinedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/MonitorProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/MonitorProxyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/MonitorProxyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/MonitorProxyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/RootNameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/RootNameNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/RootNameNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/RootNameNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWriteNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWriteNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWriteNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeLoadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeLoadNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeLoadNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeLoadNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeStoreNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeStoreNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeStoreNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeStoreNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/CompareAndSwapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/CompareAndSwapNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/CompareAndSwapNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/CompareAndSwapNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredCompareAndSwapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredCompareAndSwapNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredCompareAndSwapNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredCompareAndSwapNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/RawAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/RawAddressNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/RawAddressNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/RawAddressNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DefaultNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DefaultNodeCostProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DefaultNodeCostProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DefaultNodeCostProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeCostProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeCostProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeCostProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/PiPushable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/PiPushable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/PiPushable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/PiPushable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/META-INF/services/javax.annotation.processing.Processor
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/META-INF/services/javax.annotation.processing.Processor
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/META-INF/services/javax.annotation.processing.Processor
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionValueTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionValueTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionValueTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionValueTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/DerivedOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/DerivedOptionValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/DerivedOptionValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/DerivedOptionValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/StableOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/StableOptionValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/StableOptionValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/StableOptionValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/UniquePathUtilities.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/UniquePathUtilities.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/UniquePathUtilities.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/UniquePathUtilities.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DominatorConditionalEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DominatorConditionalEliminationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DominatorConditionalEliminationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DominatorConditionalEliminationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeGuardAnchorsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeGuardAnchorsPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeGuardAnchorsPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeGuardAnchorsPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PushThroughPiPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PushThroughPiPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PushThroughPiPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PushThroughPiPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ValueAnchorCleanupPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ValueAnchorCleanupPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ValueAnchorCleanupPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ValueAnchorCleanupPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/ExtractInstrumentationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/ExtractInstrumentationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/ExtractInstrumentationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/ExtractInstrumentationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/HighTierReconcileInstrumentationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/HighTierReconcileInstrumentationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/HighTierReconcileInstrumentationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/HighTierReconcileInstrumentationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/InlineInstrumentationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/InlineInstrumentationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/InlineInstrumentationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/InlineInstrumentationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/MidTierReconcileInstrumentationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/MidTierReconcileInstrumentationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/MidTierReconcileInstrumentationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/MidTierReconcileInstrumentationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BasicIdealGraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BasicIdealGraphPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BasicIdealGraphPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BasicIdealGraphPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugConfigCustomizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugConfigCustomizer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugConfigCustomizer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugConfigCustomizer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerMulExactFoldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerMulExactFoldTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerMulExactFoldTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerMulExactFoldTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/META-INF/services/javax.annotation.processing.Processor
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/META-INF/services/javax.annotation.processing.Processor
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/META-INF/services/javax.annotation.processing.Processor
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/APHotSpotSignature.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/APHotSpotSignature.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/APHotSpotSignature.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/APHotSpotSignature.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/AbstractVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/AbstractVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/AbstractVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/AbstractVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/ClassSubstitutionVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/ClassSubstitutionVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/ClassSubstitutionVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/ClassSubstitutionVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/FoldVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/FoldVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/FoldVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/FoldVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedFoldPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedFoldPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedFoldPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedFoldPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedNodeIntrinsicPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedNodeIntrinsicPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedNodeIntrinsicPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedNodeIntrinsicPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/InjectedDependencies.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/InjectedDependencies.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/InjectedDependencies.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/InjectedDependencies.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/MethodSubstitutionVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/MethodSubstitutionVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/MethodSubstitutionVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/MethodSubstitutionVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/NodeIntrinsicVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/NodeIntrinsicVerifier.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/NodeIntrinsicVerifier.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/NodeIntrinsicVerifier.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/PluginGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/PluginGenerator.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/PluginGenerator.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/PluginGenerator.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/VerifierAnnotationProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/VerifierAnnotationProcessor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/VerifierAnnotationProcessor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/VerifierAnnotationProcessor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineGraalDirectivesPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineGraalDirectivesPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineGraalDirectivesPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineGraalDirectivesPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/WordOperationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/WordOperationPlugin.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/WordOperationPlugin.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/WordOperationPlugin.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectObjectStoreNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectObjectStoreNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectObjectStoreNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectObjectStoreNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/Salver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/Salver.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/Salver.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/Salver.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverDebugConfigCustomizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverDebugConfigCustomizer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverDebugConfigCustomizer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverDebugConfigCustomizer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverOptions.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverOptions.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverOptions.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataDict.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataDict.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataDict.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataDict.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataList.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractGraalDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractGraalDumper.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractGraalDumper.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractGraalDumper.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractMethodScopeDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractMethodScopeDumper.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractMethodScopeDumper.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractMethodScopeDumper.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractSerializerDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractSerializerDumper.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractSerializerDumper.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractSerializerDumper.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/Dumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/Dumper.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/Dumper.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/Dumper.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/GraphDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/GraphDumper.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/GraphDumper.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/GraphDumper.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractDumpHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractDumpHandler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractDumpHandler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractGraalDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractGraalDumpHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractGraalDumpHandler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractGraalDumpHandler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/DumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/DumpHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/DumpHandler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/DumpHandler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/GraphDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/GraphDumpHandler.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/GraphDumpHandler.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/GraphDumpHandler.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/package-info.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/package-info.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/package-info.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/AbstractSerializer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/AbstractSerializer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/AbstractSerializer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/AbstractSerializer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/JSONSerializer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/JSONSerializer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/JSONSerializer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/JSONSerializer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/Serializer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/Serializer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/Serializer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/Serializer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/ECIDUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/ECIDUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/ECIDUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/ECIDUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/MethodContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/MethodContext.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/MethodContext.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/MethodContext.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/ChannelDumpWriter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/ChannelDumpWriter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/ChannelDumpWriter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/ChannelDumpWriter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/DumpWriter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/DumpWriter.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/DumpWriter.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/DumpWriter.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/META-INF/services/javax.annotation.processing.Processor
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/META-INF/services/javax.annotation.processing.Processor
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/META-INF/services/javax.annotation.processing.Processor
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java
new file mode 100644
index 0000000..1c08964
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.test;
+
+/**
+ * A class loader that exports all packages in the module defining the class loader to all classes
+ * in the unnamed module associated with the loader.
+ */
+public class ExportingClassLoader extends ClassLoader {
+    public ExportingClassLoader() {
+        if (!GraalTest.Java8OrEarlier) {
+            JLModule.fromClass(getClass()).exportAllPackagesTo(JLModule.getUnnamedModuleFor(this));
+        }
+    }
+
+    public ExportingClassLoader(ClassLoader parent) {
+        super(parent);
+        if (!GraalTest.Java8OrEarlier) {
+            JLModule.fromClass(getClass()).exportAllPackagesTo(JLModule.getUnnamedModuleFor(this));
+        }
+    }
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java
new file mode 100644
index 0000000..9fe1c13
--- /dev/null
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.test;
+
+import java.lang.reflect.Method;
+import java.util.Set;
+
+/**
+ * Facade for the {@code java.lang.Module} class introduced in JDK9 that allows tests to be
+ * developed against JDK8 but use module logic if deployed on JDK9.
+ */
+public class JLModule {
+
+    static {
+        if (GraalTest.Java8OrEarlier) {
+            throw new AssertionError("Use of " + JLModule.class + " only allowed if " + GraalTest.class.getName() + ".JDK8OrEarlier is false");
+        }
+    }
+
+    private final Object realModule;
+
+    public JLModule(Object module) {
+        this.realModule = module;
+    }
+
+    private static final Class<?> moduleClass;
+    private static final Method getModuleMethod;
+    private static final Method getUnnamedModuleMethod;
+    private static final Method getPackagesMethod;
+    private static final Method isExportedMethod;
+    private static final Method isExported2Method;
+    private static final Method addExportsMethod;
+    static {
+        try {
+            moduleClass = Class.forName("java.lang.Module");
+            getModuleMethod = Class.class.getMethod("getModule");
+            getUnnamedModuleMethod = ClassLoader.class.getMethod("getUnnamedModule");
+            getPackagesMethod = moduleClass.getMethod("getPackages");
+            isExportedMethod = moduleClass.getMethod("isExported", String.class);
+            isExported2Method = moduleClass.getMethod("isExported", String.class, moduleClass);
+            addExportsMethod = moduleClass.getMethod("addExports", String.class, moduleClass);
+        } catch (Exception e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    public static JLModule fromClass(Class<?> cls) {
+        try {
+            return new JLModule(getModuleMethod.invoke(cls));
+        } catch (Exception e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    public static JLModule getUnnamedModuleFor(ClassLoader cl) {
+        try {
+            return new JLModule(getUnnamedModuleMethod.invoke(cl));
+        } catch (Exception e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    /**
+     * Exports all packages in this module to a given module.
+     */
+    public void exportAllPackagesTo(JLModule module) {
+        if (this != module) {
+            for (String pkg : getPackages()) {
+                // Export all JVMCI packages dynamically instead
+                // of requiring a long list of -XaddExports
+                // options on the JVM command line.
+                if (!isExported(pkg, module)) {
+                    addExports(pkg, module);
+                }
+            }
+        }
+    }
+
+    public Set<String> getPackages() {
+        try {
+            return (Set<String>) getPackagesMethod.invoke(realModule);
+        } catch (Exception e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    public boolean isExported(String pn) {
+        try {
+            return (Boolean) isExportedMethod.invoke(realModule, pn);
+        } catch (Exception e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    public boolean isExported(String pn, JLModule other) {
+        try {
+            return (Boolean) isExported2Method.invoke(realModule, pn, other.realModule);
+        } catch (Exception e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    public void addExports(String pn, JLModule other) {
+        try {
+            addExportsMethod.invoke(realModule, pn, other.realModule);
+        } catch (Exception e) {
+            throw new AssertionError(e);
+        }
+    }
+}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/.checkstyle.exclude b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/.checkstyle.exclude
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/.checkstyle.exclude
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/.checkstyle.exclude
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicUnsigned.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicUnsigned.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicUnsigned.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicUnsigned.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicWord.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicWord.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicWord.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicWord.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ComparableWord.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ComparableWord.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ComparableWord.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ComparableWord.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Pointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Pointer.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Pointer.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Pointer.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerBase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerBase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerBase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerUtils.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerUtils.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerUtils.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerUtils.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Signed.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Signed.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Signed.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Signed.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Unsigned.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Unsigned.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Unsigned.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Unsigned.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsignedUtils.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsignedUtils.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsignedUtils.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsignedUtils.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordBase.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordBase.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordBase.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/nodes/WordCastNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/nodes/WordCastNode.java
similarity index 100%
rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/nodes/WordCastNode.java
rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/nodes/WordCastNode.java
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java
deleted file mode 100644
index e0b5acb..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.vm.ci.hotspot;
-
-import static jdk.vm.ci.common.InitTimer.timer;
-import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
-
-import java.lang.reflect.Executable;
-
-import jdk.vm.ci.code.BytecodeFrame;
-import jdk.vm.ci.code.InstalledCode;
-import jdk.vm.ci.code.InvalidInstalledCodeException;
-import jdk.vm.ci.code.TargetDescription;
-import jdk.vm.ci.common.InitTimer;
-import jdk.vm.ci.common.JVMCIError;
-import jdk.vm.ci.meta.JavaType;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
-/**
- * Calls from Java into HotSpot. The behavior of all the methods in this class that take a native
- * pointer as an argument (e.g., {@link #getSymbol(long)}) is undefined if the argument does not
- * denote a valid native object.
- */
-final class CompilerToVM {
-    /**
-     * Initializes the native part of the JVMCI runtime.
-     */
-    private static native void registerNatives();
-
-    static {
-        initialize();
-    }
-
-    @SuppressWarnings("try")
-    private static void initialize() {
-        try (InitTimer t = timer("CompilerToVM.registerNatives")) {
-            registerNatives();
-        }
-    }
-
-    /**
-     * Gets the {@link CompilerToVM} instance associated with the singleton
-     * {@link HotSpotJVMCIRuntime} instance.
-     */
-    public static CompilerToVM compilerToVM() {
-        return runtime().getCompilerToVM();
-    }
-
-    /**
-     * Copies the original bytecode of {@code method} into a new byte array and returns it.
-     *
-     * @return a new byte array containing the original bytecode of {@code method}
-     */
-    native byte[] getBytecode(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Gets the number of entries in {@code method}'s exception handler table or 0 if it has no
-     * exception handler table.
-     */
-    native int getExceptionTableLength(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Gets the address of the first entry in {@code method}'s exception handler table.
-     *
-     * Each entry is a native object described by these fields:
-     *
-     * <ul>
-     * <li>{@link HotSpotVMConfig#exceptionTableElementSize}</li>
-     * <li>{@link HotSpotVMConfig#exceptionTableElementStartPcOffset}</li>
-     * <li>{@link HotSpotVMConfig#exceptionTableElementEndPcOffset}</li>
-     * <li>{@link HotSpotVMConfig#exceptionTableElementHandlerPcOffset}</li>
-     * <li>{@link HotSpotVMConfig#exceptionTableElementCatchTypeIndexOffset}
-     * </ul>
-     *
-     * @return 0 if {@code method} has no exception handlers (i.e.
-     *         {@code getExceptionTableLength(method) == 0})
-     */
-    native long getExceptionTableStart(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Determines whether {@code method} is currently compilable by the JVMCI compiler being used by
-     * the VM. This can return false if JVMCI compilation failed earlier for {@code method}, a
-     * breakpoint is currently set in {@code method} or {@code method} contains other bytecode
-     * features that require special handling by the VM.
-     */
-    native boolean isCompilable(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Determines if {@code method} is targeted by a VM directive (e.g.,
-     * {@code -XX:CompileCommand=dontinline,<pattern>}) or annotation (e.g.,
-     * {@code jdk.internal.vm.annotation.DontInline}) that specifies it should not be inlined.
-     */
-    native boolean hasNeverInlineDirective(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Determines if {@code method} should be inlined at any cost. This could be because:
-     * <ul>
-     * <li>a CompileOracle directive may forces inlining of this methods</li>
-     * <li>an annotation forces inlining of this method</li>
-     * </ul>
-     */
-    native boolean shouldInlineMethod(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Used to implement {@link ResolvedJavaType#findUniqueConcreteMethod(ResolvedJavaMethod)}.
-     *
-     * @param method the method on which to base the search
-     * @param actualHolderType the best known type of receiver
-     * @return the method result or 0 is there is no unique concrete method for {@code method}
-     */
-    native HotSpotResolvedJavaMethodImpl findUniqueConcreteMethod(HotSpotResolvedObjectTypeImpl actualHolderType, HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Gets the implementor for the interface class {@code type}.
-     *
-     * @return the implementor if there is a single implementor, 0 if there is no implementor, or
-     *         {@code type} itself if there is more than one implementor
-     */
-    native HotSpotResolvedObjectTypeImpl getImplementor(HotSpotResolvedObjectTypeImpl type);
-
-    /**
-     * Determines if {@code method} is ignored by security stack walks.
-     */
-    native boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Converts a name to a type.
-     *
-     * @param name a well formed Java type in {@linkplain JavaType#getName() internal} format
-     * @param accessingClass the context of resolution (must not be null)
-     * @param resolve force resolution to a {@link ResolvedJavaType}. If true, this method will
-     *            either return a {@link ResolvedJavaType} or throw an exception
-     * @return the type for {@code name} or 0 if resolution failed and {@code resolve == false}
-     * @throws LinkageError if {@code resolve == true} and the resolution failed
-     */
-    native HotSpotResolvedObjectTypeImpl lookupType(String name, Class<?> accessingClass, boolean resolve);
-
-    /**
-     * Resolves the entry at index {@code cpi} in {@code constantPool} to an object.
-     *
-     * The behavior of this method is undefined if {@code cpi} does not denote one of the following
-     * entry types: {@code JVM_CONSTANT_MethodHandle}, {@code JVM_CONSTANT_MethodHandleInError},
-     * {@code JVM_CONSTANT_MethodType} and {@code JVM_CONSTANT_MethodTypeInError}.
-     */
-    native Object resolveConstantInPool(HotSpotConstantPool constantPool, int cpi);
-
-    /**
-     * Resolves the entry at index {@code cpi} in {@code constantPool} to an object, looking in the
-     * constant pool cache first.
-     *
-     * The behavior of this method is undefined if {@code cpi} does not denote a
-     * {@code JVM_CONSTANT_String} entry.
-     */
-    native Object resolvePossiblyCachedConstantInPool(HotSpotConstantPool constantPool, int cpi);
-
-    /**
-     * Gets the {@code JVM_CONSTANT_NameAndType} index from the entry at index {@code cpi} in
-     * {@code constantPool}.
-     *
-     * The behavior of this method is undefined if {@code cpi} does not denote an entry containing a
-     * {@code JVM_CONSTANT_NameAndType} index.
-     */
-    native int lookupNameAndTypeRefIndexInPool(HotSpotConstantPool constantPool, int cpi);
-
-    /**
-     * Gets the name of the {@code JVM_CONSTANT_NameAndType} entry referenced by another entry
-     * denoted by {@code which} in {@code constantPool}.
-     *
-     * The behavior of this method is undefined if {@code which} does not denote a entry that
-     * references a {@code JVM_CONSTANT_NameAndType} entry.
-     */
-    native String lookupNameInPool(HotSpotConstantPool constantPool, int which);
-
-    /**
-     * Gets the signature of the {@code JVM_CONSTANT_NameAndType} entry referenced by another entry
-     * denoted by {@code which} in {@code constantPool}.
-     *
-     * The behavior of this method is undefined if {@code which} does not denote a entry that
-     * references a {@code JVM_CONSTANT_NameAndType} entry.
-     */
-    native String lookupSignatureInPool(HotSpotConstantPool constantPool, int which);
-
-    /**
-     * Gets the {@code JVM_CONSTANT_Class} index from the entry at index {@code cpi} in
-     * {@code constantPool}.
-     *
-     * The behavior of this method is undefined if {@code cpi} does not denote an entry containing a
-     * {@code JVM_CONSTANT_Class} index.
-     */
-    native int lookupKlassRefIndexInPool(HotSpotConstantPool constantPool, int cpi);
-
-    /**
-     * Looks up a class denoted by the {@code JVM_CONSTANT_Class} entry at index {@code cpi} in
-     * {@code constantPool}. This method does not perform any resolution.
-     *
-     * The behavior of this method is undefined if {@code cpi} does not denote a
-     * {@code JVM_CONSTANT_Class} entry.
-     *
-     * @return the resolved class entry or a String otherwise
-     */
-    native Object lookupKlassInPool(HotSpotConstantPool constantPool, int cpi);
-
-    /**
-     * Looks up a method denoted by the entry at index {@code cpi} in {@code constantPool}. This
-     * method does not perform any resolution.
-     *
-     * The behavior of this method is undefined if {@code cpi} does not denote an entry representing
-     * a method.
-     *
-     * @param opcode the opcode of the instruction for which the lookup is being performed or
-     *            {@code -1}. If non-negative, then resolution checks specific to the bytecode it
-     *            denotes are performed if the method is already resolved. Should any of these
-     *            checks fail, 0 is returned.
-     * @return the resolved method entry, 0 otherwise
-     */
-    native HotSpotResolvedJavaMethodImpl lookupMethodInPool(HotSpotConstantPool constantPool, int cpi, byte opcode);
-
-    /**
-     * Ensures that the type referenced by the specified {@code JVM_CONSTANT_InvokeDynamic} entry at
-     * index {@code cpi} in {@code constantPool} is loaded and initialized.
-     *
-     * The behavior of this method is undefined if {@code cpi} does not denote a
-     * {@code JVM_CONSTANT_InvokeDynamic} entry.
-     */
-    native void resolveInvokeDynamicInPool(HotSpotConstantPool constantPool, int cpi);
-
-    /**
-     * If {@code cpi} denotes an entry representing a
-     * <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html#jvms-2.9">signature
-     * polymorphic</a> method, this method ensures that the type referenced by the entry is loaded
-     * and initialized. It {@code cpi} does not denote a signature polymorphic method, this method
-     * does nothing.
-     */
-    native void resolveInvokeHandleInPool(HotSpotConstantPool constantPool, int cpi);
-
-    /**
-     * Gets the list of type names (in the format of {@link JavaType#getName()}) denoting the
-     * classes that define signature polymorphic methods.
-     */
-    native String[] getSignaturePolymorphicHolders();
-
-    /**
-     * Gets the resolved type denoted by the entry at index {@code cpi} in {@code constantPool}.
-     *
-     * The behavior of this method is undefined if {@code cpi} does not denote an entry representing
-     * a class.
-     *
-     * @throws LinkageError if resolution failed
-     */
-    native HotSpotResolvedObjectTypeImpl resolveTypeInPool(HotSpotConstantPool constantPool, int cpi) throws LinkageError;
-
-    /**
-     * Looks up and attempts to resolve the {@code JVM_CONSTANT_Field} entry for at index
-     * {@code cpi} in {@code constantPool}. For some opcodes, checks are performed that require the
-     * {@code method} that contains {@code opcode} to be specified. The values returned in
-     * {@code info} are:
-     *
-     * <pre>
-     *     [(int) flags,   // only valid if field is resolved
-     *      (int) offset]  // only valid if field is resolved
-     * </pre>
-     *
-     * The behavior of this method is undefined if {@code cpi} does not denote a
-     * {@code JVM_CONSTANT_Field} entry.
-     *
-     * @param info an array in which the details of the field are returned
-     * @return the type defining the field if resolution is successful, 0 otherwise
-     */
-    native HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, int cpi, HotSpotResolvedJavaMethodImpl method, byte opcode, long[] info);
-
-    /**
-     * Converts {@code cpci} from an index into the cache for {@code constantPool} to an index
-     * directly into {@code constantPool}.
-     *
-     * The behavior of this method is undefined if {@code ccpi} is an invalid constant pool cache
-     * index.
-     */
-    native int constantPoolRemapInstructionOperandFromCache(HotSpotConstantPool constantPool, int cpci);
-
-    /**
-     * Gets the appendix object (if any) associated with the entry at index {@code cpi} in
-     * {@code constantPool}.
-     */
-    native Object lookupAppendixInPool(HotSpotConstantPool constantPool, int cpi);
-
-    /**
-     * Installs the result of a compilation into the code cache.
-     *
-     * @param target the target where this code should be installed
-     * @param compiledCode the result of a compilation
-     * @param code the details of the installed CodeBlob are written to this object
-     * @return the outcome of the installation which will be one of
-     *         {@link HotSpotVMConfig#codeInstallResultOk},
-     *         {@link HotSpotVMConfig#codeInstallResultCacheFull},
-     *         {@link HotSpotVMConfig#codeInstallResultCodeTooLarge},
-     *         {@link HotSpotVMConfig#codeInstallResultDependenciesFailed} or
-     *         {@link HotSpotVMConfig#codeInstallResultDependenciesInvalid}.
-     * @throws JVMCIError if there is something wrong with the compiled code or the associated
-     *             metadata.
-     */
-    native int installCode(TargetDescription target, HotSpotCompiledCode compiledCode, InstalledCode code, HotSpotSpeculationLog speculationLog);
-
-    /**
-     * Generates the VM metadata for some compiled code and copies them into {@code metaData}. This
-     * method does not install anything into the code cache.
-     *
-     * @param target the target where this code would be installed
-     * @param compiledCode the result of a compilation
-     * @param metaData the metadata is written to this object
-     * @return the outcome of the installation which will be one of
-     *         {@link HotSpotVMConfig#codeInstallResultOk},
-     *         {@link HotSpotVMConfig#codeInstallResultCacheFull},
-     *         {@link HotSpotVMConfig#codeInstallResultCodeTooLarge},
-     *         {@link HotSpotVMConfig#codeInstallResultDependenciesFailed} or
-     *         {@link HotSpotVMConfig#codeInstallResultDependenciesInvalid}.
-     * @throws JVMCIError if there is something wrong with the compiled code or the metadata
-     */
-    native int getMetadata(TargetDescription target, HotSpotCompiledCode compiledCode, HotSpotMetaData metaData);
-
-    /**
-     * Resets all compilation statistics.
-     */
-    native void resetCompilationStatistics();
-
-    /**
-     * Reads the database of VM info. The return value encodes the info in a nested object array
-     * that is described by the pseudo Java object {@code info} below:
-     *
-     * <pre>
-     *     info = [
-     *         VMField[] vmFields,
-     *         [String name, Long size, ...] vmTypeSizes,
-     *         [String name, Long value, ...] vmConstants,
-     *         [String name, Long value, ...] vmAddresses,
-     *         VMFlag[] vmFlags
-     *         VMIntrinsicMethod[] vmIntrinsics
-     *     ]
-     * </pre>
-     *
-     * @return VM info as encoded above
-     */
-    native Object[] readConfiguration();
-
-    /**
-     * Resolves the implementation of {@code method} for virtual dispatches on objects of dynamic
-     * type {@code exactReceiver}. This resolution process only searches "up" the class hierarchy of
-     * {@code exactReceiver}.
-     *
-     * @param caller the caller or context type used to perform access checks
-     * @return the link-time resolved method (might be abstract) or {@code null} if it is either a
-     *         signature polymorphic method or can not be linked.
-     */
-    native HotSpotResolvedJavaMethodImpl resolveMethod(HotSpotResolvedObjectTypeImpl exactReceiver, HotSpotResolvedJavaMethodImpl method, HotSpotResolvedObjectTypeImpl caller);
-
-    /**
-     * Gets the static initializer of {@code type}.
-     *
-     * @return 0 if {@code type} has no static initializer
-     */
-    native HotSpotResolvedJavaMethodImpl getClassInitializer(HotSpotResolvedObjectTypeImpl type);
-
-    /**
-     * Determines if {@code type} or any of its currently loaded subclasses overrides
-     * {@code Object.finalize()}.
-     */
-    native boolean hasFinalizableSubclass(HotSpotResolvedObjectTypeImpl type);
-
-    /**
-     * Gets the method corresponding to {@code executable}.
-     */
-    native HotSpotResolvedJavaMethodImpl asResolvedJavaMethod(Executable executable);
-
-    /**
-     * Gets the maximum absolute offset of a PC relative call to {@code address} from any position
-     * in the code cache.
-     *
-     * @param address an address that may be called from any code in the code cache
-     * @return -1 if {@code address == 0}
-     */
-    native long getMaxCallTargetOffset(long address);
-
-    /**
-     * Gets a textual disassembly of {@code codeBlob}.
-     *
-     * @return a non-zero length string containing a disassembly of {@code codeBlob} or null if
-     *         {@code codeBlob} could not be disassembled for some reason
-     */
-    // The HotSpot disassembler seems not to be thread safe so it's better to synchronize its usage
-    synchronized native String disassembleCodeBlob(InstalledCode installedCode);
-
-    /**
-     * Gets a stack trace element for {@code method} at bytecode index {@code bci}.
-     */
-    native StackTraceElement getStackTraceElement(HotSpotResolvedJavaMethodImpl method, int bci);
-
-    /**
-     * Executes some {@code installedCode} with arguments {@code args}.
-     *
-     * @return the result of executing {@code installedCode}
-     * @throws InvalidInstalledCodeException if {@code installedCode} has been invalidated
-     */
-    native Object executeInstalledCode(Object[] args, InstalledCode installedCode) throws InvalidInstalledCodeException;
-
-    /**
-     * Gets the line number table for {@code method}. The line number table is encoded as (bci,
-     * source line number) pairs.
-     *
-     * @return the line number table for {@code method} or null if it doesn't have one
-     */
-    native long[] getLineNumberTable(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Gets the number of entries in the local variable table for {@code method}.
-     *
-     * @return the number of entries in the local variable table for {@code method}
-     */
-    native int getLocalVariableTableLength(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Gets the address of the first entry in the local variable table for {@code method}.
-     *
-     * Each entry is a native object described by these fields:
-     *
-     * <ul>
-     * <li>{@link HotSpotVMConfig#localVariableTableElementSize}</li>
-     * <li>{@link HotSpotVMConfig#localVariableTableElementLengthOffset}</li>
-     * <li>{@link HotSpotVMConfig#localVariableTableElementNameCpIndexOffset}</li>
-     * <li>{@link HotSpotVMConfig#localVariableTableElementDescriptorCpIndexOffset}</li>
-     * <li>{@link HotSpotVMConfig#localVariableTableElementSlotOffset}
-     * <li>{@link HotSpotVMConfig#localVariableTableElementStartBciOffset}
-     * </ul>
-     *
-     * @return 0 if {@code method} does not have a local variable table
-     */
-    native long getLocalVariableTableStart(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Determines if {@code method} should not be inlined or compiled.
-     */
-    native void doNotInlineOrCompile(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Invalidates the profiling information for {@code method} and (re)initializes it such that
-     * profiling restarts upon its next invocation.
-     */
-    native void reprofile(HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Invalidates {@code installedCode} such that {@link InvalidInstalledCodeException} will be
-     * raised the next time {@code installedCode} is executed.
-     */
-    native void invalidateInstalledCode(InstalledCode installedCode);
-
-    /**
-     * Collects the current values of all JVMCI benchmark counters, summed up over all threads.
-     */
-    native long[] collectCounters();
-
-    /**
-     * Determines if {@code metaspaceMethodData} is mature.
-     */
-    native boolean isMature(long metaspaceMethodData);
-
-    /**
-     * Generate a unique id to identify the result of the compile.
-     */
-    native int allocateCompileId(HotSpotResolvedJavaMethodImpl method, int entryBCI);
-
-    /**
-     * Determines if {@code method} has OSR compiled code identified by {@code entryBCI} for
-     * compilation level {@code level}.
-     */
-    native boolean hasCompiledCodeForOSR(HotSpotResolvedJavaMethodImpl method, int entryBCI, int level);
-
-    /**
-     * Gets the value of {@code metaspaceSymbol} as a String.
-     */
-    native String getSymbol(long metaspaceSymbol);
-
-    /**
-     * Looks for the next Java stack frame matching an entry in {@code methods}.
-     *
-     * @param frame the starting point of the search, where {@code null} refers to the topmost frame
-     * @param methods the methods to look for, where {@code null} means that any frame is returned
-     * @return the frame, or {@code null} if the end of the stack was reached during the search
-     */
-    native HotSpotStackFrameReference getNextStackFrame(HotSpotStackFrameReference frame, ResolvedJavaMethod[] methods, int initialSkip);
-
-    /**
-     * Materializes all virtual objects within {@code stackFrame} and updates its locals.
-     *
-     * @param invalidate if {@code true}, the compiled method for the stack frame will be
-     *            invalidated
-     */
-    native void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate);
-
-    /**
-     * Gets the v-table index for interface method {@code method} in the receiver {@code type} or
-     * {@link HotSpotVMConfig#invalidVtableIndex} if {@code method} is not in {@code type}'s
-     * v-table.
-     *
-     * @throws InternalError if {@code type} is an interface or {@code method} is not held by an
-     *             interface or class represented by {@code type} is not initialized
-     */
-    native int getVtableIndexForInterfaceMethod(HotSpotResolvedObjectTypeImpl type, HotSpotResolvedJavaMethodImpl method);
-
-    /**
-     * Determines if debug info should also be emitted at non-safepoint locations.
-     */
-    native boolean shouldDebugNonSafepoints();
-
-    /**
-     * Writes {@code length} bytes from {@code bytes} starting at offset {@code offset} to the
-     * HotSpot's log stream.
-     *
-     * @exception NullPointerException if {@code bytes == null}
-     * @exception IndexOutOfBoundsException if copying would cause access of data outside array
-     *                bounds
-     */
-    native void writeDebugOutput(byte[] bytes, int offset, int length);
-
-    /**
-     * Flush HotSpot's log stream.
-     */
-    native void flushDebugOutput();
-
-    /**
-     * Read a HotSpot Method* value from the memory location described by {@code base} plus
-     * {@code displacement} and return the {@link HotSpotResolvedJavaMethodImpl} wrapping it. This
-     * method does no checking that the memory location actually contains a valid pointer and may
-     * crash the VM if an invalid location is provided. If the {@code base} is null then
-     * {@code displacement} is used by itself. If {@code base} is a
-     * {@link HotSpotResolvedJavaMethodImpl}, {@link HotSpotConstantPool} or
-     * {@link HotSpotResolvedObjectTypeImpl} then the metaspace pointer is fetched from that object
-     * and added to {@code displacement}. Any other non-null object type causes an
-     * {@link IllegalArgumentException} to be thrown.
-     *
-     * @param base an object to read from or null
-     * @param displacement
-     * @return null or the resolved method for this location
-     */
-    native HotSpotResolvedJavaMethodImpl getResolvedJavaMethod(Object base, long displacement);
-
-    /**
-     * Gets the {@code ConstantPool*} associated with {@code object} and returns a
-     * {@link HotSpotConstantPool} wrapping it.
-     *
-     * @param object a {@link HotSpotResolvedJavaMethodImpl} or
-     *            {@link HotSpotResolvedObjectTypeImpl} object
-     * @return a {@link HotSpotConstantPool} wrapping the {@code ConstantPool*} associated with
-     *         {@code object}
-     * @throws NullPointerException if {@code object == null}
-     * @throws IllegalArgumentException if {@code object} is neither a
-     *             {@link HotSpotResolvedJavaMethodImpl} nor a {@link HotSpotResolvedObjectTypeImpl}
-     */
-    native HotSpotConstantPool getConstantPool(Object object);
-
-    /**
-     * Read a HotSpot Klass* value from the memory location described by {@code base} plus
-     * {@code displacement} and return the {@link HotSpotResolvedObjectTypeImpl} wrapping it. This
-     * method does no checking that the memory location actually contains a valid pointer and may
-     * crash the VM if an invalid location is provided. If the {@code base} is null then
-     * {@code displacement} is used by itself. If {@code base} is a
-     * {@link HotSpotResolvedJavaMethodImpl}, {@link HotSpotConstantPool} or
-     * {@link HotSpotResolvedObjectTypeImpl} then the metaspace pointer is fetched from that object
-     * and added to {@code displacement}. Any other non-null object type causes an
-     * {@link IllegalArgumentException} to be thrown.
-     *
-     * @param base an object to read from or null
-     * @param displacement
-     * @param compressed true if the location contains a compressed Klass*
-     * @return null or the resolved method for this location
-     */
-    native HotSpotResolvedObjectTypeImpl getResolvedJavaType(Object base, long displacement, boolean compressed);
-
-    /**
-     * Return the size of the HotSpot ProfileData* pointed at by {@code position}. If
-     * {@code position} is outside the space of the MethodData then an
-     * {@link IllegalArgumentException} is thrown. A {@code position} inside the MethodData but that
-     * isn't pointing at a valid ProfileData will crash the VM.
-     *
-     * @param metaspaceMethodData
-     * @param position
-     * @return the size of the ProfileData item pointed at by {@code position}
-     * @throws IllegalArgumentException if an out of range position is given
-     */
-    native int methodDataProfileDataSize(long metaspaceMethodData, int position);
-
-    /**
-     * Gets the fingerprint for a given Klass*
-     *
-     * @param metaspaceKlass
-     * @return the value of the fingerprint (zero for arrays and synthetic classes).
-     */
-    native long getFingerprint(long metaspaceKlass);
-
-    /**
-     * Return the amount of native stack required for the interpreter frames represented by
-     * {@code frame}. This is used when emitting the stack banging code to ensure that there is
-     * enough space for the frames during deoptimization.
-     *
-     * @param frame
-     * @return the number of bytes required for deoptimization of this frame state
-     */
-    native int interpreterFrameSize(BytecodeFrame frame);
-
-    /**
-     * Invokes non-public method {@code java.lang.invoke.LambdaForm.compileToBytecode()} on
-     * {@code lambdaForm} (which must be a {@code java.lang.invoke.LambdaForm} instance).
-     */
-    native void compileToBytecode(Object lambdaForm);
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java
deleted file mode 100644
index f5489fb..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import java.util.Map;
-
-import jdk.vm.ci.code.BailoutException;
-import jdk.vm.ci.code.BytecodeFrame;
-import jdk.vm.ci.code.CodeCacheProvider;
-import jdk.vm.ci.code.CompiledCode;
-import jdk.vm.ci.code.InstalledCode;
-import jdk.vm.ci.code.RegisterConfig;
-import jdk.vm.ci.code.TargetDescription;
-import jdk.vm.ci.code.site.Call;
-import jdk.vm.ci.code.site.Mark;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.SpeculationLog;
-
-/**
- * HotSpot implementation of {@link CodeCacheProvider}.
- */
-public class HotSpotCodeCacheProvider implements CodeCacheProvider {
-
-    protected final HotSpotJVMCIRuntimeProvider runtime;
-    protected final HotSpotVMConfig config;
-    protected final TargetDescription target;
-    protected final RegisterConfig regConfig;
-
-    public HotSpotCodeCacheProvider(HotSpotJVMCIRuntimeProvider runtime, HotSpotVMConfig config, TargetDescription target, RegisterConfig regConfig) {
-        this.runtime = runtime;
-        this.config = config;
-        this.target = target;
-        this.regConfig = regConfig;
-    }
-
-    @Override
-    public String getMarkName(Mark mark) {
-        int markId = (int) mark.id;
-        HotSpotVMConfigStore store = runtime.getConfigStore();
-        for (Map.Entry<String, Long> e : store.getConstants().entrySet()) {
-            String name = e.getKey();
-            if (name.startsWith("MARKID_") && e.getValue() == markId) {
-                return name;
-            }
-        }
-        return CodeCacheProvider.super.getMarkName(mark);
-    }
-
-    /**
-     * Decodes a call target to a mnemonic if possible.
-     */
-    @Override
-    public String getTargetName(Call call) {
-        if (call.target instanceof HotSpotForeignCallTarget) {
-            long address = ((HotSpotForeignCallTarget) call.target).address;
-            HotSpotVMConfigStore store = runtime.getConfigStore();
-            for (Map.Entry<String, VMField> e : store.getFields().entrySet()) {
-                VMField field = e.getValue();
-                if (field.isStatic() && field.value != null && field.value == address) {
-                    return e.getValue() + ":0x" + Long.toHexString(address);
-                }
-            }
-        }
-        return CodeCacheProvider.super.getTargetName(call);
-    }
-
-    @Override
-    public RegisterConfig getRegisterConfig() {
-        return regConfig;
-    }
-
-    @Override
-    public int getMinimumOutgoingSize() {
-        return runtime.getConfig().runtimeCallStackSize;
-    }
-
-    private InstalledCode logOrDump(InstalledCode installedCode, CompiledCode compiledCode) {
-        ((HotSpotJVMCIRuntime) runtime).notifyInstall(this, installedCode, compiledCode);
-        return installedCode;
-    }
-
-    public InstalledCode installCode(ResolvedJavaMethod method, CompiledCode compiledCode, InstalledCode installedCode, SpeculationLog log, boolean isDefault) {
-        InstalledCode resultInstalledCode;
-        if (installedCode == null) {
-            if (method == null) {
-                // Must be a stub
-                resultInstalledCode = new HotSpotRuntimeStub(((HotSpotCompiledCode) compiledCode).getName());
-            } else {
-                resultInstalledCode = new HotSpotNmethod((HotSpotResolvedJavaMethod) method, ((HotSpotCompiledCode) compiledCode).getName(), isDefault);
-            }
-        } else {
-            resultInstalledCode = installedCode;
-        }
-
-        HotSpotSpeculationLog speculationLog = (log != null && log.hasSpeculations()) ? (HotSpotSpeculationLog) log : null;
-
-        int result = runtime.getCompilerToVM().installCode(target, (HotSpotCompiledCode) compiledCode, resultInstalledCode, speculationLog);
-        if (result != config.codeInstallResultOk) {
-            String resultDesc = config.getCodeInstallResultDescription(result);
-            if (compiledCode instanceof HotSpotCompiledNmethod) {
-                HotSpotCompiledNmethod compiledNmethod = (HotSpotCompiledNmethod) compiledCode;
-                String msg = compiledNmethod.getInstallationFailureMessage();
-                if (msg != null) {
-                    msg = String.format("Code installation failed: %s%n%s", resultDesc, msg);
-                } else {
-                    msg = String.format("Code installation failed: %s", resultDesc);
-                }
-                if (result == config.codeInstallResultDependenciesInvalid) {
-                    throw new AssertionError(resultDesc + " " + msg);
-                }
-                throw new BailoutException(result != config.codeInstallResultDependenciesFailed, msg);
-            } else {
-                throw new BailoutException("Error installing %s: %s", ((HotSpotCompiledCode) compiledCode).getName(), resultDesc);
-            }
-        }
-        return logOrDump(resultInstalledCode, compiledCode);
-    }
-
-    public void invalidateInstalledCode(InstalledCode installedCode) {
-        runtime.getCompilerToVM().invalidateInstalledCode(installedCode);
-    }
-
-    @Override
-    public TargetDescription getTarget() {
-        return target;
-    }
-
-    public String disassemble(InstalledCode code) {
-        if (code.isValid()) {
-            return runtime.getCompilerToVM().disassembleCodeBlob(code);
-        }
-        return null;
-    }
-
-    public SpeculationLog createSpeculationLog() {
-        return new HotSpotSpeculationLog();
-    }
-
-    public long getMaxCallTargetOffset(long address) {
-        return runtime.getCompilerToVM().getMaxCallTargetOffset(address);
-    }
-
-    public boolean shouldDebugNonSafepoints() {
-        return runtime.getCompilerToVM().shouldDebugNonSafepoints();
-    }
-
-    public int interpreterFrameSize(BytecodeFrame pos) {
-        return runtime.getCompilerToVM().interpreterFrameSize(pos);
-    }
-
-    /**
-     * Resets all compilation statistics.
-     */
-    public void resetCompilationStatistics() {
-        runtime.getCompilerToVM().resetCompilationStatistics();
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java
deleted file mode 100644
index 957f665..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java
+++ /dev/null
@@ -1,743 +0,0 @@
-/*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
-import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
-import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
-import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
-
-import java.lang.invoke.MethodHandle;
-
-import jdk.vm.ci.common.JVMCIError;
-import jdk.vm.ci.meta.ConstantPool;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.JavaField;
-import jdk.vm.ci.meta.JavaMethod;
-import jdk.vm.ci.meta.JavaType;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-import jdk.vm.ci.meta.Signature;
-
-/**
- * Implementation of {@link ConstantPool} for HotSpot.
- */
-final class HotSpotConstantPool implements ConstantPool, MetaspaceWrapperObject {
-
-    /**
-     * Subset of JVM bytecode opcodes used by {@link HotSpotConstantPool}.
-     */
-    public static class Bytecodes {
-        public static final int LDC = 18; // 0x12
-        public static final int LDC_W = 19; // 0x13
-        public static final int LDC2_W = 20; // 0x14
-        public static final int GETSTATIC = 178; // 0xB2
-        public static final int PUTSTATIC = 179; // 0xB3
-        public static final int GETFIELD = 180; // 0xB4
-        public static final int PUTFIELD = 181; // 0xB5
-        public static final int INVOKEVIRTUAL = 182; // 0xB6
-        public static final int INVOKESPECIAL = 183; // 0xB7
-        public static final int INVOKESTATIC = 184; // 0xB8
-        public static final int INVOKEINTERFACE = 185; // 0xB9
-        public static final int INVOKEDYNAMIC = 186; // 0xBA
-        public static final int NEW = 187; // 0xBB
-        public static final int NEWARRAY = 188; // 0xBC
-        public static final int ANEWARRAY = 189; // 0xBD
-        public static final int CHECKCAST = 192; // 0xC0
-        public static final int INSTANCEOF = 193; // 0xC1
-        public static final int MULTIANEWARRAY = 197; // 0xC5
-
-        static boolean isInvoke(int opcode) {
-            switch (opcode) {
-                case INVOKEVIRTUAL:
-                case INVOKESPECIAL:
-                case INVOKESTATIC:
-                case INVOKEINTERFACE:
-                case INVOKEDYNAMIC:
-                    return true;
-                default:
-                    return false;
-            }
-        }
-
-        /**
-         * See: {@code Rewriter::maybe_rewrite_invokehandle}.
-         */
-        static boolean isInvokeHandleAlias(int opcode) {
-            switch (opcode) {
-                case INVOKEVIRTUAL:
-                case INVOKESPECIAL:
-                    return true;
-                default:
-                    return false;
-            }
-        }
-    }
-
-    /**
-     * Enum of all {@code JVM_CONSTANT} constants used in the VM. This includes the public and
-     * internal ones.
-     */
-    private enum JVM_CONSTANT {
-        // @formatter:off
-        Utf8(config().jvmConstantUtf8),
-        Integer(config().jvmConstantInteger),
-        Long(config().jvmConstantLong),
-        Float(config().jvmConstantFloat),
-        Double(config().jvmConstantDouble),
-        Class(config().jvmConstantClass),
-        UnresolvedClass(config().jvmConstantUnresolvedClass),
-        UnresolvedClassInError(config().jvmConstantUnresolvedClassInError),
-        String(config().jvmConstantString),
-        Fieldref(config().jvmConstantFieldref),
-        MethodRef(config().jvmConstantMethodref),
-        InterfaceMethodref(config().jvmConstantInterfaceMethodref),
-        NameAndType(config().jvmConstantNameAndType),
-        MethodHandle(config().jvmConstantMethodHandle),
-        MethodHandleInError(config().jvmConstantMethodHandleInError),
-        MethodType(config().jvmConstantMethodType),
-        MethodTypeInError(config().jvmConstantMethodTypeInError),
-        InvokeDynamic(config().jvmConstantInvokeDynamic);
-        // @formatter:on
-
-        private final int tag;
-
-        private static final int ExternalMax = config().jvmConstantExternalMax;
-        private static final int InternalMin = config().jvmConstantInternalMin;
-        private static final int InternalMax = config().jvmConstantInternalMax;
-
-        JVM_CONSTANT(int tag) {
-            this.tag = tag;
-        }
-
-        /**
-         * Maps JVM_CONSTANT tags to {@link JVM_CONSTANT} values. Using a separate class for lazy
-         * initialization.
-         */
-        static class TagValueMap {
-            private static final JVM_CONSTANT[] table = new JVM_CONSTANT[ExternalMax + 1 + (InternalMax - InternalMin) + 1];
-
-            static {
-                assert InternalMin > ExternalMax;
-                for (JVM_CONSTANT e : values()) {
-                    table[indexOf(e.tag)] = e;
-                }
-            }
-
-            private static int indexOf(int tag) {
-                if (tag >= InternalMin) {
-                    return tag - InternalMin + ExternalMax + 1;
-                } else {
-                    assert tag <= ExternalMax;
-                }
-                return tag;
-            }
-
-            static JVM_CONSTANT get(int tag) {
-                JVM_CONSTANT res = table[indexOf(tag)];
-                if (res != null) {
-                    return res;
-                }
-                throw new JVMCIError("Unknown JVM_CONSTANT tag %s", tag);
-            }
-        }
-
-        public static JVM_CONSTANT getEnum(int tag) {
-            return TagValueMap.get(tag);
-        }
-    }
-
-    private static class LookupTypeCacheElement {
-        int lastCpi = Integer.MIN_VALUE;
-        JavaType javaType;
-
-        LookupTypeCacheElement(int lastCpi, JavaType javaType) {
-            super();
-            this.lastCpi = lastCpi;
-            this.javaType = javaType;
-        }
-    }
-
-    /**
-     * Reference to the C++ ConstantPool object.
-     */
-    private final long metaspaceConstantPool;
-    private volatile LookupTypeCacheElement lastLookupType;
-
-    /**
-     * Gets the JVMCI mirror from a HotSpot constant pool.The VM is responsible for ensuring that
-     * the ConstantPool is kept alive for the duration of this call and the
-     * {@link HotSpotJVMCIMetaAccessContext} keeps it alive after that.
-     *
-     * Called from the VM.
-     *
-     * @param metaspaceConstantPool a metaspace ConstantPool object
-     * @return the {@link HotSpotConstantPool} corresponding to {@code metaspaceConstantPool}
-     */
-    @SuppressWarnings("unused")
-    private static HotSpotConstantPool fromMetaspace(long metaspaceConstantPool) {
-        HotSpotConstantPool cp = new HotSpotConstantPool(metaspaceConstantPool);
-        runtime().metaAccessContext.add(cp);
-        return cp;
-    }
-
-    private HotSpotConstantPool(long metaspaceConstantPool) {
-        this.metaspaceConstantPool = metaspaceConstantPool;
-    }
-
-    /**
-     * Gets the holder for this constant pool as {@link HotSpotResolvedObjectTypeImpl}.
-     *
-     * @return holder for this constant pool
-     */
-    private HotSpotResolvedObjectType getHolder() {
-        return compilerToVM().getResolvedJavaType(this, config().constantPoolHolderOffset, false);
-    }
-
-    /**
-     * Converts a raw index from the bytecodes to a constant pool index by adding a
-     * {@link HotSpotVMConfig#constantPoolCpCacheIndexTag constant}.
-     *
-     * @param rawIndex index from the bytecode
-     * @param opcode bytecode to convert the index for
-     * @return constant pool index
-     */
-    private static int rawIndexToConstantPoolIndex(int rawIndex, int opcode) {
-        int index;
-        if (opcode == Bytecodes.INVOKEDYNAMIC) {
-            index = rawIndex;
-            // See: ConstantPool::is_invokedynamic_index
-            assert index < 0 : "not an invokedynamic constant pool index " + index;
-        } else {
-            assert opcode == Bytecodes.GETFIELD || opcode == Bytecodes.PUTFIELD || opcode == Bytecodes.GETSTATIC || opcode == Bytecodes.PUTSTATIC || opcode == Bytecodes.INVOKEINTERFACE ||
-                            opcode == Bytecodes.INVOKEVIRTUAL || opcode == Bytecodes.INVOKESPECIAL || opcode == Bytecodes.INVOKESTATIC : "unexpected invoke opcode " + opcode;
-            index = rawIndex + config().constantPoolCpCacheIndexTag;
-        }
-        return index;
-    }
-
-    /**
-     * Decode a constant pool cache index to a constant pool index.
-     *
-     * See {@code ConstantPool::decode_cpcache_index}.
-     *
-     * @param index constant pool cache index
-     * @return decoded index
-     */
-    private static int decodeConstantPoolCacheIndex(int index) {
-        if (isInvokedynamicIndex(index)) {
-            return decodeInvokedynamicIndex(index);
-        } else {
-            return index - config().constantPoolCpCacheIndexTag;
-        }
-    }
-
-    /**
-     * See {@code ConstantPool::is_invokedynamic_index}.
-     */
-    private static boolean isInvokedynamicIndex(int index) {
-        return index < 0;
-    }
-
-    /**
-     * See {@code ConstantPool::decode_invokedynamic_index}.
-     */
-    private static int decodeInvokedynamicIndex(int i) {
-        assert isInvokedynamicIndex(i) : i;
-        return ~i;
-    }
-
-    long getMetaspaceConstantPool() {
-        return metaspaceConstantPool;
-    }
-
-    public long getMetaspacePointer() {
-        return getMetaspaceConstantPool();
-    }
-
-    /**
-     * Gets the constant pool tag at index {@code index}.
-     *
-     * @param index constant pool index
-     * @return constant pool tag
-     */
-    private JVM_CONSTANT getTagAt(int index) {
-        assert checkBounds(index);
-        HotSpotVMConfig config = config();
-        final long metaspaceConstantPoolTags = UNSAFE.getAddress(getMetaspaceConstantPool() + config.constantPoolTagsOffset);
-        final int tag = UNSAFE.getByteVolatile(null, metaspaceConstantPoolTags + config.arrayU1DataOffset + index);
-        if (tag == 0) {
-            return null;
-        }
-        return JVM_CONSTANT.getEnum(tag);
-    }
-
-    /**
-     * Gets the constant pool entry at index {@code index}.
-     *
-     * @param index constant pool index
-     * @return constant pool entry
-     */
-    private long getEntryAt(int index) {
-        assert checkBounds(index);
-        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
-        return UNSAFE.getAddress(getMetaspaceConstantPool() + config().constantPoolSize + offset);
-    }
-
-    /**
-     * Gets the integer constant pool entry at index {@code index}.
-     *
-     * @param index constant pool index
-     * @return integer constant pool entry at index
-     */
-    private int getIntAt(int index) {
-        assert checkTag(index, JVM_CONSTANT.Integer);
-        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
-        return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + offset);
-    }
-
-    /**
-     * Gets the long constant pool entry at index {@code index}.
-     *
-     * @param index constant pool index
-     * @return long constant pool entry
-     */
-    private long getLongAt(int index) {
-        assert checkTag(index, JVM_CONSTANT.Long);
-        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
-        return UNSAFE.getLong(getMetaspaceConstantPool() + config().constantPoolSize + offset);
-    }
-
-    /**
-     * Gets the float constant pool entry at index {@code index}.
-     *
-     * @param index constant pool index
-     * @return float constant pool entry
-     */
-    private float getFloatAt(int index) {
-        assert checkTag(index, JVM_CONSTANT.Float);
-        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
-        return UNSAFE.getFloat(getMetaspaceConstantPool() + config().constantPoolSize + offset);
-    }
-
-    /**
-     * Gets the double constant pool entry at index {@code index}.
-     *
-     * @param index constant pool index
-     * @return float constant pool entry
-     */
-    private double getDoubleAt(int index) {
-        assert checkTag(index, JVM_CONSTANT.Double);
-        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
-        return UNSAFE.getDouble(getMetaspaceConstantPool() + config().constantPoolSize + offset);
-    }
-
-    /**
-     * Gets the {@code JVM_CONSTANT_NameAndType} constant pool entry at index {@code index}.
-     *
-     * @param index constant pool index
-     * @return {@code JVM_CONSTANT_NameAndType} constant pool entry
-     */
-    private int getNameAndTypeAt(int index) {
-        assert checkTag(index, JVM_CONSTANT.NameAndType);
-        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
-        return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + offset);
-    }
-
-    /**
-     * Gets the {@code JVM_CONSTANT_NameAndType} reference index constant pool entry at index
-     * {@code index}.
-     *
-     * @param index constant pool index
-     * @return {@code JVM_CONSTANT_NameAndType} reference constant pool entry
-     */
-    private int getNameAndTypeRefIndexAt(int index) {
-        return compilerToVM().lookupNameAndTypeRefIndexInPool(this, index);
-    }
-
-    /**
-     * Gets the name of a {@code JVM_CONSTANT_NameAndType} constant pool entry referenced by another
-     * entry denoted by {@code which}.
-     *
-     * @param which constant pool index or constant pool cache index
-     * @return name as {@link String}
-     */
-    private String getNameOf(int which) {
-        return compilerToVM().lookupNameInPool(this, which);
-    }
-
-    /**
-     * Gets the name reference index of a {@code JVM_CONSTANT_NameAndType} constant pool entry at
-     * index {@code index}.
-     *
-     * @param index constant pool index
-     * @return name reference index
-     */
-    private int getNameRefIndexAt(int index) {
-        final int refIndex = getNameAndTypeAt(index);
-        // name ref index is in the low 16-bits.
-        return refIndex & 0xFFFF;
-    }
-
-    /**
-     * Gets the signature of a {@code JVM_CONSTANT_NameAndType} constant pool entry referenced by
-     * another entry denoted by {@code which}.
-     *
-     * @param which constant pool index or constant pool cache index
-     * @return signature as {@link String}
-     */
-    private String getSignatureOf(int which) {
-        return compilerToVM().lookupSignatureInPool(this, which);
-    }
-
-    /**
-     * Gets the signature reference index of a {@code JVM_CONSTANT_NameAndType} constant pool entry
-     * at index {@code index}.
-     *
-     * @param index constant pool index
-     * @return signature reference index
-     */
-    private int getSignatureRefIndexAt(int index) {
-        final int refIndex = getNameAndTypeAt(index);
-        // signature ref index is in the high 16-bits.
-        return refIndex >>> 16;
-    }
-
-    /**
-     * Gets the klass reference index constant pool entry at index {@code index}.
-     *
-     * @param index constant pool index
-     * @return klass reference index
-     */
-    private int getKlassRefIndexAt(int index) {
-        return compilerToVM().lookupKlassRefIndexInPool(this, index);
-    }
-
-    /**
-     * Gets the uncached klass reference index constant pool entry at index {@code index}. See:
-     * {@code ConstantPool::uncached_klass_ref_index_at}.
-     *
-     * @param index constant pool index
-     * @return klass reference index
-     */
-    private int getUncachedKlassRefIndexAt(int index) {
-        assert checkTagIsFieldOrMethod(index);
-        int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize;
-        final int refIndex = UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + offset);
-        // klass ref index is in the low 16-bits.
-        return refIndex & 0xFFFF;
-    }
-
-    /**
-     * Checks that the constant pool index {@code index} is in the bounds of the constant pool.
-     *
-     * @param index constant pool index
-     * @throws AssertionError if the check fails
-     */
-    private boolean checkBounds(int index) {
-        assert 0 <= index && index < length() : "index " + index + " not between 0 and " + length();
-        return true;
-    }
-
-    /**
-     * Checks that the constant pool tag at index {@code index} is equal to {@code tag}.
-     *
-     * @param index constant pool index
-     * @param tag expected tag
-     * @throws AssertionError if the check fails
-     */
-    private boolean checkTag(int index, JVM_CONSTANT tag) {
-        final JVM_CONSTANT tagAt = getTagAt(index);
-        assert tagAt == tag : "constant pool tag at index " + index + " is " + tagAt + " but expected " + tag;
-        return true;
-    }
-
-    /**
-     * Asserts that the constant pool tag at index {@code index} is a {@link JVM_CONSTANT#Fieldref},
-     * or a {@link JVM_CONSTANT#MethodRef}, or a {@link JVM_CONSTANT#InterfaceMethodref}.
-     *
-     * @param index constant pool index
-     * @throws AssertionError if the check fails
-     */
-    private boolean checkTagIsFieldOrMethod(int index) {
-        final JVM_CONSTANT tagAt = getTagAt(index);
-        assert tagAt == JVM_CONSTANT.Fieldref || tagAt == JVM_CONSTANT.MethodRef || tagAt == JVM_CONSTANT.InterfaceMethodref : tagAt;
-        return true;
-    }
-
-    @Override
-    public int length() {
-        return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolLengthOffset);
-    }
-
-    @Override
-    public Object lookupConstant(int cpi) {
-        assert cpi != 0;
-        final JVM_CONSTANT tag = getTagAt(cpi);
-        switch (tag) {
-            case Integer:
-                return JavaConstant.forInt(getIntAt(cpi));
-            case Long:
-                return JavaConstant.forLong(getLongAt(cpi));
-            case Float:
-                return JavaConstant.forFloat(getFloatAt(cpi));
-            case Double:
-                return JavaConstant.forDouble(getDoubleAt(cpi));
-            case Class:
-            case UnresolvedClass:
-            case UnresolvedClassInError:
-                final int opcode = -1;  // opcode is not used
-                return lookupType(cpi, opcode);
-            case String:
-                /*
-                 * Normally, we would expect a String here, but anonymous classes can have
-                 * "pseudo strings" (arbitrary live objects) patched into a String entry. Such
-                 * entries do not have a symbol in the constant pool slot.
-                 */
-                Object string = compilerToVM().resolvePossiblyCachedConstantInPool(this, cpi);
-                return HotSpotObjectConstantImpl.forObject(string);
-            case MethodHandle:
-            case MethodHandleInError:
-            case MethodType:
-            case MethodTypeInError:
-                Object obj = compilerToVM().resolveConstantInPool(this, cpi);
-                return HotSpotObjectConstantImpl.forObject(obj);
-            default:
-                throw new JVMCIError("Unknown constant pool tag %s", tag);
-        }
-    }
-
-    @Override
-    public String lookupUtf8(int cpi) {
-        assert checkTag(cpi, JVM_CONSTANT.Utf8);
-        return compilerToVM().getSymbol(getEntryAt(cpi));
-    }
-
-    @Override
-    public Signature lookupSignature(int cpi) {
-        return new HotSpotSignature(runtime(), lookupUtf8(cpi));
-    }
-
-    @Override
-    public JavaConstant lookupAppendix(int cpi, int opcode) {
-        assert Bytecodes.isInvoke(opcode);
-        final int index = rawIndexToConstantPoolIndex(cpi, opcode);
-        Object appendix = compilerToVM().lookupAppendixInPool(this, index);
-        if (appendix == null) {
-            return null;
-        } else {
-            return HotSpotObjectConstantImpl.forObject(appendix);
-        }
-    }
-
-    /**
-     * Gets a {@link JavaType} corresponding a given resolved or unresolved type.
-     *
-     * @param type either a ResolvedJavaType or a String naming a unresolved type.
-     */
-    private static JavaType getJavaType(final Object type) {
-        if (type instanceof String) {
-            String name = (String) type;
-            return HotSpotUnresolvedJavaType.create(runtime(), "L" + name + ";");
-        } else {
-            return (JavaType) type;
-        }
-    }
-
-    @Override
-    public JavaMethod lookupMethod(int cpi, int opcode) {
-        final int index = rawIndexToConstantPoolIndex(cpi, opcode);
-        final HotSpotResolvedJavaMethod method = compilerToVM().lookupMethodInPool(this, index, (byte) opcode);
-        if (method != null) {
-            return method;
-        } else {
-            // Get the method's name and signature.
-            String name = getNameOf(index);
-            HotSpotSignature signature = new HotSpotSignature(runtime(), getSignatureOf(index));
-            if (opcode == Bytecodes.INVOKEDYNAMIC) {
-                HotSpotResolvedObjectType holder = HotSpotResolvedObjectTypeImpl.fromObjectClass(MethodHandle.class);
-                return new HotSpotMethodUnresolved(name, signature, holder);
-            } else {
-                final int klassIndex = getKlassRefIndexAt(index);
-                final Object type = compilerToVM().lookupKlassInPool(this, klassIndex);
-                JavaType holder = getJavaType(type);
-                return new HotSpotMethodUnresolved(name, signature, holder);
-            }
-        }
-    }
-
-    @Override
-    public JavaType lookupType(int cpi, int opcode) {
-        final LookupTypeCacheElement elem = this.lastLookupType;
-        if (elem != null && elem.lastCpi == cpi) {
-            return elem.javaType;
-        } else {
-            final Object type = compilerToVM().lookupKlassInPool(this, cpi);
-            JavaType result = getJavaType(type);
-            if (result instanceof ResolvedJavaType) {
-                this.lastLookupType = new LookupTypeCacheElement(cpi, result);
-            }
-            return result;
-        }
-    }
-
-    @Override
-    public JavaField lookupField(int cpi, ResolvedJavaMethod method, int opcode) {
-        final int index = rawIndexToConstantPoolIndex(cpi, opcode);
-        final int nameAndTypeIndex = getNameAndTypeRefIndexAt(index);
-        final int nameIndex = getNameRefIndexAt(nameAndTypeIndex);
-        String name = lookupUtf8(nameIndex);
-        final int typeIndex = getSignatureRefIndexAt(nameAndTypeIndex);
-        String typeName = lookupUtf8(typeIndex);
-        JavaType type = runtime().lookupType(typeName, getHolder(), false);
-
-        final int holderIndex = getKlassRefIndexAt(index);
-        JavaType holder = lookupType(holderIndex, opcode);
-
-        if (holder instanceof HotSpotResolvedObjectTypeImpl) {
-            long[] info = new long[2];
-            HotSpotResolvedObjectTypeImpl resolvedHolder;
-            try {
-                resolvedHolder = compilerToVM().resolveFieldInPool(this, index, (HotSpotResolvedJavaMethodImpl) method, (byte) opcode, info);
-            } catch (Throwable t) {
-                /*
-                 * If there was an exception resolving the field we give up and return an unresolved
-                 * field.
-                 */
-                return new HotSpotUnresolvedField(holder, name, type);
-            }
-            final int flags = (int) info[0];
-            final long offset = info[1];
-            HotSpotResolvedJavaField result = resolvedHolder.createField(name, type, offset, flags);
-            return result;
-        } else {
-            return new HotSpotUnresolvedField(holder, name, type);
-        }
-    }
-
-    @Override
-    @SuppressWarnings("fallthrough")
-    public void loadReferencedType(int cpi, int opcode) {
-        int index;
-        switch (opcode) {
-            case Bytecodes.CHECKCAST:
-            case Bytecodes.INSTANCEOF:
-            case Bytecodes.NEW:
-            case Bytecodes.ANEWARRAY:
-            case Bytecodes.MULTIANEWARRAY:
-            case Bytecodes.LDC:
-            case Bytecodes.LDC_W:
-            case Bytecodes.LDC2_W:
-                index = cpi;
-                break;
-            case Bytecodes.INVOKEDYNAMIC: {
-                // invokedynamic instructions point to a constant pool cache entry.
-                index = decodeConstantPoolCacheIndex(cpi) + config().constantPoolCpCacheIndexTag;
-                index = compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index);
-                break;
-            }
-            case Bytecodes.GETSTATIC:
-            case Bytecodes.PUTSTATIC:
-            case Bytecodes.GETFIELD:
-            case Bytecodes.PUTFIELD:
-            case Bytecodes.INVOKEVIRTUAL:
-            case Bytecodes.INVOKESPECIAL:
-            case Bytecodes.INVOKESTATIC:
-            case Bytecodes.INVOKEINTERFACE: {
-                // invoke and field instructions point to a constant pool cache entry.
-                index = rawIndexToConstantPoolIndex(cpi, opcode);
-                index = compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index);
-                break;
-            }
-            default:
-                throw JVMCIError.shouldNotReachHere("Unexpected opcode " + opcode);
-        }
-
-        final JVM_CONSTANT tag = getTagAt(index);
-        if (tag == null) {
-            assert getTagAt(index - 1) == JVM_CONSTANT.Double || getTagAt(index - 1) == JVM_CONSTANT.Long;
-            return;
-        }
-        switch (tag) {
-            case MethodRef:
-            case Fieldref:
-            case InterfaceMethodref:
-                index = getUncachedKlassRefIndexAt(index);
-                // Read the tag only once because it could change between multiple reads.
-                final JVM_CONSTANT klassTag = getTagAt(index);
-                assert klassTag == JVM_CONSTANT.Class || klassTag == JVM_CONSTANT.UnresolvedClass || klassTag == JVM_CONSTANT.UnresolvedClassInError : klassTag;
-                // fall through
-            case Class:
-            case UnresolvedClass:
-            case UnresolvedClassInError:
-                final HotSpotResolvedObjectTypeImpl type = compilerToVM().resolveTypeInPool(this, index);
-                Class<?> klass = type.mirror();
-                if (!klass.isPrimitive() && !klass.isArray()) {
-                    UNSAFE.ensureClassInitialized(klass);
-                }
-                if (tag == JVM_CONSTANT.MethodRef) {
-                    if (Bytecodes.isInvokeHandleAlias(opcode) && isSignaturePolymorphicHolder(type)) {
-                        final int methodRefCacheIndex = rawIndexToConstantPoolIndex(cpi, opcode);
-                        assert checkTag(compilerToVM().constantPoolRemapInstructionOperandFromCache(this, methodRefCacheIndex), JVM_CONSTANT.MethodRef);
-                        compilerToVM().resolveInvokeHandleInPool(this, methodRefCacheIndex);
-                    }
-                }
-
-                break;
-            case InvokeDynamic:
-                if (isInvokedynamicIndex(cpi)) {
-                    compilerToVM().resolveInvokeDynamicInPool(this, cpi);
-                }
-                break;
-            default:
-                // nothing
-                break;
-        }
-
-    }
-
-    // Lazily initialized.
-    private static String[] signaturePolymorphicHolders;
-
-    /**
-     * Determines if {@code type} contains signature polymorphic methods.
-     */
-    static boolean isSignaturePolymorphicHolder(final ResolvedJavaType type) {
-        String name = type.getName();
-        if (signaturePolymorphicHolders == null) {
-            signaturePolymorphicHolders = compilerToVM().getSignaturePolymorphicHolders();
-        }
-        for (String holder : signaturePolymorphicHolders) {
-            if (name.equals(holder)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        HotSpotResolvedObjectType holder = getHolder();
-        return "HotSpotConstantPool<" + holder.toJavaName() + ">";
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java
deleted file mode 100644
index e74027f..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import java.lang.reflect.Array;
-import java.util.Objects;
-
-import jdk.vm.ci.common.JVMCIError;
-import jdk.vm.ci.meta.Constant;
-import jdk.vm.ci.meta.ConstantReflectionProvider;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.MemoryAccessProvider;
-import jdk.vm.ci.meta.MethodHandleAccessProvider;
-import jdk.vm.ci.meta.ResolvedJavaField;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
-/**
- * HotSpot implementation of {@link ConstantReflectionProvider}.
- */
-public class HotSpotConstantReflectionProvider implements ConstantReflectionProvider {
-
-    protected final HotSpotJVMCIRuntimeProvider runtime;
-    protected final HotSpotMethodHandleAccessProvider methodHandleAccess;
-    protected final HotSpotMemoryAccessProviderImpl memoryAccess;
-
-    public HotSpotConstantReflectionProvider(HotSpotJVMCIRuntimeProvider runtime) {
-        this.runtime = runtime;
-        this.methodHandleAccess = new HotSpotMethodHandleAccessProvider(this);
-        this.memoryAccess = new HotSpotMemoryAccessProviderImpl(runtime);
-    }
-
-    public MethodHandleAccessProvider getMethodHandleAccess() {
-        return methodHandleAccess;
-    }
-
-    @Override
-    public MemoryAccessProvider getMemoryAccessProvider() {
-        return memoryAccess;
-    }
-
-    @Override
-    public Boolean constantEquals(Constant x, Constant y) {
-        if (x == y) {
-            return true;
-        } else if (x instanceof HotSpotObjectConstantImpl) {
-            return y instanceof HotSpotObjectConstantImpl && ((HotSpotObjectConstantImpl) x).object() == ((HotSpotObjectConstantImpl) y).object();
-        } else {
-            return Objects.equals(x, y);
-        }
-    }
-
-    @Override
-    public Integer readArrayLength(JavaConstant array) {
-        if (array == null || array.getJavaKind() != JavaKind.Object || array.isNull()) {
-            return null;
-        }
-
-        Object arrayObject = ((HotSpotObjectConstantImpl) array).object();
-        if (!arrayObject.getClass().isArray()) {
-            return null;
-        }
-        return Array.getLength(arrayObject);
-    }
-
-    @Override
-    public JavaConstant readArrayElement(JavaConstant array, int index) {
-        if (array == null || array.getJavaKind() != JavaKind.Object || array.isNull()) {
-            return null;
-        }
-        Object a = ((HotSpotObjectConstantImpl) array).object();
-
-        if (!a.getClass().isArray() || index < 0 || index >= Array.getLength(a)) {
-            return null;
-        }
-
-        if (a instanceof Object[]) {
-            Object element = ((Object[]) a)[index];
-            return HotSpotObjectConstantImpl.forObject(element);
-        } else {
-            return JavaConstant.forBoxedPrimitive(Array.get(a, index));
-        }
-    }
-
-    /**
-     * Check if the constant is a boxed value that is guaranteed to be cached by the platform.
-     * Otherwise the generated code might be the only reference to the boxed value and since object
-     * references from nmethods are weak this can cause GC problems.
-     *
-     * @param source
-     * @return true if the box is cached
-     */
-    private static boolean isBoxCached(JavaConstant source) {
-        switch (source.getJavaKind()) {
-            case Boolean:
-                return true;
-            case Char:
-                return source.asInt() <= 127;
-            case Byte:
-            case Short:
-            case Int:
-                return source.asInt() >= -128 && source.asInt() <= 127;
-            case Long:
-                return source.asLong() >= -128 && source.asLong() <= 127;
-            case Float:
-            case Double:
-                return false;
-            default:
-                throw new IllegalArgumentException("unexpected kind " + source.getJavaKind());
-        }
-    }
-
-    @Override
-    public JavaConstant boxPrimitive(JavaConstant source) {
-        if (source == null || !source.getJavaKind().isPrimitive() || !isBoxCached(source)) {
-            return null;
-        }
-        return HotSpotObjectConstantImpl.forObject(source.asBoxedPrimitive());
-    }
-
-    @Override
-    public JavaConstant unboxPrimitive(JavaConstant source) {
-        if (source == null || !source.getJavaKind().isObject()) {
-            return null;
-        }
-        if (source.isNull()) {
-            return null;
-        }
-        return JavaConstant.forBoxedPrimitive(((HotSpotObjectConstantImpl) source).object());
-    }
-
-    public JavaConstant forString(String value) {
-        return HotSpotObjectConstantImpl.forObject(value);
-    }
-
-    public JavaConstant forObject(Object value) {
-        return HotSpotObjectConstantImpl.forObject(value);
-    }
-
-    @Override
-    public ResolvedJavaType asJavaType(Constant constant) {
-        if (constant instanceof HotSpotObjectConstant) {
-            Object obj = ((HotSpotObjectConstantImpl) constant).object();
-            if (obj instanceof Class) {
-                return runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType((Class<?>) obj);
-            }
-        }
-        if (constant instanceof HotSpotMetaspaceConstant) {
-            MetaspaceWrapperObject obj = HotSpotMetaspaceConstantImpl.getMetaspaceObject(constant);
-            if (obj instanceof HotSpotResolvedObjectTypeImpl) {
-                return (ResolvedJavaType) obj;
-            }
-        }
-        return null;
-    }
-
-    public JavaConstant readFieldValue(ResolvedJavaField field, JavaConstant receiver) {
-        HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field;
-        if (hotspotField.isStatic()) {
-            HotSpotResolvedJavaType holder = (HotSpotResolvedJavaType) hotspotField.getDeclaringClass();
-            if (holder.isInitialized()) {
-                return memoryAccess.readUnsafeConstant(hotspotField.getJavaKind(), HotSpotObjectConstantImpl.forObject(holder.mirror()), hotspotField.offset());
-            }
-        } else {
-            if (receiver.isNonNull() && hotspotField.isInObject(((HotSpotObjectConstantImpl) receiver).object())) {
-                return memoryAccess.readUnsafeConstant(hotspotField.getJavaKind(), receiver, hotspotField.offset());
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public JavaConstant asJavaClass(ResolvedJavaType type) {
-        return HotSpotObjectConstantImpl.forObject(((HotSpotResolvedJavaType) type).mirror());
-    }
-
-    @Override
-    public Constant asObjectHub(ResolvedJavaType type) {
-        if (type instanceof HotSpotResolvedObjectType) {
-            return ((HotSpotResolvedObjectType) type).klass();
-        } else {
-            throw JVMCIError.unimplemented();
-        }
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java
deleted file mode 100644
index 529a561..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import java.lang.ref.Reference;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.WeakReference;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
-/**
- * This class manages the set of metadata roots that must be scanned during garbage collection.
- * Because of class redefinition Method* and ConstantPool* can be freed if they don't appear to be
- * in use so they must be tracked when there are live references to them from Java.
- *
- * The general theory of operation is that all {@link MetaspaceWrapperObject}s are created by
- * calling into the VM which calls back out to actually create the wrapper instance. During the call
- * the VM keeps the metadata reference alive through the use of metadata handles. Once the call
- * completes the wrapper object is registered here and will be scanned during metadata scanning. The
- * weakness of the reference to the wrapper object allows them to be reclaimed when they are no
- * longer used.
- *
- */
-public class HotSpotJVMCIMetaAccessContext {
-
-    /**
-     * The set of currently live contexts used for tracking of live metadata. Examined from the VM
-     * during garbage collection.
-     */
-    private static WeakReference<?>[] allContexts = new WeakReference<?>[0];
-
-    /**
-     * This is a chunked list of metadata roots. It can be read from VM native code so it's been
-     * marked volatile to ensure the order of updates are respected.
-     */
-    private volatile Object[] metadataRoots;
-
-    private ChunkedList<WeakReference<MetaspaceWrapperObject>> list = new ChunkedList<>();
-
-    /**
-     * The number of weak references freed since the last time the list was shrunk.
-     */
-    private int freed;
-
-    /**
-     * The {@link ReferenceQueue} tracking the weak references created by this context.
-     */
-    private final ReferenceQueue<MetaspaceWrapperObject> queue = new ReferenceQueue<>();
-
-    static synchronized void add(HotSpotJVMCIMetaAccessContext context) {
-        for (int i = 0; i < allContexts.length; i++) {
-            if (allContexts[i] == null || allContexts[i].get() == null) {
-                allContexts[i] = new WeakReference<>(context);
-                return;
-            }
-        }
-        int index = allContexts.length;
-        allContexts = Arrays.copyOf(allContexts, index + 2);
-        allContexts[index] = new WeakReference<>(context);
-    }
-
-    HotSpotJVMCIMetaAccessContext() {
-        add(this);
-    }
-
-    /**
-     * Periodically trim the list of tracked metadata. A new list is created to replace the old to
-     * avoid concurrent scanning issues.
-     */
-    private void clean() {
-        Reference<?> ref = queue.poll();
-        if (ref == null) {
-            return;
-        }
-        while (ref != null) {
-            freed++;
-            ref = queue.poll();
-        }
-        if (freed > list.size() / 2) {
-            ChunkedList<WeakReference<MetaspaceWrapperObject>> newList = new ChunkedList<>();
-            for (WeakReference<MetaspaceWrapperObject> element : list) {
-                /*
-                 * The referent could become null anywhere in here but it doesn't matter. It will
-                 * get cleaned up next time.
-                 */
-                if (element != null && element.get() != null) {
-                    newList.add(element);
-                }
-            }
-            list = newList;
-            metadataRoots = list.getHead();
-            freed = 0;
-        }
-    }
-
-    /**
-     * Add a {@link MetaspaceWrapperObject} to tracked by the GC. It's assumed that the caller is
-     * responsible for keeping the reference alive for the duration of the call. Once registration
-     * is complete then the VM will ensure it's kept alive.
-     *
-     * @param metaspaceObject
-     */
-
-    public synchronized void add(MetaspaceWrapperObject metaspaceObject) {
-        clean();
-        list.add(new WeakReference<>(metaspaceObject, queue));
-        if (list.getHead() != metadataRoots) {
-            /*
-             * The list enlarged so update the head.
-             */
-            metadataRoots = list.getHead();
-        }
-        assert isRegistered(metaspaceObject);
-    }
-
-    protected ResolvedJavaType createClass(Class<?> javaClass) {
-        if (javaClass.isPrimitive()) {
-            JavaKind kind = JavaKind.fromJavaClass(javaClass);
-            return new HotSpotResolvedPrimitiveType(kind);
-        } else {
-            return new HotSpotResolvedObjectTypeImpl(javaClass, this);
-        }
-    }
-
-    private final Map<Class<?>, WeakReference<ResolvedJavaType>> typeMap = new WeakHashMap<>();
-
-    /**
-     * Gets the JVMCI mirror for a {@link Class} object.
-     *
-     * @return the {@link ResolvedJavaType} corresponding to {@code javaClass}
-     */
-    public synchronized ResolvedJavaType fromClass(Class<?> javaClass) {
-        WeakReference<ResolvedJavaType> typeRef = typeMap.get(javaClass);
-        ResolvedJavaType type = typeRef != null ? typeRef.get() : null;
-        if (type == null) {
-            type = createClass(javaClass);
-            typeMap.put(javaClass, new WeakReference<>(type));
-        }
-        return type;
-    }
-
-    /**
-     * A very simple append only chunked list implementation.
-     */
-    static class ChunkedList<T> implements Iterable<T> {
-        private static final int CHUNK_SIZE = 32;
-
-        private static final int NEXT_CHUNK_INDEX = CHUNK_SIZE - 1;
-
-        private Object[] head;
-        private int index;
-        private int size;
-
-        ChunkedList() {
-            head = new Object[CHUNK_SIZE];
-            index = 0;
-        }
-
-        void add(T element) {
-            if (index == NEXT_CHUNK_INDEX) {
-                Object[] newHead = new Object[CHUNK_SIZE];
-                newHead[index] = head;
-                head = newHead;
-                index = 0;
-            }
-            head[index++] = element;
-            size++;
-        }
-
-        Object[] getHead() {
-            return head;
-        }
-
-        public Iterator<T> iterator() {
-            return new ChunkIterator<>();
-        }
-
-        int size() {
-            return size;
-        }
-
-        class ChunkIterator<V> implements Iterator<V> {
-
-            ChunkIterator() {
-                currentChunk = head;
-                currentIndex = -1;
-                next = findNext();
-            }
-
-            Object[] currentChunk;
-            int currentIndex;
-            V next;
-
-            @SuppressWarnings("unchecked")
-            V findNext() {
-                V result;
-                do {
-                    currentIndex++;
-                    if (currentIndex == NEXT_CHUNK_INDEX) {
-                        currentChunk = (Object[]) currentChunk[currentIndex];
-                        currentIndex = 0;
-                        if (currentChunk == null) {
-                            return null;
-                        }
-                    }
-                    result = (V) currentChunk[currentIndex];
-                } while (result == null);
-                return result;
-            }
-
-            public boolean hasNext() {
-                return next != null;
-            }
-
-            public V next() {
-                V result = next;
-                next = findNext();
-                return result;
-            }
-
-        }
-
-    }
-
-    synchronized boolean isRegistered(MetaspaceWrapperObject wrapper) {
-        for (WeakReference<MetaspaceWrapperObject> m : list) {
-            if (m != null && m.get() == wrapper) {
-                return true;
-            }
-        }
-        return false;
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java
deleted file mode 100644
index f6c97ec..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java
+++ /dev/null
@@ -1,558 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import static jdk.vm.ci.common.InitTimer.timer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.TreeMap;
-
-import jdk.internal.misc.VM;
-import jdk.vm.ci.code.Architecture;
-import jdk.vm.ci.code.CompilationRequestResult;
-import jdk.vm.ci.code.CompiledCode;
-import jdk.vm.ci.code.InstalledCode;
-import jdk.vm.ci.common.InitTimer;
-import jdk.vm.ci.common.JVMCIError;
-import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory.CompilationLevel;
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.JavaType;
-import jdk.vm.ci.meta.ResolvedJavaType;
-import jdk.vm.ci.runtime.JVMCI;
-import jdk.vm.ci.runtime.JVMCIBackend;
-import jdk.vm.ci.runtime.JVMCICompiler;
-import jdk.vm.ci.runtime.JVMCICompilerFactory;
-import jdk.vm.ci.services.JVMCIServiceLocator;
-import jdk.vm.ci.services.Services;
-
-/**
- * HotSpot implementation of a JVMCI runtime.
- *
- * The initialization of this class is very fragile since it's initialized both through
- * {@link JVMCI#initialize()} or through calling {@link HotSpotJVMCIRuntime#runtime()} and
- * {@link HotSpotJVMCIRuntime#runtime()} is also called by {@link JVMCI#initialize()}. So this class
- * can't have a static initializer and any required initialization must be done as part of
- * {@link #runtime()}. This allows the initialization to funnel back through
- * {@link JVMCI#initialize()} without deadlocking.
- */
-public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider {
-
-    @SuppressWarnings("try")
-    static class DelayedInit {
-        private static final HotSpotJVMCIRuntime instance;
-
-        static {
-            try (InitTimer t = timer("HotSpotJVMCIRuntime.<init>")) {
-                instance = new HotSpotJVMCIRuntime();
-            }
-        }
-    }
-
-    /**
-     * Gets the singleton {@link HotSpotJVMCIRuntime} object.
-     */
-    public static HotSpotJVMCIRuntime runtime() {
-        JVMCI.initialize();
-        return DelayedInit.instance;
-    }
-
-    /**
-     * A list of all supported JVMCI options.
-     */
-    public enum Option {
-        // @formatter:off
-        Compiler(String.class, null, "Selects the system compiler."),
-        // Note: The following one is not used (see InitTimer.ENABLED). It is added here
-        // so that -XX:+JVMCIPrintProperties shows the option.
-        InitTimer(Boolean.class, false, "Specifies if initialization timing is enabled."),
-        PrintConfig(Boolean.class, false, "Prints VM configuration available via JVMCI."),
-        TraceMethodDataFilter(String.class, null,
-                        "Enables tracing of profiling info when read by JVMCI.",
-                        "Empty value: trace all methods",
-                        "Non-empty value: trace methods whose fully qualified name contains the value."),
-        UseProfilingInformation(Boolean.class, true, "");
-        // @formatter:on
-
-        /**
-         * The prefix for system properties that are JVMCI options.
-         */
-        private static final String JVMCI_OPTION_PROPERTY_PREFIX = "jvmci.";
-
-        /**
-         * Marker for uninitialized flags.
-         */
-        private static final String UNINITIALIZED = "UNINITIALIZED";
-
-        private final Class<?> type;
-        private Object value;
-        private final Object defaultValue;
-        private boolean isDefault;
-        private final String[] helpLines;
-
-        Option(Class<?> type, Object defaultValue, String... helpLines) {
-            assert Character.isUpperCase(name().charAt(0)) : "Option name must start with upper-case letter: " + name();
-            this.type = type;
-            this.value = UNINITIALIZED;
-            this.defaultValue = defaultValue;
-            this.helpLines = helpLines;
-        }
-
-        @SuppressFBWarnings(value = "ES_COMPARING_STRINGS_WITH_EQ", justification = "sentinel must be String since it's a static final in an enum")
-        private Object getValue() {
-            if (value == UNINITIALIZED) {
-                String propertyValue = VM.getSavedProperty(getPropertyName());
-                if (propertyValue == null) {
-                    this.value = defaultValue;
-                    this.isDefault = true;
-                } else {
-                    if (type == Boolean.class) {
-                        this.value = Boolean.parseBoolean(propertyValue);
-                    } else if (type == String.class) {
-                        this.value = propertyValue;
-                    } else {
-                        throw new JVMCIError("Unexpected option type " + type);
-                    }
-                    this.isDefault = false;
-                }
-                // Saved properties should not be interned - let's be sure
-                assert value != UNINITIALIZED;
-            }
-            return value;
-        }
-
-        /**
-         * Gets the name of system property from which this option gets its value.
-         */
-        public String getPropertyName() {
-            return JVMCI_OPTION_PROPERTY_PREFIX + name();
-        }
-
-        /**
-         * Returns the option's value as boolean.
-         *
-         * @return option's value
-         */
-        public boolean getBoolean() {
-            return (boolean) getValue();
-        }
-
-        /**
-         * Returns the option's value as String.
-         *
-         * @return option's value
-         */
-        public String getString() {
-            return (String) getValue();
-        }
-
-        private static final int PROPERTY_LINE_WIDTH = 80;
-        private static final int PROPERTY_HELP_INDENT = 10;
-
-        /**
-         * Prints a description of the properties used to configure shared JVMCI code.
-         *
-         * @param out stream to print to
-         */
-        public static void printProperties(PrintStream out) {
-            out.println("[JVMCI properties]");
-            Option[] values = values();
-            for (Option option : values) {
-                Object value = option.getValue();
-                if (value instanceof String) {
-                    value = '"' + String.valueOf(value) + '"';
-                }
-
-                String name = option.getPropertyName();
-                String assign = option.isDefault ? "=" : ":=";
-                String typeName = option.type.getSimpleName();
-                String linePrefix = String.format("%s %s %s ", name, assign, value);
-                int typeStartPos = PROPERTY_LINE_WIDTH - typeName.length();
-                int linePad = typeStartPos - linePrefix.length();
-                if (linePad > 0) {
-                    out.printf("%s%-" + linePad + "s[%s]%n", linePrefix, "", typeName);
-                } else {
-                    out.printf("%s[%s]%n", linePrefix, typeName);
-                }
-                for (String line : option.helpLines) {
-                    out.printf("%" + PROPERTY_HELP_INDENT + "s%s%n", "", line);
-                }
-            }
-        }
-    }
-
-    public static HotSpotJVMCIBackendFactory findFactory(String architecture) {
-        for (HotSpotJVMCIBackendFactory factory : Services.load(HotSpotJVMCIBackendFactory.class)) {
-            if (factory.getArchitecture().equalsIgnoreCase(architecture)) {
-                return factory;
-            }
-        }
-
-        throw new JVMCIError("No JVMCI runtime available for the %s architecture", architecture);
-    }
-
-    /**
-     * Gets the kind of a word value on the {@linkplain #getHostJVMCIBackend() host} backend.
-     */
-    public static JavaKind getHostWordKind() {
-        return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordJavaKind;
-    }
-
-    protected final CompilerToVM compilerToVm;
-
-    protected final HotSpotVMConfigStore configStore;
-    protected final HotSpotVMConfig config;
-    private final JVMCIBackend hostBackend;
-
-    private final JVMCICompilerFactory compilerFactory;
-    private final HotSpotJVMCICompilerFactory hsCompilerFactory;
-    private volatile JVMCICompiler compiler;
-    protected final HotSpotJVMCIMetaAccessContext metaAccessContext;
-
-    /**
-     * Stores the result of {@link HotSpotJVMCICompilerFactory#getCompilationLevelAdjustment} so
-     * that it can be read from the VM.
-     */
-    @SuppressWarnings("unused") private final int compilationLevelAdjustment;
-
-    private final Map<Class<? extends Architecture>, JVMCIBackend> backends = new HashMap<>();
-
-    private volatile List<HotSpotVMEventListener> vmEventListeners;
-
-    private Iterable<HotSpotVMEventListener> getVmEventListeners() {
-        if (vmEventListeners == null) {
-            synchronized (this) {
-                if (vmEventListeners == null) {
-                    vmEventListeners = JVMCIServiceLocator.getProviders(HotSpotVMEventListener.class);
-                }
-            }
-        }
-        return vmEventListeners;
-    }
-
-    /**
-     * Stores the result of {@link HotSpotJVMCICompilerFactory#getTrivialPrefixes()} so that it can
-     * be read from the VM.
-     */
-    @SuppressWarnings("unused") private final String[] trivialPrefixes;
-
-    @SuppressWarnings("try")
-    private HotSpotJVMCIRuntime() {
-        compilerToVm = new CompilerToVM();
-
-        try (InitTimer t = timer("HotSpotVMConfig<init>")) {
-            configStore = new HotSpotVMConfigStore(compilerToVm);
-            config = new HotSpotVMConfig(configStore);
-        }
-
-        String hostArchitecture = config.getHostArchitectureName();
-
-        HotSpotJVMCIBackendFactory factory;
-        try (InitTimer t = timer("find factory:", hostArchitecture)) {
-            factory = findFactory(hostArchitecture);
-        }
-
-        try (InitTimer t = timer("create JVMCI backend:", hostArchitecture)) {
-            hostBackend = registerBackend(factory.createJVMCIBackend(this, null));
-        }
-
-        metaAccessContext = new HotSpotJVMCIMetaAccessContext();
-
-        compilerFactory = HotSpotJVMCICompilerConfig.getCompilerFactory();
-        if (compilerFactory instanceof HotSpotJVMCICompilerFactory) {
-            hsCompilerFactory = (HotSpotJVMCICompilerFactory) compilerFactory;
-            trivialPrefixes = hsCompilerFactory.getTrivialPrefixes();
-            switch (hsCompilerFactory.getCompilationLevelAdjustment()) {
-                case None:
-                    compilationLevelAdjustment = config.compLevelAdjustmentNone;
-                    break;
-                case ByHolder:
-                    compilationLevelAdjustment = config.compLevelAdjustmentByHolder;
-                    break;
-                case ByFullSignature:
-                    compilationLevelAdjustment = config.compLevelAdjustmentByFullSignature;
-                    break;
-                default:
-                    compilationLevelAdjustment = config.compLevelAdjustmentNone;
-                    break;
-            }
-        } else {
-            hsCompilerFactory = null;
-            trivialPrefixes = null;
-            compilationLevelAdjustment = config.compLevelAdjustmentNone;
-        }
-
-        if (config.getFlag("JVMCIPrintProperties", Boolean.class)) {
-            PrintStream out = new PrintStream(getLogStream());
-            Option.printProperties(out);
-            compilerFactory.printProperties(out);
-            System.exit(0);
-        }
-
-        if (Option.PrintConfig.getBoolean()) {
-            printConfig(configStore, compilerToVm);
-        }
-    }
-
-    private JVMCIBackend registerBackend(JVMCIBackend backend) {
-        Class<? extends Architecture> arch = backend.getCodeCache().getTarget().arch.getClass();
-        JVMCIBackend oldValue = backends.put(arch, backend);
-        assert oldValue == null : "cannot overwrite existing backend for architecture " + arch.getSimpleName();
-        return backend;
-    }
-
-    public ResolvedJavaType fromClass(Class<?> javaClass) {
-        return metaAccessContext.fromClass(javaClass);
-    }
-
-    public HotSpotVMConfigStore getConfigStore() {
-        return configStore;
-    }
-
-    public HotSpotVMConfig getConfig() {
-        return config;
-    }
-
-    public CompilerToVM getCompilerToVM() {
-        return compilerToVm;
-    }
-
-    public JVMCICompiler getCompiler() {
-        if (compiler == null) {
-            synchronized (this) {
-                if (compiler == null) {
-                    compiler = compilerFactory.createCompiler(this);
-                }
-            }
-        }
-        return compiler;
-    }
-
-    public JavaType lookupType(String name, HotSpotResolvedObjectType accessingType, boolean resolve) {
-        Objects.requireNonNull(accessingType, "cannot resolve type without an accessing class");
-        // If the name represents a primitive type we can short-circuit the lookup.
-        if (name.length() == 1) {
-            JavaKind kind = JavaKind.fromPrimitiveOrVoidTypeChar(name.charAt(0));
-            return fromClass(kind.toJavaClass());
-        }
-
-        // Resolve non-primitive types in the VM.
-        HotSpotResolvedObjectTypeImpl hsAccessingType = (HotSpotResolvedObjectTypeImpl) accessingType;
-        final HotSpotResolvedObjectTypeImpl klass = compilerToVm.lookupType(name, hsAccessingType.mirror(), resolve);
-
-        if (klass == null) {
-            assert resolve == false;
-            return HotSpotUnresolvedJavaType.create(this, name);
-        }
-        return klass;
-    }
-
-    public JVMCIBackend getHostJVMCIBackend() {
-        return hostBackend;
-    }
-
-    public <T extends Architecture> JVMCIBackend getJVMCIBackend(Class<T> arch) {
-        assert arch != Architecture.class;
-        return backends.get(arch);
-    }
-
-    public Map<Class<? extends Architecture>, JVMCIBackend> getJVMCIBackends() {
-        return Collections.unmodifiableMap(backends);
-    }
-
-    /**
-     * Called from the VM.
-     */
-    @SuppressWarnings({"unused"})
-    private int adjustCompilationLevel(Class<?> declaringClass, String name, String signature, boolean isOsr, int level) {
-        CompilationLevel curLevel;
-        if (level == config.compilationLevelNone) {
-            curLevel = CompilationLevel.None;
-        } else if (level == config.compilationLevelSimple) {
-            curLevel = CompilationLevel.Simple;
-        } else if (level == config.compilationLevelLimitedProfile) {
-            curLevel = CompilationLevel.LimitedProfile;
-        } else if (level == config.compilationLevelFullProfile) {
-            curLevel = CompilationLevel.FullProfile;
-        } else if (level == config.compilationLevelFullOptimization) {
-            curLevel = CompilationLevel.FullOptimization;
-        } else {
-            throw JVMCIError.shouldNotReachHere();
-        }
-
-        switch (hsCompilerFactory.adjustCompilationLevel(declaringClass, name, signature, isOsr, curLevel)) {
-            case None:
-                return config.compilationLevelNone;
-            case Simple:
-                return config.compilationLevelSimple;
-            case LimitedProfile:
-                return config.compilationLevelLimitedProfile;
-            case FullProfile:
-                return config.compilationLevelFullProfile;
-            case FullOptimization:
-                return config.compilationLevelFullOptimization;
-            default:
-                return level;
-        }
-    }
-
-    /**
-     * Called from the VM.
-     */
-    @SuppressWarnings({"unused"})
-    private HotSpotCompilationRequestResult compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) {
-        CompilationRequestResult result = getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id));
-        assert result != null : "compileMethod must always return something";
-        HotSpotCompilationRequestResult hsResult;
-        if (result instanceof HotSpotCompilationRequestResult) {
-            hsResult = (HotSpotCompilationRequestResult) result;
-        } else {
-            Object failure = result.getFailure();
-            if (failure != null) {
-                boolean retry = false; // Be conservative with unknown compiler
-                hsResult = HotSpotCompilationRequestResult.failure(failure.toString(), retry);
-            } else {
-                int inlinedBytecodes = -1;
-                hsResult = HotSpotCompilationRequestResult.success(inlinedBytecodes);
-            }
-        }
-
-        return hsResult;
-    }
-
-    /**
-     * Shuts down the runtime.
-     *
-     * Called from the VM.
-     */
-    @SuppressWarnings({"unused"})
-    private void shutdown() throws Exception {
-        for (HotSpotVMEventListener vmEventListener : getVmEventListeners()) {
-            vmEventListener.notifyShutdown();
-        }
-    }
-
-    /**
-     * Notify on completion of a bootstrap.
-     *
-     * Called from the VM.
-     */
-    @SuppressWarnings({"unused"})
-    private void bootstrapFinished() throws Exception {
-        for (HotSpotVMEventListener vmEventListener : getVmEventListeners()) {
-            vmEventListener.notifyBootstrapFinished();
-        }
-    }
-
-    /**
-     * Notify on successful install into the CodeCache.
-     *
-     * @param hotSpotCodeCacheProvider
-     * @param installedCode
-     * @param compiledCode
-     */
-    void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompiledCode compiledCode) {
-        for (HotSpotVMEventListener vmEventListener : getVmEventListeners()) {
-            vmEventListener.notifyInstall(hotSpotCodeCacheProvider, installedCode, compiledCode);
-        }
-    }
-
-    @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING", justification = "no localization here please!")
-    private static void printConfigLine(CompilerToVM vm, String format, Object... args) {
-        String line = String.format(format, args);
-        byte[] lineBytes = line.getBytes();
-        vm.writeDebugOutput(lineBytes, 0, lineBytes.length);
-        vm.flushDebugOutput();
-    }
-
-    private static void printConfig(HotSpotVMConfigStore store, CompilerToVM vm) {
-        TreeMap<String, VMField> fields = new TreeMap<>(store.getFields());
-        for (VMField field : fields.values()) {
-            if (!field.isStatic()) {
-                printConfigLine(vm, "[vmconfig:instance field] %s %s {offset=%d[0x%x]}%n", field.type, field.name, field.offset, field.offset);
-            } else {
-                String value = field.value == null ? "null" : String.format("%d[0x%x]", field.value, field.value);
-                printConfigLine(vm, "[vmconfig:static field] %s %s = %s {address=0x%x}%n", field.type, field.name, value, field.address);
-            }
-        }
-        TreeMap<String, VMFlag> flags = new TreeMap<>(store.getFlags());
-        for (VMFlag flag : flags.values()) {
-            printConfigLine(vm, "[vmconfig:flag] %s %s = %s%n", flag.type, flag.name, flag.value);
-        }
-        TreeMap<String, Long> addresses = new TreeMap<>(store.getAddresses());
-        for (Map.Entry<String, Long> e : addresses.entrySet()) {
-            printConfigLine(vm, "[vmconfig:address] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue());
-        }
-        TreeMap<String, Long> constants = new TreeMap<>(store.getConstants());
-        for (Map.Entry<String, Long> e : constants.entrySet()) {
-            printConfigLine(vm, "[vmconfig:constant] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue());
-        }
-        TreeMap<String, Long> typeSizes = new TreeMap<>(store.getTypeSizes());
-        for (Map.Entry<String, Long> e : typeSizes.entrySet()) {
-            printConfigLine(vm, "[vmconfig:type size] %s = %d%n", e.getKey(), e.getValue());
-        }
-        for (VMIntrinsicMethod e : store.getIntrinsics()) {
-            printConfigLine(vm, "[vmconfig:intrinsic] %d = %s.%s %s%n", e.id, e.declaringClass, e.name, e.descriptor);
-        }
-    }
-
-    public OutputStream getLogStream() {
-        return new OutputStream() {
-
-            @Override
-            public void write(byte[] b, int off, int len) throws IOException {
-                if (b == null) {
-                    throw new NullPointerException();
-                } else if (off < 0 || off > b.length || len < 0 || (off + len) > b.length || (off + len) < 0) {
-                    throw new IndexOutOfBoundsException();
-                } else if (len == 0) {
-                    return;
-                }
-                compilerToVm.writeDebugOutput(b, off, len);
-            }
-
-            @Override
-            public void write(int b) throws IOException {
-                write(new byte[]{(byte) b}, 0, 1);
-            }
-
-            @Override
-            public void flush() throws IOException {
-                compilerToVm.flushDebugOutput();
-            }
-        };
-    }
-
-    /**
-     * Collects the current values of all JVMCI benchmark counters, summed up over all threads.
-     */
-    public long[] collectCounters() {
-        return compilerToVm.collectCounters();
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java
deleted file mode 100644
index a4d68b5..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import jdk.vm.ci.meta.Constant;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.MemoryAccessProvider;
-
-/**
- * HotSpot specific extension of {@link MemoryAccessProvider}.
- */
-public interface HotSpotMemoryAccessProvider extends MemoryAccessProvider {
-
-    JavaConstant readNarrowOopConstant(Constant base, long displacement);
-
-    Constant readKlassPointerConstant(Constant base, long displacement);
-
-    Constant readNarrowKlassPointerConstant(Constant base, long displacement);
-
-    Constant readMethodPointerConstant(Constant base, long displacement);
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java
deleted file mode 100644
index be8e3a3..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
-
-import jdk.vm.ci.meta.Constant;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.MemoryAccessProvider;
-import jdk.vm.ci.meta.PrimitiveConstant;
-
-/**
- * HotSpot implementation of {@link MemoryAccessProvider}.
- */
-class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider {
-
-    protected final HotSpotJVMCIRuntimeProvider runtime;
-
-    HotSpotMemoryAccessProviderImpl(HotSpotJVMCIRuntimeProvider runtime) {
-        this.runtime = runtime;
-    }
-
-    private static Object asObject(Constant base) {
-        if (base instanceof HotSpotObjectConstantImpl) {
-            return ((HotSpotObjectConstantImpl) base).object();
-        } else {
-            return null;
-        }
-    }
-
-    private boolean isValidObjectFieldDisplacement(Constant base, long displacement) {
-        if (base instanceof HotSpotMetaspaceConstant) {
-            MetaspaceWrapperObject metaspaceObject = HotSpotMetaspaceConstantImpl.getMetaspaceObject(base);
-            if (metaspaceObject instanceof HotSpotResolvedObjectTypeImpl) {
-                if (displacement == runtime.getConfig().classMirrorOffset) {
-                    // Klass::_java_mirror is valid for all Klass* values
-                    return true;
-                }
-            } else {
-                throw new IllegalArgumentException(String.valueOf(metaspaceObject));
-            }
-        }
-        return false;
-    }
-
-    private static long asRawPointer(Constant base) {
-        if (base instanceof HotSpotMetaspaceConstantImpl) {
-            MetaspaceWrapperObject meta = HotSpotMetaspaceConstantImpl.getMetaspaceObject(base);
-            return meta.getMetaspacePointer();
-        } else if (base instanceof PrimitiveConstant) {
-            PrimitiveConstant prim = (PrimitiveConstant) base;
-            if (prim.getJavaKind().isNumericInteger()) {
-                return prim.asLong();
-            }
-        }
-        throw new IllegalArgumentException(String.valueOf(base));
-    }
-
-    private static long readRawValue(Constant baseConstant, long displacement, int bits) {
-        Object base = asObject(baseConstant);
-        if (base != null) {
-            switch (bits) {
-                case Byte.SIZE:
-                    return UNSAFE.getByte(base, displacement);
-                case Short.SIZE:
-                    return UNSAFE.getShort(base, displacement);
-                case Integer.SIZE:
-                    return UNSAFE.getInt(base, displacement);
-                case Long.SIZE:
-                    return UNSAFE.getLong(base, displacement);
-                default:
-                    throw new IllegalArgumentException(String.valueOf(bits));
-            }
-        } else {
-            long pointer = asRawPointer(baseConstant);
-            switch (bits) {
-                case Byte.SIZE:
-                    return UNSAFE.getByte(pointer + displacement);
-                case Short.SIZE:
-                    return UNSAFE.getShort(pointer + displacement);
-                case Integer.SIZE:
-                    return UNSAFE.getInt(pointer + displacement);
-                case Long.SIZE:
-                    return UNSAFE.getLong(pointer + displacement);
-                default:
-                    throw new IllegalArgumentException(String.valueOf(bits));
-            }
-        }
-    }
-
-    private boolean verifyReadRawObject(Object expected, Constant base, long displacement) {
-        if (base instanceof HotSpotMetaspaceConstant) {
-            MetaspaceWrapperObject metaspaceObject = HotSpotMetaspaceConstantImpl.getMetaspaceObject(base);
-            if (metaspaceObject instanceof HotSpotResolvedObjectTypeImpl) {
-                if (displacement == runtime.getConfig().classMirrorOffset) {
-                    assert expected == ((HotSpotResolvedObjectTypeImpl) metaspaceObject).mirror();
-                }
-            }
-        }
-        return true;
-    }
-
-    private Object readRawObject(Constant baseConstant, long initialDisplacement, boolean compressed) {
-        long displacement = initialDisplacement;
-
-        Object ret;
-        Object base = asObject(baseConstant);
-        if (base == null) {
-            assert !compressed;
-            displacement += asRawPointer(baseConstant);
-            ret = UNSAFE.getUncompressedObject(displacement);
-            assert verifyReadRawObject(ret, baseConstant, initialDisplacement);
-        } else {
-            assert runtime.getConfig().useCompressedOops == compressed;
-            ret = UNSAFE.getObject(base, displacement);
-        }
-        return ret;
-    }
-
-    /**
-     * Reads a value of this kind using a base address and a displacement. No bounds checking or
-     * type checking is performed. Returns {@code null} if the value is not available at this point.
-     *
-     * @param baseConstant the base address from which the value is read.
-     * @param displacement the displacement within the object in bytes
-     * @return the read value encapsulated in a {@link JavaConstant} object, or {@code null} if the
-     *         value cannot be read.
-     * @throws IllegalArgumentException if {@code kind} is {@code null}, {@link JavaKind#Void}, not
-     *             {@link JavaKind#Object} or not {@linkplain JavaKind#isPrimitive() primitive} kind
-     */
-    JavaConstant readUnsafeConstant(JavaKind kind, JavaConstant baseConstant, long displacement) {
-        if (kind == null) {
-            throw new IllegalArgumentException("null JavaKind");
-        }
-        if (kind == JavaKind.Object) {
-            Object o = readRawObject(baseConstant, displacement, runtime.getConfig().useCompressedOops);
-            return HotSpotObjectConstantImpl.forObject(o);
-        } else {
-            int bits = kind.getByteCount() * Byte.SIZE;
-            return readPrimitiveConstant(kind, baseConstant, displacement, bits);
-        }
-    }
-
-    @Override
-    public JavaConstant readPrimitiveConstant(JavaKind kind, Constant baseConstant, long initialDisplacement, int bits) {
-        try {
-            long rawValue = readRawValue(baseConstant, initialDisplacement, bits);
-            switch (kind) {
-                case Boolean:
-                    return JavaConstant.forBoolean(rawValue != 0);
-                case Byte:
-                    return JavaConstant.forByte((byte) rawValue);
-                case Char:
-                    return JavaConstant.forChar((char) rawValue);
-                case Short:
-                    return JavaConstant.forShort((short) rawValue);
-                case Int:
-                    return JavaConstant.forInt((int) rawValue);
-                case Long:
-                    return JavaConstant.forLong(rawValue);
-                case Float:
-                    return JavaConstant.forFloat(Float.intBitsToFloat((int) rawValue));
-                case Double:
-                    return JavaConstant.forDouble(Double.longBitsToDouble(rawValue));
-                default:
-                    throw new IllegalArgumentException("Unsupported kind: " + kind);
-            }
-        } catch (NullPointerException e) {
-            return null;
-        }
-    }
-
-    @Override
-    public JavaConstant readObjectConstant(Constant base, long displacement) {
-        if (!isValidObjectFieldDisplacement(base, displacement)) {
-            return null;
-        }
-        return HotSpotObjectConstantImpl.forObject(readRawObject(base, displacement, false));
-    }
-
-    @Override
-    public JavaConstant readNarrowOopConstant(Constant base, long displacement) {
-        return HotSpotObjectConstantImpl.forObject(readRawObject(base, displacement, true), true);
-    }
-
-    private HotSpotResolvedObjectTypeImpl readKlass(Constant base, long displacement, boolean compressed) {
-        assert (base instanceof HotSpotMetaspaceConstantImpl) || (base instanceof HotSpotObjectConstantImpl) : base.getClass();
-        Object baseObject = (base instanceof HotSpotMetaspaceConstantImpl) ? ((HotSpotMetaspaceConstantImpl) base).asResolvedJavaType() : ((HotSpotObjectConstantImpl) base).object();
-        return runtime.getCompilerToVM().getResolvedJavaType(baseObject, displacement, compressed);
-    }
-
-    @Override
-    public Constant readKlassPointerConstant(Constant base, long displacement) {
-        HotSpotResolvedObjectTypeImpl klass = readKlass(base, displacement, false);
-        if (klass == null) {
-            return JavaConstant.NULL_POINTER;
-        }
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(klass, false);
-    }
-
-    @Override
-    public Constant readNarrowKlassPointerConstant(Constant base, long displacement) {
-        HotSpotResolvedObjectTypeImpl klass = readKlass(base, displacement, true);
-        if (klass == null) {
-            return HotSpotCompressedNullConstant.COMPRESSED_NULL;
-        }
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(klass, true);
-    }
-
-    @Override
-    public Constant readMethodPointerConstant(Constant base, long displacement) {
-        assert (base instanceof HotSpotObjectConstantImpl);
-        Object baseObject = ((HotSpotObjectConstantImpl) base).object();
-        HotSpotResolvedJavaMethodImpl method = runtime.getCompilerToVM().getResolvedJavaMethod(baseObject, displacement);
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(method, false);
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java
deleted file mode 100644
index da04107..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import static java.util.FormattableFlags.ALTERNATE;
-import static java.util.FormattableFlags.LEFT_JUSTIFY;
-import static java.util.FormattableFlags.UPPERCASE;
-
-import java.util.Formattable;
-import java.util.Formatter;
-
-import jdk.vm.ci.meta.JavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-
-abstract class HotSpotMethod implements JavaMethod, Formattable {
-
-    public static String applyFormattingFlagsAndWidth(String s, int flags, int width) {
-        if (flags == 0 && width < 0) {
-            return s;
-        }
-        StringBuilder sb = new StringBuilder(s);
-
-        // apply width and justification
-        int len = sb.length();
-        if (len < width) {
-            for (int i = 0; i < width - len; i++) {
-                if ((flags & LEFT_JUSTIFY) == LEFT_JUSTIFY) {
-                    sb.append(' ');
-                } else {
-                    sb.insert(0, ' ');
-                }
-            }
-        }
-
-        String res = sb.toString();
-        if ((flags & UPPERCASE) == UPPERCASE) {
-            res = res.toUpperCase();
-        }
-        return res;
-    }
-
-    protected String name;
-
-    /**
-     * Controls whether {@link #toString()} includes the qualified or simple name of the class in
-     * which the method is declared.
-     */
-    public static final boolean FULLY_QUALIFIED_METHOD_NAME = false;
-
-    protected HotSpotMethod(String name) {
-        this.name = name;
-    }
-
-    @Override
-    public final String getName() {
-        return name;
-    }
-
-    @Override
-    public final String toString() {
-        char h = FULLY_QUALIFIED_METHOD_NAME ? 'H' : 'h';
-        String suffix = this instanceof ResolvedJavaMethod ? "" : ", unresolved";
-        String fmt = String.format("HotSpotMethod<%%%c.%%n(%%p)%s>", h, suffix);
-        return format(fmt);
-    }
-
-    public void formatTo(Formatter formatter, int flags, int width, int precision) {
-        String base = (flags & ALTERNATE) == ALTERNATE ? getName() : toString();
-        formatter.format(applyFormattingFlagsAndWidth(base, flags & ~ALTERNATE, width));
-    }
-
-    public JavaMethod asJavaMethod() {
-        return this;
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java
deleted file mode 100644
index e68c7fe..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import jdk.vm.ci.meta.JavaMethod;
-import jdk.vm.ci.meta.JavaType;
-import jdk.vm.ci.meta.Signature;
-
-/**
- * Implementation of {@link JavaMethod} for unresolved HotSpot methods.
- */
-final class HotSpotMethodUnresolved extends HotSpotMethod {
-
-    private final Signature signature;
-    protected JavaType holder;
-
-    HotSpotMethodUnresolved(String name, Signature signature, JavaType holder) {
-        super(name);
-        this.holder = holder;
-        this.signature = signature;
-    }
-
-    @Override
-    public Signature getSignature() {
-        return signature;
-    }
-
-    @Override
-    public JavaType getDeclaringClass() {
-        return holder;
-    }
-
-    @Override
-    public int hashCode() {
-        return super.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null || !(obj instanceof HotSpotMethodUnresolved)) {
-            return false;
-        }
-        HotSpotMethodUnresolved that = (HotSpotMethodUnresolved) obj;
-        return this.name.equals(that.name) && this.signature.equals(that.signature) && this.holder.equals(that.holder);
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java
deleted file mode 100644
index 2428726..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmFieldModifiers;
-import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-
-import jdk.internal.vm.annotation.Stable;
-import jdk.vm.ci.meta.JavaType;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
-/**
- * Represents a field in a HotSpot type.
- */
-class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField {
-
-    private final HotSpotResolvedObjectTypeImpl holder;
-    private final String name;
-    private JavaType type;
-    private final int offset;
-
-    /**
-     * This value contains all flags as stored in the VM including internal ones.
-     */
-    private final int modifiers;
-
-    HotSpotResolvedJavaFieldImpl(HotSpotResolvedObjectTypeImpl holder, String name, JavaType type, long offset, int modifiers) {
-        this.holder = holder;
-        this.name = name;
-        this.type = type;
-        assert offset != -1;
-        assert offset == (int) offset : "offset larger than int";
-        this.offset = (int) offset;
-        this.modifiers = modifiers;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof HotSpotResolvedJavaField) {
-            HotSpotResolvedJavaFieldImpl that = (HotSpotResolvedJavaFieldImpl) obj;
-            if (that.offset != this.offset || that.isStatic() != this.isStatic()) {
-                return false;
-            } else if (this.holder.equals(that.holder)) {
-                assert this.name.equals(that.name) && this.type.equals(that.type);
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return name.hashCode();
-    }
-
-    @Override
-    public int getModifiers() {
-        return modifiers & jvmFieldModifiers();
-    }
-
-    @Override
-    public boolean isInternal() {
-        return (modifiers & config().jvmAccFieldInternal) != 0;
-    }
-
-    /**
-     * Determines if a given object contains this field.
-     *
-     * @return true iff this is a non-static field and its declaring class is assignable from
-     *         {@code object}'s class
-     */
-    public boolean isInObject(Object object) {
-        if (isStatic()) {
-            return false;
-        }
-        return getDeclaringClass().isAssignableFrom(HotSpotResolvedObjectTypeImpl.fromObjectClass(object.getClass()));
-    }
-
-    @Override
-    public HotSpotResolvedObjectTypeImpl getDeclaringClass() {
-        return holder;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public JavaType getType() {
-        // Pull field into local variable to prevent a race causing
-        // a ClassCastException below
-        JavaType currentType = type;
-        if (currentType instanceof HotSpotUnresolvedJavaType) {
-            // Don't allow unresolved types to hang around forever
-            HotSpotUnresolvedJavaType unresolvedType = (HotSpotUnresolvedJavaType) currentType;
-            ResolvedJavaType resolved = unresolvedType.reresolve(holder);
-            if (resolved != null) {
-                type = resolved;
-            }
-        }
-        return type;
-    }
-
-    public int offset() {
-        return offset;
-    }
-
-    @Override
-    public String toString() {
-        return format("HotSpotField<%H.%n %t:") + offset + ">";
-    }
-
-    @Override
-    public boolean isSynthetic() {
-        return (config().jvmAccSynthetic & modifiers) != 0;
-    }
-
-    /**
-     * Checks if this field has the {@link Stable} annotation.
-     *
-     * @return true if field has {@link Stable} annotation, false otherwise
-     */
-    public boolean isStable() {
-        return (config().jvmAccFieldStable & modifiers) != 0;
-    }
-
-    @Override
-    public Annotation[] getAnnotations() {
-        Field javaField = toJava();
-        if (javaField != null) {
-            return javaField.getAnnotations();
-        }
-        return new Annotation[0];
-    }
-
-    @Override
-    public Annotation[] getDeclaredAnnotations() {
-        Field javaField = toJava();
-        if (javaField != null) {
-            return javaField.getDeclaredAnnotations();
-        }
-        return new Annotation[0];
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        Field javaField = toJava();
-        if (javaField != null) {
-            return javaField.getAnnotation(annotationClass);
-        }
-        return null;
-    }
-
-    private Field toJavaCache;
-
-    private Field toJava() {
-        if (toJavaCache != null) {
-            return toJavaCache;
-        }
-
-        if (isInternal()) {
-            return null;
-        }
-        try {
-            return toJavaCache = holder.mirror().getDeclaredField(name);
-        } catch (NoSuchFieldException | NoClassDefFoundError e) {
-            return null;
-        }
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java
deleted file mode 100644
index 393b740..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
-import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
-import static jdk.vm.ci.hotspot.HotSpotModifiers.BRIDGE;
-import static jdk.vm.ci.hotspot.HotSpotModifiers.SYNTHETIC;
-import static jdk.vm.ci.hotspot.HotSpotModifiers.VARARGS;
-import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmMethodModifiers;
-import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
-import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Executable;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-import jdk.vm.ci.common.JVMCIError;
-import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option;
-import jdk.vm.ci.meta.Constant;
-import jdk.vm.ci.meta.ConstantPool;
-import jdk.vm.ci.meta.DefaultProfilingInfo;
-import jdk.vm.ci.meta.ExceptionHandler;
-import jdk.vm.ci.meta.JavaMethod;
-import jdk.vm.ci.meta.JavaType;
-import jdk.vm.ci.meta.LineNumberTable;
-import jdk.vm.ci.meta.Local;
-import jdk.vm.ci.meta.LocalVariableTable;
-import jdk.vm.ci.meta.ProfilingInfo;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-import jdk.vm.ci.meta.Signature;
-import jdk.vm.ci.meta.SpeculationLog;
-import jdk.vm.ci.meta.TriState;
-
-/**
- * Implementation of {@link JavaMethod} for resolved HotSpot methods.
- */
-final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSpotResolvedJavaMethod, MetaspaceWrapperObject {
-
-    /**
-     * Reference to metaspace Method object.
-     */
-    private final long metaspaceMethod;
-
-    private final HotSpotResolvedObjectTypeImpl holder;
-    private final HotSpotConstantPool constantPool;
-    private final HotSpotSignature signature;
-    private HotSpotMethodData methodData;
-    private byte[] code;
-    private Executable toJavaCache;
-
-    /**
-     * Gets the holder of a HotSpot metaspace method native object.
-     *
-     * @param metaspaceMethod a metaspace Method object
-     * @return the {@link ResolvedJavaType} corresponding to the holder of the
-     *         {@code metaspaceMethod}
-     */
-    private static HotSpotResolvedObjectTypeImpl getHolder(long metaspaceMethod) {
-        HotSpotVMConfig config = config();
-        final long metaspaceConstMethod = UNSAFE.getAddress(metaspaceMethod + config.methodConstMethodOffset);
-        final long metaspaceConstantPool = UNSAFE.getAddress(metaspaceConstMethod + config.constMethodConstantsOffset);
-        return compilerToVM().getResolvedJavaType(null, metaspaceConstantPool + config.constantPoolHolderOffset, false);
-    }
-
-    /**
-     * Gets the JVMCI mirror from a HotSpot method. The VM is responsible for ensuring that the
-     * Method* is kept alive for the duration of this call and the
-     * {@link HotSpotJVMCIMetaAccessContext} keeps it alive after that.
-     *
-     * Called from the VM.
-     *
-     * @param metaspaceMethod a metaspace Method object
-     * @return the {@link ResolvedJavaMethod} corresponding to {@code metaspaceMethod}
-     */
-    @SuppressWarnings("unused")
-    private static HotSpotResolvedJavaMethod fromMetaspace(long metaspaceMethod) {
-        HotSpotResolvedObjectTypeImpl holder = getHolder(metaspaceMethod);
-        return holder.createMethod(metaspaceMethod);
-    }
-
-    HotSpotResolvedJavaMethodImpl(HotSpotResolvedObjectTypeImpl holder, long metaspaceMethod) {
-        // It would be too much work to get the method name here so we fill it in later.
-        super(null);
-        this.metaspaceMethod = metaspaceMethod;
-        this.holder = holder;
-
-        HotSpotVMConfig config = config();
-        final long constMethod = getConstMethod();
-
-        /*
-         * Get the constant pool from the metaspace method. Some methods (e.g. intrinsics for
-         * signature-polymorphic method handle methods) have their own constant pool instead of the
-         * one from their holder.
-         */
-        final long metaspaceConstantPool = UNSAFE.getAddress(constMethod + config.constMethodConstantsOffset);
-        if (metaspaceConstantPool == holder.getConstantPool().getMetaspaceConstantPool()) {
-            this.constantPool = holder.getConstantPool();
-        } else {
-            this.constantPool = compilerToVM().getConstantPool(this);
-        }
-
-        final int nameIndex = UNSAFE.getChar(constMethod + config.constMethodNameIndexOffset);
-        this.name = constantPool.lookupUtf8(nameIndex);
-
-        final int signatureIndex = UNSAFE.getChar(constMethod + config.constMethodSignatureIndexOffset);
-        this.signature = (HotSpotSignature) constantPool.lookupSignature(signatureIndex);
-    }
-
-    /**
-     * Returns a pointer to this method's constant method data structure (
-     * {@code Method::_constMethod}). This pointer isn't wrapped since it should be safe to use it
-     * within the context of this HotSpotResolvedJavaMethodImpl since the Method* and ConstMethod*
-     * are kept alive as a pair.
-     *
-     * @return pointer to this method's ConstMethod
-     */
-    private long getConstMethod() {
-        assert metaspaceMethod != 0;
-        return UNSAFE.getAddress(metaspaceMethod + config().methodConstMethodOffset);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof HotSpotResolvedJavaMethodImpl) {
-            HotSpotResolvedJavaMethodImpl that = (HotSpotResolvedJavaMethodImpl) obj;
-            return that.metaspaceMethod == metaspaceMethod;
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return (int) metaspaceMethod;
-    }
-
-    /**
-     * Returns this method's flags ({@code Method::_flags}).
-     *
-     * @return flags of this method
-     */
-    private int getFlags() {
-        return UNSAFE.getShort(metaspaceMethod + config().methodFlagsOffset);
-    }
-
-    /**
-     * Returns this method's constant method flags ({@code ConstMethod::_flags}).
-     *
-     * @return flags of this method's ConstMethod
-     */
-    private int getConstMethodFlags() {
-        return UNSAFE.getChar(getConstMethod() + config().constMethodFlagsOffset);
-    }
-
-    @Override
-    public HotSpotResolvedObjectTypeImpl getDeclaringClass() {
-        return holder;
-    }
-
-    /**
-     * Gets the address of the C++ Method object for this method.
-     */
-    public Constant getMetaspaceMethodConstant() {
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(this, false);
-    }
-
-    public long getMetaspacePointer() {
-        return metaspaceMethod;
-    }
-
-    @Override
-    public Constant getEncoding() {
-        return getMetaspaceMethodConstant();
-    }
-
-    /**
-     * Gets the complete set of modifiers for this method which includes the JVM specification
-     * modifiers as well as the HotSpot internal modifiers.
-     */
-    public int getAllModifiers() {
-        return UNSAFE.getInt(metaspaceMethod + config().methodAccessFlagsOffset);
-    }
-
-    @Override
-    public int getModifiers() {
-        return getAllModifiers() & jvmMethodModifiers();
-    }
-
-    @Override
-    public boolean canBeStaticallyBound() {
-        return (isFinal() || isPrivate() || isStatic() || holder.isLeaf()) && isConcrete();
-    }
-
-    @Override
-    public byte[] getCode() {
-        if (getCodeSize() == 0) {
-            return null;
-        }
-        if (code == null && holder.isLinked()) {
-            code = compilerToVM().getBytecode(this);
-            assert code.length == getCodeSize() : "expected: " + getCodeSize() + ", actual: " + code.length;
-        }
-        return code;
-    }
-
-    @Override
-    public int getCodeSize() {
-        return UNSAFE.getChar(getConstMethod() + config().constMethodCodeSizeOffset);
-    }
-
-    @Override
-    public ExceptionHandler[] getExceptionHandlers() {
-        final boolean hasExceptionTable = (getConstMethodFlags() & config().constMethodHasExceptionTable) != 0;
-        if (!hasExceptionTable) {
-            return new ExceptionHandler[0];
-        }
-
-        HotSpotVMConfig config = config();
-        final int exceptionTableLength = compilerToVM().getExceptionTableLength(this);
-        ExceptionHandler[] handlers = new ExceptionHandler[exceptionTableLength];
-        long exceptionTableElement = compilerToVM().getExceptionTableStart(this);
-
-        for (int i = 0; i < exceptionTableLength; i++) {
-            final int startPc = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementStartPcOffset);
-            final int endPc = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementEndPcOffset);
-            final int handlerPc = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementHandlerPcOffset);
-            int catchTypeIndex = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementCatchTypeIndexOffset);
-
-            JavaType catchType;
-            if (catchTypeIndex == 0) {
-                catchType = null;
-            } else {
-                final int opcode = -1;  // opcode is not used
-                catchType = constantPool.lookupType(catchTypeIndex, opcode);
-
-                // Check for Throwable which catches everything.
-                if (catchType instanceof HotSpotResolvedObjectTypeImpl) {
-                    HotSpotResolvedObjectTypeImpl resolvedType = (HotSpotResolvedObjectTypeImpl) catchType;
-                    if (resolvedType.mirror() == Throwable.class) {
-                        catchTypeIndex = 0;
-                        catchType = null;
-                    }
-                }
-            }
-            handlers[i] = new ExceptionHandler(startPc, endPc, handlerPc, catchTypeIndex, catchType);
-
-            // Go to the next ExceptionTableElement
-            exceptionTableElement += config.exceptionTableElementSize;
-        }
-
-        return handlers;
-    }
-
-    /**
-     * Returns true if this method has a {@code CallerSensitive} annotation.
-     *
-     * @return true if CallerSensitive annotation present, false otherwise
-     */
-    public boolean isCallerSensitive() {
-        return (getFlags() & config().methodFlagsCallerSensitive) != 0;
-    }
-
-    /**
-     * Returns true if this method has a {@code ForceInline} annotation.
-     *
-     * @return true if ForceInline annotation present, false otherwise
-     */
-    public boolean isForceInline() {
-        return (getFlags() & config().methodFlagsForceInline) != 0;
-    }
-
-    /**
-     * Returns true if this method has a {@code ReservedStackAccess} annotation.
-     *
-     * @return true if ReservedStackAccess annotation present, false otherwise
-     */
-    public boolean hasReservedStackAccess() {
-        return (getFlags() & config().methodFlagsReservedStackAccess) != 0;
-    }
-
-    /**
-     * Manually adds a DontInline annotation to this method.
-     */
-    public void setNotInlineable() {
-        compilerToVM().doNotInlineOrCompile(this);
-    }
-
-    /**
-     * Returns true if this method is one of the special methods that is ignored by security stack
-     * walks.
-     *
-     * @return true if special method ignored by security stack walks, false otherwise
-     */
-    public boolean ignoredBySecurityStackWalk() {
-        return compilerToVM().methodIsIgnoredBySecurityStackWalk(this);
-    }
-
-    @Override
-    public boolean isClassInitializer() {
-        return "<clinit>".equals(name) && isStatic();
-    }
-
-    @Override
-    public boolean isConstructor() {
-        return "<init>".equals(name) && !isStatic();
-    }
-
-    @Override
-    public int getMaxLocals() {
-        if (isAbstract() || isNative()) {
-            return 0;
-        }
-        HotSpotVMConfig config = config();
-        return UNSAFE.getChar(getConstMethod() + config.methodMaxLocalsOffset);
-    }
-
-    @Override
-    public int getMaxStackSize() {
-        if (isAbstract() || isNative()) {
-            return 0;
-        }
-        HotSpotVMConfig config = config();
-        return config.extraStackEntries + UNSAFE.getChar(getConstMethod() + config.constMethodMaxStackOffset);
-    }
-
-    @Override
-    public StackTraceElement asStackTraceElement(int bci) {
-        if (bci < 0 || bci >= getCodeSize()) {
-            // HotSpot code can only construct stack trace elements for valid bcis
-            StackTraceElement ste = compilerToVM().getStackTraceElement(this, 0);
-            return new StackTraceElement(ste.getClassName(), ste.getMethodName(), ste.getFileName(), -1);
-        }
-        return compilerToVM().getStackTraceElement(this, bci);
-    }
-
-    public ResolvedJavaMethod uniqueConcreteMethod(HotSpotResolvedObjectType receiver) {
-        if (receiver.isInterface()) {
-            // Cannot trust interfaces. Because of:
-            // interface I { void foo(); }
-            // class A { public void foo() {} }
-            // class B extends A implements I { }
-            // class C extends B { public void foo() { } }
-            // class D extends B { }
-            // Would lead to identify C.foo() as the unique concrete method for I.foo() without
-            // seeing A.foo().
-            return null;
-        }
-        if (this.isDefault()) {
-            // CHA for default methods doesn't work and may crash the VM
-            return null;
-        }
-        return compilerToVM().findUniqueConcreteMethod(((HotSpotResolvedObjectTypeImpl) receiver), this);
-    }
-
-    @Override
-    public HotSpotSignature getSignature() {
-        return signature;
-    }
-
-    /**
-     * Gets the value of {@code Method::_code}.
-     *
-     * @return the value of {@code Method::_code}
-     */
-    private long getCompiledCode() {
-        HotSpotVMConfig config = config();
-        return UNSAFE.getAddress(metaspaceMethod + config.methodCodeOffset);
-    }
-
-    /**
-     * Returns whether this method has compiled code.
-     *
-     * @return true if this method has compiled code, false otherwise
-     */
-    public boolean hasCompiledCode() {
-        return getCompiledCode() != 0L;
-    }
-
-    /**
-     * @param level
-     * @return true if the currently installed code was generated at {@code level}.
-     */
-    public boolean hasCompiledCodeAtLevel(int level) {
-        long compiledCode = getCompiledCode();
-        if (compiledCode != 0) {
-            return UNSAFE.getInt(compiledCode + config().nmethodCompLevelOffset) == level;
-        }
-        return false;
-    }
-
-    @Override
-    public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR) {
-        ProfilingInfo info;
-
-        if (Option.UseProfilingInformation.getBoolean() && methodData == null) {
-            long metaspaceMethodData = UNSAFE.getAddress(metaspaceMethod + config().methodDataOffset);
-            if (metaspaceMethodData != 0) {
-                methodData = new HotSpotMethodData(metaspaceMethodData, this);
-                String methodDataFilter = Option.TraceMethodDataFilter.getString();
-                if (methodDataFilter != null && this.format("%H.%n").contains(methodDataFilter)) {
-                    System.out.println(methodData.toString());
-                }
-            }
-        }
-
-        if (methodData == null || (!methodData.hasNormalData() && !methodData.hasExtraData())) {
-            // Be optimistic and return false for exceptionSeen. A methodDataOop is allocated in
-            // case of a deoptimization.
-            info = DefaultProfilingInfo.get(TriState.FALSE);
-        } else {
-            info = new HotSpotProfilingInfo(methodData, this, includeNormal, includeOSR);
-        }
-        return info;
-    }
-
-    @Override
-    public void reprofile() {
-        compilerToVM().reprofile(this);
-    }
-
-    @Override
-    public ConstantPool getConstantPool() {
-        return constantPool;
-    }
-
-    @Override
-    public Parameter[] getParameters() {
-        Executable javaMethod = toJava();
-        if (javaMethod == null) {
-            return null;
-        }
-
-        java.lang.reflect.Parameter[] javaParameters = javaMethod.getParameters();
-        Parameter[] res = new Parameter[javaParameters.length];
-        for (int i = 0; i < res.length; i++) {
-            java.lang.reflect.Parameter src = javaParameters[i];
-            String paramName = src.isNamePresent() ? src.getName() : null;
-            res[i] = new Parameter(paramName, src.getModifiers(), this, i);
-        }
-        return res;
-    }
-
-    @Override
-    public Annotation[][] getParameterAnnotations() {
-        Executable javaMethod = toJava();
-        return javaMethod == null ? null : javaMethod.getParameterAnnotations();
-    }
-
-    @Override
-    public Annotation[] getAnnotations() {
-        Executable javaMethod = toJava();
-        if (javaMethod != null) {
-            return javaMethod.getAnnotations();
-        }
-        return new Annotation[0];
-    }
-
-    @Override
-    public Annotation[] getDeclaredAnnotations() {
-        Executable javaMethod = toJava();
-        if (javaMethod != null) {
-            return javaMethod.getDeclaredAnnotations();
-        }
-        return new Annotation[0];
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        Executable javaMethod = toJava();
-        return javaMethod == null ? null : javaMethod.getAnnotation(annotationClass);
-    }
-
-    public boolean isBridge() {
-        return (BRIDGE & getModifiers()) != 0;
-    }
-
-    @Override
-    public boolean isSynthetic() {
-        return (SYNTHETIC & getModifiers()) != 0;
-    }
-
-    public boolean isVarArgs() {
-        return (VARARGS & getModifiers()) != 0;
-    }
-
-    public boolean isDefault() {
-        if (isConstructor()) {
-            return false;
-        }
-        // Copied from java.lang.Method.isDefault()
-        int mask = Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC;
-        return ((getModifiers() & mask) == Modifier.PUBLIC) && getDeclaringClass().isInterface();
-    }
-
-    @Override
-    public Type[] getGenericParameterTypes() {
-        Executable javaMethod = toJava();
-        return javaMethod == null ? null : javaMethod.getGenericParameterTypes();
-    }
-
-    public Class<?>[] signatureToTypes() {
-        Signature sig = getSignature();
-        int count = sig.getParameterCount(false);
-        Class<?>[] result = new Class<?>[count];
-        for (int i = 0; i < result.length; ++i) {
-            JavaType parameterType = sig.getParameterType(i, holder);
-            HotSpotResolvedJavaType resolvedParameterType = (HotSpotResolvedJavaType) parameterType.resolve(holder);
-            result[i] = resolvedParameterType.mirror();
-        }
-        return result;
-    }
-
-    private static Method searchMethods(Method[] methods, String name, Class<?> returnType, Class<?>[] parameterTypes) {
-        for (Method m : methods) {
-            if (m.getName().equals(name) && returnType.equals(m.getReturnType()) && Arrays.equals(m.getParameterTypes(), parameterTypes)) {
-                return m;
-            }
-        }
-        return null;
-    }
-
-    private Executable toJava() {
-        if (toJavaCache != null) {
-            return toJavaCache;
-        }
-        try {
-            Class<?>[] parameterTypes = signatureToTypes();
-            Class<?> returnType = ((HotSpotResolvedJavaType) getSignature().getReturnType(holder).resolve(holder)).mirror();
-
-            Executable result;
-            if (isConstructor()) {
-                result = holder.mirror().getDeclaredConstructor(parameterTypes);
-            } else {
-                // Do not use Method.getDeclaredMethod() as it can return a bridge method
-                // when this.isBridge() is false and vice versa.
-                result = searchMethods(holder.mirror().getDeclaredMethods(), name, returnType, parameterTypes);
-            }
-            toJavaCache = result;
-            return result;
-        } catch (NoSuchMethodException | NoClassDefFoundError e) {
-            return null;
-        }
-    }
-
-    @Override
-    public boolean canBeInlined() {
-        if (hasNeverInlineDirective()) {
-            return false;
-        }
-        return compilerToVM().isCompilable(this);
-    }
-
-    @Override
-    public boolean hasNeverInlineDirective() {
-        return compilerToVM().hasNeverInlineDirective(this);
-    }
-
-    @Override
-    public boolean shouldBeInlined() {
-        if (isForceInline()) {
-            return true;
-        }
-        return compilerToVM().shouldInlineMethod(this);
-    }
-
-    @Override
-    public LineNumberTable getLineNumberTable() {
-        final boolean hasLineNumberTable = (getConstMethodFlags() & config().constMethodHasLineNumberTable) != 0;
-        if (!hasLineNumberTable) {
-            return null;
-        }
-
-        long[] values = compilerToVM().getLineNumberTable(this);
-        if (values == null || values.length == 0) {
-            // Empty table so treat is as non-existent
-            return null;
-        }
-        assert values.length % 2 == 0;
-        int[] bci = new int[values.length / 2];
-        int[] line = new int[values.length / 2];
-
-        for (int i = 0; i < values.length / 2; i++) {
-            bci[i] = (int) values[i * 2];
-            line[i] = (int) values[i * 2 + 1];
-        }
-
-        return new LineNumberTable(line, bci);
-    }
-
-    @Override
-    public LocalVariableTable getLocalVariableTable() {
-        final boolean hasLocalVariableTable = (getConstMethodFlags() & config().constMethodHasLocalVariableTable) != 0;
-        if (!hasLocalVariableTable) {
-            return null;
-        }
-
-        HotSpotVMConfig config = config();
-        long localVariableTableElement = compilerToVM().getLocalVariableTableStart(this);
-        final int localVariableTableLength = compilerToVM().getLocalVariableTableLength(this);
-        Local[] locals = new Local[localVariableTableLength];
-
-        for (int i = 0; i < localVariableTableLength; i++) {
-            final int startBci = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementStartBciOffset);
-            final int endBci = startBci + UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementLengthOffset);
-            final int nameCpIndex = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementNameCpIndexOffset);
-            final int typeCpIndex = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementDescriptorCpIndexOffset);
-            final int slot = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementSlotOffset);
-
-            String localName = getConstantPool().lookupUtf8(nameCpIndex);
-            String localType = getConstantPool().lookupUtf8(typeCpIndex);
-
-            locals[i] = new Local(localName, runtime().lookupType(localType, holder, false), startBci, endBci, slot);
-
-            // Go to the next LocalVariableTableElement
-            localVariableTableElement += config.localVariableTableElementSize;
-        }
-
-        return new LocalVariableTable(locals);
-    }
-
-    /**
-     * Returns the offset of this method into the v-table. The method must have a v-table entry as
-     * indicated by {@link #isInVirtualMethodTable(ResolvedJavaType)}, otherwise an exception is
-     * thrown.
-     *
-     * @return the offset of this method into the v-table
-     */
-    public int vtableEntryOffset(ResolvedJavaType resolved) {
-        if (!isInVirtualMethodTable(resolved)) {
-            throw new JVMCIError("%s does not have a vtable entry in type %s", this, resolved);
-        }
-        HotSpotVMConfig config = config();
-        final int vtableIndex = getVtableIndex((HotSpotResolvedObjectTypeImpl) resolved);
-        return config.klassVtableStartOffset + vtableIndex * config.vtableEntrySize + config.vtableEntryMethodOffset;
-    }
-
-    @Override
-    public boolean isInVirtualMethodTable(ResolvedJavaType resolved) {
-        if (resolved instanceof HotSpotResolvedObjectTypeImpl) {
-            HotSpotResolvedObjectTypeImpl hotspotResolved = (HotSpotResolvedObjectTypeImpl) resolved;
-            int vtableIndex = getVtableIndex(hotspotResolved);
-            return vtableIndex >= 0 && vtableIndex < hotspotResolved.getVtableLength();
-        }
-        return false;
-    }
-
-    private int getVtableIndex(HotSpotResolvedObjectTypeImpl resolved) {
-        if (!holder.isLinked()) {
-            return config().invalidVtableIndex;
-        }
-        if (holder.isInterface()) {
-            if (resolved.isInterface()) {
-                return config().invalidVtableIndex;
-            }
-            return getVtableIndexForInterfaceMethod(resolved);
-        }
-        return getVtableIndex();
-    }
-
-    /**
-     * Returns this method's virtual table index.
-     *
-     * @return virtual table index
-     */
-    private int getVtableIndex() {
-        assert !holder.isInterface();
-        HotSpotVMConfig config = config();
-        int result = UNSAFE.getInt(metaspaceMethod + config.methodVtableIndexOffset);
-        assert result >= config.nonvirtualVtableIndex : "must be linked";
-        return result;
-    }
-
-    private int getVtableIndexForInterfaceMethod(ResolvedJavaType resolved) {
-        HotSpotResolvedObjectTypeImpl hotspotType = (HotSpotResolvedObjectTypeImpl) resolved;
-        return compilerToVM().getVtableIndexForInterfaceMethod(hotspotType, this);
-    }
-
-    /**
-     * The {@link SpeculationLog} for methods compiled by JVMCI hang off this per-declaring-type
-     * {@link ClassValue}. The raw Method* value is safe to use as a key in the map as a) it is
-     * never moves and b) we never read from it.
-     * <p>
-     * One implication is that we will preserve {@link SpeculationLog}s for methods that have been
-     * redefined via class redefinition. It's tempting to periodically flush such logs but we cannot
-     * read the JVM_ACC_IS_OBSOLETE bit (or anything else) via the raw pointer as obsoleted methods
-     * are subject to clean up and deletion (see InstanceKlass::purge_previous_versions_internal).
-     */
-    private static final ClassValue<Map<Long, SpeculationLog>> SpeculationLogs = new ClassValue<Map<Long, SpeculationLog>>() {
-        @Override
-        protected Map<Long, SpeculationLog> computeValue(java.lang.Class<?> type) {
-            return new HashMap<>(4);
-        }
-    };
-
-    public SpeculationLog getSpeculationLog() {
-        Map<Long, SpeculationLog> map = SpeculationLogs.get(holder.mirror());
-        synchronized (map) {
-            SpeculationLog log = map.get(this.metaspaceMethod);
-            if (log == null) {
-                log = new HotSpotSpeculationLog();
-                map.put(metaspaceMethod, log);
-            }
-            return log;
-        }
-    }
-
-    public int intrinsicId() {
-        HotSpotVMConfig config = config();
-        return UNSAFE.getChar(metaspaceMethod + config.methodIntrinsicIdOffset);
-    }
-
-    public boolean isIntrinsicCandidate() {
-        return (getFlags() & config().methodFlagsIntrinsicCandidate) != 0;
-    }
-
-    /**
-     * Allocates a compile id for this method by asking the VM for one.
-     *
-     * @param entryBCI entry bci
-     * @return compile id
-     */
-    public int allocateCompileId(int entryBCI) {
-        return compilerToVM().allocateCompileId(this, entryBCI);
-    }
-
-    public boolean hasCodeAtLevel(int entryBCI, int level) {
-        if (entryBCI == config().invocationEntryBci) {
-            return hasCompiledCodeAtLevel(level);
-        }
-        return compilerToVM().hasCompiledCodeForOSR(this, entryBCI, level);
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java
deleted file mode 100644
index a0a3bc7..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java
+++ /dev/null
@@ -1,937 +0,0 @@
-/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import static java.util.Objects.requireNonNull;
-import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
-import static jdk.vm.ci.hotspot.HotSpotConstantPool.isSignaturePolymorphicHolder;
-import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
-import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmClassModifiers;
-import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
-import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.nio.ByteOrder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-
-import jdk.vm.ci.common.JVMCIError;
-import jdk.vm.ci.meta.Assumptions.AssumptionResult;
-import jdk.vm.ci.meta.Assumptions.ConcreteMethod;
-import jdk.vm.ci.meta.Assumptions.ConcreteSubtype;
-import jdk.vm.ci.meta.Assumptions.LeafType;
-import jdk.vm.ci.meta.Assumptions.NoFinalizableSubclass;
-import jdk.vm.ci.meta.Constant;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.JavaType;
-import jdk.vm.ci.meta.ResolvedJavaField;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.ResolvedJavaType;
-
-/**
- * Implementation of {@link JavaType} for resolved non-primitive HotSpot classes.
- */
-final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implements HotSpotResolvedObjectType, MetaspaceWrapperObject {
-
-    /**
-     * The Java class this type represents.
-     */
-    private final Class<?> javaClass;
-    private HashMap<Long, HotSpotResolvedJavaField> fieldCache;
-    private HashMap<Long, HotSpotResolvedJavaMethodImpl> methodCache;
-    private HotSpotResolvedJavaField[] instanceFields;
-    private HotSpotResolvedObjectTypeImpl[] interfaces;
-    private HotSpotConstantPool constantPool;
-    final HotSpotJVMCIMetaAccessContext context;
-    private HotSpotResolvedObjectType arrayOfType;
-
-    /**
-     * Gets the JVMCI mirror for a {@link Class} object.
-     *
-     * @return the {@link HotSpotResolvedJavaType} corresponding to {@code javaClass}
-     */
-    static HotSpotResolvedObjectTypeImpl fromObjectClass(Class<?> javaClass) {
-        return (HotSpotResolvedObjectTypeImpl) runtime().fromClass(javaClass);
-    }
-
-    /**
-     * Gets the JVMCI mirror from a HotSpot type. Since {@link Class} is already a proxy for the
-     * underlying Klass*, it is used instead of the raw Klass*.
-     *
-     * Called from the VM.
-     *
-     * @param javaClass a {@link Class} object
-     * @return the {@link ResolvedJavaType} corresponding to {@code javaClass}
-     */
-    @SuppressWarnings("unused")
-    private static HotSpotResolvedObjectTypeImpl fromMetaspace(Class<?> javaClass) {
-        return fromObjectClass(javaClass);
-    }
-
-    /**
-     * Creates the JVMCI mirror for a {@link Class} object.
-     *
-     * <p>
-     * <b>NOTE</b>: Creating an instance of this class does not install the mirror for the
-     * {@link Class} type. Use {@link #fromObjectClass(Class)} or {@link #fromMetaspace(Class)}
-     * instead.
-     * </p>
-     *
-     * @param javaClass the Class to create the mirror for
-     * @param context
-     */
-    HotSpotResolvedObjectTypeImpl(Class<?> javaClass, HotSpotJVMCIMetaAccessContext context) {
-        super(getSignatureName(javaClass));
-        this.javaClass = javaClass;
-        this.context = context;
-        assert getName().charAt(0) != '[' || isArray() : getName();
-    }
-
-    /**
-     * Returns the name of this type as it would appear in a signature.
-     */
-    private static String getSignatureName(Class<?> javaClass) {
-        if (javaClass.isArray()) {
-            return javaClass.getName().replace('.', '/');
-        }
-        return "L" + javaClass.getName().replace('.', '/') + ";";
-    }
-
-    /**
-     * Gets the metaspace Klass for this type.
-     */
-    long getMetaspaceKlass() {
-        if (HotSpotJVMCIRuntime.getHostWordKind() == JavaKind.Long) {
-            return UNSAFE.getLong(javaClass, config().klassOffset);
-        }
-        return UNSAFE.getInt(javaClass, config().klassOffset) & 0xFFFFFFFFL;
-    }
-
-    @Override
-    public long getMetaspacePointer() {
-        return getMetaspaceKlass();
-    }
-
-    /**
-     * The Klass* for this object is kept alive by the direct reference to {@link #javaClass} so no
-     * extra work is required.
-     */
-    @Override
-    public boolean isRegistered() {
-        return true;
-    }
-
-    @Override
-    public int getModifiers() {
-        if (isArray()) {
-            return (getElementalType().getModifiers() & (Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED)) | Modifier.FINAL | Modifier.ABSTRACT;
-        } else {
-            return getAccessFlags() & jvmClassModifiers();
-        }
-    }
-
-    public int getAccessFlags() {
-        HotSpotVMConfig config = config();
-        return UNSAFE.getInt(getMetaspaceKlass() + config.klassAccessFlagsOffset);
-    }
-
-    @Override
-    public HotSpotResolvedObjectType getArrayClass() {
-        if (arrayOfType == null) {
-            arrayOfType = fromObjectClass(Array.newInstance(mirror(), 0).getClass());
-        }
-        return arrayOfType;
-    }
-
-    @Override
-    public ResolvedJavaType getComponentType() {
-        Class<?> javaComponentType = mirror().getComponentType();
-        return javaComponentType == null ? null : runtime().fromClass(javaComponentType);
-    }
-
-    @Override
-    public AssumptionResult<ResolvedJavaType> findLeafConcreteSubtype() {
-        if (isLeaf()) {
-            // No assumptions are required.
-            return new AssumptionResult<>(this);
-        }
-        HotSpotVMConfig config = config();
-        if (isArray()) {
-            ResolvedJavaType elementalType = getElementalType();
-            AssumptionResult<ResolvedJavaType> elementType = elementalType.findLeafConcreteSubtype();
-            if (elementType != null && elementType.getResult().equals(elementalType)) {
-                /*
-                 * If the elementType is leaf then the array is leaf under the same assumptions but
-                 * only if the element type is exactly the leaf type. The element type can be
-                 * abstract even if there is only one implementor of the abstract type.
-                 */
-                AssumptionResult<ResolvedJavaType> result = new AssumptionResult<>(this);
-                result.add(elementType);
-                return result;
-            }
-            return null;
-        } else if (isInterface()) {
-            HotSpotResolvedObjectTypeImpl implementor = getSingleImplementor();
-            /*
-             * If the implementor field contains itself that indicates that the interface has more
-             * than one implementors (see: InstanceKlass::add_implementor).
-             */
-            if (implementor == null || implementor.equals(this)) {
-                return null;
-            }
-
-            assert !implementor.isInterface();
-            if (implementor.isAbstract() || !implementor.isLeafClass()) {
-                AssumptionResult<ResolvedJavaType> leafConcreteSubtype = implementor.findLeafConcreteSubtype();
-                if (leafConcreteSubtype != null) {
-                    assert !leafConcreteSubtype.getResult().equals(implementor);
-                    AssumptionResult<ResolvedJavaType> newResult = new AssumptionResult<>(leafConcreteSubtype.getResult(), new ConcreteSubtype(this, implementor));
-                    // Accumulate leaf assumptions and return the combined result.
-                    newResult.add(leafConcreteSubtype);
-                    return newResult;
-                }
-                return null;
-            }
-            return concreteSubtype(implementor);
-        } else {
-            HotSpotResolvedObjectTypeImpl type = this;
-            while (type.isAbstract()) {
-                HotSpotResolvedObjectTypeImpl subklass = type.getSubklass();
-                if (subklass == null || UNSAFE.getAddress(subklass.getMetaspaceKlass() + config.nextSiblingOffset) != 0) {
-                    return null;
-                }
-                type = subklass;
-            }
-            if (type.isAbstract() || type.isInterface() || !type.isLeafClass()) {
-                return null;
-            }
-            if (this.isAbstract()) {
-                return concreteSubtype(type);
-            } else {
-                assert this.equals(type);
-                return new AssumptionResult<>(type, new LeafType(type));
-            }
-        }
-    }
-
-    private AssumptionResult<ResolvedJavaType> concreteSubtype(HotSpotResolvedObjectTypeImpl type) {
-        if (type.isLeaf()) {
-            return new AssumptionResult<>(type, new ConcreteSubtype(this, type));
-        } else {
-            return new AssumptionResult<>(type, new LeafType(type), new ConcreteSubtype(this, type));
-        }
-    }
-
-    /**
-     * Returns if type {@code type} is a leaf class. This is the case if the
-     * {@code Klass::_subklass} field of the underlying class is zero.
-     *
-     * @return true if the type is a leaf class
-     */
-    private boolean isLeafClass() {
-        return getSubklass() == null;
-    }
-
-    /**
-     * Returns the {@code Klass::_subklass} field of the underlying metaspace klass for the given
-     * type {@code type}.
-     *
-     * @return value of the subklass field as metaspace klass pointer
-     */
-    private HotSpotResolvedObjectTypeImpl getSubklass() {
-        return compilerToVM().getResolvedJavaType(this, config().subklassOffset, false);
-    }
-
-    @Override
-    public HotSpotResolvedObjectTypeImpl getSuperclass() {
-        Class<?> javaSuperclass = mirror().getSuperclass();
-        return javaSuperclass == null ? null : fromObjectClass(javaSuperclass);
-    }
-
-    @Override
-    public HotSpotResolvedObjectTypeImpl[] getInterfaces() {
-        if (interfaces == null) {
-            Class<?>[] javaInterfaces = mirror().getInterfaces();
-            HotSpotResolvedObjectTypeImpl[] result = new HotSpotResolvedObjectTypeImpl[javaInterfaces.length];
-            for (int i = 0; i < javaInterfaces.length; i++) {
-                result[i] = fromObjectClass(javaInterfaces[i]);
-            }
-            interfaces = result;
-        }
-        return interfaces;
-    }
-
-    @Override
-    public HotSpotResolvedObjectTypeImpl getSingleImplementor() {
-        if (!isInterface()) {
-            throw new JVMCIError("Cannot call getSingleImplementor() on a non-interface type: %s", this);
-        }
-        return compilerToVM().getImplementor(this);
-    }
-
-    public HotSpotResolvedObjectTypeImpl getSupertype() {
-        if (isArray()) {
-            ResolvedJavaType componentType = getComponentType();
-            if (mirror() == Object[].class || componentType.isPrimitive()) {
-                return fromObjectClass(Object.class);
-            }
-            return (HotSpotResolvedObjectTypeImpl) ((HotSpotResolvedObjectTypeImpl) componentType).getSupertype().getArrayClass();
-        }
-        if (isInterface()) {
-            return fromObjectClass(Object.class);
-        }
-        return getSuperclass();
-    }
-
-    @Override
-    public HotSpotResolvedObjectType findLeastCommonAncestor(ResolvedJavaType otherType) {
-        if (otherType.isPrimitive()) {
-            return null;
-        } else {
-            HotSpotResolvedObjectTypeImpl t1 = this;
-            HotSpotResolvedObjectTypeImpl t2 = (HotSpotResolvedObjectTypeImpl) otherType;
-            while (true) {
-                if (t1.isAssignableFrom(t2)) {
-                    return t1;
-                }
-                if (t2.isAssignableFrom(t1)) {
-                    return t2;
-                }
-                t1 = t1.getSupertype();
-                t2 = t2.getSupertype();
-            }
-        }
-    }
-
-    @Override
-    public AssumptionResult<Boolean> hasFinalizableSubclass() {
-        assert !isArray();
-        if (!compilerToVM().hasFinalizableSubclass(this)) {
-            return new AssumptionResult<>(false, new NoFinalizableSubclass(this));
-        }
-        return new AssumptionResult<>(true);
-    }
-
-    @Override
-    public boolean hasFinalizer() {
-        return (getAccessFlags() & config().jvmAccHasFinalizer) != 0;
-    }
-
-    @Override
-    public boolean isPrimitive() {
-        return false;
-    }
-
-    @Override
-    public boolean isArray() {
-        return mirror().isArray();
-    }
-
-    @Override
-    public boolean isInitialized() {
-        return isArray() ? true : getInitState() == config().instanceKlassStateFullyInitialized;
-    }
-
-    @Override
-    public boolean isLinked() {
-        return isArray() ? true : getInitState() >= config().instanceKlassStateLinked;
-    }
-
-    /**
-     * Returns the value of the state field {@code InstanceKlass::_init_state} of the metaspace
-     * klass.
-     *
-     * @return state field value of this type
-     */
-    private int getInitState() {
-        assert !isArray() : "_init_state only exists in InstanceKlass";
-        return UNSAFE.getByte(getMetaspaceKlass() + config().instanceKlassInitStateOffset) & 0xFF;
-    }
-
-    @Override
-    public void initialize() {
-        if (!isInitialized()) {
-            UNSAFE.ensureClassInitialized(mirror());
-            assert isInitialized();
-        }
-    }
-
-    @Override
-    public boolean isInstance(JavaConstant obj) {
-        if (obj.getJavaKind() == JavaKind.Object && !obj.isNull()) {
-            return mirror().isInstance(((HotSpotObjectConstantImpl) obj).object());
-        }
-        return false;
-    }
-
-    @Override
-    public boolean isInstanceClass() {
-        return !isArray() && !isInterface();
-    }
-
-    @Override
-    public boolean isInterface() {
-        return mirror().isInterface();
-    }
-
-    @Override
-    public boolean isAssignableFrom(ResolvedJavaType other) {
-        assert other != null;
-        if (other instanceof HotSpotResolvedObjectTypeImpl) {
-            HotSpotResolvedObjectTypeImpl otherType = (HotSpotResolvedObjectTypeImpl) other;
-            return mirror().isAssignableFrom(otherType.mirror());
-        }
-        return false;
-    }
-
-    @Override
-    public boolean isJavaLangObject() {
-        return javaClass.equals(Object.class);
-    }
-
-    @Override
-    public JavaKind getJavaKind() {
-        return JavaKind.Object;
-    }
-
-    @Override
-    public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType) {
-        assert !callerType.isArray();
-        if (isInterface()) {
-            // Methods can only be resolved against concrete types
-            return null;
-        }
-        if (method.isConcrete() && method.getDeclaringClass().equals(this) && method.isPublic() && !isSignaturePolymorphicHolder(method.getDeclaringClass())) {
-            return method;
-        }
-        if (!method.getDeclaringClass().isAssignableFrom(this)) {
-            return null;
-        }
-        HotSpotResolvedJavaMethodImpl hotSpotMethod = (HotSpotResolvedJavaMethodImpl) method;
-        HotSpotResolvedObjectTypeImpl hotSpotCallerType = (HotSpotResolvedObjectTypeImpl) callerType;
-        return compilerToVM().resolveMethod(this, hotSpotMethod, hotSpotCallerType);
-    }
-
-    public HotSpotConstantPool getConstantPool() {
-        if (constantPool == null || !isArray() && UNSAFE.getAddress(getMetaspaceKlass() + config().instanceKlassConstantsOffset) != constantPool.getMetaspaceConstantPool()) {
-            /*
-             * If the pointer to the ConstantPool has changed since this was last read refresh the
-             * HotSpotConstantPool wrapper object. This ensures that uses of the constant pool are
-             * operating on the latest one and that HotSpotResolvedJavaMethodImpls will be able to
-             * use the shared copy instead of creating their own instance.
-             */
-            constantPool = compilerToVM().getConstantPool(this);
-        }
-        return constantPool;
-    }
-
-    /**
-     * Gets the instance size of this type. If an instance of this type cannot be fast path
-     * allocated, then the returned value is negative (its absolute value gives the size). Must not
-     * be called if this is an array or interface type.
-     */
-    public int instanceSize() {
-        assert !isArray();
-        assert !isInterface();
-
-        HotSpotVMConfig config = config();
-        final int layoutHelper = layoutHelper();
-        assert layoutHelper > config.klassLayoutHelperNeutralValue : "must be instance";
-
-        // See: Klass::layout_helper_size_in_bytes
-        int size = layoutHelper & ~config.klassLayoutHelperInstanceSlowPathBit;
-
-        // See: Klass::layout_helper_needs_slow_path
-        boolean needsSlowPath = (layoutHelper & config.klassLayoutHelperInstanceSlowPathBit) != 0;
-
-        return needsSlowPath ? -size : size;
-    }
-
-    public int layoutHelper() {
-        HotSpotVMConfig config = config();
-        return UNSAFE.getInt(getMetaspaceKlass() + config.klassLayoutHelperOffset);
-    }
-
-    @Override
-    public long getFingerprint() {
-        return compilerToVM().getFingerprint(getMetaspaceKlass());
-    }
-
-    synchronized HotSpotResolvedJavaMethod createMethod(long metaspaceMethod) {
-        HotSpotResolvedJavaMethodImpl method = null;
-        if (methodCache == null) {
-            methodCache = new HashMap<>(8);
-        } else {
-            method = methodCache.get(metaspaceMethod);
-        }
-        if (method == null) {
-            method = new HotSpotResolvedJavaMethodImpl(this, metaspaceMethod);
-            methodCache.put(metaspaceMethod, method);
-            context.add(method);
-        }
-        return method;
-    }
-
-    public int getVtableLength() {
-        HotSpotVMConfig config = config();
-        if (isInterface() || isArray()) {
-            /* Everything has the core vtable of java.lang.Object */
-            return config.baseVtableLength();
-        }
-        int result = UNSAFE.getInt(getMetaspaceKlass() + config.klassVtableLengthOffset) / (config.vtableEntrySize / config.heapWordSize);
-        assert result >= config.baseVtableLength() : UNSAFE.getInt(getMetaspaceKlass() + config.klassVtableLengthOffset) + " " + config.vtableEntrySize;
-        return result;
-    }
-
-    synchronized HotSpotResolvedJavaField createField(String fieldName, JavaType type, long offset, int rawFlags) {
-        HotSpotResolvedJavaField result = null;
-
-        final int flags = rawFlags & HotSpotModifiers.jvmFieldModifiers();
-
-        final long id = offset + ((long) flags << 32);
-
-        // Must cache the fields, because the local load elimination only works if the
-        // objects from two field lookups are identical.
-        if (fieldCache == null) {
-            fieldCache = new HashMap<>(8);
-        } else {
-            result = fieldCache.get(id);
-        }
-
-        if (result == null) {
-            result = new HotSpotResolvedJavaFieldImpl(this, fieldName, type, offset, rawFlags);
-            fieldCache.put(id, result);
-        } else {
-            assert result.getName().equals(fieldName);
-            /*
-             * Comparing the types directly is too strict, because the type in the cache could be
-             * resolved while the incoming type is unresolved. The name comparison is sufficient
-             * because the type will always be resolved in the context of the holder.
-             */
-            assert result.getType().getName().equals(type.getName());
-            assert result.offset() == offset;
-            assert result.getModifiers() == flags;
-        }
-
-        return result;
-    }
-
-    @Override
-    public AssumptionResult<ResolvedJavaMethod> findUniqueConcreteMethod(ResolvedJavaMethod method) {
-        HotSpotResolvedJavaMethod hmethod = (HotSpotResolvedJavaMethod) method;
-        HotSpotResolvedObjectType declaredHolder = hmethod.getDeclaringClass();
-        /*
-         * Sometimes the receiver type in the graph hasn't stabilized to a subtype of declared
-         * holder, usually because of phis, so make sure that the type is related to the declared
-         * type before using it for lookup. Unlinked types should also be ignored because we can't
-         * resolve the proper method to invoke. Generally unlinked types in invokes should result in
-         * a deopt instead since they can't really be used if they aren't linked yet.
-         */
-        if (!declaredHolder.isAssignableFrom(this) || this.isArray() || this.equals(declaredHolder) || !isLinked() || isInterface()) {
-            ResolvedJavaMethod result = hmethod.uniqueConcreteMethod(declaredHolder);
-            if (result != null) {
-                return new AssumptionResult<>(result, new ConcreteMethod(method, declaredHolder, result));
-            }
-            return null;
-        }
-        /*
-         * The holder may be a subtype of the declaredHolder so make sure to resolve the method to
-         * the correct method for the subtype.
-         */
-        HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) resolveMethod(hmethod, this);
-        if (resolvedMethod == null) {
-            // The type isn't known to implement the method.
-            return null;
-        }
-
-        ResolvedJavaMethod result = resolvedMethod.uniqueConcreteMethod(this);
-        if (result != null) {
-            return new AssumptionResult<>(result, new ConcreteMethod(method, this, result));
-        }
-        return null;
-    }
-
-    /**
-     * This class represents the field information for one field contained in the fields array of an
-     * {@code InstanceKlass}. The implementation is similar to the native {@code FieldInfo} class.
-     */
-    private class FieldInfo {
-        /**
-         * Native pointer into the array of Java shorts.
-         */
-        private final long metaspaceData;
-
-        /**
-         * Creates a field info for the field in the fields array at index {@code index}.
-         *
-         * @param index index to the fields array
-         */
-        FieldInfo(int index) {
-            HotSpotVMConfig config = config();
-            // Get Klass::_fields
-            final long metaspaceFields = UNSAFE.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
-            assert config.fieldInfoFieldSlots == 6 : "revisit the field parsing code";
-            int offset = config.fieldInfoFieldSlots * Short.BYTES * index;
-            metaspaceData = metaspaceFields + config.arrayU2DataOffset + offset;
-        }
-
-        private int getAccessFlags() {
-            return readFieldSlot(config().fieldInfoAccessFlagsOffset);
-        }
-
-        private int getNameIndex() {
-            return readFieldSlot(config().fieldInfoNameIndexOffset);
-        }
-
-        private int getSignatureIndex() {
-            return readFieldSlot(config().fieldInfoSignatureIndexOffset);
-        }
-
-        public int getOffset() {
-            HotSpotVMConfig config = config();
-            final int lowPacked = readFieldSlot(config.fieldInfoLowPackedOffset);
-            final int highPacked = readFieldSlot(config.fieldInfoHighPackedOffset);
-            final int offset = ((highPacked << Short.SIZE) | lowPacked) >> config.fieldInfoTagSize;
-            return offset;
-        }
-
-        /**
-         * Helper method to read an entry (slot) from the field array. Currently field info is laid
-         * on top an array of Java shorts.
-         */
-        private int readFieldSlot(int index) {
-            int offset = Short.BYTES * index;
-            return UNSAFE.getChar(metaspaceData + offset);
-        }
-
-        /**
-         * Returns the name of this field as a {@link String}. If the field is an internal field the
-         * name index is pointing into the vmSymbols table.
-         */
-        public String getName() {
-            final int nameIndex = getNameIndex();
-            return isInternal() ? config().symbolAt(nameIndex) : getConstantPool().lookupUtf8(nameIndex);
-        }
-
-        /**
-         * Returns the signature of this field as {@link String}. If the field is an internal field
-         * the signature index is pointing into the vmSymbols table.
-         */
-        public String getSignature() {
-            final int signatureIndex = getSignatureIndex();
-            return isInternal() ? config().symbolAt(signatureIndex) : getConstantPool().lookupUtf8(signatureIndex);
-        }
-
-        public JavaType getType() {
-            String signature = getSignature();
-            return runtime().lookupType(signature, HotSpotResolvedObjectTypeImpl.this, false);
-        }
-
-        private boolean isInternal() {
-            return (getAccessFlags() & config().jvmAccFieldInternal) != 0;
-        }
-
-        public boolean isStatic() {
-            return Modifier.isStatic(getAccessFlags());
-        }
-
-        public boolean hasGenericSignature() {
-            return (getAccessFlags() & config().jvmAccFieldHasGenericSignature) != 0;
-        }
-    }
-
-    @SuppressFBWarnings(value = "SE_COMPARATOR_SHOULD_BE_SERIALIZABLE", justification = "comparator is only used transiently")
-    private static class OffsetComparator implements java.util.Comparator<HotSpotResolvedJavaField> {
-        @Override
-        public int compare(HotSpotResolvedJavaField o1, HotSpotResolvedJavaField o2) {
-            return o1.offset() - o2.offset();
-        }
-    }
-
-    @Override
-    public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses) {
-        if (instanceFields == null) {
-            if (isArray() || isInterface()) {
-                instanceFields = new HotSpotResolvedJavaField[0];
-            } else {
-                final int fieldCount = getFieldCount();
-                ArrayList<HotSpotResolvedJavaField> fieldsArray = new ArrayList<>(fieldCount);
-
-                for (int i = 0; i < fieldCount; i++) {
-                    FieldInfo field = new FieldInfo(i);
-
-                    // We are only interested in instance fields.
-                    if (!field.isStatic()) {
-                        HotSpotResolvedJavaField resolvedJavaField = createField(field.getName(), field.getType(), field.getOffset(), field.getAccessFlags());
-                        fieldsArray.add(resolvedJavaField);
-                    }
-                }
-
-                fieldsArray.sort(new OffsetComparator());
-
-                HotSpotResolvedJavaField[] myFields = fieldsArray.toArray(new HotSpotResolvedJavaField[0]);
-
-                if (mirror() != Object.class) {
-                    HotSpotResolvedJavaField[] superFields = (HotSpotResolvedJavaField[]) getSuperclass().getInstanceFields(true);
-                    HotSpotResolvedJavaField[] fields = Arrays.copyOf(superFields, superFields.length + myFields.length);
-                    System.arraycopy(myFields, 0, fields, superFields.length, myFields.length);
-                    instanceFields = fields;
-                } else {
-                    assert myFields.length == 0 : "java.lang.Object has fields!";
-                    instanceFields = myFields;
-                }
-
-            }
-        }
-        if (!includeSuperclasses) {
-            int myFieldsStart = 0;
-            while (myFieldsStart < instanceFields.length && !instanceFields[myFieldsStart].getDeclaringClass().equals(this)) {
-                myFieldsStart++;
-            }
-            if (myFieldsStart == 0) {
-                return instanceFields;
-            }
-            if (myFieldsStart == instanceFields.length) {
-                return new HotSpotResolvedJavaField[0];
-            }
-            return Arrays.copyOfRange(instanceFields, myFieldsStart, instanceFields.length);
-        }
-        return instanceFields;
-    }
-
-    @Override
-    public ResolvedJavaField[] getStaticFields() {
-        if (isArray()) {
-            return new HotSpotResolvedJavaField[0];
-        } else {
-            final int fieldCount = getFieldCount();
-            ArrayList<HotSpotResolvedJavaField> fieldsArray = new ArrayList<>(fieldCount);
-
-            for (int i = 0; i < fieldCount; i++) {
-                FieldInfo field = new FieldInfo(i);
-
-                // We are only interested in static fields.
-                if (field.isStatic()) {
-                    HotSpotResolvedJavaField resolvedJavaField = createField(field.getName(), field.getType(), field.getOffset(), field.getAccessFlags());
-                    fieldsArray.add(resolvedJavaField);
-                }
-            }
-
-            fieldsArray.sort(new OffsetComparator());
-            return fieldsArray.toArray(new HotSpotResolvedJavaField[fieldsArray.size()]);
-        }
-    }
-
-    /**
-     * Returns the actual field count of this class's internal {@code InstanceKlass::_fields} array
-     * by walking the array and discounting the generic signature slots at the end of the array.
-     *
-     * <p>
-     * See {@code FieldStreamBase::init_generic_signature_start_slot}
-     */
-    private int getFieldCount() {
-        HotSpotVMConfig config = config();
-        final long metaspaceFields = UNSAFE.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
-        int metaspaceFieldsLength = UNSAFE.getInt(metaspaceFields + config.arrayU1LengthOffset);
-        int fieldCount = 0;
-
-        for (int i = 0, index = 0; i < metaspaceFieldsLength; i += config.fieldInfoFieldSlots, index++) {
-            FieldInfo field = new FieldInfo(index);
-            if (field.hasGenericSignature()) {
-                metaspaceFieldsLength--;
-            }
-            fieldCount++;
-        }
-        return fieldCount;
-    }
-
-    @Override
-    public Class<?> mirror() {
-        return javaClass;
-    }
-
-    @Override
-    public String getSourceFileName() {
-        HotSpotVMConfig config = config();
-        final int sourceFileNameIndex = UNSAFE.getChar(getMetaspaceKlass() + config.instanceKlassSourceFileNameIndexOffset);
-        if (sourceFileNameIndex == 0) {
-            return null;
-        }
-        return getConstantPool().lookupUtf8(sourceFileNameIndex);
-    }
-
-    @Override
-    public Annotation[] getAnnotations() {
-        return mirror().getAnnotations();
-    }
-
-    @Override
-    public Annotation[] getDeclaredAnnotations() {
-        return mirror().getDeclaredAnnotations();
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        return mirror().getAnnotation(annotationClass);
-    }
-
-    /**
-     * Performs a fast-path check that this type is resolved in the context of a given accessing
-     * class. A negative result does not mean this type is not resolved with respect to
-     * {@code accessingClass}. That can only be determined by
-     * {@linkplain HotSpotJVMCIRuntime#lookupType(String, HotSpotResolvedObjectType, boolean)
-     * re-resolving} the type.
-     */
-    public boolean isDefinitelyResolvedWithRespectTo(ResolvedJavaType accessingClass) {
-        assert accessingClass != null;
-        ResolvedJavaType elementType = getElementalType();
-        if (elementType.isPrimitive()) {
-            // Primitive type resolution is context free.
-            return true;
-        }
-        if (elementType.getName().startsWith("Ljava/")) {
-            // Classes in a java.* package can only be defined by the
-            // boot class loader. This is enforced by ClassLoader.preDefineClass()
-            assert mirror().getClassLoader() == null;
-            return true;
-        }
-        ClassLoader thisCl = mirror().getClassLoader();
-        ClassLoader accessingClassCl = ((HotSpotResolvedObjectTypeImpl) accessingClass).mirror().getClassLoader();
-        return thisCl == accessingClassCl;
-    }
-
-    @Override
-    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
-        if (isDefinitelyResolvedWithRespectTo(requireNonNull(accessingClass))) {
-            return this;
-        }
-        HotSpotResolvedObjectTypeImpl accessingType = (HotSpotResolvedObjectTypeImpl) accessingClass;
-        return (ResolvedJavaType) runtime().lookupType(getName(), accessingType, true);
-    }
-
-    /**
-     * Gets the metaspace Klass boxed in a {@link JavaConstant}.
-     */
-    public Constant klass() {
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(this, false);
-    }
-
-    public boolean isPrimaryType() {
-        return config().secondarySuperCacheOffset != superCheckOffset();
-    }
-
-    public int superCheckOffset() {
-        HotSpotVMConfig config = config();
-        return UNSAFE.getInt(getMetaspaceKlass() + config.superCheckOffsetOffset);
-    }
-
-    public long prototypeMarkWord() {
-        HotSpotVMConfig config = config();
-        if (isArray()) {
-            return config.arrayPrototypeMarkWord();
-        } else {
-            return UNSAFE.getAddress(getMetaspaceKlass() + config.prototypeMarkWordOffset);
-        }
-    }
-
-    @Override
-    public ResolvedJavaField findInstanceFieldWithOffset(long offset, JavaKind expectedEntryKind) {
-        ResolvedJavaField[] declaredFields = getInstanceFields(true);
-        for (ResolvedJavaField field : declaredFields) {
-            HotSpotResolvedJavaField resolvedField = (HotSpotResolvedJavaField) field;
-            long resolvedFieldOffset = resolvedField.offset();
-            // @formatter:off
-            if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN  &&
-                            expectedEntryKind.isPrimitive() &&
-                            !expectedEntryKind.equals(JavaKind.Void) &&
-                            resolvedField.getJavaKind().isPrimitive()) {
-                resolvedFieldOffset +=
-                                resolvedField.getJavaKind().getByteCount() -
-                                Math.min(resolvedField.getJavaKind().getByteCount(), 4 + expectedEntryKind.getByteCount());
-            }
-            if (resolvedFieldOffset == offset) {
-                return field;
-            }
-            // @formatter:on
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isLocal() {
-        return mirror().isLocalClass();
-    }
-
-    @Override
-    public boolean isMember() {
-        return mirror().isMemberClass();
-    }
-
-    @Override
-    public HotSpotResolvedObjectTypeImpl getEnclosingType() {
-        final Class<?> encl = mirror().getEnclosingClass();
-        return encl == null ? null : fromObjectClass(encl);
-    }
-
-    @Override
-    public ResolvedJavaMethod[] getDeclaredConstructors() {
-        Constructor<?>[] constructors = mirror().getDeclaredConstructors();
-        ResolvedJavaMethod[] result = new ResolvedJavaMethod[constructors.length];
-        for (int i = 0; i < constructors.length; i++) {
-            result[i] = runtime().getHostJVMCIBackend().getMetaAccess().lookupJavaMethod(constructors[i]);
-            assert result[i].isConstructor();
-        }
-        return result;
-    }
-
-    @Override
-    public ResolvedJavaMethod[] getDeclaredMethods() {
-        Method[] methods = mirror().getDeclaredMethods();
-        ResolvedJavaMethod[] result = new ResolvedJavaMethod[methods.length];
-        for (int i = 0; i < methods.length; i++) {
-            result[i] = runtime().getHostJVMCIBackend().getMetaAccess().lookupJavaMethod(methods[i]);
-            assert !result[i].isConstructor();
-        }
-        return result;
-    }
-
-    public ResolvedJavaMethod getClassInitializer() {
-        return compilerToVM().getClassInitializer(this);
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotType<" + getName() + ", resolved>";
-    }
-
-    @Override
-    public boolean isCloneableWithAllocation() {
-        return (getAccessFlags() & config().jvmAccIsCloneableFast) != 0;
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
deleted file mode 100644
index c598f8a..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
-import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
-
-import jdk.internal.misc.Unsafe;
-
-/**
- * Used to access native configuration details.
- *
- * All non-static, public fields in this class are so that they can be compiled as constants.
- */
-class HotSpotVMConfig extends HotSpotVMConfigAccess {
-
-    /**
-     * Gets the configuration associated with the singleton {@link HotSpotJVMCIRuntime}.
-     */
-    static HotSpotVMConfig config() {
-        return runtime().getConfig();
-    }
-
-    private final String osArch = getHostArchitectureName();
-
-    HotSpotVMConfig(HotSpotVMConfigStore store) {
-        super(store);
-    }
-
-    /**
-     * Gets the host architecture name for the purpose of finding the corresponding
-     * {@linkplain HotSpotJVMCIBackendFactory backend}.
-     */
-    String getHostArchitectureName() {
-        String arch = System.getProperty("os.arch");
-        switch (arch) {
-            case "x86_64":
-                return "amd64";
-
-            case "sparcv9":
-                return "sparc";
-            default:
-                return arch;
-        }
-    }
-
-    final boolean useDeferredInitBarriers = getFlag("ReduceInitialCardMarks", Boolean.class);
-
-    final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
-
-    final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, "markOop");
-    final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*");
-    final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*");
-    final int superCheckOffsetOffset = getFieldOffset("Klass::_super_check_offset", Integer.class, "juint");
-    final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*");
-
-    /**
-     * The offset of the _java_mirror field (of type {@link Class}) in a Klass.
-     */
-    final int classMirrorOffset = getFieldOffset("Klass::_java_mirror", Integer.class, "oop");
-
-    final int klassAccessFlagsOffset = getFieldOffset("Klass::_access_flags", Integer.class, "AccessFlags");
-    final int klassLayoutHelperOffset = getFieldOffset("Klass::_layout_helper", Integer.class, "jint");
-
-    final int klassLayoutHelperNeutralValue = getConstant("Klass::_lh_neutral_value", Integer.class);
-    final int klassLayoutHelperInstanceSlowPathBit = getConstant("Klass::_lh_instance_slow_path_bit", Integer.class);
-
-    final int vtableEntrySize = getTypeSize("vtableEntry");
-    final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*");
-
-    final int instanceKlassSourceFileNameIndexOffset = getFieldOffset("InstanceKlass::_source_file_name_index", Integer.class, "u2");
-    final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1");
-    final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*");
-    final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*");
-    final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int");
-    final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int");
-
-    final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class);
-    final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class);
-
-    final int arrayU1LengthOffset = getFieldOffset("Array<int>::_length", Integer.class, "int");
-    final int arrayU1DataOffset = getFieldOffset("Array<u1>::_data", Integer.class);
-    final int arrayU2DataOffset = getFieldOffset("Array<u2>::_data", Integer.class);
-
-    final int fieldInfoAccessFlagsOffset = getConstant("FieldInfo::access_flags_offset", Integer.class);
-    final int fieldInfoNameIndexOffset = getConstant("FieldInfo::name_index_offset", Integer.class);
-    final int fieldInfoSignatureIndexOffset = getConstant("FieldInfo::signature_index_offset", Integer.class);
-    final int fieldInfoLowPackedOffset = getConstant("FieldInfo::low_packed_offset", Integer.class);
-    final int fieldInfoHighPackedOffset = getConstant("FieldInfo::high_packed_offset", Integer.class);
-    final int fieldInfoFieldSlots = getConstant("FieldInfo::field_slots", Integer.class);
-
-    final int fieldInfoTagSize = getConstant("FIELDINFO_TAG_SIZE", Integer.class);
-
-    final int jvmAccHasFinalizer = getConstant("JVM_ACC_HAS_FINALIZER", Integer.class);
-    final int jvmAccFieldInternal = getConstant("JVM_ACC_FIELD_INTERNAL", Integer.class);
-    final int jvmAccFieldStable = getConstant("JVM_ACC_FIELD_STABLE", Integer.class);
-    final int jvmAccFieldHasGenericSignature = getConstant("JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE", Integer.class);
-    final int jvmAccIsCloneableFast = getConstant("JVM_ACC_IS_CLONEABLE_FAST", Integer.class);
-
-    // These modifiers are not public in Modifier so we get them via vmStructs.
-    final int jvmAccSynthetic = getConstant("JVM_ACC_SYNTHETIC", Integer.class);
-    final int jvmAccAnnotation = getConstant("JVM_ACC_ANNOTATION", Integer.class);
-    final int jvmAccBridge = getConstant("JVM_ACC_BRIDGE", Integer.class);
-    final int jvmAccVarargs = getConstant("JVM_ACC_VARARGS", Integer.class);
-    final int jvmAccEnum = getConstant("JVM_ACC_ENUM", Integer.class);
-
-    // This is only valid on AMD64.
-    final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, osArch.equals("amd64") ? null : 0);
-
-    private final int markWordNoHashInPlace = getConstant("markOopDesc::no_hash_in_place", Integer.class);
-    private final int markWordNoLockInPlace = getConstant("markOopDesc::no_lock_in_place", Integer.class);
-
-    /**
-     * See {@code markOopDesc::prototype()}.
-     */
-    long arrayPrototypeMarkWord() {
-        return markWordNoHashInPlace | markWordNoLockInPlace;
-    }
-
-    final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags");
-    final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*");
-    final int methodIntrinsicIdOffset = getFieldOffset("Method::_intrinsic_id", Integer.class, "u2");
-    final int methodFlagsOffset = getFieldOffset("Method::_flags", Integer.class, "u2");
-    final int methodVtableIndexOffset = getFieldOffset("Method::_vtable_index", Integer.class, "int");
-
-    final int methodDataOffset = getFieldOffset("Method::_method_data", Integer.class, "MethodData*");
-    final int methodCodeOffset = getFieldOffset("Method::_code", Integer.class, "CompiledMethod*");
-
-    final int methodFlagsCallerSensitive = getConstant("Method::_caller_sensitive", Integer.class);
-    final int methodFlagsForceInline = getConstant("Method::_force_inline", Integer.class);
-    final int methodFlagsIntrinsicCandidate = getConstant("Method::_intrinsic_candidate", Integer.class);
-    final int methodFlagsDontInline = getConstant("Method::_dont_inline", Integer.class);
-    final int methodFlagsReservedStackAccess = getConstant("Method::_reserved_stack_access", Integer.class);
-    final int nonvirtualVtableIndex = getConstant("Method::nonvirtual_vtable_index", Integer.class);
-    final int invalidVtableIndex = getConstant("Method::invalid_vtable_index", Integer.class);
-
-    final int methodDataSize = getFieldOffset("MethodData::_size", Integer.class, "int");
-    final int methodDataDataSize = getFieldOffset("MethodData::_data_size", Integer.class, "int");
-    final int methodDataOopDataOffset = getFieldOffset("MethodData::_data[0]", Integer.class, "intptr_t");
-    final int methodDataOopTrapHistoryOffset = getFieldOffset("MethodData::_trap_hist._array[0]", Integer.class, "u1");
-    final int methodDataIRSizeOffset = getFieldOffset("MethodData::_jvmci_ir_size", Integer.class, "int");
-
-    final int methodDataDecompiles = getFieldOffset("MethodData::_nof_decompiles", Integer.class, "uint");
-    final int methodDataOverflowRecompiles = getFieldOffset("MethodData::_nof_overflow_recompiles", Integer.class, "uint");
-    final int methodDataOverflowTraps = getFieldOffset("MethodData::_nof_overflow_traps", Integer.class, "uint");
-
-    final int nmethodCompLevelOffset = getFieldOffset("nmethod::_comp_level", Integer.class, "int");
-
-    final int compilationLevelNone = getConstant("CompLevel_none", Integer.class);
-    final int compilationLevelSimple = getConstant("CompLevel_simple", Integer.class);
-    final int compilationLevelLimitedProfile = getConstant("CompLevel_limited_profile", Integer.class);
-    final int compilationLevelFullProfile = getConstant("CompLevel_full_profile", Integer.class);
-    final int compilationLevelFullOptimization = getConstant("CompLevel_full_optimization", Integer.class);
-
-    final int compLevelAdjustmentNone = getConstant("JVMCIRuntime::none", Integer.class);
-    final int compLevelAdjustmentByHolder = getConstant("JVMCIRuntime::by_holder", Integer.class);
-    final int compLevelAdjustmentByFullSignature = getConstant("JVMCIRuntime::by_full_signature", Integer.class);
-
-    final int invocationEntryBci = getConstant("InvocationEntryBci", Integer.class);
-
-    final int extraStackEntries = getFieldValue("CompilerToVM::Data::Method_extra_stack_entries", Integer.class, "int");
-
-    final int constMethodConstantsOffset = getFieldOffset("ConstMethod::_constants", Integer.class, "ConstantPool*");
-    final int constMethodFlagsOffset = getFieldOffset("ConstMethod::_flags", Integer.class, "u2");
-    final int constMethodCodeSizeOffset = getFieldOffset("ConstMethod::_code_size", Integer.class, "u2");
-    final int constMethodNameIndexOffset = getFieldOffset("ConstMethod::_name_index", Integer.class, "u2");
-    final int constMethodSignatureIndexOffset = getFieldOffset("ConstMethod::_signature_index", Integer.class, "u2");
-    final int constMethodMaxStackOffset = getFieldOffset("ConstMethod::_max_stack", Integer.class, "u2");
-    final int methodMaxLocalsOffset = getFieldOffset("ConstMethod::_max_locals", Integer.class, "u2");
-
-    final int constMethodHasLineNumberTable = getConstant("ConstMethod::_has_linenumber_table", Integer.class);
-    final int constMethodHasLocalVariableTable = getConstant("ConstMethod::_has_localvariable_table", Integer.class);
-    final int constMethodHasExceptionTable = getConstant("ConstMethod::_has_exception_table", Integer.class);
-
-    final int exceptionTableElementSize = getTypeSize("ExceptionTableElement");
-    final int exceptionTableElementStartPcOffset = getFieldOffset("ExceptionTableElement::start_pc", Integer.class, "u2");
-    final int exceptionTableElementEndPcOffset = getFieldOffset("ExceptionTableElement::end_pc", Integer.class, "u2");
-    final int exceptionTableElementHandlerPcOffset = getFieldOffset("ExceptionTableElement::handler_pc", Integer.class, "u2");
-    final int exceptionTableElementCatchTypeIndexOffset = getFieldOffset("ExceptionTableElement::catch_type_index", Integer.class, "u2");
-
-    final int localVariableTableElementSize = getTypeSize("LocalVariableTableElement");
-    final int localVariableTableElementStartBciOffset = getFieldOffset("LocalVariableTableElement::start_bci", Integer.class, "u2");
-    final int localVariableTableElementLengthOffset = getFieldOffset("LocalVariableTableElement::length", Integer.class, "u2");
-    final int localVariableTableElementNameCpIndexOffset = getFieldOffset("LocalVariableTableElement::name_cp_index", Integer.class, "u2");
-    final int localVariableTableElementDescriptorCpIndexOffset = getFieldOffset("LocalVariableTableElement::descriptor_cp_index", Integer.class, "u2");
-    final int localVariableTableElementSlotOffset = getFieldOffset("LocalVariableTableElement::slot", Integer.class, "u2");
-
-    final int constantPoolSize = getTypeSize("ConstantPool");
-    final int constantPoolTagsOffset = getFieldOffset("ConstantPool::_tags", Integer.class, "Array<u1>*");
-    final int constantPoolHolderOffset = getFieldOffset("ConstantPool::_pool_holder", Integer.class, "InstanceKlass*");
-    final int constantPoolLengthOffset = getFieldOffset("ConstantPool::_length", Integer.class, "int");
-
-    final int constantPoolCpCacheIndexTag = getConstant("ConstantPool::CPCACHE_INDEX_TAG", Integer.class);
-
-    final int jvmConstantUtf8 = getConstant("JVM_CONSTANT_Utf8", Integer.class);
-    final int jvmConstantInteger = getConstant("JVM_CONSTANT_Integer", Integer.class);
-    final int jvmConstantLong = getConstant("JVM_CONSTANT_Long", Integer.class);
-    final int jvmConstantFloat = getConstant("JVM_CONSTANT_Float", Integer.class);
-    final int jvmConstantDouble = getConstant("JVM_CONSTANT_Double", Integer.class);
-    final int jvmConstantClass = getConstant("JVM_CONSTANT_Class", Integer.class);
-    final int jvmConstantUnresolvedClass = getConstant("JVM_CONSTANT_UnresolvedClass", Integer.class);
-    final int jvmConstantUnresolvedClassInError = getConstant("JVM_CONSTANT_UnresolvedClassInError", Integer.class);
-    final int jvmConstantString = getConstant("JVM_CONSTANT_String", Integer.class);
-    final int jvmConstantFieldref = getConstant("JVM_CONSTANT_Fieldref", Integer.class);
-    final int jvmConstantMethodref = getConstant("JVM_CONSTANT_Methodref", Integer.class);
-    final int jvmConstantInterfaceMethodref = getConstant("JVM_CONSTANT_InterfaceMethodref", Integer.class);
-    final int jvmConstantNameAndType = getConstant("JVM_CONSTANT_NameAndType", Integer.class);
-    final int jvmConstantMethodHandle = getConstant("JVM_CONSTANT_MethodHandle", Integer.class);
-    final int jvmConstantMethodHandleInError = getConstant("JVM_CONSTANT_MethodHandleInError", Integer.class);
-    final int jvmConstantMethodType = getConstant("JVM_CONSTANT_MethodType", Integer.class);
-    final int jvmConstantMethodTypeInError = getConstant("JVM_CONSTANT_MethodTypeInError", Integer.class);
-    final int jvmConstantInvokeDynamic = getConstant("JVM_CONSTANT_InvokeDynamic", Integer.class);
-
-    final int jvmConstantExternalMax = getConstant("JVM_CONSTANT_ExternalMax", Integer.class);
-    final int jvmConstantInternalMin = getConstant("JVM_CONSTANT_InternalMin", Integer.class);
-    final int jvmConstantInternalMax = getConstant("JVM_CONSTANT_InternalMax", Integer.class);
-
-    final int heapWordSize = getConstant("HeapWordSize", Integer.class);
-
-    final int symbolPointerSize = getTypeSize("Symbol*");
-
-    final long vmSymbolsSymbols = getFieldAddress("vmSymbols::_symbols[0]", "Symbol*");
-    final int vmSymbolsFirstSID = getConstant("vmSymbols::FIRST_SID", Integer.class);
-    final int vmSymbolsSIDLimit = getConstant("vmSymbols::SID_LIMIT", Integer.class);
-
-    /**
-     * Returns the symbol in the {@code vmSymbols} table at position {@code index} as a
-     * {@link String}.
-     *
-     * @param index position in the symbol table
-     * @return the symbol at position id
-     */
-    String symbolAt(int index) {
-        HotSpotJVMCIRuntimeProvider runtime = runtime();
-        assert vmSymbolsFirstSID <= index && index < vmSymbolsSIDLimit : "index " + index + " is out of bounds";
-        assert symbolPointerSize == Unsafe.ADDRESS_SIZE : "the following address read is broken";
-        int offset = index * symbolPointerSize;
-        return runtime.getCompilerToVM().getSymbol(UNSAFE.getAddress(vmSymbolsSymbols + offset));
-    }
-
-    final int universeBaseVtableSize = getFieldValue("CompilerToVM::Data::Universe_base_vtable_size", Integer.class, "int");
-
-    final int baseVtableLength() {
-        return universeBaseVtableSize / (vtableEntrySize / heapWordSize);
-    }
-
-    final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int");
-
-    /**
-     * The DataLayout header size is the same as the cell size.
-     */
-    final int dataLayoutHeaderSize = getConstant("DataLayout::cell_size", Integer.class);
-    final int dataLayoutTagOffset = getFieldOffset("DataLayout::_header._struct._tag", Integer.class, "u1");
-    final int dataLayoutFlagsOffset = getFieldOffset("DataLayout::_header._struct._flags", Integer.class, "u1");
-    final int dataLayoutBCIOffset = getFieldOffset("DataLayout::_header._struct._bci", Integer.class, "u2");
-    final int dataLayoutCellSize = getConstant("DataLayout::cell_size", Integer.class);
-
-    final int dataLayoutNoTag = getConstant("DataLayout::no_tag", Integer.class);
-    final int dataLayoutBitDataTag = getConstant("DataLayout::bit_data_tag", Integer.class);
-    final int dataLayoutCounterDataTag = getConstant("DataLayout::counter_data_tag", Integer.class);
-    final int dataLayoutJumpDataTag = getConstant("DataLayout::jump_data_tag", Integer.class);
-    final int dataLayoutReceiverTypeDataTag = getConstant("DataLayout::receiver_type_data_tag", Integer.class);
-    final int dataLayoutVirtualCallDataTag = getConstant("DataLayout::virtual_call_data_tag", Integer.class);
-    final int dataLayoutRetDataTag = getConstant("DataLayout::ret_data_tag", Integer.class);
-    final int dataLayoutBranchDataTag = getConstant("DataLayout::branch_data_tag", Integer.class);
-    final int dataLayoutMultiBranchDataTag = getConstant("DataLayout::multi_branch_data_tag", Integer.class);
-    final int dataLayoutArgInfoDataTag = getConstant("DataLayout::arg_info_data_tag", Integer.class);
-    final int dataLayoutCallTypeDataTag = getConstant("DataLayout::call_type_data_tag", Integer.class);
-    final int dataLayoutVirtualCallTypeDataTag = getConstant("DataLayout::virtual_call_type_data_tag", Integer.class);
-    final int dataLayoutParametersTypeDataTag = getConstant("DataLayout::parameters_type_data_tag", Integer.class);
-    final int dataLayoutSpeculativeTrapDataTag = getConstant("DataLayout::speculative_trap_data_tag", Integer.class);
-
-    final int bciProfileWidth = getFlag("BciProfileWidth", Integer.class);
-    final int typeProfileWidth = getFlag("TypeProfileWidth", Integer.class);
-    final int methodProfileWidth = getFlag("MethodProfileWidth", Integer.class);
-
-    final int deoptReasonNone = getConstant("Deoptimization::Reason_none", Integer.class);
-    final int deoptReasonNullCheck = getConstant("Deoptimization::Reason_null_check", Integer.class);
-    final int deoptReasonRangeCheck = getConstant("Deoptimization::Reason_range_check", Integer.class);
-    final int deoptReasonClassCheck = getConstant("Deoptimization::Reason_class_check", Integer.class);
-    final int deoptReasonArrayCheck = getConstant("Deoptimization::Reason_array_check", Integer.class);
-    final int deoptReasonUnreached0 = getConstant("Deoptimization::Reason_unreached0", Integer.class);
-    final int deoptReasonTypeCheckInlining = getConstant("Deoptimization::Reason_type_checked_inlining", Integer.class);
-    final int deoptReasonOptimizedTypeCheck = getConstant("Deoptimization::Reason_optimized_type_check", Integer.class);
-    final int deoptReasonNotCompiledExceptionHandler = getConstant("Deoptimization::Reason_not_compiled_exception_handler", Integer.class);
-    final int deoptReasonUnresolved = getConstant("Deoptimization::Reason_unresolved", Integer.class);
-    final int deoptReasonJsrMismatch = getConstant("Deoptimization::Reason_jsr_mismatch", Integer.class);
-    final int deoptReasonDiv0Check = getConstant("Deoptimization::Reason_div0_check", Integer.class);
-    final int deoptReasonConstraint = getConstant("Deoptimization::Reason_constraint", Integer.class);
-    final int deoptReasonLoopLimitCheck = getConstant("Deoptimization::Reason_loop_limit_check", Integer.class);
-    final int deoptReasonAliasing = getConstant("Deoptimization::Reason_aliasing", Integer.class);
-    final int deoptReasonTransferToInterpreter = getConstant("Deoptimization::Reason_transfer_to_interpreter", Integer.class);
-    final int deoptReasonOSROffset = getConstant("Deoptimization::Reason_LIMIT", Integer.class);
-
-    final int deoptActionNone = getConstant("Deoptimization::Action_none", Integer.class);
-    final int deoptActionMaybeRecompile = getConstant("Deoptimization::Action_maybe_recompile", Integer.class);
-    final int deoptActionReinterpret = getConstant("Deoptimization::Action_reinterpret", Integer.class);
-    final int deoptActionMakeNotEntrant = getConstant("Deoptimization::Action_make_not_entrant", Integer.class);
-    final int deoptActionMakeNotCompilable = getConstant("Deoptimization::Action_make_not_compilable", Integer.class);
-
-    final int deoptimizationActionBits = getConstant("Deoptimization::_action_bits", Integer.class);
-    final int deoptimizationReasonBits = getConstant("Deoptimization::_reason_bits", Integer.class);
-    final int deoptimizationDebugIdBits = getConstant("Deoptimization::_debug_id_bits", Integer.class);
-    final int deoptimizationActionShift = getConstant("Deoptimization::_action_shift", Integer.class);
-    final int deoptimizationReasonShift = getConstant("Deoptimization::_reason_shift", Integer.class);
-    final int deoptimizationDebugIdShift = getConstant("Deoptimization::_debug_id_shift", Integer.class);
-
-    final int vmIntrinsicInvokeBasic = getConstant("vmIntrinsics::_invokeBasic", Integer.class);
-    final int vmIntrinsicLinkToVirtual = getConstant("vmIntrinsics::_linkToVirtual", Integer.class);
-    final int vmIntrinsicLinkToStatic = getConstant("vmIntrinsics::_linkToStatic", Integer.class);
-    final int vmIntrinsicLinkToSpecial = getConstant("vmIntrinsics::_linkToSpecial", Integer.class);
-    final int vmIntrinsicLinkToInterface = getConstant("vmIntrinsics::_linkToInterface", Integer.class);
-
-    final int codeInstallResultOk = getConstant("JVMCIEnv::ok", Integer.class);
-    final int codeInstallResultDependenciesFailed = getConstant("JVMCIEnv::dependencies_failed", Integer.class);
-    final int codeInstallResultDependenciesInvalid = getConstant("JVMCIEnv::dependencies_invalid", Integer.class);
-    final int codeInstallResultCacheFull = getConstant("JVMCIEnv::cache_full", Integer.class);
-    final int codeInstallResultCodeTooLarge = getConstant("JVMCIEnv::code_too_large", Integer.class);
-
-    String getCodeInstallResultDescription(int codeInstallResult) {
-        if (codeInstallResult == codeInstallResultOk) {
-            return "ok";
-        }
-        if (codeInstallResult == codeInstallResultDependenciesFailed) {
-            return "dependencies failed";
-        }
-        if (codeInstallResult == codeInstallResultDependenciesInvalid) {
-            return "dependencies invalid";
-        }
-        if (codeInstallResult == codeInstallResultCacheFull) {
-            return "code cache is full";
-        }
-        if (codeInstallResult == codeInstallResultCodeTooLarge) {
-            return "code is too large";
-        }
-        assert false : codeInstallResult;
-        return "unknown";
-    }
-
-    final int bitDataExceptionSeenFlag = getConstant("BitData::exception_seen_flag", Integer.class);
-    final int bitDataNullSeenFlag = getConstant("BitData::null_seen_flag", Integer.class);
-    final int methodDataCountOffset = getConstant("CounterData::count_off", Integer.class);
-    final int jumpDataTakenOffset = getConstant("JumpData::taken_off_set", Integer.class);
-    final int jumpDataDisplacementOffset = getConstant("JumpData::displacement_off_set", Integer.class);
-    final int receiverTypeDataNonprofiledCountOffset = getConstant("ReceiverTypeData::nonprofiled_count_off_set", Integer.class);
-    final int receiverTypeDataReceiverTypeRowCellCount = getConstant("ReceiverTypeData::receiver_type_row_cell_count", Integer.class);
-    final int receiverTypeDataReceiver0Offset = getConstant("ReceiverTypeData::receiver0_offset", Integer.class);
-    final int receiverTypeDataCount0Offset = getConstant("ReceiverTypeData::count0_offset", Integer.class);
-    final int branchDataNotTakenOffset = getConstant("BranchData::not_taken_off_set", Integer.class);
-    final int arrayDataArrayLenOffset = getConstant("ArrayData::array_len_off_set", Integer.class);
-    final int arrayDataArrayStartOffset = getConstant("ArrayData::array_start_off_set", Integer.class);
-    final int multiBranchDataPerCaseCellCount = getConstant("MultiBranchData::per_case_cell_count", Integer.class);
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java
deleted file mode 100644
index 9bb538d..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import jdk.vm.ci.common.JVMCIError;
-
-/**
- * Access to VM configuration data.
- */
-public class HotSpotVMConfigAccess {
-
-    /**
-     * Gets the available configuration data.
-     */
-    public HotSpotVMConfigStore getStore() {
-        return store;
-    }
-
-    /**
-     * Gets the address of a C++ symbol.
-     *
-     * @param name name of C++ symbol
-     * @param notPresent if non-null and the symbol is not present then this value is returned
-     * @return the address of the symbol
-     * @throws JVMCIError if the symbol is not present and {@code notPresent == null}
-     */
-    public long getAddress(String name, Long notPresent) {
-        Long entry = store.vmAddresses.get(name);
-        if (entry == null) {
-            if (notPresent != null) {
-                return notPresent;
-            }
-            throw new JVMCIError("expected VM symbol not found: " + name);
-        }
-        return entry;
-    }
-
-    /**
-     * Gets the address of a C++ symbol.
-     *
-     * @param name name of C++ symbol
-     * @return the address of the symbol
-     * @throws JVMCIError if the symbol is not present
-     */
-    public long getAddress(String name) {
-        return getAddress(name, null);
-    }
-
-    /**
-     * Gets the size of a C++ type.
-     *
-     * @param name name of the type
-     * @return the size in bytes of the requested field
-     * @throws JVMCIError if the field is not present and {@code notPresent} is null
-     */
-    public int getTypeSize(String name) {
-        Long entry = store.vmTypeSizes.get(name);
-        if (entry == null) {
-            throw new JVMCIError("expected VM type not found: " + name);
-        }
-        return (int) (long) entry;
-    }
-
-    /**
-     * Gets the value of a C++ constant.
-     *
-     * @param name name of the constant (e.g., {@code "frame::arg_reg_save_area_bytes"})
-     * @param type the boxed type to which the constant value will be converted
-     * @param notPresent if non-null and the constant is not present then this value is returned
-     * @return the constant value converted to {@code type}
-     * @throws JVMCIError if the constant is not present and {@code notPresent == null}
-     */
-    public <T> T getConstant(String name, Class<T> type, T notPresent) {
-        Long c = store.vmConstants.get(name);
-        if (c == null) {
-            if (notPresent != null) {
-                return notPresent;
-            }
-            throw new JVMCIError("expected VM constant not found: " + name);
-        }
-        return type.cast(convertValue(name, type, c, null));
-    }
-
-    /**
-     * Gets the value of a C++ constant.
-     *
-     * @param name name of the constant (e.g., {@code "frame::arg_reg_save_area_bytes"})
-     * @param type the boxed type to which the constant value will be converted
-     * @return the constant value converted to {@code type}
-     * @throws JVMCIError if the constant is not present
-     */
-    public <T> T getConstant(String name, Class<T> type) {
-        return getConstant(name, type, null);
-    }
-
-    /**
-     * Gets the offset of a non-static C++ field.
-     *
-     * @param name fully qualified name of the field
-     * @param type the boxed type to which the offset value will be converted (must be
-     *            {@link Integer} or {@link Long})
-     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
-     * @param notPresent if non-null and the field is not present then this value is returned
-     * @return the offset in bytes of the requested field
-     * @throws JVMCIError if the field is static or not present and {@code notPresent} is null
-     */
-    public <T> T getFieldOffset(String name, Class<T> type, String cppType, T notPresent) {
-        assert type == Integer.class || type == Long.class;
-        VMField entry = getField(name, cppType, notPresent == null);
-        if (entry == null) {
-            return notPresent;
-        }
-        if (entry.address != 0) {
-            throw new JVMCIError("cannot get offset of static field " + name);
-        }
-        return type.cast(convertValue(name, type, entry.offset, cppType));
-    }
-
-    /**
-     * Gets the offset of a non-static C++ field.
-     *
-     * @param name fully qualified name of the field
-     * @param type the boxed type to which the offset value will be converted (must be
-     *            {@link Integer} or {@link Long})
-     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
-     * @return the offset in bytes of the requested field
-     * @throws JVMCIError if the field is static or not present
-     */
-    public <T> T getFieldOffset(String name, Class<T> type, String cppType) {
-        return getFieldOffset(name, type, cppType, null);
-    }
-
-    /**
-     * Gets the offset of a non-static C++ field.
-     *
-     * @param name fully qualified name of the field
-     * @param type the boxed type to which the offset value will be converted (must be
-     *            {@link Integer} or {@link Long})
-     * @return the offset in bytes of the requested field
-     * @throws JVMCIError if the field is static or not present
-     */
-    public <T> T getFieldOffset(String name, Class<T> type) {
-        return getFieldOffset(name, type, null, null);
-    }
-
-    /**
-     * Gets the address of a static C++ field.
-     *
-     * @param name fully qualified name of the field
-     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
-     * @param notPresent if non-null and the field is not present then this value is returned
-     * @return the address of the requested field
-     * @throws JVMCIError if the field is not static or not present and {@code notPresent} is null
-     */
-    public long getFieldAddress(String name, String cppType, Long notPresent) {
-        VMField entry = getField(name, cppType, notPresent == null);
-        if (entry == null) {
-            return notPresent;
-        }
-        if (entry.address == 0) {
-            throw new JVMCIError(name + " is not a static field");
-        }
-        return entry.address;
-    }
-
-    /**
-     * Gets the address of a static C++ field.
-     *
-     * @param name fully qualified name of the field
-     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
-     * @return the address of the requested field
-     * @throws JVMCIError if the field is not static or not present
-     */
-    public long getFieldAddress(String name, String cppType) {
-        return getFieldAddress(name, cppType, null);
-    }
-
-    /**
-     * Gets the value of a static C++ field.
-     *
-     * @param name fully qualified name of the field
-     * @param type the boxed type to which the constant value will be converted
-     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
-     * @param notPresent if non-null and the field is not present then this value is returned
-     * @return the value of the requested field
-     * @throws JVMCIError if the field is not static or not present and {@code notPresent} is null
-     */
-    public <T> T getFieldValue(String name, Class<T> type, String cppType, T notPresent) {
-        VMField entry = getField(name, cppType, notPresent == null);
-        if (entry == null) {
-            return notPresent;
-        }
-        if (entry.value == null) {
-            throw new JVMCIError(name + " is not a static field");
-        }
-        return type.cast(convertValue(name, type, entry.value, cppType));
-    }
-
-    /**
-     * Gets the value of a static C++ field.
-     *
-     * @param name fully qualified name of the field
-     * @param type the boxed type to which the constant value will be converted
-     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
-     * @return the value of the requested field
-     * @throws JVMCIError if the field is not static or not present
-     */
-    public <T> T getFieldValue(String name, Class<T> type, String cppType) {
-        return getFieldValue(name, type, cppType, null);
-    }
-
-    /**
-     * Gets the value of a static C++ field.
-     *
-     * @param name fully qualified name of the field
-     * @param type the boxed type to which the constant value will be converted
-     * @return the value of the requested field
-     * @throws JVMCIError if the field is not static or not present
-     */
-    public <T> T getFieldValue(String name, Class<T> type) {
-        return getFieldValue(name, type, null, null);
-    }
-
-    /**
-     * Gets a C++ field.
-     *
-     * @param name fully qualified name of the field
-     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
-     * @param required specifies if the field must be present
-     * @return the field
-     * @throws JVMCIError if the field is not present and {@code required == true}
-     */
-    private VMField getField(String name, String cppType, boolean required) {
-        VMField entry = store.vmFields.get(name);
-        if (entry == null) {
-            if (!required) {
-                return null;
-            }
-            throw new JVMCIError("expected VM field not found: " + name);
-        }
-
-        // Make sure the native type is still the type we expect.
-        if (cppType != null && !cppType.equals(entry.type)) {
-            throw new JVMCIError("expected type " + cppType + " but VM field " + name + " is of type " + entry.type);
-        }
-        return entry;
-    }
-
-    /**
-     * Gets a VM flag value.
-     *
-     * @param name name of the flag (e.g., {@code "CompileTheWorldStartAt"})
-     * @param type the boxed type to which the flag's value will be converted
-     * @return the flag's value converted to {@code type} or {@code notPresent} if the flag is not
-     *         present
-     * @throws JVMCIError if the flag is not present
-     */
-    public <T> T getFlag(String name, Class<T> type) {
-        return getFlag(name, type, null);
-    }
-
-    /**
-     * Gets a VM flag value.
-     *
-     * @param name name of the flag (e.g., {@code "CompileTheWorldStartAt"})
-     * @param type the boxed type to which the flag's value will be converted
-     * @param notPresent if non-null and the flag is not present then this value is returned
-     * @return the flag's value converted to {@code type} or {@code notPresent} if the flag is not
-     *         present
-     * @throws JVMCIError if the flag is not present and {@code notPresent == null}
-     */
-    public <T> T getFlag(String name, Class<T> type, T notPresent) {
-        VMFlag entry = store.vmFlags.get(name);
-        if (entry == null) {
-            if (notPresent != null) {
-                return notPresent;
-            }
-            throw new JVMCIError("expected VM flag not found: " + name);
-        }
-        return type.cast(convertValue(name, type, entry.value, entry.type));
-    }
-
-    private static <T> Object convertValue(String name, Class<T> toType, Object value, String cppType) throws JVMCIError {
-        if (toType == Boolean.class) {
-            if (value instanceof String) {
-                return Boolean.valueOf((String) value);
-            } else if (value instanceof Boolean) {
-                return value;
-            } else if (value instanceof Long) {
-                return ((long) value) != 0;
-            }
-        } else if (toType == Byte.class) {
-            if (value instanceof Long) {
-                return (byte) (long) value;
-            }
-        } else if (toType == Integer.class) {
-            if (value instanceof Integer) {
-                return value;
-            } else if (value instanceof Long) {
-                return (int) (long) value;
-            }
-        } else if (toType == Long.class) {
-            return value;
-        }
-
-        throw new JVMCIError("cannot convert " + name + " of type " + value.getClass().getSimpleName() + (cppType == null ? "" : " [" + cppType + "]") + " to " + toType.getSimpleName());
-    }
-
-    private final HotSpotVMConfigStore store;
-
-    public HotSpotVMConfigAccess(HotSpotVMConfigStore store) {
-        this.store = store;
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java
deleted file mode 100644
index e6f074d..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-import static jdk.vm.ci.common.InitTimer.timer;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import jdk.vm.ci.common.InitTimer;
-
-/**
- * Access to VM configuration data.
- */
-public final class HotSpotVMConfigStore {
-
-    /**
-     * Gets the C++ symbols whose addresses are exposed by this object.
-     *
-     * @return an unmodifiable map from the symbol names to their addresses
-     */
-    public Map<String, Long> getAddresses() {
-        return Collections.unmodifiableMap(vmAddresses);
-    }
-
-    /**
-     * Gets the C++ type sizes exposed by this object.
-     *
-     * @return an unmodifiable map from C++ type names to their sizes in bytes
-     */
-    public Map<String, Long> getTypeSizes() {
-        return Collections.unmodifiableMap(vmTypeSizes);
-    }
-
-    /**
-     * Gets the C++ constants exposed by this object.
-     *
-     * @return an unmodifiable map from the names of C++ constants to their values
-     */
-    public Map<String, Long> getConstants() {
-        return Collections.unmodifiableMap(vmConstants);
-    }
-
-    /**
-     * Gets the VM flags exposed by this object.
-     *
-     * @return an unmodifiable map from VM flag names to {@link VMFlag} objects
-     */
-    public Map<String, VMFlag> getFlags() {
-        return Collections.unmodifiableMap(vmFlags);
-    }
-
-    /**
-     * Gets the C++ fields exposed by this object.
-     *
-     * @return an unmodifiable map from VM field names to {@link VMField} objects
-     */
-    public Map<String, VMField> getFields() {
-        return Collections.unmodifiableMap(vmFields);
-    }
-
-    /**
-     * Gets the VM intrinsic descriptions exposed by this object.
-     */
-    public List<VMIntrinsicMethod> getIntrinsics() {
-        return Collections.unmodifiableList(vmIntrinsics);
-    }
-
-    final HashMap<String, VMField> vmFields;
-    final HashMap<String, Long> vmTypeSizes;
-    final HashMap<String, Long> vmConstants;
-    final HashMap<String, Long> vmAddresses;
-    final HashMap<String, VMFlag> vmFlags;
-    final List<VMIntrinsicMethod> vmIntrinsics;
-
-    /**
-     * Reads the database of VM info. The return value encodes the info in a nested object array
-     * that is described by the pseudo Java object {@code info} below:
-     *
-     * <pre>
-     *     info = [
-     *         VMField[] vmFields,
-     *         [String name, Long size, ...] vmTypeSizes,
-     *         [String name, Long value, ...] vmConstants,
-     *         [String name, Long value, ...] vmAddresses,
-     *         VMFlag[] vmFlags
-     *         VMIntrinsicMethod[] vmIntrinsics
-     *     ]
-     * </pre>
-     */
-    @SuppressWarnings("try")
-    HotSpotVMConfigStore(CompilerToVM compilerToVm) {
-        Object[] data;
-        try (InitTimer t = timer("CompilerToVm readConfiguration")) {
-            data = compilerToVm.readConfiguration();
-        }
-        assert data.length == 6 : data.length;
-
-        // @formatter:off
-        VMField[] vmFieldsInfo    = (VMField[]) data[0];
-        Object[] vmTypesSizesInfo = (Object[])  data[1];
-        Object[] vmConstantsInfo  = (Object[])  data[2];
-        Object[] vmAddressesInfo  = (Object[])  data[3];
-        VMFlag[] vmFlagsInfo      = (VMFlag[])  data[4];
-
-        vmFields     = new HashMap<>(vmFieldsInfo.length);
-        vmTypeSizes  = new HashMap<>(vmTypesSizesInfo.length);
-        vmConstants  = new HashMap<>(vmConstantsInfo.length);
-        vmAddresses  = new HashMap<>(vmAddressesInfo.length);
-        vmFlags      = new HashMap<>(vmFlagsInfo.length);
-        vmIntrinsics = Arrays.asList((VMIntrinsicMethod[]) data[5]);
-        // @formatter:on
-
-        try (InitTimer t = timer("HotSpotVMConfigStore<init> fill maps")) {
-            for (VMField vmField : vmFieldsInfo) {
-                vmFields.put(vmField.name, vmField);
-            }
-
-            for (int i = 0; i < vmTypesSizesInfo.length / 2; i++) {
-                String name = (String) vmTypesSizesInfo[i * 2];
-                Long size = (Long) vmTypesSizesInfo[i * 2 + 1];
-                vmTypeSizes.put(name, size);
-            }
-
-            for (int i = 0; i < vmConstantsInfo.length / 2; i++) {
-                String name = (String) vmConstantsInfo[i * 2];
-                Long value = (Long) vmConstantsInfo[i * 2 + 1];
-                vmConstants.put(name, value);
-            }
-
-            for (int i = 0; i < vmAddressesInfo.length / 2; i++) {
-                String name = (String) vmAddressesInfo[i * 2];
-                Long value = (Long) vmAddressesInfo[i * 2 + 1];
-                vmAddresses.put(name, value);
-            }
-
-            for (VMFlag vmFlag : vmFlagsInfo) {
-                vmFlags.put(vmFlag.name, vmFlag);
-            }
-        }
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java
deleted file mode 100644
index 094d92c..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.hotspot;
-
-/**
- * Describes a C++ field exposed via {@link HotSpotVMConfigAccess}.
- */
-public final class VMField {
-
-    /**
-     * Fully qualified name of the represented field (e.g., "Klass::_name").
-     */
-    public final String name;
-
-    /**
-     * The represented field's type (e.g., "Symbol*"). This may be {@code null}.
-     */
-    public final String type;
-
-    /**
-     * If represented field is non-static, this is its offset within the containing structure.
-     */
-    public final long offset;
-
-    /**
-     * If represented field is static, this is its address. Otherwise, this field is 0.
-     */
-    public final long address;
-
-    /**
-     * Value of the field represented as a boxed long; only valid for non-oop static fields. This
-     * value is only captured once, during JVMCI initialization. If {@link #type} cannot be
-     * meaningfully (e.g., a struct) or safely (e.g., an oop) expressed as a boxed long, this is
-     * {@code null}.
-     */
-    public final Long value;
-
-    /**
-     * Determines if the represented field is static.
-     */
-    public boolean isStatic() {
-        return address != 0;
-    }
-
-    /**
-     * Creates a description of a non-static field.
-     */
-    public VMField(String name, String type, long offset) {
-        this.name = name;
-        this.type = type;
-        this.offset = offset;
-        this.address = 0;
-        this.value = null;
-    }
-
-    /**
-     * Creates a description of a static field.
-     */
-    public VMField(String name, String type, long address, Long value) {
-        this.name = name;
-        this.type = type;
-        this.offset = 0;
-        this.address = address;
-        this.value = value;
-    }
-
-    @Override
-    public String toString() {
-        String val = value == null ? "null" : String.format("0x%x", value);
-        return String.format("Field[name=%s, type=%s, offset=%d, address=0x%x, value=%s]", name, type, offset, address, val);
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java
deleted file mode 100644
index 81c5f39..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.meta;
-
-/**
- * Provides memory access operations for the target VM.
- */
-public interface MemoryAccessProvider {
-
-    /**
-     * Reads a primitive value using a base address and a displacement.
-     *
-     * @param kind the {@link JavaKind} of the returned {@link JavaConstant} object
-     * @param base the base address from which the value is read
-     * @param displacement the displacement within the object in bytes
-     * @param bits the number of bits to read from memory
-     * @return the read value encapsulated in a {@link JavaConstant} object of {@link JavaKind} kind
-     * @throws IllegalArgumentException if {@code kind} is {@link JavaKind#Void} or not
-     *             {@linkplain JavaKind#isPrimitive() primitive} kind or {@code bits} is not 8, 16,
-     *             32 or 64
-     */
-    JavaConstant readPrimitiveConstant(JavaKind kind, Constant base, long displacement, int bits) throws IllegalArgumentException;
-
-    /**
-     * Reads a Java {@link Object} value using a base address and a displacement.
-     *
-     * @param base the base address from which the value is read
-     * @param displacement the displacement within the object in bytes
-     * @return the read value encapsulated in a {@link Constant} object or {@code null} if the
-     *         address computed from {@code base} and {@code displacement} does not denote a
-     *         location holding an {@code Object} value
-     */
-    JavaConstant readObjectConstant(Constant base, long displacement);
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java
deleted file mode 100644
index dbeb7fb..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.services;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Formatter;
-import java.util.Iterator;
-import java.util.ServiceConfigurationError;
-import java.util.ServiceLoader;
-
-/**
- * A mechanism for accessing service providers via JVMCI.
- */
-public final class Services {
-
-    private Services() {
-    }
-
-    private static int getJavaSpecificationVersion() {
-        String value = System.getProperty("java.specification.version");
-        if (value.startsWith("1.")) {
-            value = value.substring(2);
-        }
-        return Integer.parseInt(value);
-    }
-
-    /**
-     * The integer value corresponding to the value of the {@code java.specification.version} system
-     * property after any leading {@code "1."} has been stripped.
-     */
-    public static final int JAVA_SPECIFICATION_VERSION = getJavaSpecificationVersion();
-
-    // Use reflection so that this compiles on Java 8
-    private static final Method getModule;
-    private static final Method getPackages;
-    private static final Method addUses;
-    private static final Method isExported;
-    private static final Method addExports;
-
-    static {
-        if (JAVA_SPECIFICATION_VERSION >= 9) {
-            try {
-                getModule = Class.class.getMethod("getModule");
-                Class<?> moduleClass = getModule.getReturnType();
-                getPackages = moduleClass.getMethod("getPackages");
-                addUses = moduleClass.getMethod("addUses", Class.class);
-                isExported = moduleClass.getMethod("isExported", String.class, moduleClass);
-                addExports = moduleClass.getMethod("addExports", String.class, moduleClass);
-            } catch (NoSuchMethodException | SecurityException e) {
-                throw new InternalError(e);
-            }
-        } else {
-            getModule = null;
-            getPackages = null;
-            addUses = null;
-            isExported = null;
-            addExports = null;
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    static <T> T invoke(Method method, Object receiver, Object... args) {
-        try {
-            return (T) method.invoke(receiver, args);
-        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-            throw new InternalError(e);
-        }
-    }
-
-    /**
-     * Performs any required security checks and dynamic reconfiguration to allow the module of a
-     * given class to access the classes in the JVMCI module.
-     *
-     * Note: This API uses {@link Class} instead of {@code Module} to provide backwards
-     * compatibility for JVMCI clients compiled against a JDK release earlier than 9.
-     *
-     * @param requestor a class requesting access to the JVMCI module for its module
-     * @throws SecurityException if a security manager is present and it denies
-     *             {@link JVMCIPermission}
-     */
-    public static void exportJVMCITo(Class<?> requestor) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new JVMCIPermission());
-        }
-        if (JAVA_SPECIFICATION_VERSION >= 9) {
-            Object jvmci = invoke(getModule, Services.class);
-            Object requestorModule = invoke(getModule, requestor);
-            if (jvmci != requestorModule) {
-                String[] packages = invoke(getPackages, jvmci);
-                for (String pkg : packages) {
-                    // Export all JVMCI packages dynamically instead
-                    // of requiring a long list of --add-exports
-                    // options on the JVM command line.
-                    boolean exported = invoke(isExported, jvmci, pkg, requestorModule);
-                    if (!exported) {
-                        invoke(addExports, jvmci, pkg, requestorModule);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Gets an {@link Iterable} of the JVMCI providers available for a given service.
-     *
-     * @throws SecurityException if a security manager is present and it denies
-     *             {@link JVMCIPermission}
-     */
-    public static <S> Iterable<S> load(Class<S> service) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new JVMCIPermission());
-        }
-        if (JAVA_SPECIFICATION_VERSION >= 9) {
-            Object jvmci = invoke(getModule, Services.class);
-            invoke(addUses, jvmci, service);
-        }
-
-        // Restrict JVMCI clients to be on the class path or module path
-        return ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
-    }
-
-    /**
-     * Gets the JVMCI provider for a given service for which at most one provider must be available.
-     *
-     * @param service the service whose provider is being requested
-     * @param required specifies if an {@link InternalError} should be thrown if no provider of
-     *            {@code service} is available
-     * @throws SecurityException if a security manager is present and it denies
-     *             {@link JVMCIPermission}
-     */
-    public static <S> S loadSingle(Class<S> service, boolean required) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new JVMCIPermission());
-        }
-        if (JAVA_SPECIFICATION_VERSION >= 9) {
-            Object jvmci = invoke(getModule, Services.class);
-            invoke(addUses, jvmci, service);
-        }
-        // Restrict JVMCI clients to be on the class path or module path
-        Iterable<S> providers = ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
-        S singleProvider = null;
-        try {
-            for (Iterator<S> it = providers.iterator(); it.hasNext();) {
-                singleProvider = it.next();
-                if (it.hasNext()) {
-                    throw new InternalError(String.format("Multiple %s providers found", service.getName()));
-                }
-            }
-        } catch (ServiceConfigurationError e) {
-            // If the service is required we will bail out below.
-        }
-        if (singleProvider == null && required) {
-            String javaHome = System.getProperty("java.home");
-            String vmName = System.getProperty("java.vm.name");
-            Formatter errorMessage = new Formatter();
-            errorMessage.format("The VM does not expose required service %s.%n", service.getName());
-            errorMessage.format("Currently used Java home directory is %s.%n", javaHome);
-            errorMessage.format("Currently used VM configuration is: %s", vmName);
-            throw new UnsupportedOperationException(errorMessage.toString());
-        }
-        return singleProvider;
-    }
-}
diff --git a/hotspot/src/jdk.vm.ci/share/classes/module-info.java b/hotspot/src/jdk.vm.ci/share/classes/module-info.java
deleted file mode 100644
index 744442b..0000000
--- a/hotspot/src/jdk.vm.ci/share/classes/module-info.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-module jdk.vm.ci {
-    exports jdk.vm.ci.services;
-
-    uses jdk.vm.ci.services.JVMCIServiceLocator;
-    uses jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;
-
-    provides jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory with
-        jdk.vm.ci.hotspot.aarch64.AArch64HotSpotJVMCIBackendFactory,
-        jdk.vm.ci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory,
-        jdk.vm.ci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory;
-
-    exports jdk.vm.ci.aarch64 to
-        jdk.vm.compiler;
-    exports jdk.vm.ci.amd64 to
-        jdk.aot,
-        jdk.vm.compiler;
-    exports jdk.vm.ci.code to
-        jdk.aot,
-        jdk.vm.compiler;
-    exports jdk.vm.ci.code.site to
-        jdk.aot,
-        jdk.vm.compiler;
-    exports jdk.vm.ci.code.stack to
-        jdk.vm.compiler;
-    exports jdk.vm.ci.common to
-        jdk.vm.compiler;
-    exports jdk.vm.ci.hotspot to
-        jdk.aot,
-        jdk.vm.compiler;
-    exports jdk.vm.ci.hotspot.aarch64 to
-        jdk.vm.compiler;
-    exports jdk.vm.ci.hotspot.amd64 to
-        jdk.vm.compiler;
-    exports jdk.vm.ci.hotspot.sparc to
-        jdk.vm.compiler;
-    exports jdk.vm.ci.meta to
-        jdk.aot,
-        jdk.vm.compiler;
-    exports jdk.vm.ci.runtime to
-        jdk.aot,
-        jdk.vm.compiler;
-    exports jdk.vm.ci.sparc to
-        jdk.vm.compiler;
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/module-info.java b/hotspot/src/jdk.vm.compiler/share/classes/module-info.java
deleted file mode 100644
index 7c45648..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/module-info.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-module jdk.vm.compiler {
-    requires java.instrument;
-    requires java.management;
-    requires jdk.management;
-    requires jdk.vm.ci;
-
-    // sun.misc.Unsafe is used
-    requires jdk.unsupported;
-
-    uses org.graalvm.compiler.code.DisassemblerProvider;
-    uses org.graalvm.compiler.core.match.MatchStatementSet;
-    uses org.graalvm.compiler.debug.DebugConfigCustomizer;
-    uses org.graalvm.compiler.debug.DebugInitializationParticipant;
-    uses org.graalvm.compiler.debug.TTYStreamProvider;
-    uses org.graalvm.compiler.hotspot.CompilerConfigurationFactory;
-    uses org.graalvm.compiler.hotspot.HotSpotBackendFactory;
-    uses org.graalvm.compiler.nodes.graphbuilderconf.NodeIntrinsicPluginFactory;
-
-    exports org.graalvm.compiler.api.directives         to jdk.aot;
-    exports org.graalvm.compiler.api.runtime            to jdk.aot;
-    exports org.graalvm.compiler.api.replacements       to jdk.aot;
-    exports org.graalvm.compiler.asm.amd64              to jdk.aot;
-    exports org.graalvm.compiler.bytecode               to jdk.aot;
-    exports org.graalvm.compiler.code                   to jdk.aot;
-    exports org.graalvm.compiler.core                   to jdk.aot;
-    exports org.graalvm.compiler.core.common            to jdk.aot;
-    exports org.graalvm.compiler.core.target            to jdk.aot;
-    exports org.graalvm.compiler.debug                  to jdk.aot;
-    exports org.graalvm.compiler.debug.internal         to jdk.aot;
-    exports org.graalvm.compiler.graph                  to jdk.aot;
-    exports org.graalvm.compiler.hotspot                to jdk.aot;
-    exports org.graalvm.compiler.hotspot.meta           to jdk.aot;
-    exports org.graalvm.compiler.hotspot.replacements   to jdk.aot;
-    exports org.graalvm.compiler.hotspot.stubs          to jdk.aot;
-    exports org.graalvm.compiler.hotspot.word           to jdk.aot;
-    exports org.graalvm.compiler.java                   to jdk.aot;
-    exports org.graalvm.compiler.lir.asm                to jdk.aot;
-    exports org.graalvm.compiler.lir.phases             to jdk.aot;
-    exports org.graalvm.compiler.nodes                  to jdk.aot;
-    exports org.graalvm.compiler.nodes.graphbuilderconf to jdk.aot;
-    exports org.graalvm.compiler.options                to jdk.aot;
-    exports org.graalvm.compiler.phases                 to jdk.aot;
-    exports org.graalvm.compiler.phases.tiers           to jdk.aot;
-    exports org.graalvm.compiler.runtime                to jdk.aot;
-    exports org.graalvm.compiler.replacements           to jdk.aot;
-    exports org.graalvm.compiler.word                   to jdk.aot;
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java
deleted file mode 100644
index 240fdc0..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.core.common.util;
-
-import static org.graalvm.compiler.core.common.util.Util.JAVA_SPECIFICATION_VERSION;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-/**
- * Reflection based access to the Module API introduced by JDK 9. This allows the API to be used in
- * code that must be compiled on a JDK prior to 9. Use of this class must be guarded by a test for
- * JDK 9 or later. For example:
- *
- * <pre>
- * if (Util.JAVA_SPECIFICATION_VERSION >= 9) {
- *     // Use of ModuleAPI
- * }
- * </pre>
- */
-public final class ModuleAPI {
-
-    private ModuleAPI(Method method) {
-        this.method = method;
-    }
-
-    private final Method method;
-
-    /**
-     * {@code Class.getModule()}.
-     */
-    public static final ModuleAPI getModule;
-
-    /**
-     * {@code jdk.internal.module.Modules.addExports(Module, String, Module)}.
-     */
-    public static final ModuleAPI addExports;
-
-    /**
-     * {@code java.lang.reflect.Module.getResourceAsStream(String)}.
-     */
-    public static final ModuleAPI getResourceAsStream;
-
-    /**
-     * {@code java.lang.reflect.Module.canRead(Module)}.
-     */
-    public static final ModuleAPI canRead;
-
-    /**
-     * {@code java.lang.reflect.Module.isExported(String)}.
-     */
-    public static final ModuleAPI isExported;
-
-    /**
-     * {@code java.lang.reflect.Module.isExported(String, Module)}.
-     */
-    public static final ModuleAPI isExportedTo;
-
-    /**
-     * Invokes the static Module API method represented by this object.
-     */
-    @SuppressWarnings("unchecked")
-    public <T> T invokeStatic(Object... args) {
-        checkAvailability();
-        assert Modifier.isStatic(method.getModifiers());
-        try {
-            return (T) method.invoke(null, args);
-        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-            throw new InternalError(e);
-        }
-    }
-
-    /**
-     * Invokes the non-static Module API method represented by this object.
-     */
-    @SuppressWarnings("unchecked")
-    public <T> T invoke(Object receiver, Object... args) {
-        checkAvailability();
-        assert !Modifier.isStatic(method.getModifiers());
-        try {
-            return (T) method.invoke(receiver, args);
-        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-            throw new InternalError(e);
-        }
-    }
-
-    private void checkAvailability() throws InternalError {
-        if (method == null) {
-            throw new InternalError("Cannot use Module API on JDK " + JAVA_SPECIFICATION_VERSION);
-        }
-    }
-
-    static {
-        if (JAVA_SPECIFICATION_VERSION >= 9) {
-            try {
-                getModule = new ModuleAPI(Class.class.getMethod("getModule"));
-                Class<?> moduleClass = getModule.method.getReturnType();
-                Class<?> modulesClass = Class.forName("jdk.internal.module.Modules");
-                getResourceAsStream = new ModuleAPI(moduleClass.getMethod("getResourceAsStream", String.class));
-                canRead = new ModuleAPI(moduleClass.getMethod("canRead", moduleClass));
-                isExported = new ModuleAPI(moduleClass.getMethod("isExported", String.class));
-                isExportedTo = new ModuleAPI(moduleClass.getMethod("isExported", String.class, moduleClass));
-                addExports = new ModuleAPI(modulesClass.getDeclaredMethod("addExports", moduleClass, String.class, moduleClass));
-            } catch (NoSuchMethodException | SecurityException | ClassNotFoundException e) {
-                throw new InternalError(e);
-            }
-        } else {
-            ModuleAPI unavailable = new ModuleAPI(null);
-            getModule = unavailable;
-            getResourceAsStream = unavailable;
-            canRead = unavailable;
-            isExported = unavailable;
-            isExportedTo = unavailable;
-            addExports = unavailable;
-        }
-
-    }
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
deleted file mode 100644
index 850faa1..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
+++ /dev/null
@@ -1,738 +0,0 @@
-/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.hotspot.amd64;
-
-import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
-import static org.graalvm.compiler.hotspot.HotSpotBackend.INITIALIZE_KLASS_BY_SYMBOL;
-import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_KLASS_BY_SYMBOL;
-import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_METHOD_BY_SYMBOL_AND_LOAD_COUNTERS;
-import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_STRING_BY_SYMBOL;
-import static org.graalvm.compiler.hotspot.HotSpotBackend.FETCH_UNROLL_INFO;
-import static org.graalvm.compiler.hotspot.HotSpotBackend.UNCOMMON_TRAP;
-import static jdk.vm.ci.amd64.AMD64.rbp;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.graalvm.compiler.asm.amd64.AMD64Address.Scale;
-import org.graalvm.compiler.core.amd64.AMD64ArithmeticLIRGenerator;
-import org.graalvm.compiler.core.amd64.AMD64LIRGenerator;
-import org.graalvm.compiler.core.amd64.AMD64MoveFactoryBase.BackupSlotProvider;
-import org.graalvm.compiler.core.common.LIRKind;
-import org.graalvm.compiler.core.common.spi.ForeignCallLinkage;
-import org.graalvm.compiler.core.common.spi.LIRKindTool;
-import org.graalvm.compiler.debug.Debug;
-import org.graalvm.compiler.debug.GraalError;
-import org.graalvm.compiler.hotspot.CompressEncoding;
-import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
-import org.graalvm.compiler.hotspot.HotSpotBackend;
-import org.graalvm.compiler.hotspot.HotSpotDebugInfoBuilder;
-import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
-import org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult;
-import org.graalvm.compiler.hotspot.HotSpotLIRGenerator;
-import org.graalvm.compiler.hotspot.HotSpotLockStack;
-import org.graalvm.compiler.hotspot.debug.BenchmarkCounters;
-import org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction;
-import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
-import org.graalvm.compiler.hotspot.nodes.type.HotSpotLIRKindTool;
-import org.graalvm.compiler.hotspot.stubs.Stub;
-import org.graalvm.compiler.lir.LIR;
-import org.graalvm.compiler.lir.LIRFrameState;
-import org.graalvm.compiler.lir.LIRInstruction;
-import org.graalvm.compiler.lir.LIRInstructionClass;
-import org.graalvm.compiler.lir.LabelRef;
-import org.graalvm.compiler.lir.StandardOp.NoOp;
-import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
-import org.graalvm.compiler.lir.SwitchStrategy;
-import org.graalvm.compiler.lir.Variable;
-import org.graalvm.compiler.lir.VirtualStackSlot;
-import org.graalvm.compiler.lir.amd64.AMD64AddressValue;
-import org.graalvm.compiler.lir.amd64.AMD64CCall;
-import org.graalvm.compiler.lir.amd64.AMD64ControlFlow.StrategySwitchOp;
-import org.graalvm.compiler.lir.amd64.AMD64FrameMapBuilder;
-import org.graalvm.compiler.lir.amd64.AMD64Move;
-import org.graalvm.compiler.lir.amd64.AMD64Move.MoveFromRegOp;
-import org.graalvm.compiler.lir.amd64.AMD64PrefetchOp;
-import org.graalvm.compiler.lir.amd64.AMD64ReadTimestampCounter;
-import org.graalvm.compiler.lir.amd64.AMD64RestoreRegistersOp;
-import org.graalvm.compiler.lir.amd64.AMD64SaveRegistersOp;
-import org.graalvm.compiler.lir.amd64.AMD64VZeroUpper;
-import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
-import org.graalvm.compiler.lir.framemap.FrameMapBuilder;
-import org.graalvm.compiler.lir.gen.LIRGenerationResult;
-
-import jdk.vm.ci.amd64.AMD64;
-import jdk.vm.ci.amd64.AMD64Kind;
-import jdk.vm.ci.code.CallingConvention;
-import jdk.vm.ci.code.Register;
-import jdk.vm.ci.code.RegisterConfig;
-import jdk.vm.ci.code.RegisterValue;
-import jdk.vm.ci.code.StackSlot;
-import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
-import jdk.vm.ci.hotspot.HotSpotObjectConstant;
-import jdk.vm.ci.meta.AllocatableValue;
-import jdk.vm.ci.meta.Constant;
-import jdk.vm.ci.meta.DeoptimizationAction;
-import jdk.vm.ci.meta.DeoptimizationReason;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.PlatformKind;
-import jdk.vm.ci.meta.PrimitiveConstant;
-import jdk.vm.ci.meta.Value;
-
-/**
- * LIR generator specialized for AMD64 HotSpot.
- */
-public class AMD64HotSpotLIRGenerator extends AMD64LIRGenerator implements HotSpotLIRGenerator {
-
-    final GraalHotSpotVMConfig config;
-    private HotSpotDebugInfoBuilder debugInfoBuilder;
-
-    protected AMD64HotSpotLIRGenerator(HotSpotProviders providers, GraalHotSpotVMConfig config, LIRGenerationResult lirGenRes) {
-        this(providers, config, lirGenRes, new BackupSlotProvider(lirGenRes.getFrameMapBuilder()));
-    }
-
-    private AMD64HotSpotLIRGenerator(HotSpotProviders providers, GraalHotSpotVMConfig config, LIRGenerationResult lirGenRes, BackupSlotProvider backupSlotProvider) {
-        this(new AMD64HotSpotLIRKindTool(), new AMD64HotSpotArithmeticLIRGenerator(), new AMD64HotSpotMoveFactory(backupSlotProvider), providers, config, lirGenRes);
-    }
-
-    protected AMD64HotSpotLIRGenerator(LIRKindTool lirKindTool, AMD64ArithmeticLIRGenerator arithmeticLIRGen, MoveFactory moveFactory, HotSpotProviders providers, GraalHotSpotVMConfig config,
-                    LIRGenerationResult lirGenRes) {
-        super(lirKindTool, arithmeticLIRGen, moveFactory, providers, lirGenRes);
-        assert config.basicLockSize == 8;
-        this.config = config;
-    }
-
-    @Override
-    public HotSpotProviders getProviders() {
-        return (HotSpotProviders) super.getProviders();
-    }
-
-    /**
-     * Utility for emitting the instruction to save RBP.
-     */
-    class SaveRbp {
-
-        final NoOp placeholder;
-
-        /**
-         * The slot reserved for saving RBP.
-         */
-        final StackSlot reservedSlot;
-
-        SaveRbp(NoOp placeholder) {
-            this.placeholder = placeholder;
-            AMD64FrameMapBuilder frameMapBuilder = (AMD64FrameMapBuilder) getResult().getFrameMapBuilder();
-            this.reservedSlot = frameMapBuilder.allocateRBPSpillSlot();
-        }
-
-        /**
-         * Replaces this operation with the appropriate move for saving rbp.
-         *
-         * @param useStack specifies if rbp must be saved to the stack
-         */
-        public AllocatableValue finalize(boolean useStack) {
-            AllocatableValue dst;
-            if (useStack) {
-                dst = reservedSlot;
-            } else {
-                ((AMD64FrameMapBuilder) getResult().getFrameMapBuilder()).freeRBPSpillSlot();
-                dst = newVariable(LIRKind.value(AMD64Kind.QWORD));
-            }
-
-            placeholder.replace(getResult().getLIR(), new MoveFromRegOp(AMD64Kind.QWORD, dst, rbp.asValue(LIRKind.value(AMD64Kind.QWORD))));
-            return dst;
-        }
-    }
-
-    private SaveRbp saveRbp;
-
-    protected void emitSaveRbp() {
-        NoOp placeholder = new NoOp(getCurrentBlock(), getResult().getLIR().getLIRforBlock(getCurrentBlock()).size());
-        append(placeholder);
-        saveRbp = new SaveRbp(placeholder);
-    }
-
-    protected SaveRbp getSaveRbp() {
-        return saveRbp;
-    }
-
-    /**
-     * Helper instruction to reserve a stack slot for the whole method. Note that the actual users
-     * of the stack slot might be inserted after stack slot allocation. This dummy instruction
-     * ensures that the stack slot is alive and gets a real stack slot assigned.
-     */
-    private static final class RescueSlotDummyOp extends LIRInstruction {
-        public static final LIRInstructionClass<RescueSlotDummyOp> TYPE = LIRInstructionClass.create(RescueSlotDummyOp.class);
-
-        @Alive({OperandFlag.STACK, OperandFlag.UNINITIALIZED}) private AllocatableValue slot;
-
-        RescueSlotDummyOp(FrameMapBuilder frameMapBuilder, LIRKind kind) {
-            super(TYPE);
-            slot = frameMapBuilder.allocateSpillSlot(kind);
-        }
-
-        public AllocatableValue getSlot() {
-            return slot;
-        }
-
-        @Override
-        public void emitCode(CompilationResultBuilder crb) {
-        }
-    }
-
-    private RescueSlotDummyOp rescueSlotOp;
-
-    private AllocatableValue getOrInitRescueSlot() {
-        RescueSlotDummyOp op = getOrInitRescueSlotOp();
-        return op.getSlot();
-    }
-
-    private RescueSlotDummyOp getOrInitRescueSlotOp() {
-        if (rescueSlotOp == null) {
-            // create dummy instruction to keep the rescue slot alive
-            rescueSlotOp = new RescueSlotDummyOp(getResult().getFrameMapBuilder(), getLIRKindTool().getWordKind());
-        }
-        return rescueSlotOp;
-    }
-
-    /**
-     * List of epilogue operations that need to restore RBP.
-     */
-    List<AMD64HotSpotRestoreRbpOp> epilogueOps = new ArrayList<>(2);
-
-    @Override
-    public <I extends LIRInstruction> I append(I op) {
-        I ret = super.append(op);
-        if (op instanceof AMD64HotSpotRestoreRbpOp) {
-            epilogueOps.add((AMD64HotSpotRestoreRbpOp) op);
-        }
-        return ret;
-    }
-
-    @Override
-    public VirtualStackSlot getLockSlot(int lockDepth) {
-        return getLockStack().makeLockSlot(lockDepth);
-    }
-
-    private HotSpotLockStack getLockStack() {
-        assert debugInfoBuilder != null && debugInfoBuilder.lockStack() != null;
-        return debugInfoBuilder.lockStack();
-    }
-
-    private Register findPollOnReturnScratchRegister() {
-        RegisterConfig regConfig = getProviders().getCodeCache().getRegisterConfig();
-        for (Register r : regConfig.getAllocatableRegisters()) {
-            if (!r.equals(regConfig.getReturnRegister(JavaKind.Long)) && !r.equals(AMD64.rbp)) {
-                return r;
-            }
-        }
-        throw GraalError.shouldNotReachHere();
-    }
-
-    private Register pollOnReturnScratchRegister;
-
-    @Override
-    public void emitReturn(JavaKind kind, Value input) {
-        AllocatableValue operand = Value.ILLEGAL;
-        if (input != null) {
-            operand = resultOperandFor(kind, input.getValueKind());
-            emitMove(operand, input);
-        }
-        if (pollOnReturnScratchRegister == null) {
-            pollOnReturnScratchRegister = findPollOnReturnScratchRegister();
-        }
-        append(new AMD64HotSpotReturnOp(operand, getStub() != null, pollOnReturnScratchRegister, config));
-    }
-
-    @Override
-    public boolean needOnlyOopMaps() {
-        // Stubs only need oop maps
-        return getResult().getStub() != null;
-    }
-
-    private LIRFrameState currentRuntimeCallInfo;
-
-    @Override
-    protected void emitForeignCallOp(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info) {
-        currentRuntimeCallInfo = info;
-        HotSpotForeignCallLinkage hsLinkage = (HotSpotForeignCallLinkage) linkage;
-        AMD64 arch = (AMD64) target().arch;
-        if (arch.getFeatures().contains(AMD64.CPUFeature.AVX) && hsLinkage.mayContainFP() && !hsLinkage.isCompiledStub()) {
-            /*
-             * If the target may contain FP ops, and it is not compiled by us, we may have an
-             * AVX-SSE transition.
-             *
-             * We exclude the argument registers from the zeroing LIR instruction since it violates
-             * the LIR semantics of @Temp that values must not be live. Note that the emitted
-             * machine instruction actually zeros _all_ XMM registers which is fine since we know
-             * that their upper half is not used.
-             */
-            append(new AMD64VZeroUpper(arguments));
-        }
-        super.emitForeignCallOp(linkage, result, arguments, temps, info);
-    }
-
-    @Override
-    public void emitLeaveCurrentStackFrame(SaveRegistersOp saveRegisterOp) {
-        append(new AMD64HotSpotLeaveCurrentStackFrameOp(saveRegisterOp));
-    }
-
-    @Override
-    public void emitLeaveDeoptimizedStackFrame(Value frameSize, Value initialInfo) {
-        Variable frameSizeVariable = load(frameSize);
-        Variable initialInfoVariable = load(initialInfo);
-        append(new AMD64HotSpotLeaveDeoptimizedStackFrameOp(frameSizeVariable, initialInfoVariable));
-    }
-
-    @Override
-    public void emitEnterUnpackFramesStackFrame(Value framePc, Value senderSp, Value senderFp, SaveRegistersOp saveRegisterOp) {
-        Register threadRegister = getProviders().getRegisters().getThreadRegister();
-        Variable framePcVariable = load(framePc);
-        Variable senderSpVariable = load(senderSp);
-        Variable senderFpVariable = load(senderFp);
-        append(new AMD64HotSpotEnterUnpackFramesStackFrameOp(threadRegister, config.threadLastJavaSpOffset(), config.threadLastJavaPcOffset(), config.threadLastJavaFpOffset(), framePcVariable,
-                        senderSpVariable, senderFpVariable, saveRegisterOp));
-    }
-
-    @Override
-    public void emitLeaveUnpackFramesStackFrame(SaveRegistersOp saveRegisterOp) {
-        Register threadRegister = getProviders().getRegisters().getThreadRegister();
-        append(new AMD64HotSpotLeaveUnpackFramesStackFrameOp(threadRegister, config.threadLastJavaSpOffset(), config.threadLastJavaPcOffset(), config.threadLastJavaFpOffset(), saveRegisterOp));
-    }
-
-    /**
-     * @param savedRegisters the registers saved by this operation which may be subject to pruning
-     * @param savedRegisterLocations the slots to which the registers are saved
-     * @param supportsRemove determines if registers can be pruned
-     */
-    protected AMD64SaveRegistersOp emitSaveRegisters(Register[] savedRegisters, AllocatableValue[] savedRegisterLocations, boolean supportsRemove) {
-        AMD64SaveRegistersOp save = new AMD64SaveRegistersOp(savedRegisters, savedRegisterLocations, supportsRemove);
-        append(save);
-        return save;
-    }
-
-    /**
-     * Allocate a stack slot for saving a register.
-     */
-    protected VirtualStackSlot allocateSaveRegisterLocation(Register register) {
-        PlatformKind kind = target().arch.getLargestStorableKind(register.getRegisterCategory());
-        if (kind.getVectorLength() > 1) {
-            // we don't use vector registers, so there is no need to save them
-            kind = AMD64Kind.DOUBLE;
-        }
-        return getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(kind));
-    }
-
-    /**
-     * Adds a node to the graph that saves all allocatable registers to the stack.
-     *
-     * @param supportsRemove determines if registers can be pruned
-     * @return the register save node
-     */
-    private AMD64SaveRegistersOp emitSaveAllRegisters(Register[] savedRegisters, boolean supportsRemove) {
-        AllocatableValue[] savedRegisterLocations = new AllocatableValue[savedRegisters.length];
-        for (int i = 0; i < savedRegisters.length; i++) {
-            savedRegisterLocations[i] = allocateSaveRegisterLocation(savedRegisters[i]);
-        }
-        return emitSaveRegisters(savedRegisters, savedRegisterLocations, supportsRemove);
-    }
-
-    @Override
-    public SaveRegistersOp emitSaveAllRegisters() {
-        // We are saving all registers.
-        // TODO Save upper half of YMM registers.
-        return emitSaveAllRegisters(target().arch.getAvailableValueRegisters().toArray(), false);
-    }
-
-    protected void emitRestoreRegisters(AMD64SaveRegistersOp save) {
-        append(new AMD64RestoreRegistersOp(save.getSlots().clone(), save));
-    }
-
-    /**
-     * Gets the {@link Stub} this generator is generating code for or {@code null} if a stub is not
-     * being generated.
-     */
-    public Stub getStub() {
-        return getResult().getStub();
-    }
-
-    @Override
-    public HotSpotLIRGenerationResult getResult() {
-        return ((HotSpotLIRGenerationResult) super.getResult());
-    }
-
-    public void setDebugInfoBuilder(HotSpotDebugInfoBuilder debugInfoBuilder) {
-        this.debugInfoBuilder = debugInfoBuilder;
-    }
-
-    @Override
-    public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState state, Value... args) {
-        HotSpotForeignCallLinkage hotspotLinkage = (HotSpotForeignCallLinkage) linkage;
-        boolean destroysRegisters = hotspotLinkage.destroysRegisters();
-
-        AMD64SaveRegistersOp save = null;
-        Stub stub = getStub();
-        if (destroysRegisters) {
-            if (stub != null && stub.preservesRegisters()) {
-                Register[] savedRegisters = getResult().getFrameMapBuilder().getRegisterConfig().getAllocatableRegisters().toArray();
-                save = emitSaveAllRegisters(savedRegisters, true);
-            }
-        }
-
-        Variable result;
-        LIRFrameState debugInfo = null;
-        if (hotspotLinkage.needsDebugInfo()) {
-            debugInfo = state;
-            assert debugInfo != null || stub != null;
-        }
-
-        if (hotspotLinkage.needsJavaFrameAnchor()) {
-            Register thread = getProviders().getRegisters().getThreadRegister();
-            append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
-            result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
-            append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), config.threadLastJavaPcOffset(), thread));
-        } else {
-            result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
-        }
-
-        if (destroysRegisters) {
-            if (stub != null) {
-                if (stub.preservesRegisters()) {
-                    HotSpotLIRGenerationResult generationResult = getResult();
-                    assert !generationResult.getCalleeSaveInfo().containsKey(currentRuntimeCallInfo);
-                    generationResult.getCalleeSaveInfo().put(currentRuntimeCallInfo, save);
-                    emitRestoreRegisters(save);
-                }
-            }
-        }
-
-        return result;
-    }
-
-    @Override
-    public Value emitLoadObjectAddress(Constant constant) {
-        HotSpotObjectConstant objectConstant = (HotSpotObjectConstant) constant;
-        HotSpotLIRKindTool kindTool = (HotSpotLIRKindTool) getLIRKindTool();
-        LIRKind kind = objectConstant.isCompressed() ? kindTool.getNarrowOopKind() : kindTool.getObjectKind();
-        Variable result = newVariable(kind);
-        append(new AMD64HotSpotLoadAddressOp(result, constant, HotSpotConstantLoadAction.RESOLVE));
-        return result;
-    }
-
-    @Override
-    public Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
-        HotSpotMetaspaceConstant metaspaceConstant = (HotSpotMetaspaceConstant) constant;
-        HotSpotLIRKindTool kindTool = (HotSpotLIRKindTool) getLIRKindTool();
-        LIRKind kind = metaspaceConstant.isCompressed() ? kindTool.getNarrowPointerKind() : kindTool.getWordKind();
-        Variable result = newVariable(kind);
-        append(new AMD64HotSpotLoadAddressOp(result, constant, action));
-        return result;
-    }
-
-    @Override
-    public Value emitObjectConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
-        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(RESOLVE_STRING_BY_SYMBOL);
-        Constant[] constants = new Constant[]{constant};
-        AllocatableValue[] constantDescriptions = new AllocatableValue[]{asAllocatable(constantDescription)};
-        Object[] notes = new Object[]{HotSpotConstantLoadAction.RESOLVE};
-        append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
-        AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
-        return emitMove(result);
-    }
-
-    @Override
-    public Value emitMetaspaceConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
-        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(RESOLVE_KLASS_BY_SYMBOL);
-        Constant[] constants = new Constant[]{constant};
-        AllocatableValue[] constantDescriptions = new AllocatableValue[]{asAllocatable(constantDescription)};
-        Object[] notes = new Object[]{HotSpotConstantLoadAction.RESOLVE};
-        append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
-        AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
-        return emitMove(result);
-    }
-
-    @Override
-    public Value emitResolveMethodAndLoadCounters(Constant method, Value klassHint, Value methodDescription, LIRFrameState frameState) {
-        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(RESOLVE_METHOD_BY_SYMBOL_AND_LOAD_COUNTERS);
-        Constant[] constants = new Constant[]{method};
-        AllocatableValue[] constantDescriptions = new AllocatableValue[]{asAllocatable(klassHint), asAllocatable(methodDescription)};
-        Object[] notes = new Object[]{HotSpotConstantLoadAction.LOAD_COUNTERS};
-        append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
-        AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
-        return emitMove(result);
-
-    }
-
-    @Override
-    public Value emitKlassInitializationAndRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
-        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(INITIALIZE_KLASS_BY_SYMBOL);
-        Constant[] constants = new Constant[]{constant};
-        AllocatableValue[] constantDescriptions = new AllocatableValue[]{asAllocatable(constantDescription)};
-        Object[] notes = new Object[]{HotSpotConstantLoadAction.INITIALIZE};
-        append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
-        AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
-        return emitMove(result);
-    }
-
-    @Override
-    public Value emitLoadConfigValue(int markId) {
-        // Globals are always full-pointer width.
-        Variable result = newVariable(LIRKind.value(target().arch.getWordKind()));
-        append(new AMD64HotSpotLoadConfigValueOp(markId, result));
-        return result;
-    }
-
-    @Override
-    public Value emitRandomSeed() {
-        AMD64ReadTimestampCounter timestamp = new AMD64ReadTimestampCounter();
-        append(timestamp);
-        return emitMove(timestamp.getLowResult());
-    }
-
-    @Override
-    public Value emitUncommonTrapCall(Value trapRequest, Value mode, SaveRegistersOp saveRegisterOp) {
-        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(UNCOMMON_TRAP);
-
-        Register thread = getProviders().getRegisters().getThreadRegister();
-        append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
-        Variable result = super.emitForeignCall(linkage, null, thread.asValue(LIRKind.value(AMD64Kind.QWORD)), trapRequest, mode);
-        append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), config.threadLastJavaPcOffset(), thread));
-
-        Map<LIRFrameState, SaveRegistersOp> calleeSaveInfo = getResult().getCalleeSaveInfo();
-        assert !calleeSaveInfo.containsKey(currentRuntimeCallInfo);
-        calleeSaveInfo.put(currentRuntimeCallInfo, saveRegisterOp);
-
-        return result;
-    }
-
-    @Override
-    public Value emitDeoptimizationFetchUnrollInfoCall(Value mode, SaveRegistersOp saveRegisterOp) {
-        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(FETCH_UNROLL_INFO);
-
-        Register thread = getProviders().getRegisters().getThreadRegister();
-        append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
-        Variable result = super.emitForeignCall(linkage, null, thread.asValue(LIRKind.value(AMD64Kind.QWORD)), mode);
-        append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), config.threadLastJavaPcOffset(), thread));
-
-        Map<LIRFrameState, SaveRegistersOp> calleeSaveInfo = getResult().getCalleeSaveInfo();
-        assert !calleeSaveInfo.containsKey(currentRuntimeCallInfo);
-        calleeSaveInfo.put(currentRuntimeCallInfo, saveRegisterOp);
-
-        return result;
-    }
-
-    @Override
-    public void emitTailcall(Value[] args, Value address) {
-        append(new AMD64TailcallOp(args, address));
-    }
-
-    @Override
-    public void emitCCall(long address, CallingConvention nativeCallingConvention, Value[] args, int numberOfFloatingPointArguments) {
-        Value[] argLocations = new Value[args.length];
-        getResult().getFrameMapBuilder().callsMethod(nativeCallingConvention);
-        // TODO(mg): in case a native function uses floating point varargs, the ABI requires that
-        // RAX contains the length of the varargs
-        PrimitiveConstant intConst = JavaConstant.forInt(numberOfFloatingPointArguments);
-        AllocatableValue numberOfFloatingPointArgumentsRegister = AMD64.rax.asValue(LIRKind.value(AMD64Kind.DWORD));
-        emitMoveConstant(numberOfFloatingPointArgumentsRegister, intConst);
-        for (int i = 0; i < args.length; i++) {
-            Value arg = args[i];
-            AllocatableValue loc = nativeCallingConvention.getArgument(i);
-            emitMove(loc, arg);
-            argLocations[i] = loc;
-        }
-        Value ptr = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(address));
-        append(new AMD64CCall(nativeCallingConvention.getReturn(), ptr, numberOfFloatingPointArgumentsRegister, argLocations));
-    }
-
-    @Override
-    public void emitUnwind(Value exception) {
-        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER);
-        CallingConvention outgoingCc = linkage.getOutgoingCallingConvention();
-        assert outgoingCc.getArgumentCount() == 2;
-        RegisterValue exceptionParameter = (RegisterValue) outgoingCc.getArgument(0);
-        emitMove(exceptionParameter, exception);
-        append(new AMD64HotSpotUnwindOp(exceptionParameter));
-    }
-
-    private void moveDeoptValuesToThread(Value actionAndReason, Value speculation) {
-        moveValueToThread(actionAndReason, config.pendingDeoptimizationOffset);
-        moveValueToThread(speculation, config.pendingFailedSpeculationOffset);
-    }
-
-    private void moveValueToThread(Value v, int offset) {
-        LIRKind wordKind = LIRKind.value(target().arch.getWordKind());
-        RegisterValue thread = getProviders().getRegisters().getThreadRegister().asValue(wordKind);
-        AMD64AddressValue address = new AMD64AddressValue(wordKind, thread, offset);
-        arithmeticLIRGen.emitStore(v.getValueKind(), address, v, null);
-    }
-
-    @Override
-    public void emitDeoptimize(Value actionAndReason, Value speculation, LIRFrameState state) {
-        moveDeoptValuesToThread(actionAndReason, speculation);
-        append(new AMD64DeoptimizeOp(state));
-    }
-
-    @Override
-    public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) {
-        Value actionAndReason = emitJavaConstant(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0));
-        Value nullValue = emitConstant(LIRKind.reference(AMD64Kind.QWORD), JavaConstant.NULL_POINTER);
-        moveDeoptValuesToThread(actionAndReason, nullValue);
-        append(new AMD64HotSpotDeoptimizeCallerOp());
-    }
-
-    @Override
-    public void beforeRegisterAllocation() {
-        super.beforeRegisterAllocation();
-        boolean hasDebugInfo = getResult().getLIR().hasDebugInfo();
-        AllocatableValue savedRbp = saveRbp.finalize(hasDebugInfo);
-        if (hasDebugInfo) {
-            getResult().setDeoptimizationRescueSlot(((AMD64FrameMapBuilder) getResult().getFrameMapBuilder()).allocateDeoptimizationRescueSlot());
-        }
-
-        getResult().setMaxInterpreterFrameSize(debugInfoBuilder.maxInterpreterFrameSize());
-
-        for (AMD64HotSpotRestoreRbpOp op : epilogueOps) {
-            op.setSavedRbp(savedRbp);
-        }
-        if (BenchmarkCounters.enabled) {
-            // ensure that the rescue slot is available
-            LIRInstruction op = getOrInitRescueSlotOp();
-            // insert dummy instruction into the start block
-            LIR lir = getResult().getLIR();
-            List<LIRInstruction> instructions = lir.getLIRforBlock(lir.getControlFlowGraph().getStartBlock());
-            instructions.add(1, op);
-            Debug.dump(Debug.INFO_LOG_LEVEL, lir, "created rescue dummy op");
-        }
-    }
-
-    @Override
-    public void emitPushInterpreterFrame(Value frameSize, Value framePc, Value senderSp, Value initialInfo) {
-        Variable frameSizeVariable = load(frameSize);
-        Variable framePcVariable = load(framePc);
-        Variable senderSpVariable = load(senderSp);
-        Variable initialInfoVariable = load(initialInfo);
-        append(new AMD64HotSpotPushInterpreterFrameOp(frameSizeVariable, framePcVariable, senderSpVariable, initialInfoVariable, config));
-    }
-
-    @Override
-    public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
-        LIRKind inputKind = pointer.getValueKind(LIRKind.class);
-        assert inputKind.getPlatformKind() == AMD64Kind.QWORD;
-        if (inputKind.isReference(0)) {
-            // oop
-            Variable result = newVariable(LIRKind.reference(AMD64Kind.DWORD));
-            append(new AMD64HotSpotMove.CompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
-            return result;
-        } else {
-            // metaspace pointer
-            Variable result = newVariable(LIRKind.value(AMD64Kind.DWORD));
-            AllocatableValue base = Value.ILLEGAL;
-            if (encoding.base != 0 || GeneratePIC.getValue()) {
-                if (GeneratePIC.getValue()) {
-                    Variable baseAddress = newVariable(LIRKind.value(AMD64Kind.QWORD));
-                    AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
-                    append(move);
-                    base = baseAddress;
-                } else {
-                    base = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(encoding.base));
-                }
-            }
-            append(new AMD64HotSpotMove.CompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
-            return result;
-        }
-    }
-
-    @Override
-    public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
-        LIRKind inputKind = pointer.getValueKind(LIRKind.class);
-        assert inputKind.getPlatformKind() == AMD64Kind.DWORD;
-        if (inputKind.isReference(0)) {
-            // oop
-            Variable result = newVariable(LIRKind.reference(AMD64Kind.QWORD));
-            append(new AMD64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
-            return result;
-        } else {
-            // metaspace pointer
-            Variable result = newVariable(LIRKind.value(AMD64Kind.QWORD));
-            AllocatableValue base = Value.ILLEGAL;
-            if (encoding.base != 0 || GeneratePIC.getValue()) {
-                if (GeneratePIC.getValue()) {
-                    Variable baseAddress = newVariable(LIRKind.value(AMD64Kind.QWORD));
-                    AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
-                    append(move);
-                    base = baseAddress;
-                } else {
-                    base = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(encoding.base));
-                }
-            }
-            append(new AMD64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
-            return result;
-        }
-    }
-
-    @Override
-    public void emitNullCheck(Value address, LIRFrameState state) {
-        if (address.getValueKind().getPlatformKind() == AMD64Kind.DWORD) {
-            CompressEncoding encoding = config.getOopEncoding();
-            Value uncompressed;
-            if (encoding.shift <= 3) {
-                LIRKind wordKind = LIRKind.unknownReference(target().arch.getWordKind());
-                uncompressed = new AMD64AddressValue(wordKind, getProviders().getRegisters().getHeapBaseRegister().asValue(wordKind), asAllocatable(address), Scale.fromInt(1 << encoding.shift), 0);
-            } else {
-                uncompressed = emitUncompress(address, encoding, false);
-            }
-            append(new AMD64Move.NullCheckOp(asAddressValue(uncompressed), state));
-        } else {
-            super.emitNullCheck(address, state);
-        }
-    }
-
-    @Override
-    public LIRInstruction createBenchmarkCounter(String name, String group, Value increment) {
-        if (BenchmarkCounters.enabled) {
-            return new AMD64HotSpotCounterOp(name, group, increment, getProviders().getRegisters(), config, getOrInitRescueSlot());
-        }
-        throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
-    }
-
-    @Override
-    public LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments) {
-        if (BenchmarkCounters.enabled) {
-            return new AMD64HotSpotCounterOp(names, groups, increments, getProviders().getRegisters(), config, getOrInitRescueSlot());
-        }
-        throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
-    }
-
-    @Override
-    public void emitPrefetchAllocate(Value address) {
-        append(new AMD64PrefetchOp(asAddressValue(address), config.allocatePrefetchInstr));
-    }
-
-    @Override
-    protected StrategySwitchOp createStrategySwitchOp(SwitchStrategy strategy, LabelRef[] keyTargets, LabelRef defaultTarget, Variable key, AllocatableValue temp) {
-        return new AMD64HotSpotStrategySwitchOp(strategy, keyTargets, defaultTarget, key, temp);
-    }
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java
deleted file mode 100644
index 28e2c0d..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.hotspot.amd64;
-
-import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
-import static jdk.vm.ci.code.ValueUtil.asRegister;
-import jdk.vm.ci.meta.AllocatableValue;
-
-import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler;
-import org.graalvm.compiler.debug.GraalError;
-import org.graalvm.compiler.lir.LIRInstructionClass;
-import org.graalvm.compiler.lir.amd64.AMD64LIRInstruction;
-import org.graalvm.compiler.lir.asm.CompilationResultBuilder;
-
-public final class AMD64HotSpotLoadConfigValueOp extends AMD64LIRInstruction {
-
-    public static final LIRInstructionClass<AMD64HotSpotLoadConfigValueOp> TYPE = LIRInstructionClass.create(AMD64HotSpotLoadConfigValueOp.class);
-
-    @Def({OperandFlag.REG}) protected AllocatableValue result;
-    private final int markId;
-
-    public AMD64HotSpotLoadConfigValueOp(int markId, AllocatableValue result) {
-        super(TYPE);
-        this.result = result;
-        this.markId = markId;
-    }
-
-    @Override
-    public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
-        if (GeneratePIC.getValue()) {
-            masm.movq(asRegister(result), masm.getPlaceholder(-1));
-        } else {
-            throw GraalError.unimplemented();
-        }
-        crb.recordMark(markId);
-    }
-
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
deleted file mode 100644
index 898d688..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
+++ /dev/null
@@ -1,793 +0,0 @@
-/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.hotspot;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-
-import org.graalvm.compiler.api.replacements.Fold;
-import org.graalvm.compiler.api.replacements.Fold.InjectedParameter;
-import org.graalvm.compiler.hotspot.nodes.GraalHotSpotVMConfigNode;
-
-import jdk.vm.ci.common.JVMCIError;
-import jdk.vm.ci.hotspot.HotSpotVMConfigAccess;
-import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
-
-/**
- * Used to access native configuration details.
- */
-public class GraalHotSpotVMConfig extends HotSpotVMConfigAccess {
-
-    /**
-     * Sentinel value to use for an {@linkplain InjectedParameter injected}
-     * {@link GraalHotSpotVMConfig} parameter to a {@linkplain Fold foldable} method.
-     */
-    public static final GraalHotSpotVMConfig INJECTED_VMCONFIG = null;
-
-    private final boolean isJDK8 = System.getProperty("java.specification.version").compareTo("1.9") < 0;
-    public final String osName = getHostOSName();
-    public final String osArch = getHostArchitectureName();
-    public final boolean windowsOs = System.getProperty("os.name", "").startsWith("Windows");
-    public final boolean linuxOs = System.getProperty("os.name", "").startsWith("Linux");
-
-    GraalHotSpotVMConfig(HotSpotVMConfigStore store) {
-        super(store);
-
-        oopEncoding = new CompressEncoding(narrowOopBase, narrowOopShift, logMinObjAlignment());
-        klassEncoding = new CompressEncoding(narrowKlassBase, narrowKlassShift, logKlassAlignment);
-
-        assert check();
-    }
-
-    /**
-     * Gets the value of a static C++ field under two possible names. {@code name} is the preferred
-     * name and will be checked first.
-     *
-     * @param name fully qualified name of the field
-     * @param alternateName fully qualified alternate name of the field
-     * @param type the boxed type to which the constant value will be converted
-     * @param cppType if non-null, the expected C++ type of the field (e.g., {@code "HeapWord*"})
-     * @return the value of the requested field
-     * @throws JVMCIError if the field is not static or not present
-     */
-    public <T> T getFieldValueWithAlternate(String name, String alternateName, Class<T> type, String cppType) {
-        try {
-            return getFieldValue(name, type, cppType);
-        } catch (JVMCIError e) {
-            try {
-                return getFieldValue(alternateName, type, cppType);
-            } catch (JVMCIError e2) {
-                throw new JVMCIError("expected VM field not found: " + name + " or " + alternateName);
-            }
-        }
-    }
-
-    private final CompressEncoding oopEncoding;
-    private final CompressEncoding klassEncoding;
-
-    public CompressEncoding getOopEncoding() {
-        return oopEncoding;
-    }
-
-    public CompressEncoding getKlassEncoding() {
-        return klassEncoding;
-    }
-
-    /**
-     * Gets the host operating system name.
-     */
-    private static String getHostOSName() {
-        String osName = System.getProperty("os.name");
-        switch (osName) {
-            case "Linux":
-                osName = "linux";
-                break;
-            case "SunOS":
-                osName = "solaris";
-                break;
-            case "Mac OS X":
-                osName = "bsd";
-                break;
-            default:
-                // Of course Windows is different...
-                if (osName.startsWith("Windows")) {
-                    osName = "windows";
-                } else {
-                    throw new JVMCIError("Unexpected OS name: " + osName);
-                }
-        }
-        return osName;
-    }
-
-    private static String getHostArchitectureName() {
-        String arch = System.getProperty("os.arch");
-        switch (arch) {
-            case "x86_64":
-                arch = "amd64";
-                break;
-            case "sparcv9":
-                arch = "sparc";
-                break;
-        }
-        return arch;
-    }
-
-    private final Integer intRequiredOnAMD64 = osArch.equals("amd64") ? null : 0;
-    private final Integer intNotPresentInJDK8 = isJDK8 ? 0 : null;
-    private final Long longNotPresentInJDK8 = isJDK8 ? 0L : null;
-
-    public final boolean cAssertions = getConstant("ASSERT", Boolean.class);
-
-    public final int codeEntryAlignment = getFlag("CodeEntryAlignment", Integer.class);
-    public final boolean enableContended = getFlag("EnableContended", Boolean.class);
-    public final boolean restrictContended = getFlag("RestrictContended", Boolean.class);
-    public final int contendedPaddingWidth = getFlag("ContendedPaddingWidth", Integer.class);
-    public final int fieldsAllocationStyle = getFlag("FieldsAllocationStyle", Integer.class);
-    public final boolean compactFields = getFlag("CompactFields", Boolean.class);
-    public final boolean verifyOops = getFlag("VerifyOops", Boolean.class);
-    public final boolean ciTime = getFlag("CITime", Boolean.class);
-    public final boolean ciTimeEach = getFlag("CITimeEach", Boolean.class);
-    public final int compileTheWorldStartAt = getFlag("CompileTheWorldStartAt", Integer.class, 1);
-    public final int compileTheWorldStopAt = getFlag("CompileTheWorldStopAt", Integer.class, Integer.MAX_VALUE);
-    public final boolean dontCompileHugeMethods = getFlag("DontCompileHugeMethods", Boolean.class);
-    public final int hugeMethodLimit = getFlag("HugeMethodLimit", Integer.class);
-    public final boolean printInlining = getFlag("PrintInlining", Boolean.class);
-    public final boolean inline = getFlag("Inline", Boolean.class);
-    public final boolean useFastLocking = getFlag("JVMCIUseFastLocking", Boolean.class);
-    public final boolean forceUnreachable = getFlag("ForceUnreachable", Boolean.class);
-    public final int codeSegmentSize = getFlag("CodeCacheSegmentSize", Integer.class);
-    public final boolean foldStableValues = getFlag("FoldStableValues", Boolean.class);
-
-    public final boolean useTLAB = getFlag("UseTLAB", Boolean.class);
-    public final boolean useBiasedLocking = getFlag("UseBiasedLocking", Boolean.class);
-    public final boolean usePopCountInstruction = getFlag("UsePopCountInstruction", Boolean.class);
-    public final boolean useAESIntrinsics = getFlag("UseAESIntrinsics", Boolean.class);
-    public final boolean useCRC32Intrinsics = getFlag("UseCRC32Intrinsics", Boolean.class);
-
-    private final boolean useMultiplyToLenIntrinsic = getFlag("UseMultiplyToLenIntrinsic", Boolean.class);
-    private final boolean useSHA1Intrinsics = getFlag("UseSHA1Intrinsics", Boolean.class);
-    private final boolean useSHA256Intrinsics = getFlag("UseSHA256Intrinsics", Boolean.class);
-    private final boolean useSHA512Intrinsics = getFlag("UseSHA512Intrinsics", Boolean.class);
-    private final boolean useMontgomeryMultiplyIntrinsic = getFlag("UseMontgomeryMultiplyIntrinsic", Boolean.class, false);
-    private final boolean useMontgomerySquareIntrinsic = getFlag("UseMontgomerySquareIntrinsic", Boolean.class, false);
-    private final boolean useMulAddIntrinsic = getFlag("UseMulAddIntrinsic", Boolean.class, false);
-    private final boolean useSquareToLenIntrinsic = getFlag("UseSquareToLenIntrinsic", Boolean.class, false);
-
-    /*
-     * These are methods because in some JDKs the flags are visible but the stubs themselves haven't
-     * been exported so we have to check both if the flag is on and if we have the stub.
-     */
-    public boolean useMultiplyToLenIntrinsic() {
-        return useMultiplyToLenIntrinsic && multiplyToLen != 0;
-    }
-
-    public boolean useSHA1Intrinsics() {
-        return useSHA1Intrinsics && sha1ImplCompress != 0;
-    }
-
-    public boolean useSHA256Intrinsics() {
-        return useSHA256Intrinsics && sha256ImplCompress != 0;
-    }
-
-    public boolean useSHA512Intrinsics() {
-        return useSHA512Intrinsics && sha512ImplCompress != 0;
-    }
-
-    public boolean useMontgomeryMultiplyIntrinsic() {
-        return useMontgomeryMultiplyIntrinsic && montgomeryMultiply != 0;
-    }
-
-    public boolean useMontgomerySquareIntrinsic() {
-        return useMontgomerySquareIntrinsic && montgomerySquare != 0;
-    }
-
-    public boolean useMulAddIntrinsic() {
-        return useMulAddIntrinsic && mulAdd != 0;
-    }
-
-    public boolean useSquareToLenIntrinsic() {
-        return useSquareToLenIntrinsic && squareToLen != 0;
-    }
-
-    public final boolean useG1GC = getFlag("UseG1GC", Boolean.class);
-    public final boolean useCMSGC = getFlag("UseConcMarkSweepGC", Boolean.class);
-
-    public final int allocatePrefetchStyle = getFlag("AllocatePrefetchStyle", Integer.class);
-    public final int allocatePrefetchInstr = getFlag("AllocatePrefetchInstr", Integer.class);
-    public final int allocatePrefetchLines = getFlag("AllocatePrefetchLines", Integer.class);
-    public final int allocateInstancePrefetchLines = getFlag("AllocateInstancePrefetchLines", Integer.class);
-    public final int allocatePrefetchStepSize = getFlag("AllocatePrefetchStepSize", Integer.class);
-    public final int allocatePrefetchDistance = getFlag("AllocatePrefetchDistance", Integer.class);
-
-    private final long universeCollectedHeap = getFieldValue("CompilerToVM::Data::Universe_collectedHeap", Long.class, "CollectedHeap*");
-    private final int collectedHeapTotalCollectionsOffset = getFieldOffset("CollectedHeap::_total_collections", Integer.class, "unsigned int");
-
-    public long gcTotalCollectionsAddress() {
-        return universeCollectedHeap + collectedHeapTotalCollectionsOffset;
-    }
-
-    public final boolean useDeferredInitBarriers = getFlag("ReduceInitialCardMarks", Boolean.class);
-
-    // Compressed Oops related values.
-    public final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
-    public final boolean useCompressedClassPointers = getFlag("UseCompressedClassPointers", Boolean.class);
-
-    public final long narrowOopBase = getFieldValue("CompilerToVM::Data::Universe_narrow_oop_base", Long.class, "address");
-    public final int narrowOopShift = getFieldValue("CompilerToVM::Data::Universe_narrow_oop_shift", Integer.class, "int");
-    public final int objectAlignment = getFlag("ObjectAlignmentInBytes", Integer.class);
-
-    public final int minObjAlignment() {
-        return objectAlignment / heapWordSize;
-    }
-
-    public final int logMinObjAlignment() {
-        return (int) (Math.log(objectAlignment) / Math.log(2));
-    }
-
-    public final int narrowKlassSize = getTypeSize("narrowKlass");
-    public final long narrowKlassBase = getFieldValue("CompilerToVM::Data::Universe_narrow_klass_base", Long.class, "address");
-    public final int narrowKlassShift = getFieldValue("CompilerToVM::Data::Universe_narrow_klass_shift", Integer.class, "int");
-    public final int logKlassAlignment = getConstant("LogKlassAlignmentInBytes", Integer.class);
-
-    public final int stackShadowPages = getFlag("StackShadowPages", Integer.class);
-    public final int stackReservedPages = getFlag("StackReservedPages", Integer.class, 0);
-    public final boolean useStackBanging = getFlag("UseStackBanging", Boolean.class);
-    public final int stackBias = getConstant("STACK_BIAS", Integer.class);
-    public final int vmPageSize = getFieldValue("CompilerToVM::Data::vm_page_size", Integer.class, "int");
-
-    public final int markOffset = getFieldOffset("oopDesc::_mark", Integer.class, "markOop");
-    public final int hubOffset = getFieldOffset("oopDesc::_metadata._klass", Integer.class, "Klass*");
-
-    public final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, "markOop");
-    public final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*");
-    public final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*");
-    public final int superCheckOffsetOffset = getFieldOffset("Klass::_super_check_offset", Integer.class, "juint");
-    public final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*");
-    public final int secondarySupersOffset = getFieldOffset("Klass::_secondary_supers", Integer.class, "Array<Klass*>*");
-
-    public final int classMirrorOffset = getFieldOffset("Klass::_java_mirror", Integer.class, "oop");
-
-    public final int klassSuperKlassOffset = getFieldOffset("Klass::_super", Integer.class, "Klass*");
-    public final int klassModifierFlagsOffset = getFieldOffset("Klass::_modifier_flags", Integer.class, "jint");
-    public final int klassAccessFlagsOffset = getFieldOffset("Klass::_access_flags", Integer.class, "AccessFlags");
-    public final int klassLayoutHelperOffset = getFieldOffset("Klass::_layout_helper", Integer.class, "jint");
-
-    public final int klassLayoutHelperNeutralValue = getConstant("Klass::_lh_neutral_value", Integer.class);
-    public final int layoutHelperLog2ElementSizeShift = getConstant("Klass::_lh_log2_element_size_shift", Integer.class);
-    public final int layoutHelperLog2ElementSizeMask = getConstant("Klass::_lh_log2_element_size_mask", Integer.class);
-    public final int layoutHelperElementTypeShift = getConstant("Klass::_lh_element_type_shift", Integer.class);
-    public final int layoutHelperElementTypeMask = getConstant("Klass::_lh_element_type_mask", Integer.class);
-    public final int layoutHelperHeaderSizeShift = getConstant("Klass::_lh_header_size_shift", Integer.class);
-    public final int layoutHelperHeaderSizeMask = getConstant("Klass::_lh_header_size_mask", Integer.class);
-    public final int layoutHelperArrayTagShift = getConstant("Klass::_lh_array_tag_shift", Integer.class);
-    public final int layoutHelperArrayTagTypeValue = getConstant("Klass::_lh_array_tag_type_value", Integer.class);
-    public final int layoutHelperArrayTagObjectValue = getConstant("Klass::_lh_array_tag_obj_value", Integer.class);
-
-    /**
-     * This filters out the bit that differentiates a type array from an object array.
-     */
-    public int layoutHelperElementTypePrimitiveInPlace() {
-        return (layoutHelperArrayTagTypeValue & ~layoutHelperArrayTagObjectValue) << layoutHelperArrayTagShift;
-    }
-
-    public final int vtableEntrySize = getTypeSize("vtableEntry");
-    public final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*");
-
-    public final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1");
-    public final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*");
-    public final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*");
-    public final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int");
-    public final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int");
-
-    public final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class);
-    public final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class);
-
-    public final int arrayOopDescSize = getTypeSize("arrayOopDesc");
-
-    /**
-     * The offset of the array length word in an array object's header.
-     *
-     * See {@code arrayOopDesc::length_offset_in_bytes()}.
-     */
-    public final int arrayOopDescLengthOffset() {
-        return useCompressedClassPointers ? hubOffset + narrowKlassSize : arrayOopDescSize;
-    }
-
-    public final int arrayU1LengthOffset = getFieldOffset("Array<int>::_length", Integer.class, "int");
-    public final int arrayU1DataOffset = getFieldOffset("Array<u1>::_data", Integer.class);
-    public final int arrayU2DataOffset = getFieldOffset("Array<u2>::_data", Integer.class);
-    public final int metaspaceArrayLengthOffset = getFieldOffset("Array<Klass*>::_length", Integer.class, "int");
-    public final int metaspaceArrayBaseOffset = getFieldOffset("Array<Klass*>::_data[0]", Integer.class, "Klass*");
-
-    public final int arrayClassElementOffset = getFieldOffset("ObjArrayKlass::_element_klass", Integer.class, "Klass*");
-
-    public final int fieldInfoAccessFlagsOffset = getConstant("FieldInfo::access_flags_offset", Integer.class);
-    public final int fieldInfoNameIndexOffset = getConstant("FieldInfo::name_index_offset", Integer.class);
-    public final int fieldInfoSignatureIndexOffset = getConstant("FieldInfo::signature_index_offset", Integer.class);
-    public final int fieldInfoInitvalIndexOffset = getConstant("FieldInfo::initval_index_offset", Integer.class);
-    public final int fieldInfoLowPackedOffset = getConstant("FieldInfo::low_packed_offset", Integer.class);
-    public final int fieldInfoHighPackedOffset = getConstant("FieldInfo::high_packed_offset", Integer.class);
-    public final int fieldInfoFieldSlots = getConstant("FieldInfo::field_slots", Integer.class);
-
-    public final int fieldInfoTagSize = getConstant("FIELDINFO_TAG_SIZE", Integer.class);
-
-    public final int jvmAccMonitorMatch = getConstant("JVM_ACC_MONITOR_MATCH", Integer.class);
-    public final int jvmAccHasMonitorBytecodes = getConstant("JVM_ACC_HAS_MONITOR_BYTECODES", Integer.class);
-    public final int jvmAccHasFinalizer = getConstant("JVM_ACC_HAS_FINALIZER", Integer.class);
-    public final int jvmAccFieldInternal = getConstant("JVM_ACC_FIELD_INTERNAL", Integer.class);
-    public final int jvmAccFieldStable = getConstant("JVM_ACC_FIELD_STABLE", Integer.class);
-    public final int jvmAccFieldHasGenericSignature = getConstant("JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE", Integer.class);
-    public final int jvmAccWrittenFlags = getConstant("JVM_ACC_WRITTEN_FLAGS", Integer.class);
-    public final int jvmAccSynthetic = getConstant("JVM_ACC_SYNTHETIC", Integer.class);
-
-    public final int threadTlabOffset = getFieldOffset("Thread::_tlab", Integer.class, "ThreadLocalAllocBuffer");
-    public final int javaThreadAnchorOffset = getFieldOffset("JavaThread::_anchor", Integer.class, "JavaFrameAnchor");
-    public final int threadObjectOffset = getFieldOffset("JavaThread::_threadObj", Integer.class, "oop");
-    public final int osThreadOffset = getFieldOffset("JavaThread::_osthread", Integer.class, "OSThread*");
-    public final int javaThreadDirtyCardQueueOffset = getFieldOffset("JavaThread::_dirty_card_queue", Integer.class, "DirtyCardQueue");
-    public final int threadIsMethodHandleReturnOffset = getFieldOffset("JavaThread::_is_method_handle_return", Integer.class, "int");
-    public final int javaThreadSatbMarkQueueOffset = getFieldOffset("JavaThread::_satb_mark_queue", Integer.class);
-    public final int threadObjectResultOffset = getFieldOffset("JavaThread::_vm_result", Integer.class, "oop");
-    public final int jvmciCountersThreadOffset = getFieldOffset("JavaThread::_jvmci_counters", Integer.class, "jlong*");
-    public final int javaThreadReservedStackActivationOffset = getFieldOffset("JavaThread::_reserved_stack_activation", Integer.class, "address", intNotPresentInJDK8);
-
-    /**
-     * An invalid value for {@link #rtldDefault}.
-     */
-    public static final long INVALID_RTLD_DEFAULT_HANDLE = 0xDEADFACE;
-
-    /**
-     * Address of the library lookup routine. The C signature of this routine is:
-     *
-     * <pre>
-     *     void* (const char *filename, char *ebuf, int ebuflen)
-     * </pre>
-     */
-    public final long dllLoad = getAddress("os::dll_load");
-
-    /**
-     * Address of the library lookup routine. The C signature of this routine is:
-     *
-     * <pre>
-     *     void* (void* handle, const char* name)
-     * </pre>
-     */
-    public final long dllLookup = getAddress("os::dll_lookup");
-
-    /**
-     * A pseudo-handle which when used as the first argument to {@link #dllLookup} means lookup will
-     * return the first occurrence of the desired symbol using the default library search order. If
-     * this field is {@value #INVALID_RTLD_DEFAULT_HANDLE}, then this capability is not supported on
-     * the current platform.
-     */
-    public final long rtldDefault = getAddress("RTLD_DEFAULT", osName.equals("bsd") || osName.equals("linux") ? null : INVALID_RTLD_DEFAULT_HANDLE);
-
-    /**
-     * This field is used to pass exception objects into and out of the runtime system during
-     * exception handling for compiled code.
-     */
-    public final int threadExceptionOopOffset = getFieldOffset("JavaThread::_exception_oop", Integer.class, "oop");
-    public final int threadExceptionPcOffset = getFieldOffset("JavaThread::_exception_pc", Integer.class, "address");
-    public final int pendingExceptionOffset = getFieldOffset("ThreadShadow::_pending_exception", Integer.class, "oop");
-
-    public final int pendingDeoptimizationOffset = getFieldOffset("JavaThread::_pending_deoptimization", Integer.class, "int");
-    public final int pendingFailedSpeculationOffset = getFieldOffset("JavaThread::_pending_failed_speculation", Integer.class, "oop");
-    public final int pendingTransferToInterpreterOffset = getFieldOffset("JavaThread::_pending_transfer_to_interpreter", Integer.class, "bool");
-
-    private final int javaFrameAnchorLastJavaSpOffset = getFieldOffset("JavaFrameAnchor::_last_Java_sp", Integer.class, "intptr_t*");
-    private final int javaFrameAnchorLastJavaPcOffset = getFieldOffset("JavaFrameAnchor::_last_Java_pc", Integer.class, "address");
-
-    public int threadLastJavaSpOffset() {
-        return javaThreadAnchorOffset + javaFrameAnchorLastJavaSpOffset;
-    }
-
-    public int threadLastJavaPcOffset() {
-        return javaThreadAnchorOffset + javaFrameAnchorLastJavaPcOffset;
-    }
-
-    public int threadLastJavaFpOffset() {
-        assert osArch.equals("aarch64") || osArch.equals("amd64");
-        return javaThreadAnchorOffset + getFieldOffset("JavaFrameAnchor::_last_Java_fp", Integer.class, "intptr_t*");
-    }
-
-    public int threadJavaFrameAnchorFlagsOffset() {
-        assert osArch.equals("sparc");
-        return javaThreadAnchorOffset + getFieldOffset("JavaFrameAnchor::_flags", Integer.class, "int");
-    }
-
-    public final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, intRequiredOnAMD64);
-    public final int frameInterpreterFrameSenderSpOffset = getConstant("frame::interpreter_frame_sender_sp_offset", Integer.class, intRequiredOnAMD64);
-    public final int frameInterpreterFrameLastSpOffset = getConstant("frame::interpreter_frame_last_sp_offset", Integer.class, intRequiredOnAMD64);
-
-    private final int dirtyCardQueueBufferOffset = isJDK8 ? getFieldOffset("PtrQueue::_buf", Integer.class, "void**") : getConstant("dirtyCardQueueBufferOffset", Integer.class);
-    private final int dirtyCardQueueIndexOffset = isJDK8 ? getFieldOffset("PtrQueue::_index", Integer.class, "size_t") : getConstant("dirtyCardQueueIndexOffset", Integer.class);
-
-    private final int satbMarkQueueBufferOffset = getConstant("satbMarkQueueBufferOffset", Integer.class, intNotPresentInJDK8);
-    private final int satbMarkQueueIndexOffset = getConstant("satbMarkQueueIndexOffset", Integer.class, intNotPresentInJDK8);
-    private final int satbMarkQueueActiveOffset = isJDK8 ? getFieldOffset("PtrQueue::_active", Integer.class, "bool") : getConstant("satbMarkQueueActiveOffset", Integer.class, intNotPresentInJDK8);
-
-    public final int osThreadInterruptedOffset = getFieldOffset("OSThread::_interrupted", Integer.class, "jint");
-
-    public final long markOopDescHashShift = getConstant("markOopDesc::hash_shift", Long.class);
-
-    public final int biasedLockMaskInPlace = getConstant("markOopDesc::biased_lock_mask_in_place", Integer.class);
-    public final int ageMaskInPlace = getConstant("markOopDesc::age_mask_in_place", Integer.class);
-    public final int epochMaskInPlace = getConstant("markOopDesc::epoch_mask_in_place", Integer.class);
-    public final long markOopDescHashMask = getConstant("markOopDesc::hash_mask", Long.class);
-    public final long markOopDescHashMaskInPlace = getConstant("markOopDesc::hash_mask_in_place", Long.class);
-
-    public final int unlockedMask = getConstant("markOopDesc::unlocked_value", Integer.class);
-    public final int biasedLockPattern = getConstant("markOopDesc::biased_lock_pattern", Integer.class);
-
-    public final int markWordNoHashInPlace = getConstant("markOopDesc::no_hash_in_place", Integer.class);
-    public final int markWordNoLockInPlace = getConstant("markOopDesc::no_lock_in_place", Integer.class);
-
-    /**
-     * See {@code markOopDesc::prototype()}.
-     */
-    public long arrayPrototypeMarkWord() {
-        return markWordNoHashInPlace | markWordNoLockInPlace;
-    }
-
-    /**
-     * See {@code markOopDesc::copy_set_hash()}.
-     */
-    public long tlabIntArrayMarkWord() {
-        long tmp = arrayPrototypeMarkWord() & (~markOopDescHashMaskInPlace);
-        tmp |= ((0x2 & markOopDescHashMask) << markOopDescHashShift);
-        return tmp;
-    }
-
-    /**
-     * Mark word right shift to get identity hash code.
-     */
-    public final int identityHashCodeShift = getConstant("markOopDesc::hash_shift", Integer.class);
-
-    /**
-     * Identity hash code value when uninitialized.
-     */
-    public final int uninitializedIdentityHashCodeValue = getConstant("markOopDesc::no_hash", Integer.class);
-
-    public final int methodAccessFlagsOffset = getFieldOffset("Method::_access_flags", Integer.class, "AccessFlags");
-    public final int methodConstMethodOffset = getFieldOffset("Method::_constMethod", Integer.class, "ConstMethod*");
-    public final int methodIntrinsicIdOffset = getFieldOffset("Method::_intrinsic_id", Integer.class, isJDK8 ? "u1" : "u2");
-    public final int methodFlagsOffset = getFieldOffset("Method::_flags", Integer.class, isJDK8 ? "u1" : "u2");
-    public final int methodVtableIndexOffset = getFieldOffset("Method::_vtable_index", Integer.class, "int");
-
-    public final int methodCountersOffset = getFieldOffset("Method::_method_counters", Integer.class, "MethodCounters*");
-    public final int methodDataOffset = getFieldOffset("Method::_method_data", Integer.class, "MethodData*");
-    public final int methodCompiledEntryOffset = getFieldOffset("Method::_from_compiled_entry", Integer.class, "address");
-    public final int methodCodeOffset = getFieldOffset("Method::_code", Integer.class, isJDK8 ? "nmethod*" : "CompiledMethod*");
-
-    public final int methodFlagsCallerSensitive = getConstant("Method::_caller_sensitive", Integer.class);
-    public final int methodFlagsForceInline = getConstant("Method::_force_inline", Integer.class);
-    public final int methodFlagsDontInline = getConstant("Method::_dont_inline", Integer.class);
-    public final int methodFlagsHidden = getConstant("Method::_hidden", Integer.class);
-    public final int nonvirtualVtableIndex = getConstant("Method::nonvirtual_vtable_index", Integer.class);
-    public final int invalidVtableIndex = getConstant("Method::invalid_vtable_index", Integer.class);
-
-    public final int invocationCounterOffset = getFieldOffset("MethodCounters::_invocation_counter", Integer.class, "InvocationCounter");
-    public final int backedgeCounterOffset = getFieldOffset("MethodCounters::_backedge_counter", Integer.class, "InvocationCounter");
-    public final int invocationCounterIncrement = getConstant("InvocationCounter::count_increment", Integer.class, intNotPresentInJDK8);
-    public final int invocationCounterShift = getConstant("InvocationCounter::count_shift", Integer.class, intNotPresentInJDK8);
-
-    public final int nmethodEntryOffset = getFieldOffset("nmethod::_verified_entry_point",
-                    Integer.class, "address");
-    public final int compilationLevelFullOptimization = getConstant("CompLevel_full_optimization",
-                    Integer.class);
-
-    public final int constantPoolSize = getTypeSize("ConstantPool");
-    public final int constantPoolLengthOffset = getFieldOffset("ConstantPool::_length",
-                    Integer.class, "int");
-
-    public final int heapWordSize = getConstant("HeapWordSize", Integer.class);
-
-    /**
-     * Bit pattern that represents a non-oop. Neither the high bits nor the low bits of this value
-     * are allowed to look like (respectively) the high or low bits of a real oop.
-     */
-    public final long nonOopBits = getFieldValue("CompilerToVM::Data::Universe_non_oop_bits", Long.class, "void*");
-
-    public final long verifyOopCounterAddress = getFieldAddress("StubRoutines::_verify_oop_count", "jint");
-    public final long verifyOopMask = getFieldValue("CompilerToVM::Data::Universe_verify_oop_mask", Long.class, "uintptr_t");
-    public final long verifyOopBits = getFieldValue("CompilerToVM::Data::Universe_verify_oop_bits", Long.class, "uintptr_t");
-
-    public final int logOfHRGrainBytes = getFieldValue("HeapRegion::LogOfHRGrainBytes", Integer.class, "int");
-
-    public final byte dirtyCardValue = isJDK8 ? getFieldValue("CompilerToVM::Data::dirty_card", Byte.class, "int") : getConstant("CardTableModRefBS::dirty_card", Byte.class);
-    public final byte g1YoungCardValue = isJDK8 ? getFieldValue("CompilerToVM::Data::g1_young_card", Byte.class, "int") : getConstant("G1SATBCardTableModRefBS::g1_young_gen", Byte.class);
-
-    public final long cardtableStartAddress = getFieldValue("CompilerToVM::Data::cardtable_start_address", Long.class, "jbyte*");
-    public final int cardtableShift = getFieldValue("CompilerToVM::Data::cardtable_shift", Integer.class, "int");
-
-    /**
-     * This is the largest stack offset encodeable in an OopMapValue. Offsets larger than this will
-     * throw an exception during code installation.
-     */
-    public final int maxOopMapStackOffset = getFieldValueWithAlternate("CompilerToVM::Data::_max_oop_map_stack_offset", "JVMCIRuntime::max_oop_map_stack_offset", Integer.class, "int");
-
-    public final long safepointPollingAddress = getFieldValue("os::_polling_page", Long.class, "address");
-
-    // G1 Collector Related Values.
-
-    public int g1CardQueueIndexOffset() {
-        return javaThreadDirtyCardQueueOffset + dirtyCardQueueIndexOffset;
-    }
-
-    public int g1CardQueueBufferOffset() {
-        return javaThreadDirtyCardQueueOffset + dirtyCardQueueBufferOffset;
-    }
-
-    public int g1SATBQueueMarkingOffset() {
-        return javaThreadSatbMarkQueueOffset + satbMarkQueueActiveOffset;
-    }
-
-    public int g1SATBQueueIndexOffset() {
-        return javaThreadSatbMarkQueueOffset + (isJDK8 ? dirtyCardQueueIndexOffset : satbMarkQueueIndexOffset);
-    }
-
-    public int g1SATBQueueBufferOffset() {
-        return javaThreadSatbMarkQueueOffset + (isJDK8 ? dirtyCardQueueBufferOffset : satbMarkQueueBufferOffset);
-    }
-
-    public final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int");
-    public final int arrayKlassOffset = getFieldValue("java_lang_Class::_array_klass_offset", Integer.class, "int");
-
-    public final int basicLockSize = getTypeSize("BasicLock");
-    public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, "markOop");
-
-    public final int threadAllocatedBytesOffset = getFieldOffset("Thread::_allocated_bytes", Integer.class, "jlong");
-
-    public final int tlabRefillWasteIncrement = getFlag("TLABWasteIncrement", Integer.class);
-
-    private final int threadLocalAllocBufferStartOffset = getFieldOffset("ThreadLocalAllocBuffer::_start", Integer.class, "HeapWord*");
-    private final int threadLocalAllocBufferEndOffset = getFieldOffset("ThreadLocalAllocBuffer::_end", Integer.class, "HeapWord*");
-    private final int threadLocalAllocBufferTopOffset = getFieldOffset("ThreadLocalAllocBuffer::_top", Integer.class, "HeapWord*");
-    private final int threadLocalAllocBufferPfTopOffset = getFieldOffset("ThreadLocalAllocBuffer::_pf_top", Integer.class, "HeapWord*");
-    private final int threadLocalAllocBufferSlowAllocationsOffset = getFieldOffset("ThreadLocalAllocBuffer::_slow_allocations", Integer.class, "unsigned");
-    private final int threadLocalAllocBufferFastRefillWasteOffset = getFieldOffset("ThreadLocalAllocBuffer::_fast_refill_waste", Integer.class, "unsigned");
-    private final int threadLocalAllocBufferNumberOfRefillsOffset = getFieldOffset("ThreadLocalAllocBuffer::_number_of_refills", Integer.class, "unsigned");
-    private final int threadLocalAllocBufferRefillWasteLimitOffset = getFieldOffset("ThreadLocalAllocBuffer::_refill_waste_limit", Integer.class, "size_t");
-    private final int threadLocalAllocBufferDesiredSizeOffset = getFieldOffset("ThreadLocalAllocBuffer::_desired_size", Integer.class, "size_t");
-
-    public int tlabSlowAllocationsOffset() {
-        return threadTlabOffset + threadLocalAllocBufferSlowAllocationsOffset;
-    }
-
-    public int tlabFastRefillWasteOffset() {
-        return threadTlabOffset + threadLocalAllocBufferFastRefillWasteOffset;
-    }
-
-    public int tlabNumberOfRefillsOffset() {
-        return threadTlabOffset + threadLocalAllocBufferNumberOfRefillsOffset;
-    }
-
-    public int tlabRefillWasteLimitOffset() {
-        return threadTlabOffset + threadLocalAllocBufferRefillWasteLimitOffset;
-    }
-
-    public int threadTlabSizeOffset() {
-        return threadTlabOffset + threadLocalAllocBufferDesiredSizeOffset;
-    }
-
-    public int threadTlabStartOffset() {
-        return threadTlabOffset + threadLocalAllocBufferStartOffset;
-    }
-
-    public int threadTlabEndOffset() {
-        return threadTlabOffset + threadLocalAllocBufferEndOffset;
-    }
-
-    public int threadTlabTopOffset() {
-        return threadTlabOffset + threadLocalAllocBufferTopOffset;
-    }
-
-    public int threadTlabPfTopOffset() {
-        return threadTlabOffset + threadLocalAllocBufferPfTopOffset;
-    }
-
-    public final int tlabAlignmentReserve = getFieldValue("CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve", Integer.class, "size_t");
-
-    public final boolean tlabStats = getFlag("TLABStats", Boolean.class);
-
-    // FIXME This is only temporary until the GC code is changed.
-    public final boolean inlineContiguousAllocationSupported = getFieldValue("CompilerToVM::Data::_supports_inline_contig_alloc", Boolean.class);
-    public final long heapEndAddress = getFieldValue("CompilerToVM::Data::_heap_end_addr", Long.class, "HeapWord**");
-    public final long heapTopAddress = getFieldValue("CompilerToVM::Data::_heap_top_addr", Long.class, isJDK8 ? "HeapWord**" : "HeapWord* volatile*");
-
-    public final long inlineCacheMissStub = getFieldValue("CompilerToVM::Data::SharedRuntime_ic_miss_stub", Long.class, "address");
-    public final long handleWrongMethodStub = getFieldValue("CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", Long.class, "address");
-
-    public final long handleDeoptStub = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", Long.class, "address");
-    public final long uncommonTrapStub = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", Long.class, "address");
-
-    public final long codeCacheLowBound = getFieldValue(isJDK8 ? "CompilerToVM::Data::CodeCache_low_bound" : "CodeCache::_low_bound", Long.class, "address");
-    public final long codeCacheHighBound = getFieldValue(isJDK8 ? "CompilerToVM::Data::CodeCache_high_bound" : "CodeCache::_high_bound", Long.class, "address");
-
-    public final long aescryptEncryptBlockStub = getFieldValue("StubRoutines::_aescrypt_encryptBlock", Long.class, "address");
-    public final long aescryptDecryptBlockStub = getFieldValue("StubRoutines::_aescrypt_decryptBlock", Long.class, "address");
-    public final long cipherBlockChainingEncryptAESCryptStub = getFieldValue("StubRoutines::_cipherBlockChaining_encryptAESCrypt", Long.class, "address");
-    public final long cipherBlockChainingDecryptAESCryptStub = getFieldValue("StubRoutines::_cipherBlockChaining_decryptAESCrypt", Long.class, "address");
-    public final long updateBytesCRC32Stub = getFieldValue("StubRoutines::_updateBytesCRC32", Long.class, "address");
-    public final long crcTableAddress = getFieldValue("StubRoutines::_crc_table_adr", Long.class, "address");
-
-    public final long sha1ImplCompress = getFieldValue("StubRoutines::_sha1_implCompress", Long.class, "address", 0L);
-    public final long sha1ImplCompressMB = getFieldValue("StubRoutines::_sha1_implCompressMB", Long.class, "address", 0L);
-    public final long sha256ImplCompress = getFieldValue("StubRoutines::_sha256_implCompress", Long.class, "address", 0L);
-    public final long sha256ImplCompressMB = getFieldValue("StubRoutines::_sha256_implCompressMB", Long.class, "address", 0L);
-    public final long sha512ImplCompress = getFieldValue("StubRoutines::_sha512_implCompress", Long.class, "address", 0L);
-    public final long sha512ImplCompressMB = getFieldValue("StubRoutines::_sha512_implCompressMB", Long.class, "address", 0L);
-    public final long multiplyToLen = getFieldValue("StubRoutines::_multiplyToLen", Long.class, "address", 0L);
-
-    public final long counterModeAESCrypt = getFieldValue("StubRoutines::_counterMode_AESCrypt", Long.class, "address", 0L);
-    public final long ghashProcessBlocks = getFieldValue("StubRoutines::_ghash_processBlocks", Long.class, "address", 0L);
-    public final long crc32cTableTddr = getFieldValue("StubRoutines::_crc32c_table_addr", Long.class, "address", 0L);
-    public final long updateBytesCRC32C = getFieldValue("StubRoutines::_updateBytesCRC32C", Long.class, "address", 0L);
-    public final long updateBytesAdler32 = getFieldValue("StubRoutines::_updateBytesAdler32", Long.class, "address", 0L);
-    public final long squareToLen = getFieldValue("StubRoutines::_squareToLen", Long.class, "address", 0L);
-    public final long mulAdd = getFieldValue("StubRoutines::_mulAdd", Long.class, "address", 0L);
-    public final long montgomeryMultiply = getFieldValue("StubRoutines::_montgomeryMultiply", Long.class, "address", 0L);
-    public final long montgomerySquare = getFieldValue("StubRoutines::_montgomerySquare", Long.class, "address", 0L);
-    public final long vectorizedMismatch = getFieldValue("StubRoutines::_vectorizedMismatch", Long.class, "address", 0L);
-
-    public final long throwDelayedStackOverflowErrorEntry = getFieldValue("StubRoutines::_throw_delayed_StackOverflowError_entry", Long.class, "address", longNotPresentInJDK8);
-
-    public final long jbyteArraycopy = getFieldValue("StubRoutines::_jbyte_arraycopy", Long.class, "address");
-    public final long jshortArraycopy = getFieldValue("StubRoutines::_jshort_arraycopy", Long.class, "address");
-    public final long jintArraycopy = getFieldValue("StubRoutines::_jint_arraycopy", Long.class, "address");
-    public final long jlongArraycopy = getFieldValue("StubRoutines::_jlong_arraycopy", Long.class, "address");
-    public final long oopArraycopy = getFieldValue("StubRoutines::_oop_arraycopy", Long.class, "address");
-    public final long oopArraycopyUninit = getFieldValue("StubRoutines::_oop_arraycopy_uninit", Long.class, "address");
-    public final long jbyteDisjointArraycopy = getFieldValue("StubRoutines::_jbyte_disjoint_arraycopy", Long.class, "address");
-    public final long jshortDisjointArraycopy = getFieldValue("StubRoutines::_jshort_disjoint_arraycopy", Long.class, "address");
-    public final long jintDisjointArraycopy = getFieldValue("StubRoutines::_jint_disjoint_arraycopy", Long.class, "address");
-    public final long jlongDisjointArraycopy = getFieldValue("StubRoutines::_jlong_disjoint_arraycopy", Long.class, "address");
-    public final long oopDisjointArraycopy = getFieldValue("StubRoutines::_oop_disjoint_arraycopy", Long.class, "address");
-    public final long oopDisjointArraycopyUninit = getFieldValue("StubRoutines::_oop_disjoint_arraycopy_uninit", Long.class, "address");
-    public final long jbyteAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_jbyte_arraycopy", Long.class, "address");
-    public final long jshortAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_jshort_arraycopy", Long.class, "address");
-    public final long jintAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_jint_arraycopy", Long.class, "address");
-    public final long jlongAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_jlong_arraycopy", Long.class, "address");
-    public final long oopAlignedArraycopy = getFieldValue("StubRoutines::_arrayof_oop_arraycopy", Long.class, "address");
-    public final long oopAlignedArraycopyUninit = getFieldValue("StubRoutines::_arrayof_oop_arraycopy_uninit", Long.class, "address");
-    public final long jbyteAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_jbyte_disjoint_arraycopy", Long.class, "address");
-    public final long jshortAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_jshort_disjoint_arraycopy", Long.class, "address");
-    public final long jintAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_jint_disjoint_arraycopy", Long.class, "address");
-    public final long jlongAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_jlong_disjoint_arraycopy", Long.class, "address");
-    public final long oopAlignedDisjointArraycopy = getFieldValue("StubRoutines::_arrayof_oop_disjoint_arraycopy", Long.class, "address");
-    public final long oopAlignedDisjointArraycopyUninit = getFieldValue("StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit", Long.class, "address");
-    public final long checkcastArraycopy = getFieldValue("StubRoutines::_checkcast_arraycopy", Long.class, "address");
-    public final long checkcastArraycopyUninit = getFieldValue("StubRoutines::_checkcast_arraycopy_uninit", Long.class, "address");
-    public final long unsafeArraycopy = getFieldValue("StubRoutines::_unsafe_arraycopy", Long.class, "address");
-    public final long genericArraycopy = getFieldValue("StubRoutines::_generic_arraycopy", Long.class, "address");
-
-    public final long newInstanceAddress = getAddress("JVMCIRuntime::new_instance");
-    public final long newArrayAddress = getAddress("JVMCIRuntime::new_array");
-    public final long newMultiArrayAddress = getAddress("JVMCIRuntime::new_multi_array");
-    public final long dynamicNewArrayAddress = getAddress("JVMCIRuntime::dynamic_new_array");
-    public final long dynamicNewInstanceAddress = getAddress("JVMCIRuntime::dynamic_new_instance");
-
-    public final long threadIsInterruptedAddress = getAddress("JVMCIRuntime::thread_is_interrupted");
-    public final long vmMessageAddress = getAddress("JVMCIRuntime::vm_message");
-    public final long identityHashCodeAddress = getAddress("JVMCIRuntime::identity_hash_code");
-    public final long exceptionHandlerForPcAddress = getAddress("JVMCIRuntime::exception_handler_for_pc");
-    public final long monitorenterAddress = getAddress("JVMCIRuntime::monitorenter");
-    public final long monitorexitAddress = getAddress("JVMCIRuntime::monitorexit");
-    public final long throwAndPostJvmtiExceptionAddress = getAddress("JVMCIRuntime::throw_and_post_jvmti_exception");
-    public final long throwKlassExternalNameExceptionAddress = getAddress("JVMCIRuntime::throw_klass_external_name_exception");
-    public final long throwClassCastExceptionAddress = getAddress("JVMCIRuntime::throw_class_cast_exception");
-    public final long logPrimitiveAddress = getAddress("JVMCIRuntime::log_primitive");
-    public final long logObjectAddress = getAddress("JVMCIRuntime::log_object");
-    public final long logPrintfAddress = getAddress("JVMCIRuntime::log_printf");
-    public final long vmErrorAddress = getAddress("JVMCIRuntime::vm_error");
-    public final long loadAndClearExceptionAddress = getAddress("JVMCIRuntime::load_and_clear_exception");
-    public final long writeBarrierPreAddress = getAddress("JVMCIRuntime::write_barrier_pre");
-    public final long writeBarrierPostAddress = getAddress("JVMCIRuntime::write_barrier_post");
-    public final long validateObject = getAddress("JVMCIRuntime::validate_object");
-
-    public final long testDeoptimizeCallInt = getAddress("JVMCIRuntime::test_deoptimize_call_int");
-
-    public final long registerFinalizerAddress = getAddress("SharedRuntime::register_finalizer");
-    public final long exceptionHandlerForReturnAddressAddress = getAddress("SharedRuntime::exception_handler_for_return_address");
-    public final long osrMigrationEndAddress = getAddress("SharedRuntime::OSR_migration_end");
-    public final long enableStackReservedZoneAddress = getAddress("SharedRuntime::enable_stack_reserved_zone", longNotPresentInJDK8);
-
-    public final long javaTimeMillisAddress = getAddress("os::javaTimeMillis");
-    public final long javaTimeNanosAddress = getAddress("os::javaTimeNanos");
-    public final long arithmeticSinAddress = getFieldValue("CompilerToVM::Data::dsin", Long.class, "address");
-    public final long arithmeticCosAddress = getFieldValue("CompilerToVM::Data::dcos", Long.class, "address");
-    public final long arithmeticTanAddress = getFieldValue("CompilerToVM::Data::dtan", Long.class, "address");
-    public final long arithmeticExpAddress = getFieldValue("CompilerToVM::Data::dexp", Long.class, "address");
-    public final long arithmeticLogAddress = getFieldValue("CompilerToVM::Data::dlog", Long.class, "address");
-    public final long arithmeticLog10Address = getFieldValue("CompilerToVM::Data::dlog10", Long.class, "address");
-    public final long arithmeticPowAddress = getFieldValue("CompilerToVM::Data::dpow", Long.class, "address");
-
-    public final long fremAddress = getAddress("SharedRuntime::frem");
-    public final long dremAddress = getAddress("SharedRuntime::drem");
-
-    public final int jvmciCountersSize = getFlag("JVMCICounterSize", Integer.class);
-
-    public final long deoptimizationFetchUnrollInfo = getAddress("Deoptimization::fetch_unroll_info");
-    public final long deoptimizationUncommonTrap = getAddress("Deoptimization::uncommon_trap");
-    public final long deoptimizationUnpackFrames = getAddress("Deoptimization::unpack_frames");
-
-    public final int deoptimizationUnpackDeopt = getConstant("Deoptimization::Unpack_deopt", Integer.class);
-    public final int deoptimizationUnpackException = getConstant("Deoptimization::Unpack_exception", Integer.class);
-    public final int deoptimizationUnpackUncommonTrap = getConstant("Deoptimization::Unpack_uncommon_trap", Integer.class);
-    public final int deoptimizationUnpackReexecute = getConstant("Deoptimization::Unpack_reexecute", Integer.class);
-
-    public final int deoptimizationUnrollBlockSizeOfDeoptimizedFrameOffset = getFieldOffset("Deoptimization::UnrollBlock::_size_of_deoptimized_frame", Integer.class, "int");
-    public final int deoptimizationUnrollBlockCallerAdjustmentOffset = getFieldOffset("Deoptimization::UnrollBlock::_caller_adjustment", Integer.class, "int");
-    public final int deoptimizationUnrollBlockNumberOfFramesOffset = getFieldOffset("Deoptimization::UnrollBlock::_number_of_frames", Integer.class, "int");
-    public final int deoptimizationUnrollBlockTotalFrameSizesOffset = getFieldOffset("Deoptimization::UnrollBlock::_total_frame_sizes", Integer.class, "int");
-    public final int deoptimizationUnrollBlockUnpackKindOffset = getFieldOffset("Deoptimization::UnrollBlock::_unpack_kind", Integer.class, "int");
-    public final int deoptimizationUnrollBlockFrameSizesOffset = getFieldOffset("Deoptimization::UnrollBlock::_frame_sizes", Integer.class, "intptr_t*");
-    public final int deoptimizationUnrollBlockFramePcsOffset = getFieldOffset("Deoptimization::UnrollBlock::_frame_pcs", Integer.class, "address*");
-    public final int deoptimizationUnrollBlockInitialInfoOffset = getFieldOffset("Deoptimization::UnrollBlock::_initial_info", Integer.class, "intptr_t");
-
-    // Checkstyle: stop
-    public final int MARKID_VERIFIED_ENTRY = getConstant("CodeInstaller::VERIFIED_ENTRY", Integer.class);
-    public final int MARKID_UNVERIFIED_ENTRY = getConstant("CodeInstaller::UNVERIFIED_ENTRY", Integer.class);
-    public final int MARKID_OSR_ENTRY = getConstant("CodeInstaller::OSR_ENTRY", Integer.class);
-    public final int MARKID_EXCEPTION_HANDLER_ENTRY = getConstant("CodeInstaller::EXCEPTION_HANDLER_ENTRY", Integer.class);
-    public final int MARKID_DEOPT_HANDLER_ENTRY = getConstant("CodeInstaller::DEOPT_HANDLER_ENTRY", Integer.class);
-    public final int MARKID_INVOKEINTERFACE = getConstant("CodeInstaller::INVOKEINTERFACE", Integer.class);
-    public final int MARKID_INVOKEVIRTUAL = getConstant("CodeInstaller::INVOKEVIRTUAL", Integer.class);
-    public final int MARKID_INVOKESTATIC = getConstant("CodeInstaller::INVOKESTATIC", Integer.class);
-    public final int MARKID_INVOKESPECIAL = getConstant("CodeInstaller::INVOKESPECIAL", Integer.class);
-    public final int MARKID_INLINE_INVOKE = getConstant("CodeInstaller::INLINE_INVOKE", Integer.class);
-    public final int MARKID_POLL_NEAR = getConstant("CodeInstaller::POLL_NEAR", Integer.class);
-    public final int MARKID_POLL_RETURN_NEAR = getConstant("CodeInstaller::POLL_RETURN_NEAR", Integer.class);
-    public final int MARKID_POLL_FAR = getConstant("CodeInstaller::POLL_FAR", Integer.class);
-    public final int MARKID_POLL_RETURN_FAR = getConstant("CodeInstaller::POLL_RETURN_FAR", Integer.class);
-    public final int MARKID_CARD_TABLE_SHIFT = getConstant("CodeInstaller::CARD_TABLE_SHIFT", Integer.class);
-    public final int MARKID_CARD_TABLE_ADDRESS = getConstant("CodeInstaller::CARD_TABLE_ADDRESS", Integer.class);
-    public final int MARKID_INVOKE_INVALID = getConstant("CodeInstaller::INVOKE_INVALID", Integer.class);
-
-    /**
-     * The following constants are given default values here since they are missing in the native
-     * JVMCI-8 code but are still required for {@link GraalHotSpotVMConfigNode#canonical} to work in
-     * a JDK8 environment.
-     */
-    public final int MARKID_HEAP_TOP_ADDRESS = getConstant("CodeInstaller::HEAP_TOP_ADDRESS", Integer.class, 17);
-    public final int MARKID_HEAP_END_ADDRESS = getConstant("CodeInstaller::HEAP_END_ADDRESS", Integer.class, 18);
-    public final int MARKID_NARROW_KLASS_BASE_ADDRESS = getConstant("CodeInstaller::NARROW_KLASS_BASE_ADDRESS", Integer.class, 19);
-    public final int MARKID_NARROW_OOP_BASE_ADDRESS = getConstant("CodeInstaller::NARROW_OOP_BASE_ADDRESS", Integer.class, 20);
-    public final int MARKID_CRC_TABLE_ADDRESS = getConstant("CodeInstaller::CRC_TABLE_ADDRESS", Integer.class, 21);
-    public final int MARKID_LOG_OF_HEAP_REGION_GRAIN_BYTES = getConstant("CodeInstaller::LOG_OF_HEAP_REGION_GRAIN_BYTES", Integer.class, 22);
-    public final int MARKID_INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED = getConstant("CodeInstaller::INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED", Integer.class, 23);
-
-    // Checkstyle: resume
-
-    protected boolean check() {
-        for (Field f : getClass().getDeclaredFields()) {
-            int modifiers = f.getModifiers();
-            if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers)) {
-                assert Modifier.isFinal(modifiers) : "field should be final: " + f;
-            }
-        }
-
-        assert codeEntryAlignment > 0 : codeEntryAlignment;
-        return true;
-    }
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java
deleted file mode 100644
index d2c61d8..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.hotspot;
-
-import org.graalvm.compiler.debug.GraalError;
-import org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction;
-import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
-import org.graalvm.compiler.hotspot.nodes.DeoptimizationFetchUnrollInfoCallNode;
-import org.graalvm.compiler.hotspot.nodes.EnterUnpackFramesStackFrameNode;
-import org.graalvm.compiler.hotspot.nodes.GraalHotSpotVMConfigNode;
-import org.graalvm.compiler.hotspot.nodes.LeaveCurrentStackFrameNode;
-import org.graalvm.compiler.hotspot.nodes.LeaveDeoptimizedStackFrameNode;
-import org.graalvm.compiler.hotspot.nodes.LeaveUnpackFramesStackFrameNode;
-import org.graalvm.compiler.hotspot.nodes.PushInterpreterFrameNode;
-import org.graalvm.compiler.hotspot.nodes.SaveAllRegistersNode;
-import org.graalvm.compiler.hotspot.nodes.UncommonTrapCallNode;
-import org.graalvm.compiler.hotspot.nodes.aot.LoadConstantIndirectlyNode;
-import org.graalvm.compiler.hotspot.nodes.aot.ResolveConstantNode;
-import org.graalvm.compiler.hotspot.nodes.aot.ResolveMethodAndLoadCountersNode;
-import org.graalvm.compiler.hotspot.nodes.profiling.RandomSeedNode;
-import org.graalvm.compiler.hotspot.replacements.EncodedSymbolConstant;
-import org.graalvm.compiler.lir.LIRFrameState;
-import org.graalvm.compiler.lir.StandardOp.SaveRegistersOp;
-import org.graalvm.compiler.lir.VirtualStackSlot;
-import org.graalvm.compiler.lir.gen.LIRGenerator;
-import org.graalvm.compiler.lir.gen.LIRGeneratorTool;
-
-import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
-import jdk.vm.ci.hotspot.HotSpotObjectConstant;
-import jdk.vm.ci.meta.Constant;
-import jdk.vm.ci.meta.DeoptimizationAction;
-import jdk.vm.ci.meta.DeoptimizationReason;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.Value;
-
-/**
- * This interface defines the contract a HotSpot backend LIR generator needs to fulfill in addition
- * to abstract methods from {@link LIRGenerator} and {@link LIRGeneratorTool}.
- */
-public interface HotSpotLIRGenerator extends LIRGeneratorTool {
-
-    /**
-     * Emits an operation to make a tail call.
-     *
-     * @param args the arguments of the call
-     * @param address the target address of the call
-     */
-    void emitTailcall(Value[] args, Value address);
-
-    void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason);
-
-    /**
-     * Emits code for a {@link SaveAllRegistersNode}.
-     *
-     * @return a {@link SaveRegistersOp} operation
-     */
-    SaveRegistersOp emitSaveAllRegisters();
-
-    /**
-     * Emits code for a {@link LeaveCurrentStackFrameNode}.
-     *
-     * @param saveRegisterOp saved registers
-     */
-    default void emitLeaveCurrentStackFrame(SaveRegistersOp saveRegisterOp) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link LeaveDeoptimizedStackFrameNode}.
-     *
-     * @param frameSize
-     * @param initialInfo
-     */
-    default void emitLeaveDeoptimizedStackFrame(Value frameSize, Value initialInfo) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link EnterUnpackFramesStackFrameNode}.
-     *
-     * @param framePc
-     * @param senderSp
-     * @param senderFp
-     * @param saveRegisterOp
-     */
-    default void emitEnterUnpackFramesStackFrame(Value framePc, Value senderSp, Value senderFp, SaveRegistersOp saveRegisterOp) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link LeaveUnpackFramesStackFrameNode}.
-     *
-     * @param saveRegisterOp
-     */
-    default void emitLeaveUnpackFramesStackFrame(SaveRegistersOp saveRegisterOp) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link PushInterpreterFrameNode}.
-     *
-     * @param frameSize
-     * @param framePc
-     * @param senderSp
-     * @param initialInfo
-     */
-    default void emitPushInterpreterFrame(Value frameSize, Value framePc, Value senderSp, Value initialInfo) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link LoadConstantIndirectlyNode}.
-     *
-     * @param constant
-     * @return value of loaded address in register
-     */
-    default Value emitLoadObjectAddress(Constant constant) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link LoadConstantIndirectlyNode}.
-     *
-     * @param constant
-     * @return Value of loaded address in register
-     */
-    @SuppressWarnings("unused")
-    default Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link GraalHotSpotVMConfigNode}.
-     *
-     * @param markId type of address to load
-     * @return value of loaded global in register
-     */
-    default Value emitLoadConfigValue(int markId) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotObjectConstant}.
-     *
-     * @param constantDescription a description of the string that need to be materialized (and
-     *            interned) as java.lang.String, generated with {@link EncodedSymbolConstant}
-     * @return Returns the address of the requested constant.
-     */
-    @SuppressWarnings("unused")
-    default Value emitObjectConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotMetaspaceConstant}.
-     *
-     * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
-     *            generated by {@link EncodedSymbolConstant}
-     * @return Returns the address of the requested constant.
-     */
-    @SuppressWarnings("unused")
-    default Value emitMetaspaceConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link ResolveMethodAndLoadCountersNode} to resolve a
-     * {@link HotSpotMetaspaceConstant} that represents a {@link ResolvedJavaMethod} and return the
-     * corresponding MethodCounters object.
-     *
-     * @param klassHint a klass in which the method is declared
-     * @param methodDescription is symbolic description of the constant generated by
-     *            {@link EncodedSymbolConstant}
-     * @return Returns the address of the requested constant.
-     */
-    @SuppressWarnings("unused")
-    default Value emitResolveMethodAndLoadCounters(Constant method, Value klassHint, Value methodDescription, LIRFrameState frameState) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link ResolveConstantNode} to resolve a klass
-     * {@link HotSpotMetaspaceConstant} and run static initializer.
-     *
-     * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
-     *            generated by {@link EncodedSymbolConstant}
-     * @return Returns the address of the requested constant.
-     */
-    @SuppressWarnings("unused")
-    default Value emitKlassInitializationAndRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link RandomSeedNode}.
-     *
-     * @return value of the counter
-     */
-    default Value emitRandomSeed() {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link UncommonTrapCallNode}.
-     *
-     * @param trapRequest
-     * @param mode
-     * @param saveRegisterOp
-     * @return a {@code Deoptimization::UnrollBlock} pointer
-     */
-    default Value emitUncommonTrapCall(Value trapRequest, Value mode, SaveRegistersOp saveRegisterOp) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Emits code for a {@link DeoptimizationFetchUnrollInfoCallNode}.
-     *
-     * @param mode
-     * @param saveRegisterOp
-     * @return a {@code Deoptimization::UnrollBlock} pointer
-     */
-    default Value emitDeoptimizationFetchUnrollInfoCall(Value mode, SaveRegistersOp saveRegisterOp) {
-        throw GraalError.unimplemented();
-    }
-
-    /**
-     * Gets a stack slot for a lock at a given lock nesting depth.
-     */
-    VirtualStackSlot getLockSlot(int lockDepth);
-
-    @Override
-    HotSpotProviders getProviders();
-
-    Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull);
-
-    Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull);
-
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java
deleted file mode 100644
index cdb8160..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.hotspot.nodes;
-
-import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
-import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG;
-import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1;
-import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_1;
-
-import org.graalvm.compiler.api.replacements.Fold;
-import org.graalvm.compiler.api.replacements.Fold.InjectedParameter;
-import org.graalvm.compiler.core.common.type.StampFactory;
-import org.graalvm.compiler.graph.Node;
-import org.graalvm.compiler.graph.NodeClass;
-import org.graalvm.compiler.graph.spi.Canonicalizable;
-import org.graalvm.compiler.graph.spi.CanonicalizerTool;
-import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
-import org.graalvm.compiler.hotspot.HotSpotLIRGenerator;
-import org.graalvm.compiler.nodeinfo.NodeInfo;
-import org.graalvm.compiler.nodes.ConstantNode;
-import org.graalvm.compiler.nodes.calc.FloatingNode;
-import org.graalvm.compiler.nodes.spi.LIRLowerable;
-import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
-
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.Value;
-
-/**
- * Represents {@link GraalHotSpotVMConfig} values that may change after compilation.
- */
-@NodeInfo(cycles = CYCLES_1, size = SIZE_1)
-public class GraalHotSpotVMConfigNode extends FloatingNode implements LIRLowerable, Canonicalizable {
-    public static final NodeClass<GraalHotSpotVMConfigNode> TYPE = NodeClass.create(GraalHotSpotVMConfigNode.class);
-
-    private final GraalHotSpotVMConfig config;
-    protected final int markId;
-
-    public GraalHotSpotVMConfigNode(@InjectedNodeParameter GraalHotSpotVMConfig config, int markId, JavaKind kind) {
-        super(TYPE, StampFactory.forKind(kind));
-        this.config = config;
-        this.markId = markId;
-    }
-
-    /**
-     * Constructor selected by {@link #loadConfigValue(int, JavaKind)}.
-     *
-     * @param config
-     * @param markId
-     */
-    public GraalHotSpotVMConfigNode(@InjectedNodeParameter GraalHotSpotVMConfig config, int markId) {
-        super(TYPE, StampFactory.forKind(JavaKind.Boolean));
-        this.config = config;
-        this.markId = 0;
-    }
-
-    @Override
-    public void generate(NodeLIRBuilderTool generator) {
-        Value res = ((HotSpotLIRGenerator) generator.getLIRGeneratorTool()).emitLoadConfigValue(markId);
-        generator.setResult(this, res);
-    }
-
-    @NodeIntrinsic
-    private static native boolean isConfigValueConstant(@ConstantNodeParameter int markId);
-
-    @NodeIntrinsic
-    private static native long loadConfigValue(@ConstantNodeParameter int markId, @ConstantNodeParameter JavaKind kind);
-
-    public static long cardTableAddress() {
-        return loadConfigValue(cardTableAddressMark(INJECTED_VMCONFIG), JavaKind.Long);
-    }
-
-    public static boolean isCardTableAddressConstant() {
-        return isConfigValueConstant(cardTableAddressMark(INJECTED_VMCONFIG));
-    }
-
-    public static long heapTopAddress() {
-        return loadConfigValue(heapTopAddressMark(INJECTED_VMCONFIG), JavaKind.Long);
-    }
-
-    public static long heapEndAddress() {
-        return loadConfigValue(heapEndAddressMark(INJECTED_VMCONFIG), JavaKind.Long);
-    }
-
-    public static long crcTableAddress() {
-        return loadConfigValue(crcTableAddressMark(INJECTED_VMCONFIG), JavaKind.Long);
-    }
-
-    public static int logOfHeapRegionGrainBytes() {
-        return (int) loadConfigValue(logOfHeapRegionGrainBytesMark(INJECTED_VMCONFIG), JavaKind.Byte);
-    }
-
-    public static boolean inlineContiguousAllocationSupported() {
-        return loadConfigValue(inlineContiguousAllocationSupportedMark(INJECTED_VMCONFIG), JavaKind.Byte) > 0;
-    }
-
-    @Fold
-    public static int cardTableAddressMark(@InjectedParameter GraalHotSpotVMConfig config) {
-        return config.MARKID_CARD_TABLE_ADDRESS;
-    }
-
-    @Fold
-    public static int heapTopAddressMark(@InjectedParameter GraalHotSpotVMConfig config) {
-        return config.MARKID_HEAP_TOP_ADDRESS;
-    }
-
-    @Fold
-    public static int heapEndAddressMark(@InjectedParameter GraalHotSpotVMConfig config) {
-        return config.MARKID_HEAP_END_ADDRESS;
-    }
-
-    @Fold
-    public static int crcTableAddressMark(@InjectedParameter GraalHotSpotVMConfig config) {
-        return config.MARKID_CRC_TABLE_ADDRESS;
-    }
-
-    @Fold
-    public static int logOfHeapRegionGrainBytesMark(@InjectedParameter GraalHotSpotVMConfig config) {
-        return config.MARKID_LOG_OF_HEAP_REGION_GRAIN_BYTES;
-    }
-
-    @Fold
-    public static int inlineContiguousAllocationSupportedMark(@InjectedParameter GraalHotSpotVMConfig config) {
-        return config.MARKID_INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED;
-    }
-
-    @Override
-    public Node canonical(CanonicalizerTool tool) {
-        if (markId == 0) {
-            return ConstantNode.forBoolean(!GeneratePIC.getValue());
-        }
-        if (!GeneratePIC.getValue()) {
-            if (markId == cardTableAddressMark(config)) {
-                return ConstantNode.forLong(config.cardtableStartAddress);
-            } else if (markId == heapTopAddressMark(config)) {
-                return ConstantNode.forLong(config.heapTopAddress);
-            } else if (markId == heapEndAddressMark(config)) {
-                return ConstantNode.forLong(config.heapEndAddress);
-            } else if (markId == crcTableAddressMark(config)) {
-                return ConstantNode.forLong(config.crcTableAddress);
-            } else if (markId == logOfHeapRegionGrainBytesMark(config)) {
-                return ConstantNode.forInt(config.logOfHRGrainBytes);
-            } else if (markId == inlineContiguousAllocationSupportedMark(config)) {
-                return ConstantNode.forBoolean(config.inlineContiguousAllocationSupported);
-            } else {
-                assert false;
-            }
-        }
-        return this;
-    }
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java
deleted file mode 100644
index 46d8be1..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.hotspot.phases.aot;
-
-import static org.graalvm.compiler.nodes.ConstantNode.getConstantNodes;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map.Entry;
-
-import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
-import jdk.vm.ci.meta.JavaConstant;
-
-import org.graalvm.compiler.graph.Node;
-import org.graalvm.compiler.graph.iterators.NodeIterable;
-import org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode;
-import org.graalvm.compiler.nodes.ConstantNode;
-import org.graalvm.compiler.nodes.FixedWithNextNode;
-import org.graalvm.compiler.nodes.Invoke;
-import org.graalvm.compiler.nodes.StructuredGraph;
-import org.graalvm.compiler.nodes.cfg.Block;
-import org.graalvm.compiler.nodes.cfg.ControlFlowGraph;
-import org.graalvm.compiler.phases.BasePhase;
-import org.graalvm.compiler.phases.tiers.PhaseContext;
-
-public class EliminateRedundantInitializationPhase extends BasePhase<PhaseContext> {
-    /**
-     * Find blocks with class initializing nodes for the class identified the by the constant node.
-     * Return the map of a block to a list of initializing nodes in that block.
-     *
-     * @param cfg an instance of the {@link ControlFlowGraph}.
-     * @param constant common input to the instances of {@link InitializeKlassNode}.
-     * @return map of blocks to lists of initializing nodes.
-     */
-    private static HashMap<Block, ArrayList<Node>> findBlocksWithInitializers(ControlFlowGraph cfg, ConstantNode constant) {
-        // node is ConstantNode representing a metaspace constant (a klass reference).
-        // InitializeKlassNodes for the same class would share the same ConstantNode input.
-        NodeIterable<?> initializers = constant.usages().filter(InitializeKlassNode.class);
-        // Map the found nodes to blocks
-        HashMap<Block, ArrayList<Node>> blockToInits = new HashMap<>();
-        for (Node i : initializers) {
-            Block b = cfg.blockFor(i);
-            ArrayList<Node> initsInBlock = blockToInits.get(b);
-            if (initsInBlock == null) {
-                initsInBlock = new ArrayList<>();
-            }
-            initsInBlock.add(i);
-            blockToInits.put(b, initsInBlock);
-        }
-        return blockToInits;
-    }
-
-    /**
-     * Process the block-to-initializers map and produce a list of blocks that contain more than one
-     * instance of {@link InitializeKlassNode}.
-     *
-     * @param blockToInits a map of blocks to lists of {@link InitializeKlassNode} instances.
-     * @return list of blocks that contain multiple instances of {@link InitializeKlassNode}.
-     */
-    private static ArrayList<Block> findBlocksWithMultipleInitializers(HashMap<Block, ArrayList<Node>> blockToInits) {
-        ArrayList<Block> result = new ArrayList<>();
-        // Select the blocks from the blocksToInits map that have more than one InitializeKlassNode
-        for (Entry<Block, ArrayList<Node>> e : blockToInits.entrySet()) {
-            if (e.getValue().size() > 1) {
-                result.add(e.getKey());
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Iterate through blocks with multiple instances of {@link InitializeKlassNode} and identify
-     * redundant instances. Remove redundant instances from the block-to-list-of-initializer map.
-     *
-     * @param blockToInits a map of blocks to lists of {@link InitializeKlassNode} instances.
-     * @param blocksWithMultipleInits a list of blocks that contain multiple instances of
-     *            {@link InitializeKlassNode}.
-     * @param constant common input to the instances of {@link InitializeKlassNode}.
-     * @return list of {@link InitializeKlassNode} instances that can be removed.
-     */
-    private static ArrayList<Node> findRedundantLocalInitializers(HashMap<Block, ArrayList<Node>> blockToInits, ArrayList<Block> blocksWithMultipleInits, ConstantNode constant) {
-        ArrayList<Node> result = new ArrayList<>();
-        for (Block b : blocksWithMultipleInits) {
-            // First initializer for our constant in the block
-            InitializeKlassNode first = null;
-            for (Node n : b.getNodes()) {
-                if (n instanceof InitializeKlassNode) {
-                    InitializeKlassNode i = (InitializeKlassNode) n;
-                    if (i.value() == constant) {
-                        if (first == null) {
-                            // First instance of {@link InitializeKlassNode} stays.
-                            first = i;
-                        } else {
-                            // All the following instances of {@link InitializeKlassNode} can be
-                            // removed.
-                            result.add(i);
-                        }
-                    }
-                }
-            }
-            assert first != null;
-
-            // Replace the entry in the initsInBlock map to contain just a single initializer
-            ArrayList<Node> initsInBlock = new ArrayList<>();
-            initsInBlock.add(first);
-            blockToInits.put(b, initsInBlock);
-        }
-        return result;
-    }
-
-    /**
-     * Find cases when one {@link InitializeKlassNode} instance dominates another. The dominated
-     * instance can be removed.
-     *
-     * @param blockToInits a map of blocks to lists of {@link InitializeKlassNode} instances.
-     * @return list of {@link InitializeKlassNode} instances that can be removed.
-     */
-    private static ArrayList<Node> findRedundantGlobalInitializers(HashMap<Block, ArrayList<Node>> blockToInits) {
-        ArrayList<Node> result = new ArrayList<>();
-        for (Entry<Block, ArrayList<Node>> e : blockToInits.entrySet()) {
-            Block currentBlock = e.getKey();
-            ArrayList<Node> nodesInCurrent = e.getValue();
-            if (nodesInCurrent != null) { // if the list is null, the initializer has already been
-                                          // eliminated.
-                for (Block d : currentBlock.getDominated()) {
-                    ArrayList<Node> nodesInDominated = blockToInits.get(d);
-                    if (nodesInDominated != null) { // if the list is null, the initializer has
-                                                    // already been eliminated.
-                        assert nodesInDominated.size() == 1;
-                        Node n = nodesInDominated.iterator().next();
-                        result.add(n);
-                        blockToInits.put(d, null);
-                    }
-                }
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Compute the list of redundant {@link InitializeKlassNode} instances that have the common
-     * {@link ConstantNode}.
-     *
-     * @param cfg an instance of the {@link ControlFlowGraph}.
-     * @param constant common input to the instances of {@link InitializeKlassNode}.
-     * @return list of {@link InitializeKlassNode} instances that can be removed.
-     */
-    private static ArrayList<Node> processConstantNode(ControlFlowGraph cfg, ConstantNode constant) {
-        HashMap<Block, ArrayList<Node>> blockToInits = findBlocksWithInitializers(cfg, constant);
-        ArrayList<Block> blocksWithMultipleInits = findBlocksWithMultipleInitializers(blockToInits);
-        ArrayList<Node> redundantInits = findRedundantLocalInitializers(blockToInits, blocksWithMultipleInits, constant);
-        // At this point each block has at most one initializer for this constant
-        if (blockToInits.size() > 1) {
-            redundantInits.addAll(findRedundantGlobalInitializers(blockToInits));
-        }
-        return redundantInits;
-    }
-
-    /**
-     * Find each {@link Invoke} that has a corresponding {@link InitializeKlassNode}. These
-     * {@link InitializeKlassNode} are redundant and are removed.
-     *
-     */
-    private static void removeInitsAtStaticCalls(StructuredGraph graph) {
-        for (Invoke invoke : graph.getInvokes()) {
-            if (invoke.classInit() != null) {
-                Node classInit = invoke.classInit();
-                classInit.replaceAtUsages(null);
-                graph.removeFixed((FixedWithNextNode) classInit);
-            }
-        }
-    }
-
-    /**
-     * Find {@link InitializeKlassNode} instances that can be removed because there is an existing
-     * dominating initialization.
-     *
-     * @param graph the program graph.
-     */
-    private static void removeRedundantInits(StructuredGraph graph) {
-        // Create cfg, we need blocks and dominators.
-        ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, false, true, false);
-        ArrayList<Node> redundantInits = new ArrayList<>();
-        for (ConstantNode node : getConstantNodes(graph)) {
-            JavaConstant constant = node.asJavaConstant();
-            if (constant instanceof HotSpotMetaspaceConstant) {
-                redundantInits.addAll(processConstantNode(cfg, node));
-            }
-        }
-        // Remove redundant instances of {@link InitializeKlassNode} from the graph.
-        for (Node n : redundantInits) {
-            graph.removeFixed((FixedWithNextNode) n);
-        }
-    }
-
-    @Override
-    protected void run(StructuredGraph graph, PhaseContext context) {
-        removeInitsAtStaticCalls(graph);
-        removeRedundantInits(graph);
-    }
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
deleted file mode 100644
index 5d2eb3e..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.hotspot.stubs;
-
-import static org.graalvm.compiler.core.GraalCompiler.emitBackEnd;
-import static org.graalvm.compiler.core.GraalCompiler.emitFrontEnd;
-import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
-import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Set;
-
-import org.graalvm.compiler.code.CompilationResult;
-import org.graalvm.compiler.core.common.CompilationIdentifier;
-import org.graalvm.compiler.core.target.Backend;
-import org.graalvm.compiler.debug.Debug;
-import org.graalvm.compiler.debug.Debug.Scope;
-import org.graalvm.compiler.debug.internal.DebugScope;
-import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder;
-import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
-import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
-import org.graalvm.compiler.hotspot.nodes.StubStartNode;
-import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory;
-import org.graalvm.compiler.lir.phases.LIRPhase;
-import org.graalvm.compiler.lir.phases.LIRSuites;
-import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext;
-import org.graalvm.compiler.lir.profiling.MoveProfilingPhase;
-import org.graalvm.compiler.nodes.StructuredGraph;
-import org.graalvm.compiler.phases.OptimisticOptimizations;
-import org.graalvm.compiler.phases.PhaseSuite;
-import org.graalvm.compiler.phases.tiers.Suites;
-
-import jdk.vm.ci.code.CodeCacheProvider;
-import jdk.vm.ci.code.InstalledCode;
-import jdk.vm.ci.code.Register;
-import jdk.vm.ci.code.RegisterConfig;
-import jdk.vm.ci.code.site.Call;
-import jdk.vm.ci.code.site.ConstantReference;
-import jdk.vm.ci.code.site.DataPatch;
-import jdk.vm.ci.code.site.Infopoint;
-import jdk.vm.ci.hotspot.HotSpotCompiledCode;
-import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
-import jdk.vm.ci.meta.DefaultProfilingInfo;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.vm.ci.meta.TriState;
-
-//JaCoCo Exclude
-
-/**
- * Base class for implementing some low level code providing the out-of-line slow path for a snippet
- * and/or a callee saved call to a HotSpot C/C++ runtime function or even a another compiled Java
- * method.
- */
-public abstract class Stub {
-
-    private static final List<Stub> stubs = new ArrayList<>();
-
-    /**
-     * The linkage information for a call to this stub from compiled code.
-     */
-    protected final HotSpotForeignCallLinkage linkage;
-
-    /**
-     * The code installed for the stub.
-     */
-    protected InstalledCode code;
-
-    /**
-     * Compilation result from which {@link #code} was created.
-     */
-    protected CompilationResult compResult;
-
-    /**
-     * The registers destroyed by this stub (from the caller's perspective).
-     */
-    private Set<Register> destroyedCallerRegisters;
-
-    private HotSpotCompiledCode compiledCode;
-
-    public void initDestroyedCallerRegisters(Set<Register> registers) {
-        assert registers != null;
-        assert destroyedCallerRegisters == null || registers.equals(destroyedCallerRegisters) : "cannot redefine";
-        destroyedCallerRegisters = registers;
-    }
-
-    /**
-     * Gets the registers destroyed by this stub from a caller's perspective. These are the
-     * temporaries of this stub and must thus be caller saved by a callers of this stub.
-     */
-    public Set<Register> getDestroyedCallerRegisters() {
-        assert destroyedCallerRegisters != null : "not yet initialized";
-        return destroyedCallerRegisters;
-    }
-
-    /**
-     * Determines if this stub preserves all registers apart from those it
-     * {@linkplain #getDestroyedCallerRegisters() destroys}.
-     */
-    public boolean preservesRegisters() {
-        return true;
-    }
-
-    protected final HotSpotProviders providers;
-
-    /**
-     * Creates a new stub.
-     *
-     * @param linkage linkage details for a call to the stub
-     */
-    public Stub(HotSpotProviders providers, HotSpotForeignCallLinkage linkage) {
-        this.linkage = linkage;
-        this.providers = providers;
-        stubs.add(this);
-    }
-
-    /**
-     * Gets an immutable view of all stubs that have been created.
-     */
-    public static Collection<Stub> getStubs() {
-        return Collections.unmodifiableList(stubs);
-    }
-
-    /**
-     * Gets the linkage for a call to this stub from compiled code.
-     */
-    public HotSpotForeignCallLinkage getLinkage() {
-        return linkage;
-    }
-
-    public RegisterConfig getRegisterConfig() {
-        return null;
-    }
-
-    /**
-     * Gets the graph that from which the code for this stub will be compiled.
-     *
-     * @param compilationId unique compilation id for the stub
-     */
-    protected abstract StructuredGraph getGraph(CompilationIdentifier compilationId);
-
-    @Override
-    public String toString() {
-        return "Stub<" + linkage.getDescriptor() + ">";
-    }
-
-    /**
-     * Gets the method the stub's code will be associated with once installed. This may be null.
-     */
-    protected abstract ResolvedJavaMethod getInstalledCodeOwner();
-
-    /**
-     * Gets a context object for the debug scope created when producing the code for this stub.
-     */
-    protected abstract Object debugScopeContext();
-
-    /**
-     * Gets the code for this stub, compiling it first if necessary.
-     */
-    @SuppressWarnings("try")
-    public synchronized InstalledCode getCode(final Backend backend) {
-        if (code == null) {
-            try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) {
-                final StructuredGraph graph = getGraph(getStubCompilationId());
-
-                // Stubs cannot be recompiled so they cannot be compiled with assumptions
-                assert graph.getAssumptions() == null;
-
-                if (!(graph.start() instanceof StubStartNode)) {
-                    StubStartNode newStart = graph.add(new StubStartNode(Stub.this));
-                    newStart.setStateAfter(graph.start().stateAfter());
-                    graph.replaceFixed(graph.start(), newStart);
-                }
-
-                CodeCacheProvider codeCache = providers.getCodeCache();
-
-                compResult = new CompilationResult(toString(), GeneratePIC.getValue());
-                try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) {
-                    Suites suites = createSuites();
-                    emitFrontEnd(providers, backend, graph, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites);
-                    LIRSuites lirSuites = createLIRSuites();
-                    emitBackEnd(graph, Stub.this, getInstalledCodeOwner(), backend, compResult, CompilationResultBuilderFactory.Default, getRegisterConfig(), lirSuites);
-                    assert checkStubInvariants();
-                } catch (Throwable e) {
-                    throw Debug.handle(e);
-                }
-
-                assert destroyedCallerRegisters != null;
-                try (Scope s = Debug.scope("CodeInstall", compResult)) {
-                    // Add a GeneratePIC check here later, we don't want to install
-                    // code if we don't have a corresponding VM global symbol.
-                    compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(null, null, compResult);
-                    code = codeCache.installCode(null, compiledCode, null, null, false);
-                } catch (Throwable e) {
-                    throw Debug.handle(e);
-                }
-            } catch (Throwable e) {
-                throw Debug.handle(e);
-            }
-            assert code != null : "error installing stub " + this;
-        }
-
-        return code;
-    }
-
-    public CompilationIdentifier getStubCompilationId() {
-        return new StubCompilationIdentifier(this);
-    }
-
-    /**
-     * Checks the conditions a compilation must satisfy to be installed as a RuntimeStub.
-     */
-    private boolean checkStubInvariants() {
-        assert compResult.getExceptionHandlers().isEmpty() : this;
-
-        // Stubs cannot be recompiled so they cannot be compiled with
-        // assumptions and there is no point in recording evol_method dependencies
-        assert compResult.getAssumptions() == null : "stubs should not use assumptions: " + this;
-
-        for (DataPatch data : compResult.getDataPatches()) {
-            if (data.reference instanceof ConstantReference) {
-                ConstantReference ref = (ConstantReference) data.reference;
-                if (ref.getConstant() instanceof HotSpotMetaspaceConstant) {
-                    HotSpotMetaspaceConstant c = (HotSpotMetaspaceConstant) ref.getConstant();
-                    if (c.asResolvedJavaType() != null && c.asResolvedJavaType().getName().equals("[I")) {
-                        // special handling for NewArrayStub
-                        // embedding the type '[I' is safe, since it is never unloaded
-                        continue;
-                    }
-                }
-            }
-
-            assert !(data.reference instanceof ConstantReference) : this + " cannot have embedded object or metadata constant: " + data.reference;
-        }
-        for (Infopoint infopoint : compResult.getInfopoints()) {
-            assert infopoint instanceof Call : this + " cannot have non-call infopoint: " + infopoint;
-            Call call = (Call) infopoint;
-            assert call.target instanceof HotSpotForeignCallLinkage : this + " cannot have non runtime call: " + call.target;
-            HotSpotForeignCallLinkage callLinkage = (HotSpotForeignCallLinkage) call.target;
-            assert !callLinkage.isCompiledStub() || callLinkage.getDescriptor().equals(UNCOMMON_TRAP_HANDLER) : this + " cannot call compiled stub " + callLinkage;
-        }
-        return true;
-    }
-
-    protected Suites createSuites() {
-        Suites defaultSuites = providers.getSuites().getDefaultSuites();
-        return new Suites(new PhaseSuite<>(), defaultSuites.getMidTier(), defaultSuites.getLowTier());
-    }
-
-    protected LIRSuites createLIRSuites() {
-        LIRSuites lirSuites = new LIRSuites(providers.getSuites().getDefaultLIRSuites());
-        ListIterator<LIRPhase<PostAllocationOptimizationContext>> moveProfiling = lirSuites.getPostAllocationOptimizationStage().findPhase(MoveProfilingPhase.class);
-        if (moveProfiling != null) {
-            moveProfiling.remove();
-        }
-        return lirSuites;
-    }
-
-    /**
-     * Gets the HotSpotCompiledCode that was created during installation.
-     */
-    public synchronized HotSpotCompiledCode getCompiledCode(final Backend backend) {
-        getCompilationResult(backend);
-        assert compiledCode != null;
-        return compiledCode;
-    }
-
-    /**
-     * Gets the compilation result for this stub, compiling it first if necessary, and installing it
-     * in code.
-     */
-    public synchronized CompilationResult getCompilationResult(final Backend backend) {
-        if (code == null) {
-            getCode(backend);
-        }
-        return compResult;
-    }
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java
deleted file mode 100644
index e139b19..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.test;
-
-/**
- * A class loader that exports all packages in the module defining the class loader to all classes
- * in the unnamed module associated with the loader.
- */
-public class ExportingClassLoader extends ClassLoader {
-    public ExportingClassLoader() {
-        if (!GraalTest.Java8OrEarlier) {
-            JLRModule.fromClass(getClass()).exportAllPackagesTo(JLRModule.getUnnamedModuleFor(this));
-        }
-    }
-
-    public ExportingClassLoader(ClassLoader parent) {
-        super(parent);
-        if (!GraalTest.Java8OrEarlier) {
-            JLRModule.fromClass(getClass()).exportAllPackagesTo(JLRModule.getUnnamedModuleFor(this));
-        }
-    }
-}
diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLRModule.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLRModule.java
deleted file mode 100644
index caa3223..0000000
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLRModule.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.graalvm.compiler.test;
-
-import java.lang.reflect.Method;
-
-/**
- * Facade for the {@code java.lang.reflect.Module} class introduced in JDK9 that allows tests to be
- * developed against JDK8 but use module logic if deployed on JDK9.
- */
-public class JLRModule {
-
-    static {
-        if (GraalTest.Java8OrEarlier) {
-            throw new AssertionError("Use of " + JLRModule.class + " only allowed if " + GraalTest.class.getName() + ".JDK8OrEarlier is false");
-        }
-    }
-
-    private final Object realModule;
-
-    public JLRModule(Object module) {
-        this.realModule = module;
-    }
-
-    private static final Class<?> moduleClass;
-    private static final Method getModuleMethod;
-    private static final Method getUnnamedModuleMethod;
-    private static final Method getPackagesMethod;
-    private static final Method isExportedMethod;
-    private static final Method isExported2Method;
-    private static final Method addExportsMethod;
-    static {
-        try {
-            moduleClass = Class.forName("java.lang.reflect.Module");
-            getModuleMethod = Class.class.getMethod("getModule");
-            getUnnamedModuleMethod = ClassLoader.class.getMethod("getUnnamedModule");
-            getPackagesMethod = moduleClass.getMethod("getPackages");
-            isExportedMethod = moduleClass.getMethod("isExported", String.class);
-            isExported2Method = moduleClass.getMethod("isExported", String.class, moduleClass);
-            addExportsMethod = moduleClass.getMethod("addExports", String.class, moduleClass);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public static JLRModule fromClass(Class<?> cls) {
-        try {
-            return new JLRModule(getModuleMethod.invoke(cls));
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public static JLRModule getUnnamedModuleFor(ClassLoader cl) {
-        try {
-            return new JLRModule(getUnnamedModuleMethod.invoke(cl));
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    /**
-     * Exports all packages in this module to a given module.
-     */
-    public void exportAllPackagesTo(JLRModule module) {
-        if (this != module) {
-            for (String pkg : getPackages()) {
-                // Export all JVMCI packages dynamically instead
-                // of requiring a long list of -XaddExports
-                // options on the JVM command line.
-                if (!isExported(pkg, module)) {
-                    addExports(pkg, module);
-                }
-            }
-        }
-    }
-
-    public String[] getPackages() {
-        try {
-            return (String[]) getPackagesMethod.invoke(realModule);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public boolean isExported(String pn) {
-        try {
-            return (Boolean) isExportedMethod.invoke(realModule, pn);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public boolean isExported(String pn, JLRModule other) {
-        try {
-            return (Boolean) isExported2Method.invoke(realModule, pn, other.realModule);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public void addExports(String pn, JLRModule other) {
-        try {
-            addExportsMethod.invoke(realModule, pn, other.realModule);
-        } catch (Exception e) {
-            throw new AssertionError(e);
-        }
-    }
-}
diff --git a/hotspot/src/share/vm/Xusage.txt b/hotspot/src/share/vm/Xusage.txt
index 3849f8f..8c8eba1 100644
--- a/hotspot/src/share/vm/Xusage.txt
+++ b/hotspot/src/share/vm/Xusage.txt
@@ -12,7 +12,7 @@
     -Xms<size>        set initial Java heap size
     -Xmx<size>        set maximum Java heap size
     -Xss<size>        set java thread stack size
-    -Xprof            output cpu profiling data
+    -Xprof            output cpu profiling data (deprecated)
     -Xfuture          enable strictest checks, anticipating future default
     -Xrs              reduce use of OS signals by Java/VM (see documentation)
     -Xcheck:jni       perform additional checks for JNI functions
diff --git a/hotspot/src/share/vm/aot/aotCodeHeap.cpp b/hotspot/src/share/vm/aot/aotCodeHeap.cpp
index 52e2c8d..87d41f8 100644
--- a/hotspot/src/share/vm/aot/aotCodeHeap.cpp
+++ b/hotspot/src/share/vm/aot/aotCodeHeap.cpp
@@ -830,38 +830,19 @@
   }
 }
 
-// Yes, this is faster than going through the relocations,
-// but there are two problems:
-// 1) GOT slots are sometimes patched with non-Metadata values
-// 2) We don't want to scan metadata for dead methods
-// Unfortunately we don't know if the metadata belongs to
-// live aot methods or not, so process them all.  If this
-// is for mark_on_stack, some old methods may stick around
-// forever instead of getting cleaned up.
+// Scan only metaspace_got cells which should have only Klass*,
+// metadata_got cells are scanned only for alive AOT methods
+// by AOTCompiledMethod::metadata_do().
 void AOTCodeHeap::got_metadata_do(void f(Metadata*)) {
   for (int i = 1; i < _metaspace_got_size; i++) {
     Metadata** p = &_metaspace_got[i];
     Metadata* md = *p;
     if (md == NULL)  continue;  // skip non-oops
-    intptr_t meta = (intptr_t)md;
-    if (meta == -1)  continue;  // skip non-oops
     if (Metaspace::contains(md)) {
       f(md);
-    }
-  }
-  for (int i = 1; i < _metadata_got_size; i++) {
-    Metadata** p = &_metadata_got[i];
-    Metadata* md = *p;
-    intptr_t meta = (intptr_t)md;
-    if ((meta & 1) == 1) {
-      // already resolved
-      md = (Metadata*)(meta & ~1);
     } else {
-      continue;
-    }
-    if (md == NULL)  continue;  // skip non-oops
-    if (Metaspace::contains(md)) {
-      f(md);
+      intptr_t meta = (intptr_t)md;
+      fatal("Invalid value in _metaspace_got[%d] = " INTPTR_FORMAT, i, meta);
     }
   }
 }
@@ -910,8 +891,6 @@
       aot->metadata_do(f);
     }
   }
-#if 0
-  // With the marking above, this call doesn't seem to be needed
+  // Scan metaspace_got cells.
   got_metadata_do(f);
-#endif
 }
diff --git a/hotspot/src/share/vm/aot/aotCodeHeap.hpp b/hotspot/src/share/vm/aot/aotCodeHeap.hpp
index 0e0d003..5c803cc 100644
--- a/hotspot/src/share/vm/aot/aotCodeHeap.hpp
+++ b/hotspot/src/share/vm/aot/aotCodeHeap.hpp
@@ -240,6 +240,11 @@
     assert(result == CodeHeap::contains(p), "");
     return result;
   }
+
+  bool contains_blob(const CodeBlob* blob) const {
+    return CodeHeap::contains(blob->code_begin());
+  }
+
   AOTCompiledMethod* find_aot(address p) const;
 
   virtual void* find_start(void* p)     const;
diff --git a/hotspot/src/share/vm/aot/aotCompiledMethod.cpp b/hotspot/src/share/vm/aot/aotCompiledMethod.cpp
index 1f40284..c501ce1 100644
--- a/hotspot/src/share/vm/aot/aotCompiledMethod.cpp
+++ b/hotspot/src/share/vm/aot/aotCompiledMethod.cpp
@@ -71,15 +71,6 @@
 }
 #endif
 
-void AOTCompiledMethod::oops_do(OopClosure* f) {
-  if (_oop != NULL) {
-    f->do_oop(&_oop);
-  }
-#if 0
-  metadata_oops_do(metadata_begin(), metadata_end(), f);
-#endif
-}
-
 bool AOTCompiledMethod::do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive, bool unloading_occurred) {
   return false;
 }
@@ -161,9 +152,6 @@
       *entry = (Metadata*)meta; // Should be atomic on x64
       return (Metadata*)m;
     }
-    // need to resolve it here..., patching of GOT need to be CAS or atomic operation.
-    // FIXIT: need methods for debuginfo.
-    // return _method;
   }
   ShouldNotReachHere(); return NULL;
 }
@@ -288,11 +276,19 @@
           f(cichk->holder_method());
           f(cichk->holder_klass());
         } else {
+          // Get Klass* or NULL (if value is -1) from GOT cell of virtual call PLT stub.
           Metadata* ic_oop = ic->cached_metadata();
           if (ic_oop != NULL) {
             f(ic_oop);
           }
         }
+      } else if (iter.type() == relocInfo::static_call_type ||
+                 iter.type() == relocInfo::opt_virtual_call_type){
+        // Check Method* in AOT c2i stub for other calls.
+        Metadata* meta = (Metadata*)nativeLoadGot_at(nativePltCall_at(iter.addr())->plt_c2i_stub())->data();
+        if (meta != NULL) {
+          f(meta);
+        }
       }
     }
   }
@@ -332,7 +328,12 @@
     st->print("%4d ", _aot_id);    // print compilation number
     st->print("    aot[%2d]", _heap->dso_id());
     // Stubs have _method == NULL
-    st->print("   %s", (_method == NULL ? _name : _method->name_and_sig_as_C_string()));
+    if (_method == NULL) {
+      st->print("   %s", _name);
+    } else {
+      ResourceMark m;
+      st->print("   %s", _method->name_and_sig_as_C_string());
+    }
     if (Verbose) {
       st->print(" entry at " INTPTR_FORMAT, p2i(_code));
     }
diff --git a/hotspot/src/share/vm/aot/aotCompiledMethod.hpp b/hotspot/src/share/vm/aot/aotCompiledMethod.hpp
index 7fef6fd..723bbdb 100644
--- a/hotspot/src/share/vm/aot/aotCompiledMethod.hpp
+++ b/hotspot/src/share/vm/aot/aotCompiledMethod.hpp
@@ -257,8 +257,6 @@
     return (int) (*_state_adr);
   }
 
-  virtual void oops_do(OopClosure* f);
-
   // inlined and non-virtual for AOTCodeHeap::oops_do
   void do_oops(OopClosure* f) {
     assert(_is_alive(), "");
diff --git a/hotspot/src/share/vm/aot/aotLoader.cpp b/hotspot/src/share/vm/aot/aotLoader.cpp
index 0dbf9ff..bd2cc8f 100644
--- a/hotspot/src/share/vm/aot/aotLoader.cpp
+++ b/hotspot/src/share/vm/aot/aotLoader.cpp
@@ -113,8 +113,8 @@
   "java.logging",
   "jdk.compiler",
   "jdk.scripting.nashorn",
-  "jdk.vm.ci",
-  "jdk.vm.compiler"
+  "jdk.internal.vm.ci",
+  "jdk.internal.vm.compiler"
 };
 
 void AOTLoader::initialize() {
diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
index e3a7af6..095ac87 100644
--- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
+++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
@@ -248,7 +248,9 @@
   } else if ((lf = x->array()->as_LoadField()) != NULL) {
     ciField* field = lf->field();
     if (field->is_static_constant()) {
-      assert(PatchALot || ScavengeRootsInCode < 2, "Constant field loads are folded during parsing");
+      // Constant field loads are usually folded during parsing.
+      // But it doesn't happen with PatchALot, ScavengeRootsInCode < 2, or when
+      // holder class is being initialized during parsing (for static fields).
       ciObject* c = field->constant_value().as_object();
       if (!c->is_null_object()) {
         set_constant(c->as_array()->length());
diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
index 1a0a5f6..0a13032 100644
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
@@ -1540,7 +1540,7 @@
         ciMethod* caller = state()->scope()->method();
         ciMethodData* md = caller->method_data_or_null();
         ciProfileData* data = md->bci_to_data(invoke_bci);
-        if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
+        if (data != NULL && (data->is_CallTypeData() || data->is_VirtualCallTypeData())) {
           bool has_return = data->is_CallTypeData() ? ((ciCallTypeData*)data)->has_return() : ((ciVirtualCallTypeData*)data)->has_return();
           // May not be true in case of an inlined call through a method handle intrinsic.
           if (has_return) {
@@ -1758,7 +1758,7 @@
   start = has_receiver ? 1 : 0;
   if (profile_arguments()) {
     ciProfileData* data = method()->method_data()->bci_to_data(bci());
-    if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
+    if (data != NULL && (data->is_CallTypeData() || data->is_VirtualCallTypeData())) {
       n = data->is_CallTypeData() ? data->as_CallTypeData()->number_of_arguments() : data->as_VirtualCallTypeData()->number_of_arguments();
     }
   }
@@ -3995,10 +3995,14 @@
         ciMethod* target = type->as_ObjectType()->constant_value()->as_method_handle()->get_vmtarget();
         // We don't do CHA here so only inline static and statically bindable methods.
         if (target->is_static() || target->can_be_statically_bound()) {
-          Bytecodes::Code bc = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokevirtual;
-          ignore_return = ignore_return || (callee->return_type()->is_void() && !target->return_type()->is_void());
-          if (try_inline(target, /*holder_known*/ true, ignore_return, bc)) {
-            return true;
+          if (ciMethod::is_consistent_info(callee, target)) {
+            Bytecodes::Code bc = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokevirtual;
+            ignore_return = ignore_return || (callee->return_type()->is_void() && !target->return_type()->is_void());
+            if (try_inline(target, /*holder_known*/ true, ignore_return, bc)) {
+              return true;
+            }
+          } else {
+            print_inlining(target, "signatures mismatch", /*success*/ false);
           }
         } else {
           print_inlining(target, "not static or statically bindable", /*success*/ false);
@@ -4026,6 +4030,8 @@
           if (try_method_handle_inline(target, ignore_return)) {
             return true;
           }
+        } else if (!ciMethod::is_consistent_info(callee, target)) {
+          print_inlining(target, "signatures mismatch", /*success*/ false);
         } else {
           ciSignature* signature = target->signature();
           const int receiver_skip = target->is_static() ? 0 : 1;
@@ -4343,7 +4349,7 @@
   }
   ciMethodData* md = m->method_data_or_null();
   ciProfileData* data = md->bci_to_data(invoke_bci);
-  if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
+  if (data != NULL && (data->is_CallTypeData() || data->is_VirtualCallTypeData())) {
     append(new ProfileReturnType(m , invoke_bci, callee, ret));
   }
 }
diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp
index 05f3947..e6cdb5e 100644
--- a/hotspot/src/share/vm/c1/c1_LIR.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIR.cpp
@@ -1413,6 +1413,17 @@
   append(c);
 }
 
+void LIR_List::null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null) {
+  if (deoptimize_on_null) {
+    // Emit an explicit null check and deoptimize if opr is null
+    CodeStub* deopt = new DeoptimizeStub(info, Deoptimization::Reason_null_check, Deoptimization::Action_none);
+    cmp(lir_cond_equal, opr, LIR_OprFact::oopConst(NULL));
+    branch(lir_cond_equal, T_OBJECT, deopt);
+  } else {
+    // Emit an implicit null check
+    append(new LIR_Op1(lir_null_check, opr, info));
+  }
+}
 
 void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
                         LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp
index 79d298d..a9c073d 100644
--- a/hotspot/src/share/vm/c1/c1_LIR.hpp
+++ b/hotspot/src/share/vm/c1/c1_LIR.hpp
@@ -613,7 +613,7 @@
   // Platform dependant.
   static LIR_Opr double_fpu(int reg1, int reg2 = -1 /*fnoreg*/);
 
-#ifdef __SOFTFP__
+#ifdef ARM32
   static LIR_Opr single_softfp(int reg) {
     return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
                                LIR_OprDesc::float_type           |
@@ -627,7 +627,7 @@
                                LIR_OprDesc::cpu_register         |
                                LIR_OprDesc::double_size);
   }
-#endif // __SOFTFP__
+#endif // ARM32
 
 #if defined(X86)
   static LIR_Opr single_xmm(int reg) {
@@ -2113,7 +2113,7 @@
   void   pack64(LIR_Opr src, LIR_Opr dst) { append(new LIR_Op1(lir_pack64,   src, dst, T_LONG, lir_patch_none, NULL)); }
   void unpack64(LIR_Opr src, LIR_Opr dst) { append(new LIR_Op1(lir_unpack64, src, dst, T_LONG, lir_patch_none, NULL)); }
 
-  void null_check(LIR_Opr opr, CodeEmitInfo* info)         { append(new LIR_Op1(lir_null_check, opr, info)); }
+  void null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null = false);
   void throw_exception(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info) {
     append(new LIR_Op2(lir_throw, exceptionPC, exceptionOop, LIR_OprFact::illegalOpr, info));
   }
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
index 0c10e86..8143eef 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -1752,8 +1752,10 @@
   if (x->needs_null_check() &&
       (needs_patching ||
        MacroAssembler::needs_explicit_null_check(x->offset()))) {
-    // emit an explicit null check because the offset is too large
-    __ null_check(object.result(), new CodeEmitInfo(info));
+    // Emit an explicit null check because the offset is too large.
+    // If the class is not loaded and the object is NULL, we need to deoptimize to throw a
+    // NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code.
+    __ null_check(object.result(), new CodeEmitInfo(info), /* deoptimize */ needs_patching);
   }
 
   LIR_Address* address;
@@ -1838,8 +1840,10 @@
       obj = new_register(T_OBJECT);
       __ move(LIR_OprFact::oopConst(NULL), obj);
     }
-    // emit an explicit null check because the offset is too large
-    __ null_check(obj, new CodeEmitInfo(info));
+    // Emit an explicit null check because the offset is too large.
+    // If the class is not loaded and the object is NULL, we need to deoptimize to throw a
+    // NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code.
+    __ null_check(obj, new CodeEmitInfo(info), /* deoptimize */ needs_patching);
   }
 
   LIR_Opr reg = rlock_result(x, field_type);
@@ -3258,50 +3262,52 @@
     int bci = x->bci_of_invoke();
     ciMethodData* md = x->method()->method_data_or_null();
     ciProfileData* data = md->bci_to_data(bci);
-    if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) ||
-        (data->is_VirtualCallTypeData() && data->as_VirtualCallTypeData()->has_arguments())) {
-      ByteSize extra = data->is_CallTypeData() ? CallTypeData::args_data_offset() : VirtualCallTypeData::args_data_offset();
-      int base_offset = md->byte_offset_of_slot(data, extra);
-      LIR_Opr mdp = LIR_OprFact::illegalOpr;
-      ciTypeStackSlotEntries* args = data->is_CallTypeData() ? ((ciCallTypeData*)data)->args() : ((ciVirtualCallTypeData*)data)->args();
+    if (data != NULL) {
+      if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) ||
+          (data->is_VirtualCallTypeData() && data->as_VirtualCallTypeData()->has_arguments())) {
+        ByteSize extra = data->is_CallTypeData() ? CallTypeData::args_data_offset() : VirtualCallTypeData::args_data_offset();
+        int base_offset = md->byte_offset_of_slot(data, extra);
+        LIR_Opr mdp = LIR_OprFact::illegalOpr;
+        ciTypeStackSlotEntries* args = data->is_CallTypeData() ? ((ciCallTypeData*)data)->args() : ((ciVirtualCallTypeData*)data)->args();
 
-      Bytecodes::Code bc = x->method()->java_code_at_bci(bci);
-      int start = 0;
-      int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments();
-      if (x->callee()->is_loaded() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) {
-        // first argument is not profiled at call (method handle invoke)
-        assert(x->method()->raw_code_at_bci(bci) == Bytecodes::_invokehandle, "invokehandle expected");
-        start = 1;
-      }
-      ciSignature* callee_signature = x->callee()->signature();
-      // method handle call to virtual method
-      bool has_receiver = x->callee()->is_loaded() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc);
-      ciSignatureStream callee_signature_stream(callee_signature, has_receiver ? x->callee()->holder() : NULL);
-
-      bool ignored_will_link;
-      ciSignature* signature_at_call = NULL;
-      x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
-      ciSignatureStream signature_at_call_stream(signature_at_call);
-
-      // if called through method handle invoke, some arguments may have been popped
-      for (int i = 0; i < stop && i+start < x->nb_profiled_args(); i++) {
-        int off = in_bytes(TypeEntriesAtCall::argument_type_offset(i)) - in_bytes(TypeEntriesAtCall::args_data_offset());
-        ciKlass* exact = profile_type(md, base_offset, off,
-                                      args->type(i), x->profiled_arg_at(i+start), mdp,
-                                      !x->arg_needs_null_check(i+start),
-                                      signature_at_call_stream.next_klass(), callee_signature_stream.next_klass());
-        if (exact != NULL) {
-          md->set_argument_type(bci, i, exact);
+        Bytecodes::Code bc = x->method()->java_code_at_bci(bci);
+        int start = 0;
+        int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments();
+        if (x->callee()->is_loaded() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) {
+          // first argument is not profiled at call (method handle invoke)
+          assert(x->method()->raw_code_at_bci(bci) == Bytecodes::_invokehandle, "invokehandle expected");
+          start = 1;
         }
-      }
-    } else {
+        ciSignature* callee_signature = x->callee()->signature();
+        // method handle call to virtual method
+        bool has_receiver = x->callee()->is_loaded() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc);
+        ciSignatureStream callee_signature_stream(callee_signature, has_receiver ? x->callee()->holder() : NULL);
+
+        bool ignored_will_link;
+        ciSignature* signature_at_call = NULL;
+        x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
+        ciSignatureStream signature_at_call_stream(signature_at_call);
+
+        // if called through method handle invoke, some arguments may have been popped
+        for (int i = 0; i < stop && i+start < x->nb_profiled_args(); i++) {
+          int off = in_bytes(TypeEntriesAtCall::argument_type_offset(i)) - in_bytes(TypeEntriesAtCall::args_data_offset());
+          ciKlass* exact = profile_type(md, base_offset, off,
+              args->type(i), x->profiled_arg_at(i+start), mdp,
+              !x->arg_needs_null_check(i+start),
+              signature_at_call_stream.next_klass(), callee_signature_stream.next_klass());
+          if (exact != NULL) {
+            md->set_argument_type(bci, i, exact);
+          }
+        }
+      } else {
 #ifdef ASSERT
-      Bytecodes::Code code = x->method()->raw_code_at_bci(x->bci_of_invoke());
-      int n = x->nb_profiled_args();
-      assert(MethodData::profile_parameters() && (MethodData::profile_arguments_jsr292_only() ||
-                                                  (x->inlined() && ((code == Bytecodes::_invokedynamic && n <= 1) || (code == Bytecodes::_invokehandle && n <= 2)))),
-             "only at JSR292 bytecodes");
+        Bytecodes::Code code = x->method()->raw_code_at_bci(x->bci_of_invoke());
+        int n = x->nb_profiled_args();
+        assert(MethodData::profile_parameters() && (MethodData::profile_arguments_jsr292_only() ||
+            (x->inlined() && ((code == Bytecodes::_invokedynamic && n <= 1) || (code == Bytecodes::_invokehandle && n <= 2)))),
+            "only at JSR292 bytecodes");
 #endif
+      }
     }
   }
 }
@@ -3392,24 +3398,26 @@
   int bci = x->bci_of_invoke();
   ciMethodData* md = x->method()->method_data_or_null();
   ciProfileData* data = md->bci_to_data(bci);
-  assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type");
-  ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret();
-  LIR_Opr mdp = LIR_OprFact::illegalOpr;
+  if (data != NULL) {
+    assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type");
+    ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret();
+    LIR_Opr mdp = LIR_OprFact::illegalOpr;
 
-  bool ignored_will_link;
-  ciSignature* signature_at_call = NULL;
-  x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
+    bool ignored_will_link;
+    ciSignature* signature_at_call = NULL;
+    x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
 
-  // The offset within the MDO of the entry to update may be too large
-  // to be used in load/store instructions on some platforms. So have
-  // profile_type() compute the address of the profile in a register.
-  ciKlass* exact = profile_type(md, md->byte_offset_of_slot(data, ret->type_offset()), 0,
-                                ret->type(), x->ret(), mdp,
-                                !x->needs_null_check(),
-                                signature_at_call->return_type()->as_klass(),
-                                x->callee()->signature()->return_type()->as_klass());
-  if (exact != NULL) {
-    md->set_return_type(bci, exact);
+    // The offset within the MDO of the entry to update may be too large
+    // to be used in load/store instructions on some platforms. So have
+    // profile_type() compute the address of the profile in a register.
+    ciKlass* exact = profile_type(md, md->byte_offset_of_slot(data, ret->type_offset()), 0,
+        ret->type(), x->ret(), mdp,
+        !x->needs_null_check(),
+        signature_at_call->return_type()->as_klass(),
+        x->callee()->signature()->return_type()->as_klass());
+    if (exact != NULL) {
+      md->set_return_type(bci, exact);
+    }
   }
 }
 
diff --git a/hotspot/src/share/vm/c1/c1_ValueMap.hpp b/hotspot/src/share/vm/c1/c1_ValueMap.hpp
index e2e1c1b..5b1342e 100644
--- a/hotspot/src/share/vm/c1/c1_ValueMap.hpp
+++ b/hotspot/src/share/vm/c1/c1_ValueMap.hpp
@@ -157,6 +157,12 @@
   void do_UnsafePutRaw   (UnsafePutRaw*    x) { kill_memory(); }
   void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); }
   void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { kill_memory(); }
+  void do_UnsafeGetRaw   (UnsafeGetRaw*    x) { /* nothing to do */ }
+  void do_UnsafeGetObject(UnsafeGetObject* x) {
+    if (x->is_volatile()) { // the JMM requires this
+      kill_memory();
+    }
+  }
   void do_Intrinsic      (Intrinsic*       x) { if (!x->preserves_state()) kill_memory(); }
 
   void do_Phi            (Phi*             x) { /* nothing to do */ }
@@ -197,8 +203,6 @@
   void do_OsrEntry       (OsrEntry*        x) { /* nothing to do */ }
   void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ }
   void do_RoundFP        (RoundFP*         x) { /* nothing to do */ }
-  void do_UnsafeGetRaw   (UnsafeGetRaw*    x) { /* nothing to do */ }
-  void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ }
   void do_ProfileCall    (ProfileCall*     x) { /* nothing to do */ }
   void do_ProfileReturnType (ProfileReturnType*  x) { /* nothing to do */ }
   void do_ProfileInvoke  (ProfileInvoke*   x) { /* nothing to do */ };
diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp
index 024909b..c7801a1 100644
--- a/hotspot/src/share/vm/ci/ciEnv.cpp
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp
@@ -101,6 +101,7 @@
   _debug_info = NULL;
   _dependencies = NULL;
   _failure_reason = NULL;
+  _inc_decompile_count_on_failure = true;
   _compilable = MethodCompilable;
   _break_at_compile = false;
   _compiler_data = NULL;
@@ -161,6 +162,7 @@
   _debug_info = NULL;
   _dependencies = NULL;
   _failure_reason = NULL;
+  _inc_decompile_count_on_failure = true;
   _compilable = MethodCompilable_never;
   _break_at_compile = false;
   _compiler_data = NULL;
@@ -702,16 +704,17 @@
 //
 // Perform an appropriate method lookup based on accessor, holder,
 // name, signature, and bytecode.
-Method* ciEnv::lookup_method(InstanceKlass*  accessor,
-                               InstanceKlass*  holder,
-                               Symbol*       name,
-                               Symbol*       sig,
-                               Bytecodes::Code bc,
-                               constantTag    tag) {
-  EXCEPTION_CONTEXT;
-  KlassHandle h_accessor(THREAD, accessor);
-  KlassHandle h_holder(THREAD, holder);
-  LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
+Method* ciEnv::lookup_method(ciInstanceKlass* accessor,
+                             ciKlass*         holder,
+                             Symbol*          name,
+                             Symbol*          sig,
+                             Bytecodes::Code  bc,
+                             constantTag      tag) {
+  // Accessibility checks are performed in ciEnv::get_method_by_index_impl.
+  assert(check_klass_accessibility(accessor, holder->get_Klass()), "holder not accessible");
+
+  KlassHandle h_accessor(accessor->get_instanceKlass());
+  KlassHandle h_holder(holder->get_Klass());
   methodHandle dest_method;
   LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
   switch (bc) {
@@ -770,7 +773,6 @@
     const int holder_index = cpool->klass_ref_index_at(index);
     bool holder_is_accessible;
     ciKlass* holder = get_klass_by_index_impl(cpool, holder_index, holder_is_accessible, accessor);
-    ciInstanceKlass* declared_holder = get_instance_klass_for_declared_method_holder(holder);
 
     // Get the method's name and signature.
     Symbol* name_sym = cpool->name_ref_at(index);
@@ -798,10 +800,9 @@
     }
 
     if (holder_is_accessible) {  // Our declared holder is loaded.
-      InstanceKlass* lookup = declared_holder->get_instanceKlass();
       constantTag tag = cpool->tag_ref_at(index);
       assert(accessor->get_instanceKlass() == cpool->pool_holder(), "not the pool holder?");
-      Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc, tag);
+      Method* m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag);
       if (m != NULL &&
           (bc == Bytecodes::_invokestatic
            ?  m->method_holder()->is_not_initialized()
@@ -824,7 +825,7 @@
     // lookup.
     ciSymbol* name      = get_symbol(name_sym);
     ciSymbol* signature = get_symbol(sig_sym);
-    return get_unloaded_method(declared_holder, name, signature, accessor);
+    return get_unloaded_method(holder, name, signature, accessor);
   }
 }
 
@@ -902,7 +903,12 @@
     if (deps.is_klass_type())  continue;  // skip klass dependencies
     Klass* witness = deps.check_dependency();
     if (witness != NULL) {
-      record_failure("invalid non-klass dependency");
+      if (deps.type() == Dependencies::call_site_target_value) {
+        _inc_decompile_count_on_failure = false;
+        record_failure("call site target change");
+      } else {
+        record_failure("invalid non-klass dependency");
+      }
       return;
     }
   }
@@ -1017,7 +1023,7 @@
     if (failing()) {
       // While not a true deoptimization, it is a preemptive decompile.
       MethodData* mdo = method()->method_data();
-      if (mdo != NULL) {
+      if (mdo != NULL && _inc_decompile_count_on_failure) {
         mdo->inc_decompile_count();
       }
 
diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp
index e5a99e1..a7fbe0b 100644
--- a/hotspot/src/share/vm/ci/ciEnv.hpp
+++ b/hotspot/src/share/vm/ci/ciEnv.hpp
@@ -55,6 +55,7 @@
   DebugInformationRecorder* _debug_info;
   Dependencies*    _dependencies;
   const char*      _failure_reason;
+  bool             _inc_decompile_count_on_failure;
   int              _compilable;
   bool             _break_at_compile;
   int              _num_inlined_bytecodes;
@@ -152,12 +153,12 @@
   // Helper methods
   bool       check_klass_accessibility(ciKlass* accessing_klass,
                                       Klass* resolved_klass);
-  Method*    lookup_method(InstanceKlass*  accessor,
-                           InstanceKlass*  holder,
-                           Symbol*         name,
-                           Symbol*         sig,
-                           Bytecodes::Code bc,
-                           constantTag     tag);
+  Method*    lookup_method(ciInstanceKlass* accessor,
+                           ciKlass*         holder,
+                           Symbol*          name,
+                           Symbol*          sig,
+                           Bytecodes::Code  bc,
+                           constantTag      tag);
 
   // Get a ciObject from the object factory.  Ensures uniqueness
   // of ciObjects.
@@ -226,11 +227,12 @@
   // Get a ciMethod representing either an unfound method or
   // a method with an unloaded holder.  Ensures uniqueness of
   // the result.
-  ciMethod* get_unloaded_method(ciInstanceKlass* holder,
+  ciMethod* get_unloaded_method(ciKlass*         holder,
                                 ciSymbol*        name,
                                 ciSymbol*        signature,
                                 ciInstanceKlass* accessor) {
-    return _factory->get_unloaded_method(holder, name, signature, accessor);
+    ciInstanceKlass* declared_holder = get_instance_klass_for_declared_method_holder(holder);
+    return _factory->get_unloaded_method(declared_holder, name, signature, accessor);
   }
 
   // Get a ciKlass representing an unloaded klass.
diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp
index 4860427..3101612 100644
--- a/hotspot/src/share/vm/ci/ciMethod.cpp
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp
@@ -1409,6 +1409,97 @@
   }
 }
 
+// ------------------------------------------------------------------
+
+static BasicType erase_to_word_type(BasicType bt) {
+  if (is_subword_type(bt)) return T_INT;
+  if (bt == T_ARRAY)       return T_OBJECT;
+  return bt;
+}
+
+static bool basic_types_match(ciType* t1, ciType* t2) {
+  if (t1 == t2)  return true;
+  return erase_to_word_type(t1->basic_type()) == erase_to_word_type(t2->basic_type());
+}
+
+bool ciMethod::is_consistent_info(ciMethod* declared_method, ciMethod* resolved_method) {
+  bool invoke_through_mh_intrinsic = declared_method->is_method_handle_intrinsic() &&
+                                  !resolved_method->is_method_handle_intrinsic();
+
+  if (!invoke_through_mh_intrinsic) {
+    // Method name & descriptor should stay the same.
+    // Signatures may reference unloaded types and thus they may be not strictly equal.
+    ciSymbol* declared_signature = declared_method->signature()->as_symbol();
+    ciSymbol* resolved_signature = resolved_method->signature()->as_symbol();
+
+    return (declared_method->name()->equals(resolved_method->name())) &&
+           (declared_signature->equals(resolved_signature));
+  }
+
+  ciMethod* linker = declared_method;
+  ciMethod* target = resolved_method;
+  // Linkers have appendix argument which is not passed to callee.
+  int has_appendix = MethodHandles::has_member_arg(linker->intrinsic_id()) ? 1 : 0;
+  if (linker->arg_size() != (target->arg_size() + has_appendix)) {
+    return false; // argument slot count mismatch
+  }
+
+  ciSignature* linker_sig = linker->signature();
+  ciSignature* target_sig = target->signature();
+
+  if (linker_sig->count() + (linker->is_static() ? 0 : 1) !=
+      target_sig->count() + (target->is_static() ? 0 : 1) + has_appendix) {
+    return false; // argument count mismatch
+  }
+
+  int sbase = 0, rbase = 0;
+  switch (linker->intrinsic_id()) {
+    case vmIntrinsics::_linkToVirtual:
+    case vmIntrinsics::_linkToInterface:
+    case vmIntrinsics::_linkToSpecial: {
+      if (target->is_static()) {
+        return false;
+      }
+      if (linker_sig->type_at(0)->is_primitive_type()) {
+        return false;  // receiver should be an oop
+      }
+      sbase = 1; // skip receiver
+      break;
+    }
+    case vmIntrinsics::_linkToStatic: {
+      if (!target->is_static()) {
+        return false;
+      }
+      break;
+    }
+    case vmIntrinsics::_invokeBasic: {
+      if (target->is_static()) {
+        if (target_sig->type_at(0)->is_primitive_type()) {
+          return false; // receiver should be an oop
+        }
+        rbase = 1; // skip receiver
+      }
+      break;
+    }
+  }
+  assert(target_sig->count() - rbase == linker_sig->count() - sbase - has_appendix, "argument count mismatch");
+  int arg_count = target_sig->count() - rbase;
+  for (int i = 0; i < arg_count; i++) {
+    if (!basic_types_match(linker_sig->type_at(sbase + i), target_sig->type_at(rbase + i))) {
+      return false;
+    }
+  }
+  // Only check the return type if the symbolic info has non-void return type.
+  // I.e. the return value of the resolved method can be dropped.
+  if (!linker->return_type()->is_void() &&
+      !basic_types_match(linker->return_type(), target->return_type())) {
+    return false;
+  }
+  return true; // no mismatch found
+}
+
+// ------------------------------------------------------------------
+
 #if INCLUDE_TRACE
 TraceStructCalleeMethod ciMethod::to_trace_struct() const {
   TraceStructCalleeMethod result;
diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp
index f16948e..dca8581 100644
--- a/hotspot/src/share/vm/ci/ciMethod.hpp
+++ b/hotspot/src/share/vm/ci/ciMethod.hpp
@@ -353,6 +353,8 @@
   void print_name(outputStream* st = tty);
   void print_short_name(outputStream* st = tty);
 
+  static bool is_consistent_info(ciMethod* declared_method, ciMethod* resolved_method);
+
 #if INCLUDE_TRACE
   TraceStructCalleeMethod to_trace_struct() const;
 #endif
diff --git a/hotspot/src/share/vm/ci/ciMethodData.cpp b/hotspot/src/share/vm/ci/ciMethodData.cpp
index 0ede3df..1e773c9 100644
--- a/hotspot/src/share/vm/ci/ciMethodData.cpp
+++ b/hotspot/src/share/vm/ci/ciMethodData.cpp
@@ -408,11 +408,13 @@
   MethodData* mdo = get_MethodData();
   if (mdo != NULL) {
     ProfileData* data = mdo->bci_to_data(bci);
-    if (data->is_CallTypeData()) {
-      data->as_CallTypeData()->set_argument_type(i, k->get_Klass());
-    } else {
-      assert(data->is_VirtualCallTypeData(), "no arguments!");
-      data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass());
+    if (data != NULL) {
+      if (data->is_CallTypeData()) {
+        data->as_CallTypeData()->set_argument_type(i, k->get_Klass());
+      } else {
+        assert(data->is_VirtualCallTypeData(), "no arguments!");
+        data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass());
+      }
     }
   }
 }
@@ -430,11 +432,13 @@
   MethodData* mdo = get_MethodData();
   if (mdo != NULL) {
     ProfileData* data = mdo->bci_to_data(bci);
-    if (data->is_CallTypeData()) {
-      data->as_CallTypeData()->set_return_type(k->get_Klass());
-    } else {
-      assert(data->is_VirtualCallTypeData(), "no arguments!");
-      data->as_VirtualCallTypeData()->set_return_type(k->get_Klass());
+    if (data != NULL) {
+      if (data->is_CallTypeData()) {
+        data->as_CallTypeData()->set_return_type(k->get_Klass());
+      } else {
+        assert(data->is_VirtualCallTypeData(), "no arguments!");
+        data->as_VirtualCallTypeData()->set_return_type(k->get_Klass());
+      }
     }
   }
 }
diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
index 96ffac1..db813ad 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -105,6 +105,12 @@
 
 #define JAVA_9_VERSION                    53
 
+void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
+  assert((bad_constant == 19 || bad_constant == 20) && _major_version >= JAVA_9_VERSION,
+         "Unexpected bad constant pool entry");
+  if (_bad_constant_seen == 0) _bad_constant_seen = bad_constant;
+}
+
 void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const stream,
                                                   ConstantPool* cp,
                                                   const int length,
@@ -302,6 +308,18 @@
         }
         break;
       }
+      case 19:
+      case 20: {
+        // Record that an error occurred in these two cases but keep parsing so
+        // that ACC_Module can be checked for in the access_flags.  Need to
+        // throw NoClassDefFoundError in that case.
+        if (_major_version >= JAVA_9_VERSION) {
+          cfs->guarantee_more(3, CHECK);
+          cfs->get_u2_fast();
+          set_class_bad_constant_seen(tag);
+          break;
+        }
+      }
       default: {
         classfile_parse_error("Unknown constant tag %u in class file %s",
                               tag,
@@ -359,14 +377,18 @@
 #endif
 
 void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream,
-                                          ConstantPool* const cp,
-                                          const int length,
-                                          TRAPS) {
+                                         ConstantPool* const cp,
+                                         const int length,
+                                         TRAPS) {
   assert(cp != NULL, "invariant");
   assert(stream != NULL, "invariant");
 
   // parsing constant pool entries
   parse_constant_pool_entries(stream, cp, length, CHECK);
+  if (class_bad_constant_seen() != 0) {
+    // a bad CP entry has been detected previously so stop parsing and just return.
+    return;
+  }
 
   int index = 1;  // declared outside of loops for portability
 
@@ -1244,6 +1266,10 @@
       }
     } else if (_major_version >= JAVA_1_5_VERSION) {
       if (attribute_name == vmSymbols::tag_signature()) {
+        if (generic_signature_index != 0) {
+          classfile_parse_error(
+            "Multiple Signature attributes for field in class file %s", CHECK);
+        }
         if (attribute_length != 2) {
           classfile_parse_error(
             "Wrong size %u for field's Signature attribute in class file %s",
@@ -2565,6 +2591,11 @@
       }
     } else if (_major_version >= JAVA_1_5_VERSION) {
       if (method_attribute_name == vmSymbols::tag_signature()) {
+        if (generic_signature_index != 0) {
+          classfile_parse_error(
+            "Multiple Signature attributes for method in class file %s",
+            CHECK_NULL);
+        }
         if (method_attribute_length != 2) {
           classfile_parse_error(
             "Invalid Signature attribute length %u in class file %s",
@@ -3052,7 +3083,13 @@
                          "Class is both outer and inner class in class file %s", CHECK_0);
     }
     // Access flags
-    jint flags = cfs->get_u2_fast() & RECOGNIZED_INNER_CLASS_MODIFIERS;
+    jint flags;
+    // JVM_ACC_MODULE is defined in JDK-9 and later.
+    if (_major_version >= JAVA_9_VERSION) {
+      flags = cfs->get_u2_fast() & (RECOGNIZED_INNER_CLASS_MODIFIERS | JVM_ACC_MODULE);
+    } else {
+      flags = cfs->get_u2_fast() & RECOGNIZED_INNER_CLASS_MODIFIERS;
+    }
     if ((flags & JVM_ACC_INTERFACE) && _major_version < JAVA_6_VERSION) {
       // Set abstract bit for old class files for backward compatibility
       flags |= JVM_ACC_ABSTRACT;
@@ -3278,6 +3315,10 @@
       }
     } else if (_major_version >= JAVA_1_5_VERSION) {
       if (tag == vmSymbols::tag_signature()) {
+        if (_generic_signature_index != 0) {
+          classfile_parse_error(
+            "Multiple Signature attributes in class file %s", CHECK);
+        }
         if (attribute_length != 2) {
           classfile_parse_error(
             "Wrong Signature attribute length %u in class file %s",
@@ -4524,6 +4565,18 @@
 // utility methods for format checking
 
 void ClassFileParser::verify_legal_class_modifiers(jint flags, TRAPS) const {
+  const bool is_module = (flags & JVM_ACC_MODULE) != 0;
+  assert(_major_version >= JAVA_9_VERSION || !is_module, "JVM_ACC_MODULE should not be set");
+  if (is_module) {
+    ResourceMark rm(THREAD);
+    Exceptions::fthrow(
+      THREAD_AND_LOCATION,
+      vmSymbols::java_lang_NoClassDefFoundError(),
+      "%s is not a class because access_flag ACC_MODULE is set",
+      _class_name->as_C_string());
+    return;
+  }
+
   if (!_need_verify) { return; }
 
   const bool is_interface  = (flags & JVM_ACC_INTERFACE)  != 0;
@@ -4532,14 +4585,12 @@
   const bool is_super      = (flags & JVM_ACC_SUPER)      != 0;
   const bool is_enum       = (flags & JVM_ACC_ENUM)       != 0;
   const bool is_annotation = (flags & JVM_ACC_ANNOTATION) != 0;
-  const bool is_module_info= (flags & JVM_ACC_MODULE)     != 0;
   const bool major_gte_15  = _major_version >= JAVA_1_5_VERSION;
 
   if ((is_abstract && is_final) ||
       (is_interface && !is_abstract) ||
       (is_interface && major_gte_15 && (is_super || is_enum)) ||
-      (!is_interface && major_gte_15 && is_annotation) ||
-      is_module_info) {
+      (!is_interface && major_gte_15 && is_annotation)) {
     ResourceMark rm(THREAD);
     Exceptions::fthrow(
       THREAD_AND_LOCATION,
@@ -5355,7 +5406,7 @@
   ModuleEntry* module_entry = ik->module();
   assert(module_entry != NULL, "module_entry should always be set");
 
-  // Obtain java.lang.reflect.Module
+  // Obtain java.lang.Module
   Handle module_handle(THREAD, JNIHandles::resolve(module_entry->module()));
 
   // Allocate mirror and initialize static fields
@@ -5542,6 +5593,7 @@
   _protection_domain(protection_domain),
   _access_flags(),
   _pub_level(pub_level),
+  _bad_constant_seen(0),
   _synthetic_flag(false),
   _sde_length(false),
   _sde_buffer(NULL),
@@ -5734,16 +5786,29 @@
   stream->guarantee_more(8, CHECK);  // flags, this_class, super_class, infs_len
 
   // Access flags
-  jint flags = stream->get_u2_fast() & JVM_RECOGNIZED_CLASS_MODIFIERS;
+  jint flags;
+  // JVM_ACC_MODULE is defined in JDK-9 and later.
+  if (_major_version >= JAVA_9_VERSION) {
+    flags = stream->get_u2_fast() & (JVM_RECOGNIZED_CLASS_MODIFIERS | JVM_ACC_MODULE);
+  } else {
+    flags = stream->get_u2_fast() & JVM_RECOGNIZED_CLASS_MODIFIERS;
+  }
 
   if ((flags & JVM_ACC_INTERFACE) && _major_version < JAVA_6_VERSION) {
     // Set abstract bit for old class files for backward compatibility
     flags |= JVM_ACC_ABSTRACT;
   }
 
-  _access_flags.set_flags(flags);
+  verify_legal_class_modifiers(flags, CHECK);
 
-  verify_legal_class_modifiers((jint)_access_flags.as_int(), CHECK);
+  short bad_constant = class_bad_constant_seen();
+  if (bad_constant != 0) {
+    // Do not throw CFE until after the access_flags are checked because if
+    // ACC_MODULE is set in the access flags, then NCDFE must be thrown, not CFE.
+    classfile_parse_error("Unknown constant tag %u in class file %s", bad_constant, CHECK);
+  }
+
+  _access_flags.set_flags(flags);
 
   // This class and superclass
   _this_class_index = stream->get_u2_fast();
diff --git a/hotspot/src/share/vm/classfile/classFileParser.hpp b/hotspot/src/share/vm/classfile/classFileParser.hpp
index df9ff68..031a714 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,6 +122,15 @@
   // for tracing and notifications
   Publicity _pub_level;
 
+  // Used to keep track of whether a constant pool item 19 or 20 is found.  These
+  // correspond to CONSTANT_Module and CONSTANT_Package tags and are not allowed
+  // in regular class files.  For class file version >= 53, a CFE cannot be thrown
+  // immediately when these are seen because a NCDFE must be thrown if the class's
+  // access_flags have ACC_MODULE set.  But, the access_flags haven't been looked
+  // at yet.  So, the bad constant pool item is cached here.  A value of zero
+  // means that no constant pool item 19 or 20 was found.
+  short _bad_constant_seen;
+
   // class attributes parsed before the instance klass is created:
   bool _synthetic_flag;
   int _sde_length;
@@ -161,6 +170,8 @@
   void fill_instance_klass(InstanceKlass* ik, bool cf_changed_in_CFLH, TRAPS);
   void set_klass(InstanceKlass* instance);
 
+  void set_class_bad_constant_seen(short bad_constant);
+  short class_bad_constant_seen() { return  _bad_constant_seen; }
   void set_class_synthetic_flag(bool x)        { _synthetic_flag = x; }
   void set_class_sourcefile_index(u2 x)        { _sourcefile_index = x; }
   void set_class_generic_signature_index(u2 x) { _generic_signature_index = x; }
diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp
index d1e37d8..c7b2661 100644
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,7 @@
   _keep_alive((is_anonymous || h_class_loader.is_null()) ? 1 : 0),
   _metaspace(NULL), _unloading(false), _klasses(NULL),
   _modules(NULL), _packages(NULL),
-  _claimed(0), _jmethod_ids(NULL), _handles(NULL), _deallocate_list(NULL),
+  _claimed(0), _jmethod_ids(NULL), _handles(), _deallocate_list(NULL),
   _next(NULL), _dependencies(dependencies),
   _metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true,
                             Monitor::_safepoint_check_never)) {
@@ -112,6 +112,76 @@
   _list_head = oopFactory::new_objectArray(2, CHECK);
 }
 
+ClassLoaderData::ChunkedHandleList::~ChunkedHandleList() {
+  Chunk* c = _head;
+  while (c != NULL) {
+    Chunk* next = c->_next;
+    delete c;
+    c = next;
+  }
+}
+
+oop* ClassLoaderData::ChunkedHandleList::add(oop o) {
+  if (_head == NULL || _head->_size == Chunk::CAPACITY) {
+    Chunk* next = new Chunk(_head);
+    OrderAccess::release_store_ptr(&_head, next);
+  }
+  oop* handle = &_head->_data[_head->_size];
+  *handle = o;
+  OrderAccess::release_store(&_head->_size, _head->_size + 1);
+  return handle;
+}
+
+inline void ClassLoaderData::ChunkedHandleList::oops_do_chunk(OopClosure* f, Chunk* c, const juint size) {
+  for (juint i = 0; i < size; i++) {
+    if (c->_data[i] != NULL) {
+      f->do_oop(&c->_data[i]);
+    }
+  }
+}
+
+void ClassLoaderData::ChunkedHandleList::oops_do(OopClosure* f) {
+  Chunk* head = (Chunk*) OrderAccess::load_ptr_acquire(&_head);
+  if (head != NULL) {
+    // Must be careful when reading size of head
+    oops_do_chunk(f, head, OrderAccess::load_acquire(&head->_size));
+    for (Chunk* c = head->_next; c != NULL; c = c->_next) {
+      oops_do_chunk(f, c, c->_size);
+    }
+  }
+}
+
+#ifdef ASSERT
+class VerifyContainsOopClosure : public OopClosure {
+  oop* _target;
+  bool _found;
+
+ public:
+  VerifyContainsOopClosure(oop* target) : _target(target), _found(false) {}
+
+  void do_oop(oop* p) {
+    if (p == _target) {
+      _found = true;
+    }
+  }
+
+  void do_oop(narrowOop* p) {
+    // The ChunkedHandleList should not contain any narrowOop
+    ShouldNotReachHere();
+  }
+
+  bool found() const {
+    return _found;
+  }
+};
+
+bool ClassLoaderData::ChunkedHandleList::contains(oop* p) {
+  VerifyContainsOopClosure cl(p);
+  oops_do(&cl);
+  return cl.found();
+}
+#endif
+
 bool ClassLoaderData::claim() {
   if (_claimed == 1) {
     return false;
@@ -146,9 +216,9 @@
 
   f->do_oop(&_class_loader);
   _dependencies.oops_do(f);
-  if (_handles != NULL) {
-    _handles->oops_do(f);
-  }
+
+  _handles.oops_do(f);
+
   if (klass_closure != NULL) {
     classes_do(klass_closure);
   }
@@ -484,12 +554,6 @@
     _metaspace = NULL;
     delete m;
   }
-  // release the handles
-  if (_handles != NULL) {
-    JNIHandleBlock::release_block(_handles);
-    _handles = NULL;
-  }
-
   // Clear all the JNI handles for methods
   // These aren't deallocated and are going to look like a leak, but that's
   // needed because we can't really get rid of jmethodIDs because we don't
@@ -563,19 +627,14 @@
   return metaspace;
 }
 
-JNIHandleBlock* ClassLoaderData::handles() const           { return _handles; }
-void ClassLoaderData::set_handles(JNIHandleBlock* handles) { _handles = handles; }
-
 jobject ClassLoaderData::add_handle(Handle h) {
   MutexLockerEx ml(metaspace_lock(),  Mutex::_no_safepoint_check_flag);
-  if (handles() == NULL) {
-    set_handles(JNIHandleBlock::allocate_block());
-  }
-  return handles()->allocate_handle(h());
+  return (jobject) _handles.add(h());
 }
 
-void ClassLoaderData::remove_handle(jobject h) {
-  _handles->release_handle(h);
+void ClassLoaderData::remove_handle_unsafe(jobject h) {
+  assert(_handles.contains((oop*) h), "Got unexpected handle " PTR_FORMAT, p2i((oop*) h));
+  *((oop*) h) = NULL;
 }
 
 // Add this metadata pointer to be freed when it's safe.  This is only during
@@ -645,7 +704,6 @@
       p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name());
   if (claimed()) out->print(" claimed ");
   if (is_unloading()) out->print(" unloading ");
-  out->print(" handles " INTPTR_FORMAT, p2i(handles()));
   out->cr();
   if (metaspace_or_null() != NULL) {
     out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp
index 8c8df51..3c0aba6 100644
--- a/hotspot/src/share/vm/classfile/classLoaderData.hpp
+++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,6 @@
 
 class ClassLoaderData;
 class JNIMethodBlock;
-class JNIHandleBlock;
 class Metadebug;
 class ModuleEntry;
 class PackageEntry;
@@ -160,6 +159,34 @@
     void oops_do(OopClosure* f);
   };
 
+  class ChunkedHandleList VALUE_OBJ_CLASS_SPEC {
+    struct Chunk : public CHeapObj<mtClass> {
+      static const size_t CAPACITY = 32;
+
+      oop _data[CAPACITY];
+      volatile juint _size;
+      Chunk* _next;
+
+      Chunk(Chunk* c) : _next(c), _size(0) { }
+    };
+
+    Chunk* _head;
+
+    void oops_do_chunk(OopClosure* f, Chunk* c, const juint size);
+
+   public:
+    ChunkedHandleList() : _head(NULL) {}
+    ~ChunkedHandleList();
+
+    // Only one thread at a time can add, guarded by ClassLoaderData::metaspace_lock().
+    // However, multiple threads can execute oops_do concurrently with add.
+    oop* add(oop o);
+#ifdef ASSERT
+    bool contains(oop* p);
+#endif
+    void oops_do(OopClosure* f);
+  };
+
   friend class ClassLoaderDataGraph;
   friend class ClassLoaderDataGraphKlassIteratorAtomic;
   friend class ClassLoaderDataGraphMetaspaceIterator;
@@ -185,8 +212,8 @@
   volatile int _claimed;   // true if claimed, for example during GC traces.
                            // To avoid applying oop closure more than once.
                            // Has to be an int because we cas it.
-  JNIHandleBlock* _handles; // Handles to constant pool arrays, Modules, etc, which
-                            // have the same life cycle of the corresponding ClassLoader.
+  ChunkedHandleList _handles; // Handles to constant pool arrays, Modules, etc, which
+                              // have the same life cycle of the corresponding ClassLoader.
 
   Klass* volatile _klasses;              // The classes defined by the class loader.
   PackageEntryTable* volatile _packages; // The packages defined by the class loader.
@@ -217,9 +244,6 @@
   ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies);
   ~ClassLoaderData();
 
-  JNIHandleBlock* handles() const;
-  void set_handles(JNIHandleBlock* handles);
-
   // GC interface.
   void clear_claimed()          { _claimed = 0; }
   bool claimed() const          { return _claimed == 1; }
@@ -312,7 +336,7 @@
   const char* loader_name();
 
   jobject add_handle(Handle h);
-  void remove_handle(jobject h);
+  void remove_handle_unsafe(jobject h);
   void add_class(Klass* k, bool publicize = true);
   void remove_class(Klass* k);
   bool contains_klass(Klass* k);
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index b7fe590..22c1e6c 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -773,13 +773,13 @@
   InstanceKlass::cast(k())->do_local_static_fields(&initialize_static_field, mirror, CHECK);
 }
 
-// Set the java.lang.reflect.Module module field in the java_lang_Class mirror
+// Set the java.lang.Module module field in the java_lang_Class mirror
 void java_lang_Class::set_mirror_module_field(KlassHandle k, Handle mirror, Handle module, TRAPS) {
   if (module.is_null()) {
     // During startup, the module may be NULL only if java.base has not been defined yet.
-    // Put the class on the fixup_module_list to patch later when the java.lang.reflect.Module
+    // Put the class on the fixup_module_list to patch later when the java.lang.Module
     // for java.base is known.
-    assert(!Universe::is_module_initialized(), "Incorrect java.lang.reflect.Module pre module system initialization");
+    assert(!Universe::is_module_initialized(), "Incorrect java.lang.Module pre module system initialization");
 
     bool javabase_was_defined = false;
     {
@@ -810,7 +810,7 @@
     assert(Universe::is_module_initialized() ||
            (ModuleEntryTable::javabase_defined() &&
             (module() == JNIHandles::resolve(ModuleEntryTable::javabase_moduleEntry()->module()))),
-           "Incorrect java.lang.reflect.Module specification while creating mirror");
+           "Incorrect java.lang.Module specification while creating mirror");
     set_module(mirror(), module());
   }
 }
@@ -2269,6 +2269,7 @@
   compute_offset(_monitors_offset,   k, vmSymbols::monitors_name(),    vmSymbols::object_array_signature());
   compute_offset(_locals_offset,     k, vmSymbols::locals_name(),      vmSymbols::object_array_signature());
   compute_offset(_operands_offset,   k, vmSymbols::operands_name(),    vmSymbols::object_array_signature());
+  compute_offset(_mode_offset,       k, vmSymbols::mode_name(),        vmSymbols::int_signature());
 }
 
 void java_lang_reflect_AccessibleObject::compute_offsets() {
@@ -2803,28 +2804,28 @@
 }
 
 
-int java_lang_reflect_Module::loader_offset;
-int java_lang_reflect_Module::name_offset;
-int java_lang_reflect_Module::_module_entry_offset = -1;
+int java_lang_Module::loader_offset;
+int java_lang_Module::name_offset;
+int java_lang_Module::_module_entry_offset = -1;
 
-Handle java_lang_reflect_Module::create(Handle loader, Handle module_name, TRAPS) {
+Handle java_lang_Module::create(Handle loader, Handle module_name, TRAPS) {
   assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
 
-  Symbol* name = vmSymbols::java_lang_reflect_Module();
+  Symbol* name = vmSymbols::java_lang_Module();
   Klass* k = SystemDictionary::resolve_or_fail(name, true, CHECK_NH);
   instanceKlassHandle klass (THREAD, k);
 
-  Handle jlrmh = klass->allocate_instance_handle(CHECK_NH);
+  Handle jlmh = klass->allocate_instance_handle(CHECK_NH);
   JavaValue result(T_VOID);
-  JavaCalls::call_special(&result, jlrmh, KlassHandle(THREAD, klass()),
+  JavaCalls::call_special(&result, jlmh, KlassHandle(THREAD, klass()),
                           vmSymbols::object_initializer_name(),
-                          vmSymbols::java_lang_reflect_module_init_signature(),
+                          vmSymbols::java_lang_module_init_signature(),
                           loader, module_name, CHECK_NH);
-  return jlrmh;
+  return jlmh;
 }
 
-void java_lang_reflect_Module::compute_offsets() {
-  Klass* k = SystemDictionary::reflect_Module_klass();
+void java_lang_Module::compute_offsets() {
+  Klass* k = SystemDictionary::Module_klass();
   if(NULL != k) {
     compute_offset(loader_offset,  k, vmSymbols::loader_name(),  vmSymbols::classloader_signature());
     compute_offset(name_offset,    k, vmSymbols::name_name(),    vmSymbols::string_signature());
@@ -2833,27 +2834,27 @@
 }
 
 
-oop java_lang_reflect_Module::loader(oop module) {
+oop java_lang_Module::loader(oop module) {
   assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
   return module->obj_field(loader_offset);
 }
 
-void java_lang_reflect_Module::set_loader(oop module, oop value) {
+void java_lang_Module::set_loader(oop module, oop value) {
   assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
   module->obj_field_put(loader_offset, value);
 }
 
-oop java_lang_reflect_Module::name(oop module) {
+oop java_lang_Module::name(oop module) {
   assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
   return module->obj_field(name_offset);
 }
 
-void java_lang_reflect_Module::set_name(oop module, oop value) {
+void java_lang_Module::set_name(oop module, oop value) {
   assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
   module->obj_field_put(name_offset, value);
 }
 
-ModuleEntry* java_lang_reflect_Module::module_entry(oop module, TRAPS) {
+ModuleEntry* java_lang_Module::module_entry(oop module, TRAPS) {
   assert(_module_entry_offset != -1, "Uninitialized module_entry_offset");
   assert(module != NULL, "module can't be null");
   assert(module->is_oop(), "module must be oop");
@@ -2862,7 +2863,7 @@
   if (module_entry == NULL) {
     // If the inject field containing the ModuleEntry* is null then return the
     // class loader's unnamed module.
-    oop loader = java_lang_reflect_Module::loader(module);
+    oop loader = java_lang_Module::loader(module);
     Handle h_loader = Handle(THREAD, loader);
     ClassLoaderData* loader_cld = SystemDictionary::register_loader(h_loader, CHECK_NULL);
     return loader_cld->modules()->unnamed_module();
@@ -2870,7 +2871,7 @@
   return module_entry;
 }
 
-void java_lang_reflect_Module::set_module_entry(oop module, ModuleEntry* module_entry) {
+void java_lang_Module::set_module_entry(oop module, ModuleEntry* module_entry) {
   assert(_module_entry_offset != -1, "Uninitialized module_entry_offset");
   assert(module != NULL, "module can't be null");
   assert(module->is_oop(), "module must be oop");
@@ -3246,6 +3247,15 @@
   mname->address_field_put(_vmindex_offset, (address) index);
 }
 
+bool java_lang_invoke_MemberName::equals(oop mn1, oop mn2) {
+  if (mn1 == mn2) {
+     return true;
+  }
+  return (vmtarget(mn1) == vmtarget(mn2) && flags(mn1) == flags(mn2) &&
+          vmindex(mn1) == vmindex(mn2) &&
+          clazz(mn1) == clazz(mn2));
+}
+
 oop java_lang_invoke_LambdaForm::vmentry(oop lform) {
   assert(is_instance(lform), "wrong type");
   return lform->obj_field(_vmentry_offset);
@@ -3658,6 +3668,7 @@
 int java_lang_LiveStackFrameInfo::_monitors_offset;
 int java_lang_LiveStackFrameInfo::_locals_offset;
 int java_lang_LiveStackFrameInfo::_operands_offset;
+int java_lang_LiveStackFrameInfo::_mode_offset;
 int java_lang_AssertionStatusDirectives::classes_offset;
 int java_lang_AssertionStatusDirectives::classEnabled_offset;
 int java_lang_AssertionStatusDirectives::packages_offset;
@@ -3728,6 +3739,10 @@
   element->obj_field_put(_operands_offset, value);
 }
 
+void java_lang_LiveStackFrameInfo::set_mode(oop element, int value) {
+  element->int_field_put(_mode_offset, value);
+}
+
 // Support for java Assertions - java_lang_AssertionStatusDirectives.
 
 void java_lang_AssertionStatusDirectives::set_classes(oop o, oop val) {
@@ -3862,7 +3877,7 @@
   reflect_ConstantPool::compute_offsets();
   reflect_UnsafeStaticFieldAccessorImpl::compute_offsets();
   java_lang_reflect_Parameter::compute_offsets();
-  java_lang_reflect_Module::compute_offsets();
+  java_lang_Module::compute_offsets();
   java_lang_StackFrameInfo::compute_offsets();
   java_lang_LiveStackFrameInfo::compute_offsets();
 
diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp
index f05db4c..da5d4a6 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -755,9 +755,9 @@
 };
 
 #define MODULE_INJECTED_FIELDS(macro)                            \
-  macro(java_lang_reflect_Module, module_entry, intptr_signature, false)
+  macro(java_lang_Module, module_entry, intptr_signature, false)
 
-class java_lang_reflect_Module {
+class java_lang_Module {
   private:
     static int loader_offset;
     static int name_offset;
@@ -1086,6 +1086,8 @@
   static int flags_offset_in_bytes()            { return _flags_offset; }
   static int vmtarget_offset_in_bytes()         { return _vmtarget_offset; }
   static int vmindex_offset_in_bytes()          { return _vmindex_offset; }
+
+  static bool equals(oop mt1, oop mt2);
 };
 
 
@@ -1380,11 +1382,13 @@
   static int _monitors_offset;
   static int _locals_offset;
   static int _operands_offset;
+  static int _mode_offset;
 
  public:
   static void set_monitors(oop info, oop value);
   static void set_locals(oop info, oop value);
   static void set_operands(oop info, oop value);
+  static void set_mode(oop info, int value);
 
   static void compute_offsets();
 
diff --git a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp
index b388bb1..a50113d 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -162,8 +162,8 @@
   return obj != NULL && is_subclass(obj->klass());
 }
 
-inline bool java_lang_reflect_Module::is_instance(oop obj) {
-  return obj != NULL && obj->klass() == SystemDictionary::reflect_Module_klass();
+inline bool java_lang_Module::is_instance(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::Module_klass();
 }
 
 inline int Backtrace::merge_bci_and_version(int bci, int version) {
diff --git a/hotspot/src/share/vm/classfile/moduleEntry.cpp b/hotspot/src/share/vm/classfile/moduleEntry.cpp
index 9402f5d..2f07b10 100644
--- a/hotspot/src/share/vm/classfile/moduleEntry.cpp
+++ b/hotspot/src/share/vm/classfile/moduleEntry.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,11 +87,11 @@
 // Set the shared ProtectionDomain atomically
 void ModuleEntry::set_shared_protection_domain(ClassLoaderData *loader_data,
                                                Handle pd_h) {
-  // Create a JNI handle for the shared ProtectionDomain and save it atomically.
-  // If someone beats us setting the _pd cache, the created JNI handle is destroyed.
+  // Create a handle for the shared ProtectionDomain and save it atomically.
+  // If someone beats us setting the _pd cache, the created handle is destroyed.
   jobject obj = loader_data->add_handle(pd_h);
   if (Atomic::cmpxchg_ptr(obj, &_pd, NULL) != NULL) {
-    loader_data->remove_handle(obj);
+    loader_data->remove_handle_unsafe(obj);
   }
 }
 
@@ -266,19 +266,19 @@
 
   // Each ModuleEntryTable has exactly one unnamed module
   if (loader_data->is_the_null_class_loader_data()) {
-    // For the boot loader, the java.lang.reflect.Module for the unnamed module
+    // For the boot loader, the java.lang.Module for the unnamed module
     // is not known until a call to JVM_SetBootLoaderUnnamedModule is made. At
     // this point initially create the ModuleEntry for the unnamed module.
     _unnamed_module = new_entry(0, Handle(NULL), NULL, NULL, NULL, loader_data);
   } else {
-    // For all other class loaders the java.lang.reflect.Module for their
+    // For all other class loaders the java.lang.Module for their
     // corresponding unnamed module can be found in the java.lang.ClassLoader object.
     oop module = java_lang_ClassLoader::unnamedModule(loader_data->class_loader());
     _unnamed_module = new_entry(0, Handle(module), NULL, NULL, NULL, loader_data);
 
-    // Store pointer to the ModuleEntry in the unnamed module's java.lang.reflect.Module
+    // Store pointer to the ModuleEntry in the unnamed module's java.lang.Module
     // object.
-    java_lang_reflect_Module::set_module_entry(module, _unnamed_module);
+    java_lang_Module::set_module_entry(module, _unnamed_module);
   }
 
   // Add to bucket 0, no name to hash on
@@ -388,27 +388,27 @@
     fatal("Unable to finalize module definition for " JAVA_BASE_NAME);
   }
 
-  // Set java.lang.reflect.Module, version and location for java.base
+  // Set java.lang.Module, version and location for java.base
   ModuleEntry* jb_module = javabase_moduleEntry();
   assert(jb_module != NULL, JAVA_BASE_NAME " ModuleEntry not defined");
   jb_module->set_version(version);
   jb_module->set_location(location);
   // Once java.base's ModuleEntry _module field is set with the known
-  // java.lang.reflect.Module, java.base is considered "defined" to the VM.
+  // java.lang.Module, java.base is considered "defined" to the VM.
   jb_module->set_module(boot_loader_data->add_handle(module_handle));
 
-  // Store pointer to the ModuleEntry for java.base in the java.lang.reflect.Module object.
-  java_lang_reflect_Module::set_module_entry(module_handle(), jb_module);
+  // Store pointer to the ModuleEntry for java.base in the java.lang.Module object.
+  java_lang_Module::set_module_entry(module_handle(), jb_module);
 }
 
-// Within java.lang.Class instances there is a java.lang.reflect.Module field
-// that must be set with the defining module.  During startup, prior to java.base's
-// definition, classes needing their module field set are added to the fixup_module_list.
-// Their module field is set once java.base's java.lang.reflect.Module is known to the VM.
+// Within java.lang.Class instances there is a java.lang.Module field that must
+// be set with the defining module.  During startup, prior to java.base's definition,
+// classes needing their module field set are added to the fixup_module_list.
+// Their module field is set once java.base's java.lang.Module is known to the VM.
 void ModuleEntryTable::patch_javabase_entries(Handle module_handle) {
   if (module_handle.is_null()) {
     fatal("Unable to patch the module field of classes loaded prior to "
-          JAVA_BASE_NAME "'s definition, invalid java.lang.reflect.Module");
+          JAVA_BASE_NAME "'s definition, invalid java.lang.Module");
   }
 
   // Do the fixups for the basic primitive types
diff --git a/hotspot/src/share/vm/classfile/moduleEntry.hpp b/hotspot/src/share/vm/classfile/moduleEntry.hpp
index 85e898e..c50441a 100644
--- a/hotspot/src/share/vm/classfile/moduleEntry.hpp
+++ b/hotspot/src/share/vm/classfile/moduleEntry.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,8 @@
 #include "utilities/ostream.hpp"
 
 #define UNNAMED_MODULE "Unnamed Module"
-#define JAVAPKG "java/"
-#define JAVAPKG_LEN 5
+#define JAVAPKG "java"
+#define JAVAPKG_LEN 4
 #define JAVA_BASE_NAME "java.base"
 
 class ModuleClosure;
@@ -45,7 +45,7 @@
 // A ModuleEntry describes a module that has been defined by a call to JVM_DefineModule.
 // It contains:
 //   - Symbol* containing the module's name.
-//   - pointer to the java.lang.reflect.Module for this module.
+//   - pointer to the java.lang.Module for this module.
 //   - pointer to the java.security.ProtectionDomain shared by classes defined to this module.
 //   - ClassLoaderData*, class loader of this module.
 //   - a growable array containg other module entries that this module can read.
@@ -55,7 +55,7 @@
 // data structure.
 class ModuleEntry : public HashtableEntry<Symbol*, mtModule> {
 private:
-  jobject _module;                     // java.lang.reflect.Module
+  jobject _module;                     // java.lang.Module
   jobject _pd;                         // java.security.ProtectionDomain, cached
                                        // for shared classes from this module
   ClassLoaderData* _loader_data;
diff --git a/hotspot/src/share/vm/classfile/modules.cpp b/hotspot/src/share/vm/classfile/modules.cpp
index afa3553..3992849 100644
--- a/hotspot/src/share/vm/classfile/modules.cpp
+++ b/hotspot/src/share/vm/classfile/modules.cpp
@@ -62,7 +62,7 @@
 }
 
 static char* get_module_name(oop module, TRAPS) {
-  oop name_oop = java_lang_reflect_Module::name(module);
+  oop name_oop = java_lang_Module::name(module);
   if (name_oop == NULL) {
     THROW_MSG_NULL(vmSymbols::java_lang_NullPointerException(), "Null module name");
   }
@@ -98,11 +98,11 @@
 
 static ModuleEntry* get_module_entry(jobject module, TRAPS) {
   Handle module_h(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_instance(module_h())) {
+  if (!java_lang_Module::is_instance(module_h())) {
     THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
-                   "module is not an instance of type java.lang.reflect.Module");
+                   "module is not an instance of type java.lang.Module");
   }
-  return java_lang_reflect_Module::module_entry(module_h(), CHECK_NULL);
+  return java_lang_Module::module_entry(module_h(), CHECK_NULL);
 }
 
 static PackageEntry* get_package_entry(ModuleEntry* module_entry, const char* package_name, TRAPS) {
@@ -181,7 +181,7 @@
   }
 
   // Validate java_base's loader is the boot loader.
-  oop loader = java_lang_reflect_Module::loader(module_handle());
+  oop loader = java_lang_Module::loader(module_handle());
   if (loader != NULL) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
               "Class loader must be the boot class loader");
@@ -234,7 +234,7 @@
   // Only the thread that actually defined the base module will get here,
   // so no locking is needed.
 
-  // Patch any previously loaded class's module field with java.base's java.lang.reflect.Module.
+  // Patch any previously loaded class's module field with java.base's java.lang.Module.
   ModuleEntryTable::patch_javabase_entries(module_handle);
 
   log_debug(modules)("define_javabase_module(): Definition of module: "
@@ -284,9 +284,9 @@
   }
 
   Handle module_handle(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_instance(module_handle())) {
+  if (!java_lang_Module::is_instance(module_handle())) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-              "module is not an instance of type java.lang.reflect.Module");
+              "module is not an instance of type java.lang.Module");
   }
 
   char* module_name = get_module_name(module_handle(), CHECK);
@@ -303,7 +303,7 @@
 
   const char* module_version = get_module_version(version);
 
-  oop loader = java_lang_reflect_Module::loader(module_handle());
+  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)) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
@@ -325,7 +325,8 @@
     // Only modules defined to either the boot or platform class loader, can define a "java/" package.
     if (!h_loader.is_null() &&
         !SystemDictionary::is_platform_class_loader(h_loader) &&
-        strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0) {
+        (strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0 &&
+          (package_name[JAVAPKG_LEN] == '/' || package_name[JAVAPKG_LEN] == '\0'))) {
       const char* class_loader_name = SystemDictionary::loader_name(h_loader());
       size_t pkg_len = strlen(package_name);
       char* pkg_name = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, pkg_len);
@@ -423,8 +424,8 @@
           pkg_list->at(y)->decrement_refcount();
         }
 
-        // Store pointer to ModuleEntry record in java.lang.reflect.Module object.
-        java_lang_reflect_Module::set_module_entry(module_handle(), module_entry);
+        // Store pointer to ModuleEntry record in java.lang.Module object.
+        java_lang_Module::set_module_entry(module_handle(), module_entry);
       }
     }
   }  // Release the lock
@@ -466,20 +467,20 @@
     THROW_MSG(vmSymbols::java_lang_NullPointerException(), "Null module object");
   }
   Handle module_handle(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_instance(module_handle())) {
+  if (!java_lang_Module::is_instance(module_handle())) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-              "module is not an instance of type java.lang.reflect.Module");
+              "module is not an instance of type java.lang.Module");
   }
 
   // Ensure that this is an unnamed module
-  oop name = java_lang_reflect_Module::name(module_handle());
+  oop name = java_lang_Module::name(module_handle());
   if (name != NULL) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
-              "boot loader's unnamed module's java.lang.reflect.Module has a name");
+              "boot loader's unnamed module's java.lang.Module has a name");
   }
 
   // Validate java_base's loader is the boot loader.
-  oop loader = java_lang_reflect_Module::loader(module_handle());
+  oop loader = java_lang_Module::loader(module_handle());
   if (loader != NULL) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
               "Class loader must be the boot class loader");
@@ -491,12 +492,12 @@
   // Ensure the boot loader's PackageEntryTable has been created
   ModuleEntryTable* module_table = get_module_entry_table(h_loader, CHECK);
 
-  // Set java.lang.reflect.Module for the boot loader's unnamed module
+  // Set java.lang.Module for the boot loader's unnamed module
   ModuleEntry* unnamed_module = module_table->unnamed_module();
   assert(unnamed_module != NULL, "boot loader's unnamed ModuleEntry not defined");
   unnamed_module->set_module(ClassLoaderData::the_null_class_loader_data()->add_handle(module_handle));
-  // Store pointer to the ModuleEntry in the unnamed module's java.lang.reflect.Module object.
-  java_lang_reflect_Module::set_module_entry(module_handle(), unnamed_module);
+  // Store pointer to the ModuleEntry in the unnamed module's java.lang.Module object.
+  java_lang_Module::set_module_entry(module_handle(), unnamed_module);
 }
 
 void Modules::add_module_exports(jobject from_module, const char* package_name, jobject to_module, TRAPS) {
@@ -626,13 +627,13 @@
   oop module = java_lang_Class::module(mirror);
 
   assert(module != NULL, "java.lang.Class module field not set");
-  assert(java_lang_reflect_Module::is_instance(module), "module is not an instance of type java.lang.reflect.Module");
+  assert(java_lang_Module::is_instance(module), "module is not an instance of type java.lang.Module");
 
   if (log_is_enabled(Debug, modules)) {
     ResourceMark rm(THREAD);
     outputStream* logst = Log(modules)::debug_stream();
     Klass* klass = java_lang_Class::as_Klass(mirror);
-    oop module_name = java_lang_reflect_Module::name(module);
+    oop module_name = java_lang_Module::name(module);
     if (module_name != NULL) {
       logst->print("get_module(): module ");
       java_lang_String::print(module_name, tty);
@@ -748,7 +749,8 @@
   // Only modules defined to either the boot or platform class loader, can define a "java/" package.
   if (!loader_data->is_the_null_class_loader_data() &&
       !loader_data->is_platform_class_loader_data() &&
-      strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0) {
+      (strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0 &&
+        (package_name[JAVAPKG_LEN] == '/' || package_name[JAVAPKG_LEN] == '\0'))) {
     const char* class_loader_name = SystemDictionary::loader_name(loader_data);
     size_t pkg_len = strlen(package_name);
     char* pkg_name = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, pkg_len);
diff --git a/hotspot/src/share/vm/classfile/modules.hpp b/hotspot/src/share/vm/classfile/modules.hpp
index 4f5e089..4dc752c 100644
--- a/hotspot/src/share/vm/classfile/modules.hpp
+++ b/hotspot/src/share/vm/classfile/modules.hpp
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -55,12 +55,12 @@
                             jstring location, const char* const* packages,
                             jsize num_packages, TRAPS);
 
-  // Provides the java.lang.reflect.Module for the unnamed module defined
+  // Provides the java.lang.Module for the unnamed module defined
   // to the boot loader.
   //
   //  IllegalArgumentExceptions are thrown for the following :
   //  * Module has a name
-  //  * Module is not a subclass of java.lang.reflect.Module
+  //  * Module is not a subclass of java.lang.Module
   //  * Module's class loader is not the boot loader
   //  NullPointerExceptions are thrown if module is null.
   static void set_bootloader_unnamed_module(jobject module, TRAPS);
@@ -96,10 +96,10 @@
   // module does not exist.
   static void add_reads_module(jobject from_module, jobject to_module, TRAPS);
 
-  // Return the java.lang.reflect.Module object for this class object.
+  // Return the java.lang.Module object for this class object.
   static jobject get_module(jclass clazz, TRAPS);
 
-  // Return the java.lang.reflect.Module object for this class loader and package.
+  // Return the java.lang.Module object for this class loader and package.
   // Returns NULL if the class loader has not loaded any classes in the package.
   // The package should contain /'s, not .'s, as in java/lang, not java.lang.
   // NullPointerException is thrown if package is null.
@@ -109,7 +109,7 @@
   static jobject get_named_module(Handle h_loader, const char* package, TRAPS);
 
   // If package is defined by loader, return the
-  // java.lang.reflect.Module object for the module in which the package is defined.
+  // java.lang.Module object for the module in which the package is defined.
   // Returns NULL if package is invalid or not defined by loader.
   static jobject get_module(Symbol* package_name, Handle h_loader, TRAPS);
 
diff --git a/hotspot/src/share/vm/classfile/stringTable.cpp b/hotspot/src/share/vm/classfile/stringTable.cpp
index 24c72b7..05f6fd8 100644
--- a/hotspot/src/share/vm/classfile/stringTable.cpp
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,10 +96,14 @@
 
 // Pick hashing algorithm
 unsigned int StringTable::hash_string(const jchar* s, int len) {
-  return use_alternate_hashcode() ? AltHashing::murmur3_32(seed(), s, len) :
+  return use_alternate_hashcode() ? alt_hash_string(s, len) :
                                     java_lang_String::hash_code(s, len);
 }
 
+unsigned int StringTable::alt_hash_string(const jchar* s, int len) {
+  return AltHashing::murmur3_32(seed(), s, len);
+}
+
 unsigned int StringTable::hash_string(oop string) {
   EXCEPTION_MARK;
   if (string == NULL) {
@@ -117,11 +121,10 @@
   }
 }
 
-oop StringTable::lookup_shared(jchar* name, int len) {
-  // java_lang_String::hash_code() was used to compute hash values in the shared table. Don't
-  // use the hash value from StringTable::hash_string() as it might use alternate hashcode.
-  return _shared_table.lookup((const char*)name,
-                              java_lang_String::hash_code(name, len), len);
+oop StringTable::lookup_shared(jchar* name, int len, unsigned int hash) {
+  assert(hash == java_lang_String::hash_code(name, len),
+         "hash must be computed using java_lang_String::hash_code");
+  return _shared_table.lookup((const char*)name, hash, len);
 }
 
 oop StringTable::lookup_in_main_table(int index, jchar* name,
@@ -156,7 +159,7 @@
   unsigned int hashValue;
   int index;
   if (use_alternate_hashcode()) {
-    hashValue = hash_string(name, len);
+    hashValue = alt_hash_string(name, len);
     index = hash_to_index(hashValue);
   } else {
     hashValue = hashValue_arg;
@@ -199,12 +202,15 @@
 }
 
 oop StringTable::lookup(jchar* name, int len) {
-  oop string = lookup_shared(name, len);
+  // shared table always uses java_lang_String::hash_code
+  unsigned int hash = java_lang_String::hash_code(name, len);
+  oop string = lookup_shared(name, len, hash);
   if (string != NULL) {
     return string;
   }
-
-  unsigned int hash = hash_string(name, len);
+  if (use_alternate_hashcode()) {
+    hash = alt_hash_string(name, len);
+  }
   int index = the_table()->hash_to_index(hash);
   string = the_table()->lookup_in_main_table(index, name, len, hash);
 
@@ -215,12 +221,15 @@
 
 oop StringTable::intern(Handle string_or_null, jchar* name,
                         int len, TRAPS) {
-  oop found_string = lookup_shared(name, len);
+  // shared table always uses java_lang_String::hash_code
+  unsigned int hashValue = java_lang_String::hash_code(name, len);
+  oop found_string = lookup_shared(name, len, hashValue);
   if (found_string != NULL) {
     return found_string;
   }
-
-  unsigned int hashValue = hash_string(name, len);
+  if (use_alternate_hashcode()) {
+    hashValue = alt_hash_string(name, len);
+  }
   int index = the_table()->hash_to_index(hashValue);
   found_string = the_table()->lookup_in_main_table(index, name, len, hashValue);
 
diff --git a/hotspot/src/share/vm/classfile/stringTable.hpp b/hotspot/src/share/vm/classfile/stringTable.hpp
index 397cbbd..2c0afc8 100644
--- a/hotspot/src/share/vm/classfile/stringTable.hpp
+++ b/hotspot/src/share/vm/classfile/stringTable.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@
                 unsigned int hashValue, TRAPS);
 
   oop lookup_in_main_table(int index, jchar* chars, int length, unsigned int hashValue);
-  static oop lookup_shared(jchar* name, int len);
+  static oop lookup_shared(jchar* name, int len, unsigned int hash);
 
   // Apply the give oop closure to the entries to the buckets
   // in the range [start_idx, end_idx).
@@ -65,6 +65,13 @@
   // in the range [start_idx, end_idx).
   static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed);
 
+  // Hashing algorithm, used as the hash value used by the
+  //     StringTable for bucket selection and comparison (stored in the
+  //     HashtableEntry structures).  This is used in the String.intern() method.
+  static unsigned int hash_string(const jchar* s, int len);
+  static unsigned int hash_string(oop string);
+  static unsigned int alt_hash_string(const jchar* s, int len);
+
   StringTable() : RehashableHashtable<oop, mtSymbol>((int)StringTableSize,
                               sizeof (HashtableEntry<oop, mtSymbol>)) {}
 
@@ -109,12 +116,6 @@
   }
   static void possibly_parallel_oops_do(OopClosure* f);
 
-  // Hashing algorithm, used as the hash value used by the
-  //     StringTable for bucket selection and comparison (stored in the
-  //     HashtableEntry structures).  This is used in the String.intern() method.
-  static unsigned int hash_string(const jchar* s, int len);
-  static unsigned int hash_string(oop string);
-
   // Internal test.
   static void test_alt_hash() PRODUCT_RETURN;
 
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp
index e29fd13..fd41085 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp
@@ -1152,21 +1152,26 @@
   Symbol* h_name = k->name();
   assert(class_name == NULL || class_name == h_name, "name mismatch");
 
-  bool define_succeeded = false;
   // Add class just loaded
   // If a class loader supports parallel classloading handle parallel define requests
   // find_or_define_instance_class may return a different InstanceKlass
   if (is_parallelCapable(class_loader)) {
-    instanceKlassHandle defined_k = find_or_define_instance_class(h_name, class_loader, k, CHECK_NULL);
-    if (k() == defined_k()) {
-      // we have won over other concurrent threads (if any) that are
-      // competing to define the same class.
-      define_succeeded = true;
+    instanceKlassHandle defined_k = find_or_define_instance_class(h_name, class_loader, k, THREAD);
+    if (!HAS_PENDING_EXCEPTION && defined_k() != k()) {
+      // If a parallel capable class loader already defined this class, register 'k' for cleanup.
+      assert(defined_k.not_null(), "Should have a klass if there's no exception");
+      loader_data->add_to_deallocate_list(k());
+      k = defined_k;
     }
-    k = defined_k;
   } else {
-    define_instance_class(k, CHECK_NULL);
-    define_succeeded = true;
+    define_instance_class(k, THREAD);
+  }
+
+  // If defining the class throws an exception register 'k' for cleanup.
+  if (HAS_PENDING_EXCEPTION) {
+    assert(k.not_null(), "Must have an instance klass here!");
+    loader_data->add_to_deallocate_list(k());
+    return NULL;
   }
 
   // Make sure we have an entry in the SystemDictionary on success
@@ -1518,8 +1523,16 @@
     // find_or_define_instance_class may return a different InstanceKlass
     if (!k.is_null()) {
       instanceKlassHandle defined_k =
-        find_or_define_instance_class(class_name, class_loader, k, CHECK_(nh));
-      k = defined_k;
+        find_or_define_instance_class(class_name, class_loader, k, THREAD);
+      if (!HAS_PENDING_EXCEPTION && defined_k() != k()) {
+        // If a parallel capable class loader already defined this class, register 'k' for cleanup.
+        assert(defined_k.not_null(), "Should have a klass if there's no exception");
+        loader_data->add_to_deallocate_list(k());
+        k = defined_k;
+      } else if (HAS_PENDING_EXCEPTION) {
+        loader_data->add_to_deallocate_list(k());
+        return nh;
+      }
     }
     return k;
   } else {
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp
index 4cd5e40..f6ad7a4 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -133,9 +133,9 @@
   do_klass(Thread_klass,                                java_lang_Thread,                          Pre                 ) \
   do_klass(ThreadGroup_klass,                           java_lang_ThreadGroup,                     Pre                 ) \
   do_klass(Properties_klass,                            java_util_Properties,                      Pre                 ) \
+  do_klass(Module_klass,                                java_lang_Module,                          Pre                 ) \
   do_klass(reflect_AccessibleObject_klass,              java_lang_reflect_AccessibleObject,        Pre                 ) \
   do_klass(reflect_Field_klass,                         java_lang_reflect_Field,                   Pre                 ) \
-  do_klass(reflect_Module_klass,                        java_lang_reflect_Module,                  Pre                 ) \
   do_klass(reflect_Parameter_klass,                     java_lang_reflect_Parameter,               Opt                 ) \
   do_klass(reflect_Method_klass,                        java_lang_reflect_Method,                  Pre                 ) \
   do_klass(reflect_Constructor_klass,                   java_lang_reflect_Constructor,             Pre                 ) \
diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp
index 0ef8644..633bb8f 100644
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,7 @@
   template(java_lang_Object,                          "java/lang/Object")                         \
   template(java_lang_Class,                           "java/lang/Class")                          \
   template(java_lang_Package,                         "java/lang/Package")                        \
+  template(java_lang_Module,                          "java/lang/Module")                         \
   template(java_lang_String,                          "java/lang/String")                         \
   template(java_lang_StringLatin1,                    "java/lang/StringLatin1")                   \
   template(java_lang_StringUTF16,                     "java/lang/StringUTF16")                    \
@@ -90,7 +91,6 @@
   template(java_lang_reflect_Method,                  "java/lang/reflect/Method")                 \
   template(java_lang_reflect_Constructor,             "java/lang/reflect/Constructor")            \
   template(java_lang_reflect_Field,                   "java/lang/reflect/Field")                  \
-  template(java_lang_reflect_Module,                  "java/lang/reflect/Module")                 \
   template(java_lang_reflect_Parameter,               "java/lang/reflect/Parameter")              \
   template(java_lang_reflect_Array,                   "java/lang/reflect/Array")                  \
   template(java_lang_StringBuffer,                    "java/lang/StringBuffer")                   \
@@ -136,7 +136,7 @@
   template(initPhase1_name,                           "initPhase1")                               \
   template(initPhase2_name,                           "initPhase2")                               \
   template(initPhase3_name,                           "initPhase3")                               \
-  template(java_lang_reflect_module_init_signature,   "(Ljava/lang/ClassLoader;Ljava/lang/String;)V") \
+  template(java_lang_module_init_signature,           "(Ljava/lang/ClassLoader;Ljava/lang/String;)V") \
                                                                                                   \
   /* class file format tags */                                                                    \
   template(tag_source_file,                           "SourceFile")                               \
@@ -325,14 +325,8 @@
   template(java_lang_StackStreamFactory_AbstractStackWalker, "java/lang/StackStreamFactory$AbstractStackWalker") \
   template(doStackWalk_signature,                     "(JIIII)Ljava/lang/Object;")                \
   template(asPrimitive_name,                          "asPrimitive")                              \
-  template(asPrimitive_int_signature,                 "(I)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
-  template(asPrimitive_long_signature,                "(J)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
-  template(asPrimitive_short_signature,               "(S)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
-  template(asPrimitive_byte_signature,                "(B)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
-  template(asPrimitive_char_signature,                "(C)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
-  template(asPrimitive_float_signature,               "(F)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
-  template(asPrimitive_double_signature,              "(D)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
-  template(asPrimitive_boolean_signature,             "(Z)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
+  template(asPrimitive_int_signature,                 "(I)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \
+  template(asPrimitive_long_signature,                "(J)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \
                                                                                                   \
   /* common method and field names */                                                             \
   template(object_initializer_name,                   "<init>")                                   \
@@ -444,6 +438,7 @@
   template(monitors_name,                             "monitors")                                 \
   template(locals_name,                               "locals")                                   \
   template(operands_name,                             "operands")                                 \
+  template(mode_name,                                 "mode")                                     \
   template(oop_size_name,                             "oop_size")                                 \
   template(static_oop_field_count_name,               "static_oop_field_count")                   \
   template(protection_domain_name,                    "protection_domain")                        \
@@ -455,7 +450,7 @@
   template(getModule_name,                            "getModule")                                \
   template(input_stream_void_signature,               "(Ljava/io/InputStream;)V")                 \
   template(definePackage_name,                        "definePackage")                            \
-  template(definePackage_signature,                   "(Ljava/lang/String;Ljava/lang/reflect/Module;)Ljava/lang/Package;") \
+  template(definePackage_signature,                   "(Ljava/lang/String;Ljava/lang/Module;)Ljava/lang/Package;") \
   template(defineOrCheckPackage_name,                 "defineOrCheckPackage")                     \
   template(defineOrCheckPackage_signature,            "(Ljava/lang/String;Ljava/util/jar/Manifest;Ljava/net/URL;)Ljava/lang/Package;") \
   template(fileToEncodedURL_name,                     "fileToEncodedURL")                         \
@@ -537,7 +532,7 @@
   template(void_class_signature,                      "()Ljava/lang/Class;")                                      \
   template(void_class_array_signature,                "()[Ljava/lang/Class;")                                     \
   template(void_string_signature,                     "()Ljava/lang/String;")                                     \
-  template(void_module_signature,                     "()Ljava/lang/reflect/Module;")                             \
+  template(void_module_signature,                     "()Ljava/lang/Module;")                                     \
   template(object_array_object_signature,             "([Ljava/lang/Object;)Ljava/lang/Object;")                  \
   template(object_object_array_object_signature,      "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;")\
   template(exception_void_signature,                  "(Ljava/lang/Exception;)V")                                 \
@@ -557,7 +552,7 @@
   template(reference_signature,                       "Ljava/lang/ref/Reference;")                                \
   template(sun_misc_Cleaner_signature,                "Lsun/misc/Cleaner;")                                       \
   template(executable_signature,                      "Ljava/lang/reflect/Executable;")                           \
-  template(module_signature,                          "Ljava/lang/reflect/Module;")                               \
+  template(module_signature,                          "Ljava/lang/Module;")                                       \
   template(concurrenthashmap_signature,               "Ljava/util/concurrent/ConcurrentHashMap;")                 \
   template(String_StringBuilder_signature,            "(Ljava/lang/String;)Ljava/lang/StringBuilder;")            \
   template(int_StringBuilder_signature,               "(I)Ljava/lang/StringBuilder;")                             \
@@ -566,6 +561,7 @@
   template(int_StringBuffer_signature,                "(I)Ljava/lang/StringBuffer;")                              \
   template(char_StringBuffer_signature,               "(C)Ljava/lang/StringBuffer;")                              \
   template(int_String_signature,                      "(I)Ljava/lang/String;")                                    \
+  template(boolean_boolean_int_signature,             "(ZZ)I")                                                    \
   template(codesource_permissioncollection_signature, "(Ljava/security/CodeSource;Ljava/security/PermissionCollection;)V") \
   /* signature symbols needed by intrinsics */                                                                    \
   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, template, VM_ALIAS_IGNORE)            \
@@ -646,16 +642,16 @@
   template(jdk_internal_module_Modules,                "jdk/internal/module/Modules")                             \
   template(jdk_internal_vm_VMSupport,                  "jdk/internal/vm/VMSupport")                               \
   template(addReads_name,                              "addReads")                                                \
-  template(addReads_signature,                         "(Ljava/lang/reflect/Module;Ljava/lang/reflect/Module;)V") \
+  template(addReads_signature,                         "(Ljava/lang/Module;Ljava/lang/Module;)V")                 \
   template(addExports_name,                            "addExports")                                              \
   template(addOpens_name,                              "addOpens")                                                \
-  template(addExports_signature,                       "(Ljava/lang/reflect/Module;Ljava/lang/String;Ljava/lang/reflect/Module;)V") \
+  template(addExports_signature,                       "(Ljava/lang/Module;Ljava/lang/String;Ljava/lang/Module;)V") \
   template(addUses_name,                               "addUses")                                                 \
-  template(addUses_signature,                          "(Ljava/lang/reflect/Module;Ljava/lang/Class;)V")          \
+  template(addUses_signature,                          "(Ljava/lang/Module;Ljava/lang/Class;)V")                  \
   template(addProvides_name,                           "addProvides")                                             \
-  template(addProvides_signature,                      "(Ljava/lang/reflect/Module;Ljava/lang/Class;Ljava/lang/Class;)V") \
+  template(addProvides_signature,                      "(Ljava/lang/Module;Ljava/lang/Class;Ljava/lang/Class;)V") \
   template(transformedByAgent_name,                    "transformedByAgent")                                      \
-  template(transformedByAgent_signature,               "(Ljava/lang/reflect/Module;)V")                           \
+  template(transformedByAgent_signature,               "(Ljava/lang/Module;)V")                                   \
   template(appendToClassPathForInstrumentation_name,   "appendToClassPathForInstrumentation")                     \
   do_alias(appendToClassPathForInstrumentation_signature, string_void_signature)                                  \
   template(serializePropertiesToByteArray_name,        "serializePropertiesToByteArray")                          \
diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp
index bfe643a..549535b 100644
--- a/hotspot/src/share/vm/code/codeCache.cpp
+++ b/hotspot/src/share/vm/code/codeCache.cpp
@@ -417,7 +417,7 @@
 CodeHeap* CodeCache::get_code_heap(const CodeBlob* cb) {
   assert(cb != NULL, "CodeBlob is null");
   FOR_ALL_HEAPS(heap) {
-    if ((*heap)->contains(cb->code_begin())) {
+    if ((*heap)->contains_blob(cb)) {
       return *heap;
     }
   }
@@ -1211,7 +1211,7 @@
   CompiledMethodIterator iter;
   while(iter.next_alive()) {
     CompiledMethod* nm = iter.method();
-    if (nm->is_marked_for_deoptimization()) {
+    if (nm->is_marked_for_deoptimization() && !nm->is_not_entrant()) {
       nm->make_not_entrant();
     }
   }
diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp
index 99209dc..469ac0a 100644
--- a/hotspot/src/share/vm/code/codeCache.hpp
+++ b/hotspot/src/share/vm/code/codeCache.hpp
@@ -304,11 +304,10 @@
     // If set to NULL, initialized by first call to next()
     _code_blob = (CodeBlob*)nm;
     if (nm != NULL) {
-      address start = nm->code_begin();
-      while(!(*_heap)->contains(start)) {
+      while(!(*_heap)->contains_blob(_code_blob)) {
         ++_heap;
       }
-      assert((*_heap)->contains(start), "match not found");
+      assert((*_heap)->contains_blob(_code_blob), "match not found");
     }
   }
 
diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp
index 7142004..f82872b 100644
--- a/hotspot/src/share/vm/code/nmethod.cpp
+++ b/hotspot/src/share/vm/code/nmethod.cpp
@@ -1146,6 +1146,14 @@
   assert(state == zombie || state == not_entrant, "must be zombie or not_entrant");
   assert(!is_zombie(), "should not already be a zombie");
 
+  if (_state == state) {
+    // Avoid taking the lock if already in required state.
+    // This is safe from races because the state is an end-state,
+    // which the nmethod cannot back out of once entered.
+    // No need for fencing either.
+    return false;
+  }
+
   // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below.
   nmethodLocker nml(this);
   methodHandle the_method(method());
diff --git a/hotspot/src/share/vm/compiler/compilerDefinitions.cpp b/hotspot/src/share/vm/compiler/compilerDefinitions.cpp
index 00c2e64..bcec3ff 100644
--- a/hotspot/src/share/vm/compiler/compilerDefinitions.cpp
+++ b/hotspot/src/share/vm/compiler/compilerDefinitions.cpp
@@ -100,7 +100,9 @@
     FLAG_SET_ERGO(size_t, MetaspaceSize, 12*M);
   }
   if (FLAG_IS_DEFAULT(MaxRAM)) {
-    FLAG_SET_ERGO(uint64_t, MaxRAM, 1ULL*G);
+    // Do not use FLAG_SET_ERGO to update MaxRAM, as this will impact
+    // heap setting done based on available phys_mem (see Arguments::set_heap_size).
+    FLAG_SET_DEFAULT(MaxRAM, 1ULL*G);
   }
   if (FLAG_IS_DEFAULT(CompileThreshold)) {
     FLAG_SET_ERGO(intx, CompileThreshold, 1500);
diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp
index 7967d6c..6015b16 100644
--- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp
+++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -711,29 +711,6 @@
   guarantee(G1RSetSparseRegionEntries > 0 && G1RSetRegionEntries > 0 , "Sanity");
 }
 
-#ifndef PRODUCT
-void HeapRegionRemSet::print() {
-  HeapRegionRemSetIterator iter(this);
-  size_t card_index;
-  while (iter.has_next(card_index)) {
-    HeapWord* card_start = _bot->address_for_index(card_index);
-    tty->print_cr("  Card " PTR_FORMAT, p2i(card_start));
-  }
-  if (iter.n_yielded() != occupied()) {
-    tty->print_cr("Yielded disagrees with occupied:");
-    tty->print_cr("  " SIZE_FORMAT_W(6) " yielded (" SIZE_FORMAT_W(6)
-                  " coarse, " SIZE_FORMAT_W(6) " fine).",
-                  iter.n_yielded(),
-                  iter.n_yielded_coarse(), iter.n_yielded_fine());
-    tty->print_cr("  " SIZE_FORMAT_W(6) " occ     (" SIZE_FORMAT_W(6)
-                           " coarse, " SIZE_FORMAT_W(6) " fine).",
-                  occupied(), occ_coarse(), occ_fine());
-  }
-  guarantee(iter.n_yielded() == occupied(),
-            "We should have yielded all the represented cards.");
-}
-#endif
-
 void HeapRegionRemSet::cleanup() {
   SparsePRT::cleanup_all();
 }
@@ -917,10 +894,6 @@
     // Otherwise...
     break;
   }
-  assert(ParallelGCThreads > 1 ||
-         n_yielded() == _hrrs->occupied(),
-         "Should have yielded all the cards in the rem set "
-         "(in the non-par case).");
   return false;
 }
 
diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp
index 7f740b6..97c7e06 100644
--- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp
+++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -290,8 +290,6 @@
   // consumed by the strong code roots.
   size_t strong_code_roots_mem_size();
 
-  void print() PRODUCT_RETURN;
-
   // Called during a stop-world phase to perform any deferred cleanups.
   static void cleanup();
 
diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp
index 48eb3c4..e300f8c 100644
--- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp
+++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,8 +54,26 @@
   }
 }
 
+void GCTaskThread::add_task_timestamp(const char* name, jlong t_entry, jlong t_exit) {
+  if (_time_stamp_index < GCTaskTimeStampEntries) {
+    GCTaskTimeStamp* time_stamp = time_stamp_at(_time_stamp_index);
+    time_stamp->set_name(name);
+    time_stamp->set_entry_time(t_entry);
+    time_stamp->set_exit_time(t_exit);
+  } else {
+    if (_time_stamp_index ==  GCTaskTimeStampEntries) {
+      log_warning(gc, task, time)("GC-thread %u: Too many timestamps, ignoring future ones. "
+                                  "Increase GCTaskTimeStampEntries to get more info.",
+                                  id());
+    }
+    // Let _time_stamp_index keep counting to give the user an idea about how many
+    // are needed.
+  }
+  _time_stamp_index++;
+}
+
 GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) {
-  guarantee(index < GCTaskTimeStampEntries, "increase GCTaskTimeStampEntries");
+  assert(index < GCTaskTimeStampEntries, "Precondition");
   if (_time_stamps == NULL) {
     // We allocate the _time_stamps array lazily since logging can be enabled dynamically
     GCTaskTimeStamp* time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC);
@@ -65,7 +83,6 @@
       FREE_C_HEAP_ARRAY(GCTaskTimeStamp, time_stamps);
     }
   }
-
   return &(_time_stamps[index]);
 }
 
@@ -75,8 +92,11 @@
   // Since _time_stamps is now lazily allocated we need to check that it
   // has in fact been allocated when calling this function.
   if (_time_stamps != NULL) {
-    log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index);
-    for(uint i=0; i<_time_stamp_index; i++) {
+    log_debug(gc, task, time)("GC-Thread %u entries: %d%s", id(),
+                              _time_stamp_index,
+                              _time_stamp_index >= GCTaskTimeStampEntries ? " (overflow)" : "");
+    const uint max_index = MIN2(_time_stamp_index, GCTaskTimeStampEntries);
+    for (uint i = 0; i < max_index; i++) {
       GCTaskTimeStamp* time_stamp = time_stamp_at(i);
       log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]",
                                 time_stamp->name(),
@@ -144,16 +164,7 @@
 
         if (log_is_enabled(Debug, gc, task, time)) {
           timer.update();
-
-          GCTaskTimeStamp* time_stamp = time_stamp_at(_time_stamp_index);
-
-          time_stamp->set_name(name);
-          time_stamp->set_entry_time(entry_time);
-          time_stamp->set_exit_time(timer.ticks());
-
-          // Update the index after we have set up the entry correctly since
-          // GCTaskThread::print_task_time_stamps() may read this value concurrently.
-          _time_stamp_index++;
+          add_task_timestamp(name, entry_time, timer.ticks());
         }
       } else {
         // idle tasks complete outside the normal accounting
diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskThread.hpp b/hotspot/src/share/vm/gc/parallel/gcTaskThread.hpp
index 59e6286..d4fbe4b 100644
--- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.hpp
+++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
   uint _time_stamp_index;
 
   GCTaskTimeStamp* time_stamp_at(uint index);
+  void add_task_timestamp(const char* name, jlong t_entry, jlong t_exit);
 
   bool _is_working;                     // True if participating in GC tasks
 
@@ -92,16 +93,16 @@
  private:
   jlong  _entry_time;
   jlong  _exit_time;
-  char*  _name;
+  const char*  _name;
 
  public:
   jlong entry_time()              { return _entry_time; }
   jlong exit_time()               { return _exit_time; }
-  const char* name() const        { return (const char*)_name; }
+  const char* name() const        { return _name; }
 
   void set_entry_time(jlong time) { _entry_time = time; }
   void set_exit_time(jlong time)  { _exit_time = time; }
-  void set_name(char* name)       { _name = name; }
+  void set_name(const char* name) { _name = name; }
 };
 
 #endif // SHARE_VM_GC_PARALLEL_GCTASKTHREAD_HPP
diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
index 2fe6b45..6f02a6c 100644
--- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
+++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
@@ -53,8 +53,34 @@
 #include "runtime/vframe.hpp"
 #include "runtime/vframe_hp.hpp"
 #include "runtime/vmStructs.hpp"
+#include "utilities/resourceHash.hpp"
 
 
+void JNIHandleMark::push_jni_handle_block() {
+  JavaThread* thread = JavaThread::current();
+  if (thread != NULL) {
+    // Allocate a new block for JNI handles.
+    // Inlined code from jni_PushLocalFrame()
+    JNIHandleBlock* java_handles = ((JavaThread*)thread)->active_handles();
+    JNIHandleBlock* compile_handles = JNIHandleBlock::allocate_block(thread);
+    assert(compile_handles != NULL && java_handles != NULL, "should not be NULL");
+    compile_handles->set_pop_frame_link(java_handles);
+    thread->set_active_handles(compile_handles);
+  }
+}
+
+void JNIHandleMark::pop_jni_handle_block() {
+  JavaThread* thread = JavaThread::current();
+  if (thread != NULL) {
+    // Release our JNI handle block
+    JNIHandleBlock* compile_handles = thread->active_handles();
+    JNIHandleBlock* java_handles = compile_handles->pop_frame_link();
+    thread->set_active_handles(java_handles);
+    compile_handles->set_pop_frame_link(NULL);
+    JNIHandleBlock::release_block(compile_handles, thread); // may block
+  }
+}
+
 // Entry to native method implementation that transitions current thread to '_thread_in_vm'.
 #define C2V_VMENTRY(result_type, name, signature) \
   JNIEXPORT result_type JNICALL c2v_ ## name signature { \
@@ -88,6 +114,7 @@
   return NULL;
 }
 
+
 int CompilerToVM::Data::Klass_vtable_start_offset;
 int CompilerToVM::Data::Klass_vtable_length_offset;
 
@@ -120,6 +147,15 @@
 
 int CompilerToVM::Data::vm_page_size;
 
+int CompilerToVM::Data::sizeof_vtableEntry = sizeof(vtableEntry);
+int CompilerToVM::Data::sizeof_ExceptionTableElement = sizeof(ExceptionTableElement);
+int CompilerToVM::Data::sizeof_LocalVariableTableElement = sizeof(LocalVariableTableElement);
+int CompilerToVM::Data::sizeof_ConstantPool = sizeof(ConstantPool);
+int CompilerToVM::Data::sizeof_SymbolPointer = sizeof(Symbol*);
+int CompilerToVM::Data::sizeof_narrowKlass = sizeof(narrowKlass);
+int CompilerToVM::Data::sizeof_arrayOopDesc = sizeof(arrayOopDesc);
+int CompilerToVM::Data::sizeof_BasicLock = sizeof(BasicLock);
+
 address CompilerToVM::Data::dsin;
 address CompilerToVM::Data::dcos;
 address CompilerToVM::Data::dtan;
@@ -128,7 +164,10 @@
 address CompilerToVM::Data::dlog10;
 address CompilerToVM::Data::dpow;
 
-void CompilerToVM::Data::initialize() {
+address CompilerToVM::Data::symbol_init;
+address CompilerToVM::Data::symbol_clinit;
+
+void CompilerToVM::Data::initialize(TRAPS) {
   Klass_vtable_start_offset = in_bytes(Klass::vtable_start_offset());
   Klass_vtable_length_offset = in_bytes(Klass::vtable_length_offset());
 
@@ -160,6 +199,9 @@
   assert(OopMapValue::legal_vm_reg_name(VMRegImpl::stack2reg(max_oop_map_stack_index)), "should be valid");
   assert(!OopMapValue::legal_vm_reg_name(VMRegImpl::stack2reg(max_oop_map_stack_index + 1)), "should be invalid");
 
+  symbol_init = (address) vmSymbols::object_initializer_name();
+  symbol_clinit = (address) vmSymbols::class_initializer_name();
+
   BarrierSet* bs = Universe::heap()->barrier_set();
   switch (bs->kind()) {
   case BarrierSet::CardTableModRef:
@@ -179,7 +221,7 @@
     // No post barriers
     break;
   default:
-    ShouldNotReachHere();
+    JVMCI_ERROR("Unsupported BarrierSet kind %d", bs->kind());
     break;
   }
 
@@ -237,13 +279,114 @@
   return vmIntrinsics;
 }
 
-C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
-#define BOXED_LONG(name, value) oop name; do { jvalue p; p.j = (jlong) (value); name = java_lang_boxing_object::create(T_LONG, &p, CHECK_NULL);} while(0)
+/**
+ * The set of VM flags known to be used.
+ */
+#define PREDEFINED_CONFIG_FLAGS(do_bool_flag, do_intx_flag, do_uintx_flag) \
+  do_intx_flag(AllocateInstancePrefetchLines)                              \
+  do_intx_flag(AllocatePrefetchDistance)                                   \
+  do_intx_flag(AllocatePrefetchInstr)                                      \
+  do_intx_flag(AllocatePrefetchLines)                                      \
+  do_intx_flag(AllocatePrefetchStepSize)                                   \
+  do_intx_flag(AllocatePrefetchStyle)                                      \
+  do_intx_flag(BciProfileWidth)                                            \
+  do_bool_flag(BootstrapJVMCI)                                             \
+  do_bool_flag(CITime)                                                     \
+  do_bool_flag(CITimeEach)                                                 \
+  do_uintx_flag(CodeCacheSegmentSize)                                      \
+  do_intx_flag(CodeEntryAlignment)                                         \
+  do_bool_flag(CompactFields)                                              \
+  NOT_PRODUCT(do_intx_flag(CompileTheWorldStartAt))                        \
+  NOT_PRODUCT(do_intx_flag(CompileTheWorldStopAt))                         \
+  do_intx_flag(ContendedPaddingWidth)                                      \
+  do_bool_flag(DontCompileHugeMethods)                                     \
+  do_bool_flag(EnableContended)                                            \
+  do_intx_flag(FieldsAllocationStyle)                                      \
+  do_bool_flag(FoldStableValues)                                           \
+  do_bool_flag(ForceUnreachable)                                           \
+  do_intx_flag(HugeMethodLimit)                                            \
+  do_bool_flag(Inline)                                                     \
+  do_intx_flag(JVMCICounterSize)                                           \
+  do_bool_flag(JVMCIPrintProperties)                                       \
+  do_bool_flag(JVMCIUseFastLocking)                                        \
+  do_intx_flag(MethodProfileWidth)                                         \
+  do_intx_flag(ObjectAlignmentInBytes)                                     \
+  do_bool_flag(PrintInlining)                                              \
+  do_bool_flag(ReduceInitialCardMarks)                                     \
+  do_bool_flag(RestrictContended)                                          \
+  do_intx_flag(StackReservedPages)                                         \
+  do_intx_flag(StackShadowPages)                                           \
+  do_bool_flag(TLABStats)                                                  \
+  do_uintx_flag(TLABWasteIncrement)                                        \
+  do_intx_flag(TypeProfileWidth)                                           \
+  do_bool_flag(UseAESIntrinsics)                                           \
+  X86_ONLY(do_intx_flag(UseAVX))                                           \
+  do_bool_flag(UseBiasedLocking)                                           \
+  do_bool_flag(UseCRC32Intrinsics)                                         \
+  do_bool_flag(UseCompressedClassPointers)                                 \
+  do_bool_flag(UseCompressedOops)                                          \
+  do_bool_flag(UseConcMarkSweepGC)                                         \
+  X86_ONLY(do_bool_flag(UseCountLeadingZerosInstruction))                  \
+  X86_ONLY(do_bool_flag(UseCountTrailingZerosInstruction))                 \
+  do_bool_flag(UseG1GC)                                                    \
+  COMPILER2_PRESENT(do_bool_flag(UseMontgomeryMultiplyIntrinsic))          \
+  COMPILER2_PRESENT(do_bool_flag(UseMontgomerySquareIntrinsic))            \
+  COMPILER2_PRESENT(do_bool_flag(UseMulAddIntrinsic))                      \
+  COMPILER2_PRESENT(do_bool_flag(UseMultiplyToLenIntrinsic))               \
+  do_bool_flag(UsePopCountInstruction)                                     \
+  do_bool_flag(UseSHA1Intrinsics)                                          \
+  do_bool_flag(UseSHA256Intrinsics)                                        \
+  do_bool_flag(UseSHA512Intrinsics)                                        \
+  do_intx_flag(UseSSE)                                                     \
+  COMPILER2_PRESENT(do_bool_flag(UseSquareToLenIntrinsic))                 \
+  do_bool_flag(UseStackBanging)                                            \
+  do_bool_flag(UseTLAB)                                                    \
+  do_bool_flag(VerifyOops)                                                 \
+
+#define BOXED_BOOLEAN(name, value) oop name = ((jboolean)(value) ? boxedTrue() : boxedFalse())
 #define BOXED_DOUBLE(name, value) oop name; do { jvalue p; p.d = (jdouble) (value); name = java_lang_boxing_object::create(T_DOUBLE, &p, CHECK_NULL);} while(0)
+#define BOXED_LONG(name, value) \
+  oop name; \
+  do { \
+    jvalue p; p.j = (jlong) (value); \
+    Handle* e = longs.get(p.j); \
+    if (e == NULL) { \
+      Handle h = java_lang_boxing_object::create(T_LONG, &p, CHECK_NULL); \
+      longs.put(p.j, h); \
+      name = h(); \
+    } else { \
+      name = (*e)(); \
+    } \
+  } while (0)
+
+#define CSTRING_TO_JSTRING(name, value) \
+  Handle name; \
+  do { \
+    if (value != NULL) { \
+      Handle* e = strings.get(value); \
+      if (e == NULL) { \
+        Handle h = java_lang_String::create_from_str(value, CHECK_NULL); \
+        strings.put(value, h); \
+        name = h(); \
+      } else { \
+        name = (*e)(); \
+      } \
+    } \
+  } while (0)
+
+C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
   ResourceMark rm;
   HandleMark hm;
 
-  CompilerToVM::Data::initialize();
+  // Used to canonicalize Long and String values.
+  ResourceHashtable<jlong, Handle> longs;
+  ResourceHashtable<const char*, Handle, &CompilerToVM::cstring_hash, &CompilerToVM::cstring_equals> strings;
+
+  jvalue prim;
+  prim.z = true;  Handle boxedTrue =  java_lang_boxing_object::create(T_BOOLEAN, &prim, CHECK_NULL);
+  prim.z = false; Handle boxedFalse = java_lang_boxing_object::create(T_BOOLEAN, &prim, CHECK_NULL);
+
+  CompilerToVM::Data::initialize(CHECK_NULL);
 
   VMField::klass()->initialize(CHECK_NULL);
   VMFlag::klass()->initialize(CHECK_NULL);
@@ -257,31 +400,31 @@
     size_t name_buf_len = strlen(vmField.typeName) + strlen(vmField.fieldName) + 2 /* "::" */;
     char* name_buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, name_buf_len + 1);
     sprintf(name_buf, "%s::%s", vmField.typeName, vmField.fieldName);
-    Handle name = java_lang_String::create_from_str(name_buf, CHECK_NULL);
-    Handle type = java_lang_String::create_from_str(vmField.typeString, CHECK_NULL);
+    CSTRING_TO_JSTRING(name, name_buf);
+    CSTRING_TO_JSTRING(type, vmField.typeString);
     VMField::set_name(vmFieldObj, name());
     VMField::set_type(vmFieldObj, type());
     VMField::set_offset(vmFieldObj, vmField.offset);
     VMField::set_address(vmFieldObj, (jlong) vmField.address);
-    if (vmField.isStatic) {
+    if (vmField.isStatic && vmField.typeString != NULL) {
       if (strcmp(vmField.typeString, "bool") == 0) {
-        BOXED_LONG(value, *(jbyte*) vmField.address);
-        VMField::set_value(vmFieldObj, value);
+        BOXED_BOOLEAN(box, *(jbyte*) vmField.address);
+        VMField::set_value(vmFieldObj, box);
       } else if (strcmp(vmField.typeString, "int") == 0 ||
                  strcmp(vmField.typeString, "jint") == 0) {
-        BOXED_LONG(value, *(jint*) vmField.address);
-        VMField::set_value(vmFieldObj, value);
+        BOXED_LONG(box, *(jint*) vmField.address);
+        VMField::set_value(vmFieldObj, box);
       } else if (strcmp(vmField.typeString, "uint64_t") == 0) {
-        BOXED_LONG(value, *(uint64_t*) vmField.address);
-        VMField::set_value(vmFieldObj, value);
+        BOXED_LONG(box, *(uint64_t*) vmField.address);
+        VMField::set_value(vmFieldObj, box);
       } else if (strcmp(vmField.typeString, "address") == 0 ||
                  strcmp(vmField.typeString, "intptr_t") == 0 ||
                  strcmp(vmField.typeString, "uintptr_t") == 0 ||
                  strcmp(vmField.typeString, "size_t") == 0 ||
                  // All foo* types are addresses.
                  vmField.typeString[strlen(vmField.typeString) - 1] == '*') {
-        BOXED_LONG(value, *((address*) vmField.address));
-        VMField::set_value(vmFieldObj, value);
+        BOXED_LONG(box, *((address*) vmField.address));
+        VMField::set_value(vmFieldObj, box);
       } else {
         JVMCI_ERROR_NULL("VM field %s has unsupported type %s", name_buf, vmField.typeString);
       }
@@ -289,16 +432,6 @@
     vmFields->obj_at_put(i, vmFieldObj());
   }
 
-  len = JVMCIVMStructs::localHotSpotVMTypes_count();
-  objArrayHandle vmTypes = oopFactory::new_objArray(SystemDictionary::Object_klass(), len * 2, CHECK_NULL);
-  for (int i = 0; i < len ; i++) {
-    VMTypeEntry vmType = JVMCIVMStructs::localHotSpotVMTypes[i];
-    Handle name = java_lang_String::create_from_str(vmType.typeName, CHECK_NULL);
-    BOXED_LONG(size, vmType.size);
-    vmTypes->obj_at_put(i * 2, name());
-    vmTypes->obj_at_put(i * 2 + 1, size);
-  }
-
   int ints_len = JVMCIVMStructs::localHotSpotVMIntConstants_count();
   int longs_len = JVMCIVMStructs::localHotSpotVMLongConstants_count();
   len = ints_len + longs_len;
@@ -306,14 +439,14 @@
   int insert = 0;
   for (int i = 0; i < ints_len ; i++) {
     VMIntConstantEntry c = JVMCIVMStructs::localHotSpotVMIntConstants[i];
-    Handle name = java_lang_String::create_from_str(c.name, CHECK_NULL);
+    CSTRING_TO_JSTRING(name, c.name);
     BOXED_LONG(value, c.value);
     vmConstants->obj_at_put(insert++, name());
     vmConstants->obj_at_put(insert++, value);
   }
   for (int i = 0; i < longs_len ; i++) {
     VMLongConstantEntry c = JVMCIVMStructs::localHotSpotVMLongConstants[i];
-    Handle name = java_lang_String::create_from_str(c.name, CHECK_NULL);
+    CSTRING_TO_JSTRING(name, c.name);
     BOXED_LONG(value, c.value);
     vmConstants->obj_at_put(insert++, name());
     vmConstants->obj_at_put(insert++, value);
@@ -324,69 +457,104 @@
   objArrayHandle vmAddresses = oopFactory::new_objArray(SystemDictionary::Object_klass(), len * 2, CHECK_NULL);
   for (int i = 0; i < len ; i++) {
     VMAddressEntry a = JVMCIVMStructs::localHotSpotVMAddresses[i];
-    Handle name = java_lang_String::create_from_str(a.name, CHECK_NULL);
+    CSTRING_TO_JSTRING(name, a.name);
     BOXED_LONG(value, a.value);
     vmAddresses->obj_at_put(i * 2, name());
     vmAddresses->obj_at_put(i * 2 + 1, value);
   }
 
-  // The last entry is the null entry.
-  len = (int) Flag::numFlags - 1;
+#define COUNT_FLAG(ignore) +1
+#ifdef ASSERT
+#define CHECK_FLAG(type, name) { \
+  Flag* flag = Flag::find_flag(#name, strlen(#name), /*allow_locked*/ true, /* return_flag */ true); \
+  assert(flag != NULL, "No such flag named " #name); \
+  assert(flag->is_##type(), "Flag " #name " is not of type " #type); \
+}
+#else
+#define CHECK_FLAG(type, name)
+#endif
+
+#define ADD_FLAG(type, name, convert) { \
+  CHECK_FLAG(type, name) \
+  instanceHandle vmFlagObj = InstanceKlass::cast(VMFlag::klass())->allocate_instance_handle(CHECK_NULL); \
+  CSTRING_TO_JSTRING(fname, #name); \
+  CSTRING_TO_JSTRING(ftype, #type); \
+  VMFlag::set_name(vmFlagObj, fname()); \
+  VMFlag::set_type(vmFlagObj, ftype()); \
+  convert(value, name); \
+  VMFlag::set_value(vmFlagObj, value); \
+  vmFlags->obj_at_put(i++, vmFlagObj()); \
+}
+#define ADD_BOOL_FLAG(name)  ADD_FLAG(bool, name, BOXED_BOOLEAN)
+#define ADD_INTX_FLAG(name)  ADD_FLAG(intx, name, BOXED_LONG)
+#define ADD_UINTX_FLAG(name) ADD_FLAG(uintx, name, BOXED_LONG)
+
+  len = 0 + PREDEFINED_CONFIG_FLAGS(COUNT_FLAG, COUNT_FLAG, COUNT_FLAG);
   objArrayHandle vmFlags = oopFactory::new_objArray(VMFlag::klass(), len, CHECK_NULL);
-  for (int i = 0; i < len; i++) {
-    Flag* flag = &Flag::flags[i];
-    instanceHandle vmFlagObj = InstanceKlass::cast(VMFlag::klass())->allocate_instance_handle(CHECK_NULL);
-    Handle name = java_lang_String::create_from_str(flag->_name, CHECK_NULL);
-    Handle type = java_lang_String::create_from_str(flag->_type, CHECK_NULL);
-    VMFlag::set_name(vmFlagObj, name());
-    VMFlag::set_type(vmFlagObj, type());
-    if (flag->is_bool()) {
-      BOXED_LONG(value, flag->get_bool());
-      VMFlag::set_value(vmFlagObj, value);
-    } else if (flag->is_ccstr()) {
-      Handle value = java_lang_String::create_from_str(flag->get_ccstr(), CHECK_NULL);
-      VMFlag::set_value(vmFlagObj, value());
-    } else if (flag->is_int()) {
-      BOXED_LONG(value, flag->get_int());
-      VMFlag::set_value(vmFlagObj, value);
-    } else if (flag->is_intx()) {
-      BOXED_LONG(value, flag->get_intx());
-      VMFlag::set_value(vmFlagObj, value);
-    } else if (flag->is_uint()) {
-      BOXED_LONG(value, flag->get_uint());
-      VMFlag::set_value(vmFlagObj, value);
-    } else if (flag->is_uint64_t()) {
-      BOXED_LONG(value, flag->get_uint64_t());
-      VMFlag::set_value(vmFlagObj, value);
-    } else if (flag->is_uintx()) {
-      BOXED_LONG(value, flag->get_uintx());
-      VMFlag::set_value(vmFlagObj, value);
-    } else if (flag->is_double()) {
-      BOXED_DOUBLE(value, flag->get_double());
-      VMFlag::set_value(vmFlagObj, value);
-    } else if (flag->is_size_t()) {
-      BOXED_LONG(value, flag->get_size_t());
-      VMFlag::set_value(vmFlagObj, value);
-    } else {
-      JVMCI_ERROR_NULL("VM flag %s has unsupported type %s", flag->_name, flag->_type);
-    }
-    vmFlags->obj_at_put(i, vmFlagObj());
-  }
+  int i = 0;
+  PREDEFINED_CONFIG_FLAGS(ADD_BOOL_FLAG, ADD_INTX_FLAG, ADD_UINTX_FLAG)
 
   objArrayHandle vmIntrinsics = CompilerToVM::initialize_intrinsics(CHECK_NULL);
 
-  objArrayOop data = oopFactory::new_objArray(SystemDictionary::Object_klass(), 6, CHECK_NULL);
+  objArrayOop data = oopFactory::new_objArray(SystemDictionary::Object_klass(), 5, CHECK_NULL);
   data->obj_at_put(0, vmFields());
-  data->obj_at_put(1, vmTypes());
-  data->obj_at_put(2, vmConstants());
-  data->obj_at_put(3, vmAddresses());
-  data->obj_at_put(4, vmFlags());
-  data->obj_at_put(5, vmIntrinsics());
+  data->obj_at_put(1, vmConstants());
+  data->obj_at_put(2, vmAddresses());
+  data->obj_at_put(3, vmFlags());
+  data->obj_at_put(4, vmIntrinsics());
 
   return (jobjectArray) JNIHandles::make_local(THREAD, data);
+#undef COUNT_FLAG
+#undef ADD_FLAG
+#undef ADD_BOOL_FLAG
+#undef ADD_INTX_FLAG
+#undef ADD_UINTX_FLAG
+#undef CHECK_FLAG
+C2V_END
+
+C2V_VMENTRY(jobject, getFlagValue, (JNIEnv *, jobject c2vm, jobject name_handle))
+#define RETURN_BOXED_LONG(value) oop box; jvalue p; p.j = (jlong) (value); box = java_lang_boxing_object::create(T_LONG, &p, CHECK_NULL); return JNIHandles::make_local(THREAD, box);
+#define RETURN_BOXED_DOUBLE(value) oop box; jvalue p; p.d = (jdouble) (value); box = java_lang_boxing_object::create(T_DOUBLE, &p, CHECK_NULL); return JNIHandles::make_local(THREAD, box);
+  Handle name = JNIHandles::resolve(name_handle);
+  if (name.is_null()) {
+    THROW_0(vmSymbols::java_lang_NullPointerException());
+  }
+  ResourceMark rm;
+  const char* cstring = java_lang_String::as_utf8_string(name());
+  Flag* flag = Flag::find_flag(cstring, strlen(cstring), /* allow_locked */ true, /* return_flag */ true);
+  if (flag == NULL) {
+    return c2vm;
+  }
+  if (flag->is_bool()) {
+    jvalue prim;
+    prim.z = flag->get_bool();
+    oop box = java_lang_boxing_object::create(T_BOOLEAN, &prim, CHECK_NULL);
+    return JNIHandles::make_local(THREAD, box);
+  } else if (flag->is_ccstr()) {
+    Handle value = java_lang_String::create_from_str(flag->get_ccstr(), CHECK_NULL);
+    return JNIHandles::make_local(THREAD, value());
+  } else if (flag->is_intx()) {
+    RETURN_BOXED_LONG(flag->get_intx());
+  } else if (flag->is_int()) {
+    RETURN_BOXED_LONG(flag->get_int());
+  } else if (flag->is_uint()) {
+    RETURN_BOXED_LONG(flag->get_uint());
+  } else if (flag->is_uint64_t()) {
+    RETURN_BOXED_LONG(flag->get_uint64_t());
+  } else if (flag->is_size_t()) {
+    RETURN_BOXED_LONG(flag->get_size_t());
+  } else if (flag->is_uintx()) {
+    RETURN_BOXED_LONG(flag->get_uintx());
+  } else if (flag->is_double()) {
+    RETURN_BOXED_DOUBLE(flag->get_double());
+  } else {
+    JVMCI_ERROR_NULL("VM flag %s has unsupported type %s", flag->_name, flag->_type);
+  }
+C2V_END
+
 #undef BOXED_LONG
 #undef BOXED_DOUBLE
-C2V_END
+#undef CSTRING_TO_JSTRING
 
 C2V_VMENTRY(jbyteArray, getBytecode, (JNIEnv *, jobject, jobject jvmci_method))
   methodHandle method = CompilerToVM::asMethod(jvmci_method);
@@ -593,9 +761,7 @@
 
 C2V_VMENTRY(jboolean, isCompilable,(JNIEnv *, jobject, jobject jvmci_method))
   methodHandle method = CompilerToVM::asMethod(jvmci_method);
-  // Ignore the not_compilable flags in hosted mode since they are never set by
-  // the JVMCI compiler.
-  return UseJVMCICompiler || !method->is_not_compilable(CompLevel_full_optimization);
+  return !method->is_not_compilable(CompLevel_full_optimization);
 C2V_END
 
 C2V_VMENTRY(jboolean, hasNeverInlineDirective,(JNIEnv *, jobject, jobject jvmci_method))
@@ -743,7 +909,7 @@
   return cp->remap_instruction_operand_from_cache(index);
 C2V_END
 
-C2V_VMENTRY(jobject, resolveFieldInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jobject jvmci_method, jbyte opcode, jlongArray info_handle))
+C2V_VMENTRY(jobject, resolveFieldInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jobject jvmci_method, jbyte opcode, jintArray info_handle))
   ResourceMark rm;
   constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool);
   Bytecodes::Code code = (Bytecodes::Code)(((int) opcode) & 0xFF);
@@ -751,9 +917,12 @@
   LinkInfo link_info(cp, index, (jvmci_method != NULL) ? CompilerToVM::asMethod(jvmci_method) : NULL, CHECK_0);
   LinkResolver::resolve_field(fd, link_info, Bytecodes::java_code(code), false, CHECK_0);
   typeArrayOop info = (typeArrayOop) JNIHandles::resolve(info_handle);
-  assert(info != NULL && info->length() == 2, "must be");
-  info->long_at_put(0, (jlong) fd.access_flags().as_int());
-  info->long_at_put(1, (jlong) fd.offset());
+  if (info == NULL || info->length() != 3) {
+    JVMCI_ERROR_NULL("info must not be null and have a length of 3");
+  }
+  info->int_at_put(0, fd.access_flags().as_int());
+  info->int_at_put(1, fd.offset());
+  info->int_at_put(2, fd.index());
   oop field_holder = CompilerToVM::get_jvmci_type(fd.field_holder(), CHECK_NULL);
   return JNIHandles::make_local(THREAD, field_holder);
 C2V_END
@@ -842,6 +1011,8 @@
 C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject installed_code, jobject speculation_log))
   ResourceMark rm;
   HandleMark hm;
+  JNIHandleMark jni_hm;
+
   Handle target_handle = JNIHandles::resolve(target);
   Handle compiled_code_handle = JNIHandles::resolve(compiled_code);
   CodeBlob* cb = NULL;
@@ -1610,7 +1781,7 @@
   {CC "resolveConstantInPool",                        CC "(" HS_CONSTANT_POOL "I)" OBJECT,                                                  FN_PTR(resolveConstantInPool)},
   {CC "resolvePossiblyCachedConstantInPool",          CC "(" HS_CONSTANT_POOL "I)" OBJECT,                                                  FN_PTR(resolvePossiblyCachedConstantInPool)},
   {CC "resolveTypeInPool",                            CC "(" HS_CONSTANT_POOL "I)" HS_RESOLVED_KLASS,                                       FN_PTR(resolveTypeInPool)},
-  {CC "resolveFieldInPool",                           CC "(" HS_CONSTANT_POOL "I" HS_RESOLVED_METHOD "B[J)" HS_RESOLVED_KLASS,              FN_PTR(resolveFieldInPool)},
+  {CC "resolveFieldInPool",                           CC "(" HS_CONSTANT_POOL "I" HS_RESOLVED_METHOD "B[I)" HS_RESOLVED_KLASS,              FN_PTR(resolveFieldInPool)},
   {CC "resolveInvokeDynamicInPool",                   CC "(" HS_CONSTANT_POOL "I)V",                                                        FN_PTR(resolveInvokeDynamicInPool)},
   {CC "resolveInvokeHandleInPool",                    CC "(" HS_CONSTANT_POOL "I)V",                                                        FN_PTR(resolveInvokeHandleInPool)},
   {CC "resolveMethod",                                CC "(" HS_RESOLVED_KLASS HS_RESOLVED_METHOD HS_RESOLVED_KLASS ")" HS_RESOLVED_METHOD, FN_PTR(resolveMethod)},
@@ -1648,6 +1819,7 @@
   {CC "getFingerprint",                               CC "(J)J",                                                                            FN_PTR(getFingerprint)},
   {CC "interpreterFrameSize",                         CC "(" BYTECODE_FRAME ")I",                                                           FN_PTR(interpreterFrameSize)},
   {CC "compileToBytecode",                            CC "(" OBJECT ")V",                                                                   FN_PTR(compileToBytecode)},
+  {CC "getFlagValue",                                 CC "(" STRING ")" OBJECT,                                                             FN_PTR(getFlagValue)},
 };
 
 int CompilerToVM::methods_count() {
diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp
index c0f21e2..036ffdd 100644
--- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp
+++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp
@@ -66,6 +66,15 @@
 
     static int vm_page_size;
 
+    static int sizeof_vtableEntry;
+    static int sizeof_ExceptionTableElement;
+    static int sizeof_LocalVariableTableElement;
+    static int sizeof_ConstantPool;
+    static int sizeof_SymbolPointer;
+    static int sizeof_narrowKlass;
+    static int sizeof_arrayOopDesc;
+    static int sizeof_BasicLock;
+
     static address dsin;
     static address dcos;
     static address dtan;
@@ -74,8 +83,11 @@
     static address dlog10;
     static address dpow;
 
+    static address symbol_init;
+    static address symbol_clinit;
+
    public:
-    static void initialize();
+    static void initialize(TRAPS);
 
     static int max_oop_map_stack_offset() {
       assert(_max_oop_map_stack_offset > 0, "must be initialized");
@@ -83,6 +95,20 @@
     }
   };
 
+  static bool cstring_equals(const char* const& s0, const char* const& s1) {
+    return strcmp(s0, s1) == 0;
+  }
+
+  static unsigned cstring_hash(const char* const& s) {
+    int h = 0;
+    const char* p = s;
+    while (*p != '\0') {
+      h = 31 * h + *p;
+      p++;
+    }
+    return h;
+  }
+
   static JNINativeMethod methods[];
 
   static objArrayHandle initialize_intrinsics(TRAPS);
@@ -180,4 +206,14 @@
   inline void do_void()                     { }
 };
 
+class JNIHandleMark : public StackObj {
+  public:
+    JNIHandleMark() { push_jni_handle_block(); }
+    ~JNIHandleMark() { pop_jni_handle_block(); }
+
+  private:
+    static void push_jni_handle_block();
+    static void pop_jni_handle_block();
+};
+
 #endif // SHARE_VM_JVMCI_JVMCI_COMPILER_TO_VM_HPP
diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp
index 9c5d983..8fb1e8c 100644
--- a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp
+++ b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp
@@ -283,13 +283,14 @@
 // Perform an appropriate method lookup based on accessor, holder,
 // name, signature, and bytecode.
 methodHandle JVMCIEnv::lookup_method(instanceKlassHandle h_accessor,
-                               instanceKlassHandle h_holder,
+                               KlassHandle   h_holder,
                                Symbol*       name,
                                Symbol*       sig,
                                Bytecodes::Code bc,
                                constantTag   tag) {
-  JVMCI_EXCEPTION_CONTEXT;
-  LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
+  // Accessibility checks are performed in JVMCIEnv::get_method_by_index_impl().
+  assert(check_klass_accessibility(h_accessor, h_holder), "holder not accessible");
+
   methodHandle dest_method;
   LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
   switch (bc) {
@@ -363,9 +364,8 @@
   }
 
   if (holder_is_accessible) { // Our declared holder is loaded.
-    instanceKlassHandle lookup = get_instance_klass_for_declared_method_holder(holder);
     constantTag tag = cpool->tag_ref_at(index);
-    methodHandle m = lookup_method(accessor, lookup, name_sym, sig_sym, bc, tag);
+    methodHandle m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag);
     if (!m.is_null() &&
         (bc == Bytecodes::_invokestatic
          ?  InstanceKlass::cast(m->method_holder())->is_not_initialized()
diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp
index 2c88449..1154a95 100644
--- a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp
+++ b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp
@@ -127,7 +127,7 @@
   // Helper methods
   static bool       check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass);
   static methodHandle  lookup_method(instanceKlassHandle  accessor,
-                           instanceKlassHandle  holder,
+                           KlassHandle     holder,
                            Symbol*         name,
                            Symbol*         sig,
                            Bytecodes::Code bc,
diff --git a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp
index d6039fc..5876414 100644
--- a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp
+++ b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp
@@ -117,7 +117,7 @@
     oop_field(VMField, type, "Ljava/lang/String;")                                                                                                             \
     long_field(VMField, offset)                                                                                                                                \
     long_field(VMField, address)                                                                                                                               \
-    oop_field(VMField, value, "Ljava/lang/Long;")                                                                                                              \
+    oop_field(VMField, value, "Ljava/lang/Object;")                                                                                                            \
   end_class                                                                                                                                                    \
   start_class(VMFlag)                                                                                                                                          \
     oop_field(VMFlag, name, "Ljava/lang/String;")                                                                                                              \
diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp
index a01651f..0ce9816 100644
--- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp
+++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp
@@ -78,6 +78,15 @@
                                                                                                                                      \
   static_field(CompilerToVM::Data,             vm_page_size,                           int)                                          \
                                                                                                                                      \
+  static_field(CompilerToVM::Data,             sizeof_vtableEntry,                     int)                                          \
+  static_field(CompilerToVM::Data,             sizeof_ExceptionTableElement,           int)                                          \
+  static_field(CompilerToVM::Data,             sizeof_LocalVariableTableElement,       int)                                          \
+  static_field(CompilerToVM::Data,             sizeof_ConstantPool,                    int)                                          \
+  static_field(CompilerToVM::Data,             sizeof_SymbolPointer,                   int)                                          \
+  static_field(CompilerToVM::Data,             sizeof_narrowKlass,                     int)                                          \
+  static_field(CompilerToVM::Data,             sizeof_arrayOopDesc,                    int)                                          \
+  static_field(CompilerToVM::Data,             sizeof_BasicLock,                       int)                                          \
+                                                                                                                                     \
   static_field(CompilerToVM::Data,             dsin,                                   address)                                      \
   static_field(CompilerToVM::Data,             dcos,                                   address)                                      \
   static_field(CompilerToVM::Data,             dtan,                                   address)                                      \
@@ -86,6 +95,9 @@
   static_field(CompilerToVM::Data,             dlog10,                                 address)                                      \
   static_field(CompilerToVM::Data,             dpow,                                   address)                                      \
                                                                                                                                      \
+  static_field(CompilerToVM::Data,             symbol_init,                            address)                                      \
+  static_field(CompilerToVM::Data,             symbol_clinit,                          address)                                      \
+                                                                                                                                     \
   static_field(Abstract_VM_Version,            _features,                              uint64_t)                                     \
                                                                                                                                      \
   nonstatic_field(Array<int>,                  _length,                                int)                                          \
diff --git a/hotspot/src/share/vm/memory/heap.cpp b/hotspot/src/share/vm/memory/heap.cpp
index 9d2179d..8db869c 100644
--- a/hotspot/src/share/vm/memory/heap.cpp
+++ b/hotspot/src/share/vm/memory/heap.cpp
@@ -190,6 +190,10 @@
   if (block != NULL) {
     assert(block->length() >= number_of_segments && block->length() < number_of_segments + CodeCacheMinBlockLength, "sanity check");
     assert(!block->free(), "must be marked free");
+    guarantee((char*) block >= _memory.low_boundary() && (char*) block < _memory.high(),
+              "The newly allocated block " INTPTR_FORMAT " is not within the heap "
+              "starting with "  INTPTR_FORMAT " and ending with "  INTPTR_FORMAT,
+              p2i(block), p2i(_memory.low_boundary()), p2i(_memory.high()));
     DEBUG_ONLY(memset((void*)block->allocated_space(), badCodeHeapNewVal, instance_size));
     _max_allocated_capacity = MAX2(_max_allocated_capacity, allocated_capacity());
     _blob_count++;
@@ -204,6 +208,10 @@
     HeapBlock* b =  block_at(_next_segment);
     b->initialize(number_of_segments);
     _next_segment += number_of_segments;
+    guarantee((char*) b >= _memory.low_boundary() && (char*) block < _memory.high(),
+              "The newly allocated block " INTPTR_FORMAT " is not within the heap "
+              "starting with "  INTPTR_FORMAT " and ending with " INTPTR_FORMAT,
+              p2i(b), p2i(_memory.low_boundary()), p2i(_memory.high()));
     DEBUG_ONLY(memset((void *)b->allocated_space(), badCodeHeapNewVal, instance_size));
     _max_allocated_capacity = MAX2(_max_allocated_capacity, allocated_capacity());
     _blob_count++;
@@ -219,6 +227,10 @@
   // Find start of HeapBlock
   HeapBlock* b = (((HeapBlock *)p) - 1);
   assert(b->allocated_space() == p, "sanity check");
+  guarantee((char*) b >= _memory.low_boundary() && (char*) b < _memory.high(),
+            "The block to be deallocated " INTPTR_FORMAT " is not within the heap "
+            "starting with "  INTPTR_FORMAT " and ending with " INTPTR_FORMAT,
+            p2i(b), p2i(_memory.low_boundary()), p2i(_memory.high()));
   DEBUG_ONLY(memset((void *)b->allocated_space(), badCodeHeapFreeVal,
              segments_to_size(b->length()) - sizeof(HeapBlock)));
   add_to_freelist(b);
diff --git a/hotspot/src/share/vm/memory/heap.hpp b/hotspot/src/share/vm/memory/heap.hpp
index d755596..6fe3391 100644
--- a/hotspot/src/share/vm/memory/heap.hpp
+++ b/hotspot/src/share/vm/memory/heap.hpp
@@ -153,7 +153,9 @@
   char* high() const                             { return _memory.high(); }
   char* high_boundary() const                    { return _memory.high_boundary(); }
 
-  virtual bool  contains(const void* p) const    { return low_boundary() <= p && p < high(); }
+  virtual bool contains(const void* p) const     { return low_boundary() <= p && p < high(); }
+  virtual bool contains_blob(const CodeBlob* blob) const { return low_boundary() <= (char*) blob && (char*) blob < high(); }
+
   virtual void* find_start(void* p)     const;   // returns the block containing p or NULL
   virtual CodeBlob* find_blob_unsafe(void* start) const;
   size_t alignment_unit()       const;           // alignment of any block
diff --git a/hotspot/src/share/vm/oops/constMethod.hpp b/hotspot/src/share/vm/oops/constMethod.hpp
index 45246ba..7453ecb 100644
--- a/hotspot/src/share/vm/oops/constMethod.hpp
+++ b/hotspot/src/share/vm/oops/constMethod.hpp
@@ -359,7 +359,9 @@
   }
 
   // Sizing
-  static int header_size() { return sizeof(ConstMethod)/wordSize; }
+  static int header_size() {
+    return align_size_up(sizeof(ConstMethod), wordSize) / wordSize;
+  }
 
   // Size needed
   static int size(int code_size, InlineTableSizes* sizes);
diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp
index 38a71f5..86cfa19 100644
--- a/hotspot/src/share/vm/oops/constantPool.hpp
+++ b/hotspot/src/share/vm/oops/constantPool.hpp
@@ -705,7 +705,9 @@
   }
 
   // Sizing (in words)
-  static int header_size()             { return sizeof(ConstantPool)/wordSize; }
+  static int header_size()             {
+    return align_size_up(sizeof(ConstantPool), wordSize) / wordSize;
+  }
   static int size(int length)          { return align_metadata_size(header_size() + length); }
   int size() const                     { return size(length()); }
 #if INCLUDE_SERVICES
diff --git a/hotspot/src/share/vm/oops/cpCache.hpp b/hotspot/src/share/vm/oops/cpCache.hpp
index e58d7c1..e68c68a 100644
--- a/hotspot/src/share/vm/oops/cpCache.hpp
+++ b/hotspot/src/share/vm/oops/cpCache.hpp
@@ -359,7 +359,9 @@
                                                    return (TosState)((_flags >> tos_state_shift) & tos_state_mask); }
 
   // Code generation support
-  static WordSize size()                         { return in_WordSize(sizeof(ConstantPoolCacheEntry) / wordSize); }
+  static WordSize size()                         {
+    return in_WordSize(align_size_up(sizeof(ConstantPoolCacheEntry), wordSize) / wordSize);
+  }
   static ByteSize size_in_bytes()                { return in_ByteSize(sizeof(ConstantPoolCacheEntry)); }
   static ByteSize indices_offset()               { return byte_offset_of(ConstantPoolCacheEntry, _indices); }
   static ByteSize f1_offset()                    { return byte_offset_of(ConstantPoolCacheEntry, _f1); }
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 41f5fd1..7098451 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -2456,22 +2456,24 @@
 void InstanceKlass::check_prohibited_package(Symbol* class_name,
                                              Handle class_loader,
                                              TRAPS) {
-  ResourceMark rm(THREAD);
   if (!class_loader.is_null() &&
       !SystemDictionary::is_platform_class_loader(class_loader) &&
-      class_name != NULL &&
-      strncmp(class_name->as_C_string(), JAVAPKG, JAVAPKG_LEN) == 0) {
-    TempNewSymbol pkg_name = InstanceKlass::package_from_name(class_name, CHECK);
-    assert(pkg_name != NULL, "Error in parsing package name starting with 'java/'");
-    char* name = pkg_name->as_C_string();
-    const char* class_loader_name = SystemDictionary::loader_name(class_loader());
-    StringUtils::replace_no_expand(name, "/", ".");
-    const char* msg_text1 = "Class loader (instance of): ";
-    const char* msg_text2 = " tried to load prohibited package name: ";
-    size_t len = strlen(msg_text1) + strlen(class_loader_name) + strlen(msg_text2) + strlen(name) + 1;
-    char* message = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, len);
-    jio_snprintf(message, len, "%s%s%s%s", msg_text1, class_loader_name, msg_text2, name);
-    THROW_MSG(vmSymbols::java_lang_SecurityException(), message);
+      class_name != NULL) {
+    ResourceMark rm(THREAD);
+    char* name = class_name->as_C_string();
+    if (strncmp(name, JAVAPKG, JAVAPKG_LEN) == 0 && name[JAVAPKG_LEN] == '/') {
+      TempNewSymbol pkg_name = InstanceKlass::package_from_name(class_name, CHECK);
+      assert(pkg_name != NULL, "Error in parsing package name starting with 'java/'");
+      name = pkg_name->as_C_string();
+      const char* class_loader_name = SystemDictionary::loader_name(class_loader());
+      StringUtils::replace_no_expand(name, "/", ".");
+      const char* msg_text1 = "Class loader (instance of): ";
+      const char* msg_text2 = " tried to load prohibited package name: ";
+      size_t len = strlen(msg_text1) + strlen(class_loader_name) + strlen(msg_text2) + strlen(name) + 1;
+      char* message = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, len);
+      jio_snprintf(message, len, "%s%s%s%s", msg_text1, class_loader_name, msg_text2, name);
+      THROW_MSG(vmSymbols::java_lang_SecurityException(), message);
+    }
   }
   return;
 }
@@ -2806,7 +2808,7 @@
   return NULL;
 }
 
-bool InstanceKlass::add_member_name(Handle mem_name) {
+oop InstanceKlass::add_member_name(Handle mem_name, bool intern) {
   jweak mem_name_wref = JNIHandles::make_weak_global(mem_name);
   MutexLocker ml(MemberNameTable_lock);
   DEBUG_ONLY(NoSafepointVerifier nsv);
@@ -2816,7 +2818,7 @@
   // is called!
   Method* method = (Method*)java_lang_invoke_MemberName::vmtarget(mem_name());
   if (method->is_obsolete()) {
-    return false;
+    return NULL;
   } else if (method->is_old()) {
     // Replace method with redefined version
     java_lang_invoke_MemberName::set_vmtarget(mem_name(), method_with_idnum(method->method_idnum()));
@@ -2825,8 +2827,11 @@
   if (_member_names == NULL) {
     _member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable(idnum_allocated_count());
   }
-  _member_names->add_member_name(mem_name_wref);
-  return true;
+  if (intern) {
+    return _member_names->find_or_add_member_name(mem_name_wref);
+  } else {
+    return _member_names->add_member_name(mem_name_wref);
+  }
 }
 
 // -----------------------------------------------------------------------------------------------------
diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp
index 015a86c..1756b9f 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1359,7 +1359,7 @@
   // JSR-292 support
   MemberNameTable* member_names() { return _member_names; }
   void set_member_names(MemberNameTable* member_names) { _member_names = member_names; }
-  bool add_member_name(Handle member_name);
+  oop add_member_name(Handle member_name, bool intern);
 
 public:
   // JVMTI support
diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp
index ebc5995..d8ec1ba 100644
--- a/hotspot/src/share/vm/oops/klass.cpp
+++ b/hotspot/src/share/vm/oops/klass.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -532,7 +532,7 @@
     } else {
       module_entry = ModuleEntryTable::javabase_moduleEntry();
     }
-    // Obtain java.lang.reflect.Module, if available
+    // Obtain java.lang.Module, if available
     Handle module_handle(THREAD, ((module_entry != NULL) ? JNIHandles::resolve(module_entry->module()) : (oop)NULL));
     java_lang_Class::create_mirror(this, loader, module_handle, protection_domain, CHECK);
   }
diff --git a/hotspot/src/share/vm/oops/metadata.hpp b/hotspot/src/share/vm/oops/metadata.hpp
index c429972..b6d60e6 100644
--- a/hotspot/src/share/vm/oops/metadata.hpp
+++ b/hotspot/src/share/vm/oops/metadata.hpp
@@ -47,6 +47,7 @@
   virtual bool is_method()             const volatile { return false; }
   virtual bool is_methodData()         const volatile { return false; }
   virtual bool is_constantPool()       const volatile { return false; }
+  virtual bool is_methodCounters()     const volatile { return false; }
 
   virtual const char* internal_name()  const = 0;
 
diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp
index ebd5f0f..6675410 100644
--- a/hotspot/src/share/vm/oops/method.hpp
+++ b/hotspot/src/share/vm/oops/method.hpp
@@ -671,7 +671,9 @@
 #endif
 
   // sizing
-  static int header_size()                       { return sizeof(Method)/wordSize; }
+  static int header_size()                       {
+    return align_size_up(sizeof(Method), wordSize) / wordSize;
+  }
   static int size(bool is_native);
   int size() const                               { return method_size(); }
 #if INCLUDE_SERVICES
diff --git a/hotspot/src/share/vm/oops/methodCounters.cpp b/hotspot/src/share/vm/oops/methodCounters.cpp
index b78b6e8..225573e 100644
--- a/hotspot/src/share/vm/oops/methodCounters.cpp
+++ b/hotspot/src/share/vm/oops/methodCounters.cpp
@@ -73,3 +73,11 @@
 #endif
 }
 
+
+void MethodCounters::print_value_on(outputStream* st) const {
+  assert(is_methodCounters(), "must be methodCounters");
+  st->print("method counters");
+  print_address_on(st);
+}
+
+
diff --git a/hotspot/src/share/vm/oops/methodCounters.hpp b/hotspot/src/share/vm/oops/methodCounters.hpp
index df96b63..97ddc4b 100644
--- a/hotspot/src/share/vm/oops/methodCounters.hpp
+++ b/hotspot/src/share/vm/oops/methodCounters.hpp
@@ -30,7 +30,7 @@
 #include "interpreter/invocationCounter.hpp"
 #include "runtime/arguments.hpp"
 
-class MethodCounters: public MetaspaceObj {
+class MethodCounters : public Metadata {
  friend class VMStructs;
  friend class JVMCIVMStructs;
  private:
@@ -109,16 +109,17 @@
   }
 
  public:
+  virtual bool is_methodCounters() const volatile { return true; }
+
   static MethodCounters* allocate(methodHandle mh, TRAPS);
 
   void deallocate_contents(ClassLoaderData* loader_data) {}
-  DEBUG_ONLY(bool on_stack() { return false; })  // for template
 
   AOT_ONLY(Method* method() const { return _method; })
 
-  static int size() { return sizeof(MethodCounters) / wordSize; }
-
-  bool is_klass() const { return false; }
+  static int size() {
+    return align_size_up(sizeof(MethodCounters), wordSize) / wordSize;
+  }
 
   void clear_counters();
 
@@ -251,5 +252,9 @@
   static ByteSize backedge_mask_offset() {
     return byte_offset_of(MethodCounters, _backedge_mask);
   }
+
+  virtual const char* internal_name() const { return "{method counters}"; }
+  virtual void print_value_on(outputStream* st) const;
+
 };
 #endif //SHARE_VM_OOPS_METHODCOUNTERS_HPP
diff --git a/hotspot/src/share/vm/opto/arraycopynode.cpp b/hotspot/src/share/vm/opto/arraycopynode.cpp
index a81d7a9..d581bcb 100644
--- a/hotspot/src/share/vm/opto/arraycopynode.cpp
+++ b/hotspot/src/share/vm/opto/arraycopynode.cpp
@@ -225,7 +225,6 @@
   Node* dest = in(ArrayCopyNode::Dest);
   const Type* src_type = phase->type(src);
   const TypeAryPtr* ary_src = src_type->isa_aryptr();
-  assert(ary_src != NULL, "should be an array copy/clone");
 
   if (is_arraycopy() || is_copyofrange() || is_copyof()) {
     const Type* dest_type = phase->type(dest);
@@ -286,7 +285,8 @@
 
     copy_type = dest_elem;
   } else {
-    assert (is_clonebasic(), "should be");
+    assert(ary_src != NULL, "should be a clone");
+    assert(is_clonebasic(), "should be");
 
     disjoint_bases = true;
     assert(src->is_AddP(), "should be base + off");
diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp
index de9f44c..a5aaa55 100644
--- a/hotspot/src/share/vm/opto/callGenerator.cpp
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp
@@ -46,7 +46,7 @@
   return TypeFunc::make(method());
 }
 
-bool CallGenerator::is_inlined_mh_linker(JVMState* jvms, ciMethod* callee) {
+bool CallGenerator::is_inlined_method_handle_intrinsic(JVMState* jvms, ciMethod* callee) {
   ciMethod* symbolic_info = jvms->method()->get_method_at_bci(jvms->bci());
   return symbolic_info->is_method_handle_intrinsic() && !callee->is_method_handle_intrinsic();
 }
@@ -142,7 +142,7 @@
   }
 
   CallStaticJavaNode *call = new CallStaticJavaNode(kit.C, tf(), target, method(), kit.bci());
-  if (is_inlined_mh_linker(jvms, method())) {
+  if (is_inlined_method_handle_intrinsic(jvms, method())) {
     // To be able to issue a direct call and skip a call to MH.linkTo*/invokeBasic adapter,
     // additional information about the method being invoked should be attached
     // to the call site to make resolution logic work
@@ -241,7 +241,7 @@
   address target = SharedRuntime::get_resolve_virtual_call_stub();
   // Normal inline cache used for call
   CallDynamicJavaNode *call = new CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci());
-  if (is_inlined_mh_linker(jvms, method())) {
+  if (is_inlined_method_handle_intrinsic(jvms, method())) {
     // To be able to issue a direct call (optimized virtual or virtual)
     // and skip a call to MH.linkTo*/invokeBasic adapter, additional information
     // about the method being invoked should be attached to the call site to
@@ -785,8 +785,7 @@
 
 
 CallGenerator* CallGenerator::for_method_handle_call(JVMState* jvms, ciMethod* caller, ciMethod* callee, bool delayed_forbidden) {
-  assert(callee->is_method_handle_intrinsic() ||
-         callee->is_compiled_lambda_form(), "for_method_handle_call mismatch");
+  assert(callee->is_method_handle_intrinsic(), "for_method_handle_call mismatch");
   bool input_not_const;
   CallGenerator* cg = CallGenerator::for_method_handle_inline(jvms, caller, callee, input_not_const);
   Compile* C = Compile::current();
@@ -826,6 +825,13 @@
         const TypeOopPtr* oop_ptr = receiver->bottom_type()->is_oopptr();
         ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget();
         const int vtable_index = Method::invalid_vtable_index;
+
+        if (!ciMethod::is_consistent_info(callee, target)) {
+          print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
+                                 "signatures mismatch");
+          return NULL;
+        }
+
         CallGenerator* cg = C->call_generator(target, vtable_index,
                                               false /* call_does_dispatch */,
                                               jvms,
@@ -833,9 +839,8 @@
                                               PROB_ALWAYS);
         return cg;
       } else {
-        const char* msg = "receiver not constant";
-        if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
-        C->log_inline_failure(msg);
+        print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
+                               "receiver not constant");
       }
     }
     break;
@@ -852,6 +857,12 @@
         const TypeOopPtr* oop_ptr = member_name->bottom_type()->is_oopptr();
         ciMethod* target = oop_ptr->const_oop()->as_member_name()->get_vmtarget();
 
+        if (!ciMethod::is_consistent_info(callee, target)) {
+          print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
+                                 "signatures mismatch");
+          return NULL;
+        }
+
         // In lambda forms we erase signature types to avoid resolving issues
         // involving class loaders.  When we optimize a method handle invoke
         // to a direct call we must cast the receiver and arguments to its
@@ -912,9 +923,8 @@
                                               speculative_receiver_type);
         return cg;
       } else {
-        const char* msg = "member_name not constant";
-        if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
-        C->log_inline_failure(msg);
+        print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
+                               "member_name not constant");
       }
     }
     break;
diff --git a/hotspot/src/share/vm/opto/callGenerator.hpp b/hotspot/src/share/vm/opto/callGenerator.hpp
index 58e8fe9..8b7ee54 100644
--- a/hotspot/src/share/vm/opto/callGenerator.hpp
+++ b/hotspot/src/share/vm/opto/callGenerator.hpp
@@ -170,7 +170,12 @@
     }
   }
 
-  static bool is_inlined_mh_linker(JVMState* jvms, ciMethod* m);
+  static void print_inlining_failure(Compile* C, ciMethod* callee, int inline_level, int bci, const char* msg) {
+    print_inlining(C, callee, inline_level, bci, msg);
+    C->log_inline_failure(msg);
+  }
+
+  static bool is_inlined_method_handle_intrinsic(JVMState* jvms, ciMethod* m);
 };
 
 
diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp
index 66b2d08..7def4ee 100644
--- a/hotspot/src/share/vm/opto/callnode.cpp
+++ b/hotspot/src/share/vm/opto/callnode.cpp
@@ -784,8 +784,8 @@
       }
       // May modify (by reflection) if an boxing object is passed
       // as argument or returned.
-      if (returns_pointer() && (proj_out(TypeFunc::Parms) != NULL)) {
-        Node* proj = proj_out(TypeFunc::Parms);
+      Node* proj = returns_pointer() ? proj_out(TypeFunc::Parms) : NULL;
+      if (proj != NULL) {
         const TypeInstPtr* inst_t = phase->type(proj)->isa_instptr();
         if ((inst_t != NULL) && (!inst_t->klass_is_exact() ||
                                  (inst_t->klass() == boxing_klass))) {
diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp
index 00979ae..f5cc9bc 100644
--- a/hotspot/src/share/vm/opto/callnode.hpp
+++ b/hotspot/src/share/vm/opto/callnode.hpp
@@ -452,8 +452,8 @@
   void delete_replaced_nodes() {
     _replaced_nodes.reset();
   }
-  void apply_replaced_nodes() {
-    _replaced_nodes.apply(this);
+  void apply_replaced_nodes(uint idx) {
+    _replaced_nodes.apply(this, idx);
   }
   void merge_replaced_nodes_with(SafePointNode* sfpt) {
     _replaced_nodes.merge_with(sfpt->_replaced_nodes);
diff --git a/hotspot/src/share/vm/opto/castnode.cpp b/hotspot/src/share/vm/opto/castnode.cpp
index 1184728..9f829a4 100644
--- a/hotspot/src/share/vm/opto/castnode.cpp
+++ b/hotspot/src/share/vm/opto/castnode.cpp
@@ -225,7 +225,10 @@
   }
 
   // Similar to ConvI2LNode::Ideal() for the same reasons
-  if (can_reshape && !phase->C->major_progress()) {
+  // Do not narrow the type of range check dependent CastIINodes to
+  // avoid corruption of the graph if a CastII is replaced by TOP but
+  // the corresponding range check is not removed.
+  if (can_reshape && !_range_check_dependency && !phase->C->major_progress()) {
     const TypeInt* this_type = this->type()->is_int();
     const TypeInt* in_type = phase->type(in(1))->isa_int();
     if (in_type != NULL && this_type != NULL &&
diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp
index de85b1c..69e7659 100644
--- a/hotspot/src/share/vm/opto/cfgnode.cpp
+++ b/hotspot/src/share/vm/opto/cfgnode.cpp
@@ -1889,6 +1889,12 @@
     bool saw_self = false;
     for( uint i=1; i<req(); ++i ) {// For all paths in
       Node *ii = in(i);
+      // TOP inputs should not be counted as safe inputs because if the
+      // Phi references itself through all other inputs then splitting the
+      // Phi through memory merges would create dead loop at later stage.
+      if (ii == top) {
+        return NULL; // Delay optimization until graph is cleaned.
+      }
       if (ii->is_MergeMem()) {
         MergeMemNode* n = ii->as_MergeMem();
         merge_width = MAX2(merge_width, n->req());
diff --git a/hotspot/src/share/vm/opto/convertnode.cpp b/hotspot/src/share/vm/opto/convertnode.cpp
index bc111cc..5d97a73 100644
--- a/hotspot/src/share/vm/opto/convertnode.cpp
+++ b/hotspot/src/share/vm/opto/convertnode.cpp
@@ -294,8 +294,7 @@
   }
 
 #ifdef _LP64
-  // Convert ConvI2L(AddI(x, y)) to AddL(ConvI2L(x), ConvI2L(y)) or
-  // ConvI2L(CastII(AddI(x, y))) to AddL(ConvI2L(CastII(x)), ConvI2L(CastII(y))),
+  // Convert ConvI2L(AddI(x, y)) to AddL(ConvI2L(x), ConvI2L(y))
   // but only if x and y have subranges that cannot cause 32-bit overflow,
   // under the assumption that x+y is in my own subrange this->type().
 
@@ -319,13 +318,6 @@
 
   Node* z = in(1);
   int op = z->Opcode();
-  Node* ctrl = NULL;
-  if (op == Op_CastII && z->as_CastII()->has_range_check()) {
-    // Skip CastII node but save control dependency
-    ctrl = z->in(0);
-    z = z->in(1);
-    op = z->Opcode();
-  }
   if (op == Op_AddI || op == Op_SubI) {
     Node* x = z->in(1);
     Node* y = z->in(2);
@@ -385,8 +377,8 @@
     }
     assert(rxlo == (int)rxlo && rxhi == (int)rxhi, "x should not overflow");
     assert(rylo == (int)rylo && ryhi == (int)ryhi, "y should not overflow");
-    Node* cx = phase->C->constrained_convI2L(phase, x, TypeInt::make(rxlo, rxhi, widen), ctrl);
-    Node* cy = phase->C->constrained_convI2L(phase, y, TypeInt::make(rylo, ryhi, widen), ctrl);
+    Node* cx = phase->C->constrained_convI2L(phase, x, TypeInt::make(rxlo, rxhi, widen), NULL);
+    Node* cy = phase->C->constrained_convI2L(phase, y, TypeInt::make(rylo, ryhi, widen), NULL);
     switch (op) {
       case Op_AddI:  return new AddLNode(cx, cy);
       case Op_SubI:  return new SubLNode(cx, cy);
diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp
index 97af80e..50142ea 100644
--- a/hotspot/src/share/vm/opto/doCall.cpp
+++ b/hotspot/src/share/vm/opto/doCall.cpp
@@ -400,92 +400,10 @@
 }
 
 #ifdef ASSERT
-static bool check_type(ciType* t1, ciType* t2) {
-  // Either oop-oop or prim-prim pair.
-  if (t1->is_primitive_type() && t2->is_primitive_type()) {
-    return t1->size() == t2->size(); // argument sizes should match
-  } else {
-    return !t1->is_primitive_type() && !t2->is_primitive_type(); // oop-oop
-  }
-}
-
-static bool check_inlined_mh_linker_info(ciMethod* symbolic_info, ciMethod* resolved_method) {
-  assert(symbolic_info->is_method_handle_intrinsic(), "sanity");
-  assert(!resolved_method->is_method_handle_intrinsic(), "sanity");
-
-  if (!symbolic_info->is_loaded() || !resolved_method->is_loaded()) {
-    return true; // Don't compare unloaded methods.
-  }
-  // Linkers have appendix argument which is not passed to callee.
-  int has_appendix = MethodHandles::has_member_arg(symbolic_info->intrinsic_id()) ? 1 : 0;
-  if (symbolic_info->arg_size() != (resolved_method->arg_size() + has_appendix)) {
-    return false; // Total size of arguments on stack mismatch.
-  }
-  if (!symbolic_info->return_type()->is_void()) {
-    // Only check the return type if the symbolic method is not void
-    // i.e. the return value of the resolved method can be dropped
-    if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) {
-      return false; // Return value size or type mismatch encountered.
-    }
-  }
-
-  switch (symbolic_info->intrinsic_id()) {
-    case vmIntrinsics::_linkToVirtual:
-    case vmIntrinsics::_linkToInterface:
-    case vmIntrinsics::_linkToSpecial: {
-      if (resolved_method->is_static())  return false;
-      break;
-    }
-    case vmIntrinsics::_linkToStatic: {
-      if (!resolved_method->is_static())  return false;
-      break;
-    }
-  }
-
-  ciSignature* symbolic_sig = symbolic_info->signature();
-  ciSignature* resolved_sig = resolved_method->signature();
-
-  if (symbolic_sig->count() + (symbolic_info->is_static() ? 0 : 1) !=
-      resolved_sig->count() + (resolved_method->is_static() ? 0 : 1) + has_appendix) {
-    return false; // Argument count mismatch
-  }
-
-  int sbase = 0, rbase = 0;
-  int arg_count = MIN2(symbolic_sig->count() - has_appendix, resolved_sig->count());
-  ciType* recv_type = NULL;
-  if (symbolic_info->is_static() && !resolved_method->is_static()) {
-    recv_type = symbolic_sig->type_at(0);
-    sbase = 1;
-  } else if (!symbolic_info->is_static() && resolved_method->is_static()) {
-    recv_type = resolved_sig->type_at(0);
-    rbase = 1;
-  }
-  if (recv_type != NULL && recv_type->is_primitive_type()) {
-    return false; // Receiver should be an oop.
-  }
-  for (int i = 0; i < arg_count; i++) {
-    if (!check_type(symbolic_sig->type_at(sbase + i), resolved_sig->type_at(rbase + i))) {
-      return false; // Argument size or type mismatch encountered.
-    }
-  }
-  return true;
-}
-
-static bool is_call_consistent_with_jvms(JVMState* jvms, CallGenerator* cg) {
+static bool check_call_consistency(JVMState* jvms, CallGenerator* cg) {
   ciMethod* symbolic_info = jvms->method()->get_method_at_bci(jvms->bci());
   ciMethod* resolved_method = cg->method();
-
-  if (CallGenerator::is_inlined_mh_linker(jvms, resolved_method)) {
-    return check_inlined_mh_linker_info(symbolic_info, resolved_method);
-  } else {
-    // Method name & descriptor should stay the same.
-    return (symbolic_info->get_Method()->name() == resolved_method->get_Method()->name()) &&
-           (symbolic_info->get_Method()->signature() == resolved_method->get_Method()->signature());
-  }
-}
-
-static bool check_call_consistency(JVMState* jvms, CallGenerator* cg) {
-  if (!is_call_consistent_with_jvms(jvms, cg)) {
+  if (!ciMethod::is_consistent_info(symbolic_info, resolved_method)) {
     tty->print_cr("JVMS:");
     jvms->dump();
     tty->print_cr("Bytecode info:");
diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp
index 169146a..1f13554 100644
--- a/hotspot/src/share/vm/opto/ifnode.cpp
+++ b/hotspot/src/share/vm/opto/ifnode.cpp
@@ -249,6 +249,13 @@
       predicate_proj = proj;
     }
   }
+
+  // If all the defs of the phi are the same constant, we already have the desired end state.
+  // Skip the split that would create empty phi and region nodes.
+  if((r->req() - req_c) == 1) {
+    return NULL;
+  }
+
   if (nb_predicate_proj > 1) {
     // Can happen in case of loop unswitching and when the loop is
     // optimized out: it's not a loop anymore so we don't care about
@@ -1458,8 +1465,9 @@
   // be skipped. For example, range check predicate has two checks
   // for lower and upper bounds.
   ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj();
-  if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL)
-   prev_dom = idom;
+  if ((unc_proj != NULL) && (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL)) {
+    prev_dom = idom;
+  }
 
   // Now walk the current IfNode's projections.
   // Loop ends when 'this' has no more uses.
diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp
index 87d6d92..0cad4dc 100644
--- a/hotspot/src/share/vm/opto/lcm.cpp
+++ b/hotspot/src/share/vm/opto/lcm.cpp
@@ -254,10 +254,12 @@
       const TypePtr *adr_type = NULL;  // Do not need this return value here
       const Node* base = mach->get_base_and_disp(offset, adr_type);
       if (base == NULL || base == NodeSentinel) {
-        // Narrow oop address doesn't have base, only index
-        if( val->bottom_type()->isa_narrowoop() &&
-            MacroAssembler::needs_explicit_null_check(offset) )
-          continue;             // Give up if offset is beyond page size
+        // Narrow oop address doesn't have base, only index.
+        // Give up if offset is beyond page size or if heap base is not protected.
+        if (val->bottom_type()->isa_narrowoop() &&
+            (MacroAssembler::needs_explicit_null_check(offset) ||
+             !Universe::narrow_oop_use_implicit_null_checks()))
+          continue;
         // cannot reason about it; is probably not implicit null exception
       } else {
         const TypePtr* tptr;
@@ -269,12 +271,17 @@
           // only regular oops are expected here
           tptr = base->bottom_type()->is_ptr();
         }
-        // Give up if offset is not a compile-time constant
-        if( offset == Type::OffsetBot || tptr->_offset == Type::OffsetBot )
+        // Give up if offset is not a compile-time constant.
+        if (offset == Type::OffsetBot || tptr->_offset == Type::OffsetBot)
           continue;
         offset += tptr->_offset; // correct if base is offseted
-        if( MacroAssembler::needs_explicit_null_check(offset) )
-          continue;             // Give up is reference is beyond 4K page size
+        // Give up if reference is beyond page size.
+        if (MacroAssembler::needs_explicit_null_check(offset))
+          continue;
+        // Give up if base is a decode node and the heap base is not protected.
+        if (base->is_Mach() && base->as_Mach()->ideal_Opcode() == Op_DecodeN &&
+            !Universe::narrow_oop_use_implicit_null_checks())
+          continue;
       }
     }
 
diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp
index 5d837d6..e1e1c9f 100644
--- a/hotspot/src/share/vm/opto/library_call.cpp
+++ b/hotspot/src/share/vm/opto/library_call.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -277,7 +277,8 @@
   AllocateArrayNode* tightly_coupled_allocation(Node* ptr,
                                                 RegionNode* slow_region);
   JVMState* arraycopy_restore_alloc_state(AllocateArrayNode* alloc, int& saved_reexecute_sp);
-  void arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp);
+  void arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp,
+                                      uint new_idx);
 
   typedef enum { LS_get_add, LS_get_set, LS_cmp_swap, LS_cmp_swap_weak, LS_cmp_exchange } LoadStoreKind;
   MemNode::MemOrd access_kind_to_memord_LS(AccessKind access_kind, bool is_store);
@@ -1667,6 +1668,9 @@
   }
 
   Node* adr = array_element_address(value, index, T_CHAR);
+  if (adr->is_top()) {
+    return false;
+  }
   if (is_store) {
     (void) store_to_memory(control(), adr, ch, T_CHAR, TypeAryPtr::BYTES, MemNode::unordered,
                            false, false, true /* mismatched */);
@@ -2371,10 +2375,10 @@
   // the barriers get omitted and the unsafe reference begins to "pollute"
   // the alias analysis of the rest of the graph, either Compile::can_alias
   // or Compile::must_alias will throw a diagnostic assert.)
-  bool need_mem_bar;
+  bool need_mem_bar = false;
   switch (kind) {
       case Relaxed:
-          need_mem_bar = mismatched || can_access_non_heap;
+          need_mem_bar = mismatched && !adr_type->isa_aryptr();
           break;
       case Opaque:
           // Opaque uses CPUOrder membars for protection against code movement.
@@ -3017,7 +3021,7 @@
       load_store = _gvn.transform(new DecodeNNode(load_store, load_store->get_ptr_type()));
     }
 #endif
-    if (can_move_pre_barrier()) {
+    if (can_move_pre_barrier() && kind == LS_get_set) {
       // Don't need to load pre_val. The old value is returned by load_store.
       // The pre_barrier can execute after the xchg as long as no safepoint
       // gets inserted between them.
@@ -4882,7 +4886,8 @@
 // deoptimize. This is possible because tightly_coupled_allocation()
 // guarantees there's no observer of the allocated array at this point
 // and the control flow is simple enough.
-void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp) {
+void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms,
+                                                    int saved_reexecute_sp, uint new_idx) {
   if (saved_jvms != NULL && !stopped()) {
     assert(alloc != NULL, "only with a tightly coupled allocation");
     // restore JVM state to the state at the arraycopy
@@ -4891,7 +4896,7 @@
     assert(saved_jvms->map()->i_o() == map()->i_o(), "IO state changed?");
     // If we've improved the types of some nodes (null check) while
     // emitting the guards, propagate them to the current state
-    map()->replaced_nodes().apply(saved_jvms->map());
+    map()->replaced_nodes().apply(saved_jvms->map(), new_idx);
     set_jvms(saved_jvms);
     _reexecute_sp = saved_reexecute_sp;
 
@@ -4949,6 +4954,7 @@
   Node* dest_offset = argument(3);  // type: int
   Node* length      = argument(4);  // type: int
 
+  uint new_idx = C->unique();
 
   // Check for allocation before we add nodes that would confuse
   // tightly_coupled_allocation()
@@ -5164,7 +5170,7 @@
     }
   }
 
-  arraycopy_move_allocation_here(alloc, dest, saved_jvms, saved_reexecute_sp);
+  arraycopy_move_allocation_here(alloc, dest, saved_jvms, saved_reexecute_sp, new_idx);
 
   if (stopped()) {
     return true;
diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp
index d35d71a..7590ba6 100644
--- a/hotspot/src/share/vm/opto/loopTransform.cpp
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp
@@ -3174,6 +3174,11 @@
     return false;
   }
 
+  Node* exit = head->loopexit()->proj_out(0);
+  if (exit == NULL) {
+    return false;
+  }
+
 #ifndef PRODUCT
   if (TraceLoopOpts) {
     tty->print("ArrayFill    ");
@@ -3281,7 +3286,6 @@
 */
 
   // Redirect the old control and memory edges that are outside the loop.
-  Node* exit = head->loopexit()->proj_out(0);
   // Sometimes the memory phi of the head is used as the outgoing
   // state of the loop.  It's safe in this case to replace it with the
   // result_mem.
diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp
index be1d82d..35d099b 100644
--- a/hotspot/src/share/vm/opto/parse1.cpp
+++ b/hotspot/src/share/vm/opto/parse1.cpp
@@ -1086,7 +1086,7 @@
         kit.make_dtrace_method_exit(method());
       }
       if (_replaced_nodes_for_exceptions) {
-        kit.map()->apply_replaced_nodes();
+        kit.map()->apply_replaced_nodes(_new_idx);
       }
       // Done with exception-path processing.
       ex_map = kit.make_exception_state(ex_oop);
@@ -1107,7 +1107,7 @@
       _exits.add_exception_state(ex_map);
     }
   }
-  _exits.map()->apply_replaced_nodes();
+  _exits.map()->apply_replaced_nodes(_new_idx);
 }
 
 //-----------------------------create_entry_map-------------------------------
diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp
index c8553ce..5153876 100644
--- a/hotspot/src/share/vm/opto/parse2.cpp
+++ b/hotspot/src/share/vm/opto/parse2.cpp
@@ -826,6 +826,9 @@
     ciMethodData* methodData = method()->method_data();
     if (!methodData->is_mature())  return PROB_UNKNOWN;
     ciProfileData* data = methodData->bci_to_data(bci());
+    if (data == NULL) {
+      return PROB_UNKNOWN;
+    }
     if (!data->is_JumpData())  return PROB_UNKNOWN;
 
     // get taken and not taken values
@@ -917,8 +920,8 @@
         // of the OSR-ed method, and we want to deopt to gather more stats.
         // If you have ANY counts, then this loop is simply 'cold' relative
         // to the OSR loop.
-        if (data->as_BranchData()->taken() +
-            data->as_BranchData()->not_taken() == 0 ) {
+        if (data == NULL ||
+            (data->as_BranchData()->taken() +  data->as_BranchData()->not_taken() == 0)) {
           // This is the only way to return PROB_UNKNOWN:
           return PROB_UNKNOWN;
         }
diff --git a/hotspot/src/share/vm/opto/replacednodes.cpp b/hotspot/src/share/vm/opto/replacednodes.cpp
index e3f3c11..68928fc 100644
--- a/hotspot/src/share/vm/opto/replacednodes.cpp
+++ b/hotspot/src/share/vm/opto/replacednodes.cpp
@@ -92,13 +92,17 @@
 }
 
 // Perfom node replacement (used when returning to caller)
-void ReplacedNodes::apply(Node* n) {
+void ReplacedNodes::apply(Node* n, uint idx) {
   if (is_empty()) {
     return;
   }
   for (int i = 0; i < _replaced_nodes->length(); i++) {
     ReplacedNode replaced = _replaced_nodes->at(i);
-    n->replace_edge(replaced.initial(), replaced.improved());
+    // Only apply if improved node was created in a callee to avoid
+    // issues with irreducible loops in the caller
+    if (replaced.improved()->_idx >= idx) {
+      n->replace_edge(replaced.initial(), replaced.improved());
+    }
   }
 }
 
diff --git a/hotspot/src/share/vm/opto/replacednodes.hpp b/hotspot/src/share/vm/opto/replacednodes.hpp
index 0f68fe9..3c31d0d 100644
--- a/hotspot/src/share/vm/opto/replacednodes.hpp
+++ b/hotspot/src/share/vm/opto/replacednodes.hpp
@@ -71,7 +71,7 @@
   void record(Node* initial, Node* improved);
   void transfer_from(const ReplacedNodes& other, uint idx);
   void reset();
-  void apply(Node* n);
+  void apply(Node* n, uint idx);
   void merge_with(const ReplacedNodes& other);
   bool is_empty() const;
   void dump(outputStream *st) const;
diff --git a/hotspot/src/share/vm/opto/stringopts.cpp b/hotspot/src/share/vm/opto/stringopts.cpp
index 85151b0b..889353d 100644
--- a/hotspot/src/share/vm/opto/stringopts.cpp
+++ b/hotspot/src/share/vm/opto/stringopts.cpp
@@ -891,8 +891,9 @@
       ctrl_path.push(cn);
       ctrl_path.push(cn->proj_out(0));
       ctrl_path.push(cn->proj_out(0)->unique_out());
-      if (cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0) != NULL) {
-        ctrl_path.push(cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0));
+      Node* catchproj = cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0);
+      if (catchproj != NULL) {
+        ctrl_path.push(catchproj);
       }
     } else {
       ShouldNotReachHere();
diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp
index a8c6800..6411307 100644
--- a/hotspot/src/share/vm/opto/type.cpp
+++ b/hotspot/src/share/vm/opto/type.cpp
@@ -373,7 +373,7 @@
   if (con_type != NULL && field->is_call_site_target()) {
     ciCallSite* call_site = holder->as_call_site();
     if (!call_site->is_constant_call_site()) {
-      ciMethodHandle* target = call_site->get_target();
+      ciMethodHandle* target = con.as_object()->as_method_handle();
       Compile::current()->dependencies()->assert_call_site_target_value(call_site, target);
     }
   }
diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp
index f519e5e..acda4432 100644
--- a/hotspot/src/share/vm/prims/jni.cpp
+++ b/hotspot/src/share/vm/prims/jni.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -935,8 +935,7 @@
   inline void get_long()   { _arguments->push_long(va_arg(_ap, jlong)); }
   inline void get_float()  { _arguments->push_float((jfloat)va_arg(_ap, jdouble)); } // float is coerced to double w/ va_arg
   inline void get_double() { _arguments->push_double(va_arg(_ap, jdouble)); }
-  inline void get_object() { jobject l = va_arg(_ap, jobject);
-                             _arguments->push_oop(Handle((oop *)l, false)); }
+  inline void get_object() { _arguments->push_jobject(va_arg(_ap, jobject)); }
 
   inline void set_ap(va_list rap) {
     va_copy(_ap, rap);
@@ -1025,7 +1024,7 @@
   inline void get_long()   { _arguments->push_long((_ap++)->j);  }
   inline void get_float()  { _arguments->push_float((_ap++)->f); }
   inline void get_double() { _arguments->push_double((_ap++)->d);}
-  inline void get_object() { _arguments->push_oop(Handle((oop *)(_ap++)->l, false)); }
+  inline void get_object() { _arguments->push_jobject((_ap++)->l); }
 
   inline void set_ap(const jvalue *rap) { _ap = rap; }
 
diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
index 2955463..71b0ea3 100644
--- a/hotspot/src/share/vm/prims/jvm.cpp
+++ b/hotspot/src/share/vm/prims/jvm.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -684,7 +684,7 @@
       // This can safepoint and redefine method, so need both new_obj and method
       // in a handle, for two different reasons.  new_obj can move, method can be
       // deleted if nothing is using it on the stack.
-      m->method_holder()->add_member_name(new_obj());
+      m->method_holder()->add_member_name(new_obj(), false);
     }
   }
 
diff --git a/hotspot/src/share/vm/prims/jvmti.xml b/hotspot/src/share/vm/prims/jvmti.xml
index 7a0515c..e7d02cc 100644
--- a/hotspot/src/share/vm/prims/jvmti.xml
+++ b/hotspot/src/share/vm/prims/jvmti.xml
@@ -1486,6 +1486,10 @@
       <description>
         Get the current thread.  
         The current thread is the Java programming language thread which has called the function.
+        The function may return <code>NULL</code> in the start phase if the
+        <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
+        <code>can_generate_early_vmstart</code></internallink> capability is enabled
+        and the <code>java.lang.Thread</code> class has not been initialized yet.
         <p/>
         Note that most <jvmti/> functions that take a thread 
         as an argument will accept <code>NULL</code> to mean 
@@ -1498,7 +1502,7 @@
         <param id="thread_ptr">
 	  <outptr><jthread/></outptr>
 	  <description>
-	     On return, points to the current thread.
+	     On return, points to the current thread, or <code>NULL</code>.
 	  </description>
 	</param>
       </parameters>
@@ -6512,7 +6516,7 @@
     <function id="GetNamedModule" num="40" since="9">
       <synopsis>Get Named Module</synopsis>
       <description>
-        Return the <code>java.lang.reflect.Module</code> object for a named
+        Return the <code>java.lang.Module</code> object for a named
         module defined to a class loader that contains a given package.
         The module is returned via <code>module_ptr</code>.
         <p/>
@@ -6550,7 +6554,7 @@
         <param id="module_ptr">
           <outptr><jobject/></outptr>
           <description>
-            On return, points to a <code>java.lang.reflect.Module</code> object
+            On return, points to a <code>java.lang.Module</code> object
             or points to <code>NULL</code>.
           </description>
         </param>
@@ -6595,6 +6599,10 @@
         <error id="JVMTI_ERROR_INVALID_MODULE">
           If <paramlink id="to_module"></paramlink> is not a module object.
         </error>
+        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+          if the module cannot be modified.
+          See <functionlink id="IsModifiableModule"/>.
+        </error>
       </errors>
     </function>
 
@@ -6629,7 +6637,7 @@
           <description>
             The module the package is exported to.
             If the <code>to_module</code> is not a subclass of
-            <code>java.lang.reflect.Module</code> this function returns
+            <code>java.lang.Module</code> this function returns
             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
           </description>
         </param>
@@ -6645,6 +6653,10 @@
           If the package <paramlink id="pkg_name"></paramlink>
           does not belong to the module.
         </error>
+        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+          if the module cannot be modified.
+          See <functionlink id="IsModifiableModule"/>.
+        </error>
       </errors>
     </function>
 
@@ -6680,7 +6692,7 @@
           <description>
             The module with the package to open.
             If the <code>to_module</code> is not a subclass of
-            <code>java.lang.reflect.Module</code> this function returns
+            <code>java.lang.Module</code> this function returns
             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
           </description>
         </param>
@@ -6696,6 +6708,10 @@
           If the package <paramlink id="pkg_name"></paramlink>
           does not belong to the module.
         </error>
+        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+          if the module cannot be modified.
+          See <functionlink id="IsModifiableModule"/>.
+        </error>
       </errors>
     </function>
 
@@ -6733,6 +6749,10 @@
         <error id="JVMTI_ERROR_INVALID_CLASS">
           If <paramlink id="service"></paramlink> is not a class object.
         </error>
+        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+          if the module cannot be modified.
+          See <functionlink id="IsModifiableModule"/>.
+        </error>
       </errors>
     </function>
 
@@ -6779,6 +6799,44 @@
         <error id="JVMTI_ERROR_INVALID_CLASS">
           If <paramlink id="impl_class"></paramlink> is not a class object.
         </error>
+        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+          if the module cannot be modified.
+          See <functionlink id="IsModifiableModule"/>.
+        </error>
+      </errors>
+    </function>
+
+    <function id="IsModifiableModule" num="99" since="9">
+      <synopsis>Is Modifiable Module</synopsis>
+      <description>
+        Determines whether a module is modifiable.
+        If a module is modifiable then this module can be updated with
+        <functionlink id="AddModuleReads"/>, <functionlink id="AddModuleExports"/>,
+        <functionlink id="AddModuleOpens"/>, <functionlink id="AddModuleUses"/>,
+        and <functionlink id="AddModuleProvides"/>. If a module is not modifiable
+        then the module can not be updated with these functions.
+      </description>
+      <origin>new</origin>
+      <capabilities>
+      </capabilities>
+      <parameters>
+        <param id="module">
+          <ptrtype><jobject/></ptrtype>
+          <description>
+            The module to query.
+          </description>
+        </param>
+        <param id="is_modifiable_module_ptr">
+          <outptr><jboolean/></outptr>
+          <description>
+            On return, points to the boolean result of this function.
+          </description>
+        </param>
+      </parameters>
+      <errors>
+        <error id="JVMTI_ERROR_INVALID_MODULE">
+          If <paramlink id="module"></paramlink> is not a module object.
+        </error>
       </errors>
     </function>
 
@@ -7799,6 +7857,10 @@
 	  A method in the new class version has different modifiers
 	  than its counterpart in the old class version.
 	</error>
+        <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+          A module cannot be modified.
+          See <functionlink id="IsModifiableModule"/>.
+        </error>
       </errors>
     </function>
 
@@ -11563,6 +11625,9 @@
     <errorid id="JVMTI_ERROR_UNMODIFIABLE_CLASS" num="79">
       The class cannot be modified.
     </errorid>
+    <errorid id="JVMTI_ERROR_UNMODIFIABLE_MODULE" num="80">
+      The module cannot be modified.
+    </errorid>
     <errorid id="JVMTI_ERROR_NOT_AVAILABLE" num="98">
       The functionality is not available in this virtual machine.
     </errorid>
@@ -14732,9 +14797,15 @@
        - Add new functions:
           - GetAllModules
           - AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides
+          - IsModifiableModule
       Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to
       disallow some implementation defined classes.
   </change>
+  <change date="12 February 2017" version="9.0.0">
+      Minor update for GetCurrentThread function:
+       - The function may return NULL in the start phase if the
+         can_generate_early_vmstart capability is enabled.
+  </change>
 </changehistory>
 
 </specification>
diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp
index f9dc315..491eedd 100644
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -235,12 +235,12 @@
 
   // check module
   Handle h_module(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_instance(h_module())) {
+  if (!java_lang_Module::is_instance(h_module())) {
     return JVMTI_ERROR_INVALID_MODULE;
   }
   // check to_module
   Handle h_to_module(THREAD, JNIHandles::resolve(to_module));
-  if (!java_lang_reflect_Module::is_instance(h_to_module())) {
+  if (!java_lang_Module::is_instance(h_to_module())) {
     return JVMTI_ERROR_INVALID_MODULE;
   }
   return JvmtiExport::add_module_reads(h_module, h_to_module, THREAD);
@@ -257,12 +257,12 @@
 
   // check module
   Handle h_module(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_instance(h_module())) {
+  if (!java_lang_Module::is_instance(h_module())) {
     return JVMTI_ERROR_INVALID_MODULE;
   }
   // check to_module
   Handle h_to_module(THREAD, JNIHandles::resolve(to_module));
-  if (!java_lang_reflect_Module::is_instance(h_to_module())) {
+  if (!java_lang_Module::is_instance(h_to_module())) {
     return JVMTI_ERROR_INVALID_MODULE;
   }
   return JvmtiExport::add_module_exports(h_module, h_pkg, h_to_module, THREAD);
@@ -279,12 +279,12 @@
 
   // check module
   Handle h_module(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_instance(h_module())) {
+  if (!java_lang_Module::is_instance(h_module())) {
     return JVMTI_ERROR_INVALID_MODULE;
   }
   // check to_module
   Handle h_to_module(THREAD, JNIHandles::resolve(to_module));
-  if (!java_lang_reflect_Module::is_instance(h_to_module())) {
+  if (!java_lang_Module::is_instance(h_to_module())) {
     return JVMTI_ERROR_INVALID_MODULE;
   }
   return JvmtiExport::add_module_opens(h_module, h_pkg, h_to_module, THREAD);
@@ -299,7 +299,7 @@
 
   // check module
   Handle h_module(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_instance(h_module())) {
+  if (!java_lang_Module::is_instance(h_module())) {
     return JVMTI_ERROR_INVALID_MODULE;
   }
   // check service
@@ -321,7 +321,7 @@
 
   // check module
   Handle h_module(THREAD, JNIHandles::resolve(module));
-  if (!java_lang_reflect_Module::is_instance(h_module())) {
+  if (!java_lang_Module::is_instance(h_module())) {
     return JVMTI_ERROR_INVALID_MODULE;
   }
   // check service
@@ -339,6 +339,22 @@
   return JvmtiExport::add_module_provides(h_module, h_service, h_impl_class, THREAD);
 } /* end AddModuleProvides */
 
+// module - pre-checked for NULL
+// is_modifiable_class_ptr - pre-checked for NULL
+jvmtiError
+JvmtiEnv::IsModifiableModule(jobject module, jboolean* is_modifiable_module_ptr) {
+  JavaThread* THREAD = JavaThread::current();
+
+  // check module
+  Handle h_module(THREAD, JNIHandles::resolve(module));
+  if (!java_lang_Module::is_instance(h_module())) {
+    return JVMTI_ERROR_INVALID_MODULE;
+  }
+
+  *is_modifiable_module_ptr = JNI_TRUE;
+  return JVMTI_ERROR_NONE;
+} /* end IsModifiableModule */
+
 
   //
   // Class functions
@@ -1796,6 +1812,13 @@
     }
   }
 
+  if (initial_object != NULL) {
+    oop init_obj = JNIHandles::resolve_external_guard(initial_object);
+    if (init_obj == NULL) {
+      return JVMTI_ERROR_INVALID_OBJECT;
+    }
+  }
+
   Thread *thread = Thread::current();
   HandleMark hm(thread);
   KlassHandle kh (thread, k_oop);
diff --git a/hotspot/src/share/vm/prims/jvmtiExport.cpp b/hotspot/src/share/vm/prims/jvmtiExport.cpp
index 52350da..ad7984c 100644
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1230,8 +1230,12 @@
     assert(thread->is_VM_thread(), "wrong thread");
 
     // get JavaThread for whom we are proxy
-    JavaThread *real_thread =
-        (JavaThread *)((VMThread *)thread)->vm_operation()->calling_thread();
+    Thread *calling_thread = ((VMThread *)thread)->vm_operation()->calling_thread();
+    if (!calling_thread->is_Java_thread()) {
+      // cannot post an event to a non-JavaThread
+      return;
+    }
+    JavaThread *real_thread = (JavaThread *)calling_thread;
 
     JvmtiEnvIterator it;
     for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
index b2cf566..e90420d 100644
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,7 @@
 #include "services/serviceUtil.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/parallel/parallelScavengeHeap.hpp"
 #endif // INCLUDE_ALL_GCS
 
@@ -1534,6 +1535,14 @@
       if (_tags[i] == entry->tag()) {
         oop o = entry->object();
         assert(o != NULL && Universe::heap()->is_in_reserved(o), "sanity check");
+#if INCLUDE_ALL_GCS
+        if (UseG1GC) {
+          // The reference in this tag map could be the only (implicitly weak)
+          // reference to that object. If we hand it out, we need to keep it live wrt
+          // SATB marking similar to other j.l.ref.Reference referents.
+          G1SATBCardTableModRefBS::enqueue(o);
+        }
+#endif
         jobject ref = JNIHandles::make_local(JavaThread::current(), o);
         _object_results->append(ref);
         _tag_results->append((uint64_t)entry->tag());
diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp
index 717c1fe..c25b306 100644
--- a/hotspot/src/share/vm/prims/methodHandles.cpp
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -176,7 +176,7 @@
   return NULL;
 }
 
-oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
+oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info, bool intern) {
   assert(info.resolved_appendix().is_null(), "only normal methods here");
   methodHandle m = info.resolved_method();
   assert(m.not_null(), "null method handle");
@@ -277,13 +277,7 @@
   // If relevant, the vtable or itable value is stored as vmindex.
   // This is done eagerly, since it is readily available without
   // constructing any new objects.
-  // TO DO: maybe intern mname_oop
-  if (m->method_holder()->add_member_name(mname)) {
-    return mname();
-  } else {
-    // Redefinition caused this to fail.  Return NULL (and an exception?)
-    return NULL;
-  }
+  return m->method_holder()->add_member_name(mname, intern);
 }
 
 oop MethodHandles::init_field_MemberName(Handle mname, fieldDescriptor& fd, bool is_setter) {
@@ -973,7 +967,9 @@
         if (!java_lang_invoke_MemberName::is_instance(result()))
           return -99;  // caller bug!
         CallInfo info(m);
-        oop saved = MethodHandles::init_method_MemberName(result, info);
+        // Since this is going through the methods to create MemberNames, don't search
+        // for matching methods already in the table
+        oop saved = MethodHandles::init_method_MemberName(result, info, /*intern*/false);
         if (saved != result())
           results->obj_at_put(rfill-1, saved);  // show saved instance to user
       } else if (++overflow >= overflow_limit) {
@@ -1054,9 +1050,34 @@
   }
 }
 
-void MemberNameTable::add_member_name(jweak mem_name_wref) {
+oop MemberNameTable::add_member_name(jweak mem_name_wref) {
   assert_locked_or_safepoint(MemberNameTable_lock);
   this->push(mem_name_wref);
+  return JNIHandles::resolve(mem_name_wref);
+}
+
+oop MemberNameTable::find_or_add_member_name(jweak mem_name_wref) {
+  assert_locked_or_safepoint(MemberNameTable_lock);
+  oop new_mem_name = JNIHandles::resolve(mem_name_wref);
+
+  // Find matching member name in the list.
+  // This is linear because these are short lists.
+  int len = this->length();
+  int new_index = len;
+  for (int idx = 0; idx < len; idx++) {
+    oop mname = JNIHandles::resolve(this->at(idx));
+    if (mname == NULL) {
+      new_index = idx;
+      continue;
+    }
+    if (java_lang_invoke_MemberName::equals(new_mem_name, mname)) {
+      JNIHandles::destroy_weak_global(mem_name_wref);
+      return mname;
+    }
+  }
+  // Not found, push the new one, or reuse empty slot
+  this->at_put_grow(new_index, mem_name_wref);
+  return new_mem_name;
 }
 
 #if INCLUDE_JVMTI
@@ -1208,9 +1229,10 @@
     if (reference_klass != NULL && reference_klass->is_instance_klass()) {
       // Emulate LinkResolver::check_klass_accessability.
       Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh));
-      if (Reflection::verify_class_access(caller,
-                                          reference_klass,
-                                          true) != Reflection::ACCESS_OK) {
+      if (caller != SystemDictionary::Object_klass()
+          && Reflection::verify_class_access(caller,
+                                             reference_klass,
+                                             true) != Reflection::ACCESS_OK) {
         THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), reference_klass->external_name());
       }
     }
diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp
index 4a82546..3a5e903 100644
--- a/hotspot/src/share/vm/prims/methodHandles.hpp
+++ b/hotspot/src/share/vm/prims/methodHandles.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@
   static Handle new_MemberName(TRAPS);  // must be followed by init_MemberName
   static oop init_MemberName(Handle mname_h, Handle target_h); // compute vmtarget/vmindex from target
   static oop init_field_MemberName(Handle mname_h, fieldDescriptor& fd, bool is_setter = false);
-  static oop init_method_MemberName(Handle mname_h, CallInfo& info);
+  static oop init_method_MemberName(Handle mname_h, CallInfo& info, bool intern = true);
   static int method_ref_kind(Method* m, bool do_dispatch_if_possible = true);
   static int find_MemberNames(KlassHandle k, Symbol* name, Symbol* sig,
                               int mflags, KlassHandle caller,
@@ -235,7 +235,8 @@
  public:
   MemberNameTable(int methods_cnt);
   ~MemberNameTable();
-  void add_member_name(jweak mem_name_ref);
+  oop add_member_name(jweak mem_name_ref);
+  oop find_or_add_member_name(jweak mem_name_ref);
 
 #if INCLUDE_JVMTI
   // RedefineClasses() API support:
diff --git a/hotspot/src/share/vm/prims/stackwalk.cpp b/hotspot/src/share/vm/prims/stackwalk.cpp
index e130127..9e3fc9a 100644
--- a/hotspot/src/share/vm/prims/stackwalk.cpp
+++ b/hotspot/src/share/vm/prims/stackwalk.cpp
@@ -173,7 +173,11 @@
   }
 }
 
-oop LiveFrameStream::create_primitive_value_instance(StackValueCollection* values, int i, TRAPS) {
+// Create and return a LiveStackFrame.PrimitiveSlot (if needed) for the
+// StackValue at the given index. 'type' is expected to be T_INT, T_LONG,
+// T_OBJECT, or T_CONFLICT.
+oop LiveFrameStream::create_primitive_slot_instance(StackValueCollection* values,
+                                                    int i, BasicType type, TRAPS) {
   Klass* k = SystemDictionary::resolve_or_null(vmSymbols::java_lang_LiveStackFrameInfo(), CHECK_NULL);
   instanceKlassHandle ik (THREAD, k);
 
@@ -182,8 +186,8 @@
   Symbol* signature = NULL;
 
   // ## TODO: type is only available in LocalVariable table, if present.
-  // ## StackValue type is T_INT or T_OBJECT.
-  switch (values->at(i)->type()) {
+  // ## StackValue type is T_INT or T_OBJECT (or converted to T_LONG on 64-bit)
+  switch (type) {
     case T_INT:
       args.push_int(values->int_at(i));
       signature = vmSymbols::asPrimitive_int_signature();
@@ -195,42 +199,26 @@
       break;
 
     case T_FLOAT:
-      args.push_float(values->float_at(i));
-      signature = vmSymbols::asPrimitive_float_signature();
-      break;
-
     case T_DOUBLE:
-      args.push_double(values->double_at(i));
-      signature = vmSymbols::asPrimitive_double_signature();
-      break;
-
     case T_BYTE:
-      args.push_int(values->int_at(i));
-      signature = vmSymbols::asPrimitive_byte_signature();
-      break;
-
     case T_SHORT:
-      args.push_int(values->int_at(i));
-      signature = vmSymbols::asPrimitive_short_signature();
-      break;
-
     case T_CHAR:
-      args.push_int(values->int_at(i));
-      signature = vmSymbols::asPrimitive_char_signature();
-      break;
-
     case T_BOOLEAN:
-      args.push_int(values->int_at(i));
-      signature = vmSymbols::asPrimitive_boolean_signature();
-      break;
+      THROW_MSG_(vmSymbols::java_lang_InternalError(), "Unexpected StackValue type", NULL);
 
     case T_OBJECT:
       return values->obj_at(i)();
 
     case T_CONFLICT:
       // put a non-null slot
-      args.push_int(0);
-      signature = vmSymbols::asPrimitive_int_signature();
+      #ifdef _LP64
+        args.push_long(0);
+        signature = vmSymbols::asPrimitive_long_signature();
+      #else
+        args.push_int(0);
+        signature = vmSymbols::asPrimitive_int_signature();
+      #endif
+
       break;
 
     default: ShouldNotReachHere();
@@ -252,9 +240,19 @@
   objArrayHandle array_h(THREAD, array_oop);
   for (int i = 0; i < values->size(); i++) {
     StackValue* st = values->at(i);
-    oop obj = create_primitive_value_instance(values, i, CHECK_(empty));
-    if (obj != NULL)
+    BasicType type = st->type();
+    int index = i;
+#ifdef _LP64
+    if (type != T_OBJECT && type != T_CONFLICT) {
+        intptr_t ret = st->get_int(); // read full 64-bit slot
+        type = T_LONG;                // treat as long
+        index--;                      // undo +1 in StackValueCollection::long_at
+    }
+#endif
+    oop obj = create_primitive_slot_instance(values, index, type, CHECK_(empty));
+    if (obj != NULL) {
       array_h->obj_at_put(i, obj);
+    }
   }
   return array_h;
 }
@@ -286,6 +284,13 @@
     StackValueCollection* expressions = _jvf->expressions();
     GrowableArray<MonitorInfo*>* monitors = _jvf->monitors();
 
+    int mode = 0;
+    if (_jvf->is_interpreted_frame()) {
+      mode = MODE_INTERPRETED;
+    } else if (_jvf->is_compiled_frame()) {
+      mode = MODE_COMPILED;
+    }
+
     if (!locals->is_empty()) {
       objArrayHandle locals_h = values_to_object_array(locals, CHECK);
       java_lang_LiveStackFrameInfo::set_locals(stackFrame(), locals_h());
@@ -298,6 +303,7 @@
       objArrayHandle monitors_h = monitors_to_object_array(monitors, CHECK);
       java_lang_LiveStackFrameInfo::set_monitors(stackFrame(), monitors_h());
     }
+    java_lang_LiveStackFrameInfo::set_mode(stackFrame(), mode);
   }
 }
 
diff --git a/hotspot/src/share/vm/prims/stackwalk.hpp b/hotspot/src/share/vm/prims/stackwalk.hpp
index 161a745..a0c4bed 100644
--- a/hotspot/src/share/vm/prims/stackwalk.hpp
+++ b/hotspot/src/share/vm/prims/stackwalk.hpp
@@ -92,11 +92,16 @@
 
 class LiveFrameStream : public BaseFrameStream {
 private:
+  enum {
+    MODE_INTERPRETED = 0x01,
+    MODE_COMPILED    = 0x02
+  };
+
   javaVFrame*           _jvf;
 
   void fill_live_stackframe(Handle stackFrame, const methodHandle& method, TRAPS);
-  static oop create_primitive_value_instance(StackValueCollection* values,
-                                             int i, TRAPS);
+  static oop create_primitive_slot_instance(StackValueCollection* values,
+                                            int i, BasicType type, TRAPS);
   static objArrayHandle monitors_to_object_array(GrowableArray<MonitorInfo*>* monitors,
                                                  TRAPS);
   static objArrayHandle values_to_object_array(StackValueCollection* values, TRAPS);
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index b57cb96..f45ae42 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -1894,6 +1894,11 @@
     if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) {
       FLAG_SET_DEFAULT(NewSizeThreadIncrease, 4*K);
     }
+    if (TieredStopAtLevel != CompLevel_full_optimization) {
+      // Currently JVMCI compiler can only work at the full optimization level
+      warning("forcing TieredStopAtLevel to full optimization because JVMCI is enabled");
+      TieredStopAtLevel = CompLevel_full_optimization;
+    }
     if (FLAG_IS_DEFAULT(TypeProfileLevel)) {
       FLAG_SET_DEFAULT(TypeProfileLevel, 0);
     }
@@ -2506,8 +2511,8 @@
     }
 #endif
   }
-#if INCLUDE_JVMCI
 
+#if INCLUDE_JVMCI
   status = status && check_jvmci_args_consistency();
 
   if (EnableJVMCI) {
@@ -2927,6 +2932,10 @@
       if (res != JNI_OK) {
         return res;
       }
+    } else if (match_option(option, "--permit-illegal-access")) {
+      if (!create_property("jdk.module.permitIllegalAccess", "true", ExternalProperty)) {
+        return JNI_ENOMEM;
+      }
     // -agentlib and -agentpath
     } else if (match_option(option, "-agentlib:", &tail) ||
           (is_absolute_path = match_option(option, "-agentpath:", &tail))) {
@@ -3169,6 +3178,7 @@
     // -Xprof
     } else if (match_option(option, "-Xprof")) {
 #if INCLUDE_FPROF
+      log_warning(arguments)("Option -Xprof was deprecated in version 9 and will likely be removed in a future release.");
       _has_profile = true;
 #else // INCLUDE_FPROF
       jio_fprintf(defaultStream::error_stream(),
@@ -3700,7 +3710,7 @@
 
 #if INCLUDE_JVMCI
   if (EnableJVMCI &&
-      !create_numbered_property("jdk.module.addmods", "jdk.vm.ci", addmods_count++)) {
+      !create_numbered_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) {
     return JNI_ENOMEM;
   }
 #endif
diff --git a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp
index abcf73c..9911ffb 100644
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.hpp b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.hpp
index 3bfb282..776685e 100644
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.hpp
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp
index e3b8864..cebdcfc 100644
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp
@@ -189,19 +189,6 @@
   assert(vf->is_compiled_frame(), "Wrong frame type");
   chunk->push(compiledVFrame::cast(vf));
 
-  ScopeDesc* trap_scope = chunk->at(0)->scope();
-  Handle exceptionObject;
-  if (trap_scope->rethrow_exception()) {
-    if (PrintDeoptimizationDetails) {
-      tty->print_cr("Exception to be rethrown in the interpreter for method %s::%s at bci %d", trap_scope->method()->method_holder()->name()->as_C_string(), trap_scope->method()->name()->as_C_string(), trap_scope->bci());
-    }
-    GrowableArray<ScopeValue*>* expressions = trap_scope->expressions();
-    guarantee(expressions != NULL && expressions->length() > 0, "must have exception to throw");
-    ScopeValue* topOfStack = expressions->top();
-    exceptionObject = StackValue::create_stack_value(&deoptee, &map, topOfStack)->get_obj();
-    assert(exceptionObject() != NULL, "exception oop can not be null");
-  }
-
   bool realloc_failures = false;
 
 #if defined(COMPILER2) || INCLUDE_JVMCI
@@ -221,8 +208,9 @@
       // It is not guaranteed that we can get such information here only
       // by analyzing bytecode in deoptimized frames. This is why this flag
       // is set during method compilation (see Compile::Process_OopMap_Node()).
-      // If the previous frame was popped, we don't have a result.
-      bool save_oop_result = chunk->at(0)->scope()->return_oop() && !thread->popframe_forcing_deopt_reexecution();
+      // If the previous frame was popped or if we are dispatching an exception,
+      // we don't have an oop result.
+      bool save_oop_result = chunk->at(0)->scope()->return_oop() && !thread->popframe_forcing_deopt_reexecution() && (exec_mode == Unpack_deopt);
       Handle return_value;
       if (save_oop_result) {
         // Reallocation may trigger GC. If deoptimization happened on return from
@@ -295,6 +283,19 @@
 #endif // INCLUDE_JVMCI
 #endif // COMPILER2 || INCLUDE_JVMCI
 
+  ScopeDesc* trap_scope = chunk->at(0)->scope();
+  Handle exceptionObject;
+  if (trap_scope->rethrow_exception()) {
+    if (PrintDeoptimizationDetails) {
+      tty->print_cr("Exception to be rethrown in the interpreter for method %s::%s at bci %d", trap_scope->method()->method_holder()->name()->as_C_string(), trap_scope->method()->name()->as_C_string(), trap_scope->bci());
+    }
+    GrowableArray<ScopeValue*>* expressions = trap_scope->expressions();
+    guarantee(expressions != NULL && expressions->length() > 0, "must have exception to throw");
+    ScopeValue* topOfStack = expressions->top();
+    exceptionObject = StackValue::create_stack_value(&deoptee, &map, topOfStack)->get_obj();
+    guarantee(exceptionObject() != NULL, "exception oop can not be null");
+  }
+
   // Ensure that no safepoint is taken after pointers have been stored
   // in fields of rematerialized objects.  If a safepoint occurs from here on
   // out the java state residing in the vframeArray will be missed.
@@ -1596,9 +1597,9 @@
       get_method_data(thread, profiled_method, create_if_missing);
 
     // Log a message
-    Events::log_deopt_message(thread, "Uncommon trap: reason=%s action=%s pc=" INTPTR_FORMAT " method=%s @ %d",
+    Events::log_deopt_message(thread, "Uncommon trap: reason=%s action=%s pc=" INTPTR_FORMAT " method=%s @ %d %s",
                               trap_reason_name(reason), trap_action_name(action), p2i(fr.pc()),
-                              trap_method->name_and_sig_as_C_string(), trap_bci);
+                              trap_method->name_and_sig_as_C_string(), trap_bci, nm->compiler_name());
 
     // Print a bunch of diagnostics, if requested.
     if (TraceDeoptimization || LogCompilation) {
@@ -1812,7 +1813,7 @@
     // aggressive optimization.
     bool inc_recompile_count = false;
     ProfileData* pdata = NULL;
-    if (ProfileTraps && update_trap_state && trap_mdo != NULL) {
+    if (ProfileTraps && !is_client_compilation_mode_vm() && update_trap_state && trap_mdo != NULL) {
       assert(trap_mdo == get_method_data(thread, profiled_method, false), "sanity");
       uint this_trap_count = 0;
       bool maybe_prior_trap = false;
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
index 90b274e..77acae0 100644
--- a/hotspot/src/share/vm/runtime/globals.hpp
+++ b/hotspot/src/share/vm/runtime/globals.hpp
@@ -657,14 +657,13 @@
           range(0, 99)                                                      \
                                                                             \
   product(bool, UseAES, false,                                              \
-          "Control whether AES instructions can be used on x86/x64")        \
+          "Control whether AES instructions are used when available")       \
                                                                             \
   product(bool, UseFMA, false,                                              \
-          "Control whether FMA instructions can be used")                   \
+          "Control whether FMA instructions are used when available")       \
                                                                             \
   product(bool, UseSHA, false,                                              \
-          "Control whether SHA instructions can be used "                   \
-          "on SPARC, on ARM and on x86")                                    \
+          "Control whether SHA instructions are used when available")       \
                                                                             \
   diagnostic(bool, UseGHASHIntrinsics, false,                               \
           "Use intrinsics for GHASH versions of crypto")                    \
@@ -1458,9 +1457,9 @@
           "Number of threads concurrent gc will use")                       \
           constraint(ConcGCThreadsConstraintFunc,AfterErgo)                 \
                                                                             \
-  product(uintx, GCTaskTimeStampEntries, 200,                               \
+  product(uint, GCTaskTimeStampEntries, 200,                                \
           "Number of time stamp entries per gc worker thread")              \
-          range(1, max_uintx)                                               \
+          range(1, max_jint)                                                \
                                                                             \
   product(bool, AlwaysTenure, false,                                        \
           "Always tenure objects in eden (ParallelGC only)")                \
@@ -3375,7 +3374,7 @@
           "Code cache expansion size (in bytes)")                           \
           range(0, max_uintx)                                               \
                                                                             \
-  develop_pd(uintx, CodeCacheMinBlockLength,                                \
+  diagnostic_pd(uintx, CodeCacheMinBlockLength,                             \
           "Minimum number of segments in a code cache block")               \
           range(1, 100)                                                     \
                                                                             \
diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp
index 0c7187c..9223f12 100644
--- a/hotspot/src/share/vm/runtime/java.cpp
+++ b/hotspot/src/share/vm/runtime/java.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -621,6 +621,13 @@
   }
 }
 
+void vm_exit_during_initialization() {
+  vm_notify_during_shutdown(NULL, NULL);
+
+  // Failure during initialization, we don't want to dump core
+  vm_abort(false);
+}
+
 void vm_exit_during_initialization(Handle exception) {
   tty->print_cr("Error occurred during initialization of VM");
   // If there are exceptions on this thread it must be cleared
diff --git a/hotspot/src/share/vm/runtime/java.hpp b/hotspot/src/share/vm/runtime/java.hpp
index e1e982e..3b3a714 100644
--- a/hotspot/src/share/vm/runtime/java.hpp
+++ b/hotspot/src/share/vm/runtime/java.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
 extern void notify_vm_shutdown();
 
 // VM exit if error occurs during initialization of VM
+extern void vm_exit_during_initialization();
 extern void vm_exit_during_initialization(Handle exception);
 extern void vm_exit_during_initialization(Symbol* exception_name, const char* message);
 extern void vm_exit_during_initialization(const char* error, const char* message = NULL);
diff --git a/hotspot/src/share/vm/runtime/javaCalls.cpp b/hotspot/src/share/vm/runtime/javaCalls.cpp
index 5874699..d91a32a 100644
--- a/hotspot/src/share/vm/runtime/javaCalls.cpp
+++ b/hotspot/src/share/vm/runtime/javaCalls.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -328,9 +328,9 @@
 // Verify the arguments
 
   if (CheckJNICalls)  {
-    args->verify(method, result->get_type(), thread);
+    args->verify(method, result->get_type());
   }
-  else debug_only(args->verify(method, result->get_type(), thread));
+  else debug_only(args->verify(method, result->get_type()));
 #if INCLUDE_JVMCI
   }
 #else
@@ -442,12 +442,43 @@
 //--------------------------------------------------------------------------------------
 // Implementation of JavaCallArguments
 
+inline bool is_value_state_indirect_oop(uint state) {
+  assert(state != JavaCallArguments::value_state_oop,
+         "Checking for handles after removal");
+  assert(state < JavaCallArguments::value_state_limit,
+         "Invalid value state %u", state);
+  return state != JavaCallArguments::value_state_primitive;
+}
+
+inline oop resolve_indirect_oop(intptr_t value, uint state) {
+  switch (state) {
+  case JavaCallArguments::value_state_handle:
+  {
+    oop* ptr = reinterpret_cast<oop*>(value);
+    return Handle::raw_resolve(ptr);
+  }
+
+  case JavaCallArguments::value_state_jobject:
+  {
+    jobject obj = reinterpret_cast<jobject>(value);
+    return JNIHandles::resolve(obj);
+  }
+
+  default:
+    ShouldNotReachHere();
+    return NULL;
+  }
+}
+
 intptr_t* JavaCallArguments::parameters() {
   // First convert all handles to oops
   for(int i = 0; i < _size; i++) {
-    if (_is_oop[i]) {
-      // Handle conversion
-      _value[i] = cast_from_oop<intptr_t>(Handle::raw_resolve((oop *)_value[i]));
+    uint state = _value_state[i];
+    assert(state != value_state_oop, "Multiple handle conversions");
+    if (is_value_state_indirect_oop(state)) {
+      oop obj = resolve_indirect_oop(_value[i], state);
+      _value[i] = cast_from_oop<intptr_t>(obj);
+      _value_state[i] = value_state_oop;
     }
   }
   // Return argument vector
@@ -457,30 +488,42 @@
 
 class SignatureChekker : public SignatureIterator {
  private:
-   bool *_is_oop;
-   int   _pos;
+   int _pos;
    BasicType _return_type;
-   intptr_t*   _value;
-   Thread* _thread;
+   u_char* _value_state;
+   intptr_t* _value;
 
  public:
   bool _is_return;
 
-  SignatureChekker(Symbol* signature, BasicType return_type, bool is_static, bool* is_oop, intptr_t* value, Thread* thread) : SignatureIterator(signature) {
-    _is_oop = is_oop;
-    _is_return = false;
-    _return_type = return_type;
-    _pos = 0;
-    _value = value;
-    _thread = thread;
-
+  SignatureChekker(Symbol* signature,
+                   BasicType return_type,
+                   bool is_static,
+                   u_char* value_state,
+                   intptr_t* value) :
+    SignatureIterator(signature),
+    _pos(0),
+    _return_type(return_type),
+    _value_state(value_state),
+    _value(value),
+    _is_return(false)
+  {
     if (!is_static) {
       check_value(true); // Receiver must be an oop
     }
   }
 
   void check_value(bool type) {
-    guarantee(_is_oop[_pos++] == type, "signature does not match pushed arguments");
+    uint state = _value_state[_pos++];
+    if (type) {
+      guarantee(is_value_state_indirect_oop(state),
+                "signature does not match pushed arguments: %u at %d",
+                state, _pos - 1);
+    } else {
+      guarantee(state == JavaCallArguments::value_state_primitive,
+                "signature does not match pushed arguments: %u at %d",
+                state, _pos - 1);
+    }
   }
 
   void check_doing_return(bool state) { _is_return = state; }
@@ -515,24 +558,20 @@
       return;
     }
 
-    // verify handle and the oop pointed to by handle
-    int p = _pos;
-    bool bad = false;
-    // If argument is oop
-    if (_is_oop[p]) {
-      intptr_t v = _value[p];
-      if (v != 0 ) {
-        size_t t = (size_t)v;
-        bad = (t < (size_t)os::vm_page_size() ) || !Handle::raw_resolve((oop *)v)->is_oop_or_null(true);
-        if (CheckJNICalls && bad) {
-          ReportJNIFatalError((JavaThread*)_thread, "Bad JNI oop argument");
-        }
-      }
-      // for the regular debug case.
-      assert(!bad, "Bad JNI oop argument");
+    intptr_t v = _value[_pos];
+    if (v != 0) {
+      // v is a "handle" referring to an oop, cast to integral type.
+      // There shouldn't be any handles in very low memory.
+      guarantee((size_t)v >= (size_t)os::vm_page_size(),
+                "Bad JNI oop argument %d: " PTR_FORMAT, _pos, v);
+      // Verify the pointee.
+      oop vv = resolve_indirect_oop(v, _value_state[_pos]);
+      guarantee(vv->is_oop_or_null(true),
+                "Bad JNI oop argument %d: " PTR_FORMAT " -> " PTR_FORMAT,
+                _pos, v, p2i(vv));
     }
 
-    check_value(true);
+    check_value(true);          // Verify value state.
   }
 
   void do_bool()                       { check_int(T_BOOLEAN);       }
@@ -549,8 +588,7 @@
 };
 
 
-void JavaCallArguments::verify(const methodHandle& method, BasicType return_type,
-  Thread *thread) {
+void JavaCallArguments::verify(const methodHandle& method, BasicType return_type) {
   guarantee(method->size_of_parameters() == size_of_parameters(), "wrong no. of arguments pushed");
 
   // Treat T_OBJECT and T_ARRAY as the same
@@ -559,7 +597,11 @@
   // Check that oop information is correct
   Symbol* signature = method->signature();
 
-  SignatureChekker sc(signature, return_type, method->is_static(),_is_oop, _value, thread);
+  SignatureChekker sc(signature,
+                      return_type,
+                      method->is_static(),
+                      _value_state,
+                      _value);
   sc.iterate_parameters();
   sc.check_doing_return(true);
   sc.iterate_returntype();
diff --git a/hotspot/src/share/vm/runtime/javaCalls.hpp b/hotspot/src/share/vm/runtime/javaCalls.hpp
index efe1f8b..e77abf7 100644
--- a/hotspot/src/share/vm/runtime/javaCalls.hpp
+++ b/hotspot/src/share/vm/runtime/javaCalls.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,11 +80,11 @@
    _default_size = 8    // Must be at least # of arguments in JavaCalls methods
   };
 
-  intptr_t    _value_buffer [_default_size + 1];
-  bool        _is_oop_buffer[_default_size + 1];
+  intptr_t    _value_buffer      [_default_size + 1];
+  u_char      _value_state_buffer[_default_size + 1];
 
   intptr_t*   _value;
-  bool*       _is_oop;
+  u_char*     _value_state;
   int         _size;
   int         _max_size;
   bool        _start_at_zero;      // Support late setting of receiver
@@ -92,8 +92,8 @@
 
   void initialize() {
     // Starts at first element to support set_receiver.
-    _value    = &_value_buffer[1];
-    _is_oop   = &_is_oop_buffer[1];
+    _value       = &_value_buffer[1];
+    _value_state = &_value_state_buffer[1];
 
     _max_size = _default_size;
     _size = 0;
@@ -101,6 +101,23 @@
     JVMCI_ONLY(_alternative_target = NULL;)
   }
 
+  // Helper for push_oop and the like.  The value argument is a
+  // "handle" that refers to an oop.  We record the address of the
+  // handle rather than the designated oop.  The handle is later
+  // resolved to the oop by parameters().  This delays the exposure of
+  // naked oops until it is GC-safe.
+  template<typename T>
+  inline int push_oop_impl(T handle, int size) {
+    // JNITypes::put_obj expects an oop value, so we play fast and
+    // loose with the type system.  The cast from handle type to oop
+    // *must* use a C-style cast.  In a product build it performs a
+    // reinterpret_cast. In a debug build (more accurately, in a
+    // CHECK_UNHANDLED_OOPS build) it performs a static_cast, invoking
+    // the debug-only oop class's conversion from void* constructor.
+    JNITypes::put_obj((oop)handle, _value, size); // Updates size.
+    return size;                // Return the updated size.
+  }
+
  public:
   JavaCallArguments() { initialize(); }
 
@@ -111,11 +128,12 @@
 
   JavaCallArguments(int max_size) {
     if (max_size > _default_size) {
-      _value  = NEW_RESOURCE_ARRAY(intptr_t, max_size + 1);
-      _is_oop = NEW_RESOURCE_ARRAY(bool, max_size + 1);
+      _value = NEW_RESOURCE_ARRAY(intptr_t, max_size + 1);
+      _value_state = NEW_RESOURCE_ARRAY(u_char, max_size + 1);
 
-      // Reserve room for potential receiver in value and is_oop
-      _value++; _is_oop++;
+      // Reserve room for potential receiver in value and state
+      _value++;
+      _value_state++;
 
       _max_size = max_size;
       _size = 0;
@@ -136,25 +154,52 @@
   }
 #endif
 
-  inline void push_oop(Handle h)    { _is_oop[_size] = true;
-                               JNITypes::put_obj((oop)h.raw_value(), _value, _size); }
+  // The possible values for _value_state elements.
+  enum {
+    value_state_primitive,
+    value_state_oop,
+    value_state_handle,
+    value_state_jobject,
+    value_state_limit
+  };
 
-  inline void push_int(int i)       { _is_oop[_size] = false;
-                               JNITypes::put_int(i, _value, _size); }
+  inline void push_oop(Handle h) {
+    _value_state[_size] = value_state_handle;
+    _size = push_oop_impl(h.raw_value(), _size);
+  }
 
-  inline void push_double(double d) { _is_oop[_size] = false; _is_oop[_size + 1] = false;
-                               JNITypes::put_double(d, _value, _size); }
+  inline void push_jobject(jobject h) {
+    _value_state[_size] = value_state_jobject;
+    _size = push_oop_impl(h, _size);
+  }
 
-  inline void push_long(jlong l)    { _is_oop[_size] = false; _is_oop[_size + 1] = false;
-                               JNITypes::put_long(l, _value, _size); }
+  inline void push_int(int i) {
+    _value_state[_size] = value_state_primitive;
+    JNITypes::put_int(i, _value, _size);
+  }
 
-  inline void push_float(float f)   { _is_oop[_size] = false;
-                               JNITypes::put_float(f, _value, _size); }
+  inline void push_double(double d) {
+    _value_state[_size] = value_state_primitive;
+    _value_state[_size + 1] = value_state_primitive;
+    JNITypes::put_double(d, _value, _size);
+  }
+
+  inline void push_long(jlong l) {
+    _value_state[_size] = value_state_primitive;
+    _value_state[_size + 1] = value_state_primitive;
+    JNITypes::put_long(l, _value, _size);
+  }
+
+  inline void push_float(float f) {
+    _value_state[_size] = value_state_primitive;
+    JNITypes::put_float(f, _value, _size);
+  }
 
   // receiver
   Handle receiver() {
     assert(_size > 0, "must at least be one argument");
-    assert(_is_oop[0], "first argument must be an oop");
+    assert(_value_state[0] == value_state_handle,
+           "first argument must be an oop");
     assert(_value[0] != 0, "receiver must be not-null");
     return Handle((oop*)_value[0], false);
   }
@@ -162,11 +207,11 @@
   void set_receiver(Handle h) {
     assert(_start_at_zero == false, "can only be called once");
     _start_at_zero = true;
-    _is_oop--;
+    _value_state--;
     _value--;
     _size++;
-    _is_oop[0] = true;
-    _value[0] = (intptr_t)h.raw_value();
+    _value_state[0] = value_state_handle;
+    push_oop_impl(h.raw_value(), 0);
   }
 
   // Converts all Handles to oops, and returns a reference to parameter vector
@@ -174,7 +219,7 @@
   int   size_of_parameters() const { return _size; }
 
   // Verify that pushed arguments fits a given method
-  void verify(const methodHandle& method, BasicType return_type, Thread *thread);
+  void verify(const methodHandle& method, BasicType return_type);
 };
 
 // All calls to Java have to go via JavaCalls. Sets up the stack frame
diff --git a/hotspot/src/share/vm/runtime/jniHandles.cpp b/hotspot/src/share/vm/runtime/jniHandles.cpp
index 679ade0..f4aae3c 100644
--- a/hotspot/src/share/vm/runtime/jniHandles.cpp
+++ b/hotspot/src/share/vm/runtime/jniHandles.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,9 @@
 #include "runtime/jniHandles.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/thread.inline.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#endif
 
 JNIHandleBlock* JNIHandles::_global_handles       = NULL;
 JNIHandleBlock* JNIHandles::_weak_global_handles  = NULL;
@@ -92,28 +95,48 @@
   jobject res = NULL;
   if (!obj.is_null()) {
     // ignore null handles
-    MutexLocker ml(JNIGlobalHandle_lock);
-    assert(Universe::heap()->is_in_reserved(obj()), "sanity check");
-    res = _weak_global_handles->allocate_handle(obj());
+    {
+      MutexLocker ml(JNIGlobalHandle_lock);
+      assert(Universe::heap()->is_in_reserved(obj()), "sanity check");
+      res = _weak_global_handles->allocate_handle(obj());
+    }
+    // Add weak tag.
+    assert(is_ptr_aligned(res, weak_tag_alignment), "invariant");
+    char* tptr = reinterpret_cast<char*>(res) + weak_tag_value;
+    res = reinterpret_cast<jobject>(tptr);
   } else {
     CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
   }
   return res;
 }
 
+template<bool external_guard>
+oop JNIHandles::resolve_jweak(jweak handle) {
+  assert(is_jweak(handle), "precondition");
+  oop result = jweak_ref(handle);
+  result = guard_value<external_guard>(result);
+#if INCLUDE_ALL_GCS
+  if (result != NULL && UseG1GC) {
+    G1SATBCardTableModRefBS::enqueue(result);
+  }
+#endif // INCLUDE_ALL_GCS
+  return result;
+}
+
+template oop JNIHandles::resolve_jweak<true>(jweak);
+template oop JNIHandles::resolve_jweak<false>(jweak);
 
 void JNIHandles::destroy_global(jobject handle) {
   if (handle != NULL) {
     assert(is_global_handle(handle), "Invalid delete of global JNI handle");
-    *((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it
+    jobject_ref(handle) = deleted_handle();
   }
 }
 
 
 void JNIHandles::destroy_weak_global(jobject handle) {
   if (handle != NULL) {
-    assert(!CheckJNICalls || is_weak_global_handle(handle), "Invalid delete of weak global JNI handle");
-    *((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it
+    jweak_ref(handle) = deleted_handle();
   }
 }
 
diff --git a/hotspot/src/share/vm/runtime/jniHandles.hpp b/hotspot/src/share/vm/runtime/jniHandles.hpp
index ce37d94..13e0e15 100644
--- a/hotspot/src/share/vm/runtime/jniHandles.hpp
+++ b/hotspot/src/share/vm/runtime/jniHandles.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,28 @@
   static JNIHandleBlock* _weak_global_handles;        // First weak global handle block
   static oop _deleted_handle;                         // Sentinel marking deleted handles
 
+  inline static bool is_jweak(jobject handle);
+  inline static oop& jobject_ref(jobject handle); // NOT jweak!
+  inline static oop& jweak_ref(jobject handle);
+
+  template<bool external_guard> inline static oop guard_value(oop value);
+  template<bool external_guard> inline static oop resolve_impl(jobject handle);
+  template<bool external_guard> static oop resolve_jweak(jweak handle);
+
  public:
+  // Low tag bit in jobject used to distinguish a jweak.  jweak is
+  // type equivalent to jobject, but there are places where we need to
+  // be able to distinguish jweak values from other jobjects, and
+  // is_weak_global_handle is unsuitable for performance reasons.  To
+  // provide such a test we add weak_tag_value to the (aligned) byte
+  // address designated by the jobject to produce the corresponding
+  // jweak.  Accessing the value of a jobject must account for it
+  // being a possibly offset jweak.
+  static const uintptr_t weak_tag_size = 1;
+  static const uintptr_t weak_tag_alignment = (1u << weak_tag_size);
+  static const uintptr_t weak_tag_mask = weak_tag_alignment - 1;
+  static const int weak_tag_value = 1;
+
   // Resolve handle into oop
   inline static oop resolve(jobject handle);
   // Resolve externally provided handle into oop with some guards
@@ -176,36 +197,85 @@
   #endif
 };
 
+inline bool JNIHandles::is_jweak(jobject handle) {
+  STATIC_ASSERT(weak_tag_size == 1);
+  STATIC_ASSERT(weak_tag_value == 1);
+  return (reinterpret_cast<uintptr_t>(handle) & weak_tag_mask) != 0;
+}
+
+inline oop& JNIHandles::jobject_ref(jobject handle) {
+  assert(!is_jweak(handle), "precondition");
+  return *reinterpret_cast<oop*>(handle);
+}
+
+inline oop& JNIHandles::jweak_ref(jobject handle) {
+  assert(is_jweak(handle), "precondition");
+  char* ptr = reinterpret_cast<char*>(handle) - weak_tag_value;
+  return *reinterpret_cast<oop*>(ptr);
+}
+
+// external_guard is true if called from resolve_external_guard.
+// Treat deleted (and possibly zapped) as NULL for external_guard,
+// else as (asserted) error.
+template<bool external_guard>
+inline oop JNIHandles::guard_value(oop value) {
+  if (!external_guard) {
+    assert(value != badJNIHandle, "Pointing to zapped jni handle area");
+    assert(value != deleted_handle(), "Used a deleted global handle");
+  } else if ((value == badJNIHandle) || (value == deleted_handle())) {
+    value = NULL;
+  }
+  return value;
+}
+
+// external_guard is true if called from resolve_external_guard.
+template<bool external_guard>
+inline oop JNIHandles::resolve_impl(jobject handle) {
+  assert(handle != NULL, "precondition");
+  oop result;
+  if (is_jweak(handle)) {       // Unlikely
+    result = resolve_jweak<external_guard>(handle);
+  } else {
+    result = jobject_ref(handle);
+    // Construction of jobjects canonicalize a null value into a null
+    // jobject, so for non-jweak the pointee should never be null.
+    assert(external_guard || result != NULL,
+           "Invalid value read from jni handle");
+    result = guard_value<external_guard>(result);
+  }
+  return result;
+}
 
 inline oop JNIHandles::resolve(jobject handle) {
-  oop result = (handle == NULL ? (oop)NULL : *(oop*)handle);
-  assert(result != NULL || (handle == NULL || !CheckJNICalls || is_weak_global_handle(handle)), "Invalid value read from jni handle");
-  assert(result != badJNIHandle, "Pointing to zapped jni handle area");
+  oop result = NULL;
+  if (handle != NULL) {
+    result = resolve_impl<false /* external_guard */ >(handle);
+  }
   return result;
-};
+}
 
-
+// Resolve some erroneous cases to NULL, rather than treating them as
+// possibly unchecked errors.  In particular, deleted handles are
+// treated as NULL (though a deleted and later reallocated handle
+// isn't detected).
 inline oop JNIHandles::resolve_external_guard(jobject handle) {
-  if (handle == NULL) return NULL;
-  oop result = *(oop*)handle;
-  if (result == NULL || result == badJNIHandle) return NULL;
+  oop result = NULL;
+  if (handle != NULL) {
+    result = resolve_impl<true /* external_guard */ >(handle);
+  }
   return result;
-};
-
+}
 
 inline oop JNIHandles::resolve_non_null(jobject handle) {
   assert(handle != NULL, "JNI handle should not be null");
-  oop result = *(oop*)handle;
-  assert(result != NULL, "Invalid value read from jni handle");
-  assert(result != badJNIHandle, "Pointing to zapped jni handle area");
-  // Don't let that private _deleted_handle object escape into the wild.
-  assert(result != deleted_handle(), "Used a deleted global handle.");
+  oop result = resolve_impl<false /* external_guard */ >(handle);
+  assert(result != NULL, "NULL read from jni handle");
   return result;
-};
+}
 
 inline void JNIHandles::destroy_local(jobject handle) {
   if (handle != NULL) {
-    *((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it
+    jobject_ref(handle) = deleted_handle();
   }
 }
 
diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp
index 29ad520..8c47a1c 100644
--- a/hotspot/src/share/vm/runtime/mutexLocker.cpp
+++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp
@@ -181,13 +181,13 @@
   }
   if (UseG1GC) {
 
-    def(SATB_Q_FL_lock             , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);
-    def(SATB_Q_CBL_mon             , PaddedMonitor, nonleaf,     true,  Monitor::_safepoint_check_never);
-    def(Shared_SATB_Q_lock         , PaddedMutex  , nonleaf,     true,  Monitor::_safepoint_check_never);
+    def(SATB_Q_FL_lock             , PaddedMutex  , special  ,   true,  Monitor::_safepoint_check_never);
+    def(SATB_Q_CBL_mon             , PaddedMonitor, leaf - 1 ,   true,  Monitor::_safepoint_check_never);
+    def(Shared_SATB_Q_lock         , PaddedMutex  , leaf - 1 ,   true,  Monitor::_safepoint_check_never);
 
-    def(DirtyCardQ_FL_lock         , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);
-    def(DirtyCardQ_CBL_mon         , PaddedMonitor, nonleaf,     true,  Monitor::_safepoint_check_never);
-    def(Shared_DirtyCardQ_lock     , PaddedMutex  , nonleaf,     true,  Monitor::_safepoint_check_never);
+    def(DirtyCardQ_FL_lock         , PaddedMutex  , special  ,   true,  Monitor::_safepoint_check_never);
+    def(DirtyCardQ_CBL_mon         , PaddedMonitor, leaf - 1 ,   true,  Monitor::_safepoint_check_never);
+    def(Shared_DirtyCardQ_lock     , PaddedMutex  , leaf - 1 ,   true,  Monitor::_safepoint_check_never);
 
     def(FreeList_lock              , PaddedMutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
     def(SecondaryFreeList_lock     , PaddedMonitor, leaf     ,   true,  Monitor::_safepoint_check_never);
diff --git a/hotspot/src/share/vm/runtime/os_ext.hpp b/hotspot/src/share/vm/runtime/os_ext.hpp
index 3aa733a..5fcaae1 100644
--- a/hotspot/src/share/vm/runtime/os_ext.hpp
+++ b/hotspot/src/share/vm/runtime/os_ext.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp
index fb4b2ee..68b895c 100644
--- a/hotspot/src/share/vm/runtime/reflection.cpp
+++ b/hotspot/src/share/vm/runtime/reflection.cpp
@@ -594,9 +594,9 @@
           current_class_name, module_from_name, new_class_name,
           module_to_name, module_from_name, module_to_name);
       } else {
-        jobject jlrm = module_to->module();
-        assert(jlrm != NULL, "Null jlrm in module_to ModuleEntry");
-        intptr_t identity_hash = JNIHandles::resolve(jlrm)->identity_hash();
+        jobject jlm = module_to->module();
+        assert(jlm != NULL, "Null jlm in module_to ModuleEntry");
+        intptr_t identity_hash = JNIHandles::resolve(jlm)->identity_hash();
         size_t len = 160 + strlen(current_class_name) + 2*strlen(module_from_name) +
           strlen(new_class_name) + 2*sizeof(uintx);
         msg = NEW_RESOURCE_ARRAY(char, len);
@@ -621,9 +621,9 @@
           current_class_name, module_from_name, new_class_name,
           module_to_name, module_to_name, package_name, module_from_name);
       } else {
-        jobject jlrm = module_from->module();
-        assert(jlrm != NULL, "Null jlrm in module_from ModuleEntry");
-        intptr_t identity_hash = JNIHandles::resolve(jlrm)->identity_hash();
+        jobject jlm = module_from->module();
+        assert(jlm != NULL, "Null jlm in module_from ModuleEntry");
+        intptr_t identity_hash = JNIHandles::resolve(jlm)->identity_hash();
         size_t len = 170 + strlen(current_class_name) + strlen(new_class_name) +
           2*strlen(module_to_name) + strlen(package_name) + 2*sizeof(uintx);
         msg = NEW_RESOURCE_ARRAY(char, len);
diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp
index abdcab5..c5bf44f 100644
--- a/hotspot/src/share/vm/runtime/thread.cpp
+++ b/hotspot/src/share/vm/runtime/thread.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3409,9 +3409,16 @@
   Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
   instanceKlassHandle klass (THREAD, k);
 
-  JavaValue result(T_VOID);
+  JavaValue result(T_INT);
+  JavaCallArguments args;
+  args.push_int(DisplayVMOutputToStderr);
+  args.push_int(log_is_enabled(Debug, init)); // print stack trace if exception thrown
   JavaCalls::call_static(&result, klass, vmSymbols::initPhase2_name(),
-                                         vmSymbols::void_method_signature(), CHECK);
+                                         vmSymbols::boolean_boolean_int_signature(), &args, CHECK);
+  if (result.get_jint() != JNI_OK) {
+    vm_exit_during_initialization(); // no message or exception
+  }
+
   universe_post_module_init();
 }
 
@@ -3458,7 +3465,7 @@
                                       java_lang_Thread::RUNNABLE);
 
   // The VM creates objects of this class.
-  initialize_class(vmSymbols::java_lang_reflect_Module(), CHECK);
+  initialize_class(vmSymbols::java_lang_Module(), CHECK);
 
   // The VM preresolves methods to these classes. Make sure that they get initialized
   initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK);
diff --git a/hotspot/src/share/vm/runtime/vframe.cpp b/hotspot/src/share/vm/runtime/vframe.cpp
index 7d9a7b3..1759e31 100644
--- a/hotspot/src/share/vm/runtime/vframe.cpp
+++ b/hotspot/src/share/vm/runtime/vframe.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -463,14 +463,15 @@
 entryVFrame::entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
 : externalVFrame(fr, reg_map, thread) {}
 
-
-void vframeStreamCommon::found_bad_method_frame() {
+#ifdef ASSERT
+void vframeStreamCommon::found_bad_method_frame() const {
   // 6379830 Cut point for an assertion that occasionally fires when
   // we are using the performance analyzer.
   // Disable this assert when testing the analyzer with fastdebug.
   // -XX:SuppressErrorAt=vframe.cpp:XXX (XXX=following line number)
-  assert(false, "invalid bci or invalid scope desc");
+  fatal("invalid bci or invalid scope desc");
 }
+#endif
 
 // top-frame will be skipped
 vframeStream::vframeStream(JavaThread* thread, frame top_frame,
diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp
index de7d510..40c43ad 100644
--- a/hotspot/src/share/vm/runtime/vframe.hpp
+++ b/hotspot/src/share/vm/runtime/vframe.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -297,14 +297,14 @@
   void fill_from_compiled_frame(int decode_offset);
   void fill_from_compiled_native_frame();
 
-  void found_bad_method_frame();
-
   void fill_from_interpreter_frame();
   bool fill_from_frame();
 
   // Helper routine for security_get_caller_frame
   void skip_prefixed_method_and_wrappers();
 
+  DEBUG_ONLY(void found_bad_method_frame() const;)
+
  public:
   // Constructor
   vframeStreamCommon(JavaThread* thread) : _reg_map(thread, false) {
@@ -407,9 +407,9 @@
       nm()->print_code();
       nm()->print_pcs();
     }
+    found_bad_method_frame();
 #endif
     // Provide a cheap fallback in product mode.  (See comment above.)
-    found_bad_method_frame();
     fill_from_compiled_native_frame();
     return;
   }
@@ -523,7 +523,7 @@
   // In this scenario, pretend that the interpreter is at the point
   // of entering the method.
   if (bci < 0) {
-    found_bad_method_frame();
+    DEBUG_ONLY(found_bad_method_frame();)
     bci = 0;
   }
   _mode   = interpreted_mode;
diff --git a/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp b/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp
index 53fea31..b9ac6a3 100644
--- a/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp
+++ b/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009, 2010 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -300,6 +300,7 @@
       not_null, merge);
 
     builder()->SetInsertPoint(not_null);
+#error Needs to be updated for tagged jweak; see JNIHandles.
     Value *unboxed_result = builder()->CreateLoad(result);
     builder()->CreateBr(merge);
 
diff --git a/hotspot/src/share/vm/utilities/debug.hpp b/hotspot/src/share/vm/utilities/debug.hpp
index 3a4483e..dbb5dc6 100644
--- a/hotspot/src/share/vm/utilities/debug.hpp
+++ b/hotspot/src/share/vm/utilities/debug.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -140,6 +140,9 @@
 // For backward compatibility.
 #define assert(p, ...) vmassert(p, __VA_ARGS__)
 
+#ifndef ASSERT
+#define vmassert_status(p, status, msg)
+#else
 // This version of vmassert is for use with checking return status from
 // library calls that return actual error values eg. EINVAL,
 // ENOMEM etc, rather than returning -1 and setting errno.
@@ -155,6 +158,7 @@
     BREAKPOINT;                                                                \
   }                                                                            \
 } while (0)
+#endif
 
 // For backward compatibility.
 #define assert_status(p, status, msg) vmassert_status(p, status, msg)
diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp
index 623a8cb..1b21635 100644
--- a/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
+ * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -153,6 +153,9 @@
 // offset_of as it is defined for gcc.
 #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16)
 
+// AIX 5.3 has buggy __thread support. (see JDK-8176442).
+#define USE_LIBRARY_BASED_TLS_ONLY 1
+
 #ifndef USE_LIBRARY_BASED_TLS_ONLY
 #define THREAD_LOCAL_DECL __thread
 #endif
diff --git a/hotspot/test/ProblemList.txt b/hotspot/test/ProblemList.txt
index bf6811e..2c657d3 100644
--- a/hotspot/test/ProblemList.txt
+++ b/hotspot/test/ProblemList.txt
@@ -73,12 +73,11 @@
 
 serviceability/jdwp/AllModulesCommandTest.java 8168478 generic-all
 serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all
+serviceability/jvmti/ModuleAwareAgents/ClassFileLoadHook/MAAClassFileLoadHook.java 8173936 generic-all
 
 #############################################################################
 
 # :hotspot_misc
 
-testlibrary_tests/ctw/JarDirTest.java 8172457 windows-all
-
 #############################################################################
 
diff --git a/hotspot/test/TEST.ROOT b/hotspot/test/TEST.ROOT
index 54b61ac..0bb7896 100644
--- a/hotspot/test/TEST.ROOT
+++ b/hotspot/test/TEST.ROOT
@@ -50,8 +50,8 @@
     vm.cpu.features \
     vm.debug
 
-# Tests using jtreg 4.2 b04 features
-requiredVersion=4.2 b04
+# Tests using jtreg 4.2 b07 features
+requiredVersion=4.2 b07
 
 # Path to libraries in the topmost test directory. This is needed so @library
 # does not need ../../ notation to reach them
diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java
index b212fc3..18983b3 100644
--- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java
+++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java
@@ -20,10 +20,19 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ * @run junit/othervm jdk.tools.jaotc.test.collect.ClassSearchTest
+ */
+
 package jdk.tools.jaotc.test.collect;
 
 
 import jdk.tools.jaotc.LoadedClass;
+import jdk.tools.jaotc.collect.*;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -32,45 +41,90 @@
 import java.util.List;
 import java.util.Set;
 import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
 
 public class ClassSearchTest {
     @Test(expected = InternalError.class)
     public void itShouldThrowExceptionIfNoProvidersAvailable() {
         ClassSearch target = new ClassSearch();
         SearchPath searchPath = new SearchPath();
-        target.search(list("foo"), searchPath);
+        target.search(list(new SearchFor("foo")), searchPath);
     }
 
     @Test
     public void itShouldFindAProviderForEachEntry() {
         Set<String> searched = new HashSet<>();
         ClassSearch target = new ClassSearch();
-        target.addProvider(new SourceProvider() {
-            @Override
-            public ClassSource findSource(String name, SearchPath searchPath) {
+        target.addProvider(provider("", (name, searchPath) -> {
                 searched.add(name);
                 return new NoopSource();
-            }
-        });
-        target.search(list("foo", "bar", "foobar"), null);
+        }));
+        target.search(searchForList("foo", "bar", "foobar"), null);
         Assert.assertEquals(hashset("foo", "bar", "foobar"), searched);
     }
 
+    private SourceProvider provider(String supports, BiFunction<String, SearchPath, ClassSource> fn) {
+        return new SourceProvider() {
+            @Override
+            public ClassSource findSource(String name, SearchPath searchPath) {
+                return fn.apply(name, searchPath);
+            }
+
+            @Override
+            public boolean supports(String type) {
+                return supports.equals(type);
+            }
+        };
+    }
+
     @Test
-    public void itShouldSearchAllProviders() {
+    public void itShouldOnlySearchSupportedProvidersForKnownType() {
         Set<String> visited = new HashSet<>();
         ClassSearch target = new ClassSearch();
-        target.addProvider((name, searchPath) -> {
-            visited.add("1");
+
+        target.addProvider(provider("jar", (name, searchPath) -> {
+            visited.add("jar");
             return null;
-        });
-        target.addProvider((name, searchPath) -> {
-            visited.add("2");
+        }));
+
+        target.addProvider(provider("dir", (name, searchPath) -> {
+            visited.add("dir");
             return null;
-        });
+        }));
 
         try {
-            target.search(list("foo"), null);
+            target.search(list(new SearchFor("some", "dir")), null);
+        } catch (InternalError e) {
+            // throws because no provider gives a source
+        }
+
+        Assert.assertEquals(hashset("dir"), visited);
+    }
+
+    @Test(expected = InternalError.class)
+    public void itShouldThrowErrorIfMultipleSourcesAreAvailable() {
+        ClassSearch target = new ClassSearch();
+        target.addProvider(provider("", (name, searchPath) -> consumer -> Assert.fail()));
+        target.addProvider(provider("", (name, searchPath) -> consumer -> Assert.fail()));
+
+        target.search(searchForList("somethign"), null);
+    }
+
+    @Test
+    public void itShouldSearchAllProvidersForUnknownType() {
+        Set<String> visited = new HashSet<>();
+        ClassSearch target = new ClassSearch();
+        target.addProvider(provider("", (name, searchPath) -> {
+            visited.add("1");
+            return null;
+        }));
+        target.addProvider(provider("", (name, searchPath) -> {
+            visited.add("2");
+            return null;
+        }));
+
+        try {
+            target.search(searchForList("foo"), null);
         } catch (InternalError e) {
             // throws because no provider gives a source
         }
@@ -85,6 +139,11 @@
         ClassSearch target = new ClassSearch();
         target.addProvider(new SourceProvider() {
             @Override
+            public boolean supports(String type) {
+                return true;
+            }
+
+            @Override
             public ClassSource findSource(String name, SearchPath searchPath) {
                 return new ClassSource() {
                     @Override
@@ -101,7 +160,7 @@
             }
         });
 
-        java.util.List<LoadedClass> search = target.search(list("/tmp/something"), null);
+        java.util.List<LoadedClass> search = target.search(searchForList("/tmp/something"), null);
         Assert.assertEquals(list(new LoadedClass("foo.Bar", null)), search);
     }
 
@@ -115,8 +174,16 @@
         };
 
         ClassSearch target = new ClassSearch();
-        target.addProvider((name, searchPath) -> consumer -> consumer.accept("foo.Bar", classLoader));
-        target.search(list("foobar"), null);
+        target.addProvider(provider("", (name, searchPath) -> consumer -> consumer.accept("foo.Bar", classLoader)));
+        target.search(searchForList("foobar"), null);
+    }
+
+    private List<SearchFor> searchForList(String... entries) {
+        List<SearchFor> list = new ArrayList<>();
+        for (String entry : entries) {
+            list.add(new SearchFor(entry));
+        }
+        return list;
     }
 
     private <T> List<T> list(T... entries) {
diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java
index 5fad5f5..ac9b8c9 100644
--- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java
+++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java
@@ -20,6 +20,14 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ * @run junit/othervm jdk.tools.jaotc.test.collect.ClassSourceTest
+ */
+
 package jdk.tools.jaotc.test.collect;
 
 import org.junit.Assert;
diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java
index 178c3d4..0e9011a 100644
--- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java
+++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java
@@ -27,6 +27,8 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import jdk.tools.jaotc.collect.FileSupport;
+
 public class FakeFileSupport extends FileSupport {
     private final Set<String> exists = new HashSet<>();
     private final Set<String> directories = new HashSet<>();
diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java
index 9a7873c..899d89f 100644
--- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java
+++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java
@@ -22,6 +22,8 @@
  */
 package jdk.tools.jaotc.test.collect;
 
+import jdk.tools.jaotc.collect.SearchPath;
+
 import java.nio.file.FileSystem;
 import java.nio.file.Path;
 import java.nio.file.Paths;
diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java
index 8ceca8d..f3d3f56 100644
--- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java
+++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java
@@ -20,6 +20,17 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ *
+ * @build jdk.tools.jaotc.test.collect.Utils
+ * @build jdk.tools.jaotc.test.collect.FakeFileSupport
+ * @run junit/othervm jdk.tools.jaotc.test.collect.SearchPathTest
+ */
+
 package jdk.tools.jaotc.test.collect;
 
 import org.junit.Before;
@@ -30,6 +41,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.tools.jaotc.collect.*;
+
 import static jdk.tools.jaotc.test.collect.Utils.set;
 import static org.junit.Assert.*;
 
diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java
index 6608c01..66ed4e2 100644
--- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java
+++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java
@@ -21,11 +21,22 @@
  * questions.
  */
 
+/**
+ * @test
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ *          jdk.aot/jdk.tools.jaotc.collect.directory
+ * @compile ../Utils.java
+ * @compile ../FakeFileSupport.java
+ * @run junit/othervm jdk.tools.jaotc.test.collect.directory.DirectorySourceProviderTest
+ */
+
 package jdk.tools.jaotc.test.collect.directory;
 
 import jdk.tools.jaotc.collect.ClassSource;
+import jdk.tools.jaotc.collect.directory.DirectorySourceProvider;
 import jdk.tools.jaotc.test.collect.FakeFileSupport;
-import jdk.tools.jaotc.test.collect.FileSupport;
+import jdk.tools.jaotc.collect.FileSupport;
 import org.junit.Assert;
 import org.junit.Test;
 
diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java
index 1405988..a6b687f 100644
--- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java
+++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java
@@ -20,9 +20,23 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ *          jdk.aot/jdk.tools.jaotc.collect.jar
+ * @compile ../Utils.java
+ * @compile ../FakeFileSupport.java
+ * @compile ../FakeSearchPath.java
+ *
+ * @run junit/othervm jdk.tools.jaotc.test.collect.jar.JarSourceProviderTest
+ */
+
 package jdk.tools.jaotc.test.collect.jar;
 
 import jdk.tools.jaotc.collect.ClassSource;
+import jdk.tools.jaotc.collect.jar.JarSourceProvider;
 import jdk.tools.jaotc.test.collect.FakeFileSupport;
 import jdk.tools.jaotc.test.collect.FakeSearchPath;
 import org.junit.Assert;
diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java
index 80f0691..b8a4404 100644
--- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java
+++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java
@@ -20,15 +20,31 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @modules jdk.aot/jdk.tools.jaotc
+ *          jdk.aot/jdk.tools.jaotc.collect
+ *          jdk.aot/jdk.tools.jaotc.collect.module
+ * @compile ../Utils.java
+ * @run junit/othervm jdk.tools.jaotc.test.collect.module.ModuleSourceProviderTest
+ */
+
 package jdk.tools.jaotc.test.collect.module;
 
-import jdk.tools.jaotc.*;
-import jdk.tools.jaotc.test.collect.FakeSearchPath;
+import jdk.tools.jaotc.collect.FileSupport;
+import jdk.tools.jaotc.collect.module.ModuleSource;
+import jdk.tools.jaotc.collect.module.ModuleSourceProvider;
 import jdk.tools.jaotc.test.collect.Utils;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.io.IOException;
+import java.nio.file.FileSystem;
 import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.function.BiFunction;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
@@ -36,28 +52,42 @@
 public class ModuleSourceProviderTest {
     private ClassLoader classLoader;
     private ModuleSourceProvider target;
+    private FileSupport fileSupport;
+    private BiFunction<Path, Path, Path> getSubDirectory = null;
 
     @Before
     public void setUp() {
         classLoader = new FakeClassLoader();
-        target = new ModuleSourceProvider(FileSystems.getDefault(), classLoader);
+        fileSupport = new FileSupport() {
+
+            @Override
+            public boolean isDirectory(Path path) {
+                return true;
+            }
+
+            @Override
+            public Path getSubDirectory(FileSystem fileSystem, Path root, Path path) throws IOException {
+                if (getSubDirectory == null) {
+                    throw new IOException("Nope");
+                }
+                return getSubDirectory.apply(root, path);
+            }
+        };
+        target = new ModuleSourceProvider(FileSystems.getDefault(), classLoader, fileSupport);
     }
 
     @Test
-    public void itShouldUseSearchPath() {
-        FakeSearchPath searchPath = new FakeSearchPath("blah/java.base");
-        ModuleSource source = (ModuleSource) target.findSource("java.base", searchPath);
-        assertEquals(Utils.set("java.base"), searchPath.entries);
-        assertEquals("blah/java.base", source.getModulePath().toString());
-        assertEquals("module:blah/java.base", source.toString());
-    }
+    public void itShouldUseFileSupport() {
+        getSubDirectory = (root, path) -> {
+            if (root.toString().equals("modules") && path.toString().equals("test.module")) {
+                return Paths.get("modules/test.module");
+            }
+            return null;
+        };
 
-    @Test
-    public void itShouldReturnNullIfSearchPathReturnsNull() {
-        FakeSearchPath searchPath = new FakeSearchPath(null);
-        ModuleSource source = (ModuleSource) target.findSource("jdk.base", searchPath);
-        assertEquals(Utils.set("jdk.base"), searchPath.entries);
-        assertNull(source);
+        ModuleSource source = (ModuleSource) target.findSource("test.module", null);
+        assertEquals("modules/test.module", source.getModulePath().toString());
+        assertEquals("module:modules/test.module", source.toString());
     }
 
     private static class FakeClassLoader extends ClassLoader {
diff --git a/hotspot/test/compiler/arraycopy/TestDefaultMethodArrayCloneDeoptC2.java b/hotspot/test/compiler/arraycopy/TestDefaultMethodArrayCloneDeoptC2.java
new file mode 100644
index 0000000..c4100ad
--- /dev/null
+++ b/hotspot/test/compiler/arraycopy/TestDefaultMethodArrayCloneDeoptC2.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8170455
+ * @summary C2: Access to [].clone from interfaces fails.
+ * @library /test/lib /
+ *
+ * @requires vm.flavor == "server" & !vm.emulatedClient
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xcomp -Xbatch -Xbootclasspath/a:.  -XX:-TieredCompilation  -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=compileonly,*TestDefaultMethodArrayCloneDeoptC2Interface::test
+ *                   compiler.arraycopy.TestDefaultMethodArrayCloneDeoptC2
+ */
+
+package compiler.arraycopy;
+
+import sun.hotspot.WhiteBox;
+import java.lang.reflect.Method;
+import compiler.whitebox.CompilerWhiteBoxTest;
+
+
+
+interface TestDefaultMethodArrayCloneDeoptC2Interface {
+    default int[] test(int[] arr) {
+        return arr.clone();
+    }
+
+    default TDMACDC2InterfaceTypeTest[] test(TDMACDC2InterfaceTypeTest[] arr) {
+        return arr.clone();
+    }
+
+    default TDMACDC2ClassTypeTest[] test(TDMACDC2ClassTypeTest[] arr) {
+        return arr.clone();
+    }
+}
+
+public class TestDefaultMethodArrayCloneDeoptC2 implements TestDefaultMethodArrayCloneDeoptC2Interface {
+    private static final WhiteBox WB = WhiteBox.getWhiteBox();
+    public static TestDefaultMethodArrayCloneDeoptC2 a = new TestDefaultMethodArrayCloneDeoptC2();
+
+    public static void main(String[] args) throws Exception {
+        testPrimitiveArr();
+        testIntfArr();
+        testClassArr();
+    }
+
+    public static void testPrimitiveArr() throws Exception {
+        Method m = TestDefaultMethodArrayCloneDeoptC2Interface.class.getMethod("test", int[].class);
+        a.test(new int[1]); // Compiled
+        a.test(new int[1]);
+        if (!WB.isMethodCompiled(m)) {
+            WB.enqueueMethodForCompilation(m, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
+        }
+        a.test(new int[1]);
+        if (!WB.isMethodCompiled(m)) {
+            throw new Exception("Method should be compiled");
+        }
+    }
+
+    public static void testIntfArr() throws Exception {
+        Method m = TestDefaultMethodArrayCloneDeoptC2Interface.class.getMethod("test", TDMACDC2InterfaceTypeTest[].class);
+        a.test(new TDMACDC2InterfaceTypeTest[1]); // Compiled, Decompile unloaded
+        a.test(new TDMACDC2InterfaceTypeTest[1]); // Compiled
+        a.test(new TDMACDC2InterfaceTypeTest[1]);
+        if (!WB.isMethodCompiled(m)) {
+            WB.enqueueMethodForCompilation(m, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
+        }
+        a.test(new TDMACDC2InterfaceTypeTest[1]);
+        if (!WB.isMethodCompiled(m)) {
+            throw new Exception("Method should be compiled");
+        }
+    }
+
+    public static void testClassArr() throws Exception {
+        Method m = TestDefaultMethodArrayCloneDeoptC2Interface.class.getMethod("test", TDMACDC2ClassTypeTest[].class);
+        a.test(new TDMACDC2ClassTypeTest[1]); // Compiled, Decompile unloaded
+        a.test(new TDMACDC2ClassTypeTest[1]); // Compiled
+        a.test(new TDMACDC2ClassTypeTest[1]);
+        if (!WB.isMethodCompiled(m)) {
+            WB.enqueueMethodForCompilation(m, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
+        }
+        a.test(new TDMACDC2ClassTypeTest[1]);
+        if (!WB.isMethodCompiled(m)) {
+            throw new Exception("Method should be compiled");
+        }
+    }
+}
+
+interface TDMACDC2InterfaceTypeTest {
+}
+
+class TDMACDC2ClassTypeTest {
+}
+
diff --git a/hotspot/test/compiler/arraycopy/TestObjectArrayCopy.java b/hotspot/test/compiler/arraycopy/TestObjectArrayCopy.java
new file mode 100644
index 0000000..0cc8475
--- /dev/null
+++ b/hotspot/test/compiler/arraycopy/TestObjectArrayCopy.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017, SAP SE and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176505
+ * @summary Wrong assertion 'should be an array copy/clone' in arraycopynode.cpp
+ *
+ * @run main/othervm -Xbatch -XX:-UseOnStackReplacement compiler.arraycopy.TestObjectArrayCopy
+ *
+ * @author Volker Simonis
+ */
+
+package compiler.arraycopy;
+
+public class TestObjectArrayCopy {
+
+    public static boolean crash(Object src) {
+        String[] dst = new String[1];
+        System.arraycopy(src, 0, dst, 0, 1);
+        return dst[0] == null;
+    }
+
+    public static void main(String[] args) {
+        String[] sa = new String[1];
+        for (int i = 0; i < 20_000; i++) {
+            crash(sa);
+        }
+    }
+}
diff --git a/hotspot/test/compiler/c1/TestUnresolvedField.jasm b/hotspot/test/compiler/c1/TestUnresolvedField.jasm
new file mode 100644
index 0000000..e6c2ae4
--- /dev/null
+++ b/hotspot/test/compiler/c1/TestUnresolvedField.jasm
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+public class compiler/c1/TestUnresolvedField version 52:0 {
+    public static Method testGetField:"()V" stack 1 locals 1 {
+        aconst_null;
+        getfield Field T.f:I; // T does not exist
+        return;
+    }
+
+    public static Method testPutField:"()V" stack 2 locals 1 {
+        aconst_null;
+        iconst_0;
+        putfield Field T.f:I; // T does not exist
+        return;
+    }
+}
diff --git a/hotspot/test/compiler/c1/TestUnresolvedFieldMain.java b/hotspot/test/compiler/c1/TestUnresolvedFieldMain.java
new file mode 100644
index 0000000..040f1b1
--- /dev/null
+++ b/hotspot/test/compiler/c1/TestUnresolvedFieldMain.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173373
+ * @compile TestUnresolvedField.jasm
+ * @run main/othervm -XX:TieredStopAtLevel=1 -Xcomp
+ *                   -XX:CompileCommand=compileonly,compiler.c1.TestUnresolvedField::test*
+ *                   compiler.c1.TestUnresolvedFieldMain
+ */
+
+package compiler.c1;
+
+public class TestUnresolvedFieldMain {
+    public static void main(String[] args) {
+        try {
+          TestUnresolvedField.testGetField();
+        } catch (java.lang.NoClassDefFoundError error) {
+          // Expected
+        }
+        try {
+          TestUnresolvedField.testPutField();
+        } catch (java.lang.NoClassDefFoundError error) {
+          // Expected
+        }
+    }
+}
diff --git a/hotspot/test/compiler/c1/UnsafeVolatileGuardTest.java b/hotspot/test/compiler/c1/UnsafeVolatileGuardTest.java
new file mode 100644
index 0000000..b10c4a6
--- /dev/null
+++ b/hotspot/test/compiler/c1/UnsafeVolatileGuardTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017, Red Hat Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.reflect.Field;
+
+/**
+ * @test
+ * @bug 8175887
+ * @summary C1 value numbering handling of Unsafe.get*Volatile is incorrect
+ * @modules java.base/jdk.internal.misc
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 UnsafeVolatileGuardTest
+ */
+public class UnsafeVolatileGuardTest {
+    volatile static private int a;
+    static private int b;
+
+    static final jdk.internal.misc.Unsafe UNSAFE = jdk.internal.misc.Unsafe.getUnsafe();
+
+    static final Object BASE;
+    static final long OFFSET;
+
+    static {
+        try {
+            Field f = UnsafeVolatileGuardTest.class.getDeclaredField("a");
+            BASE = UNSAFE.staticFieldBase(f);
+            OFFSET = UNSAFE.staticFieldOffset(f);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    static void test() {
+        int tt = b; // makes the JVM CSE the value of b
+
+        while (UNSAFE.getIntVolatile(BASE, OFFSET) == 0) {} // burn
+        if (b == 0) {
+            System.err.println("wrong value of b");
+            System.exit(1); // fail hard to report the error
+        }
+    }
+
+    public static void main(String [] args) throws Exception {
+        for (int i = 0; i < 10; i++) {
+            new Thread(UnsafeVolatileGuardTest::test).start();
+        }
+        b = 1;
+        a = 1;
+    }
+}
diff --git a/hotspot/test/compiler/c1/VolatileGuardTest.java b/hotspot/test/compiler/c1/VolatileGuardTest.java
new file mode 100644
index 0000000..44b6031
--- /dev/null
+++ b/hotspot/test/compiler/c1/VolatileGuardTest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017, Red Hat Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8175887
+ * @summary C1 doesn't respect the JMM with volatile field loads
+ *
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 VolatileGuardTest
+ */
+public class VolatileGuardTest {
+    volatile static private int a;
+    static private int b;
+
+    static void test() {
+        int tt = b; // makes the JVM CSE the value of b
+
+        while (a == 0) {} // burn
+        if (b == 0) {
+            System.err.println("wrong value of b");
+            System.exit(1); // fail hard to report the error
+        }
+    }
+
+    public static void main(String [] args) throws Exception {
+        for (int i = 0; i < 10; i++) {
+            new Thread(VolatileGuardTest::test).start();
+        }
+        b = 1;
+        a = 1;
+    }
+}
diff --git a/hotspot/test/compiler/c2/TestNPEHeapBased.java b/hotspot/test/compiler/c2/TestNPEHeapBased.java
new file mode 100644
index 0000000..0fdb5d3
--- /dev/null
+++ b/hotspot/test/compiler/c2/TestNPEHeapBased.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8176518
+ * @summary Invalid ImplicitNullChecks when heap base not protected
+ *
+ * @run main/othervm -XX:ObjectAlignmentInBytes=16 -XX:HeapBaseMinAddress=64g
+ *      -XX:-TieredCompilation -Xbatch
+ *      compiler.c2.TestNPEHeapBased
+ * @requires vm.bits == "64"
+ */
+
+package compiler.c2;
+public class TestNPEHeapBased {
+
+    TestNPEHeapBased instance = null;
+    int i = 0;
+
+    public void set_i(int value) {
+        instance.i = value;
+    }
+
+
+    static final int loop_cnt = 200000;
+
+    public static void main(String args[]){
+        TestNPEHeapBased xyz = new TestNPEHeapBased();
+        xyz.instance = xyz;
+        for (int x = 0; x < loop_cnt; x++) xyz.set_i(x);
+        xyz.instance = null;
+        try {
+            xyz.set_i(0);
+        } catch (NullPointerException npe) {
+            System.out.println("Got expected NullPointerException:");
+            npe.printStackTrace();
+            return;
+        }
+        throw new InternalError("NullPointerException is missing!");
+    }
+
+}
diff --git a/hotspot/test/compiler/c2/TestReplacedNodesOSR.java b/hotspot/test/compiler/c2/TestReplacedNodesOSR.java
new file mode 100644
index 0000000..926295e
--- /dev/null
+++ b/hotspot/test/compiler/c2/TestReplacedNodesOSR.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2017, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8174164
+ * @summary SafePointNode::_replaced_nodes breaks with irreducible loops
+ * @run main/othervm -XX:-BackgroundCompilation TestReplacedNodesOSR
+ *
+ */
+
+public class TestReplacedNodesOSR {
+
+    static Object dummy;
+
+    static interface I {
+    }
+
+    static class A implements I {
+    }
+
+    static final class MyException extends Exception {
+    }
+
+    static final A obj = new A();
+    static I static_field() { return obj; }
+
+    // When OSR compiled, this method has an irreducible loop
+    static void test(int v, MyException e) {
+        int i = 0;
+        for (;;) {
+            if (i == 1000) {
+                break;
+            }
+            try {
+                if ((i%2) == 0) {
+                    int j = 0;
+                    for (;;) {
+                        j++;
+                        if (i+j != v) {
+                            if (j == 1000) {
+                                break;
+                            }
+                        } else {
+                            A a = (A)static_field();
+                            // replaced node recorded here
+                            throw e;
+                        }
+                    }
+                }
+            } catch(MyException ex) {
+            }
+            i++;
+            // replaced node applied on return of the method
+            // replaced node used here
+            dummy = static_field();
+        }
+    }
+
+
+    static public void main(String[] args) {
+        for (int i = 0; i < 1000; i++) {
+            test(1100, new MyException());
+        }
+    }
+}
diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java
index 4c81223..5009ba6 100644
--- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java
@@ -32,10 +32,10 @@
  * @run main compiler.calls.common.InvokeDynamicPatcher
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeDynamic
  *    -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeDynamic
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java
index 2544b4c..3387d3e 100644
--- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java
@@ -30,10 +30,10 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeInterface
  *    -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeInterface
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java
index 3018113..4948890 100644
--- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java
@@ -30,10 +30,10 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeSpecial
  *    -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeSpecial
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java
index a40d9d4..563c4c4 100644
--- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java
@@ -30,10 +30,10 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeStatic
  *    -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeStatic
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java
index c82f056..4a1f046 100644
--- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java
@@ -30,10 +30,10 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeVirtual
  *    -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch  compiler.calls.common.InvokeVirtual
  *    -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java
index 1d5ac09..b59a4f9 100644
--- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java
@@ -32,7 +32,7 @@
  * @run main compiler.calls.common.InvokeDynamicPatcher
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller  compiler.calls.common.InvokeDynamic
  *    -checkCallerCompileLevel 0 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java
index b03e5bd..63ab11a 100644
--- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java
@@ -30,7 +30,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller  compiler.calls.common.InvokeInterface
  *    -checkCallerCompileLevel 0 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java
index 8593ebc..c7dda1f 100644
--- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java
@@ -30,7 +30,7 @@
  * @build compiler.calls.common.InvokeSpecial
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller  compiler.calls.common.InvokeSpecial
  *    -checkCallerCompileLevel 0 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java
index a17e9c5..ca2613b 100644
--- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java
@@ -30,7 +30,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller  compiler.calls.common.InvokeStatic
  *    -checkCallerCompileLevel 0 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java
index 9ebf7a3..c983efd 100644
--- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java
@@ -30,7 +30,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller  compiler.calls.common.InvokeVirtual
  *    -checkCallerCompileLevel 0 -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java
index 7400771..1ddea48 100644
--- a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java
@@ -30,10 +30,10 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeSpecial
  *    -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeSpecial
  *    -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4
  */
diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java
index 4efd098..961daf5 100644
--- a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java
@@ -30,7 +30,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial
  *    -nativeCaller -checkCalleeCompileLevel 0
  */
diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java
index 1005783..bde00f6 100644
--- a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java
@@ -30,7 +30,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    compiler.calls.common.InvokeSpecial
  *    -nativeCaller -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java
index f1f0634..f86ca89 100644
--- a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java
@@ -30,10 +30,10 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeStatic
  *    -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeStatic
  *    -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4
  */
diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java
index fc0a059..fff5282 100644
--- a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java
@@ -30,7 +30,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic
  *    -nativeCaller -checkCalleeCompileLevel 0
  */
diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java
index f9da3d6..3d106fd 100644
--- a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java
@@ -30,7 +30,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    compiler.calls.common.InvokeStatic
  *    -nativeCaller -nativeCallee
  */
diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java
index b6cce29..7b74424 100644
--- a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java
@@ -30,10 +30,10 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeVirtual
  *    -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -Xbatch compiler.calls.common.InvokeVirtual
  *    -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4
  */
diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java
index 270ecfa..43be4d4 100644
--- a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java
@@ -30,7 +30,7 @@
  *
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual
  *    -nativeCaller -checkCalleeCompileLevel 0
  */
diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java
index 83564c1..9b9fe1a 100644
--- a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java
@@ -30,7 +30,7 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *    sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
  *    compiler.calls.common.InvokeVirtual
  *    -nativeCaller -nativeCallee
  */
diff --git a/hotspot/test/compiler/ciReplay/SABase.java b/hotspot/test/compiler/ciReplay/SABase.java
index 0354835..5769084 100644
--- a/hotspot/test/compiler/ciReplay/SABase.java
+++ b/hotspot/test/compiler/ciReplay/SABase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,7 +141,7 @@
         if (Platform.isSolaris()) {
             try {
                 OutputAnalyzer oa = ProcessTools.executeProcess("coreadm", "-p", "core",
-                        "" + ProcessHandle.current().getPid());
+                        "" + ProcessHandle.current().pid());
                 oa.shouldHaveExitValue(0);
             } catch (Throwable t) {
                 throw new Error("Can't launch coreadm: " + t, t);
diff --git a/hotspot/test/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java b/hotspot/test/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java
new file mode 100644
index 0000000..52ccab6
--- /dev/null
+++ b/hotspot/test/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test ReturnBlobToWrongHeapTest
+ * @key stress
+ * @summary Test if VM attempts to return code blobs to an incorrect code heap or to outside of the code cache.
+ * @library /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI
+ *                   -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method
+ *                   -XX:+SegmentedCodeCache
+ *                   -XX:ReservedCodeCacheSize=16M
+ *                   -XX:CodeCacheMinBlockLength=1
+ *                   compiler.codecache.stress.ReturnBlobToWrongHeapTest
+ */
+
+package compiler.codecache.stress;
+
+import sun.hotspot.code.BlobType;
+
+import java.util.ArrayList;
+
+public class ReturnBlobToWrongHeapTest {
+    private static final long largeBlobSize = Helper.WHITE_BOX.getUintxVMFlag("ReservedCodeCacheSize") >> 6;
+    private static final long codeCacheMinBlockLength = Helper.WHITE_BOX.getUintxVMFlag("CodeCacheMinBlockLength");
+    private static final BlobType[] BLOB_TYPES = BlobType.getAvailable().toArray(new BlobType[0]);
+
+    // Allocate blob in first code heap (the code heap with index 0).
+    private static long allocate(int size) {
+        return Helper.WHITE_BOX.allocateCodeBlob(size, BLOB_TYPES[0].id);
+    }
+
+    // Free blob.
+    private static void free(long address) {
+        Helper.WHITE_BOX.freeCodeBlob(address);
+    }
+
+    public static void main(String[] args) {
+        if (codeCacheMinBlockLength == 1) {
+            // Fill first code heap with large blobs until allocation fails.
+            long address;
+            while ((address = allocate((int)largeBlobSize)) != 0) {
+            }
+
+            // Allocate segment-sized blocks in first code heap.
+            long lastSegmentSizedAddress = 0; // Address of the last segment-sized blob allocated
+            while ((address = allocate(0)) != 0) {
+                lastSegmentSizedAddress = address;
+            }
+
+            if (lastSegmentSizedAddress == 0) {
+                throw new RuntimeException("Test failed: Not possible to allocate segment-sized blob");
+            }
+
+            // Remove last segment-sized block from the first code heap.
+            free(lastSegmentSizedAddress);
+        } else {
+            throw new RuntimeException("Test requires CodeCacheMinBlockLength==1; CodeCacheMinBlockLength is " +
+                                       codeCacheMinBlockLength);
+        }
+    }
+}
diff --git a/hotspot/test/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java b/hotspot/test/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java
new file mode 100644
index 0000000..86de751
--- /dev/null
+++ b/hotspot/test/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java
@@ -0,0 +1,320 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8158168
+ * @summary Verifies that callers of StringUTF16 intrinsics throw array out of bounds exceptions.
+ * @library /compiler/patches /test/lib
+ * @build java.base/java.lang.Helper
+ * @run main/othervm -Xbatch -XX:CompileThreshold=100 -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_getCharStringU,_putCharStringU compiler.intrinsics.string.TestStringUTF16IntrinsicRangeChecks
+ * @run main/othervm -Xbatch -XX:CompileThreshold=100 -esa -ea -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_getCharStringU,_putCharStringU compiler.intrinsics.string.TestStringUTF16IntrinsicRangeChecks
+ */
+package compiler.intrinsics.string;
+
+import java.lang.reflect.Field;
+import java.util.Arrays;
+
+public class TestStringUTF16IntrinsicRangeChecks {
+
+    public static void main(String[] args) throws Exception {
+        byte[] val = new byte[2];
+        byte[] b4  = new byte[4];
+        char[] c4  = new char[4];
+        String s4 = new String(c4);
+        byte[] valHigh = new byte[2];
+        byte[] valLow  = new byte[2];
+        Helper.putCharSB(valHigh, 0, Character.MIN_HIGH_SURROGATE);
+        Helper.putCharSB(valLow,  0, Character.MIN_LOW_SURROGATE);
+
+        for (int i = 0; i < 1000; ++i) {
+            getChars((int)1234, -5, -5 + 4, val);
+            getChars((int)1234, -1, -1 + 4, val);
+            getChars((int)1234,  0,  0 + 4, val);
+            getChars((int)1234,  1,  1 + 4, val);
+
+            getChars((long)1234, -5, -5 + 4, val);
+            getChars((long)1234, -1, -1 + 4, val);
+            getChars((long)1234,  0,  0 + 4, val);
+            getChars((long)1234,  1,  1 + 4, val);
+
+            byte[] val2 = Arrays.copyOf(val, val.length);
+            putCharSB(val2, -1, '!');
+            putCharSB(val2,  1, '!');
+
+            byte[] val4 = Arrays.copyOf(b4, b4.length);
+            char[] c2  = new char[2];
+            String s2 = new String(c2);
+
+            putCharsSB(val4, -3, c2, 0, 2);
+            putCharsSB(val4, -1, c2, 0, 2);
+            putCharsSB(val4,  0, c4, 0, 4);
+            putCharsSB(val4,  1, c2, 0, 2);
+            putCharsSB(val4, -3, s2, 0, 2);
+            putCharsSB(val4, -1, s2, 0, 2);
+            putCharsSB(val4,  0, s4, 0, 4);
+            putCharsSB(val4,  1, s2, 0, 2);
+
+            codePointAtSB(valHigh, -1, 1);
+            codePointAtSB(valHigh, -1, 2);
+            codePointAtSB(valHigh,  0, 2);
+            codePointAtSB(valHigh,  1, 2);
+
+            codePointBeforeSB(valLow,  0);
+            codePointBeforeSB(valLow, -1);
+            codePointBeforeSB(valLow,  2);
+
+            if (Helper.codePointCountSB(valHigh, 0, 1) != 1) {
+                throw new AssertionError("codePointCountSB");
+            }
+            if (Helper.codePointCountSB(valLow, 0, 1) != 1) {
+                throw new AssertionError("codePointCountSB");
+            }
+            codePointCountSB(valHigh, -1, 0);
+            codePointCountSB(valHigh, -1, 2);
+            codePointCountSB(valHigh,  0, 2);
+
+            charAt(val, -1);
+            charAt(val,  1);
+
+            contentEquals(b4, val, -1);
+            contentEquals(b4, val,  2);
+            contentEquals(val, s4,  2);
+            contentEquals(val, s4, -1);
+
+            StringBuilder sb = new StringBuilder();
+            sb.append((String)null).append(true).append(false);
+            if (!sb.toString().equals("nulltruefalse")) {
+                throw new AssertionError("append");
+            }
+
+            putCharsAt(val2, -1, '1', '2', '3', '4');
+            putCharsAt(val2,  0, '1', '2', '3', '4');
+            putCharsAt(val2,  2, '1', '2', '3', '4');
+            putCharsAt(val2, -1, '1', '2', '3', '4', '5');
+            putCharsAt(val2,  0, '1', '2', '3', '4', '5');
+            putCharsAt(val2,  2, '1', '2', '3', '4', '5');
+
+            reverse(valHigh, -1);
+            reverse(valHigh,  2);
+            reverse(valLow,  -1);
+            reverse(valLow,   2);
+
+            byte[] d4 = new byte[4];
+            inflate(b4, 0, d4, -1, 2);
+            inflate(b4, 0, d4,  3, 2);
+            inflate(b4, 0, d4,  4, 1);
+
+            byte[] b0 = new byte[0];
+            byte[] b1 = new byte[1];
+            byte[] b2 = new byte[2];
+            byte[] t1 = new byte[] {1};
+            byte[] t2 = new byte[] {1, 2};
+            byte[] t4 = new byte[] {1, 2, 3, 4};
+            indexOf(b1,  1, t2,  1, 0);
+            indexOf(b2,  1, t1,  1, 0);
+            indexOf(b2,  2, t2,  1, 0);
+            indexOf(b2,  1, t2,  2, 0);
+            indexOf(b2, -1, t2,  1, 0);
+            indexOf(b2,  1, t2, -1, 0);
+            indexOf(b2,  1, t2,  1, 1);
+
+            indexOfLatin1(b1,  1, t1,  1, 0);
+            indexOfLatin1(b2,  2, t1,  1, 0);
+            indexOfLatin1(b2,  1, b0,  1, 0);
+            indexOfLatin1(b2,  1, t1,  2, 0);
+            indexOfLatin1(b2, -1, t1,  1, 0);
+            indexOfLatin1(b2,  2, t1,  1, 0);
+            indexOfLatin1(b2,  1, t1, -1, 0);
+            indexOfLatin1(b2,  1, t1,  2, 0);
+
+            lastIndexOf(b1, t2, 1, 0);
+            lastIndexOf(b2, t4, 2, 0);
+            lastIndexOf(b2, t2, 1, 0);
+            lastIndexOf(b2, t2, 1, 1);
+
+            lastIndexOfLatin1(b1, t1, 1, 0);
+            lastIndexOfLatin1(b2, t2, 2, 0);
+            lastIndexOfLatin1(b2, t1, 1, 0);
+            lastIndexOfLatin1(b2, t1, 1, 1);
+        }
+    }
+
+    static void getChars(int i, int begin, int end, byte[] value) {
+        try {
+            Helper.getChars(i, begin, end, value);
+            throw new AssertionError("getChars");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void getChars(long l, int begin, int end, byte[] value) {
+        try {
+            Helper.getChars(l, begin, end, value);
+            throw new AssertionError("getChars");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void putCharSB(byte[] val, int index, int c) {
+        try {
+            Helper.putCharSB(val, index, c);
+            throw new AssertionError("putCharSB");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void putCharsSB(byte[] val, int index, char[] ca, int off, int end) {
+        try {
+            Helper.putCharsSB(val, index, ca, off, end);
+            throw new AssertionError("putCharsSB");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void putCharsSB(byte[] val, int index, CharSequence s, int off, int end) {
+        try {
+            Helper.putCharsSB(val, index, s, off, end);
+            throw new AssertionError("putCharsSB");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void codePointAtSB(byte[] val, int index, int end) {
+        try {
+            Helper.codePointAtSB(val, index, end);
+            throw new AssertionError("codePointAtSB");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void codePointBeforeSB(byte[] val, int index) {
+        try {
+            Helper.codePointBeforeSB(val, index);
+            throw new AssertionError("codePointBeforeSB");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void codePointCountSB(byte[] val, int beginIndex, int endIndex) {
+        try {
+            Helper.codePointCountSB(val, beginIndex, endIndex);
+            throw new AssertionError("codePointCountSB");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void charAt(byte[] v, int index) {
+        try {
+            Helper.charAt(v, index);
+            throw new AssertionError("charAt");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void contentEquals(byte[] v1, byte[] v2, int len) {
+        try {
+            Helper.contentEquals(v1, v2, len);
+            throw new AssertionError("contentEquals");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void contentEquals(byte[] v, CharSequence cs, int len) {
+        try {
+            Helper.contentEquals(v, cs, len);
+            throw new AssertionError("contentEquals");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void putCharsAt(byte[] v, int i, char c1, char c2, char c3, char c4) {
+        try {
+            Helper.putCharsAt(v, i, c1, c2, c3, c4);
+            throw new AssertionError("putCharsAt");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void putCharsAt(byte[] v, int i, char c1, char c2, char c3, char c4, char c5) {
+        try {
+            Helper.putCharsAt(v, i, c1, c2, c3, c4, c5);
+            throw new AssertionError("putCharsAt");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void reverse(byte[] v, int len) {
+        try {
+            Helper.reverse(v, len);
+            throw new AssertionError("reverse");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void inflate(byte[] v1, int o1, byte[] v2, int o2, int len) {
+        try {
+            Helper.inflate(v1, o1, v2, o2, len);
+            throw new AssertionError("inflate");
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void indexOf(byte[] v1, int l1, byte[] v2, int l2, int from) {
+        try {
+            if (Helper.indexOf(v1, l1, v2, l2, from) != -1) {
+                throw new AssertionError("indexOf");
+            }
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void lastIndexOf(byte[] v1, byte[] v2, int l2, int from) {
+        try {
+            if (Helper.lastIndexOf(v1, v2, l2, from) != -1) {
+                throw new AssertionError("lastIndexOf");
+            }
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void indexOfLatin1(byte[] v1, int l1, byte[] v2, int l2, int from) {
+        try {
+            if (Helper.indexOfLatin1(v1, l1, v2, l2, from) != -1) {
+                throw new AssertionError("indexOfLatin1");
+            }
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+
+    static void lastIndexOfLatin1(byte[] v1, byte[] v2, int l2, int from) {
+        try {
+            if (Helper.lastIndexOfLatin1(v1, v2, l2, from) != -1) {
+                throw new AssertionError("lastIndexOfLatin1");
+            }
+        } catch (IndexOutOfBoundsException io) {
+        }
+    }
+}
diff --git a/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java b/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java
index d9f2ddb..7fdd282 100644
--- a/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java
+++ b/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java
@@ -23,7 +23,6 @@
 
 /**
  * @test
- * @modules java.base/jdk.internal.misc
  * @library /test/lib /
  *
  * @run driver compiler.jsr292.ContinuousCallSiteTargetChange
@@ -31,6 +30,7 @@
 
 package compiler.jsr292;
 
+import jdk.test.lib.Asserts;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
@@ -39,15 +39,26 @@
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import java.lang.invoke.MutableCallSite;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 public class ContinuousCallSiteTargetChange {
-    static void testServer() throws Exception {
+    static final int ITERATIONS = Integer.parseInt(System.getProperty("iterations", "50"));
+
+    static void runTest(Class<?> test, String... extraArgs) throws Exception {
+        List<String> argsList = new ArrayList<>(
+                List.of("-XX:+IgnoreUnrecognizedVMOptions",
+                    "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
+                    "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining"));
+
+        argsList.addAll(Arrays.asList(extraArgs));
+
+        argsList.add(test.getName());
+        argsList.add(Integer.toString(ITERATIONS));
+
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-                "-XX:+IgnoreUnrecognizedVMOptions",
-                "-server", "-XX:-TieredCompilation", "-Xbatch",
-                "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
-                "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
-                Test.class.getName(), "100");
+                argsList.toArray(new String[argsList.size()]));
 
         OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
 
@@ -55,30 +66,42 @@
 
         analyzer.shouldNotContain("made not compilable");
         analyzer.shouldNotContain("decompile_count > PerMethodRecompilationCutoff");
+
     }
 
-    static void testClient() throws Exception {
-        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-                "-XX:+IgnoreUnrecognizedVMOptions",
-                "-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch",
-                "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
-                "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
-                Test.class.getName(), "100");
+    static void testServer(Class<?> test, String... args) throws Exception {
+        List<String> extraArgsList = new ArrayList<>(
+                List.of("-server", "-XX:-TieredCompilation"));
+        extraArgsList.addAll(Arrays.asList(args));
 
-        OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
+        runTest(test, extraArgsList.toArray(new String[extraArgsList.size()]));
+    }
 
-        analyzer.shouldHaveExitValue(0);
+    static void testClient(Class<?> test, String... args) throws Exception {
+        List<String> extraArgsList = new ArrayList<>(
+                List.of("-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1"));
+        extraArgsList.addAll(Arrays.asList(args));
 
-        analyzer.shouldNotContain("made not compilable");
-        analyzer.shouldNotContain("decompile_count > PerMethodRecompilationCutoff");
+        runTest(test, extraArgsList.toArray(new String[extraArgsList.size()]));
     }
 
     public static void main(String[] args) throws Exception {
-        testServer();
-        testClient();
+        testServer(RecompilationTest.class, "-Xbatch");
+        testClient(RecompilationTest.class, "-Xbatch");
+
+        testServer(PingPongTest.class);
+        testClient(PingPongTest.class);
     }
 
-    static class Test {
+    static MethodHandle findStatic(Class<?> cls, String name, MethodType mt) {
+        try {
+            return MethodHandles.lookup().findStatic(cls, name, mt);
+        } catch (Exception e) {
+            throw new Error(e);
+        }
+    }
+
+    static class RecompilationTest {
         static final MethodType mt = MethodType.methodType(void.class);
         static final CallSite cs = new MutableCallSite(mt);
 
@@ -96,7 +119,7 @@
         }
 
         static void iteration() throws Throwable {
-            MethodHandle mh1 = MethodHandles.lookup().findStatic(ContinuousCallSiteTargetChange.Test.class, "f", mt);
+            MethodHandle mh1 = findStatic(RecompilationTest.class, "f", mt);
             cs.setTarget(mh1);
             for (int i = 0; i < 20_000; i++) {
                 test1();
@@ -111,4 +134,38 @@
             }
         }
     }
+
+    static class PingPongTest {
+        static final MethodType mt = MethodType.methodType(void.class);
+        static final CallSite cs = new MutableCallSite(mt);
+
+        static final MethodHandle mh = cs.dynamicInvoker();
+
+        static final MethodHandle ping = findStatic(PingPongTest.class, "ping", mt);
+        static final MethodHandle pong = findStatic(PingPongTest.class, "pong", mt);
+
+        static void ping() {
+            Asserts.assertEQ(cs.getTarget(), ping, "wrong call site target");
+            cs.setTarget(pong);
+        }
+
+        static void pong() {
+            Asserts.assertEQ(cs.getTarget(), pong, "wrong call site target");
+            cs.setTarget(ping);
+        }
+
+        static void iteration() throws Throwable {
+            cs.setTarget(ping);
+            for (int i = 0; i < 20_000; i++) {
+                mh.invokeExact();
+            }
+        }
+
+        public static void main(String[] args) throws Throwable {
+            int iterations = Integer.parseInt(args[0]);
+            for (int i = 0; i < iterations; i++) {
+                iteration();
+            }
+        }
+    }
 }
diff --git a/hotspot/test/compiler/jsr292/InvokerSignatureMismatch.java b/hotspot/test/compiler/jsr292/InvokerSignatureMismatch.java
new file mode 100644
index 0000000..dbd9e01
--- /dev/null
+++ b/hotspot/test/compiler/jsr292/InvokerSignatureMismatch.java
@@ -0,0 +1,56 @@
+package compiler.jsr292;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.invoke.MethodHandleHelper;
+import jdk.internal.vm.annotation.ForceInline;
+
+/*
+ * @test
+ * @bug 8166110
+ * @library /test/lib / patches
+ * @modules java.base/jdk.internal.misc
+ *          java.base/jdk.internal.vm.annotation
+ *
+ * @build java.base/java.lang.invoke.MethodHandleHelper
+ * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:-TieredCompilation
+ *                                 compiler.jsr292.InvokerSignatureMismatch
+ */
+public class InvokerSignatureMismatch {
+
+    static final MethodHandle INT_MH;
+
+    static {
+        MethodHandle mhI = null;
+        try {
+           mhI = MethodHandles.lookup().findStatic(InvokerSignatureMismatch.class, "bodyI", MethodType.methodType(void.class, int.class));
+        } catch (Throwable e) {
+        }
+        INT_MH = mhI;
+    }
+
+    public static void main(String[] args) throws Throwable {
+        for (int i = 0; i < 50_000; i++) { // OSR
+            mainLink(i);
+            mainInvoke(i);
+        }
+    }
+
+    static void mainLink(int i) throws Throwable {
+        Object name = MethodHandleHelper.internalMemberName(INT_MH);
+        MethodHandleHelper.linkToStatic(INT_MH, (float) i, name);
+    }
+
+    static void mainInvoke(int i) throws Throwable {
+        MethodHandleHelper.invokeBasicV(INT_MH, (float) i);
+    }
+
+    static int cnt = 0;
+    static void bodyI(int x) {
+        if ((x & 1023) == 0) { // already optimized x % 1024 == 0
+            ++cnt;
+        }
+    }
+
+}
diff --git a/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java b/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java
index a473262..f19244b 100644
--- a/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java
+++ b/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java
@@ -44,6 +44,21 @@
     }
 
     @ForceInline
+    public static Object internalMemberName(MethodHandle mh) throws Throwable {
+        return mh.internalMemberName();
+    }
+
+    @ForceInline
+    public static void linkToStatic(MethodHandle mh, float arg, Object name) throws Throwable {
+        MethodHandle.linkToStatic(mh, arg, name);
+    }
+
+    @ForceInline
+    public static void invokeBasicV(MethodHandle mh, float arg) throws Throwable {
+        mh.invokeBasic(arg);
+    }
+
+    @ForceInline
     public static Object invokeBasicL(MethodHandle mh) throws Throwable {
         return mh.invokeBasic();
     }
diff --git a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java
index 481334f..67fe462 100644
--- a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java
+++ b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java
@@ -27,7 +27,7 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.runtime
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *      -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=true
  *      -XX:+EnableJVMCI
diff --git a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java
index b86cfbf..a52e19b3 100644
--- a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java
+++ b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java
@@ -28,8 +28,8 @@
  * @library /test/lib /
  * @library common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *      -XX:+EnableJVMCI
  *      compiler.jvmci.SecurityRestrictionsTest
diff --git a/hotspot/test/compiler/jvmci/common/CTVMUtilities.java b/hotspot/test/compiler/jvmci/common/CTVMUtilities.java
index 7ba6d00..7f32d95 100644
--- a/hotspot/test/compiler/jvmci/common/CTVMUtilities.java
+++ b/hotspot/test/compiler/jvmci/common/CTVMUtilities.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,6 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.lang.reflect.Parameter;
 import java.util.HashMap;
 import java.util.Map;
diff --git a/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
new file mode 100644
index 0000000..1cdee2d
--- /dev/null
+++ b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
@@ -0,0 +1,309 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.vm.ci.hotspot;
+
+import jdk.vm.ci.code.InstalledCode;
+import jdk.vm.ci.code.InvalidInstalledCodeException;
+import jdk.vm.ci.code.TargetDescription;
+import jdk.vm.ci.meta.ConstantPool;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import java.lang.reflect.Executable;
+
+/**
+ * A simple "proxy" class to get test access to CompilerToVM package-private methods
+ */
+public class CompilerToVMHelper {
+    public static final CompilerToVM CTVM = new CompilerToVM();
+
+    public static byte[] getBytecode(HotSpotResolvedJavaMethod method) {
+        return CTVM.getBytecode((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static int getExceptionTableLength(HotSpotResolvedJavaMethod method) {
+        return CTVM.getExceptionTableLength((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static long getExceptionTableStart(HotSpotResolvedJavaMethod method) {
+        return CTVM.getExceptionTableStart((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static Object getFlagValue(String name) {
+        return CTVM.getFlagValue(name);
+    }
+
+    public static boolean isCompilable(HotSpotResolvedJavaMethod method) {
+        return CTVM.isCompilable((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static boolean hasNeverInlineDirective(HotSpotResolvedJavaMethod method) {
+        return CTVM.hasNeverInlineDirective((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static boolean shouldInlineMethod(HotSpotResolvedJavaMethod method) {
+        return CTVM.shouldInlineMethod((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static HotSpotResolvedJavaMethod findUniqueConcreteMethod(
+            HotSpotResolvedObjectType actualHolderType,
+            HotSpotResolvedJavaMethod method) {
+        return CTVM.findUniqueConcreteMethod((HotSpotResolvedObjectTypeImpl) actualHolderType, (HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static HotSpotResolvedObjectType getImplementor(HotSpotResolvedObjectType type) {
+        return CTVM.getImplementor((HotSpotResolvedObjectTypeImpl) type);
+    }
+
+    public static boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethod method) {
+        return CTVM.methodIsIgnoredBySecurityStackWalk((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static HotSpotResolvedObjectType lookupType(String name,
+            Class<?> accessingClass, boolean resolve) {
+        return CTVM.lookupType(name, accessingClass, resolve);
+    }
+
+    public static Object resolveConstantInPool(ConstantPool constantPool, int cpi) {
+        return CTVM.resolveConstantInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static Object resolvePossiblyCachedConstantInPool(ConstantPool constantPool, int cpi) {
+        return CTVM.resolvePossiblyCachedConstantInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static int lookupNameAndTypeRefIndexInPool(ConstantPool constantPool, int cpi) {
+        return CTVM.lookupNameAndTypeRefIndexInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static String lookupNameInPool(ConstantPool constantPool, int cpi) {
+        return CTVM.lookupNameInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static String lookupSignatureInPool(ConstantPool constantPool, int cpi) {
+        return CTVM.lookupSignatureInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static int lookupKlassRefIndexInPool(ConstantPool constantPool, int cpi) {
+        return CTVM.lookupKlassRefIndexInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static Object lookupKlassInPool(ConstantPool constantPool, int cpi) {
+        return CTVM.lookupKlassInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static HotSpotResolvedJavaMethod lookupMethodInPool(
+            ConstantPool constantPool, int cpi, byte opcode) {
+        return CTVM.lookupMethodInPool((HotSpotConstantPool) constantPool, cpi, opcode);
+    }
+
+    public static void resolveInvokeDynamicInPool(
+            ConstantPool constantPool, int cpi) {
+        CTVM.resolveInvokeDynamicInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static void resolveInvokeHandleInPool(
+            ConstantPool constantPool, int cpi) {
+        CTVM.resolveInvokeHandleInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static HotSpotResolvedObjectType resolveTypeInPool(
+            ConstantPool constantPool, int cpi) {
+        return CTVM.resolveTypeInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static HotSpotResolvedObjectType resolveFieldInPool(
+            ConstantPool constantPool, int cpi, ResolvedJavaMethod method, byte opcode, int[] info) {
+        return CTVM.resolveFieldInPool((HotSpotConstantPool) constantPool, cpi, (HotSpotResolvedJavaMethodImpl) method, opcode, info);
+    }
+
+    public static int constantPoolRemapInstructionOperandFromCache(
+            ConstantPool constantPool, int cpci) {
+        return CTVM.constantPoolRemapInstructionOperandFromCache((HotSpotConstantPool) constantPool, cpci);
+    }
+
+    public static Object lookupAppendixInPool(
+            ConstantPool constantPool, int cpi) {
+        return CTVM.lookupAppendixInPool((HotSpotConstantPool) constantPool, cpi);
+    }
+
+    public static int installCode(TargetDescription target,
+            HotSpotCompiledCode compiledCode, InstalledCode code, HotSpotSpeculationLog speculationLog) {
+        return CTVM.installCode(target, compiledCode, code, speculationLog);
+    }
+
+    public static int getMetadata(TargetDescription target,
+            HotSpotCompiledCode compiledCode, HotSpotMetaData metaData) {
+        return CTVM.getMetadata(target, compiledCode, metaData);
+    }
+
+    public static void resetCompilationStatistics() {
+        CTVM.resetCompilationStatistics();
+    }
+
+    public static Object[] readConfiguration() {
+        return CTVM.readConfiguration();
+    }
+
+    public static HotSpotResolvedJavaMethod resolveMethod(
+            HotSpotResolvedObjectType exactReceiver,
+            HotSpotResolvedJavaMethod method,
+            HotSpotResolvedObjectType caller) {
+        return CTVM.resolveMethod((HotSpotResolvedObjectTypeImpl) exactReceiver, (HotSpotResolvedJavaMethodImpl) method, (HotSpotResolvedObjectTypeImpl) caller);
+    }
+
+    public static HotSpotResolvedJavaMethod getClassInitializer(
+            HotSpotResolvedObjectType type) {
+        return CTVM.getClassInitializer((HotSpotResolvedObjectTypeImpl) type);
+    }
+
+    public static boolean hasFinalizableSubclass(HotSpotResolvedObjectType type) {
+        return CTVM.hasFinalizableSubclass((HotSpotResolvedObjectTypeImpl) type);
+    }
+
+    public static HotSpotResolvedJavaMethodImpl asResolvedJavaMethod(
+            Executable executable) {
+        return CTVM.asResolvedJavaMethod(executable);
+    }
+
+    public static long getMaxCallTargetOffset(long address) {
+        return CTVM.getMaxCallTargetOffset(address);
+    }
+
+    public static String disassembleCodeBlob(InstalledCode codeBlob) {
+        return CTVM.disassembleCodeBlob(codeBlob);
+    }
+
+    public static StackTraceElement getStackTraceElement(
+            HotSpotResolvedJavaMethod method, int bci) {
+        return CTVM.getStackTraceElement((HotSpotResolvedJavaMethodImpl)method, bci);
+    }
+
+    public static Object executeInstalledCode(Object[] args,
+            InstalledCode installedCode) throws InvalidInstalledCodeException {
+        return CTVM.executeInstalledCode(args, installedCode);
+    }
+
+    public static long[] getLineNumberTable(HotSpotResolvedJavaMethod method) {
+        return CTVM.getLineNumberTable((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static int getLocalVariableTableLength(HotSpotResolvedJavaMethod method) {
+        return CTVM.getLocalVariableTableLength((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static long getLocalVariableTableStart(HotSpotResolvedJavaMethod method) {
+        return CTVM.getLocalVariableTableStart((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static void doNotInlineOrCompile(HotSpotResolvedJavaMethod method) {
+        CTVM.doNotInlineOrCompile((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static void reprofile(HotSpotResolvedJavaMethod method) {
+        CTVM.reprofile((HotSpotResolvedJavaMethodImpl)method);
+    }
+
+    public static void invalidateInstalledCode(InstalledCode installedCode) {
+        CTVM.invalidateInstalledCode(installedCode);
+    }
+
+    public static long[] collectCounters() {
+        return CTVM.collectCounters();
+    }
+
+    public static boolean isMature(long metaspaceMethodData) {
+        return CTVM.isMature(metaspaceMethodData);
+    }
+
+    public static int allocateCompileId(HotSpotResolvedJavaMethod method,
+            int entryBCI) {
+        return CTVM.allocateCompileId((HotSpotResolvedJavaMethodImpl) method, entryBCI);
+    }
+
+    public static boolean hasCompiledCodeForOSR(
+            HotSpotResolvedJavaMethod method, int entryBCI, int level) {
+        return CTVM.hasCompiledCodeForOSR((HotSpotResolvedJavaMethodImpl) method, entryBCI, level);
+    }
+
+    public static String getSymbol(long metaspaceSymbol) {
+        return CTVM.getSymbol(metaspaceSymbol);
+    }
+
+    public static HotSpotStackFrameReference getNextStackFrame(
+            HotSpotStackFrameReference frame,
+            ResolvedJavaMethod[] methods, int initialSkip) {
+        return CTVM.getNextStackFrame(frame, methods, initialSkip);
+    }
+
+    public static void materializeVirtualObjects(
+            HotSpotStackFrameReference stackFrame, boolean invalidate) {
+        CTVM.materializeVirtualObjects(stackFrame, invalidate);
+    }
+
+    public static int getVtableIndexForInterfaceMethod(HotSpotResolvedObjectType type,
+            HotSpotResolvedJavaMethod method) {
+        return CTVM.getVtableIndexForInterfaceMethod((HotSpotResolvedObjectTypeImpl) type, (HotSpotResolvedJavaMethodImpl) method);
+    }
+
+    public static boolean shouldDebugNonSafepoints() {
+        return CTVM.shouldDebugNonSafepoints();
+    }
+
+    public static void writeDebugOutput(byte[] bytes, int offset, int length) {
+        CTVM.writeDebugOutput(bytes, offset, length);
+    }
+
+    public static void flushDebugOutput() {
+        CTVM.flushDebugOutput();
+    }
+
+    public static HotSpotResolvedJavaMethod getResolvedJavaMethod(Object base,
+            long displacement) {
+        return CTVM.getResolvedJavaMethod(base, displacement);
+    }
+
+    public static HotSpotConstantPool getConstantPool(Object object) {
+        return CTVM.getConstantPool(object);
+    }
+
+    public static HotSpotResolvedObjectType getResolvedJavaType(Object base,
+            long displacement, boolean compressed) {
+        return CTVM.getResolvedJavaType(base, displacement, compressed);
+    }
+
+    public static long getMetaspacePointer(Object o) {
+        return ((MetaspaceWrapperObject) o).getMetaspacePointer();
+    }
+
+    public static Class<?> CompilerToVMClass() {
+        return CompilerToVM.class;
+    }
+
+    public static Class<?> HotSpotConstantPoolClass() {
+        return HotSpotConstantPool.class;
+    }
+
+    public static Class<?> getMirror(HotSpotResolvedObjectType type) {
+        return ((HotSpotResolvedJavaType) type).mirror();
+    }
+}
diff --git a/hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/MetaAccessWrapper.java b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/MetaAccessWrapper.java
similarity index 100%
rename from hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/MetaAccessWrapper.java
rename to hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/MetaAccessWrapper.java
diff --git a/hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/PublicMetaspaceWrapperObject.java b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/PublicMetaspaceWrapperObject.java
similarity index 100%
rename from hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/PublicMetaspaceWrapperObject.java
rename to hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/PublicMetaspaceWrapperObject.java
diff --git a/hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java b/hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
deleted file mode 100644
index fc03353..0000000
--- a/hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.vm.ci.hotspot;
-
-import jdk.vm.ci.code.InstalledCode;
-import jdk.vm.ci.code.InvalidInstalledCodeException;
-import jdk.vm.ci.code.TargetDescription;
-import jdk.vm.ci.meta.ConstantPool;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import java.lang.reflect.Executable;
-
-/**
- * A simple "proxy" class to get test access to CompilerToVM package-private methods
- */
-public class CompilerToVMHelper {
-    public static final CompilerToVM CTVM = new CompilerToVM();
-
-    public static byte[] getBytecode(HotSpotResolvedJavaMethod method) {
-        return CTVM.getBytecode((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static int getExceptionTableLength(HotSpotResolvedJavaMethod method) {
-        return CTVM.getExceptionTableLength((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static long getExceptionTableStart(HotSpotResolvedJavaMethod method) {
-        return CTVM.getExceptionTableStart((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static boolean isCompilable(HotSpotResolvedJavaMethod method) {
-        return CTVM.isCompilable((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static boolean hasNeverInlineDirective(HotSpotResolvedJavaMethod method) {
-        return CTVM.hasNeverInlineDirective((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static boolean shouldInlineMethod(HotSpotResolvedJavaMethod method) {
-        return CTVM.shouldInlineMethod((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static HotSpotResolvedJavaMethod findUniqueConcreteMethod(
-            HotSpotResolvedObjectType actualHolderType,
-            HotSpotResolvedJavaMethod method) {
-        return CTVM.findUniqueConcreteMethod((HotSpotResolvedObjectTypeImpl) actualHolderType, (HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static HotSpotResolvedObjectType getImplementor(HotSpotResolvedObjectType type) {
-        return CTVM.getImplementor((HotSpotResolvedObjectTypeImpl) type);
-    }
-
-    public static boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethod method) {
-        return CTVM.methodIsIgnoredBySecurityStackWalk((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static HotSpotResolvedObjectType lookupType(String name,
-            Class<?> accessingClass, boolean resolve) {
-        return CTVM.lookupType(name, accessingClass, resolve);
-    }
-
-    public static Object resolveConstantInPool(ConstantPool constantPool, int cpi) {
-        return CTVM.resolveConstantInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static Object resolvePossiblyCachedConstantInPool(ConstantPool constantPool, int cpi) {
-        return CTVM.resolvePossiblyCachedConstantInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static int lookupNameAndTypeRefIndexInPool(ConstantPool constantPool, int cpi) {
-        return CTVM.lookupNameAndTypeRefIndexInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static String lookupNameInPool(ConstantPool constantPool, int cpi) {
-        return CTVM.lookupNameInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static String lookupSignatureInPool(ConstantPool constantPool, int cpi) {
-        return CTVM.lookupSignatureInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static int lookupKlassRefIndexInPool(ConstantPool constantPool, int cpi) {
-        return CTVM.lookupKlassRefIndexInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static Object lookupKlassInPool(ConstantPool constantPool, int cpi) {
-        return CTVM.lookupKlassInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static HotSpotResolvedJavaMethod lookupMethodInPool(
-            ConstantPool constantPool, int cpi, byte opcode) {
-        return CTVM.lookupMethodInPool((HotSpotConstantPool) constantPool, cpi, opcode);
-    }
-
-    public static void resolveInvokeDynamicInPool(
-            ConstantPool constantPool, int cpi) {
-        CTVM.resolveInvokeDynamicInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static void resolveInvokeHandleInPool(
-            ConstantPool constantPool, int cpi) {
-        CTVM.resolveInvokeHandleInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static HotSpotResolvedObjectType resolveTypeInPool(
-            ConstantPool constantPool, int cpi) {
-        return CTVM.resolveTypeInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static HotSpotResolvedObjectType resolveFieldInPool(
-            ConstantPool constantPool, int cpi, ResolvedJavaMethod method, byte opcode, long[] info) {
-        return CTVM.resolveFieldInPool((HotSpotConstantPool) constantPool, cpi, (HotSpotResolvedJavaMethodImpl) method, opcode, info);
-    }
-
-    public static int constantPoolRemapInstructionOperandFromCache(
-            ConstantPool constantPool, int cpci) {
-        return CTVM.constantPoolRemapInstructionOperandFromCache((HotSpotConstantPool) constantPool, cpci);
-    }
-
-    public static Object lookupAppendixInPool(
-            ConstantPool constantPool, int cpi) {
-        return CTVM.lookupAppendixInPool((HotSpotConstantPool) constantPool, cpi);
-    }
-
-    public static int installCode(TargetDescription target,
-            HotSpotCompiledCode compiledCode, InstalledCode code, HotSpotSpeculationLog speculationLog) {
-        return CTVM.installCode(target, compiledCode, code, speculationLog);
-    }
-
-    public static int getMetadata(TargetDescription target,
-            HotSpotCompiledCode compiledCode, HotSpotMetaData metaData) {
-        return CTVM.getMetadata(target, compiledCode, metaData);
-    }
-
-    public static void resetCompilationStatistics() {
-        CTVM.resetCompilationStatistics();
-    }
-
-    public static Object[] readConfiguration() {
-        return CTVM.readConfiguration();
-    }
-
-    public static HotSpotResolvedJavaMethod resolveMethod(
-            HotSpotResolvedObjectType exactReceiver,
-            HotSpotResolvedJavaMethod method,
-            HotSpotResolvedObjectType caller) {
-        return CTVM.resolveMethod((HotSpotResolvedObjectTypeImpl) exactReceiver, (HotSpotResolvedJavaMethodImpl) method, (HotSpotResolvedObjectTypeImpl) caller);
-    }
-
-    public static HotSpotResolvedJavaMethod getClassInitializer(
-            HotSpotResolvedObjectType type) {
-        return CTVM.getClassInitializer((HotSpotResolvedObjectTypeImpl) type);
-    }
-
-    public static boolean hasFinalizableSubclass(HotSpotResolvedObjectType type) {
-        return CTVM.hasFinalizableSubclass((HotSpotResolvedObjectTypeImpl) type);
-    }
-
-    public static HotSpotResolvedJavaMethodImpl asResolvedJavaMethod(
-            Executable executable) {
-        return CTVM.asResolvedJavaMethod(executable);
-    }
-
-    public static long getMaxCallTargetOffset(long address) {
-        return CTVM.getMaxCallTargetOffset(address);
-    }
-
-    public static String disassembleCodeBlob(InstalledCode codeBlob) {
-        return CTVM.disassembleCodeBlob(codeBlob);
-    }
-
-    public static StackTraceElement getStackTraceElement(
-            HotSpotResolvedJavaMethod method, int bci) {
-        return CTVM.getStackTraceElement((HotSpotResolvedJavaMethodImpl)method, bci);
-    }
-
-    public static Object executeInstalledCode(Object[] args,
-            InstalledCode installedCode) throws InvalidInstalledCodeException {
-        return CTVM.executeInstalledCode(args, installedCode);
-    }
-
-    public static long[] getLineNumberTable(HotSpotResolvedJavaMethod method) {
-        return CTVM.getLineNumberTable((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static int getLocalVariableTableLength(HotSpotResolvedJavaMethod method) {
-        return CTVM.getLocalVariableTableLength((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static long getLocalVariableTableStart(HotSpotResolvedJavaMethod method) {
-        return CTVM.getLocalVariableTableStart((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static void doNotInlineOrCompile(HotSpotResolvedJavaMethod method) {
-        CTVM.doNotInlineOrCompile((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static void reprofile(HotSpotResolvedJavaMethod method) {
-        CTVM.reprofile((HotSpotResolvedJavaMethodImpl)method);
-    }
-
-    public static void invalidateInstalledCode(InstalledCode installedCode) {
-        CTVM.invalidateInstalledCode(installedCode);
-    }
-
-    public static long[] collectCounters() {
-        return CTVM.collectCounters();
-    }
-
-    public static boolean isMature(long metaspaceMethodData) {
-        return CTVM.isMature(metaspaceMethodData);
-    }
-
-    public static int allocateCompileId(HotSpotResolvedJavaMethod method,
-            int entryBCI) {
-        return CTVM.allocateCompileId((HotSpotResolvedJavaMethodImpl) method, entryBCI);
-    }
-
-    public static boolean hasCompiledCodeForOSR(
-            HotSpotResolvedJavaMethod method, int entryBCI, int level) {
-        return CTVM.hasCompiledCodeForOSR((HotSpotResolvedJavaMethodImpl) method, entryBCI, level);
-    }
-
-    public static String getSymbol(long metaspaceSymbol) {
-        return CTVM.getSymbol(metaspaceSymbol);
-    }
-
-    public static HotSpotStackFrameReference getNextStackFrame(
-            HotSpotStackFrameReference frame,
-            ResolvedJavaMethod[] methods, int initialSkip) {
-        return CTVM.getNextStackFrame(frame, methods, initialSkip);
-    }
-
-    public static void materializeVirtualObjects(
-            HotSpotStackFrameReference stackFrame, boolean invalidate) {
-        CTVM.materializeVirtualObjects(stackFrame, invalidate);
-    }
-
-    public static int getVtableIndexForInterfaceMethod(HotSpotResolvedObjectType type,
-            HotSpotResolvedJavaMethod method) {
-        return CTVM.getVtableIndexForInterfaceMethod((HotSpotResolvedObjectTypeImpl) type, (HotSpotResolvedJavaMethodImpl) method);
-    }
-
-    public static boolean shouldDebugNonSafepoints() {
-        return CTVM.shouldDebugNonSafepoints();
-    }
-
-    public static void writeDebugOutput(byte[] bytes, int offset, int length) {
-        CTVM.writeDebugOutput(bytes, offset, length);
-    }
-
-    public static void flushDebugOutput() {
-        CTVM.flushDebugOutput();
-    }
-
-    public static HotSpotResolvedJavaMethod getResolvedJavaMethod(Object base,
-            long displacement) {
-        return CTVM.getResolvedJavaMethod(base, displacement);
-    }
-
-    public static HotSpotConstantPool getConstantPool(Object object) {
-        return CTVM.getConstantPool(object);
-    }
-
-    public static HotSpotResolvedObjectType getResolvedJavaType(Object base,
-            long displacement, boolean compressed) {
-        return CTVM.getResolvedJavaType(base, displacement, compressed);
-    }
-
-    public static long getMetaspacePointer(Object o) {
-        return ((MetaspaceWrapperObject) o).getMetaspacePointer();
-    }
-
-    public static Class<?> CompilerToVMClass() {
-        return CompilerToVM.class;
-    }
-
-    public static Class<?> HotSpotConstantPoolClass() {
-        return HotSpotConstantPool.class;
-    }
-
-    public static Class<?> getMirror(HotSpotResolvedObjectType type) {
-        return ((HotSpotResolvedJavaType) type).mirror();
-    }
-}
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java
index adfece8..7aaf6bd 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java
index 09e8f0e..19fc495 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.meta
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.AsResolvedJavaMethodTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java
index 507c569..f729894 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java
@@ -28,8 +28,8 @@
  * @library / /test/lib/
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *                   -XX:+EnableJVMCI
  *                   -XX:JVMCICounterSize=0
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java b/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java
index 6f2ccb0..f799f0c 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java
@@ -202,13 +202,13 @@
         public final String type;
         public final ResolvedJavaMethod[] methods;
         public final byte[] opcodes;
-        public final long accFlags;
+        public final int accFlags;
 
-        public TestedCPEntry(String klass, String name, String type, byte[] opcodes, long accFlags) {
+        public TestedCPEntry(String klass, String name, String type, byte[] opcodes, int accFlags) {
                 this(klass, name, type, null, opcodes, accFlags);
         }
 
-        public TestedCPEntry(String klass, String name, String type, ResolvedJavaMethod[] methods, byte[] opcodes, long accFlags) {
+        public TestedCPEntry(String klass, String name, String type, ResolvedJavaMethod[] methods, byte[] opcodes, int accFlags) {
             this.klass = klass;
             this.name = name;
             this.type = type;
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java b/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java
index e0bb9d4..0ac7f3d 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java
@@ -206,7 +206,7 @@
                                       "stringFieldEmpty",
                                       "Ljava/lang/String;",
                                       new byte[] {(byte) Opcodes.PUTFIELD | (byte) Opcodes.GETFIELD},
-                                      0L),
+                                      0),
                 }
         );
         CP_MAP_FOR_CLASS.put(CONSTANT_METHODREF,
@@ -362,7 +362,7 @@
                                       "stringFieldEmpty",
                                       "Ljava/lang/String;",
                                       new byte[] {(byte) Opcodes.PUTFIELD | (byte) Opcodes.GETFIELD},
-                                      0L),
+                                      0),
                 }
         );
         CP_MAP_FOR_ABS_CLASS.put(CONSTANT_METHODREF,
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java
index 806c2e7..a66a448 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java
@@ -28,8 +28,8 @@
  * @library / /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm compiler.jvmci.compilerToVM.DebugOutputTest
  */
 
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java
index 9101d2a..09f9b94 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  *        compiler.jvmci.compilerToVM.DisassembleCodeBlobTest
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java
index 57e2e1f..f77ea7e 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java
index 5d7c4d3..02e4b68 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java
@@ -21,6 +21,26 @@
  * questions.
  */
 
+/*
+ * @test
+ * @bug 8136421
+ * @requires vm.jvmci
+ * @library /test/lib /
+ * @library ../common/patches
+ * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.org.objectweb.asm.tree
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:.
+ *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest
+ */
+
 package compiler.jvmci.compilerToVM;
 
 import jdk.test.lib.Asserts;
@@ -36,26 +56,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-/*
- * @test
- * @bug 8136421
- * @requires vm.jvmci
- * @library /test/lib /
- * @library ../common/patches
- * @modules java.base/jdk.internal.misc
- * @modules java.base/jdk.internal.org.objectweb.asm
- *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
- * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:.
- *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *                   compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest
- */
-
 public class ExecuteInstalledCodeTest {
 
     public static void main(String[] args) {
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java
index 4f39cf0..e00f3ffe 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java
@@ -30,11 +30,11 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java
index e959482..37f358f 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java
@@ -30,9 +30,9 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetBytecodeTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java
index 5dcc9f4..57eb96b 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java
@@ -28,8 +28,8 @@
  * @library / /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetClassInitializerTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
index 2aa3937..da4eae2 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
@@ -29,12 +29,12 @@
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
-            java.base/jdk.internal.org.objectweb.asm.tree
-            jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.code
+ *          java.base/jdk.internal.org.objectweb.asm.tree
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java
index af7c9bb..018c51b 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java
@@ -30,9 +30,9 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetExceptionTableTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetFlagValueTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetFlagValueTest.java
new file mode 100644
index 0000000..b074ca8
--- /dev/null
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetFlagValueTest.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173912
+ * @requires vm.jvmci
+ * @library / /test/lib
+ * @library ../common/patches
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                  -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ *                  compiler.jvmci.compilerToVM.GetFlagValueTest
+ */
+
+package compiler.jvmci.compilerToVM;
+
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+import sun.hotspot.WhiteBox;
+
+public class GetFlagValueTest {
+    public static void main(String[] args) throws Exception {
+        try {
+            CompilerToVMHelper.getFlagValue(null);
+            Asserts.fail("Expected NullPointerException when calling getFlagValue(null)");
+        } catch (NullPointerException e) {
+            // expected
+        }
+
+        Object missing = CompilerToVMHelper.getFlagValue("this is surely not a flag");
+        Asserts.assertEquals(CompilerToVMHelper.CTVM, missing);
+
+        ProcessBuilder pb;
+        OutputAnalyzer out;
+
+        String[] arguments = {"-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", "-XX:+PrintFlagsFinal", "-version"};
+        pb = ProcessTools.createJavaProcessBuilder(arguments);
+        out = new OutputAnalyzer(pb.start());
+
+        out.shouldHaveExitValue(0);
+        String[] lines = out.getStdout().split("\\r?\\n");
+        Asserts.assertTrue(lines.length > 1, "Expected output from -XX:+PrintFlagsFinal");
+
+        final WhiteBox wb = WhiteBox.getWhiteBox();
+
+        // Line example: ccstr PrintIdealGraphAddress = 127.0.0.1 {C2 notproduct} {default}
+        Pattern flagLine = Pattern.compile("(\\w+)\\s+(\\w+)\\s+:?= (?:(.+))\\{[^}]+\\}\\s+\\{[^}]+\\}");
+        for (String line : lines) {
+            if (line.indexOf('=') != -1) {
+                line = line.trim();
+                Matcher m = flagLine.matcher(line);
+                Asserts.assertTrue(m.matches(), "Unexpected line in -XX:+PrintFlagsFinal output: " + line);
+                String type = m.group(1);
+                String name = m.group(2);
+                String expect = m.group(3).trim();
+                Object value = CompilerToVMHelper.getFlagValue(name);
+                Object wbValue = wb.getVMFlag(name);
+                Asserts.assertEquals(value, wbValue, "Value of flag " + name);
+            }
+        }
+    }
+}
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java
index 3811c74..1da08ed 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java
@@ -28,8 +28,8 @@
  * @library / /test/lib/
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetImplementorTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java
index 33b20f2..c9812d7 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java
@@ -31,9 +31,9 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetLineNumberTableTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java
index 8202d12..8ab8f16 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java
@@ -30,13 +30,13 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
  * @clean compiler.jvmci.compilerToVM.*
  * @compile -g DummyInterface.java
  * @compile -g DummyAbstractClass.java
  * @compile -g DummyClass.java
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetLocalVariableTableTest
  * @clean compiler.jvmci.compilerToVM.*
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java
index 0923e10..bf43ca4 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java
@@ -28,8 +28,8 @@
  * @library / /test/lib/
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetMaxCallTargetOffsetTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java
index 0b079f37..c01bd02 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.meta
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetNextStackFrameTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java
index b50dd8e..ef47d2d 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java
@@ -28,10 +28,10 @@
  * @library / /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc:+open
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot:+open
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
- *        jdk.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *        jdk.internal.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject
  *        sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java
index 483f141..bbf288e 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java
@@ -28,11 +28,11 @@
  * @library / /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
- *        jdk.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *        jdk.internal.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject
  *        sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java
index 0c3e4ba..63e4342 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java
@@ -30,9 +30,9 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetStackTraceElementTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java
index 87c4053..ddefd57 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc:+open
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- * @modules         jdk.vm.ci/jdk.vm.ci.hotspot:+open
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.meta
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                  compiler.jvmci.compilerToVM.GetSymbolTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java
index 8cfc1d8..af8eabe 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java
@@ -30,9 +30,9 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.GetVtableIndexForInterfaceTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java
index 969a7f6..010c230 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java
index 57ec63a..c56176e 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java
@@ -28,8 +28,8 @@
  * @library / /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                  compiler.jvmci.compilerToVM.HasFinalizableSubclassTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java
index 7efd8d2..1f2a1e2 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java
index 828dc77..66566c2 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java
@@ -30,11 +30,11 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.InvalidateInstalledCodeTest
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java
index 0243690..b11c080 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
@@ -42,7 +42,7 @@
  *                   compiler.jvmci.compilerToVM.IsCompilableTest
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler
  *                   compiler.jvmci.compilerToVM.IsCompilableTest
  */
 
@@ -69,20 +69,17 @@
     }
 
     private static void runSanityTest(Executable aMethod) {
-        boolean UseJVMCICompiler = (Boolean) WB.getVMFlag("UseJVMCICompiler");
         HotSpotResolvedJavaMethod method = CTVMUtilities
                 .getResolvedMethod(aMethod);
         boolean isCompilable = CompilerToVMHelper.isCompilable(method);
-        boolean expected = UseJVMCICompiler || WB.isMethodCompilable(aMethod);
+        boolean expected = WB.isMethodCompilable(aMethod);
         Asserts.assertEQ(isCompilable, expected, "Unexpected initial " +
                 "value of property 'compilable'");
 
-        if (!UseJVMCICompiler) {
-            WB.makeMethodNotCompilable(aMethod);
-            isCompilable = CompilerToVMHelper.isCompilable(method);
-            Asserts.assertFalse(isCompilable, aMethod + "Unexpected value of " +
-                "property 'isCompilable' after setting 'compilable' to false");
-        }
+        WB.makeMethodNotCompilable(aMethod);
+        isCompilable = CompilerToVMHelper.isCompilable(method);
+        Asserts.assertFalse(isCompilable, aMethod + "Unexpected value of " +
+            "property 'isCompilable' after setting 'compilable' to false");
     }
 
     private static List<Executable> createTestCases() {
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java
index e1427d0..329990e 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java
@@ -28,9 +28,9 @@
  * @library / /test/lib
  *          ../common/patches
  * @modules java.base/jdk.internal.misc
- *          jdk.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  *        sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java
new file mode 100644
index 0000000..b9d36ab
--- /dev/null
+++ b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8136421
+ * @requires vm.jvmci
+ * @library / /test/lib
+ *          ../common/patches
+ * @modules java.base/jdk.internal.misc
+ *          java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.org.objectweb.asm.tree
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *        sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *     -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbatch
+ *     compiler.jvmci.compilerToVM.IsMatureVsReprofileTest
+ */
+
+package compiler.jvmci.compilerToVM;
+
+import compiler.jvmci.common.CTVMUtilities;
+import compiler.jvmci.common.testcases.SimpleClass;
+import jdk.vm.ci.hotspot.CompilerToVMHelper;
+import jdk.test.lib.Asserts;
+import sun.hotspot.WhiteBox;
+import compiler.whitebox.CompilerWhiteBoxTest;
+import java.lang.reflect.Executable;
+import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
+import jdk.test.lib.Platform;
+
+public class IsMatureVsReprofileTest {
+    private static final WhiteBox WB = WhiteBox.getWhiteBox();
+    private static final boolean TIERED = WB.getBooleanVMFlag("TieredCompilation");
+    private static final boolean IS_XCOMP = Platform.isComp();
+
+    public static void main(String[] args) throws Exception {
+        new IsMatureVsReprofileTest().test();
+    }
+
+    public void test() throws Exception {
+        SimpleClass sclass = new SimpleClass();
+        Executable method = SimpleClass.class.getDeclaredMethod("testMethod");
+        long metaspaceMethodData = WB.getMethodData(method);
+        Asserts.assertEQ(metaspaceMethodData, 0L, "MDO should be null for a "
+                 + "never invoked method");
+        boolean isMature = CompilerToVMHelper.isMature(metaspaceMethodData);
+        Asserts.assertFalse(isMature, "null MDO can't be mature");
+        for (int i = 0; i < CompilerWhiteBoxTest.THRESHOLD; i++) {
+            sclass.testMethod();
+        }
+        Asserts.assertTrue(WB.isMethodCompiled(method),
+                "Method should be compiled");
+        metaspaceMethodData = WB.getMethodData(method);
+        Asserts.assertNE(metaspaceMethodData, 0L,
+                "Multiple times invoked method should have MDO");
+        isMature = CompilerToVMHelper.isMature(metaspaceMethodData);
+        /* a method is not mature for -Xcomp and -Tiered,
+           see NonTieredCompPolicy::is_mature */
+        Asserts.assertEQ(!IS_XCOMP || TIERED, isMature,
+                "Unexpected isMature state for compiled method");
+        HotSpotResolvedJavaMethod resolvedMethod
+                = CTVMUtilities.getResolvedMethod(method);
+        CompilerToVMHelper.reprofile(resolvedMethod);
+        Asserts.assertFalse(WB.isMethodCompiled(method),
+                "Unexpected method compilation state after reprofile");
+        metaspaceMethodData = WB.getMethodData(method);
+        isMature = CompilerToVMHelper.isMature(metaspaceMethodData);
+        Asserts.assertNE(metaspaceMethodData, 0L,
+                "Got null MDO after reprofile");
+        Asserts.assertEQ(TIERED && IS_XCOMP, isMature,
+                "Got unexpected isMature state after reprofiling");
+    }
+}
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java
index 826868a..0c0e60b 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java
@@ -27,8 +27,8 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @modules java.base/jdk.internal.misc:open
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot:open
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:open
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *      -Dcompiler.jvmci.compilerToVM.JVM_RegisterJVMCINatives.positive=true
  *      -XX:+EnableJVMCI
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java
index 690ef34..16afdf9a9 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java
@@ -32,11 +32,11 @@
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java
index e53d695..3bc88b9 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java
@@ -31,11 +31,11 @@
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java
index f6d139c..a0eafe8 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java
@@ -31,11 +31,11 @@
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java
index ed376e0..01e4eb1 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java
@@ -31,11 +31,11 @@
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java
index e01f023..459e577 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java
@@ -31,11 +31,11 @@
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java
index 3dc8a64..e8cf434 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java
@@ -31,11 +31,11 @@
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java
index 225da69..50a48e2 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java
@@ -28,8 +28,8 @@
  * @library / /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.LookupTypeTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java
index dee13cf..ef0d3cc 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java
@@ -32,27 +32,55 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xmixed -Xbootclasspath/a:.
+ * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *                   -XX:CompileCommand=exclude,*::check
+ *                   -XX:CompileCommand=exclude,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::check
+ *                   -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame
+ *                   -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame2
+ *                   -XX:CompileCommand=inline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::recurse
  *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
- *                   -Xbatch
+ *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=true
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false
  *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
- * @run main/othervm -Xmixed -Xbootclasspath/a:.
+ * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *                   -XX:CompileCommand=exclude,*::check
+ *                   -XX:CompileCommand=exclude,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::check
+ *                   -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame
+ *                   -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame2
+ *                   -XX:CompileCommand=inline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::recurse
  *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
- *                   -Xbatch
+ *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=false
+ *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false
+ *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
+ * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
+ *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -XX:CompileCommand=exclude,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::check
+ *                   -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame
+ *                   -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame2
+ *                   -XX:CompileCommand=inline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::recurse
+ *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
+ *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=true
+ *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=true
+ *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
+ * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
+ *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -XX:CompileCommand=exclude,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::check
+ *                   -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame
+ *                   -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame2
+ *                   -XX:CompileCommand=inline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::recurse
+ *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
+ *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=false
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=true
  *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
  */
@@ -72,25 +100,41 @@
 
 public class MaterializeVirtualObjectTest {
     private static final WhiteBox WB;
-    private static final Method METHOD;
-    private static final ResolvedJavaMethod RESOLVED_METHOD;
     private static final boolean INVALIDATE;
     private static final int COMPILE_THRESHOLD;
+    private static final Method MATERIALIZED_METHOD;
+    private static final Method NOT_MATERIALIZED_METHOD;
+    private static final ResolvedJavaMethod MATERIALIZED_RESOLVED;
+    private static final ResolvedJavaMethod NOT_MATERIALIZED_RESOLVED;
+    private static final boolean MATERIALIZE_FIRST;
 
     static {
+        Method method1;
+        Method method2;
         WB = WhiteBox.getWhiteBox();
         try {
-            METHOD = MaterializeVirtualObjectTest.class.getDeclaredMethod(
-                    "testFrame", String.class, int.class);
+            method1 = MaterializeVirtualObjectTest.class.getDeclaredMethod("testFrame",
+                    String.class, int.class);
+            method2 = MaterializeVirtualObjectTest.class.getDeclaredMethod("testFrame2",
+                    String.class, int.class);
         } catch (NoSuchMethodException e) {
             throw new Error("Can't get executable for test method", e);
         }
-        RESOLVED_METHOD = CTVMUtilities.getResolvedMethod(METHOD);
+        ResolvedJavaMethod resolved1;
+        ResolvedJavaMethod resolved2;
+        resolved1 = CTVMUtilities.getResolvedMethod(method1);
+        resolved2 = CTVMUtilities.getResolvedMethod(method2);
         INVALIDATE = Boolean.getBoolean(
                 "compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate");
         COMPILE_THRESHOLD = WB.getBooleanVMFlag("TieredCompilation")
                 ? CompilerWhiteBoxTest.THRESHOLD
                 : CompilerWhiteBoxTest.THRESHOLD * 2;
+        MATERIALIZE_FIRST = Boolean.getBoolean(
+                "compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst");
+        MATERIALIZED_RESOLVED = MATERIALIZE_FIRST ? resolved1 : resolved2;
+        NOT_MATERIALIZED_RESOLVED = MATERIALIZE_FIRST ? resolved2 : resolved1;
+        MATERIALIZED_METHOD = MATERIALIZE_FIRST ? method1 : method2;
+        NOT_MATERIALIZED_METHOD = MATERIALIZE_FIRST ? method2 : method1;
     }
 
     public static void main(String[] args) {
@@ -105,47 +149,87 @@
     }
 
     private static String getName() {
-        return "CASE: invalidate=" + INVALIDATE;
+        return "CASE: invalidate=" + INVALIDATE + ", materializedMethod="
+                + (MATERIALIZE_FIRST ? "testFrame" : "testFrame2")
+                + ", notMaterializedMethod="
+                + (MATERIALIZE_FIRST ? "testFrame2" : "testFrame");
     }
 
     private void test() {
         System.out.println(getName());
-        Asserts.assertFalse(WB.isMethodCompiled(METHOD), getName()
-                + " : method unexpectedly compiled");
-        /* need to trigger compilation by multiple method invocations
-           in order to have method profile data to be gathered */
-        for (int i = 0; i < COMPILE_THRESHOLD; i++) {
+        Asserts.assertFalse(WB.isMethodCompiled(MATERIALIZED_METHOD),
+                getName() + " : materialized method is compiled");
+        Asserts.assertFalse(WB.isMethodCompiled(NOT_MATERIALIZED_METHOD),
+                getName() + " : not materialized method is compiled");
+        for (int i = 0; i < CompilerWhiteBoxTest.THRESHOLD; i++) {
             testFrame("someString", i);
         }
-        Asserts.assertTrue(WB.isMethodCompiled(METHOD), getName()
-                + "Method unexpectedly not compiled");
-        testFrame("someString", COMPILE_THRESHOLD);
+        Asserts.assertTrue(WB.isMethodCompiled(MATERIALIZED_METHOD), getName()
+                + " : materialized method not compiled");
+        Asserts.assertTrue(WB.isMethodCompiled(NOT_MATERIALIZED_METHOD),
+                getName() + " : not materialized method not compiled");
+        testFrame("someString", /* materialize */ CompilerWhiteBoxTest.THRESHOLD);
     }
 
     private void testFrame(String str, int iteration) {
         Helper helper = new Helper(str);
-        check(iteration);
+        testFrame2(str, iteration);
         Asserts.assertTrue((helper.string != null) && (this != null)
-                && (helper != null), getName() + " : some locals are null");
+                && (helper != null), String.format("%s : some locals are null", getName()));
+     }
+
+    private void testFrame2(String str, int iteration) {
+        Helper helper = new Helper(str);
+        recurse(2, iteration);
+        Asserts.assertTrue((helper.string != null) && (this != null)
+                && (helper != null), String.format("%s : some locals are null", getName()));
+    }
+
+    private void recurse(int depth, int iteration) {
+        if (depth == 0) {
+            check(iteration);
+        } else {
+            Integer s = new Integer(depth);
+            recurse(depth - 1, iteration);
+            Asserts.assertEQ(s.intValue(), depth,
+                    String.format("different values: %s != %s", s.intValue(), depth));
+        }
     }
 
     private void check(int iteration) {
         // Materialize virtual objects on last invocation
         if (iteration == COMPILE_THRESHOLD) {
-            HotSpotStackFrameReference hsFrame = CompilerToVMHelper
-                    .getNextStackFrame(/* topmost frame */ null,
-                            new ResolvedJavaMethod[]{
-                                RESOLVED_METHOD}, /* don't skip any */ 0);
-            Asserts.assertNotNull(hsFrame, getName() + " : got null frame");
-            Asserts.assertTrue(WB.isMethodCompiled(METHOD), getName()
-                    + "Test method should be compiled");
-            Asserts.assertTrue(hsFrame.hasVirtualObjects(), getName()
-                    + ": has no virtual object before materialization");
-            CompilerToVMHelper.materializeVirtualObjects(hsFrame, INVALIDATE);
-            Asserts.assertFalse(hsFrame.hasVirtualObjects(), getName()
-                    + " : has virtual object after materialization");
-            Asserts.assertEQ(WB.isMethodCompiled(METHOD), !INVALIDATE, getName()
-                    + " : unexpected compiled status");
+            // get frames and check not-null
+            HotSpotStackFrameReference materialized = CompilerToVMHelper.getNextStackFrame(
+                    /* topmost frame */ null, new ResolvedJavaMethod[]{MATERIALIZED_RESOLVED},
+                    /* don't skip any */ 0);
+            Asserts.assertNotNull(materialized, getName()
+                    + " : got null frame for materialized method");
+            HotSpotStackFrameReference notMaterialized = CompilerToVMHelper.getNextStackFrame(
+                    /* topmost frame */ null, new ResolvedJavaMethod[]{NOT_MATERIALIZED_RESOLVED},
+                    /* don't skip any */ 0);
+            Asserts.assertNE(materialized, notMaterialized,
+                    "Got same frame pointer for both tested frames");
+            Asserts.assertNotNull(notMaterialized, getName()
+                    + " : got null frame for not materialized method");
+            // check that frames has virtual objects before materialization stage
+            Asserts.assertTrue(materialized.hasVirtualObjects(), getName()
+                    + ": materialized frame has no virtual object before materialization");
+            Asserts.assertTrue(notMaterialized.hasVirtualObjects(), getName()
+                    + ": notMaterialized frame has no virtual object before materialization");
+            // materialize
+            CompilerToVMHelper.materializeVirtualObjects(materialized, INVALIDATE);
+            // check that only not materialized frame has virtual objects
+            Asserts.assertFalse(materialized.hasVirtualObjects(), getName()
+                    + " : materialized has virtual object after materialization");
+            Asserts.assertTrue(notMaterialized.hasVirtualObjects(), getName()
+                    + " : notMaterialized has no virtual object after materialization");
+            // check that materialized frame was deoptimized in case invalidate=true
+            Asserts.assertEQ(WB.isMethodCompiled(MATERIALIZED_METHOD), !INVALIDATE, getName()
+                    + " : materialized method has unexpected compiled status");
+            // check that not materialized frame wasn't deoptimized
+            Asserts.assertTrue(WB.isMethodCompiled(NOT_MATERIALIZED_METHOD), getName()
+                    + " : not materialized method has unexpected compiled status");
         }
     }
 
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java
index 6f87bcf..ea5834f 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java
@@ -31,9 +31,9 @@
  * @modules java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java
index 866756c..01476b2 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java
@@ -28,8 +28,8 @@
  * @library / /test/lib
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.ReadConfigurationTest
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.ReadConfigurationTest
@@ -38,6 +38,7 @@
 package compiler.jvmci.compilerToVM;
 
 import jdk.test.lib.Asserts;
+import jdk.vm.ci.hotspot.VMField;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
 import jdk.vm.ci.hotspot.HotSpotVMConfigAccess;
 import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
@@ -49,10 +50,19 @@
     }
 
     private void runTest() {
-        TestHotSpotVMConfig config = new TestHotSpotVMConfig(HotSpotJVMCIRuntime.runtime().getConfigStore());
+        HotSpotVMConfigStore store = HotSpotJVMCIRuntime.runtime().getConfigStore();
+        TestHotSpotVMConfig config = new TestHotSpotVMConfig(store);
         Asserts.assertNE(config.codeCacheHighBound, 0L, "Got null address");
         Asserts.assertNE(config.stubRoutineJintArrayCopy, 0L, "Got null address");
 
+        for (VMField field : store.getFields().values()) {
+                Object value = field.value;
+                if (value != null) {
+                    Asserts.assertTrue(value instanceof Long || value instanceof Boolean,
+                        "Got unexpected value type for VM field " + field.name + ": " + value.getClass());
+                }
+        }
+
         for (VMIntrinsicMethod m : config.getStore().getIntrinsics()) {
             Asserts.assertNotNull(m);
             Asserts.assertNotNull(m.declaringClass);
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java
index 9953d4c..e563106 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java
@@ -30,11 +30,11 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java
index 63aef07..b54f7c5 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java
@@ -30,11 +30,11 @@
  * @modules java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java
index 2ee506b..59f84b0 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java
@@ -31,11 +31,11 @@
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
@@ -103,7 +103,7 @@
             cached = "cached ";
         }
         for (int j = 0; j < entry.opcodes.length; j++) {
-            long[] info = new long[2];
+            int[] info = new int[3];
             HotSpotResolvedObjectType fieldToVerify
                     = CompilerToVMHelper.resolveFieldInPool(constantPoolCTVM,
                                                            index,
@@ -147,11 +147,11 @@
             } catch (Exception ex) {
                 throw new Error("Unexpected exception", ex);
             }
-            long offsetToRefer;
+            int offsetToRefer;
             if ((entry.accFlags & Opcodes.ACC_STATIC) != 0) {
-                offsetToRefer = UNSAFE.staticFieldOffset(fieldToRefer);
+                offsetToRefer = (int) UNSAFE.staticFieldOffset(fieldToRefer);
             } else {
-                offsetToRefer = UNSAFE.objectFieldOffset(fieldToRefer);
+                offsetToRefer = (int) UNSAFE.objectFieldOffset(fieldToRefer);
             }
             msg = String.format("Field offset returned by resolveFieldInPool"
                                         + " method is wrong for the field %s.%s"
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java
index 248077d..b594c1a 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java
@@ -30,9 +30,9 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   compiler.jvmci.compilerToVM.ResolveMethodTest
  */
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java
index ca91e75..94f5fc3 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java
@@ -31,11 +31,11 @@
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java
index 3f48fd2..fe2aeee 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java
@@ -31,11 +31,11 @@
  * @modules java.base/jdk.internal.misc
  *          java.base/jdk.internal.reflect
  *          java.base/jdk.internal.org.objectweb.asm
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java
index 18a571b..0cefb66 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java
@@ -28,8 +28,8 @@
  * @library / /test/lib/
  * @library ../common/patches
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+DebugNonSafepoints
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java
index 675a136..7b1ee71 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java
@@ -30,10 +30,10 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:.
diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java
index 7ef5f8e..5393208 100644
--- a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java
+++ b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java
@@ -24,12 +24,12 @@
 /**
  * @test
  * @requires vm.jvmci
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.common
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.common
  * @compile CodeInstallerTest.java
  * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidCompilationResult
  */
diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java
index 8d3e92b..90af63b 100644
--- a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java
+++ b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java
@@ -24,12 +24,12 @@
 /**
  * @test
  * @requires vm.jvmci
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.common
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.common
  * @compile CodeInstallerTest.java
  * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidDebugInfo
  */
diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java
index 2e3f5f6..f94b83e 100644
--- a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java
+++ b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java
@@ -24,12 +24,12 @@
 /**
  * @test
  * @requires vm.jvmci
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.common
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.common
  * @compile CodeInstallerTest.java
  * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidOopMap
  */
diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java
index 84a4c90..f9e3392 100644
--- a/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java
+++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java
@@ -30,12 +30,13 @@
  * @modules java.base/jdk.internal.misc
  *          java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.services
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.common.JVMCIHelpers
  * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyBootstrapFinishedEventTest.config
  *     ./META-INF/services/jdk.vm.ci.services.JVMCIServiceLocator
diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java
index bb888c3..6b7bf29 100644
--- a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java
+++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java
@@ -30,13 +30,14 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.org.objectweb.asm
  *          java.base/jdk.internal.org.objectweb.asm.tree
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.services
  *
- * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
+ * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.common.JVMCIHelpers
  * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyInstallEventTest.config
  *     ./META-INF/services/jdk.vm.ci.services.JVMCIServiceLocator
diff --git a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java
index 76f6538..4006965 100644
--- a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java
+++ b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java
@@ -27,10 +27,11 @@
  * @requires vm.jvmci
  * @library /test/lib /
  * @modules java.base/jdk.internal.misc
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.services
  *
  * @build compiler.jvmci.common.JVMCIHelpers
  *        compiler.jvmci.events.JvmciShutdownEventListener
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java
index 10a968f..dadc401 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java
@@ -25,13 +25,13 @@
  * @test
  * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9")
  * @library /
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.amd64
- *          jdk.vm.ci/jdk.vm.ci.sparc
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.amd64
+ *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.DataPatchTest
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java
index 05d8bdb..003093c 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java
@@ -24,14 +24,14 @@
 /**
  * @test
  * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9")
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.common
- *          jdk.vm.ci/jdk.vm.ci.amd64
- *          jdk.vm.ci/jdk.vm.ci.sparc
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.common
+ *          jdk.internal.vm.ci/jdk.vm.ci.amd64
+ *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.InterpreterFrameSizeTest
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java
index 7896557..2197a22 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java
@@ -25,14 +25,14 @@
  * @test
  * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9")
  * @library /
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.common
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.amd64
- *          jdk.vm.ci/jdk.vm.ci.sparc
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.common
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.amd64
+ *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.MaxOopMapStackOffsetTest
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java
index 49a52f8..61f0e72 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java
@@ -25,14 +25,14 @@
  * @test
  * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9")
  * @library /test/lib /
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.common
- *          jdk.vm.ci/jdk.vm.ci.amd64
- *          jdk.vm.ci/jdk.vm.ci.sparc
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.common
+ *          jdk.internal.vm.ci/jdk.vm.ci.amd64
+ *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java TestHotSpotVMConfig.java NativeCallTest.java TestAssembler.java sparc/SPARCTestAssembler.java amd64/AMD64TestAssembler.java
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI  -Xbootclasspath/a:. jdk.vm.ci.code.test.NativeCallTest
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java
index 908eaf6..6402386 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java
@@ -25,13 +25,13 @@
  * @test
  * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9")
  * @library /
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.amd64
- *          jdk.vm.ci/jdk.vm.ci.sparc
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.amd64
+ *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.SimpleCodeInstallationTest
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java
index 6f3833e..251d8e3 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java
@@ -25,13 +25,13 @@
  * @test
  * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9")
  * @library /
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.amd64
- *          jdk.vm.ci/jdk.vm.ci.sparc
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.amd64
+ *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.SimpleDebugInfoTest
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java
index c0dadbbc..b4bdcbf 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java
@@ -25,13 +25,13 @@
  * @test
  * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9")
  * @library /
- * @modules jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.code
- *          jdk.vm.ci/jdk.vm.ci.code.site
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.amd64
- *          jdk.vm.ci/jdk.vm.ci.sparc
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.amd64
+ *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.VirtualObjectDebugInfoTest
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java
index b3ee631..2b98970 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java
@@ -24,9 +24,9 @@
 /*
  * @test jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest
  * @requires vm.jvmci
- * @modules jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.hotspot
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
  *          java.base/jdk.internal.vm.annotation
  *          java.base/jdk.internal.misc
  * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java
index fcbc721..1122bd7 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java
@@ -27,6 +27,7 @@
 
 import org.testng.annotations.DataProvider;
 
+import sun.hotspot.WhiteBox;
 import jdk.internal.misc.Unsafe;
 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider;
@@ -36,6 +37,10 @@
 import jdk.vm.ci.meta.JavaConstant;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.runtime.JVMCI;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
 
 public class MemoryAccessProviderData {
     private static final Unsafe UNSAFE = Unsafe.getUnsafe();
@@ -43,6 +48,18 @@
     private static final TestClass TEST_OBJECT = new TestClass();
     private static final JavaConstant TEST_CONSTANT = CONSTANT_REFLECTION.forObject(TEST_OBJECT);
     private static final JavaConstant TEST_CLASS_CONSTANT = CONSTANT_REFLECTION.forObject(TestClass.class);
+    private static KindData[] PRIMITIVE_KIND_DATA = {
+        new KindData(JavaKind.Boolean, TEST_OBJECT),
+        new KindData(JavaKind.Byte, TEST_OBJECT),
+        new KindData(JavaKind.Char, TEST_OBJECT),
+        new KindData(JavaKind.Short, TEST_OBJECT),
+        new KindData(JavaKind.Int, TEST_OBJECT),
+        new KindData(JavaKind.Float, TEST_OBJECT),
+        new KindData(JavaKind.Long, TEST_OBJECT),
+        new KindData(JavaKind.Double, TEST_OBJECT)
+    };
+    private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+
 
     @DataProvider(name = "positiveObject")
     public static Object[][] getPositiveObjectJavaKind() {
@@ -54,51 +71,40 @@
 
     @DataProvider(name = "positivePrimitive")
     public static Object[][] getPositivePrimitiveJavaKinds() {
-        Field booleanField;
-        Field byteField;
-        Field shortField;
-        Field intField;
-        Field longField;
-        Field floatField;
-        Field doubleField;
-        Field charField;
-        try {
-            booleanField = MemoryAccessProviderData.TestClass.class.getDeclaredField("booleanField");
-            byteField = MemoryAccessProviderData.TestClass.class.getDeclaredField("byteField");
-            shortField = MemoryAccessProviderData.TestClass.class.getDeclaredField("shortField");
-            intField = MemoryAccessProviderData.TestClass.class.getDeclaredField("intField");
-            longField = MemoryAccessProviderData.TestClass.class.getDeclaredField("longField");
-            floatField = MemoryAccessProviderData.TestClass.class.getDeclaredField("floatField");
-            doubleField = MemoryAccessProviderData.TestClass.class.getDeclaredField("doubleField");
-            charField = MemoryAccessProviderData.TestClass.class.getDeclaredField("charField");
-        } catch (NoSuchFieldException e) {
-            throw new Error("TESTBUG: can't find test field " + e, e);
+        List<Object[]> result = new ArrayList<>();
+        for (KindData k : PRIMITIVE_KIND_DATA) {
+            result.add(new Object[] {k.kind, TEST_CONSTANT, k.instanceFieldOffset, k.instanceFieldValue, Math.max(8, k.kind.getBitCount())});
+            result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, k.staticFieldOffset, k.staticFieldValue, Math.max(8, k.kind.getBitCount())});
         }
-        long booleanFieldOffset = UNSAFE.objectFieldOffset(booleanField);
-        long byteFieldOffset = UNSAFE.objectFieldOffset(byteField);
-        long shortFieldOffset = UNSAFE.objectFieldOffset(shortField);
-        long intFieldOffset = UNSAFE.objectFieldOffset(intField);
-        long longFieldOffset = UNSAFE.objectFieldOffset(longField);
-        long floatFieldOffset = UNSAFE.objectFieldOffset(floatField);
-        long doubleFieldOffset = UNSAFE.objectFieldOffset(doubleField);
-        long charFieldOffset = UNSAFE.objectFieldOffset(charField);
-        return new Object[][]{
-                        new Object[]{JavaKind.Boolean, TEST_CONSTANT, booleanFieldOffset,
-                                        JavaConstant.forBoolean(TEST_OBJECT.booleanField), 8},
-                        new Object[]{JavaKind.Byte, TEST_CONSTANT, byteFieldOffset,
-                                        JavaConstant.forByte(TEST_OBJECT.byteField), 8},
-                        new Object[]{JavaKind.Short, TEST_CONSTANT, shortFieldOffset,
-                                        JavaConstant.forShort(TEST_OBJECT.shortField), 16},
-                        new Object[]{JavaKind.Int, TEST_CONSTANT, intFieldOffset,
-                                        JavaConstant.forInt(TEST_OBJECT.intField), 32},
-                        new Object[]{JavaKind.Long, TEST_CONSTANT, longFieldOffset,
-                                        JavaConstant.forLong(TEST_OBJECT.longField), 64},
-                        new Object[]{JavaKind.Float, TEST_CONSTANT, floatFieldOffset,
-                                        JavaConstant.forFloat(TEST_OBJECT.floatField), 32},
-                        new Object[]{JavaKind.Double, TEST_CONSTANT, doubleFieldOffset,
-                                        JavaConstant.forDouble(TEST_OBJECT.doubleField), 64},
-                        new Object[]{JavaKind.Char, TEST_CONSTANT, charFieldOffset,
-                                        JavaConstant.forChar(TEST_OBJECT.charField), 16}};
+        return result.toArray(new Object[result.size()][]);
+    }
+
+    @DataProvider(name = "outOfBoundsInstanceFields")
+    public static Object[][] getOutOfBoundsStaticFieldReads() {
+        long instanceSize = WHITE_BOX.getObjectSize(TEST_OBJECT);
+        List<Object[]> result = new ArrayList<>();
+        for (KindData k : PRIMITIVE_KIND_DATA) {
+            long lastValidOffset = instanceSize - (k.kind.getByteCount());
+            result.add(new Object[] {k.kind, TEST_CONSTANT, lastValidOffset, false});
+            result.add(new Object[] {k.kind, TEST_CONSTANT, (long) -1, true});
+            result.add(new Object[] {k.kind, TEST_CONSTANT, lastValidOffset + 1, true});
+            result.add(new Object[] {k.kind, TEST_CONSTANT, lastValidOffset + 100, true});
+        }
+        return result.toArray(new Object[result.size()][]);
+    }
+
+    @DataProvider(name = "outOfBoundsStaticFields")
+    public static Object[][] getOutOfBoundsInstanceFieldReads() {
+        long staticsSize = WHITE_BOX.getObjectSize(TEST_OBJECT.getClass());
+        List<Object[]> result = new ArrayList<>();
+        for (KindData k : PRIMITIVE_KIND_DATA) {
+            long lastValidOffset = staticsSize - (k.kind.getByteCount());
+            result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, lastValidOffset, false});
+            result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, (long) -1, true});
+            result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, lastValidOffset + 1, true});
+            result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, lastValidOffset + 100, true});
+        }
+        return result.toArray(new Object[result.size()][]);
     }
 
     @DataProvider(name = "negative")
@@ -108,6 +114,7 @@
                         new Object[]{JavaKind.Illegal, JavaConstant.INT_1}};
     }
 
+
     private static class TestClass {
         public final boolean booleanField = true;
         public final byte byteField = 2;
@@ -117,6 +124,43 @@
         public final double doubleField = 6.0d;
         public final float floatField = 7.0f;
         public final char charField = 'a';
-        public final String stringField = "abc";
+        public final String objectField = "abc";
+
+        public static final boolean booleanStaticField = true;
+        public static final byte byteStaticField = 2;
+        public static final short shortStaticField = 3;
+        public static final int intStaticField = 4;
+        public static final long longStaticField = 5L;
+        public static final double doubleStaticField = 6.0d;
+        public static final float floatStaticField = 7.0f;
+        public static final char charStaticField = 'a';
+        public static final String objectStaticField = "abc";
+    }
+
+
+    static class KindData {
+        final JavaKind kind;
+        final Field instanceField;
+        final Field staticField;
+        final long instanceFieldOffset;
+        final long staticFieldOffset;
+        final JavaConstant instanceFieldValue;
+        final JavaConstant staticFieldValue;
+        KindData(JavaKind kind, Object testObject) {
+            this.kind = kind;
+            try {
+                Class<?> c = testObject.getClass();
+                instanceField = c.getDeclaredField(kind.getJavaName() + "Field");
+                staticField = c.getDeclaredField(kind.getJavaName() + "StaticField");
+                instanceField.setAccessible(true);
+                staticField.setAccessible(true);
+                instanceFieldOffset = UNSAFE.objectFieldOffset(instanceField);
+                staticFieldOffset = UNSAFE.staticFieldOffset(staticField);
+                instanceFieldValue = JavaConstant.forBoxedPrimitive(instanceField.get(testObject));
+                staticFieldValue = JavaConstant.forBoxedPrimitive(staticField.get(null));
+            } catch (Exception e) {
+                throw new Error("TESTBUG for kind " + kind, e);
+            }
+        }
     }
 }
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java
index bbf4c3a..783294d 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java
@@ -26,17 +26,24 @@
  * @bug 8152341
  * @requires vm.jvmci
  * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.common
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.hotspot
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.common
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
  *          java.base/jdk.internal.misc
- * @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                                sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run testng/othervm -Xbootclasspath/a:.
+ *      -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *      -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *      jdk.vm.ci.hotspot.test.MemoryAccessProviderTest
  */
 
 package jdk.vm.ci.hotspot.test;
 
+import sun.hotspot.WhiteBox;
+
 import jdk.vm.ci.meta.Constant;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.MemoryAccessProvider;
@@ -59,7 +66,27 @@
 
     @Test(dataProvider = "negative", dataProviderClass = MemoryAccessProviderData.class, expectedExceptions = {IllegalArgumentException.class})
     public void testNegativeReadPrimitiveConstant(JavaKind kind, Constant base) {
-        PROVIDER.readPrimitiveConstant(kind, base, 0L, kind == null ? 0 : kind.getBitCount());
+        PROVIDER.readPrimitiveConstant(kind, base, 0L, kind == null ? 0 : kind.getByteCount() / 8);
+    }
+
+    @Test(dataProvider = "outOfBoundsInstanceFields", dataProviderClass = MemoryAccessProviderData.class)
+    public void testReadPrimitiveInstanceFieldOutOfBounds(JavaKind kind, Constant base, Long offset, boolean isOutOfBounds) {
+        try {
+            PROVIDER.readPrimitiveConstant(kind, base, offset, kind.getByteCount() * 8);
+            Assert.assertFalse(isOutOfBounds);
+        } catch (IllegalArgumentException iae) {
+            Assert.assertTrue(isOutOfBounds);
+        }
+    }
+
+    @Test(dataProvider = "outOfBoundsStaticFields", dataProviderClass = MemoryAccessProviderData.class)
+    public void testReadPrimitiveStaticFieldOutOFBounds(JavaKind kind, Constant base, Long offset, boolean isOutOfBounds) {
+        try {
+            PROVIDER.readPrimitiveConstant(kind, base, offset, kind.getByteCount() * 8);
+            Assert.assertFalse(isOutOfBounds);
+        } catch (IllegalArgumentException iae) {
+            Assert.assertTrue(isOutOfBounds);
+        }
     }
 
     @Test(dataProvider = "positiveObject", dataProviderClass = MemoryAccessProviderData.class, expectedExceptions = {IllegalArgumentException.class})
@@ -87,7 +114,7 @@
         Assert.assertNull(PROVIDER.readObjectConstant(base, offset + 1), "Expected null");
     }
 
-    @Test(dataProvider = "positivePrimitive", dataProviderClass = MemoryAccessProviderData.class)
+    @Test(dataProvider = "positivePrimitive", dataProviderClass = MemoryAccessProviderData.class, expectedExceptions = {IllegalArgumentException.class})
     public void testNegativeReadObjectConstantPrimitiveBase(JavaKind kind, Constant base, Long offset, Object expected, int bitsCount) {
         Assert.assertNull(PROVIDER.readObjectConstant(base, offset), "Expected null");
     }
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java
index 153cfc9..be431e4 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java
@@ -28,9 +28,9 @@
  * @requires vm.jvmci
  * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src
  * @modules java.base/java.lang.invoke:+open
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
- * @modules         jdk.vm.ci/jdk.vm.ci.hotspot:+open
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open
  * @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *      jdk.vm.ci.hotspot.test.MethodHandleAccessProviderTest
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java
index fb0f1a2..b71d665 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java
@@ -25,8 +25,8 @@
  * @test
  * @requires vm.jvmci
  * @library ../../../../../
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ConstantTest
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java
index 8f0ce0c..78546ac 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java
@@ -25,8 +25,8 @@
  * @test
  * @requires vm.jvmci
  * @library ../../../../../
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          jdk.attach
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.RedefineClassTest
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java
index 78c5a79..e2696af 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java
@@ -24,8 +24,8 @@
 /**
  * @test
  * @requires vm.jvmci
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest
  */
 
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java
index f4b15b2..de50175 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java
@@ -24,8 +24,8 @@
 /**
  * @test
  * @requires vm.jvmci
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveMethodTest
  */
 
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java
index 43cd69f..7afeee0 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java
@@ -25,8 +25,8 @@
  * @test
  * @requires vm.jvmci
  * @library ../../../../../
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestConstantReflectionProvider
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java
index 7929018..7e2f4f2 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java
@@ -25,8 +25,8 @@
  * @test
  * @requires vm.jvmci
  * @library ../../../../../
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaField
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java
index a8edfec..3f30b15 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java
@@ -25,8 +25,8 @@
  * @test
  * @requires vm.jvmci
  * @library ../../../../../
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaMethod
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java
index 669b579..710a430 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java
@@ -25,8 +25,8 @@
  * @test
  * @requires vm.jvmci
  * @library ../../../../../
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaType
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java
index 37d7d52..d66f595 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java
@@ -25,8 +25,8 @@
  * @test
  * @requires vm.jvmci
  * @library ../../../../../
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestMetaAccessProvider
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java
index 48a6dc8..0755e0c 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java
@@ -25,8 +25,8 @@
  * @test
  * @requires vm.jvmci
  * @library ../../../../../
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaField
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java
index 5087814..fe65ad2 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java
@@ -25,8 +25,8 @@
  * @test
  * @requires vm.jvmci
  * @library ../../../../../
- * @modules jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaMethod
  */
diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java
index e8f9f9b..91e36fc 100644
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java
@@ -26,9 +26,9 @@
  * @requires vm.jvmci
  * @library ../../../../../
  * @modules java.base/jdk.internal.reflect
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
- *          jdk.vm.ci/jdk.vm.ci.common
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.common
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaType
  */
diff --git a/hotspot/test/compiler/jvmci/meta/StableFieldTest.java b/hotspot/test/compiler/jvmci/meta/StableFieldTest.java
index 147811f..905d844 100644
--- a/hotspot/test/compiler/jvmci/meta/StableFieldTest.java
+++ b/hotspot/test/compiler/jvmci/meta/StableFieldTest.java
@@ -28,9 +28,9 @@
  * @library /test/lib /
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.vm.annotation
- *          jdk.vm.ci/jdk.vm.ci.hotspot
- *          jdk.vm.ci/jdk.vm.ci.meta
- *          jdk.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *
  * @compile StableFieldTest.java
  * @run driver ClassFileInstaller compiler.jvmci.meta.StableFieldTest
diff --git a/hotspot/test/compiler/loopopts/TestLoopPeeling.java b/hotspot/test/compiler/loopopts/TestLoopPeeling.java
index 3627ff5..a32f3cb 100644
--- a/hotspot/test/compiler/loopopts/TestLoopPeeling.java
+++ b/hotspot/test/compiler/loopopts/TestLoopPeeling.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8078262
+ * @bug 8078262 8177095
  * @summary Tests correct dominator information after loop peeling.
  *
  * @run main/othervm -Xcomp
@@ -40,14 +40,16 @@
     public static void main(String args[]) {
         TestLoopPeeling test = new TestLoopPeeling();
         try {
-            test.testArrayAccess(0, 1);
+            test.testArrayAccess1(0, 1);
+            test.testArrayAccess2(0);
+            test.testArrayAccess3(0, false);
             test.testArrayAllocation(0, 1);
         } catch (Exception e) {
             // Ignore exceptions
         }
     }
 
-    public void testArrayAccess(int index, int inc) {
+    public void testArrayAccess1(int index, int inc) {
         int storeIndex = -1;
 
         for (; index < 10; index += inc) {
@@ -63,7 +65,7 @@
 
             if (index == 42) {
                 // This store and the corresponding range check are moved out of the
-                // loop and both used after old loop and the peeled iteration exit.
+                // loop and both used after main loop and the peeled iteration exit.
                 // For the peeled iteration, storeIndex is always -1 and the ConvI2L
                 // is replaced by TOP. However, the range check is not folded because
                 // we don't do the split if optimization in PhaseIdealLoop2.
@@ -77,6 +79,44 @@
         }
     }
 
+    public int testArrayAccess2(int index) {
+        // Load1 and the corresponding range check are moved out of the loop
+        // and both are used after the main loop and the peeled iteration exit.
+        // For the peeled iteration, storeIndex is always Integer.MIN_VALUE and
+        // for the main loop it is 0. Hence, the merging phi has type int:<=0.
+        // Load1 reads the array at index ConvI2L(CastII(AddI(storeIndex, -1)))
+        // where the CastII is range check dependent and has type int:>=0.
+        // The CastII gets pushed through the AddI and its type is changed to int:>=1
+        // which does not overlap with the input type of storeIndex (int:<=0).
+        // The CastII is replaced by TOP causing a cascade of other eliminations.
+        // Since the control path through the range check CmpU(AddI(storeIndex, -1))
+        // is not eliminated, the graph is in a corrupted state. We fail once we merge
+        // with the result of Load2 because we get data from a non-dominating region.
+        int storeIndex = Integer.MIN_VALUE;
+        for (; index < 10; ++index) {
+            if (index == 42) {
+                return array[storeIndex-1]; // Load1
+            }
+            storeIndex = 0;
+        }
+        return array[42]; // Load2
+    }
+
+    public int testArrayAccess3(int index, boolean b) {
+        // Same as testArrayAccess2 but manifests as crash in register allocator.
+        int storeIndex = Integer.MIN_VALUE;
+        for (; index < 10; ++index) {
+            if (b) {
+                return 0;
+            }
+            if (index == 42) {
+                return array[storeIndex-1]; // Load1
+            }
+            storeIndex = 0;
+        }
+        return array[42]; // Load2
+    }
+
     public byte[] testArrayAllocation(int index, int inc) {
         int allocationCount = -1;
         byte[] result;
@@ -88,7 +128,7 @@
 
             if (index == 42) {
                 // This allocation and the corresponding size check are moved out of the
-                // loop and both used after old loop and the peeled iteration exit.
+                // loop and both used after main loop and the peeled iteration exit.
                 // For the peeled iteration, allocationCount is always -1 and the ConvI2L
                 // is replaced by TOP. However, the size check is not folded because
                 // we don't do the split if optimization in PhaseIdealLoop2.
diff --git a/hotspot/test/compiler/patches/java.base/java/lang/Helper.java b/hotspot/test/compiler/patches/java.base/java/lang/Helper.java
index 65347c8..b38bebb 100644
--- a/hotspot/test/compiler/patches/java.base/java/lang/Helper.java
+++ b/hotspot/test/compiler/patches/java.base/java/lang/Helper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,4 +73,84 @@
         StringUTF16.getChars(value, srcBegin, srcEnd, dst, dstBegin);
         return dst;
     }
+
+    public static void putCharSB(byte[] val, int index, int c) {
+        StringUTF16.putCharSB(val, index, c);
+    }
+
+    public static void putCharsSB(byte[] val, int index, char[] ca, int off, int end) {
+        StringUTF16.putCharsSB(val, index, ca, off, end);
+    }
+
+    public static void putCharsSB(byte[] val, int index, CharSequence s, int off, int end) {
+        StringUTF16.putCharsSB(val, index, s, off, end);
+    }
+
+    public static int codePointAtSB(byte[] val, int index, int end) {
+        return StringUTF16.codePointAtSB(val, index, end);
+    }
+
+    public static int codePointBeforeSB(byte[] val, int index) {
+        return StringUTF16.codePointBeforeSB(val, index);
+    }
+
+    public static int codePointCountSB(byte[] val, int beginIndex, int endIndex) {
+        return StringUTF16.codePointCountSB(val, beginIndex, endIndex);
+    }
+
+    public static int getChars(int i, int begin, int end, byte[] value) {
+        return StringUTF16.getChars(i, begin, end, value);
+    }
+
+    public static int getChars(long l, int begin, int end, byte[] value) {
+        return StringUTF16.getChars(l, begin, end, value);
+    }
+
+    public static boolean contentEquals(byte[] v1, byte[] v2, int len) {
+        return StringUTF16.contentEquals(v1, v2, len);
+    }
+
+    public static boolean contentEquals(byte[] value, CharSequence cs, int len) {
+        return StringUTF16.contentEquals(value, cs, len);
+    }
+
+    public static int putCharsAt(byte[] value, int i, char c1, char c2, char c3, char c4) {
+        return StringUTF16.putCharsAt(value, i, c1, c2, c3, c4);
+    }
+
+    public static int putCharsAt(byte[] value, int i, char c1, char c2, char c3, char c4, char c5) {
+        return StringUTF16.putCharsAt(value, i, c1, c2, c3, c4, c5);
+    }
+
+    public static char charAt(byte[] value, int index) {
+        return StringUTF16.charAt(value, index);
+    }
+
+    public static void reverse(byte[] value, int count) {
+        StringUTF16.reverse(value, count);
+    }
+
+    public static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) {
+        StringUTF16.inflate(src, srcOff, dst, dstOff, len);
+    }
+
+    public static int indexOf(byte[] src, int srcCount,
+                                    byte[] tgt, int tgtCount, int fromIndex) {
+        return StringUTF16.indexOf(src, srcCount, tgt, tgtCount, fromIndex);
+    }
+
+    public static int indexOfLatin1(byte[] src, int srcCount,
+                                    byte[] tgt, int tgtCount, int fromIndex) {
+        return StringUTF16.indexOfLatin1(src, srcCount, tgt, tgtCount, fromIndex);
+    }
+    public static int lastIndexOf(byte[] src, byte[] tgt, int tgtCount, int fromIndex) {
+        int srcCount = StringUTF16.length(src); // ignored
+        return StringUTF16.lastIndexOf(src, srcCount, tgt, tgtCount, fromIndex);
+    }
+
+    public static int lastIndexOfLatin1(byte[] src, byte[] tgt, int tgtCount, int fromIndex) {
+        int srcCount = StringUTF16.length(src); // ignored
+        return StringUTF16.lastIndexOfLatin1(src, srcCount, tgt, tgtCount, fromIndex);
+    }
+
 }
diff --git a/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java
index f4958a6..fee36b9 100644
--- a/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java
+++ b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java
@@ -30,6 +30,6 @@
 public class SupportedVM implements BooleanSupplier {
     @Override
     public boolean getAsBoolean() {
-        return Platform.isServer();
+        return Platform.isServer() && !Platform.isEmulatedClient();
     }
 }
diff --git a/hotspot/test/compiler/types/correctness/OffTest.java b/hotspot/test/compiler/types/correctness/OffTest.java
index 7593fc6..5a8fe59 100644
--- a/hotspot/test/compiler/types/correctness/OffTest.java
+++ b/hotspot/test/compiler/types/correctness/OffTest.java
@@ -24,6 +24,7 @@
 /*
  * @test CorrectnessTest
  * @bug 8038418
+ * @requires vm.flavor == "server" & !vm.emulatedClient
  * @library /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management
diff --git a/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java b/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java
index 1069b41..ccba8fc 100644
--- a/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java
+++ b/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,13 @@
 
 /*
  * @test TestPrintGCDetailsVerbose
- * @bug 8016740
+ * @bug 8016740 8177963
  * @summary Tests that jvm with maximally verbose GC logging does not crash when ParOldGC has no memory
  * @key gc
  * @requires vm.gc.Parallel
  * @modules java.base/jdk.internal.misc
  * @run main/othervm -Xmx50m -XX:+UseParallelGC -Xlog:gc*=trace TestPrintGCDetailsVerbose
+ * @run main/othervm -Xmx50m -XX:+UseParallelGC -XX:GCTaskTimeStampEntries=1 -Xlog:gc*=trace TestPrintGCDetailsVerbose
  */
 public class TestPrintGCDetailsVerbose {
 
diff --git a/hotspot/test/native/runtime/test_globals.cpp b/hotspot/test/native/runtime/test_globals.cpp
index 2b6a997..3a84f2c 100644
--- a/hotspot/test/native/runtime/test_globals.cpp
+++ b/hotspot/test/native/runtime/test_globals.cpp
@@ -53,7 +53,7 @@
 }
 
 TEST_VM(FlagGuard, uintx_flag) {
-  TEST_FLAG(GCTaskTimeStampEntries, uintx, 1337);
+  TEST_FLAG(GCTaskTimeStampEntries, uint, 1337);
 }
 
 TEST_VM(FlagGuard, size_t_flag) {
diff --git a/hotspot/test/runtime/LocalLong/LocalLongHelper.java b/hotspot/test/runtime/LocalLong/LocalLongHelper.java
index 2134aee..065d7d8 100644
--- a/hotspot/test/runtime/LocalLong/LocalLongHelper.java
+++ b/hotspot/test/runtime/LocalLong/LocalLongHelper.java
@@ -30,10 +30,10 @@
 
 public class LocalLongHelper {
     static StackWalker sw;
-    static Method intValue;
+    static Method longValue;
     static Method getLocals;
     static Class<?> primitiveValueClass;
-    static Method primitiveType;
+    static Method primitiveSize;
     static Method getMethodType;
     static Field memberName;
     static Field offset;
@@ -43,27 +43,29 @@
         new LocalLongHelper().longArg(0xC0FFEE, 0x1234567890ABCDEFL);
     }
 
-    // locals[2] contains the high byte of the long argument.
+    // locals[2] contains the unused slot of the long argument.
     public long longArg(int i, long l) throws Throwable {
         List<StackFrame> frames = sw.walk(s -> s.collect(Collectors.toList()));
         Object[] locals = (Object[]) getLocals.invoke(frames.get(0));
 
-        int locals_2 = (int) intValue.invoke(locals[2]);
-        if (locals_2 != 0){
-            throw new RuntimeException("Expected locals_2 == 0");
+        if (8 == (int) primitiveSize.invoke(locals[2])) { // Only test 64-bit
+            long locals_2 = (long) longValue.invoke(locals[2]);
+            if (locals_2 != 0){
+                throw new RuntimeException("Expected locals_2 == 0");
+            }
         }
         return l; // Don't want l to become a dead var
     }
 
     private static void setupReflectionStatics() throws Throwable {
         Class<?> liveStackFrameClass = Class.forName("java.lang.LiveStackFrame");
-        primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveValue");
+        primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveSlot");
 
         getLocals = liveStackFrameClass.getDeclaredMethod("getLocals");
         getLocals.setAccessible(true);
 
-        intValue = primitiveValueClass.getDeclaredMethod("intValue");
-        intValue.setAccessible(true);
+        longValue = primitiveValueClass.getDeclaredMethod("longValue");
+        longValue.setAccessible(true);
 
         Class<?> stackFrameInfoClass = Class.forName("java.lang.StackFrameInfo");
         memberName = stackFrameInfoClass.getDeclaredField("memberName");
@@ -80,20 +82,8 @@
         f.setAccessible(true);
         Object localsAndOperandsOption = f.get(null);
 
-        primitiveType = primitiveValueClass.getDeclaredMethod("type");
-        primitiveType.setAccessible(true);
-
+        primitiveSize = primitiveValueClass.getDeclaredMethod("size");
+        primitiveSize.setAccessible(true);
         sw = (StackWalker) ewsNI.invoke(null, java.util.Collections.emptySet(), localsAndOperandsOption);
     }
-
-    private static String type(Object o) throws Throwable {
-        if (primitiveValueClass.isInstance(o)) {
-            final char c = (char) primitiveType.invoke(o);
-            return String.valueOf(c);
-        } else if (o != null) {
-            return o.getClass().getName();
-        } else {
-            return "null";
-        }
-    }
 }
diff --git a/hotspot/test/runtime/Metaspace/DefineClass.java b/hotspot/test/runtime/Metaspace/DefineClass.java
new file mode 100644
index 0000000..4563e56
--- /dev/null
+++ b/hotspot/test/runtime/Metaspace/DefineClass.java
@@ -0,0 +1,381 @@
+/*
+ * Copyright (c) 2017 SAP SE. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8173743
+ * @requires vm.compMode != "Xcomp"
+ * @summary Failures during class definition can lead to memory leaks in metaspace
+ * @library /test/lib
+ * @run main/othervm test.DefineClass defineClass
+ * @run main/othervm test.DefineClass defineSystemClass
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions
+                     -XX:+UnsyncloadClass -XX:+AllowParallelDefineClass
+                     test.DefineClass defineClassParallel
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions
+                     -XX:+UnsyncloadClass -XX:-AllowParallelDefineClass
+                     test.DefineClass defineClassParallel
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions
+                     -XX:-UnsyncloadClass -XX:+AllowParallelDefineClass
+                     test.DefineClass defineClassParallel
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions
+                     -XX:-UnsyncloadClass -XX:-AllowParallelDefineClass
+                     test.DefineClass defineClassParallel
+ * @run main/othervm test.DefineClass redefineClass
+ * @run main/othervm test.DefineClass redefineClassWithError
+ * @author volker.simonis@gmail.com
+ */
+
+package test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.lang.instrument.ClassDefinition;
+import java.lang.instrument.Instrumentation;
+import java.lang.management.ManagementFactory;
+import java.util.Scanner;
+import java.util.concurrent.CountDownLatch;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import com.sun.tools.attach.VirtualMachine;
+
+import jdk.test.lib.process.ProcessTools;
+
+public class DefineClass {
+
+    private static Instrumentation instrumentation;
+
+    public void getID(CountDownLatch start, CountDownLatch stop) {
+        String id = "AAAAAAAA";
+        System.out.println(id);
+        try {
+            // Signal that we've entered the activation..
+            start.countDown();
+            //..and wait until we can leave it.
+            stop.await();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        System.out.println(id);
+        return;
+    }
+
+    private static class MyThread extends Thread {
+        private DefineClass dc;
+        private CountDownLatch start, stop;
+
+        public MyThread(DefineClass dc, CountDownLatch start, CountDownLatch stop) {
+            this.dc = dc;
+            this.start = start;
+            this.stop = stop;
+        }
+
+        public void run() {
+            dc.getID(start, stop);
+        }
+    }
+
+    private static class ParallelLoadingThread extends Thread {
+        private MyParallelClassLoader pcl;
+        private CountDownLatch stop;
+        private byte[] buf;
+
+        public ParallelLoadingThread(MyParallelClassLoader pcl, byte[] buf, CountDownLatch stop) {
+            this.pcl = pcl;
+            this.stop = stop;
+            this.buf = buf;
+        }
+
+        public void run() {
+            try {
+                stop.await();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+            try {
+                @SuppressWarnings("unchecked")
+                Class<DefineClass> dc = (Class<DefineClass>) pcl.myDefineClass(DefineClass.class.getName(), buf, 0, buf.length);
+            }
+            catch (LinkageError jle) {
+                // Expected with a parallel capable class loader and
+                // -XX:+UnsyncloadClass or -XX:+AllowParallelDefineClass
+                pcl.incrementLinkageErrors();
+            }
+
+        }
+    }
+
+    static private class MyClassLoader extends ClassLoader {
+        public Class<?> myDefineClass(String name, byte[] b, int off, int len) throws ClassFormatError {
+            return defineClass(name, b, off, len, null);
+        }
+    }
+
+    static private class MyParallelClassLoader extends ClassLoader {
+        static {
+            System.out.println("parallelCapable : " + registerAsParallelCapable());
+        }
+        public Class<?> myDefineClass(String name, byte[] b, int off, int len) throws ClassFormatError {
+            return defineClass(name, b, off, len, null);
+        }
+        public synchronized void incrementLinkageErrors() {
+            linkageErrors++;
+        }
+        public int getLinkageErrors() {
+            return linkageErrors;
+        }
+        private volatile int linkageErrors;
+    }
+
+    public static void agentmain(String args, Instrumentation inst) {
+        System.out.println("Loading Java Agent.");
+        instrumentation = inst;
+    }
+
+
+    private static void loadInstrumentationAgent(String myName, byte[] buf) throws Exception {
+        // Create agent jar file on the fly
+        Manifest m = new Manifest();
+        m.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
+        m.getMainAttributes().put(new Attributes.Name("Agent-Class"), myName);
+        m.getMainAttributes().put(new Attributes.Name("Can-Redefine-Classes"), "true");
+        File jarFile = File.createTempFile("agent", ".jar");
+        jarFile.deleteOnExit();
+        JarOutputStream jar = new JarOutputStream(new FileOutputStream(jarFile), m);
+        jar.putNextEntry(new JarEntry(myName.replace('.', '/') + ".class"));
+        jar.write(buf);
+        jar.close();
+        String pid = Long.toString(ProcessTools.getProcessId());
+        System.out.println("Our pid is = " + pid);
+        VirtualMachine vm = VirtualMachine.attach(pid);
+        vm.loadAgent(jarFile.getAbsolutePath());
+    }
+
+    private static byte[] getBytecodes(String myName) throws Exception {
+        InputStream is = DefineClass.class.getResourceAsStream(myName + ".class");
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        byte[] buf = new byte[4096];
+        int len;
+        while ((len = is.read(buf)) != -1) baos.write(buf, 0, len);
+        buf = baos.toByteArray();
+        System.out.println("sizeof(" + myName + ".class) == " + buf.length);
+        return buf;
+    }
+
+    private static int getStringIndex(String needle, byte[] buf) {
+        return getStringIndex(needle, buf, 0);
+    }
+
+    private static int getStringIndex(String needle, byte[] buf, int offset) {
+        outer:
+        for (int i = offset; i < buf.length - offset - needle.length(); i++) {
+            for (int j = 0; j < needle.length(); j++) {
+                if (buf[i + j] != (byte)needle.charAt(j)) continue outer;
+            }
+            return i;
+        }
+        return 0;
+    }
+
+    private static void replaceString(byte[] buf, String name, int index) {
+        for (int i = index; i < index + name.length(); i++) {
+            buf[i] = (byte)name.charAt(i - index);
+        }
+    }
+
+    private static MBeanServer mbserver = ManagementFactory.getPlatformMBeanServer();
+
+    private static int getClassStats(String pattern) {
+        try {
+            ObjectName diagCmd = new ObjectName("com.sun.management:type=DiagnosticCommand");
+
+            String result = (String)mbserver.invoke(diagCmd , "gcClassStats" , new Object[] { null }, new String[] {String[].class.getName()});
+            int count = 0;
+            try (Scanner s = new Scanner(result)) {
+                if (s.hasNextLine()) {
+                    System.out.println(s.nextLine());
+                }
+                while (s.hasNextLine()) {
+                    String l = s.nextLine();
+                    if (l.endsWith(pattern)) {
+                        count++;
+                        System.out.println(l);
+                    }
+                }
+            }
+            return count;
+        }
+        catch (Exception e) {
+            throw new RuntimeException("Test failed because we can't read the class statistics!", e);
+        }
+    }
+
+    private static void printClassStats(int expectedCount, boolean reportError) {
+        int count = getClassStats("DefineClass");
+        String res = "Should have " + expectedCount +
+                     " DefineClass instances and we have: " + count;
+        System.out.println(res);
+        if (reportError && count != expectedCount) {
+            throw new RuntimeException(res);
+        }
+    }
+
+    public static final int ITERATIONS = 10;
+
+    public static void main(String[] args) throws Exception {
+        String myName = DefineClass.class.getName();
+        byte[] buf = getBytecodes(myName.substring(myName.lastIndexOf(".") + 1));
+        int iterations = (args.length > 1 ? Integer.parseInt(args[1]) : ITERATIONS);
+
+        if (args.length == 0 || "defineClass".equals(args[0])) {
+            MyClassLoader cl = new MyClassLoader();
+            for (int i = 0; i < iterations; i++) {
+                try {
+                    @SuppressWarnings("unchecked")
+                    Class<DefineClass> dc = (Class<DefineClass>) cl.myDefineClass(myName, buf, 0, buf.length);
+                    System.out.println(dc);
+                }
+                catch (LinkageError jle) {
+                    // Can only define once!
+                    if (i == 0) throw new Exception("Should succeed the first time.");
+                }
+            }
+            // We expect to have two instances of DefineClass here: the initial version in which we are
+            // executing and another version which was loaded into our own classloader 'MyClassLoader'.
+            // All the subsequent attempts to reload DefineClass into our 'MyClassLoader' should have failed.
+            printClassStats(2, false);
+            System.gc();
+            System.out.println("System.gc()");
+            // At least after System.gc() the failed loading attempts should leave no instances around!
+            printClassStats(2, true);
+        }
+        else if ("defineSystemClass".equals(args[0])) {
+            MyClassLoader cl = new MyClassLoader();
+            int index = getStringIndex("test/DefineClass", buf);
+            replaceString(buf, "java/DefineClass", index);
+            while ((index = getStringIndex("Ltest/DefineClass;", buf, index + 1)) != 0) {
+                replaceString(buf, "Ljava/DefineClass;", index);
+            }
+            index = getStringIndex("test.DefineClass", buf);
+            replaceString(buf, "java.DefineClass", index);
+
+            for (int i = 0; i < iterations; i++) {
+                try {
+                    @SuppressWarnings("unchecked")
+                    Class<DefineClass> dc = (Class<DefineClass>) cl.myDefineClass(null, buf, 0, buf.length);
+                    throw new RuntimeException("Defining a class in the 'java' package should fail!");
+                }
+                catch (java.lang.SecurityException jlse) {
+                    // Expected, because we're not allowed to define a class in the 'java' package
+                }
+            }
+            // We expect to stay with one (the initial) instances of DefineClass.
+            // All the subsequent attempts to reload DefineClass into the 'java' package should have failed.
+            printClassStats(1, false);
+            System.gc();
+            System.out.println("System.gc()");
+            // At least after System.gc() the failed loading attempts should leave no instances around!
+            printClassStats(1, true);
+        }
+        else if ("defineClassParallel".equals(args[0])) {
+            MyParallelClassLoader pcl = new MyParallelClassLoader();
+            CountDownLatch stop = new CountDownLatch(1);
+
+            Thread[] threads = new Thread[iterations];
+            for (int i = 0; i < iterations; i++) {
+                (threads[i] = new ParallelLoadingThread(pcl, buf, stop)).start();
+            }
+            stop.countDown(); // start parallel class loading..
+            // ..and wait until all threads loaded the class
+            for (int i = 0; i < iterations; i++) {
+                threads[i].join();
+            }
+            System.out.print("Counted " + pcl.getLinkageErrors() + " LinkageErrors ");
+            System.out.println(pcl.getLinkageErrors() == 0 ?
+                    "" : "(use -XX:+UnsyncloadClass and/or -XX:+AllowParallelDefineClass to avoid this)");
+            System.gc();
+            System.out.println("System.gc()");
+            // After System.gc() we expect to remain with two instances: one is the initial version which is
+            // kept alive by this main method and another one in the parallel class loader.
+            printClassStats(2, true);
+        }
+        else if ("redefineClass".equals(args[0])) {
+            loadInstrumentationAgent(myName, buf);
+            int index = getStringIndex("AAAAAAAA", buf);
+            CountDownLatch stop = new CountDownLatch(1);
+
+            Thread[] threads = new Thread[iterations];
+            for (int i = 0; i < iterations; i++) {
+                buf[index] = (byte) ('A' + i + 1); // Change string constant in getID() which is legal in redefinition
+                instrumentation.redefineClasses(new ClassDefinition(DefineClass.class, buf));
+                DefineClass dc = DefineClass.class.newInstance();
+                CountDownLatch start = new CountDownLatch(1);
+                (threads[i] = new MyThread(dc, start, stop)).start();
+                start.await(); // Wait until the new thread entered the getID() method
+            }
+            // We expect to have one instance for each redefinition because they are all kept alive by an activation
+            // plus the initial version which is kept active by this main method.
+            printClassStats(iterations + 1, false);
+            stop.countDown(); // Let all threads leave the DefineClass.getID() activation..
+            // ..and wait until really all of them returned from DefineClass.getID()
+            for (int i = 0; i < iterations; i++) {
+                threads[i].join();
+            }
+            System.gc();
+            System.out.println("System.gc()");
+            // After System.gc() we expect to remain with two instances: one is the initial version which is
+            // kept alive by this main method and another one which is the latest redefined version.
+            printClassStats(2, true);
+        }
+        else if ("redefineClassWithError".equals(args[0])) {
+            loadInstrumentationAgent(myName, buf);
+            int index = getStringIndex("getID", buf);
+
+            for (int i = 0; i < iterations; i++) {
+                buf[index] = (byte) 'X'; // Change getID() to XetID() which is illegal in redefinition
+                try {
+                    instrumentation.redefineClasses(new ClassDefinition(DefineClass.class, buf));
+                    throw new RuntimeException("Class redefinition isn't allowed to change method names!");
+                }
+                catch (UnsupportedOperationException uoe) {
+                    // Expected because redefinition can't change the name of methods
+                }
+            }
+            // We expect just a single DefineClass instance because failed redefinitions should
+            // leave no garbage around.
+            printClassStats(1, false);
+            System.gc();
+            System.out.println("System.gc()");
+            // At least after a System.gc() we should definitely stay with a single instance!
+            printClassStats(1, true);
+        }
+    }
+}
diff --git a/hotspot/test/runtime/MinimalVM/JMX.java b/hotspot/test/runtime/MinimalVM/JMX.java
index e57325e..5a9dc20 100644
--- a/hotspot/test/runtime/MinimalVM/JMX.java
+++ b/hotspot/test/runtime/MinimalVM/JMX.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,9 +47,8 @@
                 .shouldContain("-Dcom.sun.management is not supported in this VM.")
                 .shouldHaveExitValue(1);
 
-        pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), Long.toString(ProcessTools.getProcessId()), "VM.print_threads"});
+        pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), "-l"});
         new OutputAnalyzer(pb.start())
-                .shouldContain("Could not find any processes matching ")
-                .shouldHaveExitValue(1);
+                .shouldNotMatch("^" + Long.toString(ProcessTools.getProcessId()) + "\\s+.*$");
     }
 }
diff --git a/hotspot/test/runtime/classFileParserBug/AccModuleTest.java b/hotspot/test/runtime/classFileParserBug/AccModuleTest.java
new file mode 100644
index 0000000..2adc1e3
--- /dev/null
+++ b/hotspot/test/runtime/classFileParserBug/AccModuleTest.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8174725
+ * @summary Throw NoClassDefFoundError if class access_flags have ACC_MODULE set
+ * @compile BadAccModule.jcod BadAccModInrClss.jcod
+ * @run main AccModuleTest
+ */
+
+// Test that classes with access_flags containing ACC_MODULE cause ClassDefNotFoundErrors.
+public class AccModuleTest {
+    public static void main(String args[]) throws Throwable {
+
+        System.out.println("Regression test for bug 8174725");
+        try {
+            Class newClass = Class.forName("BadAccModule");
+            throw new RuntimeException("Expected NoClassDefFoundError exception not thrown");
+        } catch (java.lang.NoClassDefFoundError e) {
+            if (!e.getMessage().contains("BadAccModule is not a class because access_flag ACC_MODULE is set")) {
+                throw new RuntimeException("Wrong NoClassDefFoundError exception for AccModuleTest: " + e.getMessage());
+            }
+        }
+        try {
+            Class newClass = Class.forName("BadAccModInrClss");
+            throw new RuntimeException("Expected NoClassDefFoundError exception not thrown");
+        } catch (java.lang.NoClassDefFoundError e) {
+            if (!e.getMessage().contains("BadAccModInrClss is not a class because access_flag ACC_MODULE is set")) {
+                throw new RuntimeException("Wrong NoClassDefFoundError exception for BadAccModInrClss: " + e.getMessage());
+            }
+        }
+    }
+}
diff --git a/hotspot/test/runtime/classFileParserBug/BadAccModInrClss.jcod b/hotspot/test/runtime/classFileParserBug/BadAccModInrClss.jcod
new file mode 100644
index 0000000..bba5d08
--- /dev/null
+++ b/hotspot/test/runtime/classFileParserBug/BadAccModInrClss.jcod
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This tests that a class in an InnerClasses attribute with ACC_MODULE set
+ * causes a NoClassDefFoundError exception to get thrown.
+ */
+
+class BadAccModInrClss {
+  0xCAFEBABE;
+  0; // minor version
+  53; // version
+  [22] { // Constant Pool
+    ; // first element is empty
+    Field #3 #14; // #1     at 0x0A
+    Method #4 #15; // #2     at 0x0F
+    class #16; // #3     at 0x14
+    class #19; // #4     at 0x17
+    Utf8 "this$0"; // #5     at 0x1A
+    Utf8 "La;"; // #6     at 0x23
+    Utf8 "Synthetic"; // #7     at 0x29
+    Utf8 "<init>"; // #8     at 0x35
+    Utf8 "(Ljava/lang/Object;)V"; // #9     at 0x3E
+    Utf8 "Code"; // #10     at 0x56
+    Utf8 "LineNumberTable"; // #11     at 0x5D
+    Utf8 "SourceFile"; // #12     at 0x6F
+    Utf8 "a.java"; // #13     at 0x7C
+    NameAndType #5 #6; // #14     at 0x85
+    NameAndType #8 #20; // #15     at 0x8A
+    Utf8 "BadAccModInrClss"; // #16     at 0x8F
+    Utf8 "Loc"; // #17     at 0x9E
+    Utf8 "InnerClasses"; // #18     at 0xA4
+    Utf8 "java/lang/Object"; // #19     at 0xB3
+    Utf8 "()V"; // #20     at 0xC6
+    Utf8 "EnclosingMethod"; // #21     at 0xCC
+  } // Constant Pool
+
+  0x0000; // access
+  #3;// this_cpx
+  #4;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [1] { // fields
+    { // Member at 0xE8
+      0x0000; // access
+      #5; // name_cpx
+      #6; // sig_cpx
+      [1] { // Attributes
+        Attr(#7, 0) { // Synthetic at 0xF0
+        } // end Synthetic
+      } // Attributes
+    } // Member
+  } // fields
+
+  [1] { // methods
+    { // Member at 0xF8
+      0x0001; // access
+      #8; // name_cpx
+      #20; // sig_cpx
+      [1] { // Attributes
+        Attr(#10, 17) { // Code at 0x0100
+          2; // max_stack
+          2; // max_locals
+          Bytes[5]{
+            0x2AB70002B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [0] { // Attributes
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+  } // methods
+
+  [3] { // Attributes
+    Attr(#12, 2) { // SourceFile at 0x0119
+      #13;
+    } // end SourceFile
+    ;
+    Attr(#18, 10) { // InnerClasses at 0x0121
+      [1] { // InnerClasses
+        #3 #0 #17 0x8000; //  at 0x0131
+      }
+    } // end InnerClasses
+    ;
+    Attr(#21, 4) { // EnclosingMethod at 0x0131
+      0x0004000F;
+    } // end EnclosingMethod
+  } // Attributes
+} // end class BadAccModInrClss
diff --git a/hotspot/test/runtime/classFileParserBug/BadAccModule.jcod b/hotspot/test/runtime/classFileParserBug/BadAccModule.jcod
new file mode 100644
index 0000000..6d7d1ec
--- /dev/null
+++ b/hotspot/test/runtime/classFileParserBug/BadAccModule.jcod
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+// This is a .jcod file for a simple "Hello World" program with ACC_MODULE added
+// to its access_flags. (See line 67.)  This should cause a NoClassDefFoundError
+// when loading the class.
+class BadAccModule {
+  0xCAFEBABE;
+  0; // minor version
+  53; // version
+  [32] { // Constant Pool
+    ; // first element is empty
+    Method #6 #17; // #1     at 0x0A
+    Field #18 #19; // #2     at 0x0F
+    String #20; // #3     at 0x14
+    Method #21 #22; // #4     at 0x17
+    class #23; // #5     at 0x1C
+    class #24; // #6     at 0x1F
+    Utf8 "<init>"; // #7     at 0x22
+    Utf8 "()V"; // #8     at 0x2B
+    Utf8 "Code"; // #9     at 0x31
+    Utf8 "LineNumberTable"; // #10     at 0x38
+    Utf8 "main"; // #11     at 0x4A
+    Utf8 "([Ljava/lang/String;)V"; // #12     at 0x51
+    Utf8 "Exceptions"; // #13     at 0x6A
+    class #25; // #14     at 0x77
+    Utf8 "SourceFile"; // #15     at 0x7A
+    Utf8 "BadAccModule.java"; // #16     at 0x87
+    NameAndType #7 #8; // #17     at 0x9B
+    class #26; // #18     at 0xA0
+    NameAndType #27 #28; // #19     at 0xA3
+    Utf8 "Hello World"; // #20     at 0xA8
+    class #29; // #21     at 0xB6
+    NameAndType #30 #31; // #22     at 0xB9
+    Utf8 "BadAccModule"; // #23     at 0xBE
+    Utf8 "java/lang/Object"; // #24     at 0xCD
+    Utf8 "java/lang/Throwable"; // #25     at 0xE0
+    Utf8 "java/lang/System"; // #26     at 0xF6
+    Utf8 "out"; // #27     at 0x0109
+    Utf8 "Ljava/io/PrintStream;"; // #28     at 0x010F
+    Utf8 "java/io/PrintStream"; // #29     at 0x0127
+    Utf8 "println"; // #30     at 0x013D
+    Utf8 "(Ljava/lang/String;)V"; // #31     at 0x0147
+  } // Constant Pool
+
+  0x8021; // access  Added ACC_MODULE (0x8000) !!!
+  #5;// this_cpx
+  #6;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [0] { // fields
+  } // fields
+
+  [2] { // methods
+    { // Member at 0x016B
+      0x0001; // access
+      #7; // name_cpx
+      #8; // sig_cpx
+      [1] { // Attributes
+        Attr(#9, 29) { // Code at 0x0173
+          1; // max_stack
+          1; // max_locals
+          Bytes[5]{
+            0x2AB70001B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#10, 6) { // LineNumberTable at 0x018A
+              [1] { // LineNumberTable
+                0  1; //  at 0x0196
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+    ;
+    { // Member at 0x0196
+      0x0009; // access
+      #11; // name_cpx
+      #12; // sig_cpx
+      [2] { // Attributes
+        Attr(#9, 37) { // Code at 0x019E
+          2; // max_stack
+          1; // max_locals
+          Bytes[9]{
+            0xB200021203B60004;
+            0xB1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#10, 10) { // LineNumberTable at 0x01B9
+              [2] { // LineNumberTable
+                0  4; //  at 0x01C5
+                8  5; //  at 0x01C9
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+        ;
+        Attr(#13, 4) { // Exceptions at 0x01C9
+          [1] { // Exceptions
+            #14; //  at 0x01D3
+          }
+        } // end Exceptions
+      } // Attributes
+    } // Member
+  } // methods
+
+  [1] { // Attributes
+    Attr(#15, 2) { // SourceFile at 0x01D5
+      #16;
+    } // end SourceFile
+  } // Attributes
+} // end class BadAccModule
diff --git a/hotspot/test/runtime/classFileParserBug/fakeMethodAccessor.jasm b/hotspot/test/runtime/classFileParserBug/fakeMethodAccessor.jasm
index 36cebcb..207438a 100644
--- a/hotspot/test/runtime/classFileParserBug/fakeMethodAccessor.jasm
+++ b/hotspot/test/runtime/classFileParserBug/fakeMethodAccessor.jasm
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
  // to create a sub-type of jdk.internal.reflect.MethodAccessorImpl in order
  // to bypass Reflection.getCallerClass.  That should fail with an IAE.
  //
- import java.lang.reflect.Module;
  class fakeMethodAccessor extends jdk.internal.reflect.MethodAccessorImpl {
      public static void main(String[] a) throws Exception {
         fakeMethodAccessor f = new fakeMethodAccessor();
@@ -60,11 +59,11 @@
         astore_1;
         getstatic    Field java/lang/System.out:"Ljava/io/PrintStream;";
         ldc    class java/lang/String;
-        invokevirtual    Method java/lang/Class.getModule:"()Ljava/lang/reflect/Module;";
+        invokevirtual    Method java/lang/Class.getModule:"()Ljava/lang/Module;";
         ldc    String "jdk.internal.misc";
         ldc    class FakeMethodAccessor;
-        invokevirtual    Method java/lang/Class.getModule:"()Ljava/lang/reflect/Module;";
-        invokevirtual    Method java/lang/reflect/Module.isExported:"(Ljava/lang/String;Ljava/lang/reflect/Module;)Z";
+        invokevirtual    Method java/lang/Class.getModule:"()Ljava/lang/Module;";
+        invokevirtual    Method java/lang/Module.isExported:"(Ljava/lang/String;Ljava/lang/Module;)Z";
         invokevirtual    Method java/io/PrintStream.println:"(Z)V";
         return;
 }
diff --git a/hotspot/test/runtime/constantPool/ACCModule52.java b/hotspot/test/runtime/constantPool/ACCModule52.java
new file mode 100644
index 0000000..2414250
--- /dev/null
+++ b/hotspot/test/runtime/constantPool/ACCModule52.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.internal.org.objectweb.asm.*;
+
+/*
+ * @test
+ * @summary Test that the JVM ignores ACC_MODULE if it is set for a version
+ *          52 class file.
+ * @bug 8175383
+ * @library /test/lib
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ * @compile -XDignore.symbol.file ACCModule52.java
+ * @run main ACCModule52
+ */
+
+public class ACCModule52 {
+
+    static final String CLASS_NAME = "ACCModule52Pkg";
+
+    public static void main(String[] args) throws Exception {
+        int ACC_MODULE = 0x8000;
+        ClassWriter cw = new ClassWriter(0);
+        cw.visit(Opcodes.V1_8,
+                Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE,
+                CLASS_NAME,
+                null,
+                "java/lang/Object",
+                null);
+
+        cw.visitEnd();
+        byte[] bytes = cw.toByteArray();
+
+
+        ClassLoader loader = new ClassLoader(ACCModule52.class.getClassLoader()) {
+            @Override
+            protected Class<?> findClass(String cn)throws ClassNotFoundException {
+                if (cn.equals(CLASS_NAME)) {
+                    Class superClass = super.defineClass(cn, bytes, 0, bytes.length);
+                } else {
+                    throw new ClassNotFoundException(cn);
+                }
+                return null;
+            }
+        };
+
+        Class<?> clazz = loader.loadClass(CLASS_NAME);
+    }
+}
diff --git a/hotspot/test/runtime/constantPool/ConstModule.java b/hotspot/test/runtime/constantPool/ConstModule.java
new file mode 100644
index 0000000..94e577a
--- /dev/null
+++ b/hotspot/test/runtime/constantPool/ConstModule.java
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.internal.org.objectweb.asm.*;
+
+/*
+ * @test
+ * @summary Test scenarios for constant pool CONSTANT_Module and CONSTANT_Package
+ *          types, for class file versions 53 and 52, when ACC_MODULE is set and
+ *          not set in the access_flags.
+ * @bug 8175383
+ * @library /test/lib
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ * @compile -XDignore.symbol.file ConstModule.java
+ * @run main ConstModule
+ */
+
+public class ConstModule {
+
+    static final int ACC_MODULE = 0x8000;
+    static final boolean MODULE_TEST = true;
+    static final boolean PACKAGE_TEST = false;
+    static final boolean CFE_EXCEPTION = true;
+    static final boolean NCDFE_EXCEPTION = false;
+
+    public static void main(String[] args) throws Exception {
+
+        // Test that the JVM throws CFE for constant pool CONSTANT_Module type, for
+        // class file version 53, when ACC_MODULE is not set in the access_flags.
+        ConstModule.write_and_load(Opcodes.V1_9,
+            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC,
+            "jdk.fooMod", "FooMod", MODULE_TEST, CFE_EXCEPTION);
+
+        // Test that the JVM throws NCDFE for constant pool CONSTANT_Module type,
+        // for class file version 53, when ACC_MODULE is set in the access_flags.
+        ConstModule.write_and_load(Opcodes.V1_9,
+            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE,
+            "jdk.fooModACC", "FooModACC", MODULE_TEST, NCDFE_EXCEPTION);
+
+        // Test that the JVM throws CFE for constant pool CONSTANT_Module type, for
+        // class file version 52, even when ACC_MODULE is set in the access_flags.
+        ConstModule.write_and_load(Opcodes.V1_8,
+            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE,
+            "jdk.fooModACC52", "FooModACC52", MODULE_TEST, CFE_EXCEPTION);
+
+        // Test that the JVM throws CFE for constant pool CONSTANT_Package type, for
+        // class file version 53, when ACC_MODULE is not set in the access_flags.
+        ConstModule.write_and_load(Opcodes.V1_9,
+            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC,
+            "jdk.fooPkg", "FooPkg", PACKAGE_TEST, CFE_EXCEPTION);
+
+        // Test that the JVM throws NCDFE for constant pool CONSTANT_Package type,
+        // for class file version 53, when ACC_MODULE is set in the access_flags.
+        ConstModule.write_and_load(Opcodes.V1_9,
+            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE,
+            "jdk.fooModACC", "FooModACC", PACKAGE_TEST, NCDFE_EXCEPTION);
+
+        // Test that the JVM throws CFE for constant pool CONSTANT_Package type, for
+        // class file version 52, even when ACC_MODULE is set in the access_flags.
+        ConstModule.write_and_load(Opcodes.V1_8,
+            Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE,
+            "jdk.fooModACC52", "FooModACC52", PACKAGE_TEST, CFE_EXCEPTION);
+
+    }
+
+    public static void write_and_load(int version,
+                                      int access_flags,
+                                      String attr,
+                                      String class_name,
+                                      boolean module_test,
+                                      boolean throwCFE) throws Exception {
+        ClassWriter cw = new ClassWriter(0);
+        cw.visit(version,
+                 access_flags,
+                 class_name,
+                 null,
+                 "java/lang/Object",
+                 null);
+
+        if (module_test)
+            cw.visitAttribute(new TestModuleAttribute(attr));
+        else
+            cw.visitAttribute(new TestPackageAttribute(attr));
+
+        cw.visitEnd();
+        byte[] bytes = cw.toByteArray();
+
+
+        ClassLoader loader = new ClassLoader(ConstModule.class.getClassLoader()) {
+            @Override
+            protected Class<?> findClass(String cn)throws ClassNotFoundException {
+                if (cn.equals(class_name)) {
+                    try {
+                        Class superClass = super.defineClass(cn, bytes, 0, bytes.length);
+                        throw new RuntimeException("Expected ClassFormatError not thrown");
+                    } catch (java.lang.ClassFormatError e) {
+                       if (!throwCFE) {
+                           throw new RuntimeException("Unexpected ClassFormatError exception: " + e.getMessage());
+                       }
+                       if (module_test && !e.getMessage().contains(
+                           "Unknown constant tag 19 in class file")) {
+                           throw new RuntimeException("Wrong ClassFormatError exception: " + e.getMessage());
+                       } else if (!module_test && !e.getMessage().contains(
+                           "Unknown constant tag 20 in class file")) {
+                           throw new RuntimeException("Wrong ClassFormatError exception: " + e.getMessage());
+                       }
+                    } catch (java.lang.NoClassDefFoundError f) {
+                       if (throwCFE) {
+                           throw new RuntimeException("Unexpected NoClassDefFoundError exception: " + f.getMessage());
+                       }
+                       if (!f.getMessage().contains(
+                           "is not a class because access_flag ACC_MODULE is set")) {
+                           throw new RuntimeException("Wrong NoClassDefFoundError exception: " + f.getMessage());
+                       }
+                    }
+                } else {
+                    throw new ClassNotFoundException(cn);
+                }
+                return null;
+            }
+        };
+
+        Class<?> clazz = loader.loadClass(class_name);
+    }
+
+    /**
+     * ConstModuleAttr attribute.
+     *
+     * <pre> {@code
+     *
+     * MainClass_attribute {
+     *   // index to CONSTANT_utf8_info structure in constant pool representing
+     *   // the string "ConstModuleAttr"
+     *   u2 attribute_name_index;
+     *   u4 attribute_length;
+     *
+     *   // index to CONSTANT_Module_info structure
+     *   u2 module_name_index
+     * }
+     *
+     * } </pre>
+     */
+    public static class TestModuleAttribute extends Attribute {
+        private final String moduleName;
+
+        public TestModuleAttribute(String moduleName) {
+            super("ConstModuleAttr");
+            this.moduleName = moduleName;
+        }
+
+        public TestModuleAttribute() {
+            this(null);
+        }
+
+        @Override
+        protected Attribute read(ClassReader cr,
+                                 int off,
+                                 int len,
+                                 char[] buf,
+                                 int codeOff,
+                                 Label[] labels)
+        {
+            String mn = cr.readModule(off, buf);
+            off += 2;
+            return new TestModuleAttribute(mn);
+        }
+
+        @Override
+        protected ByteVector write(ClassWriter cw,
+                                   byte[] code,
+                                   int len,
+                                   int maxStack,
+                                   int maxLocals)
+        {
+            ByteVector attr = new ByteVector();
+            attr.putShort(cw.newModule(moduleName));
+            return attr;
+        }
+    }
+
+    /**
+     * ConstPackageAttr attribute.
+     *
+     * <pre> {@code
+     *
+     * MainClass_attribute {
+     *   // index to CONSTANT_utf8_info structure in constant pool representing
+     *   // the string "ConstPackageAttr"
+     *   u2 attribute_name_index;
+     *   u4 attribute_length;
+     *
+     *   // index to CONSTANT_Package_info structure
+     *   u2 module_name_index
+     * }
+     *
+     * } </pre>
+     */
+    public static class TestPackageAttribute extends Attribute {
+        private final String packageName;
+
+        public TestPackageAttribute(String packageName) {
+            super("ConstPackageAttr");
+            this.packageName = packageName;
+        }
+
+        public TestPackageAttribute() {
+            this(null);
+        }
+
+        @Override
+        protected Attribute read(ClassReader cr,
+                                 int off,
+                                 int len,
+                                 char[] buf,
+                                 int codeOff,
+                                 Label[] labels)
+        {
+            String mn = cr.readPackage(off, buf);
+            off += 2;
+            return new TestPackageAttribute(mn);
+        }
+
+        @Override
+        protected ByteVector write(ClassWriter cw,
+                                   byte[] code,
+                                   int len,
+                                   int maxStack,
+                                   int maxLocals)
+        {
+            ByteVector attr = new ByteVector();
+            attr.putShort(cw.newPackage(packageName));
+            return attr;
+        }
+    }
+}
diff --git a/hotspot/test/runtime/duplAttributes/DupSignatureAttrs.jcod b/hotspot/test/runtime/duplAttributes/DupSignatureAttrs.jcod
new file mode 100644
index 0000000..b43db02
--- /dev/null
+++ b/hotspot/test/runtime/duplAttributes/DupSignatureAttrs.jcod
@@ -0,0 +1,615 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// Class containing duplicate Signature attributes.  Loading it should cause a
+// ClassFormatError exception.
+class DupClassSigAttrs {
+  0xCAFEBABE;
+  0; // minor version
+  53; // version
+  [33] { // Constant Pool
+    ; // first element is empty
+    Method #6 #17; // #1     at 0x0A
+    Field #18 #19; // #2     at 0x0F
+    String #20; // #3     at 0x14
+    Method #21 #22; // #4     at 0x17
+    class #23; // #5     at 0x1C
+    class #24; // #6     at 0x1F
+    Utf8 "<init>"; // #7     at 0x22
+    Utf8 "()V"; // #8     at 0x2B
+    Utf8 "Code"; // #9     at 0x31
+    Utf8 "LineNumberTable"; // #10     at 0x38
+    Utf8 "main"; // #11     at 0x4A
+    Utf8 "([Ljava/lang/String;)V"; // #12     at 0x51
+    Utf8 "Exceptions"; // #13     at 0x6A
+    class #25; // #14     at 0x77
+    Utf8 "SourceFile"; // #15     at 0x7A
+    Utf8 "DupClassSigAttrs.java"; // #16     at 0x87
+    NameAndType #7 #8; // #17     at 0x9F
+    class #26; // #18     at 0xA4
+    NameAndType #27 #28; // #19     at 0xA7
+    Utf8 "hi"; // #20     at 0xAC
+    class #29; // #21     at 0xB1
+    NameAndType #30 #31; // #22     at 0xB4
+    Utf8 "DupClassSigAttrs"; // #23     at 0xB9
+    Utf8 "java/lang/Object"; // #24     at 0xCC
+    Utf8 "java/lang/Throwable"; // #25     at 0xDF
+    Utf8 "java/lang/System"; // #26     at 0xF5
+    Utf8 "out"; // #27     at 0x0108
+    Utf8 "Ljava/io/PrintStream;"; // #28     at 0x010E
+    Utf8 "java/io/PrintStream"; // #29     at 0x0126
+    Utf8 "println"; // #30     at 0x013C
+    Utf8 "(Ljava/lang/String;)V"; // #31     at 0x0146
+    Utf8 "Signature"; // #32     at 0x015E
+  } // Constant Pool
+
+  0x0021; // access
+  #5;// this_cpx
+  #6;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [0] { // fields
+  } // fields
+
+  [2] { // methods
+    { // Member at 0x0176
+      0x0001; // access
+      #7; // name_cpx
+      #8; // sig_cpx
+      [1] { // Attributes
+        Attr(#9, 29) { // Code at 0x017E
+          1; // max_stack
+          1; // max_locals
+          Bytes[5]{
+            0x2AB70001B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#10, 6) { // LineNumberTable at 0x0195
+              [1] { // LineNumberTable
+                0  1; //  at 0x01A1
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+    ;
+    { // Member at 0x01A1
+      0x0009; // access
+      #11; // name_cpx
+      #12; // sig_cpx
+      [2] { // Attributes
+        Attr(#9, 37) { // Code at 0x01A9
+          2; // max_stack
+          1; // max_locals
+          Bytes[9]{
+            0xB200021203B60004;
+            0xB1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#10, 10) { // LineNumberTable at 0x01C4
+              [2] { // LineNumberTable
+                0  4; //  at 0x01D0
+                8  5; //  at 0x01D4
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+        ;
+        Attr(#13, 4) { // Exceptions at 0x01D4
+          [1] { // Exceptions
+            #14; //  at 0x01DE
+          }
+        } // end Exceptions
+      } // Attributes
+    } // Member
+  } // methods
+
+  [3] { // Attributes
+    Attr(#15, 2) { // SourceFile at 0x01E0
+      #16;
+    } // end SourceFile
+    ;
+    Attr(#32, 2) { // Signature at 0x01E8
+      #16;
+    } // end Signature
+    ;
+    Attr(#32, 2) { // *** Duplicate *** Signature at 0x01F0
+      #16;
+    } // end Signature
+  } // Attributes
+} // end class DupClassSigAttrs
+
+
+// Class containing a method with duplicate Signature attributes.  Loading it
+// should cause a ClassFormatError exception.
+class DupMthSigAttrs {
+  0xCAFEBABE;
+  0; // minor version
+  53; // version
+  [33] { // Constant Pool
+    ; // first element is empty
+    Method #6 #17; // #1     at 0x0A
+    Field #18 #19; // #2     at 0x0F
+    String #20; // #3     at 0x14
+    Method #21 #22; // #4     at 0x17
+    class #23; // #5     at 0x1C
+    class #24; // #6     at 0x1F
+    Utf8 "<init>"; // #7     at 0x22
+    Utf8 "()V"; // #8     at 0x2B
+    Utf8 "Code"; // #9     at 0x31
+    Utf8 "LineNumberTable"; // #10     at 0x38
+    Utf8 "main"; // #11     at 0x4A
+    Utf8 "([Ljava/lang/String;)V"; // #12     at 0x51
+    Utf8 "Exceptions"; // #13     at 0x6A
+    class #25; // #14     at 0x77
+    Utf8 "SourceFile"; // #15     at 0x7A
+    Utf8 "DupMthSigAttrs.java"; // #16     at 0x87
+    NameAndType #7 #8; // #17     at 0x9D
+    class #26; // #18     at 0xA2
+    NameAndType #27 #28; // #19     at 0xA5
+    Utf8 "hi"; // #20     at 0xAA
+    class #29; // #21     at 0xAF
+    NameAndType #30 #31; // #22     at 0xB2
+    Utf8 "DupMthSigAttrs"; // #23     at 0xB7
+    Utf8 "java/lang/Object"; // #24     at 0xC8
+    Utf8 "java/lang/Throwable"; // #25     at 0xDB
+    Utf8 "java/lang/System"; // #26     at 0xF1
+    Utf8 "out"; // #27     at 0x0104
+    Utf8 "Ljava/io/PrintStream;"; // #28     at 0x010A
+    Utf8 "java/io/PrintStream"; // #29     at 0x0122
+    Utf8 "println"; // #30     at 0x0138
+    Utf8 "(Ljava/lang/String;)V"; // #31     at 0x0142
+    Utf8 "Signature"; // #32     at 0x015A
+  } // Constant Pool
+
+  0x0021; // access
+  #5;// this_cpx
+  #6;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [0] { // fields
+  } // fields
+
+  [2] { // methods
+    { // Member at 0x0172
+      0x0001; // access
+      #7; // name_cpx
+      #8; // sig_cpx
+      [1] { // Attributes
+        Attr(#9, 29) { // Code at 0x017A
+          1; // max_stack
+          1; // max_locals
+          Bytes[5]{
+            0x2AB70001B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#10, 6) { // LineNumberTable at 0x0191
+              [1] { // LineNumberTable
+                0  1; //  at 0x019D
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+    ;
+    { // Member at 0x019D
+      0x0009; // access
+      #11; // name_cpx
+      #12; // sig_cpx
+      [4] { // Attributes
+        Attr(#9, 37) { // Code at 0x01A5
+          2; // max_stack
+          1; // max_locals
+          Bytes[9]{
+            0xB200021203B60004;
+            0xB1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#10, 10) { // LineNumberTable at 0x01C0
+              [2] { // LineNumberTable
+                0  4; //  at 0x01CC
+                8  5; //  at 0x01D0
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+        ;
+        Attr(#32, 2) { // Signature at 0x01D0
+          #16;
+        } // end Signature
+        ;
+        Attr(#13, 4) { // Exceptions at 0x01D8
+          [1] { // Exceptions
+            #14; //  at 0x01E2
+          }
+        } // end Exceptions
+        ;
+        Attr(#32, 2) { // *** Duplicate *** Signature at 0x01E2
+          #16;
+        } // end Signature
+      } // Attributes
+    } // Member
+  } // methods
+
+  [1] { // Attributes
+    Attr(#15, 2) { // SourceFile at 0x01EC
+      #16;
+    } // end SourceFile
+  } // Attributes
+} // end class DupMthSigAttrs
+
+
+// Class containing a field with duplicate Signature attributes.  Loading it
+// should cause a ClassFormatError exception.
+class DupFldSigAttrs {
+  0xCAFEBABE;
+  0; // minor version
+  53; // version
+  [42] { // Constant Pool
+    ; // first element is empty
+    Method #9 #23; // #1     at 0x0A
+    Field #24 #25; // #2     at 0x0F
+    Field #8 #26; // #3     at 0x14
+    Method #27 #28; // #4     at 0x19
+    class #29; // #5     at 0x1E
+    String #30; // #6     at 0x21
+    Method #5 #31; // #7     at 0x24
+    class #32; // #8     at 0x29
+    class #33; // #9     at 0x2C
+    Utf8 "str"; // #10     at 0x2F
+    Utf8 "Ljava/lang/String;"; // #11     at 0x35
+    Utf8 "<init>"; // #12     at 0x4A
+    Utf8 "()V"; // #13     at 0x53
+    Utf8 "Code"; // #14     at 0x59
+    Utf8 "LineNumberTable"; // #15     at 0x60
+    Utf8 "main"; // #16     at 0x72
+    Utf8 "([Ljava/lang/String;)V"; // #17     at 0x79
+    Utf8 "Exceptions"; // #18     at 0x92
+    class #34; // #19     at 0x9F
+    Utf8 "<clinit>"; // #20     at 0xA2
+    Utf8 "SourceFile"; // #21     at 0xAD
+    Utf8 "DupFldSigAttrs.java"; // #22     at 0xBA
+    NameAndType #12 #13; // #23     at 0xD0
+    class #35; // #24     at 0xD5
+    NameAndType #36 #37; // #25     at 0xD8
+    NameAndType #10 #11; // #26     at 0xDD
+    class #38; // #27     at 0xE2
+    NameAndType #39 #40; // #28     at 0xE5
+    Utf8 "java/lang/String"; // #29     at 0xEA
+    Utf8 "Hi"; // #30     at 0xFD
+    NameAndType #12 #40; // #31     at 0x0102
+    Utf8 "DupFldSigAttrs"; // #32     at 0x0107
+    Utf8 "java/lang/Object"; // #33     at 0x0118
+    Utf8 "java/lang/Throwable"; // #34     at 0x012B
+    Utf8 "java/lang/System"; // #35     at 0x0141
+    Utf8 "out"; // #36     at 0x0154
+    Utf8 "Ljava/io/PrintStream;"; // #37     at 0x015A
+    Utf8 "java/io/PrintStream"; // #38     at 0x0172
+    Utf8 "println"; // #39     at 0x0188
+    Utf8 "(Ljava/lang/String;)V"; // #40     at 0x0192
+    Utf8 "Signature"; // #41     at 0x01AA
+  } // Constant Pool
+
+  0x0021; // access
+  #8;// this_cpx
+  #9;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [1] { // fields
+    { // Member at 0x01C0
+      0x0008; // access
+      #10; // name_cpx
+      #11; // sig_cpx
+      [2] { // Attributes
+        Attr(#41, 2) { // Signature at 0x01C8
+          #16;
+        } // end Signature
+        ;
+        Attr(#41, 2) { // *** Duplicate *** Signature at 0x01D0
+          #16;
+        } // end Signature
+      } // Attributes
+    } // Member
+  } // fields
+
+  [3] { // methods
+    { // Member at 0x01DA
+      0x0001; // access
+      #12; // name_cpx
+      #13; // sig_cpx
+      [1] { // Attributes
+        Attr(#14, 29) { // Code at 0x01E2
+          1; // max_stack
+          1; // max_locals
+          Bytes[5]{
+            0x2AB70001B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#15, 6) { // LineNumberTable at 0x01F9
+              [1] { // LineNumberTable
+                0  1; //  at 0x0205
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+    ;
+    { // Member at 0x0205
+      0x0009; // access
+      #16; // name_cpx
+      #17; // sig_cpx
+      [2] { // Attributes
+        Attr(#14, 38) { // Code at 0x020D
+          2; // max_stack
+          1; // max_locals
+          Bytes[10]{
+            0xB20002B20003B600;
+            0x04B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#15, 10) { // LineNumberTable at 0x0229
+              [2] { // LineNumberTable
+                0  6; //  at 0x0235
+                9  7; //  at 0x0239
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+        ;
+        Attr(#18, 4) { // Exceptions at 0x0239
+          [1] { // Exceptions
+            #19; //  at 0x0243
+          }
+        } // end Exceptions
+      } // Attributes
+    } // Member
+    ;
+    { // Member at 0x0243
+      0x0008; // access
+      #20; // name_cpx
+      #13; // sig_cpx
+      [1] { // Attributes
+        Attr(#14, 37) { // Code at 0x024B
+          3; // max_stack
+          0; // max_locals
+          Bytes[13]{
+            0xBB0005591206B700;
+            0x07B30003B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#15, 6) { // LineNumberTable at 0x026A
+              [1] { // LineNumberTable
+                0  3; //  at 0x0276
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+  } // methods
+
+  [1] { // Attributes
+    Attr(#21, 2) { // SourceFile at 0x0278
+      #22;
+    } // end SourceFile
+  } // Attributes
+} // end class DupFldSigAttrs
+
+
+// Class containing a Signature attribute and a field and methods with Signature
+// attributes.  Since neither the class nor any of its fields or methods have
+// duplicate Signature attributes, loading this class should not cause a
+// ClassFormatError exception.
+class OkaySigAttrs {
+  0xCAFEBABE;
+  0; // minor version
+  53; // version
+  [42] { // Constant Pool
+    ; // first element is empty
+    Method #9 #23; // #1     at 0x0A
+    Field #24 #25; // #2     at 0x0F
+    Field #8 #26; // #3     at 0x14
+    Method #27 #28; // #4     at 0x19
+    class #29; // #5     at 0x1E
+    String #30; // #6     at 0x21
+    Method #5 #31; // #7     at 0x24
+    class #32; // #8     at 0x29
+    class #33; // #9     at 0x2C
+    Utf8 "str"; // #10     at 0x2F
+    Utf8 "Ljava/lang/String;"; // #11     at 0x35
+    Utf8 "<init>"; // #12     at 0x4A
+    Utf8 "()V"; // #13     at 0x53
+    Utf8 "Code"; // #14     at 0x59
+    Utf8 "LineNumberTable"; // #15     at 0x60
+    Utf8 "main"; // #16     at 0x72
+    Utf8 "([Ljava/lang/String;)V"; // #17     at 0x79
+    Utf8 "Exceptions"; // #18     at 0x92
+    class #34; // #19     at 0x9F
+    Utf8 "<clinit>"; // #20     at 0xA2
+    Utf8 "SourceFile"; // #21     at 0xAD
+    Utf8 "OkaySigAttrs.java"; // #22     at 0xBA
+    NameAndType #12 #13; // #23     at 0xCE
+    class #35; // #24     at 0xD3
+    NameAndType #36 #37; // #25     at 0xD6
+    NameAndType #10 #11; // #26     at 0xDB
+    class #38; // #27     at 0xE0
+    NameAndType #39 #40; // #28     at 0xE3
+    Utf8 "java/lang/String"; // #29     at 0xE8
+    Utf8 "Hi"; // #30     at 0xFB
+    NameAndType #12 #40; // #31     at 0x0100
+    Utf8 "OkaySigAttrs"; // #32     at 0x0105
+    Utf8 "java/lang/Object"; // #33     at 0x0114
+    Utf8 "java/lang/Throwable"; // #34     at 0x0127
+    Utf8 "java/lang/System"; // #35     at 0x013D
+    Utf8 "out"; // #36     at 0x0150
+    Utf8 "Ljava/io/PrintStream;"; // #37     at 0x0156
+    Utf8 "java/io/PrintStream"; // #38     at 0x016E
+    Utf8 "println"; // #39     at 0x0184
+    Utf8 "(Ljava/lang/String;)V"; // #40     at 0x018E
+    Utf8 "Signature"; // #41     at 0x01A6
+  } // Constant Pool
+
+  0x0021; // access
+  #8;// this_cpx
+  #9;// super_cpx
+
+  [0] { // Interfaces
+  } // Interfaces
+
+  [1] { // fields
+    { // Member at 0x01BC
+      0x0008; // access
+      #10; // name_cpx
+      #11; // sig_cpx
+      [1] { // Attributes
+        Attr(#41, 2) { // Signature at 0x01C4
+          #16;
+        } // end Signature
+      } // Attributes
+    } // Member
+  } // fields
+
+  [3] { // methods
+    { // Member at 0x01CE
+      0x0001; // access
+      #12; // name_cpx
+      #13; // sig_cpx
+      [2] { // Attributes
+        Attr(#14, 29) { // Code at 0x01D6
+          1; // max_stack
+          1; // max_locals
+          Bytes[5]{
+            0x2AB70001B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#15, 6) { // LineNumberTable at 0x01ED
+              [1] { // LineNumberTable
+                0  1; //  at 0x01F9
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+        ;
+        Attr(#41, 2) { // Signature at 0x01F9
+          #16;
+        } // end Signature
+      } // Attributes
+    } // Member
+    ;
+    { // Member at 0x0201
+      0x0009; // access
+      #16; // name_cpx
+      #17; // sig_cpx
+      [3] { // Attributes
+        Attr(#14, 38) { // Code at 0x0209
+          2; // max_stack
+          1; // max_locals
+          Bytes[10]{
+            0xB20002B20003B600;
+            0x04B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#15, 10) { // LineNumberTable at 0x0225
+              [2] { // LineNumberTable
+                0  6; //  at 0x0231
+                9  7; //  at 0x0235
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+        ;
+        Attr(#41, 2) { // Signature at 0x0235
+          #16;
+        } // end Signature
+        ;
+        Attr(#18, 4) { // Exceptions at 0x023D
+          [1] { // Exceptions
+            #19; //  at 0x0247
+          }
+        } // end Exceptions
+      } // Attributes
+    } // Member
+    ;
+    { // Member at 0x0247
+      0x0008; // access
+      #20; // name_cpx
+      #13; // sig_cpx
+      [1] { // Attributes
+        Attr(#14, 37) { // Code at 0x024F
+          3; // max_stack
+          0; // max_locals
+          Bytes[13]{
+            0xBB0005591206B700;
+            0x07B30003B1;
+          };
+          [0] { // Traps
+          } // end Traps
+          [1] { // Attributes
+            Attr(#15, 6) { // LineNumberTable at 0x026E
+              [1] { // LineNumberTable
+                0  3; //  at 0x027A
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+  } // methods
+
+  [2] { // Attributes
+    Attr(#21, 2) { // SourceFile at 0x027C
+      #22;
+    } // end SourceFile
+    ;
+    Attr(#41, 2) { // Signature at 0x0284
+      #16;
+    } // end Signature
+  } // Attributes
+} // end class OkaySigAttrs
diff --git a/hotspot/test/runtime/duplAttributes/TestDupSignatureAttr.java b/hotspot/test/runtime/duplAttributes/TestDupSignatureAttr.java
new file mode 100644
index 0000000..856d061
--- /dev/null
+++ b/hotspot/test/runtime/duplAttributes/TestDupSignatureAttr.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176147
+ * @summary Throw ClassFormatError exception for multiple Signature attributes
+ * @compile DupSignatureAttrs.jcod
+ * @run main TestDupSignatureAttr
+ */
+
+public class TestDupSignatureAttr {
+    public static void main(String args[]) throws Throwable {
+
+        System.out.println("Regression test for bug 8176147");
+
+        String[] badClasses = new String[] {
+            "DupClassSigAttrs",
+            "DupMthSigAttrs",
+            "DupFldSigAttrs",
+        };
+        String[] messages = new String[] {
+            "Multiple Signature attributes in class file",
+            "Multiple Signature attributes for method",
+            "Multiple Signature attributes for field",
+        };
+
+        for (int x = 0; x < badClasses.length; x++) {
+            try {
+                Class newClass = Class.forName(badClasses[x]);
+                throw new RuntimeException("Expected ClassFormatError exception not thrown");
+            } catch (java.lang.ClassFormatError e) {
+                if (!e.getMessage().contains(messages[x])) {
+                    throw new RuntimeException("Wrong ClassFormatError exception thrown: " +
+                                               e.getMessage());
+                }
+            }
+        }
+
+        // Multiple Signature attributes but no duplicates.
+        Class newClass = Class.forName("OkaySigAttrs");
+    }
+}
diff --git a/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java b/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java
index d3f3ca7..6847f26 100644
--- a/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java
+++ b/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,7 @@
                 return m;
             }
         }
-        throw new RuntimeException("Failed to find method " + name + " in java.lang.reflect.Module");
+        throw new RuntimeException("Failed to find method " + name + " in java.lang.Module");
     }
 
     // Throw RuntimeException if getSystemPackageLocation() does not return
diff --git a/hotspot/test/runtime/jni/CallWithJNIWeak/CallWithJNIWeak.java b/hotspot/test/runtime/jni/CallWithJNIWeak/CallWithJNIWeak.java
new file mode 100644
index 0000000..3aaec5e
--- /dev/null
+++ b/hotspot/test/runtime/jni/CallWithJNIWeak/CallWithJNIWeak.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8166188
+ * @summary Test call of native function with JNI weak global ref.
+ * @modules java.base
+ * @run main/othervm/native CallWithJNIWeak
+ */
+
+public class CallWithJNIWeak {
+    static {
+        System.loadLibrary("CallWithJNIWeak");
+    }
+
+    private static native void testJNIFieldAccessors(CallWithJNIWeak o);
+
+    // The field initializations must be kept in sync with the JNI code
+    // which reads verifies the values of these fields.
+    private int i = 1;
+    private long j = 2;
+    private boolean z = true;
+    private char c = 'a';
+    private short s = 3;
+    private float f = 1.0f;
+    private double d = 2.0;
+    private Object l;
+
+    private CallWithJNIWeak() {
+        this.l = this;
+    }
+
+    private native void weakReceiverTest0();
+    private void weakReceiverTest() {
+        weakReceiverTest0();
+    }
+
+    private synchronized void synchonizedWeakReceiverTest() {
+        this.notifyAll();
+    }
+
+
+    private static native void runTests(CallWithJNIWeak o);
+
+    public static void main(String[] args) {
+        CallWithJNIWeak w = new CallWithJNIWeak();
+        for (int i = 0; i < 20000; i++) {
+            runTests(w);
+        }
+    }
+}
diff --git a/hotspot/test/runtime/jni/CallWithJNIWeak/libCallWithJNIWeak.c b/hotspot/test/runtime/jni/CallWithJNIWeak/libCallWithJNIWeak.c
new file mode 100644
index 0000000..83a5784
--- /dev/null
+++ b/hotspot/test/runtime/jni/CallWithJNIWeak/libCallWithJNIWeak.c
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <jni.h>
+
+/*
+ * Class:     CallWithJNIWeak
+ * Method:    testJNIFieldAccessors
+ * Signature: (LCallWithJNIWeak;)V
+ */
+JNIEXPORT void JNICALL
+Java_CallWithJNIWeak_testJNIFieldAccessors(JNIEnv *env, jclass clazz, jobject this) {
+  // Make sure that we have a weak reference to the receiver
+
+  jweak self = (*env)->NewWeakGlobalRef(env, this);
+
+  jclass this_class = (*env)->GetObjectClass(env, self);
+
+  jclass exception = (*env)->FindClass(env, "java/lang/RuntimeException");
+
+  jfieldID id_i = (*env)->GetFieldID(env, this_class, "i", "I");
+  jfieldID id_j = (*env)->GetFieldID(env, this_class, "j", "J");
+  jfieldID id_z = (*env)->GetFieldID(env, this_class, "z", "Z");
+  jfieldID id_c = (*env)->GetFieldID(env, this_class, "c", "C");
+  jfieldID id_s = (*env)->GetFieldID(env, this_class, "s", "S");
+  jfieldID id_f = (*env)->GetFieldID(env, this_class, "f", "F");
+  jfieldID id_d = (*env)->GetFieldID(env, this_class, "d", "D");
+  jfieldID id_l = (*env)->GetFieldID(env, this_class, "l", "Ljava/lang/Object;");
+  jvalue v;
+
+#define CHECK(variable, expected)                                   \
+  do {                                                              \
+    if ((variable) != (expected)) {                                 \
+      (*env)->ThrowNew(env, exception,  #variable" != " #expected); \
+      return;                                                       \
+    }                                                               \
+  } while(0)
+
+  // The values checked below must be kept in sync with the Java source file.
+
+  v.i = (*env)->GetIntField(env, self, id_i);
+  CHECK(v.i, 1);
+
+  v.j = (*env)->GetLongField(env, self, id_j);
+  CHECK(v.j, 2);
+
+  v.z = (*env)->GetBooleanField(env, self, id_z);
+  CHECK(v.z, JNI_TRUE);
+
+  v.c = (*env)->GetCharField(env, self, id_c);
+  CHECK(v.c, 'a');
+
+  v.s = (*env)->GetShortField(env, self, id_s);
+  CHECK(v.s, 3);
+
+  v.f = (*env)->GetFloatField(env, self, id_f);
+  CHECK(v.f, 1.0f);
+
+  v.d = (*env)->GetDoubleField(env, self, id_d);
+  CHECK(v.d, 2.0);
+
+#undef CHECK
+
+  v.l = (*env)->GetObjectField(env, self, id_l);
+  if (v.l == NULL) {
+    (*env)->ThrowNew(env, exception, "Object field was null");
+    return;
+  }
+  {
+    jclass clz = (*env)->GetObjectClass(env, v.l);
+    if (!(*env)->IsSameObject(env, clazz, clz)) {
+      (*env)->ThrowNew(env, exception, "Bad object class");
+    }
+  }
+
+  (*env)->DeleteWeakGlobalRef(env, self);
+}
+
+/*
+ * Class:     CallWithJNIWeak
+ * Method:    runTests
+ * Signature: (LCallWithJNIWeak;)V
+ */
+JNIEXPORT void JNICALL
+Java_CallWithJNIWeak_runTests(JNIEnv *env, jclass clazz, jobject this) {
+  jweak that = (*env)->NewWeakGlobalRef(env, this);
+  {
+    jmethodID method = (*env)->GetStaticMethodID(env,
+        clazz, "testJNIFieldAccessors", "(LCallWithJNIWeak;)V");
+    (*env)->CallStaticVoidMethod(env, clazz, method, that);
+    if ((*env)->ExceptionCheck(env)) {
+      return;
+    }
+  }
+
+  {
+    jmethodID method = (*env)->GetMethodID(env, clazz, "weakReceiverTest", "()V");
+    (*env)->CallVoidMethod(env, that, method);
+    if ((*env)->ExceptionCheck(env)) {
+      return;
+    }
+  }
+
+  {
+    jmethodID method = (*env)->GetMethodID(env, clazz, "synchonizedWeakReceiverTest", "()V");
+    (*env)->CallVoidMethod(env, that, method);
+    if ((*env)->ExceptionCheck(env)) {
+      return;
+    }
+  }
+  (*env)->DeleteWeakGlobalRef(env, that);
+}
+
+/*
+ * Class:     CallWithJNIWeak
+ * Method:    weakReceiverTest0
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_CallWithJNIWeak_weakReceiverTest0(JNIEnv *env, jobject obj) {
+  (*env)->GetObjectClass(env, obj);
+}
diff --git a/hotspot/test/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java b/hotspot/test/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java
new file mode 100644
index 0000000..6d58100
--- /dev/null
+++ b/hotspot/test/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8166188
+ * @requires vm.opt.ExplicitGCInvokesConcurrent != true
+ * @summary Test return of JNI weak global refs from native calls.
+ * @modules java.base
+ * @run main/othervm/native -Xint ReturnJNIWeak
+ * @run main/othervm/native -Xcomp ReturnJNIWeak
+ */
+
+public final class ReturnJNIWeak {
+
+    static {
+        System.loadLibrary("ReturnJNIWeak");
+    }
+
+    private static final class TestObject {
+        public final int value;
+
+        public TestObject(int value) {
+            this.value = value;
+        }
+    }
+
+    private static volatile TestObject testObject = null;
+
+    private static native void registerObject(Object o);
+    private static native void unregisterObject();
+    private static native Object getObject();
+
+    // Create the test object and record it both strongly and weakly.
+    private static void remember(int value) {
+        TestObject o = new TestObject(value);
+        registerObject(o);
+        testObject = o;
+    }
+
+    // Remove both strong and weak references to the current test object.
+    private static void forget() {
+        unregisterObject();
+        testObject = null;
+    }
+
+    // Verify the weakly recorded object
+    private static void checkValue(int value) throws Exception {
+        Object o = getObject();
+        if (o == null) {
+            throw new RuntimeException("Weak reference unexpectedly null");
+        }
+        TestObject t = (TestObject)o;
+        if (t.value != value) {
+            throw new RuntimeException("Incorrect value");
+        }
+    }
+
+    // Verify we can create a weak reference and get it back.
+    private static void testSanity() throws Exception {
+        System.out.println("running testSanity");
+        int value = 5;
+        try {
+            remember(value);
+            checkValue(value);
+        } finally {
+            forget();
+        }
+    }
+
+    // Verify weak ref value survives across collection if strong ref exists.
+    private static void testSurvival() throws Exception {
+        System.out.println("running testSurvival");
+        int value = 10;
+        try {
+            remember(value);
+            checkValue(value);
+            System.gc();
+            // Verify weak ref still has expected value.
+            checkValue(value);
+        } finally {
+            forget();
+        }
+    }
+
+    // Verify weak ref cleared if no strong ref exists.
+    private static void testClear() throws Exception {
+        System.out.println("running testClear");
+        int value = 15;
+        try {
+          remember(value);
+          checkValue(value);
+          // Verify still good.
+          checkValue(value);
+          // Drop reference.
+          testObject = null;
+          System.gc();
+          // Verify weak ref cleared as expected.
+          Object recorded = getObject();
+          if (recorded != null) {
+            throw new RuntimeException("expected clear");
+          }
+        } finally {
+          forget();
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        testSanity();
+        testSurvival();
+        testClear();
+    }
+}
diff --git a/hotspot/test/runtime/jni/ReturnJNIWeak/libReturnJNIWeak.c b/hotspot/test/runtime/jni/ReturnJNIWeak/libReturnJNIWeak.c
new file mode 100644
index 0000000..12d7ae9
--- /dev/null
+++ b/hotspot/test/runtime/jni/ReturnJNIWeak/libReturnJNIWeak.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Native support for ReturnJNIWeak test.
+ */
+
+#include "jni.h"
+
+static jweak registered = NULL;
+
+JNIEXPORT void JNICALL
+Java_ReturnJNIWeak_registerObject(JNIEnv* env,
+                                  jclass jclazz,
+                                  jobject value) {
+  // assert registered == NULL
+  registered = (*env)->NewWeakGlobalRef(env, value);
+}
+
+JNIEXPORT void JNICALL
+Java_ReturnJNIWeak_unregisterObject(JNIEnv* env, jclass jclazz) {
+  if (registered != NULL) {
+    (*env)->DeleteWeakGlobalRef(env, registered);
+    registered = NULL;
+  }
+}
+
+JNIEXPORT jobject JNICALL
+Java_ReturnJNIWeak_getObject(JNIEnv* env, jclass jclazz) {
+  // assert registered != NULL
+  return registered;
+}
diff --git a/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java b/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java
index 9d744f2..1c32203 100644
--- a/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java
+++ b/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@
 
         // Start the process, get the pid and then wait for the test to finish
         Process process = builder.start();
-        long pid = process.getPid();
+        long pid = process.pid();
         int retval = process.waitFor();
 
         // make sure the SEGVOverflow test crashed
diff --git a/hotspot/test/runtime/modules/AccModuleTest.java b/hotspot/test/runtime/modules/AccModuleTest.java
index 8deac7f..84e2de3 100644
--- a/hotspot/test/runtime/modules/AccModuleTest.java
+++ b/hotspot/test/runtime/modules/AccModuleTest.java
@@ -28,8 +28,6 @@
  * @run main AccModuleTest
  */
 
-import java.io.File;
-
 public class AccModuleTest {
 
     public static void main(String args[]) throws Throwable {
diff --git a/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java b/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java
index a1eb2cc..465c709 100644
--- a/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java
+++ b/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java
@@ -39,8 +39,6 @@
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
@@ -58,7 +56,7 @@
 
 public class AccessExportTwice {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publicly defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
@@ -68,7 +66,7 @@
         // Packages:          none
         // Packages exported: none
         ModuleDescriptor descriptor_first_mod =
-                ModuleDescriptor.module("first_mod")
+                ModuleDescriptor.newModule("first_mod")
                         .requires("java.base")
                         .requires("second_mod")
                         .build();
@@ -78,7 +76,7 @@
         // Packages:          p2
         // Packages exported: p2 is exported to first_mod
         ModuleDescriptor descriptor_second_mod =
-                ModuleDescriptor.module("second_mod")
+                ModuleDescriptor.newModule("second_mod")
                         .requires("java.base")
                         .exports("p2", Set.of("first_mod"))
                         .build();
@@ -87,17 +85,17 @@
         ModuleFinder finder = ModuleLibrary.of(descriptor_first_mod, descriptor_second_mod);
 
         // Resolves "first_mod"
-        Configuration cf = Layer.boot()
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("first_mod"));
+                .resolve(finder, ModuleFinder.of(), Set.of("first_mod"));
 
         // Map each module to the same class loader
         Map<String, ClassLoader> map = new HashMap<>();
         map.put("first_mod", MySameClassLoader.loader1);
         map.put("second_mod", MySameClassLoader.loader1);
 
-        // Create Layer that contains first_mod & second_mod
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains first_mod & second_mod
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
         assertTrue(layer.findLoader("first_mod") == MySameClassLoader.loader1);
         assertTrue(layer.findLoader("second_mod") == MySameClassLoader.loader1);
diff --git a/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java b/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java
index 5d1a690..74752d3 100644
--- a/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java
+++ b/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java
@@ -39,8 +39,6 @@
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
@@ -56,7 +54,7 @@
 
 public class AccessReadTwice {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publicly defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
@@ -66,9 +64,9 @@
         // Packages:          p1, p4
         // Packages exported: none
         ModuleDescriptor descriptor_first_mod =
-                ModuleDescriptor.module("first_mod")
+                ModuleDescriptor.newModule("first_mod")
                         .requires("java.base")
-                        .contains(Set.of("p1", "p4"))
+                        .packages(Set.of("p1", "p4"))
                         .build();
 
         // Define module:     second_mod
@@ -76,7 +74,7 @@
         // Packages:          p2
         // Packages exported: p2 is exported to first_mod
         ModuleDescriptor descriptor_second_mod =
-                ModuleDescriptor.module("second_mod")
+                ModuleDescriptor.newModule("second_mod")
                         .requires("java.base")
                         .exports("p2", Set.of("first_mod"))
                         .build();
@@ -85,9 +83,9 @@
         ModuleFinder finder = ModuleLibrary.of(descriptor_first_mod, descriptor_second_mod);
 
         // Resolves "first_mod" and "second_mod"
-        Configuration cf = Layer.boot()
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("first_mod", "second_mod"));
+                .resolve(finder, ModuleFinder.of(), Set.of("first_mod", "second_mod"));
 
         // Map each module to this class loader
         Map<String, ClassLoader> map = new HashMap<>();
@@ -95,8 +93,8 @@
         map.put("first_mod", loader);
         map.put("second_mod", loader);
 
-        // Create Layer that contains first_mod & second_mod
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains first_mod & second_mod
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
         assertTrue(layer.findLoader("first_mod") == loader);
         assertTrue(layer.findLoader("second_mod") == loader);
diff --git a/hotspot/test/runtime/modules/AccessCheck/CheckRead.java b/hotspot/test/runtime/modules/AccessCheck/CheckRead.java
index 6143f0b..bc8aaee 100644
--- a/hotspot/test/runtime/modules/AccessCheck/CheckRead.java
+++ b/hotspot/test/runtime/modules/AccessCheck/CheckRead.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test that if module m1 can not read module m2, then class p1.c1
- *          in module m1 can not access p2.c2 in module m2.
+ * @summary Test that if module m1x can not read module m2x, then class p1.c1
+ *          in module m1x can not access p2.c2 in module m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,82 +46,82 @@
 import myloaders.MySameClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-//                  defines m2 --> packages p2
-//                  defines m3 --> packages p3
+// ClassLoader1 --> defines m1x --> packages p1
+//                  defines m2x --> packages p2
+//                  defines m3x --> packages p3
 //
-// m1 can not read m2
-// package p2 in m2 is exported to m1
+// m1x can not read m2x
+// package p2 in m2x is exported to m1x
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2.
-// Access denied since m1 can not read m2.
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x.
+// Access denied since m1x can not read m2x.
 //
 public class CheckRead {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publicly defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m3
+        // Define module:     m1x
+        // Can read:          java.base, m3x
         // Packages:          p1
         // Packages exported: p1 is exported unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m3")
+                        .requires("m3x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
-        // Packages exported: p2 is exported to m1
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: p2 is exported to m1x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m1"))
+                        .exports("p2", Set.of("m1x"))
                         .build();
 
-        // Define module:     m3
-        // Can read:          java.base, m2
+        // Define module:     m3x
+        // Can read:          java.base, m2x
         // Packages:          p3
         // Packages exported: none
-        ModuleDescriptor descriptor_m3 =
-                ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor_m3x =
+                ModuleDescriptor.newModule("m3x")
                         .requires("java.base")
-                        .requires("m2")
-                        .contains("p3")
+                        .requires("m2x")
+                        .packages(Set.of("p3"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
-        map.put("m3", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
+        map.put("m3x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1, m2 and m3
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x, m2x and m3x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1 but m2 is not readable from m1)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x but m2x is not readable from m1x)");
         } catch (IllegalAccessError e) {
             System.out.println(e.getMessage());
             if (!e.getMessage().contains("cannot access")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java
index b0b64a4..732c326 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test that if module m1 can not read module m2, then class p1.c1
- *          in module m1 can not access p2.c2 in module m2.
+ * @summary Test that if module m1x can not read module m2x, then class p1.c1
+ *          in module m1x can not access p2.c2 in module m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MyDiffClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,82 +46,82 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-// ClassLoader2 --> defines m2 --> packages p2
-//                  defines m3 --> packages p3
+// ClassLoader1 --> defines m1x --> packages p1
+// ClassLoader2 --> defines m2x --> packages p2
+//                  defines m3x --> packages p3
 //
-// m1 can not read m2
-// package p2 in m2 is exported to m1
+// m1x can not read m2x
+// package p2 in m2x is exported to m1x
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2.
-// Access denied since m1 can not read m2.
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x.
+// Access denied since m1x can not read m2x.
 //
 public class DiffCL_CheckRead {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publicly defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m3
+        // Define module:     m1x
+        // Can read:          java.base, m3x
         // Packages:          p1
         // Packages exported: p1 is exported unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m3")
+                        .requires("m3x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
-        // Packages exported: p2 is exported to m1
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: p2 is exported to m1x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m1"))
+                        .exports("p2", Set.of("m1x"))
                         .build();
 
-        // Define module:     m3
-        // Can read:          java.base, m2
+        // Define module:     m3x
+        // Can read:          java.base, m2x
         // Packages:          p3
         // Packages exported: none
-        ModuleDescriptor descriptor_m3 =
-                ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor_m3x =
+                ModuleDescriptor.newModule("m3x")
                         .requires("java.base")
-                        .requires("m2")
-                        .contains("p3")
+                        .requires("m2x")
+                        .packages(Set.of("p3"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
-        map.put("m3", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
+        map.put("m3x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1, m2 and m3
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x, m2x and m3x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
-        assertTrue(layer.findLoader("m3") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m3x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1 but m2 is not readable from m1)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x but m2x is not readable from m1x)");
         } catch (IllegalAccessError e) {
             System.out.println(e.getMessage());
             if (!e.getMessage().contains("cannot access")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java
index b7088553..66062c4 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
 
 /*
  * @test
- * @summary Test that if module m1 can read module m2, but package p2 in m2
- *          is exported specifically to module m3, then class p1.c1 in m1 can not
- *          access p2.c2 in m2.
+ * @summary Test that if module m1x can read module m2x, but package p2 in m2x
+ *          is exported specifically to module m3x, then class p1.c1 in m1x can not
+ *          access p2.c2 in m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MyDiffClassLoader.java
@@ -38,7 +38,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -48,83 +47,83 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-// ClassLoader2 --> defines m2 --> packages p2
-//                  defines m3 --> packages p3
+// ClassLoader1 --> defines m1x --> packages p1
+// ClassLoader2 --> defines m2x --> packages p2
+//                  defines m3x --> packages p3
 //
-// m1 can read m2
-// package p2 in m2 is exported to m3
+// m1x can read m2x
+// package p2 in m2x is exported to m3x
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
-// Access denied since although m1 can read m2, p2 is exported only to m3.
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
+// Access denied since although m1x can read m2x, p2 is exported only to m3x.
 //
 public class DiffCL_ExpQualOther {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2, m3
+        // Define module:     m1x
+        // Can read:          java.base, m2x, m3x
         // Packages:          p1
         // Packages exported: p1 is exported unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
-                        .requires("m3")
+                        .requires("m2x")
+                        .requires("m3x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
-        // Can read:          java.base, m3
+        // Define module:     m2x
+        // Can read:          java.base, m3x
         // Packages:          p2
-        // Packages exported: p2 is exported to m3
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: p2 is exported to m3x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m3"))
+                        .exports("p2", Set.of("m3x"))
                         .build();
 
-        // Define module:     m3
-        // Can read:          java.base, m2
+        // Define module:     m3x
+        // Can read:          java.base, m2x
         // Packages:          p3
         // Packages exported: none
-        ModuleDescriptor descriptor_m3 =
-                ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor_m3x =
+                ModuleDescriptor.newModule("m3x")
                         .requires("java.base")
-                        .requires("m2")
-                        .contains("p3")
+                        .requires("m2x")
+                        .packages(Set.of("p3"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
-        map.put("m3", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
+        map.put("m3x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
-        assertTrue(layer.findLoader("m3") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m3x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3 not to m1)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x not to m1x)");
         } catch (IllegalAccessError e) {
             System.out.println(e.getMessage());
             if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java
index 8ca888b..3088a97 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in m2.
- *          Access allowed since m1 can read m2 and package p2 is exported to m1.
+ * @summary class p1.c1 defined in m1x tries to access p2.c2 defined in m2x.
+ *          Access allowed since m1x can read m2x and package p2 is exported to m1x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MyDiffClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,61 +46,61 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-// ClassLoader2 --> defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> packages p1
+// ClassLoader2 --> defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is exported to m1
+// m1x can read m2x
+// package p2 in m2x is exported to m1x
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
-// Access allowed since m1 can read m2 and package p2 is exported to m1.
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
+// Access allowed since m1x can read m2x and package p2 is exported to m1x.
 //
 public class DiffCL_ExpQualToM1 {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          p1
         // Packages exported: p1 is exported to unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
-        // Packages exported: package p2 is exported to m1
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: package p2 is exported to m1x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m1"))
+                        .exports("p2", Set.of("m1x"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
@@ -109,7 +108,7 @@
         try {
             p1_c1_class.newInstance();
         } catch (IllegalAccessError e) {
-            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1");
+            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x");
         }
     }
 
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java
index e38d541..6cb7ea9 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test that if module m1 can read module m2, and package p2 in m2 is
- *          exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2.
+ * @summary Test that if module m1x can read module m2x, and package p2 in m2x is
+ *          exported unqualifiedly, then class p1.c1 in m1x can read p2.c2 in m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MyDiffClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,62 +46,62 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-// ClassLoader2 --> defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> packages p1
+// ClassLoader2 --> defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is exported to m1
+// m1x can read m2x
+// package p2 in m2x is exported to m1x
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
-// Access allowed since m1 can read m2 and package p2 is exported
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
+// Access allowed since m1x can read m2x and package p2 is exported
 // unqualifiedly.
 //
 public class DiffCL_ExpUnqual {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          p1
         // Packages exported: p1 is exported unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
-        // Packages exported: package p2 is exported to m1
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: package p2 is exported to m1x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
                         .exports("p2")
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
@@ -110,7 +109,7 @@
         try {
             p1_c1_class.newInstance();
         } catch (IllegalAccessError e) {
-            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1");
+            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x");
         }
     }
 
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java
index 0cc88f7..e235d89 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test that if module m1 can read module m2, but package p2 in m2 is not
- *          exported, then class p1.c1 in m1 can not read p2.c2 in m2.
+ * @summary Test that if module m1x can read module m2x, but package p2 in m2x is not
+ *          exported, then class p1.c1 in m1x can not read p2.c2 in m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MyDiffClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,68 +46,68 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-// ClassLoader2 --> defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> packages p1
+// ClassLoader2 --> defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is not exported
+// m1x can read m2x
+// package p2 in m2x is not exported
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
 // Access denied since p2 is not exported.
 //
 public class DiffCL_PkgNotExp {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          p1
         // Packages exported: p1 is exported unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
         // Packages exported: none
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .contains("p2")
+                        .packages(Set.of("p2"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)");
         } catch (IllegalAccessError e) {
           System.out.println(e.getMessage());
           if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java
index 2a5c723..fafd41a 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 
 /*
  * @test
- * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module.
+ * @summary class p1.c1 defined in m1x tries to access p2.c2 defined in unnamed module.
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.module
@@ -42,18 +42,16 @@
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-//                  package p1 in m1 is exported unqualifiedly
+// ClassLoader1 --> defines m1x --> packages p1
+//                  package p1 in m1x is exported unqualifiedly
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in
+// class p1.c1 defined in m1x tries to access p2.c2 defined in
 // in unnamed module.
 //
 // Three access attempts occur in this test:
@@ -62,50 +60,50 @@
 //   2. In this scenario a strict module establishes readability
 //      to the particular unnamed module it is trying to access.
 //      Access is allowed.
-//   3. Module m1 in the test_looseModuleLayer() method
+//   3. Module m1x in the test_looseModuleLayer() method
 //      is transitioned to a loose module, access
 //      to all unnamed modules is allowed.
 //
 public class DiffCL_Umod {
 
- // Create Layers over the boot layer to test different
+ // Create layers over the boot layer to test different
  // accessing scenarios of a named module to an unnamed module.
 
- // Module m1 is a strict module and has not established
+ // Module m1x is a strict module and has not established
  // readability to an unnamed module that p2.c2 is defined in.
  public void test_strictModuleLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p1
      // Packages exported: p1 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p1")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
 
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c2 will be loaded in an unnamed module/loader2
      // to achieve differing class loaders.
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", MyDiffClassLoader.loader1);
+     map.put("m1x", MyDiffClassLoader.loader1);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
+     assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p1.c1
@@ -114,109 +112,109 @@
      // Attempt access
      try {
          p1_c1_class.newInstance();
-         throw new RuntimeException("Test Failed, strict module m1 should not be able " +
+         throw new RuntimeException("Test Failed, strict module m1x should not be able " +
                                     "to access public type p2.c2 defined in unnamed module");
      } catch (IllegalAccessError e) {
      }
 }
 
- // Module m1 is a strict module and has established
+ // Module m1x is a strict module and has established
  // readability to an unnamed module that p2.c2 is defined in.
  public void test_strictModuleUnnamedReadableLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p1
      // Packages exported: p1 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p1")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
 
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c2 will be loaded in an unnamed module/loader2
      // to achieve differing class loaders.
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", MyDiffClassLoader.loader1);
+     map.put("m1x", MyDiffClassLoader.loader1);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
+     assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p1.c1ReadEdgeDiffLoader
      Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1ReadEdgeDiffLoader");
 
      try {
-        // Read edge between m1 and the unnamed module that loads p2.c2 is established in
+        // Read edge between m1x and the unnamed module that loads p2.c2 is established in
         // c1ReadEdgeDiffLoader's ctor before attempting access.
         p1_c1_class.newInstance();
      } catch (IllegalAccessError e) {
-         throw new RuntimeException("Test Failed, module m1 has established readability to p2/c2 loader's " +
+         throw new RuntimeException("Test Failed, module m1x has established readability to p2/c2 loader's " +
                                     "unnamed module, access should be allowed: " + e.getMessage());
      }
  }
 
- // Module m1 is a loose module and thus can read all unnamed modules.
+ // Module m1x is a loose module and thus can read all unnamed modules.
  public void test_looseModuleLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p1
      // Packages exported: p1 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p1")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
 
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c2 will be loaded in an unnamed module/loader2
      // to achieve differing class loaders.
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", MyDiffClassLoader.loader1);
+     map.put("m1x", MyDiffClassLoader.loader1);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
+     assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p1.c1Loose
      Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1Loose");
 
-     // change m1 to read all unnamed modules
-     Module m1 = layer.findModule("m1").get();
-     jdk.internal.module.Modules.addReadsAllUnnamed(m1);
+     // change m1x to read all unnamed modules
+     Module m1x = layer.findModule("m1x").get();
+     jdk.internal.module.Modules.addReadsAllUnnamed(m1x);
 
      try {
          p1_c1_class.newInstance();
      } catch (IllegalAccessError e) {
-         throw new RuntimeException("Test Failed, loose module m1 should be able to access " +
+         throw new RuntimeException("Test Failed, loose module m1x should be able to access " +
                                     "public type p2.c2 defined in unnamed module: " + e.getMessage());
      }
  }
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java
index b8420c2..8a0d6a3 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 
 /*
  * @test
- * @summary class p3.c3 defined in module m1 tries to access c4 defined in an unnamed package
+ * @summary class p3.c3 defined in module m1x tries to access c4 defined in an unnamed package
  *          and an unnamed module.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
@@ -38,7 +38,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -48,10 +47,10 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p3
-//                  package p3 in m1 is exported unqualifiedly
+// ClassLoader1 --> defines m1x --> packages p3
+//                  package p3 in m1x is exported unqualifiedly
 //
-// class p3.c3 defined in m1 tries to access c4 defined in
+// class p3.c3 defined in m1x tries to access c4 defined in
 // in unnamed module.
 //
 // Two access attempts occur in this test:
@@ -63,44 +62,44 @@
 //
 public class DiffCL_UmodUpkg {
 
- // Create Layers over the boot layer to test different
+ // Create layers over the boot layer to test different
  // accessing scenarios of a named module to an unnamed module.
 
- // Module m1 is a strict module and has not established
+ // Module m1x is a strict module and has not established
  // readability to an unnamed module that c4 is defined in.
  public void test_strictModuleLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p3
      // Packages exported: p3 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p3")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
 
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c2 will be loaded in an unnamed module/loader2
      // to achieve differing class loaders.
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", MyDiffClassLoader.loader1);
+     map.put("m1x", MyDiffClassLoader.loader1);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
+     assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p3.c3
@@ -109,58 +108,58 @@
      // Attempt access
      try {
          p3_c3_class.newInstance();
-         throw new RuntimeException("Test Failed, strict module m1 should not be able to access " +
+         throw new RuntimeException("Test Failed, strict module m1x should not be able to access " +
                                     "public type c4 defined in unnamed module");
      } catch (IllegalAccessError e) {
      }
 }
 
- // Module m1 is a strict module and has established
+ // Module m1x is a strict module and has established
  // readability to an unnamed module that c4 is defined in.
  public void test_strictModuleUnnamedReadableLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p3
      // Packages exported: p3 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p3")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
      MyDiffClassLoader.loader1 = new MyDiffClassLoader();
      MyDiffClassLoader.loader2 = new MyDiffClassLoader();
 
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c2 will be loaded in an unnamed module/loader2
      // to achieve differing class loaders.
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", MyDiffClassLoader.loader1);
+     map.put("m1x", MyDiffClassLoader.loader1);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
+     assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p3.c3ReadEdgeDiffLoader
      Class p3_c3_class = MyDiffClassLoader.loader1.loadClass("p3.c3ReadEdgeDiffLoader");
 
      try {
-        // Read edge between m1 and the unnamed module that loads c4 is established in
+        // Read edge between m1x and the unnamed module that loads c4 is established in
         // C3ReadEdgeDiffLoader's ctor before attempting access.
         p3_c3_class.newInstance();
      } catch (IllegalAccessError e) {
-         throw new RuntimeException("Test Failed, module m1 has established readability to " +
+         throw new RuntimeException("Test Failed, module m1x has established readability to " +
                                     "c4 loader's unnamed module, access should be allowed: " + e.getMessage());
      }
  }
diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java
index 330d723..d3d8395 100644
--- a/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
 
 /*
  * @test
- * @summary Test that if module m1 can read module m2, but package p2 in m2
- *          is exported specifically to module m3, then class p1.c1 in m1 can not
- *          access p2.c2 in m2.
+ * @summary Test that if module m1x can read module m2x, but package p2 in m2x
+ *          is exported specifically to module m3x, then class p1.c1 in m1x can not
+ *          access p2.c2 in m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -38,7 +38,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -48,83 +47,83 @@
 import myloaders.MySameClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-//                  defines m2 --> packages p2
-//                  defines m3 --> packages p3
+// ClassLoader1 --> defines m1x --> packages p1
+//                  defines m2x --> packages p2
+//                  defines m3x --> packages p3
 //
-// m1 can read m2
-// package p2 in m2 is exported to m3
+// m1x can read m2x
+// package p2 in m2x is exported to m3x
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
-// Access denied since although m1 can read m2, p2 is exported only to m3.
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
+// Access denied since although m1x can read m2x, p2 is exported only to m3x.
 //
 public class ExpQualOther {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2, m3
+        // Define module:     m1x
+        // Can read:          java.base, m2x, m3x
         // Packages:          p1
         // Packages exported: p1 is exported unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
-                        .requires("m3")
+                        .requires("m2x")
+                        .requires("m3x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
-        // Packages exported: p2 is exported to m3
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: p2 is exported to m3x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m3"))
+                        .exports("p2", Set.of("m3x"))
                         .build();
 
-        // Define module:     m3
-        // Can read:          java.base, m2
+        // Define module:     m3x
+        // Can read:          java.base, m2x
         // Packages:          p3
         // Packages exported: none
-        ModuleDescriptor descriptor_m3 =
-                ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor_m3x =
+                ModuleDescriptor.newModule("m3x")
                         .requires("java.base")
-                        .requires("m2")
-                        .contains("p3")
+                        .requires("m2x")
+                        .packages(Set.of("p3"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
-        map.put("m3", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
+        map.put("m3x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3 not to m1)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x not to m1x)");
         } catch (IllegalAccessError e) {
             System.out.println(e.getMessage());
             if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java b/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java
index 31de457..1545bcb 100644
--- a/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java
+++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test that if module m1 can read module m2, AND package p2 in m2 is
- *          exported qualifiedly to m1, then class p1.c1 in m1 can read p2.c2 in m2.
+ * @summary Test that if module m1x can read module m2x, AND package p2 in m2x is
+ *          exported qualifiedly to m1x, then class p1.c1 in m1x can read p2.c2 in m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -48,57 +47,57 @@
 
 public class ExpQualToM1 {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          p1
         // Packages exported: p1 is exported unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
-        // Packages exported: p2 is exported qualifiedly to m1
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: p2 is exported qualifiedly to m1x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m1"))
+                        .exports("p2", Set.of("m1x"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
         } catch (IllegalAccessError e) {
-            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1");
+            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x");
         }
     }
 
diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java
index 03a3770..0daba28 100644
--- a/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java
+++ b/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test that if module m1 can read module m2, AND package p2 in module2 is
- *          exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2.
+ * @summary Test that if module m1x can read module m2x, AND package p2 in module_two is
+ *          exported unqualifiedly, then class p1.c1 in m1x can read p2.c2 in m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -48,50 +47,50 @@
 
 public class ExpUnqual {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          p1
         // Packages exported: p1 is exported unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
         // Packages exported: p2 is exported unqualifiedly
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
                         .exports("p2")
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
diff --git a/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java b/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java
index c9a89c8..69f2ca1 100644
--- a/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java
+++ b/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test if package p2 in module m2 is exported to all unnamed,
- *          then class p1.c1 in an unnamed module can read p2.c2 in module m2.
+ * @summary Test if package p2 in module m2x is exported to all unnamed,
+ *          then class p1.c1 in an unnamed module can read p2.c2 in module m2x.
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.module
@@ -41,76 +41,74 @@
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 import myloaders.MySameClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> no packages
-//                  defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> no packages
+//                  defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is exported unqualifiedly
+// m1x can read m2x
+// package p2 in m2x is exported unqualifiedly
 //
-// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
+// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
 // Access allowed, an unnamed module can read all modules and p2 in module
-//           m2 is exported to all unnamed modules.
+//           m2x is exported to all unnamed modules.
 
 public class ExportAllUnnamed {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
         // Packages exported: p2 is exported unqualifiedly
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m1"))
+                        .exports("p2", Set.of("m1x"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
         assertTrue(layer.findLoader("java.base") == null);
 
         Class p2_c2_class = MySameClassLoader.loader1.loadClass("p2.c2");
-        Module m2 = p2_c2_class.getModule();
+        Module m2x = p2_c2_class.getModule();
 
-        // Export m2/p2 to all unnamed modules.
-        jdk.internal.module.Modules.addExportsToAllUnnamed(m2, "p2");
+        // Export m2x/p2 to all unnamed modules.
+        jdk.internal.module.Modules.addExportsToAllUnnamed(m2x, "p2");
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
diff --git a/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java
index 4f592a1..baabe54 100644
--- a/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test that if module m1 can read module m2, but package p2 in m2 is not
- *          exported, then class p1.c1 in m1 can not read p2.c2 in m2.
+ * @summary Test that if module m1x can read module m2x, but package p2 in m2x is not
+ *          exported, then class p1.c1 in m1x can not read p2.c2 in m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,67 +46,67 @@
 import myloaders.MySameClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-//                  defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> packages p1
+//                  defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is not exported
+// m1x can read m2x
+// package p2 in m2x is not exported
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
 // Access denied since p2 is not exported.
 //
 public class PkgNotExp {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          p1
         // Packages exported: p1 is exported unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
         // Packages exported: none
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .contains("p2")
+                        .packages(Set.of("p2"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1 and m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x and m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)");
         } catch (IllegalAccessError e) {
           System.out.println(e.getMessage());
           if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod.java b/hotspot/test/runtime/modules/AccessCheck/Umod.java
index 255950c..20b97ed 100644
--- a/hotspot/test/runtime/modules/AccessCheck/Umod.java
+++ b/hotspot/test/runtime/modules/AccessCheck/Umod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 
 /*
  * @test
- * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module.
+ * @summary class p1.c1 defined in m1x tries to access p2.c2 defined in unnamed module.
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  * @modules java.base/jdk.internal.module
@@ -39,21 +39,19 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Module;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 import myloaders.MySameClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-//                  package p1 in m1 is exported unqualifiedly
+// ClassLoader1 --> defines m1x --> packages p1
+//                  package p1 in m1x is exported unqualifiedly
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in
+// class p1.c1 defined in m1x tries to access p2.c2 defined in
 // in unnamed module.
 //
 // Three access attempts occur in this test:
@@ -62,47 +60,47 @@
 //   2. In this scenario a strict module establishes readability
 //      to the particular unnamed module it is trying to access.
 //      Access is allowed.
-//   3. Module m1 in the test_looseModuleLayer() method
+//   3. Module m1x in the test_looseModuleLayer() method
 //      is transitioned to a loose module, access
 //      to all unnamed modules is allowed.
 //
 public class Umod {
 
- // Create Layers over the boot layer to test different
+ // Create layers over the boot layer to test different
  // accessing scenarios of a named module to an unnamed module.
 
- // Module m1 is a strict module and has not established
+ // Module m1x is a strict module and has not established
  // readability to an unnamed module that p2.c2 is defined in.
  public void test_strictModuleLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p1
      // Packages exported: p1 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p1")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c2 will be loaded in an unnamed module/loader.
      MySameClassLoader loader = new MySameClassLoader();
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", loader);
+     map.put("m1x", loader);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == loader);
+     assertTrue(layer.findLoader("m1x") == loader);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p1.c1
@@ -111,103 +109,103 @@
      // Attempt access
      try {
          p1_c1_class.newInstance();
-         throw new RuntimeException("Test Failed, strict module m1, type p1.c1, should not be able " +
+         throw new RuntimeException("Test Failed, strict module m1x, type p1.c1, should not be able " +
                                     "to access public type p2.c2 defined in unnamed module");
      } catch (IllegalAccessError e) {
      }
  }
 
- // Module m1 is a strict module and has established
+ // Module m1x is a strict module and has established
  // readability to an unnamed module that p2.c2 is defined in.
  public void test_strictModuleUnnamedReadableLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p1
      // Packages exported: p1 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p1")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
      MySameClassLoader loader = new MySameClassLoader();
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c2 will be loaded in an unnamed module/loader.
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", loader);
+     map.put("m1x", loader);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == loader);
+     assertTrue(layer.findLoader("m1x") == loader);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p1.c1ReadEdge
      Class p1_c1_class = loader.loadClass("p1.c1ReadEdge");
 
      try {
-       // Read edge between m1 and the unnamed module that loads p2.c2 is established in
+       // Read edge between m1x and the unnamed module that loads p2.c2 is established in
        // c1ReadEdge's ctor before attempting access.
        p1_c1_class.newInstance();
      } catch (IllegalAccessError e) {
-         throw new RuntimeException("Test Failed, strict module m1, type p1.c1ReadEdge, should be able to acccess public type " +
+         throw new RuntimeException("Test Failed, strict module m1x, type p1.c1ReadEdge, should be able to acccess public type " +
                                     "p2.c2 defined in unnamed module: " + e.getMessage());
      }
 }
 
- // Module m1 is a loose module and thus can read all unnamed modules.
+ // Module m1x is a loose module and thus can read all unnamed modules.
  public void test_looseModuleLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p1
      // Packages exported: p1 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p1")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
      MySameClassLoader loader = new MySameClassLoader();
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c2 will be loaded in an unnamed module/loader.
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", loader);
+     map.put("m1x", loader);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == loader);
+     assertTrue(layer.findLoader("m1x") == loader);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p1.c1Loose
      Class p1_c1_class = loader.loadClass("p1.c1Loose");
 
-     // change m1 to read all unnamed modules
-     Module m1 = layer.findModule("m1").get();
-     jdk.internal.module.Modules.addReadsAllUnnamed(m1);
+     // change m1x to read all unnamed modules
+     Module m1x = layer.findModule("m1x").get();
+     jdk.internal.module.Modules.addReadsAllUnnamed(m1x);
 
      try {
          p1_c1_class.newInstance();
      } catch (IllegalAccessError e) {
-         throw new RuntimeException("Test Failed, strict module m1, type p1.c1Loose, should be able to acccess public type " +
+         throw new RuntimeException("Test Failed, strict module m1x, type p1.c1Loose, should be able to acccess public type " +
                                     "p2.c2 defined in unnamed module: " + e.getMessage());
      }
  }
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java
index 5fcc629..a017c9f 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
 
 /*
  * @test
- * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2.
+ * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x.
  *          Access is denied, since an unnamed module can read all modules but p2 in module
- *          m2 is exported specifically to module m1, not to all modules.
+ *          m2x is exported specifically to module m1x, not to all modules.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MyDiffClassLoader.java
@@ -38,7 +38,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -48,70 +47,70 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> no packages
-// ClassLoader2 --> defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> no packages
+// ClassLoader2 --> defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is not exported
+// m1x can read m2x
+// package p2 in m2x is not exported
 //
-// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
+// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
 // Access denied, an unnamed module can read all modules but p2 in module
-//             m2 is exported specifically to module m1 not to all modules.
+//             m2x is exported specifically to module m1x not to all modules.
 //
 public class UmodDiffCL_ExpQualOther {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
+        // Define module:     m1x
         // Can read:          java.base
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
         // Packages exported: none
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m1"))
+                        .exports("p2", Set.of("m1x"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
-        // NOTE: module m1 does not define a package named p1.
+        // NOTE: module m1x does not define a package named p1.
         //       p1 will be loaded in an unnamed module.
         Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1, not unqualifiedly");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x, not unqualifiedly");
         } catch (IllegalAccessError e) {
             System.out.println(e.getMessage());
             if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java
index ade483a..724a92d 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2.
- *          Access allowed, an unnamed module can read all modules and p2 in module m2
+ * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x.
+ *          Access allowed, an unnamed module can read all modules and p2 in module m2x
  *          which is exported unqualifiedly.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
@@ -38,7 +38,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -48,70 +47,70 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> no packages
-// ClassLoader2 --> defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> no packages
+// ClassLoader2 --> defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is exported unqualifiedly.
+// m1x can read m2x
+// package p2 in m2x is exported unqualifiedly.
 //
-// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
+// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
 // Access allowed, an unnamed module can read all modules and p2 in module
-//              m2 which is exported unqualifiedly.
+//              m2x which is exported unqualifiedly.
 //
 public class UmodDiffCL_ExpUnqual {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
         // Packages exported: none
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
                         .exports("p2")
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
-        // NOTE: module m1 does not define a package named p1.
+        // NOTE: module m1x does not define a package named p1.
         //       p1 will be loaded in an unnamed module.
         Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
         } catch (IllegalAccessError e) {
-            throw new RuntimeException("Test Failed, p1.c1 defined in unnamed module can access p2.c2 in module m2");
+            throw new RuntimeException("Test Failed, p1.c1 defined in unnamed module can access p2.c2 in module m2x");
         }
     }
 
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java
index b5ec6c6..c95ab7f 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
 
 /*
  * @test
- * @summary class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2.
+ * @summary class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2x.
  *          Access is denied since even though unnamed module can read all modules, p2
- *          in module m2 is not exported at all.
+ *          in module m2x is not exported at all.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MyDiffClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,70 +46,70 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> no packages
-// ClassLoader2 --> defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> no packages
+// ClassLoader2 --> defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is not exported
+// m1x can read m2x
+// package p2 in m2x is not exported
 //
-// class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2
+// class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2x
 // Access denied since even though unnamed module can read all modules, p2
-// in module m2 is not exported at all.
+// in module m2x is not exported at all.
 //
 public class UmodDiffCL_PkgNotExp {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
         // Packages exported: none
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .contains("p2")
+                        .packages(Set.of("p2"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
-        // NOTE: module m1 does not define a package named p1.
+        // NOTE: module m1x does not define a package named p1.
         //       p1 will be loaded in an unnamed module.
         Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported to an unnamed module)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported to an unnamed module)");
         } catch (IllegalAccessError e) {
           System.out.println(e.getMessage());
           if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java b/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java
index 7cfcdab..f84425b 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 
 /*
  * @test
- * @summary class p3.c3 defined in module m1 tries to access c4 defined in unnamed module.
+ * @summary class p3.c3 defined in module m1x tries to access c4 defined in unnamed module.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -40,18 +40,16 @@
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 import myloaders.MySameClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> packages p3
-//                  package p3 in m1 is exported unqualifiedly
+// ClassLoader1 --> defines m1x --> packages p3
+//                  package p3 in m1x is exported unqualifiedly
 //
-// class p3.c3 defined in m1 tries to access c4 defined in
+// class p3.c3 defined in m1x tries to access c4 defined in
 // in unnamed module.
 //
 // Two access attempts occur in this test:
@@ -63,41 +61,41 @@
 //
 public class UmodUPkg {
 
- // Create Layers over the boot layer to test different
+ // Create layers over the boot layer to test different
  // accessing scenarios of a named module to an unnamed module.
 
- // Module m1 is a strict module and has not established
+ // Module m1x is a strict module and has not established
  // readability to an unnamed module that c4 is defined in.
  public void test_strictModuleLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p3
      // Packages exported: p3 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p3")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c4 will be loaded in an unnamed module/loader.
      MySameClassLoader loader = new MySameClassLoader();
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", loader);
+     map.put("m1x", loader);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == loader);
+     assertTrue(layer.findLoader("m1x") == loader);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p3.c3
@@ -106,55 +104,55 @@
      // Attempt access
      try {
          p3_c3_class.newInstance();
-         throw new RuntimeException("Test Failed, strict module m1, type p3.c3, should not be able to access " +
+         throw new RuntimeException("Test Failed, strict module m1x, type p3.c3, should not be able to access " +
                                     "public type c4 defined in unnamed module");
      } catch (IllegalAccessError e) {
      }
  }
 
- // Module m1 is a strict module and has established
+ // Module m1x is a strict module and has established
  // readability to an unnamed module that c4 is defined in.
  public void test_strictModuleUnnamedReadableLayer() throws Throwable {
 
-     // Define module:     m1
+     // Define module:     m1x
      // Can read:          java.base
      // Packages:          p3
      // Packages exported: p3 is exported unqualifiedly
-     ModuleDescriptor descriptor_m1 =
-             ModuleDescriptor.module("m1")
+     ModuleDescriptor descriptor_m1x =
+             ModuleDescriptor.newModule("m1x")
                      .requires("java.base")
                      .exports("p3")
                      .build();
 
      // Set up a ModuleFinder containing all modules for this layer.
-     ModuleFinder finder = ModuleLibrary.of(descriptor_m1);
+     ModuleFinder finder = ModuleLibrary.of(descriptor_m1x);
 
-     // Resolves "m1"
-     Configuration cf = Layer.boot()
+     // Resolves "m1x"
+     Configuration cf = ModuleLayer.boot()
              .configuration()
-             .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+             .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
      MySameClassLoader loader = new MySameClassLoader();
-     // map module m1 to class loader.
+     // map module m1x to class loader.
      // class c4 will be loaded in an unnamed module/loader.
      Map<String, ClassLoader> map = new HashMap<>();
-     map.put("m1", loader);
+     map.put("m1x", loader);
 
-     // Create Layer that contains m1
-     Layer layer = Layer.boot().defineModules(cf, map::get);
+     // Create layer that contains m1x
+     ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-     assertTrue(layer.findLoader("m1") == loader);
+     assertTrue(layer.findLoader("m1x") == loader);
      assertTrue(layer.findLoader("java.base") == null);
 
      // now use the same loader to load class p3.c3ReadEdge
      Class p3_c3_class = loader.loadClass("p3.c3ReadEdge");
 
      try {
-        // Read edge between m1 and the unnamed module that loads c4 is established in
+        // Read edge between m1x and the unnamed module that loads c4 is established in
         // c3ReadEdge's ctor before attempting access.
         p3_c3_class.newInstance();
      } catch (IllegalAccessError e) {
-         throw new RuntimeException("Test Failed, module m1, type p3.c3ReadEdge, has established readability to " +
+         throw new RuntimeException("Test Failed, module m1x, type p3.c3ReadEdge, has established readability to " +
                                     "c4 loader's unnamed module, access should be allowed: " + e.getMessage());
      }
  }
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java
index 01ec39a..85ecfac 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
 
 /*
  * @test
- * @summary class c5 defined in an unnamed module tries to access p6.c6 defined in m2.
+ * @summary class c5 defined in an unnamed module tries to access p6.c6 defined in m2x.
  *          Access is denied, since an unnamed module can read all modules but p6 in module
- *          m2 is exported specifically to module m1, not to all modules.
+ *          m2x is exported specifically to module m1x, not to all modules.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MyDiffClassLoader.java
@@ -38,7 +38,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -48,68 +47,68 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> no packages
-// ClassLoader2 --> defines m2 --> packages p6
+// ClassLoader1 --> defines m1x --> no packages
+// ClassLoader2 --> defines m2x --> packages p6
 //
-// m1 can read m2
-// package p6 in m2 is not exported
+// m1x can read m2x
+// package p6 in m2x is not exported
 //
-// class c5 defined in an unnamed module tries to access p6.c6 defined in m2
+// class c5 defined in an unnamed module tries to access p6.c6 defined in m2x
 // Access denied, an unnamed module can read all modules but p6 in module
-//             m2 is exported specifically to module m1 not to all modules.
+//             m2x is exported specifically to module m1x not to all modules.
 //
 public class UmodUpkgDiffCL_ExpQualOther {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p6
-        // Packages exported: p6 exported to m1
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: p6 exported to m1x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p6", Set.of("m1"))
+                        .exports("p6", Set.of("m1x"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class c5
         Class c5_class = MyDiffClassLoader.loader1.loadClass("c5");
         try {
             c5_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p6 in m2 is exported to m1, not unqualifiedly");
+            throw new RuntimeException("Failed to get IAE (p6 in m2x is exported to m1x, not unqualifiedly");
         } catch (IllegalAccessError e) {
             System.out.println(e.getMessage());
             if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java
index 68dd377..b55a19e 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary class c5 in an unnamed module can read module m2, but package p6 in module m2 is not exported.
- *          Access denied since even though unnamed module can read all modules, p6 in module m2 is not exported at all.
+ * @summary class c5 in an unnamed module can read module m2x, but package p6 in module m2x is not exported.
+ *          Access denied since even though unnamed module can read all modules, p6 in module m2x is not exported at all.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MyDiffClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,70 +46,70 @@
 import myloaders.MyDiffClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> no packages
-// ClassLoader2 --> defines m2 --> packages p6
+// ClassLoader1 --> defines m1x --> no packages
+// ClassLoader2 --> defines m2x --> packages p6
 //
-// m1 can read m2
-// package p6 in m2 is not exported
+// m1x can read m2x
+// package p6 in m2x is not exported
 //
-// class c5 defined in unnamed module tries to access p6.c6 defined in m2
+// class c5 defined in unnamed module tries to access p6.c6 defined in m2x
 // Access denied since even though unnamed module can read all modules, p6
-// in module m2 is not exported at all.
+// in module m2x is not exported at all.
 //
 public class UmodUpkgDiffCL_NotExp {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p6
         // Packages exported: none
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .contains("p6")
+                        .packages(Set.of("p6"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MyDiffClassLoader.loader1);
-        map.put("m2", MyDiffClassLoader.loader2);
+        map.put("m1x", MyDiffClassLoader.loader1);
+        map.put("m2x", MyDiffClassLoader.loader2);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2);
+        assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class c5
-        // NOTE: module m1 does not define any packages.
+        // NOTE: module m1x does not define any packages.
         //       c5 will be loaded in an unnamed module.
         Class c5_class = MyDiffClassLoader.loader1.loadClass("c5");
         try {
             c5_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p6 in m2 is not exported to " +
+            throw new RuntimeException("Failed to get IAE (p6 in m2x is not exported to " +
                                        "an unnamed module that c5 is defined within)");
         } catch (IllegalAccessError e) {
           System.out.println(e.getMessage());
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java
index 68abe56..081dc0a 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test that if class c5 in an unnamed module can read package p6 in module m2, but package p6 in module m2 is
- *          exported qualifiedly to module m3, then class c5 in an unnamed module can not read p6.c6 in module m2.
+ * @summary Test that if class c5 in an unnamed module can read package p6 in module m2x, but package p6 in module m2x is
+ *          exported qualifiedly to module m3x, then class c5 in an unnamed module can not read p6.c6 in module m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,80 +46,80 @@
 import myloaders.MySameClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> no packages
-//                  defines m2 --> packages p6
-//                  defines m3 --> packages p3
+// ClassLoader1 --> defines m1x --> no packages
+//                  defines m2x --> packages p6
+//                  defines m3x --> packages p3
 //
-// m1 can read m2
-// package p6 in m2 is exported to m3
+// m1x can read m2x
+// package p6 in m2x is exported to m3x
 //
-// class c5 defined in m1 tries to access p6.c6 defined in m2
-// Access denied since although m1 can read m2, p6 is exported only to m3.
+// class c5 defined in m1x tries to access p6.c6 defined in m2x
+// Access denied since although m1x can read m2x, p6 is exported only to m3x.
 //
 public class UmodUpkg_ExpQualOther {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1 (need to define m1 to establish the Layer successfully)
-        // Can read:          java.base, m2, m3
+        // Define module:     m1x (need to define m1x to establish the layer successfully)
+        // Can read:          java.base, m2x, m3x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
-                        .requires("m3")
+                        .requires("m2x")
+                        .requires("m3x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p6
-        // Packages exported: p6 is exported to m3
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: p6 is exported to m3x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p6", Set.of("m3"))
+                        .exports("p6", Set.of("m3x"))
                         .build();
 
-        // Define module:     m3
+        // Define module:     m3x
         // Can read:          java.base
         // Packages:          p3
         // Packages exported: none
-        ModuleDescriptor descriptor_m3 =
-                ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor_m3x =
+                ModuleDescriptor.newModule("m3x")
                         .requires("java.base")
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
-        map.put("m3", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
+        map.put("m3x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1, m2 and m3
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x, m2x and m3x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class c5
         Class c5_class = MySameClassLoader.loader1.loadClass("c5");
         try {
             c5_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p6 in m2 is exported to m3, not unqualifiedly to everyone)");
+            throw new RuntimeException("Failed to get IAE (p6 in m2x is exported to m3x, not unqualifiedly to everyone)");
         } catch (IllegalAccessError e) {
             System.out.println(e.getMessage());
             if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java
index da69805..d7e3287 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test if package p6 in module m2 is not exported, then class c5
- *          in an unnamed module can not access p6.c2 in module m2.
+ * @summary Test if package p6 in module m2x is not exported, then class c5
+ *          in an unnamed module can not access p6.c2 in module m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -46,67 +45,67 @@
 import java.util.Set;
 import myloaders.MySameClassLoader;
 
-// ClassLoader1 --> defines m1 --> no packages
-//                  defines m2 --> packages p6
+// ClassLoader1 --> defines m1x --> no packages
+//                  defines m2x --> packages p6
 //
-// m1 can read m2
-// package p6 in m2 is not exported
+// m1x can read m2x
+// package p6 in m2x is not exported
 //
-// class c5 defined in an unnamed module tries to access p6.c2 defined in m2
+// class c5 defined in an unnamed module tries to access p6.c2 defined in m2x
 // Access denied since p6 is not exported.
 //
 public class UmodUpkg_NotExp {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p6
         // Packages exported: none
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .contains("p6")
+                        .packages(Set.of("p6"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1 and m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x and m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class c5
         Class c5_class = MySameClassLoader.loader1.loadClass("c5");
         try {
             c5_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p6 in m2 is not exported)");
+            throw new RuntimeException("Failed to get IAE (p6 in m2x is not exported)");
         } catch (IllegalAccessError e) {
           System.out.println(e.getMessage());
           if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java
index 0f5aaf2..1032eec 100644
--- a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test that if package p2 in module m2 is exported to module m3,
- *          then class p1.c1 in an unnamed module can not read p2.c2 in module m2.
+ * @summary Test that if package p2 in module m2x is exported to module m3x,
+ *          then class p1.c1 in an unnamed module can not read p2.c2 in module m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,80 +46,80 @@
 import myloaders.MySameClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> no packages
-//                  defines m2 --> packages p2
-//                  defines m3 --> packages p3
+// ClassLoader1 --> defines m1x --> no packages
+//                  defines m2x --> packages p2
+//                  defines m3x --> packages p3
 //
-// m1 can read m2
-// package p2 in m2 is exported to m3
+// m1x can read m2x
+// package p2 in m2x is exported to m3x
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
-// Access denied since although m1 can read m2, p2 is exported only to m3.
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
+// Access denied since although m1x can read m2x, p2 is exported only to m3x.
 //
 public class Umod_ExpQualOther {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1 (need to define m1 to establish the Layer successfully)
-        // Can read:          java.base, m2, m3
+        // Define module:     m1x (need to define m1x to establish the layer successfully)
+        // Can read:          java.base, m2x, m3x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
-                        .requires("m3")
+                        .requires("m2x")
+                        .requires("m3x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
-        // Packages exported: p2 is exported to m3
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: p2 is exported to m3x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m3"))
+                        .exports("p2", Set.of("m3x"))
                         .build();
 
-        // Define module:     m3
+        // Define module:     m3x
         // Can read:          java.base
         // Packages:          p3
         // Packages exported: none
-        ModuleDescriptor descriptor_m3 =
-                ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor_m3x =
+                ModuleDescriptor.newModule("m3x")
                         .requires("java.base")
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
-        map.put("m3", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
+        map.put("m3x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1, m2 and m3
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x, m2x and m3x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3, not unqualifiedly to everyone)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x, not unqualifiedly to everyone)");
         } catch (IllegalAccessError e) {
             System.out.println(e.getMessage());
             if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java
index db90a08..05971ce 100644
--- a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java
+++ b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test if package p2 in module m2 is exported unqualifiedly,
- *          then class p1.c1 in an unnamed module can read p2.c2 in module m2.
+ * @summary Test if package p2 in module m2x is exported unqualifiedly,
+ *          then class p1.c1 in an unnamed module can read p2.c2 in module m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -47,61 +46,61 @@
 import myloaders.MySameClassLoader;
 
 //
-// ClassLoader1 --> defines m1 --> no packages
-//                  defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> no packages
+//                  defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is exported unqualifiedly
+// m1x can read m2x
+// package p2 in m2x is exported unqualifiedly
 //
-// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
+// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
 // Access allowed, an unnamed module can read all modules and p2 in module
-//           m2 which is exported unqualifiedly.
+//           m2x which is exported unqualifiedly.
 
 public class Umod_ExpUnqual {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
         // Packages exported: p2 is exported unqualifiedly
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
                         .exports("p2")
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java
index d140cf8..46e6929 100644
--- a/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 
 /*
  * @test
- * @summary Test if package p2 in module m2 is not exported, then class p1.c1
- *          in an unnamed module can not access p2.c2 in module m2.
+ * @summary Test if package p2 in module m2x is not exported, then class p1.c1
+ *          in an unnamed module can not access p2.c2 in module m2x.
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @compile myloaders/MySameClassLoader.java
@@ -37,7 +37,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -46,67 +45,67 @@
 import java.util.Set;
 import myloaders.MySameClassLoader;
 
-// ClassLoader1 --> defines m1 --> no packages
-//                  defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> no packages
+//                  defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is not exported
+// m1x can read m2x
+// package p2 in m2x is not exported
 //
-// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2
+// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x
 // Access denied since p2 is not exported.
 //
 public class Umod_PkgNotExp {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          none
         // Packages exported: none
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
         // Packages exported: none
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .contains("p2")
+                        .packages(Set.of("p2"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", MySameClassLoader.loader1);
-        map.put("m2", MySameClassLoader.loader1);
+        map.put("m1x", MySameClassLoader.loader1);
+        map.put("m2x", MySameClassLoader.loader1);
 
-        // Create Layer that contains m1 and m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
+        // Create layer that contains m1x and m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
 
-        assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1);
-        assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1);
+        assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
         Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)");
         } catch (IllegalAccessError e) {
           System.out.println(e.getMessage());
           if (!e.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/p1/c1Loose.java b/hotspot/test/runtime/modules/AccessCheck/p1/c1Loose.java
index 3722927..ab03e5d 100644
--- a/hotspot/test/runtime/modules/AccessCheck/p1/c1Loose.java
+++ b/hotspot/test/runtime/modules/AccessCheck/p1/c1Loose.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 
 public class c1Loose {
     public c1Loose() {
-        // Attempt access - access should succeed since m1 is a loose module
+        // Attempt access - access should succeed since m1x is a loose module
         p2.c2 c2_obj = new p2.c2();
         c2_obj.method2();
     }
diff --git a/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdge.java b/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdge.java
index 55d4a8b..40b31cc 100644
--- a/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdge.java
+++ b/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdge.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,17 +22,16 @@
  */
 package p1;
 
-import java.lang.reflect.*;
 import p2.c2;
 
 public class c1ReadEdge {
     public c1ReadEdge() {
-        // Establish read edge from module m1, where c1ReadEdge is defined,
+        // Establish read edge from module m1x, where c1ReadEdge is defined,
         // to the unnamed module, where p2.c2 will be defined.
-        Module m1 = c1ReadEdge.class.getModule();
+        Module m1x = c1ReadEdge.class.getModule();
         ClassLoader loader = c1ReadEdge.class.getClassLoader();
         Module unnamed_module = loader.getUnnamedModule();
-        m1.addReads(unnamed_module);
+        m1x.addReads(unnamed_module);
 
         // Attempt access - access should succeed
         p2.c2 c2_obj = new p2.c2();
diff --git a/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdgeDiffLoader.java b/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdgeDiffLoader.java
index daaee58..51b8955 100644
--- a/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdgeDiffLoader.java
+++ b/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdgeDiffLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,38 +22,37 @@
  */
 package p1;
 
-import java.lang.reflect.*;
 import myloaders.MyDiffClassLoader;
 import p2.c2;
 
 public class c1ReadEdgeDiffLoader {
     public c1ReadEdgeDiffLoader() {
-        // The goal is to establish a read edge between module m1
+        // The goal is to establish a read edge between module m1x
         // which is the module where p1.c1ReadEdgeDiffLoader is defined,
         // and the unnamed module that defines p2.c2.  This must be
         // done in 2 steps:
         //
-        // Step #1: Establish a read edge between m1, where c1ReadEdgeDiffLoader
+        // Step #1: Establish a read edge between m1x, where c1ReadEdgeDiffLoader
         //          is defined, and the System ClassLoader's unnamed module,
         //          where MyDiffClassLoader is defined. This read edge
         //          is needed before we can obtain MyDiffClassLoader.loader2's unnamed module.
         //
-        // Step #2: Establish a read edge between m1, where c1ReadEdgeDiffLoader
+        // Step #2: Establish a read edge between m1x, where c1ReadEdgeDiffLoader
         //          is defined, and the MyDiffClassLoader.loader2's unnamed module,
         //          where p2.c2 will be defined.
 
-        // Step #1: read edge m1 -> System ClassLoader's unnamed module
-        Module m1 = c1ReadEdgeDiffLoader.class.getModule();
+        // Step #1: read edge m1x -> System ClassLoader's unnamed module
+        Module m1x = c1ReadEdgeDiffLoader.class.getModule();
         ClassLoader system_loader = ClassLoader.getSystemClassLoader();
-        Module unnamed_module1 = system_loader.getUnnamedModule();
-        m1.addReads(unnamed_module1);
+        Module unnamed_module_one = system_loader.getUnnamedModule();
+        m1x.addReads(unnamed_module_one);
 
-        // Step #2: read edge m1 -> MyDiffClassLoader.loader2's unnamed module
+        // Step #2: read edge m1x -> MyDiffClassLoader.loader2's unnamed module
         ClassLoader loader2 = MyDiffClassLoader.loader2;
-        Module unnamed_module2 = loader2.getUnnamedModule();
-        m1.addReads(unnamed_module2);
+        Module unnamed_module_two = loader2.getUnnamedModule();
+        m1x.addReads(unnamed_module_two);
 
-        // Attempt access - access should succeed since m1 can read
+        // Attempt access - access should succeed since m1x can read
         //                  MyDiffClassLoader.loader2's unnamed module
         p2.c2 c2_obj = new p2.c2();
         c2_obj.method2();
diff --git a/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdge.jcod b/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdge.jcod
index 50df618..cc52939 100644
--- a/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdge.jcod
+++ b/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdge.jcod
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,15 +23,14 @@
 
 /*
  * package p3;
- * import java.lang.reflect.*;
  * public class c3ReadEdge {
  *    public c3ReadEdge() {
- *       // Establish read edge from module m1, where c3ReadEdge is defined,
+ *       // Establish read edge from module m1x, where c3ReadEdge is defined,
  *       // to the unnamed module, where c4 will be defined.
- *       Module m1 = c3ReadEdge.class.getModule();
+ *       Module m1x = c3ReadEdge.class.getModule();
  *       ClassLoader loader = c3ReadEdge.class.getClassLoader();
  *       Module unnamed_module = loader.getUnnamedModule();
- *       m1.addReads(unnamed_module);
+ *       m1x.addReads(unnamed_module);
  *       // Attempt access - access should succeed
  *       c4 c4_obj = new c4();
  *       c4_obj.method4();
@@ -75,14 +74,14 @@
     Utf8 "java/lang/Object"; // #28     at 0xBC
     Utf8 "java/lang/Class"; // #29     at 0xCF
     Utf8 "getModule"; // #30     at 0xE1
-    Utf8 "()Ljava/lang/reflect/Module;"; // #31     at 0xED
+    Utf8 "()Ljava/lang/Module;"; // #31     at 0xED
     Utf8 "getClassLoader"; // #32     at 0x010C
     Utf8 "()Ljava/lang/ClassLoader;"; // #33     at 0x011D
     Utf8 "java/lang/ClassLoader"; // #34     at 0x0139
     Utf8 "getUnnamedModule"; // #35     at 0x0151
-    Utf8 "java/lang/reflect/Module"; // #36     at 0x0164
+    Utf8 "java/lang/Module"; // #36     at 0x0164
     Utf8 "addReads"; // #37     at 0x017F
-    Utf8 "(Ljava/lang/reflect/Module;)Ljava/lang/reflect/Module;"; // #38     at 0x018A
+    Utf8 "(Ljava/lang/Module;)Ljava/lang/Module;"; // #38     at 0x018A
     Utf8 "method4"; // #39     at 0x01C3
   } // Constant Pool
 
diff --git a/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdgeDiffLoader.jcod b/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdgeDiffLoader.jcod
index 103f7ee..e1602cd 100644
--- a/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdgeDiffLoader.jcod
+++ b/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdgeDiffLoader.jcod
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,37 +23,36 @@
 
 /* 
  * package p3;
- * import java.lang.reflect.*;
  * import myloaders.MyDiffClassLoader;
  *
  * public class c3ReadEdgeDiffLoader {
  *    public c3ReadEdgeDiffLoader() {
- *       // The goal is to establish a read edge between module m1
+ *       // The goal is to establish a read edge between module m1x
  *       // which is the module where p3.c3ReadEdgeDiffLoader is defined,
  *       // and the unnamed module that defines c4.  This must be
  *       // done in 2 steps:
  *       //
- *       // Step #1: Establish a read edge between m1, where c3ReadEdgeDiffLoader
+ *       // Step #1: Establish a read edge between m1x, where c3ReadEdgeDiffLoader
  *       //          is defined, and the System ClassLoader's unnamed module,
  *       //          where MyDiffClassLoader is defined. This read edge
  *       //          is needed before we can obtain MyDiffClassLoader.loader2's unnamed module.
  *       //
- *       // Step #2: Establish a read edge between m1, where c3ReadEdgeDiffLoader
+ *       // Step #2: Establish a read edge between m1x, where c3ReadEdgeDiffLoader
  *       //          is defined, and the MyDiffClassLoader.loader2's unnamed module,
  *       //          where c4 will be defined.
  *
- *       // Step #1: read edge m1 -> System ClassLoader's unnamed module
- *       Module m1 = c3ReadEdgeDiffLoader.class.getModule();
+ *       // Step #1: read edge m1x -> System ClassLoader's unnamed module
+ *       Module m1x = c3ReadEdgeDiffLoader.class.getModule();
  *       ClassLoader system_loader = ClassLoader.getSystemClassLoader();
- *       Module unnamed_module1 = system_loader.getUnnamedModule();
- *       m1.addReads(unnamed_module1);
+ *       Module unnamed_module_one = system_loader.getUnnamedModule();
+ *       m1x.addReads(unnamed_module_one);
  *
- *       // Step #2: read edge m1 -> MyDiffClassLoader.loader2's unnamed module
+ *       // Step #2: read edge m1x -> MyDiffClassLoader.loader2's unnamed module
  *       ClassLoader loader2 = MyDiffClassLoader.loader2;
- *       Module unnamed_module2 = loader2.getUnnamedModule();
- *       m1.addReads(unnamed_module2);
+ *       Module unnamed_module_two = loader2.getUnnamedModule();
+ *       m1x.addReads(unnamed_module_two);
  *
- *       // Attempt access - should succeed since m1 can read
+ *       // Attempt access - should succeed since m1x can read
  *       //                  MyDiffClassLoader.loader2's unnamed module
  *       c4 c4_obj = new c4();
  *       c4_obj.method4();
@@ -100,14 +99,14 @@
     Utf8 "java/lang/Object"; // #31     at 0xDD
     Utf8 "java/lang/Class"; // #32     at 0xF0
     Utf8 "getModule"; // #33     at 0x0102
-    Utf8 "()Ljava/lang/reflect/Module;"; // #34     at 0x010E
+    Utf8 "()Ljava/lang/Module;"; // #34     at 0x010E
     Utf8 "java/lang/ClassLoader"; // #35     at 0x012D
     Utf8 "getSystemClassLoader"; // #36     at 0x0145
     Utf8 "()Ljava/lang/ClassLoader;"; // #37     at 0x015C
     Utf8 "getUnnamedModule"; // #38     at 0x0178
-    Utf8 "java/lang/reflect/Module"; // #39     at 0x018B
+    Utf8 "java/lang/Module"; // #39     at 0x018B
     Utf8 "addReads"; // #40     at 0x01A6
-    Utf8 "(Ljava/lang/reflect/Module;)Ljava/lang/reflect/Module;"; // #41     at 0x01B1
+    Utf8 "(Ljava/lang/Module;)Ljava/lang/Module;"; // #41     at 0x01B1
     Utf8 "myloaders/MyDiffClassLoader"; // #42     at 0x01EA
     Utf8 "loader2"; // #43     at 0x0208
     Utf8 "Lmyloaders/MyDiffClassLoader;"; // #44     at 0x0212
diff --git a/hotspot/test/runtime/modules/AccessCheck/p4/c4.java b/hotspot/test/runtime/modules/AccessCheck/p4/c4.java
index d009867..8df98a6 100644
--- a/hotspot/test/runtime/modules/AccessCheck/p4/c4.java
+++ b/hotspot/test/runtime/modules/AccessCheck/p4/c4.java
@@ -25,8 +25,6 @@
 
 package p4;
 
-import java.lang.reflect.Module;
-
 public class c4 {
     // Add a read edge from c4's module to given module m
     public void addReads(Module m) {
diff --git a/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java b/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java
index 7872d0d..69ee6d6 100644
--- a/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java
+++ b/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,6 @@
  * questions.
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 /*
@@ -31,7 +30,7 @@
  * @compile p2/c2.java
  * @compile p1/c1.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckAllUnnamed
@@ -43,28 +42,28 @@
     // and then test that a class in the unnamed module can access a package in a
     // named module that has been exported to all unnamed modules.
     public static void main(String args[]) throws Throwable {
-        Object m1, m2;
+        Object m1x, m2x;
 
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlM = jlObject.getModule();
+        assertNotNull(jlM, "jlModule object of java.lang.Object should not be null");
 
         // Get the class loader for AccessCheckWorks and assume it's also used to
         // load class p2.c2.
         ClassLoader this_cldr = AccessCheckAllUnnamed.class.getClassLoader();
 
         // Define a module for p3.
-        m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p3" });
-        assertNotNull(m1, "Module should not be null");
-        ModuleHelper.DefineModule(m1, "9.0", "m1/there", new String[] { "p3" });
-        ModuleHelper.AddReadsModule(m1, jlObject_jlrM);
+        m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p3" });
+        assertNotNull(m1x, "Module should not be null");
+        ModuleHelper.DefineModule(m1x, "9.0", "m1x/there", new String[] { "p3" });
+        ModuleHelper.AddReadsModule(m1x, jlM);
 
         // Define a module for p2.
-        m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
-        ModuleHelper.AddReadsModule(m2, jlObject_jlrM);
+        m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
+        ModuleHelper.AddReadsModule(m2x, jlM);
 
         try {
             ModuleHelper.AddModuleExportsToAllUnnamed((Module)null, "p2");
@@ -74,7 +73,7 @@
         }
 
         try {
-            ModuleHelper.AddModuleExportsToAllUnnamed(m2, null);
+            ModuleHelper.AddModuleExportsToAllUnnamed(m2x, null);
             throw new RuntimeException("Failed to get the expected NPE for null package");
         } catch(NullPointerException e) {
             // Expected
@@ -88,21 +87,21 @@
         }
 
         try {
-            ModuleHelper.AddModuleExportsToAllUnnamed(m2, "p3");
+            ModuleHelper.AddModuleExportsToAllUnnamed(m2x, "p3");
             throw new RuntimeException("Failed to get the expected IAE for package in other module");
         } catch(IllegalArgumentException e) {
             // Expected
         }
 
         try {
-            ModuleHelper.AddModuleExportsToAllUnnamed(m2, "p4");
+            ModuleHelper.AddModuleExportsToAllUnnamed(m2x, "p4");
             throw new RuntimeException("Failed to get the expected IAE for package not in module");
         } catch(IllegalArgumentException e) {
             // Expected
         }
 
-        // Export package p2 in m2 to allUnnamed.
-        ModuleHelper.AddModuleExportsToAllUnnamed(m2, "p2");
+        // Export package p2 in m2x to allUnnamed.
+        ModuleHelper.AddModuleExportsToAllUnnamed(m2x, "p2");
 
         // p1.c1's ctor tries to call a method in p2.c2.  This should succeed because
         // p1 is in an unnamed module and p2.c2 is exported to all unnamed modules.
diff --git a/hotspot/test/runtime/modules/AccessCheckExp.java b/hotspot/test/runtime/modules/AccessCheckExp.java
index fa624b0..18c0293 100644
--- a/hotspot/test/runtime/modules/AccessCheckExp.java
+++ b/hotspot/test/runtime/modules/AccessCheckExp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,54 +28,53 @@
  * @compile p2/c2.java
  * @compile p1/c1.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckExp
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 public class AccessCheckExp {
 
-    // Test that if module1 can read module2, but package p2 in module2 is not
-    // exported then class p1.c1 in module1 can not read p2.c2 in module2.
+    // Test that if module_one can read module_two, but package p2 in module_two is not
+    // exported then class p1.c1 in module_one can not read p2.c2 in module_two.
     public static void main(String args[]) throws Throwable {
-        Object m1, m2;
+        Object m1x, m2x;
 
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlObject_jlM = jlObject.getModule();
+        assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null");
 
         // Get the class loader for AccessCheckExp and assume it's also used to
         // load classes p1.c1 and p2.c2.
         ClassLoader this_cldr = AccessCheckExp.class.getClassLoader();
 
         // Define a module for p1.
-        m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" });
-        assertNotNull(m1, "Module should not be null");
-        ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" });
-        ModuleHelper.AddReadsModule(m1, jlObject_jlrM);
+        m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" });
+        assertNotNull(m1x, "Module should not be null");
+        ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" });
+        ModuleHelper.AddReadsModule(m1x, jlObject_jlM);
 
         // Define a module for p2.
-        m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
-        ModuleHelper.AddReadsModule(m2, jlObject_jlrM);
+        m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
+        ModuleHelper.AddReadsModule(m2x, jlObject_jlM);
 
-        // Make package p1 in m1 visible to everyone.
-        ModuleHelper.AddModuleExportsToAll(m1, "p1");
+        // Make package p1 in m1x visible to everyone.
+        ModuleHelper.AddModuleExportsToAll(m1x, "p1");
 
         // p1.c1's ctor tries to call a method in p2.c2, but p2.c2 is not
         // exported.  So should get IllegalAccessError.
-        ModuleHelper.AddReadsModule(m1, m2);
+        ModuleHelper.AddReadsModule(m1x, m2x);
 
         Class p1_c1_class = Class.forName("p1.c1");
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported");
         } catch (IllegalAccessError f) {
             System.out.println(f.getMessage());
             if (!f.getMessage().contains("does not export")) {
diff --git a/hotspot/test/runtime/modules/AccessCheckJavaBase.java b/hotspot/test/runtime/modules/AccessCheckJavaBase.java
index 24f2f77..0402f12 100644
--- a/hotspot/test/runtime/modules/AccessCheckJavaBase.java
+++ b/hotspot/test/runtime/modules/AccessCheckJavaBase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,27 +27,26 @@
  * @library /test/lib ..
  * @compile p2/c2.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckJavaBase
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 public class AccessCheckJavaBase {
 
-    // Test that a class defined to module2 always can read java.base.
+    // Test that a class defined to module_two always can read java.base.
     public static void main(String args[]) throws Throwable {
         // Get the class loader for AccessCheckJavaBase and assume it's also used to
         // load class p2.c2.
         ClassLoader this_cldr = AccessCheckJavaBase.class.getClassLoader();
 
         // Define a module for p2.
-        Object m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
+        Object m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
 
         // p2.c2 can read its superclass java.lang.Object defined within java.base
         try {
diff --git a/hotspot/test/runtime/modules/AccessCheckRead.java b/hotspot/test/runtime/modules/AccessCheckRead.java
index a36268a..c25c33a 100644
--- a/hotspot/test/runtime/modules/AccessCheckRead.java
+++ b/hotspot/test/runtime/modules/AccessCheckRead.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,45 +28,44 @@
  * @compile p2/c2.java
  * @compile p1/c1.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckRead
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 public class AccessCheckRead {
 
-    // Test that a class in a package in module1 cannot access a class in
-    // a package n module2 if module1 cannot read module2.
+    // Test that a class in a package in module_one cannot access a class in
+    // a package in module_two if module_one cannot read module_two.
     public static void main(String args[]) throws Throwable {
-        Object m1, m2;
+        Object m1x, m2x;
 
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlObject_jlM = jlObject.getModule();
+        assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null");
 
         // Get the class loader for AccessCheckRead and assume it's also used to
         // load classes p1.c1 and p2.c2.
         ClassLoader this_cldr = AccessCheckRead.class.getClassLoader();
 
         // Define a module for p1.
-        m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" });
-        assertNotNull(m1, "Module should not be null");
-        ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" });
-        ModuleHelper.AddReadsModule(m1, jlObject_jlrM);
+        m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" });
+        assertNotNull(m1x, "Module should not be null");
+        ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" });
+        ModuleHelper.AddReadsModule(m1x, jlObject_jlM);
 
         // Define a module for p2.
-        m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
-        ModuleHelper.AddReadsModule(m2, jlObject_jlrM);
+        m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
+        ModuleHelper.AddReadsModule(m2x, jlObject_jlM);
 
-        // Make package p1 in m1 visible to everyone.
-        ModuleHelper.AddModuleExportsToAll(m1, "p1");
+        // Make package p1 in m1x visible to everyone.
+        ModuleHelper.AddModuleExportsToAll(m1x, "p1");
 
         Class p1_c1_class = Class.forName("p1.c1");
 
@@ -74,7 +73,7 @@
         // cannot read p2's module.  So should get IllegalAccessError.
         try {
             p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (m1 can't read m2)");
+            throw new RuntimeException("Failed to get IAE (m1x can't read m2x)");
         } catch (IllegalAccessError e) {
             System.out.println(e.getMessage());
             if (!e.getMessage().contains("does not read") ||
diff --git a/hotspot/test/runtime/modules/AccessCheckSuper.java b/hotspot/test/runtime/modules/AccessCheckSuper.java
index 594c192..c227db2 100644
--- a/hotspot/test/runtime/modules/AccessCheckSuper.java
+++ b/hotspot/test/runtime/modules/AccessCheckSuper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,13 +28,12 @@
  * @compile p2/c2.java
  * @compile p3/c3.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckSuper
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 public class AccessCheckSuper {
@@ -48,17 +47,17 @@
         ClassLoader this_cldr = AccessCheckSuper.class.getClassLoader();
 
         // Define a module for p2.
-        Object m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
+        Object m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
 
         // Define a module for p3.
-        Object m3 = ModuleHelper.ModuleObject("module3", this_cldr, new String[] { "p3" });
-        assertNotNull(m3, "Module should not be null");
-        ModuleHelper.DefineModule(m3, "9.0", "m3/there", new String[] { "p3" });
+        Object m3x = ModuleHelper.ModuleObject("module_three", this_cldr, new String[] { "p3" });
+        assertNotNull(m3x, "Module should not be null");
+        ModuleHelper.DefineModule(m3x, "9.0", "m3x/there", new String[] { "p3" });
 
-        // Since a readability edge has not been established between module2
-        // and module3, p3.c3 cannot read its superclass p2.c2.
+        // Since a readability edge has not been established between module_two
+        // and module_three, p3.c3 cannot read its superclass p2.c2.
         try {
             Class p3_c3_class = Class.forName("p3.c3");
             throw new RuntimeException("Failed to get IAE (can't read superclass)");
diff --git a/hotspot/test/runtime/modules/AccessCheckUnnamed.java b/hotspot/test/runtime/modules/AccessCheckUnnamed.java
index 4a2ab3e..14b48b1 100644
--- a/hotspot/test/runtime/modules/AccessCheckUnnamed.java
+++ b/hotspot/test/runtime/modules/AccessCheckUnnamed.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,6 @@
  * questions.
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 /*
@@ -31,7 +30,7 @@
  * @compile p2/c2.java
  * @compile p1/c1.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckUnnamed
@@ -42,29 +41,29 @@
     // Test that a class in the unnamed module can not access a package in a
     // named module that has not been unqualifiedly exported.
     public static void main(String args[]) throws Throwable {
-        Object m1, m2;
+        Object m1x, m2x;
 
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlObject_jlM = jlObject.getModule();
+        assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null");
 
         // Get the class loader for AccessCheckWorks and assume it's also used to
         // load class p2.c2.
         ClassLoader this_cldr = AccessCheckUnnamed.class.getClassLoader();
 
         // Define a module for p2.
-        m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
-        ModuleHelper.AddReadsModule(m2, jlObject_jlrM);
+        m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
+        ModuleHelper.AddReadsModule(m2x, jlObject_jlM);
 
         // p1.c1's ctor tries to call a method in p2.c2.  This should fail because
         // p1 is in the unnamed module and p2.c2 is not unqualifiedly exported.
         Class p1_c1_class = Class.forName("p1.c1");
         try {
             Object c1_obj = p1_c1_class.newInstance();
-            throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported to unnamed module)");
+            throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported to unnamed module)");
         } catch (IllegalAccessError f) {
             System.out.println(f.getMessage());
             if (!f.getMessage().contains("does not export p2 to unnamed module")) {
diff --git a/hotspot/test/runtime/modules/AccessCheckWorks.java b/hotspot/test/runtime/modules/AccessCheckWorks.java
index 48d6660..9cb638a 100644
--- a/hotspot/test/runtime/modules/AccessCheckWorks.java
+++ b/hotspot/test/runtime/modules/AccessCheckWorks.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,51 +28,50 @@
  * @compile p2/c2.java
  * @compile p1/c1.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckWorks
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 public class AccessCheckWorks {
 
-    // Check that a class in a package in module1 can successfully access a
-    // class in module2 when module1 can read module2 and the class's package
+    // Check that a class in a package in module_one can successfully access a
+    // class in module_two when module_one can read module_two and the class's package
     // has been exported.
     public static void main(String args[]) throws Throwable {
-        Object m1, m2;
+        Object m1x, m2x;
 
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlObject_jlM = jlObject.getModule();
+        assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null");
 
         // Get the class loader for AccessCheckWorks and assume it's also used to
         // load classes p1.c1 and p2.c2.
         ClassLoader this_cldr = AccessCheckWorks.class.getClassLoader();
 
         // Define a module for p1.
-        m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" });
-        assertNotNull(m1, "Module should not be null");
-        ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" });
-        ModuleHelper.AddReadsModule(m1, jlObject_jlrM);
+        m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" });
+        assertNotNull(m1x, "Module should not be null");
+        ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" });
+        ModuleHelper.AddReadsModule(m1x, jlObject_jlM);
 
         // Define a module for p2.
-        m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
-        ModuleHelper.AddReadsModule(m2, jlObject_jlrM);
+        m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
+        ModuleHelper.AddReadsModule(m2x, jlObject_jlM);
 
-        // Make package p1 in m1 visible to everyone.
-        ModuleHelper.AddModuleExportsToAll(m1, "p1");
+        // Make package p1 in m1x visible to everyone.
+        ModuleHelper.AddModuleExportsToAll(m1x, "p1");
 
         // p1.c1's ctor tries to call a method in p2.c2.  This should work because
         // p1's module can read p2's module and p2 is exported to p1's module.
-        ModuleHelper.AddReadsModule(m1, m2);
-        ModuleHelper.AddModuleExports(m2, "p2", m1);
+        ModuleHelper.AddReadsModule(m1x, m2x);
+        ModuleHelper.AddModuleExports(m2x, "p2", m1x);
         Class p1_c1_class = Class.forName("p1.c1");
         p1_c1_class.newInstance();
     }
diff --git a/hotspot/test/runtime/modules/CCE_module_msg.java b/hotspot/test/runtime/modules/CCE_module_msg.java
index 38ff41f..7e593df 100644
--- a/hotspot/test/runtime/modules/CCE_module_msg.java
+++ b/hotspot/test/runtime/modules/CCE_module_msg.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,14 +28,13 @@
  * @compile p2/c2.java
  * @compile p4/c4.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI CCE_module_msg
  */
 
 import java.io.*;
-import java.lang.reflect.Module;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.nio.file.Path;
@@ -73,31 +72,31 @@
     }
 
     public static void invalidClassToString() throws Throwable {
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlObject_jlM = jlObject.getModule();
+        assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null");
 
         // Get the class loader for CCE_module_msg and assume it's also used to
         // load classes p1.c1 and p2.c2.
         ClassLoader this_cldr = CCE_module_msg.class.getClassLoader();
 
         // Define a module for p2.
-        Object m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
-        ModuleHelper.AddReadsModule(m2, jlObject_jlrM);
+        Object m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
+        ModuleHelper.AddReadsModule(m2x, jlObject_jlM);
 
         try {
-            ModuleHelper.AddModuleExportsToAll(m2, "p2");
+            ModuleHelper.AddModuleExportsToAll(m2x, "p2");
             Object p2Obj = new p2.c2();
             System.out.println((String)p2Obj);
             throw new RuntimeException("ClassCastException wasn't thrown, test failed.");
         } catch (ClassCastException cce) {
             String exception = cce.getMessage();
             System.out.println(exception);
-            if (exception.contains("module2/p2.c2") ||
-                !(exception.contains("module2@") &&
+            if (exception.contains("module_two/p2.c2") ||
+                !(exception.contains("module_two@") &&
                   exception.contains("/p2.c2 cannot be cast to java.base/java.lang.String"))) {
                 throw new RuntimeException("Wrong message: " + exception);
             }
@@ -105,10 +104,10 @@
     }
 
     public static void invalidClassToStringCustomLoader() throws Throwable {
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlObject_jlM = jlObject.getModule();
+        assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null");
 
         // Create a customer class loader to load class p4/c4.
         URL[] urls = new URL[] { CLASSES_DIR.toUri().toURL() };
diff --git a/hotspot/test/runtime/modules/ExportTwice.java b/hotspot/test/runtime/modules/ExportTwice.java
index 538c659..abdad3a 100644
--- a/hotspot/test/runtime/modules/ExportTwice.java
+++ b/hotspot/test/runtime/modules/ExportTwice.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,13 +28,12 @@
  * @compile p2/c2.java
  * @compile p1/c1.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ExportTwice
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 public class ExportTwice {
@@ -44,49 +43,49 @@
     // Also, check that a package can be exported to a specific package and then
     // exported unqualifiedly.
     public static void main(String args[]) throws Throwable {
-        Object m1, m2, m3;
+        Object m1x, m2x, m3x;
 
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlObject_jlM = jlObject.getModule();
+        assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null");
 
         // Get the class loader for ExportTwice and assume it's also used to
         // load classes p1.c1 and p2.c2.
         ClassLoader this_cldr = ExportTwice.class.getClassLoader();
 
         // Define a module for p1.
-        m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" });
-        assertNotNull(m1, "Module should not be null");
-        ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" });
-        ModuleHelper.AddReadsModule(m1, jlObject_jlrM);
+        m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" });
+        assertNotNull(m1x, "Module should not be null");
+        ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" });
+        ModuleHelper.AddReadsModule(m1x, jlObject_jlM);
 
         // Define a module for p2.
-        m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
-        ModuleHelper.AddReadsModule(m2, jlObject_jlrM);
+        m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
+        ModuleHelper.AddReadsModule(m2x, jlObject_jlM);
 
         // Define a module for p3.
-        m3 = ModuleHelper.ModuleObject("module3", this_cldr, new String[] { "p3" });
-        assertNotNull(m3, "Module should not be null");
-        ModuleHelper.DefineModule(m3, "9.0", "m3/there", new String[] { "p3" });
-        ModuleHelper.AddReadsModule(m3, jlObject_jlrM);
+        m3x = ModuleHelper.ModuleObject("module_three", this_cldr, new String[] { "p3" });
+        assertNotNull(m3x, "Module should not be null");
+        ModuleHelper.DefineModule(m3x, "9.0", "m3x/there", new String[] { "p3" });
+        ModuleHelper.AddReadsModule(m3x, jlObject_jlM);
 
-        // Make package p1 in m1 visible to everyone.
-        ModuleHelper.AddModuleExportsToAll(m1, "p1");
+        // Make package p1 in m1x visible to everyone.
+        ModuleHelper.AddModuleExportsToAll(m1x, "p1");
 
-        // Try to export p1 only to m2 after it was exported unqualifiedly.  It
+        // Try to export p1 only to m2x after it was exported unqualifiedly.  It
         // should silently succeed.
-        ModuleHelper.AddModuleExports(m1, "p1", m2);
+        ModuleHelper.AddModuleExports(m1x, "p1", m2x);
 
-        // Export p2 to m3 then export it again unqualifiedly.
-        ModuleHelper.AddModuleExports(m2, "p2", m3);
-        ModuleHelper.AddModuleExportsToAll(m2, "p2");
+        // Export p2 to m3x then export it again unqualifiedly.
+        ModuleHelper.AddModuleExports(m2x, "p2", m3x);
+        ModuleHelper.AddModuleExportsToAll(m2x, "p2");
 
         // p1.c1's ctor tries to call a method in p2.c2.  This should work because
         // p1's module can read p2's module and p2 is now exported unqualifiedly.
-        ModuleHelper.AddReadsModule(m1, m2);
+        ModuleHelper.AddReadsModule(m1x, m2x);
         Class p1_c1_class = Class.forName("p1.c1");
         p1_c1_class.newInstance();
     }
diff --git a/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java b/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java
index e374853..0d7b2f6 100644
--- a/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java
+++ b/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
             "-D" + prop + "=" + value, "-version");
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
-        output.shouldContain("java version ");
+        output.shouldContain(" version ");
         output.shouldHaveExitValue(0);
 
         // Ensure that the property and its value aren't available.
@@ -67,8 +67,8 @@
     }
 
     public static void main(String[] args) throws Exception {
-        testOption("--add-modules", "java.sqlx", "jdk.module.addmods.0", "java.lang.module.ResolutionException");
-        testOption("--limit-modules", "java.sqlx", "jdk.module.limitmods", "java.lang.module.ResolutionException");
+        testOption("--add-modules", "java.sqlx", "jdk.module.addmods.0", "java.lang.module.FindException");
+        testOption("--limit-modules", "java.sqlx", "jdk.module.limitmods", "java.lang.module.FindException");
         testOption("--add-reads", "xyzz=yyzd", "jdk.module.addreads.0", "WARNING: Unknown module: xyzz");
         testOption("--add-exports", "java.base/xyzz=yyzd", "jdk.module.addexports.0",
                    "WARNING: package xyzz not in java.base");
diff --git a/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java b/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java
index 7a08787..71fba98 100644
--- a/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java
+++ b/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,37 +30,36 @@
  * @build sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddModuleExportToAllUnnamed
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 public class JVMAddModuleExportToAllUnnamed {
 
-    // Check that a class in a package in module1 cannot access a class
+    // Check that a class in a package in module_one cannot access a class
     // that is in the unnamed module if the accessing package is strict.
     public static void main(String args[]) throws Throwable {
-        Object m1;
+        Object m1x;
 
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlObject_jlM = jlObject.getModule();
+        assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null");
 
         // Get the class loader for JVMAddModuleExportToAllUnnamed and assume it's also used to
         // load class p1.c1.
         ClassLoader this_cldr = JVMAddModuleExportToAllUnnamed.class.getClassLoader();
 
         // Define a module for p1.
-        m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" });
-        assertNotNull(m1, "Module should not be null");
-        ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" });
-        ModuleHelper.AddReadsModule(m1, jlObject_jlrM);
+        m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" });
+        assertNotNull(m1x, "Module should not be null");
+        ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" });
+        ModuleHelper.AddReadsModule(m1x, jlObject_jlM);
 
-        // Make package p1 in m1 visible to everyone.
-        ModuleHelper.AddModuleExportsToAll(m1, "p1");
+        // Make package p1 in m1x visible to everyone.
+        ModuleHelper.AddModuleExportsToAll(m1x, "p1");
 
         // p1.c1's ctor tries to call a method in p2.c2.  This should not work
         // because p2 is in the unnamed module and p1.c1 is strict.
diff --git a/hotspot/test/runtime/modules/JVMAddModuleExports.java b/hotspot/test/runtime/modules/JVMAddModuleExports.java
index 6895236..01d441c 100644
--- a/hotspot/test/runtime/modules/JVMAddModuleExports.java
+++ b/hotspot/test/runtime/modules/JVMAddModuleExports.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,13 +26,12 @@
  * @modules java.base/jdk.internal.misc
  * @library /test/lib ..
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddModuleExports
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 public class JVMAddModuleExports {
diff --git a/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java b/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java
index 80db658..f649964 100644
--- a/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java
+++ b/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,6 @@
  * questions.
  */
 
-import java.lang.reflect.Module;
 import static jdk.test.lib.Asserts.*;
 
 /*
@@ -31,7 +30,7 @@
  * @compile p2/c2.java
  * @compile p1/c1.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddModuleExportsToAll
@@ -43,28 +42,28 @@
     // and then test that a class in the unnamed module can access a package in
     // a named module that has been exported unqualifiedly.
     public static void main(String args[]) throws Throwable {
-        Object m1, m2, m3;
+        Object m1x, m2x, m3x;
 
-        // Get the java.lang.reflect.Module object for module java.base.
+        // Get the java.lang.Module object for module java.base.
         Class jlObject = Class.forName("java.lang.Object");
-        Object jlObject_jlrM = jlObject.getModule();
-        assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null");
+        Object jlObject_jlM = jlObject.getModule();
+        assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null");
 
         // Get the class loader for JVMAddModuleExportsToAll and assume it's also used to
         // load class p2.c2.
         ClassLoader this_cldr = JVMAddModuleExportsToAll.class.getClassLoader();
 
         // Define a module for p3.
-        m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p3" });
-        assertNotNull(m1, "Module should not be null");
-        ModuleHelper.DefineModule(m1, "9.0", "m1/there", new String[] { "p3" });
-        ModuleHelper.AddReadsModule(m1, jlObject_jlrM);
+        m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p3" });
+        assertNotNull(m1x, "Module should not be null");
+        ModuleHelper.DefineModule(m1x, "9.0", "m1x/there", new String[] { "p3" });
+        ModuleHelper.AddReadsModule(m1x, jlObject_jlM);
 
         // Define a module for p2.
-        m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" });
-        assertNotNull(m2, "Module should not be null");
-        ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" });
-        ModuleHelper.AddReadsModule(m2, jlObject_jlrM);
+        m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" });
+        assertNotNull(m2x, "Module should not be null");
+        ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" });
+        ModuleHelper.AddReadsModule(m2x, jlObject_jlM);
 
         try {
             ModuleHelper.AddModuleExportsToAll((Module)null, "p2");
@@ -74,13 +73,13 @@
         }
 
         try {
-            ModuleHelper.AddModuleExportsToAll(m2, null);
+            ModuleHelper.AddModuleExportsToAll(m2x, null);
             throw new RuntimeException("Failed to get the expected NPE for null package");
         } catch(NullPointerException e) {
             // Expected
         }
 
-        try { // Expect IAE when passing a ClassLoader object instead of a java.lang.reflect.Module object.
+        try { // Expect IAE when passing a ClassLoader object instead of a java.lang.Module object.
             ModuleHelper.AddModuleExportsToAll(this_cldr, "p2");
             throw new RuntimeException("Failed to get the expected IAE for bad module");
         } catch(IllegalArgumentException e) {
@@ -88,26 +87,26 @@
         }
 
         try {
-            ModuleHelper.AddModuleExportsToAll(m2, "p3");
+            ModuleHelper.AddModuleExportsToAll(m2x, "p3");
             throw new RuntimeException("Failed to get the expected IAE for package that is in another module");
         } catch(IllegalArgumentException e) {
             // Expected
         }
 
         try {
-            ModuleHelper.AddModuleExportsToAll(m2, "p4");
+            ModuleHelper.AddModuleExportsToAll(m2x, "p4");
             throw new RuntimeException("Failed to get the expected IAE for package not in any module");
         } catch(IllegalArgumentException e) {
             // Expected
         }
 
-        // Export package p2 in m2 unqualifiedly. Then, do a qualified export
-        // of p2 in m2 to m3.  This should not affect the unqualified export.
-        m3 = ModuleHelper.ModuleObject("module3", this_cldr, new String[] { "p4" });
-        assertNotNull(m3, "Module m3 should not be null");
-        ModuleHelper.DefineModule(m3, "9.0", "m3/there", new String[] { "p4" });
-        ModuleHelper.AddModuleExportsToAll(m2, "p2");
-        ModuleHelper.AddModuleExports(m2, "p2", m3);
+        // Export package p2 in m2x unqualifiedly. Then, do a qualified export
+        // of p2 in m2x to m3x.  This should not affect the unqualified export.
+        m3x = ModuleHelper.ModuleObject("module_three", this_cldr, new String[] { "p4" });
+        assertNotNull(m3x, "Module m3x should not be null");
+        ModuleHelper.DefineModule(m3x, "9.0", "m3x/there", new String[] { "p4" });
+        ModuleHelper.AddModuleExportsToAll(m2x, "p2");
+        ModuleHelper.AddModuleExports(m2x, "p2", m3x);
 
         // p1.c1's ctor tries to call a method in p2.c2.  This should succeed because
         // p1 is in an unnamed module and p2.c2 is exported unqualifiedly.
diff --git a/hotspot/test/runtime/modules/JVMAddModulePackage.java b/hotspot/test/runtime/modules/JVMAddModulePackage.java
index 3f7f2fd..eb2e3258 100644
--- a/hotspot/test/runtime/modules/JVMAddModulePackage.java
+++ b/hotspot/test/runtime/modules/JVMAddModulePackage.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @modules java.base/jdk.internal.misc
  * @library /test/lib ..
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddModulePackage
@@ -40,25 +40,25 @@
     public static void main(String args[]) throws Throwable {
         MyClassLoader cl1 = new MyClassLoader();
         MyClassLoader cl3 = new MyClassLoader();
-        Object module1, module2, module3;
+        Object module_one, module_two, module_three;
         boolean result;
 
-        module1 = ModuleHelper.ModuleObject("module1", cl1, new String[] { "mypackage" });
-        assertNotNull(module1, "Module should not be null");
-        ModuleHelper.DefineModule(module1, "9.0", "module1/here", new String[] { "mypackage" });
-        module2 = ModuleHelper.ModuleObject("module2", cl1, new String[] { "yourpackage" });
-        assertNotNull(module2, "Module should not be null");
-        ModuleHelper.DefineModule(module2, "9.0", "module2/here", new String[] { "yourpackage" });
-        module3 = ModuleHelper.ModuleObject("module3", cl3, new String[] { "package/num3" });
-        assertNotNull(module3, "Module should not be null");
-        ModuleHelper.DefineModule(module3, "9.0", "module3/here", new String[] { "package/num3" });
+        module_one = ModuleHelper.ModuleObject("module_one", cl1, new String[] { "mypackage" });
+        assertNotNull(module_one, "Module should not be null");
+        ModuleHelper.DefineModule(module_one, "9.0", "module_one/here", new String[] { "mypackage" });
+        module_two = ModuleHelper.ModuleObject("module_two", cl1, new String[] { "yourpackage" });
+        assertNotNull(module_two, "Module should not be null");
+        ModuleHelper.DefineModule(module_two, "9.0", "module_two/here", new String[] { "yourpackage" });
+        module_three = ModuleHelper.ModuleObject("module_three", cl3, new String[] { "package/num3" });
+        assertNotNull(module_three, "Module should not be null");
+        ModuleHelper.DefineModule(module_three, "9.0", "module_three/here", new String[] { "package/num3" });
 
         // Simple call
-        ModuleHelper.AddModulePackage(module1, "new_package");
+        ModuleHelper.AddModulePackage(module_one, "new_package");
 
         // Add a package and export it
-        ModuleHelper.AddModulePackage(module1, "package/num3");
-        ModuleHelper.AddModuleExportsToAll(module1, "package/num3");
+        ModuleHelper.AddModulePackage(module_one, "package/num3");
+        ModuleHelper.AddModuleExportsToAll(module_one, "package/num3");
 
         // Null module argument, expect an NPE
         try {
@@ -78,7 +78,7 @@
 
         // Null package argument, expect an NPE
         try {
-            ModuleHelper.AddModulePackage(module1, null);
+            ModuleHelper.AddModulePackage(module_one, null);
             throw new RuntimeException("Failed to get the expected NPE");
         } catch(NullPointerException e) {
             // Expected
@@ -86,7 +86,7 @@
 
         // Existing package, expect an ISE
         try {
-            ModuleHelper.AddModulePackage(module1, "yourpackage");
+            ModuleHelper.AddModulePackage(module_one, "yourpackage");
             throw new RuntimeException("Failed to get the expected ISE");
         } catch(IllegalStateException e) {
             // Expected
@@ -94,7 +94,7 @@
 
         // Invalid package name, expect an IAE
         try {
-            ModuleHelper.AddModulePackage(module1, "your.package");
+            ModuleHelper.AddModulePackage(module_one, "your.package");
             throw new RuntimeException("Failed to get the expected IAE");
         } catch(IllegalArgumentException e) {
             // Expected
@@ -102,7 +102,7 @@
 
         // Invalid package name, expect an IAE
         try {
-            ModuleHelper.AddModulePackage(module1, ";your/package");
+            ModuleHelper.AddModulePackage(module_one, ";your/package");
             throw new RuntimeException("Failed to get the expected IAE");
         } catch(IllegalArgumentException e) {
             // Expected
@@ -110,7 +110,7 @@
 
         // Invalid package name, expect an IAE
         try {
-            ModuleHelper.AddModulePackage(module1, "7[743");
+            ModuleHelper.AddModulePackage(module_one, "7[743");
             throw new RuntimeException("Failed to get the expected IAE");
         } catch(IllegalArgumentException e) {
             // Expected
@@ -118,7 +118,7 @@
 
         // Empty package name, expect an IAE
         try {
-            ModuleHelper.AddModulePackage(module1, "");
+            ModuleHelper.AddModulePackage(module_one, "");
             throw new RuntimeException("Failed to get the expected IAE");
         } catch(IllegalArgumentException e) {
             // Expected
@@ -126,8 +126,8 @@
 
         // Add package named "java" to an module defined to a class loader other than the boot or platform loader.
         try {
-            // module1 is defined to a MyClassLoader class loader.
-            ModuleHelper.AddModulePackage(module1, "java/foo");
+            // module_one is defined to a MyClassLoader class loader.
+            ModuleHelper.AddModulePackage(module_one, "java/foo");
             throw new RuntimeException("Failed to get the expected IAE");
         } catch(IllegalArgumentException e) {
             if (!e.getMessage().contains("prohibited package name")) {
@@ -136,10 +136,10 @@
         }
 
         // Package "javabar" should be ok
-        ModuleHelper.AddModulePackage(module1, "javabar");
+        ModuleHelper.AddModulePackage(module_one, "javabar");
 
         // Package named "java" defined to the boot class loader, should be ok
-        Object module_javabase = module1.getClass().getModule();
+        Object module_javabase = module_one.getClass().getModule();
         ModuleHelper.AddModulePackage(module_javabase, "java/foo");
 
         // Package named "java" defined to the platform class loader, should be ok
diff --git a/hotspot/test/runtime/modules/JVMAddReadsModule.java b/hotspot/test/runtime/modules/JVMAddReadsModule.java
index a25bcfc..bf0b838 100644
--- a/hotspot/test/runtime/modules/JVMAddReadsModule.java
+++ b/hotspot/test/runtime/modules/JVMAddReadsModule.java
@@ -26,7 +26,7 @@
  * @modules java.base/jdk.internal.misc
  * @library /test/lib ..
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddReadsModule
diff --git a/hotspot/test/runtime/modules/JVMDefineModule.java b/hotspot/test/runtime/modules/JVMDefineModule.java
index 9e44878..e3e263b 100644
--- a/hotspot/test/runtime/modules/JVMDefineModule.java
+++ b/hotspot/test/runtime/modules/JVMDefineModule.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @modules java.base/jdk.internal.misc
  * @library /test/lib ..
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMDefineModule
@@ -49,7 +49,7 @@
 /* Invalid test, won't compile.
         // Invalid classloader argument, expect an IAE
         try {
-            m = ModuleHelper.ModuleObject("mymodule1", new Object(), new String[] { "mypackage1" });
+            m = ModuleHelper.ModuleObject("mymodule_one", new Object(), new String[] { "mypackage1" });
             ModuleHelper.DefineModule(m,  "9.0", "mymodule/here", new String[] { "mypackage1" });
             throw new RuntimeException("Failed to get expected IAE for bad loader");
         } catch(IllegalArgumentException e) {
@@ -78,7 +78,7 @@
             ModuleHelper.DefineModule(new Object(),  "9.0", "mymodule/here", new String[] { "mypackage1" });
             throw new RuntimeException("Failed to get expected IAE or NPE for bad module");
         } catch(IllegalArgumentException e) {
-            if (!e.getMessage().contains("module is not an instance of type java.lang.reflect.Module")) {
+            if (!e.getMessage().contains("module is not an instance of type java.lang.Module")) {
               throw new RuntimeException("Failed to get expected IAE message for bad module: " + e.getMessage());
             }
         }
diff --git a/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java b/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java
index 1f58193..da32248 100644
--- a/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java
+++ b/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
  * @library /test/lib ..
  * @compile p2/c2.java
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMGetModuleByPkgName
@@ -35,7 +35,6 @@
 
 import static jdk.test.lib.Asserts.*;
 import java.lang.ClassLoader;
-import java.lang.reflect.Module;
 
 public class JVMGetModuleByPkgName {
 
@@ -79,10 +78,10 @@
         }
 
         MyClassLoader cl1 = new MyClassLoader();
-        Module module1 = (Module)ModuleHelper.ModuleObject("module1", cl1, new String[] { "mypackage" });
-        assertNotNull(module1, "Module should not be null");
-        ModuleHelper.DefineModule(module1, "9.0", "module1/here", new String[] { "mypackage" });
-        if (ModuleHelper.GetModuleByPackageName(cl1, "mypackage") != module1) {
+        Module module_one = (Module)ModuleHelper.ModuleObject("module_one", cl1, new String[] { "mypackage" });
+        assertNotNull(module_one, "Module should not be null");
+        ModuleHelper.DefineModule(module_one, "9.0", "module_one/here", new String[] { "mypackage" });
+        if (ModuleHelper.GetModuleByPackageName(cl1, "mypackage") != module_one) {
             throw new RuntimeException("Wrong module returned for cl1 mypackage");
         }
     }
diff --git a/hotspot/test/runtime/modules/LoadUnloadModuleStress.java b/hotspot/test/runtime/modules/LoadUnloadModuleStress.java
index 1f27ba9..20cde3a 100644
--- a/hotspot/test/runtime/modules/LoadUnloadModuleStress.java
+++ b/hotspot/test/runtime/modules/LoadUnloadModuleStress.java
@@ -27,7 +27,7 @@
  * @modules java.base/jdk.internal.misc
  * @library /test/lib ..
  * @build sun.hotspot.WhiteBox
- * @compile/module=java.base java/lang/reflect/ModuleHelper.java
+ * @compile/module=java.base java/lang/ModuleHelper.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx64m -Xmx64m LoadUnloadModuleStress 15000
diff --git a/hotspot/test/runtime/modules/ModuleHelper.java b/hotspot/test/runtime/modules/ModuleHelper.java
index 2f0d7f6..e4db0f5 100644
--- a/hotspot/test/runtime/modules/ModuleHelper.java
+++ b/hotspot/test/runtime/modules/ModuleHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
 
 import java.net.URI;
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Module;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
@@ -41,19 +40,19 @@
     public static void AddModuleExports(Object from, String pkg, Object to) throws Throwable {
         WhiteBox wb = WhiteBox.getWhiteBox();
         wb.AddModuleExports(from, pkg, to);
-        java.lang.reflect.ModuleHelper.addExportsNoSync((Module)from, pkg, (Module)to);
+        java.lang.ModuleHelper.addExportsNoSync((Module)from, pkg, (Module)to);
     }
 
     public static void AddReadsModule(Object from, Object to) throws Throwable {
         WhiteBox wb = WhiteBox.getWhiteBox();
         wb.AddReadsModule(from, to);
-        java.lang.reflect.ModuleHelper.addReadsNoSync((Module)from, (Module)to);
+        java.lang.ModuleHelper.addReadsNoSync((Module)from, (Module)to);
     }
 
     public static void AddModulePackage(Object m, String pkg) throws Throwable {
         WhiteBox wb = WhiteBox.getWhiteBox();
         wb.AddModulePackage(m, pkg);
-        java.lang.reflect.ModuleHelper.addPackageNoSync((Module)m, pkg);
+        java.lang.ModuleHelper.addPackageNoSync((Module)m, pkg);
     }
 
     public static Module GetModuleByPackageName(Object ldr, String pkg) throws Throwable {
@@ -64,13 +63,13 @@
     public static void AddModuleExportsToAllUnnamed(Object m, String pkg) throws Throwable {
         WhiteBox wb = WhiteBox.getWhiteBox();
         wb.AddModuleExportsToAllUnnamed(m, pkg);
-        //java.lang.reflect.ModuleHelper.addExportsToAllUnnamedNoSync((Module)m, pkg);
+        //java.lang.ModuleHelper.addExportsToAllUnnamedNoSync((Module)m, pkg);
     }
 
     public static void AddModuleExportsToAll(Object m, String pkg) throws Throwable {
         WhiteBox wb = WhiteBox.getWhiteBox();
         wb.AddModuleExportsToAll(m, pkg);
-        java.lang.reflect.ModuleHelper.addExportsNoSync((Module)m, pkg, (Module)null);
+        java.lang.ModuleHelper.addExportsNoSync((Module)m, pkg, (Module)null);
     }
 
     public static Module ModuleObject(String name, ClassLoader loader, String[] pkgs) throws Throwable {
@@ -84,10 +83,10 @@
         }
 
         ModuleDescriptor descriptor =
-            ModuleDescriptor.module(name).contains(pkg_set).build();
+            ModuleDescriptor.newModule(name).packages(pkg_set).build();
         URI uri = URI.create("module:/" + name);
 
-        return java.lang.reflect.ModuleHelper.newModule(loader, descriptor);
+        return java.lang.ModuleHelper.newModule(loader, descriptor);
     }
 
 }
diff --git a/hotspot/test/runtime/modules/ModuleOptionsTest.java b/hotspot/test/runtime/modules/ModuleOptionsTest.java
index 28064bd..e526e06 100644
--- a/hotspot/test/runtime/modules/ModuleOptionsTest.java
+++ b/hotspot/test/runtime/modules/ModuleOptionsTest.java
@@ -43,7 +43,7 @@
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
             "--add-modules=i_dont_exist", "--add-modules=java.base", "-version");
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
-        output.shouldContain("ResolutionException");
+        output.shouldContain("FindException");
         output.shouldContain("i_dont_exist");
         output.shouldHaveExitValue(1);
 
diff --git a/hotspot/test/runtime/modules/ModuleStress/CustomSystemClassLoader.java b/hotspot/test/runtime/modules/ModuleStress/CustomSystemClassLoader.java
index dca359f..643e4bf 100644
--- a/hotspot/test/runtime/modules/ModuleStress/CustomSystemClassLoader.java
+++ b/hotspot/test/runtime/modules/ModuleStress/CustomSystemClassLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 
 /**
- * A custom system ClassLoader to define the module "m2" to during iterations of
+ * A custom system ClassLoader to define the module "m2x" to during iterations of
  * differing test runs within the test ModuleStress.java
  */
 public class CustomSystemClassLoader extends ClassLoader {
diff --git a/hotspot/test/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java b/hotspot/test/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java
index 79e56f2..772293f 100644
--- a/hotspot/test/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java
+++ b/hotspot/test/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -35,79 +34,79 @@
 import java.util.Set;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-// ClassLoader2 --> defines m2 --> packages p2
-// Java System Class Loader --> defines m3 --> packages p3
+// ClassLoader1 --> defines m1x --> packages p1
+// ClassLoader2 --> defines m2x --> packages p2
+// Java System Class Loader --> defines m3x --> packages p3
 //
-// m1 can read m2
-// package p2 in m2 is exported to m1 and m3
+// m1x can read m2x
+// package p2 in m2x is exported to m1x and m3x
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
-// Access allowed since m1 can read m2 and package p2 is exported to m1.
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
+// Access allowed since m1x can read m2x and package p2 is exported to m1x.
 //
 public class ModuleNonBuiltinCLMain {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          p1
         // Packages exported: p1 is exported to unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
-        // Can read:          java.base, m3
+        // Define module:     m2x
+        // Can read:          java.base, m3x
         // Packages:          p2
-        // Packages exported: package p2 is exported to m1 and m3
+        // Packages exported: package p2 is exported to m1x and m3x
         Set<String> targets = new HashSet<>();
-        targets.add("m1");
-        targets.add("m3");
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        targets.add("m1x");
+        targets.add("m3x");
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .requires("m3")
+                        .requires("m3x")
                         .exports("p2", targets)
                         .build();
 
-        // Define module:     m3
+        // Define module:     m3x
         // Can read:          java.base
         // Packages:          p3
         // Packages exported: none
-        ModuleDescriptor descriptor_m3 =
-                ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor_m3x =
+                ModuleDescriptor.newModule("m3x")
                         .requires("java.base")
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to differing user defined class loaders for this test
         Map<String, ClassLoader> map = new HashMap<>();
         Loader1 cl1 = new Loader1();
         Loader2 cl2 = new Loader2();
         ClassLoader cl3 = ClassLoader.getSystemClassLoader();
-        map.put("m1", cl1);
-        map.put("m2", cl2);
-        map.put("m3", cl3);
+        map.put("m1x", cl1);
+        map.put("m2x", cl2);
+        map.put("m3x", cl3);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
-        assertTrue(layer.findLoader("m1") == cl1);
-        assertTrue(layer.findLoader("m2") == cl2);
-        assertTrue(layer.findLoader("m3") == cl3);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
+        assertTrue(layer.findLoader("m1x") == cl1);
+        assertTrue(layer.findLoader("m2x") == cl2);
+        assertTrue(layer.findLoader("m3x") == cl3);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
@@ -115,7 +114,7 @@
         try {
             p1_c1_class.newInstance();
         } catch (IllegalAccessError e) {
-            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1");
+            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x");
         }
     }
 
diff --git a/hotspot/test/runtime/modules/ModuleStress/ModuleSameCLMain.java b/hotspot/test/runtime/modules/ModuleStress/ModuleSameCLMain.java
index cdbc900..1eab830 100644
--- a/hotspot/test/runtime/modules/ModuleStress/ModuleSameCLMain.java
+++ b/hotspot/test/runtime/modules/ModuleStress/ModuleSameCLMain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 
 import static jdk.test.lib.Asserts.*;
 
-import java.lang.reflect.Layer;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -34,61 +33,61 @@
 import java.util.Set;
 
 //
-// ClassLoader1 --> defines m1 --> packages p1
-// ClassLoader1 --> defines m2 --> packages p2
+// ClassLoader1 --> defines m1x --> packages p1
+// ClassLoader1 --> defines m2x --> packages p2
 //
-// m1 can read m2
-// package p2 in m2 is exported to m1
+// m1x can read m2x
+// package p2 in m2x is exported to m1x
 //
-// class p1.c1 defined in m1 tries to access p2.c2 defined in m2
-// Access allowed since m1 can read m2 and package p2 is exported to m1.
+// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x
+// Access allowed since m1x can read m2x and package p2 is exported to m1x.
 //
 public class ModuleSameCLMain {
 
-    // Create a Layer over the boot layer.
+    // Create a layer over the boot layer.
     // Define modules within this layer to test access between
     // publically defined classes within packages of those modules.
     public void createLayerOnBoot() throws Throwable {
 
-        // Define module:     m1
-        // Can read:          java.base, m2
+        // Define module:     m1x
+        // Can read:          java.base, m2x
         // Packages:          p1
         // Packages exported: p1 is exported to unqualifiedly
-        ModuleDescriptor descriptor_m1 =
-                ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor_m1x =
+                ModuleDescriptor.newModule("m1x")
                         .requires("java.base")
-                        .requires("m2")
+                        .requires("m2x")
                         .exports("p1")
                         .build();
 
-        // Define module:     m2
+        // Define module:     m2x
         // Can read:          java.base
         // Packages:          p2
-        // Packages exported: package p2 is exported to m1
-        ModuleDescriptor descriptor_m2 =
-                ModuleDescriptor.module("m2")
+        // Packages exported: package p2 is exported to m1x
+        ModuleDescriptor descriptor_m2x =
+                ModuleDescriptor.newModule("m2x")
                         .requires("java.base")
-                        .exports("p2", Set.of("m1"))
+                        .exports("p2", Set.of("m1x"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
-        ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2);
+        ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x);
 
-        // Resolves "m1"
-        Configuration cf = Layer.boot()
+        // Resolves "m1x"
+        Configuration cf = ModuleLayer.boot()
                 .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
+                .resolve(finder, ModuleFinder.of(), Set.of("m1x"));
 
         // map each module to the same class loader for this test
         Map<String, ClassLoader> map = new HashMap<>();
         Loader1 cl1 = new Loader1();
-        map.put("m1", cl1);
-        map.put("m2", cl1);
+        map.put("m1x", cl1);
+        map.put("m2x", cl1);
 
-        // Create Layer that contains m1 & m2
-        Layer layer = Layer.boot().defineModules(cf, map::get);
-        assertTrue(layer.findLoader("m1") == cl1);
-        assertTrue(layer.findLoader("m2") == cl1);
+        // Create layer that contains m1x & m2x
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get);
+        assertTrue(layer.findLoader("m1x") == cl1);
+        assertTrue(layer.findLoader("m2x") == cl1);
         assertTrue(layer.findLoader("java.base") == null);
 
         // now use the same loader to load class p1.c1
@@ -96,7 +95,7 @@
         try {
             p1_c1_class.newInstance();
         } catch (IllegalAccessError e) {
-            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1");
+            throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x");
         }
     }
 
diff --git a/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java b/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java
index 2da921d..83f706d 100644
--- a/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java
+++ b/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@
              InMemoryJavaCompiler.compile("p1.c1", source1), System.getProperty("test.classes"));
 
         // Test #2: Load two modules defined to the same customer class loader.
-        //   m1's module readability list and package p2's exportability should
+        //   m1x's module readability list and package p2's exportability should
         //   not be walked at a GC safepoint since both modules are defined to
         //   the same loader and thus have the exact same life cycle.
         pb = ProcessTools.createJavaProcessBuilder(
@@ -97,7 +97,7 @@
           .shouldHaveExitValue(0);
 
         // Test #3: Load two modules in differing custom class loaders.
-        //   m1's module readability list and package p2's exportability list must
+        //   m1x's module readability list and package p2's exportability list must
         //   be walked at a GC safepoint since both modules are defined to non-builtin
         //   class loaders which could die and thus be unloaded.
         pb = ProcessTools.createJavaProcessBuilder(
@@ -106,15 +106,15 @@
              "ModuleNonBuiltinCLMain");
 
         oa = new OutputAnalyzer(pb.start());
-        oa.shouldContain("module m1 reads list must be walked")
-          .shouldContain("package p2 defined in module m2, exports list must be walked")
-          .shouldNotContain("module m2 reads list must be walked")
+        oa.shouldContain("module m1x reads list must be walked")
+          .shouldContain("package p2 defined in module m2x, exports list must be walked")
+          .shouldNotContain("module m2x reads list must be walked")
           .shouldHaveExitValue(0);
 
         // Test #4: Load two modules in differing custom class loaders,
         //   of which one has been designated as the custom system class loader
         //   via -Djava.system.class.loader=CustomSystemClassLoader. Since
-        //   m3 is defined to the system class loader, m2's module readability
+        //   m3x is defined to the system class loader, m2x's module readability
         //   list does not have to be walked at a GC safepoint, but package p2's
         //   exportability list does.
         pb = ProcessTools.createJavaProcessBuilder(
@@ -124,8 +124,8 @@
              "ModuleNonBuiltinCLMain");
 
         oa = new OutputAnalyzer(pb.start());
-        oa.shouldContain("package p2 defined in module m2, exports list must be walked")
-          .shouldNotContain("module m2 reads list must be walked")
+        oa.shouldContain("package p2 defined in module m2x, exports list must be walked")
+          .shouldNotContain("module m2x reads list must be walked")
           .shouldHaveExitValue(0);
 
     }
diff --git a/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/Main.java b/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/Main.java
index 16e8dbc..3c6c847 100644
--- a/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/Main.java
+++ b/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/Main.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,7 @@
 
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.*;
@@ -44,11 +42,11 @@
     public static void main(String[] args) throws Exception {
 
         ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        Layer layerBoot = Layer.boot();
+        ModuleLayer layerBoot = ModuleLayer.boot();
 
         Configuration cf = layerBoot
                 .configuration()
-                .resolveRequires(ModuleFinder.of(), finder, Set.of(MODULE_NAME));
+                .resolve(ModuleFinder.of(), finder, Set.of(MODULE_NAME));
 
         Module testModule = Main.class.getModule();
         ClassLoader scl = ClassLoader.getSystemClassLoader();
@@ -58,7 +56,7 @@
         Callable<Void> task = new Callable<Void>() {
             @Override
             public Void call() throws Exception {
-                Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
+                ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
                 Module transletModule = layer.findModule(MODULE_NAME).get();
                 testModule.addExports("test", transletModule);
                 Class<?> c = layer.findLoader(MODULE_NAME).loadClass("translet.Main");
diff --git a/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/MainGC.java b/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/MainGC.java
index 25c121d..ddc4bdc 100644
--- a/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/MainGC.java
+++ b/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/MainGC.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,7 @@
 
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.*;
@@ -44,11 +42,11 @@
     public static void main(String[] args) throws Exception {
 
         ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        Layer layerBoot = Layer.boot();
+        ModuleLayer layerBoot = ModuleLayer.boot();
 
         Configuration cf = layerBoot
                 .configuration()
-                .resolveRequires(ModuleFinder.of(), finder, Set.of(MODULE_NAME));
+                .resolve(ModuleFinder.of(), finder, Set.of(MODULE_NAME));
 
         Module testModule = MainGC.class.getModule();
         ClassLoader scl = ClassLoader.getSystemClassLoader();
@@ -59,7 +57,7 @@
         Callable<Void> task = new Callable<Void>() {
             @Override
             public Void call() throws Exception {
-                Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
+                ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
                 Module transletModule = layer.findModule(MODULE_NAME).get();
                 testModule.addExports("test", transletModule);
                 testModule.addReads(transletModule);
diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java
index f87a582..75489a6 100644
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,8 +38,8 @@
 
   public static void main(String args[]) throws Exception {
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-      "--patch-module=module1=module1_dir",
-      "--patch-module=module1=module1_dir",
+      "--patch-module=module_one=module_one_dir",
+      "--patch-module=module_one=module_one_dir",
       "-version");
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
     output.shouldContain("java.lang.ExceptionInInitializerError");
diff --git a/hotspot/test/runtime/modules/acc_module.jcod b/hotspot/test/runtime/modules/acc_module.jcod
index 573c7dd..09b21bc 100644
--- a/hotspot/test/runtime/modules/acc_module.jcod
+++ b/hotspot/test/runtime/modules/acc_module.jcod
@@ -23,7 +23,8 @@
 
 /*
  * This class consists of the following java code, but has an illegal class
- * access_flags value of 0x8000, that should be ignored by the JVM.
+ * access_flags value of 0x8000, that should be ignored by the JVM because
+ * the class file version is < 53.
  *
  *    public class acc_module {
  *       public static void main(String[] args) {
diff --git a/hotspot/test/runtime/modules/getModuleJNI/GetModule.java b/hotspot/test/runtime/modules/getModuleJNI/GetModule.java
index 01d0064..182632a 100644
--- a/hotspot/test/runtime/modules/getModuleJNI/GetModule.java
+++ b/hotspot/test/runtime/modules/getModuleJNI/GetModule.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
  * @run main/native GetModule
  */
 
-import java.lang.reflect.Module;
 import java.lang.management.LockInfo;
 public class GetModule {
 
diff --git a/hotspot/test/runtime/modules/java.base/java/lang/ModuleHelper.java b/hotspot/test/runtime/modules/java.base/java/lang/ModuleHelper.java
new file mode 100644
index 0000000..6aef814
--- /dev/null
+++ b/hotspot/test/runtime/modules/java.base/java/lang/ModuleHelper.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang;
+
+import java.lang.module.ModuleDescriptor;
+
+/**
+ * A helper class intended to be injected into java.lang using the
+ * java --patch-module option. The helper class provides access to package private
+ * methods in java.lang.Module.
+ */
+
+public final class ModuleHelper {
+
+    private ModuleHelper() { }
+
+    /**
+     * Creates a named module but without defining the module to the VM.
+     */
+    public static Module newModule(ClassLoader loader, ModuleDescriptor descriptor) {
+        return new Module(loader, descriptor);
+    }
+
+    /**
+     * Updates module {@code from} to that it reads module {@code to} without
+     * notifying the VM.
+     */
+    public static void addReadsNoSync(Module from, Module to) {
+        from.implAddReadsNoSync(to);
+    }
+
+    /**
+     * Updates module {@code from} so that it exports package {@code pkg}
+     * to module {@code to} but without notifying the VM. If {@code to} is
+     * {@code null} then the package is exported unconditionally.
+     */
+    public static void addExportsNoSync(Module from, String pkg, Module to) {
+        if (to == null) {
+            from.implAddExportsNoSync(pkg);
+        } else {
+            from.implAddExportsNoSync(pkg, to);
+        }
+    }
+
+    /**
+     * Adds a package to a module without notifying the VM.
+     */
+    public static void addPackageNoSync(Module m, String pkg) {
+        m.implAddPackageNoSync(pkg);
+    }
+
+}
diff --git a/hotspot/test/runtime/modules/java.base/java/lang/reflect/ModuleHelper.java b/hotspot/test/runtime/modules/java.base/java/lang/reflect/ModuleHelper.java
deleted file mode 100644
index 19bbff4..0000000
--- a/hotspot/test/runtime/modules/java.base/java/lang/reflect/ModuleHelper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.lang.reflect;
-
-import java.lang.module.ModuleDescriptor;
-
-/**
- * A helper class intended to be injected into java.lang.reflect using the
- * java --patch-module option. The helper class provides access to package private
- * methods in java.lang.reflect.Module.
- */
-
-public final class ModuleHelper {
-
-    private ModuleHelper() { }
-
-    /**
-     * Creates a named module but without defining the module to the VM.
-     */
-    public static Module newModule(ClassLoader loader, ModuleDescriptor descriptor) {
-        return new Module(loader, descriptor);
-    }
-
-    /**
-     * Updates module {@code from} to that it reads module {@code to} without
-     * notifying the VM.
-     */
-    public static void addReadsNoSync(Module from, Module to) {
-        from.implAddReadsNoSync(to);
-    }
-
-    /**
-     * Updates module {@code from} so that it exports package {@code pkg}
-     * to module {@code to} but without notifying the VM. If {@code to} is
-     * {@code null} then the package is exported unconditionally.
-     */
-    public static void addExportsNoSync(Module from, String pkg, Module to) {
-        from.implAddExportsNoSync(pkg, to);
-    }
-
-    /**
-     * Adds a package to a module without notifying the VM.
-     */
-    public static void addPackageNoSync(Module m, String pkg) {
-        m.implAddPackageNoSync(pkg);
-    }
-
-}
diff --git a/hotspot/test/serviceability/attach/AttachSetGetFlag.java b/hotspot/test/serviceability/attach/AttachSetGetFlag.java
index 2d6a28c..8ec530e 100644
--- a/hotspot/test/serviceability/attach/AttachSetGetFlag.java
+++ b/hotspot/test/serviceability/attach/AttachSetGetFlag.java
@@ -80,7 +80,7 @@
     try {
       waitForReady(target);
 
-      int pid = (int)target.getPid();
+      int pid = (int)target.pid();
 
       HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
 
@@ -116,7 +116,7 @@
     try {
       waitForReady(target);
 
-      int pid = (int)target.getPid();
+      int pid = (int)target.pid();
 
       HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
 
diff --git a/hotspot/test/serviceability/jdwp/AllModulesCommandTestDebuggee.java b/hotspot/test/serviceability/jdwp/AllModulesCommandTestDebuggee.java
index 1b686ec..5c919f4 100644
--- a/hotspot/test/serviceability/jdwp/AllModulesCommandTestDebuggee.java
+++ b/hotspot/test/serviceability/jdwp/AllModulesCommandTestDebuggee.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,6 @@
  * questions.
  */
 
-import java.lang.reflect.Module;
-import java.lang.reflect.Layer;
 import java.util.Set;
 import java.util.HashSet;
 
@@ -35,10 +33,10 @@
 
     public static void main(String[] args) throws InterruptedException {
 
-        int modCount = Layer.boot().modules().size();
+        int modCount = ModuleLayer.boot().modules().size();
 
         // Send all modules names via the process output
-        for (Module mod : Layer.boot().modules()) {
+        for (Module mod : ModuleLayer.boot().modules()) {
             String info = String.format("module %s", mod.getName());
             write(info);
         }
diff --git a/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/MyPackage/AddModuleExportsAndOpensTest.java b/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/MyPackage/AddModuleExportsAndOpensTest.java
index 04446a6..94da0f0 100644
--- a/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/MyPackage/AddModuleExportsAndOpensTest.java
+++ b/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/MyPackage/AddModuleExportsAndOpensTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@
  */
 
 import java.io.PrintStream;
-import java.lang.reflect.Module;
 
 public class AddModuleExportsAndOpensTest {
 
diff --git a/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c b/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c
index e028ee5..b5ccf25 100644
--- a/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c
+++ b/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
 #define FAILED 2
 
 static const char *EXC_CNAME = "java/lang/Exception";
-static const char* MOD_CNAME = "Ljava/lang/reflect/Module;";
+static const char* MOD_CNAME = "Ljava/lang/Module;";
 
 static jvmtiEnv *jvmti = NULL;
 static jint result = PASSED;
@@ -97,7 +97,7 @@
 }
 
 static
-jclass jlrM(JNIEnv *env) {
+jclass jlM(JNIEnv *env) {
     jclass cls = NULL;
 
     cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, MOD_CNAME));
@@ -127,7 +127,7 @@
     if (mIsExported == NULL) {
         const char* sign = "(Ljava/lang/String;)Z";
         const char* name = open ? "isOpen" : "isExported";
-        mIsExported = get_method(env, jlrM(env), name, sign);
+        mIsExported = get_method(env, jlM(env), name, sign);
     }
     jstr = JNI_ENV_PTR(env)->NewStringUTF(JNI_ENV_ARG(env, pkg));
     res = JNI_ENV_PTR(env)->CallBooleanMethod(JNI_ENV_ARG(env, module),
@@ -143,9 +143,9 @@
     jboolean res = JNI_FALSE;
 
     if (mIsExportedTo == NULL) {
-        const char* sign = "(Ljava/lang/String;Ljava/lang/reflect/Module;)Z";
+        const char* sign = "(Ljava/lang/String;Ljava/lang/Module;)Z";
         const char* name = open ? "isOpen" : "isExported";
-        mIsExportedTo = get_method(env, jlrM(env), name, sign);
+        mIsExportedTo = get_method(env, jlM(env), name, sign);
     }
     jstr = JNI_ENV_PTR(env)->NewStringUTF(JNI_ENV_ARG(env, pkg));
     res = JNI_ENV_PTR(env)->CallBooleanMethod(JNI_ENV_ARG(env, module),
diff --git a/hotspot/test/serviceability/jvmti/AddModuleReads/MyPackage/AddModuleReadsTest.java b/hotspot/test/serviceability/jvmti/AddModuleReads/MyPackage/AddModuleReadsTest.java
index 940172a..a3915f7 100644
--- a/hotspot/test/serviceability/jvmti/AddModuleReads/MyPackage/AddModuleReadsTest.java
+++ b/hotspot/test/serviceability/jvmti/AddModuleReads/MyPackage/AddModuleReadsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,6 @@
 
 import java.io.PrintStream;
 import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Module;
 
 public class AddModuleReadsTest {
 
diff --git a/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c b/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c
index 4863a4a..be259ff 100644
--- a/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c
+++ b/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
 #define FAILED 2
 
 static const char *EXC_CNAME = "java/lang/Exception";
-static const char* MOD_CNAME = "Ljava/lang/reflect/Module;";
+static const char* MOD_CNAME = "Ljava/lang/Module;";
 
 static jvmtiEnv *jvmti = NULL;
 static jint result = PASSED;
@@ -96,7 +96,7 @@
 }
 
 static
-jclass jlrM(JNIEnv *env) {
+jclass jlM(JNIEnv *env) {
     jclass cls = NULL;
 
     cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, MOD_CNAME));
@@ -123,8 +123,8 @@
     jboolean res = JNI_FALSE;
 
     if (mCanRead == NULL) {
-        const char* sign = "(Ljava/lang/reflect/Module;)Z";
-        mCanRead = get_method(env, jlrM(env), "canRead", sign);
+        const char* sign = "(Ljava/lang/Module;)Z";
+        mCanRead = get_method(env, jlM(env), "canRead", sign);
     }
     res = JNI_ENV_PTR(env)->CallBooleanMethod(JNI_ENV_ARG(env, module),
                                               mCanRead, to_module);
diff --git a/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/MyPackage/AddModuleUsesAndProvidesTest.java b/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/MyPackage/AddModuleUsesAndProvidesTest.java
index e6d9d57..634b2ea 100644
--- a/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/MyPackage/AddModuleUsesAndProvidesTest.java
+++ b/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/MyPackage/AddModuleUsesAndProvidesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@
 
 import java.io.PrintStream;
 import java.lang.TestProvider;
-import java.lang.reflect.Module;
 
 public class AddModuleUsesAndProvidesTest {
 
diff --git a/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c b/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c
index 5ce1bf4..86f9993 100644
--- a/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c
+++ b/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
 #define FAILED 2
 
 static const char *EXC_CNAME = "java/lang/Exception";
-static const char* MOD_CNAME = "Ljava/lang/reflect/Module;";
+static const char* MOD_CNAME = "Ljava/lang/Module;";
 
 static jvmtiEnv *jvmti = NULL;
 static jint result = PASSED;
@@ -97,7 +97,7 @@
 }
 
 static
-jclass jlrM(JNIEnv *env) {
+jclass jlM(JNIEnv *env) {
     jclass cls = NULL;
 
     cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, MOD_CNAME));
@@ -125,7 +125,7 @@
 
     if (mCanUse == NULL) {
         const char* sign = "(Ljava/lang/Class;)Z";
-        mCanUse = get_method(env, jlrM(env), "canUse", sign);
+        mCanUse = get_method(env, jlM(env), "canUse", sign);
     }
     res = JNI_ENV_PTR(env)->CallBooleanMethod(JNI_ENV_ARG(env, module),
                                               mCanUse, service);
diff --git a/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java b/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java
index 7c682b5..4b700ef 100644
--- a/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java
+++ b/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,6 @@
  * @run main/othervm -agentlib:JvmtiGetAllModulesTest JvmtiGetAllModulesTest
  *
  */
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.lang.module.ModuleReference;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReader;
@@ -79,16 +77,15 @@
         final String MY_MODULE_NAME = "myModule";
 
         // Verify that JVMTI reports exactly the same info as Java regarding the named modules
-        Asserts.assertEquals(Layer.boot().modules(), getModulesJVMTI());
+        Asserts.assertEquals(ModuleLayer.boot().modules(), getModulesJVMTI());
 
         // Load a new named module
-        ModuleDescriptor descriptor
-                = ModuleDescriptor.module(MY_MODULE_NAME).build();
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule(MY_MODULE_NAME).build();
         ModuleFinder finder = finderOf(descriptor);
         ClassLoader loader = new ClassLoader() {};
-        Configuration parent = Layer.boot().configuration();
-        Configuration cf = parent.resolveRequires(finder, ModuleFinder.of(), Set.of(MY_MODULE_NAME));
-        Layer my = Layer.boot().defineModules(cf, m -> loader);
+        Configuration parent = ModuleLayer.boot().configuration();
+        Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of(MY_MODULE_NAME));
+        ModuleLayer my = ModuleLayer.boot().defineModules(cf, m -> loader);
 
         // Verify that the loaded module is indeed reported by JVMTI
         Set<Module> jvmtiModules = getModulesJVMTI();
diff --git a/hotspot/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c b/hotspot/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c
index ed83d19..fcabaa4 100644
--- a/hotspot/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c
+++ b/hotspot/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
             return NULL;
         }
 
-        array = (*env)->NewObjectArray(env, modules_count, (*env)->FindClass(env, "java/lang/reflect/Module"), NULL);
+        array = (*env)->NewObjectArray(env, modules_count, (*env)->FindClass(env, "java/lang/Module"), NULL);
 
         for (i = 0; i < modules_count; ++i) {
             (*env)->SetObjectArrayElement(env, array, i, modules_ptr[i]);
diff --git a/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c b/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c
index 6e9b030..307fab0 100644
--- a/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c
+++ b/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
 #define FAILED 2
 
 static const char *EXC_CNAME = "java/lang/Exception";
-static const char* MOD_CNAME = "Ljava/lang/reflect/Module;";
+static const char* MOD_CNAME = "Ljava/lang/Module;";
 
 static jvmtiEnv *jvmti = NULL;
 static jint result = PASSED;
@@ -115,7 +115,7 @@
 }
 
 static
-jclass jlrM(JNIEnv *env) {
+jclass jlM(JNIEnv *env) {
     jclass cls = NULL;
 
     cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, MOD_CNAME));
@@ -142,7 +142,7 @@
     jobject loader = NULL;
 
     if (cl_method == NULL) {
-        cl_method = get_method(env, jlrM(env), "getClassLoader", "()Ljava/lang/ClassLoader;");
+        cl_method = get_method(env, jlM(env), "getClassLoader", "()Ljava/lang/ClassLoader;");
     }
     loader = (jobject)JNI_ENV_PTR(env)->CallObjectMethod(JNI_ENV_ARG(env, module), cl_method);
     return loader;
@@ -157,7 +157,7 @@
     const char *nstr = NULL;
 
     if (method == NULL) {
-        method = get_method(env, jlrM(env), "getName", "()Ljava/lang/String;");
+        method = get_method(env, jlM(env), "getName", "()Ljava/lang/String;");
     }
     jstr = (jstring)JNI_ENV_PTR(env)->CallObjectMethod(JNI_ENV_ARG(env, module), method);
     if (jstr != NULL) {
@@ -183,7 +183,7 @@
     err = (*jvmti)->GetNamedModule(jvmti, loader, pkg_name, module_ptr);
     if (err != JVMTI_ERROR_NONE) {
         printf("    Error in GetNamedModule for package \"%s\": %s (%d)\n",
-               pkg_name, TranslateError(err), err);
+               name, TranslateError(err), err);
         return err;
     }
     printf("    returned module: %p\n", *module_ptr);
diff --git a/hotspot/test/serviceability/sa/LingeredAppWithInterface.java b/hotspot/test/serviceability/sa/LingeredAppWithInterface.java
new file mode 100644
index 0000000..4b65bf1
--- /dev/null
+++ b/hotspot/test/serviceability/sa/LingeredAppWithInterface.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.test.lib.apps.LingeredApp;
+
+interface Language {
+    static final long nbrOfWords = 99999;
+    public abstract long getNbrOfWords();
+}
+
+class ParselTongue implements Language {
+    public long getNbrOfWords() {
+        return nbrOfWords * 4;
+    }
+}
+
+public class LingeredAppWithInterface extends LingeredApp {
+
+    public static void main(String args[]) {
+        ParselTongue lang = new ParselTongue();
+        Language muggleSpeak = new Language() {
+            public long getNbrOfWords() {
+                return nbrOfWords * 8;
+            }
+        };
+
+        // Not tested at this point. The test needs to be enhanced
+        // later to test for the sizes of the Lambda MetaFactory
+        // generated anonymous classes too. (After JDK-8160228 gets
+        // fixed.)
+        Runnable r2 = () -> System.out.println("Hello world!");
+        r2.run();
+
+        System.out.println(lang.getNbrOfWords() + muggleSpeak.getNbrOfWords());
+
+        LingeredApp.main(args);
+    }
+}
diff --git a/hotspot/test/serviceability/sa/LingeredAppWithLargeArray.java b/hotspot/test/serviceability/sa/LingeredAppWithLargeArray.java
new file mode 100644
index 0000000..44929f0
--- /dev/null
+++ b/hotspot/test/serviceability/sa/LingeredAppWithLargeArray.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.test.lib.apps.LingeredApp;
+
+public class LingeredAppWithLargeArray extends LingeredApp {
+    public static void main(String args[]) {
+        int[] hugeArray = new int[Integer.MAX_VALUE/2];
+        LingeredApp.main(args);
+    }
+ }
diff --git a/hotspot/test/serviceability/sa/TestCpoolForInvokeDynamic.java b/hotspot/test/serviceability/sa/TestCpoolForInvokeDynamic.java
index e8f1fd8..901fbab8 100644
--- a/hotspot/test/serviceability/sa/TestCpoolForInvokeDynamic.java
+++ b/hotspot/test/serviceability/sa/TestCpoolForInvokeDynamic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,6 @@
  *          jdk.hotspot.agent/sun.jvm.hotspot.oops
  *          jdk.hotspot.agent/sun.jvm.hotspot.debugger
  *          jdk.hotspot.agent/sun.jvm.hotspot.ui.classbrowser
- * @ignore 8169232
  * @run main/othervm TestCpoolForInvokeDynamic
  */
 
diff --git a/hotspot/test/serviceability/sa/TestHeapDumpForLargeArray.java b/hotspot/test/serviceability/sa/TestHeapDumpForLargeArray.java
new file mode 100644
index 0000000..70f26fb4
--- /dev/null
+++ b/hotspot/test/serviceability/sa/TestHeapDumpForLargeArray.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import java.io.File;
+import java.nio.file.Files;
+import java.io.IOException;
+import java.io.BufferedInputStream;
+import java.util.stream.Collectors;
+import java.io.FileInputStream;
+
+import sun.jvm.hotspot.HotSpotAgent;
+import sun.jvm.hotspot.debugger.*;
+
+import jdk.test.lib.apps.LingeredApp;
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.Platform;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.Asserts;
+
+/*
+ * @test
+ * @library /test/lib
+ * @bug 8171084
+ * @requires (vm.bits == "64" & os.maxMemory > 8g)
+ * @modules java.base/jdk.internal.misc
+ *          jdk.hotspot.agent/sun.jvm.hotspot
+ *          jdk.hotspot.agent/sun.jvm.hotspot.utilities
+ *          jdk.hotspot.agent/sun.jvm.hotspot.oops
+ *          jdk.hotspot.agent/sun.jvm.hotspot.debugger
+ * @run main/timeout=1800/othervm -Xmx8g TestHeapDumpForLargeArray
+ */
+
+public class TestHeapDumpForLargeArray {
+
+    private static LingeredAppWithLargeArray theApp = null;
+
+    private static void attachAndDump(String heapDumpFileName,
+                                      long lingeredAppPid) throws Exception {
+
+        JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb");
+        launcher.addToolArg("jmap");
+        launcher.addToolArg("--binaryheap");
+        launcher.addToolArg("--dumpfile");
+        launcher.addToolArg(heapDumpFileName);
+        launcher.addToolArg("--pid");
+        launcher.addToolArg(Long.toString(lingeredAppPid));
+
+        ProcessBuilder processBuilder = new ProcessBuilder();
+        processBuilder.command(launcher.getCommand());
+        System.out.println(
+            processBuilder.command().stream().collect(Collectors.joining(" ")));
+
+        OutputAnalyzer SAOutput = ProcessTools.executeProcess(processBuilder);
+        SAOutput.shouldHaveExitValue(0);
+        SAOutput.shouldNotContain("Heap segment size overflow");
+        SAOutput.shouldContain("truncating to");
+        SAOutput.shouldContain("heap written to");
+        SAOutput.shouldContain(heapDumpFileName);
+        System.out.println(SAOutput.getOutput());
+
+    }
+
+    public static void main (String... args) throws Exception {
+
+        String heapDumpFileName = "LargeArrayHeapDump.bin";
+
+        if (!Platform.shouldSAAttach()) {
+            System.out.println(
+               "SA attach not expected to work - test skipped.");
+            return;
+        }
+
+        File heapDumpFile = new File(heapDumpFileName);
+        if (heapDumpFile.exists()) {
+            heapDumpFile.delete();
+        }
+
+        try {
+            List<String> vmArgs = new ArrayList<String>();
+            vmArgs.add("-XX:+UsePerfData");
+            vmArgs.add("-Xmx8g");
+            vmArgs.addAll(Utils.getVmOptions());
+
+            theApp = new LingeredAppWithLargeArray();
+            LingeredApp.startApp(vmArgs, theApp);
+            attachAndDump(heapDumpFileName, theApp.getPid());
+        } finally {
+            LingeredApp.stopApp(theApp);
+            heapDumpFile.delete();
+        }
+    }
+}
diff --git a/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java b/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java
index 5369c76..d660249 100644
--- a/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java
+++ b/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,11 +21,15 @@
  * questions.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+
 import sun.jvm.hotspot.HotSpotAgent;
 import sun.jvm.hotspot.utilities.SystemDictionaryHelper;
 import sun.jvm.hotspot.oops.InstanceKlass;
 import sun.jvm.hotspot.debugger.*;
 
+import jdk.test.lib.apps.LingeredApp;
 import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.Platform;
@@ -45,29 +49,20 @@
  * @run main/othervm TestInstanceKlassSizeForInterface
  */
 
-interface Language {
-    static final long nbrOfWords = 99999;
-    public abstract long getNbrOfWords();
-}
-
-class ParselTongue implements Language {
-    public long getNbrOfWords() {
-      return nbrOfWords * 4;
-    }
-}
-
 public class TestInstanceKlassSizeForInterface {
 
-    private static void SAInstanceKlassSize(int pid,
+    private static LingeredAppWithInterface theApp = null;
+
+    private static void SAInstanceKlassSize(int lingeredAppPid,
                                             String[] instanceKlassNames) {
 
         HotSpotAgent agent = new HotSpotAgent();
         try {
-            agent.attach((int)pid);
+            agent.attach(lingeredAppPid);
         }
         catch (DebuggerException e) {
             System.out.println(e.getMessage());
-            System.err.println("Unable to connect to process ID: " + pid);
+            System.err.println("Unable to connect to process ID: " + lingeredAppPid);
 
             agent.detach();
             e.printStackTrace();
@@ -98,11 +93,9 @@
     }
 
     private static void createAnotherToAttach(
-                            String[] instanceKlassNames) throws Exception {
+                            String[] instanceKlassNames,
+                            int lingeredAppPid) throws Exception {
 
-        ProcessBuilder pb = new ProcessBuilder();
-
-        // Grab the pid from the current java process and pass it
         String[] toolArgs = {
             "--add-modules=jdk.hotspot.agent",
             "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED",
@@ -110,23 +103,26 @@
             "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED",
             "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.debugger=ALL-UNNAMED",
             "TestInstanceKlassSizeForInterface",
-            Long.toString(ProcessTools.getProcessId())
+            Integer.toString(lingeredAppPid)
         };
 
+        // Start a new process to attach to the LingeredApp process
+        ProcessBuilder processBuilder = ProcessTools
+                  .createJavaProcessBuilder(toolArgs);
+        OutputAnalyzer SAOutput = ProcessTools.executeProcess(processBuilder);
+        SAOutput.shouldHaveExitValue(0);
+        System.out.println(SAOutput.getOutput());
+
+        // Run jcmd on the LingeredApp process
+        ProcessBuilder pb = new ProcessBuilder();
         pb.command(new String[] {
                           JDKToolFinder.getJDKTool("jcmd"),
-                          Long.toString(ProcessTools.getProcessId()),
+                          Long.toString(lingeredAppPid),
                           "GC.class_stats",
                           "VTab,ITab,OopMap,KlassBytes"
                       }
                   );
 
-        // Start a new process to attach to the current process
-        ProcessBuilder processBuilder = ProcessTools
-                  .createJavaProcessBuilder(toolArgs);
-        OutputAnalyzer SAOutput = ProcessTools.executeProcess(processBuilder);
-        System.out.println(SAOutput.getOutput());
-
         OutputAnalyzer jcmdOutput = new OutputAnalyzer(pb.start());
         System.out.println(jcmdOutput.getOutput());
 
@@ -153,7 +149,7 @@
         String[] instanceKlassNames = new String[] {
                                           "Language",
                                           "ParselTongue",
-                                          "TestInstanceKlassSizeForInterface$1"
+                                          "LingeredAppWithInterface$1"
                                       };
 
         if (!Platform.shouldSAAttach()) {
@@ -163,22 +159,17 @@
         }
 
         if (args == null || args.length == 0) {
-            ParselTongue lang = new ParselTongue();
+            try {
+                List<String> vmArgs = new ArrayList<String>();
+                vmArgs.addAll(Utils.getVmOptions());
 
-            Language ventro = new Language() {
-                public long getNbrOfWords() {
-                    return nbrOfWords * 8;
-                }
-            };
-
-            // Not tested at this point. The test needs to be enhanced
-            // later to test for the sizes of the Lambda MetaFactory
-            // generated anonymous classes too. (After JDK-8160228 gets
-            // fixed.)
-            Runnable r2 = () -> System.out.println("Hello world!");
-            r2.run();
-
-            createAnotherToAttach(instanceKlassNames);
+                theApp = new LingeredAppWithInterface();
+                LingeredApp.startApp(vmArgs, theApp);
+                createAnotherToAttach(instanceKlassNames,
+                                      (int)theApp.getPid());
+            } finally {
+                LingeredApp.stopApp(theApp);
+            }
         } else {
             SAInstanceKlassSize(Integer.parseInt(args[0]), instanceKlassNames);
         }
diff --git a/hotspot/test/serviceability/sa/TestPrintMdo.java b/hotspot/test/serviceability/sa/TestPrintMdo.java
new file mode 100644
index 0000000..48b0b08
--- /dev/null
+++ b/hotspot/test/serviceability/sa/TestPrintMdo.java
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.ArrayList;
+import java.util.Scanner;
+import java.util.List;
+import java.io.File;
+import java.io.IOException;
+import java.util.stream.Collectors;
+import java.io.OutputStream;
+import jdk.test.lib.apps.LingeredApp;
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.Platform;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.Asserts;
+
+/*
+ * @test
+ * @library /test/lib
+ * @requires vm.flavor == "server" & !vm.emulatedClient & !(vm.opt.TieredStopAtLevel == 1)
+ * @build jdk.test.lib.apps.*
+ * @run main/othervm TestPrintMdo
+ */
+
+public class TestPrintMdo {
+
+    private static final String PRINTMDO_OUT_FILE = "printmdo_out.txt";
+
+    private static void verifyPrintMdoOutput() throws Exception {
+
+        Exception unexpected = null;
+        File printMdoFile = new File(PRINTMDO_OUT_FILE);
+        Asserts.assertTrue(printMdoFile.exists() && printMdoFile.isFile(),
+                           "File with printmdo output not created: " +
+                           printMdoFile.getAbsolutePath());
+        try {
+            Scanner scanner = new Scanner(printMdoFile);
+
+            String unexpectedMsg =
+                 "One or more of 'VirtualCallData', 'CounterData', " +
+                 "'ReceiverTypeData', 'bci', 'MethodData' "  +
+                 "or 'java/lang/Object' not found";
+            boolean knownClassFound = false;
+            boolean knownProfileDataTypeFound = false;
+            boolean knownTokensFound = false;
+
+            while (scanner.hasNextLine()) {
+                String line = scanner.nextLine();
+                line = line.trim();
+                System.out.println(line);
+
+                if (line.contains("missing reason for ")) {
+                    unexpected = new RuntimeException("Unexpected msg: missing reason for ");
+                    break;
+                }
+                if (line.contains("VirtualCallData")  ||
+                    line.contains("CounterData")      ||
+                    line.contains("ReceiverTypeData")) {
+                    knownProfileDataTypeFound = true;
+                }
+                if (line.contains("bci") ||
+                    line.contains("MethodData")) {
+                    knownTokensFound = true;
+                }
+                if (line.contains("java/lang/Object")) {
+                    knownClassFound = true;
+                }
+            }
+            if ((knownClassFound           == false)  ||
+                (knownTokensFound          == false)  ||
+                (knownProfileDataTypeFound == false)) {
+                unexpected = new RuntimeException(unexpectedMsg);
+            }
+            if (unexpected != null) {
+                throw unexpected;
+            }
+        } catch (Exception ex) {
+           throw new RuntimeException("Test ERROR " + ex, ex);
+        } finally {
+           printMdoFile.delete();
+        }
+    }
+
+    private static void startClhsdbForPrintMdo(long lingeredAppPid) throws Exception {
+
+        Process p;
+        JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb");
+        launcher.addToolArg("clhsdb");
+        launcher.addToolArg("--pid");
+        launcher.addToolArg(Long.toString(lingeredAppPid));
+
+        ProcessBuilder pb = new ProcessBuilder();
+        pb.command(launcher.getCommand());
+        System.out.println(
+            pb.command().stream().collect(Collectors.joining(" ")));
+
+        try {
+            p = pb.start();
+        } catch (Exception attachE) {
+            throw new Error("Couldn't start jhsdb or attach to LingeredApp : " + attachE);
+        }
+
+        // Issue the 'printmdo' input at the clhsdb prompt.
+        OutputStream input = p.getOutputStream();
+        String str = "printmdo -a > " + PRINTMDO_OUT_FILE + "\nquit\n";
+        try {
+            input.write(str.getBytes());
+            input.flush();
+        } catch (IOException ioe) {
+            throw new Error("Problem issuing the printmdo command: " + str, ioe);
+        }
+
+        try {
+            p.waitFor();
+        } catch (InterruptedException ie) {
+            throw new Error("Problem awaiting the child process: " + ie, ie);
+        }
+
+        int exitValue = p.exitValue();
+        if (exitValue != 0) {
+            String output;
+            try {
+                output = new OutputAnalyzer(p).getOutput();
+            } catch (IOException ioe) {
+                throw new Error("Can't get failed clhsdb process output: " + ioe, ioe);
+            }
+            throw new AssertionError("clhsdb wasn't run successfully: " + output);
+        }
+    }
+
+    public static void main (String... args) throws Exception {
+
+        LingeredApp app = null;
+
+        if (!Platform.shouldSAAttach()) {
+            System.out.println(
+               "SA attach not expected to work - test skipped.");
+            return;
+        }
+
+        try {
+            List<String> vmArgs = new ArrayList<String>();
+            vmArgs.add("-XX:+ProfileInterpreter");
+            vmArgs.addAll(Utils.getVmOptions());
+
+            app = LingeredApp.startApp(vmArgs);
+            System.out.println ("Started LingeredApp with pid " + app.getPid());
+            startClhsdbForPrintMdo(app.getPid());
+            verifyPrintMdoOutput();
+        } finally {
+            LingeredApp.stopApp(app);
+        }
+    }
+}
diff --git a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java
index 2a46621..5053194 100644
--- a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java
+++ b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java
@@ -53,7 +53,6 @@
 
 public class JMapHProfLargeHeapTest {
     private static final String HEAP_DUMP_FILE_NAME = "heap.bin";
-    private static final String HPROF_HEADER_1_0_1 = "JAVA PROFILE 1.0.1";
     private static final String HPROF_HEADER_1_0_2 = "JAVA PROFILE 1.0.2";
     private static final long M = 1024L;
     private static final long G = 1024L * M;
@@ -65,9 +64,7 @@
         }
 
         // All heap dumps should create 1.0.2 file format
-        // Hotspot internal heapdumper always use HPROF_HEADER_1_0_2 format,
-        // but SA heapdumper still use HPROF_HEADER_1_0_1 for small heaps
-        testHProfFileFormat("-Xmx1g", 22 * M, HPROF_HEADER_1_0_1);
+        testHProfFileFormat("-Xmx1g", 22 * M, HPROF_HEADER_1_0_2);
 
         /**
          * This test was deliberately commented out since the test system lacks
diff --git a/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java b/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java
index 80b45ec..0bbb42d 100644
--- a/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java
+++ b/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
             return;
         }
 
-        long ourPid = ProcessHandle.current().getPid();
+        long ourPid = ProcessHandle.current().pid();
 
         // The string we are expecting in the debugd ouput
         String golden = String.format(GOLDEN, ourPid);
diff --git a/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java
index 23bba68..29251d8 100644
--- a/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java
+++ b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@
         thread.start();
 
         // Run jstack tool and collect the output
-        JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
+        JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
         ToolResults results = jstackTool.measure();
 
         // Analyze the jstack output for the correct thread type
diff --git a/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java
index 8f3be81..e3928d0 100644
--- a/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java
+++ b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@
         debuggee.start();
 
         // Collect output from the jstack tool
-        JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
+        JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
         ToolResults results1 = jstackTool.measure();
 
         // Go to method b()
diff --git a/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java
index 6402c22..e0b6f06 100644
--- a/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java
+++ b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
         thread.start();
 
         // Run jstack tool and collect the output
-        JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
+        JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
         ToolResults results = jstackTool.measure();
 
         // Analyze the jstack output for the strange thread name
diff --git a/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java
index 9a87d6b..ac76599 100644
--- a/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java
+++ b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@
         debuggee.start();
 
         // Collect output from the jstack tool
-        JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
+        JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
         ToolResults results1 = jstackTool.measure();
 
         // Go to method b()
diff --git a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java
index 9b5a544..c4fe1cc 100644
--- a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java
+++ b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -105,7 +105,7 @@
         waitThread.start();
 
         // Collect output from the jstack tool
-        JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
+        JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
         ToolResults results = jstackTool.measure();
 
         // Analyze the jstack output for the patterns needed
diff --git a/hotspot/test/serviceability/tmtools/jstat/GarbageProducerTest.java b/hotspot/test/serviceability/tmtools/jstat/GarbageProducerTest.java
new file mode 100644
index 0000000..dfe1a8f
--- /dev/null
+++ b/hotspot/test/serviceability/tmtools/jstat/GarbageProducerTest.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.management.ManagementFactory;
+import utils.GarbageProducer;
+import common.TmTool;
+import utils.JstatResults;
+
+/**
+ * Base class for jstat testing which uses GarbageProducer to allocate garbage.
+ */
+public class GarbageProducerTest {
+
+    // Iterations of measurement to get consistent value of counters and jstat.
+    private final static int ITERATIONS = 10;
+    private final static float TARGET_MEMORY_USAGE = 0.7f;
+    private final static float MEASUREMENT_TOLERANCE = 0.05f;
+    private final GarbageProducer garbageProducer;
+    private final TmTool<? extends JstatResults> jstatTool;
+
+    public GarbageProducerTest(TmTool<? extends JstatResults> tool) {
+        garbageProducer = new GarbageProducer(TARGET_MEMORY_USAGE);
+        // We will be running jstat tool
+        jstatTool = tool;
+    }
+
+    public void run() throws Exception {
+        // Run once and get the  results asserting that they are reasonable
+        JstatResults measurement1 = jstatTool.measure();
+        measurement1.assertConsistency();
+        // Eat metaspace and heap then run the tool again and get the results  asserting that they are reasonable
+        System.gc();
+        garbageProducer.allocateMetaspaceAndHeap();
+        // Collect garbage. Also update VM statistics
+        System.gc();
+        int i = 0;
+        long collectionCountBefore = getCollectionCount();
+        JstatResults measurement2 = jstatTool.measure();
+        do {
+            System.out.println("Measurement #" + i);
+            long currentCounter = getCollectionCount();
+            // Check if GC cycle occured during measurement
+            if (currentCounter == collectionCountBefore) {
+                measurement2.assertConsistency();
+                checkOldGenMeasurement(measurement2);
+                return;
+            } else {
+                System.out.println("GC happened during measurement.");
+            }
+            collectionCountBefore = getCollectionCount();
+            measurement2 = jstatTool.measure();
+
+        } while (i++ < ITERATIONS);
+        // Checking will be performed without consistency guarantee.
+        checkOldGenMeasurement(measurement2);
+    }
+
+    private void checkOldGenMeasurement(JstatResults measurement2) {
+        float oldGenAllocationRatio = garbageProducer.getOldGenAllocationRatio() - MEASUREMENT_TOLERANCE;
+        // Assert that space has been utilized accordingly
+        JstatResults.assertSpaceUtilization(measurement2, TARGET_MEMORY_USAGE, oldGenAllocationRatio);
+    }
+
+    private static long getCollectionCount() {
+        return ManagementFactory.getGarbageCollectorMXBeans().stream()
+                .mapToLong(b -> b.getCollectionCount())
+                .sum();
+    }
+}
diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java
index 6723e6e..820c8da 100644
--- a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java
+++ b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
     public static void main(String[] args) throws Exception {
 
         // We will be running "jstat -gc" tool
-        JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().getPid());
+        JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().pid());
 
         // Run once and get the  results asserting that they are reasonable
         JstatGcCapacityResults measurement1 = jstatGcTool.measure();
diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java
index 9e4c5eb..96f0728 100644
--- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java
+++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
     public static void main(String[] args) throws Exception {
 
         // We will be running "jstat -gc" tool
-        JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid());
+        JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().pid());
 
         // Run once and get the  results asserting that they are reasonable
         JstatGcCauseResults measurement1 = jstatGcTool.measure();
diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java
index 2bdf04d..b92ea57 100644
--- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java
+++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,39 +25,19 @@
  * @test
  * @summary Test checks output displayed with jstat -gccause.
  *          Test scenario:
- *          tests forces debuggee application eat ~70% of heap and runs jstat.
- *          jstat should show that ~70% of heap (OC/OU ~= 70%).
+ *          test forces debuggee application eat ~70% of heap and runs jstat.
+ *          jstat should show actual usage of old gen (OC/OU ~= old gen usage).
  * @requires vm.opt.ExplicitGCInvokesConcurrent != true
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @library ../share
- * @run main/othervm -XX:+UsePerfData -XX:InitialHeapSize=128M -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02
+ * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02
  */
 import utils.*;
 
 public class GcCauseTest02 {
 
-    private final static float targetMemoryUsagePercent = 0.7f;
-
     public static void main(String[] args) throws Exception {
-
-        // We will be running "jstat -gc" tool
-        JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid());
-
-        // Run once and get the  results asserting that they are reasonable
-        JstatGcCauseResults measurement1 = jstatGcTool.measure();
-        measurement1.assertConsistency();
-
-        GcProvoker gcProvoker = new GcProvoker();
-
-        // Eat metaspace and heap then run the tool again and get the results  asserting that they are reasonable
-        gcProvoker.allocateAvailableMetaspaceAndHeap(targetMemoryUsagePercent);
-        // Collect garbage. Also update VM statistics
-        System.gc();
-        JstatGcCauseResults measurement2 = jstatGcTool.measure();
-        measurement2.assertConsistency();
-
-        // Assert that space has been utilized acordingly
-        JstatResults.assertSpaceUtilization(measurement2, targetMemoryUsagePercent);
+        new GarbageProducerTest(new JstatGcCauseTool(ProcessHandle.current().pid())).run();
     }
 }
diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java
index 91ebd0f..13bd73b 100644
--- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java
+++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
     public static void main(String[] args) throws Exception {
 
         // We will be running "jstat -gc" tool
-        JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid());
+        JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().pid());
 
         System.gc();
 
diff --git a/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java
index 8e1d6ae..4719baa 100644
--- a/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java
+++ b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
     public static void main(String[] args) throws Exception {
 
         // We will be running "jstat -gc" tool
-        JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().getPid());
+        JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().pid());
 
         // Run once and get the  results asserting that they are reasonable
         JstatGcNewResults measurement1 = jstatGcTool.measure();
diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java
index cc0bf52..6ee18f3 100644
--- a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java
+++ b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
     public static void main(String[] args) throws Exception {
 
         // We will be running "jstat -gc" tool
-        JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid());
+        JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().pid());
 
         // Run once and get the  results asserting that they are reasonable
         JstatGcResults measurement1 = jstatGcTool.measure();
diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java
index 91406fa..a0e0cb4 100644
--- a/hotspot/test/serviceability/tmtools/jstat/GcTest02.java
+++ b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,43 +21,23 @@
  * questions.
  */
 
-import utils.*;
 /*
  * @test
  * @summary Test checks output displayed with jstat -gc.
  *          Test scenario:
- *          tests forces debuggee application eat ~70% of heap and runs jstat.
- *          jstat should show that ~70% of heap is utilized (OC/OU ~= 70%).
+ *          test forces debuggee application eat ~70% of heap and runs jstat.
+ *          jstat should show actual usage of old gen (OC/OU ~= old gen usage).
  * @requires vm.opt.ExplicitGCInvokesConcurrent != true
  * @modules java.base/jdk.internal.misc
  * @library /test/lib
  * @library ../share
- * @run main/othervm -XX:+UsePerfData -XX:InitialHeapSize=128M -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02
+ * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02
  */
+import utils.*;
 
 public class GcTest02 {
 
-    private final static float targetMemoryUsagePercent = 0.7f;
-
     public static void main(String[] args) throws Exception {
-
-        // We will be running "jstat -gc" tool
-        JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid());
-
-        // Run once and get the  results asserting that they are reasonable
-        JstatGcResults measurement1 = jstatGcTool.measure();
-        measurement1.assertConsistency();
-
-        GcProvoker gcProvoker = new GcProvoker();
-
-        // Eat metaspace and heap then run the tool again and get the results  asserting that they are reasonable
-        gcProvoker.allocateAvailableMetaspaceAndHeap(targetMemoryUsagePercent);
-        // Collect garbage. Also updates VM statistics
-        System.gc();
-        JstatGcResults measurement2 = jstatGcTool.measure();
-        measurement2.assertConsistency();
-
-        // Assert that space has been utilized acordingly
-        JstatResults.assertSpaceUtilization(measurement2, targetMemoryUsagePercent);
+        new GarbageProducerTest(new JstatGcTool(ProcessHandle.current().pid())).run();
     }
 }
diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GarbageProducer.java b/hotspot/test/serviceability/tmtools/jstat/utils/GarbageProducer.java
new file mode 100644
index 0000000..0dd7c85
--- /dev/null
+++ b/hotspot/test/serviceability/tmtools/jstat/utils/GarbageProducer.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package utils;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+import java.lang.management.MemoryPoolMXBean;
+import java.lang.management.MemoryUsage;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This is an class used to allocate specified amount of metaspace and heap.
+ */
+public class GarbageProducer {
+
+    // Uses fixed small objects to avoid Humongous objects allocation with G1 GC.
+    private static final int MEMORY_CHUNK = 2048;
+
+    public static List<Object> allocatedMetaspace;
+    public static List<Object> allocatedMemory;
+
+    private final MemoryMXBean memoryMXBean;
+    private final float targetMemoryUsagePercent;
+    private final long targetMemoryUsage;
+
+    /**
+     * @param targetMemoryUsagePercent how many percent of metaspace and heap to
+     * allocate
+     */
+    public GarbageProducer(float targetMemoryUsagePercent) {
+        memoryMXBean = ManagementFactory.getMemoryMXBean();
+        this.targetMemoryUsagePercent = targetMemoryUsagePercent;
+        targetMemoryUsage = (long) (memoryMXBean.getHeapMemoryUsage().getMax() * targetMemoryUsagePercent);
+    }
+
+    /**
+     * Allocates heap and metaspace upon exit targetMemoryUsagePercent percents
+     * of heap and metaspace have been consumed.
+     */
+    public void allocateMetaspaceAndHeap() {
+        // Metaspace should be filled before Java Heap to prevent unexpected OOME
+        // in the Java Heap while filling Metaspace
+        allocatedMetaspace = eatMetaspace(targetMemoryUsagePercent);
+        allocatedMemory = allocateGarbage(targetMemoryUsage);
+    }
+
+    private List<Object> eatMetaspace(float targetUsage) {
+        List<Object> list = new ArrayList<>();
+        MemoryPoolMXBean metaspacePool = getMatchedMemoryPool(".*Metaspace.*");
+        float currentUsage;
+        GeneratedClassProducer gp = new GeneratedClassProducer();
+        do {
+            try {
+                list.add(gp.create(0));
+            } catch (OutOfMemoryError oome) {
+                list = null;
+                throw new RuntimeException("Unexpected OOME '" + oome.getMessage() + "' while eating " + targetUsage + " of Metaspace.");
+            }
+            MemoryUsage memoryUsage = metaspacePool.getUsage();
+            currentUsage = (((float) memoryUsage.getUsed()) / memoryUsage.getMax());
+        } while (currentUsage < targetUsage);
+        return list;
+    }
+
+    private MemoryPoolMXBean getMatchedMemoryPool(String patternPoolName) {
+        return ManagementFactory.getMemoryPoolMXBeans().stream()
+                .filter(bean -> bean.getName().matches(patternPoolName))
+                .findFirst()
+                .orElseThrow(() -> new RuntimeException("Cannot find '" + patternPoolName + "' memory pool."));
+    }
+
+    private List<Object> allocateGarbage(long targetMemoryUsage) {
+        List<Object> list = new ArrayList<>();
+        do {
+            try {
+                list.add(new byte[MEMORY_CHUNK]);
+            } catch (OutOfMemoryError e) {
+                list = null;
+                throw new RuntimeException("Unexpected OOME '" + e.getMessage() + "'");
+            }
+        } while (memoryMXBean.getHeapMemoryUsage().getUsed() < targetMemoryUsage);
+        return list;
+    }
+
+    /**
+     * Returns allocation rate for old gen based on appropriate MemoryPoolMXBean
+     * memory usage.
+     *
+     * @return allocation rate
+     */
+    public float getOldGenAllocationRatio() {
+        MemoryPoolMXBean oldGenBean = getMatchedMemoryPool(".*Old.*|.*Tenured.*");
+        MemoryUsage usage = oldGenBean.getUsage();
+        System.out.format("Memory usage for %1s.\n", oldGenBean.getName());
+        System.out.format("Used: %1d\n", usage.getUsed());
+        System.out.format("Commited: %1d\n", usage.getCommitted());
+        System.out.format("Max: %1d\n", usage.getMax());
+        return ((float) usage.getUsed()) / usage.getCommitted();
+    }
+}
diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java
index f2111fa..8457091 100644
--- a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java
+++ b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,6 @@
  */
 package utils;
 
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryPoolMXBean;
-import java.lang.management.MemoryUsage;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -36,11 +33,7 @@
 public class GcProvoker{
 
     // Uses fixed small objects to avoid Humongous objects allocation in G1
-    public static final int MEMORY_CHUNK = 2048;
-    public static final float ALLOCATION_TOLERANCE = 0.05f;
-
-    public static List<Object> allocatedMetaspace;
-    public static List<Object> allocatedMemory;
+    private static final int MEMORY_CHUNK = 2048;
 
     private final Runtime runtime;
 
@@ -61,21 +54,6 @@
         return list;
     }
 
-    private List<Object> allocateAvailableHeap(float targetUsage) {
-        // Calculates size of free memory after allocation with small tolerance.
-        long minFreeMemory = (long) ((1.0 - (targetUsage + ALLOCATION_TOLERANCE)) * runtime.maxMemory());
-        List<Object> list = new ArrayList<>();
-        do {
-            try {
-                list.add(new byte[MEMORY_CHUNK]);
-            } catch (OutOfMemoryError e) {
-                list = null;
-                throw new RuntimeException("Unexpected OOME '" + e.getMessage() + "' while eating " + targetUsage + " of heap memory.");
-            }
-        } while (runtime.freeMemory() > minFreeMemory);
-        return list;
-    }
-
     /**
      * This method provokes a GC
      */
@@ -93,65 +71,7 @@
         }
     }
 
-    /**
-     * Allocates heap and metaspace upon exit not less than targetMemoryUsagePercent percents
-     * of heap and metaspace have been consumed.
-     *
-     * @param targetMemoryUsagePercent how many percent of heap and metaspace to
-     * allocate
-     */
-
-    public void allocateMetaspaceAndHeap(float targetMemoryUsagePercent) {
-        // Metaspace should be filled before Java Heap to prevent unexpected OOME
-        // in the Java Heap while filling Metaspace
-        allocatedMetaspace = eatMetaspace(targetMemoryUsagePercent);
-        allocatedMemory = allocateHeap(targetMemoryUsagePercent);
-    }
-
-    /**
-     * Allocates heap and metaspace upon exit targetMemoryUsagePercent percents
-     * of heap and metaspace have been consumed.
-     *
-     * @param targetMemoryUsagePercent how many percent of heap and metaspace to
-     * allocate
-     */
-    public void allocateAvailableMetaspaceAndHeap(float targetMemoryUsagePercent) {
-        // Metaspace should be filled before Java Heap to prevent unexpected OOME
-        // in the Java Heap while filling Metaspace
-        allocatedMetaspace = eatMetaspace(targetMemoryUsagePercent);
-        allocatedMemory = allocateAvailableHeap(targetMemoryUsagePercent);
-    }
-
-    private List<Object> eatMetaspace(float targetUsage) {
-        List<Object> list = new ArrayList<>();
-        final String metaspacePoolName = "Metaspace";
-        MemoryPoolMXBean metaspacePool = null;
-        for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) {
-            if (pool.getName().contains(metaspacePoolName)) {
-                metaspacePool = pool;
-                break;
-            }
-        }
-        if (metaspacePool == null) {
-            throw new RuntimeException("MXBean for Metaspace pool wasn't found");
-        }
-        float currentUsage;
-        GeneratedClassProducer gp = new GeneratedClassProducer();
-        do {
-            try {
-                list.add(gp.create(0));
-            } catch (OutOfMemoryError oome) {
-                list = null;
-                throw new RuntimeException("Unexpected OOME '" + oome.getMessage() + "' while eating " + targetUsage + " of Metaspace.");
-            }
-            MemoryUsage memoryUsage = metaspacePool.getUsage();
-            currentUsage = (((float) memoryUsage.getUsed()) / memoryUsage.getMax());
-        } while (currentUsage < targetUsage);
-        return list;
-    }
-
     public GcProvoker() {
         runtime = Runtime.getRuntime();
     }
-
 }
diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java
deleted file mode 100644
index 565d86c..0000000
--- a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package utils;
-
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryPoolMXBean;
-import java.lang.management.MemoryUsage;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * Utilities to provoke GC in various ways
- */
-public class GcProvokerImpl implements GcProvoker {
-
-    private static List<Object> eatenMetaspace;
-    private static List<Object> eatenMemory;
-
-    static List<Object> eatHeapMemory(float targetUsage) {
-        long maxMemory = Runtime.getRuntime().maxMemory();
-        // uses fixed small objects to avoid Humongous objects allocation in G1
-        int memoryChunk = 2048;
-        List<Object> list = new ArrayList<>();
-        long used = 0;
-        long target = (long) (maxMemory * targetUsage);
-        while (used < target) {
-            try {
-                list.add(new byte[memoryChunk]);
-                used += memoryChunk;
-            } catch (OutOfMemoryError e) {
-                list = null;
-                throw new RuntimeException("Unexpected OOME '" + e.getMessage() + "' while eating " + targetUsage + " of heap memory.");
-            }
-        }
-        return list;
-    }
-
-    @Override
-    public void provokeGc() {
-        for (int i = 0; i < 3; i++) {
-            long edenSize = Pools.getEdenCommittedSize();
-            long heapSize = Pools.getHeapCommittedSize();
-            float targetPercent = ((float) edenSize) / (heapSize);
-            if ((targetPercent < 0) || (targetPercent > 1.0)) {
-                throw new RuntimeException("Error in the percent calculation" + " (eden size: " + edenSize + ", heap size: " + heapSize + ", calculated eden percent: " + targetPercent + ")");
-            }
-            eatHeapMemory(targetPercent);
-            eatHeapMemory(targetPercent);
-            System.gc();
-        }
-    }
-
-    @Override
-    public void eatMetaspaceAndHeap(float targetMemoryUsagePercent) {
-        // Metaspace should be filled before Java Heap to prevent unexpected OOME
-        // in the Java Heap while filling Metaspace
-        eatenMetaspace = eatMetaspace(targetMemoryUsagePercent);
-        eatenMemory = eatHeapMemory(targetMemoryUsagePercent);
-    }
-
-    private static List<Object> eatMetaspace(float targetUsage) {
-        List<Object> list = new ArrayList<>();
-        final String metaspacePoolName = "Metaspace";
-        MemoryPoolMXBean metaspacePool = null;
-        for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) {
-            if (pool.getName().contains(metaspacePoolName)) {
-                metaspacePool = pool;
-                break;
-            }
-        }
-        if (metaspacePool == null) {
-            throw new RuntimeException("MXBean for Metaspace pool wasn't found");
-        }
-        float currentUsage;
-        GeneratedClassProducer gp = new GeneratedClassProducer();
-        do {
-            try {
-                list.add(gp.create(0));
-            } catch (OutOfMemoryError oome) {
-                list = null;
-                throw new RuntimeException("Unexpected OOME '" + oome.getMessage() + "' while eating " + targetUsage + " of Metaspace.");
-            }
-            MemoryUsage memoryUsage = metaspacePool.getUsage();
-            currentUsage = (((float) memoryUsage.getUsed()) / memoryUsage.getMax());
-        } while (currentUsage < targetUsage);
-        return list;
-    }
-
-    public GcProvokerImpl() {
-    }
-
-}
diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java
index 6ac62fa..350a2a6 100644
--- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java
+++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,7 @@
     /**
      * Checks the overall consistency of the results reported by the tool
      */
+    @Override
     public void assertConsistency() {
 
         // Check exit code
@@ -117,8 +118,6 @@
         float MC = getFloatValue("MC");
         assertThat(MC >= MCMN, "MC < MCMN (generation capacity < min generation capacity)");
         assertThat(MC <= MCMX, "MGC > MCMX (generation capacity > max generation capacity)");
-
-
     }
 
     /**
@@ -139,21 +138,4 @@
         }
         return false;
     }
-
-    private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f;
-
-    private static boolean checkFloatIsSum(float sum, float... floats) {
-        for (float f : floats) {
-            sum -= f;
-        }
-
-        return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE;
-    }
-
-    private void assertThat(boolean b, String message) {
-        if (!b) {
-            throw new RuntimeException(message);
-        }
-    }
-
 }
diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java
index 3bb708d..cf435f8 100644
--- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java
+++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,7 @@
     /**
      * Checks the overall consistency of the results reported by the tool
      */
+    @Override
     public void assertConsistency() {
 
         assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode());
@@ -83,21 +84,4 @@
         assertThat(checkFloatIsSum(GCT, YGCT, FGCT), "GCT != (YGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT
                 + ", FGCT = " + FGCT + ", (YCGT + FGCT) = " + (YGCT + FGCT) + ")");
     }
-
-    private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f;
-
-    private static boolean checkFloatIsSum(float sum, float... floats) {
-        for (float f : floats) {
-            sum -= f;
-        }
-
-        return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE;
-    }
-
-    private void assertThat(boolean b, String message) {
-        if (!b) {
-            throw new RuntimeException(message);
-        }
-    }
-
 }
diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java
index 24ff449..ca3c04a 100644
--- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java
+++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,6 +54,7 @@
     /**
      * Checks the overall consistency of the results reported by the tool
      */
+    @Override
     public void assertConsistency() {
 
         assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode());
@@ -84,10 +85,4 @@
         int MTT = getIntValue("MTT");
         assertThat(TT <= MTT, "TT > MTT (tenuring threshold > maximum tenuring threshold)");
     }
-
-    private void assertThat(boolean b, String message) {
-        if (!b) {
-            throw new RuntimeException(message);
-        }
-    }
 }
diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java
index 9590541..7b736d9 100644
--- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java
+++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,6 +61,7 @@
     /**
      * Checks the overall consistency of the results reported by the tool
      */
+    @Override
     public void assertConsistency() {
 
         assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode());
@@ -112,21 +113,4 @@
         assertThat(checkFloatIsSum(GCT, YGCT, FGCT), "GCT != (YGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT
                 + ", FGCT = " + FGCT + ", (YCGT + FGCT) = " + (YGCT + FGCT) + ")");
     }
-
-    private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f;
-
-    private static boolean checkFloatIsSum(float sum, float... floats) {
-        for (float f : floats) {
-            sum -= f;
-        }
-
-        return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE;
-    }
-
-    private void assertThat(boolean b, String message) {
-        if (!b) {
-            throw new RuntimeException(message);
-        }
-    }
-
 }
diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java
index d4f9610..f628a27 100644
--- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java
+++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
  */
 abstract public class JstatResults extends ToolResults {
 
+    private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f;
+
     public JstatResults(ToolResults rawResults) {
         super(rawResults);
     }
@@ -110,38 +112,61 @@
      * space has been utilized
      */
     public static void assertSpaceUtilization(JstatResults measurement, float targetMemoryUsagePercent) {
+        assertSpaceUtilization(measurement, targetMemoryUsagePercent, targetMemoryUsagePercent);
+    }
+
+    /**
+     * Helper function to assert the utilization of the space
+     *
+     * @param measurement - measurement results to analyze
+     * @param targetMetaspaceUsagePercent -assert that not less than this amount
+     * of metaspace has been utilized
+     * @param targetOldSpaceUsagePercent -assert that not less than this amount
+     * of old space has been utilized
+     */
+    public static void assertSpaceUtilization(JstatResults measurement, float targetMetaspaceUsagePercent,
+            float targetOldSpaceUsagePercent) {
 
         if (measurement.valueExists("OU")) {
             float OC = measurement.getFloatValue("OC");
             float OU = measurement.getFloatValue("OU");
-            assertThat((OU / OC) > targetMemoryUsagePercent, "Old space utilization should be > "
-                    + (targetMemoryUsagePercent * 100) + "%, actually OU / OC = " + (OU / OC));
+            assertThat((OU / OC) > targetOldSpaceUsagePercent, "Old space utilization should be > "
+                    + (targetOldSpaceUsagePercent * 100) + "%, actually OU / OC = " + (OU / OC));
         }
 
         if (measurement.valueExists("MU")) {
             float MC = measurement.getFloatValue("MC");
             float MU = measurement.getFloatValue("MU");
-            assertThat((MU / MC) > targetMemoryUsagePercent, "Metaspace utilization should be > "
-                    + (targetMemoryUsagePercent * 100) + "%, actually MU / MC = " + (MU / MC));
+            assertThat((MU / MC) > targetMetaspaceUsagePercent, "Metaspace utilization should be > "
+                    + (targetMetaspaceUsagePercent * 100) + "%, actually MU / MC = " + (MU / MC));
         }
 
         if (measurement.valueExists("O")) {
             float O = measurement.getFloatValue("O");
-            assertThat(O > targetMemoryUsagePercent * 100, "Old space utilization should be > "
-                    + (targetMemoryUsagePercent * 100) + "%, actually O = " + O);
+            assertThat(O > targetOldSpaceUsagePercent * 100, "Old space utilization should be > "
+                    + (targetOldSpaceUsagePercent * 100) + "%, actually O = " + O);
         }
 
         if (measurement.valueExists("M")) {
             float M = measurement.getFloatValue("M");
-            assertThat(M > targetMemoryUsagePercent * 100, "Metaspace utilization should be > "
-                    + (targetMemoryUsagePercent * 100) + "%, actually M = " + M);
+            assertThat(M > targetMetaspaceUsagePercent * 100, "Metaspace utilization should be > "
+                    + (targetMetaspaceUsagePercent * 100) + "%, actually M = " + M);
         }
     }
 
-    private static void assertThat(boolean result, String message) {
+    public static void assertThat(boolean result, String message) {
         if (!result) {
             throw new RuntimeException(message);
         }
     }
 
+    public static boolean checkFloatIsSum(float sum, float... floats) {
+        for (float f : floats) {
+            sum -= f;
+        }
+
+        return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE;
+    }
+
+    abstract public void assertConsistency();
 }
diff --git a/hotspot/test/test_env.sh b/hotspot/test/test_env.sh
index 43d1a76..0c300d4 100644
--- a/hotspot/test/test_env.sh
+++ b/hotspot/test/test_env.sh
@@ -214,6 +214,11 @@
 then
   VM_CPU="aarch64"
 fi
+grep "arm64" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+  VM_CPU="aarch64"
+fi
 export VM_TYPE VM_BITS VM_OS VM_CPU
 echo "VM_TYPE=${VM_TYPE}"
 echo "VM_BITS=${VM_BITS}"
diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
index 36e6dde..f5347cd 100644
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -151,8 +151,9 @@
         if (id >= Utils.COMPILE_THE_WORLD_START_AT) {
             try {
                 Class<?> aClass = loader.loadClass(name);
-                if (name != "sun.reflect.misc.Trampoline"
-                        && name != "sun.tools.jconsole.OutputViewer") { // workaround for JDK-8159155
+                if (!"sun.reflect.misc.Trampoline".equals(name)
+                        // workaround for JDK-8159155
+                        && !"sun.tools.jconsole.OutputViewer".equals(name)) {
                     UNSAFE.ensureClassInitialized(aClass);
                 }
                 CompileTheWorld.OUT.printf("[%d]\t%s%n", id, name);
diff --git a/hotspot/test/testlibrary/jittester/Makefile b/hotspot/test/testlibrary/jittester/Makefile
index 14f0cb3..e4dd97c 100644
--- a/hotspot/test/testlibrary/jittester/Makefile
+++ b/hotspot/test/testlibrary/jittester/Makefile
@@ -108,7 +108,7 @@
 	$(shell if [ ! -d $(CLASSES_DIR) ]; then mkdir -p $(CLASSES_DIR); fi)
 
 install: clean_testbase testgroup testroot copytestlibrary copyaot JAR cleantmp
-	$(JAVA) --add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED -ea -jar $(DIST_JAR) $(APPLICATION_ARGS)
+	$(JAVA) --add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -ea -jar $(DIST_JAR) $(APPLICATION_ARGS)
 
 clean_testbase:
 	@rm -rf $(TESTBASE_DIR)
diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java
index 3974f07..952e341 100644
--- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java
+++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java
@@ -43,6 +43,7 @@
     protected final Path generatorDir;
     protected final Function<String, String[]> preRunActions;
     protected final String jtDriverOptions;
+    private static final String DISABLE_WARNINGS = "-XX:-PrintWarnings";
 
     protected TestsGenerator(String suffix) {
         this(suffix, s -> new String[0], "");
@@ -57,8 +58,8 @@
 
     protected void generateGoldenOut(String mainClassName) {
         String classPath = getRoot() + File.pathSeparator + generatorDir;
-        ProcessBuilder pb = new ProcessBuilder(JAVA, "-Xint", "-Xverify", "-cp", classPath,
-                mainClassName);
+        ProcessBuilder pb = new ProcessBuilder(JAVA, "-Xint", DISABLE_WARNINGS, "-Xverify",
+                "-cp", classPath, mainClassName);
         String goldFile = mainClassName + ".gold";
         try {
             runProcess(pb, generatorDir.resolve(goldFile).toString());
@@ -128,6 +129,8 @@
                   .append("\n");
         }
         header.append(" * @run driver jdk.test.lib.jittester.jtreg.JitTesterDriver ")
+              .append(DISABLE_WARNINGS)
+              .append(" ")
               .append(jtDriverOptions)
               .append(" ")
               .append(mainClassName)
diff --git a/hotspot/test/testlibrary_tests/ctw/CtwTest.java b/hotspot/test/testlibrary_tests/ctw/CtwTest.java
index eb6aedc..514df0e 100644
--- a/hotspot/test/testlibrary_tests/ctw/CtwTest.java
+++ b/hotspot/test/testlibrary_tests/ctw/CtwTest.java
@@ -37,6 +37,7 @@
 import java.nio.file.StandardCopyOption;
 import java.nio.charset.Charset;
 
+import jdk.test.lib.Platform;
 import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
@@ -93,7 +94,12 @@
         // concat CTW_COMMAND and args w/o 0th element
         String[] cmd = Arrays.copyOf(CTW_COMMAND, CTW_COMMAND.length + args.length - 1);
         System.arraycopy(args, 1, cmd, CTW_COMMAND.length, args.length - 1);
-
+        if (Platform.isWindows()) {
+            // '*' has to be escaped on windows
+            for (int i = 0; i < cmd.length; ++i) {
+                cmd[i] = cmd[i].replace("*", "\"*\"");
+            }
+        }
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, cmd);
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         dump(output, "compile");
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index b130a70..c94b3ee 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -401,3 +401,12 @@
 7a532a9a227137155b905341d4b99939db51220e jdk-9+153
 34af95c7dbff74f3448fcdb7d745524e8a1cc88a jdk-9+154
 9b9918656c97724fd89c04a8547043bbd37f5935 jdk-9+155
+7c829eba781409b4fe15392639289af1553dcf63 jdk-9+156
+b7e70e1e0154e1d2c69f814e03a8800ef8634fe0 jdk-9+157
+e53b322357382209fb553b9a1541ccfd12cbcb6c jdk-9+158
+0ea34706c7fa5cd71accd493eb4f54262e4a5f4e jdk-9+159
+6bff08fd5d217549aec10a20007378e52099be6c jdk-9+160
+7d5352c54fc802b3301d8433b6b2b2a92b616630 jdk-9+161
+b8aebe5292f23689f97cb8e66a9f327834dd43e6 jdk-9+162
+3890f96e8995be8c84f330d1f65269b03ac36b24 jdk-9+163
+1a52de2da827459e866fd736f9e9c62eb2ecd6bb jdk-9+164
diff --git a/jaxws/README b/jaxws/README
deleted file mode 100644
index 4d65125..0000000
--- a/jaxws/README
+++ /dev/null
@@ -1,19 +0,0 @@
-README:
-  
-  This file should be located at the top of the Mercurial repository.
-
-  See http://openjdk.java.net/ for more information about the OpenJDK.
-
-  See ../README-builds.html for complete details on build machine requirements.
-
-Simple Build Instructions:
-  This repository can be loaded as a NetBeans project, built with ant, or
-  built with GNU make, e.g.
-    ant
-       -OR-
-    cd make && gnumake
-     
-  The built files that will be imported into the jdk build will be in the 
-  "dist" directory.
-  Help information is available by running "ant -projecthelp" or "make help".
-
diff --git a/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default b/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default
index 0c22eb2..1b4056b 100644
--- a/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default
+++ b/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default
@@ -7,6 +7,7 @@
 image/ief		ief
 image/jpeg		jpeg jpg jpe JPG
 image/tiff		tiff tif
+image/png		png PNG
 image/x-xwindowdump	xwd
 application/postscript	ai eps ps
 application/rtf		rtf
diff --git a/jaxws/src/java.activation/share/classes/module-info.java b/jaxws/src/java.activation/share/classes/module-info.java
index 00d40e1..8132ff6 100644
--- a/jaxws/src/java.activation/share/classes/module-info.java
+++ b/jaxws/src/java.activation/share/classes/module-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,11 @@
 
 /**
  * Defines the JavaBeans Activation Framework (JAF) API.
+ *
+ * @moduleGraph
+ * @since 9
  */
+@Deprecated(since="9", forRemoval=true)
 module java.activation {
     requires transitive java.datatransfer;
     requires java.logging;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java
index 2f4da84..0406d5b 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,9 +54,7 @@
     public Object[] getArguments();
     public String getResourceBundleName();
 
-    public default ResourceBundle getResourceBundle(Locale locale) {
-        return null;
-    }
+    public ResourceBundle getResourceBundle(Locale locale);
 
     /**
      * Special constant that represents a message that
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java
index 1d7ace5..747110e 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 import java.util.Locale;
 import java.util.ResourceBundle;
 
+
 /**
  * @author WS Development Team
  */
@@ -42,13 +43,9 @@
     private final String _key;
     private final Object[] _args;
 
+    @Deprecated
     public LocalizableMessage(String bundlename, String key, Object... args) {
-        _bundlename = bundlename;
-        _rbSupplier = null;
-        _key = key;
-        if(args==null)
-            args = new Object[0];
-        _args = args;
+        this(bundlename, null, key, args);
     }
 
     public LocalizableMessage(String bundlename, ResourceBundleSupplier rbSupplier,
@@ -61,15 +58,17 @@
         _args = args;
     }
 
-
+    @Override
     public String getKey() {
         return _key;
     }
 
+    @Override
     public Object[] getArguments() {
         return Arrays.copyOf(_args, _args.length);
     }
 
+    @Override
     public String getResourceBundleName() {
         return _bundlename;
     }
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java
index bf8a28b..e4d5a12 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
     private final String _bundlename;
     private final ResourceBundleSupplier _rbSupplier;
 
+    @Deprecated
     public LocalizableMessageFactory(String bundlename) {
         _bundlename = bundlename;
         _rbSupplier = null;
@@ -58,4 +59,5 @@
          */
         ResourceBundle getResourceBundle(Locale locale);
     }
+
 }
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java
index 2f78673..a0436be 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 
 package com.sun.istack.internal.localization;
 
-import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier;
 import java.text.MessageFormat;
 import java.util.HashMap;
 import java.util.Locale;
@@ -41,7 +40,7 @@
 public class Localizer {
 
     private final Locale _locale;
-    private final HashMap _resourceBundles;
+    private final HashMap<String, ResourceBundle> _resourceBundles;
 
     public Localizer() {
         this(Locale.getDefault());
@@ -49,7 +48,7 @@
 
     public Localizer(Locale l) {
         _locale = l;
-        _resourceBundles = new HashMap();
+        _resourceBundles = new HashMap<>();
     }
 
     public Locale getLocale() {
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java
index e0fb446..f9f0b7a 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
 
 package com.sun.istack.internal.localization;
 
+import java.util.Locale;
+import java.util.ResourceBundle;
+
 /**
  * {@link Localizable} that wraps a non-localizable string.
  *
@@ -39,13 +42,20 @@
         this.msg = msg;
     }
 
+    @Override
     public String getKey() {
         return Localizable.NOT_LOCALIZABLE;
     }
+    @Override
     public Object[] getArguments() {
         return new Object[]{msg};
     }
+    @Override
     public String getResourceBundleName() {
         return "";
     }
+    @Override
+    public ResourceBundle getResourceBundle(Locale locale) {
+        return null;
+    }
 }
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java
index a27f082..fcf907d 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -533,4 +533,14 @@
      * @since 2.2.6
      */
     public static final String DISABLE_XML_SECURITY  = "com.sun.xml.internal.bind.disableXmlSecurity";
+
+    /**
+     * If true and element namespace is not specified, namespace of parent element will be used.
+     * The default value is false.
+     *
+     * Boolean
+     * @since 2.3.0
+     */
+    public static final String BACKUP_WITH_PARENT_NAMESPACE = "com.sun.xml.internal.bind.backupWithParentNamespace";
+
 }
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java
index a18f79e..73fe277 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -112,6 +112,8 @@
                 "is not active.  Using JAXB's implementation");
         }
 
+        Boolean backupWithParentNamespace = getPropertyValue(properties, JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE, Boolean.class);
+
         RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class);
 
         Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class);
@@ -144,6 +146,7 @@
         builder.setSupressAccessorWarnings(supressAccessorWarnings);
         builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling);
         builder.setDisableSecurityProcessing(disablesecurityProcessing);
+        builder.setBackupWithParentNamespace(backupWithParentNamespace);
         return builder.build();
     }
 
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java
new file mode 100644
index 0000000..848316f
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Code that deals with low level byte code manipulation.
+ */
+package com.sun.xml.internal.bind.v2.bytecode;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html
deleted file mode 100644
index 092f6f3..0000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-
-
-<body>
-  Code that deals with low level byte code manipulation.
-</body>
-</html>
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java
new file mode 100644
index 0000000..4032893
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Abstraction around reading annotations, to support internal/external annotations.
+ */
+package com.sun.xml.internal.bind.v2.model.annotation;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html
deleted file mode 100644
index acc9be7..0000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-  Abstraction around reading annotations, to support internal/external annotations.
-</body></html>
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java
index 5b97093..c584056 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,24 +29,25 @@
 
 /**
  * listen to static errors found during building a JAXB model from a set of classes.
- * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}.
+ * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}.
  *
  * <p>
  * All the static errors have to be reported while constructing a
- * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder#link} completes.
- * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder} wraps an {@link ErrorHandler} and all the model
+ * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} completes.
+ * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} wraps an {@link ErrorHandler} and all the model
  * components should report errors through it.
  *
  * <p>
  * {@link IllegalAnnotationException} is a checked exception to remind
  * the model classes to report it rather than to throw it.
  *
- * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilder
+ * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI
  * @author Kohsuke Kawaguchi
  */
 public interface ErrorHandler {
     /**
      * Receives a notification for an error in the annotated code.
+     * @param e
      */
     void error( IllegalAnnotationException e );
 }
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java
index c3406b7..83caf8f 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@
     public final boolean isOrdered;
 
     /**
-     * {@link com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to
+     * {@code com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to
      * {@link #ELEMENT}, {@link #REFERENCE}, and {@link #MAP} in this order.
      */
     public final int propertyIndex;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java
index 794c339..9bfe5e0 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,18 +34,22 @@
  *
  * <p>
  * This interface is only meant to be used as a return type from
- * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}.
+ * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}.
  *
  * @author Kohsuke Kawaguchi
+ * @param <T>
+ * @param <C>
  */
 public interface RegistryInfo<T,C> {
     /**
      * Returns all the references to other types in this registry.
+     * @return
      */
     Set<TypeInfo<T,C>> getReferences();
 
     /**
      * Returns the class with {@link XmlRegistry}.
+     * @return
      */
     C getClazz();
 }
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java
new file mode 100644
index 0000000..68abc10
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Implementation of the com.sun.xml.internal.bind.j2s.model package.
+ */
+package com.sun.xml.internal.bind.v2.model.impl;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html
deleted file mode 100644
index e37eebd..0000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-
-
-<body>
-Implementation of the com.sun.xml.internal.bind.j2s.model package.
-</body>
-</html>
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java
new file mode 100644
index 0000000..ea3b945
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing).
+ */
+package com.sun.xml.internal.bind.v2.model.nav;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html
deleted file mode 100644
index 319f86c..0000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-  Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing).
-</body></html>
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
index 3c91859..5a03996 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -242,6 +242,16 @@
     private Set<XmlNs> xmlNsSet = null;
 
     /**
+     * If true, despite the specification, unmarshall child element with parent namespace, if child namespace is not specified.
+     * The default value is null for System {code}com.sun.xml.internal.bind.backupWithParentNamespace{code} property to be used,
+     * and false is assumed if it's not set either.
+     *
+     * Boolean
+     * @since 2.3.0
+     */
+    public Boolean backupWithParentNamespace = null;
+
+    /**
      * Returns declared XmlNs annotations (from package-level annotation XmlSchema
      *
      * @return set of all present XmlNs annotations
@@ -263,6 +273,7 @@
         this.supressAccessorWarnings = builder.supressAccessorWarnings;
         this.improvedXsiTypeHandling = builder.improvedXsiTypeHandling;
         this.disableSecurityProcessing = builder.disableSecurityProcessing;
+        this.backupWithParentNamespace = builder.backupWithParentNamespace;
 
         Collection<TypeReference> typeRefs = builder.typeRefs;
 
@@ -1024,6 +1035,7 @@
         private boolean allNillable;
         private boolean improvedXsiTypeHandling = true;
         private boolean disableSecurityProcessing = true;
+        private Boolean backupWithParentNamespace = null; // null for System property to be used
 
         public JAXBContextBuilder() {};
 
@@ -1039,6 +1051,7 @@
             this.xmlAccessorFactorySupport = baseImpl.xmlAccessorFactorySupport;
             this.allNillable = baseImpl.allNillable;
             this.disableSecurityProcessing = baseImpl.disableSecurityProcessing;
+            this.backupWithParentNamespace = baseImpl.backupWithParentNamespace;
         }
 
         public JAXBContextBuilder setRetainPropertyInfo(boolean val) {
@@ -1101,6 +1114,11 @@
             return this;
         }
 
+        public JAXBContextBuilder setBackupWithParentNamespace(Boolean backupWithParentNamespace) {
+            this.backupWithParentNamespace = backupWithParentNamespace;
+            return this;
+        }
+
         public JAXBContextImpl build() throws JAXBException {
 
             // fool-proof
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java
new file mode 100644
index 0000000..3ae977b
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Code that implements JAXBContext, Unmarshaller, and Marshaller.
+ */
+package com.sun.xml.internal.bind.v2.runtime;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html
deleted file mode 100644
index 2c45e53..0000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-
-
-<body>
-Code that implements JAXBContext, Unmarshaller, and Marshaller.
-</body>
-</html>
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java
index 1be5995..d215431 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 
     private static final Logger logger = Util.getClassLogger();
 
-    protected static final boolean noOptimize = Runtime.version().major() >= 9 ||
+    protected static final boolean noOptimize =
         Util.getSystemProperty(ClassTailor.class.getName()+".noOptimize")!=null;
 
     static {
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java
index 17c9955..9e00016 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,11 @@
 
 import com.sun.xml.internal.bind.Util;
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+import java.lang.reflect.Field;
+import java.security.CodeSource;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
 
 /**
  * A {@link ClassLoader} used to "inject" optimized accessor classes
@@ -131,7 +136,7 @@
     /**
      * Injected classes keyed by their names.
      */
-    private final Map<String, Class> classes = new HashMap<String, Class>();
+    private final Map<String, Class> classes = new HashMap<>();
     private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
     private final Lock r = rwl.readLock();
     private final Lock w = rwl.writeLock();
@@ -141,26 +146,59 @@
      * False otherwise, which happens if this classloader can't see {@link Accessor}.
      */
     private final boolean loadable;
-    private static final Method defineClass;
-    private static final Method resolveClass;
-    private static final Method findLoadedClass;
+    private static Method defineClass;
+    private static Method resolveClass;
+    private static Method findLoadedClass;
+    private static Object U;
 
     static {
-        Method[] m = AccessController.doPrivileged(
-                new PrivilegedAction<Method[]>() {
-                    @Override
-                    public Method[] run() {
-                        return new Method[]{
-                                getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
-                                getMethod(ClassLoader.class, "resolveClass", Class.class),
-                                getMethod(ClassLoader.class, "findLoadedClass", String.class)
-                        };
-                    }
+        try {
+            Method[] m = AccessController.doPrivileged(
+                    new PrivilegedAction<Method[]>() {
+                @Override
+                public Method[] run() {
+                    return new Method[]{
+                        getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
+                        getMethod(ClassLoader.class, "resolveClass", Class.class),
+                        getMethod(ClassLoader.class, "findLoadedClass", String.class)
+                    };
                 }
-        );
-        defineClass = m[0];
-        resolveClass = m[1];
-        findLoadedClass = m[2];
+            }
+            );
+            defineClass = m[0];
+            resolveClass = m[1];
+            findLoadedClass = m[2];
+        } catch (Throwable t) {
+            try {
+                U = AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                    @Override
+                    public Object run() throws Exception {
+                        Class u = Class.forName("sun.misc.Unsafe");
+                        Field theUnsafe = u.getDeclaredField("theUnsafe");
+                        theUnsafe.setAccessible(true);
+                        return theUnsafe.get(null);
+                    }
+                });
+                defineClass = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>() {
+                    @Override
+                    public Method run() throws Exception {
+                        try {
+                            return U.getClass().getMethod("defineClass",
+                                    new Class[]{String.class,
+                                        byte[].class,
+                                        Integer.TYPE,
+                                        Integer.TYPE,
+                                        ClassLoader.class,
+                                        ProtectionDomain.class});
+                        } catch (NoSuchMethodException | SecurityException ex) {
+                            throw ex;
+                        }
+                    }
+                });
+            } catch (SecurityException | PrivilegedActionException ex) {
+                Logger.getLogger(Injector.class.getName()).log(Level.SEVERE, null, ex);
+            }
+        }
     }
 
     private static Method getMethod(final Class<?> c, final String methodname, final Class<?>... params) {
@@ -210,13 +248,11 @@
             rlocked = false;
 
             //find loaded class from classloader
-            if (c == null) {
+            if (c == null && findLoadedClass != null) {
 
                 try {
                     c = (Class) findLoadedClass.invoke(parent, className.replace('/', '.'));
-                } catch (IllegalArgumentException e) {
-                    logger.log(Level.FINE, "Unable to find " + className, e);
-                } catch (IllegalAccessException e) {
+                } catch (IllegalArgumentException | IllegalAccessException e) {
                     logger.log(Level.FINE, "Unable to find " + className, e);
                 } catch (InvocationTargetException e) {
                     Throwable t = e.getTargetException();
@@ -253,9 +289,13 @@
 
                     // we need to inject a class into the
                     try {
-                        c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length);
-                        resolveClass.invoke(parent, c);
-                    } catch (IllegalAccessException e) {
+                        if (resolveClass != null) {
+                            c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length);
+                            resolveClass.invoke(parent, c);
+                        } else {
+                            c = (Class) defineClass.invoke(U, className.replace('/', '.'), image, 0, image.length, parent, Injector.class.getProtectionDomain());
+                        }
+                    } catch (IllegalAccessException  e) {
                         logger.log(Level.FINE, "Unable to inject " + className, e);
                         return null;
                     } catch (InvocationTargetException e) {
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java
new file mode 100644
index 0000000..70ae20c
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Hosts optimized
+ * {@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor},
+ * {@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and {@link com.sun.xml.internal.bind.v2.runtime.Transducer}.
+ *
+ * <h2>How it works</h2>
+ * <p>
+ * Most of the classes in this package are "templates." At run-time, A template class file is slightly modified to match
+ * the target Java Bean, then it will be loaded into the VM.
+ */
+package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html
deleted file mode 100644
index 9039ffa..0000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-Hosts optimized
-{@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor},
-{@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and
-{@link com.sun.xml.internal.bind.v2.runtime.Transducer}.
-
-<h2>How it works</h2>
-<p>
-  Most of the classes in this package are "templates." At run-time,
-  A template class file is slightly modified to match the target Java Bean,
-  then it will be loaded into the VM.
-</body></html>
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java
new file mode 100644
index 0000000..35dfd4a
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Abstraction around accessing data of actual objects.
+ */
+package com.sun.xml.internal.bind.v2.runtime.reflect;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html
deleted file mode 100644
index 36c5c91..0000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-  Abstraction around accessing data of actual objects.
-</body></html>
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java
index d1e6729..8ae68be 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 import org.w3c.dom.Node;
 
 /**
- * Object that returns the current location that the {@link com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor}
+ * Object that returns the current location that the {@code com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor}
  * is parsing.
  *
  * @author Kohsuke Kawaguchi
@@ -41,6 +41,7 @@
 public interface LocatorEx extends Locator {
     /**
      * Gets the current location in a {@link ValidationEventLocator} object.
+     * @return
      */
     ValidationEventLocator getLocation();
 
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java
index 9becb9d..8141e4e 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,9 @@
 
 import javax.xml.namespace.QName;
 
+import com.sun.xml.internal.bind.Util;
 import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
 import com.sun.xml.internal.bind.v2.WellKnownNamespace;
 import com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl;
 import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
@@ -231,11 +233,26 @@
     @Override
     public void childElement(UnmarshallingContext.State state, TagName arg) throws SAXException {
         ChildLoader child = childUnmarshallers.get(arg.uri,arg.local);
-        if (child == null) {
-            child = catchAll;
-            if (child==null) {
-                super.childElement(state,arg);
-                return;
+        if(child == null) {
+            Boolean backupWithParentNamespace = ((JAXBContextImpl) state.getContext().getJAXBContext()).backupWithParentNamespace;
+                        backupWithParentNamespace = backupWithParentNamespace != null
+                                        ? backupWithParentNamespace
+                                        : Boolean.parseBoolean(Util.getSystemProperty(JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE));
+            if ((beanInfo != null) && (beanInfo.getTypeNames() != null) && backupWithParentNamespace) {
+                Iterator<?> typeNamesIt = beanInfo.getTypeNames().iterator();
+                QName parentQName = null;
+                if ((typeNamesIt != null) && (typeNamesIt.hasNext()) && (catchAll == null)) {
+                    parentQName = (QName) typeNamesIt.next();
+                    String parentUri = parentQName.getNamespaceURI();
+                    child = childUnmarshallers.get(parentUri, arg.local);
+                }
+            }
+            if (child == null) {
+                child = catchAll;
+                if(child==null) {
+                    super.childElement(state,arg);
+                    return;
+                }
             }
         }
 
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java
index fbe7ff5..f7b434e 100644
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,5 +23,8 @@
  * questions.
  */
 
+/**
+ * XML Schema writer generated by TXW.
+ */
 @com.sun.xml.internal.txw2.annotation.XmlNamespace("http://www.w3.org/2001/XMLSchema")
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html
deleted file mode 100644
index cce3c1b..0000000
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-
-
-<body>
-XML Schema writer generated by TXW.
-</body>
-</html>
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java
index d31a1cb..d59b0e4 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -158,7 +158,7 @@
             Class spFactory = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader);
             return newInstance(contextPath, spFactory, classLoader, properties);
         } catch (ClassNotFoundException x) {
-            throw new JAXBException(Messages.format(Messages.PROVIDER_NOT_FOUND, className), x);
+            throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), x);
 
         } catch (RuntimeException | JAXBException x) {
             // avoid wrapping RuntimeException to JAXBException,
@@ -228,7 +228,7 @@
         }
     }
 
-    private static Object instantiateProviderIfNecessary(Class<?> implClass) throws JAXBException {
+    private static Object instantiateProviderIfNecessary(final Class<?> implClass) throws JAXBException {
         try {
             if (JAXBContextFactory.class.isAssignableFrom(implClass)) {
                 return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
@@ -254,7 +254,7 @@
         try {
             spi = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, getContextClassLoader());
         } catch (ClassNotFoundException e) {
-            throw new JAXBException(e);
+            throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), e);
         }
 
         if (logger.isLoggable(Level.FINE)) {
@@ -525,6 +525,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return Thread.currentThread().getContextClassLoader();
                         }
@@ -539,6 +540,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return c.getClassLoader();
                         }
@@ -552,6 +554,7 @@
         } else {
             return (ClassLoader) java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
+                        @Override
                         public java.lang.Object run() {
                             return ClassLoader.getSystemClassLoader();
                         }
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java
index a1ebb81..79ede4f 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,6 +65,9 @@
     static final String PROVIDER_NOT_FOUND = // 1 arg
         "ContextFinder.ProviderNotFound";
 
+    static final String DEFAULT_PROVIDER_NOT_FOUND = // 0 args
+        "ContextFinder.DefaultProviderNotFound";
+
     static final String COULD_NOT_INSTANTIATE = // 2 args
         "ContextFinder.CouldNotInstantiate";
 
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties
index e6a930d..548001a 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,9 @@
 ContextFinder.ProviderNotFound = \
         Provider {0} not found
 
+ContextFinder.DefaultProviderNotFound = \
+        Implementation of JAXB-API has not been found on module path or classpath.
+
 ContextFinder.CouldNotInstantiate = \
         Provider {0} could not be instantiated: {1}
 
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java
new file mode 100644
index 0000000..d52ab7f
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * {@link javax.xml.bind.annotation.adapters.XmlAdapter} and its spec-defined
+ * sub-classes to allow arbitrary Java classes to be used with JAXB.
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="http://jcp.org/en/jsr/detail?id=222">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="http://jaxb.java.net">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="http://jaxb.java.net">JAXB Website</a>
+ */
+package javax.xml.bind.annotation.adapters;
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/helpers/package-info.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/helpers/package-info.java
new file mode 100644
index 0000000..c5c0bec
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/helpers/package-info.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * <B>JAXB Provider Use Only:</b> Provides partial default implementations for
+ * some of the <code>javax.xml.bind</code> interfaces.
+ * <p>
+ * <p>
+ * JAXB Providers can extend these classes and implement the abstract
+ * methods.
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="https://jaxb.java.net/">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="https://jaxb.java.net/">JAXB Website</a>
+ */
+package javax.xml.bind.helpers;
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/package-info.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/package-info.java
new file mode 100644
index 0000000..aa6ff57
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/package-info.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides a runtime binding framework for client applications including
+ * unmarshalling, marshalling, and validation capabilities.
+ * <p>
+ * <p>
+ * <code>JAXBContext</code> is the client-entry point to the runtime binding
+ * framework.
+ * <p>
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="https://jaxb.java.net/">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="https://jaxb.java.net/">JAXB Website</a>
+ */
+package javax.xml.bind;
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/util/package-info.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/util/package-info.java
new file mode 100644
index 0000000..229d434
--- /dev/null
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/util/package-info.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Useful client utility classes.
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="https://jaxb.java.net/">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="https://jaxb.java.net/">JAXB Website</a>
+ */
+package javax.xml.bind.util;
diff --git a/jaxws/src/java.xml.bind/share/classes/module-info.java b/jaxws/src/java.xml.bind/share/classes/module-info.java
index 1a6abaf..c871b6f 100644
--- a/jaxws/src/java.xml.bind/share/classes/module-info.java
+++ b/jaxws/src/java.xml.bind/share/classes/module-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,18 @@
 
 /**
  * Defines the Java Architecture for XML Binding (JAXB) API.
+ *
+ * @moduleGraph
+ * @since 9
  */
+@Deprecated(since="9", forRemoval=true)
 module java.xml.bind {
     requires transitive java.activation;
     requires transitive java.xml;
     requires java.compiler;
     requires java.desktop;
     requires java.logging;
+    requires jdk.unsupported;
 
     uses javax.xml.bind.JAXBContextFactory;
 
diff --git a/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java b/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java
index 58a6259..6a16a31 100644
--- a/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java
+++ b/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java
@@ -26,7 +26,11 @@
 /**
  * Defines a subset of the Common Annotations API to support programs running
  * on the Java SE Platform.
+ *
+ * @moduleGraph
+ * @since 9
  */
+@Deprecated(since="9", forRemoval=true)
 module java.xml.ws.annotation {
     exports javax.annotation;
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java
index 151ae98..9136b3e 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,8 +39,7 @@
 public interface LazyEnvelopeSource extends javax.xml.transform.Source {
     /**
      * Retrieve payload qname without materializing its contents
-     * @return
-     * @throws SOAPException
+     * @return payload QName
      */
     public QName getPayloadQName();
     public XMLStreamReader readToBodyStarTag() throws XMLStreamException;
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java
index 7adf460..2d98512 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,6 +86,7 @@
     /**
      * Constructs a <code>SOAPExceptionImpl</code> object initialized
      * with the given <code>Throwable</code> object.
+     * @param cause cause
      */
     public SOAPExceptionImpl(Throwable cause) {
         super (cause.toString());
@@ -106,6 +107,7 @@
      *         message of the embedded <code>Throwable</code> object,
      *         if there is one
      */
+    @Override
     public String getMessage() {
         String message = super.getMessage ();
         if (message == null && cause != null) {
@@ -124,6 +126,7 @@
      *         if there is none
      */
 
+    @Override
     public Throwable getCause() {
         return cause;
     }
@@ -157,6 +160,7 @@
      *         method has already been called on this <code>SOAPExceptionImpl</code>
      *         object
      */
+    @Override
     public synchronized Throwable initCause(Throwable cause)
     {
         if(this.cause != null) {
@@ -170,6 +174,7 @@
         return this;
     }
 
+    @Override
     public void printStackTrace() {
         super.printStackTrace();
         if (cause != null) {
@@ -178,6 +183,7 @@
         }
     }
 
+    @Override
     public void printStackTrace(PrintStream s) {
         super.printStackTrace(s);
         if (cause != null) {
@@ -186,6 +192,7 @@
         }
     }
 
+    @Override
     public void printStackTrace(PrintWriter s) {
         super.printStackTrace(s);
         if (cause != null) {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
index 4ff655a..a032c58 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -512,9 +512,13 @@
                         : httpConnection.getInputStream());
                 // If no reply message is returned,
                 // content-Length header field value is expected to be zero.
-                // InputStream#available() can't be used here - it just says no data *YET*!
+                // java SE 6 documentation says :
+                // available() : an estimate of the number of bytes that can be read
+                //(or skipped over) from this input stream without blocking
+                //or 0 when it reaches the end of the input stream.
                 if ((httpIn == null )
-                        || (httpConnection.getContentLength() == 0)) {
+                        || (httpConnection.getContentLength() == 0)
+                        || (httpIn.available() == 0)) {
                     response = null;
                     log.warning("SAAJ0014.p2p.content.zero");
                 } else {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java
index ee23205..f21f3d0 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@
      * @return          the MimeBodyPart
      * @exception       IndexOutOfBoundsException if the given index
      *                  is out of range.
-     * @exception       MessagingException
+     * @exception       MessagingException thrown in case of error
      */
     public MimeBodyPart getBodyPart(int index) throws MessagingException;
 
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java
index 34066fc..96a7702 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -115,6 +115,8 @@
      * <code>contentType</code> field. <p>
      *
      * MimeBodyParts may be added later.
+     *
+     * @param subtype subtype.
      */
     public BMMimeMultipart(String subtype) {
         super(subtype);
@@ -142,7 +144,9 @@
      * skips the 'preamble' and reads bytes till the terminating
      * boundary and creates MimeBodyParts for each part of the stream.
      *
-     * @param   ds      DataSource, can be a MultipartDataSource
+     * @param   ds      DataSource, can be a MultipartDataSource.
+     * @param   ct      content type.
+     * @exception MessagingException in case of error.
      */
     public BMMimeMultipart(DataSource ds, ContentType ct)
         throws MessagingException {
@@ -197,6 +201,7 @@
      *
      * @since   JavaMail 1.2
      */
+    @Override
     protected  void parse() throws  MessagingException {
         if (parsed)
             return;
@@ -694,6 +699,7 @@
      * separated by a boundary.
      */
 
+    @Override
     public void writeTo(OutputStream os)
             throws IOException, MessagingException {
 
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java
index 448cb04..eab9119 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -100,6 +100,7 @@
     /**
      * Return the specified parameter value. Returns <code>null</code>
      * if this parameter is absent.
+     * @param name parameter name.
      * @return  parameter value
      * @since           JavaMail 1.2
      */
@@ -123,7 +124,7 @@
 
     /**
      * Set the primary type. Overrides existing primary type.
-     * @param   primaryType     primary type
+     * @param   disposition disposition value
      * @since           JavaMail 1.2
      */
     public void setDisposition(String disposition) {
@@ -162,6 +163,7 @@
      * @return  RFC2045 style string
      * @since           JavaMail 1.2
      */
+    @Override
     public String toString() {
         if (disposition == null)
             return null;
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
index 4cbbae3..1fc677d 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -136,6 +136,7 @@
     /**
      * Return the specified parameter value. Returns <code>null</code>
      * if this parameter is absent.
+     * @param name parameter name
      * @return  parameter value
      */
     public String getParameter(String name) {
@@ -200,6 +201,7 @@
      *
      * @return  RFC2045 style string
      */
+    @Override
     public String toString() {
         if (primaryType == null || subType == null) // need both
             return null;
@@ -218,7 +220,7 @@
     /**
      * Match with the specified ContentType object. This method
      * compares <strong>only the <code>primaryType</code> and
-     * <code>subType</code> </strong>. The parameters of both operands
+     * <code>primaryType</code> </strong>. The parameters of both operands
      * are ignored. <p>
      *
      * For example, this method will return <code>true</code> when
@@ -232,6 +234,8 @@
      * and <strong>"text/*" </strong>
      *
      * @param   cType to compare this against
+     * @return true if <code>primaryType</code> and <code>subType</code>
+     * match specified content type.
      */
     public boolean match(ContentType cType) {
         // Match primaryType
@@ -266,6 +270,10 @@
      * For example, this method will return <code>true</code> when
      * comparing the ContentType for <strong>"text/plain"</strong>
      * with <strong>"text/*" </strong>
+     *
+     * @param s content type
+     * @return true if <code>primaryType</code> and <code>subType</code>
+     * match specified content type.
      */
     public boolean match(String s) {
         try {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java
index 4620bb0..0d9ee4e 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,14 +95,15 @@
          * one of the following:
          * <ul>
          * <li><code>ATOM</code> A sequence of ASCII characters
-         *      delimited by either SPACE, CTL, "(", <"> or the
-         *      specified SPECIALS
+         *      delimited by either SPACE, CTL, "(", &lt;"&gt; or the
+         *      specified SPECIALS</li>
          * <li><code>QUOTEDSTRING</code> A sequence of ASCII characters
-         *      within quotes
+         *      within quotes</li>
          * <li><code>COMMENT</code> A sequence of ASCII characters
-         *      within "(" and ")".
-         * <li><code>EOF</code> End of header
+         *      within "(" and ")".</li>
+         * <li><code>EOF</code> End of header</li>
          * </ul>
+         * @return type
          */
         public int getType() {
             return type;
@@ -176,6 +177,7 @@
      * Constructor. The RFC822 defined delimiters - RFC822 - are
      * used to delimit ATOMS. Also comments are skipped and not
      * returned as tokens
+     * @param header The header that is tokenized.
      */
     public HeaderTokenizer(String header)  {
         this(header, RFC822);
@@ -317,7 +319,7 @@
             currentPos++; // re-position currentPos
             char ch[] = new char[1];
             ch[0] = c;
-            return new Token((int)c, new String(ch));
+            return new Token(c, new String(ch));
         }
 
         // Check for ATOM
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java
index bf39ee7..84616c8 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,13 +48,12 @@
  * until the blank line that indicates end of header. The input stream
  * is positioned at the start of the body. The lines are stored
  * within the object and can be extracted as either Strings or
- * {@link Header} objects. <p>
- * <p/>
+ * {@link Header} objects.
+ * <p>
  * This class is mostly intended for service providers. MimeMessage
- * and MimeBody use this class for holding their headers. <p>
- * <p/>
- * <hr> <strong>A note on RFC822 and MIME headers</strong><p>
- * <p/>
+ * and MimeBody use this class for holding their headers.
+ * <hr> <strong>A note on RFC822 and MIME headers</strong>
+ * <p>
  * RFC822 and MIME header fields <strong>must</strong> contain only
  * US-ASCII characters. If a header contains non US-ASCII characters,
  * it must be encoded as per the rules in RFC 2047. The MimeUtility
@@ -65,7 +64,7 @@
  * header fields must be folded (wrapped) before being sent if they
  * exceed the line length limitation for the transport (1000 bytes for
  * SMTP).  Received headers may have been folded.  The application is
- * responsible for folding and unfolding headers as appropriate. <p>
+ * responsible for folding and unfolding headers as appropriate.
  *
  * @author John Mani
  * @author Bill Shannon
@@ -90,12 +89,13 @@
      * Read and parse the given RFC822 message stream till the
      * blank line separating the header from the body. The input
      * stream is left positioned at the start of the body. The
-     * header lines are stored internally. <p>
-     * <p/>
+     * header lines are stored internally.
+     * <p>
      * For efficiency, wrap a BufferedInputStream around the actual
      * input stream and pass it as the parameter.
      *
      * @param   is RFC822 input stream
+     * @exception MessagingException in case of error
      */
     public InternetHeaders(InputStream is) throws MessagingException {
         load(is);
@@ -104,13 +104,14 @@
     /**
      * Read and parse the given RFC822 message stream till the
      * blank line separating the header from the body. Store the
-     * header lines inside this InternetHeaders object. <p>
-     * <p/>
+     * header lines inside this InternetHeaders object.
+     * <p>
      * Note that the header lines are added into this InternetHeaders
      * object, so any existing headers in this object will not be
      * affected.
      *
      * @param   is RFC822 input stream
+     * @exception MessagingException in case of error
      */
     public void load(InputStream is) throws MessagingException {
         // Read header lines until a blank line. It is valid
@@ -208,9 +209,9 @@
     /**
      * Change the first header line that matches name
      * to have value, adding a new header if no existing header
-     * matches. Remove all matching headers but the first. <p>
-     * <p/>
-     * Note that RFC822 headers can only contain US-ASCII characters
+     * matches. Remove all matching headers but the first.
+     * <p>
+     * Note that RFC822 headers can only contain US-ASCII characters.
      *
      * @param   name    header name
      * @param   value   header value
@@ -242,8 +243,7 @@
     }
 
     /**
-     * Add a header with the specified name and value to the header list. <p>
-     * <p/>
+     * Add a header with the specified name and value to the header list.
      * Note that RFC822 headers can only contain US-ASCII characters.
      *
      * @param   name    header name
@@ -285,15 +285,15 @@
      *
      * @return  Header objects
      */
-    public List<? extends Header> getAllHeaders() {
+    public FinalArrayList<hdr> getAllHeaders() {
         return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here
     }
 
     /**
      * Add an RFC822 header line to the header store.
      * If the line starts with a space or tab (a continuation line),
-     * add it to the last header line in the list. <p>
-     * <p/>
+     * add it to the last header line in the list.
+     * <p>
      * Note that RFC822 headers can only contain US-ASCII characters
      *
      * @param   line    raw RFC822 header line
@@ -316,15 +316,19 @@
 
     /**
      * Return all the header lines as a collection
+     *
+     * @return list of header lines.
      */
     public List<String> getAllHeaderLines() {
         if(headerValueView==null)
             headerValueView = new AbstractList<String>() {
-                public String get(int index) {
+                @Override
+                                public String get(int index) {
                     return headers.get(index).line;
                 }
 
-                public int size() {
+                @Override
+                                public int size() {
                     return headers.size();
                 }
             };
@@ -368,6 +372,7 @@
     /*
      * Return the "name" part of the header line.
      */
+    @Override
     public String getName() {
         return name;
     }
@@ -375,6 +380,7 @@
     /*
      * Return the "value" part of the header line.
      */
+    @Override
     public String getValue() {
         int i = line.indexOf(':');
         if (i < 0)
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java
index 6642dfa..8aa7fe3 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,6 @@
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
 
-import com.sun.xml.internal.messaging.saaj.packaging.mime.Header;
 import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException;
 import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil;
 import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
@@ -52,12 +51,12 @@
 /**
  * This class represents a MIME body part.
  * MimeBodyParts are contained in <code>MimeMultipart</code>
- * objects. <p>
- *
+ * objects.
+ * <p>
  * MimeBodyPart uses the <code>InternetHeaders</code> class to parse
- * and store the headers of that body part. <p>
+ * and store the headers of that body part.
  *
- * <hr><strong>A note on RFC 822 and MIME headers</strong><p>
+ * <hr><strong>A note on RFC 822 and MIME headers</strong>
  *
  * RFC 822 header fields <strong>must</strong> contain only
  * US-ASCII characters. MIME allows non ASCII characters to be present
@@ -70,7 +69,7 @@
  * header fields must be folded (wrapped) before being sent if they
  * exceed the line length limitation for the transport (1000 bytes for
  * SMTP).  Received headers may have been folded.  The application is
- * responsible for folding and unfolding headers as appropriate. <p>
+ * responsible for folding and unfolding headers as appropriate.
  *
  * @author John Mani
  * @author Bill Shannon
@@ -179,6 +178,8 @@
      * the delimiter strings.
      *
      * @param   is      the body part Input Stream
+     *
+     * @exception MessagingException in case of error
      */
     public MimeBodyPart(InputStream is) throws MessagingException {
         if (!(is instanceof ByteArrayInputStream) &&
@@ -216,6 +217,7 @@
      *
      * @param   headers The header of this part
      * @param   content bytes representing the body of this part.
+     * @param   len content length.
      */
     public MimeBodyPart(InternetHeaders headers, byte[] content, int len) {
         this.headers = headers;
@@ -242,6 +244,7 @@
     /**
      * Return the containing <code>MimeMultipart</code> object,
      * or <code>null</code> if not known.
+     * @return parent part.
      */
     public MimeMultipart getParent() {
         return parent;
@@ -253,6 +256,7 @@
      * <code>addBodyPart</code> method.  <code>parent</code> may be
      * <code>null</code> if the <code>MimeBodyPart</code> is being removed
      * from its containing <code>MimeMultipart</code>.
+     * @param parent parent part
      * @since   JavaMail 1.1
      */
     public void setParent(MimeMultipart parent) {
@@ -351,6 +355,9 @@
      * If the <code>subType</code> of <code>mimeType</code> is the
      * special character '*', then the subtype is ignored during the
      * comparison.
+     *
+     * @param mimeType string
+     * @return true if it is valid mime type
      */
     public boolean isMimeType(String mimeType) {
         boolean result;
@@ -375,6 +382,9 @@
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
      *
+     * @return content disposition
+     * @exception MessagingException in case of error
+     *
      * @see #headers
      */
     public String getDisposition() throws MessagingException {
@@ -392,6 +402,9 @@
      * If the disposition is null, any existing "Content-Disposition"
      * header field is removed.
      *
+     * @param disposition value
+     *
+     * @exception MessagingException in case of error
      * @exception       IllegalStateException if this body part is
      *                  obtained from a READ_ONLY folder.
      */
@@ -423,6 +436,9 @@
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
      *
+     * @return encoding
+     * @exception MessagingException in case of error
+     *
      * @see #headers
      */
     public String getEncoding() throws MessagingException {
@@ -465,6 +481,8 @@
      *
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
+     *
+     * @return conent id
      */
     public String getContentID() {
         return getHeader("Content-ID", null);
@@ -475,6 +493,7 @@
      * If the <code>cid</code> parameter is null, any existing
      * "Content-ID" is removed.
      *
+     * @param cid content id
      * @exception       IllegalStateException if this body part is
      *                  obtained from a READ_ONLY folder.
      * @since           JavaMail 1.3
@@ -493,6 +512,8 @@
      *
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
+     *
+     * @return content MD5 sum
      */
     public String getContentMD5() {
         return getHeader("Content-MD5", null);
@@ -501,6 +522,8 @@
     /**
      * Set the "Content-MD5" header field of this body part.
      *
+     * @param md5 content md5 sum
+     *
      * @exception       IllegalStateException if this body part is
      *                  obtained from a READ_ONLY folder.
      */
@@ -516,6 +539,9 @@
      *
      * This implementation uses <code>getHeader(name)</code>
      * to obtain the requisite header field.
+     *
+     * @return array of language tags
+     * @exception MessagingException in case of error
      */
     public String[] getContentLanguage() throws MessagingException {
         String s = getHeader("Content-Language", null);
@@ -663,6 +689,7 @@
      * Returns <code>null</code> if both are absent.
      *
      * @return  filename
+     * @exception MessagingException in case of error
      */
     public String getFileName() throws MessagingException {
         String filename = null;
@@ -692,6 +719,9 @@
      * Sets the "filename" parameter of the "Content-Disposition"
      * header field of this body part.
      *
+     * @param filename filename
+     *
+     * @exception MessagingException in case of error
      * @exception       IllegalStateException if this body part is
      *                  obtained from a READ_ONLY folder.
      */
@@ -769,9 +799,14 @@
      * This implementation simply calls the <code>getContentStream</code>
      * method.
      *
+     * @return input stream
+     *
+     * @exception MessagingException in case of error
+     *
      * @see     #getInputStream
      * @see     #getContentStream
      * @since   JavaMail 1.2
+     *
      */
     public InputStream getRawInputStream() throws MessagingException {
         return getContentStream();
@@ -782,24 +817,30 @@
      *
      * The implementation provided here works just like the
      * the implementation in MimeMessage.
+     *
+     * @return data handler
      */
     public DataHandler getDataHandler() {
         if (mimePart != null) {
             //return an inputstream
             return new DataHandler(new DataSource() {
 
+                @Override
                 public InputStream getInputStream() throws IOException {
                     return mimePart.read();
                 }
 
+                @Override
                 public OutputStream getOutputStream() throws IOException {
                     throw new UnsupportedOperationException("getOutputStream cannot be supported : You have enabled LazyAttachments Option");
                 }
 
+                @Override
                 public String getContentType() {
                     return mimePart.getContentType();
                 }
 
+                @Override
                 public String getName() {
                     return "MIMEPart Wrapped DataSource";
                 }
@@ -890,6 +931,8 @@
      * If the charset is already known, use the
      * setText() version that takes the charset parameter.
      *
+     * @param text string
+     *
      * @see     #setText(String text, String charset)
      */
     public void setText(String text) {
@@ -902,6 +945,9 @@
      * charset. The given Unicode string will be charset-encoded
      * using the specified charset. The charset is also used to set
      * the "charset" parameter.
+     *
+     * @param text string
+     * @param charset character set
      */
     public void setText(String text, String charset) {
         if (charset == null) {
@@ -932,7 +978,9 @@
     /**
      * Output the body part as an RFC 822 format stream.
      *
-     * @exception MessagingException
+     * @param os output stream
+     *
+     * @exception MessagingException in case of error
      * @exception IOException   if an error occurs writing to the
      *                          stream or if an error is generated
      *                          by the javax.activation layer.
@@ -1033,6 +1081,8 @@
 
     /**
      * Remove all headers with this name.
+     *
+     * @param name header name
      */
     public void removeHeader(String name) {
         headers.removeHeader(name);
@@ -1041,14 +1091,18 @@
     /**
      * Return all the headers from this Message as an Enumeration of
      * Header objects.
+     *
+     * @return all headers
      */
-    public List<? extends Header> getAllHeaders() {
+    public FinalArrayList<hdr> getAllHeaders() {
         return headers.getAllHeaders();
     }
 
 
     /**
      * Add a header line to this body part
+     *
+     * @param line header line to add
      */
     public void addHeaderLine(String line) {
         headers.addHeaderLine(line);
@@ -1075,6 +1129,8 @@
      * <br>
      * In both cases this method is typically called by the
      * <code>Message.saveChanges</code> method.
+     *
+     * @exception MessagingException in case of error.
      */
     protected void updateHeaders() throws MessagingException {
         DataHandler dh = getDataHandler();
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
index c9bc117..6c5bf21 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -133,6 +133,7 @@
      * <code>contentType</code> field. <p>
      *
      * MimeBodyParts may be added later.
+     * @param subtype subtype.
      */
     public MimeMultipart(String subtype) {
         //super();
@@ -163,6 +164,8 @@
      *      This must be the same information as {@link DataSource#getContentType()}.
      *      All the callers of this method seem to have this object handy, so
      *      for performance reason this method accepts it. Can be null.
+     *
+     * @exception MessagingException in case of error
      */
     public MimeMultipart(DataSource ds, ContentType ct) throws MessagingException {
         // 'ds' was not a MultipartDataSource, we have
@@ -189,7 +192,8 @@
     /**
      * Return the number of enclosed MimeBodyPart objects.
      *
-     * @return          number of parts
+     * @return          number of parts.
+     * @throws MessagingException in case of error.
      */
     public  int getCount() throws MessagingException {
         parse();
@@ -202,8 +206,8 @@
     /**
      * Get the specified MimeBodyPart.  BodyParts are numbered starting at 0.
      *
-     * @param index     the index of the desired MimeBodyPart
-     * @return          the MimeBodyPart
+     * @param index     the index of the desired MimeBodyPart.
+     * @return          the MimeBodyPart.
      * @exception       MessagingException if no such MimeBodyPart exists
      */
     public  MimeBodyPart getBodyPart(int index)
@@ -221,6 +225,7 @@
      *
      * @param  CID      the ContentID of the desired part
      * @return          the MimeBodyPart
+     * @exception       MessagingException if no such MimeBodyPart exists.
      */
     public  MimeBodyPart getBodyPart(String CID)
                         throws MessagingException {
@@ -256,6 +261,8 @@
      * expensive for a specific MimeMultipart subclass, then it
      * might itself want to track whether its internal state actually
      * did change, and do the header updating only if necessary.
+     *
+     * @exception       MessagingException in case of error.
      */
     protected void updateHeaders() throws MessagingException {
         for (int i = 0; i < parts.size(); i++)
@@ -265,6 +272,11 @@
     /**
      * Iterates through all the parts and outputs each Mime part
      * separated by a boundary.
+     *
+     * @param os output stream.
+     *
+     * @exception IOException if an I/O Error occurs.
+     * @exception MessagingException in case of error.
      */
     public void writeTo(OutputStream os)
             throws IOException, MessagingException {
@@ -291,6 +303,8 @@
      * method is called by all other methods that need data for
      * the body parts, to make sure the data has been parsed.
      *
+     * @exception MessagingException in case of error.
+     *
      * @since   JavaMail 1.2
      */
     protected  void parse() throws MessagingException {
@@ -490,8 +504,9 @@
      * necessary.  This implementation simply constructs and returns
      * an InternetHeaders object.
      *
-     * @param   is      the InputStream to read the headers from
-     * @exception       MessagingException
+     * @param   is      the InputStream to read the headers from.
+     * @return headers.
+     * @exception       MessagingException in case of error.
      * @since           JavaMail 1.2
      */
     protected InternetHeaders createInternetHeaders(InputStream is)
@@ -506,8 +521,10 @@
      * necessary.  This implementation simply constructs and returns
      * a MimeBodyPart object.
      *
-     * @param   headers         the headers for the body part
-     * @param   content         the content of the body part
+     * @param   headers         the headers for the body part.
+     * @param   content         the content of the body part.
+     * @param   len             the content length.
+     * @return  MimeBodyPart
      * @since                   JavaMail 1.2
      */
     protected MimeBodyPart createMimeBodyPart(InternetHeaders headers, byte[] content, int len) {
@@ -521,8 +538,9 @@
      * necessary.  This implementation simply constructs and returns
      * a MimeBodyPart object.
      *
-     * @param   is              InputStream containing the body part
-     * @exception               MessagingException
+     * @param   is              InputStream containing the body part.
+     * @return  MimeBodyPart.
+     * @exception               MessagingException in case of error.
      * @since                   JavaMail 1.2
      */
     protected MimeBodyPart createMimeBodyPart(InputStream is) throws MessagingException {
@@ -543,8 +561,8 @@
      * a specific multipart subtype.
      *
      * @param   mp      MimeMultipart datasource
+     * @exception               MessagingException in case of error.
      */
-
     protected void setMultipartDataSource(MultipartDataSource mp)
                         throws MessagingException {
         contentType = new ContentType(mp.getContentType());
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
index 8d08e39..eb7b46c 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,6 +50,8 @@
 
     /**
      * Constructor, that constructs a DataSource from a MimeBodyPart.
+     *
+     * @param part body part
      */
     public MimePartDataSource(MimeBodyPart part) {
         this.part = part;
@@ -68,6 +70,7 @@
      *
      * @return  decoded input stream
      */
+    @Override
     public InputStream getInputStream() throws IOException {
 
         try {
@@ -88,7 +91,8 @@
      *
      * This implementation throws the UnknownServiceException.
      */
-    public OutputStream getOutputStream() throws IOException {
+    @Override
+        public OutputStream getOutputStream() throws IOException {
         throw new UnknownServiceException();
     }
 
@@ -98,6 +102,7 @@
      * This implementation just invokes the <code>getContentType</code>
      * method on the MimeBodyPart.
      */
+    @Override
     public String getContentType() {
         return part.getContentType();
     }
@@ -107,7 +112,8 @@
      *
      * This implementation just returns an empty string.
      */
-    public String getName() {
+    @Override
+        public String getName() {
         try {
                 return part.getFileName();
         } catch (MessagingException mex) {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java
index 45f6cea..87bdd6e 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,11 +65,11 @@
  * <p>
  * Note that to get the actual bytes of a mail-safe String (say,
  * for sending over SMTP), one must do
- * <p><blockquote><pre>
+ * <blockquote><pre>
  *
  *      byte[] bytes = string.getBytes("iso-8859-1");
  *
- * </pre></blockquote><p>
+ * </pre></blockquote>
  *
  * The <code>setHeader</code> and <code>addHeader</code> methods
  * on MimeMessage and MimeBodyPart assume that the given header values
@@ -222,6 +222,10 @@
      * <code>DataHandler</code> uses a thread, a pair of pipe streams,
      * and the <code>writeTo</code> method to produce the data. <p>
      *
+     * @param dh data handler
+     *
+     * @return encoding
+     *
      * @since   JavaMail 1.2
      */
     public static String getEncoding(DataHandler dh) {
@@ -294,6 +298,7 @@
      * @param   is              input stream
      * @param   encoding        the encoding of the stream.
      * @return                  decoded input stream.
+     * @exception MessagingException in case of error
      */
     public static InputStream decode(InputStream is, String encoding)
                 throws MessagingException {
@@ -323,6 +328,7 @@
      * @param   encoding        the encoding of the stream.
      * @return                  output stream that applies the
      *                          specified encoding.
+     * @exception MessagingException in case of error
      */
     public static OutputStream encode(OutputStream os, String encoding)
                 throws MessagingException {
@@ -358,6 +364,7 @@
      *                          with uuencode)
      * @return                  output stream that applies the
      *                          specified encoding.
+     * @exception MessagingException in case of error
      * @since                   JavaMail 1.2
      */
     public static OutputStream encode(OutputStream os, String encoding,
@@ -397,7 +404,7 @@
      * "unstructured" RFC 822 headers. <p>
      *
      * Example of usage:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      *
      *  MimeBodyPart part = ...
      *  String rawvalue = "FooBar Mailer, Japanese version 1.1"
@@ -411,7 +418,7 @@
      *   // setHeader() failure
      *  }
      *
-     * </pre></blockquote><p>
+     * </pre></blockquote>
      *
      * @param   text    unicode string
      * @return  Unicode string containing only US-ASCII characters
@@ -446,6 +453,7 @@
      *          encoded are in the ASCII charset, otherwise "B" encoding
      *          is used.
      * @return  Unicode string containing only US-ASCII characters
+     * @exception UnsupportedEncodingException in case of unsupported encoding
      */
     public static String encodeText(String text, String charset,
                                     String encoding)
@@ -464,7 +472,7 @@
      * returned as-is <p>
      *
      * Example of usage:
-     * <p><blockquote><pre>
+     * <blockquote><pre>
      *
      *  MimeBodyPart part = ...
      *  String rawvalue = null;
@@ -479,9 +487,10 @@
      *
      *  return value;
      *
-     * </pre></blockquote><p>
+     * </pre></blockquote>
      *
      * @param   etext   the possibly encoded value
+     * @return decoded text
      * @exception       UnsupportedEncodingException if the charset
      *                  conversion failed.
      */
@@ -568,7 +577,7 @@
      * The InternetAddress class, for example, uses this to encode
      * it's 'phrase' component.
      *
-     * @param   text    unicode string
+     * @param   word    unicode string
      * @return  Array of Unicode strings containing only US-ASCII
      *          characters.
      * @exception UnsupportedEncodingException if the encoding fails
@@ -590,7 +599,7 @@
      * The resulting bytes are then returned as a Unicode string
      * containing only ASCII characters. <p>
      *
-     * @param   text    unicode string
+     * @param   word    unicode string
      * @param   charset the MIME charset
      * @param   encoding the encoding to be used. Currently supported
      *          values are "B" and "Q". If this parameter is null, then
@@ -720,6 +729,7 @@
      * fails, an UnsupportedEncodingException is thrown.<p>
      *
      * @param   eword   the possibly encoded value
+     * @return deocoded word
      * @exception       ParseException if the string is not an
      *                  encoded-word as per RFC 2047.
      * @exception       UnsupportedEncodingException if the charset
@@ -847,8 +857,8 @@
      * @param   word    word to be quoted
      * @param   specials the set of special characters
      * @return          the possibly quoted word
-     * @see     javax.mail.internet.HeaderTokenizer#MIME
-     * @see     javax.mail.internet.HeaderTokenizer#RFC822
+     * @see     com.sun.xml.internal.messaging.saaj.packaging.mime.internet.HeaderTokenizer#MIME
+     * @see     com.sun.xml.internal.messaging.saaj.packaging.mime.internet.HeaderTokenizer#RFC822
      */
     public static String quote(String word, String specials) {
         int len = word.length();
@@ -1111,7 +1121,8 @@
             } catch (SecurityException sex) {
 
                 class NullInputStream extends InputStream {
-                    public int read() {
+                    @Override
+                   public int read() {
                         return 0;
                     }
                 }
@@ -1277,7 +1288,7 @@
         int l = s.length();
 
         for (int i = 0; i < l; i++) {
-            if (nonascii((int)s.charAt(i))) // non-ascii
+            if (nonascii(s.charAt(i))) // non-ascii
                 non_ascii++;
             else
                 ascii++;
@@ -1444,14 +1455,17 @@
         checkEOL = encodeEolStrict && breakOnNonAscii;
     }
 
+    @Override
     public void write(int b) throws IOException {
         check(b);
     }
 
+    @Override
     public void write(byte b[]) throws IOException {
         write(b, 0, b.length);
     }
 
+    @Override
     public void write(byte b[], int off, int len) throws IOException {
         len += off;
         for (int i = off; i < len ; i++)
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java
index c650b6b..4619c4d 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,6 +73,9 @@
 
     /**
      * Writes the specified region to another {@link OutputStream}.
+     * @param   start   the starting position
+     * @param   end     the ending position + 1
+     * @param   out     output stream
      */
     public void writeTo(long start,long end, OutputStream out);
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java
index 48a56e8..a85fc85 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,9 +43,17 @@
     /**
      * Convert the bytes within the specified range of the given byte
      * array into a signed integer in the given radix . The range extends
-     * from <code>start</code> till, but not including <code>end</code>. <p>
+     * from <code>start</code> till, but not including <code>end</code>.
      *
-     * Based on java.lang.Integer.parseInt()
+     * Based on java.lang.Integer.parseInt().
+     *
+     * @param b bytes to convert to integer.
+     * @param start start of the range.
+     * @param end end of the range (not including).
+     * @param radix radix.
+     *
+     * @return integer.
+     *
      */
     public static int parseInt(byte[] b, int start, int end, int radix)
                 throws NumberFormatException {
@@ -110,7 +118,14 @@
     /**
      * Convert the bytes within the specified range of the given byte
      * array into a String. The range extends from <code>start</code>
-     * till, but not including <code>end</code>. <p>
+     * till, but not including <code>end</code>.
+     *
+     * @param b bytes to convert to integer.
+     * @param start start of the range.
+     * @param end end of the range (not including).
+     *
+     * @return integer.
+     *
      */
     public static String toString(byte[] b, int start, int end) {
         int size = end - start;
@@ -122,6 +137,15 @@
         return new String(theChars);
     }
 
+        /**
+         * Encodes specified String into a sequence of bytes using the platform's
+         * default charset, storing the result into a new byte array.
+         *
+         * @param s string to encode into byte array.
+         *
+         * @return byte array.
+         *
+         */
     public static byte[] getBytes(String s) {
         char [] chars= s.toCharArray();
         int size = chars.length;
@@ -133,6 +157,13 @@
     }
 
     /**
+         * Converts input stream to array.
+         *
+         * @param is stream to convert to array.
+         *
+         * @return byte array.
+         *
+         * @throws IOException if an I/O error occurs.
      *
      * @deprecated
      *      this is an expensive operation that require an additional
@@ -140,6 +171,7 @@
      *      Unless you absolutely need the exact size array, don't use this.
      *      Use {@link ByteOutputStream} and {@link ByteOutputStream#write(InputStream)}.
      */
+    @Deprecated
     public static byte[] getBytes(InputStream is) throws IOException {
         ByteOutputStream bos = null;
         try {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java
index 31f3e36..972ccd2 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,6 +70,7 @@
      * @exception  IOException  if an I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
+    @Override
     public int read() throws IOException {
         if (index >= bufsize) {
             decode(); // Fills up buffer
@@ -94,6 +95,7 @@
      *             the stream has been reached.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public int read(byte[] buf, int off, int len) throws IOException {
         int i, c;
         for (i = 0; i < len; i++) {
@@ -112,6 +114,7 @@
      * Tests if this input stream supports marks. Currently this class
      * does not support marks
      */
+    @Override
     public boolean markSupported() {
         return false; // Maybe later ..
     }
@@ -122,6 +125,7 @@
      * a close approximation in case the original encoded stream
      * contains embedded CRLFs; since the CRLFs are discarded, not decoded
      */
+    @Override
     public int available() throws IOException {
          // This is only an estimate, since in.available()
          // might include CRLFs too ..
@@ -200,6 +204,10 @@
      * in the IMAP AUTHENTICATE protocol, but not to decode the
      * entire content of a MIME part.
      *
+     * @param inbuf byte array to decode
+     *
+     * @return decoded byte array
+     *
      * NOTE: inbuf may only contain valid base64 characters.
      *       Whitespace is not ignored.
      */
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java
index d1c3350..843a334 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,7 @@
      * @param      len   the number of bytes to write.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void write(byte[] b, int off, int len) throws IOException {
         for (int i = 0; i < len; i++)
             write(b[off + i]);
@@ -90,6 +91,7 @@
      * @param      b   the data to be written.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void write(byte[] b) throws IOException {
         write(b, 0, b.length);
     }
@@ -99,6 +101,7 @@
      * @param      c   the <code>byte</code>.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void write(int c) throws IOException {
         buffer[bufsize++] = (byte)c;
         if (bufsize == 3) { // Encoding unit = 3 bytes
@@ -112,6 +115,7 @@
      * to be encoded out to the stream.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void flush() throws IOException {
         if (bufsize > 0) { // If there's unencoded characters in the buffer ..
             encode();      // .. encode them
@@ -124,6 +128,7 @@
      * Forces any buffered output bytes to be encoded out to the stream
      * and closes this output stream
      */
+    @Override
     public void close() throws IOException {
         flush();
         out.close();
@@ -186,6 +191,10 @@
      * This method is suitable for short strings, such as those
      * in the IMAP AUTHENTICATE protocol, but not to encode the
      * entire content of a MIME part.
+     *
+     * @param inbuf byte array to encode.
+     *
+     * @return encoded byte array.
      */
     public static byte[] encode(byte[] inbuf) {
         if (inbuf.length == 0)
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java
index ec13f9e..a2a23d6 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,6 +55,10 @@
 
     /**
      * Returns the length of the encoded version of this byte array.
+     *
+     * @param b byte array.
+     *
+     * @return length of the byte array.
      */
     public static int encodedLength(byte[] b) {
         return ((b.length + 2)/3) * 4;
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java
index 50390f5..1d0533f 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,6 +64,10 @@
      *
      * This class is similar to the deprecated
      * <code>DataInputStream.readLine()</code>
+     *
+     * @return line.
+     *
+     * @throws IOException if an I/O error occurs.
      */
     public String readLine() throws IOException {
         InputStream in = this.in;
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java
index 92bd21e..88239e0 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,6 +54,11 @@
 
     /**
      * Writes a string as ASCII string.
+     *
+     * @param s string.
+     * @param out output stream.
+     *
+     * @throws IOException if an I/O error occurs.
      */
     public static void writeAsAscii(String s,OutputStream out) throws IOException {
         int len = s.length();
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java
index 2cf6e31..272806b 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,6 +69,7 @@
      * @param      c   the <code>byte</code>.
      * @exception  IOException  if an I/O error occurs.
      */
+    @Override
     public void write(int c) throws IOException {
         c = c & 0xff; // Turn off the MSB.
         if (c == ' ')
@@ -82,6 +83,11 @@
 
     /**
      * Returns the length of the encoded version of this byte array.
+     *
+     * @param b byte array.
+     * @param encodingWord whether use word or text specials.
+     *
+     * @return length.
      */
     public static int encodedLength(byte[] b, boolean encodingWord) {
         int len = 0;
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
index 9cd0216..49d9ec7 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,23 +83,29 @@
     /**
      * Set up the buffer name and permission mode.
      * This method has any effect only if it is invoked before
-     * you start writing into the output stream
+     * you start writing into the output stream.
+     *
+     * @param name name to set for the buffer.
+     * @param mode permission mode.
      */
     public void setNameMode(String name, int mode) {
         this.name = name;
         this.mode = mode;
     }
 
+    @Override
     public void write(byte[] b, int off, int len) throws IOException {
         for (int i = 0; i < len; i++)
             write(b[off + i]);
     }
 
+    @Override
     public void write(byte[] data) throws IOException {
         write(data, 0, data.length);
     }
 
-    public void write(int c) throws IOException {
+    @Override
+        public void write(int c) throws IOException {
         /* buffer up characters till we get a line's worth, then encode
          * and write them out. Max number of characters allowed per
          * line is 45.
@@ -112,6 +118,7 @@
         }
     }
 
+    @Override
     public void flush() throws IOException {
         if (bufsize > 0) { // If there's unencoded characters in the buffer
             writePrefix();
@@ -121,6 +128,7 @@
         out.flush();
     }
 
+    @Override
     public void close() throws IOException {
         flush();
         out.close();
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java
index 607e8c3..50ed0ed 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,16 +41,25 @@
 public interface Envelope extends SOAPEnvelope {
     /**
      * Get the content as a JAXP Source.
+     *
+     * @return source
      */
     Source getContent();
 
     /**
      * Output the content.
+     *
+     * @param out output stream.
+     * @exception IOException in case of an I/O error.
      */
     void output(OutputStream out) throws IOException;
 
     /**
      * Output the content.
+     *
+     * @param out output stream
+     * @param isFastInfoset true if it is fast infoset.
+     * @exception IOException in case of an I/O error.
      */
     void output(OutputStream out, boolean isFastInfoset) throws IOException;
 
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java
index e7223cc..4c8fb5a 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,9 +47,10 @@
     }
 
     /**
-     * return the DataFlavors for this <code>DataContentHandler</code>
+     * Return the DataFlavors for this <code>DataContentHandler</code>
      * @return The DataFlavors.
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         DataFlavor flavors[] = new DataFlavor[1];
         flavors[0] = new ActivationDataFlavor(
@@ -59,11 +60,13 @@
     }
 
     /**
-     * return the Transfer Data of type DataFlavor from InputStream
-     * @param df The DataFlavor.
-     * @param ins The InputStream corresponding to the data.
+     * Return the Transfer Data of type DataFlavor from InputStream
+     * @param flavor The DataFlavor.
+     * @param dataSource DataSource.
      * @return The constructed Object.
+     * @exception IOException in case of an I/O error
      */
+    @Override
     public Object getTransferData(DataFlavor flavor, DataSource dataSource)
         throws IOException
     {
@@ -81,6 +84,7 @@
         return null;
     }
 
+    @Override
     public Object getContent(DataSource dataSource) throws IOException {
         try {
             return FastInfosetReflection.FastInfosetSource_new(
@@ -92,10 +96,11 @@
     }
 
     /**
-     * construct an object from a byte stream
+     * Construct an object from a byte stream
      * (similar semantically to previous method, we are deciding
      *  which one to support)
      */
+    @Override
     public void writeTo(Object obj, String mimeType, OutputStream os)
         throws IOException
     {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java
index 2ac41fc..48ddb7a 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,7 @@
      *
      * @return The DataFlavors
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         return new DataFlavor[] { getDF()};
     }
@@ -60,9 +61,11 @@
      * Return the Transfer Data of type DataFlavor from InputStream.
      *
      * @param df The DataFlavor
-     * @param ins The InputStream corresponding to the data
+     * @param ds The DataSource
      * @return String object
+     * @exception IOException in case of an I/O error
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds)
         throws IOException {
         // use myDF.equals to be sure to get ActivationDataFlavor.equals,
@@ -73,6 +76,7 @@
             return null;
     }
 
+    @Override
     public Object getContent(DataSource ds) throws IOException {
         InputStream is = ds.getInputStream();
         int pos = 0;
@@ -98,7 +102,11 @@
 
     /**
      * Write the object to the output stream, using the specified MIME type.
+     * @param obj object to write
+     * @param type requested MIME type of the resulting byte stream
+     * @param os OutputStream
      */
+    @Override
     public void writeTo(Object obj, String type, OutputStream os)
                         throws IOException {
         if (obj != null && !(obj instanceof Image))
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
index b66cbbd..8f063f1 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,8 +67,9 @@
      *
      * @return The DataFlavors.
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() {
-        return (DataFlavor[]) Arrays.copyOf(flavor, flavor.length);
+        return Arrays.copyOf(flavor, flavor.length);
     }
 
     /**
@@ -80,6 +81,7 @@
      * @param ds The DataSource representing the data to be converted.
      * @return The constructed Object.
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds)
         throws IOException {
         for (int i=0; i < flavor.length; i++) {
@@ -98,6 +100,7 @@
      * @param ds The DataSource representing the data to be converted.
      * @return The constructed Object.
      */
+    @Override
     public Object getContent(DataSource ds) throws IOException {
         return ImageIO.read(new BufferedInputStream(ds.getInputStream()));
     }
@@ -107,11 +110,11 @@
      * and write it to the output stream.
      *
      * @param obj   The object to be converted.
-     * @param mimeType  The requested MIME type of the resulting byte stream.
+     * @param type  The requested MIME type of the resulting byte stream.
      * @param os    The output stream into which to write the converted
      *          byte stream.
      */
-
+    @Override
     public void writeTo(Object obj, String type, OutputStream os)
         throws IOException {
 
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java
index 083c1de..83cfbe5 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,9 +47,10 @@
     public static final String STR_SRC = "java.awt.Image";
 
     /**
-     * return the DataFlavors for this <code>DataContentHandler</code>
+     * Return the DataFlavors for this <code>DataContentHandler</code>
      * @return The DataFlavors.
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         DataFlavor flavors[] = new DataFlavor[1];
 
@@ -67,11 +68,12 @@
     }
 
     /**
-     * return the Transfer Data of type DataFlavor from InputStream
-     * @param df The DataFlavor.
-     * @param ins The InputStream corresponding to the data.
+     * Return the Transfer Data of type DataFlavor from InputStream
+     * @param df The DataFlavor
+     * @param ds The DataSource
      * @return The constructed Object.
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds) {
 
         // this is sort of hacky, but will work for the
@@ -98,6 +100,7 @@
     /**
      *
      */
+    @Override
     public Object getContent(DataSource ds) { // throws Exception;
         InputStream inputStream = null;
         BufferedImage jpegLoadImage = null;
@@ -109,14 +112,18 @@
         } catch (Exception e) {
         }
 
-        return (Image) jpegLoadImage;
+        return jpegLoadImage;
     }
 
     /**
-     * construct an object from a byte stream
+     * Construct an object from a byte stream
      * (similar semantically to previous method, we are deciding
      *  which one to support)
+     * @param obj object to write
+     * @param mimeType requested MIME type of the resulting byte stream
+     * @param os OutputStream
      */
+    @Override
     public void writeTo(Object obj, String mimeType, OutputStream os)
         throws IOException {
         if (!mimeType.equals("image/jpeg"))
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java
index 1f83ca5..5cf8b7a 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,24 +38,24 @@
 
     /**
      * Retrieve payload qname without materializing its contents
-     * @return
-     * @throws SOAPException
+     * @return QName
+     * @throws SOAPException in case of an error
      */
     public QName getPayloadQName() throws SOAPException;
 
     /**
      * Retrieve payload attribute value without materializing its contents
-     * @param localName
-     * @return
-     * @throws SOAPException
+     * @param localName local name
+     * @return payload attribute value
+     * @throws SOAPException in case of an error
      */
     public String getPayloadAttributeValue(String localName) throws SOAPException;
 
     /**
      * Retrieve payload attribute value without materializing its contents
-     * @param qName
-     * @return
-     * @throws SOAPException
+     * @param qName QName
+     * @return payload attribute value
+     * @throws SOAPException in case of an error
      */
     public String getPayloadAttributeValue(QName qName) throws SOAPException;
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
index c760f4a..a7df703 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@
 
     /**
      * True if this part is encoded using Fast Infoset.
-     * MIME -> application/fastinfoset
+     * MIME -&gt; application/fastinfoset
      */
     protected boolean isFastInfoset = false;
 
@@ -202,6 +202,9 @@
     /**
       * Construct a new message. This will be invoked before message
       * sends.
+      *
+      * @param isFastInfoset whether it is fast infoset
+      * @param acceptFastInfoset whether to accept fast infoset
       */
     protected MessageImpl(boolean isFastInfoset, boolean acceptFastInfoset) {
         this.isFastInfoset = isFastInfoset;
@@ -214,6 +217,8 @@
 
     /**
      * Shallow copy.
+     *
+     * @param msg SoapMessage
      */
     protected MessageImpl(SOAPMessage msg) {
         if (!(msg instanceof MessageImpl)) {
@@ -233,14 +238,17 @@
     /**
      * @param stat
      *      the mask value obtained from {@link #identifyContentType(ContentType)}
+     * @return true if SOAP 1.1 Content
      */
     protected static boolean isSoap1_1Content(int stat) {
         return (stat & SOAP1_1_FLAG) != 0;
     }
 
     /**
+     * Check whether it is SOAP 1.2 content.
      * @param stat
      *      the mask value obtained from {@link #identifyContentType(ContentType)}
+     * @return true if it is SOAP 1.2 content
      */
     protected static boolean isSoap1_2Content(int stat) {
         return (stat & SOAP1_2_FLAG) != 0;
@@ -298,6 +306,9 @@
      * Construct a message from an input stream. When messages are
      * received, there's two parts -- the transport headers and the
      * message content in a transport specific stream.
+     * @param headers MimeHeaders
+     * @param in InputStream
+     * @exception SOAPExceptionImpl in case of I/O error
      */
     protected MessageImpl(MimeHeaders headers, final InputStream in)
         throws SOAPExceptionImpl {
@@ -332,6 +343,7 @@
      * received, there's two parts -- the transport headers and the
      * message content in a transport specific stream.
      *
+     * @param headers headers
      * @param contentType
      *      The parsed content type header from the headers variable.
      *      This is redundant parameter, but it avoids reparsing this header again.
@@ -339,6 +351,8 @@
      *      The result of {@link #identifyContentType(ContentType)} over
      *      the contentType parameter. This redundant parameter, but it avoids
      *      recomputing this information again.
+     * @param in input stream
+     * @exception SOAPExceptionImpl in case of an error
      */
     protected MessageImpl(MimeHeaders headers, final ContentType contentType, int stat, final InputStream in) throws SOAPExceptionImpl {
         init(headers, stat, contentType, in);
@@ -425,18 +439,22 @@
             } else if ((stat & MIME_MULTIPART_FLAG) != 0) {
                 final InputStream finalIn = in;
                 DataSource ds = new DataSource() {
+                    @Override
                     public InputStream getInputStream() {
                         return finalIn;
                     }
 
+                    @Override
                     public OutputStream getOutputStream() {
                         return null;
                     }
 
+                    @Override
                     public String getContentType() {
                         return contentType.toString();
                     }
 
+                    @Override
                     public String getName() {
                         return "";
                     }
@@ -591,10 +609,12 @@
             return Boolean.valueOf(lazyParsingProp.toString());
         }
     }
+    @Override
     public Object getProperty(String property) {
-        return (String) properties.get(property);
+        return properties.get(property);
     }
 
+    @Override
     public void setProperty(String property, Object value) {
         verify(property, value);
         properties.put(property, value);
@@ -722,6 +742,7 @@
             return "text/xml";
     }
 
+    @Override
     public MimeHeaders getMimeHeaders() {
         return this.headers;
     }
@@ -805,10 +826,12 @@
         saved = false;
     }
 
+    @Override
     public  boolean saveRequired() {
         return saved != true;
     }
 
+    @Override
     public String getContentDescription() {
         String[] values = headers.getHeader("Content-Description");
         if (values != null && values.length > 0)
@@ -816,13 +839,16 @@
         return null;
     }
 
+    @Override
     public void setContentDescription(String description) {
         headers.setHeader("Content-Description", description);
         needsSave();
     }
 
+    @Override
     public abstract SOAPPart getSOAPPart();
 
+    @Override
     public void removeAllAttachments() {
         try {
             initializeAllAttachments();
@@ -836,6 +862,7 @@
         }
     }
 
+    @Override
     public int countAttachments() {
         try {
             initializeAllAttachments();
@@ -847,6 +874,7 @@
         return 0;
     }
 
+    @Override
     public void addAttachmentPart(AttachmentPart attachment) {
         try {
             initializeAllAttachments();
@@ -864,6 +892,7 @@
 
     static private final Iterator nullIter = Collections.EMPTY_LIST.iterator();
 
+    @Override
     public Iterator getAttachments() {
         try {
             initializeAllAttachments();
@@ -897,12 +926,14 @@
         private MimeHeaders headers;
         private AttachmentPart nextAttachment;
 
+        @Override
         public boolean hasNext() {
             if (nextAttachment == null)
                 nextAttachment = nextMatch();
             return nextAttachment != null;
         }
 
+        @Override
         public AttachmentPart next() {
             if (nextAttachment != null) {
                 AttachmentPart ret = nextAttachment;
@@ -925,11 +956,13 @@
             return null;
         }
 
+        @Override
         public void remove() {
             iter.remove();
         }
     }
 
+    @Override
     public Iterator getAttachments(MimeHeaders headers) {
         try {
             initializeAllAttachments();
@@ -942,6 +975,7 @@
         return new MimeMatchingIterator(headers);
     }
 
+    @Override
     public void removeAttachments(MimeHeaders headers) {
         try {
             initializeAllAttachments();
@@ -966,10 +1000,12 @@
        // needsSave();
     }
 
+    @Override
     public AttachmentPart createAttachmentPart() {
         return new AttachmentPartImpl();
     }
 
+    @Override
     public  AttachmentPart getAttachment(SOAPElement element)
         throws SOAPException {
         try {
@@ -1187,6 +1223,7 @@
         }
     }
 
+    @Override
     public void saveChanges() throws SOAPException {
 
         // suck in all the data from the attachments and have it
@@ -1340,6 +1377,7 @@
 
     }
 
+    @Override
     public void writeTo(OutputStream out) throws SOAPException, IOException {
         if (saveRequired()){
             this.optimizeAttachmentProcessing = true;
@@ -1397,6 +1435,7 @@
         needsSave();
     }
 
+    @Override
     public SOAPBody getSOAPBody() throws SOAPException {
         SOAPBody body = getSOAPPart().getEnvelope().getBody();
         /*if (body == null) {
@@ -1405,6 +1444,7 @@
         return body;
     }
 
+    @Override
     public SOAPHeader getSOAPHeader() throws SOAPException {
         SOAPHeader hdr = getSOAPPart().getEnvelope().getHeader();
         /*if (hdr == null) {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
index fd31cd9..cc7696e 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
      *
      * @return The DataFlavors
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         return new DataFlavor[] { myDF };
     }
@@ -51,9 +52,10 @@
      * Return the Transfer Data of type DataFlavor from InputStream.
      *
      * @param df The DataFlavor
-     * @param ins The InputStream corresponding to the data
+     * @param ds The DataSource
      * @return String object
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds) {
         // use myDF.equals to be sure to get ActivationDataFlavor.equals,
         // which properly ignores Content-Type parameters in comparison
@@ -65,7 +67,11 @@
 
     /**
      * Return the content.
+     *
+     * @param ds The DataSource
+     * @return content
      */
+    @Override
     public Object getContent(DataSource ds) {
         try {
             return new MimeMultipart(
@@ -78,6 +84,7 @@
     /**
      * Write the object to the output stream, using the specific MIME type.
      */
+    @Override
     public void writeTo(Object obj, String mimeType, OutputStream os)
                         throws IOException {
         if (obj instanceof MimeMultipart) {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
deleted file mode 100644
index 1ffe4ff..0000000
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
-*
-* @author SAAJ RI Development Team
-*/
-package com.sun.xml.internal.messaging.saaj.soap;
-
-import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
-import com.sun.org.apache.xerces.internal.dom.DocumentFragmentImpl;
-
-public class SOAPDocumentFragment extends DocumentFragmentImpl {
-
-    public SOAPDocumentFragment(CoreDocumentImpl ownerDoc) {
-        super(ownerDoc);
-    }
-
-    public SOAPDocumentFragment() {
-        super();
-    }
-
-}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
index 7dac698..417cd9a 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,16 +29,42 @@
 */
 package com.sun.xml.internal.messaging.saaj.soap;
 
-import java.util.logging.Logger;
-
-import com.sun.org.apache.xerces.internal.dom.DocumentImpl;
-import org.w3c.dom.*;
-
-import com.sun.xml.internal.messaging.saaj.soap.impl.*;
+import com.sun.xml.internal.messaging.saaj.soap.impl.CDATAImpl;
+import com.sun.xml.internal.messaging.saaj.soap.impl.ElementFactory;
+import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl;
+import com.sun.xml.internal.messaging.saaj.soap.impl.SOAPCommentImpl;
+import com.sun.xml.internal.messaging.saaj.soap.impl.SOAPTextImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Comment;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.UserDataHandler;
 
-public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument {
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Logger;
+
+public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Document {
 
     private static final String XMLNS = "xmlns".intern();
     protected static final Logger log =
@@ -47,8 +73,24 @@
 
     SOAPPartImpl enclosingSOAPPart;
 
+    private Document document;
+
+    private Map<Node, javax.xml.soap.Node> domToSoap = new HashMap<>();
+
     public SOAPDocumentImpl(SOAPPartImpl enclosingDocument) {
+        document = createDocument();
         this.enclosingSOAPPart = enclosingDocument;
+        register(this);
+    }
+
+    private Document createDocument() {
+        DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAAJUtil.getSystemClassLoader());
+        try {
+            final DocumentBuilder documentBuilder = docFactory.newDocumentBuilder();
+            return documentBuilder.newDocument();
+        } catch (ParserConfigurationException e) {
+            throw new RuntimeException("Error creating xml document", e);
+        }
     }
 
     //    public SOAPDocumentImpl(boolean grammarAccess) {
@@ -81,7 +123,7 @@
     }
 
     public DOMImplementation getImplementation() {
-        return super.getImplementation();
+        return document.getImplementation();
     }
 
     public Element getDocumentElement() {
@@ -91,7 +133,7 @@
     }
 
     protected Element doGetDocumentElement() {
-        return super.getDocumentElement();
+        return document.getDocumentElement();
     }
 
     public Element createElement(String tagName) throws DOMException {
@@ -103,7 +145,7 @@
     }
 
     public DocumentFragment createDocumentFragment() {
-        return new SOAPDocumentFragment(this);
+        return document.createDocumentFragment();
     }
 
     public org.w3c.dom.Text createTextNode(String data) {
@@ -139,7 +181,7 @@
             }
         }
 
-        return super.createAttribute(name);
+        return document.createAttribute(name);
     }
 
     public EntityReference createEntityReference(String name)
@@ -149,12 +191,15 @@
     }
 
     public NodeList getElementsByTagName(String tagname) {
-        return super.getElementsByTagName(tagname);
+        return document.getElementsByTagName(tagname);
     }
 
     public org.w3c.dom.Node importNode(Node importedNode, boolean deep)
         throws DOMException {
-        return super.importNode(importedNode, deep);
+        final Node node = document.importNode(getDomNode(importedNode), deep);
+        return node instanceof Element ?
+            ElementFactory.createElement(this, (Element) node)
+                : node;
     }
 
     public Element createElementNS(String namespaceURI, String qualifiedName)
@@ -168,26 +213,386 @@
 
     public Attr createAttributeNS(String namespaceURI, String qualifiedName)
         throws DOMException {
-        return super.createAttributeNS(namespaceURI, qualifiedName);
+        return document.createAttributeNS(namespaceURI, qualifiedName);
     }
 
     public NodeList getElementsByTagNameNS(
         String namespaceURI,
         String localName) {
-        return super.getElementsByTagNameNS(namespaceURI, localName);
+        return document.getElementsByTagNameNS(namespaceURI, localName);
     }
 
     public Element getElementById(String elementId) {
-        return super.getElementById(elementId);
+        return document.getElementById(elementId);
     }
 
+    @Override
+    public String getInputEncoding() {
+        return document.getInputEncoding();
+    }
+
+    @Override
+    public String getXmlEncoding() {
+        return document.getXmlEncoding();
+    }
+
+    @Override
+    public boolean getXmlStandalone() {
+        return document.getXmlStandalone();
+    }
+
+    @Override
+    public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
+        document.setXmlStandalone(xmlStandalone);
+    }
+
+    @Override
+    public String getXmlVersion() {
+        return document.getXmlVersion();
+    }
+
+    @Override
+    public void setXmlVersion(String xmlVersion) throws DOMException {
+        document.setXmlVersion(xmlVersion);
+    }
+
+    @Override
+    public boolean getStrictErrorChecking() {
+        return document.getStrictErrorChecking();
+    }
+
+    @Override
+    public void setStrictErrorChecking(boolean strictErrorChecking) {
+        document.setStrictErrorChecking(strictErrorChecking);
+    }
+
+    @Override
+    public String getDocumentURI() {
+        return document.getDocumentURI();
+    }
+
+    @Override
+    public void setDocumentURI(String documentURI) {
+        document.setDocumentURI(documentURI);
+    }
+
+    @Override
+    public Node adoptNode(Node source) throws DOMException {
+        return document.adoptNode(source);
+    }
+
+    @Override
+    public DOMConfiguration getDomConfig() {
+        return document.getDomConfig();
+    }
+
+    @Override
+    public void normalizeDocument() {
+        document.normalizeDocument();
+    }
+
+    @Override
+    public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException {
+        return document.renameNode(n, namespaceURI, qualifiedName);
+    }
+
+    @Override
+    public String getNodeName() {
+        return document.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return document.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        document.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return document.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return document.getParentNode();
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return document.getChildNodes();
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return document.getFirstChild();
+    }
+
+    @Override
+    public Node getLastChild() {
+        return document.getLastChild();
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return document.getPreviousSibling();
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return document.getNextSibling();
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return document.getAttributes();
+    }
+
+    @Override
+    public Document getOwnerDocument() {
+        return document.getOwnerDocument();
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return document.insertBefore(getDomNode(newChild), getDomNode(refChild));
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return document.replaceChild(getDomNode(newChild), getDomNode(oldChild));
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return document.removeChild(getDomNode(oldChild));
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return document.appendChild(getDomNode(newChild));
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return document.hasChildNodes();
+    }
+
+    @Override
     public Node cloneNode(boolean deep) {
-        SOAPPartImpl newSoapPart = getSOAPPart().doCloneNode();
-        super.cloneNode(newSoapPart.getDocument(), deep);
-        return newSoapPart;
+        return document.cloneNode(deep);
     }
 
-    public void cloneNode(SOAPDocumentImpl newdoc, boolean deep) {
-        super.cloneNode(newdoc, deep);
+    @Override
+    public void normalize() {
+        document.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return document.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return document.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return document.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        document.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return document.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return document.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return document.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return document.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return document.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        document.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return document.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return document.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return document.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return document.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return document.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return document.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return document.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return document.getUserData(key);
+    }
+
+    public Document getDomDocument() {
+        return document;
+    }
+
+    /**
+     * Insert a mapping information for {@link org.w3c.dom.Node} - {@link javax.xml.soap.Node}.
+     *
+     * In SAAJ, elements in DOM are expected to be interfaces of SAAJ, on the other hand in JDKs Xerces,
+     * they are casted to internal impl classes. After removal of SAAJ dependency
+     * to JDKs internal classes elements in DOM can never be both of them.
+     *
+     * @param node SAAJ wrapper node for w3c DOM node
+     */
+    public void register(javax.xml.soap.Node node) {
+        final Node domElement = getDomNode(node);
+        if (domToSoap.containsKey(domElement)) {
+            throw new IllegalStateException("Element " + domElement.getNodeName()
+                    + " is already registered");
+        }
+        domToSoap.put(domElement, node);
+    }
+
+    /**
+     * Find a soap wrapper for w3c dom node.
+     *
+     * @param node w3c dom node nullable
+     * @return soap wrapper for w3c dom node
+     *
+     * @throws
+     */
+    public javax.xml.soap.Node find(Node node) {
+        return find(node, true);
+    }
+
+    private javax.xml.soap.Node find(Node node, boolean required) {
+        if (node == null) {
+            return null;
+        }
+        if (node instanceof javax.xml.soap.Node) {
+            return (javax.xml.soap.Node) node;
+        }
+        final javax.xml.soap.Node found = domToSoap.get(node);
+        if (found == null && required) {
+            throw new IllegalArgumentException(MessageFormat.format("Cannot find SOAP wrapper for element {0}", node));
+        }
+        return found;
+    }
+
+    /**
+     * If corresponding soap wrapper exists for w3c dom node it is returned,
+     * if not passed dom element is returned.
+     *
+     * @param node w3c dom node
+     * @return soap wrapper or passed w3c dom node if not found
+     */
+    public Node findIfPresent(Node node) {
+        final javax.xml.soap.Node found = find(node, false);
+        return found != null ? found : node;
+    }
+
+    /**
+     * Extracts w3c dom node from corresponding soap wrapper.
+     *
+     * @param node soap or dom nullable
+     * @return dom node
+     */
+    public Node getDomNode(Node node) {
+        if (node instanceof SOAPDocumentImpl) {
+            return ((SOAPDocumentImpl)node).getDomElement();
+        } else if (node instanceof ElementImpl) {
+            return ((ElementImpl) node).getDomElement();
+        } else if (node instanceof SOAPTextImpl) {
+            return ((SOAPTextImpl)node).getDomElement();
+        } else if (node instanceof SOAPCommentImpl) {
+            return ((SOAPCommentImpl)node).getDomElement();
+        } else if (node instanceof CDATAImpl) {
+            return ((CDATAImpl) node).getDomElement();
+        }
+        return node;
+    }
+
+    public Document getDomElement() {
+        return document;
+    }
+
+    @Override
+    public String getValue() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(String value) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setParentElement(SOAPElement parent) throws SOAPException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public SOAPElement getParentElement() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void detachNode() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void recycleNode() {
+        throw new UnsupportedOperationException();
     }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
index 19cc1b4..49abddb 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,29 +25,56 @@
 
 package com.sun.xml.internal.messaging.saaj.soap;
 
-import java.io.*;
-import java.util.Iterator;
-import java.util.logging.Logger;
-import java.util.logging.Level;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.xml.soap.*;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-
-import org.w3c.dom.*;
-
-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart;
-
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
+import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart;
 import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
-import com.sun.xml.internal.messaging.saaj.util.*;
+import com.sun.xml.internal.messaging.saaj.util.ByteInputStream;
+import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
+import com.sun.xml.internal.messaging.saaj.util.FastInfosetReflection;
+import com.sun.xml.internal.messaging.saaj.util.JAXMStreamSource;
+import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import com.sun.xml.internal.messaging.saaj.util.MimeHeadersUtil;
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
+import com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser;
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Comment;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.UserDataHandler;
 
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPPart;
+import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PushbackReader;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
+import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * SOAPPartImpl is the first attachment. This contains the XML/SOAP document.
@@ -128,20 +155,21 @@
             envelope = createEnvelopeFromSource();
         } else {
             envelope = createEmptyEnvelope(null);
-            document.insertBefore(envelope, null);
+            document.insertBefore(((EnvelopeImpl) envelope).getDomElement(), null);
         }
         return envelope;
     }
 
     protected void lookForEnvelope() throws SOAPException {
         Element envelopeChildElement = document.doGetDocumentElement();
-        if (envelopeChildElement == null || envelopeChildElement instanceof Envelope) {
-            envelope = (EnvelopeImpl) envelopeChildElement;
-        } else if (!(envelopeChildElement instanceof ElementImpl)) {
+        org.w3c.dom.Node soapEnvelope = document.findIfPresent(envelopeChildElement);
+        if (soapEnvelope == null || soapEnvelope instanceof Envelope) {
+            envelope = (EnvelopeImpl) soapEnvelope;
+        } else if (document.find(envelopeChildElement) == null) {
             log.severe("SAAJ0512.soap.incorrect.factory.used");
             throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction");
         } else {
-            ElementImpl soapElement = (ElementImpl) envelopeChildElement;
+            ElementImpl soapElement = (ElementImpl) document.find(envelopeChildElement);
             if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) {
                 String prefix = soapElement.getPrefix();
                 String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix);
@@ -498,7 +526,7 @@
     }
 
     public NamedNodeMap getAttributes() {
-        return document.getAttributes();
+        return document.getDomDocument().getAttributes();
     }
 
     public NodeList getChildNodes() {
@@ -517,11 +545,11 @@
     }
 
     public String getLocalName() {
-        return document.getLocalName();
+        return document.getDomDocument().getLocalName();
     }
 
     public String getNamespaceURI() {
-        return document.getNamespaceURI();
+        return document.getDomDocument().getNamespaceURI();
     }
 
     public org.w3c.dom.Node getNextSibling() {
@@ -530,11 +558,11 @@
     }
 
     public String getNodeName() {
-        return document.getNodeName();
+        return document.getDomDocument().getNodeName();
     }
 
     public short getNodeType() {
-        return document.getNodeType();
+        return document.getDomDocument().getNodeType();
     }
 
     public String getNodeValue() throws DOMException {
@@ -542,23 +570,23 @@
     }
 
     public Document getOwnerDocument() {
-        return document.getOwnerDocument();
+        return document.getDomDocument().getOwnerDocument();
     }
 
     public org.w3c.dom.Node getParentNode() {
-        return document.getParentNode();
+        return document.getDomDocument().getParentNode();
     }
 
     public String getPrefix() {
-        return document.getPrefix();
+        return document.getDomDocument().getPrefix();
     }
 
     public org.w3c.dom.Node getPreviousSibling() {
-        return document.getPreviousSibling();
+        return document.getDomDocument().getPreviousSibling();
     }
 
     public boolean hasAttributes() {
-        return document.hasAttributes();
+        return document.getDomDocument().hasAttributes();
     }
 
     public boolean hasChildNodes() {
@@ -575,7 +603,7 @@
     }
 
     public boolean isSupported(String arg0, String arg1) {
-        return document.isSupported(arg0, arg1);
+        return document.getDomDocument().isSupported(arg0, arg1);
     }
 
     public void normalize() {
@@ -686,7 +714,7 @@
     }
 
     public DOMConfiguration getDomConfig() {
-        return document.getDomConfig();
+        return document.getDomDocument().getDomConfig();
     }
 
     public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws DOMException {
@@ -699,7 +727,7 @@
     }
 
     public String getDocumentURI() {
-        return document.getDocumentURI();
+        return document.getDomDocument().getDocumentURI();
     }
 
     public void  setStrictErrorChecking(boolean strictErrorChecking) {
@@ -707,15 +735,15 @@
     }
 
     public String getInputEncoding() {
-        return document.getInputEncoding();
+        return document.getDomDocument().getInputEncoding();
     }
 
     public String getXmlEncoding() {
-        return document.getXmlEncoding();
+        return document.getDomDocument().getXmlEncoding();
     }
 
     public boolean getXmlStandalone() {
-        return document.getXmlStandalone();
+        return document.getDomDocument().getXmlStandalone();
     }
 
     public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
@@ -723,7 +751,7 @@
     }
 
     public String getXmlVersion() {
-        return document.getXmlVersion();
+        return document.getDomDocument().getXmlVersion();
     }
 
     public void setXmlVersion(String xmlVersion) throws DOMException {
@@ -731,12 +759,12 @@
     }
 
     public boolean  getStrictErrorChecking() {
-        return document.getStrictErrorChecking();
+        return document.getDomDocument().getStrictErrorChecking();
     }
 
     // DOM L3 methods from org.w3c.dom.Node
     public String getBaseURI() {
-        return document.getBaseURI();
+        return document.getDomDocument().getBaseURI();
     }
 
     public short compareDocumentPosition(org.w3c.dom.Node other)
@@ -758,7 +786,7 @@
     }
 
     public String lookupPrefix(String namespaceURI) {
-        return document.lookupPrefix(namespaceURI);
+        return document.getDomDocument().lookupPrefix(namespaceURI);
     }
 
     public boolean isDefaultNamespace(String namespaceURI) {
@@ -770,7 +798,7 @@
     }
 
     public boolean isEqualNode(org.w3c.dom.Node arg) {
-        return document.isEqualNode(arg);
+        return document.getDomDocument().isEqualNode(arg);
     }
 
     public Object getFeature(String feature,
@@ -785,7 +813,7 @@
     }
 
     public Object getUserData(String key) {
-        return document.getUserData(key);
+        return document.getDomDocument().getUserData(key);
     }
 
     public void recycleNode() {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java
index 96fcb59..d4bd32c 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,6 +63,9 @@
     /**
      * Constructs a <code>SOAPExceptionImpl</code> object initialized
      * with the given <code>Throwable</code> object.
+     *
+     * @param cause a <code>Throwable</code> object that is to
+     *        be embedded in this <code>SOAPExceptionImpl</code> object
      */
     public SOAPVersionMismatchException(Throwable cause) {
         super(cause);
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java
index 1ee0943..491f9ea 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
 
 /**
- * JAF data content handler for text/plain --> String
+ * JAF data content handler for text/plain --&gt; String
  *
  */
 public class StringDataContentHandler implements DataContentHandler {
@@ -51,6 +51,7 @@
      *
      * @return The DataFlavors
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() {
         return new DataFlavor[] { getDF() };
     }
@@ -62,6 +63,7 @@
      * @param ds The DataSource corresponding to the data
      * @return String object
      */
+    @Override
     public Object getTransferData(DataFlavor df, DataSource ds)
                         throws IOException {
         // use myDF.equals to be sure to get ActivationDataFlavor.equals,
@@ -72,6 +74,7 @@
             return null;
     }
 
+    @Override
     public Object getContent(DataSource ds) throws IOException {
         String enc = null;
         InputStreamReader is = null;
@@ -120,6 +123,7 @@
     /**
      * Write the object to the output stream, using the specified MIME type.
      */
+    @Override
     public void writeTo(Object obj, String type, OutputStream os)
                         throws IOException {
         if (!(obj instanceof String))
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java
index dc5e06d..5dea467 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,7 @@
      * return the DataFlavors for this <code>DataContentHandler</code>
      * @return The DataFlavors.
      */
+    @Override
     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
         DataFlavor flavors[] = new DataFlavor[2];
 
@@ -69,10 +70,11 @@
 
     /**
      * return the Transfer Data of type DataFlavor from InputStream
-     * @param df The DataFlavor.
-     * @param ins The InputStream corresponding to the data.
+     * @param flavor The DataFlavor.
+     * @param dataSource The DataSource.
      * @return The constructed Object.
      */
+    @Override
     public Object getTransferData(DataFlavor flavor, DataSource dataSource)
         throws IOException {
         if (flavor.getMimeType().startsWith("text/xml") ||
@@ -87,6 +89,7 @@
     /**
      *
      */
+    @Override
     public Object getContent(DataSource dataSource) throws IOException {
         return new StreamSource(dataSource.getInputStream());
     }
@@ -96,6 +99,7 @@
      * (similar semantically to previous method, we are deciding
      *  which one to support)
      */
+    @Override
     public void writeTo(Object obj, String mimeType, OutputStream os)
         throws IOException {
         if (!mimeType.startsWith("text/xml") && !mimeType.startsWith("application/xml"))
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java
index 8da4d8a..4993bf7 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
 import org.w3c.dom.*;
 import org.w3c.dom.Node;
 
@@ -60,6 +61,10 @@
         super(ownerDoc, bodyName);
     }
 
+    public BodyImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract NameImpl getFaultName(String name);
     protected abstract boolean isFault(SOAPElement child);
     protected abstract SOAPBodyElement createBodyElement(Name name);
@@ -155,7 +160,7 @@
         if (hasFault()) {
             if (fault == null) {
                 //initialize fault member
-                fault = (SOAPFault) getFirstChildElement();
+                fault = (SOAPFault) getSoapDocument().find(getFirstChildElement());
             }
             return fault;
         }
@@ -259,11 +264,12 @@
     }
 
     protected SOAPElement convertToSoapElement(Element element) {
-        if ((element instanceof SOAPBodyElement) &&
+        final Node soapNode = getSoapDocument().findIfPresent(element);
+        if ((soapNode instanceof SOAPBodyElement) &&
             //this check is required because ElementImpl currently
             // implements SOAPBodyElement
-            !(element.getClass().equals(ElementImpl.class))) {
-            return (SOAPElement) element;
+            !(soapNode.getClass().equals(ElementImpl.class))) {
+            return (SOAPElement) soapNode;
         } else {
             return replaceElementWithSOAPElement(
                 element,
@@ -314,7 +320,7 @@
 
         Document document = null;
         try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAAJUtil.getSystemClassLoader());
             factory.setNamespaceAware(true);
             DocumentBuilder builder = factory.newDocumentBuilder();
             document = builder.newDocument();
@@ -440,7 +446,7 @@
             //not lazy -Just get first child element and return its attribute
             Element elem = getFirstChildElement();
             if (elem != null) {
-                return elem.getAttribute(localName);
+                return elem.getAttribute(getLocalName());
             }
         }
         return null;
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
index c64e3f8..b406caf 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,10 +32,17 @@
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.w3c.dom.UserDataHandler;
 
-public class CDATAImpl
-    extends com.sun.org.apache.xerces.internal.dom.CDATASectionImpl
-    implements javax.xml.soap.Text {
+public class CDATAImpl implements CDATASection, javax.xml.soap.Text {
 
     protected static final Logger log =
         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
@@ -44,8 +51,256 @@
     static final String cdataUC = "<![CDATA[";
     static final String cdataLC = "<![cdata[";
 
+    @Override
+    public Text splitText(int offset) throws DOMException {
+        return cdataSection.splitText(offset);
+    }
+
+    @Override
+    public boolean isElementContentWhitespace() {
+        return cdataSection.isElementContentWhitespace();
+    }
+
+    @Override
+    public String getWholeText() {
+        return cdataSection.getWholeText();
+    }
+
+    @Override
+    public Text replaceWholeText(String content) throws DOMException {
+        return cdataSection.replaceWholeText(content);
+    }
+
+    @Override
+    public String getData() throws DOMException {
+        return cdataSection.getData();
+    }
+
+    @Override
+    public void setData(String data) throws DOMException {
+        cdataSection.setData(data);
+    }
+
+    @Override
+    public int getLength() {
+        return cdataSection.getLength();
+    }
+
+    @Override
+    public String substringData(int offset, int count) throws DOMException {
+        return cdataSection.substringData(offset, count);
+    }
+
+    @Override
+    public void appendData(String arg) throws DOMException {
+        cdataSection.appendData(arg);
+    }
+
+    @Override
+    public void insertData(int offset, String arg) throws DOMException {
+        cdataSection.insertData(offset, arg);
+    }
+
+    @Override
+    public void deleteData(int offset, int count) throws DOMException {
+        cdataSection.deleteData(offset, count);
+    }
+
+    @Override
+    public void replaceData(int offset, int count, String arg) throws DOMException {
+        cdataSection.replaceData(offset, count, arg);
+    }
+
+    @Override
+    public String getNodeName() {
+        return cdataSection.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return cdataSection.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        cdataSection.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return cdataSection.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return cdataSection.getParentNode();
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return cdataSection.getChildNodes();
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return cdataSection.getFirstChild();
+    }
+
+    @Override
+    public Node getLastChild() {
+        return cdataSection.getLastChild();
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return cdataSection.getPreviousSibling();
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return cdataSection.getNextSibling();
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return cdataSection.getAttributes();
+    }
+
+    @Override
+    public Document getOwnerDocument() {
+        return cdataSection.getOwnerDocument();
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return cdataSection.insertBefore(newChild, refChild);
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return cdataSection.replaceChild(newChild, oldChild);
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return cdataSection.removeChild(oldChild);
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return cdataSection.appendChild(newChild);
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return cdataSection.hasChildNodes();
+    }
+
+    @Override
+    public Node cloneNode(boolean deep) {
+        return cdataSection.cloneNode(deep);
+    }
+
+    @Override
+    public void normalize() {
+        cdataSection.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return cdataSection.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return cdataSection.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return cdataSection.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        cdataSection.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return cdataSection.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return cdataSection.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return cdataSection.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return cdataSection.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return cdataSection.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        cdataSection.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return cdataSection.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return cdataSection.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return cdataSection.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return cdataSection.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return cdataSection.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return cdataSection.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return cdataSection.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return cdataSection.getUserData(key);
+    }
+
+    private CDATASection cdataSection;
+
     public CDATAImpl(SOAPDocumentImpl ownerDoc, String text) {
-        super(ownerDoc, text);
+        cdataSection = ownerDoc.getDomDocument().createCDATASection(text);
+        ownerDoc.register(this);
     }
 
     public String getValue() {
@@ -87,4 +342,8 @@
     public boolean isComment() {
         return false;
     }
+
+    public CDATASection getDomElement() {
+        return cdataSection;
+    }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java
index 36291b9..aeeb60b 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java
@@ -31,6 +31,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.soap.*;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
 import org.w3c.dom.Element;
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
@@ -41,6 +42,10 @@
         super(ownerDoc, detailName);
     }
 
+    public DetailImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract DetailEntry createDetailEntry(Name name);
     protected abstract DetailEntry createDetailEntry(QName name);
 
@@ -65,8 +70,9 @@
     }
 
     protected SOAPElement convertToSoapElement(Element element) {
-        if (element instanceof DetailEntry) {
-            return (SOAPElement) element;
+        final javax.xml.soap.Node soapNode = getSoapDocument().find(element);
+        if (soapNode instanceof DetailEntry) {
+            return (SOAPElement) soapNode;
         } else {
             DetailEntry detailEntry =
                 createDetailEntry(NameImpl.copyElementName(element));
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java
index 948a9a0..20aa00b 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,8 +30,22 @@
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
-import com.sun.xml.internal.messaging.saaj.soap.ver1_1.*;
-import com.sun.xml.internal.messaging.saaj.soap.ver1_2.*;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Body1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Detail1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Envelope1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Fault1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.FaultElement1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.Header1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Body1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Detail1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Envelope1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Fault1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.Header1_2Impl;
+import com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPPart1_2Impl;
+import org.w3c.dom.Element;
+
+import java.util.Objects;
 
 
 public class ElementFactory {
@@ -54,6 +68,72 @@
             name.getNamespaceURI());
     }
 
+    /**
+     * Create element wrapper for existing DOM element.
+     *
+     * @param ownerDocument SOAP document wrapper not null
+     * @param element DOM element not null
+     * @return SOAP wrapper for DOM element
+     */
+    public static SOAPElement createElement(SOAPDocumentImpl ownerDocument, Element element) {
+        Objects.requireNonNull(ownerDocument);
+        Objects.requireNonNull(element);
+
+        String localName = element.getLocalName();
+        String namespaceUri = element.getNamespaceURI();
+        String prefix = element.getPrefix();
+
+        if ("Envelope".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Envelope1_1Impl(ownerDocument, element);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Envelope1_2Impl(ownerDocument, element);
+            }
+        }
+        if ("Body".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Body1_1Impl(ownerDocument, element);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Body1_2Impl(ownerDocument, element);
+            }
+        }
+        if ("Header".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Header1_1Impl(ownerDocument, element);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Header1_2Impl(ownerDocument, element);
+            }
+        }
+        if ("Fault".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Fault1_1Impl(element, ownerDocument);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Fault1_2Impl(element, ownerDocument);
+            }
+
+        }
+        if ("Detail".equalsIgnoreCase(localName)) {
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new Detail1_1Impl(ownerDocument, element);
+            } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
+                return new Detail1_2Impl(ownerDocument, element);
+            }
+        }
+        if ("faultcode".equalsIgnoreCase(localName)
+                || "faultstring".equalsIgnoreCase(localName)
+                || "faultactor".equalsIgnoreCase(localName)) {
+            // SOAP 1.2 does not have fault(code/string/actor)
+            // So there is no else case required
+            if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
+                return new FaultElement1_1Impl(ownerDocument,
+                        localName,
+                        prefix);
+            }
+        }
+
+        return new ElementImpl(ownerDocument, element);
+    }
+
     public static SOAPElement createElement(
         SOAPDocumentImpl ownerDocument,
         String localName,
@@ -92,28 +172,28 @@
             prefix = NameImpl.SOAP_ENVELOPE_PREFIX;
         }
 
-        if (localName.equalsIgnoreCase("Envelope")) {
+        if ("Envelope".equalsIgnoreCase(localName)) {
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 return new Envelope1_1Impl(ownerDocument, prefix);
             } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
                 return new Envelope1_2Impl(ownerDocument, prefix);
             }
         }
-        if (localName.equalsIgnoreCase("Body")) {
+        if ("Body".equalsIgnoreCase(localName)) {
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 return new Body1_1Impl(ownerDocument, prefix);
             } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
                 return new Body1_2Impl(ownerDocument, prefix);
             }
         }
-        if (localName.equalsIgnoreCase("Header")) {
+        if ("Header".equalsIgnoreCase(localName)) {
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 return new Header1_1Impl(ownerDocument, prefix);
             } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
                 return new Header1_2Impl(ownerDocument, prefix);
             }
         }
-        if (localName.equalsIgnoreCase("Fault")) {
+        if ("Fault".equalsIgnoreCase(localName)) {
             SOAPFault fault = null;
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 fault = new Fault1_1Impl(ownerDocument, prefix);
@@ -139,16 +219,16 @@
             }
 
         }
-        if (localName.equalsIgnoreCase("Detail")) {
+        if ("Detail".equalsIgnoreCase(localName)) {
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
                 return new Detail1_1Impl(ownerDocument, prefix);
             } else if (NameImpl.SOAP12_NAMESPACE.equals(namespaceUri)) {
                 return new Detail1_2Impl(ownerDocument, prefix);
             }
         }
-        if (localName.equalsIgnoreCase("faultcode")
-            || localName.equalsIgnoreCase("faultstring")
-            || localName.equalsIgnoreCase("faultactor")) {
+        if ("faultcode".equalsIgnoreCase(localName)
+                || "faultstring".equalsIgnoreCase(localName)
+                || "faultactor".equalsIgnoreCase(localName)) {
             // SOAP 1.2 does not have fault(code/string/actor)
             // So there is no else case required
             if (NameImpl.SOAP11_NAMESPACE.equals(namespaceUri)) {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
index 10070cc..5f9ffc3 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
@@ -43,9 +43,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.*;
 
-public class ElementImpl
-    extends com.sun.org.apache.xerces.internal.dom.ElementNSImpl
-    implements SOAPElement, SOAPBodyElement {
+public class ElementImpl implements SOAPElement, SOAPBodyElement {
 
     public static final String DSIG_NS = "http://www.w3.org/2000/09/xmldsig#".intern();
     public static final String XENC_NS = "http://www.w3.org/2001/04/xmlenc#".intern();
@@ -55,6 +53,69 @@
 
     protected QName elementQName;
 
+    private Element element;
+
+    private SOAPDocumentImpl soapDocument;
+
+    @Override
+    public String getTagName() {
+        return element.getTagName();
+    }
+
+    @Override
+    public String getAttribute(String name) {
+        return element.getAttribute(name);
+    }
+
+    @Override
+    public void setAttribute(String name, String value) throws DOMException {
+        boolean isQualifiedName = (name.indexOf(":") > 0);
+        //this is because of BugfixTest#testCR7020991, after removal internal dependencies
+        //SOAPDocumentImpl#createAttribute is not called anymore from xerces parent
+        if (isQualifiedName) {
+            String nsUri = null;
+            String prefix = name.substring(0, name.indexOf(":"));
+            //cannot do anything to resolve the URI if prefix is not
+            //XMLNS.
+            if (XMLNS.equals(prefix)) {
+                nsUri = ElementImpl.XMLNS_URI;
+                setAttributeNS(nsUri, name, value);
+                return;
+            }
+        }
+        element.setAttribute(name, value);
+    }
+
+    @Override
+    public void removeAttribute(String name) throws DOMException {
+        element.removeAttribute(name);
+    }
+
+    @Override
+    public Attr getAttributeNode(String name) {
+        return element.getAttributeNode(name);
+    }
+
+    @Override
+    public Attr setAttributeNode(Attr newAttr) throws DOMException {
+        return element.setAttributeNode(newAttr);
+    }
+
+    @Override
+    public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
+        return element.removeAttributeNode(oldAttr);
+    }
+
+    @Override
+    public NodeList getElementsByTagName(String name) {
+        return new NodeListImpl(getSoapDocument(), element.getElementsByTagName(name));
+    }
+
+    @Override
+    public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
+        return element.getAttributeNS(namespaceURI, localName);
+    }
+
     protected static final Logger log =
         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
@@ -72,22 +133,27 @@
      */
     public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern();
 
+    private final static String XMLNS = "xmlns".intern();
+
     public ElementImpl(SOAPDocumentImpl ownerDoc, Name name) {
-        super(
-            ownerDoc,
-            name.getURI(),
-            name.getQualifiedName(),
-            name.getLocalName());
+        this.soapDocument = ownerDoc;
+        this.element = ownerDoc.getDomDocument().createElementNS(name.getURI(), name.getQualifiedName());
         elementQName = NameImpl.convertToQName(name);
+        getSoapDocument().register(this);
     }
 
     public ElementImpl(SOAPDocumentImpl ownerDoc, QName name) {
-        super(
-            ownerDoc,
-            name.getNamespaceURI(),
-            getQualifiedName(name),
-            name.getLocalPart());
+        this.soapDocument = ownerDoc;
+        this.element = ownerDoc.getDomDocument().createElementNS(name.getNamespaceURI(), getQualifiedName(name));
         elementQName = name;
+        getSoapDocument().register(this);
+    }
+
+    public ElementImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        this.element = domElement;
+        this.soapDocument = ownerDoc;
+        this.elementQName = new QName(domElement.getNamespaceURI(), domElement.getLocalName());
+        getSoapDocument().register(this);
     }
 
     public ElementImpl(
@@ -95,9 +161,11 @@
         String uri,
         String qualifiedName) {
 
-        super(ownerDoc, uri, qualifiedName);
+        this.soapDocument = ownerDoc;
+        this.element = ownerDoc.getDomDocument().createElementNS(uri, qualifiedName);
         elementQName =
             new QName(uri, getLocalPart(qualifiedName), getPrefix(qualifiedName));
+        getSoapDocument().register(this);
     }
 
     public void ensureNamespaceIsDeclared(String prefix, String uri) {
@@ -111,11 +179,132 @@
     }
 
     public Document getOwnerDocument() {
-        Document doc = super.getOwnerDocument();
-        if (doc instanceof SOAPDocument)
-            return ((SOAPDocument) doc).getDocument();
-        else
-            return doc;
+        return soapDocument;
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return element.insertBefore(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(refChild));
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return element.replaceChild(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(oldChild));
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return element.removeChild(getSoapDocument().getDomNode(oldChild));
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return element.appendChild(getSoapDocument().getDomNode(newChild));
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return element.hasChildNodes();
+    }
+
+    @Override
+    public Node cloneNode(boolean deep) {
+        return element.cloneNode(deep);
+    }
+
+    @Override
+    public void normalize() {
+        element.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return element.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return element.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return element.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        element.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return element.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return element.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return element.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return element.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return element.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        element.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return element.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return element.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return element.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return element.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return element.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return element.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return element.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return element.getUserData(key);
     }
 
     public SOAPElement addChildElement(Name name) throws SOAPException {
@@ -353,13 +542,16 @@
         // preserve the encodingStyle attr as it may get lost in the import
         String encodingStyle = element.getEncodingStyle();
 
-        ElementImpl importedElement = (ElementImpl) importElement(element);
+        final Element domElement = ((ElementImpl) element).getDomElement();
+        final Element importedElement = importElement(domElement);
         addNode(importedElement);
 
-        if (encodingStyle != null)
-            importedElement.setEncodingStyle(encodingStyle);
+        final SOAPElement converted = convertToSoapElement(importedElement);
 
-        return convertToSoapElement(importedElement);
+        if (encodingStyle != null)
+            converted.setEncodingStyle(encodingStyle);
+
+        return converted;
     }
 
     protected Element importElement(Element element) {
@@ -374,7 +566,7 @@
 
     protected SOAPElement addElement(Name name) throws SOAPException {
         SOAPElement newElement = createElement(name);
-        addNode(newElement);
+        addNode(((ElementImpl) newElement).getDomElement());
         return newElement;
     }
 
@@ -411,7 +603,7 @@
     }
 
     protected void addNode(org.w3c.dom.Node newElement) throws SOAPException {
-        insertBefore(newElement, null);
+        insertBefore(getSoapDocument().getDomNode(newElement), null);
 
         if (getOwnerDocument() instanceof DocumentFragment)
             return;
@@ -431,7 +623,7 @@
         Node child = getFirstChild();
         while (child != null) {
             if (child instanceof Element) {
-                return ((Element) child);
+                return (Element) getSoapDocument().find(child);
             }
             child = child.getNextSibling();
         }
@@ -441,10 +633,12 @@
     protected SOAPElement findChild(NameImpl name) {
         Node eachChild = getFirstChild();
         while (eachChild != null) {
-            if (eachChild instanceof SOAPElement) {
-                SOAPElement eachChildSoap = (SOAPElement) eachChild;
-                if (eachChildSoap.getElementName().equals(name)) {
-                    return eachChildSoap;
+            if (eachChild instanceof Element) {
+                SOAPElement eachChildSoap = (SOAPElement) getSoapDocument().find(eachChild);
+                if (eachChildSoap != null) {
+                    if (eachChildSoap.getElementName().equals(name)) {
+                        return eachChildSoap;
+                    }
                 }
             }
             eachChild = eachChild.getNextSibling();
@@ -474,14 +668,14 @@
 
     protected SOAPElement addCDATA(String text) throws SOAPException {
         org.w3c.dom.Text cdata =
-            (org.w3c.dom.Text) getOwnerDocument().createCDATASection(text);
+                getOwnerDocument().createCDATASection(text);
         addNode(cdata);
         return this;
     }
 
     protected SOAPElement addText(String text) throws SOAPException {
         org.w3c.dom.Text textNode =
-            (org.w3c.dom.Text) getOwnerDocument().createTextNode(text);
+                getOwnerDocument().createTextNode(text);
         addNode(textNode);
         return this;
     }
@@ -684,8 +878,9 @@
     }
 
     protected SOAPElement convertToSoapElement(Element element) {
-        if (element instanceof SOAPElement) {
-            return (SOAPElement) element;
+        final Node soapNode = getSoapDocument().findIfPresent(element);
+        if (soapNode instanceof SOAPElement) {
+            return (SOAPElement) soapNode;
         } else {
             return replaceElementWithSOAPElement(
                 element,
@@ -693,7 +888,7 @@
         }
     }
 
-    protected static SOAPElement replaceElementWithSOAPElement(
+    protected SOAPElement replaceElementWithSOAPElement(
         Element element,
         ElementImpl copy) {
 
@@ -709,7 +904,7 @@
             copy.insertBefore(nextChild, null);
         }
 
-        Node parent = element.getParentNode();
+        Node parent = getSoapDocument().find(element.getParentNode());
         if (parent != null) {
             parent.replaceChild(copy, element);
         } // XXX else throw an exception?
@@ -727,8 +922,8 @@
                 if (next == null) {
                     while (eachNode.hasNext()) {
                         Node node = eachNode.next();
-                        if (node instanceof SOAPElement) {
-                            next = node;
+                        if (node instanceof Element) {
+                            next = getSoapDocument().findIfPresent(node);
                             break;
                         }
                     }
@@ -899,14 +1094,14 @@
     protected javax.xml.soap.Node getValueNode() {
         Iterator<Node> i = getChildElements();
         while (i.hasNext()) {
-            javax.xml.soap.Node n = (javax.xml.soap.Node) i.next();
+            Node n = i.next();
             if (n.getNodeType() == org.w3c.dom.Node.TEXT_NODE ||
                 n.getNodeType() == org.w3c.dom.Node.CDATA_SECTION_NODE) {
                 // TODO: Hack to fix text node split into multiple lines.
                 normalize();
                 // Should remove the normalization step when this gets fixed in
                 // DOM/Xerces.
-                return (javax.xml.soap.Node) n;
+                return getSoapDocument().find(n);
             }
         }
         return null;
@@ -948,7 +1143,7 @@
         if (parentNode instanceof SOAPDocument) {
             return null;
         }
-        return (SOAPElement) parentNode;
+        return (SOAPElement) getSoapDocument().find(parentNode);
     }
 
     protected String getSOAPNamespace() {
@@ -975,7 +1170,7 @@
     public void detachNode() {
         Node parent = getParentNode();
         if (parent != null) {
-            parent.removeChild(this);
+            parent.removeChild(element);
         }
         encodingStyleAttribute.clearNameAndValue();
         // Fix for CR: 6474641
@@ -1136,17 +1331,18 @@
         return attribute == null ? null : attribute.getValue();
     }
 
-    protected static Iterator<Node> getChildElementsFrom(final Element element) {
+    protected Iterator<Node> getChildElementsFrom(final Element element) {
         return new Iterator<Node>() {
             Node next = element.getFirstChild();
             Node nextNext = null;
             Node last = null;
+            Node soapElement = getSoapDocument().findIfPresent(element);
 
             public boolean hasNext() {
                 if (next != null) {
                     return true;
                 }
-                if (next == null && nextNext != null) {
+                if (nextNext != null) {
                     next = nextNext;
                 }
 
@@ -1158,15 +1354,15 @@
                     last = next;
                     next = null;
 
-                    if ((element instanceof ElementImpl)
-                        && (last instanceof Element)) {
+                    if ((soapElement instanceof ElementImpl)
+                            && (last instanceof Element)) {
                         last =
-                            ((ElementImpl) element).convertToSoapElement(
-                                (Element) last);
+                                ((ElementImpl) soapElement).convertToSoapElement(
+                                        (Element) last);
                     }
 
                     nextNext = last.getNextSibling();
-                    return last;
+                    return getSoapDocument().findIfPresent(last);
                 }
                 throw new NoSuchElementException();
             }
@@ -1251,7 +1447,7 @@
 //                SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(value)))
 //            return;
 
-        super.setAttributeNS(namespaceURI,qualifiedName,value);
+        element.setAttributeNS(namespaceURI,qualifiedName,value);
         //String tmpLocalName = this.getLocalName();
         String tmpURI = this.getNamespaceURI();
         boolean isIDNS = false;
@@ -1270,4 +1466,116 @@
 
     }
 
+    @Override
+    public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
+        element.removeAttributeNS(namespaceURI, localName);
+    }
+
+    @Override
+    public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
+        return element.getAttributeNodeNS(namespaceURI, localName);
+    }
+
+    @Override
+    public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
+        return element.setAttributeNodeNS(newAttr);
+    }
+
+    @Override
+    public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException {
+        return new NodeListImpl(getSoapDocument(), element.getElementsByTagNameNS(namespaceURI, localName));
+    }
+
+    @Override
+    public boolean hasAttribute(String name) {
+        return element.hasAttribute(name);
+    }
+
+    @Override
+    public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
+        return element.hasAttributeNS(namespaceURI, localName);
+    }
+
+    @Override
+    public TypeInfo getSchemaTypeInfo() {
+        return element.getSchemaTypeInfo();
+    }
+
+    @Override
+    public void setIdAttribute(String name, boolean isId) throws DOMException {
+        element.setIdAttribute(name, isId);
+    }
+
+    @Override
+    public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
+        element.setIdAttributeNS(namespaceURI, localName, isId);
+    }
+
+    @Override
+    public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
+        element.setIdAttributeNode(idAttr, isId);
+    }
+
+    @Override
+    public String getNodeName() {
+        return element.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return element.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        element.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return element.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return getSoapDocument().find(element.getParentNode());
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return new NodeListImpl(getSoapDocument(), element.getChildNodes());
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return getSoapDocument().findIfPresent(element.getFirstChild());
+    }
+
+    @Override
+    public Node getLastChild() {
+        return getSoapDocument().findIfPresent(element.getLastChild());
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return getSoapDocument().findIfPresent(element.getPreviousSibling());
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return getSoapDocument().findIfPresent(element.getNextSibling());
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return element.getAttributes();
+    }
+
+    public Element getDomElement() {
+        return element;
+    }
+
+    public SOAPDocumentImpl getSoapDocument() {
+        return soapDocument;
+    }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java
index d73ba5b..faaa3d8 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,7 @@
 
 import com.sun.xml.internal.org.jvnet.staxex.util.DOMStreamReader;
 import com.sun.xml.internal.org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter;
+import org.w3c.dom.Element;
 
 /**
  * Our implementation of the SOAP envelope.
@@ -92,6 +93,10 @@
             addBody();
     }
 
+    public EnvelopeImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract NameImpl getHeaderName(String prefix);
     protected abstract NameImpl getBodyName(String prefix);
 
@@ -122,7 +127,7 @@
         }
 
         header = (HeaderImpl) createElement(headerName);
-        insertBefore(header, firstChild);
+        insertBefore(header.getDomElement(), firstChild);
         header.ensureNamespaceIsDeclared(headerName.getPrefix(), headerName.getURI());
 
         return header;
@@ -161,7 +166,7 @@
         if (body == null) {
             NameImpl bodyName = getBodyName(prefix);
             body = (BodyImpl) createElement(bodyName);
-            insertBefore(body, null);
+            insertBefore(body.getDomElement(), null);
             body.ensureNamespaceIsDeclared(bodyName.getPrefix(), bodyName.getURI());
         } else {
             log.severe("SAAJ0122.impl.body.already.exists");
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java
index 2cf604a..447039e 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public abstract class FaultElementImpl
     extends ElementImpl
@@ -47,6 +48,10 @@
         super(ownerDoc, qname);
     }
 
+    public FaultElementImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract boolean isStandardFaultElement();
 
     public SOAPElement setElementQName(QName newName) throws SOAPException {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java
index 218ce0a..86fdfcf 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.soap.*;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
 import org.w3c.dom.Element;
 
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
@@ -53,6 +54,9 @@
         super(ownerDoc, name);
     }
 
+    public FaultImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
 
     protected abstract NameImpl getDetailName();
     protected abstract NameImpl getFaultCodeName();
@@ -83,6 +87,7 @@
             (SOAPFaultElement) findAndConvertChildElement(getFaultStringName());
     }
 
+    @Override
     public void setFaultCode(String faultCode) throws SOAPException {
         setFaultCode(
             NameImpl.getLocalNameFromTagName(faultCode),
@@ -131,6 +136,7 @@
         }
     }
 
+    @Override
     public void setFaultCode(Name faultCodeQName) throws SOAPException {
         setFaultCode(
             faultCodeQName.getLocalName(),
@@ -138,6 +144,7 @@
             faultCodeQName.getURI());
     }
 
+    @Override
     public void setFaultCode(QName faultCodeQName) throws SOAPException {
         setFaultCode(
             faultCodeQName.getLocalPart(),
@@ -165,6 +172,7 @@
         detail = (Detail) findAndConvertChildElement(detailName);
     }
 
+    @Override
     public Detail getDetail() {
         if (detail == null)
             initializeDetail();
@@ -175,6 +183,7 @@
         return detail;
     }
 
+    @Override
     public Detail addDetail() throws SOAPException {
         if (detail == null)
             initializeDetail();
@@ -188,12 +197,15 @@
         }
     }
 
+    @Override
     public boolean hasDetail() {
         return (getDetail() != null);
     }
 
+    @Override
     public abstract void setFaultActor(String faultActor) throws SOAPException;
 
+    @Override
     public String getFaultActor() {
         if (this.faultActorElement == null)
             findFaultActorElement();
@@ -203,6 +215,7 @@
         return null;
     }
 
+    @Override
     public SOAPElement setElementQName(QName newName) throws SOAPException {
 
         log.log(
@@ -213,11 +226,13 @@
             "Cannot change name for " + elementQName.getLocalPart() + " to " + newName.getLocalPart());
     }
 
+    @Override
     protected SOAPElement convertToSoapElement(Element element) {
-        if (element instanceof SOAPFaultElement) {
-            return (SOAPElement) element;
-        } else if (element instanceof SOAPElement) {
-            SOAPElement soapElement = (SOAPElement) element;
+        final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element);
+        if (soapNode instanceof SOAPFaultElement) {
+            return (SOAPElement) soapNode;
+        } else if (soapNode instanceof SOAPElement) {
+            SOAPElement soapElement = (SOAPElement) soapNode;
             if (getDetailName().equals(soapElement.getElementName())) {
                 return replaceElementWithSOAPElement(element, createDetail());
             } else {
@@ -233,12 +248,12 @@
             Name elementName = NameImpl.copyElementName(element);
             ElementImpl newElement;
             if (getDetailName().equals(elementName)) {
-                newElement = (ElementImpl) createDetail();
+                newElement = createDetail();
             } else {
                 String localName = elementName.getLocalName();
                 if (isStandardFaultElement(localName))
                     newElement =
-                        (ElementImpl) createSOAPFaultElement(elementName);
+                        createSOAPFaultElement(elementName);
                 else
                     newElement = (ElementImpl) createElement(elementName);
             }
@@ -284,6 +299,7 @@
         }
     }
 
+    @Override
     protected SOAPElement addElement(Name name) throws SOAPException {
         if (getDetailName().equals(name)) {
             return addDetail();
@@ -297,6 +313,7 @@
         return super.addElement(name);
     }
 
+    @Override
     protected SOAPElement addElement(QName name) throws SOAPException {
         return addElement(NameImpl.convertToName(name));
     }
@@ -311,6 +328,8 @@
 
     /**
      * Convert an xml:lang attribute value into a Locale object
+     * @param xmlLang xml:lang attribute value
+     * @return Locale
      */
     protected static Locale xmlLangToLocale(String xmlLang) {
         if (xmlLang == null) {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
index a9e4adb..0d9f7ad 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.soap.*;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
 import org.w3c.dom.Element;
 
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
@@ -45,6 +46,10 @@
         super(ownerDoc, name);
     }
 
+    public HeaderImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected abstract SOAPHeaderElement createHeaderElement(Name name)
         throws SOAPException;
     protected abstract SOAPHeaderElement createHeaderElement(QName name)
@@ -276,8 +281,9 @@
     }
 
     protected SOAPElement convertToSoapElement(Element element) {
-        if (element instanceof SOAPHeaderElement) {
-            return (SOAPElement) element;
+        final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element);
+        if (soapNode instanceof SOAPHeaderElement) {
+            return (SOAPElement) soapNode;
         } else {
             SOAPHeaderElement headerElement;
             try {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NodeListImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NodeListImpl.java
new file mode 100644
index 0000000..141265a
--- /dev/null
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NodeListImpl.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.messaging.saaj.soap.impl;
+
+import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.util.Objects;
+
+/**
+ * Node list wrapper, finding SOAP elements automatically when possible.
+ *
+ * @author Roman Grigoriadi
+ */
+public class NodeListImpl implements NodeList {
+
+    private final SOAPDocumentImpl soapDocument;
+
+    private final NodeList nodeList;
+
+    public NodeListImpl(SOAPDocumentImpl soapDocument, NodeList nodeList) {
+        Objects.requireNonNull(soapDocument);
+        Objects.requireNonNull(soapDocument);
+        this.soapDocument = soapDocument;
+        this.nodeList = nodeList;
+    }
+
+    @Override
+    public Node item(int index) {
+        return soapDocument.findIfPresent(nodeList.item(index));
+    }
+
+    @Override
+    public int getLength() {
+        return nodeList.getLength();
+    }
+}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
index c306beb..85fbb14 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,14 +31,20 @@
 import javax.xml.soap.SOAPElement;
 import javax.xml.soap.SOAPException;
 
+import com.sun.xml.internal.messaging.saaj.util.SAAJUtil;
+import org.w3c.dom.Comment;
 import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 import org.w3c.dom.Text;
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.UserDataHandler;
 
 public class SOAPCommentImpl
-    extends com.sun.org.apache.xerces.internal.dom.CommentImpl
     implements javax.xml.soap.Text, org.w3c.dom.Comment {
 
     protected static final Logger log =
@@ -47,8 +53,236 @@
     protected static ResourceBundle rb =
         log.getResourceBundle();
 
+    @Override
+    public String getData() throws DOMException {
+        return comment.getData();
+    }
+
+    @Override
+    public void setData(String data) throws DOMException {
+        comment.setData(data);
+    }
+
+    @Override
+    public int getLength() {
+        return comment.getLength();
+    }
+
+    @Override
+    public String substringData(int offset, int count) throws DOMException {
+        return comment.substringData(offset, count);
+    }
+
+    @Override
+    public void appendData(String arg) throws DOMException {
+        comment.appendData(arg);
+    }
+
+    @Override
+    public void insertData(int offset, String arg) throws DOMException {
+        comment.insertData(offset, arg);
+    }
+
+    @Override
+    public void deleteData(int offset, int count) throws DOMException {
+        comment.deleteData(offset, count);
+    }
+
+    @Override
+    public void replaceData(int offset, int count, String arg) throws DOMException {
+        comment.replaceData(offset, count, arg);
+    }
+
+    @Override
+    public String getNodeName() {
+        return comment.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return comment.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        comment.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return comment.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return comment.getParentNode();
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return comment.getChildNodes();
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return comment.getFirstChild();
+    }
+
+    @Override
+    public Node getLastChild() {
+        return comment.getLastChild();
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return comment.getPreviousSibling();
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return comment.getNextSibling();
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return comment.getAttributes();
+    }
+
+    @Override
+    public Document getOwnerDocument() {
+        return comment.getOwnerDocument();
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return comment.insertBefore(newChild, refChild);
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return comment.replaceChild(newChild, oldChild);
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return comment.removeChild(oldChild);
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return comment.appendChild(newChild);
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return comment.hasChildNodes();
+    }
+
+    @Override
+    public Node cloneNode(boolean deep) {
+        return comment.cloneNode(deep);
+    }
+
+    @Override
+    public void normalize() {
+        comment.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return comment.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return comment.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return comment.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        comment.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return comment.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return comment.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return comment.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return comment.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return comment.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        comment.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return comment.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return comment.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return comment.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return comment.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return comment.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return comment.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return comment.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return comment.getUserData(key);
+    }
+
+    private Comment comment;
+
     public SOAPCommentImpl(SOAPDocumentImpl ownerDoc, String text) {
-        super(ownerDoc, text);
+        comment = ownerDoc.getDomDocument().createComment(text);
+        ownerDoc.register(this);
     }
 
     public String getValue() {
@@ -111,4 +345,7 @@
         throw new UnsupportedOperationException("Not Supported");
     }
 
+    public Comment getDomElement() {
+        return comment;
+    }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java
index c088928..076cacb 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,17 +32,271 @@
 
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.w3c.dom.UserDataHandler;
 
 public class SOAPTextImpl
-    extends com.sun.org.apache.xerces.internal.dom.TextImpl
     implements javax.xml.soap.Text, org.w3c.dom.Text {
 
+    @Override
+    public Text splitText(int offset) throws DOMException {
+        return textNode.splitText(offset);
+    }
+
+    @Override
+    public boolean isElementContentWhitespace() {
+        return textNode.isElementContentWhitespace();
+    }
+
+    @Override
+    public String getWholeText() {
+        return textNode.getWholeText();
+    }
+
+    @Override
+    public Text replaceWholeText(String content) throws DOMException {
+        return textNode.replaceWholeText(content);
+    }
+
+    @Override
+    public String getData() throws DOMException {
+        return textNode.getData();
+    }
+
+    @Override
+    public void setData(String data) throws DOMException {
+        textNode.setData(data);
+    }
+
+    @Override
+    public int getLength() {
+        return textNode.getLength();
+    }
+
+    @Override
+    public String substringData(int offset, int count) throws DOMException {
+        return textNode.substringData(offset, count);
+    }
+
+    @Override
+    public void appendData(String arg) throws DOMException {
+        textNode.appendData(arg);
+    }
+
+    @Override
+    public void insertData(int offset, String arg) throws DOMException {
+        textNode.insertData(offset, arg);
+    }
+
+    @Override
+    public void deleteData(int offset, int count) throws DOMException {
+        textNode.deleteData(offset, count);
+    }
+
+    @Override
+    public void replaceData(int offset, int count, String arg) throws DOMException {
+        textNode.replaceData(offset, count, arg);
+    }
+
+    @Override
+    public String getNodeName() {
+        return textNode.getNodeName();
+    }
+
+    @Override
+    public String getNodeValue() throws DOMException {
+        return textNode.getNodeValue();
+    }
+
+    @Override
+    public void setNodeValue(String nodeValue) throws DOMException {
+        textNode.setNodeValue(nodeValue);
+    }
+
+    @Override
+    public short getNodeType() {
+        return textNode.getNodeType();
+    }
+
+    @Override
+    public Node getParentNode() {
+        return textNode.getParentNode();
+    }
+
+    @Override
+    public NodeList getChildNodes() {
+        return textNode.getChildNodes();
+    }
+
+    @Override
+    public Node getFirstChild() {
+        return textNode.getFirstChild();
+    }
+
+    @Override
+    public Node getLastChild() {
+        return textNode.getLastChild();
+    }
+
+    @Override
+    public Node getPreviousSibling() {
+        return textNode.getPreviousSibling();
+    }
+
+    @Override
+    public Node getNextSibling() {
+        return textNode.getNextSibling();
+    }
+
+    @Override
+    public NamedNodeMap getAttributes() {
+        return textNode.getAttributes();
+    }
+
+    @Override
+    public Document getOwnerDocument() {
+        return textNode.getOwnerDocument();
+    }
+
+    @Override
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+        return textNode.insertBefore(newChild, refChild);
+    }
+
+    @Override
+    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+        return textNode.replaceChild(newChild, oldChild);
+    }
+
+    @Override
+    public Node removeChild(Node oldChild) throws DOMException {
+        return textNode.removeChild(oldChild);
+    }
+
+    @Override
+    public Node appendChild(Node newChild) throws DOMException {
+        return textNode.appendChild(newChild);
+    }
+
+    @Override
+    public boolean hasChildNodes() {
+        return textNode.hasChildNodes();
+    }
+
+    @Override
+    public Node cloneNode(boolean deep) {
+        return textNode.cloneNode(deep);
+    }
+
+    @Override
+    public void normalize() {
+        textNode.normalize();
+    }
+
+    @Override
+    public boolean isSupported(String feature, String version) {
+        return textNode.isSupported(feature, version);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return textNode.getNamespaceURI();
+    }
+
+    @Override
+    public String getPrefix() {
+        return textNode.getPrefix();
+    }
+
+    @Override
+    public void setPrefix(String prefix) throws DOMException {
+        textNode.setPrefix(prefix);
+    }
+
+    @Override
+    public String getLocalName() {
+        return textNode.getLocalName();
+    }
+
+    @Override
+    public boolean hasAttributes() {
+        return textNode.hasAttributes();
+    }
+
+    @Override
+    public String getBaseURI() {
+        return textNode.getBaseURI();
+    }
+
+    @Override
+    public short compareDocumentPosition(Node other) throws DOMException {
+        return textNode.compareDocumentPosition(other);
+    }
+
+    @Override
+    public String getTextContent() throws DOMException {
+        return textNode.getTextContent();
+    }
+
+    @Override
+    public void setTextContent(String textContent) throws DOMException {
+        textNode.setTextContent(textContent);
+    }
+
+    @Override
+    public boolean isSameNode(Node other) {
+        return textNode.isSameNode(other);
+    }
+
+    @Override
+    public String lookupPrefix(String namespaceURI) {
+        return textNode.lookupPrefix(namespaceURI);
+    }
+
+    @Override
+    public boolean isDefaultNamespace(String namespaceURI) {
+        return textNode.isDefaultNamespace(namespaceURI);
+    }
+
+    @Override
+    public String lookupNamespaceURI(String prefix) {
+        return textNode.lookupNamespaceURI(prefix);
+    }
+
+    @Override
+    public boolean isEqualNode(Node arg) {
+        return textNode.isEqualNode(arg);
+    }
+
+    @Override
+    public Object getFeature(String feature, String version) {
+        return textNode.getFeature(feature, version);
+    }
+
+    @Override
+    public Object setUserData(String key, Object data, UserDataHandler handler) {
+        return textNode.setUserData(key, data, handler);
+    }
+
+    @Override
+    public Object getUserData(String key) {
+        return textNode.getUserData(key);
+    }
+
     protected static final Logger log =
         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
 
+    private Text textNode;
+
     public SOAPTextImpl(SOAPDocumentImpl ownerDoc, String text) {
-        super(ownerDoc, text);
+        textNode = ownerDoc.getDomDocument().createTextNode(text);
+        ownerDoc.register(this);
     }
 
     public String getValue() {
@@ -70,7 +324,7 @@
     public void detachNode() {
         org.w3c.dom.Node parent = getParentNode();
         if (parent != null) {
-            parent.removeChild(this);
+            parent.removeChild(getDomElement());
         }
     }
 
@@ -88,4 +342,8 @@
         }
         return txt.startsWith("<!--") && txt.endsWith("-->");
     }
+
+    public Text getDomElement() {
+        return textNode;
+    }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java
index 5239932..86af990 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -218,6 +218,7 @@
         return prefix + ":" + localName;
     }
 
+    @Override
     public boolean equals(Object obj) {
         if (!(obj instanceof Name)) {
             return false;
@@ -236,6 +237,7 @@
         return true;
     }
 
+    @Override
     public int hashCode() {
         return localName.hashCode();
     }
@@ -245,6 +247,7 @@
      *
      * @return a string for the local name.
      */
+    @Override
     public String getLocalName() {
         return localName;
     }
@@ -256,6 +259,7 @@
      *
      * @return the prefix as a string.
      */
+    @Override
     public String getPrefix() {
         return prefix;
     }
@@ -265,6 +269,7 @@
      *
      * @return the uri as a string.
      */
+    @Override
     public String getURI() {
         return uri;
     }
@@ -272,6 +277,7 @@
     /**
      * Returns a String version of the name suitable for use in an XML document.
      */
+    @Override
     public String getQualifiedName() {
         if (qualifiedName == null) {
             if (prefix != null && prefix.length() > 0) {
@@ -285,6 +291,9 @@
 
     /**
      * Create a name object for a SOAP1.1 Envelope.
+     *
+     * @param prefix prefix
+     * @return Envelope Name
      */
     public static NameImpl createEnvelope1_1Name(String prefix) {
         return new Envelope1_1Name(prefix);
@@ -292,6 +301,9 @@
 
     /**
      * Create a name object for a SOAP1.2 Envelope.
+     *
+     * @param prefix prefix
+     * @return Envelope Name
      */
     public static NameImpl createEnvelope1_2Name(String prefix) {
         return new Envelope1_2Name(prefix);
@@ -299,6 +311,9 @@
 
     /**
      * Create a name object for a SOAP1.1 Header.
+     *
+     * @param prefix prefix
+     * @return Header Name
      */
     public static NameImpl createHeader1_1Name(String prefix) {
         return new Header1_1Name(prefix);
@@ -306,6 +321,9 @@
 
     /**
      * Create a name object for a SOAP1.2 Header.
+     *
+     * @param prefix prefix
+     * @return Header Name
      */
     public static NameImpl createHeader1_2Name(String prefix) {
         return new Header1_2Name(prefix);
@@ -313,6 +331,9 @@
 
     /**
      * Create a name object for a SOAP1.1 Body.
+     *
+     * @param prefix prefix
+     * @return Body Name
      */
     public static NameImpl createBody1_1Name(String prefix) {
         return new Body1_1Name(prefix);
@@ -320,6 +341,9 @@
 
     /**
      * Create a name object for a SOAP1.2 Body.
+     *
+     * @param prefix prefix
+     * @return Body Name
      */
     public static NameImpl createBody1_2Name(String prefix) {
         return new Body1_2Name(prefix);
@@ -327,20 +351,29 @@
 
     /**
      * Create a name object for a SOAP1.1 Fault.
+     *
+     * @param prefix prefix
+     * @return Fault Name
      */
     public static NameImpl createFault1_1Name(String prefix) {
         return new Fault1_1Name(prefix);
     }
 
     /**
-      * Create a name object for a SOAP1.2 NotUnderstood element.
-      */
+     * Create a name object for a SOAP1.2 NotUnderstood element.
+     *
+     * @param prefix prefix
+     * @return NotUnderstood Name
+     */
     public static NameImpl createNotUnderstood1_2Name(String prefix) {
         return new NotUnderstood1_2Name(prefix);
     }
 
     /**
      * Create a name object for a SOAP1.2 Upgrade element.
+     *
+     * @param prefix prefix
+     * @return Upgrade Name
      */
     public static NameImpl createUpgrade1_2Name(String prefix) {
         return new Upgrade1_2Name(prefix);
@@ -348,6 +381,9 @@
 
     /**
      * Create a name object for a SOAP1.2 SupportedEnvelope Upgrade element.
+     *
+     * @param prefix prefix
+     * @return Supported Envelope Name
      */
     public static NameImpl createSupportedEnvelope1_2Name(String prefix) {
         return new SupportedEnvelope1_2Name(prefix);
@@ -358,6 +394,8 @@
      * Fault, Reason or Detail.
      *
      * @param localName Local Name of element
+     * @param prefix prefix
+     * @return Fault Name
      */
     public static NameImpl createFault1_2Name(
         String localName,
@@ -369,6 +407,8 @@
      * Create a name object for a SOAP1.2 Fault/Code or Subcode.
      *
      * @param localName Either "Code" or "Subcode"
+     * @param prefix prefix
+     * @return CodeSubcode Name
      */
     public static NameImpl createCodeSubcode1_2Name(
         String prefix,
@@ -378,6 +418,8 @@
 
     /**
      * Create a name object for a SOAP1.1 Fault Detail.
+     *
+     * @return Detail Name
      */
     public static NameImpl createDetail1_1Name() {
         return new Detail1_1Name();
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java
index 12fb6d0..453abec 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,12 +38,17 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.BodyImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Body1_1Impl extends BodyImpl {
     public Body1_1Impl(SOAPDocumentImpl ownerDocument, String prefix) {
             super(ownerDocument, NameImpl.createBody1_1Name(prefix));
     }
 
+    public Body1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     public SOAPFault addSOAP12Fault(QName faultCode, String faultReason, Locale locale) {
         // log message here
         throw new UnsupportedOperationException("Not supported in SOAP 1.1");
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java
index 480ca25..acd4612 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.DetailImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Detail1_1Impl extends DetailImpl {
 
@@ -45,6 +46,11 @@
     public Detail1_1Impl(SOAPDocumentImpl ownerDoc) {
         super(ownerDoc, NameImpl.createDetail1_1Name());
     }
+
+    public Detail1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected DetailEntry createDetailEntry(Name name) {
         return new DetailEntry1_1Impl(
             (SOAPDocumentImpl) getOwnerDocument(),
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java
index c517fab..de55d8f 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Envelope1_1Impl extends EnvelopeImpl {
 
@@ -52,6 +53,11 @@
             createHeader,
             createBody);
     }
+
+    public Envelope1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getBodyName(String prefix) {
         return NameImpl.createBody1_1Name(prefix);
     }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java
index 00b8fb6..58c00c4 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
+import org.w3c.dom.Element;
 
 
 public class Fault1_1Impl extends FaultImpl {
@@ -59,6 +60,10 @@
        super(ownerDocument, NameImpl.createFault1_1Name(prefix));
     }
 
+    public Fault1_1Impl(Element domElement, SOAPDocumentImpl ownerDoc) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getDetailName() {
         return NameImpl.createDetail1_1Name();
     }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java
index a30911e..75b76d5 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.Element;
 
 public class Header1_1Impl extends HeaderImpl {
 
@@ -51,6 +52,10 @@
             super(ownerDocument, NameImpl.createHeader1_1Name(prefix));
     }
 
+    public Header1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getNotUnderstoodName() {
         log.log(
             Level.SEVERE,
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java
index abef584..1e57365 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.soap.*;
 
+import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
@@ -52,6 +53,10 @@
             super(ownerDocument, NameImpl.createBody1_2Name(prefix));
     }
 
+    public Body1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getFaultName(String name) {
         return NameImpl.createFault1_2Name(name, null);
     }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java
index 32fb78d..455d6e4 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.DetailImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Detail1_2Impl extends DetailImpl {
 
@@ -54,6 +55,10 @@
         super(ownerDocument, NameImpl.createSOAP12Name("Detail"));
     }
 
+    public Detail1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected DetailEntry createDetailEntry(Name name) {
         return new DetailEntry1_2Impl(
             ((SOAPDocument) getOwnerDocument()).getDocument(),
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java
index 53840bc..075a848 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
 import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+import org.w3c.dom.Element;
 
 public class Envelope1_2Impl extends EnvelopeImpl {
 
@@ -50,6 +51,10 @@
         super(ownerDoc, NameImpl.createEnvelope1_2Name(prefix));
     }
 
+    public Envelope1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     public Envelope1_2Impl(
         SOAPDocumentImpl ownerDoc,
         String prefix,
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java
index 6d655f1..3f206c1 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.impl.*;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.Element;
 
 
 public class Fault1_2Impl extends FaultImpl {
@@ -68,6 +69,10 @@
         super(ownerDocument, NameImpl.createFault1_2Name(null, prefix));
     }
 
+    public Fault1_2Impl(Element domElement, SOAPDocumentImpl ownerDoc) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getDetailName() {
         return NameImpl.createSOAP12Name("Detail", getPrefix());
     }
@@ -521,7 +526,7 @@
             }
         }
         if (element instanceof Detail1_2Impl) {
-            ElementImpl importedElement = (ElementImpl) importElement(element);
+            Element importedElement = importElement(element);
             addNode(importedElement);
             return convertToSoapElement(importedElement);
         } else
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java
index e860c51..ee9eeaa 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,7 @@
 import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl;
 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+import org.w3c.dom.Element;
 
 
 public class Header1_2Impl extends HeaderImpl {
@@ -54,6 +55,10 @@
         super(ownerDocument, NameImpl.createHeader1_2Name(prefix));
     }
 
+    public Header1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) {
+        super(ownerDoc, domElement);
+    }
+
     protected NameImpl getNotUnderstoodName() {
         return NameImpl.createNotUnderstood1_2Name(null);
     }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java
index 3024348..6e8aa0b 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,6 @@
  * This class is used by XML Schema binary format validation
  *
  * @author Jeffrey Rodriguez
- * @version
  */
 public final class Base64 {
 
@@ -173,7 +172,7 @@
     /**
      * Decodes Base64 data into octects
      *
-     * @param binaryData Byte array containing Base64 data
+     * @param base64Data Byte array containing Base64 data
      * @return Array containind decoded data.
      */
     public byte[] decode( byte[] base64Data ) {
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java
index c00da83..5763bd7 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
  * <li>doesn't do synchronization
  * <li>allows access to the raw buffer
  * <li>almost no parameter check
+ * </ol>
  */
 public final class ByteOutputStream extends OutputStream {
     /**
@@ -64,6 +65,9 @@
 
     /**
      * Copies all the bytes from this input into this buffer.
+     *
+     * @param in input stream.
+     * @exception IOException in case of an I/O error.
      */
     public void write(InputStream in) throws IOException {
         if (in instanceof ByteArrayInputStream) {
@@ -84,6 +88,7 @@
         }
     }
 
+    @Override
     public void write(int b) {
         ensureCapacity(1);
         buf[count] = (byte) b;
@@ -102,18 +107,22 @@
         }
     }
 
+    @Override
     public void write(byte[] b, int off, int len) {
         ensureCapacity(len);
         System.arraycopy(b, off, buf, count, len);
         count += len;
     }
 
+    @Override
     public void write(byte[] b) {
         write(b, 0, b.length);
     }
 
     /**
      * Writes a string as ASCII string.
+     *
+     * @param s string to write.
      */
     public void writeAsAscii(String s) {
         int len = s.length();
@@ -138,9 +147,12 @@
      * Evil buffer reallocation method.
      * Don't use it unless you absolutely have to.
      *
+     * @return byte array
+     *
      * @deprecated
      *      because this is evil!
      */
+    @Deprecated
     public byte toByteArray()[] {
         byte[] newbuf = new byte[count];
         System.arraycopy(buf, 0, newbuf, 0, count);
@@ -162,10 +174,12 @@
      * @return String translated from the buffer's contents.
      * @since JDK1.1
      */
+    @Override
     public String toString() {
         return new String(buf, 0, count);
     }
 
+    @Override
     public void close() {
     }
 
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java
index 4d91788..131f1f5 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,8 +39,9 @@
 * string and fragment) that may constitute a URI.
 * <p>
 * Parsing of a URI specification is done according to the URI
-* syntax described in <a href="http://www.ietf.org/rfc/rfc2396.txt?number=2396">RFC 2396</a>.
-* Every URI consists of a scheme, followed by a colon (':'), followed by a scheme-specific
+* syntax described in <a href="http://www.ietf.org/rfc/rfc2396.txt?number=2396">
+* RFC 2396</a>. Every URI consists
+* of a scheme, followed by a colon (':'), followed by a scheme-specific
 * part. For URIs that follow the "generic URI" syntax, the scheme-
 * specific part begins with two slashes ("//") and may be followed
 * by an authority segment (comprised of user information, host, and
@@ -60,8 +61,6 @@
 * default port for a specific scheme). Rather, it only knows the
 * grammar and basic set of operations that can be applied to a URI.
 *
-* @version
-*
 **********************************************************************/
  public class JaxmURI implements Serializable {
 
@@ -1106,6 +1105,7 @@
   * @return true if p_test is a URI with all values equal to this
   *         URI, false otherwise
   */
+  @Override
   public boolean equals(Object p_test) {
     if (p_test instanceof JaxmURI) {
       JaxmURI testURI = (JaxmURI) p_test;
@@ -1134,6 +1134,7 @@
     return false;
   }
 
+  @Override
   public int hashCode() {
           // No members safe to use, just default to a constant.
           return 153214;
@@ -1144,6 +1145,7 @@
   *
   * @return the URI string specification
   */
+  @Override
   public String toString() {
     StringBuilder uriSpecString = new StringBuilder();
 
@@ -1173,6 +1175,8 @@
   * A scheme is conformant if it starts with an alphanumeric, and
   * contains only alphanumerics, '+','-' and '.'.
   *
+  * @param p_scheme scheme name
+  *
   * @return true if the scheme is conformant, false otherwise
   */
   public static boolean isConformantSchemeName(String p_scheme) {
@@ -1202,7 +1206,9 @@
   * IPv4 address consists of four decimal digit groups separated by a
   * '.'. A hostname consists of domain labels (each of which must
   * begin and end with an alphanumeric but may contain '-') separated
-  & by a '.'. See RFC 2396 Section 3.2.2.
+  * by a '.'. See RFC 2396 Section 3.2.2.
+  *
+  * @param p_address address
   *
   * @return true if the string is a syntactically valid IPv4 address
   *              or hostname
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java
index 5d3c2d4..032abd1 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,10 @@
      * Returns a new String constructed from the specified String by replacing
      * the URL escape sequences and UTF8 encoding with the characters they
      * represent.
+     *
+     * @param s string
+     *
+     * @return decoded string
      */
     public static String decode(String s) {
         StringBuilder sb = new StringBuilder();
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
index b9c503c..12e7299 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,8 +45,7 @@
 
     public ParserPool(int capacity) {
         queue = new ArrayBlockingQueue<SAXParser>(capacity);
-        //factory = SAXParserFactory.newInstance();
-        factory = new com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl();
+        factory = SAXParserFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", SAAJUtil.getSystemClassLoader());
         factory.setNamespaceAware(true);
         for (int i = 0; i < capacity; i++) {
            try {
@@ -79,30 +78,7 @@
 
     public void returnParser(SAXParser saxParser) {
         saxParser.reset();
-        resetSaxParser(saxParser);
         put(saxParser);
     }
 
-
-    /**
-     * SAAJ Issue 46 :https://saaj.dev.java.net/issues/show_bug.cgi?id=46
-     * Xerces does not provide a way to reset the SymbolTable
-     * So we are trying to reset it using the proprietary code below.
-     * Temporary Until the bug : https://jaxp.dev.java.net/issues/show_bug.cgi?id=59
-     * is fixed.
-     * @param parser the parser from the pool whose Symbol Table needs to be reset.
-     */
-     private void resetSaxParser(SAXParser parser) {
-        try {
-            //Object obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table");
-            com.sun.org.apache.xerces.internal.util.SymbolTable table = new com.sun.org.apache.xerces.internal.util.SymbolTable();
-            parser.setProperty("http://apache.org/xml/properties/internal/symbol-table", table);
-            //obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table");
-        } catch (SAXNotRecognizedException ex) {
-            //nothing to do
-        } catch (SAXNotSupportedException ex) {
-            //nothing to do
-        }
-    }
-
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java
index 7f9cdc4..eafc186 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
 package com.sun.xml.internal.messaging.saaj.util;
 
 import java.security.AccessControlException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 /**
  *
@@ -48,4 +50,13 @@
             return null;
         }
     }
+
+    public static ClassLoader getSystemClassLoader() {
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                return ClassLoader.getSystemClassLoader();
+            }
+        });
+    }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java
index e11fb63..94f4f3d 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -107,11 +107,13 @@
         }
     }
 
+    @Override
     public void clearParameters() {
         if (m_realTransformer != null)
             m_realTransformer.clearParameters();
     }
 
+    @Override
     public javax.xml.transform.ErrorListener getErrorListener() {
         try {
             materialize();
@@ -122,6 +124,7 @@
         return null;
     }
 
+    @Override
     public java.util.Properties getOutputProperties() {
         try {
             materialize();
@@ -132,6 +135,7 @@
         return null;
     }
 
+    @Override
     public String getOutputProperty(String str)
         throws java.lang.IllegalArgumentException {
         try {
@@ -143,6 +147,7 @@
         return null;
     }
 
+    @Override
     public Object getParameter(String str) {
         try {
             materialize();
@@ -153,6 +158,7 @@
         return null;
     }
 
+    @Override
     public javax.xml.transform.URIResolver getURIResolver() {
         try {
             materialize();
@@ -163,6 +169,7 @@
         return null;
     }
 
+    @Override
     public void setErrorListener(
         javax.xml.transform.ErrorListener errorListener)
         throws java.lang.IllegalArgumentException {
@@ -174,6 +181,7 @@
         }
     }
 
+    @Override
     public void setOutputProperties(java.util.Properties properties)
         throws java.lang.IllegalArgumentException {
         try {
@@ -184,6 +192,7 @@
         }
     }
 
+    @Override
     public void setOutputProperty(String str, String str1)
         throws java.lang.IllegalArgumentException {
         try {
@@ -194,6 +203,7 @@
         }
     }
 
+    @Override
     public void setParameter(String str, Object obj) {
         try {
             materialize();
@@ -203,6 +213,7 @@
         }
     }
 
+    @Override
     public void setURIResolver(javax.xml.transform.URIResolver uRIResolver) {
         try {
             materialize();
@@ -272,6 +283,7 @@
 
     //------------------------------------------------------------------------
 
+    @Override
     public void transform(
         javax.xml.transform.Source source,
         javax.xml.transform.Result result)
@@ -409,6 +421,8 @@
      * Return Transformer instance for this thread, allocating a new one if
      * necessary. Note that this method does not clear global parameters,
      * properties or any other data set on a previously used transformer.
+     *
+     * @return Transformer instance
      */
     public static Transformer newTransformer() {
         //CR : 6813167
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java
index e1f39b9..6321da3 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java
@@ -26,6 +26,7 @@
 package com.sun.xml.internal.ws.addressing;
 
 import com.sun.xml.internal.ws.api.server.*;
+import com.sun.xml.internal.ws.api.server.Module;
 import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
 import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
 import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java
index 220dd8e..80f7d3b 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,8 @@
 import javax.xml.soap.SOAPHeaderElement;
 import javax.xml.soap.SOAPMessage;
 
+import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
+import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl;
 import com.sun.xml.internal.ws.api.SOAPVersion;
 import com.sun.xml.internal.ws.api.WSBinding;
 import com.sun.xml.internal.ws.api.message.Header;
@@ -234,11 +236,12 @@
         if (soapHeader == null) {
             return null;
         }
+        SOAPDocumentImpl soapDocument = ((HeaderImpl)soapHeader).getSoapDocument();
         SOAPHeaderElement headerElem = find(nsUri, localName);
         if (headerElem == null) {
             return null;
         }
-        headerElem = (SOAPHeaderElement) soapHeader.removeChild(headerElem);
+        headerElem = (SOAPHeaderElement) soapDocument.find(soapHeader.removeChild(headerElem));
 
         //it might have been a nonSAAJHeader - remove from that map
         removeNonSAAJHeader(headerElem);
@@ -330,7 +333,7 @@
 
     private void addNonSAAJHeader(SOAPHeaderElement headerElem, Header header) {
         if (nonSAAJHeaders == null) {
-            nonSAAJHeaders = new HashMap<SOAPHeaderElement, Header>();
+            nonSAAJHeaders = new HashMap<>();
         }
         nonSAAJHeaders.put(headerElem, header);
     }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java
index 25e0462..12fbb26 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,9 +68,7 @@
                             Class<?> cls = Class.forName(SAFE_THREAD_NAME);
                             Constructor<?> ctr = cls.getConstructor(Runnable.class);
                             return new SunMiscThreadFactory(ctr);
-                        } catch (ClassNotFoundException ignored) {
-                        } catch (NoSuchMethodException ignored) {
-                        }
+                        } catch (ClassNotFoundException | NoSuchMethodException ignored) {}
                         return new LegacyThreadFactory();
                     }
                 }
@@ -90,7 +88,9 @@
             try {
                 return ctr.newInstance(null, r, "toBeReplaced", 0, false);
             } catch (ReflectiveOperationException x) {
-                throw new InternalError(x);
+                InternalError ie = new InternalError(x.getMessage());
+                ie.initCause(ie);
+                throw ie;
             }
         }
     }
@@ -99,7 +99,7 @@
     private static class SunMiscThreadFactory implements ThreadFactory {
         final Constructor<?> ctr;
         SunMiscThreadFactory(Constructor<?> ctr) { this.ctr = ctr; }
-        @Override public Thread newThread(Runnable r) {
+        @Override public Thread newThread(final Runnable r) {
             return AccessController.doPrivileged(
                     new PrivilegedAction<Thread>() {
                         @Override
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java
index c849705..b976434 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
 import java.util.logging.Logger;
 
 /**
- * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * Utility class to invoke com.sun.xml.internal.ws.util.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
  * to java.lang,reflect.Method.invoke()
  *
  * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too!
@@ -39,43 +39,17 @@
 class MethodUtil {
 
     private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
-    private static final Method INVOKE_METHOD;
-
-    static {
-        Method method;
-        try {
-            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
-            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
-            }
-        } catch (Throwable t) {
-            method = null;
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
-            }
-        }
-        INVOKE_METHOD = method;
-    }
 
     static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
-        if (INVOKE_METHOD != null) {
-            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
-            }
-            try {
-                return INVOKE_METHOD.invoke(null, method, target, args);
-            } catch (InvocationTargetException ite) {
-                // unwrap invocation exception added by reflection code ...
-                throw unwrapException(ite);
-            }
-        } else {
-            // other then Oracle JDK ...
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
-            }
-            return method.invoke(target, args);
+        // com.sun.xml.internal.ws.util.MethodUtil.invoke(method, owner, args)
+        if (LOGGER.isLoggable(Level.FINE)) {
+            LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.util.MethodUtil");
+        }
+        try {
+            return com.sun.xml.internal.ws.util.MethodUtil.invoke(method, target, args);
+        } catch (InvocationTargetException ite) {
+            // unwrap invocation exception added by reflection code ...
+            throw unwrapException(ite);
         }
     }
 
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java
index 0c774aa..3ba900a 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,9 @@
 package com.sun.xml.internal.ws.api.server;
 
 import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
 import com.sun.xml.internal.ws.server.ServerRtException;
 import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader;
-import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
@@ -42,7 +42,7 @@
  * SPI that provides the source of {@link SDDocument}.
  *
  * <p>
- * This abstract class could be implemented by appliations, or one of the
+ * This abstract class could be implemented by applications, or one of the
  * {@link #create} methods can be used.
  *
  * @author Kohsuke Kawaguchi
@@ -85,28 +85,38 @@
 
     /**
      * System ID of this document.
+     * @return
      */
     public abstract URL getSystemId();
 
+    public static SDDocumentSource create(final Class<?> implClass, final String url) {
+        return create(url, implClass);
+    }
+
     /**
      * Creates {@link SDDocumentSource} from an URL.
+     * @param url
+     * @return
      */
     public static SDDocumentSource create(final URL url) {
         return new SDDocumentSource() {
             private final URL systemId = url;
 
+            @Override
             public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException {
                 InputStream is = url.openStream();
                 return new TidyXMLStreamReader(
                     xif.createXMLStreamReader(systemId.toExternalForm(),is), is);
             }
 
+            @Override
             public XMLStreamReader read() throws IOException, XMLStreamException {
                 InputStream is = url.openStream();
                 return new TidyXMLStreamReader(
                    XMLStreamReaderFactory.create(systemId.toExternalForm(),is,false), is);
             }
 
+            @Override
             public URL getSystemId() {
                 return systemId;
             }
@@ -120,19 +130,22 @@
      * @param resolvingClass class used to read resource
      * @param path resource path
      */
-    public static SDDocumentSource create(final Class resolvingClass, final String path) {
+    private static SDDocumentSource create(final String path, final Class<?> resolvingClass) {
         return new SDDocumentSource() {
 
+            @Override
             public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException {
                 InputStream is = inputStream();
                 return new TidyXMLStreamReader(xif.createXMLStreamReader(path,is), is);
             }
 
+            @Override
             public XMLStreamReader read() throws IOException, XMLStreamException {
                 InputStream is = inputStream();
                 return new TidyXMLStreamReader(XMLStreamReaderFactory.create(path,is,false), is);
             }
 
+            @Override
             public URL getSystemId() {
                 try {
                     return new URL("file://" + path);
@@ -142,12 +155,10 @@
             }
 
             private InputStream inputStream() throws IOException {
-                java.lang.reflect.Module module = resolvingClass.getModule();
-                if (module != null) {
-                    InputStream stream = module.getResourceAsStream(path);
-                    if (stream != null) {
-                        return stream;
-                    }
+                java.lang.Module module = resolvingClass.getModule();
+                InputStream stream = module.getResourceAsStream(path);
+                if (stream != null) {
+                    return stream;
                 }
                 throw new ServerRtException("cannot.load.wsdl", path);
             }
@@ -157,17 +168,23 @@
 
     /**
      * Creates a {@link SDDocumentSource} from {@link XMLStreamBuffer}.
+     * @param systemId
+     * @param xsb
+     * @return
      */
     public static SDDocumentSource create(final URL systemId, final XMLStreamBuffer xsb) {
         return new SDDocumentSource() {
+            @Override
             public XMLStreamReader read(XMLInputFactory xif) throws XMLStreamException {
                 return xsb.readAsXMLStreamReader();
             }
 
+            @Override
             public XMLStreamReader read() throws XMLStreamException {
                 return xsb.readAsXMLStreamReader();
             }
 
+            @Override
             public URL getSystemId() {
                 return systemId;
             }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java
index d62cb62..6c76e26 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 
 package com.sun.xml.internal.ws.api.streaming;
 
+import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.properties
deleted file mode 100644
index c0267b8..0000000
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java
index 927fad4..536e388 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@
     //This is reset when ever Binding.setHandlerChain() or SOAPBinding.setRoles() is called.
     private HandlerConfiguration handlerConfig;
     private final Set<QName> addedHeaders = new HashSet<QName>();
-    private final Set<QName> knownHeaders = new HashSet<QName>();
+    private final Set<QName> knownHeaders = Collections.synchronizedSet(new HashSet<QName>());
     private final Set<QName> unmodKnownHeaders = Collections.unmodifiableSet(knownHeaders);
     private final BindingID bindingId;
     // Features that are set(enabled/disabled) on the binding
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java
index 292ed73..f61114e 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,8 @@
 import javax.xml.ws.soap.MTOMFeature;
 import javax.xml.ws.soap.SOAPBinding;
 import java.util.*;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
 
 /**
  * @author WS Development Team
@@ -57,6 +59,7 @@
 
     private Set<QName> portKnownHeaders = Collections.emptySet();
     private Set<QName> bindingUnderstoodHeaders = new HashSet<QName>();
+    private final Lock lock = new ReentrantLock();
 
     /**
      * Use {@link BindingImpl#create(BindingID)} to create this.
@@ -95,7 +98,13 @@
      * @param headers SOAP header names
      */
     public void setPortKnownHeaders(@NotNull Set<QName> headers) {
-        this.portKnownHeaders = headers;
+
+        try{
+          lock.lock();
+          this.portKnownHeaders = headers;
+                } finally {
+                lock.unlock();
+        }
     }
 
     /**
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java
index f0daea5..9194ce4 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
 import java.util.logging.Logger;
 
 /**
- * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * Utility class to invoke com.sun.xml.internal.ws.util.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
  * to java.lang,reflect.Method.invoke()
  * <p/>
  * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too!
@@ -39,43 +39,17 @@
 class MethodUtil {
 
     private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
-    private static final Method INVOKE_METHOD;
-
-    static {
-        Method method;
-        try {
-            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
-            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
-            }
-        } catch (Throwable t) {
-            method = null;
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
-            }
-        }
-        INVOKE_METHOD = method;
-    }
 
     static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
-        if (INVOKE_METHOD != null) {
-            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
-            }
-            try {
-                return INVOKE_METHOD.invoke(null, method, target, args);
-            } catch (InvocationTargetException ite) {
-                // unwrap invocation exception added by reflection code ...
-                throw unwrapException(ite);
-            }
-        } else {
-            // other then Oracle JDK ...
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
-            }
-            return method.invoke(target, args);
+        // com.sun.xml.internal.ws.util.MethodUtil.invoke(method, owner, args)
+        if (LOGGER.isLoggable(Level.FINE)) {
+            LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.util.MethodUtil");
+        }
+        try {
+            return com.sun.xml.internal.ws.util.MethodUtil.invoke(method, target, args);
+        } catch (InvocationTargetException ite) {
+            // unwrap invocation exception added by reflection code ...
+            throw unwrapException(ite);
         }
     }
 
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java
index 63809b00..7ae8158 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 
 package com.sun.xml.internal.ws.commons.xmlutil;
 
+import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties
deleted file mode 100644
index c0267b8..0000000
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java
index e7d0050..957607e 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 
 package com.sun.xml.internal.ws.developer;
 
+import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java
index 158e0a9..adbcb79 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,16 @@
 
 package com.sun.xml.internal.ws.model;
 
+import java.lang.reflect.Field;
 import javax.xml.ws.WebServiceException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -44,31 +48,68 @@
 
     private static final Logger LOGGER = Logger.getLogger(Injector.class.getName());
 
-    private static final Method defineClass;
-    private static final Method resolveClass;
-    private static final Method getPackage;
-    private static final Method definePackage;
+    private static Method defineClass;
+    private static Method resolveClass;
+    private static Method getPackage;
+    private static Method definePackage;
+    private static Object U;
 
     static {
-        Method[] m = AccessController.doPrivileged(
-                new PrivilegedAction<Method[]>() {
-                    @Override
-                    public Method[] run() {
-                        return new Method[]{
-                                getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
-                                getMethod(ClassLoader.class, "resolveClass", Class.class),
-                                getMethod(ClassLoader.class, "getPackage", String.class),
-                                getMethod(ClassLoader.class, "definePackage",
-                                        String.class, String.class, String.class, String.class,
-                                        String.class, String.class, String.class, URL.class)
-                        };
-                    }
+        try {
+            Method[] m = AccessController.doPrivileged(
+                    new PrivilegedAction<Method[]>() {
+                @Override
+                public Method[] run() {
+                    return new Method[]{
+                        getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE),
+                        getMethod(ClassLoader.class, "resolveClass", Class.class),
+                        getMethod(ClassLoader.class, "getPackage", String.class),
+                        getMethod(ClassLoader.class, "definePackage",
+                            String.class, String.class, String.class, String.class,
+                            String.class, String.class, String.class, URL.class)
+                    };
                 }
-        );
-        defineClass = m[0];
-        resolveClass = m[1];
-        getPackage = m[2];
-        definePackage = m[3];
+            }
+            );
+            defineClass = m[0];
+            resolveClass = m[1];
+            getPackage = m[2];
+            definePackage = m[3];
+
+        } catch (Throwable t) {
+            try {
+                U = AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                    @Override
+                    public Object run() throws Exception {
+                        Class u = Class.forName("sun.misc.Unsafe");
+                        Field theUnsafe = u.getDeclaredField("theUnsafe");
+                        theUnsafe.setAccessible(true);
+                        return theUnsafe.get(null);
+                    }
+                });
+                defineClass = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>() {
+                    @Override
+                    public Method run() throws Exception {
+                        try {
+                            return U.getClass().getMethod("defineClass",
+                                    new Class[]{String.class,
+                                        byte[].class,
+                                        Integer.TYPE,
+                                        Integer.TYPE,
+                                        ClassLoader.class,
+                                        ProtectionDomain.class});
+                        } catch (NoSuchMethodException | SecurityException ex) {
+                            throw ex;
+                        }
+                    }
+                });
+            } catch (SecurityException | PrivilegedActionException ex) {
+                Logger.getLogger(Injector.class.getName()).log(Level.SEVERE, null, ex);
+                WebServiceException we = new WebServiceException(ex);
+                we.addSuppressed(t);
+                throw we;
+            }
+        }
     }
 
     private static Method getMethod(final Class<?> c, final String methodname, final Class<?>... params) {
@@ -91,24 +132,26 @@
             // nothing to do
         }
         try {
+            if (definePackage == null) {
+                return (Class) defineClass.invoke(U, className.replace('/', '.'), image, 0, image.length, cl, Injector.class.getProtectionDomain());
+            }
             int packIndex = className.lastIndexOf('.');
             if (packIndex != -1) {
                 String pkgname = className.substring(0, packIndex);
                 // Check if package already loaded.
-                Package pkg = (Package)getPackage.invoke(cl, pkgname);
+                Package pkg = (Package) getPackage.invoke(cl, pkgname);
                 if (pkg == null) {
                     definePackage.invoke(cl, pkgname, null, null, null, null, null, null, null);
                 }
             }
 
-            Class c = (Class)defineClass.invoke(cl,className.replace('/','.'),image,0,image.length);
+            Class c = (Class) defineClass.invoke(cl, className.replace('/', '.'), image, 0, image.length);
             resolveClass.invoke(cl, c);
             return c;
-        } catch (IllegalAccessException e) {
-            LOGGER.log(Level.FINE,"Unable to inject "+className,e);
-            throw new WebServiceException(e);
-        } catch (InvocationTargetException e) {
-            LOGGER.log(Level.FINE,"Unable to inject "+className,e);
+        } catch (IllegalAccessException | InvocationTargetException e) {
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, "Unable to inject " + className, e);
+            }
             throw new WebServiceException(e);
         }
     }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java
index 29f852e..ad6f52f 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -346,7 +346,6 @@
     }
 
     private boolean noWrapperGen() {
-        if (Runtime.version().major() >= 9) return true;
         Object o = config.properties().get(SuppressDocLitWrapperGeneration);
         return (o!= null && o instanceof Boolean) ? ((Boolean) o) : false;
     }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java
index 6879a60..4e72aac 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
 
 /**
  * Creates SOAP specific RuntimeModel
@@ -41,6 +43,8 @@
  */
 public class SOAPSEIModel extends AbstractSEIModelImpl {
 
+        private final Lock lock = new ReentrantLock();
+
     public SOAPSEIModel(WebServiceFeatureList features) {
         super(features);
     }
@@ -72,15 +76,22 @@
 
     public Set<QName> getKnownHeaders() {
         Set<QName> headers = new HashSet<QName>();
-        for (JavaMethodImpl method : getJavaMethods()) {
-            // fill in request headers
-            Iterator<ParameterImpl> params = method.getRequestParameters().iterator();
-            fillHeaders(params, headers, Mode.IN);
+
+        try{
+                lock.lock();
+            for (JavaMethodImpl method : getJavaMethods()) {
+             // fill in request headers
+             Iterator<ParameterImpl> params = method.getRequestParameters().iterator();
+             fillHeaders(params, headers, Mode.IN);
 
             // fill in response headers
-            params = method.getResponseParameters().iterator();
-            fillHeaders(params, headers, Mode.OUT);
-        }
+             params = method.getResponseParameters().iterator();
+             fillHeaders(params, headers, Mode.OUT);
+                          }
+        }finally
+        {
+                lock.unlock();
+         }
         return headers;
     }
 
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java
index ad2ad4a..127f744 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,49 +31,22 @@
 import java.util.logging.Logger;
 
 /**
- * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
+ * Utility class to invoke com.sun.xml.internal.ws.policy.util.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks
  * to java.lang,reflect.Method.invoke()
  */
 class MethodUtil {
 
     private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName());
-    private static final Method INVOKE_METHOD;
-
-    static {
-        Method method;
-        try {
-            Class<?> clazz = Class.forName("sun.reflect.misc.MethodUtil");
-            method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class);
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods.");
-            }
-        } catch (Throwable t) {
-            method = null;
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM");
-            }
-        }
-        INVOKE_METHOD = method;
-    }
 
     static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
-        if (INVOKE_METHOD != null) {
-            // sun.reflect.misc.MethodUtil.invoke(method, owner, args)
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil");
-            }
-            try {
-                return INVOKE_METHOD.invoke(null, method, target, args);
-            } catch (InvocationTargetException ite) {
-                // unwrap invocation exception added by reflection code ...
-                throw unwrapException(ite);
-            }
-        } else {
-            // other then Oracle JDK ...
-            if (LOGGER.isLoggable(Level.FINE)) {
-                LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM");
-            }
-            return method.invoke(target, args);
+        if (LOGGER.isLoggable(Level.FINE)) {
+            LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.policy.util.MethodUtil");
+        }
+        try {
+            return com.sun.xml.internal.ws.policy.util.MethodUtil.invoke(method, target, args);
+        } catch (InvocationTargetException ite) {
+            // unwrap invocation exception added by reflection code ...
+            throw unwrapException(ite);
         }
     }
 
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/util/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/util/MethodUtil.java
new file mode 100644
index 0000000..b8af4d2
--- /dev/null
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/util/MethodUtil.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.policy.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.security.AccessController;
+import java.security.AllPermission;
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+import java.security.PrivilegedExceptionAction;
+import java.security.SecureClassLoader;
+import java.util.Arrays;
+
+/*
+ * This copies from sun.reflect.misc.MethodUtil to implement the trampoline
+ * code such that when a Method is invoked, it will be called through
+ * the trampoline that is defined by this MethodUtil class loader.
+ */
+class Trampoline {
+    static {
+        if (Trampoline.class.getClassLoader() == null) {
+            throw new Error(
+                    "Trampoline must not be defined by the bootstrap classloader");
+        }
+    }
+
+    private static void ensureInvocableMethod(Method m)
+            throws InvocationTargetException {
+        Class<?> clazz = m.getDeclaringClass();
+        if (clazz.equals(AccessController.class) ||
+                clazz.equals(Method.class) ||
+                clazz.getName().startsWith("java.lang.invoke."))
+            throw new InvocationTargetException(
+                    new UnsupportedOperationException("invocation not supported"));
+    }
+
+    private static Object invoke(Method m, Object obj, Object[] params)
+            throws InvocationTargetException, IllegalAccessException {
+        ensureInvocableMethod(m);
+        return m.invoke(obj, params);
+    }
+}
+
+/*
+ * Create a trampoline class.
+ */
+public final class MethodUtil extends SecureClassLoader {
+    private static final String WS_UTIL_POLICY_PKG = "com.sun.xml.internal.ws.policy.util.";
+    private static final String TRAMPOLINE = WS_UTIL_POLICY_PKG + "Trampoline";
+    private static final Method bounce = getTrampoline();
+    private static final int DEFAULT_BUFFER_SIZE = 8192;
+    private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
+
+
+    private MethodUtil() {
+        super();
+    }
+
+    /*
+     * Bounce through the trampoline.
+     */
+    public static Object invoke(Method m, Object obj, Object[] params)
+            throws InvocationTargetException, IllegalAccessException {
+        try {
+            return bounce.invoke(null, m, obj, params);
+        } catch (InvocationTargetException ie) {
+            Throwable t = ie.getCause();
+
+            if (t instanceof InvocationTargetException) {
+                throw (InvocationTargetException) t;
+            } else if (t instanceof IllegalAccessException) {
+                throw (IllegalAccessException) t;
+            } else if (t instanceof RuntimeException) {
+                throw (RuntimeException) t;
+            } else if (t instanceof Error) {
+                throw (Error) t;
+            } else {
+                throw new Error("Unexpected invocation error", t);
+            }
+        } catch (IllegalAccessException iae) {
+            // this can't happen
+            throw new Error("Unexpected invocation error", iae);
+        }
+    }
+
+    private static Method getTrampoline() {
+        try {
+            return AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<Method>() {
+                        public Method run() throws Exception {
+                            Class<?> t = getTrampolineClass();
+                            Method b = t.getDeclaredMethod("invoke",
+                                    Method.class, Object.class, Object[].class);
+                            b.setAccessible(true);
+                            return b;
+                        }
+                    });
+        } catch (Exception e) {
+            throw new InternalError("bouncer cannot be found", e);
+        }
+    }
+
+
+    protected synchronized Class<?> loadClass(String name, boolean resolve)
+            throws ClassNotFoundException {
+        // First, check if the class has already been loaded
+        checkPackageAccess(name);
+        Class<?> c = findLoadedClass(name);
+        if (c == null) {
+            try {
+                c = findClass(name);
+            } catch (ClassNotFoundException e) {
+                // Fall through ...
+            }
+            if (c == null) {
+                c = getParent().loadClass(name);
+            }
+        }
+        if (resolve) {
+            resolveClass(c);
+        }
+        return c;
+    }
+
+
+    protected Class<?> findClass(final String name)
+            throws ClassNotFoundException {
+        if (!name.startsWith(WS_UTIL_POLICY_PKG)) {
+            throw new ClassNotFoundException(name);
+        }
+        String path = "/".concat(name.replace('.', '/').concat(".class"));
+        try (InputStream in = MethodUtil.class.getResourceAsStream(path)) {
+            byte[] b = readAllBytes(in);
+            return defineClass(name, b);
+        } catch (IOException e) {
+            throw new ClassNotFoundException(name, e);
+        }
+    }
+
+    /**
+     * JDK9 {@link InputStream#readAllBytes()} substitution.
+     */
+    private byte[] readAllBytes(InputStream in) throws IOException {
+        byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
+        int capacity = buf.length;
+        int nread = 0;
+        int n;
+        for (; ; ) {
+            // read to EOF which may read more or less than initial buffer size
+            while ((n = in.read(buf, nread, capacity - nread)) > 0)
+                nread += n;
+
+            // if the last call to read returned -1, then we're done
+            if (n < 0)
+                break;
+
+            // need to allocate a larger buffer
+            if (capacity <= MAX_BUFFER_SIZE - capacity) {
+                capacity = capacity << 1;
+            } else {
+                if (capacity == MAX_BUFFER_SIZE)
+                    throw new OutOfMemoryError("Required array size too large");
+                capacity = MAX_BUFFER_SIZE;
+            }
+            buf = Arrays.copyOf(buf, capacity);
+        }
+        return (capacity == nread) ? buf : Arrays.copyOf(buf, nread);
+    }
+
+
+    /*
+     * Define the proxy classes
+     */
+    private Class<?> defineClass(String name, byte[] b) throws IOException {
+        CodeSource cs = new CodeSource(null, (java.security.cert.Certificate[]) null);
+        if (!name.equals(TRAMPOLINE)) {
+            throw new IOException("MethodUtil: bad name " + name);
+        }
+        return defineClass(name, b, 0, b.length, cs);
+    }
+
+    protected PermissionCollection getPermissions(CodeSource codesource) {
+        PermissionCollection perms = super.getPermissions(codesource);
+        perms.add(new AllPermission());
+        return perms;
+    }
+
+    private static Class<?> getTrampolineClass() {
+        try {
+            return Class.forName(TRAMPOLINE, true, new MethodUtil());
+        } catch (ClassNotFoundException e) {
+        }
+        return null;
+    }
+
+    /**
+     * Checks package access on the given classname.
+     * This method is typically called when the Class instance is not
+     * available and the caller attempts to load a class on behalf
+     * the true caller (application).
+     */
+    private static void checkPackageAccess(String name) {
+        SecurityManager s = System.getSecurityManager();
+        if (s != null) {
+            String cname = name.replace('/', '.');
+            if (cname.startsWith("[")) {
+                int b = cname.lastIndexOf('[') + 2;
+                if (b > 1 && b < cname.length()) {
+                    cname = cname.substring(b);
+                }
+            }
+            int i = cname.lastIndexOf('.');
+            if (i != -1) {
+                s.checkPackageAccess(cname.substring(0, i));
+            }
+        }
+    }
+
+    /**
+     * Checks package access on the given class.
+     * <p>
+     * If it is a {@link Proxy#isProxyClass(Class)} that implements
+     * a non-public interface (i.e. may be in a non-restricted package),
+     * also check the package access on the proxy interfaces.
+     */
+    private static void checkPackageAccess(Class<?> clazz) {
+        checkPackageAccess(clazz.getName());
+        if (isNonPublicProxyClass(clazz)) {
+            checkProxyPackageAccess(clazz);
+        }
+    }
+
+    // Note that bytecode instrumentation tools may exclude 'sun.*'
+    // classes but not generated proxy classes and so keep it in com.sun.*
+    private static final String PROXY_PACKAGE = "com.sun.proxy";
+
+    /**
+     * Test if the given class is a proxy class that implements
+     * non-public interface.  Such proxy class may be in a non-restricted
+     * package that bypasses checkPackageAccess.
+     */
+    private static boolean isNonPublicProxyClass(Class<?> cls) {
+        String name = cls.getName();
+        int i = name.lastIndexOf('.');
+        String pkg = (i != -1) ? name.substring(0, i) : "";
+        return Proxy.isProxyClass(cls) && !pkg.startsWith(PROXY_PACKAGE);
+    }
+
+    /**
+     * Check package access on the proxy interfaces that the given proxy class
+     * implements.
+     *
+     * @param clazz Proxy class object
+     */
+    private static void checkProxyPackageAccess(Class<?> clazz) {
+        SecurityManager s = System.getSecurityManager();
+        if (s != null) {
+            // check proxy interfaces if the given class is a proxy class
+            if (Proxy.isProxyClass(clazz)) {
+                for (Class<?> intf : clazz.getInterfaces()) {
+                    checkPackageAccess(intf);
+                }
+            }
+        }
+    }
+}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocal.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocal.properties
new file mode 100644
index 0000000..d799568
--- /dev/null
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocal.properties
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocalMessages.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocalMessages.java
new file mode 100644
index 0000000..d52a1ab
--- /dev/null
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocalMessages.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.resources;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+import javax.annotation.Generated;
+import com.sun.istack.internal.localization.Localizable;
+import com.sun.istack.internal.localization.LocalizableMessageFactory;
+import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier;
+import com.sun.istack.internal.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+@Generated("com.sun.istack.internal.maven.ResourceGenMojo")
+public final class ContextClassloaderLocalMessages {
+
+    private final static String BUNDLE_NAME = "com.sun.xml.internal.ws.resources.ContextClassloaderLocal";
+    private final static LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new ContextClassloaderLocalMessages.BundleSupplier());
+    private final static Localizer LOCALIZER = new Localizer();
+
+    public static Localizable localizableFAILED_TO_CREATE_NEW_INSTANCE(Object arg0) {
+        return MESSAGE_FACTORY.getMessage("FAILED_TO_CREATE_NEW_INSTANCE", arg0);
+    }
+
+    /**
+     * Failed to create new instance of {0}
+     *
+     */
+    public static String FAILED_TO_CREATE_NEW_INSTANCE(Object arg0) {
+        return LOCALIZER.localize(localizableFAILED_TO_CREATE_NEW_INSTANCE(arg0));
+    }
+
+    private static class BundleSupplier
+        implements ResourceBundleSupplier
+    {
+
+
+        public ResourceBundle getResourceBundle(Locale locale) {
+            return ResourceBundle.getBundle(BUNDLE_NAME, locale);
+        }
+
+    }
+
+}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java
index cf0bf26..976cdd1 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 
 package com.sun.xml.internal.ws.spi;
 
+import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties
deleted file mode 100644
index c0267b8..0000000
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java
index 9f23f51..944dd38 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,13 +69,11 @@
 
 /**
  * Implements {@link Endpoint}.
- * <p/>
- * <p/>
+ *
  * This class accumulates the information necessary to create
  * {@link WSEndpoint}, and then when {@link #publish} method
  * is called it will be created.
- * <p/>
- * <p/>
+ *
  * This object also allows accumulated information to be retrieved.
  *
  * @author Jitendra Kotamraju
@@ -205,14 +203,17 @@
         invoker = null;
     }
 
+    @Override
     public Binding getBinding() {
         return binding;
     }
 
+    @Override
     public Object getImplementor() {
         return implementor;
     }
 
+    @Override
     public void publish(String address) {
         canPublish();
         URL url;
@@ -232,6 +233,7 @@
         ((HttpEndpoint) actualEndpoint).publish(address);
     }
 
+    @Override
     public void publish(Object serverContext) {
         canPublish();
         if (!com.sun.net.httpserver.HttpContext.class.isAssignableFrom(serverContext.getClass())) {
@@ -241,12 +243,14 @@
         ((HttpEndpoint) actualEndpoint).publish(serverContext);
     }
 
+    @Override
     public void publish(HttpContext serverContext) {
         canPublish();
         createEndpoint(serverContext.getPath());
         ((HttpEndpoint) actualEndpoint).publish(serverContext);
     }
 
+    @Override
     public void stop() {
         if (isPublished()) {
             ((HttpEndpoint) actualEndpoint).stop();
@@ -255,14 +259,17 @@
         }
     }
 
+    @Override
     public boolean isPublished() {
         return actualEndpoint != null;
     }
 
+    @Override
     public List<Source> getMetadata() {
         return metadata;
     }
 
+    @Override
     public void setMetadata(java.util.List<Source> metadata) {
         if (isPublished()) {
             throw new IllegalStateException("Cannot set Metadata. Endpoint is already published");
@@ -270,20 +277,24 @@
         this.metadata = metadata;
     }
 
+    @Override
     public Executor getExecutor() {
         return executor;
     }
 
+    @Override
     public void setExecutor(Executor executor) {
         this.executor = executor;
     }
 
+    @Override
     public Map<String, Object> getProperties() {
-        return new HashMap<String, Object>(properties);
+        return new HashMap<>(properties);
     }
 
+    @Override
     public void setProperties(Map<String, Object> map) {
-        this.properties = new HashMap<String, Object>(map);
+        this.properties = new HashMap<>(map);
     }
 
     /*
@@ -335,7 +346,7 @@
      * reuse the Source object multiple times.
      */
     private List<SDDocumentSource> buildDocList() {
-        List<SDDocumentSource> r = new ArrayList<SDDocumentSource>();
+        List<SDDocumentSource> r = new ArrayList<>();
 
         if (metadata != null) {
             for (Source source : metadata) {
@@ -344,14 +355,8 @@
                     String systemId = source.getSystemId();
 
                     r.add(SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer()));
-                } catch (TransformerException te) {
+                } catch (TransformerException | IOException | SAXException | ParserConfigurationException te) {
                     throw new ServerRtException("server.rt.err", te);
-                } catch (IOException te) {
-                    throw new ServerRtException("server.rt.err", te);
-                } catch (SAXException e) {
-                    throw new ServerRtException("server.rt.err", e);
-                } catch (ParserConfigurationException e) {
-                    throw new ServerRtException("server.rt.err", e);
                 }
             }
         }
@@ -367,11 +372,6 @@
         EndpointFactory.verifyImplementorClass(implClass, metadataReader);
         String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader);
         if (wsdlLocation != null) {
-            ClassLoader cl = implClass.getClassLoader();
-            URL url = cl.getResource(wsdlLocation);
-            if (url != null) {
-                return SDDocumentSource.create(url);
-            }
             return SDDocumentSource.create(implClass, wsdlLocation);
         }
         return null;
@@ -388,10 +388,12 @@
         }
     }
 
+    @Override
     public EndpointReference getEndpointReference(Element...referenceParameters) {
         return getEndpointReference(W3CEndpointReference.class, referenceParameters);
     }
 
+    @Override
     public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element...referenceParameters) {
         if (!isPublished()) {
             throw new WebServiceException("Endpoint is not published yet");
@@ -458,13 +460,12 @@
         public void start(@NotNull WSWebServiceContext wsc, @NotNull WSEndpoint endpoint) {
             try {
                 spiInvoker.inject(wsc);
-            } catch (IllegalAccessException e) {
-                throw new WebServiceException(e);
-            } catch (InvocationTargetException e) {
+            } catch (IllegalAccessException | InvocationTargetException e) {
                 throw new WebServiceException(e);
             }
         }
 
+        @Override
         public Object invoke(@NotNull Packet p, @NotNull Method m, @NotNull Object... args) throws InvocationTargetException, IllegalAccessException {
             return spiInvoker.invoke(m, args);
         }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java
index 6455b83..2d8ecee 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,8 +37,8 @@
 import java.util.Set;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.logging.Level;
 import java.util.logging.Logger;
-import java.util.Optional;
 
 
 /**
@@ -49,10 +49,10 @@
 final class ServerMgr {
 
     private static final ServerMgr serverMgr = new ServerMgr();
-    private static final Logger logger =
+    private static final Logger LOGGER =
         Logger.getLogger(
             com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http");
-    private final Map<InetSocketAddress,ServerState> servers = new HashMap<InetSocketAddress,ServerState>();
+    private final Map<InetSocketAddress,ServerState> servers = new HashMap<>();
 
     private ServerMgr() {}
 
@@ -83,25 +83,26 @@
             synchronized(servers) {
                 state = servers.get(inetAddress);
                 if (state == null) {
-                    final int finalPortNum = port;
-                    Optional<ServerState> stateOpt =
-                               servers.values()
-                                       .stream()
-                                       .filter(s -> s.getServer()
-                                                     .getAddress()
-                                                     .getPort() == finalPortNum)
-                                       .findAny();
-
-                    if (inetAddress.getAddress().isAnyLocalAddress() &&
-                        stateOpt.isPresent()) {
-                        state = stateOpt.get();
+                    ServerState free = null;
+                    for (ServerState ss : servers.values()) {
+                        if (port == ss.getServer().getAddress().getPort()) {
+                            free = ss;
+                            break;
+                        }
+                    }
+                    if (inetAddress.getAddress().isAnyLocalAddress() && free != null) {
+                        state = free;
                     } else {
-                        logger.fine("Creating new HTTP Server at "+inetAddress);
+                        if (LOGGER.isLoggable(Level.FINE)) {
+                            LOGGER.fine("Creating new HTTP Server at "+inetAddress);
+                        }
                         // Creates server with default socket backlog
                         server = HttpServer.create(inetAddress, 0);
                         server.setExecutor(Executors.newCachedThreadPool());
                         String path = url.toURI().getPath();
-                        logger.fine("Creating HTTP Context at = "+path);
+                        if (LOGGER.isLoggable(Level.FINE)) {
+                            LOGGER.fine("Creating HTTP Context at = "+path);
+                        }
                         HttpContext context = server.createContext(path);
                         server.start();
 
@@ -110,7 +111,9 @@
                         // or IP: 0.0.0.0 - which is used to monitor network traffic from any valid IP address
                         inetAddress = server.getAddress();
 
-                        logger.fine("HTTP server started = "+inetAddress);
+                        if (LOGGER.isLoggable(Level.FINE)) {
+                            LOGGER.fine("HTTP server started = "+inetAddress);
+                        }
                         state = new ServerState(server, path);
                         servers.put(inetAddress, state);
                         return context;
@@ -121,11 +124,15 @@
 
             if (state.getPaths().contains(url.getPath())) {
               String err = "Context with URL path "+url.getPath()+ " already exists on the server "+server.getAddress();
-              logger.fine(err);
+              if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.fine(err);
+              }
               throw new IllegalArgumentException(err);
             }
 
-            logger.fine("Creating HTTP Context at = "+url.getPath());
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.fine("Creating HTTP Context at = "+url.getPath());
+            }
             HttpContext context = server.createContext(url.getPath());
             state.oneMoreContext(url.getPath());
             return context;
@@ -157,7 +164,7 @@
     private static final class ServerState {
         private final HttpServer server;
         private int instances;
-        private Set<String> paths = new HashSet<String>();
+        private final Set<String> paths = new HashSet<>();
 
         ServerState(HttpServer server, String path) {
             this.server = server;
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java
index 4238523..53d37f3 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java
@@ -234,17 +234,15 @@
     }
 
     private static InputStream moduleResource(Class resolvingClass, String name) {
-        java.lang.reflect.Module module = resolvingClass.getModule();
-        if (module != null) {
-            try {
-                InputStream stream = module.getResourceAsStream(name);
-                if (stream != null) {
-                    return stream;
-                }
-            } catch(IOException e) {
-                throw new UtilException("util.failed.to.find.handlerchain.file",
-                        resolvingClass.getName(), name);
+        Module module = resolvingClass.getModule();
+        try {
+            InputStream stream = module.getResourceAsStream(name);
+            if (stream != null) {
+                return stream;
             }
+        } catch(IOException e) {
+            throw new UtilException("util.failed.to.find.handlerchain.file",
+                    resolvingClass.getName(), name);
         }
         return null;
     }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/MethodUtil.java
new file mode 100644
index 0000000..8eaf51e
--- /dev/null
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/MethodUtil.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.security.AccessController;
+import java.security.AllPermission;
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+import java.security.PrivilegedExceptionAction;
+import java.security.SecureClassLoader;
+import java.util.Arrays;
+
+/*
+ * This copies from sun.reflect.misc.MethodUtil to implement the trampoline
+ * code such that when a Method is invoked, it will be called through
+ * the trampoline that is defined by this MethodUtil class loader.
+ */
+class Trampoline {
+    static {
+        if (Trampoline.class.getClassLoader() == null) {
+            throw new Error(
+                    "Trampoline must not be defined by the bootstrap classloader");
+        }
+    }
+
+    private static void ensureInvocableMethod(Method m)
+            throws InvocationTargetException {
+        Class<?> clazz = m.getDeclaringClass();
+        if (clazz.equals(AccessController.class) ||
+                clazz.equals(Method.class) ||
+                clazz.getName().startsWith("java.lang.invoke."))
+            throw new InvocationTargetException(
+                    new UnsupportedOperationException("invocation not supported"));
+    }
+
+    private static Object invoke(Method m, Object obj, Object[] params)
+            throws InvocationTargetException, IllegalAccessException {
+        ensureInvocableMethod(m);
+        return m.invoke(obj, params);
+    }
+}
+
+/*
+ * Create a trampoline class.
+ */
+public final class MethodUtil extends SecureClassLoader {
+    private static final String WS_UTIL_PKG = "com.sun.xml.internal.ws.util.";
+    private static final String TRAMPOLINE = WS_UTIL_PKG + "Trampoline";
+    private static final Method bounce = getTrampoline();
+    private static final int DEFAULT_BUFFER_SIZE = 8192;
+    private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
+
+
+    private MethodUtil() {
+        super();
+    }
+
+    /*
+     * Bounce through the trampoline.
+     */
+    public static Object invoke(Method m, Object obj, Object[] params)
+            throws InvocationTargetException, IllegalAccessException {
+        try {
+            return bounce.invoke(null, m, obj, params);
+        } catch (InvocationTargetException ie) {
+            Throwable t = ie.getCause();
+
+            if (t instanceof InvocationTargetException) {
+                throw (InvocationTargetException) t;
+            } else if (t instanceof IllegalAccessException) {
+                throw (IllegalAccessException) t;
+            } else if (t instanceof RuntimeException) {
+                throw (RuntimeException) t;
+            } else if (t instanceof Error) {
+                throw (Error) t;
+            } else {
+                throw new Error("Unexpected invocation error", t);
+            }
+        } catch (IllegalAccessException iae) {
+            // this can't happen
+            throw new Error("Unexpected invocation error", iae);
+        }
+    }
+
+    private static Method getTrampoline() {
+        try {
+            return AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<Method>() {
+                        public Method run() throws Exception {
+                            Class<?> t = getTrampolineClass();
+                            Method b = t.getDeclaredMethod("invoke",
+                                    Method.class, Object.class, Object[].class);
+                            b.setAccessible(true);
+                            return b;
+                        }
+                    });
+        } catch (Exception e) {
+            throw new InternalError("bouncer cannot be found", e);
+        }
+    }
+
+
+    protected synchronized Class<?> loadClass(String name, boolean resolve)
+            throws ClassNotFoundException {
+        // First, check if the class has already been loaded
+        checkPackageAccess(name);
+        Class<?> c = findLoadedClass(name);
+        if (c == null) {
+            try {
+                c = findClass(name);
+            } catch (ClassNotFoundException e) {
+                // Fall through ...
+            }
+            if (c == null) {
+                c = getParent().loadClass(name);
+            }
+        }
+        if (resolve) {
+            resolveClass(c);
+        }
+        return c;
+    }
+
+
+    protected Class<?> findClass(final String name)
+            throws ClassNotFoundException {
+        if (!name.startsWith(WS_UTIL_PKG)) {
+            throw new ClassNotFoundException(name);
+        }
+        String path = "/".concat(name.replace('.', '/').concat(".class"));
+        try (InputStream in = MethodUtil.class.getResourceAsStream(path)) {
+            byte[] b = readAllBytes(in);
+            return defineClass(name, b);
+        } catch (IOException e) {
+            throw new ClassNotFoundException(name, e);
+        }
+    }
+
+    /**
+     * JDK9 {@link InputStream#readAllBytes()} substitution.
+     */
+    private byte[] readAllBytes(InputStream in) throws IOException {
+        byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
+        int capacity = buf.length;
+        int nread = 0;
+        int n;
+        for (; ; ) {
+            // read to EOF which may read more or less than initial buffer size
+            while ((n = in.read(buf, nread, capacity - nread)) > 0)
+                nread += n;
+
+            // if the last call to read returned -1, then we're done
+            if (n < 0)
+                break;
+
+            // need to allocate a larger buffer
+            if (capacity <= MAX_BUFFER_SIZE - capacity) {
+                capacity = capacity << 1;
+            } else {
+                if (capacity == MAX_BUFFER_SIZE)
+                    throw new OutOfMemoryError("Required array size too large");
+                capacity = MAX_BUFFER_SIZE;
+            }
+            buf = Arrays.copyOf(buf, capacity);
+        }
+        return (capacity == nread) ? buf : Arrays.copyOf(buf, nread);
+    }
+
+
+    /*
+     * Define the proxy classes
+     */
+    private Class<?> defineClass(String name, byte[] b) throws IOException {
+        CodeSource cs = new CodeSource(null, (java.security.cert.Certificate[]) null);
+        if (!name.equals(TRAMPOLINE)) {
+            throw new IOException("MethodUtil: bad name " + name);
+        }
+        return defineClass(name, b, 0, b.length, cs);
+    }
+
+    protected PermissionCollection getPermissions(CodeSource codesource) {
+        PermissionCollection perms = super.getPermissions(codesource);
+        perms.add(new AllPermission());
+        return perms;
+    }
+
+    private static Class<?> getTrampolineClass() {
+        try {
+            return Class.forName(TRAMPOLINE, true, new MethodUtil());
+        } catch (ClassNotFoundException e) {
+        }
+        return null;
+    }
+
+    /**
+     * Checks package access on the given classname.
+     * This method is typically called when the Class instance is not
+     * available and the caller attempts to load a class on behalf
+     * the true caller (application).
+     */
+    private static void checkPackageAccess(String name) {
+        SecurityManager s = System.getSecurityManager();
+        if (s != null) {
+            String cname = name.replace('/', '.');
+            if (cname.startsWith("[")) {
+                int b = cname.lastIndexOf('[') + 2;
+                if (b > 1 && b < cname.length()) {
+                    cname = cname.substring(b);
+                }
+            }
+            int i = cname.lastIndexOf('.');
+            if (i != -1) {
+                s.checkPackageAccess(cname.substring(0, i));
+            }
+        }
+    }
+
+    /**
+     * Checks package access on the given class.
+     * <p>
+     * If it is a {@link Proxy#isProxyClass(Class)} that implements
+     * a non-public interface (i.e. may be in a non-restricted package),
+     * also check the package access on the proxy interfaces.
+     */
+    private static void checkPackageAccess(Class<?> clazz) {
+        checkPackageAccess(clazz.getName());
+        if (isNonPublicProxyClass(clazz)) {
+            checkProxyPackageAccess(clazz);
+        }
+    }
+
+    // Note that bytecode instrumentation tools may exclude 'sun.*'
+    // classes but not generated proxy classes and so keep it in com.sun.*
+    private static final String PROXY_PACKAGE = "com.sun.proxy";
+
+    /**
+     * Test if the given class is a proxy class that implements
+     * non-public interface.  Such proxy class may be in a non-restricted
+     * package that bypasses checkPackageAccess.
+     */
+    private static boolean isNonPublicProxyClass(Class<?> cls) {
+        String name = cls.getName();
+        int i = name.lastIndexOf('.');
+        String pkg = (i != -1) ? name.substring(0, i) : "";
+        return Proxy.isProxyClass(cls) && !pkg.startsWith(PROXY_PACKAGE);
+    }
+
+    /**
+     * Check package access on the proxy interfaces that the given proxy class
+     * implements.
+     *
+     * @param clazz Proxy class object
+     */
+    private static void checkProxyPackageAccess(Class<?> clazz) {
+        SecurityManager s = System.getSecurityManager();
+        if (s != null) {
+            // check proxy interfaces if the given class is a proxy class
+            if (Proxy.isProxyClass(clazz)) {
+                for (Class<?> intf : clazz.getInterfaces()) {
+                    checkPackageAccess(intf);
+                }
+            }
+        }
+    }
+}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
index eedc7c2..82452ac 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,4 +26,4 @@
 build-id=2.3.0-SNAPSHOT
 build-version=JAX-WS RI 2.3.0-SNAPSHOT
 major-version=2.3.0
-svn-revision=5c2c1fd2f2ab3b5c7cea25f79aa49e54cb84b7cc
+svn-revision=e8c5e9697d9b27d83ff35d767939b2f55e667621
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java
index 93a44b6..715db42 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 
 package com.sun.xml.internal.ws.util.xml;
 
+import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.properties
deleted file mode 100644
index c0267b8..0000000
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java
new file mode 100644
index 0000000..d1ef864
--- /dev/null
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.xml.internal.ws.util.xml;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.server.ServerRtException;
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import javax.xml.catalog.CatalogFeatures;
+import javax.xml.catalog.CatalogFeatures.Feature;
+import javax.xml.catalog.CatalogManager;
+import javax.xml.ws.WebServiceException;
+import org.xml.sax.EntityResolver;
+
+/**
+ *
+ * @author lukas
+ */
+public class XmlCatalogUtil {
+
+    // Cache CatalogFeatures instance for future usages.
+    // Resolve feature is set to "continue" value for backward compatibility.
+    private static final CatalogFeatures CATALOG_FEATURES
+            = CatalogFeatures.builder().with(Feature.RESOLVE, "continue").build();
+
+    /**
+     * Gets an EntityResolver using XML catalog
+     *
+     * @param catalogUrl
+     * @return
+     */
+    public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) {
+        ArrayList<URL> urlsArray = new ArrayList<>();
+        EntityResolver er;
+        if (catalogUrl != null) {
+            urlsArray.add(catalogUrl);
+        }
+        try {
+            er = createCatalogResolver(urlsArray);
+        } catch (Exception e) {
+            throw new ServerRtException("server.rt.err", e);
+        }
+        return er;
+    }
+
+    /**
+     * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
+     *
+     * @return
+     */
+    public static EntityResolver createDefaultCatalogResolver() {
+        EntityResolver er;
+        try {
+            /**
+             * Gets a URLs for catalog defined at META-INF/jaxws-catalog.xml
+             */
+            ClassLoader cl = Thread.currentThread().getContextClassLoader();
+            Enumeration<URL> catalogEnum;
+            if (cl == null) {
+                catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
+            } else {
+                catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
+            }
+            er = createCatalogResolver(Collections.list(catalogEnum));
+        } catch (Exception e) {
+            throw new WebServiceException(e);
+        }
+
+        return er;
+    }
+
+    /**
+     * Instantiate catalog resolver using new catalog API (javax.xml.catalog.*)
+     * added in JDK9. Usage of new API removes dependency on internal API
+     * (com.sun.org.apache.xml.internal) for modular runtime.
+     */
+    private static EntityResolver createCatalogResolver(ArrayList<URL> urls) throws Exception {
+        // Prepare array of catalog URIs
+        URI[] uris = urls.stream()
+                             .map(u -> URI.create(u.toExternalForm()))
+                             .toArray(URI[]::new);
+
+        //Create CatalogResolver with new JDK9+ API
+        return (EntityResolver) CatalogManager.catalogResolver(CATALOG_FEATURES, uris);
+    }
+
+}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java
index d84fa5e..213b584 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java
@@ -26,30 +26,21 @@
 package com.sun.xml.internal.ws.util.xml;
 
 import com.sun.istack.internal.Nullable;
-import com.sun.xml.internal.ws.server.ServerRtException;
 import com.sun.xml.internal.ws.util.ByteArrayBuffer;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
-import java.lang.reflect.Method;
-import java.net.URI;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import java.util.stream.Collectors;
 import javax.xml.XMLConstants;
-import javax.xml.catalog.CatalogFeatures;
-import javax.xml.catalog.CatalogFeatures.Feature;
-import javax.xml.catalog.CatalogManager;
 import javax.xml.namespace.QName;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -65,7 +56,6 @@
 import javax.xml.transform.sax.TransformerHandler;
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.validation.SchemaFactory;
-import javax.xml.ws.WebServiceException;
 import javax.xml.xpath.XPathFactory;
 import javax.xml.xpath.XPathFactoryConfigurationException;
 import org.w3c.dom.Attr;
@@ -78,6 +68,8 @@
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 
@@ -184,7 +176,7 @@
     }
 
     public static List<String> parseTokenList(String tokenList) {
-        List<String> result = new ArrayList<String>();
+        List<String> result = new ArrayList<>();
         StringTokenizer tokenizer = new StringTokenizer(tokenList, " ");
         while (tokenizer.hasMoreTokens()) {
             result.add(tokenizer.nextToken());
@@ -247,6 +239,7 @@
 
     /**
      * Creates a new identity transformer.
+     * @return
      */
     public static Transformer newTransformer() {
         try {
@@ -258,9 +251,17 @@
 
     /**
      * Performs identity transformation.
+     * @param <T>
+     * @param src
+     * @param result
+     * @return
+     * @throws javax.xml.transform.TransformerException
+     * @throws java.io.IOException
+     * @throws org.xml.sax.SAXException
+     * @throws javax.xml.parsers.ParserConfigurationException
      */
-    public static <T extends Result>
-    T identityTransform(Source src, T result) throws TransformerException, SAXException, ParserConfigurationException, IOException {
+    public static <T extends Result> T identityTransform(Source src, T result)
+            throws TransformerException, SAXException, ParserConfigurationException, IOException {
         if (src instanceof StreamSource) {
             // work around a bug in JAXP in JDK6u4 and earlier where the namespace processing
             // is not turned on by default
@@ -286,69 +287,26 @@
         return is;
     }
 
-    /*
-    * Gets an EntityResolver using XML catalog
-    */
-     public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) {
-        ArrayList<URL> urlsArray = new ArrayList<URL>();
-        EntityResolver er;
-        if (catalogUrl != null) {
-            urlsArray.add(catalogUrl);
-        }
-        try {
-            er = createCatalogResolver(urlsArray);
-        } catch (Exception e) {
-            throw new ServerRtException("server.rt.err",e);
-        }
-        return er;
+    /**
+     * Gets an EntityResolver using XML catalog
+     *
+     * @param catalogUrl
+     * @return
+     */
+    public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) {
+        return XmlCatalogUtil.createEntityResolver(catalogUrl);
     }
 
     /**
      * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
+     *
+     * @return
      */
     public static EntityResolver createDefaultCatalogResolver() {
-        EntityResolver er;
-        try {
-            /**
-             * Gets a URLs for catalog defined at META-INF/jaxws-catalog.xml
-             */
-            ClassLoader cl = Thread.currentThread().getContextClassLoader();
-            Enumeration<URL> catalogEnum;
-            if (cl == null) {
-                catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
-            } else {
-                catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
-            }
-            er = createCatalogResolver(Collections.list(catalogEnum));
-        } catch (Exception e) {
-            throw new WebServiceException(e);
-        }
-
-        return er;
+        return XmlCatalogUtil.createDefaultCatalogResolver();
     }
 
     /**
-     * Instantiate catalog resolver using new catalog API (javax.xml.catalog.*)
-     * added in JDK9. Usage of new API removes dependency on internal API
-     * (com.sun.org.apache.xml.internal) for modular runtime.
-     */
-    private static EntityResolver createCatalogResolver(ArrayList<URL> urls) throws Exception {
-        // Prepare array of catalog URIs
-        URI[] uris = urls.stream()
-                             .map(u -> URI.create(u.toExternalForm()))
-                             .toArray(URI[]::new);
-
-        //Create CatalogResolver with new JDK9+ API
-        return (EntityResolver) CatalogManager.catalogResolver(catalogFeatures, uris);
-    }
-
-    // Cache CatalogFeatures instance for future usages.
-    // Resolve feature is set to "continue" value for backward compatibility.
-    private static CatalogFeatures catalogFeatures = CatalogFeatures.builder()
-                                                    .with(Feature.RESOLVE, "continue")
-                                                    .build();
-
-    /**
      * {@link ErrorHandler} that always treat the error as fatal.
      */
     public static final ErrorHandler DRACONIAN_ERROR_HANDLER = new ErrorHandler() {
@@ -391,7 +349,7 @@
         SAXParserFactory factory = SAXParserFactory.newInstance();
         try {
             factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !xmlSecurityDisabled(disableSecurity));
-        } catch (Exception e) {
+        } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) {
             LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()});
         }
         return factory;
diff --git a/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java
index ef5500a..190471c 100644
--- a/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java
+++ b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -245,10 +245,14 @@
         return null;
     }
 
-    private static String getSystemProperty(String property) {
+    private static String getSystemProperty(final String property) {
         logger.log(Level.FINE, "Checking system property {0}", property);
-        String value = AccessController.doPrivileged(
-                (PrivilegedAction<String>) () -> System.getProperty(property));
+        String value = AccessController.doPrivileged(new PrivilegedAction<String>() {
+            @Override
+            public String run() {
+                return System.getProperty(property);
+            }
+        });
         logFound(value);
         return value;
     }
diff --git a/jaxws/src/java.xml.ws/share/classes/module-info.java b/jaxws/src/java.xml.ws/share/classes/module-info.java
index 4a0175e..a1f9cfb 100644
--- a/jaxws/src/java.xml.ws/share/classes/module-info.java
+++ b/jaxws/src/java.xml.ws/share/classes/module-info.java
@@ -26,7 +26,11 @@
 /**
  * Defines the Java API for XML-Based Web Services (JAX-WS), and
  * the Web Services Metadata API.
+ *
+ * @moduleGraph
+ * @since 9
  */
+@Deprecated(since="9", forRemoval=true)
 module java.xml.ws {
     requires transitive java.activation;
     requires transitive java.xml;
@@ -36,6 +40,7 @@
     requires java.logging;
     requires java.management;
     requires jdk.httpserver;
+    requires jdk.unsupported;
 
     uses javax.xml.ws.spi.Provider;
     uses javax.xml.soap.MessageFactory;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java
index 1af2c5d..fe7813eb 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,8 +85,8 @@
      *      ("my_children","MyChildren","myChildren", and "MY-CHILDREN", "CODE003-children" respectively)
      *      <p>
      *      Although this method only works for English words, it handles non-English
-     *      words gracefully (by just returning it as-is.) For example, "&#x65E5;&#x672C;&#x8A9E;"
-     *      will be returned as-is without modified, not "&#x65E5;&#x672C;&#x8A9E;s"
+     *      words gracefully (by just returning it as-is.) For example, "{@literal &#x65E5;&#x672C;&#x8A9E;}"
+     *      will be returned as-is without modified, not "{@literal &#x65E5;&#x672C;&#x8A9E;s}"
      *      <p>
      *      This method doesn't handle suffixes very well. For example, passing
      *      "person56" will return "person56s", not "people56".
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java
index 472aa50..af71cbd 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@
      */
     @Override
     public int hashCode() {
-        return 97 * (Integer.hashCode(getType().ordinal() + 1)) + name.hashCode();
+        return 97 * (Integer.valueOf(getType().ordinal() + 1)).hashCode() + name.hashCode();
     }
 
     /**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java
index 9a9fae3..a824946 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
  *
  * <p>
  * Note that this class doesn't escape other Unicode characters
- * that are typically unsafe. For example, &#x611B; (A kanji
+ * that are typically unsafe. For example, {@literal &#x611B;} (A kanji
  * that means "love") can be considered as unsafe because
  * javac with English Windows cannot accept this character in the
  * source code.
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java
index d4feaee..c149697 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 import java.net.Authenticator;
 import java.net.Authenticator.RequestorType;
 import java.net.MalformedURLException;
@@ -42,6 +43,8 @@
 import java.net.URLEncoder;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.logging.Level;
@@ -56,11 +59,12 @@
  */
 public class DefaultAuthenticator extends Authenticator {
 
+    private static final Logger LOGGER = Logger.getLogger(DefaultAuthenticator.class.getName());
     private static DefaultAuthenticator instance;
     private static Authenticator systemAuthenticator = getCurrentAuthenticator();
     private String proxyUser;
     private String proxyPasswd;
-    private final List<AuthInfo> authInfo = new ArrayList<AuthInfo>();
+    private final List<AuthInfo> authInfo = new ArrayList<>();
     private static int counter = 0;
 
     DefaultAuthenticator() {
@@ -145,10 +149,7 @@
                 fi = new FileInputStream(f);
                 is = new InputStreamReader(fi, "UTF-8");
                 in = new BufferedReader(is);
-            } catch (UnsupportedEncodingException e) {
-                listener.onError(e, locator);
-                return;
-            } catch (FileNotFoundException e) {
+            } catch (UnsupportedEncodingException | FileNotFoundException e) {
                 listener.onError(e, locator);
                 return;
             }
@@ -170,7 +171,7 @@
                 }
             } catch (IOException e) {
                 listener.onError(e, locator);
-                Logger.getLogger(DefaultAuthenticator.class.getName()).log(Level.SEVERE, e.getMessage(), e);
+                LOGGER.log(Level.SEVERE, e.getMessage(), e);
             }
         } finally {
             try {
@@ -184,7 +185,7 @@
                     fi.close();
                 }
             } catch (IOException ex) {
-                Logger.getLogger(DefaultAuthenticator.class.getName()).log(Level.SEVERE, null, ex);
+                LOGGER.log(Level.SEVERE, null, ex);
             }
         }
     }
@@ -225,6 +226,29 @@
     }
 
     static Authenticator getCurrentAuthenticator() {
+        try {
+            return AccessController.doPrivileged(new PrivilegedExceptionAction<Authenticator>() {
+                @Override
+                public Authenticator run() throws Exception {
+                    Method method = Authenticator.class.getMethod("getDefault");
+                    return (Authenticator) method.invoke(null);
+                }
+
+            });
+        } catch (PrivilegedActionException pae) {
+            if (LOGGER.isLoggable(Level.FINE)) {
+                LOGGER.log(Level.FINE, null, pae);
+            }
+            Exception ex = pae.getException();
+            if (!(ex instanceof NoSuchMethodException)) {
+                // if Authenticator.getDefault has not been found,
+                // we likely didn't get through sec, so return null
+                // and don't care about JDK version we're on
+                return null;
+            }
+            // or we're on JDK <9, so let's continue the old way...
+        }
+
         final Field f = getTheAuthenticator();
         if (f == null) {
             return null;
@@ -239,7 +263,7 @@
                 }
             });
             return (Authenticator) f.get(null);
-        } catch (Exception ex) {
+        } catch (IllegalAccessException | IllegalArgumentException ex) {
             return null;
         } finally {
             AccessController.doPrivileged(new PrivilegedAction<Void>() {
@@ -255,7 +279,7 @@
     private static Field getTheAuthenticator() {
         try {
             return Authenticator.class.getDeclaredField("theAuthenticator");
-        } catch (Exception ex) {
+        } catch (NoSuchFieldException | SecurityException ex) {
             return null;
         }
     }
@@ -277,7 +301,7 @@
         @Override
         public void onError(Exception e, Locator loc) {
             System.err.println(getLocationString(loc) + ": " + e.getMessage());
-            Logger.getLogger(DefaultAuthenticator.class.getName()).log(Level.SEVERE, e.getMessage(), e);
+            LOGGER.log(Level.SEVERE, e.getMessage(), e);
         }
 
         private String getLocationString(Locator l) {
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java
index 4c08e4d..4061f18 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
 
 package com.sun.istack.internal.tools;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  * Class defined for safe calls of getClassLoader methods of any kind (context/system/class
  * classloader. This MUST be package private and defined in every package which
@@ -37,9 +40,10 @@
         if (System.getSecurityManager() == null) {
             return Thread.currentThread().getContextClassLoader();
         } else {
-            return (ClassLoader) java.security.AccessController.doPrivileged(
-                    new java.security.PrivilegedAction() {
-                        public java.lang.Object run() {
+            return AccessController.doPrivileged(
+                    new PrivilegedAction<ClassLoader>() {
+                        @Override
+                        public ClassLoader run() {
                             return Thread.currentThread().getContextClassLoader();
                         }
                     });
@@ -50,9 +54,10 @@
         if (System.getSecurityManager() == null) {
             return c.getClassLoader();
         } else {
-            return (ClassLoader) java.security.AccessController.doPrivileged(
-                    new java.security.PrivilegedAction() {
-                        public java.lang.Object run() {
+            return AccessController.doPrivileged(
+                    new PrivilegedAction<ClassLoader>() {
+                        @Override
+                        public ClassLoader run() {
                             return c.getClassLoader();
                         }
                     });
@@ -63,9 +68,10 @@
         if (System.getSecurityManager() == null) {
             return ClassLoader.getSystemClassLoader();
         } else {
-            return (ClassLoader) java.security.AccessController.doPrivileged(
-                    new java.security.PrivilegedAction() {
-                        public java.lang.Object run() {
+            return AccessController.doPrivileged(
+                    new PrivilegedAction<ClassLoader>() {
+                        @Override
+                        public ClassLoader run() {
                             return ClassLoader.getSystemClassLoader();
                         }
                     });
@@ -76,9 +82,10 @@
         if (System.getSecurityManager() == null) {
             return cl.getParent();
         } else {
-            return (ClassLoader) java.security.AccessController.doPrivileged(
-                    new java.security.PrivilegedAction() {
-                        public java.lang.Object run() {
+            return AccessController.doPrivileged(
+                    new PrivilegedAction<ClassLoader>() {
+                        @Override
+                        public ClassLoader run() {
                             return cl.getParent();
                         }
                     });
@@ -89,9 +96,10 @@
         if (System.getSecurityManager() == null) {
             Thread.currentThread().setContextClassLoader(cl);
         } else {
-            java.security.AccessController.doPrivileged(
-                    new java.security.PrivilegedAction() {
-                        public java.lang.Object run() {
+            AccessController.doPrivileged(
+                    new PrivilegedAction<ClassLoader>() {
+                        @Override
+                        public ClassLoader run() {
                             Thread.currentThread().setContextClassLoader(cl);
                             return null;
                         }
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
index 0cc3e21..0f2b377 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -30,10 +30,10 @@
     Non-existent directory: {0}
 
 VERSION = \
-        schemagen 2.3.0-SNAPSHOT
+        schemagen 2.3.0-b170215.1712
 
 FULLVERSION = \
-        schemagen full version "2.3.0-SNAPSHOT"
+        schemagen full version "2.3.0-b170215.1712"
 
 USAGE = \
 Usage: schemagen [-options ...] <java files> \n\
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
index 3158ce3..be77744 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0}
 
-VERSION = schemagen 2.3.0-SNAPSHOT
+VERSION = schemagen 2.3.0-b170215.1712
 
-FULLVERSION = schemagen vollst\u00E4ndige Version "2.3.0-SNAPSHOT"
+FULLVERSION = schemagen vollst\u00E4ndige Version "2.3.0-b170215.1712"
 
 USAGE = Verwendung: schemagen [-options ...] <java files> \nOptionen: \n\\ \\ \\ \\ -d <path>             : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp <path>            : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath <path>     : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding <encoding>  : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode <file>       : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version              : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion          : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help                 : Zeigt diese Verwendungsmeldung an
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
index 81d9274d..632f594 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = Directorio no existente: {0}
 
-VERSION = schemagen 2.3.0-SNAPSHOT
+VERSION = schemagen 2.3.0-b170215.1712
 
-FULLVERSION = versi\u00F3n completa de schemagen "2.3.0-SNAPSHOT"
+FULLVERSION = versi\u00F3n completa de schemagen "2.3.0-b170215.1712"
 
 USAGE = Sintaxis: schemagen [-options ...] <archivos java> \nOpciones: \n\\ \\ \\ \\ -d <ruta de acceso>             : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp <ruta de acceso>            : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding <codificaci\u00F3n>  : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode <archivo>       : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version              : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion          : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help                 : muestra este mensaje de sintaxis
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
index 597ce0e..6acdbba 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant
 
-VERSION = schemagen 2.3.0-SNAPSHOT
+VERSION = schemagen 2.3.0-b170215.1712
 
-FULLVERSION = version compl\u00E8te de schemagen "2.3.0-SNAPSHOT"
+FULLVERSION = version compl\u00E8te de schemagen "2.3.0-b170215.1712"
 
 USAGE = Syntaxe : schemagen [-options ...] <java files> \nOptions : \n\ \ \ \ -d <path> : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp <path> : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath <path> : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding <encoding> : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode <file> : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
index c7ef575e..00fe597 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = Directory non esistente: {0}
 
-VERSION = schemagen 2.3.0-SNAPSHOT
+VERSION = schemagen 2.3.0-b170215.1712
 
-FULLVERSION = versione completa schemagen "2.3.0-SNAPSHOT"
+FULLVERSION = versione completa schemagen "2.3.0-b170215.1712"
 
 USAGE = Uso: schemagen [-options ...] <java files> \nOpzioni: \n\ \ \ \ -d <path>             : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp <path>            : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath <path>     : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding <encoding>  : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode <file>       : genera il file di episodio per la compilazione separata\n\ \ \ \ -version              : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion          : visualizza le informazioni sulla versione completa\n\ \ \ \ -help                 : visualizza questo messaggio sull'uso
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
index e07c234..638e47d 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
 
-VERSION = schemagen 2.3.0-SNAPSHOT
+VERSION = schemagen 2.3.0-b170215.1712
 
-FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-SNAPSHOT"
+FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-b170215.1712"
 
 USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] <java files> \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d <path>             : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp <path>            : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath <path>     : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding <encoding>  : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode <file>       : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version              : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion          : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help                 : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
index f4e5fa4..4169311 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0}
 
-VERSION = schemagen 2.3.0-SNAPSHOT
+VERSION = schemagen 2.3.0-b170215.1712
 
-FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.3.0-SNAPSHOT"
+FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.3.0-b170215.1712"
 
 USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] <java files> \n\uC635\uC158: \n\ \ \ \ -d <path>             : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp <path>            : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath <path>     : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding <encoding>  : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode <file>       : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version              : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion          : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help                 : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
index d56ca38..6da2bc9 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0}
 
-VERSION = gera\u00E7\u00E3o do esquema 2.3.0-SNAPSHOT
+VERSION = gera\u00E7\u00E3o do esquema 2.3.0-b170215.1712
 
-FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.3.0-SNAPSHOT"
+FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.3.0-b170215.1712"
 
 USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] <java files> \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d <path>             : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp <path>            : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath <path>     : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding <encoding>  : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode <file>       : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version              : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion          : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help                 : exibir esta mensagem de uso
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
index c1be9f0..beed169 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0}
 
-VERSION = schemagen 2.3.0-SNAPSHOT
+VERSION = schemagen 2.3.0-b170215.1712
 
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-b170215.1712"
 
 USAGE = \u7528\u6CD5: schemagen [-options ...] <java files> \n\u9009\u9879: \n\ \ \ \ -d <path>             : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp <path>            : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath <path>     : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding <encoding>  : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode <file>       : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version              : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion          : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help                 : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
index dcd7976..0174469 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
 
 BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0}
 
-VERSION = schemagen 2.3.0-SNAPSHOT
+VERSION = schemagen 2.3.0-b170215.1712
 
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-b170215.1712"
 
 USAGE = \u7528\u6CD5: schemagen [-options ...] <java files> \n\u9078\u9805: \n\\ \\ \\ \\ -d <path>             : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp <path>            : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath <path>     : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding <encoding>  : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode <file>       : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version              : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion          : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help                 : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package-info.java
new file mode 100644
index 0000000..52b29b2
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package-info.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Annotation Processing related code.
+ *
+ *  This package hosts a driver that runs annotation processing for java-to-schema processing,
+ *  and additional implementations that deal primarily with AP.
+ */
+package com.sun.tools.internal.jxc.ap;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package.html
deleted file mode 100644
index 8f893b5..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-    <body>
-    Annotation Processing related code.
-
-    This package hosts a driver that runs annotation processing for java-to-schema processing,
-    and additional implementations that deal primarily with AP.
-    </body>
-</html>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/CatalogUtil.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/CatalogUtil.java
new file mode 100644
index 0000000..0d3dbc5
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/CatalogUtil.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.internal.xjc;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import javax.xml.catalog.CatalogFeatures;
+import javax.xml.catalog.CatalogFeatures.Feature;
+import javax.xml.catalog.CatalogManager;
+import org.xml.sax.EntityResolver;
+
+/**
+ *
+ * @author lukas
+ */
+final class CatalogUtil {
+
+    // Cache CatalogFeatures instance for future usages.
+    // Resolve feature is set to "continue" value for backward compatibility.
+    private static final CatalogFeatures CATALOG_FEATURES = CatalogFeatures.builder()
+                                                    .with(Feature.RESOLVE, "continue")
+                                                    .build();
+
+    static EntityResolver getCatalog(EntityResolver entityResolver, File catalogFile, ArrayList<URI> catalogUrls) throws IOException {
+        return CatalogManager.catalogResolver(
+                CATALOG_FEATURES, catalogUrls.stream().toArray(URI[]::new));
+    }
+}
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
index 6a418f5..fa3f5b2 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -173,20 +173,20 @@
 Driver.FailedToGenerateCode = \
         Failed to produce code.
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
 Driver.FilePrologComment = \
-        This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT \n\
+        This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170215.1712 \n\
         See <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \n\
         Any modifications to this file will be lost upon recompilation of the source schema. \n\
         Generated on: {0} \n
 
 Driver.Version = \
-        xjc 2.3.0-SNAPSHOT
+        xjc 2.3.0-b170215.1712
 
 Driver.FullVersion = \
-        xjc full version "2.3.0-SNAPSHOT"
+        xjc full version "2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
index 7d645e9..57e1bb3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -127,14 +127,14 @@
 
 Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden.
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT generiert \nSiehe <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170215.1712 generiert \nSiehe <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
 
-Driver.Version = xjc 2.3.0-SNAPSHOT
+Driver.Version = xjc 2.3.0-b170215.1712
 
-Driver.FullVersion = xjc vollst\u00E4ndige Version "2.3.0-SNAPSHOT"
+Driver.FullVersion = xjc vollst\u00E4ndige Version "2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
index e7196a5..63de1fa 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -127,14 +127,14 @@
 
 Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo.
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.3.0-SNAPSHOT \nVisite <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.3.0-b170215.1712 \nVisite <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
 
-Driver.Version = xjc 2.3.0-SNAPSHOT
+Driver.Version = xjc 2.3.0-b170215.1712
 
-Driver.FullVersion = versi\u00F3n completa de xjc "2.3.0-SNAPSHOT"
+Driver.FullVersion = versi\u00F3n completa de xjc "2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
index 6a1719d..5ad5ff8 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -131,14 +131,14 @@
 
 Driver.FailedToGenerateCode = Echec de la production du code.
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.3.0-SNAPSHOT \nVoir <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.3.0-b170215.1712 \nVoir <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
 
-Driver.Version = xjc 2.3.0-SNAPSHOT
+Driver.Version = xjc 2.3.0-b170215.1712
 
-Driver.FullVersion = version compl\u00E8te xjc "2.3.0-SNAPSHOT"
+Driver.FullVersion = version compl\u00E8te xjc "2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
index a1762e7..9d00dd7 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -127,14 +127,14 @@
 
 Driver.FailedToGenerateCode = Produzione del codice non riuscita.
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.3.0-SNAPSHOT \nVedere <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.3.0-b170215.1712 \nVedere <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
 
-Driver.Version = xjc 2.3.0-SNAPSHOT
+Driver.Version = xjc 2.3.0-b170215.1712
 
-Driver.FullVersion = versione completa xjc "2.3.0-SNAPSHOT"
+Driver.FullVersion = versione completa xjc "2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
index abdf441..c7a60c6 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -127,14 +127,14 @@
 
 Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.3.0-SNAPSHOT\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \n<a href="https://jaxb.java.net/">https://jaxb.java.net/</a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.3.0-b170215.1712\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \n<a href="https://jaxb.java.net/">https://jaxb.java.net/</a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
 
-Driver.Version = xjc 2.3.0-SNAPSHOT
+Driver.Version = xjc 2.3.0-b170215.1712
 
-Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-SNAPSHOT"
+Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
index d129d33..3101802 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -127,14 +127,14 @@
 
 Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4.
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.3.0-SNAPSHOT \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \n<a href="https://jaxb.java.net/">https://jaxb.java.net/</a>\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.3.0-b170215.1712 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \n<a href="https://jaxb.java.net/">https://jaxb.java.net/</a>\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
 
-Driver.Version = XJC 2.3.0-SNAPSHOT
+Driver.Version = XJC 2.3.0-b170215.1712
 
-Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.3.0-SNAPSHOT"
+Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
index 5808395..71c827a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -127,14 +127,14 @@
 
 Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo.
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.3.0-SNAPSHOT \nConsulte <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.3.0-b170215.1712 \nConsulte <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
 
-Driver.Version = xjc 2.3.0-SNAPSHOT
+Driver.Version = xjc 2.3.0-b170215.1712
 
-Driver.FullVersion = vers\u00E3o completa de xjc "2.3.0-SNAPSHOT"
+Driver.FullVersion = vers\u00E3o completa de xjc "2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
index 3439726..efd45c5 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -131,14 +131,14 @@
 
 Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.3.0-SNAPSHOT \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.3.0-b170215.1712 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
 
-Driver.Version = xjc 2.3.0-SNAPSHOT
+Driver.Version = xjc 2.3.0-b170215.1712
 
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
index 2685c64..4889fc5 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -127,14 +127,14 @@
 
 Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc.
 
-# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn <properties filter>
-Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
+# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn <properties filter>
+Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170215.1712 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 <a href="https://jaxb.java.net/">https://jaxb.java.net/</a> \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
 
-Driver.Version = xjc 2.3.0-SNAPSHOT
+Driver.Version = xjc 2.3.0-b170215.1712
 
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-b170215.1712"
 
-Driver.BuildID = 2.3.0-SNAPSHOT
+Driver.BuildID = 2.3.0-b170215.1712
 
 # for JDK integration - include version in source zip
 jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
index 10c1bda..e1603cb 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
@@ -25,6 +25,27 @@
 
 package com.sun.tools.internal.xjc;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.ServiceLoader;
+import java.util.Set;
+
 import com.sun.codemodel.internal.CodeWriter;
 import com.sun.codemodel.internal.JPackage;
 import com.sun.codemodel.internal.JResourceFile;
@@ -37,40 +58,16 @@
 import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.reader.Util;
 import com.sun.xml.internal.bind.api.impl.NameConverter;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
 import java.nio.charset.Charset;
 import java.nio.charset.IllegalCharsetNameException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
 import java.util.Locale;
-import java.util.ServiceLoader;
-import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.xml.catalog.CatalogFeatures;
-import javax.xml.catalog.CatalogFeatures.Feature;
-import javax.xml.catalog.CatalogManager;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
 
 /**
  * Global options.
@@ -181,7 +178,7 @@
     public File targetDir = new File(".");
 
     /**
-     * Actually stores {@link CatalogResolver}, but the field
+     * On JDK 8 an odler stores {@code CatalogResolver}, but the field
      * type is made to {@link EntityResolver} so that XJC can be
      * used even if resolver.jar is not available in the classpath.
      */
@@ -208,9 +205,9 @@
     /**
      * Input schema files as a list of {@link InputSource}s.
      */
-    private final List<InputSource> grammars = new ArrayList<InputSource>();
+    private final List<InputSource> grammars = new ArrayList<>();
 
-    private final List<InputSource> bindFiles = new ArrayList<InputSource>();
+    private final List<InputSource> bindFiles = new ArrayList<>();
 
     // Proxy setting.
     private String proxyHost = null;
@@ -220,7 +217,7 @@
     /**
      * {@link Plugin}s that are enabled in this compilation.
      */
-    public final List<Plugin> activePlugins = new ArrayList<Plugin>();
+    public final List<Plugin> activePlugins = new ArrayList<>();
 
     /**
      * All discovered {@link Plugin}s.
@@ -233,7 +230,7 @@
     /**
      * Set of URIs that plug-ins recognize as extension bindings.
      */
-    public final Set<String> pluginURIs = new HashSet<String>();
+    public final Set<String> pluginURIs = new HashSet<>();
 
     /**
      * This allocator has the final say on deciding the class name.
@@ -357,6 +354,7 @@
      * A plugins are enumerated when this method is called for the first time,
      * by taking {@link #classpaths} into account. That means
      * "-cp plugin.jar" has to come before you specify options to enable it.
+     * @return
      */
     public List<Plugin> getAllPlugins() {
         if(allPlugins==null) {
@@ -375,13 +373,15 @@
         this.schemaLanguage = _schemaLanguage;
     }
 
-    /** Input schema files. */
+    /** Input schema files.
+     * @return  */
     public InputSource[] getGrammars() {
         return grammars.toArray(new InputSource[grammars.size()]);
     }
 
     /**
      * Adds a new input schema.
+     * @param is
      */
     public void addGrammar( InputSource is ) {
         grammars.add(absolutize(is));
@@ -402,6 +402,7 @@
 
     /**
      * Recursively scan directories and add all XSD files in it.
+     * @param dir
      */
     public void addGrammarRecursive( File dir ) {
         addRecursive(dir,".xsd",grammars);
@@ -432,13 +433,15 @@
         return is;
     }
 
-    /** Input external binding files. */
+    /** Input external binding files.
+     * @return  */
     public InputSource[] getBindFiles() {
         return bindFiles.toArray(new InputSource[bindFiles.size()]);
     }
 
     /**
      * Adds a new binding file.
+     * @param is
      */
     public void addBindFile( InputSource is ) {
         bindFiles.add(absolutize(is));
@@ -446,6 +449,7 @@
 
     /**
      * Adds a new binding file.
+     * @param bindFile
      */
     public void addBindFile( File bindFile ) {
         bindFiles.add(fileToInputSource(bindFile));
@@ -453,15 +457,18 @@
 
     /**
      * Recursively scan directories and add all ".xjb" files in it.
+     * @param dir
      */
     public void addBindFileRecursive( File dir ) {
         addRecursive(dir,".xjb",bindFiles);
     }
 
-    public final List<URL> classpaths = new ArrayList<URL>();
+    public final List<URL> classpaths = new ArrayList<>();
     /**
      * Gets a classLoader that can load classes specified via the
      * -classpath option.
+     * @param parent
+     * @return
      */
     public ClassLoader getUserClassLoader( ClassLoader parent ) {
         if (classpaths.isEmpty())
@@ -482,6 +489,8 @@
      * Parses an option {@code args[i]} and return
      * the number of tokens consumed.
      *
+     * @param args
+     * @param i
      * @return
      *      0 if the argument is not understood. Returning 0
      *      will let the caller report an error.
@@ -610,10 +619,8 @@
                     Messages.format(Messages.NO_SUCH_FILE,file));
             }
 
-            try {
-                BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));
+            try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"))) {
                 parseProxy(in.readLine());
-                in.close();
             } catch (IOException e) {
                 throw new BadCommandLineException(
                     Messages.format(Messages.FAILED_TO_PARSE,file,e.getMessage()),e);
@@ -639,7 +646,9 @@
             return 2;
         }
         if( args[i].equals("-catalog") ) {
-            // use javax.xml.catalog to resolve external entities.
+            // use Sun's "XML Entity and URI Resolvers" by Norman Walsh
+            // to resolve external entities.
+            // https://xerces.apache.org/xml-commons/components/resolver/resolver-article.html
 
             File catalogFile = new File(requireArgument("-catalog",args,++i));
             try {
@@ -652,6 +661,7 @@
         }
         if( args[i].equals("-Xtest-class-name-allocator") ) {
             classNameAllocator = new ClassNameAllocator() {
+                @Override
                 public String assignClassName(String packageName, String className) {
                     System.out.printf("assignClassName(%s,%s)\n",packageName,className);
                     return className+"_Type";
@@ -736,6 +746,11 @@
 
     /**
      * Obtains an operand and reports an error if it's not there.
+     * @param optionName
+     * @param args
+     * @param i
+     * @return
+     * @throws com.sun.tools.internal.xjc.BadCommandLineException
      */
     public String requireArgument(String optionName, String[] args, int i) throws BadCommandLineException {
         if (i == args.length || args[i].startsWith("-")) {
@@ -773,34 +788,27 @@
         }
     }
 
-    /**
-     * Adds a new catalog file.
-     */
-    public void addCatalog(File catalogFile) throws IOException {
-        URI newUrl = catalogFile.toURI();
-        if (!catalogUrls.contains(newUrl)) {
-            catalogUrls.add(newUrl);
-        }
-        try {
-            entityResolver = CatalogManager.catalogResolver(catalogFeatures,
-                                catalogUrls.stream().toArray(URI[]::new));
-        } catch (Exception ex) {
-            entityResolver = null;
-        }
-    }
-
     // Since javax.xml.catalog is unmodifiable we need to track catalog
     // URLs added and create new catalog each time addCatalog is called
     private final ArrayList<URI> catalogUrls = new ArrayList<>();
 
-    // Cache CatalogFeatures instance for future usages.
-    // Resolve feature is set to "continue" value for backward compatibility.
-    private static CatalogFeatures catalogFeatures = CatalogFeatures.builder()
-                                                    .with(Feature.RESOLVE, "continue")
-                                                    .build();
+    /**
+     * Adds a new catalog file.Use created or existed resolver to parse new catalog file.
+     * @param catalogFile
+     * @throws java.io.IOException
+     */
+    public void addCatalog(File catalogFile) throws IOException {
+        URI newUri = catalogFile.toURI();
+        if (!catalogUrls.contains(newUri)) {
+            catalogUrls.add(newUri);
+        }
+        entityResolver = CatalogUtil.getCatalog(entityResolver, catalogFile, catalogUrls);
+    }
+
     /**
      * Parses arguments and fill fields of this object.
      *
+     * @param args
      * @exception BadCommandLineException
      *      thrown when there's a problem in the command-line arguments
      */
@@ -861,6 +869,8 @@
 
     /**
      * Finds the {@code META-INF/sun-jaxb.episode} file to add as a binding customization.
+     * @param jar
+     * @throws com.sun.tools.internal.xjc.BadCommandLineException
      */
     public void scanEpisodeFile(File jar) throws BadCommandLineException {
         try {
@@ -879,6 +889,7 @@
 
     /**
      * Guesses the schema language.
+     * @return
      */
     public Language guessSchemaLanguage() {
 
@@ -899,6 +910,8 @@
 
     /**
      * Creates a configured CodeWriter that produces files into the specified directory.
+     * @return
+     * @throws java.io.IOException
      */
     public CodeWriter createCodeWriter() throws IOException {
         return createCodeWriter(new FileCodeWriter( targetDir, readOnly, encoding ));
@@ -906,6 +919,8 @@
 
     /**
      * Creates a configured CodeWriter that produces files into the specified directory.
+     * @param core
+     * @return
      */
     public CodeWriter createCodeWriter( CodeWriter core ) {
         if(noFileHeader)
@@ -915,8 +930,8 @@
     }
 
     /**
-     * Gets the string suitable to be used as the prolog comment baked into artifacts.
-     * This is the string like "This file was generated by the JAXB RI on YYYY/mm/dd..."
+     * Gets the string suitable to be used as the prolog comment baked into artifacts.This is the string like "This file was generated by the JAXB RI on YYYY/mm/dd..."
+     * @return
      */
     public String getPrologComment() {
         // generate format syntax: <date> 'at' <time>
@@ -943,7 +958,7 @@
      * create one instance for each class name found inside this file.
      */
     private <T> List<T> findServices( Class<T> clazz) {
-        final List<T> result = new ArrayList<T>();
+        final List<T> result = new ArrayList<>();
         final boolean debug = getDebugPropertyValue();
         try {
             // TCCL allows user plugins to be loaded even if xjc is in jdk
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/SchemaCache.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/SchemaCache.java
index 1d334a0..fd97816 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/SchemaCache.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/SchemaCache.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,9 @@
                         schema = schemaFactory.newSchema(source);
 
                     } catch (IOException | SAXException e) {
-                        throw new InternalError(e);
+                        InternalError ie = new InternalError(e.getMessage());
+                        ie.initCause(e);
+                        throw ie;
                     } finally {
                         if (resourceResolver != null) resourceResolver.closeStreams();
                     }
@@ -221,5 +223,3 @@
     public void setCertifiedText(boolean certifiedText) {
     }
 }
-
-
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package-info.java
new file mode 100644
index 0000000..891578a
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * implementation of the XJC API for schema to java.
+ */
+package com.sun.tools.internal.xjc.api.impl.s2j;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html
deleted file mode 100644
index 6d643e0..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-implementation of the XJC API for schema to java.
-</body></html>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package-info.java
new file mode 100644
index 0000000..0ee6022
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package-info.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * API for programmatic invocation of XJC and schemagen.
+ *
+ * <p>
+ * This package provides a way to invoke XJC from within another program. The primary target of this API is the JAX-WS
+ * RI, but we hope that this API would be useful for other integration purposes as well.
+ *
+ * <h2>Getting Started: Using XJC</h2>
+ * <p>
+ * To invoke XJC, a typical client would do something like this:
+ * <pre>
+ *    SchemaCompiler sc = XJC.createSchemaCompiler();
+ *    sc.parseSchema(new InputSource(schema1Url.toExternalForm()));
+ *    sc.parseSchema(new InputSource(schema2Url.toExternalForm()));
+ *    ...
+ *    S2JModel model = sc.bind();
+ * </pre>
+ * <p>
+ * The bind operation causes XJC to do the bulk of the work, such as figuring out what classes to generate, what
+ * methods/fields to generate, etc. The obtained model contains useful introspective information about how the binding
+ * was performed (such as the mapping between XML types and generated Java classes)
+ *
+ * <p>
+ * Once the model is obtained, generate the code into the file system as follows:
+ * <pre>
+ *   JCodeModel cm = model.generateCode( null, ... );
+ *   cm.build(new FileCodeWriter(outputDir));
+ * </pre>
+ *
+ * <h2>Implementation Note</h2>
+ * <p>
+ * This package shouldn't contain any implementation code.
+ */
+package com.sun.tools.internal.xjc.api;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package.html
deleted file mode 100644
index 5ec97a8..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-API for programmatic invocation of XJC and schemagen.
-
-<p>
-This package provides a way to invoke XJC from within another program.
-The primary target of this API is the JAX-WS RI, but we hope that
-this API would be useful for other integration purposes as well.
-
-<h2>Getting Started: Using XJC</h2>
-<p>
-To invoke XJC, a typical client would do something like this:
-<pre>
-    SchemaCompiler sc = XJC.createSchemaCompiler();
-    sc.parseSchema(new InputSource(schema1Url.toExternalForm()));
-    sc.parseSchema(new InputSource(schema2Url.toExternalForm()));
-    ...
-    S2JModel model = sc.bind();
-</pre>
-<p>
-The bind operation causes XJC to do the bulk of the work, such as
-figuring out what classes to generate, what methods/fields to generate, etc.
-The obtained model contains useful introspective information about
-how the binding was performed (such as the mapping between XML types
-and generated Java classes)
-
-<p>
-Once the model is obtained, generate the code into the file system as follows:
-<pre>
-    JCodeModel cm = model.generateCode( null, ... );
-    cm.build(new FileCodeWriter(outputDir));
-</pre>
-
-
-<h2>Implementation Note</h2>
-<p>
-This package shouldn't contain any implementation code.
-</body></html> 
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package-info.java
new file mode 100644
index 0000000..28d16b9
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * FieldRenderer and its implementation classes.
+ * Unless you are deriving from these classes to define your own custom renderer,
+ * you shouldn't be using these classes directly. Use the outline package.
+ */
+package com.sun.tools.internal.xjc.generator.bean.field;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html
deleted file mode 100644
index 149a2f3..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<body><p>
-FieldRenderer and its implementation classes.
-Unless you are deriving from these classes to define your own custom renderer,
-you shouldn't be using these classes directly. Use the outline package.
-</p></body>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package-info.java
new file mode 100644
index 0000000..f40b82a
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package-info.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * <p>
+ * Compile-time representation of Java type system.
+ *
+ * <p>
+ * These classes are used as TypeT and ClassDeclT of the model parameterization. This implementaion is designed to be
+ * capable of representing pre-existing classes (such as java.lang.String) as well as the generated classes (represented
+ * as JDefinedClass.)
+ *
+ * <h2>Handling of Primitive Types</h2>
+ * <p>
+ * Primitive types have two forms (int and Integer), and this complicates the binding process. For this reason, inside
+ * the front end, we always use the boxed types. We'll use the unboxed form only in the back end when we know the field
+ * doesn't need to represent the null value.
+ */
+package com.sun.tools.internal.xjc.model.nav;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package.html
deleted file mode 100644
index 24ecf54..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-  <p>
-    Compile-time representation of Java type system.
-
-  <p>
-    These classes are used as TypeT and ClassDeclT of the model parameterization.
-    This implementaion is designed to be capable of representing pre-existing classes
-    (such as java.lang.String) as well as the generated classes (represented as JDefinedClass.)
-
-  <h2>Handling of Primitive Types</h2>
-  <p>
-    Primitive types have two forms (int and Integer), and this complicates the binding process.
-    For this reason, inside the front end, we always use the boxed types. We'll use the unboxed
-    form only in the back end when we know the field doesn't need to represent the null value.
-</body></html>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package-info.java
new file mode 100644
index 0000000..271f84c
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package-info.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides the outline of the generated Java source code so that
+ * additional processing (such as adding more annotations) can be
+ * done on the generated code.
+ *
+ * <p>
+ * Code generation phase builds an outline little by little, while each step is using the outline built by the prior
+ * steps.
+ */
+package com.sun.tools.internal.xjc.outline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package.html
deleted file mode 100644
index 371364c..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-  Provides the outline of the generated Java source code so that
-  additional processings (such as adding more annotations) can be
-  done on the generated code.
-
-  <p>
-  Code generation phase builds an outline little by little, while
-  each step is using the outline built by the prior steps.
-</body></html>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package-info.java
new file mode 100644
index 0000000..11e9f94
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Object Model that represents DTD binding information.
+ */
+package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html
deleted file mode 100644
index 87bbd14..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<body><p>Object Model that represents DTD binding information.</p></body>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package-info.java
new file mode 100644
index 0000000..1faa04c
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Binary expressions are left-associative. IOW, ((A,B),C) instead of (A,(B,C)).
+ */
+package com.sun.tools.internal.xjc.reader.gbind;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html
deleted file mode 100644
index 3646547..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-
-
-<body>
-    Binary expressions are left-associative. IOW, ((A,B),C) instead of (A,(B,C))
-</body>
-</html>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package-info.java
new file mode 100644
index 0000000..e32f91f
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * internalization of external binding files and &lt;jaxb:bindings&gt; customizations.
+ */
+package com.sun.tools.internal.xjc.reader.internalizer;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html
deleted file mode 100644
index e6f2aa1..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<body><p>internalization of external binding files and &lt;jaxb:bindings> customizations.</p></body>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package-info.java
new file mode 100644
index 0000000..d671985
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Front-end that reads schema(s) and produce BGM.
+ */
+package com.sun.tools.internal.xjc.reader;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package.html
deleted file mode 100644
index 7da5187..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<body><p>Front-end that reads schema(s) and produce BGM.</p></body>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java
index 0c313cb..898bfca 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Object Model that represents customization declarations.
+ * <a href="http://relaxngcc.sourceforge.net/">RelaxNGCC</a> is used to parse
+ * XML syntax into this representation, and the other parts of XJC will use
+ * this object model.
+ */
 @XmlSchema(elementFormDefault = QUALIFIED, namespace=Const.JAXB_NSURI)
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html
deleted file mode 100644
index e71625d..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<body>
-Object Model that represents customization declarations.
-
-<p>
-	<a href="http://relaxngcc.sourceforge.net/">RelaxNGCC</a> is used to parse
-	XML syntax into this representation, and the other parts of XJC will use
-	this object model.
-</p>
-</body>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package-info.java
new file mode 100644
index 0000000..5387ad0
--- /dev/null
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Code generated into the user's packages in certain compilation mode.
+ */
+package com.sun.tools.internal.xjc.runtime;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package.html
deleted file mode 100644
index 3e67519..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
- Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html><body>
-
-
-  Code generated into the user's packages in certain compilation mode.
-
-</body></html>
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java
index c4a9f35..e74b7e0 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,7 +70,7 @@
         this.substHead = _substHead;
         this.substDisallowed = _substDisallowed;
         this.substExcluded = _substExcluded;
-        this.idConstraints = Collections.unmodifiableList((List<? extends XSIdentityConstraint>)idConstraints);
+        this.idConstraints = (List<XSIdentityConstraint>) Collections.unmodifiableList((List<? extends XSIdentityConstraint>)idConstraints);
 
         for (IdentityConstraintImpl idc : idConstraints)
             idc.setParent(this);
@@ -80,42 +80,52 @@
     }
 
     private XmlString defaultValue;
+    @Override
     public XmlString getDefaultValue() { return defaultValue; }
 
     private XmlString fixedValue;
+    @Override
     public XmlString getFixedValue() { return fixedValue; }
 
     private boolean nillable;
+    @Override
     public boolean isNillable() { return nillable; }
 
     private boolean _abstract;
+    @Override
     public boolean isAbstract() { return _abstract; }
 
     private Ref.Type type;
+    @Override
     public XSType getType() { return type.getType(); }
 
     private Ref.Element substHead;
+    @Override
     public XSElementDecl getSubstAffiliation() {
         if(substHead==null)     return null;
         return substHead.get();
     }
 
     private int substDisallowed;
+    @Override
     public boolean isSubstitutionDisallowed( int method ) {
         return (substDisallowed&method)!=0;
     }
 
     private int substExcluded;
+    @Override
     public boolean isSubstitutionExcluded( int method ) {
         return (substExcluded&method)!=0;
     }
 
     private final List<XSIdentityConstraint> idConstraints;
+    @Override
     public List<XSIdentityConstraint> getIdentityConstraints() {
         return idConstraints;
     }
 
     private Boolean form;
+    @Override
     public Boolean getForm() {
         return form;
     }
@@ -124,6 +134,7 @@
     /**
      * @deprecated
      */
+    @Override
     public XSElementDecl[] listSubstitutables() {
         Set<? extends XSElementDecl> s = getSubstitutables();
         return s.toArray(new XSElementDecl[s.size()]);
@@ -135,6 +146,7 @@
     /** Unmodifieable view of {@link #substitutables}. */
     private Set<XSElementDecl> substitutablesView = null;
 
+    @Override
     public Set<? extends XSElementDecl> getSubstitutables() {
         if( substitutables==null ) {
             // if the field is null by the time this method
@@ -194,42 +206,57 @@
         }
     }
 
+    @Override
     public boolean canBeSubstitutedBy(XSElementDecl e) {
         return getSubstitutables().contains(e);
     }
 
+    @Override
     public boolean isWildcard()                 { return false; }
+    @Override
     public boolean isModelGroupDecl()           { return false; }
+    @Override
     public boolean isModelGroup()               { return false; }
+    @Override
     public boolean isElementDecl()              { return true; }
 
+    @Override
     public XSWildcard asWildcard()              { return null; }
+    @Override
     public XSModelGroupDecl asModelGroupDecl()  { return null; }
+    @Override
     public XSModelGroup asModelGroup()          { return null; }
+    @Override
     public XSElementDecl asElementDecl()        { return this; }
 
 
 
 
+    @Override
     public void visit( XSVisitor visitor ) {
         visitor.elementDecl(this);
     }
+    @Override
     public void visit( XSTermVisitor visitor ) {
         visitor.elementDecl(this);
     }
+    @Override
     public Object apply( XSTermFunction function ) {
         return function.elementDecl(this);
     }
 
+    @Override
     public <T,P> T apply(XSTermFunctionWithParam<T, P> function, P param) {
         return function.elementDecl(this,param);
     }
 
+    @Override
     public Object apply( XSFunction function ) {
         return function.elementDecl(this);
     }
 
 
     // Ref.Term implementation
+    @Override
     public XSTerm getTerm() { return this; }
 }
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java
index 2a4c694..4ca87b2 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,17 +59,19 @@
         this.name = name;
         this.selector = selector;
         selector.setParent(this);
-        this.fields = Collections.unmodifiableList((List<? extends XSXPath>)fields);
+        this.fields = (List<XSXPath>) Collections.unmodifiableList((List<? extends XSXPath>)fields);
         for( XPathImpl xp : fields )
             xp.setParent(this);
         this.refer = refer;
     }
 
 
+    @Override
     public void visit(XSVisitor visitor) {
         visitor.identityConstraint(this);
     }
 
+    @Override
     public <T> T apply(XSFunction<T> function) {
         return function.identityConstraint(this);
     }
@@ -79,30 +81,37 @@
         parent.getOwnerSchema().addIdentityConstraint(this);
     }
 
+    @Override
     public XSElementDecl getParent() {
         return parent;
     }
 
+    @Override
     public String getName() {
         return name;
     }
 
+    @Override
     public String getTargetNamespace() {
         return getParent().getTargetNamespace();
     }
 
+    @Override
     public short getCategory() {
         return category;
     }
 
+    @Override
     public XSXPath getSelector() {
         return selector;
     }
 
+    @Override
     public List<XSXPath> getFields() {
         return fields;
     }
 
+    @Override
     public XSIdentityConstraint getReferencedKey() {
         if(category==KEYREF)
             return refer.get();
@@ -110,6 +119,7 @@
             throw new IllegalStateException("not a keyref");
     }
 
+    @Override
     public XSIdentityConstraint get() {
         return this;
     }
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java
index 4e600c3..297ff88 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@
 import com.sun.xml.internal.xsom.impl.Const;
 import com.sun.xml.internal.xsom.impl.parser.state.NGCCRuntime;
 import com.sun.xml.internal.xsom.impl.parser.state.Schema;
-import com.sun.xml.internal.xsom.impl.util.Uri;
 import com.sun.xml.internal.xsom.parser.AnnotationParser;
 import com.sun.xml.internal.org.relaxng.datatype.ValidationContext;
 import org.xml.sax.Attributes;
@@ -48,8 +47,10 @@
 
 import java.io.IOException;
 import java.net.URI;
+import java.net.URL;
 import java.text.MessageFormat;
 import java.util.Stack;
+import java.util.regex.Pattern;
 
 /**
  * NGCCRuntime extended with various utility methods for
@@ -150,12 +151,15 @@
 
 
     /* registers a patcher that will run after all the parsing has finished. */
+    @Override
     public void addPatcher( Patch patcher ) {
         parser.patcherManager.addPatcher(patcher);
     }
+    @Override
     public void addErrorChecker( Patch patcher ) {
         parser.patcherManager.addErrorChecker(patcher);
     }
+    @Override
     public void reportError( String msg, Locator loc ) throws SAXException {
         parser.patcherManager.reportError(msg,loc);
     }
@@ -188,8 +192,15 @@
             EntityResolver er = parser.getEntityResolver();
             String systemId = null;
 
-            if (relativeUri!=null)
-                systemId = Uri.resolve(baseUri,relativeUri);
+            if (relativeUri!=null) {
+                if (isAbsolute(relativeUri)) {
+                    systemId = relativeUri;
+                }
+                if (baseUri == null || !isAbsolute(baseUri)) {
+                    throw new IOException("Unable to resolve relative URI " + relativeUri + " because base URI is not absolute: " + baseUri);
+                }
+                systemId = new URL(new URL(baseUri), relativeUri).toString();
+            }
 
             if (er!=null) {
                 InputSource is = er.resolveEntity(namespaceURI,systemId);
@@ -217,7 +228,21 @@
         }
     }
 
-    /** Includes the specified schema. */
+    private static final Pattern P = Pattern.compile(".*[/#?].*");
+
+    private static boolean isAbsolute(String uri) {
+        int i = uri.indexOf(':');
+        if (i < 0) {
+            return false;
+        }
+        return !P.matcher(uri.substring(0, i)).matches();
+    }
+
+    /**
+     * Includes the specified schema.
+     *
+     * @param schemaLocation
+     * @throws org.xml.sax.SAXException */
     public void includeSchema( String schemaLocation ) throws SAXException {
         NGCCRuntimeEx runtime = new NGCCRuntimeEx(parser,chameleonMode,this);
         runtime.currentSchema = this.currentSchema;
@@ -235,7 +260,12 @@
             true, currentSchema.getTargetNamespace(), getLocator() );
     }
 
-    /** Imports the specified schema. */
+    /**
+     * Imports the specified schema.
+     *
+     * @param ns
+     * @param schemaLocation
+     * @throws org.xml.sax.SAXException */
     public void importSchema( String ns, String schemaLocation ) throws SAXException {
         NGCCRuntimeEx newRuntime = new NGCCRuntimeEx(parser,false,this);
         InputSource source = resolveRelativeURL(ns,schemaLocation);
@@ -317,9 +347,13 @@
     /**
      * Parses the specified entity.
      *
+     * @param source
      * @param importLocation
      *      The source location of the import/include statement.
      *      Used for reporting errors.
+     * @param includeMode
+     * @param expectedNamespace
+     * @throws org.xml.sax.SAXException
      */
     public void parseEntity( InputSource source, boolean includeMode, String expectedNamespace, Locator importLocation )
             throws SAXException {
@@ -342,6 +376,8 @@
 
     /**
      * Creates a new instance of annotation parser.
+     *
+     * @return Annotation parser
      */
     public AnnotationParser createAnnotationParser() {
         if(parser.getAnnotationParserFactory()==null)
@@ -351,14 +387,19 @@
     }
 
     /**
-     * Gets the element name that contains the annotation element.
-     * This method works correctly only when called by the annotation handler.
+     * Gets the element name that contains the annotation element.This method works correctly only when called by the annotation handler.
+     *
+     * @return Element name
      */
     public String getAnnotationContextElementName() {
         return elementNames.get( elementNames.size()-2 );
     }
 
-    /** Creates a copy of the current locator object. */
+    /**
+     * Creates a copy of the current locator object.
+     *
+     * @return Locator copy
+     */
     public Locator copyLocator() {
         return new LocatorImpl(getLocator());
     }
@@ -397,6 +438,7 @@
             this.uri = _uri;
         }
 
+        @Override
         public String resolveNamespacePrefix(String p) {
             if(p.equals(prefix))    return uri;
             if(previous==null)      return null;
@@ -408,14 +450,20 @@
         private final Context previous;
 
         // XSDLib don't use those methods, so we cut a corner here.
+        @Override
         public String getBaseUri() { return null; }
+        @Override
         public boolean isNotation(String arg0) { return false; }
+        @Override
         public boolean isUnparsedEntity(String arg0) { return false; }
     }
 
     private Context currentContext=null;
 
-    /** Returns an immutable snapshot of the current context. */
+    /** Returns an immutable snapshot of the current context.
+     *
+     * @return Snapshot of current context
+     */
     public ValidationContext createValidationContext() {
         return currentContext;
     }
@@ -446,6 +494,7 @@
      * Parses UName under the given context.
      * @param qname Attribute name.
      * @return New {@link UName} instance based on attribute name.
+     * @throws org.xml.sax.SAXException
      */
     public UName parseUName(final String qname ) throws SAXException {
         int idx = qname.indexOf(':');
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java
deleted file mode 100644
index d6cddc7..0000000
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
-Copyright (c) 2001, 2002 Thai Open Source Software Center Ltd
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-    Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-
-    Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution.
-
-    Neither the name of the Thai Open Source Software Center Ltd nor
-    the names of its contributors may be used to endorse or promote
-    products derived from this software without specific prior written
-    permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-// @@3RD PARTY CODE@@
-
-package com.sun.xml.internal.xsom.impl.util;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-
-public class Uri {
-  private static String utf8 = "UTF-8";
-
-  public static boolean isValid(String s) {
-    return isValidPercent(s) && isValidFragment(s) && isValidScheme(s);
-  }
-
-  private static final String HEX_DIGITS = "0123456789abcdef";
-
-  public static String escapeDisallowedChars(String s) {
-    StringBuffer buf = null;
-    int len = s.length();
-    int done = 0;
-    for (;;) {
-      int i = done;
-      for (;;) {
-        if (i == len) {
-          if (done == 0)
-            return s;
-          break;
-        }
-        if (isExcluded(s.charAt(i)))
-          break;
-        i++;
-      }
-      if (buf == null)
-        buf = new StringBuffer();
-      if (i > done) {
-        buf.append(s.substring(done, i));
-        done = i;
-      }
-      if (i == len)
-        break;
-      for (i++; i < len && isExcluded(s.charAt(i)); i++)
-        ;
-      String tem = s.substring(done, i);
-      byte[] bytes;
-      try {
-        bytes = tem.getBytes(utf8);
-      }
-      catch (UnsupportedEncodingException e) {
-        utf8 = "UTF8";
-        try {
-          bytes = tem.getBytes(utf8);
-        }
-        catch (UnsupportedEncodingException e2) {
-          // Give up
-          return s;
-        }
-      }
-      for (int j = 0; j < bytes.length; j++) {
-        buf.append('%');
-        buf.append(HEX_DIGITS.charAt((bytes[j] & 0xFF) >> 4));
-        buf.append(HEX_DIGITS.charAt(bytes[j] & 0xF));
-      }
-      done = i;
-    }
-    return buf.toString();
-  }
-
-  private static String excluded = "<>\"{}|\\^`";
-
-  private static boolean isExcluded(char c) {
-    return c <= 0x20 || c >= 0x7F || excluded.indexOf(c) >= 0;
-  }
-
-  private static boolean isAlpha(char c) {
-    return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
-  }
-
-  private static boolean isHexDigit(char c) {
-    return ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F') || isDigit(c);
-  }
-
-  private static boolean isDigit(char c) {
-    return '0' <= c && c <= '9';
-  }
-
-  private static boolean isSchemeChar(char c) {
-    return isAlpha(c) || isDigit(c) || c == '+' || c == '-' || c =='.';
-  }
-
-  private static boolean isValidPercent(String s) {
-    int len = s.length();
-    for (int i = 0; i < len; i++)
-      if (s.charAt(i) == '%') {
-        if (i + 2 >= len)
-          return false;
-        else if (!isHexDigit(s.charAt(i + 1))
-             || !isHexDigit(s.charAt(i + 2)))
-          return false;
-      }
-    return true;
-  }
-
-  private static boolean isValidFragment(String s) {
-    int i = s.indexOf('#');
-    return i < 0 || s.indexOf('#', i + 1) < 0;
-  }
-
-  private static boolean isValidScheme(String s) {
-    if (!isAbsolute(s))
-      return true;
-    int i = s.indexOf(':');
-    if (i == 0
-    || i + 1 == s.length()
-    || !isAlpha(s.charAt(0)))
-      return false;
-    while (--i > 0)
-      if (!isSchemeChar(s.charAt(i)))
-    return false;
-    return true;
-  }
-
-    public static String resolve(String baseUri, String uriReference) throws IOException {
-        if (isAbsolute(uriReference))
-            return uriReference;
-
-        if(baseUri==null)
-            throw new IOException("Unable to resolve relative URI "+uriReference+" without a base URI");
-
-        if(!isAbsolute(baseUri))
-            throw new IOException("Unable to resolve relative URI "+uriReference+" because base URI is not absolute: "+baseUri);
-
-        return new URL(new URL(baseUri), uriReference).toString();
-    }
-
-    public static boolean hasFragmentId(String uri) {
-    return uri.indexOf('#') >= 0;
-  }
-
-  public static boolean isAbsolute(String uri) {
-    int i = uri.indexOf(':');
-    if (i < 0)
-      return false;
-    while (--i >= 0) {
-      switch (uri.charAt(i)) {
-      case '#':
-      case '/':
-      case '?':
-    return false;
-      }
-    }
-    return true;
-  }
-}
diff --git a/jaxws/src/jdk.xml.bind/share/legal/relaxngdatatype.md b/jaxws/src/jdk.xml.bind/share/legal/relaxngdatatype.md
index 54343b7..2555613 100644
--- a/jaxws/src/jdk.xml.bind/share/legal/relaxngdatatype.md
+++ b/jaxws/src/jdk.xml.bind/share/legal/relaxngdatatype.md
@@ -3,7 +3,7 @@
 ### RelaxNG Datatype License
 <pre>
 
-Copyright (c) 2001, Thai Open Source Software Center Ltd, Sun Microsystems.
+Copyright (c) 2005, 2010 Thai Open Source Software Center Ltd
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff --git a/jaxws/src/jdk.xml.bind/share/legal/xmlresolver.md b/jaxws/src/jdk.xml.bind/share/legal/xmlresolver.md
index cf18bb4..696f8d3 100644
--- a/jaxws/src/jdk.xml.bind/share/legal/xmlresolver.md
+++ b/jaxws/src/jdk.xml.bind/share/legal/xmlresolver.md
@@ -1,6 +1,6 @@
 ## Apache XML Resolver Library v1.2
 
-### Notice
+### Apache XML Resolver Notice
 <pre>
 
 Apache XML Commons Resolver
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocal.properties b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocal.properties
new file mode 100644
index 0000000..d799568
--- /dev/null
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocal.properties
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocalMessages.java b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocalMessages.java
new file mode 100644
index 0000000..24584fa
--- /dev/null
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocalMessages.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.internal.ws.resources;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+import com.sun.istack.internal.localization.Localizable;
+import com.sun.istack.internal.localization.LocalizableMessageFactory;
+import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier;
+import com.sun.istack.internal.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class ContextClassloaderLocalMessages {
+
+    private final static String BUNDLE_NAME = "com.sun.tools.internal.ws.resources.ContextClassloaderLocal";
+    private final static LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new ContextClassloaderLocalMessages.BundleSupplier());
+    private final static Localizer LOCALIZER = new Localizer();
+
+    public static Localizable localizableFAILED_TO_CREATE_NEW_INSTANCE(Object arg0) {
+        return MESSAGE_FACTORY.getMessage("FAILED_TO_CREATE_NEW_INSTANCE", arg0);
+    }
+
+    /**
+     * Failed to create new instance of {0}
+     *
+     */
+    public static String FAILED_TO_CREATE_NEW_INSTANCE(Object arg0) {
+        return LOCALIZER.localize(localizableFAILED_TO_CREATE_NEW_INSTANCE(arg0));
+    }
+
+    private static class BundleSupplier
+        implements ResourceBundleSupplier
+    {
+
+
+        public ResourceBundle getResourceBundle(Locale locale) {
+            return ResourceBundle.getBundle(BUNDLE_NAME, locale);
+        }
+
+    }
+
+}
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
index eedc7c2..82452ac 100644
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,4 +26,4 @@
 build-id=2.3.0-SNAPSHOT
 build-version=JAX-WS RI 2.3.0-SNAPSHOT
 major-version=2.3.0
-svn-revision=5c2c1fd2f2ab3b5c7cea25f79aa49e54cb84b7cc
+svn-revision=e8c5e9697d9b27d83ff35d767939b2f55e667621
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java
index 4f29dc6..e730c8e 100644
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -144,12 +144,9 @@
     public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException {
         final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener);
 
-        List<String> args = new ArrayList<String>(6 + (options.nocompile ? 1 : 0)
+        List<String> args = new ArrayList<>(6 + (options.nocompile ? 1 : 0)
                 + (options.encoding != null ? 2 : 0));
 
-        args.add("--add-modules");
-        args.add("java.xml.ws");
-
         args.add("-d");
         args.add(options.destDir.getAbsolutePath());
         args.add("-classpath");
@@ -163,8 +160,27 @@
             args.add("-encoding");
             args.add(options.encoding);
         }
+
+        boolean addModules = true;
         if (options.javacOptions != null) {
-            args.addAll(options.getJavacOptions(args, listener));
+            List<String> javacOptions = options.getJavacOptions(args, listener);
+            for (int i = 0; i < javacOptions.size(); i++) {
+                String opt = javacOptions.get(i);
+                if ("-source".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
+                    addModules = false;
+                }
+                if ("-target".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
+                    addModules = false;
+                }
+                if ("--release".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
+                    addModules = false;
+                }
+                args.add(opt);
+            }
+        }
+        if (addModules) {
+            args.add("--add-modules");
+            args.add("java.xml.ws");
         }
 
         JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
@@ -227,7 +243,7 @@
             com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl) fac.createRuntime(config);
 
             final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file.
-            final Map<String, File> schemaFiles = new HashMap<String, File>();
+            final Map<String, File> schemaFiles = new HashMap<>();
 
             WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
             wsdlGenInfo.setSecureXmlProcessingDisabled(disableXmlSecurity);
@@ -299,7 +315,7 @@
     }
 
     private List<File> getExternalFiles(List<String> exts) {
-        List<File> files = new ArrayList<File>();
+        List<File> files = new ArrayList<>();
         for (String ext : exts) {
             // first try absolute path ...
             File file = new File(ext);
@@ -341,6 +357,10 @@
         }
     }
 
+    private float getVersion(String s) {
+        return Float.parseFloat(s);
+    }
+
     /**
      * "Namespace" for code needed to generate the report file.
      */
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java
index 3768118f..33664a0 100644
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -246,7 +246,7 @@
     }
 
     private void deleteGeneratedFiles() {
-        Set<File> trackedRootPackages = new HashSet<File>();
+        Set<File> trackedRootPackages = new HashSet<>();
 
         if (options.clientjar != null) {
             //remove all non-java artifacts as they will packaged in jar.
@@ -282,7 +282,7 @@
 
     private void addClassesToGeneratedFiles() throws IOException {
         Iterable<File> generatedFiles = options.getGeneratedFiles();
-        final List<File> trackedClassFiles = new ArrayList<File>();
+        final List<File> trackedClassFiles = new ArrayList<>();
         for(File f: generatedFiles) {
             if(f.getName().endsWith(".java")) {
                 String relativeDir = DirectoryUtil.getRelativePathfromCommonBase(f.getParentFile(),options.sourceDir);
@@ -504,7 +504,7 @@
     }
 
     protected boolean compileGeneratedClasses(ErrorReceiver receiver, WsimportListener listener){
-        List<String> sourceFiles = new ArrayList<String>();
+        List<String> sourceFiles = new ArrayList<>();
 
         for (File f : options.getGeneratedFiles()) {
             if (f.exists() && f.getName().endsWith(".java")) {
@@ -515,10 +515,7 @@
         if (sourceFiles.size() > 0) {
             String classDir = options.destDir.getAbsolutePath();
             String classpathString = createClasspathString();
-            List<String> args = new ArrayList<String>();
-
-            args.add("--add-modules");
-            args.add("java.xml.ws");
+            List<String> args = new ArrayList<>();
 
             args.add("-d");
             args.add(classDir);
@@ -534,8 +531,26 @@
                 args.add(options.encoding);
             }
 
+            boolean addModules = true;
             if (options.javacOptions != null) {
-                args.addAll(options.getJavacOptions(args, listener));
+                List<String> javacOptions = options.getJavacOptions(args, listener);
+                for (int i = 0; i < javacOptions.size(); i++) {
+                    String opt = javacOptions.get(i);
+                    if ("-source".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
+                        addModules = false;
+                    }
+                    if ("-target".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
+                        addModules = false;
+                    }
+                    if ("--release".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
+                        addModules = false;
+                    }
+                    args.add(opt);
+                }
+            }
+            if (addModules) {
+                args.add("--add-modules");
+                args.add("java.xml.ws");
             }
 
             for (int i = 0; i < sourceFiles.size(); ++i) {
@@ -572,4 +587,8 @@
         System.out.println(WscompileMessages.WSIMPORT_USAGE_EXTENSIONS());
         System.out.println(WscompileMessages.WSIMPORT_USAGE_EXAMPLES());
     }
+
+    private float getVersion(String s) {
+        return Float.parseFloat(s);
+    }
 }
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java
index c8c8479..e15ab93 100644
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 
 package com.sun.tools.internal.ws.wsdl.parser;
 
+import com.sun.tools.internal.ws.resources.ContextClassloaderLocalMessages;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
 import java.util.WeakHashMap;
 
 /**
@@ -36,9 +36,7 @@
  */
 abstract class ContextClassloaderLocal<V> {
 
-    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
-
-    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<ClassLoader, V>();
+    private WeakHashMap<ClassLoader, V> CACHE = new WeakHashMap<>();
 
     public V get() throws Error {
         ClassLoader tccl = getContextClassLoader();
@@ -60,26 +58,21 @@
         try {
             return initialValue();
         } catch (Exception e) {
-            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
+            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
         }
     }
 
-    private static String format(String property, Object... args) {
-        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
-        return MessageFormat.format(text, args);
-    }
-
     private static ClassLoader getContextClassLoader() {
-        return (ClassLoader)
-                AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        ClassLoader cl = null;
-                        try {
-                            cl = Thread.currentThread().getContextClassLoader();
-                        } catch (SecurityException ex) {
-                        }
-                        return cl;
-                    }
-                });
+        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+            @Override
+            public ClassLoader run() {
+                ClassLoader cl = null;
+                try {
+                    cl = Thread.currentThread().getContextClassLoader();
+                } catch (SecurityException ex) {
+                }
+                return cl;
+            }
+        });
     }
 }
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties
deleted file mode 100644
index c0267b8..0000000
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 5a7c6ba..97cfd83 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -398,3 +398,13 @@
 1c4411322327aea3f91011ec3977a12a05b09629 jdk-9+153
 c97e7a8b8da062b9070df442f9cf308e10845fb7 jdk-9+154
 e170c858888e83d5c0994504599b6ed7a1fb0cfc jdk-9+155
+7d64e541a6c04c714bcad4c8b553db912f827cd5 jdk-9+156
+fdfa7b2fe9a7db06792eae20f97748f3e85bb83a jdk-9+157
+c476ca73750698fa5654e101af699ee45db38e2a jdk-9+158
+49b54a4d9e84b7ba956b8c27fced5035465146ae jdk-9+159
+cac788454598b95d8b0153c021a7fae3cd7e6fda jdk-9+160
+09b92d3067a38ee07bc14efa336b14790c93f7e7 jdk-9+161
+f6bf027e88e9a4dd19f721001a7af00157af42c4 jdk-9+162
+50171f8c47961710cbf87aead6f03fa431d8d240 jdk-9+163
+6dea581453d7c0e767e3169cfec8b423a381e71d jdk-9+164
+a7942c3b1e59495dbf51dc7c41aab355fcd253d7 jdk-9+165
diff --git a/jdk/README b/jdk/README
deleted file mode 100644
index 9817e93..0000000
--- a/jdk/README
+++ /dev/null
@@ -1,27 +0,0 @@
-README:
-  This file should be located at the top of the jdk Mercurial repository.
-
-  See http://openjdk.java.net/ for more information about the OpenJDK.
-
-Simple Build Instructions:
-
-  1. Download and install a JDK 6 from
-     http://java.sun.com/javase/downloads/index.jsp
-     Set the environment variable ALT_BOOTDIR to the location of this JDK 6.
-
-  2. Either download and install the latest JDK7 from
-     http://download.java.net/openjdk/jdk7/, or build your own complete
-     OpenJDK7 by using the top level Makefile in the OpenJDK Mercurial forest.
-     Set the environment variable ALT_JDK_IMPORT_PATH to the location of
-     this latest JDK7 or OpenJDK7 build.
-     
-  3. Check the sanity of doing a build with the current machine:
-       cd make && gnumake sanity
-     See README-builds.html if you run into problems.
-  
-  4. Do a partial build of the jdk:
-       cd make && gnumake all
-  
-  5. Construct the images:
-       cd make && gnumake images
-     The resulting JDK image should be found in build/*/j2sdk-image
diff --git a/jdk/make/CompileModuleTools.gmk b/jdk/make/CompileModuleTools.gmk
index 2bfe520..4a9fcdc 100644
--- a/jdk/make/CompileModuleTools.gmk
+++ b/jdk/make/CompileModuleTools.gmk
@@ -37,5 +37,7 @@
                 build/tools/jigsaw, \
     BIN := $(TOOLS_CLASSES_DIR), \
     ADD_JAVAC_FLAGS := \
+        --add-modules jdk.jdeps \
         --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
+        --add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED \
 ))
diff --git a/jdk/make/GenerateModuleSummary.gmk b/jdk/make/GenerateModuleSummary.gmk
index 38d9985..b96e9de 100644
--- a/jdk/make/GenerateModuleSummary.gmk
+++ b/jdk/make/GenerateModuleSummary.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -31,11 +31,16 @@
 include ModuleTools.gmk
 
 GENGRAPHS_DIR := $(IMAGES_OUTPUTDIR)/gengraphs
+SPEC_DOTFILES_DIR := $(GENGRAPHS_DIR)/spec-dotfiles
 TOOLS_MODULE_SRCDIR := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw
 
 $(GENGRAPHS_DIR)/jdk.dot: $(BUILD_JIGSAW_TOOLS)
 	$(MKDIR) -p $(@D)
-	$(TOOL_GENGRAPHS) $(GENGRAPHS_DIR)
+	$(TOOL_GENGRAPHS) --output $(GENGRAPHS_DIR)
+
+$(SPEC_DOTFILES_DIR)/java.se.dot: $(BUILD_JIGSAW_TOOLS)
+	$(MKDIR) -p $(@D)
+	$(TOOL_GENGRAPHS) --spec --output $(SPEC_DOTFILES_DIR)
 
 $(GENGRAPHS_DIR)/technology-summary.html: $(TOOLS_MODULE_SRCDIR)/technology-summary.html
 	$(install-file)
@@ -44,4 +49,4 @@
 	$(MKDIR) -p $(@D)
 	$(TOOL_MODULESUMMARY) -o $@ --module-path $(IMAGES_OUTPUTDIR)/jmods
 
-all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html
+all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html $(SPEC_DOTFILES_DIR)/java.se.dot
diff --git a/jdk/make/ModuleTools.gmk b/jdk/make/ModuleTools.gmk
index 71ca1cf..c48a1b6 100644
--- a/jdk/make/ModuleTools.gmk
+++ b/jdk/make/ModuleTools.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,9 @@
 # questions.
 #
 
-include $(SPEC)
-include MakeBase.gmk
+ifndef _MODULE_TOOLS_GMK
+_MODULE_TOOLS_GMK := 1
+
 include JavaCompilation.gmk
 
 TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
@@ -32,10 +33,12 @@
 # To avoid reevaluating the compilation setup for the tools each time this file
 # is included, the actual compilation is handled by CompileModuleTools.gmk. The
 # following trick is used to be able to declare a dependency on the built tools.
-BUILD_TOOLS_JDK := $(call SetupJavaCompilationCompileTarget, \
+BUILD_JIGSAW_TOOLS := $(call SetupJavaCompilationCompileTarget, \
     BUILD_JIGSAW_TOOLS, $(TOOLS_CLASSES_DIR))
 
 TOOL_GENGRAPHS := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
+    --add-modules jdk.jdeps \
+    --add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED \
     build.tools.jigsaw.GenGraphs
 
 TOOL_MODULESUMMARY := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
@@ -45,3 +48,5 @@
     -cp $(TOOLS_CLASSES_DIR) \
     --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
     build.tools.jigsaw.AddPackagesAttribute
+
+endif # _MODULE_TOOLS_GMK
diff --git a/jdk/make/copy/Copy-java.base.gmk b/jdk/make/copy/Copy-java.base.gmk
index 2f26a83..0176490 100644
--- a/jdk/make/copy/Copy-java.base.gmk
+++ b/jdk/make/copy/Copy-java.base.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -235,8 +235,10 @@
 
 # JDK license and assembly exception files to be packaged in JMOD
 
-JDK_LICENSE ?= $(JDK_TOPDIR)/LICENSE
-JDK_NOTICE  ?= $(JDK_TOPDIR)/ASSEMBLY_EXCEPTION
+# The license files may not be present if the source has been obtained using a
+# different license.
+JDK_LICENSE ?= $(wildcard $(TOPDIR)/LICENSE)
+JDK_NOTICE  ?= $(wildcard $(TOPDIR)/ASSEMBLY_EXCEPTION)
 
 $(eval $(call SetupCopyFiles, COPY_JDK_NOTICES, \
     FILES := $(JDK_LICENSE) $(JDK_NOTICE), \
@@ -245,4 +247,3 @@
 ))
 
 TARGETS += $(COPY_JDK_NOTICES)
-
diff --git a/jdk/make/data/charsetmapping/stdcs-linux b/jdk/make/data/charsetmapping/stdcs-linux
index 3bb0887..0a870b7 100644
--- a/jdk/make/data/charsetmapping/stdcs-linux
+++ b/jdk/make/data/charsetmapping/stdcs-linux
@@ -24,3 +24,5 @@
 JIS_X_0212
 JIS_X_0208_Solaris
 JIS_X_0212_Solaris
+MS932
+SJIS       # SJIS must go together with MS932 to support sun.nio.cs.map
diff --git a/jdk/make/data/tzdata/VERSION b/jdk/make/data/tzdata/VERSION
index 016d94c..eb5b459 100644
--- a/jdk/make/data/tzdata/VERSION
+++ b/jdk/make/data/tzdata/VERSION
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2016j
+tzdata2017b
diff --git a/jdk/make/data/tzdata/africa b/jdk/make/data/tzdata/africa
index 67918af..d3de96d 100644
--- a/jdk/make/data/tzdata/africa
+++ b/jdk/make/data/tzdata/africa
@@ -29,15 +29,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2017-02-20):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -54,39 +54,33 @@
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
 #
+# European-style abbreviations are commonly used along the Mediterranean.
+# For sub-Saharan Africa abbreviations were less standardized.
 # Previous editions of this database used WAT, CAT, SAT, and EAT
-# for +0:00 through +3:00, respectively,
-# but Mark R V Murray reports that
-# 'SAST' is the official abbreviation for +2:00 in the country of South Africa,
-# 'CAT' is commonly used for +2:00 in countries north of South Africa, and
-# 'WAT' is probably the best name for +1:00, as the common phrase for
+# for UT +00 through +03, respectively,
+# but in 1997 Mark R V Murray reported that
+# 'SAST' is the official abbreviation for +02 in the country of South Africa,
+# 'CAT' is commonly used for +02 in countries north of South Africa, and
+# 'WAT' is probably the best name for +01, as the common phrase for
 # the area that includes Nigeria is "West Africa".
-# He has heard of "Western Sahara Time" for +0:00 but can find no reference.
 #
-# To make things confusing, 'WAT' seems to have been used for -1:00 long ago;
-# I'd guess that this was because people needed _some_ name for -1:00,
-# and at the time, far west Africa was the only major land area in -1:00.
-# This usage is now obsolete, as the last use of -1:00 on the African
-# mainland seems to have been 1976 in Western Sahara.
-#
-# To summarize, the following abbreviations seem to have some currency:
-#	-1:00	WAT	West Africa Time (no longer used)
-#	 0:00	GMT	Greenwich Mean Time
-#	 2:00	CAT	Central Africa Time
-#	 2:00	SAST	South Africa Standard Time
-# and Murray suggests the following abbreviation:
-#	 1:00	WAT	West Africa Time
-# I realize that this leads to 'WAT' being used for both -1:00 and 1:00
-# for times before 1976, but this is the best I can think of
-# until we get more information.
+# To summarize, the following abbreviations seemed to have some currency:
+#	 +00	GMT	Greenwich Mean Time
+#	 +02	CAT	Central Africa Time
+#	 +02	SAST	South Africa Standard Time
+# and Murray suggested the following abbreviation:
+#	 +01	WAT	West Africa Time
+# Murray's suggestion seems to have caught on in news reports and the like.
+# I vaguely recall 'WAT' also being used for -01 in the past but
+# cannot now come up with solid citations.
 #
 # I invented the following abbreviations; corrections are welcome!
-#	 2:00	WAST	West Africa Summer Time
-#	 2:30	BEAT	British East Africa Time (no longer used)
-#	 2:45	BEAUT	British East Africa Unified Time (no longer used)
-#	 3:00	CAST	Central Africa Summer Time (no longer used)
-#	 3:00	SAST	South Africa Summer Time (no longer used)
-#	 3:00	EAT	East Africa Time
+#	 +02	WAST	West Africa Summer Time
+#	 +03	CAST	Central Africa Summer Time (no longer used)
+#	 +03	SAST	South Africa Summer Time (no longer used)
+#	 +03	EAT	East Africa Time
+# 'EAT' also seems to have caught on; the others are rare but are paired
+# with better-attested non-DST abbreviations.
 
 # Algeria
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -144,17 +138,17 @@
 
 # Cape Verde / Cabo Verde
 #
-# Shanks gives 1907 for the transition to CVT.
+# Shanks gives 1907 for the transition to +02.
 # Perhaps the 1911-05-26 Portuguese decree
-# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
+# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
 # merely made it official?
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Atlantic/Cape_Verde -1:34:04 -	LMT	1907        # Praia
-			-2:00	-	CVT	1942 Sep
-			-2:00	1:00	CVST	1945 Oct 15
-			-2:00	-	CVT	1975 Nov 25  2:00
-			-1:00	-	CVT
+			-2:00	-	-02	1942 Sep
+			-2:00	1:00	-01	1945 Oct 15
+			-2:00	-	-02	1975 Nov 25  2:00
+			-1:00	-	-01
 
 # Central African Republic
 # See Africa/Lagos.
@@ -411,7 +405,7 @@
 Rule	Ghana	1920	1942	-	Dec	31	0:00	0	GMT
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Accra	-0:00:52 -	LMT	1918
-			 0:00	Ghana	%s
+			 0:00	Ghana	GMT/+0020
 
 # Guinea
 # See Africa/Abidjan.
@@ -420,20 +414,20 @@
 #
 # Shanks gives 1911-05-26 for the transition to WAT,
 # evidently confusing the date of the Portuguese decree
-# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
+# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
 # with the date that it took effect, namely 1912-01-01.
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Bissau	-1:02:20 -	LMT	1912 Jan  1
-			-1:00	-	WAT	1975
+			-1:00	-	-01	1975
 			 0:00	-	GMT
 
 # Kenya
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Nairobi	2:27:16	-	LMT	1928 Jul
 			3:00	-	EAT	1930
-			2:30	-	BEAT	1940
-			2:45	-	BEAUT	1960
+			2:30	-	+0230	1940
+			2:45	-	+0245	1960
 			3:00	-	EAT
 Link Africa/Nairobi Africa/Addis_Ababa	 # Ethiopia
 Link Africa/Nairobi Africa/Asmara	 # Eritrea
@@ -449,18 +443,25 @@
 # See Africa/Johannesburg.
 
 # Liberia
-# From Paul Eggert (2006-03-22):
-# In 1972 Liberia was the last country to switch
-# from a UTC offset that was not a multiple of 15 or 20 minutes.
-# Howse reports that it was in honor of their president's birthday.
-# Shank & Pottenger report the date as May 1, whereas Howse reports Jan;
-# go with Shanks & Pottenger.
-# For Liberia before 1972, Shanks & Pottenger report -0:44, whereas Howse and
-# Whitman each report -0:44:30; go with the more precise figure.
+#
+# From Paul Eggert (2017-03-02):
+#
+# The Nautical Almanac for the Year 1970, p 264, is the source for -0:44:30.
+#
+# In 1972 Liberia was the last country to switch from a UTC offset
+# that was not a multiple of 15 or 20 minutes.  The 1972 change was on
+# 1972-01-07, according to an entry dated 1972-01-04 on p 330 of:
+# Presidential Papers: First year of the administration of
+# President William R. Tolbert, Jr., July 23, 1971-July 31, 1972.
+# Monrovia: Executive Mansion.
+#
+# Use the abbreviation "MMT" before 1972, as the more-accurate numeric
+# abbreviation "-004430" would be one byte over the POSIX limit.
+#
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Monrovia	-0:43:08 -	LMT	1882
 			-0:43:08 -	MMT	1919 Mar # Monrovia Mean Time
-			-0:44:30 -	LRT	1972 May # Liberia Time
+			-0:44:30 -	MMT	1972 Jan 7 # approximately MMT
 			 0:00	-	GMT
 
 ###############################################################################
@@ -619,7 +620,7 @@
 Rule Mauritius	2009	only	-	Mar	lastSun	2:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Indian/Mauritius	3:50:00 -	LMT	1907 # Port Louis
-			4:00 Mauritius	MU%sT	# Mauritius Time
+			4:00 Mauritius	+04/+05
 # Agalega Is, Rodriguez
 # no information; probably like Indian/Mauritius
 
@@ -938,14 +939,14 @@
 # since most of it was then controlled by Morocco.
 
 Zone Africa/El_Aaiun	-0:52:48 -	LMT	1934 Jan # El Aaiún
-			-1:00	-	WAT	1976 Apr 14
+			-1:00	-	-01	1976 Apr 14
 			 0:00	Morocco	WE%sT
 
 # Mozambique
 #
 # Shanks gives 1903-03-01 for the transition to CAT.
 # Perhaps the 1911-05-26 Portuguese decree
-# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
+# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
 # merely made it official?
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -972,16 +973,19 @@
 # the country are close to 40 minutes earlier in sunrise than the rest
 # of the country.
 #
-# From Paul Eggert (2007-03-31):
-# Apparently the Caprivi Strip informally observes Botswana time, but
-# we have no details.  In the meantime people there can use Africa/Gaborone.
+# From Paul Eggert (2017-02-22):
+# Although the Zambezi Region (formerly known as Caprivi) informally
+# observes Botswana time, we have no details about historical practice.
+# In the meantime people there can use Africa/Gaborone.
+# See: Immanuel S. The Namibian. 2017-02-23.
+# http://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
 
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Namibia	1994	max	-	Sep	Sun>=1	2:00	1:00	S
 Rule	Namibia	1995	max	-	Apr	Sun>=1	2:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Windhoek	1:08:24 -	LMT	1892 Feb 8
-			1:30	-	SWAT	1903 Mar    # SW Africa Time
+			1:30	-	+0130	1903 Mar
 			2:00	-	SAST	1942 Sep 20  2:00
 			2:00	1:00	SAST	1943 Mar 21  2:00
 			2:00	-	SAST	1990 Mar 21 # independence
@@ -1008,7 +1012,7 @@
 # Réunion
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Reunion	3:41:52 -	LMT	1911 Jun # Saint-Denis
-			4:00	-	RET	# Réunion Time
+			4:00	-	+04
 #
 # Crozet Islands also observes Réunion time; see the 'antarctica' file.
 #
@@ -1043,7 +1047,7 @@
 # Seychelles
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Mahe	3:41:48 -	LMT	1906 Jun # Victoria
-			4:00	-	SCT	# Seychelles Time
+			4:00	-	+04
 # From Paul Eggert (2001-05-30):
 # Aldabra, Farquhar, and Desroches, originally dependencies of the
 # Seychelles, were transferred to the British Indian Ocean Territory
diff --git a/jdk/make/data/tzdata/antarctica b/jdk/make/data/tzdata/antarctica
index 2398ac5..c88c0b4 100644
--- a/jdk/make/data/tzdata/antarctica
+++ b/jdk/make/data/tzdata/antarctica
@@ -133,7 +133,8 @@
 # O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
 # Prat, -6230-05941
 # Villa Las Estrellas (a town), around the Frei base, since 1984-04-09
-# These locations have always used Santiago time; use TZ='America/Santiago'.
+# These locations employ Region of Magallanes time; use
+# TZ='America/Punta_Arenas'.
 
 # China - year-round bases
 # Great Wall, King George Island, -6213-05858, since 1985-02-20
diff --git a/jdk/make/data/tzdata/asia b/jdk/make/data/tzdata/asia
index ac20740..306a2aa 100644
--- a/jdk/make/data/tzdata/asia
+++ b/jdk/make/data/tzdata/asia
@@ -29,15 +29,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2015-08-08):
+# From Paul Eggert (2017-01-13):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -58,29 +58,24 @@
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
 #
-# I invented the abbreviations marked '*' in the following table;
-# the rest are from earlier versions of this file, or from other sources.
-# Corrections are welcome!
+# The following alphabetic abbreviations appear in these tables:
 #	     std  dst
 #	     LMT	Local Mean Time
 #	2:00 EET  EEST	Eastern European Time
 #	2:00 IST  IDT	Israel
-#	3:00 AST  ADT	Arabia*
-#	3:30 IRST IRDT	Iran*
-#	4:00 GST	Gulf*
 #	5:30 IST	India
-#	7:00 ICT	Indochina, most times and locations*
 #	7:00 WIB	west Indonesia (Waktu Indonesia Barat)
 #	8:00 WITA	central Indonesia (Waktu Indonesia Tengah)
 #	8:00 CST	China
-#	8:00 IDT	Indochina, 1943-45, 1947-55, 1960-75 (some locations)*
-#	8:00 JWST	Western Standard Time (Japan, 1896/1937)*
-#	8:30 KST  KDT	Korea when at +0830*
-#	9:00 JCST	Central Standard Time (Japan, 1896/1937)
+#	8:30 KST  KDT	Korea when at +0830
 #	9:00 WIT	east Indonesia (Waktu Indonesia Timur)
 #	9:00 JST  JDT	Japan
 #	9:00 KST  KDT	Korea when at +09
 #	9:30 ACST	Australian Central Standard Time
+# Otherwise, these tables typically use numeric abbreviations like +03
+# and +0330 for integer hour and minute UTC offsets.  Although earlier
+# editions invented alphabetic time zone abbreviations for every
+# offset, this did not reflect common practice.
 #
 # See the 'europe' file for Russia and Turkey in Asia.
 
@@ -88,7 +83,7 @@
 # Incorporates data for Singapore from Robert Elz' asia 1.1, as well as
 # additional information from Tom Yap, Sun Microsystems Intercontinental
 # Technical Support (including a page from the Official Airline Guide -
-# Worldwide Edition).  The names for time zones are guesses.
+# Worldwide Edition).
 
 ###############################################################################
 
@@ -109,8 +104,8 @@
 # Afghanistan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Kabul	4:36:48 -	LMT	1890
-			4:00	-	AFT	1945
-			4:30	-	AFT
+			4:00	-	+04	1945
+			4:30	-	+0430
 
 # Armenia
 # From Paul Eggert (2006-03-22):
@@ -253,18 +248,17 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
-			6:30	-	BURT	1942 May 15 # Burma Time
-			5:30	-	IST	1942 Sep
-			6:30	-	BURT	1951 Sep 30
-			6:00	-	DACT	1971 Mar 26 # Dacca Time
-			6:00	-	BDT	2009
-			6:00	Dhaka	BD%sT
+			6:30	-	+0630	1942 May 15
+			5:30	-	+0530	1942 Sep
+			6:30	-	+0630	1951 Sep 30
+			6:00	-	+06	2009
+			6:00	Dhaka	+06/+07
 
 # Bhutan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Thimphu	5:58:36 -	LMT	1947 Aug 15 # or Thimbu
-			5:30	-	IST	1987 Oct
-			6:00	-	BTT	# Bhutan Time
+			5:30	-	+0530	1987 Oct
+			6:00	-	+06
 
 # British Indian Ocean Territory
 # Whitman and the 1995 CIA time zone map say 5:00, but the
@@ -274,14 +268,14 @@
 # then contained the Chagos Archipelago).
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Chagos	4:49:40	-	LMT	1907
-			5:00	-	IOT	1996 # BIOT Time
-			6:00	-	IOT
+			5:00	-	+05	1996
+			6:00	-	+06
 
 # Brunei
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Brunei	7:39:40 -	LMT	1926 Mar # Bandar Seri Begawan
-			7:30	-	BNT	1933
-			8:00	-	BNT
+			7:30	-	+0730	1933
+			8:00	-	+08
 
 # Burma / Myanmar
 
@@ -290,9 +284,9 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Yangon	6:24:40 -	LMT	1880        # or Rangoon
 			6:24:40	-	RMT	1920        # Rangoon Mean Time?
-			6:30	-	BURT	1942 May    # Burma Time
-			9:00	-	JST	1945 May  3
-			6:30	-	MMT	# Myanmar Time
+			6:30	-	+0630	1942 May
+			9:00	-	+09	1945 May  3
+			6:30	-	+0630
 
 # Cambodia
 # See Asia/Bangkok.
@@ -355,7 +349,7 @@
 # (could be true), for the moment I am assuming that those two
 # counties are mistakes in the astro.com data.
 
-# From Paul Eggert (2014-06-30):
+# From Paul Eggert (2017-01-05):
 # Alois Treindl kindly sent me translations of the following two sources:
 #
 # (1)
@@ -413,28 +407,26 @@
 # mainly observed in coastal areas), the five zones were:
 #
 # Changbai Time ("Long-white Time", Long-white = Heilongjiang area) UT +08:30
-# Asia/Harbin (currently a link to Asia/Shanghai)
+# Now part of Asia/Shanghai; its pre-1970 times are not recorded here.
 # Heilongjiang (except Mohe county), Jilin
 #
 # Zhongyuan Time ("Central plain Time") UT +08
-# Asia/Shanghai
+# Now part of Asia/Shanghai.
 # most of China
-# This currently represents most other zones as well,
-# as apparently these regions have been the same since 1970.
 # Milne gives 8:05:43.2 for Xujiahui Observatory time; round to nearest.
 # Guo says Shanghai switched to UT +08 "from the end of the 19th century".
 #
-# Long-shu Time (probably due to Long and Shu being two names of the area) UT +07
-# Asia/Chongqing (currently a link to Asia/Shanghai)
+# Long-shu Time (probably as Long and Shu were two names of the area) UT +07
+# Now part of Asia/Shanghai; its pre-1970 times are not recorded here.
 # Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
-# most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
+# most of Gansu; west Inner Mongolia; east Qinghai; and the Guangdong
 # counties Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing,
 # Yangchun, Yangjiang, Yu'nan, and Yunfu.
 #
 # Xin-zang Time ("Xinjiang-Tibet Time") UT +06
-# Asia/Urumqi
-# This currently represents Kunlun Time as well,
-# as apparently the two regions have been the same since 1970.
+# This region is now part of either Asia/Urumqi or Asia/Shanghai with
+# current boundaries uncertain; times before 1970 for areas that
+# disagree with Ürümqi or Shanghai are not recorded here.
 # The Gansu counties Aksay, Anxi, Dunhuang, Subei; west Qinghai;
 # the Guangdong counties  Xuwen, Haikang, Suixi, Lianjiang,
 # Zhanjiang, Wuchuan, Huazhou, Gaozhou, Maoming, Dianbai, and Xinyi;
@@ -445,7 +437,7 @@
 # Fukang, Kuitun, Kumukuli, Miquan, Qitai, and Turfan.
 #
 # Kunlun Time UT +05:30
-# Asia/Kashgar (currently a link to Asia/Urumqi)
+# This region is now in the same status as Xin-zang Time (see above).
 # West Tibet, including Pulan, Aheqi, Shufu, Shule;
 # West Xinjiang, including Aksu, Atushi, Yining, Hetian, Cele, Luopu, Nileke,
 # Zhaosu, Tekesi, Gongliu, Chabuchaer, Huocheng, Bole, Pishan, Suiding,
@@ -546,7 +538,7 @@
 # Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi
 # / Wulumuqi.  (Please use Asia/Shanghai if you prefer Beijing time.)
 Zone	Asia/Urumqi	5:50:20	-	LMT	1928
-			6:00	-	XJT
+			6:00	-	+06
 
 
 # Hong Kong (Xianggang)
@@ -765,30 +757,29 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 # Taipei or Taibei or T'ai-pei
 Zone	Asia/Taipei	8:06:00 -	LMT	1896 Jan  1
-			8:00	-	JWST	1937 Oct  1
+			8:00	-	CST	1937 Oct  1
 			9:00	-	JST	1945 Sep 21  1:00
 			8:00	Taiwan	C%sT
 
 # Macau (Macao, Aomen)
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Macau	1961	1962	-	Mar	Sun>=16	3:30	1:00	S
-Rule	Macau	1961	1964	-	Nov	Sun>=1	3:30	0	-
-Rule	Macau	1963	only	-	Mar	Sun>=16	0:00	1:00	S
-Rule	Macau	1964	only	-	Mar	Sun>=16	3:30	1:00	S
-Rule	Macau	1965	only	-	Mar	Sun>=16	0:00	1:00	S
-Rule	Macau	1965	only	-	Oct	31	0:00	0	-
-Rule	Macau	1966	1971	-	Apr	Sun>=16	3:30	1:00	S
-Rule	Macau	1966	1971	-	Oct	Sun>=16	3:30	0	-
-Rule	Macau	1972	1974	-	Apr	Sun>=15	0:00	1:00	S
-Rule	Macau	1972	1973	-	Oct	Sun>=15	0:00	0	-
-Rule	Macau	1974	1977	-	Oct	Sun>=15	3:30	0	-
-Rule	Macau	1975	1977	-	Apr	Sun>=15	3:30	1:00	S
-Rule	Macau	1978	1980	-	Apr	Sun>=15	0:00	1:00	S
-Rule	Macau	1978	1980	-	Oct	Sun>=15	0:00	0	-
+Rule	Macau	1961	1962	-	Mar	Sun>=16	3:30	1:00	D
+Rule	Macau	1961	1964	-	Nov	Sun>=1	3:30	0	S
+Rule	Macau	1963	only	-	Mar	Sun>=16	0:00	1:00	D
+Rule	Macau	1964	only	-	Mar	Sun>=16	3:30	1:00	D
+Rule	Macau	1965	only	-	Mar	Sun>=16	0:00	1:00	D
+Rule	Macau	1965	only	-	Oct	31	0:00	0	S
+Rule	Macau	1966	1971	-	Apr	Sun>=16	3:30	1:00	D
+Rule	Macau	1966	1971	-	Oct	Sun>=16	3:30	0	S
+Rule	Macau	1972	1974	-	Apr	Sun>=15	0:00	1:00	D
+Rule	Macau	1972	1973	-	Oct	Sun>=15	0:00	0	S
+Rule	Macau	1974	1977	-	Oct	Sun>=15	3:30	0	S
+Rule	Macau	1975	1977	-	Apr	Sun>=15	3:30	1:00	D
+Rule	Macau	1978	1980	-	Apr	Sun>=15	0:00	1:00	D
+Rule	Macau	1978	1980	-	Oct	Sun>=15	0:00	0	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Macau	7:34:20 -	LMT	1912 Jan  1
-			8:00	Macau	MO%sT	1999 Dec 20 # return to China
-			8:00	PRC	C%sT
+			8:00	Macau	C%sT
 
 
 ###############################################################################
@@ -904,11 +895,10 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dili	8:22:20 -	LMT	1912 Jan  1
-			8:00	-	TLT	1942 Feb 21 23:00 # E Timor Time
-			9:00	-	JST	1945 Sep 23
-			9:00	-	TLT	1976 May  3
-			8:00	-	WITA	2000 Sep 17  0:00
-			9:00	-	TLT
+			8:00	-	+08	1942 Feb 21 23:00
+			9:00	-	+09	1976 May  3
+			8:00	-	+08	2000 Sep 17  0:00
+			9:00	-	+09
 
 # India
 
@@ -923,9 +913,9 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Kolkata	5:53:28 -	LMT	1880        # Kolkata
 			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
-			6:30	-	BURT	1942 May 15 # Burma Time
+			6:30	-	+0630	1942 May 15
 			5:30	-	IST	1942 Sep
-			5:30	1:00	IST	1945 Oct 15
+			5:30	1:00	+0630	1945 Oct 15
 			5:30	-	IST
 # The following are like Asia/Kolkata:
 #	Andaman Is
@@ -976,33 +966,33 @@
 # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
 # but this must be a typo.
 			7:07:12	-	BMT	1923 Dec 31 23:47:12 # Batavia
-			7:20	-	JAVT	1932 Nov    # Java Time
-			7:30	-	WIB	1942 Mar 23
-			9:00	-	JST	1945 Sep 23
-			7:30	-	WIB	1948 May
-			8:00	-	WIB	1950 May
-			7:30	-	WIB	1964
+			7:20	-	+0720	1932 Nov
+			7:30	-	+0730	1942 Mar 23
+			9:00	-	+09	1945 Sep 23
+			7:30	-	+0730	1948 May
+			8:00	-	+08	1950 May
+			7:30	-	+0730	1964
 			7:00	-	WIB
 # west and central Borneo
 Zone Asia/Pontianak	7:17:20	-	LMT	1908 May
 			7:17:20	-	PMT	1932 Nov    # Pontianak MT
-			7:30	-	WIB	1942 Jan 29
-			9:00	-	JST	1945 Sep 23
-			7:30	-	WIB	1948 May
-			8:00	-	WIB	1950 May
-			7:30	-	WIB	1964
+			7:30	-	+0730	1942 Jan 29
+			9:00	-	+09	1945 Sep 23
+			7:30	-	+0730	1948 May
+			8:00	-	+08	1950 May
+			7:30	-	+0730	1964
 			8:00	-	WITA	1988 Jan  1
 			7:00	-	WIB
 # Sulawesi, Lesser Sundas, east and south Borneo
 Zone Asia/Makassar	7:57:36 -	LMT	1920
 			7:57:36	-	MMT	1932 Nov    # Macassar MT
-			8:00	-	WITA	1942 Feb  9
-			9:00	-	JST	1945 Sep 23
+			8:00	-	+08	1942 Feb  9
+			9:00	-	+09	1945 Sep 23
 			8:00	-	WITA
 # Maluku Islands, West Papua, Papua
 Zone Asia/Jayapura	9:22:48 -	LMT	1932 Nov
-			9:00	-	WIT	1944 Sep  1
-			9:30	-	ACST	1964
+			9:00	-	+09	1944 Sep  1
+			9:30	-	+0930	1964
 			9:00	-	WIT
 
 # Iran
@@ -1034,8 +1024,6 @@
 # for at least the last 5 years.  Before that, for a few years, the
 # date used was the first Thursday night of Farvardin and the last
 # Thursday night of Shahrivar, but I can't give exact dates....
-# I have also changed the abbreviations to what is considered correct
-# here in Iran, IRST for regular time and IRDT for daylight saving time.
 #
 # From Roozbeh Pournader (2005-04-05):
 # The text of the Iranian law, in effect since 1925, clearly mentions
@@ -1142,9 +1130,9 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Tehran	3:25:44	-	LMT	1916
 			3:25:44	-	TMT	1946     # Tehran Mean Time
-			3:30	-	IRST	1977 Nov
-			4:00	Iran	IR%sT	1979
-			3:30	Iran	IR%sT
+			3:30	-	+0330	1977 Nov
+			4:00	Iran	+04/+05	1979
+			3:30	Iran	+0330/+0430
 
 
 # Iraq
@@ -1187,8 +1175,8 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Baghdad	2:57:40	-	LMT	1890
 			2:57:36	-	BMT	1918     # Baghdad Mean Time?
-			3:00	-	AST	1982 May
-			3:00	Iraq	A%sT
+			3:00	-	+03	1982 May
+			3:00	Iraq	+03/+04
 
 
 ###############################################################################
@@ -1487,8 +1475,6 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Tokyo	9:18:59	-	LMT	1887 Dec 31 15:00u
-			9:00	-	JST	1896 Jan  1
-			9:00	-	JCST	1937 Oct  1
 			9:00	Japan	J%sT
 # Since 1938, all Japanese possessions have been like Asia/Tokyo.
 
@@ -1764,7 +1750,23 @@
 # Kazakh 1992-01-13 act appears to provide the same rules and 1992-03-27
 # act was to be enacted on the last Sunday of March 1992.
 
-# From Paul Eggert (2016-11-07):
+# From Stepan Golosunov (2016-11-08):
+# Turgai reorganization should affect only southern part of Qostanay
+# oblast.  Which should probably be separated into Asia/Arkalyk zone.
+# (There were also 1970, 1988 and 1990 Turgai oblast reorganizations
+# according to wikipedia.)
+#
+# [For Qostanay] http://www.ng.kz/gazeta/195/hranit/
+# suggests that clocks were to be moved 40 minutes backwards on
+# 1920-01-01 to the fourth time belt.  But I do not understand
+# how that could happen....
+#
+# [For Atyrau and Oral] 1919 decree
+# (http://www.worldtimezone.com/dst_news/dst_news_russia-1919-02-08.html
+# and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in
+# the third time belt (before 1930 this means +03).
+
+# From Paul Eggert (2016-12-06):
 # The tables below reflect Golosunov's remarks, with exceptions as noted.
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1794,7 +1796,7 @@
 			6:00	-	+06
 # The following zone is like Asia/Qyzylorda except for being one
 # hour earlier from 1991-09-29 to 1992-03-29.  The 1991/2 rules for
-# Qostenay are unclear partly because of the 1997 Turgai
+# Qostanay are unclear partly because of the 1997 Turgai
 # reorganization, so this zone is commented out for now.
 #Zone	Asia/Qostanay	4:14:20 -	LMT	1924 May  2
 #			4:00	-	+04	1930 Jun 21
@@ -1831,7 +1833,7 @@
 # Atyraū (KZ-ATY) is like Mangghystaū except it switched from
 # +04/+05 to +05/+06 in spring 1999, not fall 1994.
 Zone	Asia/Atyrau	3:27:44	-	LMT	1924 May  2
-			4:00	-	+04	1930 Jun 21
+			3:00	-	+03	1930 Jun 21
 			5:00	-	+05	1981 Oct  1
 			6:00	-	+06	1982 Apr  1
 			5:00 RussiaAsia	+05/+06	1991 Mar 31  2:00s
@@ -1843,7 +1845,7 @@
 # From Paul Eggert (2016-03-18):
 # The 1989 transition is from USSR act No. 227 (1989-03-14).
 Zone	Asia/Oral	3:25:24	-	LMT	1924 May  2 # or Ural'sk
-			4:00	-	+04	1930 Jun 21
+			3:00	-	+03	1930 Jun 21
 			5:00	-	+05	1981 Apr  1
 			5:00	1:00	+06	1981 Oct  1
 			6:00	-	+06	1982 Apr  1
@@ -1949,14 +1951,12 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Seoul	8:27:52	-	LMT	1908 Apr  1
 			8:30	-	KST	1912 Jan  1
-			9:00	-	JCST	1937 Oct  1
 			9:00	-	JST	1945 Sep  8
 			9:00	-	KST	1954 Mar 21
 			8:30	ROK	K%sT	1961 Aug 10
 			9:00	ROK	K%sT
 Zone	Asia/Pyongyang	8:23:00 -	LMT	1908 Apr  1
 			8:30	-	KST	1912 Jan  1
-			9:00	-	JCST	1937 Oct  1
 			9:00	-	JST	1945 Aug 24
 			9:00	-	KST	2015 Aug 15 00:00
 			8:30	-	KST
@@ -2011,30 +2011,29 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Asia/Kuala_Lumpur	6:46:46 -	LMT	1901 Jan  1
 			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
-			7:00	-	MALT	1933 Jan  1 # Malaya Time
-			7:00	0:20	MALST	1936 Jan  1
-			7:20	-	MALT	1941 Sep  1
-			7:30	-	MALT	1942 Feb 16
-			9:00	-	JST	1945 Sep 12
-			7:30	-	MALT	1982 Jan  1
-			8:00	-	MYT	# Malaysia Time
+			7:00	-	+07	1933 Jan  1
+			7:00	0:20	+0720	1936 Jan  1
+			7:20	-	+0720	1941 Sep  1
+			7:30	-	+0730	1942 Feb 16
+			9:00	-	+09	1945 Sep 12
+			7:30	-	+0730	1982 Jan  1
+			8:00	-	+08
 # Sabah & Sarawak
 # From Paul Eggert (2014-08-12):
 # The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945
 # and 1982 transition dates are from Mok Ly Yng.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Asia/Kuching	7:21:20	-	LMT	1926 Mar
-			7:30	-	BORT	1933        # Borneo Time
-			8:00	NBorneo	BOR%sT	1942 Feb 16
-			9:00	-	JST	1945 Sep 12
-			8:00	-	BORT	1982 Jan  1
-			8:00	-	MYT
+			7:30	-	+0730	1933
+			8:00 NBorneo  +08/+0820	1942 Feb 16
+			9:00	-	+09	1945 Sep 12
+			8:00	-	+08
 
 # Maldives
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Maldives	4:54:00 -	LMT	1880 # Male
 			4:54:00	-	MMT	1960 # Male Mean Time
-			5:00	-	MVT	# Maldives Time
+			5:00	-	+05
 
 # Mongolia
 
@@ -2161,37 +2160,41 @@
 # correction of 02:00 (in the previous edition) not being done correctly
 # in the latest edition; so ignore it for now.
 
+# From Ganbold Tsagaankhuu (2017-02-09):
+# Mongolian Government meeting has concluded today to cancel daylight
+# saving time adoption in Mongolia.  Source: http://zasag.mn/news/view/16192
+
 Rule	Mongol	1985	1998	-	Mar	lastSun	0:00	1:00	S
 Rule	Mongol	1984	1998	-	Sep	lastSun	0:00	0	-
 # IATA SSIM (1999-09) says Mongolia no longer observes DST.
 Rule	Mongol	2001	only	-	Apr	lastSat	2:00	1:00	S
 Rule	Mongol	2001	2006	-	Sep	lastSat	2:00	0	-
 Rule	Mongol	2002	2006	-	Mar	lastSat	2:00	1:00	S
-Rule	Mongol	2015	max	-	Mar	lastSat	2:00	1:00	S
-Rule	Mongol	2015	max	-	Sep	lastSat	0:00	0	-
+Rule	Mongol	2015	2016	-	Mar	lastSat	2:00	1:00	S
+Rule	Mongol	2015	2016	-	Sep	lastSat	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 # Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
 Zone	Asia/Hovd	6:06:36 -	LMT	1905 Aug
-			6:00	-	HOVT	1978     # Hovd Time
-			7:00	Mongol	HOV%sT
+			6:00	-	+06	1978
+			7:00	Mongol	+07/+08
 # Ulaanbaatar, a.k.a. Ulan Bataar, Ulan Bator, Urga
 Zone	Asia/Ulaanbaatar 7:07:32 -	LMT	1905 Aug
-			7:00	-	ULAT	1978     # Ulaanbaatar Time
-			8:00	Mongol	ULA%sT
+			7:00	-	+07	1978
+			8:00	Mongol	+08/+09
 # Choibalsan, a.k.a. Bajan Tümen, Bajan Tumen, Chojbalsan,
 # Choybalsan, Sanbejse, Tchoibalsan
 Zone	Asia/Choibalsan	7:38:00 -	LMT	1905 Aug
-			7:00	-	ULAT	1978
-			8:00	-	ULAT	1983 Apr
-			9:00	Mongol	CHO%sT	2008 Mar 31 # Choibalsan Time
-			8:00	Mongol	CHO%sT
+			7:00	-	+07	1978
+			8:00	-	+08	1983 Apr
+			9:00	Mongol	+09/+10	2008 Mar 31
+			8:00	Mongol	+08/+09
 
 # Nepal
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Kathmandu	5:41:16 -	LMT	1920
-			5:30	-	IST	1986
-			5:45	-	NPT	# Nepal Time
+			5:30	-	+0530	1986
+			5:45	-	+0545
 
 # Oman
 # See Asia/Dubai.
@@ -2340,10 +2343,10 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
-			5:30	-	IST	1942 Sep
-			5:30	1:00	IST	1945 Oct 15
-			5:30	-	IST	1951 Sep 30
-			5:00	-	KART	1971 Mar 26 # Karachi Time
+			5:30	-	+0530	1942 Sep
+			5:30	1:00	+0630	1945 Oct 15
+			5:30	-	+0530	1951 Sep 30
+			5:00	-	+05	1971 Mar 26
 			5:00 Pakistan	PK%sT	# Pakistan Time
 
 # Palestine
@@ -2708,15 +2711,15 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Manila	-15:56:00 -	LMT	1844 Dec 31
 			8:04:00 -	LMT	1899 May 11
-			8:00	Phil	PH%sT	1942 May
-			9:00	-	JST	1944 Nov
-			8:00	Phil	PH%sT
+			8:00	Phil	+08/+09	1942 May
+			9:00	-	+09	1944 Nov
+			8:00	Phil	+08/+09
 
 # Qatar
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Qatar	3:26:08 -	LMT	1920     # Al Dawhah / Doha
-			4:00	-	GST	1972 Jun
-			3:00	-	AST
+			4:00	-	+04	1972 Jun
+			3:00	-	+03
 Link Asia/Qatar Asia/Bahrain
 
 # Saudi Arabia
@@ -2743,7 +2746,7 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Riyadh	3:06:52 -	LMT	1947 Mar 14
-			3:00	-	AST
+			3:00	-	+03
 Link Asia/Riyadh Asia/Aden	# Yemen
 Link Asia/Riyadh Asia/Kuwait
 
@@ -2753,14 +2756,13 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Singapore	6:55:25 -	LMT	1901 Jan  1
 			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
-			7:00	-	MALT	1933 Jan  1 # Malaya Time
-			7:00	0:20	MALST	1936 Jan  1
-			7:20	-	MALT	1941 Sep  1
-			7:30	-	MALT	1942 Feb 16
-			9:00	-	JST	1945 Sep 12
-			7:30	-	MALT	1965 Aug  9 # independence
-			7:30	-	SGT	1982 Jan  1 # Singapore Time
-			8:00	-	SGT
+			7:00	-	+07	1933 Jan  1
+			7:00	0:20	+0720	1936 Jan  1
+			7:20	-	+0720	1941 Sep  1
+			7:30	-	+0730	1942 Feb 16
+			9:00	-	+09	1945 Sep 12
+			7:30	-	+0730	1982 Jan  1
+			8:00	-	+08
 
 # Spratly Is
 # no information
@@ -2819,8 +2821,8 @@
 Zone	Asia/Colombo	5:19:24 -	LMT	1880
 			5:19:32	-	MMT	1906        # Moratuwa Mean Time
 			5:30	-	+0530	1942 Jan  5
-			5:30	0:30	+0530/+06 1942 Sep
-			5:30	1:00	+0530/+0630 1945 Oct 16  2:00
+			5:30	0:30	+06	1942 Sep
+			5:30	1:00	+0630	1945 Oct 16  2:00
 			5:30	-	+0530	1996 May 25  0:00
 			6:30	-	+0630	1996 Oct 26  0:30
 			6:00	-	+06	2006 Apr 15  0:30
@@ -3002,7 +3004,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Bangkok	6:42:04	-	LMT	1880
 			6:42:04	-	BMT	1920 Apr # Bangkok Mean Time
-			7:00	-	ICT
+			7:00	-	+07
 Link Asia/Bangkok Asia/Phnom_Penh	# Cambodia
 Link Asia/Bangkok Asia/Vientiane	# Laos
 
@@ -3018,7 +3020,7 @@
 # United Arab Emirates
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dubai	3:41:12 -	LMT	1920
-			4:00	-	GST
+			4:00	-	+04
 Link Asia/Dubai Asia/Muscat	# Oman
 
 # Uzbekistan
@@ -3091,15 +3093,15 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Asia/Ho_Chi_Minh	7:06:40 -	LMT	1906 Jul  1
-			7:06:30	-	PLMT	1911 May  1
-			7:00	-	ICT	1942 Dec 31 23:00
-			8:00	-	IDT	1945 Mar 14 23:00
-			9:00	-	JST	1945 Sep  2
-			7:00	-	ICT	1947 Apr  1
-			8:00	-	IDT	1955 Jul  1
-			7:00	-	ICT	1959 Dec 31 23:00
-			8:00	-	IDT	1975 Jun 13
-			7:00	-	ICT
+			7:06:30	-	PLMT	1911 May  1 # Phù Liá»…n MT
+			7:00	-	+07	1942 Dec 31 23:00
+			8:00	-	+08	1945 Mar 14 23:00
+			9:00	-	+09	1945 Sep  2
+			7:00	-	+07	1947 Apr  1
+			8:00	-	+08	1955 Jul  1
+			7:00	-	+07	1959 Dec 31 23:00
+			8:00	-	+08	1975 Jun 13
+			7:00	-	+07
 
 # Yemen
 # See Asia/Riyadh.
diff --git a/jdk/make/data/tzdata/australasia b/jdk/make/data/tzdata/australasia
index 81ef521..db7e7f7 100644
--- a/jdk/make/data/tzdata/australasia
+++ b/jdk/make/data/tzdata/australasia
@@ -67,8 +67,8 @@
 			 8:00	Aus	AW%sT	1943 Jul
 			 8:00	AW	AW%sT
 Zone Australia/Eucla	 8:35:28 -	LMT	1895 Dec
-			 8:45	Aus	ACW%sT	1943 Jul
-			 8:45	AW	ACW%sT
+			 8:45	Aus +0845/+0945	1943 Jul
+			 8:45	AW  +0845/+0945
 
 # Queensland
 #
@@ -235,7 +235,8 @@
 Rule	LH	2008	max	-	Oct	Sun>=1	2:00	0:30	D
 Zone Australia/Lord_Howe 10:36:20 -	LMT	1895 Feb
 			10:00	-	AEST	1981 Mar
-			10:30	LH	LH%sT
+			10:30	LH	+1030/+1130 1985 Jul
+			10:30	LH	+1030/+11
 
 # Australian miscellany
 #
@@ -273,19 +274,19 @@
 			0	-	-00	1948 Mar 25
 			10:00	Aus	AE%sT	1967
 			10:00	AT	AE%sT	2010 Apr  4  3:00
-			11:00	-	MIST	# Macquarie I Standard Time
+			11:00	-	+11
 
 # Christmas
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Indian/Christmas	7:02:52 -	LMT	1895 Feb
-			7:00	-	CXT	# Christmas Island Time
+			7:00	-	+07
 
 # Cocos (Keeling) Is
 # These islands were ruled by the Ross family from about 1830 to 1978.
 # We don't know when standard time was introduced; for now, we guess 1900.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Cocos	6:27:40	-	LMT	1900
-			6:30	-	CCT	# Cocos Islands Time
+			6:30	-	+0630
 
 
 # Fiji
@@ -398,16 +399,16 @@
 Rule	Fiji	2015	max	-	Jan	Sun>=15	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:55:44 -	LMT	1915 Oct 26 # Suva
-			12:00	Fiji	FJ%sT	# Fiji Time
+			12:00	Fiji	+12/+13
 
 # French Polynesia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Gambier	 -8:59:48 -	LMT	1912 Oct # Rikitea
-			 -9:00	-	GAMT	# Gambier Time
+			 -9:00	-	-09
 Zone	Pacific/Marquesas -9:18:00 -	LMT	1912 Oct
-			 -9:30	-	MART	# Marquesas Time
+			 -9:30	-	-0930
 Zone	Pacific/Tahiti	 -9:58:16 -	LMT	1912 Oct # Papeete
-			-10:00	-	TAHT	# Tahiti Time
+			-10:00	-	-10
 # Clipperton (near North America) is administered from French Polynesia;
 # it is uninhabited.
 
@@ -422,15 +423,15 @@
 # Kiribati
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Tarawa	 11:32:04 -	LMT	1901 # Bairiki
-			 12:00	-	GILT	# Gilbert Is Time
+			 12:00	-	+12
 Zone Pacific/Enderbury	-11:24:20 -	LMT	1901
-			-12:00	-	PHOT	1979 Oct # Phoenix Is Time
-			-11:00	-	PHOT	1995
-			 13:00	-	PHOT
+			-12:00	-	-12	1979 Oct
+			-11:00	-	-11	1995
+			 13:00	-	+13
 Zone Pacific/Kiritimati	-10:29:20 -	LMT	1901
-			-10:40	-	LINT	1979 Oct # Line Is Time
-			-10:00	-	LINT	1995
-			 14:00	-	LINT
+			-10:40	-	-1040	1979 Oct
+			-10:00	-	-10	1995
+			 14:00	-	+14
 
 # N Mariana Is
 # See Pacific/Guam.
@@ -438,31 +439,31 @@
 # Marshall Is
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Majuro	11:24:48 -	LMT	1901
-			11:00	-	MHT	1969 Oct # Marshall Islands Time
-			12:00	-	MHT
+			11:00	-	+11	1969 Oct
+			12:00	-	+12
 Zone Pacific/Kwajalein	11:09:20 -	LMT	1901
-			11:00	-	MHT	1969 Oct
-			-12:00	-	KWAT	1993 Aug 20 # Kwajalein Time
-			12:00	-	MHT
+			11:00	-	+11	1969 Oct
+			-12:00	-	-12	1993 Aug 20
+			12:00	-	+12
 
 # Micronesia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Chuuk	10:07:08 -	LMT	1901
-			10:00	-	CHUT	# Chuuk Time
+			10:00	-	+10
 Zone Pacific/Pohnpei	10:32:52 -	LMT	1901 # Kolonia
-			11:00	-	PONT	# Pohnpei Time
+			11:00	-	+11
 Zone Pacific/Kosrae	10:51:56 -	LMT	1901
-			11:00	-	KOST	1969 Oct # Kosrae Time
-			12:00	-	KOST	1999
-			11:00	-	KOST
+			11:00	-	+11	1969 Oct
+			12:00	-	+12	1999
+			11:00	-	+11
 
 # Nauru
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Nauru	11:07:40 -	LMT	1921 Jan 15 # Uaobe
-			11:30	-	NRT	1942 Mar 15 # Nauru Time
-			9:00	-	JST	1944 Aug 15
-			11:30	-	NRT	1979 May
-			12:00	-	NRT
+			11:30	-	+1130	1942 Mar 15
+			9:00	-	+09	1944 Aug 15
+			11:30	-	+1130	1979 May
+			12:00	-	+12
 
 # New Caledonia
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -473,7 +474,7 @@
 Rule	NC	1997	only	-	Mar	 2	2:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Noumea	11:05:48 -	LMT	1912 Jan 13 # Nouméa
-			11:00	NC	NC%sT
+			11:00	NC	+11/+12
 
 
 ###############################################################################
@@ -514,8 +515,8 @@
 			11:30	NZ	NZ%sT	1946 Jan  1
 			12:00	NZ	NZ%sT
 Zone Pacific/Chatham	12:13:48 -	LMT	1868 Nov  2
-			12:15	-	CHAST	1946 Jan  1
-			12:45	Chatham	CHA%sT
+			12:15	-	+1215	1946 Jan  1
+			12:45	Chatham	+1245/+1345
 
 Link Pacific/Auckland Antarctica/McMurdo
 
@@ -537,8 +538,8 @@
 Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901        # Avarua
-			-10:30	-	CKT	1978 Nov 12 # Cook Is Time
-			-10:00	Cook	CK%sT
+			-10:30	-	-1030	1978 Nov 12
+			-10:00	Cook	-10/-0930
 
 ###############################################################################
 
@@ -546,29 +547,29 @@
 # Niue
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Niue	-11:19:40 -	LMT	1901        # Alofi
-			-11:20	-	NUT	1951        # Niue Time
-			-11:30	-	NUT	1978 Oct  1
-			-11:00	-	NUT
+			-11:20	-	-1120	1951
+			-11:30	-	-1130	1978 Oct  1
+			-11:00	-	-11
 
 # Norfolk
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Norfolk	11:11:52 -	LMT	1901 # Kingston
-			11:12	-	NMT	1951 # Norfolk Mean Time
-			11:30	-	NFT	1974 Oct 27 02:00 # Norfolk T.
-			11:30	1:00	NFST	1975 Mar  2 02:00
-			11:30	-	NFT	2015 Oct  4 02:00
-			11:00	-	NFT
+			11:12	-	+1112	1951
+			11:30	-	+1130	1974 Oct 27 02:00
+			11:30	1:00	+1230	1975 Mar  2 02:00
+			11:30	-	+1130	2015 Oct  4 02:00
+			11:00	-	+11
 
 # Palau (Belau)
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Palau	8:57:56 -	LMT	1901 # Koror
-			9:00	-	PWT	# Palau Time
+			9:00	-	+09
 
 # Papua New Guinea
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Port_Moresby 9:48:40 -	LMT	1880
 			9:48:32	-	PMMT	1895 # Port Moresby Mean Time
-			10:00	-	PGT	# Papua New Guinea Time
+			10:00	-	+10
 #
 # From Paul Eggert (2014-10-13):
 # Base the Bougainville entry on the Arawa-Kieta region, which appears to have
@@ -583,28 +584,26 @@
 # and seem to have controlled it until their 1945-08-21 surrender.
 #
 # The Autonomous Region of Bougainville switched from UT +10 to +11
-# on 2014-12-28 at 02:00.  They call +11 "Bougainville Standard Time";
-# abbreviate this as BST.  See:
+# on 2014-12-28 at 02:00.  They call +11 "Bougainville Standard Time".
+# See:
 # http://www.bougainville24.com/bougainville-issues/bougainville-gets-own-timezone/
 #
 Zone Pacific/Bougainville 10:22:16 -	LMT	1880
 			 9:48:32 -	PMMT	1895
-			10:00	-	PGT	1942 Jul
-			 9:00	-	JST	1945 Aug 21
-			10:00	-	PGT	2014 Dec 28  2:00
-			11:00	-	BST
+			10:00	-	+10	1942 Jul
+			 9:00	-	+09	1945 Aug 21
+			10:00	-	+10	2014 Dec 28  2:00
+			11:00	-	+11
 
 # Pitcairn
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Pitcairn	-8:40:20 -	LMT	1901        # Adamstown
-			-8:30	-	PNT	1998 Apr 27  0:00
-			-8:00	-	PST	# Pitcairn Standard Time
+			-8:30	-	-0830	1998 Apr 27  0:00
+			-8:00	-	-08
 
 # American Samoa
 Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1879 Jul  5
 			-11:22:48 -	LMT	1911
-			-11:00	-	NST	1967 Apr    # N=Nome
-			-11:00	-	BST	1983 Nov 30 # B=Bering
 			-11:00	-	SST	            # S=Samoa
 Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
 
@@ -685,17 +684,17 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
-			-11:30	-	WSST	1950
-			-11:00	WS	S%sT	2011 Dec 29 24:00 # S=Samoa
-			 13:00	WS	WS%sT
+			-11:30	-	-1130	1950
+			-11:00	WS	-11/-10	2011 Dec 29 24:00
+			 13:00	WS	+13/+14
 
 # Solomon Is
 # excludes Bougainville, for which see Papua New Guinea
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Guadalcanal 10:39:48 -	LMT	1912 Oct # Honiara
-			11:00	-	SBT	# Solomon Is Time
+			11:00	-	+11
 
-# Tokelau Is
+# Tokelau
 #
 # From Gwillim Law (2011-12-29)
 # A correspondent informed me that Tokelau, like Samoa, will be skipping
@@ -716,8 +715,8 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fakaofo	-11:24:56 -	LMT	1901
-			-11:00	-	TKT	2011 Dec 30 # Tokelau Time
-			13:00	-	TKT
+			-11:00	-	-11	2011 Dec 30
+			13:00	-	+13
 
 # Tonga
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -736,7 +735,7 @@
 # Tuvalu
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Funafuti	11:56:52 -	LMT	1901
-			12:00	-	TVT	# Tuvalu Time
+			12:00	-	+12
 
 
 # US minor outlying islands
@@ -760,10 +759,11 @@
 
 # Johnston
 #
-# From Paul Eggert (2014-03-11):
+# From Paul Eggert (2017-02-10):
 # Sometimes Johnston kept Hawaii time, and sometimes it was an hour behind.
 # Details are uncertain.  We have no data for Johnston after 1970, so
-# treat it like Hawaii for now.
+# treat it like Hawaii for now.  Since Johnston is now uninhabited,
+# its link to Pacific/Honolulu is in the 'backward' file.
 #
 # In his memoirs of June 6th to October 4, 1945
 # <http://www.315bw.org/Herb_Bach.htm> (2005), Herbert C. Bach writes,
@@ -783,8 +783,6 @@
 # See the table on page 4 where he lists GMT and local times for the tests; a
 # footnote for the JI tests reads that local time is "JI time = Hawaii Time
 # Minus One Hour".
-#
-# See 'northamerica' for Pacific/Johnston.
 
 # Kingman
 # uninhabited
@@ -798,7 +796,7 @@
 # Wake
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Wake	11:06:28 -	LMT	1901
-			12:00	-	WAKT	# Wake Time
+			12:00	-	+12
 
 
 # Vanuatu
@@ -811,12 +809,12 @@
 Rule	Vanuatu	1992	only	-	Oct	Sun>=23	0:00	1:00	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Efate	11:13:16 -	LMT	1912 Jan 13 # Vila
-			11:00	Vanuatu	VU%sT	# Vanuatu Time
+			11:00	Vanuatu	+11/+12
 
 # Wallis and Futuna
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Wallis	12:15:20 -	LMT	1901
-			12:00	-	WFT	# Wallis & Futuna Time
+			12:00	-	+12
 
 ###############################################################################
 
@@ -827,15 +825,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2017-02-10):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -852,28 +850,19 @@
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
 #
-# I invented the abbreviations marked '*' in the following table;
-# the rest are from earlier versions of this file, or from other sources.
+# The following abbreviations are from other sources.
 # Corrections are welcome!
 #		std	dst
 #		LMT		Local Mean Time
 #	  8:00	AWST	AWDT	Western Australia
-#	  8:45	ACWST	ACWDT	Central Western Australia*
-#	  9:00	JST		Japan
 #	  9:30	ACST	ACDT	Central Australia
 #	 10:00	AEST	AEDT	Eastern Australia
+#	 10:00	GST		Guam through 2000
 #	 10:00	ChST		Chamorro
-#	 10:30	LHST	LHDT	Lord Howe*
-#	 11:00	BST		Bougainville*
 #	 11:30	NZMT	NZST	New Zealand through 1945
 #	 12:00	NZST	NZDT	New Zealand 1946-present
-#	 12:15	CHAST		Chatham through 1945*
-#	 12:45	CHAST	CHADT	Chatham 1946-present*
-#	 13:00	WSST	WSDT	(western) Samoa 2011-present*
-#	-11:30	WSST		Western Samoa through 1950*
 #	-11:00	SST		Samoa
 #	-10:00	HST		Hawaii
-#	- 8:00	PST		Pitcairn*
 #
 # See the 'northamerica' file for Hawaii.
 # See the 'southamerica' file for Easter I and the Galápagos Is.
diff --git a/jdk/make/data/tzdata/backward b/jdk/make/data/tzdata/backward
index ec96c7e..b4cf3be 100644
--- a/jdk/make/data/tzdata/backward
+++ b/jdk/make/data/tzdata/backward
@@ -119,6 +119,7 @@
 Link	Pacific/Chatham		NZ-CHAT
 Link	America/Denver		Navajo
 Link	Asia/Shanghai		PRC
+Link	Pacific/Honolulu	Pacific/Johnston
 Link	Pacific/Pohnpei		Pacific/Ponape
 Link	Pacific/Pago_Pago	Pacific/Samoa
 Link	Pacific/Chuuk		Pacific/Truk
diff --git a/jdk/make/data/tzdata/europe b/jdk/make/data/tzdata/europe
index 9cede59..0d8a40e 100644
--- a/jdk/make/data/tzdata/europe
+++ b/jdk/make/data/tzdata/europe
@@ -29,15 +29,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2017-02-10):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -79,26 +79,23 @@
 #	History of Summer Time
 #	<http://pcdsh01.on.br/HISTHV.htm>
 #	(1998-09-21, in Portuguese)
-
 #
 # I invented the abbreviations marked '*' in the following table;
-# the rest are from earlier versions of this file, or from other sources.
-# Corrections are welcome!
-#                   std dst  2dst
-#                   LMT           Local Mean Time
-#       -4:00       AST ADT       Atlantic
-#       -3:00       WGT WGST      Western Greenland*
-#       -1:00       EGT EGST      Eastern Greenland*
-#        0:00       GMT BST  BDST Greenwich, British Summer
-#        0:00       GMT IST       Greenwich, Irish Summer
-#        0:00       WET WEST WEMT Western Europe
-#        0:19:32.13 AMT NST       Amsterdam, Netherlands Summer (1835-1937)*
-#        0:20       NET NEST      Netherlands (1937-1940)*
-#        1:00       BST           British Standard (1968-1971)
-#        1:00       CET CEST CEMT Central Europe
-#        1:00:14    SET           Swedish (1879-1899)*
-#        2:00       EET EEST      Eastern Europe
-#        3:00       MSK MSD       Moscow
+# the rest are variants of the "xMT" pattern for a city's mean time,
+# or are from other sources.  Corrections are welcome!
+#                   std  dst  2dst
+#                   LMT             Local Mean Time
+#       -4:00       AST  ADT        Atlantic
+#        0:00       GMT  BST  BDST  Greenwich, British Summer
+#        0:00       GMT  IST        Greenwich, Irish Summer
+#        0:00       WET  WEST WEMT  Western Europe
+#        0:19:32.13 AMT* NST*       Amsterdam, Netherlands Summer (1835-1937)
+#        1:00       BST             British Standard (1968-1971)
+#        1:00       CET  CEST CEMT  Central Europe
+#        1:00:14    SET             Swedish (1879-1899)
+#        1:36:34    RMT* LST*       Riga, Latvian Summer (1880-1926)*
+#        2:00       EET  EEST       Eastern Europe
+#        3:00       MSK  MSD  MDST* Moscow
 
 # From Peter Ilieve (1994-12-04),
 # The original six [EU members]: Belgium, France, (West) Germany, Italy,
@@ -498,7 +495,7 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Dublin	-0:25:00 -	LMT	1880 Aug  2
-			-0:25:21 -	DMT	1916 May 21  2:00
+			-0:25:21 -	DMT	1916 May 21  2:00 # Dublin MT
 			-0:25:21 1:00	IST	1916 Oct  1  2:00s
 			 0:00	GB-Eire	%s	1921 Dec  6 # independence
 			 0:00	GB-Eire	GMT/IST	1940 Feb 25  2:00
@@ -1087,16 +1084,16 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Danmarkshavn -1:14:40 -	LMT	1916 Jul 28
-			-3:00	-	WGT	1980 Apr  6  2:00
-			-3:00	EU	WG%sT	1996
+			-3:00	-	-03	1980 Apr  6  2:00
+			-3:00	EU	-03/-02	1996
 			0:00	-	GMT
 Zone America/Scoresbysund -1:27:52 -	LMT	1916 Jul 28 # Ittoqqortoormiit
-			-2:00	-	CGT	1980 Apr  6  2:00
-			-2:00	C-Eur	CG%sT	1981 Mar 29
-			-1:00	EU	EG%sT
+			-2:00	-	-02	1980 Apr  6  2:00
+			-2:00	C-Eur	-02/-01	1981 Mar 29
+			-1:00	EU	-01/+00
 Zone America/Godthab	-3:26:56 -	LMT	1916 Jul 28 # Nuuk
-			-3:00	-	WGT	1980 Apr  6  2:00
-			-3:00	EU	WG%sT
+			-3:00	-	-03	1980 Apr  6  2:00
+			-3:00	EU	-03/-02
 Zone America/Thule	-4:35:08 -	LMT	1916 Jul 28 # Pituffik air base
 			-4:00	Thule	A%sT
 
@@ -1511,7 +1508,7 @@
 Rule	Iceland	1967	only	-	Oct	29	 1:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Atlantic/Reykjavik	-1:28	-	LMT	1908
-			-1:00	Iceland	IS%sT	1968 Apr  7  1:00s
+			-1:00	Iceland	-01/+00	1968 Apr  7  1:00s
 			 0:00	-	GMT
 
 # Italy
@@ -1975,7 +1972,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Europe/Amsterdam	0:19:32 -	LMT	1835
 			0:19:32	Neth	%s	1937 Jul  1
-			0:20	Neth	NE%sT	1940 May 16  0:00 # Dutch Time
+			0:20	Neth +0020/+0120 1940 May 16  0:00
 			1:00	C-Eur	CE%sT	1945 Apr  2  2:00
 			1:00	Neth	CE%sT	1977
 			1:00	EU	CE%sT
@@ -2192,16 +2189,34 @@
 			 0:00	W-Eur	WE%sT	1992 Sep 27  1:00s
 			 1:00	EU	CE%sT	1996 Mar 31  1:00u
 			 0:00	EU	WE%sT
+# This Zone can be simplified once we assume zic %z.
 Zone Atlantic/Azores	-1:42:40 -	LMT	1884        # Ponta Delgada
 			-1:54:32 -	HMT	1912 Jan  1 # Horta Mean Time
-			-2:00	Port	AZO%sT	1966 Apr  3  2:00  # Azores Time
-			-1:00	Port	AZO%sT	1983 Sep 25  1:00s
-			-1:00	W-Eur	AZO%sT	1992 Sep 27  1:00s
+			-2:00	Port	-02/-01	1942 Apr 25 22:00s
+			-2:00	Port	+00	1942 Aug 15 22:00s
+			-2:00	Port	-02/-01	1943 Apr 17 22:00s
+			-2:00	Port	+00	1943 Aug 28 22:00s
+			-2:00	Port	-02/-01	1944 Apr 22 22:00s
+			-2:00	Port	+00	1944 Aug 26 22:00s
+			-2:00	Port	-02/-01	1945 Apr 21 22:00s
+			-2:00	Port	+00	1945 Aug 25 22:00s
+			-2:00	Port	-02/-01	1966 Apr  3  2:00
+			-1:00	Port	-01/+00	1983 Sep 25  1:00s
+			-1:00	W-Eur	-01/+00	1992 Sep 27  1:00s
 			 0:00	EU	WE%sT	1993 Mar 28  1:00u
-			-1:00	EU	AZO%sT
+			-1:00	EU	-01/+00
+# This Zone can be simplified once we assume zic %z.
 Zone Atlantic/Madeira	-1:07:36 -	LMT	1884        # Funchal
 			-1:07:36 -	FMT	1912 Jan  1 # Funchal Mean Time
-			-1:00	Port	MAD%sT	1966 Apr  3  2:00 # Madeira Time
+			-1:00	Port	-01/+00	1942 Apr 25 22:00s
+			-1:00	Port	+01	1942 Aug 15 22:00s
+			-1:00	Port	-01/+00	1943 Apr 17 22:00s
+			-1:00	Port	+01	1943 Aug 28 22:00s
+			-1:00	Port	-01/+00	1944 Apr 22 22:00s
+			-1:00	Port	+01	1944 Aug 26 22:00s
+			-1:00	Port	-01/+00	1945 Apr 21 22:00s
+			-1:00	Port	+01	1945 Aug 25 22:00s
+			-1:00	Port	-01/+00	1966 Apr  3  2:00
 			 0:00	Port	WE%sT	1983 Sep 25  1:00s
 			 0:00	EU	WE%sT
 
@@ -2559,10 +2574,8 @@
 			 3:00	-	MSK
 
 
-# From Tim Parenti (2014-07-03):
-# Europe/Simferopol covers...
-# **	****	Crimea, Republic of
-# **	****	Sevastopol
+# From Paul Eggert (2016-12-06):
+# Europe/Simferopol covers Crimea.
 
 Zone Europe/Simferopol	 2:16:24 -	LMT	1880
 			 2:16	-	SMT	1924 May  2 # Simferopol Mean T
@@ -3255,46 +3268,77 @@
 # See Europe/Belgrade.
 
 # Spain
+#
+# From Paul Eggert (2016-12-14):
+#
+# The source for Europe/Madrid before 2013 is:
+# Planesas P. La hora oficial en España y sus cambios.
+# Anuario del Observatorio Astronómico de Madrid (2013, in Spanish).
+# http://astronomia.ign.es/rknowsys-theme/images/webAstro/paginas/documentos/Anuario/lahoraoficialenespana.pdf
+# As this source says that historical time in the Canaries is obscure,
+# and it does not discuss Ceuta, stick with Shanks for now for that data.
+#
+# In the 1918 and 1919 fallback transitions in Spain, the clock for
+# the hour-longer day officially kept going after midnight, so that
+# the repeated instances of that day's 00:00 hour were 24 hours apart,
+# with a fallback transition from the second occurrence of 00:59... to
+# the next day's 00:00.  Our data format cannot represent this
+# directly, and instead repeats the first hour of the next day, with a
+# fallback transition from the next day's 00:59... to 00:00.
+
+# From Michael Deckers (2016-12-15):
+# The Royal Decree of 1900-06-26 quoted by Planesas, online at
+# https://www.boe.es/datos/pdfs/BOE//1900/209/A00383-00384.pdf
+# says in its article 5 (my translation):
+# These dispositions will enter into force beginning with the
+# instant at which, according to the time indicated in article 1,
+# the 1st day of January of 1901 will begin.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# For 1917-1919 Whitman gives Apr Sat>=1 - Oct Sat>=1;
-# go with Shanks & Pottenger.
-Rule	Spain	1917	only	-	May	 5	23:00s	1:00	S
-Rule	Spain	1917	1919	-	Oct	 6	23:00s	0	-
-Rule	Spain	1918	only	-	Apr	15	23:00s	1:00	S
-Rule	Spain	1919	only	-	Apr	 5	23:00s	1:00	S
-# Whitman gives 1921 Feb 28 - Oct 14; go with Shanks & Pottenger.
-Rule	Spain	1924	only	-	Apr	16	23:00s	1:00	S
-# Whitman gives 1924 Oct 14; go with Shanks & Pottenger.
-Rule	Spain	1924	only	-	Oct	 4	23:00s	0	-
-Rule	Spain	1926	only	-	Apr	17	23:00s	1:00	S
-# Whitman says no DST in 1929; go with Shanks & Pottenger.
-Rule	Spain	1926	1929	-	Oct	Sat>=1	23:00s	0	-
-Rule	Spain	1927	only	-	Apr	 9	23:00s	1:00	S
-Rule	Spain	1928	only	-	Apr	14	23:00s	1:00	S
-Rule	Spain	1929	only	-	Apr	20	23:00s	1:00	S
-# Whitman gives 1937 Jun 16, 1938 Apr 16, 1940 Apr 13;
-# go with Shanks & Pottenger.
-Rule	Spain	1937	only	-	May	22	23:00s	1:00	S
-Rule	Spain	1937	1939	-	Oct	Sat>=1	23:00s	0	-
-Rule	Spain	1938	only	-	Mar	22	23:00s	1:00	S
-Rule	Spain	1939	only	-	Apr	15	23:00s	1:00	S
-Rule	Spain	1940	only	-	Mar	16	23:00s	1:00	S
-# Whitman says no DST 1942-1945; go with Shanks & Pottenger.
-Rule	Spain	1942	only	-	May	 2	22:00s	2:00	M # Midsummer
-Rule	Spain	1942	only	-	Sep	 1	22:00s	1:00	S
-Rule	Spain	1943	1946	-	Apr	Sat>=13	22:00s	2:00	M
-Rule	Spain	1943	only	-	Oct	 3	22:00s	1:00	S
-Rule	Spain	1944	only	-	Oct	10	22:00s	1:00	S
-Rule	Spain	1945	only	-	Sep	30	 1:00	1:00	S
-Rule	Spain	1946	only	-	Sep	30	 0:00	0	-
+Rule	Spain	1918	only	-	Apr	15	23:00	1:00	S
+Rule	Spain	1918	1919	-	Oct	 6	24:00s	0	-
+Rule	Spain	1919	only	-	Apr	 6	23:00	1:00	S
+Rule	Spain	1924	only	-	Apr	16	23:00	1:00	S
+Rule	Spain	1924	only	-	Oct	 4	24:00s	0	-
+Rule	Spain	1926	only	-	Apr	17	23:00	1:00	S
+Rule	Spain	1926	1929	-	Oct	Sat>=1	24:00s	0	-
+Rule	Spain	1927	only	-	Apr	 9	23:00	1:00	S
+Rule	Spain	1928	only	-	Apr	15	 0:00	1:00	S
+Rule	Spain	1929	only	-	Apr	20	23:00	1:00	S
+# Republican Spain during the civil war; it controlled Madrid until 1939-03-28.
+Rule	Spain	1937	only	-	Jun	16	23:00	1:00	S
+Rule	Spain	1937	only	-	Oct	 2	24:00s	0	-
+Rule	Spain	1938	only	-	Apr	 2	23:00	1:00	S
+Rule	Spain	1938	only	-	Apr	30	23:00	2:00	M
+Rule	Spain	1938	only	-	Oct	 2	24:00	1:00	S
+# The following rules are for unified Spain again.
+#
+# Planesas does not say what happened in Madrid between its fall on
+# 1939-03-28 and the Nationalist spring-forward transition on
+# 1939-04-15.  For lack of better info, assume Madrid's clocks did not
+# change during that period.
+#
+# The first rule is commented out, as it is redundant for Republican Spain.
+#Rule	Spain	1939	only	-	Apr	15	23:00	1:00	S
+Rule	Spain	1939	only	-	Oct	 7	24:00s	0	-
+Rule	Spain	1942	only	-	May	 2	23:00	1:00	S
+Rule	Spain	1942	only	-	Sep	 1	 1:00	0	-
+Rule	Spain	1943	1946	-	Apr	Sat>=13	23:00	1:00	S
+Rule	Spain	1943	1944	-	Oct	Sun>=1	 1:00	0	-
+Rule	Spain	1945	1946	-	Sep	lastSun	 1:00	0	-
 Rule	Spain	1949	only	-	Apr	30	23:00	1:00	S
-Rule	Spain	1949	only	-	Sep	30	 1:00	0	-
-Rule	Spain	1974	1975	-	Apr	Sat>=13	23:00	1:00	S
+Rule	Spain	1949	only	-	Oct	 2	 1:00	0	-
+Rule	Spain	1974	1975	-	Apr	Sat>=12	23:00	1:00	S
 Rule	Spain	1974	1975	-	Oct	Sun>=1	 1:00	0	-
 Rule	Spain	1976	only	-	Mar	27	23:00	1:00	S
 Rule	Spain	1976	1977	-	Sep	lastSun	 1:00	0	-
-Rule	Spain	1977	1978	-	Apr	 2	23:00	1:00	S
-Rule	Spain	1978	only	-	Oct	 1	 1:00	0	-
+Rule	Spain	1977	only	-	Apr	 2	23:00	1:00	S
+Rule	Spain	1978	only	-	Apr	 2	 2:00s	1:00	S
+Rule	Spain	1978	only	-	Oct	 1	 2:00s	0	-
+# Nationalist Spain during the civil war
+#Rule NatSpain	1937	only	-	May	22	23:00	1:00	S
+#Rule NatSpain	1937	1938	-	Oct	Sat>=1	24:00s	0	-
+#Rule NatSpain	1938	only	-	Mar	26	23:00	1:00	S
 # The following rules are copied from Morocco from 1967 through 1978.
 Rule SpainAfrica 1967	only	-	Jun	 3	12:00	1:00	S
 Rule SpainAfrica 1967	only	-	Oct	 1	 0:00	0	-
@@ -3306,11 +3350,11 @@
 Rule SpainAfrica 1978	only	-	Jun	 1	 0:00	1:00	S
 Rule SpainAfrica 1978	only	-	Aug	 4	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Madrid	-0:14:44 -	LMT	1901 Jan  1  0:00s
-			 0:00	Spain	WE%sT	1946 Sep 30
+Zone	Europe/Madrid	-0:14:44 -	LMT	1900 Dec 31 23:45:16
+			 0:00	Spain	WE%sT	1940 Mar 16 23:00
 			 1:00	Spain	CE%sT	1979
 			 1:00	EU	CE%sT
-Zone	Africa/Ceuta	-0:21:16 -	LMT	1901
+Zone	Africa/Ceuta	-0:21:16 -	LMT	1900 Dec 31 23:38:44
 			 0:00	-	WET	1918 May  6 23:00
 			 0:00	1:00	WEST	1918 Oct  7 23:00
 			 0:00	-	WET	1924
@@ -3319,7 +3363,7 @@
 			 1:00	-	CET	1986
 			 1:00	EU	CE%sT
 Zone	Atlantic/Canary	-1:01:36 -	LMT	1922 Mar # Las Palmas de Gran C.
-			-1:00	-	CANT	1946 Sep 30  1:00 # Canaries T
+			-1:00	-	-01	1946 Sep 30  1:00
 			 0:00	-	WET	1980 Apr  6  0:00s
 			 0:00	1:00	WEST	1980 Sep 28  1:00u
 			 0:00	EU	WE%sT
@@ -3732,7 +3776,7 @@
 # spelling, except omit the apostrophe as it is not allowed in
 # portable Posix file names.
 Zone Europe/Zaporozhye	2:20:40 -	LMT	1880
-			2:20	-	CUT	1924 May  2 # Central Ukraine T
+			2:20	-	+0220	1924 May  2
 			2:00	-	EET	1930 Jun 21
 			3:00	-	MSK	1941 Aug 25
 			1:00	C-Eur	CE%sT	1943 Oct 25
diff --git a/jdk/make/data/tzdata/iso3166.tab b/jdk/make/data/tzdata/iso3166.tab
index 004a4a7..38a3a1e 100644
--- a/jdk/make/data/tzdata/iso3166.tab
+++ b/jdk/make/data/tzdata/iso3166.tab
@@ -32,8 +32,8 @@
 # All text uses UTF-8 encoding.  The columns of the table are as follows:
 #
 # 1.  ISO 3166-1 alpha-2 country code, current as of
-#     ISO 3166-1 Newsletter VI-16 (2013-07-11).  See: Updates on ISO 3166
-#   http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm
+#     ISO 3166-1 N905 (2016-11-15).  See: Updates on ISO 3166-1
+#     http://isotc.iso.org/livelink/livelink/Open/16944257
 # 2.  The usual English name for the coded region,
 #     chosen so that alphabetic sorting of subsets produces helpful lists.
 #     This is not the same as the English name in the ISO 3166 tables.
diff --git a/jdk/make/data/tzdata/leapseconds b/jdk/make/data/tzdata/leapseconds
index 71d774d..3823c9a 100644
--- a/jdk/make/data/tzdata/leapseconds
+++ b/jdk/make/data/tzdata/leapseconds
@@ -81,5 +81,5 @@
 Leap	2015	Jun	30	23:59:60	+	S
 Leap	2016	Dec	31	23:59:60	+	S
 
-#	Updated through IERS Bulletin C52
-#	File expires on:  28 June 2017
+#	Updated through IERS Bulletin C53
+#	File expires on:  28 December 2017
diff --git a/jdk/make/data/tzdata/northamerica b/jdk/make/data/tzdata/northamerica
index 56b089c..d59d270 100644
--- a/jdk/make/data/tzdata/northamerica
+++ b/jdk/make/data/tzdata/northamerica
@@ -201,22 +201,6 @@
 Zone	MST7MDT		 -7:00	US	M%sT
 Zone	PST8PDT		 -8:00	US	P%sT
 
-# From Bob Devine (1988-01-28):
-# ...Alaska (and Hawaii) had the timezone names changed in 1967.
-#    old			 new
-#    Pacific Standard Time(PST)  -same-
-#    Yukon Standard Time(YST)    -same-
-#    Central Alaska S.T. (CAT)   Alaska-Hawaii St[an]dard Time (AHST)
-#    Nome Standard Time (NT)     Bering Standard Time (BST)
-#
-# ...Alaska's timezone lines were redrawn in 1983 to give only 2 tz.
-#    The YST zone now covers nearly all of the state, AHST just part
-#    of the Aleutian islands.   No DST.
-
-# From Paul Eggert (1995-12-19):
-# The tables below use 'NST', not 'NT', for Nome Standard Time.
-# I invented 'CAWT' for Central Alaska War Time.
-
 # From U. S. Naval Observatory (1989-01-19):
 # USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
 # USA  EASTERN       4 H  BEHIND UTC    APR 3 - OCT 30
@@ -273,6 +257,21 @@
 #	Samoa standard time
 # The law doesn't give abbreviations.
 #
+# From Paul Eggert (2016-12-19):
+# Here are URLs for the 1918 and 1966 legislation:
+# http://uscode.house.gov/statviewer.htm?volume=40&page=451
+# http://uscode.house.gov/statviewer.htm?volume=80&page=108
+# Although the 1918 names were officially "United States Standard
+# Eastern Time" and similarly for "Central", "Mountain", "Pacific",
+# and "Alaska", in practice "Standard" was placed just before "Time",
+# as codified in 1966.  In practice, Alaska time was abbreviated "AST"
+# before 1968.  Summarizing the 1967 name changes:
+#	1918 names			1967 names
+#  -08	Standard Pacific Time (PST)	Pacific standard time (PST)
+#  -09	(unofficial) Yukon (YST)	Yukon standard time (YST)
+#  -10	Standard Alaska Time (AST)	Alaska-Hawaii standard time (AHST)
+#  -11	(unofficial) Nome (NST)		Bering standard time (BST)
+#
 # From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
 # Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time"
 # for time in Guam and the Northern Marianas.  See the file "australasia".
@@ -328,6 +327,15 @@
 # Roberts, city administrator in Phenix City. as saying "We are in the Central
 # time zone, but we do go by the Eastern time zone because so many people work
 # in Columbus."
+#
+# From Paul Eggert (2017-02-22):
+# Four cities are involved.  The two not mentioned above are Smiths Station
+# and Valley.  Barbara Brooks, Valley's assistant treasurer, heard it started
+# because West Point Pepperell textile mills were in Alabama while the
+# corporate office was in Georgia, and residents voted to keep Eastern
+# time even after the mills closed.  See: Kazek K. Did you know which
+# Alabama towns are in a different time zone?  al.com 2017-02-06.
+# http://www.al.com/living/index.ssf/2017/02/do_you_know_which_alabama_town.html
 
 # From Paul Eggert (2014-09-06):
 # Monthly Notices of the Royal Astronomical Society 44, 4 (1884-02-08), 208
@@ -505,7 +513,7 @@
 			-8:00	US	P%sT
 
 # Alaska
-# AK%sT is the modern abbreviation for -9:00 per USNO.
+# AK%sT is the modern abbreviation for -09 per USNO.
 #
 # From Paul Eggert (2001-05-30):
 # Howse writes that Alaska switched from the Julian to the Gregorian calendar,
@@ -611,10 +619,8 @@
 			 -9:00	US	AK%sT
 Zone America/Anchorage	 14:00:24 -	LMT	1867 Oct 18
 			 -9:59:36 -	LMT	1900 Aug 20 12:00
-			-10:00	-	CAT	1942
-			-10:00	US	CAT/CAWT 1945 Aug 14 23:00u
-			-10:00	US	CAT/CAPT 1946 # Peace
-			-10:00	-	CAT	1967 Apr
+			-10:00	-	AST	1942
+			-10:00	US	A%sT	1967 Apr
 			-10:00	-	AHST	1969
 			-10:00	US	AH%sT	1983 Oct 30  2:00
 			 -9:00	US	Y%sT	1983 Nov 30
@@ -703,7 +709,6 @@
 			-10:30	1:00	HDT	1945 Sep 30  2:00
 			-10:30	-	HST	1947 Jun  8  2:00
 			-10:00	-	HST
-Link Pacific/Honolulu Pacific/Johnston
 
 # Now we turn to US areas that have diverged from the consensus since 1970.
 
@@ -1091,15 +1096,15 @@
 ################################################################################
 
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2017-02-10):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -2757,15 +2762,15 @@
 # Belize
 # Whitman entirely disagrees with Shanks; go with Shanks & Pottenger.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Belize	1918	1942	-	Oct	Sun>=2	0:00	0:30	HD
-Rule	Belize	1919	1943	-	Feb	Sun>=9	0:00	0	S
-Rule	Belize	1973	only	-	Dec	 5	0:00	1:00	D
-Rule	Belize	1974	only	-	Feb	 9	0:00	0	S
-Rule	Belize	1982	only	-	Dec	18	0:00	1:00	D
-Rule	Belize	1983	only	-	Feb	12	0:00	0	S
+Rule	Belize	1918	1942	-	Oct	Sun>=2	0:00	0:30	-0530
+Rule	Belize	1919	1943	-	Feb	Sun>=9	0:00	0	CST
+Rule	Belize	1973	only	-	Dec	 5	0:00	1:00	CDT
+Rule	Belize	1974	only	-	Feb	 9	0:00	0	CST
+Rule	Belize	1982	only	-	Dec	18	0:00	1:00	CDT
+Rule	Belize	1983	only	-	Feb	12	0:00	0	CST
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Belize	-5:52:48 -	LMT	1912 Apr
-			-6:00	Belize	C%sT
+			-6:00	Belize	%s
 
 # Bermuda
 
@@ -3037,16 +3042,16 @@
 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	DR	1966	only	-	Oct	30	0:00	1:00	D
-Rule	DR	1967	only	-	Feb	28	0:00	0	S
-Rule	DR	1969	1973	-	Oct	lastSun	0:00	0:30	HD
-Rule	DR	1970	only	-	Feb	21	0:00	0	S
-Rule	DR	1971	only	-	Jan	20	0:00	0	S
-Rule	DR	1972	1974	-	Jan	21	0:00	0	S
+Rule	DR	1966	only	-	Oct	30	0:00	1:00	EDT
+Rule	DR	1967	only	-	Feb	28	0:00	0	EST
+Rule	DR	1969	1973	-	Oct	lastSun	0:00	0:30	-0430
+Rule	DR	1970	only	-	Feb	21	0:00	0	EST
+Rule	DR	1971	only	-	Jan	20	0:00	0	EST
+Rule	DR	1972	1974	-	Jan	21	0:00	0	EST
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Santo_Domingo -4:39:36 -	LMT	1890
 			-4:40	-	SDMT	1933 Apr  1 12:00 # S. Dom. MT
-			-5:00	DR	E%sT	1974 Oct 27
+			-5:00	DR	%s	1974 Oct 27
 			-4:00	-	AST	2000 Oct 29  2:00
 			-5:00	US	E%sT	2000 Dec  3  1:00
 			-4:00	-	AST
@@ -3157,6 +3162,12 @@
 # http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
 # http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
 
+# From Steffen Thorsen (2017-03-12):
+# We have received 4 mails from different people telling that Haiti
+# has started DST again today, and this source seems to confirm that,
+# I have not been able to find a more authoritative source:
+# https://www.haitilibre.com/en/news-20319-haiti-notices-time-change-in-haiti.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Haiti	1983	only	-	May	8	0:00	1:00	D
 Rule	Haiti	1984	1987	-	Apr	lastSun	0:00	1:00	D
@@ -3169,6 +3180,8 @@
 Rule	Haiti	2005	2006	-	Oct	lastSun	0:00	0	S
 Rule	Haiti	2012	2015	-	Mar	Sun>=8	2:00	1:00	D
 Rule	Haiti	2012	2015	-	Nov	Sun>=1	2:00	0	S
+Rule	Haiti	2017	max	-	Mar	Sun>=8	2:00	1:00	D
+Rule	Haiti	2017	max	-	Nov	Sun>=1	2:00	0	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Port-au-Prince -4:49:20 -	LMT	1890
 			-4:49	-	PPMT	1917 Jan 24 12:00 # P-a-P MT
@@ -3336,8 +3349,8 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15 # St Pierre
 			-4:00	-	AST	1980 May
-			-3:00	-	PMST	1987 # Pierre & Miquelon Time
-			-3:00	Canada	PM%sT
+			-3:00	-	-03	1987
+			-3:00	Canada	-03/-02
 
 # St Vincent and the Grenadines
 # See America/Port_of_Spain.
diff --git a/jdk/make/data/tzdata/southamerica b/jdk/make/data/tzdata/southamerica
index bbc0a95..44dbd95 100644
--- a/jdk/make/data/tzdata/southamerica
+++ b/jdk/make/data/tzdata/southamerica
@@ -29,15 +29,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2016-12-05):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -47,32 +47,10 @@
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
 # http://www.jstor.org/stable/1774359
 #
-# Earlier editions of these tables used the North American style (e.g. ARST and
-# ARDT for Argentine Standard and Daylight Time), but the following quote
-# suggests that it's better to use European style (e.g. ART and ARST).
-#	I suggest the use of _Summer time_ instead of the more cumbersome
-#	_daylight-saving time_.  _Summer time_ seems to be in general use
-#	in Europe and South America.
-#	-- E O Cutler, _New York Times_ (1937-02-14), quoted in
-#	H L Mencken, _The American Language: Supplement I_ (1960), p 466
-#
-# Earlier editions of these tables also used the North American style
-# for time zones in Brazil, but this was incorrect, as Brazilians say
-# "summer time".  Reinaldo Goulart, a São Paulo businessman active in
-# the railroad sector, writes (1999-07-06):
-#	The subject of time zones is currently a matter of discussion/debate in
-#	Brazil.  Let's say that "the Brasília time" is considered the
-#	"official time" because Brasília is the capital city.
-#	The other three time zones are called "Brasília time "minus one" or
-#	"plus one" or "plus two".  As far as I know there is no such
-#	name/designation as "Eastern Time" or "Central Time".
-# So I invented the following (English-language) abbreviations for now.
-# Corrections are welcome!
-#		std	dst
-#	-2:00	FNT	FNST	Fernando de Noronha
-#	-3:00	BRT	BRST	Brasília
-#	-4:00	AMT	AMST	Amazon
-#	-5:00	ACT	ACST	Acre
+# These tables use numeric abbreviations like -03 and -0330 for
+# integer hour and minute UTC offsets.  Although earlier editions used
+# alphabetic time zone abbreviations, these abbreviations were
+# invented and did not reflect common practice.
 
 ###############################################################################
 
@@ -407,12 +385,6 @@
 #
 # So I guess a new set of rules, besides "Arg", must be made and the last
 # America/Argentina/San_Luis entries should change to use these...
-#
-# I'm enclosing a patch that does what I say... regretfully, the San Luis
-# timezone must be called "WART/WARST" even when most of the time (like,
-# right now) WARST == ART... that is, since last Sunday, all the country
-# is using UTC-3, but in my patch, San Luis calls it "WARST" and the rest
-# of the country calls it "ART".
 # ...
 
 # From Alexander Krivenyshev (2010-04-09):
@@ -451,11 +423,11 @@
 # Buenos Aires (BA), Capital Federal (CF),
 Zone America/Argentina/Buenos_Aires -3:53:48 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May    # Córdoba Mean Time
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	Arg	-03/-02
 #
 # Córdoba (CB), Santa Fe (SF), Entre Ríos (ER), Corrientes (CN), Misiones (MN),
 # Chaco (CC), Formosa (FM), Santiago del Estero (SE)
@@ -469,113 +441,113 @@
 #
 Zone America/Argentina/Cordoba -4:16:48 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  3
+			-4:00	-	-04	1991 Oct 20
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	Arg	-03/-02
 #
 # Salta (SA), La Pampa (LP), Neuquén (NQ), Rio Negro (RN)
 Zone America/Argentina/Salta -4:21:40 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  3
+			-4:00	-	-04	1991 Oct 20
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Tucumán (TM)
 Zone America/Argentina/Tucuman -4:20:52 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 13
-			-3:00	Arg	AR%sT
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  3
+			-4:00	-	-04	1991 Oct 20
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 Jun  1
+			-4:00	-	-04	2004 Jun 13
+			-3:00	Arg	-03/-02
 #
 # La Rioja (LR)
 Zone America/Argentina/La_Rioja -4:27:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  1
-			-4:00	-	WART	1991 May  7
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  1
+			-4:00	-	-04	1991 May  7
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 Jun  1
+			-4:00	-	-04	2004 Jun 20
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # San Juan (SJ)
 Zone America/Argentina/San_Juan -4:34:04 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  1
-			-4:00	-	WART	1991 May  7
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 May 31
-			-4:00	-	WART	2004 Jul 25
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  1
+			-4:00	-	-04	1991 May  7
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 May 31
+			-4:00	-	-04	2004 Jul 25
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Jujuy (JY)
 Zone America/Argentina/Jujuy -4:21:12 -	LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1990 Mar  4
-			-4:00	-	WART	1990 Oct 28
-			-4:00	1:00	WARST	1991 Mar 17
-			-4:00	-	WART	1991 Oct  6
-			-3:00	1:00	ARST	1992
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1990 Mar  4
+			-4:00	-	-04	1990 Oct 28
+			-4:00	1:00	-03	1991 Mar 17
+			-4:00	-	-04	1991 Oct  6
+			-3:00	1:00	-02	1992
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Catamarca (CT), Chubut (CH)
 Zone America/Argentina/Catamarca -4:23:08 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  3
+			-4:00	-	-04	1991 Oct 20
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 Jun  1
+			-4:00	-	-04	2004 Jun 20
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Mendoza (MZ)
 Zone America/Argentina/Mendoza -4:35:16 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1990 Mar  4
-			-4:00	-	WART	1990 Oct 15
-			-4:00	1:00	WARST	1991 Mar  1
-			-4:00	-	WART	1991 Oct 15
-			-4:00	1:00	WARST	1992 Mar  1
-			-4:00	-	WART	1992 Oct 18
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 May 23
-			-4:00	-	WART	2004 Sep 26
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1990 Mar  4
+			-4:00	-	-04	1990 Oct 15
+			-4:00	1:00	-03	1991 Mar  1
+			-4:00	-	-04	1991 Oct 15
+			-4:00	1:00	-03	1992 Mar  1
+			-4:00	-	-04	1992 Oct 18
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 May 23
+			-4:00	-	-04	2004 Sep 26
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # San Luis (SL)
 
@@ -584,44 +556,44 @@
 
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1990
-			-3:00	1:00	ARST	1990 Mar 14
-			-4:00	-	WART	1990 Oct 15
-			-4:00	1:00	WARST	1991 Mar  1
-			-4:00	-	WART	1991 Jun  1
-			-3:00	-	ART	1999 Oct  3
-			-4:00	1:00	WARST	2000 Mar  3
-			-3:00	-	ART	2004 May 31
-			-4:00	-	WART	2004 Jul 25
-			-3:00	Arg	AR%sT	2008 Jan 21
-			-4:00	SanLuis	WAR%sT	2009 Oct 11
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1990
+			-3:00	1:00	-02	1990 Mar 14
+			-4:00	-	-04	1990 Oct 15
+			-4:00	1:00	-03	1991 Mar  1
+			-4:00	-	-04	1991 Jun  1
+			-3:00	-	-03	1999 Oct  3
+			-4:00	1:00	-03	2000 Mar  3
+			-3:00	-	-03	2004 May 31
+			-4:00	-	-04	2004 Jul 25
+			-3:00	Arg	-03/-02	2008 Jan 21
+			-4:00	SanLuis	-04/-03	2009 Oct 11
+			-3:00	-	-03
 #
 # Santa Cruz (SC)
 Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May    # Córdoba Mean Time
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 Jun  1
+			-4:00	-	-04	2004 Jun 20
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Tierra del Fuego, Antártida e Islas del Atlántico Sur (TF)
 Zone America/Argentina/Ushuaia -4:33:12 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May    # Córdoba Mean Time
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 May 30
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 May 30
+			-4:00	-	-04	2004 Jun 20
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 
 # Aruba
 Link America/Curacao America/Aruba
@@ -631,7 +603,7 @@
 Zone	America/La_Paz	-4:32:36 -	LMT	1890
 			-4:32:36 -	CMT	1931 Oct 15 # Calamarca MT
 			-4:32:36 1:00	BOST	1932 Mar 21 # Bolivia ST
-			-4:00	-	BOT	# Bolivia Time
+			-4:00	-	-04
 
 # Brazil
 
@@ -983,12 +955,12 @@
 #
 # Fernando de Noronha (administratively part of PE)
 Zone America/Noronha	-2:09:40 -	LMT	1914
-			-2:00	Brazil	FN%sT	1990 Sep 17
-			-2:00	-	FNT	1999 Sep 30
-			-2:00	Brazil	FN%sT	2000 Oct 15
-			-2:00	-	FNT	2001 Sep 13
-			-2:00	Brazil	FN%sT	2002 Oct  1
-			-2:00	-	FNT
+			-2:00	Brazil	-02/-01	1990 Sep 17
+			-2:00	-	-02	1999 Sep 30
+			-2:00	Brazil	-02/-01	2000 Oct 15
+			-2:00	-	-02	2001 Sep 13
+			-2:00	Brazil	-02/-01	2002 Oct  1
+			-2:00	-	-02
 # Other Atlantic islands have no permanent settlement.
 # These include Trindade and Martim Vaz (administratively part of ES),
 # Rocas Atoll (RN), and the St Peter and St Paul Archipelago (PE).
@@ -1001,119 +973,119 @@
 # In the north a very small part from the river Javary (now Jari I guess,
 # the border with Amapá) to the Amazon, then to the Xingu.
 Zone America/Belem	-3:13:56 -	LMT	1914
-			-3:00	Brazil	BR%sT	1988 Sep 12
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1988 Sep 12
+			-3:00	-	-03
 #
 # west Pará (PA)
 # West Pará includes Altamira, Óbidos, Prainha, Oriximiná, and Santarém.
 Zone America/Santarem	-3:38:48 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT	2008 Jun 24  0:00
-			-3:00	-	BRT
+			-4:00	Brazil	-04/-03	1988 Sep 12
+			-4:00	-	-04	2008 Jun 24  0:00
+			-3:00	-	-03
 #
 # Maranhão (MA), Piauí (PI), Ceará (CE), Rio Grande do Norte (RN),
 # Paraíba (PB)
 Zone America/Fortaleza	-2:34:00 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 22
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1990 Sep 17
+			-3:00	-	-03	1999 Sep 30
+			-3:00	Brazil	-03/-02	2000 Oct 22
+			-3:00	-	-03	2001 Sep 13
+			-3:00	Brazil	-03/-02	2002 Oct  1
+			-3:00	-	-03
 #
 # Pernambuco (PE) (except Atlantic islands)
 Zone America/Recife	-2:19:36 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 15
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1990 Sep 17
+			-3:00	-	-03	1999 Sep 30
+			-3:00	Brazil	-03/-02	2000 Oct 15
+			-3:00	-	-03	2001 Sep 13
+			-3:00	Brazil	-03/-02	2002 Oct  1
+			-3:00	-	-03
 #
 # Tocantins (TO)
 Zone America/Araguaina	-3:12:48 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1995 Sep 14
-			-3:00	Brazil	BR%sT	2003 Sep 24
-			-3:00	-	BRT	2012 Oct 21
-			-3:00	Brazil	BR%sT	2013 Sep
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1990 Sep 17
+			-3:00	-	-03	1995 Sep 14
+			-3:00	Brazil	-03/-02	2003 Sep 24
+			-3:00	-	-03	2012 Oct 21
+			-3:00	Brazil	-03/-02	2013 Sep
+			-3:00	-	-03
 #
 # Alagoas (AL), Sergipe (SE)
 Zone America/Maceio	-2:22:52 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1995 Oct 13
-			-3:00	Brazil	BR%sT	1996 Sep  4
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 22
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1990 Sep 17
+			-3:00	-	-03	1995 Oct 13
+			-3:00	Brazil	-03/-02	1996 Sep  4
+			-3:00	-	-03	1999 Sep 30
+			-3:00	Brazil	-03/-02	2000 Oct 22
+			-3:00	-	-03	2001 Sep 13
+			-3:00	Brazil	-03/-02	2002 Oct  1
+			-3:00	-	-03
 #
 # Bahia (BA)
 # There are too many Salvadors elsewhere, so use America/Bahia instead
 # of America/Salvador.
 Zone America/Bahia	-2:34:04 -	LMT	1914
-			-3:00	Brazil	BR%sT	2003 Sep 24
-			-3:00	-	BRT	2011 Oct 16
-			-3:00	Brazil	BR%sT	2012 Oct 21
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	2003 Sep 24
+			-3:00	-	-03	2011 Oct 16
+			-3:00	Brazil	-03/-02	2012 Oct 21
+			-3:00	-	-03
 #
 # Goiás (GO), Distrito Federal (DF), Minas Gerais (MG),
 # Espírito Santo (ES), Rio de Janeiro (RJ), São Paulo (SP), Paraná (PR),
 # Santa Catarina (SC), Rio Grande do Sul (RS)
 Zone America/Sao_Paulo	-3:06:28 -	LMT	1914
-			-3:00	Brazil	BR%sT	1963 Oct 23  0:00
-			-3:00	1:00	BRST	1964
-			-3:00	Brazil	BR%sT
+			-3:00	Brazil	-03/-02	1963 Oct 23  0:00
+			-3:00	1:00	-02	1964
+			-3:00	Brazil	-03/-02
 #
 # Mato Grosso do Sul (MS)
 Zone America/Campo_Grande -3:38:28 -	LMT	1914
-			-4:00	Brazil	AM%sT
+			-4:00	Brazil	-04/-03
 #
 # Mato Grosso (MT)
 Zone America/Cuiaba	-3:44:20 -	LMT	1914
-			-4:00	Brazil	AM%sT	2003 Sep 24
-			-4:00	-	AMT	2004 Oct  1
-			-4:00	Brazil	AM%sT
+			-4:00	Brazil	-04/-03	2003 Sep 24
+			-4:00	-	-04	2004 Oct  1
+			-4:00	Brazil	-04/-03
 #
 # Rondônia (RO)
 Zone America/Porto_Velho -4:15:36 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT
+			-4:00	Brazil	-04/-03	1988 Sep 12
+			-4:00	-	-04
 #
 # Roraima (RR)
 Zone America/Boa_Vista	-4:02:40 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT	1999 Sep 30
-			-4:00	Brazil	AM%sT	2000 Oct 15
-			-4:00	-	AMT
+			-4:00	Brazil	-04/-03	1988 Sep 12
+			-4:00	-	-04	1999 Sep 30
+			-4:00	Brazil	-04/-03	2000 Oct 15
+			-4:00	-	-04
 #
 # east Amazonas (AM): Boca do Acre, Jutaí, Manaus, Floriano Peixoto
 # The great circle line from Tabatinga to Porto Acre divides
 # east from west Amazonas.
 Zone America/Manaus	-4:00:04 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT	1993 Sep 28
-			-4:00	Brazil	AM%sT	1994 Sep 22
-			-4:00	-	AMT
+			-4:00	Brazil	-04/-03	1988 Sep 12
+			-4:00	-	-04	1993 Sep 28
+			-4:00	Brazil	-04/-03	1994 Sep 22
+			-4:00	-	-04
 #
 # west Amazonas (AM): Atalaia do Norte, Boca do Maoco, Benjamin Constant,
 #	Eirunepé, Envira, Ipixuna
 Zone America/Eirunepe	-4:39:28 -	LMT	1914
-			-5:00	Brazil	AC%sT	1988 Sep 12
-			-5:00	-	ACT	1993 Sep 28
-			-5:00	Brazil	AC%sT	1994 Sep 22
-			-5:00	-	ACT	2008 Jun 24  0:00
-			-4:00	-	AMT	2013 Nov 10
-			-5:00	-	ACT
+			-5:00	Brazil	-05/-04	1988 Sep 12
+			-5:00	-	-05	1993 Sep 28
+			-5:00	Brazil	-05/-04	1994 Sep 22
+			-5:00	-	-05	2008 Jun 24  0:00
+			-4:00	-	-04	2013 Nov 10
+			-5:00	-	-05
 #
 # Acre (AC)
 Zone America/Rio_Branco	-4:31:12 -	LMT	1914
-			-5:00	Brazil	AC%sT	1988 Sep 12
-			-5:00	-	ACT	2008 Jun 24  0:00
-			-4:00	-	AMT	2013 Nov 10
-			-5:00	-	ACT
+			-5:00	Brazil	-05/-04	1988 Sep 12
+			-5:00	-	-05	2008 Jun 24  0:00
+			-4:00	-	-04	2013 Nov 10
+			-5:00	-	-05
 
 # Chile
 
@@ -1258,6 +1230,18 @@
 # to mean 24:00 mainland time, not 24:00 local time, so that Easter
 # Island is always two hours behind the mainland.
 
+# From Juan Correa (2016-12-04):
+# Magallanes region ... will keep DST (UTC -3) all year round....
+# http://www.soychile.cl/Santiago/Sociedad/2016/12/04/433428/Bachelet-firmo-el-decreto-para-establecer-un-horario-unico-para-la-Region-de-Magallanes.aspx
+#
+# From Deborah Goldsmith (2017-01-19):
+# http://www.diariooficial.interior.gob.cl/publicaciones/2017/01/17/41660/01/1169626.pdf
+# From Paul Eggert (2017-01-19):
+# The above says the Magallanes change expires 2019-05-11 at 24:00,
+# so in theory, they will revert to -04/-03 after that, which means
+# they will switch from -03 to -04 one hour after Santiago does that day.
+# For now, assume that they will not revert.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1931	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1298,22 +1282,35 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Santiago	-4:42:46 -	LMT	1890
 			-4:42:46 -	SMT	1910 Jan 10 # Santiago Mean Time
-			-5:00	-	CLT	1916 Jul  1 # Chile Time
+			-5:00	-	-05	1916 Jul  1
 			-4:42:46 -	SMT	1918 Sep 10
-			-4:00	-	CLT	1919 Jul  1
+			-4:00	-	-04	1919 Jul  1
 			-4:42:46 -	SMT	1927 Sep  1
-			-5:00	Chile	CL%sT	1932 Sep  1
-			-4:00	-	CLT	1942 Jun  1
-			-5:00	-	CLT	1942 Aug  1
-			-4:00	-	CLT	1946 Jul 15
-			-4:00	1:00	CLST	1946 Sep  1 # central Chile
-			-4:00	-	CLT	1947 Apr  1
-			-5:00	-	CLT	1947 May 21 23:00
-			-4:00	Chile	CL%sT
+			-5:00	Chile	-05/-04	1932 Sep  1
+			-4:00	-	-04	1942 Jun  1
+			-5:00	-	-05	1942 Aug  1
+			-4:00	-	-04	1946 Jul 15
+			-4:00	1:00	-03	1946 Sep  1 # central Chile
+			-4:00	-	-04	1947 Apr  1
+			-5:00	-	-05	1947 May 21 23:00
+			-4:00	Chile	-04/-03
+Zone America/Punta_Arenas -4:43:40 -	LMT	1890
+			-4:42:46 -	SMT	1910 Jan 10
+			-5:00	-	-05	1916 Jul  1
+			-4:42:46 -	SMT	1918 Sep 10
+			-4:00	-	-04	1919 Jul  1
+			-4:42:46 -	SMT	1927 Sep  1
+			-5:00	Chile	-05/-04	1932 Sep  1
+			-4:00	-	-04	1942 Jun  1
+			-5:00	-	-05	1942 Aug  1
+			-4:00	-	-04	1947 Apr  1
+			-5:00	-	-05	1947 May 21 23:00
+			-4:00	Chile	-04/-03	2016 Dec  4
+			-3:00	-	-03
 Zone Pacific/Easter	-7:17:28 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
-			-7:00	Chile	EAS%sT	1982 Mar 14 3:00u # Easter Time
-			-6:00	Chile	EAS%sT
+			-7:00	Chile	-07/-06	1982 Mar 14 3:00u # Easter Time
+			-6:00	Chile	-06/-05
 #
 # Salas y Gómez Island is uninhabited.
 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
@@ -1333,9 +1330,10 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Antarctica/Palmer	0	-	-00	1965
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1982 May
-			-4:00	Chile	CL%sT
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1982 May
+			-4:00	Chile	-04/-03	2016 Dec  4
+			-3:00	-	-03
 
 # Colombia
 
@@ -1348,7 +1346,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Bogota	-4:56:16 -	LMT	1884 Mar 13
 			-4:56:16 -	BMT	1914 Nov 23 # Bogotá Mean Time
-			-5:00	CO	CO%sT	# Colombia Time
+			-5:00	CO	-05/-04
 # Malpelo, Providencia, San Andres
 # no information; probably like America/Bogota
 
@@ -1372,7 +1370,7 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Curacao	-4:35:47 -	LMT	1912 Feb 12 # Willemstad
-			-4:30	-	ANT	1965 # Netherlands Antilles Time
+			-4:30	-	-0430	1965
 			-4:00	-	AST
 
 # From Arthur David Olson (2011-06-15):
@@ -1387,19 +1385,32 @@
 #
 # Milne says the Central and South American Telegraph Company used -5:24:15.
 #
-# From Paul Eggert (2007-03-04):
-# Apparently Ecuador had a failed experiment with DST in 1992.
-# <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and
-# <http://www.hoy.com.ec/NoticiaNue.asp?row_id=249856> (2006-11-06) both
-# talk about "hora Sixto".  Leave this alone for now, as we have no data.
+# From Alois Treindl (2016-12-15):
+# http://www.elcomercio.com/actualidad/hora-sixto-1993.html
+# ... Whether the law applied also to Galápagos, I do not know.
+# From Paul Eggert (2016-12-15):
+# http://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
+# This says President Sixto Durán Ballén signed decree No. 285, which
+# established DST from 1992-11-28 to 1993-02-05; it does not give transition
+# times.  The people called it "hora de Sixto" ("Sixto hour").  The change did
+# not go over well; a popular song "Qué hora es" by Jaime Guevara had lyrics
+# that included "Amanecía en mitad de la noche, los guaguas iban a clase sin
+# sol" ("It was dawning in the middle of the night, the buses went to class
+# without sun").  Although Ballén's campaign slogan was "Ni un paso atrás"
+# (Not one step back), the clocks went back in 1993 and the experiment was not
+# repeated.  For now, assume transitions were at 00:00 local time country-wide.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Ecuador	1992	only	-	Nov	28	0:00	1:00	S
+Rule	Ecuador	1993	only	-	Feb	 5	0:00	0	-
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Guayaquil	-5:19:20 -	LMT	1890
 			-5:14:00 -	QMT	1931 # Quito Mean Time
-			-5:00	-	ECT	# Ecuador Time
+			-5:00	Ecuador	-05/-04
 Zone Pacific/Galapagos	-5:58:24 -	LMT	1931 # Puerto Baquerizo Moreno
-			-5:00	-	ECT	1986
-			-6:00	-	GALT	# Galápagos Time
+			-5:00	-	-05	1986
+			-6:00	Ecuador	-06/-05
 
 # Falklands
 
@@ -1499,25 +1510,24 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Atlantic/Stanley	-3:51:24 -	LMT	1890
 			-3:51:24 -	SMT	1912 Mar 12 # Stanley Mean Time
-			-4:00	Falk	FK%sT	1983 May    # Falkland Is Time
-			-3:00	Falk	FK%sT	1985 Sep 15
-			-4:00	Falk	FK%sT	2010 Sep  5  2:00
-			-3:00	-	FKST
+			-4:00	Falk	-04/-03	1983 May
+			-3:00	Falk	-03/-02	1985 Sep 15
+			-4:00	Falk	-04/-03	2010 Sep  5  2:00
+			-3:00	-	-03
 
 # French Guiana
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Cayenne	-3:29:20 -	LMT	1911 Jul
-			-4:00	-	GFT	1967 Oct # French Guiana Time
-			-3:00	-	GFT
+			-4:00	-	-04	1967 Oct
+			-3:00	-	-03
 
 # Guyana
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Guyana	-3:52:40 -	LMT	1915 Mar    # Georgetown
-			-3:45	-	GBGT	1966 May 26 # Br Guiana Time
-			-3:45	-	GYT	1975 Jul 31 # Guyana Time
-			-3:00	-	GYT	1991
+			-3:45	-	-0345	1975 Jul 31
+			-3:00	-	-03	1991
 # IATA SSIM (1996-06) says -4:00.  Assume a 1991 switch.
-			-4:00	-	GYT
+			-4:00	-	-04
 
 # Paraguay
 #
@@ -1609,9 +1619,9 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Asuncion	-3:50:40 -	LMT	1890
 			-3:50:40 -	AMT	1931 Oct 10 # Asunción Mean Time
-			-4:00	-	PYT	1972 Oct    # Paraguay Time
-			-3:00	-	PYT	1974 Apr
-			-4:00	Para	PY%sT
+			-4:00	-	-04	1972 Oct
+			-3:00	-	-03	1974 Apr
+			-4:00	Para	-04/-03
 
 # Peru
 #
@@ -1638,12 +1648,12 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Lima	-5:08:12 -	LMT	1890
 			-5:08:36 -	LMT	1908 Jul 28 # Lima Mean Time?
-			-5:00	Peru	PE%sT	# Peru Time
+			-5:00	Peru	-05/-04
 
 # South Georgia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Atlantic/South_Georgia -2:26:08 -	LMT	1890 # Grytviken
-			-2:00	-	GST	# South Georgia Time
+			-2:00	-	-02
 
 # South Sandwich Is
 # uninhabited; scientific personnel have wintered
@@ -1653,9 +1663,8 @@
 Zone America/Paramaribo	-3:40:40 -	LMT	1911
 			-3:40:52 -	PMT	1935     # Paramaribo Mean Time
 			-3:40:36 -	PMT	1945 Oct    # The capital moved?
-			-3:30	-	NEGT	1975 Nov 20 # Dutch Guiana Time
-			-3:30	-	SRT	1984 Oct    # Suriname Time
-			-3:00	-	SRT
+			-3:30	-	-0330	1984 Oct
+			-3:00	-	-03
 
 # Trinidad and Tobago
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1758,11 +1767,16 @@
 # [dated 2015-06-29; repeals Decree 311/006 dated 2006-09-04]
 Rule	Uruguay	2006	2014	-	Oct	Sun>=1	 2:00	1:00	S
 Rule	Uruguay	2007	2015	-	Mar	Sun>=8	 2:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+
+# This Zone can be simplified once we assume zic %z.
 Zone America/Montevideo	-3:44:44 -	LMT	1898 Jun 28
 			-3:44:44 -	MMT	1920 May  1 # Montevideo MT
-			-3:30	Uruguay	UY%sT	1942 Dec 14 # Uruguay Time
-			-3:00	Uruguay	UY%sT
+			-3:30	Uruguay	-0330/-03 1942 Dec 14
+			-3:00	Uruguay	-03/-02	1968
+			-3:00	Uruguay	-03/-0230 1971
+			-3:00	Uruguay	-03/-02	1974
+			-3:00	Uruguay	-03/-0230 1974 Dec 22
+			-3:00	Uruguay	-03/-02
 
 # Venezuela
 #
@@ -1796,7 +1810,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Caracas	-4:27:44 -	LMT	1890
 			-4:27:40 -	CMT	1912 Feb 12 # Caracas Mean Time?
-			-4:30	-	VET	1965 Jan  1  0:00 # Venezuela T.
-			-4:00	-	VET	2007 Dec  9  3:00
-			-4:30	-	VET	2016 May  1  2:30
-			-4:00	-	VET
+			-4:30	-	-0430	1965 Jan  1  0:00
+			-4:00	-	-04	2007 Dec  9  3:00
+			-4:30	-	-0430	2016 May  1  2:30
+			-4:00	-	-04
diff --git a/jdk/make/data/tzdata/zone.tab b/jdk/make/data/tzdata/zone.tab
index 7255ea5..8d6247d 100644
--- a/jdk/make/data/tzdata/zone.tab
+++ b/jdk/make/data/tzdata/zone.tab
@@ -165,6 +165,7 @@
 CI	+0519-00402	Africa/Abidjan
 CK	-2114-15946	Pacific/Rarotonga
 CL	-3327-07040	America/Santiago	Chile (most areas)
+CL	-5309-07055	America/Punta_Arenas	Region of Magallanes
 CL	-2709-10926	Pacific/Easter	Easter Island
 CM	+0403+00942	Africa/Douala
 CN	+3114+12128	Asia/Shanghai	Beijing Time
@@ -420,7 +421,6 @@
 UA	+4837+02218	Europe/Uzhgorod	Ruthenia
 UA	+4750+03510	Europe/Zaporozhye	Zaporozh'ye/Zaporizhia; Lugansk/Luhansk (east)
 UG	+0019+03225	Africa/Kampala
-UM	+1645-16931	Pacific/Johnston	Johnston Atoll
 UM	+2813-17722	Pacific/Midway	Midway Islands
 UM	+1917+16637	Pacific/Wake	Wake Island
 US	+404251-0740023	America/New_York	Eastern (most areas)
diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk
index 6b5dcf9..9a03f11 100644
--- a/jdk/make/gensrc/GensrcMisc.gmk
+++ b/jdk/make/gensrc/GensrcMisc.gmk
@@ -116,11 +116,13 @@
     JCE_DEFAULT_POLICY = limited
 endif
 
-$(eval $(call SetupTextFileProcessing, BUILD_JCESECURITY_JAVA, \
-    SOURCE_FILES := $(JDK_TOPDIR)/src/java.base/share/classes/javax/crypto/JceSecurity.java.template, \
-    OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/javax/crypto/JceSecurity.java, \
-    REPLACEMENTS := \
+ifneq ($(wildcard $(JDK_TOPDIR)/src/java.base/share/classes/javax/crypto/JceSecurity.java.template), )
+  $(eval $(call SetupTextFileProcessing, BUILD_JCESECURITY_JAVA, \
+      SOURCE_FILES := $(JDK_TOPDIR)/src/java.base/share/classes/javax/crypto/JceSecurity.java.template, \
+      OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/javax/crypto/JceSecurity.java, \
+      REPLACEMENTS := \
         @@JCE_DEFAULT_POLICY@@ => $(JCE_DEFAULT_POLICY), \
-))
+  ))
 
-GENSRC_JAVA_BASE += $(BUILD_JCESECURITY_JAVA)
+  GENSRC_JAVA_BASE += $(BUILD_JCESECURITY_JAVA)
+endif
diff --git a/jdk/make/launcher/Launcher-jdk.pack.gmk b/jdk/make/launcher/Launcher-jdk.pack.gmk
index 2ee08c7..4fe0fdf 100644
--- a/jdk/make/launcher/Launcher-jdk.pack.gmk
+++ b/jdk/make/launcher/Launcher-jdk.pack.gmk
@@ -44,7 +44,7 @@
   UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB
   UNPACKEXE_LIBS := -lz
 else
-  UNPACKEXE_CFLAGS += -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
+  UNPACKEXE_CFLAGS += -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib
   UNPACKEXE_ZIPOBJS := $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zcrc32$(OBJ_SUFFIX) \
       $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/deflate$(OBJ_SUFFIX) \
       $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/trees$(OBJ_SUFFIX) \
diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
index 743422b..9407f91 100644
--- a/jdk/make/lib/Awt2dLibraries.gmk
+++ b/jdk/make/lib/Awt2dLibraries.gmk
@@ -889,7 +889,7 @@
   LIBSPLASHSCREEN_LIBS :=
 
   ifneq ($(USE_EXTERNAL_LIBZ), true)
-    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
+    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib
     LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
   endif
 
diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk
index 3ec5082..5bb9394 100644
--- a/jdk/make/lib/CoreLibraries.gmk
+++ b/jdk/make/lib/CoreLibraries.gmk
@@ -202,7 +202,7 @@
 
 BUILD_LIBZIP_EXCLUDES :=
 ifeq ($(USE_EXTERNAL_LIBZ), true)
-  LIBZIP_EXCLUDES += zlib-1.2.8
+  LIBZIP_EXCLUDES += zlib
 endif
 
 BUILD_LIBZIP_REORDER :=
@@ -343,7 +343,7 @@
 ifneq ($(USE_EXTERNAL_LIBZ), true)
   LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
   LIBJLI_EXTRA_FILES += \
-      $(addprefix $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8/, \
+      $(addprefix $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib/, \
           inflate.c \
           inftrees.c \
           inffast.c \
diff --git a/jdk/make/lib/LibCommon.gmk b/jdk/make/lib/LibCommon.gmk
index f326842..4e1cab9 100644
--- a/jdk/make/lib/LibCommon.gmk
+++ b/jdk/make/lib/LibCommon.gmk
@@ -73,7 +73,7 @@
 ifeq ($(USE_EXTERNAL_LIBZ), true)
   LIBZ := -lz
 else
-  ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
+  ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib
 endif
 
 ###############################################################################
diff --git a/jdk/make/mapfiles/libjava/mapfile-vers b/jdk/make/mapfiles/libjava/mapfile-vers
index c08bc2c..31395f7 100644
--- a/jdk/make/mapfiles/libjava/mapfile-vers
+++ b/jdk/make/mapfiles/libjava/mapfile-vers
@@ -128,7 +128,6 @@
 		Java_java_lang_Class_isInstance;
 		Java_java_lang_Class_registerNatives;
 		Java_java_lang_ClassLoader_findBootstrapClass;
-		Java_java_lang_ClassLoader_defineClass0;
 		Java_java_lang_ClassLoader_defineClass1;
 		Java_java_lang_ClassLoader_defineClass2;
 		Java_java_lang_ClassLoader_findBuiltinLib;
@@ -274,12 +273,12 @@
                 Java_jdk_internal_misc_VM_getRuntimeArguments;
                 Java_jdk_internal_misc_VM_initialize;
 
-                Java_java_lang_reflect_Module_defineModule0;
-                Java_java_lang_reflect_Module_addReads0;
-                Java_java_lang_reflect_Module_addExports0;
-                Java_java_lang_reflect_Module_addExportsToAll0;
-                Java_java_lang_reflect_Module_addExportsToAllUnnamed0;
-                Java_java_lang_reflect_Module_addPackage0;
+                Java_java_lang_Module_defineModule0;
+                Java_java_lang_Module_addReads0;
+                Java_java_lang_Module_addExports0;
+                Java_java_lang_Module_addExportsToAll0;
+                Java_java_lang_Module_addExportsToAllUnnamed0;
+                Java_java_lang_Module_addPackage0;
 
 		Java_jdk_internal_loader_BootLoader_getSystemPackageLocation;
 		Java_jdk_internal_loader_BootLoader_getSystemPackageNames;
diff --git a/jdk/make/rmic/RmicCommon.gmk b/jdk/make/rmic/RmicCommon.gmk
index bfc5b85..2eedfda 100644
--- a/jdk/make/rmic/RmicCommon.gmk
+++ b/jdk/make/rmic/RmicCommon.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 include MakeBase.gmk
 include RMICompilation.gmk
 
-##########################################################################################
+################################################################################
 
 ifeq ($(BOOT_JDK_MODULAR), true)
   RMIC_MAIN_CLASS := -m jdk.rmic/sun.rmi.rmic.Main
@@ -37,12 +37,13 @@
   RMIC_MAIN_CLASS := sun.rmi.rmic.Main
 endif
 
-RMIC := $(JAVA_SMALL) $(INTERIM_OVERRIDE_MODULES_ARGS) $(RMIC_MAIN_CLASS)
+RMIC := $(JAVA_SMALL) $(INTERIM_RMIC_OVERRIDE_MODULES_ARGS) $(RMIC_MAIN_CLASS)
 
 CLASSES_DIR := $(JDK_OUTPUTDIR)/modules
-# NOTE: If the smart javac dependency management is reintroduced, these classes risk
-# interfering with the dependency checking. In that case they will need to be kept separate.
+# NOTE: If the smart javac dependency management is reintroduced, these classes
+# risk interfering with the dependency checking. In that case they will need to
+# be kept separate.
 STUB_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules
 RMIC_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/rmic
 
-##########################################################################################
+################################################################################
diff --git a/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java b/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
index 4de7b5c..8301929 100644
--- a/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
+++ b/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
@@ -25,29 +25,25 @@
 
 package build.tools.jigsaw;
 
+import com.sun.tools.jdeps.ModuleDotGraph;
+
 import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReference;
-import java.lang.module.ResolvedModule;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
-import java.util.TreeSet;
 import java.util.function.Function;
-
-import static java.util.stream.Collectors.*;
-import static java.lang.module.ModuleDescriptor.Requires.Modifier.TRANSITIVE;
+import java.util.stream.Collectors;
 
 /**
  * Generate the DOT file for a module graph for each module in the JDK
@@ -56,238 +52,209 @@
 public class GenGraphs {
 
     public static void main(String[] args) throws Exception {
+        Path dir = null;
+        boolean spec = false;
+        Properties props = null;
+        for (int i=0; i < args.length; i++) {
+            String arg = args[i];
+            if (arg.equals("--spec")) {
+                spec = true;
+            } else if (arg.equals("--dot-attributes")) {
+                if (i++ == args.length) {
+                    throw new IllegalArgumentException("Missing argument: --dot-attributes option");
+                }
+                props = new Properties();
+                props.load(Files.newInputStream(Paths.get(args[i])));
+            } else if (arg.equals("--output")) {
+                dir = ++i < args.length ? Paths.get(args[i]) : null;
+            } else if (arg.startsWith("-")) {
+                throw new IllegalArgumentException("Invalid option: " + arg);
+            }
+        }
 
-        if (args.length != 1) {
-            System.err.println("ERROR: specify the output directory");
+        if (dir == null) {
+            System.err.println("ERROR: must specify --output argument");
             System.exit(1);
         }
-        Path dir = Paths.get(args[0]);
+
         Files.createDirectories(dir);
+        ModuleGraphAttributes attributes;
+        if (props != null) {
+            attributes = new ModuleGraphAttributes(props);
+        } else {
+            attributes = new ModuleGraphAttributes();
+        }
+        GenGraphs genGraphs = new GenGraphs(dir, spec, attributes);
 
+        // print dot file for each module
+        Map<String, Configuration> configurations = new HashMap<>();
+        Set<String> modules = new HashSet<>();
         ModuleFinder finder = ModuleFinder.ofSystem();
-
-        Set<ModuleDescriptor> javaSEModules
-            = new TreeSet<>(finder.findAll().stream()
-                                  .map(ModuleReference::descriptor)
-                                  .filter(m -> (m.name().startsWith("java.") &&
-                                               !m.name().equals("java.smartcardio")))
-                                  .collect(toSet()));
-        Set<ModuleDescriptor> jdkModules
-            = new TreeSet<>(finder.findAll().stream()
-                                  .map(ModuleReference::descriptor)
-                                  .filter(m -> !javaSEModules.contains(m))
-                                  .collect(toSet()));
-
-        GenGraphs genGraphs = new GenGraphs(dir, javaSEModules, jdkModules);
-        Set<String> mods = new HashSet<>();
-        for (ModuleReference mref: finder.findAll()) {
-            mods.add(mref.descriptor().name());
-            genGraphs.genDotFile(mref);
+        for (ModuleReference mref : finder.findAll()) {
+            String name = (mref.descriptor().name());
+            modules.add(name);
+            if (genGraphs.accept(name, mref.descriptor())) {
+                configurations.put(name, Configuration.empty()
+                                                      .resolve(finder,
+                                                               ModuleFinder.of(),
+                                                               Set.of(name)));
+            }
         }
 
-        // all modules
-        genGraphs.genDotFile("jdk", mods);
+        if (genGraphs.accept("jdk", null)) {
+            // print a graph of all JDK modules
+            configurations.put("jdk", Configuration.empty()
+                                                   .resolve(finder,
+                                                            ModuleFinder.of(),
+                                                            modules));
+        }
 
+        genGraphs.genDotFiles(configurations);
     }
 
-    private static final String ORANGE = "#e76f00";
-    private static final String BLUE = "#437291";
-    private static final String GRAY = "#dddddd";
+    /**
+     * Custom dot file attributes.
+     */
+    static class ModuleGraphAttributes implements ModuleDotGraph.Attributes {
+        static Map<String, String> DEFAULT_ATTRIBUTES = Map.of(
+            "ranksep", "0.6",
+            "fontsize", "12",
+            "fontcolor", BLACK,
+            "fontname", "DejaVuSans",
+            "arrowsize", "1",
+            "arrowwidth", "2",
+            "arrowcolor", DARK_GRAY,
+            // custom
+            "requiresMandatedColor", LIGHT_GRAY,
+            "javaSubgraphColor", ORANGE,
+            "jdkSubgraphColor", BLUE
+        );
 
-    private static final String REEXPORTS = "";
-    private static final String REQUIRES = "style=\"dashed\"";
-    private static final String REQUIRES_BASE = "color=\"" + GRAY + "\"";
+        final Map<String, Integer> weights = new HashMap<>();
+        final List<Set<String>> ranks = new ArrayList<>();
+        final Map<String, String> attrs;
+        ModuleGraphAttributes(Map<String, String> attrs) {
+            int h = 1000;
+            weight("java.se", "java.sql.rowset", h * 10);
+            weight("java.sql.rowset", "java.sql", h * 10);
+            weight("java.sql", "java.xml", h * 10);
+            weight("java.xml", "java.base", h * 10);
 
-    private static final Map<String,Integer> weights = new HashMap<>();
-    private static final List<Set<String>> ranks = new ArrayList<>();
+            ranks.add(Set.of("java.logging", "java.scripting", "java.xml"));
+            ranks.add(Set.of("java.sql"));
+            ranks.add(Set.of("java.compiler", "java.instrument"));
+            ranks.add(Set.of("java.desktop", "java.management"));
+            ranks.add(Set.of("java.corba", "java.xml.ws"));
+            ranks.add(Set.of("java.xml.bind", "java.xml.ws.annotation"));
 
-    private static void weight(String s, String t, int w) {
-        weights.put(s + ":" + t, w);
-    }
+            this.attrs = attrs;
+        }
 
-    private static int weightOf(String s, String t) {
-        int w = weights.getOrDefault(s + ":" + t, 1);
-        if (w != 1)
-            return w;
-        if (s.startsWith("java.") && t.startsWith("java."))
-            return 10;
-        return 1;
-    }
+        ModuleGraphAttributes() {
+            this(DEFAULT_ATTRIBUTES);
+        }
+        ModuleGraphAttributes(Properties props) {
+            this(toAttributes(props));
+        }
 
-    static {
-        int h = 1000;
-        weight("java.se", "java.sql.rowset", h * 10);
-        weight("java.sql.rowset", "java.sql", h * 10);
-        weight("java.sql", "java.xml", h * 10);
-        weight("java.xml", "java.base", h * 10);
+        @Override
+        public double rankSep() {
+            return Double.valueOf(attrs.get("ranksep"));
+        }
 
-        ranks.add(Set.of("java.logging", "java.scripting", "java.xml"));
-        ranks.add(Set.of("java.sql"));
-        ranks.add(Set.of("java.compiler", "java.instrument"));
-        ranks.add(Set.of("java.desktop", "java.management"));
-        ranks.add(Set.of("java.corba", "java.xml.ws"));
-        ranks.add(Set.of("java.xml.bind", "java.xml.ws.annotation"));
+        @Override
+        public int fontSize() {
+            return Integer.valueOf(attrs.get("fontsize"));
+        }
 
+        @Override
+        public String fontName() {
+            return attrs.get("fontname");
+        }
+
+        @Override
+        public String fontColor() {
+            return attrs.get("fontcolor");
+        }
+
+        @Override
+        public int arrowSize() {
+            return Integer.valueOf(attrs.get("arrowsize"));
+        }
+
+        @Override
+        public int arrowWidth() {
+            return Integer.valueOf(attrs.get("arrowwidth"));
+        }
+
+        @Override
+        public String arrowColor() {
+            return attrs.get("arrowcolor");
+        }
+
+        @Override
+        public List<Set<String>> ranks() {
+            return ranks;
+        }
+
+        @Override
+        public String requiresMandatedColor() {
+            return attrs.get("requiresMandatedColor");
+        }
+
+        @Override
+        public String javaSubgraphColor() {
+            return attrs.get("javaSubgraphColor");
+        }
+
+        @Override
+        public String jdkSubgraphColor() {
+            return attrs.get("jdkSubgraphColor");
+        }
+
+        @Override
+        public int weightOf(String s, String t) {
+            int w = weights.getOrDefault(s + ":" + t, 1);
+            if (w != 1)
+                return w;
+            if (s.startsWith("java.") && t.startsWith("java."))
+                return 10;
+            return 1;
+        }
+
+        public void weight(String s, String t, int w) {
+            weights.put(s + ":" + t, w);
+        }
+
+        static Map<String, String> toAttributes(Properties props) {
+            return DEFAULT_ATTRIBUTES.keySet().stream()
+                .collect(Collectors.toMap(Function.identity(),
+                    k -> props.getProperty(k, DEFAULT_ATTRIBUTES.get(k))));
+        }
     }
 
     private final Path dir;
-    private final Set<ModuleDescriptor> javaGroup;
-    private final Set<ModuleDescriptor> jdkGroup;
-
-    GenGraphs(Path dir, Set<ModuleDescriptor> javaGroup, Set<ModuleDescriptor> jdkGroup) {
+    private final boolean spec;
+    private final ModuleGraphAttributes attributes;
+    GenGraphs(Path dir, boolean spec, ModuleGraphAttributes attributes) {
         this.dir = dir;
-        this.javaGroup = Collections.unmodifiableSet(javaGroup);
-        this.jdkGroup = Collections.unmodifiableSet(jdkGroup);
+        this.spec = spec;
+        this.attributes = attributes;
+    }
+
+    void genDotFiles(Map<String, Configuration> configurations) throws IOException {
+        ModuleDotGraph dotGraph = new ModuleDotGraph(configurations, spec);
+        dotGraph.genDotFiles(dir, attributes);
     }
 
     /**
-     * Generates a dot file for the given module reference as the root.
+     * Returns true for any name if generating graph for non-spec;
+     * otherwise, returns true except "jdk" and name with "jdk.internal." prefix
      */
-    void genDotFile(ModuleReference mref) throws IOException {
-        String name = mref.descriptor().name();
-        genDotFile(name, Set.of(name));
-    }
+    boolean accept(String name, ModuleDescriptor descriptor) {
+        if (!spec)
+            return true;
 
-    /**
-     * Generates a dot file for the given set of root modules.
-     */
-    void genDotFile(String name, Set<String> roots) throws IOException {
-        Configuration cf =
-            Configuration.empty().resolveRequires(ModuleFinder.ofSystem(),
-                                                  ModuleFinder.of(),
-                                                  roots);
-
-        Set<ModuleDescriptor> mds = cf.modules().stream()
-                .map(ResolvedModule::reference)
-                .map(ModuleReference::descriptor)
-                .collect(toSet());
-
-        // generate a dot file for the resolved graph
-        try (OutputStream os = Files.newOutputStream(dir.resolve(name + ".dot"));
-             PrintStream out = new PrintStream(os)) {
-            printGraph(out, name, gengraph(cf),
-                       mds.stream()
-                          .collect(toMap(ModuleDescriptor::name, Function.identity()))
-            );
-        }
-
-        if (name.equals("java.se") || name.equals("java.se.ee")) {
-            // generate a dot file for Java SE module graph
-            try (OutputStream os = Files.newOutputStream(dir.resolve(name + "-spec.dot"));
-                 PrintStream out = new PrintStream(os)) {
-                // transitive reduction on the graph of `requires transitive` edges
-                // filter out jdk.* modules which are implementation dependences
-                Graph<String> graph = requiresTransitiveGraph(cf, true);
-                printGraph(out, name, graph,
-                           mds.stream()
-                              .filter(md -> !md.name().startsWith("jdk.") &&
-                                                graph.nodes().contains(md.name()))
-                              .collect(toMap(ModuleDescriptor::name, Function.identity()))
-                );
-            }
-        }
-    }
-
-    private void printGraph(PrintStream out,
-                            String name,
-                            Graph<String> graph,
-                            Map<String, ModuleDescriptor> nameToModule)
-        throws IOException
-    {
-            Set<ModuleDescriptor> descriptors = new TreeSet<>(nameToModule.values());
-
-            out.format("digraph \"%s\" {%n", name);
-            out.format("size=\"25,25\";");
-            out.format("nodesep=.5;%n");
-            out.format("ranksep=1.5;%n");
-            out.format("pencolor=transparent;%n");
-            out.format("node [shape=plaintext, fontname=\"DejaVuSans\", fontsize=36, margin=\".2,.2\"];%n");
-            out.format("edge [penwidth=4, color=\"#999999\", arrowhead=open, arrowsize=2];%n");
-
-            out.format("subgraph %sse {%n", name.equals("jdk") ? "cluster_" : "");
-            descriptors.stream()
-                .filter(javaGroup::contains)
-                .map(ModuleDescriptor::name)
-                .forEach(mn -> out.format("  \"%s\" [fontcolor=\"%s\", group=%s];%n",
-                                          mn, ORANGE, "java"));
-            out.format("}%n");
-
-            // same ranks
-            ranks.stream()
-                .map(group -> descriptors.stream()
-                                         .map(ModuleDescriptor::name)
-                                         .filter(group::contains)
-                                         .map(mn -> "\"" + mn + "\"")
-                                         .collect(joining(",")))
-                .filter(group -> group.length() > 0)
-                .forEach(group -> out.format("{rank=same %s}%n", group));
-
-            descriptors.stream()
-                .filter(jdkGroup::contains)
-                .map(ModuleDescriptor::name)
-                .forEach(mn -> out.format("  \"%s\" [fontcolor=\"%s\", group=%s];%n",
-                                          mn, BLUE, "jdk"));
-
-            descriptors.stream()
-                .forEach(md -> {
-                    String mn = md.name();
-                    Set<String> requiresTransitive = md.requires().stream()
-                            .filter(d -> d.modifiers().contains(TRANSITIVE))
-                            .map(d -> d.name())
-                            .collect(toSet());
-
-                    graph.adjacentNodes(mn)
-                         .stream()
-                         .filter(nameToModule::containsKey)
-                         .forEach(dn -> {
-                             String attr = dn.equals("java.base") ? REQUIRES_BASE
-                                    : (requiresTransitive.contains(dn) ? REEXPORTS : REQUIRES);
-                             int w = weightOf(mn, dn);
-                             if (w > 1)
-                                 attr += "weight=" + w;
-                             out.format("  \"%s\" -> \"%s\" [%s];%n", mn, dn, attr);
-                         });
-                });
-
-            out.println("}");
-    }
-
-    /**
-     * Returns a Graph of the given Configuration after transitive reduction.
-     *
-     * Transitive reduction of requires transitive edge and requires edge have
-     * to be applied separately to prevent the requires transitive edges
-     * (e.g. U -> V) from being reduced by a path (U -> X -> Y -> V)
-     * in which  V would not be re-exported from U.
-     */
-    private Graph<String> gengraph(Configuration cf) {
-        Graph.Builder<String> builder = new Graph.Builder<>();
-        for (ResolvedModule resolvedModule : cf.modules()) {
-            String mn = resolvedModule.reference().descriptor().name();
-            builder.addNode(mn);
-            resolvedModule.reads().stream()
-                    .map(ResolvedModule::name)
-                    .forEach(target -> builder.addEdge(mn, target));
-        }
-        Graph<String> rpg = requiresTransitiveGraph(cf, false);
-        return builder.build().reduce(rpg);
-    }
-
-    /**
-     * Returns a Graph containing only requires transitive edges
-     * with transitive reduction.
-     */
-    private Graph<String> requiresTransitiveGraph(Configuration cf, boolean includeBase) {
-        Graph.Builder<String> builder = new Graph.Builder<>();
-        for (ResolvedModule resolvedModule : cf.modules()) {
-            ModuleDescriptor descriptor = resolvedModule.reference().descriptor();
-            String mn = descriptor.name();
-            descriptor.requires().stream()
-                    .filter(d -> d.modifiers().contains(TRANSITIVE)
-                                    || (includeBase && d.name().equals("java.base")))
-                    .map(d -> d.name())
-                    .forEach(d -> builder.addEdge(mn, d));
-        }
-        return builder.build().reduce();
+        return !name.equals("jdk") && !name.startsWith("jdk.internal.");
     }
 }
diff --git a/jdk/make/src/classes/build/tools/jigsaw/Graph.java b/jdk/make/src/classes/build/tools/jigsaw/Graph.java
deleted file mode 100644
index a835da1..0000000
--- a/jdk/make/src/classes/build/tools/jigsaw/Graph.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package build.tools.jigsaw;
-
-import java.io.PrintStream;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-
-public class Graph<T> {
-    private static boolean traceOn = Boolean.getBoolean("build.tools.module.trace");
-    private final Set<T> nodes;
-    private final Map<T, Set<T>> edges;
-    private Graph(Set<T> nodes, Map<T, Set<T>> edges) {
-        this.nodes = nodes;
-        this.edges = edges;
-    }
-
-    public Set<T> nodes() {
-        return nodes;
-    }
-
-    public Map<T, Set<T>> edges() {
-        return edges;
-    }
-
-    public Set<T> adjacentNodes(T u) {
-        return edges.get(u);
-    }
-
-    /**
-     * Returns a new Graph after transitive reduction
-     */
-    public Graph<T> reduce() {
-        Graph.Builder<T> builder = new Builder<>();
-        nodes.stream()
-             .forEach(u -> {
-                 builder.addNode(u);
-                 edges.get(u).stream()
-                         .filter(v -> !pathExists(u, v, false))
-                         .forEach(v -> builder.addEdge(u, v));
-             });
-        return builder.build();
-    }
-
-    /**
-     * Returns a new Graph after transitive reduction.  All edges in
-     * the given g takes precedence over this graph.
-     *
-     * @throw IllegalArgumentException g must be a subgraph this graph
-     */
-    public Graph<T> reduce(Graph<T> g) {
-        boolean subgraph = nodes.containsAll(g.nodes) && g.edges.keySet().stream()
-               .allMatch(u -> adjacentNodes(u).containsAll(g.adjacentNodes(u)));
-        if (!subgraph) {
-            throw new IllegalArgumentException("the given argument is not a subgraph of this graph");
-        }
-
-        Graph.Builder<T> builder = new Builder<>();
-        nodes.stream()
-             .forEach(u -> {
-                 builder.addNode(u);
-                 // filter the edge if there exists a path from u to v in the given g
-                 // or there exists another path from u to v in this graph
-                 edges.get(u).stream()
-                      .filter(v -> !g.pathExists(u, v) && !pathExists(u, v, false))
-                      .forEach(v -> builder.addEdge(u, v));
-             });
-
-        // add the overlapped edges from this graph and the given g
-        g.edges().keySet().stream()
-                 .forEach(u -> g.adjacentNodes(u).stream()
-                         .filter(v -> isAdjacent(u, v))
-                         .forEach(v -> builder.addEdge(u, v)));
-        return builder.build();
-    }
-
-    private boolean isAdjacent(T u, T v) {
-        return edges.containsKey(u) && edges.get(u).contains(v);
-    }
-
-    private boolean pathExists(T u, T v) {
-        return pathExists(u, v, true);
-    }
-
-    /**
-     * Returns true if there exists a path from u to v in this graph.
-     * If includeAdjacent is false, it returns true if there exists
-     * another path from u to v of distance > 1
-     */
-    private boolean pathExists(T u, T v, boolean includeAdjacent) {
-        if (!nodes.contains(u) || !nodes.contains(v)) {
-            return false;
-        }
-        if (includeAdjacent && isAdjacent(u, v)) {
-            return true;
-        }
-        Deque<T> stack = new LinkedList<>();
-        Set<T> visited = new HashSet<>();
-        stack.push(u);
-        while (!stack.isEmpty()) {
-            T node = stack.pop();
-            if (node.equals(v)) {
-                if (traceOn) {
-                    System.out.format("Edge %s -> %s removed%n", u, v);
-                }
-                return true;
-            }
-            if (!visited.contains(node)) {
-                visited.add(node);
-                edges.get(node).stream()
-                     .filter(e -> includeAdjacent || !node.equals(u) || !e.equals(v))
-                     .forEach(e -> stack.push(e));
-            }
-        }
-        assert !visited.contains(v);
-        return false;
-    }
-
-    void printGraph(PrintStream out) {
-        nodes.stream()
-             .forEach(u -> adjacentNodes(u).stream()
-                     .forEach(v -> out.format("%s -> %s%n", u, v)));
-    }
-
-    public static class Builder<T> {
-        final Set<T> nodes = new HashSet<>();
-        final Map<T, Set<T>> edges = new HashMap<>();
-        public void addNode(T node) {
-            if (nodes.contains(node)) {
-                return;
-            }
-            nodes.add(node);
-            edges.computeIfAbsent(node, _e -> new HashSet<>());
-        }
-        public void addEdge(T u, T v) {
-            addNode(u);
-            addNode(v);
-            edges.get(u).add(v);
-        }
-        public Graph<T> build() {
-            return new Graph<>(nodes, edges);
-        }
-    }
-}
diff --git a/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java b/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
index e55a1c0..520fb1b 100644
--- a/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
+++ b/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
@@ -291,9 +291,9 @@
 
     static Configuration resolve(Set<String> roots) {
         return Configuration.empty()
-            .resolveRequires(ModuleFinder.ofSystem(),
-                             ModuleFinder.of(),
-                             roots);
+            .resolve(ModuleFinder.ofSystem(),
+                     ModuleFinder.of(),
+                     roots);
     }
 
     static class HtmlDocument {
diff --git a/jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties b/jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
new file mode 100644
index 0000000..75348c3
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
@@ -0,0 +1,2 @@
+arrowcolor=#999999
+requiresMandatedColor=#999999
diff --git a/jdk/make/src/classes/build/tools/taglet/Incubating.java b/jdk/make/src/classes/build/tools/taglet/Incubating.java
index 826fadd..0670a96 100644
--- a/jdk/make/src/classes/build/tools/taglet/Incubating.java
+++ b/jdk/make/src/classes/build/tools/taglet/Incubating.java
@@ -28,9 +28,10 @@
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Set;
+import javax.lang.model.element.Element;
 import com.sun.source.doctree.DocTree;
-import jdk.javadoc.doclet.taglet.Taglet;
-import static jdk.javadoc.doclet.taglet.Taglet.Location.*;
+import jdk.javadoc.doclet.Taglet;
+import static jdk.javadoc.doclet.Taglet.Location.*;
 
 /**
  * An inline tag to conveniently insert a standard Incubating warning.  For
@@ -59,12 +60,7 @@
                 + " Will be removed in a future release.</b>";
 
     @Override
-    public String toString(DocTree tag) {
-        return MESSAGE;
-    }
-
-    @Override
-    public String toString(List<? extends DocTree> tags) {
+    public String toString(List<? extends DocTree> tags, Element elem) {
         return MESSAGE;
     }
 }
diff --git a/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java b/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java
new file mode 100644
index 0000000..6983eaa
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package build.tools.taglet;
+
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
+import javax.lang.model.element.Element;
+import com.sun.source.doctree.DocTree;
+import jdk.javadoc.doclet.Taglet;
+import static jdk.javadoc.doclet.Taglet.Location.*;
+
+/**
+ * A block tag to optionally insert a reference to a module graph.
+ */
+public class ModuleGraph implements Taglet {
+    private static final boolean enableModuleGraph =
+        Boolean.getBoolean("enableModuleGraph");
+
+    /** Returns the set of locations in which a taglet may be used. */
+    @Override
+    public Set<Location> getAllowedLocations() {
+        return EnumSet.of(MODULE);
+    }
+
+    @Override
+    public boolean isInlineTag() {
+        return false;
+    }
+
+    @Override
+    public String getName() {
+        return "moduleGraph";
+    }
+
+    @Override
+    public String toString(List<? extends DocTree> tags, Element element) {
+        if (!enableModuleGraph) {
+            return "";
+        }
+
+        String moduleName = element.getSimpleName().toString();
+        String imageFile = moduleName + "-graph.png";
+        int thumbnailHeight = -1;
+        String hoverImage = "";
+        if (!moduleName.equals("java.base")) {
+            thumbnailHeight = 100; // also appears in the stylesheet
+            hoverImage = "<span>"
+                + getImage(moduleName, imageFile, -1, true)
+                + "</span>";
+        }
+        return "<dt>"
+            + "<span class=\"simpleTagLabel\">Module Graph:</span>\n"
+            + "</dt>"
+            + "<dd>"
+            + "<a class=moduleGraph href=\"" + imageFile + "\">"
+            + getImage(moduleName, imageFile, thumbnailHeight, false)
+            + hoverImage
+            + "</a>"
+            + "</dd>";
+    }
+
+    private static final String VERTICAL_ALIGN = "vertical-align:top";
+    private static final String BORDER = "border: solid lightgray 1px;";
+
+    private String getImage(String moduleName, String file, int height, boolean useBorder) {
+        return String.format("<img style=\"%s\" alt=\"Module graph for %s\" src=\"%s\"%s>",
+                             useBorder ? BORDER + " " + VERTICAL_ALIGN : VERTICAL_ALIGN,
+                             moduleName,
+                             file,
+                             (height <= 0 ? "" : " height=\"" + height + "\""));
+    }
+}
diff --git a/jdk/src/java.base/linux/native/libnio/ch/EPoll.c b/jdk/src/java.base/linux/native/libnio/ch/EPoll.c
index ea9cdf4..d6526c5 100644
--- a/jdk/src/java.base/linux/native/libnio/ch/EPoll.c
+++ b/jdk/src/java.base/linux/native/libnio/ch/EPoll.c
@@ -95,9 +95,3 @@
     }
     return res;
 }
-
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_EPoll_close0(JNIEnv *env, jclass c, jint epfd) {
-    int res;
-    RESTARTABLE(close(epfd), res);
-}
diff --git a/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java b/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java
index 573de69..b68e3aa 100644
--- a/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java
+++ b/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java
@@ -50,10 +50,11 @@
     }
 
     /**
-     * Choose a default interface. This method returns an interface that is
-     * both "up" and supports multicast. This method choses an interface in
+     * Choose a default interface. This method returns the first interface that
+     * is both "up" and supports multicast. This method chooses an interface in
      * order of preference:
      * 1. neither loopback nor point to point
+     *    ( prefer interfaces with dual IP support )
      * 2. point to point
      * 3. loopback
      *
@@ -66,32 +67,56 @@
         try {
            nifs = NetworkInterface.getNetworkInterfaces();
         } catch (IOException ignore) {
-            // unable to enumate network interfaces
+            // unable to enumerate network interfaces
             return null;
         }
 
+        NetworkInterface preferred = null;
         NetworkInterface ppp = null;
         NetworkInterface loopback = null;
 
         while (nifs.hasMoreElements()) {
             NetworkInterface ni = nifs.nextElement();
             try {
-                if (ni.isUp() && ni.supportsMulticast()) {
-                    boolean isLoopback = ni.isLoopback();
-                    boolean isPPP = ni.isPointToPoint();
-                    if (!isLoopback && !isPPP) {
-                        // found an interface that is not the loopback or a
-                        // point-to-point interface
+                if (!ni.isUp() || !ni.supportsMulticast())
+                    continue;
+
+                boolean ip4 = false, ip6 = false;
+                Enumeration<InetAddress> addrs = ni.getInetAddresses();
+                while (addrs.hasMoreElements()) {
+                    InetAddress addr = addrs.nextElement();
+                    if (!addr.isAnyLocalAddress()) {
+                        if (addr instanceof Inet4Address) {
+                            ip4 = true;
+                        } else if (addr instanceof Inet6Address) {
+                            ip6 = true;
+                        }
+                    }
+                }
+
+                boolean isLoopback = ni.isLoopback();
+                boolean isPPP = ni.isPointToPoint();
+                if (!isLoopback && !isPPP) {
+                    // found an interface that is not the loopback or a
+                    // point-to-point interface
+                    if (preferred == null) {
+                        preferred = ni;
+                    } else if (ip4 && ip6){
                         return ni;
                     }
-                    if (ppp == null && isPPP)
-                        ppp = ni;
-                    if (loopback == null && isLoopback)
-                        loopback = ni;
                 }
+                if (ppp == null && isPPP)
+                    ppp = ni;
+                if (loopback == null && isLoopback)
+                    loopback = ni;
+
             } catch (IOException skip) { }
         }
 
-        return (ppp != null) ? ppp : loopback;
+        if (preferred != null) {
+            return preferred;
+        } else {
+            return (ppp != null) ? ppp : loopback;
+        }
     }
 }
diff --git a/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c b/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c
index b43f290..b11a4d0 100644
--- a/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c
+++ b/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,8 @@
 
 #define LOCALEIDLENGTH  128
 char *getMacOSXLocale(int cat) {
+    const char* retVal = NULL;
+
     switch (cat) {
     case LC_MESSAGES:
         {
@@ -72,33 +74,7 @@
             }
             CFRelease(languages);
 
-            // Language IDs use the language designators and (optional) region
-            // and script designators of BCP 47.  So possible formats are:
-            //
-            // "en"         (language designator only)
-            // "haw"        (3-letter lanuage designator)
-            // "en-GB"      (language with alpha-2 region designator)
-            // "es-419"     (language with 3-digit UN M.49 area code)
-            // "zh-Hans"    (language with ISO 15924 script designator)
-            //
-            // In the case of region designators (alpha-2 or UN M.49), we convert
-            // to our locale string format by changing '-' to '_'.  That is, if
-            // the '-' is followed by fewer than 4 chars.
-            char* scriptOrRegion = strchr(languageString, '-');
-            if (scriptOrRegion != NULL && strlen(scriptOrRegion) < 5) {
-                *scriptOrRegion = '_';
-
-                assert((strlen(scriptOrRegion) == 3 &&
-                        // '-' followed by a 2 character region designator
-                          isalpha(scriptOrRegion[1]) &&
-                          isalpha(scriptOrRegion[2])) ||
-                       (strlen(scriptOrRegion) == 4 &&
-                        // '-' followed by a 3-digit UN M.49 area code
-                          isdigit(scriptOrRegion[1]) &&
-                          isdigit(scriptOrRegion[2]) &&
-                          isdigit(scriptOrRegion[3])));
-            }
-            const char* retVal = languageString;
+            retVal = languageString;
 
             // Special case for Portuguese in Brazil:
             // The language code needs the "_BR" region code (to distinguish it
@@ -112,20 +88,58 @@
                     strcmp(localeString, "pt_BR") == 0) {
                 retVal = localeString;
             }
-            return strdup(retVal);
         }
         break;
     default:
         {
             char localeString[LOCALEIDLENGTH];
-            if (CFStringGetCString(CFLocaleGetIdentifier(CFLocaleCopyCurrent()),
-                                   localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding())) {
-                return strdup(localeString);
+            if (!CFStringGetCString(CFLocaleGetIdentifier(CFLocaleCopyCurrent()),
+                                    localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding())) {
+                return NULL;
             }
+            retVal = localeString;
         }
         break;
     }
 
+    if (retVal != NULL) {
+        // Language IDs use the language designators and (optional) region
+        // and script designators of BCP 47.  So possible formats are:
+        //
+        // "en"         (language designator only)
+        // "haw"        (3-letter lanuage designator)
+        // "en-GB"      (language with alpha-2 region designator)
+        // "es-419"     (language with 3-digit UN M.49 area code)
+        // "zh-Hans"    (language with ISO 15924 script designator)
+        // "zh-Hans-US"  (language with ISO 15924 script designator and region)
+        // "zh-Hans-419" (language with ISO 15924 script designator and UN M.49)
+        //
+        // In the case of region designators (alpha-2 and/or UN M.49), we convert
+        // to our locale string format by changing '-' to '_'.  That is, if
+        // the '-' is followed by fewer than 4 chars.
+        char* scriptOrRegion = strchr(retVal, '-');
+        if (scriptOrRegion != NULL) {
+            int length = strlen(scriptOrRegion);
+            if (length > 5) {
+                // Region and script both exist. Honor the script for now
+                scriptOrRegion[5] = '\0';
+            } else if (length < 5) {
+                *scriptOrRegion = '_';
+
+                assert((length == 3 &&
+                    // '-' followed by a 2 character region designator
+                      isalpha(scriptOrRegion[1]) &&
+                      isalpha(scriptOrRegion[2])) ||
+                       (length == 4 &&
+                    // '-' followed by a 3-digit UN M.49 area code
+                      isdigit(scriptOrRegion[1]) &&
+                      isdigit(scriptOrRegion[2]) &&
+                      isdigit(scriptOrRegion[3])));
+            }
+        }
+
+        return strdup(retVal);
+    }
     return NULL;
 }
 
diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java
index a1c33ae..4503ec0 100644
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,10 +42,10 @@
  * @author Andreas Sterbenz
  * @since 1.4.2
  */
-final class CounterMode extends FeedbackCipher {
+class CounterMode extends FeedbackCipher {
 
     // current counter value
-    private final byte[] counter;
+    final byte[] counter;
 
     // encrypted bytes of the previous counter value
     private final byte[] encryptedCounter;
diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java
index d449380..d3f1c99 100644
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -149,6 +149,7 @@
      * Ensures that the bytes of this key are
      * set to zero when there are no more references to it.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             if (this.key != null) {
diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java
index a0de5dc..9695ba3 100644
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -150,6 +150,7 @@
      * Ensures that the bytes of this key are
      * set to zero when there are no more references to it.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             if (this.key != null) {
diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java
index f8a3eaa..6a394e4 100644
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,52 +29,43 @@
 
 package com.sun.crypto.provider;
 
-import java.security.*;
-import javax.crypto.*;
+import javax.crypto.IllegalBlockSizeException;
 import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
 
 /**
  * This class represents the GCTR function defined in NIST 800-38D
- * under section 6.5. It needs to be constructed w/ an initialized
- * cipher object, and initial counter block(ICB). Given an input X
- * of arbitrary length, it processes and returns an output which has
- * the same length as X. The invariants of this class are:
- *
- * (1) The length of intialCounterBlk (and also of its clones, e.g.,
- * fields counter and counterSave) is equal to AES_BLOCK_SIZE.
- *
- * (2) After construction, the field counter never becomes null, it
- * always contains a byte array of length AES_BLOCK_SIZE.
+ * under section 6.5.  With a given cipher object and initial counter
+ * block, a counter mode operation is performed.  Blocksize is limited
+ * to 16 bytes.
  *
  * If any invariant is broken, failures can occur because the
  * AESCrypt.encryptBlock method can be intrinsified on the HotSpot VM
  * (see JDK-8067648 for details).
  *
+ * The counter mode operations can be intrinsified and parallelized
+ * by using CounterMode.implCrypt() if HotSpot VM supports it on the
+ * architecture.
+ *
  * <p>This function is used in the implementation of GCM mode.
  *
  * @since 1.8
  */
-final class GCTR {
+final class GCTR extends CounterMode {
 
-    // these fields should not change after the object has been constructed
-    private final SymmetricCipher aes;
-    private final byte[] icb;
-
-    // the current counter value
-    private byte[] counter;
-
-    // needed for save/restore calls
-    private byte[] counterSave = null;
-
-    // NOTE: cipher should already be initialized
     GCTR(SymmetricCipher cipher, byte[] initialCounterBlk) {
-        this.aes = cipher;
+        super(cipher);
         if (initialCounterBlk.length != AES_BLOCK_SIZE) {
             throw new RuntimeException("length of initial counter block (" + initialCounterBlk.length +
                                        ") not equal to AES_BLOCK_SIZE (" + AES_BLOCK_SIZE + ")");
         }
-        this.icb = initialCounterBlk;
-        this.counter = icb.clone();
+
+        iv = initialCounterBlk;
+        reset();
+    }
+
+    @Override
+    String getFeedback() {
+        return "GCTR";
     }
 
     // input must be multiples of 128-bit blocks when calling update
@@ -89,23 +80,11 @@
             throw new RuntimeException("output buffer too small");
         }
 
-        byte[] encryptedCntr = new byte[AES_BLOCK_SIZE];
-
-        int numOfCompleteBlocks = inLen / AES_BLOCK_SIZE;
-        for (int i = 0; i < numOfCompleteBlocks; i++) {
-            aes.encryptBlock(counter, 0, encryptedCntr, 0);
-            for (int n = 0; n < AES_BLOCK_SIZE; n++) {
-                int index = (i * AES_BLOCK_SIZE + n);
-                out[outOfs + index] =
-                    (byte) ((in[inOfs + index] ^ encryptedCntr[n]));
-            }
-            GaloisCounterMode.increment32(counter);
-        }
-        return inLen;
+        return encrypt(in, inOfs, inLen, out, outOfs);
     }
 
     // input can be arbitrary size when calling doFinal
-    protected int doFinal(byte[] in, int inOfs, int inLen, byte[] out,
+    int doFinal(byte[] in, int inOfs, int inLen, byte[] out,
                           int outOfs) throws IllegalBlockSizeException {
         try {
             if (inLen < 0) {
@@ -118,7 +97,7 @@
                 if (lastBlockSize != 0) {
                     // do the last partial block
                     byte[] encryptedCntr = new byte[AES_BLOCK_SIZE];
-                    aes.encryptBlock(counter, 0, encryptedCntr, 0);
+                    embeddedCipher.encryptBlock(counter, 0, encryptedCntr, 0);
                     for (int n = 0; n < lastBlockSize; n++) {
                         out[outOfs + completeBlkLen + n] =
                             (byte) ((in[inOfs + completeBlkLen + n] ^
@@ -131,28 +110,4 @@
         }
         return inLen;
     }
-
-    /**
-     * Resets the content of this object to when it's first constructed.
-     */
-    void reset() {
-        System.arraycopy(icb, 0, counter, 0, icb.length);
-        counterSave = null;
-    }
-
-    /**
-     * Save the current content of this object.
-     */
-    void save() {
-        this.counterSave = this.counter.clone();
-    }
-
-    /**
-     * Restores the content of this object to the previous saved one.
-     */
-    void restore() {
-        if (this.counterSave != null) {
-            this.counter = this.counterSave;
-        }
-    }
 }
diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java
index 3331f78..72e7452 100644
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -145,6 +145,7 @@
      * Ensures that the password bytes of this key are
      * set to zero when there are no more references to it.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             if (this.key != null) {
diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
index 9d82ebb..1bf5156 100644
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -267,6 +267,7 @@
      * Ensures that the password bytes of this key are
      * erased when there are no more references to it.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             if (this.passwd != null) {
diff --git a/jdk/src/java.base/share/classes/java/io/BufferedReader.java b/jdk/src/java.base/share/classes/java/io/BufferedReader.java
index 1f6a664..8cb4f73 100644
--- a/jdk/src/java.base/share/classes/java/io/BufferedReader.java
+++ b/jdk/src/java.base/share/classes/java/io/BufferedReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -297,14 +297,15 @@
 
     /**
      * Reads a line of text.  A line is considered to be terminated by any one
-     * of a line feed ('\n'), a carriage return ('\r'), or a carriage return
-     * followed immediately by a linefeed.
+     * of a line feed ('\n'), a carriage return ('\r'), a carriage return
+     * followed immediately by a line feed, or by reaching the end-of-file
+     * (EOF).
      *
      * @param      ignoreLF  If true, the next '\n' will be skipped
      *
      * @return     A String containing the contents of the line, not including
      *             any line-termination characters, or null if the end of the
-     *             stream has been reached
+     *             stream has been reached without reading any characters
      *
      * @see        java.io.LineNumberReader#readLine()
      *
@@ -375,12 +376,13 @@
 
     /**
      * Reads a line of text.  A line is considered to be terminated by any one
-     * of a line feed ('\n'), a carriage return ('\r'), or a carriage return
-     * followed immediately by a linefeed.
+     * of a line feed ('\n'), a carriage return ('\r'), a carriage return
+     * followed immediately by a line feed, or by reaching the end-of-file
+     * (EOF).
      *
      * @return     A String containing the contents of the line, not including
      *             any line-termination characters, or null if the end of the
-     *             stream has been reached
+     *             stream has been reached without reading any characters
      *
      * @exception  IOException  If an I/O error occurs
      *
diff --git a/jdk/src/java.base/share/classes/java/io/FileInputStream.java b/jdk/src/java.base/share/classes/java/io/FileInputStream.java
index a321c61..0d84011 100644
--- a/jdk/src/java.base/share/classes/java/io/FileInputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/FileInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -413,9 +413,19 @@
      * Ensures that the <code>close</code> method of this file input stream is
      * called when there are no more references to it.
      *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
+     *
      * @exception  IOException  if an I/O error occurs.
      * @see        java.io.FileInputStream#close()
      */
+    @Deprecated(since="9")
     protected void finalize() throws IOException {
         if ((fd != null) &&  (fd != FileDescriptor.in)) {
             /* if fd is shared, the references in FileDescriptor
diff --git a/jdk/src/java.base/share/classes/java/io/FileOutputStream.java b/jdk/src/java.base/share/classes/java/io/FileOutputStream.java
index f6bdb1f..634ca1e 100644
--- a/jdk/src/java.base/share/classes/java/io/FileOutputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/FileOutputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -427,9 +427,18 @@
      * <code>close</code> method of this file output stream is
      * called when there are no more references to this stream.
      *
+     * @deprecated The {@code finalize} method has been deprecated.
+     * Subclasses that override {@code finalize} in order to perform cleanup
+     * should be modified to use alternative cleanup mechanisms and
+     * to remove the overriding {@code finalize} method.
+     * When overriding the {@code finalize} method, its implementation must explicitly
+     * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     * See the specification for {@link Object#finalize()} for further
+     * information about migration options.
      * @exception  IOException  if an I/O error occurs.
      * @see        java.io.FileInputStream#close()
      */
+    @Deprecated(since="9")
     protected void finalize() throws IOException {
         if (fd != null) {
             if (fd == FileDescriptor.out || fd == FileDescriptor.err) {
diff --git a/jdk/src/java.base/share/classes/java/io/FilePermission.java b/jdk/src/java.base/share/classes/java/io/FilePermission.java
index 2d56f43..39cded5 100644
--- a/jdk/src/java.base/share/classes/java/io/FilePermission.java
+++ b/jdk/src/java.base/share/classes/java/io/FilePermission.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -209,6 +209,10 @@
     private static final Path here = builtInFS.getPath(
             GetPropertyAction.privilegedGetProperty("user.dir"));
 
+    private static final Path EMPTY_PATH = builtInFS.getPath("");
+    private static final Path DASH_PATH = builtInFS.getPath("-");
+    private static final Path DOTDOT_PATH = builtInFS.getPath("..");
+
     /**
      * A private constructor that clones some and updates some,
      * always with a different name.
@@ -341,7 +345,7 @@
                         .normalize();
                 // lastName should always be non-null now
                 Path lastName = npath.getFileName();
-                if (lastName != null && lastName.toString().equals("-")) {
+                if (lastName != null && lastName.equals(DASH_PATH)) {
                     directory = true;
                     recursive = !rememberStar;
                     npath = npath.getParent();
@@ -679,23 +683,76 @@
      * @return the depth in between
      */
     private static int containsPath(Path p1, Path p2) {
-        Path p;
-        try {
-            p = p2.relativize(p1).normalize();
-            if (p.getName(0).toString().isEmpty()) {
-                return 0;
-            } else {
-                for (Path item: p) {
-                    String s = item.toString();
-                    if (!s.equals("..")) {
-                        return -1;
-                    }
-                }
-                return p.getNameCount();
-            }
-        } catch (IllegalArgumentException iae) {
+
+        // Two paths must have the same root. For example,
+        // there is no contains relation between any two of
+        // "/x", "x", "C:/x", "C:x", and "//host/share/x".
+        if (!Objects.equals(p1.getRoot(), p2.getRoot())) {
             return -1;
         }
+
+        // Empty path (i.e. "." or "") is a strange beast,
+        // because its getNameCount()==1 but getName(0) is null.
+        // It's better to deal with it separately.
+        if (p1.equals(EMPTY_PATH)) {
+            if (p2.equals(EMPTY_PATH)) {
+                return 0;
+            } else if (p2.getName(0).equals(DOTDOT_PATH)) {
+                // "." contains p2 iif p2 has no "..". Since a
+                // a normalized path can only have 0 or more
+                // ".." at the beginning. We only need to look
+                // at the head.
+                return -1;
+            } else {
+                // and the distance is p2's name count. i.e.
+                // 3 between "." and "a/b/c".
+                return p2.getNameCount();
+            }
+        } else if (p2.equals(EMPTY_PATH)) {
+            int c1 = p1.getNameCount();
+            if (!p1.getName(c1 - 1).equals(DOTDOT_PATH)) {
+                // "." is inside p1 iif p1 is 1 or more "..".
+                // For the same reason above, we only need to
+                // look at the tail.
+                return -1;
+            }
+            // and the distance is the count of ".."
+            return c1;
+        }
+
+        // Good. No more empty paths.
+
+        // Common heads are removed
+
+        int c1 = p1.getNameCount();
+        int c2 = p2.getNameCount();
+
+        int n = Math.min(c1, c2);
+        int i = 0;
+        while (i < n) {
+            if (!p1.getName(i).equals(p2.getName(i)))
+                break;
+            i++;
+        }
+
+        // for p1 containing p2, p1 must be 0-or-more "..",
+        // and p2 cannot have "..". For the same reason, we only
+        // check tail of p1 and head of p2.
+        if (i < c1 && !p1.getName(c1 - 1).equals(DOTDOT_PATH)) {
+            return -1;
+        }
+
+        if (i < c2 && p2.getName(i).equals(DOTDOT_PATH)) {
+            return -1;
+        }
+
+        // and the distance is the name counts added (after removing
+        // the common heads).
+
+        // For example: p1 = "../../..", p2 = "../a".
+        // After removing the common heads, they become "../.." and "a",
+        // and the distance is (3-1)+(2-1) = 3.
+        return c1 - i + c2 - i;
     }
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/io/FilterInputStream.java b/jdk/src/java.base/share/classes/java/io/FilterInputStream.java
index 3304a1f..05ab5fa 100644
--- a/jdk/src/java.base/share/classes/java/io/FilterInputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/FilterInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -84,7 +84,7 @@
     }
 
     /**
-     * Reads up to <code>byte.length</code> bytes of data from this
+     * Reads up to <code>b.length</code> bytes of data from this
      * input stream into an array of bytes. This method blocks until some
      * input is available.
      * <p>
diff --git a/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java b/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java
index cb8f122..8030979 100644
--- a/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -91,8 +91,8 @@
      * <code>b.length</code>.
      * <p>
      * Note that this method does not call the one-argument
-     * <code>write</code> method of its underlying stream with the single
-     * argument <code>b</code>.
+     * <code>write</code> method of its underlying output stream with
+     * the single argument <code>b</code>.
      *
      * @param      b   the data to be written.
      * @exception  IOException  if an I/O error occurs.
@@ -113,7 +113,7 @@
      * <code>byte</code> to output.
      * <p>
      * Note that this method does not call the <code>write</code> method
-     * of its underlying input stream with the same arguments. Subclasses
+     * of its underlying output stream with the same arguments. Subclasses
      * of <code>FilterOutputStream</code> should provide a more efficient
      * implementation of this method.
      *
diff --git a/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java b/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java
index a0e998c..534e1b2 100644
--- a/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java
+++ b/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java
@@ -104,7 +104,6 @@
      * @return  {@link Status#ALLOWED Status.ALLOWED} if accepted,
      *          {@link Status#REJECTED Status.REJECTED} if rejected,
      *          {@link Status#UNDECIDED Status.UNDECIDED} if undecided.
-     * @since 9
      */
     Status checkInput(FilterInfo filterInfo);
 
@@ -323,7 +322,7 @@
          * Other patterns match or reject class or package name
          * as returned from {@link Class#getName() Class.getName()} and
          * if an optional module name is present
-         * {@link java.lang.reflect.Module#getName() class.getModule().getName()}.
+         * {@link Module#getName() class.getModule().getName()}.
          * Note that for arrays the element type is used in the pattern,
          * not the array type.
          * <ul>
diff --git a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java
index ed033d6..5c36b7f 100644
--- a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java
@@ -812,23 +812,24 @@
     }
 
     /**
-     * Enable the stream to allow objects read from the stream to be replaced.
-     * When enabled, the resolveObject method is called for every object being
+     * Enables the stream to do replacement of objects read from the stream. When
+     * enabled, the {@link #resolveObject} method is called for every object being
      * deserialized.
      *
-     * <p>If <i>enable</i> is true, and there is a security manager installed,
+     * <p>If object replacement is currently not enabled, and
+     * {@code enable} is true, and there is a security manager installed,
      * this method first calls the security manager's
-     * <code>checkPermission</code> method with the
-     * <code>SerializablePermission("enableSubstitution")</code> permission to
-     * ensure it's ok to enable the stream to allow objects read from the
-     * stream to be replaced.
+     * {@code checkPermission} method with the
+     * {@code SerializablePermission("enableSubstitution")} permission to
+     * ensure that the caller is permitted to enable the stream to do replacement
+     * of objects read from the stream.
      *
-     * @param   enable true for enabling use of <code>resolveObject</code> for
+     * @param   enable true for enabling use of {@code resolveObject} for
      *          every object being deserialized
      * @return  the previous setting before this method was invoked
      * @throws  SecurityException if a security manager exists and its
-     *          <code>checkPermission</code> method denies enabling the stream
-     *          to allow objects read from the stream to be replaced.
+     *          {@code checkPermission} method denies enabling the stream
+     *          to do replacement of objects read from the stream.
      * @see SecurityManager#checkPermission
      * @see java.io.SerializablePermission
      */
diff --git a/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java b/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java
index bff6f83..0684544 100644
--- a/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java
@@ -589,22 +589,24 @@
     }
 
     /**
-     * Enable the stream to do replacement of objects in the stream.  When
-     * enabled, the replaceObject method is called for every object being
+     * Enables the stream to do replacement of objects written to the stream.  When
+     * enabled, the {@link #replaceObject} method is called for every object being
      * serialized.
      *
-     * <p>If <code>enable</code> is true, and there is a security manager
-     * installed, this method first calls the security manager's
-     * <code>checkPermission</code> method with a
-     * <code>SerializablePermission("enableSubstitution")</code> permission to
-     * ensure it's ok to enable the stream to do replacement of objects in the
-     * stream.
+     * <p>If object replacement is currently not enabled, and
+     * {@code enable} is true, and there is a security manager installed,
+     * this method first calls the security manager's
+     * {@code checkPermission} method with the
+     * {@code SerializablePermission("enableSubstitution")} permission to
+     * ensure that the caller is permitted to enable the stream to do replacement
+     * of objects written to the stream.
      *
-     * @param   enable boolean parameter to enable replacement of objects
+     * @param   enable true for enabling use of {@code replaceObject} for
+     *          every object being serialized
      * @return  the previous setting before this method was invoked
      * @throws  SecurityException if a security manager exists and its
-     *          <code>checkPermission</code> method denies enabling the stream
-     *          to do replacement of objects in the stream.
+     *          {@code checkPermission} method denies enabling the stream
+     *          to do replacement of objects written to the stream.
      * @see SecurityManager#checkPermission
      * @see java.io.SerializablePermission
      */
diff --git a/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java b/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java
index f9c8eea..47c6a40 100644
--- a/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java
+++ b/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -307,6 +307,8 @@
      *             sequence.
      */
     public int codePointAt(int index) {
+        int count = this.count;
+        byte[] value = this.value;
         checkIndex(index, count);
         if (isLatin1()) {
             return value[index] & 0xff;
@@ -560,11 +562,7 @@
             val[count++] = 'l';
             val[count++] = 'l';
         } else {
-            checkOffset(count + 4, val.length >> 1);
-            StringUTF16.putChar(val, count++, 'n');
-            StringUTF16.putChar(val, count++, 'u');
-            StringUTF16.putChar(val, count++, 'l');
-            StringUTF16.putChar(val, count++, 'l');
+            count = StringUTF16.putCharsAt(val, count, 'n', 'u', 'l', 'l');
         }
         this.count = count;
         return this;
@@ -695,18 +693,9 @@
             }
         } else {
             if (b) {
-                checkOffset(count + 4, val.length >> 1);
-                StringUTF16.putChar(val, count++, 't');
-                StringUTF16.putChar(val, count++, 'r');
-                StringUTF16.putChar(val, count++, 'u');
-                StringUTF16.putChar(val, count++, 'e');
+                count = StringUTF16.putCharsAt(val, count, 't', 'r', 'u', 'e');
             } else {
-                checkOffset(count + 5, val.length >> 1);
-                StringUTF16.putChar(val, count++, 'f');
-                StringUTF16.putChar(val, count++, 'a');
-                StringUTF16.putChar(val, count++, 'l');
-                StringUTF16.putChar(val, count++, 's');
-                StringUTF16.putChar(val, count++, 'e');
+                count = StringUTF16.putCharsAt(val, count, 'f', 'a', 'l', 's', 'e');
             }
         }
         this.count = count;
@@ -755,16 +744,15 @@
      * @return  a reference to this object.
      */
     public AbstractStringBuilder append(int i) {
+        int count = this.count;
         int spaceNeeded = count + Integer.stringSize(i);
         ensureCapacityInternal(spaceNeeded);
         if (isLatin1()) {
             Integer.getChars(i, spaceNeeded, value);
         } else {
-            byte[] val = this.value;
-            checkOffset(spaceNeeded, val.length >> 1);
-            Integer.getCharsUTF16(i, spaceNeeded, val);
+            StringUTF16.getChars(i, count, spaceNeeded, value);
         }
-        count = spaceNeeded;
+        this.count = spaceNeeded;
         return this;
     }
 
@@ -781,16 +769,15 @@
      * @return  a reference to this object.
      */
     public AbstractStringBuilder append(long l) {
+        int count = this.count;
         int spaceNeeded = count + Long.stringSize(l);
         ensureCapacityInternal(spaceNeeded);
         if (isLatin1()) {
             Long.getChars(l, spaceNeeded, value);
         } else {
-            byte[] val = this.value;
-            checkOffset(spaceNeeded, val.length >> 1);
-            Long.getCharsUTF16(l, spaceNeeded, val);
+            StringUTF16.getChars(l, count, spaceNeeded, value);
         }
-        count = spaceNeeded;
+        this.count = spaceNeeded;
         return this;
     }
 
@@ -843,6 +830,7 @@
      *             greater than {@code end}.
      */
     public AbstractStringBuilder delete(int start, int end) {
+        int count = this.count;
         if (end > count) {
             end = count;
         }
@@ -850,7 +838,7 @@
         int len = end - start;
         if (len > 0) {
             shift(end, -len);
-            count -= len;
+            this.count = count - len;
         }
         return this;
     }
@@ -925,6 +913,7 @@
      *             greater than {@code end}.
      */
     public AbstractStringBuilder replace(int start, int end, String str) {
+        int count = this.count;
         if (end > count) {
             end = count;
         }
@@ -933,7 +922,7 @@
         int newCount = count + len - (end - start);
         ensureCapacityInternal(newCount);
         shift(end, newCount - count);
-        count = newCount;
+        this.count = newCount;
         putStringAt(start, str);
         return this;
     }
@@ -1500,40 +1489,11 @@
                 val[k] = cj;
             }
         } else {
-            checkOffset(count, val.length >> 1);
-            boolean hasSurrogates = false;
-            for (int j = (n-1) >> 1; j >= 0; j--) {
-                int k = n - j;
-                char cj = StringUTF16.getChar(val, j);
-                char ck = StringUTF16.getChar(val, k);
-                StringUTF16.putChar(val, j, ck);
-                StringUTF16.putChar(val, k, cj);
-                if (Character.isSurrogate(cj) ||
-                    Character.isSurrogate(ck)) {
-                    hasSurrogates = true;
-                }
-            }
-            if (hasSurrogates) {
-                reverseAllValidSurrogatePairs(val, count);
-            }
+            StringUTF16.reverse(val, count);
         }
         return this;
     }
 
-    /** Outlined helper method for reverse() */
-    private void reverseAllValidSurrogatePairs(byte[] val, int count) {
-        for (int i = 0; i < count - 1; i++) {
-            char c2 = StringUTF16.getChar(val, i);
-            if (Character.isLowSurrogate(c2)) {
-                char c1 = StringUTF16.getChar(val, i + 1);
-                if (Character.isHighSurrogate(c1)) {
-                    StringUTF16.putChar(val, i++, c1);
-                    StringUTF16.putChar(val, i, c2);
-                }
-            }
-        }
-    }
-
     /**
      * Returns a string representing the data in this sequence.
      * A new {@code String} object is allocated and initialized to
@@ -1682,6 +1642,7 @@
     }
 
     private final void appendChars(char[] s, int off, int end) {
+        int count = this.count;
         if (isLatin1()) {
             byte[] val = this.value;
             for (int i = off, j = count; i < end; i++) {
@@ -1689,17 +1650,17 @@
                 if (StringLatin1.canEncode(c)) {
                     val[j++] = (byte)c;
                 } else {
-                    count = j;
+                    this.count = count = j;
                     inflate();
                     StringUTF16.putCharsSB(this.value, j, s, i, end);
-                    count += end - i;
+                    this.count = count + end - i;
                     return;
                 }
             }
         } else {
             StringUTF16.putCharsSB(this.value, count, s, off, end);
         }
-        count += end - off;
+        this.count = count + end - off;
     }
 
     private final void appendChars(CharSequence s, int off, int end) {
diff --git a/jdk/src/java.base/share/classes/java/lang/Class.java b/jdk/src/java.base/share/classes/java/lang/Class.java
index b0e3d3a..733c76a 100644
--- a/jdk/src/java.base/share/classes/java/lang/Class.java
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java
@@ -43,7 +43,6 @@
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
@@ -64,9 +63,9 @@
 import jdk.internal.HotSpotIntrinsicCandidate;
 import jdk.internal.loader.BootLoader;
 import jdk.internal.loader.BuiltinClassLoader;
-import jdk.internal.loader.ResourceHelper;
 import jdk.internal.misc.Unsafe;
 import jdk.internal.misc.VM;
+import jdk.internal.module.Resources;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.ConstantPool;
 import jdk.internal.reflect.Reflection;
@@ -425,6 +424,7 @@
      *         </ul>
      *
      * @since 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static Class<?> forName(Module module, String name) {
@@ -819,6 +819,7 @@
      * @return the module that this class or interface is a member of
      *
      * @since 9
+     * @spec JPMS
      */
     public Module getModule() {
         return module;
@@ -924,6 +925,8 @@
      * this method returns {@code null}.
      *
      * @return the package of this class.
+     * @revised 9
+     * @spec JPMS
      */
     public Package getPackage() {
         if (isPrimitive() || isArray()) {
@@ -951,20 +954,30 @@
      * declaring class} of the {@link #getEnclosingMethod enclosing method} or
      * {@link #getEnclosingConstructor enclosing constructor}.
      *
-     * <p> This method returns {@code null} if this class represents an array type,
-     * a primitive type or void.
+     * <p> If this class represents an array type then this method returns the
+     * package name of the element type. If this class represents a primitive
+     * type or void then the package name "{@code java.lang}" is returned.
      *
      * @return the fully qualified package name
      *
      * @since 9
+     * @spec JPMS
      * @jls 6.7  Fully Qualified Names
      */
     public String getPackageName() {
         String pn = this.packageName;
-        if (pn == null && !isArray() && !isPrimitive()) {
-            String cn = getName();
-            int dot = cn.lastIndexOf('.');
-            pn = (dot != -1) ? cn.substring(0, dot).intern() : "";
+        if (pn == null) {
+            Class<?> c = this;
+            while (c.isArray()) {
+                c = c.getComponentType();
+            }
+            if (c.isPrimitive()) {
+                pn = "java.lang";
+            } else {
+                String cn = c.getName();
+                int dot = cn.lastIndexOf('.');
+                pn = (dot != -1) ? cn.substring(0, dot).intern() : "";
+            }
             this.packageName = pn;
         }
         return pn;
@@ -2491,10 +2504,16 @@
      * Finds a resource with a given name.
      *
      * <p> If this class is in a named {@link Module Module} then this method
-     * will attempt to find the resource in the module by means of the absolute
-     * resource name, subject to the rules for encapsulation specified in the
-     * {@code Module} {@link Module#getResourceAsStream getResourceAsStream}
-     * method.
+     * will attempt to find the resource in the module. This is done by
+     * delegating to the module's class loader {@link
+     * ClassLoader#findResource(String,String) findResource(String,String)}
+     * method, invoking it with the module name and the absolute name of the
+     * resource. Resources in named modules are subject to the rules for
+     * encapsulation specified in the {@code Module} {@link
+     * Module#getResourceAsStream getResourceAsStream} method and so this
+     * method returns {@code null} when the resource is a
+     * non-"{@code .class}" resource in a package that is not open to the
+     * caller's module.
      *
      * <p> Otherwise, if this class is not in a named module then the rules for
      * searching resources associated with a given class are implemented by the
@@ -2503,9 +2522,8 @@
      * the bootstrap class loader, the method delegates to {@link
      * ClassLoader#getSystemResourceAsStream}.
      *
-     * <p> Before finding a resource in the caller's module or delegation to a
-     * class loader, an absolute resource name is constructed from the given
-     * resource name using this algorithm:
+     * <p> Before delegation, an absolute resource name is constructed from the
+     * given resource name using this algorithm:
      *
      * <ul>
      *
@@ -2532,27 +2550,26 @@
      *          least the caller module, or access to the resource is denied
      *          by the security manager.
      * @throws  NullPointerException If {@code name} is {@code null}
+     *
+     * @see Module#getResourceAsStream(String)
      * @since  1.1
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public InputStream getResourceAsStream(String name) {
         name = resolveName(name);
 
-        Module module = getModule();
-        if (module.isNamed()) {
-            if (!ResourceHelper.isSimpleResource(name)) {
-                Module caller = Reflection.getCallerClass().getModule();
-                if (caller != module) {
-                    Set<String> packages = module.getDescriptor().packages();
-                    String pn = ResourceHelper.getPackageName(name);
-                    if (packages.contains(pn) && !module.isOpen(pn, caller)) {
-                        // resource is in package not open to caller
-                        return null;
-                    }
-                }
+        Module thisModule = getModule();
+        if (thisModule.isNamed()) {
+            // check if resource can be located by caller
+            if (Resources.canEncapsulate(name)
+                && !isOpenToCaller(name, Reflection.getCallerClass())) {
+                return null;
             }
 
-            String mn = module.getName();
+            // resource not encapsulated or in package open to caller
+            String mn = thisModule.getName();
             ClassLoader cl = getClassLoader0();
             try {
 
@@ -2585,10 +2602,16 @@
      * Finds a resource with a given name.
      *
      * <p> If this class is in a named {@link Module Module} then this method
-     * will attempt to find the resource in the module by means of the absolute
-     * resource name, subject to the rules for encapsulation specified in the
-     * {@code Module} {@link Module#getResourceAsStream getResourceAsStream}
-     * method.
+     * will attempt to find the resource in the module. This is done by
+     * delegating to the module's class loader {@link
+     * ClassLoader#findResource(String,String) findResource(String,String)}
+     * method, invoking it with the module name and the absolute name of the
+     * resource. Resources in named modules are subject to the rules for
+     * encapsulation specified in the {@code Module} {@link
+     * Module#getResourceAsStream getResourceAsStream} method and so this
+     * method returns {@code null} when the resource is a
+     * non-"{@code .class}" resource in a package that is not open to the
+     * caller's module.
      *
      * <p> Otherwise, if this class is not in a named module then the rules for
      * searching resources associated with a given class are implemented by the
@@ -2627,25 +2650,23 @@
      *         manager.
      * @throws NullPointerException If {@code name} is {@code null}
      * @since  1.1
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public URL getResource(String name) {
         name = resolveName(name);
 
-        Module module = getModule();
-        if (module.isNamed()) {
-            if (!ResourceHelper.isSimpleResource(name)) {
-                Module caller = Reflection.getCallerClass().getModule();
-                if (caller != module) {
-                    Set<String> packages = module.getDescriptor().packages();
-                    String pn = ResourceHelper.getPackageName(name);
-                    if (packages.contains(pn) && !module.isOpen(pn, caller)) {
-                        // resource is in package not open to caller
-                        return null;
-                    }
-                }
+        Module thisModule = getModule();
+        if (thisModule.isNamed()) {
+            // check if resource can be located by caller
+            if (Resources.canEncapsulate(name)
+                && !isOpenToCaller(name, Reflection.getCallerClass())) {
+                return null;
             }
-            String mn = getModule().getName();
+
+            // resource not encapsulated or in package open to caller
+            String mn = thisModule.getName();
             ClassLoader cl = getClassLoader0();
             try {
                 if (cl == null) {
@@ -2667,10 +2688,36 @@
         }
     }
 
+    /**
+     * Returns true if a resource with the given name can be located by the
+     * given caller. All resources in a module can be located by code in
+     * the module. For other callers, then the package needs to be open to
+     * the caller.
+     */
+    private boolean isOpenToCaller(String name, Class<?> caller) {
+        // assert getModule().isNamed();
+        Module thisModule = getModule();
+        Module callerModule = (caller != null) ? caller.getModule() : null;
+        if (callerModule != thisModule) {
+            String pn = Resources.toPackageName(name);
+            if (thisModule.getDescriptor().packages().contains(pn)) {
+                if (callerModule == null && !thisModule.isOpen(pn)) {
+                    // no caller, package not open
+                    return false;
+                }
+                if (!thisModule.isOpen(pn, callerModule)) {
+                    // package not open to caller
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+
     /** protection domain returned when the internal domain is null */
     private static java.security.ProtectionDomain allPermDomain;
 
-
     /**
      * Returns the {@code ProtectionDomain} of this class.  If there is a
      * security manager installed, this method first calls the security
@@ -2740,7 +2787,7 @@
          * In all other cases, it requires RuntimePermission("accessDeclaredMembers")
          * permission.
          */
-        final ClassLoader ccl = caller.getClassLoader0();
+        final ClassLoader ccl = ClassLoader.getClassLoader(caller);
         if (which != Member.PUBLIC) {
             final ClassLoader cl = getClassLoader0();
             if (ccl != cl) {
diff --git a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java
index fb771c2..ddce287 100644
--- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java
+++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java
@@ -31,7 +31,6 @@
 import java.io.File;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
-import java.lang.reflect.Module;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.AccessControlContext;
@@ -207,6 +206,8 @@
  * @jls 13.1 The Form of a Binary
  * @see      #resolveClass(Class)
  * @since 1.0
+ * @revised 9
+ * @spec JPMS
  */
 public abstract class ClassLoader {
 
@@ -350,9 +351,7 @@
     private ClassLoader(Void unused, String name, ClassLoader parent) {
         this.name = name;
         this.parent = parent;
-        this.unnamedModule
-            = SharedSecrets.getJavaLangReflectModuleAccess()
-                           .defineUnnamedModule(this);
+        this.unnamedModule = new Module(this);
         if (ParallelLoaders.isRegistered(this.getClass())) {
             parallelLockMap = new ConcurrentHashMap<>();
             package2certs = new ConcurrentHashMap<>();
@@ -380,12 +379,12 @@
      *         method doesn't allow creation of a new class loader.
      *
      * @since  9
+     * @spec JPMS
      */
     protected ClassLoader(String name, ClassLoader parent) {
         this(checkCreateClassLoader(name), name, parent);
     }
 
-
     /**
      * Creates a new class loader using the specified parent class loader for
      * delegation.
@@ -440,6 +439,7 @@
      * this class loader is not named.
      *
      * @since 9
+     * @spec JPMS
      */
     public String getName() {
         return name;
@@ -710,6 +710,7 @@
      *         if the class could not be found.
      *
      * @since 9
+     * @spec JPMS
      */
     protected Class<?> findClass(String moduleName, String name) {
         if (moduleName == null) {
@@ -834,6 +835,8 @@
      * @see  java.security.SecureClassLoader
      *
      * @since  1.1
+     * @revised 9
+     * @spec JPMS
      */
     protected final Class<?> defineClass(String name, byte[] b, int off, int len)
         throws ClassFormatError
@@ -967,6 +970,9 @@
      *          certificates than this class, or if {@code name} begins with
      *          "{@code java.}" and this class loader is not the platform
      *          class loader or its ancestor.
+     *
+     * @revised 9
+     * @spec JPMS
      */
     protected final Class<?> defineClass(String name, byte[] b, int off, int len,
                                          ProtectionDomain protectionDomain)
@@ -974,7 +980,7 @@
     {
         protectionDomain = preDefineClass(name, protectionDomain);
         String source = defineClassSourceLocation(protectionDomain);
-        Class<?> c = defineClass1(name, b, off, len, protectionDomain, source);
+        Class<?> c = defineClass1(this, name, b, off, len, protectionDomain, source);
         postDefineClass(c, protectionDomain);
         return c;
     }
@@ -1041,6 +1047,8 @@
      * @see      #defineClass(String, byte[], int, int, ProtectionDomain)
      *
      * @since  1.5
+     * @revised 9
+     * @spec JPMS
      */
     protected final Class<?> defineClass(String name, java.nio.ByteBuffer b,
                                          ProtectionDomain protectionDomain)
@@ -1064,17 +1072,17 @@
 
         protectionDomain = preDefineClass(name, protectionDomain);
         String source = defineClassSourceLocation(protectionDomain);
-        Class<?> c = defineClass2(name, b, b.position(), len, protectionDomain, source);
+        Class<?> c = defineClass2(this, name, b, b.position(), len, protectionDomain, source);
         postDefineClass(c, protectionDomain);
         return c;
     }
 
-    private native Class<?> defineClass1(String name, byte[] b, int off, int len,
-                                         ProtectionDomain pd, String source);
+    static native Class<?> defineClass1(ClassLoader loader, String name, byte[] b, int off, int len,
+                                        ProtectionDomain pd, String source);
 
-    private native Class<?> defineClass2(String name, java.nio.ByteBuffer b,
-                                         int off, int len, ProtectionDomain pd,
-                                         String source);
+    static native Class<?> defineClass2(ClassLoader loader, String name, java.nio.ByteBuffer b,
+                                        int off, int len, ProtectionDomain pd,
+                                        String source);
 
     // true if the name is null or has the potential to be a valid binary name
     private boolean checkName(String name) {
@@ -1264,11 +1272,11 @@
      * Class loader implementations that support the loading from modules
      * should override this method.
      *
-     * @apiNote This method is the basis for the {@code Class} {@link
-     * Class#getResource getResource} and {@link Class#getResourceAsStream
-     * getResourceAsStream} methods. It is not subject to the rules for
-     * encapsulation specified by {@code Module} {@link
-     * Module#getResourceAsStream getResourceAsStream}.
+     * @apiNote This method is the basis for the {@link
+     * Class#getResource Class.getResource}, {@link Class#getResourceAsStream
+     * Class.getResourceAsStream}, and {@link Module#getResourceAsStream
+     * Module.getResourceAsStream} methods. It is not subject to the rules for
+     * encapsulation specified by {@code Module.getResourceAsStream}.
      *
      * @implSpec The default implementation attempts to find the resource by
      * invoking {@link #findResource(String)} when the {@code moduleName} is
@@ -1292,6 +1300,7 @@
      *
      * @see java.lang.module.ModuleReader#find(String)
      * @since 9
+     * @spec JPMS
      */
     protected URL findResource(String moduleName, String name) throws IOException {
         if (moduleName == null) {
@@ -1342,6 +1351,8 @@
      * @throws  NullPointerException If {@code name} is {@code null}
      *
      * @since  1.1
+     * @revised 9
+     * @spec JPMS
      */
     public URL getResource(String name) {
         Objects.requireNonNull(name);
@@ -1403,6 +1414,8 @@
      * @see  #findResources(String)
      *
      * @since  1.2
+     * @revised 9
+     * @spec JPMS
      */
     public Enumeration<URL> getResources(String name) throws IOException {
         Objects.requireNonNull(name);
@@ -1499,6 +1512,8 @@
      *          denied by the security manager.
      *
      * @since  1.2
+     * @revised 9
+     * @spec JPMS
      */
     protected URL findResource(String name) {
         return null;
@@ -1531,6 +1546,8 @@
      *          If I/O errors occur
      *
      * @since  1.2
+     * @revised 9
+     * @spec JPMS
      */
     protected Enumeration<URL> findResources(String name) throws IOException {
         return Collections.emptyEnumeration();
@@ -1601,6 +1618,8 @@
      *          denied by the security manager.
      *
      * @since  1.1
+     * @revised 9
+     * @spec JPMS
      */
     public static URL getSystemResource(String name) {
         return getSystemClassLoader().getResource(name);
@@ -1636,6 +1655,8 @@
      *          If I/O errors occur
      *
      * @since  1.2
+     * @revised 9
+     * @spec JPMS
      */
     public static Enumeration<URL> getSystemResources(String name)
         throws IOException
@@ -1667,6 +1688,8 @@
      * @throws  NullPointerException If {@code name} is {@code null}
      *
      * @since  1.1
+     * @revised 9
+     * @spec JPMS
      */
     public InputStream getResourceAsStream(String name) {
         Objects.requireNonNull(name);
@@ -1699,6 +1722,8 @@
      *          denied by the security manager.
      *
      * @since  1.1
+     * @revised 9
+     * @spec JPMS
      */
     public static InputStream getSystemResourceAsStream(String name) {
         URL url = getSystemResource(name);
@@ -1749,6 +1774,7 @@
      *
      * @see Module#isNamed()
      * @since 9
+     * @spec JPMS
      */
     public final Module getUnnamedModule() {
         return unnamedModule;
@@ -1772,6 +1798,7 @@
      *          {@link RuntimePermission}{@code ("getClassLoader")}
      *
      * @since 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static ClassLoader getPlatformClassLoader() {
@@ -1847,6 +1874,8 @@
      *          {@link Throwable#getCause()} method.
      *
      * @revised  1.4
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static ClassLoader getSystemClassLoader() {
@@ -2101,6 +2130,8 @@
      *          defined by this class loader
      *
      * @since  1.2
+     * @revised 9
+     * @spec JPMS
      *
      * @see <a href="../../../technotes/guides/jar/jar.html#versioning">
      *      The JAR File Specification: Package Versioning</a>
@@ -2138,6 +2169,7 @@
      *          if {@code name} is {@code null}.
      *
      * @since  9
+     * @spec JPMS
      */
     public final Package getDefinedPackage(String name) {
         Objects.requireNonNull(name, "name cannot be null");
@@ -2160,6 +2192,7 @@
      *         or an zero length array if no package has been defined by this class loader.
      *
      * @since  9
+     * @spec JPMS
      */
     public final Package[] getDefinedPackages() {
         return packages().toArray(Package[]::new);
@@ -2196,6 +2229,8 @@
      * a {@code Package} for the specified class loader.
      *
      * @since  1.2
+     * @revised 9
+     * @spec JPMS
      */
     @Deprecated(since="9")
     protected Package getPackage(String name) {
@@ -2220,6 +2255,8 @@
      *          class loader and its ancestors
      *
      * @since  1.2
+     * @revised 9
+     * @spec JPMS
      */
     protected Package[] getPackages() {
         Stream<Package> pkgs = packages();
@@ -2308,6 +2345,7 @@
             this.isBuiltin = isBuiltin;
         }
 
+        @SuppressWarnings("deprecation")
         protected void finalize() {
             synchronized (loadedLibraryNames) {
                 if (fromClass.getClassLoader() != null && loaded) {
diff --git a/jdk/src/java.base/share/classes/java/lang/Comparable.java b/jdk/src/java.base/share/classes/java/lang/Comparable.java
index ff8892c..b1c27f1 100644
--- a/jdk/src/java.base/share/classes/java/lang/Comparable.java
+++ b/jdk/src/java.base/share/classes/java/lang/Comparable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -124,7 +124,7 @@
      * {@code sgn(}<i>expression</i>{@code )} designates the mathematical
      * <i>signum</i> function, which is defined to return one of {@code -1},
      * {@code 0}, or {@code 1} according to whether the value of
-     * <i>expression</i> is negative, zero or positive.
+     * <i>expression</i> is negative, zero, or positive, respectively.
      *
      * @param   o the object to be compared.
      * @return  a negative integer, zero, or a positive integer as this object
diff --git a/jdk/src/java.base/share/classes/java/lang/Enum.java b/jdk/src/java.base/share/classes/java/lang/Enum.java
index 9a98f30..ac912f5 100644
--- a/jdk/src/java.base/share/classes/java/lang/Enum.java
+++ b/jdk/src/java.base/share/classes/java/lang/Enum.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -243,6 +243,7 @@
     /**
      * enum classes cannot have finalize methods.
      */
+    @SuppressWarnings("deprecation")
     protected final void finalize() { }
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/lang/IllegalCallerException.java b/jdk/src/java.base/share/classes/java/lang/IllegalCallerException.java
new file mode 100644
index 0000000..f882fb2
--- /dev/null
+++ b/jdk/src/java.base/share/classes/java/lang/IllegalCallerException.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang;
+
+/**
+ * Thrown to indicate that a method has been called by an inappropriate caller.
+ *
+ * @since 9
+ * @spec JPMS
+ * @see StackWalker#getCallerClass
+ */
+public class IllegalCallerException extends RuntimeException {
+    /**
+     * Constructs an IllegalCallerException with no detail message.
+     */
+    public IllegalCallerException() {
+        super();
+    }
+
+    /**
+     * Constructs an IllegalCallerException with the specified detail
+     * message.
+     *
+     * @param s the String that contains a detailed message (can be null)
+     */
+    public IllegalCallerException(String s) {
+        super(s);
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message and
+     * cause.
+     *
+     * @param  message the detail message (can be null)
+     * @param  cause the cause (can be null)
+     */
+    public IllegalCallerException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Constructs a new exception with the specified cause and a detail
+     * message of {@code (cause==null ? null : cause.toString())} (which
+     * typically contains the class and detail message of {@code cause}).
+     *
+     * @param  cause the cause (can be null)
+     */
+    public IllegalCallerException(Throwable cause) {
+        super(cause);
+    }
+
+    static final long serialVersionUID = -2349421918363102232L;
+}
diff --git a/jdk/src/java.base/share/classes/java/lang/Integer.java b/jdk/src/java.base/share/classes/java/lang/Integer.java
index 8164b20..685d77c 100644
--- a/jdk/src/java.base/share/classes/java/lang/Integer.java
+++ b/jdk/src/java.base/share/classes/java/lang/Integer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -386,7 +386,7 @@
     }
 
     /** byte[]/UTF16 version    */
-    static void formatUnsignedIntUTF16(int val, int shift, byte[] buf, int offset, int len) {
+    private static void formatUnsignedIntUTF16(int val, int shift, byte[] buf, int offset, int len) {
         int charPos = offset + len;
         int radix = 1 << shift;
         int mask = radix - 1;
@@ -442,7 +442,7 @@
             return new String(buf, LATIN1);
         } else {
             byte[] buf = new byte[size * 2];
-            getCharsUTF16(i, size, buf);
+            StringUTF16.getChars(i, size, buf);
             return new String(buf, UTF16);
         }
     }
@@ -516,49 +516,6 @@
         return charPos;
     }
 
-    /**
-     * This is a variant of {@link #getChars(int, int, byte[])}, but for
-     * UTF-16 coder.
-     *
-     * @param i     value to convert
-     * @param index next index, after the least significant digit
-     * @param buf   target buffer, UTF16-coded.
-     * @return index of the most significant digit or minus sign, if present
-     */
-    static int getCharsUTF16(int i, int index, byte[] buf) {
-        int q, r;
-        int charPos = index;
-
-        boolean negative = (i < 0);
-        if (!negative) {
-            i = -i;
-        }
-
-        // Get 2 digits/iteration using ints
-        while (i <= -100) {
-            q = i / 100;
-            r = (q * 100) - i;
-            i = q;
-            StringUTF16.putChar(buf, --charPos, DigitOnes[r]);
-            StringUTF16.putChar(buf, --charPos, DigitTens[r]);
-        }
-
-        // We know there are at most two digits left at this point.
-        q = i / 10;
-        r = (q * 10) - i;
-        StringUTF16.putChar(buf, --charPos, '0' + r);
-
-        // Whatever left is the remaining digit.
-        if (q < 0) {
-            StringUTF16.putChar(buf, --charPos, '0' - q);
-        }
-
-        if (negative) {
-            StringUTF16.putChar(buf, --charPos, '-');
-        }
-        return charPos;
-    }
-
     // Left here for compatibility reasons, see JDK-8143900.
     static final int [] sizeTable = { 9, 99, 999, 9999, 99999, 999999, 9999999,
                                       99999999, 999999999, Integer.MAX_VALUE };
diff --git a/jdk/src/java.base/share/classes/java/lang/LayerInstantiationException.java b/jdk/src/java.base/share/classes/java/lang/LayerInstantiationException.java
new file mode 100644
index 0000000..4c64fe0
--- /dev/null
+++ b/jdk/src/java.base/share/classes/java/lang/LayerInstantiationException.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang;
+
+/**
+ * Thrown when creating a {@linkplain ModuleLayer module layer} fails.
+ *
+ * @see ModuleLayer
+ * @since 9
+ * @spec JPMS
+ */
+public class LayerInstantiationException extends RuntimeException {
+    private static final long serialVersionUID = -906239691613568347L;
+
+    /**
+     * Constructs a {@code LayerInstantiationException} with no detail message.
+     */
+    public LayerInstantiationException() {
+    }
+
+    /**
+     * Constructs a {@code LayerInstantiationException} with the given detail
+     * message.
+     *
+     * @param msg
+     *        The detail message; can be {@code null}
+     */
+    public LayerInstantiationException(String msg) {
+        super(msg);
+    }
+
+    /**
+     * Constructs a {@code LayerInstantiationException} with the given cause.
+     *
+     * @param cause
+     *        The cause; can be {@code null}
+     */
+    public LayerInstantiationException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructs a {@code FindException} with the given detail message
+     * and cause.
+     *
+     * @param msg
+     *        The detail message; can be {@code null}
+     * @param cause
+     *        The cause; can be {@code null}
+     */
+    public LayerInstantiationException(String msg, Throwable cause) {
+        super(msg, cause);
+    }
+
+}
+
diff --git a/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java b/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java
index 5be4872..13dfa34 100644
--- a/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java
+++ b/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,14 +55,36 @@
      *
      * <p>A single local variable can hold a value of type boolean, byte, char,
      * short, int, float, reference or returnAddress.  A pair of local variables
-     * can hold a value of type long or double.  In other words,
-     * a value of type long or type double occupies two consecutive local
-     * variables.  For a value of primitive type, the element in the
-     * local variable array is an {@link PrimitiveValue} object;
-     * otherwise, the element is an {@code Object}.
+     * can hold a value of type long or double (JVMS section 2.6.1).  Primitive
+     * locals are represented in the returned array as {@code PrimitiveSlot}s,
+     * with longs and doubles occupying a pair of consecutive
+     * {@code PrimitiveSlot}s.
      *
-     * <p>The returned array may contain null entries if a local variable is not
-     * live.
+     * <p>The current VM implementation does not provide specific type
+     * information for primitive locals.  This method simply returns the raw
+     * contents of the VM's primitive locals on a best-effort basis, without
+     * indicating a specific type.
+     *
+     * <p>The returned array may contain null entries for local variables that
+     * are not live.
+     *
+     * @implNote
+     * <p> The specific subclass of {@code PrimitiveSlot} will reflect the
+     * underlying architecture, and will be either {@code PrimitiveSlot32} or
+     * {@code PrimitiveSlot64}.
+     *
+     * <p>How a long or double value is stored in the pair of
+     * {@code PrimitiveSlot}s can vary based on the underlying architecture and
+     * VM implementation.  On 32-bit architectures, long/double values are split
+     * between the two {@code PrimitiveSlot32}s.
+     * On 64-bit architectures, the entire value may be stored in one of the
+     * {@code PrimitiveSlot64}s, with the other {@code PrimitiveSlot64} being
+     * unused.
+     *
+     * <p>The contents of the unused, high-order portion of a
+     * {@code PrimitiveSlot64} (when storing a primitive other than a long or
+     * double) is unspecified.  In particular, the unused bits are not
+     * necessarily zeroed out.
      *
      * @return  the local variable array of this stack frame.
      */
@@ -78,7 +100,7 @@
      * <p>Each entry on the operand stack can hold a value of any Java Virtual
      * Machine Type.
      * For a value of primitive type, the element in the returned array is
-     * an {@link PrimitiveValue} object; otherwise, the element is the {@code Object}
+     * a {@link PrimitiveSlot} object; otherwise, the element is the {@code Object}
      * on the operand stack.
      *
      * @return the operand stack of this stack frame.
@@ -87,107 +109,37 @@
 
     /**
      * <em>UNSUPPORTED</em> This interface is intended to be package-private
-     * or move to an internal package.<p>
+     * or moved to an internal package.<p>
      *
-     * Represents a local variable or an entry on the operand whose value is
+     * Represents a local variable or an entry on the operand stack whose value is
      * of primitive type.
      */
-    public abstract class PrimitiveValue {
+    public abstract class PrimitiveSlot {
         /**
-         * Returns the base type of this primitive value, one of
-         * {@code B, D, C, F, I, J, S, Z}.
-         *
-         * @return Name of a base type
-         * @jvms table 4.3-A
+         * Returns the size, in bytes, of the slot.
          */
-        abstract char type();
+        public abstract int size();
 
         /**
-         * Returns the boolean value if this primitive value is of type boolean.
-         * @return the boolean value if this primitive value is of type boolean.
+         * Returns the int value if this primitive value is of size 4
+         * @return the int value if this primitive value is of size 4
          *
          * @throws UnsupportedOperationException if this primitive value is not
-         * of type boolean.
-         */
-        public boolean booleanValue() {
-            throw new UnsupportedOperationException("this primitive of type " + type());
-        }
-
-        /**
-         * Returns the int value if this primitive value is of type int.
-         * @return the int value if this primitive value is of type int.
-         *
-         * @throws UnsupportedOperationException if this primitive value is not
-         * of type int.
+         * of size 4.
          */
         public int intValue() {
-            throw new UnsupportedOperationException("this primitive of type " + type());
+            throw new UnsupportedOperationException("this " + size() + "-byte primitive");
         }
 
         /**
-         * Returns the long value if this primitive value is of type long.
-         * @return the long value if this primitive value is of type long.
+         * Returns the long value if this primitive value is of size 8
+         * @return the long value if this primitive value is of size 8
          *
          * @throws UnsupportedOperationException if this primitive value is not
-         * of type long.
+         * of size 8.
          */
         public long longValue() {
-            throw new UnsupportedOperationException("this primitive of type " + type());
-        }
-
-        /**
-         * Returns the char value if this primitive value is of type char.
-         * @return the char value if this primitive value is of type char.
-         *
-         * @throws UnsupportedOperationException if this primitive value is not
-         * of type char.
-         */
-        public char charValue() {
-            throw new UnsupportedOperationException("this primitive of type " + type());
-        }
-
-        /**
-         * Returns the byte value if this primitive value is of type byte.
-         * @return the byte value if this primitive value is of type byte.
-         *
-         * @throws UnsupportedOperationException if this primitive value is not
-         * of type byte.
-         */
-        public byte byteValue() {
-            throw new UnsupportedOperationException("this primitive of type " + type());
-        }
-
-        /**
-         * Returns the short value if this primitive value is of type short.
-         * @return the short value if this primitive value is of type short.
-         *
-         * @throws UnsupportedOperationException if this primitive value is not
-         * of type short.
-         */
-        public short shortValue() {
-            throw new UnsupportedOperationException("this primitive of type " + type());
-        }
-
-        /**
-         * Returns the float value if this primitive value is of type float.
-         * @return the float value if this primitive value is of type float.
-         *
-         * @throws UnsupportedOperationException if this primitive value is not
-         * of type float.
-         */
-        public float floatValue() {
-            throw new UnsupportedOperationException("this primitive of type " + type());
-        }
-
-        /**
-         * Returns the double value if this primitive value is of type double.
-         * @return the double value if this primitive value is of type double.
-         *
-         * @throws UnsupportedOperationException if this primitive value is not
-         * of type double.
-         */
-        public double doubleValue() {
-            throw new UnsupportedOperationException("this primitive of type " + type());
+            throw new UnsupportedOperationException("this " + size() + "-byte primitive");
         }
     }
 
@@ -217,7 +169,7 @@
      * it denies access to {@code RuntimePermission("liveStackFrames")}; or
      * or if the given {@code options} contains
      * {@link StackWalker.Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE}
-     * and it denies access to {@code StackFramePermission("retainClassReference")}.
+     * and it denies access to {@code RuntimePermission("getStackWalkerWithClassReference")}.
      */
     public static StackWalker getStackWalker(Set<StackWalker.Option> options) {
         SecurityManager sm = System.getSecurityManager();
diff --git a/jdk/src/java.base/share/classes/java/lang/LiveStackFrameInfo.java b/jdk/src/java.base/share/classes/java/lang/LiveStackFrameInfo.java
index db8901e..b6583ad 100644
--- a/jdk/src/java.base/share/classes/java/lang/LiveStackFrameInfo.java
+++ b/jdk/src/java.base/share/classes/java/lang/LiveStackFrameInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,15 +24,13 @@
  */
 package java.lang;
 
-import java.lang.StackWalker.Option;
-import java.util.EnumSet;
-import java.util.Set;
-
-import static java.lang.StackWalker.ExtendedOption.*;
-
 final class LiveStackFrameInfo extends StackFrameInfo implements LiveStackFrame {
     private static Object[] EMPTY_ARRAY = new Object[0];
 
+    // These flags must match the values maintained in the VM
+    private static final int MODE_INTERPRETED = 0x01;
+    private static final int MODE_COMPILED    = 0x02;
+
     LiveStackFrameInfo(StackWalker walker) {
         super(walker);
     }
@@ -41,6 +39,7 @@
     private Object[] monitors = EMPTY_ARRAY;
     private Object[] locals = EMPTY_ARRAY;
     private Object[] operands = EMPTY_ARRAY;
+    private int mode = 0;
 
     @Override
     public Object[] getMonitors() {
@@ -57,51 +56,44 @@
         return operands;
     }
 
+    @Override
+    public String toString() {
+        StringBuilder retVal = new StringBuilder(super.toString());
+        if (mode != 0) {
+            retVal.append("(");
+            if ((mode & MODE_INTERPRETED) == MODE_INTERPRETED) {
+                retVal.append(" interpreted ");
+            }
+            if ((mode & MODE_COMPILED) == MODE_COMPILED) {
+                retVal.append(" compiled ");
+            }
+            retVal.append(")");
+        }
+        return retVal.toString();
+    }
+
     /*
-     * Convert primitive value to {@code Primitive} object to represent
+     * Convert primitive value to {@code PrimitiveSlot} object to represent
      * a local variable or an element on the operand stack of primitive type.
      */
-    static PrimitiveValue asPrimitive(boolean value) {
-        return new BooleanPrimitive(value);
+
+    static PrimitiveSlot asPrimitive(int value) {
+        return new PrimitiveSlot32(value);
     }
 
-    static PrimitiveValue asPrimitive(int value) {
-        return new IntPrimitive(value);
+    static PrimitiveSlot asPrimitive(long value) {
+        return new PrimitiveSlot64(value);
     }
 
-    static PrimitiveValue asPrimitive(short value) {
-        return new ShortPrimitive(value);
-    }
-
-    static PrimitiveValue asPrimitive(char value) {
-        return new CharPrimitive(value);
-    }
-
-    static PrimitiveValue asPrimitive(byte value) {
-        return new BytePrimitive(value);
-    }
-
-    static PrimitiveValue asPrimitive(long value) {
-        return new LongPrimitive(value);
-    }
-
-    static PrimitiveValue asPrimitive(float value) {
-        return new FloatPrimitive(value);
-    }
-
-    static PrimitiveValue asPrimitive(double value) {
-        return new DoublePrimitive(value);
-    }
-
-    private static class IntPrimitive extends PrimitiveValue {
+    private static class PrimitiveSlot32 extends PrimitiveSlot {
         final int value;
-        IntPrimitive(int value) {
+        PrimitiveSlot32(int value) {
             this.value = value;
         }
 
         @Override
-        public char type() {
-            return 'I';
+        public int size() {
+            return 4;
         }
 
         @Override
@@ -115,103 +107,15 @@
         }
     }
 
-    private static class ShortPrimitive extends PrimitiveValue {
-        final short value;
-        ShortPrimitive(short value) {
-            this.value = value;
-        }
-
-        @Override
-        public char type() {
-            return 'S';
-        }
-
-        @Override
-        public short shortValue() {
-            return value;
-        }
-
-        @Override
-        public String toString() {
-            return String.valueOf(value);
-        }
-    }
-
-    private static class BooleanPrimitive extends PrimitiveValue {
-        final boolean value;
-        BooleanPrimitive(boolean value) {
-            this.value = value;
-        }
-
-        @Override
-        public char type() {
-            return 'Z';
-        }
-
-        @Override
-        public boolean booleanValue()  {
-            return value;
-        }
-
-        @Override
-        public String toString() {
-            return String.valueOf(value);
-        }
-    }
-
-    private static class CharPrimitive extends PrimitiveValue {
-        final char value;
-        CharPrimitive(char value) {
-            this.value = value;
-        }
-
-        @Override
-        public char type() {
-            return 'C';
-        }
-
-        @Override
-        public char charValue() {
-            return value;
-        }
-
-        @Override
-        public String toString() {
-            return String.valueOf(value);
-        }
-    }
-
-    private static class BytePrimitive extends PrimitiveValue {
-        final byte value;
-        BytePrimitive(byte value) {
-            this.value = value;
-        }
-
-        @Override
-        public char type() {
-            return 'B';
-        }
-
-        @Override
-        public byte byteValue() {
-            return value;
-        }
-
-        @Override
-        public String toString() {
-            return String.valueOf(value);
-        }
-    }
-
-    private static class LongPrimitive extends PrimitiveValue {
+    private static class PrimitiveSlot64 extends PrimitiveSlot {
         final long value;
-        LongPrimitive(long value) {
+        PrimitiveSlot64(long value) {
             this.value = value;
         }
 
         @Override
-        public char type() {
-            return 'J';
+        public int size() {
+            return 8;
         }
 
         @Override
@@ -224,48 +128,4 @@
             return String.valueOf(value);
         }
     }
-
-    private static class FloatPrimitive extends PrimitiveValue {
-        final float value;
-        FloatPrimitive(float value) {
-            this.value = value;
-        }
-
-        @Override
-        public char type() {
-            return 'F';
-        }
-
-        @Override
-        public float floatValue() {
-            return value;
-        }
-
-        @Override
-        public String toString() {
-            return String.valueOf(value);
-        }
-    }
-
-    private static class DoublePrimitive extends PrimitiveValue {
-        final double value;
-        DoublePrimitive(double value) {
-            this.value = value;
-        }
-
-        @Override
-        public char type() {
-            return 'D';
-        }
-
-        @Override
-        public double doubleValue() {
-            return value;
-        }
-
-        @Override
-        public String toString() {
-            return String.valueOf(value);
-        }
-    }
 }
diff --git a/jdk/src/java.base/share/classes/java/lang/Long.java b/jdk/src/java.base/share/classes/java/lang/Long.java
index 103389c..9d298ca 100644
--- a/jdk/src/java.base/share/classes/java/lang/Long.java
+++ b/jdk/src/java.base/share/classes/java/lang/Long.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -414,7 +414,7 @@
     }
 
     /** byte[]/UTF16 version    */
-    static void formatUnsignedLong0UTF16(long val, int shift, byte[] buf, int offset, int len) {
+    private static void formatUnsignedLong0UTF16(long val, int shift, byte[] buf, int offset, int len) {
         int charPos = offset + len;
         int radix = 1 << shift;
         int mask = radix - 1;
@@ -475,7 +475,7 @@
             return new String(buf, LATIN1);
         } else {
             byte[] buf = new byte[size * 2];
-            getCharsUTF16(i, size, buf);
+            StringUTF16.getChars(i, size, buf);
             return new String(buf, UTF16);
         }
     }
@@ -562,61 +562,6 @@
     }
 
     /**
-     * This is a variant of {@link #getChars(long, int, byte[])}, but for
-     * UTF-16 coder.
-     *
-     * @param i     value to convert
-     * @param index next index, after the least significant digit
-     * @param buf   target buffer, UTF16-coded.
-     * @return index of the most significant digit or minus sign, if present
-     */
-    static int getCharsUTF16(long i, int index, byte[] buf) {
-        long q;
-        int r;
-        int charPos = index;
-
-        boolean negative = (i < 0);
-        if (!negative) {
-            i = -i;
-        }
-
-        // Get 2 digits/iteration using longs until quotient fits into an int
-        while (i <= Integer.MIN_VALUE) {
-            q = i / 100;
-            r = (int)((q * 100) - i);
-            i = q;
-            StringUTF16.putChar(buf, --charPos, Integer.DigitOnes[r]);
-            StringUTF16.putChar(buf, --charPos, Integer.DigitTens[r]);
-        }
-
-        // Get 2 digits/iteration using ints
-        int q2;
-        int i2 = (int)i;
-        while (i2 <= -100) {
-            q2 = i2 / 100;
-            r  = (q2 * 100) - i2;
-            i2 = q2;
-            StringUTF16.putChar(buf, --charPos, Integer.DigitOnes[r]);
-            StringUTF16.putChar(buf, --charPos, Integer.DigitTens[r]);
-        }
-
-        // We know there are at most two digits left at this point.
-        q2 = i2 / 10;
-        r  = (q2 * 10) - i2;
-        StringUTF16.putChar(buf, --charPos, '0' + r);
-
-        // Whatever left is the remaining digit.
-        if (q2 < 0) {
-            StringUTF16.putChar(buf, --charPos, '0' - q2);
-        }
-
-        if (negative) {
-            StringUTF16.putChar(buf, --charPos, '-');
-        }
-        return charPos;
-    }
-
-    /**
      * Returns the string representation size for a given long value.
      *
      * @param x long value
diff --git a/jdk/src/java.base/share/classes/java/lang/Math.java b/jdk/src/java.base/share/classes/java/lang/Math.java
index 911267d..ef02375 100644
--- a/jdk/src/java.base/share/classes/java/lang/Math.java
+++ b/jdk/src/java.base/share/classes/java/lang/Math.java
@@ -1079,6 +1079,7 @@
      * @param x the first value
      * @param y the second value
      * @return the result
+     * @since 9
      */
     public static long multiplyFull(int x, int y) {
         return (long)x * (long)y;
@@ -1091,6 +1092,7 @@
      * @param x the first value
      * @param y the second value
      * @return the result
+     * @since 9
      */
     public static long multiplyHigh(long x, long y) {
         if (x < 0 || y < 0) {
diff --git a/jdk/src/java.base/share/classes/java/lang/Module.java b/jdk/src/java.base/share/classes/java/lang/Module.java
new file mode 100644
index 0000000..26337d8
--- /dev/null
+++ b/jdk/src/java.base/share/classes/java/lang/Module.java
@@ -0,0 +1,1586 @@
+/*
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleReference;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Exports;
+import java.lang.module.ModuleDescriptor.Opens;
+import java.lang.module.ModuleDescriptor.Version;
+import java.lang.module.ResolvedModule;
+import java.lang.reflect.AnnotatedElement;
+import java.net.URI;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import jdk.internal.loader.BuiltinClassLoader;
+import jdk.internal.loader.BootLoader;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.module.ServicesCatalog;
+import jdk.internal.module.Resources;
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.reflect.CallerSensitive;
+import jdk.internal.reflect.Reflection;
+import sun.security.util.SecurityConstants;
+
+/**
+ * Represents a run-time module, either {@link #isNamed() named} or unnamed.
+ *
+ * <p> Named modules have a {@link #getName() name} and are constructed by the
+ * Java Virtual Machine when a graph of modules is defined to the Java virtual
+ * machine to create a {@linkplain ModuleLayer module layer}. </p>
+ *
+ * <p> An unnamed module does not have a name. There is an unnamed module for
+ * each {@link ClassLoader ClassLoader}, obtained by invoking its {@link
+ * ClassLoader#getUnnamedModule() getUnnamedModule} method. All types that are
+ * not in a named module are members of their defining class loader's unnamed
+ * module. </p>
+ *
+ * <p> The package names that are parameters or returned by methods defined in
+ * this class are the fully-qualified names of the packages as defined in
+ * section 6.5.3 of <cite>The Java&trade; Language Specification</cite>, for
+ * example, {@code "java.lang"}. </p>
+ *
+ * <p> Unless otherwise specified, passing a {@code null} argument to a method
+ * in this class causes a {@link NullPointerException NullPointerException} to
+ * be thrown. </p>
+ *
+ * @since 9
+ * @spec JPMS
+ * @see Class#getModule()
+ */
+
+public final class Module implements AnnotatedElement {
+
+    // the layer that contains this module, can be null
+    private final ModuleLayer layer;
+
+    // module name and loader, these fields are read by VM
+    private final String name;
+    private final ClassLoader loader;
+
+    // the module descriptor
+    private final ModuleDescriptor descriptor;
+
+
+    /**
+     * Creates a new named Module. The resulting Module will be defined to the
+     * VM but will not read any other modules, will not have any exports setup
+     * and will not be registered in the service catalog.
+     */
+    Module(ModuleLayer layer,
+           ClassLoader loader,
+           ModuleDescriptor descriptor,
+           URI uri)
+    {
+        this.layer = layer;
+        this.name = descriptor.name();
+        this.loader = loader;
+        this.descriptor = descriptor;
+
+        // define module to VM
+
+        boolean isOpen = descriptor.isOpen();
+        Version version = descriptor.version().orElse(null);
+        String vs = Objects.toString(version, null);
+        String loc = Objects.toString(uri, null);
+        String[] packages = descriptor.packages().toArray(new String[0]);
+        defineModule0(this, isOpen, vs, loc, packages);
+    }
+
+
+    /**
+     * Create the unnamed Module for the given ClassLoader.
+     *
+     * @see ClassLoader#getUnnamedModule
+     */
+    Module(ClassLoader loader) {
+        this.layer = null;
+        this.name = null;
+        this.loader = loader;
+        this.descriptor = null;
+    }
+
+
+    /**
+     * Creates a named module but without defining the module to the VM.
+     *
+     * @apiNote This constructor is for VM white-box testing.
+     */
+    Module(ClassLoader loader, ModuleDescriptor descriptor) {
+        this.layer = null;
+        this.name = descriptor.name();
+        this.loader = loader;
+        this.descriptor = descriptor;
+    }
+
+
+
+    /**
+     * Returns {@code true} if this module is a named module.
+     *
+     * @return {@code true} if this is a named module
+     *
+     * @see ClassLoader#getUnnamedModule()
+     */
+    public boolean isNamed() {
+        return name != null;
+    }
+
+    /**
+     * Returns the module name or {@code null} if this module is an unnamed
+     * module.
+     *
+     * @return The module name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Returns the {@code ClassLoader} for this module.
+     *
+     * <p> If there is a security manager then its {@code checkPermission}
+     * method if first called with a {@code RuntimePermission("getClassLoader")}
+     * permission to check that the caller is allowed to get access to the
+     * class loader. </p>
+     *
+     * @return The class loader for this module
+     *
+     * @throws SecurityException
+     *         If denied by the security manager
+     */
+    public ClassLoader getClassLoader() {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
+        }
+        return loader;
+    }
+
+    /**
+     * Returns the module descriptor for this module or {@code null} if this
+     * module is an unnamed module.
+     *
+     * @return The module descriptor for this module
+     */
+    public ModuleDescriptor getDescriptor() {
+        return descriptor;
+    }
+
+    /**
+     * Returns the layer that contains this module or {@code null} if this
+     * module is not in a layer.
+     *
+     * A module layer contains named modules and therefore this method always
+     * returns {@code null} when invoked on an unnamed module.
+     *
+     * <p> <a href="reflect/Proxy.html#dynamicmodule">Dynamic modules</a> are
+     * named modules that are generated at runtime. A dynamic module may or may
+     * not be in a module layer. </p>
+     *
+     * @return The module layer that contains this module
+     *
+     * @see java.lang.reflect.Proxy
+     */
+    public ModuleLayer getLayer() {
+        if (isNamed()) {
+            ModuleLayer layer = this.layer;
+            if (layer != null)
+                return layer;
+
+            // special-case java.base as it is created before the boot layer
+            if (loader == null && name.equals("java.base")) {
+                return ModuleLayer.boot();
+            }
+        }
+        return null;
+    }
+
+
+    // --
+
+    // special Module to mean "all unnamed modules"
+    private static final Module ALL_UNNAMED_MODULE = new Module(null);
+
+    // special Module to mean "everyone"
+    private static final Module EVERYONE_MODULE = new Module(null);
+
+    // set contains EVERYONE_MODULE, used when a package is opened or
+    // exported unconditionally
+    private static final Set<Module> EVERYONE_SET = Set.of(EVERYONE_MODULE);
+
+
+    // -- readability --
+
+    // the modules that this module reads
+    private volatile Set<Module> reads;
+
+    // additional module (2nd key) that some module (1st key) reflectively reads
+    private static final WeakPairMap<Module, Module, Boolean> reflectivelyReads
+        = new WeakPairMap<>();
+
+
+    /**
+     * Indicates if this module reads the given module. This method returns
+     * {@code true} if invoked to test if this module reads itself. It also
+     * returns {@code true} if invoked on an unnamed module (as unnamed
+     * modules read all modules).
+     *
+     * @param  other
+     *         The other module
+     *
+     * @return {@code true} if this module reads {@code other}
+     *
+     * @see #addReads(Module)
+     */
+    public boolean canRead(Module other) {
+        Objects.requireNonNull(other);
+
+        // an unnamed module reads all modules
+        if (!this.isNamed())
+            return true;
+
+        // all modules read themselves
+        if (other == this)
+            return true;
+
+        // check if this module reads other
+        if (other.isNamed()) {
+            Set<Module> reads = this.reads; // volatile read
+            if (reads != null && reads.contains(other))
+                return true;
+        }
+
+        // check if this module reads the other module reflectively
+        if (reflectivelyReads.containsKeyPair(this, other))
+            return true;
+
+        // if other is an unnamed module then check if this module reads
+        // all unnamed modules
+        if (!other.isNamed()
+            && reflectivelyReads.containsKeyPair(this, ALL_UNNAMED_MODULE))
+            return true;
+
+        return false;
+    }
+
+    /**
+     * If the caller's module is this module then update this module to read
+     * the given module.
+     *
+     * This method is a no-op if {@code other} is this module (all modules read
+     * themselves), this module is an unnamed module (as unnamed modules read
+     * all modules), or this module already reads {@code other}.
+     *
+     * @implNote <em>Read edges</em> added by this method are <em>weak</em> and
+     * do not prevent {@code other} from being GC'ed when this module is
+     * strongly reachable.
+     *
+     * @param  other
+     *         The other module
+     *
+     * @return this module
+     *
+     * @throws IllegalCallerException
+     *         If this is a named module and the caller's module is not this
+     *         module
+     *
+     * @see #canRead
+     */
+    @CallerSensitive
+    public Module addReads(Module other) {
+        Objects.requireNonNull(other);
+        if (this.isNamed()) {
+            Module caller = getCallerModule(Reflection.getCallerClass());
+            if (caller != this) {
+                throw new IllegalCallerException(caller + " != " + this);
+            }
+            implAddReads(other, true);
+        }
+        return this;
+    }
+
+    /**
+     * Updates this module to read another module.
+     *
+     * @apiNote Used by the --add-reads command line option.
+     */
+    void implAddReads(Module other) {
+        implAddReads(other, true);
+    }
+
+    /**
+     * Updates this module to read all unnamed modules.
+     *
+     * @apiNote Used by the --add-reads command line option.
+     */
+    void implAddReadsAllUnnamed() {
+        implAddReads(Module.ALL_UNNAMED_MODULE, true);
+    }
+
+    /**
+     * Updates this module to read another module without notifying the VM.
+     *
+     * @apiNote This method is for VM white-box testing.
+     */
+    void implAddReadsNoSync(Module other) {
+        implAddReads(other, false);
+    }
+
+    /**
+     * Makes the given {@code Module} readable to this module.
+     *
+     * If {@code syncVM} is {@code true} then the VM is notified.
+     */
+    private void implAddReads(Module other, boolean syncVM) {
+        Objects.requireNonNull(other);
+        if (!canRead(other)) {
+            // update VM first, just in case it fails
+            if (syncVM) {
+                if (other == ALL_UNNAMED_MODULE) {
+                    addReads0(this, null);
+                } else {
+                    addReads0(this, other);
+                }
+            }
+
+            // add reflective read
+            reflectivelyReads.putIfAbsent(this, other, Boolean.TRUE);
+        }
+    }
+
+
+    // -- exported and open packages --
+
+    // the packages are open to other modules, can be null
+    // if the value contains EVERYONE_MODULE then the package is open to all
+    private volatile Map<String, Set<Module>> openPackages;
+
+    // the packages that are exported, can be null
+    // if the value contains EVERYONE_MODULE then the package is exported to all
+    private volatile Map<String, Set<Module>> exportedPackages;
+
+    // additional exports or opens added at run-time
+    // this module (1st key), other module (2nd key)
+    // (package name, open?) (value)
+    private static final WeakPairMap<Module, Module, Map<String, Boolean>>
+        reflectivelyExports = new WeakPairMap<>();
+
+
+    /**
+     * Returns {@code true} if this module exports the given package to at
+     * least the given module.
+     *
+     * <p> This method returns {@code true} if invoked to test if a package in
+     * this module is exported to itself. It always returns {@code true} when
+     * invoked on an unnamed module. A package that is {@link #isOpen open} to
+     * the given module is considered exported to that module at run-time and
+     * so this method returns {@code true} if the package is open to the given
+     * module. </p>
+     *
+     * <p> This method does not check if the given module reads this module. </p>
+     *
+     * @param  pn
+     *         The package name
+     * @param  other
+     *         The other module
+     *
+     * @return {@code true} if this module exports the package to at least the
+     *         given module
+     *
+     * @see ModuleDescriptor#exports()
+     * @see #addExports(String,Module)
+     */
+    public boolean isExported(String pn, Module other) {
+        Objects.requireNonNull(pn);
+        Objects.requireNonNull(other);
+        return implIsExportedOrOpen(pn, other, /*open*/false);
+    }
+
+    /**
+     * Returns {@code true} if this module has <em>opened</em> a package to at
+     * least the given module.
+     *
+     * <p> This method returns {@code true} if invoked to test if a package in
+     * this module is open to itself. It returns {@code true} when invoked on an
+     * {@link ModuleDescriptor#isOpen open} module with a package in the module.
+     * It always returns {@code true} when invoked on an unnamed module. </p>
+     *
+     * <p> This method does not check if the given module reads this module. </p>
+     *
+     * @param  pn
+     *         The package name
+     * @param  other
+     *         The other module
+     *
+     * @return {@code true} if this module has <em>opened</em> the package
+     *         to at least the given module
+     *
+     * @see ModuleDescriptor#opens()
+     * @see #addOpens(String,Module)
+     * @see AccessibleObject#setAccessible(boolean)
+     * @see java.lang.invoke.MethodHandles#privateLookupIn
+     */
+    public boolean isOpen(String pn, Module other) {
+        Objects.requireNonNull(pn);
+        Objects.requireNonNull(other);
+        return implIsExportedOrOpen(pn, other, /*open*/true);
+    }
+
+    /**
+     * Returns {@code true} if this module exports the given package
+     * unconditionally.
+     *
+     * <p> This method always returns {@code true} when invoked on an unnamed
+     * module. A package that is {@link #isOpen(String) opened} unconditionally
+     * is considered exported unconditionally at run-time and so this method
+     * returns {@code true} if the package is opened unconditionally. </p>
+     *
+     * <p> This method does not check if the given module reads this module. </p>
+     *
+     * @param  pn
+     *         The package name
+     *
+     * @return {@code true} if this module exports the package unconditionally
+     *
+     * @see ModuleDescriptor#exports()
+     */
+    public boolean isExported(String pn) {
+        Objects.requireNonNull(pn);
+        return implIsExportedOrOpen(pn, EVERYONE_MODULE, /*open*/false);
+    }
+
+    /**
+     * Returns {@code true} if this module has <em>opened</em> a package
+     * unconditionally.
+     *
+     * <p> This method always returns {@code true} when invoked on an unnamed
+     * module. Additionally, it always returns {@code true} when invoked on an
+     * {@link ModuleDescriptor#isOpen open} module with a package in the
+     * module. </p>
+     *
+     * <p> This method does not check if the given module reads this module. </p>
+     *
+     * @param  pn
+     *         The package name
+     *
+     * @return {@code true} if this module has <em>opened</em> the package
+     *         unconditionally
+     *
+     * @see ModuleDescriptor#opens()
+     */
+    public boolean isOpen(String pn) {
+        Objects.requireNonNull(pn);
+        return implIsExportedOrOpen(pn, EVERYONE_MODULE, /*open*/true);
+    }
+
+
+    /**
+     * Returns {@code true} if this module exports or opens the given package
+     * to the given module. If the other module is {@code EVERYONE_MODULE} then
+     * this method tests if the package is exported or opened unconditionally.
+     */
+    private boolean implIsExportedOrOpen(String pn, Module other, boolean open) {
+        // all packages in unnamed modules are open
+        if (!isNamed())
+            return true;
+
+        // all packages are exported/open to self
+        if (other == this && containsPackage(pn))
+            return true;
+
+        // all packages in open and automatic modules are open
+        if (descriptor.isOpen() || descriptor.isAutomatic())
+            return containsPackage(pn);
+
+        // exported/opened via module declaration/descriptor
+        if (isStaticallyExportedOrOpen(pn, other, open))
+            return true;
+
+        // exported via addExports/addOpens
+        if (isReflectivelyExportedOrOpen(pn, other, open))
+            return true;
+
+        // not exported or open to other
+        return false;
+    }
+
+    /**
+     * Returns {@code true} if this module exports or opens a package to
+     * the given module via its module declaration.
+     */
+    private boolean isStaticallyExportedOrOpen(String pn, Module other, boolean open) {
+        // package is open to everyone or <other>
+        Map<String, Set<Module>> openPackages = this.openPackages;
+        if (openPackages != null) {
+            Set<Module> targets = openPackages.get(pn);
+            if (targets != null) {
+                if (targets.contains(EVERYONE_MODULE))
+                    return true;
+                if (other != EVERYONE_MODULE && targets.contains(other))
+                    return true;
+            }
+        }
+
+        if (!open) {
+            // package is exported to everyone or <other>
+            Map<String, Set<Module>> exportedPackages = this.exportedPackages;
+            if (exportedPackages != null) {
+                Set<Module> targets = exportedPackages.get(pn);
+                if (targets != null) {
+                    if (targets.contains(EVERYONE_MODULE))
+                        return true;
+                    if (other != EVERYONE_MODULE && targets.contains(other))
+                        return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Returns {@code true} if this module reflectively exports or opens given
+     * package package to the given module.
+     */
+    private boolean isReflectivelyExportedOrOpen(String pn, Module other, boolean open) {
+        // exported or open to all modules
+        Map<String, Boolean> exports = reflectivelyExports.get(this, EVERYONE_MODULE);
+        if (exports != null) {
+            Boolean b = exports.get(pn);
+            if (b != null) {
+                boolean isOpen = b.booleanValue();
+                if (!open || isOpen) return true;
+            }
+        }
+
+        if (other != EVERYONE_MODULE) {
+
+            // exported or open to other
+            exports = reflectivelyExports.get(this, other);
+            if (exports != null) {
+                Boolean b = exports.get(pn);
+                if (b != null) {
+                    boolean isOpen = b.booleanValue();
+                    if (!open || isOpen) return true;
+                }
+            }
+
+            // other is an unnamed module && exported or open to all unnamed
+            if (!other.isNamed()) {
+                exports = reflectivelyExports.get(this, ALL_UNNAMED_MODULE);
+                if (exports != null) {
+                    Boolean b = exports.get(pn);
+                    if (b != null) {
+                        boolean isOpen = b.booleanValue();
+                        if (!open || isOpen) return true;
+                    }
+                }
+            }
+
+        }
+
+        return false;
+    }
+
+
+    /**
+     * If the caller's module is this module then update this module to export
+     * the given package to the given module.
+     *
+     * <p> This method has no effect if the package is already exported (or
+     * <em>open</em>) to the given module. </p>
+     *
+     * @apiNote As specified in section 5.4.3 of the <cite>The Java&trade;
+     * Virtual Machine Specification </cite>, if an attempt to resolve a
+     * symbolic reference fails because of a linkage error, then subsequent
+     * attempts to resolve the reference always fail with the same error that
+     * was thrown as a result of the initial resolution attempt.
+     *
+     * @param  pn
+     *         The package name
+     * @param  other
+     *         The module
+     *
+     * @return this module
+     *
+     * @throws IllegalArgumentException
+     *         If {@code pn} is {@code null}, or this is a named module and the
+     *         package {@code pn} is not a package in this module
+     * @throws IllegalCallerException
+     *         If this is a named module and the caller's module is not this
+     *         module
+     *
+     * @jvms 5.4.3 Resolution
+     * @see #isExported(String,Module)
+     */
+    @CallerSensitive
+    public Module addExports(String pn, Module other) {
+        if (pn == null)
+            throw new IllegalArgumentException("package is null");
+        Objects.requireNonNull(other);
+
+        if (isNamed()) {
+            Module caller = getCallerModule(Reflection.getCallerClass());
+            if (caller != this) {
+                throw new IllegalCallerException(caller + " != " + this);
+            }
+            implAddExportsOrOpens(pn, other, /*open*/false, /*syncVM*/true);
+        }
+
+        return this;
+    }
+
+    /**
+     * If this module has <em>opened</em> a package to at least the caller
+     * module then update this module to open the package to the given module.
+     * Opening a package with this method allows all types in the package,
+     * and all their members, not just public types and their public members,
+     * to be reflected on by the given module when using APIs that support
+     * private access or a way to bypass or suppress default Java language
+     * access control checks.
+     *
+     * <p> This method has no effect if the package is already <em>open</em>
+     * to the given module. </p>
+     *
+     * @param  pn
+     *         The package name
+     * @param  other
+     *         The module
+     *
+     * @return this module
+     *
+     * @throws IllegalArgumentException
+     *         If {@code pn} is {@code null}, or this is a named module and the
+     *         package {@code pn} is not a package in this module
+     * @throws IllegalCallerException
+     *         If this is a named module and this module has not opened the
+     *         package to at least the caller's module
+     *
+     * @see #isOpen(String,Module)
+     * @see AccessibleObject#setAccessible(boolean)
+     * @see java.lang.invoke.MethodHandles#privateLookupIn
+     */
+    @CallerSensitive
+    public Module addOpens(String pn, Module other) {
+        if (pn == null)
+            throw new IllegalArgumentException("package is null");
+        Objects.requireNonNull(other);
+
+        if (isNamed()) {
+            Module caller = getCallerModule(Reflection.getCallerClass());
+            if (caller != this && (caller == null || !isOpen(pn, caller)))
+                throw new IllegalCallerException(pn + " is not open to " + caller);
+            implAddExportsOrOpens(pn, other, /*open*/true, /*syncVM*/true);
+        }
+
+        return this;
+    }
+
+
+    /**
+     * Updates this module to export a package unconditionally.
+     *
+     * @apiNote This method is for JDK tests only.
+     */
+    void implAddExports(String pn) {
+        implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, false, true);
+    }
+
+    /**
+     * Updates this module to export a package to another module.
+     *
+     * @apiNote Used by Instrumentation::redefineModule and --add-exports
+     */
+    void implAddExports(String pn, Module other) {
+        implAddExportsOrOpens(pn, other, false, true);
+    }
+
+    /**
+     * Updates this module to export a package to all unnamed modules.
+     *
+     * @apiNote Used by the --add-exports command line option.
+     */
+    void implAddExportsToAllUnnamed(String pn) {
+        implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, false, true);
+    }
+
+    /**
+     * Updates this export to export a package unconditionally without
+     * notifying the VM.
+     *
+     * @apiNote This method is for VM white-box testing.
+     */
+    void implAddExportsNoSync(String pn) {
+        implAddExportsOrOpens(pn.replace('/', '.'), Module.EVERYONE_MODULE, false, false);
+    }
+
+    /**
+     * Updates a module to export a package to another module without
+     * notifying the VM.
+     *
+     * @apiNote This method is for VM white-box testing.
+     */
+    void implAddExportsNoSync(String pn, Module other) {
+        implAddExportsOrOpens(pn.replace('/', '.'), other, false, false);
+    }
+
+    /**
+     * Updates this module to open a package unconditionally.
+     *
+     * @apiNote This method is for JDK tests only.
+     */
+    void implAddOpens(String pn) {
+        implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, true, true);
+    }
+
+    /**
+     * Updates this module to open a package to another module.
+     *
+     * @apiNote Used by Instrumentation::redefineModule and --add-opens
+     */
+    void implAddOpens(String pn, Module other) {
+        implAddExportsOrOpens(pn, other, true, true);
+    }
+
+    /**
+     * Updates this module to export a package to all unnamed modules.
+     *
+     * @apiNote Used by the --add-opens command line option.
+     */
+    void implAddOpensToAllUnnamed(String pn) {
+        implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, true, true);
+    }
+
+
+    /**
+     * Updates a module to export or open a module to another module.
+     *
+     * If {@code syncVM} is {@code true} then the VM is notified.
+     */
+    private void implAddExportsOrOpens(String pn,
+                                       Module other,
+                                       boolean open,
+                                       boolean syncVM) {
+        Objects.requireNonNull(other);
+        Objects.requireNonNull(pn);
+
+        // all packages are open in unnamed, open, and automatic modules
+        if (!isNamed() || descriptor.isOpen() || descriptor.isAutomatic())
+            return;
+
+        // nothing to do if already exported/open to other
+        if (implIsExportedOrOpen(pn, other, open))
+            return;
+
+        // can only export a package in the module
+        if (!containsPackage(pn)) {
+            throw new IllegalArgumentException("package " + pn
+                                               + " not in contents");
+        }
+
+        // update VM first, just in case it fails
+        if (syncVM) {
+            if (other == EVERYONE_MODULE) {
+                addExportsToAll0(this, pn);
+            } else if (other == ALL_UNNAMED_MODULE) {
+                addExportsToAllUnnamed0(this, pn);
+            } else {
+                addExports0(this, pn, other);
+            }
+        }
+
+        // add package name to reflectivelyExports if absent
+        Map<String, Boolean> map = reflectivelyExports
+            .computeIfAbsent(this, other,
+                             (m1, m2) -> new ConcurrentHashMap<>());
+
+        if (open) {
+            map.put(pn, Boolean.TRUE);  // may need to promote from FALSE to TRUE
+        } else {
+            map.putIfAbsent(pn, Boolean.FALSE);
+        }
+    }
+
+
+    // -- services --
+
+    // additional service type (2nd key) that some module (1st key) uses
+    private static final WeakPairMap<Module, Class<?>, Boolean> reflectivelyUses
+        = new WeakPairMap<>();
+
+    /**
+     * If the caller's module is this module then update this module to add a
+     * service dependence on the given service type. This method is intended
+     * for use by frameworks that invoke {@link java.util.ServiceLoader
+     * ServiceLoader} on behalf of other modules or where the framework is
+     * passed a reference to the service type by other code. This method is
+     * a no-op when invoked on an unnamed module or an automatic module.
+     *
+     * <p> This method does not cause {@link Configuration#resolveAndBind
+     * resolveAndBind} to be re-run. </p>
+     *
+     * @param  service
+     *         The service type
+     *
+     * @return this module
+     *
+     * @throws IllegalCallerException
+     *         If this is a named module and the caller's module is not this
+     *         module
+     *
+     * @see #canUse(Class)
+     * @see ModuleDescriptor#uses()
+     */
+    @CallerSensitive
+    public Module addUses(Class<?> service) {
+        Objects.requireNonNull(service);
+
+        if (isNamed() && !descriptor.isAutomatic()) {
+            Module caller = getCallerModule(Reflection.getCallerClass());
+            if (caller != this) {
+                throw new IllegalCallerException(caller + " != " + this);
+            }
+            implAddUses(service);
+        }
+
+        return this;
+    }
+
+    /**
+     * Update this module to add a service dependence on the given service
+     * type.
+     */
+    void implAddUses(Class<?> service) {
+        if (!canUse(service)) {
+            reflectivelyUses.putIfAbsent(this, service, Boolean.TRUE);
+        }
+    }
+
+
+    /**
+     * Indicates if this module has a service dependence on the given service
+     * type. This method always returns {@code true} when invoked on an unnamed
+     * module or an automatic module.
+     *
+     * @param  service
+     *         The service type
+     *
+     * @return {@code true} if this module uses service type {@code st}
+     *
+     * @see #addUses(Class)
+     */
+    public boolean canUse(Class<?> service) {
+        Objects.requireNonNull(service);
+
+        if (!isNamed())
+            return true;
+
+        if (descriptor.isAutomatic())
+            return true;
+
+        // uses was declared
+        if (descriptor.uses().contains(service.getName()))
+            return true;
+
+        // uses added via addUses
+        return reflectivelyUses.containsKeyPair(this, service);
+    }
+
+
+
+    // -- packages --
+
+    // Additional packages that are added to the module at run-time.
+    private volatile Map<String, Boolean> extraPackages;
+
+    private boolean containsPackage(String pn) {
+        if (descriptor.packages().contains(pn))
+            return true;
+        Map<String, Boolean> extraPackages = this.extraPackages;
+        if (extraPackages != null && extraPackages.containsKey(pn))
+            return true;
+        return false;
+    }
+
+
+    /**
+     * Returns the set of package names for the packages in this module.
+     *
+     * <p> For named modules, the returned set contains an element for each
+     * package in the module. </p>
+     *
+     * <p> For unnamed modules, this method is the equivalent to invoking the
+     * {@link ClassLoader#getDefinedPackages() getDefinedPackages} method of
+     * this module's class loader and returning the set of package names. </p>
+     *
+     * @return the set of the package names of the packages in this module
+     */
+    public Set<String> getPackages() {
+        if (isNamed()) {
+
+            Set<String> packages = descriptor.packages();
+            Map<String, Boolean> extraPackages = this.extraPackages;
+            if (extraPackages == null) {
+                return packages;
+            } else {
+                return Stream.concat(packages.stream(),
+                                     extraPackages.keySet().stream())
+                        .collect(Collectors.toSet());
+            }
+
+        } else {
+            // unnamed module
+            Stream<Package> packages;
+            if (loader == null) {
+                packages = BootLoader.packages();
+            } else {
+                packages = SharedSecrets.getJavaLangAccess().packages(loader);
+            }
+            return packages.map(Package::getName).collect(Collectors.toSet());
+        }
+    }
+
+    /**
+     * Add a package to this module without notifying the VM.
+     *
+     * @apiNote This method is VM white-box testing.
+     */
+    void implAddPackageNoSync(String pn) {
+        implAddPackage(pn.replace('/', '.'), false);
+    }
+
+    /**
+     * Add a package to this module.
+     *
+     * If {@code syncVM} is {@code true} then the VM is notified. This method is
+     * a no-op if this is an unnamed module or the module already contains the
+     * package.
+     *
+     * @throws IllegalArgumentException if the package name is not legal
+     * @throws IllegalStateException if the package is defined to another module
+     */
+    private void implAddPackage(String pn, boolean syncVM) {
+        // no-op if unnamed module
+        if (!isNamed())
+            return;
+
+        // no-op if module contains the package
+        if (containsPackage(pn))
+            return;
+
+        // check package name is legal for named modules
+        if (pn.isEmpty())
+            throw new IllegalArgumentException("Cannot add <unnamed> package");
+        for (int i=0; i<pn.length(); i++) {
+            char c = pn.charAt(i);
+            if (c == '/' || c == ';' || c == '[') {
+                throw new IllegalArgumentException("Illegal character: " + c);
+            }
+        }
+
+        // create extraPackages if needed
+        Map<String, Boolean> extraPackages = this.extraPackages;
+        if (extraPackages == null) {
+            synchronized (this) {
+                extraPackages = this.extraPackages;
+                if (extraPackages == null)
+                    this.extraPackages = extraPackages = new ConcurrentHashMap<>();
+            }
+        }
+
+        // update VM first in case it fails. This is a no-op if another thread
+        // beats us to add the package first
+        if (syncVM) {
+            // throws IllegalStateException if defined to another module
+            addPackage0(this, pn);
+            if (descriptor.isOpen() || descriptor.isAutomatic()) {
+                addExportsToAll0(this, pn);
+            }
+        }
+        extraPackages.putIfAbsent(pn, Boolean.TRUE);
+    }
+
+
+    // -- creating Module objects --
+
+    /**
+     * Defines all module in a configuration to the runtime.
+     *
+     * @return a map of module name to runtime {@code Module}
+     *
+     * @throws IllegalArgumentException
+     *         If defining any of the modules to the VM fails
+     */
+    static Map<String, Module> defineModules(Configuration cf,
+                                             Function<String, ClassLoader> clf,
+                                             ModuleLayer layer)
+    {
+        Map<String, Module> nameToModule = new HashMap<>();
+        Map<String, ClassLoader> moduleToLoader = new HashMap<>();
+
+        boolean isBootLayer = (ModuleLayer.boot() == null);
+        Set<ClassLoader> loaders = new HashSet<>();
+
+        // map each module to a class loader
+        for (ResolvedModule resolvedModule : cf.modules()) {
+            String name = resolvedModule.name();
+            ClassLoader loader = clf.apply(name);
+            if (loader != null) {
+                moduleToLoader.put(name, loader);
+                loaders.add(loader);
+            } else if (!isBootLayer) {
+                throw new IllegalArgumentException("loader can't be 'null'");
+            }
+        }
+
+        // define each module in the configuration to the VM
+        for (ResolvedModule resolvedModule : cf.modules()) {
+            ModuleReference mref = resolvedModule.reference();
+            ModuleDescriptor descriptor = mref.descriptor();
+            String name = descriptor.name();
+            URI uri = mref.location().orElse(null);
+            ClassLoader loader = moduleToLoader.get(resolvedModule.name());
+            Module m;
+            if (loader == null && isBootLayer && name.equals("java.base")) {
+                // java.base is already defined to the VM
+                m = Object.class.getModule();
+            } else {
+                m = new Module(layer, loader, descriptor, uri);
+            }
+            nameToModule.put(name, m);
+            moduleToLoader.put(name, loader);
+        }
+
+        // setup readability and exports
+        for (ResolvedModule resolvedModule : cf.modules()) {
+            ModuleReference mref = resolvedModule.reference();
+            ModuleDescriptor descriptor = mref.descriptor();
+
+            String mn = descriptor.name();
+            Module m = nameToModule.get(mn);
+            assert m != null;
+
+            // reads
+            Set<Module> reads = new HashSet<>();
+
+            // name -> source Module when in parent layer
+            Map<String, Module> nameToSource = Collections.emptyMap();
+
+            for (ResolvedModule other : resolvedModule.reads()) {
+                Module m2 = null;
+                if (other.configuration() == cf) {
+                    // this configuration
+                    m2 = nameToModule.get(other.name());
+                    assert m2 != null;
+                } else {
+                    // parent layer
+                    for (ModuleLayer parent: layer.parents()) {
+                        m2 = findModule(parent, other);
+                        if (m2 != null)
+                            break;
+                    }
+                    assert m2 != null;
+                    if (nameToSource.isEmpty())
+                        nameToSource = new HashMap<>();
+                    nameToSource.put(other.name(), m2);
+                }
+                reads.add(m2);
+
+                // update VM view
+                addReads0(m, m2);
+            }
+            m.reads = reads;
+
+            // automatic modules read all unnamed modules
+            if (descriptor.isAutomatic()) {
+                m.implAddReads(ALL_UNNAMED_MODULE, true);
+            }
+
+            // exports and opens
+            initExportsAndOpens(m, nameToSource, nameToModule, layer.parents());
+        }
+
+        // register the modules in the boot layer
+        if (isBootLayer) {
+            for (ResolvedModule resolvedModule : cf.modules()) {
+                ModuleReference mref = resolvedModule.reference();
+                ModuleDescriptor descriptor = mref.descriptor();
+                if (!descriptor.provides().isEmpty()) {
+                    String name = descriptor.name();
+                    Module m = nameToModule.get(name);
+                    ClassLoader loader = moduleToLoader.get(name);
+                    ServicesCatalog catalog;
+                    if (loader == null) {
+                        catalog = BootLoader.getServicesCatalog();
+                    } else {
+                        catalog = ServicesCatalog.getServicesCatalog(loader);
+                    }
+                    catalog.register(m);
+                }
+            }
+        }
+
+        // record that there is a layer with modules defined to the class loader
+        for (ClassLoader loader : loaders) {
+            layer.bindToLoader(loader);
+        }
+
+        return nameToModule;
+    }
+
+
+    /**
+     * Find the runtime Module corresponding to the given ResolvedModule
+     * in the given parent layer (or its parents).
+     */
+    private static Module findModule(ModuleLayer parent,
+                                     ResolvedModule resolvedModule) {
+        Configuration cf = resolvedModule.configuration();
+        String dn = resolvedModule.name();
+        return parent.layers()
+                .filter(l -> l.configuration() == cf)
+                .findAny()
+                .map(layer -> {
+                    Optional<Module> om = layer.findModule(dn);
+                    assert om.isPresent() : dn + " not found in layer";
+                    Module m = om.get();
+                    assert m.getLayer() == layer : m + " not in expected layer";
+                    return m;
+                })
+                .orElse(null);
+    }
+
+
+    /**
+     * Initialize the maps of exported and open packages for module m.
+     */
+    private static void initExportsAndOpens(Module m,
+                                            Map<String, Module> nameToSource,
+                                            Map<String, Module> nameToModule,
+                                            List<ModuleLayer> parents) {
+        // The VM doesn't special case open or automatic modules so need to
+        // export all packages
+        ModuleDescriptor descriptor = m.getDescriptor();
+        if (descriptor.isOpen() || descriptor.isAutomatic()) {
+            assert descriptor.opens().isEmpty();
+            for (String source : descriptor.packages()) {
+                addExportsToAll0(m, source);
+            }
+            return;
+        }
+
+        Map<String, Set<Module>> openPackages = new HashMap<>();
+        Map<String, Set<Module>> exportedPackages = new HashMap<>();
+
+        // process the open packages first
+        for (Opens opens : descriptor.opens()) {
+            String source = opens.source();
+
+            if (opens.isQualified()) {
+                // qualified opens
+                Set<Module> targets = new HashSet<>();
+                for (String target : opens.targets()) {
+                    Module m2 = findModule(target, nameToSource, nameToModule, parents);
+                    if (m2 != null) {
+                        addExports0(m, source, m2);
+                        targets.add(m2);
+                    }
+                }
+                if (!targets.isEmpty()) {
+                    openPackages.put(source, targets);
+                }
+            } else {
+                // unqualified opens
+                addExportsToAll0(m, source);
+                openPackages.put(source, EVERYONE_SET);
+            }
+        }
+
+        // next the exports, skipping exports when the package is open
+        for (Exports exports : descriptor.exports()) {
+            String source = exports.source();
+
+            // skip export if package is already open to everyone
+            Set<Module> openToTargets = openPackages.get(source);
+            if (openToTargets != null && openToTargets.contains(EVERYONE_MODULE))
+                continue;
+
+            if (exports.isQualified()) {
+                // qualified exports
+                Set<Module> targets = new HashSet<>();
+                for (String target : exports.targets()) {
+                    Module m2 = findModule(target, nameToSource, nameToModule, parents);
+                    if (m2 != null) {
+                        // skip qualified export if already open to m2
+                        if (openToTargets == null || !openToTargets.contains(m2)) {
+                            addExports0(m, source, m2);
+                            targets.add(m2);
+                        }
+                    }
+                }
+                if (!targets.isEmpty()) {
+                    exportedPackages.put(source, targets);
+                }
+
+            } else {
+                // unqualified exports
+                addExportsToAll0(m, source);
+                exportedPackages.put(source, EVERYONE_SET);
+            }
+        }
+
+        if (!openPackages.isEmpty())
+            m.openPackages = openPackages;
+        if (!exportedPackages.isEmpty())
+            m.exportedPackages = exportedPackages;
+    }
+
+    /**
+     * Find the runtime Module with the given name. The module name is the
+     * name of a target module in a qualified exports or opens directive.
+     *
+     * @param target The target module to find
+     * @param nameToSource The modules in parent layers that are read
+     * @param nameToModule The modules in the layer under construction
+     * @param parents The parent layers
+     */
+    private static Module findModule(String target,
+                                     Map<String, Module> nameToSource,
+                                     Map<String, Module> nameToModule,
+                                     List<ModuleLayer> parents) {
+        Module m = nameToSource.get(target);
+        if (m == null) {
+            m = nameToModule.get(target);
+            if (m == null) {
+                for (ModuleLayer parent : parents) {
+                    m = parent.findModule(target).orElse(null);
+                    if (m != null) break;
+                }
+            }
+        }
+        return m;
+    }
+
+
+    // -- annotations --
+
+    /**
+     * {@inheritDoc}
+     * This method returns {@code null} when invoked on an unnamed module.
+     */
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        return moduleInfoClass().getDeclaredAnnotation(annotationClass);
+    }
+
+    /**
+     * {@inheritDoc}
+     * This method returns an empty array when invoked on an unnamed module.
+     */
+    @Override
+    public Annotation[] getAnnotations() {
+        return moduleInfoClass().getAnnotations();
+    }
+
+    /**
+     * {@inheritDoc}
+     * This method returns an empty array when invoked on an unnamed module.
+     */
+    @Override
+    public Annotation[] getDeclaredAnnotations() {
+        return moduleInfoClass().getDeclaredAnnotations();
+    }
+
+    // cached class file with annotations
+    private volatile Class<?> moduleInfoClass;
+
+    private Class<?> moduleInfoClass() {
+        Class<?> clazz = this.moduleInfoClass;
+        if (clazz != null)
+            return clazz;
+
+        synchronized (this) {
+            clazz = this.moduleInfoClass;
+            if (clazz == null) {
+                if (isNamed()) {
+                    PrivilegedAction<Class<?>> pa = this::loadModuleInfoClass;
+                    clazz = AccessController.doPrivileged(pa);
+                }
+                if (clazz == null) {
+                    class DummyModuleInfo { }
+                    clazz = DummyModuleInfo.class;
+                }
+                this.moduleInfoClass = clazz;
+            }
+            return clazz;
+        }
+    }
+
+    private Class<?> loadModuleInfoClass() {
+        Class<?> clazz = null;
+        try (InputStream in = getResourceAsStream("module-info.class")) {
+            if (in != null)
+                clazz = loadModuleInfoClass(in);
+        } catch (Exception ignore) { }
+        return clazz;
+    }
+
+    /**
+     * Loads module-info.class as a package-private interface in a class loader
+     * that is a child of this module's class loader.
+     */
+    private Class<?> loadModuleInfoClass(InputStream in) throws IOException {
+        final String MODULE_INFO = "module-info";
+
+        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS
+                                         + ClassWriter.COMPUTE_FRAMES);
+
+        ClassVisitor cv = new ClassVisitor(Opcodes.ASM5, cw) {
+            @Override
+            public void visit(int version,
+                              int access,
+                              String name,
+                              String signature,
+                              String superName,
+                              String[] interfaces) {
+                cw.visit(version,
+                        Opcodes.ACC_INTERFACE
+                            + Opcodes.ACC_ABSTRACT
+                            + Opcodes.ACC_SYNTHETIC,
+                        MODULE_INFO,
+                        null,
+                        "java/lang/Object",
+                        null);
+            }
+            @Override
+            public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+                // keep annotations
+                return super.visitAnnotation(desc, visible);
+            }
+            @Override
+            public void visitAttribute(Attribute attr) {
+                // drop non-annotation attributes
+            }
+        };
+
+        ClassReader cr = new ClassReader(in);
+        cr.accept(cv, 0);
+        byte[] bytes = cw.toByteArray();
+
+        ClassLoader cl = new ClassLoader(loader) {
+            @Override
+            protected Class<?> findClass(String cn)throws ClassNotFoundException {
+                if (cn.equals(MODULE_INFO)) {
+                    return super.defineClass(cn, bytes, 0, bytes.length);
+                } else {
+                    throw new ClassNotFoundException(cn);
+                }
+            }
+        };
+
+        try {
+            return cl.loadClass(MODULE_INFO);
+        } catch (ClassNotFoundException e) {
+            throw new InternalError(e);
+        }
+    }
+
+
+    // -- misc --
+
+
+    /**
+     * Returns an input stream for reading a resource in this module.
+     * The {@code name} parameter is a {@code '/'}-separated path name that
+     * identifies the resource. As with {@link Class#getResourceAsStream
+     * Class.getResourceAsStream}, this method delegates to the module's class
+     * loader {@link ClassLoader#findResource(String,String)
+     * findResource(String,String)} method, invoking it with the module name
+     * (or {@code null} when the module is unnamed) and the name of the
+     * resource. If the resource name has a leading slash then it is dropped
+     * before delegation.
+     *
+     * <p> A resource in a named module may be <em>encapsulated</em> so that
+     * it cannot be located by code in other modules. Whether a resource can be
+     * located or not is determined as follows: </p>
+     *
+     * <ul>
+     *     <li> If the resource name ends with  "{@code .class}" then it is not
+     *     encapsulated. </li>
+     *
+     *     <li> A <em>package name</em> is derived from the resource name. If
+     *     the package name is a {@link #getPackages() package} in the module
+     *     then the resource can only be located by the caller of this method
+     *     when the package is {@link #isOpen(String,Module) open} to at least
+     *     the caller's module. If the resource is not in a package in the module
+     *     then the resource is not encapsulated. </li>
+     * </ul>
+     *
+     * <p> In the above, the <em>package name</em> for a resource is derived
+     * from the subsequence of characters that precedes the last {@code '/'} in
+     * the name and then replacing each {@code '/'} character in the subsequence
+     * with {@code '.'}. A leading slash is ignored when deriving the package
+     * name. As an example, the package name derived for a resource named
+     * "{@code a/b/c/foo.properties}" is "{@code a.b.c}". A resource name
+     * with the name "{@code META-INF/MANIFEST.MF}" is never encapsulated
+     * because "{@code META-INF}" is not a legal package name. </p>
+     *
+     * <p> This method returns {@code null} if the resource is not in this
+     * module, the resource is encapsulated and cannot be located by the caller,
+     * or access to the resource is denied by the security manager. </p>
+     *
+     * @param  name
+     *         The resource name
+     *
+     * @return An input stream for reading the resource or {@code null}
+     *
+     * @throws IOException
+     *         If an I/O error occurs
+     *
+     * @see Class#getResourceAsStream(String)
+     */
+    @CallerSensitive
+    public InputStream getResourceAsStream(String name) throws IOException {
+        if (name.startsWith("/")) {
+            name = name.substring(1);
+        }
+
+        if (isNamed() && Resources.canEncapsulate(name)) {
+            Module caller = getCallerModule(Reflection.getCallerClass());
+            if (caller != this && caller != Object.class.getModule()) {
+                String pn = Resources.toPackageName(name);
+                if (getPackages().contains(pn)) {
+                    if (caller == null && !isOpen(pn)) {
+                        // no caller, package not open
+                        return null;
+                    }
+                    if (!isOpen(pn, caller)) {
+                        // package not open to caller
+                        return null;
+                    }
+                }
+            }
+        }
+
+        String mn = this.name;
+
+        // special-case built-in class loaders to avoid URL connection
+        if (loader == null) {
+            return BootLoader.findResourceAsStream(mn, name);
+        } else if (loader instanceof BuiltinClassLoader) {
+            return ((BuiltinClassLoader) loader).findResourceAsStream(mn, name);
+        }
+
+        // locate resource in module
+        JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
+        URL url = jla.findResource(loader, mn, name);
+        if (url != null) {
+            try {
+                return url.openStream();
+            } catch (SecurityException e) { }
+        }
+
+        return null;
+    }
+
+    /**
+     * Returns the string representation of this module. For a named module,
+     * the representation is the string {@code "module"}, followed by a space,
+     * and then the module name. For an unnamed module, the representation is
+     * the string {@code "unnamed module"}, followed by a space, and then an
+     * implementation specific string that identifies the unnamed module.
+     *
+     * @return The string representation of this module
+     */
+    @Override
+    public String toString() {
+        if (isNamed()) {
+            return "module " + name;
+        } else {
+            String id = Integer.toHexString(System.identityHashCode(this));
+            return "unnamed module @" + id;
+        }
+    }
+
+    /**
+     * Returns the module that a given caller class is a member of. Returns
+     * {@code null} if the caller is {@code null}.
+     */
+    private Module getCallerModule(Class<?> caller) {
+        return (caller != null) ? caller.getModule() : null;
+    }
+
+
+    // -- native methods --
+
+    // JVM_DefineModule
+    private static native void defineModule0(Module module,
+                                             boolean isOpen,
+                                             String version,
+                                             String location,
+                                             String[] pns);
+
+    // JVM_AddReadsModule
+    private static native void addReads0(Module from, Module to);
+
+    // JVM_AddModuleExports
+    private static native void addExports0(Module from, String pn, Module to);
+
+    // JVM_AddModuleExportsToAll
+    private static native void addExportsToAll0(Module from, String pn);
+
+    // JVM_AddModuleExportsToAllUnnamed
+    private static native void addExportsToAllUnnamed0(Module from, String pn);
+
+    // JVM_AddModulePackage
+    private static native void addPackage0(Module m, String pn);
+}
diff --git a/jdk/src/java.base/share/classes/java/lang/ModuleLayer.java b/jdk/src/java.base/share/classes/java/lang/ModuleLayer.java
new file mode 100644
index 0000000..549662f
--- /dev/null
+++ b/jdk/src/java.base/share/classes/java/lang/ModuleLayer.java
@@ -0,0 +1,944 @@
+/*
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang;
+
+import java.lang.module.Configuration;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ResolvedModule;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import jdk.internal.loader.ClassLoaderValue;
+import jdk.internal.loader.Loader;
+import jdk.internal.loader.LoaderPool;
+import jdk.internal.module.ServicesCatalog;
+import sun.security.util.SecurityConstants;
+
+
+/**
+ * A layer of modules in the Java virtual machine.
+ *
+ * <p> A layer is created from a graph of modules in a {@link Configuration}
+ * and a function that maps each module to a {@link ClassLoader}.
+ * Creating a layer informs the Java virtual machine about the classes that
+ * may be loaded from the modules so that the Java virtual machine knows which
+ * module that each class is a member of. </p>
+ *
+ * <p> Creating a layer creates a {@link Module} object for each {@link
+ * ResolvedModule} in the configuration. For each resolved module that is
+ * {@link ResolvedModule#reads() read}, the {@code Module} {@link
+ * Module#canRead reads} the corresponding run-time {@code Module}, which may
+ * be in the same layer or a {@link #parents() parent} layer. </p>
+ *
+ * <p> The {@link #defineModulesWithOneLoader defineModulesWithOneLoader} and
+ * {@link #defineModulesWithManyLoaders defineModulesWithManyLoaders} methods
+ * provide convenient ways to create a module layer where all modules are
+ * mapped to a single class loader or where each module is mapped to its own
+ * class loader. The {@link #defineModules defineModules} method is for more
+ * advanced cases where modules are mapped to custom class loaders by means of
+ * a function specified to the method. Each of these methods has an instance
+ * and static variant. The instance methods create a layer with the receiver
+ * as the parent layer. The static methods are for more advanced cases where
+ * there can be more than one parent layer or where a {@link
+ * ModuleLayer.Controller Controller} is needed to control modules in the layer
+ * </p>
+ *
+ * <p> A Java virtual machine has at least one non-empty layer, the {@link
+ * #boot() boot} layer, that is created when the Java virtual machine is
+ * started. The boot layer contains module {@code java.base} and is the only
+ * layer in the Java virtual machine with a module named "{@code java.base}".
+ * The modules in the boot layer are mapped to the bootstrap class loader and
+ * other class loaders that are <a href="../ClassLoader.html#builtinLoaders">
+ * built-in</a> into the Java virtual machine. The boot layer will often be
+ * the {@link #parents() parent} when creating additional layers. </p>
+ *
+ * <p> Each {@code Module} in a layer is created so that it {@link
+ * Module#isExported(String) exports} and {@link Module#isOpen(String) opens}
+ * the packages described by its {@link ModuleDescriptor}. Qualified exports
+ * (where a package is exported to a set of target modules rather than all
+ * modules) are reified when creating the layer as follows: </p>
+ * <ul>
+ *     <li> If module {@code X} exports a package to {@code Y}, and if the
+ *     runtime {@code Module} {@code X} reads {@code Module} {@code Y}, then
+ *     the package is exported to {@code Module} {@code Y} (which may be in
+ *     the same layer as {@code X} or a parent layer). </li>
+ *
+ *     <li> If module {@code X} exports a package to {@code Y}, and if the
+ *     runtime {@code Module} {@code X} does not read {@code Y} then target
+ *     {@code Y} is located as if by invoking {@link #findModule(String)
+ *     findModule} to find the module in the layer or its parent layers. If
+ *     {@code Y} is found then the package is exported to the instance of
+ *     {@code Y} that was found. If {@code Y} is not found then the qualified
+ *     export is ignored. </li>
+ * </ul>
+ *
+ * <p> Qualified opens are handled in same way as qualified exports. </p>
+ *
+ * <p> As when creating a {@code Configuration},
+ * {@link ModuleDescriptor#isAutomatic() automatic} modules receive special
+ * treatment when creating a layer. An automatic module is created in the
+ * Java virtual machine as a {@code Module} that reads every unnamed {@code
+ * Module} in the Java virtual machine. </p>
+ *
+ * <p> Unless otherwise specified, passing a {@code null} argument to a method
+ * in this class causes a {@link NullPointerException NullPointerException} to
+ * be thrown. </p>
+ *
+ * <h3> Example usage: </h3>
+ *
+ * <p> This example creates a configuration by resolving a module named
+ * "{@code myapp}" with the configuration for the boot layer as the parent. It
+ * then creates a new layer with the modules in this configuration. All modules
+ * are defined to the same class loader. </p>
+ *
+ * <pre>{@code
+ *     ModuleFinder finder = ModuleFinder.of(dir1, dir2, dir3);
+ *
+ *     ModuleLayer parent = ModuleLayer.boot();
+ *
+ *     Configuration cf = parent.configuration().resolve(finder, ModuleFinder.of(), Set.of("myapp"));
+ *
+ *     ClassLoader scl = ClassLoader.getSystemClassLoader();
+ *
+ *     ModuleLayer layer = parent.defineModulesWithOneLoader(cf, scl);
+ *
+ *     Class<?> c = layer.findLoader("myapp").loadClass("app.Main");
+ * }</pre>
+ *
+ * @since 9
+ * @spec JPMS
+ * @see Module#getLayer()
+ */
+
+public final class ModuleLayer {
+
+    // the empty layer
+    private static final ModuleLayer EMPTY_LAYER
+        = new ModuleLayer(Configuration.empty(), List.of(), null);
+
+    // the configuration from which this ;ayer was created
+    private final Configuration cf;
+
+    // parent layers, empty in the case of the empty layer
+    private final List<ModuleLayer> parents;
+
+    // maps module name to jlr.Module
+    private final Map<String, Module> nameToModule;
+
+    /**
+     * Creates a new module layer from the modules in the given configuration.
+     */
+    private ModuleLayer(Configuration cf,
+                        List<ModuleLayer> parents,
+                        Function<String, ClassLoader> clf)
+    {
+        this.cf = cf;
+        this.parents = parents; // no need to do defensive copy
+
+        Map<String, Module> map;
+        if (parents.isEmpty()) {
+            map = Collections.emptyMap();
+        } else {
+            map = Module.defineModules(cf, clf, this);
+        }
+        this.nameToModule = map; // no need to do defensive copy
+    }
+
+    /**
+     * Controls a module layer. The static methods defined by {@link ModuleLayer}
+     * to create module layers return a {@code Controller} that can be used to
+     * control modules in the layer.
+     *
+     * <p> Unless otherwise specified, passing a {@code null} argument to a
+     * method in this class causes a {@link NullPointerException
+     * NullPointerException} to be thrown. </p>
+     *
+     * @apiNote Care should be taken with {@code Controller} objects, they
+     * should never be shared with untrusted code.
+     *
+     * @since 9
+     * @spec JPMS
+     */
+    public static final class Controller {
+        private final ModuleLayer layer;
+
+        Controller(ModuleLayer layer) {
+            this.layer = layer;
+        }
+
+        /**
+         * Returns the layer that this object controls.
+         *
+         * @return the module layer
+         */
+        public ModuleLayer layer() {
+            return layer;
+        }
+
+        private void ensureInLayer(Module source) {
+            if (source.getLayer() != layer)
+                throw new IllegalArgumentException(source + " not in layer");
+        }
+
+
+        /**
+         * Updates module {@code source} in the layer to read module
+         * {@code target}. This method is a no-op if {@code source} already
+         * reads {@code target}.
+         *
+         * @implNote <em>Read edges</em> added by this method are <em>weak</em>
+         * and do not prevent {@code target} from being GC'ed when {@code source}
+         * is strongly reachable.
+         *
+         * @param  source
+         *         The source module
+         * @param  target
+         *         The target module to read
+         *
+         * @return This controller
+         *
+         * @throws IllegalArgumentException
+         *         If {@code source} is not in the module layer
+         *
+         * @see Module#addReads
+         */
+        public Controller addReads(Module source, Module target) {
+            ensureInLayer(source);
+            source.implAddReads(target);
+            return this;
+        }
+
+        /**
+         * Updates module {@code source} in the layer to open a package to
+         * module {@code target}. This method is a no-op if {@code source}
+         * already opens the package to at least {@code target}.
+         *
+         * @param  source
+         *         The source module
+         * @param  pn
+         *         The package name
+         * @param  target
+         *         The target module to read
+         *
+         * @return This controller
+         *
+         * @throws IllegalArgumentException
+         *         If {@code source} is not in the module layer or the package
+         *         is not in the source module
+         *
+         * @see Module#addOpens
+         */
+        public Controller addOpens(Module source, String pn, Module target) {
+            ensureInLayer(source);
+            source.implAddOpens(pn, target);
+            return this;
+        }
+    }
+
+
+    /**
+     * Creates a new module layer, with this layer as its parent, by defining the
+     * modules in the given {@code Configuration} to the Java virtual machine.
+     * This method creates one class loader and defines all modules to that
+     * class loader. The {@link ClassLoader#getParent() parent} of each class
+     * loader is the given parent class loader. This method works exactly as
+     * specified by the static {@link
+     * #defineModulesWithOneLoader(Configuration,List,ClassLoader)
+     * defineModulesWithOneLoader} method when invoked with this layer as the
+     * parent. In other words, if this layer is {@code thisLayer} then this
+     * method is equivalent to invoking:
+     * <pre> {@code
+     *     ModuleLayer.defineModulesWithOneLoader(cf, List.of(thisLayer), parentLoader).layer();
+     * }</pre>
+     *
+     * @param  cf
+     *         The configuration for the layer
+     * @param  parentLoader
+     *         The parent class loader for the class loader created by this
+     *         method; may be {@code null} for the bootstrap class loader
+     *
+     * @return The newly created layer
+     *
+     * @throws IllegalArgumentException
+     *         If the parent of the given configuration is not the configuration
+     *         for this layer
+     * @throws LayerInstantiationException
+     *         If the layer cannot be created for any of the reasons specified
+     *         by the static {@code defineModulesWithOneLoader} method
+     * @throws SecurityException
+     *         If {@code RuntimePermission("createClassLoader")} or
+     *         {@code RuntimePermission("getClassLoader")} is denied by
+     *         the security manager
+     *
+     * @see #findLoader
+     */
+    public ModuleLayer defineModulesWithOneLoader(Configuration cf,
+                                                  ClassLoader parentLoader) {
+        return defineModulesWithOneLoader(cf, List.of(this), parentLoader).layer();
+    }
+
+
+    /**
+     * Creates a new module layer, with this layer as its parent, by defining the
+     * modules in the given {@code Configuration} to the Java virtual machine.
+     * Each module is defined to its own {@link ClassLoader} created by this
+     * method. The {@link ClassLoader#getParent() parent} of each class loader
+     * is the given parent class loader. This method works exactly as specified
+     * by the static {@link
+     * #defineModulesWithManyLoaders(Configuration,List,ClassLoader)
+     * defineModulesWithManyLoaders} method when invoked with this layer as the
+     * parent. In other words, if this layer is {@code thisLayer} then this
+     * method is equivalent to invoking:
+     * <pre> {@code
+     *     ModuleLayer.defineModulesWithManyLoaders(cf, List.of(thisLayer), parentLoader).layer();
+     * }</pre>
+     *
+     * @param  cf
+     *         The configuration for the layer
+     * @param  parentLoader
+     *         The parent class loader for each of the class loaders created by
+     *         this method; may be {@code null} for the bootstrap class loader
+     *
+     * @return The newly created layer
+     *
+     * @throws IllegalArgumentException
+     *         If the parent of the given configuration is not the configuration
+     *         for this layer
+     * @throws LayerInstantiationException
+     *         If the layer cannot be created for any of the reasons specified
+     *         by the static {@code defineModulesWithManyLoaders} method
+     * @throws SecurityException
+     *         If {@code RuntimePermission("createClassLoader")} or
+     *         {@code RuntimePermission("getClassLoader")} is denied by
+     *         the security manager
+     *
+     * @see #findLoader
+     */
+    public ModuleLayer defineModulesWithManyLoaders(Configuration cf,
+                                                    ClassLoader parentLoader) {
+        return defineModulesWithManyLoaders(cf, List.of(this), parentLoader).layer();
+    }
+
+
+    /**
+     * Creates a new module layer, with this layer as its parent, by defining the
+     * modules in the given {@code Configuration} to the Java virtual machine.
+     * Each module is mapped, by name, to its class loader by means of the
+     * given function. This method works exactly as specified by the static
+     * {@link #defineModules(Configuration,List,Function) defineModules}
+     * method when invoked with this layer as the parent. In other words, if
+     * this layer is {@code thisLayer} then this method is equivalent to
+     * invoking:
+     * <pre> {@code
+     *     ModuleLayer.defineModules(cf, List.of(thisLayer), clf).layer();
+     * }</pre>
+     *
+     * @param  cf
+     *         The configuration for the layer
+     * @param  clf
+     *         The function to map a module name to a class loader
+     *
+     * @return The newly created layer
+     *
+     * @throws IllegalArgumentException
+     *         If the parent of the given configuration is not the configuration
+     *         for this layer
+     * @throws LayerInstantiationException
+     *         If the layer cannot be created for any of the reasons specified
+     *         by the static {@code defineModules} method
+     * @throws SecurityException
+     *         If {@code RuntimePermission("getClassLoader")} is denied by
+     *         the security manager
+     */
+    public ModuleLayer defineModules(Configuration cf,
+                                     Function<String, ClassLoader> clf) {
+        return defineModules(cf, List.of(this), clf).layer();
+    }
+
+    /**
+     * Creates a new module layer by defining the modules in the given {@code
+     * Configuration} to the Java virtual machine. This method creates one
+     * class loader and defines all modules to that class loader.
+     *
+     * <p> The class loader created by this method implements <em>direct
+     * delegation</em> when loading types from modules. When its {@link
+     * ClassLoader#loadClass(String, boolean) loadClass} method is invoked to
+     * load a class then it uses the package name of the class to map it to a
+     * module. This may be a module in this layer and hence defined to the same
+     * class loader. It may be a package in a module in a parent layer that is
+     * exported to one or more of the modules in this layer. The class
+     * loader delegates to the class loader of the module, throwing {@code
+     * ClassNotFoundException} if not found by that class loader.
+     * When {@code loadClass} is invoked to load classes that do not map to a
+     * module then it delegates to the parent class loader. </p>
+     *
+     * <p> Attempting to create a layer with all modules defined to the same
+     * class loader can fail for the following reasons:
+     *
+     * <ul>
+     *
+     *     <li><p> <em>Overlapping packages</em>: Two or more modules in the
+     *     configuration have the same package. </p></li>
+     *
+     *     <li><p> <em>Split delegation</em>: The resulting class loader would
+     *     need to delegate to more than one class loader in order to load types
+     *     in a specific package. </p></li>
+     *
+     * </ul>
+     *
+     * <p> In addition, a layer cannot be created if the configuration contains
+     * a module named "{@code java.base}", or a module contains a package named
+     * "{@code java}" or a package with a name starting with "{@code java.}". </p>
+     *
+     * <p> If there is a security manager then the class loader created by
+     * this method will load classes and resources with privileges that are
+     * restricted by the calling context of this method. </p>
+     *
+     * @param  cf
+     *         The configuration for the layer
+     * @param  parentLayers
+     *         The list of parent layers in search order
+     * @param  parentLoader
+     *         The parent class loader for the class loader created by this
+     *         method; may be {@code null} for the bootstrap class loader
+     *
+     * @return A controller that controls the newly created layer
+     *
+     * @throws IllegalArgumentException
+     *         If the parent configurations do not match the configuration of
+     *         the parent layers, including order
+     * @throws LayerInstantiationException
+     *         If all modules cannot be defined to the same class loader for any
+     *         of the reasons listed above
+     * @throws SecurityException
+     *         If {@code RuntimePermission("createClassLoader")} or
+     *         {@code RuntimePermission("getClassLoader")} is denied by
+     *         the security manager
+     *
+     * @see #findLoader
+     */
+    public static Controller defineModulesWithOneLoader(Configuration cf,
+                                                        List<ModuleLayer> parentLayers,
+                                                        ClassLoader parentLoader)
+    {
+        List<ModuleLayer> parents = new ArrayList<>(parentLayers);
+        checkConfiguration(cf, parents);
+
+        checkCreateClassLoaderPermission();
+        checkGetClassLoaderPermission();
+
+        try {
+            Loader loader = new Loader(cf.modules(), parentLoader);
+            loader.initRemotePackageMap(cf, parents);
+            ModuleLayer layer =  new ModuleLayer(cf, parents, mn -> loader);
+            return new Controller(layer);
+        } catch (IllegalArgumentException | IllegalStateException e) {
+            throw new LayerInstantiationException(e.getMessage());
+        }
+    }
+
+    /**
+     * Creates a new module layer by defining the modules in the given {@code
+     * Configuration} to the Java virtual machine. Each module is defined to
+     * its own {@link ClassLoader} created by this method. The {@link
+     * ClassLoader#getParent() parent} of each class loader is the given parent
+     * class loader.
+     *
+     * <p> The class loaders created by this method implement <em>direct
+     * delegation</em> when loading types from modules. When {@link
+     * ClassLoader#loadClass(String, boolean) loadClass} method is invoked to
+     * load a class then it uses the package name of the class to map it to a
+     * module. The package may be in the module defined to the class loader.
+     * The package may be exported by another module in this layer to the
+     * module defined to the class loader. It may be in a package exported by a
+     * module in a parent layer. The class loader delegates to the class loader
+     * of the module, throwing {@code ClassNotFoundException} if not found by
+     * that class loader.
+     * When {@code loadClass} is invoked to load classes that do not map to a
+     * module then it delegates to the parent class loader. </p>
+     *
+     * <p> If there is a security manager then the class loaders created by
+     * this method will load classes and resources with privileges that are
+     * restricted by the calling context of this method. </p>
+     *
+     * @param  cf
+     *         The configuration for the layer
+     * @param  parentLayers
+     *         The list of parent layers in search order
+     * @param  parentLoader
+     *         The parent class loader for each of the class loaders created by
+     *         this method; may be {@code null} for the bootstrap class loader
+     *
+     * @return A controller that controls the newly created layer
+     *
+     * @throws IllegalArgumentException
+     *         If the parent configurations do not match the configuration of
+     *         the parent layers, including order
+     * @throws LayerInstantiationException
+     *         If the layer cannot be created because the configuration contains
+     *         a module named "{@code java.base}" or a module contains a package
+     *         named "{@code java}" or a package with a name starting with
+     *         "{@code java.}"
+     *
+     * @throws SecurityException
+     *         If {@code RuntimePermission("createClassLoader")} or
+     *         {@code RuntimePermission("getClassLoader")} is denied by
+     *         the security manager
+     *
+     * @see #findLoader
+     */
+    public static Controller defineModulesWithManyLoaders(Configuration cf,
+                                                          List<ModuleLayer> parentLayers,
+                                                          ClassLoader parentLoader)
+    {
+        List<ModuleLayer> parents = new ArrayList<>(parentLayers);
+        checkConfiguration(cf, parents);
+
+        checkCreateClassLoaderPermission();
+        checkGetClassLoaderPermission();
+
+        LoaderPool pool = new LoaderPool(cf, parents, parentLoader);
+        try {
+            ModuleLayer layer = new ModuleLayer(cf, parents, pool::loaderFor);
+            return new Controller(layer);
+        } catch (IllegalArgumentException | IllegalStateException e) {
+            throw new LayerInstantiationException(e.getMessage());
+        }
+    }
+
+    /**
+     * Creates a new module layer by defining the modules in the given {@code
+     * Configuration} to the Java virtual machine. The given function maps each
+     * module in the configuration, by name, to a class loader. Creating the
+     * layer informs the Java virtual machine about the classes that may be
+     * loaded so that the Java virtual machine knows which module that each
+     * class is a member of.
+     *
+     * <p> The class loader delegation implemented by the class loaders must
+     * respect module readability. The class loaders should be
+     * {@link ClassLoader#registerAsParallelCapable parallel-capable} so as to
+     * avoid deadlocks during class loading. In addition, the entity creating
+     * a new layer with this method should arrange that the class loaders be
+     * ready to load from these modules before there are any attempts to load
+     * classes or resources. </p>
+     *
+     * <p> Creating a layer can fail for the following reasons: </p>
+     *
+     * <ul>
+     *
+     *     <li><p> Two or more modules with the same package are mapped to the
+     *     same class loader. </p></li>
+     *
+     *     <li><p> A module is mapped to a class loader that already has a
+     *     module of the same name defined to it. </p></li>
+     *
+     *     <li><p> A module is mapped to a class loader that has already
+     *     defined types in any of the packages in the module. </p></li>
+     *
+     * </ul>
+     *
+     * <p> In addition, a layer cannot be created if the configuration contains
+     * a module named "{@code java.base}", a configuration contains a module
+     * with a package named "{@code java}" or a package name starting with
+     * "{@code java.}" and the module is mapped to a class loader other than
+     * the {@link ClassLoader#getPlatformClassLoader() platform class loader},
+     * or the function to map a module name to a class loader returns
+     * {@code null}. </p>
+     *
+     * <p> If the function to map a module name to class loader throws an error
+     * or runtime exception then it is propagated to the caller of this method.
+     * </p>
+     *
+     * @apiNote It is implementation specific as to whether creating a layer
+     * with this method is an atomic operation or not. Consequentially it is
+     * possible for this method to fail with some modules, but not all, defined
+     * to the Java virtual machine.
+     *
+     * @param  cf
+     *         The configuration for the layer
+     * @param  parentLayers
+     *         The list of parent layers in search order
+     * @param  clf
+     *         The function to map a module name to a class loader
+     *
+     * @return A controller that controls the newly created layer
+     *
+     * @throws IllegalArgumentException
+     *         If the parent configurations do not match the configuration of
+     *         the parent layers, including order
+     * @throws LayerInstantiationException
+     *         If creating the layer fails for any of the reasons listed above
+     * @throws SecurityException
+     *         If {@code RuntimePermission("getClassLoader")} is denied by
+     *         the security manager
+     */
+    public static Controller defineModules(Configuration cf,
+                                           List<ModuleLayer> parentLayers,
+                                           Function<String, ClassLoader> clf)
+    {
+        List<ModuleLayer> parents = new ArrayList<>(parentLayers);
+        checkConfiguration(cf, parents);
+        Objects.requireNonNull(clf);
+
+        checkGetClassLoaderPermission();
+
+        // The boot layer is checked during module system initialization
+        if (boot() != null) {
+            checkForDuplicatePkgs(cf, clf);
+        }
+
+        try {
+            ModuleLayer layer = new ModuleLayer(cf, parents, clf);
+            return new Controller(layer);
+        } catch (IllegalArgumentException | IllegalStateException e) {
+            throw new LayerInstantiationException(e.getMessage());
+        }
+    }
+
+
+    /**
+     * Checks that the parent configurations match the configuration of
+     * the parent layers.
+     */
+    private static void checkConfiguration(Configuration cf,
+                                           List<ModuleLayer> parentLayers)
+    {
+        Objects.requireNonNull(cf);
+
+        List<Configuration> parentConfigurations = cf.parents();
+        if (parentLayers.size() != parentConfigurations.size())
+            throw new IllegalArgumentException("wrong number of parents");
+
+        int index = 0;
+        for (ModuleLayer parent : parentLayers) {
+            if (parent.configuration() != parentConfigurations.get(index)) {
+                throw new IllegalArgumentException(
+                        "Parent of configuration != configuration of this Layer");
+            }
+            index++;
+        }
+    }
+
+    private static void checkCreateClassLoaderPermission() {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null)
+            sm.checkPermission(SecurityConstants.CREATE_CLASSLOADER_PERMISSION);
+    }
+
+    private static void checkGetClassLoaderPermission() {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null)
+            sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
+    }
+
+    /**
+     * Checks a configuration and the module-to-loader mapping to ensure that
+     * no two modules mapped to the same class loader have the same package.
+     * It also checks that no two automatic modules have the same package.
+     *
+     * @throws LayerInstantiationException
+     */
+    private static void checkForDuplicatePkgs(Configuration cf,
+                                              Function<String, ClassLoader> clf)
+    {
+        // HashMap allows null keys
+        Map<ClassLoader, Set<String>> loaderToPackages = new HashMap<>();
+        for (ResolvedModule resolvedModule : cf.modules()) {
+            ModuleDescriptor descriptor = resolvedModule.reference().descriptor();
+            ClassLoader loader = clf.apply(descriptor.name());
+
+            Set<String> loaderPackages
+                = loaderToPackages.computeIfAbsent(loader, k -> new HashSet<>());
+
+            for (String pkg : descriptor.packages()) {
+                boolean added = loaderPackages.add(pkg);
+                if (!added) {
+                    throw fail("More than one module with package %s mapped" +
+                               " to the same class loader", pkg);
+                }
+            }
+        }
+    }
+
+    /**
+     * Creates a LayerInstantiationException with the a message formatted from
+     * the given format string and arguments.
+     */
+    private static LayerInstantiationException fail(String fmt, Object ... args) {
+        String msg = String.format(fmt, args);
+        return new LayerInstantiationException(msg);
+    }
+
+
+    /**
+     * Returns the configuration for this layer.
+     *
+     * @return The configuration for this layer
+     */
+    public Configuration configuration() {
+        return cf;
+    }
+
+
+    /**
+     * Returns the list of this layer's parents unless this is the
+     * {@linkplain #empty empty layer}, which has no parents and so an
+     * empty list is returned.
+     *
+     * @return The list of this layer's parents
+     */
+    public List<ModuleLayer> parents() {
+        return parents;
+    }
+
+
+    /**
+     * Returns an ordered stream of layers. The first element is is this layer,
+     * the remaining elements are the parent layers in DFS order.
+     *
+     * @implNote For now, the assumption is that the number of elements will
+     * be very low and so this method does not use a specialized spliterator.
+     */
+    Stream<ModuleLayer> layers() {
+        List<ModuleLayer> allLayers = this.allLayers;
+        if (allLayers != null)
+            return allLayers.stream();
+
+        allLayers = new ArrayList<>();
+        Set<ModuleLayer> visited = new HashSet<>();
+        Deque<ModuleLayer> stack = new ArrayDeque<>();
+        visited.add(this);
+        stack.push(this);
+
+        while (!stack.isEmpty()) {
+            ModuleLayer layer = stack.pop();
+            allLayers.add(layer);
+
+            // push in reverse order
+            for (int i = layer.parents.size() - 1; i >= 0; i--) {
+                ModuleLayer parent = layer.parents.get(i);
+                if (!visited.contains(parent)) {
+                    visited.add(parent);
+                    stack.push(parent);
+                }
+            }
+        }
+
+        this.allLayers = allLayers = Collections.unmodifiableList(allLayers);
+        return allLayers.stream();
+    }
+
+    private volatile List<ModuleLayer> allLayers;
+
+    /**
+     * Returns the set of the modules in this layer.
+     *
+     * @return A possibly-empty unmodifiable set of the modules in this layer
+     */
+    public Set<Module> modules() {
+        Set<Module> modules = this.modules;
+        if (modules == null) {
+            this.modules = modules =
+                Collections.unmodifiableSet(new HashSet<>(nameToModule.values()));
+        }
+        return modules;
+    }
+
+    private volatile Set<Module> modules;
+
+
+    /**
+     * Returns the module with the given name in this layer, or if not in this
+     * layer, the {@linkplain #parents parent} layers. Finding a module in
+     * parent layers is equivalent to invoking {@code findModule} on each
+     * parent, in search order, until the module is found or all parents have
+     * been searched. In a <em>tree of layers</em>  then this is equivalent to
+     * a depth-first search.
+     *
+     * @param  name
+     *         The name of the module to find
+     *
+     * @return The module with the given name or an empty {@code Optional}
+     *         if there isn't a module with this name in this layer or any
+     *         parent layer
+     */
+    public Optional<Module> findModule(String name) {
+        Objects.requireNonNull(name);
+        if (this == EMPTY_LAYER)
+            return Optional.empty();
+        Module m = nameToModule.get(name);
+        if (m != null)
+            return Optional.of(m);
+
+        return layers()
+                .skip(1)  // skip this layer
+                .map(l -> l.nameToModule)
+                .filter(map -> map.containsKey(name))
+                .map(map -> map.get(name))
+                .findAny();
+    }
+
+
+    /**
+     * Returns the {@code ClassLoader} for the module with the given name. If
+     * a module of the given name is not in this layer then the {@link #parents
+     * parent} layers are searched in the manner specified by {@link
+     * #findModule(String) findModule}.
+     *
+     * <p> If there is a security manager then its {@code checkPermission}
+     * method is called with a {@code RuntimePermission("getClassLoader")}
+     * permission to check that the caller is allowed to get access to the
+     * class loader. </p>
+     *
+     * @apiNote This method does not return an {@code Optional<ClassLoader>}
+     * because `null` must be used to represent the bootstrap class loader.
+     *
+     * @param  name
+     *         The name of the module to find
+     *
+     * @return The ClassLoader that the module is defined to
+     *
+     * @throws IllegalArgumentException if a module of the given name is not
+     *         defined in this layer or any parent of this layer
+     *
+     * @throws SecurityException if denied by the security manager
+     */
+    public ClassLoader findLoader(String name) {
+        Optional<Module> om = findModule(name);
+
+        // can't use map(Module::getClassLoader) as class loader can be null
+        if (om.isPresent()) {
+            return om.get().getClassLoader();
+        } else {
+            throw new IllegalArgumentException("Module " + name
+                                               + " not known to this layer");
+        }
+    }
+
+    /**
+     * Returns a string describing this module layer.
+     *
+     * @return A possibly empty string describing this module layer
+     */
+    @Override
+    public String toString() {
+        return modules().stream()
+                .map(Module::getName)
+                .collect(Collectors.joining(", "));
+    }
+
+    /**
+     * Returns the <em>empty</em> layer. There are no modules in the empty
+     * layer. It has no parents.
+     *
+     * @return The empty layer
+     */
+    public static ModuleLayer empty() {
+        return EMPTY_LAYER;
+    }
+
+
+    /**
+     * Returns the boot layer. The boot layer contains at least one module,
+     * {@code java.base}. Its parent is the {@link #empty() empty} layer.
+     *
+     * @apiNote This method returns {@code null} during startup and before
+     *          the boot layer is fully initialized.
+     *
+     * @return The boot layer
+     */
+    public static ModuleLayer boot() {
+        return System.bootLayer;
+    }
+
+    /**
+     * Returns the ServicesCatalog for this Layer, creating it if not
+     * already created.
+     */
+    ServicesCatalog getServicesCatalog() {
+        ServicesCatalog servicesCatalog = this.servicesCatalog;
+        if (servicesCatalog != null)
+            return servicesCatalog;
+
+        synchronized (this) {
+            servicesCatalog = this.servicesCatalog;
+            if (servicesCatalog == null) {
+                servicesCatalog = ServicesCatalog.create();
+                nameToModule.values().forEach(servicesCatalog::register);
+                this.servicesCatalog = servicesCatalog;
+            }
+        }
+
+        return servicesCatalog;
+    }
+
+    private volatile ServicesCatalog servicesCatalog;
+
+
+    /**
+     * Record that this layer has at least one module defined to the given
+     * class loader.
+     */
+    void bindToLoader(ClassLoader loader) {
+        // CLV.computeIfAbsent(loader, (cl, clv) -> new CopyOnWriteArrayList<>())
+        List<ModuleLayer> list = CLV.get(loader);
+        if (list == null) {
+            list = new CopyOnWriteArrayList<>();
+            List<ModuleLayer> previous = CLV.putIfAbsent(loader, list);
+            if (previous != null) list = previous;
+        }
+        list.add(this);
+    }
+
+    /**
+     * Returns a stream of the layers that have at least one module defined to
+     * the given class loader.
+     */
+    static Stream<ModuleLayer> layers(ClassLoader loader) {
+        List<ModuleLayer> list = CLV.get(loader);
+        if (list != null) {
+            return list.stream();
+        } else {
+            return Stream.empty();
+        }
+    }
+
+    // the list of layers with modules defined to a class loader
+    private static final ClassLoaderValue<List<ModuleLayer>> CLV = new ClassLoaderValue<>();
+}
diff --git a/jdk/src/java.base/share/classes/java/lang/NamedPackage.java b/jdk/src/java.base/share/classes/java/lang/NamedPackage.java
index 5d86cc7..6234b94 100644
--- a/jdk/src/java.base/share/classes/java/lang/NamedPackage.java
+++ b/jdk/src/java.base/share/classes/java/lang/NamedPackage.java
@@ -26,7 +26,6 @@
 
 import java.lang.module.Configuration;
 import java.lang.module.ModuleReference;
-import java.lang.reflect.Module;
 import java.net.URI;
 
 /**
diff --git a/jdk/src/java.base/share/classes/java/lang/Object.java b/jdk/src/java.base/share/classes/java/lang/Object.java
index 0677aa5..e1cb6e0 100644
--- a/jdk/src/java.base/share/classes/java/lang/Object.java
+++ b/jdk/src/java.base/share/classes/java/lang/Object.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -561,10 +561,53 @@
      * the finalization of this object to be halted, but is otherwise
      * ignored.
      *
+     * @apiNote
+     * Classes that embed non-heap resources have many options
+     * for cleanup of those resources. The class must ensure that the
+     * lifetime of each instance is longer than that of any resource it embeds.
+     * {@link java.lang.ref.Reference#reachabilityFence} can be used to ensure that
+     * objects remain reachable while resources embedded in the object are in use.
+     * <p>
+     * A subclass should avoid overriding the {@code finalize} method
+     * unless the subclass embeds non-heap resources that must be cleaned up
+     * before the instance is collected.
+     * Finalizer invocations are not automatically chained, unlike constructors.
+     * If a subclass overrides {@code finalize} it must invoke the superclass
+     * finalizer explicitly.
+     * To guard against exceptions prematurely terminating the finalize chain,
+     * the subclass should use a {@code try-finally} block to ensure
+     * {@code super.finalize()} is always invoked. For example,
+     * <pre>{@code      @Override
+     *     protected void finalize() throws Throwable {
+     *         try {
+     *             ... // cleanup subclass state
+     *         } finally {
+     *             super.finalize();
+     *         }
+     *     }
+     * }</pre>
+     *
+     * @deprecated The finalization mechanism is inherently problematic.
+     * Finalization can lead to performance issues, deadlocks, and hangs.
+     * Errors in finalizers can lead to resource leaks; there is no way to cancel
+     * finalization if it is no longer necessary; and no ordering is specified
+     * among calls to {@code finalize} methods of different objects.
+     * Furthermore, there are no guarantees regarding the timing of finalization.
+     * The {@code finalize} method might be called on a finalizable object
+     * only after an indefinite delay, if at all.
+     *
+     * Classes whose instances hold non-heap resources should provide a method
+     * to enable explicit release of those resources, and they should also
+     * implement {@link AutoCloseable} if appropriate.
+     * The {@link java.lang.ref.Cleaner} and {@link java.lang.ref.PhantomReference}
+     * provide more flexible and efficient ways to release resources when an object
+     * becomes unreachable.
+     *
      * @throws Throwable the {@code Exception} raised by this method
      * @see java.lang.ref.WeakReference
      * @see java.lang.ref.PhantomReference
      * @jls 12.6 Finalization of Class Instances
      */
+    @Deprecated(since="9")
     protected void finalize() throws Throwable { }
 }
diff --git a/jdk/src/java.base/share/classes/java/lang/Package.java b/jdk/src/java.base/share/classes/java/lang/Package.java
index 5a19f97..25bf4a7 100644
--- a/jdk/src/java.base/share/classes/java/lang/Package.java
+++ b/jdk/src/java.base/share/classes/java/lang/Package.java
@@ -27,7 +27,6 @@
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Module;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -111,6 +110,8 @@
  * @see ClassLoader#definePackage(String, String, String, String, String, String, String, URL)
  *
  * @since 1.2
+ * @revised 9
+ * @spec JPMS
  */
 public class Package extends NamedPackage implements java.lang.reflect.AnnotatedElement {
     /**
@@ -207,6 +208,9 @@
      * is returned if it is not known.
      * @return the vendor that implemented this package, {@code null}
      * is returned if it is not known.
+     *
+     * @revised 9
+     * @spec JPMS
      */
     public String getImplementationVendor() {
         return versionInfo.implVendor;
@@ -334,6 +338,9 @@
      * a {@code Package} for the specified class loader.
      *
      * @see ClassLoader#getDefinedPackage
+     *
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     @Deprecated(since="9")
@@ -356,6 +363,9 @@
      *          class loader and its ancestors
      *
      * @see ClassLoader#getDefinedPackages
+     *
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static Package[] getPackages() {
diff --git a/jdk/src/java.base/share/classes/java/lang/Process.java b/jdk/src/java.base/share/classes/java/lang/Process.java
index c4c5612..90ca41d 100644
--- a/jdk/src/java.base/share/classes/java/lang/Process.java
+++ b/jdk/src/java.base/share/classes/java/lang/Process.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,10 +80,10 @@
  *
  * <p>Subclasses of Process should override the {@link #onExit()} and
  * {@link #toHandle()} methods to provide a fully functional Process including the
- * {@link #getPid() process id},
- * {@link #info() information about the process},
- * {@link #children() direct children}, and
- * {@link #descendants() direct children plus descendants of those children} of the process.
+ * {@linkplain #pid() process id},
+ * {@linkplain #info() information about the process},
+ * {@linkplain #children() direct children}, and
+ * {@linkplain #descendants() direct children plus descendants of those children} of the process.
  * Delegating to the underlying Process or ProcessHandle is typically
  * easiest and most efficient.
  *
@@ -237,14 +237,14 @@
     /**
      * Kills the process.
      * Whether the process represented by this {@code Process} object is
-     * {@link #supportsNormalTermination normally terminated} or not is
+     * {@linkplain #supportsNormalTermination normally terminated} or not is
      * implementation dependent.
      * Forcible process destruction is defined as the immediate termination of a
      * process, whereas normal termination allows the process to shut down cleanly.
      * If the process is not alive, no action is taken.
      * <p>
      * The {@link java.util.concurrent.CompletableFuture} from {@link #onExit} is
-     * {@link java.util.concurrent.CompletableFuture#complete completed}
+     * {@linkplain java.util.concurrent.CompletableFuture#complete completed}
      * when the process has terminated.
      */
     public abstract void destroy();
@@ -257,7 +257,7 @@
      * If the process is not alive, no action is taken.
      * <p>
      * The {@link java.util.concurrent.CompletableFuture} from {@link #onExit} is
-     * {@link java.util.concurrent.CompletableFuture#complete completed}
+     * {@linkplain java.util.concurrent.CompletableFuture#complete completed}
      * when the process has terminated.
      * <p>
      * Invoking this method on {@code Process} objects returned by
@@ -335,15 +335,15 @@
      *
      * @implSpec
      * The implementation of this method returns the process id as:
-     * {@link #toHandle toHandle().getPid()}.
+     * {@link #toHandle toHandle().pid()}.
      *
      * @return the native process id of the process
      * @throws UnsupportedOperationException if the Process implementation
      *         does not support this operation
      * @since 9
      */
-    public long getPid() {
-        return toHandle().getPid();
+    public long pid() {
+        return toHandle().pid();
     }
 
     /**
@@ -357,9 +357,9 @@
      * <p>
      * Calling {@code onExit().get()} waits for the process to terminate and returns
      * the Process. The future can be used to check if the process is
-     * {@link java.util.concurrent.CompletableFuture#isDone done} or to
-     * {@link java.util.concurrent.CompletableFuture#get() wait} for it to terminate.
-     * {@link java.util.concurrent.CompletableFuture#cancel(boolean) Cancelling}
+     * {@linkplain java.util.concurrent.CompletableFuture#isDone done} or to
+     * {@linkplain java.util.concurrent.CompletableFuture#get() wait} for it to terminate.
+     * {@linkplain java.util.concurrent.CompletableFuture#cancel(boolean) Cancelling}
      * the CompletableFuture does not affect the Process.
      * <p>
      * Processes returned from {@link ProcessBuilder#start} override the
@@ -389,7 +389,7 @@
      * {@code waitFor} is interrupted, the thread's interrupt status is preserved.
      * <p>
      * When {@link #waitFor()} returns successfully the CompletableFuture is
-     * {@link java.util.concurrent.CompletableFuture#complete completed} regardless
+     * {@linkplain java.util.concurrent.CompletableFuture#complete completed} regardless
      * of the exit status of the process.
      *
      * This implementation may consume a lot of memory for thread stacks if a
@@ -463,7 +463,7 @@
      * This implementation throws an instance of
      * {@link java.lang.UnsupportedOperationException} and performs no other action.
      * Subclasses should override this method to provide a ProcessHandle for the
-     * process.  The methods {@link #getPid}, {@link #info}, {@link #children},
+     * process.  The methods {@link #pid}, {@link #info}, {@link #children},
      * and {@link #descendants}, unless overridden, operate on the ProcessHandle.
      *
      * @return Returns a ProcessHandle for the Process
@@ -500,10 +500,10 @@
     /**
      * Returns a snapshot of the direct children of the process.
      * The parent of a direct child process is the process.
-     * Typically, a process that is {@link #isAlive not alive} has no children.
+     * Typically, a process that is {@linkplain #isAlive not alive} has no children.
      * <p>
      * <em>Note that processes are created and terminate asynchronously.
-     * There is no guarantee that a process is {@link #isAlive alive}.
+     * There is no guarantee that a process is {@linkplain #isAlive alive}.
      * </em>
      *
      * @implSpec
@@ -526,10 +526,10 @@
      * Returns a snapshot of the descendants of the process.
      * The descendants of a process are the children of the process
      * plus the descendants of those children, recursively.
-     * Typically, a process that is {@link #isAlive not alive} has no children.
+     * Typically, a process that is {@linkplain #isAlive not alive} has no children.
      * <p>
      * <em>Note that processes are created and terminate asynchronously.
-     * There is no guarantee that a process is {@link #isAlive alive}.
+     * There is no guarantee that a process is {@linkplain #isAlive alive}.
      * </em>
      *
      * @implSpec
diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java
index 3140645..4704565 100644
--- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java
@@ -1251,6 +1251,7 @@
      *          If the operating system does not support the creation of processes
      *
      * @throws IOException if an I/O error occurs
+     * @since 9
      */
     public static List<Process> startPipeline(List<ProcessBuilder> builders) throws IOException {
         // Accumulate and check the builders
diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java b/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java
index fbf5cfb..7cd3b5d 100644
--- a/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -104,7 +104,7 @@
      * @throws UnsupportedOperationException if the implementation
      *         does not support this operation
      */
-    long getPid();
+    long pid();
 
     /**
      * Returns an {@code Optional<ProcessHandle>} for an existing native process.
@@ -383,7 +383,7 @@
     /**
      * Returns a hash code value for this ProcessHandle.
      * The hashcode value follows the general contract for {@link Object#hashCode()}.
-     * The value is a function of the {@link #getPid getPid()} value and
+     * The value is a function of the {@link #pid pid()} value and
      * may be a function of additional information to uniquely identify the process.
      * If two ProcessHandles are equal according to the {@link #equals(Object) equals}
      * method, then calling the hashCode method on each of the two objects
diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java b/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java
index 15a2bd4..d634166 100644
--- a/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
  */
 package java.lang;
 
+import java.lang.annotation.Native;
 import java.security.PrivilegedAction;
 import java.time.Duration;
 import java.time.Instant;
@@ -34,11 +35,7 @@
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
-import java.util.concurrent.ForkJoinPool;
-import java.util.concurrent.SynchronousQueue;
 import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
 
@@ -57,6 +54,12 @@
     private static long REAPER_DEFAULT_STACKSIZE = 128 * 1024;
 
     /**
+     * Return value from waitForProcessExit0 indicating the process is not a child.
+     */
+    @Native
+    private static final int NOT_A_CHILD = -2;
+
+    /**
      * Cache the ProcessHandle of this process.
      */
     private static final ProcessHandleImpl current;
@@ -131,6 +134,29 @@
                 // spawn a thread to wait for and deliver the exit value
                 processReaperExecutor.execute(() -> {
                     int exitValue = waitForProcessExit0(pid, shouldReap);
+                    if (exitValue == NOT_A_CHILD) {
+                        // pid not alive or not a child of this process
+                        // If it is alive wait for it to terminate
+                        long sleep = 300;     // initial milliseconds to sleep
+                        int incr = 30;        // increment to the sleep time
+
+                        long startTime = isAlive0(pid);
+                        long origStart = startTime;
+                        while (startTime >= 0) {
+                            try {
+                                Thread.sleep(Math.min(sleep, 5000L)); // no more than 5 sec
+                                sleep += incr;
+                            } catch (InterruptedException ie) {
+                                // ignore and retry
+                            }
+                            startTime = isAlive0(pid);  // recheck if is alive
+                            if (origStart > 0 && startTime != origStart) {
+                                // start time changed, pid is not the same process
+                                break;
+                            }
+                        }
+                        exitValue = 0;
+                    }
                     newCompletion.complete(exitValue);
                     // remove from cache afterwards
                     completions.remove(pid, newCompletion);
@@ -146,7 +172,7 @@
             throw new IllegalStateException("onExit for current process not allowed");
         }
 
-        return ProcessHandleImpl.completion(getPid(), false)
+        return ProcessHandleImpl.completion(pid(), false)
                 .handleAsync((exitStatus, unusedThrowable) -> this);
     }
 
@@ -229,7 +255,7 @@
      * @return the native process ID
      */
     @Override
-    public long getPid() {
+    public long pid() {
         return pid;
     }
 
diff --git a/jdk/src/java.base/share/classes/java/lang/Runtime.java b/jdk/src/java.base/share/classes/java/lang/Runtime.java
index 84a599a..c026e71 100644
--- a/jdk/src/java.base/share/classes/java/lang/Runtime.java
+++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -955,7 +955,7 @@
      *
      * <p> A <em>version number</em>, {@code $VNUM}, is a non-empty sequence
      * of elements separated by period characters (U+002E).  An element is
-     * either zero, or a unsigned integer numeral without leading zeros.  The
+     * either zero, or an unsigned integer numeral without leading zeros.  The
      * final element in a version number must not be zero.  The format is:
      * </p>
      *
@@ -1053,8 +1053,8 @@
      *
      * </ul>
      *
-     * <p> A version number {@code 10-ea} matches {@code $VNUM = "10"} and
-     * {@code $PRE = "ea"}.  The version number {@code 10+-ea} matches
+     * <p> A version string {@code 10-ea} matches {@code $VNUM = "10"} and
+     * {@code $PRE = "ea"}.  The version string {@code 10+-ea} matches
      * {@code $VNUM = "10"} and {@code $OPT = "ea"}. </p>
      *
      * <p> When comparing two version strings, the value of {@code $OPT}, if
@@ -1247,7 +1247,7 @@
          * Compares this version to another.
          *
          * <p> Each of the components in the <a href="#verStr">version</a> is
-         * compared in the follow order of precedence: version numbers,
+         * compared in the following order of precedence: version numbers,
          * pre-release identifiers, build numbers, optional build information.
          * </p>
          *
@@ -1337,14 +1337,12 @@
             int oSize = ob.version().size();
             int min = Math.min(size, oSize);
             for (int i = 0; i < min; i++) {
-                Integer val = version.get(i);
-                Integer oVal = ob.version().get(i);
+                int val = version.get(i);
+                int oVal = ob.version().get(i);
                 if (val != oVal)
                     return val - oVal;
             }
-            if (size != oSize)
-                return size - oSize;
-            return 0;
+            return size - oSize;
         }
 
         private int comparePre(Version ob) {
@@ -1375,9 +1373,9 @@
             if (oBuild.isPresent()) {
                 return (build.isPresent()
                         ? build.get().compareTo(oBuild.get())
-                        : 1);
+                        : -1);
             } else if (build.isPresent()) {
-                return -1;
+                return 1;
             }
             return 0;
         }
@@ -1461,7 +1459,7 @@
          *
          * @return  {@code true} if, and only if, the given object is a {@code
          *          Version} that is identical to this {@code Version}
-         *          ignoring the optinal build information
+         *          ignoring the optional build information
          *
          */
         public boolean equalsIgnoreOptional(Object ob) {
diff --git a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java
index 46d8ef2..489bcf6 100644
--- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java
+++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,7 @@
 package java.lang;
 
 import java.security.*;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
+import java.lang.module.ModuleFinder;
 
 /**
  * This class is for runtime permissions. A {@code RuntimePermission}
@@ -265,6 +263,16 @@
  * </tr>
  *
  * <tr>
+ *   <td>defineClass</td>
+ *   <td>Define a class with
+ * {@link java.lang.invoke.MethodHandles.Lookup#defineClass(byte[])
+ * Lookup.defineClass}.</td>
+ *   <td>This grants code with a suitably privileged {@code Lookup} object
+ * permission to define classes in the same package as the {@code Lookup}'s
+ * lookup class. </td>
+ * </tr>
+ *
+ * <tr>
  *   <td>accessDeclaredMembers</td>
  *   <td>Access to the declared members of a class</td>
  *   <td>This grants code permission to query a class for its public,
@@ -298,6 +306,14 @@
  * </tr>
  *
  * <tr>
+ *   <td>getStackWalkerWithClassReference</td>
+ *   <td>Get a stack walker that can retrieve stack frames with class reference.</td>
+ *   <td>This allows retrieval of Class objects from stack walking.
+ *   This might allow malicious code to access Class objects on the stack
+ *   outside its own context.</td>
+ * </tr>
+ *
+ * <tr>
  *   <td>setDefaultUncaughtExceptionHandler</td>
  *   <td>Setting the default handler to be used when a thread
  *   terminates abruptly due to an uncaught exception</td>
@@ -359,6 +375,14 @@
  *   <td>See {@link java.lang.System.LoggerFinder java.lang.System.LoggerFinder}
  *   for more information.</td>
  * </tr>
+ *
+ * <tr>
+ *   <td>accessSystemModules</td>
+ *   <td>Access system modules in the runtime image.</td>
+ *   <td>This grants the permission to access resources in the
+ *   {@linkplain ModuleFinder#ofSystem system modules} in the runtime image.</td>
+ * </tr>
+ *
  * </table>
  *
  * @implNote
diff --git a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java
index 8a819ee..098e862 100644
--- a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java
+++ b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java
@@ -29,9 +29,7 @@
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleDescriptor.Exports;
 import java.lang.module.ModuleDescriptor.Opens;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Member;
-import java.lang.reflect.Module;
 import java.io.FileDescriptor;
 import java.io.File;
 import java.io.FilePermission;
@@ -1441,7 +1439,7 @@
 
     static {
         // Get the modules in the boot layer
-        Stream<Module> bootLayerModules = Layer.boot().modules().stream();
+        Stream<Module> bootLayerModules = ModuleLayer.boot().modules().stream();
 
         // Filter out the modules loaded by the boot or platform loader
         PrivilegedAction<Set<Module>> pa = () ->
@@ -1458,6 +1456,18 @@
     }
 
     /**
+     * Called by java.security.Security
+     */
+    static void invalidatePackageAccessCache() {
+        synchronized (packageAccessLock) {
+            packageAccessValid = false;
+        }
+        synchronized (packageDefinitionLock) {
+            packageDefinitionValid = false;
+        }
+    }
+
+    /**
      * Returns true if the module's loader is the boot or platform loader.
      */
     private static boolean isBootOrPlatformModule(Module m) {
diff --git a/jdk/src/java.base/share/classes/java/lang/StackFramePermission.java b/jdk/src/java.base/share/classes/java/lang/StackFramePermission.java
deleted file mode 100644
index 58dcba4..0000000
--- a/jdk/src/java.base/share/classes/java/lang/StackFramePermission.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.lang;
-
-/**
- * Permission to access {@link StackWalker.StackFrame}.
- *
- * @see java.lang.StackWalker.Option#RETAIN_CLASS_REFERENCE
- * @see StackWalker.StackFrame#getDeclaringClass()
- */
-public class StackFramePermission extends java.security.BasicPermission {
-    private static final long serialVersionUID = 2841894854386706014L;
-
-    /**
-     * Creates a new {@code StackFramePermission} object.
-     *
-     * @param name Permission name.  Must be "retainClassReference".
-     *
-     * @throws IllegalArgumentException if {@code name} is invalid.
-     * @throws NullPointerException if {@code name} is {@code null}.
-     */
-    public StackFramePermission(String name) {
-        super(name);
-        if (!name.equals("retainClassReference")) {
-            throw new IllegalArgumentException("name: " + name);
-        }
-    }
-}
diff --git a/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java b/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java
index 5597648..00cec33 100644
--- a/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java
+++ b/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java
@@ -25,11 +25,13 @@
 package java.lang;
 
 import jdk.internal.reflect.MethodAccessor;
+import jdk.internal.reflect.ConstructorAccessor;
 import java.lang.StackWalker.Option;
 import java.lang.StackWalker.StackFrame;
 
 import java.lang.annotation.Native;
 import java.lang.reflect.Method;
+import java.lang.reflect.Constructor;
 import java.util.HashSet;
 import java.util.NoSuchElementException;
 import java.util.Objects;
@@ -684,7 +686,7 @@
                 frames[n++] = caller;
             }
             if (frames[1] == null) {
-                throw new IllegalStateException("no caller frame");
+                throw new IllegalCallerException("no caller frame");
             }
             return n;
         }
@@ -922,7 +924,8 @@
          */
         final void setBatch(int depth, int startIndex, int endIndex) {
             if (startIndex <= 0 || endIndex <= 0)
-                throw new IllegalArgumentException("startIndex=" + startIndex + " endIndex=" + endIndex);
+                throw new IllegalArgumentException("startIndex=" + startIndex
+                        + " endIndex=" + endIndex);
 
             this.origin = startIndex;
             this.fence = endIndex;
@@ -979,14 +982,12 @@
     }
 
     private static boolean isReflectionFrame(Class<?> c) {
-        if (c.getName().startsWith("jdk.internal.reflect") &&
-                !MethodAccessor.class.isAssignableFrom(c)) {
-            throw new InternalError("Not jdk.internal.reflect.MethodAccessor: " + c.toString());
-        }
         // ## should filter all @Hidden frames?
         return c == Method.class ||
-                MethodAccessor.class.isAssignableFrom(c) ||
-                c.getName().startsWith("java.lang.invoke.LambdaForm");
+               c == Constructor.class ||
+               MethodAccessor.class.isAssignableFrom(c) ||
+               ConstructorAccessor.class.isAssignableFrom(c) ||
+               c.getName().startsWith("java.lang.invoke.LambdaForm");
     }
 
 }
diff --git a/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java b/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java
index d95ea5e..b96fb36 100644
--- a/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java
+++ b/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java
@@ -33,8 +33,6 @@
 import java.lang.module.ModuleDescriptor.Version;
 import java.lang.module.ModuleReference;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.HashSet;
 import java.util.Objects;
 import java.util.Optional;
@@ -92,6 +90,8 @@
      * @throws NullPointerException if {@code declaringClass} or
      *         {@code methodName} is null
      * @since 1.5
+     * @revised 9
+     * @spec JPMS
      */
     public StackTraceElement(String declaringClass, String methodName,
                              String fileName, int lineNumber) {
@@ -128,6 +128,7 @@
      *         or {@code methodName} is {@code null}
      *
      * @since 9
+     * @spec JPMS
      */
     public StackTraceElement(String classLoaderName,
                              String moduleName, String moduleVersion,
@@ -187,7 +188,8 @@
      *         point represented by this stack trace element; {@code null}
      *         if the module name is not available.
      * @since 9
-     * @see java.lang.reflect.Module#getName()
+     * @spec JPMS
+     * @see Module#getName()
      */
     public String getModuleName() {
         return moduleName;
@@ -201,6 +203,7 @@
      *         point represented by this stack trace element; {@code null}
      *         if the module version is not available.
      * @since 9
+     * @spec JPMS
      * @see java.lang.module.ModuleDescriptor.Version
      */
     public String getModuleVersion() {
@@ -216,6 +219,7 @@
      *         if the class loader is not named.
      *
      * @since 9
+     * @spec JPMS
      * @see java.lang.ClassLoader#getName()
      */
     public String getClassLoaderName() {
@@ -329,6 +333,8 @@
      * {@link java.lang.StackWalker.StackFrame}, where an implementation may
      * choose to omit some element in the returned string.
      *
+     * @revised 9
+     * @spec JPMS
      * @see    Throwable#printStackTrace()
      */
     public String toString() {
@@ -376,6 +382,9 @@
      * @return true if the specified object is another
      *         {@code StackTraceElement} instance representing the same
      *         execution point as this instance.
+     *
+     * @revised 9
+     * @spec JPMS
      */
     public boolean equals(Object obj) {
         if (obj==this)
@@ -469,7 +478,7 @@
         if (!VM.isModuleSystemInited())
             return true;
 
-        return Layer.boot() == m.getLayer() && HashedModules.contains(m);
+        return ModuleLayer.boot() == m.getLayer() && HashedModules.contains(m);
     }
 
     /*
@@ -481,7 +490,7 @@
 
         static Set<String> hashedModules() {
 
-            Optional<ResolvedModule> resolvedModule = Layer.boot()
+            Optional<ResolvedModule> resolvedModule = ModuleLayer.boot()
                     .configuration()
                     .findModule("java.base");
             assert resolvedModule.isPresent();
diff --git a/jdk/src/java.base/share/classes/java/lang/StackWalker.java b/jdk/src/java.base/share/classes/java/lang/StackWalker.java
index b5c43fd..7e4bc1e 100644
--- a/jdk/src/java.base/share/classes/java/lang/StackWalker.java
+++ b/jdk/src/java.base/share/classes/java/lang/StackWalker.java
@@ -29,6 +29,7 @@
 import java.util.*;
 import java.util.function.Consumer;
 import java.util.function.Function;
+import java.util.function.Predicate;
 import java.util.stream.Stream;
 
 /**
@@ -207,13 +208,23 @@
         /**
          * Shows all reflection frames.
          *
-         * <p>By default, reflection frames are hidden.  This includes the
-         * {@link java.lang.reflect.Method#invoke} method
-         * and the reflection implementation classes. A {@code StackWalker} with
-         * this {@code SHOW_REFLECT_FRAMES} option will show all reflection frames.
-         * The {@link #SHOW_HIDDEN_FRAMES} option can also be used to show all
+         * <p>By default, reflection frames are hidden.  A {@code StackWalker}
+         * configured with this {@code SHOW_REFLECT_FRAMES} option
+         * will show all reflection frames that
+         * include {@link java.lang.reflect.Method#invoke} and
+         * {@link java.lang.reflect.Constructor#newInstance(Object...)}
+         * and their reflection implementation classes.
+         *
+         * <p>The {@link #SHOW_HIDDEN_FRAMES} option can also be used to show all
          * reflection frames and it will also show other hidden frames that
          * are implementation-specific.
+         *
+         * @apiNote
+         * This option includes the stack frames representing the invocation of
+         * {@code Method} and {@code Constructor}.  Any utility methods that
+         * are equivalent to calling {@code Method.invoke} or
+         * {@code Constructor.newInstance} such as {@code Class.newInstance}
+         * are not filtered or controlled by any stack walking option.
          */
         SHOW_REFLECT_FRAMES,
         /**
@@ -268,7 +279,7 @@
      * If a security manager is present and the given {@code option} is
      * {@link Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE},
      * it calls its {@link SecurityManager#checkPermission checkPermission}
-     * method for {@code StackFramePermission("retainClassReference")}.
+     * method for {@code RuntimePermission("getStackWalkerWithClassReference")}.
      *
      * @param option {@link Option stack walking option}
      *
@@ -292,7 +303,7 @@
      * If a security manager is present and the given {@code options} contains
      * {@link Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE},
      * it calls its {@link SecurityManager#checkPermission checkPermission}
-     * method for {@code StackFramePermission("retainClassReference")}.
+     * method for {@code RuntimePermission("getStackWalkerWithClassReference")}.
      *
      * @param options {@link Option stack walking option}
      *
@@ -322,7 +333,7 @@
      * If a security manager is present and the given {@code options} contains
      * {@link Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE},
      * it calls its {@link SecurityManager#checkPermission checkPermission}
-     * method for {@code StackFramePermission("retainClassReference")}.
+     * method for {@code RuntimePermission("getStackWalkerWithClassReference")}.
      *
      * <p>
      * The {@code estimateDepth} specifies the estimate number of stack frames
@@ -365,7 +376,7 @@
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             if (options.contains(Option.RETAIN_CLASS_REFERENCE)) {
-                sm.checkPermission(new StackFramePermission("retainClassReference"));
+                sm.checkPermission(new RuntimePermission("getStackWalkerWithClassReference"));
             }
         }
     }
@@ -465,28 +476,31 @@
     }
 
     /**
-     * Gets the {@code Class} object of the caller invoking the method
-     * that calls this {@code getCallerClass} method.
+     * Gets the {@code Class} object of the caller who invoked the method
+     * that invoked {@code getCallerClass}.
      *
-     * <p> Reflection frames, {@link java.lang.invoke.MethodHandle}, and
-     * hidden frames are filtered regardless of the
+     * <p> This method filters {@linkplain Option#SHOW_REFLECT_FRAMES reflection
+     * frames}, {@link java.lang.invoke.MethodHandle}, and
+     * {@linkplain Option#SHOW_HIDDEN_FRAMES hidden frames} regardless of the
      * {@link Option#SHOW_REFLECT_FRAMES SHOW_REFLECT_FRAMES}
      * and {@link Option#SHOW_HIDDEN_FRAMES SHOW_HIDDEN_FRAMES} options
      * this {@code StackWalker} has been configured with.
      *
+     * <p> This method should be called when a caller frame is present.  If
+     * it is called from the bottom most frame on the stack,
+     * {@code IllegalCallerException} will be thrown.
+     *
      * <p> This method throws {@code UnsupportedOperationException}
      * if this {@code StackWalker} is not configured with the
      * {@link Option#RETAIN_CLASS_REFERENCE RETAIN_CLASS_REFERENCE} option.
-     * This method should be called when a caller frame is present.  If
-     * it is called from the last frame on the stack,
-     * {@code IllegalStateException} will be thrown.
      *
      * @apiNote
      * For example, {@code Util::getResourceBundle} loads a resource bundle
-     * on behalf of the caller.  It calls this {@code getCallerClass} method
-     * to find the method calling {@code Util::getResourceBundle} and uses the caller's
-     * class loader to load the resource bundle. The caller class in this example
-     * is the {@code MyTool} class.
+     * on behalf of the caller.  It invokes {@code getCallerClass} to identify
+     * the class whose method called {@code Util::getResourceBundle}.
+     * Then, it obtains the class loader of that class, and uses
+     * the class loader to load the resource bundle. The caller class
+     * in this example is {@code MyTool}.
      *
      * <pre>{@code
      * class Util {
@@ -517,17 +531,17 @@
      * }</pre>
      *
      * When the {@code getCallerClass} method is called from a method that
-     * is the last frame on the stack,
+     * is the bottom most frame on the stack,
      * for example, {@code static public void main} method launched by the
      * {@code java} launcher, or a method invoked from a JNI attached thread,
-     * {@code IllegalStateException} is thrown.
+     * {@code IllegalCallerException} is thrown.
      *
      * @return {@code Class} object of the caller's caller invoking this method.
      *
      * @throws UnsupportedOperationException if this {@code StackWalker}
      *         is not configured with {@link Option#RETAIN_CLASS_REFERENCE
      *         Option.RETAIN_CLASS_REFERENCE}.
-     * @throws IllegalStateException if there is no caller frame, i.e.
+     * @throws IllegalCallerException if there is no caller frame, i.e.
      *         when this {@code getCallerClass} method is called from a method
      *         which is the last frame on the stack.
      */
diff --git a/jdk/src/java.base/share/classes/java/lang/String.java b/jdk/src/java.base/share/classes/java/lang/String.java
index 9bcc699..8cc0ee6 100644
--- a/jdk/src/java.base/share/classes/java/lang/String.java
+++ b/jdk/src/java.base/share/classes/java/lang/String.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1064,11 +1064,7 @@
             if (!isLatin1()) {  // utf16 str and latin1 abs can never be "equal"
                 return false;
             }
-            for (int i = 0; i < len; i++) {
-                if ((char)(v1[i] & 0xff) != StringUTF16.getChar(v2, i)) {
-                    return false;
-                }
-            }
+            return StringUTF16.contentEquals(v1, v2, len);
         }
         return true;
     }
@@ -1120,10 +1116,8 @@
                 }
             }
         } else {
-            for (int i = 0; i < n; i++) {
-                if (StringUTF16.getChar(val, i) != cs.charAt(i)) {
-                    return false;
-                }
+            if (!StringUTF16.contentEquals(val, cs, n)) {
+                return false;
             }
         }
         return true;
@@ -1734,6 +1728,9 @@
         if (tgtCount == 0) {
             return fromIndex;
         }
+        if (tgtCount > srcCount) {
+            return -1;
+        }
         if (srcCoder == tgtCoder) {
             return srcCoder == LATIN1
                 ? StringLatin1.indexOf(src, srcCount, tgt, tgtCount, fromIndex)
@@ -1792,7 +1789,7 @@
      * is the string being searched for.
      *
      * @param   src         the characters being searched.
-     * @param   srcCoder  coder handles the mapping between bytes/chars
+     * @param   srcCoder    coder handles the mapping between bytes/chars
      * @param   srcCount    count of the source string.
      * @param   tgt         the characters being searched for.
      * @param   fromIndex   the index to begin searching from.
@@ -1807,12 +1804,12 @@
          * consistency, don't check for null str.
          */
         int rightIndex = srcCount - tgtCount;
-        if (fromIndex < 0) {
-            return -1;
-        }
         if (fromIndex > rightIndex) {
             fromIndex = rightIndex;
         }
+        if (fromIndex < 0) {
+            return -1;
+        }
         /* Empty string always matches. */
         if (tgtCount == 0) {
             return fromIndex;
@@ -1825,31 +1822,8 @@
         if (srcCoder == LATIN1) {    // && tgtCoder == UTF16
             return -1;
         }
-                                     // srcCoder == UTF16 && tgtCoder == LATIN1
-        int min = tgtCount - 1;
-        int i = min + fromIndex;
-        int strLastIndex = tgtCount - 1;
-
-        char strLastChar = (char)(tgt[strLastIndex] & 0xff);
-    startSearchForLastChar:
-        while (true) {
-            while (i >= min && StringUTF16.getChar(src, i) != strLastChar) {
-                i--;
-            }
-            if (i < min) {
-                return -1;
-            }
-            int j = i - 1;
-            int start = j - strLastIndex;
-            int k = strLastIndex - 1;
-            while (j > start) {
-                if (StringUTF16.getChar(src, j--) != (tgt[k--] & 0xff)) {
-                    i--;
-                    continue startSearchForLastChar;
-                }
-            }
-            return start + 1;
-        }
+        // srcCoder == UTF16 && tgtCoder == LATIN1
+        return StringUTF16.lastIndexOfLatin1(src, srcCount, tgt, tgtCount, fromIndex);
     }
 
     /**
@@ -2672,7 +2646,6 @@
      * point</a> is passed through uninterpreted.
      *
      * @return an IntStream of char values from this sequence
-     * @since 9
      */
     @Override
     public IntStream chars() {
@@ -2692,7 +2665,6 @@
      * {@code int} values which are then passed to the stream.
      *
      * @return an IntStream of Unicode code points from this sequence
-     * @since 9
      */
     @Override
     public IntStream codePoints() {
@@ -3080,7 +3052,8 @@
      */
     static void checkIndex(int index, int length) {
         if (index < 0 || index >= length) {
-            throw new StringIndexOutOfBoundsException("index " + index);
+            throw new StringIndexOutOfBoundsException("index " + index +
+                                                      ",length " + length);
         }
     }
 
@@ -3118,7 +3091,7 @@
      *          If {@code begin} is negative, {@code begin} is greater than
      *          {@code end}, or {@code end} is greater than {@code length}.
      */
-    private static void checkBoundsBeginEnd(int begin, int end, int length) {
+    static void checkBoundsBeginEnd(int begin, int end, int length) {
         if (begin < 0 || begin > end || end > length) {
             throw new StringIndexOutOfBoundsException(
                 "begin " + begin + ", end " + end + ", length " + length);
diff --git a/jdk/src/java.base/share/classes/java/lang/StringCoding.java b/jdk/src/java.base/share/classes/java/lang/StringCoding.java
index ccbe6f2..7340fed 100644
--- a/jdk/src/java.base/share/classes/java/lang/StringCoding.java
+++ b/jdk/src/java.base/share/classes/java/lang/StringCoding.java
@@ -46,9 +46,6 @@
 import static java.lang.String.LATIN1;
 import static java.lang.String.UTF16;
 import static java.lang.String.COMPACT_STRINGS;
-import static java.nio.charset.StandardCharsets.ISO_8859_1;
-import static java.nio.charset.StandardCharsets.US_ASCII;
-import static java.nio.charset.StandardCharsets.UTF_8;
 
 /**
  * Utility class for string encoding and decoding.
@@ -64,6 +61,10 @@
     private static final ThreadLocal<SoftReference<StringEncoder>> encoder =
         new ThreadLocal<>();
 
+    private static final Charset ISO_8859_1 = Charset.forName("iso-8859-1");
+    private static final Charset US_ASCII = Charset.forName("us-ascii");
+    private static final Charset UTF_8 = Charset.forName("utf-8");
+
     private static boolean warnUnsupportedCharset = true;
 
     private static <T> T deref(ThreadLocal<SoftReference<T>> tl) {
diff --git a/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java b/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java
index f3f1608..809fab8 100644
--- a/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java
+++ b/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -293,7 +293,7 @@
         if (coder == String.LATIN1) {
             return Integer.getChars(value, index, buf);
         } else {
-            return Integer.getCharsUTF16(value, index, buf);
+            return StringUTF16.getChars(value, index, buf);
         }
     }
 
@@ -311,7 +311,7 @@
         if (coder == String.LATIN1) {
             return Long.getChars(value, index, buf);
         } else {
-            return Long.getCharsUTF16(value, index, buf);
+            return StringUTF16.getChars(value, index, buf);
         }
     }
 
diff --git a/jdk/src/java.base/share/classes/java/lang/StringLatin1.java b/jdk/src/java.base/share/classes/java/lang/StringLatin1.java
index b307bee..73a84eb 100644
--- a/jdk/src/java.base/share/classes/java/lang/StringLatin1.java
+++ b/jdk/src/java.base/share/classes/java/lang/StringLatin1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@
 import static java.lang.String.LATIN1;
 import static java.lang.String.UTF16;
 import static java.lang.String.checkOffset;
-import static java.lang.String.checkBoundsOffCount;
 
 final class StringLatin1 {
 
@@ -566,11 +565,7 @@
     // inflatedCopy byte[] -> byte[]
     @HotSpotIntrinsicCandidate
     public static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) {
-        // We need a range check here because 'putChar' has no checks
-        checkBoundsOffCount(dstOff << 1, len << 1, dst.length);
-        for (int i = 0; i < len; i++) {
-            StringUTF16.putChar(dst, dstOff++, src[srcOff++] & 0xff);
-        }
+        StringUTF16.inflate(src, srcOff, dst, dstOff, len);
     }
 
     static class CharsSpliterator implements Spliterator.OfInt {
diff --git a/jdk/src/java.base/share/classes/java/lang/StringUTF16.java b/jdk/src/java.base/share/classes/java/lang/StringUTF16.java
index 2c0dd91..e4a94d1 100644
--- a/jdk/src/java.base/share/classes/java/lang/StringUTF16.java
+++ b/jdk/src/java.base/share/classes/java/lang/StringUTF16.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,12 +30,11 @@
 import java.util.Spliterator;
 import java.util.function.IntConsumer;
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.vm.annotation.ForceInline;
+import jdk.internal.vm.annotation.DontInline;
 
 import static java.lang.String.UTF16;
 import static java.lang.String.LATIN1;
-import static java.lang.String.checkIndex;
-import static java.lang.String.checkOffset;
-import static java.lang.String.checkBoundsOffCount;
 
 final class StringUTF16 {
 
@@ -51,33 +50,37 @@
     }
 
     @HotSpotIntrinsicCandidate
-    public static void putChar(byte[] val, int index, int c) {
+    // intrinsic performs no bounds checks
+    static void putChar(byte[] val, int index, int c) {
+        assert index >= 0 && index < length(val) : "Trusted caller missed bounds check";
         index <<= 1;
         val[index++] = (byte)(c >> HI_BYTE_SHIFT);
         val[index]   = (byte)(c >> LO_BYTE_SHIFT);
     }
 
     @HotSpotIntrinsicCandidate
-    public static char getChar(byte[] val, int index) {
+    // intrinsic performs no bounds checks
+    static char getChar(byte[] val, int index) {
+        assert index >= 0 && index < length(val) : "Trusted caller missed bounds check";
         index <<= 1;
         return (char)(((val[index++] & 0xff) << HI_BYTE_SHIFT) |
                       ((val[index]   & 0xff) << LO_BYTE_SHIFT));
     }
 
-    public static char charAt(byte[] value, int index) {
-        if (index < 0 || index >= value.length >> 1) {
-            throw new StringIndexOutOfBoundsException(index);
-        }
-        return getChar(value, index);
-    }
-
     public static int length(byte[] value) {
         return value.length >> 1;
     }
 
-    public static int codePointAt(byte[] value, int index, int end) {
+    private static int codePointAt(byte[] value, int index, int end, boolean checked) {
+        assert index < end;
+        if (checked) {
+            checkIndex(index, value);
+        }
         char c1 = getChar(value, index);
         if (Character.isHighSurrogate(c1) && ++index < end) {
+            if (checked) {
+                checkIndex(index, value);
+            }
             char c2 = getChar(value, index);
             if (Character.isLowSurrogate(c2)) {
                return Character.toCodePoint(c1, c2);
@@ -86,10 +89,22 @@
         return c1;
     }
 
-    public static int codePointBefore(byte[] value, int index) {
-        char c2 = getChar(value, --index);
+    public static int codePointAt(byte[] value, int index, int end) {
+       return codePointAt(value, index, end, false /* unchecked */);
+    }
+
+    private static int codePointBefore(byte[] value, int index, boolean checked) {
+        --index;
+        if (checked) {
+            checkIndex(index, value);
+        }
+        char c2 = getChar(value, index);
         if (Character.isLowSurrogate(c2) && index > 0) {
-            char c1 = getChar(value, --index);
+            --index;
+            if (checked) {
+                checkIndex(index, value);
+            }
+            char c1 = getChar(value, index);
             if (Character.isHighSurrogate(c1)) {
                return Character.toCodePoint(c1, c2);
             }
@@ -97,11 +112,19 @@
         return c2;
     }
 
-    public static int codePointCount(byte[] value, int beginIndex, int endIndex) {
+    public static int codePointBefore(byte[] value, int index) {
+        return codePointBefore(value, index, false /* unchecked */);
+    }
+
+    private static int codePointCount(byte[] value, int beginIndex, int endIndex, boolean checked) {
+        assert beginIndex <= endIndex;
         int count = endIndex - beginIndex;
-        for (int i = beginIndex; i < endIndex; ) {
+        int i = beginIndex;
+        if (checked && i < endIndex) {
+            checkBoundsBeginEnd(i, endIndex, value);
+        }
+        for (; i < endIndex - 1; ) {
             if (Character.isHighSurrogate(getChar(value, i++)) &&
-                i < endIndex &&
                 Character.isLowSurrogate(getChar(value, i))) {
                 count--;
                 i++;
@@ -110,6 +133,10 @@
         return count;
     }
 
+    public static int codePointCount(byte[] value, int beginIndex, int endIndex) {
+        return codePointCount(value, beginIndex, endIndex, false /* unchecked */);
+    }
+
     public static char[] toChars(byte[] value) {
         char[] dst = new char[value.length >> 1];
         getChars(value, 0, dst.length, dst, 0);
@@ -162,7 +189,7 @@
     @HotSpotIntrinsicCandidate
     public static int compress(byte[] src, int srcOff, byte[] dst, int dstOff, int len) {
         // We need a range check here because 'getChar' has no checks
-        checkBoundsOffCount(srcOff << 1, len << 1, src.length);
+        checkBoundsOffCount(srcOff, len, src);
         for (int i = 0; i < len; i++) {
             char c = getChar(src, srcOff);
             if (c > 0xFF) {
@@ -212,7 +239,7 @@
     public static void getChars(byte[] value, int srcBegin, int srcEnd, char dst[], int dstBegin) {
         // We need a range check here because 'getChar' has no checks
         if (srcBegin < srcEnd) {
-            checkBoundsOffCount(srcBegin << 1, (srcEnd - srcBegin) << 1, value.length);
+            checkBoundsOffCount(srcBegin, srcEnd - srcBegin, value);
         }
         for (int i = srcBegin; i < srcEnd; i++) {
             dst[dstBegin++] = getChar(value, i);
@@ -319,14 +346,25 @@
         if (str.length == 0) {
             return 0;
         }
-        if (value.length == 0) {
+        if (value.length < str.length) {
             return -1;
         }
-        return indexOf(value, length(value), str, length(str), 0);
+        return indexOfUnsafe(value, length(value), str, length(str), 0);
     }
 
     @HotSpotIntrinsicCandidate
     public static int indexOf(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) {
+        checkBoundsBeginEnd(fromIndex, valueCount, value);
+        checkBoundsBeginEnd(0, strCount, str);
+        return indexOfUnsafe(value, valueCount, str, strCount, fromIndex);
+    }
+
+
+    private static int indexOfUnsafe(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) {
+        assert fromIndex >= 0;
+        assert strCount > 0;
+        assert strCount <= length(str);
+        assert valueCount >= strCount;
         char first = getChar(str, 0);
         int max = (valueCount - strCount);
         for (int i = fromIndex; i <= max; i++) {
@@ -348,6 +386,7 @@
         return -1;
     }
 
+
     /**
      * Handles indexOf Latin1 substring in UTF16 string.
      */
@@ -356,14 +395,24 @@
         if (str.length == 0) {
             return 0;
         }
-        if (value.length == 0) {
+        if (length(value) < str.length) {
             return -1;
         }
-        return indexOfLatin1(value, length(value), str, str.length, 0);
+        return indexOfLatin1Unsafe(value, length(value), str, str.length, 0);
     }
 
     @HotSpotIntrinsicCandidate
     public static int indexOfLatin1(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) {
+        checkBoundsBeginEnd(fromIndex, srcCount, src);
+        String.checkBoundsBeginEnd(0, tgtCount, tgt.length);
+        return indexOfLatin1Unsafe(src, srcCount, tgt, tgtCount, fromIndex);
+    }
+
+    public static int indexOfLatin1Unsafe(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) {
+        assert fromIndex >= 0;
+        assert tgtCount > 0;
+        assert tgtCount <= tgt.length;
+        assert srcCount >= tgtCount;
         char first = (char)(tgt[0] & 0xff);
         int max = (srcCount - tgtCount);
         for (int i = fromIndex; i <= max; i++) {
@@ -389,6 +438,11 @@
 
     @HotSpotIntrinsicCandidate
     private static int indexOfChar(byte[] value, int ch, int fromIndex, int max) {
+        checkBoundsBeginEnd(fromIndex, max, value);
+        return indexOfCharUnsafe(value, ch, fromIndex, max);
+    }
+
+    private static int indexOfCharUnsafe(byte[] value, int ch, int fromIndex, int max) {
         for (int i = fromIndex; i < max; i++) {
             if (getChar(value, i) == ch) {
                 return i;
@@ -404,6 +458,7 @@
         if (Character.isValidCodePoint(ch)) {
             final char hi = Character.highSurrogate(ch);
             final char lo = Character.lowSurrogate(ch);
+            checkBoundsBeginEnd(fromIndex, max, value);
             for (int i = fromIndex; i < max - 1; i++) {
                 if (getChar(value, i) == hi && getChar(value, i + 1 ) == lo) {
                     return i;
@@ -413,13 +468,21 @@
         return -1;
     }
 
+    // srcCoder == UTF16 && tgtCoder == UTF16
     public static int lastIndexOf(byte[] src, int srcCount,
                                   byte[] tgt, int tgtCount, int fromIndex) {
+        assert fromIndex >= 0;
+        assert tgtCount > 0;
+        assert tgtCount <= length(tgt);
         int min = tgtCount - 1;
         int i = min + fromIndex;
         int strLastIndex = tgtCount - 1;
+
+        checkIndex(strLastIndex, tgt);
         char strLastChar = getChar(tgt, strLastIndex);
 
+        checkIndex(i, src);
+
     startSearchForLastChar:
         while (true) {
             while (i >= min && getChar(src, i) != strLastChar) {
@@ -509,6 +572,9 @@
     public static boolean regionMatchesCI(byte[] value, int toffset,
                                           byte[] other, int ooffset, int len) {
         int last = toffset + len;
+        assert toffset >= 0 && ooffset >= 0;
+        assert ooffset + len <= length(other);
+        assert last <= length(value);
         while (toffset < last) {
             char c1 = getChar(value, toffset++);
             char c2 = getChar(other, ooffset++);
@@ -599,6 +665,8 @@
     private static String toLowerCaseEx(String str, byte[] value,
                                         byte[] result, int first, Locale locale,
                                         boolean localeDependent) {
+        assert(result.length == value.length);
+        assert(first >= 0);
         int resultOffset = first;
         int length = value.length >> 1;
         int srcCount;
@@ -633,6 +701,8 @@
                     System.arraycopy(result, 0, result2, 0, resultOffset << 1);
                     result = result2;
                 }
+                assert resultOffset >= 0;
+                assert resultOffset + mapLen <= length(result);
                 for (int x = 0; x < mapLen; ++x) {
                     putChar(result, resultOffset++, lowerCharArray[x]);
                 }
@@ -697,6 +767,8 @@
                                         byte[] result, int first,
                                         Locale locale, boolean localeDependent)
     {
+        assert(result.length == value.length);
+        assert(first >= 0);
         int resultOffset = first;
         int length = value.length >> 1;
         int srcCount;
@@ -733,10 +805,12 @@
                     byte[] result2 = newBytesFor((result.length >> 1) + mapLen - srcCount);
                     System.arraycopy(result, 0, result2, 0, resultOffset << 1);
                     result = result2;
-                 }
-                 for (int x = 0; x < mapLen; ++x) {
+                }
+                assert resultOffset >= 0;
+                assert resultOffset + mapLen <= length(result);
+                for (int x = 0; x < mapLen; ++x) {
                     putChar(result, resultOffset++, upperCharArray[x]);
-                 }
+                }
             }
         }
         return newString(result, 0, resultOffset);
@@ -757,7 +831,7 @@
             null;
     }
 
-    public static void putChars(byte[] val, int index, char[] str, int off, int end) {
+    private static void putChars(byte[] val, int index, char[] str, int off, int end) {
         while (off < end) {
             putChar(val, index++, str[off++]);
         }
@@ -927,35 +1001,172 @@
     ////////////////////////////////////////////////////////////////
 
     public static void putCharSB(byte[] val, int index, int c) {
-        checkIndex(index, val.length >> 1);
+        checkIndex(index, val);
         putChar(val, index, c);
     }
 
     public static void putCharsSB(byte[] val, int index, char[] ca, int off, int end) {
-        checkOffset(index + end - off, val.length >> 1);
+        checkBoundsBeginEnd(index, index + end - off, val);
         putChars(val, index, ca, off, end);
     }
 
     public static void putCharsSB(byte[] val, int index, CharSequence s, int off, int end) {
-        checkOffset(index + end - off, val.length >> 1);
+        checkBoundsBeginEnd(index, index + end - off, val);
         for (int i = off; i < end; i++) {
             putChar(val, index++, s.charAt(i));
         }
     }
 
     public static int codePointAtSB(byte[] val, int index, int end) {
-        checkOffset(end, val.length >> 1);
-        return codePointAt(val, index, end);
+        return codePointAt(val, index, end, true /* checked */);
     }
 
     public static int codePointBeforeSB(byte[] val, int index) {
-        checkOffset(index, val.length >> 1);
-        return codePointBefore(val, index);
+        return codePointBefore(val, index, true /* checked */);
     }
 
     public static int codePointCountSB(byte[] val, int beginIndex, int endIndex) {
-        checkOffset(endIndex, val.length >> 1);
-        return codePointCount(val, beginIndex, endIndex);
+        return codePointCount(val, beginIndex, endIndex, true /* checked */);
+    }
+
+    public static int getChars(int i, int begin, int end, byte[] value) {
+        checkBoundsBeginEnd(begin, end, value);
+        int pos = getChars(i, end, value);
+        assert begin == pos;
+        return pos;
+    }
+
+    public static int getChars(long l, int begin, int end, byte[] value) {
+        checkBoundsBeginEnd(begin, end, value);
+        int pos = getChars(l, end, value);
+        assert begin == pos;
+        return pos;
+    }
+
+    public static boolean contentEquals(byte[] v1, byte[] v2, int len) {
+        checkBoundsOffCount(0, len, v2);
+        for (int i = 0; i < len; i++) {
+            if ((char)(v1[i] & 0xff) != getChar(v2, i)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public static boolean contentEquals(byte[] value, CharSequence cs, int len) {
+        checkOffset(len, value);
+        for (int i = 0; i < len; i++) {
+            if (getChar(value, i) != cs.charAt(i)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public static int putCharsAt(byte[] value, int i, char c1, char c2, char c3, char c4) {
+        int end = i + 4;
+        checkBoundsBeginEnd(i, end, value);
+        putChar(value, i++, c1);
+        putChar(value, i++, c2);
+        putChar(value, i++, c3);
+        putChar(value, i++, c4);
+        assert(i == end);
+        return end;
+    }
+
+    public static int putCharsAt(byte[] value, int i, char c1, char c2, char c3, char c4, char c5) {
+        int end = i + 5;
+        checkBoundsBeginEnd(i, end, value);
+        putChar(value, i++, c1);
+        putChar(value, i++, c2);
+        putChar(value, i++, c3);
+        putChar(value, i++, c4);
+        putChar(value, i++, c5);
+        assert(i == end);
+        return end;
+    }
+
+    public static char charAt(byte[] value, int index) {
+        checkIndex(index, value);
+        return getChar(value, index);
+    }
+
+    public static void reverse(byte[] val, int count) {
+        checkOffset(count, val);
+        int n = count - 1;
+        boolean hasSurrogates = false;
+        for (int j = (n-1) >> 1; j >= 0; j--) {
+            int k = n - j;
+            char cj = getChar(val, j);
+            char ck = getChar(val, k);
+            putChar(val, j, ck);
+            putChar(val, k, cj);
+            if (Character.isSurrogate(cj) ||
+                Character.isSurrogate(ck)) {
+                hasSurrogates = true;
+            }
+        }
+        if (hasSurrogates) {
+            reverseAllValidSurrogatePairs(val, count);
+        }
+    }
+
+    /** Outlined helper method for reverse() */
+    private static void reverseAllValidSurrogatePairs(byte[] val, int count) {
+        for (int i = 0; i < count - 1; i++) {
+            char c2 = getChar(val, i);
+            if (Character.isLowSurrogate(c2)) {
+                char c1 = getChar(val, i + 1);
+                if (Character.isHighSurrogate(c1)) {
+                    putChar(val, i++, c1);
+                    putChar(val, i, c2);
+                }
+            }
+        }
+    }
+
+    // inflatedCopy byte[] -> byte[]
+    public static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) {
+        // We need a range check here because 'putChar' has no checks
+        checkBoundsOffCount(dstOff, len, dst);
+        for (int i = 0; i < len; i++) {
+            putChar(dst, dstOff++, src[srcOff++] & 0xff);
+        }
+    }
+
+    // srcCoder == UTF16 && tgtCoder == LATIN1
+    public static int lastIndexOfLatin1(byte[] src, int srcCount,
+                                        byte[] tgt, int tgtCount, int fromIndex) {
+        assert fromIndex >= 0;
+        assert tgtCount > 0;
+        assert tgtCount <= tgt.length;
+        int min = tgtCount - 1;
+        int i = min + fromIndex;
+        int strLastIndex = tgtCount - 1;
+
+        char strLastChar = (char)(tgt[strLastIndex] & 0xff);
+
+        checkIndex(i, src);
+
+    startSearchForLastChar:
+        while (true) {
+            while (i >= min && getChar(src, i) != strLastChar) {
+                i--;
+            }
+            if (i < min) {
+                return -1;
+            }
+            int j = i - 1;
+            int start = j - strLastIndex;
+            int k = strLastIndex - 1;
+            while (j > start) {
+                if (getChar(src, j--) != (tgt[k--] & 0xff)) {
+                    i--;
+                    continue startSearchForLastChar;
+                }
+            }
+            return start + 1;
+        }
     }
 
     ////////////////////////////////////////////////////////////////
@@ -975,4 +1186,123 @@
     }
 
     static final int MAX_LENGTH = Integer.MAX_VALUE >> 1;
+
+    // Used by trusted callers.  Assumes all necessary bounds checks have
+    // been done by the caller.
+
+    /**
+     * This is a variant of {@link Integer#getChars(int, int, byte[])}, but for
+     * UTF-16 coder.
+     *
+     * @param i     value to convert
+     * @param index next index, after the least significant digit
+     * @param buf   target buffer, UTF16-coded.
+     * @return index of the most significant digit or minus sign, if present
+     */
+    static int getChars(int i, int index, byte[] buf) {
+        int q, r;
+        int charPos = index;
+
+        boolean negative = (i < 0);
+        if (!negative) {
+            i = -i;
+        }
+
+        // Get 2 digits/iteration using ints
+        while (i <= -100) {
+            q = i / 100;
+            r = (q * 100) - i;
+            i = q;
+            putChar(buf, --charPos, Integer.DigitOnes[r]);
+            putChar(buf, --charPos, Integer.DigitTens[r]);
+        }
+
+        // We know there are at most two digits left at this point.
+        q = i / 10;
+        r = (q * 10) - i;
+        putChar(buf, --charPos, '0' + r);
+
+        // Whatever left is the remaining digit.
+        if (q < 0) {
+            putChar(buf, --charPos, '0' - q);
+        }
+
+        if (negative) {
+            putChar(buf, --charPos, '-');
+        }
+        return charPos;
+    }
+
+    /**
+     * This is a variant of {@link Long#getChars(long, int, byte[])}, but for
+     * UTF-16 coder.
+     *
+     * @param i     value to convert
+     * @param index next index, after the least significant digit
+     * @param buf   target buffer, UTF16-coded.
+     * @return index of the most significant digit or minus sign, if present
+     */
+    static int getChars(long i, int index, byte[] buf) {
+        long q;
+        int r;
+        int charPos = index;
+
+        boolean negative = (i < 0);
+        if (!negative) {
+            i = -i;
+        }
+
+        // Get 2 digits/iteration using longs until quotient fits into an int
+        while (i <= Integer.MIN_VALUE) {
+            q = i / 100;
+            r = (int)((q * 100) - i);
+            i = q;
+            putChar(buf, --charPos, Integer.DigitOnes[r]);
+            putChar(buf, --charPos, Integer.DigitTens[r]);
+        }
+
+        // Get 2 digits/iteration using ints
+        int q2;
+        int i2 = (int)i;
+        while (i2 <= -100) {
+            q2 = i2 / 100;
+            r  = (q2 * 100) - i2;
+            i2 = q2;
+            putChar(buf, --charPos, Integer.DigitOnes[r]);
+            putChar(buf, --charPos, Integer.DigitTens[r]);
+        }
+
+        // We know there are at most two digits left at this point.
+        q2 = i2 / 10;
+        r  = (q2 * 10) - i2;
+        putChar(buf, --charPos, '0' + r);
+
+        // Whatever left is the remaining digit.
+        if (q2 < 0) {
+            putChar(buf, --charPos, '0' - q2);
+        }
+
+        if (negative) {
+            putChar(buf, --charPos, '-');
+        }
+        return charPos;
+    }
+    // End of trusted methods.
+
+    public static void checkIndex(int off, byte[] val) {
+        String.checkIndex(off, length(val));
+    }
+
+    public static void checkOffset(int off, byte[] val) {
+        String.checkOffset(off, length(val));
+    }
+
+    public static void checkBoundsBeginEnd(int begin, int end, byte[] val) {
+        String.checkBoundsBeginEnd(begin, end, length(val));
+    }
+
+    public static void checkBoundsOffCount(int offset, int count, byte[] val) {
+        String.checkBoundsOffCount(offset, count, length(val));
+    }
+
 }
diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java
index 1577e21..a57c9a7 100644
--- a/jdk/src/java.base/share/classes/java/lang/System.java
+++ b/jdk/src/java.base/share/classes/java/lang/System.java
@@ -35,32 +35,32 @@
 import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
 import java.lang.annotation.Annotation;
+import java.lang.module.ModuleDescriptor;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Executable;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
+import java.net.URI;
 import java.net.URL;
 import java.security.AccessControlContext;
-import java.util.Properties;
-import java.util.PropertyPermission;
-import java.util.Map;
+import java.security.ProtectionDomain;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.nio.channels.Channel;
 import java.nio.channels.spi.SelectorProvider;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Properties;
+import java.util.PropertyPermission;
+import java.util.ResourceBundle;
+import java.util.function.Supplier;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Stream;
 
-import java.util.Objects;
-import java.util.ResourceBundle;
-import java.util.function.Supplier;
-import sun.nio.ch.Interruptible;
+import jdk.internal.module.ModuleBootstrap;
+import jdk.internal.module.ServicesCatalog;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
-import sun.security.util.SecurityConstants;
-import sun.reflect.annotation.AnnotationType;
 import jdk.internal.HotSpotIntrinsicCandidate;
 import jdk.internal.misc.JavaLangAccess;;
 import jdk.internal.misc.SharedSecrets;;
@@ -68,8 +68,9 @@
 import jdk.internal.logger.LoggerFinderLoader;
 import jdk.internal.logger.LazyLoggers;
 import jdk.internal.logger.LocalizedLoggerWrapper;
-
-import jdk.internal.module.ModuleBootstrap;
+import sun.reflect.annotation.AnnotationType;
+import sun.nio.ch.Interruptible;
+import sun.security.util.SecurityConstants;
 
 /**
  * The <code>System</code> class contains several useful class fields
@@ -1159,7 +1160,7 @@
          * @param msg the string message (or a key in the message catalog, if
          * this logger is a {@link
          * LoggerFinder#getLocalizedLogger(java.lang.String,
-         * java.util.ResourceBundle, java.lang.reflect.Module) localized logger});
+         * java.util.ResourceBundle, java.lang.Module) localized logger});
          * can be {@code null}.
          *
          * @throws NullPointerException if {@code level} is {@code null}.
@@ -1227,7 +1228,7 @@
          * @param msg the string message (or a key in the message catalog, if
          * this logger is a {@link
          * LoggerFinder#getLocalizedLogger(java.lang.String,
-         * java.util.ResourceBundle, java.lang.reflect.Module) localized logger});
+         * java.util.ResourceBundle, java.lang.Module) localized logger});
          * can be {@code null}.
          * @param thrown a {@code Throwable} associated with the log message;
          *        can be {@code null}.
@@ -1276,7 +1277,7 @@
          * java.text.MessageFormat} format, (or a key in the message
          * catalog, if this logger is a {@link
          * LoggerFinder#getLocalizedLogger(java.lang.String,
-         * java.util.ResourceBundle, java.lang.reflect.Module) localized logger});
+         * java.util.ResourceBundle, java.lang.Module) localized logger});
          * can be {@code null}.
          * @param params an optional list of parameters to the message (may be
          * none).
@@ -1481,7 +1482,7 @@
          * message localization.
          *
          * @implSpec By default, this method calls {@link
-         * #getLogger(java.lang.String, java.lang.reflect.Module)
+         * #getLogger(java.lang.String, java.lang.Module)
          * this.getLogger(name, module)} to obtain a logger, then wraps that
          * logger in a {@link Logger} instance where all methods that do not
          * take a {@link ResourceBundle} as parameter are redirected to one
@@ -1565,12 +1566,20 @@
      * @implSpec
      * Instances returned by this method route messages to loggers
      * obtained by calling {@link LoggerFinder#getLogger(java.lang.String,
-     * java.lang.reflect.Module) LoggerFinder.getLogger(name, module)}, where
+     * java.lang.Module) LoggerFinder.getLogger(name, module)}, where
      * {@code module} is the caller's module.
+     * In cases where {@code System.getLogger} is called from a context where
+     * there is no caller frame on the stack (e.g when called directly
+     * from a JNI attached thread), {@code IllegalCallerException} is thrown.
+     * To obtain a logger in such a context, use an auxiliary class that will
+     * implicitly be identified as the caller, or use the system {@link
+     * LoggerFinder#getLoggerFinder() LoggerFinder} to obtain a logger instead.
+     * Note that doing the latter may eagerly initialize the underlying
+     * logging system.
      *
      * @apiNote
      * This method may defer calling the {@link
-     * LoggerFinder#getLogger(java.lang.String, java.lang.reflect.Module)
+     * LoggerFinder#getLogger(java.lang.String, java.lang.Module)
      * LoggerFinder.getLogger} method to create an actual logger supplied by
      * the logging backend, for instance, to allow loggers to be obtained during
      * the system initialization time.
@@ -1579,6 +1588,8 @@
      * @return an instance of {@link Logger} that can be used by the calling
      *         class.
      * @throws NullPointerException if {@code name} is {@code null}.
+     * @throws IllegalCallerException if there is no Java caller frame on the
+     *         stack.
      *
      * @since 9
      */
@@ -1586,6 +1597,9 @@
     public static Logger getLogger(String name) {
         Objects.requireNonNull(name);
         final Class<?> caller = Reflection.getCallerClass();
+        if (caller == null) {
+            throw new IllegalCallerException("no caller frame");
+        }
         return LazyLoggers.getLogger(name, caller.getModule());
     }
 
@@ -1598,9 +1612,17 @@
      * @implSpec
      * The returned logger will perform message localization as specified
      * by {@link LoggerFinder#getLocalizedLogger(java.lang.String,
-     * java.util.ResourceBundle, java.lang.reflect.Module)
-     * LoggerFinder.getLocalizedLogger(name, bundle, module}, where
+     * java.util.ResourceBundle, java.lang.Module)
+     * LoggerFinder.getLocalizedLogger(name, bundle, module)}, where
      * {@code module} is the caller's module.
+     * In cases where {@code System.getLogger} is called from a context where
+     * there is no caller frame on the stack (e.g when called directly
+     * from a JNI attached thread), {@code IllegalCallerException} is thrown.
+     * To obtain a logger in such a context, use an auxiliary class that
+     * will implicitly be identified as the caller, or use the system {@link
+     * LoggerFinder#getLoggerFinder() LoggerFinder} to obtain a logger instead.
+     * Note that doing the latter may eagerly initialize the underlying
+     * logging system.
      *
      * @apiNote
      * This method is intended to be used after the system is fully initialized.
@@ -1619,6 +1641,8 @@
      * resource bundle for message localization.
      * @throws NullPointerException if {@code name} is {@code null} or
      *         {@code bundle} is {@code null}.
+     * @throws IllegalCallerException if there is no Java caller frame on the
+     *         stack.
      *
      * @since 9
      */
@@ -1627,6 +1651,9 @@
         final ResourceBundle rb = Objects.requireNonNull(bundle);
         Objects.requireNonNull(name);
         final Class<?> caller = Reflection.getCallerClass();
+        if (caller == null) {
+            throw new IllegalCallerException("no caller frame");
+        }
         final SecurityManager sm = System.getSecurityManager();
         // We don't use LazyLoggers if a resource bundle is specified.
         // Bootstrap sensitive classes in the JDK do not use resource bundles
@@ -1737,6 +1764,7 @@
      * @since   1.1
      */
     @Deprecated(since="1.2", forRemoval=true)
+    @SuppressWarnings("removal")
     public static void runFinalizersOnExit(boolean value) {
         Runtime.runFinalizersOnExit(value);
     }
@@ -1845,6 +1873,39 @@
     }
 
     /**
+     * Logs an exception/error at initialization time to stdout or stderr.
+     *
+     * @param printToStderr to print to stderr rather than stdout
+     * @param printStackTrace to print the stack trace
+     * @param msg the message to print before the exception, can be {@code null}
+     * @param e the exception or error
+     */
+    private static void logInitException(boolean printToStderr,
+                                         boolean printStackTrace,
+                                         String msg,
+                                         Throwable e) {
+        if (VM.initLevel() < 1) {
+            throw new InternalError("system classes not initialized");
+        }
+        PrintStream log = (printToStderr) ? err : out;
+        if (msg != null) {
+            log.println(msg);
+        }
+        if (printStackTrace) {
+            e.printStackTrace(log);
+        } else {
+            log.println(e);
+            for (Throwable suppressed : e.getSuppressed()) {
+                log.println("Suppressed: " + suppressed);
+            }
+            Throwable cause = e.getCause();
+            if (cause != null) {
+                log.println("Caused by: " + cause);
+            }
+        }
+    }
+
+    /**
      * Initialize the system class.  Called after thread initialization.
      */
     private static void initPhase1() {
@@ -1917,18 +1978,30 @@
     }
 
     // @see #initPhase2()
-    private static Layer bootLayer;
+    static ModuleLayer bootLayer;
 
     /*
      * Invoked by VM.  Phase 2 module system initialization.
      * Only classes in java.base can be loaded in this phase.
+     *
+     * @param printToStderr print exceptions to stderr rather than stdout
+     * @param printStackTrace print stack trace when exception occurs
+     *
+     * @return JNI_OK for success, JNI_ERR for failure
      */
-    private static void initPhase2() {
-        // initialize the module system
-        System.bootLayer = ModuleBootstrap.boot();
+    private static int initPhase2(boolean printToStderr, boolean printStackTrace) {
+        try {
+            bootLayer = ModuleBootstrap.boot();
+        } catch (Exception | Error e) {
+            logInitException(printToStderr, printStackTrace,
+                             "Error occurred during initialization of boot layer", e);
+            return -1; // JNI_ERR
+        }
 
         // module system initialized
         VM.initLevel(2);
+
+        return 0; // JNI_OK
     }
 
     /*
@@ -1942,10 +2015,6 @@
      * the application classpath or modulepath.
      */
     private static void initPhase3() {
-        // Initialize publicLookup early, to avoid bootstrapping circularities
-        // with security manager using java.lang.invoke infrastructure.
-        java.lang.invoke.MethodHandles.publicLookup();
-
         // set security manager
         String cn = System.getProperty("java.security.manager");
         if (cn != null) {
@@ -2029,15 +2098,16 @@
             public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) {
                 return new Thread(target, acc);
             }
+            @SuppressWarnings("deprecation")
             public void invokeFinalize(Object o) throws Throwable {
                 o.finalize();
             }
-            public Layer getBootLayer() {
-                return bootLayer;
-            }
             public ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl) {
                 return cl.createOrGetClassLoaderValueMap();
             }
+            public Class<?> defineClass(ClassLoader loader, String name, byte[] b, ProtectionDomain pd, String source) {
+                return ClassLoader.defineClass1(loader, name, b, 0, b.length, pd, source);
+            }
             public Class<?> findBootstrapClassOrNull(ClassLoader cl, String name) {
                 return cl.findBootstrapClassOrNull(name);
             }
@@ -2053,6 +2123,47 @@
             public String fastUUID(long lsb, long msb) {
                 return Long.fastUUID(lsb, msb);
             }
+            public void invalidatePackageAccessCache() {
+                SecurityManager.invalidatePackageAccessCache();
+            }
+            public Module defineModule(ClassLoader loader,
+                                       ModuleDescriptor descriptor,
+                                       URI uri) {
+                return new Module(null, loader, descriptor, uri);
+            }
+            public Module defineUnnamedModule(ClassLoader loader) {
+                return new Module(loader);
+            }
+            public void addReads(Module m1, Module m2) {
+                m1.implAddReads(m2);
+            }
+            public void addReadsAllUnnamed(Module m) {
+                m.implAddReadsAllUnnamed();
+            }
+            public void addExports(Module m, String pn, Module other) {
+                m.implAddExports(pn, other);
+            }
+            public void addExportsToAllUnnamed(Module m, String pn) {
+                m.implAddExportsToAllUnnamed(pn);
+            }
+            public void addOpens(Module m, String pn, Module other) {
+                m.implAddOpens(pn, other);
+            }
+            public void addOpensToAllUnnamed(Module m, String pn) {
+                m.implAddOpensToAllUnnamed(pn);
+            }
+            public void addUses(Module m, Class<?> service) {
+                m.implAddUses(service);
+            }
+            public ServicesCatalog getServicesCatalog(ModuleLayer layer) {
+                return layer.getServicesCatalog();
+            }
+            public Stream<ModuleLayer> layers(ModuleLayer layer) {
+                return layer.layers();
+            }
+            public Stream<ModuleLayer> layers(ClassLoader loader) {
+                return ModuleLayer.layers(loader);
+            }
         });
     }
 }
diff --git a/jdk/src/java.base/share/classes/java/lang/Thread.java b/jdk/src/java.base/share/classes/java/lang/Thread.java
index a7fc391..8ecc90d 100644
--- a/jdk/src/java.base/share/classes/java/lang/Thread.java
+++ b/jdk/src/java.base/share/classes/java/lang/Thread.java
@@ -927,7 +927,7 @@
      *       for example), the <code>interrupt</code> method should be used to
      *       interrupt the wait.
      *       For more information, see
-     *       <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
+     *       <a href="{@docRoot}/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
      *       are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      */
     @Deprecated(since="1.2")
@@ -960,7 +960,7 @@
      *        could be used to generate exceptions that the target thread was
      *        not prepared to handle.
      *        For more information, see
-     *        <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
+     *        <a href="{@docRoot}/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
      *        are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      *        This method is subject to removal in a future version of Java SE.
      */
@@ -1082,7 +1082,7 @@
      *     If another thread ever attempted to lock this resource, deadlock
      *     would result. Such deadlocks typically manifest themselves as
      *     "frozen" processes. For more information, see
-     *     <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">
+     *     <a href="{@docRoot}/java/lang/doc-files/threadPrimitiveDeprecation.html">
      *     Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      *     This method is subject to removal in a future version of Java SE.
      * @throws NoSuchMethodError always
@@ -1122,7 +1122,7 @@
      *   monitor prior to calling <code>resume</code>, deadlock results.  Such
      *   deadlocks typically manifest themselves as "frozen" processes.
      *   For more information, see
-     *   <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
+     *   <a href="{@docRoot}/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
      *   are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      */
     @Deprecated(since="1.2")
@@ -1148,7 +1148,7 @@
      * @deprecated This method exists solely for use with {@link #suspend},
      *     which has been deprecated because it is deadlock-prone.
      *     For more information, see
-     *     <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">Why
+     *     <a href="{@docRoot}/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
      *     are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
      */
     @Deprecated(since="1.2")
diff --git a/jdk/src/java.base/share/classes/java/lang/WeakPairMap.java b/jdk/src/java.base/share/classes/java/lang/WeakPairMap.java
new file mode 100644
index 0000000..1e4e127
--- /dev/null
+++ b/jdk/src/java.base/share/classes/java/lang/WeakPairMap.java
@@ -0,0 +1,354 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.lang;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
+import java.util.Collection;
+import java.util.Objects;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.BiFunction;
+
+/**
+ * A WeakHashMap-like data structure that uses a pair of weakly-referenced keys
+ * with identity equality semantics to associate a strongly-referenced value.
+ * Unlike WeakHashMap, this data structure is thread-safe.
+ *
+ * @param <K1> the type of 1st key in key pair
+ * @param <K2> the type of 2nd key in key pair
+ * @param <V>  the type of value
+ * @author Peter Levart
+ */
+final class WeakPairMap<K1, K2, V> {
+
+    private final ConcurrentHashMap<Pair<K1, K2>, V> map = new ConcurrentHashMap<>();
+    private final ReferenceQueue<Object> queue = new ReferenceQueue<>();
+
+    /**
+     * Tests if the specified pair of keys are associated with a value
+     * in the WeakPairMap.
+     *
+     * @param k1 the 1st of the pair of keys
+     * @param k2 the 2nd of the pair of keys
+     * @return true if and only if the specified key pair is in this WeakPairMap,
+     * as determined by the identity comparison; false otherwise
+     * @throws NullPointerException if any of the specified keys is null
+     */
+    public boolean containsKeyPair(K1 k1, K2 k2) {
+        expungeStaleAssociations();
+        return map.containsKey(Pair.lookup(k1, k2));
+    }
+
+    /**
+     * Returns the value to which the specified pair of keys is mapped, or null
+     * if this WeakPairMap contains no mapping for the key pair.
+     * <p>More formally, if this WeakPairMap contains a mapping from a key pair
+     * {@code (_k1, _k2)} to a value {@code v} such that
+     * {@code k1 == _k1 && k2 == _k2}, then this method returns {@code v};
+     * otherwise it returns {@code null}.
+     * (There can be at most one such mapping.)
+     *
+     * @param k1 the 1st of the pair of keys for which the mapped value is to
+     *           be returned
+     * @param k2 the 2nd of the pair of keys for which the mapped value is to
+     *           be returned
+     * @return the value to which the specified key pair is mapped, or null if
+     * this map contains no mapping for the key pair
+     * @throws NullPointerException if any of the specified keys is null
+     */
+    public V get(K1 k1, K2 k2) {
+        expungeStaleAssociations();
+        return map.get(Pair.lookup(k1, k2));
+    }
+
+    /**
+     * Maps the specified key pair to the specified value in this WeakPairMap.
+     * Neither the keys nor the value can be null.
+     * <p>The value can be retrieved by calling the {@link #get} method
+     * with the the same keys (compared by identity).
+     *
+     * @param k1 the 1st of the pair of keys with which the specified value is to
+     *           be associated
+     * @param k2 the 2nd of the pair of keys with which the specified value is to
+     *           be associated
+     * @param v  value to be associated with the specified key pair
+     * @return the previous value associated with key pair, or {@code null} if
+     * there was no mapping for key pair
+     * @throws NullPointerException if any of the specified keys or value is null
+     */
+    public V put(K1 k1, K2 k2, V v) {
+        expungeStaleAssociations();
+        return map.put(Pair.weak(k1, k2, queue), v);
+    }
+
+    /**
+     * If the specified key pair is not already associated with a value,
+     * associates it with the given value and returns {@code null}, else does
+     * nothing and returns the currently associated value.
+     *
+     * @param k1 the 1st of the pair of keys with which the specified value is to
+     *           be associated
+     * @param k2 the 2nd of the pair of keys with which the specified value is to
+     *           be associated
+     * @param v  value to be associated with the specified key pair
+     * @return the previous value associated with key pair, or {@code null} if
+     * there was no mapping for key pair
+     * @throws NullPointerException if any of the specified keys or value is null
+     */
+    public V putIfAbsent(K1 k1, K2 k2, V v) {
+        expungeStaleAssociations();
+        return map.putIfAbsent(Pair.weak(k1, k2, queue), v);
+    }
+
+    /**
+     * If the specified key pair is not already associated with a value,
+     * attempts to compute its value using the given mapping function
+     * and enters it into this WeakPairMap unless {@code null}. The entire
+     * method invocation is performed atomically, so the function is
+     * applied at most once per key pair. Some attempted update operations
+     * on this WeakPairMap by other threads may be blocked while computation
+     * is in progress, so the computation should be short and simple,
+     * and must not attempt to update any other mappings of this WeakPairMap.
+     *
+     * @param k1              the 1st of the pair of keys with which the
+     *                        computed value is to be associated
+     * @param k2              the 2nd of the pair of keys with which the
+     *                        computed value is to be associated
+     * @param mappingFunction the function to compute a value
+     * @return the current (existing or computed) value associated with
+     * the specified key pair, or null if the computed value is null
+     * @throws NullPointerException  if any of the specified keys or
+     *                               mappingFunction is null
+     * @throws IllegalStateException if the computation detectably
+     *                               attempts a recursive update to this map
+     *                               that would otherwise never complete
+     * @throws RuntimeException      or Error if the mappingFunction does so, in
+     *                               which case the mapping is left unestablished
+     */
+    public V computeIfAbsent(K1 k1, K2 k2,
+                             BiFunction<? super K1, ? super K2, ? extends V>
+                                 mappingFunction) {
+        expungeStaleAssociations();
+        try {
+            return map.computeIfAbsent(
+                Pair.weak(k1, k2, queue),
+                pair -> mappingFunction.apply(pair.first(), pair.second()));
+        } finally {
+            Reference.reachabilityFence(k1);
+            Reference.reachabilityFence(k2);
+        }
+    }
+
+    /**
+     * Returns a {@link Collection} view of the values contained in this
+     * WeakPairMap. The collection is backed by the WeakPairMap, so changes to
+     * the map are reflected in the collection, and vice-versa.  The collection
+     * supports element removal, which removes the corresponding
+     * mapping from this map, via the {@code Iterator.remove},
+     * {@code Collection.remove}, {@code removeAll},
+     * {@code retainAll}, and {@code clear} operations.  It does not
+     * support the {@code add} or {@code addAll} operations.
+     *
+     * @return the collection view
+     */
+    public Collection<V> values() {
+        expungeStaleAssociations();
+        return map.values();
+    }
+
+    /**
+     * Removes associations from this WeakPairMap for which at least one of the
+     * keys in key pair has been found weakly-reachable and corresponding
+     * WeakRefPeer(s) enqueued. Called as part of each public operation.
+     */
+    private void expungeStaleAssociations() {
+        WeakRefPeer<?> peer;
+        while ((peer = (WeakRefPeer<?>) queue.poll()) != null) {
+            map.remove(peer.weakPair());
+        }
+    }
+
+    /**
+     * Common interface of both {@link Weak} and {@link Lookup} key pairs.
+     */
+    private interface Pair<K1, K2> {
+
+        static <K1, K2> Pair<K1, K2> weak(K1 k1, K2 k2,
+                                          ReferenceQueue<Object> queue) {
+            return new Weak<>(k1, k2, queue);
+        }
+
+        static <K1, K2> Pair<K1, K2> lookup(K1 k1, K2 k2) {
+            return new Lookup<>(k1, k2);
+        }
+
+        /**
+         * @return The 1st of the pair of keys (may be null for {@link Weak}
+         * when it gets cleared)
+         */
+        K1 first();
+
+        /**
+         * @return The 2nd of the pair of keys (may be null for {@link Weak}
+         * when it gets cleared)
+         */
+        K2 second();
+
+        static int hashCode(Object first, Object second) {
+            // assert first != null && second != null;
+            return System.identityHashCode(first) ^
+                   System.identityHashCode(second);
+        }
+
+        static boolean equals(Object first, Object second, Pair<?, ?> p) {
+            return first != null && second != null &&
+                   first == p.first() && second == p.second();
+        }
+
+        /**
+         * A Pair where both keys are weakly-referenced.
+         * It is composed of two instances of {@link WeakRefPeer}s:
+         * <pre>{@code
+         *
+         *     +-referent-> [K1]                +-referent-> [K2]
+         *     |                                |
+         *   +----------------+               +----------------+
+         *   | Pair.Weak <:   |-----peer----->| (anonymous) <: |
+         *   | WeakRefPeer,   |               | WeakRefPeer    |
+         *   | Pair           |<--weakPair()--|                |
+         *   +----------------+               +----------------+
+         *     |            ^
+         *     |            |
+         *     +-weakPair()-+
+         *
+         * }</pre>
+         * <p>
+         * Pair.Weak is used for CHM keys. Both peers are associated with the
+         * same {@link ReferenceQueue} so when either of their referents
+         * becomes weakly-reachable, the corresponding entries can be
+         * {@link #expungeStaleAssociations() expunged} from the map.
+         */
+        final class Weak<K1, K2> extends WeakRefPeer<K1> implements Pair<K1, K2> {
+
+            // saved hash so it can be retrieved after the reference is cleared
+            private final int hash;
+            // link to <K2> peer
+            private final WeakRefPeer<K2> peer;
+
+            Weak(K1 k1, K2 k2, ReferenceQueue<Object> queue) {
+                super(k1, queue);
+                hash = Pair.hashCode(k1, k2);
+                peer = new WeakRefPeer<>(k2, queue) {
+                    // link back to <K1> peer
+                    @Override
+                    Weak<?, ?> weakPair() { return Weak.this; }
+                };
+            }
+
+            @Override
+            Weak<?, ?> weakPair() {
+                return this;
+            }
+
+            @Override
+            public K1 first() {
+                return get();
+            }
+
+            @Override
+            public K2 second() {
+                return peer.get();
+            }
+
+            @Override
+            public int hashCode() {
+                return hash;
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                return this == obj ||
+                       (obj instanceof Pair &&
+                        Pair.equals(first(), second(), (Pair<?, ?>) obj));
+            }
+        }
+
+        /**
+         * Optimized lookup Pair, used as lookup key in methods like
+         * {@link java.util.Map#get(Object)} or
+         * {@link java.util.Map#containsKey(Object)}) where
+         * there is a great chance its allocation is eliminated
+         * by escape analysis when such lookups are inlined by JIT.
+         * All its methods are purposely designed so that 'this' is never
+         * passed to any other method or used as identity.
+         */
+        final class Lookup<K1, K2> implements Pair<K1, K2> {
+            private final K1 k1;
+            private final K2 k2;
+
+            Lookup(K1 k1, K2 k2) {
+                this.k1 = Objects.requireNonNull(k1);
+                this.k2 = Objects.requireNonNull(k2);
+            }
+
+            @Override
+            public K1 first() {
+                return k1;
+            }
+
+            @Override
+            public K2 second() {
+                return k2;
+            }
+
+            @Override
+            public int hashCode() {
+                return Pair.hashCode(k1, k2);
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                return obj instanceof Pair &&
+                       Pair.equals(k1, k2, (Pair<?, ?>) obj);
+            }
+        }
+    }
+
+    /**
+     * Common abstract supertype of a pair of WeakReference peers.
+     */
+    private static abstract class WeakRefPeer<K> extends WeakReference<K> {
+
+        WeakRefPeer(K k, ReferenceQueue<Object> queue) {
+            super(Objects.requireNonNull(k), queue);
+        }
+
+        /**
+         * @return the {@link Pair.Weak} side of the pair of peers.
+         */
+        abstract Pair.Weak<?, ?> weakPair();
+    }
+}
diff --git a/jdk/src/java.base/share/classes/java/lang/annotation/ElementType.java b/jdk/src/java.base/share/classes/java/lang/annotation/ElementType.java
index 14780fe..bbab9cd 100644
--- a/jdk/src/java.base/share/classes/java/lang/annotation/ElementType.java
+++ b/jdk/src/java.base/share/classes/java/lang/annotation/ElementType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 /**
  * The constants of this enumerated type provide a simple classification of the
  * syntactic locations where annotations may appear in a Java program. These
- * constants are used in {@link Target java.lang.annotation.Target}
+ * constants are used in {@link java.lang.annotation.Target Target}
  * meta-annotations to specify where it is legal to write annotations of a
  * given type.
  *
diff --git a/jdk/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html b/jdk/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html
new file mode 100644
index 0000000..aa6ba49
--- /dev/null
+++ b/jdk/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html
@@ -0,0 +1,364 @@
+<!--
+ Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Oracle designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Oracle in the LICENSE file that accompanied this code.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ or visit www.oracle.com if you need additional information or have any
+ questions.
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+  <title>Java Thread Primitive Deprecation</title>
+  <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
+</head>
+<body>
+<h2>Java Thread Primitive Deprecation</h2>
+<hr size="3" noshade="noshade" />
+<h3>Why is <code>Thread.stop</code> deprecated?</h3>
+<p>Because it is inherently unsafe. Stopping a thread causes it to
+unlock all the monitors that it has locked. (The monitors are
+unlocked as the <code>ThreadDeath</code> exception propagates up
+the stack.) If any of the objects previously protected by these
+monitors were in an inconsistent state, other threads may now view
+these objects in an inconsistent state. Such objects are said to be
+<i>damaged</i>. When threads operate on damaged objects, arbitrary
+behavior can result. This behavior may be subtle and difficult to
+detect, or it may be pronounced. Unlike other unchecked exceptions,
+<code>ThreadDeath</code> kills threads silently; thus, the user has
+no warning that his program may be corrupted. The corruption can
+manifest itself at any time after the actual damage occurs, even
+hours or days in the future.</p>
+<hr />
+<h3>Couldn't I just catch the <code>ThreadDeath</code> exception
+and fix the damaged object?</h3>
+<p>In theory, perhaps, but it would <em>vastly</em> complicate the
+task of writing correct multithreaded code. The task would be
+nearly insurmountable for two reasons:</p>
+<ol>
+<li>A thread can throw a <code>ThreadDeath</code> exception
+<i>almost anywhere</i>. All synchronized methods and blocks would
+have to be studied in great detail, with this in mind.</li>
+<li>A thread can throw a second <code>ThreadDeath</code> exception
+while cleaning up from the first (in the <code>catch</code> or
+<code>finally</code> clause). Cleanup would have to be repeated till
+it succeeded. The code to ensure this would be quite complex.</li>
+</ol>
+In sum, it just isn't practical.
+<hr />
+<h3>What about <code>Thread.stop(Throwable)</code>?</h3>
+<p>In addition to all of the problems noted above, this method may
+be used to generate exceptions that its target thread is unprepared
+to handle (including checked exceptions that the thread could not
+possibly throw, were it not for this method). For example, the
+following method is behaviorally identical to Java's
+<code>throw</code> operation, but circumvents the compiler's
+attempts to guarantee that the calling method has declared all of
+the checked exceptions that it may throw:</p>
+<pre>
+    static void sneakyThrow(Throwable t) {
+        Thread.currentThread().stop(t);
+    }
+</pre>
+<hr />
+<h3>What should I use instead of <code>Thread.stop</code>?</h3>
+<p>Most uses of <code>stop</code> should be replaced by code that
+simply modifies some variable to indicate that the target thread
+should stop running. The target thread should check this variable
+regularly, and return from its run method in an orderly fashion if
+the variable indicates that it is to stop running. To ensure prompt
+communication of the stop-request, the variable must be
+<tt>volatile</tt> (or access to the variable must be
+synchronized).</p>
+<p>For example, suppose your applet contains the following
+<code>start</code>, <code>stop</code> and <code>run</code>
+methods:</p>
+<pre>
+    private Thread blinker;
+
+    public void start() {
+        blinker = new Thread(this);
+        blinker.start();
+    }
+
+    public void stop() {
+        blinker.stop();  // UNSAFE!
+    }
+
+    public void run() {
+        while (true) {
+            try {
+                Thread.sleep(interval);
+            } catch (InterruptedException e){
+            }
+            repaint();
+        }
+    }
+</pre>
+You can avoid the use of <code>Thread.stop</code> by replacing the
+applet's <code>stop</code> and <code>run</code> methods with:
+<pre>
+    private volatile Thread blinker;
+
+    public void stop() {
+        blinker = null;
+    }
+
+    public void run() {
+        Thread thisThread = Thread.currentThread();
+        while (blinker == thisThread) {
+            try {
+                Thread.sleep(interval);
+            } catch (InterruptedException e){
+            }
+            repaint();
+        }
+    }
+</pre>
+<hr />
+<h3>How do I stop a thread that waits for long periods (e.g., for
+input)?</h3>
+<p>That's what the <code>Thread.interrupt</code> method is for. The
+same "state based" signaling mechanism shown above can be used, but
+the state change (<code>blinker = null</code>, in the previous
+example) can be followed by a call to
+<code>Thread.interrupt</code>, to interrupt the wait:</p>
+<pre>
+    public void stop() {
+        Thread moribund = waiter;
+        waiter = null;
+        moribund.interrupt();
+    }
+</pre>
+For this technique to work, it's critical that any method that
+catches an interrupt exception and is not prepared to deal with it
+immediately reasserts the exception. We say <em>reasserts</em>
+rather than <em>rethrows</em>, because it is not always possible to
+rethrow the exception. If the method that catches the
+<code>InterruptedException</code> is not declared to throw this
+(checked) exception, then it should "reinterrupt itself" with the
+following incantation:
+<pre>
+    Thread.currentThread().interrupt();
+</pre>
+This ensures that the Thread will reraise the
+<code>InterruptedException</code> as soon as it is able.
+<hr />
+<h3>What if a thread doesn't respond to
+<code>Thread.interrupt</code>?</h3>
+<p>In some cases, you can use application specific tricks. For
+example, if a thread is waiting on a known socket, you can close
+the socket to cause the thread to return immediately.
+Unfortunately, there really isn't any technique that works in
+general. <em>It should be noted that in all situations where a
+waiting thread doesn't respond to <code>Thread.interrupt</code>, it
+wouldn't respond to <code>Thread.stop</code> either.</em> Such
+cases include deliberate denial-of-service attacks, and I/O
+operations for which thread.stop and thread.interrupt do not work
+properly.</p>
+<hr />
+<h3>Why are <code>Thread.suspend</code> and
+<code>Thread.resume</code> deprecated?</h3>
+<p><code>Thread.suspend</code> is inherently deadlock-prone. If the
+target thread holds a lock on the monitor protecting a critical
+system resource when it is suspended, no thread can access this
+resource until the target thread is resumed. If the thread that
+would resume the target thread attempts to lock this monitor prior
+to calling <code>resume</code>, deadlock results. Such deadlocks
+typically manifest themselves as "frozen" processes.</p>
+<hr />
+<h3>What should I use instead of <code>Thread.suspend</code> and
+<code>Thread.resume</code>?</h3>
+<p>As with <code>Thread.stop</code>, the prudent approach is to
+have the "target thread" poll a variable indicating the desired
+state of the thread (active or suspended). When the desired state
+is suspended, the thread waits using <code>Object.wait</code>. When
+the thread is resumed, the target thread is notified using
+<code>Object.notify</code>.</p>
+<p>For example, suppose your applet contains the following
+mousePressed event handler, which toggles the state of a thread
+called <code>blinker</code>:</p>
+<pre>
+    private boolean threadSuspended;
+
+    Public void mousePressed(MouseEvent e) {
+        e.consume();
+
+        if (threadSuspended)
+            blinker.resume();
+        else
+            blinker.suspend();  // DEADLOCK-PRONE!
+
+        threadSuspended = !threadSuspended;
+    }
+</pre>
+You can avoid the use of <code>Thread.suspend</code> and
+<code>Thread.resume</code> by replacing the event handler above
+with:
+<pre>
+    public synchronized void mousePressed(MouseEvent e) {
+        e.consume();
+
+        threadSuspended = !threadSuspended;
+
+        if (!threadSuspended)
+            notify();
+    }
+</pre>
+and adding the following code to the "run loop":
+<pre>
+                synchronized(this) {
+                    while (threadSuspended)
+                        wait();
+                }
+</pre>
+The <code>wait</code> method throws the
+<code>InterruptedException</code>, so it must be inside a <code>try
+... catch</code> clause. It's fine to put it in the same clause as
+the <code>sleep</code>. The check should follow (rather than
+precede) the <code>sleep</code> so the window is immediately
+repainted when the thread is "resumed." The resulting
+<code>run</code> method follows:
+<pre>
+    public void run() {
+        while (true) {
+            try {
+                Thread.sleep(interval);
+
+                synchronized(this) {
+                    while (threadSuspended)
+                        wait();
+                }
+            } catch (InterruptedException e){
+            }
+            repaint();
+        }
+    }
+</pre>
+Note that the <code>notify</code> in the <code>mousePressed</code>
+method and the <code>wait</code> in the <code>run</code> method are
+inside <code>synchronized</code> blocks. This is required by the
+language, and ensures that <code>wait</code> and
+<code>notify</code> are properly serialized. In practical terms,
+this eliminates race conditions that could cause the "suspended"
+thread to miss a <code>notify</code> and remain suspended
+indefinitely.
+<p>While the cost of synchronization in Java is decreasing as the
+platform matures, it will never be free. A simple trick can be used
+to remove the synchronization that we've added to each iteration of
+the "run loop." The synchronized block that was added is replaced
+by a slightly more complex piece of code that enters a synchronized
+block only if the thread has actually been suspended:</p>
+<pre>
+                if (threadSuspended) {
+                    synchronized(this) {
+                        while (threadSuspended)
+                            wait();
+                    }
+                }
+</pre>
+<p>In the absence of explicit synchronization,
+<tt>threadSuspended</tt> must be made <tt>volatile</tt> to ensure
+prompt communication of the suspend-request.</p>
+The resulting <code>run</code> method is:
+<pre>
+    private volatile boolean threadSuspended;
+
+    public void run() {
+        while (true) {
+            try {
+                Thread.sleep(interval);
+
+                if (threadSuspended) {
+                    synchronized(this) {
+                        while (threadSuspended)
+                            wait();
+                    }
+                }
+            } catch (InterruptedException e){
+            }
+            repaint();
+        }
+    }
+</pre>
+<hr size="3" noshade="noshade" />
+<h3>Can I combine the two techniques to produce a thread that may
+be safely "stopped" or "suspended"?</h3>
+Yes, it's reasonably straightforward. The one subtlety is that the
+target thread may already be suspended at the time that another
+thread tries to stop it. If the <tt>stop</tt> method merely sets
+the state variable (<tt>blinker</tt>) to null, the target thread
+will remain suspended (waiting on the monitor), rather than exiting
+gracefully as it should. If the applet is restarted, multiple
+threads could end up waiting on the monitor at the same time,
+resulting in erratic behavior.
+<p>To rectify this situation, the <tt>stop</tt> method must ensure
+that the target thread resumes immediately if it is suspended. Once
+the target thread resumes, it must recognize immediately that it
+has been stopped, and exit gracefully. Here's how the resulting
+<tt>run</tt> and <tt>stop</tt> methods look:</p>
+<pre>
+    public void run() {
+        Thread thisThread = Thread.currentThread();
+        while (blinker == thisThread) {
+            try {
+                Thread.sleep(interval);
+
+                synchronized(this) {
+                    while (threadSuspended &amp;&amp; blinker==thisThread)
+                        wait();
+                }
+            } catch (InterruptedException e){
+            }
+            repaint();
+        }
+    }
+
+    public synchronized void stop() {
+        blinker = null;
+        notify();
+    }
+</pre>
+If the <tt>stop</tt> method calls <tt>Thread.interrupt</tt>, as
+described above, it needn't call <tt>notify</tt> as well, but it
+still must be synchronized. This ensures that the target thread
+won't miss an interrupt due to a race condition.
+<hr />
+<h3>What about <code>Thread.destroy</code>?</h3>
+<code>Thread.destroy</code> was never implemented and has been
+deprecated. If it were implemented, it would be deadlock-prone in
+the manner of <code>Thread.suspend</code>. (In fact, it is roughly
+equivalent to <code>Thread.suspend</code> without the possibility
+of a subsequent <code>Thread.resume</code>.)
+<hr />
+<h3>Why is <code>Runtime.runFinalizersOnExit</code>
+deprecated?</h3>
+Because it is inherently unsafe. It may result in finalizers being
+called on live objects while other threads are concurrently
+manipulating those objects, resulting in erratic behavior or
+deadlock. While this problem could be prevented if the class whose
+objects are being finalized were coded to "defend against" this
+call, most programmers do <i>not</i> defend against it. They assume
+that an object is dead at the time that its finalizer is called.
+<p>Further, the call is not "thread-safe" in the sense that it sets
+a VM-global flag. This forces <i>every</i> class with a finalizer
+to defend against the finalization of live objects!</p>
+<p><!-- Body text ends here --></p>
+</body>
+</html>
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java
index 3f91060..a717213 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java
@@ -26,6 +26,7 @@
 
 import sun.invoke.util.Wrapper;
 
+import static java.lang.invoke.MethodHandleInfo.*;
 import static sun.invoke.util.Wrapper.forPrimitiveType;
 import static sun.invoke.util.Wrapper.forWrapperType;
 import static sun.invoke.util.Wrapper.isWrapperType;
@@ -56,11 +57,11 @@
     final String samMethodName;               // Name of the SAM method "foo"
     final MethodType samMethodType;           // Type of the SAM method "(Object)Object"
     final MethodHandle implMethod;            // Raw method handle for the implementation method
+    final MethodType implMethodType;          // Type of the implMethod MethodHandle "(CC,int)String"
     final MethodHandleInfo implInfo;          // Info about the implementation method handle "MethodHandleInfo[5 CC.impl(int)String]"
     final int implKind;                       // Invocation kind for implementation "5"=invokevirtual
     final boolean implIsInstanceMethod;       // Is the implementation an instance method "true"
-    final Class<?> implDefiningClass;         // Type defining the implementation "class CC"
-    final MethodType implMethodType;          // Type of the implementation method "(int)String"
+    final Class<?> implClass;                 // Class for referencing the implementation method "class CC"
     final MethodType instantiatedMethodType;  // Instantiated erased functional interface method type "(Integer)Object"
     final boolean isSerializable;             // Should the returned instance be serializable
     final Class<?>[] markerInterfaces;        // Additional marker interfaces to be implemented
@@ -128,19 +129,51 @@
         this.samMethodType  = samMethodType;
 
         this.implMethod = implMethod;
+        this.implMethodType = implMethod.type();
         this.implInfo = caller.revealDirect(implMethod);
-        this.implKind = implInfo.getReferenceKind();
-        this.implIsInstanceMethod =
-                implKind == MethodHandleInfo.REF_invokeVirtual ||
-                implKind == MethodHandleInfo.REF_invokeSpecial ||
-                implKind == MethodHandleInfo.REF_invokeInterface;
-        this.implDefiningClass = implInfo.getDeclaringClass();
-        this.implMethodType = implInfo.getMethodType();
+        switch (implInfo.getReferenceKind()) {
+            case REF_invokeVirtual:
+            case REF_invokeInterface:
+                this.implClass = implMethodType.parameterType(0);
+                // reference kind reported by implInfo may not match implMethodType's first param
+                // Example: implMethodType is (Cloneable)String, implInfo is for Object.toString
+                this.implKind = implClass.isInterface() ? REF_invokeInterface : REF_invokeVirtual;
+                this.implIsInstanceMethod = true;
+                break;
+            case REF_invokeSpecial:
+                // JDK-8172817: should use referenced class here, but we don't know what it was
+                this.implClass = implInfo.getDeclaringClass();
+                this.implKind = REF_invokeSpecial;
+                this.implIsInstanceMethod = true;
+                break;
+            case REF_invokeStatic:
+            case REF_newInvokeSpecial:
+                // JDK-8172817: should use referenced class here for invokestatic, but we don't know what it was
+                this.implClass = implInfo.getDeclaringClass();
+                this.implKind = implInfo.getReferenceKind();
+                this.implIsInstanceMethod = false;
+                break;
+            default:
+                throw new LambdaConversionException(String.format("Unsupported MethodHandle kind: %s", implInfo));
+        }
+
         this.instantiatedMethodType = instantiatedMethodType;
         this.isSerializable = isSerializable;
         this.markerInterfaces = markerInterfaces;
         this.additionalBridges = additionalBridges;
 
+        if (samMethodName.isEmpty() ||
+                samMethodName.indexOf('.') >= 0 ||
+                samMethodName.indexOf(';') >= 0 ||
+                samMethodName.indexOf('[') >= 0 ||
+                samMethodName.indexOf('/') >= 0 ||
+                samMethodName.indexOf('<') >= 0 ||
+                samMethodName.indexOf('>') >= 0) {
+            throw new LambdaConversionException(String.format(
+                    "Method name '%s' is not legal",
+                    samMethodName));
+        }
+
         if (!samBase.isInterface()) {
             throw new LambdaConversionException(String.format(
                     "Functional interface %s is not an interface",
@@ -171,24 +204,12 @@
      * @throws LambdaConversionException if there are improper conversions
      */
     void validateMetafactoryArgs() throws LambdaConversionException {
-        switch (implKind) {
-            case MethodHandleInfo.REF_invokeInterface:
-            case MethodHandleInfo.REF_invokeVirtual:
-            case MethodHandleInfo.REF_invokeStatic:
-            case MethodHandleInfo.REF_newInvokeSpecial:
-            case MethodHandleInfo.REF_invokeSpecial:
-                break;
-            default:
-                throw new LambdaConversionException(String.format("Unsupported MethodHandle kind: %s", implInfo));
-        }
-
-        // Check arity: optional-receiver + captured + SAM == impl
+        // Check arity: captured + SAM == impl
         final int implArity = implMethodType.parameterCount();
-        final int receiverArity = implIsInstanceMethod ? 1 : 0;
         final int capturedArity = invokedType.parameterCount();
         final int samArity = samMethodType.parameterCount();
         final int instantiatedArity = instantiatedMethodType.parameterCount();
-        if (implArity + receiverArity != capturedArity + samArity) {
+        if (implArity != capturedArity + samArity) {
             throw new LambdaConversionException(
                     String.format("Incorrect number of parameters for %s method %s; %d captured parameters, %d functional interface method parameters, %d implementation parameters",
                                   implIsInstanceMethod ? "instance" : "static", implInfo,
@@ -209,8 +230,8 @@
         }
 
         // If instance: first captured arg (receiver) must be subtype of class where impl method is defined
-        final int capturedStart;
-        final int samStart;
+        final int capturedStart; // index of first non-receiver capture parameter in implMethodType
+        final int samStart; // index of first non-receiver sam parameter in implMethodType
         if (implIsInstanceMethod) {
             final Class<?> receiverClass;
 
@@ -223,45 +244,36 @@
             } else {
                 // receiver is a captured variable
                 capturedStart = 1;
-                samStart = 0;
+                samStart = capturedArity;
                 receiverClass = invokedType.parameterType(0);
             }
 
             // check receiver type
-            if (!implDefiningClass.isAssignableFrom(receiverClass)) {
+            if (!implClass.isAssignableFrom(receiverClass)) {
                 throw new LambdaConversionException(
                         String.format("Invalid receiver type %s; not a subtype of implementation type %s",
-                                      receiverClass, implDefiningClass));
-            }
-
-           Class<?> implReceiverClass = implMethod.type().parameterType(0);
-           if (implReceiverClass != implDefiningClass && !implReceiverClass.isAssignableFrom(receiverClass)) {
-               throw new LambdaConversionException(
-                       String.format("Invalid receiver type %s; not a subtype of implementation receiver type %s",
-                                     receiverClass, implReceiverClass));
+                                      receiverClass, implClass));
             }
         } else {
             // no receiver
             capturedStart = 0;
-            samStart = 0;
+            samStart = capturedArity;
         }
 
         // Check for exact match on non-receiver captured arguments
-        final int implFromCaptured = capturedArity - capturedStart;
-        for (int i=0; i<implFromCaptured; i++) {
+        for (int i=capturedStart; i<capturedArity; i++) {
             Class<?> implParamType = implMethodType.parameterType(i);
-            Class<?> capturedParamType = invokedType.parameterType(i + capturedStart);
+            Class<?> capturedParamType = invokedType.parameterType(i);
             if (!capturedParamType.equals(implParamType)) {
                 throw new LambdaConversionException(
                         String.format("Type mismatch in captured lambda parameter %d: expecting %s, found %s",
                                       i, capturedParamType, implParamType));
             }
         }
-        // Check for adaptation match on SAM arguments
-        final int samOffset = samStart - implFromCaptured;
-        for (int i=implFromCaptured; i<implArity; i++) {
+        // Check for adaptation match on non-receiver SAM arguments
+        for (int i=samStart; i<implArity; i++) {
             Class<?> implParamType = implMethodType.parameterType(i);
-            Class<?> instantiatedParamType = instantiatedMethodType.parameterType(i + samOffset);
+            Class<?> instantiatedParamType = instantiatedMethodType.parameterType(i - capturedArity);
             if (!isAdaptableTo(instantiatedParamType, implParamType, true)) {
                 throw new LambdaConversionException(
                         String.format("Type mismatch for lambda argument %d: %s is not convertible to %s",
@@ -271,29 +283,40 @@
 
         // Adaptation match: return type
         Class<?> expectedType = instantiatedMethodType.returnType();
-        Class<?> actualReturnType =
-                (implKind == MethodHandleInfo.REF_newInvokeSpecial)
-                  ? implDefiningClass
-                  : implMethodType.returnType();
-        Class<?> samReturnType = samMethodType.returnType();
+        Class<?> actualReturnType = implMethodType.returnType();
         if (!isAdaptableToAsReturn(actualReturnType, expectedType)) {
             throw new LambdaConversionException(
                     String.format("Type mismatch for lambda return: %s is not convertible to %s",
                                   actualReturnType, expectedType));
         }
-        if (!isAdaptableToAsReturnStrict(expectedType, samReturnType)) {
-            throw new LambdaConversionException(
-                    String.format("Type mismatch for lambda expected return: %s is not convertible to %s",
-                                  expectedType, samReturnType));
-        }
+
+        // Check descriptors of generated methods
+        checkDescriptor(samMethodType);
         for (MethodType bridgeMT : additionalBridges) {
-            if (!isAdaptableToAsReturnStrict(expectedType, bridgeMT.returnType())) {
-                throw new LambdaConversionException(
-                        String.format("Type mismatch for lambda expected return: %s is not convertible to %s",
-                                      expectedType, bridgeMT.returnType()));
+            checkDescriptor(bridgeMT);
+        }
+    }
+
+    /** Validate that the given descriptor's types are compatible with {@code instantiatedMethodType} **/
+    private void checkDescriptor(MethodType descriptor) throws LambdaConversionException {
+        for (int i = 0; i < instantiatedMethodType.parameterCount(); i++) {
+            Class<?> instantiatedParamType = instantiatedMethodType.parameterType(i);
+            Class<?> descriptorParamType = descriptor.parameterType(i);
+            if (!descriptorParamType.isAssignableFrom(instantiatedParamType)) {
+                String msg = String.format("Type mismatch for instantiated parameter %d: %s is not a subtype of %s",
+                                           i, instantiatedParamType, descriptorParamType);
+                throw new LambdaConversionException(msg);
             }
         }
-     }
+
+        Class<?> instantiatedReturnType = instantiatedMethodType.returnType();
+        Class<?> descriptorReturnType = descriptor.returnType();
+        if (!isAdaptableToAsReturnStrict(instantiatedReturnType, descriptorReturnType)) {
+            String msg = String.format("Type mismatch for lambda expected return: %s is not convertible to %s",
+                                       instantiatedReturnType, descriptorReturnType);
+            throw new LambdaConversionException(msg);
+        }
+    }
 
     /**
      * Check type adaptability for parameter types.
@@ -345,8 +368,8 @@
                || !fromType.equals(void.class) && isAdaptableTo(fromType, toType, false);
     }
     private boolean isAdaptableToAsReturnStrict(Class<?> fromType, Class<?> toType) {
-        if (fromType.equals(void.class)) return toType.equals(void.class);
-        return isAdaptableTo(fromType, toType, true);
+        if (fromType.equals(void.class) || toType.equals(void.class)) return fromType.equals(toType);
+        else return isAdaptableTo(fromType, toType, true);
     }
 
 
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java
index 5389961..031e18a7 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java
@@ -82,6 +82,7 @@
 }
 }</pre></blockquote>
  * @author John Rose, JSR 292 EG
+ * @since 1.7
  */
 abstract
 public class CallSite {
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/ConstantCallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/ConstantCallSite.java
index f27d0e7b..f7d87ba 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/ConstantCallSite.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/ConstantCallSite.java
@@ -30,6 +30,7 @@
  * An {@code invokedynamic} instruction linked to a {@code ConstantCallSite} is permanently
  * bound to the call site's target.
  * @author John Rose, JSR 292 EG
+ * @since 1.7
  */
 public class ConstantCallSite extends CallSite {
     private final boolean isFrozen;
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
index 0c814bd..35f91cc2 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
@@ -96,7 +96,6 @@
     private final String implMethodClassName;        // Name of type containing implementation "CC"
     private final String implMethodName;             // Name of implementation method "impl"
     private final String implMethodDesc;             // Type descriptor for implementation methods "(I)Ljava/lang/String;"
-    private final Class<?> implMethodReturnClass;    // class for implementation method return type "Ljava/lang/String;"
     private final MethodType constructorType;        // Generated class constructor type "(CC)void"
     private final ClassWriter cw;                    // ASM class writer
     private final String[] argNames;                 // Generated names for the constructor arguments
@@ -153,12 +152,9 @@
         super(caller, invokedType, samMethodName, samMethodType,
               implMethod, instantiatedMethodType,
               isSerializable, markerInterfaces, additionalBridges);
-        implMethodClassName = implDefiningClass.getName().replace('.', '/');
+        implMethodClassName = implClass.getName().replace('.', '/');
         implMethodName = implInfo.getName();
-        implMethodDesc = implMethodType.toMethodDescriptorString();
-        implMethodReturnClass = (implKind == MethodHandleInfo.REF_newInvokeSpecial)
-                ? implDefiningClass
-                : implMethodType.returnType();
+        implMethodDesc = implInfo.getMethodType().toMethodDescriptorString();
         constructorType = invokedType.changeReturnType(Void.TYPE);
         lambdaClassName = targetClass.getName().replace('.', '/') + "$$Lambda$" + counter.incrementAndGet();
         cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
@@ -467,13 +463,14 @@
             // Invoke the method we want to forward to
             visitMethodInsn(invocationOpcode(), implMethodClassName,
                             implMethodName, implMethodDesc,
-                            implDefiningClass.isInterface());
+                            implClass.isInterface());
 
             // Convert the return value (if any) and return it
             // Note: if adapting from non-void to void, the 'return'
             // instruction will pop the unneeded result
+            Class<?> implReturnClass = implMethodType.returnType();
             Class<?> samReturnClass = methodType.returnType();
-            convertType(implMethodReturnClass, samReturnClass, samReturnClass);
+            convertType(implReturnClass, samReturnClass, samReturnClass);
             visitInsn(getReturnOpcode(samReturnClass));
             // Maxs computed by ClassWriter.COMPUTE_MAXS,these arguments ignored
             visitMaxs(-1, -1);
@@ -482,23 +479,13 @@
 
         private void convertArgumentTypes(MethodType samType) {
             int lvIndex = 0;
-            boolean samIncludesReceiver = implIsInstanceMethod &&
-                                                   invokedType.parameterCount() == 0;
-            int samReceiverLength = samIncludesReceiver ? 1 : 0;
-            if (samIncludesReceiver) {
-                // push receiver
-                Class<?> rcvrType = samType.parameterType(0);
-                visitVarInsn(getLoadOpcode(rcvrType), lvIndex + 1);
-                lvIndex += getParameterSize(rcvrType);
-                convertType(rcvrType, implDefiningClass, instantiatedMethodType.parameterType(0));
-            }
             int samParametersLength = samType.parameterCount();
-            int argOffset = implMethodType.parameterCount() - samParametersLength;
-            for (int i = samReceiverLength; i < samParametersLength; i++) {
+            int captureArity = invokedType.parameterCount();
+            for (int i = 0; i < samParametersLength; i++) {
                 Class<?> argType = samType.parameterType(i);
                 visitVarInsn(getLoadOpcode(argType), lvIndex + 1);
                 lvIndex += getParameterSize(argType);
-                convertType(argType, implMethodType.parameterType(argOffset + i), instantiatedMethodType.parameterType(i));
+                convertType(argType, implMethodType.parameterType(captureArity + i), instantiatedMethodType.parameterType(i));
             }
         }
 
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaConversionException.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaConversionException.java
index e1123da..2dc8f22 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaConversionException.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaConversionException.java
@@ -27,6 +27,8 @@
 
 /**
  * LambdaConversionException
+ *
+ * @since 1.8
  */
 public class LambdaConversionException extends Exception {
     private static final long serialVersionUID = 292L + 8L;
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java
index b6ef976..b09744c 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java
@@ -211,6 +211,7 @@
  * theory, any method handle could be used. Currently supported are direct method
  * handles representing invocation of virtual, interface, constructor and static
  * methods.
+ * @since 1.8
  */
 public class LambdaMetafactory {
 
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java
index 97efa4f..92ab77c 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java
@@ -33,7 +33,6 @@
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
index 6265b87..3ec8b63 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
@@ -423,6 +423,7 @@
  * @see MethodType
  * @see MethodHandles
  * @author John Rose, JSR 292 EG
+ * @since 1.7
  */
 public abstract class MethodHandle {
 
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
index 09db4f9..fce6e0f 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java
@@ -38,6 +38,8 @@
 /**
  * This class consists exclusively of static methods that help adapt
  * method handles to other JVM types, such as interfaces.
+ *
+ * @since 1.7
  */
 public class MethodHandleProxies {
 
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
index 16a9e8a..afd8d9b 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
@@ -25,8 +25,9 @@
 
 package java.lang.invoke;
 
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.module.IllegalAccessLogger;
+import jdk.internal.org.objectweb.asm.ClassReader;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
 import jdk.internal.vm.annotation.ForceInline;
@@ -42,9 +43,11 @@
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.lang.reflect.ReflectPermission;
 import java.nio.ByteOrder;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.BitSet;
@@ -111,13 +114,17 @@
 
     /**
      * Returns a {@link Lookup lookup object} which is trusted minimally.
-     * It can only be used to create method handles to public members in
+     * The lookup has the {@code PUBLIC} and {@code UNCONDITIONAL} modes.
+     * It can only be used to create method handles to public members of
      * public classes in packages that are exported unconditionally.
      * <p>
-     * For now, the {@linkplain Lookup#lookupClass lookup class} of this lookup
-     * object is in an unnamed module.
-     * Consequently, the lookup context of this lookup object will be the bootstrap
-     * class loader, which means it cannot find user classes.
+     * As a matter of pure convention, the {@linkplain Lookup#lookupClass lookup class}
+     * of this lookup object will be {@link java.lang.Object}.
+     *
+     * @apiNote The use of Object is conventional, and because the lookup modes are
+     * limited, there is no special access provided to the internals of Object, its package
+     * or its module. Consequently, the lookup context of this lookup object will be the
+     * bootstrap class loader, which means it cannot find user classes.
      *
      * <p style="font-size:smaller;">
      * <em>Discussion:</em>
@@ -129,17 +136,12 @@
      * Also, it cannot access
      * <a href="MethodHandles.Lookup.html#callsens">caller sensitive methods</a>.
      * @return a lookup object which is trusted minimally
+     *
+     * @revised 9
+     * @spec JPMS
      */
     public static Lookup publicLookup() {
-        // During VM startup then only classes in the java.base module can be
-        // loaded and linked. This is because java.base exports aren't setup until
-        // the module system is initialized, hence types in the unnamed module
-        // (or any named module) can't link to java/lang/Object.
-        if (!jdk.internal.misc.VM.isModuleSystemInited()) {
-            return new Lookup(Object.class, Lookup.PUBLIC);
-        } else {
-            return LookupHelper.PUBLIC_LOOKUP;
-        }
+        return Lookup.PUBLIC_LOOKUP;
     }
 
     /**
@@ -172,6 +174,7 @@
      * @throws IllegalAccessException if the access check specified above fails
      * @throws SecurityException if denied by the security manager
      * @since 9
+     * @spec JPMS
      * @see Lookup#dropLookupMode
      */
     public static Lookup privateLookupIn(Class<?> targetClass, Lookup lookup) throws IllegalAccessException {
@@ -183,16 +186,22 @@
             throw new IllegalArgumentException(targetClass + " is an array class");
         Module targetModule = targetClass.getModule();
         Module callerModule = lookup.lookupClass().getModule();
-        if (callerModule != targetModule && targetModule.isNamed()) {
-            if (!callerModule.canRead(targetModule))
-                throw new IllegalAccessException(callerModule + " does not read " + targetModule);
+        if (!callerModule.canRead(targetModule))
+            throw new IllegalAccessException(callerModule + " does not read " + targetModule);
+        if (targetModule.isNamed()) {
             String pn = targetClass.getPackageName();
-            assert pn != null && pn.length() > 0 : "unnamed package cannot be in named module";
+            assert pn.length() > 0 : "unnamed package cannot be in named module";
             if (!targetModule.isOpen(pn, callerModule))
                 throw new IllegalAccessException(targetModule + " does not open " + pn + " to " + callerModule);
         }
         if ((lookup.lookupModes() & Lookup.MODULE) == 0)
             throw new IllegalAccessException("lookup does not have MODULE lookup mode");
+        if (!callerModule.isNamed() && targetModule.isNamed()) {
+            IllegalAccessLogger logger = IllegalAccessLogger.illegalAccessLogger();
+            if (logger != null) {
+                logger.logIfOpenedByBackdoor(lookup, targetClass);
+            }
+        }
         return new Lookup(targetClass);
     }
 
@@ -601,6 +610,8 @@
      * so that there can be a secure foundation for lookups.
      * Nearly all other methods in the JSR 292 API rely on lookup
      * objects to check access requests.
+     *
+     * @revised 9
      */
     public static final
     class Lookup {
@@ -647,15 +658,33 @@
          *  lookup class and public types in packages exported by other modules
          *  to the module of the lookup class.
          *  @since 9
+         *  @spec JPMS
          */
         public static final int MODULE = PACKAGE << 1;
 
-        private static final int ALL_MODES = (PUBLIC | PRIVATE | PROTECTED | PACKAGE | MODULE);
+        /** A single-bit mask representing {@code unconditional} access
+         *  which may contribute to the result of {@link #lookupModes lookupModes}.
+         *  The value is {@code 0x20}, which does not correspond meaningfully to
+         *  any particular {@linkplain java.lang.reflect.Modifier modifier bit}.
+         *  A {@code Lookup} with this lookup mode assumes {@linkplain
+         *  java.lang.Module#canRead(java.lang.Module) readability}.
+         *  In conjunction with the {@code PUBLIC} modifier bit, a {@code Lookup}
+         *  with this lookup mode can access all public members of public types
+         *  of all modules where the type is in a package that is {@link
+         *  java.lang.Module#isExported(String) exported unconditionally}.
+         *  @since 9
+         *  @spec JPMS
+         *  @see #publicLookup()
+         */
+        public static final int UNCONDITIONAL = PACKAGE << 2;
+
+        private static final int ALL_MODES = (PUBLIC | PRIVATE | PROTECTED | PACKAGE | MODULE | UNCONDITIONAL);
+        private static final int FULL_POWER_MODES = (ALL_MODES & ~UNCONDITIONAL);
         private static final int TRUSTED   = -1;
 
         private static int fixmods(int mods) {
-            mods &= (ALL_MODES - PACKAGE - MODULE);
-            return (mods != 0) ? mods : (PACKAGE | MODULE);
+            mods &= (ALL_MODES - PACKAGE - MODULE - UNCONDITIONAL);
+            return (mods != 0) ? mods : (PACKAGE | MODULE | UNCONDITIONAL);
         }
 
         /** Tells which class is performing the lookup.  It is this class against
@@ -682,13 +711,14 @@
          *  {@linkplain #PRIVATE PRIVATE (0x02)},
          *  {@linkplain #PROTECTED PROTECTED (0x04)},
          *  {@linkplain #PACKAGE PACKAGE (0x08)},
-         *  and {@linkplain #MODULE MODULE (0x10)}.
+         *  {@linkplain #MODULE MODULE (0x10)},
+         *  and {@linkplain #UNCONDITIONAL UNCONDITIONAL (0x20)}.
          *  <p>
          *  A freshly-created lookup object
-         *  on the {@linkplain java.lang.invoke.MethodHandles#lookup() caller's class}
-         *  has all possible bits set, since the caller class can access all its own members,
-         *  all public types in the caller's module, and all public types in packages exported
-         *  by other modules to the caller's module.
+         *  on the {@linkplain java.lang.invoke.MethodHandles#lookup() caller's class} has
+         *  all possible bits set, except {@code UNCONDITIONAL}. The lookup can be used to
+         *  access all members of the caller's class, all public types in the caller's module,
+         *  and all public types in packages exported by other modules to the caller's module.
          *  A lookup object on a new lookup class
          *  {@linkplain java.lang.invoke.MethodHandles.Lookup#in created from a previous lookup object}
          *  may have some mode bits set to zero.
@@ -701,6 +731,9 @@
          *  @return the lookup modes, which limit the kinds of access performed by this lookup object
          *  @see #in
          *  @see #dropLookupMode
+         *
+         *  @revised 9
+         *  @spec JPMS
          */
         public int lookupModes() {
             return allowedModes & ALL_MODES;
@@ -712,9 +745,9 @@
          * which in turn is called by a method not in this package.
          */
         Lookup(Class<?> lookupClass) {
-            this(lookupClass, ALL_MODES);
+            this(lookupClass, FULL_POWER_MODES);
             // make sure we haven't accidentally picked up a privileged class:
-            checkUnprivilegedlookupClass(lookupClass, ALL_MODES);
+            checkUnprivilegedlookupClass(lookupClass, FULL_POWER_MODES);
         }
 
         private Lookup(Class<?> lookupClass, int allowedModes) {
@@ -730,19 +763,20 @@
          * However, the resulting {@code Lookup} object is guaranteed
          * to have no more access capabilities than the original.
          * In particular, access capabilities can be lost as follows:<ul>
-         * <li>If the lookup class for this {@code Lookup} is not in a named module,
-         * and the new lookup class is in a named module {@code M}, then no members in
-         * {@code M}'s non-exported packages will be accessible.
-         * <li>If the lookup for this {@code Lookup} is in a named module, and the
-         * new lookup class is in a different module {@code M}, then no members, not even
-         * public members in {@code M}'s exported packages, will be accessible.
-         * <li>If the new lookup class differs from the old one,
-         * protected members will not be accessible by virtue of inheritance.
-         * (Protected members may continue to be accessible because of package sharing.)
+         * <li>If the old lookup class is in a {@link Module#isNamed() named} module, and
+         * the new lookup class is in a different module {@code M}, then no members, not
+         * even public members in {@code M}'s exported packages, will be accessible.
+         * The exception to this is when this lookup is {@link #publicLookup()
+         * publicLookup}, in which case {@code PUBLIC} access is not lost.
+         * <li>If the old lookup class is in an unnamed module, and the new lookup class
+         * is a different module then {@link #MODULE MODULE} access is lost.
+         * <li>If the new lookup class differs from the old one then {@code UNCONDITIONAL} is lost.
          * <li>If the new lookup class is in a different package
          * than the old one, protected and default (package) members will not be accessible.
          * <li>If the new lookup class is not within the same package member
-         * as the old one, private members will not be accessible.
+         * as the old one, private members will not be accessible, and protected members
+         * will not be accessible by virtue of inheritance.
+         * (Protected members may continue to be accessible because of package sharing.)
          * <li>If the new lookup class is not accessible to the old lookup class,
          * then no members, not even public members, will be accessible.
          * (In all other cases, public members will continue to be accessible.)
@@ -757,32 +791,34 @@
          * @return a lookup object which reports the desired lookup class, or the same object
          * if there is no change
          * @throws NullPointerException if the argument is null
+         *
+         * @revised 9
+         * @spec JPMS
          */
         public Lookup in(Class<?> requestedLookupClass) {
             Objects.requireNonNull(requestedLookupClass);
             if (allowedModes == TRUSTED)  // IMPL_LOOKUP can make any lookup at all
-                return new Lookup(requestedLookupClass, ALL_MODES);
+                return new Lookup(requestedLookupClass, FULL_POWER_MODES);
             if (requestedLookupClass == this.lookupClass)
                 return this;  // keep same capabilities
-
-            int newModes = (allowedModes & (ALL_MODES & ~PROTECTED));
+            int newModes = (allowedModes & FULL_POWER_MODES);
             if (!VerifyAccess.isSameModule(this.lookupClass, requestedLookupClass)) {
-                // Allowed to teleport from an unnamed to a named module but resulting
-                // Lookup has no access to module private members
-                if (this.lookupClass.getModule().isNamed()) {
+                // Need to drop all access when teleporting from a named module to another
+                // module. The exception is publicLookup where PUBLIC is not lost.
+                if (this.lookupClass.getModule().isNamed()
+                    && (this.allowedModes & UNCONDITIONAL) == 0)
                     newModes = 0;
-                } else {
-                    newModes &= ~MODULE;
-                }
+                else
+                    newModes &= ~(MODULE|PACKAGE|PRIVATE|PROTECTED);
             }
             if ((newModes & PACKAGE) != 0
                 && !VerifyAccess.isSamePackage(this.lookupClass, requestedLookupClass)) {
-                newModes &= ~(PACKAGE|PRIVATE);
+                newModes &= ~(PACKAGE|PRIVATE|PROTECTED);
             }
             // Allow nestmate lookups to be created without special privilege:
             if ((newModes & PRIVATE) != 0
                 && !VerifyAccess.isSamePackageMember(this.lookupClass, requestedLookupClass)) {
-                newModes &= ~PRIVATE;
+                newModes &= ~(PRIVATE|PROTECTED);
             }
             if ((newModes & PUBLIC) != 0
                 && !VerifyAccess.isClassAccessible(requestedLookupClass, this.lookupClass, allowedModes)) {
@@ -801,40 +837,153 @@
          * finds members, but with a lookup mode that has lost the given lookup mode.
          * The lookup mode to drop is one of {@link #PUBLIC PUBLIC}, {@link #MODULE
          * MODULE}, {@link #PACKAGE PACKAGE}, {@link #PROTECTED PROTECTED} or {@link #PRIVATE PRIVATE}.
-         * {@link #PROTECTED PROTECTED} is always dropped and so the resulting lookup
-         * mode will never have this access capability. When dropping {@code PACKAGE}
-         * then the resulting lookup will not have {@code PACKAGE} or {@code PRIVATE}
-         * access. When dropping {@code MODULE} then the resulting lookup will not
-         * have {@code MODULE}, {@code PACKAGE}, or {@code PRIVATE} access. If {@code
-         * PUBLIC} is dropped then the resulting lookup has no access.
+         * {@link #PROTECTED PROTECTED} and {@link #UNCONDITIONAL UNCONDITIONAL} are always
+         * dropped and so the resulting lookup mode will never have these access capabilities.
+         * When dropping {@code PACKAGE} then the resulting lookup will not have {@code PACKAGE}
+         * or {@code PRIVATE} access. When dropping {@code MODULE} then the resulting lookup will
+         * not have {@code MODULE}, {@code PACKAGE}, or {@code PRIVATE} access. If {@code PUBLIC}
+         * is dropped then the resulting lookup has no access.
          * @param modeToDrop the lookup mode to drop
          * @return a lookup object which lacks the indicated mode, or the same object if there is no change
          * @throws IllegalArgumentException if {@code modeToDrop} is not one of {@code PUBLIC},
-         * {@code MODULE}, {@code PACKAGE}, {@code PROTECTED} or {@code PRIVATE}
-         * @since 9
+         * {@code MODULE}, {@code PACKAGE}, {@code PROTECTED}, {@code PRIVATE} or {@code UNCONDITIONAL}
          * @see MethodHandles#privateLookupIn
+         * @since 9
          */
         public Lookup dropLookupMode(int modeToDrop) {
             int oldModes = lookupModes();
-            int newModes = oldModes & ~(modeToDrop | PROTECTED);
+            int newModes = oldModes & ~(modeToDrop | PROTECTED | UNCONDITIONAL);
             switch (modeToDrop) {
                 case PUBLIC: newModes &= ~(ALL_MODES); break;
                 case MODULE: newModes &= ~(PACKAGE | PRIVATE); break;
                 case PACKAGE: newModes &= ~(PRIVATE); break;
                 case PROTECTED:
-                case PRIVATE: break;
+                case PRIVATE:
+                case UNCONDITIONAL: break;
                 default: throw new IllegalArgumentException(modeToDrop + " is not a valid mode to drop");
             }
             if (newModes == oldModes) return this;  // return self if no change
             return new Lookup(lookupClass(), newModes);
         }
 
+        /**
+         * Defines a class to the same class loader and in the same runtime package and
+         * {@linkplain java.security.ProtectionDomain protection domain} as this lookup's
+         * {@linkplain #lookupClass() lookup class}.
+         *
+         * <p> The {@linkplain #lookupModes() lookup modes} for this lookup must include
+         * {@link #PACKAGE PACKAGE} access as default (package) members will be
+         * accessible to the class. The {@code PACKAGE} lookup mode serves to authenticate
+         * that the lookup object was created by a caller in the runtime package (or derived
+         * from a lookup originally created by suitably privileged code to a target class in
+         * the runtime package). The lookup modes cannot include {@link #PRIVATE PRIVATE}
+         * access. A lookup with {@code PRIVATE} access can be downgraded to drop this lookup
+         * mode with the {@linkplain #dropLookupMode(int) dropLookupMode} method. </p>
+         *
+         * <p> The {@code bytes} parameter is the class bytes of a valid class file (as defined
+         * by the <em>The Java Virtual Machine Specification</em>) with a class name in the
+         * same package as the lookup class. </p>
+         *
+         * <p> This method does not run the class initializer. The class initializer may
+         * run at a later time, as detailed in section 12.4 of the <em>The Java Language
+         * Specification</em>. </p>
+         *
+         * <p> If there is a security manager, its {@code checkPermission} method is first called
+         * to check {@code RuntimePermission("defineClass")}. </p>
+         *
+         * @param bytes the class bytes
+         * @return the {@code Class} object for the class
+         * @throws IllegalArgumentException the bytes are for a class in a different package
+         * to the lookup class
+         * @throws IllegalAccessException if this lookup does not have {@code PACKAGE} access
+         * @throws UnsupportedOperationException if the lookup class has {@code PRIVATE} access
+         * @throws LinkageError if the class is malformed ({@code ClassFormatError}), cannot be
+         * verified ({@code VerifyError}), is already defined, or another linkage error occurs
+         * @throws SecurityException if denied by the security manager
+         * @throws NullPointerException if {@code bytes} is {@code null}
+         * @since 9
+         * @spec JPMS
+         * @see Lookup#privateLookupIn
+         * @see Lookup#dropLookupMode
+         * @see ClassLoader#defineClass(String,byte[],int,int,ProtectionDomain)
+         */
+        public Class<?> defineClass(byte[] bytes) throws IllegalAccessException {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null)
+                sm.checkPermission(new RuntimePermission("defineClass"));
+            if (hasPrivateAccess())
+                throw new UnsupportedOperationException("PRIVATE access not supported");
+            if ((lookupModes() & PACKAGE) == 0)
+                throw new IllegalAccessException("Lookup does not have PACKAGE access");
+            assert (lookupModes() & (MODULE|PUBLIC)) != 0;
+
+            // parse class bytes to get class name (in internal form)
+            bytes = bytes.clone();
+            String name;
+            try {
+                ClassReader reader = new ClassReader(bytes);
+                name = reader.getClassName();
+            } catch (RuntimeException e) {
+                // ASM exceptions are poorly specified
+                ClassFormatError cfe = new ClassFormatError();
+                cfe.initCause(e);
+                throw cfe;
+            }
+
+            // get package and class name in binary form
+            String cn, pn;
+            int index = name.lastIndexOf('/');
+            if (index == -1) {
+                cn = name;
+                pn = "";
+            } else {
+                cn = name.replace('/', '.');
+                pn = cn.substring(0, index);
+            }
+            if (!pn.equals(lookupClass.getPackageName())) {
+                throw new IllegalArgumentException("Class not in same package as lookup class");
+            }
+
+            // invoke the class loader's defineClass method
+            ClassLoader loader = lookupClass.getClassLoader();
+            ProtectionDomain pd = (loader != null) ? lookupClassProtectionDomain() : null;
+            String source = "__Lookup_defineClass__";
+            Class<?> clazz = SharedSecrets.getJavaLangAccess().defineClass(loader, cn, bytes, pd, source);
+            assert clazz.getClassLoader() == lookupClass.getClassLoader()
+                    && clazz.getPackageName().equals(lookupClass.getPackageName())
+                    && protectionDomain(clazz) == lookupClassProtectionDomain();
+            return clazz;
+        }
+
+        private ProtectionDomain lookupClassProtectionDomain() {
+            ProtectionDomain pd = cachedProtectionDomain;
+            if (pd == null) {
+                cachedProtectionDomain = pd = protectionDomain(lookupClass);
+            }
+            return pd;
+        }
+
+        private ProtectionDomain protectionDomain(Class<?> clazz) {
+            PrivilegedAction<ProtectionDomain> pa = clazz::getProtectionDomain;
+            return AccessController.doPrivileged(pa);
+        }
+
+        // cached protection domain
+        private volatile ProtectionDomain cachedProtectionDomain;
+
+
         // Make sure outer class is initialized first.
         static { IMPL_NAMES.getClass(); }
 
         /** Package-private version of lookup which is trusted. */
         static final Lookup IMPL_LOOKUP = new Lookup(Object.class, TRUSTED);
 
+        /** Version of lookup which is trusted minimally.
+         *  It can only be used to create method handles to publicly accessible
+         *  members in packages that are exported unconditionally.
+         */
+        static final Lookup PUBLIC_LOOKUP = new Lookup(Object.class, (PUBLIC|UNCONDITIONAL));
+
         private static void checkUnprivilegedlookupClass(Class<?> lookupClass, int allowedModes) {
             String name = lookupClass.getName();
             if (name.startsWith("java.lang.invoke."))
@@ -845,7 +994,7 @@
             // TODO replace with a more formal and less fragile mechanism
             // that does not bluntly restrict classes under packages within
             // java.base from looking up MethodHandles or VarHandles.
-            if (allowedModes == ALL_MODES && lookupClass.getClassLoader() == null) {
+            if (allowedModes == FULL_POWER_MODES && lookupClass.getClassLoader() == null) {
                 if ((name.startsWith("java.") &&
                      !name.equals("java.lang.Thread") &&
                      !name.startsWith("java.util.concurrent.")) ||
@@ -866,6 +1015,7 @@
          * <ul>
          * <li>If no access is allowed, the suffix is "/noaccess".
          * <li>If only public access to types in exported packages is allowed, the suffix is "/public".
+         * <li>If only public access and unconditional access are allowed, the suffix is "/publicLookup".
          * <li>If only public and module access are allowed, the suffix is "/module".
          * <li>If only public, module and package access are allowed, the suffix is "/package".
          * <li>If only public, module, package, and private access are allowed, the suffix is "/private".
@@ -884,6 +1034,9 @@
          * because it requires a direct subclass relationship between
          * caller and callee.)
          * @see #in
+         *
+         * @revised 9
+         * @spec JPMS
          */
         @Override
         public String toString() {
@@ -893,13 +1046,15 @@
                 return cname + "/noaccess";
             case PUBLIC:
                 return cname + "/public";
+            case PUBLIC|UNCONDITIONAL:
+                return cname  + "/publicLookup";
             case PUBLIC|MODULE:
                 return cname + "/module";
             case PUBLIC|MODULE|PACKAGE:
                 return cname + "/package";
-            case ALL_MODES & ~PROTECTED:
+            case FULL_POWER_MODES & ~PROTECTED:
                 return cname + "/private";
-            case ALL_MODES:
+            case FULL_POWER_MODES:
                 return cname;
             case TRUSTED:
                 return "/trusted";  // internal only; not exported
@@ -1580,6 +1735,7 @@
             if (refKind == REF_invokeSpecial)
                 refKind = REF_invokeVirtual;
             assert(method.isMethod());
+            @SuppressWarnings("deprecation")
             Lookup lookup = m.isAccessible() ? IMPL_LOOKUP : this;
             return lookup.getDirectMethodNoSecurityManager(refKind, method.getDeclaringClass(), method, findBoundCallerClass(method));
         }
@@ -1662,6 +1818,7 @@
         public MethodHandle unreflectConstructor(Constructor<?> c) throws IllegalAccessException {
             MemberName ctor = new MemberName(c);
             assert(ctor.isConstructor());
+            @SuppressWarnings("deprecation")
             Lookup lookup = c.isAccessible() ? IMPL_LOOKUP : this;
             return lookup.getDirectConstructorNoSecurityManager(ctor.getDeclaringClass(), ctor);
         }
@@ -1692,6 +1849,7 @@
             assert(isSetter
                     ? MethodHandleNatives.refKindIsSetter(field.getReferenceKind())
                     : MethodHandleNatives.refKindIsGetter(field.getReferenceKind()));
+            @SuppressWarnings("deprecation")
             Lookup lookup = f.isAccessible() ? IMPL_LOOKUP : this;
             return lookup.getDirectFieldNoSecurityManager(field.getReferenceKind(), f.getDeclaringClass(), field);
         }
@@ -1907,7 +2065,7 @@
 
         /**
          * Returns {@code true} if this lookup has {@code PRIVATE} access.
-         * @return {@code true} if this lookup has {@code PRIVATE} acesss.
+         * @return {@code true} if this lookup has {@code PRIVATE} access.
          * @since 9
          */
         public boolean hasPrivateAccess() {
@@ -2033,9 +2191,9 @@
                                (defc == refc ||
                                 Modifier.isPublic(refc.getModifiers())));
             if (!classOK && (allowedModes & PACKAGE) != 0) {
-                classOK = (VerifyAccess.isClassAccessible(defc, lookupClass(), ALL_MODES) &&
+                classOK = (VerifyAccess.isClassAccessible(defc, lookupClass(), FULL_POWER_MODES) &&
                            (defc == refc ||
-                            VerifyAccess.isClassAccessible(refc, lookupClass(), ALL_MODES)));
+                            VerifyAccess.isClassAccessible(refc, lookupClass(), FULL_POWER_MODES)));
             }
             if (!classOK)
                 return "class is not public";
@@ -2348,53 +2506,6 @@
     }
 
     /**
-     * Helper class used to lazily create PUBLIC_LOOKUP with a lookup class
-     * in an <em>unnamed module</em>.
-     *
-     * @see Lookup#publicLookup
-     */
-    private static class LookupHelper {
-        private static final String UNNAMED = "Unnamed";
-        private static final String OBJECT  = "java/lang/Object";
-
-        private static Class<?> createClass() {
-            try {
-                ClassWriter cw = new ClassWriter(0);
-                cw.visit(Opcodes.V1_8,
-                         Opcodes.ACC_FINAL + Opcodes.ACC_SUPER,
-                         UNNAMED,
-                         null,
-                         OBJECT,
-                         null);
-                cw.visitSource(UNNAMED, null);
-                cw.visitEnd();
-                byte[] bytes = cw.toByteArray();
-                ClassLoader loader = new ClassLoader(null) {
-                    @Override
-                    protected Class<?> findClass(String cn) throws ClassNotFoundException {
-                        if (cn.equals(UNNAMED))
-                            return super.defineClass(UNNAMED, bytes, 0, bytes.length);
-                        throw new ClassNotFoundException(cn);
-                    }
-                };
-                return loader.loadClass(UNNAMED);
-            } catch (Exception e) {
-                throw new InternalError(e);
-            }
-        }
-
-        private static final Class<?> PUBLIC_LOOKUP_CLASS = createClass();
-
-        /**
-         * Lookup that is trusted minimally. It can only be used to create
-         * method handles to publicly accessible members in exported packages.
-         *
-         * @see MethodHandles#publicLookup
-         */
-        static final Lookup PUBLIC_LOOKUP = new Lookup(PUBLIC_LOOKUP_CLASS, Lookup.PUBLIC);
-    }
-
-    /**
      * Produces a method handle constructing arrays of a desired type.
      * The return type of the method handle will be the array type.
      * The type of its sole argument will be {@code int}, which specifies the size of the array.
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java
index 53e88de..860ef23 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java
@@ -88,6 +88,7 @@
  * (But the classes need not be initialized, as is the case with a {@code CONSTANT_Class}.)
  * This loading may occur at any time before the {@code MethodType} object is first derived.
  * @author John Rose, JSR 292 EG
+ * @since 1.7
  */
 public final
 class MethodType implements java.io.Serializable {
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java
index 6e5d350..2d32abd 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java
@@ -81,6 +81,7 @@
  * For target values which will be frequently updated, consider using
  * a {@linkplain VolatileCallSite volatile call site} instead.
  * @author John Rose, JSR 292 EG
+ * @since 1.7
  */
 public class MutableCallSite extends CallSite {
     /**
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java b/jdk/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java
index d9f94f3..0566e6b 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java
@@ -54,6 +54,7 @@
  * lambda actually captured by that class.
  *
  * @see LambdaMetafactory
+ * @since 1.8
  */
 public final class SerializedLambda implements Serializable {
     private static final long serialVersionUID = 8025925345765570181L;
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/SwitchPoint.java b/jdk/src/java.base/share/classes/java/lang/invoke/SwitchPoint.java
index 5d9b3bf..83b4d49 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/SwitchPoint.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/SwitchPoint.java
@@ -108,6 +108,7 @@
  * }
  * }</pre>
  * @author Remi Forax, JSR 292 EG
+ * @since 1.7
  */
 public class SwitchPoint {
     private static final MethodHandle
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/VolatileCallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/VolatileCallSite.java
index de88f36..1046e72 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/VolatileCallSite.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/VolatileCallSite.java
@@ -40,6 +40,7 @@
  * with {@code MutableCallSite}.
  * @see MutableCallSite
  * @author John Rose, JSR 292 EG
+ * @since 1.7
  */
 public class VolatileCallSite extends CallSite {
     /**
diff --git a/jdk/src/java.base/share/classes/java/lang/module/Configuration.java b/jdk/src/java.base/share/classes/java/lang/module/Configuration.java
index 9753569..d5fc16c 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/Configuration.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/Configuration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,126 +42,48 @@
 import java.util.stream.Stream;
 
 /**
- * The configuration that is the result of resolution or resolution with
- * service binding.
+ * A configuration that is the result of <a href="package-summary.html#resolution">
+ * resolution</a> or resolution with <a href="package-summary.html#servicebinding">
+ * service binding</a>.
  *
- * <h2><a name="resolution">Resolution</a></h2>
+ * <p> A configuration encapsulates the <em>readability graph</em> that is the
+ * output of resolution. A readability graph is a directed graph where the nodes
+ * are of type {@link ResolvedModule} and the edges represent the readability
+ * amongst the modules. {@code Configuration} defines the {@link #modules()
+ * modules()} method to get the set of resolved modules in the graph. {@code
+ * ResolvedModule} defines the {@link ResolvedModule#reads() reads()} method to
+ * get the set of modules that a resolved module reads. The modules that are
+ * read may be in the same configuration or may be in {@link #parents() parent}
+ * configurations. </p>
  *
- * <p> Resolution is the process of computing the transitive closure of a set
- * of root modules over a set of observable modules by resolving the
- * dependences expressed by {@code requires} clauses.
+ * <p> Configuration defines the {@link #resolve(ModuleFinder,List,ModuleFinder,Collection)
+ * resolve} method to resolve a collection of root modules, and the {@link
+ * #resolveAndBind(ModuleFinder,List,ModuleFinder,Collection) resolveAndBind}
+ * method to do resolution with service binding. There are instance and
+ * static variants of both methods. The instance methods create a configuration
+ * with the receiver as the parent configuration. The static methods are for
+ * more advanced cases where there can be more than one parent configuration. </p>
  *
- * The <em>dependence graph</em> is augmented with edges that take account of
- * implicitly declared dependences ({@code requires transitive}) to create a
- * <em>readability graph</em>. A {@code Configuration} encapsulates the
- * resulting graph of {@link ResolvedModule resolved modules}.
- *
- * <p> Suppose we have the following observable modules: </p>
- * <pre> {@code
- *     module m1 { requires m2; }
- *     module m2 { requires transitive m3; }
- *     module m3 { }
- *     module m4 { }
- * } </pre>
- *
- * <p> If the module {@code m1} is resolved then the resulting configuration
- * contains three modules ({@code m1}, {@code m2}, {@code m3}). The edges in
- * its readability graph are: </p>
- * <pre> {@code
- *     m1 --> m2  (meaning m1 reads m2)
- *     m1 --> m3
- *     m2 --> m3
- * } </pre>
- *
- * <p> Resolution is an additive process. When computing the transitive closure
- * then the dependence relation may include dependences on modules in parent
- * configurations. The result is a <em>relative configuration</em> that is
- * relative to one or more parent configurations and where the readability graph
- * may have edges from modules in the configuration to modules in parent
- * configurations.
- *
- * </p>
- *
- * <p> Suppose we have the following observable modules: </p>
- * <pre> {@code
- *     module m1 { requires m2; requires java.xml; }
- *     module m2 { }
- * } </pre>
- *
- * <p> If module {@code m1} is resolved with the configuration for the {@link
- * java.lang.reflect.Layer#boot() boot} layer as the parent then the resulting
- * configuration contains two modules ({@code m1}, {@code m2}). The edges in
- * its readability graph are:
- * <pre> {@code
- *     m1 --> m2
- *     m1 --> java.xml
- * } </pre>
- * where module {@code java.xml} is in the parent configuration. For
- * simplicity, this example omits the implicitly declared dependence on the
- * {@code java.base} module.
- *
- * <a name="automaticmoduleresolution"></a>
- * <p> {@link ModuleDescriptor#isAutomatic() Automatic} modules receive special
- * treatment during resolution. Each automatic module is resolved so that it
- * reads all other modules in the configuration and all parent configurations.
- * Each automatic module is also resolved as if it {@code requires transitive}
- * all other automatic modules in the configuration (and all automatic modules
- * in parent configurations). </p>
-
- * <h2><a name="servicebinding">Service binding</a></h2>
- *
- * <p> Service binding is the process of augmenting a graph of resolved modules
- * from the set of observable modules induced by the service-use dependence
- * ({@code uses} and {@code provides} clauses). Any module that was not
- * previously in the graph requires resolution to compute its transitive
- * closure. Service binding is an iterative process in that adding a module
- * that satisfies some service-use dependence may introduce new service-use
- * dependences. </p>
- *
- * <p> Suppose we have the following observable modules: </p>
- * <pre> {@code
- *     module m1 { exports p; uses p.S; }
- *     module m2 { requires m1; provides p.S with p2.S2; }
- *     module m3 { requires m1; requires m4; provides p.S with p3.S3; }
- *     module m4 { }
- * } </pre>
- *
- * <p> If the module {@code m1} is resolved then the resulting graph of modules
- * has one module ({@code m1}). If the graph is augmented with modules induced
- * by the service-use dependence relation then the configuration will contain
- * four modules ({@code m1}, {@code m2}, {@code m3}, {@code m4}). The edges in
- * its readability graph are: </p>
- * <pre> {@code
- *     m2 --> m1
- *     m3 --> m1
- *     m3 --> m4
- * } </pre>
- * <p> The edges in the conceptual service-use graph are: </p>
- * <pre> {@code
- *     m1 --> m2  (meaning m1 uses a service that is provided by m2)
- *     m1 --> m3
- * } </pre>
- *
- * <p> If this configuration is instantiated as a {@code Layer}, and if code in
- * module {@code m1} uses {@link java.util.ServiceLoader ServiceLoader} to
- * iterate over implementations of {@code p.S.class}, then it will iterate over
- * an instance of {@code p2.S2} and {@code p3.S3}. </p>
+ * <p> Each {@link java.lang.ModuleLayer layer} of modules in the Java virtual
+ * machine is created from a configuration. The configuration for the {@link
+ * java.lang.ModuleLayer#boot() boot} layer is obtained by invoking {@code
+ * ModuleLayer.boot().configuration()}. The configuration for the boot layer
+ * will often be the parent when creating new configurations. </p>
  *
  * <h3> Example </h3>
  *
- * <p> The following example uses the {@code resolveRequires} method to resolve
- * a module named <em>myapp</em> with the configuration for the boot layer as
- * the parent configuration. It prints the name of each resolved module and
- * the names of the modules that each module reads. </p>
+ * <p> The following example uses the {@link
+ * #resolve(ModuleFinder,ModuleFinder,Collection) resolve} method to resolve a
+ * module named <em>myapp</em> with the configuration for the boot layer as the
+ * parent configuration. It prints the name of each resolved module and the
+ * names of the modules that each module reads. </p>
  *
  * <pre>{@code
  *    ModuleFinder finder = ModuleFinder.of(dir1, dir2, dir3);
  *
- *    Configuration parent = Layer.boot().configuration();
+ *    Configuration parent = ModuleLayer.boot().configuration();
  *
- *    Configuration cf = parent.resolveRequires(finder,
- *                                              ModuleFinder.of(),
- *                                              Set.of("myapp"));
+ *    Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("myapp"));
  *    cf.modules().forEach(m -> {
  *        System.out.format("%s -> %s%n",
  *            m.name(),
@@ -172,7 +94,8 @@
  * }</pre>
  *
  * @since 9
- * @see java.lang.reflect.Layer
+ * @spec JPMS
+ * @see java.lang.ModuleLayer
  */
 public final class Configuration {
 
@@ -186,11 +109,20 @@
     private final Set<ResolvedModule> modules;
     private final Map<String, ResolvedModule> nameToModule;
 
+    // module constraints on target
+    private final String osName;
+    private final String osArch;
+
+    String osName() { return osName; }
+    String osArch() { return osArch; }
+
     private Configuration() {
         this.parents = Collections.emptyList();
         this.graph = Collections.emptyMap();
         this.modules = Collections.emptySet();
         this.nameToModule = Collections.emptyMap();
+        this.osName = null;
+        this.osArch = null;
     }
 
     private Configuration(List<Configuration> parents,
@@ -214,27 +146,29 @@
         this.graph = g;
         this.modules = Set.of(moduleArray);
         this.nameToModule = Map.ofEntries(nameEntries);
-    }
 
+        this.osName = resolver.osName();
+        this.osArch = resolver.osArch();
+    }
 
     /**
      * Resolves a collection of root modules, with this configuration as its
      * parent, to create a new configuration. This method works exactly as
      * specified by the static {@link
-     * #resolveRequires(ModuleFinder,List,ModuleFinder,Collection) resolveRequires}
+     * #resolve(ModuleFinder,List,ModuleFinder,Collection) resolve}
      * method when invoked with this configuration as the parent. In other words,
      * if this configuration is {@code cf} then this method is equivalent to
      * invoking:
      * <pre> {@code
-     *     Configuration.resolveRequires(before, List.of(cf), after, roots);
+     *     Configuration.resolve(before, List.of(cf), after, roots);
      * }</pre>
      *
      * @param  before
      *         The <em>before</em> module finder to find modules
      * @param  after
-     *         The <em>after</em> module finder to locate modules when a
-     *         module cannot be located by the {@code before} module finder
-     *         and the module is not in this configuration
+     *         The <em>after</em> module finder to locate modules when not
+     *         located by the {@code before} module finder or in parent
+     *         configurations
      * @param  roots
      *         The possibly-empty collection of module names of the modules
      *         to resolve
@@ -242,16 +176,20 @@
      * @return The configuration that is the result of resolving the given
      *         root modules
      *
+     * @throws FindException
+     *         If resolution fails for any of the observability-related reasons
+     *         specified by the static {@code resolve} method
      * @throws ResolutionException
-     *         If resolution or the post-resolution checks fail
+     *         If any of the post-resolution consistency checks specified by
+     *         the  static {@code resolve} method fail
      * @throws SecurityException
      *         If locating a module is denied by the security manager
      */
-    public Configuration resolveRequires(ModuleFinder before,
-                                         ModuleFinder after,
-                                         Collection<String> roots)
+    public Configuration resolve(ModuleFinder before,
+                                 ModuleFinder after,
+                                 Collection<String> roots)
     {
-        return resolveRequires(before, List.of(this), after, roots);
+        return resolve(before, List.of(this), after, roots);
     }
 
 
@@ -259,12 +197,12 @@
      * Resolves a collection of root modules, with service binding, and with
      * this configuration as its parent, to create a new configuration.
      * This method works exactly as specified by the static {@link
-     * #resolveRequiresAndUses(ModuleFinder,List,ModuleFinder,Collection)
-     * resolveRequiresAndUses} method when invoked with this configuration
+     * #resolveAndBind(ModuleFinder,List,ModuleFinder,Collection)
+     * resolveAndBind} method when invoked with this configuration
      * as the parent. In other words, if this configuration is {@code cf} then
      * this method is equivalent to invoking:
      * <pre> {@code
-     *     Configuration.resolveRequiresAndUses(before, List.of(cf), after, roots);
+     *     Configuration.resolveAndBind(before, List.of(cf), after, roots);
      * }</pre>
      *
      *
@@ -272,25 +210,29 @@
      *         The <em>before</em> module finder to find modules
      * @param  after
      *         The <em>after</em> module finder to locate modules when not
-     *         located by the {@code before} module finder and this
-     *         configuration
+     *         located by the {@code before} module finder or in parent
+     *         configurations
      * @param  roots
      *         The possibly-empty collection of module names of the modules
      *         to resolve
      *
-     * @return The configuration that is the result of resolving the given
-     *         root modules
+     * @return The configuration that is the result of resolving, with service
+     *         binding, the given root modules
      *
+     * @throws FindException
+     *         If resolution fails for any of the observability-related reasons
+     *         specified by the static {@code resolve} method
      * @throws ResolutionException
-     *         If resolution or the post-resolution checks fail
+     *         If any of the post-resolution consistency checks specified by
+     *         the  static {@code resolve} method fail
      * @throws SecurityException
      *         If locating a module is denied by the security manager
      */
-    public Configuration resolveRequiresAndUses(ModuleFinder before,
-                                                ModuleFinder after,
-                                                Collection<String> roots)
+    public Configuration resolveAndBind(ModuleFinder before,
+                                        ModuleFinder after,
+                                        Collection<String> roots)
     {
-        return resolveRequiresAndUses(before, List.of(this), after, roots);
+        return resolveAndBind(before, List.of(this), after, roots);
     }
 
 
@@ -301,14 +243,14 @@
      *
      * This method is used to create the configuration for the boot layer.
      */
-    static Configuration resolveRequiresAndUses(ModuleFinder finder,
-                                                Collection<String> roots,
-                                                boolean check,
-                                                PrintStream traceOutput)
+    static Configuration resolveAndBind(ModuleFinder finder,
+                                        Collection<String> roots,
+                                        boolean check,
+                                        PrintStream traceOutput)
     {
         List<Configuration> parents = List.of(empty());
         Resolver resolver = new Resolver(finder, parents, ModuleFinder.of(), traceOutput);
-        resolver.resolveRequires(roots).resolveUses();
+        resolver.resolve(roots).bind();
 
         return new Configuration(parents, resolver, check);
     }
@@ -328,13 +270,14 @@
      *
      * <p> When all modules have been resolved then the resulting dependency
      * graph is checked to ensure that it does not contain cycles. A
-     * readability graph is constructed and in conjunction with the module
+     * readability graph is constructed, and in conjunction with the module
      * exports and service use, checked for consistency. </p>
      *
-     * <p> Resolution and the (post-resolution) consistency checks may fail for
-     * following reasons: </p>
+     * <p> Resolution may fail with {@code FindException} for the following
+     * <em>observability-related</em> reasons: </p>
      *
      * <ul>
+     *
      *     <li><p> A root module, or a direct or transitive dependency, is not
      *     found. </p></li>
      *
@@ -343,9 +286,20 @@
      *     descriptor ({@code module-info.class}) or two versions of the same
      *     module are found in the same directory. </p></li>
      *
+     * </ul>
+     *
+     * <p> Post-resolution consistency checks may fail with {@code
+     * ResolutionException} for the following reasons: </p>
+     *
+     * <ul>
+     *
      *     <li><p> A cycle is detected, say where module {@code m1} requires
      *     module {@code m2} and {@code m2} requires {@code m1}. </p></li>
      *
+     *     <li><p> A module reads two or more modules with the same name. This
+     *     includes the case where a module reads another with the same name as
+     *     itself. </p></li>
+     *
      *     <li><p> Two or more modules in the configuration export the same
      *     package to a module that reads both. This includes the case where a
      *     module {@code M} containing package {@code p} reads another module
@@ -356,21 +310,13 @@
      *     module {@code M} nor exported to {@code M} by any module that
      *     {@code M} reads. </p></li>
      *
-     *     <li><p> A module {@code M} declares that it
-     *     "{@code provides ... with q.T}" but package {@code q} is not in
-     *     module {@code M}. </p></li>
-     *
-     *     <li><p> Two or more modules in the configuration are specific to
-     *     different {@link ModuleDescriptor#osName() operating systems},
-     *     {@link ModuleDescriptor#osArch() architectures}, or {@link
-     *     ModuleDescriptor#osVersion() versions}. </p></li>
-     *
-     *     <li><p> Other implementation specific checks, for example referential
-     *     integrity checks to ensure that different versions of tighly coupled
-     *     modules cannot be combined in the same configuration. </p></li>
-     *
      * </ul>
      *
+     * @implNote In the implementation then observability of modules may depend
+     * on referential integrity or other checks that ensure different builds of
+     * tightly coupled modules or modules for specific operating systems or
+     * architectures are not combined in the same configuration.
+     *
      * @param  before
      *         The <em>before</em> module finder to find modules
      * @param  parents
@@ -386,17 +332,22 @@
      * @return The configuration that is the result of resolving the given
      *         root modules
      *
+     * @throws FindException
+     *         If resolution fails for an observability-related reason
      * @throws ResolutionException
-     *         If resolution or the post-resolution checks fail
+     *         If a post-resolution consistency checks fails
      * @throws IllegalArgumentException
-     *         If the list of parents is empty
+     *         If the list of parents is empty, or the list has two or more
+     *         parents with modules for different target operating systems,
+     *         architectures, or versions
+     *
      * @throws SecurityException
      *         If locating a module is denied by the security manager
      */
-    public static Configuration resolveRequires(ModuleFinder before,
-                                                List<Configuration> parents,
-                                                ModuleFinder after,
-                                                Collection<String> roots)
+    public static Configuration resolve(ModuleFinder before,
+                                        List<Configuration> parents,
+                                        ModuleFinder after,
+                                        Collection<String> roots)
     {
         Objects.requireNonNull(before);
         Objects.requireNonNull(after);
@@ -407,7 +358,7 @@
             throw new IllegalArgumentException("'parents' is empty");
 
         Resolver resolver = new Resolver(before, parentList, after, null);
-        resolver.resolveRequires(roots);
+        resolver.resolve(roots);
 
         return new Configuration(parentList, resolver, true);
     }
@@ -417,24 +368,24 @@
      * configuration.
      *
      * <p> This method works exactly as specified by {@link
-     * #resolveRequires(ModuleFinder,List,ModuleFinder,Collection)
-     * resolveRequires} except that the graph of resolved modules is augmented
+     * #resolve(ModuleFinder,List,ModuleFinder,Collection)
+     * resolve} except that the graph of resolved modules is augmented
      * with modules induced by the service-use dependence relation. </p>
      *
      * <p> More specifically, the root modules are resolved as if by calling
-     * {@code resolveRequires}. The resolved modules, and all modules in the
+     * {@code resolve}. The resolved modules, and all modules in the
      * parent configurations, with {@link ModuleDescriptor#uses() service
      * dependences} are then examined. All modules found by the given module
      * finders that {@link ModuleDescriptor#provides() provide} an
      * implementation of one or more of the service types are added to the
      * module graph and then resolved as if by calling the {@code
-     * resolveRequires} method. Adding modules to the module graph may
-     * introduce new service-use dependences and so the process works
-     * iteratively until no more modules are added. </p>
+     * resolve} method. Adding modules to the module graph may introduce new
+     * service-use dependences and so the process works iteratively until no
+     * more modules are added. </p>
      *
-     * <p> As service binding involves resolution then it may fail with {@link
-     * ResolutionException} for exactly the same reasons specified in
-     * {@code resolveRequires}.  </p>
+     * <p> As service binding involves resolution then it may fail with {@code
+     * FindException} or {@code ResolutionException} for exactly the same
+     * reasons specified in {@code resolve}. </p>
      *
      * @param  before
      *         The <em>before</em> module finder to find modules
@@ -448,20 +399,26 @@
      *         The possibly-empty collection of module names of the modules
      *         to resolve
      *
-     * @return The configuration that is the result of resolving the given
-     *         root modules
+     * @return The configuration that is the result of resolving, with service
+     *         binding, the given root modules
      *
+     * @throws FindException
+     *         If resolution fails for any of the observability-related reasons
+     *         specified by the static {@code resolve} method
      * @throws ResolutionException
-     *         If resolution or the post-resolution checks fail
+     *         If any of the post-resolution consistency checks specified by
+     *         the  static {@code resolve} method fail
      * @throws IllegalArgumentException
-     *         If the list of parents is empty
+     *         If the list of parents is empty, or the list has two or more
+     *         parents with modules for different target operating systems,
+     *         architectures, or versions
      * @throws SecurityException
      *         If locating a module is denied by the security manager
      */
-    public static Configuration resolveRequiresAndUses(ModuleFinder before,
-                                                       List<Configuration> parents,
-                                                       ModuleFinder after,
-                                                       Collection<String> roots)
+    public static Configuration resolveAndBind(ModuleFinder before,
+                                               List<Configuration> parents,
+                                               ModuleFinder after,
+                                               Collection<String> roots)
     {
         Objects.requireNonNull(before);
         Objects.requireNonNull(after);
@@ -472,7 +429,7 @@
             throw new IllegalArgumentException("'parents' is empty");
 
         Resolver resolver = new Resolver(before, parentList, after, null);
-        resolver.resolveRequires(roots).resolveUses();
+        resolver.resolve(roots).bind();
 
         return new Configuration(parentList, resolver, true);
     }
diff --git a/jdk/src/java.base/share/classes/java/lang/module/FindException.java b/jdk/src/java.base/share/classes/java/lang/module/FindException.java
index d76f293..411959e 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/FindException.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/FindException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,14 @@
 package java.lang.module;
 
 /**
- * Thrown by module finders when finding a module fails.
+ * Thrown by a {@link ModuleFinder ModuleFinder} when an error occurs finding
+ * a module. Also thrown by {@link
+ * Configuration#resolve(ModuleFinder,java.util.List,ModuleFinder,java.util.Collection)
+ * Configuration.resolve} when resolution fails for observability-related
+ * reasons.
  *
- * @see ModuleFinder
  * @since 9
+ * @spec JPMS
  */
 
 public class FindException extends RuntimeException {
diff --git a/jdk/src/java.base/share/classes/java/lang/module/InvalidModuleDescriptorException.java b/jdk/src/java.base/share/classes/java/lang/module/InvalidModuleDescriptorException.java
index 981f23a..3e30688 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/InvalidModuleDescriptorException.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/InvalidModuleDescriptorException.java
@@ -31,6 +31,7 @@
  *
  * @see ModuleDescriptor#read
  * @since 9
+ * @spec JPMS
  */
 public class InvalidModuleDescriptorException extends RuntimeException {
     private static final long serialVersionUID = 4863390386809347380L;
diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
index b10d986..01b4316 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 import java.nio.ByteBuffer;
 import java.nio.file.Path;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumSet;
@@ -56,18 +57,37 @@
 /**
  * A module descriptor.
  *
- * <p> A {@code ModuleDescriptor} is typically created from the binary form
- * of a module declaration. Alternatively, the {@link ModuleDescriptor.Builder}
- * class can be used to create a {@code ModuleDescriptor} from its components.
- * The {@link #module module}, {@link #openModule openModule}, and {@link
- * #automaticModule automaticModule} methods create builders for building
- * different kinds of modules. </p>
+ * <p> A module descriptor describes a named module and defines methods to
+ * obtain each of its components. The module descriptor for a named module
+ * in the Java virtual machine is obtained by invoking the {@link
+ * java.lang.Module Module}'s {@link java.lang.Module#getDescriptor
+ * getDescriptor} method. Module descriptors can also be created using the
+ * {@link ModuleDescriptor.Builder} class or by reading the binary form of a
+ * module declaration ({@code module-info.class}) using the {@link
+ * #read(InputStream,Supplier) read} methods defined here. </p>
+ *
+ * <p> A module descriptor describes a <em>normal</em>, open, or automatic
+ * module. <em>Normal</em> modules and open modules describe their {@link
+ * #requires() dependences}, {@link #exports() exported-packages}, the services
+ * that they {@link #uses() use} or {@link #provides() provide}, and other
+ * components. <em>Normal</em> modules may {@link #opens() open} specific
+ * packages. The module descriptor for an open modules does not declare any
+ * open packages (its {@code opens} method returns an empty set) but when
+ * instantiated in the Java virtual machine then it is treated as if all
+ * packages are open. The module descriptor for an automatic module does not
+ * declare any dependences (except for the mandatory dependency on {@code
+ * java.base}), and does not declare any exported or open packages. Automatic
+ * module receive special treatment during resolution so that they read all
+ * other modules in the configuration. When an automatic module is instantiated
+ * in the Java virtual machine then it reads every unnamed module and is
+ * treated as if all packages are exported and open. </p>
  *
  * <p> {@code ModuleDescriptor} objects are immutable and safe for use by
  * multiple concurrent threads.</p>
  *
+ * @see java.lang.Module
  * @since 9
- * @see java.lang.reflect.Module
+ * @spec JPMS
  */
 
 public class ModuleDescriptor
@@ -75,10 +95,45 @@
 {
 
     /**
+     * A modifier on a module.
+     *
+     * @see ModuleDescriptor#modifiers()
+     * @since 9
+     */
+    public static enum Modifier {
+        /**
+         * An open module. An open module does not declare any open packages
+         * but the resulting module is treated as if all packages are open.
+         */
+        OPEN,
+
+        /**
+         * An automatic module. An automatic module is treated as if it exports
+         * and opens all packages.
+         *
+         * @apiNote This modifier does not correspond to a module flag in the
+         * binary form of a module declaration ({@code module-info.class}).
+         */
+        AUTOMATIC,
+
+        /**
+         * The module was not explicitly or implicitly declared.
+         */
+        SYNTHETIC,
+
+        /**
+         * The module was implicitly declared.
+         */
+        MANDATED;
+    }
+
+
+    /**
      * <p> A dependence upon a module </p>
      *
      * @see ModuleDescriptor#requires()
      * @since 9
+     * @spec JPMS
      */
 
     public final static class Requires
@@ -88,7 +143,9 @@
         /**
          * A modifier on a module dependence.
          *
+         * @see Requires#modifiers()
          * @since 9
+         * @spec JPMS
          */
         public static enum Modifier {
 
@@ -122,8 +179,10 @@
         private final Set<Modifier> mods;
         private final String name;
         private final Version compiledVersion;
+        private final String rawCompiledVersion;
 
-        private Requires(Set<Modifier> ms, String mn, Version v) {
+        private Requires(Set<Modifier> ms, String mn, Version v, String vs) {
+            assert v == null || vs == null;
             if (ms.isEmpty()) {
                 ms = Collections.emptySet();
             } else {
@@ -132,12 +191,14 @@
             this.mods = ms;
             this.name = mn;
             this.compiledVersion = v;
+            this.rawCompiledVersion = vs;
         }
 
         private Requires(Set<Modifier> ms, String mn, Version v, boolean unused) {
             this.mods = ms;
             this.name = mn;
             this.compiledVersion = v;
+            this.rawCompiledVersion = null;
         }
 
         /**
@@ -161,24 +222,52 @@
         /**
          * Returns the version of the module if recorded at compile-time.
          *
-         * @return The version of the module if recorded at compile-time
+         * @return The version of the module if recorded at compile-time,
+         *         or an empty {@code Optional} if no version was recorded or
+         *         the version string recorded is {@linkplain Version#parse(String)
+         *         unparseable}
          */
         public Optional<Version> compiledVersion() {
             return Optional.ofNullable(compiledVersion);
         }
 
         /**
+         * Returns the string with the possibly-unparseable version of the module
+         * if recorded at compile-time.
+         *
+         * @return The string containing the version of the module if recorded
+         *         at compile-time, or an empty {@code Optional} if no version
+         *         was recorded
+         *
+         * @see #compiledVersion()
+         */
+        public Optional<String> rawCompiledVersion() {
+            if (compiledVersion != null) {
+                return Optional.of(compiledVersion.toString());
+            } else {
+                return Optional.ofNullable(rawCompiledVersion);
+            }
+        }
+
+        /**
          * Compares this module dependence to another.
          *
          * <p> Two {@code Requires} objects are compared by comparing their
-         * module name lexicographically.  Where the module names are equal then
-         * the sets of modifiers are compared based on a value computed from the
-         * ordinal of each modifier. Where the module names are equal and the
-         * set of modifiers are equal then the version of the modules recorded
-         * at compile-time are compared. When comparing the versions recorded
-         * at compile-time then a dependence that has a recorded version is
-         * considered to succeed a dependence that does not have a recorded
-         * version. </p>
+         * module names lexicographically. Where the module names are equal
+         * then the sets of modifiers are compared in the same way that
+         * module modifiers are compared (see {@link ModuleDescriptor#compareTo
+         * ModuleDescriptor.compareTo}). Where the module names are equal and
+         * the set of modifiers are equal then the version of the modules
+         * recorded at compile-time are compared. When comparing the versions
+         * recorded at compile-time then a dependence that has a recorded
+         * version is considered to succeed a dependence that does not have a
+         * recorded version. If both recorded versions are {@linkplain
+         * Version#parse(String) unparseable} then the {@linkplain
+         * #rawCompiledVersion() raw version strings} are compared
+         * lexicographically. </p>
+         *
+         * @param  that
+         *         The module dependence to compare
          *
          * @return A negative integer, zero, or a positive integer if this module
          *         dependence is less than, equal to, or greater than the given
@@ -186,39 +275,26 @@
          */
         @Override
         public int compareTo(Requires that) {
+            if (this == that) return 0;
+
             int c = this.name().compareTo(that.name());
-            if (c != 0)
-                return c;
+            if (c != 0) return c;
 
             // modifiers
-            c = Long.compare(this.modsValue(), that.modsValue());
-            if (c != 0)
-                return c;
+            long v1 = modsValue(this.modifiers());
+            long v2 = modsValue(that.modifiers());
+            c = Long.compare(v1, v2);
+            if (c != 0) return c;
 
             // compiledVersion
-            if (this.compiledVersion != null) {
-                if (that.compiledVersion != null)
-                    c = this.compiledVersion.compareTo(that.compiledVersion);
-                else
-                    c = 1;
-            } else {
-                if (that.compiledVersion != null)
-                    c = -1;
-            }
+            c = compare(this.compiledVersion, that.compiledVersion);
+            if (c != 0) return c;
 
-            return c;
-        }
+            // rawCompiledVersion
+            c = compare(this.rawCompiledVersion, that.rawCompiledVersion);
+            if (c != 0) return c;
 
-        /**
-         * Return a value for the modifiers to allow sets of modifiers to be
-         * compared.
-         */
-        private long modsValue() {
-            long value = 0;
-            for (Modifier m : mods) {
-                value += 1 << m.ordinal();
-            }
-            return value;
+            return 0;
         }
 
         /**
@@ -245,7 +321,8 @@
                 return false;
             Requires that = (Requires)ob;
             return name.equals(that.name) && mods.equals(that.mods)
-                    && Objects.equals(compiledVersion, that.compiledVersion);
+                    && Objects.equals(compiledVersion, that.compiledVersion)
+                    && Objects.equals(rawCompiledVersion, that.rawCompiledVersion);
         }
 
         /**
@@ -262,13 +339,15 @@
             int hash = name.hashCode() * 43 + mods.hashCode();
             if (compiledVersion != null)
                 hash = hash * 43 + compiledVersion.hashCode();
+            if (rawCompiledVersion != null)
+                hash = hash * 43 + rawCompiledVersion.hashCode();
             return hash;
         }
 
         /**
-         * Returns a string describing module dependence.
+         * Returns a string describing this module dependence.
          *
-         * @return A string describing module dependence
+         * @return A string describing this module dependence
          */
         @Override
         public String toString() {
@@ -285,18 +364,23 @@
 
 
     /**
-     * <p> A module export, may be qualified or unqualified. </p>
+     * <p> A package exported by a module, may be qualified or unqualified. </p>
      *
      * @see ModuleDescriptor#exports()
      * @since 9
+     * @spec JPMS
      */
 
-    public final static class Exports {
+    public final static class Exports
+        implements Comparable<Exports>
+    {
 
         /**
-         * A modifier on a module export.
+         * A modifier on an exported package.
          *
+         * @see Exports#modifiers()
          * @since 9
+         * @spec JPMS
          */
         public static enum Modifier {
 
@@ -381,6 +465,52 @@
         }
 
         /**
+         * Compares this module export to another.
+         *
+         * <p> Two {@code Exports} objects are compared by comparing the package
+         * names lexicographically. Where the packages names are equal then the
+         * sets of modifiers are compared in the same way that module modifiers
+         * are compared (see {@link ModuleDescriptor#compareTo
+         * ModuleDescriptor.compareTo}). Where the package names are equal and
+         * the set of modifiers are equal then the set of target modules are
+         * compared. This is done by sorting the names of the target modules
+         * in ascending order, and according to their natural ordering, and then
+         * comparing the corresponding elements lexicographically. Where the
+         * sets differ in size, and the larger set contains all elements of the
+         * smaller set, then the larger set is considered to succeed the smaller
+         * set. </p>
+         *
+         * @param  that
+         *         The module export to compare
+         *
+         * @return A negative integer, zero, or a positive integer if this module
+         *         export is less than, equal to, or greater than the given
+         *         export dependence
+         */
+        @Override
+        public int compareTo(Exports that) {
+            if (this == that) return 0;
+
+            int c = source.compareTo(that.source);
+            if (c != 0)
+                return c;
+
+            // modifiers
+            long v1 = modsValue(this.modifiers());
+            long v2 = modsValue(that.modifiers());
+            c = Long.compare(v1, v2);
+            if (c != 0)
+                return c;
+
+            // targets
+            c = compare(targets, that.targets);
+            if (c != 0)
+                return c;
+
+            return 0;
+        }
+
+        /**
          * Computes a hash code for this module export.
          *
          * <p> The hash code is based upon the modifiers, the package name,
@@ -425,9 +555,9 @@
         }
 
         /**
-         * Returns a string describing module export.
+         * Returns a string describing the exported package.
          *
-         * @return A string describing module export
+         * @return A string describing the exported package
          */
         @Override
         public String toString() {
@@ -441,8 +571,7 @@
 
 
     /**
-     * <p> Represents a module <em>opens</em> directive, may be qualified or
-     * unqualified. </p>
+     * <p> A package opened by a module, may be qualified or unqualified. </p>
      *
      * <p> The <em>opens</em> directive in a module declaration declares a
      * package to be open to allow all types in the package, and all their
@@ -452,26 +581,30 @@
      *
      * @see ModuleDescriptor#opens()
      * @since 9
+     * @spec JPMS
      */
 
-    public final static class Opens {
-
+    public final static class Opens
+        implements Comparable<Opens>
+    {
         /**
-         * A modifier on a module <em>opens</em> directive.
+         * A modifier on an open package.
          *
+         * @see Opens#modifiers()
          * @since 9
+         * @spec JPMS
          */
         public static enum Modifier {
 
             /**
-             * The opens was not explicitly or implicitly declared in the
-             * source of the module declaration.
+             * The open package was not explicitly or implicitly declared in
+             * the source of the module declaration.
              */
             SYNTHETIC,
 
             /**
-             * The opens was implicitly declared in the source of the module
-             * declaration.
+             * The open package was implicitly declared in the source of the
+             * module declaration.
              */
             MANDATED;
 
@@ -544,6 +677,52 @@
         }
 
         /**
+         * Compares this module opens to another.
+         *
+         * <p> Two {@code Opens} objects are compared by comparing the package
+         * names lexicographically. Where the packages names are equal then the
+         * sets of modifiers are compared in the same way that module modifiers
+         * are compared (see {@link ModuleDescriptor#compareTo
+         * ModuleDescriptor.compareTo}). Where the package names are equal and
+         * the set of modifiers are equal then the set of target modules are
+         * compared. This is done by sorting the names of the target modules
+         * in ascending order, and according to their natural ordering, and then
+         * comparing the corresponding elements lexicographically. Where the
+         * sets differ in size, and the larger set contains all elements of the
+         * smaller set, then the larger set is considered to succeed the smaller
+         * set. </p>
+         *
+         * @param  that
+         *         The module opens to compare
+         *
+         * @return A negative integer, zero, or a positive integer if this module
+         *         opens is less than, equal to, or greater than the given
+         *         module opens
+         */
+        @Override
+        public int compareTo(Opens that) {
+            if (this == that) return 0;
+
+            int c = source.compareTo(that.source);
+            if (c != 0)
+                return c;
+
+            // modifiers
+            long v1 = modsValue(this.modifiers());
+            long v2 = modsValue(that.modifiers());
+            c = Long.compare(v1, v2);
+            if (c != 0)
+                return c;
+
+            // targets
+            c = compare(targets, that.targets);
+            if (c != 0)
+                return c;
+
+            return 0;
+        }
+
+        /**
          * Computes a hash code for this module opens.
          *
          * <p> The hash code is based upon the modifiers, the package name,
@@ -588,9 +767,9 @@
         }
 
         /**
-         * Returns a string describing module opens.
+         * Returns a string describing the open package.
          *
-         * @return A string describing module opens
+         * @return A string describing the open package
          */
         @Override
         public String toString() {
@@ -608,10 +787,12 @@
      *
      * @see ModuleDescriptor#provides()
      * @since 9
+     * @spec JPMS
      */
 
-    public final static class Provides {
-
+    public final static class Provides
+        implements Comparable<Provides>
+    {
         private final String service;
         private final List<String> providers;
 
@@ -628,7 +809,7 @@
         /**
          * Returns the fully qualified class name of the service type.
          *
-         * @return The fully qualified class name of the service type.
+         * @return The fully qualified class name of the service type
          */
         public String service() { return service; }
 
@@ -642,6 +823,46 @@
         public List<String> providers() { return providers; }
 
         /**
+         * Compares this provides to another.
+         *
+         * <p> Two {@code Provides} objects are compared by comparing the fully
+         * qualified class name of the service type lexicographically. Where the
+         * class names are equal then the list of the provider class names are
+         * compared by comparing the corresponding elements of both lists
+         * lexicographically and in sequence. Where the lists differ in size,
+         * {@code N} is the size of the shorter list, and the first {@code N}
+         * corresponding elements are equal, then the longer list is considered
+         * to succeed the shorter list. </p>
+         *
+         * @param  that
+         *         The {@code Provides} to compare
+         *
+         * @return A negative integer, zero, or a positive integer if this provides
+         *         is less than, equal to, or greater than the given provides
+         */
+        public int compareTo(Provides that) {
+            if (this == that) return 0;
+
+            int c = service.compareTo(that.service);
+            if (c != 0) return c;
+
+            // compare provider class names in sequence
+            int size1 = this.providers.size();
+            int size2 = that.providers.size();
+            for (int index=0; index<Math.min(size1, size2); index++) {
+                String e1 = this.providers.get(index);
+                String e2 = that.providers.get(index);
+                c = e1.compareTo(e2);
+                if (c != 0) return c;
+            }
+            if (size1 == size2) {
+                return 0;
+            } else {
+                return (size1 > size2) ? 1 : -1;
+            }
+        }
+
+        /**
          * Computes a hash code for this provides.
          *
          * <p> The hash code is based upon the service type and the set of
@@ -699,7 +920,7 @@
      *
      * <p> A version string has three components: The version number itself, an
      * optional pre-release version, and an optional build version.  Each
-     * component is sequence of tokens; each token is either a non-negative
+     * component is a sequence of tokens; each token is either a non-negative
      * integer or a string.  Tokens are separated by the punctuation characters
      * {@code '.'}, {@code '-'}, or {@code '+'}, or by transitions from a
      * sequence of digits to a sequence of characters that are neither digits
@@ -740,6 +961,7 @@
      *
      * @see ModuleDescriptor#version()
      * @since 9
+     * @spec JPMS
      */
 
     public final static class Version
@@ -1009,53 +1231,40 @@
 
     }
 
-
+
     private final String name;
     private final Version version;
-    private final boolean open;
-
-    // Indicates if synthesised for a JAR file found on the module path
-    private final boolean automatic;
-
-    // Not generated from a module-info.java
-    private final boolean synthetic;
-
+    private final String rawVersionString;
+    private final Set<Modifier> modifiers;
+    private final boolean open;  // true if modifiers contains OPEN
+    private final boolean automatic;  // true if modifiers contains AUTOMATIC
     private final Set<Requires> requires;
     private final Set<Exports> exports;
     private final Set<Opens> opens;
     private final Set<String> uses;
     private final Set<Provides> provides;
-
-    // Added post-compilation by tools
     private final Set<String> packages;
     private final String mainClass;
-    private final String osName;
-    private final String osArch;
-    private final String osVersion;
-
 
     private ModuleDescriptor(String name,
                              Version version,
-                             boolean open,
-                             boolean automatic,
-                             boolean synthetic,
+                             String rawVersionString,
+                             Set<Modifier> modifiers,
                              Set<Requires> requires,
                              Set<Exports> exports,
                              Set<Opens> opens,
                              Set<String> uses,
                              Set<Provides> provides,
                              Set<String> packages,
-                             String mainClass,
-                             String osName,
-                             String osArch,
-                             String osVersion)
+                             String mainClass)
     {
+        assert version == null || rawVersionString == null;
         this.name = name;
         this.version = version;
-        this.open = open;
-        this.automatic = automatic;
-        this.synthetic = synthetic;
-
+        this.rawVersionString = rawVersionString;
+        this.modifiers = emptyOrUnmodifiableSet(modifiers);
+        this.open = modifiers.contains(Modifier.OPEN);
+        this.automatic = modifiers.contains(Modifier.AUTOMATIC);
         assert (requires.stream().map(Requires::name).distinct().count()
                 == requires.size());
         this.requires = emptyOrUnmodifiableSet(requires);
@@ -1066,35 +1275,6 @@
 
         this.packages = emptyOrUnmodifiableSet(packages);
         this.mainClass = mainClass;
-        this.osName = osName;
-        this.osArch = osArch;
-        this.osVersion = osVersion;
-    }
-
-    /**
-     * Clones the given module descriptor with an augmented set of packages
-     */
-    ModuleDescriptor(ModuleDescriptor md, Set<String> pkgs) {
-        this.name = md.name;
-        this.version = md.version;
-        this.open = md.open;
-        this.automatic = md.automatic;
-        this.synthetic = md.synthetic;
-
-        this.requires = md.requires;
-        this.exports = md.exports;
-        this.opens = md.opens;
-        this.uses = md.uses;
-        this.provides = md.provides;
-
-        Set<String> packages = new HashSet<>(md.packages);
-        packages.addAll(pkgs);
-        this.packages = emptyOrUnmodifiableSet(packages);
-
-        this.mainClass = md.mainClass;
-        this.osName = md.osName;
-        this.osArch = md.osArch;
-        this.osVersion = md.osVersion;
     }
 
     /**
@@ -1103,9 +1283,7 @@
      */
     ModuleDescriptor(String name,
                      Version version,
-                     boolean open,
-                     boolean automatic,
-                     boolean synthetic,
+                     Set<Modifier> modifiers,
                      Set<Requires> requires,
                      Set<Exports> exports,
                      Set<Opens> opens,
@@ -1113,16 +1291,14 @@
                      Set<Provides> provides,
                      Set<String> packages,
                      String mainClass,
-                     String osName,
-                     String osArch,
-                     String osVersion,
                      int hashCode,
                      boolean unused) {
         this.name = name;
         this.version = version;
-        this.open = open;
-        this.automatic = automatic;
-        this.synthetic = synthetic;
+        this.rawVersionString = null;
+        this.modifiers = modifiers;
+        this.open = modifiers.contains(Modifier.OPEN);
+        this.automatic = modifiers.contains(Modifier.AUTOMATIC);
         this.requires = requires;
         this.exports = exports;
         this.opens = opens;
@@ -1130,14 +1306,11 @@
         this.provides = provides;
         this.packages = packages;
         this.mainClass = mainClass;
-        this.osName = osName;
-        this.osArch = osArch;
-        this.osVersion = osVersion;
         this.hash = hashCode;
     }
 
     /**
-     * <p> The module name. </p>
+     * <p> Returns the module name. </p>
      *
      * @return The module name
      */
@@ -1146,11 +1319,19 @@
     }
 
     /**
+     * <p> Returns the set of module modifiers. </p>
+     *
+     * @return A possibly-empty unmodifiable set of modifiers
+     */
+    public Set<Modifier> modifiers() {
+        return modifiers;
+    }
+
+    /**
      * <p> Returns {@code true} if this is an open module. </p>
      *
-     * <p> An open module does not declare any open packages (the {@link #opens()
-     * opens} method returns an empty set) but the resulting module is treated
-     * as if all packages are open. </p>
+     * <p> This method is equivalent to testing if the set of {@link #modifiers
+     * modifiers} contains the {@link Modifier#OPEN OPEN} modifier. </p>
      *
      * @return  {@code true} if this is an open module
      */
@@ -1161,12 +1342,8 @@
     /**
      * <p> Returns {@code true} if this is an automatic module. </p>
      *
-     * <p> An automatic module is defined implicitly rather than explicitly
-     * and therefore does not have a module declaration. JAR files located on
-     * the application module path, or by the {@link ModuleFinder} returned by
-     * {@link ModuleFinder#of(java.nio.file.Path[]) ModuleFinder.of}, are
-     * treated as automatic modules if they do have not have a module
-     * declaration. </p>
+     * <p> This method is equivalent to testing if the set of {@link #modifiers
+     * modifiers} contains the {@link Modifier#OPEN AUTOMATIC} modifier. </p>
      *
      * @return  {@code true} if this is an automatic module
      */
@@ -1175,20 +1352,13 @@
     }
 
     /**
-     * <p> Returns {@code true} if this module descriptor was not generated
-     * from an explicit module declaration ({@code module-info.java})
-     * or an implicit module declaration (an {@link #isAutomatic() automatic}
-     * module). </p>
+     * <p> Returns the set of {@code Requires} objects representing the module
+     * dependences. </p>
      *
-     * @return  {@code true} if this module descriptor was not generated by
-     *          an explicit or implicit module declaration
-     */
-    public boolean isSynthetic() {
-        return synthetic;
-    }
-
-    /**
-     * <p> The dependences of this module. </p>
+     * <p> The set includes a dependency on "{@code java.base}" when this
+     * module is not named "{@code java.base}". If this module is an automatic
+     * module then it does not have a dependency on any module other than
+     * "{@code java.base}". </p>
      *
      * @return  A possibly-empty unmodifiable set of {@link Requires} objects
      */
@@ -1197,7 +1367,11 @@
     }
 
     /**
-     * <p> The module exports. </p>
+     * <p> Returns the set of {@code Exports} objects representing the exported
+     * packages. </p>
+     *
+     * <p> If this module is an automatic module then the set of exports
+     * is empty. </p>
      *
      * @return  A possibly-empty unmodifiable set of exported packages
      */
@@ -1206,16 +1380,11 @@
     }
 
     /**
-     * <p> The module <em>opens</em> directives. </p>
+     * <p> Returns the set of {@code Opens} objects representing the open
+     * packages. </p>
      *
-     * <p> Each {@code Opens} object in the set represents a package (and
-     * the set of target module names when qualified) where all types in the
-     * package, and all their members, not just public types and their public
-     * members, can be reflected on when using APIs that bypass or suppress
-     * default Java language access control checks. </p>
-     *
-     * <p> This method returns an empty set when invoked on {@link #isOpen()
-     * open} module. </p>
+     * <p> If this module is an open module or an automatic module then the
+     * set of open packages is empty. </p>
      *
      * @return  A possibly-empty unmodifiable set of open packages
      */
@@ -1224,7 +1393,10 @@
     }
 
     /**
-     * <p> The service dependences of this module. </p>
+     * <p> Returns the set of service dependences. </p>
+     *
+     * <p> If this module is an automatic module then the set of service
+     * dependences is empty. </p>
      *
      * @return  A possibly-empty unmodifiable set of the fully qualified class
      *          names of the service types used
@@ -1234,7 +1406,8 @@
     }
 
     /**
-     * <p> The services that this module provides. </p>
+     * <p> Returns the set of {@code Provides} objects representing the
+     * services that the module provides. </p>
      *
      * @return The possibly-empty unmodifiable set of the services that this
      *         module provides
@@ -1244,20 +1417,39 @@
     }
 
     /**
-     * Returns this module's version.
+     * <p> Returns the module version. </p>
      *
-     * @return This module's version
+     * @return This module's version, or an empty {@code Optional} if the
+     *         module does not have a version or the version is
+     *         {@linkplain Version#parse(String) unparseable}
      */
     public Optional<Version> version() {
         return Optional.ofNullable(version);
     }
 
     /**
-     * Returns a string containing this module's name and, if present, its
-     * version.
+     * <p> Returns the string with the possibly-unparseable version of the
+     * module </p>
      *
-     * @return A string containing this module's name and, if present, its
-     *         version.
+     * @return The string containing the version of the module or an empty
+     *         {@code Optional} if the module does not have a version
+     *
+     * @see #version()
+     */
+    public Optional<String> rawVersion() {
+        if (version != null) {
+            return Optional.of(version.toString());
+        } else {
+            return Optional.ofNullable(rawVersionString);
+        }
+    }
+
+    /**
+     * <p> Returns a string containing the module name and, if present, its
+     * version. </p>
+     *
+     * @return A string containing the module name and, if present, its
+     *         version
      */
     public String toNameAndVersion() {
         if (version != null) {
@@ -1268,51 +1460,22 @@
     }
 
     /**
-     * Returns the module's main class.
+     * <p> Returns the module main class. </p>
      *
-     * @return The fully qualified class name of this module's main class
+     * @return The fully qualified class name of the module's main class
      */
     public Optional<String> mainClass() {
         return Optional.ofNullable(mainClass);
     }
 
     /**
-     * Returns the operating system name if this module is operating system
-     * specific.
+     * Returns the set of packages in the module.
      *
-     * @return The operating system name or an empty {@code Optional}
-     *         if this module is not operating system specific
-     */
-    public Optional<String> osName() {
-        return Optional.ofNullable(osName);
-    }
-
-    /**
-     * Returns the operating system architecture if this module is operating
-     * system architecture specific.
+     * <p> The set of packages includes all exported and open packages, as well
+     * as the packages of any service providers, and the package for the main
+     * class. </p>
      *
-     * @return The operating system architecture or an empty {@code Optional}
-     *         if this module is not operating system architecture specific
-     */
-    public Optional<String> osArch() {
-        return Optional.ofNullable(osArch);
-    }
-
-    /**
-     * Returns the operating system version if this module is operating
-     * system version specific.
-     *
-     * @return The operating system version or an empty {@code Optional}
-     *         if this module is not operating system version specific
-     */
-    public Optional<String> osVersion() {
-        return Optional.ofNullable(osVersion);
-    }
-
-    /**
-     * Returns the names of all packages in this module.
-     *
-     * @return A possibly-empty unmodifiable set of all packages in the module
+     * @return A possibly-empty unmodifiable set of the packages in the module
      */
     public Set<String> packages() {
         return packages;
@@ -1320,77 +1483,81 @@
 
 
     /**
-     * A builder used for building {@link ModuleDescriptor} objects.
+     * A builder for building {@link ModuleDescriptor} objects.
      *
-     * <p> {@code ModuleDescriptor} defines the {@link #module module}, {@link
-     * #openModule openModule}, and {@link #automaticModule automaticModule}
-     * methods to create builders for building different kinds of modules. </p>
+     * <p> {@code ModuleDescriptor} defines the {@link #newModule newModule},
+     * {@link #newOpenModule newOpenModule}, and {@link #newAutomaticModule
+     * newAutomaticModule} methods to create builders for building
+     * <em>normal</em>, open, and automatic modules. </p>
+     *
+     * <p> The set of packages in the module are accumulated by the {@code
+     * Builder} as the {@link ModuleDescriptor.Builder#exports(String) exports},
+     * {@link ModuleDescriptor.Builder#opens(String) opens},
+     * {@link ModuleDescriptor.Builder#packages(Set) packages},
+     * {@link ModuleDescriptor.Builder#provides(String,List) provides}, and
+     * {@link ModuleDescriptor.Builder#mainClass(String) mainClass} methods are
+     * invoked. </p>
+     *
+     * <p> The module names, package names, and class names that are parameters
+     * specified to the builder methods are the module names, package names,
+     * and qualified names of classes (in named packages) as defined in the
+     * <cite>The Java&trade; Language Specification</cite>. </p>
      *
      * <p> Example usage: </p>
-     * <pre>{@code    ModuleDescriptor descriptor = ModuleDescriptor.module("m1")
-     *         .exports("p")
-     *         .requires("m2")
+     * <pre>{@code    ModuleDescriptor descriptor = ModuleDescriptor.newModule("stats.core")
+     *         .requires("java.base")
+     *         .exports("org.acme.stats.core.clustering")
+     *         .exports("org.acme.stats.core.regression")
+     *         .packages(Set.of("org.acme.stats.core.internal"))
      *         .build();
      * }</pre>
      *
      * @apiNote A {@code Builder} checks the components and invariants as
-     * components are added to the builder. The rational for this is to detect
+     * components are added to the builder. The rationale for this is to detect
      * errors as early as possible and not defer all validation to the
-     * {@link #build build} method. A {@code Builder} cannot be used to create
-     * a {@link ModuleDescriptor#isSynthetic() synthetic} module.
+     * {@link #build build} method.
      *
      * @since 9
+     * @spec JPMS
      */
     public static final class Builder {
         final String name;
-        final boolean strict; // true if module names are checked
+        final boolean strict;
+        final Set<Modifier> modifiers;
         final boolean open;
-        final boolean synthetic;
-        boolean automatic;
+        final boolean automatic;
+        final Set<String> packages = new HashSet<>();
         final Map<String, Requires> requires = new HashMap<>();
         final Map<String, Exports> exports = new HashMap<>();
         final Map<String, Opens> opens = new HashMap<>();
-        final Set<String> concealedPackages = new HashSet<>();
         final Set<String> uses = new HashSet<>();
         final Map<String, Provides> provides = new HashMap<>();
         Version version;
-        String osName;
-        String osArch;
-        String osVersion;
+        String rawVersionString;
         String mainClass;
 
         /**
          * Initializes a new builder with the given module name.
          *
-         * @param strict
-         *        Indicates whether module names are checked or not
+         * If {@code strict} is {@code true} then module, package, and class
+         * names are checked to ensure they are legal names. In addition, the
+         * {@link #build buid} method will add "{@code requires java.base}" if
+         * the dependency is not declared.
          */
-        Builder(String name, boolean strict, boolean open, boolean synthetic) {
+        Builder(String name, boolean strict, Set<Modifier> modifiers) {
             this.name = (strict) ? requireModuleName(name) : name;
             this.strict = strict;
-            this.open = open;
-            this.synthetic = synthetic;
-        }
-
-        /* package */ Builder automatic(boolean automatic) {
-            this.automatic = automatic;
-            return this;
+            this.modifiers = modifiers;
+            this.open = modifiers.contains(Modifier.OPEN);
+            this.automatic = modifiers.contains(Modifier.AUTOMATIC);
+            assert !open || !automatic;
         }
 
         /**
-         * Returns the set of packages that are exported (unconditionally or
-         * unconditionally).
+         * Returns a snapshot of the packages in the module.
          */
-        /* package */ Set<String> exportedPackages() {
-            return exports.keySet();
-        }
-
-        /**
-         * Returns the set of packages that are opened (unconditionally or
-         * unconditionally).
-         */
-        /* package */Set<String> openPackages() {
-            return opens.keySet();
+        /* package */ Set<String> packages() {
+            return Collections.unmodifiableSet(packages);
         }
 
         /**
@@ -1406,8 +1573,12 @@
          *         initialized to build
          * @throws IllegalStateException
          *         If the dependence on the module has already been declared
+         *         or this builder is for an automatic module
          */
         public Builder requires(Requires req) {
+            if (automatic)
+                throw new IllegalStateException("Automatic modules cannot declare"
+                                                + " dependences");
             String mn = req.name();
             if (name.equals(mn))
                 throw new IllegalArgumentException("Dependence on self");
@@ -1433,11 +1604,12 @@
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If the module name is {@code null}, is not a legal Java
-         *         identifier, or is equal to the module name that this builder
+         *         If the module name is {@code null}, is not a legal module
+         *         name, or is equal to the module name that this builder
          *         was initialized to build
          * @throws IllegalStateException
          *         If the dependence on the module has already been declared
+         *         or this builder is for an automatic module
          */
         public Builder requires(Set<Requires.Modifier> ms,
                                 String mn,
@@ -1445,7 +1617,21 @@
             Objects.requireNonNull(compiledVersion);
             if (strict)
                 mn = requireModuleName(mn);
-            return requires(new Requires(ms, mn, compiledVersion));
+            return requires(new Requires(ms, mn, compiledVersion, null));
+        }
+
+        /* package */Builder requires(Set<Requires.Modifier> ms,
+                                      String mn,
+                                      String rawCompiledVersion) {
+            Requires r;
+            try {
+                Version v = Version.parse(rawCompiledVersion);
+                r = new Requires(ms, mn, v, null);
+            } catch (IllegalArgumentException e) {
+                if (strict) throw e;
+                r = new Requires(ms, mn, null, rawCompiledVersion);
+            }
+            return requires(r);
         }
 
         /**
@@ -1460,16 +1646,17 @@
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If the module name is {@code null}, is not a legal Java
-         *         identifier, or is equal to the module name that this builder
+         *         If the module name is {@code null}, is not a legal module
+         *         name, or is equal to the module name that this builder
          *         was initialized to build
          * @throws IllegalStateException
          *         If the dependence on the module has already been declared
+         *         or this builder is for an automatic module
          */
         public Builder requires(Set<Requires.Modifier> ms, String mn) {
             if (strict)
                 mn = requireModuleName(mn);
-            return requires(new Requires(ms, mn, null));
+            return requires(new Requires(ms, mn, null, null));
         }
 
         /**
@@ -1481,18 +1668,19 @@
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If the module name is {@code null}, is not a legal Java
-         *         identifier, or is equal to the module name that this builder
+         *         If the module name is {@code null}, is not a legal module
+         *         name, or is equal to the module name that this builder
          *         was initialized to build
          * @throws IllegalStateException
          *         If the dependence on the module has already been declared
+         *         or this builder is for an automatic module
          */
         public Builder requires(String mn) {
             return requires(EnumSet.noneOf(Requires.Modifier.class), mn);
         }
 
         /**
-         * Adds an export.
+         * Adds an exported package.
          *
          * @param  e
          *         The export
@@ -1500,29 +1688,27 @@
          * @return This builder
          *
          * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method or the package is already
-         *         declared as exported
+         *         If the {@link Exports#source package} is already declared as
+         *         exported or this builder is for an automatic module
          */
         public Builder exports(Exports e) {
-            // can't be exported and concealed
-            String source = e.source();
-            if (concealedPackages.contains(source)) {
-                throw new IllegalStateException("Package " + source
-                                                 + " already declared");
+            if (automatic) {
+                throw new IllegalStateException("Automatic modules cannot declare"
+                                                 + " exported packages");
             }
+            String source = e.source();
             if (exports.containsKey(source)) {
                 throw new IllegalStateException("Exported package " + source
                                                  + " already declared");
             }
-
             exports.put(source, e);
+            packages.add(source);
             return this;
         }
 
         /**
-         * Adds an export, with the given (and possibly empty) set of modifiers,
-         * to export a package to a set of target modules.
+         * Adds an exported package with the given (and possibly empty) set of
+         * modifiers. The package is exported to a set of target modules.
          *
          * @param  ms
          *         The set of modifiers
@@ -1534,33 +1720,34 @@
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If the package name or any of the target modules is {@code
-         *         null} or is not a legal Java identifier, or the set of
-         *         targets is empty
+         *         If the package name is {@code null} or is not a legal
+         *         package name, the set of target modules is empty, or the set
+         *         of target modules contains a name that is not a legal module
+         *         name
          * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method or the package is already
-         *         declared as exported
+         *         If the package is already declared as exported
+         *         or this builder is for an automatic module
          */
         public Builder exports(Set<Exports.Modifier> ms,
                                String pn,
                                Set<String> targets)
         {
-            Exports e = new Exports(ms, requirePackageName(pn), targets);
+            Exports e = new Exports(ms, pn, targets);
 
             // check targets
             targets = e.targets();
             if (targets.isEmpty())
                 throw new IllegalArgumentException("Empty target set");
-            if (strict)
+            if (strict) {
+                requirePackageName(e.source());
                 targets.stream().forEach(Checks::requireModuleName);
-
+            }
             return exports(e);
         }
 
         /**
-         * Adds an unqualified export with the given (and possibly empty) set
-         * of modifiers.
+         * Adds an exported package with the given (and possibly empty) set of
+         * modifiers. The package is exported to all modules.
          *
          * @param  ms
          *         The set of modifiers
@@ -1570,160 +1757,22 @@
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If the package name is {@code null} or is not a legal Java
-         *         identifier
+         *         If the package name is {@code null} or is not a legal
+         *         package name
          * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method or the package is already
-         *         declared as exported
+         *         If the package is already declared as exported
+         *         or this builder is for an automatic module
          */
         public Builder exports(Set<Exports.Modifier> ms, String pn) {
-            Exports e = new Exports(ms, requirePackageName(pn), Collections.emptySet());
+            if (strict) {
+                requirePackageName(pn);
+            }
+            Exports e = new Exports(ms, pn, Collections.emptySet());
             return exports(e);
         }
 
         /**
-         * Adds an export to export a package to a set of target modules.
-         *
-         * @param  pn
-         *         The package name
-         * @param  targets
-         *         The set of target modules names
-         *
-         * @return This builder
-         *
-         * @throws IllegalArgumentException
-         *         If the package name or any of the target modules is {@code
-         *         null} or is not a legal Java identifier, or the set of
-         *         targets is empty
-         * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method or the package is already
-         *         declared as exported
-         */
-        public Builder exports(String pn, Set<String> targets) {
-            return exports(Collections.emptySet(), pn, targets);
-        }
-
-        /**
-         * Adds an unqualified export.
-         *
-         * @param  pn
-         *         The package name
-         *
-         * @return This builder
-         *
-         * @throws IllegalArgumentException
-         *         If the package name is {@code null} or is not a legal Java
-         *         identifier
-         * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method or the package is already
-         *         declared as exported
-         */
-        public Builder exports(String pn) {
-            return exports(Collections.emptySet(), pn);
-        }
-
-        /**
-         * Adds an <em>opens</em> directive.
-         *
-         * @param  obj
-         *         The {@code Opens} object
-         *
-         * @return This builder
-         *
-         * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method, the package is already
-         *         declared as open, or this is a builder for an open module
-         */
-        public Builder opens(Opens obj) {
-            if (open) {
-                throw new IllegalStateException("open modules cannot declare"
-                                                + " open packages");
-            }
-
-            // can't be open and concealed
-            String source = obj.source();
-            if (concealedPackages.contains(source)) {
-                throw new IllegalStateException("Package " + source
-                                                + " already declared");
-            }
-            if (opens.containsKey(source)) {
-                throw new IllegalStateException("Open package " + source
-                                                + " already declared");
-            }
-
-            opens.put(source, obj);
-            return this;
-        }
-
-
-        /**
-         * Adds an <em>opens</em> directive, with the given (and possibly empty)
-         * set of modifiers, to open a package to a set of target modules.
-         *
-         * @param  ms
-         *         The set of modifiers
-         * @param  pn
-         *         The package name
-         * @param  targets
-         *         The set of target modules names
-         *
-         * @return This builder
-         *
-         * @throws IllegalArgumentException
-         *         If the package name or any of the target modules is {@code
-         *         null} or is not a legal Java identifier, or the set of
-         *         targets is empty
-         * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method, the package is already
-         *         declared as open, or this is a builder for an open module
-         */
-        public Builder opens(Set<Opens.Modifier> ms,
-                             String pn,
-                             Set<String> targets)
-        {
-            Opens e = new Opens(ms, requirePackageName(pn), targets);
-
-            // check targets
-            targets = e.targets();
-            if (targets.isEmpty())
-                throw new IllegalArgumentException("Empty target set");
-            if (strict)
-                targets.stream().forEach(Checks::requireModuleName);
-
-            return opens(e);
-        }
-
-        /**
-         * Adds an <em>opens</em> directive to open a package with the given (and
-         * possibly empty) set of modifiers.
-         *
-         * @param  ms
-         *         The set of modifiers
-         * @param  pn
-         *         The package name
-         *
-         * @return This builder
-         *
-         * @throws IllegalArgumentException
-         *         If the package name is {@code null} or is not a legal Java
-         *         identifier
-         * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method, the package is already
-         *         declared as open, or this is a builder for an open module
-         */
-        public Builder opens(Set<Opens.Modifier> ms, String pn) {
-            Opens e = new Opens(ms, requirePackageName(pn), Collections.emptySet());
-            return opens(e);
-        }
-
-        /**
-         * Adds an <em>opens</em> directive to open a package to a set of target
+         * Adds an exported package. The package is exported to a set of target
          * modules.
          *
          * @param  pn
@@ -1734,20 +1783,20 @@
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If the package name or any of the target modules is {@code
-         *         null} or is not a legal Java identifier, or the set of
-         *         targets is empty
+         *         If the package name is {@code null} or is not a legal
+         *         package name, the set of target modules is empty, or the set
+         *         of target modules contains a name that is not a legal module
+         *         name
          * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method, the package is already
-         *         declared as open, or this is a builder for an open module
+         *         If the package is already declared as exported
+         *         or this builder is for an automatic module
          */
-        public Builder opens(String pn, Set<String> targets) {
-            return opens(Collections.emptySet(), pn, targets);
+        public Builder exports(String pn, Set<String> targets) {
+            return exports(Collections.emptySet(), pn, targets);
         }
 
         /**
-         * Adds an <em>opens</em> directive to open a package.
+         * Adds an exported package. The package is exported to all modules.
          *
          * @param  pn
          *         The package name
@@ -1755,12 +1804,146 @@
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If the package name is {@code null} or is not a legal Java
-         *         identifier
+         *         If the package name is {@code null} or is not a legal
+         *         package name
          * @throws IllegalStateException
-         *         If the package is already declared as a package with the
-         *         {@link #contains contains} method, the package is already
-         *         declared as open, or this is a builder for an open module
+         *         If the package is already declared as exported
+         *         or this builder is for an automatic module
+         */
+        public Builder exports(String pn) {
+            return exports(Collections.emptySet(), pn);
+        }
+
+        /**
+         * Adds an open package.
+         *
+         * @param  obj
+         *         The {@code Opens} object
+         *
+         * @return This builder
+         *
+         * @throws IllegalStateException
+         *         If the package is already declared as open, or this is a
+         *         builder for an open module or automatic module
+         */
+        public Builder opens(Opens obj) {
+            if (open || automatic) {
+                throw new IllegalStateException("Open or automatic modules cannot"
+                                                + " declare open packages");
+            }
+            String source = obj.source();
+            if (opens.containsKey(source)) {
+                throw new IllegalStateException("Open package " + source
+                                                + " already declared");
+            }
+            opens.put(source, obj);
+            packages.add(source);
+            return this;
+        }
+
+
+        /**
+         * Adds an open package with the given (and possibly empty) set of
+         * modifiers. The package is open to a set of target modules.
+         *
+         * @param  ms
+         *         The set of modifiers
+         * @param  pn
+         *         The package name
+         * @param  targets
+         *         The set of target modules names
+         *
+         * @return This builder
+         *
+         * @throws IllegalArgumentException
+         *         If the package name is {@code null} or is not a legal
+         *         package name, the set of target modules is empty, or the set
+         *         of target modules contains a name that is not a legal module
+         *         name
+         * @throws IllegalStateException
+         *         If the package is already declared as open, or this is a
+         *         builder for an open module or automatic module
+         */
+        public Builder opens(Set<Opens.Modifier> ms,
+                             String pn,
+                             Set<String> targets)
+        {
+            Opens opens = new Opens(ms, pn, targets);
+
+            // check targets
+            targets = opens.targets();
+            if (targets.isEmpty())
+                throw new IllegalArgumentException("Empty target set");
+            if (strict) {
+                requirePackageName(opens.source());
+                targets.stream().forEach(Checks::requireModuleName);
+            }
+            return opens(opens);
+        }
+
+        /**
+         * Adds an open package with the given (and possibly empty) set of
+         * modifiers. The package is open to all modules.
+         *
+         * @param  ms
+         *         The set of modifiers
+         * @param  pn
+         *         The package name
+         *
+         * @return This builder
+         *
+         * @throws IllegalArgumentException
+         *         If the package name is {@code null} or is not a legal
+         *         package name
+         * @throws IllegalStateException
+         *         If the package is already declared as open, or this is a
+         *         builder for an open module or automatic module
+         */
+        public Builder opens(Set<Opens.Modifier> ms, String pn) {
+            if (strict) {
+                requirePackageName(pn);
+            }
+            Opens e = new Opens(ms, pn, Collections.emptySet());
+            return opens(e);
+        }
+
+        /**
+         * Adds an open package. The package is open to a set of target modules.
+         *
+         * @param  pn
+         *         The package name
+         * @param  targets
+         *         The set of target modules names
+         *
+         * @return This builder
+         *
+         * @throws IllegalArgumentException
+         *         If the package name is {@code null} or is not a legal
+         *         package name, the set of target modules is empty, or the set
+         *         of target modules contains a name that is not a legal module
+         *         name
+         * @throws IllegalStateException
+         *         If the package is already declared as open, or this is a
+         *         builder for an open module or automatic module
+         */
+        public Builder opens(String pn, Set<String> targets) {
+            return opens(Collections.emptySet(), pn, targets);
+        }
+
+        /**
+         * Adds an open package. The package is open to all modules.
+         *
+         * @param  pn
+         *         The package name
+         *
+         * @return This builder
+         *
+         * @throws IllegalArgumentException
+         *         If the package name is {@code null} or is not a legal
+         *         package name
+         * @throws IllegalStateException
+         *         If the package is already declared as open, or this is a
+         *         builder for an open module or automatic module
          */
         public Builder opens(String pn) {
             return opens(Collections.emptySet(), pn);
@@ -1775,12 +1958,16 @@
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If the service type is {@code null} or is not a legal Java
-         *         identifier
+         *         If the service type is {@code null} or not a qualified name of
+         *         a class in a named package
          * @throws IllegalStateException
          *         If a dependency on the service type has already been declared
+         *         or this is a builder for an automatic module
          */
         public Builder uses(String service) {
+            if (automatic)
+                throw new IllegalStateException("Automatic modules can not declare"
+                                                + " service dependences");
             if (uses.contains(requireServiceTypeName(service)))
                 throw new IllegalStateException("Dependence upon service "
                                                 + service + " already declared");
@@ -1789,7 +1976,9 @@
         }
 
         /**
-         * Provides a service with one or more implementations.
+         * Provides a service with one or more implementations. The package for
+         * each {@link Provides#providers provider} (or provider factory) is
+         * added to the module if not already added.
          *
          * @param  p
          *         The provides
@@ -1801,16 +1990,18 @@
          *         declared
          */
         public Builder provides(Provides p) {
-            String st = p.service();
-            if (provides.containsKey(st))
+            String service = p.service();
+            if (provides.containsKey(service))
                 throw new IllegalStateException("Providers of service "
-                                                + st + " already declared");
-            provides.put(st, p);
+                                                + service + " already declared");
+            provides.put(service, p);
+            p.providers().forEach(name -> packages.add(packageName(name)));
             return this;
         }
 
         /**
-         * Provides implementations of a service.
+         * Provides implementations of a service. The package for each provider
+         * (or provider factory) is added to the module if not already added.
          *
          * @param  service
          *         The service type
@@ -1821,103 +2012,59 @@
          *
          * @throws IllegalArgumentException
          *         If the service type or any of the provider class names is
-         *         {@code null} or is not a legal Java identifier, or the list
-         *         of provider class names is empty
+         *         {@code null} or not a qualified name of a class in a named
+         *         package, or the list of provider class names is empty
          * @throws IllegalStateException
          *         If the providers for the service type have already been
          *         declared
          */
         public Builder provides(String service, List<String> providers) {
-            if (provides.containsKey(service))
-                throw new IllegalStateException("Providers of service "
-                                                + service + " already declared by " + name);
-
-            Provides p = new Provides(requireServiceTypeName(service), providers);
+            Provides p = new Provides(service, providers);
 
             // check providers after the set has been copied.
             List<String> providerNames = p.providers();
             if (providerNames.isEmpty())
                 throw new IllegalArgumentException("Empty providers set");
-            providerNames.forEach(Checks::requireServiceProviderName);
-            provides.put(service, p);
-            return this;
+            if (strict) {
+                requireServiceTypeName(p.service());
+                providerNames.forEach(Checks::requireServiceProviderName);
+            } else {
+                // Disallow service/providers in unnamed package
+                String pn = packageName(service);
+                if (pn.isEmpty()) {
+                    throw new IllegalArgumentException(service
+                                                       + ": unnamed package");
+                }
+                for (String name : providerNames) {
+                    pn = packageName(name);
+                    if (pn.isEmpty()) {
+                        throw new IllegalArgumentException(name
+                                                           + ": unnamed package");
+                    }
+                }
+            }
+            return provides(p);
         }
 
         /**
-         * Provides an implementation of a service.
-         *
-         * @param  service
-         *         The service type
-         * @param  provider
-         *         The provider or provider factory class name
-         *
-         * @return This builder
-         *
-         * @throws IllegalArgumentException
-         *         If the service type or the provider class name is {@code
-         *         null} or is not a legal Java identifier
-         * @throws IllegalStateException
-         *         If the providers for the service type have already been
-         *         declared
-         */
-        public Builder provides(String service, String provider) {
-            if (provider == null)
-                throw new IllegalArgumentException("'provider' is null");
-            return provides(service, List.of(provider));
-        }
-
-        /**
-         * Adds a (possible empty) set of packages to the module
+         * Adds packages to the module. All packages in the set of package names
+         * that are not in the module are added to module.
          *
          * @param  pns
-         *         The set of package names
+         *         The (possibly empty) set of package names
          *
          * @return This builder
          *
          * @throws IllegalArgumentException
          *         If any of the package names is {@code null} or is not a
-         *         legal Java identifier
-         * @throws IllegalStateException
-         *         If any of packages are already declared as packages in
-         *         the module. This includes packages that are already
-         *         declared as exported or open packages.
+         *         legal package name
          */
-        public Builder contains(Set<String> pns) {
-            pns.forEach(this::contains);
-            return this;
-        }
-
-        /**
-         * Adds a package to the module.
-         *
-         * @param  pn
-         *         The package name
-         *
-         * @return This builder
-         *
-         * @throws IllegalArgumentException
-         *         If the package name is {@code null}, or is not a legal Java
-         *         identifier
-         * @throws IllegalStateException
-         *         If the package is already declared as a package in the
-         *         module. This includes the package already declared as an
-         *         exported or open package.
-         */
-        public Builder contains(String pn) {
-            Checks.requirePackageName(pn);
-            if (concealedPackages.contains(pn)) {
-                throw new IllegalStateException("Package " + pn
-                                                + " already declared");
+        public Builder packages(Set<String> pns) {
+            if (strict) {
+                pns = new HashSet<>(pns);
+                pns.forEach(Checks::requirePackageName);
             }
-            if (exports.containsKey(pn)) {
-                throw new IllegalStateException("Exported package "
-                                                + pn + " already declared");
-            }
-            if (opens.containsKey(pn)) {
-                throw new IllegalStateException("Open package "
-                                                 + pn + " already declared");
-            }
-            concealedPackages.add(pn);
+            this.packages.addAll(pns);
             return this;
         }
 
@@ -1931,28 +2078,41 @@
          */
         public Builder version(Version v) {
             version = requireNonNull(v);
+            rawVersionString = null;
             return this;
         }
 
         /**
          * Sets the module version.
          *
-         * @param  v
+         * @param  vs
          *         The version string to parse
          *
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If {@code v} is null or cannot be parsed as a version string
+         *         If {@code vs} is {@code null} or cannot be parsed as a
+         *         version string
          *
          * @see Version#parse(String)
          */
-        public Builder version(String v) {
-            return version(Version.parse(v));
+        public Builder version(String vs) {
+            try {
+                version = Version.parse(vs);
+                rawVersionString = null;
+            } catch (IllegalArgumentException e) {
+                if (strict) throw e;
+                version = null;
+                rawVersionString = vs;
+            }
+            return this;
         }
 
         /**
-         * Sets the module main class.
+         * Sets the module main class. The package for the main class is added
+         * to the module if not already added. In other words, this method is
+         * equivalent to first invoking this builder's {@link #packages(Set)
+         * packages} method to add the package name of the main class.
          *
          * @param  mc
          *         The module main class
@@ -1960,100 +2120,67 @@
          * @return This builder
          *
          * @throws IllegalArgumentException
-         *         If {@code mainClass} is null or is not a legal Java identifier
+         *         If {@code mainClass} is {@code null} or not a qualified
+         *         name of a class in a named package
          */
         public Builder mainClass(String mc) {
-            mainClass = requireBinaryName("main class name", mc);
-            return this;
-        }
-
-        /**
-         * Sets the operating system name.
-         *
-         * @param  name
-         *         The operating system name
-         *
-         * @return This builder
-         *
-         * @throws IllegalArgumentException
-         *         If {@code name} is null or the empty String
-         */
-        public Builder osName(String name) {
-            if (name == null || name.isEmpty())
-                throw new IllegalArgumentException("OS name is null or empty");
-            osName = name;
-            return this;
-        }
-
-        /**
-         * Sets the operating system architecture.
-         *
-         * @param  arch
-         *         The operating system architecture
-         *
-         * @return This builder
-         *
-         * @throws IllegalArgumentException
-         *         If {@code name} is null or the empty String
-         */
-        public Builder osArch(String arch) {
-            if (arch == null || arch.isEmpty())
-                throw new IllegalArgumentException("OS arch is null or empty");
-            osArch = arch;
-            return this;
-        }
-
-        /**
-         * Sets the operating system version.
-         *
-         * @param  version
-         *         The operating system version
-         *
-         * @return This builder
-         *
-         * @throws IllegalArgumentException
-         *         If {@code name} is null or the empty String
-         */
-        public Builder osVersion(String version) {
-            if (version == null || version.isEmpty())
-                throw new IllegalArgumentException("OS version is null or empty");
-            osVersion = version;
+            String pn;
+            if (strict) {
+                mc = requireQualifiedClassName("main class name", mc);
+                pn = packageName(mc);
+                assert !pn.isEmpty();
+            } else {
+                // Disallow main class in unnamed package
+                pn = packageName(mc);
+                if (pn.isEmpty()) {
+                    throw new IllegalArgumentException(mc + ": unnamed package");
+                }
+            }
+            packages.add(pn);
+            mainClass = mc;
             return this;
         }
 
         /**
          * Builds and returns a {@code ModuleDescriptor} from its components.
          *
+         * <p> The module will require "{@code java.base}" even if the dependence
+         * has not been declared (the exception is when building a module named
+         * "{@code java.base}" as it cannot require itself). The dependence on
+         * "{@code java.base}" will have the {@link
+         * java.lang.module.ModuleDescriptor.Requires.Modifier#MANDATED MANDATED}
+         * modifier if the dependence was not declared. </p>
+         *
          * @return The module descriptor
          */
         public ModuleDescriptor build() {
             Set<Requires> requires = new HashSet<>(this.requires.values());
-
-            Set<String> packages = new HashSet<>();
-            packages.addAll(exports.keySet());
-            packages.addAll(opens.keySet());
-            packages.addAll(concealedPackages);
-
             Set<Exports> exports = new HashSet<>(this.exports.values());
             Set<Opens> opens = new HashSet<>(this.opens.values());
 
+            // add dependency on java.base
+            if (strict
+                    && !name.equals("java.base")
+                    && !this.requires.containsKey("java.base")) {
+                requires.add(new Requires(Set.of(Requires.Modifier.MANDATED),
+                                          "java.base",
+                                          null,
+                                          null));
+            }
+
             Set<Provides> provides = new HashSet<>(this.provides.values());
 
             return new ModuleDescriptor(name,
                                         version,
-                                        open,
-                                        automatic,
-                                        synthetic,
+                                        rawVersionString,
+                                        modifiers,
                                         requires,
                                         exports,
                                         opens,
                                         uses,
                                         provides,
                                         packages,
-                                        mainClass,
-                                        osName,
-                                        osArch,
-                                        osVersion);
+                                        mainClass);
         }
 
     }
@@ -2062,16 +2189,22 @@
      * Compares this module descriptor to another.
      *
      * <p> Two {@code ModuleDescriptor} objects are compared by comparing their
-     * module name lexicographically.  Where the module names are equal then
-     * the versions, if present, are compared. </p>
-     *
-     * @apiNote For now, the natural ordering is not consistent with equals.
-     * If two module descriptors have equal module names, equal versions if
-     * present, but their corresponding components are not equal, then they
-     * will be considered equal by this method.
+     * module names lexicographically. Where the module names are equal then the
+     * module versions are compared. When comparing the module versions then a
+     * module descriptor with a version is considered to succeed a module
+     * descriptor that does not have a version. If both versions are {@linkplain
+     * Version#parse(String) unparseable} then the {@linkplain #rawVersion()
+     * raw version strings} are compared lexicographically. Where the module names
+     * are equal and the versions are equal (or not present in both), then the
+     * set of modifiers are compared. Sets of modifiers are compared by comparing
+     * a <em>binary value</em> computed for each set. If a modifier is present
+     * in the set then the bit at the position of its ordinal is {@code 1}
+     * in the binary value, otherwise {@code 0}. If the two set of modifiers
+     * are also equal then the other components of the module descriptors are
+     * compared in a manner that is consistent with {@code equals}. </p>
      *
      * @param  that
-     *         The object to which this module descriptor is to be compared
+     *         The module descriptor to compare
      *
      * @return A negative integer, zero, or a positive integer if this module
      *         descriptor is less than, equal to, or greater than the given
@@ -2079,16 +2212,44 @@
      */
     @Override
     public int compareTo(ModuleDescriptor that) {
+        if (this == that) return 0;
+
         int c = this.name().compareTo(that.name());
         if (c != 0) return c;
-        if (version == null) {
-            if (that.version == null)
-                return 0;
-            return -1;
-        }
-        if (that.version == null)
-            return +1;
-        return version.compareTo(that.version);
+
+        c = compare(this.version, that.version);
+        if (c != 0) return c;
+
+        c = compare(this.rawVersionString, that.rawVersionString);
+        if (c != 0) return c;
+
+        long v1 = modsValue(this.modifiers());
+        long v2 = modsValue(that.modifiers());
+        c = Long.compare(v1, v2);
+        if (c != 0) return c;
+
+        c = compare(this.requires, that.requires);
+        if (c != 0) return c;
+
+        c = compare(this.packages, that.packages);
+        if (c != 0) return c;
+
+        c = compare(this.exports, that.exports);
+        if (c != 0) return c;
+
+        c = compare(this.opens, that.opens);
+        if (c != 0) return c;
+
+        c = compare(this.uses, that.uses);
+        if (c != 0) return c;
+
+        c = compare(this.provides, that.provides);
+        if (c != 0) return c;
+
+        c = compare(this.mainClass, that.mainClass);
+        if (c != 0) return c;
+
+        return 0;
     }
 
     /**
@@ -2115,24 +2276,18 @@
             return false;
         ModuleDescriptor that = (ModuleDescriptor)ob;
         return (name.equals(that.name)
-                && open == that.open
-                && automatic == that.automatic
-                && synthetic == that.synthetic
+                && modifiers.equals(that.modifiers)
                 && requires.equals(that.requires)
+                && Objects.equals(packages, that.packages)
                 && exports.equals(that.exports)
                 && opens.equals(that.opens)
                 && uses.equals(that.uses)
                 && provides.equals(that.provides)
                 && Objects.equals(version, that.version)
-                && Objects.equals(mainClass, that.mainClass)
-                && Objects.equals(osName, that.osName)
-                && Objects.equals(osArch, that.osArch)
-                && Objects.equals(osVersion, that.osVersion)
-                && Objects.equals(packages, that.packages));
+                && Objects.equals(rawVersionString, that.rawVersionString)
+                && Objects.equals(mainClass, that.mainClass));
     }
 
-    private transient int hash;  // cached hash code
-
     /**
      * Computes a hash code for this module descriptor.
      *
@@ -2147,31 +2302,28 @@
         int hc = hash;
         if (hc == 0) {
             hc = name.hashCode();
-            hc = hc * 43 + Boolean.hashCode(open);
-            hc = hc * 43 + Boolean.hashCode(automatic);
-            hc = hc * 43 + Boolean.hashCode(synthetic);
+            hc = hc * 43 + Objects.hashCode(modifiers);
             hc = hc * 43 + requires.hashCode();
+            hc = hc * 43 + Objects.hashCode(packages);
             hc = hc * 43 + exports.hashCode();
             hc = hc * 43 + opens.hashCode();
             hc = hc * 43 + uses.hashCode();
             hc = hc * 43 + provides.hashCode();
             hc = hc * 43 + Objects.hashCode(version);
+            hc = hc * 43 + Objects.hashCode(rawVersionString);
             hc = hc * 43 + Objects.hashCode(mainClass);
-            hc = hc * 43 + Objects.hashCode(osName);
-            hc = hc * 43 + Objects.hashCode(osArch);
-            hc = hc * 43 + Objects.hashCode(osVersion);
-            hc = hc * 43 + Objects.hashCode(packages);
             if (hc == 0)
                 hc = -1;
             hash = hc;
         }
         return hc;
     }
+    private transient int hash;  // cached hash code
 
     /**
-     * Returns a string describing this descriptor.
+     * <p> Returns a string describing the module. </p>
      *
-     * @return A string describing this descriptor
+     * @return A string describing the module
      */
     @Override
     public String toString() {
@@ -2201,31 +2353,50 @@
      *
      * @param  name
      *         The module name
+     * @param  ms
+     *         The set of module modifiers
      *
      * @return A new builder
      *
      * @throws IllegalArgumentException
-     *         If the module name is {@code null} or is not a legal Java
-     *         identifier
+     *         If the module name is {@code null} or is not a legal module
+     *         name, or the set of modifiers contains {@link
+     *         Modifier#AUTOMATIC AUTOMATIC} with other modifiers
      */
-    public static Builder module(String name) {
-        return new Builder(name, true, false, false);
+    public static Builder newModule(String name, Set<Modifier> ms) {
+        Set<Modifier> mods = new HashSet<>(ms);
+        if (mods.contains(Modifier.AUTOMATIC) && mods.size() > 1)
+            throw new IllegalArgumentException("AUTOMATIC cannot be used with"
+                                               + " other modifiers");
+
+        return new Builder(name, true, mods);
+    }
+
+    /**
+     * Instantiates a builder to build a module descriptor for a <em>normal</em>
+     * module. This method is equivalent to invoking {@link #newModule(String,Set)
+     * newModule} with an empty set of {@link ModuleDescriptor.Modifier modifiers}.
+     *
+     * @param  name
+     *         The module name
+     *
+     * @return A new builder
+     *
+     * @throws IllegalArgumentException
+     *         If the module name is {@code null} or is not a legal module
+     *         name
+     */
+    public static Builder newModule(String name) {
+        return new Builder(name, true, Set.of());
     }
 
     /**
      * Instantiates a builder to build a module descriptor for an open module.
-     * An open module does not declare any open packages but the resulting
-     * module is treated as if all packages are open.
+     * This method is equivalent to invoking {@link #newModule(String,Set)
+     * newModule} with the {@link ModuleDescriptor.Modifier#OPEN OPEN} modifier.
      *
-     * <p> As an example, the following creates a module descriptor for an open
-     * name "{@code m}" containing two packages, one of which is exported. </p>
-     * <pre>{@code
-     *     ModuleDescriptor descriptor = ModuleDescriptor.openModule("m")
-     *         .requires("java.base")
-     *         .exports("p")
-     *         .contains("q")
-     *         .build();
-     * }</pre>
+     * <p> The builder for an open module cannot be used to declare any open
+     * packages. </p>
      *
      * @param  name
      *         The module name
@@ -2233,19 +2404,22 @@
      * @return A new builder that builds an open module
      *
      * @throws IllegalArgumentException
-     *         If the module name is {@code null} or is not a legal Java
-     *         identifier
+     *         If the module name is {@code null} or is not a legal module
+     *         name
      */
-    public static Builder openModule(String name) {
-        return new Builder(name, true, true, false);
+    public static Builder newOpenModule(String name) {
+        return new Builder(name, true, Set.of(Modifier.OPEN));
     }
 
     /**
      * Instantiates a builder to build a module descriptor for an automatic
-     * module. Automatic modules receive special treatment during resolution
-     * (see {@link Configuration}) so that they read all other modules. When
-     * Instantiated in the Java virtual machine as a {@link java.lang.reflect.Module}
-     * then the Module reads every unnamed module in the Java virtual machine.
+     * module. This method is equivalent to invoking {@link #newModule(String,Set)
+     * newModule} with the {@link ModuleDescriptor.Modifier#AUTOMATIC AUTOMATIC}
+     * modifier.
+     *
+     * <p> The builder for an automatic module cannot be used to declare module
+     * or service dependences. It also cannot be used to declare any exported
+     * or open packages. </p>
      *
      * @param  name
      *         The module name
@@ -2253,13 +2427,13 @@
      * @return A new builder that builds an automatic module
      *
      * @throws IllegalArgumentException
-     *         If the module name is {@code null} or is not a legal Java
-     *         identifier
+     *         If the module name is {@code null} or is not a legal module
+     *         name
      *
      * @see ModuleFinder#of(Path[])
      */
-    public static Builder automaticModule(String name) {
-        return new Builder(name, true, false, false).automatic(true);
+    public static Builder newAutomaticModule(String name) {
+        return new Builder(name, true, Set.of(Modifier.AUTOMATIC));
     }
 
 
@@ -2269,8 +2443,12 @@
      *
      * <p> If the descriptor encoded in the input stream does not indicate a
      * set of packages in the module then the {@code packageFinder} will be
-     * invoked. If the {@code packageFinder} throws an {@link UncheckedIOException}
-     * then {@link IOException} cause will be re-thrown. </p>
+     * invoked. The set of packages that the {@code packageFinder} returns
+     * must include all the packages that the module exports, opens, as well
+     * as the packages of the service implementations that the module provides,
+     * and the package of the main class (if the module has a main class). If
+     * the {@code packageFinder} throws an {@link UncheckedIOException} then
+     * {@link IOException} cause will be re-thrown. </p>
      *
      * <p> If there are bytes following the module descriptor then it is
      * implementation specific as to whether those bytes are read, ignored,
@@ -2292,7 +2470,9 @@
      * @return The module descriptor
      *
      * @throws InvalidModuleDescriptorException
-     *         If an invalid module descriptor is detected
+     *         If an invalid module descriptor is detected or the set of
+     *         packages returned by the {@code packageFinder} does not include
+     *         all of the packages obtained from the module descriptor
      * @throws IOException
      *         If an I/O error occurs reading from the input stream or {@code
      *         UncheckedIOException} is thrown by the package finder
@@ -2305,8 +2485,12 @@
     }
 
     /**
-     * Reads the binary form of a module declaration from an input stream
-     * as a module descriptor.
+     * Reads the binary form of a module declaration from an input stream as a
+     * module descriptor. This method works exactly as specified by the 2-arg
+     * {@link #read(InputStream,Supplier) read} method with the exception that
+     * a packager finder is not used to find additional packages when the
+     * module descriptor read from the stream does not indicate the set of
+     * packages.
      *
      * @param  in
      *         The input stream
@@ -2327,7 +2511,13 @@
      * as a module descriptor.
      *
      * <p> If the descriptor encoded in the byte buffer does not indicate a
-     * set of packages then the {@code packageFinder} will be invoked. </p>
+     * set of packages in the module then the {@code packageFinder} will be
+     * invoked. The set of packages that the {@code packageFinder} returns
+     * must include all the packages that the module exports, opens, as well
+     * as the packages of the service implementations that the module provides,
+     * and the package of the main class (if the module has a main class). If
+     * the {@code packageFinder} throws an {@link UncheckedIOException} then
+     * {@link IOException} cause will be re-thrown. </p>
      *
      * <p> The module descriptor is read from the buffer stating at index
      * {@code p}, where {@code p} is the buffer's {@link ByteBuffer#position()
@@ -2353,7 +2543,9 @@
      * @return The module descriptor
      *
      * @throws InvalidModuleDescriptorException
-     *         If an invalid module descriptor is detected
+     *         If an invalid module descriptor is detected or the set of
+     *         packages returned by the {@code packageFinder} does not include
+     *         all of the packages obtained from the module descriptor
      */
     public static ModuleDescriptor read(ByteBuffer bb,
                                         Supplier<Set<String>> packageFinder)
@@ -2362,8 +2554,11 @@
     }
 
     /**
-     * Reads the binary form of a module declaration from a byte buffer
-     * as a module descriptor.
+     * Reads the binary form of a module declaration from a byte buffer as a
+     * module descriptor. This method works exactly as specified by the 2-arg
+     * {@link #read(ByteBuffer,Supplier) read} method with the exception that a
+     * packager finder is not used to find additional packages when the module
+     * descriptor encoded in the buffer does not indicate the set of packages.
      *
      * @param  bb
      *         The byte buffer
@@ -2398,6 +2593,11 @@
         }
     }
 
+    private static String packageName(String cn) {
+        int index = cn.lastIndexOf('.');
+        return (index == -1) ? "" : cn.substring(0, index);
+    }
+
     /**
      * Returns a string containing the given set of modifiers and label.
      */
@@ -2407,6 +2607,36 @@
                 .collect(Collectors.joining(" "));
     }
 
+    private static <T extends Object & Comparable<? super T>>
+    int compare(T obj1, T obj2) {
+        if (obj1 != null) {
+            return (obj2 != null) ? obj1.compareTo(obj2) : 1;
+        } else {
+            return (obj2 == null) ? 0 : -1;
+        }
+    }
+
+    /**
+     * Compares two sets of {@code Comparable} objects.
+     */
+    @SuppressWarnings("unchecked")
+    private static <T extends Object & Comparable<? super T>>
+    int compare(Set<T> s1, Set<T> s2) {
+        T[] a1 = (T[]) s1.toArray();
+        T[] a2 = (T[]) s2.toArray();
+        Arrays.sort(a1);
+        Arrays.sort(a2);
+        return Arrays.compare(a1, a2);
+    }
+
+    private static <E extends Enum<E>> long modsValue(Set<E> set) {
+        long value = 0;
+        for (Enum<E> e : set) {
+            value += 1 << e.ordinal();
+        }
+        return value;
+    }
+
     static {
         /**
          * Setup the shared secret to allow code in other packages access
@@ -2417,19 +2647,21 @@
                 @Override
                 public Builder newModuleBuilder(String mn,
                                                 boolean strict,
-                                                boolean open,
-                                                boolean synthetic) {
-                    return new Builder(mn, strict, open, synthetic);
+                                                Set<ModuleDescriptor.Modifier> modifiers) {
+                    return new Builder(mn, strict, modifiers);
                 }
 
                 @Override
-                public Set<String> exportedPackages(ModuleDescriptor.Builder builder) {
-                    return builder.exportedPackages();
+                public Set<String> packages(ModuleDescriptor.Builder builder) {
+                    return builder.packages();
                 }
 
                 @Override
-                public Set<String> openPackages(ModuleDescriptor.Builder builder) {
-                    return builder.openPackages();
+                public void requires(ModuleDescriptor.Builder builder,
+                                     Set<Requires.Modifier> ms,
+                                     String mn,
+                                     String rawCompiledVersion) {
+                    builder.requires(ms, mn, rawCompiledVersion);
                 }
 
                 @Override
@@ -2467,22 +2699,9 @@
                 }
 
                 @Override
-                public Version newVersion(String v) {
-                    return new Version(v);
-                }
-
-                @Override
-                public ModuleDescriptor newModuleDescriptor(ModuleDescriptor md,
-                                                            Set<String> pkgs) {
-                    return new ModuleDescriptor(md, pkgs);
-                }
-
-                @Override
                 public ModuleDescriptor newModuleDescriptor(String name,
                                                             Version version,
-                                                            boolean open,
-                                                            boolean automatic,
-                                                            boolean synthetic,
+                                                            Set<ModuleDescriptor.Modifier> modifiers,
                                                             Set<Requires> requires,
                                                             Set<Exports> exports,
                                                             Set<Opens> opens,
@@ -2490,15 +2709,10 @@
                                                             Set<Provides> provides,
                                                             Set<String> packages,
                                                             String mainClass,
-                                                            String osName,
-                                                            String osArch,
-                                                            String osVersion,
                                                             int hashCode) {
                     return new ModuleDescriptor(name,
                                                 version,
-                                                open,
-                                                automatic,
-                                                synthetic,
+                                                modifiers,
                                                 requires,
                                                 exports,
                                                 opens,
@@ -2506,20 +2720,17 @@
                                                 provides,
                                                 packages,
                                                 mainClass,
-                                                osName,
-                                                osArch,
-                                                osVersion,
                                                 hashCode,
                                                 false);
                 }
 
                 @Override
-                public Configuration resolveRequiresAndUses(ModuleFinder finder,
-                                                            Collection<String> roots,
-                                                            boolean check,
-                                                            PrintStream traceOutput)
+                public Configuration resolveAndBind(ModuleFinder finder,
+                                                    Collection<String> roots,
+                                                    boolean check,
+                                                    PrintStream traceOutput)
                 {
-                    return Configuration.resolveRequiresAndUses(finder, roots, check, traceOutput);
+                    return Configuration.resolveAndBind(finder, roots, check, traceOutput);
                 }
             });
     }
diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java
index 5d01f69..0be9d8d 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,6 @@
 
 package java.lang.module;
 
-import java.io.File;
-import java.io.FilePermission;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -42,14 +40,15 @@
 import java.util.Optional;
 import java.util.Set;
 
+import jdk.internal.module.ModuleBootstrap;
+import jdk.internal.module.ModulePatcher;
 import jdk.internal.module.ModulePath;
 import jdk.internal.module.SystemModuleFinder;
-import sun.security.action.GetPropertyAction;
 
 /**
  * A finder of modules. A {@code ModuleFinder} is used to find modules during
- * <a href="Configuration.html#resolution">resolution</a> or
- * <a href="Configuration.html#servicebinding">service binding</a>.
+ * <a href="package-summary.html#resolution">resolution</a> or
+ * <a href="package-summary.html#servicebinding">service binding</a>.
  *
  * <p> A {@code ModuleFinder} can only find one module with a given name. A
  * {@code ModuleFinder} that finds modules in a sequence of directories, for
@@ -85,6 +84,7 @@
  * <p> A {@code ModuleFinder} is not required to be thread safe. </p>
  *
  * @since 9
+ * @spec JPMS
  */
 
 public interface ModuleFinder {
@@ -124,8 +124,8 @@
      * to find that module. </p>
      *
      * @apiNote This is important to have for methods such as {@link
-     * Configuration#resolveRequiresAndUses resolveRequiresAndUses} that need
-     * to scan the module path to find modules that provide a specific service.
+     * Configuration#resolveAndBind resolveAndBind} that need to scan the
+     * module path to find modules that provide a specific service.
      *
      * @return The set of all module references that this finder locates
      *
@@ -144,9 +144,9 @@
      *
      * <p> If there is a security manager set then its {@link
      * SecurityManager#checkPermission(Permission) checkPermission} method is
-     * invoked to check that the caller has been granted {@link FilePermission}
-     * to recursively read the directory that is the value of the system
-     * property {@code java.home}. </p>
+     * invoked to check that the caller has been granted
+     * {@link RuntimePermission RuntimePermission("accessSystemModules")}
+     * to access the system modules. </p>
      *
      * @return A {@code ModuleFinder} that locates the system modules
      *
@@ -154,25 +154,29 @@
      *         If denied by the security manager
      */
     static ModuleFinder ofSystem() {
-        String home;
-
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            PrivilegedAction<String> pa = new GetPropertyAction("java.home");
-            home = AccessController.doPrivileged(pa);
-            Permission p = new FilePermission(home + File.separator + "-", "read");
-            sm.checkPermission(p);
+            sm.checkPermission(new RuntimePermission("accessSystemModules"));
+            PrivilegedAction<ModuleFinder> pa = ModuleFinder::privilegedOfSystem;
+            return AccessController.doPrivileged(pa);
         } else {
-            home = System.getProperty("java.home");
+            return privilegedOfSystem();
         }
+    }
 
+    /**
+     * Returns a module finder that locates the system modules. This method
+     * assumes it has permissions to access the runtime image.
+     */
+    private static ModuleFinder privilegedOfSystem() {
+        String home = System.getProperty("java.home");
         Path modules = Paths.get(home, "lib", "modules");
         if (Files.isRegularFile(modules)) {
             return SystemModuleFinder.getInstance();
         } else {
-            Path mlib = Paths.get(home, "modules");
-            if (Files.isDirectory(mlib)) {
-                return of(mlib);
+            Path dir = Paths.get(home, "modules");
+            if (Files.isDirectory(dir)) {
+                return privilegedOf(ModuleBootstrap.patcher(), dir);
             } else {
                 throw new InternalError("Unable to detect the run-time image");
             }
@@ -180,6 +184,26 @@
     }
 
     /**
+     * Returns a module finder that locates the system modules in an exploded
+     * image. The image may be patched.
+     */
+    private static ModuleFinder privilegedOf(ModulePatcher patcher, Path dir) {
+        ModuleFinder finder = ModulePath.of(patcher, dir);
+        return new ModuleFinder() {
+            @Override
+            public Optional<ModuleReference> find(String name) {
+                PrivilegedAction<Optional<ModuleReference>> pa = () -> finder.find(name);
+                return AccessController.doPrivileged(pa);
+            }
+            @Override
+            public Set<ModuleReference> findAll() {
+                PrivilegedAction<Set<ModuleReference>> pa = finder::findAll;
+                return AccessController.doPrivileged(pa);
+            }
+        };
+    }
+
+    /**
      * Returns a module finder that locates modules on the file system by
      * searching a sequence of directories and/or packaged modules.
      *
@@ -198,25 +222,20 @@
      *
      * <p> If an element is a path to a directory of modules then each entry in
      * the directory is a packaged module or the top-level directory of an
-     * exploded module. The module finder's {@link #find(String) find} or
-     * {@link #findAll() findAll} methods throw {@link FindException} if a
-     * directory containing more than one module with the same name is
-     * encountered. </p>
-     *
-     * <p> If an element in the array is a path to a directory, and that
-     * directory contains a file named {@code module-info.class}, then the
+     * exploded module. It is an error if a directory contains more than one
+     * module with the same name. If an element is a path to a directory, and
+     * that directory contains a file named {@code module-info.class}, then the
      * directory is treated as an exploded module rather than a directory of
      * modules. </p>
      *
-     * <p> The module finder returned by this method supports modules that are
-     * packaged as JAR files. A JAR file with a {@code module-info.class} in
-     * the top-level directory of the JAR file (or overridden by a versioned
-     * entry in a {@link java.util.jar.JarFile#isMultiRelease() multi-release}
-     * JAR file) is a modular JAR and is an <em>explicit module</em>.
-     * A JAR file that does not have a {@code module-info.class} in the
-     * top-level directory is an {@link ModuleDescriptor#isAutomatic automatic}
-     * module. The {@link ModuleDescriptor} for an automatic module is created as
-     * follows:
+     * <p id="automatic-modules"> The module finder returned by this method
+     * supports modules packaged as JAR files. A JAR file with a {@code
+     * module-info.class} in its top-level directory, or in a versioned entry
+     * in a {@linkplain java.util.jar.JarFile#isMultiRelease() multi-release}
+     * JAR file, is a modular JAR file and thus defines an <em>explicit</em>
+     * module. A JAR file that does not have a {@code module-info.class} in its
+     * top-level directory defines an <em>automatic module</em>, as follows:
+     * </p>
      *
      * <ul>
      *
@@ -235,63 +254,67 @@
      *         ModuleDescriptor.Version} and ignored if it cannot be parsed as
      *         a {@code Version}. </p></li>
      *
-     *         <li><p> For the module name, then any trailing digits and dots
-     *         are removed, all non-alphanumeric characters ({@code [^A-Za-z0-9]})
-     *         are replaced with a dot ({@code "."}), all repeating dots are
-     *         replaced with one dot, and all leading and trailing dots are
-     *         removed. </p></li>
+     *         <li><p> All non-alphanumeric characters ({@code [^A-Za-z0-9]})
+     *         in the module name are replaced with a dot ({@code "."}), all
+     *         repeating dots are replaced with one dot, and all leading and
+     *         trailing dots are removed. </p></li>
      *
      *         <li><p> As an example, a JAR file named {@code foo-bar.jar} will
      *         derive a module name {@code foo.bar} and no version. A JAR file
-     *         named {@code foo-1.2.3-SNAPSHOT.jar} will derive a module name
-     *         {@code foo} and {@code 1.2.3-SNAPSHOT} as the version. </p></li>
+     *         named {@code foo-bar-1.2.3-SNAPSHOT.jar} will derive a module
+     *         name {@code foo.bar} and {@code 1.2.3-SNAPSHOT} as the version.
+     *         </p></li>
      *
      *     </ul></li>
      *
-     *     <li><p> It {@link ModuleDescriptor#requires() requires} {@code
-     *     java.base}. </p></li>
-     *
-     *     <li><p> The set of packages in the module is derived from the names
-     *     of non-directory entries in the JAR file. A candidate package name
-     *     is derived from an entry using the characters up to, but not
-     *     including, the last forward slash. All remaining forward slashes are
-     *     replaced with dot ({@code "."}). If the resulting string is a valid
-     *     Java identifier then it is assumed to be a package name. For example,
-     *     if the JAR file contains an entry "{@code p/q/Foo.class}" then the
-     *     package name derived is "{@code p.q}". All packages are {@link
-     *     ModuleDescriptor#exports() exported}. </p></li>
+     *     <li><p> The set of packages in the module is derived from the
+     *     non-directory entries in the JAR file that have names ending in
+     *     "{@code .class}". A candidate package name is derived from the name
+     *     using the characters up to, but not including, the last forward slash.
+     *     All remaining forward slashes are replaced with dot ({@code "."}). If
+     *     the resulting string is a legal package name then it is assumed to be
+     *     a package name. For example, if the JAR file contains the entry
+     *     "{@code p/q/Foo.class}" then the package name derived is
+     *     "{@code p.q}".</p></li>
      *
      *     <li><p> The contents of entries starting with {@code
      *     META-INF/services/} are assumed to be service configuration files
      *     (see {@link java.util.ServiceLoader}). If the name of a file
-     *     (that follows {@code META-INF/services/}) is a legal Java identifier
-     *     then it is assumed to be the fully-qualified binary name of a
-     *     service type. The entries in the file are assumed to be the
-     *     fully-qualified binary names of provider classes. </p></li>
+     *     (that follows {@code META-INF/services/}) is a legal class name
+     *     then it is assumed to be the fully-qualified class name of a service
+     *     type. The entries in the file are assumed to be the fully-qualified
+     *     class names of provider classes. </p></li>
      *
      *     <li><p> If the JAR file has a {@code Main-Class} attribute in its
-     *     main manifest then its value is the {@link
+     *     main manifest then its value is the module {@link
      *     ModuleDescriptor#mainClass() main class}. </p></li>
      *
      * </ul>
      *
      * <p> If a {@code ModuleDescriptor} cannot be created (by means of the
      * {@link ModuleDescriptor.Builder ModuleDescriptor.Builder} API) for an
-     * automatic module then {@code FindException} is thrown. This can arise,
-     * for example, when a legal Java identifier name cannot be derived from
-     * the file name of the JAR file or where the JAR file contains a {@code
-     * .class} in the top-level directory of the JAR file. </p>
+     * automatic module then {@code FindException} is thrown. This can arise
+     * when a legal module name cannot be derived from the file name of the JAR
+     * file, where the JAR file contains a {@code .class} in the top-level
+     * directory of the JAR file, where an entry in a service configuration
+     * file is not a legal class name or its package name is not in the set of
+     * packages derived for the module, or where the module main class is not
+     * a legal class name or its package is not in the module. </p>
      *
      * <p> In addition to JAR files, an implementation may also support modules
-     * that are packaged in other implementation specific module formats. When
-     * a file is encountered that is not recognized as a packaged module then
-     * {@code FindException} is thrown. An implementation may choose to ignore
-     * some files, {@link java.nio.file.Files#isHidden hidden} files for
-     * example. Paths to files that do not exist are always ignored. </p>
+     * that are packaged in other implementation specific module formats. If
+     * an element in the array specified to this method is a path to a directory
+     * of modules then entries in the directory that not recognized as modules
+     * are ignored. If an element in the array is a path to a packaged module
+     * that is not recognized then a {@code FindException} is thrown when the
+     * file is encountered. Paths to files that do not exist are always ignored.
+     * </p>
      *
      * <p> As with automatic modules, the contents of a packaged or exploded
      * module may need to be <em>scanned</em> in order to determine the packages
-     * in the module. If a {@code .class} file (other than {@code
+     * in the module. Whether {@linkplain java.nio.file.Files#isHidden(Path)
+     * hidden files} are ignored or not is implementation specific and therefore
+     * not specified. If a {@code .class} file (other than {@code
      * module-info.class}) is found in the top-level directory then it is
      * assumed to be a class in the unnamed package and so {@code FindException}
      * is thrown. </p>
@@ -325,7 +348,7 @@
             };
         }
 
-        return new ModulePath(entries);
+        return ModulePath.of(entries);
     }
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java
index d79d210..e97f32f 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java
@@ -45,10 +45,14 @@
  * module. A module reader is also intended to be used by {@code ClassLoader}
  * implementations that load classes and resources from modules. </p>
  *
- * <p> A resource in a module is identified by a name that is a
+ * <p> A resource in a module is identified by an abstract name that is a
  * '{@code /}'-separated path string. For example, module {@code java.base} may
  * have a resource "{@code java/lang/Object.class}" that, by convention, is the
- * class file for {@code java.lang.Object}. </p>
+ * class file for {@code java.lang.Object}. A module reader may treat
+ * directories in the module content as resources (whether it does or not is
+ * module reader specific). Where the module content contains a directory
+ * that can be located as a resource then its name ends with a slash ('/'). The
+ * directory can also be located with a name that drops the trailing slash. </p>
  *
  * <p> A {@code ModuleReader} is {@linkplain ModuleReference#open open} upon
  * creation and is closed by invoking the {@link #close close} method.  Failure
@@ -61,8 +65,18 @@
  * open}, {@link #read read}, and {@link #list list} methods may throw {@code
  * SecurityException} if access is denied by the security manager. </p>
  *
+ * @implSpec Implementations of {@code ModuleReader} should take great care
+ * when translating an abstract resource name to the location of a resource in
+ * a packaged module or on the file system. Implementations are advised to
+ * treat resource names with elements such as '{@code .},  '{@code ..}',
+ * elements containing file separators, or empty elements as "not found". More
+ * generally, if the resource name is not in the stream of elements that the
+ * {@code list} method returns then the resource should be treated as "not
+ * found" to avoid inconsistencies.
+ *
  * @see ModuleReference
  * @since 9
+ * @spec JPMS
  */
 
 public interface ModuleReader extends Closeable {
@@ -70,6 +84,9 @@
     /**
      * Finds a resource, returning a URI to the resource in the module.
      *
+     * <p> If the module reader can determine that the name locates a directory
+     * then the resulting URI will end with a slash ('/'). </p>
+     *
      * @param  name
      *         The name of the resource to open for reading
      *
@@ -130,7 +147,7 @@
      *
      * @apiNote This method is intended for high-performance class loading. It
      * is not capable (or intended) to read arbitrary large resources that
-     * could potentially be 2GB or larger. The rational for using this method
+     * could potentially be 2GB or larger. The rationale for using this method
      * in conjunction with the {@code release} method is to allow module reader
      * implementations manage buffers in an efficient manner.
      *
@@ -148,6 +165,9 @@
      *         If an I/O error occurs or the module reader is closed
      * @throws SecurityException
      *         If denied by the security manager
+     * @throws OutOfMemoryError
+     *         If the resource is larger than {@code Integer.MAX_VALUE},
+     *         the maximum capacity of a byte buffer
      *
      * @see ClassLoader#defineClass(String, ByteBuffer, java.security.ProtectionDomain)
      */
@@ -182,7 +202,9 @@
 
     /**
      * Lists the contents of the module, returning a stream of elements that
-     * are the names of all resources in the module.
+     * are the names of all resources in the module. Whether the stream of
+     * elements includes names corresponding to directories in the module is
+     * module reader specific.
      *
      * <p> In lazy implementations then an {@code IOException} may be thrown
      * when using the stream to list the module contents. If this occurs then
diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java
index 09a5ace..54291e7 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java
@@ -44,6 +44,7 @@
  * @see ModuleFinder
  * @see ModuleReader
  * @since 9
+ * @spec JPMS
  */
 
 public abstract class ModuleReference {
@@ -76,7 +77,7 @@
     /**
      * Returns the location of this module's content, if known.
      *
-     * <p> This URI, when present, is used as the {@linkplain
+     * <p> This URI, when present, can be used as the {@linkplain
      * java.security.CodeSource#getLocation location} value of a {@link
      * java.security.CodeSource CodeSource} so that a module's classes can be
      * granted specific permissions when loaded by a {@link
diff --git a/jdk/src/java.base/share/classes/java/lang/module/ResolutionException.java b/jdk/src/java.base/share/classes/java/lang/module/ResolutionException.java
index fb14cfe..69cc71f 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/ResolutionException.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/ResolutionException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,12 @@
 package java.lang.module;
 
 /**
- * Thrown when resolving a set of modules or binding fails.
+ * Thrown when resolving a set of modules, or resolving a set of modules with
+ * service binding, fails.
  *
  * @see Configuration
  * @since 9
+ * @spec JPMS
  */
 public class ResolutionException extends RuntimeException {
     private static final long serialVersionUID = -1031186845316729450L;
diff --git a/jdk/src/java.base/share/classes/java/lang/module/ResolvedModule.java b/jdk/src/java.base/share/classes/java/lang/module/ResolvedModule.java
index 05ef3c4..a3858ef 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/ResolvedModule.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/ResolvedModule.java
@@ -37,6 +37,7 @@
  * module's content.
  *
  * @since 9
+ * @spec JPMS
  * @see Configuration#modules()
  */
 public final class ResolvedModule {
diff --git a/jdk/src/java.base/share/classes/java/lang/module/Resolver.java b/jdk/src/java.base/share/classes/java/lang/module/Resolver.java
index d2aafdc..6adf93f 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/Resolver.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/Resolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
 import java.io.PrintStream;
 import java.lang.module.ModuleDescriptor.Provides;
 import java.lang.module.ModuleDescriptor.Requires.Modifier;
-import java.lang.reflect.Layer;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -47,10 +46,11 @@
 
 import jdk.internal.module.ModuleHashes;
 import jdk.internal.module.ModuleReferenceImpl;
+import jdk.internal.module.ModuleTarget;
 
 /**
- * The resolver used by {@link Configuration#resolveRequires} and
- * {@link Configuration#resolveRequiresAndUses}.
+ * The resolver used by {@link Configuration#resolve} and {@link
+ * Configuration#resolveAndBind}.
  *
  * @implNote The resolver is used at VM startup and so deliberately avoids
  * using lambda and stream usages in code paths used during startup.
@@ -66,7 +66,20 @@
     // maps module name to module reference
     private final Map<String, ModuleReference> nameToReference = new HashMap<>();
 
+    // true if all automatic modules have been found
+    private boolean haveAllAutomaticModules;
 
+    // module constraints on target platform
+    private String osName;
+    private String osArch;
+
+    String osName() { return osName; }
+    String osArch() { return osArch; }
+
+    /**
+     * @throws IllegalArgumentException if there are more than one parent and
+     *         the constraints on the target platform conflict
+     */
     Resolver(ModuleFinder beforeFinder,
              List<Configuration> parents,
              ModuleFinder afterFinder,
@@ -75,15 +88,44 @@
         this.parents = parents;
         this.afterFinder = afterFinder;
         this.traceOutput = traceOutput;
+
+        // record constraints on target platform, checking that they don't conflict
+        for (Configuration parent : parents) {
+            String value = parent.osName();
+            if (value != null) {
+                if (osName == null) {
+                    osName = value;
+                } else {
+                    if (!value.equals(osName)) {
+                        failParentConflict("Operating System", osName, value);
+                    }
+                }
+            }
+            value = parent.osArch();
+            if (value != null) {
+                if (osArch == null) {
+                    osArch = value;
+                } else {
+                    if (!value.equals(osArch)) {
+                        failParentConflict("OS architecture", osArch, value);
+                    }
+                }
+            }
+        }
     }
 
+    private void failParentConflict(String constraint, String s1, String s2) {
+        String msg = "Parents have conflicting constraints on target "
+                     + constraint + ": " + s1 + ", " + s2;
+        throw new IllegalArgumentException(msg);
+    }
 
     /**
      * Resolves the given named modules.
      *
      * @throws ResolutionException
      */
-    Resolver resolveRequires(Collection<String> roots) {
+    Resolver resolve(Collection<String> roots) {
 
         // create the visit stack to get us started
         Deque<ModuleDescriptor> q = new ArrayDeque<>();
@@ -100,7 +142,7 @@
 
                 mref = findWithAfterFinder(root);
                 if (mref == null) {
-                    fail("Module %s not found", root);
+                    findFail("Module %s not found", root);
                 }
             }
 
@@ -109,8 +151,7 @@
                 mref.location().ifPresent(uri -> trace("  (%s)", uri));
             }
 
-            assert mref.descriptor().name().equals(root);
-            nameToReference.put(root, mref);
+            addFoundModule(mref);
             q.push(mref.descriptor());
         }
 
@@ -132,6 +173,21 @@
             ModuleDescriptor descriptor = q.poll();
             assert nameToReference.containsKey(descriptor.name());
 
+            // if the module is an automatic module then all automatic
+            // modules need to be resolved
+            if (descriptor.isAutomatic() && !haveAllAutomaticModules) {
+                addFoundAutomaticModules().forEach(mref -> {
+                    ModuleDescriptor other = mref.descriptor();
+                    q.offer(other);
+                    if (isTracing()) {
+                        trace("Automatic module %s located, required by %s",
+                              other.name(), descriptor.name());
+                        mref.location().ifPresent(uri -> trace("  (%s)", uri));
+                    }
+                });
+                haveAllAutomaticModules = true;
+            }
+
             // process dependences
             for (ModuleDescriptor.Requires requires : descriptor.requires()) {
 
@@ -152,19 +208,24 @@
 
                     mref = findWithAfterFinder(dn);
                     if (mref == null) {
-                        fail("Module %s not found, required by %s",
-                                dn, descriptor.name());
+                        findFail("Module %s not found, required by %s",
+                                 dn, descriptor.name());
                     }
                 }
 
                 if (!nameToReference.containsKey(dn)) {
-                    nameToReference.put(dn, mref);
+                    addFoundModule(mref);
                     q.offer(mref.descriptor());
-                    resolved.add(mref.descriptor());
 
                     if (isTracing()) {
-                        trace("Module %s located, required by %s",
-                                dn, descriptor.name());
+                        String prefix;
+                        if (mref.descriptor().isAutomatic()) {
+                            prefix = "Automatic module";
+                        } else {
+                            prefix = "Module";
+                        }
+                        trace(prefix + " %s located, required by %s",
+                              dn, descriptor.name());
                         mref.location().ifPresent(uri -> trace("  (%s)", uri));
                     }
                 }
@@ -181,7 +242,7 @@
      * Augments the set of resolved modules with modules induced by the
      * service-use relation.
      */
-    Resolver resolveUses() {
+    Resolver bind() {
 
         // Scan the finders for all available service provider modules. As
         // java.base uses services then then module finders will be scanned
@@ -211,7 +272,7 @@
 
         // the initial set of modules that may use services
         Set<ModuleDescriptor> initialConsumers;
-        if (Layer.boot() == null) {
+        if (ModuleLayer.boot() == null) {
             initialConsumers = new HashSet<>();
         } else {
             initialConsumers = parents.stream()
@@ -246,7 +307,7 @@
                                             mref.location()
                                                 .ifPresent(uri -> trace("  (%s)", uri));
                                         }
-                                        nameToReference.put(pn, mref);
+                                        addFoundModule(mref);
                                         q.push(provider);
                                     }
                                 }
@@ -262,6 +323,84 @@
         return this;
     }
 
+    /**
+     * Add all automatic modules that have not already been found to the
+     * nameToReference map.
+     */
+    private Set<ModuleReference> addFoundAutomaticModules() {
+        Set<ModuleReference> result = new HashSet<>();
+        findAll().forEach(mref -> {
+            String mn = mref.descriptor().name();
+            if (mref.descriptor().isAutomatic() && !nameToReference.containsKey(mn)) {
+                addFoundModule(mref);
+                result.add(mref);
+            }
+        });
+        return result;
+    }
+
+    /**
+     * Add the module to the nameToReference map. Also check any constraints on
+     * the target platform with the constraints of other modules.
+     */
+    private void addFoundModule(ModuleReference mref) {
+        String mn = mref.descriptor().name();
+
+        if (mref instanceof ModuleReferenceImpl) {
+            ModuleTarget target = ((ModuleReferenceImpl)mref).moduleTarget();
+            if (target != null)
+                checkTargetConstraints(mn, target);
+        }
+
+        nameToReference.put(mn, mref);
+    }
+
+    /**
+     * Check that the module's constraints on the target platform do not
+     * conflict with the constraints of other modules resolved so far or
+     * modules in parent configurations.
+     */
+    private void checkTargetConstraints(String mn, ModuleTarget target) {
+        String value = target.osName();
+        if (value != null) {
+            if (osName == null) {
+                osName = value;
+            } else {
+                if (!value.equals(osName)) {
+                    failTargetConstraint(mn, target);
+                }
+            }
+        }
+        value = target.osArch();
+        if (value != null) {
+            if (osArch == null) {
+                osArch = value;
+            } else {
+                if (!value.equals(osArch)) {
+                    failTargetConstraint(mn, target);
+                }
+            }
+        }
+    }
+
+    private void failTargetConstraint(String mn, ModuleTarget target) {
+        String s1 = targetAsString(osName, osArch);
+        String s2 = targetAsString(target.osName(), target.osArch());
+        findFail("Module %s has constraints on target platform (%s) that"
+                 + " conflict with other modules: %s", mn, s1, s2);
+    }
+
+    private String targetAsString(ModuleTarget target) {
+        return targetAsString(target.osName(), target.osArch());
+    }
+
+    private String targetAsString(String osName, String osArch) {
+        return new StringJoiner("-")
+                .add(Objects.toString(osName, "*"))
+                .add(Objects.toString(osArch, "*"))
+                .toString();
+    }
+
 
     /**
      * Execute post-resolution checks and returns the module graph of resolved
@@ -281,7 +420,6 @@
 
         if (check) {
             detectCycles();
-            checkPlatformConstraints();
             checkHashes();
         }
 
@@ -319,8 +457,7 @@
         if (!visited.contains(descriptor)) {
             boolean added = visitPath.add(descriptor);
             if (!added) {
-                throw new ResolutionException("Cycle detected: " +
-                        cycleAsString(descriptor));
+                resolveFail("Cycle detected: %s", cycleAsString(descriptor));
             }
             for (ModuleDescriptor.Requires requires : descriptor.requires()) {
                 String dn = requires.name();
@@ -354,86 +491,6 @@
 
 
     /**
-     * If there are platform specific modules then check that the OS name,
-     * architecture and version match.
-     *
-     * @apiNote This method does not currently check if the OS matches
-     *          platform specific modules in parent configurations.
-     */
-    private void checkPlatformConstraints() {
-
-        // first module encountered that is platform specific
-        String savedModuleName = null;
-        String savedOsName = null;
-        String savedOsArch = null;
-        String savedOsVersion = null;
-
-        for (ModuleReference mref : nameToReference.values()) {
-            ModuleDescriptor descriptor = mref.descriptor();
-
-            String osName = descriptor.osName().orElse(null);
-            String osArch = descriptor.osArch().orElse(null);
-            String osVersion = descriptor.osVersion().orElse(null);
-
-            if (osName != null || osArch != null || osVersion != null) {
-
-                if (savedModuleName == null) {
-
-                    savedModuleName = descriptor.name();
-                    savedOsName = osName;
-                    savedOsArch = osArch;
-                    savedOsVersion = osVersion;
-
-                } else {
-
-                    boolean matches = platformMatches(osName, savedOsName)
-                            && platformMatches(osArch, savedOsArch)
-                            && platformMatches(osVersion, savedOsVersion);
-
-                    if (!matches) {
-                        String s1 = platformAsString(savedOsName,
-                                                     savedOsArch,
-                                                     savedOsVersion);
-
-                        String s2 = platformAsString(osName, osArch, osVersion);
-                        fail("Mismatching constraints on target platform: "
-                                + savedModuleName + ": " + s1
-                                + ", " + descriptor.name() + ": " + s2);
-                    }
-
-                }
-
-            }
-        }
-
-    }
-
-    /**
-     * Returns true if the s1 and s2 are equal or one of them is null.
-     */
-    private boolean platformMatches(String s1, String s2) {
-        if (s1 == null || s2 == null)
-            return true;
-        else
-            return Objects.equals(s1, s2);
-    }
-
-    /**
-     * Return a string that encodes the OS name/arch/version.
-     */
-    private String platformAsString(String osName,
-                                    String osArch,
-                                    String osVersion) {
-
-        return new StringJoiner("-")
-                .add(Objects.toString(osName, "*"))
-                .add(Objects.toString(osArch, "*"))
-                .add(Objects.toString(osVersion, "*"))
-                .toString();
-
-    }
-
-    /**
      * Checks the hashes in the module descriptor to ensure that they match
      * any recorded hashes.
      */
@@ -460,7 +517,7 @@
                     continue;
 
                 if (!(mref2 instanceof ModuleReferenceImpl)) {
-                    fail("Unable to compute the hash of module %s", dn);
+                    findFail("Unable to compute the hash of module %s", dn);
                 }
 
                 // skip checking the hash if the module has been patched
@@ -469,11 +526,11 @@
                     byte[] recordedHash = hashes.hashFor(dn);
                     byte[] actualHash = other.computeHash(algorithm);
                     if (actualHash == null)
-                        fail("Unable to compute the hash of module %s", dn);
+                        findFail("Unable to compute the hash of module %s", dn);
                     if (!Arrays.equals(recordedHash, actualHash)) {
-                        fail("Hash of %s (%s) differs to expected hash (%s)" +
-                             " recorded in %s", dn, toHexString(actualHash),
-                             toHexString(recordedHash), descriptor.name());
+                        findFail("Hash of %s (%s) differs to expected hash (%s)" +
+                                 " recorded in %s", dn, toHexString(actualHash),
+                                 toHexString(recordedHash), descriptor.name());
                     }
                 }
             }
@@ -514,7 +571,7 @@
         // need "requires transitive" from the modules in parent configurations
         // as there may be selected modules that have a dependency on modules in
         // the parent configuration.
-        if (Layer.boot() == null) {
+        if (ModuleLayer.boot() == null) {
             g2 = new HashMap<>(capacity);
         } else {
             g2 = parents.stream()
@@ -669,16 +726,30 @@
 
 
     /**
-     * Checks the readability graph to ensure that no two modules export the
-     * same package to a module. This includes the case where module M has
-     * a local package P and M reads another module that exports P to M.
-     * Also checks the uses/provides of module M to ensure that it reads a
-     * module that exports the package of the service type to M.
+     * Checks the readability graph to ensure that
+     * <ol>
+     *   <li><p> A module does not read two or more modules with the same name.
+     *   This includes the case where a module reads another another with the
+     *   same name as itself. </p></li>
+     *   <li><p> Two or more modules in the configuration don't export the same
+     *   package to a module that reads both. This includes the case where a
+     *   module {@code M} containing package {@code p} reads another module
+     *   that exports {@code p} to {@code M}. </p></li>
+     *   <li><p> A module {@code M} doesn't declare that it "{@code uses p.S}"
+     *   or "{@code provides p.S with ...}" but package {@code p} is neither
+     *   in module {@code M} nor exported to {@code M} by any module that
+     *   {@code M} reads. </p></li>
+     * </ol>
      */
     private void checkExportSuppliers(Map<ResolvedModule, Set<ResolvedModule>> graph) {
 
         for (Map.Entry<ResolvedModule, Set<ResolvedModule>> e : graph.entrySet()) {
             ModuleDescriptor descriptor1 = e.getKey().descriptor();
+            String name1 = descriptor1.name();
+
+            // the names of the modules that are read (including self)
+            Set<String> names = new HashSet<>();
+            names.add(name1);
 
             // the map of packages that are local or exported to descriptor1
             Map<String, ModuleDescriptor> packageToExporter = new HashMap<>();
@@ -694,37 +765,49 @@
             for (ResolvedModule endpoint : reads) {
                 ModuleDescriptor descriptor2 = endpoint.descriptor();
 
-                for (ModuleDescriptor.Exports export : descriptor2.exports()) {
-
-                    if (export.isQualified()) {
-                        if (!export.targets().contains(descriptor1.name()))
-                            continue;
+                String name2 = descriptor2.name();
+                if (descriptor2 != descriptor1 && !names.add(name2)) {
+                    if (name2.equals(name1)) {
+                        resolveFail("Module %s reads another module named %s",
+                                    name1, name1);
+                    } else{
+                        resolveFail("Module %s reads more than one module named %s",
+                                     name1, name2);
                     }
+                }
 
-                    // source is exported to descriptor2
-                    String source = export.source();
-                    ModuleDescriptor other
-                        = packageToExporter.putIfAbsent(source, descriptor2);
+                if (descriptor2.isAutomatic()) {
+                    // automatic modules read self and export all packages
+                    if (descriptor2 != descriptor1) {
+                        for (String source : descriptor2.packages()) {
+                            ModuleDescriptor supplier
+                                = packageToExporter.putIfAbsent(source, descriptor2);
 
-                    if (other != null && other != descriptor2) {
-                        // package might be local to descriptor1
-                        if (other == descriptor1) {
-                            fail("Module %s contains package %s"
-                                 + ", module %s exports package %s to %s",
-                                    descriptor1.name(),
-                                    source,
-                                    descriptor2.name(),
-                                    source,
-                                    descriptor1.name());
-                        } else {
-                            fail("Modules %s and %s export package %s to module %s",
-                                    descriptor2.name(),
-                                    other.name(),
-                                    source,
-                                    descriptor1.name());
+                            // descriptor2 and 'supplier' export source to descriptor1
+                            if (supplier != null) {
+                                failTwoSuppliers(descriptor1, source, descriptor2, supplier);
+                            }
                         }
 
                     }
+                } else {
+                    for (ModuleDescriptor.Exports export : descriptor2.exports()) {
+                        if (export.isQualified()) {
+                            if (!export.targets().contains(descriptor1.name()))
+                                continue;
+                        }
+
+                        // source is exported by descriptor2
+                        String source = export.source();
+                        ModuleDescriptor supplier
+                            = packageToExporter.putIfAbsent(source, descriptor2);
+
+                        // descriptor2 and 'supplier' export source to descriptor1
+                        if (supplier != null) {
+                            failTwoSuppliers(descriptor1, source, descriptor2, supplier);
+                        }
+                    }
+
                 }
             }
 
@@ -735,8 +818,8 @@
                 for (String service : descriptor1.uses()) {
                     String pn = packageName(service);
                     if (!packageToExporter.containsKey(pn)) {
-                        fail("Module %s does not read a module that exports %s",
-                             descriptor1.name(), pn);
+                        resolveFail("Module %s does not read a module that exports %s",
+                                    descriptor1.name(), pn);
                     }
                 }
 
@@ -744,15 +827,8 @@
                 for (ModuleDescriptor.Provides provides : descriptor1.provides()) {
                     String pn = packageName(provides.service());
                     if (!packageToExporter.containsKey(pn)) {
-                        fail("Module %s does not read a module that exports %s",
-                             descriptor1.name(), pn);
-                    }
-
-                    for (String provider : provides.providers()) {
-                        if (!packages.contains(packageName(provider))) {
-                            fail("Provider %s not in module %s",
-                                 provider, descriptor1.name());
-                        }
+                        resolveFail("Module %s does not read a module that exports %s",
+                                    descriptor1.name(), pn);
                     }
                 }
 
@@ -763,6 +839,42 @@
     }
 
     /**
+     * Fail because a module in the configuration exports the same package to
+     * a module that reads both. This includes the case where a module M
+     * containing a package p reads another module that exports p to at least
+     * module M.
+     */
+    private void failTwoSuppliers(ModuleDescriptor descriptor,
+                                  String source,
+                                  ModuleDescriptor supplier1,
+                                  ModuleDescriptor supplier2) {
+
+        if (supplier2 == descriptor) {
+            ModuleDescriptor tmp = supplier1;
+            supplier1 = supplier2;
+            supplier2 = tmp;
+        }
+
+        if (supplier1 == descriptor) {
+            resolveFail("Module %s contains package %s"
+                         + ", module %s exports package %s to %s",
+                    descriptor.name(),
+                    source,
+                    supplier2.name(),
+                    source,
+                    descriptor.name());
+        } else {
+            resolveFail("Modules %s and %s export package %s to module %s",
+                    supplier1.name(),
+                    supplier2.name(),
+                    source,
+                    descriptor.name());
+        }
+
+    }
+
+
+    /**
      * Find a module of the given name in the parent configurations
      */
     private ResolvedModule findInParent(String mn) {
@@ -779,24 +891,16 @@
      * Invokes the beforeFinder to find method to find the given module.
      */
     private ModuleReference findWithBeforeFinder(String mn) {
-        try {
-            return beforeFinder.find(mn).orElse(null);
-        } catch (FindException e) {
-            // unwrap
-            throw new ResolutionException(e.getMessage(), e.getCause());
-        }
+
+        return beforeFinder.find(mn).orElse(null);
+
     }
 
     /**
      * Invokes the afterFinder to find method to find the given module.
      */
     private ModuleReference findWithAfterFinder(String mn) {
-        try {
-            return afterFinder.find(mn).orElse(null);
-        } catch (FindException e) {
-            // unwrap
-            throw new ResolutionException(e.getMessage(), e.getCause());
-        }
+        return afterFinder.find(mn).orElse(null);
     }
 
     /**
@@ -804,34 +908,27 @@
      * and after ModuleFinders.
      */
     private Set<ModuleReference> findAll() {
-        try {
+        Set<ModuleReference> beforeModules = beforeFinder.findAll();
+        Set<ModuleReference> afterModules = afterFinder.findAll();
 
-            Set<ModuleReference> beforeModules = beforeFinder.findAll();
-            Set<ModuleReference> afterModules = afterFinder.findAll();
+        if (afterModules.isEmpty())
+            return beforeModules;
 
-            if (afterModules.isEmpty())
-                return beforeModules;
+        if (beforeModules.isEmpty()
+                && parents.size() == 1
+                && parents.get(0) == Configuration.empty())
+            return afterModules;
 
-            if (beforeModules.isEmpty()
-                    && parents.size() == 1
-                    && parents.get(0) == Configuration.empty())
-                return afterModules;
-
-            Set<ModuleReference> result = new HashSet<>(beforeModules);
-            for (ModuleReference mref : afterModules) {
-                String name = mref.descriptor().name();
-                if (!beforeFinder.find(name).isPresent()
-                        && findInParent(name) == null) {
-                    result.add(mref);
-                }
+        Set<ModuleReference> result = new HashSet<>(beforeModules);
+        for (ModuleReference mref : afterModules) {
+            String name = mref.descriptor().name();
+            if (!beforeFinder.find(name).isPresent()
+                    && findInParent(name) == null) {
+                result.add(mref);
             }
-
-            return result;
-
-        } catch (FindException e) {
-            // unwrap
-            throw new ResolutionException(e.getMessage(), e.getCause());
         }
+
+        return result;
     }
 
     /**
@@ -843,9 +940,17 @@
     }
 
     /**
+     * Throw FindException with the given format string and arguments
+     */
+    private static void findFail(String fmt, Object ... args) {
+        String msg = String.format(fmt, args);
+        throw new FindException(msg);
+    }
+
+    /**
      * Throw ResolutionException with the given format string and arguments
      */
-    private static void fail(String fmt, Object ... args) {
+    private static void resolveFail(String fmt, Object ... args) {
         String msg = String.format(fmt, args);
         throw new ResolutionException(msg);
     }
diff --git a/jdk/src/java.base/share/classes/java/lang/module/package-info.java b/jdk/src/java.base/share/classes/java/lang/module/package-info.java
index f641638..b531f13 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/package-info.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,112 @@
  * Classes to support module descriptors and creating configurations of modules
  * by means of resolution and service binding.
  *
+ * <h2><a name="resolution">Resolution</a></h2>
+ *
+ * <p> Resolution is the process of computing the transitive closure of a set
+ * of root modules over a set of observable modules by resolving the
+ * dependences expressed by {@link
+ * java.lang.module.ModuleDescriptor.Requires requires} clauses.
+ * The <em>dependence graph</em> is augmented with edges that take account of
+ * implicitly declared dependences ({@code requires transitive}) to create a
+ * <em>readability graph</em>. The result of resolution is a {@link
+ * java.lang.module.Configuration Configuration} that encapsulates the
+ * readability graph. </p>
+ *
+ * <p> As an example, suppose we have the following observable modules: </p>
+ * <pre> {@code
+ *     module m1 { requires m2; }
+ *     module m2 { requires transitive m3; }
+ *     module m3 { }
+ *     module m4 { }
+ * } </pre>
+ *
+ * <p> If the module {@code m1} is resolved then the resulting configuration
+ * contains three modules ({@code m1}, {@code m2}, {@code m3}). The edges in
+ * its readability graph are: </p>
+ * <pre> {@code
+ *     m1 --> m2  (meaning m1 reads m2)
+ *     m1 --> m3
+ *     m2 --> m3
+ * } </pre>
+ *
+ * <p> Resolution is an additive process. When computing the transitive closure
+ * then the dependence relation may include dependences on modules in {@link
+ * java.lang.module.Configuration#parents() parent} configurations. The result
+ * is a <em>relative configuration</em> that is relative to one or more parent
+ * configurations and where the readability graph may have edges from modules
+ * in the configuration to modules in parent configurations. </p>
+ *
+ * <p> As an example, suppose we have the following observable modules: </p>
+ * <pre> {@code
+ *     module m1 { requires m2; requires java.xml; }
+ *     module m2 { }
+ * } </pre>
+ *
+ * <p> If module {@code m1} is resolved with the configuration for the {@link
+ * java.lang.ModuleLayer#boot() boot} layer as the parent then the resulting
+ * configuration contains two modules ({@code m1}, {@code m2}). The edges in
+ * its readability graph are:
+ * <pre> {@code
+ *     m1 --> m2
+ *     m1 --> java.xml
+ * } </pre>
+ * where module {@code java.xml} is in the parent configuration. For
+ * simplicity, this example omits the implicitly declared dependence on the
+ * {@code java.base} module.
+ *
+ * <p> Requires clauses that are "{@code requires static}" express an optional
+ * dependence (except at compile-time). If a module declares that it
+ * "{@code requires static M}" then resolution does not search the observable
+ * modules for "{@code M}". However, if "{@code M}" is resolved (because resolution
+ * resolves a module that requires "{@code M}" without the {@link
+ * java.lang.module.ModuleDescriptor.Requires.Modifier#STATIC static} modifier)
+ * then the readability graph will contain read edges for each module that
+ * "{@code requires static M}". </p>
+ *
+ * <p> {@link java.lang.module.ModuleDescriptor#isAutomatic() Automatic} modules
+ * receive special treatment during resolution. Each automatic module is resolved
+ * as if it "{@code requires transitive}" all observable automatic modules and
+ * all automatic modules in the parent configurations. Each automatic module is
+ * resolved so that it reads all other modules in the resulting configuration and
+ * all modules in parent configurations. </p>
+ *
+ * <h2><a name="servicebinding">Service binding</a></h2>
+ *
+ * <p> Service binding is the process of augmenting a graph of resolved modules
+ * from the set of observable modules induced by the service-use dependence
+ * ({@code uses} and {@code provides} clauses). Any module that was not
+ * previously in the graph requires resolution to compute its transitive
+ * closure. Service binding is an iterative process in that adding a module
+ * that satisfies some service-use dependence may introduce new service-use
+ * dependences. </p>
+ *
+ * <p> Suppose we have the following observable modules: </p>
+ * <pre> {@code
+ *     module m1 { exports p; uses p.S; }
+ *     module m2 { requires m1; provides p.S with p2.S2; }
+ *     module m3 { requires m1; requires m4; provides p.S with p3.S3; }
+ *     module m4 { }
+ * } </pre>
+ *
+ * <p> If the module {@code m1} is resolved then the resulting graph of modules
+ * has one module ({@code m1}). If the graph is augmented with modules induced
+ * by the service-use dependence relation then the configuration will contain
+ * four modules ({@code m1}, {@code m2}, {@code m3}, {@code m4}). The edges in
+ * its readability graph are: </p>
+ * <pre> {@code
+ *     m2 --> m1
+ *     m3 --> m1
+ *     m3 --> m4
+ * } </pre>
+ * <p> The edges in the conceptual service-use graph are: </p>
+ * <pre> {@code
+ *     m1 --> m2  (meaning m1 uses a service that is provided by m2)
+ *     m1 --> m3
+ * } </pre>
+ *
+ * <h2>General Exceptions</h2>
+ *
  * <p> Unless otherwise noted, passing a {@code null} argument to a constructor
  * or method of any class or interface in this package will cause a {@link
  * java.lang.NullPointerException NullPointerException} to be thrown. Additionally,
@@ -34,6 +140,7 @@
  * will cause a {@code NullPointerException}, unless otherwise specified. </p>
  *
  * @since 9
+ * @spec JPMS
  */
 
 package java.lang.module;
diff --git a/jdk/src/java.base/share/classes/java/lang/ref/FinalReference.java b/jdk/src/java.base/share/classes/java/lang/ref/FinalReference.java
index d763794..bb97d69 100644
--- a/jdk/src/java.base/share/classes/java/lang/ref/FinalReference.java
+++ b/jdk/src/java.base/share/classes/java/lang/ref/FinalReference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,9 @@
     public FinalReference(T referent, ReferenceQueue<? super T> q) {
         super(referent, q);
     }
+
+    @Override
+    public boolean enqueue() {
+        throw new InternalError("should never reach here");
+    }
 }
diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java
index cd4bd80..d66fe1a 100644
--- a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -140,15 +140,24 @@
         }
     }
 
-    /* Atomically get and clear (set to null) the VM's pending list.
+    /*
+     * system property to disable clearing before enqueuing.
+     */
+    private static final boolean disableClearBeforeEnqueue
+        = Boolean.getBoolean("jdk.lang.ref.disableClearBeforeEnqueue");
+
+    /*
+     * Atomically get and clear (set to null) the VM's pending list.
      */
     private static native Reference<Object> getAndClearReferencePendingList();
 
-    /* Test whether the VM's pending list contains any entries.
+    /*
+     * Test whether the VM's pending list contains any entries.
      */
     private static native boolean hasReferencePendingList();
 
-    /* Wait until the VM's pending list may be non-null.
+    /*
+     * Wait until the VM's pending list may be non-null.
      */
     private static native void waitForReferencePendingList();
 
@@ -261,7 +270,6 @@
         this.referent = null;
     }
 
-
     /* -- Queue operations -- */
 
     /**
@@ -278,8 +286,8 @@
     }
 
     /**
-     * Adds this reference object to the queue with which it is registered,
-     * if any.
+     * Clears this reference object and adds it to the queue with which
+     * it is registered, if any.
      *
      * <p> This method is invoked only by Java code; when the garbage collector
      * enqueues references it does so directly, without invoking this method.
@@ -289,10 +297,11 @@
      *           it was not registered with a queue when it was created
      */
     public boolean enqueue() {
+        if (!disableClearBeforeEnqueue)
+            this.referent = null;
         return this.queue.enqueue(this);
     }
 
-
     /* -- Constructors -- */
 
     Reference(T referent) {
@@ -419,5 +428,4 @@
         // HotSpot needs to retain the ref and not GC it before a call to this
         // method
     }
-
 }
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java b/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java
index f585b47..35c689d 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,37 +29,46 @@
 import java.security.AccessController;
 
 import jdk.internal.misc.VM;
+import jdk.internal.module.IllegalAccessLogger;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
 import jdk.internal.reflect.ReflectionFactory;
 import sun.security.action.GetPropertyAction;
 
 /**
- * The AccessibleObject class is the base class for Field, Method and
- * Constructor objects.  It provides the ability to flag a reflected
- * object as suppressing default Java language access control checks
- * when it is used. The access checks -- <em>module boundaries</em>,
- * public, default (package) access, protected, and private members --
- * are performed when Fields, Methods or Constructors are used to set
- * or get fields, to invoke methods or to create and initialize new
- * instances of classes, respectively. Unlike access control specified
- * in the <cite>The Java&trade; Language Specification</cite> and
- * <cite>The Java Virtual Machine Specification</cite>, access checks
- * with reflected objects assume {@link Module#canRead readability}.
+ * The {@code AccessibleObject} class is the base class for {@code Field},
+ * {@code Method}, and {@code Constructor} objects (known as <em>reflected
+ * objects</em>). It provides the ability to flag a reflected object as
+ * suppressing checks for Java language access control when it is used. This
+ * permits sophisticated applications with sufficient privilege, such as Java
+ * Object Serialization or other persistence mechanisms, to manipulate objects
+ * in a manner that would normally be prohibited.
  *
- * <p>Setting the {@code accessible} flag in a reflected object
- * permits sophisticated applications with sufficient privilege, such
- * as Java Object Serialization or other persistence mechanisms, to
- * manipulate objects in a manner that would normally be prohibited.
+ * <p> Java language access control prevents use of private members outside
+ * their class; package access members outside their package; protected members
+ * outside their package or subclasses; and public members outside their
+ * module unless they are declared in an {@link Module#isExported(String,Module)
+ * exported} package and the user {@link Module#canRead reads} their module. By
+ * default, Java language access control is enforced (with one variation) when
+ * {@code Field}s, {@code Method}s, or {@code Constructor}s are used to get or
+ * set fields, to invoke methods, or to create and initialize new instances of
+ * classes, respectively. Every reflected object checks that the code using it
+ * is in an appropriate class, package, or module. </p>
  *
- * <p>By default, a reflected object is <em>not</em> accessible.
+ * <p> The one variation from Java language access control is that the checks
+ * by reflected objects assume readability. That is, the module containing
+ * the use of a reflected object is assumed to read the module in which
+ * the underlying field, method, or constructor is declared. </p>
  *
- * @see Field
- * @see Method
- * @see Constructor
- * @see ReflectPermission
+ * <p> Whether the checks for Java language access control can be suppressed
+ * (and thus, whether access can be enabled) depends on whether the reflected
+ * object corresponds to a member in an exported or open package
+ * (see {@link #setAccessible(boolean)}). </p>
  *
+ * @jls 6.6 Access Control
  * @since 1.2
+ * @revised 9
+ * @spec JPMS
  */
 public class AccessibleObject implements AnnotatedElement {
 
@@ -78,15 +87,11 @@
 
     /**
      * Convenience method to set the {@code accessible} flag for an
-     * array of objects with a single security check (for efficiency).
+     * array of reflected objects with a single security check (for efficiency).
      *
-     * <p>This method cannot be used to enable access to an object that is a
-     * {@link Member member} of a class in a different module to the caller and
-     * where the class is in a package that is not exported to the caller's
-     * module. Additionally, if the member is non-public or its declaring
-     * class is non-public, then this method can only be used to enable access
-     * if the package is {@link Module#isOpen(String,Module) open} to at least
-     * the caller's module.
+     * <p> This method may be used to enable access to all reflected objects in
+     * the array when access to each reflected object can be enabled as
+     * specified by {@link #setAccessible(boolean) setAccessible(boolean)}. </p>
      *
      * <p>If there is a security manager, its
      * {@code checkPermission} method is first called with a
@@ -99,10 +104,15 @@
      * @param array the array of AccessibleObjects
      * @param flag  the new value for the {@code accessible} flag
      *              in each object
-     * @throws InaccessibleObjectException if access cannot be enabled
-     * @throws SecurityException if the request is denied.
+     * @throws InaccessibleObjectException if access cannot be enabled for all
+     *         objects in the array
+     * @throws SecurityException if the request is denied by the security manager
+     *         or an element in the array is a constructor for {@code
+     *         java.lang.Class}
      * @see SecurityManager#checkPermission
      * @see ReflectPermission
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static void setAccessible(AccessibleObject[] array, boolean flag) {
@@ -120,41 +130,143 @@
     }
 
     /**
-     * Set the {@code accessible} flag for this object to
+     * Set the {@code accessible} flag for this reflected object to
      * the indicated boolean value.  A value of {@code true} indicates that
-     * the reflected object should suppress Java language access
-     * checking when it is used.  A value of {@code false} indicates
-     * that the reflected object should enforce Java language access checks
-     * while assuming readability (as noted in the class description).
+     * the reflected object should suppress checks for Java language access
+     * control when it is used. A value of {@code false} indicates that
+     * the reflected object should enforce checks for Java language access
+     * control when it is used, with the variation noted in the class description.
      *
-     * <p>This method cannot be used to enable access to an object that is a
-     * {@link Member member} of a class in a different module to the caller and
-     * where the class is in a package that is not exported to the caller's
-     * module. Additionally, if the member is non-public or its declaring
-     * class is non-public, then this method can only be used to enable access
-     * if the package is {@link Module#isOpen(String,Module) open} to at least
-     * the caller's module.
+     * <p> This method may be used by a caller in class {@code C} to enable
+     * access to a {@link Member member} of {@link Member#getDeclaringClass()
+     * declaring class} {@code D} if any of the following hold: </p>
      *
-     * <p>If there is a security manager, its
+     * <ul>
+     *     <li> {@code C} and {@code D} are in the same module. </li>
+     *
+     *     <li> The member is {@code public} and {@code D} is {@code public} in
+     *     a package that the module containing {@code D} {@link
+     *     Module#isExported(String,Module) exports} to at least the module
+     *     containing {@code C}. </li>
+     *
+     *     <li> The member is {@code protected} {@code static}, {@code D} is
+     *     {@code public} in a package that the module containing {@code D}
+     *     exports to at least the module containing {@code C}, and {@code C}
+     *     is a subclass of {@code D}. </li>
+     *
+     *     <li> {@code D} is in a package that the module containing {@code D}
+     *     {@link Module#isOpen(String,Module) opens} to at least the module
+     *     containing {@code C}.
+     *     All packages in unnamed and open modules are open to all modules and
+     *     so this method always succeeds when {@code D} is in an unnamed or
+     *     open module. </li>
+     * </ul>
+     *
+     * <p> This method cannot be used to enable access to private members,
+     * members with default (package) access, protected instance members, or
+     * protected constructors when the declaring class is in a different module
+     * to the caller and the package containing the declaring class is not open
+     * to the caller's module. </p>
+     *
+     * <p> If there is a security manager, its
      * {@code checkPermission} method is first called with a
      * {@code ReflectPermission("suppressAccessChecks")} permission.
      *
      * @param flag the new value for the {@code accessible} flag
      * @throws InaccessibleObjectException if access cannot be enabled
-     * @throws SecurityException if the request is denied
-     * @see SecurityManager#checkPermission
-     * @see ReflectPermission
+     * @throws SecurityException if the request is denied by the security manager
+     * @see #trySetAccessible
      * @see java.lang.invoke.MethodHandles#privateLookupIn
+     * @revised 9
+     * @spec JPMS
      */
     public void setAccessible(boolean flag) {
         AccessibleObject.checkPermission();
         setAccessible0(flag);
     }
 
-    void setAccessible0(boolean flag) {
+    /**
+     * Sets the accessible flag and returns the new value
+     */
+    boolean setAccessible0(boolean flag) {
         this.override = flag;
+        return flag;
     }
 
+    /**
+     * Set the {@code accessible} flag for this reflected object to {@code true}
+     * if possible. This method sets the {@code accessible} flag, as if by
+     * invoking {@link #setAccessible(boolean) setAccessible(true)}, and returns
+     * the possibly-updated value for the {@code accessible} flag. If access
+     * cannot be enabled, i.e. the checks or Java language access control cannot
+     * be suppressed, this method returns {@code false} (as opposed to {@code
+     * setAccessible(true)} throwing {@code InaccessibleObjectException} when
+     * it fails).
+     *
+     * <p> This method is a no-op if the {@code accessible} flag for
+     * this reflected object is {@code true}.
+     *
+     * <p> For example, a caller can invoke {@code trySetAccessible}
+     * on a {@code Method} object for a private instance method
+     * {@code p.T::privateMethod} to suppress the checks for Java language access
+     * control when the {@code Method} is invoked.
+     * If {@code p.T} class is in a different module to the caller and
+     * package {@code p} is open to at least the caller's module,
+     * the code below successfully sets the {@code accessible} flag
+     * to {@code true}.
+     *
+     * <pre>
+     * {@code
+     *     p.T obj = ....;  // instance of p.T
+     *     :
+     *     Method m = p.T.class.getDeclaredMethod("privateMethod");
+     *     if (m.trySetAccessible()) {
+     *         m.invoke(obj);
+     *     } else {
+     *         // package p is not opened to the caller to access private member of T
+     *         ...
+     *     }
+     * }</pre>
+     *
+     * <p> If there is a security manager, its {@code checkPermission} method
+     * is first called with a {@code ReflectPermission("suppressAccessChecks")}
+     * permission. </p>
+     *
+     * @return {@code true} if the {@code accessible} flag is set to {@code true};
+     *         {@code false} if access cannot be enabled.
+     * @throws SecurityException if the request is denied by the security manager
+     *
+     * @since 9
+     * @spec JPMS
+     * @see java.lang.invoke.MethodHandles#privateLookupIn
+     */
+    @CallerSensitive
+    public final boolean trySetAccessible() {
+        AccessibleObject.checkPermission();
+
+        if (override == true) return true;
+
+        // if it's not a Constructor, Method, Field then no access check
+        if (!Member.class.isInstance(this)) {
+            return setAccessible0(true);
+        }
+
+        // does not allow to suppress access check for Class's constructor
+        Class<?> declaringClass = ((Member) this).getDeclaringClass();
+        if (declaringClass == Class.class && this instanceof Constructor) {
+            return false;
+        }
+
+        if (checkCanSetAccessible(Reflection.getCallerClass(),
+                                  declaringClass,
+                                  false)) {
+            return setAccessible0(true);
+        } else {
+            return false;
+        }
+    }
+
+
    /**
     * If the given AccessibleObject is a {@code Constructor}, {@code Method}
     * or {@code Field} then checks that its declaring class is in a package
@@ -164,107 +276,207 @@
         // do nothing, needs to be overridden by Constructor, Method, Field
     }
 
+
     void checkCanSetAccessible(Class<?> caller, Class<?> declaringClass) {
+        checkCanSetAccessible(caller, declaringClass, true);
+    }
+
+    private boolean checkCanSetAccessible(Class<?> caller,
+                                          Class<?> declaringClass,
+                                          boolean throwExceptionIfDenied) {
         Module callerModule = caller.getModule();
         Module declaringModule = declaringClass.getModule();
 
-        if (callerModule == declaringModule) return;
-        if (callerModule == Object.class.getModule()) return;
-        if (!declaringModule.isNamed()) return;
+        if (callerModule == declaringModule) return true;
+        if (callerModule == Object.class.getModule()) return true;
+        if (!declaringModule.isNamed()) return true;
 
-        // package is open to caller
-        String pn = packageName(declaringClass);
-        if (declaringModule.isOpen(pn, callerModule)) {
-            printStackTraceIfOpenedReflectively(declaringModule, pn, callerModule);
-            return;
-        }
-
-        // package is exported to caller and class/member is public
-        boolean isExported = declaringModule.isExported(pn, callerModule);
-        boolean isClassPublic = Modifier.isPublic(declaringClass.getModifiers());
+        String pn = declaringClass.getPackageName();
         int modifiers;
         if (this instanceof Executable) {
             modifiers = ((Executable) this).getModifiers();
         } else {
             modifiers = ((Field) this).getModifiers();
         }
-        boolean isMemberPublic = Modifier.isPublic(modifiers);
-        if (isExported && isClassPublic && isMemberPublic) {
-            printStackTraceIfExportedReflectively(declaringModule, pn, callerModule);
-            return;
+
+        // class is public and package is exported to caller
+        boolean isClassPublic = Modifier.isPublic(declaringClass.getModifiers());
+        if (isClassPublic && declaringModule.isExported(pn, callerModule)) {
+            // member is public
+            if (Modifier.isPublic(modifiers)) {
+                logIfExportedByBackdoor(caller, declaringClass);
+                return true;
+            }
+
+            // member is protected-static
+            if (Modifier.isProtected(modifiers)
+                && Modifier.isStatic(modifiers)
+                && isSubclassOf(caller, declaringClass)) {
+                logIfExportedByBackdoor(caller, declaringClass);
+                return true;
+            }
         }
 
-        // not accessible
-        String msg = "Unable to make ";
-        if (this instanceof Field)
-            msg += "field ";
-        msg += this + " accessible: " + declaringModule + " does not \"";
-        if (isClassPublic && isMemberPublic)
-            msg += "exports";
-        else
-            msg += "opens";
-        msg += " " + pn + "\" to " + callerModule;
-        InaccessibleObjectException e = new InaccessibleObjectException(msg);
-        if (Reflection.printStackTraceWhenAccessFails()) {
-            e.printStackTrace(System.err);
+        // package is open to caller
+        if (declaringModule.isOpen(pn, callerModule)) {
+            logIfOpenedByBackdoor(caller, declaringClass);
+            return true;
         }
-        throw e;
-    }
 
-    private void printStackTraceIfOpenedReflectively(Module module,
-                                                     String pn,
-                                                     Module other) {
-        printStackTraceIfExposedReflectively(module, pn, other, true);
-    }
-
-    private void printStackTraceIfExportedReflectively(Module module,
-                                                       String pn,
-                                                       Module other) {
-        printStackTraceIfExposedReflectively(module, pn, other, false);
-    }
-
-    private void printStackTraceIfExposedReflectively(Module module,
-                                                      String pn,
-                                                      Module other,
-                                                      boolean open)
-    {
-        if (Reflection.printStackTraceWhenAccessSucceeds()
-            && !module.isStaticallyExportedOrOpen(pn, other, open))
-        {
-            String msg = other + " allowed to invoke setAccessible on ";
+        if (throwExceptionIfDenied) {
+            // not accessible
+            String msg = "Unable to make ";
             if (this instanceof Field)
                 msg += "field ";
-            msg += this;
-            new Exception(msg) {
-                private static final long serialVersionUID = 42L;
-                public String toString() {
-                    return "WARNING: " + getMessage();
-                }
-            }.printStackTrace(System.err);
+            msg += this + " accessible: " + declaringModule + " does not \"";
+            if (isClassPublic && Modifier.isPublic(modifiers))
+                msg += "exports";
+            else
+                msg += "opens";
+            msg += " " + pn + "\" to " + callerModule;
+            InaccessibleObjectException e = new InaccessibleObjectException(msg);
+            if (printStackTraceWhenAccessFails()) {
+                e.printStackTrace(System.err);
+            }
+            throw e;
+        }
+        return false;
+    }
+
+    private boolean isSubclassOf(Class<?> queryClass, Class<?> ofClass) {
+        while (queryClass != null) {
+            if (queryClass == ofClass) {
+                return true;
+            }
+            queryClass = queryClass.getSuperclass();
+        }
+        return false;
+    }
+
+    private void logIfOpenedByBackdoor(Class<?> caller, Class<?> declaringClass) {
+        Module callerModule = caller.getModule();
+        Module targetModule = declaringClass.getModule();
+        // callerModule is null during early startup
+        if (callerModule != null && !callerModule.isNamed() && targetModule.isNamed()) {
+            IllegalAccessLogger logger = IllegalAccessLogger.illegalAccessLogger();
+            if (logger != null) {
+                logger.logIfOpenedByBackdoor(caller, declaringClass, this::toShortString);
+            }
+        }
+    }
+
+    private void logIfExportedByBackdoor(Class<?> caller, Class<?> declaringClass) {
+        Module callerModule = caller.getModule();
+        Module targetModule = declaringClass.getModule();
+        // callerModule is null during early startup
+        if (callerModule != null && !callerModule.isNamed() && targetModule.isNamed()) {
+            IllegalAccessLogger logger = IllegalAccessLogger.illegalAccessLogger();
+            if (logger != null) {
+                logger.logIfExportedByBackdoor(caller, declaringClass, this::toShortString);
+            }
         }
     }
 
     /**
-     * Returns the package name of the given class.
+     * Returns a short descriptive string to describe this object in log messages.
      */
-    private static String packageName(Class<?> c) {
-        while (c.isArray()) {
-            c = c.getComponentType();
-        }
-        String pn = c.getPackageName();
-        return (pn != null) ? pn : "";
+    String toShortString() {
+        return toString();
     }
 
     /**
-     * Get the value of the {@code accessible} flag for this object.
+     * Get the value of the {@code accessible} flag for this reflected object.
      *
      * @return the value of the object's {@code accessible} flag
+     *
+     * @deprecated
+     * This method is deprecated because its name hints that it checks
+     * if the reflected object is accessible when it actually indicates
+     * if the checks for Java language access control are suppressed.
+     * This method may return {@code false} on a reflected object that is
+     * accessible to the caller. To test if this reflected object is accessible,
+     * it should use {@link #canAccess(Object)}.
+     *
+     * @revised 9
+     * @spec JPMS
      */
+    @Deprecated(since="9")
     public boolean isAccessible() {
         return override;
     }
 
     /**
+     * Test if the caller can access this reflected object. If this reflected
+     * object corresponds to an instance method or field then this method tests
+     * if the caller can access the given {@code obj} with the reflected object.
+     * For instance methods or fields then the {@code obj} argument must be an
+     * instance of the {@link Member#getDeclaringClass() declaring class}. For
+     * static members and constructors then {@code obj} must be {@code null}.
+     *
+     * <p> This method returns {@code true} if the {@code accessible} flag
+     * is set to {@code true}, i.e. the checks for Java language access control
+     * are suppressed, or if the caller can access the member as
+     * specified in <cite>The Java&trade; Language Specification</cite>,
+     * with the variation noted in the class description. </p>
+     *
+     * @param obj an instance object of the declaring class of this reflected
+     *            object if it is an instance method or field
+     *
+     * @return {@code true} if the caller can access this reflected object.
+     *
+     * @throws IllegalArgumentException
+     *         <ul>
+     *         <li> if this reflected object is a static member or constructor and
+     *              the given {@code obj} is non-{@code null}, or </li>
+     *         <li> if this reflected object is an instance method or field
+     *              and the given {@code obj} is {@code null} or of type
+     *              that is not a subclass of the {@link Member#getDeclaringClass()
+     *              declaring class} of the member.</li>
+     *         </ul>
+     *
+     * @since 9
+     * @spec JPMS
+     * @jls 6.6 Access Control
+     * @see #trySetAccessible
+     * @see #setAccessible(boolean)
+     */
+    @CallerSensitive
+    public final boolean canAccess(Object obj) {
+        if (!Member.class.isInstance(this)) {
+            return override;
+        }
+
+        Class<?> declaringClass = ((Member) this).getDeclaringClass();
+        int modifiers = ((Member) this).getModifiers();
+        if (!Modifier.isStatic(modifiers) &&
+                (this instanceof Method || this instanceof Field)) {
+            if (obj == null) {
+                throw new IllegalArgumentException("null object for " + this);
+            }
+            // if this object is an instance member, the given object
+            // must be a subclass of the declaring class of this reflected object
+            if (!declaringClass.isAssignableFrom(obj.getClass())) {
+                throw new IllegalArgumentException("object is not an instance of "
+                                                   + declaringClass.getName());
+            }
+        } else if (obj != null) {
+            throw new IllegalArgumentException("non-null object for " + this);
+        }
+
+        // access check is suppressed
+        if (override) return true;
+
+        Class<?> caller = Reflection.getCallerClass();
+        Class<?> targetClass;
+        if (this instanceof Constructor) {
+            targetClass = declaringClass;
+        } else {
+            targetClass = Modifier.isStatic(modifiers) ? null : obj.getClass();
+        }
+        return verifyAccess(caller, declaringClass, targetClass, modifiers);
+    }
+
+    /**
      * Constructor: only used by the Java Virtual Machine.
      */
     protected AccessibleObject() {}
@@ -302,7 +514,7 @@
         return AnnotatedElement.super.isAnnotationPresent(annotationClass);
     }
 
-   /**
+    /**
      * @throws NullPointerException {@inheritDoc}
      * @since 1.8
      */
@@ -373,8 +585,21 @@
                            Class<?> targetClass, int modifiers)
         throws IllegalAccessException
     {
+        if (!verifyAccess(caller, memberClass, targetClass, modifiers)) {
+            IllegalAccessException e = Reflection.newIllegalAccessException(
+                caller, memberClass, targetClass, modifiers);
+            if (printStackTraceWhenAccessFails()) {
+                e.printStackTrace(System.err);
+            }
+            throw e;
+        }
+    }
+
+    final boolean verifyAccess(Class<?> caller, Class<?> memberClass,
+                               Class<?> targetClass, int modifiers)
+    {
         if (caller == memberClass) {  // quick check
-            return;             // ACCESS IS OK
+            return true;             // ACCESS IS OK
         }
         Object cache = securityCheckCache;  // read volatile
         if (targetClass != null // instance member or constructor
@@ -385,26 +610,31 @@
                 Class<?>[] cache2 = (Class<?>[]) cache;
                 if (cache2[1] == targetClass &&
                     cache2[0] == caller) {
-                    return;     // ACCESS IS OK
+                    return true;     // ACCESS IS OK
                 }
                 // (Test cache[1] first since range check for [1]
                 // subsumes range check for [0].)
             }
         } else if (cache == caller) {
             // Non-protected case (or targetClass == memberClass or static member).
-            return;             // ACCESS IS OK
+            return true;             // ACCESS IS OK
         }
 
         // If no return, fall through to the slow path.
-        slowCheckMemberAccess(caller, memberClass, targetClass, modifiers);
+        return slowVerifyAccess(caller, memberClass, targetClass, modifiers);
     }
 
     // Keep all this slow stuff out of line:
-    void slowCheckMemberAccess(Class<?> caller, Class<?> memberClass,
-                               Class<?> targetClass, int modifiers)
-        throws IllegalAccessException
+    private boolean slowVerifyAccess(Class<?> caller, Class<?> memberClass,
+                                     Class<?> targetClass, int modifiers)
     {
-        Reflection.ensureMemberAccess(caller, memberClass, targetClass, modifiers);
+        if (!Reflection.verifyMemberAccess(caller, memberClass, targetClass, modifiers)) {
+            // access denied
+            return false;
+        }
+
+        // access okay
+        logIfExportedByBackdoor(caller, memberClass);
 
         // Success: Update the cache.
         Object cache = (targetClass != null
@@ -418,5 +648,27 @@
         // guarantees that the initializing stores for the cache
         // elements will occur before the volatile write.
         securityCheckCache = cache;         // write volatile
+        return true;
+    }
+
+    // true to print a stack trace when access fails
+    private static volatile boolean printStackWhenAccessFails;
+
+    // true if printStack* values are initialized
+    private static volatile boolean printStackPropertiesSet;
+
+    /**
+     * Returns true if a stack trace should be printed when access fails.
+     */
+    private static boolean printStackTraceWhenAccessFails() {
+        if (!printStackPropertiesSet && VM.initLevel() >= 1) {
+            String s = GetPropertyAction.privilegedGetProperty(
+                    "sun.reflect.debugModuleAccessChecks");
+            if (s != null) {
+                printStackWhenAccessFails = !s.equalsIgnoreCase("false");
+            }
+            printStackPropertiesSet = true;
+        }
+        return printStackWhenAccessFails;
     }
 }
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java
index f64e84f..ecc3fd1 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java
@@ -38,6 +38,7 @@
 import sun.reflect.generics.scope.ConstructorScope;
 import java.lang.annotation.Annotation;
 import java.lang.annotation.AnnotationFormatError;
+import java.util.StringJoiner;
 
 /**
  * {@code Constructor} provides information about, and access to, a single
@@ -168,6 +169,12 @@
      * is true. </p>
      *
      * @param flag {@inheritDoc}
+     *
+     * @throws InaccessibleObjectException {@inheritDoc}
+     * @throws SecurityException if the request is denied by the security manager
+     *         or this is a constructor for {@code java.lang.Class}
+     *
+     * @spec JPMS
      */
     @Override
     @CallerSensitive
@@ -353,6 +360,20 @@
         sb.append(getDeclaringClass().getTypeName());
     }
 
+    @Override
+    String toShortString() {
+        StringBuilder sb = new StringBuilder("constructor ");
+        sb.append(getDeclaringClass().getTypeName());
+        sb.append('(');
+        StringJoiner sj = new StringJoiner(",");
+        for (Class<?> parameterType : getParameterTypes()) {
+            sj.add(parameterType.getTypeName());
+        }
+        sb.append(sj);
+        sb.append(')');
+        return sb.toString();
+    }
+
     /**
      * Returns a string describing this {@code Constructor},
      * including type parameters.  The string is formatted as the
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Field.java b/jdk/src/java.base/share/classes/java/lang/reflect/Field.java
index 05b7178..1f1192f 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Field.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Field.java
@@ -158,6 +158,10 @@
         return res;
     }
 
+    /**
+     * @throws InaccessibleObjectException {@inheritDoc}
+     * @throws SecurityException {@inheritDoc}
+     */
     @Override
     @CallerSensitive
     public void setAccessible(boolean flag) {
@@ -320,6 +324,11 @@
             + getName());
     }
 
+    @Override
+    String toShortString() {
+        return "field " + getDeclaringClass().getTypeName() + "." + getName();
+    }
+
     /**
      * Returns a string describing this {@code Field}, including
      * its generic type.  The format is the access modifiers for the
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/InaccessibleObjectException.java b/jdk/src/java.base/share/classes/java/lang/reflect/InaccessibleObjectException.java
index 34db515..b03d449 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/InaccessibleObjectException.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/InaccessibleObjectException.java
@@ -30,6 +30,7 @@
  *
  * @see AccessibleObject#setAccessible(boolean)
  * @since 9
+ * @spec JPMS
  */
 
 public class InaccessibleObjectException extends RuntimeException {
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java b/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java
deleted file mode 100644
index 9eaf90d..0000000
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java
+++ /dev/null
@@ -1,921 +0,0 @@
-/*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.lang.reflect;
-
-import java.lang.module.Configuration;
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ResolvedModule;
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import jdk.internal.loader.ClassLoaderValue;
-import jdk.internal.loader.Loader;
-import jdk.internal.loader.LoaderPool;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.module.Modules;
-import jdk.internal.module.ServicesCatalog;
-import sun.security.util.SecurityConstants;
-
-
-/**
- * A layer of modules in the Java virtual machine.
- *
- * <p> A layer is created from a graph of modules that is the {@link
- * Configuration} and a function that maps each module to a {@link ClassLoader}.
- * Creating a layer informs the Java virtual machine about the classes that
- * may be loaded from modules so that the Java virtual machine knows which
- * module that each class is a member of. Each layer, except the {@link
- * #empty() empty} layer, has at least one {@link #parents() parent}. </p>
- *
- * <p> Creating a layer creates a {@link Module} object for each {@link
- * ResolvedModule} in the configuration. For each resolved module that is
- * {@link ResolvedModule#reads() read}, the {@code Module} {@link
- * Module#canRead reads} the corresponding run-time {@code Module}, which may
- * be in the same layer or a parent layer. The {@code Module} {@link
- * Module#isExported(String) exports} the packages described by its {@link
- * ModuleDescriptor}. </p>
- *
- * <p> The {@link #defineModulesWithOneLoader defineModulesWithOneLoader} and
- * {@link #defineModulesWithManyLoaders defineModulesWithManyLoaders} methods
- * provide convenient ways to create a {@code Layer} where all modules are
- * mapped to a single class loader or where each module is mapped to its own
- * class loader. The {@link #defineModules defineModules} method is for more
- * advanced cases where modules are mapped to custom class loaders by means of
- * a function specified to the method. Each of these methods has an instance
- * and static variant. The instance methods create a layer with the receiver
- * as the parent layer. The static methods are for more advanced cases where
- * there can be more than one parent layer or a {@link Layer.Controller
- * Controller} is needed to control modules in the layer. </p>
- *
- * <p> A Java virtual machine has at least one non-empty layer, the {@link
- * #boot() boot} layer, that is created when the Java virtual machine is
- * started. The boot layer contains module {@code java.base} and is the only
- * layer in the Java virtual machine with a module named "{@code java.base}".
- * The modules in the boot layer are mapped to the bootstrap class loader and
- * other class loaders that are <a href="../ClassLoader.html#builtinLoaders">
- * built-in</a> into the Java virtual machine. The boot layer will often be
- * the {@link #parents() parent} when creating additional layers. </p>
- *
- * <p> As when creating a {@code Configuration},
- * {@link ModuleDescriptor#isAutomatic() automatic} modules receive
- * <a href="../module/Configuration.html#automaticmoduleresolution">special
- * treatment</a> when creating a layer. An automatic module is created in the
- * Java virtual machine as a {@code Module} that reads every unnamed {@code
- * Module} in the Java virtual machine. </p>
- *
- * <p> Unless otherwise specified, passing a {@code null} argument to a method
- * in this class causes a {@link NullPointerException NullPointerException} to
- * be thrown. </p>
- *
- * <h3> Example usage: </h3>
- *
- * <p> This example creates a configuration by resolving a module named
- * "{@code myapp}" with the configuration for the boot layer as the parent. It
- * then creates a new layer with the modules in this configuration. All modules
- * are defined to the same class loader. </p>
- *
- * <pre>{@code
- *     ModuleFinder finder = ModuleFinder.of(dir1, dir2, dir3);
- *
- *     Layer parent = Layer.boot();
- *
- *     Configuration cf = parent.configuration()
- *         .resolveRequires(finder, ModuleFinder.of(), Set.of("myapp"));
- *
- *     ClassLoader scl = ClassLoader.getSystemClassLoader();
- *
- *     Layer layer = parent.defineModulesWithOneLoader(cf, scl);
- *
- *     Class<?> c = layer.findLoader("myapp").loadClass("app.Main");
- * }</pre>
- *
- * @since 9
- * @see Module#getLayer()
- */
-
-public final class Layer {
-
-    // the empty Layer
-    private static final Layer EMPTY_LAYER
-        = new Layer(Configuration.empty(), List.of(), null);
-
-    // the configuration from which this Layer was created
-    private final Configuration cf;
-
-    // parent layers, empty in the case of the empty layer
-    private final List<Layer> parents;
-
-    // maps module name to jlr.Module
-    private final Map<String, Module> nameToModule;
-
-    /**
-     * Creates a new Layer from the modules in the given configuration.
-     */
-    private Layer(Configuration cf,
-                  List<Layer> parents,
-                  Function<String, ClassLoader> clf)
-    {
-        this.cf = cf;
-        this.parents = parents; // no need to do defensive copy
-
-        Map<String, Module> map;
-        if (parents.isEmpty()) {
-            map = Collections.emptyMap();
-        } else {
-            map = Module.defineModules(cf, clf, this);
-        }
-        this.nameToModule = map; // no need to do defensive copy
-    }
-
-    /**
-     * Controls a layer. The static methods defined by {@link Layer} to create
-     * module layers return a {@code Controller} that can be used to control
-     * modules in the layer.
-     *
-     * @apiNote Care should be taken with {@code Controller} objects, they
-     * should never be shared with untrusted code.
-     *
-     * @since 9
-     */
-    public static final class Controller {
-        private final Layer layer;
-
-        Controller(Layer layer) {
-            this.layer = layer;
-        }
-
-        /**
-         * Returns the layer that this object controls.
-         *
-         * @return the layer
-         */
-        public Layer layer() {
-            return layer;
-        }
-
-        private void ensureInLayer(Module source) {
-            if (!layer.modules().contains(source))
-                throw new IllegalArgumentException(source + " not in layer");
-        }
-
-
-        /**
-         * Updates module {@code source} in the layer to read module
-         * {@code target}. This method is a no-op if {@code source} already
-         * reads {@code target}.
-         *
-         * @implNote <em>Read edges</em> added by this method are <em>weak</em>
-         * and do not prevent {@code target} from being GC'ed when {@code source}
-         * is strongly reachable.
-         *
-         * @param  source
-         *         The source module
-         * @param  target
-         *         The target module to read
-         *
-         * @return This controller
-         *
-         * @throws IllegalArgumentException
-         *         If {@code source} is not in the layer
-         *
-         * @see Module#addReads
-         */
-        public Controller addReads(Module source, Module target) {
-            Objects.requireNonNull(source);
-            Objects.requireNonNull(target);
-            ensureInLayer(source);
-            Modules.addReads(source, target);
-            return this;
-        }
-
-        /**
-         * Updates module {@code source} in the layer to open a package to
-         * module {@code target}. This method is a no-op if {@code source}
-         * already opens the package to at least {@code target}.
-         *
-         * @param  source
-         *         The source module
-         * @param  pn
-         *         The package name
-         * @param  target
-         *         The target module to read
-         *
-         * @return This controller
-         *
-         * @throws IllegalArgumentException
-         *         If {@code source} is not in the layer or the package is not
-         *         in the source module
-         *
-         * @see Module#addOpens
-         */
-        public Controller addOpens(Module source, String pn, Module target) {
-            Objects.requireNonNull(source);
-            Objects.requireNonNull(target);
-            ensureInLayer(source);
-            Modules.addOpens(source, pn, target);
-            return this;
-        }
-    }
-
-
-    /**
-     * Creates a new layer, with this layer as its parent, by defining the
-     * modules in the given {@code Configuration} to the Java virtual machine.
-     * This method creates one class loader and defines all modules to that
-     * class loader. The {@link ClassLoader#getParent() parent} of each class
-     * loader is the given parent class loader. This method works exactly as
-     * specified by the static {@link
-     * #defineModulesWithOneLoader(Configuration,List,ClassLoader)
-     * defineModulesWithOneLoader} method when invoked with this layer as the
-     * parent. In other words, if this layer is {@code thisLayer} then this
-     * method is equivalent to invoking:
-     * <pre> {@code
-     *     Layer.defineModulesWithOneLoader(cf, List.of(thisLayer), parentLoader).layer();
-     * }</pre>
-     *
-     * @param  cf
-     *         The configuration for the layer
-     * @param  parentLoader
-     *         The parent class loader for the class loader created by this
-     *         method; may be {@code null} for the bootstrap class loader
-     *
-     * @return The newly created layer
-     *
-     * @throws IllegalArgumentException
-     *         If the parent of the given configuration is not the configuration
-     *         for this layer
-     * @throws LayerInstantiationException
-     *         If all modules cannot be defined to the same class loader for any
-     *         of the reasons listed above or the layer cannot be created because
-     *         the configuration contains a module named "{@code java.base}" or
-     *         a module with a package name starting with "{@code java.}"
-     * @throws SecurityException
-     *         If {@code RuntimePermission("createClassLoader")} or
-     *         {@code RuntimePermission("getClassLoader")} is denied by
-     *         the security manager
-     *
-     * @see #findLoader
-     */
-    public Layer defineModulesWithOneLoader(Configuration cf,
-                                            ClassLoader parentLoader) {
-        return defineModulesWithOneLoader(cf, List.of(this), parentLoader).layer();
-    }
-
-
-    /**
-     * Creates a new layer, with this layer as its parent, by defining the
-     * modules in the given {@code Configuration} to the Java virtual machine.
-     * Each module is defined to its own {@link ClassLoader} created by this
-     * method. The {@link ClassLoader#getParent() parent} of each class loader
-     * is the given parent class loader. This method works exactly as specified
-     * by the static {@link
-     * #defineModulesWithManyLoaders(Configuration,List,ClassLoader)
-     * defineModulesWithManyLoaders} method when invoked with this layer as the
-     * parent. In other words, if this layer is {@code thisLayer} then this
-     * method is equivalent to invoking:
-     * <pre> {@code
-     *     Layer.defineModulesWithManyLoaders(cf, List.of(thisLayer), parentLoader).layer();
-     * }</pre>
-     *
-     * @param  cf
-     *         The configuration for the layer
-     * @param  parentLoader
-     *         The parent class loader for each of the class loaders created by
-     *         this method; may be {@code null} for the bootstrap class loader
-     *
-     * @return The newly created layer
-     *
-     * @throws IllegalArgumentException
-     *         If the parent of the given configuration is not the configuration
-     *         for this layer
-     * @throws LayerInstantiationException
-     *         If the layer cannot be created because the configuration contains
-     *         a module named "{@code java.base}" or a module with a package
-     *         name starting with "{@code java.}"
-     * @throws SecurityException
-     *         If {@code RuntimePermission("createClassLoader")} or
-     *         {@code RuntimePermission("getClassLoader")} is denied by
-     *         the security manager
-     *
-     * @see #findLoader
-     */
-    public Layer defineModulesWithManyLoaders(Configuration cf,
-                                              ClassLoader parentLoader) {
-        return defineModulesWithManyLoaders(cf, List.of(this), parentLoader).layer();
-    }
-
-
-    /**
-     * Creates a new layer, with this layer as its parent, by defining the
-     * modules in the given {@code Configuration} to the Java virtual machine.
-     * Each module is mapped, by name, to its class loader by means of the
-     * given function. This method works exactly as specified by the static
-     * {@link #defineModules(Configuration,List,Function) defineModules}
-     * method when invoked with this layer as the parent. In other words, if
-     * this layer is {@code thisLayer} then this method is equivalent to
-     * invoking:
-     * <pre> {@code
-     *     Layer.defineModules(cf, List.of(thisLayer), clf).layer();
-     * }</pre>
-     *
-     * @param  cf
-     *         The configuration for the layer
-     * @param  clf
-     *         The function to map a module name to a class loader
-     *
-     * @return The newly created layer
-     *
-     * @throws IllegalArgumentException
-     *         If the parent of the given configuration is not the configuration
-     *         for this layer
-     * @throws LayerInstantiationException
-     *         If creating the {@code Layer} fails for any of the reasons
-     *         listed above, the layer cannot be created because the
-     *         configuration contains a module named "{@code java.base}",
-     *         a module with a package name starting with "{@code java.}" is
-     *         mapped to a class loader other than the {@link
-     *         ClassLoader#getPlatformClassLoader() platform class loader},
-     *         or the function to map a module name to a class loader returns
-     *         {@code null}
-     * @throws SecurityException
-     *         If {@code RuntimePermission("getClassLoader")} is denied by
-     *         the security manager
-     */
-    public Layer defineModules(Configuration cf,
-                               Function<String, ClassLoader> clf) {
-        return defineModules(cf, List.of(this), clf).layer();
-    }
-
-    /**
-     * Creates a new layer by defining the modules in the given {@code
-     * Configuration} to the Java virtual machine. This method creates one
-     * class loader and defines all modules to that class loader.
-     *
-     * <p> The class loader created by this method implements <em>direct
-     * delegation</em> when loading types from modules. When its {@link
-     * ClassLoader#loadClass(String, boolean) loadClass} method is invoked to
-     * load a class then it uses the package name of the class to map it to a
-     * module. This may be a module in this layer and hence defined to the same
-     * class loader. It may be a package in a module in a parent layer that is
-     * exported to one or more of the modules in this layer. The class
-     * loader delegates to the class loader of the module, throwing {@code
-     * ClassNotFoundException} if not found by that class loader.
-     *
-     * When {@code loadClass} is invoked to load classes that do not map to a
-     * module then it delegates to the parent class loader. </p>
-     *
-     * <p> Attempting to create a layer with all modules defined to the same
-     * class loader can fail for the following reasons:
-     *
-     * <ul>
-     *
-     *     <li><p> <em>Overlapping packages</em>: Two or more modules in the
-     *     configuration have the same package. </p></li>
-     *
-     *     <li><p> <em>Split delegation</em>: The resulting class loader would
-     *     need to delegate to more than one class loader in order to load types
-     *     in a specific package. </p></li>
-     *
-     * </ul>
-     *
-     * <p> If there is a security manager then the class loader created by
-     * this method will load classes and resources with privileges that are
-     * restricted by the calling context of this method. </p>
-     *
-     * @param  cf
-     *         The configuration for the layer
-     * @param  parentLayers
-     *         The list parent layers in search order
-     * @param  parentLoader
-     *         The parent class loader for the class loader created by this
-     *         method; may be {@code null} for the bootstrap class loader
-     *
-     * @return A controller that controls the newly created layer
-     *
-     * @throws IllegalArgumentException
-     *         If the parent configurations do not match the configuration of
-     *         the parent layers, including order
-     * @throws LayerInstantiationException
-     *         If all modules cannot be defined to the same class loader for any
-     *         of the reasons listed above or the layer cannot be created because
-     *         the configuration contains a module named "{@code java.base}" or
-     *         a module with a package name starting with "{@code java.}"
-     * @throws SecurityException
-     *         If {@code RuntimePermission("createClassLoader")} or
-     *         {@code RuntimePermission("getClassLoader")} is denied by
-     *         the security manager
-     *
-     * @see #findLoader
-     */
-    public static Controller defineModulesWithOneLoader(Configuration cf,
-                                                        List<Layer> parentLayers,
-                                                        ClassLoader parentLoader)
-    {
-        List<Layer> parents = new ArrayList<>(parentLayers);
-        checkConfiguration(cf, parents);
-
-        checkCreateClassLoaderPermission();
-        checkGetClassLoaderPermission();
-
-        try {
-            Loader loader = new Loader(cf.modules(), parentLoader);
-            loader.initRemotePackageMap(cf, parents);
-            Layer layer =  new Layer(cf, parents, mn -> loader);
-            return new Controller(layer);
-        } catch (IllegalArgumentException | IllegalStateException e) {
-            throw new LayerInstantiationException(e.getMessage());
-        }
-    }
-
-    /**
-     * Creates a new layer by defining the modules in the given {@code
-     * Configuration} to the Java virtual machine. Each module is defined to
-     * its own {@link ClassLoader} created by this method. The {@link
-     * ClassLoader#getParent() parent} of each class loader is the given parent
-     * class loader.
-     *
-     * <p> The class loaders created by this method implement <em>direct
-     * delegation</em> when loading types from modules. When {@link
-     * ClassLoader#loadClass(String, boolean) loadClass} method is invoked to
-     * load a class then it uses the package name of the class to map it to a
-     * module. The package may be in the module defined to the class loader.
-     * The package may be exported by another module in this layer to the
-     * module defined to the class loader. It may be in a package exported by a
-     * module in a parent layer. The class loader delegates to the class loader
-     * of the module, throwing {@code ClassNotFoundException} if not found by
-     * that class loader.
-     *
-     * When {@code loadClass} is invoked to load classes that do not map to a
-     * module then it delegates to the parent class loader. </p>
-     *
-     * <p> If there is a security manager then the class loaders created by
-     * this method will load classes and resources with privileges that are
-     * restricted by the calling context of this method. </p>
-     *
-     * @param  cf
-     *         The configuration for the layer
-     * @param  parentLayers
-     *         The list parent layers in search order
-     * @param  parentLoader
-     *         The parent class loader for each of the class loaders created by
-     *         this method; may be {@code null} for the bootstrap class loader
-     *
-     * @return A controller that controls the newly created layer
-     *
-     * @throws IllegalArgumentException
-     *         If the parent configurations do not match the configuration of
-     *         the parent layers, including order
-     * @throws LayerInstantiationException
-     *         If the layer cannot be created because the configuration contains
-     *         a module named "{@code java.base}" or a module with a package
-     *         name starting with "{@code java.}"
-     * @throws SecurityException
-     *         If {@code RuntimePermission("createClassLoader")} or
-     *         {@code RuntimePermission("getClassLoader")} is denied by
-     *         the security manager
-     *
-     * @see #findLoader
-     */
-    public static Controller defineModulesWithManyLoaders(Configuration cf,
-                                                          List<Layer> parentLayers,
-                                                          ClassLoader parentLoader)
-    {
-        List<Layer> parents = new ArrayList<>(parentLayers);
-        checkConfiguration(cf, parents);
-
-        checkCreateClassLoaderPermission();
-        checkGetClassLoaderPermission();
-
-        LoaderPool pool = new LoaderPool(cf, parents, parentLoader);
-        try {
-            Layer layer = new Layer(cf, parents, pool::loaderFor);
-            return new Controller(layer);
-        } catch (IllegalArgumentException | IllegalStateException e) {
-            throw new LayerInstantiationException(e.getMessage());
-        }
-    }
-
-    /**
-     * Creates a new layer by defining the modules in the given {@code
-     * Configuration} to the Java virtual machine.
-     * Each module is mapped, by name, to its class loader by means of the
-     * given function. The class loader delegation implemented by these class
-     * loaders must respect module readability. The class loaders should be
-     * {@link ClassLoader#registerAsParallelCapable parallel-capable} so as to
-     * avoid deadlocks during class loading. In addition, the entity creating
-     * a new layer with this method should arrange that the class loaders are
-     * ready to load from these modules before there are any attempts to load
-     * classes or resources.
-     *
-     * <p> Creating a {@code Layer} can fail for the following reasons: </p>
-     *
-     * <ul>
-     *
-     *     <li><p> Two or more modules with the same package are mapped to the
-     *     same class loader. </p></li>
-     *
-     *     <li><p> A module is mapped to a class loader that already has a
-     *     module of the same name defined to it. </p></li>
-     *
-     *     <li><p> A module is mapped to a class loader that has already
-     *     defined types in any of the packages in the module. </p></li>
-     *
-     * </ul>
-     *
-     * <p> If the function to map a module name to class loader throws an error
-     * or runtime exception then it is propagated to the caller of this method.
-     * </p>
-     *
-     * @apiNote It is implementation specific as to whether creating a Layer
-     * with this method is an atomic operation or not. Consequentially it is
-     * possible for this method to fail with some modules, but not all, defined
-     * to Java virtual machine.
-     *
-     * @param  cf
-     *         The configuration for the layer
-     * @param  parentLayers
-     *         The list parent layers in search order
-     * @param  clf
-     *         The function to map a module name to a class loader
-     *
-     * @return A controller that controls the newly created layer
-     *
-     * @throws IllegalArgumentException
-     *         If the parent configurations do not match the configuration of
-     *         the parent layers, including order
-     * @throws LayerInstantiationException
-     *         If creating the {@code Layer} fails for any of the reasons
-     *         listed above, the layer cannot be created because the
-     *         configuration contains a module named "{@code java.base}",
-     *         a module with a package name starting with "{@code java.}" is
-     *         mapped to a class loader other than the {@link
-     *         ClassLoader#getPlatformClassLoader() platform class loader},
-     *         or the function to map a module name to a class loader returns
-     *         {@code null}
-     * @throws SecurityException
-     *         If {@code RuntimePermission("getClassLoader")} is denied by
-     *         the security manager
-     */
-    public static Controller defineModules(Configuration cf,
-                                           List<Layer> parentLayers,
-                                           Function<String, ClassLoader> clf)
-    {
-        List<Layer> parents = new ArrayList<>(parentLayers);
-        checkConfiguration(cf, parents);
-        Objects.requireNonNull(clf);
-
-        checkGetClassLoaderPermission();
-
-        // The boot layer is checked during module system initialization
-        if (boot() != null) {
-            checkForDuplicatePkgs(cf, clf);
-        }
-
-        try {
-            Layer layer = new Layer(cf, parents, clf);
-            return new Controller(layer);
-        } catch (IllegalArgumentException | IllegalStateException e) {
-            throw new LayerInstantiationException(e.getMessage());
-        }
-    }
-
-
-    /**
-     * Checks that the parent configurations match the configuration of
-     * the parent layers.
-     */
-    private static void checkConfiguration(Configuration cf,
-                                           List<Layer> parentLayers)
-    {
-        Objects.requireNonNull(cf);
-
-        List<Configuration> parentConfigurations = cf.parents();
-        if (parentLayers.size() != parentConfigurations.size())
-            throw new IllegalArgumentException("wrong number of parents");
-
-        int index = 0;
-        for (Layer parent : parentLayers) {
-            if (parent.configuration() != parentConfigurations.get(index)) {
-                throw new IllegalArgumentException(
-                        "Parent of configuration != configuration of this Layer");
-            }
-            index++;
-        }
-    }
-
-    private static void checkCreateClassLoaderPermission() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null)
-            sm.checkPermission(SecurityConstants.CREATE_CLASSLOADER_PERMISSION);
-    }
-
-    private static void checkGetClassLoaderPermission() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null)
-            sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
-    }
-
-    /**
-     * Checks a configuration and the module-to-loader mapping to ensure that
-     * no two modules mapped to the same class loader have the same package.
-     * It also checks that no two automatic modules have the same package.
-     *
-     * @throws LayerInstantiationException
-     */
-    private static void checkForDuplicatePkgs(Configuration cf,
-                                              Function<String, ClassLoader> clf)
-    {
-        // HashMap allows null keys
-        Map<ClassLoader, Set<String>> loaderToPackages = new HashMap<>();
-        for (ResolvedModule resolvedModule : cf.modules()) {
-            ModuleDescriptor descriptor = resolvedModule.reference().descriptor();
-            ClassLoader loader = clf.apply(descriptor.name());
-
-            Set<String> loaderPackages
-                = loaderToPackages.computeIfAbsent(loader, k -> new HashSet<>());
-
-            for (String pkg : descriptor.packages()) {
-                boolean added = loaderPackages.add(pkg);
-                if (!added) {
-                    throw fail("More than one module with package %s mapped" +
-                               " to the same class loader", pkg);
-                }
-            }
-        }
-    }
-
-    /**
-     * Creates a LayerInstantiationException with the a message formatted from
-     * the given format string and arguments.
-     */
-    private static LayerInstantiationException fail(String fmt, Object ... args) {
-        String msg = String.format(fmt, args);
-        return new LayerInstantiationException(msg);
-    }
-
-
-    /**
-     * Returns the configuration for this layer.
-     *
-     * @return The configuration for this layer
-     */
-    public Configuration configuration() {
-        return cf;
-    }
-
-
-    /**
-     * Returns the list of this layer's parents unless this is the
-     * {@linkplain #empty empty layer}, which has no parents and so an
-     * empty list is returned.
-     *
-     * @return The list of this layer's parents
-     */
-    public List<Layer> parents() {
-        return parents;
-    }
-
-
-    /**
-     * Returns an ordered stream of layers. The first element is is this layer,
-     * the remaining elements are the parent layers in DFS order.
-     *
-     * @implNote For now, the assumption is that the number of elements will
-     * be very low and so this method does not use a specialized spliterator.
-     */
-    Stream<Layer> layers() {
-        List<Layer> allLayers = this.allLayers;
-        if (allLayers != null)
-            return allLayers.stream();
-
-        allLayers = new ArrayList<>();
-        Set<Layer> visited = new HashSet<>();
-        Deque<Layer> stack = new ArrayDeque<>();
-        visited.add(this);
-        stack.push(this);
-
-        while (!stack.isEmpty()) {
-            Layer layer = stack.pop();
-            allLayers.add(layer);
-
-            // push in reverse order
-            for (int i = layer.parents.size() - 1; i >= 0; i--) {
-                Layer parent = layer.parents.get(i);
-                if (!visited.contains(parent)) {
-                    visited.add(parent);
-                    stack.push(parent);
-                }
-            }
-        }
-
-        this.allLayers = allLayers = Collections.unmodifiableList(allLayers);
-        return allLayers.stream();
-    }
-
-    private volatile List<Layer> allLayers;
-
-    /**
-     * Returns the set of the modules in this layer.
-     *
-     * @return A possibly-empty unmodifiable set of the modules in this layer
-     */
-    public Set<Module> modules() {
-        return Collections.unmodifiableSet(
-                nameToModule.values().stream().collect(Collectors.toSet()));
-    }
-
-
-    /**
-     * Returns the module with the given name in this layer, or if not in this
-     * layer, the {@linkplain #parents parents} layers. Finding a module in
-     * parent layers is equivalent to invoking {@code findModule} on each
-     * parent, in search order, until the module is found or all parents have
-     * been searched. In a <em>tree of layers</em>  then this is equivalent to
-     * a depth-first search.
-     *
-     * @param  name
-     *         The name of the module to find
-     *
-     * @return The module with the given name or an empty {@code Optional}
-     *         if there isn't a module with this name in this layer or any
-     *         parent layer
-     */
-    public Optional<Module> findModule(String name) {
-        Objects.requireNonNull(name);
-        Module m = nameToModule.get(name);
-        if (m != null)
-            return Optional.of(m);
-
-        return layers()
-                .skip(1)  // skip this layer
-                .map(l -> l.nameToModule)
-                .filter(map -> map.containsKey(name))
-                .map(map -> map.get(name))
-                .findAny();
-    }
-
-
-    /**
-     * Returns the {@code ClassLoader} for the module with the given name. If
-     * a module of the given name is not in this layer then the {@link #parents
-     * parent} layers are searched in the manner specified by {@link
-     * #findModule(String) findModule}.
-     *
-     * <p> If there is a security manager then its {@code checkPermission}
-     * method is called with a {@code RuntimePermission("getClassLoader")}
-     * permission to check that the caller is allowed to get access to the
-     * class loader. </p>
-     *
-     * @apiNote This method does not return an {@code Optional<ClassLoader>}
-     * because `null` must be used to represent the bootstrap class loader.
-     *
-     * @param  name
-     *         The name of the module to find
-     *
-     * @return The ClassLoader that the module is defined to
-     *
-     * @throws IllegalArgumentException if a module of the given name is not
-     *         defined in this layer or any parent of this layer
-     *
-     * @throws SecurityException if denied by the security manager
-     */
-    public ClassLoader findLoader(String name) {
-        Optional<Module> om = findModule(name);
-
-        // can't use map(Module::getClassLoader) as class loader can be null
-        if (om.isPresent()) {
-            return om.get().getClassLoader();
-        } else {
-            throw new IllegalArgumentException("Module " + name
-                                               + " not known to this layer");
-        }
-    }
-
-    /**
-     * Returns a string describing this layer.
-     *
-     * @return A possibly empty string describing this layer
-     */
-    @Override
-    public String toString() {
-        return modules().stream()
-                .map(Module::getName)
-                .collect(Collectors.joining(", "));
-    }
-
-    /**
-     * Returns the <em>empty</em> layer. There are no modules in the empty
-     * layer. It has no parents.
-     *
-     * @return The empty layer
-     */
-    public static Layer empty() {
-        return EMPTY_LAYER;
-    }
-
-
-    /**
-     * Returns the boot layer. The boot layer contains at least one module,
-     * {@code java.base}. Its parent is the {@link #empty() empty} layer.
-     *
-     * @apiNote This method returns {@code null} during startup and before
-     *          the boot layer is fully initialized.
-     *
-     * @return The boot layer
-     */
-    public static Layer boot() {
-        return SharedSecrets.getJavaLangAccess().getBootLayer();
-    }
-
-
-    /**
-     * Returns the ServicesCatalog for this Layer, creating it if not
-     * already created.
-     */
-    ServicesCatalog getServicesCatalog() {
-        ServicesCatalog servicesCatalog = this.servicesCatalog;
-        if (servicesCatalog != null)
-            return servicesCatalog;
-
-        synchronized (this) {
-            servicesCatalog = this.servicesCatalog;
-            if (servicesCatalog == null) {
-                servicesCatalog = ServicesCatalog.create();
-                nameToModule.values().forEach(servicesCatalog::register);
-                this.servicesCatalog = servicesCatalog;
-            }
-        }
-
-        return servicesCatalog;
-    }
-
-    private volatile ServicesCatalog servicesCatalog;
-
-
-    /**
-     * Record that this layer has at least one module defined to the given
-     * class loader.
-     */
-    void bindToLoader(ClassLoader loader) {
-        // CLV.computeIfAbsent(loader, (cl, clv) -> new CopyOnWriteArrayList<>())
-        List<Layer> list = CLV.get(loader);
-        if (list == null) {
-            list = new CopyOnWriteArrayList<>();
-            List<Layer> previous = CLV.putIfAbsent(loader, list);
-            if (previous != null) list = previous;
-        }
-        list.add(this);
-    }
-
-    /**
-     * Returns a stream of the layers that have at least one module defined to
-     * the given class loader.
-     */
-    static Stream<Layer> layers(ClassLoader loader) {
-        List<Layer> list = CLV.get(loader);
-        if (list != null) {
-            return list.stream();
-        } else {
-            return Stream.empty();
-        }
-    }
-
-    // the list of layers with modules defined to a class loader
-    private static final ClassLoaderValue<List<Layer>> CLV = new ClassLoaderValue<>();
-}
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/LayerInstantiationException.java b/jdk/src/java.base/share/classes/java/lang/reflect/LayerInstantiationException.java
deleted file mode 100644
index ff61c41..0000000
--- a/jdk/src/java.base/share/classes/java/lang/reflect/LayerInstantiationException.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.lang.reflect;
-
-/**
- * Thrown when creating a Layer fails.
- *
- * @see Layer
- *
- * @since 9
- */
-public class LayerInstantiationException extends RuntimeException {
-    private static final long serialVersionUID = -906239691613568347L;
-
-    /**
-     * Constructs a {@code LayerInstantiationException} with no detail message.
-     */
-    public LayerInstantiationException() {
-    }
-
-    /**
-     * Constructs a {@code LayerInstantiationException} with the given detail
-     * message.
-     *
-     * @param msg
-     *        The detail message; can be {@code null}
-     */
-    public LayerInstantiationException(String msg) {
-        super(msg);
-    }
-
-    /**
-     * Constructs a {@code LayerInstantiationException} with the given cause.
-     *
-     * @param cause
-     *        The cause; can be {@code null}
-     */
-    public LayerInstantiationException(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Constructs a {@code FindException} with the given detail message
-     * and cause.
-     *
-     * @param msg
-     *        The detail message; can be {@code null}
-     * @param cause
-     *        The cause; can be {@code null}
-     */
-    public LayerInstantiationException(String msg, Throwable cause) {
-        super(msg, cause);
-    }
-
-}
-
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java
index 027a711..b915b55 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java
@@ -42,6 +42,7 @@
 import java.lang.annotation.Annotation;
 import java.lang.annotation.AnnotationFormatError;
 import java.nio.ByteBuffer;
+import java.util.StringJoiner;
 
 /**
  * A {@code Method} provides information about, and access to, a single method
@@ -179,6 +180,10 @@
         return res;
     }
 
+    /**
+     * @throws InaccessibleObjectException {@inheritDoc}
+     * @throws SecurityException {@inheritDoc}
+     */
     @Override
     @CallerSensitive
     public void setAccessible(boolean flag) {
@@ -412,6 +417,21 @@
         sb.append(getName());
     }
 
+    @Override
+    String toShortString() {
+        StringBuilder sb = new StringBuilder("method ");
+        sb.append(getDeclaringClass().getTypeName()).append('.');
+        sb.append(getName());
+        sb.append('(');
+        StringJoiner sj = new StringJoiner(",");
+        for (Class<?> parameterType : getParameterTypes()) {
+            sj.add(parameterType.getTypeName());
+        }
+        sb.append(sj);
+        sb.append(')');
+        return sb.toString();
+    }
+
     /**
      * Returns a string describing this {@code Method}, including
      * type parameters.  The string is formatted as the method access
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Module.java b/jdk/src/java.base/share/classes/java/lang/reflect/Module.java
deleted file mode 100644
index 5134b64..0000000
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Module.java
+++ /dev/null
@@ -1,1574 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.lang.reflect;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.module.Configuration;
-import java.lang.module.ModuleReference;
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleDescriptor.Exports;
-import java.lang.module.ModuleDescriptor.Opens;
-import java.lang.module.ModuleDescriptor.Version;
-import java.lang.module.ResolvedModule;
-import java.net.URI;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Function;
-import java.util.stream.Stream;
-
-import jdk.internal.loader.BuiltinClassLoader;
-import jdk.internal.loader.BootLoader;
-import jdk.internal.loader.ResourceHelper;
-import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.JavaLangReflectModuleAccess;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.module.ServicesCatalog;
-import jdk.internal.org.objectweb.asm.AnnotationVisitor;
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.reflect.CallerSensitive;
-import jdk.internal.reflect.Reflection;
-import sun.security.util.SecurityConstants;
-
-/**
- * Represents a run-time module, either {@link #isNamed() named} or unnamed.
- *
- * <p> Named modules have a {@link #getName() name} and are constructed by the
- * Java Virtual Machine when a graph of modules is defined to the Java virtual
- * machine to create a module {@link Layer Layer}. </p>
- *
- * <p> An unnamed module does not have a name. There is an unnamed module
- * per {@link ClassLoader ClassLoader} that is obtained by invoking the class
- * loader's {@link ClassLoader#getUnnamedModule() getUnnamedModule} method. The
- * {@link Class#getModule() getModule} method of all types defined by a class
- * loader that are not in a named module return the class loader's unnamed
- * module. </p>
- *
- * <p> The package names that are parameters or returned by methods defined in
- * this class are the fully-qualified names of the packages as defined in
- * section 6.5.3 of <cite>The Java&trade; Language Specification </cite>, for
- * example, {@code "java.lang"}. </p>
- *
- * <p> Unless otherwise specified, passing a {@code null} argument to a method
- * in this class causes a {@link NullPointerException NullPointerException} to
- * be thrown. </p>
- *
- * @since 9
- * @see java.lang.Class#getModule
- */
-
-public final class Module implements AnnotatedElement {
-
-    // the layer that contains this module, can be null
-    private final Layer layer;
-
-    // module name and loader, these fields are read by VM
-    private final String name;
-    private final ClassLoader loader;
-
-    // the module descriptor
-    private final ModuleDescriptor descriptor;
-
-
-    /**
-     * Creates a new named Module. The resulting Module will be defined to the
-     * VM but will not read any other modules, will not have any exports setup
-     * and will not be registered in the service catalog.
-     */
-    private Module(Layer layer,
-                   ClassLoader loader,
-                   ModuleDescriptor descriptor,
-                   URI uri)
-    {
-        this.layer = layer;
-        this.name = descriptor.name();
-        this.loader = loader;
-        this.descriptor = descriptor;
-
-        // define module to VM
-
-        boolean isOpen = descriptor.isOpen();
-        Version version = descriptor.version().orElse(null);
-        String vs = Objects.toString(version, null);
-        String loc = Objects.toString(uri, null);
-        String[] packages = descriptor.packages().toArray(new String[0]);
-        defineModule0(this, isOpen, vs, loc, packages);
-    }
-
-
-    /**
-     * Create the unnamed Module for the given ClassLoader.
-     *
-     * @see ClassLoader#getUnnamedModule
-     */
-    private Module(ClassLoader loader) {
-        this.layer = null;
-        this.name = null;
-        this.loader = loader;
-        this.descriptor = null;
-    }
-
-
-    /**
-     * Creates a named module but without defining the module to the VM.
-     *
-     * @apiNote This constructor is for VM white-box testing.
-     */
-    Module(ClassLoader loader, ModuleDescriptor descriptor) {
-        this.layer = null;
-        this.name = descriptor.name();
-        this.loader = loader;
-        this.descriptor = descriptor;
-    }
-
-
-
-    /**
-     * Returns {@code true} if this module is a named module.
-     *
-     * @return {@code true} if this is a named module
-     *
-     * @see ClassLoader#getUnnamedModule()
-     */
-    public boolean isNamed() {
-        return name != null;
-    }
-
-    /**
-     * Returns the module name or {@code null} if this module is an unnamed
-     * module.
-     *
-     * @return The module name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Returns the {@code ClassLoader} for this module.
-     *
-     * <p> If there is a security manager then its {@code checkPermission}
-     * method if first called with a {@code RuntimePermission("getClassLoader")}
-     * permission to check that the caller is allowed to get access to the
-     * class loader. </p>
-     *
-     * @return The class loader for this module
-     *
-     * @throws SecurityException
-     *         If denied by the security manager
-     */
-    public ClassLoader getClassLoader() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
-        }
-        return loader;
-    }
-
-    /**
-     * Returns the module descriptor for this module or {@code null} if this
-     * module is an unnamed module.
-     *
-     * @return The module descriptor for this module
-     */
-    public ModuleDescriptor getDescriptor() {
-        return descriptor;
-    }
-
-    /**
-     * Returns the layer that contains this module or {@code null} if this
-     * module is not in a layer.
-     *
-     * A module {@code Layer} contains named modules and therefore this
-     * method always returns {@code null} when invoked on an unnamed module.
-     *
-     * <p> <a href="Proxy.html#dynamicmodule">Dynamic modules</a> are named
-     * modules that are generated at runtime. A dynamic module may or may
-     * not be in a module Layer. </p>
-     *
-     * @return The layer that contains this module
-     *
-     * @see Proxy
-     */
-    public Layer getLayer() {
-        if (isNamed()) {
-            Layer layer = this.layer;
-            if (layer != null)
-                return layer;
-
-            // special-case java.base as it is created before the boot Layer
-            if (loader == null && name.equals("java.base")) {
-                return SharedSecrets.getJavaLangAccess().getBootLayer();
-            }
-        }
-
-        return null;
-    }
-
-
-    // --
-
-    // special Module to mean "all unnamed modules"
-    private static final Module ALL_UNNAMED_MODULE = new Module(null);
-
-    // special Module to mean "everyone"
-    private static final Module EVERYONE_MODULE = new Module(null);
-
-    // set contains EVERYONE_MODULE, used when a package is opened or
-    // exported unconditionally
-    private static final Set<Module> EVERYONE_SET = Set.of(EVERYONE_MODULE);
-
-
-    // -- readability --
-
-    // the modules that this module reads
-    private volatile Set<Module> reads;
-
-    // additional module (2nd key) that some module (1st key) reflectively reads
-    private static final WeakPairMap<Module, Module, Boolean> reflectivelyReads
-        = new WeakPairMap<>();
-
-
-    /**
-     * Indicates if this module reads the given module. This method returns
-     * {@code true} if invoked to test if this module reads itself. It also
-     * returns {@code true} if invoked on an unnamed module (as unnamed
-     * modules read all modules).
-     *
-     * @param  other
-     *         The other module
-     *
-     * @return {@code true} if this module reads {@code other}
-     *
-     * @see #addReads(Module)
-     */
-    public boolean canRead(Module other) {
-        Objects.requireNonNull(other);
-
-        // an unnamed module reads all modules
-        if (!this.isNamed())
-            return true;
-
-        // all modules read themselves
-        if (other == this)
-            return true;
-
-        // check if this module reads other
-        if (other.isNamed()) {
-            Set<Module> reads = this.reads; // volatile read
-            if (reads != null && reads.contains(other))
-                return true;
-        }
-
-        // check if this module reads the other module reflectively
-        if (reflectivelyReads.containsKeyPair(this, other))
-            return true;
-
-        // if other is an unnamed module then check if this module reads
-        // all unnamed modules
-        if (!other.isNamed()
-            && reflectivelyReads.containsKeyPair(this, ALL_UNNAMED_MODULE))
-            return true;
-
-        return false;
-    }
-
-    /**
-     * If the caller's module is this module then update this module to read
-     * the given module.
-     *
-     * This method is a no-op if {@code other} is this module (all modules read
-     * themselves), this module is an unnamed module (as unnamed modules read
-     * all modules), or this module already reads {@code other}.
-     *
-     * @implNote <em>Read edges</em> added by this method are <em>weak</em> and
-     * do not prevent {@code other} from being GC'ed when this module is
-     * strongly reachable.
-     *
-     * @param  other
-     *         The other module
-     *
-     * @return this module
-     *
-     * @throws IllegalStateException
-     *         If this is a named module and the caller is not this module
-     *
-     * @see #canRead
-     */
-    @CallerSensitive
-    public Module addReads(Module other) {
-        Objects.requireNonNull(other);
-        if (this.isNamed()) {
-            Module caller = Reflection.getCallerClass().getModule();
-            if (caller != this) {
-                throw new IllegalStateException(caller + " != " + this);
-            }
-            implAddReads(other, true);
-        }
-        return this;
-    }
-
-    /**
-     * Updates this module to read another module.
-     *
-     * @apiNote This method is for Proxy use and white-box testing.
-     */
-    void implAddReads(Module other) {
-        implAddReads(other, true);
-    }
-
-    /**
-     * Updates this module to read another module without notifying the VM.
-     *
-     * @apiNote This method is for VM white-box testing.
-     */
-    void implAddReadsNoSync(Module other) {
-        implAddReads(other, false);
-    }
-
-    /**
-     * Makes the given {@code Module} readable to this module.
-     *
-     * If {@code syncVM} is {@code true} then the VM is notified.
-     */
-    private void implAddReads(Module other, boolean syncVM) {
-        Objects.requireNonNull(other);
-
-        // nothing to do
-        if (other == this || !this.isNamed())
-            return;
-
-        // check if we already read this module
-        Set<Module> reads = this.reads;
-        if (reads != null && reads.contains(other))
-            return;
-
-        // update VM first, just in case it fails
-        if (syncVM) {
-            if (other == ALL_UNNAMED_MODULE) {
-                addReads0(this, null);
-            } else {
-                addReads0(this, other);
-            }
-        }
-
-        // add reflective read
-        reflectivelyReads.putIfAbsent(this, other, Boolean.TRUE);
-    }
-
-
-    // -- exported and open packages --
-
-    // the packages are open to other modules, can be null
-    // if the value contains EVERYONE_MODULE then the package is open to all
-    private volatile Map<String, Set<Module>> openPackages;
-
-    // the packages that are exported, can be null
-    // if the value contains EVERYONE_MODULE then the package is exported to all
-    private volatile Map<String, Set<Module>> exportedPackages;
-
-    // additional exports or opens added at run-time
-    // this module (1st key), other module (2nd key)
-    // (package name, open?) (value)
-    private static final WeakPairMap<Module, Module, Map<String, Boolean>>
-        reflectivelyExports = new WeakPairMap<>();
-
-
-    /**
-     * Returns {@code true} if this module exports the given package to at
-     * least the given module.
-     *
-     * <p> This method returns {@code true} if invoked to test if a package in
-     * this module is exported to itself. It always returns {@code true} when
-     * invoked on an unnamed module. A package that is {@link #isOpen open} to
-     * the given module is considered exported to that module at run-time and
-     * so this method returns {@code true} if the package is open to the given
-     * module. </p>
-     *
-     * <p> This method does not check if the given module reads this module. </p>
-     *
-     * @param  pn
-     *         The package name
-     * @param  other
-     *         The other module
-     *
-     * @return {@code true} if this module exports the package to at least the
-     *         given module
-     *
-     * @see ModuleDescriptor#exports()
-     * @see #addExports(String,Module)
-     */
-    public boolean isExported(String pn, Module other) {
-        Objects.requireNonNull(pn);
-        Objects.requireNonNull(other);
-        return implIsExportedOrOpen(pn, other, /*open*/false);
-    }
-
-    /**
-     * Returns {@code true} if this module has <em>opened</em> a package to at
-     * least the given module.
-     *
-     * <p> This method returns {@code true} if invoked to test if a package in
-     * this module is open to itself. It returns {@code true} when invoked on an
-     * {@link ModuleDescriptor#isOpen open} module with a package in the module.
-     * It always returns {@code true} when invoked on an unnamed module. </p>
-     *
-     * <p> This method does not check if the given module reads this module. </p>
-     *
-     * @param  pn
-     *         The package name
-     * @param  other
-     *         The other module
-     *
-     * @return {@code true} if this module has <em>opened</em> the package
-     *         to at least the given module
-     *
-     * @see ModuleDescriptor#opens()
-     * @see #addOpens(String,Module)
-     * @see AccessibleObject#setAccessible(boolean)
-     * @see java.lang.invoke.MethodHandles#privateLookupIn
-     */
-    public boolean isOpen(String pn, Module other) {
-        Objects.requireNonNull(pn);
-        Objects.requireNonNull(other);
-        return implIsExportedOrOpen(pn, other, /*open*/true);
-    }
-
-    /**
-     * Returns {@code true} if this module exports the given package
-     * unconditionally.
-     *
-     * <p> This method always returns {@code true} when invoked on an unnamed
-     * module. A package that is {@link #isOpen(String) opened} unconditionally
-     * is considered exported unconditionally at run-time and so this method
-     * returns {@code true} if the package is opened unconditionally. </p>
-     *
-     * <p> This method does not check if the given module reads this module. </p>
-     *
-     * @param  pn
-     *         The package name
-     *
-     * @return {@code true} if this module exports the package unconditionally
-     *
-     * @see ModuleDescriptor#exports()
-     */
-    public boolean isExported(String pn) {
-        Objects.requireNonNull(pn);
-        return implIsExportedOrOpen(pn, EVERYONE_MODULE, /*open*/false);
-    }
-
-    /**
-     * Returns {@code true} if this module has <em>opened</em> a package
-     * unconditionally.
-     *
-     * <p> This method always returns {@code true} when invoked on an unnamed
-     * module. Additionally, it always returns {@code true} when invoked on an
-     * {@link ModuleDescriptor#isOpen open} module with a package in the
-     * module. </p>
-     *
-     * <p> This method does not check if the given module reads this module. </p>
-     *
-     * @param  pn
-     *         The package name
-     *
-     * @return {@code true} if this module has <em>opened</em> the package
-     *         unconditionally
-     *
-     * @see ModuleDescriptor#opens()
-     */
-    public boolean isOpen(String pn) {
-        Objects.requireNonNull(pn);
-        return implIsExportedOrOpen(pn, EVERYONE_MODULE, /*open*/true);
-    }
-
-
-    /**
-     * Returns {@code true} if this module exports or opens the given package
-     * to the given module. If the other module is {@code EVERYONE_MODULE} then
-     * this method tests if the package is exported or opened unconditionally.
-     */
-    private boolean implIsExportedOrOpen(String pn, Module other, boolean open) {
-        // all packages in unnamed modules are open
-        if (!isNamed())
-            return true;
-
-        // all packages are exported/open to self
-        if (other == this && containsPackage(pn))
-            return true;
-
-        // all packages in open modules are open
-        if (descriptor.isOpen())
-            return containsPackage(pn);
-
-        // exported/opened via module declaration/descriptor
-        if (isStaticallyExportedOrOpen(pn, other, open))
-            return true;
-
-        // exported via addExports/addOpens
-        if (isReflectivelyExportedOrOpen(pn, other, open))
-            return true;
-
-        // not exported or open to other
-        return false;
-    }
-
-    /**
-     * Returns {@code true} if this module exports or opens a package to
-     * the given module via its module declaration.
-     */
-    boolean isStaticallyExportedOrOpen(String pn, Module other, boolean open) {
-        // package is open to everyone or <other>
-        Map<String, Set<Module>> openPackages = this.openPackages;
-        if (openPackages != null) {
-            Set<Module> targets = openPackages.get(pn);
-            if (targets != null) {
-                if (targets.contains(EVERYONE_MODULE))
-                    return true;
-                if (other != EVERYONE_MODULE && targets.contains(other))
-                    return true;
-            }
-        }
-
-        if (!open) {
-            // package is exported to everyone or <other>
-            Map<String, Set<Module>> exportedPackages = this.exportedPackages;
-            if (exportedPackages != null) {
-                Set<Module> targets = exportedPackages.get(pn);
-                if (targets != null) {
-                    if (targets.contains(EVERYONE_MODULE))
-                        return true;
-                    if (other != EVERYONE_MODULE && targets.contains(other))
-                        return true;
-                }
-            }
-        }
-
-        return false;
-    }
-
-
-    /**
-     * Returns {@code true} if this module reflectively exports or opens given
-     * package package to the given module.
-     */
-    private boolean isReflectivelyExportedOrOpen(String pn, Module other, boolean open) {
-        // exported or open to all modules
-        Map<String, Boolean> exports = reflectivelyExports.get(this, EVERYONE_MODULE);
-        if (exports != null) {
-            Boolean b = exports.get(pn);
-            if (b != null) {
-                boolean isOpen = b.booleanValue();
-                if (!open || isOpen) return true;
-            }
-        }
-
-        if (other != EVERYONE_MODULE) {
-
-            // exported or open to other
-            exports = reflectivelyExports.get(this, other);
-            if (exports != null) {
-                Boolean b = exports.get(pn);
-                if (b != null) {
-                    boolean isOpen = b.booleanValue();
-                    if (!open || isOpen) return true;
-                }
-            }
-
-            // other is an unnamed module && exported or open to all unnamed
-            if (!other.isNamed()) {
-                exports = reflectivelyExports.get(this, ALL_UNNAMED_MODULE);
-                if (exports != null) {
-                    Boolean b = exports.get(pn);
-                    if (b != null) {
-                        boolean isOpen = b.booleanValue();
-                        if (!open || isOpen) return true;
-                    }
-                }
-            }
-
-        }
-
-        return false;
-    }
-
-
-    /**
-     * If the caller's module is this module then update this module to export
-     * the given package to the given module.
-     *
-     * <p> This method has no effect if the package is already exported (or
-     * <em>open</em>) to the given module. It also has no effect if
-     * invoked on an {@link ModuleDescriptor#isOpen open} module. </p>
-     *
-     * @apiNote As specified in section 5.4.3 of the <cite>The Java&trade;
-     * Virtual Machine Specification </cite>, if an attempt to resolve a
-     * symbolic reference fails because of a linkage error, then subsequent
-     * attempts to resolve the reference always fail with the same error that
-     * was thrown as a result of the initial resolution attempt.
-     *
-     * @param  pn
-     *         The package name
-     * @param  other
-     *         The module
-     *
-     * @return this module
-     *
-     * @throws IllegalArgumentException
-     *         If {@code pn} is {@code null}, or this is a named module and the
-     *         package {@code pn} is not a package in this module
-     * @throws IllegalStateException
-     *         If this is a named module and the caller is not this module
-     *
-     * @jvms 5.4.3 Resolution
-     * @see #isExported(String,Module)
-     */
-    @CallerSensitive
-    public Module addExports(String pn, Module other) {
-        if (pn == null)
-            throw new IllegalArgumentException("package is null");
-        Objects.requireNonNull(other);
-
-        if (isNamed() && !descriptor.isOpen()) {
-            Module caller = Reflection.getCallerClass().getModule();
-            if (caller != this) {
-                throw new IllegalStateException(caller + " != " + this);
-            }
-            implAddExportsOrOpens(pn, other, /*open*/false, /*syncVM*/true);
-        }
-
-        return this;
-    }
-
-    /**
-     * If this module has <em>opened</em> a package to at least the caller
-     * module then update this module to open the package to the given module.
-     * Opening a package with this method allows all types in the package,
-     * and all their members, not just public types and their public members,
-     * to be reflected on by the given module when using APIs that support
-     * private access or a way to bypass or suppress default Java language
-     * access control checks.
-     *
-     * <p> This method has no effect if the package is already <em>open</em>
-     * to the given module. It also has no effect if invoked on an {@link
-     * ModuleDescriptor#isOpen open} module. </p>
-     *
-     * @param  pn
-     *         The package name
-     * @param  other
-     *         The module
-     *
-     * @return this module
-     *
-     * @throws IllegalArgumentException
-     *         If {@code pn} is {@code null}, or this is a named module and the
-     *         package {@code pn} is not a package in this module
-     * @throws IllegalStateException
-     *         If this is a named module and this module has not opened the
-     *         package to at least the caller
-     *
-     * @see #isOpen(String,Module)
-     * @see AccessibleObject#setAccessible(boolean)
-     * @see java.lang.invoke.MethodHandles#privateLookupIn
-     */
-    @CallerSensitive
-    public Module addOpens(String pn, Module other) {
-        if (pn == null)
-            throw new IllegalArgumentException("package is null");
-        Objects.requireNonNull(other);
-
-        if (isNamed() && !descriptor.isOpen()) {
-            Module caller = Reflection.getCallerClass().getModule();
-            if (caller != this && !isOpen(pn, caller))
-                throw new IllegalStateException(pn + " is not open to " + caller);
-            implAddExportsOrOpens(pn, other, /*open*/true, /*syncVM*/true);
-        }
-
-        return this;
-    }
-
-
-    /**
-     * Updates the exports so that package {@code pn} is exported to module
-     * {@code other} but without notifying the VM.
-     *
-     * @apiNote This method is for VM white-box testing.
-     */
-    void implAddExportsNoSync(String pn, Module other) {
-        if (other == null)
-            other = EVERYONE_MODULE;
-        implAddExportsOrOpens(pn.replace('/', '.'), other, false, false);
-    }
-
-    /**
-     * Updates the exports so that package {@code pn} is exported to module
-     * {@code other}.
-     *
-     * @apiNote This method is for white-box testing.
-     */
-    void implAddExports(String pn, Module other) {
-        implAddExportsOrOpens(pn, other, false, true);
-    }
-
-    /**
-     * Updates the module to open package {@code pn} to module {@code other}.
-     *
-     * @apiNote This method is for white-box tests and jtreg
-     */
-    void implAddOpens(String pn, Module other) {
-        implAddExportsOrOpens(pn, other, true, true);
-    }
-
-    /**
-     * Updates a module to export or open a module to another module.
-     *
-     * If {@code syncVM} is {@code true} then the VM is notified.
-     */
-    private void implAddExportsOrOpens(String pn,
-                                       Module other,
-                                       boolean open,
-                                       boolean syncVM) {
-        Objects.requireNonNull(other);
-        Objects.requireNonNull(pn);
-
-        // all packages are open in unnamed and open modules
-        if (!isNamed() || descriptor.isOpen())
-            return;
-
-        // nothing to do if already exported/open to other
-        if (implIsExportedOrOpen(pn, other, open))
-            return;
-
-        // can only export a package in the module
-        if (!containsPackage(pn)) {
-            throw new IllegalArgumentException("package " + pn
-                                               + " not in contents");
-        }
-
-        // update VM first, just in case it fails
-        if (syncVM) {
-            if (other == EVERYONE_MODULE) {
-                addExportsToAll0(this, pn);
-            } else if (other == ALL_UNNAMED_MODULE) {
-                addExportsToAllUnnamed0(this, pn);
-            } else {
-                addExports0(this, pn, other);
-            }
-        }
-
-        // add package name to reflectivelyExports if absent
-        Map<String, Boolean> map = reflectivelyExports
-            .computeIfAbsent(this, other,
-                             (m1, m2) -> new ConcurrentHashMap<>());
-
-        if (open) {
-            map.put(pn, Boolean.TRUE);  // may need to promote from FALSE to TRUE
-        } else {
-            map.putIfAbsent(pn, Boolean.FALSE);
-        }
-    }
-
-
-    // -- services --
-
-    // additional service type (2nd key) that some module (1st key) uses
-    private static final WeakPairMap<Module, Class<?>, Boolean> reflectivelyUses
-        = new WeakPairMap<>();
-
-    /**
-     * If the caller's module is this module then update this module to add a
-     * service dependence on the given service type. This method is intended
-     * for use by frameworks that invoke {@link java.util.ServiceLoader
-     * ServiceLoader} on behalf of other modules or where the framework is
-     * passed a reference to the service type by other code. This method is
-     * a no-op when invoked on an unnamed module or an automatic module.
-     *
-     * <p> This method does not cause {@link
-     * Configuration#resolveRequiresAndUses resolveRequiresAndUses} to be
-     * re-run. </p>
-     *
-     * @param  service
-     *         The service type
-     *
-     * @return this module
-     *
-     * @throws IllegalStateException
-     *         If this is a named module and the caller is not this module
-     *
-     * @see #canUse(Class)
-     * @see ModuleDescriptor#uses()
-     */
-    @CallerSensitive
-    public Module addUses(Class<?> service) {
-        Objects.requireNonNull(service);
-
-        if (isNamed() && !descriptor.isAutomatic()) {
-            Module caller = Reflection.getCallerClass().getModule();
-            if (caller != this) {
-                throw new IllegalStateException(caller + " != " + this);
-            }
-            implAddUses(service);
-        }
-
-        return this;
-    }
-
-    /**
-     * Update this module to add a service dependence on the given service
-     * type.
-     */
-    void implAddUses(Class<?> service) {
-        if (!canUse(service)) {
-            reflectivelyUses.putIfAbsent(this, service, Boolean.TRUE);
-        }
-    }
-
-
-    /**
-     * Indicates if this module has a service dependence on the given service
-     * type. This method always returns {@code true} when invoked on an unnamed
-     * module or an automatic module.
-     *
-     * @param  service
-     *         The service type
-     *
-     * @return {@code true} if this module uses service type {@code st}
-     *
-     * @see #addUses(Class)
-     */
-    public boolean canUse(Class<?> service) {
-        Objects.requireNonNull(service);
-
-        if (!isNamed())
-            return true;
-
-        if (descriptor.isAutomatic())
-            return true;
-
-        // uses was declared
-        if (descriptor.uses().contains(service.getName()))
-            return true;
-
-        // uses added via addUses
-        return reflectivelyUses.containsKeyPair(this, service);
-    }
-
-
-
-    // -- packages --
-
-    // Additional packages that are added to the module at run-time.
-    // The field is volatile as it may be replaced at run-time
-    private volatile Set<String> extraPackages;
-
-    private boolean containsPackage(String pn) {
-        if (descriptor.packages().contains(pn))
-            return true;
-        Set<String> extraPackages = this.extraPackages;
-        if (extraPackages != null && extraPackages.contains(pn))
-            return true;
-        return false;
-    }
-
-
-    /**
-     * Returns an array of the package names of the packages in this module.
-     *
-     * <p> For named modules, the returned array contains an element for each
-     * package in the module. It may contain elements corresponding to packages
-     * added to the module, <a href="Proxy.html#dynamicmodule">dynamic modules</a>
-     * for example, after it was loaded.
-     *
-     * <p> For unnamed modules, this method is the equivalent of invoking the
-     * {@link ClassLoader#getDefinedPackages() getDefinedPackages} method of
-     * this module's class loader and returning the array of package names. </p>
-     *
-     * <p> A package name appears at most once in the returned array. </p>
-     *
-     * @apiNote This method returns an array rather than a {@code Set} for
-     * consistency with other {@code java.lang.reflect} types.
-     *
-     * @return an array of the package names of the packages in this module
-     */
-    public String[] getPackages() {
-        if (isNamed()) {
-
-            Set<String> packages = descriptor.packages();
-            Set<String> extraPackages = this.extraPackages;
-            if (extraPackages == null) {
-                return packages.toArray(new String[0]);
-            } else {
-                return Stream.concat(packages.stream(),
-                                     extraPackages.stream())
-                        .toArray(String[]::new);
-            }
-
-        } else {
-            // unnamed module
-            Stream<Package> packages;
-            if (loader == null) {
-                packages = BootLoader.packages();
-            } else {
-                packages = SharedSecrets.getJavaLangAccess().packages(loader);
-            }
-            return packages.map(Package::getName).toArray(String[]::new);
-        }
-    }
-
-    /**
-     * Add a package to this module.
-     *
-     * @apiNote This method is for Proxy use.
-     *
-     * @apiNote This is an expensive operation, not expected to be used often.
-     * At this time then it does not validate that the package name is a
-     * valid java identifier.
-     */
-    void addPackage(String pn) {
-        implAddPackage(pn, true);
-    }
-
-    /**
-     * Add a package to this module without notifying the VM.
-     *
-     * @apiNote This method is VM white-box testing.
-     */
-    void implAddPackageNoSync(String pn) {
-        implAddPackage(pn.replace('/', '.'), false);
-    }
-
-    /**
-     * Add a package to this module.
-     *
-     * If {@code syncVM} is {@code true} then the VM is notified.
-     */
-    private void implAddPackage(String pn, boolean syncVM) {
-        if (!isNamed())
-            throw new InternalError("adding package to unnamed module?");
-        if (descriptor.isOpen())
-            throw new InternalError("adding package to open module?");
-        if (pn.isEmpty())
-            throw new InternalError("adding <unnamed> package to module?");
-
-        if (descriptor.packages().contains(pn)) {
-            // already in module
-            return;
-        }
-
-        Set<String> extraPackages = this.extraPackages;
-        if (extraPackages != null && extraPackages.contains(pn)) {
-            // already added
-            return;
-        }
-        synchronized (this) {
-            // recheck under lock
-            extraPackages = this.extraPackages;
-            if (extraPackages != null) {
-                if (extraPackages.contains(pn)) {
-                    // already added
-                    return;
-                }
-
-                // copy the set
-                extraPackages = new HashSet<>(extraPackages);
-                extraPackages.add(pn);
-            } else {
-                extraPackages = Collections.singleton(pn);
-            }
-
-            // update VM first, just in case it fails
-            if (syncVM)
-                addPackage0(this, pn);
-
-            // replace with new set
-            this.extraPackages = extraPackages; // volatile write
-        }
-    }
-
-
-    // -- creating Module objects --
-
-    /**
-     * Defines all module in a configuration to the runtime.
-     *
-     * @return a map of module name to runtime {@code Module}
-     *
-     * @throws IllegalArgumentException
-     *         If defining any of the modules to the VM fails
-     */
-    static Map<String, Module> defineModules(Configuration cf,
-                                             Function<String, ClassLoader> clf,
-                                             Layer layer)
-    {
-        Map<String, Module> nameToModule = new HashMap<>();
-        Map<String, ClassLoader> moduleToLoader = new HashMap<>();
-
-        boolean isBootLayer = (Layer.boot() == null);
-        Set<ClassLoader> loaders = new HashSet<>();
-
-        // map each module to a class loader
-        for (ResolvedModule resolvedModule : cf.modules()) {
-            String name = resolvedModule.name();
-            ClassLoader loader = clf.apply(name);
-            if (loader != null) {
-                moduleToLoader.put(name, loader);
-                loaders.add(loader);
-            } else if (!isBootLayer) {
-                throw new IllegalArgumentException("loader can't be 'null'");
-            }
-        }
-
-        // define each module in the configuration to the VM
-        for (ResolvedModule resolvedModule : cf.modules()) {
-            ModuleReference mref = resolvedModule.reference();
-            ModuleDescriptor descriptor = mref.descriptor();
-            String name = descriptor.name();
-            URI uri = mref.location().orElse(null);
-            ClassLoader loader = moduleToLoader.get(resolvedModule.name());
-            Module m;
-            if (loader == null && isBootLayer && name.equals("java.base")) {
-                // java.base is already defined to the VM
-                m = Object.class.getModule();
-            } else {
-                m = new Module(layer, loader, descriptor, uri);
-            }
-            nameToModule.put(name, m);
-            moduleToLoader.put(name, loader);
-        }
-
-        // setup readability and exports
-        for (ResolvedModule resolvedModule : cf.modules()) {
-            ModuleReference mref = resolvedModule.reference();
-            ModuleDescriptor descriptor = mref.descriptor();
-
-            String mn = descriptor.name();
-            Module m = nameToModule.get(mn);
-            assert m != null;
-
-            // reads
-            Set<Module> reads = new HashSet<>();
-            for (ResolvedModule other : resolvedModule.reads()) {
-                Module m2 = null;
-                if (other.configuration() == cf) {
-                    String dn = other.reference().descriptor().name();
-                    m2 = nameToModule.get(dn);
-                } else {
-                    for (Layer parent: layer.parents()) {
-                        m2 = findModule(parent, other);
-                        if (m2 != null)
-                            break;
-                    }
-                }
-                assert m2 != null;
-
-                reads.add(m2);
-
-                // update VM view
-                addReads0(m, m2);
-            }
-            m.reads = reads;
-
-            // automatic modules read all unnamed modules
-            if (descriptor.isAutomatic()) {
-                m.implAddReads(ALL_UNNAMED_MODULE, true);
-            }
-
-            // exports and opens
-            initExportsAndOpens(descriptor, nameToModule, m);
-        }
-
-        // register the modules in the boot layer
-        if (isBootLayer) {
-            for (ResolvedModule resolvedModule : cf.modules()) {
-                ModuleReference mref = resolvedModule.reference();
-                ModuleDescriptor descriptor = mref.descriptor();
-                if (!descriptor.provides().isEmpty()) {
-                    String name = descriptor.name();
-                    Module m = nameToModule.get(name);
-                    ClassLoader loader = moduleToLoader.get(name);
-                    ServicesCatalog catalog;
-                    if (loader == null) {
-                        catalog = BootLoader.getServicesCatalog();
-                    } else {
-                        catalog = ServicesCatalog.getServicesCatalog(loader);
-                    }
-                    catalog.register(m);
-                }
-            }
-        }
-
-        // record that there is a layer with modules defined to the class loader
-        for (ClassLoader loader : loaders) {
-            layer.bindToLoader(loader);
-        }
-
-        return nameToModule;
-    }
-
-
-    /**
-     * Find the runtime Module corresponding to the given ResolvedModule
-     * in the given parent layer (or its parents).
-     */
-    private static Module findModule(Layer parent, ResolvedModule resolvedModule) {
-        Configuration cf = resolvedModule.configuration();
-        String dn = resolvedModule.name();
-        return parent.layers()
-                .filter(l -> l.configuration() == cf)
-                .findAny()
-                .map(layer -> {
-                    Optional<Module> om = layer.findModule(dn);
-                    assert om.isPresent() : dn + " not found in layer";
-                    Module m = om.get();
-                    assert m.getLayer() == layer : m + " not in expected layer";
-                    return m;
-                })
-                .orElse(null);
-    }
-
-    /**
-     * Initialize the maps of exported and open packages for module m.
-     */
-    private static void initExportsAndOpens(ModuleDescriptor descriptor,
-                                            Map<String, Module> nameToModule,
-                                            Module m)
-    {
-        // The VM doesn't know about open modules so need to export all packages
-        if (descriptor.isOpen()) {
-            assert descriptor.opens().isEmpty();
-            for (String source : descriptor.packages()) {
-                addExportsToAll0(m, source);
-            }
-            return;
-        }
-
-        Map<String, Set<Module>> openPackages = new HashMap<>();
-        Map<String, Set<Module>> exportedPackages = new HashMap<>();
-
-        // process the open packages first
-        for (Opens opens : descriptor.opens()) {
-            String source = opens.source();
-
-            if (opens.isQualified()) {
-                // qualified opens
-                Set<Module> targets = new HashSet<>();
-                for (String target : opens.targets()) {
-                    // only open to modules that are in this configuration
-                    Module m2 = nameToModule.get(target);
-                    if (m2 != null) {
-                        addExports0(m, source, m2);
-                        targets.add(m2);
-                    }
-                }
-                if (!targets.isEmpty()) {
-                    openPackages.put(source, targets);
-                }
-            } else {
-                // unqualified opens
-                addExportsToAll0(m, source);
-                openPackages.put(source, EVERYONE_SET);
-            }
-        }
-
-        // next the exports, skipping exports when the package is open
-        for (Exports exports : descriptor.exports()) {
-            String source = exports.source();
-
-            // skip export if package is already open to everyone
-            Set<Module> openToTargets = openPackages.get(source);
-            if (openToTargets != null && openToTargets.contains(EVERYONE_MODULE))
-                continue;
-
-            if (exports.isQualified()) {
-                // qualified exports
-                Set<Module> targets = new HashSet<>();
-                for (String target : exports.targets()) {
-                    // only export to modules that are in this configuration
-                    Module m2 = nameToModule.get(target);
-                    if (m2 != null) {
-                        // skip qualified export if already open to m2
-                        if (openToTargets == null || !openToTargets.contains(m2)) {
-                            addExports0(m, source, m2);
-                            targets.add(m2);
-                        }
-                    }
-                }
-                if (!targets.isEmpty()) {
-                    exportedPackages.put(source, targets);
-                }
-
-            } else {
-                // unqualified exports
-                addExportsToAll0(m, source);
-                exportedPackages.put(source, EVERYONE_SET);
-            }
-        }
-
-        if (!openPackages.isEmpty())
-            m.openPackages = openPackages;
-        if (!exportedPackages.isEmpty())
-            m.exportedPackages = exportedPackages;
-    }
-
-
-    // -- annotations --
-
-    /**
-     * {@inheritDoc}
-     * This method returns {@code null} when invoked on an unnamed module.
-     */
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        return moduleInfoClass().getDeclaredAnnotation(annotationClass);
-    }
-
-    /**
-     * {@inheritDoc}
-     * This method returns an empty array when invoked on an unnamed module.
-     */
-    @Override
-    public Annotation[] getAnnotations() {
-        return moduleInfoClass().getAnnotations();
-    }
-
-    /**
-     * {@inheritDoc}
-     * This method returns an empty array when invoked on an unnamed module.
-     */
-    @Override
-    public Annotation[] getDeclaredAnnotations() {
-        return moduleInfoClass().getDeclaredAnnotations();
-    }
-
-    // cached class file with annotations
-    private volatile Class<?> moduleInfoClass;
-
-    private Class<?> moduleInfoClass() {
-        Class<?> clazz = this.moduleInfoClass;
-        if (clazz != null)
-            return clazz;
-
-        synchronized (this) {
-            clazz = this.moduleInfoClass;
-            if (clazz == null) {
-                if (isNamed()) {
-                    PrivilegedAction<Class<?>> pa = this::loadModuleInfoClass;
-                    clazz = AccessController.doPrivileged(pa);
-                }
-                if (clazz == null) {
-                    class DummyModuleInfo { }
-                    clazz = DummyModuleInfo.class;
-                }
-                this.moduleInfoClass = clazz;
-            }
-            return clazz;
-        }
-    }
-
-    private Class<?> loadModuleInfoClass() {
-        Class<?> clazz = null;
-        try (InputStream in = getResourceAsStream("module-info.class")) {
-            if (in != null)
-                clazz = loadModuleInfoClass(in);
-        } catch (Exception ignore) { }
-        return clazz;
-    }
-
-    /**
-     * Loads module-info.class as a package-private interface in a class loader
-     * that is a child of this module's class loader.
-     */
-    private Class<?> loadModuleInfoClass(InputStream in) throws IOException {
-        final String MODULE_INFO = "module-info";
-
-        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS
-                                         + ClassWriter.COMPUTE_FRAMES);
-
-        ClassVisitor cv = new ClassVisitor(Opcodes.ASM5, cw) {
-            @Override
-            public void visit(int version,
-                              int access,
-                              String name,
-                              String signature,
-                              String superName,
-                              String[] interfaces) {
-                cw.visit(version,
-                        Opcodes.ACC_INTERFACE
-                            + Opcodes.ACC_ABSTRACT
-                            + Opcodes.ACC_SYNTHETIC,
-                        MODULE_INFO,
-                        null,
-                        "java/lang/Object",
-                        null);
-            }
-            @Override
-            public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
-                // keep annotations
-                return super.visitAnnotation(desc, visible);
-            }
-            @Override
-            public void visitAttribute(Attribute attr) {
-                // drop non-annotation attributes
-            }
-        };
-
-        ClassReader cr = new ClassReader(in);
-        cr.accept(cv, 0);
-        byte[] bytes = cw.toByteArray();
-
-        ClassLoader cl = new ClassLoader(loader) {
-            @Override
-            protected Class<?> findClass(String cn)throws ClassNotFoundException {
-                if (cn.equals(MODULE_INFO)) {
-                    return super.defineClass(cn, bytes, 0, bytes.length);
-                } else {
-                    throw new ClassNotFoundException(cn);
-                }
-            }
-        };
-
-        try {
-            return cl.loadClass(MODULE_INFO);
-        } catch (ClassNotFoundException e) {
-            throw new InternalError(e);
-        }
-    }
-
-
-    // -- misc --
-
-
-    /**
-     * Returns an input stream for reading a resource in this module. The
-     * {@code name} parameter is a {@code '/'}-separated path name that
-     * identifies the resource.
-     *
-     * <p> A resource in a named modules may be <em>encapsulated</em> so that
-     * it cannot be located by code in other modules. Whether a resource can be
-     * located or not is determined as follows:
-     *
-     * <ul>
-     *     <li> The <em>package name</em> of the resource is derived from the
-     *     subsequence of characters that precedes the last {@code '/'} and then
-     *     replacing each {@code '/'} character in the subsequence with
-     *     {@code '.'}. For example, the package name derived for a resource
-     *     named "{@code a/b/c/foo.properties}" is "{@code a.b.c}". </li>
-     *
-     *     <li> If the package name is a package in the module then the package
-     *     must be {@link #isOpen open} the module of the caller of this method.
-     *     If the package is not in the module then the resource is not
-     *     encapsulated. Resources in the unnamed package or "{@code META-INF}",
-     *     for example, are never encapsulated because they can never be
-     *     packages in a named module. </li>
-     *
-     *     <li> As a special case, resources ending with "{@code .class}" are
-     *     never encapsulated. </li>
-     * </ul>
-     *
-     * <p> This method returns {@code null} if the resource is not in this
-     * module, the resource is encapsulated and cannot be located by the caller,
-     * or access to the resource is denied by the security manager.
-     *
-     * @param  name
-     *         The resource name
-     *
-     * @return An input stream for reading the resource or {@code null}
-     *
-     * @throws IOException
-     *         If an I/O error occurs
-     *
-     * @see java.lang.module.ModuleReader#open(String)
-     */
-    @CallerSensitive
-    public InputStream getResourceAsStream(String name) throws IOException {
-        Objects.requireNonNull(name);
-
-        if (isNamed() && !ResourceHelper.isSimpleResource(name)) {
-            Module caller = Reflection.getCallerClass().getModule();
-            if (caller != this && caller != Object.class.getModule()) {
-                // ignore packages added for proxies via addPackage
-                Set<String> packages = getDescriptor().packages();
-                String pn = ResourceHelper.getPackageName(name);
-                if (packages.contains(pn) && !isOpen(pn, caller)) {
-                    // resource is in package not open to caller
-                    return null;
-                }
-            }
-        }
-
-        String mn = this.name;
-
-        // special-case built-in class loaders to avoid URL connection
-        if (loader == null) {
-            return BootLoader.findResourceAsStream(mn, name);
-        } else if (loader instanceof BuiltinClassLoader) {
-            return ((BuiltinClassLoader) loader).findResourceAsStream(mn, name);
-        }
-
-        // locate resource in module
-        JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
-        URL url = jla.findResource(loader, mn, name);
-        if (url != null) {
-            try {
-                return url.openStream();
-            } catch (SecurityException e) { }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the string representation of this module. For a named module,
-     * the representation is the string {@code "module"}, followed by a space,
-     * and then the module name. For an unnamed module, the representation is
-     * the string {@code "unnamed module"}, followed by a space, and then an
-     * implementation specific string that identifies the unnamed module.
-     *
-     * @return The string representation of this module
-     */
-    @Override
-    public String toString() {
-        if (isNamed()) {
-            return "module " + name;
-        } else {
-            String id = Integer.toHexString(System.identityHashCode(this));
-            return "unnamed module @" + id;
-        }
-    }
-
-
-    // -- native methods --
-
-    // JVM_DefineModule
-    private static native void defineModule0(Module module,
-                                             boolean isOpen,
-                                             String version,
-                                             String location,
-                                             String[] pns);
-
-    // JVM_AddReadsModule
-    private static native void addReads0(Module from, Module to);
-
-    // JVM_AddModuleExports
-    private static native void addExports0(Module from, String pn, Module to);
-
-    // JVM_AddModuleExportsToAll
-    private static native void addExportsToAll0(Module from, String pn);
-
-    // JVM_AddModuleExportsToAllUnnamed
-    private static native void addExportsToAllUnnamed0(Module from, String pn);
-
-    // JVM_AddModulePackage
-    private static native void addPackage0(Module m, String pn);
-
-    /**
-     * Register shared secret to provide access to package-private methods
-     */
-    static {
-        SharedSecrets.setJavaLangReflectModuleAccess(
-            new JavaLangReflectModuleAccess() {
-                @Override
-                public Module defineUnnamedModule(ClassLoader loader) {
-                    return new Module(loader);
-                }
-                @Override
-                public Module defineModule(ClassLoader loader,
-                                           ModuleDescriptor descriptor,
-                                           URI uri) {
-                   return new Module(null, loader, descriptor, uri);
-                }
-                @Override
-                public void addReads(Module m1, Module m2) {
-                    m1.implAddReads(m2, true);
-                }
-                @Override
-                public void addReadsAllUnnamed(Module m) {
-                    m.implAddReads(Module.ALL_UNNAMED_MODULE);
-                }
-                @Override
-                public void addExports(Module m, String pn, Module other) {
-                    m.implAddExportsOrOpens(pn, other, false, true);
-                }
-                @Override
-                public void addOpens(Module m, String pn, Module other) {
-                    m.implAddExportsOrOpens(pn, other, true, true);
-                }
-                @Override
-                public void addExportsToAll(Module m, String pn) {
-                    m.implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, false, true);
-                }
-                @Override
-                public void addOpensToAll(Module m, String pn) {
-                    m.implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, true, true);
-                }
-                @Override
-                public void addExportsToAllUnnamed(Module m, String pn) {
-                    m.implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, false, true);
-                }
-                @Override
-                public void addOpensToAllUnnamed(Module m, String pn) {
-                    m.implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, true, true);
-                }
-                @Override
-                public void addUses(Module m, Class<?> service) {
-                    m.implAddUses(service);
-                }
-                @Override
-                public void addPackage(Module m, String pn) {
-                    m.implAddPackage(pn, true);
-                }
-                @Override
-                public ServicesCatalog getServicesCatalog(Layer layer) {
-                    return layer.getServicesCatalog();
-                }
-                @Override
-                public Stream<Layer> layers(Layer layer) {
-                    return layer.layers();
-                }
-                @Override
-                public Stream<Layer> layers(ClassLoader loader) {
-                    return Layer.layers(loader);
-                }
-                @Override
-                public boolean isStaticallyExported(Module module, String pn, Module other) {
-                    return module.isStaticallyExportedOrOpen(pn, other, false);
-                }
-            });
-    }
-}
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java
index 15d41a4..c47caad 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 
 package java.lang.reflect;
 
+import java.lang.module.ModuleDescriptor;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Arrays;
@@ -52,6 +53,9 @@
 import sun.security.action.GetPropertyAction;
 import sun.security.util.SecurityConstants;
 
+import static java.lang.module.ModuleDescriptor.Modifier.SYNTHETIC;
+
+
 /**
  *
  * {@code Proxy} provides static methods for creating objects that act like instances
@@ -164,7 +168,8 @@
  * methods is specified as follows:
  *
  * <ol>
- * <li>If all the proxy interfaces are in <em>exported</em> packages:
+ * <li>If all the proxy interfaces are in <em>exported</em> or <em>open</em>
+ *     packages:
  * <ol type="a">
  * <li>if all the proxy interfaces are <em>public</em>, then the proxy class is
  *     <em>public</em> in a package exported by the
@@ -178,10 +183,11 @@
  *     <a href="#restrictions">not possible</a>.</li>
  * </ol>
  * </li>
- * <li>If at least one proxy interface is a <em>non-exported</em> package:
+ * <li>If at least one proxy interface is in a package that is
+ *     <em>non-exported</em> and <em>non-open</em>:
  * <ol type="a">
  * <li>if all the proxy interfaces are <em>public</em>, then the proxy class is
- *     <em>public</em> in a <em>non-exported</em> package of
+ *     <em>public</em> in a <em>non-exported</em>, <em>non-open</em> package of
  *     <a href="#dynamicmodule"><em>dynamic module</em>.</a>
  *     The names of the package and the module are unspecified.</li>
  *
@@ -195,21 +201,22 @@
  * </ol>
  *
  * <p>
- * Note that if proxy interfaces with a mix of accessibilities --
- * exported public, exported non-public, non-exported public, non-exported non-public --
- * are proxied by the same instance, then the proxy class's accessibility is
+ * Note that if proxy interfaces with a mix of accessibilities -- for example,
+ * an exported public interface and a non-exported non-public interface -- are
+ * proxied by the same instance, then the proxy class's accessibility is
  * governed by the least accessible proxy interface.
  * <p>
  * Note that it is possible for arbitrary code to obtain access to a proxy class
- * in an exported package with {@link AccessibleObject#setAccessible setAccessible},
- * whereas a proxy class in a non-exported package is never accessible to
+ * in an open package with {@link AccessibleObject#setAccessible setAccessible},
+ * whereas a proxy class in a non-open package is never accessible to
  * code outside the module of the proxy class.
  *
  * <p>
- * Throughout this specification, a "non-exported package" refers to a package that
- * is not exported to all modules. Specifically, it refers to a package that
- * either is not exported at all by its containing module or is exported in a
- * qualified fashion by its containing module.
+ * Throughout this specification, a "non-exported package" refers to a package
+ * that is not exported to all modules, and a "non-open package" refers to
+ * a package that is not open to all modules.  Specifically, these terms refer to
+ * a package that either is not exported/open by its containing module or is
+ * exported/open in a qualified fashion by its containing module.
  *
  * <h3><a name="dynamicmodule">Dynamic Modules</a></h3>
  * <p>
@@ -220,11 +227,11 @@
  * {@code Proxy.newProxyInstance} method should be used instead.
  *
  * <p>
- * A dynamic module can read the modules of all of the superinterfaces of a proxy class
- * and the modules of the types referenced by all public method signatures
+ * A dynamic module can read the modules of all of the superinterfaces of a proxy
+ * class and the modules of the types referenced by all public method signatures
  * of a proxy class.  If a superinterface or a referenced type, say {@code T},
- * is in a non-exported package, the {@linkplain java.lang.reflect.Module module}
- * of {@code T} is updated to export the package of {@code T} to the dynamic module.
+ * is in a non-exported package, the {@linkplain Module module} of {@code T} is
+ * updated to export the package of {@code T} to the dynamic module.
  *
  * <h3>Methods Duplicated in Multiple Proxy Interfaces</h3>
  *
@@ -272,6 +279,8 @@
  * @author      Peter Jones
  * @see         InvocationHandler
  * @since       1.3
+ * @revised 9
+ * @spec JPMS
  */
 public class Proxy implements java.io.Serializable {
     private static final long serialVersionUID = -2222568056686623797L;
@@ -350,14 +359,17 @@
      * @throws  NullPointerException if the {@code interfaces} array
      *          argument or any of its elements are {@code null}
      *
-     * @deprecated Proxy classes generated in a named module are encapsulated and not
-     *      accessible to code outside its module.
-     *      {@link Constructor#newInstance(Object...) Constructor.newInstance} will throw
-     *      {@code IllegalAccessException} when it is called on an inaccessible proxy class.
+     * @deprecated Proxy classes generated in a named module are encapsulated
+     *      and not accessible to code outside its module.
+     *      {@link Constructor#newInstance(Object...) Constructor.newInstance}
+     *      will throw {@code IllegalAccessException} when it is called on
+     *      an inaccessible proxy class.
      *      Use {@link #newProxyInstance(ClassLoader, Class[], InvocationHandler)}
      *      to create a proxy instance instead.
      *
      * @see <a href="#membership">Package and Module Membership of Proxy Class</a>
+     * @revised 9
+     * @spec JPMS
      */
     @Deprecated
     @CallerSensitive
@@ -500,17 +512,19 @@
                         "Unnamed package cannot be added to " + m);
             }
 
-            // add the package to the runtime module if not exists
             if (m.isNamed()) {
-                m.addPackage(proxyPkg);
+                if (!m.getDescriptor().packages().contains(proxyPkg)) {
+                    throw new InternalError(proxyPkg + " not exist in " + m.getName());
+                }
             }
 
             /*
              * Choose a name for the proxy class to generate.
              */
             long num = nextUniqueNumber.getAndIncrement();
-            String proxyName = proxyPkg.isEmpty() ? proxyClassNamePrefix + num
-                                                  : proxyPkg + "." + proxyClassNamePrefix + num;
+            String proxyName = proxyPkg.isEmpty()
+                                    ? proxyClassNamePrefix + num
+                                    : proxyPkg + "." + proxyClassNamePrefix + num;
 
             ClassLoader loader = getLoader(m);
             trace(proxyName, m, loader, interfaces);
@@ -570,9 +584,13 @@
                     c.getModule().getName(), c.getName(), access, ld);
         }
 
-        static void trace(String cn, Module module, ClassLoader loader, List<Class<?>> interfaces) {
+        static void trace(String cn,
+                          Module module,
+                          ClassLoader loader,
+                          List<Class<?>> interfaces) {
             if (isDebug()) {
-                System.out.format("PROXY: %s/%s defined by %s%n", module.getName(), cn, loader);
+                System.err.format("PROXY: %s/%s defined by %s%n",
+                                  module.getName(), cn, loader);
             }
             if (isDebug("debug")) {
                 interfaces.stream()
@@ -581,7 +599,7 @@
         }
 
         private static final String DEBUG =
-                GetPropertyAction.privilegedGetProperty("jdk.proxy.debug", "");
+            GetPropertyAction.privilegedGetProperty("jdk.proxy.debug", "");
 
         private static boolean isDebug() {
             return !DEBUG.isEmpty();
@@ -592,15 +610,16 @@
 
         // ProxyBuilder instance members start here....
 
-        private final ClassLoader loader;
         private final List<Class<?>> interfaces;
         private final Module module;
         ProxyBuilder(ClassLoader loader, List<Class<?>> interfaces) {
             if (!VM.isModuleSystemInited()) {
-                throw new InternalError("Proxy is not supported until module system is fully initialized");
+                throw new InternalError("Proxy is not supported until "
+                        + "module system is fully initialized");
             }
             if (interfaces.size() > 65535) {
-                throw new IllegalArgumentException("interface limit exceeded: " + interfaces.size());
+                throw new IllegalArgumentException("interface limit exceeded: "
+                        + interfaces.size());
             }
 
             Set<Class<?>> refTypes = referencedTypes(loader, interfaces);
@@ -608,7 +627,6 @@
             // IAE if violates any restrictions specified in newProxyInstance
             validateProxyInterfaces(loader, interfaces, refTypes);
 
-            this.loader = loader;
             this.interfaces = interfaces;
             this.module = mapToModule(loader, interfaces, refTypes);
             assert getLoader(module) == loader;
@@ -648,8 +666,8 @@
          * Validate the given proxy interfaces and the given referenced types
          * are visible to the defining loader.
          *
-         * @throws IllegalArgumentException if it violates the restrictions specified
-         *         in {@link Proxy#newProxyInstance}
+         * @throws IllegalArgumentException if it violates the restrictions
+         *         specified in {@link Proxy#newProxyInstance}
          */
         private static void validateProxyInterfaces(ClassLoader loader,
                                                     List<Class<?>> interfaces,
@@ -720,9 +738,9 @@
          * is in the same module of the package-private interface.
          *
          * If all proxy interfaces are public and at least one in a non-exported
-         * package, then the proxy class is in a dynamic module in a non-exported
-         * package.  Reads edge and qualified exports are added for
-         * dynamic module to access.
+         * package, then the proxy class is in a dynamic module in a
+         * non-exported package.  Reads edge and qualified exports are added
+         * for dynamic module to access.
          */
         private static Module mapToModule(ClassLoader loader,
                                           List<Class<?>> interfaces,
@@ -741,11 +759,12 @@
                 }
             }
 
-            // all proxy interfaces are public and exported, the proxy class is in unnamed module
-            // Such proxy class is accessible to any unnamed module and named module that
-            // can read unnamed module
+            // all proxy interfaces are public and exported, the proxy class
+            // is in unnamed module.  Such proxy class is accessible to
+            // any unnamed module and named module that can read unnamed module
             if (packagePrivateTypes.isEmpty() && modulePrivateTypes.isEmpty()) {
-                return loader != null ? loader.getUnnamedModule() : BootLoader.getUnnamedModule();
+                return loader != null ? loader.getUnnamedModule()
+                                      : BootLoader.getUnnamedModule();
             }
 
             if (packagePrivateTypes.size() > 0) {
@@ -767,7 +786,8 @@
                 Module target = null;
                 for (Module m : packagePrivateTypes.values()) {
                     if (getLoader(m) != loader) {
-                        // the specified loader is not the same class loader of the non-public interface
+                        // the specified loader is not the same class loader
+                        // of the non-public interface
                         throw new IllegalArgumentException(
                                 "non-public interface is not defined by the given loader");
                     }
@@ -788,8 +808,9 @@
                 return target;
             }
 
-            // all proxy interfaces are public and at least one in a non-exported package
-            // map to dynamic proxy module and add reads edge and qualified exports, if necessary
+            // All proxy interfaces are public and at least one in a non-exported
+            // package.  So maps to a dynamic proxy module and add reads edge
+            // and qualified exports, if necessary
             Module target = getDynamicModule(loader);
 
             // set up proxy class access to proxy interfaces and types
@@ -845,8 +866,8 @@
         private static final AtomicInteger counter = new AtomicInteger();
 
         /*
-         * Define a dynamic module for the generated proxy classes in a non-exported package
-         * named com.sun.proxy.$MODULE.
+         * Define a dynamic module for the generated proxy classes in
+         * a non-exported package named com.sun.proxy.$MODULE.
          *
          * Each class loader will have one dynamic module.
          */
@@ -855,7 +876,11 @@
                 // create a dynamic module and setup module access
                 String mn = "jdk.proxy" + counter.incrementAndGet();
                 String pn = PROXY_PACKAGE_PREFIX + "." + mn;
-                Module m = Modules.defineModule(ld, mn, Collections.singleton(pn));
+                ModuleDescriptor descriptor =
+                    ModuleDescriptor.newModule(mn, Set.of(SYNTHETIC))
+                                    .packages(Set.of(pn))
+                                    .build();
+                Module m = Modules.defineModule(ld, descriptor, null);
                 Modules.addReads(m, Proxy.class.getModule());
                 // java.base to create proxy instance
                 Modules.addExports(m, pn, Object.class.getModule());
@@ -955,6 +980,8 @@
      *          {@code null}
      *
      * @see <a href="#membership">Package and Module Membership of Proxy Class</a>
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static Object newProxyInstance(ClassLoader loader,
@@ -1039,6 +1066,9 @@
      * @return  {@code true} if the class is a proxy class and
      *          {@code false} otherwise
      * @throws  NullPointerException if {@code cl} is {@code null}
+     *
+     * @revised 9
+     * @spec JPMS
      */
     public static boolean isProxyClass(Class<?> cl) {
         return Proxy.class.isAssignableFrom(cl) && ProxyBuilder.isProxyClass(cl);
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java b/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java
deleted file mode 100644
index 39a623a..0000000
--- a/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.lang.reflect;
-
-import java.lang.ref.Reference;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.WeakReference;
-import java.util.Collection;
-import java.util.Objects;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.BiFunction;
-
-/**
- * A WeakHashMap-like data structure that uses a pair of weakly-referenced keys
- * with identity equality semantics to associate a strongly-referenced value.
- * Unlike WeakHashMap, this data structure is thread-safe.
- *
- * @param <K1> the type of 1st key in key pair
- * @param <K2> the type of 2nd key in key pair
- * @param <V>  the type of value
- * @author Peter Levart
- */
-final class WeakPairMap<K1, K2, V> {
-
-    private final ConcurrentHashMap<Pair<K1, K2>, V> map = new ConcurrentHashMap<>();
-    private final ReferenceQueue<Object> queue = new ReferenceQueue<>();
-
-    /**
-     * Tests if the specified pair of keys are associated with a value
-     * in the WeakPairMap.
-     *
-     * @param k1 the 1st of the pair of keys
-     * @param k2 the 2nd of the pair of keys
-     * @return true if and only if the specified key pair is in this WeakPairMap,
-     * as determined by the identity comparison; false otherwise
-     * @throws NullPointerException if any of the specified keys is null
-     */
-    public boolean containsKeyPair(K1 k1, K2 k2) {
-        expungeStaleAssociations();
-        return map.containsKey(Pair.lookup(k1, k2));
-    }
-
-    /**
-     * Returns the value to which the specified pair of keys is mapped, or null
-     * if this WeakPairMap contains no mapping for the key pair.
-     * <p>More formally, if this WeakPairMap contains a mapping from a key pair
-     * {@code (_k1, _k2)} to a value {@code v} such that
-     * {@code k1 == _k1 && k2 == _k2}, then this method returns {@code v};
-     * otherwise it returns {@code null}.
-     * (There can be at most one such mapping.)
-     *
-     * @param k1 the 1st of the pair of keys for which the mapped value is to
-     *           be returned
-     * @param k2 the 2nd of the pair of keys for which the mapped value is to
-     *           be returned
-     * @return the value to which the specified key pair is mapped, or null if
-     * this map contains no mapping for the key pair
-     * @throws NullPointerException if any of the specified keys is null
-     */
-    public V get(K1 k1, K2 k2) {
-        expungeStaleAssociations();
-        return map.get(Pair.lookup(k1, k2));
-    }
-
-    /**
-     * Maps the specified key pair to the specified value in this WeakPairMap.
-     * Neither the keys nor the value can be null.
-     * <p>The value can be retrieved by calling the {@link #get} method
-     * with the the same keys (compared by identity).
-     *
-     * @param k1 the 1st of the pair of keys with which the specified value is to
-     *           be associated
-     * @param k2 the 2nd of the pair of keys with which the specified value is to
-     *           be associated
-     * @param v  value to be associated with the specified key pair
-     * @return the previous value associated with key pair, or {@code null} if
-     * there was no mapping for key pair
-     * @throws NullPointerException if any of the specified keys or value is null
-     */
-    public V put(K1 k1, K2 k2, V v) {
-        expungeStaleAssociations();
-        return map.put(Pair.weak(k1, k2, queue), v);
-    }
-
-    /**
-     * If the specified key pair is not already associated with a value,
-     * associates it with the given value and returns {@code null}, else does
-     * nothing and returns the currently associated value.
-     *
-     * @param k1 the 1st of the pair of keys with which the specified value is to
-     *           be associated
-     * @param k2 the 2nd of the pair of keys with which the specified value is to
-     *           be associated
-     * @param v  value to be associated with the specified key pair
-     * @return the previous value associated with key pair, or {@code null} if
-     * there was no mapping for key pair
-     * @throws NullPointerException if any of the specified keys or value is null
-     */
-    public V putIfAbsent(K1 k1, K2 k2, V v) {
-        expungeStaleAssociations();
-        return map.putIfAbsent(Pair.weak(k1, k2, queue), v);
-    }
-
-    /**
-     * If the specified key pair is not already associated with a value,
-     * attempts to compute its value using the given mapping function
-     * and enters it into this WeakPairMap unless {@code null}. The entire
-     * method invocation is performed atomically, so the function is
-     * applied at most once per key pair. Some attempted update operations
-     * on this WeakPairMap by other threads may be blocked while computation
-     * is in progress, so the computation should be short and simple,
-     * and must not attempt to update any other mappings of this WeakPairMap.
-     *
-     * @param k1              the 1st of the pair of keys with which the
-     *                        computed value is to be associated
-     * @param k2              the 2nd of the pair of keys with which the
-     *                        computed value is to be associated
-     * @param mappingFunction the function to compute a value
-     * @return the current (existing or computed) value associated with
-     * the specified key pair, or null if the computed value is null
-     * @throws NullPointerException  if any of the specified keys or
-     *                               mappingFunction is null
-     * @throws IllegalStateException if the computation detectably
-     *                               attempts a recursive update to this map
-     *                               that would otherwise never complete
-     * @throws RuntimeException      or Error if the mappingFunction does so, in
-     *                               which case the mapping is left unestablished
-     */
-    public V computeIfAbsent(K1 k1, K2 k2,
-                             BiFunction<? super K1, ? super K2, ? extends V>
-                                 mappingFunction) {
-        expungeStaleAssociations();
-        try {
-            return map.computeIfAbsent(
-                Pair.weak(k1, k2, queue),
-                pair -> mappingFunction.apply(pair.first(), pair.second()));
-        } finally {
-            Reference.reachabilityFence(k1);
-            Reference.reachabilityFence(k2);
-        }
-    }
-
-    /**
-     * Returns a {@link Collection} view of the values contained in this
-     * WeakPairMap. The collection is backed by the WeakPairMap, so changes to
-     * the map are reflected in the collection, and vice-versa.  The collection
-     * supports element removal, which removes the corresponding
-     * mapping from this map, via the {@code Iterator.remove},
-     * {@code Collection.remove}, {@code removeAll},
-     * {@code retainAll}, and {@code clear} operations.  It does not
-     * support the {@code add} or {@code addAll} operations.
-     *
-     * @return the collection view
-     */
-    public Collection<V> values() {
-        expungeStaleAssociations();
-        return map.values();
-    }
-
-    /**
-     * Removes associations from this WeakPairMap for which at least one of the
-     * keys in key pair has been found weakly-reachable and corresponding
-     * WeakRefPeer(s) enqueued. Called as part of each public operation.
-     */
-    private void expungeStaleAssociations() {
-        WeakRefPeer<?> peer;
-        while ((peer = (WeakRefPeer<?>) queue.poll()) != null) {
-            map.remove(peer.weakPair());
-        }
-    }
-
-    /**
-     * Common interface of both {@link Weak} and {@link Lookup} key pairs.
-     */
-    private interface Pair<K1, K2> {
-
-        static <K1, K2> Pair<K1, K2> weak(K1 k1, K2 k2,
-                                          ReferenceQueue<Object> queue) {
-            return new Weak<>(k1, k2, queue);
-        }
-
-        static <K1, K2> Pair<K1, K2> lookup(K1 k1, K2 k2) {
-            return new Lookup<>(k1, k2);
-        }
-
-        /**
-         * @return The 1st of the pair of keys (may be null for {@link Weak}
-         * when it gets cleared)
-         */
-        K1 first();
-
-        /**
-         * @return The 2nd of the pair of keys (may be null for {@link Weak}
-         * when it gets cleared)
-         */
-        K2 second();
-
-        static int hashCode(Object first, Object second) {
-            // assert first != null && second != null;
-            return System.identityHashCode(first) ^
-                   System.identityHashCode(second);
-        }
-
-        static boolean equals(Object first, Object second, Pair<?, ?> p) {
-            return first != null && second != null &&
-                   first == p.first() && second == p.second();
-        }
-
-        /**
-         * A Pair where both keys are weakly-referenced.
-         * It is composed of two instances of {@link WeakRefPeer}s:
-         * <pre>{@code
-         *
-         *     +-referent-> [K1]                +-referent-> [K2]
-         *     |                                |
-         *   +----------------+               +----------------+
-         *   | Pair.Weak <:   |-----peer----->| (anonymous) <: |
-         *   | WeakRefPeer,   |               | WeakRefPeer    |
-         *   | Pair           |<--weakPair()--|                |
-         *   +----------------+               +----------------+
-         *     |            ^
-         *     |            |
-         *     +-weakPair()-+
-         *
-         * }</pre>
-         * <p>
-         * Pair.Weak is used for CHM keys. Both peers are associated with the
-         * same {@link ReferenceQueue} so when either of their referents
-         * becomes weakly-reachable, the corresponding entries can be
-         * {@link #expungeStaleAssociations() expunged} from the map.
-         */
-        final class Weak<K1, K2> extends WeakRefPeer<K1> implements Pair<K1, K2> {
-
-            // saved hash so it can be retrieved after the reference is cleared
-            private final int hash;
-            // link to <K2> peer
-            private final WeakRefPeer<K2> peer;
-
-            Weak(K1 k1, K2 k2, ReferenceQueue<Object> queue) {
-                super(k1, queue);
-                hash = Pair.hashCode(k1, k2);
-                peer = new WeakRefPeer<>(k2, queue) {
-                    // link back to <K1> peer
-                    @Override
-                    Weak<?, ?> weakPair() { return Weak.this; }
-                };
-            }
-
-            @Override
-            Weak<?, ?> weakPair() {
-                return this;
-            }
-
-            @Override
-            public K1 first() {
-                return get();
-            }
-
-            @Override
-            public K2 second() {
-                return peer.get();
-            }
-
-            @Override
-            public int hashCode() {
-                return hash;
-            }
-
-            @Override
-            public boolean equals(Object obj) {
-                return this == obj ||
-                       (obj instanceof Pair &&
-                        Pair.equals(first(), second(), (Pair<?, ?>) obj));
-            }
-        }
-
-        /**
-         * Optimized lookup Pair, used as lookup key in methods like
-         * {@link java.util.Map#get(Object)} or
-         * {@link java.util.Map#containsKey(Object)}) where
-         * there is a great chance its allocation is eliminated
-         * by escape analysis when such lookups are inlined by JIT.
-         * All its methods are purposely designed so that 'this' is never
-         * passed to any other method or used as identity.
-         */
-        final class Lookup<K1, K2> implements Pair<K1, K2> {
-            private final K1 k1;
-            private final K2 k2;
-
-            Lookup(K1 k1, K2 k2) {
-                this.k1 = Objects.requireNonNull(k1);
-                this.k2 = Objects.requireNonNull(k2);
-            }
-
-            @Override
-            public K1 first() {
-                return k1;
-            }
-
-            @Override
-            public K2 second() {
-                return k2;
-            }
-
-            @Override
-            public int hashCode() {
-                return Pair.hashCode(k1, k2);
-            }
-
-            @Override
-            public boolean equals(Object obj) {
-                return obj instanceof Pair &&
-                       Pair.equals(k1, k2, (Pair<?, ?>) obj);
-            }
-        }
-    }
-
-    /**
-     * Common abstract supertype of a pair of WeakReference peers.
-     */
-    private static abstract class WeakRefPeer<K> extends WeakReference<K> {
-
-        WeakRefPeer(K k, ReferenceQueue<Object> queue) {
-            super(Objects.requireNonNull(k), queue);
-        }
-
-        /**
-         * @return the {@link Pair.Weak} side of the pair of peers.
-         */
-        abstract Pair.Weak<?, ?> weakPair();
-    }
-}
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/package-info.java b/jdk/src/java.base/share/classes/java/lang/reflect/package-info.java
index c8cb025..e771f31 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/package-info.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,10 @@
 
 /**
  * Provides classes and interfaces for obtaining reflective information about
- * modules, classes and objects.  Reflection allows programmatic access to
- * information about modules and to the fields, methods and constructors of
- * loaded classes, and the use of reflected fields, methods, and constructors
- * to operate on their underlying counterparts, within encapsulation and
- * security restrictions.
+ * classes and objects.  Reflection allows programmatic access to information
+ * about the fields, methods and constructors of loaded classes, and the use
+ * of reflected fields, methods, and constructors to operate on their underlying
+ * counterparts, within encapsulation and security restrictions.
  *
  * <p>{@code AccessibleObject} allows suppression of access checks if
  * the necessary {@code ReflectPermission} is available.
@@ -45,5 +44,7 @@
  * members declared by a given class.
  *
  * @since 1.1
+ * @revised 9
+ * @spec JPMS
  */
 package java.lang.reflect;
diff --git a/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java b/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java
index 4945713..d441456 100644
--- a/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java
+++ b/jdk/src/java.base/share/classes/java/net/AbstractPlainDatagramSocketImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -275,6 +275,7 @@
         return (fd == null) ? true : false;
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         close();
     }
diff --git a/jdk/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java b/jdk/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java
index 465ec01..e66bbdc 100644
--- a/jdk/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java
+++ b/jdk/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -646,6 +646,7 @@
     /**
      * Cleans up if the user forgets to close it.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() throws IOException {
         close();
     }
diff --git a/jdk/src/java.base/share/classes/java/net/NetworkInterface.java b/jdk/src/java.base/share/classes/java/net/NetworkInterface.java
index 960024f..66141af 100644
--- a/jdk/src/java.base/share/classes/java/net/NetworkInterface.java
+++ b/jdk/src/java.base/share/classes/java/net/NetworkInterface.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -175,14 +175,16 @@
      */
     public java.util.List<InterfaceAddress> getInterfaceAddresses() {
         java.util.List<InterfaceAddress> lst = new java.util.ArrayList<>(1);
-        SecurityManager sec = System.getSecurityManager();
-        for (int j=0; j<bindings.length; j++) {
-            try {
-                if (sec != null) {
-                    sec.checkConnect(bindings[j].getAddress().getHostAddress(), -1);
-                }
-                lst.add(bindings[j]);
-            } catch (SecurityException e) { }
+        if (bindings != null) {
+            SecurityManager sec = System.getSecurityManager();
+            for (int j=0; j<bindings.length; j++) {
+                try {
+                    if (sec != null) {
+                        sec.checkConnect(bindings[j].getAddress().getHostAddress(), -1);
+                    }
+                    lst.add(bindings[j]);
+                } catch (SecurityException e) { }
+            }
         }
         return lst;
     }
diff --git a/jdk/src/java.base/share/classes/java/net/SocketInputStream.java b/jdk/src/java.base/share/classes/java/net/SocketInputStream.java
index 2f54d34..04ee337 100644
--- a/jdk/src/java.base/share/classes/java/net/SocketInputStream.java
+++ b/jdk/src/java.base/share/classes/java/net/SocketInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -283,6 +283,7 @@
     /**
      * Overrides finalize, the fd is closed by the Socket.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() {}
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/net/SocketOutputStream.java b/jdk/src/java.base/share/classes/java/net/SocketOutputStream.java
index 9cbe056..0ba877b 100644
--- a/jdk/src/java.base/share/classes/java/net/SocketOutputStream.java
+++ b/jdk/src/java.base/share/classes/java/net/SocketOutputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -175,6 +175,7 @@
     /**
      * Overrides finalize, the fd is closed by the Socket.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() {}
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/net/URL.java b/jdk/src/java.base/share/classes/java/net/URL.java
index b029b83..1ac1437 100644
--- a/jdk/src/java.base/share/classes/java/net/URL.java
+++ b/jdk/src/java.base/share/classes/java/net/URL.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,8 @@
 import java.util.ServiceConfigurationError;
 import java.util.ServiceLoader;
 
+import jdk.internal.misc.JavaNetURLAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.security.util.SecurityConstants;
 import sun.security.action.GetPropertyAction;
 
@@ -1614,6 +1616,17 @@
     private void setSerializedHashCode(int hc) {
         this.hashCode = hc;
     }
+
+    static {
+        SharedSecrets.setJavaNetURLAccess(
+                new JavaNetURLAccess() {
+                    @Override
+                    public URLStreamHandler getHandler(URL u) {
+                        return u.handler;
+                    }
+                }
+        );
+    }
 }
 
 final class UrlDeserializedState {
diff --git a/jdk/src/java.base/share/classes/java/net/URLClassLoader.java b/jdk/src/java.base/share/classes/java/net/URLClassLoader.java
index 2e52fe2..d6bd954 100644
--- a/jdk/src/java.base/share/classes/java/net/URLClassLoader.java
+++ b/jdk/src/java.base/share/classes/java/net/URLClassLoader.java
@@ -228,6 +228,7 @@
      *         allow creation of a class loader.
      *
      * @since 9
+     * @spec JPMS
      */
     public URLClassLoader(String name,
                           URL[] urls,
@@ -262,6 +263,7 @@
      *         creation of a class loader.
      *
      * @since 9
+     * @spec JPMS
      */
     public URLClassLoader(String name, URL[] urls, ClassLoader parent,
                           URLStreamHandlerFactory factory) {
@@ -558,6 +560,9 @@
      * @throws      IllegalArgumentException if the package name is
      *              already defined by this class loader
      * @return      the newly defined {@code Package} object
+     *
+     * @revised 9
+     * @spec JPMS
      */
     protected Package definePackage(String name, Manifest man, URL url) {
         String path = name.replace('.', '/').concat("/");
diff --git a/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java b/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java
index 838cc40..07aa7c6 100644
--- a/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java
+++ b/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java
@@ -213,7 +213,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public final MappedByteBuffer position(int newPosition) {
@@ -223,7 +222,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public final MappedByteBuffer limit(int newLimit) {
@@ -233,7 +231,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public final MappedByteBuffer mark() {
@@ -243,7 +240,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public final MappedByteBuffer reset() {
@@ -253,7 +249,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public final MappedByteBuffer clear() {
@@ -263,7 +258,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public final MappedByteBuffer flip() {
@@ -273,7 +267,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public final MappedByteBuffer rewind() {
diff --git a/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template b/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template
index 1292ca4..4453130 100644
--- a/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template
+++ b/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template
@@ -1069,7 +1069,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public
@@ -1083,7 +1082,6 @@
     
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public
@@ -1097,7 +1095,6 @@
     
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public 
@@ -1111,7 +1108,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public 
@@ -1125,7 +1121,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public 
@@ -1139,7 +1134,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public 
@@ -1153,7 +1147,6 @@
 
     /**
      * {@inheritDoc}
-     * @since 9
      */
     @Override
     public 
diff --git a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java
index 8120989..512045b 100644
--- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java
+++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java
@@ -300,9 +300,8 @@
      */
     private static void checkName(String s) {
         int n = s.length();
-        if (!atBugLevel("1.4")) {
-            if (n == 0)
-                throw new IllegalCharsetNameException(s);
+        if (n == 0 && !atBugLevel("1.4")) {
+            throw new IllegalCharsetNameException(s);
         }
         for (int i = 0; i < n; i++) {
             char c = s.charAt(i);
@@ -319,7 +318,9 @@
     }
 
     /* The standard set of charsets */
-    private static CharsetProvider standardProvider = new StandardCharsets();
+    private static final CharsetProvider standardProvider = new StandardCharsets();
+
+    private static final String[] zeroAliases = new String[0];
 
     // Cache of the most-recently-returned charsets,
     // along with the names that were used to find them
@@ -626,7 +627,6 @@
 
     private final String name;          // tickles a bug in oldjavac
     private final String[] aliases;     // tickles a bug in oldjavac
-    private final String[] zeroAliases = new String[0];
     private Set<String> aliasSet = null;
 
     /**
diff --git a/jdk/src/java.base/share/classes/java/nio/file/ClosedFileSystemException.java b/jdk/src/java.base/share/classes/java/nio/file/ClosedFileSystemException.java
index 82cf096..60d4551 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/ClosedFileSystemException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/ClosedFileSystemException.java
@@ -28,6 +28,8 @@
 /**
  * Unchecked exception thrown when an attempt is made to invoke an operation on
  * a file and the file system is closed.
+ *
+ * @since 1.7
  */
 
 public class ClosedFileSystemException
diff --git a/jdk/src/java.base/share/classes/java/nio/file/ClosedWatchServiceException.java b/jdk/src/java.base/share/classes/java/nio/file/ClosedWatchServiceException.java
index 3995b6d..4990a7a 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/ClosedWatchServiceException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/ClosedWatchServiceException.java
@@ -28,6 +28,8 @@
 /**
  * Unchecked exception thrown when an attempt is made to invoke an operation on
  * a watch service that is closed.
+ *
+ * @since 1.7
  */
 
 public class ClosedWatchServiceException
diff --git a/jdk/src/java.base/share/classes/java/nio/file/FileSystemAlreadyExistsException.java b/jdk/src/java.base/share/classes/java/nio/file/FileSystemAlreadyExistsException.java
index e305542..5877410 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/FileSystemAlreadyExistsException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystemAlreadyExistsException.java
@@ -28,6 +28,8 @@
 /**
  * Runtime exception thrown when an attempt is made to create a file system that
  * already exists.
+ *
+ * @since 1.7
  */
 
 public class FileSystemAlreadyExistsException
diff --git a/jdk/src/java.base/share/classes/java/nio/file/FileSystemNotFoundException.java b/jdk/src/java.base/share/classes/java/nio/file/FileSystemNotFoundException.java
index 1c0ee4c..e50eafb 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/FileSystemNotFoundException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/FileSystemNotFoundException.java
@@ -27,6 +27,8 @@
 
 /**
  * Runtime exception thrown when a file system cannot be found.
+ *
+ * @since 1.7
  */
 
 public class FileSystemNotFoundException
diff --git a/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java b/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java
index 0502d7b..2dc3597 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/InvalidPathException.java
@@ -29,6 +29,8 @@
  * Unchecked exception thrown when path string cannot be converted into a
  * {@link Path} because the path string contains invalid characters, or
  * the path string is invalid for other file system specific reasons.
+ *
+ * @since 1.7
  */
 
 public class InvalidPathException
diff --git a/jdk/src/java.base/share/classes/java/nio/file/ProviderMismatchException.java b/jdk/src/java.base/share/classes/java/nio/file/ProviderMismatchException.java
index 0220d6e..9e628cb 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/ProviderMismatchException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/ProviderMismatchException.java
@@ -29,6 +29,8 @@
  * Unchecked exception thrown when an attempt is made to invoke a method on an
  * object created by one file system provider with a parameter created by a
  * different file system provider.
+ *
+ * @since 1.7
  */
 public class ProviderMismatchException
     extends java.lang.IllegalArgumentException
diff --git a/jdk/src/java.base/share/classes/java/nio/file/ProviderNotFoundException.java b/jdk/src/java.base/share/classes/java/nio/file/ProviderNotFoundException.java
index 8fa0cef..41f9819 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/ProviderNotFoundException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/ProviderNotFoundException.java
@@ -27,6 +27,8 @@
 
 /**
  * Runtime exception thrown when a provider of the required type cannot be found.
+ *
+ * @since 1.7
  */
 
 public class ProviderNotFoundException
diff --git a/jdk/src/java.base/share/classes/java/nio/file/ReadOnlyFileSystemException.java b/jdk/src/java.base/share/classes/java/nio/file/ReadOnlyFileSystemException.java
index 9b25e5f..0b9d42a 100644
--- a/jdk/src/java.base/share/classes/java/nio/file/ReadOnlyFileSystemException.java
+++ b/jdk/src/java.base/share/classes/java/nio/file/ReadOnlyFileSystemException.java
@@ -28,6 +28,8 @@
 /**
  * Unchecked exception thrown when an attempt is made to update an object
  * associated with a {@link FileSystem#isReadOnly() read-only} {@code FileSystem}.
+ *
+ * @since 1.7
  */
 
 public class ReadOnlyFileSystemException
diff --git a/jdk/src/java.base/share/classes/java/security/DrbgParameters.java b/jdk/src/java.base/share/classes/java/security/DrbgParameters.java
index c71e1cf..b17cf07 100644
--- a/jdk/src/java.base/share/classes/java/security/DrbgParameters.java
+++ b/jdk/src/java.base/share/classes/java/security/DrbgParameters.java
@@ -53,8 +53,8 @@
  * for CTR_DRBG. Please note that it is not the algorithm used in
  * {@link SecureRandom#getInstance}, which we will call a
  * <em>SecureRandom algorithm</em> below),
- * <li> optionally features, including prediction resistance
- * and reseeding supports.
+ * <li> optional features, including prediction resistance
+ * and reseeding supports,
  * <li> highest security strength.
  * </ul>
  * <p>
diff --git a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
index ecb1278..1a9ac15 100644
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,7 @@
 import jdk.internal.misc.JavaSecurityProtectionDomainAccess;
 import static jdk.internal.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
 import jdk.internal.misc.SharedSecrets;
+import sun.security.action.GetPropertyAction;
 import sun.security.provider.PolicyFile;
 import sun.security.util.Debug;
 import sun.security.util.FilePermCompat;
@@ -62,6 +63,14 @@
 
 public class ProtectionDomain {
 
+    /**
+     * If true, {@link #impliesWithAltFilePerm} will try to be compatible on
+     * FilePermission checking even if a 3rd-party Policy implementation is set.
+     */
+    private static final boolean filePermCompatInPD =
+            "true".equals(GetPropertyAction.privilegedGetProperty(
+                "jdk.security.filePermCompat"));
+
     private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
 
         private JavaSecurityAccessImpl() {
@@ -321,19 +330,27 @@
     }
 
     /**
-     * This method has the same logic flow as {@link #implies} except that
-     * when the {@link FilePermCompat#compat} flag is on it ensures
-     * FilePermission compatibility after JDK-8164705. {@code implies()}
-     * is called when compat flag is not on or user has extended
-     * {@code ProtectionDomain}.
+     * This method has almost the same logic flow as {@link #implies} but
+     * it ensures some level of FilePermission compatibility after JDK-8164705.
      *
      * This method is called by {@link AccessControlContext#checkPermission}
      * and not intended to be called by an application.
      */
     boolean impliesWithAltFilePerm(Permission perm) {
 
-        // If this is a subclass of ProtectionDomain. Call the old method.
-        if (!FilePermCompat.compat || getClass() != ProtectionDomain.class) {
+        // If FilePermCompat.compat is set (default value), FilePermission
+        // checking compatibility should be considered.
+
+        // If filePermCompatInPD is set, this method checks for alternative
+        // FilePermission to keep compatibility for any Policy implementation.
+        // When set to false (default value), implies() is called since
+        // the PolicyFile implementation already supports compatibility.
+
+        // If this is a subclass of ProtectionDomain, call implies()
+        // because most likely user has overridden it.
+
+        if (!filePermCompatInPD || !FilePermCompat.compat ||
+                getClass() != ProtectionDomain.class) {
             return implies(perm);
         }
 
diff --git a/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java b/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java
index 8f84e103..4f0bfa4 100644
--- a/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java
+++ b/jdk/src/java.base/share/classes/java/security/SecureClassLoader.java
@@ -125,6 +125,7 @@
      *         doesn't allow creation of a class loader.
      *
      * @since 9
+     * @spec JPMS
      */
     protected SecureClassLoader(String name, ClassLoader parent) {
         super(name, parent);
diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandom.java b/jdk/src/java.base/share/classes/java/security/SecureRandom.java
index ac4ee6e..4f9f1b3 100644
--- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
  *
  * <p>A cryptographically strong random number minimally complies with the
  * statistical random number generator tests specified in
- * <a href="http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf">
+ * <a href="http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.140-2.pdf">
  * <i>FIPS 140-2, Security Requirements for Cryptographic Modules</i></a>,
  * section 4.9.1.
  * Additionally, {@code SecureRandom} must produce non-deterministic output.
@@ -64,8 +64,8 @@
  * <blockquote><pre>
  * SecureRandom r1 = new SecureRandom();
  * SecureRandom r2 = SecureRandom.getInstance("NativePRNG");
- * SecureRandom r3 = SecureRandom("DRBG",
- *         DrbgParameters.Instantiation(128, RESEED_ONLY, null));</pre>
+ * SecureRandom r3 = SecureRandom.getInstance("DRBG",
+ *         DrbgParameters.instantiation(128, RESEED_ONLY, null));</pre>
  * </blockquote>
  *
  * <p> The third statement above returns a {@code SecureRandom} object of the
@@ -651,8 +651,6 @@
      * {@code SecureRandom}.
      *
      * @return the string representation
-     *
-     * @since 9
      */
     @Override
     public String toString() {
diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java b/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java
index 65a0ce0..fefbe57 100644
--- a/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java
@@ -211,8 +211,6 @@
      * {@code SecureRandom}.
      *
      * @return the string representation
-     *
-     * @since 9
      */
     @Override
     public String toString() {
diff --git a/jdk/src/java.base/share/classes/java/security/Security.java b/jdk/src/java.base/share/classes/java/security/Security.java
index 49b7e99..1076b1d 100644
--- a/jdk/src/java.base/share/classes/java/security/Security.java
+++ b/jdk/src/java.base/share/classes/java/security/Security.java
@@ -25,11 +25,12 @@
 
 package java.security;
 
-import java.lang.reflect.*;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.io.*;
 import java.net.URL;
+
+import jdk.internal.misc.SharedSecrets;
 import sun.security.util.Debug;
 import sun.security.util.PropertyExpander;
 
@@ -800,9 +801,6 @@
      * "package.definition", we need to signal to the SecurityManager
      * class that the value has just changed, and that it should
      * invalidate it's local cache values.
-     *
-     * Rather than create a new API entry for this function,
-     * we use reflection to set a private variable.
      */
     private static void invalidateSMCache(String key) {
 
@@ -810,42 +808,8 @@
         final boolean pd = key.equals("package.definition");
 
         if (pa || pd) {
-            AccessController.doPrivileged(new PrivilegedAction<>() {
-                public Void run() {
-                    try {
-                        /* Get the class via the bootstrap class loader. */
-                        Class<?> cl = Class.forName(
-                            "java.lang.SecurityManager", false, null);
-                        Field f = null;
-                        boolean accessible = false;
-
-                        if (pa) {
-                            f = cl.getDeclaredField("packageAccessValid");
-                            accessible = f.isAccessible();
-                            f.setAccessible(true);
-                        } else {
-                            f = cl.getDeclaredField("packageDefinitionValid");
-                            accessible = f.isAccessible();
-                            f.setAccessible(true);
-                        }
-                        f.setBoolean(f, false);
-                        f.setAccessible(accessible);
-                    }
-                    catch (Exception e1) {
-                        /* If we couldn't get the class, it hasn't
-                         * been loaded yet.  If there is no such
-                         * field, we shouldn't try to set it.  There
-                         * shouldn't be a security execption, as we
-                         * are loaded by boot class loader, and we
-                         * are inside a doPrivileged() here.
-                         *
-                         * NOOP: don't do anything...
-                         */
-                    }
-                    return null;
-                }  /* run */
-            });  /* PrivilegedAction */
-        }  /* if */
+            SharedSecrets.getJavaLangAccess().invalidatePackageAccessCache();
+        }
     }
 
     private static void check(String directive) {
diff --git a/jdk/src/java.base/share/classes/java/time/Duration.java b/jdk/src/java.base/share/classes/java/time/Duration.java
index cacd399..875b9e0 100644
--- a/jdk/src/java.base/share/classes/java/time/Duration.java
+++ b/jdk/src/java.base/share/classes/java/time/Duration.java
@@ -1370,6 +1370,7 @@
      * @return a {@code Duration} based on this duration with the time truncated, not null
      * @throws DateTimeException if the unit is invalid for truncation
      * @throws UnsupportedTemporalTypeException if the unit is not supported
+     * @since 9
      */
     public Duration truncatedTo(TemporalUnit unit) {
         Objects.requireNonNull(unit, "unit");
diff --git a/jdk/src/java.base/share/classes/java/time/chrono/Era.java b/jdk/src/java.base/share/classes/java/time/chrono/Era.java
index f8945fa..5cf0968 100644
--- a/jdk/src/java.base/share/classes/java/time/chrono/Era.java
+++ b/jdk/src/java.base/share/classes/java/time/chrono/Era.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -310,8 +310,8 @@
      * The parameters control the style of the returned text and the locale.
      * <p>
      * If no textual mapping is found then the {@link #getValue() numeric value} is returned.
-     * <p>
-     * This default implementation is suitable for all implementations.
+     *
+     * @apiNote This default implementation is suitable for most implementations.
      *
      * @param style  the style of the text required, not null
      * @param locale  the locale to use, not null
diff --git a/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java b/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java
index 7ae6294..e6fadc9 100644
--- a/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java
+++ b/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -240,19 +240,10 @@
     }
 
     /**
-     * Gets the textual representation of this era.
-     * <p>
-     * This returns the textual name used to identify the era,
-     * suitable for presentation to the user.
-     * The parameters control the style of the returned text and the locale.
-     * <p>
-     * If no textual mapping is found then the {@link #getValue() numeric value}
-     * is returned.
+     * {@inheritDoc}
      *
-     * @param style  the style of the text required, not null
-     * @param locale  the locale to use, not null
-     * @return the text value of the era, not null
-     * @since 9
+     * @param style {@inheritDoc}
+     * @param locale {@inheritDoc}
      */
     @Override
     public String getDisplayName(TextStyle style, Locale locale) {
diff --git a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
index 8fe990a..f734fdd 100644
--- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
+++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
@@ -1278,6 +1278,7 @@
      *
      * @param textStyle  the text style to use, not null
      * @return this, for chaining, not null
+     * @since 9
      */
     public DateTimeFormatterBuilder appendGenericZoneText(TextStyle textStyle) {
         appendInternal(new ZoneTextPrinterParser(textStyle, null, true));
@@ -1303,6 +1304,7 @@
      * @param textStyle  the text style to use, not null
      * @param preferredZones  the set of preferred zone ids, not null
      * @return this, for chaining, not null
+     * @since 9
      */
     public DateTimeFormatterBuilder appendGenericZoneText(TextStyle textStyle,
                                                           Set<ZoneId> preferredZones) {
diff --git a/jdk/src/java.base/share/classes/java/util/Comparator.java b/jdk/src/java.base/share/classes/java/util/Comparator.java
index ade582d..85f25be 100644
--- a/jdk/src/java.base/share/classes/java/util/Comparator.java
+++ b/jdk/src/java.base/share/classes/java/util/Comparator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -112,12 +112,6 @@
      * zero, or a positive integer as the first argument is less than, equal
      * to, or greater than the second.<p>
      *
-     * In the foregoing description, the notation
-     * {@code sgn(}<i>expression</i>{@code )} designates the mathematical
-     * <i>signum</i> function, which is defined to return one of {@code -1},
-     * {@code 0}, or {@code 1} according to whether the value of
-     * <i>expression</i> is negative, zero or positive.<p>
-     *
      * The implementor must ensure that {@code sgn(compare(x, y)) ==
      * -sgn(compare(y, x))} for all {@code x} and {@code y}.  (This
      * implies that {@code compare(x, y)} must throw an exception if and only
@@ -135,7 +129,13 @@
      * {@code (compare(x, y)==0) == (x.equals(y))}.  Generally speaking,
      * any comparator that violates this condition should clearly indicate
      * this fact.  The recommended language is "Note: this comparator
-     * imposes orderings that are inconsistent with equals."
+     * imposes orderings that are inconsistent with equals."<p>
+     *
+     * In the foregoing description, the notation
+     * {@code sgn(}<i>expression</i>{@code )} designates the mathematical
+     * <i>signum</i> function, which is defined to return one of {@code -1},
+     * {@code 0}, or {@code 1} according to whether the value of
+     * <i>expression</i> is negative, zero, or positive, respectively.
      *
      * @param o1 the first object to be compared.
      * @param o2 the second object to be compared.
diff --git a/jdk/src/java.base/share/classes/java/util/Date.java b/jdk/src/java.base/share/classes/java/util/Date.java
index 312a74b..8b6a634 100644
--- a/jdk/src/java.base/share/classes/java/util/Date.java
+++ b/jdk/src/java.base/share/classes/java/util/Date.java
@@ -728,7 +728,6 @@
      * @see     java.util.Calendar
      * @deprecated As of JDK version 1.1,
      * replaced by {@code Calendar.get(Calendar.DAY_OF_MONTH)}.
-     * @deprecated
      */
     @Deprecated
     public int getDate() {
diff --git a/jdk/src/java.base/share/classes/java/util/Iterator.java b/jdk/src/java.base/share/classes/java/util/Iterator.java
index 7dcb155..a5d8929 100644
--- a/jdk/src/java.base/share/classes/java/util/Iterator.java
+++ b/jdk/src/java.base/share/classes/java/util/Iterator.java
@@ -109,7 +109,8 @@
      * Exceptions thrown by the action are relayed to the caller.
      * <p>
      * The behavior of an iterator is unspecified if the action modifies the
-     * collection in any way (even by calling the {@link #remove remove} method),
+     * collection in any way (even by calling the {@link #remove remove} method
+     * or other mutator methods of {@code Iterator} subtypes),
      * unless an overriding class has specified a concurrent modification policy.
      * <p>
      * Subsequent behavior of an iterator is unspecified if the action throws an
diff --git a/jdk/src/java.base/share/classes/java/util/Objects.java b/jdk/src/java.base/share/classes/java/util/Objects.java
index dad583b..c6bf3c9 100644
--- a/jdk/src/java.base/share/classes/java/util/Objects.java
+++ b/jdk/src/java.base/share/classes/java/util/Objects.java
@@ -343,7 +343,8 @@
      */
     public static <T> T requireNonNull(T obj, Supplier<String> messageSupplier) {
         if (obj == null)
-            throw new NullPointerException(messageSupplier.get());
+            throw new NullPointerException(messageSupplier == null ?
+                                           null : messageSupplier.get());
         return obj;
     }
 
diff --git a/jdk/src/java.base/share/classes/java/util/Observable.java b/jdk/src/java.base/share/classes/java/util/Observable.java
index b19830b..d71bf5d 100644
--- a/jdk/src/java.base/share/classes/java/util/Observable.java
+++ b/jdk/src/java.base/share/classes/java/util/Observable.java
@@ -69,6 +69,8 @@
  * {@link java.beans} package.  For reliable and ordered
  * messaging among threads, consider using one of the concurrent data
  * structures in the {@link java.util.concurrent} package.
+ * For reactive streams style programming, see the
+ * {@link java.util.concurrent.Flow} API.
  */
 @Deprecated(since="9")
 public class Observable {
diff --git a/jdk/src/java.base/share/classes/java/util/Properties.java b/jdk/src/java.base/share/classes/java/util/Properties.java
index 85e294d..19682c1 100644
--- a/jdk/src/java.base/share/classes/java/util/Properties.java
+++ b/jdk/src/java.base/share/classes/java/util/Properties.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -471,7 +471,7 @@
                 if (inStream != null) {
                     //The line below is equivalent to calling a
                     //ISO8859-1 decoder.
-                    c = (char) (0xff & inByteBuf[inOff++]);
+                    c = (char)(inByteBuf[inOff++] & 0xFF);
                 } else {
                     c = inCharBuf[inOff++];
                 }
@@ -494,8 +494,25 @@
                 if (isNewLine) {
                     isNewLine = false;
                     if (c == '#' || c == '!') {
+                        // Comment, quickly consume the rest of the line,
+                        // resume on line-break and backslash.
+                        if (inStream != null) {
+                            while (inOff < inLimit) {
+                                byte b = inByteBuf[inOff++];
+                                if (b == '\n' || b == '\r' || b == '\\') {
+                                    c = (char)(b & 0xFF);
+                                    break;
+                                }
+                            }
+                        } else {
+                            while (inOff < inLimit) {
+                                c = inCharBuf[inOff++];
+                                if (c == '\n' || c == '\r' || c == '\\') {
+                                    break;
+                                }
+                            }
+                        }
                         isCommentLine = true;
-                        continue;
                     }
                 }
 
diff --git a/jdk/src/java.base/share/classes/java/util/ResourceBundle.java b/jdk/src/java.base/share/classes/java/util/ResourceBundle.java
index 600b181..c258884 100644
--- a/jdk/src/java.base/share/classes/java/util/ResourceBundle.java
+++ b/jdk/src/java.base/share/classes/java/util/ResourceBundle.java
@@ -50,7 +50,6 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.net.JarURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
@@ -350,6 +349,8 @@
  * @see MissingResourceException
  * @see ResourceBundleProvider
  * @since 1.1
+ * @revised 9
+ * @spec JPMS
  */
 public abstract class ResourceBundle {
 
@@ -870,6 +871,8 @@
      * @throws UnsupportedOperationException
      *         if this method is called in a named module
      * @since 1.6
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static final ResourceBundle getBundle(String baseName,
@@ -938,6 +941,7 @@
      *         specified module
      * @return a resource bundle for the given base name and the default locale
      * @since 9
+     * @spec JPMS
      * @see ResourceBundleProvider
      */
     @CallerSensitive
@@ -991,6 +995,7 @@
      *         be found in the specified {@code module}
      * @return a resource bundle for the given base name and locale in the module
      * @since 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static ResourceBundle getBundle(String baseName, Locale targetLocale, Module module) {
@@ -1036,6 +1041,8 @@
      * @throws UnsupportedOperationException
      *         if this method is called in a named module
      * @since 1.6
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static final ResourceBundle getBundle(String baseName, Locale targetLocale,
@@ -1243,6 +1250,8 @@
      * @exception MissingResourceException
      *        if no resource bundle for the specified base name can be found
      * @since 1.2
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static ResourceBundle getBundle(String baseName, Locale locale,
@@ -1465,6 +1474,8 @@
      * @throws UnsupportedOperationException
      *         if this method is called in a named module
      * @since 1.6
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static ResourceBundle getBundle(String baseName, Locale targetLocale,
@@ -1824,7 +1835,7 @@
                         cacheKey.setFormat(format);
                         break;
                     }
-                } catch (Exception e) {
+                } catch (LinkageError|Exception e) {
                     cacheKey.setCause(e);
                 }
             }
@@ -2194,6 +2205,8 @@
      * by the caller's module.
      *
      * @since 1.6
+     * @revised 9
+     * @spec JPMS
      * @see ResourceBundle.Control#getTimeToLive(String,Locale)
      */
     @CallerSensitive
@@ -2475,6 +2488,8 @@
      * of {@link ResourceBundleControlProvider} are ignored in named modules.
      *
      * @since 1.6
+     * @revised 9
+     * @spec JPMS
      * @see java.util.spi.ResourceBundleProvider
      */
     public static class Control {
@@ -3103,6 +3118,8 @@
          *        if an error occurred when reading resources using
          *        any I/O operations
          * @see java.util.spi.ResourceBundleProvider#getBundle(String, Locale)
+         * @revised 9
+         * @spec JPMS
          */
         public ResourceBundle newBundle(String baseName, Locale locale, String format,
                                         ClassLoader loader, boolean reload)
diff --git a/jdk/src/java.base/share/classes/java/util/ServiceLoader.java b/jdk/src/java.base/share/classes/java/util/ServiceLoader.java
index 0b437d4..db4ff4e 100644
--- a/jdk/src/java.base/share/classes/java/util/ServiceLoader.java
+++ b/jdk/src/java.base/share/classes/java/util/ServiceLoader.java
@@ -31,10 +31,8 @@
 import java.io.InputStreamReader;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.net.URL;
 import java.net.URLConnection;
 import java.security.AccessControlContext;
@@ -48,8 +46,8 @@
 import java.util.stream.StreamSupport;
 
 import jdk.internal.loader.BootLoader;
+import jdk.internal.loader.ClassLoaders;
 import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.JavaLangReflectModuleAccess;
 import jdk.internal.misc.SharedSecrets;
 import jdk.internal.misc.VM;
 import jdk.internal.module.ServicesCatalog;
@@ -119,7 +117,7 @@
  * and deployed as an explicit module must have an appropriate <i>uses</i>
  * clause in its <i>module descriptor</i> to declare that the module uses
  * implementations of the service. A corresponding requirement is that a
- * provider deployed as a named module must have an appropriate
+ * provider deployed as an explicit module must have an appropriate
  * <i>provides</i> clause in its module descriptor to declare that the module
  * provides an implementation of the service. The <i>uses</i> and
  * <i>provides</i> allow consumers of a service to be <i>linked</i> to modules
@@ -159,7 +157,7 @@
  * <h2> Locating providers </h2>
  *
  * <p> The {@code load} methods locate providers using a class loader or module
- * {@link Layer layer}. When locating providers using a class loader then
+ * {@link ModuleLayer layer}. When locating providers using a class loader then
  * providers in both named and unnamed modules may be located. When locating
  * providers using a module layer then only providers in named modules in
  * the layer (or parent layers) are located.
@@ -167,11 +165,11 @@
  * <p> When locating providers using a class loader then any providers in named
  * modules defined to the class loader, or any class loader that is reachable
  * via parent delegation, are located. Additionally, providers in module layers
- * other than the {@link Layer#boot() boot} layer, where the module layer
+ * other than the {@link ModuleLayer#boot() boot} layer, where the module layer
  * contains modules defined to the class loader, or any class loader reachable
  * via parent delegation, are also located. For example, suppose there is a
  * module layer where each module is defined to its own class loader (see {@link
- * Layer#defineModulesWithManyLoaders defineModulesWithManyLoaders}). If the
+ * ModuleLayer#defineModulesWithManyLoaders defineModulesWithManyLoaders}). If the
  * {@code load} method is invoked to locate providers using any of these class
  * loaders for this layer then it will locate all of the providers in that
  * layer, irrespective of their defining class loader.
@@ -197,14 +195,17 @@
  *     will locate providers in modules defined to the class loader, then its
  *     parent class loader, its parent parent, and so on to the bootstrap class
  *     loader. If a {@code ClassLoader}, or any class loader in the parent
- *     delegation chain, defines modules in a custom module {@link Layer} then
+ *     delegation chain, defines modules in a custom module {@link ModuleLayer} then
  *     all providers in that layer are located, irrespective of their class
  *     loader. The ordering of modules defined to the same class loader, or the
  *     ordering of modules in a layer, is not defined. </li>
  *
  *     <li> If a named module declares more than one provider then the providers
- *     are located in the order that they appear in the {@code provides} table of
- *     the {@code Module} class file attribute ({@code module-info.class}). </li>
+ *     are located in the iteration order of the {@link
+ *     java.lang.module.ModuleDescriptor.Provides#providers() providers} list.
+ *     Providers added dynamically by instrumentation agents ({@link
+ *     java.lang.instrument.Instrumentation#redefineModule redefineModule})
+ *     are always located after providers declared by the module. </li>
  *
  *     <li> When locating providers in unnamed modules then the ordering is
  *     based on the order that the class loader's {@link
@@ -212,11 +213,11 @@
  *     method finds the service configuration files. </li>
  * </ul>
  *
- * <p> Service loaders created to locate providers in a module {@link Layer}
- * will first locate providers in the layer, before locating providers in
- * parent layers. Traversal of parent layers is depth-first with each layer
- * visited at most once. For example, suppose L0 is the boot layer, L1 and
- * L2 are custom layers with L0 as their parent. Now suppose that L3 is
+ * <p> Service loaders created to locate providers in a {@linkplain ModuleLayer
+ * module layer} will first locate providers in the layer, before locating
+ * providers in parent layers. Traversal of parent layers is depth-first with
+ * each layer visited at most once. For example, suppose L0 is the boot layer,
+ * L1 and L2 are custom layers with L0 as their parent. Now suppose that L3 is
  * created with L1 and L2 as the parents (in that order). Using a service
  * loader to locate providers with L3 as the content will locate providers
  * in the following order: L3, L1, L0, L2. The ordering of modules in a layer
@@ -335,6 +336,8 @@
  *
  * @author Mark Reinhold
  * @since 1.6
+ * @revised 9
+ * @spec JPMS
  */
 
 public final class ServiceLoader<S>
@@ -346,12 +349,12 @@
     // The class of the service type
     private final String serviceName;
 
-    // The module Layer used to locate providers; null when locating
+    // The module layer used to locate providers; null when locating
     // providers using a class loader
-    private final Layer layer;
+    private final ModuleLayer layer;
 
     // The class loader used to locate, load, and instantiate providers;
-    // null when locating provider using a module Layer
+    // null when locating provider using a module layer
     private final ClassLoader loader;
 
     // The access control context taken when the ServiceLoader is created
@@ -370,10 +373,8 @@
     private int reloadCount;
 
     private static JavaLangAccess LANG_ACCESS;
-    private static JavaLangReflectModuleAccess JLRM_ACCESS;
     static {
         LANG_ACCESS = SharedSecrets.getJavaLangAccess();
-        JLRM_ACCESS = SharedSecrets.getJavaLangReflectModuleAccess();
     }
 
     /**
@@ -386,6 +387,7 @@
      *
      * @param  <S> The service type
      * @since 9
+     * @spec JPMS
      */
     public static interface Provider<S> extends Supplier<S> {
         /**
@@ -418,13 +420,13 @@
 
     /**
      * Initializes a new instance of this class for locating service providers
-     * in a module Layer.
+     * in a module layer.
      *
      * @throws ServiceConfigurationError
      *         If {@code svc} is not accessible to {@code caller} or the caller
      *         module does not use the service type.
      */
-    private ServiceLoader(Class<?> caller, Layer layer, Class<S> svc) {
+    private ServiceLoader(Class<?> caller, ModuleLayer layer, Class<S> svc) {
         Objects.requireNonNull(caller);
         Objects.requireNonNull(layer);
         Objects.requireNonNull(svc);
@@ -505,12 +507,15 @@
 
     /**
      * Checks that the given service type is accessible to types in the given
-     * module, and check that the module declare that it uses the service type. ??
+     * module, and check that the module declares that it uses the service type.
      */
     private static void checkCaller(Class<?> caller, Class<?> svc) {
-        Module callerModule = caller.getModule();
+        if (caller == null) {
+            fail(svc, "no caller to check if it declares `uses`");
+        }
 
         // Check access to the service type
+        Module callerModule = caller.getModule();
         int mods = svc.getModifiers();
         if (!Reflection.verifyMemberAccess(caller, svc, null, mods)) {
             fail(svc, "service type not accessible to " + callerModule);
@@ -819,13 +824,13 @@
 
     /**
      * Implements lazy service provider lookup of service providers that
-     * are provided by modules in a module Layer (or parent layers)
+     * are provided by modules in a module layer (or parent layers)
      */
     private final class LayerLookupIterator<T>
         implements Iterator<Provider<T>>
     {
-        Deque<Layer> stack = new ArrayDeque<>();
-        Set<Layer> visited = new HashSet<>();
+        Deque<ModuleLayer> stack = new ArrayDeque<>();
+        Set<ModuleLayer> visited = new HashSet<>();
         Iterator<ServiceProvider> iterator;
         ServiceProvider next;  // next provider to load
 
@@ -834,8 +839,8 @@
             stack.push(layer);
         }
 
-        private Iterator<ServiceProvider> providers(Layer layer) {
-            ServicesCatalog catalog = JLRM_ACCESS.getServicesCatalog(layer);
+        private Iterator<ServiceProvider> providers(ModuleLayer layer) {
+            ServicesCatalog catalog = LANG_ACCESS.getServicesCatalog(layer);
             return catalog.findServices(serviceName).iterator();
         }
 
@@ -857,10 +862,10 @@
                 if (stack.isEmpty())
                     return false;
 
-                Layer layer = stack.pop();
-                List<Layer> parents = layer.parents();
+                ModuleLayer layer = stack.pop();
+                List<ModuleLayer> parents = layer.parents();
                 for (int i = parents.size() - 1; i >= 0; i--) {
-                    Layer parent = parents.get(i);
+                    ModuleLayer parent = parents.get(i);
                     if (!visited.contains(parent)) {
                         visited.add(parent);
                         stack.push(parent);
@@ -908,8 +913,8 @@
          * Returns iterator to iterate over the implementations of {@code
          * service} in the given layer.
          */
-        private List<ServiceProvider> providers(Layer layer) {
-            ServicesCatalog catalog = JLRM_ACCESS.getServicesCatalog(layer);
+        private List<ServiceProvider> providers(ModuleLayer layer) {
+            ServicesCatalog catalog = LANG_ACCESS.getServicesCatalog(layer);
             return catalog.findServices(serviceName);
         }
 
@@ -927,26 +932,28 @@
             } else {
                 catalog = ServicesCatalog.getServicesCatalogOrNull(loader);
             }
-            Stream<ServiceProvider> stream1;
+            List<ServiceProvider> providers;
             if (catalog == null) {
-                stream1 = Stream.empty();
+                providers = List.of();
             } else {
-                stream1 = catalog.findServices(serviceName).stream();
+                providers = catalog.findServices(serviceName);
             }
 
             // modules in custom layers that define modules to the class loader
-            Stream<ServiceProvider> stream2;
             if (loader == null) {
-                stream2 = Stream.empty();
+                return providers.iterator();
             } else {
-                Layer bootLayer = Layer.boot();
-                stream2 = JLRM_ACCESS.layers(loader)
-                        .filter(l -> (l != bootLayer))
-                        .map(l -> providers(l))
-                        .flatMap(List::stream);
+                List<ServiceProvider> allProviders = new ArrayList<>(providers);
+                ModuleLayer bootLayer = ModuleLayer.boot();
+                Iterator<ModuleLayer> iterator = LANG_ACCESS.layers(loader).iterator();
+                while (iterator.hasNext()) {
+                    ModuleLayer layer = iterator.next();
+                    if (layer != bootLayer) {
+                        allProviders.addAll(providers(layer));
+                    }
+                }
+                return allProviders.iterator();
             }
-
-            return Stream.concat(stream1, stream2).iterator();
         }
 
         @Override
@@ -998,6 +1005,7 @@
     {
         static final String PREFIX = "META-INF/services/";
 
+        Set<String> providerNames = new HashSet<>();  // to avoid duplicates
         Enumeration<URL> configs;
         Iterator<String> pending;
         Class<?> nextClass;
@@ -1007,7 +1015,7 @@
 
         /**
          * Parse a single line from the given configuration file, adding the
-         * name on the line to the names list.
+         * name on the line to set of names if not already seen.
          */
         private int parseLine(URL u, BufferedReader r, int lc, Set<String> names)
             throws IOException
@@ -1032,7 +1040,9 @@
                     if (!Character.isJavaIdentifierPart(cp) && (cp != '.'))
                         fail(service, u, lc, "Illegal provider-class name: " + ln);
                 }
-                names.add(ln);
+                if (providerNames.add(ln)) {
+                    names.add(ln);
+                }
             }
             return lc + 1;
         }
@@ -1063,15 +1073,24 @@
                 return true;
             }
 
-            Class<?> clazz = null;
+            Class<?> clazz;
             do {
                 if (configs == null) {
                     try {
                         String fullName = PREFIX + service.getName();
-                        if (loader == null)
+                        if (loader == null) {
                             configs = ClassLoader.getSystemResources(fullName);
-                        else
+                        } else if (loader == ClassLoaders.platformClassLoader()) {
+                            // The platform classloader doesn't have a class path,
+                            // but the boot loader might.
+                            if (BootLoader.hasClassPath()) {
+                                configs = BootLoader.findResources(fullName);
+                            } else {
+                                configs = Collections.emptyEnumeration();
+                            }
+                        } else {
                             configs = loader.getResources(fullName);
+                        }
                     } catch (IOException x) {
                         fail(service, "Error locating configuration files", x);
                     }
@@ -1214,6 +1233,9 @@
      *
      * @return  An iterator that lazily loads providers for this loader's
      *          service
+     *
+     * @revised 9
+     * @spec JPMS
      */
     public Iterator<S> iterator() {
 
@@ -1279,8 +1301,10 @@
      * provider to be loaded. </p>
      *
      * <p> If this loader's provider caches are cleared by invoking the {@link
-     * #reload() reload} method then existing streams for this service
-     * loader should be discarded. </p>
+     * #reload() reload} method then existing streams for this service loader
+     * should be discarded. The returned stream's source {@code Spliterator} is
+     * <em>fail-fast</em> and will throw {@link ConcurrentModificationException}
+     * if the provider cache has been cleared. </p>
      *
      * <p> The following examples demonstrate usage. The first example
      * creates a stream of providers, the second example is the same except
@@ -1300,6 +1324,7 @@
      * @return  A stream that lazily loads providers for this loader's service
      *
      * @since 9
+     * @spec JPMS
      */
     public Stream<Provider<S>> stream() {
         // use cached providers as the source when all providers loaded
@@ -1414,6 +1439,9 @@
      *         if the service type is not accessible to the caller or the
      *         caller is in an explicit module and its module descriptor does
      *         not declare that it uses {@code service}
+     *
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static <S> ServiceLoader<S> load(Class<S> service,
@@ -1457,6 +1485,9 @@
      *         if the service type is not accessible to the caller or the
      *         caller is in an explicit module and its module descriptor does
      *         not declare that it uses {@code service}
+     *
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static <S> ServiceLoader<S> load(Class<S> service) {
@@ -1490,6 +1521,9 @@
      *         if the service type is not accessible to the caller or the
      *         caller is in an explicit module and its module descriptor does
      *         not declare that it uses {@code service}
+     *
+     * @revised 9
+     * @spec JPMS
      */
     @CallerSensitive
     public static <S> ServiceLoader<S> loadInstalled(Class<S> service) {
@@ -1499,7 +1533,7 @@
 
     /**
      * Creates a new service loader for the given service type that loads
-     * service providers from modules in the given {@code Layer} and its
+     * service providers from modules in the given {@code ModuleLayer} and its
      * ancestors.
      *
      * @apiNote Unlike the other load methods defined here, the service type
@@ -1509,7 +1543,7 @@
      * @param  <S> the class of the service type
      *
      * @param  layer
-     *         The module Layer
+     *         The module layer
      *
      * @param  service
      *         The interface or abstract class representing the service
@@ -1522,9 +1556,10 @@
      *         not declare that it uses {@code service}
      *
      * @since 9
+     * @spec JPMS
      */
     @CallerSensitive
-    public static <S> ServiceLoader<S> load(Layer layer, Class<S> service) {
+    public static <S> ServiceLoader<S> load(ModuleLayer layer, Class<S> service) {
         return new ServiceLoader<>(Reflection.getCallerClass(), layer, service);
     }
 
@@ -1551,6 +1586,7 @@
      *         or error is thrown when locating or instantiating the provider.
      *
      * @since 9
+     * @spec JPMS
      */
     public Optional<S> findFirst() {
         Iterator<S> iterator = iterator();
diff --git a/jdk/src/java.base/share/classes/java/util/SplittableRandom.java b/jdk/src/java.base/share/classes/java/util/SplittableRandom.java
index 1a6653d..f852e1d 100644
--- a/jdk/src/java.base/share/classes/java/util/SplittableRandom.java
+++ b/jdk/src/java.base/share/classes/java/util/SplittableRandom.java
@@ -779,8 +779,7 @@
      * @return a stream of pseudorandom {@code double} values,
      *         each with the given origin (inclusive) and bound (exclusive)
      * @throws IllegalArgumentException if {@code streamSize} is
-     *         less than zero
-     * @throws IllegalArgumentException if {@code randomNumberOrigin}
+     *         less than zero, or {@code randomNumberOrigin}
      *         is greater than or equal to {@code randomNumberBound}
      */
     public DoubleStream doubles(long streamSize, double randomNumberOrigin,
diff --git a/jdk/src/java.base/share/classes/java/util/Timer.java b/jdk/src/java.base/share/classes/java/util/Timer.java
index 770d9f9..7c47d0c 100644
--- a/jdk/src/java.base/share/classes/java/util/Timer.java
+++ b/jdk/src/java.base/share/classes/java/util/Timer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -108,6 +108,7 @@
      * finalizer forgetting to call it.
      */
     private final Object threadReaper = new Object() {
+        @SuppressWarnings("deprecation")
         protected void finalize() throws Throwable {
             synchronized(queue) {
                 thread.newTasksMayBeScheduled = false;
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java b/jdk/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java
index 6af7c7a..4e73c08 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java
@@ -1226,6 +1226,7 @@
                 } else {
                     nextIndex = NONE;
                     nextItem = null;
+                    if (lastRet == REMOVED) detach();
                 }
             } finally {
                 lock.unlock();
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/Executors.java b/jdk/src/java.base/share/classes/java/util/concurrent/Executors.java
index a31e3a1..00fdf25 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/Executors.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/Executors.java
@@ -713,6 +713,7 @@
         FinalizableDelegatedExecutorService(ExecutorService executor) {
             super(executor);
         }
+        @SuppressWarnings("deprecation")
         protected void finalize() {
             super.shutdown();
         }
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java b/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java
index 9b53a8a..65e9943 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/Flow.java
@@ -271,11 +271,11 @@
         /**
          * Adds the given number {@code n} of items to the current
          * unfulfilled demand for this subscription.  If {@code n} is
-         * negative, the Subscriber will receive an {@code onError}
-         * signal with an {@link IllegalArgumentException} argument.
-         * Otherwise, the Subscriber will receive up to {@code n}
-         * additional {@code onNext} invocations (or fewer if
-         * terminated).
+         * less than or equal to zero, the Subscriber will receive an
+         * {@code onError} signal with an {@link
+         * IllegalArgumentException} argument.  Otherwise, the
+         * Subscriber will receive up to {@code n} additional {@code
+         * onNext} invocations (or fewer if terminated).
          *
          * @param n the increment of demand; a value of {@code
          * Long.MAX_VALUE} may be considered as effectively unbounded
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java b/jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java
index 28e98a3..fafc11b 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java
@@ -588,6 +588,7 @@
         if (!closed) {
             BufferedSubscription<T> b;
             synchronized (this) {
+                // no need to re-check closed here
                 b = clients;
                 clients = null;
                 closed = true;
@@ -619,9 +620,11 @@
             BufferedSubscription<T> b;
             synchronized (this) {
                 b = clients;
-                clients = null;
-                closed = true;
-                closedException = error;
+                if (!closed) {  // don't clobber racing close
+                    clients = null;
+                    closedException = error;
+                    closed = true;
+                }
             }
             while (b != null) {
                 BufferedSubscription<T> next = b.next;
@@ -1362,9 +1365,9 @@
                     }
                 }
             }
-            else if (n < 0L)
+            else
                 onError(new IllegalArgumentException(
-                            "negative subscription request"));
+                            "non-positive subscription request"));
         }
 
         public final boolean isReleasable() { // for ManagedBlocker
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java b/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java
index cfc676a..22c1f9a 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java
@@ -699,8 +699,7 @@
      * @return a stream of pseudorandom {@code double} values,
      *         each with the given origin (inclusive) and bound (exclusive)
      * @throws IllegalArgumentException if {@code streamSize} is
-     *         less than zero
-     * @throws IllegalArgumentException if {@code randomNumberOrigin}
+     *         less than zero, or {@code randomNumberOrigin}
      *         is greater than or equal to {@code randomNumberBound}
      * @since 1.8
      */
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java b/jdk/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java
index 0016bff..ceb9bf2 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java
@@ -1490,7 +1490,17 @@
     /**
      * Invokes {@code shutdown} when this executor is no longer
      * referenced and it has no threads.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     protected void finalize() {
         shutdown();
     }
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java b/jdk/src/java.base/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java
index d228f73..ab43971 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java
@@ -53,16 +53,14 @@
  *
  * <dl>
  * <dt><b><i>Non-fair mode (default)</i></b>
- * <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif">
- * When constructed as non-fair (the default), the order of entry
+ * <dd>When constructed as non-fair (the default), the order of entry
  * to the read and write lock is unspecified, subject to reentrancy
  * constraints.  A nonfair lock that is continuously contended may
  * indefinitely postpone one or more reader or writer threads, but
  * will normally have higher throughput than a fair lock.
  *
  * <dt><b><i>Fair mode</i></b>
- * <dd style="font-family:'DejaVu Sans', Arial, Helvetica, sans-serif">
- * When constructed as fair, threads contend for entry using an
+ * <dd>When constructed as fair, threads contend for entry using an
  * approximately arrival-order policy. When the currently held lock
  * is released, either the longest-waiting single writer thread will
  * be assigned the write lock, or if there is a group of reader threads
diff --git a/jdk/src/java.base/share/classes/java/util/jar/Pack200.java b/jdk/src/java.base/share/classes/java/util/jar/Pack200.java
index 01df263..c8862a8 100644
--- a/jdk/src/java.base/share/classes/java/util/jar/Pack200.java
+++ b/jdk/src/java.base/share/classes/java/util/jar/Pack200.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -452,13 +452,13 @@
         String CODE_ATTRIBUTE_PFX       = "pack.code.attribute.";
 
         /**
-         * The unpacker's progress as a percentage, as periodically
-         * updated by the unpacker.
+         * The packer's progress as a percentage, as periodically
+         * updated by the packer.
          * Values of 0 - 100 are normal, and -1 indicates a stall.
          * Progress can be monitored by polling the value of this
          * property.
          * <p>
-         * At a minimum, the unpacker must set progress to 0
+         * At a minimum, the packer must set progress to 0
          * at the beginning of a packing operation, and to 100
          * at the end.
          */
@@ -623,7 +623,7 @@
          * property.
          * <p>
          * At a minimum, the unpacker must set progress to 0
-         * at the beginning of a packing operation, and to 100
+         * at the beginning of an unpacking operation, and to 100
          * at the end.
          */
         String PROGRESS         = "unpack.progress";
@@ -631,7 +631,7 @@
         /**
          * Get the set of this engine's properties. This set is
          * a "live view", so that changing its
-         * contents immediately affects the Packer engine, and
+         * contents immediately affects the Unpacker engine, and
          * changes from the engine (such as progress indications)
          * are immediately visible in the map.
          *
diff --git a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java
index 53884b1..20dfa45 100644
--- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java
+++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java
@@ -3867,8 +3867,10 @@
                     return next.match(matcher, i + 1, seq);
                 if (ch == 0x0D) {
                     i++;
-                    if (i < matcher.to && seq.charAt(i) == 0x0A)
-                        i++;
+                    if (i < matcher.to && seq.charAt(i) == 0x0A &&
+                        next.match(matcher, i + 1, seq)) {
+                        return true;
+                    }
                     return next.match(matcher, i, seq);
                 }
             } else {
diff --git a/jdk/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java b/jdk/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java
index 06b6c26..4a3ef27 100644
--- a/jdk/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java
+++ b/jdk/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java
@@ -31,7 +31,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UncheckedIOException;
-import java.lang.reflect.Module;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Locale;
@@ -81,6 +80,7 @@
  *     ResourceBundleProvider Service Providers</a>
  *
  * @since 9
+ * @spec JPMS
  */
 public abstract class AbstractResourceBundleProvider implements ResourceBundleProvider {
     private static final JavaUtilResourceBundleAccess RB_ACCESS =
diff --git a/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleControlProvider.java b/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleControlProvider.java
index f74830b..871d919 100644
--- a/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleControlProvider.java
+++ b/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleControlProvider.java
@@ -44,6 +44,8 @@
  *
  * @author Masayoshi Okutsu
  * @since 1.8
+ * @revised 9
+ * @spec JPMS
  * @see ResourceBundle#getBundle(String, java.util.Locale, ClassLoader, ResourceBundle.Control)
  *      ResourceBundle.getBundle
  * @see java.util.ServiceLoader#load(Class)
diff --git a/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleProvider.java b/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleProvider.java
index 0074ae3..251831f 100644
--- a/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleProvider.java
+++ b/jdk/src/java.base/share/classes/java/util/spi/ResourceBundleProvider.java
@@ -57,6 +57,7 @@
  * @see <a href="../ResourceBundle.html#RBP_support">
  *     ResourceBundleProvider Service Providers</a>
  * @since 9
+ * @spec JPMS
  */
 public interface ResourceBundleProvider {
     /**
diff --git a/jdk/src/java.base/share/classes/java/util/stream/Collectors.java b/jdk/src/java.base/share/classes/java/util/stream/Collectors.java
index 17c743a..02f9ada 100644
--- a/jdk/src/java.base/share/classes/java/util/stream/Collectors.java
+++ b/jdk/src/java.base/share/classes/java/util/stream/Collectors.java
@@ -720,8 +720,9 @@
      * the result is 0.
      *
      * @param <T> the type of the input elements
-     * @param mapper a function extracting the property to be summed
-     * @return a {@code Collector} that produces the sum of a derived property
+     * @param mapper a function extracting the property to be averaged
+     * @return a {@code Collector} that produces the arithmetic mean of a
+     * derived property
      */
     public static <T> Collector<T, ?, Double>
     averagingInt(ToIntFunction<? super T> mapper) {
@@ -738,8 +739,9 @@
      * the result is 0.
      *
      * @param <T> the type of the input elements
-     * @param mapper a function extracting the property to be summed
-     * @return a {@code Collector} that produces the sum of a derived property
+     * @param mapper a function extracting the property to be averaged
+     * @return a {@code Collector} that produces the arithmetic mean of a
+     * derived property
      */
     public static <T> Collector<T, ?, Double>
     averagingLong(ToLongFunction<? super T> mapper) {
@@ -769,8 +771,9 @@
      * 2<sup>53</sup>, leading to additional numerical errors.
      *
      * @param <T> the type of the input elements
-     * @param mapper a function extracting the property to be summed
-     * @return a {@code Collector} that produces the sum of a derived property
+     * @param mapper a function extracting the property to be averaged
+     * @return a {@code Collector} that produces the arithmetic mean of a
+     * derived property
      */
     public static <T> Collector<T, ?, Double>
     averagingDouble(ToDoubleFunction<? super T> mapper) {
diff --git a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java
index bf70f4d..6eb5065 100644
--- a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java
+++ b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -551,7 +551,17 @@
 
     /**
      * Closes the compressor when garbage is collected.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     protected void finalize() {
         end();
     }
diff --git a/jdk/src/java.base/share/classes/java/util/zip/Inflater.java b/jdk/src/java.base/share/classes/java/util/zip/Inflater.java
index 94c05e1..2aab545 100644
--- a/jdk/src/java.base/share/classes/java/util/zip/Inflater.java
+++ b/jdk/src/java.base/share/classes/java/util/zip/Inflater.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -378,7 +378,17 @@
 
     /**
      * Closes the decompressor when garbage is collected.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     protected void finalize() {
         end();
     }
diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java b/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java
index 5191894..c00b5bf 100644
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -441,7 +441,7 @@
     /**
      * Sets the size of the compressed entry data.
      *
-     * @param csize the compressed size to set to
+     * @param csize the compressed size to set
      *
      * @see #getCompressedSize()
      */
diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipException.java b/jdk/src/java.base/share/classes/java/util/zip/ZipException.java
index 7031292..588611f 100644
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipException.java
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipException.java
@@ -32,7 +32,7 @@
  *
  * @author  unascribed
  * @see     java.io.IOException
- * @since   1.0
+ * @since   1.1
  */
 
 public
diff --git a/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java b/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java
index 4a78e2e..83ce244 100644
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -274,7 +274,7 @@
      *
      * @throws IllegalStateException if the zip file has been closed
      *
-     * Since 1.7
+     * @since 1.7
      */
     public String getComment() {
         synchronized (this) {
@@ -420,6 +420,7 @@
                     Integer.MAX_VALUE : (int) avail);
         }
 
+        @SuppressWarnings("deprecation")
         protected void finalize() throws Throwable {
             close();
         }
@@ -641,9 +642,18 @@
      * This will prevent holding up system resources for an undetermined
      * length of time.
      *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      * @throws IOException if an I/O error has occurred
      * @see    java.util.zip.ZipFile#close()
      */
+    @Deprecated(since="9")
     protected void finalize() throws IOException {
         close();
     }
@@ -813,6 +823,7 @@
             }
         }
 
+        @SuppressWarnings("deprecation")
         protected void finalize() {
             close();
         }
diff --git a/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java b/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java
index 60a1c9d..16b7903 100644
--- a/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java
+++ b/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java
@@ -25,7 +25,6 @@
 
 package javax.crypto;
 
-import java.lang.reflect.Module;
 import java.security.*;
 import java.net.*;
 import java.util.*;
diff --git a/jdk/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java b/jdk/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java
index 10506b7..ee77794 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -137,10 +137,15 @@
         int headerSize = ImageHeader.getHeaderSize();
 
         // If no memory map then read header from image file
-        if (map == null) {
+        if (headerBuffer == null) {
             headerBuffer = ByteBuffer.allocateDirect(headerSize);
-            channel.read(headerBuffer, 0L);
-            headerBuffer.rewind();
+            if (channel.read(headerBuffer, 0L) == headerSize) {
+                headerBuffer.rewind();
+            } else {
+                throw new IOException("\"" + name + "\" is not an image file");
+            }
+        } else if (headerBuffer.capacity() < headerSize) {
+            throw new IOException("\"" + name + "\" is not an image file");
         }
 
         // Interpret the image file header
@@ -156,6 +161,9 @@
         memoryMap = map.asReadOnlyBuffer();
 
         // Interpret the image index
+        if (memoryMap.capacity() < indexSize) {
+            throw new IOException("The image file \"" + name + "\" is corrupted");
+        }
         redirect = intBuffer(memoryMap, header.getRedirectOffset(), header.getRedirectSize());
         offsets = intBuffer(memoryMap, header.getOffsetsOffset(), header.getOffsetsSize());
         locations = slice(memoryMap, header.getLocationsOffset(), header.getLocationsSize());
@@ -241,27 +249,20 @@
         return stringsReader;
     }
 
-    public ImageLocation findLocation(String mn, String rn) {
-        Objects.requireNonNull(mn);
-        Objects.requireNonNull(rn);
-
-        return findLocation("/" + mn + "/" + rn);
-    }
-
-    public synchronized ImageLocation findLocation(String name) {
+    public synchronized ImageLocation findLocation(String module, String name) {
+        Objects.requireNonNull(module);
         Objects.requireNonNull(name);
         // Details of the algorithm used here can be found in
         // jdk.tools.jlink.internal.PerfectHashBuilder.
-        byte[] bytes = ImageStringsReader.mutf8FromString(name);
         int count = header.getTableLength();
-        int index = redirect.get(ImageStringsReader.hashCode(bytes) % count);
+        int index = redirect.get(ImageStringsReader.hashCode(module, name) % count);
 
         if (index < 0) {
             // index is twos complement of location attributes index.
             index = -index - 1;
         } else if (index > 0) {
             // index is hash seed needed to compute location attributes index.
-            index = ImageStringsReader.hashCode(bytes, index) % count;
+            index = ImageStringsReader.hashCode(module, name, index) % count;
         } else {
             // No entry.
             return null;
@@ -269,13 +270,36 @@
 
         long[] attributes = getAttributes(offsets.get(index));
 
-        ImageLocation imageLocation = new ImageLocation(attributes, stringsReader);
+        if (!ImageLocation.verify(module, name, attributes, stringsReader)) {
+            return null;
+        }
+        return new ImageLocation(attributes, stringsReader);
+    }
 
-        if (!imageLocation.verify(name)) {
+    public synchronized ImageLocation findLocation(String name) {
+        Objects.requireNonNull(name);
+        // Details of the algorithm used here can be found in
+        // jdk.tools.jlink.internal.PerfectHashBuilder.
+        int count = header.getTableLength();
+        int index = redirect.get(ImageStringsReader.hashCode(name) % count);
+
+        if (index < 0) {
+            // index is twos complement of location attributes index.
+            index = -index - 1;
+        } else if (index > 0) {
+            // index is hash seed needed to compute location attributes index.
+            index = ImageStringsReader.hashCode(name, index) % count;
+        } else {
+            // No entry.
             return null;
         }
 
-        return imageLocation;
+        long[] attributes = getAttributes(offsets.get(index));
+
+        if (!ImageLocation.verify(name, attributes, stringsReader)) {
+            return null;
+        }
+        return new ImageLocation(attributes, stringsReader);
     }
 
     public String[] getEntryNames() {
diff --git a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageLocation.java b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageLocation.java
index ad0ae42..f1b8f55 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageLocation.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageLocation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,14 +59,6 @@
         return strings;
     }
 
-    private static int attributeLength(int data) {
-        return (data & 0x7) + 1;
-    }
-
-    private static int attributeKind(int data) {
-        return data >>> 3;
-    }
-
     static long[] decompress(ByteBuffer bytes) {
         Objects.requireNonNull(bytes);
         long[] attributes = new long[ATTRIBUTE_COUNT];
@@ -74,7 +66,7 @@
         if (bytes != null) {
             while (bytes.hasRemaining()) {
                 int data = bytes.get() & 0xFF;
-                int kind = attributeKind(data);
+                int kind = data >>> 3;
 
                 if (kind == ATTRIBUTE_END) {
                     break;
@@ -85,7 +77,7 @@
                         "Invalid jimage attribute kind: " + kind);
                 }
 
-                int length = attributeLength(data);
+                int length = (data & 0x7) + 1;
                 long value = 0;
 
                 for (int j = 0; j < length; j++) {
@@ -128,9 +120,82 @@
      }
 
     public boolean verify(String name) {
-        Objects.requireNonNull(name);
+        return verify(name, attributes, strings);
+    }
 
-        return name.equals(getFullName());
+    /**
+     * A simpler verification would be {@code name.equals(getFullName())}, but
+     * by not creating the full name and enabling early returns we allocate
+     * fewer objects. Could possibly be made allocation free by extending
+     * ImageStrings to test if strings at an offset match the name region.
+     */
+    static boolean verify(String name, long[] attributes, ImageStrings strings) {
+        Objects.requireNonNull(name);
+        final int length = name.length();
+        int index = 0;
+        int moduleOffset = (int)attributes[ATTRIBUTE_MODULE];
+        if (moduleOffset != 0) {
+            String module = strings.get(moduleOffset);
+            final int moduleLen = module.length();
+            index = moduleLen + 1;
+            if (length <= index
+                    || name.charAt(0) != '/'
+                    || !name.regionMatches(1, module, 0, moduleLen)
+                    || name.charAt(index++) != '/') {
+                return false;
+            }
+        }
+
+        return verifyName(name, index, length, attributes, strings);
+    }
+
+    static boolean verify(String module, String name, long[] attributes,
+            ImageStrings strings) {
+        Objects.requireNonNull(module);
+        Objects.requireNonNull(name);
+        int moduleOffset = (int)attributes[ATTRIBUTE_MODULE];
+        if (moduleOffset != 0) {
+            if (!module.equals(strings.get(moduleOffset))) {
+                return false;
+            }
+        }
+
+        return verifyName(name, 0, name.length(), attributes, strings);
+    }
+
+    private static boolean verifyName(String name, int index, int length,
+            long[] attributes, ImageStrings strings) {
+
+        int parentOffset = (int) attributes[ATTRIBUTE_PARENT];
+        if (parentOffset != 0) {
+            String parent = strings.get(parentOffset);
+            final int parentLen = parent.length();
+            if (!name.regionMatches(index, parent, 0, parentLen)) {
+                return false;
+            }
+            index += parentLen;
+            if (length <= index || name.charAt(index++) != '/') {
+                return false;
+            }
+        }
+        String base = strings.get((int) attributes[ATTRIBUTE_BASE]);
+        final int baseLen = base.length();
+        if (!name.regionMatches(index, base, 0, baseLen)) {
+            return false;
+        }
+        index += baseLen;
+        int extOffset = (int) attributes[ATTRIBUTE_EXTENSION];
+        if (extOffset != 0) {
+            String extension = strings.get(extOffset);
+            int extLen = extension.length();
+            if (length <= index
+                    || name.charAt(index++) != '.'
+                    || !name.regionMatches(index, extension, 0, extLen)) {
+                return false;
+            }
+            index += extLen;
+        }
+        return length == index;
     }
 
     long getAttribute(int kind) {
diff --git a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java
index 60ab472..6082c21 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java
@@ -52,7 +52,9 @@
  * to the jimage file provided by the shipped JDK by tools running on JDK 8.
  */
 public final class ImageReader implements AutoCloseable {
-    private SharedImageReader reader;
+    private final SharedImageReader reader;
+
+    private volatile boolean closed;
 
     private ImageReader(SharedImageReader reader) {
         this.reader = reader;
@@ -71,45 +73,49 @@
 
     @Override
     public void close() throws IOException {
-        if (reader == null) {
+        if (closed) {
             throw new IOException("image file already closed");
         }
-
         reader.close(this);
-        reader = null;
+        closed = true;
+    }
+
+    private void ensureOpen() throws IOException {
+        if (closed) {
+            throw new IOException("image file closed");
+        }
+    }
+
+    private void requireOpen() {
+        if (closed) {
+            throw new IllegalStateException("image file closed");
+        }
     }
 
     // directory management interface
     public Directory getRootDirectory() throws IOException {
-        if (reader == null) {
-            throw new IOException("image file closed");
-        }
+        ensureOpen();
         return reader.getRootDirectory();
     }
 
+
     public Node findNode(String name) throws IOException {
-        if (reader == null) {
-            throw new IOException("image file closed");
-        }
+        ensureOpen();
         return reader.findNode(name);
     }
 
     public byte[] getResource(Node node) throws IOException {
-        if (reader == null) {
-            throw new IOException("image file closed");
-        }
+        ensureOpen();
         return reader.getResource(node);
     }
 
     public byte[] getResource(Resource rs) throws IOException {
-        if (reader == null) {
-            throw new IOException("image file closed");
-        }
+        ensureOpen();
         return reader.getResource(rs);
     }
 
     public ImageHeader getHeader() {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getHeader();
     }
 
@@ -118,42 +124,42 @@
     }
 
     public String getName() {
-        Objects.requireNonNull(reader, "image file closed");
-        return reader.getName() ;
+        requireOpen();
+        return reader.getName();
     }
 
     public ByteOrder getByteOrder() {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getByteOrder();
     }
 
     public Path getImagePath() {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getImagePath();
     }
 
     public ImageStringsReader getStrings() {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getStrings();
     }
 
     public ImageLocation findLocation(String mn, String rn) {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.findLocation(mn, rn);
     }
 
     public ImageLocation findLocation(String name) {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.findLocation(name);
     }
 
     public String[] getEntryNames() {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getEntryNames();
     }
 
     public String[] getModuleNames() {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         int off = "/modules/".length();
         return reader.findNode("/modules")
                      .getChildren()
@@ -164,32 +170,32 @@
     }
 
     public long[] getAttributes(int offset) {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getAttributes(offset);
     }
 
     public String getString(int offset) {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getString(offset);
     }
 
     public byte[] getResource(String name) {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getResource(name);
     }
 
     public byte[] getResource(ImageLocation loc) {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getResource(loc);
     }
 
     public ByteBuffer getResourceBuffer(ImageLocation loc) {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getResourceBuffer(loc);
     }
 
     public InputStream getResourceStream(ImageLocation loc) {
-        Objects.requireNonNull(reader, "image file closed");
+        requireOpen();
         return reader.getResourceStream(loc);
     }
 
diff --git a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReaderFactory.java b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReaderFactory.java
index 092b309..24ac9bf 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReaderFactory.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageReaderFactory.java
@@ -32,6 +32,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.Map;
 import java.util.Objects;
+import java.util.function.Function;
 
 /**
  * Factory to get ImageReader
@@ -56,21 +57,23 @@
      */
     public static ImageReader get(Path jimage) throws IOException {
         Objects.requireNonNull(jimage);
-        ImageReader reader = readers.get(jimage);
-        if (reader != null) {
-            return reader;
-        }
-        reader = ImageReader.open(jimage);
-        // potential race with other threads opening the same URL
-        ImageReader r = readers.putIfAbsent(jimage, reader);
-        if (r == null) {
-            return reader;
-        } else {
-            reader.close();
-            return r;
+        try {
+            return readers.computeIfAbsent(jimage, OPENER);
+        } catch (UncheckedIOException io) {
+            throw io.getCause();
         }
     }
 
+    private static Function<Path, ImageReader> OPENER = new Function<Path, ImageReader>() {
+        public ImageReader apply(Path path) {
+            try {
+                return ImageReader.open(path);
+            } catch (IOException io) {
+                throw new UncheckedIOException(io);
+            }
+        }
+    };
+
     /**
      * Returns the {@code ImageReader} to read the image file in this
      * run-time image.
diff --git a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageStringsReader.java b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageStringsReader.java
index e4a11cb..d9900aa 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageStringsReader.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageStringsReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@
  */
 public class ImageStringsReader implements ImageStrings {
     public static final int HASH_MULTIPLIER = 0x01000193;
+    public static final int POSITIVE_MASK = 0x7FFFFFFF;
+
     private final BasicImageReader reader;
 
     ImageStringsReader(BasicImageReader reader) {
@@ -54,40 +56,60 @@
         throw new InternalError("Can not add strings at runtime");
     }
 
-    private static int hashCode(byte[] bytes, int offset, int count, int seed) {
-        Objects.requireNonNull(bytes);
+    public static int hashCode(String s) {
+        return hashCode(s, HASH_MULTIPLIER);
+    }
 
-        if (offset < 0 || count < 0 || offset > bytes.length - count) {
-            throw new IndexOutOfBoundsException("offset=" + offset + ", count=" + count);
+    public static int hashCode(String s, int seed) {
+        return unmaskedHashCode(s, seed) & POSITIVE_MASK;
+    }
+
+    public static int hashCode(String module, String name) {
+        return hashCode(module, name, HASH_MULTIPLIER);
+    }
+
+    public static int hashCode(String module, String name, int seed) {
+        seed = unmaskedHashCode("/", seed);
+        seed = unmaskedHashCode(module, seed);
+        seed = unmaskedHashCode("/", seed);
+        seed = unmaskedHashCode(name, seed);
+        return seed & POSITIVE_MASK;
+    }
+
+    public static int unmaskedHashCode(String s, int seed) {
+        int slen = s.length();
+        byte[] buffer = null;
+
+        for (int i = 0; i < slen; i++) {
+            char ch = s.charAt(i);
+            int uch = ch & 0xFFFF;
+
+            if ((uch & ~0x7F) != 0) {
+                if (buffer == null) {
+                    buffer = new byte[8];
+                }
+                int mask = ~0x3F;
+                int n = 0;
+
+                do {
+                    buffer[n++] = (byte)(0x80 | (uch & 0x3F));
+                    uch >>= 6;
+                    mask >>= 1;
+                } while ((uch & mask) != 0);
+
+                buffer[n] = (byte)((mask << 1) | uch);
+
+                do {
+                    seed = (seed * HASH_MULTIPLIER) ^ (buffer[n--] & 0xFF);
+                } while (0 <= n);
+            } else if (uch == 0) {
+                seed = (seed * HASH_MULTIPLIER) ^ (0xC0);
+                seed = (seed * HASH_MULTIPLIER) ^ (0x80);
+            } else {
+                seed = (seed * HASH_MULTIPLIER) ^ (uch);
+            }
         }
-
-        int limit = offset + count;
-
-        if (limit < 0 || limit > bytes.length) {
-            throw new IndexOutOfBoundsException("limit=" + limit);
-        }
-
-        for (int i = offset; i < limit; i++) {
-            seed = (seed * HASH_MULTIPLIER) ^ (bytes[i] & 0xFF);
-        }
-
-        return seed & 0x7FFFFFFF;
-    }
-
-    public static int hashCode(byte[] bytes, int seed) {
-        return hashCode(bytes, 0, bytes.length, seed);
-    }
-
-    public static int hashCode(byte[] bytes) {
-        return hashCode(bytes, 0, bytes.length, HASH_MULTIPLIER);
-    }
-
-    public static int hashCode(String string, int seed) {
-        return hashCode(mutf8FromString(string), seed);
-    }
-
-    public static int hashCode(String string) {
-        return hashCode(mutf8FromString(string), HASH_MULTIPLIER);
+        return seed;
     }
 
     static int charsFromMUTF8Length(byte[] bytes, int offset, int count) {
@@ -179,7 +201,7 @@
         throw new InternalError("No terminating zero byte for modified UTF-8 byte sequence");
     }
 
-    static void charsFromByteBuffer(char chars[], ByteBuffer buffer) {
+    static void charsFromByteBuffer(char[] chars, ByteBuffer buffer) {
         int j = 0;
 
         while(buffer.hasRemaining()) {
@@ -228,10 +250,12 @@
         return new String(chars);
     }
 
-    static int mutf8FromCharsLength(char chars[]) {
+    static int mutf8FromStringLength(String s) {
         int length = 0;
+        int slen = s.length();
 
-        for (char ch : chars) {
+        for (int i = 0; i < slen; i++) {
+            char ch = s.charAt(i);
             int uch = ch & 0xFFFF;
 
             if ((uch & ~0x7F) != 0) {
@@ -255,14 +279,19 @@
         return length;
     }
 
-    static void mutf8FromChars(byte[] bytes, int offset, char chars[]) {
+    static void mutf8FromString(byte[] bytes, int offset, String s) {
         int j = offset;
-        byte[] buffer = new byte[8];
+        byte[] buffer = null;
+        int slen = s.length();
 
-        for (char ch : chars) {
+        for (int i = 0; i < slen; i++) {
+            char ch = s.charAt(i);
             int uch = ch & 0xFFFF;
 
             if ((uch & ~0x7F) != 0) {
+                if (buffer == null) {
+                    buffer = new byte[8];
+                }
                 int mask = ~0x3F;
                 int n = 0;
 
@@ -287,10 +316,9 @@
     }
 
     public static byte[] mutf8FromString(String string) {
-        char[] chars = string.toCharArray();
-        int length = mutf8FromCharsLength(chars);
+        int length = mutf8FromStringLength(string);
         byte[] bytes = new byte[length];
-        mutf8FromChars(bytes, 0, chars);
+        mutf8FromString(bytes, 0, string);
 
         return bytes;
     }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/jmod/JmodFile.java b/jdk/src/java.base/share/classes/jdk/internal/jmod/JmodFile.java
index 34e99df..0a78e71 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/jmod/JmodFile.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/jmod/JmodFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,7 +59,7 @@
             bis.read(magic);
             if (magic[0] != JMOD_MAGIC_NUMBER[0] ||
                 magic[1] != JMOD_MAGIC_NUMBER[1]) {
-                throw new IOException("Invalid jmod file: " + file.toString());
+                throw new IOException("Invalid JMOD file: " + file.toString());
             }
             if (magic[2] > JMOD_MAJOR_VERSION ||
                 (magic[2] == JMOD_MAJOR_VERSION && magic[3] > JMOD_MINOR_VERSION)) {
@@ -78,7 +78,7 @@
         HEADER_FILES("include"),
         LEGAL_NOTICES("legal"),
         MAN_PAGES("man"),
-        NATIVE_LIBS("native"),
+        NATIVE_LIBS("lib"),
         NATIVE_CMDS("bin");
 
         private final String jmodDir;
@@ -131,6 +131,13 @@
         }
 
         /**
+         * Returns true if the entry is a directory in the JMOD file.
+         */
+        public boolean isDirectory() {
+            return zipEntry.isDirectory();
+        }
+
+        /**
          * Returns the size of this entry.
          */
         public long size() {
@@ -191,7 +198,7 @@
 
     /**
      * Opens an {@code InputStream} for reading the named entry of the given
-     * section in this jmod file.
+     * section in this JMOD file.
      *
      * @throws IOException if the named entry is not found, or I/O error
      *         occurs when reading it
@@ -217,11 +224,10 @@
     }
 
     /**
-     * Returns a stream of non-directory entries in this jmod file.
+     * Returns a stream of entries in this JMOD file.
      */
     public Stream<Entry> stream() {
         return zipfile.stream()
-                      .filter(e -> !e.isDirectory())
                       .map(Entry::new);
     }
 
diff --git a/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystem.java b/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystem.java
index 49285b3..d544e4c 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystem.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystem.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -106,6 +106,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             cleanup();
diff --git a/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystemProvider.java b/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystemProvider.java
index 4aed7a6..1297603 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystemProvider.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileSystemProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,14 +65,12 @@
     }
 
     /**
-     * Need FilePermission ${java.home}/-", "read" to create or get jrt:/
+     * Need RuntimePermission "accessSystemModules" to create or get jrt:/
      */
     private void checkPermission() {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            String home = SystemImage.RUNTIME_HOME;
-            FilePermission perm
-                    = new FilePermission(home + File.separator + "-", "read");
+            RuntimePermission perm = new RuntimePermission("accessSystemModules");
             sm.checkPermission(perm);
         }
     }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java b/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java
index 7885d8e..07b5173 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java
@@ -27,8 +27,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -62,8 +60,7 @@
     private static final String JAVA_HOME = System.getProperty("java.home");
 
     static {
-        UNNAMED_MODULE
-            = SharedSecrets.getJavaLangReflectModuleAccess().defineUnnamedModule(null);
+        UNNAMED_MODULE = SharedSecrets.getJavaLangAccess().defineUnnamedModule(null);
         setBootLoaderUnnamedModule0(UNNAMED_MODULE);
     }
 
@@ -96,6 +93,14 @@
     }
 
     /**
+     * Returns {@code true} if there is a class path associated with the
+     * BootLoader.
+     */
+    public static boolean hasClassPath() {
+        return ClassLoaders.bootLoader().hasClassPath();
+    }
+
+    /**
      * Register a module with this class loader so that its classes (and
      * resources) become visible via this class loader.
      */
@@ -247,7 +252,7 @@
 
             if (mn != null) {
                 // named module from runtime image or exploded module
-                Optional<Module> om = Layer.boot().findModule(mn);
+                Optional<Module> om = ModuleLayer.boot().findModule(mn);
                 if (!om.isPresent())
                     throw new InternalError(mn + " not in boot layer");
                 return om.get();
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java b/jdk/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java
index ab052ec..ce3bb67 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java
@@ -57,8 +57,10 @@
 import java.util.jar.Manifest;
 import java.util.stream.Stream;
 
-import jdk.internal.module.ModulePatcher.PatchedModuleReader;
 import jdk.internal.misc.VM;
+import jdk.internal.module.ModulePatcher.PatchedModuleReader;
+import jdk.internal.module.SystemModules;
+import jdk.internal.module.Resources;
 
 
 /**
@@ -135,7 +137,7 @@
 
     // maps package name to loaded module for modules in the boot layer
     private static final Map<String, LoadedModule> packageToModule
-        = new ConcurrentHashMap<>(1024);
+        = new ConcurrentHashMap<>(SystemModules.PACKAGES_IN_BOOT_LAYER);
 
     // maps a module name to a module reference
     private final Map<String, ModuleReference> nameToModule;
@@ -162,6 +164,14 @@
     }
 
     /**
+     * Returns {@code true} if there is a class path associated with this
+     * class loader.
+     */
+    boolean hasClassPath() {
+        return ucp != null;
+    }
+
+    /**
      * Register a module this this class loader. This has the effect of making
      * the types in the module visible.
      */
@@ -247,18 +257,24 @@
      */
     @Override
     public URL findResource(String name) {
-        String pn = ResourceHelper.getPackageName(name);
+        String pn = Resources.toPackageName(name);
         LoadedModule module = packageToModule.get(pn);
         if (module != null) {
 
             // resource is in a package of a module defined to this loader
-            if (module.loader() == this
-                && (name.endsWith(".class") || isOpen(module.mref(), pn))) {
+            if (module.loader() == this) {
+                URL url;
                 try {
-                    return findResource(module.name(), name); // checks URL
+                    url = findResource(module.name(), name); // checks URL
                 } catch (IOException ioe) {
                     return null;
                 }
+                if (url != null
+                    && (name.endsWith(".class")
+                        || url.toString().endsWith("/")
+                        || isOpen(module.mref(), pn))) {
+                    return url;
+                }
             }
 
         } else {
@@ -292,15 +308,17 @@
     public Enumeration<URL> findResources(String name) throws IOException {
         List<URL> checked = new ArrayList<>();  // list of checked URLs
 
-        String pn = ResourceHelper.getPackageName(name);
+        String pn = Resources.toPackageName(name);
         LoadedModule module = packageToModule.get(pn);
         if (module != null) {
 
             // resource is in a package of a module defined to this loader
-            if (module.loader() == this
-                && (name.endsWith(".class") || isOpen(module.mref(), pn))) {
-                URL url = findResource(module.name(), name);  // checks URL
-                if (url != null) {
+            if (module.loader() == this) {
+                URL url = findResource(module.name(), name); // checks URL
+                if (url != null
+                    && (name.endsWith(".class")
+                        || url.toString().endsWith("/")
+                        || isOpen(module.mref(), pn))) {
                     checked.add(url);
                 }
             }
@@ -350,11 +368,13 @@
                 new PrivilegedExceptionAction<>() {
                     @Override
                     public List<URL> run() throws IOException {
-                        List<URL> result = new ArrayList<>();
+                        List<URL> result = null;
                         for (ModuleReference mref : nameToModule.values()) {
                             URI u = moduleReaderFor(mref).find(name).orElse(null);
                             if (u != null) {
                                 try {
+                                    if (result == null)
+                                        result = new ArrayList<>();
                                     result.add(u.toURL());
                                 } catch (MalformedURLException |
                                          IllegalArgumentException e) {
@@ -374,7 +394,7 @@
                 map = new ConcurrentHashMap<>();
                 this.resourceCache = new SoftReference<>(map);
             }
-            if (urls.isEmpty())
+            if (urls == null)
                 urls = Collections.emptyList();
             map.putIfAbsent(name, urls);
         }
@@ -424,7 +444,7 @@
      * Returns a URL to a resource on the class path.
      */
     private URL findResourceOnClassPath(String name) {
-        if (ucp != null) {
+        if (hasClassPath()) {
             if (System.getSecurityManager() == null) {
                 return ucp.findResource(name, false);
             } else {
@@ -441,7 +461,7 @@
      * Returns the URLs of all resources of the given name on the class path.
      */
     private Enumeration<URL> findResourcesOnClassPath(String name) {
-        if (ucp != null) {
+        if (hasClassPath()) {
             if (System.getSecurityManager() == null) {
                 return ucp.findResources(name, false);
             } else {
@@ -480,7 +500,7 @@
         } else {
 
             // search class path
-            if (ucp != null) {
+            if (hasClassPath()) {
                 c = findClassOnClassPathOrNull(cn);
             }
 
@@ -513,7 +533,7 @@
         }
 
         // search class path
-        if (ucp != null) {
+        if (hasClassPath()) {
             return findClassOnClassPathOrNull(cn);
         }
 
@@ -568,7 +588,7 @@
                     }
 
                     // check class path
-                    if (c == null && ucp != null && VM.isModuleSystemInited()) {
+                    if (c == null && hasClassPath() && VM.isModuleSystemInited()) {
                         c = findClassOnClassPathOrNull(cn);
                     }
                 }
@@ -922,13 +942,13 @@
      * Returns the ModuleReader for the given module.
      */
     private ModuleReader moduleReaderFor(ModuleReference mref) {
-        return moduleToReader.computeIfAbsent(mref, m -> createModuleReader(mref));
+        return moduleToReader.computeIfAbsent(mref, BuiltinClassLoader::createModuleReader);
     }
 
     /**
      * Creates a ModuleReader for the given module.
      */
-    private ModuleReader createModuleReader(ModuleReference mref) {
+    private static ModuleReader createModuleReader(ModuleReference mref) {
         try {
             return mref.open();
         } catch (IOException e) {
@@ -966,7 +986,7 @@
      */
     private boolean isOpen(ModuleReference mref, String pn) {
         ModuleDescriptor descriptor = mref.descriptor();
-        if (descriptor.isOpen())
+        if (descriptor.isOpen() || descriptor.isAutomatic())
             return true;
         for (ModuleDescriptor.Opens opens : descriptor.opens()) {
             String source = opens.source();
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java b/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java
index 6449250..9729026 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java
@@ -27,7 +27,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.lang.reflect.Module;
 import java.net.URL;
 import java.nio.file.InvalidPathException;
 import java.nio.file.Paths;
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/Loader.java b/jdk/src/java.base/share/classes/jdk/internal/loader/Loader.java
index 04285cc..0eb249d 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/Loader.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/Loader.java
@@ -33,7 +33,6 @@
 import java.lang.module.ModuleReader;
 import java.lang.module.ModuleReference;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -60,6 +59,7 @@
 import java.util.stream.Stream;
 
 import jdk.internal.misc.SharedSecrets;
+import jdk.internal.module.Resources;
 
 
 /**
@@ -79,8 +79,8 @@
  * loader. This allows automatic modules (for example) to link to types in the
  * unnamed module of the parent class loader.
  *
- * @see Layer#defineModulesWithOneLoader
- * @see Layer#defineModulesWithManyLoaders
+ * @see ModuleModuleLayer#defineModulesWithOneLoader
+ * @see ModuleModuleLayer#defineModulesWithManyLoaders
  */
 
 public final class Loader extends SecureClassLoader {
@@ -206,10 +206,10 @@
      * @param cf the Configuration containing at least modules to be defined to
      *           this class loader
      *
-     * @param parentLayers the parent Layers
+     * @param parentModuleLayers the parent ModuleLayers
      */
     public Loader initRemotePackageMap(Configuration cf,
-                                       List<Layer> parentLayers)
+                                       List<ModuleLayer> parentModuleLayers)
     {
         for (String name : nameToModule.keySet()) {
             ResolvedModule resolvedModule = cf.findModule(name).get();
@@ -235,8 +235,8 @@
                 } else {
 
                     // find the layer for the target module
-                    Layer layer = parentLayers.stream()
-                        .map(parent -> findLayer(parent, other.configuration()))
+                    ModuleLayer layer = parentModuleLayers.stream()
+                        .map(parent -> findModuleLayer(parent, other.configuration()))
                         .flatMap(Optional::stream)
                         .findAny()
                         .orElseThrow(() ->
@@ -285,8 +285,8 @@
      * Find the layer corresponding to the given configuration in the tree
      * of layers rooted at the given parent.
      */
-    private Optional<Layer> findLayer(Layer parent, Configuration cf) {
-        return SharedSecrets.getJavaLangReflectModuleAccess().layers(parent)
+    private Optional<ModuleLayer> findModuleLayer(ModuleLayer parent, Configuration cf) {
+        return SharedSecrets.getJavaLangAccess().layers(parent)
                 .filter(l -> l.configuration() == cf)
                 .findAny();
     }
@@ -356,45 +356,52 @@
 
     @Override
     public URL findResource(String name) {
-        URL url = null;
-        String pn = ResourceHelper.getPackageName(name);
+        String pn = Resources.toPackageName(name);
         LoadedModule module = localPackageToModule.get(pn);
+
         if (module != null) {
-            if (name.endsWith(".class") || isOpen(module.mref(), pn)) {
-                try {
-                    url = findResource(module.name(), name);
-                } catch (IOException ioe) {
-                    // ignore
+            try {
+                URL url = findResource(module.name(), name);
+                if (url != null
+                    && (name.endsWith(".class")
+                        || url.toString().endsWith("/")
+                        || isOpen(module.mref(), pn))) {
+                    return url;
                 }
+            } catch (IOException ioe) {
+                // ignore
             }
+
         } else {
             for (ModuleReference mref : nameToModule.values()) {
                 try {
-                    url = findResource(mref.descriptor().name(), name);
-                    if (url != null)
-                        break;
+                    URL url = findResource(mref.descriptor().name(), name);
+                    if (url != null) return url;
                 } catch (IOException ioe) {
                     // ignore
                 }
             }
         }
-        return url;
+
+        return null;
     }
 
     @Override
     public Enumeration<URL> findResources(String name) throws IOException {
         List<URL> urls = new ArrayList<>();
-        String pn = ResourceHelper.getPackageName(name);
+        String pn = Resources.toPackageName(name);
         LoadedModule module = localPackageToModule.get(pn);
         if (module != null) {
-            if (name.endsWith(".class") || isOpen(module.mref(), pn)) {
-                try {
-                    URL url = findResource(module.name(), name);
-                    if (url != null)
-                        urls.add(url);
-                } catch (IOException ioe) {
-                    // ignore
+            try {
+                URL url = findResource(module.name(), name);
+                if (url != null
+                    && (name.endsWith(".class")
+                        || url.toString().endsWith("/")
+                        || isOpen(module.mref(), pn))) {
+                    urls.add(url);
                 }
+            } catch (IOException ioe) {
+                // ignore
             }
         } else {
             for (ModuleReference mref : nameToModule.values()) {
@@ -643,7 +650,7 @@
      */
     private boolean isOpen(ModuleReference mref, String pn) {
         ModuleDescriptor descriptor = mref.descriptor();
-        if (descriptor.isOpen())
+        if (descriptor.isOpen() || descriptor.isAutomatic())
             return true;
         for (ModuleDescriptor.Opens opens : descriptor.opens()) {
             String source = opens.source();
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/LoaderPool.java b/jdk/src/java.base/share/classes/jdk/internal/loader/LoaderPool.java
index 14b088c..a16f244 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/LoaderPool.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/LoaderPool.java
@@ -27,7 +27,6 @@
 
 import java.lang.module.Configuration;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -36,7 +35,7 @@
 /**
  * A pool of class loaders.
  *
- * @see Layer#defineModulesWithManyLoaders
+ * @see ModuleLayer#defineModulesWithManyLoaders
  */
 
 public final class LoaderPool {
@@ -51,7 +50,7 @@
      * created with the given parent class loader as its parent.
      */
     public LoaderPool(Configuration cf,
-                      List<Layer> parentLayers,
+                      List<ModuleLayer> parentLayers,
                       ClassLoader parentLoader)
     {
         Map<String, Loader> loaders = new HashMap<>();
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/ResourceHelper.java b/jdk/src/java.base/share/classes/jdk/internal/loader/ResourceHelper.java
deleted file mode 100644
index a9e0750..0000000
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/ResourceHelper.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.internal.loader;
-
-import jdk.internal.module.Checks;
-
-/**
- * Helper class for Class#getResource, Module#getResourceAsStream, and other
- * methods that locate a resource in a module.
- */
-public final class ResourceHelper {
-    private ResourceHelper() { }
-
-    /**
-     * Returns the <em>package name</em> for a resource.
-     */
-    public static String getPackageName(String name) {
-        int index = name.lastIndexOf('/');
-        if (index != -1) {
-            return name.substring(0, index).replace("/", ".");
-        } else {
-            return "";
-        }
-    }
-
-    /**
-     * Returns true if the resource is a <em>simple resource</em> that can
-     * never be encapsulated. Resources ending in "{@code .class}" or where
-     * the package name is not a Java identifier are resources that can
-     * never be encapsulated.
-     */
-    public static boolean isSimpleResource(String name) {
-        int len = name.length();
-        if (len > 6 && name.endsWith(".class")) {
-            return true;
-        }
-        if (!Checks.isJavaIdentifier(getPackageName(name))) {
-            return true;
-        }
-        return false;
-    }
-}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java b/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java
index d67c342..d343f8f 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,6 +65,8 @@
 import java.util.jar.Attributes.Name;
 import java.util.zip.ZipFile;
 
+import jdk.internal.misc.JavaNetURLAccess;
+import jdk.internal.misc.JavaNetURLClassLoaderAccess;
 import jdk.internal.misc.JavaUtilZipFileAccess;
 import jdk.internal.misc.SharedSecrets;
 import jdk.internal.util.jar.InvalidJarIndexError;
@@ -346,7 +348,7 @@
      * path. The URLs are opened and expanded as needed. Returns null
      * if the specified index is out of range.
      */
-     private synchronized Loader getLoader(int index) {
+    private synchronized Loader getLoader(int index) {
         if (closed) {
             return null;
         }
@@ -404,31 +406,40 @@
     private Loader getLoader(final URL url) throws IOException {
         try {
             return java.security.AccessController.doPrivileged(
-                new java.security.PrivilegedExceptionAction<>() {
-                public Loader run() throws IOException {
-                    String protocol = url.getProtocol();  // lower cased in URL
-                    String file = url.getFile();
-                    if ("jar".equals(protocol)
-                            && file != null && (file.indexOf("!/") == file.length() - 2)) {
-                        // extract the nested URL
-                        URL nestedUrl = new URL(file.substring(0, file.length() - 2));
-                        return new JarLoader(nestedUrl, jarHandler, lmap, acc);
-                    } else if (file != null && file.endsWith("/")) {
-                        if ("file".equals(protocol)) {
-                            return new FileLoader(url);
-                        } else {
-                            return new Loader(url);
+                    new java.security.PrivilegedExceptionAction<>() {
+                        public Loader run() throws IOException {
+                            String protocol = url.getProtocol();  // lower cased in URL
+                            String file = url.getFile();
+                            if (file != null && file.endsWith("/")) {
+                                if ("file".equals(protocol)) {
+                                    return new FileLoader(url);
+                                } else if ("jar".equals(protocol) &&
+                                        isDefaultJarHandler(url) &&
+                                        file.endsWith("!/")) {
+                                    // extract the nested URL
+                                    URL nestedUrl = new URL(file.substring(0, file.length() - 2));
+                                    return new JarLoader(nestedUrl, jarHandler, lmap, acc);
+                                } else {
+                                    return new Loader(url);
+                                }
+                            } else {
+                                return new JarLoader(url, jarHandler, lmap, acc);
+                            }
                         }
-                    } else {
-                        return new JarLoader(url, jarHandler, lmap, acc);
-                    }
-                }
-            }, acc);
+                    }, acc);
         } catch (java.security.PrivilegedActionException pae) {
             throw (IOException)pae.getException();
         }
     }
 
+    private static final JavaNetURLAccess JNUA
+            = SharedSecrets.getJavaNetURLAccess();
+
+    private static boolean isDefaultJarHandler(URL u) {
+        URLStreamHandler h = JNUA.getHandler(u);
+        return h instanceof sun.net.www.protocol.jar.Handler;
+    }
+
     /*
      * Pushes the specified URLs onto the list of unopened URLs.
      */
@@ -493,7 +504,7 @@
     }
 
     /**
-     * Inner class used to represent a loader of resources and classes
+     * Nested class used to represent a loader of resources and classes
      * from a base URL.
      */
     private static class Loader implements Closeable {
@@ -600,7 +611,8 @@
          * close this loader and release all resources
          * method overridden in sub-classes
          */
-        public void close () throws IOException {
+        @Override
+        public void close() throws IOException {
             if (jarfile != null) {
                 jarfile.close();
             }
@@ -615,7 +627,7 @@
     }
 
     /*
-     * Inner class used to represent a Loader of resources from a JAR URL.
+     * Nested class class used to represent a Loader of resources from a JAR URL.
      */
     static class JarLoader extends Loader {
         private JarFile jar;
@@ -798,7 +810,7 @@
 
 
         /*
-         * Returns true iff atleast one resource in the jar file has the same
+         * Returns true iff at least one resource in the jar file has the same
          * package name as that of the specified resource name.
          */
         boolean validIndex(final String name) {
@@ -826,6 +838,7 @@
         /*
          * Returns the URL for a resource with the specified name
          */
+        @Override
         URL findResource(final String name, boolean check) {
             Resource rsc = getResource(name, check);
             if (rsc != null) {
@@ -837,6 +850,7 @@
         /*
          * Returns the JAR Resource for the specified name.
          */
+        @Override
         Resource getResource(final String name, boolean check) {
             try {
                 ensureOpen();
@@ -863,7 +877,6 @@
          */
         Resource getResource(final String name, boolean check,
                              Set<String> visited) {
-
             Resource res;
             String[] jarFiles;
             int count = 0;
@@ -919,7 +932,6 @@
                         continue;
                     }
 
-
                     /* Note that the addition of the url to the list of visited
                      * jars incorporates a check for presence in the hashmap
                      */
@@ -975,6 +987,7 @@
         /*
          * Returns the JAR file local class path, or null if none.
          */
+        @Override
         URL[] getClassPath() throws IOException {
             if (index != null) {
                 return null;
@@ -1002,7 +1015,7 @@
          * Parses value of the Class-Path manifest attribute and returns
          * an array of URLs relative to the specified base URL.
          */
-        private URL[] parseClassPath(URL base, String value)
+        private static URL[] parseClassPath(URL base, String value)
             throws MalformedURLException
         {
             StringTokenizer st = new StringTokenizer(value);
@@ -1018,7 +1031,7 @@
     }
 
     /*
-     * Inner class used to represent a loader of classes and resources
+     * Nested class used to represent a loader of classes and resources
      * from a file URL that refers to a directory.
      */
     private static class FileLoader extends Loader {
@@ -1038,6 +1051,7 @@
         /*
          * Returns the URL for a resource with the specified name
          */
+        @Override
         URL findResource(final String name, boolean check) {
             Resource rsc = getResource(name, check);
             if (rsc != null) {
@@ -1046,6 +1060,7 @@
             return null;
         }
 
+        @Override
         Resource getResource(final String name, boolean check) {
             final URL url;
             try {
diff --git a/jdk/src/java.base/share/classes/jdk/internal/logger/DefaultLoggerFinder.java b/jdk/src/java.base/share/classes/jdk/internal/logger/DefaultLoggerFinder.java
index 397ddba..5ffd8fd 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/logger/DefaultLoggerFinder.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/logger/DefaultLoggerFinder.java
@@ -30,10 +30,10 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.function.Function;
+import java.util.Objects;
 import java.lang.System.LoggerFinder;
 import java.lang.System.Logger;
 import java.lang.ref.ReferenceQueue;
-import java.lang.reflect.Module;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Collection;
@@ -155,6 +155,8 @@
 
     @Override
     public final Logger getLogger(String name,  Module module) {
+        Objects.requireNonNull(name, "name");
+        Objects.requireNonNull(module, "module");
         checkPermission();
         return demandLoggerFor(name, module);
     }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java b/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java
index 6c65426..c266caa 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java
@@ -31,7 +31,6 @@
 import java.lang.System.LoggerFinder;
 import java.lang.System.Logger;
 import java.lang.ref.WeakReference;
-import java.lang.reflect.Module;
 import java.util.Objects;
 import jdk.internal.misc.VM;
 import sun.util.logging.PlatformLogger;
@@ -402,10 +401,10 @@
      * @param module The module on behalf of which the logger is created.
      *               If the module is not loaded from the Boot ClassLoader,
      *               the LoggerFinder is accessed and the logger returned
-     *               by {@link LoggerFinder#getLogger(java.lang.String, java.lang.reflect.Module)}
+     *               by {@link LoggerFinder#getLogger(java.lang.String, java.lang.Module)}
      *               is returned to the caller directly.
      *               Otherwise, the logger returned by
-     *               {@link #getLazyLogger(java.lang.String, java.lang.reflect.Module)}
+     *               {@link #getLazyLogger(java.lang.String, java.lang.Module)}
      *               is returned to the caller.
      *
      * @return  a (possibly lazy) Logger instance.
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
index 6838111..ece20d8 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,16 +27,18 @@
 
 import java.io.IOException;
 import java.lang.annotation.Annotation;
+import java.lang.module.ModuleDescriptor;
 import java.lang.reflect.Executable;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
+import java.net.URI;
 import java.net.URL;
 import java.security.AccessControlContext;
+import java.security.ProtectionDomain;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Stream;
 
+import jdk.internal.module.ServicesCatalog;
 import jdk.internal.reflect.ConstantPool;
 import sun.reflect.annotation.AnnotationType;
 import sun.nio.ch.Interruptible;
@@ -139,17 +141,17 @@
     void invokeFinalize(Object o) throws Throwable;
 
     /**
-     * Returns the boot Layer
-     */
-    Layer getBootLayer();
-
-    /**
      * Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s)
      * associated with the given class loader, creating it if it doesn't already exist.
      */
     ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl);
 
     /**
+     * Defines a class with the given name to a class loader.
+     */
+    Class<?> defineClass(ClassLoader cl, String name, byte[] b, ProtectionDomain pd, String source);
+
+    /**
      * Returns a class loaded by the bootstrap class loader.
      */
     Class<?> findBootstrapClassOrNull(ClassLoader cl, String name);
@@ -174,4 +176,79 @@
      * Invokes Long.fastUUID
      */
     String fastUUID(long lsb, long msb);
+
+    /**
+     * Invalidate package access cache
+     */
+    void invalidatePackageAccessCache();
+
+    /**
+     * Defines a new module to the Java virtual machine. The module
+     * is defined to the given class loader.
+     *
+     * The URI is for information purposes only, it can be {@code null}.
+     */
+    Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri);
+
+    /**
+     * Defines the unnamed module for the given class loader.
+     */
+    Module defineUnnamedModule(ClassLoader loader);
+
+    /**
+     * Updates the readability so that module m1 reads m2. The new read edge
+     * does not result in a strong reference to m2 (m2 can be GC'ed).
+     *
+     * This method is the same as m1.addReads(m2) but without a permission check.
+     */
+    void addReads(Module m1, Module m2);
+
+    /**
+     * Updates module m to read all unnamed modules.
+     */
+    void addReadsAllUnnamed(Module m);
+
+    /**
+     * Updates module m1 to export a package to module m2. The export does
+     * not result in a strong reference to m2 (m2 can be GC'ed).
+     */
+    void addExports(Module m1, String pkg, Module m2);
+
+    /**
+     * Updates a module m to export a package to all unnamed modules.
+     */
+    void addExportsToAllUnnamed(Module m, String pkg);
+
+    /**
+     * Updates module m1 to open a package to module m2. Opening the
+     * package does not result in a strong reference to m2 (m2 can be GC'ed).
+     */
+    void addOpens(Module m1, String pkg, Module m2);
+
+    /**
+     * Updates a module m to open a package to all unnamed modules.
+     */
+    void addOpensToAllUnnamed(Module m, String pkg);
+
+    /**
+     * Updates a module m to use a service.
+     */
+    void addUses(Module m, Class<?> service);
+
+    /**
+     * Returns the ServicesCatalog for the given Layer.
+     */
+    ServicesCatalog getServicesCatalog(ModuleLayer layer);
+
+    /**
+     * Returns an ordered stream of layers. The first element is is the
+     * given layer, the remaining elements are its parents, in DFS order.
+     */
+    Stream<ModuleLayer> layers(ModuleLayer layer);
+
+    /**
+     * Returns a stream of the layers that have modules defined to the
+     * given class loader.
+     */
+    Stream<ModuleLayer> layers(ClassLoader loader);
 }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java
index eed7a2d..9ad1d5c 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,20 +59,21 @@
      */
     ModuleDescriptor.Builder newModuleBuilder(String mn,
                                               boolean strict,
-                                              boolean open,
-                                              boolean synthetic);
+                                              Set<ModuleDescriptor.Modifier> ms);
 
     /**
-     * Returns the set of packages that are exported (unconditionally or
-     * unconditionally).
+     * Returns a snapshot of the packages in the module.
      */
-    Set<String> exportedPackages(ModuleDescriptor.Builder builder);
+    Set<String> packages(ModuleDescriptor.Builder builder);
 
     /**
-     * Returns the set of packages that are opened (unconditionally or
-     * unconditionally).
+     * Adds a dependence on a module with the given (possibly un-parsable)
+     * version string.
      */
-    Set<String> openPackages(ModuleDescriptor.Builder builder);
+    void requires(ModuleDescriptor.Builder builder,
+                  Set<Requires.Modifier> ms,
+                  String mn,
+                  String rawCompiledVersion);
 
     /**
      * Returns a {@code ModuleDescriptor.Requires} of the given modifiers
@@ -114,23 +115,11 @@
     Provides newProvides(String service, List<String> providers);
 
     /**
-     * Returns a {@code ModuleDescriptor.Version} of the given version.
-     */
-    Version newVersion(String v);
-
-    /**
-     * Clones the given module descriptor with an augmented set of packages
-     */
-    ModuleDescriptor newModuleDescriptor(ModuleDescriptor md, Set<String> pkgs);
-
-    /**
      * Returns a new {@code ModuleDescriptor} instance.
      */
     ModuleDescriptor newModuleDescriptor(String name,
                                          Version version,
-                                         boolean open,
-                                         boolean automatic,
-                                         boolean synthetic,
+                                         Set<ModuleDescriptor.Modifier> ms,
                                          Set<Requires> requires,
                                          Set<Exports> exports,
                                          Set<Opens> opens,
@@ -138,9 +127,6 @@
                                          Set<Provides> provides,
                                          Set<String> packages,
                                          String mainClass,
-                                         String osName,
-                                         String osArch,
-                                         String osVersion,
                                          int hashCode);
 
     /**
@@ -148,9 +134,9 @@
      * and the empty configuration as the parent. The post resolution
      * checks are optionally run.
      */
-    Configuration resolveRequiresAndUses(ModuleFinder finder,
-                                         Collection<String> roots,
-                                         boolean check,
-                                         PrintStream traceOutput);
+    Configuration resolveAndBind(ModuleFinder finder,
+                                 Collection<String> roots,
+                                 boolean check,
+                                 PrintStream traceOutput);
 
 }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java
deleted file mode 100644
index 7bf6a1f..0000000
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.internal.misc;
-
-import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-import java.net.URI;
-import java.util.stream.Stream;
-
-import jdk.internal.module.ServicesCatalog;
-
-/**
- * Provides access to non-public methods in java.lang.reflect.Module
- */
-
-public interface JavaLangReflectModuleAccess {
-
-    /**
-     * Defines the unnamed module for the given class loader.
-     */
-    Module defineUnnamedModule(ClassLoader loader);
-
-    /**
-     * Defines a new module to the Java virtual machine. The module
-     * is defined to the given class loader.
-     *
-     * The URI is for information purposes only, it can be {@code null}.
-     */
-    Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri);
-
-    /**
-     * Updates the readability so that module m1 reads m2. The new read edge
-     * does not result in a strong reference to m2 (m2 can be GC'ed).
-     *
-     * This method is the same as m1.addReads(m2) but without a permission check.
-     */
-    void addReads(Module m1, Module m2);
-
-    /**
-     * Updates module m to read all unnamed modules.
-     */
-    void addReadsAllUnnamed(Module m);
-
-    /**
-     * Updates module m1 to export a package to module m2. The export does
-     * not result in a strong reference to m2 (m2 can be GC'ed).
-     */
-    void addExports(Module m1, String pkg, Module m2);
-
-    /**
-     * Updates module m1 to open a package to module m2. Opening the
-     * package does not result in a strong reference to m2 (m2 can be GC'ed).
-     */
-    void addOpens(Module m1, String pkg, Module m2);
-
-    /**
-     * Updates a module m to export a package to all modules.
-     */
-    void addExportsToAll(Module m, String pkg);
-
-    /**
-     * Updates a module m to open a package to all modules.
-     */
-    void addOpensToAll(Module m, String pkg);
-
-    /**
-     * Updates a module m to export a package to all unnamed modules.
-     */
-    void addExportsToAllUnnamed(Module m, String pkg);
-
-    /**
-     * Updates a module m to open a package to all unnamed modules.
-     */
-    void addOpensToAllUnnamed(Module m, String pkg);
-
-    /**
-     * Updates a module m to use a service.
-     */
-    void addUses(Module m, Class<?> service);
-
-    /**
-     * Add a package to the given module.
-     */
-    void addPackage(Module m, String pkg);
-
-    /**
-     * Returns the ServicesCatalog for the given Layer.
-     */
-    ServicesCatalog getServicesCatalog(Layer layer);
-
-    /**
-     * Returns an ordered stream of layers. The first element is is the
-     * given layer, the remaining elements are its parents, in DFS order.
-     */
-    Stream<Layer> layers(Layer layer);
-
-    /**
-     * Returns a stream of the layers that have modules defined to the
-     * given class loader.
-     */
-    Stream<Layer> layers(ClassLoader loader);
-
-    /**
-     * Tests if a module exports a package at least {@code other} via its
-     * module declaration.
-     *
-     * @apiNote This is a temporary method for debugging features.
-     */
-    boolean isStaticallyExported(Module module, String pn, Module other);
-}
\ No newline at end of file
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaNetURLAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaNetURLAccess.java
new file mode 100644
index 0000000..37e8fd3
--- /dev/null
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaNetURLAccess.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.internal.misc;
+
+import java.net.URL;
+import java.net.URLStreamHandler;
+
+public interface JavaNetURLAccess {
+    URLStreamHandler getHandler(URL u);
+}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java
index b137c3d..c0eb99d 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java
@@ -25,7 +25,6 @@
 
 package jdk.internal.misc;
 
-import java.lang.reflect.Module;
 import java.util.Locale;
 import java.util.ResourceBundle;
 
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java b/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
index 36514cb..cd54d42 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,6 @@
     private static JavaUtilJarAccess javaUtilJarAccess;
     private static JavaLangAccess javaLangAccess;
     private static JavaLangModuleAccess javaLangModuleAccess;
-    private static JavaLangReflectModuleAccess javaLangReflectModuleAccess;
     private static JavaLangInvokeAccess javaLangInvokeAccess;
     private static JavaLangRefAccess javaLangRefAccess;
     private static JavaIOAccess javaIOAccess;
@@ -58,6 +57,7 @@
     private static JavaNetHttpCookieAccess javaNetHttpCookieAccess;
     private static JavaNetSocketAccess javaNetSocketAccess;
     private static JavaNetUriAccess javaNetUriAccess;
+    private static JavaNetURLAccess javaNetURLAccess;
     private static JavaNetURLClassLoaderAccess javaNetURLClassLoaderAccess;
     private static JavaNioAccess javaNioAccess;
     private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
@@ -118,16 +118,6 @@
         return javaLangModuleAccess;
     }
 
-    public static void setJavaLangReflectModuleAccess(JavaLangReflectModuleAccess jlrma) {
-        javaLangReflectModuleAccess = jlrma;
-    }
-
-    public static JavaLangReflectModuleAccess getJavaLangReflectModuleAccess() {
-        if (javaLangReflectModuleAccess == null)
-            unsafe.ensureClassInitialized(java.lang.reflect.Module.class);
-        return javaLangReflectModuleAccess;
-    }
-
     public static void setJavaLangRefAccess(JavaLangRefAccess jlra) {
         javaLangRefAccess = jlra;
     }
@@ -146,6 +136,16 @@
         return javaNetUriAccess;
     }
 
+    public static void setJavaNetURLAccess(JavaNetURLAccess jnua) {
+        javaNetURLAccess = jnua;
+    }
+
+    public static JavaNetURLAccess getJavaNetURLAccess() {
+        if (javaNetURLAccess == null)
+            unsafe.ensureClassInitialized(java.net.URL.class);
+        return javaNetURLAccess;
+    }
+
     public static void setJavaNetURLClassLoaderAccess(JavaNetURLClassLoaderAccess jnua) {
         javaNetURLClassLoaderAccess = jnua;
     }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/Builder.java b/jdk/src/java.base/share/classes/jdk/internal/module/Builder.java
index 2ef9c11..2792ccc 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/Builder.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/Builder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
 import jdk.internal.misc.SharedSecrets;
 
 /**
- * This builder is optimized for reconstituting ModuleDescriptor
+ * This builder is optimized for reconstituting the {@code ModuleDescriptor}s
  * for system modules.  The validation should be done at jlink time.
  *
  * 1. skip name validation
@@ -136,9 +136,7 @@
     }
 
     final String name;
-    boolean open;
-    boolean automatic;
-    boolean synthetic;
+    boolean open, synthetic, mandated;
     Set<Requires> requires;
     Set<Exports> exports;
     Set<Opens> opens;
@@ -147,9 +145,6 @@
     Set<Provides> provides;
     Version version;
     String mainClass;
-    String osName;
-    String osArch;
-    String osVersion;
 
     Builder(String name) {
         this.name = name;
@@ -165,13 +160,13 @@
         return this;
     }
 
-    Builder automatic(boolean value) {
-        this.automatic = value;
+    Builder synthetic(boolean value) {
+        this.synthetic = value;
         return this;
     }
 
-    Builder synthetic(boolean value) {
-        this.synthetic = value;
+    Builder mandated(boolean value) {
+        this.mandated = value;
         return this;
     }
 
@@ -228,13 +223,10 @@
      *
      * @throws IllegalArgumentException if {@code v} is null or cannot be
      *         parsed as a version string
-     * @throws IllegalStateException if the module version is already set
      *
      * @see Version#parse(String)
      */
     public Builder version(String v) {
-        if (version != null)
-            throw new IllegalStateException("module version already set");
         Version ver = cachedVersion;
         if (ver != null && v.equals(ver.toString())) {
             version = ver;
@@ -246,50 +238,29 @@
 
     /**
      * Sets the module main class.
-     *
-     * @throws IllegalStateException if already set
      */
     public Builder mainClass(String mc) {
-        if (mainClass != null)
-            throw new IllegalStateException("main class already set");
         mainClass = mc;
         return this;
     }
 
     /**
-     * Sets the OS name.
-     *
-     * @throws IllegalStateException if already set
+     * Returns an immutable set of the module modifiers derived from the flags.
      */
-    public Builder osName(String name) {
-        if (osName != null)
-            throw new IllegalStateException("OS name already set");
-        this.osName = name;
-        return this;
-    }
-
-    /**
-     * Sets the OS arch.
-     *
-     * @throws IllegalStateException if already set
-     */
-    public Builder osArch(String arch) {
-        if (osArch != null)
-            throw new IllegalStateException("OS arch already set");
-        this.osArch = arch;
-        return this;
-    }
-
-    /**
-     * Sets the OS version.
-     *
-     * @throws IllegalStateException if already set
-     */
-    public Builder osVersion(String version) {
-        if (osVersion != null)
-            throw new IllegalStateException("OS version already set");
-        this.osVersion = version;
-        return this;
+    private Set<ModuleDescriptor.Modifier> modifiers() {
+        int n = 0;
+        if (open) n++;
+        if (synthetic) n++;
+        if (mandated) n++;
+        if (n == 0) {
+            return Collections.emptySet();
+        } else {
+            ModuleDescriptor.Modifier[] mods = new ModuleDescriptor.Modifier[n];
+            if (open) mods[--n] = ModuleDescriptor.Modifier.OPEN;
+            if (synthetic) mods[--n] = ModuleDescriptor.Modifier.SYNTHETIC;
+            if (mandated) mods[--n] = ModuleDescriptor.Modifier.MANDATED;
+            return Set.of(mods);
+        }
     }
 
     /**
@@ -297,12 +268,9 @@
      */
     public ModuleDescriptor build(int hashCode) {
         assert name != null;
-
         return JLMA.newModuleDescriptor(name,
                                         version,
-                                        open,
-                                        automatic,
-                                        synthetic,
+                                        modifiers(),
                                         requires,
                                         exports,
                                         opens,
@@ -310,9 +278,6 @@
                                         provides,
                                         packages,
                                         mainClass,
-                                        osName,
-                                        osArch,
-                                        osVersion,
                                         hashCode);
     }
 }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/Checks.java b/jdk/src/java.base/share/classes/jdk/internal/module/Checks.java
index 2fdeaab..3271283 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/Checks.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/Checks.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 package jdk.internal.module;
 
 /**
- * Utility class for checking module name and binary names.
+ * Utility class for checking module, package, and class names.
  */
 
 public final class Checks {
@@ -58,8 +58,6 @@
             throw new IllegalArgumentException(name + ": Invalid module name"
                     + ": '" + id + "' is not a Java identifier");
         }
-        //if (!Character.isJavaIdentifierStart(last))
-        //    throw new IllegalArgumentException(name + ": Module name ends in digit");
         return name;
     }
 
@@ -77,8 +75,6 @@
         int last = isJavaIdentifier(name, off, name.length() - off);
         if (last == -1)
             return false;
-        //if (!Character.isJavaIdentifierStart(last))
-        //    return false;
         return true;
     }
 
@@ -89,40 +85,62 @@
      *         package name
      */
     public static String requirePackageName(String name) {
-        return requireBinaryName("package name", name);
+        return requireTypeName("package name", name);
     }
 
     /**
-     * Checks a name to ensure that it's a legal type name.
+     * Returns {@code true} if the given name is a legal package name.
+     */
+    public static boolean isPackageName(String name) {
+        return isTypeName(name);
+    }
+
+    /**
+     * Checks a name to ensure that it's a legal qualified class name
      *
      * @throws IllegalArgumentException if name is null or not a legal
-     *         type name
+     *         qualified class name
      */
     public static String requireServiceTypeName(String name) {
-        return requireBinaryName("service type name", name);
+        return requireQualifiedClassName("service type name", name);
     }
 
     /**
-     * Checks a name to ensure that it's a legal type name.
+     * Checks a name to ensure that it's a legal qualified class name.
      *
      * @throws IllegalArgumentException if name is null or not a legal
-     *         type name
+     *         qualified class name
      */
     public static String requireServiceProviderName(String name) {
-        return requireBinaryName("service provider name", name);
+        return requireQualifiedClassName("service provider name", name);
     }
 
     /**
-     * Returns {@code true} if the given name is a legal binary name.
+     * Checks a name to ensure that it's a legal qualified class name in
+     * a named package.
+     *
+     * @throws IllegalArgumentException if name is null or not a legal
+     *         qualified class name in a named package
      */
-    public static boolean isJavaIdentifier(String name) {
-        return isBinaryName(name);
+    public static String requireQualifiedClassName(String what, String name) {
+        requireTypeName(what, name);
+        if (name.indexOf('.') == -1)
+            throw new IllegalArgumentException(name + ": is not a qualified name of"
+                                               + " a Java class in a named package");
+        return name;
     }
 
     /**
-     * Returns {@code true} if the given name is a legal binary name.
+     * Returns {@code true} if the given name is a legal class name.
      */
-    public static boolean isBinaryName(String name) {
+    public static boolean isClassName(String name) {
+        return isTypeName(name);
+    }
+
+    /**
+     * Returns {@code true} if the given name is a legal type name.
+     */
+    private static boolean isTypeName(String name) {
         int next;
         int off = 0;
         while ((next = name.indexOf('.', off)) != -1) {
@@ -135,12 +153,12 @@
     }
 
     /**
-     * Checks if the given name is a legal binary name.
+     * Checks if the given name is a legal type name.
      *
      * @throws IllegalArgumentException if name is null or not a legal
-     *         binary name
+     *         type name
      */
-    public static String requireBinaryName(String what, String name) {
+    private static String requireTypeName(String what, String name) {
         if (name == null)
             throw new IllegalArgumentException("Null " + what);
         int next;
@@ -162,41 +180,38 @@
     }
 
     /**
-     * Returns {@code true} if the last character of the given name is legal
-     * as the last character of a module name.
-     *
-     * @throws IllegalArgumentException if name is empty
+     * Returns {@code true} if a given legal module name contains an identifier
+     * that doesn't end with a Java letter.
      */
-    public static boolean hasLegalModuleNameLastCharacter(String name) {
-        if (name.isEmpty())
-            throw new IllegalArgumentException("name is empty");
-        int len = name.length();
-        if (isASCIIString(name)) {
-            char c = name.charAt(len-1);
-            return Character.isJavaIdentifierStart(c);
-        } else {
-            int i = 0;
-            int cp = -1;
-            while (i < len) {
-                cp = name.codePointAt(i);
-                i += Character.charCount(cp);
-            }
-            return Character.isJavaIdentifierStart(cp);
-        }
-    }
-
-    /**
-     * Returns true if the given string only contains ASCII characters.
-     */
-    private static boolean isASCIIString(String s) {
+    public static boolean hasJavaIdentifierWithTrailingDigit(String name) {
+        // quick scan to allow names that are just ASCII without digits
+        boolean needToParse = false;
         int i = 0;
-        while (i < s.length()) {
-            int c = s.charAt(i);
-            if (c > 0x7F)
-                return false;
+        while (i < name.length()) {
+            int c = name.charAt(i);
+            if (c > 0x7F || (c >= '0' && c <= '9')) {
+                needToParse = true;
+                break;
+            }
             i++;
         }
-        return true;
+        if (!needToParse)
+            return false;
+
+        // slow path
+        int next;
+        int off = 0;
+        while ((next = name.indexOf('.', off)) != -1) {
+            int last = isJavaIdentifier(name, off, (next - off));
+            if (!Character.isJavaIdentifierStart(last))
+                return true;
+            off = next+1;
+        }
+        int last = isJavaIdentifier(name, off, name.length() - off);
+        if (!Character.isJavaIdentifierStart(last))
+            return true;
+        return false;
+
     }
 
     /**
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileAttributes.java b/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileAttributes.java
index 69c7ee6..6d88162 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileAttributes.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileAttributes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 package jdk.internal.module;
 
 import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Builder;
 import java.lang.module.ModuleDescriptor.Requires;
 import java.lang.module.ModuleDescriptor.Exports;
 import java.lang.module.ModuleDescriptor.Opens;
@@ -98,14 +99,17 @@
 
             // module_flags
             int module_flags = cr.readUnsignedShort(off);
-            boolean open = ((module_flags & ACC_OPEN) != 0);
-            boolean synthetic = ((module_flags & ACC_SYNTHETIC) != 0);
             off += 2;
 
-            ModuleDescriptor.Builder builder = JLMA.newModuleBuilder(mn,
-                                                                     false,
-                                                                     open,
-                                                                     synthetic);
+            Set<ModuleDescriptor.Modifier> modifiers = new HashSet<>();
+            if ((module_flags & ACC_OPEN) != 0)
+                modifiers.add(ModuleDescriptor.Modifier.OPEN);
+            if ((module_flags & ACC_SYNTHETIC) != 0)
+                modifiers.add(ModuleDescriptor.Modifier.SYNTHETIC);
+            if ((module_flags & ACC_MANDATED) != 0)
+                modifiers.add(ModuleDescriptor.Modifier.MANDATED);
+
+            Builder builder = JLMA.newModuleBuilder(mn, false, modifiers);
 
             // module_version
             String module_version = cr.readUTF8(off, buf);
@@ -142,19 +146,13 @@
                         mods.add(Requires.Modifier.MANDATED);
                 }
 
-
                 // requires_version
-                Version compiledVersion = null;
                 String requires_version = cr.readUTF8(off, buf);
                 off += 2;
-                if (requires_version != null) {
-                    compiledVersion = Version.parse(requires_version);
-                }
-
-                if (compiledVersion == null) {
+                if (requires_version == null) {
                     builder.requires(mods, dn);
                 } else {
-                    builder.requires(mods, dn, compiledVersion);
+                    JLMA.requires(builder, mods, dn, requires_version);
                 }
             }
 
@@ -283,19 +281,22 @@
             attr.putShort(module_name_index);
 
             // module_flags
+            Set<ModuleDescriptor.Modifier> modifiers = descriptor.modifiers();
             int module_flags = 0;
-            if (descriptor.isOpen())
+            if (modifiers.contains(ModuleDescriptor.Modifier.OPEN))
                 module_flags |= ACC_OPEN;
-            if (descriptor.isSynthetic())
+            if (modifiers.contains(ModuleDescriptor.Modifier.SYNTHETIC))
                 module_flags |= ACC_SYNTHETIC;
+            if (modifiers.contains(ModuleDescriptor.Modifier.MANDATED))
+                module_flags |= ACC_MANDATED;
             attr.putShort(module_flags);
 
             // module_version
-            Version v = descriptor.version().orElse(null);
-            if (v == null) {
+            String vs = descriptor.rawVersion().orElse(null);
+            if (vs == null) {
                 attr.putShort(0);
             } else {
-                int module_version_index = cw.newUTF8(v.toString());
+                int module_version_index = cw.newUTF8(vs);
                 attr.putShort(module_version_index);
             }
 
@@ -319,11 +320,11 @@
                 attr.putShort(requires_flags);
 
                 int requires_version_index;
-                v = r.compiledVersion().orElse(null);
-                if (v == null) {
+                vs = r.rawCompiledVersion().orElse(null);
+                if (vs == null) {
                     requires_version_index = 0;
                 } else {
-                    requires_version_index = cw.newUTF8(v.toString());
+                    requires_version_index = cw.newUTF8(vs);
                 }
                 attr.putShort(requires_version_index);
             }
@@ -552,8 +553,6 @@
      *   u2 os_name_index;
      *   // index to CONSTANT_utf8_info structure with the OS arch
      *   u2 os_arch_index
-     *   // index to CONSTANT_utf8_info structure with the OS version
-     *   u2 os_version_index;
      * }
      *
      * } </pre>
@@ -561,17 +560,23 @@
     public static class ModuleTargetAttribute extends Attribute {
         private final String osName;
         private final String osArch;
-        private final String osVersion;
 
-        public ModuleTargetAttribute(String osName, String osArch, String osVersion) {
+        public ModuleTargetAttribute(String osName, String osArch) {
             super(MODULE_TARGET);
             this.osName = osName;
             this.osArch = osArch;
-            this.osVersion = osVersion;
         }
 
         public ModuleTargetAttribute() {
-            this(null, null, null);
+            this(null, null);
+        }
+
+        public String osName() {
+            return osName;
+        }
+
+        public String osArch() {
+            return osArch;
         }
 
         @Override
@@ -585,7 +590,6 @@
 
             String osName = null;
             String osArch = null;
-            String osVersion = null;
 
             int name_index = cr.readUnsignedShort(off);
             if (name_index != 0)
@@ -597,12 +601,7 @@
                 osArch = cr.readUTF8(off, buf);
             off += 2;
 
-            int version_index = cr.readUnsignedShort(off);
-            if (version_index != 0)
-                osVersion = cr.readUTF8(off, buf);
-            off += 2;
-
-            return new ModuleTargetAttribute(osName, osArch, osVersion);
+            return new ModuleTargetAttribute(osName, osArch);
         }
 
         @Override
@@ -624,11 +623,6 @@
                 arch_index = cw.newUTF8(osArch);
             attr.putShort(arch_index);
 
-            int version_index = 0;
-            if (osVersion != null && osVersion.length() > 0)
-                version_index = cw.newUTF8(osVersion);
-            attr.putShort(version_index);
-
             return attr;
         }
     }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileConstants.java b/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileConstants.java
index 48fe536..66e241e 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileConstants.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ClassFileConstants.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,8 +46,8 @@
     // access, requires, exports, and opens flags
     public static final int ACC_MODULE        = 0x8000;
     public static final int ACC_OPEN          = 0x0020;
-    public static final int ACC_TRANSITIVE    = 0x0010;
-    public static final int ACC_STATIC_PHASE  = 0x0020;
+    public static final int ACC_TRANSITIVE    = 0x0020;
+    public static final int ACC_STATIC_PHASE  = 0x0040;
     public static final int ACC_SYNTHETIC     = 0x1000;
     public static final int ACC_MANDATED      = 0x8000;
 
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java b/jdk/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java
new file mode 100644
index 0000000..3914ce9
--- /dev/null
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java
@@ -0,0 +1,344 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.module;
+
+import java.io.PrintStream;
+import java.lang.invoke.MethodHandles;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.CodeSource;
+import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.WeakHashMap;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+
+import jdk.internal.loader.BootLoader;
+import sun.security.action.GetPropertyAction;
+
+/**
+ * Supports logging of access to members of API packages that are exported or
+ * opened via backdoor mechanisms to code in unnamed modules.
+ */
+
+public final class IllegalAccessLogger {
+
+    /**
+     * Holder class to lazily create the StackWalker object and determine
+     * if the stack trace should be printed
+     */
+    static class Holder {
+        static final StackWalker STACK_WALKER;
+        static final boolean PRINT_STACK_TRACE;
+
+        static {
+            PrivilegedAction<StackWalker> pa = () ->
+                StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE);
+            STACK_WALKER = AccessController.doPrivileged(pa);
+
+            String name = "sun.reflect.debugModuleAccessChecks";
+            String value = GetPropertyAction.privilegedGetProperty(name, null);
+            PRINT_STACK_TRACE = "access" .equals(value);
+        }
+    }
+
+    // the maximum number of frames to capture
+    private static final int MAX_STACK_FRAMES = 32;
+
+    // lock to avoid interference when printing stack traces
+    private static final Object OUTPUT_LOCK = new Object();
+
+    // caller -> usages
+    private final Map<Class<?>, Set<Usage>> callerToUsages = new WeakHashMap<>();
+
+    // module -> (package name -> CLI option)
+    private final Map<Module, Map<String, String>> exported;
+    private final Map<Module, Map<String, String>> opened;
+
+    // the print stream to send the warnings
+    private final PrintStream warningStream;
+
+    private IllegalAccessLogger(Map<Module, Map<String, String>> exported,
+                                Map<Module, Map<String, String>> opened,
+                                PrintStream warningStream) {
+        this.exported = deepCopy(exported);
+        this.opened = deepCopy(opened);
+        this.warningStream = warningStream;
+    }
+
+    /**
+     * Returns that a Builder that is seeded with the packages known to this logger.
+     */
+    public Builder toBuilder() {
+        return new Builder(exported, opened);
+    }
+
+    /**
+     * Logs access to the member of a target class by a caller class if the class
+     * is in a package that is exported via a backdoor mechanism.
+     *
+     * The {@code whatSupplier} supplies the message that describes the member.
+     */
+    public void logIfExportedByBackdoor(Class<?> caller,
+                                        Class<?> target,
+                                        Supplier<String> whatSupplier) {
+        Map<String, String> packages = exported.get(target.getModule());
+        if (packages != null) {
+            String how = packages.get(target.getPackageName());
+            if (how != null) {
+                log(caller, whatSupplier.get(), how);
+            }
+        }
+    }
+
+    /**
+     * Logs access to the member of a target class by a caller class if the class
+     * is in a package that is opened via a backdoor mechanism.
+     *
+     * The {@code what} parameter supplies the message that describes the member.
+     */
+    public void logIfOpenedByBackdoor(Class<?> caller,
+                                      Class<?> target,
+                                      Supplier<String> whatSupplier) {
+        Map<String, String> packages = opened.get(target.getModule());
+        if (packages != null) {
+            String how = packages.get(target.getPackageName());
+            if (how != null) {
+                log(caller, whatSupplier.get(), how);
+            }
+        }
+    }
+
+    /**
+     * Logs access by a caller class. The {@code what} parameter describes
+     * the member is accessed, the {@code how} parameter is the means by which
+     * access is allocated (CLI option for example).
+     */
+    private void log(Class<?> caller, String what, String how) {
+        log(caller, what, () -> {
+            PrivilegedAction<ProtectionDomain> pa = caller::getProtectionDomain;
+            CodeSource cs = AccessController.doPrivileged(pa).getCodeSource();
+            URL url = (cs != null) ? cs.getLocation() : null;
+            String source = caller.getName();
+            if (url != null)
+                source += " (" + url + ")";
+            return "WARNING: Illegal access by " + source + " to " + what
+                    + " (permitted by " + how + ")";
+        });
+    }
+
+
+    /**
+     * Logs access to caller class if the class is in a package that is opened via
+     * a backdoor mechanism.
+     */
+    public void logIfOpenedByBackdoor(MethodHandles.Lookup caller, Class<?> target) {
+        Map<String, String> packages = opened.get(target.getModule());
+        if (packages != null) {
+            String how = packages.get(target.getPackageName());
+            if (how != null) {
+                log(caller.lookupClass(), target.getName(), () ->
+                    "WARNING: Illegal access using Lookup on " + caller.lookupClass()
+                    + " to " + target + " (permitted by " + how + ")");
+            }
+        }
+    }
+
+    /**
+     * Log access by a caller. The {@code what} parameter describes the class or
+     * member that is being accessed. The {@code msgSupplier} supplies the log
+     * message.
+     *
+     * To reduce output, this method only logs the access if it hasn't been seen
+     * previously. "Seen previously" is implemented as a map of caller class -> Usage,
+     * where a Usage is the "what" and a hash of the stack trace. The map has weak
+     * keys so it can be expunged when the caller is GC'ed/unloaded.
+     */
+    private void log(Class<?> caller, String what, Supplier<String> msgSupplier) {
+        // stack trace without the top-most frames in java.base
+        List<StackWalker.StackFrame> stack = Holder.STACK_WALKER.walk(s ->
+            s.dropWhile(this::isJavaBase)
+             .limit(MAX_STACK_FRAMES)
+             .collect(Collectors.toList())
+        );
+
+        // check if the access has already been recorded
+        Usage u = new Usage(what, hash(stack));
+        boolean firstUsage;
+        synchronized (this) {
+            firstUsage = callerToUsages.computeIfAbsent(caller, k -> new HashSet<>()).add(u);
+        }
+
+        // log message if first usage
+        if (firstUsage) {
+            String msg = msgSupplier.get();
+            if (Holder.PRINT_STACK_TRACE) {
+                synchronized (OUTPUT_LOCK) {
+                    warningStream.println(msg);
+                    stack.forEach(f -> warningStream.println("\tat " + f));
+                }
+            } else {
+                warningStream.println(msg);
+            }
+        }
+    }
+
+    private static class Usage {
+        private final String what;
+        private final int stack;
+        Usage(String what, int stack) {
+            this.what = what;
+            this.stack = stack;
+        }
+        @Override
+        public int hashCode() {
+            return what.hashCode() ^ stack;
+        }
+        @Override
+        public boolean equals(Object ob) {
+            if (ob instanceof Usage) {
+                Usage that = (Usage)ob;
+                return what.equals(that.what) && stack == (that.stack);
+            } else {
+                return false;
+            }
+        }
+    }
+
+    /**
+     * Returns true if the stack frame is for a class in java.base.
+     */
+    private boolean isJavaBase(StackWalker.StackFrame frame) {
+        Module caller = frame.getDeclaringClass().getModule();
+        return "java.base".equals(caller.getName());
+    }
+
+    /**
+     * Computes a hash code for the give stack frames. The hash code is based
+     * on the class, method name, and BCI.
+     */
+    private int hash(List<StackWalker.StackFrame> stack) {
+        int hash = 0;
+        for (StackWalker.StackFrame frame : stack) {
+            hash = (31 * hash) + Objects.hash(frame.getDeclaringClass(),
+                                              frame.getMethodName(),
+                                              frame.getByteCodeIndex());
+        }
+        return hash;
+    }
+
+    // system-wide IllegalAccessLogger
+    private static volatile IllegalAccessLogger logger;
+
+    /**
+     * Sets the system-wide IllegalAccessLogger
+     */
+    public static void setIllegalAccessLogger(IllegalAccessLogger l) {
+        if (l.exported.isEmpty() && l.opened.isEmpty()) {
+            logger = null;
+        } else {
+            logger = l;
+        }
+    }
+
+    /**
+     * Returns the system-wide IllegalAccessLogger or {@code null} if there is
+     * no logger.
+     */
+    public static IllegalAccessLogger illegalAccessLogger() {
+        return logger;
+    }
+
+    /**
+     * A builder for IllegalAccessLogger objects.
+     */
+    public static class Builder {
+        private final Module UNNAMED = BootLoader.getUnnamedModule();
+        private Map<Module, Map<String, String>> exported;
+        private Map<Module, Map<String, String>> opened;
+        private PrintStream warningStream = System.err;
+
+        public Builder() { }
+
+        public Builder(Map<Module, Map<String, String>> exported,
+                       Map<Module, Map<String, String>> opened) {
+            this.exported = deepCopy(exported);
+            this.opened = deepCopy(opened);
+        }
+
+        public Builder logAccessToExportedPackage(Module m, String pn, String how) {
+            if (!m.isExported(pn, UNNAMED)) {
+                if (exported == null)
+                    exported = new HashMap<>();
+                exported.computeIfAbsent(m, k -> new HashMap<>()).putIfAbsent(pn, how);
+            }
+            return this;
+        }
+
+        public Builder logAccessToOpenPackage(Module m, String pn, String how) {
+            // opens implies exported at run-time.
+            logAccessToExportedPackage(m, pn, how);
+
+            if (!m.isOpen(pn, UNNAMED)) {
+                if (opened == null)
+                    opened = new HashMap<>();
+                opened.computeIfAbsent(m, k -> new HashMap<>()).putIfAbsent(pn, how);
+            }
+            return this;
+        }
+
+        public Builder warningStream(PrintStream warningStream) {
+            this.warningStream = Objects.requireNonNull(warningStream);
+            return this;
+        }
+
+        /**
+         * Builds the logger.
+         */
+        public IllegalAccessLogger build() {
+            return new IllegalAccessLogger(exported, opened, warningStream);
+        }
+    }
+
+
+    static Map<Module, Map<String, String>> deepCopy(Map<Module, Map<String, String>> map) {
+        if (map == null || map.isEmpty()) {
+            return new HashMap<>();
+        } else {
+            Map<Module, Map<String, String>> newMap = new HashMap<>();
+            for (Map.Entry<Module, Map<String, String>> e : map.entrySet()) {
+                newMap.put(e.getKey(), new HashMap<>(e.getValue()));
+            }
+            return newMap;
+        }
+    }
+}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
index 7140646..061b229 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,8 +32,6 @@
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReference;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.net.URI;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -60,7 +58,7 @@
  * resolving a set of module names specified via the launcher (or equivalent)
  * -m and --add-modules options. The modules are located on a module path that
  * is constructed from the upgrade module path, system modules, and application
- * module path. The Configuration is instantiated as the boot Layer with each
+ * module path. The Configuration is instantiated as the boot layer with each
  * module in the the configuration defined to one of the built-in class loaders.
  */
 
@@ -105,11 +103,11 @@
     }
 
     /**
-     * Initialize the module system, returning the boot Layer.
+     * Initialize the module system, returning the boot layer.
      *
      * @see java.lang.System#initPhase2()
      */
-    public static Layer boot() {
+    public static ModuleLayer boot() {
 
         long t0 = System.nanoTime();
 
@@ -236,7 +234,6 @@
             ModuleFinder f = finder;  // observable modules
             systemModules.findAll()
                 .stream()
-                .filter(mref -> !ModuleResolution.doNotResolveByDefault(mref))
                 .map(ModuleReference::descriptor)
                 .map(ModuleDescriptor::name)
                 .filter(mn -> f.find(mn).isPresent())  // observable
@@ -275,10 +272,10 @@
 
         // run the resolver to create the configuration
         Configuration cf = SharedSecrets.getJavaLangModuleAccess()
-                .resolveRequiresAndUses(finder,
-                                        roots,
-                                        needPostResolutionChecks,
-                                        traceOutput);
+                .resolveAndBind(finder,
+                                roots,
+                                needPostResolutionChecks,
+                                traceOutput);
 
         // time to create configuration
         PerfCounters.resolveTime.addElapsedTimeFrom(t3);
@@ -318,25 +315,25 @@
         // if needed check that there are no split packages in the set of
         // resolved modules for the boot layer
         if (SystemModules.hasSplitPackages() || needPostResolutionChecks) {
-                Map<String, String> packageToModule = new HashMap<>();
-                for (ResolvedModule resolvedModule : cf.modules()) {
-                    ModuleDescriptor descriptor =
-                        resolvedModule.reference().descriptor();
-                    String name = descriptor.name();
-                    for (String p : descriptor.packages()) {
-                        String other = packageToModule.putIfAbsent(p, name);
-                        if (other != null) {
-                            fail("Package " + p + " in both module "
-                                 + name + " and module " + other);
-                        }
+            Map<String, String> packageToModule = new HashMap<>();
+            for (ResolvedModule resolvedModule : cf.modules()) {
+                ModuleDescriptor descriptor = resolvedModule.reference().descriptor();
+                String name = descriptor.name();
+                for (String p : descriptor.packages()) {
+                    String other = packageToModule.putIfAbsent(p, name);
+                    if (other != null) {
+                        String msg = "Package " + p + " in both module "
+                                     + name + " and module " + other;
+                        throw new LayerInstantiationException(msg);
                     }
                 }
             }
+        }
 
         long t4 = System.nanoTime();
 
         // define modules to VM/runtime
-        Layer bootLayer = Layer.empty().defineModules(cf, clf);
+        ModuleLayer bootLayer = ModuleLayer.empty().defineModules(cf, clf);
 
         PerfCounters.layerCreateTime.addElapsedTimeFrom(t4);
 
@@ -358,7 +355,7 @@
         PerfCounters.loadModulesTime.addElapsedTimeFrom(t5);
 
 
-        // --add-reads, -add-exports/-add-opens
+        // --add-reads, --add-exports/--add-opens
         addExtraReads(bootLayer);
         addExtraExportsAndOpens(bootLayer);
 
@@ -380,10 +377,9 @@
                                             Set<String> otherMods)
     {
         // resolve all root modules
-        Configuration cf = Configuration.empty()
-                .resolveRequires(finder,
-                                 ModuleFinder.of(),
-                                 roots);
+        Configuration cf = Configuration.empty().resolve(finder,
+                                                         ModuleFinder.of(),
+                                                         roots);
 
         // module name -> reference
         Map<String, ModuleReference> map = new HashMap<>();
@@ -416,7 +412,7 @@
 
     /**
      * Creates a finder from the module path that is the value of the given
-     * system property.
+     * system property and optionally patched by --patch-module
      */
     private static ModuleFinder createModulePathFinder(String prop) {
         String s = System.getProperty(prop);
@@ -429,7 +425,7 @@
             for (String dir: dirs) {
                 paths[i++] = Paths.get(dir);
             }
-            return ModuleFinder.of(paths);
+            return ModulePath.of(patcher, paths);
         }
     }
 
@@ -475,7 +471,7 @@
      * Process the --add-reads options to add any additional read edges that
      * are specified on the command-line.
      */
-    private static void addExtraReads(Layer bootLayer) {
+    private static void addExtraReads(ModuleLayer bootLayer) {
 
         // decode the command line options
         Map<String, List<String>> map = decode("jdk.module.addreads.");
@@ -513,8 +509,7 @@
      * Process the --add-exports and --add-opens options to export/open
      * additional packages specified on the command-line.
      */
-    private static void addExtraExportsAndOpens(Layer bootLayer) {
-
+    private static void addExtraExportsAndOpens(ModuleLayer bootLayer) {
         // --add-exports
         String prefix = "jdk.module.addexports.";
         Map<String, List<String>> extraExports = decode(prefix);
@@ -528,9 +523,27 @@
         if (!extraOpens.isEmpty()) {
             addExtraExportsOrOpens(bootLayer, extraOpens, true);
         }
+
+        // --permit-illegal-access
+        if (getAndRemoveProperty("jdk.module.permitIllegalAccess") != null) {
+            warn("--permit-illegal-access will be removed in the next major release");
+            IllegalAccessLogger.Builder builder = new IllegalAccessLogger.Builder();
+            Module unnamed = BootLoader.getUnnamedModule();
+            bootLayer.modules().stream().forEach(m -> {
+                m.getDescriptor()
+                 .packages()
+                 .stream()
+                 .filter(pn -> !m.isOpen(pn, unnamed))  // skip if opened by --add-opens
+                 .forEach(pn -> {
+                     builder.logAccessToOpenPackage(m, pn, "--permit-illegal-access");
+                     Modules.addOpensToAllUnnamed(m, pn);
+                 });
+            });
+            IllegalAccessLogger.setIllegalAccessLogger(builder.build());
+        }
     }
 
-    private static void addExtraExportsOrOpens(Layer bootLayer,
+    private static void addExtraExportsOrOpens(ModuleLayer bootLayer,
                                                Map<String, List<String>> map,
                                                boolean opens)
     {
@@ -541,12 +554,12 @@
             String key = e.getKey();
             String[] s = key.split("/");
             if (s.length != 2)
-                fail(unableToParse(option,  "<module>/<package>", key));
+                fail(unableToParse(option, "<module>/<package>", key));
 
             String mn = s[0];
             String pn = s[1];
             if (mn.isEmpty() || pn.isEmpty())
-                fail(unableToParse(option,  "<module>/<package>", key));
+                fail(unableToParse(option, "<module>/<package>", key));
 
             // The exporting module is in the boot layer
             Module m;
@@ -631,7 +644,7 @@
 
             // value is <module>(,<module>)* or <file>(<pathsep><file>)*
             if (!allowDuplicates && map.containsKey(key))
-                fail(key + " specified more than once in " + option(prefix));
+                fail(key + " specified more than once to " + option(prefix));
             List<String> values = map.computeIfAbsent(key, k -> new ArrayList<>());
             int ntargets = 0;
             for (String s : rhs.split(regex)) {
@@ -675,10 +688,6 @@
             ModuleReference mref = rm.reference();
             String mn = mref.descriptor().name();
 
-            // emit warning if module name ends with a non-Java letter
-            if (!Checks.hasLegalModuleNameLastCharacter(mn))
-                warn("Module name \"" + mn + "\" may soon be illegal");
-
             // emit warning if the WARN_INCUBATING module resolution bit set
             if (ModuleResolution.hasIncubatingWarning(mref)) {
                 if (incubating == null) {
@@ -704,7 +713,7 @@
     }
 
     static void warnUnknownModule(String option, String mn) {
-        warn("Unknown module: " + mn + " specified in " + option);
+        warn("Unknown module: " + mn + " specified to " + option);
     }
 
     static String unableToParse(String option, String text, String value) {
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java
index 3aac651..b589e29 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,6 @@
 import java.lang.module.ModuleDescriptor.Requires;
 import java.lang.module.ModuleDescriptor.Exports;
 import java.lang.module.ModuleDescriptor.Opens;
-import java.lang.module.ModuleDescriptor.Version;
 import java.nio.ByteBuffer;
 import java.nio.BufferUnderflowException;
 import java.util.ArrayList;
@@ -51,7 +50,6 @@
 
 import jdk.internal.misc.JavaLangModuleAccess;
 import jdk.internal.misc.SharedSecrets;
-import jdk.internal.module.ModuleResolution;
 
 import static jdk.internal.module.ClassFileConstants.*;
 
@@ -91,18 +89,24 @@
      */
     public static final class Attributes {
         private final ModuleDescriptor descriptor;
+        private final ModuleTarget target;
         private final ModuleHashes recordedHashes;
         private final ModuleResolution moduleResolution;
         Attributes(ModuleDescriptor descriptor,
+                   ModuleTarget target,
                    ModuleHashes recordedHashes,
                    ModuleResolution moduleResolution) {
             this.descriptor = descriptor;
+            this.target = target;
             this.recordedHashes = recordedHashes;
             this.moduleResolution = moduleResolution;
         }
         public ModuleDescriptor descriptor() {
             return descriptor;
         }
+        public ModuleTarget target() {
+            return target;
+        }
         public ModuleHashes recordedHashes() {
             return recordedHashes;
         }
@@ -221,10 +225,10 @@
         Set<String> attributes = new HashSet<>();
 
         Builder builder = null;
-        Set<String> packages = null;
+        Set<String> allPackages = null;
         String mainClass = null;
-        String[] osValues = null;
-        ModuleHashes hashes = null;
+        ModuleTarget moduleTarget = null;
+        ModuleHashes moduelHashes = null;
         ModuleResolution moduleResolution = null;
 
         for (int i = 0; i < attributes_count ; i++) {
@@ -245,7 +249,7 @@
                     break;
 
                 case MODULE_PACKAGES :
-                    packages = readModulePackagesAttribute(in, cpool);
+                    allPackages = readModulePackagesAttribute(in, cpool);
                     break;
 
                 case MODULE_MAIN_CLASS :
@@ -253,12 +257,12 @@
                     break;
 
                 case MODULE_TARGET :
-                    osValues = readModuleTargetAttribute(in, cpool);
+                    moduleTarget = readModuleTargetAttribute(in, cpool);
                     break;
 
                 case MODULE_HASHES :
                     if (parseHashes) {
-                        hashes = readModuleHashesAttribute(in, cpool);
+                        moduelHashes = readModuleHashesAttribute(in, cpool);
                     } else {
                         in.skipBytes(length);
                     }
@@ -284,55 +288,46 @@
             throw invalidModuleDescriptor(MODULE + " attribute not found");
         }
 
+        // ModuleMainClass  attribute
+        if (mainClass != null) {
+            builder.mainClass(mainClass);
+        }
+
         // If the ModulePackages attribute is not present then the packageFinder
         // is used to find the set of packages
         boolean usedPackageFinder = false;
-        if (packages == null && packageFinder != null) {
+        if (allPackages == null && packageFinder != null) {
             try {
-                packages = new HashSet<>(packageFinder.get());
+                allPackages = packageFinder.get();
             } catch (UncheckedIOException x) {
                 throw x.getCause();
             }
             usedPackageFinder = true;
         }
-        if (packages != null) {
-            Set<String> exportedPackages = JLMA.exportedPackages(builder);
-            Set<String> openPackages = JLMA.openPackages(builder);
-            if (packages.containsAll(exportedPackages)
-                    && packages.containsAll(openPackages)) {
-                packages.removeAll(exportedPackages);
-                packages.removeAll(openPackages);
-            } else {
-                // the set of packages is not complete
-                Set<String> exportedAndOpenPackages = new HashSet<>();
-                exportedAndOpenPackages.addAll(exportedPackages);
-                exportedAndOpenPackages.addAll(openPackages);
-                for (String pn : exportedAndOpenPackages) {
-                    if (!packages.contains(pn)) {
-                        String tail;
-                        if (usedPackageFinder) {
-                            tail = " not found by package finder";
-                        } else {
-                            tail = " missing from ModulePackages attribute";
-                        }
-                        throw invalidModuleDescriptor("Package " + pn + tail);
-                    }
+        if (allPackages != null) {
+            Set<String> knownPackages = JLMA.packages(builder);
+            if (!allPackages.containsAll(knownPackages)) {
+                Set<String> missingPackages = new HashSet<>(knownPackages);
+                missingPackages.removeAll(allPackages);
+                assert !missingPackages.isEmpty();
+                String missingPackage = missingPackages.iterator().next();
+                String tail;
+                if (usedPackageFinder) {
+                    tail = " not found in module";
+                } else {
+                    tail = " missing from ModulePackages class file attribute";
                 }
-                assert false; // should not get here
-            }
-            builder.contains(packages);
-        }
+                throw invalidModuleDescriptor("Package " + missingPackage + tail);
 
-        if (mainClass != null)
-            builder.mainClass(mainClass);
-        if (osValues != null) {
-            if (osValues[0] != null) builder.osName(osValues[0]);
-            if (osValues[1] != null) builder.osArch(osValues[1]);
-            if (osValues[2] != null) builder.osVersion(osValues[2]);
+            }
+            builder.packages(allPackages);
         }
 
         ModuleDescriptor descriptor = builder.build();
-        return new Attributes(descriptor, hashes, moduleResolution);
+        return new Attributes(descriptor,
+                              moduleTarget,
+                              moduelHashes,
+                              moduleResolution);
     }
 
     /**
@@ -347,10 +342,17 @@
         String mn = cpool.getModuleName(module_name_index);
 
         int module_flags = in.readUnsignedShort();
-        boolean open = ((module_flags & ACC_OPEN) != 0);
-        boolean synthetic = ((module_flags & ACC_SYNTHETIC) != 0);
 
-        Builder builder = JLMA.newModuleBuilder(mn, false, open, synthetic);
+        Set<ModuleDescriptor.Modifier> modifiers = new HashSet<>();
+        boolean open = ((module_flags & ACC_OPEN) != 0);
+        if (open)
+            modifiers.add(ModuleDescriptor.Modifier.OPEN);
+        if ((module_flags & ACC_SYNTHETIC) != 0)
+            modifiers.add(ModuleDescriptor.Modifier.SYNTHETIC);
+        if ((module_flags & ACC_MANDATED) != 0)
+            modifiers.add(ModuleDescriptor.Modifier.MANDATED);
+
+        Builder builder = JLMA.newModuleBuilder(mn, false, modifiers);
 
         int module_version_index = in.readUnsignedShort();
         if (module_version_index != 0) {
@@ -381,16 +383,11 @@
             }
 
             int requires_version_index = in.readUnsignedShort();
-            Version compiledVersion = null;
-            if (requires_version_index != 0) {
-                String vs = cpool.getUtf8(requires_version_index);
-                compiledVersion = Version.parse(vs);
-            }
-
-            if (compiledVersion == null) {
+            if (requires_version_index == 0) {
                 builder.requires(mods, dn);
             } else {
-                builder.requires(mods, dn, compiledVersion);
+                String vs = cpool.getUtf8(requires_version_index);
+                JLMA.requires(builder, mods, dn, vs);
             }
 
             if (dn.equals("java.base"))
@@ -429,7 +426,11 @@
                     Set<String> targets = new HashSet<>(exports_to_count);
                     for (int j=0; j<exports_to_count; j++) {
                         int exports_to_index = in.readUnsignedShort();
-                        targets.add(cpool.getModuleName(exports_to_index));
+                        String target = cpool.getModuleName(exports_to_index);
+                        if (!targets.add(target)) {
+                            throw invalidModuleDescriptor(pkg + " exported to "
+                                                          + target + " more than once");
+                        }
                     }
                     builder.exports(mods, pkg, targets);
                 } else {
@@ -465,7 +466,11 @@
                     Set<String> targets = new HashSet<>(open_to_count);
                     for (int j=0; j<open_to_count; j++) {
                         int opens_to_index = in.readUnsignedShort();
-                        targets.add(cpool.getModuleName(opens_to_index));
+                        String target = cpool.getModuleName(opens_to_index);
+                        if (!targets.add(target)) {
+                            throw invalidModuleDescriptor(pkg + " opened to "
+                                                          + target + " more than once");
+                        }
                     }
                     builder.opens(mods, pkg, targets);
                 } else {
@@ -493,7 +498,10 @@
                 for (int j=0; j<with_count; j++) {
                     index = in.readUnsignedShort();
                     String pn = cpool.getClassName(index);
-                    providers.add(pn);
+                    if (!providers.add(pn)) {
+                        throw invalidModuleDescriptor(sn + " provides " + pn
+                                                      + " more than once");
+                    }
                 }
                 builder.provides(sn, providers);
             }
@@ -535,24 +543,21 @@
     /**
      * Reads the ModuleTarget attribute
      */
-    private String[] readModuleTargetAttribute(DataInput in, ConstantPool cpool)
+    private ModuleTarget readModuleTargetAttribute(DataInput in, ConstantPool cpool)
         throws IOException
     {
-        String[] values = new String[3];
+        String osName = null;
+        String osArch = null;
 
         int name_index = in.readUnsignedShort();
         if (name_index != 0)
-            values[0] = cpool.getUtf8(name_index);
+            osName = cpool.getUtf8(name_index);
 
         int arch_index = in.readUnsignedShort();
         if (arch_index != 0)
-            values[1] = cpool.getUtf8(arch_index);
+            osArch = cpool.getUtf8(arch_index);
 
-        int version_index = in.readUnsignedShort();
-        if (version_index != 0)
-            values[2] = cpool.getUtf8(version_index);
-
-        return values;
+        return new ModuleTarget(osName, osArch);
     }
 
 
@@ -629,10 +634,7 @@
 
     /**
      * Return true if the given attribute name is the name of a pre-defined
-     * attribute that is not allowed in the class file.
-     *
-     * Except for Module, InnerClasses, SourceFile, SourceDebugExtension, and
-     * Deprecated, none of the pre-defined attributes in JVMS 4.7 may appear.
+     * attribute in JVMS 4.7 that is not allowed in a module-info class.
      */
     private static boolean isAttributeDisallowed(String name) {
         Set<String> notAllowed = predefinedNotAllowed;
@@ -640,6 +642,7 @@
             notAllowed = Set.of(
                     "ConstantValue",
                     "Code",
+                    "Deprecated",
                     "StackMapTable",
                     "Exceptions",
                     "EnclosingMethod",
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java
index 0d05ad2..35f28d3 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java
@@ -56,7 +56,7 @@
     // the packages in the ModulePackages attribute
     private Set<String> packages;
 
-    // the value of the module_version in Module attribute
+    // the value for the module version in the Module attribute
     private Version version;
 
     // the value of the ModuleMainClass attribute
@@ -65,7 +65,6 @@
     // the values for the ModuleTarget attribute
     private String osName;
     private String osArch;
-    private String osVersion;
 
     // the hashes for the ModuleHashes attribute
     private ModuleHashes hashes;
@@ -78,7 +77,11 @@
     }
 
     /**
-     * Sets the set of packages for the ModulePackages attribute
+     * Sets the packages for the ModulePackages attribute
+     *
+     * @apiNote This method does not check that the package names are legal
+     * package names or that the set of packages is a super set of the
+     * packages in the module.
      */
     public ModuleInfoExtender packages(Set<String> packages) {
         this.packages = Collections.unmodifiableSet(packages);
@@ -86,7 +89,7 @@
     }
 
     /**
-     * Sets the value of the module_version in Module attribute.
+     * Sets the value for the module version in the Module attribute
      */
     public ModuleInfoExtender version(Version version) {
         this.version = version;
@@ -95,6 +98,9 @@
 
     /**
      * Sets the value of the ModuleMainClass attribute.
+     *
+     * @apiNote This method does not check that the main class is a legal
+     * class name in a named package.
      */
     public ModuleInfoExtender mainClass(String mainClass) {
         this.mainClass = mainClass;
@@ -104,12 +110,9 @@
     /**
      * Sets the values for the ModuleTarget attribute.
      */
-    public ModuleInfoExtender targetPlatform(String osName,
-                                             String osArch,
-                                             String osVersion) {
+    public ModuleInfoExtender targetPlatform(String osName, String osArch) {
         this.osName = osName;
         this.osArch = osArch;
-        this.osVersion = osVersion;
         return this;
     }
 
@@ -133,7 +136,7 @@
 
     /**
      * A ClassVisitor that supports adding class file attributes. If an
-     * attribute already exists then the first occurence of the attribute
+     * attribute already exists then the first occurrence of the attribute
      * is replaced.
      */
     private static class AttributeAddingClassVisitor extends ClassVisitor {
@@ -196,8 +199,8 @@
             cv.addAttribute(new ModulePackagesAttribute(packages));
         if (mainClass != null)
             cv.addAttribute(new ModuleMainClassAttribute(mainClass));
-        if (osName != null || osArch != null || osVersion != null)
-            cv.addAttribute(new ModuleTargetAttribute(osName, osArch, osVersion));
+        if (osName != null || osArch != null)
+            cv.addAttribute(new ModuleTargetAttribute(osName, osArch));
         if (hashes != null)
             cv.addAttribute(new ModuleHashesAttribute(hashes));
         if (moduleResolution != null)
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java
index 5a17442..01bee50 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
      * Writes the given module descriptor to a module-info.class file,
      * returning it in a byte array.
      */
-    private static byte[] toModuleInfo(ModuleDescriptor md) {
+    private static byte[] toModuleInfo(ModuleDescriptor md, ModuleTarget target) {
         ClassWriter cw = new ClassWriter(0);
         cw.visit(Opcodes.V1_9, ACC_MODULE, "module-info", null, null, null);
         cw.visitAttribute(new ModuleAttribute(md));
@@ -66,12 +66,10 @@
         // write ModuleMainClass if the module has a main class
         md.mainClass().ifPresent(mc -> cw.visitAttribute(new ModuleMainClassAttribute(mc)));
 
-        // write ModuleTarget attribute if have any of OS name/arch/version
-        String osName = md.osName().orElse(null);
-        String osArch = md.osArch().orElse(null);
-        String osVersion = md.osVersion().orElse(null);
-        if (osName != null || osArch != null || osVersion != null) {
-            cw.visitAttribute(new ModuleTargetAttribute(osName, osArch, osVersion));
+        // write ModuleTarget if there is a platform OS/arch
+        if (target != null) {
+            cw.visitAttribute(new ModuleTargetAttribute(target.osName(),
+                                                        target.osArch()));
         }
 
         cw.visitEnd();
@@ -82,11 +80,23 @@
      * Writes a module descriptor to the given output stream as a
      * module-info.class.
      */
+    public static void write(ModuleDescriptor descriptor,
+                             ModuleTarget target,
+                             OutputStream out)
+        throws IOException
+    {
+        byte[] bytes = toModuleInfo(descriptor, target);
+        out.write(bytes);
+    }
+
+    /**
+     * Writes a module descriptor to the given output stream as a
+     * module-info.class.
+     */
     public static void write(ModuleDescriptor descriptor, OutputStream out)
         throws IOException
     {
-        byte[] bytes = toModuleInfo(descriptor);
-        out.write(bytes);
+        write(descriptor, null, out);
     }
 
     /**
@@ -94,8 +104,7 @@
      * in module-info.class format.
      */
     public static ByteBuffer toByteBuffer(ModuleDescriptor descriptor) {
-        byte[] bytes = toModuleInfo(descriptor);
+        byte[] bytes = toModuleInfo(descriptor, null);
         return ByteBuffer.wrap(bytes);
     }
-
 }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java
index 9c3308f..15e60d0 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,13 +41,6 @@
  * are generated at build time.
  */
 final class ModuleLoaderMap {
-    /*
-     * The list of boot modules and platform modules are generated at build time.
-     */
-    private static final String[] BOOT_MODULES
-        = new String[] { "@@BOOT_MODULE_NAMES@@" };
-    private static final String[] PLATFORM_MODULES
-        = new String[] { "@@PLATFORM_MODULE_NAMES@@" };
 
     /**
      * Returns the function to map modules in the given configuration to the
@@ -55,6 +48,10 @@
      */
     static Function<String, ClassLoader> mappingFunction(Configuration cf) {
 
+        // The list of boot modules and platform modules are generated at build time.
+        final String[] BOOT_MODULES = new String[] { "@@BOOT_MODULE_NAMES@@" };
+        final String[] PLATFORM_MODULES = new String[] { "@@PLATFORM_MODULE_NAMES@@" };
+
         Set<String> bootModules = new HashSet<>(BOOT_MODULES.length);
         for (String mn : BOOT_MODULES) {
             bootModules.add(mn);
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java
index 5bd7ef5..3f5827b 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 import java.io.InputStream;
 import java.io.UncheckedIOException;
 import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Builder;
 import java.lang.module.ModuleReader;
 import java.lang.module.ModuleReference;
 import java.net.MalformedURLException;
@@ -108,8 +109,11 @@
         if (paths == null)
             return mref;
 
-        // scan the JAR file or directory tree to get the set of packages
+        // Scan the JAR file or directory tree to get the set of packages.
+        // For automatic modules then packages that do not contain class files
+        // must be ignored.
         Set<String> packages = new HashSet<>();
+        boolean isAutomatic = descriptor.isAutomatic();
         try {
             for (Path file : paths) {
                 if (Files.isRegularFile(file)) {
@@ -118,8 +122,10 @@
                     // is not supported by the boot class loader
                     try (JarFile jf = new JarFile(file.toFile())) {
                         jf.stream()
+                          .filter(e -> !e.isDirectory()
+                                  && (!isAutomatic || e.getName().endsWith(".class")))
                           .map(e -> toPackageName(file, e))
-                          .filter(Checks::isJavaIdentifier)
+                          .filter(Checks::isPackageName)
                           .forEach(packages::add);
                     }
 
@@ -129,8 +135,11 @@
                     Path top = file;
                     Files.find(top, Integer.MAX_VALUE,
                                ((path, attrs) -> attrs.isRegularFile()))
+                            .filter(path -> (!isAutomatic
+                                    || path.toString().endsWith(".class"))
+                                    && !isHidden(path))
                             .map(path -> toPackageName(top, path))
-                            .filter(Checks::isJavaIdentifier)
+                            .filter(Checks::isPackageName)
                             .forEach(packages::add);
 
                 }
@@ -141,20 +150,41 @@
         }
 
         // if there are new packages then we need a new ModuleDescriptor
-        Set<String> original = descriptor.packages();
-        packages.addAll(original);
-        if (packages.size() > original.size()) {
-            descriptor = JLMA.newModuleDescriptor(descriptor, packages);
+        packages.removeAll(descriptor.packages());
+        if (!packages.isEmpty()) {
+            Builder builder = JLMA.newModuleBuilder(descriptor.name(),
+                                                    /*strict*/ false,
+                                                    descriptor.modifiers());
+            if (!descriptor.isAutomatic()) {
+                descriptor.requires().forEach(builder::requires);
+                descriptor.exports().forEach(builder::exports);
+                descriptor.opens().forEach(builder::opens);
+                descriptor.uses().forEach(builder::uses);
+            }
+            descriptor.provides().forEach(builder::provides);
+
+            descriptor.version().ifPresent(builder::version);
+            descriptor.mainClass().ifPresent(builder::mainClass);
+
+            // original + new packages
+            builder.packages(descriptor.packages());
+            builder.packages(packages);
+
+            descriptor = builder.build();
         }
 
         // return a module reference to the patched module
         URI location = mref.location().orElse(null);
 
+        ModuleTarget target = null;
         ModuleHashes recordedHashes = null;
+        ModuleHashes.HashSupplier hasher = null;
         ModuleResolution mres = null;
         if (mref instanceof ModuleReferenceImpl) {
             ModuleReferenceImpl impl = (ModuleReferenceImpl)mref;
+            target = impl.moduleTarget();
             recordedHashes = impl.recordedHashes();
+            hasher = impl.hasher();
             mres = impl.moduleResolution();
         }
 
@@ -162,8 +192,9 @@
                                        location,
                                        () -> new PatchedModuleReader(paths, mref),
                                        this,
+                                       target,
                                        recordedHashes,
-                                       null,
+                                       hasher,
                                        mres);
 
     }
@@ -197,7 +228,7 @@
         private volatile ModuleReader delegate;
 
         /**
-         * Creates the ModuleReader to reads resources a patched module.
+         * Creates the ModuleReader to reads resources in a patched module.
          */
         PatchedModuleReader(List<Path> patches, ModuleReference mref) {
             List<ResourceFinder> finders = new ArrayList<>();
@@ -262,13 +293,16 @@
         }
 
         /**
-         * Finds a resources in the patch locations. Returns null if not found.
+         * Finds a resources in the patch locations. Returns null if not found
+         * or the name is "module-info.class" as that cannot be overridden.
          */
         private Resource findResourceInPatch(String name) throws IOException {
-            for (ResourceFinder finder : finders) {
-                Resource r = finder.find(name);
-                if (r != null)
-                    return r;
+            if (!name.equals("module-info.class")) {
+                for (ResourceFinder finder : finders) {
+                    Resource r = finder.find(name);
+                    if (r != null)
+                        return r;
+                }
             }
             return null;
         }
@@ -449,9 +483,7 @@
 
         @Override
         public Stream<String> list() throws IOException {
-            return jf.stream()
-                    .filter(e -> !e.isDirectory())
-                    .map(JarEntry::getName);
+            return jf.stream().map(JarEntry::getName);
         }
     }
 
@@ -471,20 +503,9 @@
 
         @Override
         public Resource find(String name) throws IOException {
-            Path file = Paths.get(name.replace('/', File.separatorChar));
-            if (file.getRoot() == null) {
-                file = dir.resolve(file);
-            } else {
-                // drop the root component so that the resource is
-                // located relative to the module directory
-                int n = file.getNameCount();
-                if (n == 0)
-                    return null;
-                file = dir.resolve(file.subpath(0, n));
-            }
-
-            if (Files.isRegularFile(file)) {
-                return newResource(name, dir, file);
+            Path file = Resources.toFilePath(dir, name);
+            if (file != null) {
+                return  newResource(name, dir, file);
             } else {
                 return null;
             }
@@ -530,17 +551,15 @@
 
         @Override
         public Stream<String> list() throws IOException {
-            return Files.find(dir, Integer.MAX_VALUE,
-                              (path, attrs) -> attrs.isRegularFile())
-                    .map(f -> dir.relativize(f)
-                                 .toString()
-                                 .replace(File.separatorChar, '/'));
+            return Files.walk(dir, Integer.MAX_VALUE)
+                        .map(f -> Resources.toResourceName(dir, f))
+                        .filter(s -> s.length() > 0);
         }
     }
 
 
     /**
-     * Derives a package name from a file path to a .class file.
+     * Derives a package name from the file path of an entry in an exploded patch
      */
     private static String toPackageName(Path top, Path file) {
         Path entry = top.relativize(file);
@@ -553,6 +572,17 @@
     }
 
     /**
+     * Returns true if the given file exists and is a hidden file
+     */
+    private boolean isHidden(Path file) {
+        try {
+            return Files.isHidden(file);
+        } catch (IOException ioe) {
+            return false;
+        }
+    }
+
+    /**
      * Derives a package name from the name of an entry in a JAR file.
      */
     private static String toPackageName(Path file, JarEntry entry) {
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePath.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePath.java
index fb7871d..75a76b0 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePath.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePath.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
 import java.lang.module.FindException;
 import java.lang.module.InvalidModuleDescriptorException;
 import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleDescriptor.Requires;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReference;
 import java.net.URI;
@@ -70,12 +69,11 @@
 
 /**
  * A {@code ModuleFinder} that locates modules on the file system by searching
- * a sequence of directories or packaged modules.
- *
- * The {@code ModuleFinder} can be created to work in either the run-time
- * or link-time phases. In both cases it locates modular JAR and exploded
- * modules. When created for link-time then it additionally locates
- * modules in JMOD files.
+ * a sequence of directories or packaged modules. The ModuleFinder can be
+ * created to work in either the run-time or link-time phases. In both cases it
+ * locates modular JAR and exploded modules. When created for link-time then it
+ * additionally locates modules in JMOD files. The ModuleFinder can also
+ * optionally patch any modules that it locates with a ModulePatcher.
  */
 
 public class ModulePath implements ModuleFinder {
@@ -87,6 +85,9 @@
     // true for the link phase (supports modules packaged in JMOD format)
     private final boolean isLinkPhase;
 
+    // for patching modules, can be null
+    private final ModulePatcher patcher;
+
     // the entries on this module path
     private final Path[] entries;
     private int next;
@@ -94,19 +95,51 @@
     // map of module name to module reference map for modules already located
     private final Map<String, ModuleReference> cachedModules = new HashMap<>();
 
-    public ModulePath(Runtime.Version version, boolean isLinkPhase, Path... entries) {
+
+    private ModulePath(Runtime.Version version,
+                       boolean isLinkPhase,
+                       ModulePatcher patcher,
+                       Path... entries) {
         this.releaseVersion = version;
         this.isLinkPhase = isLinkPhase;
+        this.patcher = patcher;
         this.entries = entries.clone();
         for (Path entry : this.entries) {
             Objects.requireNonNull(entry);
         }
     }
 
-    public ModulePath(Path... entries) {
-        this(JarFile.runtimeVersion(), false, entries);
+    /**
+     * Returns a ModuleFinder that that locates modules on the file system by
+     * searching a sequence of directories and/or packaged modules. The modules
+     * may be patched by the given ModulePatcher.
+     */
+    public static ModuleFinder of(ModulePatcher patcher, Path... entries) {
+        return new ModulePath(JarFile.runtimeVersion(), false, patcher, entries);
     }
 
+    /**
+     * Returns a ModuleFinder that that locates modules on the file system by
+     * searching a sequence of directories and/or packaged modules.
+     */
+    public static ModuleFinder of(Path... entries) {
+        return of((ModulePatcher)null, entries);
+    }
+
+    /**
+     * Returns a ModuleFinder that that locates modules on the file system by
+     * searching a sequence of directories and/or packaged modules.
+     *
+     * @param version The release version to use for multi-release JAR files
+     * @param isLinkPhase {@code true} if the link phase to locate JMOD files
+     */
+    public static ModuleFinder of(Runtime.Version version,
+                                  boolean isLinkPhase,
+                                  Path... entries) {
+        return new ModulePath(version, isLinkPhase, null, entries);
+    }
+
+
     @Override
     public Optional<ModuleReference> find(String name) {
         Objects.requireNonNull(name);
@@ -195,8 +228,7 @@
             if (attrs.isDirectory()) {
                 Path mi = entry.resolve(MODULE_INFO);
                 if (!Files.exists(mi)) {
-                    // does not exist or unable to determine so assume a
-                    // directory of modules
+                    // assume a directory of modules
                     return scanDirectory(entry);
                 }
             }
@@ -206,11 +238,17 @@
             if (mref != null) {
                 String name = mref.descriptor().name();
                 return Collections.singletonMap(name, mref);
-            } else {
-                // skipped
-                return Collections.emptyMap();
             }
 
+            // not recognized
+            String msg;
+            if (!isLinkPhase && entry.toString().endsWith(".jmod")) {
+                msg = "JMOD format not supported at execution time";
+            } else {
+                msg = "Module format not recognized";
+            }
+            throw new FindException(msg + ": " + entry);
+
         } catch (IOException ioe) {
             throw new FindException(ioe);
         }
@@ -266,14 +304,11 @@
 
 
     /**
-     * Locates a packaged or exploded module, returning a {@code ModuleReference}
-     * to the module. Returns {@code null} if the entry is skipped because it is
-     * to a directory that does not contain a module-info.class or it's a hidden
-     * file.
+     * Reads a packaged or exploded module, returning a {@code ModuleReference}
+     * to the module. Returns {@code null} if the entry is not recognized.
      *
      * @throws IOException if an I/O error occurs
-     * @throws FindException if the file is not recognized as a module or an
-     *         error occurs parsing its module descriptor
+     * @throws FindException if an error occurs parsing its module descriptor
      */
     private ModuleReference readModule(Path entry, BasicFileAttributes attrs)
         throws IOException
@@ -282,24 +317,16 @@
 
             if (attrs.isDirectory()) {
                 return readExplodedModule(entry); // may return null
-            }
-
-            String fn = entry.getFileName().toString();
-            if (attrs.isRegularFile()) {
-                if (fn.endsWith(".jar")) {
-                    return readJar(entry);
-                } else if (fn.endsWith(".jmod")) {
-                    if (isLinkPhase)
-                        return readJMod(entry);
-                    throw new FindException("JMOD files not supported: " + entry);
-                }
-            }
-
-            // skip hidden files
-            if (fn.startsWith(".") || Files.isHidden(entry)) {
-                return null;
             } else {
-                throw new FindException("Unrecognized module: " + entry);
+                String fn = entry.getFileName().toString();
+                if (attrs.isRegularFile()) {
+                    if (fn.endsWith(".jar")) {
+                        return readJar(entry);
+                    } else if (isLinkPhase && fn.endsWith(".jmod")) {
+                        return readJMod(entry);
+                    }
+                }
+                return null;
             }
 
         } catch (InvalidModuleDescriptorException e) {
@@ -327,7 +354,7 @@
         }
     }
 
-    // -- jmod files --
+    // -- JMOD files --
 
     private Set<String> jmodPackages(JmodFile jf) {
         return jf.stream()
@@ -339,7 +366,7 @@
     }
 
     /**
-     * Returns a {@code ModuleReference} to a module in jmod file on the
+     * Returns a {@code ModuleReference} to a module in JMOD file on the
      * file system.
      *
      * @throws IOException
@@ -362,7 +389,7 @@
 
     /**
      * Returns the service type corresponding to the name of a services
-     * configuration file if it is a valid Java identifier.
+     * configuration file if it is a legal type name.
      *
      * For example, if called with "META-INF/services/p.S" then this method
      * returns a container with the value "p.S".
@@ -374,7 +401,7 @@
             String prefix = cf.substring(0, index);
             if (prefix.equals(SERVICES_PREFIX)) {
                 String sn = cf.substring(index);
-                if (Checks.isJavaIdentifier(sn))
+                if (Checks.isClassName(sn))
                     return Optional.of(sn);
             }
         }
@@ -403,11 +430,10 @@
      *
      * 1. The module name (and optionally the version) is derived from the file
      *    name of the JAR file
-     * 2. All packages are exported and open
-     * 3. It has no non-exported/non-open packages
-     * 4. The contents of any META-INF/services configuration files are mapped
+     * 2. All packages are derived from the .class files in the JAR file
+     * 3. The contents of any META-INF/services configuration files are mapped
      *    to "provides" declarations
-     * 5. The Main-Class attribute in the main attributes of the JAR manifest
+     * 4. The Main-Class attribute in the main attributes of the JAR manifest
      *    is mapped to the module descriptor mainClass
      */
     private ModuleDescriptor deriveModuleDescriptor(JarFile jf)
@@ -443,9 +469,7 @@
         mn = cleanModuleName(mn);
 
         // Builder throws IAE if module name is empty or invalid
-        ModuleDescriptor.Builder builder
-            = ModuleDescriptor.automaticModule(mn)
-                .requires(Set.of(Requires.Modifier.MANDATED), "java.base");
+        ModuleDescriptor.Builder builder = ModuleDescriptor.newAutomaticModule(mn);
         if (vs != null)
             builder.version(vs);
 
@@ -453,17 +477,22 @@
         Map<Boolean, Set<String>> map = VersionedStream.stream(jf)
                 .filter(e -> !e.isDirectory())
                 .map(JarEntry::getName)
+                .filter(e -> (e.endsWith(".class") ^ e.startsWith(SERVICES_PREFIX)))
                 .collect(Collectors.partitioningBy(e -> e.startsWith(SERVICES_PREFIX),
                                                    Collectors.toSet()));
 
-        Set<String> resources = map.get(Boolean.FALSE);
+        Set<String> classFiles = map.get(Boolean.FALSE);
         Set<String> configFiles = map.get(Boolean.TRUE);
-        // all packages are exported and open
-        resources.stream()
+
+        // the packages containing class files
+        Set<String> packages = classFiles.stream()
                 .map(this::toPackageName)
                 .flatMap(Optional::stream)
                 .distinct()
-                .forEach(pn -> builder.exports(pn).opens(pn));
+                .collect(Collectors.toSet());
+
+        // all packages are exported and open
+        builder.packages(packages);
 
         // map names of service configuration files to service names
         Set<String> serviceNames = configFiles.stream()
@@ -481,6 +510,11 @@
                 String cn;
                 while ((cn = nextLine(reader)) != null) {
                     if (cn.length() > 0) {
+                        String pn = packageName(cn);
+                        if (!packages.contains(pn)) {
+                            String msg = "Provider class " + cn + " not in module";
+                            throw new InvalidModuleDescriptorException(msg);
+                        }
                         providerClasses.add(cn);
                     }
                 }
@@ -494,8 +528,15 @@
         if (man != null) {
             Attributes attrs = man.getMainAttributes();
             String mainClass = attrs.getValue(Attributes.Name.MAIN_CLASS);
-            if (mainClass != null)
-                builder.mainClass(mainClass.replace("/", "."));
+            if (mainClass != null) {
+                mainClass = mainClass.replace("/", ".");
+                String pn = packageName(mainClass);
+                if (!packages.contains(pn)) {
+                    String msg = "Main-Class " + mainClass + " not in module";
+                    throw new InvalidModuleDescriptorException(msg);
+                }
+                builder.mainClass(mainClass);
+            }
         }
 
         return builder.build();
@@ -506,7 +547,6 @@
      */
     private static class Patterns {
         static final Pattern DASH_VERSION = Pattern.compile("-(\\d+(\\.|$))");
-        static final Pattern TRAILING_VERSION = Pattern.compile("(\\.|\\d)*$");
         static final Pattern NON_ALPHANUM = Pattern.compile("[^A-Za-z0-9]");
         static final Pattern REPEATING_DOTS = Pattern.compile("(\\.)(\\1)+");
         static final Pattern LEADING_DOTS = Pattern.compile("^\\.");
@@ -517,9 +557,6 @@
      * Clean up candidate module name derived from a JAR file name.
      */
     private static String cleanModuleName(String mn) {
-        // drop trailing version from name
-        mn = Patterns.TRAILING_VERSION.matcher(mn).replaceAll("");
-
         // replace non-alphanumeric
         mn = Patterns.NON_ALPHANUM.matcher(mn).replaceAll(".");
 
@@ -568,11 +605,10 @@
                 // no module-info.class so treat it as automatic module
                 try {
                     ModuleDescriptor md = deriveModuleDescriptor(jf);
-                    attrs = new ModuleInfo.Attributes(md, null, null);
-                } catch (IllegalArgumentException iae) {
-                    throw new FindException(
-                        "Unable to derive module descriptor for: "
-                        + jf.getName(), iae);
+                    attrs = new ModuleInfo.Attributes(md, null, null, null);
+                } catch (RuntimeException e) {
+                    throw new FindException("Unable to derive module descriptor for "
+                                            + jf.getName(), e);
                 }
 
             } else {
@@ -580,7 +616,7 @@
                                         () -> jarPackages(jf));
             }
 
-            return ModuleReferences.newJarModule(attrs, file);
+            return ModuleReferences.newJarModule(attrs, patcher, file);
         }
     }
 
@@ -590,7 +626,7 @@
     private Set<String> explodedPackages(Path dir) {
         try {
             return Files.find(dir, Integer.MAX_VALUE,
-                              ((path, attrs) -> attrs.isRegularFile()))
+                    ((path, attrs) -> attrs.isRegularFile() && !isHidden(path)))
                     .map(path -> dir.relativize(path))
                     .map(this::toPackageName)
                     .flatMap(Optional::stream)
@@ -617,31 +653,38 @@
             // for now
             return null;
         }
-        return ModuleReferences.newExplodedModule(attrs, dir);
+        return ModuleReferences.newExplodedModule(attrs, patcher, dir);
+    }
+
+    /**
+     * Maps a type name to its package name.
+     */
+    private static String packageName(String cn) {
+        int index = cn.lastIndexOf('.');
+        return (index == -1) ? "" : cn.substring(0, index);
     }
 
     /**
      * Maps the name of an entry in a JAR or ZIP file to a package name.
      *
-     * @throws IllegalArgumentException if the name is a class file in
-     *         the top-level directory of the JAR/ZIP file (and it's
-     *         not module-info.class)
+     * @throws InvalidModuleDescriptorException if the name is a class file in
+     *         the top-level directory of the JAR/ZIP file (and it's not
+     *         module-info.class)
      */
     private Optional<String> toPackageName(String name) {
         assert !name.endsWith("/");
-
         int index = name.lastIndexOf("/");
         if (index == -1) {
             if (name.endsWith(".class") && !name.equals(MODULE_INFO)) {
-                throw new IllegalArgumentException(name
-                        + " found in top-level directory:"
-                        + " (unnamed package not allowed in module)");
+                String msg = name + " found in top-level directory"
+                             + " (unnamed package not allowed in module)";
+                throw new InvalidModuleDescriptorException(msg);
             }
             return Optional.empty();
         }
 
         String pn = name.substring(0, index).replace('/', '.');
-        if (Checks.isJavaIdentifier(pn)) {
+        if (Checks.isPackageName(pn)) {
             return Optional.of(pn);
         } else {
             // not a valid package name
@@ -653,7 +696,7 @@
      * Maps the relative path of an entry in an exploded module to a package
      * name.
      *
-     * @throws IllegalArgumentException if the name is a class file in
+     * @throws InvalidModuleDescriptorException if the name is a class file in
      *         the top-level directory (and it's not module-info.class)
      */
     private Optional<String> toPackageName(Path file) {
@@ -663,15 +706,15 @@
         if (parent == null) {
             String name = file.toString();
             if (name.endsWith(".class") && !name.equals(MODULE_INFO)) {
-                throw new IllegalArgumentException(name
-                        + " found in in top-level directory"
-                        + " (unnamed package not allowed in module)");
+                String msg = name + " found in top-level directory"
+                             + " (unnamed package not allowed in module)";
+                throw new InvalidModuleDescriptorException(msg);
             }
             return Optional.empty();
         }
 
         String pn = parent.toString().replace(File.separatorChar, '.');
-        if (Checks.isJavaIdentifier(pn)) {
+        if (Checks.isPackageName(pn)) {
             return Optional.of(pn);
         } else {
             // not a valid package name
@@ -679,6 +722,17 @@
         }
     }
 
+    /**
+     * Returns true if the given file exists and is a hidden file
+     */
+    private boolean isHidden(Path file) {
+        try {
+            return Files.isHidden(file);
+        } catch (IOException ioe) {
+            return false;
+        }
+    }
+
     private static final PerfCounter scanTime
         = PerfCounter.newPerfCounter("jdk.module.finder.modulepath.scanTime");
     private static final PerfCounter moduleCount
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferenceImpl.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferenceImpl.java
index 2ab42bd..0029309 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferenceImpl.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferenceImpl.java
@@ -46,6 +46,9 @@
     // non-null if the module is patched
     private final ModulePatcher patcher;
 
+    // ModuleTarget if the module is OS/architecture specific
+    private final ModuleTarget target;
+
     // the hashes of other modules recorded in this module
     private final ModuleHashes recordedHashes;
 
@@ -65,6 +68,7 @@
                         URI location,
                         Supplier<ModuleReader> readerSupplier,
                         ModulePatcher patcher,
+                        ModuleTarget target,
                         ModuleHashes recordedHashes,
                         ModuleHashes.HashSupplier hasher,
                         ModuleResolution moduleResolution)
@@ -72,6 +76,7 @@
         super(descriptor, Objects.requireNonNull(location));
         this.readerSupplier = readerSupplier;
         this.patcher = patcher;
+        this.target = target;
         this.recordedHashes = recordedHashes;
         this.hasher = hasher;
         this.moduleResolution = moduleResolution;
@@ -94,6 +99,13 @@
     }
 
     /**
+     * Returns the ModuleTarget or {@code null} if the no target platform.
+     */
+    public ModuleTarget moduleTarget() {
+        return target;
+    }
+
+    /**
      * Returns the hashes recorded in this module or {@code null} if there
      * are no hashes recorded.
      */
@@ -163,7 +175,14 @@
 
     @Override
     public String toString() {
-        return super.toString();
+        StringBuilder sb = new StringBuilder();
+        sb.append("[module ");
+        sb.append(descriptor().name());
+        sb.append(", location=");
+        sb.append(location().orElseThrow(() -> new InternalError()));
+        if (isPatched()) sb.append(" (patched)");
+        sb.append("]");
+        return sb.toString();
     }
 
 }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java
index a2aff8f..450cc5c 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java
@@ -25,7 +25,6 @@
 
 package jdk.internal.module;
 
-import java.io.File;
 import java.io.IOError;
 import java.io.IOException;
 import java.io.InputStream;
@@ -36,7 +35,6 @@
 import java.nio.ByteBuffer;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
@@ -51,7 +49,6 @@
 import java.util.zip.ZipFile;
 
 import jdk.internal.jmod.JmodFile;
-import jdk.internal.misc.JavaLangAccess;
 import jdk.internal.misc.SharedSecrets;
 import jdk.internal.module.ModuleHashes.HashSupplier;
 import jdk.internal.util.jar.VersionedStream;
@@ -65,59 +62,60 @@
  */
 
 class ModuleReferences {
-
-    private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
-
     private ModuleReferences() { }
 
     /**
-     * Creates a ModuleReference to a module or to patched module when
-     * creating modules for the boot Layer and --patch-module is specified.
+     * Creates a ModuleReference to a possibly-patched module
      */
     private static ModuleReference newModule(ModuleInfo.Attributes attrs,
                                              URI uri,
                                              Supplier<ModuleReader> supplier,
+                                             ModulePatcher patcher,
                                              HashSupplier hasher) {
-
         ModuleReference mref = new ModuleReferenceImpl(attrs.descriptor(),
                                                        uri,
                                                        supplier,
                                                        null,
+                                                       attrs.target(),
                                                        attrs.recordedHashes(),
                                                        hasher,
                                                        attrs.moduleResolution());
-        if (JLA.getBootLayer() == null)
-            mref = ModuleBootstrap.patcher().patchIfNeeded(mref);
+        if (patcher != null)
+            mref = patcher.patchIfNeeded(mref);
 
         return mref;
     }
 
     /**
-     * Creates a ModuleReference to a module packaged as a modular JAR.
+     * Creates a ModuleReference to a possibly-patched module in a modular JAR.
      */
-    static ModuleReference newJarModule(ModuleInfo.Attributes attrs, Path file) {
+    static ModuleReference newJarModule(ModuleInfo.Attributes attrs,
+                                        ModulePatcher patcher,
+                                        Path file) {
         URI uri = file.toUri();
         Supplier<ModuleReader> supplier = () -> new JarModuleReader(file, uri);
         HashSupplier hasher = (a) -> ModuleHashes.computeHash(file, a);
-        return newModule(attrs, uri, supplier, hasher);
+        return newModule(attrs, uri, supplier, patcher, hasher);
     }
 
     /**
-     * Creates a ModuleReference to a module packaged as a JMOD.
+     * Creates a ModuleReference to a module in a JMOD file.
      */
     static ModuleReference newJModModule(ModuleInfo.Attributes attrs, Path file) {
         URI uri = file.toUri();
         Supplier<ModuleReader> supplier = () -> new JModModuleReader(file, uri);
         HashSupplier hasher = (a) -> ModuleHashes.computeHash(file, a);
-        return newModule(attrs, uri, supplier, hasher);
+        return newModule(attrs, uri, supplier, null, hasher);
     }
 
     /**
-     * Creates a ModuleReference to an exploded module.
+     * Creates a ModuleReference to a possibly-patched exploded module.
      */
-    static ModuleReference newExplodedModule(ModuleInfo.Attributes attrs, Path dir) {
+    static ModuleReference newExplodedModule(ModuleInfo.Attributes attrs,
+                                             ModulePatcher patcher,
+                                             Path dir) {
         Supplier<ModuleReader> supplier = () -> new ExplodedModuleReader(dir);
-        return newModule(attrs, dir.toUri(), supplier, null);
+        return newModule(attrs, dir.toUri(), supplier, patcher, null);
     }
 
 
@@ -252,6 +250,8 @@
             if (je != null) {
                 if (jf.isMultiRelease())
                     name = SharedSecrets.javaUtilJarAccess().getRealName(jf, je);
+                if (je.isDirectory() && !name.endsWith("/"))
+                    name += "/";
                 String encodedPath = ParseUtil.encodePath(name, false);
                 String uris = "jar:" + uri + "!/" + encodedPath;
                 return Optional.of(URI.create(uris));
@@ -274,7 +274,6 @@
         Stream<String> implList() throws IOException {
             // take snapshot to avoid async close
             List<String> names = VersionedStream.stream(jf)
-                    .filter(e -> !e.isDirectory())
                     .map(JarEntry::getName)
                     .collect(Collectors.toList());
             return names.stream();
@@ -316,6 +315,8 @@
         Optional<URI> implFind(String name) {
             JmodFile.Entry je = getEntry(name);
             if (je != null) {
+                if (je.isDirectory() && !name.endsWith("/"))
+                    name += "/";
                 String encodedPath = ParseUtil.encodePath(name, false);
                 String uris = "jmod:" + uri + "!/" + encodedPath;
                 return Optional.of(URI.create(uris));
@@ -370,21 +371,6 @@
         }
 
         /**
-         * Returns a Path to access to the given resource.
-         */
-        private Path toPath(String name) {
-            Path path = Paths.get(name.replace('/', File.separatorChar));
-            if (path.getRoot() == null) {
-                return dir.resolve(path);
-            } else {
-                // drop the root component so that the resource is
-                // located relative to the module directory
-                int n = path.getNameCount();
-                return (n > 0) ? dir.resolve(path.subpath(0, n)) : null;
-            }
-        }
-
-        /**
          * Throws IOException if the module reader is closed;
          */
         private void ensureOpen() throws IOException {
@@ -394,8 +380,8 @@
         @Override
         public Optional<URI> find(String name) throws IOException {
             ensureOpen();
-            Path path = toPath(name);
-            if (path != null && Files.isRegularFile(path)) {
+            Path path = Resources.toFilePath(dir, name);
+            if (path != null) {
                 try {
                     return Optional.of(path.toUri());
                 } catch (IOError e) {
@@ -409,8 +395,8 @@
         @Override
         public Optional<InputStream> open(String name) throws IOException {
             ensureOpen();
-            Path path = toPath(name);
-            if (path != null && Files.isRegularFile(path)) {
+            Path path = Resources.toFilePath(dir, name);
+            if (path != null) {
                 return Optional.of(Files.newInputStream(path));
             } else {
                 return Optional.empty();
@@ -420,8 +406,8 @@
         @Override
         public Optional<ByteBuffer> read(String name) throws IOException {
             ensureOpen();
-            Path path = toPath(name);
-            if (path != null && Files.isRegularFile(path)) {
+            Path path = Resources.toFilePath(dir, name);
+            if (path != null) {
                 return Optional.of(ByteBuffer.wrap(Files.readAllBytes(path)));
             } else {
                 return Optional.empty();
@@ -431,12 +417,9 @@
         @Override
         public Stream<String> list() throws IOException {
             ensureOpen();
-            // sym links not followed
-            return Files.find(dir, Integer.MAX_VALUE,
-                              (path, attrs) -> attrs.isRegularFile())
-                    .map(f -> dir.relativize(f)
-                                 .toString()
-                                 .replace(File.separatorChar, '/'));
+            return Files.walk(dir, Integer.MAX_VALUE)
+                        .map(f -> Resources.toResourceName(dir, f))
+                        .filter(s -> s.length() > 0);
         }
 
         @Override
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleTarget.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleTarget.java
new file mode 100644
index 0000000..dcfe8ac
--- /dev/null
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleTarget.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.module;
+
+public final class ModuleTarget {
+
+    private final String osName;
+    private final String osArch;
+
+    public ModuleTarget(String osName, String osArch) {
+        this.osName = osName;
+        this.osArch = osArch;
+    }
+
+    public String osName() {
+        return osName;
+    }
+
+    public String osArch() {
+        return osArch;
+    }
+
+}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java b/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java
index 9f68cfb..6228862 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java
@@ -26,23 +26,20 @@
 package jdk.internal.module;
 
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.net.URI;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.Set;
 
 import jdk.internal.loader.BootLoader;
 import jdk.internal.loader.ClassLoaders;
-import jdk.internal.misc.JavaLangReflectModuleAccess;
+import jdk.internal.misc.JavaLangAccess;
 import jdk.internal.misc.SharedSecrets;
 
 /**
- * A helper class to allow JDK classes create dynamic modules and to update
- * modules, exports and the readability graph. It is also invoked by the VM
- * to add read edges when agents are instrumenting code that need to link
- * to supporting classes.
+ * A helper class for creating and updating modules. This class is intended to
+ * support command-line options, tests, and the instrumentation API. It is also
+ * used by the VM to add read edges when agents are instrumenting code that
+ * need to link to supporting classes.
  *
  * The parameters that are package names in this API are the fully-qualified
  * names of the packages as defined in section 6.5.3 of <cite>The Java&trade;
@@ -52,8 +49,7 @@
 public class Modules {
     private Modules() { }
 
-    private static final JavaLangReflectModuleAccess JLRMA
-        = SharedSecrets.getJavaLangReflectModuleAccess();
+    private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
 
     /**
      * Creates a new Module. The module has the given ModuleDescriptor and
@@ -68,48 +64,37 @@
                                       ModuleDescriptor descriptor,
                                       URI uri)
     {
-        return JLRMA.defineModule(loader, descriptor, uri);
+        return JLA.defineModule(loader, descriptor, uri);
     }
 
     /**
-     * Define a new module to the VM. The module has the given set of
-     * packages and is defined to the given class loader.
-     *
-     * The resulting Module is in a larval state in that it does not not read
-     * any other module and does not have any exports.
-     */
-    public static Module defineModule(ClassLoader loader,
-                                      String name,
-                                      Set<String> packages)
-    {
-        ModuleDescriptor descriptor = ModuleDescriptor.module(name)
-                .contains(packages)
-                .build();
-
-        return JLRMA.defineModule(loader, descriptor, null);
-    }
-
-    /**
-     * Adds a read-edge so that module {@code m1} reads module {@code m1}.
+     * Updates m1 to read m2.
      * Same as m1.addReads(m2) but without a caller check.
      */
     public static void addReads(Module m1, Module m2) {
-        JLRMA.addReads(m1, m2);
+        JLA.addReads(m1, m2);
     }
 
     /**
-     * Update module {@code m} to read all unnamed modules.
+     * Update module m to read all unnamed modules.
      */
     public static void addReadsAllUnnamed(Module m) {
-        JLRMA.addReadsAllUnnamed(m);
+        JLA.addReadsAllUnnamed(m);
     }
 
     /**
      * Updates module m1 to export a package to module m2.
-     * Same as m1.addExports(pn, m2) but without a caller check.
+     * Same as m1.addExports(pn, m2) but without a caller check
      */
     public static void addExports(Module m1, String pn, Module m2) {
-        JLRMA.addExports(m1, pn, m2);
+        JLA.addExports(m1, pn, m2);
+    }
+
+    /**
+     * Updates module m to export a package to all unnamed modules.
+     */
+    public static void addExportsToAllUnnamed(Module m, String pn) {
+        JLA.addExportsToAllUnnamed(m, pn);
     }
 
     /**
@@ -117,51 +102,31 @@
      * Same as m1.addOpens(pn, m2) but without a caller check.
      */
     public static void addOpens(Module m1, String pn, Module m2) {
-        JLRMA.addOpens(m1, pn, m2);
-    }
-
-    /**
-     * Updates a module m to export a package to all modules.
-     */
-    public static void addExportsToAll(Module m, String pn) {
-        JLRMA.addExportsToAll(m, pn);
-    }
-
-    /**
-     * Updates a module m to open a package to all modules.
-     */
-    public static void addOpensToAll(Module m, String pn) {
-        JLRMA.addOpensToAll(m, pn);
-    }
-
-    /**
-     * Updates module m to export a package to all unnamed modules.
-     */
-    public static void addExportsToAllUnnamed(Module m, String pn) {
-        JLRMA.addExportsToAllUnnamed(m, pn);
+        JLA.addOpens(m1, pn, m2);
     }
 
     /**
      * Updates module m to open a package to all unnamed modules.
      */
     public static void addOpensToAllUnnamed(Module m, String pn) {
-        JLRMA.addOpensToAllUnnamed(m, pn);
+        JLA.addOpensToAllUnnamed(m, pn);
     }
 
     /**
-     * Updates module m to use a service
+     * Updates module m to use a service.
+     * Same as m2.addUses(service) but without a caller check.
      */
     public static void addUses(Module m, Class<?> service) {
-        JLRMA.addUses(m, service);
+        JLA.addUses(m, service);
     }
 
     /**
      * Updates module m to provide a service
      */
     public static void addProvides(Module m, Class<?> service, Class<?> impl) {
-        Layer layer = m.getLayer();
+        ModuleLayer layer = m.getLayer();
 
-        if (layer == null || layer == Layer.boot()) {
+        if (layer == null || layer == ModuleLayer.boot()) {
             // update ClassLoader catalog
             PrivilegedAction<ClassLoader> pa = m::getClassLoader;
             ClassLoader loader = AccessController.doPrivileged(pa);
@@ -176,22 +141,11 @@
 
         if (layer != null) {
             // update Layer catalog
-            SharedSecrets.getJavaLangReflectModuleAccess()
-                    .getServicesCatalog(layer)
-                    .addProvider(m, service, impl);
+            JLA.getServicesCatalog(layer).addProvider(m, service, impl);
         }
     }
 
     /**
-     * Adds a package to a module's content.
-     *
-     * This method is a no-op if the module already contains the package.
-     */
-    public static void addPackage(Module m, String pn) {
-        JLRMA.addPackage(m, pn);
-    }
-
-    /**
      * Called by the VM when code in the given Module has been transformed by
      * an agent and so may have been instrumented to call into supporting
      * classes on the boot class path or application class path.
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/Resources.java b/jdk/src/java.base/share/classes/jdk/internal/module/Resources.java
new file mode 100644
index 0000000..4498682
--- /dev/null
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/Resources.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.internal.module;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.attribute.BasicFileAttributes;
+
+/**
+ * A helper class to support working with resources in modules. Also provides
+ * support for translating resource names to file paths.
+ */
+public final class Resources {
+    private Resources() { }
+
+    /**
+     * Return true if a resource can be encapsulated. Resource with names
+     * ending in ".class" or "/" cannot be encapsulated. Resource names
+     * that map to a legal package name can be encapsulated.
+     */
+    public static boolean canEncapsulate(String name) {
+        int len = name.length();
+        if (len > 6 && name.endsWith(".class")) {
+            return false;
+        } else {
+            return Checks.isPackageName(toPackageName(name));
+        }
+    }
+
+    /**
+     * Derive a <em>package name</em> for a resource. The package name
+     * returned by this method may not be a legal package name. This method
+     * returns null if the the resource name ends with a "/" (a directory)
+     * or the resource name does not contain a "/".
+     */
+    public static String toPackageName(String name) {
+        int index = name.lastIndexOf('/');
+        if (index == -1 || index == name.length()-1) {
+            return "";
+        } else {
+            return name.substring(0, index).replace("/", ".");
+        }
+    }
+
+    /**
+     * Returns a resource name corresponding to the relative file path
+     * between {@code dir} and {@code file}. If the file is a directory
+     * then the name will end with a  "/", except the top-level directory
+     * where the empty string is returned.
+     */
+    public static String toResourceName(Path dir, Path file) {
+        String s = dir.relativize(file)
+                      .toString()
+                      .replace(File.separatorChar, '/');
+        if (s.length() > 0 && Files.isDirectory(file))
+            s += "/";
+        return s;
+    }
+
+    /**
+     * Returns a file path to a resource in a file tree. If the resource
+     * name has a trailing "/" then the file path will locate a directory.
+     * Returns {@code null} if the resource does not map to a file in the
+     * tree file.
+     */
+    public static Path toFilePath(Path dir, String name) throws IOException {
+        boolean expectDirectory = name.endsWith("/");
+        if (expectDirectory) {
+            name = name.substring(0, name.length() - 1);  // drop trailing "/"
+        }
+        Path path = toSafeFilePath(name);
+        if (path != null) {
+            Path file = dir.resolve(path);
+            try {
+                BasicFileAttributes attrs;
+                attrs = Files.readAttributes(file, BasicFileAttributes.class);
+                if (attrs.isDirectory()
+                    || (!attrs.isDirectory() && !expectDirectory))
+                    return file;
+            } catch (NoSuchFileException ignore) { }
+        }
+        return null;
+    }
+
+    /**
+     * Map a resource name to a "safe" file path. Returns {@code null} if
+     * the resource name cannot be converted into a "safe" file path.
+     *
+     * Resource names with empty elements, or elements that are "." or ".."
+     * are rejected, as are resource names that translates to a file path
+     * with a root component.
+     */
+    private static Path toSafeFilePath(String name) {
+        // scan elements of resource name
+        int next;
+        int off = 0;
+        while ((next = name.indexOf('/', off)) != -1) {
+            int len = next - off;
+            if (!mayTranslate(name, off, len)) {
+                return null;
+            }
+            off = next + 1;
+        }
+        int rem = name.length() - off;
+        if (!mayTranslate(name, off, rem)) {
+            return null;
+        }
+
+        // convert to file path
+        Path path;
+        if (File.separatorChar == '/') {
+            path = Paths.get(name);
+        } else {
+            // not allowed to embed file separators
+            if (name.contains(File.separator))
+                return null;
+            path = Paths.get(name.replace('/', File.separatorChar));
+        }
+
+        // file path not allowed to have root component
+        return (path.getRoot() == null) ? path : null;
+    }
+
+    /**
+     * Returns {@code true} if the element in a resource name is a candidate
+     * to translate to the element of a file path.
+     */
+    private static boolean mayTranslate(String name, int off, int len) {
+        if (len <= 2) {
+            if (len == 0)
+                return false;
+            boolean starsWithDot = (name.charAt(off) == '.');
+            if (len == 1 && starsWithDot)
+                return false;
+            if (len == 2 && starsWithDot && (name.charAt(off+1) == '.'))
+                return false;
+        }
+        return true;
+    }
+
+}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java b/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java
index d4425aa..f0d7126 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java
@@ -25,7 +25,6 @@
 
 package jdk.internal.module;
 
-import java.lang.reflect.Module;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleDescriptor.Provides;
 import java.util.ArrayList;
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/SystemModuleFinder.java b/jdk/src/java.base/share/classes/jdk/internal/module/SystemModuleFinder.java
index 5ec0a62..92c4c96 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/SystemModuleFinder.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/SystemModuleFinder.java
@@ -80,8 +80,6 @@
         = PerfCounter.newPerfCounter("jdk.module.finder.jimage.packages");
     private static final PerfCounter exportsCount
         = PerfCounter.newPerfCounter("jdk.module.finder.jimage.exports");
-    // ImageReader used to access all modules in the image
-    private static final ImageReader imageReader;
 
     // singleton finder to find modules in the run-time images
     private static final SystemModuleFinder INSTANCE;
@@ -96,13 +94,28 @@
      */
     static {
         long t0 = System.nanoTime();
-        imageReader = ImageReaderFactory.getImageReader();
 
         INSTANCE = new SystemModuleFinder();
 
         initTime.addElapsedTimeFrom(t0);
     }
 
+    /**
+     * Holder class for the ImageReader
+     */
+    private static class SystemImage {
+        static final ImageReader READER;
+        static {
+            long t0 = System.nanoTime();
+            READER = ImageReaderFactory.getImageReader();
+            initTime.addElapsedTimeFrom(t0);
+        }
+
+        static ImageReader reader() {
+            return READER;
+        }
+    }
+
     private static boolean isFastPathSupported() {
        return SystemModules.MODULE_NAMES.length > 0;
     }
@@ -114,7 +127,7 @@
 
         // this happens when java.base is patched with java.base
         // from an exploded image
-        return imageReader.getModuleNames();
+        return SystemImage.reader().getModuleNames();
     }
 
     // the set of modules in the run-time image
@@ -137,26 +150,31 @@
             System.getProperty("jdk.system.module.finder.disabledFastPath") != null;
 
         ModuleDescriptor[] descriptors;
+        ModuleTarget[] targets;
         ModuleHashes[] recordedHashes;
         ModuleResolution[] moduleResolutions;
 
         // fast loading of ModuleDescriptor of system modules
         if (isFastPathSupported() && !disabled) {
             descriptors = SystemModules.descriptors();
+            targets = SystemModules.targets();
             recordedHashes = SystemModules.hashes();
             moduleResolutions = SystemModules.moduleResolutions();
         } else {
             // if fast loading of ModuleDescriptors is disabled
             // fallback to read module-info.class
             descriptors = new ModuleDescriptor[n];
+            targets = new ModuleTarget[n];
             recordedHashes = new ModuleHashes[n];
             moduleResolutions = new ModuleResolution[n];
+            ImageReader imageReader = SystemImage.reader();
             for (int i = 0; i < names.length; i++) {
                 String mn = names[i];
                 ImageLocation loc = imageReader.findLocation(mn, "module-info.class");
                 ModuleInfo.Attributes attrs =
                     ModuleInfo.read(imageReader.getResourceBuffer(loc), null);
                 descriptors[i] = attrs.descriptor();
+                targets[i] = attrs.target();
                 recordedHashes[i] = attrs.recordedHashes();
                 moduleResolutions[i] = attrs.moduleResolution();
             }
@@ -192,6 +210,7 @@
 
             // create the ModuleReference
             ModuleReference mref = toModuleReference(md,
+                                                     targets[i],
                                                      recordedHashes[i],
                                                      hashSupplier(names[i]),
                                                      moduleResolutions[i]);
@@ -219,6 +238,7 @@
     }
 
     private ModuleReference toModuleReference(ModuleDescriptor md,
+                                              ModuleTarget target,
                                               ModuleHashes recordedHashes,
                                               HashSupplier hasher,
                                               ModuleResolution mres) {
@@ -232,9 +252,14 @@
             }
         };
 
-        ModuleReference mref =
-            new ModuleReferenceImpl(md, uri, readerSupplier, null,
-                                    recordedHashes, hasher, mres);
+        ModuleReference mref = new ModuleReferenceImpl(md,
+                                                       uri,
+                                                       readerSupplier,
+                                                       null,
+                                                       target,
+                                                       recordedHashes,
+                                                       hasher,
+                                                       mres);
 
         // may need a reference to a patched module if --patch-module specified
         mref = ModuleBootstrap.patcher().patchIfNeeded(mref);
@@ -291,6 +316,7 @@
             Objects.requireNonNull(name);
             if (closed)
                 throw new IOException("ModuleReader is closed");
+            ImageReader imageReader = SystemImage.reader();
             if (imageReader != null) {
                 return imageReader.findLocation(module, name);
             } else {
@@ -330,7 +356,7 @@
         public Optional<ByteBuffer> read(String name) throws IOException {
             ImageLocation location = findImageLocation(name);
             if (location != null) {
-                return Optional.of(imageReader.getResourceBuffer(location));
+                return Optional.of(SystemImage.reader().getResourceBuffer(location));
             } else {
                 return Optional.empty();
             }
@@ -372,7 +398,7 @@
             stack = new ArrayDeque<>();
 
             // push the root node to the stack to get started
-            ImageReader.Node dir = imageReader.findNode(moduleRoot);
+            ImageReader.Node dir = SystemImage.reader().findNode(moduleRoot);
             if (dir == null || !dir.isDirectory())
                 throw new IOException(moduleRoot + " not a directory");
             stack.push(dir);
@@ -390,7 +416,7 @@
                     String name = node.getName();
                     if (node.isDirectory()) {
                         // build node
-                        ImageReader.Node dir = imageReader.findNode(name);
+                        ImageReader.Node dir = SystemImage.reader().findNode(name);
                         assert dir.isDirectory();
                         stack.push(dir);
                     } else {
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/SystemModules.java b/jdk/src/java.base/share/classes/jdk/internal/module/SystemModules.java
index 596bb69..06e21ba 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/SystemModules.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/SystemModules.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 
 import java.lang.module.ModuleDescriptor;
 
-/*
+/**
  * SystemModules class will be generated at link time to create
  * ModuleDescriptor for the system modules directly to improve
  * the module descriptor reconstitution time.
@@ -65,7 +65,7 @@
     }
 
     /**
-     * Returns a non-empty array of ModuleDescriptors in the run-time image.
+     * Returns a non-empty array of ModuleDescriptor objects in the run-time image.
      *
      * When running an exploded image it returns an empty array.
      */
@@ -74,6 +74,15 @@
     }
 
     /**
+     * Returns a non-empty array of ModuleTarget objects in the run-time image.
+     *
+     * When running an exploded image it returns an empty array.
+     */
+    public static ModuleTarget[] targets() {
+        throw new InternalError("expected to be overridden at link time");
+    }
+
+    /**
      * Returns a non-empty array of ModuleHashes recorded in each module
      * in the run-time image.
      *
diff --git a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java
index 4d91a00..a3c58f2 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java
@@ -2508,7 +2508,7 @@
     }
 
     /**
-     * Reads a CONSTANT_Pakcage_info item in {@code b}.  This method is
+     * Reads a CONSTANT_Package_info item in {@code b}.  This method is
      * intended for {@link Attribute} sub slasses, and is normally not needed
      * by class generators or adapters.</i>
      *
diff --git a/jdk/src/java.base/share/classes/jdk/internal/reflect/Reflection.java b/jdk/src/java.base/share/classes/jdk/internal/reflect/Reflection.java
index 9a41004..0d0ba62 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/reflect/Reflection.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/reflect/Reflection.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,9 +31,7 @@
 import java.util.Map;
 import java.util.Objects;
 import jdk.internal.HotSpotIntrinsicCandidate;
-import jdk.internal.misc.SharedSecrets;
 import jdk.internal.misc.VM;
-import sun.security.action.GetPropertyAction;
 
 /** Common utility routines used by both java.lang and
     java.lang.reflect */
@@ -104,39 +102,40 @@
                                           int modifiers)
         throws IllegalAccessException
     {
-        if (currentClass == null || memberClass == null) {
-            throw new InternalError();
-        }
-
         if (!verifyMemberAccess(currentClass, memberClass, targetClass, modifiers)) {
-            throwIllegalAccessException(currentClass, memberClass, targetClass, modifiers);
+            throw newIllegalAccessException(currentClass, memberClass, targetClass, modifiers);
         }
     }
 
     /**
-     * Verify access to a member, returning {@code false} if no access
+     * Verify access to a member and return {@code true} if it is granted.
+     *
+     * @param currentClass the class performing the access
+     * @param memberClass the declaring class of the member being accessed
+     * @param targetClass the class of target object if accessing instance
+     *                    field or method;
+     *                    or the declaring class if accessing constructor;
+     *                    or null if accessing static field or method
+     * @param modifiers the member's access modifiers
+     * @return {@code true} if access to member is granted
      */
     public static boolean verifyMemberAccess(Class<?> currentClass,
                                              Class<?> memberClass,
                                              Class<?> targetClass,
                                              int modifiers)
     {
-        // Verify that currentClass can access a field, method, or
-        // constructor of memberClass, where that member's access bits are
-        // "modifiers".
-
-        boolean gotIsSameClassPackage = false;
-        boolean isSameClassPackage = false;
-
         if (currentClass == memberClass) {
             // Always succeeds
             return true;
         }
 
-        if (!verifyModuleAccess(currentClass, memberClass)) {
+        if (!verifyModuleAccess(currentClass.getModule(), memberClass)) {
             return false;
         }
 
+        boolean gotIsSameClassPackage = false;
+        boolean isSameClassPackage = false;
+
         if (!Modifier.isPublic(getClassAccessFlags(memberClass))) {
             isSameClassPackage = isSameClassPackage(currentClass, memberClass);
             gotIsSameClassPackage = true;
@@ -196,39 +195,20 @@
     }
 
     /**
-     * Returns {@code true} if memberClass's's module exports memberClass's
-     * package to currentClass's module.
+     * Returns {@code true} if memberClass's module exports memberClass's
+     * package to currentModule.
      */
-    public static boolean verifyModuleAccess(Class<?> currentClass,
-                                             Class<?> memberClass) {
-        return verifyModuleAccess(currentClass.getModule(), memberClass);
-    }
-
     public static boolean verifyModuleAccess(Module currentModule, Class<?> memberClass) {
         Module memberModule = memberClass.getModule();
-
-        // module may be null during startup (initLevel 0)
-        if (currentModule == memberModule)
-           return true;  // same module (named or unnamed)
-
-        // memberClass may be primitive or array class
-        Class<?> c = memberClass;
-        while (c.isArray()) {
-            c = c.getComponentType();
-        }
-        if (c.isPrimitive())
+        if (currentModule == memberModule) {
+            // same module (named or unnamed) or both null if called
+            // before module system is initialized, which means we are
+            // dealing with java.base only.
             return true;
-
-        String pkg = c.getPackageName();
-        boolean allowed = memberModule.isExported(pkg, currentModule);
-        if (allowed && memberModule.isNamed() && printStackTraceWhenAccessSucceeds()) {
-            if (!SharedSecrets.getJavaLangReflectModuleAccess()
-                    .isStaticallyExported(memberModule, pkg, currentModule)) {
-                String msg = currentModule + " allowed access to member of " + memberClass;
-                new Exception(msg).printStackTrace(System.err);
-            }
+        } else {
+            String pkg = memberClass.getPackageName();
+            return memberModule.isExported(pkg, currentModule);
         }
-        return allowed;
     }
 
     /**
@@ -237,10 +217,6 @@
     private static boolean isSameClassPackage(Class<?> c1, Class<?> c2) {
         if (c1.getClassLoader() != c2.getClassLoader())
             return false;
-        while (c1.isArray())
-            c1 = c1.getComponentType();
-        while (c2.isArray())
-            c2 = c2.getComponentType();
         return Objects.equals(c1.getPackageName(), c2.getPackageName());
     }
 
@@ -356,52 +332,14 @@
         return false;
     }
 
-
-    // true to print a stack trace when access fails
-    private static volatile boolean printStackWhenAccessFails;
-
-    // true to print a stack trace when access succeeds
-    private static volatile boolean printStackWhenAccessSucceeds;
-
-    // true if printStack* values are initialized
-    private static volatile boolean printStackPropertiesSet;
-
-    private static void ensurePrintStackPropertiesSet() {
-        if (!printStackPropertiesSet && VM.initLevel() >= 1) {
-            String s = GetPropertyAction.privilegedGetProperty(
-                    "sun.reflect.debugModuleAccessChecks");
-            if (s != null) {
-                printStackWhenAccessFails = !s.equalsIgnoreCase("false");
-                printStackWhenAccessSucceeds = s.equalsIgnoreCase("access");
-            }
-            printStackPropertiesSet = true;
-        }
-    }
-
-    public static void enableStackTraces() {
-        printStackWhenAccessFails = true;
-        printStackWhenAccessSucceeds = true;
-        printStackPropertiesSet = true;
-    }
-
-    public static boolean printStackTraceWhenAccessFails() {
-        ensurePrintStackPropertiesSet();
-        return printStackWhenAccessFails;
-    }
-
-    public static boolean printStackTraceWhenAccessSucceeds() {
-        ensurePrintStackPropertiesSet();
-        return printStackWhenAccessSucceeds;
-    }
-
     /**
-     * Throws IllegalAccessException with the an exception message based on
+     * Returns an IllegalAccessException with an exception message based on
      * the access that is denied.
      */
-    private static void throwIllegalAccessException(Class<?> currentClass,
-                                                    Class<?> memberClass,
-                                                    Object target,
-                                                    int modifiers)
+    public static IllegalAccessException newIllegalAccessException(Class<?> currentClass,
+                                                                   Class<?> memberClass,
+                                                                   Class<?> targetClass,
+                                                                   int modifiers)
         throws IllegalAccessException
     {
         String currentSuffix = "";
@@ -413,11 +351,7 @@
         if (m2.isNamed())
             memberSuffix = " (in " + m2 + ")";
 
-        Class<?> c = memberClass;
-        while (c.isArray()) {
-            c = c.getComponentType();
-        }
-        String memberPackageName = c.getPackageName();
+        String memberPackageName = memberClass.getPackageName();
 
         String msg = currentClass + currentSuffix + " cannot access ";
         if (m2.isExported(memberPackageName, m1)) {
@@ -433,20 +367,6 @@
             if (m2.isNamed()) msg += " to " + m1;
         }
 
-        throwIllegalAccessException(msg);
-    }
-
-    /**
-     * Throws IllegalAccessException with the given exception message.
-     */
-    public static void throwIllegalAccessException(String msg)
-        throws IllegalAccessException
-    {
-        IllegalAccessException e = new IllegalAccessException(msg);
-        ensurePrintStackPropertiesSet();
-        if (printStackWhenAccessFails) {
-            e.printStackTrace(System.err);
-        }
-        throw e;
+        return new IllegalAccessException(msg);
     }
 }
diff --git a/jdk/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java b/jdk/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java
index 990de71..50200fd 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,7 @@
 import java.util.Objects;
 import java.util.Properties;
 
+import jdk.internal.misc.VM;
 import sun.reflect.misc.ReflectUtil;
 import sun.security.action.GetPropertyAction;
 
@@ -585,17 +586,10 @@
     private static void checkInitted() {
         if (initted) return;
 
-        // Tests to ensure the system properties table is fully
-        // initialized. This is needed because reflection code is
-        // called very early in the initialization process (before
-        // command-line arguments have been parsed and therefore
-        // these user-settable properties installed.) We assume that
-        // if System.out is non-null then the System class has been
-        // fully initialized and that the bulk of the startup code
-        // has been run.
-
-        if (System.out == null) {
-            // java.lang.System not yet fully initialized
+        // Defer initialization until module system is initialized so as
+        // to avoid inflation and spinning bytecode in unnamed modules
+        // during early startup.
+        if (!VM.isModuleSystemInited()) {
             return;
         }
 
diff --git a/jdk/src/java.base/share/classes/module-info.java b/jdk/src/java.base/share/classes/module-info.java
index 185f8f2..1c3f769 100644
--- a/jdk/src/java.base/share/classes/module-info.java
+++ b/jdk/src/java.base/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the foundational APIs of the Java SE Platform.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.base {
 
@@ -123,10 +126,9 @@
         jdk.jlink;
     exports jdk.internal.loader to
         java.instrument,
-        java.logging,
-        jdk.jlink;
+        java.logging;
     exports jdk.internal.jmod to
-        jdk.compiler,
+        jdk.compiler,   // reflective dependency
         jdk.jlink;
     exports jdk.internal.logger to
         java.logging;
@@ -134,14 +136,11 @@
         jdk.jartool,
         jdk.jlink,
         jdk.scripting.nashorn,
-        jdk.vm.ci;
+        jdk.internal.vm.ci;
     exports jdk.internal.org.objectweb.asm.tree to
         jdk.jlink;
     exports jdk.internal.org.objectweb.asm.util to
-        jdk.jlink,
         jdk.scripting.nashorn;
-    exports jdk.internal.org.objectweb.asm.tree.analysis to
-        jdk.jlink;
     exports jdk.internal.org.objectweb.asm.commons to
         jdk.scripting.nashorn;
     exports jdk.internal.org.objectweb.asm.signature to
@@ -155,7 +154,6 @@
         jdk.jlink;
     exports jdk.internal.misc to
         java.desktop,
-        jdk.incubator.httpclient,
         java.logging,
         java.management,
         java.naming,
@@ -164,8 +162,8 @@
         java.sql,
         java.xml,
         jdk.charsets,
-        jdk.compiler,
-        jdk.jartool,
+        jdk.compiler,   // reflective dependency
+        jdk.incubator.httpclient,
         jdk.jdeps,
         jdk.jlink,
         jdk.jshell,
@@ -173,7 +171,7 @@
         jdk.scripting.nashorn,
         jdk.scripting.nashorn.shell,
         jdk.unsupported,
-        jdk.vm.ci;
+        jdk.internal.vm.ci;
     exports jdk.internal.perf to
         java.desktop,
         java.management,
@@ -191,7 +189,7 @@
         jdk.unsupported;
     exports jdk.internal.vm.annotation to
         jdk.unsupported,
-        jdk.vm.ci;
+        jdk.internal.vm.ci;
     exports jdk.internal.util.jar to
         jdk.jartool,
         jdk.jdeps,
@@ -208,11 +206,10 @@
         jdk.naming.dns;
     exports sun.net.util to
         java.desktop,
-        jdk.jconsole,
-        jdk.naming.dns;
+        jdk.jconsole;
     exports sun.net.www to
-        jdk.incubator.httpclient,
         java.desktop,
+        jdk.incubator.httpclient,
         jdk.jartool;
     exports sun.net.www.protocol.http to
         java.security.jgss;
@@ -237,8 +234,7 @@
         java.management.rmi,
         java.rmi,
         java.sql.rowset,
-        java.xml,
-        java.xml.ws;
+        java.xml;
     exports sun.security.action to
         java.desktop,
         java.security.jgss;
diff --git a/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java b/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
index 9c46aad..d0e2a98 100644
--- a/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
+++ b/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@
 
 import java.lang.reflect.Modifier;
 import static java.lang.reflect.Modifier.*;
-import java.lang.reflect.Module;
 import java.util.Objects;
 import jdk.internal.reflect.Reflection;
 
@@ -39,6 +38,7 @@
 
     private VerifyAccess() { }  // cannot instantiate
 
+    private static final int UNCONDITIONAL_ALLOWED = java.lang.invoke.MethodHandles.Lookup.UNCONDITIONAL;
     private static final int MODULE_ALLOWED = java.lang.invoke.MethodHandles.Lookup.MODULE;
     private static final int PACKAGE_ONLY = 0;
     private static final int PACKAGE_ALLOWED = java.lang.invoke.MethodHandles.Lookup.PACKAGE;
@@ -92,7 +92,7 @@
                                              int      allowedModes) {
         if (allowedModes == 0)  return false;
         assert((allowedModes & PUBLIC) != 0 &&
-               (allowedModes & ~(ALL_ACCESS_MODES|PACKAGE_ALLOWED|MODULE_ALLOWED)) == 0);
+               (allowedModes & ~(ALL_ACCESS_MODES|PACKAGE_ALLOWED|MODULE_ALLOWED|UNCONDITIONAL_ALLOWED)) == 0);
         // The symbolic reference class (refc) must always be fully verified.
         if (!isClassAccessible(refc, lookupClass, allowedModes)) {
             return false;
@@ -173,7 +173,7 @@
                                             int allowedModes) {
         if (allowedModes == 0)  return false;
         assert((allowedModes & PUBLIC) != 0 &&
-               (allowedModes & ~(ALL_ACCESS_MODES|PACKAGE_ALLOWED|MODULE_ALLOWED)) == 0);
+               (allowedModes & ~(ALL_ACCESS_MODES|PACKAGE_ALLOWED|MODULE_ALLOWED|UNCONDITIONAL_ALLOWED)) == 0);
         int mods = getClassModifiers(refc);
         if (isPublic(mods)) {
 
@@ -191,22 +191,17 @@
                 (lookupModule == refModule))
                 return true;
 
-            // check readability
-            if (lookupModule.canRead(refModule)) {
+            // check readability when UNCONDITIONAL not allowed
+            if (((allowedModes & UNCONDITIONAL_ALLOWED) != 0)
+                || lookupModule.canRead(refModule)) {
 
                 // check that refc is in an exported package
-                Class<?> c = refc;
-                while (c.isArray()) {
-                    c = c.getComponentType();
-                }
-                if (c.isPrimitive())
-                    return true;
                 if ((allowedModes & MODULE_ALLOWED) != 0) {
-                    if (refModule.isExported(c.getPackageName(), lookupModule))
+                    if (refModule.isExported(refc.getPackageName(), lookupModule))
                         return true;
                 } else {
                     // exported unconditionally
-                    if (refModule.isExported(c.getPackageName()))
+                    if (refModule.isExported(refc.getPackageName()))
                         return true;
                 }
 
diff --git a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
index ee8f311..d6cc366 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
+++ b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,10 +50,8 @@
 import java.lang.module.ModuleDescriptor.Exports;
 import java.lang.module.ModuleDescriptor.Opens;
 import java.lang.module.ModuleDescriptor.Provides;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.net.URI;
@@ -428,7 +426,7 @@
                 abort(null, "java.launcher.jar.error3", jarname);
             }
 
-            // Add-Exports and Add-Opens to break encapsulation
+            // Add-Exports and Add-Opens
             String exports = mainAttrs.getValue(ADD_EXPORTS);
             if (exports != null) {
                 addExportsOrOpens(exports, false);
@@ -466,7 +464,8 @@
             if (s.length == 2) {
                 String mn = s[0];
                 String pn = s[1];
-                Layer.boot().findModule(mn).ifPresent(m -> {
+
+                ModuleLayer.boot().findModule(mn).ifPresent(m -> {
                     if (m.getDescriptor().packages().contains(pn)) {
                         if (open) {
                             Modules.addOpensToAllUnnamed(m, pn);
@@ -563,7 +562,7 @@
         }
 
         // main module is in the boot layer
-        Layer layer = Layer.boot();
+        ModuleLayer layer = ModuleLayer.boot();
         Optional<Module> om = layer.findModule(mainModule);
         if (!om.isPresent()) {
             // should not happen
@@ -591,8 +590,8 @@
                 c = Class.forName(m, cn);
             }
         } catch (LinkageError le) {
-            abort(null, "java.launcher.module.error3",
-                    mainClass, m.getName(), le.getLocalizedMessage());
+            abort(null, "java.launcher.module.error3", mainClass, m.getName(),
+                    le.getClass().getName() + ": " + le.getLocalizedMessage());
         }
         if (c == null) {
             abort(null, "java.launcher.module.error2", mainClass, mainModule);
@@ -638,14 +637,17 @@
                         String ncn = Normalizer.normalize(cn, Normalizer.Form.NFC);
                         mainClass = Class.forName(ncn, false, scl);
                     } catch (NoClassDefFoundError | ClassNotFoundException cnfe1) {
-                        abort(cnfe1, "java.launcher.cls.error1", cn);
+                        abort(cnfe1, "java.launcher.cls.error1", cn,
+                                cnfe1.getClass().getCanonicalName(), cnfe1.getMessage());
                     }
                 } else {
-                    abort(cnfe, "java.launcher.cls.error1", cn);
+                    abort(cnfe, "java.launcher.cls.error1", cn,
+                            cnfe.getClass().getCanonicalName(), cnfe.getMessage());
                 }
             }
         } catch (LinkageError le) {
-            abort(le, "java.launcher.cls.error6", cn, le.getLocalizedMessage());
+            abort(le, "java.launcher.cls.error6", cn,
+                    le.getClass().getName() + ": " + le.getLocalizedMessage());
         }
         return mainClass;
     }
@@ -850,7 +852,7 @@
         private static void setFXLaunchParameters(String what, int mode) {
 
             // find the module with the FX launcher
-            Optional<Module> om = Layer.boot().findModule(JAVAFX_GRAPHICS_MODULE_NAME);
+            Optional<Module> om = ModuleLayer.boot().findModule(JAVAFX_GRAPHICS_MODULE_NAME);
             if (!om.isPresent()) {
                 abort(null, "java.launcher.cls.error5");
             }
@@ -934,8 +936,7 @@
      * Called by the launcher to list the observable modules.
      * If called without any sub-options then the output is a simple list of
      * the modules. If called with sub-options then the sub-options are the
-     * names of the modules to list (-listmods:java.base,java.desktop for
-     * example).
+     * names of the modules to list (e.g. --list-modules java.base,java.desktop)
      */
     static void listModules(boolean printToStderr, String optionFlag)
         throws IOException, ClassNotFoundException
@@ -943,85 +944,97 @@
         initOutput(printToStderr);
 
         ModuleFinder finder = jdk.internal.module.ModuleBootstrap.finder();
-
         int colon = optionFlag.indexOf('=');
         if (colon == -1) {
             finder.findAll().stream()
-                .sorted(Comparator.comparing(ModuleReference::descriptor))
-                .forEach(md -> {
-                    ostream.println(midAndLocation(md.descriptor(),
-                                                   md.location()));
-                });
+                  .sorted(Comparator.comparing(ModuleReference::descriptor))
+                  .forEach(mref -> describeModule(finder, mref, false));
         } else {
             String[] names = optionFlag.substring(colon+1).split(",");
             for (String name: names) {
                 ModuleReference mref = finder.find(name).orElse(null);
                 if (mref == null) {
-                    System.err.format("%s not observable!%n", name);
+                    System.err.format("%s not found%n", name);
                     continue;
                 }
-
-                ModuleDescriptor md = mref.descriptor();
-                if (md.isOpen())
-                    ostream.print("open ");
-                if (md.isAutomatic())
-                    ostream.print("automatic ");
-                ostream.println("module " + midAndLocation(md, mref.location()));
-
-                // unqualified exports (sorted by package)
-                Set<Exports> exports = new TreeSet<>(Comparator.comparing(Exports::source));
-                md.exports().stream().filter(e -> !e.isQualified()).forEach(exports::add);
-                for (Exports e : exports) {
-                    String modsAndSource = Stream.concat(toStringStream(e.modifiers()),
-                            Stream.of(e.source()))
-                            .collect(Collectors.joining(" "));
-                    ostream.format("  exports %s%n", modsAndSource);
-                }
-
-                for (Requires d : md.requires()) {
-                    ostream.format("  requires %s%n", d);
-                }
-                for (String s : md.uses()) {
-                    ostream.format("  uses %s%n", s);
-                }
-
-                for (Provides ps : md.provides()) {
-                    ostream.format("  provides %s with %s%n", ps.service(),
-                            ps.providers().stream().collect(Collectors.joining(", ")));
-                }
-
-                // qualified exports
-                for (Exports e : md.exports()) {
-                    if (e.isQualified()) {
-                        String modsAndSource = Stream.concat(toStringStream(e.modifiers()),
-                                Stream.of(e.source()))
-                                .collect(Collectors.joining(" "));
-                        ostream.format("  exports %s", modsAndSource);
-                        formatCommaList(ostream, " to", e.targets());
-                    }
-                }
-
-                // open packages
-                for (Opens obj: md.opens()) {
-                    String modsAndSource = Stream.concat(toStringStream(obj.modifiers()),
-                            Stream.of(obj.source()))
-                            .collect(Collectors.joining(" "));
-                    ostream.format("  opens %s", modsAndSource);
-                    if (obj.isQualified())
-                        formatCommaList(ostream, " to", obj.targets());
-                    else
-                        ostream.println();
-                }
-
-                // non-exported/non-open packages
-                Set<String> concealed = new TreeSet<>(md.packages());
-                md.exports().stream().map(Exports::source).forEach(concealed::remove);
-                md.opens().stream().map(Opens::source).forEach(concealed::remove);
-                concealed.forEach(p -> ostream.format("  contains %s%n", p));
+                describeModule(finder, mref, true);
             }
         }
     }
 
+    /**
+     * Describes the given module.
+     */
+    static void describeModule(ModuleFinder finder,
+                               ModuleReference mref,
+                               boolean verbose)
+    {
+        ModuleDescriptor md = mref.descriptor();
+        ostream.print("module " + midAndLocation(md, mref.location()));
+        if (md.isAutomatic())
+            ostream.print(" automatic");
+        ostream.println();
+
+        if (!verbose)
+            return;
+
+        // unqualified exports (sorted by package)
+        Set<Exports> exports = new TreeSet<>(Comparator.comparing(Exports::source));
+        md.exports().stream().filter(e -> !e.isQualified()).forEach(exports::add);
+        for (Exports e : exports) {
+            String modsAndSource = Stream.concat(toStringStream(e.modifiers()),
+                    Stream.of(e.source()))
+                    .collect(Collectors.joining(" "));
+            ostream.format("  exports %s%n", modsAndSource);
+        }
+
+        for (Requires d : md.requires()) {
+            ostream.format("  requires %s", d);
+            String suffix = finder.find(d.name())
+                    .map(ModuleReference::descriptor)
+                    .map(any -> any.isAutomatic() ? " automatic" : "")
+                    .orElse(" not found");
+            ostream.println(suffix);
+        }
+        for (String s : md.uses()) {
+            ostream.format("  uses %s%n", s);
+        }
+
+        for (Provides ps : md.provides()) {
+            ostream.format("  provides %s with %s%n", ps.service(),
+                    ps.providers().stream().collect(Collectors.joining(", ")));
+        }
+
+        // qualified exports
+        for (Exports e : md.exports()) {
+            if (e.isQualified()) {
+                String modsAndSource = Stream.concat(toStringStream(e.modifiers()),
+                        Stream.of(e.source()))
+                        .collect(Collectors.joining(" "));
+                ostream.format("  exports %s", modsAndSource);
+                formatCommaList(ostream, " to", e.targets());
+            }
+        }
+
+        // open packages
+        for (Opens obj: md.opens()) {
+            String modsAndSource = Stream.concat(toStringStream(obj.modifiers()),
+                    Stream.of(obj.source()))
+                    .collect(Collectors.joining(" "));
+            ostream.format("  opens %s", modsAndSource);
+            if (obj.isQualified())
+                formatCommaList(ostream, " to", obj.targets());
+            else
+                ostream.println();
+        }
+
+        // non-exported/non-open packages
+        Set<String> concealed = new TreeSet<>(md.packages());
+        md.exports().stream().map(Exports::source).forEach(concealed::remove);
+        md.opens().stream().map(Opens::source).forEach(concealed::remove);
+        concealed.forEach(p -> ostream.format("  contains %s%n", p));
+    }
+
     static <T> String toString(Set<T> s) {
         return toStringStream(s).collect(Collectors.joining(" "));
     }
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties
index 23439de..7816cc0 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,19 +24,23 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Usage: {0} [options] class [args...]\n\
-\           (to execute a class)\n   or  {0} [options] -jar jarfile [args...]\n\
+java.launcher.opt.header  =   Usage: {0} [options] <mainclass> [args...]\n\
+\           (to execute a class)\n   or  {0} [options] -jar <jarfile> [args...]\n\
 \           (to execute a jar file)\n\
-\   or  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n\
+\   or  {0} [options] -m <module>[/<mainclass>] [args...]\n\
+\       {0} [options] --module <module>[/<mainclass>] [args...]\n\
 \           (to execute the main class in a module)\n\n\
-where options include:\n\n
+\ Arguments following the main class, -jar <jarfile>, -m or --module\n\
+\ <module>/<mainclass> are passed as the arguments to main class.\n\n\
+\ where options include:\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  Deprecated, will be removed in a future release\n
 java.launcher.opt.vmselect   =\    {0}\t  to select the "{1}" VM\n
 java.launcher.opt.hotspot    =\    {0}\t  is a synonym for the "{1}" VM  [deprecated]\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n\
+java.launcher.opt.footer = \
+\    -cp <class search path of directories and zip/jar files>\n\
 \    -classpath <class search path of directories and zip/jar files>\n\
 \    --class-path <class search path of directories and zip/jar files>\n\
 \                  A {0} separated list of directories, JAR archives,\n\
@@ -49,10 +53,6 @@
 \                  A {0} separated list of directories, each directory\n\
 \                  is a directory of modules that replace upgradeable\n\
 \                  modules in the runtime image\n\
-\    -m <module>[/<mainclass>]\n\
-\    --module <modulename>[/<mainclass>]\n\
-\                  the initial module to resolve, and the name of the main class\n\
-\                  to execute if not specified by the module\n\
 \    --add-modules <modulename>[,<modulename>...]\n\
 \                  root modules to resolve in addition to the initial module.\n\
 \                  <modulename> can also be ALL-DEFAULT, ALL-SYSTEM,\n\
@@ -102,8 +102,11 @@
 \                  should always be passed as the argument to the -splash option.\n\
 \                  The most appropriate scaled image provided will be picked up\n\
 \                  automatically.\n\
-\                  See the SplashScreen API documentation for more information.\n\
-\    @<filepath>   read options from the specified file\n\n\
+\                  See the SplashScreen API documentation for more information\n\
+\    @argument files\n\
+\                  one or more argument files containing options\n\
+\    -disable-@files\n\
+\                  prevent further argument file expansion\n\
 \To specify an argument for a long option, you can use --<name>=<value> or\n\
 \--<name> <value>.\n
 
@@ -129,7 +132,7 @@
 \    -Xms<size>        set initial Java heap size\n\
 \    -Xmx<size>        set maximum Java heap size\n\
 \    -Xnoclassgc       disable class garbage collection\n\
-\    -Xprof            output cpu profiling data\n\
+\    -Xprof            output cpu profiling data (deprecated)\n\
 \    -Xrs              reduce use of OS signals by Java/VM (see documentation)\n\
 \    -Xshare:auto      use shared class data if possible (default)\n\
 \    -Xshare:off       do not attempt to use shared class data\n\
@@ -157,6 +160,10 @@
 \    --add-opens <module>/<package>=<target-module>(,<target-module>)*\n\
 \                      updates <module> to open <package> to\n\
 \                      <target-module>, regardless of module declaration.\n\
+\    --permit-illegal-access\n\
+\                      permit illegal access to members of types in named modules\n\
+\                      by code in unnamed modules. This compatibility option will\n\
+\                      be removed in the next release.\n\
 \    --disable-@files  disable further argument file expansion\n\
 \    --patch-module <module>=<file>({0}<file>)*\n\
 \                      Override or augment a module with classes and resources\n\
@@ -175,7 +182,8 @@
 \                      override default icon displayed in dock\n\n
 
 java.launcher.cls.error1=\
-    Error: Could not find or load main class {0}
+    Error: Could not find or load main class {0}\n\
+    Caused by: {1}: {2}
 java.launcher.cls.error2=\
     Error: Main method is not {0} in class {1}, please define the main method as:\n\
 \   public static void main(String[] args)
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_de.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_de.properties
index 2272ae9..b3d9295 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_de.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_de.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,21 +24,18 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Verwendung: {0} [Optionen] Klasse [Argumente...]\n           (zur Ausf\u00FChrung einer Klasse)\n   oder  {0} [Optionen] -jar JAR-Datei [Argumente...]\n           (zur Ausf\u00FChrung einer JAR-Datei)\n   oder  {0} [Optionen] -p <Modulpfad> -m <Modulname>[/<Hauptklasse>] [Argumente...]\n           (zur Ausf\u00FChrung der Hauptklasse in einem Modul)\nwobei "Optionen" Folgendes umfasst:\n
+java.launcher.opt.header  =   Verwendung: {0} [Optionen] Klasse [Argumente...]\n           (zur Ausf\u00FChrung einer Klasse)\n   oder  {0} [Optionen] -jar JAR-Datei [Argumente...]\n           (zur Ausf\u00FChrung einer JAR-Datei)\n   oder  {0} [Optionen] -p <Modulpfad> -m <Modulname>[/<Hauptklasse>] [Argumente...]\n           (zur Ausf\u00FChrung der Hauptklasse in einem Modul)\nwobei "Optionen" Folgendes umfasst:\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  Veraltet, wird in einem zuk\u00FCnftigen Release entfernt\n
 java.launcher.opt.vmselect   =\    {0}\t  zur Auswahl der "{1}" VM\n
 java.launcher.opt.hotspot    =\    {0}\t  ist ein Synonym f\u00FCr die "{1}" VM  [verworfen]\n
 
-java.launcher.ergo.message1  =\                  Die Standard-VM ist {0}
-java.launcher.ergo.message2  =\                  weil die Ausf\u00FChrung auf einem Server-Class-Rechner erfolgt.\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =-cp <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n    -classpath <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n    --class-path <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n                  Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n                  und ZIP-Archiven zur Suche nach Klassendateien.\n    -p <Modulpfad>\n    --module-path <Modulpfad>...\n                  Eine durch {0} getrennte Liste mit Verzeichnissen, wobei jedes Verzeichnis\n                  ein Modulverzeichnis ist.\n    --upgrade-module-path <Modulpfad>...\n                  Eine durch {0} getrennte Liste mit Verzeichnissen, wobei jedes Verzeichnis\n                  ein Verzeichnis mit Modulen ist, die upgradef\u00E4hige\n                  Module im Laufzeitimage ersetzen\n    -m <Modul>[/<Hauptklasse>]\n    --module <Modulname>[/<Hauptklasse>]\n                  Das anf\u00E4ngliche aufzul\u00F6sende Modul und der Name der auszuf\u00FChrenden\n                  Hauptklasse, wenn nicht durch das Modul angegeben\n    --add-modules <Modulname>[,<Modulname>...]\n                  Zus\u00E4tzlich zum anf\u00E4nglichen Modul aufzul\u00F6sende Root-Module.\n                  <Modulname> kann auch ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH sein.\n    --limit-modules <Modulname>[,<Modulname>...]\n                  Begrenzt die Gesamtheit der beobachtbaren Module\n    --list-modules [<Modulname>[,<Modulname>...]]\n                  F\u00FChrt die beobachtbaren Module auf und beendet den Vorgang\n    --dry-run     Erstellt VM, f\u00FChrt jedoch die Hauptmethode nicht aus.\n                  Diese --dry-run-Option kann zur Validierung der Befehlszeilenoptionen,\n                  etwa der Modulsystemkonfiguration, n\u00FCtzlich sein.\n    -D<Name>=<Wert>\n                  Legt eine Systemeigenschaft fest\n    -verbose:[class|gc|jni]\n                  Aktiviert Verbose-Ausgabe\n    -version      Druckt die Produktversion in den Fehlerstream und beendet den Vorgang\n    --version     Druckt die Produktversion in den Ausgabestream und beendet den Vorgang\n    -showversion  Druckt die Produktversion in den Fehlerstream und f\u00E4hrt fort\n    --show-version\n                  Druckt die Produktversion in den Ausgabestream und f\u00E4hrt fort\n    -? -h -help\n                   Gibt diese Hilfemeldung in den Fehlerstream aus\n    --help         Gibt diese Hilfemeldung in den Ausgabestream aus\n    -X            Gibt Hilfe zu zus\u00E4tzlichen Optionen in den Fehlerstream aus\n   --help-extra  Gibt Hilfe zu zus\u00E4tzlichen Optionen in den Ausgabestream aus\n    -ea[:<Packagename>...|:<Klassenname>]\n    -enableassertions[:<Packagename>...|:<Klassenname>]\n                  Aktiviert Assertions mit angegebener Granularit\u00E4t\n    -da[:<Packagename>...|:<Klassenname>]\n    -disableassertions[:<Packagename>...|:<Klassenname>]\n                  Deaktiviert Assertions mit angegebener Granularit\u00E4t\n    -esa | -enablesystemassertions\n                  Aktiviert System-Assertions\n    -dsa | -disablesystemassertions\n                  Deaktiviert System-Assertions\n    -agentlib:<Lib-Name>[=<Optionen>]\n                  L\u00E4dt native Agent Library <Lib-Name>, Beispiel: -agentlib:jdwp\n                  siehe auch -agentlib:jdwp=help\n    -agentpath:<Pfadname>[=<Optionen>]\n                  L\u00E4dt native Agent Library nach vollst\u00E4ndigem Pfadnamen\n    -javaagent:<JAR-Pfad>[=<Optionen>]\n                  L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n    -splash:<Bildpfad>\n                  Zeigt Begr\u00FC\u00DFungsbildschirm mit angegebenem Bild an\n                  HiDPI-skalierte Bilder werden automatisch unterst\u00FCtzt und verwendet,\n                  sofern verf\u00FCgbar. Der nicht skalierte Bilddateiname, z.B. image.ext,\n                  muss immer als Argument an die Option -splash \u00FCbergeben \
+werden.\n                  Das geeignetste skalierte Bild wird automatisch\n                  ausgew\u00E4hlt.\n                  Weitere Informationen finden Sie in der Dokumentation zur SplashScreen-API.\n    @<Dateipfad>   Liest Optionen aus der angegebenen Datei\n\nZur Angabe eines Arguments f\u00FCr eine lange Option k\u00F6nnen Sie --<Name>=<Wert> oder\n--<Name> <Wert> verwenden.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n    -classpath <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n    --class-path <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n                  Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n                  und ZIP-Archiven zur Suche nach Klassendateien.\n    -p <Modulpfad>\n    --module-path <Modulpfad>...\n                  Eine durch {0} getrennte Liste mit Verzeichnissen, wobei jedes Verzeichnis\n                  ein Modulverzeichnis ist.\n    --upgrade-module-path <Modulpfad>...\n                  Eine durch {0} getrennte Liste mit Verzeichnissen, wobei jedes Verzeichnis\n                  ein Verzeichnis mit Modulen ist, die upgradef\u00E4hige\n                  Module im Laufzeitimage ersetzen\n    -m <Modul>[/<Hauptklasse>]\n    --module <Modulname>[/<Hauptklasse>]\n                  Das anf\u00E4ngliche aufzul\u00F6sende Modul und der Name der auszuf\u00FChrenden\n                  Hauptklasse, wenn nicht durch das Modul angegeben\n    --add-modules <Modulname>[,<Modulname>...]\n                  Zus\u00E4tzlich zu dem anf\u00E4nglichen Modul aufzul\u00F6sende Root-Module.\n                  <Modulname> kann auch ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH sein.\n    --limit-modules <Modulname>[,<Modulname>...]\n                  Begrenzt die gesamten beobachtbaren Module\n    --list-modules [<Modulname>[,<Modulname>...]]\n                  F\u00FChrt die beobachtbaren Module auf und beendet den Vorgang\n    --dry-run     Erstellt VM, f\u00FChrt jedoch die Hauptmethode nicht aus.\n                  Diese --dry-run-Option kann zur Validierung der Befehlszeilenoptionen\n                  n\u00FCtzlich sein, wie der Modulsystemkonfiguration.\n    -D<Name>=<Wert>\n                  Setzt eine Systemeigenschaft\n    -verbose:[class|gc|jni]\n                  Aktiviert Verbose-Ausgabe\n    -version      Druckt Produktversion und beendet den Vorgang\n    -showversion  Druckt Produktversion und f\u00E4hrt fort\n    -? -help --help\n                  Gibt diese Hilfemeldung aus\n    -X            Gibt Hilfe zu Nicht-Standardoptionen aus\n    -ea[:<Packagename>...|:<Klassenname>]\n    -enableassertions[:<Packagename>...|:<Klassenname>]\n                  Aktiviert Assertions mit angegebener Granularit\u00E4t\n    -da[:<Packagename>...|:<Klassenname>]\n    -disableassertions[:<Packagename>...|:<Klassenname>]\n                  Deaktiviert Assertions mit angegebener Granularit\u00E4t\n    -esa | -enablesystemassertions\n                  Aktiviert System-Assertions\n    -dsa | -disablesystemassertions\n                  Deaktiviert System-Assertions\n    -agentlib:<Lib-Name>[=<Optionen>]\n                  L\u00E4dt native Agent Library <Lib-Name>, Beispiel: -agentlib:jdwp\n                  siehe auch -agentlib:jdwp=help\n    -agentpath:<Pfadname>[=<Optionen>]\n                  L\u00E4dt native Agent Library nach vollst\u00E4ndigem Pfadnamen\n    -javaagent:<JAR-Pfad>[=<Optionen>]\n                  L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n    -splash:<Bildpfad>\n                  Zeigt Begr\u00FC\u00DFungsbildschirm mit angegebenem Bild an\n                  HiDPI-skalierte Bilder werden automatisch unterst\u00FCtzt und verwendet,\n                  sofern verf\u00FCgbar. Der nicht skalierte Bilddateiname, z.B. image.ext,\n                  muss immer als Argument an die Option -splash \u00FCbergeben werden.\n                  Das geeignetste skalierte Bild wird automatisch\n                  ausgew\u00E4hlt.\n                  Weitere Informationen finden Sie in der Dokumentation zu SplashScreen-API.\n    @<Dateipfad>   Liest Optionen aus der angegebenen Datei\nZur Angabe eines Arguments f\u00FCr eine lange Option k\u00F6nnen Sie --<Name>=<Wert> oder\n--<Name> <Wert> verwenden.\n
-See Weitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html.
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           Deaktiviert Hintergrundkompilierung\n    -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n                      an Ende von Bootstrap-Klassenpfad anh\u00E4ngen\n    -Xcheck:jni       F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen aus\n    -Xcomp            Erzwingt Kompilierung von Methoden beim ersten Aufruf\n    -Xdebug           Wird zur Abw\u00E4rtskompatiblit\u00E4t bereitgestellt\n    -Xdiag            Zeigt zus\u00E4tzliche Diagnosemeldungen\n    -Xdiag:resolver   Zeigt Resolver-Diagnosemeldungen\n    -Xfuture          Aktiviert strengste Pr\u00FCfungen, als m\u00F6glicher zuk\u00FCnftiger Standardwert erwartet\n    -Xint             Nur Ausf\u00FChrung im interpretierten Modus\n    -Xinternalversion\n                      Zeigt detailliertere JVM-Versionsinformationen an als die\n                      -version-Option\n    -Xloggc:<file>    Protokolliert GC-Status in einer Datei mit Zeitstempeln\n    -Xmixed           Ausf\u00FChrung im gemischten Modus (Standard)\n    -Xmn<size>        Setzt die anf\u00E4ngliche und maximale Gr\u00F6\u00DFe (in Byte) des Heaps\n                      f\u00FCr die junge Generation (Nursery)\n    -Xms<size>        Setzt die anf\u00E4ngliche Java-Heap-Gr\u00F6\u00DFe\n    -Xmx<size>        Setzt die maximale Java-Heap-Gr\u00F6\u00DFe\n    -Xnoclassgc       Deaktiviert die Klassen-Garbage Collection\n    -Xprof            Gibt CPU-Profilierungsdaten aus\n    -Xrs              Reduziert die Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n    -Xshare:auto      Verwendet freigegebene Klassendaten, wenn m\u00F6glich (Standard)\n    -Xshare:off       Versucht nicht, freigegebene Klassendaten zu verwenden\n    -Xshare:on        Erfordert die Verwendung von freigegebenen Klassendaten, verl\u00E4uft sonst nicht erfolgreich.\n    -XshowSettings    Zeigt alle Einstellungen und f\u00E4hrt fort\n    -XshowSettings:all\n                      Zeigt alle Einstellungen und f\u00E4hrt fort\n    -XshowSettings:locale\n                      Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n    -XshowSettings:properties\n                      Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n    -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n    -Xss<size>        Setzt Stackgr\u00F6\u00DFe des Java-Threads\n    -Xverify          Setzt den Modus der Bytecodeverifizierung\n    --add-reads <Modul>=<Zielmodul>(,<Zielmodul>)*\n                      Aktualisiert <Modul>, damit <Zielmodul> gelesen wird, ungeachtet \n                      der Moduldeklaration. \n                      <Zielmodul> kann ALL-UNNAMED sein, um alle unbenannten\n                      Module zu lesen.\n    --add-exports <Modul>/<Package>=<Zielmodul>(,<Zielmodul>)*\n                      Aktualisiert <Modul>, um <Package> in <Zielmodul> zu exportieren,\n                      ungeachtet der Moduldeklaration.\n                      <Zielmodul> kann ALL-UNNAMED sein, um in alle \n                      unbenannten Module zu exportieren.\n    --disable-@files  Deaktiviert das weitere Einblenden der Argumentdatei\n    --patch-module <Modul>=<Datei>({0}<Datei>)*\n                      Setzt ein Modul au\u00DFer Kraft oder erweitert ein Modul mit Klassen und Ressourcen\n                      in JAR-Dateien oder -Verzeichnissen.\n\nDiese Optionen sind Nicht-Standardoptionen und k\u00F6nnen ohne Ank\u00FCndigung ge\u00E4ndert werden.\n
+java.launcher.X.usage=\n    -Xbatch           Deaktiviert Hintergrundkompilierung\n    -Xbootclasspath/a: <Durch {0} getrennte Verzeichnisse und ZIP-/JAR-Dateien>\n                      an Ende von Bootstrap-Klassenpfad anh\u00E4ngen\n    -Xcheck:jni       F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen aus\n    -Xcomp            Erzwingt Kompilierung von Methoden beim ersten Aufruf\n    -Xdebug           Wird zur Abw\u00E4rtskompatiblit\u00E4t bereitgestellt\n    -Xdiag            Zeigt zus\u00E4tzliche Diagnosemeldungen an\n    -Xdiag:resolver   Zeigt Resolver-Diagnosemeldungen an\n    -Xfuture          Aktiviert strengste Pr\u00FCfungen, wird als m\u00F6glicher zuk\u00FCnftiger Standardwert erwartet\n    -Xint             Nur Ausf\u00FChrung im interpretierten Modus\n    -Xinternalversion\n                      Zeigt detailliertere JVM-Versionsinformationen an als die\n                      Option -version\n    -Xloggc:<Datei>    Protokolliert GC-Status in einer Datei mit Zeitstempeln\n    -Xmixed           Ausf\u00FChrung im gemischten Modus (Standard)\n    -Xmn<Gr\u00F6\u00DFe>        Legt die anf\u00E4ngliche und maximale Gr\u00F6\u00DFe (in Byte) des Heaps\n                      f\u00FCr die junge Generation (Nursery) fest\n    -Xms<Gr\u00F6\u00DFe>        Legt die anf\u00E4ngliche Java-Heap-Gr\u00F6\u00DFe fest\n    -Xmx<Gr\u00F6\u00DFe>        Legt die maximale Java-Heap-Gr\u00F6\u00DFe fest\n    -Xnoclassgc       Deaktiviert die Klassen-Garbage Collection\n    -Xprof            Gibt CPU-Profilierungsdaten aus\n    -Xrs              Reduziert die Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n    -Xshare:auto      Verwendet, wenn m\u00F6glich, freigegebene Klassendaten (Standard)\n    -Xshare:off       Versucht, keine freigegebene Klassendaten zu verwenden\n    -Xshare:on        Erfordert die Verwendung von freigegebenen Klassendaten, verl\u00E4uft sonst nicht erfolgreich.\n    -XshowSettings    Zeigt alle Einstellungen an und f\u00E4hrt fort\n    -XshowSettings:all\n                      Zeigt alle Einstellungen an und f\u00E4hrt fort\n    -XshowSettings:locale\n                      Zeigt alle gebietsschemabezogenen Einstellungen an und f\u00E4hrt fort\n    -XshowSettings:properties\n                      Zeigt alle Eigenschaftseinstellungen an und f\u00E4hrt fort\n    -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen an und f\u00E4hrt fort\n    -Xss<Gr\u00F6\u00DFe>        Legt Stack-Gr\u00F6\u00DFe des Java-Threads fest\n    -Xverify          Legt den Modus der Bytecodeverifizierung fest\n    --add-reads <Modul>=<Zielmodul>(,<Zielmodul>)*\n                      Aktualisiert <Modul>, damit <Zielmodul> ungeachtet der\n                      der Moduldeklaration gelesen wird. \n                      <Zielmodul> kann ALL-UNNAMED sein, um alle unbenannten\n                      Module zu lesen.\n    --add-exports <Modul>/<Package>=<Zielmodul>(,<Zielmodul>)*\n                      Aktualisiert <Modul>, um <Package> ungeachtet der Moduldeklaration\n                        in <Zielmodul> zu exportieren.\n                      <Zielmodul> kann ALL-UNNAMED sein, um in alle \n                      unbenannten Module zu exportieren.\n    --add-opens <Modul>/<Package>=<Zielmodul>(,<Zielmodul>)*\n                      Aktualisiert <Modul>, um <Package> ungeachtet der Moduldeklaration\n                      in <Zielmodul> zu \u00F6ffnen.\n    --disable-@files  Deaktiviert das weitere Einblenden der Argumentdatei\n    --patch-module <Modul>=<Datei>({0}<Datei>)*\n                      \u00DCberschreibt oder erweitert ein Modul in JAR-Dateien\n                      oder -Verzeichnissen mit Klassen und Ressourcen.\n\nDiese zus\u00E4tzlichen Optionen k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\nDie folgenden Optionen sind f\u00FCr Mac OS X spezifisch:\n    -XstartOnFirstThread\n                      main()-Methode f\u00FCr den ersten (AppKit) Thread ausf\u00FChren\n    -Xdock:name=<application name>\n                      Den im Dock angezeigten Standardanwendungsnamen \u00FCberschreiben\n    -Xdock:icon=<Pfad zu Symboldatei>\n                      Das im Dock angezeigte Standardsymbol \u00FCberschreiben\n\n
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_es.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_es.properties
index c837084..12052a2 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_es.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_es.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,22 +24,19 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Sintaxis: {0} [opciones] class [argumentos...]\n           (para ejecutar una clase)\n   o  {0} [opciones] -jar jarfile [argumentos...]\n           (para ejecutar un archivo jar)\n   o  {0} [opciones] -p <ruta_m\u00F3dulo> -m <nombre_m\u00F3dulo>[/<clase_principal>] [argumentos...]\n           (para ejecutar la clase principal en un m\u00F3dulo)\ndonde las opciones incluyen:\n
+java.launcher.opt.header  =   Sintaxis: {0} [opciones] class [argumentos...]\n           (para ejecutar una clase)\n   o  {0} [opciones] -jar jarfile [argumentos...]\n           (para ejecutar un archivo jar)\n   o  {0} [opciones] -p <ruta_m\u00F3dulo> -m <nombre_m\u00F3dulo>[/<clase_principal>] [argumentos...]\n           (para ejecutar la clase principal en un m\u00F3dulo)\ndonde las opciones incluyen:\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  Anticuada, se eliminar\u00E1 en una versi\u00F3n futura\n
 java.launcher.opt.vmselect   =\    {0}\t  para seleccionar la VM "{1}"\n
 java.launcher.opt.hotspot    =\    {0}\t  es un sin\u00F3nimo de la VM "{1}" [anticuada]\n
 
-java.launcher.ergo.message1  =\                  La VM por defecto es {0}
-java.launcher.ergo.message2  =\                  porque la ejecuci\u00F3n se est\u00E1 llevando a cabo en una m\u00E1quina de clase de servidor.\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =-cp <ruta de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n    -classpath <ruta de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n    --class-path <ruta de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n                  Lista separada por {0} de directorios, archivos JAR\n                  y archivos ZIP para buscar archivos de clase.\n    -p <ruta_m\u00F3dulo>\n    --module-path <ruta_m\u00F3dulo>...\n                  Lista separada por {0} de directorios, cada directorio\n                  es un directorio de m\u00F3dulos.\n    --upgrade-module-path <ruta_m\u00F3dulo>...\n                  Lista separada por {0} de directorios, cada directorio\n                  es un directorio de m\u00F3dulos que sustituye a los m\u00F3dulos\n                  actualizables en la imagen de tiempo de ejecuci\u00F3n\n    -m <m\u00F3dulo>[/<clase_principal>]\n    --module <nombre_m\u00F3dulo>[/<clase_principal>]\n                  m\u00F3dulo inicial que resolver y nombre de la clase principal\n                  que ejecutar si el m\u00F3dulo no la especifica\n    --add-modules <nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]\n                  m\u00F3dulos ra\u00EDz que resolver, adem\u00E1s del m\u00F3dulo inicial.\n                  <nombre_m\u00F3dulo> tambi\u00E9n puede ser ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH.\n    --limit-modules <nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]\n                  limitar el universo de los m\u00F3dulos observables\n    --list-modules [<nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]]\n                  mostrar los m\u00F3dulos observables y salir\n    --dry-run     crear VM pero no ejecutar m\u00E9todo principal.\n                  Esta opci\u00F3n --dry-run puede ser \u00FAtil para validar las\n                  opciones de l\u00EDnea de comandos como la configuraci\u00F3n del sistema de m\u00F3dulo.\n    -D<nombre>=<valor>\n                  definir una propiedad del sistema\n    -verbose:[class|gc|jni]\n                  activar la salida detallada\n    -version      imprimir la versi\u00F3n del producto en el flujo de errores y salir\n    ---version      imprimir la versi\u00F3n del producto en el flujo de salida y salir\n    -showversion  imprimir la versi\u00F3n del producto en el flujo de errores y continuar\n    --show-version\n                  imprimir la versi\u00F3n del producto en el flujo de salida y continuar\n    -? -h -help\n                  imprimir este mensaje de ayuda en el flujo de errores\n    --help        imprimir este mensaje de ayuda en el flujo de salida\n    -X            imprimir la ayuda de opciones adicionales en el flujo de errores\n    --help-extra  imprimir la ayuda de opciones adicionales en el fujo de salida\n    -ea[:<nombre_paquete>...|:<nombre_clase>]\n    -enableassertions[:<nombre_paquete>...|:<nombre_clase>]\n                  activar afirmaciones con la granularidad especificada\n    -da[:<nombre_paquete>...|:<nombre_clase>]\n    -disableassertions[:<nombre_paquete>...|:<nombre_clase>]\n                  desactivar afirmaciones con la granularidad especificada\n    -esa | -enablesystemassertions\n                  activar afirmaciones del sistema\n    -dsa | -disablesystemassertions\n                  desactivar afirmaciones del sistema\n    -agentlib:<nombre_bib>[=<opciones>]\n                  cargar biblioteca de agentes nativos <nombre_bib>, por ejemplo, -agentlib:jdwp\n                  ver tambi\u00E9n -agentlib:jdwp=help\n    -agentpath:<nombre_ruta>[=<opciones>]\n                  cargar biblioteca de agentes nativos por nombre de ruta completo\n    -javaagent:<ruta_jar>[=<opciones>]\n                  cargar agente de lenguaje de programaci\u00F3n Java, ver java.lang.instrument\n    -splash:<ruta_imagen>\n                  mostrar pantalla de presentaci\u00F3n con la imagen especificada\n                  Las im\u00E1genes a escala HiDPI est\u00E1n \
+soportadas y se usan autom\u00E1ticamente\n                  si est\u00E1n disponibles. El nombre de archivo de la imagen sin escala, por ejemplo, image.ext,\n                  siempre debe transferirse como el argumento en la opci\u00F3n -splash.\n                  La imagen a escala m\u00E1s adecuada que se haya proporcionado se escoger\u00E1\n                  autom\u00E1ticamente.\n                  Consulte la documentaci\u00F3n de la API de la pantalla de presentaci\u00F3n para obtener m\u00E1s informaci\u00F3n.\n    en<ruta_archivo>   leer opciones del archivo especificado\nPara especificar un argumento para una opci\u00F3n larga, puede usar --<nombre>=<valor> o\n--<nombre> <valor>.
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <ruta de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n    -classpath <ruta de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n    --class-path <ruta de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n                  Lista separada por {0} de directorios, archivos JAR\n                  y archivos ZIP para buscar archivos de clase.\n    -p <ruta_m\u00F3dulo>\n    --module-path <ruta_m\u00F3dulo>...\n                  Lista separada por {0} de directorios, cada directorio\n                  es un directorio de m\u00F3dulos.\n    --upgrade-module-path <ruta_m\u00F3dulo>...\n                  Lista separada por {0} de directorios, cada directorio\n                  es un directorio de m\u00F3dulos que sustituye a los m\u00F3dulos\n                  actualizables en la imagen de tiempo de ejecuci\u00F3n\n    -m <m\u00F3dulo>[/<clase_principal>]\n    --module <nombre_m\u00F3dulo>[/<clase_principal>]\n                  m\u00F3dulo inicial que resolver y nombre de la clase principal\n                  que ejecutar si el m\u00F3dulo no la especifica\n    --add-modules <nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]\n                  m\u00F3dulos ra\u00EDz que resolver, adem\u00E1s del m\u00F3dulo inicial.\n                  <nombre_m\u00F3dulo> tambi\u00E9n puede ser ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH.\n    --limit-modules <nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]\n                  limitar el universo de los m\u00F3dulos observables\n    --list-modules [<nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]]\n                  mostrar los m\u00F3dulos observables y salir\n    --dry-run     crear VM pero no ejecutar m\u00E9todo principal.\n                  Esta opci\u00F3n --dry-run puede ser \u00FAtil para validar las\n                  opciones de l\u00EDnea de comandos como la configuraci\u00F3n del sistema de m\u00F3dulo.\n    -D<nombre>=<valor>\n                  definir una propiedad del sistema\n    -verbose:[class|gc|jni]\n                  activar la salida detallada\n    -version      imprimir la versi\u00F3n del producto y salir\n    -showversion  imprimir la versi\u00F3n del producto y continuar\n    -? -help --help\n                  imprimir este mensaje de ayuda\n    -X            imprimir la ayuda de opciones no est\u00E1ndar\n    -ea[:<nombre_paquete>...|:<nombre_clase>]\n    -enableassertions[:<nombre_paquete>...|:<nombre_clase>]\n                  activar afirmaciones con la granularidad especificada\n    -da[:<nombre_paquete>...|:<nombre_clase>]\n    -disableassertions[:<nombre_paquete>...|:<nombre_clase>]\n                  desactivar afirmaciones con la granularidad especificada\n    -esa | -enablesystemassertions\n                  activar afirmaciones del sistema\n    -dsa | -disablesystemassertions\n                  desactivar afirmaciones del sistema\n    -agentlib:<nombre_bib>[=<opciones>]\n                  cargar biblioteca de agentes nativos <nombre_bib>, por ejemplo, -agentlib:jdwp\n                  ver tambi\u00E9n -agentlib:jdwp=help\n    -agentpath:<nombre_ruta>[=<opciones>]\n                  cargar biblioteca de agentes nativos por nombre de ruta completo\n    -javaagent:<ruta_jar>[=<opciones>]\n                  cargar agente de lenguaje de programaci\u00F3n Java, ver java.lang.instrument\n    -splash:<ruta_imagen>\n                  mostrar pantalla de bienvenida con la imagen especificada\n                  Las im\u00E1genes a escala HiDPI est\u00E1n soportadas y se usan autom\u00E1ticamente\n                  si est\u00E1n disponibles. El nombre de archivo de la imagen sin escala, por ejemplo, image.ext,\n                  siempre debe transferirse como el argumento en la opci\u00F3n -splash.\n                  La imagen a escala m\u00E1s adecuada que se haya proporcionado se escoger\u00E1\n                  autom\u00E1ticamente.\n                  Consulte la documentaci\u00F3n de \
-la API de la pantalla de bienvenida para obtener m\u00E1s informaci\u00F3n.\n    en<ruta_archivo>   leer opciones del archivo especificado\nPara especificar un argumento para una opci\u00F3n larga, puede usar --<nombre>=<valor> o\n--<nombre> <valor>.\n
-See http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n.
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           desactivar compilaci\u00F3n de fondo\n    -Xbootclasspath/a:<directorios y archivos zip/jar separados por {0}>\n                      agregar al final de la ruta de la clase de inicializaci\u00F3n de datos\n    -Xcheck:jni       realizar comprobaciones adicionales para las funciones de JNI\n    -Xcomp            fuerza la compilaci\u00F3n de m\u00E9todos en la primera llamada\n    -Xdebug           se proporciona para ofrecer compatibilidad con versiones anteriores\n    -Xdiag            mostrar mensajes de diagn\u00F3stico adicionales\n    -Xdiag:resolver   mostrar mensajes de diagn\u00F3stico de resoluci\u00F3n\n    -Xfuture          activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n    -Xint             solo ejecuci\u00F3n de modo interpretado\n    -Xinternalversion\n                      muestra una informaci\u00F3n de la versi\u00F3n de JVM m\u00E1s detallada que la\n                      opci\u00F3n -version\n    -Xloggc:<archivo>    registrar el estado de GC en un archivo con registros de hora\n    -Xmixed           ejecuci\u00F3n de modo mixto (por defecto)\n    -Xmn<tama\u00F1o>        define el tama\u00F1o inicial y m\u00E1ximo (en bytes) de la pila\n                      para la generaci\u00F3n m\u00E1s joven (espacio infantil)\n    -Xms<size>        define el tama\u00F1o inicial de la pila de Java\n    -Xmx<size>        define el tama\u00F1o m\u00E1ximo de la pila de Java\n    -Xnoclassgc       desactivar la recolecci\u00F3n de basura de clases\n    -Xprof            datos de creaci\u00F3n de perfiles de CPU de salida\n    -Xrs              reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n    -Xshare:auto      usar datos de clase compartidos si es posible (valor por defecto)\n    -Xshare:off       no intentar usar datos de clase compartidos\n    -Xshare:on        es obligatorio el uso de datos de clase compartidos, de lo contrario se producir\u00E1 un fallo.\n    -XshowSettings    mostrar toda la configuraci\u00F3n y continuar\n    -XshowSettings:all\n                      mostrar todos los valores y continuar\n    -XshowSettings:locale\n                      mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n    -XshowSettings:properties\n                      mostrar todos los valores de propiedad y continuar\n    -XshowSettings:vm mostrar todos los valores relacionados con vm y continuar\n    -Xss<tama\u00F1o>        definir tama\u00F1o de la pila del thread de Java\n    -Xverify          define el modo del verificador de c\u00F3digo de bytes\n    --add-reads <m\u00F3dulo>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n                      actualiza <m\u00F3dulo> para leer <m\u00F3dulo-destino>, independientemente\n                      de la declaraci\u00F3n del m\u00F3dulo. \n                      <m\u00F3dulo-destino> puede ser ALL-UNNAMED para leer todos los\n                      m\u00F3dulos sin nombre.\n    --add-exports <m\u00F3dulo>/<paquete>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n                      actualiza <m\u00F3dulo> para exportar <paquete> en <m\u00F3dulo-destino>,\n                      independientemente de la declaraci\u00F3n del m\u00F3dulo.\n                      <m\u00F3dulo-destino> puede ser ALL-UNNAMED para exportar a todos los\n                      m\u00F3dulos sin nombre.\n    --disable-@files  desactivar la ampliaci\u00F3n de archivos de m\u00E1s argumentos\n    --patch-module <m\u00F3dulo>=<archivo>({0}<archivo>)*\n                      Aumentar o anular un m\u00F3dulo con clases y recursos\n                      en directorios y archivos JAR\n\nEstas opciones no son est\u00E1ndar y est\u00E1n sujetas a cambio sin previo aviso.\n
+java.launcher.X.usage=-Xbatch           desactivar compilaci\u00F3n de fondo\n    -Xbootclasspath/a:<directorios y archivos zip/jar separados por {0}>\n                      agregar al final de la ruta de la clase de inicializaci\u00F3n de datos\n    -Xcheck:jni       realizar comprobaciones adicionales para las funciones de JNI\n    -Xcomp            fuerza la compilaci\u00F3n de m\u00E9todos en la primera llamada\n    -Xdebug           se proporciona para ofrecer compatibilidad con versiones anteriores\n    -Xdiag            mostrar mensajes de diagn\u00F3stico adicionales\n    -Xdiag:resolver   mostrar mensajes de diagn\u00F3stico de resoluci\u00F3n\n    -Xfuture          activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n    -Xint             solo ejecuci\u00F3n de modo interpretado\n    -Xinternalversion\n                      muestra una informaci\u00F3n de la versi\u00F3n de JVM m\u00E1s detallada que la\n                      opci\u00F3n -version\n    -Xloggc:    registrar el estado de GC en un archivo con registros de hora\n    -Xmixed           ejecuci\u00F3n de modo mixto (por defecto)\n    -Xmn<tama\u00F1o>        define el tama\u00F1o inicial y m\u00E1ximo (en bytes) de la pila\n                      para la generaci\u00F3n m\u00E1s joven (espacio infantil)\n    -Xms<size>        define el tama\u00F1o inicial de la pila de Java\n    -Xmx<size>        define el tama\u00F1o m\u00E1ximo de la pila de Java\n    -Xnoclassgc       desactivar la recolecci\u00F3n de basura de clases\n    -Xprof            datos de creaci\u00F3n de perfiles de CPU de salida\n    -Xrs              reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n    -Xshare:auto      usar datos de clase compartidos si es posible (valor por defecto)\n    -Xshare:off       no intentar usar datos de clase compartidos\n    -Xshare:on        es obligatorio el uso de datos de clase compartidos, de lo contrario se producir\u00E1 un fallo.\n    -XshowSettings    mostrar toda la configuraci\u00F3n y continuar\n    -XshowSettings:all\n                      mostrar todos los valores y continuar\n    -XshowSettings:locale\n                      mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n    -XshowSettings:properties\n                      mostrar todos los valores de propiedad y continuar\n    -XshowSettings:vm mostrar todos los valores relacionados con vm y continuar\n    -Xss<tama\u00F1o>        definir tama\u00F1o de la pila del thread de Java\n    -Xverify          define el modo del verificador de c\u00F3digo de bytes\n    --add-reads <m\u00F3dulo>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n                      actualiza <m\u00F3dulo> para leer <m\u00F3dulo-destino>, independientemente\n                      de la declaraci\u00F3n del m\u00F3dulo. \n                      <m\u00F3dulo-destino> puede ser ALL-UNNAMED para leer todos los\n                      m\u00F3dulos sin nombre.\n    --add-exports <m\u00F3dulo>/<paquete>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n                      actualiza <m\u00F3dulo> para exportar <paquete> en <m\u00F3dulo-destino>,\n                      independientemente de la declaraci\u00F3n del m\u00F3dulo.\n                      <m\u00F3dulo-destino> puede ser ALL-UNNAMED para exportar a todos los\n                      m\u00F3dulos sin nombre.\n    --add-opens <m\u00F3dulo>/<paquete>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n                      actualiza <m\u00F3dulo> para abrir <paquete> en\n                      <m\u00F3dulo-destino>, independientemente de la declaraci\u00F3n del m\u00F3dulo.\n    --disable-@files  desactivar la ampliaci\u00F3n de archivos de m\u00E1s argumentos\n    --patch-module <m\u00F3dulo>=({0})*\n                      Aumentar o anular un m\u00F3dulo con clases y recursos\n                      en directorios o archivos JAR\n\nEstas opciones \
+son adicionales y est\u00E1n sujetas a cambio sin previo aviso.
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\nLas siguientes opciones son espec\u00EDficas para Mac OS X:\n    -XstartOnFirstThread\n                      ejecutar el m\u00E9todo main() del primer thread (AppKit)\n    -Xdock:name=<application name>\n                      sustituir al nombre por defecto de la aplicaci\u00F3n que se muestra en el Dock\n    -Xdock:icon=<ruta de acceso a archivo de icono>\n                      sustituir al icono por defecto que se muestra en el Dock\n\n
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties
index 9743885..4917953 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_fr.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,23 +24,19 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Syntaxe : {0} [options] class [args...]\n           (pour l''ex\u00E9cution d''une classe)\n   ou  {0} [options] -jar jarfile [args...]\n           (pour l''ex\u00E9cution d''un fichier JAR)\n   ou  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (pour l''ex\u00E9cution de la classe principale dans un module)\no\u00F9 options comprend les \u00E9l\u00E9ments suivants :\n
+java.launcher.opt.header  =   Syntaxe : {0} [options] class [args...]\n           (pour l''ex\u00E9cution d''une classe)\n   ou  {0} [options] -jar jarfile [args...]\n           (pour l''ex\u00E9cution d''un fichier JAR)\n   ou  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (pour l''ex\u00E9cution de la classe principale dans un module)\n\no\u00F9 options comprend les \u00E9l\u00E9ments suivants :\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  En phase d''abandon, sera enlev\u00E9 dans une version future\n
 java.launcher.opt.vmselect   =\    {0}\t  pour s\u00E9lectionner la machine virtuelle "{1}"\n
 java.launcher.opt.hotspot    =\    {0}\t  est un synonyme pour la machine virtuelle "{1}"  [en phase d''abandon]\n
 
-java.launcher.ergo.message1  =\                  La machine virtuelle par d\u00E9faut est {0}
-java.launcher.ergo.message2  =\                  car vous ex\u00E9cutez une machine de classe de serveur.\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =\    -cp <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n    -classpath <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n    --class-path <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n                  Liste de r\u00E9pertoires, d''archives JAR\n                  et d''archives ZIP s\u00E9par\u00E9s par des {0} dans laquelle rechercher les fichiers de classe.\n    -p <chemin de module>\n    --module-path <chemin de module>...\n                  Liste de r\u00E9pertoires s\u00E9par\u00E9s par des {0}, chaque r\u00E9pertoire\n                  est un r\u00E9pertoire de modules.\n    --upgrade-module-path <chemin de module>...\n                  Liste de r\u00E9pertoires s\u00E9par\u00E9s par des {0}, chaque r\u00E9pertoire\n                  est un r\u00E9pertoire de modules qui remplacent des modules\n                  pouvant \u00EAtre mis \u00E0 niveau dans l''image d''ex\u00E9cution\n    -m <module>[/<mainclass>]\n    --module <modulename>[/<mainclass>]\n                  module initial \u00E0 r\u00E9soudre et nom de la classe principale\n                  \u00E0 ex\u00E9cuter si elle n''est pas indiqu\u00E9e par le module\n    --add-modules <modulename>[,<modulename>...]\n                  modules racine \u00E0 r\u00E9soudre en plus du module initial.\n                  <modulename> peut \u00E9galement \u00EAtre ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH.\n    --limit-modules <modulename>[,<modulename>...]\n                  limitation de l''univers de modules observables\n    --list-modules [<modulename>[,<modulename>...]]\n                  \u00E9num\u00E9ration des modules observables et fin de l''op\u00E9ration\n    --dry-run     cr\u00E9e une machine virtuelle mais n''ex\u00E9cute pas la m\u00E9thode principale.\n                  Cette option --dry-run peut s''av\u00E9rer utile pour la validation des\n                  options de ligne de commandes telles que la configuration syst\u00E8me de module.\n    -D<name>=<value>\n                  d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n    -verbose:[class|gc|jni]\n                  activation de la sortie en mode verbose\n    -version      affichage de la version du produit dans le flux d''erreur et fin de l''op\u00E9ration\n    --version     affichage de la version du produit dans le flux de sortie et fin de l''op\u00E9ration\n    -showversion  affichage de la version du produit dans le flux d''erreur et poursuite de l''op\u00E9ration\n    --show-version\n                  affichage de la version du produit dans le flux de sortie et poursuite de l''op\u00E9ration\n    -? -h -help\n                  affichage de ce message d''aide dans le flux d''erreur\n    --help        affichage de ce message d''aide dans le flux de sortie\n    -X            affichage de l''aide sur les options suppl\u00E9mentaires dans le flux d''erreur\n    --help-extra  affichage de l''aide sur les options suppl\u00E9mentaires dans le flux de sortie\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  activation des assertions avec la granularit\u00E9 indiqu\u00E9e\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  d\u00E9sactivation des assertions avec la granularit\u00E9 indiqu\u00E9e\n    -esa | -enablesystemassertions\n                  activation des assertions syst\u00E8me\n    -dsa | -disablesystemassertions\n                  d\u00E9sactivation des assertions syst\u00E8me\n    -agentlib:<libname>[=<options>]\n                  chargement de la biblioth\u00E8que d''agents natifs <libname>, par exemple : -agentlib:jdwp\n                  voir aussi -agentlib:jdwp=help\n    -agentpath:<pathname>[=<options>]\n                  chargement de la biblioth\u00E8que d''agents natifs via le chemin d''acc\u00E8s complet\n    \
+-javaagent:<jarpath>[=<options>]\n                  chargement de l''agent de langage de programmation Java, voir java.lang.instrument\n    -splash:<imagepath>\n                  affichage de l''\u00E9cran d''accueil avec l''image indiqu\u00E9e\n                  Les images redimensionn\u00E9es HiDPI sont automatiquement prises en charge et utilis\u00E9es\n                  si elles sont disponibles. Le nom de fichier d''une image non redimensionn\u00E9e, par ex. image.ext,\n                  doit toujours \u00EAtre transmis comme argument \u00E0 l''option -splash.\n                  L''image redimensionn\u00E9e fournie la plus appropri\u00E9e sera automatiquement\n                  s\u00E9lectionn\u00E9e.\n                  Pour plus d''informations, reportez-vous \u00E0 la documentation relative \u00E0 l''API SplashScreen.\n    @<filepath>   lecture des options \u00E0 partir du fichier indiqu\u00E9\n\nPour indiquer un argument pour une option longue, vous pouvez utiliser --<name>=<value> ou\n--<name> <value>.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n    -classpath <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n    --class-path <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n                  Liste de r\u00E9pertoires, d''archives JAR\n                  et d''archives ZIP s\u00E9par\u00E9s par des {0} dans laquelle rechercher les fichiers de classe.\n    -p <chemin de module>\n    --module-path <chemin de module>...\n                  Liste de r\u00E9pertoires s\u00E9par\u00E9s par des {0}, chaque r\u00E9pertoire\n                  est un r\u00E9pertoire de modules.\n    --upgrade-module-path <chemin de module>...\n                  Liste de r\u00E9pertoires s\u00E9par\u00E9s par des {0}, chaque r\u00E9pertoire\n                  est un r\u00E9pertoire de modules qui remplace des modules\n                  pouvant \u00EAtre mis \u00E0 niveau dans l''image d''ex\u00E9cution\n    -m <module>[/<mainclass>]\n    --module <modulename>[/<mainclass>]\n                  module initial \u00E0 r\u00E9soudre et nom de la classe principale\n                  \u00E0 ex\u00E9cuter si elle n''est pas indiqu\u00E9e par le module\n    --add-modules <modulename>[,<modulename>...]\n                  modules racine \u00E0 r\u00E9soudre en plus du module initial.\n                  <modulename> peut \u00E9galement \u00EAtre ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH.\n    --limit-modules <modulename>[,<modulename>...]\n                  limitation de l''univers de modules observables\n    --list-modules [<modulename>[,<modulename>...]]\n                  \u00E9num\u00E9ration des modules observables et fin de l''op\u00E9ration\n    --dry-run     cr\u00E9e une machine virtuelle mais n''ex\u00E9cute pas la m\u00E9thode principale.\n                  Cette option --dry-run peut s''av\u00E9rer utile pour la validation des\n                  options de ligne de commandes telles que la configuration syst\u00E8me de module.\n    -D<nom>=<valeur>\n                  d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n    -verbose:[class|gc|jni]\n                  activation de la sortie en mode verbose\n    -version      affichage de la version du produit et fin de l''op\u00E9ration\n    -showversion  affichage de la version du produit et poursuite de l''op\u00E9ration\n    -? -help --help\n                  affichage du message d''aide\n    -X            affichage de l''aide sur les options non standard\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  activation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  d\u00E9sactivation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n    -esa | -enablesystemassertions\n                  activation des assertions syst\u00E8me\n    -dsa | -disablesystemassertions\n                  d\u00E9sactivation des assertions syst\u00E8me\n    -agentlib:<libname>[=<options>]\n                  chargement de la biblioth\u00E8que d''agent natif <libname>, par exemple : -agentlib:jdwp\n                  voir aussi -agentlib:jdwp=help\n    -agentpath:<pathname>[=<options>]\n                  chargement de la biblioth\u00E8que d''agent natif via le chemin d''acc\u00E8s complet\n    -javaagent:<jarpath>[=<options>]\n                  chargement de l''agent du langage de programmation Java, voir java.lang.instrument\n    -splash:<imagepath>\n                  affichage de l''\u00E9cran d''accueil avec l''image indiqu\u00E9e\n                  Les images redimensionn\u00E9es HiDPI sont automatiquement prises en charge et utilis\u00E9es\n                  si elles sont disponibles. Le nom de fichier d''une image non redimensionn\u00E9e, par ex. image.ext,\n                  doit toujours \
-\u00EAtre transmis comme argument \u00E0 l''option -splash.\n                  L''image redimensionn\u00E9e fournie la plus appropri\u00E9e sera automatiquement\n                  s\u00E9lectionn\u00E9e.\n                  Pour plus d''informations, reportez-vous \u00E0 la documentation relative \u00E0 l''API SplashScreen.\n    @<filepath>   lire les options \u00E0 partir du fichier indiqu\u00E9\nPour indiquer un argument pour une option longue, vous pouvez utiliser --<name>=<value> ou\n--<name> <value>.\n
-See http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails.
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           d\u00E9sactivation de la compilation en arri\u00E8re-plan\n    -Xbootclasspath/a:<r\u00E9pertoires et fichiers ZIP/JAR s\u00E9par\u00E9s par des {0}>\n                      ajout \u00E0 la fin du chemin de classe bootstrap\n    -Xcheck:jni        ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n    -Xcomp            force la compilation de m\u00E9thodes au premier appel\n    -Xdebug           fourni pour la compatibilit\u00E9 amont\n    -Xdiag            affichage de messages de diagnostic suppl\u00E9mentaires\n    -Xdiag:resolver   affichage de messages de diagnostic du r\u00E9solveur\n    -Xfuture           activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n    -Xint             ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n    -Xinternalversion\n                      affiche des informations de version JVM plus d\u00E9taill\u00E9es que\n                      l''option -version\n    -Xloggc:<file>    journalisation du statut de l''op\u00E9ration de ramasse-miette dans un fichier avec horodatage\n    -Xmixed           ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n    -Xmn<size>        d\u00E9finit les tailles initiale et maximale (en octets) de la portion de m\u00E9moire\n                      pour la jeune g\u00E9n\u00E9ration (nursery)\n    -Xms<size>        d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n    -Xmx<size>        d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n    -Xnoclassgc       d\u00E9sactivation de l''op\u00E9ration de ramasse-miette de la classe\n    -Xprof            sortie des donn\u00E9es de profilage d''UC\n    -Xrs              r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n    -Xshare:auto      utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n    -Xshare:off       aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n    -Xshare:on        utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration\n    -XshowSettings    affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n    -XshowSettings:all\n                      affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n    -XshowSettings:locale\n                      affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n    -XshowSettings:properties\n                       affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n    -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n    -Xss<size>        d\u00E9finition de la taille de pile de threads Java\n    -Xverify          d\u00E9finit le mode du v\u00E9rificateur de code ex\u00E9cutable\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      met \u00E0 jour <module> pour lire <target-module>, sans tenir compte\n                      de la d\u00E9claration de module. \n                      <target-module> peut \u00EAtre ALL-UNNAMED pour lire tous les modules\n                      sans nom.\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      met \u00E0 jour <module> pour exporter <package> vers <target-module>,\n                      sans tenir compte de la d\u00E9claration de module.\n                      <target-module> peut \u00EAtre ALL-UNNAMED pour effectuer un export vers tous\n                      les modules sans nom.\n    --disable-@files  d\u00E9sactivation d''autres d\u00E9veloppements de fichier d''argument\n    --patch-module <module>=<file>({0}<file>)*\n                      Remplacement ou augmentation d''un module avec des classes et des ressources\n                      dans des \
-fichiers ou des r\u00E9pertoires JAR.\n\nCes options ne sont pas standard et peuvent \u00EAtre modifi\u00E9es sans pr\u00E9avis.\n
+java.launcher.X.usage=\n    -Xbatch           d\u00E9sactivation de la compilation en arri\u00E8re-plan\n    -Xbootclasspath/a:<r\u00E9pertoires et fichiers ZIP/JAR s\u00E9par\u00E9s par des {0}>\n                      ajout \u00E0 la fin du chemin de classe bootstrap\n    -Xcheck:jni        ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n    -Xcomp            force la compilation de m\u00E9thodes au premier appel\n    -Xdebug           fourni pour la compatibilit\u00E9 amont\n    -Xdiag            affichage de messages de diagnostic suppl\u00E9mentaires\n    -Xdiag:resolver   affichage de messages de diagnostic du r\u00E9solveur\n    -Xfuture           activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n    -Xint             ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n    -Xinternalversion\n                      affiche des informations de version JVM plus d\u00E9taill\u00E9es que\n                      l''option -version\n    -Xloggc:<file>    journalisation du statut de l''op\u00E9ration de ramasse-miette dans un fichier avec horodatage\n    -Xmixed           ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n    -Xmn<size>        d\u00E9finit les tailles initiale et maximale (en octets) de la portion de m\u00E9moire\n                      pour la jeune g\u00E9n\u00E9ration (nursery)\n    -Xms<size>        d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n    -Xmx<size>        d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n    -Xnoclassgc       d\u00E9sactivation de l''op\u00E9ration de ramasse-miette de la classe\n    -Xprof            sortie des donn\u00E9es de profilage d''UC\n    -Xrs              r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n    -Xshare:auto      utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n    -Xshare:off       aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n    -Xshare:on        utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration\n    -XshowSettings    affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n    -XshowSettings:all\n                      affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n    -XshowSettings:locale\n                      affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n    -XshowSettings:properties\n                       affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n    -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n    -Xss<size>        d\u00E9finition de la taille de pile de threads Java\n    -Xverify          d\u00E9finit le mode du v\u00E9rificateur de code ex\u00E9cutable\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      met \u00E0 jour <module> pour lire <target-module>, sans tenir compte\n                      de la d\u00E9claration de module. \n                      <target-module> peut \u00EAtre ALL-UNNAMED pour lire tous les modules\n                      sans nom.\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      met \u00E0 jour <module> pour exporter <package> vers <target-module>,\n                      sans tenir compte de la d\u00E9claration de module.\n                      <target-module> peut \u00EAtre ALL-UNNAMED pour effectuer un export vers tous\n                      les modules sans nom.\n    --add-opens <module>/<package>=<target-module>(,<target-module>)*\n                      met \u00E0 jour <module> pour ouvrir <package> vers\n                      \
+<target-module>, sans tenir compte de la d\u00E9claration de module\n    --disable-@files  d\u00E9sactivation d''autres d\u00E9veloppements de fichier d''argument\n    --patch-module <module>=<file>({0}<file>)*\n                      Remplacement ou augmentation d''un module avec des classes et des ressources\n                      dans des fichiers ou des r\u00E9pertoires JAR.\n\nCes options suppl\u00E9mentaires peuvent \u00EAtre modifi\u00E9es sans pr\u00E9avis.\n
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\nLes options suivantes sont propres \u00E0 Mac OS X :\n    -XstartOnFirstThread\n                      ex\u00E9cute la m\u00E9thode main() sur le premier thread (AppKit)\n    -Xdock:name=<nom d'application>\n                      remplace le nom d'application par d\u00E9faut affich\u00E9 dans l'ancrage\n    -Xdock:icon=<chemin vers le fichier d'ic\u00F4ne>\n                      remplace l'ic\u00F4ne par d\u00E9faut affich\u00E9e dans l'ancrage\n\n
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_it.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_it.properties
index d06e699..7be6b1f 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_it.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_it.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,22 +24,18 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Uso: {0} [opzioni] class [argomenti...]\n           (per eseguire una classe)\n   oppure {0} [opzioni] -jar jarfile [argomenti...]\n           (per eseguire un file jar)\n   oppure {0} [opzioni] -p <percorsomodulo> -m <nomemodulo>[/<classeprincipale>] [argomenti...]\n           (per eseguire la classe principale in un modulo)\ndove opzioni include:\n
+java.launcher.opt.header  =   Uso: {0} [opzioni] class [argomenti...]\n           (per eseguire una classe)\n   oppure {0} [opzioni] -jar jarfile [argomenti...]\n           (per eseguire un file jar)\n   oppure {0} [opzioni] -p <percorsomodulo> -m <nomemodulo>[/<classeprincipale>] [argomenti...]\n           (per eseguire la classe principale in un modulo)\ndove opzioni include:\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  opzione non pi\u00F9 valida; verr\u00E0 rimossa in una release futura\n
 java.launcher.opt.vmselect   =\    {0}\t  per selezionare la VM "{1}"\n
 java.launcher.opt.hotspot    =\    {0}\t  \u00E8 un sinonimo per la VM "{1}" [non valido]\n
 
-java.launcher.ergo.message1  =\                  La VM predefinita \u00E8 {0}
-java.launcher.ergo.message2  =\                  perch\u00E9 si utilizza un computer di classe server.\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =\    -cp <classpath di ricerca di directory e file zip/jar>\n    -classpath <classpath di ricerca di directory e file zip/jar>\n    --class-path <classpath di ricerca di directory e file zip/jar>\n               Lista separata da {0} di directory, archivi JAR\n                  e archivi ZIP utilizzata per la ricerca di file di classe.\n    -p <percorso modulo>\n    -module-path <percorso modulo>...\n                  Lista separata da {0} di directory; ciascuna directory\n                  \u00E8 una directory di moduli.\n    -upgrade-module-path <percorso modulo>...\n                  Lista separata da {0} di directory; ciascuna directory\n                  \u00E8 una directory dei moduli che sostituiscono i moduli\n                  aggiornabili nell''immagine in fase di esecuzione.\n    -m <modulo>[/<classe principale>]\n    --module <nome modulo>[/<classe principale>]\n                  Il modulo iniziale da risolvere e il nome della classe\n                  principale da eseguire se non specificata dal modulo.\n    -add-modules <nome modulo>[,<nome modulo>...]\n                  Moduli root da risolvere in aggiunta al modulo iniziale.\n                  <nome modulo> pu\u00F2 essere anche ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH.\n    -limit-modules <nome modulo>[,<nome modulo>...]\n                  Limita l''universe dei moduli osservabili.\n    -list-modules[:<nome modulo>[,<nome modulo>...]]\n                  Elenca i moduli osservabili ed esce.\n    --dry-run     Crea la VM ma non esegue il metodo principale.\n                  Pu\u00F2 essere utile, ad esempio, per la convalida delle opzioni della\n                  riga di comando utilizzate per la configurazione del sistema di moduli.\n    -D<nome>=<valore>\n                  Imposta una propriet\u00E0 di sistema.\n    -verbose:[class|gc|jni]\n                  Abilita l''output descrittivo.\n    -version      Visualizza la versione del prodotto ed esce.\n    --version     Visualizza la versione del prodotto nel flusso di output ed esce.\n    -showversion  Visualizza la versione del prodotto nel flusso di errori e continua.\n    --show-version\n                  Visualizza la versione del prodotto nel flusso di output e continua.\n    -? -h -help\n                  Visualizza questo messaggio della Guida nel flusso di errori.\n    --help        Visualizza questo messaggio della Guida nel flusso di output.\n    -X            Visualizza la Guida relativa alle opzioni non standard nel flusso di errori.\n    --help-extra  Visualizza la Guida relativa alle opzioni non standard nel flusso di output.\n    -ea[:<nome package>...|:<nome classe>]\n    -enableassertions[:<nome package>...|:<nome classe>]\n                  Abilita le asserzioni con la granularit\u00E0 specificata.\n    -da[:<nome package>...|:<nome classe>]\n    -disableassertions[:<nome package>...|:<nome classe>]\n                  Disabilita le asserzioni con la granularit\u00E0 specificata.\n    -esa | -enablesystemassertions\n                  Abilita le asserzioni di sistema.\n    -dsa | -disablesystemassertions\n                  Disabilita le asserzioni di sistema.\n    -agentlib:<nome libreria>[=<opzioni>]\n                  Carica la libreria agenti nativa <nome libreria>, ad esempio -agentlib:jdwp.\n                  Vedere anche -agentlib:jdwp=help.\n    -agentpath:<nome percorso>[=<opzioni>]\n                  Carica la libreria agenti nativa con il percorso completo.\n    -javaagent:<percorso jar>[=<opzioni>]\n                  Carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument.\n    -splash:<percorso immagine>\n                  Mostra la schermata iniziale con l''immagine specificata.\n                  Le immagini ridimensionate HiDPI sono supportate e utilizzate automaticamente\n                  se disponibili. I nomi file delle immagini non ridimensionate, ad esempio image.ext,\n                  devono \
+essere sempre passati come argomenti all''opzione -splash.\n                  Verr\u00E0 scelta automaticamente l''immagine ridimensionata pi\u00F9 appropriata\n                  fornita.\n                  Per ulteriori informazioni, vedere la documentazione relativa all''API SplashScreen.\n    @<percorso file>   Legge le opzioni dal file specificato.\n\nPer specificare un argomento per un''opzione lunga, \u00E8 possibile utilizzare --<nome>=<valore> o\n--<nome> <valore>.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <classpath di ricerca di directory e file zip/jar>\n    -classpath <classpath di ricerca di directory e file zip/jar>\n    --class-path <classpath di ricerca di directory e file zip/jar>\n               Lista separata da {0} di directory e di archivi JAR\n                  e ZIP utilizzata per la ricerca di file di classe.\n    -p <percorso modulo>\n    -module-path <percorso modulo>...\n                  Lista separata da {0} di directory; ciascuna directory\n                  \u00E8 una directory di moduli.\n    -upgrade-module-path <percorso modulo>...\n                  Lista separata da {0} di directory; ciascuna directory\n                  \u00E8 una directory dei moduli che sostituiscono i moduli\n                  aggiornabili nell''immagine in fase di esecuzione.\n    -m <modulo>[/<classe principale>]\n    --module <nome modulo>[/<classe principale>]\n                  Il modulo iniziale da risolvere e il nome della classe\n                  principale da eseguire se non specificata dal modulo.\n    -add-modules <nome modulo>[,<nome modulo>...]\n                  Moduli root da risolvere in aggiunta al modulo iniziale.\n                  <nome modulo> pu\u00F2 essere anche ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH.\n    -limit-modules <nome modulo>[,<nome modulo>...]\n                  Limita l''universe dei moduli osservabili.\n    -list-modules[:<nome modulo>[,<nome modulo>...]]\n                  Elenca i moduli osservabili ed esce.\n    --dry-run     Crea la VM ma non esegue il metodo principale.\n                  Pu\u00F2 essere utile, ad esempio, per la convalida delle opzioni della\n                  riga di comando utilizzate per la configurazione del sistema di moduli.\n    -D<nome>=<valore>\n                  Imposta una propriet\u00E0 di sistema.\n    -verbose:[class|gc|jni]\n                  Abilita l''output descrittivo.\n    -version      Visualizza la versione del prodotto ed esce.\n    -showversion  Visualizza la versione del prodotto e continua\n    -? -help      --help\n                  Visualizza questo messaggio della Guida.\n    -X            Visualizza la Guida relativa alle opzioni non standard.\n    -ea[:<nome package>...|:<nome classe>]\n    -enableassertions[:<nome package>...|:<nome classe>]\n                  Abilita le asserzioni con la granularit\u00E0 specificata.\n    -da[:<nome package>...|:<nome classe>]\n    -disableassertions[:<nome package>...|:<nome classe>]\n                  Disabilita le asserzioni con la granularit\u00E0 specificata.\n    -esa | -enablesystemassertions\n                  Abilita le asserzioni di sistema.\n    -dsa | -disablesystemassertions\n                  Disabilita le asserzioni di sistema.\n    -agentlib:<nome libreria>[=<opzioni>]\n                  Carica la libreria agenti nativa <nome libreria>, ad esempio -agentlib:jdwp.\n                  Vedere anche -agentlib:jdwp=help.\n    -agentpath:<nome percorso>[=<opzioni>]\n                  Carica la libreria agenti nativa con il percorso completo.\n    -javaagent:<percorso jar>[=<opzioni>]\n                  Carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument.\n    -splash:<percorso immagine>\n                  Mostra la schermata iniziale con l''immagine specificata.\n                  Le immagini ridimensionate HiDPI sono supportate e utilizzate automaticamente\n                  se disponibili. I nomi file delle immagini non ridimensionate, ad esempio image.ext,\n                  devono essere sempre passati come argomenti all''opzione -splash.\n                  Verr\u00E0 scelta automaticamente l''immagine ridimensionata pi\u00F9 appropriata\n                  fornita.\n                  Per ulteriori informazioni, vedere la documentazione relativa all''API SplashScreen.\n    @<percorso file>   legge le opzioni dal file specificato.\nPer specificare un argomento per un''opzione lunga, \u00E8 possibile \
-utilizzare --<nome>=<valore> o\n--<nome> <valore>.
-See Per ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html.
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           disabilita la compilazione in background\n    -Xbootclasspath/a:<directory e file zip/jar separati da {0}>\n                      aggiunge alla fine del classpath di bootstrap\n   -Xcheck:jni       esegue controlli aggiuntivi per le funzioni JNI\n    -Xcomp            forza la compilazione dei metodi al primo richiamo\n    -Xdebug           fornito per la compatibilit\u00E0 con le versioni precedenti\n    -Xdiag            mostra ulteriori messaggi diagnostici\n    -Xdiag:resolver   mostra i messaggi diagnostici del resolver\n    -Xfuture          abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n    -Xint             esecuzione solo in modalit\u00E0 convertita\n    -Xinternalversion\n                      visualizza informazioni pi\u00F9 dettagliate sulla versione JVM rispetto\n                      all''opzione -version\n    -Xloggc:<file>    registra lo stato GC in un file con indicatori orari\n    -Xmixed           esecuzione in modalit\u00E0 mista (impostazione predefinita)\n    -Xmn<size>        imposta le dimensioni iniziale e massima (in byte) dell''heap\n                      per la young generation (nursery)\n    -Xms<size>        imposta la dimensione heap Java iniziale\n    -Xmx<size>        imposta la dimensione heap Java massima\n    -Xnoclassgc       disabilta la garbage collection della classe\n    -Xprof            visualizza i dati di profilo della CPU\n    -Xrs              riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n    -Xshare:auto      utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n     -Xshare:off       non tenta di utilizzare i dati di classe condivisi\n    -Xshare:on        richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n    -XshowSettings    mostra tutte le impostazioni e continua\n    -XshowSettings:all\n                      mostra tutte le impostazioni e continua\n    -XshowSettings:locale\n                      mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n    -XshowSettings:properties\n                      mostra tutte le impostazioni delle propriet\u00E0 e continua\n    -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n    -Xss<size>        imposta la dimensione dello stack di thread Java\n     -Xverify          imposta la modalit\u00E0 del verificatore bytecode\n    --add-reads:<module>=<target-module>(,<target-module>)*\n                      aggiorna <module> per leggere <target-module>, indipendentemente\n                      dalla dichiarazione del modulo.\n                      <target-module> pu\u00F2 essere ALL-UNNAMED per leggere tutti i\n                      moduli senza nome.\n   -add-exports:<module>/<package>=<target-module>(,<target-module>)*\n                      aggiorna <module> per esportare <package> in <target-module>,\n                      indipendentemente dalla dichiarazione del modulo.\n                      <target-module> pu\u00F2 essere ALL-UNNAMED per esportare tutti i\n                      moduli senza nome.\n    --disable-@files  disabilita l''ulteriore espansione del file di argomenti\n    -patch-module <module>=<file>({0}<file>)*\n                      sostituisce o migliora un modulo con classi e risorse\n                      in file JAR o directory\n\nQueste opzioni non sono opzioni standard e sono soggette a modifiche senza preavviso.\n
+java.launcher.X.usage=\n    -Xbatch           Disabilita la compilazione in background.\n    -Xbootclasspath/a:<directory e file zip/jar separati da {0}>\n                      Aggiunge alla fine del classpath di bootstrap.\n   -Xcheck:jni       Esegue controlli aggiuntivi per le funzioni JNI.\n    -Xcomp            Forza la compilazione dei metodi al primo richiamo.\n    -Xdebug           Fornito per la compatibilit\u00E0 con le versioni precedenti.\n    -Xdiag            Mostra ulteriori messaggi diagnostici.\n    -Xdiag:resolver   Mostra i messaggi diagnostici del resolver.\n    -Xfuture          Abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future.\n    -Xint             Esecuzione solo in modalit\u00E0 convertita.\n    -Xinternalversion\n                      Visualizza informazioni pi\u00F9 dettagliate sulla versione JVM rispetto\n                      all''opzione -version.\n    -Xloggc:<file>    Registra lo stato GC in un file con indicatori orari.\n    -Xmixed           Esecuzione in modalit\u00E0 mista (impostazione predefinita).\n    -Xmn<size>        Imposta le dimensioni iniziale e massima (in byte) dell''heap\n                      per la young generation (nursery).\n    -Xms<size>        Imposta la dimensione heap Java iniziale.\n    -Xmx<size>        Imposta la dimensione heap Java massima.\n    -Xnoclassgc       Disabilta la garbage collection della classe.\n    -Xprof            Visualizza i dati di profilo della CPU.\n    -Xrs              Riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione).\n    -Xshare:auto      Utilizza i dati di classe condivisi se possibile (impostazione predefinita).\n     -Xshare:off       Non tenta di utilizzare i dati di classe condivisi.\n    -Xshare:on        Richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n    -XshowSettings    Mostra tutte le impostazioni e continua.\n    -XshowSettings:all\n                      Mostra tutte le impostazioni e continua.\n    -XshowSettings:locale\n                      Mostra tutte le impostazioni correlate alle impostazioni nazionali e continua.\n    -XshowSettings:properties\n                      Mostra tutte le impostazioni delle propriet\u00E0 e continua.\n    -XshowSettings:vm Mostra tutte le impostazioni correlate alla VM e continua.\n    -Xss<size>        Imposta la dimensione dello stack di thread Java.\n     -Xverify          Imposta la modalit\u00E0 del verificatore bytecode.\n    --add-reads:<module>=<target-module>(,<target-module>)*\n                      Aggiorna <module> per leggere <target-module>, indipendentemente\n                      dalla dichiarazione del modulo.\n                      <target-module> pu\u00F2 essere ALL-UNNAMED per leggere tutti i\n                      moduli senza nome.\n   -add-exports:<module>/<package>=<target-module>(,<target-module>)*\n                      Aggiorna <module> per esportare <package> in <target-module>,\n                      indipendentemente dalla dichiarazione del modulo.\n                      <target-module> pu\u00F2 essere ALL-UNNAMED per esportare tutti i\n                      moduli senza nome.\n    --add-opens <module>/<package>=<target-module>(,<target-module>)*\n                      Aggiorna <module> per aprire <package> in\n                      <target-module>, indipendentemente dalla dichiarazione del modulo.\n    --disable-@files  Disabilita l''ulteriore espansione del file di argomenti.\n    -patch-module <module>=<file>({0}<file>)*\n                      Sostituisce o migliora un modulo con classi e risorse\n                      in file JAR o directory.\n\nQueste opzioni non sono opzioni standard e sono soggette a modifiche senza preavviso.\n
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\nLe opzioni riportate di seguito sono specifiche del sistema operativo Mac OS X:\n    -XstartOnFirstThread\n                      Esegue il metodo main() sul primo thread (AppKit).\n    -Xdock:name=<nome applicazione>\n                      Sostituisce il nome applicazione predefinito visualizzato nel dock\n    -Xdock:icon=<percorso file icona>\n                      Sostituisce l'icona predefinita visualizzata nel dock\n\n
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ja.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ja.properties
index 996a806..57453ce 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ja.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,23 +24,20 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   \u4F7F\u7528\u65B9\u6CD5: {0} [options] class [args...]\n           (\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n   \u307E\u305F\u306F  {0} [options] -jar jarfile [args...]\n           (jar\u30D5\u30A1\u30A4\u30EB\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n   \u307E\u305F\u306F  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n
+java.launcher.opt.header  =   \u4F7F\u7528\u65B9\u6CD5: {0} [options] class [args...]\n           (\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n   \u307E\u305F\u306F  {0} [options] -jar jarfile [args...]\n           (jar\u30D5\u30A1\u30A4\u30EB\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n   \u307E\u305F\u306F  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  \u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u4E88\u5B9A\u3067\u3059\n
 java.launcher.opt.vmselect   =\    {0}\t  "{1}" VM\u3092\u9078\u629E\u3059\u308B\u5834\u5408\n
 java.launcher.opt.hotspot    =\    {0}\t  \u306F"{1}" VM\u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059  [\u975E\u63A8\u5968]\n
 
-java.launcher.ergo.message1  =\                  \u30C7\u30D5\u30A9\u30EB\u30C8VM\u306F{0}\u3067\u3059
-java.launcher.ergo.message2  =\                  \u3053\u308C\u306F\u30B5\u30FC\u30D0\u30FC\u30AF\u30E9\u30B9\u306E\u30DE\u30B7\u30F3\u3067\u5B9F\u884C\u3057\u3066\u3044\u308B\u305F\u3081\u3067\u3059\u3002\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =\    -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n    -classpath <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n    --class-path <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n                  \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001JAR\u30A2\u30FC\u30AB\u30A4\u30D6\n                  \u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\n    -p <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>\n    --module-path <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>...\n                  \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\u5404\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\n                  \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\u3002\n    --upgrade-module-path <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>...\n                  \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\u5404\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\n                  \u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u3067\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n                  \u7F6E\u63DB\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\n    -m <module>[/<mainclass>]\n    --module <modulename>[/<mainclass>]\n                  \u89E3\u6C7A\u3059\u308B\u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u304A\u3088\u3073\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306B\n                  \u5B9F\u884C\u3059\u308B\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u306E\u540D\u524D\n    --add-modules <modulename>[,<modulename>...]\n                  \u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u52A0\u3048\u3066\u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u3002\n                  <modulename>\u306B\u306F\u3001ALL-DEFAULT\u3001ALL-SYSTEM\u3001\n                  ALL-MODULE-PATH\u3082\u4F7F\u7528\u3067\u304D\u308B\u3002\n    --limit-modules <modulename>[,<modulename>...]\n                  \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u9818\u57DF\u3092\u5236\u9650\u3059\u308B\n    --list-modules [<modulename>[,<modulename>...]]\n                  \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u4E00\u89A7\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n    --dry-run     VM\u3092\u4F5C\u6210\u3059\u308B\u304C\u3001\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u306F\u5B9F\u884C\u3057\u306A\u3044\u3002\n                  \u3053\u306E--dry-run\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B7\u30B9\u30C6\u30E0\u69CB\u6210\u306A\u3069\u306E\n                  \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u691C\u8A3C\u3059\u308B\u5834\u5408\u306B\u4FBF\u5229\u3067\u3059\u3002\n    -D<name>=<value>\n                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n    -verbose:[class|gc|jni]\n                  \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n    -version      \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u30A8\u30E9\u30FC\u30FB\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n    --version     \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n    \
+-showversion  \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u30A8\u30E9\u30FC\u30FB\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n    --show-version\n                  \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -? -h -help\n                  \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u30A8\u30E9\u30FC\u30FB\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3059\u308B\n    --help        \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3059\u308B\n    -X            \u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u30A8\u30E9\u30FC\u30FB\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3059\u308B\n    --help-extra  \u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u30B9\u30C8\u30EA\u30FC\u30E0\u306B\u51FA\u529B\u3059\u308B\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n    -esa | -enablesystemassertions\n                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n    -dsa | -disablesystemassertions\n                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n    -agentlib:<libname>[=<options>]\n                  \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA<libname>\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:jdwp\n                  -agentlib:jdwp=help\u3082\u53C2\u7167\n    -agentpath:<pathname>[=<options>]\n                  \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n    -javaagent:<jarpath>[=<options>]\n                  Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n    -splash:<imagepath>\n                  \u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n                  HiDPI\u306B\u30B9\u30B1\u30FC\u30EA\u30F3\u30B0\u3055\u308C\u305F\u30A4\u30E1\u30FC\u30B8\u304C\u81EA\u52D5\u7684\u306B\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3001\n                  \u4F7F\u7528\u3067\u304D\u308C\u3070\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\u5FC5\u305A\u3001\u30B9\u30B1\u30FC\u30EA\u30F3\u30B0\n                  \u3055\u308C\u306A\u3044\u30A4\u30E1\u30FC\u30B8\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u305F\u3068\u3048\u3070image.ext\u3092\u3001\n                  \u5F15\u6570\u3068\u3057\u3066-splash\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n                  \u6307\u5B9A\u3055\u308C\u305F\u6700\u3082\u9069\u5207\u306A\u30B9\u30B1\u30FC\u30EA\u30F3\u30B0\u6E08\u30A4\u30E1\u30FC\u30B8\u304C\u81EA\u52D5\u7684\u306B\n                  \u9078\u629E\u3055\u308C\u307E\u3059\u3002\n                  \u8A73\u7D30\u306FSplashScreen API\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n    @<filepath>   \
+\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8AAD\u307F\u53D6\u308B\n\nlong\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B\u306B\u306F\u3001--<name>=<value>\u307E\u305F\u306F--<name> <value>\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n    -classpath <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n    --class-path <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n                  \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n                  JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\n    -p <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>\n    --module-path <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>...\n                  \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\u5404\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\n                  \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\u3002\n    --upgrade-module-path <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>...\n                  \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\u5404\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\n                  \u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u3067\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u7F6E\u63DB\u3059\u308B\n                  \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\n    -m <module>[/<mainclass>]\n    --module <modulename>[/<mainclass>]\n                  \u89E3\u6C7A\u3059\u308B\u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u304A\u3088\u3073\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306B\n                  \u5B9F\u884C\u3059\u308B\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u306E\u540D\u524D\n    --add-modules <modulename>[,<modulename>...]\n                  \u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u52A0\u3048\u3066\u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u3002\n                  <modulename>\u306FALL-DEFAULT\u3001ALL-SYSTEM\u3001ALL-MODULE-PATH\n                  \u306B\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002\n    --limit-modules <modulename>[,<modulename>...]\n                  \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u9818\u57DF\u3092\u5236\u9650\u3059\u308B\n    --list-modules [<modulename>[,<modulename>...]]\n                  \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u4E00\u89A7\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n    --dry-run     VM\u3092\u4F5C\u6210\u3059\u308B\u304C\u3001\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u306F\u5B9F\u884C\u3057\u306A\u3044\u3002\n                  \u3053\u306E--dry-run\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B7\u30B9\u30C6\u30E0\u69CB\u6210\u306A\u3069\u306E\n                  \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u691C\u8A3C\u3059\u308B\u5834\u5408\u306B\u4FBF\u5229\u3067\u3059\u3002\n    -D<name>=<value>\n                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n    -verbose:[class|gc|jni]\n                  \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n    -version      \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n    -showversion  \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -? -help --help\n                  \
-\u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n    -X            \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n    -esa | -enablesystemassertions\n                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n    -dsa | -disablesystemassertions\n                  \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n    -agentlib:<libname>[=<options>]\n                  \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA<libname>\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:jdwp\n                  -agentlib:jdwp=help\u3082\u53C2\u7167\n    -agentpath:<pathname>[=<options>]\n                  \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n    -javaagent:<jarpath>[=<options>]\n                  Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n    -splash:<imagepath>\n                  \u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n                  \u53EF\u80FD\u3067\u3042\u308C\u3070\u3001HiDPI\u30B9\u30B1\u30FC\u30EB\u306E\u30A4\u30E1\u30FC\u30B8\u304C\u81EA\u52D5\u7684\u306B\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n                  \u30B9\u30B1\u30FC\u30EB\u306A\u3057\u306E\u30A4\u30E1\u30FC\u30B8\u306E\u30D5\u30A1\u30A4\u30EB\u540D(image.ext\u306A\u3069)\u306F\u3001\n                  \u5E38\u306B-splash\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u3068\u3057\u3066\u6E21\u3055\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n                  \u6307\u5B9A\u3055\u308C\u305F\u6700\u9069\u306A\u30B9\u30B1\u30FC\u30EB\u306E\u30A4\u30E1\u30FC\u30B8\u304C\u81EA\u52D5\u7684\u306B\n                  \u9078\u629E\u3055\u308C\u307E\u3059\u3002\n                  \u8A73\u7D30\u306FSplashScreen API\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n    @<filepath>   \u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8AAD\u307F\u53D6\u308B\n\u9577\u3044\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001--<name>=<value>\u307E\u305F\u306F\n--<name> <value>\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n
-See \u8A73\u7D30\u306F\u3001http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n    -Xbootclasspath/a:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n                      \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n    -Xcheck:jni       JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n    -Xcomp            \u521D\u56DE\u547C\u51FA\u3057\u6642\u306B\u30E1\u30BD\u30C3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u5F37\u5236\u3059\u308B\n    -Xdebug           \u4E0B\u4F4D\u4E92\u63DB\u6027\u306E\u305F\u3081\u306B\u63D0\u4F9B\n    -Xdiag            \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n    -Xdiag:resolver   \u30EA\u30BE\u30EB\u30D0\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n    -Xfuture          \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n    -Xint             \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n    -Xinternalversion\n                      -version\u30AA\u30D7\u30B7\u30E7\u30F3\u3088\u308A\u8A73\u7D30\u306AJVM\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\n                       \u8868\u793A\u3059\u308B\n    -Xloggc:<file>    \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n    -Xmixed           \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n    -Xmn<size>        \u82E5\u3044\u4E16\u4EE3(\u30CA\u30FC\u30B5\u30EA)\u306E\u30D2\u30FC\u30D7\u306E\u521D\u671F\u304A\u3088\u3073\u6700\u5927\u30B5\u30A4\u30BA(\u30D0\u30A4\u30C8\u5358\u4F4D)\n                      \u3092\u8A2D\u5B9A\u3059\u308B\n    -Xms<size>        Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xmx<size>        Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xnoclassgc       \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n    -Xprof            CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n    -Xrs              Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n    -Xshare:auto      \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n    -Xshare:off       \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n    -Xshare:on        \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n    -XshowSettings    \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:all\n                      \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:locale\n                      \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:properties\n                      \
-\u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -Xss<size>        Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xverify          \u30D0\u30A4\u30C8\u30B3\u30FC\u30C9\u691C\u8A3C\u6A5F\u80FD\u306E\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3059\u308B\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<target-module>\n                      \u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059\u3002 \n                      <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n                      \u8AAD\u307F\u53D6\u308C\u307E\u3059\u3002\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<package>\u3092<target-module>\u306B\n                      \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\n                      <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\n                      \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3067\u304D\u307E\u3059\u3002\n    --disable-@files  \u3055\u3089\u306A\u308B\u5F15\u6570\u30D5\u30A1\u30A4\u30EB\u62E1\u5F35\u3092\u7121\u52B9\u306B\u3059\u308B\n    --patch-module <module>=<file>({0}<file>)*\n                      JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u3067\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\n                      \u62E1\u5F35\u3057\u307E\u3059\u3002\n\n\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\n
+java.launcher.X.usage=\n    -Xbatch           \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n    -Xbootclasspath/a:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n                      \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n    -Xcheck:jni       JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n    -Xcomp            \u521D\u56DE\u547C\u51FA\u3057\u6642\u306B\u30E1\u30BD\u30C3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u5F37\u5236\u3059\u308B\n    -Xdebug           \u4E0B\u4F4D\u4E92\u63DB\u6027\u306E\u305F\u3081\u306B\u63D0\u4F9B\n    -Xdiag            \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n    -Xdiag:resolver   \u30EA\u30BE\u30EB\u30D0\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n    -Xfuture          \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n    -Xint             \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n    -Xinternalversion\n                      -version\u30AA\u30D7\u30B7\u30E7\u30F3\u3088\u308A\u8A73\u7D30\u306AJVM\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\n                       \u8868\u793A\u3059\u308B\n    -Xloggc:<file>    \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n    -Xmixed           \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n    -Xmn<size>        \u82E5\u3044\u4E16\u4EE3(\u30CA\u30FC\u30B5\u30EA)\u306E\u30D2\u30FC\u30D7\u306E\u521D\u671F\u304A\u3088\u3073\u6700\u5927\u30B5\u30A4\u30BA(\u30D0\u30A4\u30C8\u5358\u4F4D)\n                      \u3092\u8A2D\u5B9A\u3059\u308B\n    -Xms<size>        Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xmx<size>        Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xnoclassgc       \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n    -Xprof            CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n    -Xrs              Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n    -Xshare:auto      \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n    -Xshare:off       \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n    -Xshare:on        \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n    -XshowSettings    \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:all\n                      \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:locale\n                      \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:properties\n                      \
+\u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n    -Xss<size>        Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n    -Xverify          \u30D0\u30A4\u30C8\u30B3\u30FC\u30C9\u691C\u8A3C\u6A5F\u80FD\u306E\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3059\u308B\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<target-module>\n                      \u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059\u3002 \n                      <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n                      \u8AAD\u307F\u53D6\u308C\u307E\u3059\u3002\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<package>\u3092<target-module>\u306B\n                      \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\n                      <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\n                      \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3067\u304D\u307E\u3059\u3002\n    --add-opens <module>/<package>=<target-module>(,<target-module>)*\n                      \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066\n                      <package>\u3092<target-module>\u306B\u958B\u304D\u307E\u3059\u3002\n    --disable-@files  \u3055\u3089\u306A\u308B\u5F15\u6570\u30D5\u30A1\u30A4\u30EB\u62E1\u5F35\u3092\u7121\u52B9\u306B\u3059\u308B\n    --patch-module <module>=<file>({0}<file>)*\n                      JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u3067\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n                      \u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\u62E1\u5F35\u3057\u307E\u3059\u3002\n\n\u3053\u308C\u3089\u306F\u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\n
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\n\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306FMac OS X\u56FA\u6709\u3067\u3059:\n    -XstartOnFirstThread\n                      main()\u30E1\u30BD\u30C3\u30C9\u3092\u6700\u521D(AppKit)\u306E\u30B9\u30EC\u30C3\u30C9\u3067\u5B9F\u884C\u3059\u308B\n    -Xdock:name=<application name>\n                      Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n    -Xdock:icon=<path to icon file>\n                      Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n\n
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ko.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ko.properties
index a734e61..e543dc7 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ko.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_ko.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,23 +24,19 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   \uC0AC\uC6A9\uBC95: {0} [options] class [args...]\n           (\uD074\uB798\uC2A4 \uC2E4\uD589)\n   \uB610\uB294  {0} [options] -jar jarfile [args...]\n           (jar \uD30C\uC77C \uC2E4\uD589)\n   \uB610\uB294  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (\uBAA8\uB4C8\uC758 \uAE30\uBCF8 \uD074\uB798\uC2A4 \uC2E4\uD589)\n\uC5EC\uAE30\uC11C options\uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n
+java.launcher.opt.header  =   \uC0AC\uC6A9\uBC95: {0} [options] class [args...]\n           (\uD074\uB798\uC2A4 \uC2E4\uD589)\n   \uB610\uB294  {0} [options] -jar jarfile [args...]\n           (jar \uD30C\uC77C \uC2E4\uD589)\n   \uB610\uB294  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (\uBAA8\uB4C8\uC758 \uAE30\uBCF8 \uD074\uB798\uC2A4 \uC2E4\uD589)\n\uC5EC\uAE30\uC11C options\uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  \uB354 \uC774\uC0C1 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC74C. \uC774\uD6C4 \uB9B4\uB9AC\uC2A4\uC5D0\uC11C \uC81C\uAC70\uB429\uB2C8\uB2E4.\n
 java.launcher.opt.vmselect   =\    {0}\t  "{1}" VM\uC744 \uC120\uD0DD\uD569\uB2C8\uB2E4.\n
 java.launcher.opt.hotspot    =\    {0}\t  "{1}" VM\uC758 \uB3D9\uC758\uC5B4\uC785\uB2C8\uB2E4[\uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC74C].\n
 
-java.launcher.ergo.message1  =\                  \uAE30\uBCF8 VM\uC740 {0}\uC785\uB2C8\uB2E4.
-java.launcher.ergo.message2  =\                  \uC11C\uBC84\uAE09 \uC2DC\uC2A4\uD15C\uC5D0\uC11C \uC2E4\uD589 \uC911\uC774\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4.\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =\    -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n    -classpath <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n    --class-path <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n              \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n                  JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n    -p <\uBAA8\uB4C8 \uACBD\uB85C>\n    -module-path <\uBAA8\uB4C8 \uACBD\uB85C>...\n                  {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC785\uB2C8\uB2E4. \uAC01 \uB514\uB809\uD1A0\uB9AC\uB294\n                  \uBAA8\uB4C8\uC758 \uB514\uB809\uD1A0\uB9AC\uC785\uB2C8\uB2E4.\n    -upgrade-module-path <\uBAA8\uB4C8 \uACBD\uB85C>...\n                  {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC785\uB2C8\uB2E4. \uAC01 \uB514\uB809\uD1A0\uB9AC\uB294\n                  \uBAA8\uB4C8\uC758 \uB514\uB809\uD1A0\uB9AC\uB85C, \uB7F0\uD0C0\uC784 \uC774\uBBF8\uC9C0\uC5D0\uC11C \uC5C5\uADF8\uB808\uC774\uB4DC\n                  \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC744 \uB300\uCCB4\uD569\uB2C8\uB2E4.\n    -m <\uBAA8\uB4C8>[/<\uAE30\uBCF8 \uD074\uB798\uC2A4>]\n    --module <\uBAA8\uB4C8 \uC774\uB984>[/<\uAE30\uBCF8 \uD074\uB798\uC2A4>]\n              \uBD84\uC11D\uD560 \uCD08\uAE30 \uBAA8\uB4C8 \uBC0F \uBAA8\uB4C8\uC5D0\uC11C \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uACBD\uC6B0 \uC2E4\uD589\uD560\n                  \uAE30\uBCF8 \uD074\uB798\uC2A4\uC758 \uC774\uB984\uC785\uB2C8\uB2E4.\n    --add-modules <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n                  \uCD08\uAE30 \uBAA8\uB4C8 \uC678\uC5D0 \uBD84\uC11D\uD560 \uB8E8\uD2B8 \uBAA8\uB4C8\uC785\uB2C8\uB2E4.\n                  <\uBAA8\uB4C8 \uC774\uB984>\uC740 ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH\uC77C \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4.\n    --limit-modules <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n                  \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC744 \uB098\uC5F4\uD558\uACE0 \uC885\uB8CC \uBC94\uC704\uB97C \uC81C\uD55C\uD569\uB2C8\uB2E4.\n    --list-modules[<\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]]\n                  \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC744 \uB098\uC5F4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n    --dry-run     VM\uC744 \uC0DD\uC131\uD558\uC9C0\uB9CC \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n                  \uC774 --dry-run \uC635\uC158\uC740 \uBAA8\uB4C8 \uC2DC\uC2A4\uD15C \uAD6C\uC131\uACFC \uAC19\uC740 \uBA85\uB839\uD589\n                  \uC635\uC158\uC744 \uAC80\uC99D\uD558\uB294 \uB370 \uC720\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n    -D<\uC774\uB984>=<\uAC12>\n                  \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n    -verbose:[class|gc|jni]\n                  \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -version      \uC81C\uD488 \uBC84\uC804\uC744 \uC624\uB958 \uC2A4\uD2B8\uB9BC\uC5D0 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n    --version     \uC81C\uD488 \uBC84\uC804\uC744 \uCD9C\uB825 \uC2A4\uD2B8\uB9BC\uC5D0 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n    -showversion  \uC81C\uD488 \uBC84\uC804\uC744 \uC624\uB958 \uC2A4\uD2B8\uB9BC\uC5D0 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    --show-version\n                  \uC81C\uD488 \uBC84\uC804\uC744 \uCD9C\uB825 \uC2A4\uD2B8\uB9BC\uC5D0 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -? -h -help\n                 \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC624\uB958 \
+\uC2A4\uD2B8\uB9BC\uC5D0 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n    --help        \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uCD9C\uB825 \uC2A4\uD2B8\uB9BC\uC5D0 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n    -X            \uCD94\uAC00 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC624\uB958 \uC2A4\uD2B8\uB9BC\uC5D0 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n    --help-extra  \uCD94\uAC00 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uCD9C\uB825 \uC2A4\uD2B8\uB9BC\uC5D0 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n    -ea[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n    -enableassertions[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n                  \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -da[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n    -disableassertions[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n                  \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -esa | -enablesystemassertions\n                  \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -dsa | -disablesystemassertions\n                  \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -agentlib:<\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984>[=<\uC635\uC158>]\n                  \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC <\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984>\uC744 \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:jdwp).\n                  -agentlib:jdwp=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n    -agentpath:<\uACBD\uB85C \uC774\uB984>[=<\uC635\uC158>]\n                  \uC804\uCCB4 \uACBD\uB85C \uC774\uB984\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n    -javaagent:<jar \uACBD\uB85C>[=<\uC635\uC158>]\n                  Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n    -splash:<\uC774\uBBF8\uC9C0 \uACBD\uB85C>\n                  \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n                  HiDPI\uB85C \uC870\uC815\uB41C \uC774\uBBF8\uC9C0\uAC00 \uC790\uB3D9\uC73C\uB85C \uC9C0\uC6D0\uB418\uACE0 \uAC00\uB2A5\uD55C \uACBD\uC6B0\n                  \uC0AC\uC6A9\uB429\uB2C8\uB2E4. \uBBF8\uC870\uC815 \uC774\uBBF8\uC9C0 \uD30C\uC77C \uC774\uB984(\uC608: image.ext)\uC740\n                  \uD56D\uC0C1 -splash \uC635\uC158\uC5D0 \uC778\uC218\uB85C \uC804\uB2EC\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.\n                  \uAC00\uC7A5 \uC801\uC808\uD788 \uC870\uC815\uB41C \uC774\uBBF8\uC9C0\uAC00 \uC790\uB3D9\uC73C\uB85C\n                  \uCC44\uD0DD\uB429\uB2C8\uB2E4.\n                  \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 SplashScreen API \uC124\uBA85\uC11C\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n    @<\uD30C\uC77C \uACBD\uB85C>   \uC9C0\uC815\uB41C \uD30C\uC77C\uC5D0\uC11C \uC635\uC158\uC744 \uC77D\uC2B5\uB2C8\uB2E4.\n\nlong \uC635\uC158\uC5D0 \uB300\uD55C \uC778\uC218\uB97C \uC9C0\uC815\uD558\uB824\uBA74 --<\uC774\uB984>=<\uAC12> \uB610\uB294\n--<\uC774\uB984> <\uAC12>\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n    -classpath <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n    --class-path <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n                  \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n                  JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n    -p <\uBAA8\uB4C8 \uACBD\uB85C>\n    --module-path <\uBAA8\uB4C8 \uACBD\uB85C>...\n                  {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC785\uB2C8\uB2E4. \uAC01 \uB514\uB809\uD1A0\uB9AC\uB294\n                  \uBAA8\uB4C8\uC758 \uB514\uB809\uD1A0\uB9AC\uC785\uB2C8\uB2E4.\n    --upgrade-module-path <\uBAA8\uB4C8 \uACBD\uB85C>...\n                  {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC785\uB2C8\uB2E4. \uAC01 \uB514\uB809\uD1A0\uB9AC\uB294\n                  \uBAA8\uB4C8\uC758 \uB514\uB809\uD1A0\uB9AC\uB85C, \uB7F0\uD0C0\uC784 \uC774\uBBF8\uC9C0\uC5D0\uC11C \uC5C5\uADF8\uB808\uC774\uB4DC\n                  \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC744 \uB300\uCCB4\uD569\uB2C8\uB2E4.\n    -m <\uBAA8\uB4C8>[/<\uAE30\uBCF8 \uD074\uB798\uC2A4>]\n    --module <\uBAA8\uB4C8 \uC774\uB984>[/<\uAE30\uBCF8 \uD074\uB798\uC2A4>]\n                  \uBD84\uC11D\uD560 \uCD08\uAE30 \uBAA8\uB4C8 \uBC0F \uBAA8\uB4C8\uC5D0\uC11C \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uACBD\uC6B0 \uC2E4\uD589\uD560\n                  \uAE30\uBCF8 \uD074\uB798\uC2A4\uC758 \uC774\uB984\uC785\uB2C8\uB2E4.\n    --add-modules <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n                  \uCD08\uAE30 \uBAA8\uB4C8 \uC678\uC5D0 \uBD84\uC11D\uD560 \uB8E8\uD2B8 \uBAA8\uB4C8\uC785\uB2C8\uB2E4.\n                  <\uBAA8\uB4C8 \uC774\uB984>\uC740 ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH\uC77C \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4.\n    --limit-modules <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n                  \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC758 \uBC94\uC704\uB97C \uC81C\uD55C\uD569\uB2C8\uB2E4.\n    --list-modules [<\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]]\n                  \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC744 \uB098\uC5F4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n    --dry-run     VM\uC744 \uC0DD\uC131\uD558\uC9C0\uB9CC \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n                  \uC774 --dry-run \uC635\uC158\uC740 \uBAA8\uB4C8 \uC2DC\uC2A4\uD15C \uAD6C\uC131\uACFC \uAC19\uC740 \uBA85\uB839\uD589\n                  \uC635\uC158\uC744 \uAC80\uC99D\uD558\uB294 \uB370 \uC720\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n    -D<\uC774\uB984>=<\uAC12>\n                  \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n    -verbose:[class|gc|jni]\n                  \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -version      \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n    -showversion  \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -? -help --help\n                  \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n    -X            \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n    -ea[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n    -enableassertions[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n                  \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \
-\uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -da[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n    -disableassertions[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n                  \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -esa | -enablesystemassertions\n                  \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -dsa | -disablesystemassertions\n                  \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -agentlib:<\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984>[=<\uC635\uC158>]\n                  \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC <\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984>\uC744 \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:jdwp).\n                  -agentlib:jdwp=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n    -agentpath:<\uACBD\uB85C \uC774\uB984>[=<\uC635\uC158>]\n                  \uC804\uCCB4 \uACBD\uB85C \uC774\uB984\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n    -javaagent:<jar \uACBD\uB85C>[=<\uC635\uC158>]\n                  Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n    -splash:<\uC774\uBBF8\uC9C0 \uACBD\uB85C>\n                  \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n                  HiDPI\uB85C \uC870\uC815\uB41C \uC774\uBBF8\uC9C0\uAC00 \uC790\uB3D9\uC73C\uB85C \uC9C0\uC6D0\uB418\uACE0 \uAC00\uB2A5\uD55C \uACBD\uC6B0\n                  \uC0AC\uC6A9\uB429\uB2C8\uB2E4. \uBBF8\uC870\uC815 \uC774\uBBF8\uC9C0 \uD30C\uC77C \uC774\uB984(\uC608: image.ext)\uC740\n                  \uD56D\uC0C1 -splash \uC635\uC158\uC5D0 \uC778\uC218\uB85C \uC804\uB2EC\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.\n                  \uAC00\uC7A5 \uC801\uC808\uD788 \uC870\uC815\uB41C \uC774\uBBF8\uC9C0\uAC00 \uC790\uB3D9\uC73C\uB85C \uCC44\uD0DD\uB429\uB2C8\uB2E4.\n                  \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 SplashScreen API \uC124\uBA85\uC11C\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n    @<\uD30C\uC77C \uACBD\uB85C>   \uC9C0\uC815\uB41C \uD30C\uC77C\uC5D0\uC11C \uC635\uC158\uC744 \uC77D\uC2B5\uB2C8\uB2E4.\nlong \uC635\uC158\uC5D0 \uB300\uD55C \uC778\uC218\uB97C \uC9C0\uC815\uD558\uB824\uBA74 --<\uC774\uB984>=<\uAC12> \uB610\uB294 --<\uC774\uB984> <\uAC12>\uC744\n\uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
-See \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xbootclasspath/a:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n                      \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n    -Xcheck:jni       JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n    -Xcomp            \uCCAB\uBC88\uC9F8 \uD638\uCD9C\uC5D0\uC11C \uBA54\uC18C\uB4DC \uCEF4\uD30C\uC77C\uC744 \uAC15\uC81C\uD569\uB2C8\uB2E4.\n    -Xdebug           \uC5ED \uD638\uD658\uC131\uC744 \uC704\uD574 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n    -Xdiag            \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n    -Xdiag:resolver   \uBD84\uC11D\uAE30 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n    -Xfuture          \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xint             \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n    -Xinternalversion\n                      -version \uC635\uC158\uBCF4\uB2E4 \uC0C1\uC138\uD55C JVM \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n    -Xloggc:<file>    \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n    -Xmixed           \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n    -Xmn<size>        \uC80A\uC740 \uC138\uB300(Nursery)\uB97C \uC704\uD574 \uD799\uC758 \uCD08\uAE30 \uBC0F \uCD5C\uB300\n                      \uD06C\uAE30(\uBC14\uC774\uD2B8)\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xms<size>        \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xmx<size>        \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xnoclassgc       \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xprof            CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n    -Xrs              Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n    -Xshare:auto      \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n    -Xshare:off       \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -Xshare:on        \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n    -XshowSettings    \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:all\n                      \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:locale\n                      \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:properties\n                      \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -Xss<size>        Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \
-\uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xverify          \uBC14\uC774\uD2B8\uCF54\uB4DC \uAC80\uC99D\uC790\uC758 \uBAA8\uB4DC\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <target-module>\uC744 \uC77D\uB3C4\uB85D\n                      <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n                      <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uC744 \uC77D\uC744 \uC218 \uC788\uB294\n                      ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <package>\uB97C <target-module>\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD558\uB3C4\uB85D\n                      <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n                      <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD560 \uC218 \uC788\uB294\n                      ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n    --disable-@files  \uCD94\uAC00 \uC778\uC218 \uD30C\uC77C \uD655\uC7A5\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    --patch-module <module>=<file>({0}<file>)*\n                      JAR \uD30C\uC77C/\uB514\uB809\uD1A0\uB9AC\uC758 \uD074\uB798\uC2A4\uC640 \uB9AC\uC18C\uC2A4\uB85C\n                      \uBAA8\uB4C8\uC744 \uBB34\uD6A8\uD654\uD558\uAC70\uB098 \uC778\uC218\uD654\uD569\uB2C8\uB2E4.\n\n\uC774 \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
+java.launcher.X.usage=\n    -Xbatch           \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xbootclasspath/a:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n                      \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n    -Xcheck:jni       JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n    -Xcomp            \uCCAB\uBC88\uC9F8 \uD638\uCD9C\uC5D0\uC11C \uBA54\uC18C\uB4DC \uCEF4\uD30C\uC77C\uC744 \uAC15\uC81C\uD569\uB2C8\uB2E4.\n    -Xdebug           \uC5ED \uD638\uD658\uC131\uC744 \uC704\uD574 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n    -Xdiag            \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n    -Xdiag:resolver   \uBD84\uC11D\uAE30 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n    -Xfuture          \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xint             \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n    -Xinternalversion\n                      -version \uC635\uC158\uBCF4\uB2E4 \uC0C1\uC138\uD55C JVM \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n    -Xloggc:<file>    \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n    -Xmixed           \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n    -Xmn<size>        \uC80A\uC740 \uC138\uB300(Nursery)\uB97C \uC704\uD574 \uD799\uC758 \uCD08\uAE30 \uBC0F \uCD5C\uB300\n                      \uD06C\uAE30(\uBC14\uC774\uD2B8)\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xms<size>        \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xmx<size>        \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xnoclassgc       \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xprof            CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n    -Xrs              Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n    -Xshare:auto      \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n    -Xshare:off       \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -Xshare:on        \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n    -XshowSettings    \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:all\n                      \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:locale\n                      \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:properties\n                      \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n    -Xss<size>        Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \
+\uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    -Xverify          \uBC14\uC774\uD2B8\uCF54\uB4DC \uAC80\uC99D\uC790\uC758 \uBAA8\uB4DC\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <target-module>\uC744 \uC77D\uB3C4\uB85D\n                      <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n                      <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uC744 \uC77D\uC744 \uC218 \uC788\uB294\n                      ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <package>\uB97C <target-module>\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD558\uB3C4\uB85D\n                      <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n                      <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD560 \uC218 \uC788\uB294\n                      ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n    --add-opens <module>/<package>=<target-module>(,<target-module>)*\n                      \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <package>\uB97C <target-module>\uB85C \uC5F4\uB3C4\uB85D\n                      <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n    --disable-@files  \uCD94\uAC00 \uC778\uC218 \uD30C\uC77C \uD655\uC7A5\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n    --patch-module <module>=<file>({0}<file>)*\n                      JAR \uD30C\uC77C \uB610\uB294 \uB514\uB809\uD1A0\uB9AC\uC758 \uD074\uB798\uC2A4\uC640 \uB9AC\uC18C\uC2A4\uB85C\n                      \uBAA8\uB4C8\uC744 \uBB34\uD6A8\uD654\uD558\uAC70\uB098 \uC778\uC218\uD654\uD569\uB2C8\uB2E4.\n\n\uC774\uB7EC\uD55C \uCD94\uAC00 \uC635\uC158\uC740 \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\n\uB2E4\uC74C\uC740 Mac OS X\uC5D0 \uD2B9\uC815\uB41C \uC635\uC158\uC785\uB2C8\uB2E4.\n    -XstartOnFirstThread\n                      \uCCAB\uBC88\uC9F8 (AppKit) \uC2A4\uB808\uB4DC\uC5D0 main() \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4.\n    -Xdock:name=<application name>\n                      \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC774\uB984\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n    -Xdock:icon=<path to icon file>\n                      \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC544\uC774\uCF58\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\n
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_pt_BR.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_pt_BR.properties
index 1d8421d..e83e6d5 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_pt_BR.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_pt_BR.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,22 +24,18 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Uso: {0} [options] class [args...]\n           (para executar uma classe)\n   ou  {0} [options] -jar jarfile [args...]\n           (para executar um arquivo jar)\n   or  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (para executar a classe principal em um m\u00F3dulo)\nem que as op\u00E7\u00F5es incluem:\n
+java.launcher.opt.header  =   Uso: {0} [options] class [args...]\n           (para executar uma classe)\n   ou  {0} [options] -jar jarfile [args...]\n           (para executar um arquivo jar)\n   or  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (para executar a classe principal em um m\u00F3dulo)\nem que as op\u00E7\u00F5es incluem:\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  Obsoleto, ser\u00E1 removido em uma futura release\n
 java.launcher.opt.vmselect   =\    {0}\t  para selecionar a VM "{1}"\n
 java.launcher.opt.hotspot    =\    {0}\t  \u00E9 um sin\u00F4nimo da VM "{1}" [obsoleto]\n
 
-java.launcher.ergo.message1  =\                  A VM padr\u00E3o \u00E9 {0}
-java.launcher.ergo.message2  =\                  porque a execu\u00E7\u00E3o est\u00E1 sendo feita em uma m\u00E1quina de classe de servidor.\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =\    -cp <caminho de pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n    -classpath <caminho de pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n    --class-path <caminho de pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n                  Uma lista separada por {0} de diret\u00F3rios, arquivos compactados JAR\n                  e arquivos ZIP nos quais procurar arquivos de classe.\n    -p <caminho de m\u00F3dulo>\n    --module-path <caminho de m\u00F3dulo>...\n                  Uma lista separada por {0} de diret\u00F3rios, cada um sendo um\n                  diret\u00F3rio de m\u00F3dulos.\n    --upgrade-module-path <caminho de m\u00F3dulo>...\n                  Uma lista separada por {0} de diret\u00F3rios, cada um\n                  um diret\u00F3rio de m\u00F3dulos que substituem m\u00F3dulos\n                  atualiz\u00E1veis na imagem de runtime\n    -m <module>[/<mainclass>]\n    --module <modulename>[/<mainclass>]\n                  o m\u00F3dulo inicial a ser resolvido e o nome da classe principal\n                  a ser executada se n\u00E3o especificado pelo m\u00F3dulo\n    --add-modules <modulename>[,<modulename>...]\n                  m\u00F3dulos raiz a serem resolvidos al\u00E9m do m\u00F3dulo inicial.\n                  <modulename> pode ser tamb\u00E9m ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH.\n    --limit-modules <modulename>[,<modulename>...]\n                  limitar o universo dos m\u00F3dulos observ\u00E1veis\n    --list-modules [<modulename>[,<modulename>...]]\n                  listar os m\u00F3dulos observ\u00E1veis e sair\n    --dry-run     criar VM, mas n\u00E3o executar o m\u00E9todo principal.\n                  Esta op\u00E7\u00E3o --dry-run pode ser \u00FAtil para validar as\n                  op\u00E7\u00F5es de linha de comando, como a configura\u00E7\u00E3o do sistema de m\u00F3dulos.\n    -D<name>=<value>\n                  definir uma propriedade do sistema\n    -verbose:[class|gc|jni]\n                  ativar sa\u00EDda detalhada\n    -version      imprimir vers\u00E3o do produto no fluxo de erros e sair\n    --version     imprimir vers\u00E3o do produto no fluxo de sa\u00EDda e sair\n    -showversion  imprimir vers\u00E3o do produto no fluxo de sa\u00EDda e continuar\n    --show-version\n                  imprimir vers\u00E3o do produto no fluxo de sa\u00EDda e continuar\n    -? -h -help\n                  imprimir esta mensagem de ajuda no fluxo de erros\n    --help        imprimir esta mensagem de ajuda no fluxo de sa\u00EDda\n    -X            imprimir ajuda sobre op\u00E7\u00F5es extras no fluxo de erros\n    --help-extra  imprimir ajuda sobre op\u00E7\u00F5es extras no fluxo de sa\u00EDda\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  ativar asser\u00E7\u00F5es com granularidade especificada\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  desativar asser\u00E7\u00F5es com granularidade especificada\n    -esa | -enablesystemassertions\n                  ativar asser\u00E7\u00F5es de sistema\n    -dsa | -disablesystemassertions\n                  desativar asser\u00E7\u00F5es de sistema\n    -agentlib:<libname>[=<options>]\n                  carregar biblioteca de agente nativo <libname>; por exemplo, -agentlib:jdwp\n                  ver tamb\u00E9m -agentlib:jdwp=help\n    -agentpath:<pathname>[=<options>]\n                  carregar biblioteca de agente nativo por nome do caminho completo\n    -javaagent:<jarpath>[=<options>]\n                  carregar agente de linguagem de programa\u00E7\u00E3o Java; ver java.lang.instrument\n    -splash:<imagepath>\n                  mostrar tela de apresenta\u00E7\u00E3o com imagem especificada\n                  Imagens em escala HiDPI ser\u00E3o automaticamente suportadas e usadas\n                  se dispon\u00EDveis. O \
+nome do arquivo de imagem sem escala, por exemplo, image.ext,\n                  sempre dever\u00E1 ser informado como argumento para a op\u00E7\u00E3o -splash.\n                  A imagem em escala mais apropriada fornecida ser\u00E1 selecionada\n                  automaticamente.\n                  Consulte a documenta\u00E7\u00E3o da API SplashScreen para obter mais informa\u00E7\u00F5es.\n    @<filepath>   op\u00E7\u00F5es de leitura do arquivo especificado\n\nPara especificar um argumento para uma op\u00E7\u00E3o longa, voc\u00EA pode usar --<name>=<value> ou\n--<name> <value>.\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <caminho da pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n    -classpath <caminho da pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n    --class-path <caminho da pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n                  Uma lista separada por {0} de diret\u00F3rios, arquivos compactados JAR\n                  e ZIP para pesquisa de arquivos de classe.\n    -p <caminho do m\u00F3dulo>\n    --module-path <caminho do m\u00F3dulo>...\n                  Uma lista separada por {0} de diret\u00F3rios, cada um\n                  sendo um diret\u00F3rio de m\u00F3dulos.\n    --upgrade-module-path <caminho do m\u00F3dulo>...\n                  Uma lista separada por {0} de diret\u00F3rios, cada um sendo\n                  um diret\u00F3rio de m\u00F3dulos que substituem m\u00F3dulos atualiz\u00E1veis\n                  por upgrade na imagem do runtime\n    -m <module>[/<mainclass>]\n    --module <modulename>[/<mainclass>]\n                  o m\u00F3dulo inicial a ser resolvido e o nome da classe principal\n                  a ser executada se o m\u00F3dulo n\u00E3o especificar\n    --add-modules <modulename>[,<modulename>...]\n                  m\u00F3dulos-raiz a serem resolvidos al\u00E9m do m\u00F3dulo inicial.\n                  <modulename> tamb\u00E9m pode ser ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH.\n    --limit-modules <modulename>[,<modulename>...]\n                  limitar o universo de m\u00F3dulos observ\u00E1veis\n    --list-modules [<modulename>[,<modulename>...]]\n                  listar os m\u00F3dulos observ\u00E1veis e sair\n    --dry-run     criar VM, mas n\u00E3o executar o m\u00E9todo principal.\n                  Esta op\u00E7\u00E3o --dry-run pode ser \u00FAtil para validar as\n                  op\u00E7\u00F5es da linha de comando, como a configura\u00E7\u00E3o do sistema do m\u00F3dulo.\n    -D<name>=<value>\n                  definir uma propriedade do sistema\n    -verbose:[class|gc|jni]\n                  ativar sa\u00EDda detalhada\n    -version      imprimir vers\u00E3o do produto e sair\n    -showversion  imprimir vers\u00E3o do produto e continuar\n    -? -help --help\n                  imprimir esta mensagem de ajuda\n    -X            imprimir a ajuda em op\u00E7\u00F5es n\u00E3o padr\u00E3o\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  ativar asser\u00E7\u00F5es com granularidade especificada\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  desativar asser\u00E7\u00F5es com granularidade especificada\n    -esa | -enablesystemassertions\n                  ativar asser\u00E7\u00F5es do sistema\n    -dsa | -disablesystemassertions\n                  desativar asser\u00E7\u00F5es do sistema\n    -agentlib:<libname>[=<options>]\n                  carregar biblioteca de agentes nativa <libname>; por exemplo, -agentlib:jdwp\n                  consulte tamb\u00E9m -agentlib:jdwp=help\n    -agentpath:<pathname>[=<options>]\n                  carregar biblioteca de agentes nativa por nome de caminho completo\n    -javaagent:<jarpath>[=<options>]\n                  carregar agente de linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n    -splash:<imagepath>\n                  mostrar tela de abertura com imagem especificada\n                  Imagens HiDPI dimensionadas s\u00E3o suportadas automaticamente e utilizadas\n                  se dispon\u00EDveis. O nome do arquivo de imagem n\u00E3o dimensionada, por exemplo, image.ext,\n                  deve ser informado sempre como argumento para a op\u00E7\u00E3o -splash.\n                  A imagem dimensionada mais apropriada fornecida ser\u00E1 selecionada\n                  automaticamente.\n                  Consulte a documenta\u00E7\u00E3o da API de Tela de Abertura para obter mais \
-informa\u00E7\u00F5es.\n    @<filepath>   op\u00E7\u00F5es de leitura do arquivo especificado\nPara especificar um argumento para uma op\u00E7\u00E3o longa, voc\u00EA pode usar --<name>=<value> ou\n--<name> <value>.\n
-See http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes.
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           desativar compila\u00E7\u00E3o em segundo plano\n    -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexar ao final do caminho de classe bootstrap\n    -Xcheck:jni       executar verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es JNI\n    -Xcomp            for\u00E7a a compila\u00E7\u00E3o de m\u00E9todos na primeira chamada\n    -Xdebug           fornecido para fins de compatibilidade reversa\n    -Xdiag            mostrar mensagens de diagn\u00F3stico adicionais\n    -Xdiag:resolver   mostrar mensagens de diagn\u00F3stico do resolvedor\n    -Xfuture          ativar verifica\u00E7\u00F5es mais rigorosas, antecipando padr\u00E3o futuro\n    -Xint             somente execu\u00E7\u00E3o em modo interpretado\n    -Xinternalversion\n                      exibe informa\u00E7\u00F5es mais detalhadas de vers\u00E3o da JVM do que a\n                      op\u00E7\u00E3o -version\n    -Xloggc:<file>    registrar status de GC em um arquivo com time-stamps\n    -Xmixed           execu\u00E7\u00E3o em modo misto (padr\u00E3o)\n    -Xmn<size>        define o tamanho inicial e m\u00E1ximo (em bytes) do heap\n                      para a gera\u00E7\u00E3o jovem (infantil)\n    -Xms<size>        definir tamanho do heap Java inicial\n    -Xmx<size>        definir tamanho do heap Java m\u00E1ximo\n    -Xnoclassgc       desativar coleta de lixo de classe\n    -Xprof            emitir dados de perfil de cpu\n    -Xrs              reduzir uso de sinais do SO por Java/VM (consultar documenta\u00E7\u00E3o)\n    -Xshare:auto      usar dados de classe compartilhados, se poss\u00EDvel (padr\u00E3o)\n    -Xshare:off       n\u00E3o tentar usar dados de classe compartilhados\n    -Xshare:on        exigir o uso de dados de classe compartilhados; caso contr\u00E1rio, falhar\u00E1.\n    -XshowSettings    mostrar todas as defini\u00E7\u00F5es e continuar\n    -XshowSettings:all\n                      mostrar todas as defini\u00E7\u00F5es e continuar\n    -XshowSettings:locale\n                      mostrar todas as defini\u00E7\u00F5es relativas a localidade e continuar\n    -XshowSettings:properties\n                      mostrar todas as defini\u00E7\u00F5es de propriedade e continuar\n    -XshowSettings:vm mostrar todas as defini\u00E7\u00F5es relativas a vm e continuar\n    -Xss<size>        definir tamanho de pilha de thread java\n    -Xverify          define o modo do verificador de c\u00F3digo de byte\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      atualiza <module> para ler <target-module>, independentemente\n                      da declara\u00E7\u00E3o do m\u00F3dulo. \n                      <target-module> pode ser ALL-UNNAMED para ler todos os m\u00F3dulos\n                      sem nome.\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      atualiza <module> para exportar <package> para <target-module>,\n                      independentemente da declara\u00E7\u00E3o do m\u00F3dulo.\n                      <target-module> pode ser ALL-UNNAMED para exportar para todos\n                      os m\u00F3dulos sem nome.\n    --disable-@files  desativar expans\u00E3o de arquivo de argumento adicional\n    --patch-module <module>=<file>({0}<file>)*\n                      Substituir ou aumentar um m\u00F3dulo com classes e recursos\n                      em arquivo JAR ou diret\u00F3rios.\n\nEssas op\u00E7\u00F5es n\u00E3o s\u00E3o padr\u00E3o e est\u00E3o sujeitas a altera\u00E7\u00E3o sem aviso.\n
+java.launcher.X.usage=\n    -Xbatch           desativar compila\u00E7\u00E3o em segundo plano\n    -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n                      anexar ao final do caminho de classe de bootstrap\n    -Xcheck:jni       executar verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es JNI\n    -Xcomp            for\u00E7a a compila\u00E7\u00E3o de m\u00E9todos na primeira chamada\n    -Xdebug           fornecido para compatibilidade reversa\n    -Xdiag            mostrar mensagens adicionais de diagn\u00F3stico\n    -Xdiag:resolver   mostrar mensagens de diagn\u00F3stico do resolvedor\n    -Xfuture          ativar verifica\u00E7\u00F5es mais estritas, antecipando padr\u00E3o futuro\n    -Xint             somente execu\u00E7\u00E3o de modo interpretado\n    -Xinternalversion\n                      exibe informa\u00E7\u00F5es mais detalhadas da vers\u00E3o da JVM do que a\n                      op\u00E7\u00E3o -version\n    -Xloggc:<file>    registrar status de GC em um arquivo com time-stamps\n    -Xmixed           execu\u00E7\u00E3o em modo misto (padr\u00E3o)\n    -Xmn<size>        define o tamanho inicial e m\u00E1ximo (em bytes) do heap\n                      para a gera\u00E7\u00E3o jovem (infantil)\n    -Xms<size>        definir tamanho inicial do heap Java\n    -Xmx<size>        definir tamanho m\u00E1ximo do heap Java\n    -Xnoclassgc       desativar coleta de lixo de classe\n    -Xprof            gerar dados de perfil de cpu\n    -Xrs              reduzir uso de sinais do SO por Java/VM (ver documenta\u00E7\u00E3o)\n    -Xshare:auto      usar dados de classe compartilhados se poss\u00EDvel (padr\u00E3o)\n    -Xshare:off       n\u00E3o tentar usar dados de classe compartilhados\n    -Xshare:on        exigido o uso de dados de classe compartilhados; caso contr\u00E1rio, falhar\u00E1.\n    -XshowSettings    mostrar todas as defini\u00E7\u00F5es e continuar\n    -XshowSettings:all\n                      mostrar todas as defini\u00E7\u00F5es e continuar\n    -XshowSettings:locale\n                      mostrar todas as defini\u00E7\u00F5es relacionadas a localidade e continuar\n    -XshowSettings:properties\n                      mostrar todas as defini\u00E7\u00F5es de propriedade e continuar\n    -XshowSettings:vm mostrar todas as defini\u00E7\u00F5es relacionadas a vm e continuar\n    -Xss<size>        definir tamanho da pilha de thread java\n    -Xverify          define o modo do verificador de c\u00F3digo de byte\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      atualiza <module> para ler <target-module>, independentemente\n                      da declara\u00E7\u00E3o de m\u00F3dulo. \n                      <target-module> pode ser ALL-UNNAMED para ler todos os m\u00F3dulos\n                      sem nome.\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      atualiza <module> para exportar <package> para <target-module>,\n                      independentemente da declara\u00E7\u00E3o de m\u00F3dulo.\n                      <target-module> pode ser ALL-UNNAMED para exportar todos os\n                      m\u00F3dulos sem nome.\n    --add-opens <module>/<package>=<target-module>(,<target-module>)*\n                      atualiza <module> para abrir <package> para\n                      <target-module>, independentemente da declara\u00E7\u00E3o de m\u00F3dulo.\n    --disable-@files  desativar expans\u00E3o de arquivo de argumento adicional\n    --patch-module <module>=<file>({0}<file>)*\n                      Substitui ou amplia um m\u00F3dulo com classes e recursos\n                      em arquivos ou diret\u00F3rios JAR.\n\nEssas op\u00E7\u00F5es extras est\u00E3o sujeitas a altera\u00E7\u00E3o sem aviso.\n
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\nAs op\u00E7\u00F5es a seguir s\u00E3o espec\u00EDficas para o Mac OS X:\n    -XstartOnFirstThread\n                      executa o m\u00E9todo main() no primeiro thread (AppKit)\n    -Xdock:name=<nome do aplicativo>\n                      substitui o nome do aplicativo padr\u00E3o exibido no encaixe\n    -Xdock:icon=<caminho para o arquivo do \u00EDcone>\n                      substitui o \u00EDcone exibido no encaixe\n\n
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_sv.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_sv.properties
index c456d61..4a66d70 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_sv.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_sv.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,22 +24,18 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   Syntax: {0} [options] class [args...]\n           (f\u00F6r att k\u00F6ra en klass)\n   eller  {0} [options] -jar jarfile [args...]\n           (f\u00F6r att k\u00F6ra en jar-fil)\n   eller {0} [options] -p <moduls\u00F6kv\u00E4g> -m <modulnamn>[/<huvudklass>] [args...]\n           (f\u00F6r att k\u00F6ra huvudklassen i en modul)\nmed alternativen:\n
+java.launcher.opt.header  =   Syntax: {0} [options] class [args...]\n           (f\u00F6r att k\u00F6ra en klass)\n   eller  {0} [options] -jar jarfile [args...]\n           (f\u00F6r att k\u00F6ra en jar-fil)\n   eller {0} [options] -p <moduls\u00F6kv\u00E4g> -m <modulnamn>[/<huvudklass>] [args...]\n           (f\u00F6r att k\u00F6ra huvudklassen i en modul)\nmed alternativen:\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  Inaktuellt, tas bort i en framtida utg\u00E5va\n
 java.launcher.opt.vmselect   =\    {0}\t  f\u00F6r att v\u00E4lja "{1}" VM\n
 java.launcher.opt.hotspot    =\    {0}\t  \u00E4r en synonym f\u00F6r "{1}" VM  [inaktuell]\n
 
-java.launcher.ergo.message1  =\                  Standard-VM \u00E4r {0}
-java.launcher.ergo.message2  =\                  eftersom du k\u00F6r en serverklassmaskin.\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =\    -cp <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n    -classpath <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n    --class-path <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n                  En lista \u00F6ver kataloger, JAR-arkiv och ZIP-arkiv att\n                  s\u00F6ka efter klassfiler i, avgr\u00E4nsad med {0}.\n    -p <moduls\u00F6kv\u00E4g>\n    --module-path <moduls\u00F6kv\u00E4g>...\n                  En lista \u00F6ver kataloger, d\u00E4r varje katalog \u00E4r en katalog\n                  med moduler, avgr\u00E4nsad med {0}.\n    --upgrade-module-path <moduls\u00F6kv\u00E4g>...\n                  En lista \u00F6ver kataloger, d\u00E4r varje katalog \u00E4r en katalog\n                  med moduler som ers\u00E4tter uppgraderingsbara moduler\n                  i exekveringsavbilden, avgr\u00E4nsad med {0} \n    -m <modul>[/<huvudklass>]\n    --module <modulnamn>[/<huvudklass>]\n                  den ursprungliga modulen att l\u00F6sa och namnet p\u00E5 huvudklassen\n                  att k\u00F6ra, om den inte anges av modulen\n    --add-modules <modulnamn>[,<modulnamn>...]\n                  rotmoduler att l\u00F6sa f\u00F6rutom den ursprungliga modulen.\n                  <modulnamn> kan \u00E4ven vara ALL-DEFAULT, ALL-SYSTEM och\n                  ALL-MODULE-PATH.\n    --limit-modules <modulnamn>[,<modulnamn>...]\n                  begr\u00E4nsa universumet med observerbara moduler\n    --list-modules [<modulnamn>[,<modulnamn>...]]\n                  lista de observerbara modulerna och avsluta\n    --dry-run     skapa VM:en men k\u00F6r inte huvudmetoden.\n                  Det h\u00E4r alternativet kan vara anv\u00E4ndbart f\u00F6r att validera\n                  kommandoradsalternativen, som modulsystemkonfigurationen.\n    -D<namn>=<v\u00E4rde>\n                  ange en systemegenskap\n    -verbose:[class|gc|jni]\n                  aktivera utf\u00F6rliga utdata\n    -version      skriv ut produktversion till felstr\u00F6mmen och avsluta\n    --version     skriv ut produktversion till utdatastr\u00F6mmen och avsluta\n    -showversion  skriv ut produktversion till felstr\u00F6mmen och forts\u00E4tt\n    --show-version\n                  skriv ut produktversion till utdatastr\u00F6mmen och forts\u00E4tt\n    -? -h -help\n                  skriv ut det h\u00E4r hj\u00E4lpmeddelandet till felstr\u00F6mmen\n    --help        skriv ut det h\u00E4r hj\u00E4lpmeddelandet till utdatastr\u00F6mmen\n    -X            skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ till felstr\u00F6mmen\n    --help-extra  skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ till utdatastr\u00F6mmen\n    -ea[:<paketnamn>...|:<klassnamn>]\n    -enableassertions[:<paketnamn>...|:<klassnamn>]\n                  aktivera verifieringar med den angivna detaljgraden\n    -da[:<paketnamn>...|:<klassnamn>]\n    -disableassertions[:<paketnamn>...|:<klassnamn>]\n                  avaktivera verifieringar med den angivna detaljgraden\n    -esa | -enablesystemassertions\n                  aktivera systemverifieringar\n    -dsa | -disablesystemassertions\n                  avaktivera systemverifieringar\n    -agentlib:<biblioteksnamn>[=<alternativ>]\n                  ladda det ursprungliga agentbiblioteket <biblioteksnamn>, exempel: -agentlib:jdwp\n                  se \u00E4ven -agentlib:jdwp=help\n    -agentpath:<s\u00F6kv\u00E4gsnamn>[=<alternativ>]\n                  ladda det ursprungliga agentbiblioteket med fullst\u00E4ndigt s\u00F6kv\u00E4gsnamn\n    -javaagent:<jar-s\u00F6kv\u00E4g>[=<alternativ>]\n                  ladda agenten f\u00F6r programmeringsspr\u00E5ket Java, se java.lang.instrument\n    -splash:<bilds\u00F6kv\u00E4g>\n                  visa v\u00E4lkomstsk\u00E4rmen med den angivna bilden\n                  HiDPI-skal\u00E4ndrade bilder st\u00F6ds automatiskt och anv\u00E4nds om de \u00E4r\n                  tillg\u00E4ngliga. Filnamnet p\u00E5 den \
+oskal\u00E4ndrade bilden, t.ex.\n                  bild.filtill\u00E4gg, ska alltid \u00F6verf\u00F6ras som argument till\n                  alternativet -splash.\n                  Den l\u00E4mpligaste skal\u00E4ndrade bilden v\u00E4ljs automatiskt.\n                  Mer information finns i dokumentationen f\u00F6r API:t SplashScreen.\n    @<fils\u00F6kv\u00E4g>   l\u00E4s alternativ fr\u00E5n den angivna filen\n\nOm du vill ange ett argument f\u00F6r ett l\u00E5ngt alternativ kan du anv\u00E4nda --<namn>=<v\u00E4rde>\neller --<namn> <v\u00E4rde>.
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n    -classpath <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n    --class-path <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n                  En lista \u00F6ver kataloger, JAR-arkiv och ZIP-arkiv att\n                  s\u00F6ka efter klassfiler i, avgr\u00E4nsad med {0}.\n    -p <moduls\u00F6kv\u00E4g>\n    --module-path <moduls\u00F6kv\u00E4g>...\n                  En lista \u00F6ver kataloger, d\u00E4r varje katalog \u00E4r en katalog\n                  med moduler, avgr\u00E4nsad med {0}.\n    --upgrade-module-path <moduls\u00F6kv\u00E4g>...\n                  En lista \u00F6ver kataloger, d\u00E4r varje katalog \u00E4r en katalog\n                  med moduler som ers\u00E4tter uppgraderingsbara moduler\n                  i exekveringsavbilden, avgr\u00E4nsad med {0} \n    -m <modul>[/<huvudklass>]\n    --module <modulnamn>[/<huvudklass>]\n                  den ursprungliga modulen att l\u00F6sa och namnet p\u00E5 huvudklassen\n                  att k\u00F6ra, om den inte anges av modulen\n    --add-modules <modulnamn>[,<modulnamn>...]\n                  rotmoduler att l\u00F6sa f\u00F6rutom den ursprungliga modulen.\n                  <modulnamn> kan \u00E4ven vara ALL-DEFAULT, ALL-SYSTEM och\n                  ALL-MODULE-PATH.\n    --limit-modules <modulnamn>[,<modulnamn>...]\n                  begr\u00E4nsa universumet med observerbara moduler\n    --list-modules [<modulnamn>[,<modulnamn>...]]\n                  lista de observerbara modulerna och avsluta\n    --dry-run     skapa VM:en men k\u00F6r inte huvudmetoden.\n                  Det h\u00E4r alternativet kan vara anv\u00E4ndbart f\u00F6r att validera\n                  kommandoradsalternativen, som modulsystemkonfigurationen.\n    -D<namn>=<v\u00E4rde>\n                  ange en systemegenskap\n    -verbose:[class|gc|jni]\n                  aktivera utf\u00F6rliga utdata\n    -version      skriv ut produktversion och avsluta\n    -showversion  skriv ut produktversion och forts\u00E4tt\n    -? -help --help\n                  skriv ut det h\u00E4r hj\u00E4lpmeddelandet\n    -X            skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ\n    -ea[:<paketnamn>...|:<klassnamn>]\n    -enableassertions[:<paketnamn>...|:<klassnamn>]\n                  aktivera verifieringar med den angivna detaljgraden\n    -da[:<paketnamn>...|:<klassnamn>]\n    -disableassertions[:<paketnamn>...|:<klassnamn>]\n                  avaktivera verifieringar med den angivna detaljgraden\n    -esa | -enablesystemassertions\n                  aktivera systemverifieringar\n    -dsa | -disablesystemassertions\n                  avaktivera systemverifieringar\n    -agentlib:<biblioteksnamn>[=<alternativ>]\n                  ladda det ursprungliga agentbiblioteket <biblioteksnamn>, exempel: -agentlib:jdwp\n                  se \u00E4ven -agentlib:jdwp=help\n    -agentpath:<s\u00F6kv\u00E4gsnamn>[=<alternativ>]\n                  ladda det ursprungliga agentbiblioteket med fullst\u00E4ndigt s\u00F6kv\u00E4gsnamn\n    -javaagent:<jar-s\u00F6kv\u00E4g>[=<alternativ>]\n                  ladda agenten f\u00F6r programmeringsspr\u00E5ket Java, se java.lang.instrument\n    -splash:<bilds\u00F6kv\u00E4g>\n                  visa v\u00E4lkomstsk\u00E4rmen med den angivna bilden\n                  HiDPI-skal\u00E4ndrade bilder st\u00F6ds automatiskt och anv\u00E4nds om de \u00E4r\n                  tillg\u00E4ngliga. Filnamnet p\u00E5 den oskal\u00E4ndrade bilden, t.ex.\n                  bild.filtill\u00E4gg, ska alltid \u00F6verf\u00F6ras som argument till\n                  alternativet -splash.\n                  Den l\u00E4mpligaste skal\u00E4ndrade bilden v\u00E4ljs automatiskt.\n                  Mer information finns i dokumentationen f\u00F6r API:t SplashScreen.\n    @<fils\u00F6kv\u00E4g>   l\u00E4s alternativ fr\u00E5n den angivna filen\nOm du vill ange ett argument f\u00F6r \
-ett l\u00E5ngt alternativ kan du anv\u00E4nda --<namn>=<v\u00E4rde>\neller --<namn> <v\u00E4rde>.\n
-See Se http://www.oracle.com/technetwork/java/javase/documentation/index.html f\u00F6r mer information.
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           avaktivera bakgrundskompilering\n    -Xbootclasspath/a:<kataloger och zip-/jar-filer avgr\u00E4nsade med {0}>\n                      l\u00E4gg till sist i klass\u00F6kv\u00E4gen f\u00F6r programladdning\n    -Xcheck:jni       utf\u00F6r fler kontroller f\u00F6r JNI-funktioner\n    -Xcomp            tvingar kompilering av metoder vid det f\u00F6rsta anropet\n    -Xdebug           tillhandah\u00E5lls f\u00F6r bak\u00E5tkompatibilitet\n    -Xdiag            visa fler diagnostiska meddelanden\n    -Xdiag:resolver   visa diagnostiska meddelanden f\u00F6r matchning\n    -Xfuture          aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n    -Xint             endast exekvering i tolkat l\u00E4ge\n    -Xinternalversion\n                      visar mer detaljerad information om JVM-version \u00E4n\n                      alternativet -version\n    -Xloggc:<fil>    logga GC-status till en fil med tidsst\u00E4mplar\n    -Xmixed           exekvering i blandat l\u00E4ge (standard)\n    -Xmn<storlek>     anger ursprunglig och maximal storlek (i byte) f\u00F6r h\u00F6gen f\u00F6r\n                      generationen med nyare objekt (h\u00F6gen f\u00F6r tilldelning av nya objekt)\n    -Xms<storlek>     ange ursprunglig storlek f\u00F6r Java-heap-utrymmet\n    -Xmx<storlek>     ange st\u00F6rsta storlek f\u00F6r Java-heap-utrymmet\n    -Xnoclassgc       avaktivera klasskr\u00E4pinsamling\n    -Xprof            utdata f\u00F6r processorprofilering\n    -Xrs              minska operativsystemssignalanv\u00E4ndning f\u00F6r Java/VM (se dokumentationen)\n    -Xshare:auto      anv\u00E4nd delade klassdata om m\u00F6jligt (standard)\n    -Xshare:off       f\u00F6rs\u00F6k inte anv\u00E4nda delade klassdata\n    -Xshare:on        kr\u00E4v anv\u00E4ndning av delade klassdata, utf\u00F6r inte i annat fall.\n    -XshowSettings    visa alla inst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:all\n                      visa alla inst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:locale\n                      visa alla spr\u00E5kkonventionsrelaterade inst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:properties\n                      visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n    -Xss<storlek>     ange storlek f\u00F6r java-tr\u00E5dsstacken\n    -Xverify          anger l\u00E4ge f\u00F6r bytekodverifieraren\n    --add-reads <modul>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n                      uppdaterar <modul> att l\u00E4sa <m\u00E5lmodul>, oavsett\n                      moduldeklarationen. \n                      <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att l\u00E4sa alla\n                      ej namngivna moduler.\n    --add-exports <modul>/<paket>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n                      uppdaterar <modul> att exportera <paket> till <m\u00E5lmodul>,\n                      oavsett moduldeklarationen.\n                      <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att exportera till alla\n                      ej namngivna moduler.\n    --disable-@files  avaktivera ytterligare argumentfilsut\u00F6kning\n    --patch-module <modul>=<fil>({0}<fil>)*\n                      \u00C5sidos\u00E4tt eller ut\u00F6ka en modul med klasser och resurser\n                      i JAR-filer eller kataloger.\n\nDe h\u00E4r alternativen \u00E4r icke-standardalternativ och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n
+java.launcher.X.usage=\n    -Xbatch           avaktivera bakgrundskompilering\n    -Xbootclasspath/a:<kataloger och zip-/jar-filer avgr\u00E4nsade med {0}>\n                      l\u00E4gg till sist i klass\u00F6kv\u00E4gen f\u00F6r programladdning\n    -Xcheck:jni       utf\u00F6r fler kontroller f\u00F6r JNI-funktioner\n    -Xcomp            tvingar kompilering av metoder vid det f\u00F6rsta anropet\n    -Xdebug           tillhandah\u00E5lls f\u00F6r bak\u00E5tkompatibilitet\n    -Xdiag            visa fler diagnostiska meddelanden\n    -Xdiag:resolver   visa diagnostiska meddelanden f\u00F6r matchning\n    -Xfuture          aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n    -Xint             endast exekvering i tolkat l\u00E4ge\n    -Xinternalversion\n                      visar mer detaljerad information om JVM-version \u00E4n\n                      alternativet -version\n    -Xloggc:<fil>    logga GC-status till en fil med tidsst\u00E4mplar\n    -Xmixed           exekvering i blandat l\u00E4ge (standard)\n    -Xmn<storlek>     anger ursprunglig och maximal storlek (i byte) f\u00F6r h\u00F6gen f\u00F6r\n                      generationen med nyare objekt (h\u00F6gen f\u00F6r tilldelning av nya objekt)\n    -Xms<storlek>     ange ursprunglig storlek f\u00F6r Java-heap-utrymmet\n    -Xmx<storlek>     ange st\u00F6rsta storlek f\u00F6r Java-heap-utrymmet\n    -Xnoclassgc       avaktivera klasskr\u00E4pinsamling\n    -Xprof            utdata f\u00F6r processorprofilering\n    -Xrs              minska operativsystemssignalanv\u00E4ndning f\u00F6r Java/VM (se dokumentationen)\n    -Xshare:auto      anv\u00E4nd delade klassdata om m\u00F6jligt (standard)\n    -Xshare:off       f\u00F6rs\u00F6k inte anv\u00E4nda delade klassdata\n    -Xshare:on        kr\u00E4v anv\u00E4ndning av delade klassdata, utf\u00F6r inte i annat fall.\n    -XshowSettings    visa alla inst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:all\n                      visa alla inst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:locale\n                      visa alla spr\u00E5kkonventionsrelaterade inst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:properties\n                      visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n    -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n    -Xss<storlek>     ange storlek f\u00F6r java-tr\u00E5dsstacken\n    -Xverify          anger l\u00E4ge f\u00F6r bytekodverifieraren\n    --add-reads <modul>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n                      uppdaterar <modul> f\u00F6r att l\u00E4sa <m\u00E5lmodul>, oavsett\n                      moduldeklarationen. \n                      <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att l\u00E4sa alla\n                      ej namngivna moduler.\n    --add-exports <modul>/<paket>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n                      uppdaterar <modul> f\u00F6r att exportera <paket> till <m\u00E5lmodul>,\n                      oavsett moduldeklarationen.\n                      <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att exportera till alla\n                      ej namngivna moduler.\n    --add-opens <modul>/<paket>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n                      uppdaterar <modul> f\u00F6r att \u00F6ppna <paket> till\n                      <m\u00E5lmodul>, oavsett moduldeklarationen.\n    --disable-@files  avaktivera ytterligare argumentfilsut\u00F6kning\n    --patch-module <modul>=<fil>({0}<fil>)*\n                      \u00C5sidos\u00E4tt eller ut\u00F6ka en modul med klasser och resurser\n                      i JAR-filer eller kataloger.\n\nDe h\u00E4r extra alternativen kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\nF\u00F6ljande alternativ \u00E4r Mac OS X-specifika:\n    -XstartOnFirstThread\n                      k\u00F6r main()-metoden p\u00E5 den f\u00F6rsta (AppKit)-tr\u00E5den\n    -Xdock:name=<applikationsnamn>\n                      \u00E5sidos\u00E4tt det standardapplikationsnamn som visas i dockan\n    -Xdock:icon=<s\u00F6kv\u00E4g till ikonfil>\n                      \u00E5sidos\u00E4tt den standardikon som visas i dockan\n\n
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_CN.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_CN.properties
index b2043da..7097537 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_CN.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,23 +24,19 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   \u7528\u6CD5: {0} [options] class [args...]\n           (\u6267\u884C\u7C7B)\n   \u6216  {0} [options] -jar jarfile [args...]\n           (\u6267\u884C jar \u6587\u4EF6)\n   \u6216  {0} [options] -p <\u6A21\u5757\u8DEF\u5F84> -m <\u6A21\u5757\u540D\u79F0>[/<\u6A21\u5757\u7C7B>] [args...]\n           (\u6267\u884C\u6A21\u5757\u4E2D\u7684\u4E3B\u7C7B)\n\u5176\u4E2D\u9009\u9879\u5305\u62EC:\n
+java.launcher.opt.header  =   \u7528\u6CD5: {0} [options] class [args...]\n           (\u6267\u884C\u7C7B)\n   \u6216  {0} [options] -jar jarfile [args...]\n           (\u6267\u884C jar \u6587\u4EF6)\n   \u6216  {0} [options] -p <\u6A21\u5757\u8DEF\u5F84> -m <\u6A21\u5757\u540D\u79F0>[/<\u6A21\u5757\u7C7B>] [args...]\n           (\u6267\u884C\u6A21\u5757\u4E2D\u7684\u4E3B\u7C7B)\n\u5176\u4E2D\u9009\u9879\u5305\u62EC:\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  \u5DF2\u8FC7\u65F6, \u5728\u4EE5\u540E\u7684\u53D1\u884C\u7248\u4E2D\u5C06\u88AB\u5220\u9664\n
 java.launcher.opt.vmselect   =\    {0}\t  \u9009\u62E9 "{1}" VM\n
 java.launcher.opt.hotspot    =\    {0}\t  \u662F "{1}" VM \u7684\u540C\u4E49\u8BCD [\u5DF2\u8FC7\u65F6]\n
 
-java.launcher.ergo.message1  =\                  \u9ED8\u8BA4 VM \u662F {0}
-java.launcher.ergo.message2  =\                  \u56E0\u4E3A\u60A8\u662F\u5728\u670D\u52A1\u5668\u7C7B\u8BA1\u7B97\u673A\u4E0A\u8FD0\u884C\u3002\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =\    -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n    -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n    --class-path <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n                  \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u7684\u76EE\u5F55, JAR \u6863\u6848\n                  \u548C ZIP \u6863\u6848\u7684\u5217\u8868, \u4F7F\u7528 {0} \u5206\u9694\u3002\n    -p <\u6A21\u5757\u8DEF\u5F84>\n    --module-path <\u6A21\u5757\u8DEF\u5F84>...\n                  \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u5217\u8868, \u6BCF\u4E2A\u76EE\u5F55\n                  \u90FD\u662F\u4E00\u4E2A\u5305\u542B\u6A21\u5757\u7684\u76EE\u5F55\u3002\n    --upgrade-module-path <\u6A21\u5757\u8DEF\u5F84>...\n                  \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u5217\u8868, \u6BCF\u4E2A\u76EE\u5F55\n                  \u90FD\u662F\u4E00\u4E2A\u5305\u542B\u6A21\u5757\u7684\u76EE\u5F55, \u8FD9\u4E9B\u6A21\u5757\n                  \u7528\u4E8E\u66FF\u6362\u8FD0\u884C\u65F6\u6620\u50CF\u4E2D\u7684\u53EF\u5347\u7EA7\u6A21\u5757\n    -m <\u6A21\u5757>[/<\u4E3B\u7C7B>]\n    --module <\u6A21\u5757\u540D\u79F0>[/<\u4E3B\u7C7B>]\n                  \u8981\u89E3\u6790\u7684\u521D\u59CB\u6A21\u5757, \u4EE5\u53CA\u5728\u672A\u7531\u6A21\u5757\u6307\u5B9A\u65F6\n                  \u8981\u6267\u884C\u7684\u4E3B\u7C7B\u540D\u79F0\n    --add-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n                  \u9664\u4E86\u521D\u59CB\u6A21\u5757\u4E4B\u5916\u8981\u89E3\u6790\u7684\u6839\u6A21\u5757\u3002\n                  <\u6A21\u5757\u540D\u79F0> \u8FD8\u53EF\u4EE5\u4E3A ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH\u3002\n    --limit-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n                  \u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF\n    --list-modules [<\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]]\n                  \u5217\u51FA\u53EF\u89C2\u5BDF\u6A21\u5757\u5E76\u9000\u51FA\n    --dry-run     \u521B\u5EFA VM \u4F46\u4E0D\u6267\u884C main \u65B9\u6CD5\u3002\n                  \u6B64 --dry-run \u9009\u9879\u5BF9\u4E8E\u9A8C\u8BC1\u8BF8\u5982\n                  \u6A21\u5757\u7CFB\u7EDF\u914D\u7F6E\u8FD9\u6837\u7684\u547D\u4EE4\u884C\u9009\u9879\u53EF\u80FD\u662F\u975E\u5E38\u6709\u7528\u7684\u3002\n    -D<\u540D\u79F0>=<\u503C>\n                  \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n    -verbose:[class|gc|jni]\n                  \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n    -version      \u5C06\u4EA7\u54C1\u7248\u672C\u8F93\u51FA\u5230\u9519\u8BEF\u6D41\u5E76\u9000\u51FA\n    --version     \u5C06\u4EA7\u54C1\u7248\u672C\u8F93\u51FA\u5230\u8F93\u51FA\u6D41\u5E76\u9000\u51FA\n    -showversion  \u5C06\u4EA7\u54C1\u7248\u672C\u8F93\u51FA\u5230\u9519\u8BEF\u6D41\u5E76\u7EE7\u7EED\n    --show-version\n                  \u5C06\u4EA7\u54C1\u7248\u672C\u8F93\u51FA\u5230\u8F93\u51FA\u6D41\u5E76\u7EE7\u7EED\n    -? -h -help\n                  \u5C06\u6B64\u5E2E\u52A9\u6D88\u606F\u8F93\u51FA\u5230\u9519\u8BEF\u6D41\n    --help        \u5C06\u6B64\u5E2E\u52A9\u6D88\u606F\u8F93\u51FA\u5230\u8F93\u51FA\u6D41\n    -X            \u5C06\u989D\u5916\u9009\u9879\u7684\u5E2E\u52A9\u8F93\u51FA\u5230\u9519\u8BEF\u6D41\n    --help-extra  \u5C06\u989D\u5916\u9009\u9879\u7684\u5E2E\u52A9\u8F93\u51FA\u5230\u8F93\u51FA\u6D41\n    -ea[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n    -enableassertions[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n                  \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n    -da[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n    -disableassertions[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n                  \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u7981\u7528\u65AD\u8A00\n    -esa | -enablesystemassertions\n                  \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n    -dsa | \
+-disablesystemassertions\n                  \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n    -agentlib:<\u5E93\u540D>[=<\u9009\u9879>]\n                  \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 <\u5E93\u540D>, \u4F8B\u5982 -agentlib:jdwp\n                  \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help\n    -agentpath:<\u8DEF\u5F84\u540D>[=<\u9009\u9879>]\n                  \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n    -javaagent:<jar \u8DEF\u5F84>[=<\u9009\u9879>]\n                  \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n    -splash:<\u56FE\u50CF\u8DEF\u5F84>\n                  \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n                  \u81EA\u52A8\u652F\u6301\u548C\u4F7F\u7528 HiDPI \u7F29\u653E\u56FE\u50CF\n                  (\u5982\u679C\u53EF\u7528)\u3002\u672A\u7F29\u653E\u7684\u56FE\u50CF\u6587\u4EF6\u540D (\u4F8B\u5982, image.ext)\n                  \u5E94\u59CB\u7EC8\u4F5C\u4E3A\u53C2\u6570\u4F20\u9012\u7ED9 -splash \u9009\u9879\u3002\n                  \u5C06\u81EA\u52A8\u9009\u53D6\u63D0\u4F9B\u7684\u6700\u9002\u5F53\u7684\u7F29\u653E\n                  \u56FE\u50CF\u3002\n                  \u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 SplashScreen API \u6587\u6863\u3002\n    @<\u6587\u4EF6\u8DEF\u5F84>   \u4ECE\u6307\u5B9A\u6587\u4EF6\u4E2D\u8BFB\u53D6\u9009\u9879\n\n\u8981\u4E3A\u957F\u9009\u9879\u6307\u5B9A\u53C2\u6570, \u53EF\u4EE5\u4F7F\u7528 --<\u540D\u79F0>=<\u503C> \u6216\n--<\u540D\u79F0> <\u503C>\u3002\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n    -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n    --class-path <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n                  \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u7684\u76EE\u5F55, JAR \u6863\u6848\n                  \u548C ZIP \u6863\u6848\u7684\u5217\u8868, \u4F7F\u7528 {0} \u5206\u9694\u3002\n    -p <\u6A21\u5757\u8DEF\u5F84>\n    --module-path <\u6A21\u5757\u8DEF\u5F84>...\n                  \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u5217\u8868, \u6BCF\u4E2A\u76EE\u5F55\n                  \u90FD\u662F\u4E00\u4E2A\u5305\u542B\u6A21\u5757\u7684\u76EE\u5F55\u3002\n    --upgrade-module-path <\u6A21\u5757\u8DEF\u5F84>...\n                  \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u5217\u8868, \u6BCF\u4E2A\u76EE\u5F55\n                  \u90FD\u662F\u4E00\u4E2A\u5305\u542B\u6A21\u5757\u7684\u76EE\u5F55, \u8FD9\u4E9B\u6A21\u5757\n                  \u7528\u4E8E\u66FF\u6362\u8FD0\u884C\u65F6\u6620\u50CF\u4E2D\u7684\u53EF\u5347\u7EA7\u6A21\u5757\n    -m <\u6A21\u5757>[/<\u4E3B\u7C7B>]\n    --module <\u6A21\u5757\u540D\u79F0>[/<\u4E3B\u7C7B>]\n                  \u8981\u89E3\u6790\u7684\u521D\u59CB\u6A21\u5757, \u4EE5\u53CA\u5728\u672A\u7531\u6A21\u5757\u6307\u5B9A\u65F6\n                  \u8981\u6267\u884C\u7684\u4E3B\u7C7B\u540D\u79F0\n    --add-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n                  \u9664\u4E86\u521D\u59CB\u6A21\u5757\u4E4B\u5916\u8981\u89E3\u6790\u7684\u6839\u6A21\u5757\u3002\n                  <\u6A21\u5757\u540D\u79F0> \u8FD8\u53EF\u4EE5\u4E3A ALL-DEFAULT, ALL-SYSTEM,\n                  ALL-MODULE-PATH\u3002\n    --limit-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n                  \u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF\n    --list-modules [<\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]]\n                  \u5217\u51FA\u53EF\u89C2\u5BDF\u6A21\u5757\u5E76\u9000\u51FA\n    --dry-run     \u521B\u5EFA VM \u4F46\u4E0D\u6267\u884C\u4E3B\u65B9\u6CD5\u3002\n                  \u6B64 --dry-run \u9009\u9879\u5BF9\u4E8E\u9A8C\u8BC1\u8BF8\u5982\n                  \u6A21\u5757\u7CFB\u7EDF\u914D\u7F6E\u8FD9\u6837\u7684\u547D\u4EE4\u884C\u9009\u9879\u53EF\u80FD\u662F\u975E\u5E38\u6709\u7528\u7684\u3002\n    -D<\u540D\u79F0>=<\u503C>\n                  \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n    -verbose:[class|gc|jni]\n                  \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n    -version      \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n    -showversion  \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n    -? -help --help\n                  \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n    -X            \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n    -ea[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n    -enableassertions[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n                  \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n    -da[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n    -disableassertions[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n                  \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u7981\u7528\u65AD\u8A00\n    -esa | -enablesystemassertions\n                  \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n    -dsa | -disablesystemassertions\n                  \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n    -agentlib:<\u5E93\u540D>[=<\u9009\u9879>]\n                  \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 <\u5E93\u540D>, \u4F8B\u5982 -agentlib:jdwp\n                  \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help\n    -agentpath:<\u8DEF\u5F84\u540D>[=<\u9009\u9879>]\n                  \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n    -javaagent:<jar \u8DEF\u5F84>[=<\u9009\u9879>]\n                  \u52A0\u8F7D \
-Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n    -splash:<\u56FE\u50CF\u8DEF\u5F84>\n                  \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n                  \u81EA\u52A8\u652F\u6301\u548C\u4F7F\u7528 HiDPI \u7F29\u653E\u56FE\u50CF\n                  (\u5982\u679C\u53EF\u7528)\u3002\u672A\u7F29\u653E\u7684\u56FE\u50CF\u6587\u4EF6\u540D (\u4F8B\u5982, image.ext)\n                  \u5E94\u59CB\u7EC8\u4F5C\u4E3A\u53C2\u6570\u4F20\u9012\u7ED9 -splash \u9009\u9879\u3002\n                  \u5C06\u81EA\u52A8\u9009\u53D6\u63D0\u4F9B\u7684\u6700\u9002\u5F53\u7684\u7F29\u653E\n                  \u56FE\u50CF\u3002\n                  \u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 SplashScreen API \u6587\u6863\u3002\n    @<\u6587\u4EF6\u8DEF\u5F84>   \u4ECE\u6307\u5B9A\u6587\u4EF6\u4E2D\u8BFB\u53D6\u9009\u9879\n\u8981\u4E3A\u957F\u9009\u9879\u6307\u5B9A\u53C2\u6570, \u53EF\u4EE5\u4F7F\u7528 --<\u540D\u79F0>=<\u503C> \u6216\n--<\u540D\u79F0> <\u503C>\u3002\n
-See \u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n    -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n                      \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n    -Xcheck:jni       \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n    -Xcomp            \u5728\u9996\u6B21\u8C03\u7528\u65F6\u5F3A\u5236\u7F16\u8BD1\u65B9\u6CD5\n    -Xdebug           \u4E3A\u5B9E\u73B0\u5411\u540E\u517C\u5BB9\u800C\u63D0\u4F9B\n    -Xdiag            \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n    -Xdiag:resolver   \u663E\u793A\u89E3\u6790\u5668\u8BCA\u65AD\u6D88\u606F\n    -Xfuture          \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n    -Xint             \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n    -Xinternalversion\n                      \u663E\u793A\u6BD4 -version \u9009\u9879\u66F4\u8BE6\u7EC6\u7684 JVM\n                      \u7248\u672C\u4FE1\u606F\n    -Xloggc:<\u6587\u4EF6>    \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n    -Xmixed           \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4\u503C)\n    -Xmn<\u5927\u5C0F>        \u4E3A\u5E74\u8F7B\u4EE3 (\u65B0\u751F\u4EE3) \u8BBE\u7F6E\u521D\u59CB\u548C\u6700\u5927\u5806\u5927\u5C0F\n                      (\u4EE5\u5B57\u8282\u4E3A\u5355\u4F4D)\n    -Xms<\u5927\u5C0F>        \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n    -Xmx<\u5927\u5C0F>        \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n    -Xnoclassgc       \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n    -Xprof            \u8F93\u51FA cpu \u914D\u7F6E\u6587\u4EF6\u6570\u636E\n    -Xrs              \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n    -Xshare:auto      \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4\u503C)\n    -Xshare:off       \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n    -Xshare:on        \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n    -XshowSettings    \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:all\n                      \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:locale\n                      \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EEDe\n    -XshowSettings:properties\n                      \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -Xss<\u5927\u5C0F>        \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n    -Xverify          \u8BBE\u7F6E\u5B57\u8282\u7801\u9A8C\u8BC1\u5668\u7684\u6A21\u5F0F\n    --add-reads <\u6A21\u5757>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n                      \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u8BFB\u53D6 <\u76EE\u6807\u6A21\u5757>,\n                      \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n                      <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u8BFB\u53D6\u6240\u6709\u672A\u547D\u540D\n                      \u6A21\u5757\u3002\n    --add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n                      \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u5C06 <\u7A0B\u5E8F\u5305> \u5BFC\u51FA\u5230 <\u76EE\u6807\u6A21\u5757>,\n                      \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n                      <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u5BFC\u51FA\u6240\u6709\n                      \u672A\u547D\u540D\u6A21\u5757\u3002\n    --disable-@files  \u7981\u6B62\u8FDB\u4E00\u6B65\u6269\u5C55\u53C2\u6570\u6587\u4EF6\n    --patch-module \
-<\u6A21\u5757>=<\u6587\u4EF6>({0}<\u6587\u4EF6>)*\n                      \u4F7F\u7528 JAR \u6587\u4EF6\u6216\u76EE\u5F55\u4E2D\u7684\u7C7B\u548C\u8D44\u6E90\n                      \u8986\u76D6\u6216\u589E\u5F3A\u6A21\u5757\u3002\n\n\u8FD9\u4E9B\u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
+java.launcher.X.usage=\n    -Xbatch           \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n    -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n                      \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n    -Xcheck:jni       \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n    -Xcomp            \u5728\u9996\u6B21\u8C03\u7528\u65F6\u5F3A\u5236\u7F16\u8BD1\u65B9\u6CD5\n    -Xdebug           \u4E3A\u5B9E\u73B0\u5411\u540E\u517C\u5BB9\u800C\u63D0\u4F9B\n    -Xdiag            \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n    -Xdiag:resolver   \u663E\u793A\u89E3\u6790\u5668\u8BCA\u65AD\u6D88\u606F\n    -Xfuture          \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n    -Xint             \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n    -Xinternalversion\n                      \u663E\u793A\u6BD4 -version \u9009\u9879\u66F4\u8BE6\u7EC6\u7684 JVM\n                      \u7248\u672C\u4FE1\u606F\n    -Xloggc:<\u6587\u4EF6>    \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n    -Xmixed           \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4\u503C)\n    -Xmn<\u5927\u5C0F>        \u4E3A\u5E74\u8F7B\u4EE3 (\u65B0\u751F\u4EE3) \u8BBE\u7F6E\u521D\u59CB\u548C\u6700\u5927\u5806\u5927\u5C0F\n                      (\u4EE5\u5B57\u8282\u4E3A\u5355\u4F4D)\n    -Xms<\u5927\u5C0F>        \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n    -Xmx<\u5927\u5C0F>        \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n    -Xnoclassgc       \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n    -Xprof            \u8F93\u51FA cpu \u5206\u6790\u6570\u636E\n    -Xrs              \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n    -Xshare:auto      \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4\u503C)\n    -Xshare:off       \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n    -Xshare:on        \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n    -XshowSettings    \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:all\n                      \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:locale\n                      \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EEDe\n    -XshowSettings:properties\n                      \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n    -Xss<\u5927\u5C0F>        \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n    -Xverify          \u8BBE\u7F6E\u5B57\u8282\u7801\u9A8C\u8BC1\u5668\u7684\u6A21\u5F0F\n    --add-reads <\u6A21\u5757>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n                      \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u8BFB\u53D6 <\u76EE\u6807\u6A21\u5757>,\n                      \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n                      <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u8BFB\u53D6\u6240\u6709\u672A\u547D\u540D\n                      \u6A21\u5757\u3002\n    --add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n                      \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u5C06 <\u7A0B\u5E8F\u5305> \u5BFC\u51FA\u5230 <\u76EE\u6807\u6A21\u5757>,\n                      \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n                      <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u5BFC\u51FA\u6240\u6709\n                      \u672A\u547D\u540D\u6A21\u5757\u3002\n    --add-opens \
+<\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n                      \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u5728 <\u76EE\u6807\u6A21\u5757> \u4E2D\n                      \u6253\u5F00 <\u7A0B\u5E8F\u5305>, \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n    --disable-@files  \u7981\u6B62\u8FDB\u4E00\u6B65\u6269\u5C55\u53C2\u6570\u6587\u4EF6\n    --patch-module <\u6A21\u5757>=<\u6587\u4EF6>({0}<\u6587\u4EF6>)*\n                      \u4F7F\u7528 JAR \u6587\u4EF6\u6216\u76EE\u5F55\u4E2D\u7684\u7C7B\u548C\u8D44\u6E90\n                      \u8986\u76D6\u6216\u589E\u5F3A\u6A21\u5757\u3002\n\n\u8FD9\u4E9B\u989D\u5916\u9009\u9879\u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\n\u4EE5\u4E0B\u9009\u9879\u4E3A Mac OS X \u7279\u5B9A\u7684\u9009\u9879:\n    -XstartOnFirstThread\n                      \u5728\u7B2C\u4E00\u4E2A (AppKit) \u7EBF\u7A0B\u4E0A\u8FD0\u884C main() \u65B9\u6CD5\n    -Xdock:name=<\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0>\n                      \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\n    -Xdock:icon=<\u56FE\u6807\u6587\u4EF6\u7684\u8DEF\u5F84>\n                      \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u56FE\u6807\n\n
diff --git a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_TW.properties b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_TW.properties
index 38815af..af484c7 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_TW.properties
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher_zh_TW.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,23 +24,19 @@
 #
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.header  =   \u7528\u6CD5: {0} [options] class [args...]\n           (\u7528\u65BC\u57F7\u884C\u985E\u5225)\n   \u6216  {0} [options] -jar jarfile [args...]\n           (\u7528\u65BC\u57F7\u884C jar \u6A94\u6848)\n   \u6216  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (\u7528\u65BC\u57F7\u884C\u6A21\u7D44\u4E2D\u7684\u4E3B\u8981\u985E\u5225)\n\u5176\u4E2D\u7684\u9078\u9805\u5305\u62EC:\n
+java.launcher.opt.header  =   \u7528\u6CD5: {0} [options] class [args...]\n           (\u7528\u65BC\u57F7\u884C\u985E\u5225)\n   \u6216  {0} [options] -jar jarfile [args...]\n           (\u7528\u65BC\u57F7\u884C jar \u6A94\u6848)\n   \u6216  {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n           (\u7528\u65BC\u57F7\u884C\u6A21\u7D44\u4E2D\u7684\u4E3B\u8981\u985E\u5225)\n\u5176\u4E2D\u7684\u9078\u9805\u5305\u62EC:\n\n
 
 java.launcher.opt.datamodel  =\    -d{0}\t  \u5DF2\u4E0D\u518D\u4F7F\u7528\uFF0C\u5C07\u65BC\u672A\u4F86\u7248\u672C\u4E2D\u79FB\u9664\n
 java.launcher.opt.vmselect   =\    {0}\t  \u9078\u53D6 "{1}" VM\n
 java.launcher.opt.hotspot    =\    {0}\t  \u662F "{1}" VM \u7684\u540C\u7FA9\u5B57  [\u5DF2\u4E0D\u518D\u4F7F\u7528]\n
 
-java.launcher.ergo.message1  =\                  \u9810\u8A2D\u7684 VM \u70BA {0}
-java.launcher.ergo.message2  =\                  \u56E0\u70BA\u60A8\u6B63\u5728\u4F3A\u670D\u5668\u985E\u5225\u6A5F\u5668\u4E0A\u57F7\u884C\u3002\n
+# Translators please note do not translate the options themselves
+java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n    -classpath <class search path of directories and zip/jar files>\n    --class-path <class search path of directories and zip/jar files>\n                  \u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA\n                  ZIP \u5B58\u6A94\u6E05\u55AE\uFF0C\u5C07\u5728\u5176\u4E2D\u641C\u5C0B\u985E\u5225\u6A94\u6848\u3002\n    -p <module path>\n    --module-path <module path>...\n                  \u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u6E05\u55AE\uFF0C\u6BCF\u500B\u76EE\u9304\n                  \u90FD\u662F\u4E00\u500B\u6A21\u7D44\u76EE\u9304\u3002\n    --upgrade-module-path <module path>...\n                  \u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u6E05\u55AE\uFF0C\u6BCF\u500B\u76EE\u9304\n                  \u90FD\u662F\u4E00\u500B\u6A21\u7D44\u76EE\u9304\uFF0C \u7576\u4E2D\u7684\u6A21\u7D44\u53EF\u53D6\u4EE3\n                  \u7A0B\u5F0F\u5BE6\u969B\u57F7\u884C\u5F71\u50CF\u4E2D\u7684\u53EF\u5347\u7D1A\u6A21\u7D44\n    -m <module>[/<mainclass>]\n    --module <modulename>[/<mainclass>]\n                  \u8981\u89E3\u6790\u7684\u8D77\u59CB\u6A21\u7D44\uFF0C\u4EE5\u53CA\u8981\u57F7\u884C\u4E4B\u4E3B\u8981\u985E\u5225\n                  \u7684\u540D\u7A31 (\u82E5\u6A21\u7D44\u672A\u6307\u5B9A\u7684\u8A71)\n    --add-modules <modulename>[,<modulename>...]\n                  \u9664\u4E86\u8D77\u59CB\u6A21\u7D44\u5916\uFF0C\u8981\u89E3\u6790\u7684\u6839\u6A21\u7D44\u3002\n                  <modulename> \u4E5F\u53EF\u4EE5\u662F ALL-DEFAULT\u3001ALL-SYSTEM\u3001\n                  ALL-MODULE-PATH\u3002\n    --limit-modules <modulename>[,<modulename>...]\n                  \u9650\u5236\u53EF\u76E3\u6E2C\u6A21\u7D44\u7684\u7BC4\u570D\n    --list-modules [<modulename>[,<modulename>...]]\n                  \u5217\u51FA\u53EF\u76E3\u6E2C\u6A21\u7D44\u4E26\u7D50\u675F\n    --dry-run     \u5EFA\u7ACB VM \u4F46\u4E0D\u57F7\u884C\u4E3B\u8981\u65B9\u6CD5\u3002\n                  \u6B64 --dry-run \u9078\u9805\u5C0D\u65BC\u9A57\u8B49\u547D\u4EE4\u884C\u9078\u9805\n                  (\u4F8B\u5982\u6A21\u7D44\u7CFB\u7D71\u7D44\u614B) \u5F88\u6709\u7528\u3002\n    -D<name>=<value>\n                  \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n    -verbose:[class|gc|jni]\n                  \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n    -version      \u5728\u932F\u8AA4\u4E32\u6D41\u5370\u51FA\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n    --version     \u5728\u8F38\u51FA\u4E32\u6D41\u5370\u51FA\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n    -showversion  \u5728\u932F\u8AA4\u4E32\u6D41\u5370\u51FA\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n    --show-version\n                  \u5728\u8F38\u51FA\u4E32\u6D41\u5370\u51FA\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n    -? -h -help\n                  \u5728\u932F\u8AA4\u4E32\u6D41\u5370\u51FA\u6B64\u8AAA\u660E\u8A0A\u606F\n    --help        \u5728\u8F38\u51FA\u4E32\u6D41\u5370\u51FA\u6B64\u8AAA\u660E\u8A0A\u606F\n    -X            \u5728\u932F\u8AA4\u4E32\u6D41\u5370\u51FA\u984D\u5916\u9078\u9805\u7684\u8AAA\u660E\n    --help-extra  \u5728\u8F38\u51FA\u4E32\u6D41\u5370\u51FA\u984D\u5916\u9078\u9805\u7684\u8AAA\u660E\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  \u555F\u7528\u6307\u5B9A\u4E4B\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  \u505C\u7528\u6307\u5B9A\u4E4B\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n    -esa | -enablesystemassertions\n                  \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n    -dsa | -disablesystemassertions\n                  \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n    -agentlib:<libname>[=<options>]\n                  \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB <libname>\uFF0C\u4F8B\u5982 -agentlib:jdwp\n                  \u53E6\u8ACB\u53C3\u95B1 \
+-agentlib:jdwp=help\n    -agentpath:<pathname>[=<options>]\n                  \u4F9D\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n    -javaagent:<jarpath>[=<options>]\n                  \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n    -splash:<imagepath>\n                  \u986F\u793A\u542B\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n                  \u7CFB\u7D71\u6703\u81EA\u52D5\u652F\u63F4\u4E26\u4F7F\u7528 HiDPI \u5DF2\u7E2E\u653E\u5F71\u50CF\n                  (\u5982\u679C\u53EF\u7528\u7684\u8A71)\u3002\u672A\u7E2E\u653E\u5F71\u50CF\u6A94\u6848\u540D\u7A31 (\u4F8B\u5982 image.ext)\n                  \u61C9\u4E00\u5F8B\u4EE5\u5F15\u6578\u7684\u5F62\u5F0F\u50B3\u9001\u5230 -splash \u9078\u9805\u3002\n                  \u7CFB\u7D71\u6703\u81EA\u52D5\u5F9E\u63D0\u4F9B\u7684\u5DF2\u7E2E\u653E\u5F71\u50CF\u4E2D\u9078\u64C7\u6700\u9069\u5408\u7684\n                  \u5DF2\u7E2E\u653E\u5F71\u50CF\u3002\n                  \u8ACB\u53C3\u95B1 SplashScreen API \u6587\u4EF6\uFF0C\u4EE5\u77AD\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002\n    @<filepath>   \u5F9E\u6307\u5B9A\u7684\u6A94\u6848\u8B80\u53D6\u9078\u9805\n\n\u82E5\u8981\u6307\u5B9A\u9577\u9078\u9805\u7684\u5F15\u6578\uFF0C\u53EF\u4EE5\u4F7F\u7528 --<name>=<value> \u6216\n--<name> <value>\u3002\n
 
 # Translators please note do not translate the options themselves
-java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n    -classpath <class search path of directories and zip/jar files>\n    --class-path <class search path of directories and zip/jar files>\n                  \u5C07\u5728\u5176\u4E2D\u641C\u5C0B\u985E\u5225\u6A94\u6848\u4E4B\u4EE5 {0} \u5340\u9694\u7684\n                  \u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA ZIP \u5B58\u6A94\u6E05\u55AE\u3002\n    -p <module path>\n    --module-path <module path>...\n                  \u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u6E05\u55AE\uFF0C\u6BCF\u500B\u76EE\u9304\n                  \u662F\u4E00\u500B\u6A21\u7D44\u76EE\u9304\u3002\n    --upgrade-module-path <module path>...\n                  \u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u6E05\u55AE\uFF0C\u6BCF\u500B\u76EE\u9304\n                  \u90FD\u662F\u4E00\u500B\u6A21\u7D44\u76EE\u9304\uFF0C\u7576\u4E2D\u7684\u6A21\u7D44\u53EF\u53D6\u4EE3\n                  \u7A0B\u5F0F\u5BE6\u969B\u57F7\u884C\u5F71\u50CF\u4E2D\u7684\u53EF\u5347\u7D1A\u6A21\u7D44\n    -m <module>[/<mainclass>]\n    --module <modulename>[/<mainclass>]\n                  \u8981\u89E3\u6790\u7684\u8D77\u59CB\u6A21\u7D44\uFF0C\u4EE5\u53CA\u6A21\u7D44\u672A\u6307\u5B9A\u6642\n                  \u6240\u8981\u57F7\u884C\u4E4B\u4E3B\u8981\u985E\u5225\u7684\u540D\u7A31\n    --add-modules <modulename>[,<modulename>...]\n                  \u9664\u4E86\u8D77\u59CB\u6A21\u7D44\u5916\uFF0C\u8981\u89E3\u6790\u7684\u6839\u6A21\u7D44\u3002\n                  <modulename> \u4E5F\u53EF\u4EE5\u662F ALL-DEFAULT\u3001ALL-SYSTEM\u3001\n                  ALL-MODULE-PATH\u3002\n    --limit-modules <modulename>[,<modulename>...]\n                  \u9650\u5236\u53EF\u76E3\u6E2C\u6A21\u7D44\u7684\u7BC4\u570D\n    --list-modules [<modulename>[,<modulename>...]]\n                  \u5217\u51FA\u53EF\u76E3\u6E2C\u6A21\u7D44\u4E26\u7D50\u675F\n    --dry-run     \u5EFA\u7ACB VM \u4F46\u4E0D\u57F7\u884C\u4E3B\u8981\u65B9\u6CD5\u3002\n                  \u6B64 --dry-run \u9078\u9805\u5C0D\u65BC\u9A57\u8B49\u547D\u4EE4\u884C\u9078\u9805\n                  (\u4F8B\u5982\u6A21\u7D44\u7CFB\u7D71\u7D44\u614B) \u6703\u5F88\u6709\u7528\u3002\n    -D<name>=<value>\n                  \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n    -verbose:[class|gc|jni]\n                  \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n    -version      \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n    -showversion  \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n    -? -help --help\n                  \u5217\u5370\u672C\u8AAA\u660E\u8A0A\u606F\n    -X            \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n    -ea[:<packagename>...|:<classname>]\n    -enableassertions[:<packagename>...|:<classname>]\n                  \u555F\u7528\u6307\u5B9A\u4E4B\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n    -da[:<packagename>...|:<classname>]\n    -disableassertions[:<packagename>...|:<classname>]\n                  \u505C\u7528\u6307\u5B9A\u4E4B\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n    -esa | -enablesystemassertions\n                  \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n    -dsa | -disablesystemassertions\n                  \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n    -agentlib:<libname>[=<options>]\n                  \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB <libname>\uFF0C\u4F8B\u5982 -agentlib:jdwp\n                  \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help\n    -agentpath:<pathname>[=<options>]\n                  \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n    -javaagent:<jarpath>[=<options>]\n                  \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n    -splash:<imagepath>\n                  \u986F\u793A\u542B\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n                  \
-\u7CFB\u7D71\u6703\u81EA\u52D5\u652F\u63F4\u4E26\u4F7F\u7528 HiDPI \u5DF2\u7E2E\u653E\u5F71\u50CF\n                  (\u5982\u679C\u53EF\u7528\u7684\u8A71)\u3002\u672A\u7E2E\u653E\u5F71\u50CF\u6A94\u6848\u540D\u7A31 (\u4F8B\u5982 image.ext)\n                  \u61C9\u4E00\u5F8B\u4EE5\u5F15\u6578\u7684\u5F62\u5F0F\u50B3\u9001\u5230 -splash \u9078\u9805\u3002\n                  \u7CFB\u7D71\u6703\u81EA\u52D5\u5F9E\u63D0\u4F9B\u7684\u5DF2\u7E2E\u653E\u5F71\u50CF\u4E2D\u9078\u64C7\u6700\u9069\u5408\u7684\n                  \u5DF2\u7E2E\u653E\u5F71\u50CF\u3002\n                  \u8ACB\u53C3\u95B1 SplashScreen API \u6587\u4EF6\uFF0C\u4EE5\u53D6\u5F97\u66F4\u591A\u8CC7\u8A0A\u3002\n    @<filepath>   \u5F9E\u6307\u5B9A\u7684\u6A94\u6848\u8B80\u53D6\u9078\u9805\n\u82E5\u8981\u6307\u5B9A\u9577\u9078\u9805\u7684\u5F15\u6578\uFF0C\u53EF\u4EE5\u4F7F\u7528 --<name>=<value> \u6216\n--<name> <value>\u3002\n
-See \u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002
-
-# Translators please note do not translate the options themselves
-java.launcher.X.usage=\    -Xbatch           \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n    -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n                      \u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n    -Xcheck:jni       \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n    -Xcomp            \u5F37\u5236\u7DE8\u8B6F\u7B2C\u4E00\u500B\u547C\u53EB\u7684\u65B9\u6CD5\n    -Xdebug           \u70BA\u56DE\u6EAF\u76F8\u5BB9\u6027\u63D0\u4F9B\n    -Xdiag            \u986F\u793A\u5176\u4ED6\u8A3A\u65B7\u8A0A\u606F\n    -Xdiag:resolver   \u986F\u793A\u89E3\u6790\u5668\u8A3A\u65B7\u8A0A\u606F\n    -Xfuture          \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n    -Xint             \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n    -Xinternalversion\n                      \u986F\u793A\u6BD4\u4F7F\u7528 -version \u9078\u9805\u6642\u66F4\u70BA\u8A73\u7D30\u7684\n                      JVM \u7248\u672C\u8CC7\u8A0A\n    -Xloggc:<file>    \u5C07 GC \u72C0\u614B\u548C\u6642\u6233\u8A18\u9304\u81F3\u6A94\u6848\n    -Xmixed           \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n    -Xmn<size>        \u91DD\u5C0D\u65B0\u751F\u4EE3 (\u990A\u6210\u5340) \u8A2D\u5B9A\u5806\u96C6\u7684\u8D77\u59CB\u5927\u5C0F\u548C\n                      \u5927\u5C0F\u4E0A\u9650 (\u4F4D\u5143\u7D44)\n    -Xms<size>        \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n    -Xmx<size>        \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n    -Xnoclassgc       \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n    -Xprof            \u8F38\u51FA cpu \u5206\u6790\u8CC7\u6599\n    -Xrs              \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n    -Xshare:auto      \u76E1\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n    -Xshare:off       \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n    -Xshare:on        \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n    -XshowSettings    \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:all\n                      \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:locale\n                      \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:properties\n                      \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -Xss<size>        \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n    -Xverify          \u8A2D\u5B9A Bytecode \u9A57\u8B49\u7A0B\u5F0F\u6A21\u5F0F\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C\u66F4\u65B0 <module> \u4EE5\n                      \u8B80\u53D6 <target-module>\u3002\n                      \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u8B80\u53D6\u6240\u6709\u672A\u547D\u540D\u7684\n                      \u6A21\u7D44\u3002\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C\u66F4\u65B0 <module> \u4EE5\u4FBF\u5C07 <package>\n                      \u532F\u51FA\u81F3 <target-module>\u3002\n                      \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u532F\u51FA\u81F3\u6240\u6709\n                      \u672A\u547D\u540D\u7684\u6A21\u7D44\u3002\n    --disable-@files  \u505C\u7528\u9032\u4E00\u6B65\u7684\u5F15\u6578\u6A94\u6848\u64F4\u5145\n    --patch-module <module>=<file>({0}<file>)*\n                      \u8986\u5BEB\u6216\u52A0\u5F37 JAR \u6A94\u6848\u6216\u76EE\u9304\u4E2D\n                      \
-\u542B\u6709\u985E\u5225\u548C\u8CC7\u6E90\u7684\u6A21\u7D44\u3002\n\n\u4E0A\u8FF0\u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
+java.launcher.X.usage=\n    -Xbatch           \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n    -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n                      \u9644\u52A0\u81F3\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n    -Xcheck:jni       \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n    -Xcomp            \u5F37\u5236\u7DE8\u8B6F\u7B2C\u4E00\u500B\u547C\u53EB\u7684\u65B9\u6CD5\n    -Xdebug           \u91DD\u5C0D\u56DE\u6EAF\u76F8\u5BB9\u6027\u63D0\u4F9B\n    -Xdiag            \u986F\u793A\u5176\u4ED6\u8A3A\u65B7\u8A0A\u606F\n    -Xdiag:resolver   \u986F\u793A\u89E3\u6790\u5668\u8A3A\u65B7\u8A0A\u606F\n    -Xfuture          \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n    -Xint             \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n    -Xinternalversion\n                      \u986F\u793A\u6BD4 -version \u9078\u9805\u66F4\u70BA\u8A73\u7D30\u7684\n                      JVM \u7248\u672C\u8CC7\u8A0A\n    -Xloggc:<file>    \u5C07 GC \u72C0\u614B\u8A18\u9304\u81F3\u6A94\u6848\u4E14\u9023\u540C\u6642\u6233\n    -Xmixed           \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n    -Xmn<size>        \u8A2D\u5B9A\u65B0\u751F\u4EE3 (\u990A\u6210\u5340) \u4E4B\u5806\u96C6\u7684\u8D77\u59CB\u5927\u5C0F\u548C\n                      \u5927\u5C0F\u4E0A\u9650 (\u4F4D\u5143\u7D44)\n    -Xms<size>        \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n    -Xmx<size>        \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n    -Xnoclassgc       \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n    -Xprof            \u8F38\u51FA cpu \u5206\u6790\u8CC7\u6599\n    -Xrs              \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n    -Xshare:auto      \u5728\u53EF\u80FD\u7684\u60C5\u6CC1\u4E0B\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n    -Xshare:off       \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n    -Xshare:on        \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u6703\u5931\u6557\u3002\n    -XshowSettings    \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:all\n                      \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:locale\n                      \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:properties\n                      \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n    -Xss<size>        \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n    -Xverify          \u8A2D\u5B9A Bytecode \u9A57\u8B49\u7A0B\u5F0F\u7684\u6A21\u5F0F\n    --add-reads <module>=<target-module>(,<target-module>)*\n                      \u66F4\u65B0 <module> \u4EE5\u8B80\u53D6 <target-module>\uFF0C\u7121\u8AD6\n                      \u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\u3002 \n                      \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u8B80\u53D6\u6240\u6709\u672A\u547D\u540D\u7684\n                      \u6A21\u7D44\u3002\n    --add-exports <module>/<package>=<target-module>(,<target-module>)*\n                      \u66F4\u65B0 <module> \u4EE5\u4FBF\u5C07 <package> \u532F\u51FA\u81F3 <target-module>\uFF0C\n                      \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\u3002\n                      \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u532F\u51FA\u81F3\u6240\u6709\n                      \u672A\u547D\u540D\u7684\u6A21\u7D44\u3002\n    --add-opens <module>/<package>=<target-module>(,<target-module>)*\n                      \u66F4\u65B0 <module> \
+\u4EE5\u4FBF\u5C07 <package> \u958B\u555F\u81F3\n                      <target-module>\uFF0C\u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\u3002\n    --disable-@files  \u505C\u7528\u9032\u4E00\u6B65\u7684\u5F15\u6578\u6A94\u6848\u64F4\u5145\n    --patch-module <module>=<file>({0}<file>)*\n                      \u8986\u5BEB\u6216\u52A0\u5F37\u542B\u6709 JAR \u6A94\u6848\u6216\u76EE\u9304\u4E2D\n                      \u985E\u5225\u548C\u8CC7\u6E90\u7684\u6A21\u7D44\u3002\n\n\u4E0A\u8FF0\u7684\u984D\u5916\u9078\u9805\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
 
 # Translators please note do not translate the options themselves
 java.launcher.X.macosx.usage=\n\u4E0B\u5217\u662F Mac OS X \u7279\u5B9A\u9078\u9805:\n    -XstartOnFirstThread\n                      \u5728\u7B2C\u4E00\u500B (AppKit) \u57F7\u884C\u7DD2\u57F7\u884C main() \u65B9\u6CD5\n    -Xdock:name=<application name>\n                      \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u61C9\u7528\u7A0B\u5F0F\u540D\u7A31\n    -Xdock:icon=<path to icon file>\n                      \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u5716\u793A\n\n
diff --git a/jdk/src/java.base/share/classes/sun/net/www/MeteredStream.java b/jdk/src/java.base/share/classes/sun/net/www/MeteredStream.java
index 29b998a..08ff179 100644
--- a/jdk/src/java.base/share/classes/sun/net/www/MeteredStream.java
+++ b/jdk/src/java.base/share/classes/sun/net/www/MeteredStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -203,6 +203,7 @@
         return super.markSupported();
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             close();
diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/DelegateHttpsURLConnection.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/DelegateHttpsURLConnection.java
index b6ff7b4..2b5e511 100644
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/DelegateHttpsURLConnection.java
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/DelegateHttpsURLConnection.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,6 +77,7 @@
      * Called by layered delegator's finalize() method to handle closing
      * the underlying object.
      */
+    @SuppressWarnings("deprecation")
     protected void dispose() throws Throwable {
         super.finalize();
     }
diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java
index 1b2a584..792af78 100644
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -478,6 +478,7 @@
      * sun.net.www.protocol.http.HttpURLConnection's finalize()
      * would have to be made public.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         delegate.dispose();
     }
diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/jar/JarURLConnection.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/jar/JarURLConnection.java
index fb12cf7..5cb3e99 100644
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/jar/JarURLConnection.java
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/jar/JarURLConnection.java
@@ -82,6 +82,9 @@
 
         jarFileURL = getJarFileURL();
         jarFileURLConnection = jarFileURL.openConnection();
+        // whether, or not, the embedded URL should use the cache will depend
+        // on this instance's cache value
+        jarFileURLConnection.setUseCaches(useCaches);
         entryName = getEntryName();
     }
 
diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java
index 88e6f5b..c744608 100644
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,13 +26,13 @@
 package sun.net.www.protocol.jrt;
 
 import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FilePermission;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.security.AccessController;
 import java.security.Permission;
+import java.security.PrivilegedAction;
 
 import jdk.internal.jimage.ImageLocation;
 import jdk.internal.jimage.ImageReader;
@@ -42,7 +42,6 @@
 import jdk.internal.loader.Resource;
 import sun.net.www.ParseUtil;
 import sun.net.www.URLConnection;
-import sun.security.action.GetPropertyAction;
 
 /**
  * URLConnection implementation that can be used to connect to resources
@@ -51,7 +50,11 @@
 public class JavaRuntimeURLConnection extends URLConnection {
 
     // ImageReader to access resources in jimage
-    private static final ImageReader reader = ImageReaderFactory.getImageReader();
+    private static final ImageReader reader;
+    static {
+        PrivilegedAction<ImageReader> pa = ImageReaderFactory::getImageReader;
+        reader = AccessController.doPrivileged(pa);
+    }
 
     // the module and resource name in the URL
     private final String module;
@@ -60,9 +63,6 @@
     // the Resource when connected
     private volatile Resource resource;
 
-    // the permission to access resources in the runtime image, created lazily
-    private static volatile Permission permission;
-
     JavaRuntimeURLConnection(URL url) throws IOException {
         super(url);
         String path = url.getPath();
@@ -158,14 +158,8 @@
     }
 
     @Override
-    public Permission getPermission() throws IOException {
-        Permission p = permission;
-        if (p == null) {
-            String home = GetPropertyAction.privilegedGetProperty("java.home");
-            p = new FilePermission(home + File.separator + "-", "read");
-            permission = p;
-        }
-        return p;
+    public Permission getPermission() {
+        return new RuntimePermission("accessSystemModules");
     }
 
     /**
diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java b/jdk/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java
index 7f63ec8..c4d5080 100644
--- a/jdk/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1034,6 +1034,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws IOException {
         // fd is null if constructor threw exception
         if (fd != null)
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
index f2eeaaa..8969ef1 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
@@ -32,7 +32,6 @@
 import java.nio.charset.Charset;
 import java.nio.charset.spi.CharsetProvider;
 import java.util.Iterator;
-import java.util.Locale;
 import java.util.Map;
 import sun.security.action.GetPropertyAction;
 
@@ -44,13 +43,13 @@
     _INCLUDE_CACHE_MAP_
 
     // Maps canonical names to class names
-    private Map<String,String> classMap;
+    private final Map<String,String> classMap;
     // Maps alias names to canonical names
-    private Map<String,String> aliasMap;
+    private final Map<String,String> aliasMap;
     // Maps canonical names to cached instances
-    private Map<String,Charset> cache;
+    private final Map<String,Charset> cache;
 
-    private String packagePrefix = "sun.nio.cs";
+    private static final String packagePrefix = "sun.nio.cs";
 
     public StandardCharsets() {
         this.aliasMap = new Aliases();
@@ -102,10 +101,16 @@
         if (cln == null)
             return null;
 
-        if (cln.equals("US_ASCII")) {
-            cs = new US_ASCII();
-            cache.put(csn, cs);
-            return cs;
+        // As all charset class names added to classMap are string literals we
+        // can check identity here as an optimization
+        if (cln == "US_ASCII") {
+            return cache(csn, new US_ASCII());
+        }
+        if (cln == "ISO_8859_1") {
+            return cache(csn, new ISO_8859_1());
+        }
+        if (cln == "UTF_8") {
+            return cache(csn, new UTF_8());
         }
 
         // Instantiate the charset and cache it
@@ -114,9 +119,7 @@
             Object o = Class.forName(packagePrefix + "." + cln,
                                      true,
                                      this.getClass().getClassLoader()).newInstance();
-            cs = (Charset)o;
-            cache.put(csn, cs);
-            return cs;
+            return cache(csn, (Charset)o);
         } catch (ClassNotFoundException |
                  IllegalAccessException |
                  InstantiationException x) {
@@ -124,6 +127,11 @@
         }
     }
 
+    private Charset cache(String csn, Charset cs) {
+        cache.put(csn, cs);
+        return cs;
+    }
+
     public final Charset charsetForName(String charsetName) {
         synchronized (this) {
             return lookup(canonicalize(charsetName));
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/US_ASCII.java b/jdk/src/java.base/share/classes/sun/nio/cs/US_ASCII.java
index 39b7df0..e85ce61 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/US_ASCII.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/US_ASCII.java
@@ -31,7 +31,6 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
-import java.util.Arrays;
 
 public class US_ASCII
     extends Charset
diff --git a/jdk/src/java.base/share/classes/sun/reflect/misc/MethodUtil.java b/jdk/src/java.base/share/classes/sun/reflect/misc/MethodUtil.java
index d3d34da..8cb5ca0 100644
--- a/jdk/src/java.base/share/classes/sun/reflect/misc/MethodUtil.java
+++ b/jdk/src/java.base/share/classes/sun/reflect/misc/MethodUtil.java
@@ -25,7 +25,6 @@
 
 package sun.reflect.misc;
 
-import java.lang.reflect.Module;
 import java.io.EOFException;
 import java.security.AllPermission;
 import java.security.AccessController;
diff --git a/jdk/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java b/jdk/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java
index ed69ba3..6efd90d 100644
--- a/jdk/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
 import java.security.Signature;
 import java.security.SignatureException;
 import java.security.Timestamp;
+import java.security.cert.CertPathValidatorException;
 import java.security.cert.CertificateException;
 import java.security.cert.CertificateFactory;
 import java.security.cert.CertPath;
@@ -48,6 +49,7 @@
 import java.util.Set;
 
 import sun.security.timestamp.TimestampToken;
+import sun.security.util.ConstraintsParameters;
 import sun.security.util.Debug;
 import sun.security.util.DerEncoder;
 import sun.security.util.DerInputStream;
@@ -321,6 +323,8 @@
                 data = content.getContentBytes();
             }
 
+            ConstraintsParameters cparams =
+                    new ConstraintsParameters(timestamp);
             String digestAlgname = getDigestAlgorithmId().getName();
 
             byte[] dataSigned;
@@ -347,11 +351,11 @@
                 if (messageDigest == null) // fail if there is no message digest
                     return null;
 
-                // check that algorithm is not restricted
-                if (!JAR_DISABLED_CHECK.permits(DIGEST_PRIMITIVE_SET,
-                        digestAlgname, null)) {
-                    throw new SignatureException("Digest check failed. " +
-                            "Disabled algorithm used: " + digestAlgname);
+                // check that digest algorithm is not restricted
+                try {
+                    JAR_DISABLED_CHECK.permits(digestAlgname, cparams);
+                } catch (CertPathValidatorException e) {
+                    throw new SignatureException(e.getMessage(), e);
                 }
 
                 MessageDigest md = MessageDigest.getInstance(digestAlgname);
@@ -385,17 +389,18 @@
             String algname = AlgorithmId.makeSigAlg(
                     digestAlgname, encryptionAlgname);
 
-            // check that algorithm is not restricted
-            if (!JAR_DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, algname, null)) {
-                throw new SignatureException("Signature check failed. " +
-                        "Disabled algorithm used: " + algname);
+            // check that jar signature algorithm is not restricted
+            try {
+                JAR_DISABLED_CHECK.permits(algname, cparams);
+            } catch (CertPathValidatorException e) {
+                throw new SignatureException(e.getMessage(), e);
             }
 
             X509Certificate cert = getCertificate(block);
-            PublicKey key = cert.getPublicKey();
             if (cert == null) {
                 return null;
             }
+            PublicKey key = cert.getPublicKey();
 
             // check if the public key is restricted
             if (!JAR_DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, key)) {
diff --git a/jdk/src/java.base/share/classes/sun/security/pkcs10/PKCS10.java b/jdk/src/java.base/share/classes/sun/security/pkcs10/PKCS10.java
index 02ed730..9302580 100644
--- a/jdk/src/java.base/share/classes/sun/security/pkcs10/PKCS10.java
+++ b/jdk/src/java.base/share/classes/sun/security/pkcs10/PKCS10.java
@@ -167,7 +167,8 @@
         // key and signature algorithm we found.
         //
         try {
-            sig = Signature.getInstance(id.getName());
+            sigAlg = id.getName();
+            sig = Signature.getInstance(sigAlg);
             sig.initVerify(subjectPublicKeyInfo);
             sig.update(data);
             if (!sig.verify(sigData))
@@ -218,6 +219,7 @@
         signature.update(certificateRequestInfo, 0,
                 certificateRequestInfo.length);
         sig = signature.sign();
+        sigAlg = signature.getAlgorithm();
 
         /*
          * Build guts of SIGNED macro
@@ -251,6 +253,11 @@
         { return subjectPublicKeyInfo; }
 
     /**
+     * Returns the signature algorithm.
+     */
+    public String getSigAlg() { return sigAlg; }
+
+    /**
      * Returns the additional attributes requested.
      */
     public PKCS10Attributes getAttributes()
@@ -348,6 +355,7 @@
 
     private X500Name            subject;
     private PublicKey           subjectPublicKeyInfo;
+    private String              sigAlg;
     private PKCS10Attributes    attributeSet;
     private byte[]              encoded;        // signed
 }
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/KeyProtector.java b/jdk/src/java.base/share/classes/sun/security/provider/KeyProtector.java
index ef7a1f4..bffa1f5 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/KeyProtector.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/KeyProtector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -147,6 +147,7 @@
      * Ensures that the password bytes of this key protector are
      * set to zero when there are no more references to it.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         if (passwdBytes != null) {
             Arrays.fill(passwdBytes, (byte)0x00);
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java
index 9055959..f7bedb9 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import java.security.AlgorithmConstraints;
 import java.security.CryptoPrimitive;
 import java.security.Timestamp;
+import java.security.cert.CertPathValidator;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
@@ -53,9 +54,10 @@
 import java.security.spec.DSAPublicKeySpec;
 
 import sun.security.util.AnchorCertificates;
-import sun.security.util.CertConstraintParameters;
+import sun.security.util.ConstraintsParameters;
 import sun.security.util.Debug;
 import sun.security.util.DisabledAlgorithmConstraints;
+import sun.security.validator.Validator;
 import sun.security.x509.X509CertImpl;
 import sun.security.x509.X509CRLImpl;
 import sun.security.x509.AlgorithmId;
@@ -79,6 +81,7 @@
     private final Date pkixdate;
     private PublicKey prevPubKey;
     private final Timestamp jarTimestamp;
+    private final String variant;
 
     private static final Set<CryptoPrimitive> SIGNATURE_PRIMITIVE_SET =
         Collections.unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE));
@@ -103,87 +106,56 @@
     private boolean trustedMatch = false;
 
     /**
-     * Create a new {@code AlgorithmChecker} with the algorithm
-     * constraints specified in security property
-     * "jdk.certpath.disabledAlgorithms".
+     * Create a new {@code AlgorithmChecker} with the given algorithm
+     * given {@code TrustAnchor} and {@code String} variant.
      *
      * @param anchor the trust anchor selected to validate the target
      *     certificate
+     * @param variant is the Validator variants of the operation. A null value
+     *                passed will set it to Validator.GENERIC.
      */
-    public AlgorithmChecker(TrustAnchor anchor) {
-        this(anchor, certPathDefaultConstraints, null);
-    }
-
-    /**
-     * Create a new {@code AlgorithmChecker} with the
-     * given {@code TrustAnchor} and {@code AlgorithmConstraints}.
-     *
-     * @param anchor the trust anchor selected to validate the target
-     *     certificate
-     * @param constraints the algorithm constraints (or null)
-     *
-     * @throws IllegalArgumentException if the {@code anchor} is null
-     */
-    public AlgorithmChecker(TrustAnchor anchor,
-            AlgorithmConstraints constraints) {
-        this(anchor, constraints, null);
-    }
-
-    /**
-     * Create a new {@code AlgorithmChecker} with the
-     * given {@code AlgorithmConstraints}.
-     * <p>
-     * Note that this constructor will be used to check a certification
-     * path where the trust anchor is unknown, or a certificate list which may
-     * contain the trust anchor. This constructor is used by SunJSSE.
-     *
-     * @param constraints the algorithm constraints (or null)
-     */
-    public AlgorithmChecker(AlgorithmConstraints constraints) {
-        this.prevPubKey = null;
-        this.trustedPubKey = null;
-        this.constraints = constraints;
-        this.pkixdate = null;
-        this.jarTimestamp = null;
+    public AlgorithmChecker(TrustAnchor anchor, String variant) {
+        this(anchor, certPathDefaultConstraints, null, null, variant);
     }
 
     /**
      * Create a new {@code AlgorithmChecker} with the given
-     * {@code Timestamp}.
-     * <p>
-     * Note that this constructor will be used to check a certification
-     * path for signed JAR files that are timestamped.
+     * {@code AlgorithmConstraints}, {@code Timestamp}, and {@code String}
+     * variant.
      *
+     * Note that this constructor can initialize a variation of situations where
+     * the AlgorithmConstraints, Timestamp, or Variant maybe known.
+     *
+     * @param constraints the algorithm constraints (or null)
      * @param jarTimestamp Timestamp passed for JAR timestamp constraint
      *                     checking. Set to null if not applicable.
+     * @param variant is the Validator variants of the operation. A null value
+     *                passed will set it to Validator.GENERIC.
      */
-    public AlgorithmChecker(Timestamp jarTimestamp) {
-        this.prevPubKey = null;
-        this.trustedPubKey = null;
-        this.constraints = certPathDefaultConstraints;
-        if (jarTimestamp == null) {
-            throw new IllegalArgumentException(
-                    "Timestamp cannot be null");
-        }
-        this.pkixdate = jarTimestamp.getTimestamp();
-        this.jarTimestamp = jarTimestamp;
+    public AlgorithmChecker(AlgorithmConstraints constraints,
+            Timestamp jarTimestamp, String variant) {
+        this(null, constraints, null, jarTimestamp, variant);
     }
 
     /**
      * Create a new {@code AlgorithmChecker} with the
-     * given {@code TrustAnchor} and {@code AlgorithmConstraints}.
+     * given {@code TrustAnchor}, {@code AlgorithmConstraints},
+     * {@code Timestamp}, and {@code String} variant.
      *
      * @param anchor the trust anchor selected to validate the target
      *     certificate
      * @param constraints the algorithm constraints (or null)
-     * @param pkixdate Date the constraints are checked against. The value is
-     *             either the PKIXParameter date or null for the current date.
-     *
-     * @throws IllegalArgumentException if the {@code anchor} is null
+     * @param pkixdate The date specified by the PKIXParameters date.  If the
+     *                 PKIXParameters is null, the current date is used.  This
+     *                 should be null when jar files are being checked.
+     * @param jarTimestamp Timestamp passed for JAR timestamp constraint
+     *                     checking. Set to null if not applicable.
+     * @param variant is the Validator variants of the operation. A null value
+     *                passed will set it to Validator.GENERIC.
      */
     public AlgorithmChecker(TrustAnchor anchor,
-            AlgorithmConstraints constraints,
-            Date pkixdate) {
+            AlgorithmConstraints constraints, Date pkixdate,
+            Timestamp jarTimestamp, String variant) {
 
         if (anchor != null) {
             if (anchor.getTrustedCert() != null) {
@@ -203,25 +175,30 @@
             }
         }
 
-        this.prevPubKey = trustedPubKey;
-        this.constraints = constraints;
-        this.pkixdate = pkixdate;
-        this.jarTimestamp = null;
+        this.prevPubKey = this.trustedPubKey;
+        this.constraints = (constraints == null ? certPathDefaultConstraints :
+                constraints);
+        // If we are checking jar files, set pkixdate the same as the timestamp
+        // for certificate checking
+        this.pkixdate = (jarTimestamp != null ? jarTimestamp.getTimestamp() :
+                pkixdate);
+        this.jarTimestamp = jarTimestamp;
+        this.variant = (variant == null ? Validator.VAR_GENERIC : variant);
     }
 
     /**
-     * Create a new {@code AlgorithmChecker} with the
-     * given {@code TrustAnchor} and {@code PKIXParameter} date.
+     * Create a new {@code AlgorithmChecker} with the given {@code TrustAnchor},
+     * {@code PKIXParameter} date, and {@code varient}
      *
      * @param anchor the trust anchor selected to validate the target
      *     certificate
      * @param pkixdate Date the constraints are checked against. The value is
-     *             either the PKIXParameter date or null for the current date.
-     *
-     * @throws IllegalArgumentException if the {@code anchor} is null
+     *             either the PKIXParameters date or null for the current date.
+     * @param variant is the Validator variants of the operation. A null value
+     *                passed will set it to Validator.GENERIC.
      */
-    public AlgorithmChecker(TrustAnchor anchor, Date pkixdate) {
-        this(anchor, certPathDefaultConstraints, pkixdate);
+    public AlgorithmChecker(TrustAnchor anchor, Date pkixdate, String variant) {
+        this(anchor, certPathDefaultConstraints, pkixdate, null, variant);
     }
 
     // Check this 'cert' for restrictions in the AnchorCertificates
@@ -237,10 +214,6 @@
         return AnchorCertificates.contains(cert);
     }
 
-    Timestamp getJarTimestamp() {
-        return jarTimestamp;
-    }
-
     @Override
     public void init(boolean forward) throws CertPathValidatorException {
         //  Note that this class does not support forward mode.
@@ -286,6 +259,28 @@
                 null, null, -1, PKIXReason.INVALID_KEY_USAGE);
         }
 
+        X509CertImpl x509Cert;
+        AlgorithmId algorithmId;
+        try {
+            x509Cert = X509CertImpl.toImpl((X509Certificate)cert);
+            algorithmId = (AlgorithmId)x509Cert.get(X509CertImpl.SIG_ALG);
+        } catch (CertificateException ce) {
+            throw new CertPathValidatorException(ce);
+        }
+
+        AlgorithmParameters currSigAlgParams = algorithmId.getParameters();
+        PublicKey currPubKey = cert.getPublicKey();
+        String currSigAlg = ((X509Certificate)cert).getSigAlgName();
+
+        // Check the signature algorithm and parameters against constraints.
+        if (!constraints.permits(SIGNATURE_PRIMITIVE_SET, currSigAlg,
+                currSigAlgParams)) {
+            throw new CertPathValidatorException(
+                    "Algorithm constraints check failed on signature " +
+                            "algorithm: " + currSigAlg, null, null, -1,
+                    BasicReason.ALGORITHM_CONSTRAINED);
+        }
+
         // Assume all key usage bits are set if key usage is not present
         Set<CryptoPrimitive> primitives = KU_PRIMITIVE_SET;
 
@@ -322,101 +317,74 @@
             }
         }
 
-        PublicKey currPubKey = cert.getPublicKey();
+        ConstraintsParameters cp =
+                new ConstraintsParameters((X509Certificate)cert,
+                        trustedMatch, pkixdate, jarTimestamp, variant);
 
+        // Check against local constraints if it is DisabledAlgorithmConstraints
         if (constraints instanceof DisabledAlgorithmConstraints) {
-            // Check against DisabledAlgorithmConstraints certpath constraints.
-            // permits() will throw exception on failure.
-            ((DisabledAlgorithmConstraints)constraints).permits(primitives,
-                new CertConstraintParameters((X509Certificate)cert,
-                        trustedMatch, pkixdate, jarTimestamp));
-            // If there is no previous key, set one and exit
-            if (prevPubKey == null) {
-                prevPubKey = currPubKey;
-                return;
-            }
-        }
+            ((DisabledAlgorithmConstraints)constraints).permits(currSigAlg, cp);
+            // DisabledAlgorithmsConstraints does not check primitives, so key
+            // additional key check.
 
-        X509CertImpl x509Cert;
-        AlgorithmId algorithmId;
-        try {
-            x509Cert = X509CertImpl.toImpl((X509Certificate)cert);
-            algorithmId = (AlgorithmId)x509Cert.get(X509CertImpl.SIG_ALG);
-        } catch (CertificateException ce) {
-            throw new CertPathValidatorException(ce);
-        }
-
-        AlgorithmParameters currSigAlgParams = algorithmId.getParameters();
-        String currSigAlg = x509Cert.getSigAlgName();
-
-        // If 'constraints' is not of DisabledAlgorithmConstraints, check all
-        // everything individually
-        if (!(constraints instanceof DisabledAlgorithmConstraints)) {
-            // Check the current signature algorithm
-            if (!constraints.permits(
-                    SIGNATURE_PRIMITIVE_SET,
-                    currSigAlg, currSigAlgParams)) {
-                throw new CertPathValidatorException(
-                        "Algorithm constraints check failed on signature " +
-                                "algorithm: " + currSigAlg, null, null, -1,
-                        BasicReason.ALGORITHM_CONSTRAINED);
-            }
-
+        } else {
+            // Perform the default constraints checking anyway.
+            certPathDefaultConstraints.permits(currSigAlg, cp);
+            // Call locally set constraints to check key with primitives.
             if (!constraints.permits(primitives, currPubKey)) {
                 throw new CertPathValidatorException(
-                        "Algorithm constraints check failed on keysize: " +
-                                sun.security.util.KeyUtil.getKeySize(currPubKey),
+                        "Algorithm constraints check failed on key " +
+                                currPubKey.getAlgorithm() + " with size of " +
+                                sun.security.util.KeyUtil.getKeySize(currPubKey) +
+                                "bits",
                         null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
             }
         }
 
+        // If there is no previous key, set one and exit
+        if (prevPubKey == null) {
+            prevPubKey = currPubKey;
+            return;
+        }
+
         // Check with previous cert for signature algorithm and public key
-        if (prevPubKey != null) {
-            if (!constraints.permits(
-                    SIGNATURE_PRIMITIVE_SET,
-                    currSigAlg, prevPubKey, currSigAlgParams)) {
-                throw new CertPathValidatorException(
+        if (!constraints.permits(
+                SIGNATURE_PRIMITIVE_SET,
+                currSigAlg, prevPubKey, currSigAlgParams)) {
+            throw new CertPathValidatorException(
                     "Algorithm constraints check failed on " +
                             "signature algorithm: " + currSigAlg,
                     null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
+        }
+
+        // Inherit key parameters from previous key
+        if (PKIX.isDSAPublicKeyWithoutParams(currPubKey)) {
+            // Inherit DSA parameters from previous key
+            if (!(prevPubKey instanceof DSAPublicKey)) {
+                throw new CertPathValidatorException("Input key is not " +
+                        "of a appropriate type for inheriting parameters");
             }
 
-            // Inherit key parameters from previous key
-            if (PKIX.isDSAPublicKeyWithoutParams(currPubKey)) {
-                // Inherit DSA parameters from previous key
-                if (!(prevPubKey instanceof DSAPublicKey)) {
-                    throw new CertPathValidatorException("Input key is not " +
-                        "of a appropriate type for inheriting parameters");
-                }
-
-                DSAParams params = ((DSAPublicKey)prevPubKey).getParams();
-                if (params == null) {
-                    throw new CertPathValidatorException(
+            DSAParams params = ((DSAPublicKey)prevPubKey).getParams();
+            if (params == null) {
+                throw new CertPathValidatorException(
                         "Key parameters missing from public key.");
-                }
+            }
 
-                try {
-                    BigInteger y = ((DSAPublicKey)currPubKey).getY();
-                    KeyFactory kf = KeyFactory.getInstance("DSA");
-                    DSAPublicKeySpec ks = new DSAPublicKeySpec(y,
-                                                       params.getP(),
-                                                       params.getQ(),
-                                                       params.getG());
-                    currPubKey = kf.generatePublic(ks);
-                } catch (GeneralSecurityException e) {
-                    throw new CertPathValidatorException("Unable to generate " +
+            try {
+                BigInteger y = ((DSAPublicKey)currPubKey).getY();
+                KeyFactory kf = KeyFactory.getInstance("DSA");
+                DSAPublicKeySpec ks = new DSAPublicKeySpec(y, params.getP(),
+                        params.getQ(), params.getG());
+                currPubKey = kf.generatePublic(ks);
+            } catch (GeneralSecurityException e) {
+                throw new CertPathValidatorException("Unable to generate " +
                         "key with inherited parameters: " + e.getMessage(), e);
-                }
             }
         }
 
         // reset the previous public key
         prevPubKey = currPubKey;
-
-        // check the extended key usage, ignore the check now
-        // List<String> extendedKeyUsages = x509Cert.getExtendedKeyUsage();
-
-        // DO NOT remove any unresolved critical extensions
     }
 
     /**
@@ -456,8 +424,10 @@
      *
      * @param key the public key to verify the CRL signature
      * @param crl the target CRL
+     * @param variant is the Validator variants of the operation. A null value
+     *                passed will set it to Validator.GENERIC.
      */
-    static void check(PublicKey key, X509CRL crl)
+    static void check(PublicKey key, X509CRL crl, String variant)
                         throws CertPathValidatorException {
 
         X509CRLImpl x509CRLImpl = null;
@@ -468,7 +438,7 @@
         }
 
         AlgorithmId algorithmId = x509CRLImpl.getSigAlgId();
-        check(key, algorithmId);
+        check(key, algorithmId, variant);
     }
 
     /**
@@ -476,20 +446,16 @@
      *
      * @param key the public key to verify the CRL signature
      * @param algorithmId signature algorithm Algorithm ID
+     * @param variant is the Validator variants of the operation. A null value
+     *                passed will set it to Validator.GENERIC.
      */
-    static void check(PublicKey key, AlgorithmId algorithmId)
+    static void check(PublicKey key, AlgorithmId algorithmId, String variant)
                         throws CertPathValidatorException {
         String sigAlgName = algorithmId.getName();
         AlgorithmParameters sigAlgParams = algorithmId.getParameters();
 
-        if (!certPathDefaultConstraints.permits(
-                SIGNATURE_PRIMITIVE_SET, sigAlgName, key, sigAlgParams)) {
-            throw new CertPathValidatorException(
-                "Algorithm constraints check failed on signature algorithm: " +
-                sigAlgName + " is disabled",
-                null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
-        }
+        certPathDefaultConstraints.permits(new ConstraintsParameters(
+                sigAlgName, sigAlgParams, key, variant));
     }
-
 }
 
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java
index 49a0368..43ff7b7 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java
@@ -51,7 +51,7 @@
 
 /**
  * BasicChecker is a PKIXCertPathChecker that checks the basic information
- * on a PKIX certificate, namely the signature, timestamp, and subject/issuer
+ * on a PKIX certificate, namely the signature, validity, and subject/issuer
  * name chaining.
  *
  * @since       1.4
@@ -125,7 +125,7 @@
     }
 
     /**
-     * Performs the signature, timestamp, and subject/issuer name chaining
+     * Performs the signature, validity, and subject/issuer name chaining
      * checks on the certificate using its internal state. This method does
      * not remove any critical extensions from the Collection.
      *
@@ -141,7 +141,7 @@
         X509Certificate currCert = (X509Certificate)cert;
 
         if (!sigOnly) {
-            verifyTimestamp(currCert);
+            verifyValidity(currCert);
             verifyNameChaining(currCert);
         }
         verifySignature(currCert);
@@ -177,12 +177,12 @@
     }
 
     /**
-     * Internal method to verify the timestamp on a certificate
+     * Internal method to verify the validity on a certificate
      */
-    private void verifyTimestamp(X509Certificate cert)
+    private void verifyValidity(X509Certificate cert)
         throws CertPathValidatorException
     {
-        String msg = "timestamp";
+        String msg = "validity";
         if (debug != null)
             debug.println("---checking " + msg + ":" + date.toString() + "...");
 
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
index 95ef350..0f16c64 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 import java.util.*;
 
 import sun.security.util.Debug;
+import sun.security.validator.Validator;
 import static sun.security.x509.PKIXExtensions.*;
 import sun.security.x509.*;
 
@@ -66,6 +67,20 @@
      * an X509CRLSelector with certificateChecking set.
      */
     public static Collection<X509CRL> getCRLs(X509CRLSelector selector,
+            boolean signFlag, PublicKey prevKey, String provider,
+            List<CertStore> certStores, boolean[] reasonsMask,
+            Set<TrustAnchor> trustAnchors, Date validity, String variant)
+            throws CertStoreException
+    {
+        return getCRLs(selector, signFlag, prevKey, null, provider, certStores,
+                reasonsMask, trustAnchors, validity, variant);
+    }
+    /**
+     * Return the X509CRLs matching this selector. The selector must be
+     * an X509CRLSelector with certificateChecking set.
+     */
+    // Called by com.sun.deploy.security.RevocationChecker
+    public static Collection<X509CRL> getCRLs(X509CRLSelector selector,
                                               boolean signFlag,
                                               PublicKey prevKey,
                                               String provider,
@@ -76,7 +91,7 @@
         throws CertStoreException
     {
         return getCRLs(selector, signFlag, prevKey, null, provider, certStores,
-                       reasonsMask, trustAnchors, validity);
+                reasonsMask, trustAnchors, validity, Validator.VAR_GENERIC);
     }
 
     /**
@@ -91,7 +106,8 @@
                                               List<CertStore> certStores,
                                               boolean[] reasonsMask,
                                               Set<TrustAnchor> trustAnchors,
-                                              Date validity)
+                                              Date validity,
+                                              String variant)
         throws CertStoreException
     {
         X509Certificate cert = selector.getCertificateChecking();
@@ -120,7 +136,7 @@
                 DistributionPoint point = t.next();
                 Collection<X509CRL> crls = getCRLs(selector, certImpl,
                     point, reasonsMask, signFlag, prevKey, prevCert, provider,
-                    certStores, trustAnchors, validity);
+                    certStores, trustAnchors, validity, variant);
                 results.addAll(crls);
             }
             if (debug != null) {
@@ -145,7 +161,7 @@
         X509CertImpl certImpl, DistributionPoint point, boolean[] reasonsMask,
         boolean signFlag, PublicKey prevKey, X509Certificate prevCert,
         String provider, List<CertStore> certStores,
-        Set<TrustAnchor> trustAnchors, Date validity)
+        Set<TrustAnchor> trustAnchors, Date validity, String variant)
             throws CertStoreException {
 
         // check for full name
@@ -208,7 +224,7 @@
                 selector.setIssuerNames(null);
                 if (selector.match(crl) && verifyCRL(certImpl, point, crl,
                         reasonsMask, signFlag, prevKey, prevCert, provider,
-                        trustAnchors, certStores, validity)) {
+                        trustAnchors, certStores, validity, variant)) {
                     crls.add(crl);
                 }
             } catch (IOException | CRLException e) {
@@ -316,7 +332,7 @@
         X509CRL crl, boolean[] reasonsMask, boolean signFlag,
         PublicKey prevKey, X509Certificate prevCert, String provider,
         Set<TrustAnchor> trustAnchors, List<CertStore> certStores,
-        Date validity) throws CRLException, IOException {
+        Date validity, String variant) throws CRLException, IOException {
 
         if (debug != null) {
             debug.println("DistributionPointFetcher.verifyCRL: " +
@@ -663,7 +679,7 @@
 
         // check the crl signature algorithm
         try {
-            AlgorithmChecker.check(prevKey, crl);
+            AlgorithmChecker.check(prevKey, crl, variant);
         } catch (CertPathValidatorException cpve) {
             if (debug != null) {
                 debug.println("CRL signature algorithm check failed: " + cpve);
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSP.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSP.java
index 8753072..dce7302 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSP.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSP.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
 
 import sun.security.action.GetIntegerAction;
 import sun.security.util.Debug;
+import sun.security.validator.Validator;
 import sun.security.x509.AccessDescription;
 import sun.security.x509.AuthorityInfoAccessExtension;
 import sun.security.x509.GeneralName;
@@ -94,42 +95,6 @@
 
     private OCSP() {}
 
-    /**
-     * Obtains the revocation status of a certificate using OCSP using the most
-     * common defaults. The OCSP responder URI is retrieved from the
-     * certificate's AIA extension. The OCSP responder certificate is assumed
-     * to be the issuer's certificate (or issued by the issuer CA).
-     *
-     * @param cert the certificate to be checked
-     * @param issuerCert the issuer certificate
-     * @return the RevocationStatus
-     * @throws IOException if there is an exception connecting to or
-     *    communicating with the OCSP responder
-     * @throws CertPathValidatorException if an exception occurs while
-     *    encoding the OCSP Request or validating the OCSP Response
-     */
-    public static RevocationStatus check(X509Certificate cert,
-                                         X509Certificate issuerCert)
-        throws IOException, CertPathValidatorException {
-        CertId certId = null;
-        URI responderURI = null;
-        try {
-            X509CertImpl certImpl = X509CertImpl.toImpl(cert);
-            responderURI = getResponderURI(certImpl);
-            if (responderURI == null) {
-                throw new CertPathValidatorException
-                    ("No OCSP Responder URI in certificate");
-            }
-            certId = new CertId(issuerCert, certImpl.getSerialNumberObject());
-        } catch (CertificateException | IOException e) {
-            throw new CertPathValidatorException
-                ("Exception while encoding OCSPRequest", e);
-        }
-        OCSPResponse ocspResponse = check(Collections.singletonList(certId),
-            responderURI, new OCSPResponse.IssuerInfo(issuerCert), null, null,
-            Collections.<Extension>emptyList());
-        return (RevocationStatus)ocspResponse.getSingleResponse(certId);
-    }
 
     /**
      * Obtains the revocation status of a certificate using OCSP.
@@ -146,6 +111,8 @@
      * @throws CertPathValidatorException if an exception occurs while
      *    encoding the OCSP Request or validating the OCSP Response
      */
+
+    // Called by com.sun.deploy.security.TrustDecider
     public static RevocationStatus check(X509Certificate cert,
                                          X509Certificate issuerCert,
                                          URI responderURI,
@@ -154,27 +121,27 @@
         throws IOException, CertPathValidatorException
     {
         return check(cert, issuerCert, responderURI, responderCert, date,
-                     Collections.<Extension>emptyList());
+                     Collections.<Extension>emptyList(), Validator.VAR_GENERIC);
     }
 
-    // Called by com.sun.deploy.security.TrustDecider
+
     public static RevocationStatus check(X509Certificate cert,
-                                         X509Certificate issuerCert,
-                                         URI responderURI,
-                                         X509Certificate responderCert,
-                                         Date date, List<Extension> extensions)
+            X509Certificate issuerCert, URI responderURI,
+            X509Certificate responderCert, Date date, List<Extension> extensions,
+            String variant)
         throws IOException, CertPathValidatorException
     {
-        return check(cert, responderURI, null, issuerCert, responderCert, date, extensions);
+        return check(cert, responderURI, null, issuerCert, responderCert, date,
+                extensions, variant);
     }
 
     public static RevocationStatus check(X509Certificate cert,
             URI responderURI, TrustAnchor anchor, X509Certificate issuerCert,
             X509Certificate responderCert, Date date,
-            List<Extension> extensions)
+            List<Extension> extensions, String variant)
             throws IOException, CertPathValidatorException
     {
-        CertId certId = null;
+        CertId certId;
         try {
             X509CertImpl certImpl = X509CertImpl.toImpl(cert);
             certId = new CertId(issuerCert, certImpl.getSerialNumberObject());
@@ -184,7 +151,7 @@
         }
         OCSPResponse ocspResponse = check(Collections.singletonList(certId),
                 responderURI, new OCSPResponse.IssuerInfo(anchor, issuerCert),
-                responderCert, date, extensions);
+                responderCert, date, extensions, variant);
         return (RevocationStatus) ocspResponse.getSingleResponse(certId);
     }
 
@@ -206,10 +173,10 @@
      * @throws CertPathValidatorException if an exception occurs while
      *    encoding the OCSP Request or validating the OCSP Response
      */
-        static OCSPResponse check(List<CertId> certIds, URI responderURI,
+    static OCSPResponse check(List<CertId> certIds, URI responderURI,
                               OCSPResponse.IssuerInfo issuerInfo,
                               X509Certificate responderCert, Date date,
-                              List<Extension> extensions)
+                              List<Extension> extensions, String variant)
         throws IOException, CertPathValidatorException
     {
         byte[] nonce = null;
@@ -226,7 +193,7 @@
 
             // verify the response
             ocspResponse.verify(certIds, issuerInfo, responderCert, date,
-                    nonce);
+                    nonce, variant);
         } catch (IOException ioe) {
             throw new CertPathValidatorException(
                 "Unable to determine revocation status due to network error",
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java
index d1770da..11f1b09 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/OCSPResponse.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Set;
 import javax.security.auth.x500.X500Principal;
 
@@ -375,7 +374,8 @@
     }
 
     void verify(List<CertId> certIds, IssuerInfo issuerInfo,
-            X509Certificate responderCert, Date date, byte[] nonce)
+            X509Certificate responderCert, Date date, byte[] nonce,
+            String variant)
         throws CertPathValidatorException
     {
         switch (responseStatus) {
@@ -508,7 +508,8 @@
                 // Check algorithm constraints specified in security property
                 // "jdk.certpath.disabledAlgorithms".
                 AlgorithmChecker algChecker =
-                        new AlgorithmChecker(issuerInfo.getAnchor(), date);
+                        new AlgorithmChecker(issuerInfo.getAnchor(), date,
+                                variant);
                 algChecker.init(false);
                 algChecker.check(signerCert, Collections.<String>emptySet());
 
@@ -568,7 +569,7 @@
         if (signerCert != null) {
             // Check algorithm constraints specified in security property
             // "jdk.certpath.disabledAlgorithms".
-            AlgorithmChecker.check(signerCert.getPublicKey(), sigAlgId);
+            AlgorithmChecker.check(signerCert.getPublicKey(), sigAlgId, variant);
 
             if (!verifySignature(signerCert)) {
                 throw new CertPathValidatorException(
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java
index f6b0b2e..8a177c0 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,6 +87,7 @@
         private Set<TrustAnchor> anchors;
         private List<X509Certificate> certs;
         private Timestamp timestamp;
+        private String variant;
 
         ValidatorParams(CertPath cp, PKIXParameters params)
             throws InvalidAlgorithmParameterException
@@ -102,8 +103,9 @@
         ValidatorParams(PKIXParameters params)
             throws InvalidAlgorithmParameterException
         {
-            if (params instanceof PKIXTimestampParameters) {
-                timestamp = ((PKIXTimestampParameters) params).getTimestamp();
+            if (params instanceof PKIXExtendedParameters) {
+                timestamp = ((PKIXExtendedParameters) params).getTimestamp();
+                variant = ((PKIXExtendedParameters) params).getVariant();
             }
 
             this.anchors = params.getTrustAnchors();
@@ -199,6 +201,10 @@
         Timestamp timestamp() {
             return timestamp;
         }
+
+        String variant() {
+            return variant;
+        }
     }
 
     static class BuilderParams extends ValidatorParams {
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
index ac12fab..53ae439 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -172,11 +172,8 @@
         List<PKIXCertPathChecker> certPathCheckers = new ArrayList<>();
         // add standard checkers that we will be using
         certPathCheckers.add(untrustedChecker);
-        if (params.timestamp() == null) {
-            certPathCheckers.add(new AlgorithmChecker(anchor, params.date()));
-        } else {
-            certPathCheckers.add(new AlgorithmChecker(params.timestamp()));
-        }
+        certPathCheckers.add(new AlgorithmChecker(anchor, null, params.date(),
+                params.timestamp(), params.variant()));
         certPathCheckers.add(new KeyChecker(certPathLen,
                                             params.targetCertConstraints()));
         certPathCheckers.add(new ConstraintsChecker(certPathLen));
@@ -194,13 +191,10 @@
         certPathCheckers.add(pc);
         // default value for date is current time
         BasicChecker bc;
-        if (params.timestamp() == null) {
-            bc = new BasicChecker(anchor, params.date(), params.sigProvider(),
-                    false);
-        } else {
-            bc = new BasicChecker(anchor, params.timestamp().getTimestamp(),
-                    params.sigProvider(), false);
-        }
+        bc = new BasicChecker(anchor,
+                (params.timestamp() == null ? params.date() :
+                        params.timestamp().getTimestamp()),
+                params.sigProvider(), false);
         certPathCheckers.add(bc);
 
         boolean revCheckerAdded = false;
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXExtendedParameters.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXExtendedParameters.java
new file mode 100644
index 0000000..42c2d1f
--- /dev/null
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXExtendedParameters.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+package sun.security.provider.certpath;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.Timestamp;
+import java.security.cert.CertSelector;
+import java.security.cert.CertStore;
+import java.security.cert.PKIXBuilderParameters;
+import java.security.cert.PKIXCertPathChecker;
+import java.security.cert.TrustAnchor;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * This class is a wrapper for PKIXBuilderParameters so that a Timestamp object
+ * and a string for the variant type, can be passed when doing certpath
+ * checking.
+ */
+
+public class PKIXExtendedParameters extends PKIXBuilderParameters {
+
+    private final PKIXBuilderParameters p;
+    private Timestamp jarTimestamp;
+    private final String variant;
+
+    public PKIXExtendedParameters(PKIXBuilderParameters params,
+            Timestamp timestamp, String variant)
+            throws InvalidAlgorithmParameterException {
+        super(params.getTrustAnchors(), null);
+        p = params;
+        jarTimestamp = timestamp;
+        this.variant = variant;
+    }
+
+    public Timestamp getTimestamp() {
+        return jarTimestamp;
+    }
+    public void setTimestamp(Timestamp t) {
+        jarTimestamp = t;
+    }
+
+    public String getVariant() {
+        return variant;
+    }
+
+    @Override
+    public void setDate(Date d) {
+        p.setDate(d);
+    }
+
+    @Override
+    public void addCertPathChecker(PKIXCertPathChecker c) {
+        p.addCertPathChecker(c);
+    }
+
+    @Override
+    public void setMaxPathLength(int maxPathLength) {
+        p.setMaxPathLength(maxPathLength);
+    }
+
+    @Override
+    public int getMaxPathLength() {
+        return p.getMaxPathLength();
+    }
+
+    @Override
+    public String toString() {
+        return p.toString();
+    }
+
+    @Override
+    public Set<TrustAnchor> getTrustAnchors() {
+        return p.getTrustAnchors();
+    }
+
+    @Override
+    public void setTrustAnchors(Set<TrustAnchor> trustAnchors)
+            throws InvalidAlgorithmParameterException {
+        // To avoid problems with PKIXBuilderParameter's constructors
+        if (p == null) {
+            return;
+        }
+        p.setTrustAnchors(trustAnchors);
+    }
+
+    @Override
+    public Set<String> getInitialPolicies() {
+        return p.getInitialPolicies();
+    }
+
+    @Override
+    public void setInitialPolicies(Set<String> initialPolicies) {
+        p.setInitialPolicies(initialPolicies);
+    }
+
+    @Override
+    public void setCertStores(List<CertStore> stores) {
+        p.setCertStores(stores);
+    }
+
+    @Override
+    public void addCertStore(CertStore store) {
+        p.addCertStore(store);
+    }
+
+    @Override
+    public List<CertStore> getCertStores() {
+        return p.getCertStores();
+    }
+
+    @Override
+    public void setRevocationEnabled(boolean val) {
+        p.setRevocationEnabled(val);
+    }
+
+    @Override
+    public boolean isRevocationEnabled() {
+        return p.isRevocationEnabled();
+    }
+
+    @Override
+    public void setExplicitPolicyRequired(boolean val) {
+        p.setExplicitPolicyRequired(val);
+    }
+
+    @Override
+    public boolean isExplicitPolicyRequired() {
+        return p.isExplicitPolicyRequired();
+    }
+
+    @Override
+    public void setPolicyMappingInhibited(boolean val) {
+        p.setPolicyMappingInhibited(val);
+    }
+
+    @Override
+    public boolean isPolicyMappingInhibited() {
+        return p.isPolicyMappingInhibited();
+    }
+
+    @Override
+    public void setAnyPolicyInhibited(boolean val) {
+        p.setAnyPolicyInhibited(val);
+    }
+
+    @Override
+    public boolean isAnyPolicyInhibited() {
+        return p.isAnyPolicyInhibited();
+    }
+
+    @Override
+    public void setPolicyQualifiersRejected(boolean qualifiersRejected) {
+        p.setPolicyQualifiersRejected(qualifiersRejected);
+    }
+
+    @Override
+    public boolean getPolicyQualifiersRejected() {
+        return p.getPolicyQualifiersRejected();
+    }
+
+    @Override
+    public Date getDate() {
+        return p.getDate();
+    }
+
+    @Override
+    public void setCertPathCheckers(List<PKIXCertPathChecker> checkers) {
+        p.setCertPathCheckers(checkers);
+    }
+
+    @Override
+    public List<PKIXCertPathChecker> getCertPathCheckers() {
+        return p.getCertPathCheckers();
+    }
+
+    @Override
+    public String getSigProvider() {
+        return p.getSigProvider();
+    }
+
+    @Override
+    public void setSigProvider(String sigProvider) {
+        p.setSigProvider(sigProvider);
+    }
+
+    @Override
+    public CertSelector getTargetCertConstraints() {
+        return p.getTargetCertConstraints();
+    }
+
+    @Override
+    public void setTargetCertConstraints(CertSelector selector) {
+        // To avoid problems with PKIXBuilderParameter's constructors
+        if (p == null) {
+            return;
+        }
+        p.setTargetCertConstraints(selector);
+    }
+
+}
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXTimestampParameters.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXTimestampParameters.java
deleted file mode 100644
index 34b4971..0000000
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXTimestampParameters.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-
-package sun.security.provider.certpath;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.Timestamp;
-import java.security.cert.CertSelector;
-import java.security.cert.CertStore;
-import java.security.cert.PKIXBuilderParameters;
-import java.security.cert.PKIXCertPathChecker;
-import java.security.cert.TrustAnchor;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
-/**
- * This class is a wrapper for PKIXBuilderParameters so that a Timestamp object
- * can be passed alone when PKIXCertPath is checking signed jar files.
- */
-
-public class PKIXTimestampParameters extends PKIXBuilderParameters {
-
-    private final PKIXBuilderParameters p;
-    private Timestamp jarTimestamp;
-
-    public PKIXTimestampParameters(PKIXBuilderParameters params,
-            Timestamp timestamp) throws InvalidAlgorithmParameterException {
-        super(params.getTrustAnchors(), null);
-        p = params;
-        jarTimestamp = timestamp;
-    }
-
-    public Timestamp getTimestamp() {
-        return jarTimestamp;
-    }
-    public void setTimestamp(Timestamp t) {
-        jarTimestamp = t;
-    }
-
-    @Override
-    public void setDate(Date d) {
-        p.setDate(d);
-    }
-
-    @Override
-    public void addCertPathChecker(PKIXCertPathChecker c) {
-        p.addCertPathChecker(c);
-    }
-
-    @Override
-    public void setMaxPathLength(int maxPathLength) {
-        p.setMaxPathLength(maxPathLength);
-    }
-
-    @Override
-    public int getMaxPathLength() {
-        return p.getMaxPathLength();
-    }
-
-    @Override
-    public String toString() {
-        return p.toString();
-    }
-
-    @Override
-    public Set<TrustAnchor> getTrustAnchors() {
-        return p.getTrustAnchors();
-    }
-
-    @Override
-    public void setTrustAnchors(Set<TrustAnchor> trustAnchors)
-            throws InvalidAlgorithmParameterException {
-        // To avoid problems with PKIXBuilderParameter's constructors
-        if (p == null) {
-            return;
-        }
-        p.setTrustAnchors(trustAnchors);
-    }
-
-    @Override
-    public Set<String> getInitialPolicies() {
-        return p.getInitialPolicies();
-    }
-
-    @Override
-    public void setInitialPolicies(Set<String> initialPolicies) {
-        p.setInitialPolicies(initialPolicies);
-    }
-
-    @Override
-    public void setCertStores(List<CertStore> stores) {
-        p.setCertStores(stores);
-    }
-
-    @Override
-    public void addCertStore(CertStore store) {
-        p.addCertStore(store);
-    }
-
-    @Override
-    public List<CertStore> getCertStores() {
-        return p.getCertStores();
-    }
-
-    @Override
-    public void setRevocationEnabled(boolean val) {
-        p.setRevocationEnabled(val);
-    }
-
-    @Override
-    public boolean isRevocationEnabled() {
-        return p.isRevocationEnabled();
-    }
-
-    @Override
-    public void setExplicitPolicyRequired(boolean val) {
-        p.setExplicitPolicyRequired(val);
-    }
-
-    @Override
-    public boolean isExplicitPolicyRequired() {
-        return p.isExplicitPolicyRequired();
-    }
-
-    @Override
-    public void setPolicyMappingInhibited(boolean val) {
-        p.setPolicyMappingInhibited(val);
-    }
-
-    @Override
-    public boolean isPolicyMappingInhibited() {
-        return p.isPolicyMappingInhibited();
-    }
-
-    @Override
-    public void setAnyPolicyInhibited(boolean val) {
-        p.setAnyPolicyInhibited(val);
-    }
-
-    @Override
-    public boolean isAnyPolicyInhibited() {
-        return p.isAnyPolicyInhibited();
-    }
-
-    @Override
-    public void setPolicyQualifiersRejected(boolean qualifiersRejected) {
-        p.setPolicyQualifiersRejected(qualifiersRejected);
-    }
-
-    @Override
-    public boolean getPolicyQualifiersRejected() {
-        return p.getPolicyQualifiersRejected();
-    }
-
-    @Override
-    public Date getDate() {
-        return p.getDate();
-    }
-
-    @Override
-    public void setCertPathCheckers(List<PKIXCertPathChecker> checkers) {
-        p.setCertPathCheckers(checkers);
-    }
-
-    @Override
-    public List<PKIXCertPathChecker> getCertPathCheckers() {
-        return p.getCertPathCheckers();
-    }
-
-    @Override
-    public String getSigProvider() {
-        return p.getSigProvider();
-    }
-
-    @Override
-    public void setSigProvider(String sigProvider) {
-        p.setSigProvider(sigProvider);
-    }
-
-    @Override
-    public CertSelector getTargetCertConstraints() {
-        return p.getTargetCertConstraints();
-    }
-
-    @Override
-    public void setTargetCertConstraints(CertSelector selector) {
-        // To avoid problems with PKIXBuilderParameter's constructors
-        if (p == null) {
-            return;
-        }
-        p.setTargetCertConstraints(selector);
-    }
-
-}
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java
index 5fba166..9b443a7 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -579,7 +579,7 @@
                     approvedCRLs.addAll(DistributionPointFetcher.getCRLs(
                                         sel, signFlag, prevKey, prevCert,
                                         params.sigProvider(), certStores,
-                                        reasonsMask, anchors, null));
+                                        reasonsMask, anchors, null, params.variant()));
                 }
             } catch (CertStoreException e) {
                 if (e instanceof CertStoreTypeException) {
@@ -727,7 +727,7 @@
                     }
                 }
                 response.verify(Collections.singletonList(certId), issuerInfo,
-                        responderCert, params.date(), nonce);
+                        responderCert, params.date(), nonce, params.variant());
 
             } else {
                 URI responderURI = (this.responderURI != null)
@@ -741,7 +741,7 @@
 
                 response = OCSP.check(Collections.singletonList(certId),
                         responderURI, issuerInfo, responderCert, null,
-                        ocspExtensions);
+                        ocspExtensions, params.variant());
             }
         } catch (IOException e) {
             throw new CertPathValidatorException(
@@ -853,7 +853,7 @@
                     if (DistributionPointFetcher.verifyCRL(
                             certImpl, point, crl, reasonsMask, signFlag,
                             prevKey, null, params.sigProvider(), anchors,
-                            certStores, params.date()))
+                            certStores, params.date(), params.variant()))
                     {
                         results.add(crl);
                     }
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java
index c0cc98a..11d8a06 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -344,7 +344,7 @@
 
                 // add the algorithm checker
                 checkers.add(new AlgorithmChecker(builder.trustAnchor,
-                        buildParams.date()));
+                        buildParams.date(), null));
 
                 BasicChecker basicChecker = null;
                 if (nextState.keyParamsNeeded()) {
diff --git a/jdk/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java b/jdk/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
index 7b1fcce..45cb91f 100644
--- a/jdk/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
+++ b/jdk/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -191,14 +191,22 @@
             if (version != 0) {
                 throw new IOException("Version must be 0");
             }
-            n = getBigInteger(data);
-            e = getBigInteger(data);
-            d = getBigInteger(data);
-            p = getBigInteger(data);
-            q = getBigInteger(data);
-            pe = getBigInteger(data);
-            qe = getBigInteger(data);
-            coeff = getBigInteger(data);
+
+            /*
+             * Some implementations do not correctly encode ASN.1 INTEGER values
+             * in 2's complement format, resulting in a negative integer when
+             * decoded. Correct the error by converting it to a positive integer.
+             *
+             * See CR 6255949
+             */
+            n = data.getPositiveBigInteger();
+            e = data.getPositiveBigInteger();
+            d = data.getPositiveBigInteger();
+            p = data.getPositiveBigInteger();
+            q = data.getPositiveBigInteger();
+            pe = data.getPositiveBigInteger();
+            qe = data.getPositiveBigInteger();
+            coeff = data.getPositiveBigInteger();
             if (derValue.data.available() != 0) {
                 throw new IOException("Extra data available");
             }
@@ -206,23 +214,4 @@
             throw new InvalidKeyException("Invalid RSA private key", e);
         }
     }
-
-    /**
-     * Read a BigInteger from the DerInputStream.
-     */
-    static BigInteger getBigInteger(DerInputStream data) throws IOException {
-        BigInteger b = data.getBigInteger();
-
-        /*
-         * Some implementations do not correctly encode ASN.1 INTEGER values
-         * in 2's complement format, resulting in a negative integer when
-         * decoded. Correct the error by converting it to a positive integer.
-         *
-         * See CR 6255949
-         */
-        if (b.signum() < 0) {
-            b = new BigInteger(1, b.toByteArray());
-        }
-        return b;
-    }
 }
diff --git a/jdk/src/java.base/share/classes/sun/security/rsa/RSAPublicKeyImpl.java b/jdk/src/java.base/share/classes/sun/security/rsa/RSAPublicKeyImpl.java
index 52c0d67..5f2afac 100644
--- a/jdk/src/java.base/share/classes/sun/security/rsa/RSAPublicKeyImpl.java
+++ b/jdk/src/java.base/share/classes/sun/security/rsa/RSAPublicKeyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -111,8 +111,8 @@
                 throw new IOException("Not a SEQUENCE");
             }
             DerInputStream data = derValue.data;
-            n = RSAPrivateCrtKeyImpl.getBigInteger(data);
-            e = RSAPrivateCrtKeyImpl.getBigInteger(data);
+            n = data.getPositiveBigInteger();
+            e = data.getPositiveBigInteger();
             if (derValue.data.available() != 0) {
                 throw new IOException("Extra data available");
             }
diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java b/jdk/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
index a09932d..51560f5 100644
--- a/jdk/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -265,6 +265,7 @@
      * the penalty of prematurly killing SSL sessions.
      */
     @Override
+    @SuppressWarnings("deprecation")
     protected final void finalize() throws Throwable {
         try {
             close();
diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/EllipticCurvesExtension.java b/jdk/src/java.base/share/classes/sun/security/ssl/EllipticCurvesExtension.java
index d4f2848..c91b25e 100644
--- a/jdk/src/java.base/share/classes/sun/security/ssl/EllipticCurvesExtension.java
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/EllipticCurvesExtension.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,9 @@
 
 final class EllipticCurvesExtension extends HelloExtension {
 
+    /* Class and subclass dynamic debugging support */
+    private static final Debug debug = Debug.getInstance("ssl");
+
     private static final int ARBITRARY_PRIME = 0xff01;
     private static final int ARBITRARY_CHAR2 = 0xff02;
 
@@ -159,6 +162,11 @@
                     }   // ignore unknown curves
                 }
             }
+            if (idList.isEmpty() && JsseJce.isEcAvailable()) {
+                throw new IllegalArgumentException(
+                    "System property jdk.tls.namedGroups(" + property + ") " +
+                    "contains no supported elliptic curves");
+            }
         } else {        // default curves
             int[] ids;
             if (requireFips) {
@@ -183,16 +191,17 @@
             }
         }
 
-        if (idList.isEmpty()) {
-            throw new IllegalArgumentException(
-                "System property jdk.tls.namedGroups(" + property + ") " +
-                "contains no supported elliptic curves");
-        } else {
-            supportedCurveIds = new int[idList.size()];
-            int i = 0;
-            for (Integer id : idList) {
-                supportedCurveIds[i++] = id;
-            }
+        if (debug != null && idList.isEmpty()) {
+            Debug.log(
+                "Initialized [jdk.tls.namedGroups|default] list contains " +
+                "no available elliptic curves. " +
+                (property != null ? "(" + property + ")" : "[Default]"));
+        }
+
+        supportedCurveIds = new int[idList.size()];
+        int i = 0;
+        for (Integer id : idList) {
+            supportedCurveIds[i++] = id;
         }
     }
 
diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java b/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java
index 46ae8d5..4f0a95f 100644
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
 
 import sun.security.provider.certpath.AlgorithmChecker;
 import sun.security.action.GetPropertyAction;
+import sun.security.validator.Validator;
 
 public abstract class SSLContextImpl extends SSLContextSpi {
 
@@ -1436,7 +1437,7 @@
                 constraints = new SSLAlgorithmConstraints(sslSocket, true);
             }
 
-            checkAlgorithmConstraints(chain, constraints);
+            checkAlgorithmConstraints(chain, constraints, isClient);
         }
     }
 
@@ -1478,12 +1479,12 @@
                 constraints = new SSLAlgorithmConstraints(engine, true);
             }
 
-            checkAlgorithmConstraints(chain, constraints);
+            checkAlgorithmConstraints(chain, constraints, isClient);
         }
     }
 
     private void checkAlgorithmConstraints(X509Certificate[] chain,
-            AlgorithmConstraints constraints) throws CertificateException {
+            AlgorithmConstraints constraints, boolean isClient) throws CertificateException {
 
         try {
             // Does the certificate chain end with a trusted certificate?
@@ -1501,7 +1502,9 @@
 
             // A forward checker, need to check from trust to target
             if (checkedLength >= 0) {
-                AlgorithmChecker checker = new AlgorithmChecker(constraints);
+                AlgorithmChecker checker =
+                        new AlgorithmChecker(constraints, null,
+                                (isClient ? Validator.VAR_TLS_CLIENT : Validator.VAR_TLS_SERVER));
                 checker.init(false);
                 for (int i = checkedLength; i >= 0; i--) {
                     Certificate cert = chain[i];
diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SunJSSE.java b/jdk/src/java.base/share/classes/sun/security/ssl/SunJSSE.java
index 3ef37b7..0bb89fb 100644
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SunJSSE.java
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SunJSSE.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -247,6 +247,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     protected final void finalize() throws Throwable {
         // empty
         super.finalize();
diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java b/jdk/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java
index b6ed37c..954b90d 100644
--- a/jdk/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java
@@ -39,6 +39,7 @@
 import javax.net.ssl.*;
 
 import sun.security.provider.certpath.AlgorithmChecker;
+import sun.security.validator.Validator;
 
 /**
  * The new X509 key manager implementation. The main differences to the
@@ -661,6 +662,15 @@
 
             return CheckResult.OK;
         }
+
+        public String getValidator() {
+            if (this == CLIENT) {
+                return Validator.VAR_TLS_CLIENT;
+            } else if (this == SERVER) {
+                return Validator.VAR_TLS_SERVER;
+            }
+            return Validator.VAR_GENERIC;
+        }
     }
 
     // enum for the result of the extension check
@@ -774,7 +784,8 @@
 
             // check the algorithm constraints
             if (constraints != null &&
-                    !conformsToAlgorithmConstraints(constraints, chain)) {
+                    !conformsToAlgorithmConstraints(constraints, chain,
+                            checkType.getValidator())) {
 
                 if (useDebug) {
                     debug.println("Ignoring alias " + alias +
@@ -811,9 +822,10 @@
     }
 
     private static boolean conformsToAlgorithmConstraints(
-            AlgorithmConstraints constraints, Certificate[] chain) {
+            AlgorithmConstraints constraints, Certificate[] chain,
+            String variant) {
 
-        AlgorithmChecker checker = new AlgorithmChecker(constraints);
+        AlgorithmChecker checker = new AlgorithmChecker(constraints, null, variant);
         try {
             checker.init(false);
         } catch (CertPathValidatorException cpve) {
diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java
index b73773f..53ea970 100644
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java
@@ -27,6 +27,7 @@
 
 import java.io.*;
 import java.security.CodeSigner;
+import java.security.CryptoPrimitive;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
 import java.security.MessageDigest;
@@ -156,6 +157,7 @@
     private boolean protectedPath = false;
     private boolean srcprotectedPath = false;
     private boolean cacerts = false;
+    private boolean nowarn = false;
     private CertificateFactory cf = null;
     private KeyStore caks = null; // "cacerts" keystore
     private char[] srcstorePass = null;
@@ -166,6 +168,16 @@
     private List<String> ids = new ArrayList<>();   // used in GENCRL
     private List<String> v3ext = new ArrayList<>();
 
+    // Warnings on weak algorithms
+    private List<String> weakWarnings = new ArrayList<>();
+
+    private static final DisabledAlgorithmConstraints DISABLED_CHECK =
+            new DisabledAlgorithmConstraints(
+                    DisabledAlgorithmConstraints.PROPERTY_CERTPATH_DISABLED_ALGS);
+
+    private static final Set<CryptoPrimitive> SIG_PRIMITIVE_SET = Collections
+            .unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE));
+
     enum Command {
         CERTREQ("Generates.a.certificate.request",
             ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME,
@@ -351,7 +363,7 @@
     private static final String NONE = "NONE";
     private static final String P11KEYSTORE = "PKCS11";
     private static final String P12KEYSTORE = "PKCS12";
-    private final String keyAlias = "mykey";
+    private static final String keyAlias = "mykey";
 
     // for i18n
     private static final java.util.ResourceBundle rb =
@@ -387,6 +399,7 @@
                 throw e;
             }
         } finally {
+            printWeakWarnings(false);
             for (char[] pass : passwords) {
                 if (pass != null) {
                     Arrays.fill(pass, ' ');
@@ -476,6 +489,8 @@
                 help = true;
             } else if (collator.compare(flags, "-conf") == 0) {
                 i++;
+            } else if (collator.compare(flags, "-nowarn") == 0) {
+                nowarn = true;
             } else if (collator.compare(flags, "-keystore") == 0) {
                 ksfname = args[++i];
                 if (new File(ksfname).getCanonicalPath().equals(
@@ -1010,6 +1025,13 @@
             cf = CertificateFactory.getInstance("X509");
         }
 
+        // -trustcacerts can only be specified on -importcert.
+        // Reset it so that warnings on CA cert will remain for
+        // -printcert, etc.
+        if (command != IMPORTCERT) {
+            trustcacerts = false;
+        }
+
         if (trustcacerts) {
             caks = KeyStoreUtil.getCacertsKeyStore();
         }
@@ -1152,11 +1174,11 @@
         } else if (command == LIST) {
             if (storePass == null
                     && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
-                printWarning();
+                printNoIntegrityWarning();
             }
 
             if (alias != null) {
-                doPrintEntry(alias, out);
+                doPrintEntry(rb.getString("the.certificate"), alias, out);
             } else {
                 doPrintEntries(out);
             }
@@ -1253,6 +1275,12 @@
             throws Exception {
 
 
+        if (keyStore.containsAlias(alias) == false) {
+            MessageFormat form = new MessageFormat
+                    (rb.getString("Alias.alias.does.not.exist"));
+            Object[] source = {alias};
+            throw new Exception(form.format(source));
+        }
         Certificate signerCert = keyStore.getCertificate(alias);
         byte[] encoded = signerCert.getEncoded();
         X509CertImpl signerCertImpl = new X509CertImpl(encoded);
@@ -1306,6 +1334,8 @@
         byte[] rawReq = Pem.decode(new String(sb));
         PKCS10 req = new PKCS10(rawReq);
 
+        checkWeak(rb.getString("the.certificate.request"), req);
+
         info.set(X509CertInfo.KEY, new CertificateX509Key(req.getSubjectPublicKeyInfo()));
         info.set(X509CertInfo.SUBJECT,
                     dname==null?req.getSubjectName():new X500Name(dname));
@@ -1335,6 +1365,9 @@
                 }
             }
         }
+
+        checkWeak(rb.getString("the.issuer"), keyStore.getCertificateChain(alias));
+        checkWeak(rb.getString("the.generated.certificate"), cert);
     }
 
     private void doGenCRL(PrintStream out)
@@ -1385,6 +1418,7 @@
         } else {
             out.write(crl.getEncodedInternal());
         }
+        checkWeak(rb.getString("the.generated.crl"), crl, privateKey);
     }
 
     /**
@@ -1431,6 +1465,8 @@
         // Sign the request and base-64 encode it
         request.encodeAndSign(subject, signature);
         request.print(out);
+
+        checkWeak(rb.getString("the.generated.certificate.request"), request);
     }
 
     /**
@@ -1454,7 +1490,7 @@
     {
         if (storePass == null
                 && !KeyStoreUtil.isWindowsKeyStore(storetype)) {
-            printWarning();
+            printNoIntegrityWarning();
         }
         if (alias == null) {
             alias = keyAlias;
@@ -1474,6 +1510,7 @@
             throw new Exception(form.format(source));
         }
         dumpCert(cert, out);
+        checkWeak(rb.getString("the.certificate"), cert);
     }
 
     /**
@@ -1728,6 +1765,7 @@
         if (keyPass == null) {
             keyPass = promptForKeyPass(alias, null, storePass);
         }
+        checkWeak(rb.getString("the.generated.certificate"), chain[0]);
         keyStore.setKeyEntry(alias, privKey, keyPass, chain);
     }
 
@@ -1810,7 +1848,7 @@
     /**
      * Prints a single keystore entry.
      */
-    private void doPrintEntry(String alias, PrintStream out)
+    private void doPrintEntry(String label, String alias, PrintStream out)
         throws Exception
     {
         if (keyStore.containsAlias(alias) == false) {
@@ -1881,12 +1919,14 @@
                         } else {
                             dumpCert(chain[i], out);
                         }
+                        checkWeak(label, chain[i]);
                     }
                 } else {
                     // Print the digest of the user cert only
                     out.println
                         (rb.getString("Certificate.fingerprint.SHA.256.") +
                         getCertFingerPrint("SHA-256", chain[0]));
+                    checkWeak(label, chain);
                 }
             }
         } else if (keyStore.entryInstanceOf(alias,
@@ -1909,6 +1949,7 @@
                 out.println(rb.getString("Certificate.fingerprint.SHA.256.")
                             + getCertFingerPrint("SHA-256", cert));
             }
+            checkWeak(label, cert);
         } else {
             out.println(rb.getString("Unknown.Entry.Type"));
         }
@@ -1992,7 +2033,7 @@
 
         if (srcstorePass == null
                 && !KeyStoreUtil.isWindowsKeyStore(srcstoretype)) {
-            // anti refactoring, copied from printWarning(),
+            // anti refactoring, copied from printNoIntegrityWarning(),
             // but change 2 lines
             System.err.println();
             System.err.println(rb.getString
@@ -2083,6 +2124,10 @@
         }
 
         try {
+            Certificate c = srckeystore.getCertificate(alias);
+            if (c != null) {
+                checkWeak("<" + newAlias + ">", c);
+            }
             keyStore.setEntry(newAlias, entry, pp);
             // Place the check so that only successful imports are blocked.
             // For example, we don't block a failed SecretEntry import.
@@ -2154,7 +2199,7 @@
         for (Enumeration<String> e = keyStore.aliases();
                                         e.hasMoreElements(); ) {
             String alias = e.nextElement();
-            doPrintEntry(alias, out);
+            doPrintEntry("<" + alias + ">", alias, out);
             if (verbose || rfc) {
                 out.println(rb.getString("NEWLINE"));
                 out.println(rb.getString
@@ -2300,19 +2345,28 @@
         for (CRL crl: loadCRLs(src)) {
             printCRL(crl, out);
             String issuer = null;
+            Certificate signer = null;
             if (caks != null) {
                 issuer = verifyCRL(caks, crl);
                 if (issuer != null) {
+                    signer = caks.getCertificate(issuer);
                     out.printf(rb.getString(
-                            "verified.by.s.in.s"), issuer, "cacerts");
+                            "verified.by.s.in.s.weak"),
+                            issuer,
+                            "cacerts",
+                            withWeak(signer.getPublicKey()));
                     out.println();
                 }
             }
             if (issuer == null && keyStore != null) {
                 issuer = verifyCRL(keyStore, crl);
                 if (issuer != null) {
+                    signer = keyStore.getCertificate(issuer);
                     out.printf(rb.getString(
-                            "verified.by.s.in.s"), issuer, "keystore");
+                            "verified.by.s.in.s.weak"),
+                            issuer,
+                            "keystore",
+                            withWeak(signer.getPublicKey()));
                     out.println();
                 }
             }
@@ -2324,18 +2378,26 @@
                 out.println(rb.getString
                         ("STARNN"));
             }
+            checkWeak(rb.getString("the.crl"), crl, signer == null ? null : signer.getPublicKey());
         }
     }
 
     private void printCRL(CRL crl, PrintStream out)
             throws Exception {
+        X509CRL xcrl = (X509CRL)crl;
         if (rfc) {
-            X509CRL xcrl = (X509CRL)crl;
             out.println("-----BEGIN X509 CRL-----");
             out.println(Base64.getMimeEncoder(64, CRLF).encodeToString(xcrl.getEncoded()));
             out.println("-----END X509 CRL-----");
         } else {
-            out.println(crl.toString());
+            String s;
+            if (crl instanceof X509CRLImpl) {
+                X509CRLImpl x509crl = (X509CRLImpl) crl;
+                s = x509crl.toStringWithAlgName(withWeak("" + x509crl.getSigAlgId()));
+            } else {
+                s = crl.toString();
+            }
+            out.println(s);
         }
     }
 
@@ -2362,8 +2424,11 @@
         PKCS10 req = new PKCS10(Pem.decode(new String(sb)));
 
         PublicKey pkey = req.getSubjectPublicKeyInfo();
-        out.printf(rb.getString("PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key."),
-                req.getSubjectName(), pkey.getFormat(), pkey.getAlgorithm());
+        out.printf(rb.getString("PKCS.10.with.weak"),
+                req.getSubjectName(),
+                pkey.getFormat(),
+                withWeak(pkey),
+                withWeak(req.getSigAlg()));
         for (PKCS10Attribute attr: req.getAttributes().getAttributes()) {
             ObjectIdentifier oid = attr.getAttributeId();
             if (oid.equals(PKCS9Attribute.EXTENSION_REQUEST_OID)) {
@@ -2386,6 +2451,7 @@
         if (debug) {
             out.println(req);   // Just to see more, say, public key length...
         }
+        checkWeak(rb.getString("the.certificate.request"), req);
     }
 
     /**
@@ -2425,6 +2491,15 @@
             if (i < (certs.length-1)) {
                 out.println();
             }
+            checkWeak(oneInMany(rb.getString("the.certificate"), i, certs.length), x509Cert);
+        }
+    }
+
+    private static String oneInMany(String label, int i, int num) {
+        if (num == 1) {
+            return label;
+        } else {
+            return String.format(rb.getString("one.in.many"), label, i+1, num);
         }
     }
 
@@ -2458,7 +2533,11 @@
                             out.println();
                             out.println(rb.getString("Signature."));
                             out.println();
-                            for (Certificate cert: signer.getSignerCertPath().getCertificates()) {
+
+                            List<? extends Certificate> certs
+                                    = signer.getSignerCertPath().getCertificates();
+                            int cc = 0;
+                            for (Certificate cert: certs) {
                                 X509Certificate x = (X509Certificate)cert;
                                 if (rfc) {
                                     out.println(rb.getString("Certificate.owner.") + x.getSubjectDN() + "\n");
@@ -2467,12 +2546,15 @@
                                     printX509Cert(x, out);
                                 }
                                 out.println();
+                                checkWeak(oneInMany(rb.getString("the.certificate"), cc++, certs.size()), x);
                             }
                             Timestamp ts = signer.getTimestamp();
                             if (ts != null) {
                                 out.println(rb.getString("Timestamp."));
                                 out.println();
-                                for (Certificate cert: ts.getSignerCertPath().getCertificates()) {
+                                certs = ts.getSignerCertPath().getCertificates();
+                                cc = 0;
+                                for (Certificate cert: certs) {
                                     X509Certificate x = (X509Certificate)cert;
                                     if (rfc) {
                                         out.println(rb.getString("Certificate.owner.") + x.getSubjectDN() + "\n");
@@ -2481,6 +2563,7 @@
                                         printX509Cert(x, out);
                                     }
                                     out.println();
+                                    checkWeak(oneInMany(rb.getString("the.tsa.certificate"), cc++, certs.size()), x);
                                 }
                             }
                         }
@@ -2523,6 +2606,7 @@
                         printX509Cert((X509Certificate)cert, out);
                         out.println();
                     }
+                    checkWeak(oneInMany(rb.getString("the.certificate"), i, chain.size()), cert);
                 } catch (Exception e) {
                     if (debug) {
                         e.printStackTrace();
@@ -2698,7 +2782,7 @@
         }
 
         // Now store the newly established chain in the keystore. The new
-        // chain replaces the old one.
+        // chain replaces the old one. The chain can be null if user chooses no.
         if (newChain != null) {
             keyStore.setKeyEntry(alias, privKey,
                                  (keyPass != null) ? keyPass : storePass,
@@ -2735,6 +2819,12 @@
             throw new Exception(rb.getString("Input.not.an.X.509.certificate"));
         }
 
+        if (noprompt) {
+            checkWeak(rb.getString("the.input"), cert);
+            keyStore.setCertificateEntry(alias, cert);
+            return true;
+        }
+
         // if certificate is self-signed, make sure it verifies
         boolean selfSigned = false;
         if (KeyStoreUtil.isSelfSigned(cert)) {
@@ -2742,11 +2832,6 @@
             selfSigned = true;
         }
 
-        if (noprompt) {
-            keyStore.setCertificateEntry(alias, cert);
-            return true;
-        }
-
         // check if cert already exists in keystore
         String reply = null;
         String trustalias = keyStore.getCertificateAlias(cert);
@@ -2755,6 +2840,8 @@
                 ("Certificate.already.exists.in.keystore.under.alias.trustalias."));
             Object[] source = {trustalias};
             System.err.println(form.format(source));
+            checkWeak(rb.getString("the.input"), cert);
+            printWeakWarnings(true);
             reply = getYesNoReply
                 (rb.getString("Do.you.still.want.to.add.it.no."));
         } else if (selfSigned) {
@@ -2764,6 +2851,8 @@
                         ("Certificate.already.exists.in.system.wide.CA.keystore.under.alias.trustalias."));
                 Object[] source = {trustalias};
                 System.err.println(form.format(source));
+                checkWeak(rb.getString("the.input"), cert);
+                printWeakWarnings(true);
                 reply = getYesNoReply
                         (rb.getString("Do.you.still.want.to.add.it.to.your.own.keystore.no."));
             }
@@ -2771,6 +2860,8 @@
                 // Print the cert and ask user if they really want to add
                 // it to their keystore
                 printX509Cert(cert, System.out);
+                checkWeak(rb.getString("the.input"), cert);
+                printWeakWarnings(true);
                 reply = getYesNoReply
                         (rb.getString("Trust.this.certificate.no."));
             }
@@ -2784,6 +2875,7 @@
             }
         }
 
+        // Not found in this keystore and not self-signed
         // Try to establish trust chain
         try {
             Certificate[] chain = establishCertChain(null, cert);
@@ -2795,6 +2887,8 @@
             // Print the cert and ask user if they really want to add it to
             // their keystore
             printX509Cert(cert, System.out);
+            checkWeak(rb.getString("the.input"), cert);
+            printWeakWarnings(true);
             reply = getYesNoReply
                 (rb.getString("Trust.this.certificate.no."));
             if ("YES".equals(reply)) {
@@ -2933,6 +3027,24 @@
         return keyPass;
     }
 
+    private String withWeak(String alg) {
+        if (DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, alg, null)) {
+            return alg;
+        } else {
+            return String.format(rb.getString("with.weak"), alg);
+        }
+    }
+
+    private String withWeak(PublicKey key) {
+        if (DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, key)) {
+            return String.format(rb.getString("key.bit"),
+                    KeyUtil.getKeySize(key), key.getAlgorithm());
+        } else {
+            return String.format(rb.getString("key.bit.weak"),
+                    KeyUtil.getKeySize(key), key.getAlgorithm());
+        }
+    }
+
     /**
      * Prints a certificate in a human readable format.
      */
@@ -2941,8 +3053,13 @@
     {
 
         MessageFormat form = new MessageFormat
-                (rb.getString(".PATTERN.printX509Cert"));
+                (rb.getString(".PATTERN.printX509Cert.with.weak"));
         PublicKey pkey = cert.getPublicKey();
+        String sigName = cert.getSigAlgName();
+        // No need to warn about sigalg of a trust anchor
+        if (!isTrustedCert(cert)) {
+            sigName = withWeak(sigName);
+        }
         Object[] source = {cert.getSubjectDN().toString(),
                         cert.getIssuerDN().toString(),
                         cert.getSerialNumber().toString(16),
@@ -2950,10 +3067,9 @@
                         cert.getNotAfter().toString(),
                         getCertFingerPrint("SHA-1", cert),
                         getCertFingerPrint("SHA-256", cert),
-                        cert.getSigAlgName(),
-                        pkey.getAlgorithm(),
-                        KeyUtil.getKeySize(pkey),
-                        cert.getVersion(),
+                        sigName,
+                        withWeak(pkey),
+                        cert.getVersion()
                         };
         out.println(form.format(source));
 
@@ -3003,12 +3119,12 @@
      * @param ks the keystore to search with, not null
      * @return <code>cert</code> itself if it's already inside <code>ks</code>,
      * or a certificate inside <code>ks</code> who signs <code>cert</code>,
-     * or null otherwise.
+     * or null otherwise. A label is added.
      */
-    private static Certificate getTrustedSigner(Certificate cert, KeyStore ks)
-            throws Exception {
+    private static Pair<String,Certificate>
+            getSigner(Certificate cert, KeyStore ks) throws Exception {
         if (ks.getCertificateAlias(cert) != null) {
-            return cert;
+            return new Pair<>("", cert);
         }
         for (Enumeration<String> aliases = ks.aliases();
                 aliases.hasMoreElements(); ) {
@@ -3017,7 +3133,7 @@
             if (trustedCert != null) {
                 try {
                     cert.verify(trustedCert.getPublicKey());
-                    return trustedCert;
+                    return new Pair<>(name, trustedCert);
                 } catch (Exception e) {
                     // Not verified, skip to the next one
                 }
@@ -3281,7 +3397,7 @@
     /**
      * Prints warning about missing integrity check.
      */
-    private void printWarning() {
+    private void printNoIntegrityWarning() {
         System.err.println();
         System.err.println(rb.getString
             (".WARNING.WARNING.WARNING."));
@@ -3306,6 +3422,9 @@
                                         Certificate[] replyCerts)
         throws Exception
     {
+
+        checkWeak(rb.getString("reply"), replyCerts);
+
         // order the certs in the reply (bottom-up).
         // we know that all certs in the reply are of type X.509, because
         // we parsed them using an X.509 certificate factory
@@ -3358,9 +3477,11 @@
 
         // do we trust the cert at the top?
         Certificate topCert = replyCerts[replyCerts.length-1];
-        Certificate root = getTrustedSigner(topCert, keyStore);
+        boolean fromKeyStore = true;
+        Pair<String,Certificate> root = getSigner(topCert, keyStore);
         if (root == null && trustcacerts && caks != null) {
-            root = getTrustedSigner(topCert, caks);
+            root = getSigner(topCert, caks);
+            fromKeyStore = false;
         }
         if (root == null) {
             System.err.println();
@@ -3369,33 +3490,42 @@
             printX509Cert((X509Certificate)topCert, System.out);
             System.err.println();
             System.err.print(rb.getString(".is.not.trusted."));
+            printWeakWarnings(true);
             String reply = getYesNoReply
                     (rb.getString("Install.reply.anyway.no."));
             if ("NO".equals(reply)) {
                 return null;
             }
         } else {
-            if (root != topCert) {
+            if (root.snd != topCert) {
                 // append the root CA cert to the chain
                 Certificate[] tmpCerts =
                     new Certificate[replyCerts.length+1];
                 System.arraycopy(replyCerts, 0, tmpCerts, 0,
                                  replyCerts.length);
-                tmpCerts[tmpCerts.length-1] = root;
+                tmpCerts[tmpCerts.length-1] = root.snd;
                 replyCerts = tmpCerts;
+                checkWeak(String.format(rb.getString(fromKeyStore ?
+                                            "alias.in.keystore" :
+                                            "alias.in.cacerts"),
+                                        root.fst),
+                          root.snd);
             }
         }
-
         return replyCerts;
     }
 
     /**
      * Establishes a certificate chain (using trusted certificates in the
-     * keystore), starting with the user certificate
+     * keystore and cacerts), starting with the reply (certToVerify)
      * and ending at a self-signed certificate found in the keystore.
      *
-     * @param userCert the user certificate of the alias
-     * @param certToVerify the single certificate provided in the reply
+     * @param userCert optional existing certificate, mostly likely be the
+     *                 original self-signed cert created by -genkeypair.
+     *                 It must have the same public key as certToVerify
+     *                 but cannot be the same cert.
+     * @param certToVerify the starting certificate to build the chain
+     * @returns the established chain, might be null if user decides not
      */
     private Certificate[] establishCertChain(Certificate userCert,
                                              Certificate certToVerify)
@@ -3423,30 +3553,37 @@
         // Use the subject distinguished name as the key into the hash table.
         // All certificates associated with the same subject distinguished
         // name are stored in the same hash table entry as a vector.
-        Hashtable<Principal, Vector<Certificate>> certs = null;
+        Hashtable<Principal, Vector<Pair<String,X509Certificate>>> certs = null;
         if (keyStore.size() > 0) {
-            certs = new Hashtable<Principal, Vector<Certificate>>(11);
+            certs = new Hashtable<>(11);
             keystorecerts2Hashtable(keyStore, certs);
         }
         if (trustcacerts) {
             if (caks!=null && caks.size()>0) {
                 if (certs == null) {
-                    certs = new Hashtable<Principal, Vector<Certificate>>(11);
+                    certs = new Hashtable<>(11);
                 }
                 keystorecerts2Hashtable(caks, certs);
             }
         }
 
         // start building chain
-        Vector<Certificate> chain = new Vector<>(2);
-        if (buildChain((X509Certificate)certToVerify, chain, certs)) {
-            Certificate[] newChain = new Certificate[chain.size()];
+        Vector<Pair<String,X509Certificate>> chain = new Vector<>(2);
+        if (buildChain(
+                new Pair<>(rb.getString("the.input"),
+                           (X509Certificate) certToVerify),
+                chain, certs)) {
+            for (Pair<String,X509Certificate> p : chain) {
+                checkWeak(p.fst, p.snd);
+            }
+            Certificate[] newChain =
+                    new Certificate[chain.size()];
             // buildChain() returns chain with self-signed root-cert first and
             // user-cert last, so we need to invert the chain before we store
             // it
             int j=0;
             for (int i=chain.size()-1; i>=0; i--) {
-                newChain[j] = chain.elementAt(i);
+                newChain[j] = chain.elementAt(i).snd;
                 j++;
             }
             return newChain;
@@ -3457,7 +3594,17 @@
     }
 
     /**
-     * Recursively tries to establish chain from pool of trusted certs.
+     * Recursively tries to establish chain from pool of certs starting from
+     * certToVerify until a self-signed cert is found, and fill the certs found
+     * into chain. Each cert in the chain signs the next one.
+     *
+     * This method is able to recover from an error, say, if certToVerify
+     * is signed by certA but certA has no issuer in certs and itself is not
+     * self-signed, the method can try another certB that also signs
+     * certToVerify and look for signer of certB, etc, etc.
+     *
+     * Each cert in chain comes with a label showing its origin. The label is
+     * used in the warning message when the cert is considered a risk.
      *
      * @param certToVerify the cert that needs to be verified.
      * @param chain the chain that's being built.
@@ -3465,19 +3612,20 @@
      *
      * @return true if successful, false otherwise.
      */
-    private boolean buildChain(X509Certificate certToVerify,
-                        Vector<Certificate> chain,
-                        Hashtable<Principal, Vector<Certificate>> certs) {
-        Principal issuer = certToVerify.getIssuerDN();
-        if (KeyStoreUtil.isSelfSigned(certToVerify)) {
+    private boolean buildChain(Pair<String,X509Certificate> certToVerify,
+            Vector<Pair<String,X509Certificate>> chain,
+            Hashtable<Principal, Vector<Pair<String,X509Certificate>>> certs) {
+        if (KeyStoreUtil.isSelfSigned(certToVerify.snd)) {
             // reached self-signed root cert;
             // no verification needed because it's trusted.
             chain.addElement(certToVerify);
             return true;
         }
 
+        Principal issuer = certToVerify.snd.getIssuerDN();
+
         // Get the issuer's certificate(s)
-        Vector<Certificate> vec = certs.get(issuer);
+        Vector<Pair<String,X509Certificate>> vec = certs.get(issuer);
         if (vec == null) {
             return false;
         }
@@ -3485,13 +3633,12 @@
         // Try out each certificate in the vector, until we find one
         // whose public key verifies the signature of the certificate
         // in question.
-        for (Enumeration<Certificate> issuerCerts = vec.elements();
-             issuerCerts.hasMoreElements(); ) {
-            X509Certificate issuerCert
-                = (X509Certificate)issuerCerts.nextElement();
-            PublicKey issuerPubKey = issuerCert.getPublicKey();
+        for (Enumeration<Pair<String,X509Certificate>> issuerCerts = vec.elements();
+                issuerCerts.hasMoreElements(); ) {
+            Pair<String,X509Certificate> issuerCert = issuerCerts.nextElement();
+            PublicKey issuerPubKey = issuerCert.snd.getPublicKey();
             try {
-                certToVerify.verify(issuerPubKey);
+                certToVerify.snd.verify(issuerPubKey);
             } catch (Exception e) {
                 continue;
             }
@@ -3541,10 +3688,11 @@
     /**
      * Stores the (leaf) certificates of a keystore in a hashtable.
      * All certs belonging to the same CA are stored in a vector that
-     * in turn is stored in the hashtable, keyed by the CA's subject DN
+     * in turn is stored in the hashtable, keyed by the CA's subject DN.
+     * Each cert comes with a string label that shows its origin and alias.
      */
     private void keystorecerts2Hashtable(KeyStore ks,
-                Hashtable<Principal, Vector<Certificate>> hash)
+                Hashtable<Principal, Vector<Pair<String,X509Certificate>>> hash)
         throws Exception {
 
         for (Enumeration<String> aliases = ks.aliases();
@@ -3553,13 +3701,20 @@
             Certificate cert = ks.getCertificate(alias);
             if (cert != null) {
                 Principal subjectDN = ((X509Certificate)cert).getSubjectDN();
-                Vector<Certificate> vec = hash.get(subjectDN);
+                Pair<String,X509Certificate> pair = new Pair<>(
+                        String.format(
+                                rb.getString(ks == caks ?
+                                        "alias.in.cacerts" :
+                                        "alias.in.keystore"),
+                                alias),
+                        (X509Certificate)cert);
+                Vector<Pair<String,X509Certificate>> vec = hash.get(subjectDN);
                 if (vec == null) {
-                    vec = new Vector<Certificate>();
-                    vec.addElement(cert);
+                    vec = new Vector<>();
+                    vec.addElement(pair);
                 } else {
-                    if (!vec.contains(cert)) {
-                        vec.addElement(cert);
+                    if (!vec.contains(pair)) {
+                        vec.addElement(pair);
                     }
                 }
                 hash.put(subjectDN, vec);
@@ -4157,6 +4312,81 @@
         return result;
     }
 
+    private boolean isTrustedCert(Certificate cert) throws KeyStoreException {
+        if (caks != null && caks.getCertificateAlias(cert) != null) {
+            return true;
+        } else {
+            String inKS = keyStore.getCertificateAlias(cert);
+            return inKS != null && keyStore.isCertificateEntry(inKS);
+        }
+    }
+
+    private void checkWeak(String label, String sigAlg, Key key) {
+
+        if (sigAlg != null && !DISABLED_CHECK.permits(
+                SIG_PRIMITIVE_SET, sigAlg, null)) {
+            weakWarnings.add(String.format(
+                    rb.getString("whose.sigalg.risk"), label, sigAlg));
+        }
+        if (key != null && !DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, key)) {
+            weakWarnings.add(String.format(
+                    rb.getString("whose.key.risk"),
+                    label,
+                    String.format(rb.getString("key.bit"),
+                            KeyUtil.getKeySize(key), key.getAlgorithm())));
+        }
+    }
+
+    private void checkWeak(String label, Certificate[] certs)
+            throws KeyStoreException {
+        for (int i = 0; i < certs.length; i++) {
+            Certificate cert = certs[i];
+            if (cert instanceof X509Certificate) {
+                X509Certificate xc = (X509Certificate)cert;
+                String fullLabel = label;
+                if (certs.length > 1) {
+                    fullLabel = oneInMany(label, i, certs.length);
+                }
+                checkWeak(fullLabel, xc);
+            }
+        }
+    }
+
+    private void checkWeak(String label, Certificate cert)
+            throws KeyStoreException {
+        if (cert instanceof X509Certificate) {
+            X509Certificate xc = (X509Certificate)cert;
+            // No need to check the sigalg of a trust anchor
+            String sigAlg = isTrustedCert(cert) ? null : xc.getSigAlgName();
+            checkWeak(label, sigAlg, xc.getPublicKey());
+        }
+    }
+
+    private void checkWeak(String label, PKCS10 p10) {
+        checkWeak(label, p10.getSigAlg(), p10.getSubjectPublicKeyInfo());
+    }
+
+    private void checkWeak(String label, CRL crl, Key key) {
+        if (crl instanceof X509CRLImpl) {
+            X509CRLImpl impl = (X509CRLImpl)crl;
+            checkWeak(label, impl.getSigAlgName(), key);
+        }
+    }
+
+    private void printWeakWarnings(boolean newLine) {
+        if (!weakWarnings.isEmpty() && !nowarn) {
+            System.err.println("\nWarning:");
+            for (String warning : weakWarnings) {
+                System.err.println(warning);
+            }
+            if (newLine) {
+                // When calling before a yes/no prompt, add a new line
+                System.err.println();
+            }
+        }
+        weakWarnings.clear();
+    }
+
     /**
      * Prints the usage of this tool.
      */
diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java
index 8ede539..522449c 100644
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java
@@ -360,8 +360,6 @@
         {"Enter.alias.name.", "Enter alias name:  "},
         {".RETURN.if.same.as.for.otherAlias.",
                 "\t(RETURN if same as for <{0}>)"},
-        {".PATTERN.printX509Cert",
-                "Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t SHA1: {5}\n\t SHA256: {6}\nSignature algorithm name: {7}\nSubject Public Key Algorithm: {8} ({9,number,#})\nVersion: {10}"},
         {"What.is.your.first.and.last.name.",
                 "What is your first and last name?"},
         {"What.is.the.name.of.your.organizational.unit.",
@@ -428,16 +426,12 @@
         {"Please.provide.keysize.for.secret.key.generation",
                 "Please provide -keysize for secret key generation"},
 
-        {"verified.by.s.in.s", "Verified by %s in %s"},
         {"warning.not.verified.make.sure.keystore.is.correct",
             "WARNING: not verified. Make sure -keystore is correct."},
 
         {"Extensions.", "Extensions: "},
         {".Empty.value.", "(Empty value)"},
         {"Extension.Request.", "Extension Request:"},
-        {"PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key.",
-                "PKCS #10 Certificate Request (Version 1.0)\n" +
-                "Subject: %s\nPublic Key: %s format %s key\n"},
         {"Unknown.keyUsage.type.", "Unknown keyUsage type: "},
         {"Unknown.extendedkeyUsage.type.", "Unknown extendedkeyUsage type: "},
         {"Unknown.AccessDescription.type.", "Unknown AccessDescription type: "},
@@ -446,7 +440,34 @@
                  "This extension cannot be marked as critical. "},
         {"Odd.number.of.hex.digits.found.", "Odd number of hex digits found: "},
         {"Unknown.extension.type.", "Unknown extension type: "},
-        {"command.{0}.is.ambiguous.", "command {0} is ambiguous:"}
+        {"command.{0}.is.ambiguous.", "command {0} is ambiguous:"},
+
+        // 8171319: keytool should print out warnings when reading or
+        // generating cert/cert req using weak algorithms
+        {"the.certificate.request", "The certificate request"},
+        {"the.issuer", "The issuer"},
+        {"the.generated.certificate", "The generated certificate"},
+        {"the.generated.crl", "The generated CRL"},
+        {"the.generated.certificate.request", "The generated certificate request"},
+        {"the.certificate", "The certificate"},
+        {"the.crl", "The CRL"},
+        {"the.tsa.certificate", "The TSA certificate"},
+        {"the.input", "The input"},
+        {"reply", "Reply"},
+        {"one.in.many", "%s #%d of %d"},
+        {"alias.in.cacerts", "Issuer <%s> in cacerts"},
+        {"alias.in.keystore", "Issuer <%s>"},
+        {"with.weak", "%s (weak)"},
+        {"key.bit", "%d-bit %s key"},
+        {"key.bit.weak", "%d-bit %s key (weak)"},
+        {".PATTERN.printX509Cert.with.weak",
+                "Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t SHA1: {5}\n\t SHA256: {6}\nSignature algorithm name: {7}\nSubject Public Key Algorithm: {8}\nVersion: {9}"},
+        {"PKCS.10.with.weak",
+                "PKCS #10 Certificate Request (Version 1.0)\n" +
+                        "Subject: %s\nFormat: %s\nPublic Key: %s\nSignature algorithm: %s\n"},
+        {"verified.by.s.in.s.weak", "Verified by %s in %s with a %s"},
+        {"whose.sigalg.risk", "%s uses the %s signature algorithm which is considered a security risk."},
+        {"whose.key.risk", "%s uses a %s which is considered a security risk."},
     };
 
 
diff --git a/jdk/src/java.base/share/classes/sun/security/util/CertConstraintParameters.java b/jdk/src/java.base/share/classes/sun/security/util/CertConstraintParameters.java
deleted file mode 100644
index 23880f7..0000000
--- a/jdk/src/java.base/share/classes/sun/security/util/CertConstraintParameters.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.util;
-
-import java.security.Timestamp;
-import java.security.cert.X509Certificate;
-import java.util.Date;
-
-/**
- * This class is a wrapper for keeping state and passing objects between PKIX,
- * AlgorithmChecker, and DisabledAlgorithmConstraints.
- */
-public class CertConstraintParameters {
-    // A certificate being passed to check against constraints.
-    private final X509Certificate cert;
-    // This is true if the trust anchor in the certificate chain matches a cert
-    // in AnchorCertificates
-    private final boolean trustedMatch;
-    // PKIXParameter date
-    private final Date pkixDate;
-    // Timestamp of the signed JAR file
-    private final Timestamp jarTimestamp;
-
-    public CertConstraintParameters(X509Certificate c, boolean match,
-            Date pkixdate, Timestamp jarTime) {
-        cert = c;
-        trustedMatch = match;
-        pkixDate = pkixdate;
-        jarTimestamp = jarTime;
-    }
-
-    public CertConstraintParameters(X509Certificate c) {
-        this(c, false, null, null);
-    }
-
-    // Returns if the trust anchor has a match if anchor checking is enabled.
-    public boolean isTrustedMatch() {
-        return trustedMatch;
-    }
-
-    public X509Certificate getCertificate() {
-        return cert;
-    }
-
-    public Date getPKIXParamDate() {
-        return pkixDate;
-    }
-
-    public Timestamp getJARTimestamp() {
-        return jarTimestamp;
-    }
-
-}
diff --git a/jdk/src/java.base/share/classes/sun/security/util/ConstraintsParameters.java b/jdk/src/java.base/share/classes/sun/security/util/ConstraintsParameters.java
new file mode 100644
index 0000000..8431865
--- /dev/null
+++ b/jdk/src/java.base/share/classes/sun/security/util/ConstraintsParameters.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.util;
+
+import sun.security.validator.Validator;
+
+import java.security.AlgorithmParameters;
+import java.security.Key;
+import java.security.Timestamp;
+import java.security.cert.X509Certificate;
+import java.util.Date;
+
+/**
+ * This class contains parameters for checking against constraints that extend
+ * past the publicly available parameters in java.security.AlgorithmConstraints.
+
+ * This is currently on passed between  between PKIX, AlgorithmChecker,
+ * and DisabledAlgorithmConstraints.
+ */
+public class ConstraintsParameters {
+    /*
+     * The below 3 values are used the same as the permit() methods
+     * published in java.security.AlgorithmConstraints.
+     */
+    // Algorithm string to be checked against constraints
+    private final String algorithm;
+    // AlgorithmParameters to the algorithm being checked
+    private final AlgorithmParameters algParams;
+    // Public Key being checked against constraints
+    private final Key publicKey;
+
+    /*
+     * New values that are checked against constraints that the current public
+     * API does not support.
+     */
+    // A certificate being passed to check against constraints.
+    private final X509Certificate cert;
+    // This is true if the trust anchor in the certificate chain matches a cert
+    // in AnchorCertificates
+    private final boolean trustedMatch;
+    // PKIXParameter date
+    private final Date pkixDate;
+    // Timestamp of the signed JAR file
+    private final Timestamp jarTimestamp;
+    private final String variant;
+
+    public ConstraintsParameters(X509Certificate c, boolean match,
+            Date pkixdate, Timestamp jarTime, String variant) {
+        cert = c;
+        trustedMatch = match;
+        pkixDate = pkixdate;
+        jarTimestamp = jarTime;
+        this.variant = (variant == null ? Validator.VAR_GENERIC : variant);
+        algorithm = null;
+        algParams = null;
+        publicKey = null;
+    }
+
+    public ConstraintsParameters(String algorithm, AlgorithmParameters params,
+            Key key, String variant) {
+        this.algorithm = algorithm;
+        algParams = params;
+        this.publicKey = key;
+        cert = null;
+        trustedMatch = false;
+        pkixDate = null;
+        jarTimestamp = null;
+        this.variant = (variant == null ? Validator.VAR_GENERIC : variant);
+    }
+
+
+    public ConstraintsParameters(X509Certificate c) {
+        this(c, false, null, null,
+                Validator.VAR_GENERIC);
+    }
+
+    public ConstraintsParameters(Timestamp jarTime) {
+        this(null, false, null, jarTime, Validator.VAR_GENERIC);
+    }
+
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+    public AlgorithmParameters getAlgParams() {
+        return algParams;
+    }
+
+    public Key getPublicKey() {
+        return publicKey;
+    }
+    // Returns if the trust anchor has a match if anchor checking is enabled.
+    public boolean isTrustedMatch() {
+        return trustedMatch;
+    }
+
+    public X509Certificate getCertificate() {
+        return cert;
+    }
+
+    public Date getPKIXParamDate() {
+        return pkixDate;
+    }
+
+    public Timestamp getJARTimestamp() {
+        return jarTimestamp;
+    }
+
+    public String getVariant() {
+        return variant;
+    }
+}
diff --git a/jdk/src/java.base/share/classes/sun/security/util/DerInputBuffer.java b/jdk/src/java.base/share/classes/sun/security/util/DerInputBuffer.java
index 1e56002..54eade3 100644
--- a/jdk/src/java.base/share/classes/sun/security/util/DerInputBuffer.java
+++ b/jdk/src/java.base/share/classes/sun/security/util/DerInputBuffer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,16 +44,26 @@
  */
 class DerInputBuffer extends ByteArrayInputStream implements Cloneable {
 
-    DerInputBuffer(byte[] buf) { super(buf); }
+    boolean allowBER = true;
 
-    DerInputBuffer(byte[] buf, int offset, int len) {
+    // used by sun/security/util/DerInputBuffer/DerInputBufferEqualsHashCode.java
+    DerInputBuffer(byte[] buf) {
+        this(buf, true);
+    }
+
+    DerInputBuffer(byte[] buf, boolean allowBER) {
+        super(buf);
+        this.allowBER = allowBER;
+    }
+
+    DerInputBuffer(byte[] buf, int offset, int len, boolean allowBER) {
         super(buf, offset, len);
+        this.allowBER = allowBER;
     }
 
     DerInputBuffer dup() {
         try {
             DerInputBuffer retval = (DerInputBuffer)clone();
-
             retval.mark(Integer.MAX_VALUE);
             return retval;
         } catch (CloneNotSupportedException e) {
@@ -147,8 +157,8 @@
         System.arraycopy(buf, pos, bytes, 0, len);
         skip(len);
 
-        // check to make sure no extra leading 0s for DER
-        if (len >= 2 && (bytes[0] == 0) && (bytes[1] >= 0)) {
+        // BER allows leading 0s but DER does not
+        if (!allowBER && (len >= 2 && (bytes[0] == 0) && (bytes[1] >= 0))) {
             throw new IOException("Invalid encoding: redundant leading 0s");
         }
 
diff --git a/jdk/src/java.base/share/classes/sun/security/util/DerInputStream.java b/jdk/src/java.base/share/classes/sun/security/util/DerInputStream.java
index 94c9085..d8498c7 100644
--- a/jdk/src/java.base/share/classes/sun/security/util/DerInputStream.java
+++ b/jdk/src/java.base/share/classes/sun/security/util/DerInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -81,6 +81,25 @@
     }
 
     /**
+     * Create a DER input stream from part of a data buffer with
+     * additional arg to control whether DER checks are enforced.
+     * The buffer is not copied, it is shared.  Accordingly, the
+     * buffer should be treated as read-only.
+     *
+     * @param data the buffer from which to create the string (CONSUMED)
+     * @param offset the first index of <em>data</em> which will
+     *          be read as DER input in the new stream
+     * @param len how long a chunk of the buffer to use,
+     *          starting at "offset"
+     * @param allowBER whether to allow constructed indefinite-length
+     *          encoding as well as tolerate leading 0s
+     */
+    public DerInputStream(byte[] data, int offset, int len,
+        boolean allowBER) throws IOException {
+        init(data, offset, len, allowBER);
+    }
+
+    /**
      * Create a DER input stream from part of a data buffer.
      * The buffer is not copied, it is shared.  Accordingly, the
      * buffer should be treated as read-only.
@@ -95,47 +114,27 @@
         init(data, offset, len, true);
     }
 
-    /**
-     * Create a DER input stream from part of a data buffer with
-     * additional arg to indicate whether to allow constructed
-     * indefinite-length encoding.
-     * The buffer is not copied, it is shared.  Accordingly, the
-     * buffer should be treated as read-only.
-     *
-     * @param data the buffer from which to create the string (CONSUMED)
-     * @param offset the first index of <em>data</em> which will
-     *          be read as DER input in the new stream
-     * @param len how long a chunk of the buffer to use,
-     *          starting at "offset"
-     * @param allowIndefiniteLength whether to allow constructed
-     *          indefinite-length encoding
-     */
-    public DerInputStream(byte[] data, int offset, int len,
-        boolean allowIndefiniteLength) throws IOException {
-        init(data, offset, len, allowIndefiniteLength);
-    }
-
     /*
      * private helper routine
      */
-    private void init(byte[] data, int offset, int len,
-        boolean allowIndefiniteLength) throws IOException {
+    private void init(byte[] data, int offset, int len, boolean allowBER) throws IOException {
         if ((offset+2 > data.length) || (offset+len > data.length)) {
             throw new IOException("Encoding bytes too short");
         }
         // check for indefinite length encoding
         if (DerIndefLenConverter.isIndefinite(data[offset+1])) {
-            if (!allowIndefiniteLength) {
+            if (!allowBER) {
                 throw new IOException("Indefinite length BER encoding found");
             } else {
                 byte[] inData = new byte[len];
                 System.arraycopy(data, offset, inData, 0, len);
 
                 DerIndefLenConverter derIn = new DerIndefLenConverter();
-                buffer = new DerInputBuffer(derIn.convert(inData));
+                buffer = new DerInputBuffer(derIn.convert(inData), allowBER);
             }
-        } else
-            buffer = new DerInputBuffer(data, offset, len);
+        } else {
+            buffer = new DerInputBuffer(data, offset, len, allowBER);
+        }
         buffer.mark(Integer.MAX_VALUE);
     }
 
@@ -156,7 +155,7 @@
      */
     public DerInputStream subStream(int len, boolean do_skip)
     throws IOException {
-        DerInputBuffer  newbuf = buffer.dup();
+        DerInputBuffer newbuf = buffer.dup();
 
         newbuf.truncate(len);
         if (do_skip) {
@@ -399,7 +398,8 @@
            dis.readFully(indefData, offset, readLen);
            dis.close();
            DerIndefLenConverter derIn = new DerIndefLenConverter();
-           buffer = new DerInputBuffer(derIn.convert(indefData));
+           buffer = new DerInputBuffer(derIn.convert(indefData), buffer.allowBER);
+
            if (tag != buffer.read())
                 throw new IOException("Indefinite length encoding" +
                         " not supported");
@@ -427,7 +427,7 @@
         DerValue value;
 
         do {
-            value = new DerValue(newstr.buffer);
+            value = new DerValue(newstr.buffer, buffer.allowBER);
             vec.addElement(value);
         } while (newstr.available() > 0);
 
diff --git a/jdk/src/java.base/share/classes/sun/security/util/DerValue.java b/jdk/src/java.base/share/classes/sun/security/util/DerValue.java
index b47064a..4f48cdc 100644
--- a/jdk/src/java.base/share/classes/sun/security/util/DerValue.java
+++ b/jdk/src/java.base/share/classes/sun/security/util/DerValue.java
@@ -1,5 +1,5 @@
-/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+/**
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -225,6 +225,16 @@
         data = init(stringTag, value);
     }
 
+    // Creates a DerValue from a tag and some DER-encoded data w/ additional
+    // arg to control whether DER checks are enforced.
+    DerValue(byte tag, byte[] data, boolean allowBER) {
+        this.tag = tag;
+        buffer = new DerInputBuffer(data.clone(), allowBER);
+        length = data.length;
+        this.data = new DerInputStream(buffer);
+        this.data.mark(Integer.MAX_VALUE);
+    }
+
     /**
      * Creates a DerValue from a tag and some DER-encoded data.
      *
@@ -232,20 +242,16 @@
      * @param data the DER-encoded data
      */
     public DerValue(byte tag, byte[] data) {
-        this.tag = tag;
-        buffer = new DerInputBuffer(data.clone());
-        length = data.length;
-        this.data = new DerInputStream(buffer);
-        this.data.mark(Integer.MAX_VALUE);
+        this(tag, data, true);
     }
 
     /*
      * package private
      */
     DerValue(DerInputBuffer in) throws IOException {
+
         // XXX must also parse BER-encoded constructed
         // values such as sequences, sets...
-
         tag = (byte)in.read();
         byte lenByte = (byte)in.read();
         length = DerInputStream.getLength(lenByte, in);
@@ -260,7 +266,7 @@
             dis.readFully(indefData, offset, readLen);
             dis.close();
             DerIndefLenConverter derIn = new DerIndefLenConverter();
-            inbuf = new DerInputBuffer(derIn.convert(indefData));
+            inbuf = new DerInputBuffer(derIn.convert(indefData), in.allowBER);
             if (tag != inbuf.read())
                 throw new IOException
                         ("Indefinite length encoding not supported");
@@ -282,6 +288,12 @@
         }
     }
 
+    // Get an ASN.1/DER encoded datum from a buffer w/ additional
+    // arg to control whether DER checks are enforced.
+    DerValue(byte[] buf, boolean allowBER) throws IOException {
+        data = init(true, new ByteArrayInputStream(buf), allowBER);
+    }
+
     /**
      * Get an ASN.1/DER encoded datum from a buffer.  The
      * entire buffer must hold exactly one datum, including
@@ -290,7 +302,14 @@
      * @param buf buffer holding a single DER-encoded datum.
      */
     public DerValue(byte[] buf) throws IOException {
-        data = init(true, new ByteArrayInputStream(buf));
+        this(buf, true);
+    }
+
+    // Get an ASN.1/DER encoded datum from part of a buffer w/ additional
+    // arg to control whether DER checks are enforced.
+    DerValue(byte[] buf, int offset, int len, boolean allowBER)
+        throws IOException {
+        data = init(true, new ByteArrayInputStream(buf, offset, len), allowBER);
     }
 
     /**
@@ -303,7 +322,13 @@
      * @param len how many bytes are in the encoded datum
      */
     public DerValue(byte[] buf, int offset, int len) throws IOException {
-        data = init(true, new ByteArrayInputStream(buf, offset, len));
+        this(buf, offset, len, true);
+    }
+
+    // Get an ASN1/DER encoded datum from an input stream w/ additional
+    // arg to control whether DER checks are enforced.
+    DerValue(InputStream in, boolean allowBER) throws IOException {
+        data = init(false, in, allowBER);
     }
 
     /**
@@ -316,10 +341,11 @@
      *  which may be followed by additional data
      */
     public DerValue(InputStream in) throws IOException {
-        data = init(false, in);
+        this(in, true);
     }
 
-    private DerInputStream init(byte stringTag, String value) throws IOException {
+    private DerInputStream init(byte stringTag, String value)
+        throws IOException {
         String enc = null;
 
         tag = stringTag;
@@ -347,7 +373,7 @@
 
         byte[] buf = value.getBytes(enc);
         length = buf.length;
-        buffer = new DerInputBuffer(buf);
+        buffer = new DerInputBuffer(buf, true);
         DerInputStream result = new DerInputStream(buffer);
         result.mark(Integer.MAX_VALUE);
         return result;
@@ -356,8 +382,8 @@
     /*
      * helper routine
      */
-    private DerInputStream init(boolean fullyBuffered, InputStream in)
-            throws IOException {
+    private DerInputStream init(boolean fullyBuffered, InputStream in,
+        boolean allowBER) throws IOException {
 
         tag = (byte)in.read();
         byte lenByte = (byte)in.read();
@@ -384,7 +410,7 @@
 
         byte[] bytes = IOUtils.readFully(in, length, true);
 
-        buffer = new DerInputBuffer(bytes);
+        buffer = new DerInputBuffer(bytes, allowBER);
         return new DerInputStream(buffer);
     }
 
@@ -479,7 +505,8 @@
         if (buffer.read(bytes) != length)
             throw new IOException("short read on DerValue buffer");
         if (isConstructed()) {
-            DerInputStream in = new DerInputStream(bytes);
+            DerInputStream in = new DerInputStream(bytes, 0, bytes.length,
+                buffer.allowBER);
             bytes = null;
             while (in.available() != 0) {
                 bytes = append(bytes, in.getOctetString());
diff --git a/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java b/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
index 73914fe..9051b39 100644
--- a/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
+++ b/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,10 @@
 
 package sun.security.util;
 
+import sun.security.validator.Validator;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
 import java.security.CryptoPrimitive;
 import java.security.AlgorithmParameters;
 import java.security.Key;
@@ -32,10 +36,12 @@
 import java.security.cert.CertPathValidatorException.BasicReason;
 import java.security.cert.X509Certificate;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
@@ -100,12 +106,6 @@
     @Override
     public final boolean permits(Set<CryptoPrimitive> primitives,
             String algorithm, AlgorithmParameters parameters) {
-
-        if (primitives == null || primitives.isEmpty()) {
-            throw new IllegalArgumentException(
-                        "No cryptographic primitive specified");
-        }
-
         return checkAlgorithm(disabledAlgorithms, algorithm, decomposer);
     }
 
@@ -133,6 +133,18 @@
         return checkConstraints(primitives, algorithm, key, parameters);
     }
 
+    public final void permits(ConstraintsParameters cp)
+            throws CertPathValidatorException {
+        permits(cp.getAlgorithm(), cp);
+    }
+
+    public final void permits(String algorithm, Key key,
+            AlgorithmParameters params, String variant)
+            throws CertPathValidatorException {
+        permits(algorithm, new ConstraintsParameters(algorithm, params, key,
+                (variant == null) ? Validator.VAR_GENERIC : variant));
+    }
+
     /*
      * Check if a x509Certificate object is permitted.  Check if all
      * algorithms are allowed, certificate constraints, and the
@@ -140,18 +152,10 @@
      *
      * Uses new style permit() which throws exceptions.
      */
-    public final void permits(Set<CryptoPrimitive> primitives,
-            CertConstraintParameters cp) throws CertPathValidatorException {
-        checkConstraints(primitives, cp);
-    }
 
-    /*
-     * Check if Certificate object is within the constraints.
-     * Uses new style permit() which throws exceptions.
-     */
-    public final void permits(Set<CryptoPrimitive> primitives,
-            X509Certificate cert) throws CertPathValidatorException {
-        checkConstraints(primitives, new CertConstraintParameters(cert));
+    public final void permits(String algorithm, ConstraintsParameters cp)
+            throws CertPathValidatorException {
+        algorithmConstraints.permits(algorithm, cp);
     }
 
     // Check if a string is contained inside the property
@@ -174,7 +178,7 @@
             throw new IllegalArgumentException("The key cannot be null");
         }
 
-        // check the signature algorithm
+        // check the signature algorithm with parameters
         if (algorithm != null && algorithm.length() != 0) {
             if (!permits(primitives, algorithm, parameters)) {
                 return false;
@@ -190,36 +194,6 @@
         return algorithmConstraints.permits(key);
     }
 
-    /*
-     * Check algorithm constraints with Certificate
-     * Uses new style permit() which throws exceptions.
-     */
-    private void checkConstraints(Set<CryptoPrimitive> primitives,
-            CertConstraintParameters cp) throws CertPathValidatorException {
-
-        X509Certificate cert = cp.getCertificate();
-        String algorithm = cert.getSigAlgName();
-
-        // Check signature algorithm is not disabled
-        if (!permits(primitives, algorithm, null)) {
-            throw new CertPathValidatorException(
-                    "Algorithm constraints check failed on disabled "+
-                            "signature algorithm: " + algorithm,
-                    null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
-        }
-
-        // Check key algorithm is not disabled
-        if (!permits(primitives, cert.getPublicKey().getAlgorithm(), null)) {
-            throw new CertPathValidatorException(
-                    "Algorithm constraints check failed on disabled "+
-                            "public key algorithm: " + algorithm,
-                    null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
-        }
-
-        // Check the certificate and key constraints
-        algorithmConstraints.permits(cp);
-
-    }
 
     /**
      * Key and Certificate Constraints
@@ -234,13 +208,13 @@
      * 'true' means the operation is allowed.
      * 'false' means it failed the constraints and is disallowed.
      *
-     * When passing CertConstraintParameters through permit(), an exception
+     * When passing ConstraintsParameters through permit(), an exception
      * will be thrown on a failure to better identify why the operation was
      * disallowed.
      */
 
     private static class Constraints {
-        private Map<String, Set<Constraint>> constraintsMap = new HashMap<>();
+        private Map<String, List<Constraint>> constraintsMap = new HashMap<>();
 
         private static class Holder {
             private static final Pattern DENY_AFTER_PATTERN = Pattern.compile(
@@ -260,23 +234,22 @@
 
                 // Check if constraint is a complete disabling of an
                 // algorithm or has conditions.
-                String algorithm;
-                String policy;
                 int space = constraintEntry.indexOf(' ');
-                if (space > 0) {
-                    algorithm = AlgorithmDecomposer.hashName(
-                            constraintEntry.substring(0, space).
-                                    toUpperCase(Locale.ENGLISH));
-                    policy = constraintEntry.substring(space + 1);
-                } else {
-                    algorithm = constraintEntry.toUpperCase(Locale.ENGLISH);
-                    if (!constraintsMap.containsKey(algorithm)) {
-                        constraintsMap.putIfAbsent(algorithm,
-                                new HashSet<>());
-                    }
+                String algorithm = AlgorithmDecomposer.hashName(
+                        ((space > 0 ? constraintEntry.substring(0, space) :
+                                constraintEntry).
+                                toUpperCase(Locale.ENGLISH)));
+                List<Constraint> constraintList =
+                        constraintsMap.getOrDefault(algorithm,
+                                new ArrayList<>(1));
+                constraintsMap.putIfAbsent(algorithm, constraintList);
+                if (space <= 0) {
+                    constraintList.add(new DisabledConstraint(algorithm));
                     continue;
                 }
 
+                String policy = constraintEntry.substring(space + 1);
+
                 // Convert constraint conditions into Constraint classes
                 Constraint c, lastConstraint = null;
                 // Allow only one jdkCA entry per constraint entry
@@ -315,7 +288,7 @@
                         c = new jdkCAConstraint(algorithm);
                         jdkCALimit = true;
 
-                    } else if(entry.startsWith("denyAfter") &&
+                    } else if (entry.startsWith("denyAfter") &&
                             (matcher = Holder.DENY_AFTER_PATTERN.matcher(entry))
                                     .matches()) {
                         if (debug != null) {
@@ -332,6 +305,12 @@
                         c = new DenyAfterConstraint(algorithm, year, month,
                                 day);
                         denyAfterLimit = true;
+                    } else if (entry.startsWith("usage")) {
+                        String s[] = (entry.substring(5)).trim().split(" ");
+                        c = new UsageConstraint(algorithm, s);
+                        if (debug != null) {
+                            debug.println("Constraints usage length is " + s.length);
+                        }
                     } else {
                         throw new IllegalArgumentException("Error in security" +
                                 " property. Constraint unknown: " + entry);
@@ -340,11 +319,7 @@
                     // Link multiple conditions for a single constraint
                     // into a linked list.
                     if (lastConstraint == null) {
-                        if (!constraintsMap.containsKey(algorithm)) {
-                            constraintsMap.putIfAbsent(algorithm,
-                                    new HashSet<>());
-                        }
-                        constraintsMap.get(algorithm).add(c);
+                        constraintList.add(c);
                     } else {
                         lastConstraint.nextConstraint = c;
                     }
@@ -354,17 +329,17 @@
         }
 
         // Get applicable constraints based off the signature algorithm
-        private Set<Constraint> getConstraints(String algorithm) {
+        private List<Constraint> getConstraints(String algorithm) {
             return constraintsMap.get(algorithm);
         }
 
         // Check if KeySizeConstraints permit the specified key
         public boolean permits(Key key) {
-            Set<Constraint> set = getConstraints(key.getAlgorithm());
-            if (set == null) {
+            List<Constraint> list = getConstraints(key.getAlgorithm());
+            if (list == null) {
                 return true;
             }
-            for (Constraint constraint : set) {
+            for (Constraint constraint : list) {
                 if (!constraint.permits(key)) {
                     if (debug != null) {
                         debug.println("keySizeConstraint: failed key " +
@@ -377,31 +352,35 @@
         }
 
         // Check if constraints permit this cert.
-        public void permits(CertConstraintParameters cp)
+        public void permits(String algorithm, ConstraintsParameters cp)
                 throws CertPathValidatorException {
             X509Certificate cert = cp.getCertificate();
 
             if (debug != null) {
-                debug.println("Constraints.permits(): " + cert.getSigAlgName());
+                debug.println("Constraints.permits(): " + algorithm +
+                        " Variant: " + cp.getVariant());
             }
 
             // Get all signature algorithms to check for constraints
-            Set<String> algorithms =
-                    AlgorithmDecomposer.decomposeOneHash(cert.getSigAlgName());
-            if (algorithms == null || algorithms.isEmpty()) {
-                return;
+            Set<String> algorithms = new HashSet<>();
+            if (algorithm != null) {
+                algorithms.addAll(AlgorithmDecomposer.decomposeOneHash(algorithm));
             }
 
-            // Attempt to add the public key algorithm to the set
-            algorithms.add(cert.getPublicKey().getAlgorithm());
-
+            // Attempt to add the public key algorithm if cert provided
+            if (cert != null) {
+                algorithms.add(cert.getPublicKey().getAlgorithm());
+            }
+            if (cp.getPublicKey() != null) {
+                algorithms.add(cp.getPublicKey().getAlgorithm());
+            }
             // Check all applicable constraints
-            for (String algorithm : algorithms) {
-                Set<Constraint> set = getConstraints(algorithm);
-                if (set == null) {
+            for (String alg : algorithms) {
+                List<Constraint> list = getConstraints(alg);
+                if (list == null) {
                     continue;
                 }
-                for (Constraint constraint : set) {
+                for (Constraint constraint : list) {
                     constraint.permits(cp);
                 }
             }
@@ -467,17 +446,17 @@
 
         /**
          * Check if an algorithm constraint is permitted with a given
-         * CertConstraintParameters.
+         * ConstraintsParameters.
          *
          * If the check inside of {@code permits()} fails, it must call
-         * {@code next()} with the same {@code CertConstraintParameters}
+         * {@code next()} with the same {@code ConstraintsParameters}
          * parameter passed if multiple constraints need to be checked.
          *
          * @param cp CertConstraintParameter containing certificate info
          * @throws CertPathValidatorException if constraint disallows.
          *
          */
-        public abstract void permits(CertConstraintParameters cp)
+        public abstract void permits(ConstraintsParameters cp)
                 throws CertPathValidatorException;
 
         /**
@@ -491,12 +470,12 @@
          * were disallowed, the last constraint will throw
          * {@code CertPathValidatorException}.
          *
-         * @param cp CertConstraintParameters
+         * @param cp ConstraintsParameters
          * @return 'true' if constraint allows the operation, 'false' if
          * we are at the end of the constraint list or,
          * {@code nextConstraint} is null.
          */
-        boolean next(CertConstraintParameters cp)
+        boolean next(ConstraintsParameters cp)
                 throws CertPathValidatorException {
             if (nextConstraint != null) {
                 nextConstraint.permits(cp);
@@ -525,6 +504,14 @@
             }
             return false;
         }
+
+        String extendedMsg(ConstraintsParameters cp) {
+            return (cp.getCertificate() == null ? "." :
+                    " used with certificate: " +
+                            cp.getCertificate().getSubjectX500Principal() +
+                    (cp.getVariant() != Validator.VAR_GENERIC ?
+                            ".  Usage was " + cp.getVariant() : "."));
+        }
     }
 
     /*
@@ -537,11 +524,11 @@
         }
 
         /*
-         * Check if CertConstraintParameters has a trusted match, if it does
+         * Check if ConstraintsParameters has a trusted match, if it does
          * call next() for any following constraints. If it does not, exit
          * as this constraint(s) does not restrict the operation.
          */
-        public void permits(CertConstraintParameters cp)
+        public void permits(ConstraintsParameters cp)
                 throws CertPathValidatorException {
             if (debug != null) {
                 debug.println("jdkCAConstraints.permits(): " + algorithm);
@@ -554,8 +541,7 @@
                 }
                 throw new CertPathValidatorException(
                         "Algorithm constraints check failed on certificate " +
-                                "anchor limits. " + algorithm + " used with " +
-                                cp.getCertificate().getSubjectX500Principal(),
+                        "anchor limits. " + algorithm + extendedMsg(cp),
                         null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
             }
         }
@@ -615,7 +601,7 @@
           * constraints. Throw an exception if this is the last constraint.
           */
          @Override
-         public void permits(CertConstraintParameters cp)
+         public void permits(ConstraintsParameters cp)
                  throws CertPathValidatorException {
              Date currentDate;
              String errmsg;
@@ -628,7 +614,7 @@
                  errmsg = "PKIXParameter date: ";
              } else {
                  currentDate = new Date();
-                 errmsg = "Certificate date: ";
+                 errmsg = "Current date: ";
              }
 
              if (!denyAfterDate.after(currentDate)) {
@@ -637,9 +623,9 @@
                  }
                  throw new CertPathValidatorException(
                          "denyAfter constraint check failed: " + algorithm +
-                                 " used with Constraint date: " +
-                                 dateFormat.format(denyAfterDate) + "; "
-                                 + errmsg + dateFormat.format(currentDate),
+                         " used with Constraint date: " +
+                         dateFormat.format(denyAfterDate) + "; " + errmsg +
+                         dateFormat.format(currentDate) + extendedMsg(cp),
                          null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
              }
          }
@@ -661,6 +647,54 @@
      }
 
     /*
+     * The usage constraint is for the "usage" keyword.  It checks against the
+     * variant value in ConstraintsParameters.
+     */
+    private static class UsageConstraint extends Constraint {
+        String[] usages;
+
+        UsageConstraint(String algorithm, String[] usages) {
+            this.algorithm = algorithm;
+            this.usages = usages;
+        }
+
+        public void permits(ConstraintsParameters cp)
+                throws CertPathValidatorException {
+            for (String usage : usages) {
+
+                String v = null;
+                if (usage.compareToIgnoreCase("TLSServer") == 0) {
+                    v = Validator.VAR_TLS_SERVER;
+                } else if (usage.compareToIgnoreCase("TLSClient") == 0) {
+                    v = Validator.VAR_TLS_CLIENT;
+                } else if (usage.compareToIgnoreCase("SignedJAR") == 0) {
+                    v = Validator.VAR_PLUGIN_CODE_SIGNING;
+                }
+
+                if (debug != null) {
+                    debug.println("Checking if usage constraint \"" + v +
+                            "\" matches \"" + cp.getVariant() + "\"");
+                    // Because usage checking can come from many places
+                    // a stack trace is very helpful.
+                    ByteArrayOutputStream ba = new ByteArrayOutputStream();
+                    PrintStream ps = new PrintStream(ba);
+                    (new Exception()).printStackTrace(ps);
+                    debug.println(ba.toString());
+                }
+                if (cp.getVariant().compareTo(v) == 0) {
+                    if (next(cp)) {
+                        return;
+                    }
+                    throw new CertPathValidatorException("Usage constraint " +
+                            usage + " check failed: " + algorithm +
+                            extendedMsg(cp),
+                            null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
+                }
+            }
+        }
+    }
+
+    /*
      * This class contains constraints dealing with the key size
      * support limits per algorithm.   e.g.  "keySize <= 1024"
      */
@@ -713,17 +747,22 @@
          * constraint  Any permitted constraint will exit the linked list
          * to allow the operation.
          */
-        public void permits(CertConstraintParameters cp)
+        public void permits(ConstraintsParameters cp)
                 throws CertPathValidatorException {
-            if (!permitsImpl(cp.getCertificate().getPublicKey())) {
+            Key key = null;
+            if (cp.getPublicKey() != null) {
+                key = cp.getPublicKey();
+            } else if (cp.getCertificate() != null) {
+                key = cp.getCertificate().getPublicKey();
+            }
+            if (key != null && !permitsImpl(key)) {
                 if (nextConstraint != null) {
                     nextConstraint.permits(cp);
                     return;
                 }
                 throw new CertPathValidatorException(
                         "Algorithm constraints check failed on keysize limits. "
-                                + algorithm + " " + size + "bit key used with "
-                                + cp.getCertificate().getSubjectX500Principal(),
+                        + algorithm + " " + size + "bit key" + extendedMsg(cp),
                         null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
             }
         }
@@ -762,5 +801,26 @@
             return true;
         }
     }
+
+    /*
+     * This constraint is used for the complete disabling of the algorithm.
+     */
+    private static class DisabledConstraint extends Constraint {
+        DisabledConstraint(String algo) {
+            algorithm = algo;
+        }
+
+        public void permits(ConstraintsParameters cp)
+                throws CertPathValidatorException {
+            throw new CertPathValidatorException(
+                    "Algorithm constraints check failed on disabled " +
+                            "algorithm: " + algorithm + extendedMsg(cp),
+                    null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
+        }
+
+        public boolean permits(Key key) {
+            return false;
+        }
+    }
 }
 
diff --git a/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java b/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java
index f8022c5..0663f05 100644
--- a/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java
+++ b/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,25 +28,23 @@
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.security.CodeSigner;
-import java.security.CryptoPrimitive;
+import java.security.GeneralSecurityException;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.SignatureException;
+import java.security.Timestamp;
 import java.security.cert.CertPath;
 import java.security.cert.X509Certificate;
 import java.security.cert.CertificateException;
 import java.security.cert.CertificateFactory;
 import java.util.ArrayList;
 import java.util.Base64;
-import java.util.Collections;
-import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Set;
 import java.util.jar.Attributes;
 import java.util.jar.JarException;
 import java.util.jar.JarFile;
@@ -61,9 +59,6 @@
     /* Are we debugging ? */
     private static final Debug debug = Debug.getInstance("jar");
 
-    private static final Set<CryptoPrimitive> DIGEST_PRIMITIVE_SET =
-            Collections.unmodifiableSet(EnumSet.of(CryptoPrimitive.MESSAGE_DIGEST));
-
     private static final DisabledAlgorithmConstraints JAR_DISABLED_CHECK =
             new DisabledAlgorithmConstraints(
                     DisabledAlgorithmConstraints.PROPERTY_JAR_DISABLED_ALGS);
@@ -97,6 +92,14 @@
     /* for generating certpath objects */
     private CertificateFactory certificateFactory = null;
 
+    /** Algorithms that have been checked if they are weak. */
+    private Map<String, Boolean> permittedAlgs= new HashMap<>();
+
+    /** TSA timestamp of signed jar.  The newest timestamp is used.  If there
+     *  was no TSA timestamp used when signed, current time is used ("null").
+     */
+    private Timestamp timestamp = null;
+
     /**
      * Create the named SignatureFileVerifier.
      *
@@ -222,15 +225,8 @@
 
     /** get digest from cache */
 
-    private MessageDigest getDigest(String algorithm) throws SignatureException {
-        // check that algorithm is not restricted
-        if (!JAR_DISABLED_CHECK.permits(DIGEST_PRIMITIVE_SET, algorithm, null)) {
-            SignatureException e =
-                    new SignatureException("SignatureFile check failed. " +
-                            "Disabled algorithm used: " + algorithm);
-            throw e;
-        }
-
+    private MessageDigest getDigest(String algorithm)
+            throws SignatureException {
         if (createdDigests == null)
             createdDigests = new HashMap<>();
 
@@ -302,6 +298,27 @@
         if (newSigners == null)
             return;
 
+        /*
+         * Look for the latest timestamp in the signature block.  If an entry
+         * has no timestamp, use current time (aka null).
+         */
+        for (CodeSigner s: newSigners) {
+            if (debug != null) {
+                debug.println("Gathering timestamp for:  " + s.toString());
+            }
+            if (s.getTimestamp() == null) {
+                timestamp = null;
+                break;
+            } else if (timestamp == null) {
+                timestamp = s.getTimestamp();
+            } else {
+                if (timestamp.getTimestamp().before(
+                        s.getTimestamp().getTimestamp())) {
+                    timestamp = s.getTimestamp();
+                }
+            }
+        }
+
         Iterator<Map.Entry<String,Attributes>> entries =
                                 sf.getEntries().entrySet().iterator();
 
@@ -345,6 +362,68 @@
     }
 
     /**
+     * Check if algorithm is permitted using the permittedAlgs Map.
+     * If the algorithm is not in the map, check against disabled algorithms and
+     * store the result. If the algorithm is in the map use that result.
+     * False is returned for weak algorithm, true for good algorithms.
+     */
+    boolean permittedCheck(String key, String algorithm) {
+        Boolean permitted = permittedAlgs.get(algorithm);
+        if (permitted == null) {
+            try {
+                JAR_DISABLED_CHECK.permits(algorithm,
+                        new ConstraintsParameters(timestamp));
+            } catch(GeneralSecurityException e) {
+                permittedAlgs.put(algorithm, Boolean.FALSE);
+                permittedAlgs.put(key.toUpperCase(), Boolean.FALSE);
+                if (debug != null) {
+                    if (e.getMessage() != null) {
+                        debug.println(key + ":  " + e.getMessage());
+                    } else {
+                        debug.println(key + ":  " + algorithm +
+                                " was disabled, no exception msg given.");
+                        e.printStackTrace();
+                    }
+                }
+                return false;
+            }
+
+            permittedAlgs.put(algorithm, Boolean.TRUE);
+            return true;
+        }
+
+        // Algorithm has already been checked, return the value from map.
+        return permitted.booleanValue();
+    }
+
+    /**
+     * With a given header (*-DIGEST*), return a string that lists all the
+     * algorithms associated with the header.
+     * If there are none, return "Unknown Algorithm".
+     */
+    String getWeakAlgorithms(String header) {
+        String w = "";
+        try {
+            for (String key : permittedAlgs.keySet()) {
+                if (key.endsWith(header)) {
+                    w += key.substring(0, key.length() - header.length()) + " ";
+                }
+            }
+        } catch (RuntimeException e) {
+            w = "Unknown Algorithm(s).  Error processing " + header + ".  " +
+                    e.getMessage();
+        }
+
+        // This means we have an error in finding weak algorithms, run in
+        // debug mode to see permittedAlgs map's values.
+        if (w.length() == 0) {
+            return "Unknown Algorithm(s)";
+        }
+
+        return w;
+    }
+
+    /**
      * See if the whole manifest was signed.
      */
     private boolean verifyManifestHash(Manifest sf,
@@ -354,6 +433,10 @@
     {
         Attributes mattr = sf.getMainAttributes();
         boolean manifestSigned = false;
+        // If only weak algorithms are used.
+        boolean weakAlgs = true;
+        // If a "*-DIGEST-MANIFEST" entry is found.
+        boolean validEntry = false;
 
         // go through all the attributes and process *-Digest-Manifest entries
         for (Map.Entry<Object,Object> se : mattr.entrySet()) {
@@ -363,6 +446,16 @@
             if (key.toUpperCase(Locale.ENGLISH).endsWith("-DIGEST-MANIFEST")) {
                 // 16 is length of "-Digest-Manifest"
                 String algorithm = key.substring(0, key.length()-16);
+                validEntry = true;
+
+                // Check if this algorithm is permitted, skip if false.
+                if (!permittedCheck(key, algorithm)) {
+                    continue;
+                }
+
+                // A non-weak algorithm was used, any weak algorithms found do
+                // not need to be reported.
+                weakAlgs = false;
 
                 manifestDigests.add(key);
                 manifestDigests.add(se.getValue());
@@ -373,15 +466,14 @@
                         Base64.getMimeDecoder().decode((String)se.getValue());
 
                     if (debug != null) {
-                     debug.println("Signature File: Manifest digest " +
-                                          digest.getAlgorithm());
-                     debug.println( "  sigfile  " + toHex(expectedHash));
-                     debug.println( "  computed " + toHex(computedHash));
-                     debug.println();
+                        debug.println("Signature File: Manifest digest " +
+                                algorithm);
+                        debug.println( "  sigfile  " + toHex(expectedHash));
+                        debug.println( "  computed " + toHex(computedHash));
+                        debug.println();
                     }
 
-                    if (MessageDigest.isEqual(computedHash,
-                                              expectedHash)) {
+                    if (MessageDigest.isEqual(computedHash, expectedHash)) {
                         manifestSigned = true;
                     } else {
                         //XXX: we will continue and verify each section
@@ -389,15 +481,33 @@
                 }
             }
         }
+
+        if (debug != null) {
+            debug.println("PermittedAlgs mapping: ");
+            for (String key : permittedAlgs.keySet()) {
+                debug.println(key + " : " +
+                        permittedAlgs.get(key).toString());
+            }
+        }
+
+        // If there were only weak algorithms entries used, throw an exception.
+        if (validEntry && weakAlgs) {
+            throw new SignatureException("Manifest hash check failed " +
+                    "(DIGEST-MANIFEST). Disabled algorithm(s) used: " +
+                    getWeakAlgorithms("-DIGEST-MANIFEST"));
+        }
         return manifestSigned;
     }
 
-    private boolean verifyManifestMainAttrs(Manifest sf,
-                                        ManifestDigester md)
+    private boolean verifyManifestMainAttrs(Manifest sf, ManifestDigester md)
          throws IOException, SignatureException
     {
         Attributes mattr = sf.getMainAttributes();
         boolean attrsVerified = true;
+        // If only weak algorithms are used.
+        boolean weakAlgs = true;
+        // If a ATTR_DIGEST entry is found.
+        boolean validEntry = false;
 
         // go through all the attributes and process
         // digest entries for the manifest main attributes
@@ -407,6 +517,16 @@
             if (key.toUpperCase(Locale.ENGLISH).endsWith(ATTR_DIGEST)) {
                 String algorithm =
                         key.substring(0, key.length() - ATTR_DIGEST.length());
+                validEntry = true;
+
+                // Check if this algorithm is permitted, skip if false.
+                if (!permittedCheck(key, algorithm)) {
+                    continue;
+                }
+
+                // A non-weak algorithm was used, any weak algorithms found do
+                // not need to be reported.
+                weakAlgs = false;
 
                 MessageDigest digest = getDigest(algorithm);
                 if (digest != null) {
@@ -425,8 +545,7 @@
                      debug.println();
                     }
 
-                    if (MessageDigest.isEqual(computedHash,
-                                              expectedHash)) {
+                    if (MessageDigest.isEqual(computedHash, expectedHash)) {
                         // good
                     } else {
                         // we will *not* continue and verify each section
@@ -442,6 +561,22 @@
             }
         }
 
+        if (debug != null) {
+            debug.println("PermittedAlgs mapping: ");
+            for (String key : permittedAlgs.keySet()) {
+                debug.println(key + " : " +
+                        permittedAlgs.get(key).toString());
+            }
+        }
+
+        // If there were only weak algorithms entries used, throw an exception.
+        if (validEntry && weakAlgs) {
+            throw new SignatureException("Manifest Main Attribute check " +
+                    "failed (" + ATTR_DIGEST + ").  " +
+                    "Disabled algorithm(s) used: " +
+                    getWeakAlgorithms(ATTR_DIGEST));
+        }
+
         // this method returns 'true' if either:
         //      . manifest main attributes were not signed, or
         //      . manifest main attributes were signed and verified
@@ -464,6 +599,10 @@
     {
         boolean oneDigestVerified = false;
         ManifestDigester.Entry mde = md.get(name,block.isOldStyle());
+        // If only weak algorithms are used.
+        boolean weakAlgs = true;
+        // If a "*-DIGEST" entry is found.
+        boolean validEntry = false;
 
         if (mde == null) {
             throw new SecurityException(
@@ -471,7 +610,6 @@
         }
 
         if (sfAttr != null) {
-
             //sun.security.util.HexDumpEncoder hex = new sun.security.util.HexDumpEncoder();
             //hex.encodeBuffer(data, System.out);
 
@@ -482,6 +620,16 @@
                 if (key.toUpperCase(Locale.ENGLISH).endsWith("-DIGEST")) {
                     // 7 is length of "-Digest"
                     String algorithm = key.substring(0, key.length()-7);
+                    validEntry = true;
+
+                    // Check if this algorithm is permitted, skip if false.
+                    if (!permittedCheck(key, algorithm)) {
+                        continue;
+                    }
+
+                    // A non-weak algorithm was used, any weak algorithms found do
+                    // not need to be reported.
+                    weakAlgs = false;
 
                     MessageDigest digest = getDigest(algorithm);
 
@@ -532,6 +680,22 @@
                 }
             }
         }
+
+        if (debug != null) {
+            debug.println("PermittedAlgs mapping: ");
+            for (String key : permittedAlgs.keySet()) {
+                debug.println(key + " : " +
+                        permittedAlgs.get(key).toString());
+            }
+        }
+
+        // If there were only weak algorithms entries used, throw an exception.
+        if (validEntry && weakAlgs) {
+            throw new SignatureException("Manifest Main Attribute check " +
+                    "failed (DIGEST).  Disabled algorithm(s) used: " +
+                    getWeakAlgorithms("DIGEST"));
+        }
+
         return oneDigestVerified;
     }
 
diff --git a/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java b/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java
index 8d63ea2..9f9b36a 100644
--- a/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java
+++ b/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 import javax.security.auth.x500.X500Principal;
 import sun.security.action.GetBooleanAction;
 import sun.security.provider.certpath.AlgorithmChecker;
-import sun.security.provider.certpath.PKIXTimestampParameters;
+import sun.security.provider.certpath.PKIXExtendedParameters;
 
 /**
  * Validator implementation built on the PKIX CertPath API. This
@@ -195,23 +195,22 @@
                 ("null or zero-length certificate chain");
         }
 
-        // Check if 'parameter' affects 'pkixParameters'
+        // Use PKIXExtendedParameters for timestamp and variant additions
         PKIXBuilderParameters pkixParameters = null;
-        if (parameter instanceof Timestamp && plugin) {
-            try {
-                pkixParameters = new PKIXTimestampParameters(
-                        (PKIXBuilderParameters) parameterTemplate.clone(),
-                        (Timestamp) parameter);
-            } catch (InvalidAlgorithmParameterException e) {
-                // ignore exception
-            }
-        } else {
-            pkixParameters = (PKIXBuilderParameters) parameterTemplate.clone();
+        try {
+            pkixParameters = new PKIXExtendedParameters(
+                    (PKIXBuilderParameters) parameterTemplate.clone(),
+                    (parameter instanceof Timestamp) ?
+                            (Timestamp) parameter : null,
+                    variant);
+        } catch (InvalidAlgorithmParameterException e) {
+            // ignore exception
         }
 
         // add new algorithm constraints checker
         if (constraints != null) {
-            pkixParameters.addCertPathChecker(new AlgorithmChecker(constraints));
+            pkixParameters.addCertPathChecker(
+                    new AlgorithmChecker(constraints, null, variant));
         }
 
         // attach it to the PKIXBuilderParameters.
diff --git a/jdk/src/java.base/share/classes/sun/security/validator/SimpleValidator.java b/jdk/src/java.base/share/classes/sun/security/validator/SimpleValidator.java
index 58f7a5d..a90c8c7 100644
--- a/jdk/src/java.base/share/classes/sun/security/validator/SimpleValidator.java
+++ b/jdk/src/java.base/share/classes/sun/security/validator/SimpleValidator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -155,12 +155,14 @@
 
         // create default algorithm constraints checker
         TrustAnchor anchor = new TrustAnchor(anchorCert, null);
-        AlgorithmChecker defaultAlgChecker = new AlgorithmChecker(anchor);
+        AlgorithmChecker defaultAlgChecker =
+                new AlgorithmChecker(anchor, variant);
 
         // create application level algorithm constraints checker
         AlgorithmChecker appAlgChecker = null;
         if (constraints != null) {
-            appAlgChecker = new AlgorithmChecker(anchor, constraints);
+            appAlgChecker = new AlgorithmChecker(anchor, constraints, null,
+                    null, variant);
         }
 
         // verify top down, starting at the certificate issued by
diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java
index 1fc5bed..364d47b 100644
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java
@@ -536,13 +536,18 @@
      * @return value of this CRL in a printable form.
      */
     public String toString() {
+        return toStringWithAlgName("" + sigAlgId);
+    }
+
+    // Specifically created for keytool to append a (weak) label to sigAlg
+    public String toStringWithAlgName(String name) {
         StringBuilder sb = new StringBuilder();
         sb.append("X.509 CRL v")
             .append(version+1)
             .append('\n');
         if (sigAlgId != null)
             sb.append("Signature Algorithm: ")
-                .append(sigAlgId)
+                .append(name)
                 .append(", OID=")
                 .append(sigAlgId.getOID())
                 .append('\n');
diff --git a/jdk/src/java.base/share/conf/net.properties b/jdk/src/java.base/share/conf/net.properties
index b490e17..ac94b30 100644
--- a/jdk/src/java.base/share/conf/net.properties
+++ b/jdk/src/java.base/share/conf/net.properties
@@ -3,7 +3,7 @@
 #
 # This file may contain default values for the networking system properties.
 # These values are only used when the system properties are not specified
-# on the command line or set programatically.
+# on the command line or set programmatically.
 # For now, only the various proxy settings can be configured here.
 ############################################################
 
@@ -11,7 +11,7 @@
 # settings when they do exist.
 # Set it to 'true' to enable this feature and check for platform
 # specific proxy settings
-# Note that the system properties that do explicitely set proxies
+# Note that the system properties that do explicitly set proxies
 # (like http.proxyHost) do take precedence over the system settings
 # even if java.net.useSystemProxies is set to true.
  
diff --git a/jdk/src/java.base/share/conf/security/java.security b/jdk/src/java.base/share/conf/security/java.security
index 5e77881..a564f7c 100644
--- a/jdk/src/java.base/share/conf/security/java.security
+++ b/jdk/src/java.base/share/conf/security/java.security
@@ -116,6 +116,13 @@
 # Example:
 #   jdk.security.provider.preferred=AES/GCM/NoPadding:SunJCE, \
 #         MessageDigest.SHA-256:SUN, Group.HmacSHA2:SunJCE
+#
+#ifdef solaris-sparc
+# Optional Solaris-SPARC configuration for non-FIPS 140 configurations.
+#   jdk.security.provider.preferred=AES:SunJCE, SHA1:SUN, Group.SHA2:SUN, \
+#   HmacSHA1:SunJCE, Group.HmacSHA2:SunJCE
+#
+#endif
 #jdk.security.provider.preferred=
 
 
@@ -240,6 +247,7 @@
 #
 # The default value is an empty string, which is equivalent to
 #   securerandom.drbg.config=Hash_DRBG,SHA-256,128,none
+#
 securerandom.drbg.config=
 
 #
@@ -262,23 +270,27 @@
 
 # The default is to have a single system-wide policy file,
 # and a policy file in the user's home directory.
+#
 policy.url.1=file:${java.home}/conf/security/java.policy
 policy.url.2=file:${user.home}/.java.policy
 
 # whether or not we expand properties in the policy file
 # if this is set to false, properties (${...}) will not be expanded in policy
 # files.
+#
 policy.expandProperties=true
 
 # whether or not we allow an extra policy to be passed on the command line
 # with -Djava.security.policy=somefile. Comment out this line to disable
 # this feature.
+#
 policy.allowSystemProperty=true
 
 # whether or not we look into the IdentityScope for trusted Identities
 # when encountering a 1.1 signed JAR file. If the identity is found
 # and is trusted, we grant it AllPermission. Note: the default policy
 # provider (sun.security.provider.PolicyFile) does not support this property.
+#
 policy.ignoreIdentityScope=false
 
 #
@@ -360,7 +372,6 @@
 # For this reason the default caching policy is to maintain these
 # results for 10 seconds.
 #
-#
 networkaddress.cache.negative.ttl=10
 
 #
@@ -460,8 +471,10 @@
 # Example,
 #   krb5.kdc.bad.policy = tryLast
 #   krb5.kdc.bad.policy = tryLess:2,2000
+#
 krb5.kdc.bad.policy = tryLast
 
+#
 # Algorithm restrictions for certification path (CertPath) processing
 #
 # In some environments, certain algorithms or key lengths may be undesirable
@@ -481,7 +494,8 @@
 #       (see below)
 #
 #   Constraint:
-#       KeySizeConstraint | CAConstraint | DenyAfterConstraint
+#       KeySizeConstraint | CAConstraint | DenyAfterConstraint |
+#       UsageConstraint
 #
 #   KeySizeConstraint:
 #       keySize Operator KeyLength
@@ -498,6 +512,9 @@
 #   DenyAfterConstraint:
 #       denyAfter YYYY-MM-DD
 #
+#   UsageConstraint:
+#       usage [TLSServer] [TLSClient] [SignedJAR]
+#
 # The "AlgorithmName" is the standard algorithm name of the disabled
 # algorithm. See "Java Cryptography Architecture Standard Algorithm Name
 # Documentation" for information about Standard Algorithm Names.  Matching
@@ -547,6 +564,19 @@
 #       Example:  To deny usage of RSA 2048 bit certificates after Feb 3 2020,
 #       use the following:  "RSA keySize == 2048 & denyAfter 2020-02-03"
 #
+#   UsageConstraint:
+#     usage [TLSServer] [TLSClient] [SignedJAR]
+#       This constraint prohibits the specified algorithm for
+#       a specified usage.  This should be used when disabling an algorithm
+#       for all usages is not practical. 'TLSServer' restricts the algorithm
+#       in TLS server certificate chains when server authentication is
+#       performed. 'TLSClient' restricts the algorithm in TLS client
+#       certificate chains when client authentication is performed.
+#       'SignedJAR' constrains use of certificates in signed jar files.
+#       The usage type follows the keyword and more than one usage type can
+#       be specified with a whitespace delimiter.
+#       Example:  "SHA1 usage TLSServer TLSClient"
+#
 # When an algorithm must satisfy more than one constraint, it must be
 # delimited by an ampersand '&'.  For example, to restrict certificates in a
 # chain that terminate at a distribution provided trust anchor and contain
@@ -568,39 +598,10 @@
 #   jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
 #
 #
-jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & denyAfter 2017-01-01, \
+jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & usage TLSServer, \
     RSA keySize < 1024, DSA keySize < 1024, EC keySize < 224
 
 #
-# RMI Registry Serial Filter
-#
-# The filter pattern uses the same format as jdk.serialFilter.
-# This filter can override the builtin filter if additional types need to be
-# allowed or rejected from the RMI Registry.
-#
-# Note: This property is currently used by the JDK Reference implementation.
-# It is not guaranteed to be examined and used by other implementations.
-#
-#sun.rmi.registry.registryFilter=pattern;pattern
-#
-# RMI Distributed Garbage Collector (DGC) Serial Filter
-#
-# The filter pattern uses the same format as jdk.serialFilter.
-# This filter can override the builtin filter if additional types need to be
-# allowed or rejected from the RMI DGC.
-#
-# Note: This property is currently used by the JDK Reference implementation.
-# It is not guaranteed to be examined and used by other implementations.
-#
-# The builtin DGC filter can approximately be represented as the filter pattern:
-#
-#sun.rmi.transport.dgcFilter=\
-#    java.rmi.server.ObjID;\
-#    java.rmi.server.UID;\
-#    java.rmi.dgc.VMID;\
-#    java.rmi.dgc.Lease;\
-#    maxdepth=5;maxarray=10000
-
 # Algorithm restrictions for signed JAR files
 #
 # In some environments, certain algorithms or key lengths may be undesirable
@@ -615,17 +616,20 @@
 #       " DisabledAlgorithm { , DisabledAlgorithm } "
 #
 #   DisabledAlgorithm:
-#       AlgorithmName [Constraint]
+#       AlgorithmName [Constraint] { '&' Constraint }
 #
 #   AlgorithmName:
 #       (see below)
 #
 #   Constraint:
-#       KeySizeConstraint
+#       KeySizeConstraint | DenyAfterConstraint
 #
 #   KeySizeConstraint:
 #       keySize Operator KeyLength
 #
+#   DenyAfterConstraint:
+#       denyAfter YYYY-MM-DD
+#
 #   Operator:
 #       <= | < | == | != | >= | >
 #
@@ -636,9 +640,12 @@
 # implementation. It is not guaranteed to be examined and used by other
 # implementations.
 #
+# See "jdk.certpath.disabledAlgorithms" for syntax descriptions.
+#
 jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
       DSA keySize < 1024
 
+#
 # Algorithm restrictions for Secure Socket Layer/Transport Layer Security
 # (SSL/TLS/DTLS) processing
 #
@@ -939,3 +946,32 @@
 #
 #jdk.serialFilter=pattern;pattern
 
+#
+# RMI Registry Serial Filter
+#
+# The filter pattern uses the same format as jdk.serialFilter.
+# This filter can override the builtin filter if additional types need to be
+# allowed or rejected from the RMI Registry.
+#
+# Note: This property is currently used by the JDK Reference implementation.
+# It is not guaranteed to be examined and used by other implementations.
+#
+#sun.rmi.registry.registryFilter=pattern;pattern
+#
+# RMI Distributed Garbage Collector (DGC) Serial Filter
+#
+# The filter pattern uses the same format as jdk.serialFilter.
+# This filter can override the builtin filter if additional types need to be
+# allowed or rejected from the RMI DGC.
+#
+# Note: This property is currently used by the JDK Reference implementation.
+# It is not guaranteed to be examined and used by other implementations.
+#
+# The builtin DGC filter can approximately be represented as the filter pattern:
+#
+#sun.rmi.transport.dgcFilter=\
+#    java.rmi.server.ObjID;\
+#    java.rmi.server.UID;\
+#    java.rmi.dgc.VMID;\
+#    java.rmi.dgc.Lease;\
+#    maxdepth=5;maxarray=10000
diff --git a/jdk/src/java.base/share/legal/zlib.md b/jdk/src/java.base/share/legal/zlib.md
index bbf40f9..69198f1 100644
--- a/jdk/src/java.base/share/legal/zlib.md
+++ b/jdk/src/java.base/share/legal/zlib.md
@@ -1,9 +1,9 @@
-## zlib v1.2.8
+## zlib v1.2.11
 
 ### zlib License
 <pre>
 
-Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
+Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
 
 This software is provided 'as-is', without any express or implied
 warranty.  In no event will the authors be held liable for any damages
diff --git a/jdk/src/java.base/share/lib/security/default.policy b/jdk/src/java.base/share/lib/security/default.policy
index 7f7ad4f..033d80b 100644
--- a/jdk/src/java.base/share/lib/security/default.policy
+++ b/jdk/src/java.base/share/lib/security/default.policy
@@ -70,6 +70,8 @@
 
 grant codeBase "jrt:/java.xml.bind" {
     permission java.lang.RuntimePermission
+                   "accessClassInPackage.sun.misc";
+    permission java.lang.RuntimePermission
                    "accessClassInPackage.com.sun.xml.internal.*";
     permission java.lang.RuntimePermission
                    "accessClassInPackage.com.sun.istack.internal";
@@ -102,18 +104,16 @@
 };
 
 grant codeBase "jrt:/java.xml.ws" {
+    permission java.net.NetPermission
+                   "getProxySelector";
     permission java.lang.RuntimePermission
-                   "accessClassInPackage.com.sun.org.apache.xml.internal.resolver";
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.com.sun.org.apache.xml.internal.resolver.tools";
+                   "accessClassInPackage.sun.misc";
     permission java.lang.RuntimePermission
                    "accessClassInPackage.com.sun.xml.internal.*";
     permission java.lang.RuntimePermission
                    "accessClassInPackage.com.sun.istack.internal";
     permission java.lang.RuntimePermission
                    "accessClassInPackage.com.sun.istack.internal.*";
-    permission java.lang.RuntimePermission
-                   "accessClassInPackage.com.sun.org.apache.xerces.internal.*";
     permission java.lang.RuntimePermission "accessDeclaredMembers";
     permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
     permission java.util.PropertyPermission "*", "read";
@@ -213,3 +213,7 @@
     permission java.lang.RuntimePermission "accessClassInPackage.com.sun.java.swing.plaf.*";
     permission java.lang.RuntimePermission "accessClassInPackage.com.apple.*";
 };
+
+grant codeBase "jrt:/jdk.internal.vm.compiler" {
+    permission java.security.AllPermission;
+};
diff --git a/jdk/src/java.base/share/native/launcher/main.c b/jdk/src/java.base/share/native/launcher/main.c
index acbff5f..8e27a2a 100644
--- a/jdk/src/java.base/share/native/launcher/main.c
+++ b/jdk/src/java.base/share/native/launcher/main.c
@@ -130,10 +130,10 @@
 
         // Add first arg, which is the app name
         JLI_List_add(args, JLI_StringDup(argv[0]));
-        // Append JAVA_OPTIONS
-        if (JLI_AddArgsFromEnvVar(args, JAVA_OPTIONS)) {
+        // Append JDK_JAVA_OPTIONS
+        if (JLI_AddArgsFromEnvVar(args, JDK_JAVA_OPTIONS)) {
             // JLI_SetTraceLauncher is not called yet
-            // Show _JAVA_OPTIONS content along with JAVA_OPTIONS to aid diagnosis
+            // Show _JAVA_OPTIONS content along with JDK_JAVA_OPTIONS to aid diagnosis
             if (getenv(JLDEBUG_ENV_ENTRY)) {
                 char *tmp = getenv("_JAVA_OPTIONS");
                 if (NULL != tmp) {
diff --git a/jdk/src/java.base/share/native/libjava/ClassLoader.c b/jdk/src/java.base/share/native/libjava/ClassLoader.c
index 5a8d861..f380380 100644
--- a/jdk/src/java.base/share/native/libjava/ClassLoader.c
+++ b/jdk/src/java.base/share/native/libjava/ClassLoader.c
@@ -72,23 +72,9 @@
     return utfStr;
 }
 
-// The existence or signature of this method is not guaranteed since it
-// supports a private method.  This method will be changed in 1.7.
-JNIEXPORT jclass JNICALL
-Java_java_lang_ClassLoader_defineClass0(JNIEnv *env,
-                                        jobject loader,
-                                        jstring name,
-                                        jbyteArray data,
-                                        jint offset,
-                                        jint length,
-                                        jobject pd)
-{
-    return Java_java_lang_ClassLoader_defineClass1(env, loader, name, data, offset,
-                                                   length, pd, NULL);
-}
-
 JNIEXPORT jclass JNICALL
 Java_java_lang_ClassLoader_defineClass1(JNIEnv *env,
+                                        jclass cls,
                                         jobject loader,
                                         jstring name,
                                         jbyteArray data,
@@ -163,6 +149,7 @@
 
 JNIEXPORT jclass JNICALL
 Java_java_lang_ClassLoader_defineClass2(JNIEnv *env,
+                                        jclass cls,
                                         jobject loader,
                                         jstring name,
                                         jobject data,
diff --git a/jdk/src/java.base/share/native/libjava/Module.c b/jdk/src/java.base/share/native/libjava/Module.c
index 2606755..f396b8d 100644
--- a/jdk/src/java.base/share/native/libjava/Module.c
+++ b/jdk/src/java.base/share/native/libjava/Module.c
@@ -29,12 +29,12 @@
 #include "jni_util.h"
 #include "jvm.h"
 
-#include "java_lang_reflect_Module.h"
+#include "java_lang_Module.h"
 
 /*
  * Gets the UTF-8 chars for the string and translates '.' to '/'.  Does no
  * further validation, assumption being that both calling code in
- * java.lang.reflect.Module and VM will do deeper validation.
+ * java.lang.Module and VM will do deeper validation.
  */
 static char*
 GetInternalPackageName(JNIEnv *env, jstring pkg, char* buf, jsize buf_size)
@@ -68,35 +68,37 @@
 }
 
 JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_defineModule0(JNIEnv *env, jclass cls, jobject module,
+Java_java_lang_Module_defineModule0(JNIEnv *env, jclass cls, jobject module,
                                             jboolean is_open, jstring version,
                                             jstring location, jobjectArray packages)
 {
     char** pkgs = NULL;
-    jsize idx;
     jsize num_packages = (*env)->GetArrayLength(env, packages);
 
     if (num_packages != 0 && (pkgs = calloc(num_packages, sizeof(char*))) == NULL) {
         JNU_ThrowOutOfMemoryError(env, NULL);
         return;
-    } else {
-        int valid = 1;
+    } else if ((*env)->EnsureLocalCapacity(env, (jint)num_packages) == 0) {
+        jboolean failed = JNI_FALSE;
+        int idx;
         for (idx = 0; idx < num_packages; idx++) {
             jstring pkg = (*env)->GetObjectArrayElement(env, packages, idx);
-            pkgs[idx] = GetInternalPackageName(env, pkg, NULL, 0);
-            if (pkgs[idx] == NULL) {
-                valid = 0;
+            char* name = GetInternalPackageName(env, pkg, NULL, 0);
+            if (name != NULL) {
+                pkgs[idx] = name;
+            } else {
+                failed = JNI_TRUE;
                 break;
             }
         }
-
-        if (valid != 0) {
+        if (!failed) {
             JVM_DefineModule(env, module, is_open, version, location,
-                    (const char* const*)pkgs, num_packages);
+                             (const char* const*)pkgs, num_packages);
         }
     }
 
     if (num_packages > 0) {
+        int idx;
         for (idx = 0; idx < num_packages; idx++) {
             if (pkgs[idx] != NULL) {
                 free(pkgs[idx]);
@@ -107,14 +109,14 @@
 }
 
 JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addReads0(JNIEnv *env, jclass cls, jobject from, jobject to)
+Java_java_lang_Module_addReads0(JNIEnv *env, jclass cls, jobject from, jobject to)
 {
     JVM_AddReadsModule(env, from, to);
 }
 
 JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addExports0(JNIEnv *env, jclass cls, jobject from,
-                                          jstring pkg, jobject to)
+Java_java_lang_Module_addExports0(JNIEnv *env, jclass cls, jobject from,
+                                  jstring pkg, jobject to)
 {
     char buf[128];
     char* pkg_name;
@@ -134,8 +136,8 @@
 }
 
 JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addExportsToAll0(JNIEnv *env, jclass cls, jobject from,
-                                               jstring pkg)
+Java_java_lang_Module_addExportsToAll0(JNIEnv *env, jclass cls, jobject from,
+                                       jstring pkg)
 {
     char buf[128];
     char* pkg_name;
@@ -155,8 +157,8 @@
 }
 
 JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addExportsToAllUnnamed0(JNIEnv *env, jclass cls,
-                                                      jobject from, jstring pkg)
+Java_java_lang_Module_addExportsToAllUnnamed0(JNIEnv *env, jclass cls,
+                                              jobject from, jstring pkg)
 {
     char buf[128];
     char* pkg_name;
@@ -176,7 +178,7 @@
 }
 
 JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addPackage0(JNIEnv *env, jclass cls, jobject m, jstring pkg)
+Java_java_lang_Module_addPackage0(JNIEnv *env, jclass cls, jobject m, jstring pkg)
 {
     char buf[128];
     char* pkg_name;
diff --git a/jdk/src/java.base/share/native/libjli/args.c b/jdk/src/java.base/share/native/libjli/args.c
index d24301c..adbff67 100644
--- a/jdk/src/java.base/share/native/libjli/args.c
+++ b/jdk/src/java.base/share/native/libjli/args.c
@@ -34,7 +34,7 @@
     #define NO_JNI
   #endif
   #define JLI_ReportMessage(...) printf(__VA_ARGS__)
-  #define JAVA_OPTIONS "JAVA_OPTIONS"
+  #define JDK_JAVA_OPTIONS "JDK_JAVA_OPTIONS"
   int IsWhiteSpaceOption(const char* name) { return 1; }
 #else
   #include "java.h"
@@ -429,10 +429,6 @@
 }
 
 jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name) {
-
-#ifndef ENABLE_JAVA_OPTIONS
-    return JNI_FALSE;
-#else
     char *env = getenv(var_name);
     char *p, *arg;
     char quote;
@@ -519,7 +515,6 @@
     }
 
     return JNI_TRUE;
-#endif
 }
 
 #ifdef DEBUG_ARGFILE
diff --git a/jdk/src/java.base/share/native/libjli/java.h b/jdk/src/java.base/share/native/libjli/java.h
index d035a08..842dcc9 100644
--- a/jdk/src/java.base/share/native/libjli/java.h
+++ b/jdk/src/java.base/share/native/libjli/java.h
@@ -71,7 +71,7 @@
 
 #define SPLASH_FILE_ENV_ENTRY "_JAVA_SPLASH_FILE"
 #define SPLASH_JAR_ENV_ENTRY "_JAVA_SPLASH_JAR"
-#define JAVA_OPTIONS "JAVA_OPTIONS"
+#define JDK_JAVA_OPTIONS "JDK_JAVA_OPTIONS"
 
 /*
  * Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/ChangeLog b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/ChangeLog
deleted file mode 100644
index f22aaba..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/ChangeLog
+++ /dev/null
@@ -1,1472 +0,0 @@
-
-                ChangeLog file for zlib
-
-Changes in 1.2.8 (28 Apr 2013)
-- Update contrib/minizip/iowin32.c for Windows RT [Vollant]
-- Do not force Z_CONST for C++
-- Clean up contrib/vstudio [Ro§]
-- Correct spelling error in zlib.h
-- Fix mixed line endings in contrib/vstudio
-
-Changes in 1.2.7.3 (13 Apr 2013)
-- Fix version numbers and DLL names in contrib/vstudio/*/zlib.rc
-
-Changes in 1.2.7.2 (13 Apr 2013)
-- Change check for a four-byte type back to hexadecimal
-- Fix typo in win32/Makefile.msc
-- Add casts in gzwrite.c for pointer differences
-
-Changes in 1.2.7.1 (24 Mar 2013)
-- Replace use of unsafe string functions with snprintf if available
-- Avoid including stddef.h on Windows for Z_SOLO compile [Niessink]
-- Fix gzgetc undefine when Z_PREFIX set [Turk]
-- Eliminate use of mktemp in Makefile (not always available)
-- Fix bug in 'F' mode for gzopen()
-- Add inflateGetDictionary() function
-- Correct comment in deflate.h
-- Use _snprintf for snprintf in Microsoft C
-- On Darwin, only use /usr/bin/libtool if libtool is not Apple
-- Delete "--version" file if created by "ar --version" [Richard G.]
-- Fix configure check for veracity of compiler error return codes
-- Fix CMake compilation of static lib for MSVC2010 x64
-- Remove unused variable in infback9.c
-- Fix argument checks in gzlog_compress() and gzlog_write()
-- Clean up the usage of z_const and respect const usage within zlib
-- Clean up examples/gzlog.[ch] comparisons of different types
-- Avoid shift equal to bits in type (caused endless loop)
-- Fix unintialized value bug in gzputc() introduced by const patches
-- Fix memory allocation error in examples/zran.c [Nor]
-- Fix bug where gzopen(), gzclose() would write an empty file
-- Fix bug in gzclose() when gzwrite() runs out of memory
-- Check for input buffer malloc failure in examples/gzappend.c
-- Add note to contrib/blast to use binary mode in stdio
-- Fix comparisons of differently signed integers in contrib/blast
-- Check for invalid code length codes in contrib/puff
-- Fix serious but very rare decompression bug in inftrees.c
-- Update inflateBack() comments, since inflate() can be faster
-- Use underscored I/O function names for WINAPI_FAMILY
-- Add _tr_flush_bits to the external symbols prefixed by --zprefix
-- Add contrib/vstudio/vc10 pre-build step for static only
-- Quote --version-script argument in CMakeLists.txt
-- Don't specify --version-script on Apple platforms in CMakeLists.txt
-- Fix casting error in contrib/testzlib/testzlib.c
-- Fix types in contrib/minizip to match result of get_crc_table()
-- Simplify contrib/vstudio/vc10 with 'd' suffix
-- Add TOP support to win32/Makefile.msc
-- Suport i686 and amd64 assembler builds in CMakeLists.txt
-- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
-- Add vc11 and vc12 build files to contrib/vstudio
-- Add gzvprintf() as an undocumented function in zlib
-- Fix configure for Sun shell
-- Remove runtime check in configure for four-byte integer type
-- Add casts and consts to ease user conversion to C++
-- Add man pages for minizip and miniunzip
-- In Makefile uninstall, don't rm if preceding cd fails
-- Do not return Z_BUF_ERROR if deflateParam() has nothing to write
-
-Changes in 1.2.7 (2 May 2012)
-- Replace use of memmove() with a simple copy for portability
-- Test for existence of strerror
-- Restore gzgetc_ for backward compatibility with 1.2.6
-- Fix build with non-GNU make on Solaris
-- Require gcc 4.0 or later on Mac OS X to use the hidden attribute
-- Include unistd.h for Watcom C
-- Use __WATCOMC__ instead of __WATCOM__
-- Do not use the visibility attribute if NO_VIZ defined
-- Improve the detection of no hidden visibility attribute
-- Avoid using __int64 for gcc or solo compilation
-- Cast to char * in gzprintf to avoid warnings [Zinser]
-- Fix make_vms.com for VAX [Zinser]
-- Don't use library or built-in byte swaps
-- Simplify test and use of gcc hidden attribute
-- Fix bug in gzclose_w() when gzwrite() fails to allocate memory
-- Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen()
-- Fix bug in test/minigzip.c for configure --solo
-- Fix contrib/vstudio project link errors [Mohanathas]
-- Add ability to choose the builder in make_vms.com [Schweda]
-- Add DESTDIR support to mingw32 win32/Makefile.gcc
-- Fix comments in win32/Makefile.gcc for proper usage
-- Allow overriding the default install locations for cmake
-- Generate and install the pkg-config file with cmake
-- Build both a static and a shared version of zlib with cmake
-- Include version symbols for cmake builds
-- If using cmake with MSVC, add the source directory to the includes
-- Remove unneeded EXTRA_CFLAGS from win32/Makefile.gcc [Truta]
-- Move obsolete emx makefile to old [Truta]
-- Allow the use of -Wundef when compiling or using zlib
-- Avoid the use of the -u option with mktemp
-- Improve inflate() documentation on the use of Z_FINISH
-- Recognize clang as gcc
-- Add gzopen_w() in Windows for wide character path names
-- Rename zconf.h in CMakeLists.txt to move it out of the way
-- Add source directory in CMakeLists.txt for building examples
-- Look in build directory for zlib.pc in CMakeLists.txt
-- Remove gzflags from zlibvc.def in vc9 and vc10
-- Fix contrib/minizip compilation in the MinGW environment
-- Update ./configure for Solaris, support --64 [Mooney]
-- Remove -R. from Solaris shared build (possible security issue)
-- Avoid race condition for parallel make (-j) running example
-- Fix type mismatch between get_crc_table() and crc_table
-- Fix parsing of version with "-" in CMakeLists.txt [Snider, Ziegler]
-- Fix the path to zlib.map in CMakeLists.txt
-- Force the native libtool in Mac OS X to avoid GNU libtool [Beebe]
-- Add instructions to win32/Makefile.gcc for shared install [Torri]
-
-Changes in 1.2.6.1 (12 Feb 2012)
-- Avoid the use of the Objective-C reserved name "id"
-- Include io.h in gzguts.h for Microsoft compilers
-- Fix problem with ./configure --prefix and gzgetc macro
-- Include gz_header definition when compiling zlib solo
-- Put gzflags() functionality back in zutil.c
-- Avoid library header include in crc32.c for Z_SOLO
-- Use name in GCC_CLASSIC as C compiler for coverage testing, if set
-- Minor cleanup in contrib/minizip/zip.c [Vollant]
-- Update make_vms.com [Zinser]
-- Remove unnecessary gzgetc_ function
-- Use optimized byte swap operations for Microsoft and GNU [Snyder]
-- Fix minor typo in zlib.h comments [Rzesniowiecki]
-
-Changes in 1.2.6 (29 Jan 2012)
-- Update the Pascal interface in contrib/pascal
-- Fix function numbers for gzgetc_ in zlibvc.def files
-- Fix configure.ac for contrib/minizip [Schiffer]
-- Fix large-entry detection in minizip on 64-bit systems [Schiffer]
-- Have ./configure use the compiler return code for error indication
-- Fix CMakeLists.txt for cross compilation [McClure]
-- Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes]
-- Fix compilation of contrib/minizip on FreeBSD [Marquez]
-- Correct suggested usages in win32/Makefile.msc [Shachar, Horvath]
-- Include io.h for Turbo C / Borland C on all platforms [Truta]
-- Make version explicit in contrib/minizip/configure.ac [Bosmans]
-- Avoid warning for no encryption in contrib/minizip/zip.c [Vollant]
-- Minor cleanup up contrib/minizip/unzip.c [Vollant]
-- Fix bug when compiling minizip with C++ [Vollant]
-- Protect for long name and extra fields in contrib/minizip [Vollant]
-- Avoid some warnings in contrib/minizip [Vollant]
-- Add -I../.. -L../.. to CFLAGS for minizip and miniunzip
-- Add missing libs to minizip linker command
-- Add support for VPATH builds in contrib/minizip
-- Add an --enable-demos option to contrib/minizip/configure
-- Add the generation of configure.log by ./configure
-- Exit when required parameters not provided to win32/Makefile.gcc
-- Have gzputc return the character written instead of the argument
-- Use the -m option on ldconfig for BSD systems [Tobias]
-- Correct in zlib.map when deflateResetKeep was added
-
-Changes in 1.2.5.3 (15 Jan 2012)
-- Restore gzgetc function for binary compatibility
-- Do not use _lseeki64 under Borland C++ [Truta]
-- Update win32/Makefile.msc to build test/*.c [Truta]
-- Remove old/visualc6 given CMakefile and other alternatives
-- Update AS400 build files and documentation [Monnerat]
-- Update win32/Makefile.gcc to build test/*.c [Truta]
-- Permit stronger flushes after Z_BLOCK flushes
-- Avoid extraneous empty blocks when doing empty flushes
-- Permit Z_NULL arguments to deflatePending
-- Allow deflatePrime() to insert bits in the middle of a stream
-- Remove second empty static block for Z_PARTIAL_FLUSH
-- Write out all of the available bits when using Z_BLOCK
-- Insert the first two strings in the hash table after a flush
-
-Changes in 1.2.5.2 (17 Dec 2011)
-- fix ld error: unable to find version dependency 'ZLIB_1.2.5'
-- use relative symlinks for shared libs
-- Avoid searching past window for Z_RLE strategy
-- Assure that high-water mark initialization is always applied in deflate
-- Add assertions to fill_window() in deflate.c to match comments
-- Update python link in README
-- Correct spelling error in gzread.c
-- Fix bug in gzgets() for a concatenated empty gzip stream
-- Correct error in comment for gz_make()
-- Change gzread() and related to ignore junk after gzip streams
-- Allow gzread() and related to continue after gzclearerr()
-- Allow gzrewind() and gzseek() after a premature end-of-file
-- Simplify gzseek() now that raw after gzip is ignored
-- Change gzgetc() to a macro for speed (~40% speedup in testing)
-- Fix gzclose() to return the actual error last encountered
-- Always add large file support for windows
-- Include zconf.h for windows large file support
-- Include zconf.h.cmakein for windows large file support
-- Update zconf.h.cmakein on make distclean
-- Merge vestigial vsnprintf determination from zutil.h to gzguts.h
-- Clarify how gzopen() appends in zlib.h comments
-- Correct documentation of gzdirect() since junk at end now ignored
-- Add a transparent write mode to gzopen() when 'T' is in the mode
-- Update python link in zlib man page
-- Get inffixed.h and MAKEFIXED result to match
-- Add a ./config --solo option to make zlib subset with no libary use
-- Add undocumented inflateResetKeep() function for CAB file decoding
-- Add --cover option to ./configure for gcc coverage testing
-- Add #define ZLIB_CONST option to use const in the z_stream interface
-- Add comment to gzdopen() in zlib.h to use dup() when using fileno()
-- Note behavior of uncompress() to provide as much data as it can
-- Add files in contrib/minizip to aid in building libminizip
-- Split off AR options in Makefile.in and configure
-- Change ON macro to Z_ARG to avoid application conflicts
-- Facilitate compilation with Borland C++ for pragmas and vsnprintf
-- Include io.h for Turbo C / Borland C++
-- Move example.c and minigzip.c to test/
-- Simplify incomplete code table filling in inflate_table()
-- Remove code from inflate.c and infback.c that is impossible to execute
-- Test the inflate code with full coverage
-- Allow deflateSetDictionary, inflateSetDictionary at any time (in raw)
-- Add deflateResetKeep and fix inflateResetKeep to retain dictionary
-- Fix gzwrite.c to accommodate reduced memory zlib compilation
-- Have inflate() with Z_FINISH avoid the allocation of a window
-- Do not set strm->adler when doing raw inflate
-- Fix gzeof() to behave just like feof() when read is not past end of file
-- Fix bug in gzread.c when end-of-file is reached
-- Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF
-- Document gzread() capability to read concurrently written files
-- Remove hard-coding of resource compiler in CMakeLists.txt [Blammo]
-
-Changes in 1.2.5.1 (10 Sep 2011)
-- Update FAQ entry on shared builds (#13)
-- Avoid symbolic argument to chmod in Makefile.in
-- Fix bug and add consts in contrib/puff [Oberhumer]
-- Update contrib/puff/zeros.raw test file to have all block types
-- Add full coverage test for puff in contrib/puff/Makefile
-- Fix static-only-build install in Makefile.in
-- Fix bug in unzGetCurrentFileInfo() in contrib/minizip [Kuno]
-- Add libz.a dependency to shared in Makefile.in for parallel builds
-- Spell out "number" (instead of "nb") in zlib.h for total_in, total_out
-- Replace $(...) with `...` in configure for non-bash sh [Bowler]
-- Add darwin* to Darwin* and solaris* to SunOS\ 5* in configure [Groffen]
-- Add solaris* to Linux* in configure to allow gcc use [Groffen]
-- Add *bsd* to Linux* case in configure [Bar-Lev]
-- Add inffast.obj to dependencies in win32/Makefile.msc
-- Correct spelling error in deflate.h [Kohler]
-- Change libzdll.a again to libz.dll.a (!) in win32/Makefile.gcc
-- Add test to configure for GNU C looking for gcc in output of $cc -v
-- Add zlib.pc generation to win32/Makefile.gcc [Weigelt]
-- Fix bug in zlib.h for _FILE_OFFSET_BITS set and _LARGEFILE64_SOURCE not
-- Add comment in zlib.h that adler32_combine with len2 < 0 makes no sense
-- Make NO_DIVIDE option in adler32.c much faster (thanks to John Reiser)
-- Make stronger test in zconf.h to include unistd.h for LFS
-- Apply Darwin patches for 64-bit file offsets to contrib/minizip [Slack]
-- Fix zlib.h LFS support when Z_PREFIX used
-- Add updated as400 support (removed from old) [Monnerat]
-- Avoid deflate sensitivity to volatile input data
-- Avoid division in adler32_combine for NO_DIVIDE
-- Clarify the use of Z_FINISH with deflateBound() amount of space
-- Set binary for output file in puff.c
-- Use u4 type for crc_table to avoid conversion warnings
-- Apply casts in zlib.h to avoid conversion warnings
-- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
-- Improve inflateSync() documentation to note indeterminancy
-- Add deflatePending() function to return the amount of pending output
-- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
-- Add a check in configure for stdarg.h, use for gzprintf()
-- Check that pointers fit in ints when gzprint() compiled old style
-- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
-- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
-- Add debug records in assmebler code [Londer]
-- Update RFC references to use http://tools.ietf.org/html/... [Li]
-- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
-
-Changes in 1.2.5 (19 Apr 2010)
-- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev]
-- Default to libdir as sharedlibdir in configure [Nieder]
-- Update copyright dates on modified source files
-- Update trees.c to be able to generate modified trees.h
-- Exit configure for MinGW, suggesting win32/Makefile.gcc
-- Check for NULL path in gz_open [Homurlu]
-
-Changes in 1.2.4.5 (18 Apr 2010)
-- Set sharedlibdir in configure [Torok]
-- Set LDFLAGS in Makefile.in [Bar-Lev]
-- Avoid mkdir objs race condition in Makefile.in [Bowler]
-- Add ZLIB_INTERNAL in front of internal inter-module functions and arrays
-- Define ZLIB_INTERNAL to hide internal functions and arrays for GNU C
-- Don't use hidden attribute when it is a warning generator (e.g. Solaris)
-
-Changes in 1.2.4.4 (18 Apr 2010)
-- Fix CROSS_PREFIX executable testing, CHOST extract, mingw* [Torok]
-- Undefine _LARGEFILE64_SOURCE in zconf.h if it is zero, but not if empty
-- Try to use bash or ksh regardless of functionality of /bin/sh
-- Fix configure incompatibility with NetBSD sh
-- Remove attempt to run under bash or ksh since have better NetBSD fix
-- Fix win32/Makefile.gcc for MinGW [Bar-Lev]
-- Add diagnostic messages when using CROSS_PREFIX in configure
-- Added --sharedlibdir option to configure [Weigelt]
-- Use hidden visibility attribute when available [Frysinger]
-
-Changes in 1.2.4.3 (10 Apr 2010)
-- Only use CROSS_PREFIX in configure for ar and ranlib if they exist
-- Use CROSS_PREFIX for nm [Bar-Lev]
-- Assume _LARGEFILE64_SOURCE defined is equivalent to true
-- Avoid use of undefined symbols in #if with && and ||
-- Make *64 prototypes in gzguts.h consistent with functions
-- Add -shared load option for MinGW in configure [Bowler]
-- Move z_off64_t to public interface, use instead of off64_t
-- Remove ! from shell test in configure (not portable to Solaris)
-- Change +0 macro tests to -0 for possibly increased portability
-
-Changes in 1.2.4.2 (9 Apr 2010)
-- Add consistent carriage returns to readme.txt's in masmx86 and masmx64
-- Really provide prototypes for *64 functions when building without LFS
-- Only define unlink() in minigzip.c if unistd.h not included
-- Update README to point to contrib/vstudio project files
-- Move projects/vc6 to old/ and remove projects/
-- Include stdlib.h in minigzip.c for setmode() definition under WinCE
-- Clean up assembler builds in win32/Makefile.msc [Rowe]
-- Include sys/types.h for Microsoft for off_t definition
-- Fix memory leak on error in gz_open()
-- Symbolize nm as $NM in configure [Weigelt]
-- Use TEST_LDSHARED instead of LDSHARED to link test programs [Weigelt]
-- Add +0 to _FILE_OFFSET_BITS and _LFS64_LARGEFILE in case not defined
-- Fix bug in gzeof() to take into account unused input data
-- Avoid initialization of structures with variables in puff.c
-- Updated win32/README-WIN32.txt [Rowe]
-
-Changes in 1.2.4.1 (28 Mar 2010)
-- Remove the use of [a-z] constructs for sed in configure [gentoo 310225]
-- Remove $(SHAREDLIB) from LIBS in Makefile.in [Creech]
-- Restore "for debugging" comment on sprintf() in gzlib.c
-- Remove fdopen for MVS from gzguts.h
-- Put new README-WIN32.txt in win32 [Rowe]
-- Add check for shell to configure and invoke another shell if needed
-- Fix big fat stinking bug in gzseek() on uncompressed files
-- Remove vestigial F_OPEN64 define in zutil.h
-- Set and check the value of _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE
-- Avoid errors on non-LFS systems when applications define LFS macros
-- Set EXE to ".exe" in configure for MINGW [Kahle]
-- Match crc32() in crc32.c exactly to the prototype in zlib.h [Sherrill]
-- Add prefix for cross-compilation in win32/makefile.gcc [Bar-Lev]
-- Add DLL install in win32/makefile.gcc [Bar-Lev]
-- Allow Linux* or linux* from uname in configure [Bar-Lev]
-- Allow ldconfig to be redefined in configure and Makefile.in [Bar-Lev]
-- Add cross-compilation prefixes to configure [Bar-Lev]
-- Match type exactly in gz_load() invocation in gzread.c
-- Match type exactly of zcalloc() in zutil.c to zlib.h alloc_func
-- Provide prototypes for *64 functions when building zlib without LFS
-- Don't use -lc when linking shared library on MinGW
-- Remove errno.h check in configure and vestigial errno code in zutil.h
-
-Changes in 1.2.4 (14 Mar 2010)
-- Fix VER3 extraction in configure for no fourth subversion
-- Update zlib.3, add docs to Makefile.in to make .pdf out of it
-- Add zlib.3.pdf to distribution
-- Don't set error code in gzerror() if passed pointer is NULL
-- Apply destination directory fixes to CMakeLists.txt [Lowman]
-- Move #cmakedefine's to a new zconf.in.cmakein
-- Restore zconf.h for builds that don't use configure or cmake
-- Add distclean to dummy Makefile for convenience
-- Update and improve INDEX, README, and FAQ
-- Update CMakeLists.txt for the return of zconf.h [Lowman]
-- Update contrib/vstudio/vc9 and vc10 [Vollant]
-- Change libz.dll.a back to libzdll.a in win32/Makefile.gcc
-- Apply license and readme changes to contrib/asm686 [Raiter]
-- Check file name lengths and add -c option in minigzip.c [Li]
-- Update contrib/amd64 and contrib/masmx86/ [Vollant]
-- Avoid use of "eof" parameter in trees.c to not shadow library variable
-- Update make_vms.com for removal of zlibdefs.h [Zinser]
-- Update assembler code and vstudio projects in contrib [Vollant]
-- Remove outdated assembler code contrib/masm686 and contrib/asm586
-- Remove old vc7 and vc8 from contrib/vstudio
-- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe]
-- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open()
-- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant]
-- Remove *64 functions from win32/zlib.def (they're not 64-bit yet)
-- Fix bug in void-returning vsprintf() case in gzwrite.c
-- Fix name change from inflate.h in contrib/inflate86/inffas86.c
-- Check if temporary file exists before removing in make_vms.com [Zinser]
-- Fix make install and uninstall for --static option
-- Fix usage of _MSC_VER in gzguts.h and zutil.h [Truta]
-- Update readme.txt in contrib/masmx64 and masmx86 to assemble
-
-Changes in 1.2.3.9 (21 Feb 2010)
-- Expunge gzio.c
-- Move as400 build information to old
-- Fix updates in contrib/minizip and contrib/vstudio
-- Add const to vsnprintf test in configure to avoid warnings [Weigelt]
-- Delete zconf.h (made by configure) [Weigelt]
-- Change zconf.in.h to zconf.h.in per convention [Weigelt]
-- Check for NULL buf in gzgets()
-- Return empty string for gzgets() with len == 1 (like fgets())
-- Fix description of gzgets() in zlib.h for end-of-file, NULL return
-- Update minizip to 1.1 [Vollant]
-- Avoid MSVC loss of data warnings in gzread.c, gzwrite.c
-- Note in zlib.h that gzerror() should be used to distinguish from EOF
-- Remove use of snprintf() from gzlib.c
-- Fix bug in gzseek()
-- Update contrib/vstudio, adding vc9 and vc10 [Kuno, Vollant]
-- Fix zconf.h generation in CMakeLists.txt [Lowman]
-- Improve comments in zconf.h where modified by configure
-
-Changes in 1.2.3.8 (13 Feb 2010)
-- Clean up text files (tabs, trailing whitespace, etc.) [Oberhumer]
-- Use z_off64_t in gz_zero() and gz_skip() to match state->skip
-- Avoid comparison problem when sizeof(int) == sizeof(z_off64_t)
-- Revert to Makefile.in from 1.2.3.6 (live with the clutter)
-- Fix missing error return in gzflush(), add zlib.h note
-- Add *64 functions to zlib.map [Levin]
-- Fix signed/unsigned comparison in gz_comp()
-- Use SFLAGS when testing shared linking in configure
-- Add --64 option to ./configure to use -m64 with gcc
-- Fix ./configure --help to correctly name options
-- Have make fail if a test fails [Levin]
-- Avoid buffer overrun in contrib/masmx64/gvmat64.asm [Simpson]
-- Remove assembler object files from contrib
-
-Changes in 1.2.3.7 (24 Jan 2010)
-- Always gzopen() with O_LARGEFILE if available
-- Fix gzdirect() to work immediately after gzopen() or gzdopen()
-- Make gzdirect() more precise when the state changes while reading
-- Improve zlib.h documentation in many places
-- Catch memory allocation failure in gz_open()
-- Complete close operation if seek forward in gzclose_w() fails
-- Return Z_ERRNO from gzclose_r() if close() fails
-- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL
-- Return zero for gzwrite() errors to match zlib.h description
-- Return -1 on gzputs() error to match zlib.h description
-- Add zconf.in.h to allow recovery from configure modification [Weigelt]
-- Fix static library permissions in Makefile.in [Weigelt]
-- Avoid warnings in configure tests that hide functionality [Weigelt]
-- Add *BSD and DragonFly to Linux case in configure [gentoo 123571]
-- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212]
-- Avoid access of uninitialized data for first inflateReset2 call [Gomes]
-- Keep object files in subdirectories to reduce the clutter somewhat
-- Remove default Makefile and zlibdefs.h, add dummy Makefile
-- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_
-- Remove zlibdefs.h completely -- modify zconf.h instead
-
-Changes in 1.2.3.6 (17 Jan 2010)
-- Avoid void * arithmetic in gzread.c and gzwrite.c
-- Make compilers happier with const char * for gz_error message
-- Avoid unused parameter warning in inflate.c
-- Avoid signed-unsigned comparison warning in inflate.c
-- Indent #pragma's for traditional C
-- Fix usage of strwinerror() in glib.c, change to gz_strwinerror()
-- Correct email address in configure for system options
-- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser]
-- Update zlib.map [Brown]
-- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Torok]
-- Apply various fixes to CMakeLists.txt [Lowman]
-- Add checks on len in gzread() and gzwrite()
-- Add error message for no more room for gzungetc()
-- Remove zlib version check in gzwrite()
-- Defer compression of gzprintf() result until need to
-- Use snprintf() in gzdopen() if available
-- Remove USE_MMAP configuration determination (only used by minigzip)
-- Remove examples/pigz.c (available separately)
-- Update examples/gun.c to 1.6
-
-Changes in 1.2.3.5 (8 Jan 2010)
-- Add space after #if in zutil.h for some compilers
-- Fix relatively harmless bug in deflate_fast() [Exarevsky]
-- Fix same problem in deflate_slow()
-- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown]
-- Add deflate_rle() for faster Z_RLE strategy run-length encoding
-- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding
-- Change name of "write" variable in inffast.c to avoid library collisions
-- Fix premature EOF from gzread() in gzio.c [Brown]
-- Use zlib header window size if windowBits is 0 in inflateInit2()
-- Remove compressBound() call in deflate.c to avoid linking compress.o
-- Replace use of errno in gz* with functions, support WinCE [Alves]
-- Provide alternative to perror() in minigzip.c for WinCE [Alves]
-- Don't use _vsnprintf on later versions of MSVC [Lowman]
-- Add CMake build script and input file [Lowman]
-- Update contrib/minizip to 1.1 [Svensson, Vollant]
-- Moved nintendods directory from contrib to .
-- Replace gzio.c with a new set of routines with the same functionality
-- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
-- Update contrib/minizip to 1.1b
-- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
-
-Changes in 1.2.3.4 (21 Dec 2009)
-- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility
-- Update comments in configure and Makefile.in for default --shared
-- Fix test -z's in configure [Marquess]
-- Build examplesh and minigzipsh when not testing
-- Change NULL's to Z_NULL's in deflate.c and in comments in zlib.h
-- Import LDFLAGS from the environment in configure
-- Fix configure to populate SFLAGS with discovered CFLAGS options
-- Adapt make_vms.com to the new Makefile.in [Zinser]
-- Add zlib2ansi script for C++ compilation [Marquess]
-- Add _FILE_OFFSET_BITS=64 test to make test (when applicable)
-- Add AMD64 assembler code for longest match to contrib [Teterin]
-- Include options from $SFLAGS when doing $LDSHARED
-- Simplify 64-bit file support by introducing z_off64_t type
-- Make shared object files in objs directory to work around old Sun cc
-- Use only three-part version number for Darwin shared compiles
-- Add rc option to ar in Makefile.in for when ./configure not run
-- Add -WI,-rpath,. to LDFLAGS for OSF 1 V4*
-- Set LD_LIBRARYN32_PATH for SGI IRIX shared compile
-- Protect against _FILE_OFFSET_BITS being defined when compiling zlib
-- Rename Makefile.in targets allstatic to static and allshared to shared
-- Fix static and shared Makefile.in targets to be independent
-- Correct error return bug in gz_open() by setting state [Brown]
-- Put spaces before ;;'s in configure for better sh compatibility
-- Add pigz.c (parallel implementation of gzip) to examples/
-- Correct constant in crc32.c to UL [Leventhal]
-- Reject negative lengths in crc32_combine()
-- Add inflateReset2() function to work like inflateEnd()/inflateInit2()
-- Include sys/types.h for _LARGEFILE64_SOURCE [Brown]
-- Correct typo in doc/algorithm.txt [Janik]
-- Fix bug in adler32_combine() [Zhu]
-- Catch missing-end-of-block-code error in all inflates and in puff
-    Assures that random input to inflate eventually results in an error
-- Added enough.c (calculation of ENOUGH for inftrees.h) to examples/
-- Update ENOUGH and its usage to reflect discovered bounds
-- Fix gzerror() error report on empty input file [Brown]
-- Add ush casts in trees.c to avoid pedantic runtime errors
-- Fix typo in zlib.h uncompress() description [Reiss]
-- Correct inflate() comments with regard to automatic header detection
-- Remove deprecation comment on Z_PARTIAL_FLUSH (it stays)
-- Put new version of gzlog (2.0) in examples with interruption recovery
-- Add puff compile option to permit invalid distance-too-far streams
-- Add puff TEST command options, ability to read piped input
-- Prototype the *64 functions in zlib.h when _FILE_OFFSET_BITS == 64, but
-  _LARGEFILE64_SOURCE not defined
-- Fix Z_FULL_FLUSH to truly erase the past by resetting s->strstart
-- Fix deflateSetDictionary() to use all 32K for output consistency
-- Remove extraneous #define MIN_LOOKAHEAD in deflate.c (in deflate.h)
-- Clear bytes after deflate lookahead to avoid use of uninitialized data
-- Change a limit in inftrees.c to be more transparent to Coverity Prevent
-- Update win32/zlib.def with exported symbols from zlib.h
-- Correct spelling errors in zlib.h [Willem, Sobrado]
-- Allow Z_BLOCK for deflate() to force a new block
-- Allow negative bits in inflatePrime() to delete existing bit buffer
-- Add Z_TREES flush option to inflate() to return at end of trees
-- Add inflateMark() to return current state information for random access
-- Add Makefile for NintendoDS to contrib [Costa]
-- Add -w in configure compile tests to avoid spurious warnings [Beucler]
-- Fix typos in zlib.h comments for deflateSetDictionary()
-- Fix EOF detection in transparent gzread() [Maier]
-
-Changes in 1.2.3.3 (2 October 2006)
-- Make --shared the default for configure, add a --static option
-- Add compile option to permit invalid distance-too-far streams
-- Add inflateUndermine() function which is required to enable above
-- Remove use of "this" variable name for C++ compatibility [Marquess]
-- Add testing of shared library in make test, if shared library built
-- Use ftello() and fseeko() if available instead of ftell() and fseek()
-- Provide two versions of all functions that use the z_off_t type for
-  binary compatibility -- a normal version and a 64-bit offset version,
-  per the Large File Support Extension when _LARGEFILE64_SOURCE is
-  defined; use the 64-bit versions by default when _FILE_OFFSET_BITS
-  is defined to be 64
-- Add a --uname= option to configure to perhaps help with cross-compiling
-
-Changes in 1.2.3.2 (3 September 2006)
-- Turn off silly Borland warnings [Hay]
-- Use off64_t and define _LARGEFILE64_SOURCE when present
-- Fix missing dependency on inffixed.h in Makefile.in
-- Rig configure --shared to build both shared and static [Teredesai, Truta]
-- Remove zconf.in.h and instead create a new zlibdefs.h file
-- Fix contrib/minizip/unzip.c non-encrypted after encrypted [Vollant]
-- Add treebuild.xml (see http://treebuild.metux.de/) [Weigelt]
-
-Changes in 1.2.3.1 (16 August 2006)
-- Add watcom directory with OpenWatcom make files [Daniel]
-- Remove #undef of FAR in zconf.in.h for MVS [Fedtke]
-- Update make_vms.com [Zinser]
-- Use -fPIC for shared build in configure [Teredesai, Nicholson]
-- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen]
-- Use fdopen() (not _fdopen()) for Interix in zutil.h [BŠck]
-- Add some FAQ entries about the contrib directory
-- Update the MVS question in the FAQ
-- Avoid extraneous reads after EOF in gzio.c [Brown]
-- Correct spelling of "successfully" in gzio.c [Randers-Pehrson]
-- Add comments to zlib.h about gzerror() usage [Brown]
-- Set extra flags in gzip header in gzopen() like deflate() does
-- Make configure options more compatible with double-dash conventions
-  [Weigelt]
-- Clean up compilation under Solaris SunStudio cc [Rowe, Reinholdtsen]
-- Fix uninstall target in Makefile.in [Truta]
-- Add pkgconfig support [Weigelt]
-- Use $(DESTDIR) macro in Makefile.in [Reinholdtsen, Weigelt]
-- Replace set_data_type() with a more accurate detect_data_type() in
-  trees.c, according to the txtvsbin.txt document [Truta]
-- Swap the order of #include <stdio.h> and #include "zlib.h" in
-  gzio.c, example.c and minigzip.c [Truta]
-- Shut up annoying VS2005 warnings about standard C deprecation [Rowe,
-  Truta] (where?)
-- Fix target "clean" from win32/Makefile.bor [Truta]
-- Create .pdb and .manifest files in win32/makefile.msc [Ziegler, Rowe]
-- Update zlib www home address in win32/DLL_FAQ.txt [Truta]
-- Update contrib/masmx86/inffas32.asm for VS2005 [Vollant, Van Wassenhove]
-- Enable browse info in the "Debug" and "ASM Debug" configurations in
-  the Visual C++ 6 project, and set (non-ASM) "Debug" as default [Truta]
-- Add pkgconfig support [Weigelt]
-- Add ZLIB_VER_MAJOR, ZLIB_VER_MINOR and ZLIB_VER_REVISION in zlib.h,
-  for use in win32/zlib1.rc [Polushin, Rowe, Truta]
-- Add a document that explains the new text detection scheme to
-  doc/txtvsbin.txt [Truta]
-- Add rfc1950.txt, rfc1951.txt and rfc1952.txt to doc/ [Truta]
-- Move algorithm.txt into doc/ [Truta]
-- Synchronize FAQ with website
-- Fix compressBound(), was low for some pathological cases [Fearnley]
-- Take into account wrapper variations in deflateBound()
-- Set examples/zpipe.c input and output to binary mode for Windows
-- Update examples/zlib_how.html with new zpipe.c (also web site)
-- Fix some warnings in examples/gzlog.c and examples/zran.c (it seems
-  that gcc became pickier in 4.0)
-- Add zlib.map for Linux: "All symbols from zlib-1.1.4 remain
-  un-versioned, the patch adds versioning only for symbols introduced in
-  zlib-1.2.0 or later.  It also declares as local those symbols which are
-  not designed to be exported." [Levin]
-- Update Z_PREFIX list in zconf.in.h, add --zprefix option to configure
-- Do not initialize global static by default in trees.c, add a response
-  NO_INIT_GLOBAL_POINTERS to initialize them if needed [Marquess]
-- Don't use strerror() in gzio.c under WinCE [Yakimov]
-- Don't use errno.h in zutil.h under WinCE [Yakimov]
-- Move arguments for AR to its usage to allow replacing ar [Marot]
-- Add HAVE_VISIBILITY_PRAGMA in zconf.in.h for Mozilla [Randers-Pehrson]
-- Improve inflateInit() and inflateInit2() documentation
-- Fix structure size comment in inflate.h
-- Change configure help option from --h* to --help [Santos]
-
-Changes in 1.2.3 (18 July 2005)
-- Apply security vulnerability fixes to contrib/infback9 as well
-- Clean up some text files (carriage returns, trailing space)
-- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant]
-
-Changes in 1.2.2.4 (11 July 2005)
-- Add inflatePrime() function for starting inflation at bit boundary
-- Avoid some Visual C warnings in deflate.c
-- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit
-  compile
-- Fix some spelling errors in comments [Betts]
-- Correct inflateInit2() error return documentation in zlib.h
-- Add zran.c example of compressed data random access to examples
-  directory, shows use of inflatePrime()
-- Fix cast for assignments to strm->state in inflate.c and infback.c
-- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer]
-- Move declarations of gf2 functions to right place in crc32.c [Oberhumer]
-- Add cast in trees.c t avoid a warning [Oberhumer]
-- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer]
-- Update make_vms.com [Zinser]
-- Initialize state->write in inflateReset() since copied in inflate_fast()
-- Be more strict on incomplete code sets in inflate_table() and increase
-  ENOUGH and MAXD -- this repairs a possible security vulnerability for
-  invalid inflate input.  Thanks to Tavis Ormandy and Markus Oberhumer for
-  discovering the vulnerability and providing test cases.
-- Add ia64 support to configure for HP-UX [Smith]
-- Add error return to gzread() for format or i/o error [Levin]
-- Use malloc.h for OS/2 [Necasek]
-
-Changes in 1.2.2.3 (27 May 2005)
-- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile
-- Typecast fread() return values in gzio.c [Vollant]
-- Remove trailing space in minigzip.c outmode (VC++ can't deal with it)
-- Fix crc check bug in gzread() after gzungetc() [Heiner]
-- Add the deflateTune() function to adjust internal compression parameters
-- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack)
-- Remove an incorrect assertion in examples/zpipe.c
-- Add C++ wrapper in infback9.h [Donais]
-- Fix bug in inflateCopy() when decoding fixed codes
-- Note in zlib.h how much deflateSetDictionary() actually uses
-- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used)
-- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer]
-- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer]
-- Add gzdirect() function to indicate transparent reads
-- Update contrib/minizip [Vollant]
-- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer]
-- Add casts in crc32.c to avoid warnings [Oberhumer]
-- Add contrib/masmx64 [Vollant]
-- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant]
-
-Changes in 1.2.2.2 (30 December 2004)
-- Replace structure assignments in deflate.c and inflate.c with zmemcpy to
-  avoid implicit memcpy calls (portability for no-library compilation)
-- Increase sprintf() buffer size in gzdopen() to allow for large numbers
-- Add INFLATE_STRICT to check distances against zlib header
-- Improve WinCE errno handling and comments [Chang]
-- Remove comment about no gzip header processing in FAQ
-- Add Z_FIXED strategy option to deflateInit2() to force fixed trees
-- Add updated make_vms.com [Coghlan], update README
-- Create a new "examples" directory, move gzappend.c there, add zpipe.c,
-  fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html.
-- Add FAQ entry and comments in deflate.c on uninitialized memory access
-- Add Solaris 9 make options in configure [Gilbert]
-- Allow strerror() usage in gzio.c for STDC
-- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer]
-- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant]
-- Use z_off_t for adler32_combine() and crc32_combine() lengths
-- Make adler32() much faster for small len
-- Use OS_CODE in deflate() default gzip header
-
-Changes in 1.2.2.1 (31 October 2004)
-- Allow inflateSetDictionary() call for raw inflate
-- Fix inflate header crc check bug for file names and comments
-- Add deflateSetHeader() and gz_header structure for custom gzip headers
-- Add inflateGetheader() to retrieve gzip headers
-- Add crc32_combine() and adler32_combine() functions
-- Add alloc_func, free_func, in_func, out_func to Z_PREFIX list
-- Use zstreamp consistently in zlib.h (inflate_back functions)
-- Remove GUNZIP condition from definition of inflate_mode in inflate.h
-  and in contrib/inflate86/inffast.S [Truta, Anderson]
-- Add support for AMD64 in contrib/inflate86/inffas86.c [Anderson]
-- Update projects/README.projects and projects/visualc6 [Truta]
-- Update win32/DLL_FAQ.txt [Truta]
-- Avoid warning under NO_GZCOMPRESS in gzio.c; fix typo [Truta]
-- Deprecate Z_ASCII; use Z_TEXT instead [Truta]
-- Use a new algorithm for setting strm->data_type in trees.c [Truta]
-- Do not define an exit() prototype in zutil.c unless DEBUG defined
-- Remove prototype of exit() from zutil.c, example.c, minigzip.c [Truta]
-- Add comment in zlib.h for Z_NO_FLUSH parameter to deflate()
-- Fix Darwin build version identification [Peterson]
-
-Changes in 1.2.2 (3 October 2004)
-- Update zlib.h comments on gzip in-memory processing
-- Set adler to 1 in inflateReset() to support Java test suite [Walles]
-- Add contrib/dotzlib [Ravn]
-- Update win32/DLL_FAQ.txt [Truta]
-- Update contrib/minizip [Vollant]
-- Move contrib/visual-basic.txt to old/ [Truta]
-- Fix assembler builds in projects/visualc6/ [Truta]
-
-Changes in 1.2.1.2 (9 September 2004)
-- Update INDEX file
-- Fix trees.c to update strm->data_type (no one ever noticed!)
-- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown]
-- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE)
-- Add limited multitasking protection to DYNAMIC_CRC_TABLE
-- Add NO_vsnprintf for VMS in zutil.h [Mozilla]
-- Don't declare strerror() under VMS [Mozilla]
-- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize
-- Update contrib/ada [Anisimkov]
-- Update contrib/minizip [Vollant]
-- Fix configure to not hardcode directories for Darwin [Peterson]
-- Fix gzio.c to not return error on empty files [Brown]
-- Fix indentation; update version in contrib/delphi/ZLib.pas and
-  contrib/pascal/zlibpas.pas [Truta]
-- Update mkasm.bat in contrib/masmx86 [Truta]
-- Update contrib/untgz [Truta]
-- Add projects/README.projects [Truta]
-- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta]
-- Update win32/DLL_FAQ.txt [Truta]
-- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta]
-- Remove an unnecessary assignment to curr in inftrees.c [Truta]
-- Add OS/2 to exe builds in configure [Poltorak]
-- Remove err dummy parameter in zlib.h [Kientzle]
-
-Changes in 1.2.1.1 (9 January 2004)
-- Update email address in README
-- Several FAQ updates
-- Fix a big fat bug in inftrees.c that prevented decoding valid
-  dynamic blocks with only literals and no distance codes --
-  Thanks to "Hot Emu" for the bug report and sample file
-- Add a note to puff.c on no distance codes case.
-
-Changes in 1.2.1 (17 November 2003)
-- Remove a tab in contrib/gzappend/gzappend.c
-- Update some interfaces in contrib for new zlib functions
-- Update zlib version number in some contrib entries
-- Add Windows CE definition for ptrdiff_t in zutil.h [Mai, Truta]
-- Support shared libraries on Hurd and KFreeBSD [Brown]
-- Fix error in NO_DIVIDE option of adler32.c
-
-Changes in 1.2.0.8 (4 November 2003)
-- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas
-- Add experimental NO_DIVIDE #define in adler32.c
-    - Possibly faster on some processors (let me know if it is)
-- Correct Z_BLOCK to not return on first inflate call if no wrap
-- Fix strm->data_type on inflate() return to correctly indicate EOB
-- Add deflatePrime() function for appending in the middle of a byte
-- Add contrib/gzappend for an example of appending to a stream
-- Update win32/DLL_FAQ.txt [Truta]
-- Delete Turbo C comment in README [Truta]
-- Improve some indentation in zconf.h [Truta]
-- Fix infinite loop on bad input in configure script [Church]
-- Fix gzeof() for concatenated gzip files [Johnson]
-- Add example to contrib/visual-basic.txt [Michael B.]
-- Add -p to mkdir's in Makefile.in [vda]
-- Fix configure to properly detect presence or lack of printf functions
-- Add AS400 support [Monnerat]
-- Add a little Cygwin support [Wilson]
-
-Changes in 1.2.0.7 (21 September 2003)
-- Correct some debug formats in contrib/infback9
-- Cast a type in a debug statement in trees.c
-- Change search and replace delimiter in configure from % to # [Beebe]
-- Update contrib/untgz to 0.2 with various fixes [Truta]
-- Add build support for Amiga [Nikl]
-- Remove some directories in old that have been updated to 1.2
-- Add dylib building for Mac OS X in configure and Makefile.in
-- Remove old distribution stuff from Makefile
-- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X
-- Update links in README
-
-Changes in 1.2.0.6 (13 September 2003)
-- Minor FAQ updates
-- Update contrib/minizip to 1.00 [Vollant]
-- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta]
-- Update POSTINC comment for 68060 [Nikl]
-- Add contrib/infback9 with deflate64 decoding (unsupported)
-- For MVS define NO_vsnprintf and undefine FAR [van Burik]
-- Add pragma for fdopen on MVS [van Burik]
-
-Changes in 1.2.0.5 (8 September 2003)
-- Add OF to inflateBackEnd() declaration in zlib.h
-- Remember start when using gzdopen in the middle of a file
-- Use internal off_t counters in gz* functions to properly handle seeks
-- Perform more rigorous check for distance-too-far in inffast.c
-- Add Z_BLOCK flush option to return from inflate at block boundary
-- Set strm->data_type on return from inflate
-    - Indicate bits unused, if at block boundary, and if in last block
-- Replace size_t with ptrdiff_t in crc32.c, and check for correct size
-- Add condition so old NO_DEFLATE define still works for compatibility
-- FAQ update regarding the Windows DLL [Truta]
-- INDEX update: add qnx entry, remove aix entry [Truta]
-- Install zlib.3 into mandir [Wilson]
-- Move contrib/zlib_dll_FAQ.txt to win32/DLL_FAQ.txt; update [Truta]
-- Adapt the zlib interface to the new DLL convention guidelines [Truta]
-- Introduce ZLIB_WINAPI macro to allow the export of functions using
-  the WINAPI calling convention, for Visual Basic [Vollant, Truta]
-- Update msdos and win32 scripts and makefiles [Truta]
-- Export symbols by name, not by ordinal, in win32/zlib.def [Truta]
-- Add contrib/ada [Anisimkov]
-- Move asm files from contrib/vstudio/vc70_32 to contrib/asm386 [Truta]
-- Rename contrib/asm386 to contrib/masmx86 [Truta, Vollant]
-- Add contrib/masm686 [Truta]
-- Fix offsets in contrib/inflate86 and contrib/masmx86/inffas32.asm
-  [Truta, Vollant]
-- Update contrib/delphi; rename to contrib/pascal; add example [Truta]
-- Remove contrib/delphi2; add a new contrib/delphi [Truta]
-- Avoid inclusion of the nonstandard <memory.h> in contrib/iostream,
-  and fix some method prototypes [Truta]
-- Fix the ZCR_SEED2 constant to avoid warnings in contrib/minizip
-  [Truta]
-- Avoid the use of backslash (\) in contrib/minizip [Vollant]
-- Fix file time handling in contrib/untgz; update makefiles [Truta]
-- Update contrib/vstudio/vc70_32 to comply with the new DLL guidelines
-  [Vollant]
-- Remove contrib/vstudio/vc15_16 [Vollant]
-- Rename contrib/vstudio/vc70_32 to contrib/vstudio/vc7 [Truta]
-- Update README.contrib [Truta]
-- Invert the assignment order of match_head and s->prev[...] in
-  INSERT_STRING [Truta]
-- Compare TOO_FAR with 32767 instead of 32768, to avoid 16-bit warnings
-  [Truta]
-- Compare function pointers with 0, not with NULL or Z_NULL [Truta]
-- Fix prototype of syncsearch in inflate.c [Truta]
-- Introduce ASMINF macro to be enabled when using an ASM implementation
-  of inflate_fast [Truta]
-- Change NO_DEFLATE to NO_GZCOMPRESS [Truta]
-- Modify test_gzio in example.c to take a single file name as a
-  parameter [Truta]
-- Exit the example.c program if gzopen fails [Truta]
-- Add type casts around strlen in example.c [Truta]
-- Remove casting to sizeof in minigzip.c; give a proper type
-  to the variable compared with SUFFIX_LEN [Truta]
-- Update definitions of STDC and STDC99 in zconf.h [Truta]
-- Synchronize zconf.h with the new Windows DLL interface [Truta]
-- Use SYS16BIT instead of __32BIT__ to distinguish between
-  16- and 32-bit platforms [Truta]
-- Use far memory allocators in small 16-bit memory models for
-  Turbo C [Truta]
-- Add info about the use of ASMV, ASMINF and ZLIB_WINAPI in
-  zlibCompileFlags [Truta]
-- Cygwin has vsnprintf [Wilson]
-- In Windows16, OS_CODE is 0, as in MSDOS [Truta]
-- In Cygwin, OS_CODE is 3 (Unix), not 11 (Windows32) [Wilson]
-
-Changes in 1.2.0.4 (10 August 2003)
-- Minor FAQ updates
-- Be more strict when checking inflateInit2's windowBits parameter
-- Change NO_GUNZIP compile option to NO_GZIP to cover deflate as well
-- Add gzip wrapper option to deflateInit2 using windowBits
-- Add updated QNX rule in configure and qnx directory [Bonnefoy]
-- Make inflate distance-too-far checks more rigorous
-- Clean up FAR usage in inflate
-- Add casting to sizeof() in gzio.c and minigzip.c
-
-Changes in 1.2.0.3 (19 July 2003)
-- Fix silly error in gzungetc() implementation [Vollant]
-- Update contrib/minizip and contrib/vstudio [Vollant]
-- Fix printf format in example.c
-- Correct cdecl support in zconf.in.h [Anisimkov]
-- Minor FAQ updates
-
-Changes in 1.2.0.2 (13 July 2003)
-- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons
-- Attempt to avoid warnings in crc32.c for pointer-int conversion
-- Add AIX to configure, remove aix directory [Bakker]
-- Add some casts to minigzip.c
-- Improve checking after insecure sprintf() or vsprintf() calls
-- Remove #elif's from crc32.c
-- Change leave label to inf_leave in inflate.c and infback.c to avoid
-  library conflicts
-- Remove inflate gzip decoding by default--only enable gzip decoding by
-  special request for stricter backward compatibility
-- Add zlibCompileFlags() function to return compilation information
-- More typecasting in deflate.c to avoid warnings
-- Remove leading underscore from _Capital #defines [Truta]
-- Fix configure to link shared library when testing
-- Add some Windows CE target adjustments [Mai]
-- Remove #define ZLIB_DLL in zconf.h [Vollant]
-- Add zlib.3 [Rodgers]
-- Update RFC URL in deflate.c and algorithm.txt [Mai]
-- Add zlib_dll_FAQ.txt to contrib [Truta]
-- Add UL to some constants [Truta]
-- Update minizip and vstudio [Vollant]
-- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h
-- Expand use of NO_DUMMY_DECL to avoid all dummy structures
-- Added iostream3 to contrib [Schwardt]
-- Replace rewind() with fseek() for WinCE [Truta]
-- Improve setting of zlib format compression level flags
-    - Report 0 for huffman and rle strategies and for level == 0 or 1
-    - Report 2 only for level == 6
-- Only deal with 64K limit when necessary at compile time [Truta]
-- Allow TOO_FAR check to be turned off at compile time [Truta]
-- Add gzclearerr() function [Souza]
-- Add gzungetc() function
-
-Changes in 1.2.0.1 (17 March 2003)
-- Add Z_RLE strategy for run-length encoding [Truta]
-    - When Z_RLE requested, restrict matches to distance one
-    - Update zlib.h, minigzip.c, gzopen(), gzdopen() for Z_RLE
-- Correct FASTEST compilation to allow level == 0
-- Clean up what gets compiled for FASTEST
-- Incorporate changes to zconf.in.h [Vollant]
-    - Refine detection of Turbo C need for dummy returns
-    - Refine ZLIB_DLL compilation
-    - Include additional header file on VMS for off_t typedef
-- Try to use _vsnprintf where it supplants vsprintf [Vollant]
-- Add some casts in inffast.c
-- Enchance comments in zlib.h on what happens if gzprintf() tries to
-  write more than 4095 bytes before compression
-- Remove unused state from inflateBackEnd()
-- Remove exit(0) from minigzip.c, example.c
-- Get rid of all those darn tabs
-- Add "check" target to Makefile.in that does the same thing as "test"
-- Add "mostlyclean" and "maintainer-clean" targets to Makefile.in
-- Update contrib/inflate86 [Anderson]
-- Update contrib/testzlib, contrib/vstudio, contrib/minizip [Vollant]
-- Add msdos and win32 directories with makefiles [Truta]
-- More additions and improvements to the FAQ
-
-Changes in 1.2.0 (9 March 2003)
-- New and improved inflate code
-    - About 20% faster
-    - Does not allocate 32K window unless and until needed
-    - Automatically detects and decompresses gzip streams
-    - Raw inflate no longer needs an extra dummy byte at end
-    - Added inflateBack functions using a callback interface--even faster
-      than inflate, useful for file utilities (gzip, zip)
-    - Added inflateCopy() function to record state for random access on
-      externally generated deflate streams (e.g. in gzip files)
-    - More readable code (I hope)
-- New and improved crc32()
-    - About 50% faster, thanks to suggestions from Rodney Brown
-- Add deflateBound() and compressBound() functions
-- Fix memory leak in deflateInit2()
-- Permit setting dictionary for raw deflate (for parallel deflate)
-- Fix const declaration for gzwrite()
-- Check for some malloc() failures in gzio.c
-- Fix bug in gzopen() on single-byte file 0x1f
-- Fix bug in gzread() on concatenated file with 0x1f at end of buffer
-  and next buffer doesn't start with 0x8b
-- Fix uncompress() to return Z_DATA_ERROR on truncated input
-- Free memory at end of example.c
-- Remove MAX #define in trees.c (conflicted with some libraries)
-- Fix static const's in deflate.c, gzio.c, and zutil.[ch]
-- Declare malloc() and free() in gzio.c if STDC not defined
-- Use malloc() instead of calloc() in zutil.c if int big enough
-- Define STDC for AIX
-- Add aix/ with approach for compiling shared library on AIX
-- Add HP-UX support for shared libraries in configure
-- Add OpenUNIX support for shared libraries in configure
-- Use $cc instead of gcc to build shared library
-- Make prefix directory if needed when installing
-- Correct Macintosh avoidance of typedef Byte in zconf.h
-- Correct Turbo C memory allocation when under Linux
-- Use libz.a instead of -lz in Makefile (assure use of compiled library)
-- Update configure to check for snprintf or vsnprintf functions and their
-  return value, warn during make if using an insecure function
-- Fix configure problem with compile-time knowledge of HAVE_UNISTD_H that
-  is lost when library is used--resolution is to build new zconf.h
-- Documentation improvements (in zlib.h):
-    - Document raw deflate and inflate
-    - Update RFCs URL
-    - Point out that zlib and gzip formats are different
-    - Note that Z_BUF_ERROR is not fatal
-    - Document string limit for gzprintf() and possible buffer overflow
-    - Note requirement on avail_out when flushing
-    - Note permitted values of flush parameter of inflate()
-- Add some FAQs (and even answers) to the FAQ
-- Add contrib/inflate86/ for x86 faster inflate
-- Add contrib/blast/ for PKWare Data Compression Library decompression
-- Add contrib/puff/ simple inflate for deflate format description
-
-Changes in 1.1.4 (11 March 2002)
-- ZFREE was repeated on same allocation on some error conditions.
-  This creates a security problem described in
-  http://www.zlib.org/advisory-2002-03-11.txt
-- Returned incorrect error (Z_MEM_ERROR) on some invalid data
-- Avoid accesses before window for invalid distances with inflate window
-  less than 32K.
-- force windowBits > 8 to avoid a bug in the encoder for a window size
-  of 256 bytes. (A complete fix will be available in 1.1.5).
-
-Changes in 1.1.3 (9 July 1998)
-- fix "an inflate input buffer bug that shows up on rare but persistent
-  occasions" (Mark)
-- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
-- fix gzseek(..., SEEK_SET) in write mode
-- fix crc check after a gzeek (Frank Faubert)
-- fix miniunzip when the last entry in a zip file is itself a zip file
-  (J Lillge)
-- add contrib/asm586 and contrib/asm686 (Brian Raiter)
-  See http://www.muppetlabs.com/~breadbox/software/assembly.html
-- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
-- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
-- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
-- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
-- added a FAQ file
-
-- Support gzdopen on Mac with Metrowerks (Jason Linhart)
-- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
-- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
-- avoid some warnings with Borland C (Tom Tanner)
-- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
-- emulate utime() for WIN32 in contrib/untgz  (Gilles Vollant)
-- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
-- use libdir and includedir in Makefile.in (Tim Mooney)
-- support shared libraries on OSF1 V4 (Tim Mooney)
-- remove so_locations in "make clean"  (Tim Mooney)
-- fix maketree.c compilation error (Glenn, Mark)
-- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
-- new Makefile.riscos (Rich Walker)
-- initialize static descriptors in trees.c for embedded targets (Nick Smith)
-- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
-- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
-- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
-- fix maketree.c to allow clean compilation of inffixed.h (Mark)
-- fix parameter check in deflateCopy (Gunther Nikl)
-- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
-- Many portability patches by Christian Spieler:
-  . zutil.c, zutil.h: added "const" for zmem*
-  . Make_vms.com: fixed some typos
-  . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
-  . msdos/Makefile.msc: remove "default rtl link library" info from obj files
-  . msdos/Makefile.*: use model-dependent name for the built zlib library
-  . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
-     new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
-- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
-- replace __far with _far for better portability (Christian Spieler, Tom Lane)
-- fix test for errno.h in configure (Tim Newsham)
-
-Changes in 1.1.2 (19 March 98)
-- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
-  See http://www.winimage.com/zLibDll/unzip.html
-- preinitialize the inflate tables for fixed codes, to make the code
-  completely thread safe (Mark)
-- some simplifications and slight speed-up to the inflate code (Mark)
-- fix gzeof on non-compressed files (Allan Schrum)
-- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs)
-- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn)
-- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
-- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori)
-- do not wrap extern "C" around system includes (Tom Lane)
-- mention zlib binding for TCL in README (Andreas Kupries)
-- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert)
-- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
-- allow "configure --prefix $HOME" (Tim Mooney)
-- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson)
-- move Makefile.sas to amiga/Makefile.sas
-
-Changes in 1.1.1 (27 Feb 98)
-- fix macros _tr_tally_* in deflate.h for debug mode  (Glenn Randers-Pehrson)
-- remove block truncation heuristic which had very marginal effect for zlib
-  (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
-  compression ratio on some files. This also allows inlining _tr_tally for
-  matches in deflate_slow.
-- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
-
-Changes in 1.1.0 (24 Feb 98)
-- do not return STREAM_END prematurely in inflate (John Bowler)
-- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
-- compile with -DFASTEST to get compression code optimized for speed only
-- in minigzip, try mmap'ing the input file first (Miguel Albrecht)
-- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain
-  on Sun but significant on HP)
-
-- add a pointer to experimental unzip library in README (Gilles Vollant)
-- initialize variable gcc in configure (Chris Herborth)
-
-Changes in 1.0.9 (17 Feb 1998)
-- added gzputs and gzgets functions
-- do not clear eof flag in gzseek (Mark Diekhans)
-- fix gzseek for files in transparent mode (Mark Diekhans)
-- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
-- replace EXPORT with ZEXPORT to avoid conflict with other programs
-- added compress2 in zconf.h, zlib.def, zlib.dnt
-- new asm code from Gilles Vollant in contrib/asm386
-- simplify the inflate code (Mark):
- . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
- . ZALLOC the length list in inflate_trees_fixed() instead of using stack
- . ZALLOC the value area for huft_build() instead of using stack
- . Simplify Z_FINISH check in inflate()
-
-- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
-- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
-- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
-  the declaration of FAR (Gilles VOllant)
-- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
-- read_buf buf parameter of type Bytef* instead of charf*
-- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
-- do not redeclare unlink in minigzip.c for WIN32 (John Bowler)
-- fix check for presence of directories in "make install" (Ian Willis)
-
-Changes in 1.0.8 (27 Jan 1998)
-- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
-- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
-- added compress2() to allow setting the compression level
-- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
-- use constant arrays for the static trees in trees.c instead of computing
-  them at run time (thanks to Ken Raeburn for this suggestion). To create
-  trees.h, compile with GEN_TREES_H and run "make test".
-- check return code of example in "make test" and display result
-- pass minigzip command line options to file_compress
-- simplifying code of inflateSync to avoid gcc 2.8 bug
-
-- support CC="gcc -Wall" in configure -s (QingLong)
-- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn)
-- fix test for shared library support to avoid compiler warnings
-- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant)
-- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit)
-- do not use fdopen for Metrowerks on Mac (Brad Pettit))
-- add checks for gzputc and gzputc in example.c
-- avoid warnings in gzio.c and deflate.c (Andreas Kleinert)
-- use const for the CRC table (Ken Raeburn)
-- fixed "make uninstall" for shared libraries
-- use Tracev instead of Trace in infblock.c
-- in example.c use correct compressed length for test_sync
-- suppress +vnocompatwarnings in configure for HPUX (not always supported)
-
-Changes in 1.0.7 (20 Jan 1998)
-- fix gzseek which was broken in write mode
-- return error for gzseek to negative absolute position
-- fix configure for Linux (Chun-Chung Chen)
-- increase stack space for MSC (Tim Wegner)
-- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant)
-- define EXPORTVA for gzprintf (Gilles Vollant)
-- added man page zlib.3 (Rick Rodgers)
-- for contrib/untgz, fix makedir() and improve Makefile
-
-- check gzseek in write mode in example.c
-- allocate extra buffer for seeks only if gzseek is actually called
-- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant)
-- add inflateSyncPoint in zconf.h
-- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def
-
-Changes in 1.0.6 (19 Jan 1998)
-- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
-  gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
-- Fix a deflate bug occurring only with compression level 0 (thanks to
-  Andy Buckler for finding this one).
-- In minigzip, pass transparently also the first byte for .Z files.
-- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
-- check Z_FINISH in inflate (thanks to Marc Schluper)
-- Implement deflateCopy (thanks to Adam Costello)
-- make static libraries by default in configure, add --shared option.
-- move MSDOS or Windows specific files to directory msdos
-- suppress the notion of partial flush to simplify the interface
-  (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
-- suppress history buffer provided by application to simplify the interface
-  (this feature was not implemented anyway in 1.0.4)
-- next_in and avail_in must be initialized before calling inflateInit or
-  inflateInit2
-- add EXPORT in all exported functions (for Windows DLL)
-- added Makefile.nt (thanks to Stephen Williams)
-- added the unsupported "contrib" directory:
-   contrib/asm386/ by Gilles Vollant <info@winimage.com>
-        386 asm code replacing longest_match().
-   contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
-        A C++ I/O streams interface to the zlib gz* functions
-   contrib/iostream2/  by Tyge Løvset <Tyge.Lovset@cmr.no>
-        Another C++ I/O streams interface
-   contrib/untgz/  by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
-        A very simple tar.gz file extractor using zlib
-   contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
-        How to use compress(), uncompress() and the gz* functions from VB.
-- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
-  level) in minigzip (thanks to Tom Lane)
-
-- use const for rommable constants in deflate
-- added test for gzseek and gztell in example.c
-- add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
-- add undocumented function zError to convert error code to string
-  (for Tim Smithers)
-- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
-- Use default memcpy for Symantec MSDOS compiler.
-- Add EXPORT keyword for check_func (needed for Windows DLL)
-- add current directory to LD_LIBRARY_PATH for "make test"
-- create also a link for libz.so.1
-- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
-- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
-- added -soname for Linux in configure (Chun-Chung Chen,
-- assign numbers to the exported functions in zlib.def (for Windows DLL)
-- add advice in zlib.h for best usage of deflateSetDictionary
-- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
-- allow compilation with ANSI keywords only enabled for TurboC in large model
-- avoid "versionString"[0] (Borland bug)
-- add NEED_DUMMY_RETURN for Borland
-- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
-- allow compilation with CC
-- defined STDC for OS/2 (David Charlap)
-- limit external names to 8 chars for MVS (Thomas Lund)
-- in minigzip.c, use static buffers only for 16-bit systems
-- fix suffix check for "minigzip -d foo.gz"
-- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
-- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
-- added makelcc.bat for lcc-win32 (Tom St Denis)
-- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
-- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
-- check for unistd.h in configure (for off_t)
-- remove useless check parameter in inflate_blocks_free
-- avoid useless assignment of s->check to itself in inflate_blocks_new
-- do not flush twice in gzclose (thanks to Ken Raeburn)
-- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
-- use NO_ERRNO_H instead of enumeration of operating systems with errno.h
-- work around buggy fclose on pipes for HP/UX
-- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson)
-- fix configure if CC is already equal to gcc
-
-Changes in 1.0.5 (3 Jan 98)
-- Fix inflate to terminate gracefully when fed corrupted or invalid data
-- Use const for rommable constants in inflate
-- Eliminate memory leaks on error conditions in inflate
-- Removed some vestigial code in inflate
-- Update web address in README
-
-Changes in 1.0.4 (24 Jul 96)
-- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
-  bit, so the decompressor could decompress all the correct data but went
-  on to attempt decompressing extra garbage data. This affected minigzip too.
-- zlibVersion and gzerror return const char* (needed for DLL)
-- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
-- use z_error only for DEBUG (avoid problem with DLLs)
-
-Changes in 1.0.3 (2 Jul 96)
-- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS
-  small and medium models; this makes the library incompatible with previous
-  versions for these models. (No effect in large model or on other systems.)
-- return OK instead of BUF_ERROR if previous deflate call returned with
-  avail_out as zero but there is nothing to do
-- added memcmp for non STDC compilers
-- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly)
-- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO)
-- better check for 16-bit mode MSC (avoids problem with Symantec)
-
-Changes in 1.0.2 (23 May 96)
-- added Windows DLL support
-- added a function zlibVersion (for the DLL support)
-- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model)
-- Bytef is define's instead of typedef'd only for Borland C
-- avoid reading uninitialized memory in example.c
-- mention in README that the zlib format is now RFC1950
-- updated Makefile.dj2
-- added algorithm.doc
-
-Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
-- fix array overlay in deflate.c which sometimes caused bad compressed data
-- fix inflate bug with empty stored block
-- fix MSDOS medium model which was broken in 0.99
-- fix deflateParams() which could generated bad compressed data.
-- Bytef is define'd instead of typedef'ed (work around Borland bug)
-- added an INDEX file
-- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
-  Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
-- speed up adler32 for modern machines without auto-increment
-- added -ansi for IRIX in configure
-- static_init_done in trees.c is an int
-- define unlink as delete for VMS
-- fix configure for QNX
-- add configure branch for SCO and HPUX
-- avoid many warnings (unused variables, dead assignments, etc...)
-- no fdopen for BeOS
-- fix the Watcom fix for 32 bit mode (define FAR as empty)
-- removed redefinition of Byte for MKWERKS
-- work around an MWKERKS bug (incorrect merge of all .h files)
-
-Changes in 0.99 (27 Jan 96)
-- allow preset dictionary shared between compressor and decompressor
-- allow compression level 0 (no compression)
-- add deflateParams in zlib.h: allow dynamic change of compression level
-  and compression strategy.
-- test large buffers and deflateParams in example.c
-- add optional "configure" to build zlib as a shared library
-- suppress Makefile.qnx, use configure instead
-- fixed deflate for 64-bit systems (detected on Cray)
-- fixed inflate_blocks for 64-bit systems (detected on Alpha)
-- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2)
-- always return Z_BUF_ERROR when deflate() has nothing to do
-- deflateInit and inflateInit are now macros to allow version checking
-- prefix all global functions and types with z_ with -DZ_PREFIX
-- make falloc completely reentrant (inftrees.c)
-- fixed very unlikely race condition in ct_static_init
-- free in reverse order of allocation to help memory manager
-- use zlib-1.0/* instead of zlib/* inside the tar.gz
-- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith
-  -Wconversion -Wstrict-prototypes -Wmissing-prototypes"
-- allow gzread on concatenated .gz files
-- deflateEnd now returns Z_DATA_ERROR if it was premature
-- deflate is finally (?) fully deterministic (no matches beyond end of input)
-- Document Z_SYNC_FLUSH
-- add uninstall in Makefile
-- Check for __cpluplus in zlib.h
-- Better test in ct_align for partial flush
-- avoid harmless warnings for Borland C++
-- initialize hash_head in deflate.c
-- avoid warning on fdopen (gzio.c) for HP cc -Aa
-- include stdlib.h for STDC compilers
-- include errno.h for Cray
-- ignore error if ranlib doesn't exist
-- call ranlib twice for NeXTSTEP
-- use exec_prefix instead of prefix for libz.a
-- renamed ct_* as _tr_* to avoid conflict with applications
-- clear z->msg in inflateInit2 before any error return
-- initialize opaque in example.c, gzio.c, deflate.c and inflate.c
-- fixed typo in zconf.h (_GNUC__ => __GNUC__)
-- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode)
-- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
-- in fcalloc, normalize pointer if size > 65520 bytes
-- don't use special fcalloc for 32 bit Borland C++
-- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
-- use Z_BINARY instead of BINARY
-- document that gzclose after gzdopen will close the file
-- allow "a" as mode in gzopen.
-- fix error checking in gzread
-- allow skipping .gz extra-field on pipes
-- added reference to Perl interface in README
-- put the crc table in FAR data (I dislike more and more the medium model :)
-- added get_crc_table
-- added a dimension to all arrays (Borland C can't count).
-- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
-- guard against multiple inclusion of *.h (for precompiled header on Mac)
-- Watcom C pretends to be Microsoft C small model even in 32 bit mode.
-- don't use unsized arrays to avoid silly warnings by Visual C++:
-     warning C4746: 'inflate_mask' : unsized array treated as  '__far'
-     (what's wrong with far data in far model?).
-- define enum out of inflate_blocks_state to allow compilation with C++
-
-Changes in 0.95 (16 Aug 95)
-- fix MSDOS small and medium model (now easier to adapt to any compiler)
-- inlined send_bits
-- fix the final (:-) bug for deflate with flush (output was correct but
-  not completely flushed in rare occasions).
-- default window size is same for compression and decompression
-  (it's now sufficient to set MAX_WBITS in zconf.h).
-- voidp -> voidpf and voidnp -> voidp (for consistency with other
-  typedefs and because voidnp was not near in large model).
-
-Changes in 0.94 (13 Aug 95)
-- support MSDOS medium model
-- fix deflate with flush (could sometimes generate bad output)
-- fix deflateReset (zlib header was incorrectly suppressed)
-- added support for VMS
-- allow a compression level in gzopen()
-- gzflush now calls fflush
-- For deflate with flush, flush even if no more input is provided.
-- rename libgz.a as libz.a
-- avoid complex expression in infcodes.c triggering Turbo C bug
-- work around a problem with gcc on Alpha (in INSERT_STRING)
-- don't use inline functions (problem with some gcc versions)
-- allow renaming of Byte, uInt, etc... with #define.
-- avoid warning about (unused) pointer before start of array in deflate.c
-- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
-- avoid reserved word 'new' in trees.c
-
-Changes in 0.93 (25 June 95)
-- temporarily disable inline functions
-- make deflate deterministic
-- give enough lookahead for PARTIAL_FLUSH
-- Set binary mode for stdin/stdout in minigzip.c for OS/2
-- don't even use signed char in inflate (not portable enough)
-- fix inflate memory leak for segmented architectures
-
-Changes in 0.92 (3 May 95)
-- don't assume that char is signed (problem on SGI)
-- Clear bit buffer when starting a stored block
-- no memcpy on Pyramid
-- suppressed inftest.c
-- optimized fill_window, put longest_match inline for gcc
-- optimized inflate on stored blocks.
-- untabify all sources to simplify patches
-
-Changes in 0.91 (2 May 95)
-- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
-- Document the memory requirements in zconf.h
-- added "make install"
-- fix sync search logic in inflateSync
-- deflate(Z_FULL_FLUSH) now works even if output buffer too short
-- after inflateSync, don't scare people with just "lo world"
-- added support for DJGPP
-
-Changes in 0.9 (1 May 95)
-- don't assume that zalloc clears the allocated memory (the TurboC bug
-  was Mark's bug after all :)
-- let again gzread copy uncompressed data unchanged (was working in 0.71)
-- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
-- added a test of inflateSync in example.c
-- moved MAX_WBITS to zconf.h because users might want to change that.
-- document explicitly that zalloc(64K) on MSDOS must return a normalized
-  pointer (zero offset)
-- added Makefiles for Microsoft C, Turbo C, Borland C++
-- faster crc32()
-
-Changes in 0.8 (29 April 95)
-- added fast inflate (inffast.c)
-- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
-  is incompatible with previous versions of zlib which returned Z_OK.
-- work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
-  (actually that was not a compiler bug, see 0.81 above)
-- gzread no longer reads one extra byte in certain cases
-- In gzio destroy(), don't reference a freed structure
-- avoid many warnings for MSDOS
-- avoid the ERROR symbol which is used by MS Windows
-
-Changes in 0.71 (14 April 95)
-- Fixed more MSDOS compilation problems :( There is still a bug with
-  TurboC large model.
-
-Changes in 0.7 (14 April 95)
-- Added full inflate support.
-- Simplified the crc32() interface. The pre- and post-conditioning
-  (one's complement) is now done inside crc32(). WARNING: this is
-  incompatible with previous versions; see zlib.h for the new usage.
-
-Changes in 0.61 (12 April 95)
-- workaround for a bug in TurboC. example and minigzip now work on MSDOS.
-
-Changes in 0.6 (11 April 95)
-- added minigzip.c
-- added gzdopen to reopen a file descriptor as gzFile
-- added transparent reading of non-gziped files in gzread.
-- fixed bug in gzread (don't read crc as data)
-- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose).
-- don't allocate big arrays in the stack (for MSDOS)
-- fix some MSDOS compilation problems
-
-Changes in 0.5:
-- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
-  not yet Z_FULL_FLUSH.
-- support decompression but only in a single step (forced Z_FINISH)
-- added opaque object for zalloc and zfree.
-- added deflateReset and inflateReset
-- added a variable zlib_version for consistency checking.
-- renamed the 'filter' parameter of deflateInit2 as 'strategy'.
-  Added Z_FILTERED and Z_HUFFMAN_ONLY constants.
-
-Changes in 0.4:
-- avoid "zip" everywhere, use zlib instead of ziplib.
-- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
-  if compression method == 8.
-- added adler32 and crc32
-- renamed deflateOptions as deflateInit2, call one or the other but not both
-- added the method parameter for deflateInit2.
-- added inflateInit2
-- simplied considerably deflateInit and inflateInit by not supporting
-  user-provided history buffer. This is supported only in deflateInit2
-  and inflateInit2.
-
-Changes in 0.3:
-- prefix all macro names with Z_
-- use Z_FINISH instead of deflateEnd to finish compression.
-- added Z_HUFFMAN_ONLY
-- added gzerror()
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/README b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/README
deleted file mode 100644
index 5ca9d12..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/README
+++ /dev/null
@@ -1,115 +0,0 @@
-ZLIB DATA COMPRESSION LIBRARY
-
-zlib 1.2.8 is a general purpose data compression library.  All the code is
-thread safe.  The data format used by the zlib library is described by RFCs
-(Request for Comments) 1950 to 1952 in the files
-http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
-rfc1952 (gzip format).
-
-All functions of the compression library are documented in the file zlib.h
-(volunteer to write man pages welcome, contact zlib@gzip.org).  A usage example
-of the library is given in the file test/example.c which also tests that
-the library is working correctly.  Another example is given in the file
-test/minigzip.c.  The compression library itself is composed of all source
-files in the root directory.
-
-To compile all files and run the test program, follow the instructions given at
-the top of Makefile.in.  In short "./configure; make test", and if that goes
-well, "make install" should work for most flavors of Unix.  For Windows, use
-one of the special makefiles in win32/ or contrib/vstudio/ .  For VMS, use
-make_vms.com.
-
-Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
-<info@winimage.com> for the Windows DLL version.  The zlib home page is
-http://zlib.net/ .  Before reporting a problem, please check this site to
-verify that you have the latest version of zlib; otherwise get the latest
-version and check whether the problem still exists or not.
-
-PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
-
-Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan.  1997
-issue of Dr.  Dobb's Journal; a copy of the article is available at
-http://marknelson.us/1997/01/01/zlib-engine/ .
-
-The changes made in version 1.2.8 are documented in the file ChangeLog.
-
-Unsupported third party contributions are provided in directory contrib/ .
-
-zlib is available in Java using the java.util.zip package, documented at
-http://java.sun.com/developer/technicalArticles/Programming/compression/ .
-
-A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
-at CPAN (Comprehensive Perl Archive Network) sites, including
-http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
-
-A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
-available in Python 1.5 and later versions, see
-http://docs.python.org/library/zlib.html .
-
-zlib is built into tcl: http://wiki.tcl.tk/4610 .
-
-An experimental package to read and write files in .zip format, written on top
-of zlib by Gilles Vollant <info@winimage.com>, is available in the
-contrib/minizip directory of zlib.
-
-
-Notes for some targets:
-
-- For Windows DLL versions, please see win32/DLL_FAQ.txt
-
-- For 64-bit Irix, deflate.c must be compiled without any optimization. With
-  -O, one libpng test fails. The test works in 32 bit mode (with the -n32
-  compiler flag). The compiler bug has been reported to SGI.
-
-- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
-  when compiled with cc.
-
-- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
-  necessary to get gzprintf working correctly. This is done by configure.
-
-- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
-  other compilers. Use "make test" to check your compiler.
-
-- gzdopen is not supported on RISCOS or BEOS.
-
-- For PalmOs, see http://palmzlib.sourceforge.net/
-
-
-Acknowledgments:
-
-  The deflate format used by zlib was defined by Phil Katz.  The deflate and
-  zlib specifications were written by L.  Peter Deutsch.  Thanks to all the
-  people who reported problems and suggested various improvements in zlib; they
-  are too numerous to cite here.
-
-Copyright notice:
-
- (C) 1995-2013 Jean-loup Gailly and Mark Adler
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  Jean-loup Gailly        Mark Adler
-  jloup@gzip.org          madler@alumni.caltech.edu
-
-If you use the zlib library in a product, we would appreciate *not* receiving
-lengthy legal documents to sign.  The sources are provided for free but without
-warranty of any kind.  The library has been entirely written by Jean-loup
-Gailly and Mark Adler; it does not include third-party code.
-
-If you redistribute modified sources, we would appreciate that you include in
-the file ChangeLog history information documenting your changes.  Please read
-the FAQ for more information on the distribution of modified source versions.
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/compress.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/compress.c
deleted file mode 100644
index cdc51e0..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/compress.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* compress.c -- compress a memory buffer
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#define ZLIB_INTERNAL
-#include "zlib.h"
-
-/* ===========================================================================
-     Compresses the source buffer into the destination buffer. The level
-   parameter has the same meaning as in deflateInit.  sourceLen is the byte
-   length of the source buffer. Upon entry, destLen is the total size of the
-   destination buffer, which must be at least 0.1% larger than sourceLen plus
-   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
-
-     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
-   Z_STREAM_ERROR if the level parameter is invalid.
-*/
-int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
-    Bytef *dest;
-    uLongf *destLen;
-    const Bytef *source;
-    uLong sourceLen;
-    int level;
-{
-    z_stream stream;
-    int err;
-
-    stream.next_in = (z_const Bytef *)source;
-    stream.avail_in = (uInt)sourceLen;
-#ifdef MAXSEG_64K
-    /* Check for source > 64K on 16-bit machine: */
-    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
-#endif
-    stream.next_out = dest;
-    stream.avail_out = (uInt)*destLen;
-    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
-
-    stream.zalloc = (alloc_func)0;
-    stream.zfree = (free_func)0;
-    stream.opaque = (voidpf)0;
-
-    err = deflateInit(&stream, level);
-    if (err != Z_OK) return err;
-
-    err = deflate(&stream, Z_FINISH);
-    if (err != Z_STREAM_END) {
-        deflateEnd(&stream);
-        return err == Z_OK ? Z_BUF_ERROR : err;
-    }
-    *destLen = stream.total_out;
-
-    err = deflateEnd(&stream);
-    return err;
-}
-
-/* ===========================================================================
- */
-int ZEXPORT compress (dest, destLen, source, sourceLen)
-    Bytef *dest;
-    uLongf *destLen;
-    const Bytef *source;
-    uLong sourceLen;
-{
-    return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
-}
-
-/* ===========================================================================
-     If the default memLevel or windowBits for deflateInit() is changed, then
-   this function needs to be updated.
- */
-uLong ZEXPORT compressBound (sourceLen)
-    uLong sourceLen;
-{
-    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
-           (sourceLen >> 25) + 13;
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.c
deleted file mode 100644
index 5cc66c5..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.c
+++ /dev/null
@@ -1,1991 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- *  ALGORITHM
- *
- *      The "deflation" process depends on being able to identify portions
- *      of the input text which are identical to earlier input (within a
- *      sliding window trailing behind the input currently being processed).
- *
- *      The most straightforward technique turns out to be the fastest for
- *      most input files: try all possible matches and select the longest.
- *      The key feature of this algorithm is that insertions into the string
- *      dictionary are very simple and thus fast, and deletions are avoided
- *      completely. Insertions are performed at each input character, whereas
- *      string matches are performed only when the previous match ends. So it
- *      is preferable to spend more time in matches to allow very fast string
- *      insertions and avoid deletions. The matching algorithm for small
- *      strings is inspired from that of Rabin & Karp. A brute force approach
- *      is used to find longer strings when a small match has been found.
- *      A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
- *      (by Leonid Broukhis).
- *         A previous version of this file used a more sophisticated algorithm
- *      (by Fiala and Greene) which is guaranteed to run in linear amortized
- *      time, but has a larger average cost, uses more memory and is patented.
- *      However the F&G algorithm may be faster for some highly redundant
- *      files if the parameter max_chain_length (described below) is too large.
- *
- *  ACKNOWLEDGEMENTS
- *
- *      The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
- *      I found it in 'freeze' written by Leonid Broukhis.
- *      Thanks to many people for bug reports and testing.
- *
- *  REFERENCES
- *
- *      Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
- *      Available in http://tools.ietf.org/html/rfc1951
- *
- *      A description of the Rabin and Karp algorithm is given in the book
- *         "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
- *
- *      Fiala,E.R., and Greene,D.H.
- *         Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
- *
- */
-
-/* @(#) $Id$ */
-
-#include "deflate.h"
-
-const char deflate_copyright[] =
-   " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
-/*
-  If you use the zlib library in a product, an acknowledgment is welcome
-  in the documentation of your product. If for some reason you cannot
-  include such an acknowledgment, I would appreciate that you keep this
-  copyright string in the executable of your product.
- */
-
-/* ===========================================================================
- *  Function prototypes.
- */
-typedef enum {
-    need_more,      /* block not completed, need more input or more output */
-    block_done,     /* block flush performed */
-    finish_started, /* finish started, need only more output at next deflate */
-    finish_done     /* finish done, accept no more input or output */
-} block_state;
-
-typedef block_state (*compress_func) OF((deflate_state *s, int flush));
-/* Compression function. Returns the block state after the call. */
-
-local void fill_window    OF((deflate_state *s));
-local block_state deflate_stored OF((deflate_state *s, int flush));
-local block_state deflate_fast   OF((deflate_state *s, int flush));
-#ifndef FASTEST
-local block_state deflate_slow   OF((deflate_state *s, int flush));
-#endif
-local block_state deflate_rle    OF((deflate_state *s, int flush));
-local block_state deflate_huff   OF((deflate_state *s, int flush));
-local void lm_init        OF((deflate_state *s));
-local void putShortMSB    OF((deflate_state *s, uInt b));
-local void flush_pending  OF((z_streamp strm));
-local int read_buf        OF((z_streamp strm, Bytef *buf, unsigned size));
-#ifdef ASMV
-      void match_init OF((void)); /* asm code initialization */
-      uInt longest_match  OF((deflate_state *s, IPos cur_match));
-#else
-local uInt longest_match  OF((deflate_state *s, IPos cur_match));
-#endif
-
-#ifdef DEBUG
-local  void check_match OF((deflate_state *s, IPos start, IPos match,
-                            int length));
-#endif
-
-/* ===========================================================================
- * Local data
- */
-
-#define NIL 0
-/* Tail of hash chains */
-
-#ifndef TOO_FAR
-#  define TOO_FAR 4096
-#endif
-/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
-
-/* Values for max_lazy_match, good_match and max_chain_length, depending on
- * the desired pack level (0..9). The values given below have been tuned to
- * exclude worst case performance for pathological files. Better values may be
- * found for specific files.
- */
-typedef struct config_s {
-   ush good_length; /* reduce lazy search above this match length */
-   ush max_lazy;    /* do not perform lazy search above this match length */
-   ush nice_length; /* quit search above this match length */
-   ush max_chain;
-   compress_func func;
-} config;
-
-#ifdef FASTEST
-local const config configuration_table[2] = {
-/*      good lazy nice chain */
-/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
-/* 1 */ {4,    4,  8,    4, deflate_fast}}; /* max speed, no lazy matches */
-#else
-local const config configuration_table[10] = {
-/*      good lazy nice chain */
-/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
-/* 1 */ {4,    4,  8,    4, deflate_fast}, /* max speed, no lazy matches */
-/* 2 */ {4,    5, 16,    8, deflate_fast},
-/* 3 */ {4,    6, 32,   32, deflate_fast},
-
-/* 4 */ {4,    4, 16,   16, deflate_slow},  /* lazy matches */
-/* 5 */ {8,   16, 32,   32, deflate_slow},
-/* 6 */ {8,   16, 128, 128, deflate_slow},
-/* 7 */ {8,   32, 128, 256, deflate_slow},
-/* 8 */ {32, 128, 258, 1024, deflate_slow},
-/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
-#endif
-
-/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
- * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
- * meaning.
- */
-
-#define EQUAL 0
-/* result of memcmp for equal strings */
-
-#ifndef NO_DUMMY_DECL
-struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
-#endif
-
-/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
-#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0))
-
-/* ===========================================================================
- * Update a hash value with the given input byte
- * IN  assertion: all calls to to UPDATE_HASH are made with consecutive
- *    input characters, so that a running hash key can be computed from the
- *    previous key instead of complete recalculation each time.
- */
-#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
-
-
-/* ===========================================================================
- * Insert string str in the dictionary and set match_head to the previous head
- * of the hash chain (the most recent string with same hash key). Return
- * the previous length of the hash chain.
- * If this file is compiled with -DFASTEST, the compression level is forced
- * to 1, and no hash chains are maintained.
- * IN  assertion: all calls to to INSERT_STRING are made with consecutive
- *    input characters and the first MIN_MATCH bytes of str are valid
- *    (except for the last MIN_MATCH-1 bytes of the input file).
- */
-#ifdef FASTEST
-#define INSERT_STRING(s, str, match_head) \
-   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
-    match_head = s->head[s->ins_h], \
-    s->head[s->ins_h] = (Pos)(str))
-#else
-#define INSERT_STRING(s, str, match_head) \
-   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
-    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
-    s->head[s->ins_h] = (Pos)(str))
-#endif
-
-/* ===========================================================================
- * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
- * prev[] will be initialized on the fly.
- */
-#define CLEAR_HASH(s) \
-    s->head[s->hash_size-1] = NIL; \
-    zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
-
-/* ========================================================================= */
-int ZEXPORT deflateInit_(strm, level, version, stream_size)
-    z_streamp strm;
-    int level;
-    const char *version;
-    int stream_size;
-{
-    return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
-                         Z_DEFAULT_STRATEGY, version, stream_size);
-    /* To do: ignore strm->next_in if we use it as window */
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
-                  version, stream_size)
-    z_streamp strm;
-    int  level;
-    int  method;
-    int  windowBits;
-    int  memLevel;
-    int  strategy;
-    const char *version;
-    int stream_size;
-{
-    deflate_state *s;
-    int wrap = 1;
-    static const char my_version[] = ZLIB_VERSION;
-
-    ushf *overlay;
-    /* We overlay pending_buf and d_buf+l_buf. This works since the average
-     * output size for (length,distance) codes is <= 24 bits.
-     */
-
-    if (version == Z_NULL || version[0] != my_version[0] ||
-        stream_size != sizeof(z_stream)) {
-        return Z_VERSION_ERROR;
-    }
-    if (strm == Z_NULL) return Z_STREAM_ERROR;
-
-    strm->msg = Z_NULL;
-    if (strm->zalloc == (alloc_func)0) {
-#ifdef Z_SOLO
-        return Z_STREAM_ERROR;
-#else
-        strm->zalloc = zcalloc;
-        strm->opaque = (voidpf)0;
-#endif
-    }
-    if (strm->zfree == (free_func)0)
-#ifdef Z_SOLO
-        return Z_STREAM_ERROR;
-#else
-        strm->zfree = zcfree;
-#endif
-
-#ifdef FASTEST
-    if (level != 0) level = 1;
-#else
-    if (level == Z_DEFAULT_COMPRESSION) level = 6;
-#endif
-
-    if (windowBits < 0) { /* suppress zlib wrapper */
-        wrap = 0;
-        windowBits = -windowBits;
-    }
-#ifdef GZIP
-    else if (windowBits > 15) {
-        wrap = 2;       /* write gzip wrapper instead */
-        windowBits -= 16;
-    }
-#endif
-    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
-        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
-        strategy < 0 || strategy > Z_FIXED) {
-        return Z_STREAM_ERROR;
-    }
-    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
-    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
-    if (s == Z_NULL) return Z_MEM_ERROR;
-    strm->state = (struct internal_state FAR *)s;
-    s->strm = strm;
-
-    s->wrap = wrap;
-    s->gzhead = Z_NULL;
-    s->w_bits = windowBits;
-    s->w_size = 1 << s->w_bits;
-    s->w_mask = s->w_size - 1;
-
-    s->hash_bits = memLevel + 7;
-    s->hash_size = 1 << s->hash_bits;
-    s->hash_mask = s->hash_size - 1;
-    s->hash_shift =  ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
-
-    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
-    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
-    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
-
-    s->high_water = 0;      /* nothing written to s->window yet */
-
-    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
-
-    overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
-    s->pending_buf = (uchf *) overlay;
-    s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
-
-    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
-        s->pending_buf == Z_NULL) {
-        s->status = FINISH_STATE;
-        strm->msg = ERR_MSG(Z_MEM_ERROR);
-        deflateEnd (strm);
-        return Z_MEM_ERROR;
-    }
-    s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
-    s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
-
-    s->level = level;
-    s->strategy = strategy;
-    s->method = (Byte)method;
-
-    return deflateReset(strm);
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
-    z_streamp strm;
-    const Bytef *dictionary;
-    uInt  dictLength;
-{
-    deflate_state *s;
-    uInt str, n;
-    int wrap;
-    unsigned avail;
-    z_const unsigned char *next;
-
-    if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)
-        return Z_STREAM_ERROR;
-    s = strm->state;
-    wrap = s->wrap;
-    if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
-        return Z_STREAM_ERROR;
-
-    /* when using zlib wrappers, compute Adler-32 for provided dictionary */
-    if (wrap == 1)
-        strm->adler = adler32(strm->adler, dictionary, dictLength);
-    s->wrap = 0;                    /* avoid computing Adler-32 in read_buf */
-
-    /* if dictionary would fill window, just replace the history */
-    if (dictLength >= s->w_size) {
-        if (wrap == 0) {            /* already empty otherwise */
-            CLEAR_HASH(s);
-            s->strstart = 0;
-            s->block_start = 0L;
-            s->insert = 0;
-        }
-        dictionary += dictLength - s->w_size;  /* use the tail */
-        dictLength = s->w_size;
-    }
-
-    /* insert dictionary into window and hash */
-    avail = strm->avail_in;
-    next = strm->next_in;
-    strm->avail_in = dictLength;
-    strm->next_in = (z_const Bytef *)dictionary;
-    fill_window(s);
-    while (s->lookahead >= MIN_MATCH) {
-        str = s->strstart;
-        n = s->lookahead - (MIN_MATCH-1);
-        do {
-            UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
-#ifndef FASTEST
-            s->prev[str & s->w_mask] = s->head[s->ins_h];
-#endif
-            s->head[s->ins_h] = (Pos)str;
-            str++;
-        } while (--n);
-        s->strstart = str;
-        s->lookahead = MIN_MATCH-1;
-        fill_window(s);
-    }
-    s->strstart += s->lookahead;
-    s->block_start = (long)s->strstart;
-    s->insert = s->lookahead;
-    s->lookahead = 0;
-    s->match_length = s->prev_length = MIN_MATCH-1;
-    s->match_available = 0;
-    strm->next_in = next;
-    strm->avail_in = avail;
-    s->wrap = wrap;
-    return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateResetKeep (strm)
-    z_streamp strm;
-{
-    deflate_state *s;
-
-    if (strm == Z_NULL || strm->state == Z_NULL ||
-        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
-        return Z_STREAM_ERROR;
-    }
-
-    strm->total_in = strm->total_out = 0;
-    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
-    strm->data_type = Z_UNKNOWN;
-
-    s = (deflate_state *)strm->state;
-    s->pending = 0;
-    s->pending_out = s->pending_buf;
-
-    if (s->wrap < 0) {
-        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
-    }
-    s->status = s->wrap ? INIT_STATE : BUSY_STATE;
-    strm->adler =
-#ifdef GZIP
-        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
-#endif
-        adler32(0L, Z_NULL, 0);
-    s->last_flush = Z_NO_FLUSH;
-
-    _tr_init(s);
-
-    return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateReset (strm)
-    z_streamp strm;
-{
-    int ret;
-
-    ret = deflateResetKeep(strm);
-    if (ret == Z_OK)
-        lm_init(strm->state);
-    return ret;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateSetHeader (strm, head)
-    z_streamp strm;
-    gz_headerp head;
-{
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    if (strm->state->wrap != 2) return Z_STREAM_ERROR;
-    strm->state->gzhead = head;
-    return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflatePending (strm, pending, bits)
-    unsigned *pending;
-    int *bits;
-    z_streamp strm;
-{
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    if (pending != Z_NULL)
-        *pending = strm->state->pending;
-    if (bits != Z_NULL)
-        *bits = strm->state->bi_valid;
-    return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflatePrime (strm, bits, value)
-    z_streamp strm;
-    int bits;
-    int value;
-{
-    deflate_state *s;
-    int put;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    s = strm->state;
-    if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
-        return Z_BUF_ERROR;
-    do {
-        put = Buf_size - s->bi_valid;
-        if (put > bits)
-            put = bits;
-        s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid);
-        s->bi_valid += put;
-        _tr_flush_bits(s);
-        value >>= put;
-        bits -= put;
-    } while (bits);
-    return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateParams(strm, level, strategy)
-    z_streamp strm;
-    int level;
-    int strategy;
-{
-    deflate_state *s;
-    compress_func func;
-    int err = Z_OK;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    s = strm->state;
-
-#ifdef FASTEST
-    if (level != 0) level = 1;
-#else
-    if (level == Z_DEFAULT_COMPRESSION) level = 6;
-#endif
-    if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
-        return Z_STREAM_ERROR;
-    }
-    func = configuration_table[s->level].func;
-
-    if ((strategy != s->strategy || func != configuration_table[level].func) &&
-        strm->total_in != 0) {
-        /* Flush the last buffer: */
-        err = deflate(strm, Z_BLOCK);
-        if (err == Z_BUF_ERROR && s->pending == 0)
-            err = Z_OK;
-    }
-    if (s->level != level) {
-        s->level = level;
-        s->max_lazy_match   = configuration_table[level].max_lazy;
-        s->good_match       = configuration_table[level].good_length;
-        s->nice_match       = configuration_table[level].nice_length;
-        s->max_chain_length = configuration_table[level].max_chain;
-    }
-    s->strategy = strategy;
-    return err;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
-    z_streamp strm;
-    int good_length;
-    int max_lazy;
-    int nice_length;
-    int max_chain;
-{
-    deflate_state *s;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    s = strm->state;
-    s->good_match = good_length;
-    s->max_lazy_match = max_lazy;
-    s->nice_match = nice_length;
-    s->max_chain_length = max_chain;
-    return Z_OK;
-}
-
-/* =========================================================================
- * For the default windowBits of 15 and memLevel of 8, this function returns
- * a close to exact, as well as small, upper bound on the compressed size.
- * They are coded as constants here for a reason--if the #define's are
- * changed, then this function needs to be changed as well.  The return
- * value for 15 and 8 only works for those exact settings.
- *
- * For any setting other than those defaults for windowBits and memLevel,
- * the value returned is a conservative worst case for the maximum expansion
- * resulting from using fixed blocks instead of stored blocks, which deflate
- * can emit on compressed data for some combinations of the parameters.
- *
- * This function could be more sophisticated to provide closer upper bounds for
- * every combination of windowBits and memLevel.  But even the conservative
- * upper bound of about 14% expansion does not seem onerous for output buffer
- * allocation.
- */
-uLong ZEXPORT deflateBound(strm, sourceLen)
-    z_streamp strm;
-    uLong sourceLen;
-{
-    deflate_state *s;
-    uLong complen, wraplen;
-    Bytef *str;
-
-    /* conservative upper bound for compressed data */
-    complen = sourceLen +
-              ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
-
-    /* if can't get parameters, return conservative bound plus zlib wrapper */
-    if (strm == Z_NULL || strm->state == Z_NULL)
-        return complen + 6;
-
-    /* compute wrapper length */
-    s = strm->state;
-    switch (s->wrap) {
-    case 0:                                 /* raw deflate */
-        wraplen = 0;
-        break;
-    case 1:                                 /* zlib wrapper */
-        wraplen = 6 + (s->strstart ? 4 : 0);
-        break;
-    case 2:                                 /* gzip wrapper */
-        wraplen = 18;
-        if (s->gzhead != Z_NULL) {          /* user-supplied gzip header */
-            if (s->gzhead->extra != Z_NULL)
-                wraplen += 2 + s->gzhead->extra_len;
-            str = s->gzhead->name;
-            if (str != Z_NULL)
-                do {
-                    wraplen++;
-                } while (*str++);
-            str = s->gzhead->comment;
-            if (str != Z_NULL)
-                do {
-                    wraplen++;
-                } while (*str++);
-            if (s->gzhead->hcrc)
-                wraplen += 2;
-        }
-        break;
-    default:                                /* for compiler happiness */
-        wraplen = 6;
-    }
-
-    /* if not default parameters, return conservative bound */
-    if (s->w_bits != 15 || s->hash_bits != 8 + 7)
-        return complen + wraplen;
-
-    /* default settings: return tight bound for that case */
-    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
-           (sourceLen >> 25) + 13 - 6 + wraplen;
-}
-
-/* =========================================================================
- * Put a short in the pending buffer. The 16-bit value is put in MSB order.
- * IN assertion: the stream state is correct and there is enough room in
- * pending_buf.
- */
-local void putShortMSB (s, b)
-    deflate_state *s;
-    uInt b;
-{
-    put_byte(s, (Byte)(b >> 8));
-    put_byte(s, (Byte)(b & 0xff));
-}
-
-/* =========================================================================
- * Flush as much pending output as possible. All deflate() output goes
- * through this function so some applications may wish to modify it
- * to avoid allocating a large strm->next_out buffer and copying into it.
- * (See also read_buf()).
- */
-local void flush_pending(strm)
-    z_streamp strm;
-{
-    unsigned len;
-    deflate_state *s = strm->state;
-
-    _tr_flush_bits(s);
-    len = s->pending;
-    if (len > strm->avail_out) len = strm->avail_out;
-    if (len == 0) return;
-
-    zmemcpy(strm->next_out, s->pending_out, len);
-    strm->next_out  += len;
-    s->pending_out  += len;
-    strm->total_out += len;
-    strm->avail_out  -= len;
-    s->pending -= len;
-    if (s->pending == 0) {
-        s->pending_out = s->pending_buf;
-    }
-}
-
-/* ========================================================================= */
-int ZEXPORT deflate (strm, flush)
-    z_streamp strm;
-    int flush;
-{
-    int old_flush; /* value of flush param for previous deflate call */
-    deflate_state *s;
-
-    if (strm == Z_NULL || strm->state == Z_NULL ||
-        flush > Z_BLOCK || flush < 0) {
-        return Z_STREAM_ERROR;
-    }
-    s = strm->state;
-
-    if (strm->next_out == Z_NULL ||
-        (strm->next_in == Z_NULL && strm->avail_in != 0) ||
-        (s->status == FINISH_STATE && flush != Z_FINISH)) {
-        ERR_RETURN(strm, Z_STREAM_ERROR);
-    }
-    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
-
-    s->strm = strm; /* just in case */
-    old_flush = s->last_flush;
-    s->last_flush = flush;
-
-    /* Write the header */
-    if (s->status == INIT_STATE) {
-#ifdef GZIP
-        if (s->wrap == 2) {
-            strm->adler = crc32(0L, Z_NULL, 0);
-            put_byte(s, 31);
-            put_byte(s, 139);
-            put_byte(s, 8);
-            if (s->gzhead == Z_NULL) {
-                put_byte(s, 0);
-                put_byte(s, 0);
-                put_byte(s, 0);
-                put_byte(s, 0);
-                put_byte(s, 0);
-                put_byte(s, s->level == 9 ? 2 :
-                            (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
-                             4 : 0));
-                put_byte(s, OS_CODE);
-                s->status = BUSY_STATE;
-            }
-            else {
-                put_byte(s, (s->gzhead->text ? 1 : 0) +
-                            (s->gzhead->hcrc ? 2 : 0) +
-                            (s->gzhead->extra == Z_NULL ? 0 : 4) +
-                            (s->gzhead->name == Z_NULL ? 0 : 8) +
-                            (s->gzhead->comment == Z_NULL ? 0 : 16)
-                        );
-                put_byte(s, (Byte)(s->gzhead->time & 0xff));
-                put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
-                put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
-                put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
-                put_byte(s, s->level == 9 ? 2 :
-                            (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
-                             4 : 0));
-                put_byte(s, s->gzhead->os & 0xff);
-                if (s->gzhead->extra != Z_NULL) {
-                    put_byte(s, s->gzhead->extra_len & 0xff);
-                    put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
-                }
-                if (s->gzhead->hcrc)
-                    strm->adler = crc32(strm->adler, s->pending_buf,
-                                        s->pending);
-                s->gzindex = 0;
-                s->status = EXTRA_STATE;
-            }
-        }
-        else
-#endif
-        {
-            uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
-            uInt level_flags;
-
-            if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
-                level_flags = 0;
-            else if (s->level < 6)
-                level_flags = 1;
-            else if (s->level == 6)
-                level_flags = 2;
-            else
-                level_flags = 3;
-            header |= (level_flags << 6);
-            if (s->strstart != 0) header |= PRESET_DICT;
-            header += 31 - (header % 31);
-
-            s->status = BUSY_STATE;
-            putShortMSB(s, header);
-
-            /* Save the adler32 of the preset dictionary: */
-            if (s->strstart != 0) {
-                putShortMSB(s, (uInt)(strm->adler >> 16));
-                putShortMSB(s, (uInt)(strm->adler & 0xffff));
-            }
-            strm->adler = adler32(0L, Z_NULL, 0);
-        }
-    }
-#ifdef GZIP
-    if (s->status == EXTRA_STATE) {
-        if (s->gzhead->extra != Z_NULL) {
-            uInt beg = s->pending;  /* start of bytes to update crc */
-
-            while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
-                if (s->pending == s->pending_buf_size) {
-                    if (s->gzhead->hcrc && s->pending > beg)
-                        strm->adler = crc32(strm->adler, s->pending_buf + beg,
-                                            s->pending - beg);
-                    flush_pending(strm);
-                    beg = s->pending;
-                    if (s->pending == s->pending_buf_size)
-                        break;
-                }
-                put_byte(s, s->gzhead->extra[s->gzindex]);
-                s->gzindex++;
-            }
-            if (s->gzhead->hcrc && s->pending > beg)
-                strm->adler = crc32(strm->adler, s->pending_buf + beg,
-                                    s->pending - beg);
-            if (s->gzindex == s->gzhead->extra_len) {
-                s->gzindex = 0;
-                s->status = NAME_STATE;
-            }
-        }
-        else
-            s->status = NAME_STATE;
-    }
-    if (s->status == NAME_STATE) {
-        if (s->gzhead->name != Z_NULL) {
-            uInt beg = s->pending;  /* start of bytes to update crc */
-            int val;
-
-            do {
-                if (s->pending == s->pending_buf_size) {
-                    if (s->gzhead->hcrc && s->pending > beg)
-                        strm->adler = crc32(strm->adler, s->pending_buf + beg,
-                                            s->pending - beg);
-                    flush_pending(strm);
-                    beg = s->pending;
-                    if (s->pending == s->pending_buf_size) {
-                        val = 1;
-                        break;
-                    }
-                }
-                val = s->gzhead->name[s->gzindex++];
-                put_byte(s, val);
-            } while (val != 0);
-            if (s->gzhead->hcrc && s->pending > beg)
-                strm->adler = crc32(strm->adler, s->pending_buf + beg,
-                                    s->pending - beg);
-            if (val == 0) {
-                s->gzindex = 0;
-                s->status = COMMENT_STATE;
-            }
-        }
-        else
-            s->status = COMMENT_STATE;
-    }
-    if (s->status == COMMENT_STATE) {
-        if (s->gzhead->comment != Z_NULL) {
-            uInt beg = s->pending;  /* start of bytes to update crc */
-            int val;
-
-            do {
-                if (s->pending == s->pending_buf_size) {
-                    if (s->gzhead->hcrc && s->pending > beg)
-                        strm->adler = crc32(strm->adler, s->pending_buf + beg,
-                                            s->pending - beg);
-                    flush_pending(strm);
-                    beg = s->pending;
-                    if (s->pending == s->pending_buf_size) {
-                        val = 1;
-                        break;
-                    }
-                }
-                val = s->gzhead->comment[s->gzindex++];
-                put_byte(s, val);
-            } while (val != 0);
-            if (s->gzhead->hcrc && s->pending > beg)
-                strm->adler = crc32(strm->adler, s->pending_buf + beg,
-                                    s->pending - beg);
-            if (val == 0)
-                s->status = HCRC_STATE;
-        }
-        else
-            s->status = HCRC_STATE;
-    }
-    if (s->status == HCRC_STATE) {
-        if (s->gzhead->hcrc) {
-            if (s->pending + 2 > s->pending_buf_size)
-                flush_pending(strm);
-            if (s->pending + 2 <= s->pending_buf_size) {
-                put_byte(s, (Byte)(strm->adler & 0xff));
-                put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
-                strm->adler = crc32(0L, Z_NULL, 0);
-                s->status = BUSY_STATE;
-            }
-        }
-        else
-            s->status = BUSY_STATE;
-    }
-#endif
-
-    /* Flush as much pending output as possible */
-    if (s->pending != 0) {
-        flush_pending(strm);
-        if (strm->avail_out == 0) {
-            /* Since avail_out is 0, deflate will be called again with
-             * more output space, but possibly with both pending and
-             * avail_in equal to zero. There won't be anything to do,
-             * but this is not an error situation so make sure we
-             * return OK instead of BUF_ERROR at next call of deflate:
-             */
-            s->last_flush = -1;
-            return Z_OK;
-        }
-
-    /* Make sure there is something to do and avoid duplicate consecutive
-     * flushes. For repeated and useless calls with Z_FINISH, we keep
-     * returning Z_STREAM_END instead of Z_BUF_ERROR.
-     */
-    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
-               flush != Z_FINISH) {
-        ERR_RETURN(strm, Z_BUF_ERROR);
-    }
-
-    /* User must not provide more input after the first FINISH: */
-    if (s->status == FINISH_STATE && strm->avail_in != 0) {
-        ERR_RETURN(strm, Z_BUF_ERROR);
-    }
-
-    /* Start a new block or continue the current one.
-     */
-    if (strm->avail_in != 0 || s->lookahead != 0 ||
-        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
-        block_state bstate;
-
-        bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
-                    (s->strategy == Z_RLE ? deflate_rle(s, flush) :
-                        (*(configuration_table[s->level].func))(s, flush));
-
-        if (bstate == finish_started || bstate == finish_done) {
-            s->status = FINISH_STATE;
-        }
-        if (bstate == need_more || bstate == finish_started) {
-            if (strm->avail_out == 0) {
-                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
-            }
-            return Z_OK;
-            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
-             * of deflate should use the same flush parameter to make sure
-             * that the flush is complete. So we don't have to output an
-             * empty block here, this will be done at next call. This also
-             * ensures that for a very small output buffer, we emit at most
-             * one empty block.
-             */
-        }
-        if (bstate == block_done) {
-            if (flush == Z_PARTIAL_FLUSH) {
-                _tr_align(s);
-            } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
-                _tr_stored_block(s, (char*)0, 0L, 0);
-                /* For a full flush, this empty block will be recognized
-                 * as a special marker by inflate_sync().
-                 */
-                if (flush == Z_FULL_FLUSH) {
-                    CLEAR_HASH(s);             /* forget history */
-                    if (s->lookahead == 0) {
-                        s->strstart = 0;
-                        s->block_start = 0L;
-                        s->insert = 0;
-                    }
-                }
-            }
-            flush_pending(strm);
-            if (strm->avail_out == 0) {
-              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
-              return Z_OK;
-            }
-        }
-    }
-    Assert(strm->avail_out > 0, "bug2");
-
-    if (flush != Z_FINISH) return Z_OK;
-    if (s->wrap <= 0) return Z_STREAM_END;
-
-    /* Write the trailer */
-#ifdef GZIP
-    if (s->wrap == 2) {
-        put_byte(s, (Byte)(strm->adler & 0xff));
-        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
-        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
-        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
-        put_byte(s, (Byte)(strm->total_in & 0xff));
-        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
-        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
-        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
-    }
-    else
-#endif
-    {
-        putShortMSB(s, (uInt)(strm->adler >> 16));
-        putShortMSB(s, (uInt)(strm->adler & 0xffff));
-    }
-    flush_pending(strm);
-    /* If avail_out is zero, the application will call deflate again
-     * to flush the rest.
-     */
-    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
-    return s->pending != 0 ? Z_OK : Z_STREAM_END;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateEnd (strm)
-    z_streamp strm;
-{
-    int status;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-
-    status = strm->state->status;
-    if (status != INIT_STATE &&
-        status != EXTRA_STATE &&
-        status != NAME_STATE &&
-        status != COMMENT_STATE &&
-        status != HCRC_STATE &&
-        status != BUSY_STATE &&
-        status != FINISH_STATE) {
-      return Z_STREAM_ERROR;
-    }
-
-    /* Deallocate in reverse order of allocations: */
-    TRY_FREE(strm, strm->state->pending_buf);
-    TRY_FREE(strm, strm->state->head);
-    TRY_FREE(strm, strm->state->prev);
-    TRY_FREE(strm, strm->state->window);
-
-    ZFREE(strm, strm->state);
-    strm->state = Z_NULL;
-
-    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
-}
-
-/* =========================================================================
- * Copy the source state to the destination state.
- * To simplify the source, this is not supported for 16-bit MSDOS (which
- * doesn't have enough memory anyway to duplicate compression states).
- */
-int ZEXPORT deflateCopy (dest, source)
-    z_streamp dest;
-    z_streamp source;
-{
-#ifdef MAXSEG_64K
-    return Z_STREAM_ERROR;
-#else
-    deflate_state *ds;
-    deflate_state *ss;
-    ushf *overlay;
-
-
-    if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
-        return Z_STREAM_ERROR;
-    }
-
-    ss = source->state;
-
-    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
-
-    ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
-    if (ds == Z_NULL) return Z_MEM_ERROR;
-    dest->state = (struct internal_state FAR *) ds;
-    zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
-    ds->strm = dest;
-
-    ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
-    ds->prev   = (Posf *)  ZALLOC(dest, ds->w_size, sizeof(Pos));
-    ds->head   = (Posf *)  ZALLOC(dest, ds->hash_size, sizeof(Pos));
-    overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
-    ds->pending_buf = (uchf *) overlay;
-
-    if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
-        ds->pending_buf == Z_NULL) {
-        deflateEnd (dest);
-        return Z_MEM_ERROR;
-    }
-    /* following zmemcpy do not work for 16-bit MSDOS */
-    zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
-    zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
-    zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
-    zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
-
-    ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
-    ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
-    ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
-
-    ds->l_desc.dyn_tree = ds->dyn_ltree;
-    ds->d_desc.dyn_tree = ds->dyn_dtree;
-    ds->bl_desc.dyn_tree = ds->bl_tree;
-
-    return Z_OK;
-#endif /* MAXSEG_64K */
-}
-
-/* ===========================================================================
- * Read a new buffer from the current input stream, update the adler32
- * and total number of bytes read.  All deflate() input goes through
- * this function so some applications may wish to modify it to avoid
- * allocating a large strm->next_in buffer and copying from it.
- * (See also flush_pending()).
- */
-local int read_buf(strm, buf, size)
-    z_streamp strm;
-    Bytef *buf;
-    unsigned size;
-{
-    unsigned len = strm->avail_in;
-
-    if (len > size) len = size;
-    if (len == 0) return 0;
-
-    strm->avail_in  -= len;
-
-    zmemcpy(buf, strm->next_in, len);
-    if (strm->state->wrap == 1) {
-        strm->adler = adler32(strm->adler, buf, len);
-    }
-#ifdef GZIP
-    else if (strm->state->wrap == 2) {
-        strm->adler = crc32(strm->adler, buf, len);
-    }
-#endif
-    strm->next_in  += len;
-    strm->total_in += len;
-
-    return (int)len;
-}
-
-/* ===========================================================================
- * Initialize the "longest match" routines for a new zlib stream
- */
-local void lm_init (s)
-    deflate_state *s;
-{
-    s->window_size = (ulg)2L*s->w_size;
-
-    CLEAR_HASH(s);
-
-    /* Set the default configuration parameters:
-     */
-    s->max_lazy_match   = configuration_table[s->level].max_lazy;
-    s->good_match       = configuration_table[s->level].good_length;
-    s->nice_match       = configuration_table[s->level].nice_length;
-    s->max_chain_length = configuration_table[s->level].max_chain;
-
-    s->strstart = 0;
-    s->block_start = 0L;
-    s->lookahead = 0;
-    s->insert = 0;
-    s->match_length = s->prev_length = MIN_MATCH-1;
-    s->match_available = 0;
-    s->ins_h = 0;
-#ifndef FASTEST
-#ifdef ASMV
-    match_init(); /* initialize the asm code */
-#endif
-#endif
-}
-
-#ifndef FASTEST
-/* ===========================================================================
- * Set match_start to the longest match starting at the given string and
- * return its length. Matches shorter or equal to prev_length are discarded,
- * in which case the result is equal to prev_length and match_start is
- * garbage.
- * IN assertions: cur_match is the head of the hash chain for the current
- *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
- * OUT assertion: the match length is not greater than s->lookahead.
- */
-#ifndef ASMV
-/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
- * match.S. The code will be functionally equivalent.
- */
-local uInt longest_match(s, cur_match)
-    deflate_state *s;
-    IPos cur_match;                             /* current match */
-{
-    unsigned chain_length = s->max_chain_length;/* max hash chain length */
-    register Bytef *scan = s->window + s->strstart; /* current string */
-    register Bytef *match;                       /* matched string */
-    register int len;                           /* length of current match */
-    int best_len = s->prev_length;              /* best match length so far */
-    int nice_match = s->nice_match;             /* stop if match long enough */
-    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
-        s->strstart - (IPos)MAX_DIST(s) : NIL;
-    /* Stop when cur_match becomes <= limit. To simplify the code,
-     * we prevent matches with the string of window index 0.
-     */
-    Posf *prev = s->prev;
-    uInt wmask = s->w_mask;
-
-#ifdef UNALIGNED_OK
-    /* Compare two bytes at a time. Note: this is not always beneficial.
-     * Try with and without -DUNALIGNED_OK to check.
-     */
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
-    register ush scan_start = *(ushf*)scan;
-    register ush scan_end   = *(ushf*)(scan+best_len-1);
-#else
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
-    register Byte scan_end1  = scan[best_len-1];
-    register Byte scan_end   = scan[best_len];
-#endif
-
-    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
-     * It is easy to get rid of this optimization if necessary.
-     */
-    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
-    /* Do not waste too much time if we already have a good match: */
-    if (s->prev_length >= s->good_match) {
-        chain_length >>= 2;
-    }
-    /* Do not look for matches beyond the end of the input. This is necessary
-     * to make deflate deterministic.
-     */
-    if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-
-    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
-    do {
-        Assert(cur_match < s->strstart, "no future");
-        match = s->window + cur_match;
-
-        /* Skip to next match if the match length cannot increase
-         * or if the match length is less than 2.  Note that the checks below
-         * for insufficient lookahead only occur occasionally for performance
-         * reasons.  Therefore uninitialized memory will be accessed, and
-         * conditional jumps will be made that depend on those values.
-         * However the length of the match is limited to the lookahead, so
-         * the output of deflate is not affected by the uninitialized values.
-         */
-#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
-        /* This code assumes sizeof(unsigned short) == 2. Do not use
-         * UNALIGNED_OK if your compiler uses a different size.
-         */
-        if (*(ushf*)(match+best_len-1) != scan_end ||
-            *(ushf*)match != scan_start) continue;
-
-        /* It is not necessary to compare scan[2] and match[2] since they are
-         * always equal when the other bytes match, given that the hash keys
-         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
-         * strstart+3, +5, ... up to strstart+257. We check for insufficient
-         * lookahead only every 4th comparison; the 128th check will be made
-         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
-         * necessary to put more guard bytes at the end of the window, or
-         * to check more often for insufficient lookahead.
-         */
-        Assert(scan[2] == match[2], "scan[2]?");
-        scan++, match++;
-        do {
-        } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 scan < strend);
-        /* The funny "do {}" generates better code on most compilers */
-
-        /* Here, scan <= window+strstart+257 */
-        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-        if (*scan == *match) scan++;
-
-        len = (MAX_MATCH - 1) - (int)(strend-scan);
-        scan = strend - (MAX_MATCH-1);
-
-#else /* UNALIGNED_OK */
-
-        if (match[best_len]   != scan_end  ||
-            match[best_len-1] != scan_end1 ||
-            *match            != *scan     ||
-            *++match          != scan[1])      continue;
-
-        /* The check at best_len-1 can be removed because it will be made
-         * again later. (This heuristic is not always a win.)
-         * It is not necessary to compare scan[2] and match[2] since they
-         * are always equal when the other bytes match, given that
-         * the hash keys are equal and that HASH_BITS >= 8.
-         */
-        scan += 2, match++;
-        Assert(*scan == *match, "match[2]?");
-
-        /* We check for insufficient lookahead only every 8th comparison;
-         * the 256th check will be made at strstart+258.
-         */
-        do {
-        } while (*++scan == *++match && *++scan == *++match &&
-                 *++scan == *++match && *++scan == *++match &&
-                 *++scan == *++match && *++scan == *++match &&
-                 *++scan == *++match && *++scan == *++match &&
-                 scan < strend);
-
-        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
-        len = MAX_MATCH - (int)(strend - scan);
-        scan = strend - MAX_MATCH;
-
-#endif /* UNALIGNED_OK */
-
-        if (len > best_len) {
-            s->match_start = cur_match;
-            best_len = len;
-            if (len >= nice_match) break;
-#ifdef UNALIGNED_OK
-            scan_end = *(ushf*)(scan+best_len-1);
-#else
-            scan_end1  = scan[best_len-1];
-            scan_end   = scan[best_len];
-#endif
-        }
-    } while ((cur_match = prev[cur_match & wmask]) > limit
-             && --chain_length != 0);
-
-    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
-    return s->lookahead;
-}
-#endif /* ASMV */
-
-#else /* FASTEST */
-
-/* ---------------------------------------------------------------------------
- * Optimized version for FASTEST only
- */
-local uInt longest_match(s, cur_match)
-    deflate_state *s;
-    IPos cur_match;                             /* current match */
-{
-    register Bytef *scan = s->window + s->strstart; /* current string */
-    register Bytef *match;                       /* matched string */
-    register int len;                           /* length of current match */
-    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
-
-    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
-     * It is easy to get rid of this optimization if necessary.
-     */
-    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
-    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
-    Assert(cur_match < s->strstart, "no future");
-
-    match = s->window + cur_match;
-
-    /* Return failure if the match length is less than 2:
-     */
-    if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
-
-    /* The check at best_len-1 can be removed because it will be made
-     * again later. (This heuristic is not always a win.)
-     * It is not necessary to compare scan[2] and match[2] since they
-     * are always equal when the other bytes match, given that
-     * the hash keys are equal and that HASH_BITS >= 8.
-     */
-    scan += 2, match += 2;
-    Assert(*scan == *match, "match[2]?");
-
-    /* We check for insufficient lookahead only every 8th comparison;
-     * the 256th check will be made at strstart+258.
-     */
-    do {
-    } while (*++scan == *++match && *++scan == *++match &&
-             *++scan == *++match && *++scan == *++match &&
-             *++scan == *++match && *++scan == *++match &&
-             *++scan == *++match && *++scan == *++match &&
-             scan < strend);
-
-    Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
-    len = MAX_MATCH - (int)(strend - scan);
-
-    if (len < MIN_MATCH) return MIN_MATCH - 1;
-
-    s->match_start = cur_match;
-    return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
-}
-
-#endif /* FASTEST */
-
-#ifdef DEBUG
-/* ===========================================================================
- * Check that the match at match_start is indeed a match.
- */
-local void check_match(s, start, match, length)
-    deflate_state *s;
-    IPos start, match;
-    int length;
-{
-    /* check that the match is indeed a match */
-    if (zmemcmp(s->window + match,
-                s->window + start, length) != EQUAL) {
-        fprintf(stderr, " start %u, match %u, length %d\n",
-                start, match, length);
-        do {
-            fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
-        } while (--length != 0);
-        z_error("invalid match");
-    }
-    if (z_verbose > 1) {
-        fprintf(stderr,"\\[%d,%d]", start-match, length);
-        do { putc(s->window[start++], stderr); } while (--length != 0);
-    }
-}
-#else
-#  define check_match(s, start, match, length)
-#endif /* DEBUG */
-
-/* ===========================================================================
- * Fill the window when the lookahead becomes insufficient.
- * Updates strstart and lookahead.
- *
- * IN assertion: lookahead < MIN_LOOKAHEAD
- * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
- *    At least one byte has been read, or avail_in == 0; reads are
- *    performed for at least two bytes (required for the zip translate_eol
- *    option -- not supported here).
- */
-local void fill_window(s)
-    deflate_state *s;
-{
-    register unsigned n, m;
-    register Posf *p;
-    unsigned more;    /* Amount of free space at the end of the window. */
-    uInt wsize = s->w_size;
-
-    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
-
-    do {
-        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
-
-        /* Deal with !@#$% 64K limit: */
-        if (sizeof(int) <= 2) {
-            if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
-                more = wsize;
-
-            } else if (more == (unsigned)(-1)) {
-                /* Very unlikely, but possible on 16 bit machine if
-                 * strstart == 0 && lookahead == 1 (input done a byte at time)
-                 */
-                more--;
-            }
-        }
-
-        /* If the window is almost full and there is insufficient lookahead,
-         * move the upper half to the lower one to make room in the upper half.
-         */
-        if (s->strstart >= wsize+MAX_DIST(s)) {
-
-            zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
-            s->match_start -= wsize;
-            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
-            s->block_start -= (long) wsize;
-
-            /* Slide the hash table (could be avoided with 32 bit values
-               at the expense of memory usage). We slide even when level == 0
-               to keep the hash table consistent if we switch back to level > 0
-               later. (Using level 0 permanently is not an optimal usage of
-               zlib, so we don't care about this pathological case.)
-             */
-            n = s->hash_size;
-            p = &s->head[n];
-            do {
-                m = *--p;
-                *p = (Pos)(m >= wsize ? m-wsize : NIL);
-            } while (--n);
-
-            n = wsize;
-#ifndef FASTEST
-            p = &s->prev[n];
-            do {
-                m = *--p;
-                *p = (Pos)(m >= wsize ? m-wsize : NIL);
-                /* If n is not on any hash chain, prev[n] is garbage but
-                 * its value will never be used.
-                 */
-            } while (--n);
-#endif
-            more += wsize;
-        }
-        if (s->strm->avail_in == 0) break;
-
-        /* If there was no sliding:
-         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
-         *    more == window_size - lookahead - strstart
-         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
-         * => more >= window_size - 2*WSIZE + 2
-         * In the BIG_MEM or MMAP case (not yet supported),
-         *   window_size == input_size + MIN_LOOKAHEAD  &&
-         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
-         * Otherwise, window_size == 2*WSIZE so more >= 2.
-         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
-         */
-        Assert(more >= 2, "more < 2");
-
-        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
-        s->lookahead += n;
-
-        /* Initialize the hash value now that we have some input: */
-        if (s->lookahead + s->insert >= MIN_MATCH) {
-            uInt str = s->strstart - s->insert;
-            s->ins_h = s->window[str];
-            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
-#if MIN_MATCH != 3
-            Call UPDATE_HASH() MIN_MATCH-3 more times
-#endif
-            while (s->insert) {
-                UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
-#ifndef FASTEST
-                s->prev[str & s->w_mask] = s->head[s->ins_h];
-#endif
-                s->head[s->ins_h] = (Pos)str;
-                str++;
-                s->insert--;
-                if (s->lookahead + s->insert < MIN_MATCH)
-                    break;
-            }
-        }
-        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
-         * but this is not important since only literal bytes will be emitted.
-         */
-
-    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
-
-    /* If the WIN_INIT bytes after the end of the current data have never been
-     * written, then zero those bytes in order to avoid memory check reports of
-     * the use of uninitialized (or uninitialised as Julian writes) bytes by
-     * the longest match routines.  Update the high water mark for the next
-     * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
-     * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
-     */
-    if (s->high_water < s->window_size) {
-        ulg curr = s->strstart + (ulg)(s->lookahead);
-        ulg init;
-
-        if (s->high_water < curr) {
-            /* Previous high water mark below current data -- zero WIN_INIT
-             * bytes or up to end of window, whichever is less.
-             */
-            init = s->window_size - curr;
-            if (init > WIN_INIT)
-                init = WIN_INIT;
-            zmemzero(s->window + curr, (unsigned)init);
-            s->high_water = curr + init;
-        }
-        else if (s->high_water < (ulg)curr + WIN_INIT) {
-            /* High water mark at or above current data, but below current data
-             * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
-             * to end of window, whichever is less.
-             */
-            init = (ulg)curr + WIN_INIT - s->high_water;
-            if (init > s->window_size - s->high_water)
-                init = s->window_size - s->high_water;
-            zmemzero(s->window + s->high_water, (unsigned)init);
-            s->high_water += init;
-        }
-    }
-
-    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
-           "not enough room for search");
-}
-
-/* ===========================================================================
- * Flush the current block, with given end-of-file flag.
- * IN assertion: strstart is set to the end of the current match.
- */
-#define FLUSH_BLOCK_ONLY(s, last) { \
-   _tr_flush_block(s, (s->block_start >= 0L ? \
-                   (charf *)&s->window[(unsigned)s->block_start] : \
-                   (charf *)Z_NULL), \
-                (ulg)((long)s->strstart - s->block_start), \
-                (last)); \
-   s->block_start = s->strstart; \
-   flush_pending(s->strm); \
-   Tracev((stderr,"[FLUSH]")); \
-}
-
-/* Same but force premature exit if necessary. */
-#define FLUSH_BLOCK(s, last) { \
-   FLUSH_BLOCK_ONLY(s, last); \
-   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
-}
-
-/* ===========================================================================
- * Copy without compression as much as possible from the input stream, return
- * the current block state.
- * This function does not insert new strings in the dictionary since
- * uncompressible data is probably not useful. This function is used
- * only for the level=0 compression option.
- * NOTE: this function should be optimized to avoid extra copying from
- * window to pending_buf.
- */
-local block_state deflate_stored(s, flush)
-    deflate_state *s;
-    int flush;
-{
-    /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
-     * to pending_buf_size, and each stored block has a 5 byte header:
-     */
-    ulg max_block_size = 0xffff;
-    ulg max_start;
-
-    if (max_block_size > s->pending_buf_size - 5) {
-        max_block_size = s->pending_buf_size - 5;
-    }
-
-    /* Copy as much as possible from input to output: */
-    for (;;) {
-        /* Fill the window as much as possible: */
-        if (s->lookahead <= 1) {
-
-            Assert(s->strstart < s->w_size+MAX_DIST(s) ||
-                   s->block_start >= (long)s->w_size, "slide too late");
-
-            fill_window(s);
-            if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
-
-            if (s->lookahead == 0) break; /* flush the current block */
-        }
-        Assert(s->block_start >= 0L, "block gone");
-
-        s->strstart += s->lookahead;
-        s->lookahead = 0;
-
-        /* Emit a stored block if pending_buf will be full: */
-        max_start = s->block_start + max_block_size;
-        if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
-            /* strstart == 0 is possible when wraparound on 16-bit machine */
-            s->lookahead = (uInt)(s->strstart - max_start);
-            s->strstart = (uInt)max_start;
-            FLUSH_BLOCK(s, 0);
-        }
-        /* Flush if we may have to slide, otherwise block_start may become
-         * negative and the data will be gone:
-         */
-        if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
-            FLUSH_BLOCK(s, 0);
-        }
-    }
-    s->insert = 0;
-    if (flush == Z_FINISH) {
-        FLUSH_BLOCK(s, 1);
-        return finish_done;
-    }
-    if ((long)s->strstart > s->block_start)
-        FLUSH_BLOCK(s, 0);
-    return block_done;
-}
-
-/* ===========================================================================
- * Compress as much as possible from the input stream, return the current
- * block state.
- * This function does not perform lazy evaluation of matches and inserts
- * new strings in the dictionary only for unmatched strings or for short
- * matches. It is used only for the fast compression options.
- */
-local block_state deflate_fast(s, flush)
-    deflate_state *s;
-    int flush;
-{
-    IPos hash_head;       /* head of the hash chain */
-    int bflush;           /* set if current block must be flushed */
-
-    for (;;) {
-        /* Make sure that we always have enough lookahead, except
-         * at the end of the input file. We need MAX_MATCH bytes
-         * for the next match, plus MIN_MATCH bytes to insert the
-         * string following the next match.
-         */
-        if (s->lookahead < MIN_LOOKAHEAD) {
-            fill_window(s);
-            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
-                return need_more;
-            }
-            if (s->lookahead == 0) break; /* flush the current block */
-        }
-
-        /* Insert the string window[strstart .. strstart+2] in the
-         * dictionary, and set hash_head to the head of the hash chain:
-         */
-        hash_head = NIL;
-        if (s->lookahead >= MIN_MATCH) {
-            INSERT_STRING(s, s->strstart, hash_head);
-        }
-
-        /* Find the longest match, discarding those <= prev_length.
-         * At this point we have always match_length < MIN_MATCH
-         */
-        if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
-            /* To simplify the code, we prevent matches with the string
-             * of window index 0 (in particular we have to avoid a match
-             * of the string with itself at the start of the input file).
-             */
-            s->match_length = longest_match (s, hash_head);
-            /* longest_match() sets match_start */
-        }
-        if (s->match_length >= MIN_MATCH) {
-            check_match(s, s->strstart, s->match_start, s->match_length);
-
-            _tr_tally_dist(s, s->strstart - s->match_start,
-                           s->match_length - MIN_MATCH, bflush);
-
-            s->lookahead -= s->match_length;
-
-            /* Insert new strings in the hash table only if the match length
-             * is not too large. This saves time but degrades compression.
-             */
-#ifndef FASTEST
-            if (s->match_length <= s->max_insert_length &&
-                s->lookahead >= MIN_MATCH) {
-                s->match_length--; /* string at strstart already in table */
-                do {
-                    s->strstart++;
-                    INSERT_STRING(s, s->strstart, hash_head);
-                    /* strstart never exceeds WSIZE-MAX_MATCH, so there are
-                     * always MIN_MATCH bytes ahead.
-                     */
-                } while (--s->match_length != 0);
-                s->strstart++;
-            } else
-#endif
-            {
-                s->strstart += s->match_length;
-                s->match_length = 0;
-                s->ins_h = s->window[s->strstart];
-                UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
-#if MIN_MATCH != 3
-                Call UPDATE_HASH() MIN_MATCH-3 more times
-#endif
-                /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
-                 * matter since it will be recomputed at next deflate call.
-                 */
-            }
-        } else {
-            /* No match, output a literal byte */
-            Tracevv((stderr,"%c", s->window[s->strstart]));
-            _tr_tally_lit (s, s->window[s->strstart], bflush);
-            s->lookahead--;
-            s->strstart++;
-        }
-        if (bflush) FLUSH_BLOCK(s, 0);
-    }
-    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
-    if (flush == Z_FINISH) {
-        FLUSH_BLOCK(s, 1);
-        return finish_done;
-    }
-    if (s->last_lit)
-        FLUSH_BLOCK(s, 0);
-    return block_done;
-}
-
-#ifndef FASTEST
-/* ===========================================================================
- * Same as above, but achieves better compression. We use a lazy
- * evaluation for matches: a match is finally adopted only if there is
- * no better match at the next window position.
- */
-local block_state deflate_slow(s, flush)
-    deflate_state *s;
-    int flush;
-{
-    IPos hash_head;          /* head of hash chain */
-    int bflush;              /* set if current block must be flushed */
-
-    /* Process the input block. */
-    for (;;) {
-        /* Make sure that we always have enough lookahead, except
-         * at the end of the input file. We need MAX_MATCH bytes
-         * for the next match, plus MIN_MATCH bytes to insert the
-         * string following the next match.
-         */
-        if (s->lookahead < MIN_LOOKAHEAD) {
-            fill_window(s);
-            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
-                return need_more;
-            }
-            if (s->lookahead == 0) break; /* flush the current block */
-        }
-
-        /* Insert the string window[strstart .. strstart+2] in the
-         * dictionary, and set hash_head to the head of the hash chain:
-         */
-        hash_head = NIL;
-        if (s->lookahead >= MIN_MATCH) {
-            INSERT_STRING(s, s->strstart, hash_head);
-        }
-
-        /* Find the longest match, discarding those <= prev_length.
-         */
-        s->prev_length = s->match_length, s->prev_match = s->match_start;
-        s->match_length = MIN_MATCH-1;
-
-        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
-            s->strstart - hash_head <= MAX_DIST(s)) {
-            /* To simplify the code, we prevent matches with the string
-             * of window index 0 (in particular we have to avoid a match
-             * of the string with itself at the start of the input file).
-             */
-            s->match_length = longest_match (s, hash_head);
-            /* longest_match() sets match_start */
-
-            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
-#if TOO_FAR <= 32767
-                || (s->match_length == MIN_MATCH &&
-                    s->strstart - s->match_start > TOO_FAR)
-#endif
-                )) {
-
-                /* If prev_match is also MIN_MATCH, match_start is garbage
-                 * but we will ignore the current match anyway.
-                 */
-                s->match_length = MIN_MATCH-1;
-            }
-        }
-        /* If there was a match at the previous step and the current
-         * match is not better, output the previous match:
-         */
-        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
-            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
-            /* Do not insert strings in hash table beyond this. */
-
-            check_match(s, s->strstart-1, s->prev_match, s->prev_length);
-
-            _tr_tally_dist(s, s->strstart -1 - s->prev_match,
-                           s->prev_length - MIN_MATCH, bflush);
-
-            /* Insert in hash table all strings up to the end of the match.
-             * strstart-1 and strstart are already inserted. If there is not
-             * enough lookahead, the last two strings are not inserted in
-             * the hash table.
-             */
-            s->lookahead -= s->prev_length-1;
-            s->prev_length -= 2;
-            do {
-                if (++s->strstart <= max_insert) {
-                    INSERT_STRING(s, s->strstart, hash_head);
-                }
-            } while (--s->prev_length != 0);
-            s->match_available = 0;
-            s->match_length = MIN_MATCH-1;
-            s->strstart++;
-
-            if (bflush) FLUSH_BLOCK(s, 0);
-
-        } else if (s->match_available) {
-            /* If there was no match at the previous position, output a
-             * single literal. If there was a match but the current match
-             * is longer, truncate the previous match to a single literal.
-             */
-            Tracevv((stderr,"%c", s->window[s->strstart-1]));
-            _tr_tally_lit(s, s->window[s->strstart-1], bflush);
-            if (bflush) {
-                FLUSH_BLOCK_ONLY(s, 0);
-            }
-            s->strstart++;
-            s->lookahead--;
-            if (s->strm->avail_out == 0) return need_more;
-        } else {
-            /* There is no previous match to compare with, wait for
-             * the next step to decide.
-             */
-            s->match_available = 1;
-            s->strstart++;
-            s->lookahead--;
-        }
-    }
-    Assert (flush != Z_NO_FLUSH, "no flush?");
-    if (s->match_available) {
-        Tracevv((stderr,"%c", s->window[s->strstart-1]));
-        _tr_tally_lit(s, s->window[s->strstart-1], bflush);
-        s->match_available = 0;
-    }
-    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
-    if (flush == Z_FINISH) {
-        FLUSH_BLOCK(s, 1);
-        return finish_done;
-    }
-    if (s->last_lit)
-        FLUSH_BLOCK(s, 0);
-    return block_done;
-}
-#endif /* FASTEST */
-
-/* ===========================================================================
- * For Z_RLE, simply look for runs of bytes, generate matches only of distance
- * one.  Do not maintain a hash table.  (It will be regenerated if this run of
- * deflate switches away from Z_RLE.)
- */
-local block_state deflate_rle(s, flush)
-    deflate_state *s;
-    int flush;
-{
-    int bflush;             /* set if current block must be flushed */
-    uInt prev;              /* byte at distance one to match */
-    Bytef *scan, *strend;   /* scan goes up to strend for length of run */
-
-    for (;;) {
-        /* Make sure that we always have enough lookahead, except
-         * at the end of the input file. We need MAX_MATCH bytes
-         * for the longest run, plus one for the unrolled loop.
-         */
-        if (s->lookahead <= MAX_MATCH) {
-            fill_window(s);
-            if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
-                return need_more;
-            }
-            if (s->lookahead == 0) break; /* flush the current block */
-        }
-
-        /* See how many times the previous byte repeats */
-        s->match_length = 0;
-        if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
-            scan = s->window + s->strstart - 1;
-            prev = *scan;
-            if (prev == *++scan && prev == *++scan && prev == *++scan) {
-                strend = s->window + s->strstart + MAX_MATCH;
-                do {
-                } while (prev == *++scan && prev == *++scan &&
-                         prev == *++scan && prev == *++scan &&
-                         prev == *++scan && prev == *++scan &&
-                         prev == *++scan && prev == *++scan &&
-                         scan < strend);
-                s->match_length = MAX_MATCH - (int)(strend - scan);
-                if (s->match_length > s->lookahead)
-                    s->match_length = s->lookahead;
-            }
-            Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
-        }
-
-        /* Emit match if have run of MIN_MATCH or longer, else emit literal */
-        if (s->match_length >= MIN_MATCH) {
-            check_match(s, s->strstart, s->strstart - 1, s->match_length);
-
-            _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
-
-            s->lookahead -= s->match_length;
-            s->strstart += s->match_length;
-            s->match_length = 0;
-        } else {
-            /* No match, output a literal byte */
-            Tracevv((stderr,"%c", s->window[s->strstart]));
-            _tr_tally_lit (s, s->window[s->strstart], bflush);
-            s->lookahead--;
-            s->strstart++;
-        }
-        if (bflush) FLUSH_BLOCK(s, 0);
-    }
-    s->insert = 0;
-    if (flush == Z_FINISH) {
-        FLUSH_BLOCK(s, 1);
-        return finish_done;
-    }
-    if (s->last_lit)
-        FLUSH_BLOCK(s, 0);
-    return block_done;
-}
-
-/* ===========================================================================
- * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
- * (It will be regenerated if this run of deflate switches away from Huffman.)
- */
-local block_state deflate_huff(s, flush)
-    deflate_state *s;
-    int flush;
-{
-    int bflush;             /* set if current block must be flushed */
-
-    for (;;) {
-        /* Make sure that we have a literal to write. */
-        if (s->lookahead == 0) {
-            fill_window(s);
-            if (s->lookahead == 0) {
-                if (flush == Z_NO_FLUSH)
-                    return need_more;
-                break;      /* flush the current block */
-            }
-        }
-
-        /* Output a literal byte */
-        s->match_length = 0;
-        Tracevv((stderr,"%c", s->window[s->strstart]));
-        _tr_tally_lit (s, s->window[s->strstart], bflush);
-        s->lookahead--;
-        s->strstart++;
-        if (bflush) FLUSH_BLOCK(s, 0);
-    }
-    s->insert = 0;
-    if (flush == Z_FINISH) {
-        FLUSH_BLOCK(s, 1);
-        return finish_done;
-    }
-    if (s->last_lit)
-        FLUSH_BLOCK(s, 0);
-    return block_done;
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.h b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.h
deleted file mode 100644
index 8be47fa..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.h
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* deflate.h -- internal compression state
- * Copyright (C) 1995-2012 Jean-loup Gailly
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef DEFLATE_H
-#define DEFLATE_H
-
-#include "zutil.h"
-
-/* define NO_GZIP when compiling if you want to disable gzip header and
-   trailer creation by deflate().  NO_GZIP would be used to avoid linking in
-   the crc code when it is not needed.  For shared libraries, gzip encoding
-   should be left enabled. */
-#ifndef NO_GZIP
-#  define GZIP
-#endif
-
-/* ===========================================================================
- * Internal compression state.
- */
-
-#define LENGTH_CODES 29
-/* number of length codes, not counting the special END_BLOCK code */
-
-#define LITERALS  256
-/* number of literal bytes 0..255 */
-
-#define L_CODES (LITERALS+1+LENGTH_CODES)
-/* number of Literal or Length codes, including the END_BLOCK code */
-
-#define D_CODES   30
-/* number of distance codes */
-
-#define BL_CODES  19
-/* number of codes used to transfer the bit lengths */
-
-#define HEAP_SIZE (2*L_CODES+1)
-/* maximum heap size */
-
-#define MAX_BITS 15
-/* All codes must not exceed MAX_BITS bits */
-
-#define Buf_size 16
-/* size of bit buffer in bi_buf */
-
-#define INIT_STATE    42
-#define EXTRA_STATE   69
-#define NAME_STATE    73
-#define COMMENT_STATE 91
-#define HCRC_STATE   103
-#define BUSY_STATE   113
-#define FINISH_STATE 666
-/* Stream status */
-
-
-/* Data structure describing a single value and its code string. */
-typedef struct ct_data_s {
-    union {
-        ush  freq;       /* frequency count */
-        ush  code;       /* bit string */
-    } fc;
-    union {
-        ush  dad;        /* father node in Huffman tree */
-        ush  len;        /* length of bit string */
-    } dl;
-} FAR ct_data;
-
-#define Freq fc.freq
-#define Code fc.code
-#define Dad  dl.dad
-#define Len  dl.len
-
-typedef struct static_tree_desc_s  static_tree_desc;
-
-typedef struct tree_desc_s {
-    ct_data *dyn_tree;           /* the dynamic tree */
-    int     max_code;            /* largest code with non zero frequency */
-    static_tree_desc *stat_desc; /* the corresponding static tree */
-} FAR tree_desc;
-
-typedef ush Pos;
-typedef Pos FAR Posf;
-typedef unsigned IPos;
-
-/* A Pos is an index in the character window. We use short instead of int to
- * save space in the various tables. IPos is used only for parameter passing.
- */
-
-typedef struct internal_state {
-    z_streamp strm;      /* pointer back to this zlib stream */
-    int   status;        /* as the name implies */
-    Bytef *pending_buf;  /* output still pending */
-    ulg   pending_buf_size; /* size of pending_buf */
-    Bytef *pending_out;  /* next pending byte to output to the stream */
-    uInt   pending;      /* nb of bytes in the pending buffer */
-    int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */
-    gz_headerp  gzhead;  /* gzip header information to write */
-    uInt   gzindex;      /* where in extra, name, or comment */
-    Byte  method;        /* can only be DEFLATED */
-    int   last_flush;    /* value of flush param for previous deflate call */
-
-                /* used by deflate.c: */
-
-    uInt  w_size;        /* LZ77 window size (32K by default) */
-    uInt  w_bits;        /* log2(w_size)  (8..16) */
-    uInt  w_mask;        /* w_size - 1 */
-
-    Bytef *window;
-    /* Sliding window. Input bytes are read into the second half of the window,
-     * and move to the first half later to keep a dictionary of at least wSize
-     * bytes. With this organization, matches are limited to a distance of
-     * wSize-MAX_MATCH bytes, but this ensures that IO is always
-     * performed with a length multiple of the block size. Also, it limits
-     * the window size to 64K, which is quite useful on MSDOS.
-     * To do: use the user input buffer as sliding window.
-     */
-
-    ulg window_size;
-    /* Actual size of window: 2*wSize, except when the user input buffer
-     * is directly used as sliding window.
-     */
-
-    Posf *prev;
-    /* Link to older string with same hash index. To limit the size of this
-     * array to 64K, this link is maintained only for the last 32K strings.
-     * An index in this array is thus a window index modulo 32K.
-     */
-
-    Posf *head; /* Heads of the hash chains or NIL. */
-
-    uInt  ins_h;          /* hash index of string to be inserted */
-    uInt  hash_size;      /* number of elements in hash table */
-    uInt  hash_bits;      /* log2(hash_size) */
-    uInt  hash_mask;      /* hash_size-1 */
-
-    uInt  hash_shift;
-    /* Number of bits by which ins_h must be shifted at each input
-     * step. It must be such that after MIN_MATCH steps, the oldest
-     * byte no longer takes part in the hash key, that is:
-     *   hash_shift * MIN_MATCH >= hash_bits
-     */
-
-    long block_start;
-    /* Window position at the beginning of the current output block. Gets
-     * negative when the window is moved backwards.
-     */
-
-    uInt match_length;           /* length of best match */
-    IPos prev_match;             /* previous match */
-    int match_available;         /* set if previous match exists */
-    uInt strstart;               /* start of string to insert */
-    uInt match_start;            /* start of matching string */
-    uInt lookahead;              /* number of valid bytes ahead in window */
-
-    uInt prev_length;
-    /* Length of the best match at previous step. Matches not greater than this
-     * are discarded. This is used in the lazy match evaluation.
-     */
-
-    uInt max_chain_length;
-    /* To speed up deflation, hash chains are never searched beyond this
-     * length.  A higher limit improves compression ratio but degrades the
-     * speed.
-     */
-
-    uInt max_lazy_match;
-    /* Attempt to find a better match only when the current match is strictly
-     * smaller than this value. This mechanism is used only for compression
-     * levels >= 4.
-     */
-#   define max_insert_length  max_lazy_match
-    /* Insert new strings in the hash table only if the match length is not
-     * greater than this length. This saves time but degrades compression.
-     * max_insert_length is used only for compression levels <= 3.
-     */
-
-    int level;    /* compression level (1..9) */
-    int strategy; /* favor or force Huffman coding*/
-
-    uInt good_match;
-    /* Use a faster search when the previous match is longer than this */
-
-    int nice_match; /* Stop searching when current match exceeds this */
-
-                /* used by trees.c: */
-    /* Didn't use ct_data typedef below to suppress compiler warning */
-    struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
-    struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
-    struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */
-
-    struct tree_desc_s l_desc;               /* desc. for literal tree */
-    struct tree_desc_s d_desc;               /* desc. for distance tree */
-    struct tree_desc_s bl_desc;              /* desc. for bit length tree */
-
-    ush bl_count[MAX_BITS+1];
-    /* number of codes at each bit length for an optimal tree */
-
-    int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
-    int heap_len;               /* number of elements in the heap */
-    int heap_max;               /* element of largest frequency */
-    /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
-     * The same heap array is used to build all trees.
-     */
-
-    uch depth[2*L_CODES+1];
-    /* Depth of each subtree used as tie breaker for trees of equal frequency
-     */
-
-    uchf *l_buf;          /* buffer for literals or lengths */
-
-    uInt  lit_bufsize;
-    /* Size of match buffer for literals/lengths.  There are 4 reasons for
-     * limiting lit_bufsize to 64K:
-     *   - frequencies can be kept in 16 bit counters
-     *   - if compression is not successful for the first block, all input
-     *     data is still in the window so we can still emit a stored block even
-     *     when input comes from standard input.  (This can also be done for
-     *     all blocks if lit_bufsize is not greater than 32K.)
-     *   - if compression is not successful for a file smaller than 64K, we can
-     *     even emit a stored file instead of a stored block (saving 5 bytes).
-     *     This is applicable only for zip (not gzip or zlib).
-     *   - creating new Huffman trees less frequently may not provide fast
-     *     adaptation to changes in the input data statistics. (Take for
-     *     example a binary file with poorly compressible code followed by
-     *     a highly compressible string table.) Smaller buffer sizes give
-     *     fast adaptation but have of course the overhead of transmitting
-     *     trees more frequently.
-     *   - I can't count above 4
-     */
-
-    uInt last_lit;      /* running index in l_buf */
-
-    ushf *d_buf;
-    /* Buffer for distances. To simplify the code, d_buf and l_buf have
-     * the same number of elements. To use different lengths, an extra flag
-     * array would be necessary.
-     */
-
-    ulg opt_len;        /* bit length of current block with optimal trees */
-    ulg static_len;     /* bit length of current block with static trees */
-    uInt matches;       /* number of string matches in current block */
-    uInt insert;        /* bytes at end of window left to insert */
-
-#ifdef DEBUG
-    ulg compressed_len; /* total bit length of compressed file mod 2^32 */
-    ulg bits_sent;      /* bit length of compressed data sent mod 2^32 */
-#endif
-
-    ush bi_buf;
-    /* Output buffer. bits are inserted starting at the bottom (least
-     * significant bits).
-     */
-    int bi_valid;
-    /* Number of valid bits in bi_buf.  All bits above the last valid bit
-     * are always zero.
-     */
-
-    ulg high_water;
-    /* High water mark offset in window for initialized bytes -- bytes above
-     * this are set to zero in order to avoid memory check warnings when
-     * longest match routines access bytes past the input.  This is then
-     * updated to the new high water mark.
-     */
-
-} FAR deflate_state;
-
-/* Output a byte on the stream.
- * IN assertion: there is enough room in pending_buf.
- */
-#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
-
-
-#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
-/* Minimum amount of lookahead, except at the end of the input file.
- * See deflate.c for comments about the MIN_MATCH+1.
- */
-
-#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
-/* In order to simplify the code, particularly on 16 bit machines, match
- * distances are limited to MAX_DIST instead of WSIZE.
- */
-
-#define WIN_INIT MAX_MATCH
-/* Number of bytes after end of data in window to initialize in order to avoid
-   memory checker errors from longest match routines */
-
-        /* in trees.c */
-void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
-int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
-void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
-                        ulg stored_len, int last));
-void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
-void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
-void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
-                        ulg stored_len, int last));
-
-#define d_code(dist) \
-   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
-/* Mapping from a distance to a distance code. dist is the distance - 1 and
- * must not have side effects. _dist_code[256] and _dist_code[257] are never
- * used.
- */
-
-#ifndef DEBUG
-/* Inline versions of _tr_tally for speed: */
-
-#if defined(GEN_TREES_H) || !defined(STDC)
-  extern uch ZLIB_INTERNAL _length_code[];
-  extern uch ZLIB_INTERNAL _dist_code[];
-#else
-  extern const uch ZLIB_INTERNAL _length_code[];
-  extern const uch ZLIB_INTERNAL _dist_code[];
-#endif
-
-# define _tr_tally_lit(s, c, flush) \
-  { uch cc = (c); \
-    s->d_buf[s->last_lit] = 0; \
-    s->l_buf[s->last_lit++] = cc; \
-    s->dyn_ltree[cc].Freq++; \
-    flush = (s->last_lit == s->lit_bufsize-1); \
-   }
-# define _tr_tally_dist(s, distance, length, flush) \
-  { uch len = (length); \
-    ush dist = (distance); \
-    s->d_buf[s->last_lit] = dist; \
-    s->l_buf[s->last_lit++] = len; \
-    dist--; \
-    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
-    s->dyn_dtree[d_code(dist)].Freq++; \
-    flush = (s->last_lit == s->lit_bufsize-1); \
-  }
-#else
-# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
-# define _tr_tally_dist(s, distance, length, flush) \
-              flush = _tr_tally(s, distance, length)
-#endif
-
-#endif /* DEFLATE_H */
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzguts.h b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzguts.h
deleted file mode 100644
index 5889f45..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzguts.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* gzguts.h -- zlib internal header definitions for gz* operations
- * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#ifdef _LARGEFILE64_SOURCE
-#  ifndef _LARGEFILE_SOURCE
-#    define _LARGEFILE_SOURCE 1
-#  endif
-#  ifdef _FILE_OFFSET_BITS
-#    undef _FILE_OFFSET_BITS
-#  endif
-#endif
-
-#ifdef HAVE_HIDDEN
-#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
-#else
-#  define ZLIB_INTERNAL
-#endif
-
-#include <stdio.h>
-#include "zlib.h"
-#ifdef STDC
-#  include <string.h>
-#  include <stdlib.h>
-#  include <limits.h>
-#endif
-#include <fcntl.h>
-
-#ifdef _WIN32
-#  include <stddef.h>
-#endif
-
-#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
-#  include <io.h>
-#endif
-
-#ifdef WINAPI_FAMILY
-#  define open _open
-#  define read _read
-#  define write _write
-#  define close _close
-#endif
-
-#ifdef NO_DEFLATE       /* for compatibility with old definition */
-#  define NO_GZCOMPRESS
-#endif
-
-#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
-#  ifndef HAVE_VSNPRINTF
-#    define HAVE_VSNPRINTF
-#  endif
-#endif
-
-#if defined(__CYGWIN__)
-#  ifndef HAVE_VSNPRINTF
-#    define HAVE_VSNPRINTF
-#  endif
-#endif
-
-#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)
-#  ifndef HAVE_VSNPRINTF
-#    define HAVE_VSNPRINTF
-#  endif
-#endif
-
-#ifndef HAVE_VSNPRINTF
-#  ifdef MSDOS
-/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
-   but for now we just assume it doesn't. */
-#    define NO_vsnprintf
-#  endif
-#  ifdef __TURBOC__
-#    define NO_vsnprintf
-#  endif
-#  ifdef WIN32
-/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
-#    if !defined(vsnprintf) && !defined(NO_vsnprintf)
-#      if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
-#         define vsnprintf _vsnprintf
-#      endif
-#    endif
-#  endif
-#  ifdef __SASC
-#    define NO_vsnprintf
-#  endif
-#  ifdef VMS
-#    define NO_vsnprintf
-#  endif
-#  ifdef __OS400__
-#    define NO_vsnprintf
-#  endif
-#  ifdef __MVS__
-#    define NO_vsnprintf
-#  endif
-#endif
-
-/* unlike snprintf (which is required in C99, yet still not supported by
-   Microsoft more than a decade later!), _snprintf does not guarantee null
-   termination of the result -- however this is only used in gzlib.c where
-   the result is assured to fit in the space provided */
-#ifdef _MSC_VER
-#  define snprintf _snprintf
-#endif
-
-#ifndef local
-#  define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-/* gz* functions always use library allocation functions */
-#ifndef STDC
-  extern voidp  malloc OF((uInt size));
-  extern void   free   OF((voidpf ptr));
-#endif
-
-/* get errno and strerror definition */
-#if defined UNDER_CE
-#  include <windows.h>
-#  define zstrerror() gz_strwinerror((DWORD)GetLastError())
-#else
-#  ifndef NO_STRERROR
-#    include <errno.h>
-#    define zstrerror() strerror(errno)
-#  else
-#    define zstrerror() "stdio error (consult errno)"
-#  endif
-#endif
-
-/* provide prototypes for these when building zlib without LFS */
-#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
-    ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
-    ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
-    ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
-    ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
-#endif
-
-/* default memLevel */
-#if MAX_MEM_LEVEL >= 8
-#  define DEF_MEM_LEVEL 8
-#else
-#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
-#endif
-
-/* default i/o buffer size -- double this for output when reading (this and
-   twice this must be able to fit in an unsigned type) */
-#define GZBUFSIZE 8192
-
-/* gzip modes, also provide a little integrity check on the passed structure */
-#define GZ_NONE 0
-#define GZ_READ 7247
-#define GZ_WRITE 31153
-#define GZ_APPEND 1     /* mode set to GZ_WRITE after the file is opened */
-
-/* values for gz_state how */
-#define LOOK 0      /* look for a gzip header */
-#define COPY 1      /* copy input directly */
-#define GZIP 2      /* decompress a gzip stream */
-
-/* internal gzip file state data structure */
-typedef struct {
-        /* exposed contents for gzgetc() macro */
-    struct gzFile_s x;      /* "x" for exposed */
-                            /* x.have: number of bytes available at x.next */
-                            /* x.next: next output data to deliver or write */
-                            /* x.pos: current position in uncompressed data */
-        /* used for both reading and writing */
-    int mode;               /* see gzip modes above */
-    int fd;                 /* file descriptor */
-    char *path;             /* path or fd for error messages */
-    unsigned size;          /* buffer size, zero if not allocated yet */
-    unsigned want;          /* requested buffer size, default is GZBUFSIZE */
-    unsigned char *in;      /* input buffer */
-    unsigned char *out;     /* output buffer (double-sized when reading) */
-    int direct;             /* 0 if processing gzip, 1 if transparent */
-        /* just for reading */
-    int how;                /* 0: get header, 1: copy, 2: decompress */
-    z_off64_t start;        /* where the gzip data started, for rewinding */
-    int eof;                /* true if end of input file reached */
-    int past;               /* true if read requested past end */
-        /* just for writing */
-    int level;              /* compression level */
-    int strategy;           /* compression strategy */
-        /* seek request */
-    z_off64_t skip;         /* amount to skip (already rewound if backwards) */
-    int seek;               /* true if seek request pending */
-        /* error information */
-    int err;                /* error code */
-    char *msg;              /* error message */
-        /* zlib inflate or deflate stream */
-    z_stream strm;          /* stream structure in-place (not a pointer) */
-} gz_state;
-typedef gz_state FAR *gz_statep;
-
-/* shared functions */
-void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
-#if defined UNDER_CE
-char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
-#endif
-
-/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
-   value -- needed when comparing unsigned to z_off64_t, which is signed
-   (possible z_off64_t types off_t, off64_t, and long are all signed) */
-#ifdef INT_MAX
-#  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
-#else
-unsigned ZLIB_INTERNAL gz_intmax OF((void));
-#  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
-#endif
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzlib.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzlib.c
deleted file mode 100644
index 4dce9b9..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzlib.c
+++ /dev/null
@@ -1,658 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* gzlib.c -- zlib functions common to reading and writing gzip files
- * Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "gzguts.h"
-
-#if defined(_WIN32) && !defined(__BORLANDC__)
-#  define LSEEK _lseeki64
-#else
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
-#  define LSEEK lseek64
-#else
-#  define LSEEK lseek
-#endif
-#endif
-
-/* Local functions */
-local void gz_reset OF((gz_statep));
-local gzFile gz_open OF((const void *, int, const char *));
-
-#if defined UNDER_CE
-
-/* Map the Windows error number in ERROR to a locale-dependent error message
-   string and return a pointer to it.  Typically, the values for ERROR come
-   from GetLastError.
-
-   The string pointed to shall not be modified by the application, but may be
-   overwritten by a subsequent call to gz_strwinerror
-
-   The gz_strwinerror function does not change the current setting of
-   GetLastError. */
-char ZLIB_INTERNAL *gz_strwinerror (error)
-     DWORD error;
-{
-    static char buf[1024];
-
-    wchar_t *msgbuf;
-    DWORD lasterr = GetLastError();
-    DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
-        | FORMAT_MESSAGE_ALLOCATE_BUFFER,
-        NULL,
-        error,
-        0, /* Default language */
-        (LPVOID)&msgbuf,
-        0,
-        NULL);
-    if (chars != 0) {
-        /* If there is an \r\n appended, zap it.  */
-        if (chars >= 2
-            && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
-            chars -= 2;
-            msgbuf[chars] = 0;
-        }
-
-        if (chars > sizeof (buf) - 1) {
-            chars = sizeof (buf) - 1;
-            msgbuf[chars] = 0;
-        }
-
-        wcstombs(buf, msgbuf, chars + 1);
-        LocalFree(msgbuf);
-    }
-    else {
-        sprintf(buf, "unknown win32 error (%ld)", error);
-    }
-
-    SetLastError(lasterr);
-    return buf;
-}
-
-#endif /* UNDER_CE */
-
-/* Reset gzip file state */
-local void gz_reset(state)
-    gz_statep state;
-{
-    state->x.have = 0;              /* no output data available */
-    if (state->mode == GZ_READ) {   /* for reading ... */
-        state->eof = 0;             /* not at end of file */
-        state->past = 0;            /* have not read past end yet */
-        state->how = LOOK;          /* look for gzip header */
-    }
-    state->seek = 0;                /* no seek request pending */
-    gz_error(state, Z_OK, NULL);    /* clear error */
-    state->x.pos = 0;               /* no uncompressed data yet */
-    state->strm.avail_in = 0;       /* no input data yet */
-}
-
-/* Open a gzip file either by name or file descriptor. */
-local gzFile gz_open(path, fd, mode)
-    const void *path;
-    int fd;
-    const char *mode;
-{
-    gz_statep state;
-    size_t len;
-    int oflag;
-#ifdef O_CLOEXEC
-    int cloexec = 0;
-#endif
-#ifdef O_EXCL
-    int exclusive = 0;
-#endif
-
-    /* check input */
-    if (path == NULL)
-        return NULL;
-
-    /* allocate gzFile structure to return */
-    state = (gz_statep)malloc(sizeof(gz_state));
-    if (state == NULL)
-        return NULL;
-    state->size = 0;            /* no buffers allocated yet */
-    state->want = GZBUFSIZE;    /* requested buffer size */
-    state->msg = NULL;          /* no error message yet */
-
-    /* interpret mode */
-    state->mode = GZ_NONE;
-    state->level = Z_DEFAULT_COMPRESSION;
-    state->strategy = Z_DEFAULT_STRATEGY;
-    state->direct = 0;
-    while (*mode) {
-        if (*mode >= '0' && *mode <= '9')
-            state->level = *mode - '0';
-        else
-            switch (*mode) {
-            case 'r':
-                state->mode = GZ_READ;
-                break;
-#ifndef NO_GZCOMPRESS
-            case 'w':
-                state->mode = GZ_WRITE;
-                break;
-            case 'a':
-                state->mode = GZ_APPEND;
-                break;
-#endif
-            case '+':       /* can't read and write at the same time */
-                free(state);
-                return NULL;
-            case 'b':       /* ignore -- will request binary anyway */
-                break;
-#ifdef O_CLOEXEC
-            case 'e':
-                cloexec = 1;
-                break;
-#endif
-#ifdef O_EXCL
-            case 'x':
-                exclusive = 1;
-                break;
-#endif
-            case 'f':
-                state->strategy = Z_FILTERED;
-                break;
-            case 'h':
-                state->strategy = Z_HUFFMAN_ONLY;
-                break;
-            case 'R':
-                state->strategy = Z_RLE;
-                break;
-            case 'F':
-                state->strategy = Z_FIXED;
-                break;
-            case 'T':
-                state->direct = 1;
-                break;
-            default:        /* could consider as an error, but just ignore */
-                ;
-            }
-        mode++;
-    }
-
-    /* must provide an "r", "w", or "a" */
-    if (state->mode == GZ_NONE) {
-        free(state);
-        return NULL;
-    }
-
-    /* can't force transparent read */
-    if (state->mode == GZ_READ) {
-        if (state->direct) {
-            free(state);
-            return NULL;
-        }
-        state->direct = 1;      /* for empty file */
-    }
-
-    /* save the path name for error messages */
-#ifdef _WIN32
-    if (fd == -2) {
-        len = wcstombs(NULL, path, 0);
-        if (len == (size_t)-1)
-            len = 0;
-    }
-    else
-#endif
-        len = strlen((const char *)path);
-    state->path = (char *)malloc(len + 1);
-    if (state->path == NULL) {
-        free(state);
-        return NULL;
-    }
-#ifdef _WIN32
-    if (fd == -2)
-        if (len)
-            wcstombs(state->path, path, len + 1);
-        else
-            *(state->path) = 0;
-    else
-#endif
-#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
-        snprintf(state->path, len + 1, "%s", (const char *)path);
-#else
-        strcpy(state->path, path);
-#endif
-
-    /* compute the flags for open() */
-    oflag =
-#ifdef O_LARGEFILE
-        O_LARGEFILE |
-#endif
-#ifdef O_BINARY
-        O_BINARY |
-#endif
-#ifdef O_CLOEXEC
-        (cloexec ? O_CLOEXEC : 0) |
-#endif
-        (state->mode == GZ_READ ?
-         O_RDONLY :
-         (O_WRONLY | O_CREAT |
-#ifdef O_EXCL
-          (exclusive ? O_EXCL : 0) |
-#endif
-          (state->mode == GZ_WRITE ?
-           O_TRUNC :
-           O_APPEND)));
-
-    /* open the file with the appropriate flags (or just use fd) */
-    state->fd = fd > -1 ? fd : (
-#ifdef _WIN32
-        fd == -2 ? _wopen(path, oflag, 0666) :
-#endif
-        open((const char *)path, oflag, 0666));
-    if (state->fd == -1) {
-        free(state->path);
-        free(state);
-        return NULL;
-    }
-    if (state->mode == GZ_APPEND)
-        state->mode = GZ_WRITE;         /* simplify later checks */
-
-    /* save the current position for rewinding (only if reading) */
-    if (state->mode == GZ_READ) {
-        state->start = LSEEK(state->fd, 0, SEEK_CUR);
-        if (state->start == -1) state->start = 0;
-    }
-
-    /* initialize stream */
-    gz_reset(state);
-
-    /* return stream */
-    return (gzFile)state;
-}
-
-/* -- see zlib.h -- */
-gzFile ZEXPORT gzopen(path, mode)
-    const char *path;
-    const char *mode;
-{
-    return gz_open(path, -1, mode);
-}
-
-/* -- see zlib.h -- */
-gzFile ZEXPORT gzopen64(path, mode)
-    const char *path;
-    const char *mode;
-{
-    return gz_open(path, -1, mode);
-}
-
-/* -- see zlib.h -- */
-gzFile ZEXPORT gzdopen(fd, mode)
-    int fd;
-    const char *mode;
-{
-    char *path;         /* identifier for error messages */
-    gzFile gz;
-
-    if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
-        return NULL;
-#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
-    snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */
-#else
-    sprintf(path, "<fd:%d>", fd);   /* for debugging */
-#endif
-    gz = gz_open(path, fd, mode);
-    free(path);
-    return gz;
-}
-
-/* -- see zlib.h -- */
-#ifdef _WIN32
-gzFile ZEXPORT gzopen_w(path, mode)
-    const wchar_t *path;
-    const char *mode;
-{
-    return gz_open(path, -2, mode);
-}
-#endif
-
-/* -- see zlib.h -- */
-int ZEXPORT gzbuffer(file, size)
-    gzFile file;
-    unsigned size;
-{
-    gz_statep state;
-
-    /* get internal structure and check integrity */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
-        return -1;
-
-    /* make sure we haven't already allocated memory */
-    if (state->size != 0)
-        return -1;
-
-    /* check and set requested size */
-    if (size < 2)
-        size = 2;               /* need two bytes to check magic header */
-    state->want = size;
-    return 0;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzrewind(file)
-    gzFile file;
-{
-    gz_statep state;
-
-    /* get internal structure */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-
-    /* check that we're reading and that there's no error */
-    if (state->mode != GZ_READ ||
-            (state->err != Z_OK && state->err != Z_BUF_ERROR))
-        return -1;
-
-    /* back up and start over */
-    if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
-        return -1;
-    gz_reset(state);
-    return 0;
-}
-
-/* -- see zlib.h -- */
-z_off64_t ZEXPORT gzseek64(file, offset, whence)
-    gzFile file;
-    z_off64_t offset;
-    int whence;
-{
-    unsigned n;
-    z_off64_t ret;
-    gz_statep state;
-
-    /* get internal structure and check integrity */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
-        return -1;
-
-    /* check that there's no error */
-    if (state->err != Z_OK && state->err != Z_BUF_ERROR)
-        return -1;
-
-    /* can only seek from start or relative to current position */
-    if (whence != SEEK_SET && whence != SEEK_CUR)
-        return -1;
-
-    /* normalize offset to a SEEK_CUR specification */
-    if (whence == SEEK_SET)
-        offset -= state->x.pos;
-    else if (state->seek)
-        offset += state->skip;
-    state->seek = 0;
-
-    /* if within raw area while reading, just go there */
-    if (state->mode == GZ_READ && state->how == COPY &&
-            state->x.pos + offset >= 0) {
-        ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
-        if (ret == -1)
-            return -1;
-        state->x.have = 0;
-        state->eof = 0;
-        state->past = 0;
-        state->seek = 0;
-        gz_error(state, Z_OK, NULL);
-        state->strm.avail_in = 0;
-        state->x.pos += offset;
-        return state->x.pos;
-    }
-
-    /* calculate skip amount, rewinding if needed for back seek when reading */
-    if (offset < 0) {
-        if (state->mode != GZ_READ)         /* writing -- can't go backwards */
-            return -1;
-        offset += state->x.pos;
-        if (offset < 0)                     /* before start of file! */
-            return -1;
-        if (gzrewind(file) == -1)           /* rewind, then skip to offset */
-            return -1;
-    }
-
-    /* if reading, skip what's in output buffer (one less gzgetc() check) */
-    if (state->mode == GZ_READ) {
-        n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ?
-            (unsigned)offset : state->x.have;
-        state->x.have -= n;
-        state->x.next += n;
-        state->x.pos += n;
-        offset -= n;
-    }
-
-    /* request skip (if not zero) */
-    if (offset) {
-        state->seek = 1;
-        state->skip = offset;
-    }
-    return state->x.pos + offset;
-}
-
-/* -- see zlib.h -- */
-z_off_t ZEXPORT gzseek(file, offset, whence)
-    gzFile file;
-    z_off_t offset;
-    int whence;
-{
-    z_off64_t ret;
-
-    ret = gzseek64(file, (z_off64_t)offset, whence);
-    return ret == (z_off_t)ret ? (z_off_t)ret : -1;
-}
-
-/* -- see zlib.h -- */
-z_off64_t ZEXPORT gztell64(file)
-    gzFile file;
-{
-    gz_statep state;
-
-    /* get internal structure and check integrity */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
-        return -1;
-
-    /* return position */
-    return state->x.pos + (state->seek ? state->skip : 0);
-}
-
-/* -- see zlib.h -- */
-z_off_t ZEXPORT gztell(file)
-    gzFile file;
-{
-    z_off64_t ret;
-
-    ret = gztell64(file);
-    return ret == (z_off_t)ret ? (z_off_t)ret : -1;
-}
-
-/* -- see zlib.h -- */
-z_off64_t ZEXPORT gzoffset64(file)
-    gzFile file;
-{
-    z_off64_t offset;
-    gz_statep state;
-
-    /* get internal structure and check integrity */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
-        return -1;
-
-    /* compute and return effective offset in file */
-    offset = LSEEK(state->fd, 0, SEEK_CUR);
-    if (offset == -1)
-        return -1;
-    if (state->mode == GZ_READ)             /* reading */
-        offset -= state->strm.avail_in;     /* don't count buffered input */
-    return offset;
-}
-
-/* -- see zlib.h -- */
-z_off_t ZEXPORT gzoffset(file)
-    gzFile file;
-{
-    z_off64_t ret;
-
-    ret = gzoffset64(file);
-    return ret == (z_off_t)ret ? (z_off_t)ret : -1;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzeof(file)
-    gzFile file;
-{
-    gz_statep state;
-
-    /* get internal structure and check integrity */
-    if (file == NULL)
-        return 0;
-    state = (gz_statep)file;
-    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
-        return 0;
-
-    /* return end-of-file state */
-    return state->mode == GZ_READ ? state->past : 0;
-}
-
-/* -- see zlib.h -- */
-const char * ZEXPORT gzerror(file, errnum)
-    gzFile file;
-    int *errnum;
-{
-    gz_statep state;
-
-    /* get internal structure and check integrity */
-    if (file == NULL)
-        return NULL;
-    state = (gz_statep)file;
-    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
-        return NULL;
-
-    /* return error information */
-    if (errnum != NULL)
-        *errnum = state->err;
-    return state->err == Z_MEM_ERROR ? "out of memory" :
-                                       (state->msg == NULL ? "" : state->msg);
-}
-
-/* -- see zlib.h -- */
-void ZEXPORT gzclearerr(file)
-    gzFile file;
-{
-    gz_statep state;
-
-    /* get internal structure and check integrity */
-    if (file == NULL)
-        return;
-    state = (gz_statep)file;
-    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
-        return;
-
-    /* clear error and end-of-file */
-    if (state->mode == GZ_READ) {
-        state->eof = 0;
-        state->past = 0;
-    }
-    gz_error(state, Z_OK, NULL);
-}
-
-/* Create an error message in allocated memory and set state->err and
-   state->msg accordingly.  Free any previous error message already there.  Do
-   not try to free or allocate space if the error is Z_MEM_ERROR (out of
-   memory).  Simply save the error message as a static string.  If there is an
-   allocation failure constructing the error message, then convert the error to
-   out of memory. */
-void ZLIB_INTERNAL gz_error(state, err, msg)
-    gz_statep state;
-    int err;
-    const char *msg;
-{
-    /* free previously allocated message and clear */
-    if (state->msg != NULL) {
-        if (state->err != Z_MEM_ERROR)
-            free(state->msg);
-        state->msg = NULL;
-    }
-
-    /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
-    if (err != Z_OK && err != Z_BUF_ERROR)
-        state->x.have = 0;
-
-    /* set error code, and if no message, then done */
-    state->err = err;
-    if (msg == NULL)
-        return;
-
-    /* for an out of memory error, return literal string when requested */
-    if (err == Z_MEM_ERROR)
-        return;
-
-    /* construct error message with path */
-    if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
-            NULL) {
-        state->err = Z_MEM_ERROR;
-        return;
-    }
-#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
-    snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
-             "%s%s%s", state->path, ": ", msg);
-#else
-    strcpy(state->msg, state->path);
-    strcat(state->msg, ": ");
-    strcat(state->msg, msg);
-#endif
-    return;
-}
-
-#ifndef INT_MAX
-/* portably return maximum value for an int (when limits.h presumed not
-   available) -- we need to do this to cover cases where 2's complement not
-   used, since C standard permits 1's complement and sign-bit representations,
-   otherwise we could just use ((unsigned)-1) >> 1 */
-unsigned ZLIB_INTERNAL gz_intmax()
-{
-    unsigned p, q;
-
-    p = 1;
-    do {
-        q = p;
-        p <<= 1;
-        p++;
-    } while (p > q);
-    return q >> 1;
-}
-#endif
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzread.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzread.c
deleted file mode 100644
index cd87098..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzread.c
+++ /dev/null
@@ -1,618 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* gzread.c -- zlib functions for reading gzip files
- * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "gzguts.h"
-
-/* Local functions */
-local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
-local int gz_avail OF((gz_statep));
-local int gz_look OF((gz_statep));
-local int gz_decomp OF((gz_statep));
-local int gz_fetch OF((gz_statep));
-local int gz_skip OF((gz_statep, z_off64_t));
-
-/* Use read() to load a buffer -- return -1 on error, otherwise 0.  Read from
-   state->fd, and update state->eof, state->err, and state->msg as appropriate.
-   This function needs to loop on read(), since read() is not guaranteed to
-   read the number of bytes requested, depending on the type of descriptor. */
-local int gz_load(state, buf, len, have)
-    gz_statep state;
-    unsigned char *buf;
-    unsigned len;
-    unsigned *have;
-{
-    int ret;
-
-    *have = 0;
-    do {
-        ret = read(state->fd, buf + *have, len - *have);
-        if (ret <= 0)
-            break;
-        *have += ret;
-    } while (*have < len);
-    if (ret < 0) {
-        gz_error(state, Z_ERRNO, zstrerror());
-        return -1;
-    }
-    if (ret == 0)
-        state->eof = 1;
-    return 0;
-}
-
-/* Load up input buffer and set eof flag if last data loaded -- return -1 on
-   error, 0 otherwise.  Note that the eof flag is set when the end of the input
-   file is reached, even though there may be unused data in the buffer.  Once
-   that data has been used, no more attempts will be made to read the file.
-   If strm->avail_in != 0, then the current data is moved to the beginning of
-   the input buffer, and then the remainder of the buffer is loaded with the
-   available data from the input file. */
-local int gz_avail(state)
-    gz_statep state;
-{
-    unsigned got;
-    z_streamp strm = &(state->strm);
-
-    if (state->err != Z_OK && state->err != Z_BUF_ERROR)
-        return -1;
-    if (state->eof == 0) {
-        if (strm->avail_in) {       /* copy what's there to the start */
-            unsigned char *p = state->in;
-            unsigned const char *q = strm->next_in;
-            unsigned n = strm->avail_in;
-            do {
-                *p++ = *q++;
-            } while (--n);
-        }
-        if (gz_load(state, state->in + strm->avail_in,
-                    state->size - strm->avail_in, &got) == -1)
-            return -1;
-        strm->avail_in += got;
-        strm->next_in = state->in;
-    }
-    return 0;
-}
-
-/* Look for gzip header, set up for inflate or copy.  state->x.have must be 0.
-   If this is the first time in, allocate required memory.  state->how will be
-   left unchanged if there is no more input data available, will be set to COPY
-   if there is no gzip header and direct copying will be performed, or it will
-   be set to GZIP for decompression.  If direct copying, then leftover input
-   data from the input buffer will be copied to the output buffer.  In that
-   case, all further file reads will be directly to either the output buffer or
-   a user buffer.  If decompressing, the inflate state will be initialized.
-   gz_look() will return 0 on success or -1 on failure. */
-local int gz_look(state)
-    gz_statep state;
-{
-    z_streamp strm = &(state->strm);
-
-    /* allocate read buffers and inflate memory */
-    if (state->size == 0) {
-        /* allocate buffers */
-        state->in = (unsigned char *)malloc(state->want);
-        state->out = (unsigned char *)malloc(state->want << 1);
-        if (state->in == NULL || state->out == NULL) {
-            if (state->out != NULL)
-                free(state->out);
-            if (state->in != NULL)
-                free(state->in);
-            gz_error(state, Z_MEM_ERROR, "out of memory");
-            return -1;
-        }
-        state->size = state->want;
-
-        /* allocate inflate memory */
-        state->strm.zalloc = Z_NULL;
-        state->strm.zfree = Z_NULL;
-        state->strm.opaque = Z_NULL;
-        state->strm.avail_in = 0;
-        state->strm.next_in = Z_NULL;
-        if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */
-            free(state->out);
-            free(state->in);
-            state->size = 0;
-            gz_error(state, Z_MEM_ERROR, "out of memory");
-            return -1;
-        }
-    }
-
-    /* get at least the magic bytes in the input buffer */
-    if (strm->avail_in < 2) {
-        if (gz_avail(state) == -1)
-            return -1;
-        if (strm->avail_in == 0)
-            return 0;
-    }
-
-    /* look for gzip magic bytes -- if there, do gzip decoding (note: there is
-       a logical dilemma here when considering the case of a partially written
-       gzip file, to wit, if a single 31 byte is written, then we cannot tell
-       whether this is a single-byte file, or just a partially written gzip
-       file -- for here we assume that if a gzip file is being written, then
-       the header will be written in a single operation, so that reading a
-       single byte is sufficient indication that it is not a gzip file) */
-    if (strm->avail_in > 1 &&
-            strm->next_in[0] == 31 && strm->next_in[1] == 139) {
-        inflateReset(strm);
-        state->how = GZIP;
-        state->direct = 0;
-        return 0;
-    }
-
-    /* no gzip header -- if we were decoding gzip before, then this is trailing
-       garbage.  Ignore the trailing garbage and finish. */
-    if (state->direct == 0) {
-        strm->avail_in = 0;
-        state->eof = 1;
-        state->x.have = 0;
-        return 0;
-    }
-
-    /* doing raw i/o, copy any leftover input to output -- this assumes that
-       the output buffer is larger than the input buffer, which also assures
-       space for gzungetc() */
-    state->x.next = state->out;
-    if (strm->avail_in) {
-        memcpy(state->x.next, strm->next_in, strm->avail_in);
-        state->x.have = strm->avail_in;
-        strm->avail_in = 0;
-    }
-    state->how = COPY;
-    state->direct = 1;
-    return 0;
-}
-
-/* Decompress from input to the provided next_out and avail_out in the state.
-   On return, state->x.have and state->x.next point to the just decompressed
-   data.  If the gzip stream completes, state->how is reset to LOOK to look for
-   the next gzip stream or raw data, once state->x.have is depleted.  Returns 0
-   on success, -1 on failure. */
-local int gz_decomp(state)
-    gz_statep state;
-{
-    int ret = Z_OK;
-    unsigned had;
-    z_streamp strm = &(state->strm);
-
-    /* fill output buffer up to end of deflate stream */
-    had = strm->avail_out;
-    do {
-        /* get more input for inflate() */
-        if (strm->avail_in == 0 && gz_avail(state) == -1)
-            return -1;
-        if (strm->avail_in == 0) {
-            gz_error(state, Z_BUF_ERROR, "unexpected end of file");
-            break;
-        }
-
-        /* decompress and handle errors */
-        ret = inflate(strm, Z_NO_FLUSH);
-        if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
-            gz_error(state, Z_STREAM_ERROR,
-                     "internal error: inflate stream corrupt");
-            return -1;
-        }
-        if (ret == Z_MEM_ERROR) {
-            gz_error(state, Z_MEM_ERROR, "out of memory");
-            return -1;
-        }
-        if (ret == Z_DATA_ERROR) {              /* deflate stream invalid */
-            gz_error(state, Z_DATA_ERROR,
-                     strm->msg == NULL ? "compressed data error" : strm->msg);
-            return -1;
-        }
-    } while (strm->avail_out && ret != Z_STREAM_END);
-
-    /* update available output */
-    state->x.have = had - strm->avail_out;
-    state->x.next = strm->next_out - state->x.have;
-
-    /* if the gzip stream completed successfully, look for another */
-    if (ret == Z_STREAM_END)
-        state->how = LOOK;
-
-    /* good decompression */
-    return 0;
-}
-
-/* Fetch data and put it in the output buffer.  Assumes state->x.have is 0.
-   Data is either copied from the input file or decompressed from the input
-   file depending on state->how.  If state->how is LOOK, then a gzip header is
-   looked for to determine whether to copy or decompress.  Returns -1 on error,
-   otherwise 0.  gz_fetch() will leave state->how as COPY or GZIP unless the
-   end of the input file has been reached and all data has been processed.  */
-local int gz_fetch(state)
-    gz_statep state;
-{
-    z_streamp strm = &(state->strm);
-
-    do {
-        switch(state->how) {
-        case LOOK:      /* -> LOOK, COPY (only if never GZIP), or GZIP */
-            if (gz_look(state) == -1)
-                return -1;
-            if (state->how == LOOK)
-                return 0;
-            break;
-        case COPY:      /* -> COPY */
-            if (gz_load(state, state->out, state->size << 1, &(state->x.have))
-                    == -1)
-                return -1;
-            state->x.next = state->out;
-            return 0;
-        case GZIP:      /* -> GZIP or LOOK (if end of gzip stream) */
-            strm->avail_out = state->size << 1;
-            strm->next_out = state->out;
-            if (gz_decomp(state) == -1)
-                return -1;
-        }
-    } while (state->x.have == 0 && (!state->eof || strm->avail_in));
-    return 0;
-}
-
-/* Skip len uncompressed bytes of output.  Return -1 on error, 0 on success. */
-local int gz_skip(state, len)
-    gz_statep state;
-    z_off64_t len;
-{
-    unsigned n;
-
-    /* skip over len bytes or reach end-of-file, whichever comes first */
-    while (len)
-        /* skip over whatever is in output buffer */
-        if (state->x.have) {
-            n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
-                (unsigned)len : state->x.have;
-            state->x.have -= n;
-            state->x.next += n;
-            state->x.pos += n;
-            len -= n;
-        }
-
-        /* output buffer empty -- return if we're at the end of the input */
-        else if (state->eof && state->strm.avail_in == 0)
-            break;
-
-        /* need more data to skip -- load up output buffer */
-        else {
-            /* get more output, looking for header if required */
-            if (gz_fetch(state) == -1)
-                return -1;
-        }
-    return 0;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzread(file, buf, len)
-    gzFile file;
-    voidp buf;
-    unsigned len;
-{
-    unsigned got, n;
-    gz_statep state;
-    z_streamp strm;
-
-    /* get internal structure */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-    strm = &(state->strm);
-
-    /* check that we're reading and that there's no (serious) error */
-    if (state->mode != GZ_READ ||
-            (state->err != Z_OK && state->err != Z_BUF_ERROR))
-        return -1;
-
-    /* since an int is returned, make sure len fits in one, otherwise return
-       with an error (this avoids the flaw in the interface) */
-    if ((int)len < 0) {
-        gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
-        return -1;
-    }
-
-    /* if len is zero, avoid unnecessary operations */
-    if (len == 0)
-        return 0;
-
-    /* process a skip request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_skip(state, state->skip) == -1)
-            return -1;
-    }
-
-    /* get len bytes to buf, or less than len if at the end */
-    got = 0;
-    do {
-        /* first just try copying data from the output buffer */
-        if (state->x.have) {
-            n = state->x.have > len ? len : state->x.have;
-            memcpy(buf, state->x.next, n);
-            state->x.next += n;
-            state->x.have -= n;
-        }
-
-        /* output buffer empty -- return if we're at the end of the input */
-        else if (state->eof && strm->avail_in == 0) {
-            state->past = 1;        /* tried to read past end */
-            break;
-        }
-
-        /* need output data -- for small len or new stream load up our output
-           buffer */
-        else if (state->how == LOOK || len < (state->size << 1)) {
-            /* get more output, looking for header if required */
-            if (gz_fetch(state) == -1)
-                return -1;
-            continue;       /* no progress yet -- go back to copy above */
-            /* the copy above assures that we will leave with space in the
-               output buffer, allowing at least one gzungetc() to succeed */
-        }
-
-        /* large len -- read directly into user buffer */
-        else if (state->how == COPY) {      /* read directly */
-            if (gz_load(state, (unsigned char *)buf, len, &n) == -1)
-                return -1;
-        }
-
-        /* large len -- decompress directly into user buffer */
-        else {  /* state->how == GZIP */
-            strm->avail_out = len;
-            strm->next_out = (unsigned char *)buf;
-            if (gz_decomp(state) == -1)
-                return -1;
-            n = state->x.have;
-            state->x.have = 0;
-        }
-
-        /* update progress */
-        len -= n;
-        buf = (char *)buf + n;
-        got += n;
-        state->x.pos += n;
-    } while (len);
-
-    /* return number of bytes read into user buffer (will fit in int) */
-    return (int)got;
-}
-
-/* -- see zlib.h -- */
-#ifdef Z_PREFIX_SET
-#  undef z_gzgetc
-#else
-#  undef gzgetc
-#endif
-int ZEXPORT gzgetc(file)
-    gzFile file;
-{
-    int ret;
-    unsigned char buf[1];
-    gz_statep state;
-
-    /* get internal structure */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-
-    /* check that we're reading and that there's no (serious) error */
-    if (state->mode != GZ_READ ||
-        (state->err != Z_OK && state->err != Z_BUF_ERROR))
-        return -1;
-
-    /* try output buffer (no need to check for skip request) */
-    if (state->x.have) {
-        state->x.have--;
-        state->x.pos++;
-        return *(state->x.next)++;
-    }
-
-    /* nothing there -- try gzread() */
-    ret = gzread(file, buf, 1);
-    return ret < 1 ? -1 : buf[0];
-}
-
-int ZEXPORT gzgetc_(file)
-gzFile file;
-{
-    return gzgetc(file);
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzungetc(c, file)
-    int c;
-    gzFile file;
-{
-    gz_statep state;
-
-    /* get internal structure */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-
-    /* check that we're reading and that there's no (serious) error */
-    if (state->mode != GZ_READ ||
-        (state->err != Z_OK && state->err != Z_BUF_ERROR))
-        return -1;
-
-    /* process a skip request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_skip(state, state->skip) == -1)
-            return -1;
-    }
-
-    /* can't push EOF */
-    if (c < 0)
-        return -1;
-
-    /* if output buffer empty, put byte at end (allows more pushing) */
-    if (state->x.have == 0) {
-        state->x.have = 1;
-        state->x.next = state->out + (state->size << 1) - 1;
-        state->x.next[0] = c;
-        state->x.pos--;
-        state->past = 0;
-        return c;
-    }
-
-    /* if no room, give up (must have already done a gzungetc()) */
-    if (state->x.have == (state->size << 1)) {
-        gz_error(state, Z_DATA_ERROR, "out of room to push characters");
-        return -1;
-    }
-
-    /* slide output data if needed and insert byte before existing data */
-    if (state->x.next == state->out) {
-        unsigned char *src = state->out + state->x.have;
-        unsigned char *dest = state->out + (state->size << 1);
-        while (src > state->out)
-            *--dest = *--src;
-        state->x.next = dest;
-    }
-    state->x.have++;
-    state->x.next--;
-    state->x.next[0] = c;
-    state->x.pos--;
-    state->past = 0;
-    return c;
-}
-
-/* -- see zlib.h -- */
-char * ZEXPORT gzgets(file, buf, len)
-    gzFile file;
-    char *buf;
-    int len;
-{
-    unsigned left, n;
-    char *str;
-    unsigned char *eol;
-    gz_statep state;
-
-    /* check parameters and get internal structure */
-    if (file == NULL || buf == NULL || len < 1)
-        return NULL;
-    state = (gz_statep)file;
-
-    /* check that we're reading and that there's no (serious) error */
-    if (state->mode != GZ_READ ||
-        (state->err != Z_OK && state->err != Z_BUF_ERROR))
-        return NULL;
-
-    /* process a skip request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_skip(state, state->skip) == -1)
-            return NULL;
-    }
-
-    /* copy output bytes up to new line or len - 1, whichever comes first --
-       append a terminating zero to the string (we don't check for a zero in
-       the contents, let the user worry about that) */
-    str = buf;
-    left = (unsigned)len - 1;
-    if (left) do {
-        /* assure that something is in the output buffer */
-        if (state->x.have == 0 && gz_fetch(state) == -1)
-            return NULL;                /* error */
-        if (state->x.have == 0) {       /* end of file */
-            state->past = 1;            /* read past end */
-            break;                      /* return what we have */
-        }
-
-        /* look for end-of-line in current output buffer */
-        n = state->x.have > left ? left : state->x.have;
-        eol = (unsigned char *)memchr(state->x.next, '\n', n);
-        if (eol != NULL)
-            n = (unsigned)(eol - state->x.next) + 1;
-
-        /* copy through end-of-line, or remainder if not found */
-        memcpy(buf, state->x.next, n);
-        state->x.have -= n;
-        state->x.next += n;
-        state->x.pos += n;
-        left -= n;
-        buf += n;
-    } while (left && eol == NULL);
-
-    /* return terminated string, or if nothing, end of file */
-    if (buf == str)
-        return NULL;
-    buf[0] = 0;
-    return str;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzdirect(file)
-    gzFile file;
-{
-    gz_statep state;
-
-    /* get internal structure */
-    if (file == NULL)
-        return 0;
-    state = (gz_statep)file;
-
-    /* if the state is not known, but we can find out, then do so (this is
-       mainly for right after a gzopen() or gzdopen()) */
-    if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
-        (void)gz_look(state);
-
-    /* return 1 if transparent, 0 if processing a gzip stream */
-    return state->direct;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzclose_r(file)
-    gzFile file;
-{
-    int ret, err;
-    gz_statep state;
-
-    /* get internal structure */
-    if (file == NULL)
-        return Z_STREAM_ERROR;
-    state = (gz_statep)file;
-
-    /* check that we're reading */
-    if (state->mode != GZ_READ)
-        return Z_STREAM_ERROR;
-
-    /* free memory and close file */
-    if (state->size) {
-        inflateEnd(&(state->strm));
-        free(state->out);
-        free(state->in);
-    }
-    err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
-    gz_error(state, Z_OK, NULL);
-    free(state->path);
-    ret = close(state->fd);
-    free(state);
-    return ret ? Z_ERRNO : err;
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzwrite.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzwrite.c
deleted file mode 100644
index 1955cf7..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzwrite.c
+++ /dev/null
@@ -1,601 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* gzwrite.c -- zlib functions for writing gzip files
- * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "gzguts.h"
-
-/* Local functions */
-local int gz_init OF((gz_statep));
-local int gz_comp OF((gz_statep, int));
-local int gz_zero OF((gz_statep, z_off64_t));
-
-/* Initialize state for writing a gzip file.  Mark initialization by setting
-   state->size to non-zero.  Return -1 on failure or 0 on success. */
-local int gz_init(state)
-    gz_statep state;
-{
-    int ret;
-    z_streamp strm = &(state->strm);
-
-    /* allocate input buffer */
-    state->in = (unsigned char *)malloc(state->want);
-    if (state->in == NULL) {
-        gz_error(state, Z_MEM_ERROR, "out of memory");
-        return -1;
-    }
-
-    /* only need output buffer and deflate state if compressing */
-    if (!state->direct) {
-        /* allocate output buffer */
-        state->out = (unsigned char *)malloc(state->want);
-        if (state->out == NULL) {
-            free(state->in);
-            gz_error(state, Z_MEM_ERROR, "out of memory");
-            return -1;
-        }
-
-        /* allocate deflate memory, set up for gzip compression */
-        strm->zalloc = Z_NULL;
-        strm->zfree = Z_NULL;
-        strm->opaque = Z_NULL;
-        ret = deflateInit2(strm, state->level, Z_DEFLATED,
-                           MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
-        if (ret != Z_OK) {
-            free(state->out);
-            free(state->in);
-            gz_error(state, Z_MEM_ERROR, "out of memory");
-            return -1;
-        }
-    }
-
-    /* mark state as initialized */
-    state->size = state->want;
-
-    /* initialize write buffer if compressing */
-    if (!state->direct) {
-        strm->avail_out = state->size;
-        strm->next_out = state->out;
-        state->x.next = strm->next_out;
-    }
-    return 0;
-}
-
-/* Compress whatever is at avail_in and next_in and write to the output file.
-   Return -1 if there is an error writing to the output file, otherwise 0.
-   flush is assumed to be a valid deflate() flush value.  If flush is Z_FINISH,
-   then the deflate() state is reset to start a new gzip stream.  If gz->direct
-   is true, then simply write to the output file without compressing, and
-   ignore flush. */
-local int gz_comp(state, flush)
-    gz_statep state;
-    int flush;
-{
-    int ret, got;
-    unsigned have;
-    z_streamp strm = &(state->strm);
-
-    /* allocate memory if this is the first time through */
-    if (state->size == 0 && gz_init(state) == -1)
-        return -1;
-
-    /* write directly if requested */
-    if (state->direct) {
-        got = write(state->fd, strm->next_in, strm->avail_in);
-        if (got < 0 || (unsigned)got != strm->avail_in) {
-            gz_error(state, Z_ERRNO, zstrerror());
-            return -1;
-        }
-        strm->avail_in = 0;
-        return 0;
-    }
-
-    /* run deflate() on provided input until it produces no more output */
-    ret = Z_OK;
-    do {
-        /* write out current buffer contents if full, or if flushing, but if
-           doing Z_FINISH then don't write until we get to Z_STREAM_END */
-        if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
-            (flush != Z_FINISH || ret == Z_STREAM_END))) {
-            have = (unsigned)(strm->next_out - state->x.next);
-            if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
-                         (unsigned)got != have)) {
-                gz_error(state, Z_ERRNO, zstrerror());
-                return -1;
-            }
-            if (strm->avail_out == 0) {
-                strm->avail_out = state->size;
-                strm->next_out = state->out;
-            }
-            state->x.next = strm->next_out;
-        }
-
-        /* compress */
-        have = strm->avail_out;
-        ret = deflate(strm, flush);
-        if (ret == Z_STREAM_ERROR) {
-            gz_error(state, Z_STREAM_ERROR,
-                      "internal error: deflate stream corrupt");
-            return -1;
-        }
-        have -= strm->avail_out;
-    } while (have);
-
-    /* if that completed a deflate stream, allow another to start */
-    if (flush == Z_FINISH)
-        deflateReset(strm);
-
-    /* all done, no errors */
-    return 0;
-}
-
-/* Compress len zeros to output.  Return -1 on error, 0 on success. */
-local int gz_zero(state, len)
-    gz_statep state;
-    z_off64_t len;
-{
-    int first;
-    unsigned n;
-    z_streamp strm = &(state->strm);
-
-    /* consume whatever's left in the input buffer */
-    if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
-        return -1;
-
-    /* compress len zeros (len guaranteed > 0) */
-    first = 1;
-    while (len) {
-        n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
-            (unsigned)len : state->size;
-        if (first) {
-            memset(state->in, 0, n);
-            first = 0;
-        }
-        strm->avail_in = n;
-        strm->next_in = state->in;
-        state->x.pos += n;
-        if (gz_comp(state, Z_NO_FLUSH) == -1)
-            return -1;
-        len -= n;
-    }
-    return 0;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzwrite(file, buf, len)
-    gzFile file;
-    voidpc buf;
-    unsigned len;
-{
-    unsigned put = len;
-    gz_statep state;
-    z_streamp strm;
-
-    /* get internal structure */
-    if (file == NULL)
-        return 0;
-    state = (gz_statep)file;
-    strm = &(state->strm);
-
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
-        return 0;
-
-    /* since an int is returned, make sure len fits in one, otherwise return
-       with an error (this avoids the flaw in the interface) */
-    if ((int)len < 0) {
-        gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
-        return 0;
-    }
-
-    /* if len is zero, avoid unnecessary operations */
-    if (len == 0)
-        return 0;
-
-    /* allocate memory if this is the first time through */
-    if (state->size == 0 && gz_init(state) == -1)
-        return 0;
-
-    /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return 0;
-    }
-
-    /* for small len, copy to input buffer, otherwise compress directly */
-    if (len < state->size) {
-        /* copy to input buffer, compress when full */
-        do {
-            unsigned have, copy;
-
-            if (strm->avail_in == 0)
-                strm->next_in = state->in;
-            have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
-            copy = state->size - have;
-            if (copy > len)
-                copy = len;
-            memcpy(state->in + have, buf, copy);
-            strm->avail_in += copy;
-            state->x.pos += copy;
-            buf = (const char *)buf + copy;
-            len -= copy;
-            if (len && gz_comp(state, Z_NO_FLUSH) == -1)
-                return 0;
-        } while (len);
-    }
-    else {
-        /* consume whatever's left in the input buffer */
-        if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
-            return 0;
-
-        /* directly compress user buffer to file */
-        strm->avail_in = len;
-        strm->next_in = (z_const Bytef *)buf;
-        state->x.pos += len;
-        if (gz_comp(state, Z_NO_FLUSH) == -1)
-            return 0;
-    }
-
-    /* input was all buffered or compressed (put will fit in int) */
-    return (int)put;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzputc(file, c)
-    gzFile file;
-    int c;
-{
-    unsigned have;
-    unsigned char buf[1];
-    gz_statep state;
-    z_streamp strm;
-
-    /* get internal structure */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-    strm = &(state->strm);
-
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
-        return -1;
-
-    /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return -1;
-    }
-
-    /* try writing to input buffer for speed (state->size == 0 if buffer not
-       initialized) */
-    if (state->size) {
-        if (strm->avail_in == 0)
-            strm->next_in = state->in;
-        have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
-        if (have < state->size) {
-            state->in[have] = c;
-            strm->avail_in++;
-            state->x.pos++;
-            return c & 0xff;
-        }
-    }
-
-    /* no room in buffer or not initialized, use gz_write() */
-    buf[0] = c;
-    if (gzwrite(file, buf, 1) != 1)
-        return -1;
-    return c & 0xff;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzputs(file, str)
-    gzFile file;
-    const char *str;
-{
-    int ret;
-    unsigned len;
-
-    /* write string */
-    len = (unsigned)strlen(str);
-    ret = gzwrite(file, str, len);
-    return ret == 0 && len != 0 ? -1 : ret;
-}
-
-#if defined(STDC) || defined(Z_HAVE_STDARG_H)
-#include <stdarg.h>
-
-/* -- see zlib.h -- */
-int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
-{
-    int size, len;
-    gz_statep state;
-    z_streamp strm;
-
-    /* get internal structure */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-    strm = &(state->strm);
-
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
-        return 0;
-
-    /* make sure we have some buffer space */
-    if (state->size == 0 && gz_init(state) == -1)
-        return 0;
-
-    /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return 0;
-    }
-
-    /* consume whatever's left in the input buffer */
-    if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
-        return 0;
-
-    /* do the printf() into the input buffer, put length in len */
-    size = (int)(state->size);
-    state->in[size - 1] = 0;
-#ifdef NO_vsnprintf
-#  ifdef HAS_vsprintf_void
-    (void)vsprintf((char *)(state->in), format, va);
-    for (len = 0; len < size; len++)
-        if (state->in[len] == 0) break;
-#  else
-    len = vsprintf((char *)(state->in), format, va);
-#  endif
-#else
-#  ifdef HAS_vsnprintf_void
-    (void)vsnprintf((char *)(state->in), size, format, va);
-    len = strlen((char *)(state->in));
-#  else
-    len = vsnprintf((char *)(state->in), size, format, va);
-#  endif
-#endif
-
-    /* check that printf() results fit in buffer */
-    if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
-        return 0;
-
-    /* update buffer and position, defer compression until needed */
-    strm->avail_in = (unsigned)len;
-    strm->next_in = state->in;
-    state->x.pos += len;
-    return len;
-}
-
-int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
-{
-    va_list va;
-    int ret;
-
-    va_start(va, format);
-    ret = gzvprintf(file, format, va);
-    va_end(va);
-    return ret;
-}
-
-#else /* !STDC && !Z_HAVE_STDARG_H */
-
-/* -- see zlib.h -- */
-int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
-                       a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
-    gzFile file;
-    const char *format;
-    int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
-        a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
-{
-    int size, len;
-    gz_statep state;
-    z_streamp strm;
-
-    /* get internal structure */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-    strm = &(state->strm);
-
-    /* check that can really pass pointer in ints */
-    if (sizeof(int) != sizeof(void *))
-        return 0;
-
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
-        return 0;
-
-    /* make sure we have some buffer space */
-    if (state->size == 0 && gz_init(state) == -1)
-        return 0;
-
-    /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return 0;
-    }
-
-    /* consume whatever's left in the input buffer */
-    if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
-        return 0;
-
-    /* do the printf() into the input buffer, put length in len */
-    size = (int)(state->size);
-    state->in[size - 1] = 0;
-#ifdef NO_snprintf
-#  ifdef HAS_sprintf_void
-    sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
-            a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-    for (len = 0; len < size; len++)
-        if (state->in[len] == 0) break;
-#  else
-    len = sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
-                  a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-#  endif
-#else
-#  ifdef HAS_snprintf_void
-    snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, a7, a8,
-             a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
-    len = strlen((char *)(state->in));
-#  else
-    len = snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6,
-                   a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18,
-                   a19, a20);
-#  endif
-#endif
-
-    /* check that printf() results fit in buffer */
-    if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
-        return 0;
-
-    /* update buffer and position, defer compression until needed */
-    strm->avail_in = (unsigned)len;
-    strm->next_in = state->in;
-    state->x.pos += len;
-    return len;
-}
-
-#endif
-
-/* -- see zlib.h -- */
-int ZEXPORT gzflush(file, flush)
-    gzFile file;
-    int flush;
-{
-    gz_statep state;
-
-    /* get internal structure */
-    if (file == NULL)
-        return -1;
-    state = (gz_statep)file;
-
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
-        return Z_STREAM_ERROR;
-
-    /* check flush parameter */
-    if (flush < 0 || flush > Z_FINISH)
-        return Z_STREAM_ERROR;
-
-    /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return -1;
-    }
-
-    /* compress remaining data with requested flush */
-    gz_comp(state, flush);
-    return state->err;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzsetparams(file, level, strategy)
-    gzFile file;
-    int level;
-    int strategy;
-{
-    gz_statep state;
-    z_streamp strm;
-
-    /* get internal structure */
-    if (file == NULL)
-        return Z_STREAM_ERROR;
-    state = (gz_statep)file;
-    strm = &(state->strm);
-
-    /* check that we're writing and that there's no error */
-    if (state->mode != GZ_WRITE || state->err != Z_OK)
-        return Z_STREAM_ERROR;
-
-    /* if no change is requested, then do nothing */
-    if (level == state->level && strategy == state->strategy)
-        return Z_OK;
-
-    /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            return -1;
-    }
-
-    /* change compression parameters for subsequent input */
-    if (state->size) {
-        /* flush previous input with previous parameters before changing */
-        if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)
-            return state->err;
-        deflateParams(strm, level, strategy);
-    }
-    state->level = level;
-    state->strategy = strategy;
-    return Z_OK;
-}
-
-/* -- see zlib.h -- */
-int ZEXPORT gzclose_w(file)
-    gzFile file;
-{
-    int ret = Z_OK;
-    gz_statep state;
-
-    /* get internal structure */
-    if (file == NULL)
-        return Z_STREAM_ERROR;
-    state = (gz_statep)file;
-
-    /* check that we're writing */
-    if (state->mode != GZ_WRITE)
-        return Z_STREAM_ERROR;
-
-    /* check for seek request */
-    if (state->seek) {
-        state->seek = 0;
-        if (gz_zero(state, state->skip) == -1)
-            ret = state->err;
-    }
-
-    /* flush, free memory, and close file */
-    if (gz_comp(state, Z_FINISH) == -1)
-        ret = state->err;
-    if (state->size) {
-        if (!state->direct) {
-            (void)deflateEnd(&(state->strm));
-            free(state->out);
-        }
-        free(state->in);
-    }
-    gz_error(state, Z_OK, NULL);
-    free(state->path);
-    if (close(state->fd) == -1)
-        ret = Z_ERRNO;
-    free(state);
-    return ret;
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/infback.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/infback.c
deleted file mode 100644
index 7001b4b..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/infback.c
+++ /dev/null
@@ -1,664 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* infback.c -- inflate using a call-back interface
- * Copyright (C) 1995-2011 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
-   This code is largely copied from inflate.c.  Normally either infback.o or
-   inflate.o would be linked into an application--not both.  The interface
-   with inffast.c is retained so that optimized assembler-coded versions of
-   inflate_fast() can be used with either inflate.c or infback.c.
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-/* function prototypes */
-local void fixedtables OF((struct inflate_state FAR *state));
-
-/*
-   strm provides memory allocation functions in zalloc and zfree, or
-   Z_NULL to use the library memory allocation functions.
-
-   windowBits is in the range 8..15, and window is a user-supplied
-   window and output buffer that is 2**windowBits bytes.
- */
-int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
-z_streamp strm;
-int windowBits;
-unsigned char FAR *window;
-const char *version;
-int stream_size;
-{
-    struct inflate_state FAR *state;
-
-    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
-        stream_size != (int)(sizeof(z_stream)))
-        return Z_VERSION_ERROR;
-    if (strm == Z_NULL || window == Z_NULL ||
-        windowBits < 8 || windowBits > 15)
-        return Z_STREAM_ERROR;
-    strm->msg = Z_NULL;                 /* in case we return an error */
-    if (strm->zalloc == (alloc_func)0) {
-#ifdef Z_SOLO
-        return Z_STREAM_ERROR;
-#else
-        strm->zalloc = zcalloc;
-        strm->opaque = (voidpf)0;
-#endif
-    }
-    if (strm->zfree == (free_func)0)
-#ifdef Z_SOLO
-        return Z_STREAM_ERROR;
-#else
-    strm->zfree = zcfree;
-#endif
-    state = (struct inflate_state FAR *)ZALLOC(strm, 1,
-                                               sizeof(struct inflate_state));
-    if (state == Z_NULL) return Z_MEM_ERROR;
-    Tracev((stderr, "inflate: allocated\n"));
-    strm->state = (struct internal_state FAR *)state;
-    state->dmax = 32768U;
-    state->wbits = windowBits;
-    state->wsize = 1U << windowBits;
-    state->window = window;
-    state->wnext = 0;
-    state->whave = 0;
-    return Z_OK;
-}
-
-/*
-   Return state with length and distance decoding tables and index sizes set to
-   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
-   If BUILDFIXED is defined, then instead this routine builds the tables the
-   first time it's called, and returns those tables the first time and
-   thereafter.  This reduces the size of the code by about 2K bytes, in
-   exchange for a little execution time.  However, BUILDFIXED should not be
-   used for threaded applications, since the rewriting of the tables and virgin
-   may not be thread-safe.
- */
-local void fixedtables(state)
-struct inflate_state FAR *state;
-{
-#ifdef BUILDFIXED
-    static int virgin = 1;
-    static code *lenfix, *distfix;
-    static code fixed[544];
-
-    /* build fixed huffman tables if first call (may not be thread safe) */
-    if (virgin) {
-        unsigned sym, bits;
-        static code *next;
-
-        /* literal/length table */
-        sym = 0;
-        while (sym < 144) state->lens[sym++] = 8;
-        while (sym < 256) state->lens[sym++] = 9;
-        while (sym < 280) state->lens[sym++] = 7;
-        while (sym < 288) state->lens[sym++] = 8;
-        next = fixed;
-        lenfix = next;
-        bits = 9;
-        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
-
-        /* distance table */
-        sym = 0;
-        while (sym < 32) state->lens[sym++] = 5;
-        distfix = next;
-        bits = 5;
-        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
-
-        /* do this just once */
-        virgin = 0;
-    }
-#else /* !BUILDFIXED */
-#   include "inffixed.h"
-#endif /* BUILDFIXED */
-    state->lencode = lenfix;
-    state->lenbits = 9;
-    state->distcode = distfix;
-    state->distbits = 5;
-}
-
-/* Macros for inflateBack(): */
-
-/* Load returned state from inflate_fast() */
-#define LOAD() \
-    do { \
-        put = strm->next_out; \
-        left = strm->avail_out; \
-        next = strm->next_in; \
-        have = strm->avail_in; \
-        hold = state->hold; \
-        bits = state->bits; \
-    } while (0)
-
-/* Set state from registers for inflate_fast() */
-#define RESTORE() \
-    do { \
-        strm->next_out = put; \
-        strm->avail_out = left; \
-        strm->next_in = next; \
-        strm->avail_in = have; \
-        state->hold = hold; \
-        state->bits = bits; \
-    } while (0)
-
-/* Clear the input bit accumulator */
-#define INITBITS() \
-    do { \
-        hold = 0; \
-        bits = 0; \
-    } while (0)
-
-/* Assure that some input is available.  If input is requested, but denied,
-   then return a Z_BUF_ERROR from inflateBack(). */
-#define PULL() \
-    do { \
-        if (have == 0) { \
-            have = in(in_desc, &next); \
-            if (have == 0) { \
-                next = Z_NULL; \
-                ret = Z_BUF_ERROR; \
-                goto inf_leave; \
-            } \
-        } \
-    } while (0)
-
-/* Get a byte of input into the bit accumulator, or return from inflateBack()
-   with an error if there is no input available. */
-#define PULLBYTE() \
-    do { \
-        PULL(); \
-        have--; \
-        hold += (unsigned long)(*next++) << bits; \
-        bits += 8; \
-    } while (0)
-
-/* Assure that there are at least n bits in the bit accumulator.  If there is
-   not enough available input to do that, then return from inflateBack() with
-   an error. */
-#define NEEDBITS(n) \
-    do { \
-        while (bits < (unsigned)(n)) \
-            PULLBYTE(); \
-    } while (0)
-
-/* Return the low n bits of the bit accumulator (n < 16) */
-#define BITS(n) \
-    ((unsigned)hold & ((1U << (n)) - 1))
-
-/* Remove n bits from the bit accumulator */
-#define DROPBITS(n) \
-    do { \
-        hold >>= (n); \
-        bits -= (unsigned)(n); \
-    } while (0)
-
-/* Remove zero to seven bits as needed to go to a byte boundary */
-#define BYTEBITS() \
-    do { \
-        hold >>= bits & 7; \
-        bits -= bits & 7; \
-    } while (0)
-
-/* Assure that some output space is available, by writing out the window
-   if it's full.  If the write fails, return from inflateBack() with a
-   Z_BUF_ERROR. */
-#define ROOM() \
-    do { \
-        if (left == 0) { \
-            put = state->window; \
-            left = state->wsize; \
-            state->whave = left; \
-            if (out(out_desc, put, left)) { \
-                ret = Z_BUF_ERROR; \
-                goto inf_leave; \
-            } \
-        } \
-    } while (0)
-
-/*
-   strm provides the memory allocation functions and window buffer on input,
-   and provides information on the unused input on return.  For Z_DATA_ERROR
-   returns, strm will also provide an error message.
-
-   in() and out() are the call-back input and output functions.  When
-   inflateBack() needs more input, it calls in().  When inflateBack() has
-   filled the window with output, or when it completes with data in the
-   window, it calls out() to write out the data.  The application must not
-   change the provided input until in() is called again or inflateBack()
-   returns.  The application must not change the window/output buffer until
-   inflateBack() returns.
-
-   in() and out() are called with a descriptor parameter provided in the
-   inflateBack() call.  This parameter can be a structure that provides the
-   information required to do the read or write, as well as accumulated
-   information on the input and output such as totals and check values.
-
-   in() should return zero on failure.  out() should return non-zero on
-   failure.  If either in() or out() fails, than inflateBack() returns a
-   Z_BUF_ERROR.  strm->next_in can be checked for Z_NULL to see whether it
-   was in() or out() that caused in the error.  Otherwise,  inflateBack()
-   returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
-   error, or Z_MEM_ERROR if it could not allocate memory for the state.
-   inflateBack() can also return Z_STREAM_ERROR if the input parameters
-   are not correct, i.e. strm is Z_NULL or the state was not initialized.
- */
-int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
-z_streamp strm;
-in_func in;
-void FAR *in_desc;
-out_func out;
-void FAR *out_desc;
-{
-    struct inflate_state FAR *state;
-    z_const unsigned char FAR *next;    /* next input */
-    unsigned char FAR *put;     /* next output */
-    unsigned have, left;        /* available input and output */
-    unsigned long hold;         /* bit buffer */
-    unsigned bits;              /* bits in bit buffer */
-    unsigned copy;              /* number of stored or match bytes to copy */
-    unsigned char FAR *from;    /* where to copy match bytes from */
-    code here;                  /* current decoding table entry */
-    code last;                  /* parent table entry */
-    unsigned len;               /* length to copy for repeats, bits to drop */
-    int ret;                    /* return code */
-    static const unsigned short order[19] = /* permutation of code lengths */
-        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-
-    /* Check that the strm exists and that the state was initialized */
-    if (strm == Z_NULL || strm->state == Z_NULL)
-        return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-
-    /* Reset the state */
-    strm->msg = Z_NULL;
-    state->mode = TYPE;
-    state->last = 0;
-    state->whave = 0;
-    next = strm->next_in;
-    have = next != Z_NULL ? strm->avail_in : 0;
-    hold = 0;
-    bits = 0;
-    put = state->window;
-    left = state->wsize;
-
-    /* Inflate until end of block marked as last */
-    for (;;)
-        switch (state->mode) {
-        case TYPE:
-            /* determine and dispatch block type */
-            if (state->last) {
-                BYTEBITS();
-                state->mode = DONE;
-                break;
-            }
-            NEEDBITS(3);
-            state->last = BITS(1);
-            DROPBITS(1);
-            switch (BITS(2)) {
-            case 0:                             /* stored block */
-                Tracev((stderr, "inflate:     stored block%s\n",
-                        state->last ? " (last)" : ""));
-                state->mode = STORED;
-                break;
-            case 1:                             /* fixed block */
-                fixedtables(state);
-                Tracev((stderr, "inflate:     fixed codes block%s\n",
-                        state->last ? " (last)" : ""));
-                state->mode = LEN;              /* decode codes */
-                break;
-            case 2:                             /* dynamic block */
-                Tracev((stderr, "inflate:     dynamic codes block%s\n",
-                        state->last ? " (last)" : ""));
-                state->mode = TABLE;
-                break;
-            case 3:
-                strm->msg = (char *)"invalid block type";
-                state->mode = BAD;
-            }
-            DROPBITS(2);
-            break;
-
-        case STORED:
-            /* get and verify stored block length */
-            BYTEBITS();                         /* go to byte boundary */
-            NEEDBITS(32);
-            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
-                strm->msg = (char *)"invalid stored block lengths";
-                state->mode = BAD;
-                break;
-            }
-            state->length = (unsigned)hold & 0xffff;
-            Tracev((stderr, "inflate:       stored length %u\n",
-                    state->length));
-            INITBITS();
-
-            /* copy stored block from input to output */
-            while (state->length != 0) {
-                copy = state->length;
-                PULL();
-                ROOM();
-                if (copy > have) copy = have;
-                if (copy > left) copy = left;
-                zmemcpy(put, next, copy);
-                have -= copy;
-                next += copy;
-                left -= copy;
-                put += copy;
-                state->length -= copy;
-            }
-            Tracev((stderr, "inflate:       stored end\n"));
-            state->mode = TYPE;
-            break;
-
-        case TABLE:
-            /* get dynamic table entries descriptor */
-            NEEDBITS(14);
-            state->nlen = BITS(5) + 257;
-            DROPBITS(5);
-            state->ndist = BITS(5) + 1;
-            DROPBITS(5);
-            state->ncode = BITS(4) + 4;
-            DROPBITS(4);
-#ifndef PKZIP_BUG_WORKAROUND
-            if (state->nlen > 286 || state->ndist > 30) {
-                strm->msg = (char *)"too many length or distance symbols";
-                state->mode = BAD;
-                break;
-            }
-#endif
-            Tracev((stderr, "inflate:       table sizes ok\n"));
-
-            /* get code length code lengths (not a typo) */
-            state->have = 0;
-            while (state->have < state->ncode) {
-                NEEDBITS(3);
-                state->lens[order[state->have++]] = (unsigned short)BITS(3);
-                DROPBITS(3);
-            }
-            while (state->have < 19)
-                state->lens[order[state->have++]] = 0;
-            state->next = state->codes;
-            state->lencode = (code const FAR *)(state->next);
-            state->lenbits = 7;
-            ret = inflate_table(CODES, state->lens, 19, &(state->next),
-                                &(state->lenbits), state->work);
-            if (ret) {
-                strm->msg = (char *)"invalid code lengths set";
-                state->mode = BAD;
-                break;
-            }
-            Tracev((stderr, "inflate:       code lengths ok\n"));
-
-            /* get length and distance code code lengths */
-            state->have = 0;
-            while (state->have < state->nlen + state->ndist) {
-                for (;;) {
-                    here = state->lencode[BITS(state->lenbits)];
-                    if ((unsigned)(here.bits) <= bits) break;
-                    PULLBYTE();
-                }
-                if (here.val < 16) {
-                    DROPBITS(here.bits);
-                    state->lens[state->have++] = here.val;
-                }
-                else {
-                    if (here.val == 16) {
-                        NEEDBITS(here.bits + 2);
-                        DROPBITS(here.bits);
-                        if (state->have == 0) {
-                            strm->msg = (char *)"invalid bit length repeat";
-                            state->mode = BAD;
-                            break;
-                        }
-                        len = (unsigned)(state->lens[state->have - 1]);
-                        copy = 3 + BITS(2);
-                        DROPBITS(2);
-                    }
-                    else if (here.val == 17) {
-                        NEEDBITS(here.bits + 3);
-                        DROPBITS(here.bits);
-                        len = 0;
-                        copy = 3 + BITS(3);
-                        DROPBITS(3);
-                    }
-                    else {
-                        NEEDBITS(here.bits + 7);
-                        DROPBITS(here.bits);
-                        len = 0;
-                        copy = 11 + BITS(7);
-                        DROPBITS(7);
-                    }
-                    if (state->have + copy > state->nlen + state->ndist) {
-                        strm->msg = (char *)"invalid bit length repeat";
-                        state->mode = BAD;
-                        break;
-                    }
-                    while (copy--)
-                        state->lens[state->have++] = (unsigned short)len;
-                }
-            }
-
-            /* handle error breaks in while */
-            if (state->mode == BAD) break;
-
-            /* check for end-of-block code (better have one) */
-            if (state->lens[256] == 0) {
-                strm->msg = (char *)"invalid code -- missing end-of-block";
-                state->mode = BAD;
-                break;
-            }
-
-            /* build code tables -- note: do not change the lenbits or distbits
-               values here (9 and 6) without reading the comments in inftrees.h
-               concerning the ENOUGH constants, which depend on those values */
-            state->next = state->codes;
-            state->lencode = (code const FAR *)(state->next);
-            state->lenbits = 9;
-            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
-                                &(state->lenbits), state->work);
-            if (ret) {
-                strm->msg = (char *)"invalid literal/lengths set";
-                state->mode = BAD;
-                break;
-            }
-            state->distcode = (code const FAR *)(state->next);
-            state->distbits = 6;
-            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
-                            &(state->next), &(state->distbits), state->work);
-            if (ret) {
-                strm->msg = (char *)"invalid distances set";
-                state->mode = BAD;
-                break;
-            }
-            Tracev((stderr, "inflate:       codes ok\n"));
-            state->mode = LEN;
-
-        case LEN:
-            /* use inflate_fast() if we have enough input and output */
-            if (have >= 6 && left >= 258) {
-                RESTORE();
-                if (state->whave < state->wsize)
-                    state->whave = state->wsize - left;
-                inflate_fast(strm, state->wsize);
-                LOAD();
-                break;
-            }
-
-            /* get a literal, length, or end-of-block code */
-            for (;;) {
-                here = state->lencode[BITS(state->lenbits)];
-                if ((unsigned)(here.bits) <= bits) break;
-                PULLBYTE();
-            }
-            if (here.op && (here.op & 0xf0) == 0) {
-                last = here;
-                for (;;) {
-                    here = state->lencode[last.val +
-                            (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + here.bits) <= bits) break;
-                    PULLBYTE();
-                }
-                DROPBITS(last.bits);
-            }
-            DROPBITS(here.bits);
-            state->length = (unsigned)here.val;
-
-            /* process literal */
-            if (here.op == 0) {
-                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
-                        "inflate:         literal '%c'\n" :
-                        "inflate:         literal 0x%02x\n", here.val));
-                ROOM();
-                *put++ = (unsigned char)(state->length);
-                left--;
-                state->mode = LEN;
-                break;
-            }
-
-            /* process end of block */
-            if (here.op & 32) {
-                Tracevv((stderr, "inflate:         end of block\n"));
-                state->mode = TYPE;
-                break;
-            }
-
-            /* invalid code */
-            if (here.op & 64) {
-                strm->msg = (char *)"invalid literal/length code";
-                state->mode = BAD;
-                break;
-            }
-
-            /* length code -- get extra bits, if any */
-            state->extra = (unsigned)(here.op) & 15;
-            if (state->extra != 0) {
-                NEEDBITS(state->extra);
-                state->length += BITS(state->extra);
-                DROPBITS(state->extra);
-            }
-            Tracevv((stderr, "inflate:         length %u\n", state->length));
-
-            /* get distance code */
-            for (;;) {
-                here = state->distcode[BITS(state->distbits)];
-                if ((unsigned)(here.bits) <= bits) break;
-                PULLBYTE();
-            }
-            if ((here.op & 0xf0) == 0) {
-                last = here;
-                for (;;) {
-                    here = state->distcode[last.val +
-                            (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + here.bits) <= bits) break;
-                    PULLBYTE();
-                }
-                DROPBITS(last.bits);
-            }
-            DROPBITS(here.bits);
-            if (here.op & 64) {
-                strm->msg = (char *)"invalid distance code";
-                state->mode = BAD;
-                break;
-            }
-            state->offset = (unsigned)here.val;
-
-            /* get distance extra bits, if any */
-            state->extra = (unsigned)(here.op) & 15;
-            if (state->extra != 0) {
-                NEEDBITS(state->extra);
-                state->offset += BITS(state->extra);
-                DROPBITS(state->extra);
-            }
-            if (state->offset > state->wsize - (state->whave < state->wsize ?
-                                                left : 0)) {
-                strm->msg = (char *)"invalid distance too far back";
-                state->mode = BAD;
-                break;
-            }
-            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
-
-            /* copy match from window to output */
-            do {
-                ROOM();
-                copy = state->wsize - state->offset;
-                if (copy < left) {
-                    from = put + copy;
-                    copy = left - copy;
-                }
-                else {
-                    from = put - state->offset;
-                    copy = left;
-                }
-                if (copy > state->length) copy = state->length;
-                state->length -= copy;
-                left -= copy;
-                do {
-                    *put++ = *from++;
-                } while (--copy);
-            } while (state->length != 0);
-            break;
-
-        case DONE:
-            /* inflate stream terminated properly -- write leftover output */
-            ret = Z_STREAM_END;
-            if (left < state->wsize) {
-                if (out(out_desc, state->window, state->wsize - left))
-                    ret = Z_BUF_ERROR;
-            }
-            goto inf_leave;
-
-        case BAD:
-            ret = Z_DATA_ERROR;
-            goto inf_leave;
-
-        default:                /* can't happen, but makes compilers happy */
-            ret = Z_STREAM_ERROR;
-            goto inf_leave;
-        }
-
-    /* Return unused input */
-  inf_leave:
-    strm->next_in = next;
-    strm->avail_in = have;
-    return ret;
-}
-
-int ZEXPORT inflateBackEnd(strm)
-z_streamp strm;
-{
-    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
-        return Z_STREAM_ERROR;
-    ZFREE(strm, strm->state);
-    strm->state = Z_NULL;
-    Tracev((stderr, "inflate: end\n"));
-    return Z_OK;
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.c
deleted file mode 100644
index 4b9cddd..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* inffast.c -- fast decoding
- * Copyright (C) 1995-2008, 2010, 2013 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-#ifndef ASMINF
-
-/* Allow machine dependent optimization for post-increment or pre-increment.
-   Based on testing to date,
-   Pre-increment preferred for:
-   - PowerPC G3 (Adler)
-   - MIPS R5000 (Randers-Pehrson)
-   Post-increment preferred for:
-   - none
-   No measurable difference:
-   - Pentium III (Anderson)
-   - M68060 (Nikl)
- */
-#ifdef POSTINC
-#  define OFF 0
-#  define PUP(a) *(a)++
-#else
-#  define OFF 1
-#  define PUP(a) *++(a)
-#endif
-
-/*
-   Decode literal, length, and distance codes and write out the resulting
-   literal and match bytes until either not enough input or output is
-   available, an end-of-block is encountered, or a data error is encountered.
-   When large enough input and output buffers are supplied to inflate(), for
-   example, a 16K input buffer and a 64K output buffer, more than 95% of the
-   inflate execution time is spent in this routine.
-
-   Entry assumptions:
-
-        state->mode == LEN
-        strm->avail_in >= 6
-        strm->avail_out >= 258
-        start >= strm->avail_out
-        state->bits < 8
-
-   On return, state->mode is one of:
-
-        LEN -- ran out of enough output space or enough available input
-        TYPE -- reached end of block code, inflate() to interpret next block
-        BAD -- error in block data
-
-   Notes:
-
-    - The maximum input bits used by a length/distance pair is 15 bits for the
-      length code, 5 bits for the length extra, 15 bits for the distance code,
-      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
-      Therefore if strm->avail_in >= 6, then there is enough input to avoid
-      checking for available input while decoding.
-
-    - The maximum bytes that a single length/distance pair can output is 258
-      bytes, which is the maximum length that can be coded.  inflate_fast()
-      requires strm->avail_out >= 258 for each loop to avoid checking for
-      output space.
- */
-void ZLIB_INTERNAL inflate_fast(strm, start)
-z_streamp strm;
-unsigned start;         /* inflate()'s starting value for strm->avail_out */
-{
-    struct inflate_state FAR *state;
-    z_const unsigned char FAR *in;      /* local strm->next_in */
-    z_const unsigned char FAR *last;    /* have enough input while in < last */
-    unsigned char FAR *out;     /* local strm->next_out */
-    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
-    unsigned char FAR *end;     /* while out < end, enough space available */
-#ifdef INFLATE_STRICT
-    unsigned dmax;              /* maximum distance from zlib header */
-#endif
-    unsigned wsize;             /* window size or zero if not using window */
-    unsigned whave;             /* valid bytes in the window */
-    unsigned wnext;             /* window write index */
-    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
-    unsigned long hold;         /* local strm->hold */
-    unsigned bits;              /* local strm->bits */
-    code const FAR *lcode;      /* local strm->lencode */
-    code const FAR *dcode;      /* local strm->distcode */
-    unsigned lmask;             /* mask for first level of length codes */
-    unsigned dmask;             /* mask for first level of distance codes */
-    code here;                  /* retrieved table entry */
-    unsigned op;                /* code bits, operation, extra bits, or */
-                                /*  window position, window bytes to copy */
-    unsigned len;               /* match length, unused bytes */
-    unsigned dist;              /* match distance */
-    unsigned char FAR *from;    /* where to copy match from */
-
-    /* copy state to local variables */
-    state = (struct inflate_state FAR *)strm->state;
-    in = strm->next_in - OFF;
-    last = in + (strm->avail_in - 5);
-    out = strm->next_out - OFF;
-    beg = out - (start - strm->avail_out);
-    end = out + (strm->avail_out - 257);
-#ifdef INFLATE_STRICT
-    dmax = state->dmax;
-#endif
-    wsize = state->wsize;
-    whave = state->whave;
-    wnext = state->wnext;
-    window = state->window;
-    hold = state->hold;
-    bits = state->bits;
-    lcode = state->lencode;
-    dcode = state->distcode;
-    lmask = (1U << state->lenbits) - 1;
-    dmask = (1U << state->distbits) - 1;
-
-    /* decode literals and length/distances until end-of-block or not enough
-       input data or output space */
-    do {
-        if (bits < 15) {
-            hold += (unsigned long)(PUP(in)) << bits;
-            bits += 8;
-            hold += (unsigned long)(PUP(in)) << bits;
-            bits += 8;
-        }
-        here = lcode[hold & lmask];
-      dolen:
-        op = (unsigned)(here.bits);
-        hold >>= op;
-        bits -= op;
-        op = (unsigned)(here.op);
-        if (op == 0) {                          /* literal */
-            Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
-                    "inflate:         literal '%c'\n" :
-                    "inflate:         literal 0x%02x\n", here.val));
-            PUP(out) = (unsigned char)(here.val);
-        }
-        else if (op & 16) {                     /* length base */
-            len = (unsigned)(here.val);
-            op &= 15;                           /* number of extra bits */
-            if (op) {
-                if (bits < op) {
-                    hold += (unsigned long)(PUP(in)) << bits;
-                    bits += 8;
-                }
-                len += (unsigned)hold & ((1U << op) - 1);
-                hold >>= op;
-                bits -= op;
-            }
-            Tracevv((stderr, "inflate:         length %u\n", len));
-            if (bits < 15) {
-                hold += (unsigned long)(PUP(in)) << bits;
-                bits += 8;
-                hold += (unsigned long)(PUP(in)) << bits;
-                bits += 8;
-            }
-            here = dcode[hold & dmask];
-          dodist:
-            op = (unsigned)(here.bits);
-            hold >>= op;
-            bits -= op;
-            op = (unsigned)(here.op);
-            if (op & 16) {                      /* distance base */
-                dist = (unsigned)(here.val);
-                op &= 15;                       /* number of extra bits */
-                if (bits < op) {
-                    hold += (unsigned long)(PUP(in)) << bits;
-                    bits += 8;
-                    if (bits < op) {
-                        hold += (unsigned long)(PUP(in)) << bits;
-                        bits += 8;
-                    }
-                }
-                dist += (unsigned)hold & ((1U << op) - 1);
-#ifdef INFLATE_STRICT
-                if (dist > dmax) {
-                    strm->msg = (char *)"invalid distance too far back";
-                    state->mode = BAD;
-                    break;
-                }
-#endif
-                hold >>= op;
-                bits -= op;
-                Tracevv((stderr, "inflate:         distance %u\n", dist));
-                op = (unsigned)(out - beg);     /* max distance in output */
-                if (dist > op) {                /* see if copy from window */
-                    op = dist - op;             /* distance back in window */
-                    if (op > whave) {
-                        if (state->sane) {
-                            strm->msg =
-                                (char *)"invalid distance too far back";
-                            state->mode = BAD;
-                            break;
-                        }
-#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
-                        if (len <= op - whave) {
-                            do {
-                                PUP(out) = 0;
-                            } while (--len);
-                            continue;
-                        }
-                        len -= op - whave;
-                        do {
-                            PUP(out) = 0;
-                        } while (--op > whave);
-                        if (op == 0) {
-                            from = out - dist;
-                            do {
-                                PUP(out) = PUP(from);
-                            } while (--len);
-                            continue;
-                        }
-#endif
-                    }
-                    from = window - OFF;
-                    if (wnext == 0) {           /* very common case */
-                        from += wsize - op;
-                        if (op < len) {         /* some from window */
-                            len -= op;
-                            do {
-                                PUP(out) = PUP(from);
-                            } while (--op);
-                            from = out - dist;  /* rest from output */
-                        }
-                    }
-                    else if (wnext < op) {      /* wrap around window */
-                        from += wsize + wnext - op;
-                        op -= wnext;
-                        if (op < len) {         /* some from end of window */
-                            len -= op;
-                            do {
-                                PUP(out) = PUP(from);
-                            } while (--op);
-                            from = window - OFF;
-                            if (wnext < len) {  /* some from start of window */
-                                op = wnext;
-                                len -= op;
-                                do {
-                                    PUP(out) = PUP(from);
-                                } while (--op);
-                                from = out - dist;      /* rest from output */
-                            }
-                        }
-                    }
-                    else {                      /* contiguous in window */
-                        from += wnext - op;
-                        if (op < len) {         /* some from window */
-                            len -= op;
-                            do {
-                                PUP(out) = PUP(from);
-                            } while (--op);
-                            from = out - dist;  /* rest from output */
-                        }
-                    }
-                    while (len > 2) {
-                        PUP(out) = PUP(from);
-                        PUP(out) = PUP(from);
-                        PUP(out) = PUP(from);
-                        len -= 3;
-                    }
-                    if (len) {
-                        PUP(out) = PUP(from);
-                        if (len > 1)
-                            PUP(out) = PUP(from);
-                    }
-                }
-                else {
-                    from = out - dist;          /* copy direct from output */
-                    do {                        /* minimum length is three */
-                        PUP(out) = PUP(from);
-                        PUP(out) = PUP(from);
-                        PUP(out) = PUP(from);
-                        len -= 3;
-                    } while (len > 2);
-                    if (len) {
-                        PUP(out) = PUP(from);
-                        if (len > 1)
-                            PUP(out) = PUP(from);
-                    }
-                }
-            }
-            else if ((op & 64) == 0) {          /* 2nd level distance code */
-                here = dcode[here.val + (hold & ((1U << op) - 1))];
-                goto dodist;
-            }
-            else {
-                strm->msg = (char *)"invalid distance code";
-                state->mode = BAD;
-                break;
-            }
-        }
-        else if ((op & 64) == 0) {              /* 2nd level length code */
-            here = lcode[here.val + (hold & ((1U << op) - 1))];
-            goto dolen;
-        }
-        else if (op & 32) {                     /* end-of-block */
-            Tracevv((stderr, "inflate:         end of block\n"));
-            state->mode = TYPE;
-            break;
-        }
-        else {
-            strm->msg = (char *)"invalid literal/length code";
-            state->mode = BAD;
-            break;
-        }
-    } while (in < last && out < end);
-
-    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
-    len = bits >> 3;
-    in -= len;
-    bits -= len << 3;
-    hold &= (1U << bits) - 1;
-
-    /* update state and return */
-    strm->next_in = in + OFF;
-    strm->next_out = out + OFF;
-    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
-    strm->avail_out = (unsigned)(out < end ?
-                                 257 + (end - out) : 257 - (out - end));
-    state->hold = hold;
-    state->bits = bits;
-    return;
-}
-
-/*
-   inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
-   - Using bit fields for code structure
-   - Different op definition to avoid & for extra bits (do & for table bits)
-   - Three separate decoding do-loops for direct, window, and wnext == 0
-   - Special case for distance > 1 copies to do overlapped load and store copy
-   - Explicit branch predictions (based on measured branch probabilities)
-   - Deferring match copy and interspersed it with decoding subsequent codes
-   - Swapping literal/length else
-   - Swapping window/direct else
-   - Larger unrolled copy loops (three is about right)
-   - Moving len -= 3 statement into middle of loop
- */
-
-#endif /* !ASMINF */
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.c
deleted file mode 100644
index b159c15..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.c
+++ /dev/null
@@ -1,1536 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* inflate.c -- zlib decompression
- * Copyright (C) 1995-2012 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- * Change history:
- *
- * 1.2.beta0    24 Nov 2002
- * - First version -- complete rewrite of inflate to simplify code, avoid
- *   creation of window when not needed, minimize use of window when it is
- *   needed, make inffast.c even faster, implement gzip decoding, and to
- *   improve code readability and style over the previous zlib inflate code
- *
- * 1.2.beta1    25 Nov 2002
- * - Use pointers for available input and output checking in inffast.c
- * - Remove input and output counters in inffast.c
- * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
- * - Remove unnecessary second byte pull from length extra in inffast.c
- * - Unroll direct copy to three copies per loop in inffast.c
- *
- * 1.2.beta2    4 Dec 2002
- * - Change external routine names to reduce potential conflicts
- * - Correct filename to inffixed.h for fixed tables in inflate.c
- * - Make hbuf[] unsigned char to match parameter type in inflate.c
- * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
- *   to avoid negation problem on Alphas (64 bit) in inflate.c
- *
- * 1.2.beta3    22 Dec 2002
- * - Add comments on state->bits assertion in inffast.c
- * - Add comments on op field in inftrees.h
- * - Fix bug in reuse of allocated window after inflateReset()
- * - Remove bit fields--back to byte structure for speed
- * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
- * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
- * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
- * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
- * - Use local copies of stream next and avail values, as well as local bit
- *   buffer and bit count in inflate()--for speed when inflate_fast() not used
- *
- * 1.2.beta4    1 Jan 2003
- * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
- * - Move a comment on output buffer sizes from inffast.c to inflate.c
- * - Add comments in inffast.c to introduce the inflate_fast() routine
- * - Rearrange window copies in inflate_fast() for speed and simplification
- * - Unroll last copy for window match in inflate_fast()
- * - Use local copies of window variables in inflate_fast() for speed
- * - Pull out common wnext == 0 case for speed in inflate_fast()
- * - Make op and len in inflate_fast() unsigned for consistency
- * - Add FAR to lcode and dcode declarations in inflate_fast()
- * - Simplified bad distance check in inflate_fast()
- * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
- *   source file infback.c to provide a call-back interface to inflate for
- *   programs like gzip and unzip -- uses window as output buffer to avoid
- *   window copying
- *
- * 1.2.beta5    1 Jan 2003
- * - Improved inflateBack() interface to allow the caller to provide initial
- *   input in strm.
- * - Fixed stored blocks bug in inflateBack()
- *
- * 1.2.beta6    4 Jan 2003
- * - Added comments in inffast.c on effectiveness of POSTINC
- * - Typecasting all around to reduce compiler warnings
- * - Changed loops from while (1) or do {} while (1) to for (;;), again to
- *   make compilers happy
- * - Changed type of window in inflateBackInit() to unsigned char *
- *
- * 1.2.beta7    27 Jan 2003
- * - Changed many types to unsigned or unsigned short to avoid warnings
- * - Added inflateCopy() function
- *
- * 1.2.0        9 Mar 2003
- * - Changed inflateBack() interface to provide separate opaque descriptors
- *   for the in() and out() functions
- * - Changed inflateBack() argument and in_func typedef to swap the length
- *   and buffer address return values for the input function
- * - Check next_in and next_out for Z_NULL on entry to inflate()
- *
- * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-#ifdef MAKEFIXED
-#  ifndef BUILDFIXED
-#    define BUILDFIXED
-#  endif
-#endif
-
-/* function prototypes */
-local void fixedtables OF((struct inflate_state FAR *state));
-local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
-                           unsigned copy));
-#ifdef BUILDFIXED
-   void makefixed OF((void));
-#endif
-local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
-                              unsigned len));
-
-int ZEXPORT inflateResetKeep(strm)
-z_streamp strm;
-{
-    struct inflate_state FAR *state;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    strm->total_in = strm->total_out = state->total = 0;
-    strm->msg = Z_NULL;
-    if (state->wrap)        /* to support ill-conceived Java test suite */
-        strm->adler = state->wrap & 1;
-    state->mode = HEAD;
-    state->last = 0;
-    state->havedict = 0;
-    state->dmax = 32768U;
-    state->head = Z_NULL;
-    state->hold = 0;
-    state->bits = 0;
-    state->lencode = state->distcode = state->next = state->codes;
-    state->sane = 1;
-    state->back = -1;
-    Tracev((stderr, "inflate: reset\n"));
-    return Z_OK;
-}
-
-int ZEXPORT inflateReset(strm)
-z_streamp strm;
-{
-    struct inflate_state FAR *state;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    state->wsize = 0;
-    state->whave = 0;
-    state->wnext = 0;
-    return inflateResetKeep(strm);
-}
-
-int ZEXPORT inflateReset2(strm, windowBits)
-z_streamp strm;
-int windowBits;
-{
-    int wrap;
-    struct inflate_state FAR *state;
-
-    /* get the state */
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-
-    /* extract wrap request from windowBits parameter */
-    if (windowBits < 0) {
-        wrap = 0;
-        windowBits = -windowBits;
-    }
-    else {
-        wrap = (windowBits >> 4) + 1;
-#ifdef GUNZIP
-        if (windowBits < 48)
-            windowBits &= 15;
-#endif
-    }
-
-    /* set number of window bits, free window if different */
-    if (windowBits && (windowBits < 8 || windowBits > 15))
-        return Z_STREAM_ERROR;
-    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
-        ZFREE(strm, state->window);
-        state->window = Z_NULL;
-    }
-
-    /* update state and reset the rest of it */
-    state->wrap = wrap;
-    state->wbits = (unsigned)windowBits;
-    return inflateReset(strm);
-}
-
-int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
-z_streamp strm;
-int windowBits;
-const char *version;
-int stream_size;
-{
-    int ret;
-    struct inflate_state FAR *state;
-
-    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
-        stream_size != (int)(sizeof(z_stream)))
-        return Z_VERSION_ERROR;
-    if (strm == Z_NULL) return Z_STREAM_ERROR;
-    strm->msg = Z_NULL;                 /* in case we return an error */
-    if (strm->zalloc == (alloc_func)0) {
-#ifdef Z_SOLO
-        return Z_STREAM_ERROR;
-#else
-        strm->zalloc = zcalloc;
-        strm->opaque = (voidpf)0;
-#endif
-    }
-    if (strm->zfree == (free_func)0)
-#ifdef Z_SOLO
-        return Z_STREAM_ERROR;
-#else
-        strm->zfree = zcfree;
-#endif
-    state = (struct inflate_state FAR *)
-            ZALLOC(strm, 1, sizeof(struct inflate_state));
-    if (state == Z_NULL) return Z_MEM_ERROR;
-    Tracev((stderr, "inflate: allocated\n"));
-    strm->state = (struct internal_state FAR *)state;
-    state->window = Z_NULL;
-    ret = inflateReset2(strm, windowBits);
-    if (ret != Z_OK) {
-        ZFREE(strm, state);
-        strm->state = Z_NULL;
-    }
-    return ret;
-}
-
-int ZEXPORT inflateInit_(strm, version, stream_size)
-z_streamp strm;
-const char *version;
-int stream_size;
-{
-    return inflateInit2_(strm, DEF_WBITS, version, stream_size);
-}
-
-int ZEXPORT inflatePrime(strm, bits, value)
-z_streamp strm;
-int bits;
-int value;
-{
-    struct inflate_state FAR *state;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    if (bits < 0) {
-        state->hold = 0;
-        state->bits = 0;
-        return Z_OK;
-    }
-    if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
-    value &= (1L << bits) - 1;
-    state->hold += value << state->bits;
-    state->bits += bits;
-    return Z_OK;
-}
-
-/*
-   Return state with length and distance decoding tables and index sizes set to
-   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
-   If BUILDFIXED is defined, then instead this routine builds the tables the
-   first time it's called, and returns those tables the first time and
-   thereafter.  This reduces the size of the code by about 2K bytes, in
-   exchange for a little execution time.  However, BUILDFIXED should not be
-   used for threaded applications, since the rewriting of the tables and virgin
-   may not be thread-safe.
- */
-local void fixedtables(state)
-struct inflate_state FAR *state;
-{
-#ifdef BUILDFIXED
-    static int virgin = 1;
-    static code *lenfix, *distfix;
-    static code fixed[544];
-
-    /* build fixed huffman tables if first call (may not be thread safe) */
-    if (virgin) {
-        unsigned sym, bits;
-        static code *next;
-
-        /* literal/length table */
-        sym = 0;
-        while (sym < 144) state->lens[sym++] = 8;
-        while (sym < 256) state->lens[sym++] = 9;
-        while (sym < 280) state->lens[sym++] = 7;
-        while (sym < 288) state->lens[sym++] = 8;
-        next = fixed;
-        lenfix = next;
-        bits = 9;
-        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
-
-        /* distance table */
-        sym = 0;
-        while (sym < 32) state->lens[sym++] = 5;
-        distfix = next;
-        bits = 5;
-        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
-
-        /* do this just once */
-        virgin = 0;
-    }
-#else /* !BUILDFIXED */
-#   include "inffixed.h"
-#endif /* BUILDFIXED */
-    state->lencode = lenfix;
-    state->lenbits = 9;
-    state->distcode = distfix;
-    state->distbits = 5;
-}
-
-#ifdef MAKEFIXED
-#include <stdio.h>
-
-/*
-   Write out the inffixed.h that is #include'd above.  Defining MAKEFIXED also
-   defines BUILDFIXED, so the tables are built on the fly.  makefixed() writes
-   those tables to stdout, which would be piped to inffixed.h.  A small program
-   can simply call makefixed to do this:
-
-    void makefixed(void);
-
-    int main(void)
-    {
-        makefixed();
-        return 0;
-    }
-
-   Then that can be linked with zlib built with MAKEFIXED defined and run:
-
-    a.out > inffixed.h
- */
-void makefixed()
-{
-    unsigned low, size;
-    struct inflate_state state;
-
-    fixedtables(&state);
-    puts("    /* inffixed.h -- table for decoding fixed codes");
-    puts("     * Generated automatically by makefixed().");
-    puts("     */");
-    puts("");
-    puts("    /* WARNING: this file should *not* be used by applications.");
-    puts("       It is part of the implementation of this library and is");
-    puts("       subject to change. Applications should only use zlib.h.");
-    puts("     */");
-    puts("");
-    size = 1U << 9;
-    printf("    static const code lenfix[%u] = {", size);
-    low = 0;
-    for (;;) {
-        if ((low % 7) == 0) printf("\n        ");
-        printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
-               state.lencode[low].bits, state.lencode[low].val);
-        if (++low == size) break;
-        putchar(',');
-    }
-    puts("\n    };");
-    size = 1U << 5;
-    printf("\n    static const code distfix[%u] = {", size);
-    low = 0;
-    for (;;) {
-        if ((low % 6) == 0) printf("\n        ");
-        printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
-               state.distcode[low].val);
-        if (++low == size) break;
-        putchar(',');
-    }
-    puts("\n    };");
-}
-#endif /* MAKEFIXED */
-
-/*
-   Update the window with the last wsize (normally 32K) bytes written before
-   returning.  If window does not exist yet, create it.  This is only called
-   when a window is already in use, or when output has been written during this
-   inflate call, but the end of the deflate stream has not been reached yet.
-   It is also called to create a window for dictionary data when a dictionary
-   is loaded.
-
-   Providing output buffers larger than 32K to inflate() should provide a speed
-   advantage, since only the last 32K of output is copied to the sliding window
-   upon return from inflate(), and since all distances after the first 32K of
-   output will fall in the output data, making match copies simpler and faster.
-   The advantage may be dependent on the size of the processor's data caches.
- */
-local int updatewindow(strm, end, copy)
-z_streamp strm;
-const Bytef *end;
-unsigned copy;
-{
-    struct inflate_state FAR *state;
-    unsigned dist;
-
-    state = (struct inflate_state FAR *)strm->state;
-
-    /* if it hasn't been done already, allocate space for the window */
-    if (state->window == Z_NULL) {
-        state->window = (unsigned char FAR *)
-                        ZALLOC(strm, 1U << state->wbits,
-                               sizeof(unsigned char));
-        if (state->window == Z_NULL) return 1;
-    }
-
-    /* if window not in use yet, initialize */
-    if (state->wsize == 0) {
-        state->wsize = 1U << state->wbits;
-        state->wnext = 0;
-        state->whave = 0;
-    }
-
-    /* copy state->wsize or less output bytes into the circular window */
-    if (copy >= state->wsize) {
-        zmemcpy(state->window, end - state->wsize, state->wsize);
-        state->wnext = 0;
-        state->whave = state->wsize;
-    }
-    else {
-        dist = state->wsize - state->wnext;
-        if (dist > copy) dist = copy;
-        zmemcpy(state->window + state->wnext, end - copy, dist);
-        copy -= dist;
-        if (copy) {
-            zmemcpy(state->window, end - copy, copy);
-            state->wnext = copy;
-            state->whave = state->wsize;
-        }
-        else {
-            state->wnext += dist;
-            if (state->wnext == state->wsize) state->wnext = 0;
-            if (state->whave < state->wsize) state->whave += dist;
-        }
-    }
-    return 0;
-}
-
-/* Macros for inflate(): */
-
-/* check function to use adler32() for zlib or crc32() for gzip */
-#ifdef GUNZIP
-#  define UPDATE(check, buf, len) \
-    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
-#else
-#  define UPDATE(check, buf, len) adler32(check, buf, len)
-#endif
-
-/* check macros for header crc */
-#ifdef GUNZIP
-#  define CRC2(check, word) \
-    do { \
-        hbuf[0] = (unsigned char)(word); \
-        hbuf[1] = (unsigned char)((word) >> 8); \
-        check = crc32(check, hbuf, 2); \
-    } while (0)
-
-#  define CRC4(check, word) \
-    do { \
-        hbuf[0] = (unsigned char)(word); \
-        hbuf[1] = (unsigned char)((word) >> 8); \
-        hbuf[2] = (unsigned char)((word) >> 16); \
-        hbuf[3] = (unsigned char)((word) >> 24); \
-        check = crc32(check, hbuf, 4); \
-    } while (0)
-#endif
-
-/* Load registers with state in inflate() for speed */
-#define LOAD() \
-    do { \
-        put = strm->next_out; \
-        left = strm->avail_out; \
-        next = strm->next_in; \
-        have = strm->avail_in; \
-        hold = state->hold; \
-        bits = state->bits; \
-    } while (0)
-
-/* Restore state from registers in inflate() */
-#define RESTORE() \
-    do { \
-        strm->next_out = put; \
-        strm->avail_out = left; \
-        strm->next_in = next; \
-        strm->avail_in = have; \
-        state->hold = hold; \
-        state->bits = bits; \
-    } while (0)
-
-/* Clear the input bit accumulator */
-#define INITBITS() \
-    do { \
-        hold = 0; \
-        bits = 0; \
-    } while (0)
-
-/* Get a byte of input into the bit accumulator, or return from inflate()
-   if there is no input available. */
-#define PULLBYTE() \
-    do { \
-        if (have == 0) goto inf_leave; \
-        have--; \
-        hold += (unsigned long)(*next++) << bits; \
-        bits += 8; \
-    } while (0)
-
-/* Assure that there are at least n bits in the bit accumulator.  If there is
-   not enough available input to do that, then return from inflate(). */
-#define NEEDBITS(n) \
-    do { \
-        while (bits < (unsigned)(n)) \
-            PULLBYTE(); \
-    } while (0)
-
-/* Return the low n bits of the bit accumulator (n < 16) */
-#define BITS(n) \
-    ((unsigned)hold & ((1U << (n)) - 1))
-
-/* Remove n bits from the bit accumulator */
-#define DROPBITS(n) \
-    do { \
-        hold >>= (n); \
-        bits -= (unsigned)(n); \
-    } while (0)
-
-/* Remove zero to seven bits as needed to go to a byte boundary */
-#define BYTEBITS() \
-    do { \
-        hold >>= bits & 7; \
-        bits -= bits & 7; \
-    } while (0)
-
-/*
-   inflate() uses a state machine to process as much input data and generate as
-   much output data as possible before returning.  The state machine is
-   structured roughly as follows:
-
-    for (;;) switch (state) {
-    ...
-    case STATEn:
-        if (not enough input data or output space to make progress)
-            return;
-        ... make progress ...
-        state = STATEm;
-        break;
-    ...
-    }
-
-   so when inflate() is called again, the same case is attempted again, and
-   if the appropriate resources are provided, the machine proceeds to the
-   next state.  The NEEDBITS() macro is usually the way the state evaluates
-   whether it can proceed or should return.  NEEDBITS() does the return if
-   the requested bits are not available.  The typical use of the BITS macros
-   is:
-
-        NEEDBITS(n);
-        ... do something with BITS(n) ...
-        DROPBITS(n);
-
-   where NEEDBITS(n) either returns from inflate() if there isn't enough
-   input left to load n bits into the accumulator, or it continues.  BITS(n)
-   gives the low n bits in the accumulator.  When done, DROPBITS(n) drops
-   the low n bits off the accumulator.  INITBITS() clears the accumulator
-   and sets the number of available bits to zero.  BYTEBITS() discards just
-   enough bits to put the accumulator on a byte boundary.  After BYTEBITS()
-   and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
-
-   NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
-   if there is no input available.  The decoding of variable length codes uses
-   PULLBYTE() directly in order to pull just enough bytes to decode the next
-   code, and no more.
-
-   Some states loop until they get enough input, making sure that enough
-   state information is maintained to continue the loop where it left off
-   if NEEDBITS() returns in the loop.  For example, want, need, and keep
-   would all have to actually be part of the saved state in case NEEDBITS()
-   returns:
-
-    case STATEw:
-        while (want < need) {
-            NEEDBITS(n);
-            keep[want++] = BITS(n);
-            DROPBITS(n);
-        }
-        state = STATEx;
-    case STATEx:
-
-   As shown above, if the next state is also the next case, then the break
-   is omitted.
-
-   A state may also return if there is not enough output space available to
-   complete that state.  Those states are copying stored data, writing a
-   literal byte, and copying a matching string.
-
-   When returning, a "goto inf_leave" is used to update the total counters,
-   update the check value, and determine whether any progress has been made
-   during that inflate() call in order to return the proper return code.
-   Progress is defined as a change in either strm->avail_in or strm->avail_out.
-   When there is a window, goto inf_leave will update the window with the last
-   output written.  If a goto inf_leave occurs in the middle of decompression
-   and there is no window currently, goto inf_leave will create one and copy
-   output to the window for the next call of inflate().
-
-   In this implementation, the flush parameter of inflate() only affects the
-   return code (per zlib.h).  inflate() always writes as much as possible to
-   strm->next_out, given the space available and the provided input--the effect
-   documented in zlib.h of Z_SYNC_FLUSH.  Furthermore, inflate() always defers
-   the allocation of and copying into a sliding window until necessary, which
-   provides the effect documented in zlib.h for Z_FINISH when the entire input
-   stream available.  So the only thing the flush parameter actually does is:
-   when flush is set to Z_FINISH, inflate() cannot return Z_OK.  Instead it
-   will return Z_BUF_ERROR if it has not reached the end of the stream.
- */
-
-int ZEXPORT inflate(strm, flush)
-z_streamp strm;
-int flush;
-{
-    struct inflate_state FAR *state;
-    z_const unsigned char FAR *next;    /* next input */
-    unsigned char FAR *put;     /* next output */
-    unsigned have, left;        /* available input and output */
-    unsigned long hold;         /* bit buffer */
-    unsigned bits;              /* bits in bit buffer */
-    unsigned in, out;           /* save starting available input and output */
-    unsigned copy;              /* number of stored or match bytes to copy */
-    unsigned char FAR *from;    /* where to copy match bytes from */
-    code here;                  /* current decoding table entry */
-    code last;                  /* parent table entry */
-    unsigned len;               /* length to copy for repeats, bits to drop */
-    int ret;                    /* return code */
-#ifdef GUNZIP
-    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
-#endif
-    static const unsigned short order[19] = /* permutation of code lengths */
-        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-
-    if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
-        (strm->next_in == Z_NULL && strm->avail_in != 0))
-        return Z_STREAM_ERROR;
-
-    state = (struct inflate_state FAR *)strm->state;
-    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
-    LOAD();
-    in = have;
-    out = left;
-    ret = Z_OK;
-    for (;;)
-        switch (state->mode) {
-        case HEAD:
-            if (state->wrap == 0) {
-                state->mode = TYPEDO;
-                break;
-            }
-            NEEDBITS(16);
-#ifdef GUNZIP
-            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
-                state->check = crc32(0L, Z_NULL, 0);
-                CRC2(state->check, hold);
-                INITBITS();
-                state->mode = FLAGS;
-                break;
-            }
-            state->flags = 0;           /* expect zlib header */
-            if (state->head != Z_NULL)
-                state->head->done = -1;
-            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
-#else
-            if (
-#endif
-                ((BITS(8) << 8) + (hold >> 8)) % 31) {
-                strm->msg = (char *)"incorrect header check";
-                state->mode = BAD;
-                break;
-            }
-            if (BITS(4) != Z_DEFLATED) {
-                strm->msg = (char *)"unknown compression method";
-                state->mode = BAD;
-                break;
-            }
-            DROPBITS(4);
-            len = BITS(4) + 8;
-            if (state->wbits == 0)
-                state->wbits = len;
-            else if (len > state->wbits) {
-                strm->msg = (char *)"invalid window size";
-                state->mode = BAD;
-                break;
-            }
-            state->dmax = 1U << len;
-            Tracev((stderr, "inflate:   zlib header ok\n"));
-            strm->adler = state->check = adler32(0L, Z_NULL, 0);
-            state->mode = hold & 0x200 ? DICTID : TYPE;
-            INITBITS();
-            break;
-#ifdef GUNZIP
-        case FLAGS:
-            NEEDBITS(16);
-            state->flags = (int)(hold);
-            if ((state->flags & 0xff) != Z_DEFLATED) {
-                strm->msg = (char *)"unknown compression method";
-                state->mode = BAD;
-                break;
-            }
-            if (state->flags & 0xe000) {
-                strm->msg = (char *)"unknown header flags set";
-                state->mode = BAD;
-                break;
-            }
-            if (state->head != Z_NULL)
-                state->head->text = (int)((hold >> 8) & 1);
-            if (state->flags & 0x0200) CRC2(state->check, hold);
-            INITBITS();
-            state->mode = TIME;
-        case TIME:
-            NEEDBITS(32);
-            if (state->head != Z_NULL)
-                state->head->time = hold;
-            if (state->flags & 0x0200) CRC4(state->check, hold);
-            INITBITS();
-            state->mode = OS;
-        case OS:
-            NEEDBITS(16);
-            if (state->head != Z_NULL) {
-                state->head->xflags = (int)(hold & 0xff);
-                state->head->os = (int)(hold >> 8);
-            }
-            if (state->flags & 0x0200) CRC2(state->check, hold);
-            INITBITS();
-            state->mode = EXLEN;
-        case EXLEN:
-            if (state->flags & 0x0400) {
-                NEEDBITS(16);
-                state->length = (unsigned)(hold);
-                if (state->head != Z_NULL)
-                    state->head->extra_len = (unsigned)hold;
-                if (state->flags & 0x0200) CRC2(state->check, hold);
-                INITBITS();
-            }
-            else if (state->head != Z_NULL)
-                state->head->extra = Z_NULL;
-            state->mode = EXTRA;
-        case EXTRA:
-            if (state->flags & 0x0400) {
-                copy = state->length;
-                if (copy > have) copy = have;
-                if (copy) {
-                    if (state->head != Z_NULL &&
-                        state->head->extra != Z_NULL) {
-                        len = state->head->extra_len - state->length;
-                        zmemcpy(state->head->extra + len, next,
-                                len + copy > state->head->extra_max ?
-                                state->head->extra_max - len : copy);
-                    }
-                    if (state->flags & 0x0200)
-                        state->check = crc32(state->check, next, copy);
-                    have -= copy;
-                    next += copy;
-                    state->length -= copy;
-                }
-                if (state->length) goto inf_leave;
-            }
-            state->length = 0;
-            state->mode = NAME;
-        case NAME:
-            if (state->flags & 0x0800) {
-                if (have == 0) goto inf_leave;
-                copy = 0;
-                do {
-                    len = (unsigned)(next[copy++]);
-                    if (state->head != Z_NULL &&
-                            state->head->name != Z_NULL &&
-                            state->length < state->head->name_max)
-                        state->head->name[state->length++] = len;
-                } while (len && copy < have);
-                if (state->flags & 0x0200)
-                    state->check = crc32(state->check, next, copy);
-                have -= copy;
-                next += copy;
-                if (len) goto inf_leave;
-            }
-            else if (state->head != Z_NULL)
-                state->head->name = Z_NULL;
-            state->length = 0;
-            state->mode = COMMENT;
-        case COMMENT:
-            if (state->flags & 0x1000) {
-                if (have == 0) goto inf_leave;
-                copy = 0;
-                do {
-                    len = (unsigned)(next[copy++]);
-                    if (state->head != Z_NULL &&
-                            state->head->comment != Z_NULL &&
-                            state->length < state->head->comm_max)
-                        state->head->comment[state->length++] = len;
-                } while (len && copy < have);
-                if (state->flags & 0x0200)
-                    state->check = crc32(state->check, next, copy);
-                have -= copy;
-                next += copy;
-                if (len) goto inf_leave;
-            }
-            else if (state->head != Z_NULL)
-                state->head->comment = Z_NULL;
-            state->mode = HCRC;
-        case HCRC:
-            if (state->flags & 0x0200) {
-                NEEDBITS(16);
-                if (hold != (state->check & 0xffff)) {
-                    strm->msg = (char *)"header crc mismatch";
-                    state->mode = BAD;
-                    break;
-                }
-                INITBITS();
-            }
-            if (state->head != Z_NULL) {
-                state->head->hcrc = (int)((state->flags >> 9) & 1);
-                state->head->done = 1;
-            }
-            strm->adler = state->check = crc32(0L, Z_NULL, 0);
-            state->mode = TYPE;
-            break;
-#endif
-        case DICTID:
-            NEEDBITS(32);
-            strm->adler = state->check = ZSWAP32(hold);
-            INITBITS();
-            state->mode = DICT;
-        case DICT:
-            if (state->havedict == 0) {
-                RESTORE();
-                return Z_NEED_DICT;
-            }
-            strm->adler = state->check = adler32(0L, Z_NULL, 0);
-            state->mode = TYPE;
-        case TYPE:
-            if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
-        case TYPEDO:
-            if (state->last) {
-                BYTEBITS();
-                state->mode = CHECK;
-                break;
-            }
-            NEEDBITS(3);
-            state->last = BITS(1);
-            DROPBITS(1);
-            switch (BITS(2)) {
-            case 0:                             /* stored block */
-                Tracev((stderr, "inflate:     stored block%s\n",
-                        state->last ? " (last)" : ""));
-                state->mode = STORED;
-                break;
-            case 1:                             /* fixed block */
-                fixedtables(state);
-                Tracev((stderr, "inflate:     fixed codes block%s\n",
-                        state->last ? " (last)" : ""));
-                state->mode = LEN_;             /* decode codes */
-                if (flush == Z_TREES) {
-                    DROPBITS(2);
-                    goto inf_leave;
-                }
-                break;
-            case 2:                             /* dynamic block */
-                Tracev((stderr, "inflate:     dynamic codes block%s\n",
-                        state->last ? " (last)" : ""));
-                state->mode = TABLE;
-                break;
-            case 3:
-                strm->msg = (char *)"invalid block type";
-                state->mode = BAD;
-            }
-            DROPBITS(2);
-            break;
-        case STORED:
-            BYTEBITS();                         /* go to byte boundary */
-            NEEDBITS(32);
-            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
-                strm->msg = (char *)"invalid stored block lengths";
-                state->mode = BAD;
-                break;
-            }
-            state->length = (unsigned)hold & 0xffff;
-            Tracev((stderr, "inflate:       stored length %u\n",
-                    state->length));
-            INITBITS();
-            state->mode = COPY_;
-            if (flush == Z_TREES) goto inf_leave;
-        case COPY_:
-            state->mode = COPY;
-        case COPY:
-            copy = state->length;
-            if (copy) {
-                if (copy > have) copy = have;
-                if (copy > left) copy = left;
-                if (copy == 0) goto inf_leave;
-                zmemcpy(put, next, copy);
-                have -= copy;
-                next += copy;
-                left -= copy;
-                put += copy;
-                state->length -= copy;
-                break;
-            }
-            Tracev((stderr, "inflate:       stored end\n"));
-            state->mode = TYPE;
-            break;
-        case TABLE:
-            NEEDBITS(14);
-            state->nlen = BITS(5) + 257;
-            DROPBITS(5);
-            state->ndist = BITS(5) + 1;
-            DROPBITS(5);
-            state->ncode = BITS(4) + 4;
-            DROPBITS(4);
-#ifndef PKZIP_BUG_WORKAROUND
-            if (state->nlen > 286 || state->ndist > 30) {
-                strm->msg = (char *)"too many length or distance symbols";
-                state->mode = BAD;
-                break;
-            }
-#endif
-            Tracev((stderr, "inflate:       table sizes ok\n"));
-            state->have = 0;
-            state->mode = LENLENS;
-        case LENLENS:
-            while (state->have < state->ncode) {
-                NEEDBITS(3);
-                state->lens[order[state->have++]] = (unsigned short)BITS(3);
-                DROPBITS(3);
-            }
-            while (state->have < 19)
-                state->lens[order[state->have++]] = 0;
-            state->next = state->codes;
-            state->lencode = (const code FAR *)(state->next);
-            state->lenbits = 7;
-            ret = inflate_table(CODES, state->lens, 19, &(state->next),
-                                &(state->lenbits), state->work);
-            if (ret) {
-                strm->msg = (char *)"invalid code lengths set";
-                state->mode = BAD;
-                break;
-            }
-            Tracev((stderr, "inflate:       code lengths ok\n"));
-            state->have = 0;
-            state->mode = CODELENS;
-        case CODELENS:
-            while (state->have < state->nlen + state->ndist) {
-                for (;;) {
-                    here = state->lencode[BITS(state->lenbits)];
-                    if ((unsigned)(here.bits) <= bits) break;
-                    PULLBYTE();
-                }
-                if (here.val < 16) {
-                    DROPBITS(here.bits);
-                    state->lens[state->have++] = here.val;
-                }
-                else {
-                    if (here.val == 16) {
-                        NEEDBITS(here.bits + 2);
-                        DROPBITS(here.bits);
-                        if (state->have == 0) {
-                            strm->msg = (char *)"invalid bit length repeat";
-                            state->mode = BAD;
-                            break;
-                        }
-                        len = state->lens[state->have - 1];
-                        copy = 3 + BITS(2);
-                        DROPBITS(2);
-                    }
-                    else if (here.val == 17) {
-                        NEEDBITS(here.bits + 3);
-                        DROPBITS(here.bits);
-                        len = 0;
-                        copy = 3 + BITS(3);
-                        DROPBITS(3);
-                    }
-                    else {
-                        NEEDBITS(here.bits + 7);
-                        DROPBITS(here.bits);
-                        len = 0;
-                        copy = 11 + BITS(7);
-                        DROPBITS(7);
-                    }
-                    if (state->have + copy > state->nlen + state->ndist) {
-                        strm->msg = (char *)"invalid bit length repeat";
-                        state->mode = BAD;
-                        break;
-                    }
-                    while (copy--)
-                        state->lens[state->have++] = (unsigned short)len;
-                }
-            }
-
-            /* handle error breaks in while */
-            if (state->mode == BAD) break;
-
-            /* check for end-of-block code (better have one) */
-            if (state->lens[256] == 0) {
-                strm->msg = (char *)"invalid code -- missing end-of-block";
-                state->mode = BAD;
-                break;
-            }
-
-            /* build code tables -- note: do not change the lenbits or distbits
-               values here (9 and 6) without reading the comments in inftrees.h
-               concerning the ENOUGH constants, which depend on those values */
-            state->next = state->codes;
-            state->lencode = (const code FAR *)(state->next);
-            state->lenbits = 9;
-            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
-                                &(state->lenbits), state->work);
-            if (ret) {
-                strm->msg = (char *)"invalid literal/lengths set";
-                state->mode = BAD;
-                break;
-            }
-            state->distcode = (const code FAR *)(state->next);
-            state->distbits = 6;
-            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
-                            &(state->next), &(state->distbits), state->work);
-            if (ret) {
-                strm->msg = (char *)"invalid distances set";
-                state->mode = BAD;
-                break;
-            }
-            Tracev((stderr, "inflate:       codes ok\n"));
-            state->mode = LEN_;
-            if (flush == Z_TREES) goto inf_leave;
-        case LEN_:
-            state->mode = LEN;
-        case LEN:
-            if (have >= 6 && left >= 258) {
-                RESTORE();
-                inflate_fast(strm, out);
-                LOAD();
-                if (state->mode == TYPE)
-                    state->back = -1;
-                break;
-            }
-            state->back = 0;
-            for (;;) {
-                here = state->lencode[BITS(state->lenbits)];
-                if ((unsigned)(here.bits) <= bits) break;
-                PULLBYTE();
-            }
-            if (here.op && (here.op & 0xf0) == 0) {
-                last = here;
-                for (;;) {
-                    here = state->lencode[last.val +
-                            (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + here.bits) <= bits) break;
-                    PULLBYTE();
-                }
-                DROPBITS(last.bits);
-                state->back += last.bits;
-            }
-            DROPBITS(here.bits);
-            state->back += here.bits;
-            state->length = (unsigned)here.val;
-            if ((int)(here.op) == 0) {
-                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
-                        "inflate:         literal '%c'\n" :
-                        "inflate:         literal 0x%02x\n", here.val));
-                state->mode = LIT;
-                break;
-            }
-            if (here.op & 32) {
-                Tracevv((stderr, "inflate:         end of block\n"));
-                state->back = -1;
-                state->mode = TYPE;
-                break;
-            }
-            if (here.op & 64) {
-                strm->msg = (char *)"invalid literal/length code";
-                state->mode = BAD;
-                break;
-            }
-            state->extra = (unsigned)(here.op) & 15;
-            state->mode = LENEXT;
-        case LENEXT:
-            if (state->extra) {
-                NEEDBITS(state->extra);
-                state->length += BITS(state->extra);
-                DROPBITS(state->extra);
-                state->back += state->extra;
-            }
-            Tracevv((stderr, "inflate:         length %u\n", state->length));
-            state->was = state->length;
-            state->mode = DIST;
-        case DIST:
-            for (;;) {
-                here = state->distcode[BITS(state->distbits)];
-                if ((unsigned)(here.bits) <= bits) break;
-                PULLBYTE();
-            }
-            if ((here.op & 0xf0) == 0) {
-                last = here;
-                for (;;) {
-                    here = state->distcode[last.val +
-                            (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + here.bits) <= bits) break;
-                    PULLBYTE();
-                }
-                DROPBITS(last.bits);
-                state->back += last.bits;
-            }
-            DROPBITS(here.bits);
-            state->back += here.bits;
-            if (here.op & 64) {
-                strm->msg = (char *)"invalid distance code";
-                state->mode = BAD;
-                break;
-            }
-            state->offset = (unsigned)here.val;
-            state->extra = (unsigned)(here.op) & 15;
-            state->mode = DISTEXT;
-        case DISTEXT:
-            if (state->extra) {
-                NEEDBITS(state->extra);
-                state->offset += BITS(state->extra);
-                DROPBITS(state->extra);
-                state->back += state->extra;
-            }
-#ifdef INFLATE_STRICT
-            if (state->offset > state->dmax) {
-                strm->msg = (char *)"invalid distance too far back";
-                state->mode = BAD;
-                break;
-            }
-#endif
-            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
-            state->mode = MATCH;
-        case MATCH:
-            if (left == 0) goto inf_leave;
-            copy = out - left;
-            if (state->offset > copy) {         /* copy from window */
-                copy = state->offset - copy;
-                if (copy > state->whave) {
-                    if (state->sane) {
-                        strm->msg = (char *)"invalid distance too far back";
-                        state->mode = BAD;
-                        break;
-                    }
-#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
-                    Trace((stderr, "inflate.c too far\n"));
-                    copy -= state->whave;
-                    if (copy > state->length) copy = state->length;
-                    if (copy > left) copy = left;
-                    left -= copy;
-                    state->length -= copy;
-                    do {
-                        *put++ = 0;
-                    } while (--copy);
-                    if (state->length == 0) state->mode = LEN;
-                    break;
-#endif
-                }
-                if (copy > state->wnext) {
-                    copy -= state->wnext;
-                    from = state->window + (state->wsize - copy);
-                }
-                else
-                    from = state->window + (state->wnext - copy);
-                if (copy > state->length) copy = state->length;
-            }
-            else {                              /* copy from output */
-                from = put - state->offset;
-                copy = state->length;
-            }
-            if (copy > left) copy = left;
-            left -= copy;
-            state->length -= copy;
-            do {
-                *put++ = *from++;
-            } while (--copy);
-            if (state->length == 0) state->mode = LEN;
-            break;
-        case LIT:
-            if (left == 0) goto inf_leave;
-            *put++ = (unsigned char)(state->length);
-            left--;
-            state->mode = LEN;
-            break;
-        case CHECK:
-            if (state->wrap) {
-                NEEDBITS(32);
-                out -= left;
-                strm->total_out += out;
-                state->total += out;
-                if (out)
-                    strm->adler = state->check =
-                        UPDATE(state->check, put - out, out);
-                out = left;
-                if ((
-#ifdef GUNZIP
-                     state->flags ? hold :
-#endif
-                     ZSWAP32(hold)) != state->check) {
-                    strm->msg = (char *)"incorrect data check";
-                    state->mode = BAD;
-                    break;
-                }
-                INITBITS();
-                Tracev((stderr, "inflate:   check matches trailer\n"));
-            }
-#ifdef GUNZIP
-            state->mode = LENGTH;
-        case LENGTH:
-            if (state->wrap && state->flags) {
-                NEEDBITS(32);
-                if (hold != (state->total & 0xffffffffUL)) {
-                    strm->msg = (char *)"incorrect length check";
-                    state->mode = BAD;
-                    break;
-                }
-                INITBITS();
-                Tracev((stderr, "inflate:   length matches trailer\n"));
-            }
-#endif
-            state->mode = DONE;
-        case DONE:
-            ret = Z_STREAM_END;
-            goto inf_leave;
-        case BAD:
-            ret = Z_DATA_ERROR;
-            goto inf_leave;
-        case MEM:
-            return Z_MEM_ERROR;
-        case SYNC:
-        default:
-            return Z_STREAM_ERROR;
-        }
-
-    /*
-       Return from inflate(), updating the total counts and the check value.
-       If there was no progress during the inflate() call, return a buffer
-       error.  Call updatewindow() to create and/or update the window state.
-       Note: a memory error from inflate() is non-recoverable.
-     */
-  inf_leave:
-    RESTORE();
-    if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
-            (state->mode < CHECK || flush != Z_FINISH)))
-        if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
-            state->mode = MEM;
-            return Z_MEM_ERROR;
-        }
-    in -= strm->avail_in;
-    out -= strm->avail_out;
-    strm->total_in += in;
-    strm->total_out += out;
-    state->total += out;
-    if (state->wrap && out)
-        strm->adler = state->check =
-            UPDATE(state->check, strm->next_out - out, out);
-    strm->data_type = state->bits + (state->last ? 64 : 0) +
-                      (state->mode == TYPE ? 128 : 0) +
-                      (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
-    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
-        ret = Z_BUF_ERROR;
-    return ret;
-}
-
-int ZEXPORT inflateEnd(strm)
-z_streamp strm;
-{
-    struct inflate_state FAR *state;
-    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
-        return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    if (state->window != Z_NULL) ZFREE(strm, state->window);
-    ZFREE(strm, strm->state);
-    strm->state = Z_NULL;
-    Tracev((stderr, "inflate: end\n"));
-    return Z_OK;
-}
-
-int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
-z_streamp strm;
-Bytef *dictionary;
-uInt *dictLength;
-{
-    struct inflate_state FAR *state;
-
-    /* check state */
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-
-    /* copy dictionary */
-    if (state->whave && dictionary != Z_NULL) {
-        zmemcpy(dictionary, state->window + state->wnext,
-                state->whave - state->wnext);
-        zmemcpy(dictionary + state->whave - state->wnext,
-                state->window, state->wnext);
-    }
-    if (dictLength != Z_NULL)
-        *dictLength = state->whave;
-    return Z_OK;
-}
-
-int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
-z_streamp strm;
-const Bytef *dictionary;
-uInt dictLength;
-{
-    struct inflate_state FAR *state;
-    unsigned long dictid;
-    int ret;
-
-    /* check state */
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    if (state->wrap != 0 && state->mode != DICT)
-        return Z_STREAM_ERROR;
-
-    /* check for correct dictionary identifier */
-    if (state->mode == DICT) {
-        dictid = adler32(0L, Z_NULL, 0);
-        dictid = adler32(dictid, dictionary, dictLength);
-        if (dictid != state->check)
-            return Z_DATA_ERROR;
-    }
-
-    /* copy dictionary to window using updatewindow(), which will amend the
-       existing dictionary if appropriate */
-    ret = updatewindow(strm, dictionary + dictLength, dictLength);
-    if (ret) {
-        state->mode = MEM;
-        return Z_MEM_ERROR;
-    }
-    state->havedict = 1;
-    Tracev((stderr, "inflate:   dictionary set\n"));
-    return Z_OK;
-}
-
-int ZEXPORT inflateGetHeader(strm, head)
-z_streamp strm;
-gz_headerp head;
-{
-    struct inflate_state FAR *state;
-
-    /* check state */
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
-
-    /* save header structure */
-    state->head = head;
-    head->done = 0;
-    return Z_OK;
-}
-
-/*
-   Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff.  Return when found
-   or when out of input.  When called, *have is the number of pattern bytes
-   found in order so far, in 0..3.  On return *have is updated to the new
-   state.  If on return *have equals four, then the pattern was found and the
-   return value is how many bytes were read including the last byte of the
-   pattern.  If *have is less than four, then the pattern has not been found
-   yet and the return value is len.  In the latter case, syncsearch() can be
-   called again with more data and the *have state.  *have is initialized to
-   zero for the first call.
- */
-local unsigned syncsearch(have, buf, len)
-unsigned FAR *have;
-const unsigned char FAR *buf;
-unsigned len;
-{
-    unsigned got;
-    unsigned next;
-
-    got = *have;
-    next = 0;
-    while (next < len && got < 4) {
-        if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
-            got++;
-        else if (buf[next])
-            got = 0;
-        else
-            got = 4 - got;
-        next++;
-    }
-    *have = got;
-    return next;
-}
-
-int ZEXPORT inflateSync(strm)
-z_streamp strm;
-{
-    unsigned len;               /* number of bytes to look at or looked at */
-    unsigned long in, out;      /* temporary to save total_in and total_out */
-    unsigned char buf[4];       /* to restore bit buffer to byte string */
-    struct inflate_state FAR *state;
-
-    /* check parameters */
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
-
-    /* if first time, start search in bit buffer */
-    if (state->mode != SYNC) {
-        state->mode = SYNC;
-        state->hold <<= state->bits & 7;
-        state->bits -= state->bits & 7;
-        len = 0;
-        while (state->bits >= 8) {
-            buf[len++] = (unsigned char)(state->hold);
-            state->hold >>= 8;
-            state->bits -= 8;
-        }
-        state->have = 0;
-        syncsearch(&(state->have), buf, len);
-    }
-
-    /* search available input */
-    len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
-    strm->avail_in -= len;
-    strm->next_in += len;
-    strm->total_in += len;
-
-    /* return no joy or set up to restart inflate() on a new block */
-    if (state->have != 4) return Z_DATA_ERROR;
-    in = strm->total_in;  out = strm->total_out;
-    inflateReset(strm);
-    strm->total_in = in;  strm->total_out = out;
-    state->mode = TYPE;
-    return Z_OK;
-}
-
-/*
-   Returns true if inflate is currently at the end of a block generated by
-   Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
-   implementation to provide an additional safety check. PPP uses
-   Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
-   block. When decompressing, PPP checks that at the end of input packet,
-   inflate is waiting for these length bytes.
- */
-int ZEXPORT inflateSyncPoint(strm)
-z_streamp strm;
-{
-    struct inflate_state FAR *state;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    return state->mode == STORED && state->bits == 0;
-}
-
-int ZEXPORT inflateCopy(dest, source)
-z_streamp dest;
-z_streamp source;
-{
-    struct inflate_state FAR *state;
-    struct inflate_state FAR *copy;
-    unsigned char FAR *window;
-    unsigned wsize;
-
-    /* check input */
-    if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
-        source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
-        return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)source->state;
-
-    /* allocate space */
-    copy = (struct inflate_state FAR *)
-           ZALLOC(source, 1, sizeof(struct inflate_state));
-    if (copy == Z_NULL) return Z_MEM_ERROR;
-    window = Z_NULL;
-    if (state->window != Z_NULL) {
-        window = (unsigned char FAR *)
-                 ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
-        if (window == Z_NULL) {
-            ZFREE(source, copy);
-            return Z_MEM_ERROR;
-        }
-    }
-
-    /* copy state */
-    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
-    zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
-    if (state->lencode >= state->codes &&
-        state->lencode <= state->codes + ENOUGH - 1) {
-        copy->lencode = copy->codes + (state->lencode - state->codes);
-        copy->distcode = copy->codes + (state->distcode - state->codes);
-    }
-    copy->next = copy->codes + (state->next - state->codes);
-    if (window != Z_NULL) {
-        wsize = 1U << state->wbits;
-        zmemcpy(window, state->window, wsize);
-    }
-    copy->window = window;
-    dest->state = (struct internal_state FAR *)copy;
-    return Z_OK;
-}
-
-int ZEXPORT inflateUndermine(strm, subvert)
-z_streamp strm;
-int subvert;
-{
-    struct inflate_state FAR *state;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-    state = (struct inflate_state FAR *)strm->state;
-    state->sane = !subvert;
-#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
-    return Z_OK;
-#else
-    state->sane = 1;
-    return Z_DATA_ERROR;
-#endif
-}
-
-long ZEXPORT inflateMark(strm)
-z_streamp strm;
-{
-    struct inflate_state FAR *state;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
-    state = (struct inflate_state FAR *)strm->state;
-    return ((long)(state->back) << 16) +
-        (state->mode == COPY ? state->length :
-            (state->mode == MATCH ? state->was - state->length : 0));
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.h b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.h
deleted file mode 100644
index 090cb8a..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* inflate.h -- internal inflate state definition
- * Copyright (C) 1995-2009 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-/* define NO_GZIP when compiling if you want to disable gzip header and
-   trailer decoding by inflate().  NO_GZIP would be used to avoid linking in
-   the crc code when it is not needed.  For shared libraries, gzip decoding
-   should be left enabled. */
-#ifndef NO_GZIP
-#  define GUNZIP
-#endif
-
-/* Possible inflate modes between inflate() calls */
-typedef enum {
-    HEAD,       /* i: waiting for magic header */
-    FLAGS,      /* i: waiting for method and flags (gzip) */
-    TIME,       /* i: waiting for modification time (gzip) */
-    OS,         /* i: waiting for extra flags and operating system (gzip) */
-    EXLEN,      /* i: waiting for extra length (gzip) */
-    EXTRA,      /* i: waiting for extra bytes (gzip) */
-    NAME,       /* i: waiting for end of file name (gzip) */
-    COMMENT,    /* i: waiting for end of comment (gzip) */
-    HCRC,       /* i: waiting for header crc (gzip) */
-    DICTID,     /* i: waiting for dictionary check value */
-    DICT,       /* waiting for inflateSetDictionary() call */
-        TYPE,       /* i: waiting for type bits, including last-flag bit */
-        TYPEDO,     /* i: same, but skip check to exit inflate on new block */
-        STORED,     /* i: waiting for stored size (length and complement) */
-        COPY_,      /* i/o: same as COPY below, but only first time in */
-        COPY,       /* i/o: waiting for input or output to copy stored block */
-        TABLE,      /* i: waiting for dynamic block table lengths */
-        LENLENS,    /* i: waiting for code length code lengths */
-        CODELENS,   /* i: waiting for length/lit and distance code lengths */
-            LEN_,       /* i: same as LEN below, but only first time in */
-            LEN,        /* i: waiting for length/lit/eob code */
-            LENEXT,     /* i: waiting for length extra bits */
-            DIST,       /* i: waiting for distance code */
-            DISTEXT,    /* i: waiting for distance extra bits */
-            MATCH,      /* o: waiting for output space to copy string */
-            LIT,        /* o: waiting for output space to write literal */
-    CHECK,      /* i: waiting for 32-bit check value */
-    LENGTH,     /* i: waiting for 32-bit length (gzip) */
-    DONE,       /* finished check, done -- remain here until reset */
-    BAD,        /* got a data error -- remain here until reset */
-    MEM,        /* got an inflate() memory error -- remain here until reset */
-    SYNC        /* looking for synchronization bytes to restart inflate() */
-} inflate_mode;
-
-/*
-    State transitions between above modes -
-
-    (most modes can go to BAD or MEM on error -- not shown for clarity)
-
-    Process header:
-        HEAD -> (gzip) or (zlib) or (raw)
-        (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
-                  HCRC -> TYPE
-        (zlib) -> DICTID or TYPE
-        DICTID -> DICT -> TYPE
-        (raw) -> TYPEDO
-    Read deflate blocks:
-            TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
-            STORED -> COPY_ -> COPY -> TYPE
-            TABLE -> LENLENS -> CODELENS -> LEN_
-            LEN_ -> LEN
-    Read deflate codes in fixed or dynamic block:
-                LEN -> LENEXT or LIT or TYPE
-                LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
-                LIT -> LEN
-    Process trailer:
-        CHECK -> LENGTH -> DONE
- */
-
-/* state maintained between inflate() calls.  Approximately 10K bytes. */
-struct inflate_state {
-    inflate_mode mode;          /* current inflate mode */
-    int last;                   /* true if processing last block */
-    int wrap;                   /* bit 0 true for zlib, bit 1 true for gzip */
-    int havedict;               /* true if dictionary provided */
-    int flags;                  /* gzip header method and flags (0 if zlib) */
-    unsigned dmax;              /* zlib header max distance (INFLATE_STRICT) */
-    unsigned long check;        /* protected copy of check value */
-    unsigned long total;        /* protected copy of output count */
-    gz_headerp head;            /* where to save gzip header information */
-        /* sliding window */
-    unsigned wbits;             /* log base 2 of requested window size */
-    unsigned wsize;             /* window size or zero if not using window */
-    unsigned whave;             /* valid bytes in the window */
-    unsigned wnext;             /* window write index */
-    unsigned char FAR *window;  /* allocated sliding window, if needed */
-        /* bit accumulator */
-    unsigned long hold;         /* input bit accumulator */
-    unsigned bits;              /* number of bits in "in" */
-        /* for string and stored block copying */
-    unsigned length;            /* literal or length of data to copy */
-    unsigned offset;            /* distance back to copy string from */
-        /* for table and code decoding */
-    unsigned extra;             /* extra bits needed */
-        /* fixed and dynamic code tables */
-    code const FAR *lencode;    /* starting table for length/literal codes */
-    code const FAR *distcode;   /* starting table for distance codes */
-    unsigned lenbits;           /* index bits for lencode */
-    unsigned distbits;          /* index bits for distcode */
-        /* dynamic table building */
-    unsigned ncode;             /* number of code length code lengths */
-    unsigned nlen;              /* number of length code lengths */
-    unsigned ndist;             /* number of distance code lengths */
-    unsigned have;              /* number of code lengths in lens[] */
-    code FAR *next;             /* next available space in codes[] */
-    unsigned short lens[320];   /* temporary storage for code lengths */
-    unsigned short work[288];   /* work area for code table building */
-    code codes[ENOUGH];         /* space for code tables */
-    int sane;                   /* if false, allow invalid distance too far */
-    int back;                   /* bits back of last unprocessed length/lit */
-    unsigned was;               /* initial length of match */
-};
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.c
deleted file mode 100644
index c4b0bf2..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2013 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-
-#define MAXBITS 15
-
-const char inflate_copyright[] =
-   " inflate 1.2.8 Copyright 1995-2013 Mark Adler ";
-/*
-  If you use the zlib library in a product, an acknowledgment is welcome
-  in the documentation of your product. If for some reason you cannot
-  include such an acknowledgment, I would appreciate that you keep this
-  copyright string in the executable of your product.
- */
-
-/*
-   Build a set of tables to decode the provided canonical Huffman code.
-   The code lengths are lens[0..codes-1].  The result starts at *table,
-   whose indices are 0..2^bits-1.  work is a writable array of at least
-   lens shorts, which is used as a work area.  type is the type of code
-   to be generated, CODES, LENS, or DISTS.  On return, zero is success,
-   -1 is an invalid code, and +1 means that ENOUGH isn't enough.  table
-   on return points to the next available entry's address.  bits is the
-   requested root table index bits, and on return it is the actual root
-   table index bits.  It will differ if the request is greater than the
-   longest code or if it is less than the shortest code.
- */
-int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
-codetype type;
-unsigned short FAR *lens;
-unsigned codes;
-code FAR * FAR *table;
-unsigned FAR *bits;
-unsigned short FAR *work;
-{
-    unsigned len;               /* a code's length in bits */
-    unsigned sym;               /* index of code symbols */
-    unsigned min, max;          /* minimum and maximum code lengths */
-    unsigned root;              /* number of index bits for root table */
-    unsigned curr;              /* number of index bits for current table */
-    unsigned drop;              /* code bits to drop for sub-table */
-    int left;                   /* number of prefix codes available */
-    unsigned used;              /* code entries in table used */
-    unsigned huff;              /* Huffman code */
-    unsigned incr;              /* for incrementing code, index */
-    unsigned fill;              /* index for replicating entries */
-    unsigned low;               /* low bits for current root entry */
-    unsigned mask;              /* mask for low root bits */
-    code here;                  /* table entry for duplication */
-    code FAR *next;             /* next available space in table */
-    const unsigned short FAR *base;     /* base value table to use */
-    const unsigned short FAR *extra;    /* extra bits table to use */
-    int end;                    /* use base and extra for symbol > end */
-    unsigned short count[MAXBITS+1];    /* number of codes of each length */
-    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
-    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
-        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
-        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
-    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
-        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
-        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78};
-    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
-        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
-        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
-        8193, 12289, 16385, 24577, 0, 0};
-    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
-        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
-        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
-        28, 28, 29, 29, 64, 64};
-
-    /*
-       Process a set of code lengths to create a canonical Huffman code.  The
-       code lengths are lens[0..codes-1].  Each length corresponds to the
-       symbols 0..codes-1.  The Huffman code is generated by first sorting the
-       symbols by length from short to long, and retaining the symbol order
-       for codes with equal lengths.  Then the code starts with all zero bits
-       for the first code of the shortest length, and the codes are integer
-       increments for the same length, and zeros are appended as the length
-       increases.  For the deflate format, these bits are stored backwards
-       from their more natural integer increment ordering, and so when the
-       decoding tables are built in the large loop below, the integer codes
-       are incremented backwards.
-
-       This routine assumes, but does not check, that all of the entries in
-       lens[] are in the range 0..MAXBITS.  The caller must assure this.
-       1..MAXBITS is interpreted as that code length.  zero means that that
-       symbol does not occur in this code.
-
-       The codes are sorted by computing a count of codes for each length,
-       creating from that a table of starting indices for each length in the
-       sorted table, and then entering the symbols in order in the sorted
-       table.  The sorted table is work[], with that space being provided by
-       the caller.
-
-       The length counts are used for other purposes as well, i.e. finding
-       the minimum and maximum length codes, determining if there are any
-       codes at all, checking for a valid set of lengths, and looking ahead
-       at length counts to determine sub-table sizes when building the
-       decoding tables.
-     */
-
-    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
-    for (len = 0; len <= MAXBITS; len++)
-        count[len] = 0;
-    for (sym = 0; sym < codes; sym++)
-        count[lens[sym]]++;
-
-    /* bound code lengths, force root to be within code lengths */
-    root = *bits;
-    for (max = MAXBITS; max >= 1; max--)
-        if (count[max] != 0) break;
-    if (root > max) root = max;
-    if (max == 0) {                     /* no symbols to code at all */
-        here.op = (unsigned char)64;    /* invalid code marker */
-        here.bits = (unsigned char)1;
-        here.val = (unsigned short)0;
-        *(*table)++ = here;             /* make a table to force an error */
-        *(*table)++ = here;
-        *bits = 1;
-        return 0;     /* no symbols, but wait for decoding to report error */
-    }
-    for (min = 1; min < max; min++)
-        if (count[min] != 0) break;
-    if (root < min) root = min;
-
-    /* check for an over-subscribed or incomplete set of lengths */
-    left = 1;
-    for (len = 1; len <= MAXBITS; len++) {
-        left <<= 1;
-        left -= count[len];
-        if (left < 0) return -1;        /* over-subscribed */
-    }
-    if (left > 0 && (type == CODES || max != 1))
-        return -1;                      /* incomplete set */
-
-    /* generate offsets into symbol table for each length for sorting */
-    offs[1] = 0;
-    for (len = 1; len < MAXBITS; len++)
-        offs[len + 1] = offs[len] + count[len];
-
-    /* sort symbols by length, by symbol order within each length */
-    for (sym = 0; sym < codes; sym++)
-        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
-
-    /*
-       Create and fill in decoding tables.  In this loop, the table being
-       filled is at next and has curr index bits.  The code being used is huff
-       with length len.  That code is converted to an index by dropping drop
-       bits off of the bottom.  For codes where len is less than drop + curr,
-       those top drop + curr - len bits are incremented through all values to
-       fill the table with replicated entries.
-
-       root is the number of index bits for the root table.  When len exceeds
-       root, sub-tables are created pointed to by the root entry with an index
-       of the low root bits of huff.  This is saved in low to check for when a
-       new sub-table should be started.  drop is zero when the root table is
-       being filled, and drop is root when sub-tables are being filled.
-
-       When a new sub-table is needed, it is necessary to look ahead in the
-       code lengths to determine what size sub-table is needed.  The length
-       counts are used for this, and so count[] is decremented as codes are
-       entered in the tables.
-
-       used keeps track of how many table entries have been allocated from the
-       provided *table space.  It is checked for LENS and DIST tables against
-       the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
-       the initial root table size constants.  See the comments in inftrees.h
-       for more information.
-
-       sym increments through all symbols, and the loop terminates when
-       all codes of length max, i.e. all codes, have been processed.  This
-       routine permits incomplete codes, so another loop after this one fills
-       in the rest of the decoding tables with invalid code markers.
-     */
-
-    /* set up for code type */
-    switch (type) {
-    case CODES:
-        base = extra = work;    /* dummy value--not used */
-        end = 19;
-        break;
-    case LENS:
-        base = lbase;
-        base -= 257;
-        extra = lext;
-        extra -= 257;
-        end = 256;
-        break;
-    default:            /* DISTS */
-        base = dbase;
-        extra = dext;
-        end = -1;
-    }
-
-    /* initialize state for loop */
-    huff = 0;                   /* starting code */
-    sym = 0;                    /* starting code symbol */
-    len = min;                  /* starting code length */
-    next = *table;              /* current table to fill in */
-    curr = root;                /* current table index bits */
-    drop = 0;                   /* current bits to drop from code for index */
-    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
-    used = 1U << root;          /* use root table entries */
-    mask = used - 1;            /* mask for comparing low */
-
-    /* check available table space */
-    if ((type == LENS && used > ENOUGH_LENS) ||
-        (type == DISTS && used > ENOUGH_DISTS))
-        return 1;
-
-    /* process all codes and make table entries */
-    for (;;) {
-        /* create table entry */
-        here.bits = (unsigned char)(len - drop);
-        if ((int)(work[sym]) < end) {
-            here.op = (unsigned char)0;
-            here.val = work[sym];
-        }
-        else if ((int)(work[sym]) > end) {
-            here.op = (unsigned char)(extra[work[sym]]);
-            here.val = base[work[sym]];
-        }
-        else {
-            here.op = (unsigned char)(32 + 64);         /* end of block */
-            here.val = 0;
-        }
-
-        /* replicate for those indices with low len bits equal to huff */
-        incr = 1U << (len - drop);
-        fill = 1U << curr;
-        min = fill;                 /* save offset to next table */
-        do {
-            fill -= incr;
-            next[(huff >> drop) + fill] = here;
-        } while (fill != 0);
-
-        /* backwards increment the len-bit code huff */
-        incr = 1U << (len - 1);
-        while (huff & incr)
-            incr >>= 1;
-        if (incr != 0) {
-            huff &= incr - 1;
-            huff += incr;
-        }
-        else
-            huff = 0;
-
-        /* go to next symbol, update count, len */
-        sym++;
-        if (--(count[len]) == 0) {
-            if (len == max) break;
-            len = lens[work[sym]];
-        }
-
-        /* create new sub-table if needed */
-        if (len > root && (huff & mask) != low) {
-            /* if first time, transition to sub-tables */
-            if (drop == 0)
-                drop = root;
-
-            /* increment past last table */
-            next += min;            /* here min is 1 << curr */
-
-            /* determine length of next table */
-            curr = len - drop;
-            left = (int)(1 << curr);
-            while (curr + drop < max) {
-                left -= count[curr + drop];
-                if (left <= 0) break;
-                curr++;
-                left <<= 1;
-            }
-
-            /* check for enough space */
-            used += 1U << curr;
-            if ((type == LENS && used > ENOUGH_LENS) ||
-                (type == DISTS && used > ENOUGH_DISTS))
-                return 1;
-
-            /* point entry in root table to sub-table */
-            low = huff & mask;
-            (*table)[low].op = (unsigned char)curr;
-            (*table)[low].bits = (unsigned char)root;
-            (*table)[low].val = (unsigned short)(next - *table);
-        }
-    }
-
-    /* fill in remaining table entry if code is incomplete (guaranteed to have
-       at most one remaining entry, since if the code is incomplete, the
-       maximum code length that was allowed to get this far is one bit) */
-    if (huff != 0) {
-        here.op = (unsigned char)64;            /* invalid code marker */
-        here.bits = (unsigned char)(len - drop);
-        here.val = (unsigned short)0;
-        next[huff] = here;
-    }
-
-    /* set return parameters */
-    *table += used;
-    *bits = root;
-    return 0;
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/patches/ChangeLog_java b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/patches/ChangeLog_java
deleted file mode 100644
index 6f013db..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/patches/ChangeLog_java
+++ /dev/null
@@ -1,10 +0,0 @@
-(1)renamed
-   adler32.c -> zadler32.c
-   zcrc32c -> zcrc32.c
-
-(2)added _LP64 to make uLong a 32-bit int on 64-bit platform
-   zconf.h:
-   uLong -> 32-bit int
-
-(3)updated crc32.c/crc32()
-   unsigned long      -> uLong
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.c
deleted file mode 100644
index e4ecffe..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.c
+++ /dev/null
@@ -1,1250 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2012 Jean-loup Gailly
- * detect_data_type() function provided freely by Cosmin Truta, 2006
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- *  ALGORITHM
- *
- *      The "deflation" process uses several Huffman trees. The more
- *      common source values are represented by shorter bit sequences.
- *
- *      Each code tree is stored in a compressed form which is itself
- * a Huffman encoding of the lengths of all the code strings (in
- * ascending order by source values).  The actual code strings are
- * reconstructed from the lengths in the inflate process, as described
- * in the deflate specification.
- *
- *  REFERENCES
- *
- *      Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
- *      Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
- *
- *      Storer, James A.
- *          Data Compression:  Methods and Theory, pp. 49-50.
- *          Computer Science Press, 1988.  ISBN 0-7167-8156-5.
- *
- *      Sedgewick, R.
- *          Algorithms, p290.
- *          Addison-Wesley, 1983. ISBN 0-201-06672-6.
- */
-
-/* @(#) $Id$ */
-
-/* #define GEN_TREES_H */
-
-#include "deflate.h"
-
-#ifdef DEBUG
-#  include <ctype.h>
-#endif
-
-/* ===========================================================================
- * Constants
- */
-
-#define MAX_BL_BITS 7
-/* Bit length codes must not exceed MAX_BL_BITS bits */
-
-#define END_BLOCK 256
-/* end of block literal code */
-
-#define REP_3_6      16
-/* repeat previous bit length 3-6 times (2 bits of repeat count) */
-
-#define REPZ_3_10    17
-/* repeat a zero length 3-10 times  (3 bits of repeat count) */
-
-#define REPZ_11_138  18
-/* repeat a zero length 11-138 times  (7 bits of repeat count) */
-
-local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
-   = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
-
-local const int extra_dbits[D_CODES] /* extra bits for each distance code */
-   = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
-
-local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
-   = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
-
-local const uch bl_order[BL_CODES]
-   = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
-/* The lengths of the bit length codes are sent in order of decreasing
- * probability, to avoid transmitting the lengths for unused bit length codes.
- */
-
-/* ===========================================================================
- * Local data. These are initialized only once.
- */
-
-#define DIST_CODE_LEN  512 /* see definition of array dist_code below */
-
-#if defined(GEN_TREES_H) || !defined(STDC)
-/* non ANSI compilers may not accept trees.h */
-
-local ct_data static_ltree[L_CODES+2];
-/* The static literal tree. Since the bit lengths are imposed, there is no
- * need for the L_CODES extra codes used during heap construction. However
- * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
- * below).
- */
-
-local ct_data static_dtree[D_CODES];
-/* The static distance tree. (Actually a trivial tree since all codes use
- * 5 bits.)
- */
-
-uch _dist_code[DIST_CODE_LEN];
-/* Distance codes. The first 256 values correspond to the distances
- * 3 .. 258, the last 256 values correspond to the top 8 bits of
- * the 15 bit distances.
- */
-
-uch _length_code[MAX_MATCH-MIN_MATCH+1];
-/* length code for each normalized match length (0 == MIN_MATCH) */
-
-local int base_length[LENGTH_CODES];
-/* First normalized length for each code (0 = MIN_MATCH) */
-
-local int base_dist[D_CODES];
-/* First normalized distance for each code (0 = distance of 1) */
-
-#else
-#  include "trees.h"
-#endif /* GEN_TREES_H */
-
-struct static_tree_desc_s {
-    const ct_data *static_tree;  /* static tree or NULL */
-    const intf *extra_bits;      /* extra bits for each code or NULL */
-    int     extra_base;          /* base index for extra_bits */
-    int     elems;               /* max number of elements in the tree */
-    int     max_length;          /* max bit length for the codes */
-};
-
-local static_tree_desc  static_l_desc =
-{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
-
-local static_tree_desc  static_d_desc =
-{static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS};
-
-local static_tree_desc  static_bl_desc =
-{(const ct_data *)0, extra_blbits, 0,   BL_CODES, MAX_BL_BITS};
-
-/* ===========================================================================
- * Local (static) routines in this file.
- */
-
-local void tr_static_init OF((void));
-local void init_block     OF((deflate_state *s));
-local void pqdownheap     OF((deflate_state *s, ct_data *tree, int k));
-local void gen_bitlen     OF((deflate_state *s, tree_desc *desc));
-local void gen_codes      OF((ct_data *tree, int max_code, ushf *bl_count));
-local void build_tree     OF((deflate_state *s, tree_desc *desc));
-local void scan_tree      OF((deflate_state *s, ct_data *tree, int max_code));
-local void send_tree      OF((deflate_state *s, ct_data *tree, int max_code));
-local int  build_bl_tree  OF((deflate_state *s));
-local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
-                              int blcodes));
-local void compress_block OF((deflate_state *s, const ct_data *ltree,
-                              const ct_data *dtree));
-local int  detect_data_type OF((deflate_state *s));
-local unsigned bi_reverse OF((unsigned value, int length));
-local void bi_windup      OF((deflate_state *s));
-local void bi_flush       OF((deflate_state *s));
-local void copy_block     OF((deflate_state *s, charf *buf, unsigned len,
-                              int header));
-
-#ifdef GEN_TREES_H
-local void gen_trees_header OF((void));
-#endif
-
-#ifndef DEBUG
-#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
-   /* Send a code of the given tree. c and tree must not have side effects */
-
-#else /* DEBUG */
-#  define send_code(s, c, tree) \
-     { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
-       send_bits(s, tree[c].Code, tree[c].Len); }
-#endif
-
-/* ===========================================================================
- * Output a short LSB first on the stream.
- * IN assertion: there is enough room in pendingBuf.
- */
-#define put_short(s, w) { \
-    put_byte(s, (uch)((w) & 0xff)); \
-    put_byte(s, (uch)((ush)(w) >> 8)); \
-}
-
-/* ===========================================================================
- * Send a value on a given number of bits.
- * IN assertion: length <= 16 and value fits in length bits.
- */
-#ifdef DEBUG
-local void send_bits      OF((deflate_state *s, int value, int length));
-
-local void send_bits(s, value, length)
-    deflate_state *s;
-    int value;  /* value to send */
-    int length; /* number of bits */
-{
-    Tracevv((stderr," l %2d v %4x ", length, value));
-    Assert(length > 0 && length <= 15, "invalid length");
-    s->bits_sent += (ulg)length;
-
-    /* If not enough room in bi_buf, use (valid) bits from bi_buf and
-     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
-     * unused bits in value.
-     */
-    if (s->bi_valid > (int)Buf_size - length) {
-        s->bi_buf |= (ush)value << s->bi_valid;
-        put_short(s, s->bi_buf);
-        s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
-        s->bi_valid += length - Buf_size;
-    } else {
-        s->bi_buf |= (ush)value << s->bi_valid;
-        s->bi_valid += length;
-    }
-}
-#else /* !DEBUG */
-
-#define send_bits(s, value, length) \
-{ int len = length;\
-  if (s->bi_valid > (int)Buf_size - len) {\
-    int val = value;\
-    s->bi_buf |= (ush)val << s->bi_valid;\
-    put_short(s, s->bi_buf);\
-    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
-    s->bi_valid += len - Buf_size;\
-  } else {\
-    s->bi_buf |= (ush)(value) << s->bi_valid;\
-    s->bi_valid += len;\
-  }\
-}
-#endif /* DEBUG */
-
-
-/* the arguments must not have side effects */
-
-/* ===========================================================================
- * Initialize the various 'constant' tables.
- */
-local void tr_static_init()
-{
-#if defined(GEN_TREES_H) || !defined(STDC)
-    static int static_init_done = 0;
-    int n;        /* iterates over tree elements */
-    int bits;     /* bit counter */
-    int length;   /* length value */
-    int code;     /* code value */
-    int dist;     /* distance index */
-    ush bl_count[MAX_BITS+1];
-    /* number of codes at each bit length for an optimal tree */
-
-    if (static_init_done) return;
-
-    /* For some embedded targets, global variables are not initialized: */
-#ifdef NO_INIT_GLOBAL_POINTERS
-    static_l_desc.static_tree = static_ltree;
-    static_l_desc.extra_bits = extra_lbits;
-    static_d_desc.static_tree = static_dtree;
-    static_d_desc.extra_bits = extra_dbits;
-    static_bl_desc.extra_bits = extra_blbits;
-#endif
-
-    /* Initialize the mapping length (0..255) -> length code (0..28) */
-    length = 0;
-    for (code = 0; code < LENGTH_CODES-1; code++) {
-        base_length[code] = length;
-        for (n = 0; n < (1<<extra_lbits[code]); n++) {
-            _length_code[length++] = (uch)code;
-        }
-    }
-    Assert (length == 256, "tr_static_init: length != 256");
-    /* Note that the length 255 (match length 258) can be represented
-     * in two different ways: code 284 + 5 bits or code 285, so we
-     * overwrite length_code[255] to use the best encoding:
-     */
-    _length_code[length-1] = (uch)code;
-
-    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
-    dist = 0;
-    for (code = 0 ; code < 16; code++) {
-        base_dist[code] = dist;
-        for (n = 0; n < (1<<extra_dbits[code]); n++) {
-            _dist_code[dist++] = (uch)code;
-        }
-    }
-    Assert (dist == 256, "tr_static_init: dist != 256");
-    dist >>= 7; /* from now on, all distances are divided by 128 */
-    for ( ; code < D_CODES; code++) {
-        base_dist[code] = dist << 7;
-        for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
-            _dist_code[256 + dist++] = (uch)code;
-        }
-    }
-    Assert (dist == 256, "tr_static_init: 256+dist != 512");
-
-    /* Construct the codes of the static literal tree */
-    for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
-    n = 0;
-    while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
-    while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
-    while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
-    while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
-    /* Codes 286 and 287 do not exist, but we must include them in the
-     * tree construction to get a canonical Huffman tree (longest code
-     * all ones)
-     */
-    gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
-
-    /* The static distance tree is trivial: */
-    for (n = 0; n < D_CODES; n++) {
-        static_dtree[n].Len = 5;
-        static_dtree[n].Code = bi_reverse((unsigned)n, 5);
-    }
-    static_init_done = 1;
-
-#  ifdef GEN_TREES_H
-    gen_trees_header();
-#  endif
-#endif /* defined(GEN_TREES_H) || !defined(STDC) */
-}
-
-/* ===========================================================================
- * Genererate the file trees.h describing the static trees.
- */
-#ifdef GEN_TREES_H
-#  ifndef DEBUG
-#    include <stdio.h>
-#  endif
-
-#  define SEPARATOR(i, last, width) \
-      ((i) == (last)? "\n};\n\n" :    \
-       ((i) % (width) == (width)-1 ? ",\n" : ", "))
-
-void gen_trees_header()
-{
-    FILE *header = fopen("trees.h", "w");
-    int i;
-
-    Assert (header != NULL, "Can't open trees.h");
-    fprintf(header,
-            "/* header created automatically with -DGEN_TREES_H */\n\n");
-
-    fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
-    for (i = 0; i < L_CODES+2; i++) {
-        fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
-                static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
-    }
-
-    fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
-    for (i = 0; i < D_CODES; i++) {
-        fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
-                static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
-    }
-
-    fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n");
-    for (i = 0; i < DIST_CODE_LEN; i++) {
-        fprintf(header, "%2u%s", _dist_code[i],
-                SEPARATOR(i, DIST_CODE_LEN-1, 20));
-    }
-
-    fprintf(header,
-        "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
-    for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
-        fprintf(header, "%2u%s", _length_code[i],
-                SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
-    }
-
-    fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
-    for (i = 0; i < LENGTH_CODES; i++) {
-        fprintf(header, "%1u%s", base_length[i],
-                SEPARATOR(i, LENGTH_CODES-1, 20));
-    }
-
-    fprintf(header, "local const int base_dist[D_CODES] = {\n");
-    for (i = 0; i < D_CODES; i++) {
-        fprintf(header, "%5u%s", base_dist[i],
-                SEPARATOR(i, D_CODES-1, 10));
-    }
-
-    fclose(header);
-}
-#endif /* GEN_TREES_H */
-
-/* ===========================================================================
- * Initialize the tree data structures for a new zlib stream.
- */
-void ZLIB_INTERNAL _tr_init(s)
-    deflate_state *s;
-{
-    tr_static_init();
-
-    s->l_desc.dyn_tree = s->dyn_ltree;
-    s->l_desc.stat_desc = &static_l_desc;
-
-    s->d_desc.dyn_tree = s->dyn_dtree;
-    s->d_desc.stat_desc = &static_d_desc;
-
-    s->bl_desc.dyn_tree = s->bl_tree;
-    s->bl_desc.stat_desc = &static_bl_desc;
-
-    s->bi_buf = 0;
-    s->bi_valid = 0;
-#ifdef DEBUG
-    s->compressed_len = 0L;
-    s->bits_sent = 0L;
-#endif
-
-    /* Initialize the first block of the first file: */
-    init_block(s);
-}
-
-/* ===========================================================================
- * Initialize a new block.
- */
-local void init_block(s)
-    deflate_state *s;
-{
-    int n; /* iterates over tree elements */
-
-    /* Initialize the trees. */
-    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
-    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
-    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
-
-    s->dyn_ltree[END_BLOCK].Freq = 1;
-    s->opt_len = s->static_len = 0L;
-    s->last_lit = s->matches = 0;
-}
-
-#define SMALLEST 1
-/* Index within the heap array of least frequent node in the Huffman tree */
-
-
-/* ===========================================================================
- * Remove the smallest element from the heap and recreate the heap with
- * one less element. Updates heap and heap_len.
- */
-#define pqremove(s, tree, top) \
-{\
-    top = s->heap[SMALLEST]; \
-    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
-    pqdownheap(s, tree, SMALLEST); \
-}
-
-/* ===========================================================================
- * Compares to subtrees, using the tree depth as tie breaker when
- * the subtrees have equal frequency. This minimizes the worst case length.
- */
-#define smaller(tree, n, m, depth) \
-   (tree[n].Freq < tree[m].Freq || \
-   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
-
-/* ===========================================================================
- * Restore the heap property by moving down the tree starting at node k,
- * exchanging a node with the smallest of its two sons if necessary, stopping
- * when the heap property is re-established (each father smaller than its
- * two sons).
- */
-local void pqdownheap(s, tree, k)
-    deflate_state *s;
-    ct_data *tree;  /* the tree to restore */
-    int k;               /* node to move down */
-{
-    int v = s->heap[k];
-    int j = k << 1;  /* left son of k */
-    while (j <= s->heap_len) {
-        /* Set j to the smallest of the two sons: */
-        if (j < s->heap_len &&
-            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
-            j++;
-        }
-        /* Exit if v is smaller than both sons */
-        if (smaller(tree, v, s->heap[j], s->depth)) break;
-
-        /* Exchange v with the smallest son */
-        s->heap[k] = s->heap[j];  k = j;
-
-        /* And continue down the tree, setting j to the left son of k */
-        j <<= 1;
-    }
-    s->heap[k] = v;
-}
-
-/* ===========================================================================
- * Compute the optimal bit lengths for a tree and update the total bit length
- * for the current block.
- * IN assertion: the fields freq and dad are set, heap[heap_max] and
- *    above are the tree nodes sorted by increasing frequency.
- * OUT assertions: the field len is set to the optimal bit length, the
- *     array bl_count contains the frequencies for each bit length.
- *     The length opt_len is updated; static_len is also updated if stree is
- *     not null.
- */
-local void gen_bitlen(s, desc)
-    deflate_state *s;
-    tree_desc *desc;    /* the tree descriptor */
-{
-    ct_data *tree        = desc->dyn_tree;
-    int max_code         = desc->max_code;
-    const ct_data *stree = desc->stat_desc->static_tree;
-    const intf *extra    = desc->stat_desc->extra_bits;
-    int base             = desc->stat_desc->extra_base;
-    int max_length       = desc->stat_desc->max_length;
-    int h;              /* heap index */
-    int n, m;           /* iterate over the tree elements */
-    int bits;           /* bit length */
-    int xbits;          /* extra bits */
-    ush f;              /* frequency */
-    int overflow = 0;   /* number of elements with bit length too large */
-
-    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
-
-    /* In a first pass, compute the optimal bit lengths (which may
-     * overflow in the case of the bit length tree).
-     */
-    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
-
-    for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
-        n = s->heap[h];
-        bits = tree[tree[n].Dad].Len + 1;
-        if (bits > max_length) bits = max_length, overflow++;
-        tree[n].Len = (ush)bits;
-        /* We overwrite tree[n].Dad which is no longer needed */
-
-        if (n > max_code) continue; /* not a leaf node */
-
-        s->bl_count[bits]++;
-        xbits = 0;
-        if (n >= base) xbits = extra[n-base];
-        f = tree[n].Freq;
-        s->opt_len += (ulg)f * (bits + xbits);
-        if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
-    }
-    if (overflow == 0) return;
-
-    Trace((stderr,"\nbit length overflow\n"));
-    /* This happens for example on obj2 and pic of the Calgary corpus */
-
-    /* Find the first bit length which could increase: */
-    do {
-        bits = max_length-1;
-        while (s->bl_count[bits] == 0) bits--;
-        s->bl_count[bits]--;      /* move one leaf down the tree */
-        s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
-        s->bl_count[max_length]--;
-        /* The brother of the overflow item also moves one step up,
-         * but this does not affect bl_count[max_length]
-         */
-        overflow -= 2;
-    } while (overflow > 0);
-
-    /* Now recompute all bit lengths, scanning in increasing frequency.
-     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
-     * lengths instead of fixing only the wrong ones. This idea is taken
-     * from 'ar' written by Haruhiko Okumura.)
-     */
-    for (bits = max_length; bits != 0; bits--) {
-        n = s->bl_count[bits];
-        while (n != 0) {
-            m = s->heap[--h];
-            if (m > max_code) continue;
-            if ((unsigned) tree[m].Len != (unsigned) bits) {
-                Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
-                s->opt_len += ((long)bits - (long)tree[m].Len)
-                              *(long)tree[m].Freq;
-                tree[m].Len = (ush)bits;
-            }
-            n--;
-        }
-    }
-}
-
-/* ===========================================================================
- * Generate the codes for a given tree and bit counts (which need not be
- * optimal).
- * IN assertion: the array bl_count contains the bit length statistics for
- * the given tree and the field len is set for all tree elements.
- * OUT assertion: the field code is set for all tree elements of non
- *     zero code length.
- */
-local void gen_codes (tree, max_code, bl_count)
-    ct_data *tree;             /* the tree to decorate */
-    int max_code;              /* largest code with non zero frequency */
-    ushf *bl_count;            /* number of codes at each bit length */
-{
-    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
-    ush code = 0;              /* running code value */
-    int bits;                  /* bit index */
-    int n;                     /* code index */
-
-    /* The distribution counts are first used to generate the code values
-     * without bit reversal.
-     */
-    for (bits = 1; bits <= MAX_BITS; bits++) {
-        next_code[bits] = code = (code + bl_count[bits-1]) << 1;
-    }
-    /* Check that the bit counts in bl_count are consistent. The last code
-     * must be all ones.
-     */
-    Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
-            "inconsistent bit counts");
-    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
-
-    for (n = 0;  n <= max_code; n++) {
-        int len = tree[n].Len;
-        if (len == 0) continue;
-        /* Now reverse the bits */
-        tree[n].Code = bi_reverse(next_code[len]++, len);
-
-        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
-             n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
-    }
-}
-
-/* ===========================================================================
- * Construct one Huffman tree and assigns the code bit strings and lengths.
- * Update the total bit length for the current block.
- * IN assertion: the field freq is set for all tree elements.
- * OUT assertions: the fields len and code are set to the optimal bit length
- *     and corresponding code. The length opt_len is updated; static_len is
- *     also updated if stree is not null. The field max_code is set.
- */
-local void build_tree(s, desc)
-    deflate_state *s;
-    tree_desc *desc; /* the tree descriptor */
-{
-    ct_data *tree         = desc->dyn_tree;
-    const ct_data *stree  = desc->stat_desc->static_tree;
-    int elems             = desc->stat_desc->elems;
-    int n, m;          /* iterate over heap elements */
-    int max_code = -1; /* largest code with non zero frequency */
-    int node;          /* new node being created */
-
-    /* Construct the initial heap, with least frequent element in
-     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
-     * heap[0] is not used.
-     */
-    s->heap_len = 0, s->heap_max = HEAP_SIZE;
-
-    for (n = 0; n < elems; n++) {
-        if (tree[n].Freq != 0) {
-            s->heap[++(s->heap_len)] = max_code = n;
-            s->depth[n] = 0;
-        } else {
-            tree[n].Len = 0;
-        }
-    }
-
-    /* The pkzip format requires that at least one distance code exists,
-     * and that at least one bit should be sent even if there is only one
-     * possible code. So to avoid special checks later on we force at least
-     * two codes of non zero frequency.
-     */
-    while (s->heap_len < 2) {
-        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
-        tree[node].Freq = 1;
-        s->depth[node] = 0;
-        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
-        /* node is 0 or 1 so it does not have extra bits */
-    }
-    desc->max_code = max_code;
-
-    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
-     * establish sub-heaps of increasing lengths:
-     */
-    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
-
-    /* Construct the Huffman tree by repeatedly combining the least two
-     * frequent nodes.
-     */
-    node = elems;              /* next internal node of the tree */
-    do {
-        pqremove(s, tree, n);  /* n = node of least frequency */
-        m = s->heap[SMALLEST]; /* m = node of next least frequency */
-
-        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
-        s->heap[--(s->heap_max)] = m;
-
-        /* Create a new node father of n and m */
-        tree[node].Freq = tree[n].Freq + tree[m].Freq;
-        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
-                                s->depth[n] : s->depth[m]) + 1);
-        tree[n].Dad = tree[m].Dad = (ush)node;
-#ifdef DUMP_BL_TREE
-        if (tree == s->bl_tree) {
-            fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
-                    node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
-        }
-#endif
-        /* and insert the new node in the heap */
-        s->heap[SMALLEST] = node++;
-        pqdownheap(s, tree, SMALLEST);
-
-    } while (s->heap_len >= 2);
-
-    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
-
-    /* At this point, the fields freq and dad are set. We can now
-     * generate the bit lengths.
-     */
-    gen_bitlen(s, (tree_desc *)desc);
-
-    /* The field len is now set, we can generate the bit codes */
-    gen_codes ((ct_data *)tree, max_code, s->bl_count);
-}
-
-/* ===========================================================================
- * Scan a literal or distance tree to determine the frequencies of the codes
- * in the bit length tree.
- */
-local void scan_tree (s, tree, max_code)
-    deflate_state *s;
-    ct_data *tree;   /* the tree to be scanned */
-    int max_code;    /* and its largest code of non zero frequency */
-{
-    int n;                     /* iterates over all tree elements */
-    int prevlen = -1;          /* last emitted length */
-    int curlen;                /* length of current code */
-    int nextlen = tree[0].Len; /* length of next code */
-    int count = 0;             /* repeat count of the current code */
-    int max_count = 7;         /* max repeat count */
-    int min_count = 4;         /* min repeat count */
-
-    if (nextlen == 0) max_count = 138, min_count = 3;
-    tree[max_code+1].Len = (ush)0xffff; /* guard */
-
-    for (n = 0; n <= max_code; n++) {
-        curlen = nextlen; nextlen = tree[n+1].Len;
-        if (++count < max_count && curlen == nextlen) {
-            continue;
-        } else if (count < min_count) {
-            s->bl_tree[curlen].Freq += count;
-        } else if (curlen != 0) {
-            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
-            s->bl_tree[REP_3_6].Freq++;
-        } else if (count <= 10) {
-            s->bl_tree[REPZ_3_10].Freq++;
-        } else {
-            s->bl_tree[REPZ_11_138].Freq++;
-        }
-        count = 0; prevlen = curlen;
-        if (nextlen == 0) {
-            max_count = 138, min_count = 3;
-        } else if (curlen == nextlen) {
-            max_count = 6, min_count = 3;
-        } else {
-            max_count = 7, min_count = 4;
-        }
-    }
-}
-
-/* ===========================================================================
- * Send a literal or distance tree in compressed form, using the codes in
- * bl_tree.
- */
-local void send_tree (s, tree, max_code)
-    deflate_state *s;
-    ct_data *tree; /* the tree to be scanned */
-    int max_code;       /* and its largest code of non zero frequency */
-{
-    int n;                     /* iterates over all tree elements */
-    int prevlen = -1;          /* last emitted length */
-    int curlen;                /* length of current code */
-    int nextlen = tree[0].Len; /* length of next code */
-    int count = 0;             /* repeat count of the current code */
-    int max_count = 7;         /* max repeat count */
-    int min_count = 4;         /* min repeat count */
-
-    /* tree[max_code+1].Len = -1; */  /* guard already set */
-    if (nextlen == 0) max_count = 138, min_count = 3;
-
-    for (n = 0; n <= max_code; n++) {
-        curlen = nextlen; nextlen = tree[n+1].Len;
-        if (++count < max_count && curlen == nextlen) {
-            continue;
-        } else if (count < min_count) {
-            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
-
-        } else if (curlen != 0) {
-            if (curlen != prevlen) {
-                send_code(s, curlen, s->bl_tree); count--;
-            }
-            Assert(count >= 3 && count <= 6, " 3_6?");
-            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
-
-        } else if (count <= 10) {
-            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
-
-        } else {
-            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
-        }
-        count = 0; prevlen = curlen;
-        if (nextlen == 0) {
-            max_count = 138, min_count = 3;
-        } else if (curlen == nextlen) {
-            max_count = 6, min_count = 3;
-        } else {
-            max_count = 7, min_count = 4;
-        }
-    }
-}
-
-/* ===========================================================================
- * Construct the Huffman tree for the bit lengths and return the index in
- * bl_order of the last bit length code to send.
- */
-local int build_bl_tree(s)
-    deflate_state *s;
-{
-    int max_blindex;  /* index of last bit length code of non zero freq */
-
-    /* Determine the bit length frequencies for literal and distance trees */
-    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
-    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
-
-    /* Build the bit length tree: */
-    build_tree(s, (tree_desc *)(&(s->bl_desc)));
-    /* opt_len now includes the length of the tree representations, except
-     * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
-     */
-
-    /* Determine the number of bit length codes to send. The pkzip format
-     * requires that at least 4 bit length codes be sent. (appnote.txt says
-     * 3 but the actual value used is 4.)
-     */
-    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
-        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
-    }
-    /* Update opt_len to include the bit length tree and counts */
-    s->opt_len += 3*(max_blindex+1) + 5+5+4;
-    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
-            s->opt_len, s->static_len));
-
-    return max_blindex;
-}
-
-/* ===========================================================================
- * Send the header for a block using dynamic Huffman trees: the counts, the
- * lengths of the bit length codes, the literal tree and the distance tree.
- * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
- */
-local void send_all_trees(s, lcodes, dcodes, blcodes)
-    deflate_state *s;
-    int lcodes, dcodes, blcodes; /* number of codes for each tree */
-{
-    int rank;                    /* index in bl_order */
-
-    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
-    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
-            "too many codes");
-    Tracev((stderr, "\nbl counts: "));
-    send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
-    send_bits(s, dcodes-1,   5);
-    send_bits(s, blcodes-4,  4); /* not -3 as stated in appnote.txt */
-    for (rank = 0; rank < blcodes; rank++) {
-        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
-        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
-    }
-    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
-
-    send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
-    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
-
-    send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
-    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
-}
-
-/* ===========================================================================
- * Send a stored block
- */
-void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
-    deflate_state *s;
-    charf *buf;       /* input block */
-    ulg stored_len;   /* length of input block */
-    int last;         /* one if this is the last block for a file */
-{
-    send_bits(s, (STORED_BLOCK<<1)+last, 3);    /* send block type */
-#ifdef DEBUG
-    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
-    s->compressed_len += (stored_len + 4) << 3;
-#endif
-    copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
-}
-
-/* ===========================================================================
- * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)
- */
-void ZLIB_INTERNAL _tr_flush_bits(s)
-    deflate_state *s;
-{
-    bi_flush(s);
-}
-
-/* ===========================================================================
- * Send one empty static block to give enough lookahead for inflate.
- * This takes 10 bits, of which 7 may remain in the bit buffer.
- */
-void ZLIB_INTERNAL _tr_align(s)
-    deflate_state *s;
-{
-    send_bits(s, STATIC_TREES<<1, 3);
-    send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
-    s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
-#endif
-    bi_flush(s);
-}
-
-/* ===========================================================================
- * Determine the best encoding for the current block: dynamic trees, static
- * trees or store, and output the encoded block to the zip file.
- */
-void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
-    deflate_state *s;
-    charf *buf;       /* input block, or NULL if too old */
-    ulg stored_len;   /* length of input block */
-    int last;         /* one if this is the last block for a file */
-{
-    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
-    int max_blindex = 0;  /* index of last bit length code of non zero freq */
-
-    /* Build the Huffman trees unless a stored block is forced */
-    if (s->level > 0) {
-
-        /* Check if the file is binary or text */
-        if (s->strm->data_type == Z_UNKNOWN)
-            s->strm->data_type = detect_data_type(s);
-
-        /* Construct the literal and distance trees */
-        build_tree(s, (tree_desc *)(&(s->l_desc)));
-        Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
-                s->static_len));
-
-        build_tree(s, (tree_desc *)(&(s->d_desc)));
-        Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
-                s->static_len));
-        /* At this point, opt_len and static_len are the total bit lengths of
-         * the compressed block data, excluding the tree representations.
-         */
-
-        /* Build the bit length tree for the above two trees, and get the index
-         * in bl_order of the last bit length code to send.
-         */
-        max_blindex = build_bl_tree(s);
-
-        /* Determine the best encoding. Compute the block lengths in bytes. */
-        opt_lenb = (s->opt_len+3+7)>>3;
-        static_lenb = (s->static_len+3+7)>>3;
-
-        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
-                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
-                s->last_lit));
-
-        if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
-
-    } else {
-        Assert(buf != (char*)0, "lost buf");
-        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
-    }
-
-#ifdef FORCE_STORED
-    if (buf != (char*)0) { /* force stored block */
-#else
-    if (stored_len+4 <= opt_lenb && buf != (char*)0) {
-                       /* 4: two words for the lengths */
-#endif
-        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
-         * Otherwise we can't have processed more than WSIZE input bytes since
-         * the last block flush, because compression would have been
-         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
-         * transform a block into a stored block.
-         */
-        _tr_stored_block(s, buf, stored_len, last);
-
-#ifdef FORCE_STATIC
-    } else if (static_lenb >= 0) { /* force static trees */
-#else
-    } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
-#endif
-        send_bits(s, (STATIC_TREES<<1)+last, 3);
-        compress_block(s, (const ct_data *)static_ltree,
-                       (const ct_data *)static_dtree);
-#ifdef DEBUG
-        s->compressed_len += 3 + s->static_len;
-#endif
-    } else {
-        send_bits(s, (DYN_TREES<<1)+last, 3);
-        send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
-                       max_blindex+1);
-        compress_block(s, (const ct_data *)s->dyn_ltree,
-                       (const ct_data *)s->dyn_dtree);
-#ifdef DEBUG
-        s->compressed_len += 3 + s->opt_len;
-#endif
-    }
-    Assert (s->compressed_len == s->bits_sent, "bad compressed size");
-    /* The above check is made mod 2^32, for files larger than 512 MB
-     * and uLong implemented on 32 bits.
-     */
-    init_block(s);
-
-    if (last) {
-        bi_windup(s);
-#ifdef DEBUG
-        s->compressed_len += 7;  /* align on byte boundary */
-#endif
-    }
-    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
-           s->compressed_len-7*last));
-}
-
-/* ===========================================================================
- * Save the match info and tally the frequency counts. Return true if
- * the current block must be flushed.
- */
-int ZLIB_INTERNAL _tr_tally (s, dist, lc)
-    deflate_state *s;
-    unsigned dist;  /* distance of matched string */
-    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
-{
-    s->d_buf[s->last_lit] = (ush)dist;
-    s->l_buf[s->last_lit++] = (uch)lc;
-    if (dist == 0) {
-        /* lc is the unmatched char */
-        s->dyn_ltree[lc].Freq++;
-    } else {
-        s->matches++;
-        /* Here, lc is the match length - MIN_MATCH */
-        dist--;             /* dist = match distance - 1 */
-        Assert((ush)dist < (ush)MAX_DIST(s) &&
-               (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
-               (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");
-
-        s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
-        s->dyn_dtree[d_code(dist)].Freq++;
-    }
-
-#ifdef TRUNCATE_BLOCK
-    /* Try to guess if it is profitable to stop the current block here */
-    if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
-        /* Compute an upper bound for the compressed length */
-        ulg out_length = (ulg)s->last_lit*8L;
-        ulg in_length = (ulg)((long)s->strstart - s->block_start);
-        int dcode;
-        for (dcode = 0; dcode < D_CODES; dcode++) {
-            out_length += (ulg)s->dyn_dtree[dcode].Freq *
-                (5L+extra_dbits[dcode]);
-        }
-        out_length >>= 3;
-        Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
-               s->last_lit, in_length, out_length,
-               100L - out_length*100L/in_length));
-        if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
-    }
-#endif
-    return (s->last_lit == s->lit_bufsize-1);
-    /* We avoid equality with lit_bufsize because of wraparound at 64K
-     * on 16 bit machines and because stored blocks are restricted to
-     * 64K-1 bytes.
-     */
-}
-
-/* ===========================================================================
- * Send the block data compressed using the given Huffman trees
- */
-local void compress_block(s, ltree, dtree)
-    deflate_state *s;
-    const ct_data *ltree; /* literal tree */
-    const ct_data *dtree; /* distance tree */
-{
-    unsigned dist;      /* distance of matched string */
-    int lc;             /* match length or unmatched char (if dist == 0) */
-    unsigned lx = 0;    /* running index in l_buf */
-    unsigned code;      /* the code to send */
-    int extra;          /* number of extra bits to send */
-
-    if (s->last_lit != 0) do {
-        dist = s->d_buf[lx];
-        lc = s->l_buf[lx++];
-        if (dist == 0) {
-            send_code(s, lc, ltree); /* send a literal byte */
-            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
-        } else {
-            /* Here, lc is the match length - MIN_MATCH */
-            code = _length_code[lc];
-            send_code(s, code+LITERALS+1, ltree); /* send the length code */
-            extra = extra_lbits[code];
-            if (extra != 0) {
-                lc -= base_length[code];
-                send_bits(s, lc, extra);       /* send the extra length bits */
-            }
-            dist--; /* dist is now the match distance - 1 */
-            code = d_code(dist);
-            Assert (code < D_CODES, "bad d_code");
-
-            send_code(s, code, dtree);       /* send the distance code */
-            extra = extra_dbits[code];
-            if (extra != 0) {
-                dist -= base_dist[code];
-                send_bits(s, dist, extra);   /* send the extra distance bits */
-            }
-        } /* literal or match pair ? */
-
-        /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
-        Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
-               "pendingBuf overflow");
-
-    } while (lx < s->last_lit);
-
-    send_code(s, END_BLOCK, ltree);
-}
-
-/* ===========================================================================
- * Check if the data type is TEXT or BINARY, using the following algorithm:
- * - TEXT if the two conditions below are satisfied:
- *    a) There are no non-portable control characters belonging to the
- *       "black list" (0..6, 14..25, 28..31).
- *    b) There is at least one printable character belonging to the
- *       "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
- * - BINARY otherwise.
- * - The following partially-portable control characters form a
- *   "gray list" that is ignored in this detection algorithm:
- *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
- * IN assertion: the fields Freq of dyn_ltree are set.
- */
-local int detect_data_type(s)
-    deflate_state *s;
-{
-    /* black_mask is the bit mask of black-listed bytes
-     * set bits 0..6, 14..25, and 28..31
-     * 0xf3ffc07f = binary 11110011111111111100000001111111
-     */
-    unsigned long black_mask = 0xf3ffc07fUL;
-    int n;
-
-    /* Check for non-textual ("black-listed") bytes. */
-    for (n = 0; n <= 31; n++, black_mask >>= 1)
-        if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))
-            return Z_BINARY;
-
-    /* Check for textual ("white-listed") bytes. */
-    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
-            || s->dyn_ltree[13].Freq != 0)
-        return Z_TEXT;
-    for (n = 32; n < LITERALS; n++)
-        if (s->dyn_ltree[n].Freq != 0)
-            return Z_TEXT;
-
-    /* There are no "black-listed" or "white-listed" bytes:
-     * this stream either is empty or has tolerated ("gray-listed") bytes only.
-     */
-    return Z_BINARY;
-}
-
-/* ===========================================================================
- * Reverse the first len bits of a code, using straightforward code (a faster
- * method would use a table)
- * IN assertion: 1 <= len <= 15
- */
-local unsigned bi_reverse(code, len)
-    unsigned code; /* the value to invert */
-    int len;       /* its bit length */
-{
-    register unsigned res = 0;
-    do {
-        res |= code & 1;
-        code >>= 1, res <<= 1;
-    } while (--len > 0);
-    return res >> 1;
-}
-
-/* ===========================================================================
- * Flush the bit buffer, keeping at most 7 bits in it.
- */
-local void bi_flush(s)
-    deflate_state *s;
-{
-    if (s->bi_valid == 16) {
-        put_short(s, s->bi_buf);
-        s->bi_buf = 0;
-        s->bi_valid = 0;
-    } else if (s->bi_valid >= 8) {
-        put_byte(s, (Byte)s->bi_buf);
-        s->bi_buf >>= 8;
-        s->bi_valid -= 8;
-    }
-}
-
-/* ===========================================================================
- * Flush the bit buffer and align the output on a byte boundary
- */
-local void bi_windup(s)
-    deflate_state *s;
-{
-    if (s->bi_valid > 8) {
-        put_short(s, s->bi_buf);
-    } else if (s->bi_valid > 0) {
-        put_byte(s, (Byte)s->bi_buf);
-    }
-    s->bi_buf = 0;
-    s->bi_valid = 0;
-#ifdef DEBUG
-    s->bits_sent = (s->bits_sent+7) & ~7;
-#endif
-}
-
-/* ===========================================================================
- * Copy a stored block, storing first the length and its
- * one's complement if requested.
- */
-local void copy_block(s, buf, len, header)
-    deflate_state *s;
-    charf    *buf;    /* the input data */
-    unsigned len;     /* its length */
-    int      header;  /* true if block header must be written */
-{
-    bi_windup(s);        /* align on byte boundary */
-
-    if (header) {
-        put_short(s, (ush)len);
-        put_short(s, (ush)~len);
-#ifdef DEBUG
-        s->bits_sent += 2*16;
-#endif
-    }
-#ifdef DEBUG
-    s->bits_sent += (ulg)len<<3;
-#endif
-    while (len--) {
-        put_byte(s, *buf++);
-    }
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/uncompr.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/uncompr.c
deleted file mode 100644
index 1bcf06f..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/uncompr.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* uncompr.c -- decompress a memory buffer
- * Copyright (C) 1995-2003, 2010 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#define ZLIB_INTERNAL
-#include "zlib.h"
-
-/* ===========================================================================
-     Decompresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer. Upon entry, destLen is the total
-   size of the destination buffer, which must be large enough to hold the
-   entire uncompressed data. (The size of the uncompressed data must have
-   been saved previously by the compressor and transmitted to the decompressor
-   by some mechanism outside the scope of this compression library.)
-   Upon exit, destLen is the actual size of the compressed buffer.
-
-     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer, or Z_DATA_ERROR if the input data was corrupted.
-*/
-int ZEXPORT uncompress (dest, destLen, source, sourceLen)
-    Bytef *dest;
-    uLongf *destLen;
-    const Bytef *source;
-    uLong sourceLen;
-{
-    z_stream stream;
-    int err;
-
-    stream.next_in = (z_const Bytef *)source;
-    stream.avail_in = (uInt)sourceLen;
-    /* Check for source > 64K on 16-bit machine: */
-    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
-
-    stream.next_out = dest;
-    stream.avail_out = (uInt)*destLen;
-    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
-
-    stream.zalloc = (alloc_func)0;
-    stream.zfree = (free_func)0;
-
-    err = inflateInit(&stream);
-    if (err != Z_OK) return err;
-
-    err = inflate(&stream, Z_FINISH);
-    if (err != Z_STREAM_END) {
-        inflateEnd(&stream);
-        if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
-            return Z_DATA_ERROR;
-        return err;
-    }
-    *destLen = stream.total_out;
-
-    err = inflateEnd(&stream);
-    return err;
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zadler32.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zadler32.c
deleted file mode 100644
index a310831..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zadler32.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2011 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#include "zutil.h"
-
-#define local static
-
-local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
-
-#define BASE 65521      /* largest prime smaller than 65536 */
-#define NMAX 5552
-/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
-
-#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
-#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
-#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
-#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
-#define DO16(buf)   DO8(buf,0); DO8(buf,8);
-
-/* use NO_DIVIDE if your processor does not do division in hardware --
-   try it both ways to see which is faster */
-#ifdef NO_DIVIDE
-/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
-   (thank you to John Reiser for pointing this out) */
-#  define CHOP(a) \
-    do { \
-        unsigned long tmp = a >> 16; \
-        a &= 0xffffUL; \
-        a += (tmp << 4) - tmp; \
-    } while (0)
-#  define MOD28(a) \
-    do { \
-        CHOP(a); \
-        if (a >= BASE) a -= BASE; \
-    } while (0)
-#  define MOD(a) \
-    do { \
-        CHOP(a); \
-        MOD28(a); \
-    } while (0)
-#  define MOD63(a) \
-    do { /* this assumes a is not negative */ \
-        z_off64_t tmp = a >> 32; \
-        a &= 0xffffffffL; \
-        a += (tmp << 8) - (tmp << 5) + tmp; \
-        tmp = a >> 16; \
-        a &= 0xffffL; \
-        a += (tmp << 4) - tmp; \
-        tmp = a >> 16; \
-        a &= 0xffffL; \
-        a += (tmp << 4) - tmp; \
-        if (a >= BASE) a -= BASE; \
-    } while (0)
-#else
-#  define MOD(a) a %= BASE
-#  define MOD28(a) a %= BASE
-#  define MOD63(a) a %= BASE
-#endif
-
-/* ========================================================================= */
-uLong ZEXPORT adler32(adler, buf, len)
-    uLong adler;
-    const Bytef *buf;
-    uInt len;
-{
-    unsigned long sum2;
-    unsigned n;
-
-    /* split Adler-32 into component sums */
-    sum2 = (adler >> 16) & 0xffff;
-    adler &= 0xffff;
-
-    /* in case user likes doing a byte at a time, keep it fast */
-    if (len == 1) {
-        adler += buf[0];
-        if (adler >= BASE)
-            adler -= BASE;
-        sum2 += adler;
-        if (sum2 >= BASE)
-            sum2 -= BASE;
-        return adler | (sum2 << 16);
-    }
-
-    /* initial Adler-32 value (deferred check for len == 1 speed) */
-    if (buf == Z_NULL)
-        return 1L;
-
-    /* in case short lengths are provided, keep it somewhat fast */
-    if (len < 16) {
-        while (len--) {
-            adler += *buf++;
-            sum2 += adler;
-        }
-        if (adler >= BASE)
-            adler -= BASE;
-        MOD28(sum2);            /* only added so many BASE's */
-        return adler | (sum2 << 16);
-    }
-
-    /* do length NMAX blocks -- requires just one modulo operation */
-    while (len >= NMAX) {
-        len -= NMAX;
-        n = NMAX / 16;          /* NMAX is divisible by 16 */
-        do {
-            DO16(buf);          /* 16 sums unrolled */
-            buf += 16;
-        } while (--n);
-        MOD(adler);
-        MOD(sum2);
-    }
-
-    /* do remaining bytes (less than NMAX, still just one modulo) */
-    if (len) {                  /* avoid modulos if none remaining */
-        while (len >= 16) {
-            len -= 16;
-            DO16(buf);
-            buf += 16;
-        }
-        while (len--) {
-            adler += *buf++;
-            sum2 += adler;
-        }
-        MOD(adler);
-        MOD(sum2);
-    }
-
-    /* return recombined sums */
-    return adler | (sum2 << 16);
-}
-
-/* ========================================================================= */
-local uLong adler32_combine_(adler1, adler2, len2)
-    uLong adler1;
-    uLong adler2;
-    z_off64_t len2;
-{
-    unsigned long sum1;
-    unsigned long sum2;
-    unsigned rem;
-
-    /* for negative len, return invalid adler32 as a clue for debugging */
-    if (len2 < 0)
-        return 0xffffffffUL;
-
-    /* the derivation of this formula is left as an exercise for the reader */
-    MOD63(len2);                /* assumes len2 >= 0 */
-    rem = (unsigned)len2;
-    sum1 = adler1 & 0xffff;
-    sum2 = rem * sum1;
-    MOD(sum2);
-    sum1 += (adler2 & 0xffff) + BASE - 1;
-    sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
-    if (sum1 >= BASE) sum1 -= BASE;
-    if (sum1 >= BASE) sum1 -= BASE;
-    if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
-    if (sum2 >= BASE) sum2 -= BASE;
-    return sum1 | (sum2 << 16);
-}
-
-/* ========================================================================= */
-uLong ZEXPORT adler32_combine(adler1, adler2, len2)
-    uLong adler1;
-    uLong adler2;
-    z_off_t len2;
-{
-    return adler32_combine_(adler1, adler2, len2);
-}
-
-uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
-    uLong adler1;
-    uLong adler2;
-    z_off64_t len2;
-{
-    return adler32_combine_(adler1, adler2, len2);
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zconf.h b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zconf.h
deleted file mode 100644
index c7edbed..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zconf.h
+++ /dev/null
@@ -1,543 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2013 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-/* for _LP64 */
-#include <sys/types.h>
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- * Even better than compiling with -DZ_PREFIX would be to use configure to set
- * this permanently in zconf.h using "./configure --zprefix".
- */
-#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
-#  define Z_PREFIX_SET
-
-/* all linked symbols */
-#  define _dist_code            z__dist_code
-#  define _length_code          z__length_code
-#  define _tr_align             z__tr_align
-#  define _tr_flush_bits        z__tr_flush_bits
-#  define _tr_flush_block       z__tr_flush_block
-#  define _tr_init              z__tr_init
-#  define _tr_stored_block      z__tr_stored_block
-#  define _tr_tally             z__tr_tally
-#  define adler32               z_adler32
-#  define adler32_combine       z_adler32_combine
-#  define adler32_combine64     z_adler32_combine64
-#  ifndef Z_SOLO
-#    define compress              z_compress
-#    define compress2             z_compress2
-#    define compressBound         z_compressBound
-#  endif
-#  define crc32                 z_crc32
-#  define crc32_combine         z_crc32_combine
-#  define crc32_combine64       z_crc32_combine64
-#  define deflate               z_deflate
-#  define deflateBound          z_deflateBound
-#  define deflateCopy           z_deflateCopy
-#  define deflateEnd            z_deflateEnd
-#  define deflateInit2_         z_deflateInit2_
-#  define deflateInit_          z_deflateInit_
-#  define deflateParams         z_deflateParams
-#  define deflatePending        z_deflatePending
-#  define deflatePrime          z_deflatePrime
-#  define deflateReset          z_deflateReset
-#  define deflateResetKeep      z_deflateResetKeep
-#  define deflateSetDictionary  z_deflateSetDictionary
-#  define deflateSetHeader      z_deflateSetHeader
-#  define deflateTune           z_deflateTune
-#  define deflate_copyright     z_deflate_copyright
-#  define get_crc_table         z_get_crc_table
-#  ifndef Z_SOLO
-#    define gz_error              z_gz_error
-#    define gz_intmax             z_gz_intmax
-#    define gz_strwinerror        z_gz_strwinerror
-#    define gzbuffer              z_gzbuffer
-#    define gzclearerr            z_gzclearerr
-#    define gzclose               z_gzclose
-#    define gzclose_r             z_gzclose_r
-#    define gzclose_w             z_gzclose_w
-#    define gzdirect              z_gzdirect
-#    define gzdopen               z_gzdopen
-#    define gzeof                 z_gzeof
-#    define gzerror               z_gzerror
-#    define gzflush               z_gzflush
-#    define gzgetc                z_gzgetc
-#    define gzgetc_               z_gzgetc_
-#    define gzgets                z_gzgets
-#    define gzoffset              z_gzoffset
-#    define gzoffset64            z_gzoffset64
-#    define gzopen                z_gzopen
-#    define gzopen64              z_gzopen64
-#    ifdef _WIN32
-#      define gzopen_w              z_gzopen_w
-#    endif
-#    define gzprintf              z_gzprintf
-#    define gzvprintf             z_gzvprintf
-#    define gzputc                z_gzputc
-#    define gzputs                z_gzputs
-#    define gzread                z_gzread
-#    define gzrewind              z_gzrewind
-#    define gzseek                z_gzseek
-#    define gzseek64              z_gzseek64
-#    define gzsetparams           z_gzsetparams
-#    define gztell                z_gztell
-#    define gztell64              z_gztell64
-#    define gzungetc              z_gzungetc
-#    define gzwrite               z_gzwrite
-#  endif
-#  define inflate               z_inflate
-#  define inflateBack           z_inflateBack
-#  define inflateBackEnd        z_inflateBackEnd
-#  define inflateBackInit_      z_inflateBackInit_
-#  define inflateCopy           z_inflateCopy
-#  define inflateEnd            z_inflateEnd
-#  define inflateGetHeader      z_inflateGetHeader
-#  define inflateInit2_         z_inflateInit2_
-#  define inflateInit_          z_inflateInit_
-#  define inflateMark           z_inflateMark
-#  define inflatePrime          z_inflatePrime
-#  define inflateReset          z_inflateReset
-#  define inflateReset2         z_inflateReset2
-#  define inflateSetDictionary  z_inflateSetDictionary
-#  define inflateGetDictionary  z_inflateGetDictionary
-#  define inflateSync           z_inflateSync
-#  define inflateSyncPoint      z_inflateSyncPoint
-#  define inflateUndermine      z_inflateUndermine
-#  define inflateResetKeep      z_inflateResetKeep
-#  define inflate_copyright     z_inflate_copyright
-#  define inflate_fast          z_inflate_fast
-#  define inflate_table         z_inflate_table
-#  ifndef Z_SOLO
-#    define uncompress            z_uncompress
-#  endif
-#  define zError                z_zError
-#  ifndef Z_SOLO
-#    define zcalloc               z_zcalloc
-#    define zcfree                z_zcfree
-#  endif
-#  define zlibCompileFlags      z_zlibCompileFlags
-#  define zlibVersion           z_zlibVersion
-
-/* all zlib typedefs in zlib.h and zconf.h */
-#  define Byte                  z_Byte
-#  define Bytef                 z_Bytef
-#  define alloc_func            z_alloc_func
-#  define charf                 z_charf
-#  define free_func             z_free_func
-#  ifndef Z_SOLO
-#    define gzFile                z_gzFile
-#  endif
-#  define gz_header             z_gz_header
-#  define gz_headerp            z_gz_headerp
-#  define in_func               z_in_func
-#  define intf                  z_intf
-#  define out_func              z_out_func
-#  define uInt                  z_uInt
-#  define uIntf                 z_uIntf
-#  define uLong                 z_uLong
-#  define uLongf                z_uLongf
-#  define voidp                 z_voidp
-#  define voidpc                z_voidpc
-#  define voidpf                z_voidpf
-
-/* all zlib structs in zlib.h and zconf.h */
-#  define gz_header_s           z_gz_header_s
-#  define internal_state        z_internal_state
-
-#endif
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-#  define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-#  define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-#  define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-#  ifndef WIN32
-#    define WIN32
-#  endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-#    ifndef SYS16BIT
-#      define SYS16BIT
-#    endif
-#  endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-#  define MAXSEG_64K
-#endif
-#ifdef MSDOS
-#  define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-#  ifndef STDC
-#    define STDC
-#  endif
-#  if __STDC_VERSION__ >= 199901L
-#    ifndef STDC99
-#      define STDC99
-#    endif
-#  endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-#  define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
-#  define STDC
-#endif
-
-#ifndef STDC
-#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-#    define const       /* note: need a more gentle solution here */
-#  endif
-#endif
-
-#if defined(ZLIB_CONST) && !defined(z_const)
-#  define z_const const
-#else
-#  define z_const
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-#  define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-#  ifdef MAXSEG_64K
-#    define MAX_MEM_LEVEL 8
-#  else
-#    define MAX_MEM_LEVEL 9
-#  endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-#  define MAX_WBITS   15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
-            (1 << (windowBits+2)) +  (1 << (memLevel+9))
- that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
-     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
-   The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
-                        /* Type declarations */
-
-#ifndef OF /* function prototypes */
-#  ifdef STDC
-#    define OF(args)  args
-#  else
-#    define OF(args)  ()
-#  endif
-#endif
-
-#ifndef Z_ARG /* function prototypes for stdarg */
-#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
-#    define Z_ARG(args)  args
-#  else
-#    define Z_ARG(args)  ()
-#  endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-#  if defined(M_I86SM) || defined(M_I86MM)
-     /* MSC small or medium model */
-#    define SMALL_MEDIUM
-#    ifdef _MSC_VER
-#      define FAR _far
-#    else
-#      define FAR far
-#    endif
-#  endif
-#  if (defined(__SMALL__) || defined(__MEDIUM__))
-     /* Turbo C small or medium model */
-#    define SMALL_MEDIUM
-#    ifdef __BORLANDC__
-#      define FAR _far
-#    else
-#      define FAR far
-#    endif
-#  endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
-   /* If building or using zlib as a DLL, define ZLIB_DLL.
-    * This is not mandatory, but it offers a little performance increase.
-    */
-#  ifdef ZLIB_DLL
-#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-#      ifdef ZLIB_INTERNAL
-#        define ZEXTERN extern __declspec(dllexport)
-#      else
-#        define ZEXTERN extern __declspec(dllimport)
-#      endif
-#    endif
-#  endif  /* ZLIB_DLL */
-   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
-    * define ZLIB_WINAPI.
-    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
-    */
-#  ifdef ZLIB_WINAPI
-#    ifdef FAR
-#      undef FAR
-#    endif
-#    include <windows.h>
-     /* No need for _export, use ZLIB.DEF instead. */
-     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-#    define ZEXPORT WINAPI
-#    ifdef WIN32
-#      define ZEXPORTVA WINAPIV
-#    else
-#      define ZEXPORTVA FAR CDECL
-#    endif
-#  endif
-#endif
-
-#if defined (__BEOS__)
-#  ifdef ZLIB_DLL
-#    ifdef ZLIB_INTERNAL
-#      define ZEXPORT   __declspec(dllexport)
-#      define ZEXPORTVA __declspec(dllexport)
-#    else
-#      define ZEXPORT   __declspec(dllimport)
-#      define ZEXPORTVA __declspec(dllimport)
-#    endif
-#  endif
-#endif
-
-#ifndef ZEXTERN
-#  define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-#  define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-#  define ZEXPORTVA
-#endif
-
-#ifndef FAR
-#  define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char  Byte;  /* 8 bits */
-#endif
-typedef unsigned int   uInt;  /* 16 bits or more */
-
-#ifdef _LP64
-typedef unsigned int  uLong;  /* 32 bits or more */
-#else
-typedef unsigned long  uLong; /* 32 bits or more */
-#endif
-
-#ifdef SMALL_MEDIUM
-   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-#  define Bytef Byte FAR
-#else
-   typedef Byte  FAR Bytef;
-#endif
-typedef char  FAR charf;
-typedef int   FAR intf;
-typedef uInt  FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
-   typedef void const *voidpc;
-   typedef void FAR   *voidpf;
-   typedef void       *voidp;
-#else
-   typedef Byte const *voidpc;
-   typedef Byte FAR   *voidpf;
-   typedef Byte       *voidp;
-#endif
-
-#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
-#  include <limits.h>
-#  if (UINT_MAX == 0xffffffffUL)
-#    define Z_U4 unsigned
-#  elif (ULONG_MAX == 0xffffffffUL)
-#    define Z_U4 unsigned long
-#  elif (USHRT_MAX == 0xffffffffUL)
-#    define Z_U4 unsigned short
-#  endif
-#endif
-
-#ifdef Z_U4
-   typedef Z_U4 z_crc_t;
-#else
-   typedef unsigned long z_crc_t;
-#endif
-
-#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
-#  define Z_HAVE_UNISTD_H
-#endif
-
-#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
-#  define Z_HAVE_STDARG_H
-#endif
-
-#ifdef STDC
-#  ifndef Z_SOLO
-#    include <sys/types.h>      /* for off_t */
-#  endif
-#endif
-
-#if defined(STDC) || defined(Z_HAVE_STDARG_H)
-#  ifndef Z_SOLO
-#    include <stdarg.h>         /* for va_list */
-#  endif
-#endif
-
-#ifdef _WIN32
-#  ifndef Z_SOLO
-#    include <stddef.h>         /* for wchar_t */
-#  endif
-#endif
-
-/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
- * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
- * though the former does not conform to the LFS document), but considering
- * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
- * equivalently requesting no 64-bit operations
- */
-#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
-#  undef _LARGEFILE64_SOURCE
-#endif
-
-#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
-#  define Z_HAVE_UNISTD_H
-#endif
-#ifndef Z_SOLO
-#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
-#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
-#    ifdef VMS
-#      include <unixio.h>       /* for off_t */
-#    endif
-#    ifndef z_off_t
-#      define z_off_t off_t
-#    endif
-#  endif
-#endif
-
-#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
-#  define Z_LFS64
-#endif
-
-#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
-#  define Z_LARGE64
-#endif
-
-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
-#  define Z_WANT64
-#endif
-
-#if !defined(SEEK_SET) && !defined(Z_SOLO)
-#  define SEEK_SET        0       /* Seek from beginning of file.  */
-#  define SEEK_CUR        1       /* Seek from current position.  */
-#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
-#endif
-
-#ifndef z_off_t
-#  define z_off_t long
-#endif
-
-#if !defined(_WIN32) && defined(Z_LARGE64)
-#  define z_off64_t off64_t
-#else
-#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
-#    define z_off64_t __int64
-#  else
-#    define z_off64_t z_off_t
-#  endif
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
-  #pragma map(deflateInit_,"DEIN")
-  #pragma map(deflateInit2_,"DEIN2")
-  #pragma map(deflateEnd,"DEEND")
-  #pragma map(deflateBound,"DEBND")
-  #pragma map(inflateInit_,"ININ")
-  #pragma map(inflateInit2_,"ININ2")
-  #pragma map(inflateEnd,"INEND")
-  #pragma map(inflateSync,"INSY")
-  #pragma map(inflateSetDictionary,"INSEDI")
-  #pragma map(compressBound,"CMBND")
-  #pragma map(inflate_table,"INTABL")
-  #pragma map(inflate_fast,"INFA")
-  #pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zcrc32.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zcrc32.c
deleted file mode 100644
index 0fe90df..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zcrc32.c
+++ /dev/null
@@ -1,449 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
- * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
- * tables for updating the shift register in one step with three exclusive-ors
- * instead of four steps with four exclusive-ors.  This results in about a
- * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
- */
-
-/* @(#) $Id$ */
-
-/*
-  Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
-  protection on the static variables used to control the first-use generation
-  of the crc tables.  Therefore, if you #define DYNAMIC_CRC_TABLE, you should
-  first call get_crc_table() to initialize the tables before allowing more than
-  one thread to use crc32().
-
-  DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
- */
-
-#ifdef MAKECRCH
-#  include <stdio.h>
-#  ifndef DYNAMIC_CRC_TABLE
-#    define DYNAMIC_CRC_TABLE
-#  endif /* !DYNAMIC_CRC_TABLE */
-#endif /* MAKECRCH */
-
-#include "zutil.h"      /* for STDC and FAR definitions */
-
-#define local static
-
-/* Definitions for doing the crc four data bytes at a time. */
-#if !defined(NOBYFOUR) && defined(Z_U4)
-#  define BYFOUR
-#endif
-#ifdef BYFOUR
-   local unsigned long crc32_little OF((unsigned long,
-                        const unsigned char FAR *, unsigned));
-   local unsigned long crc32_big OF((unsigned long,
-                        const unsigned char FAR *, unsigned));
-#  define TBLS 8
-#else
-#  define TBLS 1
-#endif /* BYFOUR */
-
-/* Local functions for crc concatenation */
-local unsigned long gf2_matrix_times OF((unsigned long *mat,
-                                         unsigned long vec));
-local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
-local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
-
-
-#ifdef DYNAMIC_CRC_TABLE
-
-local volatile int crc_table_empty = 1;
-local z_crc_t FAR crc_table[TBLS][256];
-local void make_crc_table OF((void));
-#ifdef MAKECRCH
-   local void write_table OF((FILE *, const z_crc_t FAR *));
-#endif /* MAKECRCH */
-/*
-  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
-  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
-
-  Polynomials over GF(2) are represented in binary, one bit per coefficient,
-  with the lowest powers in the most significant bit.  Then adding polynomials
-  is just exclusive-or, and multiplying a polynomial by x is a right shift by
-  one.  If we call the above polynomial p, and represent a byte as the
-  polynomial q, also with the lowest power in the most significant bit (so the
-  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
-  where a mod b means the remainder after dividing a by b.
-
-  This calculation is done using the shift-register method of multiplying and
-  taking the remainder.  The register is initialized to zero, and for each
-  incoming bit, x^32 is added mod p to the register if the bit is a one (where
-  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
-  x (which is shifting right by one and adding x^32 mod p if the bit shifted
-  out is a one).  We start with the highest power (least significant bit) of
-  q and repeat for all eight bits of q.
-
-  The first table is simply the CRC of all possible eight bit values.  This is
-  all the information needed to generate CRCs on data a byte at a time for all
-  combinations of CRC register values and incoming bytes.  The remaining tables
-  allow for word-at-a-time CRC calculation for both big-endian and little-
-  endian machines, where a word is four bytes.
-*/
-local void make_crc_table()
-{
-    z_crc_t c;
-    int n, k;
-    z_crc_t poly;                       /* polynomial exclusive-or pattern */
-    /* terms of polynomial defining this crc (except x^32): */
-    static volatile int first = 1;      /* flag to limit concurrent making */
-    static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
-
-    /* See if another task is already doing this (not thread-safe, but better
-       than nothing -- significantly reduces duration of vulnerability in
-       case the advice about DYNAMIC_CRC_TABLE is ignored) */
-    if (first) {
-        first = 0;
-
-        /* make exclusive-or pattern from polynomial (0xedb88320UL) */
-        poly = 0;
-        for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
-            poly |= (z_crc_t)1 << (31 - p[n]);
-
-        /* generate a crc for every 8-bit value */
-        for (n = 0; n < 256; n++) {
-            c = (z_crc_t)n;
-            for (k = 0; k < 8; k++)
-                c = c & 1 ? poly ^ (c >> 1) : c >> 1;
-            crc_table[0][n] = c;
-        }
-
-#ifdef BYFOUR
-        /* generate crc for each value followed by one, two, and three zeros,
-           and then the byte reversal of those as well as the first table */
-        for (n = 0; n < 256; n++) {
-            c = crc_table[0][n];
-            crc_table[4][n] = ZSWAP32(c);
-            for (k = 1; k < 4; k++) {
-                c = crc_table[0][c & 0xff] ^ (c >> 8);
-                crc_table[k][n] = c;
-                crc_table[k + 4][n] = ZSWAP32(c);
-            }
-        }
-#endif /* BYFOUR */
-
-        crc_table_empty = 0;
-    }
-    else {      /* not first */
-        /* wait for the other guy to finish (not efficient, but rare) */
-        while (crc_table_empty)
-            ;
-    }
-
-#ifdef MAKECRCH
-    /* write out CRC tables to crc32.h */
-    {
-        FILE *out;
-
-        out = fopen("crc32.h", "w");
-        if (out == NULL) return;
-        fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
-        fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
-        fprintf(out, "local const z_crc_t FAR ");
-        fprintf(out, "crc_table[TBLS][256] =\n{\n  {\n");
-        write_table(out, crc_table[0]);
-#  ifdef BYFOUR
-        fprintf(out, "#ifdef BYFOUR\n");
-        for (k = 1; k < 8; k++) {
-            fprintf(out, "  },\n  {\n");
-            write_table(out, crc_table[k]);
-        }
-        fprintf(out, "#endif\n");
-#  endif /* BYFOUR */
-        fprintf(out, "  }\n};\n");
-        fclose(out);
-    }
-#endif /* MAKECRCH */
-}
-
-#ifdef MAKECRCH
-local void write_table(out, table)
-    FILE *out;
-    const z_crc_t FAR *table;
-{
-    int n;
-
-    for (n = 0; n < 256; n++)
-        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ",
-                (unsigned long)(table[n]),
-                n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
-}
-#endif /* MAKECRCH */
-
-#else /* !DYNAMIC_CRC_TABLE */
-/* ========================================================================
- * Tables of CRC-32s of all single-byte values, made by make_crc_table().
- */
-#include "crc32.h"
-#endif /* DYNAMIC_CRC_TABLE */
-
-/* =========================================================================
- * This function can be used by asm versions of crc32()
- */
-const z_crc_t FAR * ZEXPORT get_crc_table()
-{
-#ifdef DYNAMIC_CRC_TABLE
-    if (crc_table_empty)
-        make_crc_table();
-#endif /* DYNAMIC_CRC_TABLE */
-    return (const z_crc_t FAR *)crc_table;
-}
-
-/* ========================================================================= */
-#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
-#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
-
-/* ========================================================================= */
-uLong ZEXPORT crc32(crc, buf, len)
-    uLong crc;
-    const unsigned char FAR *buf;
-    uInt len;
-{
-    if (buf == Z_NULL) return 0UL;
-
-#ifdef DYNAMIC_CRC_TABLE
-    if (crc_table_empty)
-        make_crc_table();
-#endif /* DYNAMIC_CRC_TABLE */
-
-#ifdef BYFOUR
-    if (sizeof(void *) == sizeof(ptrdiff_t)) {
-        z_crc_t endian;
-
-        endian = 1;
-        if (*((unsigned char *)(&endian)))
-            return (uLong)crc32_little(crc, buf, len);
-        else
-            return (uLong)crc32_big(crc, buf, len);
-    }
-#endif /* BYFOUR */
-    crc = crc ^ 0xffffffffUL;
-    while (len >= 8) {
-        DO8;
-        len -= 8;
-    }
-    if (len) do {
-        DO1;
-    } while (--len);
-    return crc ^ 0xffffffffUL;
-}
-
-#ifdef BYFOUR
-
-/* ========================================================================= */
-#define DOLIT4 c ^= *buf4++; \
-        c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
-            crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
-#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
-
-/* ========================================================================= */
-local unsigned long crc32_little(crc, buf, len)
-    unsigned long crc;
-    const unsigned char FAR *buf;
-    unsigned len;
-{
-    register z_crc_t c;
-    register const z_crc_t FAR *buf4;
-
-    c = (z_crc_t)crc;
-    c = ~c;
-    while (len && ((ptrdiff_t)buf & 3)) {
-        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
-        len--;
-    }
-
-    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
-    while (len >= 32) {
-        DOLIT32;
-        len -= 32;
-    }
-    while (len >= 4) {
-        DOLIT4;
-        len -= 4;
-    }
-    buf = (const unsigned char FAR *)buf4;
-
-    if (len) do {
-        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
-    } while (--len);
-    c = ~c;
-    return (unsigned long)c;
-}
-
-/* ========================================================================= */
-#define DOBIG4 c ^= *++buf4; \
-        c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
-            crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
-#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
-
-/* ========================================================================= */
-local unsigned long crc32_big(crc, buf, len)
-    unsigned long crc;
-    const unsigned char FAR *buf;
-    unsigned len;
-{
-    register z_crc_t c;
-    register const z_crc_t FAR *buf4;
-
-    c = ZSWAP32((z_crc_t)crc);
-    c = ~c;
-    while (len && ((ptrdiff_t)buf & 3)) {
-        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
-        len--;
-    }
-
-    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
-    buf4--;
-    while (len >= 32) {
-        DOBIG32;
-        len -= 32;
-    }
-    while (len >= 4) {
-        DOBIG4;
-        len -= 4;
-    }
-    buf4++;
-    buf = (const unsigned char FAR *)buf4;
-
-    if (len) do {
-        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
-    } while (--len);
-    c = ~c;
-    return (unsigned long)(ZSWAP32(c));
-}
-
-#endif /* BYFOUR */
-
-#define GF2_DIM 32      /* dimension of GF(2) vectors (length of CRC) */
-
-/* ========================================================================= */
-local unsigned long gf2_matrix_times(mat, vec)
-    unsigned long *mat;
-    unsigned long vec;
-{
-    unsigned long sum;
-
-    sum = 0;
-    while (vec) {
-        if (vec & 1)
-            sum ^= *mat;
-        vec >>= 1;
-        mat++;
-    }
-    return sum;
-}
-
-/* ========================================================================= */
-local void gf2_matrix_square(square, mat)
-    unsigned long *square;
-    unsigned long *mat;
-{
-    int n;
-
-    for (n = 0; n < GF2_DIM; n++)
-        square[n] = gf2_matrix_times(mat, mat[n]);
-}
-
-/* ========================================================================= */
-local uLong crc32_combine_(crc1, crc2, len2)
-    uLong crc1;
-    uLong crc2;
-    z_off64_t len2;
-{
-    int n;
-    unsigned long row;
-    unsigned long even[GF2_DIM];    /* even-power-of-two zeros operator */
-    unsigned long odd[GF2_DIM];     /* odd-power-of-two zeros operator */
-
-    /* degenerate case (also disallow negative lengths) */
-    if (len2 <= 0)
-        return crc1;
-
-    /* put operator for one zero bit in odd */
-    odd[0] = 0xedb88320UL;          /* CRC-32 polynomial */
-    row = 1;
-    for (n = 1; n < GF2_DIM; n++) {
-        odd[n] = row;
-        row <<= 1;
-    }
-
-    /* put operator for two zero bits in even */
-    gf2_matrix_square(even, odd);
-
-    /* put operator for four zero bits in odd */
-    gf2_matrix_square(odd, even);
-
-    /* apply len2 zeros to crc1 (first square will put the operator for one
-       zero byte, eight zero bits, in even) */
-    do {
-        /* apply zeros operator for this bit of len2 */
-        gf2_matrix_square(even, odd);
-        if (len2 & 1)
-            crc1 = gf2_matrix_times(even, crc1);
-        len2 >>= 1;
-
-        /* if no more bits set, then done */
-        if (len2 == 0)
-            break;
-
-        /* another iteration of the loop with odd and even swapped */
-        gf2_matrix_square(odd, even);
-        if (len2 & 1)
-            crc1 = gf2_matrix_times(odd, crc1);
-        len2 >>= 1;
-
-        /* if no more bits set, then done */
-    } while (len2 != 0);
-
-    /* return combined crc */
-    crc1 ^= crc2;
-    return crc1;
-}
-
-/* ========================================================================= */
-uLong ZEXPORT crc32_combine(crc1, crc2, len2)
-    uLong crc1;
-    uLong crc2;
-    z_off_t len2;
-{
-    return crc32_combine_(crc1, crc2, len2);
-}
-
-uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
-    uLong crc1;
-    uLong crc2;
-    z_off64_t len2;
-{
-    return crc32_combine_(crc1, crc2, len2);
-}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zlib.h b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zlib.h
deleted file mode 100644
index 8779cad..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zlib.h
+++ /dev/null
@@ -1,1792 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.8, April 28th, 2013
-
-  Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  Jean-loup Gailly        Mark Adler
-  jloup@gzip.org          madler@alumni.caltech.edu
-
-
-  The data format used by the zlib library is described by RFCs (Request for
-  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
-  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
-*/
-
-#ifndef ZLIB_H
-#define ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.2.8"
-#define ZLIB_VERNUM 0x1280
-#define ZLIB_VER_MAJOR 1
-#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 8
-#define ZLIB_VER_SUBREVISION 0
-
-/*
-    The 'zlib' compression library provides in-memory compression and
-  decompression functions, including integrity checks of the uncompressed data.
-  This version of the library supports only one compression method (deflation)
-  but other algorithms will be added later and will have the same stream
-  interface.
-
-    Compression can be done in a single step if the buffers are large enough,
-  or can be done by repeated calls of the compression function.  In the latter
-  case, the application must provide more input and/or consume the output
-  (providing more output space) before each call.
-
-    The compressed data format used by default by the in-memory functions is
-  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
-  around a deflate stream, which is itself documented in RFC 1951.
-
-    The library also supports reading and writing files in gzip (.gz) format
-  with an interface similar to that of stdio using the functions that start
-  with "gz".  The gzip format is different from the zlib format.  gzip is a
-  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
-
-    This library can optionally read and write gzip streams in memory as well.
-
-    The zlib format was designed to be compact and fast for use in memory
-  and on communications channels.  The gzip format was designed for single-
-  file compression on file systems, has a larger header than zlib to maintain
-  directory information, and uses a different, slower check method than zlib.
-
-    The library does not install any signal handler.  The decoder checks
-  the consistency of the compressed data, so the library should never crash
-  even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
-    z_const Bytef *next_in;     /* next input byte */
-    uInt     avail_in;  /* number of bytes available at next_in */
-    uLong    total_in;  /* total number of input bytes read so far */
-
-    Bytef    *next_out; /* next output byte should be put there */
-    uInt     avail_out; /* remaining free space at next_out */
-    uLong    total_out; /* total number of bytes output so far */
-
-    z_const char *msg;  /* last error message, NULL if no error */
-    struct internal_state FAR *state; /* not visible by applications */
-
-    alloc_func zalloc;  /* used to allocate the internal state */
-    free_func  zfree;   /* used to free the internal state */
-    voidpf     opaque;  /* private data object passed to zalloc and zfree */
-
-    int     data_type;  /* best guess about the data type: binary or text */
-    uLong   adler;      /* adler32 value of the uncompressed data */
-    uLong   reserved;   /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
-     gzip header information passed to and from zlib routines.  See RFC 1952
-  for more details on the meanings of these fields.
-*/
-typedef struct gz_header_s {
-    int     text;       /* true if compressed data believed to be text */
-    uLong   time;       /* modification time */
-    int     xflags;     /* extra flags (not used when writing a gzip file) */
-    int     os;         /* operating system */
-    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
-    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
-    uInt    extra_max;  /* space at extra (only when reading header) */
-    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
-    uInt    name_max;   /* space at name (only when reading header) */
-    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
-    uInt    comm_max;   /* space at comment (only when reading header) */
-    int     hcrc;       /* true if there was or will be a header crc */
-    int     done;       /* true when done reading gzip header (not used
-                           when writing a gzip file) */
-} gz_header;
-
-typedef gz_header FAR *gz_headerp;
-
-/*
-     The application must update next_in and avail_in when avail_in has dropped
-   to zero.  It must update next_out and avail_out when avail_out has dropped
-   to zero.  The application must initialize zalloc, zfree and opaque before
-   calling the init function.  All other fields are set by the compression
-   library and must not be updated by the application.
-
-     The opaque value provided by the application will be passed as the first
-   parameter for calls of zalloc and zfree.  This can be useful for custom
-   memory management.  The compression library attaches no meaning to the
-   opaque value.
-
-     zalloc must return Z_NULL if there is not enough memory for the object.
-   If zlib is used in a multi-threaded application, zalloc and zfree must be
-   thread safe.
-
-     On 16-bit systems, the functions zalloc and zfree must be able to allocate
-   exactly 65536 bytes, but will not be required to allocate more than this if
-   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers
-   returned by zalloc for objects of exactly 65536 bytes *must* have their
-   offset normalized to zero.  The default allocation function provided by this
-   library ensures this (see zutil.c).  To reduce memory requirements and avoid
-   any allocation of 64K objects, at the expense of compression ratio, compile
-   the library with -DMAX_WBITS=14 (see zconf.h).
-
-     The fields total_in and total_out can be used for statistics or progress
-   reports.  After compression, total_in holds the total size of the
-   uncompressed data and may be saved for use in the decompressor (particularly
-   if the decompressor wants to decompress everything in a single step).
-*/
-
-                        /* constants */
-
-#define Z_NO_FLUSH      0
-#define Z_PARTIAL_FLUSH 1
-#define Z_SYNC_FLUSH    2
-#define Z_FULL_FLUSH    3
-#define Z_FINISH        4
-#define Z_BLOCK         5
-#define Z_TREES         6
-/* Allowed flush values; see deflate() and inflate() below for details */
-
-#define Z_OK            0
-#define Z_STREAM_END    1
-#define Z_NEED_DICT     2
-#define Z_ERRNO        (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR   (-3)
-#define Z_MEM_ERROR    (-4)
-#define Z_BUF_ERROR    (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION         0
-#define Z_BEST_SPEED             1
-#define Z_BEST_COMPRESSION       9
-#define Z_DEFAULT_COMPRESSION  (-1)
-/* compression levels */
-
-#define Z_FILTERED            1
-#define Z_HUFFMAN_ONLY        2
-#define Z_RLE                 3
-#define Z_FIXED               4
-#define Z_DEFAULT_STRATEGY    0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY   0
-#define Z_TEXT     1
-#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
-#define Z_UNKNOWN  2
-/* Possible values of the data_type field (though see inflate()) */
-
-#define Z_DEFLATED   8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
-
-                        /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
-   If the first character differs, the library code actually used is not
-   compatible with the zlib.h header file used by the application.  This check
-   is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
-     Initializes the internal stream state for compression.  The fields
-   zalloc, zfree and opaque must be initialized before by the caller.  If
-   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
-   allocation functions.
-
-     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
-   1 gives best speed, 9 gives best compression, 0 gives no compression at all
-   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION
-   requests a default compromise between speed and compression (currently
-   equivalent to level 6).
-
-     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_STREAM_ERROR if level is not a valid compression level, or
-   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
-   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null
-   if there is no error message.  deflateInit does not perform any compression:
-   this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
-    deflate compresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full.  It may introduce
-  some output latency (reading input without producing any output) except when
-  forced to flush.
-
-    The detailed semantics are as follows.  deflate performs one or both of the
-  following actions:
-
-  - Compress more input starting at next_in and update next_in and avail_in
-    accordingly.  If not all input can be processed (because there is not
-    enough room in the output buffer), next_in and avail_in are updated and
-    processing will resume at this point for the next call of deflate().
-
-  - Provide more output starting at next_out and update next_out and avail_out
-    accordingly.  This action is forced if the parameter flush is non zero.
-    Forcing flush frequently degrades the compression ratio, so this parameter
-    should be set only when necessary (in interactive applications).  Some
-    output may be provided even if flush is not set.
-
-    Before the call of deflate(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming more
-  output, and updating avail_in or avail_out accordingly; avail_out should
-  never be zero before the call.  The application can consume the compressed
-  output when it wants, for example when the output buffer is full (avail_out
-  == 0), or after each call of deflate().  If deflate returns Z_OK and with
-  zero avail_out, it must be called again after making room in the output
-  buffer because there might be more output pending.
-
-    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
-  decide how much data to accumulate before producing output, in order to
-  maximize compression.
-
-    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
-  flushed to the output buffer and the output is aligned on a byte boundary, so
-  that the decompressor can get all input data available so far.  (In
-  particular avail_in is zero after the call if enough output space has been
-  provided before the call.) Flushing may degrade compression for some
-  compression algorithms and so it should be used only when necessary.  This
-  completes the current deflate block and follows it with an empty stored block
-  that is three bits plus filler bits to the next byte, followed by four bytes
-  (00 00 ff ff).
-
-    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
-  output buffer, but the output is not aligned to a byte boundary.  All of the
-  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
-  This completes the current deflate block and follows it with an empty fixed
-  codes block that is 10 bits long.  This assures that enough bytes are output
-  in order for the decompressor to finish the block before the empty fixed code
-  block.
-
-    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
-  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
-  seven bits of the current block are held to be written as the next byte after
-  the next deflate block is completed.  In this case, the decompressor may not
-  be provided enough bits at this point in order to complete decompression of
-  the data provided so far to the compressor.  It may need to wait for the next
-  block to be emitted.  This is for advanced applications that need to control
-  the emission of deflate blocks.
-
-    If flush is set to Z_FULL_FLUSH, all output is flushed as with
-  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
-  restart from this point if previous compressed data has been damaged or if
-  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade
-  compression.
-
-    If deflate returns with avail_out == 0, this function must be called again
-  with the same value of the flush parameter and more output space (updated
-  avail_out), until the flush is complete (deflate returns with non-zero
-  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
-  avail_out is greater than six to avoid repeated flush markers due to
-  avail_out == 0 on return.
-
-    If the parameter flush is set to Z_FINISH, pending input is processed,
-  pending output is flushed and deflate returns with Z_STREAM_END if there was
-  enough output space; if deflate returns with Z_OK, this function must be
-  called again with Z_FINISH and more output space (updated avail_out) but no
-  more input data, until it returns with Z_STREAM_END or an error.  After
-  deflate has returned Z_STREAM_END, the only possible operations on the stream
-  are deflateReset or deflateEnd.
-
-    Z_FINISH can be used immediately after deflateInit if all the compression
-  is to be done in a single step.  In this case, avail_out must be at least the
-  value returned by deflateBound (see below).  Then deflate is guaranteed to
-  return Z_STREAM_END.  If not enough output space is provided, deflate will
-  not return Z_STREAM_END, and it must be called again as described above.
-
-    deflate() sets strm->adler to the adler32 checksum of all input read
-  so far (that is, total_in bytes).
-
-    deflate() may update strm->data_type if it can make a good guess about
-  the input data type (Z_BINARY or Z_TEXT).  In doubt, the data is considered
-  binary.  This field is only for information purposes and does not affect the
-  compression algorithm in any manner.
-
-    deflate() returns Z_OK if some progress has been made (more input
-  processed or more output produced), Z_STREAM_END if all input has been
-  consumed and all output has been produced (only when flush is set to
-  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
-  if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
-  (for example avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not
-  fatal, and deflate() can be called again with more input and more output
-  space to continue compressing.
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any pending
-   output.
-
-     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
-   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
-   prematurely (some input or output was discarded).  In the error case, msg
-   may be set but then points to a static string (which must not be
-   deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
-     Initializes the internal stream state for decompression.  The fields
-   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
-   the caller.  If next_in is not Z_NULL and avail_in is large enough (the
-   exact value depends on the compression method), inflateInit determines the
-   compression method from the zlib header and allocates all data structures
-   accordingly; otherwise the allocation will be deferred to the first call of
-   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
-   use default allocation functions.
-
-     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
-   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
-   invalid, such as a null pointer to the structure.  msg is set to null if
-   there is no error message.  inflateInit does not perform any decompression
-   apart from possibly reading the zlib header if present: actual decompression
-   will be done by inflate().  (So next_in and avail_in may be modified, but
-   next_out and avail_out are unused and unchanged.) The current implementation
-   of inflateInit() does not process any header information -- that is deferred
-   until inflate() is called.
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
-    inflate decompresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full.  It may introduce
-  some output latency (reading input without producing any output) except when
-  forced to flush.
-
-  The detailed semantics are as follows.  inflate performs one or both of the
-  following actions:
-
-  - Decompress more input starting at next_in and update next_in and avail_in
-    accordingly.  If not all input can be processed (because there is not
-    enough room in the output buffer), next_in is updated and processing will
-    resume at this point for the next call of inflate().
-
-  - Provide more output starting at next_out and update next_out and avail_out
-    accordingly.  inflate() provides as much output as possible, until there is
-    no more input data or no more space in the output buffer (see below about
-    the flush parameter).
-
-    Before the call of inflate(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming more
-  output, and updating the next_* and avail_* values accordingly.  The
-  application can consume the uncompressed output when it wants, for example
-  when the output buffer is full (avail_out == 0), or after each call of
-  inflate().  If inflate returns Z_OK and with zero avail_out, it must be
-  called again after making room in the output buffer because there might be
-  more output pending.
-
-    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
-  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much
-  output as possible to the output buffer.  Z_BLOCK requests that inflate()
-  stop if and when it gets to the next deflate block boundary.  When decoding
-  the zlib or gzip format, this will cause inflate() to return immediately
-  after the header and before the first block.  When doing a raw inflate,
-  inflate() will go ahead and process the first block, and will return when it
-  gets to the end of that block, or when it runs out of data.
-
-    The Z_BLOCK option assists in appending to or combining deflate streams.
-  Also to assist in this, on return inflate() will set strm->data_type to the
-  number of unused bits in the last byte taken from strm->next_in, plus 64 if
-  inflate() is currently decoding the last block in the deflate stream, plus
-  128 if inflate() returned immediately after decoding an end-of-block code or
-  decoding the complete header up to just before the first byte of the deflate
-  stream.  The end-of-block will not be indicated until all of the uncompressed
-  data from that block has been written to strm->next_out.  The number of
-  unused bits may in general be greater than seven, except when bit 7 of
-  data_type is set, in which case the number of unused bits will be less than
-  eight.  data_type is set as noted here every time inflate() returns for all
-  flush options, and so can be used to determine the amount of currently
-  consumed input in bits.
-
-    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
-  end of each deflate block header is reached, before any actual data in that
-  block is decoded.  This allows the caller to determine the length of the
-  deflate block header for later use in random access within a deflate block.
-  256 is added to the value of strm->data_type when inflate() returns
-  immediately after reaching the end of the deflate block header.
-
-    inflate() should normally be called until it returns Z_STREAM_END or an
-  error.  However if all decompression is to be performed in a single step (a
-  single call of inflate), the parameter flush should be set to Z_FINISH.  In
-  this case all pending input is processed and all pending output is flushed;
-  avail_out must be large enough to hold all of the uncompressed data for the
-  operation to complete.  (The size of the uncompressed data may have been
-  saved by the compressor for this purpose.) The use of Z_FINISH is not
-  required to perform an inflation in one step.  However it may be used to
-  inform inflate that a faster approach can be used for the single inflate()
-  call.  Z_FINISH also informs inflate to not maintain a sliding window if the
-  stream completes, which reduces inflate's memory footprint.  If the stream
-  does not complete, either because not all of the stream is provided or not
-  enough output space is provided, then a sliding window will be allocated and
-  inflate() can be called again to continue the operation as if Z_NO_FLUSH had
-  been used.
-
-     In this implementation, inflate() always flushes as much output as
-  possible to the output buffer, and always uses the faster approach on the
-  first call.  So the effects of the flush parameter in this implementation are
-  on the return value of inflate() as noted below, when inflate() returns early
-  when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
-  memory for a sliding window when Z_FINISH is used.
-
-     If a preset dictionary is needed after this call (see inflateSetDictionary
-  below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
-  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
-  strm->adler to the Adler-32 checksum of all output produced so far (that is,
-  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
-  below.  At the end of the stream, inflate() checks that its computed adler32
-  checksum is equal to that saved by the compressor and returns Z_STREAM_END
-  only if the checksum is correct.
-
-    inflate() can decompress and check either zlib-wrapped or gzip-wrapped
-  deflate data.  The header type is detected automatically, if requested when
-  initializing with inflateInit2().  Any information contained in the gzip
-  header is not retained, so applications that need that information should
-  instead use raw inflate, see inflateInit2() below, or inflateBack() and
-  perform their own processing of the gzip header and trailer.  When processing
-  gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
-  producted so far.  The CRC-32 is checked against the gzip trailer.
-
-    inflate() returns Z_OK if some progress has been made (more input processed
-  or more output produced), Z_STREAM_END if the end of the compressed data has
-  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
-  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
-  corrupted (input stream not conforming to the zlib format or incorrect check
-  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
-  next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
-  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
-  output buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and
-  inflate() can be called again with more input and more output space to
-  continue decompressing.  If Z_DATA_ERROR is returned, the application may
-  then call inflateSync() to look for a good compression block if a partial
-  recovery of the data is desired.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any pending
-   output.
-
-     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
-   was inconsistent.  In the error case, msg may be set but then points to a
-   static string (which must not be deallocated).
-*/
-
-
-                        /* Advanced functions */
-
-/*
-    The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
-                                     int  level,
-                                     int  method,
-                                     int  windowBits,
-                                     int  memLevel,
-                                     int  strategy));
-
-     This is another version of deflateInit with more compression options.  The
-   fields next_in, zalloc, zfree and opaque must be initialized before by the
-   caller.
-
-     The method parameter is the compression method.  It must be Z_DEFLATED in
-   this version of the library.
-
-     The windowBits parameter is the base two logarithm of the window size
-   (the size of the history buffer).  It should be in the range 8..15 for this
-   version of the library.  Larger values of this parameter result in better
-   compression at the expense of memory usage.  The default value is 15 if
-   deflateInit is used instead.
-
-     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits
-   determines the window size.  deflate() will then generate raw deflate data
-   with no zlib header or trailer, and will not compute an adler32 check value.
-
-     windowBits can also be greater than 15 for optional gzip encoding.  Add
-   16 to windowBits to write a simple gzip header and trailer around the
-   compressed data instead of a zlib wrapper.  The gzip header will have no
-   file name, no extra data, no comment, no modification time (set to zero), no
-   header crc, and the operating system will be set to 255 (unknown).  If a
-   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
-
-     The memLevel parameter specifies how much memory should be allocated
-   for the internal compression state.  memLevel=1 uses minimum memory but is
-   slow and reduces compression ratio; memLevel=9 uses maximum memory for
-   optimal speed.  The default value is 8.  See zconf.h for total memory usage
-   as a function of windowBits and memLevel.
-
-     The strategy parameter is used to tune the compression algorithm.  Use the
-   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
-   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
-   string match), or Z_RLE to limit match distances to one (run-length
-   encoding).  Filtered data consists mostly of small values with a somewhat
-   random distribution.  In this case, the compression algorithm is tuned to
-   compress them better.  The effect of Z_FILTERED is to force more Huffman
-   coding and less string matching; it is somewhat intermediate between
-   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as
-   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The
-   strategy parameter only affects the compression ratio but not the
-   correctness of the compressed output even if it is not set appropriately.
-   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
-   decoder for special applications.
-
-     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
-   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
-   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is
-   set to null if there is no error message.  deflateInit2 does not perform any
-   compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
-                                             const Bytef *dictionary,
-                                             uInt  dictLength));
-/*
-     Initializes the compression dictionary from the given byte sequence
-   without producing any compressed output.  When using the zlib format, this
-   function must be called immediately after deflateInit, deflateInit2 or
-   deflateReset, and before any call of deflate.  When doing raw deflate, this
-   function must be called either before any call of deflate, or immediately
-   after the completion of a deflate block, i.e. after all input has been
-   consumed and all output has been delivered when using any of the flush
-   options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH.  The
-   compressor and decompressor must use exactly the same dictionary (see
-   inflateSetDictionary).
-
-     The dictionary should consist of strings (byte sequences) that are likely
-   to be encountered later in the data to be compressed, with the most commonly
-   used strings preferably put towards the end of the dictionary.  Using a
-   dictionary is most useful when the data to be compressed is short and can be
-   predicted with good accuracy; the data can then be compressed better than
-   with the default empty dictionary.
-
-     Depending on the size of the compression data structures selected by
-   deflateInit or deflateInit2, a part of the dictionary may in effect be
-   discarded, for example if the dictionary is larger than the window size
-   provided in deflateInit or deflateInit2.  Thus the strings most likely to be
-   useful should be put at the end of the dictionary, not at the front.  In
-   addition, the current implementation of deflate will use at most the window
-   size minus 262 bytes of the provided dictionary.
-
-     Upon return of this function, strm->adler is set to the adler32 value
-   of the dictionary; the decompressor may later use this value to determine
-   which dictionary has been used by the compressor.  (The adler32 value
-   applies to the whole dictionary even if only a subset of the dictionary is
-   actually used by the compressor.) If a raw deflate was requested, then the
-   adler32 value is not computed and strm->adler is not set.
-
-     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
-   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
-   inconsistent (for example if deflate has already been called for this stream
-   or if not at a block boundary for raw deflate).  deflateSetDictionary does
-   not perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
-                                    z_streamp source));
-/*
-     Sets the destination stream as a complete copy of the source stream.
-
-     This function can be useful when several compression strategies will be
-   tried, for example when there are several ways of pre-processing the input
-   data with a filter.  The streams that will be discarded should then be freed
-   by calling deflateEnd.  Note that deflateCopy duplicates the internal
-   compression state which can be quite large, so this strategy is slow and can
-   consume lots of memory.
-
-     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
-   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
-   destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
-     This function is equivalent to deflateEnd followed by deflateInit,
-   but does not free and reallocate all the internal compression state.  The
-   stream will keep the same compression level and any other attributes that
-   may have been set by deflateInit2.
-
-     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
-                                      int level,
-                                      int strategy));
-/*
-     Dynamically update the compression level and compression strategy.  The
-   interpretation of level and strategy is as in deflateInit2.  This can be
-   used to switch between compression and straight copy of the input data, or
-   to switch to a different kind of input data requiring a different strategy.
-   If the compression level is changed, the input available so far is
-   compressed with the old level (and may be flushed); the new level will take
-   effect only at the next call of deflate().
-
-     Before the call of deflateParams, the stream state must be set as for
-   a call of deflate(), since the currently available input may have to be
-   compressed and flushed.  In particular, strm->avail_out must be non-zero.
-
-     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
-   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
-   strm->avail_out was zero.
-*/
-
-ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
-                                    int good_length,
-                                    int max_lazy,
-                                    int nice_length,
-                                    int max_chain));
-/*
-     Fine tune deflate's internal compression parameters.  This should only be
-   used by someone who understands the algorithm used by zlib's deflate for
-   searching for the best matching string, and even then only by the most
-   fanatic optimizer trying to squeeze out the last compressed bit for their
-   specific input data.  Read the deflate.c source code for the meaning of the
-   max_lazy, good_length, nice_length, and max_chain parameters.
-
-     deflateTune() can be called after deflateInit() or deflateInit2(), and
-   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
- */
-
-ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
-                                       uLong sourceLen));
-/*
-     deflateBound() returns an upper bound on the compressed size after
-   deflation of sourceLen bytes.  It must be called after deflateInit() or
-   deflateInit2(), and after deflateSetHeader(), if used.  This would be used
-   to allocate an output buffer for deflation in a single pass, and so would be
-   called before deflate().  If that first deflate() call is provided the
-   sourceLen input bytes, an output buffer allocated to the size returned by
-   deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
-   to return Z_STREAM_END.  Note that it is possible for the compressed size to
-   be larger than the value returned by deflateBound() if flush options other
-   than Z_FINISH or Z_NO_FLUSH are used.
-*/
-
-ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
-                                       unsigned *pending,
-                                       int *bits));
-/*
-     deflatePending() returns the number of bytes and bits of output that have
-   been generated, but not yet provided in the available output.  The bytes not
-   provided would be due to the available output space having being consumed.
-   The number of bits of output not provided are between 0 and 7, where they
-   await more bits to join them in order to fill out a full byte.  If pending
-   or bits are Z_NULL, then those values are not set.
-
-     deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
- */
-
-ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
-                                     int bits,
-                                     int value));
-/*
-     deflatePrime() inserts bits in the deflate output stream.  The intent
-   is that this function is used to start off the deflate output with the bits
-   leftover from a previous deflate stream when appending to it.  As such, this
-   function can only be used for raw deflate, and must be used before the first
-   deflate() call after a deflateInit2() or deflateReset().  bits must be less
-   than or equal to 16, and that many of the least significant bits of value
-   will be inserted in the output.
-
-     deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
-   room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
-   source stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
-                                         gz_headerp head));
-/*
-     deflateSetHeader() provides gzip header information for when a gzip
-   stream is requested by deflateInit2().  deflateSetHeader() may be called
-   after deflateInit2() or deflateReset() and before the first call of
-   deflate().  The text, time, os, extra field, name, and comment information
-   in the provided gz_header structure are written to the gzip header (xflag is
-   ignored -- the extra flags are set according to the compression level).  The
-   caller must assure that, if not Z_NULL, name and comment are terminated with
-   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
-   available there.  If hcrc is true, a gzip header crc is included.  Note that
-   the current versions of the command-line version of gzip (up through version
-   1.3.x) do not support header crc's, and will report that it is a "multi-part
-   gzip file" and give up.
-
-     If deflateSetHeader is not used, the default gzip header has text false,
-   the time set to zero, and os set to 255, with no extra, name, or comment
-   fields.  The gzip header is returned to the default state by deflateReset().
-
-     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
-                                     int  windowBits));
-
-     This is another version of inflateInit with an extra parameter.  The
-   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
-   before by the caller.
-
-     The windowBits parameter is the base two logarithm of the maximum window
-   size (the size of the history buffer).  It should be in the range 8..15 for
-   this version of the library.  The default value is 15 if inflateInit is used
-   instead.  windowBits must be greater than or equal to the windowBits value
-   provided to deflateInit2() while compressing, or it must be equal to 15 if
-   deflateInit2() was not used.  If a compressed stream with a larger window
-   size is given as input, inflate() will return with the error code
-   Z_DATA_ERROR instead of trying to allocate a larger window.
-
-     windowBits can also be zero to request that inflate use the window size in
-   the zlib header of the compressed stream.
-
-     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits
-   determines the window size.  inflate() will then process raw deflate data,
-   not looking for a zlib or gzip header, not generating a check value, and not
-   looking for any check values for comparison at the end of the stream.  This
-   is for use with other formats that use the deflate compressed data format
-   such as zip.  Those formats provide their own check values.  If a custom
-   format is developed using the raw deflate format for compressed data, it is
-   recommended that a check value such as an adler32 or a crc32 be applied to
-   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
-   most applications, the zlib format should be used as is.  Note that comments
-   above on the use in deflateInit2() applies to the magnitude of windowBits.
-
-     windowBits can also be greater than 15 for optional gzip decoding.  Add
-   32 to windowBits to enable zlib and gzip decoding with automatic header
-   detection, or add 16 to decode only the gzip format (the zlib format will
-   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a
-   crc32 instead of an adler32.
-
-     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
-   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
-   invalid, such as a null pointer to the structure.  msg is set to null if
-   there is no error message.  inflateInit2 does not perform any decompression
-   apart from possibly reading the zlib header if present: actual decompression
-   will be done by inflate().  (So next_in and avail_in may be modified, but
-   next_out and avail_out are unused and unchanged.) The current implementation
-   of inflateInit2() does not process any header information -- that is
-   deferred until inflate() is called.
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
-                                             const Bytef *dictionary,
-                                             uInt  dictLength));
-/*
-     Initializes the decompression dictionary from the given uncompressed byte
-   sequence.  This function must be called immediately after a call of inflate,
-   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor
-   can be determined from the adler32 value returned by that call of inflate.
-   The compressor and decompressor must use exactly the same dictionary (see
-   deflateSetDictionary).  For raw inflate, this function can be called at any
-   time to set the dictionary.  If the provided dictionary is smaller than the
-   window and there is already data in the window, then the provided dictionary
-   will amend what's there.  The application must insure that the dictionary
-   that was used for compression is provided.
-
-     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
-   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
-   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
-   expected one (incorrect adler32 value).  inflateSetDictionary does not
-   perform any decompression: this will be done by subsequent calls of
-   inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
-                                             Bytef *dictionary,
-                                             uInt  *dictLength));
-/*
-     Returns the sliding dictionary being maintained by inflate.  dictLength is
-   set to the number of bytes in the dictionary, and that many bytes are copied
-   to dictionary.  dictionary must have enough space, where 32768 bytes is
-   always enough.  If inflateGetDictionary() is called with dictionary equal to
-   Z_NULL, then only the dictionary length is returned, and nothing is copied.
-   Similary, if dictLength is Z_NULL, then it is not set.
-
-     inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
-   stream state is inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/*
-     Skips invalid compressed data until a possible full flush point (see above
-   for the description of deflate with Z_FULL_FLUSH) can be found, or until all
-   available input is skipped.  No output is provided.
-
-     inflateSync searches for a 00 00 FF FF pattern in the compressed data.
-   All full flush points have this pattern, but not all occurrences of this
-   pattern are full flush points.
-
-     inflateSync returns Z_OK if a possible full flush point has been found,
-   Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
-   has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
-   In the success case, the application may save the current current value of
-   total_in which indicates where valid compressed data was found.  In the
-   error case, the application may repeatedly call inflateSync, providing more
-   input each time, until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
-                                    z_streamp source));
-/*
-     Sets the destination stream as a complete copy of the source stream.
-
-     This function can be useful when randomly accessing a large stream.  The
-   first pass through the stream can periodically record the inflate state,
-   allowing restarting inflate at those points when randomly accessing the
-   stream.
-
-     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
-   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
-   destination.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
-     This function is equivalent to inflateEnd followed by inflateInit,
-   but does not free and reallocate all the internal decompression state.  The
-   stream will keep attributes that may have been set by inflateInit2.
-
-     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
-                                      int windowBits));
-/*
-     This function is the same as inflateReset, but it also permits changing
-   the wrap and window size requests.  The windowBits parameter is interpreted
-   the same as it is for inflateInit2.
-
-     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being Z_NULL), or if
-   the windowBits parameter is invalid.
-*/
-
-ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
-                                     int bits,
-                                     int value));
-/*
-     This function inserts bits in the inflate input stream.  The intent is
-   that this function is used to start inflating at a bit position in the
-   middle of a byte.  The provided bits will be used before any bytes are used
-   from next_in.  This function should only be used with raw inflate, and
-   should be used before the first inflate() call after inflateInit2() or
-   inflateReset().  bits must be less than or equal to 16, and that many of the
-   least significant bits of value will be inserted in the input.
-
-     If bits is negative, then the input stream bit buffer is emptied.  Then
-   inflatePrime() can be called again to put bits in the buffer.  This is used
-   to clear out bits leftover after feeding inflate a block description prior
-   to feeding inflate codes.
-
-     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
-/*
-     This function returns two values, one in the lower 16 bits of the return
-   value, and the other in the remaining upper bits, obtained by shifting the
-   return value down 16 bits.  If the upper value is -1 and the lower value is
-   zero, then inflate() is currently decoding information outside of a block.
-   If the upper value is -1 and the lower value is non-zero, then inflate is in
-   the middle of a stored block, with the lower value equaling the number of
-   bytes from the input remaining to copy.  If the upper value is not -1, then
-   it is the number of bits back from the current bit position in the input of
-   the code (literal or length/distance pair) currently being processed.  In
-   that case the lower value is the number of bytes already emitted for that
-   code.
-
-     A code is being processed if inflate is waiting for more input to complete
-   decoding of the code, or if it has completed decoding but is waiting for
-   more output space to write the literal or match data.
-
-     inflateMark() is used to mark locations in the input data for random
-   access, which may be at bit positions, and to note those cases where the
-   output of a code may span boundaries of random access blocks.  The current
-   location in the input stream can be determined from avail_in and data_type
-   as noted in the description for the Z_BLOCK flush parameter for inflate.
-
-     inflateMark returns the value noted above or -1 << 16 if the provided
-   source stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
-                                         gz_headerp head));
-/*
-     inflateGetHeader() requests that gzip header information be stored in the
-   provided gz_header structure.  inflateGetHeader() may be called after
-   inflateInit2() or inflateReset(), and before the first call of inflate().
-   As inflate() processes the gzip stream, head->done is zero until the header
-   is completed, at which time head->done is set to one.  If a zlib stream is
-   being decoded, then head->done is set to -1 to indicate that there will be
-   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
-   used to force inflate() to return immediately after header processing is
-   complete and before any actual data is decompressed.
-
-     The text, time, xflags, and os fields are filled in with the gzip header
-   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
-   was valid if done is set to one.) If extra is not Z_NULL, then extra_max
-   contains the maximum number of bytes to write to extra.  Once done is true,
-   extra_len contains the actual extra field length, and extra contains the
-   extra field, or that field truncated if extra_max is less than extra_len.
-   If name is not Z_NULL, then up to name_max characters are written there,
-   terminated with a zero unless the length is greater than name_max.  If
-   comment is not Z_NULL, then up to comm_max characters are written there,
-   terminated with a zero unless the length is greater than comm_max.  When any
-   of extra, name, or comment are not Z_NULL and the respective field is not
-   present in the header, then that field is set to Z_NULL to signal its
-   absence.  This allows the use of deflateSetHeader() with the returned
-   structure to duplicate the header.  However if those fields are set to
-   allocated memory, then the application will need to save those pointers
-   elsewhere so that they can be eventually freed.
-
-     If inflateGetHeader is not used, then the header information is simply
-   discarded.  The header is always checked for validity, including the header
-   CRC if present.  inflateReset() will reset the process to discard the header
-   information.  The application would need to call inflateGetHeader() again to
-   retrieve the header from the next gzip stream.
-
-     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
-                                        unsigned char FAR *window));
-
-     Initialize the internal stream state for decompression using inflateBack()
-   calls.  The fields zalloc, zfree and opaque in strm must be initialized
-   before the call.  If zalloc and zfree are Z_NULL, then the default library-
-   derived memory allocation routines are used.  windowBits is the base two
-   logarithm of the window size, in the range 8..15.  window is a caller
-   supplied buffer of that size.  Except for special applications where it is
-   assured that deflate was used with small window sizes, windowBits must be 15
-   and a 32K byte window must be supplied to be able to decompress general
-   deflate streams.
-
-     See inflateBack() for the usage of these routines.
-
-     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
-   the parameters are invalid, Z_MEM_ERROR if the internal state could not be
-   allocated, or Z_VERSION_ERROR if the version of the library does not match
-   the version of the header file.
-*/
-
-typedef unsigned (*in_func) OF((void FAR *,
-                                z_const unsigned char FAR * FAR *));
-typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
-
-ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
-                                    in_func in, void FAR *in_desc,
-                                    out_func out, void FAR *out_desc));
-/*
-     inflateBack() does a raw inflate with a single call using a call-back
-   interface for input and output.  This is potentially more efficient than
-   inflate() for file i/o applications, in that it avoids copying between the
-   output and the sliding window by simply making the window itself the output
-   buffer.  inflate() can be faster on modern CPUs when used with large
-   buffers.  inflateBack() trusts the application to not change the output
-   buffer passed by the output function, at least until inflateBack() returns.
-
-     inflateBackInit() must be called first to allocate the internal state
-   and to initialize the state with the user-provided window buffer.
-   inflateBack() may then be used multiple times to inflate a complete, raw
-   deflate stream with each call.  inflateBackEnd() is then called to free the
-   allocated state.
-
-     A raw deflate stream is one with no zlib or gzip header or trailer.
-   This routine would normally be used in a utility that reads zip or gzip
-   files and writes out uncompressed files.  The utility would decode the
-   header and process the trailer on its own, hence this routine expects only
-   the raw deflate stream to decompress.  This is different from the normal
-   behavior of inflate(), which expects either a zlib or gzip header and
-   trailer around the deflate stream.
-
-     inflateBack() uses two subroutines supplied by the caller that are then
-   called by inflateBack() for input and output.  inflateBack() calls those
-   routines until it reads a complete deflate stream and writes out all of the
-   uncompressed data, or until it encounters an error.  The function's
-   parameters and return types are defined above in the in_func and out_func
-   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
-   number of bytes of provided input, and a pointer to that input in buf.  If
-   there is no input available, in() must return zero--buf is ignored in that
-   case--and inflateBack() will return a buffer error.  inflateBack() will call
-   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
-   should return zero on success, or non-zero on failure.  If out() returns
-   non-zero, inflateBack() will return with an error.  Neither in() nor out()
-   are permitted to change the contents of the window provided to
-   inflateBackInit(), which is also the buffer that out() uses to write from.
-   The length written by out() will be at most the window size.  Any non-zero
-   amount of input may be provided by in().
-
-     For convenience, inflateBack() can be provided input on the first call by
-   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
-   in() will be called.  Therefore strm->next_in must be initialized before
-   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
-   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
-   must also be initialized, and then if strm->avail_in is not zero, input will
-   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].
-
-     The in_desc and out_desc parameters of inflateBack() is passed as the
-   first parameter of in() and out() respectively when they are called.  These
-   descriptors can be optionally used to pass any information that the caller-
-   supplied in() and out() functions need to do their job.
-
-     On return, inflateBack() will set strm->next_in and strm->avail_in to
-   pass back any unused input that was provided by the last in() call.  The
-   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
-   if in() or out() returned an error, Z_DATA_ERROR if there was a format error
-   in the deflate stream (in which case strm->msg is set to indicate the nature
-   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
-   In the case of Z_BUF_ERROR, an input or output error can be distinguished
-   using strm->next_in which will be Z_NULL only if in() returned an error.  If
-   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
-   non-zero.  (in() will always be called before out(), so strm->next_in is
-   assured to be defined if out() returns non-zero.) Note that inflateBack()
-   cannot return Z_OK.
-*/
-
-ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
-/*
-     All memory allocated by inflateBackInit() is freed.
-
-     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
-   state was inconsistent.
-*/
-
-ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
-/* Return flags indicating compile-time options.
-
-    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
-     1.0: size of uInt
-     3.2: size of uLong
-     5.4: size of voidpf (pointer)
-     7.6: size of z_off_t
-
-    Compiler, assembler, and debug options:
-     8: DEBUG
-     9: ASMV or ASMINF -- use ASM code
-     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
-     11: 0 (reserved)
-
-    One-time table building (smaller code, but not thread-safe if true):
-     12: BUILDFIXED -- build static block decoding tables when needed
-     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
-     14,15: 0 (reserved)
-
-    Library content (indicates missing functionality):
-     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
-                          deflate code when not needed)
-     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
-                    and decode gzip streams (to avoid linking crc code)
-     18-19: 0 (reserved)
-
-    Operation variations (changes in library functionality):
-     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
-     21: FASTEST -- deflate algorithm with only one, lowest compression level
-     22,23: 0 (reserved)
-
-    The sprintf variant used by gzprintf (zero is best):
-     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
-     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
-     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
-
-    Remainder:
-     27-31: 0 (reserved)
- */
-
-#ifndef Z_SOLO
-
-                        /* utility functions */
-
-/*
-     The following utility functions are implemented on top of the basic
-   stream-oriented functions.  To simplify the interface, some default options
-   are assumed (compression level and memory usage, standard memory allocation
-   functions).  The source code of these utility functions can be modified if
-   you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
-                                 const Bytef *source, uLong sourceLen));
-/*
-     Compresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer.  Upon entry, destLen is the total size
-   of the destination buffer, which must be at least the value returned by
-   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
-   compressed buffer.
-
-     compress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
-                                  const Bytef *source, uLong sourceLen,
-                                  int level));
-/*
-     Compresses the source buffer into the destination buffer.  The level
-   parameter has the same meaning as in deflateInit.  sourceLen is the byte
-   length of the source buffer.  Upon entry, destLen is the total size of the
-   destination buffer, which must be at least the value returned by
-   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
-   compressed buffer.
-
-     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
-   Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
-/*
-     compressBound() returns an upper bound on the compressed size after
-   compress() or compress2() on sourceLen bytes.  It would be used before a
-   compress() or compress2() call to allocate the destination buffer.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
-                                   const Bytef *source, uLong sourceLen));
-/*
-     Decompresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer.  Upon entry, destLen is the total size
-   of the destination buffer, which must be large enough to hold the entire
-   uncompressed data.  (The size of the uncompressed data must have been saved
-   previously by the compressor and transmitted to the decompressor by some
-   mechanism outside the scope of this compression library.) Upon exit, destLen
-   is the actual size of the uncompressed buffer.
-
-     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.  In
-   the case where there is not enough room, uncompress() will fill the output
-   buffer with the uncompressed data up to that point.
-*/
-
-                        /* gzip file access functions */
-
-/*
-     This library supports reading and writing files in gzip (.gz) format with
-   an interface similar to that of stdio, using the functions that start with
-   "gz".  The gzip format is different from the zlib format.  gzip is a gzip
-   wrapper, documented in RFC 1952, wrapped around a deflate stream.
-*/
-
-typedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */
-
-/*
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
-
-     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as
-   in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
-   a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
-   compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
-   for fixed code compression as in "wb9F".  (See the description of
-   deflateInit2 for more information about the strategy parameter.)  'T' will
-   request transparent writing or appending with no compression and not using
-   the gzip format.
-
-     "a" can be used instead of "w" to request that the gzip stream that will
-   be written be appended to the file.  "+" will result in an error, since
-   reading and writing to the same gzip file is not supported.  The addition of
-   "x" when writing will create the file exclusively, which fails if the file
-   already exists.  On systems that support it, the addition of "e" when
-   reading or writing will set the flag to close the file on an execve() call.
-
-     These functions, as well as gzip, will read and decode a sequence of gzip
-   streams in a file.  The append function of gzopen() can be used to create
-   such a file.  (Also see gzflush() for another way to do this.)  When
-   appending, gzopen does not test whether the file begins with a gzip stream,
-   nor does it look for the end of the gzip streams to begin appending.  gzopen
-   will simply append a gzip stream to the existing file.
-
-     gzopen can be used to read a file which is not in gzip format; in this
-   case gzread will directly read from the file without decompression.  When
-   reading, this will be detected automatically by looking for the magic two-
-   byte gzip header.
-
-     gzopen returns NULL if the file could not be opened, if there was
-   insufficient memory to allocate the gzFile state, or if an invalid mode was
-   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
-   errno can be checked to determine if the reason gzopen failed was that the
-   file could not be opened.
-*/
-
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
-/*
-     gzdopen associates a gzFile with the file descriptor fd.  File descriptors
-   are obtained from calls like open, dup, creat, pipe or fileno (if the file
-   has been previously opened with fopen).  The mode parameter is as in gzopen.
-
-     The next call of gzclose on the returned gzFile will also close the file
-   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
-   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
-   mode);.  The duplicated descriptor should be saved to avoid a leak, since
-   gzdopen does not close fd if it fails.  If you are using fileno() to get the
-   file descriptor from a FILE *, then you will have to use dup() to avoid
-   double-close()ing the file descriptor.  Both gzclose() and fclose() will
-   close the associated file descriptor, so they need to have different file
-   descriptors.
-
-     gzdopen returns NULL if there was insufficient memory to allocate the
-   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
-   provided, or '+' was provided), or if fd is -1.  The file descriptor is not
-   used until the next gz* read, write, seek, or close operation, so gzdopen
-   will not detect if fd is invalid (unless fd is -1).
-*/
-
-ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
-/*
-     Set the internal buffer size used by this library's functions.  The
-   default buffer size is 8192 bytes.  This function must be called after
-   gzopen() or gzdopen(), and before any other calls that read or write the
-   file.  The buffer memory allocation is always deferred to the first read or
-   write.  Two buffers are allocated, either both of the specified size when
-   writing, or one of the specified size and the other twice that size when
-   reading.  A larger buffer size of, for example, 64K or 128K bytes will
-   noticeably increase the speed of decompression (reading).
-
-     The new buffer size also affects the maximum length for gzprintf().
-
-     gzbuffer() returns 0 on success, or -1 on failure, such as being called
-   too late.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
-     Dynamically update the compression level or strategy.  See the description
-   of deflateInit2 for the meaning of these parameters.
-
-     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
-   opened for writing.
-*/
-
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
-/*
-     Reads the given number of uncompressed bytes from the compressed file.  If
-   the input file is not in gzip format, gzread copies the given number of
-   bytes into the buffer directly from the file.
-
-     After reaching the end of a gzip stream in the input, gzread will continue
-   to read, looking for another gzip stream.  Any number of gzip streams may be
-   concatenated in the input file, and will all be decompressed by gzread().
-   If something other than a gzip stream is encountered after a gzip stream,
-   that remaining trailing garbage is ignored (and no error is returned).
-
-     gzread can be used to read a gzip file that is being concurrently written.
-   Upon reaching the end of the input, gzread will return with the available
-   data.  If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
-   gzclearerr can be used to clear the end of file indicator in order to permit
-   gzread to be tried again.  Z_OK indicates that a gzip stream was completed
-   on the last gzread.  Z_BUF_ERROR indicates that the input file ended in the
-   middle of a gzip stream.  Note that gzread does not return -1 in the event
-   of an incomplete gzip stream.  This error is deferred until gzclose(), which
-   will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
-   stream.  Alternatively, gzerror can be used before gzclose to detect this
-   case.
-
-     gzread returns the number of uncompressed bytes actually read, less than
-   len for end of file, or -1 for error.
-*/
-
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
-                                voidpc buf, unsigned len));
-/*
-     Writes the given number of uncompressed bytes into the compressed file.
-   gzwrite returns the number of uncompressed bytes written or 0 in case of
-   error.
-*/
-
-ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
-/*
-     Converts, formats, and writes the arguments to the compressed file under
-   control of the format string, as in fprintf.  gzprintf returns the number of
-   uncompressed bytes actually written, or 0 in case of error.  The number of
-   uncompressed bytes written is limited to 8191, or one less than the buffer
-   size given to gzbuffer().  The caller should assure that this limit is not
-   exceeded.  If it is exceeded, then gzprintf() will return an error (0) with
-   nothing written.  In this case, there may also be a buffer overflow with
-   unpredictable consequences, which is possible only if zlib was compiled with
-   the insecure functions sprintf() or vsprintf() because the secure snprintf()
-   or vsnprintf() functions were not available.  This can be determined using
-   zlibCompileFlags().
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
-     Writes the given null-terminated string to the compressed file, excluding
-   the terminating null character.
-
-     gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
-     Reads bytes from the compressed file until len-1 characters are read, or a
-   newline character is read and transferred to buf, or an end-of-file
-   condition is encountered.  If any characters are read or if len == 1, the
-   string is terminated with a null character.  If no characters are read due
-   to an end-of-file or len < 1, then the buffer is left untouched.
-
-     gzgets returns buf which is a null-terminated string, or it returns NULL
-   for end-of-file or in case of error.  If there was an error, the contents at
-   buf are indeterminate.
-*/
-
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
-/*
-     Writes c, converted to an unsigned char, into the compressed file.  gzputc
-   returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
-/*
-     Reads one byte from the compressed file.  gzgetc returns this byte or -1
-   in case of end of file or error.  This is implemented as a macro for speed.
-   As such, it does not do all of the checking the other functions do.  I.e.
-   it does not check to see if file is NULL, nor whether the structure file
-   points to has been clobbered or not.
-*/
-
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
-/*
-     Push one character back onto the stream to be read as the first character
-   on the next read.  At least one character of push-back is allowed.
-   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will
-   fail if c is -1, and may fail if a character has been pushed but not read
-   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the
-   output buffer size of pushed characters is allowed.  (See gzbuffer above.)
-   The pushed character will be discarded if the stream is repositioned with
-   gzseek() or gzrewind().
-*/
-
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
-/*
-     Flushes all pending output into the compressed file.  The parameter flush
-   is as in the deflate() function.  The return value is the zlib error number
-   (see function gzerror below).  gzflush is only permitted when writing.
-
-     If the flush parameter is Z_FINISH, the remaining data is written and the
-   gzip stream is completed in the output.  If gzwrite() is called again, a new
-   gzip stream will be started in the output.  gzread() is able to read such
-   concatented gzip streams.
-
-     gzflush should be called only when strictly necessary because it will
-   degrade compression if called too often.
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
-                                   z_off_t offset, int whence));
-
-     Sets the starting position for the next gzread or gzwrite on the given
-   compressed file.  The offset represents a number of bytes in the
-   uncompressed data stream.  The whence parameter is defined as in lseek(2);
-   the value SEEK_END is not supported.
-
-     If the file is opened for reading, this function is emulated but can be
-   extremely slow.  If the file is opened for writing, only forward seeks are
-   supported; gzseek then compresses a sequence of zeroes up to the new
-   starting position.
-
-     gzseek returns the resulting offset location as measured in bytes from
-   the beginning of the uncompressed stream, or -1 in case of error, in
-   particular if the file is opened for writing and the new starting position
-   would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
-/*
-     Rewinds the given file. This function is supported only for reading.
-
-     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
-
-     Returns the starting position for the next gzread or gzwrite on the given
-   compressed file.  This position represents a number of bytes in the
-   uncompressed data stream, and is zero when starting, even if appending or
-   reading a gzip stream from the middle of a file using gzdopen().
-
-     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
-
-     Returns the current offset in the file being read or written.  This offset
-   includes the count of bytes that precede the gzip stream, for example when
-   appending or when using gzdopen() for reading.  When reading, the offset
-   does not include as yet unused buffered input.  This information can be used
-   for a progress indicator.  On error, gzoffset() returns -1.
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
-     Returns true (1) if the end-of-file indicator has been set while reading,
-   false (0) otherwise.  Note that the end-of-file indicator is set only if the
-   read tried to go past the end of the input, but came up short.  Therefore,
-   just like feof(), gzeof() may return false even if there is no more data to
-   read, in the event that the last read request was for the exact number of
-   bytes remaining in the input file.  This will happen if the input file size
-   is an exact multiple of the buffer size.
-
-     If gzeof() returns true, then the read functions will return no more data,
-   unless the end-of-file indicator is reset by gzclearerr() and the input file
-   has grown since the previous end of file was detected.
-*/
-
-ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
-/*
-     Returns true (1) if file is being copied directly while reading, or false
-   (0) if file is a gzip stream being decompressed.
-
-     If the input file is empty, gzdirect() will return true, since the input
-   does not contain a gzip stream.
-
-     If gzdirect() is used immediately after gzopen() or gzdopen() it will
-   cause buffers to be allocated to allow reading the file to determine if it
-   is a gzip file.  Therefore if gzbuffer() is used, it should be called before
-   gzdirect().
-
-     When writing, gzdirect() returns true (1) if transparent writing was
-   requested ("wT" for the gzopen() mode), or false (0) otherwise.  (Note:
-   gzdirect() is not needed when writing.  Transparent writing must be
-   explicitly requested, so the application already knows the answer.  When
-   linking statically, using gzdirect() will include all of the zlib code for
-   gzip file reading and decompression, which may not be desired.)
-*/
-
-ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
-/*
-     Flushes all pending output if necessary, closes the compressed file and
-   deallocates the (de)compression state.  Note that once file is closed, you
-   cannot call gzerror with file, since its structures have been deallocated.
-   gzclose must not be called more than once on the same file, just as free
-   must not be called more than once on the same allocation.
-
-     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
-   file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
-   last read ended in the middle of a gzip stream, or Z_OK on success.
-*/
-
-ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
-ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
-/*
-     Same as gzclose(), but gzclose_r() is only for use when reading, and
-   gzclose_w() is only for use when writing or appending.  The advantage to
-   using these instead of gzclose() is that they avoid linking in zlib
-   compression or decompression code that is not used when only reading or only
-   writing respectively.  If gzclose() is used, then both compression and
-   decompression code will be included the application when linking to a static
-   zlib library.
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
-     Returns the error message for the last error which occurred on the given
-   compressed file.  errnum is set to zlib error number.  If an error occurred
-   in the file system and not in the compression library, errnum is set to
-   Z_ERRNO and the application may consult errno to get the exact error code.
-
-     The application must not modify the returned string.  Future calls to
-   this function may invalidate the previously returned string.  If file is
-   closed, then the string previously returned by gzerror will no longer be
-   available.
-
-     gzerror() should be used to distinguish errors from end-of-file for those
-   functions above that do not distinguish those cases in their return values.
-*/
-
-ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
-/*
-     Clears the error and end-of-file flags for file.  This is analogous to the
-   clearerr() function in stdio.  This is useful for continuing to read a gzip
-   file that is being written concurrently.
-*/
-
-#endif /* !Z_SOLO */
-
-                        /* checksum functions */
-
-/*
-     These functions are not related to compression but are exported
-   anyway because they might be useful in applications using the compression
-   library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-/*
-     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
-   return the updated checksum.  If buf is Z_NULL, this function returns the
-   required initial value for the checksum.
-
-     An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
-   much faster.
-
-   Usage example:
-
-     uLong adler = adler32(0L, Z_NULL, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       adler = adler32(adler, buffer, length);
-     }
-     if (adler != original_adler) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
-                                          z_off_t len2));
-
-     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
-   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
-   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
-   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.  Note
-   that the z_off_t type (like off_t) is a signed integer.  If len2 is
-   negative, the result has no meaning or utility.
-*/
-
-ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
-/*
-     Update a running CRC-32 with the bytes buf[0..len-1] and return the
-   updated CRC-32.  If buf is Z_NULL, this function returns the required
-   initial value for the crc.  Pre- and post-conditioning (one's complement) is
-   performed within this function so it shouldn't be done by the application.
-
-   Usage example:
-
-     uLong crc = crc32(0L, Z_NULL, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       crc = crc32(crc, buffer, length);
-     }
-     if (crc != original_crc) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
-
-     Combine two CRC-32 check values into one.  For two sequences of bytes,
-   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
-   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
-   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
-   len2.
-*/
-
-
-                        /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
-                                     const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
-                                     const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
-                                      int windowBits, int memLevel,
-                                      int strategy, const char *version,
-                                      int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
-                                      const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
-                                         unsigned char FAR *window,
-                                         const char *version,
-                                         int stream_size));
-#define deflateInit(strm, level) \
-        deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
-#define inflateInit(strm) \
-        inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
-        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
-                      (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
-        inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
-                      (int)sizeof(z_stream))
-#define inflateBackInit(strm, windowBits, window) \
-        inflateBackInit_((strm), (windowBits), (window), \
-                      ZLIB_VERSION, (int)sizeof(z_stream))
-
-#ifndef Z_SOLO
-
-/* gzgetc() macro and its supporting function and exposed data structure.  Note
- * that the real internal state is much larger than the exposed structure.
- * This abbreviated structure exposes just enough for the gzgetc() macro.  The
- * user should not mess with these exposed elements, since their names or
- * behavior could change in the future, perhaps even capriciously.  They can
- * only be used by the gzgetc() macro.  You have been warned.
- */
-struct gzFile_s {
-    unsigned have;
-    unsigned char *next;
-    z_off64_t pos;
-};
-ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */
-#ifdef Z_PREFIX_SET
-#  undef z_gzgetc
-#  define z_gzgetc(g) \
-          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
-#else
-#  define gzgetc(g) \
-          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
-#endif
-
-/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
- * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
- * both are true, the application gets the *64 functions, and the regular
- * functions are changed to 64 bits) -- in case these are set on systems
- * without large file support, _LFS64_LARGEFILE must also be true
- */
-#ifdef Z_LARGE64
-   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
-   ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
-   ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
-   ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
-   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
-   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
-#endif
-
-#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
-#  ifdef Z_PREFIX_SET
-#    define z_gzopen z_gzopen64
-#    define z_gzseek z_gzseek64
-#    define z_gztell z_gztell64
-#    define z_gzoffset z_gzoffset64
-#    define z_adler32_combine z_adler32_combine64
-#    define z_crc32_combine z_crc32_combine64
-#  else
-#    define gzopen gzopen64
-#    define gzseek gzseek64
-#    define gztell gztell64
-#    define gzoffset gzoffset64
-#    define adler32_combine adler32_combine64
-#    define crc32_combine crc32_combine64
-#  endif
-#  ifndef Z_LARGE64
-     ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
-     ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
-     ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
-     ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
-     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
-     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
-#  endif
-#else
-   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
-   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
-   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
-   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
-   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
-   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
-#endif
-
-#else /* Z_SOLO */
-
-   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
-   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
-
-#endif /* !Z_SOLO */
-
-/* hack for buggy compilers */
-#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
-    struct internal_state {int dummy;};
-#endif
-
-/* undocumented functions */
-ZEXTERN const char   * ZEXPORT zError           OF((int));
-ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
-ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));
-ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
-ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
-ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
-#if defined(_WIN32) && !defined(Z_SOLO)
-ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
-                                            const char *mode));
-#endif
-#if defined(STDC) || defined(Z_HAVE_STDARG_H)
-#  ifndef Z_SOLO
-ZEXTERN int            ZEXPORTVA gzvprintf Z_ARG((gzFile file,
-                                                  const char *format,
-                                                  va_list va));
-#  endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZLIB_H */
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.c b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.c
deleted file mode 100644
index e543476..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#include "zutil.h"
-#ifndef Z_SOLO
-#  include "gzguts.h"
-#endif
-
-#ifndef NO_DUMMY_DECL
-struct internal_state      {int dummy;}; /* for buggy compilers */
-#endif
-
-z_const char * const z_errmsg[10] = {
-"need dictionary",     /* Z_NEED_DICT       2  */
-"stream end",          /* Z_STREAM_END      1  */
-"",                    /* Z_OK              0  */
-"file error",          /* Z_ERRNO         (-1) */
-"stream error",        /* Z_STREAM_ERROR  (-2) */
-"data error",          /* Z_DATA_ERROR    (-3) */
-"insufficient memory", /* Z_MEM_ERROR     (-4) */
-"buffer error",        /* Z_BUF_ERROR     (-5) */
-"incompatible version",/* Z_VERSION_ERROR (-6) */
-""};
-
-
-const char * ZEXPORT zlibVersion()
-{
-    return ZLIB_VERSION;
-}
-
-uLong ZEXPORT zlibCompileFlags()
-{
-    uLong flags;
-
-    flags = 0;
-    switch ((int)(sizeof(uInt))) {
-    case 2:     break;
-    case 4:     flags += 1;     break;
-    case 8:     flags += 2;     break;
-    default:    flags += 3;
-    }
-    switch ((int)(sizeof(uLong))) {
-    case 2:     break;
-    case 4:     flags += 1 << 2;        break;
-    case 8:     flags += 2 << 2;        break;
-    default:    flags += 3 << 2;
-    }
-    switch ((int)(sizeof(voidpf))) {
-    case 2:     break;
-    case 4:     flags += 1 << 4;        break;
-    case 8:     flags += 2 << 4;        break;
-    default:    flags += 3 << 4;
-    }
-    switch ((int)(sizeof(z_off_t))) {
-    case 2:     break;
-    case 4:     flags += 1 << 6;        break;
-    case 8:     flags += 2 << 6;        break;
-    default:    flags += 3 << 6;
-    }
-#ifdef DEBUG
-    flags += 1 << 8;
-#endif
-#if defined(ASMV) || defined(ASMINF)
-    flags += 1 << 9;
-#endif
-#ifdef ZLIB_WINAPI
-    flags += 1 << 10;
-#endif
-#ifdef BUILDFIXED
-    flags += 1 << 12;
-#endif
-#ifdef DYNAMIC_CRC_TABLE
-    flags += 1 << 13;
-#endif
-#ifdef NO_GZCOMPRESS
-    flags += 1L << 16;
-#endif
-#ifdef NO_GZIP
-    flags += 1L << 17;
-#endif
-#ifdef PKZIP_BUG_WORKAROUND
-    flags += 1L << 20;
-#endif
-#ifdef FASTEST
-    flags += 1L << 21;
-#endif
-#if defined(STDC) || defined(Z_HAVE_STDARG_H)
-#  ifdef NO_vsnprintf
-    flags += 1L << 25;
-#    ifdef HAS_vsprintf_void
-    flags += 1L << 26;
-#    endif
-#  else
-#    ifdef HAS_vsnprintf_void
-    flags += 1L << 26;
-#    endif
-#  endif
-#else
-    flags += 1L << 24;
-#  ifdef NO_snprintf
-    flags += 1L << 25;
-#    ifdef HAS_sprintf_void
-    flags += 1L << 26;
-#    endif
-#  else
-#    ifdef HAS_snprintf_void
-    flags += 1L << 26;
-#    endif
-#  endif
-#endif
-    return flags;
-}
-
-#ifdef DEBUG
-
-#  ifndef verbose
-#    define verbose 0
-#  endif
-int ZLIB_INTERNAL z_verbose = verbose;
-
-void ZLIB_INTERNAL z_error (m)
-    char *m;
-{
-    fprintf(stderr, "%s\n", m);
-    exit(1);
-}
-#endif
-
-/* exported to allow conversion of error code to string for compress() and
- * uncompress()
- */
-const char * ZEXPORT zError(err)
-    int err;
-{
-    return ERR_MSG(err);
-}
-
-#if defined(_WIN32_WCE)
-    /* The Microsoft C Run-Time Library for Windows CE doesn't have
-     * errno.  We define it as a global variable to simplify porting.
-     * Its value is always 0 and should not be used.
-     */
-    int errno = 0;
-#endif
-
-#ifndef HAVE_MEMCPY
-
-void ZLIB_INTERNAL zmemcpy(dest, source, len)
-    Bytef* dest;
-    const Bytef* source;
-    uInt  len;
-{
-    if (len == 0) return;
-    do {
-        *dest++ = *source++; /* ??? to be unrolled */
-    } while (--len != 0);
-}
-
-int ZLIB_INTERNAL zmemcmp(s1, s2, len)
-    const Bytef* s1;
-    const Bytef* s2;
-    uInt  len;
-{
-    uInt j;
-
-    for (j = 0; j < len; j++) {
-        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
-    }
-    return 0;
-}
-
-void ZLIB_INTERNAL zmemzero(dest, len)
-    Bytef* dest;
-    uInt  len;
-{
-    if (len == 0) return;
-    do {
-        *dest++ = 0;  /* ??? to be unrolled */
-    } while (--len != 0);
-}
-#endif
-
-#ifndef Z_SOLO
-
-#ifdef SYS16BIT
-
-#ifdef __TURBOC__
-/* Turbo C in 16-bit mode */
-
-#  define MY_ZCALLOC
-
-/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
- * and farmalloc(64K) returns a pointer with an offset of 8, so we
- * must fix the pointer. Warning: the pointer must be put back to its
- * original form in order to free it, use zcfree().
- */
-
-#define MAX_PTR 10
-/* 10*64K = 640K */
-
-local int next_ptr = 0;
-
-typedef struct ptr_table_s {
-    voidpf org_ptr;
-    voidpf new_ptr;
-} ptr_table;
-
-local ptr_table table[MAX_PTR];
-/* This table is used to remember the original form of pointers
- * to large buffers (64K). Such pointers are normalized with a zero offset.
- * Since MSDOS is not a preemptive multitasking OS, this table is not
- * protected from concurrent access. This hack doesn't work anyway on
- * a protected system like OS/2. Use Microsoft C instead.
- */
-
-voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
-{
-    voidpf buf = opaque; /* just to make some compilers happy */
-    ulg bsize = (ulg)items*size;
-
-    /* If we allocate less than 65520 bytes, we assume that farmalloc
-     * will return a usable pointer which doesn't have to be normalized.
-     */
-    if (bsize < 65520L) {
-        buf = farmalloc(bsize);
-        if (*(ush*)&buf != 0) return buf;
-    } else {
-        buf = farmalloc(bsize + 16L);
-    }
-    if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
-    table[next_ptr].org_ptr = buf;
-
-    /* Normalize the pointer to seg:0 */
-    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
-    *(ush*)&buf = 0;
-    table[next_ptr++].new_ptr = buf;
-    return buf;
-}
-
-void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
-{
-    int n;
-    if (*(ush*)&ptr != 0) { /* object < 64K */
-        farfree(ptr);
-        return;
-    }
-    /* Find the original pointer */
-    for (n = 0; n < next_ptr; n++) {
-        if (ptr != table[n].new_ptr) continue;
-
-        farfree(table[n].org_ptr);
-        while (++n < next_ptr) {
-            table[n-1] = table[n];
-        }
-        next_ptr--;
-        return;
-    }
-    ptr = opaque; /* just to make some compilers happy */
-    Assert(0, "zcfree: ptr not found");
-}
-
-#endif /* __TURBOC__ */
-
-
-#ifdef M_I86
-/* Microsoft C in 16-bit mode */
-
-#  define MY_ZCALLOC
-
-#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
-#  define _halloc  halloc
-#  define _hfree   hfree
-#endif
-
-voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
-{
-    if (opaque) opaque = 0; /* to make compiler happy */
-    return _halloc((long)items, size);
-}
-
-void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
-{
-    if (opaque) opaque = 0; /* to make compiler happy */
-    _hfree(ptr);
-}
-
-#endif /* M_I86 */
-
-#endif /* SYS16BIT */
-
-
-#ifndef MY_ZCALLOC /* Any system without a special alloc function */
-
-#ifndef STDC
-extern voidp  malloc OF((uInt size));
-extern voidp  calloc OF((uInt items, uInt size));
-extern void   free   OF((voidpf ptr));
-#endif
-
-voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
-    voidpf opaque;
-    unsigned items;
-    unsigned size;
-{
-    if (opaque) items += size - size; /* make compiler happy */
-    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
-                              (voidpf)calloc(items, size);
-}
-
-void ZLIB_INTERNAL zcfree (opaque, ptr)
-    voidpf opaque;
-    voidpf ptr;
-{
-    free(ptr);
-    if (opaque) return; /* make compiler happy */
-}
-
-#endif /* MY_ZCALLOC */
-
-#endif /* !Z_SOLO */
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.h b/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.h
deleted file mode 100644
index b82b14d..0000000
--- a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2013 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
-   part of the implementation of the compression library and is
-   subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZUTIL_H
-#define ZUTIL_H
-
-#ifdef HAVE_HIDDEN
-#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
-#else
-#  define ZLIB_INTERNAL
-#endif
-
-#include "zlib.h"
-
-#if defined(STDC) && !defined(Z_SOLO)
-#  if !(defined(_WIN32_WCE) && defined(_MSC_VER))
-#    include <stddef.h>
-#  endif
-#  include <string.h>
-#  include <stdlib.h>
-#endif
-
-#ifdef Z_SOLO
-   typedef long ptrdiff_t;  /* guess -- will be caught if guess is wrong */
-#endif
-
-#ifndef local
-#  define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-typedef unsigned char  uch;
-typedef uch FAR uchf;
-typedef unsigned short ush;
-typedef ush FAR ushf;
-typedef unsigned long  ulg;
-
-extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
-/* (size given to avoid silly warnings with Visual C++) */
-
-#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
-
-#define ERR_RETURN(strm,err) \
-  return (strm->msg = ERR_MSG(err), (err))
-/* To be used only when the state is known to be valid */
-
-        /* common constants */
-
-#ifndef DEF_WBITS
-#  define DEF_WBITS MAX_WBITS
-#endif
-/* default windowBits for decompression. MAX_WBITS is for compression only */
-
-#if MAX_MEM_LEVEL >= 8
-#  define DEF_MEM_LEVEL 8
-#else
-#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
-#endif
-/* default memLevel */
-
-#define STORED_BLOCK 0
-#define STATIC_TREES 1
-#define DYN_TREES    2
-/* The three kinds of block type */
-
-#define MIN_MATCH  3
-#define MAX_MATCH  258
-/* The minimum and maximum match lengths */
-
-#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
-
-        /* target dependencies */
-
-#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
-#  define OS_CODE  0x00
-#  ifndef Z_SOLO
-#    if defined(__TURBOC__) || defined(__BORLANDC__)
-#      if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
-         /* Allow compilation with ANSI keywords only enabled */
-         void _Cdecl farfree( void *block );
-         void *_Cdecl farmalloc( unsigned long nbytes );
-#      else
-#        include <alloc.h>
-#      endif
-#    else /* MSC or DJGPP */
-#      include <malloc.h>
-#    endif
-#  endif
-#endif
-
-#ifdef AMIGA
-#  define OS_CODE  0x01
-#endif
-
-#if defined(VAXC) || defined(VMS)
-#  define OS_CODE  0x02
-#  define F_OPEN(name, mode) \
-     fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
-#endif
-
-#if defined(ATARI) || defined(atarist)
-#  define OS_CODE  0x05
-#endif
-
-#ifdef OS2
-#  define OS_CODE  0x06
-#  if defined(M_I86) && !defined(Z_SOLO)
-#    include <malloc.h>
-#  endif
-#endif
-
-#if defined(MACOS) || defined(TARGET_OS_MAC)
-#  define OS_CODE  0x07
-#  ifndef Z_SOLO
-#    if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-#      include <unix.h> /* for fdopen */
-#    else
-#      ifndef fdopen
-#        define fdopen(fd,mode) NULL /* No fdopen() */
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef TOPS20
-#  define OS_CODE  0x0a
-#endif
-
-#ifdef WIN32
-#  ifndef __CYGWIN__  /* Cygwin is Unix, not Win32 */
-#    define OS_CODE  0x0b
-#  endif
-#endif
-
-#ifdef __50SERIES /* Prime/PRIMOS */
-#  define OS_CODE  0x0f
-#endif
-
-#if defined(_BEOS_) || defined(RISCOS)
-#  define fdopen(fd,mode) NULL /* No fdopen() */
-#endif
-
-#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
-#  if defined(_WIN32_WCE)
-#    define fdopen(fd,mode) NULL /* No fdopen() */
-#    ifndef _PTRDIFF_T_DEFINED
-       typedef int ptrdiff_t;
-#      define _PTRDIFF_T_DEFINED
-#    endif
-#  else
-#    define fdopen(fd,type)  _fdopen(fd,type)
-#  endif
-#endif
-
-#if defined(__BORLANDC__) && !defined(MSDOS)
-  #pragma warn -8004
-  #pragma warn -8008
-  #pragma warn -8066
-#endif
-
-/* provide prototypes for these when building zlib without LFS */
-#if !defined(_WIN32) && \
-    (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
-    ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
-    ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
-#endif
-
-        /* common defaults */
-
-#ifndef OS_CODE
-#  define OS_CODE  0x03  /* assume Unix */
-#endif
-
-#ifndef F_OPEN
-#  define F_OPEN(name, mode) fopen((name), (mode))
-#endif
-
-         /* functions */
-
-#if defined(pyr) || defined(Z_SOLO)
-#  define NO_MEMCPY
-#endif
-#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
- /* Use our own functions for small and medium model with MSC <= 5.0.
-  * You may have to use the same strategy for Borland C (untested).
-  * The __SC__ check is for Symantec.
-  */
-#  define NO_MEMCPY
-#endif
-#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
-#  define HAVE_MEMCPY
-#endif
-#ifdef HAVE_MEMCPY
-#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */
-#    define zmemcpy _fmemcpy
-#    define zmemcmp _fmemcmp
-#    define zmemzero(dest, len) _fmemset(dest, 0, len)
-#  else
-#    define zmemcpy memcpy
-#    define zmemcmp memcmp
-#    define zmemzero(dest, len) memset(dest, 0, len)
-#  endif
-#else
-   void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
-   int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
-   void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
-#endif
-
-/* Diagnostic functions */
-#ifdef DEBUG
-#  include <stdio.h>
-   extern int ZLIB_INTERNAL z_verbose;
-   extern void ZLIB_INTERNAL z_error OF((char *m));
-#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
-#  define Trace(x) {if (z_verbose>=0) fprintf x ;}
-#  define Tracev(x) {if (z_verbose>0) fprintf x ;}
-#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}
-#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
-#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
-#else
-#  define Assert(cond,msg)
-#  define Trace(x)
-#  define Tracev(x)
-#  define Tracevv(x)
-#  define Tracec(c,x)
-#  define Tracecv(c,x)
-#endif
-
-#ifndef Z_SOLO
-   voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
-                                    unsigned size));
-   void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));
-#endif
-
-#define ZALLOC(strm, items, size) \
-           (*((strm)->zalloc))((strm)->opaque, (items), (size))
-#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
-#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
-
-/* Reverse the bytes in a 32-bit value */
-#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
-                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
-
-#endif /* ZUTIL_H */
diff --git a/jdk/src/java.base/share/native/libzip/zlib/ChangeLog b/jdk/src/java.base/share/native/libzip/zlib/ChangeLog
new file mode 100644
index 0000000..30199a6
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/ChangeLog
@@ -0,0 +1,1515 @@
+
+                ChangeLog file for zlib
+
+Changes in 1.2.11 (15 Jan 2017)
+- Fix deflate stored bug when pulling last block from window
+- Permit immediate deflateParams changes before any deflate input
+
+Changes in 1.2.10 (2 Jan 2017)
+- Avoid warnings on snprintf() return value
+- Fix bug in deflate_stored() for zero-length input
+- Fix bug in gzwrite.c that produced corrupt gzip files
+- Remove files to be installed before copying them in Makefile.in
+- Add warnings when compiling with assembler code
+
+Changes in 1.2.9 (31 Dec 2016)
+- Fix contrib/minizip to permit unzipping with desktop API [Zouzou]
+- Improve contrib/blast to return unused bytes
+- Assure that gzoffset() is correct when appending
+- Improve compress() and uncompress() to support large lengths
+- Fix bug in test/example.c where error code not saved
+- Remedy Coverity warning [Randers-Pehrson]
+- Improve speed of gzprintf() in transparent mode
+- Fix inflateInit2() bug when windowBits is 16 or 32
+- Change DEBUG macro to ZLIB_DEBUG
+- Avoid uninitialized access by gzclose_w()
+- Allow building zlib outside of the source directory
+- Fix bug that accepted invalid zlib header when windowBits is zero
+- Fix gzseek() problem on MinGW due to buggy _lseeki64 there
+- Loop on write() calls in gzwrite.c in case of non-blocking I/O
+- Add --warn (-w) option to ./configure for more compiler warnings
+- Reject a window size of 256 bytes if not using the zlib wrapper
+- Fix bug when level 0 used with Z_HUFFMAN or Z_RLE
+- Add --debug (-d) option to ./configure to define ZLIB_DEBUG
+- Fix bugs in creating a very large gzip header
+- Add uncompress2() function, which returns the input size used
+- Assure that deflateParams() will not switch functions mid-block
+- Dramatically speed up deflation for level 0 (storing)
+- Add gzfread(), duplicating the interface of fread()
+- Add gzfwrite(), duplicating the interface of fwrite()
+- Add deflateGetDictionary() function
+- Use snprintf() for later versions of Microsoft C
+- Fix *Init macros to use z_ prefix when requested
+- Replace as400 with os400 for OS/400 support [Monnerat]
+- Add crc32_z() and adler32_z() functions with size_t lengths
+- Update Visual Studio project files [AraHaan]
+
+Changes in 1.2.8 (28 Apr 2013)
+- Update contrib/minizip/iowin32.c for Windows RT [Vollant]
+- Do not force Z_CONST for C++
+- Clean up contrib/vstudio [Roß]
+- Correct spelling error in zlib.h
+- Fix mixed line endings in contrib/vstudio
+
+Changes in 1.2.7.3 (13 Apr 2013)
+- Fix version numbers and DLL names in contrib/vstudio/*/zlib.rc
+
+Changes in 1.2.7.2 (13 Apr 2013)
+- Change check for a four-byte type back to hexadecimal
+- Fix typo in win32/Makefile.msc
+- Add casts in gzwrite.c for pointer differences
+
+Changes in 1.2.7.1 (24 Mar 2013)
+- Replace use of unsafe string functions with snprintf if available
+- Avoid including stddef.h on Windows for Z_SOLO compile [Niessink]
+- Fix gzgetc undefine when Z_PREFIX set [Turk]
+- Eliminate use of mktemp in Makefile (not always available)
+- Fix bug in 'F' mode for gzopen()
+- Add inflateGetDictionary() function
+- Correct comment in deflate.h
+- Use _snprintf for snprintf in Microsoft C
+- On Darwin, only use /usr/bin/libtool if libtool is not Apple
+- Delete "--version" file if created by "ar --version" [Richard G.]
+- Fix configure check for veracity of compiler error return codes
+- Fix CMake compilation of static lib for MSVC2010 x64
+- Remove unused variable in infback9.c
+- Fix argument checks in gzlog_compress() and gzlog_write()
+- Clean up the usage of z_const and respect const usage within zlib
+- Clean up examples/gzlog.[ch] comparisons of different types
+- Avoid shift equal to bits in type (caused endless loop)
+- Fix uninitialized value bug in gzputc() introduced by const patches
+- Fix memory allocation error in examples/zran.c [Nor]
+- Fix bug where gzopen(), gzclose() would write an empty file
+- Fix bug in gzclose() when gzwrite() runs out of memory
+- Check for input buffer malloc failure in examples/gzappend.c
+- Add note to contrib/blast to use binary mode in stdio
+- Fix comparisons of differently signed integers in contrib/blast
+- Check for invalid code length codes in contrib/puff
+- Fix serious but very rare decompression bug in inftrees.c
+- Update inflateBack() comments, since inflate() can be faster
+- Use underscored I/O function names for WINAPI_FAMILY
+- Add _tr_flush_bits to the external symbols prefixed by --zprefix
+- Add contrib/vstudio/vc10 pre-build step for static only
+- Quote --version-script argument in CMakeLists.txt
+- Don't specify --version-script on Apple platforms in CMakeLists.txt
+- Fix casting error in contrib/testzlib/testzlib.c
+- Fix types in contrib/minizip to match result of get_crc_table()
+- Simplify contrib/vstudio/vc10 with 'd' suffix
+- Add TOP support to win32/Makefile.msc
+- Suport i686 and amd64 assembler builds in CMakeLists.txt
+- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
+- Add vc11 and vc12 build files to contrib/vstudio
+- Add gzvprintf() as an undocumented function in zlib
+- Fix configure for Sun shell
+- Remove runtime check in configure for four-byte integer type
+- Add casts and consts to ease user conversion to C++
+- Add man pages for minizip and miniunzip
+- In Makefile uninstall, don't rm if preceding cd fails
+- Do not return Z_BUF_ERROR if deflateParam() has nothing to write
+
+Changes in 1.2.7 (2 May 2012)
+- Replace use of memmove() with a simple copy for portability
+- Test for existence of strerror
+- Restore gzgetc_ for backward compatibility with 1.2.6
+- Fix build with non-GNU make on Solaris
+- Require gcc 4.0 or later on Mac OS X to use the hidden attribute
+- Include unistd.h for Watcom C
+- Use __WATCOMC__ instead of __WATCOM__
+- Do not use the visibility attribute if NO_VIZ defined
+- Improve the detection of no hidden visibility attribute
+- Avoid using __int64 for gcc or solo compilation
+- Cast to char * in gzprintf to avoid warnings [Zinser]
+- Fix make_vms.com for VAX [Zinser]
+- Don't use library or built-in byte swaps
+- Simplify test and use of gcc hidden attribute
+- Fix bug in gzclose_w() when gzwrite() fails to allocate memory
+- Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen()
+- Fix bug in test/minigzip.c for configure --solo
+- Fix contrib/vstudio project link errors [Mohanathas]
+- Add ability to choose the builder in make_vms.com [Schweda]
+- Add DESTDIR support to mingw32 win32/Makefile.gcc
+- Fix comments in win32/Makefile.gcc for proper usage
+- Allow overriding the default install locations for cmake
+- Generate and install the pkg-config file with cmake
+- Build both a static and a shared version of zlib with cmake
+- Include version symbols for cmake builds
+- If using cmake with MSVC, add the source directory to the includes
+- Remove unneeded EXTRA_CFLAGS from win32/Makefile.gcc [Truta]
+- Move obsolete emx makefile to old [Truta]
+- Allow the use of -Wundef when compiling or using zlib
+- Avoid the use of the -u option with mktemp
+- Improve inflate() documentation on the use of Z_FINISH
+- Recognize clang as gcc
+- Add gzopen_w() in Windows for wide character path names
+- Rename zconf.h in CMakeLists.txt to move it out of the way
+- Add source directory in CMakeLists.txt for building examples
+- Look in build directory for zlib.pc in CMakeLists.txt
+- Remove gzflags from zlibvc.def in vc9 and vc10
+- Fix contrib/minizip compilation in the MinGW environment
+- Update ./configure for Solaris, support --64 [Mooney]
+- Remove -R. from Solaris shared build (possible security issue)
+- Avoid race condition for parallel make (-j) running example
+- Fix type mismatch between get_crc_table() and crc_table
+- Fix parsing of version with "-" in CMakeLists.txt [Snider, Ziegler]
+- Fix the path to zlib.map in CMakeLists.txt
+- Force the native libtool in Mac OS X to avoid GNU libtool [Beebe]
+- Add instructions to win32/Makefile.gcc for shared install [Torri]
+
+Changes in 1.2.6.1 (12 Feb 2012)
+- Avoid the use of the Objective-C reserved name "id"
+- Include io.h in gzguts.h for Microsoft compilers
+- Fix problem with ./configure --prefix and gzgetc macro
+- Include gz_header definition when compiling zlib solo
+- Put gzflags() functionality back in zutil.c
+- Avoid library header include in crc32.c for Z_SOLO
+- Use name in GCC_CLASSIC as C compiler for coverage testing, if set
+- Minor cleanup in contrib/minizip/zip.c [Vollant]
+- Update make_vms.com [Zinser]
+- Remove unnecessary gzgetc_ function
+- Use optimized byte swap operations for Microsoft and GNU [Snyder]
+- Fix minor typo in zlib.h comments [Rzesniowiecki]
+
+Changes in 1.2.6 (29 Jan 2012)
+- Update the Pascal interface in contrib/pascal
+- Fix function numbers for gzgetc_ in zlibvc.def files
+- Fix configure.ac for contrib/minizip [Schiffer]
+- Fix large-entry detection in minizip on 64-bit systems [Schiffer]
+- Have ./configure use the compiler return code for error indication
+- Fix CMakeLists.txt for cross compilation [McClure]
+- Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes]
+- Fix compilation of contrib/minizip on FreeBSD [Marquez]
+- Correct suggested usages in win32/Makefile.msc [Shachar, Horvath]
+- Include io.h for Turbo C / Borland C on all platforms [Truta]
+- Make version explicit in contrib/minizip/configure.ac [Bosmans]
+- Avoid warning for no encryption in contrib/minizip/zip.c [Vollant]
+- Minor cleanup up contrib/minizip/unzip.c [Vollant]
+- Fix bug when compiling minizip with C++ [Vollant]
+- Protect for long name and extra fields in contrib/minizip [Vollant]
+- Avoid some warnings in contrib/minizip [Vollant]
+- Add -I../.. -L../.. to CFLAGS for minizip and miniunzip
+- Add missing libs to minizip linker command
+- Add support for VPATH builds in contrib/minizip
+- Add an --enable-demos option to contrib/minizip/configure
+- Add the generation of configure.log by ./configure
+- Exit when required parameters not provided to win32/Makefile.gcc
+- Have gzputc return the character written instead of the argument
+- Use the -m option on ldconfig for BSD systems [Tobias]
+- Correct in zlib.map when deflateResetKeep was added
+
+Changes in 1.2.5.3 (15 Jan 2012)
+- Restore gzgetc function for binary compatibility
+- Do not use _lseeki64 under Borland C++ [Truta]
+- Update win32/Makefile.msc to build test/*.c [Truta]
+- Remove old/visualc6 given CMakefile and other alternatives
+- Update AS400 build files and documentation [Monnerat]
+- Update win32/Makefile.gcc to build test/*.c [Truta]
+- Permit stronger flushes after Z_BLOCK flushes
+- Avoid extraneous empty blocks when doing empty flushes
+- Permit Z_NULL arguments to deflatePending
+- Allow deflatePrime() to insert bits in the middle of a stream
+- Remove second empty static block for Z_PARTIAL_FLUSH
+- Write out all of the available bits when using Z_BLOCK
+- Insert the first two strings in the hash table after a flush
+
+Changes in 1.2.5.2 (17 Dec 2011)
+- fix ld error: unable to find version dependency 'ZLIB_1.2.5'
+- use relative symlinks for shared libs
+- Avoid searching past window for Z_RLE strategy
+- Assure that high-water mark initialization is always applied in deflate
+- Add assertions to fill_window() in deflate.c to match comments
+- Update python link in README
+- Correct spelling error in gzread.c
+- Fix bug in gzgets() for a concatenated empty gzip stream
+- Correct error in comment for gz_make()
+- Change gzread() and related to ignore junk after gzip streams
+- Allow gzread() and related to continue after gzclearerr()
+- Allow gzrewind() and gzseek() after a premature end-of-file
+- Simplify gzseek() now that raw after gzip is ignored
+- Change gzgetc() to a macro for speed (~40% speedup in testing)
+- Fix gzclose() to return the actual error last encountered
+- Always add large file support for windows
+- Include zconf.h for windows large file support
+- Include zconf.h.cmakein for windows large file support
+- Update zconf.h.cmakein on make distclean
+- Merge vestigial vsnprintf determination from zutil.h to gzguts.h
+- Clarify how gzopen() appends in zlib.h comments
+- Correct documentation of gzdirect() since junk at end now ignored
+- Add a transparent write mode to gzopen() when 'T' is in the mode
+- Update python link in zlib man page
+- Get inffixed.h and MAKEFIXED result to match
+- Add a ./config --solo option to make zlib subset with no library use
+- Add undocumented inflateResetKeep() function for CAB file decoding
+- Add --cover option to ./configure for gcc coverage testing
+- Add #define ZLIB_CONST option to use const in the z_stream interface
+- Add comment to gzdopen() in zlib.h to use dup() when using fileno()
+- Note behavior of uncompress() to provide as much data as it can
+- Add files in contrib/minizip to aid in building libminizip
+- Split off AR options in Makefile.in and configure
+- Change ON macro to Z_ARG to avoid application conflicts
+- Facilitate compilation with Borland C++ for pragmas and vsnprintf
+- Include io.h for Turbo C / Borland C++
+- Move example.c and minigzip.c to test/
+- Simplify incomplete code table filling in inflate_table()
+- Remove code from inflate.c and infback.c that is impossible to execute
+- Test the inflate code with full coverage
+- Allow deflateSetDictionary, inflateSetDictionary at any time (in raw)
+- Add deflateResetKeep and fix inflateResetKeep to retain dictionary
+- Fix gzwrite.c to accommodate reduced memory zlib compilation
+- Have inflate() with Z_FINISH avoid the allocation of a window
+- Do not set strm->adler when doing raw inflate
+- Fix gzeof() to behave just like feof() when read is not past end of file
+- Fix bug in gzread.c when end-of-file is reached
+- Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF
+- Document gzread() capability to read concurrently written files
+- Remove hard-coding of resource compiler in CMakeLists.txt [Blammo]
+
+Changes in 1.2.5.1 (10 Sep 2011)
+- Update FAQ entry on shared builds (#13)
+- Avoid symbolic argument to chmod in Makefile.in
+- Fix bug and add consts in contrib/puff [Oberhumer]
+- Update contrib/puff/zeros.raw test file to have all block types
+- Add full coverage test for puff in contrib/puff/Makefile
+- Fix static-only-build install in Makefile.in
+- Fix bug in unzGetCurrentFileInfo() in contrib/minizip [Kuno]
+- Add libz.a dependency to shared in Makefile.in for parallel builds
+- Spell out "number" (instead of "nb") in zlib.h for total_in, total_out
+- Replace $(...) with `...` in configure for non-bash sh [Bowler]
+- Add darwin* to Darwin* and solaris* to SunOS\ 5* in configure [Groffen]
+- Add solaris* to Linux* in configure to allow gcc use [Groffen]
+- Add *bsd* to Linux* case in configure [Bar-Lev]
+- Add inffast.obj to dependencies in win32/Makefile.msc
+- Correct spelling error in deflate.h [Kohler]
+- Change libzdll.a again to libz.dll.a (!) in win32/Makefile.gcc
+- Add test to configure for GNU C looking for gcc in output of $cc -v
+- Add zlib.pc generation to win32/Makefile.gcc [Weigelt]
+- Fix bug in zlib.h for _FILE_OFFSET_BITS set and _LARGEFILE64_SOURCE not
+- Add comment in zlib.h that adler32_combine with len2 < 0 makes no sense
+- Make NO_DIVIDE option in adler32.c much faster (thanks to John Reiser)
+- Make stronger test in zconf.h to include unistd.h for LFS
+- Apply Darwin patches for 64-bit file offsets to contrib/minizip [Slack]
+- Fix zlib.h LFS support when Z_PREFIX used
+- Add updated as400 support (removed from old) [Monnerat]
+- Avoid deflate sensitivity to volatile input data
+- Avoid division in adler32_combine for NO_DIVIDE
+- Clarify the use of Z_FINISH with deflateBound() amount of space
+- Set binary for output file in puff.c
+- Use u4 type for crc_table to avoid conversion warnings
+- Apply casts in zlib.h to avoid conversion warnings
+- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
+- Improve inflateSync() documentation to note indeterminancy
+- Add deflatePending() function to return the amount of pending output
+- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
+- Add a check in configure for stdarg.h, use for gzprintf()
+- Check that pointers fit in ints when gzprint() compiled old style
+- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
+- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
+- Add debug records in assmebler code [Londer]
+- Update RFC references to use http://tools.ietf.org/html/... [Li]
+- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
+
+Changes in 1.2.5 (19 Apr 2010)
+- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev]
+- Default to libdir as sharedlibdir in configure [Nieder]
+- Update copyright dates on modified source files
+- Update trees.c to be able to generate modified trees.h
+- Exit configure for MinGW, suggesting win32/Makefile.gcc
+- Check for NULL path in gz_open [Homurlu]
+
+Changes in 1.2.4.5 (18 Apr 2010)
+- Set sharedlibdir in configure [Torok]
+- Set LDFLAGS in Makefile.in [Bar-Lev]
+- Avoid mkdir objs race condition in Makefile.in [Bowler]
+- Add ZLIB_INTERNAL in front of internal inter-module functions and arrays
+- Define ZLIB_INTERNAL to hide internal functions and arrays for GNU C
+- Don't use hidden attribute when it is a warning generator (e.g. Solaris)
+
+Changes in 1.2.4.4 (18 Apr 2010)
+- Fix CROSS_PREFIX executable testing, CHOST extract, mingw* [Torok]
+- Undefine _LARGEFILE64_SOURCE in zconf.h if it is zero, but not if empty
+- Try to use bash or ksh regardless of functionality of /bin/sh
+- Fix configure incompatibility with NetBSD sh
+- Remove attempt to run under bash or ksh since have better NetBSD fix
+- Fix win32/Makefile.gcc for MinGW [Bar-Lev]
+- Add diagnostic messages when using CROSS_PREFIX in configure
+- Added --sharedlibdir option to configure [Weigelt]
+- Use hidden visibility attribute when available [Frysinger]
+
+Changes in 1.2.4.3 (10 Apr 2010)
+- Only use CROSS_PREFIX in configure for ar and ranlib if they exist
+- Use CROSS_PREFIX for nm [Bar-Lev]
+- Assume _LARGEFILE64_SOURCE defined is equivalent to true
+- Avoid use of undefined symbols in #if with && and ||
+- Make *64 prototypes in gzguts.h consistent with functions
+- Add -shared load option for MinGW in configure [Bowler]
+- Move z_off64_t to public interface, use instead of off64_t
+- Remove ! from shell test in configure (not portable to Solaris)
+- Change +0 macro tests to -0 for possibly increased portability
+
+Changes in 1.2.4.2 (9 Apr 2010)
+- Add consistent carriage returns to readme.txt's in masmx86 and masmx64
+- Really provide prototypes for *64 functions when building without LFS
+- Only define unlink() in minigzip.c if unistd.h not included
+- Update README to point to contrib/vstudio project files
+- Move projects/vc6 to old/ and remove projects/
+- Include stdlib.h in minigzip.c for setmode() definition under WinCE
+- Clean up assembler builds in win32/Makefile.msc [Rowe]
+- Include sys/types.h for Microsoft for off_t definition
+- Fix memory leak on error in gz_open()
+- Symbolize nm as $NM in configure [Weigelt]
+- Use TEST_LDSHARED instead of LDSHARED to link test programs [Weigelt]
+- Add +0 to _FILE_OFFSET_BITS and _LFS64_LARGEFILE in case not defined
+- Fix bug in gzeof() to take into account unused input data
+- Avoid initialization of structures with variables in puff.c
+- Updated win32/README-WIN32.txt [Rowe]
+
+Changes in 1.2.4.1 (28 Mar 2010)
+- Remove the use of [a-z] constructs for sed in configure [gentoo 310225]
+- Remove $(SHAREDLIB) from LIBS in Makefile.in [Creech]
+- Restore "for debugging" comment on sprintf() in gzlib.c
+- Remove fdopen for MVS from gzguts.h
+- Put new README-WIN32.txt in win32 [Rowe]
+- Add check for shell to configure and invoke another shell if needed
+- Fix big fat stinking bug in gzseek() on uncompressed files
+- Remove vestigial F_OPEN64 define in zutil.h
+- Set and check the value of _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE
+- Avoid errors on non-LFS systems when applications define LFS macros
+- Set EXE to ".exe" in configure for MINGW [Kahle]
+- Match crc32() in crc32.c exactly to the prototype in zlib.h [Sherrill]
+- Add prefix for cross-compilation in win32/makefile.gcc [Bar-Lev]
+- Add DLL install in win32/makefile.gcc [Bar-Lev]
+- Allow Linux* or linux* from uname in configure [Bar-Lev]
+- Allow ldconfig to be redefined in configure and Makefile.in [Bar-Lev]
+- Add cross-compilation prefixes to configure [Bar-Lev]
+- Match type exactly in gz_load() invocation in gzread.c
+- Match type exactly of zcalloc() in zutil.c to zlib.h alloc_func
+- Provide prototypes for *64 functions when building zlib without LFS
+- Don't use -lc when linking shared library on MinGW
+- Remove errno.h check in configure and vestigial errno code in zutil.h
+
+Changes in 1.2.4 (14 Mar 2010)
+- Fix VER3 extraction in configure for no fourth subversion
+- Update zlib.3, add docs to Makefile.in to make .pdf out of it
+- Add zlib.3.pdf to distribution
+- Don't set error code in gzerror() if passed pointer is NULL
+- Apply destination directory fixes to CMakeLists.txt [Lowman]
+- Move #cmakedefine's to a new zconf.in.cmakein
+- Restore zconf.h for builds that don't use configure or cmake
+- Add distclean to dummy Makefile for convenience
+- Update and improve INDEX, README, and FAQ
+- Update CMakeLists.txt for the return of zconf.h [Lowman]
+- Update contrib/vstudio/vc9 and vc10 [Vollant]
+- Change libz.dll.a back to libzdll.a in win32/Makefile.gcc
+- Apply license and readme changes to contrib/asm686 [Raiter]
+- Check file name lengths and add -c option in minigzip.c [Li]
+- Update contrib/amd64 and contrib/masmx86/ [Vollant]
+- Avoid use of "eof" parameter in trees.c to not shadow library variable
+- Update make_vms.com for removal of zlibdefs.h [Zinser]
+- Update assembler code and vstudio projects in contrib [Vollant]
+- Remove outdated assembler code contrib/masm686 and contrib/asm586
+- Remove old vc7 and vc8 from contrib/vstudio
+- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe]
+- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open()
+- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant]
+- Remove *64 functions from win32/zlib.def (they're not 64-bit yet)
+- Fix bug in void-returning vsprintf() case in gzwrite.c
+- Fix name change from inflate.h in contrib/inflate86/inffas86.c
+- Check if temporary file exists before removing in make_vms.com [Zinser]
+- Fix make install and uninstall for --static option
+- Fix usage of _MSC_VER in gzguts.h and zutil.h [Truta]
+- Update readme.txt in contrib/masmx64 and masmx86 to assemble
+
+Changes in 1.2.3.9 (21 Feb 2010)
+- Expunge gzio.c
+- Move as400 build information to old
+- Fix updates in contrib/minizip and contrib/vstudio
+- Add const to vsnprintf test in configure to avoid warnings [Weigelt]
+- Delete zconf.h (made by configure) [Weigelt]
+- Change zconf.in.h to zconf.h.in per convention [Weigelt]
+- Check for NULL buf in gzgets()
+- Return empty string for gzgets() with len == 1 (like fgets())
+- Fix description of gzgets() in zlib.h for end-of-file, NULL return
+- Update minizip to 1.1 [Vollant]
+- Avoid MSVC loss of data warnings in gzread.c, gzwrite.c
+- Note in zlib.h that gzerror() should be used to distinguish from EOF
+- Remove use of snprintf() from gzlib.c
+- Fix bug in gzseek()
+- Update contrib/vstudio, adding vc9 and vc10 [Kuno, Vollant]
+- Fix zconf.h generation in CMakeLists.txt [Lowman]
+- Improve comments in zconf.h where modified by configure
+
+Changes in 1.2.3.8 (13 Feb 2010)
+- Clean up text files (tabs, trailing whitespace, etc.) [Oberhumer]
+- Use z_off64_t in gz_zero() and gz_skip() to match state->skip
+- Avoid comparison problem when sizeof(int) == sizeof(z_off64_t)
+- Revert to Makefile.in from 1.2.3.6 (live with the clutter)
+- Fix missing error return in gzflush(), add zlib.h note
+- Add *64 functions to zlib.map [Levin]
+- Fix signed/unsigned comparison in gz_comp()
+- Use SFLAGS when testing shared linking in configure
+- Add --64 option to ./configure to use -m64 with gcc
+- Fix ./configure --help to correctly name options
+- Have make fail if a test fails [Levin]
+- Avoid buffer overrun in contrib/masmx64/gvmat64.asm [Simpson]
+- Remove assembler object files from contrib
+
+Changes in 1.2.3.7 (24 Jan 2010)
+- Always gzopen() with O_LARGEFILE if available
+- Fix gzdirect() to work immediately after gzopen() or gzdopen()
+- Make gzdirect() more precise when the state changes while reading
+- Improve zlib.h documentation in many places
+- Catch memory allocation failure in gz_open()
+- Complete close operation if seek forward in gzclose_w() fails
+- Return Z_ERRNO from gzclose_r() if close() fails
+- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL
+- Return zero for gzwrite() errors to match zlib.h description
+- Return -1 on gzputs() error to match zlib.h description
+- Add zconf.in.h to allow recovery from configure modification [Weigelt]
+- Fix static library permissions in Makefile.in [Weigelt]
+- Avoid warnings in configure tests that hide functionality [Weigelt]
+- Add *BSD and DragonFly to Linux case in configure [gentoo 123571]
+- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212]
+- Avoid access of uninitialized data for first inflateReset2 call [Gomes]
+- Keep object files in subdirectories to reduce the clutter somewhat
+- Remove default Makefile and zlibdefs.h, add dummy Makefile
+- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_
+- Remove zlibdefs.h completely -- modify zconf.h instead
+
+Changes in 1.2.3.6 (17 Jan 2010)
+- Avoid void * arithmetic in gzread.c and gzwrite.c
+- Make compilers happier with const char * for gz_error message
+- Avoid unused parameter warning in inflate.c
+- Avoid signed-unsigned comparison warning in inflate.c
+- Indent #pragma's for traditional C
+- Fix usage of strwinerror() in glib.c, change to gz_strwinerror()
+- Correct email address in configure for system options
+- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser]
+- Update zlib.map [Brown]
+- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Torok]
+- Apply various fixes to CMakeLists.txt [Lowman]
+- Add checks on len in gzread() and gzwrite()
+- Add error message for no more room for gzungetc()
+- Remove zlib version check in gzwrite()
+- Defer compression of gzprintf() result until need to
+- Use snprintf() in gzdopen() if available
+- Remove USE_MMAP configuration determination (only used by minigzip)
+- Remove examples/pigz.c (available separately)
+- Update examples/gun.c to 1.6
+
+Changes in 1.2.3.5 (8 Jan 2010)
+- Add space after #if in zutil.h for some compilers
+- Fix relatively harmless bug in deflate_fast() [Exarevsky]
+- Fix same problem in deflate_slow()
+- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown]
+- Add deflate_rle() for faster Z_RLE strategy run-length encoding
+- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding
+- Change name of "write" variable in inffast.c to avoid library collisions
+- Fix premature EOF from gzread() in gzio.c [Brown]
+- Use zlib header window size if windowBits is 0 in inflateInit2()
+- Remove compressBound() call in deflate.c to avoid linking compress.o
+- Replace use of errno in gz* with functions, support WinCE [Alves]
+- Provide alternative to perror() in minigzip.c for WinCE [Alves]
+- Don't use _vsnprintf on later versions of MSVC [Lowman]
+- Add CMake build script and input file [Lowman]
+- Update contrib/minizip to 1.1 [Svensson, Vollant]
+- Moved nintendods directory from contrib to .
+- Replace gzio.c with a new set of routines with the same functionality
+- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
+- Update contrib/minizip to 1.1b
+- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
+
+Changes in 1.2.3.4 (21 Dec 2009)
+- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility
+- Update comments in configure and Makefile.in for default --shared
+- Fix test -z's in configure [Marquess]
+- Build examplesh and minigzipsh when not testing
+- Change NULL's to Z_NULL's in deflate.c and in comments in zlib.h
+- Import LDFLAGS from the environment in configure
+- Fix configure to populate SFLAGS with discovered CFLAGS options
+- Adapt make_vms.com to the new Makefile.in [Zinser]
+- Add zlib2ansi script for C++ compilation [Marquess]
+- Add _FILE_OFFSET_BITS=64 test to make test (when applicable)
+- Add AMD64 assembler code for longest match to contrib [Teterin]
+- Include options from $SFLAGS when doing $LDSHARED
+- Simplify 64-bit file support by introducing z_off64_t type
+- Make shared object files in objs directory to work around old Sun cc
+- Use only three-part version number for Darwin shared compiles
+- Add rc option to ar in Makefile.in for when ./configure not run
+- Add -WI,-rpath,. to LDFLAGS for OSF 1 V4*
+- Set LD_LIBRARYN32_PATH for SGI IRIX shared compile
+- Protect against _FILE_OFFSET_BITS being defined when compiling zlib
+- Rename Makefile.in targets allstatic to static and allshared to shared
+- Fix static and shared Makefile.in targets to be independent
+- Correct error return bug in gz_open() by setting state [Brown]
+- Put spaces before ;;'s in configure for better sh compatibility
+- Add pigz.c (parallel implementation of gzip) to examples/
+- Correct constant in crc32.c to UL [Leventhal]
+- Reject negative lengths in crc32_combine()
+- Add inflateReset2() function to work like inflateEnd()/inflateInit2()
+- Include sys/types.h for _LARGEFILE64_SOURCE [Brown]
+- Correct typo in doc/algorithm.txt [Janik]
+- Fix bug in adler32_combine() [Zhu]
+- Catch missing-end-of-block-code error in all inflates and in puff
+    Assures that random input to inflate eventually results in an error
+- Added enough.c (calculation of ENOUGH for inftrees.h) to examples/
+- Update ENOUGH and its usage to reflect discovered bounds
+- Fix gzerror() error report on empty input file [Brown]
+- Add ush casts in trees.c to avoid pedantic runtime errors
+- Fix typo in zlib.h uncompress() description [Reiss]
+- Correct inflate() comments with regard to automatic header detection
+- Remove deprecation comment on Z_PARTIAL_FLUSH (it stays)
+- Put new version of gzlog (2.0) in examples with interruption recovery
+- Add puff compile option to permit invalid distance-too-far streams
+- Add puff TEST command options, ability to read piped input
+- Prototype the *64 functions in zlib.h when _FILE_OFFSET_BITS == 64, but
+  _LARGEFILE64_SOURCE not defined
+- Fix Z_FULL_FLUSH to truly erase the past by resetting s->strstart
+- Fix deflateSetDictionary() to use all 32K for output consistency
+- Remove extraneous #define MIN_LOOKAHEAD in deflate.c (in deflate.h)
+- Clear bytes after deflate lookahead to avoid use of uninitialized data
+- Change a limit in inftrees.c to be more transparent to Coverity Prevent
+- Update win32/zlib.def with exported symbols from zlib.h
+- Correct spelling errors in zlib.h [Willem, Sobrado]
+- Allow Z_BLOCK for deflate() to force a new block
+- Allow negative bits in inflatePrime() to delete existing bit buffer
+- Add Z_TREES flush option to inflate() to return at end of trees
+- Add inflateMark() to return current state information for random access
+- Add Makefile for NintendoDS to contrib [Costa]
+- Add -w in configure compile tests to avoid spurious warnings [Beucler]
+- Fix typos in zlib.h comments for deflateSetDictionary()
+- Fix EOF detection in transparent gzread() [Maier]
+
+Changes in 1.2.3.3 (2 October 2006)
+- Make --shared the default for configure, add a --static option
+- Add compile option to permit invalid distance-too-far streams
+- Add inflateUndermine() function which is required to enable above
+- Remove use of "this" variable name for C++ compatibility [Marquess]
+- Add testing of shared library in make test, if shared library built
+- Use ftello() and fseeko() if available instead of ftell() and fseek()
+- Provide two versions of all functions that use the z_off_t type for
+  binary compatibility -- a normal version and a 64-bit offset version,
+  per the Large File Support Extension when _LARGEFILE64_SOURCE is
+  defined; use the 64-bit versions by default when _FILE_OFFSET_BITS
+  is defined to be 64
+- Add a --uname= option to configure to perhaps help with cross-compiling
+
+Changes in 1.2.3.2 (3 September 2006)
+- Turn off silly Borland warnings [Hay]
+- Use off64_t and define _LARGEFILE64_SOURCE when present
+- Fix missing dependency on inffixed.h in Makefile.in
+- Rig configure --shared to build both shared and static [Teredesai, Truta]
+- Remove zconf.in.h and instead create a new zlibdefs.h file
+- Fix contrib/minizip/unzip.c non-encrypted after encrypted [Vollant]
+- Add treebuild.xml (see http://treebuild.metux.de/) [Weigelt]
+
+Changes in 1.2.3.1 (16 August 2006)
+- Add watcom directory with OpenWatcom make files [Daniel]
+- Remove #undef of FAR in zconf.in.h for MVS [Fedtke]
+- Update make_vms.com [Zinser]
+- Use -fPIC for shared build in configure [Teredesai, Nicholson]
+- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen]
+- Use fdopen() (not _fdopen()) for Interix in zutil.h [Bäck]
+- Add some FAQ entries about the contrib directory
+- Update the MVS question in the FAQ
+- Avoid extraneous reads after EOF in gzio.c [Brown]
+- Correct spelling of "successfully" in gzio.c [Randers-Pehrson]
+- Add comments to zlib.h about gzerror() usage [Brown]
+- Set extra flags in gzip header in gzopen() like deflate() does
+- Make configure options more compatible with double-dash conventions
+  [Weigelt]
+- Clean up compilation under Solaris SunStudio cc [Rowe, Reinholdtsen]
+- Fix uninstall target in Makefile.in [Truta]
+- Add pkgconfig support [Weigelt]
+- Use $(DESTDIR) macro in Makefile.in [Reinholdtsen, Weigelt]
+- Replace set_data_type() with a more accurate detect_data_type() in
+  trees.c, according to the txtvsbin.txt document [Truta]
+- Swap the order of #include <stdio.h> and #include "zlib.h" in
+  gzio.c, example.c and minigzip.c [Truta]
+- Shut up annoying VS2005 warnings about standard C deprecation [Rowe,
+  Truta] (where?)
+- Fix target "clean" from win32/Makefile.bor [Truta]
+- Create .pdb and .manifest files in win32/makefile.msc [Ziegler, Rowe]
+- Update zlib www home address in win32/DLL_FAQ.txt [Truta]
+- Update contrib/masmx86/inffas32.asm for VS2005 [Vollant, Van Wassenhove]
+- Enable browse info in the "Debug" and "ASM Debug" configurations in
+  the Visual C++ 6 project, and set (non-ASM) "Debug" as default [Truta]
+- Add pkgconfig support [Weigelt]
+- Add ZLIB_VER_MAJOR, ZLIB_VER_MINOR and ZLIB_VER_REVISION in zlib.h,
+  for use in win32/zlib1.rc [Polushin, Rowe, Truta]
+- Add a document that explains the new text detection scheme to
+  doc/txtvsbin.txt [Truta]
+- Add rfc1950.txt, rfc1951.txt and rfc1952.txt to doc/ [Truta]
+- Move algorithm.txt into doc/ [Truta]
+- Synchronize FAQ with website
+- Fix compressBound(), was low for some pathological cases [Fearnley]
+- Take into account wrapper variations in deflateBound()
+- Set examples/zpipe.c input and output to binary mode for Windows
+- Update examples/zlib_how.html with new zpipe.c (also web site)
+- Fix some warnings in examples/gzlog.c and examples/zran.c (it seems
+  that gcc became pickier in 4.0)
+- Add zlib.map for Linux: "All symbols from zlib-1.1.4 remain
+  un-versioned, the patch adds versioning only for symbols introduced in
+  zlib-1.2.0 or later.  It also declares as local those symbols which are
+  not designed to be exported." [Levin]
+- Update Z_PREFIX list in zconf.in.h, add --zprefix option to configure
+- Do not initialize global static by default in trees.c, add a response
+  NO_INIT_GLOBAL_POINTERS to initialize them if needed [Marquess]
+- Don't use strerror() in gzio.c under WinCE [Yakimov]
+- Don't use errno.h in zutil.h under WinCE [Yakimov]
+- Move arguments for AR to its usage to allow replacing ar [Marot]
+- Add HAVE_VISIBILITY_PRAGMA in zconf.in.h for Mozilla [Randers-Pehrson]
+- Improve inflateInit() and inflateInit2() documentation
+- Fix structure size comment in inflate.h
+- Change configure help option from --h* to --help [Santos]
+
+Changes in 1.2.3 (18 July 2005)
+- Apply security vulnerability fixes to contrib/infback9 as well
+- Clean up some text files (carriage returns, trailing space)
+- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant]
+
+Changes in 1.2.2.4 (11 July 2005)
+- Add inflatePrime() function for starting inflation at bit boundary
+- Avoid some Visual C warnings in deflate.c
+- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit
+  compile
+- Fix some spelling errors in comments [Betts]
+- Correct inflateInit2() error return documentation in zlib.h
+- Add zran.c example of compressed data random access to examples
+  directory, shows use of inflatePrime()
+- Fix cast for assignments to strm->state in inflate.c and infback.c
+- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer]
+- Move declarations of gf2 functions to right place in crc32.c [Oberhumer]
+- Add cast in trees.c t avoid a warning [Oberhumer]
+- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer]
+- Update make_vms.com [Zinser]
+- Initialize state->write in inflateReset() since copied in inflate_fast()
+- Be more strict on incomplete code sets in inflate_table() and increase
+  ENOUGH and MAXD -- this repairs a possible security vulnerability for
+  invalid inflate input.  Thanks to Tavis Ormandy and Markus Oberhumer for
+  discovering the vulnerability and providing test cases.
+- Add ia64 support to configure for HP-UX [Smith]
+- Add error return to gzread() for format or i/o error [Levin]
+- Use malloc.h for OS/2 [Necasek]
+
+Changes in 1.2.2.3 (27 May 2005)
+- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile
+- Typecast fread() return values in gzio.c [Vollant]
+- Remove trailing space in minigzip.c outmode (VC++ can't deal with it)
+- Fix crc check bug in gzread() after gzungetc() [Heiner]
+- Add the deflateTune() function to adjust internal compression parameters
+- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack)
+- Remove an incorrect assertion in examples/zpipe.c
+- Add C++ wrapper in infback9.h [Donais]
+- Fix bug in inflateCopy() when decoding fixed codes
+- Note in zlib.h how much deflateSetDictionary() actually uses
+- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used)
+- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer]
+- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer]
+- Add gzdirect() function to indicate transparent reads
+- Update contrib/minizip [Vollant]
+- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer]
+- Add casts in crc32.c to avoid warnings [Oberhumer]
+- Add contrib/masmx64 [Vollant]
+- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant]
+
+Changes in 1.2.2.2 (30 December 2004)
+- Replace structure assignments in deflate.c and inflate.c with zmemcpy to
+  avoid implicit memcpy calls (portability for no-library compilation)
+- Increase sprintf() buffer size in gzdopen() to allow for large numbers
+- Add INFLATE_STRICT to check distances against zlib header
+- Improve WinCE errno handling and comments [Chang]
+- Remove comment about no gzip header processing in FAQ
+- Add Z_FIXED strategy option to deflateInit2() to force fixed trees
+- Add updated make_vms.com [Coghlan], update README
+- Create a new "examples" directory, move gzappend.c there, add zpipe.c,
+  fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html.
+- Add FAQ entry and comments in deflate.c on uninitialized memory access
+- Add Solaris 9 make options in configure [Gilbert]
+- Allow strerror() usage in gzio.c for STDC
+- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer]
+- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant]
+- Use z_off_t for adler32_combine() and crc32_combine() lengths
+- Make adler32() much faster for small len
+- Use OS_CODE in deflate() default gzip header
+
+Changes in 1.2.2.1 (31 October 2004)
+- Allow inflateSetDictionary() call for raw inflate
+- Fix inflate header crc check bug for file names and comments
+- Add deflateSetHeader() and gz_header structure for custom gzip headers
+- Add inflateGetheader() to retrieve gzip headers
+- Add crc32_combine() and adler32_combine() functions
+- Add alloc_func, free_func, in_func, out_func to Z_PREFIX list
+- Use zstreamp consistently in zlib.h (inflate_back functions)
+- Remove GUNZIP condition from definition of inflate_mode in inflate.h
+  and in contrib/inflate86/inffast.S [Truta, Anderson]
+- Add support for AMD64 in contrib/inflate86/inffas86.c [Anderson]
+- Update projects/README.projects and projects/visualc6 [Truta]
+- Update win32/DLL_FAQ.txt [Truta]
+- Avoid warning under NO_GZCOMPRESS in gzio.c; fix typo [Truta]
+- Deprecate Z_ASCII; use Z_TEXT instead [Truta]
+- Use a new algorithm for setting strm->data_type in trees.c [Truta]
+- Do not define an exit() prototype in zutil.c unless DEBUG defined
+- Remove prototype of exit() from zutil.c, example.c, minigzip.c [Truta]
+- Add comment in zlib.h for Z_NO_FLUSH parameter to deflate()
+- Fix Darwin build version identification [Peterson]
+
+Changes in 1.2.2 (3 October 2004)
+- Update zlib.h comments on gzip in-memory processing
+- Set adler to 1 in inflateReset() to support Java test suite [Walles]
+- Add contrib/dotzlib [Ravn]
+- Update win32/DLL_FAQ.txt [Truta]
+- Update contrib/minizip [Vollant]
+- Move contrib/visual-basic.txt to old/ [Truta]
+- Fix assembler builds in projects/visualc6/ [Truta]
+
+Changes in 1.2.1.2 (9 September 2004)
+- Update INDEX file
+- Fix trees.c to update strm->data_type (no one ever noticed!)
+- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown]
+- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE)
+- Add limited multitasking protection to DYNAMIC_CRC_TABLE
+- Add NO_vsnprintf for VMS in zutil.h [Mozilla]
+- Don't declare strerror() under VMS [Mozilla]
+- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize
+- Update contrib/ada [Anisimkov]
+- Update contrib/minizip [Vollant]
+- Fix configure to not hardcode directories for Darwin [Peterson]
+- Fix gzio.c to not return error on empty files [Brown]
+- Fix indentation; update version in contrib/delphi/ZLib.pas and
+  contrib/pascal/zlibpas.pas [Truta]
+- Update mkasm.bat in contrib/masmx86 [Truta]
+- Update contrib/untgz [Truta]
+- Add projects/README.projects [Truta]
+- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta]
+- Update win32/DLL_FAQ.txt [Truta]
+- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta]
+- Remove an unnecessary assignment to curr in inftrees.c [Truta]
+- Add OS/2 to exe builds in configure [Poltorak]
+- Remove err dummy parameter in zlib.h [Kientzle]
+
+Changes in 1.2.1.1 (9 January 2004)
+- Update email address in README
+- Several FAQ updates
+- Fix a big fat bug in inftrees.c that prevented decoding valid
+  dynamic blocks with only literals and no distance codes --
+  Thanks to "Hot Emu" for the bug report and sample file
+- Add a note to puff.c on no distance codes case.
+
+Changes in 1.2.1 (17 November 2003)
+- Remove a tab in contrib/gzappend/gzappend.c
+- Update some interfaces in contrib for new zlib functions
+- Update zlib version number in some contrib entries
+- Add Windows CE definition for ptrdiff_t in zutil.h [Mai, Truta]
+- Support shared libraries on Hurd and KFreeBSD [Brown]
+- Fix error in NO_DIVIDE option of adler32.c
+
+Changes in 1.2.0.8 (4 November 2003)
+- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas
+- Add experimental NO_DIVIDE #define in adler32.c
+    - Possibly faster on some processors (let me know if it is)
+- Correct Z_BLOCK to not return on first inflate call if no wrap
+- Fix strm->data_type on inflate() return to correctly indicate EOB
+- Add deflatePrime() function for appending in the middle of a byte
+- Add contrib/gzappend for an example of appending to a stream
+- Update win32/DLL_FAQ.txt [Truta]
+- Delete Turbo C comment in README [Truta]
+- Improve some indentation in zconf.h [Truta]
+- Fix infinite loop on bad input in configure script [Church]
+- Fix gzeof() for concatenated gzip files [Johnson]
+- Add example to contrib/visual-basic.txt [Michael B.]
+- Add -p to mkdir's in Makefile.in [vda]
+- Fix configure to properly detect presence or lack of printf functions
+- Add AS400 support [Monnerat]
+- Add a little Cygwin support [Wilson]
+
+Changes in 1.2.0.7 (21 September 2003)
+- Correct some debug formats in contrib/infback9
+- Cast a type in a debug statement in trees.c
+- Change search and replace delimiter in configure from % to # [Beebe]
+- Update contrib/untgz to 0.2 with various fixes [Truta]
+- Add build support for Amiga [Nikl]
+- Remove some directories in old that have been updated to 1.2
+- Add dylib building for Mac OS X in configure and Makefile.in
+- Remove old distribution stuff from Makefile
+- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X
+- Update links in README
+
+Changes in 1.2.0.6 (13 September 2003)
+- Minor FAQ updates
+- Update contrib/minizip to 1.00 [Vollant]
+- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta]
+- Update POSTINC comment for 68060 [Nikl]
+- Add contrib/infback9 with deflate64 decoding (unsupported)
+- For MVS define NO_vsnprintf and undefine FAR [van Burik]
+- Add pragma for fdopen on MVS [van Burik]
+
+Changes in 1.2.0.5 (8 September 2003)
+- Add OF to inflateBackEnd() declaration in zlib.h
+- Remember start when using gzdopen in the middle of a file
+- Use internal off_t counters in gz* functions to properly handle seeks
+- Perform more rigorous check for distance-too-far in inffast.c
+- Add Z_BLOCK flush option to return from inflate at block boundary
+- Set strm->data_type on return from inflate
+    - Indicate bits unused, if at block boundary, and if in last block
+- Replace size_t with ptrdiff_t in crc32.c, and check for correct size
+- Add condition so old NO_DEFLATE define still works for compatibility
+- FAQ update regarding the Windows DLL [Truta]
+- INDEX update: add qnx entry, remove aix entry [Truta]
+- Install zlib.3 into mandir [Wilson]
+- Move contrib/zlib_dll_FAQ.txt to win32/DLL_FAQ.txt; update [Truta]
+- Adapt the zlib interface to the new DLL convention guidelines [Truta]
+- Introduce ZLIB_WINAPI macro to allow the export of functions using
+  the WINAPI calling convention, for Visual Basic [Vollant, Truta]
+- Update msdos and win32 scripts and makefiles [Truta]
+- Export symbols by name, not by ordinal, in win32/zlib.def [Truta]
+- Add contrib/ada [Anisimkov]
+- Move asm files from contrib/vstudio/vc70_32 to contrib/asm386 [Truta]
+- Rename contrib/asm386 to contrib/masmx86 [Truta, Vollant]
+- Add contrib/masm686 [Truta]
+- Fix offsets in contrib/inflate86 and contrib/masmx86/inffas32.asm
+  [Truta, Vollant]
+- Update contrib/delphi; rename to contrib/pascal; add example [Truta]
+- Remove contrib/delphi2; add a new contrib/delphi [Truta]
+- Avoid inclusion of the nonstandard <memory.h> in contrib/iostream,
+  and fix some method prototypes [Truta]
+- Fix the ZCR_SEED2 constant to avoid warnings in contrib/minizip
+  [Truta]
+- Avoid the use of backslash (\) in contrib/minizip [Vollant]
+- Fix file time handling in contrib/untgz; update makefiles [Truta]
+- Update contrib/vstudio/vc70_32 to comply with the new DLL guidelines
+  [Vollant]
+- Remove contrib/vstudio/vc15_16 [Vollant]
+- Rename contrib/vstudio/vc70_32 to contrib/vstudio/vc7 [Truta]
+- Update README.contrib [Truta]
+- Invert the assignment order of match_head and s->prev[...] in
+  INSERT_STRING [Truta]
+- Compare TOO_FAR with 32767 instead of 32768, to avoid 16-bit warnings
+  [Truta]
+- Compare function pointers with 0, not with NULL or Z_NULL [Truta]
+- Fix prototype of syncsearch in inflate.c [Truta]
+- Introduce ASMINF macro to be enabled when using an ASM implementation
+  of inflate_fast [Truta]
+- Change NO_DEFLATE to NO_GZCOMPRESS [Truta]
+- Modify test_gzio in example.c to take a single file name as a
+  parameter [Truta]
+- Exit the example.c program if gzopen fails [Truta]
+- Add type casts around strlen in example.c [Truta]
+- Remove casting to sizeof in minigzip.c; give a proper type
+  to the variable compared with SUFFIX_LEN [Truta]
+- Update definitions of STDC and STDC99 in zconf.h [Truta]
+- Synchronize zconf.h with the new Windows DLL interface [Truta]
+- Use SYS16BIT instead of __32BIT__ to distinguish between
+  16- and 32-bit platforms [Truta]
+- Use far memory allocators in small 16-bit memory models for
+  Turbo C [Truta]
+- Add info about the use of ASMV, ASMINF and ZLIB_WINAPI in
+  zlibCompileFlags [Truta]
+- Cygwin has vsnprintf [Wilson]
+- In Windows16, OS_CODE is 0, as in MSDOS [Truta]
+- In Cygwin, OS_CODE is 3 (Unix), not 11 (Windows32) [Wilson]
+
+Changes in 1.2.0.4 (10 August 2003)
+- Minor FAQ updates
+- Be more strict when checking inflateInit2's windowBits parameter
+- Change NO_GUNZIP compile option to NO_GZIP to cover deflate as well
+- Add gzip wrapper option to deflateInit2 using windowBits
+- Add updated QNX rule in configure and qnx directory [Bonnefoy]
+- Make inflate distance-too-far checks more rigorous
+- Clean up FAR usage in inflate
+- Add casting to sizeof() in gzio.c and minigzip.c
+
+Changes in 1.2.0.3 (19 July 2003)
+- Fix silly error in gzungetc() implementation [Vollant]
+- Update contrib/minizip and contrib/vstudio [Vollant]
+- Fix printf format in example.c
+- Correct cdecl support in zconf.in.h [Anisimkov]
+- Minor FAQ updates
+
+Changes in 1.2.0.2 (13 July 2003)
+- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons
+- Attempt to avoid warnings in crc32.c for pointer-int conversion
+- Add AIX to configure, remove aix directory [Bakker]
+- Add some casts to minigzip.c
+- Improve checking after insecure sprintf() or vsprintf() calls
+- Remove #elif's from crc32.c
+- Change leave label to inf_leave in inflate.c and infback.c to avoid
+  library conflicts
+- Remove inflate gzip decoding by default--only enable gzip decoding by
+  special request for stricter backward compatibility
+- Add zlibCompileFlags() function to return compilation information
+- More typecasting in deflate.c to avoid warnings
+- Remove leading underscore from _Capital #defines [Truta]
+- Fix configure to link shared library when testing
+- Add some Windows CE target adjustments [Mai]
+- Remove #define ZLIB_DLL in zconf.h [Vollant]
+- Add zlib.3 [Rodgers]
+- Update RFC URL in deflate.c and algorithm.txt [Mai]
+- Add zlib_dll_FAQ.txt to contrib [Truta]
+- Add UL to some constants [Truta]
+- Update minizip and vstudio [Vollant]
+- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h
+- Expand use of NO_DUMMY_DECL to avoid all dummy structures
+- Added iostream3 to contrib [Schwardt]
+- Replace rewind() with fseek() for WinCE [Truta]
+- Improve setting of zlib format compression level flags
+    - Report 0 for huffman and rle strategies and for level == 0 or 1
+    - Report 2 only for level == 6
+- Only deal with 64K limit when necessary at compile time [Truta]
+- Allow TOO_FAR check to be turned off at compile time [Truta]
+- Add gzclearerr() function [Souza]
+- Add gzungetc() function
+
+Changes in 1.2.0.1 (17 March 2003)
+- Add Z_RLE strategy for run-length encoding [Truta]
+    - When Z_RLE requested, restrict matches to distance one
+    - Update zlib.h, minigzip.c, gzopen(), gzdopen() for Z_RLE
+- Correct FASTEST compilation to allow level == 0
+- Clean up what gets compiled for FASTEST
+- Incorporate changes to zconf.in.h [Vollant]
+    - Refine detection of Turbo C need for dummy returns
+    - Refine ZLIB_DLL compilation
+    - Include additional header file on VMS for off_t typedef
+- Try to use _vsnprintf where it supplants vsprintf [Vollant]
+- Add some casts in inffast.c
+- Enchance comments in zlib.h on what happens if gzprintf() tries to
+  write more than 4095 bytes before compression
+- Remove unused state from inflateBackEnd()
+- Remove exit(0) from minigzip.c, example.c
+- Get rid of all those darn tabs
+- Add "check" target to Makefile.in that does the same thing as "test"
+- Add "mostlyclean" and "maintainer-clean" targets to Makefile.in
+- Update contrib/inflate86 [Anderson]
+- Update contrib/testzlib, contrib/vstudio, contrib/minizip [Vollant]
+- Add msdos and win32 directories with makefiles [Truta]
+- More additions and improvements to the FAQ
+
+Changes in 1.2.0 (9 March 2003)
+- New and improved inflate code
+    - About 20% faster
+    - Does not allocate 32K window unless and until needed
+    - Automatically detects and decompresses gzip streams
+    - Raw inflate no longer needs an extra dummy byte at end
+    - Added inflateBack functions using a callback interface--even faster
+      than inflate, useful for file utilities (gzip, zip)
+    - Added inflateCopy() function to record state for random access on
+      externally generated deflate streams (e.g. in gzip files)
+    - More readable code (I hope)
+- New and improved crc32()
+    - About 50% faster, thanks to suggestions from Rodney Brown
+- Add deflateBound() and compressBound() functions
+- Fix memory leak in deflateInit2()
+- Permit setting dictionary for raw deflate (for parallel deflate)
+- Fix const declaration for gzwrite()
+- Check for some malloc() failures in gzio.c
+- Fix bug in gzopen() on single-byte file 0x1f
+- Fix bug in gzread() on concatenated file with 0x1f at end of buffer
+  and next buffer doesn't start with 0x8b
+- Fix uncompress() to return Z_DATA_ERROR on truncated input
+- Free memory at end of example.c
+- Remove MAX #define in trees.c (conflicted with some libraries)
+- Fix static const's in deflate.c, gzio.c, and zutil.[ch]
+- Declare malloc() and free() in gzio.c if STDC not defined
+- Use malloc() instead of calloc() in zutil.c if int big enough
+- Define STDC for AIX
+- Add aix/ with approach for compiling shared library on AIX
+- Add HP-UX support for shared libraries in configure
+- Add OpenUNIX support for shared libraries in configure
+- Use $cc instead of gcc to build shared library
+- Make prefix directory if needed when installing
+- Correct Macintosh avoidance of typedef Byte in zconf.h
+- Correct Turbo C memory allocation when under Linux
+- Use libz.a instead of -lz in Makefile (assure use of compiled library)
+- Update configure to check for snprintf or vsnprintf functions and their
+  return value, warn during make if using an insecure function
+- Fix configure problem with compile-time knowledge of HAVE_UNISTD_H that
+  is lost when library is used--resolution is to build new zconf.h
+- Documentation improvements (in zlib.h):
+    - Document raw deflate and inflate
+    - Update RFCs URL
+    - Point out that zlib and gzip formats are different
+    - Note that Z_BUF_ERROR is not fatal
+    - Document string limit for gzprintf() and possible buffer overflow
+    - Note requirement on avail_out when flushing
+    - Note permitted values of flush parameter of inflate()
+- Add some FAQs (and even answers) to the FAQ
+- Add contrib/inflate86/ for x86 faster inflate
+- Add contrib/blast/ for PKWare Data Compression Library decompression
+- Add contrib/puff/ simple inflate for deflate format description
+
+Changes in 1.1.4 (11 March 2002)
+- ZFREE was repeated on same allocation on some error conditions.
+  This creates a security problem described in
+  http://www.zlib.org/advisory-2002-03-11.txt
+- Returned incorrect error (Z_MEM_ERROR) on some invalid data
+- Avoid accesses before window for invalid distances with inflate window
+  less than 32K.
+- force windowBits > 8 to avoid a bug in the encoder for a window size
+  of 256 bytes. (A complete fix will be available in 1.1.5).
+
+Changes in 1.1.3 (9 July 1998)
+- fix "an inflate input buffer bug that shows up on rare but persistent
+  occasions" (Mark)
+- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
+- fix gzseek(..., SEEK_SET) in write mode
+- fix crc check after a gzeek (Frank Faubert)
+- fix miniunzip when the last entry in a zip file is itself a zip file
+  (J Lillge)
+- add contrib/asm586 and contrib/asm686 (Brian Raiter)
+  See http://www.muppetlabs.com/~breadbox/software/assembly.html
+- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
+- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
+- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
+- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
+- added a FAQ file
+
+- Support gzdopen on Mac with Metrowerks (Jason Linhart)
+- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
+- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
+- avoid some warnings with Borland C (Tom Tanner)
+- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
+- emulate utime() for WIN32 in contrib/untgz  (Gilles Vollant)
+- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
+- use libdir and includedir in Makefile.in (Tim Mooney)
+- support shared libraries on OSF1 V4 (Tim Mooney)
+- remove so_locations in "make clean"  (Tim Mooney)
+- fix maketree.c compilation error (Glenn, Mark)
+- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
+- new Makefile.riscos (Rich Walker)
+- initialize static descriptors in trees.c for embedded targets (Nick Smith)
+- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
+- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
+- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
+- fix maketree.c to allow clean compilation of inffixed.h (Mark)
+- fix parameter check in deflateCopy (Gunther Nikl)
+- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
+- Many portability patches by Christian Spieler:
+  . zutil.c, zutil.h: added "const" for zmem*
+  . Make_vms.com: fixed some typos
+  . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
+  . msdos/Makefile.msc: remove "default rtl link library" info from obj files
+  . msdos/Makefile.*: use model-dependent name for the built zlib library
+  . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
+     new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
+- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
+- replace __far with _far for better portability (Christian Spieler, Tom Lane)
+- fix test for errno.h in configure (Tim Newsham)
+
+Changes in 1.1.2 (19 March 98)
+- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
+  See http://www.winimage.com/zLibDll/unzip.html
+- preinitialize the inflate tables for fixed codes, to make the code
+  completely thread safe (Mark)
+- some simplifications and slight speed-up to the inflate code (Mark)
+- fix gzeof on non-compressed files (Allan Schrum)
+- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs)
+- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn)
+- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
+- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori)
+- do not wrap extern "C" around system includes (Tom Lane)
+- mention zlib binding for TCL in README (Andreas Kupries)
+- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert)
+- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
+- allow "configure --prefix $HOME" (Tim Mooney)
+- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson)
+- move Makefile.sas to amiga/Makefile.sas
+
+Changes in 1.1.1 (27 Feb 98)
+- fix macros _tr_tally_* in deflate.h for debug mode  (Glenn Randers-Pehrson)
+- remove block truncation heuristic which had very marginal effect for zlib
+  (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
+  compression ratio on some files. This also allows inlining _tr_tally for
+  matches in deflate_slow.
+- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
+
+Changes in 1.1.0 (24 Feb 98)
+- do not return STREAM_END prematurely in inflate (John Bowler)
+- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
+- compile with -DFASTEST to get compression code optimized for speed only
+- in minigzip, try mmap'ing the input file first (Miguel Albrecht)
+- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain
+  on Sun but significant on HP)
+
+- add a pointer to experimental unzip library in README (Gilles Vollant)
+- initialize variable gcc in configure (Chris Herborth)
+
+Changes in 1.0.9 (17 Feb 1998)
+- added gzputs and gzgets functions
+- do not clear eof flag in gzseek (Mark Diekhans)
+- fix gzseek for files in transparent mode (Mark Diekhans)
+- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
+- replace EXPORT with ZEXPORT to avoid conflict with other programs
+- added compress2 in zconf.h, zlib.def, zlib.dnt
+- new asm code from Gilles Vollant in contrib/asm386
+- simplify the inflate code (Mark):
+ . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
+ . ZALLOC the length list in inflate_trees_fixed() instead of using stack
+ . ZALLOC the value area for huft_build() instead of using stack
+ . Simplify Z_FINISH check in inflate()
+
+- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
+- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
+- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
+  the declaration of FAR (Gilles VOllant)
+- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
+- read_buf buf parameter of type Bytef* instead of charf*
+- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
+- do not redeclare unlink in minigzip.c for WIN32 (John Bowler)
+- fix check for presence of directories in "make install" (Ian Willis)
+
+Changes in 1.0.8 (27 Jan 1998)
+- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
+- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
+- added compress2() to allow setting the compression level
+- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
+- use constant arrays for the static trees in trees.c instead of computing
+  them at run time (thanks to Ken Raeburn for this suggestion). To create
+  trees.h, compile with GEN_TREES_H and run "make test".
+- check return code of example in "make test" and display result
+- pass minigzip command line options to file_compress
+- simplifying code of inflateSync to avoid gcc 2.8 bug
+
+- support CC="gcc -Wall" in configure -s (QingLong)
+- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn)
+- fix test for shared library support to avoid compiler warnings
+- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant)
+- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit)
+- do not use fdopen for Metrowerks on Mac (Brad Pettit))
+- add checks for gzputc and gzputc in example.c
+- avoid warnings in gzio.c and deflate.c (Andreas Kleinert)
+- use const for the CRC table (Ken Raeburn)
+- fixed "make uninstall" for shared libraries
+- use Tracev instead of Trace in infblock.c
+- in example.c use correct compressed length for test_sync
+- suppress +vnocompatwarnings in configure for HPUX (not always supported)
+
+Changes in 1.0.7 (20 Jan 1998)
+- fix gzseek which was broken in write mode
+- return error for gzseek to negative absolute position
+- fix configure for Linux (Chun-Chung Chen)
+- increase stack space for MSC (Tim Wegner)
+- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant)
+- define EXPORTVA for gzprintf (Gilles Vollant)
+- added man page zlib.3 (Rick Rodgers)
+- for contrib/untgz, fix makedir() and improve Makefile
+
+- check gzseek in write mode in example.c
+- allocate extra buffer for seeks only if gzseek is actually called
+- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant)
+- add inflateSyncPoint in zconf.h
+- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def
+
+Changes in 1.0.6 (19 Jan 1998)
+- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
+  gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
+- Fix a deflate bug occurring only with compression level 0 (thanks to
+  Andy Buckler for finding this one).
+- In minigzip, pass transparently also the first byte for .Z files.
+- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
+- check Z_FINISH in inflate (thanks to Marc Schluper)
+- Implement deflateCopy (thanks to Adam Costello)
+- make static libraries by default in configure, add --shared option.
+- move MSDOS or Windows specific files to directory msdos
+- suppress the notion of partial flush to simplify the interface
+  (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
+- suppress history buffer provided by application to simplify the interface
+  (this feature was not implemented anyway in 1.0.4)
+- next_in and avail_in must be initialized before calling inflateInit or
+  inflateInit2
+- add EXPORT in all exported functions (for Windows DLL)
+- added Makefile.nt (thanks to Stephen Williams)
+- added the unsupported "contrib" directory:
+   contrib/asm386/ by Gilles Vollant <info@winimage.com>
+        386 asm code replacing longest_match().
+   contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
+        A C++ I/O streams interface to the zlib gz* functions
+   contrib/iostream2/  by Tyge Løvset <Tyge.Lovset@cmr.no>
+        Another C++ I/O streams interface
+   contrib/untgz/  by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
+        A very simple tar.gz file extractor using zlib
+   contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
+        How to use compress(), uncompress() and the gz* functions from VB.
+- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
+  level) in minigzip (thanks to Tom Lane)
+
+- use const for rommable constants in deflate
+- added test for gzseek and gztell in example.c
+- add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
+- add undocumented function zError to convert error code to string
+  (for Tim Smithers)
+- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
+- Use default memcpy for Symantec MSDOS compiler.
+- Add EXPORT keyword for check_func (needed for Windows DLL)
+- add current directory to LD_LIBRARY_PATH for "make test"
+- create also a link for libz.so.1
+- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
+- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
+- added -soname for Linux in configure (Chun-Chung Chen,
+- assign numbers to the exported functions in zlib.def (for Windows DLL)
+- add advice in zlib.h for best usage of deflateSetDictionary
+- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
+- allow compilation with ANSI keywords only enabled for TurboC in large model
+- avoid "versionString"[0] (Borland bug)
+- add NEED_DUMMY_RETURN for Borland
+- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
+- allow compilation with CC
+- defined STDC for OS/2 (David Charlap)
+- limit external names to 8 chars for MVS (Thomas Lund)
+- in minigzip.c, use static buffers only for 16-bit systems
+- fix suffix check for "minigzip -d foo.gz"
+- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
+- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
+- added makelcc.bat for lcc-win32 (Tom St Denis)
+- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
+- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
+- check for unistd.h in configure (for off_t)
+- remove useless check parameter in inflate_blocks_free
+- avoid useless assignment of s->check to itself in inflate_blocks_new
+- do not flush twice in gzclose (thanks to Ken Raeburn)
+- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
+- use NO_ERRNO_H instead of enumeration of operating systems with errno.h
+- work around buggy fclose on pipes for HP/UX
+- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson)
+- fix configure if CC is already equal to gcc
+
+Changes in 1.0.5 (3 Jan 98)
+- Fix inflate to terminate gracefully when fed corrupted or invalid data
+- Use const for rommable constants in inflate
+- Eliminate memory leaks on error conditions in inflate
+- Removed some vestigial code in inflate
+- Update web address in README
+
+Changes in 1.0.4 (24 Jul 96)
+- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
+  bit, so the decompressor could decompress all the correct data but went
+  on to attempt decompressing extra garbage data. This affected minigzip too.
+- zlibVersion and gzerror return const char* (needed for DLL)
+- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
+- use z_error only for DEBUG (avoid problem with DLLs)
+
+Changes in 1.0.3 (2 Jul 96)
+- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS
+  small and medium models; this makes the library incompatible with previous
+  versions for these models. (No effect in large model or on other systems.)
+- return OK instead of BUF_ERROR if previous deflate call returned with
+  avail_out as zero but there is nothing to do
+- added memcmp for non STDC compilers
+- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly)
+- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO)
+- better check for 16-bit mode MSC (avoids problem with Symantec)
+
+Changes in 1.0.2 (23 May 96)
+- added Windows DLL support
+- added a function zlibVersion (for the DLL support)
+- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model)
+- Bytef is define's instead of typedef'd only for Borland C
+- avoid reading uninitialized memory in example.c
+- mention in README that the zlib format is now RFC1950
+- updated Makefile.dj2
+- added algorithm.doc
+
+Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
+- fix array overlay in deflate.c which sometimes caused bad compressed data
+- fix inflate bug with empty stored block
+- fix MSDOS medium model which was broken in 0.99
+- fix deflateParams() which could generate bad compressed data.
+- Bytef is define'd instead of typedef'ed (work around Borland bug)
+- added an INDEX file
+- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
+  Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
+- speed up adler32 for modern machines without auto-increment
+- added -ansi for IRIX in configure
+- static_init_done in trees.c is an int
+- define unlink as delete for VMS
+- fix configure for QNX
+- add configure branch for SCO and HPUX
+- avoid many warnings (unused variables, dead assignments, etc...)
+- no fdopen for BeOS
+- fix the Watcom fix for 32 bit mode (define FAR as empty)
+- removed redefinition of Byte for MKWERKS
+- work around an MWKERKS bug (incorrect merge of all .h files)
+
+Changes in 0.99 (27 Jan 96)
+- allow preset dictionary shared between compressor and decompressor
+- allow compression level 0 (no compression)
+- add deflateParams in zlib.h: allow dynamic change of compression level
+  and compression strategy.
+- test large buffers and deflateParams in example.c
+- add optional "configure" to build zlib as a shared library
+- suppress Makefile.qnx, use configure instead
+- fixed deflate for 64-bit systems (detected on Cray)
+- fixed inflate_blocks for 64-bit systems (detected on Alpha)
+- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2)
+- always return Z_BUF_ERROR when deflate() has nothing to do
+- deflateInit and inflateInit are now macros to allow version checking
+- prefix all global functions and types with z_ with -DZ_PREFIX
+- make falloc completely reentrant (inftrees.c)
+- fixed very unlikely race condition in ct_static_init
+- free in reverse order of allocation to help memory manager
+- use zlib-1.0/* instead of zlib/* inside the tar.gz
+- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith
+  -Wconversion -Wstrict-prototypes -Wmissing-prototypes"
+- allow gzread on concatenated .gz files
+- deflateEnd now returns Z_DATA_ERROR if it was premature
+- deflate is finally (?) fully deterministic (no matches beyond end of input)
+- Document Z_SYNC_FLUSH
+- add uninstall in Makefile
+- Check for __cpluplus in zlib.h
+- Better test in ct_align for partial flush
+- avoid harmless warnings for Borland C++
+- initialize hash_head in deflate.c
+- avoid warning on fdopen (gzio.c) for HP cc -Aa
+- include stdlib.h for STDC compilers
+- include errno.h for Cray
+- ignore error if ranlib doesn't exist
+- call ranlib twice for NeXTSTEP
+- use exec_prefix instead of prefix for libz.a
+- renamed ct_* as _tr_* to avoid conflict with applications
+- clear z->msg in inflateInit2 before any error return
+- initialize opaque in example.c, gzio.c, deflate.c and inflate.c
+- fixed typo in zconf.h (_GNUC__ => __GNUC__)
+- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode)
+- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
+- in fcalloc, normalize pointer if size > 65520 bytes
+- don't use special fcalloc for 32 bit Borland C++
+- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
+- use Z_BINARY instead of BINARY
+- document that gzclose after gzdopen will close the file
+- allow "a" as mode in gzopen.
+- fix error checking in gzread
+- allow skipping .gz extra-field on pipes
+- added reference to Perl interface in README
+- put the crc table in FAR data (I dislike more and more the medium model :)
+- added get_crc_table
+- added a dimension to all arrays (Borland C can't count).
+- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
+- guard against multiple inclusion of *.h (for precompiled header on Mac)
+- Watcom C pretends to be Microsoft C small model even in 32 bit mode.
+- don't use unsized arrays to avoid silly warnings by Visual C++:
+     warning C4746: 'inflate_mask' : unsized array treated as  '__far'
+     (what's wrong with far data in far model?).
+- define enum out of inflate_blocks_state to allow compilation with C++
+
+Changes in 0.95 (16 Aug 95)
+- fix MSDOS small and medium model (now easier to adapt to any compiler)
+- inlined send_bits
+- fix the final (:-) bug for deflate with flush (output was correct but
+  not completely flushed in rare occasions).
+- default window size is same for compression and decompression
+  (it's now sufficient to set MAX_WBITS in zconf.h).
+- voidp -> voidpf and voidnp -> voidp (for consistency with other
+  typedefs and because voidnp was not near in large model).
+
+Changes in 0.94 (13 Aug 95)
+- support MSDOS medium model
+- fix deflate with flush (could sometimes generate bad output)
+- fix deflateReset (zlib header was incorrectly suppressed)
+- added support for VMS
+- allow a compression level in gzopen()
+- gzflush now calls fflush
+- For deflate with flush, flush even if no more input is provided.
+- rename libgz.a as libz.a
+- avoid complex expression in infcodes.c triggering Turbo C bug
+- work around a problem with gcc on Alpha (in INSERT_STRING)
+- don't use inline functions (problem with some gcc versions)
+- allow renaming of Byte, uInt, etc... with #define.
+- avoid warning about (unused) pointer before start of array in deflate.c
+- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
+- avoid reserved word 'new' in trees.c
+
+Changes in 0.93 (25 June 95)
+- temporarily disable inline functions
+- make deflate deterministic
+- give enough lookahead for PARTIAL_FLUSH
+- Set binary mode for stdin/stdout in minigzip.c for OS/2
+- don't even use signed char in inflate (not portable enough)
+- fix inflate memory leak for segmented architectures
+
+Changes in 0.92 (3 May 95)
+- don't assume that char is signed (problem on SGI)
+- Clear bit buffer when starting a stored block
+- no memcpy on Pyramid
+- suppressed inftest.c
+- optimized fill_window, put longest_match inline for gcc
+- optimized inflate on stored blocks.
+- untabify all sources to simplify patches
+
+Changes in 0.91 (2 May 95)
+- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
+- Document the memory requirements in zconf.h
+- added "make install"
+- fix sync search logic in inflateSync
+- deflate(Z_FULL_FLUSH) now works even if output buffer too short
+- after inflateSync, don't scare people with just "lo world"
+- added support for DJGPP
+
+Changes in 0.9 (1 May 95)
+- don't assume that zalloc clears the allocated memory (the TurboC bug
+  was Mark's bug after all :)
+- let again gzread copy uncompressed data unchanged (was working in 0.71)
+- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
+- added a test of inflateSync in example.c
+- moved MAX_WBITS to zconf.h because users might want to change that.
+- document explicitly that zalloc(64K) on MSDOS must return a normalized
+  pointer (zero offset)
+- added Makefiles for Microsoft C, Turbo C, Borland C++
+- faster crc32()
+
+Changes in 0.8 (29 April 95)
+- added fast inflate (inffast.c)
+- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
+  is incompatible with previous versions of zlib which returned Z_OK.
+- work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
+  (actually that was not a compiler bug, see 0.81 above)
+- gzread no longer reads one extra byte in certain cases
+- In gzio destroy(), don't reference a freed structure
+- avoid many warnings for MSDOS
+- avoid the ERROR symbol which is used by MS Windows
+
+Changes in 0.71 (14 April 95)
+- Fixed more MSDOS compilation problems :( There is still a bug with
+  TurboC large model.
+
+Changes in 0.7 (14 April 95)
+- Added full inflate support.
+- Simplified the crc32() interface. The pre- and post-conditioning
+  (one's complement) is now done inside crc32(). WARNING: this is
+  incompatible with previous versions; see zlib.h for the new usage.
+
+Changes in 0.61 (12 April 95)
+- workaround for a bug in TurboC. example and minigzip now work on MSDOS.
+
+Changes in 0.6 (11 April 95)
+- added minigzip.c
+- added gzdopen to reopen a file descriptor as gzFile
+- added transparent reading of non-gziped files in gzread.
+- fixed bug in gzread (don't read crc as data)
+- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose).
+- don't allocate big arrays in the stack (for MSDOS)
+- fix some MSDOS compilation problems
+
+Changes in 0.5:
+- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
+  not yet Z_FULL_FLUSH.
+- support decompression but only in a single step (forced Z_FINISH)
+- added opaque object for zalloc and zfree.
+- added deflateReset and inflateReset
+- added a variable zlib_version for consistency checking.
+- renamed the 'filter' parameter of deflateInit2 as 'strategy'.
+  Added Z_FILTERED and Z_HUFFMAN_ONLY constants.
+
+Changes in 0.4:
+- avoid "zip" everywhere, use zlib instead of ziplib.
+- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
+  if compression method == 8.
+- added adler32 and crc32
+- renamed deflateOptions as deflateInit2, call one or the other but not both
+- added the method parameter for deflateInit2.
+- added inflateInit2
+- simplied considerably deflateInit and inflateInit by not supporting
+  user-provided history buffer. This is supported only in deflateInit2
+  and inflateInit2.
+
+Changes in 0.3:
+- prefix all macro names with Z_
+- use Z_FINISH instead of deflateEnd to finish compression.
+- added Z_HUFFMAN_ONLY
+- added gzerror()
diff --git a/jdk/src/java.base/share/native/libzip/zlib/README b/jdk/src/java.base/share/native/libzip/zlib/README
new file mode 100644
index 0000000..51106de
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/README
@@ -0,0 +1,115 @@
+ZLIB DATA COMPRESSION LIBRARY
+
+zlib 1.2.11 is a general purpose data compression library.  All the code is
+thread safe.  The data format used by the zlib library is described by RFCs
+(Request for Comments) 1950 to 1952 in the files
+http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
+rfc1952 (gzip format).
+
+All functions of the compression library are documented in the file zlib.h
+(volunteer to write man pages welcome, contact zlib@gzip.org).  A usage example
+of the library is given in the file test/example.c which also tests that
+the library is working correctly.  Another example is given in the file
+test/minigzip.c.  The compression library itself is composed of all source
+files in the root directory.
+
+To compile all files and run the test program, follow the instructions given at
+the top of Makefile.in.  In short "./configure; make test", and if that goes
+well, "make install" should work for most flavors of Unix.  For Windows, use
+one of the special makefiles in win32/ or contrib/vstudio/ .  For VMS, use
+make_vms.com.
+
+Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
+<info@winimage.com> for the Windows DLL version.  The zlib home page is
+http://zlib.net/ .  Before reporting a problem, please check this site to
+verify that you have the latest version of zlib; otherwise get the latest
+version and check whether the problem still exists or not.
+
+PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
+
+Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan.  1997
+issue of Dr.  Dobb's Journal; a copy of the article is available at
+http://marknelson.us/1997/01/01/zlib-engine/ .
+
+The changes made in version 1.2.11 are documented in the file ChangeLog.
+
+Unsupported third party contributions are provided in directory contrib/ .
+
+zlib is available in Java using the java.util.zip package, documented at
+http://java.sun.com/developer/technicalArticles/Programming/compression/ .
+
+A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
+at CPAN (Comprehensive Perl Archive Network) sites, including
+http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
+
+A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
+available in Python 1.5 and later versions, see
+http://docs.python.org/library/zlib.html .
+
+zlib is built into tcl: http://wiki.tcl.tk/4610 .
+
+An experimental package to read and write files in .zip format, written on top
+of zlib by Gilles Vollant <info@winimage.com>, is available in the
+contrib/minizip directory of zlib.
+
+
+Notes for some targets:
+
+- For Windows DLL versions, please see win32/DLL_FAQ.txt
+
+- For 64-bit Irix, deflate.c must be compiled without any optimization. With
+  -O, one libpng test fails. The test works in 32 bit mode (with the -n32
+  compiler flag). The compiler bug has been reported to SGI.
+
+- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
+  when compiled with cc.
+
+- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
+  necessary to get gzprintf working correctly. This is done by configure.
+
+- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
+  other compilers. Use "make test" to check your compiler.
+
+- gzdopen is not supported on RISCOS or BEOS.
+
+- For PalmOs, see http://palmzlib.sourceforge.net/
+
+
+Acknowledgments:
+
+  The deflate format used by zlib was defined by Phil Katz.  The deflate and
+  zlib specifications were written by L.  Peter Deutsch.  Thanks to all the
+  people who reported problems and suggested various improvements in zlib; they
+  are too numerous to cite here.
+
+Copyright notice:
+
+ (C) 1995-2017 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not* receiving
+lengthy legal documents to sign.  The sources are provided for free but without
+warranty of any kind.  The library has been entirely written by Jean-loup
+Gailly and Mark Adler; it does not include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include in
+the file ChangeLog history information documenting your changes.  Please read
+the FAQ for more information on the distribution of modified source versions.
diff --git a/jdk/src/java.base/share/native/libzip/zlib/compress.c b/jdk/src/java.base/share/native/libzip/zlib/compress.c
new file mode 100644
index 0000000..a9d3b98
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/compress.c
@@ -0,0 +1,110 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* compress.c -- compress a memory buffer
+ * Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+/* ===========================================================================
+     Compresses the source buffer into the destination buffer. The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer. Upon entry, destLen is the total size of the
+   destination buffer, which must be at least 0.1% larger than sourceLen plus
+   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
+    Bytef *dest;
+    uLongf *destLen;
+    const Bytef *source;
+    uLong sourceLen;
+    int level;
+{
+    z_stream stream;
+    int err;
+    const uInt max = (uInt)-1;
+    uLong left;
+
+    left = *destLen;
+    *destLen = 0;
+
+    stream.zalloc = (alloc_func)0;
+    stream.zfree = (free_func)0;
+    stream.opaque = (voidpf)0;
+
+    err = deflateInit(&stream, level);
+    if (err != Z_OK) return err;
+
+    stream.next_out = dest;
+    stream.avail_out = 0;
+    stream.next_in = (z_const Bytef *)source;
+    stream.avail_in = 0;
+
+    do {
+        if (stream.avail_out == 0) {
+            stream.avail_out = left > (uLong)max ? max : (uInt)left;
+            left -= stream.avail_out;
+        }
+        if (stream.avail_in == 0) {
+            stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
+            sourceLen -= stream.avail_in;
+        }
+        err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
+    } while (err == Z_OK);
+
+    *destLen = stream.total_out;
+    deflateEnd(&stream);
+    return err == Z_STREAM_END ? Z_OK : err;
+}
+
+/* ===========================================================================
+ */
+int ZEXPORT compress (dest, destLen, source, sourceLen)
+    Bytef *dest;
+    uLongf *destLen;
+    const Bytef *source;
+    uLong sourceLen;
+{
+    return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
+}
+
+/* ===========================================================================
+     If the default memLevel or windowBits for deflateInit() is changed, then
+   this function needs to be updated.
+ */
+uLong ZEXPORT compressBound (sourceLen)
+    uLong sourceLen;
+{
+    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+           (sourceLen >> 25) + 13;
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/crc32.h b/jdk/src/java.base/share/native/libzip/zlib/crc32.h
similarity index 100%
rename from jdk/src/java.base/share/native/libzip/zlib-1.2.8/crc32.h
rename to jdk/src/java.base/share/native/libzip/zlib/crc32.h
diff --git a/jdk/src/java.base/share/native/libzip/zlib/deflate.c b/jdk/src/java.base/share/native/libzip/zlib/deflate.c
new file mode 100644
index 0000000..d0ee5fe
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/deflate.c
@@ -0,0 +1,2187 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* deflate.c -- compress data using the deflation algorithm
+ * Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ *  ALGORITHM
+ *
+ *      The "deflation" process depends on being able to identify portions
+ *      of the input text which are identical to earlier input (within a
+ *      sliding window trailing behind the input currently being processed).
+ *
+ *      The most straightforward technique turns out to be the fastest for
+ *      most input files: try all possible matches and select the longest.
+ *      The key feature of this algorithm is that insertions into the string
+ *      dictionary are very simple and thus fast, and deletions are avoided
+ *      completely. Insertions are performed at each input character, whereas
+ *      string matches are performed only when the previous match ends. So it
+ *      is preferable to spend more time in matches to allow very fast string
+ *      insertions and avoid deletions. The matching algorithm for small
+ *      strings is inspired from that of Rabin & Karp. A brute force approach
+ *      is used to find longer strings when a small match has been found.
+ *      A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
+ *      (by Leonid Broukhis).
+ *         A previous version of this file used a more sophisticated algorithm
+ *      (by Fiala and Greene) which is guaranteed to run in linear amortized
+ *      time, but has a larger average cost, uses more memory and is patented.
+ *      However the F&G algorithm may be faster for some highly redundant
+ *      files if the parameter max_chain_length (described below) is too large.
+ *
+ *  ACKNOWLEDGEMENTS
+ *
+ *      The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
+ *      I found it in 'freeze' written by Leonid Broukhis.
+ *      Thanks to many people for bug reports and testing.
+ *
+ *  REFERENCES
+ *
+ *      Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
+ *      Available in http://tools.ietf.org/html/rfc1951
+ *
+ *      A description of the Rabin and Karp algorithm is given in the book
+ *         "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
+ *
+ *      Fiala,E.R., and Greene,D.H.
+ *         Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
+ *
+ */
+
+/* @(#) $Id$ */
+
+#include "deflate.h"
+
+const char deflate_copyright[] =
+   " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler ";
+/*
+  If you use the zlib library in a product, an acknowledgment is welcome
+  in the documentation of your product. If for some reason you cannot
+  include such an acknowledgment, I would appreciate that you keep this
+  copyright string in the executable of your product.
+ */
+
+/* ===========================================================================
+ *  Function prototypes.
+ */
+typedef enum {
+    need_more,      /* block not completed, need more input or more output */
+    block_done,     /* block flush performed */
+    finish_started, /* finish started, need only more output at next deflate */
+    finish_done     /* finish done, accept no more input or output */
+} block_state;
+
+typedef block_state (*compress_func) OF((deflate_state *s, int flush));
+/* Compression function. Returns the block state after the call. */
+
+local int deflateStateCheck      OF((z_streamp strm));
+local void slide_hash     OF((deflate_state *s));
+local void fill_window    OF((deflate_state *s));
+local block_state deflate_stored OF((deflate_state *s, int flush));
+local block_state deflate_fast   OF((deflate_state *s, int flush));
+#ifndef FASTEST
+local block_state deflate_slow   OF((deflate_state *s, int flush));
+#endif
+local block_state deflate_rle    OF((deflate_state *s, int flush));
+local block_state deflate_huff   OF((deflate_state *s, int flush));
+local void lm_init        OF((deflate_state *s));
+local void putShortMSB    OF((deflate_state *s, uInt b));
+local void flush_pending  OF((z_streamp strm));
+local unsigned read_buf   OF((z_streamp strm, Bytef *buf, unsigned size));
+#ifdef ASMV
+#  pragma message("Assembler code may have bugs -- use at your own risk")
+      void match_init OF((void)); /* asm code initialization */
+      uInt longest_match  OF((deflate_state *s, IPos cur_match));
+#else
+local uInt longest_match  OF((deflate_state *s, IPos cur_match));
+#endif
+
+#ifdef ZLIB_DEBUG
+local  void check_match OF((deflate_state *s, IPos start, IPos match,
+                            int length));
+#endif
+
+/* ===========================================================================
+ * Local data
+ */
+
+#define NIL 0
+/* Tail of hash chains */
+
+#ifndef TOO_FAR
+#  define TOO_FAR 4096
+#endif
+/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
+
+/* Values for max_lazy_match, good_match and max_chain_length, depending on
+ * the desired pack level (0..9). The values given below have been tuned to
+ * exclude worst case performance for pathological files. Better values may be
+ * found for specific files.
+ */
+typedef struct config_s {
+   ush good_length; /* reduce lazy search above this match length */
+   ush max_lazy;    /* do not perform lazy search above this match length */
+   ush nice_length; /* quit search above this match length */
+   ush max_chain;
+   compress_func func;
+} config;
+
+#ifdef FASTEST
+local const config configuration_table[2] = {
+/*      good lazy nice chain */
+/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
+/* 1 */ {4,    4,  8,    4, deflate_fast}}; /* max speed, no lazy matches */
+#else
+local const config configuration_table[10] = {
+/*      good lazy nice chain */
+/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */
+/* 1 */ {4,    4,  8,    4, deflate_fast}, /* max speed, no lazy matches */
+/* 2 */ {4,    5, 16,    8, deflate_fast},
+/* 3 */ {4,    6, 32,   32, deflate_fast},
+
+/* 4 */ {4,    4, 16,   16, deflate_slow},  /* lazy matches */
+/* 5 */ {8,   16, 32,   32, deflate_slow},
+/* 6 */ {8,   16, 128, 128, deflate_slow},
+/* 7 */ {8,   32, 128, 256, deflate_slow},
+/* 8 */ {32, 128, 258, 1024, deflate_slow},
+/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
+#endif
+
+/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
+ * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
+ * meaning.
+ */
+
+/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
+#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
+
+/* ===========================================================================
+ * Update a hash value with the given input byte
+ * IN  assertion: all calls to UPDATE_HASH are made with consecutive input
+ *    characters, so that a running hash key can be computed from the previous
+ *    key instead of complete recalculation each time.
+ */
+#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
+
+
+/* ===========================================================================
+ * Insert string str in the dictionary and set match_head to the previous head
+ * of the hash chain (the most recent string with same hash key). Return
+ * the previous length of the hash chain.
+ * If this file is compiled with -DFASTEST, the compression level is forced
+ * to 1, and no hash chains are maintained.
+ * IN  assertion: all calls to INSERT_STRING are made with consecutive input
+ *    characters and the first MIN_MATCH bytes of str are valid (except for
+ *    the last MIN_MATCH-1 bytes of the input file).
+ */
+#ifdef FASTEST
+#define INSERT_STRING(s, str, match_head) \
+   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+    match_head = s->head[s->ins_h], \
+    s->head[s->ins_h] = (Pos)(str))
+#else
+#define INSERT_STRING(s, str, match_head) \
+   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
+    s->head[s->ins_h] = (Pos)(str))
+#endif
+
+/* ===========================================================================
+ * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
+ * prev[] will be initialized on the fly.
+ */
+#define CLEAR_HASH(s) \
+    s->head[s->hash_size-1] = NIL; \
+    zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+
+/* ===========================================================================
+ * Slide the hash table when sliding the window down (could be avoided with 32
+ * bit values at the expense of memory usage). We slide even when level == 0 to
+ * keep the hash table consistent if we switch back to level > 0 later.
+ */
+local void slide_hash(s)
+    deflate_state *s;
+{
+    unsigned n, m;
+    Posf *p;
+    uInt wsize = s->w_size;
+
+    n = s->hash_size;
+    p = &s->head[n];
+    do {
+        m = *--p;
+        *p = (Pos)(m >= wsize ? m - wsize : NIL);
+    } while (--n);
+    n = wsize;
+#ifndef FASTEST
+    p = &s->prev[n];
+    do {
+        m = *--p;
+        *p = (Pos)(m >= wsize ? m - wsize : NIL);
+        /* If n is not on any hash chain, prev[n] is garbage but
+         * its value will never be used.
+         */
+    } while (--n);
+#endif
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateInit_(strm, level, version, stream_size)
+    z_streamp strm;
+    int level;
+    const char *version;
+    int stream_size;
+{
+    return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
+                         Z_DEFAULT_STRATEGY, version, stream_size);
+    /* To do: ignore strm->next_in if we use it as window */
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
+                  version, stream_size)
+    z_streamp strm;
+    int  level;
+    int  method;
+    int  windowBits;
+    int  memLevel;
+    int  strategy;
+    const char *version;
+    int stream_size;
+{
+    deflate_state *s;
+    int wrap = 1;
+    static const char my_version[] = ZLIB_VERSION;
+
+    ushf *overlay;
+    /* We overlay pending_buf and d_buf+l_buf. This works since the average
+     * output size for (length,distance) codes is <= 24 bits.
+     */
+
+    if (version == Z_NULL || version[0] != my_version[0] ||
+        stream_size != sizeof(z_stream)) {
+        return Z_VERSION_ERROR;
+    }
+    if (strm == Z_NULL) return Z_STREAM_ERROR;
+
+    strm->msg = Z_NULL;
+    if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zalloc = zcalloc;
+        strm->opaque = (voidpf)0;
+#endif
+    }
+    if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zfree = zcfree;
+#endif
+
+#ifdef FASTEST
+    if (level != 0) level = 1;
+#else
+    if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#endif
+
+    if (windowBits < 0) { /* suppress zlib wrapper */
+        wrap = 0;
+        windowBits = -windowBits;
+    }
+#ifdef GZIP
+    else if (windowBits > 15) {
+        wrap = 2;       /* write gzip wrapper instead */
+        windowBits -= 16;
+    }
+#endif
+    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
+        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
+        strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) {
+        return Z_STREAM_ERROR;
+    }
+    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
+    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
+    if (s == Z_NULL) return Z_MEM_ERROR;
+    strm->state = (struct internal_state FAR *)s;
+    s->strm = strm;
+    s->status = INIT_STATE;     /* to pass state test in deflateReset() */
+
+    s->wrap = wrap;
+    s->gzhead = Z_NULL;
+    s->w_bits = (uInt)windowBits;
+    s->w_size = 1 << s->w_bits;
+    s->w_mask = s->w_size - 1;
+
+    s->hash_bits = (uInt)memLevel + 7;
+    s->hash_size = 1 << s->hash_bits;
+    s->hash_mask = s->hash_size - 1;
+    s->hash_shift =  ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
+
+    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
+    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
+    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
+
+    s->high_water = 0;      /* nothing written to s->window yet */
+
+    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
+
+    overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
+    s->pending_buf = (uchf *) overlay;
+    s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
+
+    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
+        s->pending_buf == Z_NULL) {
+        s->status = FINISH_STATE;
+        strm->msg = ERR_MSG(Z_MEM_ERROR);
+        deflateEnd (strm);
+        return Z_MEM_ERROR;
+    }
+    s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
+    s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
+
+    s->level = level;
+    s->strategy = strategy;
+    s->method = (Byte)method;
+
+    return deflateReset(strm);
+}
+
+/* =========================================================================
+ * Check for a valid deflate stream state. Return 0 if ok, 1 if not.
+ */
+local int deflateStateCheck (strm)
+    z_streamp strm;
+{
+    deflate_state *s;
+    if (strm == Z_NULL ||
+        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
+        return 1;
+    s = strm->state;
+    if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
+#ifdef GZIP
+                                           s->status != GZIP_STATE &&
+#endif
+                                           s->status != EXTRA_STATE &&
+                                           s->status != NAME_STATE &&
+                                           s->status != COMMENT_STATE &&
+                                           s->status != HCRC_STATE &&
+                                           s->status != BUSY_STATE &&
+                                           s->status != FINISH_STATE))
+        return 1;
+    return 0;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
+    z_streamp strm;
+    const Bytef *dictionary;
+    uInt  dictLength;
+{
+    deflate_state *s;
+    uInt str, n;
+    int wrap;
+    unsigned avail;
+    z_const unsigned char *next;
+
+    if (deflateStateCheck(strm) || dictionary == Z_NULL)
+        return Z_STREAM_ERROR;
+    s = strm->state;
+    wrap = s->wrap;
+    if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
+        return Z_STREAM_ERROR;
+
+    /* when using zlib wrappers, compute Adler-32 for provided dictionary */
+    if (wrap == 1)
+        strm->adler = adler32(strm->adler, dictionary, dictLength);
+    s->wrap = 0;                    /* avoid computing Adler-32 in read_buf */
+
+    /* if dictionary would fill window, just replace the history */
+    if (dictLength >= s->w_size) {
+        if (wrap == 0) {            /* already empty otherwise */
+            CLEAR_HASH(s);
+            s->strstart = 0;
+            s->block_start = 0L;
+            s->insert = 0;
+        }
+        dictionary += dictLength - s->w_size;  /* use the tail */
+        dictLength = s->w_size;
+    }
+
+    /* insert dictionary into window and hash */
+    avail = strm->avail_in;
+    next = strm->next_in;
+    strm->avail_in = dictLength;
+    strm->next_in = (z_const Bytef *)dictionary;
+    fill_window(s);
+    while (s->lookahead >= MIN_MATCH) {
+        str = s->strstart;
+        n = s->lookahead - (MIN_MATCH-1);
+        do {
+            UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+            s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+            s->head[s->ins_h] = (Pos)str;
+            str++;
+        } while (--n);
+        s->strstart = str;
+        s->lookahead = MIN_MATCH-1;
+        fill_window(s);
+    }
+    s->strstart += s->lookahead;
+    s->block_start = (long)s->strstart;
+    s->insert = s->lookahead;
+    s->lookahead = 0;
+    s->match_length = s->prev_length = MIN_MATCH-1;
+    s->match_available = 0;
+    strm->next_in = next;
+    strm->avail_in = avail;
+    s->wrap = wrap;
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength)
+    z_streamp strm;
+    Bytef *dictionary;
+    uInt  *dictLength;
+{
+    deflate_state *s;
+    uInt len;
+
+    if (deflateStateCheck(strm))
+        return Z_STREAM_ERROR;
+    s = strm->state;
+    len = s->strstart + s->lookahead;
+    if (len > s->w_size)
+        len = s->w_size;
+    if (dictionary != Z_NULL && len)
+        zmemcpy(dictionary, s->window + s->strstart + s->lookahead - len, len);
+    if (dictLength != Z_NULL)
+        *dictLength = len;
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateResetKeep (strm)
+    z_streamp strm;
+{
+    deflate_state *s;
+
+    if (deflateStateCheck(strm)) {
+        return Z_STREAM_ERROR;
+    }
+
+    strm->total_in = strm->total_out = 0;
+    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
+    strm->data_type = Z_UNKNOWN;
+
+    s = (deflate_state *)strm->state;
+    s->pending = 0;
+    s->pending_out = s->pending_buf;
+
+    if (s->wrap < 0) {
+        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
+    }
+    s->status =
+#ifdef GZIP
+        s->wrap == 2 ? GZIP_STATE :
+#endif
+        s->wrap ? INIT_STATE : BUSY_STATE;
+    strm->adler =
+#ifdef GZIP
+        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
+#endif
+        adler32(0L, Z_NULL, 0);
+    s->last_flush = Z_NO_FLUSH;
+
+    _tr_init(s);
+
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateReset (strm)
+    z_streamp strm;
+{
+    int ret;
+
+    ret = deflateResetKeep(strm);
+    if (ret == Z_OK)
+        lm_init(strm->state);
+    return ret;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateSetHeader (strm, head)
+    z_streamp strm;
+    gz_headerp head;
+{
+    if (deflateStateCheck(strm) || strm->state->wrap != 2)
+        return Z_STREAM_ERROR;
+    strm->state->gzhead = head;
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflatePending (strm, pending, bits)
+    unsigned *pending;
+    int *bits;
+    z_streamp strm;
+{
+    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
+    if (pending != Z_NULL)
+        *pending = strm->state->pending;
+    if (bits != Z_NULL)
+        *bits = strm->state->bi_valid;
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflatePrime (strm, bits, value)
+    z_streamp strm;
+    int bits;
+    int value;
+{
+    deflate_state *s;
+    int put;
+
+    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
+    s = strm->state;
+    if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
+        return Z_BUF_ERROR;
+    do {
+        put = Buf_size - s->bi_valid;
+        if (put > bits)
+            put = bits;
+        s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid);
+        s->bi_valid += put;
+        _tr_flush_bits(s);
+        value >>= put;
+        bits -= put;
+    } while (bits);
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateParams(strm, level, strategy)
+    z_streamp strm;
+    int level;
+    int strategy;
+{
+    deflate_state *s;
+    compress_func func;
+
+    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
+    s = strm->state;
+
+#ifdef FASTEST
+    if (level != 0) level = 1;
+#else
+    if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#endif
+    if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
+        return Z_STREAM_ERROR;
+    }
+    func = configuration_table[s->level].func;
+
+    if ((strategy != s->strategy || func != configuration_table[level].func) &&
+        s->high_water) {
+        /* Flush the last buffer: */
+        int err = deflate(strm, Z_BLOCK);
+        if (err == Z_STREAM_ERROR)
+            return err;
+        if (strm->avail_out == 0)
+            return Z_BUF_ERROR;
+    }
+    if (s->level != level) {
+        if (s->level == 0 && s->matches != 0) {
+            if (s->matches == 1)
+                slide_hash(s);
+            else
+                CLEAR_HASH(s);
+            s->matches = 0;
+        }
+        s->level = level;
+        s->max_lazy_match   = configuration_table[level].max_lazy;
+        s->good_match       = configuration_table[level].good_length;
+        s->nice_match       = configuration_table[level].nice_length;
+        s->max_chain_length = configuration_table[level].max_chain;
+    }
+    s->strategy = strategy;
+    return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
+    z_streamp strm;
+    int good_length;
+    int max_lazy;
+    int nice_length;
+    int max_chain;
+{
+    deflate_state *s;
+
+    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
+    s = strm->state;
+    s->good_match = (uInt)good_length;
+    s->max_lazy_match = (uInt)max_lazy;
+    s->nice_match = nice_length;
+    s->max_chain_length = (uInt)max_chain;
+    return Z_OK;
+}
+
+/* =========================================================================
+ * For the default windowBits of 15 and memLevel of 8, this function returns
+ * a close to exact, as well as small, upper bound on the compressed size.
+ * They are coded as constants here for a reason--if the #define's are
+ * changed, then this function needs to be changed as well.  The return
+ * value for 15 and 8 only works for those exact settings.
+ *
+ * For any setting other than those defaults for windowBits and memLevel,
+ * the value returned is a conservative worst case for the maximum expansion
+ * resulting from using fixed blocks instead of stored blocks, which deflate
+ * can emit on compressed data for some combinations of the parameters.
+ *
+ * This function could be more sophisticated to provide closer upper bounds for
+ * every combination of windowBits and memLevel.  But even the conservative
+ * upper bound of about 14% expansion does not seem onerous for output buffer
+ * allocation.
+ */
+uLong ZEXPORT deflateBound(strm, sourceLen)
+    z_streamp strm;
+    uLong sourceLen;
+{
+    deflate_state *s;
+    uLong complen, wraplen;
+
+    /* conservative upper bound for compressed data */
+    complen = sourceLen +
+              ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
+
+    /* if can't get parameters, return conservative bound plus zlib wrapper */
+    if (deflateStateCheck(strm))
+        return complen + 6;
+
+    /* compute wrapper length */
+    s = strm->state;
+    switch (s->wrap) {
+    case 0:                                 /* raw deflate */
+        wraplen = 0;
+        break;
+    case 1:                                 /* zlib wrapper */
+        wraplen = 6 + (s->strstart ? 4 : 0);
+        break;
+#ifdef GZIP
+    case 2:                                 /* gzip wrapper */
+        wraplen = 18;
+        if (s->gzhead != Z_NULL) {          /* user-supplied gzip header */
+            Bytef *str;
+            if (s->gzhead->extra != Z_NULL)
+                wraplen += 2 + s->gzhead->extra_len;
+            str = s->gzhead->name;
+            if (str != Z_NULL)
+                do {
+                    wraplen++;
+                } while (*str++);
+            str = s->gzhead->comment;
+            if (str != Z_NULL)
+                do {
+                    wraplen++;
+                } while (*str++);
+            if (s->gzhead->hcrc)
+                wraplen += 2;
+        }
+        break;
+#endif
+    default:                                /* for compiler happiness */
+        wraplen = 6;
+    }
+
+    /* if not default parameters, return conservative bound */
+    if (s->w_bits != 15 || s->hash_bits != 8 + 7)
+        return complen + wraplen;
+
+    /* default settings: return tight bound for that case */
+    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+           (sourceLen >> 25) + 13 - 6 + wraplen;
+}
+
+/* =========================================================================
+ * Put a short in the pending buffer. The 16-bit value is put in MSB order.
+ * IN assertion: the stream state is correct and there is enough room in
+ * pending_buf.
+ */
+local void putShortMSB (s, b)
+    deflate_state *s;
+    uInt b;
+{
+    put_byte(s, (Byte)(b >> 8));
+    put_byte(s, (Byte)(b & 0xff));
+}
+
+/* =========================================================================
+ * Flush as much pending output as possible. All deflate() output, except for
+ * some deflate_stored() output, goes through this function so some
+ * applications may wish to modify it to avoid allocating a large
+ * strm->next_out buffer and copying into it. (See also read_buf()).
+ */
+local void flush_pending(strm)
+    z_streamp strm;
+{
+    unsigned len;
+    deflate_state *s = strm->state;
+
+    _tr_flush_bits(s);
+    len = s->pending;
+    if (len > strm->avail_out) len = strm->avail_out;
+    if (len == 0) return;
+
+    zmemcpy(strm->next_out, s->pending_out, len);
+    strm->next_out  += len;
+    s->pending_out  += len;
+    strm->total_out += len;
+    strm->avail_out -= len;
+    s->pending      -= len;
+    if (s->pending == 0) {
+        s->pending_out = s->pending_buf;
+    }
+}
+
+/* ===========================================================================
+ * Update the header CRC with the bytes s->pending_buf[beg..s->pending - 1].
+ */
+#define HCRC_UPDATE(beg) \
+    do { \
+        if (s->gzhead->hcrc && s->pending > (beg)) \
+            strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
+                                s->pending - (beg)); \
+    } while (0)
+
+/* ========================================================================= */
+int ZEXPORT deflate (strm, flush)
+    z_streamp strm;
+    int flush;
+{
+    int old_flush; /* value of flush param for previous deflate call */
+    deflate_state *s;
+
+    if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {
+        return Z_STREAM_ERROR;
+    }
+    s = strm->state;
+
+    if (strm->next_out == Z_NULL ||
+        (strm->avail_in != 0 && strm->next_in == Z_NULL) ||
+        (s->status == FINISH_STATE && flush != Z_FINISH)) {
+        ERR_RETURN(strm, Z_STREAM_ERROR);
+    }
+    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
+
+    old_flush = s->last_flush;
+    s->last_flush = flush;
+
+    /* Flush as much pending output as possible */
+    if (s->pending != 0) {
+        flush_pending(strm);
+        if (strm->avail_out == 0) {
+            /* Since avail_out is 0, deflate will be called again with
+             * more output space, but possibly with both pending and
+             * avail_in equal to zero. There won't be anything to do,
+             * but this is not an error situation so make sure we
+             * return OK instead of BUF_ERROR at next call of deflate:
+             */
+            s->last_flush = -1;
+            return Z_OK;
+        }
+
+    /* Make sure there is something to do and avoid duplicate consecutive
+     * flushes. For repeated and useless calls with Z_FINISH, we keep
+     * returning Z_STREAM_END instead of Z_BUF_ERROR.
+     */
+    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
+               flush != Z_FINISH) {
+        ERR_RETURN(strm, Z_BUF_ERROR);
+    }
+
+    /* User must not provide more input after the first FINISH: */
+    if (s->status == FINISH_STATE && strm->avail_in != 0) {
+        ERR_RETURN(strm, Z_BUF_ERROR);
+    }
+
+    /* Write the header */
+    if (s->status == INIT_STATE) {
+        /* zlib header */
+        uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
+        uInt level_flags;
+
+        if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
+            level_flags = 0;
+        else if (s->level < 6)
+            level_flags = 1;
+        else if (s->level == 6)
+            level_flags = 2;
+        else
+            level_flags = 3;
+        header |= (level_flags << 6);
+        if (s->strstart != 0) header |= PRESET_DICT;
+        header += 31 - (header % 31);
+
+        putShortMSB(s, header);
+
+        /* Save the adler32 of the preset dictionary: */
+        if (s->strstart != 0) {
+            putShortMSB(s, (uInt)(strm->adler >> 16));
+            putShortMSB(s, (uInt)(strm->adler & 0xffff));
+        }
+        strm->adler = adler32(0L, Z_NULL, 0);
+        s->status = BUSY_STATE;
+
+        /* Compression must start with an empty pending buffer */
+        flush_pending(strm);
+        if (s->pending != 0) {
+            s->last_flush = -1;
+            return Z_OK;
+        }
+    }
+#ifdef GZIP
+    if (s->status == GZIP_STATE) {
+        /* gzip header */
+        strm->adler = crc32(0L, Z_NULL, 0);
+        put_byte(s, 31);
+        put_byte(s, 139);
+        put_byte(s, 8);
+        if (s->gzhead == Z_NULL) {
+            put_byte(s, 0);
+            put_byte(s, 0);
+            put_byte(s, 0);
+            put_byte(s, 0);
+            put_byte(s, 0);
+            put_byte(s, s->level == 9 ? 2 :
+                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+                      4 : 0));
+            put_byte(s, OS_CODE);
+            s->status = BUSY_STATE;
+
+            /* Compression must start with an empty pending buffer */
+            flush_pending(strm);
+            if (s->pending != 0) {
+                s->last_flush = -1;
+                return Z_OK;
+            }
+        }
+        else {
+            put_byte(s, (s->gzhead->text ? 1 : 0) +
+                     (s->gzhead->hcrc ? 2 : 0) +
+                     (s->gzhead->extra == Z_NULL ? 0 : 4) +
+                     (s->gzhead->name == Z_NULL ? 0 : 8) +
+                     (s->gzhead->comment == Z_NULL ? 0 : 16)
+                     );
+            put_byte(s, (Byte)(s->gzhead->time & 0xff));
+            put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
+            put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
+            put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
+            put_byte(s, s->level == 9 ? 2 :
+                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
+                      4 : 0));
+            put_byte(s, s->gzhead->os & 0xff);
+            if (s->gzhead->extra != Z_NULL) {
+                put_byte(s, s->gzhead->extra_len & 0xff);
+                put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
+            }
+            if (s->gzhead->hcrc)
+                strm->adler = crc32(strm->adler, s->pending_buf,
+                                    s->pending);
+            s->gzindex = 0;
+            s->status = EXTRA_STATE;
+        }
+    }
+    if (s->status == EXTRA_STATE) {
+        if (s->gzhead->extra != Z_NULL) {
+            ulg beg = s->pending;   /* start of bytes to update crc */
+            uInt left = (s->gzhead->extra_len & 0xffff) - s->gzindex;
+            while (s->pending + left > s->pending_buf_size) {
+                uInt copy = s->pending_buf_size - s->pending;
+                zmemcpy(s->pending_buf + s->pending,
+                        s->gzhead->extra + s->gzindex, copy);
+                s->pending = s->pending_buf_size;
+                HCRC_UPDATE(beg);
+                s->gzindex += copy;
+                flush_pending(strm);
+                if (s->pending != 0) {
+                    s->last_flush = -1;
+                    return Z_OK;
+                }
+                beg = 0;
+                left -= copy;
+            }
+            zmemcpy(s->pending_buf + s->pending,
+                    s->gzhead->extra + s->gzindex, left);
+            s->pending += left;
+            HCRC_UPDATE(beg);
+            s->gzindex = 0;
+        }
+        s->status = NAME_STATE;
+    }
+    if (s->status == NAME_STATE) {
+        if (s->gzhead->name != Z_NULL) {
+            ulg beg = s->pending;   /* start of bytes to update crc */
+            int val;
+            do {
+                if (s->pending == s->pending_buf_size) {
+                    HCRC_UPDATE(beg);
+                    flush_pending(strm);
+                    if (s->pending != 0) {
+                        s->last_flush = -1;
+                        return Z_OK;
+                    }
+                    beg = 0;
+                }
+                val = s->gzhead->name[s->gzindex++];
+                put_byte(s, val);
+            } while (val != 0);
+            HCRC_UPDATE(beg);
+            s->gzindex = 0;
+        }
+        s->status = COMMENT_STATE;
+    }
+    if (s->status == COMMENT_STATE) {
+        if (s->gzhead->comment != Z_NULL) {
+            ulg beg = s->pending;   /* start of bytes to update crc */
+            int val;
+            do {
+                if (s->pending == s->pending_buf_size) {
+                    HCRC_UPDATE(beg);
+                    flush_pending(strm);
+                    if (s->pending != 0) {
+                        s->last_flush = -1;
+                        return Z_OK;
+                    }
+                    beg = 0;
+                }
+                val = s->gzhead->comment[s->gzindex++];
+                put_byte(s, val);
+            } while (val != 0);
+            HCRC_UPDATE(beg);
+        }
+        s->status = HCRC_STATE;
+    }
+    if (s->status == HCRC_STATE) {
+        if (s->gzhead->hcrc) {
+            if (s->pending + 2 > s->pending_buf_size) {
+                flush_pending(strm);
+                if (s->pending != 0) {
+                    s->last_flush = -1;
+                    return Z_OK;
+                }
+            }
+            put_byte(s, (Byte)(strm->adler & 0xff));
+            put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
+            strm->adler = crc32(0L, Z_NULL, 0);
+        }
+        s->status = BUSY_STATE;
+
+        /* Compression must start with an empty pending buffer */
+        flush_pending(strm);
+        if (s->pending != 0) {
+            s->last_flush = -1;
+            return Z_OK;
+        }
+    }
+#endif
+
+    /* Start a new block or continue the current one.
+     */
+    if (strm->avail_in != 0 || s->lookahead != 0 ||
+        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
+        block_state bstate;
+
+        bstate = s->level == 0 ? deflate_stored(s, flush) :
+                 s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
+                 s->strategy == Z_RLE ? deflate_rle(s, flush) :
+                 (*(configuration_table[s->level].func))(s, flush);
+
+        if (bstate == finish_started || bstate == finish_done) {
+            s->status = FINISH_STATE;
+        }
+        if (bstate == need_more || bstate == finish_started) {
+            if (strm->avail_out == 0) {
+                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
+            }
+            return Z_OK;
+            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
+             * of deflate should use the same flush parameter to make sure
+             * that the flush is complete. So we don't have to output an
+             * empty block here, this will be done at next call. This also
+             * ensures that for a very small output buffer, we emit at most
+             * one empty block.
+             */
+        }
+        if (bstate == block_done) {
+            if (flush == Z_PARTIAL_FLUSH) {
+                _tr_align(s);
+            } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
+                _tr_stored_block(s, (char*)0, 0L, 0);
+                /* For a full flush, this empty block will be recognized
+                 * as a special marker by inflate_sync().
+                 */
+                if (flush == Z_FULL_FLUSH) {
+                    CLEAR_HASH(s);             /* forget history */
+                    if (s->lookahead == 0) {
+                        s->strstart = 0;
+                        s->block_start = 0L;
+                        s->insert = 0;
+                    }
+                }
+            }
+            flush_pending(strm);
+            if (strm->avail_out == 0) {
+              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
+              return Z_OK;
+            }
+        }
+    }
+
+    if (flush != Z_FINISH) return Z_OK;
+    if (s->wrap <= 0) return Z_STREAM_END;
+
+    /* Write the trailer */
+#ifdef GZIP
+    if (s->wrap == 2) {
+        put_byte(s, (Byte)(strm->adler & 0xff));
+        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
+        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
+        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
+        put_byte(s, (Byte)(strm->total_in & 0xff));
+        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
+        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
+        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
+    }
+    else
+#endif
+    {
+        putShortMSB(s, (uInt)(strm->adler >> 16));
+        putShortMSB(s, (uInt)(strm->adler & 0xffff));
+    }
+    flush_pending(strm);
+    /* If avail_out is zero, the application will call deflate again
+     * to flush the rest.
+     */
+    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
+    return s->pending != 0 ? Z_OK : Z_STREAM_END;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateEnd (strm)
+    z_streamp strm;
+{
+    int status;
+
+    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
+
+    status = strm->state->status;
+
+    /* Deallocate in reverse order of allocations: */
+    TRY_FREE(strm, strm->state->pending_buf);
+    TRY_FREE(strm, strm->state->head);
+    TRY_FREE(strm, strm->state->prev);
+    TRY_FREE(strm, strm->state->window);
+
+    ZFREE(strm, strm->state);
+    strm->state = Z_NULL;
+
+    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
+}
+
+/* =========================================================================
+ * Copy the source state to the destination state.
+ * To simplify the source, this is not supported for 16-bit MSDOS (which
+ * doesn't have enough memory anyway to duplicate compression states).
+ */
+int ZEXPORT deflateCopy (dest, source)
+    z_streamp dest;
+    z_streamp source;
+{
+#ifdef MAXSEG_64K
+    return Z_STREAM_ERROR;
+#else
+    deflate_state *ds;
+    deflate_state *ss;
+    ushf *overlay;
+
+
+    if (deflateStateCheck(source) || dest == Z_NULL) {
+        return Z_STREAM_ERROR;
+    }
+
+    ss = source->state;
+
+    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+
+    ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
+    if (ds == Z_NULL) return Z_MEM_ERROR;
+    dest->state = (struct internal_state FAR *) ds;
+    zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
+    ds->strm = dest;
+
+    ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
+    ds->prev   = (Posf *)  ZALLOC(dest, ds->w_size, sizeof(Pos));
+    ds->head   = (Posf *)  ZALLOC(dest, ds->hash_size, sizeof(Pos));
+    overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
+    ds->pending_buf = (uchf *) overlay;
+
+    if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
+        ds->pending_buf == Z_NULL) {
+        deflateEnd (dest);
+        return Z_MEM_ERROR;
+    }
+    /* following zmemcpy do not work for 16-bit MSDOS */
+    zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
+    zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
+    zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
+    zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+
+    ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+    ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
+    ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
+
+    ds->l_desc.dyn_tree = ds->dyn_ltree;
+    ds->d_desc.dyn_tree = ds->dyn_dtree;
+    ds->bl_desc.dyn_tree = ds->bl_tree;
+
+    return Z_OK;
+#endif /* MAXSEG_64K */
+}
+
+/* ===========================================================================
+ * Read a new buffer from the current input stream, update the adler32
+ * and total number of bytes read.  All deflate() input goes through
+ * this function so some applications may wish to modify it to avoid
+ * allocating a large strm->next_in buffer and copying from it.
+ * (See also flush_pending()).
+ */
+local unsigned read_buf(strm, buf, size)
+    z_streamp strm;
+    Bytef *buf;
+    unsigned size;
+{
+    unsigned len = strm->avail_in;
+
+    if (len > size) len = size;
+    if (len == 0) return 0;
+
+    strm->avail_in  -= len;
+
+    zmemcpy(buf, strm->next_in, len);
+    if (strm->state->wrap == 1) {
+        strm->adler = adler32(strm->adler, buf, len);
+    }
+#ifdef GZIP
+    else if (strm->state->wrap == 2) {
+        strm->adler = crc32(strm->adler, buf, len);
+    }
+#endif
+    strm->next_in  += len;
+    strm->total_in += len;
+
+    return len;
+}
+
+/* ===========================================================================
+ * Initialize the "longest match" routines for a new zlib stream
+ */
+local void lm_init (s)
+    deflate_state *s;
+{
+    s->window_size = (ulg)2L*s->w_size;
+
+    CLEAR_HASH(s);
+
+    /* Set the default configuration parameters:
+     */
+    s->max_lazy_match   = configuration_table[s->level].max_lazy;
+    s->good_match       = configuration_table[s->level].good_length;
+    s->nice_match       = configuration_table[s->level].nice_length;
+    s->max_chain_length = configuration_table[s->level].max_chain;
+
+    s->strstart = 0;
+    s->block_start = 0L;
+    s->lookahead = 0;
+    s->insert = 0;
+    s->match_length = s->prev_length = MIN_MATCH-1;
+    s->match_available = 0;
+    s->ins_h = 0;
+#ifndef FASTEST
+#ifdef ASMV
+    match_init(); /* initialize the asm code */
+#endif
+#endif
+}
+
+#ifndef FASTEST
+/* ===========================================================================
+ * Set match_start to the longest match starting at the given string and
+ * return its length. Matches shorter or equal to prev_length are discarded,
+ * in which case the result is equal to prev_length and match_start is
+ * garbage.
+ * IN assertions: cur_match is the head of the hash chain for the current
+ *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
+ * OUT assertion: the match length is not greater than s->lookahead.
+ */
+#ifndef ASMV
+/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
+ * match.S. The code will be functionally equivalent.
+ */
+local uInt longest_match(s, cur_match)
+    deflate_state *s;
+    IPos cur_match;                             /* current match */
+{
+    unsigned chain_length = s->max_chain_length;/* max hash chain length */
+    register Bytef *scan = s->window + s->strstart; /* current string */
+    register Bytef *match;                      /* matched string */
+    register int len;                           /* length of current match */
+    int best_len = (int)s->prev_length;         /* best match length so far */
+    int nice_match = s->nice_match;             /* stop if match long enough */
+    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+        s->strstart - (IPos)MAX_DIST(s) : NIL;
+    /* Stop when cur_match becomes <= limit. To simplify the code,
+     * we prevent matches with the string of window index 0.
+     */
+    Posf *prev = s->prev;
+    uInt wmask = s->w_mask;
+
+#ifdef UNALIGNED_OK
+    /* Compare two bytes at a time. Note: this is not always beneficial.
+     * Try with and without -DUNALIGNED_OK to check.
+     */
+    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
+    register ush scan_start = *(ushf*)scan;
+    register ush scan_end   = *(ushf*)(scan+best_len-1);
+#else
+    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+    register Byte scan_end1  = scan[best_len-1];
+    register Byte scan_end   = scan[best_len];
+#endif
+
+    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+     * It is easy to get rid of this optimization if necessary.
+     */
+    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+    /* Do not waste too much time if we already have a good match: */
+    if (s->prev_length >= s->good_match) {
+        chain_length >>= 2;
+    }
+    /* Do not look for matches beyond the end of the input. This is necessary
+     * to make deflate deterministic.
+     */
+    if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
+
+    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+    do {
+        Assert(cur_match < s->strstart, "no future");
+        match = s->window + cur_match;
+
+        /* Skip to next match if the match length cannot increase
+         * or if the match length is less than 2.  Note that the checks below
+         * for insufficient lookahead only occur occasionally for performance
+         * reasons.  Therefore uninitialized memory will be accessed, and
+         * conditional jumps will be made that depend on those values.
+         * However the length of the match is limited to the lookahead, so
+         * the output of deflate is not affected by the uninitialized values.
+         */
+#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+        /* This code assumes sizeof(unsigned short) == 2. Do not use
+         * UNALIGNED_OK if your compiler uses a different size.
+         */
+        if (*(ushf*)(match+best_len-1) != scan_end ||
+            *(ushf*)match != scan_start) continue;
+
+        /* It is not necessary to compare scan[2] and match[2] since they are
+         * always equal when the other bytes match, given that the hash keys
+         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
+         * strstart+3, +5, ... up to strstart+257. We check for insufficient
+         * lookahead only every 4th comparison; the 128th check will be made
+         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+         * necessary to put more guard bytes at the end of the window, or
+         * to check more often for insufficient lookahead.
+         */
+        Assert(scan[2] == match[2], "scan[2]?");
+        scan++, match++;
+        do {
+        } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+                 scan < strend);
+        /* The funny "do {}" generates better code on most compilers */
+
+        /* Here, scan <= window+strstart+257 */
+        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+        if (*scan == *match) scan++;
+
+        len = (MAX_MATCH - 1) - (int)(strend-scan);
+        scan = strend - (MAX_MATCH-1);
+
+#else /* UNALIGNED_OK */
+
+        if (match[best_len]   != scan_end  ||
+            match[best_len-1] != scan_end1 ||
+            *match            != *scan     ||
+            *++match          != scan[1])      continue;
+
+        /* The check at best_len-1 can be removed because it will be made
+         * again later. (This heuristic is not always a win.)
+         * It is not necessary to compare scan[2] and match[2] since they
+         * are always equal when the other bytes match, given that
+         * the hash keys are equal and that HASH_BITS >= 8.
+         */
+        scan += 2, match++;
+        Assert(*scan == *match, "match[2]?");
+
+        /* We check for insufficient lookahead only every 8th comparison;
+         * the 256th check will be made at strstart+258.
+         */
+        do {
+        } while (*++scan == *++match && *++scan == *++match &&
+                 *++scan == *++match && *++scan == *++match &&
+                 *++scan == *++match && *++scan == *++match &&
+                 *++scan == *++match && *++scan == *++match &&
+                 scan < strend);
+
+        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+        len = MAX_MATCH - (int)(strend - scan);
+        scan = strend - MAX_MATCH;
+
+#endif /* UNALIGNED_OK */
+
+        if (len > best_len) {
+            s->match_start = cur_match;
+            best_len = len;
+            if (len >= nice_match) break;
+#ifdef UNALIGNED_OK
+            scan_end = *(ushf*)(scan+best_len-1);
+#else
+            scan_end1  = scan[best_len-1];
+            scan_end   = scan[best_len];
+#endif
+        }
+    } while ((cur_match = prev[cur_match & wmask]) > limit
+             && --chain_length != 0);
+
+    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+    return s->lookahead;
+}
+#endif /* ASMV */
+
+#else /* FASTEST */
+
+/* ---------------------------------------------------------------------------
+ * Optimized version for FASTEST only
+ */
+local uInt longest_match(s, cur_match)
+    deflate_state *s;
+    IPos cur_match;                             /* current match */
+{
+    register Bytef *scan = s->window + s->strstart; /* current string */
+    register Bytef *match;                       /* matched string */
+    register int len;                           /* length of current match */
+    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+
+    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+     * It is easy to get rid of this optimization if necessary.
+     */
+    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+    Assert(cur_match < s->strstart, "no future");
+
+    match = s->window + cur_match;
+
+    /* Return failure if the match length is less than 2:
+     */
+    if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
+
+    /* The check at best_len-1 can be removed because it will be made
+     * again later. (This heuristic is not always a win.)
+     * It is not necessary to compare scan[2] and match[2] since they
+     * are always equal when the other bytes match, given that
+     * the hash keys are equal and that HASH_BITS >= 8.
+     */
+    scan += 2, match += 2;
+    Assert(*scan == *match, "match[2]?");
+
+    /* We check for insufficient lookahead only every 8th comparison;
+     * the 256th check will be made at strstart+258.
+     */
+    do {
+    } while (*++scan == *++match && *++scan == *++match &&
+             *++scan == *++match && *++scan == *++match &&
+             *++scan == *++match && *++scan == *++match &&
+             *++scan == *++match && *++scan == *++match &&
+             scan < strend);
+
+    Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+    len = MAX_MATCH - (int)(strend - scan);
+
+    if (len < MIN_MATCH) return MIN_MATCH - 1;
+
+    s->match_start = cur_match;
+    return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
+}
+
+#endif /* FASTEST */
+
+#ifdef ZLIB_DEBUG
+
+#define EQUAL 0
+/* result of memcmp for equal strings */
+
+/* ===========================================================================
+ * Check that the match at match_start is indeed a match.
+ */
+local void check_match(s, start, match, length)
+    deflate_state *s;
+    IPos start, match;
+    int length;
+{
+    /* check that the match is indeed a match */
+    if (zmemcmp(s->window + match,
+                s->window + start, length) != EQUAL) {
+        fprintf(stderr, " start %u, match %u, length %d\n",
+                start, match, length);
+        do {
+            fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
+        } while (--length != 0);
+        z_error("invalid match");
+    }
+    if (z_verbose > 1) {
+        fprintf(stderr,"\\[%d,%d]", start-match, length);
+        do { putc(s->window[start++], stderr); } while (--length != 0);
+    }
+}
+#else
+#  define check_match(s, start, match, length)
+#endif /* ZLIB_DEBUG */
+
+/* ===========================================================================
+ * Fill the window when the lookahead becomes insufficient.
+ * Updates strstart and lookahead.
+ *
+ * IN assertion: lookahead < MIN_LOOKAHEAD
+ * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
+ *    At least one byte has been read, or avail_in == 0; reads are
+ *    performed for at least two bytes (required for the zip translate_eol
+ *    option -- not supported here).
+ */
+local void fill_window(s)
+    deflate_state *s;
+{
+    unsigned n;
+    unsigned more;    /* Amount of free space at the end of the window. */
+    uInt wsize = s->w_size;
+
+    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
+
+    do {
+        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
+
+        /* Deal with !@#$% 64K limit: */
+        if (sizeof(int) <= 2) {
+            if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
+                more = wsize;
+
+            } else if (more == (unsigned)(-1)) {
+                /* Very unlikely, but possible on 16 bit machine if
+                 * strstart == 0 && lookahead == 1 (input done a byte at time)
+                 */
+                more--;
+            }
+        }
+
+        /* If the window is almost full and there is insufficient lookahead,
+         * move the upper half to the lower one to make room in the upper half.
+         */
+        if (s->strstart >= wsize+MAX_DIST(s)) {
+
+            zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more);
+            s->match_start -= wsize;
+            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
+            s->block_start -= (long) wsize;
+            slide_hash(s);
+            more += wsize;
+        }
+        if (s->strm->avail_in == 0) break;
+
+        /* If there was no sliding:
+         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
+         *    more == window_size - lookahead - strstart
+         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
+         * => more >= window_size - 2*WSIZE + 2
+         * In the BIG_MEM or MMAP case (not yet supported),
+         *   window_size == input_size + MIN_LOOKAHEAD  &&
+         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
+         * Otherwise, window_size == 2*WSIZE so more >= 2.
+         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
+         */
+        Assert(more >= 2, "more < 2");
+
+        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
+        s->lookahead += n;
+
+        /* Initialize the hash value now that we have some input: */
+        if (s->lookahead + s->insert >= MIN_MATCH) {
+            uInt str = s->strstart - s->insert;
+            s->ins_h = s->window[str];
+            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
+#if MIN_MATCH != 3
+            Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+            while (s->insert) {
+                UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
+#ifndef FASTEST
+                s->prev[str & s->w_mask] = s->head[s->ins_h];
+#endif
+                s->head[s->ins_h] = (Pos)str;
+                str++;
+                s->insert--;
+                if (s->lookahead + s->insert < MIN_MATCH)
+                    break;
+            }
+        }
+        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
+         * but this is not important since only literal bytes will be emitted.
+         */
+
+    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
+
+    /* If the WIN_INIT bytes after the end of the current data have never been
+     * written, then zero those bytes in order to avoid memory check reports of
+     * the use of uninitialized (or uninitialised as Julian writes) bytes by
+     * the longest match routines.  Update the high water mark for the next
+     * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
+     * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
+     */
+    if (s->high_water < s->window_size) {
+        ulg curr = s->strstart + (ulg)(s->lookahead);
+        ulg init;
+
+        if (s->high_water < curr) {
+            /* Previous high water mark below current data -- zero WIN_INIT
+             * bytes or up to end of window, whichever is less.
+             */
+            init = s->window_size - curr;
+            if (init > WIN_INIT)
+                init = WIN_INIT;
+            zmemzero(s->window + curr, (unsigned)init);
+            s->high_water = curr + init;
+        }
+        else if (s->high_water < (ulg)curr + WIN_INIT) {
+            /* High water mark at or above current data, but below current data
+             * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
+             * to end of window, whichever is less.
+             */
+            init = (ulg)curr + WIN_INIT - s->high_water;
+            if (init > s->window_size - s->high_water)
+                init = s->window_size - s->high_water;
+            zmemzero(s->window + s->high_water, (unsigned)init);
+            s->high_water += init;
+        }
+    }
+
+    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+           "not enough room for search");
+}
+
+/* ===========================================================================
+ * Flush the current block, with given end-of-file flag.
+ * IN assertion: strstart is set to the end of the current match.
+ */
+#define FLUSH_BLOCK_ONLY(s, last) { \
+   _tr_flush_block(s, (s->block_start >= 0L ? \
+                   (charf *)&s->window[(unsigned)s->block_start] : \
+                   (charf *)Z_NULL), \
+                (ulg)((long)s->strstart - s->block_start), \
+                (last)); \
+   s->block_start = s->strstart; \
+   flush_pending(s->strm); \
+   Tracev((stderr,"[FLUSH]")); \
+}
+
+/* Same but force premature exit if necessary. */
+#define FLUSH_BLOCK(s, last) { \
+   FLUSH_BLOCK_ONLY(s, last); \
+   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
+}
+
+/* Maximum stored block length in deflate format (not including header). */
+#define MAX_STORED 65535
+
+/* Minimum of a and b. */
+#define MIN(a, b) ((a) > (b) ? (b) : (a))
+
+/* ===========================================================================
+ * Copy without compression as much as possible from the input stream, return
+ * the current block state.
+ *
+ * In case deflateParams() is used to later switch to a non-zero compression
+ * level, s->matches (otherwise unused when storing) keeps track of the number
+ * of hash table slides to perform. If s->matches is 1, then one hash table
+ * slide will be done when switching. If s->matches is 2, the maximum value
+ * allowed here, then the hash table will be cleared, since two or more slides
+ * is the same as a clear.
+ *
+ * deflate_stored() is written to minimize the number of times an input byte is
+ * copied. It is most efficient with large input and output buffers, which
+ * maximizes the opportunites to have a single copy from next_in to next_out.
+ */
+local block_state deflate_stored(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    /* Smallest worthy block size when not flushing or finishing. By default
+     * this is 32K. This can be as small as 507 bytes for memLevel == 1. For
+     * large input and output buffers, the stored block size will be larger.
+     */
+    unsigned min_block = MIN(s->pending_buf_size - 5, s->w_size);
+
+    /* Copy as many min_block or larger stored blocks directly to next_out as
+     * possible. If flushing, copy the remaining available input to next_out as
+     * stored blocks, if there is enough space.
+     */
+    unsigned len, left, have, last = 0;
+    unsigned used = s->strm->avail_in;
+    do {
+        /* Set len to the maximum size block that we can copy directly with the
+         * available input data and output space. Set left to how much of that
+         * would be copied from what's left in the window.
+         */
+        len = MAX_STORED;       /* maximum deflate stored block length */
+        have = (s->bi_valid + 42) >> 3;         /* number of header bytes */
+        if (s->strm->avail_out < have)          /* need room for header */
+            break;
+            /* maximum stored block length that will fit in avail_out: */
+        have = s->strm->avail_out - have;
+        left = s->strstart - s->block_start;    /* bytes left in window */
+        if (len > (ulg)left + s->strm->avail_in)
+            len = left + s->strm->avail_in;     /* limit len to the input */
+        if (len > have)
+            len = have;                         /* limit len to the output */
+
+        /* If the stored block would be less than min_block in length, or if
+         * unable to copy all of the available input when flushing, then try
+         * copying to the window and the pending buffer instead. Also don't
+         * write an empty block when flushing -- deflate() does that.
+         */
+        if (len < min_block && ((len == 0 && flush != Z_FINISH) ||
+                                flush == Z_NO_FLUSH ||
+                                len != left + s->strm->avail_in))
+            break;
+
+        /* Make a dummy stored block in pending to get the header bytes,
+         * including any pending bits. This also updates the debugging counts.
+         */
+        last = flush == Z_FINISH && len == left + s->strm->avail_in ? 1 : 0;
+        _tr_stored_block(s, (char *)0, 0L, last);
+
+        /* Replace the lengths in the dummy stored block with len. */
+        s->pending_buf[s->pending - 4] = len;
+        s->pending_buf[s->pending - 3] = len >> 8;
+        s->pending_buf[s->pending - 2] = ~len;
+        s->pending_buf[s->pending - 1] = ~len >> 8;
+
+        /* Write the stored block header bytes. */
+        flush_pending(s->strm);
+
+#ifdef ZLIB_DEBUG
+        /* Update debugging counts for the data about to be copied. */
+        s->compressed_len += len << 3;
+        s->bits_sent += len << 3;
+#endif
+
+        /* Copy uncompressed bytes from the window to next_out. */
+        if (left) {
+            if (left > len)
+                left = len;
+            zmemcpy(s->strm->next_out, s->window + s->block_start, left);
+            s->strm->next_out += left;
+            s->strm->avail_out -= left;
+            s->strm->total_out += left;
+            s->block_start += left;
+            len -= left;
+        }
+
+        /* Copy uncompressed bytes directly from next_in to next_out, updating
+         * the check value.
+         */
+        if (len) {
+            read_buf(s->strm, s->strm->next_out, len);
+            s->strm->next_out += len;
+            s->strm->avail_out -= len;
+            s->strm->total_out += len;
+        }
+    } while (last == 0);
+
+    /* Update the sliding window with the last s->w_size bytes of the copied
+     * data, or append all of the copied data to the existing window if less
+     * than s->w_size bytes were copied. Also update the number of bytes to
+     * insert in the hash tables, in the event that deflateParams() switches to
+     * a non-zero compression level.
+     */
+    used -= s->strm->avail_in;      /* number of input bytes directly copied */
+    if (used) {
+        /* If any input was used, then no unused input remains in the window,
+         * therefore s->block_start == s->strstart.
+         */
+        if (used >= s->w_size) {    /* supplant the previous history */
+            s->matches = 2;         /* clear hash */
+            zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size);
+            s->strstart = s->w_size;
+        }
+        else {
+            if (s->window_size - s->strstart <= used) {
+                /* Slide the window down. */
+                s->strstart -= s->w_size;
+                zmemcpy(s->window, s->window + s->w_size, s->strstart);
+                if (s->matches < 2)
+                    s->matches++;   /* add a pending slide_hash() */
+            }
+            zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);
+            s->strstart += used;
+        }
+        s->block_start = s->strstart;
+        s->insert += MIN(used, s->w_size - s->insert);
+    }
+    if (s->high_water < s->strstart)
+        s->high_water = s->strstart;
+
+    /* If the last block was written to next_out, then done. */
+    if (last)
+        return finish_done;
+
+    /* If flushing and all input has been consumed, then done. */
+    if (flush != Z_NO_FLUSH && flush != Z_FINISH &&
+        s->strm->avail_in == 0 && (long)s->strstart == s->block_start)
+        return block_done;
+
+    /* Fill the window with any remaining input. */
+    have = s->window_size - s->strstart - 1;
+    if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) {
+        /* Slide the window down. */
+        s->block_start -= s->w_size;
+        s->strstart -= s->w_size;
+        zmemcpy(s->window, s->window + s->w_size, s->strstart);
+        if (s->matches < 2)
+            s->matches++;           /* add a pending slide_hash() */
+        have += s->w_size;          /* more space now */
+    }
+    if (have > s->strm->avail_in)
+        have = s->strm->avail_in;
+    if (have) {
+        read_buf(s->strm, s->window + s->strstart, have);
+        s->strstart += have;
+    }
+    if (s->high_water < s->strstart)
+        s->high_water = s->strstart;
+
+    /* There was not enough avail_out to write a complete worthy or flushed
+     * stored block to next_out. Write a stored block to pending instead, if we
+     * have enough input for a worthy block, or if flushing and there is enough
+     * room for the remaining input as a stored block in the pending buffer.
+     */
+    have = (s->bi_valid + 42) >> 3;         /* number of header bytes */
+        /* maximum stored block length that will fit in pending: */
+    have = MIN(s->pending_buf_size - have, MAX_STORED);
+    min_block = MIN(have, s->w_size);
+    left = s->strstart - s->block_start;
+    if (left >= min_block ||
+        ((left || flush == Z_FINISH) && flush != Z_NO_FLUSH &&
+         s->strm->avail_in == 0 && left <= have)) {
+        len = MIN(left, have);
+        last = flush == Z_FINISH && s->strm->avail_in == 0 &&
+               len == left ? 1 : 0;
+        _tr_stored_block(s, (charf *)s->window + s->block_start, len, last);
+        s->block_start += len;
+        flush_pending(s->strm);
+    }
+
+    /* We've done all we can with the available input and output. */
+    return last ? finish_started : need_more;
+}
+
+/* ===========================================================================
+ * Compress as much as possible from the input stream, return the current
+ * block state.
+ * This function does not perform lazy evaluation of matches and inserts
+ * new strings in the dictionary only for unmatched strings or for short
+ * matches. It is used only for the fast compression options.
+ */
+local block_state deflate_fast(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    IPos hash_head;       /* head of the hash chain */
+    int bflush;           /* set if current block must be flushed */
+
+    for (;;) {
+        /* Make sure that we always have enough lookahead, except
+         * at the end of the input file. We need MAX_MATCH bytes
+         * for the next match, plus MIN_MATCH bytes to insert the
+         * string following the next match.
+         */
+        if (s->lookahead < MIN_LOOKAHEAD) {
+            fill_window(s);
+            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+                return need_more;
+            }
+            if (s->lookahead == 0) break; /* flush the current block */
+        }
+
+        /* Insert the string window[strstart .. strstart+2] in the
+         * dictionary, and set hash_head to the head of the hash chain:
+         */
+        hash_head = NIL;
+        if (s->lookahead >= MIN_MATCH) {
+            INSERT_STRING(s, s->strstart, hash_head);
+        }
+
+        /* Find the longest match, discarding those <= prev_length.
+         * At this point we have always match_length < MIN_MATCH
+         */
+        if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
+            /* To simplify the code, we prevent matches with the string
+             * of window index 0 (in particular we have to avoid a match
+             * of the string with itself at the start of the input file).
+             */
+            s->match_length = longest_match (s, hash_head);
+            /* longest_match() sets match_start */
+        }
+        if (s->match_length >= MIN_MATCH) {
+            check_match(s, s->strstart, s->match_start, s->match_length);
+
+            _tr_tally_dist(s, s->strstart - s->match_start,
+                           s->match_length - MIN_MATCH, bflush);
+
+            s->lookahead -= s->match_length;
+
+            /* Insert new strings in the hash table only if the match length
+             * is not too large. This saves time but degrades compression.
+             */
+#ifndef FASTEST
+            if (s->match_length <= s->max_insert_length &&
+                s->lookahead >= MIN_MATCH) {
+                s->match_length--; /* string at strstart already in table */
+                do {
+                    s->strstart++;
+                    INSERT_STRING(s, s->strstart, hash_head);
+                    /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+                     * always MIN_MATCH bytes ahead.
+                     */
+                } while (--s->match_length != 0);
+                s->strstart++;
+            } else
+#endif
+            {
+                s->strstart += s->match_length;
+                s->match_length = 0;
+                s->ins_h = s->window[s->strstart];
+                UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+#if MIN_MATCH != 3
+                Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+                /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
+                 * matter since it will be recomputed at next deflate call.
+                 */
+            }
+        } else {
+            /* No match, output a literal byte */
+            Tracevv((stderr,"%c", s->window[s->strstart]));
+            _tr_tally_lit (s, s->window[s->strstart], bflush);
+            s->lookahead--;
+            s->strstart++;
+        }
+        if (bflush) FLUSH_BLOCK(s, 0);
+    }
+    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
+}
+
+#ifndef FASTEST
+/* ===========================================================================
+ * Same as above, but achieves better compression. We use a lazy
+ * evaluation for matches: a match is finally adopted only if there is
+ * no better match at the next window position.
+ */
+local block_state deflate_slow(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    IPos hash_head;          /* head of hash chain */
+    int bflush;              /* set if current block must be flushed */
+
+    /* Process the input block. */
+    for (;;) {
+        /* Make sure that we always have enough lookahead, except
+         * at the end of the input file. We need MAX_MATCH bytes
+         * for the next match, plus MIN_MATCH bytes to insert the
+         * string following the next match.
+         */
+        if (s->lookahead < MIN_LOOKAHEAD) {
+            fill_window(s);
+            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+                return need_more;
+            }
+            if (s->lookahead == 0) break; /* flush the current block */
+        }
+
+        /* Insert the string window[strstart .. strstart+2] in the
+         * dictionary, and set hash_head to the head of the hash chain:
+         */
+        hash_head = NIL;
+        if (s->lookahead >= MIN_MATCH) {
+            INSERT_STRING(s, s->strstart, hash_head);
+        }
+
+        /* Find the longest match, discarding those <= prev_length.
+         */
+        s->prev_length = s->match_length, s->prev_match = s->match_start;
+        s->match_length = MIN_MATCH-1;
+
+        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
+            s->strstart - hash_head <= MAX_DIST(s)) {
+            /* To simplify the code, we prevent matches with the string
+             * of window index 0 (in particular we have to avoid a match
+             * of the string with itself at the start of the input file).
+             */
+            s->match_length = longest_match (s, hash_head);
+            /* longest_match() sets match_start */
+
+            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
+#if TOO_FAR <= 32767
+                || (s->match_length == MIN_MATCH &&
+                    s->strstart - s->match_start > TOO_FAR)
+#endif
+                )) {
+
+                /* If prev_match is also MIN_MATCH, match_start is garbage
+                 * but we will ignore the current match anyway.
+                 */
+                s->match_length = MIN_MATCH-1;
+            }
+        }
+        /* If there was a match at the previous step and the current
+         * match is not better, output the previous match:
+         */
+        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
+            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
+            /* Do not insert strings in hash table beyond this. */
+
+            check_match(s, s->strstart-1, s->prev_match, s->prev_length);
+
+            _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+                           s->prev_length - MIN_MATCH, bflush);
+
+            /* Insert in hash table all strings up to the end of the match.
+             * strstart-1 and strstart are already inserted. If there is not
+             * enough lookahead, the last two strings are not inserted in
+             * the hash table.
+             */
+            s->lookahead -= s->prev_length-1;
+            s->prev_length -= 2;
+            do {
+                if (++s->strstart <= max_insert) {
+                    INSERT_STRING(s, s->strstart, hash_head);
+                }
+            } while (--s->prev_length != 0);
+            s->match_available = 0;
+            s->match_length = MIN_MATCH-1;
+            s->strstart++;
+
+            if (bflush) FLUSH_BLOCK(s, 0);
+
+        } else if (s->match_available) {
+            /* If there was no match at the previous position, output a
+             * single literal. If there was a match but the current match
+             * is longer, truncate the previous match to a single literal.
+             */
+            Tracevv((stderr,"%c", s->window[s->strstart-1]));
+            _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+            if (bflush) {
+                FLUSH_BLOCK_ONLY(s, 0);
+            }
+            s->strstart++;
+            s->lookahead--;
+            if (s->strm->avail_out == 0) return need_more;
+        } else {
+            /* There is no previous match to compare with, wait for
+             * the next step to decide.
+             */
+            s->match_available = 1;
+            s->strstart++;
+            s->lookahead--;
+        }
+    }
+    Assert (flush != Z_NO_FLUSH, "no flush?");
+    if (s->match_available) {
+        Tracevv((stderr,"%c", s->window[s->strstart-1]));
+        _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+        s->match_available = 0;
+    }
+    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
+}
+#endif /* FASTEST */
+
+/* ===========================================================================
+ * For Z_RLE, simply look for runs of bytes, generate matches only of distance
+ * one.  Do not maintain a hash table.  (It will be regenerated if this run of
+ * deflate switches away from Z_RLE.)
+ */
+local block_state deflate_rle(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    int bflush;             /* set if current block must be flushed */
+    uInt prev;              /* byte at distance one to match */
+    Bytef *scan, *strend;   /* scan goes up to strend for length of run */
+
+    for (;;) {
+        /* Make sure that we always have enough lookahead, except
+         * at the end of the input file. We need MAX_MATCH bytes
+         * for the longest run, plus one for the unrolled loop.
+         */
+        if (s->lookahead <= MAX_MATCH) {
+            fill_window(s);
+            if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
+                return need_more;
+            }
+            if (s->lookahead == 0) break; /* flush the current block */
+        }
+
+        /* See how many times the previous byte repeats */
+        s->match_length = 0;
+        if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
+            scan = s->window + s->strstart - 1;
+            prev = *scan;
+            if (prev == *++scan && prev == *++scan && prev == *++scan) {
+                strend = s->window + s->strstart + MAX_MATCH;
+                do {
+                } while (prev == *++scan && prev == *++scan &&
+                         prev == *++scan && prev == *++scan &&
+                         prev == *++scan && prev == *++scan &&
+                         prev == *++scan && prev == *++scan &&
+                         scan < strend);
+                s->match_length = MAX_MATCH - (uInt)(strend - scan);
+                if (s->match_length > s->lookahead)
+                    s->match_length = s->lookahead;
+            }
+            Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
+        }
+
+        /* Emit match if have run of MIN_MATCH or longer, else emit literal */
+        if (s->match_length >= MIN_MATCH) {
+            check_match(s, s->strstart, s->strstart - 1, s->match_length);
+
+            _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
+
+            s->lookahead -= s->match_length;
+            s->strstart += s->match_length;
+            s->match_length = 0;
+        } else {
+            /* No match, output a literal byte */
+            Tracevv((stderr,"%c", s->window[s->strstart]));
+            _tr_tally_lit (s, s->window[s->strstart], bflush);
+            s->lookahead--;
+            s->strstart++;
+        }
+        if (bflush) FLUSH_BLOCK(s, 0);
+    }
+    s->insert = 0;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
+}
+
+/* ===========================================================================
+ * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
+ * (It will be regenerated if this run of deflate switches away from Huffman.)
+ */
+local block_state deflate_huff(s, flush)
+    deflate_state *s;
+    int flush;
+{
+    int bflush;             /* set if current block must be flushed */
+
+    for (;;) {
+        /* Make sure that we have a literal to write. */
+        if (s->lookahead == 0) {
+            fill_window(s);
+            if (s->lookahead == 0) {
+                if (flush == Z_NO_FLUSH)
+                    return need_more;
+                break;      /* flush the current block */
+            }
+        }
+
+        /* Output a literal byte */
+        s->match_length = 0;
+        Tracevv((stderr,"%c", s->window[s->strstart]));
+        _tr_tally_lit (s, s->window[s->strstart], bflush);
+        s->lookahead--;
+        s->strstart++;
+        if (bflush) FLUSH_BLOCK(s, 0);
+    }
+    s->insert = 0;
+    if (flush == Z_FINISH) {
+        FLUSH_BLOCK(s, 1);
+        return finish_done;
+    }
+    if (s->last_lit)
+        FLUSH_BLOCK(s, 0);
+    return block_done;
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib/deflate.h b/jdk/src/java.base/share/native/libzip/zlib/deflate.h
new file mode 100644
index 0000000..183c22d
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/deflate.h
@@ -0,0 +1,373 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* deflate.h -- internal compression state
+ * Copyright (C) 1995-2016 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id$ */
+
+#ifndef DEFLATE_H
+#define DEFLATE_H
+
+#include "zutil.h"
+
+/* define NO_GZIP when compiling if you want to disable gzip header and
+   trailer creation by deflate().  NO_GZIP would be used to avoid linking in
+   the crc code when it is not needed.  For shared libraries, gzip encoding
+   should be left enabled. */
+#ifndef NO_GZIP
+#  define GZIP
+#endif
+
+/* ===========================================================================
+ * Internal compression state.
+ */
+
+#define LENGTH_CODES 29
+/* number of length codes, not counting the special END_BLOCK code */
+
+#define LITERALS  256
+/* number of literal bytes 0..255 */
+
+#define L_CODES (LITERALS+1+LENGTH_CODES)
+/* number of Literal or Length codes, including the END_BLOCK code */
+
+#define D_CODES   30
+/* number of distance codes */
+
+#define BL_CODES  19
+/* number of codes used to transfer the bit lengths */
+
+#define HEAP_SIZE (2*L_CODES+1)
+/* maximum heap size */
+
+#define MAX_BITS 15
+/* All codes must not exceed MAX_BITS bits */
+
+#define Buf_size 16
+/* size of bit buffer in bi_buf */
+
+#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
+#ifdef GZIP
+#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
+#endif
+#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
+#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
+#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
+#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
+#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
+#define FINISH_STATE 666    /* stream complete */
+/* Stream status */
+
+
+/* Data structure describing a single value and its code string. */
+typedef struct ct_data_s {
+    union {
+        ush  freq;       /* frequency count */
+        ush  code;       /* bit string */
+    } fc;
+    union {
+        ush  dad;        /* father node in Huffman tree */
+        ush  len;        /* length of bit string */
+    } dl;
+} FAR ct_data;
+
+#define Freq fc.freq
+#define Code fc.code
+#define Dad  dl.dad
+#define Len  dl.len
+
+typedef struct static_tree_desc_s  static_tree_desc;
+
+typedef struct tree_desc_s {
+    ct_data *dyn_tree;           /* the dynamic tree */
+    int     max_code;            /* largest code with non zero frequency */
+    const static_tree_desc *stat_desc;  /* the corresponding static tree */
+} FAR tree_desc;
+
+typedef ush Pos;
+typedef Pos FAR Posf;
+typedef unsigned IPos;
+
+/* A Pos is an index in the character window. We use short instead of int to
+ * save space in the various tables. IPos is used only for parameter passing.
+ */
+
+typedef struct internal_state {
+    z_streamp strm;      /* pointer back to this zlib stream */
+    int   status;        /* as the name implies */
+    Bytef *pending_buf;  /* output still pending */
+    ulg   pending_buf_size; /* size of pending_buf */
+    Bytef *pending_out;  /* next pending byte to output to the stream */
+    ulg   pending;       /* nb of bytes in the pending buffer */
+    int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */
+    gz_headerp  gzhead;  /* gzip header information to write */
+    ulg   gzindex;       /* where in extra, name, or comment */
+    Byte  method;        /* can only be DEFLATED */
+    int   last_flush;    /* value of flush param for previous deflate call */
+
+                /* used by deflate.c: */
+
+    uInt  w_size;        /* LZ77 window size (32K by default) */
+    uInt  w_bits;        /* log2(w_size)  (8..16) */
+    uInt  w_mask;        /* w_size - 1 */
+
+    Bytef *window;
+    /* Sliding window. Input bytes are read into the second half of the window,
+     * and move to the first half later to keep a dictionary of at least wSize
+     * bytes. With this organization, matches are limited to a distance of
+     * wSize-MAX_MATCH bytes, but this ensures that IO is always
+     * performed with a length multiple of the block size. Also, it limits
+     * the window size to 64K, which is quite useful on MSDOS.
+     * To do: use the user input buffer as sliding window.
+     */
+
+    ulg window_size;
+    /* Actual size of window: 2*wSize, except when the user input buffer
+     * is directly used as sliding window.
+     */
+
+    Posf *prev;
+    /* Link to older string with same hash index. To limit the size of this
+     * array to 64K, this link is maintained only for the last 32K strings.
+     * An index in this array is thus a window index modulo 32K.
+     */
+
+    Posf *head; /* Heads of the hash chains or NIL. */
+
+    uInt  ins_h;          /* hash index of string to be inserted */
+    uInt  hash_size;      /* number of elements in hash table */
+    uInt  hash_bits;      /* log2(hash_size) */
+    uInt  hash_mask;      /* hash_size-1 */
+
+    uInt  hash_shift;
+    /* Number of bits by which ins_h must be shifted at each input
+     * step. It must be such that after MIN_MATCH steps, the oldest
+     * byte no longer takes part in the hash key, that is:
+     *   hash_shift * MIN_MATCH >= hash_bits
+     */
+
+    long block_start;
+    /* Window position at the beginning of the current output block. Gets
+     * negative when the window is moved backwards.
+     */
+
+    uInt match_length;           /* length of best match */
+    IPos prev_match;             /* previous match */
+    int match_available;         /* set if previous match exists */
+    uInt strstart;               /* start of string to insert */
+    uInt match_start;            /* start of matching string */
+    uInt lookahead;              /* number of valid bytes ahead in window */
+
+    uInt prev_length;
+    /* Length of the best match at previous step. Matches not greater than this
+     * are discarded. This is used in the lazy match evaluation.
+     */
+
+    uInt max_chain_length;
+    /* To speed up deflation, hash chains are never searched beyond this
+     * length.  A higher limit improves compression ratio but degrades the
+     * speed.
+     */
+
+    uInt max_lazy_match;
+    /* Attempt to find a better match only when the current match is strictly
+     * smaller than this value. This mechanism is used only for compression
+     * levels >= 4.
+     */
+#   define max_insert_length  max_lazy_match
+    /* Insert new strings in the hash table only if the match length is not
+     * greater than this length. This saves time but degrades compression.
+     * max_insert_length is used only for compression levels <= 3.
+     */
+
+    int level;    /* compression level (1..9) */
+    int strategy; /* favor or force Huffman coding*/
+
+    uInt good_match;
+    /* Use a faster search when the previous match is longer than this */
+
+    int nice_match; /* Stop searching when current match exceeds this */
+
+                /* used by trees.c: */
+    /* Didn't use ct_data typedef below to suppress compiler warning */
+    struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
+    struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
+    struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */
+
+    struct tree_desc_s l_desc;               /* desc. for literal tree */
+    struct tree_desc_s d_desc;               /* desc. for distance tree */
+    struct tree_desc_s bl_desc;              /* desc. for bit length tree */
+
+    ush bl_count[MAX_BITS+1];
+    /* number of codes at each bit length for an optimal tree */
+
+    int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
+    int heap_len;               /* number of elements in the heap */
+    int heap_max;               /* element of largest frequency */
+    /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
+     * The same heap array is used to build all trees.
+     */
+
+    uch depth[2*L_CODES+1];
+    /* Depth of each subtree used as tie breaker for trees of equal frequency
+     */
+
+    uchf *l_buf;          /* buffer for literals or lengths */
+
+    uInt  lit_bufsize;
+    /* Size of match buffer for literals/lengths.  There are 4 reasons for
+     * limiting lit_bufsize to 64K:
+     *   - frequencies can be kept in 16 bit counters
+     *   - if compression is not successful for the first block, all input
+     *     data is still in the window so we can still emit a stored block even
+     *     when input comes from standard input.  (This can also be done for
+     *     all blocks if lit_bufsize is not greater than 32K.)
+     *   - if compression is not successful for a file smaller than 64K, we can
+     *     even emit a stored file instead of a stored block (saving 5 bytes).
+     *     This is applicable only for zip (not gzip or zlib).
+     *   - creating new Huffman trees less frequently may not provide fast
+     *     adaptation to changes in the input data statistics. (Take for
+     *     example a binary file with poorly compressible code followed by
+     *     a highly compressible string table.) Smaller buffer sizes give
+     *     fast adaptation but have of course the overhead of transmitting
+     *     trees more frequently.
+     *   - I can't count above 4
+     */
+
+    uInt last_lit;      /* running index in l_buf */
+
+    ushf *d_buf;
+    /* Buffer for distances. To simplify the code, d_buf and l_buf have
+     * the same number of elements. To use different lengths, an extra flag
+     * array would be necessary.
+     */
+
+    ulg opt_len;        /* bit length of current block with optimal trees */
+    ulg static_len;     /* bit length of current block with static trees */
+    uInt matches;       /* number of string matches in current block */
+    uInt insert;        /* bytes at end of window left to insert */
+
+#ifdef ZLIB_DEBUG
+    ulg compressed_len; /* total bit length of compressed file mod 2^32 */
+    ulg bits_sent;      /* bit length of compressed data sent mod 2^32 */
+#endif
+
+    ush bi_buf;
+    /* Output buffer. bits are inserted starting at the bottom (least
+     * significant bits).
+     */
+    int bi_valid;
+    /* Number of valid bits in bi_buf.  All bits above the last valid bit
+     * are always zero.
+     */
+
+    ulg high_water;
+    /* High water mark offset in window for initialized bytes -- bytes above
+     * this are set to zero in order to avoid memory check warnings when
+     * longest match routines access bytes past the input.  This is then
+     * updated to the new high water mark.
+     */
+
+} FAR deflate_state;
+
+/* Output a byte on the stream.
+ * IN assertion: there is enough room in pending_buf.
+ */
+#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
+
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+/* Minimum amount of lookahead, except at the end of the input file.
+ * See deflate.c for comments about the MIN_MATCH+1.
+ */
+
+#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
+/* In order to simplify the code, particularly on 16 bit machines, match
+ * distances are limited to MAX_DIST instead of WSIZE.
+ */
+
+#define WIN_INIT MAX_MATCH
+/* Number of bytes after end of data in window to initialize in order to avoid
+   memory checker errors from longest match routines */
+
+        /* in trees.c */
+void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
+int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
+void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
+                        ulg stored_len, int last));
+void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
+void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
+void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
+                        ulg stored_len, int last));
+
+#define d_code(dist) \
+   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
+/* Mapping from a distance to a distance code. dist is the distance - 1 and
+ * must not have side effects. _dist_code[256] and _dist_code[257] are never
+ * used.
+ */
+
+#ifndef ZLIB_DEBUG
+/* Inline versions of _tr_tally for speed: */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+  extern uch ZLIB_INTERNAL _length_code[];
+  extern uch ZLIB_INTERNAL _dist_code[];
+#else
+  extern const uch ZLIB_INTERNAL _length_code[];
+  extern const uch ZLIB_INTERNAL _dist_code[];
+#endif
+
+# define _tr_tally_lit(s, c, flush) \
+  { uch cc = (c); \
+    s->d_buf[s->last_lit] = 0; \
+    s->l_buf[s->last_lit++] = cc; \
+    s->dyn_ltree[cc].Freq++; \
+    flush = (s->last_lit == s->lit_bufsize-1); \
+   }
+# define _tr_tally_dist(s, distance, length, flush) \
+  { uch len = (uch)(length); \
+    ush dist = (ush)(distance); \
+    s->d_buf[s->last_lit] = dist; \
+    s->l_buf[s->last_lit++] = len; \
+    dist--; \
+    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
+    s->dyn_dtree[d_code(dist)].Freq++; \
+    flush = (s->last_lit == s->lit_bufsize-1); \
+  }
+#else
+# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
+# define _tr_tally_dist(s, distance, length, flush) \
+              flush = _tr_tally(s, distance, length)
+#endif
+
+#endif /* DEFLATE_H */
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzclose.c b/jdk/src/java.base/share/native/libzip/zlib/gzclose.c
similarity index 100%
rename from jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzclose.c
rename to jdk/src/java.base/share/native/libzip/zlib/gzclose.c
diff --git a/jdk/src/java.base/share/native/libzip/zlib/gzguts.h b/jdk/src/java.base/share/native/libzip/zlib/gzguts.h
new file mode 100644
index 0000000..26464b4
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/gzguts.h
@@ -0,0 +1,242 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* gzguts.h -- zlib internal header definitions for gz* operations
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#ifdef _LARGEFILE64_SOURCE
+#  ifndef _LARGEFILE_SOURCE
+#    define _LARGEFILE_SOURCE 1
+#  endif
+#  ifdef _FILE_OFFSET_BITS
+#    undef _FILE_OFFSET_BITS
+#  endif
+#endif
+
+#ifdef HAVE_HIDDEN
+#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+#  define ZLIB_INTERNAL
+#endif
+
+#include <stdio.h>
+#include "zlib.h"
+#ifdef STDC
+#  include <string.h>
+#  include <stdlib.h>
+#  include <limits.h>
+#endif
+
+#ifndef _POSIX_SOURCE
+#  define _POSIX_SOURCE
+#endif
+#include <fcntl.h>
+
+#ifdef _WIN32
+#  include <stddef.h>
+#endif
+
+#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
+#  include <io.h>
+#endif
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+#  define WIDECHAR
+#endif
+
+#ifdef WINAPI_FAMILY
+#  define open _open
+#  define read _read
+#  define write _write
+#  define close _close
+#endif
+
+#ifdef NO_DEFLATE       /* for compatibility with old definition */
+#  define NO_GZCOMPRESS
+#endif
+
+#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
+#  ifndef HAVE_VSNPRINTF
+#    define HAVE_VSNPRINTF
+#  endif
+#endif
+
+#if defined(__CYGWIN__)
+#  ifndef HAVE_VSNPRINTF
+#    define HAVE_VSNPRINTF
+#  endif
+#endif
+
+#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)
+#  ifndef HAVE_VSNPRINTF
+#    define HAVE_VSNPRINTF
+#  endif
+#endif
+
+#ifndef HAVE_VSNPRINTF
+#  ifdef MSDOS
+/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
+   but for now we just assume it doesn't. */
+#    define NO_vsnprintf
+#  endif
+#  ifdef __TURBOC__
+#    define NO_vsnprintf
+#  endif
+#  ifdef WIN32
+/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
+#    if !defined(vsnprintf) && !defined(NO_vsnprintf)
+#      if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
+#         define vsnprintf _vsnprintf
+#      endif
+#    endif
+#  endif
+#  ifdef __SASC
+#    define NO_vsnprintf
+#  endif
+#  ifdef VMS
+#    define NO_vsnprintf
+#  endif
+#  ifdef __OS400__
+#    define NO_vsnprintf
+#  endif
+#  ifdef __MVS__
+#    define NO_vsnprintf
+#  endif
+#endif
+
+/* unlike snprintf (which is required in C99), _snprintf does not guarantee
+   null termination of the result -- however this is only used in gzlib.c where
+   the result is assured to fit in the space provided */
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#  define snprintf _snprintf
+#endif
+
+#ifndef local
+#  define local static
+#endif
+/* since "static" is used to mean two completely different things in C, we
+   define "local" for the non-static meaning of "static", for readability
+   (compile with -Dlocal if your debugger can't find static symbols) */
+
+/* gz* functions always use library allocation functions */
+#ifndef STDC
+  extern voidp  malloc OF((uInt size));
+  extern void   free   OF((voidpf ptr));
+#endif
+
+/* get errno and strerror definition */
+#if defined UNDER_CE
+#  include <windows.h>
+#  define zstrerror() gz_strwinerror((DWORD)GetLastError())
+#else
+#  ifndef NO_STRERROR
+#    include <errno.h>
+#    define zstrerror() strerror(errno)
+#  else
+#    define zstrerror() "stdio error (consult errno)"
+#  endif
+#endif
+
+/* provide prototypes for these when building zlib without LFS */
+#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
+    ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+    ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+    ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+    ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+#endif
+
+/* default memLevel */
+#if MAX_MEM_LEVEL >= 8
+#  define DEF_MEM_LEVEL 8
+#else
+#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
+#endif
+
+/* default i/o buffer size -- double this for output when reading (this and
+   twice this must be able to fit in an unsigned type) */
+#define GZBUFSIZE 8192
+
+/* gzip modes, also provide a little integrity check on the passed structure */
+#define GZ_NONE 0
+#define GZ_READ 7247
+#define GZ_WRITE 31153
+#define GZ_APPEND 1     /* mode set to GZ_WRITE after the file is opened */
+
+/* values for gz_state how */
+#define LOOK 0      /* look for a gzip header */
+#define COPY 1      /* copy input directly */
+#define GZIP 2      /* decompress a gzip stream */
+
+/* internal gzip file state data structure */
+typedef struct {
+        /* exposed contents for gzgetc() macro */
+    struct gzFile_s x;      /* "x" for exposed */
+                            /* x.have: number of bytes available at x.next */
+                            /* x.next: next output data to deliver or write */
+                            /* x.pos: current position in uncompressed data */
+        /* used for both reading and writing */
+    int mode;               /* see gzip modes above */
+    int fd;                 /* file descriptor */
+    char *path;             /* path or fd for error messages */
+    unsigned size;          /* buffer size, zero if not allocated yet */
+    unsigned want;          /* requested buffer size, default is GZBUFSIZE */
+    unsigned char *in;      /* input buffer (double-sized when writing) */
+    unsigned char *out;     /* output buffer (double-sized when reading) */
+    int direct;             /* 0 if processing gzip, 1 if transparent */
+        /* just for reading */
+    int how;                /* 0: get header, 1: copy, 2: decompress */
+    z_off64_t start;        /* where the gzip data started, for rewinding */
+    int eof;                /* true if end of input file reached */
+    int past;               /* true if read requested past end */
+        /* just for writing */
+    int level;              /* compression level */
+    int strategy;           /* compression strategy */
+        /* seek request */
+    z_off64_t skip;         /* amount to skip (already rewound if backwards) */
+    int seek;               /* true if seek request pending */
+        /* error information */
+    int err;                /* error code */
+    char *msg;              /* error message */
+        /* zlib inflate or deflate stream */
+    z_stream strm;          /* stream structure in-place (not a pointer) */
+} gz_state;
+typedef gz_state FAR *gz_statep;
+
+/* shared functions */
+void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
+#if defined UNDER_CE
+char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
+#endif
+
+/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
+   value -- needed when comparing unsigned to z_off64_t, which is signed
+   (possible z_off64_t types off_t, off64_t, and long are all signed) */
+#ifdef INT_MAX
+#  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
+#else
+unsigned ZLIB_INTERNAL gz_intmax OF((void));
+#  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
+#endif
diff --git a/jdk/src/java.base/share/native/libzip/zlib/gzlib.c b/jdk/src/java.base/share/native/libzip/zlib/gzlib.c
new file mode 100644
index 0000000..a814dd8
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/gzlib.c
@@ -0,0 +1,661 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* gzlib.c -- zlib functions common to reading and writing gzip files
+ * Copyright (C) 2004-2017 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+#if defined(_WIN32) && !defined(__BORLANDC__) && !defined(__MINGW32__)
+#  define LSEEK _lseeki64
+#else
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#  define LSEEK lseek64
+#else
+#  define LSEEK lseek
+#endif
+#endif
+
+/* Local functions */
+local void gz_reset OF((gz_statep));
+local gzFile gz_open OF((const void *, int, const char *));
+
+#if defined UNDER_CE
+
+/* Map the Windows error number in ERROR to a locale-dependent error message
+   string and return a pointer to it.  Typically, the values for ERROR come
+   from GetLastError.
+
+   The string pointed to shall not be modified by the application, but may be
+   overwritten by a subsequent call to gz_strwinerror
+
+   The gz_strwinerror function does not change the current setting of
+   GetLastError. */
+char ZLIB_INTERNAL *gz_strwinerror (error)
+     DWORD error;
+{
+    static char buf[1024];
+
+    wchar_t *msgbuf;
+    DWORD lasterr = GetLastError();
+    DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
+        | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+        NULL,
+        error,
+        0, /* Default language */
+        (LPVOID)&msgbuf,
+        0,
+        NULL);
+    if (chars != 0) {
+        /* If there is an \r\n appended, zap it.  */
+        if (chars >= 2
+            && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
+            chars -= 2;
+            msgbuf[chars] = 0;
+        }
+
+        if (chars > sizeof (buf) - 1) {
+            chars = sizeof (buf) - 1;
+            msgbuf[chars] = 0;
+        }
+
+        wcstombs(buf, msgbuf, chars + 1);
+        LocalFree(msgbuf);
+    }
+    else {
+        sprintf(buf, "unknown win32 error (%ld)", error);
+    }
+
+    SetLastError(lasterr);
+    return buf;
+}
+
+#endif /* UNDER_CE */
+
+/* Reset gzip file state */
+local void gz_reset(state)
+    gz_statep state;
+{
+    state->x.have = 0;              /* no output data available */
+    if (state->mode == GZ_READ) {   /* for reading ... */
+        state->eof = 0;             /* not at end of file */
+        state->past = 0;            /* have not read past end yet */
+        state->how = LOOK;          /* look for gzip header */
+    }
+    state->seek = 0;                /* no seek request pending */
+    gz_error(state, Z_OK, NULL);    /* clear error */
+    state->x.pos = 0;               /* no uncompressed data yet */
+    state->strm.avail_in = 0;       /* no input data yet */
+}
+
+/* Open a gzip file either by name or file descriptor. */
+local gzFile gz_open(path, fd, mode)
+    const void *path;
+    int fd;
+    const char *mode;
+{
+    gz_statep state;
+    z_size_t len;
+    int oflag;
+#ifdef O_CLOEXEC
+    int cloexec = 0;
+#endif
+#ifdef O_EXCL
+    int exclusive = 0;
+#endif
+
+    /* check input */
+    if (path == NULL)
+        return NULL;
+
+    /* allocate gzFile structure to return */
+    state = (gz_statep)malloc(sizeof(gz_state));
+    if (state == NULL)
+        return NULL;
+    state->size = 0;            /* no buffers allocated yet */
+    state->want = GZBUFSIZE;    /* requested buffer size */
+    state->msg = NULL;          /* no error message yet */
+
+    /* interpret mode */
+    state->mode = GZ_NONE;
+    state->level = Z_DEFAULT_COMPRESSION;
+    state->strategy = Z_DEFAULT_STRATEGY;
+    state->direct = 0;
+    while (*mode) {
+        if (*mode >= '0' && *mode <= '9')
+            state->level = *mode - '0';
+        else
+            switch (*mode) {
+            case 'r':
+                state->mode = GZ_READ;
+                break;
+#ifndef NO_GZCOMPRESS
+            case 'w':
+                state->mode = GZ_WRITE;
+                break;
+            case 'a':
+                state->mode = GZ_APPEND;
+                break;
+#endif
+            case '+':       /* can't read and write at the same time */
+                free(state);
+                return NULL;
+            case 'b':       /* ignore -- will request binary anyway */
+                break;
+#ifdef O_CLOEXEC
+            case 'e':
+                cloexec = 1;
+                break;
+#endif
+#ifdef O_EXCL
+            case 'x':
+                exclusive = 1;
+                break;
+#endif
+            case 'f':
+                state->strategy = Z_FILTERED;
+                break;
+            case 'h':
+                state->strategy = Z_HUFFMAN_ONLY;
+                break;
+            case 'R':
+                state->strategy = Z_RLE;
+                break;
+            case 'F':
+                state->strategy = Z_FIXED;
+                break;
+            case 'T':
+                state->direct = 1;
+                break;
+            default:        /* could consider as an error, but just ignore */
+                ;
+            }
+        mode++;
+    }
+
+    /* must provide an "r", "w", or "a" */
+    if (state->mode == GZ_NONE) {
+        free(state);
+        return NULL;
+    }
+
+    /* can't force transparent read */
+    if (state->mode == GZ_READ) {
+        if (state->direct) {
+            free(state);
+            return NULL;
+        }
+        state->direct = 1;      /* for empty file */
+    }
+
+    /* save the path name for error messages */
+#ifdef WIDECHAR
+    if (fd == -2) {
+        len = wcstombs(NULL, path, 0);
+        if (len == (z_size_t)-1)
+            len = 0;
+    }
+    else
+#endif
+        len = strlen((const char *)path);
+    state->path = (char *)malloc(len + 1);
+    if (state->path == NULL) {
+        free(state);
+        return NULL;
+    }
+#ifdef WIDECHAR
+    if (fd == -2)
+        if (len)
+            wcstombs(state->path, path, len + 1);
+        else
+            *(state->path) = 0;
+    else
+#endif
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+        (void)snprintf(state->path, len + 1, "%s", (const char *)path);
+#else
+        strcpy(state->path, path);
+#endif
+
+    /* compute the flags for open() */
+    oflag =
+#ifdef O_LARGEFILE
+        O_LARGEFILE |
+#endif
+#ifdef O_BINARY
+        O_BINARY |
+#endif
+#ifdef O_CLOEXEC
+        (cloexec ? O_CLOEXEC : 0) |
+#endif
+        (state->mode == GZ_READ ?
+         O_RDONLY :
+         (O_WRONLY | O_CREAT |
+#ifdef O_EXCL
+          (exclusive ? O_EXCL : 0) |
+#endif
+          (state->mode == GZ_WRITE ?
+           O_TRUNC :
+           O_APPEND)));
+
+    /* open the file with the appropriate flags (or just use fd) */
+    state->fd = fd > -1 ? fd : (
+#ifdef WIDECHAR
+        fd == -2 ? _wopen(path, oflag, 0666) :
+#endif
+        open((const char *)path, oflag, 0666));
+    if (state->fd == -1) {
+        free(state->path);
+        free(state);
+        return NULL;
+    }
+    if (state->mode == GZ_APPEND) {
+        LSEEK(state->fd, 0, SEEK_END);  /* so gzoffset() is correct */
+        state->mode = GZ_WRITE;         /* simplify later checks */
+    }
+
+    /* save the current position for rewinding (only if reading) */
+    if (state->mode == GZ_READ) {
+        state->start = LSEEK(state->fd, 0, SEEK_CUR);
+        if (state->start == -1) state->start = 0;
+    }
+
+    /* initialize stream */
+    gz_reset(state);
+
+    /* return stream */
+    return (gzFile)state;
+}
+
+/* -- see zlib.h -- */
+gzFile ZEXPORT gzopen(path, mode)
+    const char *path;
+    const char *mode;
+{
+    return gz_open(path, -1, mode);
+}
+
+/* -- see zlib.h -- */
+gzFile ZEXPORT gzopen64(path, mode)
+    const char *path;
+    const char *mode;
+{
+    return gz_open(path, -1, mode);
+}
+
+/* -- see zlib.h -- */
+gzFile ZEXPORT gzdopen(fd, mode)
+    int fd;
+    const char *mode;
+{
+    char *path;         /* identifier for error messages */
+    gzFile gz;
+
+    if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
+        return NULL;
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+    (void)snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd);
+#else
+    sprintf(path, "<fd:%d>", fd);   /* for debugging */
+#endif
+    gz = gz_open(path, fd, mode);
+    free(path);
+    return gz;
+}
+
+/* -- see zlib.h -- */
+#ifdef WIDECHAR
+gzFile ZEXPORT gzopen_w(path, mode)
+    const wchar_t *path;
+    const char *mode;
+{
+    return gz_open(path, -2, mode);
+}
+#endif
+
+/* -- see zlib.h -- */
+int ZEXPORT gzbuffer(file, size)
+    gzFile file;
+    unsigned size;
+{
+    gz_statep state;
+
+    /* get internal structure and check integrity */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+        return -1;
+
+    /* make sure we haven't already allocated memory */
+    if (state->size != 0)
+        return -1;
+
+    /* check and set requested size */
+    if ((size << 1) < size)
+        return -1;              /* need to be able to double it */
+    if (size < 2)
+        size = 2;               /* need two bytes to check magic header */
+    state->want = size;
+    return 0;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzrewind(file)
+    gzFile file;
+{
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+
+    /* check that we're reading and that there's no error */
+    if (state->mode != GZ_READ ||
+            (state->err != Z_OK && state->err != Z_BUF_ERROR))
+        return -1;
+
+    /* back up and start over */
+    if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
+        return -1;
+    gz_reset(state);
+    return 0;
+}
+
+/* -- see zlib.h -- */
+z_off64_t ZEXPORT gzseek64(file, offset, whence)
+    gzFile file;
+    z_off64_t offset;
+    int whence;
+{
+    unsigned n;
+    z_off64_t ret;
+    gz_statep state;
+
+    /* get internal structure and check integrity */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+        return -1;
+
+    /* check that there's no error */
+    if (state->err != Z_OK && state->err != Z_BUF_ERROR)
+        return -1;
+
+    /* can only seek from start or relative to current position */
+    if (whence != SEEK_SET && whence != SEEK_CUR)
+        return -1;
+
+    /* normalize offset to a SEEK_CUR specification */
+    if (whence == SEEK_SET)
+        offset -= state->x.pos;
+    else if (state->seek)
+        offset += state->skip;
+    state->seek = 0;
+
+    /* if within raw area while reading, just go there */
+    if (state->mode == GZ_READ && state->how == COPY &&
+            state->x.pos + offset >= 0) {
+        ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
+        if (ret == -1)
+            return -1;
+        state->x.have = 0;
+        state->eof = 0;
+        state->past = 0;
+        state->seek = 0;
+        gz_error(state, Z_OK, NULL);
+        state->strm.avail_in = 0;
+        state->x.pos += offset;
+        return state->x.pos;
+    }
+
+    /* calculate skip amount, rewinding if needed for back seek when reading */
+    if (offset < 0) {
+        if (state->mode != GZ_READ)         /* writing -- can't go backwards */
+            return -1;
+        offset += state->x.pos;
+        if (offset < 0)                     /* before start of file! */
+            return -1;
+        if (gzrewind(file) == -1)           /* rewind, then skip to offset */
+            return -1;
+    }
+
+    /* if reading, skip what's in output buffer (one less gzgetc() check) */
+    if (state->mode == GZ_READ) {
+        n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ?
+            (unsigned)offset : state->x.have;
+        state->x.have -= n;
+        state->x.next += n;
+        state->x.pos += n;
+        offset -= n;
+    }
+
+    /* request skip (if not zero) */
+    if (offset) {
+        state->seek = 1;
+        state->skip = offset;
+    }
+    return state->x.pos + offset;
+}
+
+/* -- see zlib.h -- */
+z_off_t ZEXPORT gzseek(file, offset, whence)
+    gzFile file;
+    z_off_t offset;
+    int whence;
+{
+    z_off64_t ret;
+
+    ret = gzseek64(file, (z_off64_t)offset, whence);
+    return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+}
+
+/* -- see zlib.h -- */
+z_off64_t ZEXPORT gztell64(file)
+    gzFile file;
+{
+    gz_statep state;
+
+    /* get internal structure and check integrity */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+        return -1;
+
+    /* return position */
+    return state->x.pos + (state->seek ? state->skip : 0);
+}
+
+/* -- see zlib.h -- */
+z_off_t ZEXPORT gztell(file)
+    gzFile file;
+{
+    z_off64_t ret;
+
+    ret = gztell64(file);
+    return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+}
+
+/* -- see zlib.h -- */
+z_off64_t ZEXPORT gzoffset64(file)
+    gzFile file;
+{
+    z_off64_t offset;
+    gz_statep state;
+
+    /* get internal structure and check integrity */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+        return -1;
+
+    /* compute and return effective offset in file */
+    offset = LSEEK(state->fd, 0, SEEK_CUR);
+    if (offset == -1)
+        return -1;
+    if (state->mode == GZ_READ)             /* reading */
+        offset -= state->strm.avail_in;     /* don't count buffered input */
+    return offset;
+}
+
+/* -- see zlib.h -- */
+z_off_t ZEXPORT gzoffset(file)
+    gzFile file;
+{
+    z_off64_t ret;
+
+    ret = gzoffset64(file);
+    return ret == (z_off_t)ret ? (z_off_t)ret : -1;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzeof(file)
+    gzFile file;
+{
+    gz_statep state;
+
+    /* get internal structure and check integrity */
+    if (file == NULL)
+        return 0;
+    state = (gz_statep)file;
+    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+        return 0;
+
+    /* return end-of-file state */
+    return state->mode == GZ_READ ? state->past : 0;
+}
+
+/* -- see zlib.h -- */
+const char * ZEXPORT gzerror(file, errnum)
+    gzFile file;
+    int *errnum;
+{
+    gz_statep state;
+
+    /* get internal structure and check integrity */
+    if (file == NULL)
+        return NULL;
+    state = (gz_statep)file;
+    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+        return NULL;
+
+    /* return error information */
+    if (errnum != NULL)
+        *errnum = state->err;
+    return state->err == Z_MEM_ERROR ? "out of memory" :
+                                       (state->msg == NULL ? "" : state->msg);
+}
+
+/* -- see zlib.h -- */
+void ZEXPORT gzclearerr(file)
+    gzFile file;
+{
+    gz_statep state;
+
+    /* get internal structure and check integrity */
+    if (file == NULL)
+        return;
+    state = (gz_statep)file;
+    if (state->mode != GZ_READ && state->mode != GZ_WRITE)
+        return;
+
+    /* clear error and end-of-file */
+    if (state->mode == GZ_READ) {
+        state->eof = 0;
+        state->past = 0;
+    }
+    gz_error(state, Z_OK, NULL);
+}
+
+/* Create an error message in allocated memory and set state->err and
+   state->msg accordingly.  Free any previous error message already there.  Do
+   not try to free or allocate space if the error is Z_MEM_ERROR (out of
+   memory).  Simply save the error message as a static string.  If there is an
+   allocation failure constructing the error message, then convert the error to
+   out of memory. */
+void ZLIB_INTERNAL gz_error(state, err, msg)
+    gz_statep state;
+    int err;
+    const char *msg;
+{
+    /* free previously allocated message and clear */
+    if (state->msg != NULL) {
+        if (state->err != Z_MEM_ERROR)
+            free(state->msg);
+        state->msg = NULL;
+    }
+
+    /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
+    if (err != Z_OK && err != Z_BUF_ERROR)
+        state->x.have = 0;
+
+    /* set error code, and if no message, then done */
+    state->err = err;
+    if (msg == NULL)
+        return;
+
+    /* for an out of memory error, return literal string when requested */
+    if (err == Z_MEM_ERROR)
+        return;
+
+    /* construct error message with path */
+    if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
+            NULL) {
+        state->err = Z_MEM_ERROR;
+        return;
+    }
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+    (void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
+                   "%s%s%s", state->path, ": ", msg);
+#else
+    strcpy(state->msg, state->path);
+    strcat(state->msg, ": ");
+    strcat(state->msg, msg);
+#endif
+}
+
+#ifndef INT_MAX
+/* portably return maximum value for an int (when limits.h presumed not
+   available) -- we need to do this to cover cases where 2's complement not
+   used, since C standard permits 1's complement and sign-bit representations,
+   otherwise we could just use ((unsigned)-1) >> 1 */
+unsigned ZLIB_INTERNAL gz_intmax()
+{
+    unsigned p, q;
+
+    p = 1;
+    do {
+        q = p;
+        p <<= 1;
+        p++;
+    } while (p > q);
+    return q >> 1;
+}
+#endif
diff --git a/jdk/src/java.base/share/native/libzip/zlib/gzread.c b/jdk/src/java.base/share/native/libzip/zlib/gzread.c
new file mode 100644
index 0000000..14394c5
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/gzread.c
@@ -0,0 +1,678 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* gzread.c -- zlib functions for reading gzip files
+ * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+/* Local functions */
+local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
+local int gz_avail OF((gz_statep));
+local int gz_look OF((gz_statep));
+local int gz_decomp OF((gz_statep));
+local int gz_fetch OF((gz_statep));
+local int gz_skip OF((gz_statep, z_off64_t));
+local z_size_t gz_read OF((gz_statep, voidp, z_size_t));
+
+/* Use read() to load a buffer -- return -1 on error, otherwise 0.  Read from
+   state->fd, and update state->eof, state->err, and state->msg as appropriate.
+   This function needs to loop on read(), since read() is not guaranteed to
+   read the number of bytes requested, depending on the type of descriptor. */
+local int gz_load(state, buf, len, have)
+    gz_statep state;
+    unsigned char *buf;
+    unsigned len;
+    unsigned *have;
+{
+    int ret;
+    unsigned get, max = ((unsigned)-1 >> 2) + 1;
+
+    *have = 0;
+    do {
+        get = len - *have;
+        if (get > max)
+            get = max;
+        ret = read(state->fd, buf + *have, get);
+        if (ret <= 0)
+            break;
+        *have += (unsigned)ret;
+    } while (*have < len);
+    if (ret < 0) {
+        gz_error(state, Z_ERRNO, zstrerror());
+        return -1;
+    }
+    if (ret == 0)
+        state->eof = 1;
+    return 0;
+}
+
+/* Load up input buffer and set eof flag if last data loaded -- return -1 on
+   error, 0 otherwise.  Note that the eof flag is set when the end of the input
+   file is reached, even though there may be unused data in the buffer.  Once
+   that data has been used, no more attempts will be made to read the file.
+   If strm->avail_in != 0, then the current data is moved to the beginning of
+   the input buffer, and then the remainder of the buffer is loaded with the
+   available data from the input file. */
+local int gz_avail(state)
+    gz_statep state;
+{
+    unsigned got;
+    z_streamp strm = &(state->strm);
+
+    if (state->err != Z_OK && state->err != Z_BUF_ERROR)
+        return -1;
+    if (state->eof == 0) {
+        if (strm->avail_in) {       /* copy what's there to the start */
+            unsigned char *p = state->in;
+            unsigned const char *q = strm->next_in;
+            unsigned n = strm->avail_in;
+            do {
+                *p++ = *q++;
+            } while (--n);
+        }
+        if (gz_load(state, state->in + strm->avail_in,
+                    state->size - strm->avail_in, &got) == -1)
+            return -1;
+        strm->avail_in += got;
+        strm->next_in = state->in;
+    }
+    return 0;
+}
+
+/* Look for gzip header, set up for inflate or copy.  state->x.have must be 0.
+   If this is the first time in, allocate required memory.  state->how will be
+   left unchanged if there is no more input data available, will be set to COPY
+   if there is no gzip header and direct copying will be performed, or it will
+   be set to GZIP for decompression.  If direct copying, then leftover input
+   data from the input buffer will be copied to the output buffer.  In that
+   case, all further file reads will be directly to either the output buffer or
+   a user buffer.  If decompressing, the inflate state will be initialized.
+   gz_look() will return 0 on success or -1 on failure. */
+local int gz_look(state)
+    gz_statep state;
+{
+    z_streamp strm = &(state->strm);
+
+    /* allocate read buffers and inflate memory */
+    if (state->size == 0) {
+        /* allocate buffers */
+        state->in = (unsigned char *)malloc(state->want);
+        state->out = (unsigned char *)malloc(state->want << 1);
+        if (state->in == NULL || state->out == NULL) {
+            free(state->out);
+            free(state->in);
+            gz_error(state, Z_MEM_ERROR, "out of memory");
+            return -1;
+        }
+        state->size = state->want;
+
+        /* allocate inflate memory */
+        state->strm.zalloc = Z_NULL;
+        state->strm.zfree = Z_NULL;
+        state->strm.opaque = Z_NULL;
+        state->strm.avail_in = 0;
+        state->strm.next_in = Z_NULL;
+        if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */
+            free(state->out);
+            free(state->in);
+            state->size = 0;
+            gz_error(state, Z_MEM_ERROR, "out of memory");
+            return -1;
+        }
+    }
+
+    /* get at least the magic bytes in the input buffer */
+    if (strm->avail_in < 2) {
+        if (gz_avail(state) == -1)
+            return -1;
+        if (strm->avail_in == 0)
+            return 0;
+    }
+
+    /* look for gzip magic bytes -- if there, do gzip decoding (note: there is
+       a logical dilemma here when considering the case of a partially written
+       gzip file, to wit, if a single 31 byte is written, then we cannot tell
+       whether this is a single-byte file, or just a partially written gzip
+       file -- for here we assume that if a gzip file is being written, then
+       the header will be written in a single operation, so that reading a
+       single byte is sufficient indication that it is not a gzip file) */
+    if (strm->avail_in > 1 &&
+            strm->next_in[0] == 31 && strm->next_in[1] == 139) {
+        inflateReset(strm);
+        state->how = GZIP;
+        state->direct = 0;
+        return 0;
+    }
+
+    /* no gzip header -- if we were decoding gzip before, then this is trailing
+       garbage.  Ignore the trailing garbage and finish. */
+    if (state->direct == 0) {
+        strm->avail_in = 0;
+        state->eof = 1;
+        state->x.have = 0;
+        return 0;
+    }
+
+    /* doing raw i/o, copy any leftover input to output -- this assumes that
+       the output buffer is larger than the input buffer, which also assures
+       space for gzungetc() */
+    state->x.next = state->out;
+    if (strm->avail_in) {
+        memcpy(state->x.next, strm->next_in, strm->avail_in);
+        state->x.have = strm->avail_in;
+        strm->avail_in = 0;
+    }
+    state->how = COPY;
+    state->direct = 1;
+    return 0;
+}
+
+/* Decompress from input to the provided next_out and avail_out in the state.
+   On return, state->x.have and state->x.next point to the just decompressed
+   data.  If the gzip stream completes, state->how is reset to LOOK to look for
+   the next gzip stream or raw data, once state->x.have is depleted.  Returns 0
+   on success, -1 on failure. */
+local int gz_decomp(state)
+    gz_statep state;
+{
+    int ret = Z_OK;
+    unsigned had;
+    z_streamp strm = &(state->strm);
+
+    /* fill output buffer up to end of deflate stream */
+    had = strm->avail_out;
+    do {
+        /* get more input for inflate() */
+        if (strm->avail_in == 0 && gz_avail(state) == -1)
+            return -1;
+        if (strm->avail_in == 0) {
+            gz_error(state, Z_BUF_ERROR, "unexpected end of file");
+            break;
+        }
+
+        /* decompress and handle errors */
+        ret = inflate(strm, Z_NO_FLUSH);
+        if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
+            gz_error(state, Z_STREAM_ERROR,
+                     "internal error: inflate stream corrupt");
+            return -1;
+        }
+        if (ret == Z_MEM_ERROR) {
+            gz_error(state, Z_MEM_ERROR, "out of memory");
+            return -1;
+        }
+        if (ret == Z_DATA_ERROR) {              /* deflate stream invalid */
+            gz_error(state, Z_DATA_ERROR,
+                     strm->msg == NULL ? "compressed data error" : strm->msg);
+            return -1;
+        }
+    } while (strm->avail_out && ret != Z_STREAM_END);
+
+    /* update available output */
+    state->x.have = had - strm->avail_out;
+    state->x.next = strm->next_out - state->x.have;
+
+    /* if the gzip stream completed successfully, look for another */
+    if (ret == Z_STREAM_END)
+        state->how = LOOK;
+
+    /* good decompression */
+    return 0;
+}
+
+/* Fetch data and put it in the output buffer.  Assumes state->x.have is 0.
+   Data is either copied from the input file or decompressed from the input
+   file depending on state->how.  If state->how is LOOK, then a gzip header is
+   looked for to determine whether to copy or decompress.  Returns -1 on error,
+   otherwise 0.  gz_fetch() will leave state->how as COPY or GZIP unless the
+   end of the input file has been reached and all data has been processed.  */
+local int gz_fetch(state)
+    gz_statep state;
+{
+    z_streamp strm = &(state->strm);
+
+    do {
+        switch(state->how) {
+        case LOOK:      /* -> LOOK, COPY (only if never GZIP), or GZIP */
+            if (gz_look(state) == -1)
+                return -1;
+            if (state->how == LOOK)
+                return 0;
+            break;
+        case COPY:      /* -> COPY */
+            if (gz_load(state, state->out, state->size << 1, &(state->x.have))
+                    == -1)
+                return -1;
+            state->x.next = state->out;
+            return 0;
+        case GZIP:      /* -> GZIP or LOOK (if end of gzip stream) */
+            strm->avail_out = state->size << 1;
+            strm->next_out = state->out;
+            if (gz_decomp(state) == -1)
+                return -1;
+        }
+    } while (state->x.have == 0 && (!state->eof || strm->avail_in));
+    return 0;
+}
+
+/* Skip len uncompressed bytes of output.  Return -1 on error, 0 on success. */
+local int gz_skip(state, len)
+    gz_statep state;
+    z_off64_t len;
+{
+    unsigned n;
+
+    /* skip over len bytes or reach end-of-file, whichever comes first */
+    while (len)
+        /* skip over whatever is in output buffer */
+        if (state->x.have) {
+            n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
+                (unsigned)len : state->x.have;
+            state->x.have -= n;
+            state->x.next += n;
+            state->x.pos += n;
+            len -= n;
+        }
+
+        /* output buffer empty -- return if we're at the end of the input */
+        else if (state->eof && state->strm.avail_in == 0)
+            break;
+
+        /* need more data to skip -- load up output buffer */
+        else {
+            /* get more output, looking for header if required */
+            if (gz_fetch(state) == -1)
+                return -1;
+        }
+    return 0;
+}
+
+/* Read len bytes into buf from file, or less than len up to the end of the
+   input.  Return the number of bytes read.  If zero is returned, either the
+   end of file was reached, or there was an error.  state->err must be
+   consulted in that case to determine which. */
+local z_size_t gz_read(state, buf, len)
+    gz_statep state;
+    voidp buf;
+    z_size_t len;
+{
+    z_size_t got;
+    unsigned n;
+
+    /* if len is zero, avoid unnecessary operations */
+    if (len == 0)
+        return 0;
+
+    /* process a skip request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_skip(state, state->skip) == -1)
+            return 0;
+    }
+
+    /* get len bytes to buf, or less than len if at the end */
+    got = 0;
+    do {
+        /* set n to the maximum amount of len that fits in an unsigned int */
+        n = -1;
+        if (n > len)
+            n = (unsigned)len;
+
+        /* first just try copying data from the output buffer */
+        if (state->x.have) {
+            if (state->x.have < n)
+                n = state->x.have;
+            memcpy(buf, state->x.next, n);
+            state->x.next += n;
+            state->x.have -= n;
+        }
+
+        /* output buffer empty -- return if we're at the end of the input */
+        else if (state->eof && state->strm.avail_in == 0) {
+            state->past = 1;        /* tried to read past end */
+            break;
+        }
+
+        /* need output data -- for small len or new stream load up our output
+           buffer */
+        else if (state->how == LOOK || n < (state->size << 1)) {
+            /* get more output, looking for header if required */
+            if (gz_fetch(state) == -1)
+                return 0;
+            continue;       /* no progress yet -- go back to copy above */
+            /* the copy above assures that we will leave with space in the
+               output buffer, allowing at least one gzungetc() to succeed */
+        }
+
+        /* large len -- read directly into user buffer */
+        else if (state->how == COPY) {      /* read directly */
+            if (gz_load(state, (unsigned char *)buf, n, &n) == -1)
+                return 0;
+        }
+
+        /* large len -- decompress directly into user buffer */
+        else {  /* state->how == GZIP */
+            state->strm.avail_out = n;
+            state->strm.next_out = (unsigned char *)buf;
+            if (gz_decomp(state) == -1)
+                return 0;
+            n = state->x.have;
+            state->x.have = 0;
+        }
+
+        /* update progress */
+        len -= n;
+        buf = (char *)buf + n;
+        got += n;
+        state->x.pos += n;
+    } while (len);
+
+    /* return number of bytes read into user buffer */
+    return got;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzread(file, buf, len)
+    gzFile file;
+    voidp buf;
+    unsigned len;
+{
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+
+    /* check that we're reading and that there's no (serious) error */
+    if (state->mode != GZ_READ ||
+            (state->err != Z_OK && state->err != Z_BUF_ERROR))
+        return -1;
+
+    /* since an int is returned, make sure len fits in one, otherwise return
+       with an error (this avoids a flaw in the interface) */
+    if ((int)len < 0) {
+        gz_error(state, Z_STREAM_ERROR, "request does not fit in an int");
+        return -1;
+    }
+
+    /* read len or fewer bytes to buf */
+    len = (unsigned)gz_read(state, buf, len);
+
+    /* check for an error */
+    if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR)
+        return -1;
+
+    /* return the number of bytes read (this is assured to fit in an int) */
+    return (int)len;
+}
+
+/* -- see zlib.h -- */
+z_size_t ZEXPORT gzfread(buf, size, nitems, file)
+    voidp buf;
+    z_size_t size;
+    z_size_t nitems;
+    gzFile file;
+{
+    z_size_t len;
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return 0;
+    state = (gz_statep)file;
+
+    /* check that we're reading and that there's no (serious) error */
+    if (state->mode != GZ_READ ||
+            (state->err != Z_OK && state->err != Z_BUF_ERROR))
+        return 0;
+
+    /* compute bytes to read -- error on overflow */
+    len = nitems * size;
+    if (size && len / size != nitems) {
+        gz_error(state, Z_STREAM_ERROR, "request does not fit in a size_t");
+        return 0;
+    }
+
+    /* read len or fewer bytes to buf, return the number of full items read */
+    return len ? gz_read(state, buf, len) / size : 0;
+}
+
+/* -- see zlib.h -- */
+#ifdef Z_PREFIX_SET
+#  undef z_gzgetc
+#else
+#  undef gzgetc
+#endif
+int ZEXPORT gzgetc(file)
+    gzFile file;
+{
+    int ret;
+    unsigned char buf[1];
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+
+    /* check that we're reading and that there's no (serious) error */
+    if (state->mode != GZ_READ ||
+        (state->err != Z_OK && state->err != Z_BUF_ERROR))
+        return -1;
+
+    /* try output buffer (no need to check for skip request) */
+    if (state->x.have) {
+        state->x.have--;
+        state->x.pos++;
+        return *(state->x.next)++;
+    }
+
+    /* nothing there -- try gz_read() */
+    ret = (int)gz_read(state, buf, 1);
+    return ret < 1 ? -1 : buf[0];
+}
+
+int ZEXPORT gzgetc_(file)
+gzFile file;
+{
+    return gzgetc(file);
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzungetc(c, file)
+    int c;
+    gzFile file;
+{
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+
+    /* check that we're reading and that there's no (serious) error */
+    if (state->mode != GZ_READ ||
+        (state->err != Z_OK && state->err != Z_BUF_ERROR))
+        return -1;
+
+    /* process a skip request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_skip(state, state->skip) == -1)
+            return -1;
+    }
+
+    /* can't push EOF */
+    if (c < 0)
+        return -1;
+
+    /* if output buffer empty, put byte at end (allows more pushing) */
+    if (state->x.have == 0) {
+        state->x.have = 1;
+        state->x.next = state->out + (state->size << 1) - 1;
+        state->x.next[0] = (unsigned char)c;
+        state->x.pos--;
+        state->past = 0;
+        return c;
+    }
+
+    /* if no room, give up (must have already done a gzungetc()) */
+    if (state->x.have == (state->size << 1)) {
+        gz_error(state, Z_DATA_ERROR, "out of room to push characters");
+        return -1;
+    }
+
+    /* slide output data if needed and insert byte before existing data */
+    if (state->x.next == state->out) {
+        unsigned char *src = state->out + state->x.have;
+        unsigned char *dest = state->out + (state->size << 1);
+        while (src > state->out)
+            *--dest = *--src;
+        state->x.next = dest;
+    }
+    state->x.have++;
+    state->x.next--;
+    state->x.next[0] = (unsigned char)c;
+    state->x.pos--;
+    state->past = 0;
+    return c;
+}
+
+/* -- see zlib.h -- */
+char * ZEXPORT gzgets(file, buf, len)
+    gzFile file;
+    char *buf;
+    int len;
+{
+    unsigned left, n;
+    char *str;
+    unsigned char *eol;
+    gz_statep state;
+
+    /* check parameters and get internal structure */
+    if (file == NULL || buf == NULL || len < 1)
+        return NULL;
+    state = (gz_statep)file;
+
+    /* check that we're reading and that there's no (serious) error */
+    if (state->mode != GZ_READ ||
+        (state->err != Z_OK && state->err != Z_BUF_ERROR))
+        return NULL;
+
+    /* process a skip request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_skip(state, state->skip) == -1)
+            return NULL;
+    }
+
+    /* copy output bytes up to new line or len - 1, whichever comes first --
+       append a terminating zero to the string (we don't check for a zero in
+       the contents, let the user worry about that) */
+    str = buf;
+    left = (unsigned)len - 1;
+    if (left) do {
+        /* assure that something is in the output buffer */
+        if (state->x.have == 0 && gz_fetch(state) == -1)
+            return NULL;                /* error */
+        if (state->x.have == 0) {       /* end of file */
+            state->past = 1;            /* read past end */
+            break;                      /* return what we have */
+        }
+
+        /* look for end-of-line in current output buffer */
+        n = state->x.have > left ? left : state->x.have;
+        eol = (unsigned char *)memchr(state->x.next, '\n', n);
+        if (eol != NULL)
+            n = (unsigned)(eol - state->x.next) + 1;
+
+        /* copy through end-of-line, or remainder if not found */
+        memcpy(buf, state->x.next, n);
+        state->x.have -= n;
+        state->x.next += n;
+        state->x.pos += n;
+        left -= n;
+        buf += n;
+    } while (left && eol == NULL);
+
+    /* return terminated string, or if nothing, end of file */
+    if (buf == str)
+        return NULL;
+    buf[0] = 0;
+    return str;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzdirect(file)
+    gzFile file;
+{
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return 0;
+    state = (gz_statep)file;
+
+    /* if the state is not known, but we can find out, then do so (this is
+       mainly for right after a gzopen() or gzdopen()) */
+    if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
+        (void)gz_look(state);
+
+    /* return 1 if transparent, 0 if processing a gzip stream */
+    return state->direct;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzclose_r(file)
+    gzFile file;
+{
+    int ret, err;
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return Z_STREAM_ERROR;
+    state = (gz_statep)file;
+
+    /* check that we're reading */
+    if (state->mode != GZ_READ)
+        return Z_STREAM_ERROR;
+
+    /* free memory and close file */
+    if (state->size) {
+        inflateEnd(&(state->strm));
+        free(state->out);
+        free(state->in);
+    }
+    err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
+    gz_error(state, Z_OK, NULL);
+    free(state->path);
+    ret = close(state->fd);
+    free(state);
+    return ret ? Z_ERRNO : err;
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib/gzwrite.c b/jdk/src/java.base/share/native/libzip/zlib/gzwrite.c
new file mode 100644
index 0000000..7a73b7c
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/gzwrite.c
@@ -0,0 +1,689 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* gzwrite.c -- zlib functions for writing gzip files
+ * Copyright (C) 2004-2017 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "gzguts.h"
+
+/* Local functions */
+local int gz_init OF((gz_statep));
+local int gz_comp OF((gz_statep, int));
+local int gz_zero OF((gz_statep, z_off64_t));
+local z_size_t gz_write OF((gz_statep, voidpc, z_size_t));
+
+/* Initialize state for writing a gzip file.  Mark initialization by setting
+   state->size to non-zero.  Return -1 on a memory allocation failure, or 0 on
+   success. */
+local int gz_init(state)
+    gz_statep state;
+{
+    int ret;
+    z_streamp strm = &(state->strm);
+
+    /* allocate input buffer (double size for gzprintf) */
+    state->in = (unsigned char *)malloc(state->want << 1);
+    if (state->in == NULL) {
+        gz_error(state, Z_MEM_ERROR, "out of memory");
+        return -1;
+    }
+
+    /* only need output buffer and deflate state if compressing */
+    if (!state->direct) {
+        /* allocate output buffer */
+        state->out = (unsigned char *)malloc(state->want);
+        if (state->out == NULL) {
+            free(state->in);
+            gz_error(state, Z_MEM_ERROR, "out of memory");
+            return -1;
+        }
+
+        /* allocate deflate memory, set up for gzip compression */
+        strm->zalloc = Z_NULL;
+        strm->zfree = Z_NULL;
+        strm->opaque = Z_NULL;
+        ret = deflateInit2(strm, state->level, Z_DEFLATED,
+                           MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
+        if (ret != Z_OK) {
+            free(state->out);
+            free(state->in);
+            gz_error(state, Z_MEM_ERROR, "out of memory");
+            return -1;
+        }
+        strm->next_in = NULL;
+    }
+
+    /* mark state as initialized */
+    state->size = state->want;
+
+    /* initialize write buffer if compressing */
+    if (!state->direct) {
+        strm->avail_out = state->size;
+        strm->next_out = state->out;
+        state->x.next = strm->next_out;
+    }
+    return 0;
+}
+
+/* Compress whatever is at avail_in and next_in and write to the output file.
+   Return -1 if there is an error writing to the output file or if gz_init()
+   fails to allocate memory, otherwise 0.  flush is assumed to be a valid
+   deflate() flush value.  If flush is Z_FINISH, then the deflate() state is
+   reset to start a new gzip stream.  If gz->direct is true, then simply write
+   to the output file without compressing, and ignore flush. */
+local int gz_comp(state, flush)
+    gz_statep state;
+    int flush;
+{
+    int ret, writ;
+    unsigned have, put, max = ((unsigned)-1 >> 2) + 1;
+    z_streamp strm = &(state->strm);
+
+    /* allocate memory if this is the first time through */
+    if (state->size == 0 && gz_init(state) == -1)
+        return -1;
+
+    /* write directly if requested */
+    if (state->direct) {
+        while (strm->avail_in) {
+            put = strm->avail_in > max ? max : strm->avail_in;
+            writ = write(state->fd, strm->next_in, put);
+            if (writ < 0) {
+                gz_error(state, Z_ERRNO, zstrerror());
+                return -1;
+            }
+            strm->avail_in -= (unsigned)writ;
+            strm->next_in += writ;
+        }
+        return 0;
+    }
+
+    /* run deflate() on provided input until it produces no more output */
+    ret = Z_OK;
+    do {
+        /* write out current buffer contents if full, or if flushing, but if
+           doing Z_FINISH then don't write until we get to Z_STREAM_END */
+        if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
+            (flush != Z_FINISH || ret == Z_STREAM_END))) {
+            while (strm->next_out > state->x.next) {
+                put = strm->next_out - state->x.next > (int)max ? max :
+                      (unsigned)(strm->next_out - state->x.next);
+                writ = write(state->fd, state->x.next, put);
+                if (writ < 0) {
+                    gz_error(state, Z_ERRNO, zstrerror());
+                    return -1;
+                }
+                state->x.next += writ;
+            }
+            if (strm->avail_out == 0) {
+                strm->avail_out = state->size;
+                strm->next_out = state->out;
+                state->x.next = state->out;
+            }
+        }
+
+        /* compress */
+        have = strm->avail_out;
+        ret = deflate(strm, flush);
+        if (ret == Z_STREAM_ERROR) {
+            gz_error(state, Z_STREAM_ERROR,
+                      "internal error: deflate stream corrupt");
+            return -1;
+        }
+        have -= strm->avail_out;
+    } while (have);
+
+    /* if that completed a deflate stream, allow another to start */
+    if (flush == Z_FINISH)
+        deflateReset(strm);
+
+    /* all done, no errors */
+    return 0;
+}
+
+/* Compress len zeros to output.  Return -1 on a write error or memory
+   allocation failure by gz_comp(), or 0 on success. */
+local int gz_zero(state, len)
+    gz_statep state;
+    z_off64_t len;
+{
+    int first;
+    unsigned n;
+    z_streamp strm = &(state->strm);
+
+    /* consume whatever's left in the input buffer */
+    if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+        return -1;
+
+    /* compress len zeros (len guaranteed > 0) */
+    first = 1;
+    while (len) {
+        n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
+            (unsigned)len : state->size;
+        if (first) {
+            memset(state->in, 0, n);
+            first = 0;
+        }
+        strm->avail_in = n;
+        strm->next_in = state->in;
+        state->x.pos += n;
+        if (gz_comp(state, Z_NO_FLUSH) == -1)
+            return -1;
+        len -= n;
+    }
+    return 0;
+}
+
+/* Write len bytes from buf to file.  Return the number of bytes written.  If
+   the returned value is less than len, then there was an error. */
+local z_size_t gz_write(state, buf, len)
+    gz_statep state;
+    voidpc buf;
+    z_size_t len;
+{
+    z_size_t put = len;
+
+    /* if len is zero, avoid unnecessary operations */
+    if (len == 0)
+        return 0;
+
+    /* allocate memory if this is the first time through */
+    if (state->size == 0 && gz_init(state) == -1)
+        return 0;
+
+    /* check for seek request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_zero(state, state->skip) == -1)
+            return 0;
+    }
+
+    /* for small len, copy to input buffer, otherwise compress directly */
+    if (len < state->size) {
+        /* copy to input buffer, compress when full */
+        do {
+            unsigned have, copy;
+
+            if (state->strm.avail_in == 0)
+                state->strm.next_in = state->in;
+            have = (unsigned)((state->strm.next_in + state->strm.avail_in) -
+                              state->in);
+            copy = state->size - have;
+            if (copy > len)
+                copy = (unsigned)len;
+            memcpy(state->in + have, buf, copy);
+            state->strm.avail_in += copy;
+            state->x.pos += copy;
+            buf = (const char *)buf + copy;
+            len -= copy;
+            if (len && gz_comp(state, Z_NO_FLUSH) == -1)
+                return 0;
+        } while (len);
+    }
+    else {
+        /* consume whatever's left in the input buffer */
+        if (state->strm.avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
+            return 0;
+
+        /* directly compress user buffer to file */
+        state->strm.next_in = (z_const Bytef *)buf;
+        do {
+            unsigned n = (unsigned)-1;
+            if (n > len)
+                n = (unsigned)len;
+            state->strm.avail_in = n;
+            state->x.pos += n;
+            if (gz_comp(state, Z_NO_FLUSH) == -1)
+                return 0;
+            len -= n;
+        } while (len);
+    }
+
+    /* input was all buffered or compressed */
+    return put;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzwrite(file, buf, len)
+    gzFile file;
+    voidpc buf;
+    unsigned len;
+{
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return 0;
+    state = (gz_statep)file;
+
+    /* check that we're writing and that there's no error */
+    if (state->mode != GZ_WRITE || state->err != Z_OK)
+        return 0;
+
+    /* since an int is returned, make sure len fits in one, otherwise return
+       with an error (this avoids a flaw in the interface) */
+    if ((int)len < 0) {
+        gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
+        return 0;
+    }
+
+    /* write len bytes from buf (the return value will fit in an int) */
+    return (int)gz_write(state, buf, len);
+}
+
+/* -- see zlib.h -- */
+z_size_t ZEXPORT gzfwrite(buf, size, nitems, file)
+    voidpc buf;
+    z_size_t size;
+    z_size_t nitems;
+    gzFile file;
+{
+    z_size_t len;
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return 0;
+    state = (gz_statep)file;
+
+    /* check that we're writing and that there's no error */
+    if (state->mode != GZ_WRITE || state->err != Z_OK)
+        return 0;
+
+    /* compute bytes to read -- error on overflow */
+    len = nitems * size;
+    if (size && len / size != nitems) {
+        gz_error(state, Z_STREAM_ERROR, "request does not fit in a size_t");
+        return 0;
+    }
+
+    /* write len bytes to buf, return the number of full items written */
+    return len ? gz_write(state, buf, len) / size : 0;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzputc(file, c)
+    gzFile file;
+    int c;
+{
+    unsigned have;
+    unsigned char buf[1];
+    gz_statep state;
+    z_streamp strm;
+
+    /* get internal structure */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+    strm = &(state->strm);
+
+    /* check that we're writing and that there's no error */
+    if (state->mode != GZ_WRITE || state->err != Z_OK)
+        return -1;
+
+    /* check for seek request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_zero(state, state->skip) == -1)
+            return -1;
+    }
+
+    /* try writing to input buffer for speed (state->size == 0 if buffer not
+       initialized) */
+    if (state->size) {
+        if (strm->avail_in == 0)
+            strm->next_in = state->in;
+        have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
+        if (have < state->size) {
+            state->in[have] = (unsigned char)c;
+            strm->avail_in++;
+            state->x.pos++;
+            return c & 0xff;
+        }
+    }
+
+    /* no room in buffer or not initialized, use gz_write() */
+    buf[0] = (unsigned char)c;
+    if (gz_write(state, buf, 1) != 1)
+        return -1;
+    return c & 0xff;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzputs(file, str)
+    gzFile file;
+    const char *str;
+{
+    int ret;
+    z_size_t len;
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return -1;
+    state = (gz_statep)file;
+
+    /* check that we're writing and that there's no error */
+    if (state->mode != GZ_WRITE || state->err != Z_OK)
+        return -1;
+
+    /* write string */
+    len = strlen(str);
+    ret = (int)gz_write(state, str, len);
+    return ret == 0 && len != 0 ? -1 : ret;
+}
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#include <stdarg.h>
+
+/* -- see zlib.h -- */
+int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
+{
+    int len;
+    unsigned left;
+    char *next;
+    gz_statep state;
+    z_streamp strm;
+
+    /* get internal structure */
+    if (file == NULL)
+        return Z_STREAM_ERROR;
+    state = (gz_statep)file;
+    strm = &(state->strm);
+
+    /* check that we're writing and that there's no error */
+    if (state->mode != GZ_WRITE || state->err != Z_OK)
+        return Z_STREAM_ERROR;
+
+    /* make sure we have some buffer space */
+    if (state->size == 0 && gz_init(state) == -1)
+        return state->err;
+
+    /* check for seek request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_zero(state, state->skip) == -1)
+            return state->err;
+    }
+
+    /* do the printf() into the input buffer, put length in len -- the input
+       buffer is double-sized just for this function, so there is guaranteed to
+       be state->size bytes available after the current contents */
+    if (strm->avail_in == 0)
+        strm->next_in = state->in;
+    next = (char *)(state->in + (strm->next_in - state->in) + strm->avail_in);
+    next[state->size - 1] = 0;
+#ifdef NO_vsnprintf
+#  ifdef HAS_vsprintf_void
+    (void)vsprintf(next, format, va);
+    for (len = 0; len < state->size; len++)
+        if (next[len] == 0) break;
+#  else
+    len = vsprintf(next, format, va);
+#  endif
+#else
+#  ifdef HAS_vsnprintf_void
+    (void)vsnprintf(next, state->size, format, va);
+    len = strlen(next);
+#  else
+    len = vsnprintf(next, state->size, format, va);
+#  endif
+#endif
+
+    /* check that printf() results fit in buffer */
+    if (len == 0 || (unsigned)len >= state->size || next[state->size - 1] != 0)
+        return 0;
+
+    /* update buffer and position, compress first half if past that */
+    strm->avail_in += (unsigned)len;
+    state->x.pos += len;
+    if (strm->avail_in >= state->size) {
+        left = strm->avail_in - state->size;
+        strm->avail_in = state->size;
+        if (gz_comp(state, Z_NO_FLUSH) == -1)
+            return state->err;
+        memcpy(state->in, state->in + state->size, left);
+        strm->next_in = state->in;
+        strm->avail_in = left;
+    }
+    return len;
+}
+
+int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
+{
+    va_list va;
+    int ret;
+
+    va_start(va, format);
+    ret = gzvprintf(file, format, va);
+    va_end(va);
+    return ret;
+}
+
+#else /* !STDC && !Z_HAVE_STDARG_H */
+
+/* -- see zlib.h -- */
+int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+                       a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
+    gzFile file;
+    const char *format;
+    int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+        a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
+{
+    unsigned len, left;
+    char *next;
+    gz_statep state;
+    z_streamp strm;
+
+    /* get internal structure */
+    if (file == NULL)
+        return Z_STREAM_ERROR;
+    state = (gz_statep)file;
+    strm = &(state->strm);
+
+    /* check that can really pass pointer in ints */
+    if (sizeof(int) != sizeof(void *))
+        return Z_STREAM_ERROR;
+
+    /* check that we're writing and that there's no error */
+    if (state->mode != GZ_WRITE || state->err != Z_OK)
+        return Z_STREAM_ERROR;
+
+    /* make sure we have some buffer space */
+    if (state->size == 0 && gz_init(state) == -1)
+        return state->error;
+
+    /* check for seek request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_zero(state, state->skip) == -1)
+            return state->error;
+    }
+
+    /* do the printf() into the input buffer, put length in len -- the input
+       buffer is double-sized just for this function, so there is guaranteed to
+       be state->size bytes available after the current contents */
+    if (strm->avail_in == 0)
+        strm->next_in = state->in;
+    next = (char *)(strm->next_in + strm->avail_in);
+    next[state->size - 1] = 0;
+#ifdef NO_snprintf
+#  ifdef HAS_sprintf_void
+    sprintf(next, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12,
+            a13, a14, a15, a16, a17, a18, a19, a20);
+    for (len = 0; len < size; len++)
+        if (next[len] == 0)
+            break;
+#  else
+    len = sprintf(next, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11,
+                  a12, a13, a14, a15, a16, a17, a18, a19, a20);
+#  endif
+#else
+#  ifdef HAS_snprintf_void
+    snprintf(next, state->size, format, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+             a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+    len = strlen(next);
+#  else
+    len = snprintf(next, state->size, format, a1, a2, a3, a4, a5, a6, a7, a8,
+                   a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+#  endif
+#endif
+
+    /* check that printf() results fit in buffer */
+    if (len == 0 || len >= state->size || next[state->size - 1] != 0)
+        return 0;
+
+    /* update buffer and position, compress first half if past that */
+    strm->avail_in += len;
+    state->x.pos += len;
+    if (strm->avail_in >= state->size) {
+        left = strm->avail_in - state->size;
+        strm->avail_in = state->size;
+        if (gz_comp(state, Z_NO_FLUSH) == -1)
+            return state->err;
+        memcpy(state->in, state->in + state->size, left);
+        strm->next_in = state->in;
+        strm->avail_in = left;
+    }
+    return (int)len;
+}
+
+#endif
+
+/* -- see zlib.h -- */
+int ZEXPORT gzflush(file, flush)
+    gzFile file;
+    int flush;
+{
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return Z_STREAM_ERROR;
+    state = (gz_statep)file;
+
+    /* check that we're writing and that there's no error */
+    if (state->mode != GZ_WRITE || state->err != Z_OK)
+        return Z_STREAM_ERROR;
+
+    /* check flush parameter */
+    if (flush < 0 || flush > Z_FINISH)
+        return Z_STREAM_ERROR;
+
+    /* check for seek request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_zero(state, state->skip) == -1)
+            return state->err;
+    }
+
+    /* compress remaining data with requested flush */
+    (void)gz_comp(state, flush);
+    return state->err;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzsetparams(file, level, strategy)
+    gzFile file;
+    int level;
+    int strategy;
+{
+    gz_statep state;
+    z_streamp strm;
+
+    /* get internal structure */
+    if (file == NULL)
+        return Z_STREAM_ERROR;
+    state = (gz_statep)file;
+    strm = &(state->strm);
+
+    /* check that we're writing and that there's no error */
+    if (state->mode != GZ_WRITE || state->err != Z_OK)
+        return Z_STREAM_ERROR;
+
+    /* if no change is requested, then do nothing */
+    if (level == state->level && strategy == state->strategy)
+        return Z_OK;
+
+    /* check for seek request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_zero(state, state->skip) == -1)
+            return state->err;
+    }
+
+    /* change compression parameters for subsequent input */
+    if (state->size) {
+        /* flush previous input with previous parameters before changing */
+        if (strm->avail_in && gz_comp(state, Z_BLOCK) == -1)
+            return state->err;
+        deflateParams(strm, level, strategy);
+    }
+    state->level = level;
+    state->strategy = strategy;
+    return Z_OK;
+}
+
+/* -- see zlib.h -- */
+int ZEXPORT gzclose_w(file)
+    gzFile file;
+{
+    int ret = Z_OK;
+    gz_statep state;
+
+    /* get internal structure */
+    if (file == NULL)
+        return Z_STREAM_ERROR;
+    state = (gz_statep)file;
+
+    /* check that we're writing */
+    if (state->mode != GZ_WRITE)
+        return Z_STREAM_ERROR;
+
+    /* check for seek request */
+    if (state->seek) {
+        state->seek = 0;
+        if (gz_zero(state, state->skip) == -1)
+            ret = state->err;
+    }
+
+    /* flush, free memory, and close file */
+    if (gz_comp(state, Z_FINISH) == -1)
+        ret = state->err;
+    if (state->size) {
+        if (!state->direct) {
+            (void)deflateEnd(&(state->strm));
+            free(state->out);
+        }
+        free(state->in);
+    }
+    gz_error(state, Z_OK, NULL);
+    free(state->path);
+    if (close(state->fd) == -1)
+        ret = Z_ERRNO;
+    free(state);
+    return ret;
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib/infback.c b/jdk/src/java.base/share/native/libzip/zlib/infback.c
new file mode 100644
index 0000000..4c82839
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/infback.c
@@ -0,0 +1,664 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* infback.c -- inflate using a call-back interface
+ * Copyright (C) 1995-2016 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+   This code is largely copied from inflate.c.  Normally either infback.o or
+   inflate.o would be linked into an application--not both.  The interface
+   with inffast.c is retained so that optimized assembler-coded versions of
+   inflate_fast() can be used with either inflate.c or infback.c.
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+/* function prototypes */
+local void fixedtables OF((struct inflate_state FAR *state));
+
+/*
+   strm provides memory allocation functions in zalloc and zfree, or
+   Z_NULL to use the library memory allocation functions.
+
+   windowBits is in the range 8..15, and window is a user-supplied
+   window and output buffer that is 2**windowBits bytes.
+ */
+int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
+z_streamp strm;
+int windowBits;
+unsigned char FAR *window;
+const char *version;
+int stream_size;
+{
+    struct inflate_state FAR *state;
+
+    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+        stream_size != (int)(sizeof(z_stream)))
+        return Z_VERSION_ERROR;
+    if (strm == Z_NULL || window == Z_NULL ||
+        windowBits < 8 || windowBits > 15)
+        return Z_STREAM_ERROR;
+    strm->msg = Z_NULL;                 /* in case we return an error */
+    if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zalloc = zcalloc;
+        strm->opaque = (voidpf)0;
+#endif
+    }
+    if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+    strm->zfree = zcfree;
+#endif
+    state = (struct inflate_state FAR *)ZALLOC(strm, 1,
+                                               sizeof(struct inflate_state));
+    if (state == Z_NULL) return Z_MEM_ERROR;
+    Tracev((stderr, "inflate: allocated\n"));
+    strm->state = (struct internal_state FAR *)state;
+    state->dmax = 32768U;
+    state->wbits = (uInt)windowBits;
+    state->wsize = 1U << windowBits;
+    state->window = window;
+    state->wnext = 0;
+    state->whave = 0;
+    return Z_OK;
+}
+
+/*
+   Return state with length and distance decoding tables and index sizes set to
+   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
+   If BUILDFIXED is defined, then instead this routine builds the tables the
+   first time it's called, and returns those tables the first time and
+   thereafter.  This reduces the size of the code by about 2K bytes, in
+   exchange for a little execution time.  However, BUILDFIXED should not be
+   used for threaded applications, since the rewriting of the tables and virgin
+   may not be thread-safe.
+ */
+local void fixedtables(state)
+struct inflate_state FAR *state;
+{
+#ifdef BUILDFIXED
+    static int virgin = 1;
+    static code *lenfix, *distfix;
+    static code fixed[544];
+
+    /* build fixed huffman tables if first call (may not be thread safe) */
+    if (virgin) {
+        unsigned sym, bits;
+        static code *next;
+
+        /* literal/length table */
+        sym = 0;
+        while (sym < 144) state->lens[sym++] = 8;
+        while (sym < 256) state->lens[sym++] = 9;
+        while (sym < 280) state->lens[sym++] = 7;
+        while (sym < 288) state->lens[sym++] = 8;
+        next = fixed;
+        lenfix = next;
+        bits = 9;
+        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+
+        /* distance table */
+        sym = 0;
+        while (sym < 32) state->lens[sym++] = 5;
+        distfix = next;
+        bits = 5;
+        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+
+        /* do this just once */
+        virgin = 0;
+    }
+#else /* !BUILDFIXED */
+#   include "inffixed.h"
+#endif /* BUILDFIXED */
+    state->lencode = lenfix;
+    state->lenbits = 9;
+    state->distcode = distfix;
+    state->distbits = 5;
+}
+
+/* Macros for inflateBack(): */
+
+/* Load returned state from inflate_fast() */
+#define LOAD() \
+    do { \
+        put = strm->next_out; \
+        left = strm->avail_out; \
+        next = strm->next_in; \
+        have = strm->avail_in; \
+        hold = state->hold; \
+        bits = state->bits; \
+    } while (0)
+
+/* Set state from registers for inflate_fast() */
+#define RESTORE() \
+    do { \
+        strm->next_out = put; \
+        strm->avail_out = left; \
+        strm->next_in = next; \
+        strm->avail_in = have; \
+        state->hold = hold; \
+        state->bits = bits; \
+    } while (0)
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+    do { \
+        hold = 0; \
+        bits = 0; \
+    } while (0)
+
+/* Assure that some input is available.  If input is requested, but denied,
+   then return a Z_BUF_ERROR from inflateBack(). */
+#define PULL() \
+    do { \
+        if (have == 0) { \
+            have = in(in_desc, &next); \
+            if (have == 0) { \
+                next = Z_NULL; \
+                ret = Z_BUF_ERROR; \
+                goto inf_leave; \
+            } \
+        } \
+    } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflateBack()
+   with an error if there is no input available. */
+#define PULLBYTE() \
+    do { \
+        PULL(); \
+        have--; \
+        hold += (unsigned long)(*next++) << bits; \
+        bits += 8; \
+    } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator.  If there is
+   not enough available input to do that, then return from inflateBack() with
+   an error. */
+#define NEEDBITS(n) \
+    do { \
+        while (bits < (unsigned)(n)) \
+            PULLBYTE(); \
+    } while (0)
+
+/* Return the low n bits of the bit accumulator (n < 16) */
+#define BITS(n) \
+    ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+    do { \
+        hold >>= (n); \
+        bits -= (unsigned)(n); \
+    } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+    do { \
+        hold >>= bits & 7; \
+        bits -= bits & 7; \
+    } while (0)
+
+/* Assure that some output space is available, by writing out the window
+   if it's full.  If the write fails, return from inflateBack() with a
+   Z_BUF_ERROR. */
+#define ROOM() \
+    do { \
+        if (left == 0) { \
+            put = state->window; \
+            left = state->wsize; \
+            state->whave = left; \
+            if (out(out_desc, put, left)) { \
+                ret = Z_BUF_ERROR; \
+                goto inf_leave; \
+            } \
+        } \
+    } while (0)
+
+/*
+   strm provides the memory allocation functions and window buffer on input,
+   and provides information on the unused input on return.  For Z_DATA_ERROR
+   returns, strm will also provide an error message.
+
+   in() and out() are the call-back input and output functions.  When
+   inflateBack() needs more input, it calls in().  When inflateBack() has
+   filled the window with output, or when it completes with data in the
+   window, it calls out() to write out the data.  The application must not
+   change the provided input until in() is called again or inflateBack()
+   returns.  The application must not change the window/output buffer until
+   inflateBack() returns.
+
+   in() and out() are called with a descriptor parameter provided in the
+   inflateBack() call.  This parameter can be a structure that provides the
+   information required to do the read or write, as well as accumulated
+   information on the input and output such as totals and check values.
+
+   in() should return zero on failure.  out() should return non-zero on
+   failure.  If either in() or out() fails, than inflateBack() returns a
+   Z_BUF_ERROR.  strm->next_in can be checked for Z_NULL to see whether it
+   was in() or out() that caused in the error.  Otherwise,  inflateBack()
+   returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
+   error, or Z_MEM_ERROR if it could not allocate memory for the state.
+   inflateBack() can also return Z_STREAM_ERROR if the input parameters
+   are not correct, i.e. strm is Z_NULL or the state was not initialized.
+ */
+int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
+z_streamp strm;
+in_func in;
+void FAR *in_desc;
+out_func out;
+void FAR *out_desc;
+{
+    struct inflate_state FAR *state;
+    z_const unsigned char FAR *next;    /* next input */
+    unsigned char FAR *put;     /* next output */
+    unsigned have, left;        /* available input and output */
+    unsigned long hold;         /* bit buffer */
+    unsigned bits;              /* bits in bit buffer */
+    unsigned copy;              /* number of stored or match bytes to copy */
+    unsigned char FAR *from;    /* where to copy match bytes from */
+    code here;                  /* current decoding table entry */
+    code last;                  /* parent table entry */
+    unsigned len;               /* length to copy for repeats, bits to drop */
+    int ret;                    /* return code */
+    static const unsigned short order[19] = /* permutation of code lengths */
+        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+    /* Check that the strm exists and that the state was initialized */
+    if (strm == Z_NULL || strm->state == Z_NULL)
+        return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* Reset the state */
+    strm->msg = Z_NULL;
+    state->mode = TYPE;
+    state->last = 0;
+    state->whave = 0;
+    next = strm->next_in;
+    have = next != Z_NULL ? strm->avail_in : 0;
+    hold = 0;
+    bits = 0;
+    put = state->window;
+    left = state->wsize;
+
+    /* Inflate until end of block marked as last */
+    for (;;)
+        switch (state->mode) {
+        case TYPE:
+            /* determine and dispatch block type */
+            if (state->last) {
+                BYTEBITS();
+                state->mode = DONE;
+                break;
+            }
+            NEEDBITS(3);
+            state->last = BITS(1);
+            DROPBITS(1);
+            switch (BITS(2)) {
+            case 0:                             /* stored block */
+                Tracev((stderr, "inflate:     stored block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = STORED;
+                break;
+            case 1:                             /* fixed block */
+                fixedtables(state);
+                Tracev((stderr, "inflate:     fixed codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = LEN;              /* decode codes */
+                break;
+            case 2:                             /* dynamic block */
+                Tracev((stderr, "inflate:     dynamic codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = TABLE;
+                break;
+            case 3:
+                strm->msg = (char *)"invalid block type";
+                state->mode = BAD;
+            }
+            DROPBITS(2);
+            break;
+
+        case STORED:
+            /* get and verify stored block length */
+            BYTEBITS();                         /* go to byte boundary */
+            NEEDBITS(32);
+            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+                strm->msg = (char *)"invalid stored block lengths";
+                state->mode = BAD;
+                break;
+            }
+            state->length = (unsigned)hold & 0xffff;
+            Tracev((stderr, "inflate:       stored length %u\n",
+                    state->length));
+            INITBITS();
+
+            /* copy stored block from input to output */
+            while (state->length != 0) {
+                copy = state->length;
+                PULL();
+                ROOM();
+                if (copy > have) copy = have;
+                if (copy > left) copy = left;
+                zmemcpy(put, next, copy);
+                have -= copy;
+                next += copy;
+                left -= copy;
+                put += copy;
+                state->length -= copy;
+            }
+            Tracev((stderr, "inflate:       stored end\n"));
+            state->mode = TYPE;
+            break;
+
+        case TABLE:
+            /* get dynamic table entries descriptor */
+            NEEDBITS(14);
+            state->nlen = BITS(5) + 257;
+            DROPBITS(5);
+            state->ndist = BITS(5) + 1;
+            DROPBITS(5);
+            state->ncode = BITS(4) + 4;
+            DROPBITS(4);
+#ifndef PKZIP_BUG_WORKAROUND
+            if (state->nlen > 286 || state->ndist > 30) {
+                strm->msg = (char *)"too many length or distance symbols";
+                state->mode = BAD;
+                break;
+            }
+#endif
+            Tracev((stderr, "inflate:       table sizes ok\n"));
+
+            /* get code length code lengths (not a typo) */
+            state->have = 0;
+            while (state->have < state->ncode) {
+                NEEDBITS(3);
+                state->lens[order[state->have++]] = (unsigned short)BITS(3);
+                DROPBITS(3);
+            }
+            while (state->have < 19)
+                state->lens[order[state->have++]] = 0;
+            state->next = state->codes;
+            state->lencode = (code const FAR *)(state->next);
+            state->lenbits = 7;
+            ret = inflate_table(CODES, state->lens, 19, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid code lengths set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       code lengths ok\n"));
+
+            /* get length and distance code code lengths */
+            state->have = 0;
+            while (state->have < state->nlen + state->ndist) {
+                for (;;) {
+                    here = state->lencode[BITS(state->lenbits)];
+                    if ((unsigned)(here.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                if (here.val < 16) {
+                    DROPBITS(here.bits);
+                    state->lens[state->have++] = here.val;
+                }
+                else {
+                    if (here.val == 16) {
+                        NEEDBITS(here.bits + 2);
+                        DROPBITS(here.bits);
+                        if (state->have == 0) {
+                            strm->msg = (char *)"invalid bit length repeat";
+                            state->mode = BAD;
+                            break;
+                        }
+                        len = (unsigned)(state->lens[state->have - 1]);
+                        copy = 3 + BITS(2);
+                        DROPBITS(2);
+                    }
+                    else if (here.val == 17) {
+                        NEEDBITS(here.bits + 3);
+                        DROPBITS(here.bits);
+                        len = 0;
+                        copy = 3 + BITS(3);
+                        DROPBITS(3);
+                    }
+                    else {
+                        NEEDBITS(here.bits + 7);
+                        DROPBITS(here.bits);
+                        len = 0;
+                        copy = 11 + BITS(7);
+                        DROPBITS(7);
+                    }
+                    if (state->have + copy > state->nlen + state->ndist) {
+                        strm->msg = (char *)"invalid bit length repeat";
+                        state->mode = BAD;
+                        break;
+                    }
+                    while (copy--)
+                        state->lens[state->have++] = (unsigned short)len;
+                }
+            }
+
+            /* handle error breaks in while */
+            if (state->mode == BAD) break;
+
+            /* check for end-of-block code (better have one) */
+            if (state->lens[256] == 0) {
+                strm->msg = (char *)"invalid code -- missing end-of-block";
+                state->mode = BAD;
+                break;
+            }
+
+            /* build code tables -- note: do not change the lenbits or distbits
+               values here (9 and 6) without reading the comments in inftrees.h
+               concerning the ENOUGH constants, which depend on those values */
+            state->next = state->codes;
+            state->lencode = (code const FAR *)(state->next);
+            state->lenbits = 9;
+            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid literal/lengths set";
+                state->mode = BAD;
+                break;
+            }
+            state->distcode = (code const FAR *)(state->next);
+            state->distbits = 6;
+            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+                            &(state->next), &(state->distbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid distances set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       codes ok\n"));
+            state->mode = LEN;
+
+        case LEN:
+            /* use inflate_fast() if we have enough input and output */
+            if (have >= 6 && left >= 258) {
+                RESTORE();
+                if (state->whave < state->wsize)
+                    state->whave = state->wsize - left;
+                inflate_fast(strm, state->wsize);
+                LOAD();
+                break;
+            }
+
+            /* get a literal, length, or end-of-block code */
+            for (;;) {
+                here = state->lencode[BITS(state->lenbits)];
+                if ((unsigned)(here.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if (here.op && (here.op & 0xf0) == 0) {
+                last = here;
+                for (;;) {
+                    here = state->lencode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+            }
+            DROPBITS(here.bits);
+            state->length = (unsigned)here.val;
+
+            /* process literal */
+            if (here.op == 0) {
+                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+                        "inflate:         literal '%c'\n" :
+                        "inflate:         literal 0x%02x\n", here.val));
+                ROOM();
+                *put++ = (unsigned char)(state->length);
+                left--;
+                state->mode = LEN;
+                break;
+            }
+
+            /* process end of block */
+            if (here.op & 32) {
+                Tracevv((stderr, "inflate:         end of block\n"));
+                state->mode = TYPE;
+                break;
+            }
+
+            /* invalid code */
+            if (here.op & 64) {
+                strm->msg = (char *)"invalid literal/length code";
+                state->mode = BAD;
+                break;
+            }
+
+            /* length code -- get extra bits, if any */
+            state->extra = (unsigned)(here.op) & 15;
+            if (state->extra != 0) {
+                NEEDBITS(state->extra);
+                state->length += BITS(state->extra);
+                DROPBITS(state->extra);
+            }
+            Tracevv((stderr, "inflate:         length %u\n", state->length));
+
+            /* get distance code */
+            for (;;) {
+                here = state->distcode[BITS(state->distbits)];
+                if ((unsigned)(here.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if ((here.op & 0xf0) == 0) {
+                last = here;
+                for (;;) {
+                    here = state->distcode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+            }
+            DROPBITS(here.bits);
+            if (here.op & 64) {
+                strm->msg = (char *)"invalid distance code";
+                state->mode = BAD;
+                break;
+            }
+            state->offset = (unsigned)here.val;
+
+            /* get distance extra bits, if any */
+            state->extra = (unsigned)(here.op) & 15;
+            if (state->extra != 0) {
+                NEEDBITS(state->extra);
+                state->offset += BITS(state->extra);
+                DROPBITS(state->extra);
+            }
+            if (state->offset > state->wsize - (state->whave < state->wsize ?
+                                                left : 0)) {
+                strm->msg = (char *)"invalid distance too far back";
+                state->mode = BAD;
+                break;
+            }
+            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
+
+            /* copy match from window to output */
+            do {
+                ROOM();
+                copy = state->wsize - state->offset;
+                if (copy < left) {
+                    from = put + copy;
+                    copy = left - copy;
+                }
+                else {
+                    from = put - state->offset;
+                    copy = left;
+                }
+                if (copy > state->length) copy = state->length;
+                state->length -= copy;
+                left -= copy;
+                do {
+                    *put++ = *from++;
+                } while (--copy);
+            } while (state->length != 0);
+            break;
+
+        case DONE:
+            /* inflate stream terminated properly -- write leftover output */
+            ret = Z_STREAM_END;
+            if (left < state->wsize) {
+                if (out(out_desc, state->window, state->wsize - left))
+                    ret = Z_BUF_ERROR;
+            }
+            goto inf_leave;
+
+        case BAD:
+            ret = Z_DATA_ERROR;
+            goto inf_leave;
+
+        default:                /* can't happen, but makes compilers happy */
+            ret = Z_STREAM_ERROR;
+            goto inf_leave;
+        }
+
+    /* Return unused input */
+  inf_leave:
+    strm->next_in = next;
+    strm->avail_in = have;
+    return ret;
+}
+
+int ZEXPORT inflateBackEnd(strm)
+z_streamp strm;
+{
+    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+        return Z_STREAM_ERROR;
+    ZFREE(strm, strm->state);
+    strm->state = Z_NULL;
+    Tracev((stderr, "inflate: end\n"));
+    return Z_OK;
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib/inffast.c b/jdk/src/java.base/share/native/libzip/zlib/inffast.c
new file mode 100644
index 0000000..4bfc995
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/inffast.c
@@ -0,0 +1,347 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* inffast.c -- fast decoding
+ * Copyright (C) 1995-2017 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifdef ASMINF
+#  pragma message("Assembler code may have bugs -- use at your own risk")
+#else
+
+/*
+   Decode literal, length, and distance codes and write out the resulting
+   literal and match bytes until either not enough input or output is
+   available, an end-of-block is encountered, or a data error is encountered.
+   When large enough input and output buffers are supplied to inflate(), for
+   example, a 16K input buffer and a 64K output buffer, more than 95% of the
+   inflate execution time is spent in this routine.
+
+   Entry assumptions:
+
+        state->mode == LEN
+        strm->avail_in >= 6
+        strm->avail_out >= 258
+        start >= strm->avail_out
+        state->bits < 8
+
+   On return, state->mode is one of:
+
+        LEN -- ran out of enough output space or enough available input
+        TYPE -- reached end of block code, inflate() to interpret next block
+        BAD -- error in block data
+
+   Notes:
+
+    - The maximum input bits used by a length/distance pair is 15 bits for the
+      length code, 5 bits for the length extra, 15 bits for the distance code,
+      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
+      Therefore if strm->avail_in >= 6, then there is enough input to avoid
+      checking for available input while decoding.
+
+    - The maximum bytes that a single length/distance pair can output is 258
+      bytes, which is the maximum length that can be coded.  inflate_fast()
+      requires strm->avail_out >= 258 for each loop to avoid checking for
+      output space.
+ */
+void ZLIB_INTERNAL inflate_fast(strm, start)
+z_streamp strm;
+unsigned start;         /* inflate()'s starting value for strm->avail_out */
+{
+    struct inflate_state FAR *state;
+    z_const unsigned char FAR *in;      /* local strm->next_in */
+    z_const unsigned char FAR *last;    /* have enough input while in < last */
+    unsigned char FAR *out;     /* local strm->next_out */
+    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
+    unsigned char FAR *end;     /* while out < end, enough space available */
+#ifdef INFLATE_STRICT
+    unsigned dmax;              /* maximum distance from zlib header */
+#endif
+    unsigned wsize;             /* window size or zero if not using window */
+    unsigned whave;             /* valid bytes in the window */
+    unsigned wnext;             /* window write index */
+    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
+    unsigned long hold;         /* local strm->hold */
+    unsigned bits;              /* local strm->bits */
+    code const FAR *lcode;      /* local strm->lencode */
+    code const FAR *dcode;      /* local strm->distcode */
+    unsigned lmask;             /* mask for first level of length codes */
+    unsigned dmask;             /* mask for first level of distance codes */
+    code here;                  /* retrieved table entry */
+    unsigned op;                /* code bits, operation, extra bits, or */
+                                /*  window position, window bytes to copy */
+    unsigned len;               /* match length, unused bytes */
+    unsigned dist;              /* match distance */
+    unsigned char FAR *from;    /* where to copy match from */
+
+    /* copy state to local variables */
+    state = (struct inflate_state FAR *)strm->state;
+    in = strm->next_in;
+    last = in + (strm->avail_in - 5);
+    out = strm->next_out;
+    beg = out - (start - strm->avail_out);
+    end = out + (strm->avail_out - 257);
+#ifdef INFLATE_STRICT
+    dmax = state->dmax;
+#endif
+    wsize = state->wsize;
+    whave = state->whave;
+    wnext = state->wnext;
+    window = state->window;
+    hold = state->hold;
+    bits = state->bits;
+    lcode = state->lencode;
+    dcode = state->distcode;
+    lmask = (1U << state->lenbits) - 1;
+    dmask = (1U << state->distbits) - 1;
+
+    /* decode literals and length/distances until end-of-block or not enough
+       input data or output space */
+    do {
+        if (bits < 15) {
+            hold += (unsigned long)(*in++) << bits;
+            bits += 8;
+            hold += (unsigned long)(*in++) << bits;
+            bits += 8;
+        }
+        here = lcode[hold & lmask];
+      dolen:
+        op = (unsigned)(here.bits);
+        hold >>= op;
+        bits -= op;
+        op = (unsigned)(here.op);
+        if (op == 0) {                          /* literal */
+            Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+                    "inflate:         literal '%c'\n" :
+                    "inflate:         literal 0x%02x\n", here.val));
+            *out++ = (unsigned char)(here.val);
+        }
+        else if (op & 16) {                     /* length base */
+            len = (unsigned)(here.val);
+            op &= 15;                           /* number of extra bits */
+            if (op) {
+                if (bits < op) {
+                    hold += (unsigned long)(*in++) << bits;
+                    bits += 8;
+                }
+                len += (unsigned)hold & ((1U << op) - 1);
+                hold >>= op;
+                bits -= op;
+            }
+            Tracevv((stderr, "inflate:         length %u\n", len));
+            if (bits < 15) {
+                hold += (unsigned long)(*in++) << bits;
+                bits += 8;
+                hold += (unsigned long)(*in++) << bits;
+                bits += 8;
+            }
+            here = dcode[hold & dmask];
+          dodist:
+            op = (unsigned)(here.bits);
+            hold >>= op;
+            bits -= op;
+            op = (unsigned)(here.op);
+            if (op & 16) {                      /* distance base */
+                dist = (unsigned)(here.val);
+                op &= 15;                       /* number of extra bits */
+                if (bits < op) {
+                    hold += (unsigned long)(*in++) << bits;
+                    bits += 8;
+                    if (bits < op) {
+                        hold += (unsigned long)(*in++) << bits;
+                        bits += 8;
+                    }
+                }
+                dist += (unsigned)hold & ((1U << op) - 1);
+#ifdef INFLATE_STRICT
+                if (dist > dmax) {
+                    strm->msg = (char *)"invalid distance too far back";
+                    state->mode = BAD;
+                    break;
+                }
+#endif
+                hold >>= op;
+                bits -= op;
+                Tracevv((stderr, "inflate:         distance %u\n", dist));
+                op = (unsigned)(out - beg);     /* max distance in output */
+                if (dist > op) {                /* see if copy from window */
+                    op = dist - op;             /* distance back in window */
+                    if (op > whave) {
+                        if (state->sane) {
+                            strm->msg =
+                                (char *)"invalid distance too far back";
+                            state->mode = BAD;
+                            break;
+                        }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+                        if (len <= op - whave) {
+                            do {
+                                *out++ = 0;
+                            } while (--len);
+                            continue;
+                        }
+                        len -= op - whave;
+                        do {
+                            *out++ = 0;
+                        } while (--op > whave);
+                        if (op == 0) {
+                            from = out - dist;
+                            do {
+                                *out++ = *from++;
+                            } while (--len);
+                            continue;
+                        }
+#endif
+                    }
+                    from = window;
+                    if (wnext == 0) {           /* very common case */
+                        from += wsize - op;
+                        if (op < len) {         /* some from window */
+                            len -= op;
+                            do {
+                                *out++ = *from++;
+                            } while (--op);
+                            from = out - dist;  /* rest from output */
+                        }
+                    }
+                    else if (wnext < op) {      /* wrap around window */
+                        from += wsize + wnext - op;
+                        op -= wnext;
+                        if (op < len) {         /* some from end of window */
+                            len -= op;
+                            do {
+                                *out++ = *from++;
+                            } while (--op);
+                            from = window;
+                            if (wnext < len) {  /* some from start of window */
+                                op = wnext;
+                                len -= op;
+                                do {
+                                    *out++ = *from++;
+                                } while (--op);
+                                from = out - dist;      /* rest from output */
+                            }
+                        }
+                    }
+                    else {                      /* contiguous in window */
+                        from += wnext - op;
+                        if (op < len) {         /* some from window */
+                            len -= op;
+                            do {
+                                *out++ = *from++;
+                            } while (--op);
+                            from = out - dist;  /* rest from output */
+                        }
+                    }
+                    while (len > 2) {
+                        *out++ = *from++;
+                        *out++ = *from++;
+                        *out++ = *from++;
+                        len -= 3;
+                    }
+                    if (len) {
+                        *out++ = *from++;
+                        if (len > 1)
+                            *out++ = *from++;
+                    }
+                }
+                else {
+                    from = out - dist;          /* copy direct from output */
+                    do {                        /* minimum length is three */
+                        *out++ = *from++;
+                        *out++ = *from++;
+                        *out++ = *from++;
+                        len -= 3;
+                    } while (len > 2);
+                    if (len) {
+                        *out++ = *from++;
+                        if (len > 1)
+                            *out++ = *from++;
+                    }
+                }
+            }
+            else if ((op & 64) == 0) {          /* 2nd level distance code */
+                here = dcode[here.val + (hold & ((1U << op) - 1))];
+                goto dodist;
+            }
+            else {
+                strm->msg = (char *)"invalid distance code";
+                state->mode = BAD;
+                break;
+            }
+        }
+        else if ((op & 64) == 0) {              /* 2nd level length code */
+            here = lcode[here.val + (hold & ((1U << op) - 1))];
+            goto dolen;
+        }
+        else if (op & 32) {                     /* end-of-block */
+            Tracevv((stderr, "inflate:         end of block\n"));
+            state->mode = TYPE;
+            break;
+        }
+        else {
+            strm->msg = (char *)"invalid literal/length code";
+            state->mode = BAD;
+            break;
+        }
+    } while (in < last && out < end);
+
+    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+    len = bits >> 3;
+    in -= len;
+    bits -= len << 3;
+    hold &= (1U << bits) - 1;
+
+    /* update state and return */
+    strm->next_in = in;
+    strm->next_out = out;
+    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
+    strm->avail_out = (unsigned)(out < end ?
+                                 257 + (end - out) : 257 - (out - end));
+    state->hold = hold;
+    state->bits = bits;
+    return;
+}
+
+/*
+   inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
+   - Using bit fields for code structure
+   - Different op definition to avoid & for extra bits (do & for table bits)
+   - Three separate decoding do-loops for direct, window, and wnext == 0
+   - Special case for distance > 1 copies to do overlapped load and store copy
+   - Explicit branch predictions (based on measured branch probabilities)
+   - Deferring match copy and interspersed it with decoding subsequent codes
+   - Swapping literal/length else
+   - Swapping window/direct else
+   - Larger unrolled copy loops (three is about right)
+   - Moving len -= 3 statement into middle of loop
+ */
+
+#endif /* !ASMINF */
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.h b/jdk/src/java.base/share/native/libzip/zlib/inffast.h
similarity index 100%
rename from jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.h
rename to jdk/src/java.base/share/native/libzip/zlib/inffast.h
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffixed.h b/jdk/src/java.base/share/native/libzip/zlib/inffixed.h
similarity index 100%
rename from jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffixed.h
rename to jdk/src/java.base/share/native/libzip/zlib/inffixed.h
diff --git a/jdk/src/java.base/share/native/libzip/zlib/inflate.c b/jdk/src/java.base/share/native/libzip/zlib/inflate.c
new file mode 100644
index 0000000..ca904e7
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/inflate.c
@@ -0,0 +1,1585 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* inflate.c -- zlib decompression
+ * Copyright (C) 1995-2016 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * Change history:
+ *
+ * 1.2.beta0    24 Nov 2002
+ * - First version -- complete rewrite of inflate to simplify code, avoid
+ *   creation of window when not needed, minimize use of window when it is
+ *   needed, make inffast.c even faster, implement gzip decoding, and to
+ *   improve code readability and style over the previous zlib inflate code
+ *
+ * 1.2.beta1    25 Nov 2002
+ * - Use pointers for available input and output checking in inffast.c
+ * - Remove input and output counters in inffast.c
+ * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
+ * - Remove unnecessary second byte pull from length extra in inffast.c
+ * - Unroll direct copy to three copies per loop in inffast.c
+ *
+ * 1.2.beta2    4 Dec 2002
+ * - Change external routine names to reduce potential conflicts
+ * - Correct filename to inffixed.h for fixed tables in inflate.c
+ * - Make hbuf[] unsigned char to match parameter type in inflate.c
+ * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
+ *   to avoid negation problem on Alphas (64 bit) in inflate.c
+ *
+ * 1.2.beta3    22 Dec 2002
+ * - Add comments on state->bits assertion in inffast.c
+ * - Add comments on op field in inftrees.h
+ * - Fix bug in reuse of allocated window after inflateReset()
+ * - Remove bit fields--back to byte structure for speed
+ * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
+ * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
+ * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
+ * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
+ * - Use local copies of stream next and avail values, as well as local bit
+ *   buffer and bit count in inflate()--for speed when inflate_fast() not used
+ *
+ * 1.2.beta4    1 Jan 2003
+ * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
+ * - Move a comment on output buffer sizes from inffast.c to inflate.c
+ * - Add comments in inffast.c to introduce the inflate_fast() routine
+ * - Rearrange window copies in inflate_fast() for speed and simplification
+ * - Unroll last copy for window match in inflate_fast()
+ * - Use local copies of window variables in inflate_fast() for speed
+ * - Pull out common wnext == 0 case for speed in inflate_fast()
+ * - Make op and len in inflate_fast() unsigned for consistency
+ * - Add FAR to lcode and dcode declarations in inflate_fast()
+ * - Simplified bad distance check in inflate_fast()
+ * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
+ *   source file infback.c to provide a call-back interface to inflate for
+ *   programs like gzip and unzip -- uses window as output buffer to avoid
+ *   window copying
+ *
+ * 1.2.beta5    1 Jan 2003
+ * - Improved inflateBack() interface to allow the caller to provide initial
+ *   input in strm.
+ * - Fixed stored blocks bug in inflateBack()
+ *
+ * 1.2.beta6    4 Jan 2003
+ * - Added comments in inffast.c on effectiveness of POSTINC
+ * - Typecasting all around to reduce compiler warnings
+ * - Changed loops from while (1) or do {} while (1) to for (;;), again to
+ *   make compilers happy
+ * - Changed type of window in inflateBackInit() to unsigned char *
+ *
+ * 1.2.beta7    27 Jan 2003
+ * - Changed many types to unsigned or unsigned short to avoid warnings
+ * - Added inflateCopy() function
+ *
+ * 1.2.0        9 Mar 2003
+ * - Changed inflateBack() interface to provide separate opaque descriptors
+ *   for the in() and out() functions
+ * - Changed inflateBack() argument and in_func typedef to swap the length
+ *   and buffer address return values for the input function
+ * - Check next_in and next_out for Z_NULL on entry to inflate()
+ *
+ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifdef MAKEFIXED
+#  ifndef BUILDFIXED
+#    define BUILDFIXED
+#  endif
+#endif
+
+/* function prototypes */
+local int inflateStateCheck OF((z_streamp strm));
+local void fixedtables OF((struct inflate_state FAR *state));
+local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
+                           unsigned copy));
+#ifdef BUILDFIXED
+   void makefixed OF((void));
+#endif
+local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
+                              unsigned len));
+
+local int inflateStateCheck(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+    if (strm == Z_NULL ||
+        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
+        return 1;
+    state = (struct inflate_state FAR *)strm->state;
+    if (state == Z_NULL || state->strm != strm ||
+        state->mode < HEAD || state->mode > SYNC)
+        return 1;
+    return 0;
+}
+
+int ZEXPORT inflateResetKeep(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    strm->total_in = strm->total_out = state->total = 0;
+    strm->msg = Z_NULL;
+    if (state->wrap)        /* to support ill-conceived Java test suite */
+        strm->adler = state->wrap & 1;
+    state->mode = HEAD;
+    state->last = 0;
+    state->havedict = 0;
+    state->dmax = 32768U;
+    state->head = Z_NULL;
+    state->hold = 0;
+    state->bits = 0;
+    state->lencode = state->distcode = state->next = state->codes;
+    state->sane = 1;
+    state->back = -1;
+    Tracev((stderr, "inflate: reset\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflateReset(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    state->wsize = 0;
+    state->whave = 0;
+    state->wnext = 0;
+    return inflateResetKeep(strm);
+}
+
+int ZEXPORT inflateReset2(strm, windowBits)
+z_streamp strm;
+int windowBits;
+{
+    int wrap;
+    struct inflate_state FAR *state;
+
+    /* get the state */
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* extract wrap request from windowBits parameter */
+    if (windowBits < 0) {
+        wrap = 0;
+        windowBits = -windowBits;
+    }
+    else {
+        wrap = (windowBits >> 4) + 5;
+#ifdef GUNZIP
+        if (windowBits < 48)
+            windowBits &= 15;
+#endif
+    }
+
+    /* set number of window bits, free window if different */
+    if (windowBits && (windowBits < 8 || windowBits > 15))
+        return Z_STREAM_ERROR;
+    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
+        ZFREE(strm, state->window);
+        state->window = Z_NULL;
+    }
+
+    /* update state and reset the rest of it */
+    state->wrap = wrap;
+    state->wbits = (unsigned)windowBits;
+    return inflateReset(strm);
+}
+
+int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
+z_streamp strm;
+int windowBits;
+const char *version;
+int stream_size;
+{
+    int ret;
+    struct inflate_state FAR *state;
+
+    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+        stream_size != (int)(sizeof(z_stream)))
+        return Z_VERSION_ERROR;
+    if (strm == Z_NULL) return Z_STREAM_ERROR;
+    strm->msg = Z_NULL;                 /* in case we return an error */
+    if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zalloc = zcalloc;
+        strm->opaque = (voidpf)0;
+#endif
+    }
+    if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+        return Z_STREAM_ERROR;
+#else
+        strm->zfree = zcfree;
+#endif
+    state = (struct inflate_state FAR *)
+            ZALLOC(strm, 1, sizeof(struct inflate_state));
+    if (state == Z_NULL) return Z_MEM_ERROR;
+    Tracev((stderr, "inflate: allocated\n"));
+    strm->state = (struct internal_state FAR *)state;
+    state->strm = strm;
+    state->window = Z_NULL;
+    state->mode = HEAD;     /* to pass state test in inflateReset2() */
+    ret = inflateReset2(strm, windowBits);
+    if (ret != Z_OK) {
+        ZFREE(strm, state);
+        strm->state = Z_NULL;
+    }
+    return ret;
+}
+
+int ZEXPORT inflateInit_(strm, version, stream_size)
+z_streamp strm;
+const char *version;
+int stream_size;
+{
+    return inflateInit2_(strm, DEF_WBITS, version, stream_size);
+}
+
+int ZEXPORT inflatePrime(strm, bits, value)
+z_streamp strm;
+int bits;
+int value;
+{
+    struct inflate_state FAR *state;
+
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (bits < 0) {
+        state->hold = 0;
+        state->bits = 0;
+        return Z_OK;
+    }
+    if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR;
+    value &= (1L << bits) - 1;
+    state->hold += (unsigned)value << state->bits;
+    state->bits += (uInt)bits;
+    return Z_OK;
+}
+
+/*
+   Return state with length and distance decoding tables and index sizes set to
+   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
+   If BUILDFIXED is defined, then instead this routine builds the tables the
+   first time it's called, and returns those tables the first time and
+   thereafter.  This reduces the size of the code by about 2K bytes, in
+   exchange for a little execution time.  However, BUILDFIXED should not be
+   used for threaded applications, since the rewriting of the tables and virgin
+   may not be thread-safe.
+ */
+local void fixedtables(state)
+struct inflate_state FAR *state;
+{
+#ifdef BUILDFIXED
+    static int virgin = 1;
+    static code *lenfix, *distfix;
+    static code fixed[544];
+
+    /* build fixed huffman tables if first call (may not be thread safe) */
+    if (virgin) {
+        unsigned sym, bits;
+        static code *next;
+
+        /* literal/length table */
+        sym = 0;
+        while (sym < 144) state->lens[sym++] = 8;
+        while (sym < 256) state->lens[sym++] = 9;
+        while (sym < 280) state->lens[sym++] = 7;
+        while (sym < 288) state->lens[sym++] = 8;
+        next = fixed;
+        lenfix = next;
+        bits = 9;
+        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+
+        /* distance table */
+        sym = 0;
+        while (sym < 32) state->lens[sym++] = 5;
+        distfix = next;
+        bits = 5;
+        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+
+        /* do this just once */
+        virgin = 0;
+    }
+#else /* !BUILDFIXED */
+#   include "inffixed.h"
+#endif /* BUILDFIXED */
+    state->lencode = lenfix;
+    state->lenbits = 9;
+    state->distcode = distfix;
+    state->distbits = 5;
+}
+
+#ifdef MAKEFIXED
+#include <stdio.h>
+
+/*
+   Write out the inffixed.h that is #include'd above.  Defining MAKEFIXED also
+   defines BUILDFIXED, so the tables are built on the fly.  makefixed() writes
+   those tables to stdout, which would be piped to inffixed.h.  A small program
+   can simply call makefixed to do this:
+
+    void makefixed(void);
+
+    int main(void)
+    {
+        makefixed();
+        return 0;
+    }
+
+   Then that can be linked with zlib built with MAKEFIXED defined and run:
+
+    a.out > inffixed.h
+ */
+void makefixed()
+{
+    unsigned low, size;
+    struct inflate_state state;
+
+    fixedtables(&state);
+    puts("    /* inffixed.h -- table for decoding fixed codes");
+    puts("     * Generated automatically by makefixed().");
+    puts("     */");
+    puts("");
+    puts("    /* WARNING: this file should *not* be used by applications.");
+    puts("       It is part of the implementation of this library and is");
+    puts("       subject to change. Applications should only use zlib.h.");
+    puts("     */");
+    puts("");
+    size = 1U << 9;
+    printf("    static const code lenfix[%u] = {", size);
+    low = 0;
+    for (;;) {
+        if ((low % 7) == 0) printf("\n        ");
+        printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
+               state.lencode[low].bits, state.lencode[low].val);
+        if (++low == size) break;
+        putchar(',');
+    }
+    puts("\n    };");
+    size = 1U << 5;
+    printf("\n    static const code distfix[%u] = {", size);
+    low = 0;
+    for (;;) {
+        if ((low % 6) == 0) printf("\n        ");
+        printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
+               state.distcode[low].val);
+        if (++low == size) break;
+        putchar(',');
+    }
+    puts("\n    };");
+}
+#endif /* MAKEFIXED */
+
+/*
+   Update the window with the last wsize (normally 32K) bytes written before
+   returning.  If window does not exist yet, create it.  This is only called
+   when a window is already in use, or when output has been written during this
+   inflate call, but the end of the deflate stream has not been reached yet.
+   It is also called to create a window for dictionary data when a dictionary
+   is loaded.
+
+   Providing output buffers larger than 32K to inflate() should provide a speed
+   advantage, since only the last 32K of output is copied to the sliding window
+   upon return from inflate(), and since all distances after the first 32K of
+   output will fall in the output data, making match copies simpler and faster.
+   The advantage may be dependent on the size of the processor's data caches.
+ */
+local int updatewindow(strm, end, copy)
+z_streamp strm;
+const Bytef *end;
+unsigned copy;
+{
+    struct inflate_state FAR *state;
+    unsigned dist;
+
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* if it hasn't been done already, allocate space for the window */
+    if (state->window == Z_NULL) {
+        state->window = (unsigned char FAR *)
+                        ZALLOC(strm, 1U << state->wbits,
+                               sizeof(unsigned char));
+        if (state->window == Z_NULL) return 1;
+    }
+
+    /* if window not in use yet, initialize */
+    if (state->wsize == 0) {
+        state->wsize = 1U << state->wbits;
+        state->wnext = 0;
+        state->whave = 0;
+    }
+
+    /* copy state->wsize or less output bytes into the circular window */
+    if (copy >= state->wsize) {
+        zmemcpy(state->window, end - state->wsize, state->wsize);
+        state->wnext = 0;
+        state->whave = state->wsize;
+    }
+    else {
+        dist = state->wsize - state->wnext;
+        if (dist > copy) dist = copy;
+        zmemcpy(state->window + state->wnext, end - copy, dist);
+        copy -= dist;
+        if (copy) {
+            zmemcpy(state->window, end - copy, copy);
+            state->wnext = copy;
+            state->whave = state->wsize;
+        }
+        else {
+            state->wnext += dist;
+            if (state->wnext == state->wsize) state->wnext = 0;
+            if (state->whave < state->wsize) state->whave += dist;
+        }
+    }
+    return 0;
+}
+
+/* Macros for inflate(): */
+
+/* check function to use adler32() for zlib or crc32() for gzip */
+#ifdef GUNZIP
+#  define UPDATE(check, buf, len) \
+    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
+#else
+#  define UPDATE(check, buf, len) adler32(check, buf, len)
+#endif
+
+/* check macros for header crc */
+#ifdef GUNZIP
+#  define CRC2(check, word) \
+    do { \
+        hbuf[0] = (unsigned char)(word); \
+        hbuf[1] = (unsigned char)((word) >> 8); \
+        check = crc32(check, hbuf, 2); \
+    } while (0)
+
+#  define CRC4(check, word) \
+    do { \
+        hbuf[0] = (unsigned char)(word); \
+        hbuf[1] = (unsigned char)((word) >> 8); \
+        hbuf[2] = (unsigned char)((word) >> 16); \
+        hbuf[3] = (unsigned char)((word) >> 24); \
+        check = crc32(check, hbuf, 4); \
+    } while (0)
+#endif
+
+/* Load registers with state in inflate() for speed */
+#define LOAD() \
+    do { \
+        put = strm->next_out; \
+        left = strm->avail_out; \
+        next = strm->next_in; \
+        have = strm->avail_in; \
+        hold = state->hold; \
+        bits = state->bits; \
+    } while (0)
+
+/* Restore state from registers in inflate() */
+#define RESTORE() \
+    do { \
+        strm->next_out = put; \
+        strm->avail_out = left; \
+        strm->next_in = next; \
+        strm->avail_in = have; \
+        state->hold = hold; \
+        state->bits = bits; \
+    } while (0)
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+    do { \
+        hold = 0; \
+        bits = 0; \
+    } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflate()
+   if there is no input available. */
+#define PULLBYTE() \
+    do { \
+        if (have == 0) goto inf_leave; \
+        have--; \
+        hold += (unsigned long)(*next++) << bits; \
+        bits += 8; \
+    } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator.  If there is
+   not enough available input to do that, then return from inflate(). */
+#define NEEDBITS(n) \
+    do { \
+        while (bits < (unsigned)(n)) \
+            PULLBYTE(); \
+    } while (0)
+
+/* Return the low n bits of the bit accumulator (n < 16) */
+#define BITS(n) \
+    ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+    do { \
+        hold >>= (n); \
+        bits -= (unsigned)(n); \
+    } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+    do { \
+        hold >>= bits & 7; \
+        bits -= bits & 7; \
+    } while (0)
+
+/*
+   inflate() uses a state machine to process as much input data and generate as
+   much output data as possible before returning.  The state machine is
+   structured roughly as follows:
+
+    for (;;) switch (state) {
+    ...
+    case STATEn:
+        if (not enough input data or output space to make progress)
+            return;
+        ... make progress ...
+        state = STATEm;
+        break;
+    ...
+    }
+
+   so when inflate() is called again, the same case is attempted again, and
+   if the appropriate resources are provided, the machine proceeds to the
+   next state.  The NEEDBITS() macro is usually the way the state evaluates
+   whether it can proceed or should return.  NEEDBITS() does the return if
+   the requested bits are not available.  The typical use of the BITS macros
+   is:
+
+        NEEDBITS(n);
+        ... do something with BITS(n) ...
+        DROPBITS(n);
+
+   where NEEDBITS(n) either returns from inflate() if there isn't enough
+   input left to load n bits into the accumulator, or it continues.  BITS(n)
+   gives the low n bits in the accumulator.  When done, DROPBITS(n) drops
+   the low n bits off the accumulator.  INITBITS() clears the accumulator
+   and sets the number of available bits to zero.  BYTEBITS() discards just
+   enough bits to put the accumulator on a byte boundary.  After BYTEBITS()
+   and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
+
+   NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
+   if there is no input available.  The decoding of variable length codes uses
+   PULLBYTE() directly in order to pull just enough bytes to decode the next
+   code, and no more.
+
+   Some states loop until they get enough input, making sure that enough
+   state information is maintained to continue the loop where it left off
+   if NEEDBITS() returns in the loop.  For example, want, need, and keep
+   would all have to actually be part of the saved state in case NEEDBITS()
+   returns:
+
+    case STATEw:
+        while (want < need) {
+            NEEDBITS(n);
+            keep[want++] = BITS(n);
+            DROPBITS(n);
+        }
+        state = STATEx;
+    case STATEx:
+
+   As shown above, if the next state is also the next case, then the break
+   is omitted.
+
+   A state may also return if there is not enough output space available to
+   complete that state.  Those states are copying stored data, writing a
+   literal byte, and copying a matching string.
+
+   When returning, a "goto inf_leave" is used to update the total counters,
+   update the check value, and determine whether any progress has been made
+   during that inflate() call in order to return the proper return code.
+   Progress is defined as a change in either strm->avail_in or strm->avail_out.
+   When there is a window, goto inf_leave will update the window with the last
+   output written.  If a goto inf_leave occurs in the middle of decompression
+   and there is no window currently, goto inf_leave will create one and copy
+   output to the window for the next call of inflate().
+
+   In this implementation, the flush parameter of inflate() only affects the
+   return code (per zlib.h).  inflate() always writes as much as possible to
+   strm->next_out, given the space available and the provided input--the effect
+   documented in zlib.h of Z_SYNC_FLUSH.  Furthermore, inflate() always defers
+   the allocation of and copying into a sliding window until necessary, which
+   provides the effect documented in zlib.h for Z_FINISH when the entire input
+   stream available.  So the only thing the flush parameter actually does is:
+   when flush is set to Z_FINISH, inflate() cannot return Z_OK.  Instead it
+   will return Z_BUF_ERROR if it has not reached the end of the stream.
+ */
+
+int ZEXPORT inflate(strm, flush)
+z_streamp strm;
+int flush;
+{
+    struct inflate_state FAR *state;
+    z_const unsigned char FAR *next;    /* next input */
+    unsigned char FAR *put;     /* next output */
+    unsigned have, left;        /* available input and output */
+    unsigned long hold;         /* bit buffer */
+    unsigned bits;              /* bits in bit buffer */
+    unsigned in, out;           /* save starting available input and output */
+    unsigned copy;              /* number of stored or match bytes to copy */
+    unsigned char FAR *from;    /* where to copy match bytes from */
+    code here;                  /* current decoding table entry */
+    code last;                  /* parent table entry */
+    unsigned len;               /* length to copy for repeats, bits to drop */
+    int ret;                    /* return code */
+#ifdef GUNZIP
+    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
+#endif
+    static const unsigned short order[19] = /* permutation of code lengths */
+        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+    if (inflateStateCheck(strm) || strm->next_out == Z_NULL ||
+        (strm->next_in == Z_NULL && strm->avail_in != 0))
+        return Z_STREAM_ERROR;
+
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
+    LOAD();
+    in = have;
+    out = left;
+    ret = Z_OK;
+    for (;;)
+        switch (state->mode) {
+        case HEAD:
+            if (state->wrap == 0) {
+                state->mode = TYPEDO;
+                break;
+            }
+            NEEDBITS(16);
+#ifdef GUNZIP
+            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
+                if (state->wbits == 0)
+                    state->wbits = 15;
+                state->check = crc32(0L, Z_NULL, 0);
+                CRC2(state->check, hold);
+                INITBITS();
+                state->mode = FLAGS;
+                break;
+            }
+            state->flags = 0;           /* expect zlib header */
+            if (state->head != Z_NULL)
+                state->head->done = -1;
+            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
+#else
+            if (
+#endif
+                ((BITS(8) << 8) + (hold >> 8)) % 31) {
+                strm->msg = (char *)"incorrect header check";
+                state->mode = BAD;
+                break;
+            }
+            if (BITS(4) != Z_DEFLATED) {
+                strm->msg = (char *)"unknown compression method";
+                state->mode = BAD;
+                break;
+            }
+            DROPBITS(4);
+            len = BITS(4) + 8;
+            if (state->wbits == 0)
+                state->wbits = len;
+            if (len > 15 || len > state->wbits) {
+                strm->msg = (char *)"invalid window size";
+                state->mode = BAD;
+                break;
+            }
+            state->dmax = 1U << len;
+            Tracev((stderr, "inflate:   zlib header ok\n"));
+            strm->adler = state->check = adler32(0L, Z_NULL, 0);
+            state->mode = hold & 0x200 ? DICTID : TYPE;
+            INITBITS();
+            break;
+#ifdef GUNZIP
+        case FLAGS:
+            NEEDBITS(16);
+            state->flags = (int)(hold);
+            if ((state->flags & 0xff) != Z_DEFLATED) {
+                strm->msg = (char *)"unknown compression method";
+                state->mode = BAD;
+                break;
+            }
+            if (state->flags & 0xe000) {
+                strm->msg = (char *)"unknown header flags set";
+                state->mode = BAD;
+                break;
+            }
+            if (state->head != Z_NULL)
+                state->head->text = (int)((hold >> 8) & 1);
+            if ((state->flags & 0x0200) && (state->wrap & 4))
+                CRC2(state->check, hold);
+            INITBITS();
+            state->mode = TIME;
+        case TIME:
+            NEEDBITS(32);
+            if (state->head != Z_NULL)
+                state->head->time = hold;
+            if ((state->flags & 0x0200) && (state->wrap & 4))
+                CRC4(state->check, hold);
+            INITBITS();
+            state->mode = OS;
+        case OS:
+            NEEDBITS(16);
+            if (state->head != Z_NULL) {
+                state->head->xflags = (int)(hold & 0xff);
+                state->head->os = (int)(hold >> 8);
+            }
+            if ((state->flags & 0x0200) && (state->wrap & 4))
+                CRC2(state->check, hold);
+            INITBITS();
+            state->mode = EXLEN;
+        case EXLEN:
+            if (state->flags & 0x0400) {
+                NEEDBITS(16);
+                state->length = (unsigned)(hold);
+                if (state->head != Z_NULL)
+                    state->head->extra_len = (unsigned)hold;
+                if ((state->flags & 0x0200) && (state->wrap & 4))
+                    CRC2(state->check, hold);
+                INITBITS();
+            }
+            else if (state->head != Z_NULL)
+                state->head->extra = Z_NULL;
+            state->mode = EXTRA;
+        case EXTRA:
+            if (state->flags & 0x0400) {
+                copy = state->length;
+                if (copy > have) copy = have;
+                if (copy) {
+                    if (state->head != Z_NULL &&
+                        state->head->extra != Z_NULL) {
+                        len = state->head->extra_len - state->length;
+                        zmemcpy(state->head->extra + len, next,
+                                len + copy > state->head->extra_max ?
+                                state->head->extra_max - len : copy);
+                    }
+                    if ((state->flags & 0x0200) && (state->wrap & 4))
+                        state->check = crc32(state->check, next, copy);
+                    have -= copy;
+                    next += copy;
+                    state->length -= copy;
+                }
+                if (state->length) goto inf_leave;
+            }
+            state->length = 0;
+            state->mode = NAME;
+        case NAME:
+            if (state->flags & 0x0800) {
+                if (have == 0) goto inf_leave;
+                copy = 0;
+                do {
+                    len = (unsigned)(next[copy++]);
+                    if (state->head != Z_NULL &&
+                            state->head->name != Z_NULL &&
+                            state->length < state->head->name_max)
+                        state->head->name[state->length++] = (Bytef)len;
+                } while (len && copy < have);
+                if ((state->flags & 0x0200) && (state->wrap & 4))
+                    state->check = crc32(state->check, next, copy);
+                have -= copy;
+                next += copy;
+                if (len) goto inf_leave;
+            }
+            else if (state->head != Z_NULL)
+                state->head->name = Z_NULL;
+            state->length = 0;
+            state->mode = COMMENT;
+        case COMMENT:
+            if (state->flags & 0x1000) {
+                if (have == 0) goto inf_leave;
+                copy = 0;
+                do {
+                    len = (unsigned)(next[copy++]);
+                    if (state->head != Z_NULL &&
+                            state->head->comment != Z_NULL &&
+                            state->length < state->head->comm_max)
+                        state->head->comment[state->length++] = (Bytef)len;
+                } while (len && copy < have);
+                if ((state->flags & 0x0200) && (state->wrap & 4))
+                    state->check = crc32(state->check, next, copy);
+                have -= copy;
+                next += copy;
+                if (len) goto inf_leave;
+            }
+            else if (state->head != Z_NULL)
+                state->head->comment = Z_NULL;
+            state->mode = HCRC;
+        case HCRC:
+            if (state->flags & 0x0200) {
+                NEEDBITS(16);
+                if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
+                    strm->msg = (char *)"header crc mismatch";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+            }
+            if (state->head != Z_NULL) {
+                state->head->hcrc = (int)((state->flags >> 9) & 1);
+                state->head->done = 1;
+            }
+            strm->adler = state->check = crc32(0L, Z_NULL, 0);
+            state->mode = TYPE;
+            break;
+#endif
+        case DICTID:
+            NEEDBITS(32);
+            strm->adler = state->check = ZSWAP32(hold);
+            INITBITS();
+            state->mode = DICT;
+        case DICT:
+            if (state->havedict == 0) {
+                RESTORE();
+                return Z_NEED_DICT;
+            }
+            strm->adler = state->check = adler32(0L, Z_NULL, 0);
+            state->mode = TYPE;
+        case TYPE:
+            if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
+        case TYPEDO:
+            if (state->last) {
+                BYTEBITS();
+                state->mode = CHECK;
+                break;
+            }
+            NEEDBITS(3);
+            state->last = BITS(1);
+            DROPBITS(1);
+            switch (BITS(2)) {
+            case 0:                             /* stored block */
+                Tracev((stderr, "inflate:     stored block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = STORED;
+                break;
+            case 1:                             /* fixed block */
+                fixedtables(state);
+                Tracev((stderr, "inflate:     fixed codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = LEN_;             /* decode codes */
+                if (flush == Z_TREES) {
+                    DROPBITS(2);
+                    goto inf_leave;
+                }
+                break;
+            case 2:                             /* dynamic block */
+                Tracev((stderr, "inflate:     dynamic codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = TABLE;
+                break;
+            case 3:
+                strm->msg = (char *)"invalid block type";
+                state->mode = BAD;
+            }
+            DROPBITS(2);
+            break;
+        case STORED:
+            BYTEBITS();                         /* go to byte boundary */
+            NEEDBITS(32);
+            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+                strm->msg = (char *)"invalid stored block lengths";
+                state->mode = BAD;
+                break;
+            }
+            state->length = (unsigned)hold & 0xffff;
+            Tracev((stderr, "inflate:       stored length %u\n",
+                    state->length));
+            INITBITS();
+            state->mode = COPY_;
+            if (flush == Z_TREES) goto inf_leave;
+        case COPY_:
+            state->mode = COPY;
+        case COPY:
+            copy = state->length;
+            if (copy) {
+                if (copy > have) copy = have;
+                if (copy > left) copy = left;
+                if (copy == 0) goto inf_leave;
+                zmemcpy(put, next, copy);
+                have -= copy;
+                next += copy;
+                left -= copy;
+                put += copy;
+                state->length -= copy;
+                break;
+            }
+            Tracev((stderr, "inflate:       stored end\n"));
+            state->mode = TYPE;
+            break;
+        case TABLE:
+            NEEDBITS(14);
+            state->nlen = BITS(5) + 257;
+            DROPBITS(5);
+            state->ndist = BITS(5) + 1;
+            DROPBITS(5);
+            state->ncode = BITS(4) + 4;
+            DROPBITS(4);
+#ifndef PKZIP_BUG_WORKAROUND
+            if (state->nlen > 286 || state->ndist > 30) {
+                strm->msg = (char *)"too many length or distance symbols";
+                state->mode = BAD;
+                break;
+            }
+#endif
+            Tracev((stderr, "inflate:       table sizes ok\n"));
+            state->have = 0;
+            state->mode = LENLENS;
+        case LENLENS:
+            while (state->have < state->ncode) {
+                NEEDBITS(3);
+                state->lens[order[state->have++]] = (unsigned short)BITS(3);
+                DROPBITS(3);
+            }
+            while (state->have < 19)
+                state->lens[order[state->have++]] = 0;
+            state->next = state->codes;
+            state->lencode = (const code FAR *)(state->next);
+            state->lenbits = 7;
+            ret = inflate_table(CODES, state->lens, 19, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid code lengths set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       code lengths ok\n"));
+            state->have = 0;
+            state->mode = CODELENS;
+        case CODELENS:
+            while (state->have < state->nlen + state->ndist) {
+                for (;;) {
+                    here = state->lencode[BITS(state->lenbits)];
+                    if ((unsigned)(here.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                if (here.val < 16) {
+                    DROPBITS(here.bits);
+                    state->lens[state->have++] = here.val;
+                }
+                else {
+                    if (here.val == 16) {
+                        NEEDBITS(here.bits + 2);
+                        DROPBITS(here.bits);
+                        if (state->have == 0) {
+                            strm->msg = (char *)"invalid bit length repeat";
+                            state->mode = BAD;
+                            break;
+                        }
+                        len = state->lens[state->have - 1];
+                        copy = 3 + BITS(2);
+                        DROPBITS(2);
+                    }
+                    else if (here.val == 17) {
+                        NEEDBITS(here.bits + 3);
+                        DROPBITS(here.bits);
+                        len = 0;
+                        copy = 3 + BITS(3);
+                        DROPBITS(3);
+                    }
+                    else {
+                        NEEDBITS(here.bits + 7);
+                        DROPBITS(here.bits);
+                        len = 0;
+                        copy = 11 + BITS(7);
+                        DROPBITS(7);
+                    }
+                    if (state->have + copy > state->nlen + state->ndist) {
+                        strm->msg = (char *)"invalid bit length repeat";
+                        state->mode = BAD;
+                        break;
+                    }
+                    while (copy--)
+                        state->lens[state->have++] = (unsigned short)len;
+                }
+            }
+
+            /* handle error breaks in while */
+            if (state->mode == BAD) break;
+
+            /* check for end-of-block code (better have one) */
+            if (state->lens[256] == 0) {
+                strm->msg = (char *)"invalid code -- missing end-of-block";
+                state->mode = BAD;
+                break;
+            }
+
+            /* build code tables -- note: do not change the lenbits or distbits
+               values here (9 and 6) without reading the comments in inftrees.h
+               concerning the ENOUGH constants, which depend on those values */
+            state->next = state->codes;
+            state->lencode = (const code FAR *)(state->next);
+            state->lenbits = 9;
+            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid literal/lengths set";
+                state->mode = BAD;
+                break;
+            }
+            state->distcode = (const code FAR *)(state->next);
+            state->distbits = 6;
+            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+                            &(state->next), &(state->distbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid distances set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       codes ok\n"));
+            state->mode = LEN_;
+            if (flush == Z_TREES) goto inf_leave;
+        case LEN_:
+            state->mode = LEN;
+        case LEN:
+            if (have >= 6 && left >= 258) {
+                RESTORE();
+                inflate_fast(strm, out);
+                LOAD();
+                if (state->mode == TYPE)
+                    state->back = -1;
+                break;
+            }
+            state->back = 0;
+            for (;;) {
+                here = state->lencode[BITS(state->lenbits)];
+                if ((unsigned)(here.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if (here.op && (here.op & 0xf0) == 0) {
+                last = here;
+                for (;;) {
+                    here = state->lencode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+                state->back += last.bits;
+            }
+            DROPBITS(here.bits);
+            state->back += here.bits;
+            state->length = (unsigned)here.val;
+            if ((int)(here.op) == 0) {
+                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+                        "inflate:         literal '%c'\n" :
+                        "inflate:         literal 0x%02x\n", here.val));
+                state->mode = LIT;
+                break;
+            }
+            if (here.op & 32) {
+                Tracevv((stderr, "inflate:         end of block\n"));
+                state->back = -1;
+                state->mode = TYPE;
+                break;
+            }
+            if (here.op & 64) {
+                strm->msg = (char *)"invalid literal/length code";
+                state->mode = BAD;
+                break;
+            }
+            state->extra = (unsigned)(here.op) & 15;
+            state->mode = LENEXT;
+        case LENEXT:
+            if (state->extra) {
+                NEEDBITS(state->extra);
+                state->length += BITS(state->extra);
+                DROPBITS(state->extra);
+                state->back += state->extra;
+            }
+            Tracevv((stderr, "inflate:         length %u\n", state->length));
+            state->was = state->length;
+            state->mode = DIST;
+        case DIST:
+            for (;;) {
+                here = state->distcode[BITS(state->distbits)];
+                if ((unsigned)(here.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if ((here.op & 0xf0) == 0) {
+                last = here;
+                for (;;) {
+                    here = state->distcode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+                state->back += last.bits;
+            }
+            DROPBITS(here.bits);
+            state->back += here.bits;
+            if (here.op & 64) {
+                strm->msg = (char *)"invalid distance code";
+                state->mode = BAD;
+                break;
+            }
+            state->offset = (unsigned)here.val;
+            state->extra = (unsigned)(here.op) & 15;
+            state->mode = DISTEXT;
+        case DISTEXT:
+            if (state->extra) {
+                NEEDBITS(state->extra);
+                state->offset += BITS(state->extra);
+                DROPBITS(state->extra);
+                state->back += state->extra;
+            }
+#ifdef INFLATE_STRICT
+            if (state->offset > state->dmax) {
+                strm->msg = (char *)"invalid distance too far back";
+                state->mode = BAD;
+                break;
+            }
+#endif
+            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
+            state->mode = MATCH;
+        case MATCH:
+            if (left == 0) goto inf_leave;
+            copy = out - left;
+            if (state->offset > copy) {         /* copy from window */
+                copy = state->offset - copy;
+                if (copy > state->whave) {
+                    if (state->sane) {
+                        strm->msg = (char *)"invalid distance too far back";
+                        state->mode = BAD;
+                        break;
+                    }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+                    Trace((stderr, "inflate.c too far\n"));
+                    copy -= state->whave;
+                    if (copy > state->length) copy = state->length;
+                    if (copy > left) copy = left;
+                    left -= copy;
+                    state->length -= copy;
+                    do {
+                        *put++ = 0;
+                    } while (--copy);
+                    if (state->length == 0) state->mode = LEN;
+                    break;
+#endif
+                }
+                if (copy > state->wnext) {
+                    copy -= state->wnext;
+                    from = state->window + (state->wsize - copy);
+                }
+                else
+                    from = state->window + (state->wnext - copy);
+                if (copy > state->length) copy = state->length;
+            }
+            else {                              /* copy from output */
+                from = put - state->offset;
+                copy = state->length;
+            }
+            if (copy > left) copy = left;
+            left -= copy;
+            state->length -= copy;
+            do {
+                *put++ = *from++;
+            } while (--copy);
+            if (state->length == 0) state->mode = LEN;
+            break;
+        case LIT:
+            if (left == 0) goto inf_leave;
+            *put++ = (unsigned char)(state->length);
+            left--;
+            state->mode = LEN;
+            break;
+        case CHECK:
+            if (state->wrap) {
+                NEEDBITS(32);
+                out -= left;
+                strm->total_out += out;
+                state->total += out;
+                if ((state->wrap & 4) && out)
+                    strm->adler = state->check =
+                        UPDATE(state->check, put - out, out);
+                out = left;
+                if ((state->wrap & 4) && (
+#ifdef GUNZIP
+                     state->flags ? hold :
+#endif
+                     ZSWAP32(hold)) != state->check) {
+                    strm->msg = (char *)"incorrect data check";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+                Tracev((stderr, "inflate:   check matches trailer\n"));
+            }
+#ifdef GUNZIP
+            state->mode = LENGTH;
+        case LENGTH:
+            if (state->wrap && state->flags) {
+                NEEDBITS(32);
+                if (hold != (state->total & 0xffffffffUL)) {
+                    strm->msg = (char *)"incorrect length check";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+                Tracev((stderr, "inflate:   length matches trailer\n"));
+            }
+#endif
+            state->mode = DONE;
+        case DONE:
+            ret = Z_STREAM_END;
+            goto inf_leave;
+        case BAD:
+            ret = Z_DATA_ERROR;
+            goto inf_leave;
+        case MEM:
+            return Z_MEM_ERROR;
+        case SYNC:
+        default:
+            return Z_STREAM_ERROR;
+        }
+
+    /*
+       Return from inflate(), updating the total counts and the check value.
+       If there was no progress during the inflate() call, return a buffer
+       error.  Call updatewindow() to create and/or update the window state.
+       Note: a memory error from inflate() is non-recoverable.
+     */
+  inf_leave:
+    RESTORE();
+    if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
+            (state->mode < CHECK || flush != Z_FINISH)))
+        if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
+            state->mode = MEM;
+            return Z_MEM_ERROR;
+        }
+    in -= strm->avail_in;
+    out -= strm->avail_out;
+    strm->total_in += in;
+    strm->total_out += out;
+    state->total += out;
+    if ((state->wrap & 4) && out)
+        strm->adler = state->check =
+            UPDATE(state->check, strm->next_out - out, out);
+    strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
+                      (state->mode == TYPE ? 128 : 0) +
+                      (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
+    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
+        ret = Z_BUF_ERROR;
+    return ret;
+}
+
+int ZEXPORT inflateEnd(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+    if (inflateStateCheck(strm))
+        return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->window != Z_NULL) ZFREE(strm, state->window);
+    ZFREE(strm, strm->state);
+    strm->state = Z_NULL;
+    Tracev((stderr, "inflate: end\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
+z_streamp strm;
+Bytef *dictionary;
+uInt *dictLength;
+{
+    struct inflate_state FAR *state;
+
+    /* check state */
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* copy dictionary */
+    if (state->whave && dictionary != Z_NULL) {
+        zmemcpy(dictionary, state->window + state->wnext,
+                state->whave - state->wnext);
+        zmemcpy(dictionary + state->whave - state->wnext,
+                state->window, state->wnext);
+    }
+    if (dictLength != Z_NULL)
+        *dictLength = state->whave;
+    return Z_OK;
+}
+
+int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
+z_streamp strm;
+const Bytef *dictionary;
+uInt dictLength;
+{
+    struct inflate_state FAR *state;
+    unsigned long dictid;
+    int ret;
+
+    /* check state */
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->wrap != 0 && state->mode != DICT)
+        return Z_STREAM_ERROR;
+
+    /* check for correct dictionary identifier */
+    if (state->mode == DICT) {
+        dictid = adler32(0L, Z_NULL, 0);
+        dictid = adler32(dictid, dictionary, dictLength);
+        if (dictid != state->check)
+            return Z_DATA_ERROR;
+    }
+
+    /* copy dictionary to window using updatewindow(), which will amend the
+       existing dictionary if appropriate */
+    ret = updatewindow(strm, dictionary + dictLength, dictLength);
+    if (ret) {
+        state->mode = MEM;
+        return Z_MEM_ERROR;
+    }
+    state->havedict = 1;
+    Tracev((stderr, "inflate:   dictionary set\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflateGetHeader(strm, head)
+z_streamp strm;
+gz_headerp head;
+{
+    struct inflate_state FAR *state;
+
+    /* check state */
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
+
+    /* save header structure */
+    state->head = head;
+    head->done = 0;
+    return Z_OK;
+}
+
+/*
+   Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff.  Return when found
+   or when out of input.  When called, *have is the number of pattern bytes
+   found in order so far, in 0..3.  On return *have is updated to the new
+   state.  If on return *have equals four, then the pattern was found and the
+   return value is how many bytes were read including the last byte of the
+   pattern.  If *have is less than four, then the pattern has not been found
+   yet and the return value is len.  In the latter case, syncsearch() can be
+   called again with more data and the *have state.  *have is initialized to
+   zero for the first call.
+ */
+local unsigned syncsearch(have, buf, len)
+unsigned FAR *have;
+const unsigned char FAR *buf;
+unsigned len;
+{
+    unsigned got;
+    unsigned next;
+
+    got = *have;
+    next = 0;
+    while (next < len && got < 4) {
+        if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
+            got++;
+        else if (buf[next])
+            got = 0;
+        else
+            got = 4 - got;
+        next++;
+    }
+    *have = got;
+    return next;
+}
+
+int ZEXPORT inflateSync(strm)
+z_streamp strm;
+{
+    unsigned len;               /* number of bytes to look at or looked at */
+    unsigned long in, out;      /* temporary to save total_in and total_out */
+    unsigned char buf[4];       /* to restore bit buffer to byte string */
+    struct inflate_state FAR *state;
+
+    /* check parameters */
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
+
+    /* if first time, start search in bit buffer */
+    if (state->mode != SYNC) {
+        state->mode = SYNC;
+        state->hold <<= state->bits & 7;
+        state->bits -= state->bits & 7;
+        len = 0;
+        while (state->bits >= 8) {
+            buf[len++] = (unsigned char)(state->hold);
+            state->hold >>= 8;
+            state->bits -= 8;
+        }
+        state->have = 0;
+        syncsearch(&(state->have), buf, len);
+    }
+
+    /* search available input */
+    len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
+    strm->avail_in -= len;
+    strm->next_in += len;
+    strm->total_in += len;
+
+    /* return no joy or set up to restart inflate() on a new block */
+    if (state->have != 4) return Z_DATA_ERROR;
+    in = strm->total_in;  out = strm->total_out;
+    inflateReset(strm);
+    strm->total_in = in;  strm->total_out = out;
+    state->mode = TYPE;
+    return Z_OK;
+}
+
+/*
+   Returns true if inflate is currently at the end of a block generated by
+   Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+   implementation to provide an additional safety check. PPP uses
+   Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
+   block. When decompressing, PPP checks that at the end of input packet,
+   inflate is waiting for these length bytes.
+ */
+int ZEXPORT inflateSyncPoint(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    return state->mode == STORED && state->bits == 0;
+}
+
+int ZEXPORT inflateCopy(dest, source)
+z_streamp dest;
+z_streamp source;
+{
+    struct inflate_state FAR *state;
+    struct inflate_state FAR *copy;
+    unsigned char FAR *window;
+    unsigned wsize;
+
+    /* check input */
+    if (inflateStateCheck(source) || dest == Z_NULL)
+        return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)source->state;
+
+    /* allocate space */
+    copy = (struct inflate_state FAR *)
+           ZALLOC(source, 1, sizeof(struct inflate_state));
+    if (copy == Z_NULL) return Z_MEM_ERROR;
+    window = Z_NULL;
+    if (state->window != Z_NULL) {
+        window = (unsigned char FAR *)
+                 ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
+        if (window == Z_NULL) {
+            ZFREE(source, copy);
+            return Z_MEM_ERROR;
+        }
+    }
+
+    /* copy state */
+    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+    zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
+    copy->strm = dest;
+    if (state->lencode >= state->codes &&
+        state->lencode <= state->codes + ENOUGH - 1) {
+        copy->lencode = copy->codes + (state->lencode - state->codes);
+        copy->distcode = copy->codes + (state->distcode - state->codes);
+    }
+    copy->next = copy->codes + (state->next - state->codes);
+    if (window != Z_NULL) {
+        wsize = 1U << state->wbits;
+        zmemcpy(window, state->window, wsize);
+    }
+    copy->window = window;
+    dest->state = (struct internal_state FAR *)copy;
+    return Z_OK;
+}
+
+int ZEXPORT inflateUndermine(strm, subvert)
+z_streamp strm;
+int subvert;
+{
+    struct inflate_state FAR *state;
+
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+    state->sane = !subvert;
+    return Z_OK;
+#else
+    (void)subvert;
+    state->sane = 1;
+    return Z_DATA_ERROR;
+#endif
+}
+
+int ZEXPORT inflateValidate(strm, check)
+z_streamp strm;
+int check;
+{
+    struct inflate_state FAR *state;
+
+    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (check)
+        state->wrap |= 4;
+    else
+        state->wrap &= ~4;
+    return Z_OK;
+}
+
+long ZEXPORT inflateMark(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (inflateStateCheck(strm))
+        return -(1L << 16);
+    state = (struct inflate_state FAR *)strm->state;
+    return (long)(((unsigned long)((long)state->back)) << 16) +
+        (state->mode == COPY ? state->length :
+            (state->mode == MATCH ? state->was - state->length : 0));
+}
+
+unsigned long ZEXPORT inflateCodesUsed(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+    if (inflateStateCheck(strm)) return (unsigned long)-1;
+    state = (struct inflate_state FAR *)strm->state;
+    return (unsigned long)(state->next - state->codes);
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib/inflate.h b/jdk/src/java.base/share/native/libzip/zlib/inflate.h
new file mode 100644
index 0000000..060f7fc
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/inflate.h
@@ -0,0 +1,149 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* inflate.h -- internal inflate state definition
+ * Copyright (C) 1995-2016 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* define NO_GZIP when compiling if you want to disable gzip header and
+   trailer decoding by inflate().  NO_GZIP would be used to avoid linking in
+   the crc code when it is not needed.  For shared libraries, gzip decoding
+   should be left enabled. */
+#ifndef NO_GZIP
+#  define GUNZIP
+#endif
+
+/* Possible inflate modes between inflate() calls */
+typedef enum {
+    HEAD = 16180,   /* i: waiting for magic header */
+    FLAGS,      /* i: waiting for method and flags (gzip) */
+    TIME,       /* i: waiting for modification time (gzip) */
+    OS,         /* i: waiting for extra flags and operating system (gzip) */
+    EXLEN,      /* i: waiting for extra length (gzip) */
+    EXTRA,      /* i: waiting for extra bytes (gzip) */
+    NAME,       /* i: waiting for end of file name (gzip) */
+    COMMENT,    /* i: waiting for end of comment (gzip) */
+    HCRC,       /* i: waiting for header crc (gzip) */
+    DICTID,     /* i: waiting for dictionary check value */
+    DICT,       /* waiting for inflateSetDictionary() call */
+        TYPE,       /* i: waiting for type bits, including last-flag bit */
+        TYPEDO,     /* i: same, but skip check to exit inflate on new block */
+        STORED,     /* i: waiting for stored size (length and complement) */
+        COPY_,      /* i/o: same as COPY below, but only first time in */
+        COPY,       /* i/o: waiting for input or output to copy stored block */
+        TABLE,      /* i: waiting for dynamic block table lengths */
+        LENLENS,    /* i: waiting for code length code lengths */
+        CODELENS,   /* i: waiting for length/lit and distance code lengths */
+            LEN_,       /* i: same as LEN below, but only first time in */
+            LEN,        /* i: waiting for length/lit/eob code */
+            LENEXT,     /* i: waiting for length extra bits */
+            DIST,       /* i: waiting for distance code */
+            DISTEXT,    /* i: waiting for distance extra bits */
+            MATCH,      /* o: waiting for output space to copy string */
+            LIT,        /* o: waiting for output space to write literal */
+    CHECK,      /* i: waiting for 32-bit check value */
+    LENGTH,     /* i: waiting for 32-bit length (gzip) */
+    DONE,       /* finished check, done -- remain here until reset */
+    BAD,        /* got a data error -- remain here until reset */
+    MEM,        /* got an inflate() memory error -- remain here until reset */
+    SYNC        /* looking for synchronization bytes to restart inflate() */
+} inflate_mode;
+
+/*
+    State transitions between above modes -
+
+    (most modes can go to BAD or MEM on error -- not shown for clarity)
+
+    Process header:
+        HEAD -> (gzip) or (zlib) or (raw)
+        (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
+                  HCRC -> TYPE
+        (zlib) -> DICTID or TYPE
+        DICTID -> DICT -> TYPE
+        (raw) -> TYPEDO
+    Read deflate blocks:
+            TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
+            STORED -> COPY_ -> COPY -> TYPE
+            TABLE -> LENLENS -> CODELENS -> LEN_
+            LEN_ -> LEN
+    Read deflate codes in fixed or dynamic block:
+                LEN -> LENEXT or LIT or TYPE
+                LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
+                LIT -> LEN
+    Process trailer:
+        CHECK -> LENGTH -> DONE
+ */
+
+/* State maintained between inflate() calls -- approximately 7K bytes, not
+   including the allocated sliding window, which is up to 32K bytes. */
+struct inflate_state {
+    z_streamp strm;             /* pointer back to this zlib stream */
+    inflate_mode mode;          /* current inflate mode */
+    int last;                   /* true if processing last block */
+    int wrap;                   /* bit 0 true for zlib, bit 1 true for gzip,
+                                   bit 2 true to validate check value */
+    int havedict;               /* true if dictionary provided */
+    int flags;                  /* gzip header method and flags (0 if zlib) */
+    unsigned dmax;              /* zlib header max distance (INFLATE_STRICT) */
+    unsigned long check;        /* protected copy of check value */
+    unsigned long total;        /* protected copy of output count */
+    gz_headerp head;            /* where to save gzip header information */
+        /* sliding window */
+    unsigned wbits;             /* log base 2 of requested window size */
+    unsigned wsize;             /* window size or zero if not using window */
+    unsigned whave;             /* valid bytes in the window */
+    unsigned wnext;             /* window write index */
+    unsigned char FAR *window;  /* allocated sliding window, if needed */
+        /* bit accumulator */
+    unsigned long hold;         /* input bit accumulator */
+    unsigned bits;              /* number of bits in "in" */
+        /* for string and stored block copying */
+    unsigned length;            /* literal or length of data to copy */
+    unsigned offset;            /* distance back to copy string from */
+        /* for table and code decoding */
+    unsigned extra;             /* extra bits needed */
+        /* fixed and dynamic code tables */
+    code const FAR *lencode;    /* starting table for length/literal codes */
+    code const FAR *distcode;   /* starting table for distance codes */
+    unsigned lenbits;           /* index bits for lencode */
+    unsigned distbits;          /* index bits for distcode */
+        /* dynamic table building */
+    unsigned ncode;             /* number of code length code lengths */
+    unsigned nlen;              /* number of length code lengths */
+    unsigned ndist;             /* number of distance code lengths */
+    unsigned have;              /* number of code lengths in lens[] */
+    code FAR *next;             /* next available space in codes[] */
+    unsigned short lens[320];   /* temporary storage for code lengths */
+    unsigned short work[288];   /* work area for code table building */
+    code codes[ENOUGH];         /* space for code tables */
+    int sane;                   /* if false, allow invalid distance too far */
+    int back;                   /* bits back of last unprocessed length/lit */
+    unsigned was;               /* initial length of match */
+};
diff --git a/jdk/src/java.base/share/native/libzip/zlib/inftrees.c b/jdk/src/java.base/share/native/libzip/zlib/inftrees.c
new file mode 100644
index 0000000..5b882ed
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/inftrees.c
@@ -0,0 +1,328 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* inftrees.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-2017 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+
+#define MAXBITS 15
+
+const char inflate_copyright[] =
+   " inflate 1.2.11 Copyright 1995-2017 Mark Adler ";
+/*
+  If you use the zlib library in a product, an acknowledgment is welcome
+  in the documentation of your product. If for some reason you cannot
+  include such an acknowledgment, I would appreciate that you keep this
+  copyright string in the executable of your product.
+ */
+
+/*
+   Build a set of tables to decode the provided canonical Huffman code.
+   The code lengths are lens[0..codes-1].  The result starts at *table,
+   whose indices are 0..2^bits-1.  work is a writable array of at least
+   lens shorts, which is used as a work area.  type is the type of code
+   to be generated, CODES, LENS, or DISTS.  On return, zero is success,
+   -1 is an invalid code, and +1 means that ENOUGH isn't enough.  table
+   on return points to the next available entry's address.  bits is the
+   requested root table index bits, and on return it is the actual root
+   table index bits.  It will differ if the request is greater than the
+   longest code or if it is less than the shortest code.
+ */
+int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
+codetype type;
+unsigned short FAR *lens;
+unsigned codes;
+code FAR * FAR *table;
+unsigned FAR *bits;
+unsigned short FAR *work;
+{
+    unsigned len;               /* a code's length in bits */
+    unsigned sym;               /* index of code symbols */
+    unsigned min, max;          /* minimum and maximum code lengths */
+    unsigned root;              /* number of index bits for root table */
+    unsigned curr;              /* number of index bits for current table */
+    unsigned drop;              /* code bits to drop for sub-table */
+    int left;                   /* number of prefix codes available */
+    unsigned used;              /* code entries in table used */
+    unsigned huff;              /* Huffman code */
+    unsigned incr;              /* for incrementing code, index */
+    unsigned fill;              /* index for replicating entries */
+    unsigned low;               /* low bits for current root entry */
+    unsigned mask;              /* mask for low root bits */
+    code here;                  /* table entry for duplication */
+    code FAR *next;             /* next available space in table */
+    const unsigned short FAR *base;     /* base value table to use */
+    const unsigned short FAR *extra;    /* extra bits table to use */
+    unsigned match;             /* use base and extra for symbol >= match */
+    unsigned short count[MAXBITS+1];    /* number of codes of each length */
+    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
+    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
+        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
+        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 202};
+    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
+        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+        8193, 12289, 16385, 24577, 0, 0};
+    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
+        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+        28, 28, 29, 29, 64, 64};
+
+    /*
+       Process a set of code lengths to create a canonical Huffman code.  The
+       code lengths are lens[0..codes-1].  Each length corresponds to the
+       symbols 0..codes-1.  The Huffman code is generated by first sorting the
+       symbols by length from short to long, and retaining the symbol order
+       for codes with equal lengths.  Then the code starts with all zero bits
+       for the first code of the shortest length, and the codes are integer
+       increments for the same length, and zeros are appended as the length
+       increases.  For the deflate format, these bits are stored backwards
+       from their more natural integer increment ordering, and so when the
+       decoding tables are built in the large loop below, the integer codes
+       are incremented backwards.
+
+       This routine assumes, but does not check, that all of the entries in
+       lens[] are in the range 0..MAXBITS.  The caller must assure this.
+       1..MAXBITS is interpreted as that code length.  zero means that that
+       symbol does not occur in this code.
+
+       The codes are sorted by computing a count of codes for each length,
+       creating from that a table of starting indices for each length in the
+       sorted table, and then entering the symbols in order in the sorted
+       table.  The sorted table is work[], with that space being provided by
+       the caller.
+
+       The length counts are used for other purposes as well, i.e. finding
+       the minimum and maximum length codes, determining if there are any
+       codes at all, checking for a valid set of lengths, and looking ahead
+       at length counts to determine sub-table sizes when building the
+       decoding tables.
+     */
+
+    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+    for (len = 0; len <= MAXBITS; len++)
+        count[len] = 0;
+    for (sym = 0; sym < codes; sym++)
+        count[lens[sym]]++;
+
+    /* bound code lengths, force root to be within code lengths */
+    root = *bits;
+    for (max = MAXBITS; max >= 1; max--)
+        if (count[max] != 0) break;
+    if (root > max) root = max;
+    if (max == 0) {                     /* no symbols to code at all */
+        here.op = (unsigned char)64;    /* invalid code marker */
+        here.bits = (unsigned char)1;
+        here.val = (unsigned short)0;
+        *(*table)++ = here;             /* make a table to force an error */
+        *(*table)++ = here;
+        *bits = 1;
+        return 0;     /* no symbols, but wait for decoding to report error */
+    }
+    for (min = 1; min < max; min++)
+        if (count[min] != 0) break;
+    if (root < min) root = min;
+
+    /* check for an over-subscribed or incomplete set of lengths */
+    left = 1;
+    for (len = 1; len <= MAXBITS; len++) {
+        left <<= 1;
+        left -= count[len];
+        if (left < 0) return -1;        /* over-subscribed */
+    }
+    if (left > 0 && (type == CODES || max != 1))
+        return -1;                      /* incomplete set */
+
+    /* generate offsets into symbol table for each length for sorting */
+    offs[1] = 0;
+    for (len = 1; len < MAXBITS; len++)
+        offs[len + 1] = offs[len] + count[len];
+
+    /* sort symbols by length, by symbol order within each length */
+    for (sym = 0; sym < codes; sym++)
+        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
+
+    /*
+       Create and fill in decoding tables.  In this loop, the table being
+       filled is at next and has curr index bits.  The code being used is huff
+       with length len.  That code is converted to an index by dropping drop
+       bits off of the bottom.  For codes where len is less than drop + curr,
+       those top drop + curr - len bits are incremented through all values to
+       fill the table with replicated entries.
+
+       root is the number of index bits for the root table.  When len exceeds
+       root, sub-tables are created pointed to by the root entry with an index
+       of the low root bits of huff.  This is saved in low to check for when a
+       new sub-table should be started.  drop is zero when the root table is
+       being filled, and drop is root when sub-tables are being filled.
+
+       When a new sub-table is needed, it is necessary to look ahead in the
+       code lengths to determine what size sub-table is needed.  The length
+       counts are used for this, and so count[] is decremented as codes are
+       entered in the tables.
+
+       used keeps track of how many table entries have been allocated from the
+       provided *table space.  It is checked for LENS and DIST tables against
+       the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
+       the initial root table size constants.  See the comments in inftrees.h
+       for more information.
+
+       sym increments through all symbols, and the loop terminates when
+       all codes of length max, i.e. all codes, have been processed.  This
+       routine permits incomplete codes, so another loop after this one fills
+       in the rest of the decoding tables with invalid code markers.
+     */
+
+    /* set up for code type */
+    switch (type) {
+    case CODES:
+        base = extra = work;    /* dummy value--not used */
+        match = 20;
+        break;
+    case LENS:
+        base = lbase;
+        extra = lext;
+        match = 257;
+        break;
+    default:    /* DISTS */
+        base = dbase;
+        extra = dext;
+        match = 0;
+    }
+
+    /* initialize state for loop */
+    huff = 0;                   /* starting code */
+    sym = 0;                    /* starting code symbol */
+    len = min;                  /* starting code length */
+    next = *table;              /* current table to fill in */
+    curr = root;                /* current table index bits */
+    drop = 0;                   /* current bits to drop from code for index */
+    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
+    used = 1U << root;          /* use root table entries */
+    mask = used - 1;            /* mask for comparing low */
+
+    /* check available table space */
+    if ((type == LENS && used > ENOUGH_LENS) ||
+        (type == DISTS && used > ENOUGH_DISTS))
+        return 1;
+
+    /* process all codes and make table entries */
+    for (;;) {
+        /* create table entry */
+        here.bits = (unsigned char)(len - drop);
+        if (work[sym] + 1U < match) {
+            here.op = (unsigned char)0;
+            here.val = work[sym];
+        }
+        else if (work[sym] >= match) {
+            here.op = (unsigned char)(extra[work[sym] - match]);
+            here.val = base[work[sym] - match];
+        }
+        else {
+            here.op = (unsigned char)(32 + 64);         /* end of block */
+            here.val = 0;
+        }
+
+        /* replicate for those indices with low len bits equal to huff */
+        incr = 1U << (len - drop);
+        fill = 1U << curr;
+        min = fill;                 /* save offset to next table */
+        do {
+            fill -= incr;
+            next[(huff >> drop) + fill] = here;
+        } while (fill != 0);
+
+        /* backwards increment the len-bit code huff */
+        incr = 1U << (len - 1);
+        while (huff & incr)
+            incr >>= 1;
+        if (incr != 0) {
+            huff &= incr - 1;
+            huff += incr;
+        }
+        else
+            huff = 0;
+
+        /* go to next symbol, update count, len */
+        sym++;
+        if (--(count[len]) == 0) {
+            if (len == max) break;
+            len = lens[work[sym]];
+        }
+
+        /* create new sub-table if needed */
+        if (len > root && (huff & mask) != low) {
+            /* if first time, transition to sub-tables */
+            if (drop == 0)
+                drop = root;
+
+            /* increment past last table */
+            next += min;            /* here min is 1 << curr */
+
+            /* determine length of next table */
+            curr = len - drop;
+            left = (int)(1 << curr);
+            while (curr + drop < max) {
+                left -= count[curr + drop];
+                if (left <= 0) break;
+                curr++;
+                left <<= 1;
+            }
+
+            /* check for enough space */
+            used += 1U << curr;
+            if ((type == LENS && used > ENOUGH_LENS) ||
+                (type == DISTS && used > ENOUGH_DISTS))
+                return 1;
+
+            /* point entry in root table to sub-table */
+            low = huff & mask;
+            (*table)[low].op = (unsigned char)curr;
+            (*table)[low].bits = (unsigned char)root;
+            (*table)[low].val = (unsigned short)(next - *table);
+        }
+    }
+
+    /* fill in remaining table entry if code is incomplete (guaranteed to have
+       at most one remaining entry, since if the code is incomplete, the
+       maximum code length that was allowed to get this far is one bit) */
+    if (huff != 0) {
+        here.op = (unsigned char)64;            /* invalid code marker */
+        here.bits = (unsigned char)(len - drop);
+        here.val = (unsigned short)0;
+        next[huff] = here;
+    }
+
+    /* set return parameters */
+    *table += used;
+    *bits = root;
+    return 0;
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.h b/jdk/src/java.base/share/native/libzip/zlib/inftrees.h
similarity index 100%
rename from jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.h
rename to jdk/src/java.base/share/native/libzip/zlib/inftrees.h
diff --git a/jdk/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java b/jdk/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java
new file mode 100644
index 0000000..d5615a6
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java
@@ -0,0 +1,81 @@
+(1) renamed adler32.c -> zadler32.c, zcrc32c -> zcrc32.c
+
+(2) zconf.h:
+    - added _LP64 to make uLong a 32-bit int on 64-bit platform
+    uLong -> 32-bit int
+
+--------------------------
+35,37d10
+< /* for _LP64 */
+< #include <sys/types.h>
+<
+421,424d393
+<
+< #ifdef _LP64
+< typedef unsigned int  uLong;  /* 32 bits or more */
+< #else
+426d394
+< #endif
+--------------------------
+
+(3) updated crc32.c/crc32(), crc32_z()
+   unsigned long      -> uLong
+
+--------------------------
+
+226,227c202,203
+< uLong ZEXPORT crc32_z(crc, buf, len)
+<     uLong crc;
+---
+> unsigned long ZEXPORT crc32_z(crc, buf, len)
+>     unsigned long crc;
+244c220
+<             return (uLong)crc32_little(crc, buf, len);
+---
+>             return crc32_little(crc, buf, len);
+246c222
+<             return (uLong)crc32_big(crc, buf, len);
+---
+>             return crc32_big(crc, buf, len);
+261,262c237,238
+< uLong ZEXPORT crc32(crc, buf, len)
+<     uLong crc;
+---
+> unsigned long ZEXPORT crc32(crc, buf, len)
+>     unsigned long crc;
+
+--------------------------
+
+(4) gzread.c
+
+--------------------------
+343c319
+<             n = (unsigned)len;
+---
+>             n = len;
+424c400
+<     len = (unsigned)gz_read(state, buf, len);
+---
+>     len = gz_read(state, buf, len);
+496c472
+<     ret = (int)gz_read(state, buf, 1);
+---
+>     ret = gz_read(state, buf, 1);
+--------------------------
+
+(5) gzwrite.c
+
+--------------------------
+236c212
+<                 copy = (unsigned)len;
+---
+>                 copy = len;
+256c232
+<                 n = (unsigned)len;
+---
+>                 n = len;
+--------------------------
+
+
+
+  
diff --git a/jdk/src/java.base/share/native/libzip/zlib/trees.c b/jdk/src/java.base/share/native/libzip/zlib/trees.c
new file mode 100644
index 0000000..c3703c0
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/trees.c
@@ -0,0 +1,1227 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* trees.c -- output deflated data using Huffman coding
+ * Copyright (C) 1995-2017 Jean-loup Gailly
+ * detect_data_type() function provided freely by Cosmin Truta, 2006
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ *  ALGORITHM
+ *
+ *      The "deflation" process uses several Huffman trees. The more
+ *      common source values are represented by shorter bit sequences.
+ *
+ *      Each code tree is stored in a compressed form which is itself
+ * a Huffman encoding of the lengths of all the code strings (in
+ * ascending order by source values).  The actual code strings are
+ * reconstructed from the lengths in the inflate process, as described
+ * in the deflate specification.
+ *
+ *  REFERENCES
+ *
+ *      Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
+ *      Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
+ *
+ *      Storer, James A.
+ *          Data Compression:  Methods and Theory, pp. 49-50.
+ *          Computer Science Press, 1988.  ISBN 0-7167-8156-5.
+ *
+ *      Sedgewick, R.
+ *          Algorithms, p290.
+ *          Addison-Wesley, 1983. ISBN 0-201-06672-6.
+ */
+
+/* @(#) $Id$ */
+
+/* #define GEN_TREES_H */
+
+#include "deflate.h"
+
+#ifdef ZLIB_DEBUG
+#  include <ctype.h>
+#endif
+
+/* ===========================================================================
+ * Constants
+ */
+
+#define MAX_BL_BITS 7
+/* Bit length codes must not exceed MAX_BL_BITS bits */
+
+#define END_BLOCK 256
+/* end of block literal code */
+
+#define REP_3_6      16
+/* repeat previous bit length 3-6 times (2 bits of repeat count) */
+
+#define REPZ_3_10    17
+/* repeat a zero length 3-10 times  (3 bits of repeat count) */
+
+#define REPZ_11_138  18
+/* repeat a zero length 11-138 times  (7 bits of repeat count) */
+
+local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
+   = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
+
+local const int extra_dbits[D_CODES] /* extra bits for each distance code */
+   = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+
+local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
+   = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
+
+local const uch bl_order[BL_CODES]
+   = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
+/* The lengths of the bit length codes are sent in order of decreasing
+ * probability, to avoid transmitting the lengths for unused bit length codes.
+ */
+
+/* ===========================================================================
+ * Local data. These are initialized only once.
+ */
+
+#define DIST_CODE_LEN  512 /* see definition of array dist_code below */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+/* non ANSI compilers may not accept trees.h */
+
+local ct_data static_ltree[L_CODES+2];
+/* The static literal tree. Since the bit lengths are imposed, there is no
+ * need for the L_CODES extra codes used during heap construction. However
+ * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
+ * below).
+ */
+
+local ct_data static_dtree[D_CODES];
+/* The static distance tree. (Actually a trivial tree since all codes use
+ * 5 bits.)
+ */
+
+uch _dist_code[DIST_CODE_LEN];
+/* Distance codes. The first 256 values correspond to the distances
+ * 3 .. 258, the last 256 values correspond to the top 8 bits of
+ * the 15 bit distances.
+ */
+
+uch _length_code[MAX_MATCH-MIN_MATCH+1];
+/* length code for each normalized match length (0 == MIN_MATCH) */
+
+local int base_length[LENGTH_CODES];
+/* First normalized length for each code (0 = MIN_MATCH) */
+
+local int base_dist[D_CODES];
+/* First normalized distance for each code (0 = distance of 1) */
+
+#else
+#  include "trees.h"
+#endif /* GEN_TREES_H */
+
+struct static_tree_desc_s {
+    const ct_data *static_tree;  /* static tree or NULL */
+    const intf *extra_bits;      /* extra bits for each code or NULL */
+    int     extra_base;          /* base index for extra_bits */
+    int     elems;               /* max number of elements in the tree */
+    int     max_length;          /* max bit length for the codes */
+};
+
+local const static_tree_desc  static_l_desc =
+{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
+
+local const static_tree_desc  static_d_desc =
+{static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS};
+
+local const static_tree_desc  static_bl_desc =
+{(const ct_data *)0, extra_blbits, 0,   BL_CODES, MAX_BL_BITS};
+
+/* ===========================================================================
+ * Local (static) routines in this file.
+ */
+
+local void tr_static_init OF((void));
+local void init_block     OF((deflate_state *s));
+local void pqdownheap     OF((deflate_state *s, ct_data *tree, int k));
+local void gen_bitlen     OF((deflate_state *s, tree_desc *desc));
+local void gen_codes      OF((ct_data *tree, int max_code, ushf *bl_count));
+local void build_tree     OF((deflate_state *s, tree_desc *desc));
+local void scan_tree      OF((deflate_state *s, ct_data *tree, int max_code));
+local void send_tree      OF((deflate_state *s, ct_data *tree, int max_code));
+local int  build_bl_tree  OF((deflate_state *s));
+local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
+                              int blcodes));
+local void compress_block OF((deflate_state *s, const ct_data *ltree,
+                              const ct_data *dtree));
+local int  detect_data_type OF((deflate_state *s));
+local unsigned bi_reverse OF((unsigned value, int length));
+local void bi_windup      OF((deflate_state *s));
+local void bi_flush       OF((deflate_state *s));
+
+#ifdef GEN_TREES_H
+local void gen_trees_header OF((void));
+#endif
+
+#ifndef ZLIB_DEBUG
+#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
+   /* Send a code of the given tree. c and tree must not have side effects */
+
+#else /* !ZLIB_DEBUG */
+#  define send_code(s, c, tree) \
+     { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
+       send_bits(s, tree[c].Code, tree[c].Len); }
+#endif
+
+/* ===========================================================================
+ * Output a short LSB first on the stream.
+ * IN assertion: there is enough room in pendingBuf.
+ */
+#define put_short(s, w) { \
+    put_byte(s, (uch)((w) & 0xff)); \
+    put_byte(s, (uch)((ush)(w) >> 8)); \
+}
+
+/* ===========================================================================
+ * Send a value on a given number of bits.
+ * IN assertion: length <= 16 and value fits in length bits.
+ */
+#ifdef ZLIB_DEBUG
+local void send_bits      OF((deflate_state *s, int value, int length));
+
+local void send_bits(s, value, length)
+    deflate_state *s;
+    int value;  /* value to send */
+    int length; /* number of bits */
+{
+    Tracevv((stderr," l %2d v %4x ", length, value));
+    Assert(length > 0 && length <= 15, "invalid length");
+    s->bits_sent += (ulg)length;
+
+    /* If not enough room in bi_buf, use (valid) bits from bi_buf and
+     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
+     * unused bits in value.
+     */
+    if (s->bi_valid > (int)Buf_size - length) {
+        s->bi_buf |= (ush)value << s->bi_valid;
+        put_short(s, s->bi_buf);
+        s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
+        s->bi_valid += length - Buf_size;
+    } else {
+        s->bi_buf |= (ush)value << s->bi_valid;
+        s->bi_valid += length;
+    }
+}
+#else /* !ZLIB_DEBUG */
+
+#define send_bits(s, value, length) \
+{ int len = length;\
+  if (s->bi_valid > (int)Buf_size - len) {\
+    int val = (int)value;\
+    s->bi_buf |= (ush)val << s->bi_valid;\
+    put_short(s, s->bi_buf);\
+    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
+    s->bi_valid += len - Buf_size;\
+  } else {\
+    s->bi_buf |= (ush)(value) << s->bi_valid;\
+    s->bi_valid += len;\
+  }\
+}
+#endif /* ZLIB_DEBUG */
+
+
+/* the arguments must not have side effects */
+
+/* ===========================================================================
+ * Initialize the various 'constant' tables.
+ */
+local void tr_static_init()
+{
+#if defined(GEN_TREES_H) || !defined(STDC)
+    static int static_init_done = 0;
+    int n;        /* iterates over tree elements */
+    int bits;     /* bit counter */
+    int length;   /* length value */
+    int code;     /* code value */
+    int dist;     /* distance index */
+    ush bl_count[MAX_BITS+1];
+    /* number of codes at each bit length for an optimal tree */
+
+    if (static_init_done) return;
+
+    /* For some embedded targets, global variables are not initialized: */
+#ifdef NO_INIT_GLOBAL_POINTERS
+    static_l_desc.static_tree = static_ltree;
+    static_l_desc.extra_bits = extra_lbits;
+    static_d_desc.static_tree = static_dtree;
+    static_d_desc.extra_bits = extra_dbits;
+    static_bl_desc.extra_bits = extra_blbits;
+#endif
+
+    /* Initialize the mapping length (0..255) -> length code (0..28) */
+    length = 0;
+    for (code = 0; code < LENGTH_CODES-1; code++) {
+        base_length[code] = length;
+        for (n = 0; n < (1<<extra_lbits[code]); n++) {
+            _length_code[length++] = (uch)code;
+        }
+    }
+    Assert (length == 256, "tr_static_init: length != 256");
+    /* Note that the length 255 (match length 258) can be represented
+     * in two different ways: code 284 + 5 bits or code 285, so we
+     * overwrite length_code[255] to use the best encoding:
+     */
+    _length_code[length-1] = (uch)code;
+
+    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
+    dist = 0;
+    for (code = 0 ; code < 16; code++) {
+        base_dist[code] = dist;
+        for (n = 0; n < (1<<extra_dbits[code]); n++) {
+            _dist_code[dist++] = (uch)code;
+        }
+    }
+    Assert (dist == 256, "tr_static_init: dist != 256");
+    dist >>= 7; /* from now on, all distances are divided by 128 */
+    for ( ; code < D_CODES; code++) {
+        base_dist[code] = dist << 7;
+        for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+            _dist_code[256 + dist++] = (uch)code;
+        }
+    }
+    Assert (dist == 256, "tr_static_init: 256+dist != 512");
+
+    /* Construct the codes of the static literal tree */
+    for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
+    n = 0;
+    while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
+    while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
+    while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
+    while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
+    /* Codes 286 and 287 do not exist, but we must include them in the
+     * tree construction to get a canonical Huffman tree (longest code
+     * all ones)
+     */
+    gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
+
+    /* The static distance tree is trivial: */
+    for (n = 0; n < D_CODES; n++) {
+        static_dtree[n].Len = 5;
+        static_dtree[n].Code = bi_reverse((unsigned)n, 5);
+    }
+    static_init_done = 1;
+
+#  ifdef GEN_TREES_H
+    gen_trees_header();
+#  endif
+#endif /* defined(GEN_TREES_H) || !defined(STDC) */
+}
+
+/* ===========================================================================
+ * Genererate the file trees.h describing the static trees.
+ */
+#ifdef GEN_TREES_H
+#  ifndef ZLIB_DEBUG
+#    include <stdio.h>
+#  endif
+
+#  define SEPARATOR(i, last, width) \
+      ((i) == (last)? "\n};\n\n" :    \
+       ((i) % (width) == (width)-1 ? ",\n" : ", "))
+
+void gen_trees_header()
+{
+    FILE *header = fopen("trees.h", "w");
+    int i;
+
+    Assert (header != NULL, "Can't open trees.h");
+    fprintf(header,
+            "/* header created automatically with -DGEN_TREES_H */\n\n");
+
+    fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
+    for (i = 0; i < L_CODES+2; i++) {
+        fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
+                static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
+    }
+
+    fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
+    for (i = 0; i < D_CODES; i++) {
+        fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
+                static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
+    }
+
+    fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n");
+    for (i = 0; i < DIST_CODE_LEN; i++) {
+        fprintf(header, "%2u%s", _dist_code[i],
+                SEPARATOR(i, DIST_CODE_LEN-1, 20));
+    }
+
+    fprintf(header,
+        "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+    for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
+        fprintf(header, "%2u%s", _length_code[i],
+                SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
+    }
+
+    fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
+    for (i = 0; i < LENGTH_CODES; i++) {
+        fprintf(header, "%1u%s", base_length[i],
+                SEPARATOR(i, LENGTH_CODES-1, 20));
+    }
+
+    fprintf(header, "local const int base_dist[D_CODES] = {\n");
+    for (i = 0; i < D_CODES; i++) {
+        fprintf(header, "%5u%s", base_dist[i],
+                SEPARATOR(i, D_CODES-1, 10));
+    }
+
+    fclose(header);
+}
+#endif /* GEN_TREES_H */
+
+/* ===========================================================================
+ * Initialize the tree data structures for a new zlib stream.
+ */
+void ZLIB_INTERNAL _tr_init(s)
+    deflate_state *s;
+{
+    tr_static_init();
+
+    s->l_desc.dyn_tree = s->dyn_ltree;
+    s->l_desc.stat_desc = &static_l_desc;
+
+    s->d_desc.dyn_tree = s->dyn_dtree;
+    s->d_desc.stat_desc = &static_d_desc;
+
+    s->bl_desc.dyn_tree = s->bl_tree;
+    s->bl_desc.stat_desc = &static_bl_desc;
+
+    s->bi_buf = 0;
+    s->bi_valid = 0;
+#ifdef ZLIB_DEBUG
+    s->compressed_len = 0L;
+    s->bits_sent = 0L;
+#endif
+
+    /* Initialize the first block of the first file: */
+    init_block(s);
+}
+
+/* ===========================================================================
+ * Initialize a new block.
+ */
+local void init_block(s)
+    deflate_state *s;
+{
+    int n; /* iterates over tree elements */
+
+    /* Initialize the trees. */
+    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
+    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
+    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
+
+    s->dyn_ltree[END_BLOCK].Freq = 1;
+    s->opt_len = s->static_len = 0L;
+    s->last_lit = s->matches = 0;
+}
+
+#define SMALLEST 1
+/* Index within the heap array of least frequent node in the Huffman tree */
+
+
+/* ===========================================================================
+ * Remove the smallest element from the heap and recreate the heap with
+ * one less element. Updates heap and heap_len.
+ */
+#define pqremove(s, tree, top) \
+{\
+    top = s->heap[SMALLEST]; \
+    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
+    pqdownheap(s, tree, SMALLEST); \
+}
+
+/* ===========================================================================
+ * Compares to subtrees, using the tree depth as tie breaker when
+ * the subtrees have equal frequency. This minimizes the worst case length.
+ */
+#define smaller(tree, n, m, depth) \
+   (tree[n].Freq < tree[m].Freq || \
+   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
+
+/* ===========================================================================
+ * Restore the heap property by moving down the tree starting at node k,
+ * exchanging a node with the smallest of its two sons if necessary, stopping
+ * when the heap property is re-established (each father smaller than its
+ * two sons).
+ */
+local void pqdownheap(s, tree, k)
+    deflate_state *s;
+    ct_data *tree;  /* the tree to restore */
+    int k;               /* node to move down */
+{
+    int v = s->heap[k];
+    int j = k << 1;  /* left son of k */
+    while (j <= s->heap_len) {
+        /* Set j to the smallest of the two sons: */
+        if (j < s->heap_len &&
+            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+            j++;
+        }
+        /* Exit if v is smaller than both sons */
+        if (smaller(tree, v, s->heap[j], s->depth)) break;
+
+        /* Exchange v with the smallest son */
+        s->heap[k] = s->heap[j];  k = j;
+
+        /* And continue down the tree, setting j to the left son of k */
+        j <<= 1;
+    }
+    s->heap[k] = v;
+}
+
+/* ===========================================================================
+ * Compute the optimal bit lengths for a tree and update the total bit length
+ * for the current block.
+ * IN assertion: the fields freq and dad are set, heap[heap_max] and
+ *    above are the tree nodes sorted by increasing frequency.
+ * OUT assertions: the field len is set to the optimal bit length, the
+ *     array bl_count contains the frequencies for each bit length.
+ *     The length opt_len is updated; static_len is also updated if stree is
+ *     not null.
+ */
+local void gen_bitlen(s, desc)
+    deflate_state *s;
+    tree_desc *desc;    /* the tree descriptor */
+{
+    ct_data *tree        = desc->dyn_tree;
+    int max_code         = desc->max_code;
+    const ct_data *stree = desc->stat_desc->static_tree;
+    const intf *extra    = desc->stat_desc->extra_bits;
+    int base             = desc->stat_desc->extra_base;
+    int max_length       = desc->stat_desc->max_length;
+    int h;              /* heap index */
+    int n, m;           /* iterate over the tree elements */
+    int bits;           /* bit length */
+    int xbits;          /* extra bits */
+    ush f;              /* frequency */
+    int overflow = 0;   /* number of elements with bit length too large */
+
+    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
+
+    /* In a first pass, compute the optimal bit lengths (which may
+     * overflow in the case of the bit length tree).
+     */
+    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
+
+    for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+        n = s->heap[h];
+        bits = tree[tree[n].Dad].Len + 1;
+        if (bits > max_length) bits = max_length, overflow++;
+        tree[n].Len = (ush)bits;
+        /* We overwrite tree[n].Dad which is no longer needed */
+
+        if (n > max_code) continue; /* not a leaf node */
+
+        s->bl_count[bits]++;
+        xbits = 0;
+        if (n >= base) xbits = extra[n-base];
+        f = tree[n].Freq;
+        s->opt_len += (ulg)f * (unsigned)(bits + xbits);
+        if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
+    }
+    if (overflow == 0) return;
+
+    Tracev((stderr,"\nbit length overflow\n"));
+    /* This happens for example on obj2 and pic of the Calgary corpus */
+
+    /* Find the first bit length which could increase: */
+    do {
+        bits = max_length-1;
+        while (s->bl_count[bits] == 0) bits--;
+        s->bl_count[bits]--;      /* move one leaf down the tree */
+        s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
+        s->bl_count[max_length]--;
+        /* The brother of the overflow item also moves one step up,
+         * but this does not affect bl_count[max_length]
+         */
+        overflow -= 2;
+    } while (overflow > 0);
+
+    /* Now recompute all bit lengths, scanning in increasing frequency.
+     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+     * lengths instead of fixing only the wrong ones. This idea is taken
+     * from 'ar' written by Haruhiko Okumura.)
+     */
+    for (bits = max_length; bits != 0; bits--) {
+        n = s->bl_count[bits];
+        while (n != 0) {
+            m = s->heap[--h];
+            if (m > max_code) continue;
+            if ((unsigned) tree[m].Len != (unsigned) bits) {
+                Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
+                s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
+                tree[m].Len = (ush)bits;
+            }
+            n--;
+        }
+    }
+}
+
+/* ===========================================================================
+ * Generate the codes for a given tree and bit counts (which need not be
+ * optimal).
+ * IN assertion: the array bl_count contains the bit length statistics for
+ * the given tree and the field len is set for all tree elements.
+ * OUT assertion: the field code is set for all tree elements of non
+ *     zero code length.
+ */
+local void gen_codes (tree, max_code, bl_count)
+    ct_data *tree;             /* the tree to decorate */
+    int max_code;              /* largest code with non zero frequency */
+    ushf *bl_count;            /* number of codes at each bit length */
+{
+    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
+    unsigned code = 0;         /* running code value */
+    int bits;                  /* bit index */
+    int n;                     /* code index */
+
+    /* The distribution counts are first used to generate the code values
+     * without bit reversal.
+     */
+    for (bits = 1; bits <= MAX_BITS; bits++) {
+        code = (code + bl_count[bits-1]) << 1;
+        next_code[bits] = (ush)code;
+    }
+    /* Check that the bit counts in bl_count are consistent. The last code
+     * must be all ones.
+     */
+    Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+            "inconsistent bit counts");
+    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
+
+    for (n = 0;  n <= max_code; n++) {
+        int len = tree[n].Len;
+        if (len == 0) continue;
+        /* Now reverse the bits */
+        tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
+
+        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
+             n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+    }
+}
+
+/* ===========================================================================
+ * Construct one Huffman tree and assigns the code bit strings and lengths.
+ * Update the total bit length for the current block.
+ * IN assertion: the field freq is set for all tree elements.
+ * OUT assertions: the fields len and code are set to the optimal bit length
+ *     and corresponding code. The length opt_len is updated; static_len is
+ *     also updated if stree is not null. The field max_code is set.
+ */
+local void build_tree(s, desc)
+    deflate_state *s;
+    tree_desc *desc; /* the tree descriptor */
+{
+    ct_data *tree         = desc->dyn_tree;
+    const ct_data *stree  = desc->stat_desc->static_tree;
+    int elems             = desc->stat_desc->elems;
+    int n, m;          /* iterate over heap elements */
+    int max_code = -1; /* largest code with non zero frequency */
+    int node;          /* new node being created */
+
+    /* Construct the initial heap, with least frequent element in
+     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+     * heap[0] is not used.
+     */
+    s->heap_len = 0, s->heap_max = HEAP_SIZE;
+
+    for (n = 0; n < elems; n++) {
+        if (tree[n].Freq != 0) {
+            s->heap[++(s->heap_len)] = max_code = n;
+            s->depth[n] = 0;
+        } else {
+            tree[n].Len = 0;
+        }
+    }
+
+    /* The pkzip format requires that at least one distance code exists,
+     * and that at least one bit should be sent even if there is only one
+     * possible code. So to avoid special checks later on we force at least
+     * two codes of non zero frequency.
+     */
+    while (s->heap_len < 2) {
+        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
+        tree[node].Freq = 1;
+        s->depth[node] = 0;
+        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
+        /* node is 0 or 1 so it does not have extra bits */
+    }
+    desc->max_code = max_code;
+
+    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+     * establish sub-heaps of increasing lengths:
+     */
+    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
+
+    /* Construct the Huffman tree by repeatedly combining the least two
+     * frequent nodes.
+     */
+    node = elems;              /* next internal node of the tree */
+    do {
+        pqremove(s, tree, n);  /* n = node of least frequency */
+        m = s->heap[SMALLEST]; /* m = node of next least frequency */
+
+        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
+        s->heap[--(s->heap_max)] = m;
+
+        /* Create a new node father of n and m */
+        tree[node].Freq = tree[n].Freq + tree[m].Freq;
+        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
+                                s->depth[n] : s->depth[m]) + 1);
+        tree[n].Dad = tree[m].Dad = (ush)node;
+#ifdef DUMP_BL_TREE
+        if (tree == s->bl_tree) {
+            fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
+                    node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
+        }
+#endif
+        /* and insert the new node in the heap */
+        s->heap[SMALLEST] = node++;
+        pqdownheap(s, tree, SMALLEST);
+
+    } while (s->heap_len >= 2);
+
+    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
+
+    /* At this point, the fields freq and dad are set. We can now
+     * generate the bit lengths.
+     */
+    gen_bitlen(s, (tree_desc *)desc);
+
+    /* The field len is now set, we can generate the bit codes */
+    gen_codes ((ct_data *)tree, max_code, s->bl_count);
+}
+
+/* ===========================================================================
+ * Scan a literal or distance tree to determine the frequencies of the codes
+ * in the bit length tree.
+ */
+local void scan_tree (s, tree, max_code)
+    deflate_state *s;
+    ct_data *tree;   /* the tree to be scanned */
+    int max_code;    /* and its largest code of non zero frequency */
+{
+    int n;                     /* iterates over all tree elements */
+    int prevlen = -1;          /* last emitted length */
+    int curlen;                /* length of current code */
+    int nextlen = tree[0].Len; /* length of next code */
+    int count = 0;             /* repeat count of the current code */
+    int max_count = 7;         /* max repeat count */
+    int min_count = 4;         /* min repeat count */
+
+    if (nextlen == 0) max_count = 138, min_count = 3;
+    tree[max_code+1].Len = (ush)0xffff; /* guard */
+
+    for (n = 0; n <= max_code; n++) {
+        curlen = nextlen; nextlen = tree[n+1].Len;
+        if (++count < max_count && curlen == nextlen) {
+            continue;
+        } else if (count < min_count) {
+            s->bl_tree[curlen].Freq += count;
+        } else if (curlen != 0) {
+            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
+            s->bl_tree[REP_3_6].Freq++;
+        } else if (count <= 10) {
+            s->bl_tree[REPZ_3_10].Freq++;
+        } else {
+            s->bl_tree[REPZ_11_138].Freq++;
+        }
+        count = 0; prevlen = curlen;
+        if (nextlen == 0) {
+            max_count = 138, min_count = 3;
+        } else if (curlen == nextlen) {
+            max_count = 6, min_count = 3;
+        } else {
+            max_count = 7, min_count = 4;
+        }
+    }
+}
+
+/* ===========================================================================
+ * Send a literal or distance tree in compressed form, using the codes in
+ * bl_tree.
+ */
+local void send_tree (s, tree, max_code)
+    deflate_state *s;
+    ct_data *tree; /* the tree to be scanned */
+    int max_code;       /* and its largest code of non zero frequency */
+{
+    int n;                     /* iterates over all tree elements */
+    int prevlen = -1;          /* last emitted length */
+    int curlen;                /* length of current code */
+    int nextlen = tree[0].Len; /* length of next code */
+    int count = 0;             /* repeat count of the current code */
+    int max_count = 7;         /* max repeat count */
+    int min_count = 4;         /* min repeat count */
+
+    /* tree[max_code+1].Len = -1; */  /* guard already set */
+    if (nextlen == 0) max_count = 138, min_count = 3;
+
+    for (n = 0; n <= max_code; n++) {
+        curlen = nextlen; nextlen = tree[n+1].Len;
+        if (++count < max_count && curlen == nextlen) {
+            continue;
+        } else if (count < min_count) {
+            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
+
+        } else if (curlen != 0) {
+            if (curlen != prevlen) {
+                send_code(s, curlen, s->bl_tree); count--;
+            }
+            Assert(count >= 3 && count <= 6, " 3_6?");
+            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+
+        } else if (count <= 10) {
+            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+
+        } else {
+            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
+        }
+        count = 0; prevlen = curlen;
+        if (nextlen == 0) {
+            max_count = 138, min_count = 3;
+        } else if (curlen == nextlen) {
+            max_count = 6, min_count = 3;
+        } else {
+            max_count = 7, min_count = 4;
+        }
+    }
+}
+
+/* ===========================================================================
+ * Construct the Huffman tree for the bit lengths and return the index in
+ * bl_order of the last bit length code to send.
+ */
+local int build_bl_tree(s)
+    deflate_state *s;
+{
+    int max_blindex;  /* index of last bit length code of non zero freq */
+
+    /* Determine the bit length frequencies for literal and distance trees */
+    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
+    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
+
+    /* Build the bit length tree: */
+    build_tree(s, (tree_desc *)(&(s->bl_desc)));
+    /* opt_len now includes the length of the tree representations, except
+     * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+     */
+
+    /* Determine the number of bit length codes to send. The pkzip format
+     * requires that at least 4 bit length codes be sent. (appnote.txt says
+     * 3 but the actual value used is 4.)
+     */
+    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
+        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+    }
+    /* Update opt_len to include the bit length tree and counts */
+    s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4;
+    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+            s->opt_len, s->static_len));
+
+    return max_blindex;
+}
+
+/* ===========================================================================
+ * Send the header for a block using dynamic Huffman trees: the counts, the
+ * lengths of the bit length codes, the literal tree and the distance tree.
+ * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
+ */
+local void send_all_trees(s, lcodes, dcodes, blcodes)
+    deflate_state *s;
+    int lcodes, dcodes, blcodes; /* number of codes for each tree */
+{
+    int rank;                    /* index in bl_order */
+
+    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
+    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
+            "too many codes");
+    Tracev((stderr, "\nbl counts: "));
+    send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
+    send_bits(s, dcodes-1,   5);
+    send_bits(s, blcodes-4,  4); /* not -3 as stated in appnote.txt */
+    for (rank = 0; rank < blcodes; rank++) {
+        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
+        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
+    }
+    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
+
+    send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
+    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
+
+    send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
+    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
+}
+
+/* ===========================================================================
+ * Send a stored block
+ */
+void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
+    deflate_state *s;
+    charf *buf;       /* input block */
+    ulg stored_len;   /* length of input block */
+    int last;         /* one if this is the last block for a file */
+{
+    send_bits(s, (STORED_BLOCK<<1)+last, 3);    /* send block type */
+    bi_windup(s);        /* align on byte boundary */
+    put_short(s, (ush)stored_len);
+    put_short(s, (ush)~stored_len);
+    zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
+    s->pending += stored_len;
+#ifdef ZLIB_DEBUG
+    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
+    s->compressed_len += (stored_len + 4) << 3;
+    s->bits_sent += 2*16;
+    s->bits_sent += stored_len<<3;
+#endif
+}
+
+/* ===========================================================================
+ * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)
+ */
+void ZLIB_INTERNAL _tr_flush_bits(s)
+    deflate_state *s;
+{
+    bi_flush(s);
+}
+
+/* ===========================================================================
+ * Send one empty static block to give enough lookahead for inflate.
+ * This takes 10 bits, of which 7 may remain in the bit buffer.
+ */
+void ZLIB_INTERNAL _tr_align(s)
+    deflate_state *s;
+{
+    send_bits(s, STATIC_TREES<<1, 3);
+    send_code(s, END_BLOCK, static_ltree);
+#ifdef ZLIB_DEBUG
+    s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
+#endif
+    bi_flush(s);
+}
+
+/* ===========================================================================
+ * Determine the best encoding for the current block: dynamic trees, static
+ * trees or store, and write out the encoded block.
+ */
+void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
+    deflate_state *s;
+    charf *buf;       /* input block, or NULL if too old */
+    ulg stored_len;   /* length of input block */
+    int last;         /* one if this is the last block for a file */
+{
+    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
+    int max_blindex = 0;  /* index of last bit length code of non zero freq */
+
+    /* Build the Huffman trees unless a stored block is forced */
+    if (s->level > 0) {
+
+        /* Check if the file is binary or text */
+        if (s->strm->data_type == Z_UNKNOWN)
+            s->strm->data_type = detect_data_type(s);
+
+        /* Construct the literal and distance trees */
+        build_tree(s, (tree_desc *)(&(s->l_desc)));
+        Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
+                s->static_len));
+
+        build_tree(s, (tree_desc *)(&(s->d_desc)));
+        Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
+                s->static_len));
+        /* At this point, opt_len and static_len are the total bit lengths of
+         * the compressed block data, excluding the tree representations.
+         */
+
+        /* Build the bit length tree for the above two trees, and get the index
+         * in bl_order of the last bit length code to send.
+         */
+        max_blindex = build_bl_tree(s);
+
+        /* Determine the best encoding. Compute the block lengths in bytes. */
+        opt_lenb = (s->opt_len+3+7)>>3;
+        static_lenb = (s->static_len+3+7)>>3;
+
+        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
+                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
+                s->last_lit));
+
+        if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+
+    } else {
+        Assert(buf != (char*)0, "lost buf");
+        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
+    }
+
+#ifdef FORCE_STORED
+    if (buf != (char*)0) { /* force stored block */
+#else
+    if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+                       /* 4: two words for the lengths */
+#endif
+        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
+         * Otherwise we can't have processed more than WSIZE input bytes since
+         * the last block flush, because compression would have been
+         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
+         * transform a block into a stored block.
+         */
+        _tr_stored_block(s, buf, stored_len, last);
+
+#ifdef FORCE_STATIC
+    } else if (static_lenb >= 0) { /* force static trees */
+#else
+    } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
+#endif
+        send_bits(s, (STATIC_TREES<<1)+last, 3);
+        compress_block(s, (const ct_data *)static_ltree,
+                       (const ct_data *)static_dtree);
+#ifdef ZLIB_DEBUG
+        s->compressed_len += 3 + s->static_len;
+#endif
+    } else {
+        send_bits(s, (DYN_TREES<<1)+last, 3);
+        send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
+                       max_blindex+1);
+        compress_block(s, (const ct_data *)s->dyn_ltree,
+                       (const ct_data *)s->dyn_dtree);
+#ifdef ZLIB_DEBUG
+        s->compressed_len += 3 + s->opt_len;
+#endif
+    }
+    Assert (s->compressed_len == s->bits_sent, "bad compressed size");
+    /* The above check is made mod 2^32, for files larger than 512 MB
+     * and uLong implemented on 32 bits.
+     */
+    init_block(s);
+
+    if (last) {
+        bi_windup(s);
+#ifdef ZLIB_DEBUG
+        s->compressed_len += 7;  /* align on byte boundary */
+#endif
+    }
+    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
+           s->compressed_len-7*last));
+}
+
+/* ===========================================================================
+ * Save the match info and tally the frequency counts. Return true if
+ * the current block must be flushed.
+ */
+int ZLIB_INTERNAL _tr_tally (s, dist, lc)
+    deflate_state *s;
+    unsigned dist;  /* distance of matched string */
+    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
+{
+    s->d_buf[s->last_lit] = (ush)dist;
+    s->l_buf[s->last_lit++] = (uch)lc;
+    if (dist == 0) {
+        /* lc is the unmatched char */
+        s->dyn_ltree[lc].Freq++;
+    } else {
+        s->matches++;
+        /* Here, lc is the match length - MIN_MATCH */
+        dist--;             /* dist = match distance - 1 */
+        Assert((ush)dist < (ush)MAX_DIST(s) &&
+               (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
+               (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");
+
+        s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
+        s->dyn_dtree[d_code(dist)].Freq++;
+    }
+
+#ifdef TRUNCATE_BLOCK
+    /* Try to guess if it is profitable to stop the current block here */
+    if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
+        /* Compute an upper bound for the compressed length */
+        ulg out_length = (ulg)s->last_lit*8L;
+        ulg in_length = (ulg)((long)s->strstart - s->block_start);
+        int dcode;
+        for (dcode = 0; dcode < D_CODES; dcode++) {
+            out_length += (ulg)s->dyn_dtree[dcode].Freq *
+                (5L+extra_dbits[dcode]);
+        }
+        out_length >>= 3;
+        Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
+               s->last_lit, in_length, out_length,
+               100L - out_length*100L/in_length));
+        if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
+    }
+#endif
+    return (s->last_lit == s->lit_bufsize-1);
+    /* We avoid equality with lit_bufsize because of wraparound at 64K
+     * on 16 bit machines and because stored blocks are restricted to
+     * 64K-1 bytes.
+     */
+}
+
+/* ===========================================================================
+ * Send the block data compressed using the given Huffman trees
+ */
+local void compress_block(s, ltree, dtree)
+    deflate_state *s;
+    const ct_data *ltree; /* literal tree */
+    const ct_data *dtree; /* distance tree */
+{
+    unsigned dist;      /* distance of matched string */
+    int lc;             /* match length or unmatched char (if dist == 0) */
+    unsigned lx = 0;    /* running index in l_buf */
+    unsigned code;      /* the code to send */
+    int extra;          /* number of extra bits to send */
+
+    if (s->last_lit != 0) do {
+        dist = s->d_buf[lx];
+        lc = s->l_buf[lx++];
+        if (dist == 0) {
+            send_code(s, lc, ltree); /* send a literal byte */
+            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
+        } else {
+            /* Here, lc is the match length - MIN_MATCH */
+            code = _length_code[lc];
+            send_code(s, code+LITERALS+1, ltree); /* send the length code */
+            extra = extra_lbits[code];
+            if (extra != 0) {
+                lc -= base_length[code];
+                send_bits(s, lc, extra);       /* send the extra length bits */
+            }
+            dist--; /* dist is now the match distance - 1 */
+            code = d_code(dist);
+            Assert (code < D_CODES, "bad d_code");
+
+            send_code(s, code, dtree);       /* send the distance code */
+            extra = extra_dbits[code];
+            if (extra != 0) {
+                dist -= (unsigned)base_dist[code];
+                send_bits(s, dist, extra);   /* send the extra distance bits */
+            }
+        } /* literal or match pair ? */
+
+        /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
+        Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
+               "pendingBuf overflow");
+
+    } while (lx < s->last_lit);
+
+    send_code(s, END_BLOCK, ltree);
+}
+
+/* ===========================================================================
+ * Check if the data type is TEXT or BINARY, using the following algorithm:
+ * - TEXT if the two conditions below are satisfied:
+ *    a) There are no non-portable control characters belonging to the
+ *       "black list" (0..6, 14..25, 28..31).
+ *    b) There is at least one printable character belonging to the
+ *       "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
+ * - BINARY otherwise.
+ * - The following partially-portable control characters form a
+ *   "gray list" that is ignored in this detection algorithm:
+ *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
+ * IN assertion: the fields Freq of dyn_ltree are set.
+ */
+local int detect_data_type(s)
+    deflate_state *s;
+{
+    /* black_mask is the bit mask of black-listed bytes
+     * set bits 0..6, 14..25, and 28..31
+     * 0xf3ffc07f = binary 11110011111111111100000001111111
+     */
+    unsigned long black_mask = 0xf3ffc07fUL;
+    int n;
+
+    /* Check for non-textual ("black-listed") bytes. */
+    for (n = 0; n <= 31; n++, black_mask >>= 1)
+        if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))
+            return Z_BINARY;
+
+    /* Check for textual ("white-listed") bytes. */
+    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
+            || s->dyn_ltree[13].Freq != 0)
+        return Z_TEXT;
+    for (n = 32; n < LITERALS; n++)
+        if (s->dyn_ltree[n].Freq != 0)
+            return Z_TEXT;
+
+    /* There are no "black-listed" or "white-listed" bytes:
+     * this stream either is empty or has tolerated ("gray-listed") bytes only.
+     */
+    return Z_BINARY;
+}
+
+/* ===========================================================================
+ * Reverse the first len bits of a code, using straightforward code (a faster
+ * method would use a table)
+ * IN assertion: 1 <= len <= 15
+ */
+local unsigned bi_reverse(code, len)
+    unsigned code; /* the value to invert */
+    int len;       /* its bit length */
+{
+    register unsigned res = 0;
+    do {
+        res |= code & 1;
+        code >>= 1, res <<= 1;
+    } while (--len > 0);
+    return res >> 1;
+}
+
+/* ===========================================================================
+ * Flush the bit buffer, keeping at most 7 bits in it.
+ */
+local void bi_flush(s)
+    deflate_state *s;
+{
+    if (s->bi_valid == 16) {
+        put_short(s, s->bi_buf);
+        s->bi_buf = 0;
+        s->bi_valid = 0;
+    } else if (s->bi_valid >= 8) {
+        put_byte(s, (Byte)s->bi_buf);
+        s->bi_buf >>= 8;
+        s->bi_valid -= 8;
+    }
+}
+
+/* ===========================================================================
+ * Flush the bit buffer and align the output on a byte boundary
+ */
+local void bi_windup(s)
+    deflate_state *s;
+{
+    if (s->bi_valid > 8) {
+        put_short(s, s->bi_buf);
+    } else if (s->bi_valid > 0) {
+        put_byte(s, (Byte)s->bi_buf);
+    }
+    s->bi_buf = 0;
+    s->bi_valid = 0;
+#ifdef ZLIB_DEBUG
+    s->bits_sent = (s->bits_sent+7) & ~7;
+#endif
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.h b/jdk/src/java.base/share/native/libzip/zlib/trees.h
similarity index 100%
rename from jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.h
rename to jdk/src/java.base/share/native/libzip/zlib/trees.h
diff --git a/jdk/src/java.base/share/native/libzip/zlib/uncompr.c b/jdk/src/java.base/share/native/libzip/zlib/uncompr.c
new file mode 100644
index 0000000..bd4766f
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/uncompr.c
@@ -0,0 +1,117 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* uncompr.c -- decompress a memory buffer
+ * Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+/* ===========================================================================
+     Decompresses the source buffer into the destination buffer.  *sourceLen is
+   the byte length of the source buffer. Upon entry, *destLen is the total size
+   of the destination buffer, which must be large enough to hold the entire
+   uncompressed data. (The size of the uncompressed data must have been saved
+   previously by the compressor and transmitted to the decompressor by some
+   mechanism outside the scope of this compression library.) Upon exit,
+   *destLen is the size of the decompressed data and *sourceLen is the number
+   of source bytes consumed. Upon return, source + *sourceLen points to the
+   first unused input byte.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer, or
+   Z_DATA_ERROR if the input data was corrupted, including if the input data is
+   an incomplete zlib stream.
+*/
+int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
+    Bytef *dest;
+    uLongf *destLen;
+    const Bytef *source;
+    uLong *sourceLen;
+{
+    z_stream stream;
+    int err;
+    const uInt max = (uInt)-1;
+    uLong len, left;
+    Byte buf[1];    /* for detection of incomplete stream when *destLen == 0 */
+
+    len = *sourceLen;
+    if (*destLen) {
+        left = *destLen;
+        *destLen = 0;
+    }
+    else {
+        left = 1;
+        dest = buf;
+    }
+
+    stream.next_in = (z_const Bytef *)source;
+    stream.avail_in = 0;
+    stream.zalloc = (alloc_func)0;
+    stream.zfree = (free_func)0;
+    stream.opaque = (voidpf)0;
+
+    err = inflateInit(&stream);
+    if (err != Z_OK) return err;
+
+    stream.next_out = dest;
+    stream.avail_out = 0;
+
+    do {
+        if (stream.avail_out == 0) {
+            stream.avail_out = left > (uLong)max ? max : (uInt)left;
+            left -= stream.avail_out;
+        }
+        if (stream.avail_in == 0) {
+            stream.avail_in = len > (uLong)max ? max : (uInt)len;
+            len -= stream.avail_in;
+        }
+        err = inflate(&stream, Z_NO_FLUSH);
+    } while (err == Z_OK);
+
+    *sourceLen -= len + stream.avail_in;
+    if (dest != buf)
+        *destLen = stream.total_out;
+    else if (stream.total_out && err == Z_BUF_ERROR)
+        left = 1;
+
+    inflateEnd(&stream);
+    return err == Z_STREAM_END ? Z_OK :
+           err == Z_NEED_DICT ? Z_DATA_ERROR  :
+           err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR :
+           err;
+}
+
+int ZEXPORT uncompress (dest, destLen, source, sourceLen)
+    Bytef *dest;
+    uLongf *destLen;
+    const Bytef *source;
+    uLong sourceLen;
+{
+    return uncompress2(dest, destLen, source, &sourceLen);
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib/zadler32.c b/jdk/src/java.base/share/native/libzip/zlib/zadler32.c
new file mode 100644
index 0000000..e148022
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/zadler32.c
@@ -0,0 +1,210 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-2011, 2016 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zutil.h"
+
+local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
+
+#define BASE 65521U     /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
+#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf)   DO8(buf,0); DO8(buf,8);
+
+/* use NO_DIVIDE if your processor does not do division in hardware --
+   try it both ways to see which is faster */
+#ifdef NO_DIVIDE
+/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
+   (thank you to John Reiser for pointing this out) */
+#  define CHOP(a) \
+    do { \
+        unsigned long tmp = a >> 16; \
+        a &= 0xffffUL; \
+        a += (tmp << 4) - tmp; \
+    } while (0)
+#  define MOD28(a) \
+    do { \
+        CHOP(a); \
+        if (a >= BASE) a -= BASE; \
+    } while (0)
+#  define MOD(a) \
+    do { \
+        CHOP(a); \
+        MOD28(a); \
+    } while (0)
+#  define MOD63(a) \
+    do { /* this assumes a is not negative */ \
+        z_off64_t tmp = a >> 32; \
+        a &= 0xffffffffL; \
+        a += (tmp << 8) - (tmp << 5) + tmp; \
+        tmp = a >> 16; \
+        a &= 0xffffL; \
+        a += (tmp << 4) - tmp; \
+        tmp = a >> 16; \
+        a &= 0xffffL; \
+        a += (tmp << 4) - tmp; \
+        if (a >= BASE) a -= BASE; \
+    } while (0)
+#else
+#  define MOD(a) a %= BASE
+#  define MOD28(a) a %= BASE
+#  define MOD63(a) a %= BASE
+#endif
+
+/* ========================================================================= */
+uLong ZEXPORT adler32_z(adler, buf, len)
+    uLong adler;
+    const Bytef *buf;
+    z_size_t len;
+{
+    unsigned long sum2;
+    unsigned n;
+
+    /* split Adler-32 into component sums */
+    sum2 = (adler >> 16) & 0xffff;
+    adler &= 0xffff;
+
+    /* in case user likes doing a byte at a time, keep it fast */
+    if (len == 1) {
+        adler += buf[0];
+        if (adler >= BASE)
+            adler -= BASE;
+        sum2 += adler;
+        if (sum2 >= BASE)
+            sum2 -= BASE;
+        return adler | (sum2 << 16);
+    }
+
+    /* initial Adler-32 value (deferred check for len == 1 speed) */
+    if (buf == Z_NULL)
+        return 1L;
+
+    /* in case short lengths are provided, keep it somewhat fast */
+    if (len < 16) {
+        while (len--) {
+            adler += *buf++;
+            sum2 += adler;
+        }
+        if (adler >= BASE)
+            adler -= BASE;
+        MOD28(sum2);            /* only added so many BASE's */
+        return adler | (sum2 << 16);
+    }
+
+    /* do length NMAX blocks -- requires just one modulo operation */
+    while (len >= NMAX) {
+        len -= NMAX;
+        n = NMAX / 16;          /* NMAX is divisible by 16 */
+        do {
+            DO16(buf);          /* 16 sums unrolled */
+            buf += 16;
+        } while (--n);
+        MOD(adler);
+        MOD(sum2);
+    }
+
+    /* do remaining bytes (less than NMAX, still just one modulo) */
+    if (len) {                  /* avoid modulos if none remaining */
+        while (len >= 16) {
+            len -= 16;
+            DO16(buf);
+            buf += 16;
+        }
+        while (len--) {
+            adler += *buf++;
+            sum2 += adler;
+        }
+        MOD(adler);
+        MOD(sum2);
+    }
+
+    /* return recombined sums */
+    return adler | (sum2 << 16);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT adler32(adler, buf, len)
+    uLong adler;
+    const Bytef *buf;
+    uInt len;
+{
+    return adler32_z(adler, buf, len);
+}
+
+/* ========================================================================= */
+local uLong adler32_combine_(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    z_off64_t len2;
+{
+    unsigned long sum1;
+    unsigned long sum2;
+    unsigned rem;
+
+    /* for negative len, return invalid adler32 as a clue for debugging */
+    if (len2 < 0)
+        return 0xffffffffUL;
+
+    /* the derivation of this formula is left as an exercise for the reader */
+    MOD63(len2);                /* assumes len2 >= 0 */
+    rem = (unsigned)len2;
+    sum1 = adler1 & 0xffff;
+    sum2 = rem * sum1;
+    MOD(sum2);
+    sum1 += (adler2 & 0xffff) + BASE - 1;
+    sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
+    if (sum1 >= BASE) sum1 -= BASE;
+    if (sum1 >= BASE) sum1 -= BASE;
+    if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1);
+    if (sum2 >= BASE) sum2 -= BASE;
+    return sum1 | (sum2 << 16);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT adler32_combine(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    z_off_t len2;
+{
+    return adler32_combine_(adler1, adler2, len2);
+}
+
+uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    z_off64_t len2;
+{
+    return adler32_combine_(adler1, adler2, len2);
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib/zconf.h b/jdk/src/java.base/share/native/libzip/zlib/zconf.h
new file mode 100644
index 0000000..9b92011
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/zconf.h
@@ -0,0 +1,566 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/* for _LP64 */
+#include <sys/types.h>
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
+#  define Z_PREFIX_SET
+
+/* all linked symbols and init macros */
+#  define _dist_code            z__dist_code
+#  define _length_code          z__length_code
+#  define _tr_align             z__tr_align
+#  define _tr_flush_bits        z__tr_flush_bits
+#  define _tr_flush_block       z__tr_flush_block
+#  define _tr_init              z__tr_init
+#  define _tr_stored_block      z__tr_stored_block
+#  define _tr_tally             z__tr_tally
+#  define adler32               z_adler32
+#  define adler32_combine       z_adler32_combine
+#  define adler32_combine64     z_adler32_combine64
+#  define adler32_z             z_adler32_z
+#  ifndef Z_SOLO
+#    define compress              z_compress
+#    define compress2             z_compress2
+#    define compressBound         z_compressBound
+#  endif
+#  define crc32                 z_crc32
+#  define crc32_combine         z_crc32_combine
+#  define crc32_combine64       z_crc32_combine64
+#  define crc32_z               z_crc32_z
+#  define deflate               z_deflate
+#  define deflateBound          z_deflateBound
+#  define deflateCopy           z_deflateCopy
+#  define deflateEnd            z_deflateEnd
+#  define deflateGetDictionary  z_deflateGetDictionary
+#  define deflateInit           z_deflateInit
+#  define deflateInit2          z_deflateInit2
+#  define deflateInit2_         z_deflateInit2_
+#  define deflateInit_          z_deflateInit_
+#  define deflateParams         z_deflateParams
+#  define deflatePending        z_deflatePending
+#  define deflatePrime          z_deflatePrime
+#  define deflateReset          z_deflateReset
+#  define deflateResetKeep      z_deflateResetKeep
+#  define deflateSetDictionary  z_deflateSetDictionary
+#  define deflateSetHeader      z_deflateSetHeader
+#  define deflateTune           z_deflateTune
+#  define deflate_copyright     z_deflate_copyright
+#  define get_crc_table         z_get_crc_table
+#  ifndef Z_SOLO
+#    define gz_error              z_gz_error
+#    define gz_intmax             z_gz_intmax
+#    define gz_strwinerror        z_gz_strwinerror
+#    define gzbuffer              z_gzbuffer
+#    define gzclearerr            z_gzclearerr
+#    define gzclose               z_gzclose
+#    define gzclose_r             z_gzclose_r
+#    define gzclose_w             z_gzclose_w
+#    define gzdirect              z_gzdirect
+#    define gzdopen               z_gzdopen
+#    define gzeof                 z_gzeof
+#    define gzerror               z_gzerror
+#    define gzflush               z_gzflush
+#    define gzfread               z_gzfread
+#    define gzfwrite              z_gzfwrite
+#    define gzgetc                z_gzgetc
+#    define gzgetc_               z_gzgetc_
+#    define gzgets                z_gzgets
+#    define gzoffset              z_gzoffset
+#    define gzoffset64            z_gzoffset64
+#    define gzopen                z_gzopen
+#    define gzopen64              z_gzopen64
+#    ifdef _WIN32
+#      define gzopen_w              z_gzopen_w
+#    endif
+#    define gzprintf              z_gzprintf
+#    define gzputc                z_gzputc
+#    define gzputs                z_gzputs
+#    define gzread                z_gzread
+#    define gzrewind              z_gzrewind
+#    define gzseek                z_gzseek
+#    define gzseek64              z_gzseek64
+#    define gzsetparams           z_gzsetparams
+#    define gztell                z_gztell
+#    define gztell64              z_gztell64
+#    define gzungetc              z_gzungetc
+#    define gzvprintf             z_gzvprintf
+#    define gzwrite               z_gzwrite
+#  endif
+#  define inflate               z_inflate
+#  define inflateBack           z_inflateBack
+#  define inflateBackEnd        z_inflateBackEnd
+#  define inflateBackInit       z_inflateBackInit
+#  define inflateBackInit_      z_inflateBackInit_
+#  define inflateCodesUsed      z_inflateCodesUsed
+#  define inflateCopy           z_inflateCopy
+#  define inflateEnd            z_inflateEnd
+#  define inflateGetDictionary  z_inflateGetDictionary
+#  define inflateGetHeader      z_inflateGetHeader
+#  define inflateInit           z_inflateInit
+#  define inflateInit2          z_inflateInit2
+#  define inflateInit2_         z_inflateInit2_
+#  define inflateInit_          z_inflateInit_
+#  define inflateMark           z_inflateMark
+#  define inflatePrime          z_inflatePrime
+#  define inflateReset          z_inflateReset
+#  define inflateReset2         z_inflateReset2
+#  define inflateResetKeep      z_inflateResetKeep
+#  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateSync           z_inflateSync
+#  define inflateSyncPoint      z_inflateSyncPoint
+#  define inflateUndermine      z_inflateUndermine
+#  define inflateValidate       z_inflateValidate
+#  define inflate_copyright     z_inflate_copyright
+#  define inflate_fast          z_inflate_fast
+#  define inflate_table         z_inflate_table
+#  ifndef Z_SOLO
+#    define uncompress            z_uncompress
+#    define uncompress2           z_uncompress2
+#  endif
+#  define zError                z_zError
+#  ifndef Z_SOLO
+#    define zcalloc               z_zcalloc
+#    define zcfree                z_zcfree
+#  endif
+#  define zlibCompileFlags      z_zlibCompileFlags
+#  define zlibVersion           z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+#  define Byte                  z_Byte
+#  define Bytef                 z_Bytef
+#  define alloc_func            z_alloc_func
+#  define charf                 z_charf
+#  define free_func             z_free_func
+#  ifndef Z_SOLO
+#    define gzFile                z_gzFile
+#  endif
+#  define gz_header             z_gz_header
+#  define gz_headerp            z_gz_headerp
+#  define in_func               z_in_func
+#  define intf                  z_intf
+#  define out_func              z_out_func
+#  define uInt                  z_uInt
+#  define uIntf                 z_uIntf
+#  define uLong                 z_uLong
+#  define uLongf                z_uLongf
+#  define voidp                 z_voidp
+#  define voidpc                z_voidpc
+#  define voidpf                z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+#  define gz_header_s           z_gz_header_s
+#  define internal_state        z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+#  define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+#  define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+#  define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+#  ifndef WIN32
+#    define WIN32
+#  endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+#    ifndef SYS16BIT
+#      define SYS16BIT
+#    endif
+#  endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+#  define MAXSEG_64K
+#endif
+#ifdef MSDOS
+#  define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+#  ifndef STDC
+#    define STDC
+#  endif
+#  if __STDC_VERSION__ >= 199901L
+#    ifndef STDC99
+#      define STDC99
+#    endif
+#  endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+#  define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
+#  define STDC
+#endif
+
+#ifndef STDC
+#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+#    define const       /* note: need a more gentle solution here */
+#  endif
+#endif
+
+#if defined(ZLIB_CONST) && !defined(z_const)
+#  define z_const const
+#else
+#  define z_const
+#endif
+
+#ifdef Z_SOLO
+   typedef unsigned long z_size_t;
+#else
+#  define z_longlong long long
+#  if defined(NO_SIZE_T)
+     typedef unsigned NO_SIZE_T z_size_t;
+#  elif defined(STDC)
+#    include <stddef.h>
+     typedef size_t z_size_t;
+#  else
+     typedef unsigned long z_size_t;
+#  endif
+#  undef z_longlong
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+#  ifdef MAXSEG_64K
+#    define MAX_MEM_LEVEL 8
+#  else
+#    define MAX_MEM_LEVEL 9
+#  endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+#  define MAX_WBITS   15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+            (1 << (windowBits+2)) +  (1 << (memLevel+9))
+ that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+   The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
+ for small objects.
+*/
+
+                        /* Type declarations */
+
+#ifndef OF /* function prototypes */
+#  ifdef STDC
+#    define OF(args)  args
+#  else
+#    define OF(args)  ()
+#  endif
+#endif
+
+#ifndef Z_ARG /* function prototypes for stdarg */
+#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#    define Z_ARG(args)  args
+#  else
+#    define Z_ARG(args)  ()
+#  endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+#  if defined(M_I86SM) || defined(M_I86MM)
+     /* MSC small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef _MSC_VER
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#  if (defined(__SMALL__) || defined(__MEDIUM__))
+     /* Turbo C small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef __BORLANDC__
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+   /* If building or using zlib as a DLL, define ZLIB_DLL.
+    * This is not mandatory, but it offers a little performance increase.
+    */
+#  ifdef ZLIB_DLL
+#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+#      ifdef ZLIB_INTERNAL
+#        define ZEXTERN extern __declspec(dllexport)
+#      else
+#        define ZEXTERN extern __declspec(dllimport)
+#      endif
+#    endif
+#  endif  /* ZLIB_DLL */
+   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+    * define ZLIB_WINAPI.
+    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+    */
+#  ifdef ZLIB_WINAPI
+#    ifdef FAR
+#      undef FAR
+#    endif
+#    include <windows.h>
+     /* No need for _export, use ZLIB.DEF instead. */
+     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+#    define ZEXPORT WINAPI
+#    ifdef WIN32
+#      define ZEXPORTVA WINAPIV
+#    else
+#      define ZEXPORTVA FAR CDECL
+#    endif
+#  endif
+#endif
+
+#if defined (__BEOS__)
+#  ifdef ZLIB_DLL
+#    ifdef ZLIB_INTERNAL
+#      define ZEXPORT   __declspec(dllexport)
+#      define ZEXPORTVA __declspec(dllexport)
+#    else
+#      define ZEXPORT   __declspec(dllimport)
+#      define ZEXPORTVA __declspec(dllimport)
+#    endif
+#  endif
+#endif
+
+#ifndef ZEXTERN
+#  define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+#  define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+#  define ZEXPORTVA
+#endif
+
+#ifndef FAR
+#  define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char  Byte;  /* 8 bits */
+#endif
+typedef unsigned int   uInt;  /* 16 bits or more */
+
+#ifdef _LP64
+typedef unsigned int  uLong;  /* 32 bits or more */
+#else
+typedef unsigned long  uLong; /* 32 bits or more */
+#endif
+
+#ifdef SMALL_MEDIUM
+   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+#  define Bytef Byte FAR
+#else
+   typedef Byte  FAR Bytef;
+#endif
+typedef char  FAR charf;
+typedef int   FAR intf;
+typedef uInt  FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+   typedef void const *voidpc;
+   typedef void FAR   *voidpf;
+   typedef void       *voidp;
+#else
+   typedef Byte const *voidpc;
+   typedef Byte FAR   *voidpf;
+   typedef Byte       *voidp;
+#endif
+
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+#  include <limits.h>
+#  if (UINT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned
+#  elif (ULONG_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned long
+#  elif (USHRT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned short
+#  endif
+#endif
+
+#ifdef Z_U4
+   typedef Z_U4 z_crc_t;
+#else
+   typedef unsigned long z_crc_t;
+#endif
+
+#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
+#  define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
+#  define Z_HAVE_STDARG_H
+#endif
+
+#ifdef STDC
+#  ifndef Z_SOLO
+#    include <sys/types.h>      /* for off_t */
+#  endif
+#endif
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifndef Z_SOLO
+#    include <stdarg.h>         /* for va_list */
+#  endif
+#endif
+
+#ifdef _WIN32
+#  ifndef Z_SOLO
+#    include <stddef.h>         /* for wchar_t */
+#  endif
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
+#  undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+#  define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+#    ifdef VMS
+#      include <unixio.h>       /* for off_t */
+#    endif
+#    ifndef z_off_t
+#      define z_off_t off_t
+#    endif
+#  endif
+#endif
+
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+#  define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+#  define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+#  define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
+#  define SEEK_SET        0       /* Seek from beginning of file.  */
+#  define SEEK_CUR        1       /* Seek from current position.  */
+#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+#  define z_off_t long
+#endif
+
+#if !defined(_WIN32) && defined(Z_LARGE64)
+#  define z_off64_t off64_t
+#else
+#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+#    define z_off64_t __int64
+#  else
+#    define z_off64_t z_off_t
+#  endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+  #pragma map(deflateInit_,"DEIN")
+  #pragma map(deflateInit2_,"DEIN2")
+  #pragma map(deflateEnd,"DEEND")
+  #pragma map(deflateBound,"DEBND")
+  #pragma map(inflateInit_,"ININ")
+  #pragma map(inflateInit2_,"ININ2")
+  #pragma map(inflateEnd,"INEND")
+  #pragma map(inflateSync,"INSY")
+  #pragma map(inflateSetDictionary,"INSEDI")
+  #pragma map(compressBound,"CMBND")
+  #pragma map(inflate_table,"INTABL")
+  #pragma map(inflate_fast,"INFA")
+  #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/jdk/src/java.base/share/native/libzip/zlib/zcrc32.c b/jdk/src/java.base/share/native/libzip/zlib/zcrc32.c
new file mode 100644
index 0000000..c1965fd
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/zcrc32.c
@@ -0,0 +1,466 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* crc32.c -- compute the CRC-32 of a data stream
+ * Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
+ * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
+ * tables for updating the shift register in one step with three exclusive-ors
+ * instead of four steps with four exclusive-ors.  This results in about a
+ * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
+ */
+
+/* @(#) $Id$ */
+
+/*
+  Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
+  protection on the static variables used to control the first-use generation
+  of the crc tables.  Therefore, if you #define DYNAMIC_CRC_TABLE, you should
+  first call get_crc_table() to initialize the tables before allowing more than
+  one thread to use crc32().
+
+  DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
+ */
+
+#ifdef MAKECRCH
+#  include <stdio.h>
+#  ifndef DYNAMIC_CRC_TABLE
+#    define DYNAMIC_CRC_TABLE
+#  endif /* !DYNAMIC_CRC_TABLE */
+#endif /* MAKECRCH */
+
+#include "zutil.h"      /* for STDC and FAR definitions */
+
+/* Definitions for doing the crc four data bytes at a time. */
+#if !defined(NOBYFOUR) && defined(Z_U4)
+#  define BYFOUR
+#endif
+#ifdef BYFOUR
+   local unsigned long crc32_little OF((unsigned long,
+                        const unsigned char FAR *, z_size_t));
+   local unsigned long crc32_big OF((unsigned long,
+                        const unsigned char FAR *, z_size_t));
+#  define TBLS 8
+#else
+#  define TBLS 1
+#endif /* BYFOUR */
+
+/* Local functions for crc concatenation */
+local unsigned long gf2_matrix_times OF((unsigned long *mat,
+                                         unsigned long vec));
+local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
+local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
+
+
+#ifdef DYNAMIC_CRC_TABLE
+
+local volatile int crc_table_empty = 1;
+local z_crc_t FAR crc_table[TBLS][256];
+local void make_crc_table OF((void));
+#ifdef MAKECRCH
+   local void write_table OF((FILE *, const z_crc_t FAR *));
+#endif /* MAKECRCH */
+/*
+  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
+  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
+
+  Polynomials over GF(2) are represented in binary, one bit per coefficient,
+  with the lowest powers in the most significant bit.  Then adding polynomials
+  is just exclusive-or, and multiplying a polynomial by x is a right shift by
+  one.  If we call the above polynomial p, and represent a byte as the
+  polynomial q, also with the lowest power in the most significant bit (so the
+  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
+  where a mod b means the remainder after dividing a by b.
+
+  This calculation is done using the shift-register method of multiplying and
+  taking the remainder.  The register is initialized to zero, and for each
+  incoming bit, x^32 is added mod p to the register if the bit is a one (where
+  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
+  x (which is shifting right by one and adding x^32 mod p if the bit shifted
+  out is a one).  We start with the highest power (least significant bit) of
+  q and repeat for all eight bits of q.
+
+  The first table is simply the CRC of all possible eight bit values.  This is
+  all the information needed to generate CRCs on data a byte at a time for all
+  combinations of CRC register values and incoming bytes.  The remaining tables
+  allow for word-at-a-time CRC calculation for both big-endian and little-
+  endian machines, where a word is four bytes.
+*/
+local void make_crc_table()
+{
+    z_crc_t c;
+    int n, k;
+    z_crc_t poly;                       /* polynomial exclusive-or pattern */
+    /* terms of polynomial defining this crc (except x^32): */
+    static volatile int first = 1;      /* flag to limit concurrent making */
+    static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+
+    /* See if another task is already doing this (not thread-safe, but better
+       than nothing -- significantly reduces duration of vulnerability in
+       case the advice about DYNAMIC_CRC_TABLE is ignored) */
+    if (first) {
+        first = 0;
+
+        /* make exclusive-or pattern from polynomial (0xedb88320UL) */
+        poly = 0;
+        for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
+            poly |= (z_crc_t)1 << (31 - p[n]);
+
+        /* generate a crc for every 8-bit value */
+        for (n = 0; n < 256; n++) {
+            c = (z_crc_t)n;
+            for (k = 0; k < 8; k++)
+                c = c & 1 ? poly ^ (c >> 1) : c >> 1;
+            crc_table[0][n] = c;
+        }
+
+#ifdef BYFOUR
+        /* generate crc for each value followed by one, two, and three zeros,
+           and then the byte reversal of those as well as the first table */
+        for (n = 0; n < 256; n++) {
+            c = crc_table[0][n];
+            crc_table[4][n] = ZSWAP32(c);
+            for (k = 1; k < 4; k++) {
+                c = crc_table[0][c & 0xff] ^ (c >> 8);
+                crc_table[k][n] = c;
+                crc_table[k + 4][n] = ZSWAP32(c);
+            }
+        }
+#endif /* BYFOUR */
+
+        crc_table_empty = 0;
+    }
+    else {      /* not first */
+        /* wait for the other guy to finish (not efficient, but rare) */
+        while (crc_table_empty)
+            ;
+    }
+
+#ifdef MAKECRCH
+    /* write out CRC tables to crc32.h */
+    {
+        FILE *out;
+
+        out = fopen("crc32.h", "w");
+        if (out == NULL) return;
+        fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
+        fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
+        fprintf(out, "local const z_crc_t FAR ");
+        fprintf(out, "crc_table[TBLS][256] =\n{\n  {\n");
+        write_table(out, crc_table[0]);
+#  ifdef BYFOUR
+        fprintf(out, "#ifdef BYFOUR\n");
+        for (k = 1; k < 8; k++) {
+            fprintf(out, "  },\n  {\n");
+            write_table(out, crc_table[k]);
+        }
+        fprintf(out, "#endif\n");
+#  endif /* BYFOUR */
+        fprintf(out, "  }\n};\n");
+        fclose(out);
+    }
+#endif /* MAKECRCH */
+}
+
+#ifdef MAKECRCH
+local void write_table(out, table)
+    FILE *out;
+    const z_crc_t FAR *table;
+{
+    int n;
+
+    for (n = 0; n < 256; n++)
+        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ",
+                (unsigned long)(table[n]),
+                n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
+}
+#endif /* MAKECRCH */
+
+#else /* !DYNAMIC_CRC_TABLE */
+/* ========================================================================
+ * Tables of CRC-32s of all single-byte values, made by make_crc_table().
+ */
+#include "crc32.h"
+#endif /* DYNAMIC_CRC_TABLE */
+
+/* =========================================================================
+ * This function can be used by asm versions of crc32()
+ */
+const z_crc_t FAR * ZEXPORT get_crc_table()
+{
+#ifdef DYNAMIC_CRC_TABLE
+    if (crc_table_empty)
+        make_crc_table();
+#endif /* DYNAMIC_CRC_TABLE */
+    return (const z_crc_t FAR *)crc_table;
+}
+
+/* ========================================================================= */
+#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
+#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_z(crc, buf, len)
+    uLong crc;
+    const unsigned char FAR *buf;
+    z_size_t len;
+{
+    if (buf == Z_NULL) return 0UL;
+
+#ifdef DYNAMIC_CRC_TABLE
+    if (crc_table_empty)
+        make_crc_table();
+#endif /* DYNAMIC_CRC_TABLE */
+
+#ifdef BYFOUR
+    if (sizeof(void *) == sizeof(ptrdiff_t)) {
+        z_crc_t endian;
+
+        endian = 1;
+        if (*((unsigned char *)(&endian)))
+            return (uLong)crc32_little(crc, buf, len);
+        else
+            return (uLong)crc32_big(crc, buf, len);
+    }
+#endif /* BYFOUR */
+    crc = crc ^ 0xffffffffUL;
+    while (len >= 8) {
+        DO8;
+        len -= 8;
+    }
+    if (len) do {
+        DO1;
+    } while (--len);
+    return crc ^ 0xffffffffUL;
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32(crc, buf, len)
+    uLong crc;
+    const unsigned char FAR *buf;
+    uInt len;
+{
+    return crc32_z(crc, buf, len);
+}
+
+#ifdef BYFOUR
+
+/*
+   This BYFOUR code accesses the passed unsigned char * buffer with a 32-bit
+   integer pointer type. This violates the strict aliasing rule, where a
+   compiler can assume, for optimization purposes, that two pointers to
+   fundamentally different types won't ever point to the same memory. This can
+   manifest as a problem only if one of the pointers is written to. This code
+   only reads from those pointers. So long as this code remains isolated in
+   this compilation unit, there won't be a problem. For this reason, this code
+   should not be copied and pasted into a compilation unit in which other code
+   writes to the buffer that is passed to these routines.
+ */
+
+/* ========================================================================= */
+#define DOLIT4 c ^= *buf4++; \
+        c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
+            crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
+#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
+
+/* ========================================================================= */
+local unsigned long crc32_little(crc, buf, len)
+    unsigned long crc;
+    const unsigned char FAR *buf;
+    z_size_t len;
+{
+    register z_crc_t c;
+    register const z_crc_t FAR *buf4;
+
+    c = (z_crc_t)crc;
+    c = ~c;
+    while (len && ((ptrdiff_t)buf & 3)) {
+        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+        len--;
+    }
+
+    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
+    while (len >= 32) {
+        DOLIT32;
+        len -= 32;
+    }
+    while (len >= 4) {
+        DOLIT4;
+        len -= 4;
+    }
+    buf = (const unsigned char FAR *)buf4;
+
+    if (len) do {
+        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+    } while (--len);
+    c = ~c;
+    return (unsigned long)c;
+}
+
+/* ========================================================================= */
+#define DOBIG4 c ^= *buf4++; \
+        c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
+            crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
+#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
+
+/* ========================================================================= */
+local unsigned long crc32_big(crc, buf, len)
+    unsigned long crc;
+    const unsigned char FAR *buf;
+    z_size_t len;
+{
+    register z_crc_t c;
+    register const z_crc_t FAR *buf4;
+
+    c = ZSWAP32((z_crc_t)crc);
+    c = ~c;
+    while (len && ((ptrdiff_t)buf & 3)) {
+        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+        len--;
+    }
+
+    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
+    while (len >= 32) {
+        DOBIG32;
+        len -= 32;
+    }
+    while (len >= 4) {
+        DOBIG4;
+        len -= 4;
+    }
+    buf = (const unsigned char FAR *)buf4;
+
+    if (len) do {
+        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+    } while (--len);
+    c = ~c;
+    return (unsigned long)(ZSWAP32(c));
+}
+
+#endif /* BYFOUR */
+
+#define GF2_DIM 32      /* dimension of GF(2) vectors (length of CRC) */
+
+/* ========================================================================= */
+local unsigned long gf2_matrix_times(mat, vec)
+    unsigned long *mat;
+    unsigned long vec;
+{
+    unsigned long sum;
+
+    sum = 0;
+    while (vec) {
+        if (vec & 1)
+            sum ^= *mat;
+        vec >>= 1;
+        mat++;
+    }
+    return sum;
+}
+
+/* ========================================================================= */
+local void gf2_matrix_square(square, mat)
+    unsigned long *square;
+    unsigned long *mat;
+{
+    int n;
+
+    for (n = 0; n < GF2_DIM; n++)
+        square[n] = gf2_matrix_times(mat, mat[n]);
+}
+
+/* ========================================================================= */
+local uLong crc32_combine_(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    z_off64_t len2;
+{
+    int n;
+    unsigned long row;
+    unsigned long even[GF2_DIM];    /* even-power-of-two zeros operator */
+    unsigned long odd[GF2_DIM];     /* odd-power-of-two zeros operator */
+
+    /* degenerate case (also disallow negative lengths) */
+    if (len2 <= 0)
+        return crc1;
+
+    /* put operator for one zero bit in odd */
+    odd[0] = 0xedb88320UL;          /* CRC-32 polynomial */
+    row = 1;
+    for (n = 1; n < GF2_DIM; n++) {
+        odd[n] = row;
+        row <<= 1;
+    }
+
+    /* put operator for two zero bits in even */
+    gf2_matrix_square(even, odd);
+
+    /* put operator for four zero bits in odd */
+    gf2_matrix_square(odd, even);
+
+    /* apply len2 zeros to crc1 (first square will put the operator for one
+       zero byte, eight zero bits, in even) */
+    do {
+        /* apply zeros operator for this bit of len2 */
+        gf2_matrix_square(even, odd);
+        if (len2 & 1)
+            crc1 = gf2_matrix_times(even, crc1);
+        len2 >>= 1;
+
+        /* if no more bits set, then done */
+        if (len2 == 0)
+            break;
+
+        /* another iteration of the loop with odd and even swapped */
+        gf2_matrix_square(odd, even);
+        if (len2 & 1)
+            crc1 = gf2_matrix_times(odd, crc1);
+        len2 >>= 1;
+
+        /* if no more bits set, then done */
+    } while (len2 != 0);
+
+    /* return combined crc */
+    crc1 ^= crc2;
+    return crc1;
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    z_off_t len2;
+{
+    return crc32_combine_(crc1, crc2, len2);
+}
+
+uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    z_off64_t len2;
+{
+    return crc32_combine_(crc1, crc2, len2);
+}
diff --git a/jdk/src/java.base/share/native/libzip/zlib/zlib.h b/jdk/src/java.base/share/native/libzip/zlib/zlib.h
new file mode 100644
index 0000000..e383d0e
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/zlib.h
@@ -0,0 +1,1936 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.11, January 15th, 2017
+
+  Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+
+  The data format used by the zlib library is described by RFCs (Request for
+  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
+  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.11"
+#define ZLIB_VERNUM 0x12b0
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 11
+#define ZLIB_VER_SUBREVISION 0
+
+/*
+    The 'zlib' compression library provides in-memory compression and
+  decompression functions, including integrity checks of the uncompressed data.
+  This version of the library supports only one compression method (deflation)
+  but other algorithms will be added later and will have the same stream
+  interface.
+
+    Compression can be done in a single step if the buffers are large enough,
+  or can be done by repeated calls of the compression function.  In the latter
+  case, the application must provide more input and/or consume the output
+  (providing more output space) before each call.
+
+    The compressed data format used by default by the in-memory functions is
+  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+  around a deflate stream, which is itself documented in RFC 1951.
+
+    The library also supports reading and writing files in gzip (.gz) format
+  with an interface similar to that of stdio using the functions that start
+  with "gz".  The gzip format is different from the zlib format.  gzip is a
+  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+    This library can optionally read and write gzip and raw deflate streams in
+  memory as well.
+
+    The zlib format was designed to be compact and fast for use in memory
+  and on communications channels.  The gzip format was designed for single-
+  file compression on file systems, has a larger header than zlib to maintain
+  directory information, and uses a different, slower check method than zlib.
+
+    The library does not install any signal handler.  The decoder checks
+  the consistency of the compressed data, so the library should never crash
+  even in the case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+    z_const Bytef *next_in;     /* next input byte */
+    uInt     avail_in;  /* number of bytes available at next_in */
+    uLong    total_in;  /* total number of input bytes read so far */
+
+    Bytef    *next_out; /* next output byte will go here */
+    uInt     avail_out; /* remaining free space at next_out */
+    uLong    total_out; /* total number of bytes output so far */
+
+    z_const char *msg;  /* last error message, NULL if no error */
+    struct internal_state FAR *state; /* not visible by applications */
+
+    alloc_func zalloc;  /* used to allocate the internal state */
+    free_func  zfree;   /* used to free the internal state */
+    voidpf     opaque;  /* private data object passed to zalloc and zfree */
+
+    int     data_type;  /* best guess about the data type: binary or text
+                           for deflate, or the decoding state for inflate */
+    uLong   adler;      /* Adler-32 or CRC-32 value of the uncompressed data */
+    uLong   reserved;   /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+     gzip header information passed to and from zlib routines.  See RFC 1952
+  for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+    int     text;       /* true if compressed data believed to be text */
+    uLong   time;       /* modification time */
+    int     xflags;     /* extra flags (not used when writing a gzip file) */
+    int     os;         /* operating system */
+    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
+    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
+    uInt    extra_max;  /* space at extra (only when reading header) */
+    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
+    uInt    name_max;   /* space at name (only when reading header) */
+    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
+    uInt    comm_max;   /* space at comment (only when reading header) */
+    int     hcrc;       /* true if there was or will be a header crc */
+    int     done;       /* true when done reading gzip header (not used
+                           when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+     The application must update next_in and avail_in when avail_in has dropped
+   to zero.  It must update next_out and avail_out when avail_out has dropped
+   to zero.  The application must initialize zalloc, zfree and opaque before
+   calling the init function.  All other fields are set by the compression
+   library and must not be updated by the application.
+
+     The opaque value provided by the application will be passed as the first
+   parameter for calls of zalloc and zfree.  This can be useful for custom
+   memory management.  The compression library attaches no meaning to the
+   opaque value.
+
+     zalloc must return Z_NULL if there is not enough memory for the object.
+   If zlib is used in a multi-threaded application, zalloc and zfree must be
+   thread safe.  In that case, zlib is thread-safe.  When zalloc and zfree are
+   Z_NULL on entry to the initialization function, they are set to internal
+   routines that use the standard library functions malloc() and free().
+
+     On 16-bit systems, the functions zalloc and zfree must be able to allocate
+   exactly 65536 bytes, but will not be required to allocate more than this if
+   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers
+   returned by zalloc for objects of exactly 65536 bytes *must* have their
+   offset normalized to zero.  The default allocation function provided by this
+   library ensures this (see zutil.c).  To reduce memory requirements and avoid
+   any allocation of 64K objects, at the expense of compression ratio, compile
+   the library with -DMAX_WBITS=14 (see zconf.h).
+
+     The fields total_in and total_out can be used for statistics or progress
+   reports.  After compression, total_in holds the total size of the
+   uncompressed data and may be saved for use by the decompressor (particularly
+   if the decompressor wants to decompress everything in a single step).
+*/
+
+                        /* constants */
+
+#define Z_NO_FLUSH      0
+#define Z_PARTIAL_FLUSH 1
+#define Z_SYNC_FLUSH    2
+#define Z_FULL_FLUSH    3
+#define Z_FINISH        4
+#define Z_BLOCK         5
+#define Z_TREES         6
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK            0
+#define Z_STREAM_END    1
+#define Z_NEED_DICT     2
+#define Z_ERRNO        (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR   (-3)
+#define Z_MEM_ERROR    (-4)
+#define Z_BUF_ERROR    (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION         0
+#define Z_BEST_SPEED             1
+#define Z_BEST_COMPRESSION       9
+#define Z_DEFAULT_COMPRESSION  (-1)
+/* compression levels */
+
+#define Z_FILTERED            1
+#define Z_HUFFMAN_ONLY        2
+#define Z_RLE                 3
+#define Z_FIXED               4
+#define Z_DEFAULT_STRATEGY    0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY   0
+#define Z_TEXT     1
+#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN  2
+/* Possible values of the data_type field for deflate() */
+
+#define Z_DEFLATED   8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+
+                        /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+   If the first character differs, the library code actually used is not
+   compatible with the zlib.h header file used by the application.  This check
+   is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+     Initializes the internal stream state for compression.  The fields
+   zalloc, zfree and opaque must be initialized before by the caller.  If
+   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
+   allocation functions.
+
+     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+   1 gives best speed, 9 gives best compression, 0 gives no compression at all
+   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION
+   requests a default compromise between speed and compression (currently
+   equivalent to level 6).
+
+     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if level is not a valid compression level, or
+   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null
+   if there is no error message.  deflateInit does not perform any compression:
+   this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+    deflate compresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+    The detailed semantics are as follows.  deflate performs one or both of the
+  following actions:
+
+  - Compress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), next_in and avail_in are updated and
+    processing will resume at this point for the next call of deflate().
+
+  - Generate more output starting at next_out and update next_out and avail_out
+    accordingly.  This action is forced if the parameter flush is non zero.
+    Forcing flush frequently degrades the compression ratio, so this parameter
+    should be set only when necessary.  Some output may be provided even if
+    flush is zero.
+
+    Before the call of deflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating avail_in or avail_out accordingly; avail_out should
+  never be zero before the call.  The application can consume the compressed
+  output when it wants, for example when the output buffer is full (avail_out
+  == 0), or after each call of deflate().  If deflate returns Z_OK and with
+  zero avail_out, it must be called again after making room in the output
+  buffer because there might be more output pending. See deflatePending(),
+  which can be used if desired to determine whether or not there is more ouput
+  in that case.
+
+    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+  decide how much data to accumulate before producing output, in order to
+  maximize compression.
+
+    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+  flushed to the output buffer and the output is aligned on a byte boundary, so
+  that the decompressor can get all input data available so far.  (In
+  particular avail_in is zero after the call if enough output space has been
+  provided before the call.) Flushing may degrade compression for some
+  compression algorithms and so it should be used only when necessary.  This
+  completes the current deflate block and follows it with an empty stored block
+  that is three bits plus filler bits to the next byte, followed by four bytes
+  (00 00 ff ff).
+
+    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
+  output buffer, but the output is not aligned to a byte boundary.  All of the
+  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
+  This completes the current deflate block and follows it with an empty fixed
+  codes block that is 10 bits long.  This assures that enough bytes are output
+  in order for the decompressor to finish the block before the empty fixed
+  codes block.
+
+    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
+  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
+  seven bits of the current block are held to be written as the next byte after
+  the next deflate block is completed.  In this case, the decompressor may not
+  be provided enough bits at this point in order to complete decompression of
+  the data provided so far to the compressor.  It may need to wait for the next
+  block to be emitted.  This is for advanced applications that need to control
+  the emission of deflate blocks.
+
+    If flush is set to Z_FULL_FLUSH, all output is flushed as with
+  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+  restart from this point if previous compressed data has been damaged or if
+  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade
+  compression.
+
+    If deflate returns with avail_out == 0, this function must be called again
+  with the same value of the flush parameter and more output space (updated
+  avail_out), until the flush is complete (deflate returns with non-zero
+  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+  avail_out is greater than six to avoid repeated flush markers due to
+  avail_out == 0 on return.
+
+    If the parameter flush is set to Z_FINISH, pending input is processed,
+  pending output is flushed and deflate returns with Z_STREAM_END if there was
+  enough output space.  If deflate returns with Z_OK or Z_BUF_ERROR, this
+  function must be called again with Z_FINISH and more output space (updated
+  avail_out) but no more input data, until it returns with Z_STREAM_END or an
+  error.  After deflate has returned Z_STREAM_END, the only possible operations
+  on the stream are deflateReset or deflateEnd.
+
+    Z_FINISH can be used in the first deflate call after deflateInit if all the
+  compression is to be done in a single step.  In order to complete in one
+  call, avail_out must be at least the value returned by deflateBound (see
+  below).  Then deflate is guaranteed to return Z_STREAM_END.  If not enough
+  output space is provided, deflate will not return Z_STREAM_END, and it must
+  be called again as described above.
+
+    deflate() sets strm->adler to the Adler-32 checksum of all input read
+  so far (that is, total_in bytes).  If a gzip stream is being generated, then
+  strm->adler will be the CRC-32 checksum of the input read so far.  (See
+  deflateInit2 below.)
+
+    deflate() may update strm->data_type if it can make a good guess about
+  the input data type (Z_BINARY or Z_TEXT).  If in doubt, the data is
+  considered binary.  This field is only for information purposes and does not
+  affect the compression algorithm in any manner.
+
+    deflate() returns Z_OK if some progress has been made (more input
+  processed or more output produced), Z_STREAM_END if all input has been
+  consumed and all output has been produced (only when flush is set to
+  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+  if next_in or next_out was Z_NULL or the state was inadvertently written over
+  by the application), or Z_BUF_ERROR if no progress is possible (for example
+  avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not fatal, and
+  deflate() can be called again with more input and more output space to
+  continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+   prematurely (some input or output was discarded).  In the error case, msg
+   may be set but then points to a static string (which must not be
+   deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+     Initializes the internal stream state for decompression.  The fields
+   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+   the caller.  In the current version of inflate, the provided input is not
+   read or consumed.  The allocation of a sliding window will be deferred to
+   the first call of inflate (if the decompression does not complete on the
+   first call).  If zalloc and zfree are set to Z_NULL, inflateInit updates
+   them to use default allocation functions.
+
+     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit does not perform any decompression.
+   Actual decompression will be done by inflate().  So next_in, and avail_in,
+   next_out, and avail_out are unused and unchanged.  The current
+   implementation of inflateInit() does not process any header information --
+   that is deferred until inflate() is called.
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+    inflate decompresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+  The detailed semantics are as follows.  inflate performs one or both of the
+  following actions:
+
+  - Decompress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), then next_in and avail_in are updated
+    accordingly, and processing will resume at this point for the next call of
+    inflate().
+
+  - Generate more output starting at next_out and update next_out and avail_out
+    accordingly.  inflate() provides as much output as possible, until there is
+    no more input data or no more space in the output buffer (see below about
+    the flush parameter).
+
+    Before the call of inflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating the next_* and avail_* values accordingly.  If the
+  caller of inflate() does not provide both available input and available
+  output space, it is possible that there will be no progress made.  The
+  application can consume the uncompressed output when it wants, for example
+  when the output buffer is full (avail_out == 0), or after each call of
+  inflate().  If inflate returns Z_OK and with zero avail_out, it must be
+  called again after making room in the output buffer because there might be
+  more output pending.
+
+    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
+  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much
+  output as possible to the output buffer.  Z_BLOCK requests that inflate()
+  stop if and when it gets to the next deflate block boundary.  When decoding
+  the zlib or gzip format, this will cause inflate() to return immediately
+  after the header and before the first block.  When doing a raw inflate,
+  inflate() will go ahead and process the first block, and will return when it
+  gets to the end of that block, or when it runs out of data.
+
+    The Z_BLOCK option assists in appending to or combining deflate streams.
+  To assist in this, on return inflate() always sets strm->data_type to the
+  number of unused bits in the last byte taken from strm->next_in, plus 64 if
+  inflate() is currently decoding the last block in the deflate stream, plus
+  128 if inflate() returned immediately after decoding an end-of-block code or
+  decoding the complete header up to just before the first byte of the deflate
+  stream.  The end-of-block will not be indicated until all of the uncompressed
+  data from that block has been written to strm->next_out.  The number of
+  unused bits may in general be greater than seven, except when bit 7 of
+  data_type is set, in which case the number of unused bits will be less than
+  eight.  data_type is set as noted here every time inflate() returns for all
+  flush options, and so can be used to determine the amount of currently
+  consumed input in bits.
+
+    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
+  end of each deflate block header is reached, before any actual data in that
+  block is decoded.  This allows the caller to determine the length of the
+  deflate block header for later use in random access within a deflate block.
+  256 is added to the value of strm->data_type when inflate() returns
+  immediately after reaching the end of the deflate block header.
+
+    inflate() should normally be called until it returns Z_STREAM_END or an
+  error.  However if all decompression is to be performed in a single step (a
+  single call of inflate), the parameter flush should be set to Z_FINISH.  In
+  this case all pending input is processed and all pending output is flushed;
+  avail_out must be large enough to hold all of the uncompressed data for the
+  operation to complete.  (The size of the uncompressed data may have been
+  saved by the compressor for this purpose.)  The use of Z_FINISH is not
+  required to perform an inflation in one step.  However it may be used to
+  inform inflate that a faster approach can be used for the single inflate()
+  call.  Z_FINISH also informs inflate to not maintain a sliding window if the
+  stream completes, which reduces inflate's memory footprint.  If the stream
+  does not complete, either because not all of the stream is provided or not
+  enough output space is provided, then a sliding window will be allocated and
+  inflate() can be called again to continue the operation as if Z_NO_FLUSH had
+  been used.
+
+     In this implementation, inflate() always flushes as much output as
+  possible to the output buffer, and always uses the faster approach on the
+  first call.  So the effects of the flush parameter in this implementation are
+  on the return value of inflate() as noted below, when inflate() returns early
+  when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
+  memory for a sliding window when Z_FINISH is used.
+
+     If a preset dictionary is needed after this call (see inflateSetDictionary
+  below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
+  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+  strm->adler to the Adler-32 checksum of all output produced so far (that is,
+  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+  below.  At the end of the stream, inflate() checks that its computed Adler-32
+  checksum is equal to that saved by the compressor and returns Z_STREAM_END
+  only if the checksum is correct.
+
+    inflate() can decompress and check either zlib-wrapped or gzip-wrapped
+  deflate data.  The header type is detected automatically, if requested when
+  initializing with inflateInit2().  Any information contained in the gzip
+  header is not retained unless inflateGetHeader() is used.  When processing
+  gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
+  produced so far.  The CRC-32 is checked against the gzip trailer, as is the
+  uncompressed length, modulo 2^32.
+
+    inflate() returns Z_OK if some progress has been made (more input processed
+  or more output produced), Z_STREAM_END if the end of the compressed data has
+  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+  corrupted (input stream not conforming to the zlib format or incorrect check
+  value, in which case strm->msg points to a string with a more specific
+  error), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+  next_in or next_out was Z_NULL, or the state was inadvertently written over
+  by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR
+  if no progress was possible or if there was not enough room in the output
+  buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and
+  inflate() can be called again with more input and more output space to
+  continue decompressing.  If Z_DATA_ERROR is returned, the application may
+  then call inflateSync() to look for a good compression block if a partial
+  recovery of the data is to be attempted.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state
+   was inconsistent.
+*/
+
+
+                        /* Advanced functions */
+
+/*
+    The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+                                     int  level,
+                                     int  method,
+                                     int  windowBits,
+                                     int  memLevel,
+                                     int  strategy));
+
+     This is another version of deflateInit with more compression options.  The
+   fields next_in, zalloc, zfree and opaque must be initialized before by the
+   caller.
+
+     The method parameter is the compression method.  It must be Z_DEFLATED in
+   this version of the library.
+
+     The windowBits parameter is the base two logarithm of the window size
+   (the size of the history buffer).  It should be in the range 8..15 for this
+   version of the library.  Larger values of this parameter result in better
+   compression at the expense of memory usage.  The default value is 15 if
+   deflateInit is used instead.
+
+     For the current implementation of deflate(), a windowBits value of 8 (a
+   window size of 256 bytes) is not supported.  As a result, a request for 8
+   will result in 9 (a 512-byte window).  In that case, providing 8 to
+   inflateInit2() will result in an error when the zlib header with 9 is
+   checked against the initialization of inflate().  The remedy is to not use 8
+   with deflateInit2() with this initialization, or at least in that case use 9
+   with inflateInit2().
+
+     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits
+   determines the window size.  deflate() will then generate raw deflate data
+   with no zlib header or trailer, and will not compute a check value.
+
+     windowBits can also be greater than 15 for optional gzip encoding.  Add
+   16 to windowBits to write a simple gzip header and trailer around the
+   compressed data instead of a zlib wrapper.  The gzip header will have no
+   file name, no extra data, no comment, no modification time (set to zero), no
+   header crc, and the operating system will be set to the appropriate value,
+   if the operating system was determined at compile time.  If a gzip stream is
+   being written, strm->adler is a CRC-32 instead of an Adler-32.
+
+     For raw deflate or gzip encoding, a request for a 256-byte window is
+   rejected as invalid, since only the zlib header provides a means of
+   transmitting the window size to the decompressor.
+
+     The memLevel parameter specifies how much memory should be allocated
+   for the internal compression state.  memLevel=1 uses minimum memory but is
+   slow and reduces compression ratio; memLevel=9 uses maximum memory for
+   optimal speed.  The default value is 8.  See zconf.h for total memory usage
+   as a function of windowBits and memLevel.
+
+     The strategy parameter is used to tune the compression algorithm.  Use the
+   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+   string match), or Z_RLE to limit match distances to one (run-length
+   encoding).  Filtered data consists mostly of small values with a somewhat
+   random distribution.  In this case, the compression algorithm is tuned to
+   compress them better.  The effect of Z_FILTERED is to force more Huffman
+   coding and less string matching; it is somewhat intermediate between
+   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as
+   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The
+   strategy parameter only affects the compression ratio but not the
+   correctness of the compressed output even if it is not set appropriately.
+   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
+   decoder for special applications.
+
+     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
+   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
+   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is
+   set to null if there is no error message.  deflateInit2 does not perform any
+   compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the compression dictionary from the given byte sequence
+   without producing any compressed output.  When using the zlib format, this
+   function must be called immediately after deflateInit, deflateInit2 or
+   deflateReset, and before any call of deflate.  When doing raw deflate, this
+   function must be called either before any call of deflate, or immediately
+   after the completion of a deflate block, i.e. after all input has been
+   consumed and all output has been delivered when using any of the flush
+   options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH.  The
+   compressor and decompressor must use exactly the same dictionary (see
+   inflateSetDictionary).
+
+     The dictionary should consist of strings (byte sequences) that are likely
+   to be encountered later in the data to be compressed, with the most commonly
+   used strings preferably put towards the end of the dictionary.  Using a
+   dictionary is most useful when the data to be compressed is short and can be
+   predicted with good accuracy; the data can then be compressed better than
+   with the default empty dictionary.
+
+     Depending on the size of the compression data structures selected by
+   deflateInit or deflateInit2, a part of the dictionary may in effect be
+   discarded, for example if the dictionary is larger than the window size
+   provided in deflateInit or deflateInit2.  Thus the strings most likely to be
+   useful should be put at the end of the dictionary, not at the front.  In
+   addition, the current implementation of deflate will use at most the window
+   size minus 262 bytes of the provided dictionary.
+
+     Upon return of this function, strm->adler is set to the Adler-32 value
+   of the dictionary; the decompressor may later use this value to determine
+   which dictionary has been used by the compressor.  (The Adler-32 value
+   applies to the whole dictionary even if only a subset of the dictionary is
+   actually used by the compressor.) If a raw deflate was requested, then the
+   Adler-32 value is not computed and strm->adler is not set.
+
+     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent (for example if deflate has already been called for this stream
+   or if not at a block boundary for raw deflate).  deflateSetDictionary does
+   not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
+                                             Bytef *dictionary,
+                                             uInt  *dictLength));
+/*
+     Returns the sliding dictionary being maintained by deflate.  dictLength is
+   set to the number of bytes in the dictionary, and that many bytes are copied
+   to dictionary.  dictionary must have enough space, where 32768 bytes is
+   always enough.  If deflateGetDictionary() is called with dictionary equal to
+   Z_NULL, then only the dictionary length is returned, and nothing is copied.
+   Similary, if dictLength is Z_NULL, then it is not set.
+
+     deflateGetDictionary() may return a length less than the window size, even
+   when more than the window size in input has been provided. It may return up
+   to 258 bytes less in that case, due to how zlib's implementation of deflate
+   manages the sliding window and lookahead for matches, where matches can be
+   up to 258 bytes long. If the application needs the last window-size bytes of
+   input, then that would need to be saved by the application outside of zlib.
+
+     deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
+   stream state is inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when several compression strategies will be
+   tried, for example when there are several ways of pre-processing the input
+   data with a filter.  The streams that will be discarded should then be freed
+   by calling deflateEnd.  Note that deflateCopy duplicates the internal
+   compression state which can be quite large, so this strategy is slow and can
+   consume lots of memory.
+
+     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to deflateEnd followed by deflateInit, but
+   does not free and reallocate the internal compression state.  The stream
+   will leave the compression level and any other attributes that may have been
+   set unchanged.
+
+     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+                                      int level,
+                                      int strategy));
+/*
+     Dynamically update the compression level and compression strategy.  The
+   interpretation of level and strategy is as in deflateInit2().  This can be
+   used to switch between compression and straight copy of the input data, or
+   to switch to a different kind of input data requiring a different strategy.
+   If the compression approach (which is a function of the level) or the
+   strategy is changed, and if any input has been consumed in a previous
+   deflate() call, then the input available so far is compressed with the old
+   level and strategy using deflate(strm, Z_BLOCK).  There are three approaches
+   for the compression levels 0, 1..3, and 4..9 respectively.  The new level
+   and strategy will take effect at the next call of deflate().
+
+     If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
+   not have enough output space to complete, then the parameter change will not
+   take effect.  In this case, deflateParams() can be called again with the
+   same parameters and more output space to try again.
+
+     In order to assure a change in the parameters on the first try, the
+   deflate stream should be flushed using deflate() with Z_BLOCK or other flush
+   request until strm.avail_out is not zero, before calling deflateParams().
+   Then no more input data should be provided before the deflateParams() call.
+   If this is done, the old level and strategy will be applied to the data
+   compressed before deflateParams(), and the new level and strategy will be
+   applied to the the data compressed after deflateParams().
+
+     deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream
+   state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if
+   there was not enough output space to complete the compression of the
+   available input data before a change in the strategy or approach.  Note that
+   in the case of a Z_BUF_ERROR, the parameters are not changed.  A return
+   value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be
+   retried with more output space.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+                                    int good_length,
+                                    int max_lazy,
+                                    int nice_length,
+                                    int max_chain));
+/*
+     Fine tune deflate's internal compression parameters.  This should only be
+   used by someone who understands the algorithm used by zlib's deflate for
+   searching for the best matching string, and even then only by the most
+   fanatic optimizer trying to squeeze out the last compressed bit for their
+   specific input data.  Read the deflate.c source code for the meaning of the
+   max_lazy, good_length, nice_length, and max_chain parameters.
+
+     deflateTune() can be called after deflateInit() or deflateInit2(), and
+   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+                                       uLong sourceLen));
+/*
+     deflateBound() returns an upper bound on the compressed size after
+   deflation of sourceLen bytes.  It must be called after deflateInit() or
+   deflateInit2(), and after deflateSetHeader(), if used.  This would be used
+   to allocate an output buffer for deflation in a single pass, and so would be
+   called before deflate().  If that first deflate() call is provided the
+   sourceLen input bytes, an output buffer allocated to the size returned by
+   deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
+   to return Z_STREAM_END.  Note that it is possible for the compressed size to
+   be larger than the value returned by deflateBound() if flush options other
+   than Z_FINISH or Z_NO_FLUSH are used.
+*/
+
+ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
+                                       unsigned *pending,
+                                       int *bits));
+/*
+     deflatePending() returns the number of bytes and bits of output that have
+   been generated, but not yet provided in the available output.  The bytes not
+   provided would be due to the available output space having being consumed.
+   The number of bits of output not provided are between 0 and 7, where they
+   await more bits to join them in order to fill out a full byte.  If pending
+   or bits are Z_NULL, then those values are not set.
+
+     deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+ */
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     deflatePrime() inserts bits in the deflate output stream.  The intent
+   is that this function is used to start off the deflate output with the bits
+   leftover from a previous deflate stream when appending to it.  As such, this
+   function can only be used for raw deflate, and must be used before the first
+   deflate() call after a deflateInit2() or deflateReset().  bits must be less
+   than or equal to 16, and that many of the least significant bits of value
+   will be inserted in the output.
+
+     deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
+   room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
+   source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     deflateSetHeader() provides gzip header information for when a gzip
+   stream is requested by deflateInit2().  deflateSetHeader() may be called
+   after deflateInit2() or deflateReset() and before the first call of
+   deflate().  The text, time, os, extra field, name, and comment information
+   in the provided gz_header structure are written to the gzip header (xflag is
+   ignored -- the extra flags are set according to the compression level).  The
+   caller must assure that, if not Z_NULL, name and comment are terminated with
+   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+   available there.  If hcrc is true, a gzip header crc is included.  Note that
+   the current versions of the command-line version of gzip (up through version
+   1.3.x) do not support header crc's, and will report that it is a "multi-part
+   gzip file" and give up.
+
+     If deflateSetHeader is not used, the default gzip header has text false,
+   the time set to zero, and os set to 255, with no extra, name, or comment
+   fields.  The gzip header is returned to the default state by deflateReset().
+
+     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+                                     int  windowBits));
+
+     This is another version of inflateInit with an extra parameter.  The
+   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+   before by the caller.
+
+     The windowBits parameter is the base two logarithm of the maximum window
+   size (the size of the history buffer).  It should be in the range 8..15 for
+   this version of the library.  The default value is 15 if inflateInit is used
+   instead.  windowBits must be greater than or equal to the windowBits value
+   provided to deflateInit2() while compressing, or it must be equal to 15 if
+   deflateInit2() was not used.  If a compressed stream with a larger window
+   size is given as input, inflate() will return with the error code
+   Z_DATA_ERROR instead of trying to allocate a larger window.
+
+     windowBits can also be zero to request that inflate use the window size in
+   the zlib header of the compressed stream.
+
+     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits
+   determines the window size.  inflate() will then process raw deflate data,
+   not looking for a zlib or gzip header, not generating a check value, and not
+   looking for any check values for comparison at the end of the stream.  This
+   is for use with other formats that use the deflate compressed data format
+   such as zip.  Those formats provide their own check values.  If a custom
+   format is developed using the raw deflate format for compressed data, it is
+   recommended that a check value such as an Adler-32 or a CRC-32 be applied to
+   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
+   most applications, the zlib format should be used as is.  Note that comments
+   above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+     windowBits can also be greater than 15 for optional gzip decoding.  Add
+   32 to windowBits to enable zlib and gzip decoding with automatic header
+   detection, or add 16 to decode only the gzip format (the zlib format will
+   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a
+   CRC-32 instead of an Adler-32.  Unlike the gunzip utility and gzread() (see
+   below), inflate() will not automatically decode concatenated gzip streams.
+   inflate() will return Z_STREAM_END at the end of the gzip stream.  The state
+   would need to be reset to continue decoding a subsequent gzip stream.
+
+     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit2 does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.) The current implementation
+   of inflateInit2() does not process any header information -- that is
+   deferred until inflate() is called.
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the decompression dictionary from the given uncompressed byte
+   sequence.  This function must be called immediately after a call of inflate,
+   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor
+   can be determined from the Adler-32 value returned by that call of inflate.
+   The compressor and decompressor must use exactly the same dictionary (see
+   deflateSetDictionary).  For raw inflate, this function can be called at any
+   time to set the dictionary.  If the provided dictionary is smaller than the
+   window and there is already data in the window, then the provided dictionary
+   will amend what's there.  The application must insure that the dictionary
+   that was used for compression is provided.
+
+     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+   expected one (incorrect Adler-32 value).  inflateSetDictionary does not
+   perform any decompression: this will be done by subsequent calls of
+   inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
+                                             Bytef *dictionary,
+                                             uInt  *dictLength));
+/*
+     Returns the sliding dictionary being maintained by inflate.  dictLength is
+   set to the number of bytes in the dictionary, and that many bytes are copied
+   to dictionary.  dictionary must have enough space, where 32768 bytes is
+   always enough.  If inflateGetDictionary() is called with dictionary equal to
+   Z_NULL, then only the dictionary length is returned, and nothing is copied.
+   Similary, if dictLength is Z_NULL, then it is not set.
+
+     inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
+   stream state is inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+     Skips invalid compressed data until a possible full flush point (see above
+   for the description of deflate with Z_FULL_FLUSH) can be found, or until all
+   available input is skipped.  No output is provided.
+
+     inflateSync searches for a 00 00 FF FF pattern in the compressed data.
+   All full flush points have this pattern, but not all occurrences of this
+   pattern are full flush points.
+
+     inflateSync returns Z_OK if a possible full flush point has been found,
+   Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
+   has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
+   In the success case, the application may save the current current value of
+   total_in which indicates where valid compressed data was found.  In the
+   error case, the application may repeatedly call inflateSync, providing more
+   input each time, until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when randomly accessing a large stream.  The
+   first pass through the stream can periodically record the inflate state,
+   allowing restarting inflate at those points when randomly accessing the
+   stream.
+
+     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to inflateEnd followed by inflateInit,
+   but does not free and reallocate the internal decompression state.  The
+   stream will keep attributes that may have been set by inflateInit2.
+
+     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+                                      int windowBits));
+/*
+     This function is the same as inflateReset, but it also permits changing
+   the wrap and window size requests.  The windowBits parameter is interpreted
+   the same as it is for inflateInit2.  If the window size is changed, then the
+   memory allocated for the window is freed, and the window will be reallocated
+   by inflate() if needed.
+
+     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL), or if
+   the windowBits parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     This function inserts bits in the inflate input stream.  The intent is
+   that this function is used to start inflating at a bit position in the
+   middle of a byte.  The provided bits will be used before any bytes are used
+   from next_in.  This function should only be used with raw inflate, and
+   should be used before the first inflate() call after inflateInit2() or
+   inflateReset().  bits must be less than or equal to 16, and that many of the
+   least significant bits of value will be inserted in the input.
+
+     If bits is negative, then the input stream bit buffer is emptied.  Then
+   inflatePrime() can be called again to put bits in the buffer.  This is used
+   to clear out bits leftover after feeding inflate a block description prior
+   to feeding inflate codes.
+
+     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+/*
+     This function returns two values, one in the lower 16 bits of the return
+   value, and the other in the remaining upper bits, obtained by shifting the
+   return value down 16 bits.  If the upper value is -1 and the lower value is
+   zero, then inflate() is currently decoding information outside of a block.
+   If the upper value is -1 and the lower value is non-zero, then inflate is in
+   the middle of a stored block, with the lower value equaling the number of
+   bytes from the input remaining to copy.  If the upper value is not -1, then
+   it is the number of bits back from the current bit position in the input of
+   the code (literal or length/distance pair) currently being processed.  In
+   that case the lower value is the number of bytes already emitted for that
+   code.
+
+     A code is being processed if inflate is waiting for more input to complete
+   decoding of the code, or if it has completed decoding but is waiting for
+   more output space to write the literal or match data.
+
+     inflateMark() is used to mark locations in the input data for random
+   access, which may be at bit positions, and to note those cases where the
+   output of a code may span boundaries of random access blocks.  The current
+   location in the input stream can be determined from avail_in and data_type
+   as noted in the description for the Z_BLOCK flush parameter for inflate.
+
+     inflateMark returns the value noted above, or -65536 if the provided
+   source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     inflateGetHeader() requests that gzip header information be stored in the
+   provided gz_header structure.  inflateGetHeader() may be called after
+   inflateInit2() or inflateReset(), and before the first call of inflate().
+   As inflate() processes the gzip stream, head->done is zero until the header
+   is completed, at which time head->done is set to one.  If a zlib stream is
+   being decoded, then head->done is set to -1 to indicate that there will be
+   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
+   used to force inflate() to return immediately after header processing is
+   complete and before any actual data is decompressed.
+
+     The text, time, xflags, and os fields are filled in with the gzip header
+   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
+   was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+   contains the maximum number of bytes to write to extra.  Once done is true,
+   extra_len contains the actual extra field length, and extra contains the
+   extra field, or that field truncated if extra_max is less than extra_len.
+   If name is not Z_NULL, then up to name_max characters are written there,
+   terminated with a zero unless the length is greater than name_max.  If
+   comment is not Z_NULL, then up to comm_max characters are written there,
+   terminated with a zero unless the length is greater than comm_max.  When any
+   of extra, name, or comment are not Z_NULL and the respective field is not
+   present in the header, then that field is set to Z_NULL to signal its
+   absence.  This allows the use of deflateSetHeader() with the returned
+   structure to duplicate the header.  However if those fields are set to
+   allocated memory, then the application will need to save those pointers
+   elsewhere so that they can be eventually freed.
+
+     If inflateGetHeader is not used, then the header information is simply
+   discarded.  The header is always checked for validity, including the header
+   CRC if present.  inflateReset() will reset the process to discard the header
+   information.  The application would need to call inflateGetHeader() again to
+   retrieve the header from the next gzip stream.
+
+     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+                                        unsigned char FAR *window));
+
+     Initialize the internal stream state for decompression using inflateBack()
+   calls.  The fields zalloc, zfree and opaque in strm must be initialized
+   before the call.  If zalloc and zfree are Z_NULL, then the default library-
+   derived memory allocation routines are used.  windowBits is the base two
+   logarithm of the window size, in the range 8..15.  window is a caller
+   supplied buffer of that size.  Except for special applications where it is
+   assured that deflate was used with small window sizes, windowBits must be 15
+   and a 32K byte window must be supplied to be able to decompress general
+   deflate streams.
+
+     See inflateBack() for the usage of these routines.
+
+     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+   the parameters are invalid, Z_MEM_ERROR if the internal state could not be
+   allocated, or Z_VERSION_ERROR if the version of the library does not match
+   the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *,
+                                z_const unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+                                    in_func in, void FAR *in_desc,
+                                    out_func out, void FAR *out_desc));
+/*
+     inflateBack() does a raw inflate with a single call using a call-back
+   interface for input and output.  This is potentially more efficient than
+   inflate() for file i/o applications, in that it avoids copying between the
+   output and the sliding window by simply making the window itself the output
+   buffer.  inflate() can be faster on modern CPUs when used with large
+   buffers.  inflateBack() trusts the application to not change the output
+   buffer passed by the output function, at least until inflateBack() returns.
+
+     inflateBackInit() must be called first to allocate the internal state
+   and to initialize the state with the user-provided window buffer.
+   inflateBack() may then be used multiple times to inflate a complete, raw
+   deflate stream with each call.  inflateBackEnd() is then called to free the
+   allocated state.
+
+     A raw deflate stream is one with no zlib or gzip header or trailer.
+   This routine would normally be used in a utility that reads zip or gzip
+   files and writes out uncompressed files.  The utility would decode the
+   header and process the trailer on its own, hence this routine expects only
+   the raw deflate stream to decompress.  This is different from the default
+   behavior of inflate(), which expects a zlib header and trailer around the
+   deflate stream.
+
+     inflateBack() uses two subroutines supplied by the caller that are then
+   called by inflateBack() for input and output.  inflateBack() calls those
+   routines until it reads a complete deflate stream and writes out all of the
+   uncompressed data, or until it encounters an error.  The function's
+   parameters and return types are defined above in the in_func and out_func
+   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
+   number of bytes of provided input, and a pointer to that input in buf.  If
+   there is no input available, in() must return zero -- buf is ignored in that
+   case -- and inflateBack() will return a buffer error.  inflateBack() will
+   call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].
+   out() should return zero on success, or non-zero on failure.  If out()
+   returns non-zero, inflateBack() will return with an error.  Neither in() nor
+   out() are permitted to change the contents of the window provided to
+   inflateBackInit(), which is also the buffer that out() uses to write from.
+   The length written by out() will be at most the window size.  Any non-zero
+   amount of input may be provided by in().
+
+     For convenience, inflateBack() can be provided input on the first call by
+   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
+   in() will be called.  Therefore strm->next_in must be initialized before
+   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
+   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
+   must also be initialized, and then if strm->avail_in is not zero, input will
+   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].
+
+     The in_desc and out_desc parameters of inflateBack() is passed as the
+   first parameter of in() and out() respectively when they are called.  These
+   descriptors can be optionally used to pass any information that the caller-
+   supplied in() and out() functions need to do their job.
+
+     On return, inflateBack() will set strm->next_in and strm->avail_in to
+   pass back any unused input that was provided by the last in() call.  The
+   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+   if in() or out() returned an error, Z_DATA_ERROR if there was a format error
+   in the deflate stream (in which case strm->msg is set to indicate the nature
+   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
+   In the case of Z_BUF_ERROR, an input or output error can be distinguished
+   using strm->next_in which will be Z_NULL only if in() returned an error.  If
+   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
+   non-zero.  (in() will always be called before out(), so strm->next_in is
+   assured to be defined if out() returns non-zero.)  Note that inflateBack()
+   cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+     All memory allocated by inflateBackInit() is freed.
+
+     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+   state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+     1.0: size of uInt
+     3.2: size of uLong
+     5.4: size of voidpf (pointer)
+     7.6: size of z_off_t
+
+    Compiler, assembler, and debug options:
+     8: ZLIB_DEBUG
+     9: ASMV or ASMINF -- use ASM code
+     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+     11: 0 (reserved)
+
+    One-time table building (smaller code, but not thread-safe if true):
+     12: BUILDFIXED -- build static block decoding tables when needed
+     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+     14,15: 0 (reserved)
+
+    Library content (indicates missing functionality):
+     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+                          deflate code when not needed)
+     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+                    and decode gzip streams (to avoid linking crc code)
+     18-19: 0 (reserved)
+
+    Operation variations (changes in library functionality):
+     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+     21: FASTEST -- deflate algorithm with only one, lowest compression level
+     22,23: 0 (reserved)
+
+    The sprintf variant used by gzprintf (zero is best):
+     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+    Remainder:
+     27-31: 0 (reserved)
+ */
+
+#ifndef Z_SOLO
+
+                        /* utility functions */
+
+/*
+     The following utility functions are implemented on top of the basic
+   stream-oriented functions.  To simplify the interface, some default options
+   are assumed (compression level and memory usage, standard memory allocation
+   functions).  The source code of these utility functions can be modified if
+   you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
+                                 const Bytef *source, uLong sourceLen));
+/*
+     Compresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed data.  compress() is equivalent to compress2() with a level
+   parameter of Z_DEFAULT_COMPRESSION.
+
+     compress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
+                                  const Bytef *source, uLong sourceLen,
+                                  int level));
+/*
+     Compresses the source buffer into the destination buffer.  The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer.  Upon entry, destLen is the total size of the
+   destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed data.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+     compressBound() returns an upper bound on the compressed size after
+   compress() or compress2() on sourceLen bytes.  It would be used before a
+   compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
+                                   const Bytef *source, uLong sourceLen));
+/*
+     Decompresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be large enough to hold the entire
+   uncompressed data.  (The size of the uncompressed data must have been saved
+   previously by the compressor and transmitted to the decompressor by some
+   mechanism outside the scope of this compression library.) Upon exit, destLen
+   is the actual size of the uncompressed data.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.  In
+   the case where there is not enough room, uncompress() will fill the output
+   buffer with the uncompressed data up to that point.
+*/
+
+ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest,   uLongf *destLen,
+                                    const Bytef *source, uLong *sourceLen));
+/*
+     Same as uncompress, except that sourceLen is a pointer, where the
+   length of the source is *sourceLen.  On return, *sourceLen is the number of
+   source bytes consumed.
+*/
+
+                        /* gzip file access functions */
+
+/*
+     This library supports reading and writing files in gzip (.gz) format with
+   an interface similar to that of stdio, using the functions that start with
+   "gz".  The gzip format is different from the zlib format.  gzip is a gzip
+   wrapper, documented in RFC 1952, wrapped around a deflate stream.
+*/
+
+typedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */
+
+/*
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as
+   in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
+   a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
+   compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
+   for fixed code compression as in "wb9F".  (See the description of
+   deflateInit2 for more information about the strategy parameter.)  'T' will
+   request transparent writing or appending with no compression and not using
+   the gzip format.
+
+     "a" can be used instead of "w" to request that the gzip stream that will
+   be written be appended to the file.  "+" will result in an error, since
+   reading and writing to the same gzip file is not supported.  The addition of
+   "x" when writing will create the file exclusively, which fails if the file
+   already exists.  On systems that support it, the addition of "e" when
+   reading or writing will set the flag to close the file on an execve() call.
+
+     These functions, as well as gzip, will read and decode a sequence of gzip
+   streams in a file.  The append function of gzopen() can be used to create
+   such a file.  (Also see gzflush() for another way to do this.)  When
+   appending, gzopen does not test whether the file begins with a gzip stream,
+   nor does it look for the end of the gzip streams to begin appending.  gzopen
+   will simply append a gzip stream to the existing file.
+
+     gzopen can be used to read a file which is not in gzip format; in this
+   case gzread will directly read from the file without decompression.  When
+   reading, this will be detected automatically by looking for the magic two-
+   byte gzip header.
+
+     gzopen returns NULL if the file could not be opened, if there was
+   insufficient memory to allocate the gzFile state, or if an invalid mode was
+   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
+   errno can be checked to determine if the reason gzopen failed was that the
+   file could not be opened.
+*/
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+     gzdopen associates a gzFile with the file descriptor fd.  File descriptors
+   are obtained from calls like open, dup, creat, pipe or fileno (if the file
+   has been previously opened with fopen).  The mode parameter is as in gzopen.
+
+     The next call of gzclose on the returned gzFile will also close the file
+   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
+   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
+   mode);.  The duplicated descriptor should be saved to avoid a leak, since
+   gzdopen does not close fd if it fails.  If you are using fileno() to get the
+   file descriptor from a FILE *, then you will have to use dup() to avoid
+   double-close()ing the file descriptor.  Both gzclose() and fclose() will
+   close the associated file descriptor, so they need to have different file
+   descriptors.
+
+     gzdopen returns NULL if there was insufficient memory to allocate the
+   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
+   provided, or '+' was provided), or if fd is -1.  The file descriptor is not
+   used until the next gz* read, write, seek, or close operation, so gzdopen
+   will not detect if fd is invalid (unless fd is -1).
+*/
+
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
+/*
+     Set the internal buffer size used by this library's functions.  The
+   default buffer size is 8192 bytes.  This function must be called after
+   gzopen() or gzdopen(), and before any other calls that read or write the
+   file.  The buffer memory allocation is always deferred to the first read or
+   write.  Three times that size in buffer space is allocated.  A larger buffer
+   size of, for example, 64K or 128K bytes will noticeably increase the speed
+   of decompression (reading).
+
+     The new buffer size also affects the maximum length for gzprintf().
+
+     gzbuffer() returns 0 on success, or -1 on failure, such as being called
+   too late.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+     Dynamically update the compression level or strategy.  See the description
+   of deflateInit2 for the meaning of these parameters.  Previously provided
+   data is flushed before the parameter change.
+
+     gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
+   opened for writing, Z_ERRNO if there is an error writing the flushed data,
+   or Z_MEM_ERROR if there is a memory allocation error.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+     Reads the given number of uncompressed bytes from the compressed file.  If
+   the input file is not in gzip format, gzread copies the given number of
+   bytes into the buffer directly from the file.
+
+     After reaching the end of a gzip stream in the input, gzread will continue
+   to read, looking for another gzip stream.  Any number of gzip streams may be
+   concatenated in the input file, and will all be decompressed by gzread().
+   If something other than a gzip stream is encountered after a gzip stream,
+   that remaining trailing garbage is ignored (and no error is returned).
+
+     gzread can be used to read a gzip file that is being concurrently written.
+   Upon reaching the end of the input, gzread will return with the available
+   data.  If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
+   gzclearerr can be used to clear the end of file indicator in order to permit
+   gzread to be tried again.  Z_OK indicates that a gzip stream was completed
+   on the last gzread.  Z_BUF_ERROR indicates that the input file ended in the
+   middle of a gzip stream.  Note that gzread does not return -1 in the event
+   of an incomplete gzip stream.  This error is deferred until gzclose(), which
+   will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
+   stream.  Alternatively, gzerror can be used before gzclose to detect this
+   case.
+
+     gzread returns the number of uncompressed bytes actually read, less than
+   len for end of file, or -1 for error.  If len is too large to fit in an int,
+   then nothing is read, -1 is returned, and the error state is set to
+   Z_STREAM_ERROR.
+*/
+
+ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
+                                     gzFile file));
+/*
+     Read up to nitems items of size size from file to buf, otherwise operating
+   as gzread() does.  This duplicates the interface of stdio's fread(), with
+   size_t request and return types.  If the library defines size_t, then
+   z_size_t is identical to size_t.  If not, then z_size_t is an unsigned
+   integer type that can contain a pointer.
+
+     gzfread() returns the number of full items read of size size, or zero if
+   the end of the file was reached and a full item could not be read, or if
+   there was an error.  gzerror() must be consulted if zero is returned in
+   order to determine if there was an error.  If the multiplication of size and
+   nitems overflows, i.e. the product does not fit in a z_size_t, then nothing
+   is read, zero is returned, and the error state is set to Z_STREAM_ERROR.
+
+     In the event that the end of file is reached and only a partial item is
+   available at the end, i.e. the remaining uncompressed data length is not a
+   multiple of size, then the final partial item is nevetheless read into buf
+   and the end-of-file flag is set.  The length of the partial item read is not
+   provided, but could be inferred from the result of gztell().  This behavior
+   is the same as the behavior of fread() implementations in common libraries,
+   but it prevents the direct use of gzfread() to read a concurrently written
+   file, reseting and retrying on end-of-file, when size is not 1.
+*/
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+                                voidpc buf, unsigned len));
+/*
+     Writes the given number of uncompressed bytes into the compressed file.
+   gzwrite returns the number of uncompressed bytes written or 0 in case of
+   error.
+*/
+
+ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
+                                      z_size_t nitems, gzFile file));
+/*
+     gzfwrite() writes nitems items of size size from buf to file, duplicating
+   the interface of stdio's fwrite(), with size_t request and return types.  If
+   the library defines size_t, then z_size_t is identical to size_t.  If not,
+   then z_size_t is an unsigned integer type that can contain a pointer.
+
+     gzfwrite() returns the number of full items written of size size, or zero
+   if there was an error.  If the multiplication of size and nitems overflows,
+   i.e. the product does not fit in a z_size_t, then nothing is written, zero
+   is returned, and the error state is set to Z_STREAM_ERROR.
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
+/*
+     Converts, formats, and writes the arguments to the compressed file under
+   control of the format string, as in fprintf.  gzprintf returns the number of
+   uncompressed bytes actually written, or a negative zlib error code in case
+   of error.  The number of uncompressed bytes written is limited to 8191, or
+   one less than the buffer size given to gzbuffer().  The caller should assure
+   that this limit is not exceeded.  If it is exceeded, then gzprintf() will
+   return an error (0) with nothing written.  In this case, there may also be a
+   buffer overflow with unpredictable consequences, which is possible only if
+   zlib was compiled with the insecure functions sprintf() or vsprintf()
+   because the secure snprintf() or vsnprintf() functions were not available.
+   This can be determined using zlibCompileFlags().
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+     Writes the given null-terminated string to the compressed file, excluding
+   the terminating null character.
+
+     gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+     Reads bytes from the compressed file until len-1 characters are read, or a
+   newline character is read and transferred to buf, or an end-of-file
+   condition is encountered.  If any characters are read or if len == 1, the
+   string is terminated with a null character.  If no characters are read due
+   to an end-of-file or len < 1, then the buffer is left untouched.
+
+     gzgets returns buf which is a null-terminated string, or it returns NULL
+   for end-of-file or in case of error.  If there was an error, the contents at
+   buf are indeterminate.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+     Writes c, converted to an unsigned char, into the compressed file.  gzputc
+   returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+     Reads one byte from the compressed file.  gzgetc returns this byte or -1
+   in case of end of file or error.  This is implemented as a macro for speed.
+   As such, it does not do all of the checking the other functions do.  I.e.
+   it does not check to see if file is NULL, nor whether the structure file
+   points to has been clobbered or not.
+*/
+
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+/*
+     Push one character back onto the stream to be read as the first character
+   on the next read.  At least one character of push-back is allowed.
+   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will
+   fail if c is -1, and may fail if a character has been pushed but not read
+   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the
+   output buffer size of pushed characters is allowed.  (See gzbuffer above.)
+   The pushed character will be discarded if the stream is repositioned with
+   gzseek() or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+     Flushes all pending output into the compressed file.  The parameter flush
+   is as in the deflate() function.  The return value is the zlib error number
+   (see function gzerror below).  gzflush is only permitted when writing.
+
+     If the flush parameter is Z_FINISH, the remaining data is written and the
+   gzip stream is completed in the output.  If gzwrite() is called again, a new
+   gzip stream will be started in the output.  gzread() is able to read such
+   concatenated gzip streams.
+
+     gzflush should be called only when strictly necessary because it will
+   degrade compression if called too often.
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+                                   z_off_t offset, int whence));
+
+     Sets the starting position for the next gzread or gzwrite on the given
+   compressed file.  The offset represents a number of bytes in the
+   uncompressed data stream.  The whence parameter is defined as in lseek(2);
+   the value SEEK_END is not supported.
+
+     If the file is opened for reading, this function is emulated but can be
+   extremely slow.  If the file is opened for writing, only forward seeks are
+   supported; gzseek then compresses a sequence of zeroes up to the new
+   starting position.
+
+     gzseek returns the resulting offset location as measured in bytes from
+   the beginning of the uncompressed stream, or -1 in case of error, in
+   particular if the file is opened for writing and the new starting position
+   would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
+/*
+     Rewinds the given file. This function is supported only for reading.
+
+     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
+
+     Returns the starting position for the next gzread or gzwrite on the given
+   compressed file.  This position represents a number of bytes in the
+   uncompressed data stream, and is zero when starting, even if appending or
+   reading a gzip stream from the middle of a file using gzdopen().
+
+     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+
+     Returns the current offset in the file being read or written.  This offset
+   includes the count of bytes that precede the gzip stream, for example when
+   appending or when using gzdopen() for reading.  When reading, the offset
+   does not include as yet unused buffered input.  This information can be used
+   for a progress indicator.  On error, gzoffset() returns -1.
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+     Returns true (1) if the end-of-file indicator has been set while reading,
+   false (0) otherwise.  Note that the end-of-file indicator is set only if the
+   read tried to go past the end of the input, but came up short.  Therefore,
+   just like feof(), gzeof() may return false even if there is no more data to
+   read, in the event that the last read request was for the exact number of
+   bytes remaining in the input file.  This will happen if the input file size
+   is an exact multiple of the buffer size.
+
+     If gzeof() returns true, then the read functions will return no more data,
+   unless the end-of-file indicator is reset by gzclearerr() and the input file
+   has grown since the previous end of file was detected.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+     Returns true (1) if file is being copied directly while reading, or false
+   (0) if file is a gzip stream being decompressed.
+
+     If the input file is empty, gzdirect() will return true, since the input
+   does not contain a gzip stream.
+
+     If gzdirect() is used immediately after gzopen() or gzdopen() it will
+   cause buffers to be allocated to allow reading the file to determine if it
+   is a gzip file.  Therefore if gzbuffer() is used, it should be called before
+   gzdirect().
+
+     When writing, gzdirect() returns true (1) if transparent writing was
+   requested ("wT" for the gzopen() mode), or false (0) otherwise.  (Note:
+   gzdirect() is not needed when writing.  Transparent writing must be
+   explicitly requested, so the application already knows the answer.  When
+   linking statically, using gzdirect() will include all of the zlib code for
+   gzip file reading and decompression, which may not be desired.)
+*/
+
+ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
+/*
+     Flushes all pending output if necessary, closes the compressed file and
+   deallocates the (de)compression state.  Note that once file is closed, you
+   cannot call gzerror with file, since its structures have been deallocated.
+   gzclose must not be called more than once on the same file, just as free
+   must not be called more than once on the same allocation.
+
+     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
+   file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
+   last read ended in the middle of a gzip stream, or Z_OK on success.
+*/
+
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+/*
+     Same as gzclose(), but gzclose_r() is only for use when reading, and
+   gzclose_w() is only for use when writing or appending.  The advantage to
+   using these instead of gzclose() is that they avoid linking in zlib
+   compression or decompression code that is not used when only reading or only
+   writing respectively.  If gzclose() is used, then both compression and
+   decompression code will be included the application when linking to a static
+   zlib library.
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+     Returns the error message for the last error which occurred on the given
+   compressed file.  errnum is set to zlib error number.  If an error occurred
+   in the file system and not in the compression library, errnum is set to
+   Z_ERRNO and the application may consult errno to get the exact error code.
+
+     The application must not modify the returned string.  Future calls to
+   this function may invalidate the previously returned string.  If file is
+   closed, then the string previously returned by gzerror will no longer be
+   available.
+
+     gzerror() should be used to distinguish errors from end-of-file for those
+   functions above that do not distinguish those cases in their return values.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+     Clears the error and end-of-file flags for file.  This is analogous to the
+   clearerr() function in stdio.  This is useful for continuing to read a gzip
+   file that is being written concurrently.
+*/
+
+#endif /* !Z_SOLO */
+
+                        /* checksum functions */
+
+/*
+     These functions are not related to compression but are exported
+   anyway because they might be useful in applications using the compression
+   library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+   return the updated checksum.  If buf is Z_NULL, this function returns the
+   required initial value for the checksum.
+
+     An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
+   much faster.
+
+   Usage example:
+
+     uLong adler = adler32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       adler = adler32(adler, buffer, length);
+     }
+     if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf,
+                                    z_size_t len));
+/*
+     Same as adler32(), but with a size_t length.
+*/
+
+/*
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+                                          z_off_t len2));
+
+     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
+   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
+   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.  Note
+   that the z_off_t type (like off_t) is a signed integer.  If len2 is
+   negative, the result has no meaning or utility.
+*/
+
+ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
+/*
+     Update a running CRC-32 with the bytes buf[0..len-1] and return the
+   updated CRC-32.  If buf is Z_NULL, this function returns the required
+   initial value for the crc.  Pre- and post-conditioning (one's complement) is
+   performed within this function so it shouldn't be done by the application.
+
+   Usage example:
+
+     uLong crc = crc32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       crc = crc32(crc, buffer, length);
+     }
+     if (crc != original_crc) error();
+*/
+
+ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
+                                  z_size_t len));
+/*
+     Same as crc32(), but with a size_t length.
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+     Combine two CRC-32 check values into one.  For two sequences of bytes,
+   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
+   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+   len2.
+*/
+
+
+                        /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
+                                      int windowBits, int memLevel,
+                                      int strategy, const char *version,
+                                      int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
+                                      const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+                                         unsigned char FAR *window,
+                                         const char *version,
+                                         int stream_size));
+#ifdef Z_PREFIX_SET
+#  define z_deflateInit(strm, level) \
+          deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+#  define z_inflateInit(strm) \
+          inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+#  define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+          deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+                        (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
+#  define z_inflateInit2(strm, windowBits) \
+          inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+                        (int)sizeof(z_stream))
+#  define z_inflateBackInit(strm, windowBits, window) \
+          inflateBackInit_((strm), (windowBits), (window), \
+                           ZLIB_VERSION, (int)sizeof(z_stream))
+#else
+#  define deflateInit(strm, level) \
+          deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+#  define inflateInit(strm) \
+          inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+#  define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+          deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+                        (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
+#  define inflateInit2(strm, windowBits) \
+          inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+                        (int)sizeof(z_stream))
+#  define inflateBackInit(strm, windowBits, window) \
+          inflateBackInit_((strm), (windowBits), (window), \
+                           ZLIB_VERSION, (int)sizeof(z_stream))
+#endif
+
+#ifndef Z_SOLO
+
+/* gzgetc() macro and its supporting function and exposed data structure.  Note
+ * that the real internal state is much larger than the exposed structure.
+ * This abbreviated structure exposes just enough for the gzgetc() macro.  The
+ * user should not mess with these exposed elements, since their names or
+ * behavior could change in the future, perhaps even capriciously.  They can
+ * only be used by the gzgetc() macro.  You have been warned.
+ */
+struct gzFile_s {
+    unsigned have;
+    unsigned char *next;
+    z_off64_t pos;
+};
+ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */
+#ifdef Z_PREFIX_SET
+#  undef z_gzgetc
+#  define z_gzgetc(g) \
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
+#else
+#  define gzgetc(g) \
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
+#endif
+
+/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
+ * both are true, the application gets the *64 functions, and the regular
+ * functions are changed to 64 bits) -- in case these are set on systems
+ * without large file support, _LFS64_LARGEFILE must also be true
+ */
+#ifdef Z_LARGE64
+   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+   ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+   ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+   ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
+   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+#endif
+
+#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
+#  ifdef Z_PREFIX_SET
+#    define z_gzopen z_gzopen64
+#    define z_gzseek z_gzseek64
+#    define z_gztell z_gztell64
+#    define z_gzoffset z_gzoffset64
+#    define z_adler32_combine z_adler32_combine64
+#    define z_crc32_combine z_crc32_combine64
+#  else
+#    define gzopen gzopen64
+#    define gzseek gzseek64
+#    define gztell gztell64
+#    define gzoffset gzoffset64
+#    define adler32_combine adler32_combine64
+#    define crc32_combine crc32_combine64
+#  endif
+#  ifndef Z_LARGE64
+     ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+     ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+     ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+     ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
+     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+#  endif
+#else
+   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+#endif
+
+#else /* Z_SOLO */
+
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+
+#endif /* !Z_SOLO */
+
+/* undocumented functions */
+ZEXTERN const char   * ZEXPORT zError           OF((int));
+ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
+ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));
+ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
+ZEXTERN int            ZEXPORT inflateValidate OF((z_streamp, int));
+ZEXTERN unsigned long  ZEXPORT inflateCodesUsed OF ((z_streamp));
+ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
+ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
+#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
+ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
+                                            const char *mode));
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifndef Z_SOLO
+ZEXTERN int            ZEXPORTVA gzvprintf Z_ARG((gzFile file,
+                                                  const char *format,
+                                                  va_list va));
+#  endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/jdk/src/java.base/share/native/libzip/zlib/zutil.c b/jdk/src/java.base/share/native/libzip/zlib/zutil.c
new file mode 100644
index 0000000..a0c8892
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/zutil.c
@@ -0,0 +1,350 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* zutil.c -- target dependent utility functions for the compression library
+ * Copyright (C) 1995-2017 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#include "zutil.h"
+
+#ifndef Z_SOLO
+#  include "gzguts.h"
+#endif
+
+z_const char * const z_errmsg[10] = {
+    (z_const char *)"need dictionary",     /* Z_NEED_DICT       2  */
+    (z_const char *)"stream end",          /* Z_STREAM_END      1  */
+    (z_const char *)"",                    /* Z_OK              0  */
+    (z_const char *)"file error",          /* Z_ERRNO         (-1) */
+    (z_const char *)"stream error",        /* Z_STREAM_ERROR  (-2) */
+    (z_const char *)"data error",          /* Z_DATA_ERROR    (-3) */
+    (z_const char *)"insufficient memory", /* Z_MEM_ERROR     (-4) */
+    (z_const char *)"buffer error",        /* Z_BUF_ERROR     (-5) */
+    (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */
+    (z_const char *)""
+};
+
+
+const char * ZEXPORT zlibVersion()
+{
+    return ZLIB_VERSION;
+}
+
+uLong ZEXPORT zlibCompileFlags()
+{
+    uLong flags;
+
+    flags = 0;
+    switch ((int)(sizeof(uInt))) {
+    case 2:     break;
+    case 4:     flags += 1;     break;
+    case 8:     flags += 2;     break;
+    default:    flags += 3;
+    }
+    switch ((int)(sizeof(uLong))) {
+    case 2:     break;
+    case 4:     flags += 1 << 2;        break;
+    case 8:     flags += 2 << 2;        break;
+    default:    flags += 3 << 2;
+    }
+    switch ((int)(sizeof(voidpf))) {
+    case 2:     break;
+    case 4:     flags += 1 << 4;        break;
+    case 8:     flags += 2 << 4;        break;
+    default:    flags += 3 << 4;
+    }
+    switch ((int)(sizeof(z_off_t))) {
+    case 2:     break;
+    case 4:     flags += 1 << 6;        break;
+    case 8:     flags += 2 << 6;        break;
+    default:    flags += 3 << 6;
+    }
+#ifdef ZLIB_DEBUG
+    flags += 1 << 8;
+#endif
+#if defined(ASMV) || defined(ASMINF)
+    flags += 1 << 9;
+#endif
+#ifdef ZLIB_WINAPI
+    flags += 1 << 10;
+#endif
+#ifdef BUILDFIXED
+    flags += 1 << 12;
+#endif
+#ifdef DYNAMIC_CRC_TABLE
+    flags += 1 << 13;
+#endif
+#ifdef NO_GZCOMPRESS
+    flags += 1L << 16;
+#endif
+#ifdef NO_GZIP
+    flags += 1L << 17;
+#endif
+#ifdef PKZIP_BUG_WORKAROUND
+    flags += 1L << 20;
+#endif
+#ifdef FASTEST
+    flags += 1L << 21;
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#  ifdef NO_vsnprintf
+    flags += 1L << 25;
+#    ifdef HAS_vsprintf_void
+    flags += 1L << 26;
+#    endif
+#  else
+#    ifdef HAS_vsnprintf_void
+    flags += 1L << 26;
+#    endif
+#  endif
+#else
+    flags += 1L << 24;
+#  ifdef NO_snprintf
+    flags += 1L << 25;
+#    ifdef HAS_sprintf_void
+    flags += 1L << 26;
+#    endif
+#  else
+#    ifdef HAS_snprintf_void
+    flags += 1L << 26;
+#    endif
+#  endif
+#endif
+    return flags;
+}
+
+#ifdef ZLIB_DEBUG
+#include <stdlib.h>
+#  ifndef verbose
+#    define verbose 0
+#  endif
+int ZLIB_INTERNAL z_verbose = verbose;
+
+void ZLIB_INTERNAL z_error (m)
+    char *m;
+{
+    fprintf(stderr, "%s\n", m);
+    exit(1);
+}
+#endif
+
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(err)
+    int err;
+{
+    return ERR_MSG(err);
+}
+
+#if defined(_WIN32_WCE)
+    /* The Microsoft C Run-Time Library for Windows CE doesn't have
+     * errno.  We define it as a global variable to simplify porting.
+     * Its value is always 0 and should not be used.
+     */
+    int errno = 0;
+#endif
+
+#ifndef HAVE_MEMCPY
+
+void ZLIB_INTERNAL zmemcpy(dest, source, len)
+    Bytef* dest;
+    const Bytef* source;
+    uInt  len;
+{
+    if (len == 0) return;
+    do {
+        *dest++ = *source++; /* ??? to be unrolled */
+    } while (--len != 0);
+}
+
+int ZLIB_INTERNAL zmemcmp(s1, s2, len)
+    const Bytef* s1;
+    const Bytef* s2;
+    uInt  len;
+{
+    uInt j;
+
+    for (j = 0; j < len; j++) {
+        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+    }
+    return 0;
+}
+
+void ZLIB_INTERNAL zmemzero(dest, len)
+    Bytef* dest;
+    uInt  len;
+{
+    if (len == 0) return;
+    do {
+        *dest++ = 0;  /* ??? to be unrolled */
+    } while (--len != 0);
+}
+#endif
+
+#ifndef Z_SOLO
+
+#ifdef SYS16BIT
+
+#ifdef __TURBOC__
+/* Turbo C in 16-bit mode */
+
+#  define MY_ZCALLOC
+
+/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
+ * and farmalloc(64K) returns a pointer with an offset of 8, so we
+ * must fix the pointer. Warning: the pointer must be put back to its
+ * original form in order to free it, use zcfree().
+ */
+
+#define MAX_PTR 10
+/* 10*64K = 640K */
+
+local int next_ptr = 0;
+
+typedef struct ptr_table_s {
+    voidpf org_ptr;
+    voidpf new_ptr;
+} ptr_table;
+
+local ptr_table table[MAX_PTR];
+/* This table is used to remember the original form of pointers
+ * to large buffers (64K). Such pointers are normalized with a zero offset.
+ * Since MSDOS is not a preemptive multitasking OS, this table is not
+ * protected from concurrent access. This hack doesn't work anyway on
+ * a protected system like OS/2. Use Microsoft C instead.
+ */
+
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+    voidpf buf;
+    ulg bsize = (ulg)items*size;
+
+    (void)opaque;
+
+    /* If we allocate less than 65520 bytes, we assume that farmalloc
+     * will return a usable pointer which doesn't have to be normalized.
+     */
+    if (bsize < 65520L) {
+        buf = farmalloc(bsize);
+        if (*(ush*)&buf != 0) return buf;
+    } else {
+        buf = farmalloc(bsize + 16L);
+    }
+    if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
+    table[next_ptr].org_ptr = buf;
+
+    /* Normalize the pointer to seg:0 */
+    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
+    *(ush*)&buf = 0;
+    table[next_ptr++].new_ptr = buf;
+    return buf;
+}
+
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+{
+    int n;
+
+    (void)opaque;
+
+    if (*(ush*)&ptr != 0) { /* object < 64K */
+        farfree(ptr);
+        return;
+    }
+    /* Find the original pointer */
+    for (n = 0; n < next_ptr; n++) {
+        if (ptr != table[n].new_ptr) continue;
+
+        farfree(table[n].org_ptr);
+        while (++n < next_ptr) {
+            table[n-1] = table[n];
+        }
+        next_ptr--;
+        return;
+    }
+    Assert(0, "zcfree: ptr not found");
+}
+
+#endif /* __TURBOC__ */
+
+
+#ifdef M_I86
+/* Microsoft C in 16-bit mode */
+
+#  define MY_ZCALLOC
+
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
+#  define _halloc  halloc
+#  define _hfree   hfree
+#endif
+
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
+{
+    (void)opaque;
+    return _halloc((long)items, size);
+}
+
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+{
+    (void)opaque;
+    _hfree(ptr);
+}
+
+#endif /* M_I86 */
+
+#endif /* SYS16BIT */
+
+
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef STDC
+extern voidp  malloc OF((uInt size));
+extern voidp  calloc OF((uInt items, uInt size));
+extern void   free   OF((voidpf ptr));
+#endif
+
+voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
+    voidpf opaque;
+    unsigned items;
+    unsigned size;
+{
+    (void)opaque;
+    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
+                              (voidpf)calloc(items, size);
+}
+
+void ZLIB_INTERNAL zcfree (opaque, ptr)
+    voidpf opaque;
+    voidpf ptr;
+{
+    (void)opaque;
+    free(ptr);
+}
+
+#endif /* MY_ZCALLOC */
+
+#endif /* !Z_SOLO */
diff --git a/jdk/src/java.base/share/native/libzip/zlib/zutil.h b/jdk/src/java.base/share/native/libzip/zlib/zutil.h
new file mode 100644
index 0000000..c9e1273
--- /dev/null
+++ b/jdk/src/java.base/share/native/libzip/zlib/zutil.h
@@ -0,0 +1,295 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZUTIL_H
+#define ZUTIL_H
+
+#ifdef HAVE_HIDDEN
+#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+#  define ZLIB_INTERNAL
+#endif
+
+#include "zlib.h"
+
+#if defined(STDC) && !defined(Z_SOLO)
+#  if !(defined(_WIN32_WCE) && defined(_MSC_VER))
+#    include <stddef.h>
+#  endif
+#  include <string.h>
+#  include <stdlib.h>
+#endif
+
+#ifdef Z_SOLO
+   typedef long ptrdiff_t;  /* guess -- will be caught if guess is wrong */
+#endif
+
+#ifndef local
+#  define local static
+#endif
+/* since "static" is used to mean two completely different things in C, we
+   define "local" for the non-static meaning of "static", for readability
+   (compile with -Dlocal if your debugger can't find static symbols) */
+
+typedef unsigned char  uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long  ulg;
+
+extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+/* (size given to avoid silly warnings with Visual C++) */
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
+#define ERR_RETURN(strm,err) \
+  return (strm->msg = ERR_MSG(err), (err))
+/* To be used only when the state is known to be valid */
+
+        /* common constants */
+
+#ifndef DEF_WBITS
+#  define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+#  define DEF_MEM_LEVEL 8
+#else
+#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES    2
+/* The three kinds of block type */
+
+#define MIN_MATCH  3
+#define MAX_MATCH  258
+/* The minimum and maximum match lengths */
+
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
+        /* target dependencies */
+
+#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
+#  define OS_CODE  0x00
+#  ifndef Z_SOLO
+#    if defined(__TURBOC__) || defined(__BORLANDC__)
+#      if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+         /* Allow compilation with ANSI keywords only enabled */
+         void _Cdecl farfree( void *block );
+         void *_Cdecl farmalloc( unsigned long nbytes );
+#      else
+#        include <alloc.h>
+#      endif
+#    else /* MSC or DJGPP */
+#      include <malloc.h>
+#    endif
+#  endif
+#endif
+
+#ifdef AMIGA
+#  define OS_CODE  1
+#endif
+
+#if defined(VAXC) || defined(VMS)
+#  define OS_CODE  2
+#  define F_OPEN(name, mode) \
+     fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+#endif
+
+#ifdef __370__
+#  if __TARGET_LIB__ < 0x20000000
+#    define OS_CODE 4
+#  elif __TARGET_LIB__ < 0x40000000
+#    define OS_CODE 11
+#  else
+#    define OS_CODE 8
+#  endif
+#endif
+
+#if defined(ATARI) || defined(atarist)
+#  define OS_CODE  5
+#endif
+
+#ifdef OS2
+#  define OS_CODE  6
+#  if defined(M_I86) && !defined(Z_SOLO)
+#    include <malloc.h>
+#  endif
+#endif
+
+#if defined(MACOS) || defined(TARGET_OS_MAC)
+#  define OS_CODE  7
+#  ifndef Z_SOLO
+#    if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+#      include <unix.h> /* for fdopen */
+#    else
+#      ifndef fdopen
+#        define fdopen(fd,mode) NULL /* No fdopen() */
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __acorn
+#  define OS_CODE 13
+#endif
+
+#if defined(WIN32) && !defined(__CYGWIN__)
+#  define OS_CODE  10
+#endif
+
+#ifdef _BEOS_
+#  define OS_CODE  16
+#endif
+
+#ifdef __TOS_OS400__
+#  define OS_CODE 18
+#endif
+
+#ifdef __APPLE__
+#  define OS_CODE 19
+#endif
+
+#if defined(_BEOS_) || defined(RISCOS)
+#  define fdopen(fd,mode) NULL /* No fdopen() */
+#endif
+
+#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
+#  if defined(_WIN32_WCE)
+#    define fdopen(fd,mode) NULL /* No fdopen() */
+#    ifndef _PTRDIFF_T_DEFINED
+       typedef int ptrdiff_t;
+#      define _PTRDIFF_T_DEFINED
+#    endif
+#  else
+#    define fdopen(fd,type)  _fdopen(fd,type)
+#  endif
+#endif
+
+#if defined(__BORLANDC__) && !defined(MSDOS)
+  #pragma warn -8004
+  #pragma warn -8008
+  #pragma warn -8066
+#endif
+
+/* provide prototypes for these when building zlib without LFS */
+#if !defined(_WIN32) && \
+    (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
+    ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+    ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+#endif
+
+        /* common defaults */
+
+#ifndef OS_CODE
+#  define OS_CODE  3     /* assume Unix */
+#endif
+
+#ifndef F_OPEN
+#  define F_OPEN(name, mode) fopen((name), (mode))
+#endif
+
+         /* functions */
+
+#if defined(pyr) || defined(Z_SOLO)
+#  define NO_MEMCPY
+#endif
+#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
+ /* Use our own functions for small and medium model with MSC <= 5.0.
+  * You may have to use the same strategy for Borland C (untested).
+  * The __SC__ check is for Symantec.
+  */
+#  define NO_MEMCPY
+#endif
+#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
+#  define HAVE_MEMCPY
+#endif
+#ifdef HAVE_MEMCPY
+#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */
+#    define zmemcpy _fmemcpy
+#    define zmemcmp _fmemcmp
+#    define zmemzero(dest, len) _fmemset(dest, 0, len)
+#  else
+#    define zmemcpy memcpy
+#    define zmemcmp memcmp
+#    define zmemzero(dest, len) memset(dest, 0, len)
+#  endif
+#else
+   void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+   int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+   void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
+#endif
+
+/* Diagnostic functions */
+#ifdef ZLIB_DEBUG
+#  include <stdio.h>
+   extern int ZLIB_INTERNAL z_verbose;
+   extern void ZLIB_INTERNAL z_error OF((char *m));
+#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+#  define Trace(x) {if (z_verbose>=0) fprintf x ;}
+#  define Tracev(x) {if (z_verbose>0) fprintf x ;}
+#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+#else
+#  define Assert(cond,msg)
+#  define Trace(x)
+#  define Tracev(x)
+#  define Tracevv(x)
+#  define Tracec(c,x)
+#  define Tracecv(c,x)
+#endif
+
+#ifndef Z_SOLO
+   voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+                                    unsigned size));
+   void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));
+#endif
+
+#define ZALLOC(strm, items, size) \
+           (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+/* Reverse the bytes in a 32-bit value */
+#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
+                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
+
+#endif /* ZUTIL_H */
diff --git a/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java b/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java
index 78d9f7f..c08f0bf 100644
--- a/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java
+++ b/jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -617,7 +617,7 @@
     }
 
     @Override
-    public long getPid() {
+    public long pid() {
         return pid;
     }
 
diff --git a/jdk/src/java.base/unix/classes/module-info.java.extra b/jdk/src/java.base/unix/classes/module-info.java.extra
index 43f85b0..833b096 100644
--- a/jdk/src/java.base/unix/classes/module-info.java.extra
+++ b/jdk/src/java.base/unix/classes/module-info.java.extra
@@ -23,14 +23,14 @@
  * questions.
  */
 
-// jdk.vm.compiler uses Unsafe and VM classes from jdk.internal.misc
-exports jdk.internal.misc to jdk.vm.compiler;
-opens   jdk.internal.misc to jdk.vm.compiler;
+// jdk.internal.vm.compiler uses Unsafe and VM classes from jdk.internal.misc
+exports jdk.internal.misc to jdk.internal.vm.compiler;
+opens   jdk.internal.misc to jdk.internal.vm.compiler;
 
-// jdk.vm.compiler uses com.sun.crypto.provider to generate crypto intrinsics
-opens com.sun.crypto.provider to jdk.vm.compiler;
+// jdk.internal.vm.compiler uses com.sun.crypto.provider to generate crypto intrinsics
+opens com.sun.crypto.provider to jdk.internal.vm.compiler;
 
-exports jdk.internal.module to jdk.vm.compiler;
+exports jdk.internal.module to jdk.internal.vm.compiler;
 
 // AOT uses jdk.internal.misc.Unsafe
 exports jdk.internal.misc to jdk.aot;
diff --git a/jdk/src/java.base/unix/native/launcher/jexec.c b/jdk/src/java.base/unix/native/launcher/jexec.c
index d288823..bd6458c 100644
--- a/jdk/src/java.base/unix/native/launcher/jexec.c
+++ b/jdk/src/java.base/unix/native/launcher/jexec.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -332,7 +332,7 @@
 
                 if (end <= count) {
                     end -= 4; // make sure there are 4 bytes to read at start
-                    while (start < end) {
+                    while (start <= end) {
                         off_t xhid  = SH(buf, start);
                         off_t xdlen = SH(buf, start + 2);
 
diff --git a/jdk/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c b/jdk/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
index 6c0e1cc..2702849 100644
--- a/jdk/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
+++ b/jdk/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -244,7 +244,8 @@
         int status;
         while (waitpid(pid, &status, 0) < 0) {
             switch (errno) {
-                case ECHILD: return 0;
+                case ECHILD:
+                    return java_lang_ProcessHandleImpl_NOT_A_CHILD; // No child
                 case EINTR: break;
                 default: return -1;
             }
@@ -269,9 +270,10 @@
         memset(&siginfo, 0, sizeof siginfo);
         while (waitid(P_PID, pid, &siginfo, options) < 0) {
             switch (errno) {
-            case ECHILD: return 0;
-            case EINTR: break;
-            default: return -1;
+                case ECHILD:
+                    return java_lang_ProcessHandleImpl_NOT_A_CHILD; // No child
+                case EINTR: break;
+                default: return -1;
             }
         }
 
diff --git a/jdk/src/java.base/windows/classes/java/lang/ProcessImpl.java b/jdk/src/java.base/windows/classes/java/lang/ProcessImpl.java
index 988234d..d4063bd 100644
--- a/jdk/src/java.base/windows/classes/java/lang/ProcessImpl.java
+++ b/jdk/src/java.base/windows/classes/java/lang/ProcessImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -523,7 +523,7 @@
 
     @Override
     public CompletableFuture<Process> onExit() {
-        return ProcessHandleImpl.completion(getPid(), false)
+        return ProcessHandleImpl.completion(pid(), false)
                 .handleAsync((exitStatus, unusedThrowable) -> this);
     }
 
@@ -550,8 +550,8 @@
     private static native void terminateProcess(long handle);
 
     @Override
-    public long getPid() {
-        return processHandle.getPid();
+    public long pid() {
+        return processHandle.pid();
     }
 
     private static native int getProcessId0(long handle);
@@ -572,7 +572,7 @@
     @Override
     public String toString() {
         int exitCode = getExitCodeProcess(handle);
-        return new StringBuilder("Process[pid=").append(getPid())
+        return new StringBuilder("Process[pid=").append(pid())
                 .append(", exitValue=").append(exitCode == STILL_ACTIVE ? "\"not exited\"" : exitCode)
                 .append("]").toString();
     }
diff --git a/jdk/src/java.base/windows/native/libjli/cmdtoargs.c b/jdk/src/java.base/windows/native/libjli/cmdtoargs.c
index f984885..955775f 100644
--- a/jdk/src/java.base/windows/native/libjli/cmdtoargs.c
+++ b/jdk/src/java.base/windows/native/libjli/cmdtoargs.c
@@ -205,9 +205,9 @@
     size_t i, cnt;
 
     JLI_List envArgs = JLI_List_new(1);
-    if (JLI_AddArgsFromEnvVar(envArgs, JAVA_OPTIONS)) {
+    if (JLI_AddArgsFromEnvVar(envArgs, JDK_JAVA_OPTIONS)) {
         // JLI_SetTraceLauncher is not called yet
-        // Show _JAVA_OPTIONS content along with JAVA_OPTIONS to aid diagnosis
+        // Show _JAVA_OPTIONS content along with JDK_JAVA_OPTIONS to aid diagnosis
         if (getenv(JLDEBUG_ENV_ENTRY)) {
             char *tmp = getenv("_JAVA_OPTIONS");
             if (NULL != tmp) {
diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
index becfd05..7cc256e 100644
--- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
@@ -211,6 +211,9 @@
      *     representationClass = java.awt.Image
      *     mimeType            = "image/x-java-image"
      * </pre>
+     * Will be {@code null} if {@code java.awt.Image} is not visible, the
+     * {@code java.desktop} module is not loaded, or the {@code java.desktop}
+     * module is not in the run-time image.
      */
     public static final DataFlavor imageFlavor = createConstant("image/x-java-image; class=java.awt.Image", "Image");
 
diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/package-info.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/package-info.java
new file mode 100644
index 0000000..c13a4be
--- /dev/null
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/package-info.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides interfaces and classes for transferring data between and within
+ * applications. It defines the notion of a "transferable" object, which is an
+ * object capable of being transferred between or within applications. An object
+ * identifies itself as being transferable by implementing the Transferable
+ * interface.
+ * <p>
+ * It also provides a clipboard mechanism, which is an object that temporarily
+ * holds a transferable object that can be transferred between or within an
+ * application. The clipboard is typically used for copy and paste operations.
+ * Although it is possible to create a clipboard to use within an application,
+ * most applications will use the system clipboard to ensure the data can be
+ * transferred across applications running on the platform.
+ *
+ * @since 1.1
+ */
+package java.awt.datatransfer;
diff --git a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/package.html b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/package.html
deleted file mode 100644
index c3b55e8..0000000
--- a/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/package.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides interfaces and classes for transferring data
-between and within applications.  It defines the notion of a
-"transferable" object, which is an object capable of being
-transferred between or within applications. An object identifies
-itself as being transferable by implementing the Transferable
-interface.
-<p>
-It also provides a clipboard mechanism, which is an object that
-temporarily holds a transferable object that can be transferred
-between or within an application. The clipboard is typically used
-for copy and paste operations. Although it is possible to create
-a clipboard to use within an application, most applications will
-use the system clipboard to ensure the data can be transferred
-across applications running on the platform.
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.1
-</body>
-</html>
diff --git a/jdk/src/java.datatransfer/share/classes/module-info.java b/jdk/src/java.datatransfer/share/classes/module-info.java
index ea3f9c2..41fbc8d 100644
--- a/jdk/src/java.datatransfer/share/classes/module-info.java
+++ b/jdk/src/java.datatransfer/share/classes/module-info.java
@@ -24,7 +24,10 @@
  */
 
 /**
- * Defines an API for transferring data between and within applications.
+ * Defines the API for transferring data between and within applications.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.datatransfer {
     exports java.awt.datatransfer;
diff --git a/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIConstants.java b/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIConstants.java
index 8e10513..175af75 100644
--- a/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIConstants.java
+++ b/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIConstants.java
@@ -78,7 +78,7 @@
                 return "THUMB_START";
             } else if (hit == WINDOW_TITLE_BAR_HEIGHT) {
                 return "WINDOW_TITLE_BAR_HEIGHT";
-            } else if (hit == THUMB_START) {
+            } else if (hit == ANIMATION_FRAME) {
                 return "ANIMATION_FRAME";
             }
             return getClass().getSimpleName();
diff --git a/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIControl.java b/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIControl.java
index 115002b..e357944 100644
--- a/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIControl.java
+++ b/jdk/src/java.desktop/macosx/classes/apple/laf/JRSUIControl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -114,6 +114,7 @@
         changes.putAll(other.changes);
     }
 
+    @SuppressWarnings("deprecation")
     protected synchronized void finalize() throws Throwable {
         if (cfDictionaryPtr == 0) return;
         disposeCFDictionary(cfDictionaryPtr);
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java
index c0a4009..9bcafea 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,24 @@
 import java.awt.PopupMenu;
 import java.awt.Toolkit;
 import java.awt.Window;
-import java.awt.desktop.*;
+import java.awt.desktop.AboutHandler;
+import java.awt.desktop.AppForegroundListener;
+import java.awt.desktop.AppHiddenListener;
+import java.awt.desktop.AppReopenedListener;
+import java.awt.desktop.OpenFilesEvent;
+import java.awt.desktop.OpenFilesHandler;
+import java.awt.desktop.OpenURIEvent;
+import java.awt.desktop.OpenURIHandler;
+import java.awt.desktop.PreferencesHandler;
+import java.awt.desktop.PrintFilesEvent;
+import java.awt.desktop.PrintFilesHandler;
+import java.awt.desktop.QuitHandler;
+import java.awt.desktop.QuitResponse;
+import java.awt.desktop.QuitStrategy;
+import java.awt.desktop.ScreenSleepListener;
+import java.awt.desktop.SystemEventListener;
+import java.awt.desktop.SystemSleepListener;
+import java.awt.desktop.UserSessionListener;
 import java.beans.Beans;
 
 import javax.swing.JMenuBar;
@@ -108,10 +125,10 @@
      *
      * @see AppForegroundListener
      * @see AppHiddenListener
-     * @see AppReOpenedListener
-     * @see AppScreenSleepListener
-     * @see AppSystemSleepListener
-     * @see AppUserSessionListener
+     * @see AppReopenedListener
+     * @see ScreenSleepListener
+     * @see SystemSleepListener
+     * @see UserSessionListener
      *
      * @param listener
      * @since Java for Mac OS X 10.6 Update 3
@@ -126,10 +143,10 @@
      *
      * @see AppForegroundListener
      * @see AppHiddenListener
-     * @see AppReOpenedListener
-     * @see AppScreenSleepListener
-     * @see AppSystemSleepListener
-     * @see AppUserSessionListener
+     * @see AppReopenedListener
+     * @see ScreenSleepListener
+     * @see SystemSleepListener
+     * @see UserSessionListener
      *
      * @param listener
      * @since Java for Mac OS X 10.6 Update 3
@@ -144,7 +161,7 @@
      *
      * Setting the {@link AboutHandler} to {@code null} reverts it to the default Cocoa About window.
      *
-     * @param aboutHandler the handler to respond to the {@link AboutHandler#handleAbout()} message
+     * @param aboutHandler the handler to respond to the {@link AboutHandler#handleAbout} message
      * @since Java for Mac OS X 10.6 Update 3
      * @since Java for Mac OS X 10.5 Update 8
      */
@@ -167,7 +184,7 @@
 
     /**
      * Installs the handler which is notified when the application is asked to open a list of files.
-     * The {@link OpenFilesHandler#openFiles(AppEvent.OpenFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist.
+     * The {@link OpenFilesHandler#openFiles(OpenFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist.
      * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a {@code CFBundleDocumentTypes} key to your app's Info.plist.
      *
      * @param openFileHandler
@@ -180,7 +197,7 @@
 
     /**
      * Installs the handler which is notified when the application is asked to print a list of files.
-     * The {@link PrintFilesHandler#printFiles(AppEvent.PrintFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist.
+     * The {@link PrintFilesHandler#printFiles(PrintFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist.
      * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a {@code CFBundleDocumentTypes} key to your app's Info.plist.
      *
      * @param printFileHandler
@@ -193,10 +210,10 @@
 
     /**
      * Installs the handler which is notified when the application is asked to open a URL.
-     * The {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleURLTypes} array present in it's Info.plist.
+     * The {@link OpenURIHandler#openURI(OpenURIEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleURLTypes} array present in it's Info.plist.
      * See the <a href="http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference">Info.plist Key Reference</a> for more information about adding a {@code CFBundleURLTypes} key to your app's Info.plist.
      *
-     * Setting the handler to {@code null} causes all {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be enqueued until another handler is set.
+     * Setting the handler to {@code null} causes all {@link OpenURIHandler#openURI(OpenURIEvent)} requests to be enqueued until another handler is set.
      *
      * @param openURIHandler
      * @since Java for Mac OS X 10.6 Update 3
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java
index aba03e9..da1c967 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,26 @@
 
 package com.apple.eawt;
 
+import java.awt.desktop.AboutHandler;
+import java.awt.desktop.AppForegroundListener;
+import java.awt.desktop.AppHiddenListener;
+import java.awt.desktop.AppReopenedListener;
+import java.awt.desktop.OpenFilesHandler;
+import java.awt.desktop.OpenURIHandler;
+import java.awt.desktop.PreferencesHandler;
+import java.awt.desktop.PrintFilesHandler;
+import java.awt.desktop.QuitHandler;
+import java.awt.desktop.ScreenSleepListener;
+import java.awt.desktop.SystemEventListener;
+import java.awt.desktop.SystemSleepListener;
+import java.awt.desktop.UserSessionListener;
+
 /**
  * An abstract adapter class for receiving {@code ApplicationEvents}.
  *
  * ApplicationEvents are deprecated. Use individual app event listeners or handlers instead.
  *
- * @see Application#addAppEventListener(AppEventListener)
+ * @see Application#addAppEventListener(SystemEventListener)
  *
  * @see AboutHandler
  * @see PreferencesHandler
@@ -39,14 +53,14 @@
  * @see PrintFilesHandler
  * @see QuitHandler
  *
- * @see AppReOpenedListener
+ * @see AppReopenedListener
  * @see AppForegroundListener
  * @see AppHiddenListener
  * @see UserSessionListener
  * @see ScreenSleepListener
  * @see SystemSleepListener
  *
- * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link MacQuitResponse}.
+ * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReopenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link MacQuitResponse}.
  * @since 1.4
  */
 @SuppressWarnings("deprecation")
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java
index 49617f6..98c1bc5 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,18 @@
 
 package com.apple.eawt;
 
+import java.awt.desktop.AboutHandler;
+import java.awt.desktop.AppReopenedListener;
+import java.awt.desktop.OpenFilesHandler;
+import java.awt.desktop.PreferencesHandler;
+import java.awt.desktop.PrintFilesHandler;
+import java.awt.desktop.QuitHandler;
 import java.util.EventObject;
 
 /**
  * The class of events sent to the deprecated ApplicationListener callbacks.
  *
- * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link MacQuitResponse}
+ * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReopenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link MacQuitResponse}
  * @since 1.4
  */
 @Deprecated
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java
index eabcb92..74bec65 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,25 @@
 
 package com.apple.eawt;
 
+import java.awt.desktop.AboutHandler;
+import java.awt.desktop.AppForegroundListener;
+import java.awt.desktop.AppHiddenListener;
+import java.awt.desktop.AppReopenedListener;
+import java.awt.desktop.OpenFilesHandler;
+import java.awt.desktop.OpenURIHandler;
+import java.awt.desktop.PreferencesHandler;
+import java.awt.desktop.PrintFilesHandler;
+import java.awt.desktop.QuitHandler;
+import java.awt.desktop.ScreenSleepListener;
+import java.awt.desktop.SystemEventListener;
+import java.awt.desktop.SystemSleepListener;
+import java.awt.desktop.UserSessionListener;
 import java.util.EventListener;
 
 /**
  * ApplicationEvents are deprecated. Use individual AppEvent listeners or handlers instead.
  *
- * @see Application#addAppEventListener(AppEventListener)
+ * @see Application#addAppEventListener(SystemEventListener)
  *
  * @see AboutHandler
  * @see PreferencesHandler
@@ -39,7 +52,7 @@
  * @see PrintFilesHandler
  * @see QuitHandler
  *
- * @see AppReOpenedListener
+ * @see AppReopenedListener
  * @see AppForegroundListener
  * @see AppHiddenListener
  * @see UserSessionListener
@@ -47,7 +60,7 @@
  * @see SystemSleepListener
  *
  * @since 1.4
- * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReOpenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link MacQuitResponse}
+ * @deprecated replaced by {@link AboutHandler}, {@link PreferencesHandler}, {@link AppReopenedListener}, {@link OpenFilesHandler}, {@link PrintFilesHandler}, {@link QuitHandler}, {@link MacQuitResponse}
  */
 @SuppressWarnings("deprecation")
 @Deprecated
@@ -146,7 +159,7 @@
      * event is sent from another application, include that code as part of this handler.
      *
      * @param event the Reopen Application event
-     * @deprecated use {@link AppReOpenedListener}
+     * @deprecated use {@link AppReopenedListener}
      */
     @Deprecated
     public void handleReOpenApplication(ApplicationEvent event);
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenAdapter.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenAdapter.java
index 4a124da..79fcd34 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenAdapter.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,15 @@
 
 package com.apple.eawt;
 
+import java.awt.Window;
+
 import com.apple.eawt.event.FullScreenEvent;
 
 /**
  * Abstract adapter class for receiving fullscreen events. This class is provided
  * as a convenience for creating listeners.
  *
- * Subclasses registered with {@link FullScreenUtilities#addFullScreenListenerTo(javax.swing.RootPaneContainer, FullScreenListener)}
+ * Subclasses registered with {@link FullScreenUtilities#addFullScreenListenerTo(Window, FullScreenListener)}
  * will receive all entering/entered/exiting/exited full screen events.
  *
  * @see FullScreenUtilities
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenListener.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenListener.java
index 737a67f..d3490ef 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenListener.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,25 +37,25 @@
 public interface FullScreenListener extends EventListener {
         /**
      * Invoked when a window has started to enter full screen.
-     * @param event containing the specific window entering full screen.
+     * @param e containing the specific window entering full screen.
      */
         public void windowEnteringFullScreen(final FullScreenEvent e);
 
         /**
      * Invoked when a window has fully entered full screen.
-     * @param event containing the specific window which has entered full screen.
+     * @param e containing the specific window which has entered full screen.
      */
         public void windowEnteredFullScreen(final FullScreenEvent e);
 
         /**
      * Invoked when a window has started to exit full screen.
-     * @param event containing the specific window exiting full screen.
+     * @param e containing the specific window exiting full screen.
      */
         public void windowExitingFullScreen(final FullScreenEvent e);
 
         /**
      * Invoked when a window has fully exited full screen.
-     * @param event containing the specific window which has exited full screen.
+     * @param e containing the specific window which has exited full screen.
      */
         public void windowExitedFullScreen(final FullScreenEvent e);
 }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java
index 682c07e..3847212 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/FullScreenUtilities.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
 /**
  * Utility class perform animated full screen actions to top-level {@link Window}s.
  *
- * This class manages the relationship between {@link Windows}s and the {@link FullScreenListener}s
+ * This class manages the relationship between {@link Window}s and the {@link FullScreenListener}s
  * attached to them. It's design is similar to the Java SE 6u10 {@link com.sun.awt.AWTUtilities}
  * class which adds additional functionality to AWT Windows, without adding new API to the
  * {@link java.awt.Window} class.
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/MacQuitResponse.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/MacQuitResponse.java
index ab37dfc..5b9eb05 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/MacQuitResponse.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/MacQuitResponse.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,14 @@
 
 package com.apple.eawt;
 
+import java.awt.desktop.QuitEvent;
+import java.awt.desktop.QuitHandler;
 import java.awt.desktop.QuitResponse;
+import java.awt.desktop.QuitStrategy;
 
 /**
  * Used to respond to a request to quit the application.
- * The QuitResponse may be used after the {@link QuitHandler#handleQuitRequestWith(AppEvent.QuitEvent, MacQuitResponse)} method has returned, and may be used from any thread.
+ * The QuitResponse may be used after the {@link QuitHandler#handleQuitRequestWith(QuitEvent, QuitResponse)} method has returned, and may be used from any thread.
  *
  * @see Application#setQuitHandler(QuitHandler)
  * @see QuitHandler
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureAdapter.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureAdapter.java
index 6e17f53..0f6c6d9 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureAdapter.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
  * Abstract adapter class for receiving gesture events. This class is provided
  * as a convenience for creating listeners.
  *
- * Subclasses registered with {@link GestureUtilities#addGestureListenerTo()}
+ * Subclasses registered with {@link GestureUtilities#addGestureListenerTo}
  * will receive all phase, magnification, rotation, and swipe events.
  *
  * @see GestureUtilities
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureEvent.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureEvent.java
index 7c35589..6e313b0 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureEvent.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GestureEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 package com.apple.eawt.event;
 
 import java.awt.*;
+import java.awt.event.InputEvent;
 
 /**
  * Abstract event all gestures inherit from.
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GesturePhaseListener.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GesturePhaseListener.java
index c0fc343..e6d90db 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GesturePhaseListener.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/GesturePhaseListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,13 +39,13 @@
 public interface GesturePhaseListener extends GestureListener {
     /**
      * Invoked when the user has started a continuous gesture.
-     * @param event representing the start of a continuous gesture.
+     * @param e representing the start of a continuous gesture.
      */
     public void gestureBegan(final GesturePhaseEvent e);
 
     /**
      * Invoked when the user has stopped a continuous gesture.
-     * @param event representing the end of a continuous gesture.
+     * @param e representing the end of a continuous gesture.
      */
     public void gestureEnded(final GesturePhaseEvent e);
 }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/MagnificationListener.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/MagnificationListener.java
index 35130ba..d327b70 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/MagnificationListener.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/MagnificationListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
 public interface MagnificationListener extends GestureListener {
     /**
      * Invoked when a magnification gesture is performed by the user.
-     * @param event containing the scale of the magnification.
+     * @param e containing the scale of the magnification.
      */
     public void magnify(final MagnificationEvent e);
 }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/RotationListener.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/RotationListener.java
index ae3ed06..9fcbed7 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/RotationListener.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/RotationListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
 public interface RotationListener extends GestureListener {
     /**
      * Invoked when a rotation gesture is performed by the user.
-     * @param event containing an abstract measure of rotation.
+     * @param e containing an abstract measure of rotation.
      */
     public void rotate(final RotationEvent e);
 }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/SwipeListener.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/SwipeListener.java
index cfbbdc2..598eb38 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/SwipeListener.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/SwipeListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,25 +38,25 @@
 public interface SwipeListener extends GestureListener {
     /**
      * Invoked when an upwards swipe gesture is performed by the user.
-     * @param event representing the occurrence of a swipe.
+     * @param e representing the occurrence of a swipe.
      */
     public void swipedUp(final SwipeEvent e);
 
     /**
      * Invoked when a downward swipe gesture is performed by the user.
-     * @param event representing the occurrence of a swipe.
+     * @param e representing the occurrence of a swipe.
      */
     public void swipedDown(final SwipeEvent e);
 
     /**
      * Invoked when a leftward swipe gesture is performed by the user.
-     * @param event representing the occurrence of a swipe.
+     * @param e representing the occurrence of a swipe.
      */
     public void swipedLeft(final SwipeEvent e);
 
     /**
      * Invoked when a rightward swipe gesture is performed by the user.
-     * @param event representing the occurrence of a swipe.
+     * @param e representing the occurrence of a swipe.
      */
     public void swipedRight(final SwipeEvent e);
 }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/package-info.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/package-info.java
new file mode 100644
index 0000000..bb8020d
--- /dev/null
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/package-info.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Classes for receiving gesture events. Provides a mechanism to receive various
+ * gesture events on JComponents. Gesture notifications are relayed up the
+ * component hierarchy from the deepest component under the cursor to the
+ * top-level container. Events may be consumed by deeper components to prevent
+ * them from propagating to higher components. Gesture listeners are added to
+ * components using the GestureUtilities helper class.
+ */
+package com.apple.eawt.event;
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/package.html b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/package.html
deleted file mode 100644
index 0946e60..0000000
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/package.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title></title>
-</head>
-<body bgcolor="white">
-Classes for receiving gesture events.
-
-Provides a mechanism to receive various gesture events on JComponents. Gesture notifications are relayed up the component hierarchy from the deepest component under the cursor to the top-level container. Events may be consumed by deeper components to prevent them from propagating to higher components.
-
-Gesture listeners are added to components using the GestureUtilities helper class.
-</body>
-</html>
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/package-info.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/package-info.java
new file mode 100644
index 0000000..105bc09
--- /dev/null
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/package-info.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes for integrating Java applications with the native
+ * application environment. These classes provide a simple way to implement
+ * native features to fine tune Java applications on Mac OS X. These listeners
+ * and handlers can help make Java applications behaviors and user interface
+ * indistinguishable from native applications. For further information on the
+ * Mac OS X user interface, consult the <a target=_blank
+ * href="http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines">
+ * Aqua Human Interface Guidelines</a>.
+ */
+package com.apple.eawt;
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/package.html b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/package.html
deleted file mode 100644
index 81bc1a8..0000000
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/package.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title></title>
-</head>
-<body bgcolor="white">
-Provides classes for integrating Java applications with the native application environment.
-
-These classes provide a simple way to implement native features to fine tune Java applications on Mac OS X. These listeners and handlers can help make Java applications behaviors and user interface indistinguishable from native applications. For further information on the Mac OS X user interface, consult the <a target=_blank href="http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines"> Aqua Human Interface Guidelines</a>.</body>
-</html>
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eio/package-info.java b/jdk/src/java.desktop/macosx/classes/com/apple/eio/package-info.java
new file mode 100644
index 0000000..ba664d6
--- /dev/null
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/eio/package-info.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes to allow you to take advantage of functionality of the
+ * underlying Mac OS X operating system. The classes in this package provide
+ * access to features of Mac OS X that may or may not be present on other
+ * platforms. It should be noted that depending on any of these features ties
+ * Java applications to Mac OS X. For more thorough explanation of some of the
+ * topics discussed here, please refer to <a target=_blank
+ * href="http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/index.html">
+ * Inside Mac OS X: System Overview</a>.
+ */
+package com.apple.eio;
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eio/package.html b/jdk/src/java.desktop/macosx/classes/com/apple/eio/package.html
deleted file mode 100644
index 922b5b4..0000000
--- a/jdk/src/java.desktop/macosx/classes/com/apple/eio/package.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-<head>
-</head>
-<body bgcolor="white">
-Provides classes to allow you to take advantage of functionality of the underlying Mac OS X operating system.
-The classes in this package provide access to features of Mac OS X that may or may not be present on other platforms. It should be noted that depending on any of these features ties Java applications to Mac OS X. For more thorough explanation of some of the topics discussed here, please refer to <a target=_blank href="http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/index.html">Inside Mac OS X: System Overview</a>.</body>
-</html>
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java
index aa2947c..f58c518 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java
@@ -37,7 +37,7 @@
 import com.apple.laf.AquaUtils.*;
 
 public abstract class AquaButtonBorder extends AquaBorder implements Border, UIResource {
-    public static final RecyclableSingleton<Dynamic> fDynamic = new RecyclableSingletonFromDefaultConstructor<Dynamic>(Dynamic.class);
+    private static final RecyclableSingleton<Dynamic> fDynamic = new RecyclableSingletonFromDefaultConstructor<Dynamic>(Dynamic.class);
     public static AquaButtonBorder getDynamicButtonBorder() {
         return fDynamic.get();
     }
@@ -47,12 +47,12 @@
         return fToggle.get();
     }
 
-    public static final RecyclableSingleton<Toolbar> fToolBar = new RecyclableSingletonFromDefaultConstructor<Toolbar>(Toolbar.class);
+    private static final RecyclableSingleton<Toolbar> fToolBar = new RecyclableSingletonFromDefaultConstructor<Toolbar>(Toolbar.class);
     public static Border getToolBarButtonBorder() {
         return fToolBar.get();
     }
 
-    public static final RecyclableSingleton<Named> fBevel = new RecyclableSingleton<Named>() {
+    private static final RecyclableSingleton<Named> fBevel = new RecyclableSingleton<Named>() {
         protected Named getInstance() {
             return new Named(Widget.BUTTON_BEVEL, new SizeDescriptor(new SizeVariant().alterMargins(2, 4, 2, 4)));
         }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonCheckBoxUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonCheckBoxUI.java
index d467cca..bef9fe8 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonCheckBoxUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonCheckBoxUI.java
@@ -34,8 +34,8 @@
 import com.apple.laf.AquaUtils.*;
 
 public class AquaButtonCheckBoxUI extends AquaButtonLabeledUI {
-    protected static final RecyclableSingleton<AquaButtonCheckBoxUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaButtonCheckBoxUI>(AquaButtonCheckBoxUI.class);
-    protected static final RecyclableSingleton<ImageIcon> sizingIcon = new RecyclableSingleton<ImageIcon>() {
+    private static final RecyclableSingleton<AquaButtonCheckBoxUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaButtonCheckBoxUI>(AquaButtonCheckBoxUI.class);
+    private static final RecyclableSingleton<ImageIcon> sizingIcon = new RecyclableSingleton<ImageIcon>() {
         protected ImageIcon getInstance() {
             return new ImageIcon(AquaNativeResources.getRadioButtonSizerImage());
         }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java
index 0d48390..aa48414 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java
@@ -138,7 +138,7 @@
         return typeDefinitions.get().get(name);
     }
 
-    protected static final RecyclableSingleton<Map<String, TypeSpecifier>> typeDefinitions = new RecyclableSingleton<Map<String, TypeSpecifier>>() {
+    private static final RecyclableSingleton<Map<String, TypeSpecifier>> typeDefinitions = new RecyclableSingleton<Map<String, TypeSpecifier>>() {
         protected Map<String, TypeSpecifier> getInstance() {
             return getAllTypes();
         }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java
index c05f191..5f6a076 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java
@@ -42,9 +42,9 @@
 import com.apple.laf.AquaUtils.RecyclableSingleton;
 
 public abstract class AquaButtonLabeledUI extends AquaButtonToggleUI implements Sizeable {
-    protected static RecyclableSizingIcon regularIcon = new RecyclableSizingIcon(18);
-    protected static RecyclableSizingIcon smallIcon = new RecyclableSizingIcon(16);
-    protected static RecyclableSizingIcon miniIcon = new RecyclableSizingIcon(14);
+    private static final RecyclableSizingIcon regularIcon = new RecyclableSizingIcon(18);
+    private static final RecyclableSizingIcon smallIcon = new RecyclableSizingIcon(16);
+    private static final RecyclableSizingIcon miniIcon = new RecyclableSizingIcon(14);
 
     protected static class RecyclableSizingIcon extends RecyclableSingleton<Icon> {
         final int iconSize;
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java
index cb46534..a8da180 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonRadioUI.java
@@ -34,8 +34,8 @@
 import com.apple.laf.AquaUtils.*;
 
 public class AquaButtonRadioUI extends AquaButtonLabeledUI {
-    protected static final RecyclableSingleton<AquaButtonRadioUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaButtonRadioUI>(AquaButtonRadioUI.class);
-    protected static final RecyclableSingleton<ImageIcon> sizingIcon = new RecyclableSingleton<ImageIcon>() {
+    private static final RecyclableSingleton<AquaButtonRadioUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaButtonRadioUI>(AquaButtonRadioUI.class);
+    private static final RecyclableSingleton<ImageIcon> sizingIcon = new RecyclableSingleton<ImageIcon>() {
         protected ImageIcon getInstance() {
             return new ImageIcon(AquaNativeResources.getRadioButtonSizerImage());
         }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonToggleUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonToggleUI.java
index d61126e..d4f55f3 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonToggleUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonToggleUI.java
@@ -32,7 +32,7 @@
 
 public class AquaButtonToggleUI extends AquaButtonUI {
     // Create PLAF
-    static final RecyclableSingleton<AquaButtonToggleUI> aquaToggleButtonUI = new RecyclableSingletonFromDefaultConstructor<AquaButtonToggleUI>(AquaButtonToggleUI.class);
+    private static final RecyclableSingleton<AquaButtonToggleUI> aquaToggleButtonUI = new RecyclableSingletonFromDefaultConstructor<AquaButtonToggleUI>(AquaButtonToggleUI.class);
     public static ComponentUI createUI(final JComponent b) {
         return aquaToggleButtonUI.get();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java
index 4d6d463..b173ee1 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java
@@ -48,7 +48,7 @@
     private static final String BUTTON_TYPE = "JButton.buttonType";
     private static final String SEGMENTED_BUTTON_POSITION = "JButton.segmentPosition";
 
-    protected static final RecyclableSingleton<AquaButtonUI> buttonUI = new RecyclableSingletonFromDefaultConstructor<AquaButtonUI>(AquaButtonUI.class);
+    private static final RecyclableSingleton<AquaButtonUI> buttonUI = new RecyclableSingletonFromDefaultConstructor<AquaButtonUI>(AquaButtonUI.class);
     public static ComponentUI createUI(final JComponent c) {
         return buttonUI.get();
     }
@@ -462,7 +462,7 @@
         return d;
     }
 
-    static final RecyclableSingleton<AquaHierarchyButtonListener> fHierListener = new RecyclableSingletonFromDefaultConstructor<AquaHierarchyButtonListener>(AquaHierarchyButtonListener.class);
+    private static final RecyclableSingleton<AquaHierarchyButtonListener> fHierListener = new RecyclableSingletonFromDefaultConstructor<AquaHierarchyButtonListener>(AquaHierarchyButtonListener.class);
     static AquaHierarchyButtonListener getAquaHierarchyButtonListener() {
         return fHierListener.get();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java
index 88faf6b..7336fbd 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxPopup.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,29 @@
 
 package com.apple.laf;
 
-import java.awt.*;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
 import java.awt.Insets;
+import java.awt.Point;
 import java.awt.Rectangle;
-import java.awt.event.*;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseEvent;
 
-import javax.swing.*;
+import javax.swing.Box;
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.ListCellRenderer;
+import javax.swing.SwingUtilities;
 import javax.swing.plaf.basic.BasicComboPopup;
 
 import sun.lwawt.macosx.CPlatformWindow;
 
 @SuppressWarnings("serial") // Superclass is not serializable across versions
-class AquaComboBoxPopup extends BasicComboPopup {
+final class AquaComboBoxPopup extends BasicComboPopup {
     static final int FOCUS_RING_PAD_LEFT = 6;
     static final int FOCUS_RING_PAD_RIGHT = 6;
     static final int FOCUS_RING_PAD_BOTTOM = 5;
@@ -154,9 +165,15 @@
     protected JList<Object> createList() {
         return new JList<Object>(comboBox.getModel()) {
             @Override
+            @SuppressWarnings("deprecation")
             public void processMouseEvent(MouseEvent e) {
                 if (e.isMetaDown()) {
-                    e = new MouseEvent((Component)e.getSource(), e.getID(), e.getWhen(), e.getModifiers() ^ InputEvent.META_MASK, e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), MouseEvent.NOBUTTON);
+                    e = new MouseEvent((Component) e.getSource(), e.getID(),
+                                       e.getWhen(),
+                                       e.getModifiers() ^ InputEvent.META_MASK,
+                                       e.getX(), e.getY(), e.getXOnScreen(),
+                                       e.getYOnScreen(), e.getClickCount(),
+                                       e.isPopupTrigger(), MouseEvent.NOBUTTON);
                 }
                 super.processMouseEvent(e);
             }
@@ -195,9 +212,6 @@
         //System.err.println("GetBestScreenBounds p: "+ p.x + ", " + p.y);
         final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
         final GraphicsDevice[] gs = ge.getScreenDevices();
-        //System.err.println("  gs.length = " + gs.length);
-        final Rectangle comboBoxBounds = comboBox.getBounds();
-
         for (final GraphicsDevice gd : gs) {
             final GraphicsConfiguration[] gc = gd.getConfigurations();
             for (final GraphicsConfiguration element0 : gc) {
@@ -209,15 +223,14 @@
         }
 
         // Hmm.  Origin's off screen, but is any part on?
+        final Rectangle comboBoxBounds = comboBox.getBounds();
         comboBoxBounds.setLocation(p);
         for (final GraphicsDevice gd : gs) {
             final GraphicsConfiguration[] gc = gd.getConfigurations();
             for (final GraphicsConfiguration element0 : gc) {
                 final Rectangle gcBounds = element0.getBounds();
                 if (gcBounds.intersects(comboBoxBounds)) {
-                    if (gcBounds.contains(p)) {
-                        return getAvailableScreenArea(gcBounds, element0);
-                    }
+                    return getAvailableScreenArea(gcBounds, element0);
                 }
             }
         }
@@ -228,8 +241,15 @@
     private Rectangle getAvailableScreenArea(Rectangle bounds,
                                              GraphicsConfiguration gc) {
         Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
-        return new Rectangle(0, insets.top, bounds.width,
-                bounds.height - insets.top);
+        return new Rectangle(bounds.x + insets.left, bounds.y + insets.top,
+                             bounds.width - insets.left - insets.right,
+                             bounds.height - insets.top - insets.bottom);
+    }
+
+    private int getComboBoxEdge(int py, boolean bottom) {
+        int offset = bottom ? 9 : -9;
+        // if py is less than new y we have a clipped combo, so leave it alone.
+        return Math.min((py / 2) + offset, py);
     }
 
     @Override
@@ -240,7 +260,7 @@
         if (isPopdown && !isTableCellEditor) {
             // place the popup just below the button, which is
             // near the center of a large combo box
-            py = Math.min((py / 2) + 9, py); // if py is less than new y we have a clipped combo, so leave it alone.
+            py = getComboBoxEdge(py, true);
         }
 
         // px & py are relative to the combo box
@@ -285,8 +305,12 @@
         // Make sure it's all on the screen - shift it by the amount it's off
         p.x += px;
         p.y += py; // Screen location of px & py
-        if (p.x < scrBounds.x) px -= (p.x + scrBounds.x);
-        if (p.y < scrBounds.y) py -= (p.y + scrBounds.y);
+        if (p.x < scrBounds.x) {
+            px = px + (scrBounds.x - p.x);
+        }
+        if (p.y < scrBounds.y) {
+            py = py + (scrBounds.y - p.y);
+        }
 
         final Point top = new Point(0, 0);
         SwingUtilities.convertPointFromScreen(top, comboBox);
@@ -318,22 +342,27 @@
         }
 
         final Rectangle r = new Rectangle(px, py, pw, ph);
-        if (py + ph > scrBounds.y + scrBounds.height) {
-            if (ph <= -scrBounds.y ) {
-                // popup goes above
-                r.y = -ph ;
-            } else {
-                // a full screen height popup
-                r.y = scrBounds.y + Math.max(0, (scrBounds.height - ph) / 2 );
-                r.height = Math.min(scrBounds.height, ph);
-            }
+        if (r.y + r.height < top.y + scrBounds.y + scrBounds.height) {
+            return r;
+        }
+        // Check whether it goes below the bottom of the screen, if so flip it
+        int newY = getComboBoxEdge(comboBoxBounds.height, false) - ph - comboBoxInsets.top;
+        if (newY > top.y + scrBounds.y) {
+            return new Rectangle(px, newY, r.width, r.height);
+        } else {
+            // There are no place at top, move popup to the center of the screen
+            r.y = top.y + scrBounds.y + Math.max(0, (scrBounds.height - ph) / 2 );
+            r.height = Math.min(scrBounds.height, ph);
         }
         return r;
     }
 
     // The one to use when itemCount <= maxRowCount.  Size never adjusts for arrows
     // We want it positioned so the selected item is right above the combo box
-    protected Rectangle computePopupBoundsForMenu(final int px, final int py, final int pw, final int ph, final int itemCount, final Rectangle scrBounds) {
+    protected Rectangle computePopupBoundsForMenu(final int px, final int py,
+                                                  final int pw, final int ph,
+                                                  final int itemCount,
+                                                  final Rectangle scrBounds) {
         //System.err.println("computePopupBoundsForMenu: " + px + "," + py + " " +  pw + "," + ph);
         //System.err.println("itemCount: " +itemCount +" src: "+ scrBounds);
         int elementSize = 0; //kDefaultItemSize;
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java
index 3cc7b55..e501b12 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java
@@ -594,7 +594,7 @@
     }
 
     @SuppressWarnings("unchecked")
-    static final RecyclableSingleton<ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI>> APPLICATOR = new
+    private static final RecyclableSingleton<ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI>> APPLICATOR = new
             RecyclableSingleton<ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI>>() {
         @Override
         protected ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI> getInstance() {
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java
index b69d2d0..6e0aa18 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileView.java
@@ -75,7 +75,7 @@
     private static native int getNativeLSInfo(final byte[] pathBytes, final boolean isDirectory);
     private static native String getNativePathForResolvedAlias(final byte[] absolutePath, final boolean isDirectory);
 
-    static final RecyclableSingleton<String> machineName = new RecyclableSingleton<String>() {
+    private static final RecyclableSingleton<String> machineName = new RecyclableSingleton<String>() {
         @Override
         protected String getInstance() {
             return getNativeMachineName();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaGroupBorder.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaGroupBorder.java
index 2916eb1..59a437d 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaGroupBorder.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaGroupBorder.java
@@ -35,17 +35,17 @@
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
 public abstract class AquaGroupBorder extends AquaBorder {
-    static final RecyclableSingletonFromDefaultConstructor<? extends Border> tabbedPaneGroupBorder = new RecyclableSingletonFromDefaultConstructor<TabbedPane>(TabbedPane.class);
+    private static final RecyclableSingletonFromDefaultConstructor<? extends Border> tabbedPaneGroupBorder = new RecyclableSingletonFromDefaultConstructor<TabbedPane>(TabbedPane.class);
     public static Border getTabbedPaneGroupBorder() {
         return tabbedPaneGroupBorder.get();
     }
 
-    static final RecyclableSingletonFromDefaultConstructor<? extends Border> titleBorderGroupBorder = new RecyclableSingletonFromDefaultConstructor<Titled>(Titled.class);
+    private static final RecyclableSingletonFromDefaultConstructor<? extends Border> titleBorderGroupBorder = new RecyclableSingletonFromDefaultConstructor<Titled>(Titled.class);
     public static Border getBorderForTitledBorder() {
         return titleBorderGroupBorder.get();
     }
 
-    static final RecyclableSingletonFromDefaultConstructor<? extends Border> titlelessGroupBorder = new RecyclableSingletonFromDefaultConstructor<Titleless>(Titleless.class);
+    private static final RecyclableSingletonFromDefaultConstructor<? extends Border> titlelessGroupBorder = new RecyclableSingletonFromDefaultConstructor<Titleless>(Titleless.class);
     public static Border getTitlelessBorder() {
         return titlelessGroupBorder.get();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaHighlighter.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaHighlighter.java
index 9f4f81f..7b1a1c8 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaHighlighter.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaHighlighter.java
@@ -37,7 +37,7 @@
 import com.apple.laf.AquaUtils.RecyclableSingleton;
 
 public class AquaHighlighter extends DefaultHighlighter implements UIResource {
-    static final RecyclableSingleton<LayerPainter> instance = new RecyclableSingleton<LayerPainter>() {
+    private static final RecyclableSingleton<LayerPainter> instance = new RecyclableSingleton<LayerPainter>() {
         protected LayerPainter getInstance() {
             return new AquaHighlightPainter(null);
         }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java
index 5d43a41..1970bc7 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java
@@ -240,14 +240,14 @@
         }
     }
 
-    protected static final NamedImageSingleton northArrow = new NamedImageSingleton("NSMenuScrollUp");
-    protected static final IconUIResourceSingleton northArrowIcon = new IconUIResourceSingleton(northArrow);
-    protected static final NamedImageSingleton southArrow = new NamedImageSingleton("NSMenuScrollDown");
-    protected static final IconUIResourceSingleton southArrowIcon = new IconUIResourceSingleton(southArrow);
-    protected static final NamedImageSingleton westArrow = new NamedImageSingleton("NSMenuSubmenuLeft");
-    protected static final IconUIResourceSingleton westArrowIcon = new IconUIResourceSingleton(westArrow);
-    protected static final NamedImageSingleton eastArrow = new NamedImageSingleton("NSMenuSubmenu");
-    protected static final IconUIResourceSingleton eastArrowIcon = new IconUIResourceSingleton(eastArrow);
+    private static final NamedImageSingleton northArrow = new NamedImageSingleton("NSMenuScrollUp");
+    private static final IconUIResourceSingleton northArrowIcon = new IconUIResourceSingleton(northArrow);
+    private static final NamedImageSingleton southArrow = new NamedImageSingleton("NSMenuScrollDown");
+    private static final IconUIResourceSingleton southArrowIcon = new IconUIResourceSingleton(southArrow);
+    private static final NamedImageSingleton westArrow = new NamedImageSingleton("NSMenuSubmenuLeft");
+    private static final IconUIResourceSingleton westArrowIcon = new IconUIResourceSingleton(westArrow);
+    private static final NamedImageSingleton eastArrow = new NamedImageSingleton("NSMenuSubmenu");
+    private static final IconUIResourceSingleton eastArrowIcon = new IconUIResourceSingleton(eastArrow);
 
     static Image getArrowImageForDirection(final int direction) {
         switch(direction) {
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameBorder.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameBorder.java
index 4a72d0f..58fc7da 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameBorder.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameBorder.java
@@ -55,7 +55,7 @@
 
     private static final int kContentTester = 100; // For getting region insets
 
-    static final RecyclableSingleton<AquaInternalFrameBorder> documentWindowFrame = new RecyclableSingleton<AquaInternalFrameBorder>() {
+    private static final RecyclableSingleton<AquaInternalFrameBorder> documentWindowFrame = new RecyclableSingleton<AquaInternalFrameBorder>() {
         protected AquaInternalFrameBorder getInstance() {
             return new AquaInternalFrameBorder(WindowType.DOCUMENT);
         }
@@ -64,7 +64,7 @@
         return documentWindowFrame.get();
     }
 
-    static final RecyclableSingleton<AquaInternalFrameBorder> utilityWindowFrame = new RecyclableSingleton<AquaInternalFrameBorder>() {
+    private static final RecyclableSingleton<AquaInternalFrameBorder> utilityWindowFrame = new RecyclableSingleton<AquaInternalFrameBorder>() {
         protected AquaInternalFrameBorder getInstance() {
             return new AquaInternalFrameBorder(WindowType.UTILITY);
         }
@@ -73,7 +73,7 @@
         return utilityWindowFrame.get();
     }
 
-    static final RecyclableSingleton<AquaInternalFrameBorder> dialogWindowFrame = new RecyclableSingleton<AquaInternalFrameBorder>() {
+    private static final RecyclableSingleton<AquaInternalFrameBorder> dialogWindowFrame = new RecyclableSingleton<AquaInternalFrameBorder>() {
         protected AquaInternalFrameBorder getInstance() {
             return new AquaInternalFrameBorder(WindowType.DOCUMENT);
         }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java
index af2aaf0..3a40c49 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameDockIconUI.java
@@ -137,6 +137,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void mouseEntered(final MouseEvent e) {
         if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) return;
         String title = fFrame.getTitle();
@@ -146,6 +147,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void mouseExited(final MouseEvent e) {
         if (fDockLabel != null && (e.getModifiers() & InputEvent.BUTTON1_MASK) == 0) fDockLabel.hide();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java
index fd6bccf..4b09210 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java
@@ -147,7 +147,7 @@
         southPane = c;
     }
 
-    static final RecyclableSingleton<Icon> closeIcon = new RecyclableSingleton<Icon>() {
+    private static final RecyclableSingleton<Icon> closeIcon = new RecyclableSingleton<Icon>() {
         @Override
         protected Icon getInstance() {
             return new AquaInternalFrameButtonIcon(Widget.TITLE_BAR_CLOSE_BOX);
@@ -157,7 +157,7 @@
         return closeIcon.get();
     }
 
-    static final RecyclableSingleton<Icon> minimizeIcon = new RecyclableSingleton<Icon>() {
+    private static final RecyclableSingleton<Icon> minimizeIcon = new RecyclableSingleton<Icon>() {
         @Override
         protected Icon getInstance() {
             return new AquaInternalFrameButtonIcon(Widget.TITLE_BAR_COLLAPSE_BOX);
@@ -167,7 +167,7 @@
         return minimizeIcon.get();
     }
 
-    static final RecyclableSingleton<Icon> zoomIcon = new RecyclableSingleton<Icon>() {
+    private static final RecyclableSingleton<Icon> zoomIcon = new RecyclableSingleton<Icon>() {
         @Override
         protected Icon getInstance() {
             return new AquaInternalFrameButtonIcon(Widget.TITLE_BAR_ZOOM_BOX);
@@ -555,6 +555,7 @@
         }
 
         @Override
+        @SuppressWarnings("deprecation")
         public void mouseDragged(final MouseEvent e) {
 // do not forward drags
 //            if (didForwardEvent(e)) return;
@@ -621,7 +622,7 @@
 
             return didForwardEvent;
         }
-
+        @SuppressWarnings("deprecation")
         boolean didForwardEventInternal(final MouseEvent e) {
             if (fDraggingFrame) return false;
 
@@ -737,7 +738,7 @@
         }
     } // end class PaletteListener
 
-    static final InternalFrameShadow documentWindowShadow = new InternalFrameShadow() {
+    private static final InternalFrameShadow documentWindowShadow = new InternalFrameShadow() {
         @Override
         Border getForegroundShadowBorder() {
             return new AquaUtils.SlicedShadowBorder(new Painter() {
@@ -777,7 +778,7 @@
         }
     };
 
-    static final InternalFrameShadow paletteWindowShadow = new InternalFrameShadow() {
+    private static final InternalFrameShadow paletteWindowShadow = new InternalFrameShadow() {
         @Override
         Border getForegroundShadowBorder() {
             return new AquaUtils.SlicedShadowBorder(new Painter() {
@@ -833,7 +834,7 @@
         }
     }
 
-    static final RecyclableSingleton<Icon> RESIZE_ICON = new RecyclableSingleton<Icon>() {
+    private static final RecyclableSingleton<Icon> RESIZE_ICON = new RecyclableSingleton<Icon>() {
         @Override
         protected Icon getInstance() {
             return new AquaIcon.ScalingJRSUIIcon(11, 11) {
@@ -927,11 +928,15 @@
             return (w - x) + (h - y) < 12;
         }
 
+        @SuppressWarnings("deprecation")
         void forwardEventToFrame(final MouseEvent e) {
             final Point pt = new Point();
             final Component c = getComponentToForwardTo(e, pt);
             if (c == null) return;
-            c.dispatchEvent(new MouseEvent(c, e.getID(), e.getWhen(), e.getModifiers(), pt.x, pt.y, e.getClickCount(), e.isPopupTrigger(), e.getButton()));
+            c.dispatchEvent(
+                    new MouseEvent(c, e.getID(), e.getWhen(), e.getModifiers(),
+                                   pt.x, pt.y, e.getClickCount(),
+                                   e.isPopupTrigger(), e.getButton()));
         }
 
         Component getComponentToForwardTo(final MouseEvent e, final Point dst) {
@@ -993,6 +998,7 @@
         public void mouseMoved(final MouseEvent e) { }
 
         @Override
+        @SuppressWarnings("deprecation")
         public void mouseWheelMoved(final MouseWheelEvent e) {
             final Point pt = new Point();
             final Component c = getComponentToForwardTo(e, pt);
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java
index d6395ac..cb32bfc 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java
@@ -37,7 +37,7 @@
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
 public class AquaKeyBindings {
-    static final RecyclableSingleton<AquaKeyBindings> instance = new RecyclableSingletonFromDefaultConstructor<AquaKeyBindings>(AquaKeyBindings.class);
+    private static final RecyclableSingleton<AquaKeyBindings> instance = new RecyclableSingletonFromDefaultConstructor<AquaKeyBindings>(AquaKeyBindings.class);
     static AquaKeyBindings instance() {
         return instance.get();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLabelUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLabelUI.java
index bb24f60..fb5682d 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLabelUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLabelUI.java
@@ -37,7 +37,7 @@
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
 public class AquaLabelUI extends BasicLabelUI {
-    protected static final  RecyclableSingleton<AquaLabelUI> aquaLabelUI = new RecyclableSingletonFromDefaultConstructor<AquaLabelUI>(AquaLabelUI.class);
+    private static final RecyclableSingleton<AquaLabelUI> aquaLabelUI = new RecyclableSingletonFromDefaultConstructor<AquaLabelUI>(AquaLabelUI.class);
 
     public static ComponentUI createUI(final JComponent c) {
         return aquaLabelUI.get();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java
index 53feb41..69c22af 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java
@@ -74,7 +74,10 @@
         kUCapsLockGlyph = 0x21EA;
 
     static final int ALT_GRAPH_MASK = 1 << 5; // New to Java2
-    static final int sUnsupportedModifiersMask = ~(InputEvent.CTRL_MASK | InputEvent.ALT_MASK | InputEvent.SHIFT_MASK | InputEvent.META_MASK | ALT_GRAPH_MASK);
+    @SuppressWarnings("deprecation")
+    static final int sUnsupportedModifiersMask =
+            ~(InputEvent.CTRL_MASK | InputEvent.ALT_MASK | InputEvent.SHIFT_MASK
+                    | InputEvent.META_MASK | ALT_GRAPH_MASK);
 
     interface Client {
         public void paintBackground(Graphics g, JComponent c, int menuWidth, int menuHeight);
@@ -86,6 +89,7 @@
     }
 
     // Return a string with the proper modifier glyphs
+    @SuppressWarnings("deprecation")
     private static String getKeyModifiersUnicode(final int modifiers, final boolean isLeftToRight) {
         final StringBuilder buf = new StringBuilder(2);
         // Order (from StandardMenuDef.c): control, option(alt), shift, cmd
@@ -121,7 +125,7 @@
         return buf.toString();
     }
 
-    static final RecyclableSingleton<AquaMenuPainter> sPainter = new RecyclableSingletonFromDefaultConstructor<AquaMenuPainter>(AquaMenuPainter.class);
+    private static final RecyclableSingleton<AquaMenuPainter> sPainter = new RecyclableSingletonFromDefaultConstructor<AquaMenuPainter>(AquaMenuPainter.class);
     static AquaMenuPainter instance() {
         return sPainter.get();
     }
@@ -135,9 +139,9 @@
         protected Border getInstance() { return UIManager.getBorder(borderName); }
     }
 
-    protected final RecyclableBorder menuBarPainter = new RecyclableBorder("MenuBar.backgroundPainter");
-    protected final RecyclableBorder selectedMenuBarItemPainter = new RecyclableBorder("MenuBar.selectedBackgroundPainter");
-    protected final RecyclableBorder selectedMenuItemPainter = new RecyclableBorder("MenuItem.selectedBackgroundPainter");
+    private static final RecyclableBorder menuBarPainter = new RecyclableBorder("MenuBar.backgroundPainter");
+    private static final RecyclableBorder selectedMenuBarItemPainter = new RecyclableBorder("MenuBar.selectedBackgroundPainter");
+    private static final RecyclableBorder selectedMenuItemPainter = new RecyclableBorder("MenuItem.selectedBackgroundPainter");
 
     public void paintMenuBarBackground(final Graphics g, final int width, final int height, final JComponent c) {
         g.setColor(c == null ? Color.white : c.getBackground());
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMnemonicHandler.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMnemonicHandler.java
index be5ab65..76c9735 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMnemonicHandler.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaMnemonicHandler.java
@@ -34,7 +34,7 @@
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
 public class AquaMnemonicHandler {
-    static final RecyclableSingleton<AltProcessor> altProcessor = new RecyclableSingletonFromDefaultConstructor<AltProcessor>(AltProcessor.class);
+    private static final RecyclableSingleton<AltProcessor> altProcessor = new RecyclableSingletonFromDefaultConstructor<AltProcessor>(AltProcessor.class);
     public static KeyEventPostProcessor getInstance() {
         return altProcessor.get();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaNativeResources.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaNativeResources.java
index 48c6942..1aa700d 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaNativeResources.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaNativeResources.java
@@ -54,7 +54,7 @@
         }
     }
 
-    static final RecyclableSingleton<Color> sBackgroundColor = new RecyclableSingleton<Color>() {
+    private static final RecyclableSingleton<Color> sBackgroundColor = new RecyclableSingleton<Color>() {
         @Override
         protected Color getInstance() {
             final long backgroundID = getWindowBackgroundColor();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaPanelUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaPanelUI.java
index f03a7f9..b6509ef 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaPanelUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaPanelUI.java
@@ -35,7 +35,7 @@
 import java.awt.Graphics;
 
 public class AquaPanelUI extends BasicPanelUI {
-    static RecyclableSingleton<AquaPanelUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaPanelUI>(AquaPanelUI.class);
+    private static final RecyclableSingleton<AquaPanelUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaPanelUI>(AquaPanelUI.class);
 
     public static ComponentUI createUI(final JComponent c) {
         return instance.get();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaPopupMenuSeparatorUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaPopupMenuSeparatorUI.java
index be4a06f..64291c1 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaPopupMenuSeparatorUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaPopupMenuSeparatorUI.java
@@ -34,7 +34,7 @@
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
 public class AquaPopupMenuSeparatorUI extends BasicSeparatorUI {
-    protected static RecyclableSingletonFromDefaultConstructor<AquaPopupMenuSeparatorUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaPopupMenuSeparatorUI>(AquaPopupMenuSeparatorUI.class);
+    private static final RecyclableSingletonFromDefaultConstructor<AquaPopupMenuSeparatorUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaPopupMenuSeparatorUI>(AquaPopupMenuSeparatorUI.class);
 
     public static ComponentUI createUI(final JComponent c) {
         return instance.get();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java
index 1745c91..bf66a1b 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java
@@ -46,7 +46,7 @@
 public class AquaProgressBarUI extends ProgressBarUI implements ChangeListener, PropertyChangeListener, AncestorListener, Sizeable {
     private static final boolean ADJUSTTIMER = true;
 
-    protected static final RecyclableSingleton<SizeDescriptor> sizeDescriptor = new RecyclableSingleton<SizeDescriptor>() {
+    private static final RecyclableSingleton<SizeDescriptor> sizeDescriptor = new RecyclableSingleton<SizeDescriptor>() {
         @Override
         protected SizeDescriptor getInstance() {
             return new SizeDescriptor(new SizeVariant(146, 20)) {
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaScrollBarUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaScrollBarUI.java
index 92e3423..9d87013 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaScrollBarUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaScrollBarUI.java
@@ -154,7 +154,7 @@
         return State.ACTIVE;
     }
 
-    static final RecyclableSingleton<Map<Hit, ScrollBarPart>> hitToPressedPartMap = new RecyclableSingleton<Map<Hit,ScrollBarPart>>(){
+    private static final RecyclableSingleton<Map<Hit, ScrollBarPart>> hitToPressedPartMap = new RecyclableSingleton<Map<Hit,ScrollBarPart>>(){
         @Override
         protected Map<Hit, ScrollBarPart> getInstance() {
             final Map<Hit, ScrollBarPart> map = new HashMap<Hit, ScrollBarPart>(7);
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaScrollRegionBorder.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaScrollRegionBorder.java
index 596506f..d09aa65 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaScrollRegionBorder.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaScrollRegionBorder.java
@@ -40,7 +40,7 @@
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
 public class AquaScrollRegionBorder extends AquaBorder {
-    static final RecyclableSingletonFromDefaultConstructor<AquaScrollRegionBorder> instance = new RecyclableSingletonFromDefaultConstructor<AquaScrollRegionBorder>(AquaScrollRegionBorder.class);
+    private static final RecyclableSingletonFromDefaultConstructor<AquaScrollRegionBorder> instance = new RecyclableSingletonFromDefaultConstructor<AquaScrollRegionBorder>(AquaScrollRegionBorder.class);
 
     public static AquaScrollRegionBorder getScrollRegionBorder() {
         return instance.get();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSliderUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSliderUI.java
index 65ed9d7..3775fc8 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSliderUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSliderUI.java
@@ -45,7 +45,7 @@
 //    static final Dimension roundThumbSize = new Dimension(21 + 4, 21 + 4); // +2px on both sides for focus fuzz
 //    static final Dimension pointingThumbSize = new Dimension(19 + 4, 22 + 4);
 
-    protected static final RecyclableSingleton<SizeDescriptor> roundThumbDescriptor = new RecyclableSingleton<SizeDescriptor>() {
+    private static final RecyclableSingleton<SizeDescriptor> roundThumbDescriptor = new RecyclableSingleton<SizeDescriptor>() {
         protected SizeDescriptor getInstance() {
             return new SizeDescriptor(new SizeVariant(25, 25)) {
                 public SizeVariant deriveSmall(final SizeVariant v) {
@@ -57,7 +57,7 @@
             };
         }
     };
-    protected static final RecyclableSingleton<SizeDescriptor> pointingThumbDescriptor = new RecyclableSingleton<SizeDescriptor>() {
+    private static final RecyclableSingleton<SizeDescriptor> pointingThumbDescriptor = new RecyclableSingleton<SizeDescriptor>() {
         protected SizeDescriptor getInstance() {
             return new SizeDescriptor(new SizeVariant(23, 26)) {
                 public SizeVariant deriveSmall(final SizeVariant v) {
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
index ad78bc2..798df58 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -515,6 +515,7 @@
     /**
      * Adds the specified mnemonic at the specified index.
      */
+    @SuppressWarnings("deprecation")
     private void addMnemonic(final int index, final int mnemonic) {
         if (mnemonicToIndexMap == null) {
             initMnemonics();
@@ -3731,7 +3732,6 @@
          * <p>
          * This should be used if the ActionMap can be shared.
          *
-         * @param c JComponent to install the ActionMap on.
          * @param loaderClass Class object that gets loadActionMap invoked
          *                    on.
          * @param defaultsKey Key to use to defaults table to check for
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderBorder.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderBorder.java
index 17f412b..68aafa5 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderBorder.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderBorder.java
@@ -126,7 +126,7 @@
         return State.ACTIVE;
     }
 
-    static final RecyclableSingleton<Border> alternateBorder = new RecyclableSingleton<Border>() {
+    private static final RecyclableSingleton<Border> alternateBorder = new RecyclableSingleton<Border>() {
         @Override
         protected Border getInstance() {
             return BorderFactory.createRaisedBevelBorder();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java
index 35b87aa..85577ce 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java
@@ -67,7 +67,7 @@
         super.uninstallDefaults();
     }
 
-    static final RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>> TABLE_HEADER_APPLICATORS = new RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>>() {
+    private static final RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>> TABLE_HEADER_APPLICATORS = new RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>>() {
         @Override
         @SuppressWarnings("unchecked")
         protected ClientPropertyApplicator<JTableHeader, JTableHeader> getInstance() {
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldBorder.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldBorder.java
index 6f161b7..2919172 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldBorder.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldBorder.java
@@ -36,7 +36,7 @@
 import com.apple.laf.AquaUtils.*;
 
 public class AquaTextFieldBorder extends AquaBorder {
-    protected static final RecyclableSingleton<AquaTextFieldBorder> instance = new RecyclableSingletonFromDefaultConstructor<AquaTextFieldBorder>(AquaTextFieldBorder.class);
+    private static final RecyclableSingleton<AquaTextFieldBorder> instance = new RecyclableSingletonFromDefaultConstructor<AquaTextFieldBorder>(AquaTextFieldBorder.class);
     public static AquaTextFieldBorder getTextFieldBorder() {
         return instance.get();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldSearch.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldSearch.java
index 4117d89..ba7ea8d 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldSearch.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextFieldSearch.java
@@ -90,7 +90,7 @@
         return (c.getClientProperty(FIND_POPUP_KEY) instanceof JPopupMenu);
     }
 
-    protected static final RecyclableSingleton<SearchFieldBorder> instance = new RecyclableSingletonFromDefaultConstructor<SearchFieldBorder>(SearchFieldBorder.class);
+    private static final RecyclableSingleton<SearchFieldBorder> instance = new RecyclableSingletonFromDefaultConstructor<SearchFieldBorder>(SearchFieldBorder.class);
     public static SearchFieldBorder getSearchTextFieldBorder() {
         return instance.get();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextPasswordFieldUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextPasswordFieldUI.java
index 82f32a5..0cdcc9c 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextPasswordFieldUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTextPasswordFieldUI.java
@@ -38,7 +38,7 @@
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
 public class AquaTextPasswordFieldUI extends AquaTextFieldUI {
-    static final RecyclableSingleton<CapsLockSymbolPainter> capsLockPainter = new RecyclableSingletonFromDefaultConstructor<CapsLockSymbolPainter>(CapsLockSymbolPainter.class);
+    private static final RecyclableSingleton<CapsLockSymbolPainter> capsLockPainter = new RecyclableSingletonFromDefaultConstructor<CapsLockSymbolPainter>(CapsLockSymbolPainter.class);
     static CapsLockSymbolPainter getCapsLockPainter() {
         return capsLockPainter.get();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolBarSeparatorUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolBarSeparatorUI.java
index a3d7b6e..555ea8b 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolBarSeparatorUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolBarSeparatorUI.java
@@ -34,7 +34,7 @@
 import com.apple.laf.AquaUtils.*;
 
 public class AquaToolBarSeparatorUI extends BasicToolBarSeparatorUI {
-    protected static RecyclableSingleton<AquaToolBarSeparatorUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaToolBarSeparatorUI>(AquaToolBarSeparatorUI.class);
+    private static final RecyclableSingleton<AquaToolBarSeparatorUI> instance = new RecyclableSingletonFromDefaultConstructor<AquaToolBarSeparatorUI>(AquaToolBarSeparatorUI.class);
 
     public static ComponentUI createUI(final JComponent c) {
         return instance.get();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolBarUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolBarUI.java
index 05773dd..7ea41a4 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolBarUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolBarUI.java
@@ -35,7 +35,7 @@
 import com.apple.laf.AquaUtils.*;
 
 public class AquaToolBarUI extends BasicToolBarUI implements SwingConstants {
-    private static RecyclableSingleton<ToolBarBorder> toolBarBorder = new RecyclableSingletonFromDefaultConstructor<ToolBarBorder>(ToolBarBorder.class);
+    private static final RecyclableSingleton<ToolBarBorder> toolBarBorder = new RecyclableSingletonFromDefaultConstructor<ToolBarBorder>(ToolBarBorder.class);
     public static Border getToolBarBorder() {
         return toolBarBorder.get();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolTipUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolTipUI.java
index 9a9f5b3..19e9c1c 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolTipUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaToolTipUI.java
@@ -34,7 +34,7 @@
 import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor;
 
 public class AquaToolTipUI extends BasicToolTipUI {
-    static final RecyclableSingletonFromDefaultConstructor<AquaToolTipUI> sharedAquaInstance = new RecyclableSingletonFromDefaultConstructor<AquaToolTipUI>(AquaToolTipUI.class);
+    private static final RecyclableSingletonFromDefaultConstructor<AquaToolTipUI> sharedAquaInstance = new RecyclableSingletonFromDefaultConstructor<AquaToolTipUI>(AquaToolTipUI.class);
 
     public static ComponentUI createUI(final JComponent c) {
         return sharedAquaInstance.get();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java
index 999d24a..63ab438 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaUtilControlSize.java
@@ -49,7 +49,7 @@
         void applySizeFor(final JComponent c, final Size size);
     }
 
-    protected static final RecyclableSingleton<PropertySizeListener> sizeListener
+    private static final RecyclableSingleton<PropertySizeListener> sizeListener
             = new RecyclableSingletonFromDefaultConstructor<>(PropertySizeListener.class);
     protected static PropertySizeListener getSizeListener() {
         return sizeListener.get();
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuPropertyListener.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuPropertyListener.java
index cce9383..1176a82 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuPropertyListener.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuPropertyListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 
     /**
      * This method gets called when a bound property is changed.
-     * @param evt A PropertyChangeEvent object describing the event source
+     * @param e A PropertyChangeEvent object describing the event source
      *       and the property that has changed.
      */
     public void propertyChange(final PropertyChangeEvent e) {
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/resources/aqua_de.properties b/jdk/src/java.desktop/macosx/classes/com/apple/laf/resources/aqua_de.properties
index b85ed0c..8310556 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/resources/aqua_de.properties
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/resources/aqua_de.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
 FileChooser.openButton.textAndMnemonic=\u00D6ffnen
 FileChooser.saveDialogTitle.textAndMnemonic=Speichern
 FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen
-FileChooser.updateButton.textAndMnemonic=Updaten
+FileChooser.updateButton.textAndMnemonic=Aktualisieren
 FileChooser.helpButton.textAndMnemonic=Hilfe
 FileChooser.directoryOpenButton.textAndMnemonic=\u00D6ffnen
 
diff --git a/jdk/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java b/jdk/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java
index f84397a..ce5ed8b 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -79,6 +79,10 @@
 
     /** Available CoreGraphics displays. */
     private final Map<Integer, CGraphicsDevice> devices = new HashMap<>(5);
+    /**
+     * The key in the {@link #devices} for the main display.
+     */
+    private int mainDisplayID;
 
     /** Reference to the display reconfiguration callback context. */
     private final long displayReconfigContext;
@@ -120,6 +124,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             super.finalize();
@@ -136,15 +141,15 @@
             final Map<Integer, CGraphicsDevice> old = new HashMap<>(devices);
             devices.clear();
 
-            int mainID = getMainDisplayID();
+            mainDisplayID = getMainDisplayID();
 
             // initialization of the graphics device may change
             // list of displays on hybrid systems via an activation
             // of discrete video.
             // So, we initialize the main display first, and then
             // retrieve actual list of displays.
-            if (!old.containsKey(mainID)) {
-                old.put(mainID, new CGraphicsDevice(mainID));
+            if (!old.containsKey(mainDisplayID)) {
+                old.put(mainDisplayID, new CGraphicsDevice(mainDisplayID));
             }
 
             for (final int id : getDisplayIDs()) {
@@ -157,7 +162,6 @@
 
     @Override
     public synchronized GraphicsDevice getDefaultScreenDevice() throws HeadlessException {
-        final int mainDisplayID = getMainDisplayID();
         CGraphicsDevice d = devices.get(mainDisplayID);
         if (d == null) {
             // we do not expect that this may happen, the only response
diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java b/jdk/src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java
index d2f9a54..5a2cf76 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java
@@ -75,37 +75,9 @@
                 }
             }
 
-            if (code < 0x0590) {
+            if (code < FontUtilities.MIN_LAYOUT_CHARCODE) {
                 continue;
-            } else if (code <= 0x05ff) {
-                // Hebrew 0x0590->0x05ff
-                return true;
-            } else if (code >= 0x0600 && code <= 0x06ff) {
-                // Arabic
-                return true;
-            } else if (code >= 0x0900 && code <= 0x0d7f) {
-                // if Indic, assume shaping for conjuncts, reordering:
-                // 0900 - 097F Devanagari
-                // 0980 - 09FF Bengali
-                // 0A00 - 0A7F Gurmukhi
-                // 0A80 - 0AFF Gujarati
-                // 0B00 - 0B7F Oriya
-                // 0B80 - 0BFF Tamil
-                // 0C00 - 0C7F Telugu
-                // 0C80 - 0CFF Kannada
-                // 0D00 - 0D7F Malayalam
-                return true;
-            } else if (code >= 0x0e00 && code <= 0x0e7f) {
-                // if Thai, assume shaping for vowel, tone marks
-                return true;
-            } else if (code >= 0x200c && code <= 0x200d) {
-                // zwj or zwnj
-                return true;
-            } else if (code >= 0x202a && code <= 0x202e) {
-                // directional control
-                return true;
-            } else if (code >= 0x206a && code <= 0x206f) {
-                // directional control
+            } else if (FontUtilities.isComplexCharCode(code)) {
                 return true;
             } else if (code >= 0x10000) {
                 i += 1; // Empty glyph slot after surrogate
diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java b/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java
index 049dbb5..15abdda 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -211,6 +211,10 @@
         ArrayList<String> listOfString = new ArrayList<String>();
         getCascadeList(nativeFontPtr, listOfString);
 
+        // add JRE "Lucida Sans Regular" to the cascade list to enable fallback
+        // to happen to this JRE font in case the intended glyph is missing in
+        // fonts provided in the CoreText provided cascaded list
+        listOfString.add("Lucida Sans Regular");
         FontManager fm = FontManagerFactory.getInstance();
         int numFonts = 1 + listOfString.size();
         PhysicalFont[] fonts = new PhysicalFont[numFonts];
@@ -246,6 +250,7 @@
         return compFont;
     }
 
+    @SuppressWarnings("deprecation")
     protected synchronized void finalize() {
         if (nativeFontPtr != 0) {
             disposeNativeFont(nativeFontPtr);
diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/CStrike.java b/jdk/src/java.desktop/macosx/classes/sun/font/CStrike.java
index ed38388..7eba967 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/font/CStrike.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/CStrike.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -127,6 +127,7 @@
         return nativeStrikePtr;
     }
 
+    @SuppressWarnings("deprecation")
     protected synchronized void finalize() throws Throwable {
         if (nativeStrikePtr != 0) {
             disposeNativeStrikePtr(nativeStrikePtr);
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java
index a024da3..e43c4db 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java
@@ -1224,6 +1224,7 @@
      * Changes the target of the AWTEvent from awt component to appropriate
      * swing delegate.
      */
+    @SuppressWarnings("deprecation")
     private AWTEvent createDelegateEvent(final AWTEvent e) {
         // TODO modifiers should be changed to getModifiers()|getModifiersEx()?
         AWTEvent delegateEvent = null;
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWListPeer.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWListPeer.java
index e6e1ec3..f9d7db6 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWListPeer.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWListPeer.java
@@ -302,6 +302,7 @@
             }
 
             @Override
+            @SuppressWarnings("deprecation")
             protected void processMouseEvent(final MouseEvent e) {
                 super.processMouseEvent(e);
                 if (e.getID() == MouseEvent.MOUSE_CLICKED && e.getClickCount() == 2) {
@@ -314,6 +315,7 @@
             }
 
             @Override
+            @SuppressWarnings("deprecation")
             protected void processKeyEvent(final KeyEvent e) {
                 super.processKeyEvent(e);
                 if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_ENTER) {
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java
index daa0298..a6eec6e 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java
@@ -359,13 +359,6 @@
     // ---- NON-COMPONENT PEERS ---- //
 
     @Override
-    public final ColorModel getColorModel() throws HeadlessException {
-        return GraphicsEnvironment.getLocalGraphicsEnvironment()
-                                  .getDefaultScreenDevice()
-                                  .getDefaultConfiguration().getColorModel();
-    }
-
-    @Override
     public final boolean isDesktopSupported() {
         return true;
     }
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
index 6a0f49a..2d3ce3e 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
@@ -93,6 +93,7 @@
         InputEvent         triggerEvent = trigger.getTriggerEvent();
 
         Point dragOrigin = new Point(trigger.getDragOrigin());
+        @SuppressWarnings("deprecation")
         int extModifiers = (triggerEvent.getModifiers() | triggerEvent.getModifiersEx());
         long timestamp   = triggerEvent.getWhen();
         int clickCount   = ((triggerEvent instanceof MouseEvent) ? (((MouseEvent) triggerEvent).getClickCount()) : 1);
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java
index f69ad20..e53f23a 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -135,6 +135,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     protected final void finalize() throws Throwable {
         dispose();
     }
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java
index 3deba1e..891972f 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,15 +57,19 @@
     }
 
     static Object[] getAvailableLocalesInternal() {
-        List<?> workList = nativeGetAvailableLocales();
+        List<Object> workList = nativeGetAvailableLocales();
+        Locale currentLocale = CInputMethod.getNativeLocale();
 
-        if (workList != null) {
+        if (workList == null || workList.isEmpty()) {
+            return new Object[] {
+                    currentLocale != null ? currentLocale : Locale.getDefault()
+            };
+        } else {
+            if (currentLocale != null && !workList.contains(currentLocale)) {
+                workList.add(currentLocale);
+            }
             return workList.toArray();
         }
-
-        return new Object[] {
-            Locale.getDefault()
-        };
     }
 
     /**
@@ -119,5 +123,5 @@
     }
 
     private static native void nativeInit();
-    private static native List<?> nativeGetAvailableLocales();
+    private static native List<Object> nativeGetAvailableLocales();
 }
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java
index 0230c4e..a0d4e8f 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java
@@ -63,7 +63,7 @@
         CMenuComponent parent = (CMenuComponent)LWToolkit.targetToPeer(getTarget().getParent());
         return parent.executeGet(ptr->nativeCreate(ptr, isSeparator()));
     }
-
+    @SuppressWarnings("deprecation")
     public void setLabel(String label, char keyChar, int keyCode, int modifiers) {
         int keyMask = modifiers;
         if (keyCode == KeyEvent.VK_UNDEFINED) {
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java
index de99473..c0172f6 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java
@@ -265,9 +265,8 @@
 
     static class DeltaAccumulator {
 
-        static final double MIN_THRESHOLD = 0.1;
-        static final double MAX_THRESHOLD = 0.5;
         double accumulatedDelta;
+        boolean accumulate;
 
         int getRoundedDelta(double delta, int scrollPhase) {
 
@@ -278,25 +277,23 @@
                     roundDelta = delta > 0 ? 1 : -1;
                 }
             } else { // trackpad
-                boolean begin = scrollPhase == NSEvent.SCROLL_PHASE_BEGAN;
-                boolean end = scrollPhase == NSEvent.SCROLL_MASK_PHASE_ENDED
-                        || scrollPhase == NSEvent.SCROLL_MASK_PHASE_CANCELLED;
-
-                if (begin) {
+                if (scrollPhase == NSEvent.SCROLL_PHASE_BEGAN) {
                     accumulatedDelta = 0;
+                    accumulate = true;
                 }
+                else if (scrollPhase == NSEvent.SCROLL_PHASE_MOMENTUM_BEGAN) {
+                    accumulate = true;
+                }
+                if (accumulate) {
 
-                accumulatedDelta += delta;
+                    accumulatedDelta += delta;
 
-                double absAccumulatedDelta = Math.abs(accumulatedDelta);
-                if (absAccumulatedDelta > MAX_THRESHOLD) {
                     roundDelta = (int) Math.round(accumulatedDelta);
-                    accumulatedDelta -= roundDelta;
-                }
 
-                if (end) {
-                    if (roundDelta == 0 && absAccumulatedDelta > MIN_THRESHOLD) {
-                        roundDelta = accumulatedDelta > 0 ? 1 : -1;
+                    accumulatedDelta -= roundDelta;
+
+                    if (scrollPhase == NSEvent.SCROLL_PHASE_ENDED) {
+                        accumulate = false;
                     }
                 }
             }
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
index 102851f..fb96628 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -232,6 +232,7 @@
 
     private volatile boolean isInFullScreen;
     private volatile boolean isIconifyAnimationActive;
+    private volatile boolean isZoomed;
 
     private Window target;
     private LWWindowPeer peer;
@@ -506,7 +507,7 @@
 
     private boolean isMaximized() {
         return undecorated ? this.normalBounds != null
-                : CWrapper.NSWindow.isZoomed(getNSWindowPtr());
+                : isZoomed;
     }
 
     private void maximize() {
@@ -974,6 +975,7 @@
 
     protected void deliverMoveResizeEvent(int x, int y, int width, int height,
                                         boolean byUser) {
+        isZoomed = CWrapper.NSWindow.isZoomed(getNSWindowPtr());
         checkZoom();
 
         final Rectangle oldB = nativeBounds;
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPopupMenu.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPopupMenu.java
index b73f67a..95f8305 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPopupMenu.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPopupMenu.java
@@ -46,6 +46,7 @@
     private native long nativeShowPopupMenu(long modelPtr, int x, int y);
 
     @Override
+    @SuppressWarnings("deprecation")
     public void show(Event e) {
         Component origin = (Component)e.target;
         if (origin != null) {
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java
index cb1ee14..1e492b9 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java
@@ -68,6 +68,7 @@
     public void setResizable(boolean resizable) {}
     public void setEnabled(boolean enable) {}
     public void setBounds(int x, int y, int width, int height) {}
+    @SuppressWarnings("deprecation")
     public boolean handleEvent(Event e) { return false; }
     public void setForeground(Color c) {}
     public void setBackground(Color c) {}
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
index 2d54d62..e54e153 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -556,6 +556,7 @@
     // The following methods are CPrinterJob specific.
 
     @Override
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         synchronized (fNSPrintInfoLock) {
             if (fNSPrintInfo != -1) {
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java
index 940858e..744b85a 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -174,7 +174,8 @@
     @Override
     public int getRGBPixel(int x, int y) {
         int c[] = new int[1];
-        getScreenPixels(new Rectangle(x, y, 1, 1), c);
+        double scale = fDevice.getScaleFactor();
+        getScreenPixels(new Rectangle(x, y, (int) scale, (int) scale), c);
         return c[0];
     }
 
@@ -198,7 +199,8 @@
                                    boolean isMouseMove);
     private native void keyEvent(int javaKeyCode, boolean keydown);
     private void getScreenPixels(Rectangle r, int[] pixels){
-        nativeGetScreenPixels(r.x, r.y, r.width, r.height, pixels);
+        double scale = fDevice.getScaleFactor();
+        nativeGetScreenPixels(r.x, r.y, r.width, r.height, scale, pixels);
     }
-    private native void nativeGetScreenPixels(int x, int y, int width, int height, int[] pixels);
+    private native void nativeGetScreenPixels(int x, int y, int width, int height, double scale, int[] pixels);
 }
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
index 9c46300..6f5e5c8 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
@@ -359,18 +359,6 @@
     }
 
     @Override
-    protected int getScreenHeight() {
-        return GraphicsEnvironment.getLocalGraphicsEnvironment()
-                .getDefaultScreenDevice().getDefaultConfiguration().getBounds().height;
-    }
-
-    @Override
-    protected int getScreenWidth() {
-        return GraphicsEnvironment.getLocalGraphicsEnvironment()
-                .getDefaultScreenDevice().getDefaultConfiguration().getBounds().width;
-    }
-
-    @Override
     protected void initializeDesktopProperties() {
         super.initializeDesktopProperties();
         Map <Object, Object> fontHints = new HashMap<>();
@@ -532,6 +520,7 @@
      * @since     1.1
      */
     @Override
+    @SuppressWarnings("deprecation")
     public int getMenuShortcutKeyMask() {
         return Event.META_MASK;
     }
@@ -768,6 +757,7 @@
      * stroke.
      */
     @Override
+    @SuppressWarnings("deprecation")
     public int getFocusAcceleratorKeyMask() {
         return InputEvent.CTRL_MASK | InputEvent.ALT_MASK;
     }
@@ -777,6 +767,7 @@
      * printable character.
      */
     @Override
+    @SuppressWarnings("deprecation")
     public boolean isPrintableCharacterModifiersMask(int mods) {
         return ((mods & (InputEvent.META_MASK | InputEvent.CTRL_MASK)) == 0);
     }
diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java
index 5710988..252ce11 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java
@@ -36,8 +36,8 @@
     static final int SCROLL_PHASE_UNSUPPORTED = 1;
     static final int SCROLL_PHASE_BEGAN = 2;
     static final int SCROLL_PHASE_CONTINUED = 3;
-    static final int SCROLL_MASK_PHASE_CANCELLED = 4;
-    static final int SCROLL_MASK_PHASE_ENDED = 5;
+    static final int SCROLL_PHASE_MOMENTUM_BEGAN = 4;
+    static final int SCROLL_PHASE_ENDED = 5;
 
     private int type;
     private int modifierFlags;
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
index 208d22d..186a002 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
@@ -381,6 +381,13 @@
     } else {
         clickCount = [event clickCount];
     }
+
+    jdouble deltaX = [event deltaX];
+    jdouble deltaY = [event deltaY];
+    if ([AWTToolkit hasPreciseScrollingDeltas: event]) {
+        deltaX = [event scrollingDeltaX] * 0.1;
+        deltaY = [event scrollingDeltaY] * 0.1;
+    }
     
     static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent");
     static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IIIIIIIIDDI)V");
@@ -391,8 +398,8 @@
                                   [event buttonNumber],
                                   (jint)localPoint.x, (jint)localPoint.y,
                                   (jint)absP.x, (jint)absP.y,
-                                  [event deltaY],
-                                  [event deltaX],
+                                  deltaY,
+                                  deltaX,
                                   [AWTToolkit scrollStateWithEvent: event]);
     CHECK_NULL(jEvent);
     
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m
index 03a32dd..db54e27 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m
@@ -376,7 +376,7 @@
     static JNF_MEMBER_CACHE(jm_getMaxPage, sjc_CPrinterJob, "getMaxPageAttrib", "()I");
     static JNF_MEMBER_CACHE(jm_getSelectAttrib, sjc_CPrinterJob, "getSelectAttrib", "()I");
     static JNF_MEMBER_CACHE(jm_getNumberOfPages, jc_Pageable, "getNumberOfPages", "()I");
-    static JNF_MEMBER_CACHE(jm_getPageFormat, sjc_CPrinterJob, "getPageFormatFromAttributes", "()Ljava/awt/print/PageFormat;");
+    static JNF_MEMBER_CACHE(jm_getPageFormat, sjc_CPrinterJob, "getPageFormat", "(I)Ljava/awt/print/PageFormat;");
 
     NSMutableDictionary* printingDictionary = [dst dictionary];
 
@@ -412,7 +412,7 @@
     [printingDictionary setObject:[NSNumber numberWithInteger:fromPage] forKey:NSPrintFirstPage];
     [printingDictionary setObject:[NSNumber numberWithInteger:toPage] forKey:NSPrintLastPage];
 
-    jobject page = JNFCallObjectMethod(env, srcPrinterJob, jm_getPageFormat); 
+    jobject page = JNFCallObjectMethod(env, srcPrinterJob, jm_getPageFormat, (jint)0);
     if (page != NULL) {
         javaPageFormatToNSPrintInfo(env, NULL, page, dst);
     }
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m
index d3ee81c..c394854 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -276,7 +276,7 @@
 JNIEXPORT void JNICALL
 Java_sun_lwawt_macosx_CRobot_nativeGetScreenPixels
 (JNIEnv *env, jobject peer,
- jint x, jint y, jint width, jint height, jintArray pixels)
+ jint x, jint y, jint width, jint height, jdouble scale, jintArray pixels)
 {
     JNF_COCOA_ENTER(env);
 
@@ -285,10 +285,11 @@
     jint picWidth = width;
     jint picHeight = height;
 
-    CGRect screenRect = CGRectMake(picX, picY, picWidth, picHeight);
+    CGRect screenRect = CGRectMake(picX / scale, picY / scale,
+    				picWidth / scale, picHeight / scale);
     CGImageRef screenPixelsImage = CGWindowListCreateImage(screenRect,
                                         kCGWindowListOptionOnScreenOnly,
-                                        kCGNullWindowID, kCGWindowImageDefault);
+                                        kCGNullWindowID, kCGWindowImageBestResolution);
 
     if (screenPixelsImage == NULL) {
         return;
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m
index 8057972..bfce2fd 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m
@@ -139,7 +139,14 @@
     jint clickCount;
 
     clickCount = [event clickCount];
-        
+
+    jdouble deltaX = [event deltaX];
+    jdouble deltaY = [event deltaY];
+    if ([AWTToolkit hasPreciseScrollingDeltas: event]) {
+        deltaX = [event scrollingDeltaX] * 0.1;
+        deltaY = [event scrollingDeltaY] * 0.1;
+    }
+
     static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent");
     static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IIIIIIIIDDI)V");
     jobject jEvent = JNFNewObject(env, jctor_NSEvent,
@@ -149,8 +156,8 @@
                                   [event buttonNumber],
                                   (jint)localPoint.x, (jint)localPoint.y,
                                   (jint)absP.x, (jint)absP.y,
-                                  [event deltaY],
-                                  [event deltaX],
+                                  deltaY,
+                                  deltaX,
                                   [AWTToolkit scrollStateWithEvent: event]);
     CHECK_NULL(jEvent);
 
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m
index 5a91adf..01b495b 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m
@@ -136,7 +136,7 @@
         fJavaRole = [javaRole retain];
 
         fAccessible = (*env)->NewWeakGlobalRef(env, accessible);
-        
+        (*env)->ExceptionClear(env); // in case of OOME
         jobject jcomponent = [(AWTView *)fView awtComponent:env];
         fComponent = (*env)->NewWeakGlobalRef(env, jcomponent);
         (*env)->DeleteLocalRef(env, jcomponent);
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.h b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.h
index c581cb4..34532ec 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.h
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.h
@@ -42,6 +42,7 @@
 + (long) getEventCount;
 + (void) eventCountPlusPlus;
 + (jint) scrollStateWithEvent: (NSEvent*) event;
++ (BOOL) hasPreciseScrollingDeltas: (NSEvent*) event;
 @end
 
 /*
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
index 41e9668..8cba8cc 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
@@ -47,7 +47,7 @@
 #define SCROLL_PHASE_UNSUPPORTED 1
 #define SCROLL_PHASE_BEGAN 2
 #define SCROLL_PHASE_CONTINUED 3
-#define SCROLL_PHASE_CANCELLED 4
+#define SCROLL_PHASE_MOMENTUM_BEGAN 4
 #define SCROLL_PHASE_ENDED 5
 
 int gNumberOfButtons;
@@ -85,16 +85,33 @@
         return 0;
     }
     
-    NSEventPhase phase = [event phase];
-    NSEventPhase momentumPhase = [event momentumPhase];
-    
-    if (!phase && !momentumPhase) return SCROLL_PHASE_UNSUPPORTED;
-    switch (phase) {
-        case NSEventPhaseBegan: return SCROLL_PHASE_BEGAN;
-        case NSEventPhaseCancelled: return SCROLL_PHASE_CANCELLED;
-        case NSEventPhaseEnded: return SCROLL_PHASE_ENDED;
-        default: return SCROLL_PHASE_CONTINUED;
+    if ([event phase]) {
+        // process a phase of manual scrolling
+        switch ([event phase]) {
+            case NSEventPhaseBegan: return SCROLL_PHASE_BEGAN;
+            case NSEventPhaseCancelled: return SCROLL_PHASE_ENDED;
+            case NSEventPhaseEnded: return SCROLL_PHASE_ENDED;
+            default: return SCROLL_PHASE_CONTINUED;
+        }
     }
+
+    if ([event momentumPhase]) {
+        // process a phase of automatic scrolling
+        switch ([event momentumPhase]) {
+            case NSEventPhaseBegan: return SCROLL_PHASE_MOMENTUM_BEGAN;
+            case NSEventPhaseCancelled: return SCROLL_PHASE_ENDED;
+            case NSEventPhaseEnded: return SCROLL_PHASE_ENDED;
+            default: return SCROLL_PHASE_CONTINUED;
+        }
+    }
+    // phase and momentum phase both are not set
+    return SCROLL_PHASE_UNSUPPORTED;
+}
+
++ (BOOL) hasPreciseScrollingDeltas: (NSEvent*) event {
+    return [event type] == NSScrollWheel
+        && [event respondsToSelector:@selector(hasPreciseScrollingDeltas)]
+        && [event hasPreciseScrollingDeltas];
 }
 @end
 
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.m
index 01f24de..017c46a 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.m
@@ -284,28 +284,21 @@
     CGFloat components[component_size];
     CGGradientRef gradient = NULL;
 
-    for (int i = 0; i < num_locations; i++) {
+    for (i = 0; i < num_locations; i++) {
         locations[i] = gradientInfo->fractionsdata[i];
-//fprintf(stderr, "locations[%d] %f\n", i, locations[i]);
     }
     for (i = 0; i < component_size; i++) {
         components[i] = gradientInfo->colordata[i];
-//fprintf(stderr, "components[%d] %f, gradientInfo->colordata[%d] %f\n",
-//                  i, components[i], i, gradientInfo->colordata[i]);
     } 
     CGContextSaveGState(cgRef);
     gradient = CGGradientCreateWithColorComponents(colorspace, components, locations, num_locations);
-//fprintf(stderr, "gradientInfo->start.x %f, gradientInfo->start.y %f\n", 
-//                 gradientInfo->start.x, gradientInfo->start.y);
-//fprintf(stderr, "gradientInfo->end.x %f, gradientInfo->end.y %f\n", 
-//                 gradientInfo->end.x, gradientInfo->end.y);
     if (qsdo->isEvenOddFill) {
         CGContextEOClip(cgRef);
     } else {
         CGContextClip(cgRef);
     }
     CGContextDrawLinearGradient(cgRef, gradient, gradientInfo->start, gradientInfo->end, kCGGradientDrawsAfterEndLocation);    
-    
+
     CGContextRestoreGState(cgRef);
     CGColorSpaceRelease(colorspace);
     CGGradientRelease(gradient);
@@ -332,27 +325,19 @@
     CGFloat startRadius = gradientInfo->radius;
     CGFloat endRadius = gradientInfo->radius;
 
-    for (int i = 0; i < num_locations; i++) {
+    for (i = 0; i < num_locations; i++) {
         locations[i] = gradientInfo->fractionsdata[i];
-//fprintf(stderr, "locations[%d] %f\n", i, locations[i]);
     }
     for (i = 0; i < component_size; i++) {
         components[i] = gradientInfo->colordata[i];
-//fprintf(stderr, "components[%d] %f, gradientInfo->colordata[%d] %f\n",
-//                  i, components[i], i, gradientInfo->colordata[i]);
     } 
     CGContextSaveGState(cgRef);
     gradient = CGGradientCreateWithColorComponents(colorspace, components, locations, num_locations);
-//fprintf(stderr, "gradientInfo->start.x %f, gradientInfo->start.y %f\n", 
-//                 gradientInfo->start.x, gradientInfo->start.y);
-//fprintf(stderr, "gradientInfo->end.x %f, gradientInfo->end.y %f\n", 
-//                 gradientInfo->end.x, gradientInfo->end.y);
     if (qsdo->isEvenOddFill) {
         CGContextEOClip(cgRef);
     } else {
         CGContextClip(cgRef);
     }
-//fprintf(stderr, "gradientInfo->startRadius %f, gradientInfo->endRadius %f\n",startRadius,endRadius);
     CGContextDrawRadialGradient(cgRef, gradient, gradientInfo->start, 0, gradientInfo->end, endRadius, kCGGradientDrawsAfterEndLocation);    
     
     CGContextRestoreGState(cgRef);
@@ -944,54 +929,41 @@
     if (colorArray != NULL)
     {
         jint length = (*env)->GetArrayLength(env, colorArray);
-//fprintf(stderr, "length %d\n", length);
 
         jint* jcolorData = (jint*)(*env)->GetPrimitiveArrayCritical(env, colorArray, NULL);
-        CGFloat* colors= (CGFloat*)calloc(0, sizeof(CGFloat)*length);
+        qsdo->gradientInfo->colordata = (CGFloat*)malloc(sizeof(CGFloat)*4*length);
+        memset(qsdo->gradientInfo->colordata, 0, sizeof(CGFloat)*4*length);
         if (jcolorData != NULL)
         {
-            jint i;
+            int i;
             for (i=0; i<length; i++)
             {
-                colors[i] = (CGFloat)jcolorData[i];
+                qsdo->gradientInfo->colordata[i*4] = ((jcolorData[i]>>16)&0xff)*kColorConversionMultiplier;
+
+                qsdo->gradientInfo->colordata[i*4+1] = ((jcolorData[i]>>8)&0xff)*kColorConversionMultiplier;
+
+                qsdo->gradientInfo->colordata[i*4+2] = ((jcolorData[i]>>0)&0xff)*kColorConversionMultiplier;
+
+                qsdo->gradientInfo->colordata[i*4+3] = ((jcolorData[i]>>24)&0xff)*kColorConversionMultiplier;
             }
         }
         (*env)->ReleasePrimitiveArrayCritical(env, colorArray, jcolorData, 0);
-        qsdo->gradientInfo->colordata = (CGFloat*)calloc(0, sizeof(CGFloat)*4*length);
-        for (int i = 0; i < length; i++) 
-        {
-            jint c1 = colors[i];
-//fprintf(stderr, "c1 %x\n", c1);
-            qsdo->gradientInfo->colordata[i*4] = ((c1>>16)&0xff)*kColorConversionMultiplier;
-//fprintf(stderr, "qsdo->gradientInfo->colordata[%d] %f\n", i*4, qsdo->gradientInfo->colordata[i*4]);
-
-            qsdo->gradientInfo->colordata[i*4+1] = ((c1>>8)&0xff)*kColorConversionMultiplier;
-//fprintf(stderr, "qsdo->gradientInfo->colordata[%d] %f\n", i*4+1, qsdo->gradientInfo->colordata[i*4+1]);
-
-            qsdo->gradientInfo->colordata[i*4+2] = ((c1>>0)&0xff)*kColorConversionMultiplier;
-//fprintf(stderr, "qsdo->gradientInfo->colordata[%d] %f\n", i*4+2, qsdo->gradientInfo->colordata[i*4+2]);
-
-            qsdo->gradientInfo->colordata[i*4+3] = ((c1>>24)&0xff)*kColorConversionMultiplier;
-//fprintf(stderr, "qsdo->gradientInfo->colordata[%d] %f\n", i*4+3, qsdo->gradientInfo->colordata[i*4+3]);
-        }
-        free(colors);
     }
     jobject fractionsArray  = ((*env)->GetObjectArrayElement(env, qsdo->javaGraphicsStatesObjects, sun_java2d_OSXSurfaceData_kFractionsArrayIndex)); 
     if (fractionsArray != NULL)
     {
         jint length = (*env)->GetArrayLength(env, fractionsArray);
-//fprintf(stderr, "fractions length %d\n", length);
         qsdo->gradientInfo->fractionsLength = length;
 
         jfloat* jfractionsData = (jfloat*)(*env)->GetPrimitiveArrayCritical(env, fractionsArray, NULL);
         if (jfractionsData != NULL)
         {
+            int i;
             qsdo->gradientInfo->fractionsdata = (CGFloat *)malloc(sizeof(CGFloat) *length);
-            jint i;
+            memset(qsdo->gradientInfo->fractionsdata, 0, sizeof(CGFloat)*length);
             for (i=0; i<length; i++)
             {
                 qsdo->gradientInfo->fractionsdata[i] = jfractionsData[i];
-//fprintf(stderr, "jfrationsData[%d] %f, qsdo->gradientInfo->fractionsdata[%d] = %f\n", i, jfractionsData[i], i, qsdo->gradientInfo->fractionsdata[i]);
             }
             (*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, jfractionsData, 0);
         }
diff --git a/jdk/src/java.desktop/share/classes/com/sun/awt/AWTUtilities.java b/jdk/src/java.desktop/share/classes/com/sun/awt/AWTUtilities.java
index 1ba10ac..e699937 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/awt/AWTUtilities.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/awt/AWTUtilities.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 
 import java.awt.*;
 
+import javax.swing.JRootPane;
+
 import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
 
@@ -323,7 +325,7 @@
      * is thrown.
      * <p>If the window is a {@code Frame} or a {@code Dialog}, the window must
      * be undecorated prior to enabling the per-pixel translucency effect (see
-     * {@link Frame#setUndecorated()} and/or {@link Dialog#setUndecorated()}).
+     * {@link Frame#setUndecorated} and/or {@link Dialog#setUndecorated}).
      * If the window becomes decorated through a subsequent call to the
      * corresponding {@code setUndecorated()} method, the per-pixel
      * translucency effect will be disabled and the opaque property reset to
@@ -431,7 +433,7 @@
      * </ul>
      * <p>
      * The most common example when the 'mixing-cutout' shape is needed is a
-     * glass pane component. The {@link JRootPane#setGlassPane()} method
+     * glass pane component. The {@link JRootPane#setGlassPane} method
      * automatically sets the <i>empty-shape</i> as the 'mixing-cutout' shape
      * for the given glass pane component.  If a developer needs some other
      * 'mixing-cutout' shape for the glass pane (which is rare), this must be
@@ -456,8 +458,7 @@
                     "The component argument should not be null.");
         }
 
-        AWTAccessor.getComponentAccessor().setMixingCutoutShape(component,
-                shape);
+        component.setMixingCutoutShape(shape);
     }
 }
 
diff --git a/jdk/src/java.desktop/share/classes/com/sun/awt/SecurityWarning.java b/jdk/src/java.desktop/share/classes/com/sun/awt/SecurityWarning.java
index a33a8b3..02c65c0 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/awt/SecurityWarning.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/awt/SecurityWarning.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,7 +59,7 @@
      *
      * The returned value is not valid until the peer has been created. Before
      * invoking this method a developer must call the {@link Window#pack()},
-     * {@link Window#setVisible()}, or some other method that creates the peer.
+     * {@link Window#setVisible}, or some other method that creates the peer.
      *
      * @param window the window to get the security warning size for
      *
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java
index ee17852..81baecc 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java
@@ -1439,51 +1439,72 @@
         decodeRLE8(imSize, padding, values, bdata);
     }
 
+    private boolean copyRLE8ScanlineToDst(int lineNo,
+                                          byte[] val,
+                                          byte[] bdata) {
+        // Return value
+        boolean isSuccess = false;
+
+        // Reusing the code to copy 1 row of pixels or scanline to required
+        // destination buffer.
+        if (lineNo >= sourceRegion.y &&
+            lineNo < sourceRegion.y + sourceRegion.height) {
+            if (noTransform) {
+                int pos = lineNo * width;
+                for(int i = 0; i < width; i++)
+                    bdata[pos++] = val[i];
+                processImageUpdate(bi, 0, lineNo,
+                                   destinationRegion.width, 1, 1, 1,
+                                   new int[]{0});
+                isSuccess = true;
+            } else if ((lineNo - sourceRegion.y) % scaleY == 0) {
+                int lineStride =
+                    ((ComponentSampleModel)sampleModel).getScanlineStride();
+                int currentLine = (lineNo - sourceRegion.y) / scaleY +
+                    destinationRegion.y;
+                int pos = currentLine * lineStride;
+                pos += destinationRegion.x;
+                for (int i = sourceRegion.x;
+                     i < sourceRegion.x + sourceRegion.width;
+                     i += scaleX)
+                    bdata[pos++] = val[i];
+                processImageUpdate(bi, 0, currentLine,
+                                   destinationRegion.width, 1, 1, 1,
+                                   new int[]{0});
+                isSuccess = true;
+            }
+            // Ensure to reset the scanline buffer once the copy is complete.
+            for(int scIndex = 0; scIndex < width; scIndex++) {
+                val[scIndex] = 0;
+            }
+        }
+
+        return isSuccess;
+    }
+
     private void decodeRLE8(int imSize,
                             int padding,
                             byte[] values,
                             byte[] bdata) throws IOException {
 
-        byte val[] = new byte[width * height];
+        byte val[] = new byte[width];
         int count = 0, l = 0;
         int value;
         boolean flag = false;
         int lineNo = isBottomUp ? height - 1 : 0;
-        int lineStride =
-            ((ComponentSampleModel)sampleModel).getScanlineStride();
         int finished = 0;
 
-        while (count != imSize) {
+        // Ensure image source has sufficient data to decode
+        while ((count + 1) < imSize) {
             value = values[count++] & 0xff;
             if (value == 0) {
                 switch(values[count++] & 0xff) {
 
                 case 0:
                     // End-of-scanline marker
-                    if (lineNo >= sourceRegion.y &&
-                        lineNo < sourceRegion.y + sourceRegion.height) {
-                        if (noTransform) {
-                            int pos = lineNo * width;
-                            for(int i = 0; i < width; i++)
-                                bdata[pos++] = val[i];
-                            processImageUpdate(bi, 0, lineNo,
-                                               destinationRegion.width, 1, 1, 1,
-                                               new int[]{0});
-                            finished++;
-                        } else if ((lineNo - sourceRegion.y) % scaleY == 0) {
-                            int currentLine = (lineNo - sourceRegion.y) / scaleY +
-                                destinationRegion.y;
-                            int pos = currentLine * lineStride;
-                            pos += destinationRegion.x;
-                            for (int i = sourceRegion.x;
-                                 i < sourceRegion.x + sourceRegion.width;
-                                 i += scaleX)
-                                bdata[pos++] = val[i];
-                            processImageUpdate(bi, 0, currentLine,
-                                               destinationRegion.width, 1, 1, 1,
-                                               new int[]{0});
-                            finished++;
-                        }
+                    // Copy the decoded scanline to destination
+                    if (copyRLE8ScanlineToDst(lineNo, val, bdata)) {
+                        finished++;
                     }
                     processImageProgress(100.0F * finished / destinationRegion.height);
                     lineNo += isBottomUp ? -1 : 1;
@@ -1492,26 +1513,62 @@
                     if (abortRequested()) {
                         flag = true;
                     }
-
                     break;
 
                 case 1:
                     // End-of-RLE marker
                     flag = true;
+
+                    // Check if the last decoded scanline was copied to
+                    // destination bitmap
+                    if (l != 0) {
+                        // Copy the decoded scanline to destination
+                        if (copyRLE8ScanlineToDst(lineNo, val, bdata)) {
+                            finished++;
+                        }
+                        processImageProgress(100.0F * finished / destinationRegion.height);
+                        lineNo += isBottomUp ? -1 : 1;
+                        l = 0;
+                    }
                     break;
 
                 case 2:
                     // delta or vector marker
-                    int xoff = values[count++] & 0xff;
-                    int yoff = values[count] & 0xff;
-                    // Move to the position xoff, yoff down
-                    l += xoff + yoff*width;
+                    if ((count+1) < imSize) {
+                        int xoff = values[count++] & 0xff;
+                        int yoff = values[count++] & 0xff;
+
+                        // Check if the yOffset shifts the decoding to another
+                        // row. In such cases, the decoded pixels in scanline
+                        // buffer-val must be copied to the destination image.
+                        if (yoff != 0) {
+                            // Copy the decoded scanline to destination
+                            if (copyRLE8ScanlineToDst(lineNo, val, bdata)) {
+                                finished++;
+                            }
+                            processImageProgress(100.0F * finished
+                                                 / destinationRegion.height);
+                            lineNo += isBottomUp ? -yoff : yoff;
+                        }
+
+                        // Move to the position xoff, yoff down
+                        l += xoff + yoff*width;
+                        l %= width;
+                    }
                     break;
 
                 default:
                     int end = values[count-1] & 0xff;
-                    for (int i=0; i<end; i++) {
-                        val[l++] = (byte)(values[count++] & 0xff);
+                    byte readByte = 0;
+                    // Ensure to check if the source index-count, does not
+                    // exceed the source image size
+                    for (int i=0; (i < end) && (count < imSize); i++) {
+                        readByte = (byte)(values[count++] & 0xff);
+                        // Ensure to check if scanline index-l, does not
+                        // exceed the scanline buffer size (width of image)
+                        if (l < width) {
+                            val[l++] = readByte;
+                        }
                     }
 
                     // Whenever end pixels can fit into odd number of bytes,
@@ -1519,10 +1576,16 @@
                     if ((end & 1) == 1) {
                         count++;
                     }
+                    break;
                 }
             } else {
-                for (int i=0; i<value; i++) {
-                    val[l++] = (byte)(values[count] & 0xff);
+                // Encoded mode
+                // Ensure to check if the source index-count, does not
+                // exceed the source image size
+                if (count < imSize) {
+                    for (int i=0; (i < value) && (l < width); i++) {
+                        val[l++] = (byte)(values[count] & 0xff);
+                    }
                 }
 
                 count++;
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java
index 4eae8a8..b4541d5 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -84,10 +84,8 @@
      * is unable to create approximation of {@code src}
      * and {@code canCreatePalette} returns {@code false}.
      *
-     * @see createIndexColorModel
-     *
-     * @see canCreatePalette
-     *
+     * @see #createIndexColorModel
+     * @see #canCreatePalette
      */
     public static RenderedImage createIndexedImage(RenderedImage src) {
         PaletteBuilder pb = new PaletteBuilder(src);
@@ -107,10 +105,8 @@
      * is unable to create approximation of {@code img}
      * and {@code canCreatePalette} returns {@code false}.
      *
-     * @see createIndexedImage
-     *
-     * @see canCreatePalette
-     *
+     * @see #createIndexedImage
+     * @see #canCreatePalette
      */
     public static IndexColorModel createIndexColorModel(RenderedImage img) {
         PaletteBuilder pb = new PaletteBuilder(img);
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SingleTileRenderedImage.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SingleTileRenderedImage.java
index 5dbd5b4..0cbdefa 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SingleTileRenderedImage.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SingleTileRenderedImage.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
      * and a ColorModel.
      *
      * @param ras A Raster that will define tile (0, 0) of the image.
-     * @param cm A ColorModel that will serve as the image's
+     * @param colorModel A ColorModel that will serve as the image's
      *           ColorModel.
      */
     public SingleTileRenderedImage(Raster ras, ColorModel colorModel) {
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java
index cdcb68d..8ddffc5 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -72,6 +72,7 @@
         streamPos = pos;
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         // Empty finalizer (for improved performance; no need to call
         // super.finalize() in this case)
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java
index 067b275..a7d96cf 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -729,7 +729,8 @@
     /**
      * Writes any extension blocks, the Image Descriptor, and the image data
      *
-     * @param iioimage The image and image metadata.
+     * @param image The image.
+     * @param imageMetadata The image metadata.
      * @param param The write parameters.
      * @param globalColorTable The Global Color Table.
      * @param sourceBounds The source region.
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java
index e560a53..65ac967 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -99,7 +99,7 @@
      * of the list if it is present, and any JFXX or APP2ICC marker
      * segments are subordinate to the JFIF marker segment.  This
      * list is package visible so that the writer can access it.
-     * @see #MarkerSegment
+     * @see MarkerSegment
      */
     List<MarkerSegment> markerSequence = new ArrayList<>();
 
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java
index f1660f8..3fbc55c 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -143,6 +143,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         // Empty finalizer (for improved performance; no need to call
         // super.finalize() in this case)
@@ -279,6 +280,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         // Empty finalizer (for improved performance; no need to call
         // super.finalize() in this case)
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java
index 4618561..d78cb1c 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,13 +74,13 @@
 
     /**
      * ImageWriteParam for JPEG writer.
-     * May be initialized by {@link #initJPEGWriter()}.
+     * May be initialized by {@link #initJPEGWriter}.
      */
     protected JPEGImageWriteParam JPEGParam = null;
 
     /**
      * The JPEG writer.
-     * May be initialized by {@link #initJPEGWriter()}.
+     * May be initialized by {@link #initJPEGWriter}.
      */
     protected ImageWriter JPEGWriter = null;
 
@@ -95,7 +95,7 @@
      * Stream metadata equivalent to a tables-only stream such as in
      * the {@code JPEGTables}. Default value is {@code null}.
      * This should be set by any subclass which sets
-     * {@link writeAbbreviatedStream} to {@code true}.
+     * {@link #writeAbbreviatedStream} to {@code true}.
      */
     protected IIOMetadata JPEGStreamMetadata = null;
 
@@ -435,6 +435,7 @@
         return compDataLength;
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         super.finalize();
         if(JPEGWriter != null) {
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFDecompressor.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFDecompressor.java
index acfa698..a1b0439 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFDecompressor.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFDecompressor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1322,7 +1322,7 @@
      * Sets the index of the planar configuration band to be decoded. This value
      * is ignored for chunky (interleaved) images.
      *
-     * @param the index of the planar band to decode
+     * @param planarBand the index of the planar band to decode
      */
     public void setPlanarBand(int planarBand) { this.planarBand = planarBand; }
 
@@ -2069,7 +2069,7 @@
      * <p> The default implementation calls {@code decodeRaw(byte[] b,
      * ...)} and copies the resulting data into {@code f}.
      *
-     * @param f a {@code double} array to be written.
+     * @param d a {@code double} array to be written.
      * @param dstOffset the starting offset in {@code f} to be
      * written.
      * @param bitsPerPixel the number of bits for each pixel.
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java
index 966ca95..384687f 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -139,6 +139,7 @@
         JPEGReader.read(0, JPEGParam);
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         super.finalize();
         JPEGReader.dispose();
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java
index 2837754..67dd60f 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -610,6 +610,7 @@
         JPEGReader.read(0, JPEGParam);
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         super.finalize();
         JPEGReader.dispose();
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java
index 8fd3a45..90bc2c4 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,8 +58,6 @@
  *
  * The encoding process may clip, subsample using the parameters
  * specified in the {@code ImageWriteParam}.
- *
- * @see com.sun.media.imageio.plugins.WBMPImageWriteParam
  */
 public class WBMPImageWriter extends ImageWriter {
     /** The output stream to write into */
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java
index 3695498..be1e659 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,7 @@
         this.stream = stream;
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             stream.close();
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKColorType.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKColorType.java
index 1d619c1..85358c8 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKColorType.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKColorType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -138,9 +138,9 @@
      * arguments to scale.
      *
      * @param color Color to alter
-     * @param hFactory Amount to scale the hue
+     * @param hFactor Amount to scale the hue
      * @param lFactor Amount to scale the lightness
-     * @param sFactory Amount to sacle saturation
+     * @param sFactor Amount to sacle saturation
      * @return newly created color
      */
     static Color adjustColor(Color color, float hFactor, float lFactor,
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
index b1b30da..9567262 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -82,7 +82,7 @@
      * render the text as html nor will it offset by the insets of the
      * component.
      *
-     * @param ss SynthContext
+     * @param context SynthContext
      * @param g Graphics used to render string in.
      * @param text Text to render
      * @param bounds Bounds of the text to be drawn.
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java
index 23c3f87..2c45d6f 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -319,7 +319,7 @@
      * insets will be placed in it, otherwise a new Insets object will be
      * created and returned.
      *
-     * @param context SynthContext identifying requestor
+     * @param state SynthContext identifying requestor
      * @param insets Where to place Insets
      * @return Insets.
      */
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java
index 16f56e2..f4d6c8e 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java
@@ -236,7 +236,7 @@
                 }
             });
         }
-
+        @SuppressWarnings("deprecation")
         void forwardEventToParent(MouseEvent e) {
             getParent().dispatchEvent(new MouseEvent(
                 getParent(), e.getID(), e.getWhen(), e.getModifiers(),
@@ -329,7 +329,7 @@
                 }
             });
         }
-
+        @SuppressWarnings("deprecation")
         void forwardEventToParent(MouseEvent e) {
             getParent().dispatchEvent(new MouseEvent(
                 getParent(), e.getID(), e.getWhen(), e.getModifiers(),
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java
index 47bed21..c15a7b7 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,6 @@
       * <b>drawStringInRect()</b> does not clip to the rectangle, but instead
       * uses this rectangle and the desired justification to compute the point
       * at which to begin drawing the text.
-      * @see #drawString
       */
     public static void drawStringInRect(Graphics g, String aString, int x, int y,
                                  int width, int height, int justification) {
@@ -139,10 +138,11 @@
     }
 
   /**
-   * This method is not being used to paint menu item since
+   * @deprecated This method is not being used to paint menu item since
    * 6.0 This code left for compatibility only. Do not use or
    * override it, this will not cause any visible effect.
    */
+  @Deprecated(since = "9")
   public static void paintMenuItem(Graphics g, JComponent c,
                                    Icon checkIcon, Icon arrowIcon,
                                    Color background, Color foreground,
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java
index 3d38e3b..a124859 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java
@@ -361,7 +361,7 @@
                 }
             });
         }
-
+        @SuppressWarnings("deprecation")
         void forwardEventToParent(MouseEvent e) {
             getParent().dispatchEvent(new MouseEvent(
                 getParent(), e.getID(), e.getWhen(), e.getModifiers(),
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
index 7c8fd8a..dc459e81 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
@@ -523,7 +523,8 @@
 
         Object optionPaneMessageAreaBorder = new BorderUIResource.EmptyBorderUIResource(10,10,12,10);
 
-
+        @SuppressWarnings("deprecation")
+        final int metaMask = KeyEvent.META_MASK;
         Object[] defaults = {
 
             "Desktop.background", table.get("desktop"),
@@ -635,8 +636,7 @@
             "Menu.submenuPopupOffsetX", -2,
             "Menu.submenuPopupOffsetY", 3,
             "Menu.shortcutKeys", new int[]{
-                SwingUtilities2.getSystemMnemonicKeyMask(),
-                KeyEvent.META_MASK
+                SwingUtilities2.getSystemMnemonicKeyMask(), metaMask
             },
             "Menu.cancelMode", "hideMenuTree",
 
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java
index 402bcc5..a0b182b8 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java
@@ -107,6 +107,7 @@
         };
     }
 
+    @SuppressWarnings("deprecation")
     public boolean isPopupTrigger(MouseEvent e) {
         return ((e.getID()==MouseEvent.MOUSE_PRESSED)
                 && ((e.getModifiers() & MouseEvent.BUTTON3_MASK)!=0));
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java
index 208a968..a2a85e9 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifTextUI.java
@@ -155,6 +155,7 @@
     /**
      * Default bindings all keymaps implementing the Motif feel.
      */
+    @SuppressWarnings("deprecation")
     static final JTextComponent.KeyBinding[] defaultBindings = {
         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT,
                                                                     InputEvent.CTRL_MASK),
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java
index eb47262..10a9e35 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java
@@ -36,7 +36,6 @@
 import javax.swing.*;
 
 
-
 import com.sun.java.swing.plaf.windows.TMSchema.State;
 import static com.sun.java.swing.plaf.windows.TMSchema.State.*;
 import com.sun.java.swing.plaf.windows.TMSchema.Part;
@@ -383,18 +382,25 @@
             updateProgress();
             if (! isDone()) {
                 Graphics2D g = (Graphics2D) _g.create();
-                skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
-                float alpha;
-                if (isForward) {
-                    alpha = progress;
+                if (skin.haveToSwitchStates()) {
+                    skin.paintSkinRaw(g, dx, dy, dw, dh, state);
+                    g.setComposite(AlphaComposite.SrcOver.derive(1 - progress));
+                    skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
                 } else {
-                    alpha = 1 - progress;
+                    skin.paintSkinRaw(g, dx, dy, dw, dh, startState);
+                    float alpha;
+                    if (isForward) {
+                        alpha = progress;
+                    } else {
+                        alpha = 1 - progress;
+                    }
+                    g.setComposite(AlphaComposite.SrcOver.derive(alpha));
+                    skin.paintSkinRaw(g, dx, dy, dw, dh, state);
                 }
-                g.setComposite(AlphaComposite.SrcOver.derive(alpha));
-                skin.paintSkinRaw(g, dx, dy, dw, dh, state);
                 g.dispose();
             } else {
                 skin.paintSkinRaw(_g, dx, dy, dw, dh, state);
+                skin.switchStates(false);
             }
         }
         boolean isDone() {
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/TMSchema.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/TMSchema.java
index 0bca0dd..f45a077 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/TMSchema.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/TMSchema.java
@@ -121,6 +121,12 @@
 
         LBP_LISTBOX(Control.LISTBOX, 0),
 
+        LBCP_BORDER_HSCROLL  (Control.LISTBOX, 1),
+        LBCP_BORDER_HVSCROLL (Control.LISTBOX, 2),
+        LBCP_BORDER_NOSCROLL (Control.LISTBOX, 3),
+        LBCP_BORDER_VSCROLL  (Control.LISTBOX, 4),
+        LBCP_ITEM            (Control.LISTBOX, 5),
+
         LVP_LISTVIEW(Control.LISTVIEW, 0),
 
         PP_PROGRESS (Control.PROGRESS, 0),
@@ -343,6 +349,12 @@
             stateMap.put(Part.HP_HEADERSORTARROW,
                          new State[] {SORTEDDOWN, SORTEDUP});
 
+            State[] listBoxStates = new State[] { NORMAL, PRESSED, HOT, DISABLED};
+            stateMap.put(Part.LBCP_BORDER_HSCROLL, listBoxStates);
+            stateMap.put(Part.LBCP_BORDER_HVSCROLL, listBoxStates);
+            stateMap.put(Part.LBCP_BORDER_NOSCROLL, listBoxStates);
+            stateMap.put(Part.LBCP_BORDER_VSCROLL, listBoxStates);
+
             State[] scrollBarStates = new State[] { NORMAL, HOT, PRESSED, DISABLED, HOVER };
             stateMap.put(Part.SBP_SCROLLBAR,    scrollBarStates);
             stateMap.put(Part.SBP_THUMBBTNVERT, scrollBarStates);
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java
index 8021755..677ee8b 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java
@@ -41,6 +41,7 @@
 import sun.swing.DefaultLookup;
 import sun.swing.StringUIClientPropertyKey;
 
+import com.sun.java.swing.plaf.windows.WindowsBorders.DashedBorder;
 
 /**
  * Windows combo box.
@@ -97,6 +98,9 @@
                 } else if (source instanceof XPComboBoxButton) {
                     rv = ((XPComboBoxButton) source)
                         .getWindowsComboBoxUI().comboBox;
+                } else if (source instanceof JTextField &&
+                        ((JTextField) source).getParent() instanceof JComboBox) {
+                    rv = (JComboBox) ((JTextField) source).getParent();
                 }
                 return rv;
             }
@@ -149,6 +153,8 @@
             //is initialized after installListeners is invoked
             comboBox.addMouseListener(rolloverListener);
             arrowButton.addMouseListener(rolloverListener);
+            // set empty border as default to see vista animated border
+            comboBox.setBorder(new EmptyBorder(0,0,0,0));
         }
     }
 
@@ -224,6 +230,9 @@
             state = State.DISABLED;
         } else if (isPopupVisible(comboBox)) {
             state = State.PRESSED;
+        } else if (comboBox.isEditable()
+                && comboBox.getEditor().getEditorComponent().isFocusOwner()) {
+            state = State.PRESSED;
         } else if (isRollover) {
             state = State.HOT;
         }
@@ -242,7 +251,7 @@
             skin = xp.getSkin(c, Part.CP_READONLY);
         }
         if (skin == null) {
-            skin = xp.getSkin(c, Part.CP_COMBOBOX);
+            skin = xp.getSkin(c, Part.CP_BORDER);
         }
         skin.paintSkin(g, 0, 0, c.getWidth(), c.getHeight(), state);
     }
@@ -368,7 +377,7 @@
     }
 
     protected ComboPopup createPopup() {
-        return super.createPopup();
+        return new WinComboPopUp(comboBox);
     }
 
     /**
@@ -414,8 +423,10 @@
 
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     private class XPComboBoxButton extends XPStyle.GlyphButton {
+        private State prevState = null;
+
         public XPComboBoxButton(XPStyle xp) {
-            super(null,
+            super(comboBox,
                   (! xp.isSkinDefined(comboBox, Part.CP_DROPDOWNBUTTONRIGHT))
                    ? Part.CP_DROPDOWNBUTTON
                    : (comboBox.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
@@ -428,18 +439,33 @@
         @Override
         protected State getState() {
             State rv;
+
+            getModel().setPressed(comboBox.isPopupVisible());
+
             rv = super.getState();
             XPStyle xp = XPStyle.getXP();
             if (rv != State.DISABLED
-                && comboBox != null && ! comboBox.isEditable()
-                && xp != null && xp.isSkinDefined(comboBox,
-                                                  Part.CP_DROPDOWNBUTTONRIGHT)) {
+                    && comboBox != null && ! comboBox.isEditable()
+                    && xp != null && xp.isSkinDefined(comboBox,
+                            Part.CP_DROPDOWNBUTTONRIGHT)) {
                 /*
                  * for non editable ComboBoxes Vista seems to have the
                  * same glyph for all non DISABLED states
                  */
                 rv = State.NORMAL;
             }
+            if (rv == State.NORMAL && (prevState == State.HOT || prevState == State.PRESSED)) {
+                /*
+                 * State NORMAL of combobox button cannot overpaint states HOT or PRESSED
+                 * Therefore HOT state must be painted from alpha 1 to 0 and not as usual that
+                 * NORMAL state is painted from alpha 0 to alpha 1.
+                 */
+                skin.switchStates(true);
+            }
+            if (rv != prevState) {
+                prevState = rv;
+            }
+
             return rv;
         }
 
@@ -484,6 +510,39 @@
         }
     }
 
+    @SuppressWarnings("serial") // Same-version serialization only
+    protected class WinComboPopUp extends BasicComboPopup {
+        private Skin listBoxBorder = null;
+        private XPStyle xp;
+
+        public WinComboPopUp(JComboBox<Object> combo) {
+            super(combo);
+            xp = XPStyle.getXP();
+            if (xp != null && xp.isSkinDefined(combo, Part.LBCP_BORDER_NOSCROLL)) {
+                this.listBoxBorder = new Skin(combo, Part.LBCP_BORDER_NOSCROLL);
+                this.setBorder(new EmptyBorder(1,1,1,1));
+            }
+        }
+
+        protected KeyListener createKeyListener() {
+            return new InvocationKeyHandler();
+        }
+
+        protected class InvocationKeyHandler extends BasicComboPopup.InvocationKeyHandler {
+            protected InvocationKeyHandler() {
+                WinComboPopUp.this.super();
+            }
+        }
+
+        protected void paintComponent(Graphics g) {
+            super.paintComponent(g);
+            if (this.listBoxBorder != null) {
+                this.listBoxBorder.paintSkinRaw(g, this.getX(), this.getY(),
+                        this.getWidth(), this.getHeight(), State.HOT);
+            }
+        }
+    }
+
 
     /**
      * Subclassed to highlight selected item in an editable combo box.
@@ -498,6 +557,7 @@
         protected JTextField createEditorComponent() {
             JTextField editor = super.createEditorComponent();
             Border border = (Border)UIManager.get("ComboBox.editorBorder");
+
             if (border != null) {
                 editor.setBorder(border);
             }
@@ -524,6 +584,31 @@
         private static final Object BORDER_KEY
             = new StringUIClientPropertyKey("BORDER_KEY");
         private static final Border NULL_BORDER = new EmptyBorder(0, 0, 0, 0);
+
+        // Create own version of DashedBorder with more space on left side
+        private class WindowsComboBoxDashedBorder extends DashedBorder {
+
+            public WindowsComboBoxDashedBorder(Color color, int thickness) {
+                super(color, thickness);
+            }
+
+            public WindowsComboBoxDashedBorder(Color color) {
+                super(color);
+            }
+
+            @Override
+            public Insets getBorderInsets(Component c, Insets i) {
+                return new Insets(0,2,0,0);
+            }
+        }
+
+        public WindowsComboBoxRenderer() {
+            super();
+
+            // correct space on the left side of text items in the combo popup list
+            Insets i = getBorder().getBorderInsets(this);
+            setBorder(new EmptyBorder(0, 2, 0, i.right));
+        }
         /**
          * {@inheritDoc}
          */
@@ -542,7 +627,7 @@
                 if (index == -1 && isSelected) {
                     Border border = component.getBorder();
                     Border dashedBorder =
-                        new WindowsBorders.DashedBorder(list.getForeground());
+                        new WindowsComboBoxDashedBorder(list.getForeground());
                     component.setBorder(dashedBorder);
                     //store current border in client property if needed
                     if (component.getClientProperty(BORDER_KEY) == null) {
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
index 598b081..fa50e94 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
@@ -672,7 +672,7 @@
             "ComboBox.buttonHighlight", ControlHighlightColor,
             "ComboBox.selectionBackground", SelectionBackgroundColor,
             "ComboBox.selectionForeground", SelectionTextColor,
-            "ComboBox.editorBorder", new XPValue(new EmptyBorder(1,2,1,1),
+            "ComboBox.editorBorder", new XPValue(new EmptyBorder(1,4,1,1),
                                                  new EmptyBorder(1,4,1,4)),
             "ComboBox.disabledBackground",
                         new XPColorValue(Part.CP_COMBOBOX, State.DISABLED,
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java
index 8f73094..be22c73 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java
@@ -165,8 +165,11 @@
         }
 
         public boolean postProcessKeyEvent(KeyEvent ev) {
-            if(ev.isConsumed()) {
-                // do not manage consumed event
+            if(ev.isConsumed() && ev.getKeyCode() != KeyEvent.VK_ALT) {
+                // mnemonic combination, it's consumed, but we need
+                // set altKeyPressed to false, otherwise after selection
+                // component by mnemonic combination a menu will be open
+                altKeyPressed = false;
                 return false;
             }
             if (ev.getKeyCode() == KeyEvent.VK_ALT) {
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI.java
index 30f348d..eb8080b 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI.java
@@ -63,6 +63,7 @@
 
     private boolean contentOpaque = true;
 
+    @SuppressWarnings("deprecation")
     protected void installDefaults() {
         super.installDefaults();
         contentOpaque = UIManager.getBoolean("TabbedPane.contentOpaque");
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java
index 0dbe039..2c60209 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -127,7 +127,7 @@
      *
      * @param part a <code>Part</code>
      * @param state a <code>String</code>
-     * @param attributeKey a <code>String</code>
+     * @param prop a <code>String</code>
      * @return a <code>String</code> or null if key is not found
      *    in the current style
      *
@@ -172,7 +172,6 @@
 
     /** Get a named <code>Dimension</code> value from the current style
      *
-     * @param key a <code>String</code>
      * @return a <code>Dimension</code> or null if key is not found
      *    in the current style
      *
@@ -189,7 +188,6 @@
     /** Get a named <code>Point</code> (e.g. a location or an offset) value
      *  from the current style
      *
-     * @param key a <code>String</code>
      * @return a <code>Point</code> or null if key is not found
      *    in the current style
      *
@@ -205,7 +203,6 @@
 
     /** Get a named <code>Insets</code> value from the current style
      *
-     * @param key a <code>String</code>
      * @return an <code>Insets</code> object or null if key is not found
      *    in the current style
      *
@@ -223,7 +220,6 @@
 
     /** Get a named <code>Color</code> value from the current style
      *
-     * @param part a <code>Part</code>
      * @return a <code>Color</code> or null if key is not found
      *    in the current style
      */
@@ -479,6 +475,7 @@
 
         private final String string;
         private Dimension size = null;
+        private boolean switchStates = false;
 
         Skin(Component component, Part part) {
             this(component, part, null);
@@ -513,6 +510,14 @@
             return (insets != null) ? insets : new Insets(0, 0, 0, 0);
         }
 
+        boolean haveToSwitchStates() {
+            return switchStates;
+        }
+
+        void switchStates(boolean b) {
+            switchStates = b;
+        }
+
         private int getWidth(State state) {
             if (size == null) {
                 size = getPartSize(part, state);
@@ -689,7 +694,7 @@
 
     @SuppressWarnings("serial") // Superclass is not serializable across versions
     static class GlyphButton extends JButton {
-        private Skin skin;
+        protected Skin skin;
 
         public GlyphButton(Component parent, Part part) {
             XPStyle xp = getXP();
diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java
index 672b76f..bea9f5d 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -444,6 +444,7 @@
      * close this device if discarded by the garbage collector.
      */
     @Override
+    @SuppressWarnings("deprecation")
     protected final void finalize() {
         close();
     }
diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMixer.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMixer.java
index 7389e8d..c040c55 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMixer.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractMixer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@
 
     /**
      * Constructs a new AbstractMixer.
-     * @param mixer the mixer with which this line is associated
+     * @param mixerInfo the mixer with which this line is associated
      * @param controls set of supported controls
      */
     protected AbstractMixer(Mixer.Info mixerInfo,
diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java
index b7d292a..4f01291 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 
 import java.util.Map;
 
+import javax.sound.midi.MidiSystem;
 import javax.sound.midi.MidiUnavailableException;
 import javax.sound.midi.Synthesizer;
 import javax.sound.sampled.AudioFormat;
diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java
index 7553353..ef995f8 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -163,7 +163,6 @@
      * rllong
      * Protected helper method to read 64 bits and changing the order of
      * each bytes.
-     * @param DataInputStream
      * @return 32 bits swapped value.
      * @exception IOException
      */
@@ -187,7 +186,6 @@
     /**
      * big2little
      * Protected helper method to swap the order of bytes in a 32 bit int
-     * @param int
      * @return 32 bits swapped value
      */
     final int big2little(int i) {
@@ -207,7 +205,6 @@
     /**
      * rlshort
      * Protected helper method to read 16 bits value. Swap high with low byte.
-     * @param DataInputStream
      * @return the swapped value.
      * @exception IOException
      */
@@ -229,7 +226,6 @@
     /**
      * big2little
      * Protected helper method to swap the order of bytes in a 16 bit short
-     * @param int
      * @return 16 bits swapped value
      */
     final short big2littleShort(short i) {
diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java
index 50b200f..9e78425 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,6 @@
      * rllong
      * Protected helper method to read 64 bits and changing the order of
      * each bytes.
-     * @param DataInputStream
      * @return 32 bits swapped value.
      * @exception IOException
      */
@@ -93,7 +92,6 @@
     /**
      * big2little
      * Protected helper method to swap the order of bytes in a 32 bit int
-     * @param int
      * @return 32 bits swapped value
      */
     final int big2little(int i) {
@@ -113,7 +111,6 @@
     /**
      * rlshort
      * Protected helper method to read 16 bits value. Swap high with low byte.
-     * @param DataInputStream
      * @return the swapped value.
      * @exception IOException
      */
@@ -135,7 +132,6 @@
     /**
      * big2little
      * Protected helper method to swap the order of bytes in a 16 bit short
-     * @param int
      * @return 16 bits swapped value
      */
     final short big2littleShort(short i) {
diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/Toolkit.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/Toolkit.java
index 1b903a3..2105248 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/Toolkit.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/Toolkit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
 
     /**
      * Swaps bytes.
-     * @throws ArrayOutOfBoundsException if len is not a multiple of 2.
+     * @throws ArrayIndexOutOfBoundsException if len is not a multiple of 2.
      */
     static void getByteSwapped(byte[] b, int off, int len) {
 
diff --git a/jdk/src/java.desktop/share/classes/java/applet/package-info.java b/jdk/src/java.desktop/share/classes/java/applet/package-info.java
new file mode 100644
index 0000000..351a58b
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/applet/package-info.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides the classes necessary to create an applet and the classes an applet
+ * uses to communicate with its applet context.
+ * <p>
+ * The applet framework involves two entities: the <i>applet</i> and the
+ * <i>applet context</i>. An applet is an embeddable window (see the Panel
+ * class) with a few extra methods that the applet context can use to
+ * initialize, start, and stop the applet.
+ * <p>
+ * The applet context is an application that is responsible for loading and
+ * running applets. For example, the applet context could be a Web browser or an
+ * applet development environment.
+ * <p>
+ * The APIs in this package are all deprecated. Alternative technologies such as
+ * Java Web Start or installable applications should be used instead.
+ * See <a href="http://openjdk.java.net/jeps/289">JEP 289</a> and
+ * the Oracle White Paper
+ * <a href="http://www.oracle.com/technetwork/java/javase/migratingfromapplets-2872444.pdf">
+ * "Migrating from Java Applets to plugin-free Java technologies"</a> for more
+ * information.
+ *
+ * @since 1.0
+ */
+package java.applet;
diff --git a/jdk/src/java.desktop/share/classes/java/applet/package.html b/jdk/src/java.desktop/share/classes/java/applet/package.html
deleted file mode 100644
index a95395b..0000000
--- a/jdk/src/java.desktop/share/classes/java/applet/package.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<!--
- Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<body bgcolor="white">
-
-Provides the classes necessary to create an applet and the classes an applet
-uses to communicate with its applet context.
-<p>
-The applet framework involves two
-entities: the <i>applet</i> and the <i>applet context</i>. An applet is an 
-embeddable window (see the Panel class) with a few extra methods that the applet 
-context can use to initialize, start, and stop the applet.
-<p>
-The applet context is an application that is responsible for loading and running
-applets. For example, the applet context could be a Web browser or an applet
-development environment.
-<p>
-The APIs in this package are all deprecated. Alternative technologies such as Java Web Start
-or installable applications should be used instead. See <a href="http://openjdk.java.net/jeps/289">JEP 289</a>
-and the Oracle White Paper <a href="http://www.oracle.com/technetwork/java/javase/migratingfromapplets-2872444.pdf">
-"Migrating from Java Applets to plugin-free Java technologies"</a> for more information.
-<p>
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.0
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java b/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java
index 9250597..fe0b169 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java
@@ -292,8 +292,12 @@
 
     /**
      * Constructs an AWTEvent object from the parameters of a 1.0-style event.
+     *
      * @param event the old-style event
+     * @deprecated It is recommended that {@link #AWTEvent(Object, int)} be used
+     *             instead
      */
+    @Deprecated(since = "9")
     public AWTEvent(Event event) {
         this(event.target, event.id);
     }
@@ -436,6 +440,7 @@
      * event class in java.awt.event because we don't want to make
      * it public and it needs to be called from java.awt.
      */
+    @SuppressWarnings("deprecation")
     Event convertToOld() {
         Object src = getSource();
         int newid = id;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java b/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java
index 6e85f2b..075d5a6 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java
@@ -350,6 +350,7 @@
      * @throws NullPointerException if {@code anEvent} is null
      * @return the {@code AWTKeyStroke} that precipitated the event
      */
+    @SuppressWarnings("deprecation")
     public static AWTKeyStroke getAWTKeyStrokeForEvent(KeyEvent anEvent) {
         int id = anEvent.getID();
         switch(id) {
@@ -397,6 +398,7 @@
      * @throws IllegalArgumentException if {@code s} is {@code null},
      *        or is formatted incorrectly
      */
+    @SuppressWarnings("deprecation")
     public static AWTKeyStroke getAWTKeyStroke(String s) {
         if (s == null) {
             throw new IllegalArgumentException("String cannot be null");
@@ -708,6 +710,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     private static int mapOldModifiers(int modifiers) {
         if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
             modifiers |= InputEvent.SHIFT_DOWN_MASK;
@@ -737,6 +740,7 @@
         return modifiers;
     }
 
+    @SuppressWarnings("deprecation")
     private static int mapNewModifiers(int modifiers) {
         if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
             modifiers |= InputEvent.SHIFT_MASK;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Component.java b/jdk/src/java.desktop/share/classes/java/awt/Component.java
index dca2674..6858859 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Component.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Component.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,7 @@
 import javax.accessibility.*;
 import java.applet.Applet;
 import javax.swing.JComponent;
+import javax.swing.JRootPane;
 
 import sun.awt.ComponentFactory;
 import sun.security.action.GetPropertyAction;
@@ -5036,6 +5037,7 @@
      *
      * Returns whether or not event was dispatched to an ancestor
      */
+    @SuppressWarnings("deprecation")
     boolean dispatchMouseWheelToAncestor(MouseWheelEvent e) {
         int newX, newY;
         newX = e.getX() + getX(); // Coordinates take into account at least
@@ -6231,7 +6233,7 @@
     /**
      * Indicates whether a class or its superclasses override coalesceEvents.
      * Must be called with lock on coalesceMap and privileged.
-     * @see checkCoalescing
+     * @see #checkCoalescing
      */
     private static boolean isCoalesceEventsOverriden(Class<?> clazz) {
         assert Thread.holdsLock(coalesceMap);
@@ -10379,7 +10381,11 @@
     }
 
     /**
-     * Sets a 'mixing-cutout' shape for the given component.
+     * Sets a 'mixing-cutout' shape for this lightweight component.
+     *
+     * This method is used exclusively for the purposes of the
+     * Heavyweight/Lightweight Components Mixing feature and will
+     * have no effect if applied to a heavyweight component.
      *
      * By default a lightweight component is treated as an opaque rectangle for
      * the purposes of the Heavyweight/Lightweight Components Mixing feature.
@@ -10392,7 +10398,7 @@
      * <li>{@code null} - reverts the default cutout shape (the rectangle equal
      * to the component's {@code getBounds()})
      * <li><i>empty-shape</i> - does not cut out anything from heavyweight
-     * components. This makes the given lightweight component effectively
+     * components. This makes this lightweight component effectively
      * transparent. Note that descendants of the lightweight component still
      * affect the shapes of heavyweight components.  An example of an
      * <i>empty-shape</i> is {@code new Rectangle()}.
@@ -10401,21 +10407,16 @@
      * </ul>
      * <p>
      * The most common example when the 'mixing-cutout' shape is needed is a
-     * glass pane component. The {@link JRootPane#setGlassPane()} method
+     * glass pane component. The {@link JRootPane#setGlassPane} method
      * automatically sets the <i>empty-shape</i> as the 'mixing-cutout' shape
      * for the given glass pane component.  If a developer needs some other
      * 'mixing-cutout' shape for the glass pane (which is rare), this must be
      * changed manually after installing the glass pane to the root pane.
-     * <p>
-     * Note that the 'mixing-cutout' shape neither affects painting, nor the
-     * mouse events handling for the given component. It is used exclusively
-     * for the purposes of the Heavyweight/Lightweight Components Mixing
-     * feature.
      *
      * @param shape the new 'mixing-cutout' shape
      * @since 9
      */
-    void setMixingCutoutShape(Shape shape) {
+    public void setMixingCutoutShape(Shape shape) {
         Region region = shape == null ? null : Region.getInstance(shape, null);
 
         synchronized (getTreeLock()) {
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Container.java b/jdk/src/java.desktop/share/classes/java/awt/Container.java
index 13d5e23..e0bb5e0 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Container.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Container.java
@@ -4728,6 +4728,7 @@
      * Listen for drag events posted in other hw components so we can
      * track enter/exit regardless of where a drag originated
      */
+    @SuppressWarnings("deprecation")
     public void eventDispatched(AWTEvent e) {
         boolean isForeignDrag = (e instanceof MouseEvent) &&
                                 !(e instanceof SunDropTargetEvent) &&
@@ -4826,6 +4827,7 @@
      * If the target has been removed, we don't bother to send the
      * message.
      */
+    @SuppressWarnings("deprecation")
     void retargetMouseEvent(Component target, int id, MouseEvent e) {
         if (target == null) {
             return; // mouse is over another hw component or target is disabled
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Desktop.java b/jdk/src/java.desktop/share/classes/java/awt/Desktop.java
index fac3def..1292887 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Desktop.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Desktop.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,12 @@
 
 package java.awt;
 
+import java.awt.desktop.AboutEvent;
 import java.awt.desktop.AboutHandler;
 import java.awt.desktop.OpenFilesHandler;
+import java.awt.desktop.OpenURIEvent;
 import java.awt.desktop.OpenURIHandler;
+import java.awt.desktop.PreferencesEvent;
 import java.awt.desktop.PreferencesHandler;
 import java.awt.desktop.PrintFilesHandler;
 import java.awt.desktop.QuitHandler;
@@ -42,8 +45,9 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 
-import sun.awt.SunToolkit;
 import javax.swing.JMenuBar;
+
+import sun.awt.SunToolkit;
 import sun.security.util.SecurityConstants;
 
 /**
@@ -335,7 +339,7 @@
      * most of the platforms support the {@link Desktop.Action#OPEN}
      * action.  But for a specific file, there may not be an
      * application registered to open it.  In this case, {@link
-     * #isSupported} may return {@code true}, but the corresponding
+     * #isSupported(Action)} may return {@code true}, but the corresponding
      * action method will throw an {@link IOException}.
      *
      * @param action the specified {@link Action}
@@ -720,7 +724,7 @@
      * default behavior.
      *
      * @param aboutHandler the handler to respond to the
-     * {@link java.awt.desktop.AboutHandler#handleAbout} )} message
+     * {@link java.awt.desktop.AboutHandler#handleAbout(AboutEvent)} message
      *
      * @throws SecurityException if a security manager exists and it
      * denies the
@@ -828,7 +832,7 @@
      * open a URL.
      *
      * Setting the handler to {@code null} causes all
-     * {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be
+     * {@link OpenURIHandler#openURI(OpenURIEvent)} requests to be
      * enqueued until another handler is set.
      *
      * @implNote Please note that for Mac OS, notifications
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Event.java b/jdk/src/java.desktop/share/classes/java/awt/Event.java
index b00b098..da33b23 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Event.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Event.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,7 @@
  */
 package java.awt;
 
-import java.awt.event.*;
-import java.io.*;
+import java.awt.event.KeyEvent;
 
 /**
  * <b>NOTE:</b> The {@code Event} class is obsolete and is
@@ -56,9 +55,12 @@
  * {@code Event} class ({@code PGUP},
  * {@code PGDN}, {@code F1}, {@code F2}, etc).
  *
+ * @deprecated It is recommended that {@code AWTEvent} and its subclasses be
+ *             used instead
  * @author     Sami Shaio
  * @since      1.0
  */
+@Deprecated(since = "9")
 public class Event implements java.io.Serializable {
     private transient long data;
 
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Font.java b/jdk/src/java.desktop/share/classes/java/awt/Font.java
index 18046fd..2440a66 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Font.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Font.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,7 @@
 import java.security.PrivilegedExceptionAction;
 import java.text.AttributedCharacterIterator.Attribute;
 import java.text.CharacterIterator;
+import java.util.EventListener;
 import java.util.Hashtable;
 import java.util.Locale;
 import java.util.Map;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Graphics.java b/jdk/src/java.desktop/share/classes/java/awt/Graphics.java
index 932a89d..317a93f 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Graphics.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Graphics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1159,8 +1159,18 @@
 
     /**
      * Disposes of this graphics context once it is no longer referenced.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      * @see #dispose
      */
+    @Deprecated(since="9")
     public void finalize() {
         dispose();
     }
diff --git a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java
index 1e9e2f4..f2fb6d2 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java
@@ -415,6 +415,7 @@
      * Initializes a KeyboardFocusManager.
      */
     public KeyboardFocusManager() {
+        @SuppressWarnings("deprecation")
         AWTKeyStroke[][] defaultFocusTraversalKeyStrokes = {
                 {
                         AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0, false),
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Menu.java b/jdk/src/java.desktop/share/classes/java/awt/Menu.java
index 4bd1bba..acadfeb 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Menu.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Menu.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,9 @@
 import java.awt.peer.MenuPeer;
 import java.io.IOException;
 import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.Enumeration;
+import java.util.EventListener;
 import java.util.Vector;
 
 import javax.accessibility.Accessible;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java
index 8d0d51d..a5eaca1 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,9 @@
 import java.awt.peer.MenuBarPeer;
 import java.io.IOException;
 import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.Enumeration;
+import java.util.EventListener;
 import java.util.Vector;
 
 import javax.accessibility.Accessible;
@@ -375,6 +377,7 @@
      * keydown).  Returns true if there is an associated
      * keyboard event.
      */
+    @SuppressWarnings("deprecation")
     boolean handleShortcut(KeyEvent e) {
         // Is it a key event?
         int id = e.getID();
diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java b/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java
index fb3c72c..b4bc3c7 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java
@@ -379,6 +379,7 @@
             }
 
         } else { // backward compatibility
+            @SuppressWarnings("deprecation")
             Event olde = e.convertToOld();
             if (olde != null) {
                 postEvent(olde);
diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java b/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java
index e0611cc..0d869c4 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java
@@ -435,6 +435,7 @@
      * keydown) and the item is enabled.
      * Returns true if there is an associated shortcut.
      */
+    @SuppressWarnings("deprecation")
     boolean handleShortcut(KeyEvent e) {
         MenuShortcut s = new MenuShortcut(e.getKeyCode(),
                              (e.getModifiers() & InputEvent.SHIFT_MASK) > 0);
diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java b/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java
index 57526ff..0704b32 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java
@@ -180,6 +180,7 @@
      * @return a string representation of this MenuShortcut.
      * @since 1.1
      */
+    @SuppressWarnings("deprecation")
     public String toString() {
         int modifiers = 0;
         if (!GraphicsEnvironment.isHeadless()) {
diff --git a/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java b/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java
index faca59d..f1e93fd 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,10 @@
 
 package java.awt;
 
-import java.awt.image.Raster;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
 import java.awt.image.ColorModel;
+import java.awt.image.Raster;
 
 /**
  * The {@code PaintContext} interface defines the encapsulated
diff --git a/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java b/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java
index 4846074..7e8737a 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java
@@ -154,6 +154,7 @@
      *                parent's hierarchy
      * @exception RuntimeException if the parent is not showing on screen
      */
+    @SuppressWarnings("deprecation")
     public void show(Component origin, int x, int y) {
         // Use localParent for thread safety.
         MenuContainer localParent = parent;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/PrintJob.java b/jdk/src/java.desktop/share/classes/java/awt/PrintJob.java
index fcc6afe..9012608 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/PrintJob.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/PrintJob.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -79,8 +79,18 @@
 
     /**
      * Ends this print job once it is no longer referenced.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      * @see #end
      */
+    @Deprecated(since="9")
     public void finalize() {
         end();
     }
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Robot.java b/jdk/src/java.desktop/share/classes/java/awt/Robot.java
index 8483ed3..1f24684 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Robot.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Robot.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,9 @@
 
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BaseMultiResolutionImage;
+import java.awt.image.MultiResolutionImage;
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBufferInt;
 import java.awt.image.DirectColorModel;
@@ -38,6 +41,7 @@
 import sun.awt.ComponentFactory;
 import sun.awt.SunToolkit;
 import sun.awt.image.SunWritableRaster;
+import sun.swing.SwingUtilities2;
 
 /**
  * This class is used to generate native system input events
@@ -95,15 +99,14 @@
 
     /**
      * Creates a Robot for the given screen device. Coordinates passed
-     * to Robot method calls like mouseMove and createScreenCapture will
-     * be interpreted as being in the same coordinate system as the
-     * specified screen. Note that depending on the platform configuration,
-     * multiple screens may either:
+     * to Robot method calls like mouseMove, getPixelColor and
+     * createScreenCapture will be interpreted as being in the same coordinate
+     * system as the specified screen. Note that depending on the platform
+     * configuration, multiple screens may either:
      * <ul>
      * <li>share the same coordinate system to form a combined virtual screen</li>
      * <li>use different coordinate systems to act as independent screens</li>
      * </ul>
-     * This constructor is meant for the latter case.
      * <p>
      * If screen devices are reconfigured such that the coordinate system is
      * affected, the behavior of existing Robot objects is undefined.
@@ -137,6 +140,7 @@
         initLegalButtonMask();
     }
 
+    @SuppressWarnings("deprecation")
     private static synchronized void initLegalButtonMask() {
         if (LEGAL_BUTTON_MASK != 0) return;
 
@@ -390,6 +394,11 @@
      * @return  Color of the pixel
      */
     public synchronized Color getPixelColor(int x, int y) {
+        AffineTransform tx = GraphicsEnvironment.
+                getLocalGraphicsEnvironment().getDefaultScreenDevice().
+                getDefaultConfiguration().getDefaultTransform();
+        x = (int) (x * tx.getScaleX());
+        y = (int) (y * tx.getScaleY());
         Color color = new Color(peer.getRGBPixel(x, y));
         return color;
     }
@@ -405,13 +414,70 @@
      * @see     AWTPermission
      */
     public synchronized BufferedImage createScreenCapture(Rectangle screenRect) {
+        return createCompatibleImage(screenRect, false)[0];
+    }
+
+    /**
+     * Creates an image containing pixels read from the screen.
+     * This image does not include the mouse cursor.
+     * This method can be used in case there is a scaling transform
+     * from user space to screen (device) space.
+     * Typically this means that the display is a high resolution screen,
+     * although strictly it means any case in which there is such a transform.
+     * Returns a {@link java.awt.image.MultiResolutionImage}.
+     * <p>
+     * For a non-scaled display, the {@code MultiResolutionImage}
+     * will have one image variant:
+     * <ul>
+     * <li> Base Image with user specified size.
+     * </ul>
+     * <p>
+     * For a high resolution display where there is a scaling transform,
+     * the {@code MultiResolutionImage} will have two image variants:
+     * <ul>
+     * <li> Base Image with user specified size. This is scaled from the screen.
+     * <li> Native device resolution image with device size pixels.
+     * </ul>
+     * <p>
+     * Example:
+     * <pre>{@code
+     *      Image nativeResImage;
+     *      MultiResolutionImage mrImage = robot.createMultiResolutionScreenCapture(frame.getBounds());
+     *      List<Image> resolutionVariants = mrImage.getResolutionVariants();
+     *      if (resolutionVariants.size() > 1) {
+     *          nativeResImage = resolutionVariants.get(1);
+     *      } else {
+     *          nativeResImage = resolutionVariants.get(0);
+     *      }
+     * }</pre>
+     * @param   screenRect     Rect to capture in screen coordinates
+     * @return  The captured image
+     * @throws  IllegalArgumentException if {@code screenRect} width and height are not greater than zero
+     * @throws  SecurityException if {@code readDisplayPixels} permission is not granted
+     * @see     SecurityManager#checkPermission
+     * @see     AWTPermission
+     *
+     * @since 9
+     */
+    public synchronized MultiResolutionImage
+            createMultiResolutionScreenCapture(Rectangle screenRect) {
+
+        return new BaseMultiResolutionImage(
+                createCompatibleImage(screenRect, true));
+    }
+
+    private synchronized BufferedImage[]
+            createCompatibleImage(Rectangle screenRect, boolean isHiDPI) {
+
         checkScreenCaptureAllowed();
 
         checkValidRect(screenRect);
 
-        BufferedImage image;
+        BufferedImage lowResolutionImage;
+        BufferedImage highResolutionImage;
         DataBufferInt buffer;
         WritableRaster raster;
+        BufferedImage[] imageArray;
 
         if (screenCapCM == null) {
             /*
@@ -421,31 +487,98 @@
              */
 
             screenCapCM = new DirectColorModel(24,
-                                               /* red mask */    0x00FF0000,
-                                               /* green mask */  0x0000FF00,
-                                               /* blue mask */   0x000000FF);
+                    /* red mask */ 0x00FF0000,
+                    /* green mask */ 0x0000FF00,
+                    /* blue mask */ 0x000000FF);
         }
 
+        int[] bandmasks = new int[3];
+        bandmasks[0] = screenCapCM.getRedMask();
+        bandmasks[1] = screenCapCM.getGreenMask();
+        bandmasks[2] = screenCapCM.getBlueMask();
+
         // need to sync the toolkit prior to grabbing the pixels since in some
         // cases rendering to the screen may be delayed
         Toolkit.getDefaultToolkit().sync();
 
+        GraphicsConfiguration gc = GraphicsEnvironment
+                .getLocalGraphicsEnvironment()
+                .getDefaultScreenDevice().
+                getDefaultConfiguration();
+        gc = SwingUtilities2.getGraphicsConfigurationAtPoint(
+                gc, screenRect.getCenterX(), screenRect.getCenterY());
+
+        AffineTransform tx = gc.getDefaultTransform();
+        double uiScaleX = tx.getScaleX();
+        double uiScaleY = tx.getScaleY();
         int pixels[];
-        int[] bandmasks = new int[3];
 
-        pixels = peer.getRGBPixels(screenRect);
-        buffer = new DataBufferInt(pixels, pixels.length);
+        if (uiScaleX == 1 && uiScaleY == 1) {
 
-        bandmasks[0] = screenCapCM.getRedMask();
-        bandmasks[1] = screenCapCM.getGreenMask();
-        bandmasks[2] = screenCapCM.getBlueMask();
+            pixels = peer.getRGBPixels(screenRect);
+            buffer = new DataBufferInt(pixels, pixels.length);
 
-        raster = Raster.createPackedRaster(buffer, screenRect.width, screenRect.height, screenRect.width, bandmasks, null);
-        SunWritableRaster.makeTrackable(buffer);
+            bandmasks[0] = screenCapCM.getRedMask();
+            bandmasks[1] = screenCapCM.getGreenMask();
+            bandmasks[2] = screenCapCM.getBlueMask();
 
-        image = new BufferedImage(screenCapCM, raster, false, null);
+            raster = Raster.createPackedRaster(buffer, screenRect.width,
+                    screenRect.height, screenRect.width, bandmasks, null);
+            SunWritableRaster.makeTrackable(buffer);
 
-        return image;
+            highResolutionImage = new BufferedImage(screenCapCM, raster,
+                    false, null);
+            imageArray = new BufferedImage[1];
+            imageArray[0] = highResolutionImage;
+
+        } else {
+
+            int sX = (int) Math.floor(screenRect.x * uiScaleX);
+            int sY = (int) Math.floor(screenRect.y * uiScaleY);
+            int sWidth = (int) Math.ceil(screenRect.width * uiScaleX);
+            int sHeight = (int) Math.ceil(screenRect.height * uiScaleY);
+            int temppixels[];
+            Rectangle scaledRect = new Rectangle(sX, sY, sWidth, sHeight);
+            temppixels = peer.getRGBPixels(scaledRect);
+
+            // HighResolutionImage
+            pixels = temppixels;
+            buffer = new DataBufferInt(pixels, pixels.length);
+            raster = Raster.createPackedRaster(buffer, scaledRect.width,
+                    scaledRect.height, scaledRect.width, bandmasks, null);
+            SunWritableRaster.makeTrackable(buffer);
+
+            highResolutionImage = new BufferedImage(screenCapCM, raster,
+                    false, null);
+
+
+            // LowResolutionImage
+            lowResolutionImage = new BufferedImage(screenRect.width,
+                    screenRect.height, highResolutionImage.getType());
+            Graphics2D g = lowResolutionImage.createGraphics();
+            g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
+                    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+            g.setRenderingHint(RenderingHints.KEY_RENDERING,
+                    RenderingHints.VALUE_RENDER_QUALITY);
+            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                    RenderingHints.VALUE_ANTIALIAS_ON);
+            g.drawImage(highResolutionImage, 0, 0,
+                    screenRect.width, screenRect.height,
+                    0, 0, scaledRect.width, scaledRect.height, null);
+            g.dispose();
+
+            if(!isHiDPI) {
+                imageArray = new BufferedImage[1];
+                imageArray[0] = lowResolutionImage;
+            } else {
+                imageArray = new BufferedImage[2];
+                imageArray[0] = lowResolutionImage;
+                imageArray[1] = highResolutionImage;
+            }
+
+        }
+
+        return imageArray;
     }
 
     private static void checkValidRect(Rectangle rect) {
diff --git a/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java b/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java
index 46ed1ff..0a7e44b 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,15 +25,17 @@
 
 package java.awt;
 
-import java.util.Vector;
+import java.awt.event.ActionListener;
 import java.awt.peer.SystemTrayPeer;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
-import sun.awt.AppContext;
-import sun.awt.SunToolkit;
-import sun.awt.HeadlessToolkit;
+import java.util.Vector;
+
 import sun.awt.AWTAccessor;
 import sun.awt.AWTPermissions;
+import sun.awt.AppContext;
+import sun.awt.HeadlessToolkit;
+import sun.awt.SunToolkit;
 
 /**
  * The {@code SystemTray} class represents the system tray for a
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Taskbar.java b/jdk/src/java.desktop/share/classes/java/awt/Taskbar.java
index 112ccb5..82a64d0 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Taskbar.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Taskbar.java
@@ -274,6 +274,10 @@
     /**
      * Requests user attention to the specified window.
      *
+     * Has no effect if a window representation is not displayable in
+     * the task area. Whether it is displayable is dependent on all
+     * of window type, platform, and implementation.
+     *
      * @param w window
      * @throws SecurityException if a security manager exists and it denies the
      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
@@ -375,6 +379,10 @@
      * for the specified window.
      * It may be disabled by system settings.
      *
+     * Has no effect if a window representation is not displayable in
+     * the task area. Whether it is displayable is dependent on all
+     * of window type, platform, and implementation.
+     *
      * @param w window to update
      * @param badge image to affix to the icon
      * @throws SecurityException if a security manager exists and it denies the
@@ -409,6 +417,11 @@
     /**
      * Displays a determinate progress bar in the task area for the specified
      * window.
+     *
+     * Has no effect if a window representation is not displayable in
+     * the task area. Whether it is displayable is dependent on all
+     * of window type, platform, and implementation.
+     *
      * <br>
      * The visual behavior is platform and {@link State} dependent.
      * <br>
@@ -437,6 +450,10 @@
 
     /**
      * Sets a progress state for a specified window.
+     *
+     * Has no effect if a window representation is not displayable in
+     * the task area. Whether it is displayable is dependent on all
+     * of window type, platform, and implementation.
      * <br>
      * Each state displays a progress in a platform-dependent way.
      * <br>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java
index f4bfd11..baa7456 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -451,7 +451,7 @@
      *
      * @param s the error message
      * @param e the original exception
-     * @throws the new AWTError including the cause (the original exception)
+     * @throws AWTError the new AWTError including the cause (the original exception)
      */
     private static void newAWTError(Throwable e, String s) {
         AWTError newAWTError = new AWTError(s);
@@ -1067,6 +1067,7 @@
      * @see       java.awt.MenuShortcut
      * @since     1.1
      */
+    @SuppressWarnings("deprecation")
     public int getMenuShortcutKeyMask() throws HeadlessException {
         GraphicsEnvironment.checkHeadless();
 
diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
index 3adc80f..36a09c0 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -751,7 +751,17 @@
 
     /**
      * Frees the resources associated with an ICC_Profile object.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     protected void finalize () {
         if (cmmProfile != null) {
             CMSManager.getModule().freeProfile(cmmProfile);
@@ -1071,7 +1081,7 @@
      * when loading this profile.
      * If deferring is enabled, then the deferred activation
      * code will take care of access privileges.
-     * @see activateDeferredProfile()
+     * @see #activateDeferredProfile()
      */
     static ICC_Profile getDeferredInstance(ProfileDeferralInfo pdi) {
         if (!ProfileDeferralMgr.deferring) {
diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/color/package-info.java
new file mode 100644
index 0000000..ea9d72f
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/color/package-info.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes for color spaces. It contains an implementation of a color
+ * space based on the International Color Consortium (ICC) Profile Format
+ * Specification, Version 3.4, August 15, 1997. It also contains color profiles
+ * based on the ICC Profile Format Specification.
+ *
+ * @since 1.2
+ */
+package java.awt.color;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/package.html b/jdk/src/java.desktop/share/classes/java/awt/color/package.html
deleted file mode 100644
index 41fa95a..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/color/package.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides classes for color spaces.  It contains an
-implementation of a color space based on the International Color
-Consortium (ICC) Profile Format Specification, Version 3.4, August 15,
-1997.  It also contains color profiles based on the ICC Profile Format
-Specification.
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.2
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/AppForegroundEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/AppForegroundEvent.java
index 9d7107b..d5442b5 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/AppForegroundEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/AppForegroundEvent.java
@@ -30,8 +30,8 @@
  * Event sent when the application has become the foreground app, and when it is
  * no longer the foreground app.
  *
- * @see AppForegroundListener#appRaisedToForeground(AppEvent.AppForegroundEvent)
- * @see AppForegroundListener#appMovedToBackground(AppEvent.AppForegroundEvent)
+ * @see AppForegroundListener#appRaisedToForeground(AppForegroundEvent)
+ * @see AppForegroundListener#appMovedToBackground(AppForegroundEvent)
  *
  * @since 9
  */
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/AppHiddenEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/AppHiddenEvent.java
index 1a41cc2..39ac364 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/AppHiddenEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/AppHiddenEvent.java
@@ -29,8 +29,8 @@
 /**
  * Event sent when the application has been hidden or shown.
  *
- * @see AppHiddenListener#appHidden(AppEvent.AppHiddenEvent)
- * @see AppHiddenListener#appUnhidden(AppEvent.AppHiddenEvent)
+ * @see AppHiddenListener#appHidden(AppHiddenEvent)
+ * @see AppHiddenListener#appUnhidden(AppHiddenEvent)
  *
  * @since 9
  */
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/AppReopenedEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/AppReopenedEvent.java
index 2e7f9f1..526cd87 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/AppReopenedEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/AppReopenedEvent.java
@@ -29,7 +29,7 @@
 /**
  * Event sent when the application is asked to re-open itself.
  *
- * @see AppReopenedListener#appReopened(AppEvent.AppReopenedEvent)
+ * @see AppReopenedListener#appReopened(AppReopenedEvent)
  *
  * @since 9
  */
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java
index aa9b8aa..5989a1b 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/FilesEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,6 @@
     /**
      * Constructs a {@code FilesEvent}
      * @param files files
-     * @param searchTerm searchTerm
      */
     FilesEvent(final List<File> files) {
         this.files = files;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/OpenURIEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/OpenURIEvent.java
index 61b0aae..d29ce26 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/OpenURIEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/OpenURIEvent.java
@@ -31,7 +31,7 @@
 /**
  * Event sent when the app is asked to open a {@code URI}.
  *
- * @see OpenURIHandler#openURI(AppEvent.OpenURIEvent)
+ * @see OpenURIHandler#openURI(OpenURIEvent)
  *
  * @since 9
  */
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/PrintFilesEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/PrintFilesEvent.java
index 0ec9d00..c3e5a46 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/PrintFilesEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/PrintFilesEvent.java
@@ -33,7 +33,7 @@
 /**
  * Event sent when the app is asked to print a list of files.
  *
- * @see PrintFilesHandler#printFiles(AppEvent.PrintFilesEvent)
+ * @see PrintFilesHandler#printFiles(PrintFilesEvent)
  * @since 9
  */
 public final class PrintFilesEvent extends FilesEvent {
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/QuitEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/QuitEvent.java
index ea9f4b4..c0e1bd4 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/QuitEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/QuitEvent.java
@@ -28,7 +28,7 @@
 /**
  * Event sent when the application is asked to quit.
  *
- * @see QuitHandler#handleQuitRequestWith(AppEvent.QuitEvent, QuitResponse)
+ * @see QuitHandler#handleQuitRequestWith(QuitEvent, QuitResponse)
  *
  * @since 9
  */
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/ScreenSleepEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/ScreenSleepEvent.java
index 8801878..3f6505c 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/ScreenSleepEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/ScreenSleepEvent.java
@@ -28,8 +28,8 @@
  * Event sent when the displays attached to the system enter and exit power save
  * sleep.
  *
- * @see ScreenSleepListener#screenAboutToSleep(AppEvent.ScreenSleepEvent)
- * @see ScreenSleepListener#screenAwoke(AppEvent.ScreenSleepEvent)
+ * @see ScreenSleepListener#screenAboutToSleep(ScreenSleepEvent)
+ * @see ScreenSleepListener#screenAwoke(ScreenSleepEvent)
  *
  * @since 9
  */
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/SystemSleepEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/SystemSleepEvent.java
index b9fab3b..b38b76d 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/SystemSleepEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/SystemSleepEvent.java
@@ -28,8 +28,8 @@
 /**
  * Event sent when the system enters and exits power save sleep.
  *
- * @see SystemSleepListener#systemAboutToSleep(AppEvent.SystemSleepEvent)
- * @see SystemSleepListener#systemAwoke(AppEvent.SystemSleepEvent)
+ * @see SystemSleepListener#systemAboutToSleep(SystemSleepEvent)
+ * @see SystemSleepListener#systemAwoke(SystemSleepEvent)
  *
  * @since 9
  */
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/UserSessionEvent.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/UserSessionEvent.java
index 5daca85..aaf1cea 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/UserSessionEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/UserSessionEvent.java
@@ -29,8 +29,8 @@
  *
  * Some systems may provide a reason of a user session change.
  *
- * @see UserSessionListener#userSessionActivated(AppEvent.UserSessionEvent)
- * @see UserSessionListener#userSessionDeactivated(AppEvent.UserSessionEvent)
+ * @see UserSessionListener#userSessionActivated(UserSessionEvent)
+ * @see UserSessionListener#userSessionDeactivated(UserSessionEvent)
  *
  * @since 9
  */
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/desktop/package-info.java
new file mode 100644
index 0000000..7f74a1f
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/desktop/package-info.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides interfaces and classes for interaction with various desktop
+ * capabilities.
+ *
+ * @since 9
+ */
+package java.awt.desktop;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/desktop/package.html b/jdk/src/java.desktop/share/classes/java/awt/desktop/package.html
deleted file mode 100644
index c0043f4..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/desktop/package.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
- Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides interfaces and classes for interaction with various 
-desktop capabilities.
-
-@since 9
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java
index b8d89d2..141603f 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java
@@ -281,6 +281,7 @@
      * The mouse modifiers have higher priority than overlaying key
      * modifiers.
      */
+    @SuppressWarnings("deprecation")
     private void setNewModifiers() {
         if ((gestureModifiers & InputEvent.BUTTON1_MASK) != 0) {
             gestureModifiers |= InputEvent.BUTTON1_DOWN_MASK;
@@ -305,6 +306,7 @@
     /**
      * Sets old modifiers by the new ones.
      */
+    @SuppressWarnings("deprecation")
     private void setOldModifiers() {
         if ((gestureModifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
             gestureModifiers |= InputEvent.BUTTON1_MASK;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/package-info.java
new file mode 100644
index 0000000..c9561de
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/package-info.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Drag and Drop is a direct manipulation gesture found in many Graphical User
+ * Interface systems that provides a mechanism to transfer information between
+ * two entities logically associated with presentation elements in the GUI.
+ * Normally driven by a physical gesture of a human user using an appropriate
+ * input device, Drag and Drop provides both a mechanism to enable continuous
+ * feedback regarding the possible outcome of any subsequent data transfer to
+ * the user during navigation over the presentation elements in the GUI, and the
+ * facilities to provide for any subsequent data negotiation and transfer.
+ * <p>
+ * This package defines the classes and interfaces necessary to perform Drag and
+ * Drop operations in Java. It defines classes for the drag-source and the
+ * drop-target, as well as events for transferring the data being dragged. This
+ * package also provides a means for giving visual feedback to the user
+ * throughout the duration of the Drag and Drop operation.
+ * <p>
+ * A typical Drag and Drop operation can be decomposed into the following states
+ * (not entirely sequentially):
+ * <ul>
+ *     <li>A {@code DragSource} comes into existence, associated with some
+ *     presentation element ({@code Component}) in the GUI, to initiate a Drag
+ *     and Drop of some potentially {@code Transferable} data.</li>
+ *     <li>1 or more {@code DropTarget}(s) come into/go out of existence,
+ *     associated with presentation elements in the GUI (Components),
+ *     potentially capable of consuming {@code Transferable} data types.</li>
+ *     <li>A {@code DragGestureRecognizer} is obtained from the
+ *     {@code DragSource} and is associated with a {@code Component} in order to
+ *     track and identify any Drag initiating gesture by the user over the
+ *     {@code Component}.</li>
+ *     <li>A user makes a Drag gesture over the {@code Component}, which the
+ *     registered {@code DragGestureRecognizer} detects, and notifies its
+ *     {@code DragGestureListener} of.
+ *     <p>
+ *     Note: Although this API consistently refers to the stimulus for a drag
+ *     and drop operation being a physical gesture by a human user, this does
+ *     not preclude a programmatically driven DnD operation given the
+ *     appropriate implementation of a {@code DragSource}. This package
+ *     contains the abstract class {@code MouseDragGestureRecognizer} for
+ *     recognizing mouse device gestures. Other abstract subclasses may be
+ *     provided by the platform to support other input devices or particular
+ *     {@code Component} class semantics.</li>
+ *     <li>The {@code DragGestureListener} causes the {@code DragSource} to
+ *     initiate the Drag and Drop operation on behalf of the user, perhaps
+ *     animating the GUI Cursor and/or rendering an {@code Image} of the item(s)
+ *     that are the subject of the operation.</li>
+ *     <li>As the user gestures navigate over {@code Component}(s) in the GUI
+ *     with associated {@code DropTarget}(s), the {@code DragSource} receives
+ *     notifications in order to provide "Drag Over" feedback effects, and the
+ *     {@code DropTarget}(s) receive notifications in order to provide
+ *     "Drag Under" feedback effects based upon the operation(s) supported and
+ *     the data type(s) involved.</li>
+ * </ul>
+ * <p>
+ * The gesture itself moves a logical cursor across the GUI hierarchy,
+ * intersecting the geometry of GUI Component(s), possibly resulting in the
+ * logical "Drag" cursor entering, crossing, and subsequently leaving
+ * {@code Component}(s) and associated {@code DropTarget}(s).
+ * <p>
+ * The {@code DragSource} object manifests "Drag Over" feedback to the user, in
+ * the typical case by animating the GUI {@code Cursor} associated with the
+ * logical cursor.
+ * <p>
+ * {@code DropTarget} objects manifest "Drag Under" feedback to the user, in the
+ * typical case, by rendering animations into their associated GUI
+ * {@code Component}(s) under the GUI Cursor.
+ * <p>
+ * The determination of the feedback effects, and the ultimate success or
+ * failure of the data transfer, should one occur, is parameterized as follows:
+ * <ul>
+ *     <li>By the transfer "operation" selected by the user, and supported by
+ *     both the {@code DragSource} and {@code DropTarget}: Copy, Move or
+ *     Reference(link).</li>
+ *     <li>By the intersection of the set of data types provided by the
+ *     {@code DragSource} and the set of data types comprehensible by the
+ *     {@code DropTarget}.</li>
+ *     <li>When the user terminates the drag operation, normally resulting in a
+ *     successful Drop, both the {@code DragSource} and {@code DropTarget}
+ *     receive notifications that include, and result in the type negotiation
+ *     and transfer of, the information associated with the {@code DragSource}
+ *     via a {@code Transferable} object.</li>
+ * </ul>
+ *
+ * @since 1.2
+ */
+package java.awt.dnd;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/package.html b/jdk/src/java.desktop/share/classes/java/awt/dnd/package.html
deleted file mode 100644
index 4673485..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/dnd/package.html
+++ /dev/null
@@ -1,146 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Drag and Drop is a direct manipulation gesture found in many Graphical
-User Interface systems that provides a mechanism to transfer
-information between two entities logically associated with presentation
-elements in the GUI. Normally driven by a physical gesture of a
-human user using an appropriate input device, Drag and Drop provides both
-a mechanism to enable continuous feedback regarding the
-possible outcome of any subsequent data transfer to the user during
-navigation over the presentation elements in the GUI, and the facilities
-to provide for any subsequent data negotiation and transfer. 
-<P>
-This package defines the classes and interfaces necessary to perform Drag
-and Drop operations in Java. It
-defines classes for the drag-source and the drop-target, as well as
-events for transferring the data being dragged. This package also provides
-a means for giving visual feedback to the user throughout the
-duration of the Drag and Drop operation. 
-<P>
-A typical Drag and Drop operation can be decomposed into the following
-states (not entirely sequentially): 
-<UL>
-<LI>A <code>DragSource</code> comes into existence, 
-associated with some presentation
-element (<code>Component</code>) in the GUI, to initiate a Drag and Drop of
-some potentially <code>Transferable</code> data. 
-<br><br>
-<LI>1 or more <code>DropTarget</code>(s) come into/go out of 
-existence, associated
-with presentation elements in the GUI (Components), potentially
-capable of consuming <code>Transferable</code> data types. 
-<br><br>
-<LI> A <code>DragGestureRecognizer</code> is 
-obtained from the <code>DragSource</code> and is
-associated with a <code>Component</code> in order 
-to track and identify any Drag
-initiating gesture by the user over the <code>Component</code>. 
-<br><br>
-<LI> A user makes a Drag gesture over the <code>Component</code>, 
-which the registered
-<code>DragGestureRecognizer</code> detects, and notifies its
-<code>DragGestureListener</code> of. 
-<P>
-Note: Although this API consistently refers to the stimulus for a
-drag and drop operation being a physical gesture by a human user, this
-does not preclude a programmatically driven DnD operation given the
-appropriate implementation of a <code>DragSource</code>. This package
-contains the abstract class <code>MouseDragGestureRecognizer</code> for
-recognizing mouse device gestures. Other abstract subclasses may be
-provided by the platform to support other input devices or
-particular <code>Component</code> class semantics. 
-<br><br>
-<LI> The <code>DragGestureListener</code> causes the 
-<code>DragSource</code> to initiate the Drag
-and Drop operation on behalf of the user, perhaps animating the
-GUI Cursor and/or rendering an <code>Image</code> of the item(s) that are the
-subject of the operation.
-<br><br>
-<LI> As the user gestures navigate over <code>Component</code>(s) 
-in the GUI with
-associated <code>DropTarget</code>(s), the <code>DragSource</code> 
-receives notifications in order
-to provide "Drag Over" feedback effects, and the <code>DropTarget</code>(s)
-receive notifications in order to provide "Drag Under" feedback effects
-based upon the operation(s) supported and the data type(s) involved. 
-</UL>
-<P>
-
-The gesture itself moves a logical cursor across the GUI hierarchy,
-intersecting the geometry of GUI Component(s), possibly resulting in
-the logical "Drag" cursor entering, crossing, and subsequently
-leaving <code>Component</code>(s) and associated <code>DropTarget</code>(s). 
-<P>
-The <code>DragSource</code> object manifests "Drag Over" feedback to the user, in the typical case by animating the GUI <code>Cursor</code> associated with the
-logical cursor. 
-<P>
-<code>DropTarget</code> objects manifest "Drag Under" feedback to the user, in
-the typical case, by rendering animations into their associated GUI
-<code>Component</code>(s) under the GUI Cursor. 
-<P>
-The determination of the feedback effects, and the ultimate success
-or failure of the data transfer, should one occur, is parameterized
-as follows: 
-<UL>
-<LI> By the transfer "operation" selected by the user, and supported by
-both the <code>DragSource</code> and <code>DropTarget</code>: Copy, Move or Reference(link). 
-<br><br>
-<LI> By the intersection of the set of data types provided by the
-<code>DragSource</code> and the set of data types comprehensible by the 
-<code>DropTarget</code>. 
-<br><br>
-<LI>When the user terminates the drag operation, normally resulting in a
-successful Drop, both the <code>DragSource</code> and <code>DropTarget</code>
-receive
-notifications that include, and result in the type negotiation and
-transfer of, the information associated with the <code>DragSource</code> via a
-<code>Transferable</code> object. 
-</UL>
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.2
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/peer/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/peer/package-info.java
new file mode 100644
index 0000000..8505e24
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/peer/package-info.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides for interfacing with the underlying window system in order to access
+ * its platform-dependent drag-and-drop facilities. This package is only used by
+ * AWT toolkit developers.
+ *
+ * @since 1.2
+ */
+package java.awt.dnd.peer;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/peer/package.html b/jdk/src/java.desktop/share/classes/java/awt/dnd/peer/package.html
deleted file mode 100644
index 6c83292..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/dnd/peer/package.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!--
- Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<body bgcolor="white">
-
-Provides for interfacing with the underlying window system
-in order to access its platform-dependent drag-and-drop facilities.
-This package is only used by AWT toolkit developers.
-
-
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
-
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java
index 6ce7955..3d42245 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java
@@ -26,7 +26,6 @@
 package java.awt.event;
 
 import java.awt.AWTEvent;
-import java.awt.Event;
 import java.lang.annotation.Native;
 
 /**
@@ -63,25 +62,25 @@
      * The shift modifier. An indicator that the shift key was held
      * down during the event.
      */
-    public static final int SHIFT_MASK          = Event.SHIFT_MASK;
+    public static final int SHIFT_MASK = 1 << 0;
 
     /**
      * The control modifier. An indicator that the control key was held
      * down during the event.
      */
-    public static final int CTRL_MASK           = Event.CTRL_MASK;
+    public static final int CTRL_MASK = 1 << 1;
 
     /**
      * The meta modifier. An indicator that the meta key was held
      * down during the event.
      */
-    public static final int META_MASK           = Event.META_MASK;
+    public static final int META_MASK = 1 << 2;
 
     /**
      * The alt modifier. An indicator that the alt key was held
      * down during the event.
      */
-    public static final int ALT_MASK            = Event.ALT_MASK;
+    public static final int ALT_MASK = 1 << 3;
 
 
     /**
@@ -274,6 +273,7 @@
      *
      * @return a string identifying the event and its associated command
      */
+    @SuppressWarnings("deprecation")
     public String paramString() {
         String typeStr;
         switch(id) {
diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java
index ec9bd0b..09a08a0 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,51 +62,76 @@
 
     /**
      * The Shift key modifier constant.
-     * It is recommended that SHIFT_DOWN_MASK be used instead.
+     *
+     * @deprecated It is recommended that SHIFT_DOWN_MASK and
+     *             {@link #getModifiersEx()} be used instead
      */
+    @Deprecated(since = "9")
     public static final int SHIFT_MASK = Event.SHIFT_MASK;
 
     /**
      * The Control key modifier constant.
-     * It is recommended that CTRL_DOWN_MASK be used instead.
+     *
+     * @deprecated It is recommended that CTRL_DOWN_MASK and
+     *             {@link #getModifiersEx()} be used instead
      */
+    @Deprecated(since = "9")
     public static final int CTRL_MASK = Event.CTRL_MASK;
 
     /**
      * The Meta key modifier constant.
-     * It is recommended that META_DOWN_MASK be used instead.
+     *
+     * @deprecated It is recommended that META_DOWN_MASK and
+     *             {@link #getModifiersEx()} be used instead
      */
+    @Deprecated(since = "9")
     public static final int META_MASK = Event.META_MASK;
 
     /**
      * The Alt key modifier constant.
-     * It is recommended that ALT_DOWN_MASK be used instead.
+     *
+     * @deprecated It is recommended that ALT_DOWN_MASK and
+     *             {@link #getModifiersEx()} be used instead
      */
+    @Deprecated(since = "9")
     public static final int ALT_MASK = Event.ALT_MASK;
 
     /**
      * The AltGraph key modifier constant.
+     *
+     * @deprecated It is recommended that ALT_GRAPH_DOWN_MASK and
+     *             {@link #getModifiersEx()} be used instead
      */
+    @Deprecated(since = "9")
     public static final int ALT_GRAPH_MASK = 1 << 5;
 
     /**
      * The Mouse Button1 modifier constant.
-     * It is recommended that BUTTON1_DOWN_MASK be used instead.
+     *
+     * @deprecated It is recommended that BUTTON1_DOWN_MASK and
+     *             {@link #getModifiersEx()} be used instead
      */
+    @Deprecated(since = "9")
     public static final int BUTTON1_MASK = 1 << 4;
 
     /**
      * The Mouse Button2 modifier constant.
-     * It is recommended that BUTTON2_DOWN_MASK be used instead.
-     * Note that BUTTON2_MASK has the same value as ALT_MASK.
+     *
+     * @deprecated It is recommended that BUTTON2_DOWN_MASK and
+     *             {@link #getModifiersEx()} be used instead. Note that
+     *             BUTTON2_MASK has the same value as ALT_MASK.
      */
+    @Deprecated(since = "9")
     public static final int BUTTON2_MASK = Event.ALT_MASK;
 
     /**
      * The Mouse Button3 modifier constant.
-     * It is recommended that BUTTON3_DOWN_MASK be used instead.
-     * Note that BUTTON3_MASK has the same value as META_MASK.
+     *
+     * @deprecated It is recommended that BUTTON3_DOWN_MASK and
+     *             {@link #getModifiersEx()} be used instead. Note that
+     *             BUTTON3_MASK has the same value as META_MASK.
      */
+    @Deprecated(since = "9")
     public static final int BUTTON3_MASK = Event.META_MASK;
 
     /**
@@ -159,7 +184,7 @@
 
     /**
      * An array of extended modifiers for additional buttons.
-     * @see getButtonDownMasks
+     * @see #getButtonDownMasks()
      * There are twenty buttons fit into 4byte space.
      * one more bit is reserved for FIRST_HIGH_BIT.
      * @since 1.7
@@ -382,7 +407,7 @@
      * @return whether or not the Shift modifier is down on this event
      */
     public boolean isShiftDown() {
-        return (modifiers & SHIFT_MASK) != 0;
+        return (modifiers & SHIFT_DOWN_MASK) != 0;
     }
 
     /**
@@ -390,7 +415,7 @@
      * @return whether or not the Control modifier is down on this event
      */
     public boolean isControlDown() {
-        return (modifiers & CTRL_MASK) != 0;
+        return (modifiers & CTRL_DOWN_MASK) != 0;
     }
 
     /**
@@ -398,7 +423,7 @@
      * @return whether or not the Meta modifier is down on this event
      */
     public boolean isMetaDown() {
-        return (modifiers & META_MASK) != 0;
+        return (modifiers & META_DOWN_MASK) != 0;
     }
 
     /**
@@ -406,7 +431,7 @@
      * @return whether or not the Alt modifier is down on this event
      */
     public boolean isAltDown() {
-        return (modifiers & ALT_MASK) != 0;
+        return (modifiers & ALT_DOWN_MASK) != 0;
     }
 
     /**
@@ -414,7 +439,7 @@
      * @return whether or not the AltGraph modifier is down on this event
      */
     public boolean isAltGraphDown() {
-        return (modifiers & ALT_GRAPH_MASK) != 0;
+        return (modifiers & ALT_GRAPH_DOWN_MASK) != 0;
     }
 
     /**
@@ -428,8 +453,12 @@
 
     /**
      * Returns the modifier mask for this event.
+     *
      * @return the modifier mask for this event
+     * @deprecated It is recommended that extended modifier keys and
+     *             {@link #getModifiersEx()} be used instead
      */
+    @Deprecated(since = "9")
     public int getModifiers() {
         return modifiers & (JDK_1_3_MODIFIERS | HIGH_MODIFIERS);
     }
diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java
index 0ca378d..2c02890 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java
@@ -1169,6 +1169,7 @@
      * @see #getKeyLocation()
      * @since 1.4
      */
+    @SuppressWarnings("deprecation")
     public KeyEvent(Component source, int id, long when, int modifiers,
                     int keyCode, char keyChar, int keyLocation) {
         super(source, id, when, modifiers);
@@ -1561,7 +1562,10 @@
      * @return string a text description of the combination of modifier
      *                keys that were held down during the event
      * @see InputEvent#getModifiersExText(int)
+     * @deprecated It is recommended that extended modifier keys and
+     *             {@link InputEvent#getModifiersExText(int)} be used instead
      */
+    @Deprecated(since = "9")
     public static String getKeyModifiersText(int modifiers) {
         StringBuilder buf = new StringBuilder();
         if ((modifiers & InputEvent.META_MASK) != 0) {
@@ -1696,6 +1700,7 @@
      *
      * @return a string identifying the event and its attributes
      */
+    @SuppressWarnings("deprecation")
     public String paramString() {
         StringBuilder str = new StringBuilder(100);
 
@@ -1821,6 +1826,7 @@
      * Sets new modifiers by the old ones. The key modifiers
      * override overlapping mouse modifiers.
      */
+    @SuppressWarnings("deprecation")
     private void setNewModifiers() {
         if ((modifiers & SHIFT_MASK) != 0) {
             modifiers |= SHIFT_DOWN_MASK;
@@ -1845,6 +1851,7 @@
     /**
      * Sets old modifiers by the new ones.
      */
+    @SuppressWarnings("deprecation")
     private void setOldModifiers() {
         if ((modifiers & SHIFT_DOWN_MASK) != 0) {
             modifiers |= SHIFT_MASK;
@@ -1871,6 +1878,7 @@
      * override overlapping mouse modifiers.
      * @serial
      */
+    @SuppressWarnings("deprecation")
     private void readObject(ObjectInputStream s)
       throws IOException, ClassNotFoundException {
         s.defaultReadObject();
diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java
index 2ae987b..a4e1668 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java
@@ -733,6 +733,7 @@
      * @see InputEvent#getMaskForButton(int)
      * @since 1.6
      */
+    @SuppressWarnings("deprecation")
     public MouseEvent(Component source, int id, long when, int modifiers,
                       int x, int y, int xAbs, int yAbs,
                       int clickCount, boolean popupTrigger, int button)
@@ -943,6 +944,7 @@
      * @see InputEvent#getModifiersExText(int)
      * @since 1.4
      */
+    @SuppressWarnings("deprecation")
     public static String getMouseModifiersText(int modifiers) {
         StringBuilder buf = new StringBuilder();
         if ((modifiers & InputEvent.ALT_MASK) != 0) {
@@ -1007,6 +1009,7 @@
      *
      * @return a string identifying the event and its attributes
      */
+    @SuppressWarnings("deprecation")
     public String paramString() {
         StringBuilder str = new StringBuilder(80);
 
@@ -1066,6 +1069,7 @@
      * Sets new modifiers by the old ones.
      * Also sets button.
      */
+    @SuppressWarnings("deprecation")
     private void setNewModifiers() {
         if ((modifiers & BUTTON1_MASK) != 0) {
             modifiers |= BUTTON1_DOWN_MASK;
@@ -1120,6 +1124,7 @@
     /**
      * Sets old modifiers by the new ones.
      */
+    @SuppressWarnings("deprecation")
     private void setOldModifiers() {
         if (id == MOUSE_PRESSED
             || id == MOUSE_RELEASED
@@ -1168,6 +1173,7 @@
      * Sets new modifiers by the old ones.
      * @serial
      */
+    @SuppressWarnings("deprecation")
     private void readObject(ObjectInputStream s)
       throws IOException, ClassNotFoundException {
         s.defaultReadObject();
diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/event/package-info.java
new file mode 100644
index 0000000..c4dc383
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/event/package-info.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides interfaces and classes for dealing with different types of events
+ * fired by AWT components. See the {@link java.awt.AWTEvent java.awt.AWTEvent}
+ * class for details on the AWT event model. Events are fired by event sources.
+ * An event listener registers with an event source to receive notifications
+ * about the events of a particular type. This package defines events and event
+ * listeners, as well as event listener adapters, which are convenience classes
+ * to make easier the process of writing event listeners.
+ *
+ * @since 1.1
+ */
+package java.awt.event;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/package.html b/jdk/src/java.desktop/share/classes/java/awt/event/package.html
deleted file mode 100644
index 0e2ae75..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/event/package.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides interfaces and classes for dealing with different
-types of events fired by AWT components. See the java.awt.AWTEvent
-class for details on the AWT event model.  Events are fired by event
-sources.  An event listener registers with an event source to receive
-notifications about the events of a particular type.  This package
-defines events and event listeners, as well as event listener
-adapters, which are convenience classes to make easier the process of
-writing event listeners.
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.1
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/font/CharArrayIterator.java b/jdk/src/java.desktop/share/classes/java/awt/font/CharArrayIterator.java
index 5c35bea..c7a00bd 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/font/CharArrayIterator.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/font/CharArrayIterator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
      * Sets the position to getBeginIndex() and returns the character at that
      * position.
      * @return the first character in the text, or DONE if the text is empty
-     * @see getBeginIndex
+     * @see #getBeginIndex
      */
     public char first() {
 
@@ -59,7 +59,7 @@
      * Sets the position to getEndIndex()-1 (getEndIndex() if the text is empty)
      * and returns the character at that position.
      * @return the last character in the text, or DONE if the text is empty
-     * @see getEndIndex
+     * @see #getEndIndex
      */
     public char last() {
 
@@ -76,7 +76,7 @@
      * Gets the character at the current position (as returned by getIndex()).
      * @return the character at the current position or DONE if the current
      * position is off the end of the text.
-     * @see getIndex
+     * @see #getIndex
      */
     public char current() {
 
diff --git a/jdk/src/java.desktop/share/classes/java/awt/font/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/font/package-info.java
new file mode 100644
index 0000000..6cdcd3d
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/font/package-info.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interface relating to fonts. It contains support for
+ * representing Type 1, Type 1 Multiple Master fonts, OpenType fonts, and
+ * TrueType fonts.
+ *
+ * @since 1.2
+ */
+package java.awt.font;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/font/package.html b/jdk/src/java.desktop/share/classes/java/awt/font/package.html
deleted file mode 100644
index 22e71ba..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/font/package.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides classes and interface relating to fonts.  It
-contains support for representing Type 1, Type 1 Multiple Master
-fonts, OpenType fonts, and TrueType fonts.
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.2
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/geom/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/geom/package-info.java
new file mode 100644
index 0000000..2ef69ba
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/geom/package-info.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides the Java 2D classes for defining and performing operations on
+ * objects related to two-dimensional geometry. Some important features of the
+ * package include:
+ * <ul>
+ *     <li>classes for manipulating geometry, such as AffineTransform and the
+ *     PathIterator interface which is implemented by all Shape objects.</li>
+ *     <li>classes that implement the Shape interface, such as CubicCurve2D,
+ *     Ellipse2D, Line2D, Rectangle2D, and GeneralShape.</li>
+ *     <li>the Area class which provides mechanisms for add (union), subtract,
+ *     intersect, and exclusiveOR operations on other Shape objects.</li>
+ * </ul>
+ *
+ * @since 1.2
+ */
+package java.awt.geom;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/geom/package.html b/jdk/src/java.desktop/share/classes/java/awt/geom/package.html
deleted file mode 100644
index de8b62c..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/geom/package.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides the Java 2D classes for defining and performing operations
-on objects related to two-dimensional geometry.  Some important features
-of the package include:
-<ul>
-<li>classes for manipulating geometry, such as AffineTransform and
-the PathIterator interface which is implemented by all Shape objects.
-
-<li>classes that implement the Shape interface, such as
-CubicCurve2D, Ellipse2D, Line2D, Rectangle2D, and GeneralShape.
-
-<li>the Area class which provides mechanisms for add (union), subtract,
-intersect, and exclusiveOR operations on other Shape objects.
-</ul>
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.2
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/im/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/im/package-info.java
new file mode 100644
index 0000000..59da280
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/im/package-info.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interfaces for the input method framework. This package
+ * enables text editing components to receive text input through input methods.
+ * Input methods are software components that let the user enter text in ways
+ * other than simple typing on a keyboard. They are commonly used to enter
+ * Japanese, Chinese, or Korean - languages using thousands of different
+ * characters - on keyboards with far fewer keys. However, the framework also
+ * supports input methods for other languages and the use of entirely different
+ * input mechanisms, such as handwriting or speech recognition.
+ *
+ * <h2>Package Specification</h2>
+ * <ul>
+ *     <li><a href="{@docRoot}/../technotes/guides/imf/spec.html">
+ *         Input Method Framework Specification</a></li>
+ *     <li><a href="{@docRoot}/../technotes/guides/imf/api-reference.html">
+ *         Input Method Client API Reference</a></li>
+ * </ul>
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, guides, and tool documentation, please
+ * see:
+ * <ul>
+ *     <li><a href="{@docRoot}/../technotes/guides/imf/overview.html">
+ *         Input Method Framework Overview</a></li>
+ *     <li><a href="{@docRoot}/../technotes/guides/imf/api-tutorial.html">
+ *         Input Method Client API Tutorial</a></li>
+ * </ul>
+ *
+ * @since 1.2
+ */
+package java.awt.im;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/im/package.html b/jdk/src/java.desktop/share/classes/java/awt/im/package.html
deleted file mode 100644
index 552ca18..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/im/package.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!--
- Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<HTML>
-<HEAD>
-   <META NAME=GENERATOR CONTENT="Claris Home Page 2.0">
-   <X-SAS-WINDOW TOP=42 BOTTOM=589 LEFT=4 RIGHT=534>
-</HEAD>
-<BODY BGCOLOR="#FFFFFF">
-
-<P>Provides classes and interfaces for the input method framework.
-This package enables text editing components to receive text input
-through input methods. Input methods are software components that let
-the user enter text in ways other than simple typing on a keyboard.
-They are commonly used to enter Japanese, Chinese, or Korean -
-languages using thousands of different characters - on keyboards with
-far fewer keys. However, the framework also supports input methods
-for other languages and the use of entirely different input
-mechanisms, such as handwriting or speech recognition.</P>
-
-<H2>Package Specification</H2>
-
-<UL>
-   <LI><B><A HREF="{@docRoot}/../technotes/guides/imf/spec.html">Input Method
-   Framework Specification</A></B>
-   
-   <LI><B><A HREF="{@docRoot}/../technotes/guides/imf/api-reference.html">Input
-   Method Client API Reference</A></B>
-</UL>
-
-<H2>Related Documentation</H2>
-
-<P>For overviews, tutorials, examples, guides, and tool
-documentation, please see:</P>
-
-<UL>
-   <LI><B><A HREF="{@docRoot}/../technotes/guides/imf/overview.html">Input Method
-   Framework Overview</A></B>
-   
-   <LI><B><A HREF="{@docRoot}/../technotes/guides/imf/api-tutorial.html">Input
-   Method Client API Tutorial</A></B>
-</UL>
-
-@since 1.2
-</BODY>
-</HTML>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/im/spi/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/im/spi/package-info.java
new file mode 100644
index 0000000..c6badd2
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/im/spi/package-info.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides interfaces that enable the development of input methods that can be
+ * used with any Java runtime environment. Input methods are software components
+ * that let the user enter text in ways other than simple typing on a keyboard.
+ * They are commonly used to enter Japanese, Chinese, or Korean - languages
+ * using thousands of different characters - on keyboards with far fewer keys.
+ * However, this package also allows the development of input methods for other
+ * languages and the use of entirely different input mechanisms, such as
+ * handwriting recognition.
+ *
+ * <h2><a name="package_specification"></a>Package Specification</h2>
+ * <ul>
+ *     <li><a href="../../../../../technotes/guides/imf/spec.html">
+ *         Input Method Framework Specification</a></li>
+ *     <li><a href="../../../../../technotes/guides/imf/spi-reference.html">
+ *         Input Method Engine SPI Reference</a></li>
+ * </ul>
+ *
+ * <h2><a name="Packaging"></a>Packaging Input Methods</h2>
+ * Input methods can be made available by adding them to the application's class
+ * path. The main JAR file of an input method must contain the file:
+ * <pre>
+ *     META-INF/services/java.awt.im.spi.InputMethodDescriptor
+ * </pre>
+ * The file should contain a list of fully-qualified class names, one per line,
+ * of classes implementing the {@code java.awt.im.spi.InputMethodDescriptor}
+ * interface. Space and tab characters surrounding each name, as well as blank
+ * lines, are ignored. The comment character is {@code '#'}
+ * ({@code \u005Cu0023}); on each line all characters following the first
+ * comment character are ignored. The file must be encoded in UTF-8.
+ * <p>
+ * For example, if the fully-qualified name of the class that implements
+ * {@code java.awt.im.spi.InputMethodDesciptor} for the <em>Foo</em> input
+ * method is {@code com.sun.ime.FooInputMethodDescriptor}, the file
+ * {@code META-INF/services/java.awt.im.spi.InputMethodDescriptor}
+ * contains a line:
+ * <pre>
+ *     com.sun.ime.FooInputMethodDescriptor
+ * </pre>
+ * The input method must also provide at least two classes: one class
+ * implementing the {@code java.awt.im.spi.InputMethodDescriptor} interface, one
+ * class implementing the {@code java.awt.im.spi.InputMethod} interface. The
+ * input method should separate the implementations for these interfaces, so
+ * that loading of the class implementing {@code InputMethod} can be deferred
+ * until actually needed.
+ *
+ * <h2><a name="Loading"></a>Loading Input Methods</h2>
+ * The input method framework will usually defer loading of input  method
+ * classes until they are absolutely needed. It loads only the
+ * {@code InputMethodDescriptor} implementations during AWT initialization. It
+ * loads an {@code InputMethod} implementation when the input method has been
+ * selected.
+ *
+ * <h2><a name="PeeredComponents"></a>Java Input Methods and Peered Text
+ * Components</h2>
+ * The Java input method framework intends to support all combinations of input
+ * methods (host input methods and Java input methods) and components (peered
+ * and lightweight). However, because of limitations in the underlying platform,
+ * it may not always be possible to enable the communication between Java input
+ * methods and peered AWT components. Support for this specific combination is
+ * therefore platform dependent. In Sun's Java SE Runtime Environments, this
+ * combination is supported on Windows, but not on Solaris.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, guides, and tool documentation, please
+ * see:
+ * <ul>
+ *     <li><a href="../../../../../technotes/guides/imf/overview.html">
+ *         Input Method Framework Overview</a></li>
+ *     <li><a href="../../../../../technotes/guides/imf/spi-tutorial.html">
+ *         Input Method Engine SPI Tutorial</a></li>
+ * </ul>
+ *
+ * @since 1.3
+ */
+package java.awt.im.spi;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/im/spi/package.html b/jdk/src/java.desktop/share/classes/java/awt/im/spi/package.html
deleted file mode 100644
index 2e63c92..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/im/spi/package.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<!--
- Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!--This file created 7/22/1999 11:47 by Claris Home Page version 2.0-->
-<HTML>
-<HEAD>
-   <TITLE>Package java.awt.im.spi Description</TITLE>
-   <META NAME=GENERATOR CONTENT="Claris Home Page 2.0">
-   <X-SAS-WINDOW TOP=51 BOTTOM=592 LEFT=171 RIGHT=701>
-</HEAD>
-<BODY BGCOLOR="#FFFFFF">
-
-<P>Provides interfaces that enable the development of input methods
-that can be used with any Java runtime environment. Input methods are
-software components that let the user enter text in ways other than
-simple typing on a keyboard. They are commonly used to enter
-Japanese, Chinese, or Korean - languages using thousands of different
-characters - on keyboards with far fewer keys. However, this package
-also allows the development of input methods for other languages and
-the use of entirely different input mechanisms, such as handwriting
-recognition.</P>
-
-<H2><A NAME="package_specification"></A>Package Specification</H2>
-
-<UL>
-   <LI><B><A HREF="../../../../../technotes/guides/imf/spec.html">Input Method
-   Framework Specification</A></B>
-   
-   <LI><B><A HREF="../../../../../technotes/guides/imf/spi-reference.html">Input
-   Method Engine SPI Reference</A></B>
-</UL>
-
-<H4><A NAME="Packaging"></A>Packaging Input Methods</H4>
-
-<P>Input methods can be made available by adding them to the application's
-class path. The main JAR file of an input method must contain the
-file:</P>
-
-<PRE>    META-INF/services/java.awt.im.spi.InputMethodDescriptor</PRE>
-
-<P>The file should contain a list of fully-qualified class names, one
-per line, of classes implementing the
-<CODE>java.awt.im.spi.InputMethodDescriptor</CODE> interface. Space
-and tab characters surrounding each name, as well as blank lines, are
-ignored. The comment character is <CODE>'#'</CODE>
-(<CODE>\u0023</CODE>); on each line all characters following the
-first comment character are ignored. The file must be encoded in
-UTF-8.</P>
-
-<P>For example, if the fully-qualified name of the class that
-implements <CODE>java.awt.im.spi.InputMethodDesciptor</CODE> for the
-<EM>Foo</EM> input method is
-<CODE>com.sun.ime.FooInputMethodDescriptor</CODE>, the file
-<CODE>META-INF/services/java.awt.im.spi.InputMethodDescriptor</CODE>
-contains a line:</P>
-
-<PRE>    com.sun.ime.FooInputMethodDescriptor</PRE>
-
-<P>The input method must also provide at least two classes: one class
-implementing the <CODE>java.awt.im.spi.InputMethodDescriptor</CODE>
-interface, one class implementing the
-<CODE>java.awt.im.spi.InputMethod</CODE> interface. The input method
-should separate the implementations for these interfaces, so that
-loading of the class implementing <CODE>InputMethod</CODE> can be
-deferred until actually needed.</P>
-
-<H4><A NAME="Loading"></A>Loading Input Methods</H4>
-
-<P>The input method framework will usually defer loading of input
-method classes until they are absolutely needed. It loads only the
-<CODE>InputMethodDescriptor</CODE> implementations during AWT
-initialization. It loads an <CODE>InputMethod</CODE> implementation
-when the input method has been selected.</P>
-
-<H4><A NAME="PeeredComponents"></A>Java Input Methods and Peered Text
-Components</H4>
-
-<P>The Java input method framework intends to support all
-combinations of input methods (host input methods and Java input
-methods) and components (peered and lightweight). However, because of
-limitations in the underlying platform, it may not always be possible
-to enable the communication between Java input methods and peered AWT
-components. Support for this specific combination is therefore
-platform dependent. In Sun's Java SE Runtime Environments, this
-combination is supported on Windows, but not on Solaris.</P>
-
-<H2>Related Documentation</H2>
-
-<P>For overviews, tutorials, examples, guides, and tool
-documentation, please see:</P>
-
-<UL>
-   <LI><B><A HREF="../../../../../technotes/guides/imf/overview.html">Input
-   Method Framework Overview</A></B>
-   
-   <LI><B><A HREF="../../../../../technotes/guides/imf/spi-tutorial.html">Input
-   Method Engine SPI Tutorial</A></B>
-</UL>
-
-@since 1.3
-</BODY>
-</HTML>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/ColorModel.java b/jdk/src/java.desktop/share/classes/java/awt/image/ColorModel.java
index 9c22632..2be7f7e 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/image/ColorModel.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/ColorModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,10 +31,10 @@
 import sun.java2d.cmm.CMSManager;
 import sun.java2d.cmm.ColorTransform;
 import sun.java2d.cmm.PCMM;
-import java.awt.Toolkit;
 import java.util.Collections;
 import java.util.Map;
 import java.util.WeakHashMap;
+import java.util.Arrays;
 
 /**
  * The {@code ColorModel} abstract class encapsulates the
@@ -362,7 +362,14 @@
             this.transparency         = transparency;
         }
 
-        nBits = bits.clone();
+        /*
+         * We need significant bits value only for the length
+         * of number of components, so we truncate remaining part.
+         * It also helps in hashCode calculation since bits[] can contain
+         * different values after the length of number of components between
+         * two ColorModels.
+         */
+        nBits = Arrays.copyOf(bits, numComponents);
         this.pixel_bits = pixel_bits;
         if (pixel_bits <= 0) {
             throw new IllegalArgumentException("Number of pixel bits must "+
@@ -1441,69 +1448,53 @@
     }
 
     /**
-     * Tests if the specified {@code Object} is an instance of
-     * {@code ColorModel} and if it equals this
-     * {@code ColorModel}.
-     * @param obj the {@code Object} to test for equality
-     * @return {@code true} if the specified {@code Object}
-     * is an instance of {@code ColorModel} and equals this
-     * {@code ColorModel}; {@code false} otherwise.
+     * This method simply delegates to the default implementation in {@code Object}
+     * which is identical to an {@code ==} test since this class cannot enforce the
+     * issues of a proper equality test among multiple independent subclass
+     * branches.
+     * Subclasses are encouraged to override this method and provide equality
+     * testing for their own properties in addition to equality tests for the
+     * following common base properties of {@code ColorModel}:
+     * <ul>
+     * <li>Support for alpha component.</li>
+     * <li>Is alpha premultiplied.</li>
+     * <li>Number of bits per pixel.</li>
+     * <li>Type of transparency like Opaque, Bitmask or Translucent.</li>
+     * <li>Number of components in a pixel.</li>
+     * <li>{@code ColorSpace} type.</li>
+     * <li>Type of the array used to represent pixel values.</li>
+     * <li>Number of significant bits per color and alpha component.</li>
+     * </ul>
+     * @param obj the reference object with which to compare.
+     * @return {@code true} if this object is the same as the obj
+     *         argument; {@code false} otherwise.
      */
+    @Override
     public boolean equals(Object obj) {
-        if (!(obj instanceof ColorModel)) {
-            return false;
-        }
-        ColorModel cm = (ColorModel) obj;
-
-        if (this == cm) {
-            return true;
-        }
-        if (supportsAlpha != cm.hasAlpha() ||
-            isAlphaPremultiplied != cm.isAlphaPremultiplied() ||
-            pixel_bits != cm.getPixelSize() ||
-            transparency != cm.getTransparency() ||
-            numComponents != cm.getNumComponents())
-        {
-            return false;
-        }
-
-        int[] nb = cm.getComponentSize();
-
-        if ((nBits != null) && (nb != null)) {
-            for (int i = 0; i < numComponents; i++) {
-                if (nBits[i] != nb[i]) {
-                    return false;
-                }
-            }
-        } else {
-            return ((nBits == null) && (nb == null));
-        }
-
-        return true;
+        return super.equals(obj);
     }
 
     /**
-     * Returns the hash code for this ColorModel.
-     *
-     * @return    a hash code for this ColorModel.
+     * This method simply delegates to the default implementation in {@code Object}
+     * which returns the system ID for the class.
+     * Subclasses are encouraged to override this method and provide a hash
+     * for their own properties in addition to hashing the values of the
+     * following common base properties of {@code ColorModel}:
+     * <ul>
+     * <li>Support for alpha component.</li>
+     * <li>Is alpha premultiplied.</li>
+     * <li>Number of bits per pixel.</li>
+     * <li>Type of transparency like Opaque, Bitmask or Translucent.</li>
+     * <li>Number of components in a pixel.</li>
+     * <li>{@code ColorSpace} type.</li>
+     * <li>Type of the array used to represent pixel values.</li>
+     * <li>Number of significant bits per color and alpha component.</li>
+     * </ul>
+     * @return a hash code value for this object.
      */
+    @Override
     public int hashCode() {
-
-        int result = 0;
-
-        result = (supportsAlpha ? 2 : 3) +
-                 (isAlphaPremultiplied ? 4 : 5) +
-                 pixel_bits * 6 +
-                 transparency * 7 +
-                 numComponents * 8;
-
-        if (nBits != null) {
-            for (int i = 0; i < numComponents; i++) {
-                result = result + nBits[i] * (i + 9);
-            }
-        }
-
-        return result;
+        return super.hashCode();
     }
 
     /**
@@ -1629,7 +1620,17 @@
      * Disposes of system resources associated with this
      * {@code ColorModel} once this {@code ColorModel} is no
      * longer referenced.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     public void finalize() {
     }
 
diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/ComponentColorModel.java b/jdk/src/java.desktop/share/classes/java/awt/image/ComponentColorModel.java
index 60c5b0d..1e6a4d9 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/image/ComponentColorModel.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/ComponentColorModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 
 import java.awt.color.ColorSpace;
 import java.awt.color.ICC_ColorSpace;
+import java.util.Arrays;
 
 /**
  * A {@code ColorModel} class that works with pixel values that
@@ -200,6 +201,7 @@
     private float[] diffMinMax;
     private float[] compOffset;
     private float[] compScale;
+    private volatile int hashCode;
 
     /**
      * Constructs a {@code ComponentColorModel} from the specified
@@ -2927,22 +2929,59 @@
     }
 
     /**
-     * Compares this color model with another for equality.
-     *
-     * @param obj The object to compare with this color model.
-     * @return {@code true} if the color model objects are equal,
-     * {@code false} if they are not.
+     * Tests if the specified {@code Object} is an instance
+     * of {@code ComponentColorModel} and equals this
+     * {@code ComponentColorModel}.
+     * @param obj the {@code Object} to test for equality
+     * @return {@code true} if the specified {@code Object}
+     * is an instance of {@code ComponentColorModel} and equals this
+     * {@code ComponentColorModel}; {@code false} otherwise.
      */
+    @Override
     public boolean equals(Object obj) {
-        if (!super.equals(obj)) {
+        if (!(obj instanceof ComponentColorModel)) {
             return false;
         }
 
-        if (obj.getClass() !=  getClass()) {
+        ComponentColorModel cm = (ComponentColorModel) obj;
+        if (supportsAlpha != cm.hasAlpha() ||
+            isAlphaPremultiplied != cm.isAlphaPremultiplied() ||
+            pixel_bits != cm.getPixelSize() ||
+            transparency != cm.getTransparency() ||
+            numComponents != cm.getNumComponents() ||
+            (!(colorSpace.equals(cm.colorSpace))) ||
+            transferType != cm.transferType)
+        {
+            return false;
+        }
+
+        if (!(Arrays.equals(nBits, cm.getComponentSize()))) {
             return false;
         }
 
         return true;
     }
 
-}
+    /**
+     * Returns the hash code for this ComponentColorModel.
+     *
+     * @return    a hash code for this ComponentColorModel.
+     */
+    @Override
+    public int hashCode() {
+        int result = hashCode;
+        if (result == 0) {
+            result = 7;
+            result = 89 * result + this.pixel_bits;
+            result = 89 * result + Arrays.hashCode(this.nBits);
+            result = 89 * result + this.transparency;
+            result = 89 * result + (this.supportsAlpha ? 1 : 0);
+            result = 89 * result + (this.isAlphaPremultiplied ? 1 : 0);
+            result = 89 * result + this.numComponents;
+            result = 89 * result + this.colorSpace.hashCode();
+            result = 89 * result + this.transferType;
+            hashCode = result;
+        }
+        return result;
+    }
+}
\ No newline at end of file
diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/IndexColorModel.java b/jdk/src/java.desktop/share/classes/java/awt/image/IndexColorModel.java
index bc6e805..81aab99 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/image/IndexColorModel.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/IndexColorModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import java.awt.Transparency;
 import java.awt.color.ColorSpace;
 import java.math.BigInteger;
+import java.util.Arrays;
 
 /**
  * The {@code IndexColorModel} class is a {@code ColorModel}
@@ -129,6 +130,7 @@
     private int transparent_index = -1;
     private boolean allgrayopaque;
     private BigInteger validBits;
+    private volatile int hashCode;
 
     private sun.awt.image.BufImgSurfaceData.ICMColorData colorData = null;
 
@@ -1512,7 +1514,17 @@
      * Disposes of system resources associated with this
      * {@code ColorModel} once this {@code ColorModel} is no
      * longer referenced.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     public void finalize() {
     }
 
@@ -1532,4 +1544,100 @@
                          + " isAlphaPre = "+isAlphaPremultiplied
                          );
     }
+
+    /**
+     * Tests if the specified {@code Object} is an
+     * instance of {@code IndexColorModel}
+     * and if it equals this {@code IndexColorModel}
+     * @param obj the {@code Object} to test for equality
+     * @return {@code true} if the specified {@code Object}
+     * equals this {@code IndexColorModel}; {@code false} otherwise.
+     */
+    @Override
+    public boolean equals(Object obj) {
+
+        if (!(obj instanceof IndexColorModel)) {
+            return false;
+        }
+
+        IndexColorModel cm = (IndexColorModel) obj;
+        if (supportsAlpha != cm.hasAlpha() ||
+            isAlphaPremultiplied != cm.isAlphaPremultiplied() ||
+            pixel_bits != cm.getPixelSize() ||
+            transparency != cm.getTransparency() ||
+            numComponents != cm.getNumComponents() ||
+            (!(colorSpace.equals(cm.colorSpace))) ||
+            transferType != cm.transferType ||
+            map_size != cm.map_size ||
+            transparent_index != cm.transparent_index)
+        {
+            return false;
+        }
+
+        if (!(Arrays.equals(nBits, cm.getComponentSize()))) {
+            return false;
+        }
+
+        // verify whether we have to check equality of all bits in validBits
+        boolean testValidBits;
+        if (validBits == cm.validBits) {
+            testValidBits = false;
+        } else if (validBits == null || cm.validBits == null) {
+            return false;
+        } else if (validBits.equals(cm.validBits)) {
+            testValidBits = false;
+        } else {
+            testValidBits = true;
+        }
+
+        if (testValidBits) {
+            for (int i = 0; i < map_size; i++) {
+                if (rgb[i] != cm.rgb[i] ||
+                    validBits.testBit(i) != cm.validBits.testBit(i))
+                {
+                    return false;
+                }
+            }
+        } else {
+            for (int i = 0; i < map_size; i++) {
+                if (rgb[i] != cm.rgb[i]) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Returns the hash code for IndexColorModel.
+     *
+     * @return    a hash code for IndexColorModel
+     */
+    @Override
+    public int hashCode() {
+        int result = hashCode;
+        if (result == 0) {
+            /*
+             * We are intentionally not calculating hashCode for validBits,
+             * because it is only used for 8-bit indexed screens and they
+             * are very rare. It is very unlikely for 2 IndexColorModels
+             * to have different valiBits and have same value for all
+             * other properties.
+             */
+            result = 7;
+            result = 89 * result + this.pixel_bits;
+            result = 89 * result + Arrays.hashCode(this.nBits);
+            result = 89 * result + this.transparency;
+            result = 89 * result + (this.supportsAlpha ? 1 : 0);
+            result = 89 * result + (this.isAlphaPremultiplied ? 1 : 0);
+            result = 89 * result + this.numComponents;
+            result = 89 * result + this.colorSpace.hashCode();
+            result = 89 * result + this.transferType;
+            result = 89 * result + Arrays.hashCode(this.rgb);
+            result = 89 * result + this.map_size;
+            result = 89 * result + this.transparent_index;
+            hashCode = result;
+        }
+        return result;
+    }
 }
diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/PackedColorModel.java b/jdk/src/java.desktop/share/classes/java/awt/image/PackedColorModel.java
index 0db6ff1..bb432f9 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/image/PackedColorModel.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/PackedColorModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 
 import java.awt.Transparency;
 import java.awt.color.ColorSpace;
+import java.util.Arrays;
 
 /**
  * The {@code PackedColorModel} class is an abstract
@@ -88,6 +89,7 @@
     int[] maskArray;
     int[] maskOffsets;
     float[] scaleFactors;
+    private volatile int hashCode;
 
     /**
      * Constructs a {@code PackedColorModel} from a color mask array,
@@ -393,25 +395,63 @@
      * is an instance of {@code PackedColorModel} and equals this
      * {@code PackedColorModel}; {@code false} otherwise.
      */
+    @Override
     public boolean equals(Object obj) {
         if (!(obj instanceof PackedColorModel)) {
             return false;
         }
 
-        if (!super.equals(obj)) {
+        PackedColorModel cm = (PackedColorModel) obj;
+
+        if (supportsAlpha != cm.hasAlpha() ||
+            isAlphaPremultiplied != cm.isAlphaPremultiplied() ||
+            pixel_bits != cm.getPixelSize() ||
+            transparency != cm.getTransparency() ||
+            numComponents != cm.getNumComponents() ||
+            (!(colorSpace.equals(cm.colorSpace))) ||
+            transferType != cm.transferType)
+        {
             return false;
         }
 
-        PackedColorModel cm = (PackedColorModel) obj;
         int numC = cm.getNumComponents();
         for(int i=0; i < numC; i++) {
             if (maskArray[i] != cm.getMask(i)) {
                 return false;
             }
         }
+
+        if (!(Arrays.equals(nBits, cm.getComponentSize()))) {
+            return false;
+        }
+
         return true;
     }
 
+    /**
+     * Returns the hash code for this PackedColorModel.
+     *
+     * @return    a hash code for this PackedColorModel.
+     */
+    @Override
+    public int hashCode() {
+        int result = hashCode;
+        if (result == 0) {
+            result = 7;
+            result = 89 * result + this.pixel_bits;
+            result = 89 * result + Arrays.hashCode(this.nBits);
+            result = 89 * result + this.transparency;
+            result = 89 * result + (this.supportsAlpha ? 1 : 0);
+            result = 89 * result + (this.isAlphaPremultiplied ? 1 : 0);
+            result = 89 * result + this.numComponents;
+            result = 89 * result + this.colorSpace.hashCode();
+            result = 89 * result + this.transferType;
+            result = 89 * result + Arrays.hashCode(this.maskArray);
+            hashCode = result;
+        }
+        return result;
+    }
+
     private static final int[] createBitsArray(int[]colorMaskArray,
                                                int alphaMask) {
         int numColors = colorMaskArray.length;
@@ -480,4 +520,4 @@
         return count;
     }
 
-}
+}
\ No newline at end of file
diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/image/package-info.java
new file mode 100644
index 0000000..d7be6d1
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/package-info.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes for creating and modifying images. Images are processed
+ * using a streaming framework that involves an image producer, optional image
+ * filters, and an image consumer. This framework makes it possible to
+ * progressively render an image while it is being fetched and generated.
+ * Moreover, the framework allows an application to discard the storage used by
+ * an image and to regenerate it at any time. This package provides a number of
+ * image producers, consumers, and filters that you can configure for your image
+ * processing needs.
+ *
+ * @since 1.0
+ */
+package java.awt.image;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/package.html b/jdk/src/java.desktop/share/classes/java/awt/image/package.html
deleted file mode 100644
index 5ea3b80..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/image/package.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides classes for creating and modifying images.
-Images are processed using a streaming framework that involves an
-image producer, optional image filters, and an image consumer.  This
-framework makes it possible to progressively render an image while it
-is being fetched and generated.  Moreover, the framework allows an
-application to discard the storage used by an image and to regenerate
-it at any time.  This package provides a number of image producers,
-consumers, and filters that you can configure for your image
-processing needs.
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.0
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/renderable/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/image/renderable/package-info.java
new file mode 100644
index 0000000..dc02c0d
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/renderable/package-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interfaces for producing rendering-independent images.
+ *
+ * @since 1.2
+ */
+package java.awt.image.renderable;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/renderable/package.html b/jdk/src/java.desktop/share/classes/java/awt/image/renderable/package.html
deleted file mode 100644
index c75fb1f..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/image/renderable/package.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides classes and interfaces for producing
-rendering-independent images.
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.2
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/package-info.java
new file mode 100644
index 0000000..b2335c3
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/package-info.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Contains all of the classes for creating user interfaces and for painting
+ * graphics and images. A user interface object such as a button or a scrollbar
+ * is called, in AWT terminology, a component. The Component class is the root
+ * of all AWT components. See Component for a detailed description of properties
+ * that all AWT components share.
+ * <p>
+ * Some components fire events when a user interacts with the components. The
+ * AWTEvent class and its subclasses are used to represent the events that AWT
+ * components can fire. See AWTEvent for a description of the AWT event model.
+ * <p>
+ * A container is a component that can contain components and other containers.
+ * A con tainer can also have a layout manager that controls the visual
+ * placement of components in the container. The AWT package contains several
+ * layout manager classes and an interface for building your own layout manager.
+ * See Container and LayoutManager for more information.
+ * <p>
+ * Each {@code Component} object is limited in its maximum size and its location
+ * because the values are stored as an integer. Also, a platform may further
+ * restrict maximum size and location coordinates. The exact maximum values are
+ * dependent on the platform. There is no way to change these maximum values,
+ * either in Java code or in native code. These limitations also impose
+ * restrictions on component layout. If the bounds of a Component object exceed
+ * a platform limit, there is no way to properly arrange them within a Container
+ * object. The object's bounds are defined by any object's coordinate in
+ * combination with its size on a respective axis.
+ *
+ * <h2>Additional Specification</h2>
+ * <ul>
+ *     <li><a href="doc-files/FocusSpec.html">The AWT Focus Subsystem</a>
+ *     <li><a href="doc-files/Modality.html">The AWT Modality</a>
+ * </ul>
+ *
+ * @since 1.0
+ */
+package java.awt;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/package.html b/jdk/src/java.desktop/share/classes/java/awt/package.html
deleted file mode 100644
index ebab6ec..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/package.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Contains all of the classes for creating user
-interfaces and for painting graphics and images. A user interface object such as a button or a
-scrollbar is called, in AWT terminology, a component. The Component class is the root of all
-AWT components. See Component for a detailed description of properties that all AWT 
-components share.
-<p>
-Some components fire events when a user interacts with the components. The AWTEvent
-class and its subclasses are used to represent the events that AWT components can fire. See
-AWTEvent for a description of the AWT event model.
-<p>
-A container is a component that can contain components and other containers. A con
-tainer can also have a layout manager that controls the visual placement of components in the
-container. The AWT package contains several layout manager classes and an interface for
-building your own layout manager. See Container and LayoutManager for more information.
-<p>
-Each {@code Component} object is limited in its maximum size and
-its location because the values are stored as an integer.
-Also, a platform may further restrict maximum size and location
-coordinates. The exact maximum values are dependent on the platform.
-There is no way to change these maximum values, either in Java
-code or in native code.
-These limitations also impose restrictions on component layout.
-If the bounds of a Component object exceed a platform limit,
-there is no way to properly arrange them within a Container object.
-The object's bounds are defined by any object's coordinate
-in combination with its size on a respective axis. 
-
-
-<h2>Additional Specification</h2>
-<ul>
-<li><a href="doc-files/FocusSpec.html">The AWT Focus Subsystem</a>
-<li><a href="doc-files/Modality.html">The AWT Modality</a>
-</ul>
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.0
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/peer/DesktopPeer.java b/jdk/src/java.desktop/share/classes/java/awt/peer/DesktopPeer.java
index 9751458..67eda40 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/peer/DesktopPeer.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/peer/DesktopPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,21 @@
  */
 package java.awt.peer;
 
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
 import java.awt.Desktop.Action;
 import java.awt.desktop.AboutHandler;
-import java.awt.desktop.SystemEventListener;
 import java.awt.desktop.OpenFilesHandler;
+import java.awt.desktop.OpenURIEvent;
 import java.awt.desktop.OpenURIHandler;
+import java.awt.desktop.PreferencesEvent;
 import java.awt.desktop.PreferencesHandler;
 import java.awt.desktop.PrintFilesHandler;
 import java.awt.desktop.QuitHandler;
 import java.awt.desktop.QuitStrategy;
+import java.awt.desktop.SystemEventListener;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+
 import javax.swing.JMenuBar;
 
 /**
@@ -162,7 +165,7 @@
      * the default behavior
      *
      * @param preferencesHandler the handler to respond to the
-     * {@link java.awt.desktop.PreferencesHandler#handlePreferences(java.awt.PreferencesEvent) }
+     * {@link java.awt.desktop.PreferencesHandler#handlePreferences(PreferencesEvent) }
      */
     default void setPreferencesHandler(final PreferencesHandler preferencesHandler) {
     }
@@ -191,7 +194,7 @@
      * open a URL.
      *
      * Setting the handler to {@code null} causes all
-     * {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be
+     * {@link OpenURIHandler#openURI(OpenURIEvent)} requests to be
      * enqueued until another handler is set.
      *
      * @param openURIHandler handler
diff --git a/jdk/src/java.desktop/share/classes/java/awt/peer/PopupMenuPeer.java b/jdk/src/java.desktop/share/classes/java/awt/peer/PopupMenuPeer.java
index 3d3b677..3e42310 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/peer/PopupMenuPeer.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/peer/PopupMenuPeer.java
@@ -46,5 +46,6 @@
      *
      * @see PopupMenu#show(java.awt.Component, int, int)
      */
+    @SuppressWarnings("deprecation")
     void show(Event e);
 }
diff --git a/jdk/src/java.desktop/share/classes/java/awt/peer/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/peer/package-info.java
new file mode 100644
index 0000000..49b6840
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/peer/package-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides for interfacing with the underlying window system. It is for
+ * accessing the platform-specific facilities in order to build AWT toolkits. It
+ * is only used by AWT toolkit developers.
+ */
+package java.awt.peer;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/peer/package.html b/jdk/src/java.desktop/share/classes/java/awt/peer/package.html
deleted file mode 100644
index aeb98b2..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/peer/package.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!--
- Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<body bgcolor="white">
-
-Provides for interfacing with the underlying window system.
-It is for accessing the platform-specific facilities in order to
-build AWT toolkits. It is only used by AWT toolkit developers.
-
-
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
-
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/awt/print/PrinterJob.java b/jdk/src/java.desktop/share/classes/java/awt/print/PrinterJob.java
index 0e4d7f9..f549388 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/print/PrinterJob.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/print/PrinterJob.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,12 +27,12 @@
 
 import java.awt.AWTError;
 import java.awt.HeadlessException;
-import java.util.Enumeration;
 
 import javax.print.DocFlavor;
 import javax.print.PrintService;
 import javax.print.PrintServiceLookup;
 import javax.print.StreamPrintServiceFactory;
+import javax.print.attribute.AttributeSet;
 import javax.print.attribute.PrintRequestAttributeSet;
 import javax.print.attribute.standard.Media;
 import javax.print.attribute.standard.MediaPrintableArea;
@@ -40,8 +40,6 @@
 import javax.print.attribute.standard.MediaSizeName;
 import javax.print.attribute.standard.OrientationRequested;
 
-import sun.security.action.GetPropertyAction;
-
 /**
  * The {@code PrinterJob} class is the principal class that controls
  * printing. An application calls methods in this class to set up a job,
diff --git a/jdk/src/java.desktop/share/classes/java/awt/print/package-info.java b/jdk/src/java.desktop/share/classes/java/awt/print/package-info.java
new file mode 100644
index 0000000..76dfb74
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/awt/print/package-info.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interfaces for a general printing API. The API includes
+ * such features as:
+ * <ul>
+ *     <li>the ability to specify document types</li>
+ *     <li>mechanisms for control of page setup and page formats</li>
+ *     <li>the ability to manage job control dialogs</li>
+ * </ul>
+ *
+ * @since 1.2
+ */
+package java.awt.print;
diff --git a/jdk/src/java.desktop/share/classes/java/awt/print/package.html b/jdk/src/java.desktop/share/classes/java/awt/print/package.html
deleted file mode 100644
index 6c708d5..0000000
--- a/jdk/src/java.desktop/share/classes/java/awt/print/package.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head><title></title></head>
-<body bgcolor="white">
-
-Provides classes and interfaces for a general printing API.  The
-API includes such features as:
-<ul>
-<li>the ability to specify document types
-<li>mechanisms for control of page setup and page formats
-<li>the ability to manage job control dialogs
-</ul>
-
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.2
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/beans/ChangeListenerMap.java b/jdk/src/java.desktop/share/classes/java/beans/ChangeListenerMap.java
index fa8be47..8f246b0 100644
--- a/jdk/src/java.desktop/share/classes/java/beans/ChangeListenerMap.java
+++ b/jdk/src/java.desktop/share/classes/java/beans/ChangeListenerMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,8 +39,8 @@
  * for the {@link PropertyChangeSupport PropertyChangeSupport} class
  * and the {@link VetoableChangeSupport VetoableChangeSupport} class.
  *
- * @see PropertyChangeListenerMap
- * @see VetoableChangeListenerMap
+ * @see PropertyChangeSupport.PropertyChangeListenerMap
+ * @see VetoableChangeSupport.VetoableChangeListenerMap
  *
  * @author Sergey A. Malenkov
  */
diff --git a/jdk/src/java.desktop/share/classes/java/beans/beancontext/package-info.java b/jdk/src/java.desktop/share/classes/java/beans/beancontext/package-info.java
new file mode 100644
index 0000000..f1b22cf
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/beans/beancontext/package-info.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interfaces relating to bean context. A bean context is a
+ * container for beans and defines the execution environment for the beans it
+ * contains. There can be several beans in a single bean context, and a bean
+ * context can be nested within another bean context. This package also
+ * contains events and listener interface for beans being added and removed from
+ * a bean context.
+ *
+ * @since 1.2
+ */
+package java.beans.beancontext;
diff --git a/jdk/src/java.desktop/share/classes/java/beans/beancontext/package.html b/jdk/src/java.desktop/share/classes/java/beans/beancontext/package.html
deleted file mode 100644
index 739356e..0000000
--- a/jdk/src/java.desktop/share/classes/java/beans/beancontext/package.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--
- Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<body bgcolor="white">
-
-Provides classes and interfaces relating to bean context.
-A bean context is a container for beans and defines the execution
-environment for the beans it contains.  There can be several beans in
-a single bean context, and a bean context can be nested within another
-bean context.  This package also contains events and listener
-interface for beans being added and removed from a bean context.
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
-  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since 1.2
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/java/beans/package-info.java b/jdk/src/java.desktop/share/classes/java/beans/package-info.java
new file mode 100644
index 0000000..c841669
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/java/beans/package-info.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Contains classes related to developing <em>beans</em> -- components based on
+ * the JavaBeans&trade; architecture. A few of the classes are used by beans
+ * while they run in an application. For example, the event classes are used by
+ * beans that fire property and vetoable change events (see
+ * {@link java.beans.PropertyChangeEvent}). However, most of the classes in this
+ * package are meant to be used by a bean editor (that is, a development
+ * environment for customizing and putting together beans to create an
+ * application). In particular, these classes help the bean editor create a user
+ * interface that the user can use to customize the bean. For example, a bean
+ * may contain a property of a special type that a bean editor may not know how
+ * to handle. By using the {@code PropertyEditor} interface, a bean developer
+ * can provide an editor for this special type.
+ * <p>
+ * To minimize the resources used by a bean, the classes used by bean editors
+ * are loaded only when the bean is being edited. They are not needed while the
+ * bean is running in an application and therefore not loaded. This information
+ * is kept in what's called a bean-info (see {@link java.beans.BeanInfo}).
+ * <p>
+ * Unless explicitly stated, null values or empty Strings are not valid
+ * parameters for the methods in this package. You may expect to see exceptions
+ * if these parameters are used.
+ *
+ * <h2>Long-Term Persistence</h2>
+ * As of v1.4, the {@code java.beans} package provides support for <em>long-term
+ * persistence</em> -- reading and writing a bean as a textual representation of
+ * its property values. The property values are treated as beans, and are
+ * recursively read or written to capture their publicly available state. This
+ * approach is suitable for long-term storage because it relies only on public
+ * API, rather than the likely-to-change private implementation.
+ *
+ * <blockquote><hr><b>Note:</b> The persistence scheme cannot automatically
+ * instantiate custom inner classes, such as you might use for event handlers.
+ * By using the {@link java.beans.EventHandler} class instead of inner classes
+ * for custom event handlers, you can avoid this problem.<hr></blockquote>
+ * <p>
+ * You read and write beans in XML format using the
+ * {@link java.beans.XMLDecoder} and {@link java.beans.XMLEncoder} classes,
+ * respectively. One notable feature of the persistence scheme is that reading
+ * in a bean requires no special knowledge of the bean.
+ * <p>
+ * Writing out a bean, on the other hand, sometimes requires special knowledge
+ * of the bean's type. If the bean's state can be expressed using only the
+ * no-argument constructor and public getter and setter methods for properties,
+ * no special knowledge is required. Otherwise, the bean requires a custom
+ * <em>persistence delegate</em> -- an object that is in charge of writing out
+ * beans of a particular type. All classes provided in the JDK that descend from
+ * {@code java.awt.Component}, as well as all their properties, automatically
+ * have persistence delegates.
+ * <p>
+ * If you need (or choose) to provide a persistence delegate for a bean, you can
+ * do so either by using a {@link java.beans.DefaultPersistenceDelegate}
+ * instance or by creating your own subclass of {@code PersistenceDelegate}. If
+ * the only reason a bean needs a persistence delegate is because you want to
+ * invoke the bean's constructor with property values as arguments, you can
+ * create the bean's persistence delegate with the one-argument
+ * {@code DefaultPersistenceDelegate} constructor. Otherwise, you need to
+ * implement your own persistence delegate, for which you're likely to need the
+ * following classes:
+ * <dl>
+ *     <dt>{@link java.beans.PersistenceDelegate}</dt>
+ *     <dd>The abstract class from which all persistence delegates descend. Your
+ *     subclass should use its knowledge of the bean's type to provide whatever
+ *     {@code Statement}s and {@code Expression}s are necessary to create the
+ *     bean and restore its state.</dd>
+ *     <dt>{@link java.beans.Statement}</dt>
+ *     <dd>Represents the invocation of a single method on an object. Includes
+ *     a set of arguments to the method.</dd>
+ *     <dt>{@link java.beans.Expression}</dt>
+ *     <dd>A subclass of {@code Statement} used for methods that return a
+ *     value.</dd>
+ * </dl>
+ * <p>
+ * Once you create a persistence delegate, you register it using the
+ * {@code setPersistenceDelegate} method of {@code XMLEncoder}.
+ *
+ * <h2>Related Documentation</h2>
+ * For overview, architecture, and tutorial documentation, please see:
+ * <ul>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/javabeans/">
+ *         JavaBeans</a>, a trail in <em>The Java Tutorial</em>.</li>
+ *     <li><a href="http://www.oracle.com/technetwork/java/persistence2-141443.html">
+ *         Long-Term Persistence</a>, an article in
+ *         <em>The Swing Connection</em>.</li>
+ * </ul>
+ */
+package java.beans;
diff --git a/jdk/src/java.desktop/share/classes/java/beans/package.html b/jdk/src/java.desktop/share/classes/java/beans/package.html
deleted file mode 100644
index 81a9cda..0000000
--- a/jdk/src/java.desktop/share/classes/java/beans/package.html
+++ /dev/null
@@ -1,155 +0,0 @@
-<!--
- Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<body bgcolor="white">
-
-Contains classes related to developing
-<em>beans</em> -- components
-based on the JavaBeans&trade; architecture.
-A few of the
-classes are used by beans while they run in an application. 
-For example, the event classes are
-used by beans that fire property and vetoable change 
-events (see 
-{@link java.beans.PropertyChangeEvent}). However, most of the classes in this
-package are meant to be used by a bean editor (that is, a development environment 
-for customizing and putting together beans to create an application). In
-particular, these classes help the bean editor create a user 
-interface that the user can use to customize the bean. For example, a bean may 
-contain a property of a special type that a bean editor may not know how to handle. 
-By using the <code>PropertyEditor</code> interface, a bean developer can
-provide an editor for this special type.
-
-<p>
-To minimize the resources used by a bean, the classes used by bean editors are loaded only
-when the bean is being edited. They are not needed while the bean is running in an application
-and therefore not loaded. This information is kept in what's called a bean-info (see {@link java.beans.BeanInfo}).
-
-<p>
-Unless explicitly stated, null values or empty Strings are not valid 
-parameters for the methods in this package. You may expect to see 
-exceptions if these parameters are used.
-
-
-<h2>Long-Term Persistence</h2>
-
-As of v1.4,
-the <code>java.beans</code> package provides support for 
-<em>long-term persistence</em> -- reading and
-writing a bean as a textual representation of its property values.
-The property values are treated as beans,
-and are recursively read or written to capture 
-their publicly available state.
-This approach is suitable for long-term storage 
-because it relies only on public API,
-rather than the likely-to-change private implementation.
-
-<blockquote>
-<hr>
-<b>Note:</b>
-The persistence scheme cannot automatically instantiate 
-custom inner classes, such as you might use for event handlers.
-By using the {@link java.beans.EventHandler} class
-instead of inner classes for custom event handlers,
-you can avoid this problem.
-<hr>
-</blockquote>
-
-<p>
-
-You read and write beans in XML format using the
-{@link java.beans.XMLDecoder}
-and 
-{@link java.beans.XMLEncoder}
-classes, respectively.
-One notable feature of the persistence scheme is that
-reading in a bean requires no special knowledge of the bean.
-
-<p>
-Writing out a bean, on the other hand,
-sometimes requires special knowledge of the bean's type.
-If the bean's state can be
-expressed using only the no-argument constructor and 
-public getter and setter methods for properties,
-no special knowledge is required.
-Otherwise, the bean requires a custom <em>persistence delegate</em> --
-an object that is in charge of writing out beans of a particular type.
-All classes provided in the JDK that descend 
-from <code>java.awt.Component</code>, 
-as well as all their properties, 
-automatically have persistence delegates.
-
-<p>
-
-If you need (or choose) to provide a persistence delegate for a bean,
-you can do so either by using a 
-{@link java.beans.DefaultPersistenceDelegate}
-instance
-or by creating your own subclass of <code>PersistenceDelegate</code>.
-If the only reason a bean needs a persistence delegate 
-is because you want to invoke the bean's constructor with 
-property values as arguments,
-you can create the bean's persistence delegate 
-with the one-argument
-<code>DefaultPersistenceDelegate</code>
-constructor.
-Otherwise,
-you need to implement your own persistence delegate,
-for which you're likely to need the following classes:
-
-<dl>
-<dt> {@link java.beans.PersistenceDelegate}
-<dd> The abstract class from which all persistence delegates descend.
-     Your subclass should use its knowledge of the bean's type to provide 
-     whatever <code>Statement</code>s and <code>Expression</code>s
-     are necessary to create the bean
-     and restore its state.
-<dt> {@link java.beans.Statement}
-<dd> Represents the invocation of a single method on an object.
-     Includes a set of arguments to the method.
-<dt> {@link java.beans.Expression}
-<dd> A subclass of <code>Statement</code>
-     used for methods that return a value.
-</dl>
-
-<p>
-Once you create a persistence delegate,
-you register it using the
-<code>setPersistenceDelegate</code> method of
-<code>XMLEncoder</code>.
-
-
-<h2>Related Documentation</h2>
-
-For overview, architecture, and tutorial documentation, please see:
-<ul>
-  <li><a href="http://docs.oracle.com/javase/tutorial/javabeans/">JavaBeans</a>, a trail in <em>The Java Tutorial</em>.
-  <li><a href="http://www.oracle.com/technetwork/java/persistence2-141443.html">Long-Term Persistence</a>, an article in <em>The Swing Connection</em>.
-</ul>
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java
index c3a30f3..0894847 100644
--- a/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java
+++ b/jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,6 @@
 import java.beans.PropertyChangeEvent;
 import java.awt.IllegalComponentStateException;
 
-import javax.swing.SwingContainer;
-
 /**
  * AccessibleContext represents the minimum information all accessible objects
  * return.  This information includes the accessible name, description, role,
@@ -79,7 +77,6 @@
  * @author      Lynn Monsanto
  */
 @JavaBean(description = "Minimal information that all accessible objects return")
-@SwingContainer(false)
 public abstract class AccessibleContext {
 
     /**
@@ -416,7 +413,7 @@
      *
      * @see #addPropertyChangeListener
      * @see #removePropertyChangeListener
-     * @see #firePropertyChangeListener
+     * @see #firePropertyChange
      */
     private PropertyChangeSupport accessibleChangeSupport = null;
 
diff --git a/jdk/src/java.desktop/share/classes/javax/accessibility/package-info.java b/jdk/src/java.desktop/share/classes/javax/accessibility/package-info.java
new file mode 100644
index 0000000..eb311c2
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/accessibility/package-info.java
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Defines a contract between user-interface components and an assistive
+ * technology that provides access to those components. If a Java application
+ * fully supports the Java Accessibility API, then it should be compatible with,
+ * and friendly toward, assistive technologies such as screen readers, screen
+ * magnifiers, etc. With a Java application that fully supports the Java
+ * Accessibility API, no screen reader off screen model would be necessary
+ * because the API provides all of the information normally contained in an off
+ * screen model.
+ * <p>
+ * The Java Accessibility API package consists of 8 Java programming language
+ * interfaces, and 6 Java programming language classes. These are described
+ * below.
+ *
+ * <h3><a name="Accessible"></a><a href="Accessible.html">Interface
+ * Accessible</a></h3>
+ * <a href="Accessible.html">Interface Accessible</a> is the main interface of
+ * the Java Accessibility API. All components that support the Java
+ * Accessibility API must implement this interface. It contains a single method,
+ * {@code getAccessibleContext}, that returns an instance of the class
+ * <a href="#AccessibleContext">AccessibleContext</a>. Sun thinks that
+ * implementing this interface is the absolute minimum requirement of every
+ * object that is part of the user interface of a Java application, if that
+ * program is to be compatible with assistive technologies.
+ *
+ * <h3><a name="AccessibleContext"></a><a href="AccessibleContext.html">Class
+ * AccessibleContext</a></h3>
+ * <a href="AccessibleContext.html">AccessibleContext</a> represents the minimum
+ * information all accessible objects return and is obtained by calling the
+ * {@code getAccessibleContext} method on an object that implements the
+ * <a href="#Accessible">Accessible</a> interface. This information includes the
+ * accessible name, description, <a href="#AccessibleRole">role</a>, and
+ * <a href="#AccessibleState">state</a> of the object, as well as information
+ * about the parent and children of the object.&nbsp; In addition,
+ * JavaBeans&trade; property change support is also included to allow assisitive
+ * technologies learn when the values of the accessible properties change.
+ * AccessibleContext also contains methods for obtaining more specific
+ * accessibility information about a component. If the component supports it,
+ * these methods will return an object that implements one or more of the
+ * following interfaces:
+ * <ul>
+ *     <li><b><a href="#AccessibleAction">AccessibleAction</a></b> - the object
+ *     can perform one or more actions. This interface provides the standard
+ *     mechanism for an assistive technology to determine what those actions are
+ *     and tell the object to perform those actions. Any object that can be
+ *     manipulated should return an object that implements this interface when
+ *     the {@code getAccessibleAction} method is called on an AccessibleContext.
+ *     </li>
+ *     <li><b><a href="#AccessibleComponent">AccessibleComponent</a></b> - the
+ *     object has a graphical representation. This interface provides the
+ *     standard mechanism for an assistive technology to determine and set the
+ *     graphical representation of the object. Any object that is rendered on
+ *     the screen should return an object that implements this interface when
+ *     the {@code getAccessibleComponent} method is called on an
+ *     AccessibleContext.</li>
+ *     <li><b><a href="#AccessibleSelection">AccessibleSelection</a></b> - the
+ *     object allows its children to be selected. This interface provides the
+ *     standard mechanism for an assistive technology to determine the currently
+ *     selected children as well as modify the selection set. Any object that
+ *     has children that can be selected should return an object that implements
+ *     this interface when the {@code getAccessibleSelection} method is called
+ *     on an AccessibleContext.</li>
+ *     <li><b><a href="#AccessibleText">AccessibleText</a></b> - the object
+ *     presents editable textual information on the display. This interface
+ *     provides the standard mechanism for an assistive technology to access
+ *     that text via its content, attributes, and spatial location. Any object
+ *     that contains editable text should return an object that implements this
+ *     interface when the {@code getAccessibleText} method is called on an
+ *     AccessibleContext.</li>
+ *     <li><b><a href="#AccessibleHypertext">AccessibleHypertext</a></b> - the
+ *     object presents hypertext information on the display. This interface
+ *     provides the standard mechanism for an assistive technology to access that
+ *     hypertext via its content, attributes, and spatial location. Any object
+ *     that contains hypertext should return an object that implements this
+ *     interface when the {@code getAccessibleText} method is called on an
+ *     AccessibleContext.</li>
+ *     <li><b><a href="#AccessibleValue">AccessibleValue</a></b> - the object
+ *     supports a numerical value. This interface provides the standard
+ *     mechanism for an assistive technology to determine and set the current
+ *     value of the object, as well as the minimum and maximum values. Any
+ *     object that supports a numerical value should return an object that
+ *     implements this interface when the {@code getAccessibleValue} method is
+ *     called on an AccessibleContext.</li>
+ * </ul>
+ *
+ * <h3><a name="AccessibleRole"></a><a href="AccessibleRole.html">Class
+ * AccessibleRole</a></h3>
+ * This class encapsulates the Accessible object's role in the user interface
+ * and is obtained by calling the {@code getAccessibleRole} method on an
+ * <a href="#AccessibleContext">AccessibleContext</a>. Accessible roles include
+ * "Check box", "Menu Item", "Panel", etc. These roles are identified by the
+ * constants in this class such as {@code AccessibleRole.CHECK_BOX,
+ * AccessibleRole.MENU_ITEM,} and {@code AccessibleRole.PANEL}. The constants in
+ * this class present a strongly typed enumeration of common object roles. A
+ * public constructor for this class has been purposely omitted and applications
+ * should use one of the constants from this class. Although this class
+ * pre-defines a large list of standard roles, it is extensible so additional
+ * programmer-defined roles can be added in the future without needing to modify
+ * the base class.
+ *
+ * <h3><a name="AccessibleState"></a><a href="AccessibleState.html">Class
+ * AccessibleState</a></h3>
+ * This class encapsulates a particular state of the Accessible object.
+ * Accessible states include things like "Armed", "Busy", "Checked", "Focused",
+ * etc. These roles are identified by the constants in this class such as
+ * {@code AccessibleState.ARMED, AccessibleState.BUSY, AccessibleState.CHECKED,}
+ * and {@code AccessibleState.FOCUSED}. The sum of all the states of an
+ * Accessible object is called the
+ * <a href="#AccessibleStateSet">AccessibleStateSet</a>, and can be obtained by
+ * calling the {@code getAccessibleStateSet} method on an
+ * <a href="#AccessibleContext">AccessibleContext</a>.
+ * <p>
+ * The constants in this class present a strongly typed enumeration of common
+ * object roles. A public constructor for this class has been purposely omitted
+ * and applications should use one of the constants from this class. Although
+ * this class pre-defines a large list of standard roles, it is extensible so
+ * additional, programmer-defined roles can be added in the future without
+ * needing to modify the base class.
+ *
+ * <h3><a name="AccessibleStateSet"></a><a href="AccessibleStateSet.html">Class
+ * AccessibleStateSet</a></h3>
+ * This class encapsulates a collection of states of the Accessible object and
+ * is obtained by calling the {@code getAccessibleStateSet} method on an
+ * <a href="#AccessibleContext">AccessibleContext</a>. Since an object might
+ * have multiple states (e.g. it might be both "Checked" and "Focused"), this
+ * class is needed to encapsulate a collection of these states. Methods in the
+ * class provide for retrieving the individual
+ * <a href="#AccessibleState">AccessibleStates</a> on the state set.
+ *
+ * <h3><a name="AccessibleBundle"></a><a href="AccessibleBundle.html">Class
+ * AccessibleBundle</a></h3>
+ * This class is used to maintain a strongly typed enumeration. It is the super
+ * class of both the <a href="#AccessibleRole">AccessibleRole</a> and
+ * <a href="#AccessibleState">AccessibleState</a> classes. Programmers normally
+ * do not interact with this class directly, but will instead use the
+ * <a href="#AccessibleRole">AccessibleRole</a> and
+ * <a href="#AccessibleState">AccessibleState</a> classes.
+ *
+ * <h3><a name="AccessibleAction"></a><a href="AccessibleAction.html">Interface
+ * AccessibleAction</a></h3>
+ * The <a href="AccessibleAction.html">AccessibleAction</a> interface should be
+ * supported by any object that can perform one or more actions. This interface
+ * provides the standard mechanism for an assistive technology to determine what
+ * those actions are as well as tell the object to perform those actions. Any
+ * object that can be manipulated should support this interface.
+ * <p>
+ * Applications can determine if an object supports the AccessibleAction
+ * interface by first obtaining its
+ * <a href="#AccessibleContext">AccessibleContext</a> (see
+ * <a href="#Accessible">Accessible</a>) and then calling the
+ * {@code getAccessibleAction} method of
+ * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is
+ * not null, the object supports this interface.
+ *
+ * <h3> <a name="AccessibleComponent"></a><a href="AccessibleComponent.html">
+ * Interface AccessibleComponent</a></h3>
+ * The <a href="AccessibleComponent.html">AccessibleComponent</a> interface
+ * should be supported by any object that is rendered on the screen. This
+ * interface provides the standard mechanism for an assistive technology to
+ * determine and set the graphical representation of an object. <p>Applications
+ * can determine if an object supports the AccessibleComponent interface by
+ * first obtaining its <a href="#AccessibleContext">AccessibleContext</a> (see
+ * <a href="#Accessible">Accessible</a>) and then calling the
+ * {@code getAccessibleComponent} method of
+ * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is
+ * not null, the object supports this interface.
+ *
+ * <h3><a name="AccessibleSelection"></a><a href="AccessibleSelection.html">
+ * Interface AccessibleSelection</a></h3>
+ * The <a href="AccessibleSelection.html">AccessibleSelection</a> interface
+ * provides the standard mechanism for an assistive technology to determine what
+ * the current selected children are, as well as modify the selection set. Any
+ * object that has children that can be selected should support this the
+ * AccessibleSelection interface.
+ * <p>
+ * Applications can determine if an object supports the AccessibleSelection
+ * interface by first obtaining its
+ * <a href="#AccessibleContext">AccessibleContext</a> (see
+ * <a href="#Accessible">Accessible</a>) and then calling the
+ * {@code getAccessibleSelection} method of
+ * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is
+ * not null, the object supports this interface.
+ *
+ * <h3><a name="AccessibleText"></a><a href="AccessibleText.html">Interface
+ * AccessibleText</a></h3>
+ * Interface <a href="AccessibleText.html">AccessibleText</a> is the contract
+ * for making rich, editable text Accessible. Not all text displayed on the
+ * screen is rich and editable (e.g. text contained in buttons, labels, menus,
+ * etc., which users aren't expected to manipulate). However, objects containing
+ * editable text must implement interface AccessibleText if they are to
+ * interoperate with assistive technologies.
+ * <p>
+ * This interface provides support for going between pixel coordinates and the
+ * text at a given pixel coordinate, for retrieving the letter, word, and
+ * sentence at, before, or after a given position in the text. This interface
+ * provides support for retrieving the attributes of the character at a given
+ * position in the text (font, font size, style, etc.), as well as getting the
+ * selected text (if any), the length of the text, and the location of the text
+ * caret.
+ * <p>
+ * Applications can determine if an object supports the AccessibleText interface
+ * by first obtaining its <a href="#AccessibleContext">AccessibleContext</a>
+ * (see <a href="#Accessible">Accessible</a>) and then calling the
+ * {@code getAccessibleText} method of
+ * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is
+ * not null, the object supports this interface.
+ *
+ * <h3><a name="AccessibleHypertext"></a> <a href="AccessibleHypertext.html">
+ * Interface AccessibleHypertext</a></h3>
+ * The <a href="AccessibleHypertext.html">AccessibleHypertext</a> interface
+ * should be supported by any object that presents hypertext information on the
+ * display. This interface provides the standard mechanism for an assistive
+ * technology to access that text via its content, attributes, and spatial
+ * location. It also provides standard mechanisms for manipulating
+ * <a href="#AccessibleHyperlink">hyperlinks</a>. Applications can determine if
+ * an object supports the AccessibleHypertext interface by first obtaining its
+ * <a href="#AccessibleContext">AccessibleContext</a> (see
+ * <a href="#Accessible">Accessible</a>) and then calling the
+ * AccessibleContext.getAccessibleText() method of
+ * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is a
+ * class which extends AccessibleHypertext, then that object supports
+ * AccessibleHypertext.
+ *
+ * <h3><a name="AccessibleHyperlink"></a><a href="AccessibleHyperlink.html">
+ * Interface AccessibleHyperlink</a></h3>
+ * An object that is a hyperlink should support the
+ * <a href="AccessibleHyperlink.html">AccessibleHyperlink</a> interface.&nbsp;
+ * An object that implements this interface will be returned by calling the
+ * getLink method on an <a href="#AccessibleHypertext">AccessibleHypertext</a>
+ * object.
+ *
+ * <h3><a name="AccessibleValue"></a><a href="AccessibleValue.html">Interface
+ * AccessibleValue</a></h3>
+ * The <a href="AccessibleValue.html">AccessibleValue</a> interface should be
+ * supported by any object that supports a numerical value (e.g., a scroll bar).
+ * This interface provides the standard mechanism for an assistive technology to
+ * determine and set the numerical value as well as get the minimum and maximum
+ * values.
+ * <p>
+ * Applications can determine if an object supports the AccessibleValue
+ * interface by first obtaining its
+ * <a href="#AccessibleContext">AccessibleContext</a> (see
+ * <a href="#Accessible">Accessible</a>) and then calling the
+ * {@code getAccessibleValue} method of
+ * <a href="#AccessibleContext">AccessibleContext</a>. If the return value is
+ * not null, the object supports this interface.
+ *
+ * @since 1.2
+ */
+package javax.accessibility;
diff --git a/jdk/src/java.desktop/share/classes/javax/accessibility/package.html b/jdk/src/java.desktop/share/classes/javax/accessibility/package.html
deleted file mode 100644
index 4d1037a..0000000
--- a/jdk/src/java.desktop/share/classes/javax/accessibility/package.html
+++ /dev/null
@@ -1,266 +0,0 @@
-<HTML>
-<HEAD>
-   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-   <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (WinNT; I) [Netscape]">
-<!--
-Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</HEAD>
-<BODY BGCOLOR="#FFFFFF">
-Defines a contract between user-interface components and an assistive technology
-that provides access to those components. If a Java application fully supports
-the Java Accessibility API, then it should be compatible with, and friendly
-toward, assistive technologies such as screen readers, screen magnifiers,
-etc. With a Java application that fully supports the Java Accessibility
-API, no screen reader off screen model would be necessary because the API
-provides all of the information normally contained in an off screen model.
-
-<P>The Java Accessibility API package consists of 8 Java programming language
-interfaces, and 6 Java programming language classes. These are described
-below.
-<H3>
-<A NAME="Accessible"></A><A HREF="Accessible.html">Interface Accessible</A></H3>
-<A HREF="Accessible.html">Interface Accessible</A> is the main interface
-of the Java Accessibility API. All components that support the Java Accessibility
-API must implement this interface. It contains a single method, <code>getAccessibleContext</code>,
-that returns an instance of the class <A HREF="#AccessibleContext">AccessibleContext</A>.
-Sun thinks that implementing this interface is the absolute minimum requirement
-of every object that is part of the user interface of a Java application,
-if that program is to be compatible with assistive technologies.
-<H3>
-<A NAME="AccessibleContext"></A><A HREF="AccessibleContext.html">Class
-AccessibleContext</A></H3>
-<A HREF="AccessibleContext.html">AccessibleContext</A> represents the minimum
-information all accessible objects return and is obtained by calling the
-<code>getAccessibleContext</code> method on an object that implements the <A HREF="#Accessible">Accessible</A>
-interface. This information includes the accessible name, description,
-<A HREF="#AccessibleRole">role</A>, and <A HREF="#AccessibleState">state</A>
-of the object, as well as information about the parent and children of
-the object.&nbsp; In addition, JavaBeans <SUP><FONT SIZE=-2>TM</FONT></SUP>
-property change support is also included to allow assisitive technologies
-learn when the values of the accessible properties change. AccessibleContext
-also contains methods for obtaining more specific accessibility information
-about a component. If the component supports it, these methods will return
-an object that implements one or more of the following interfaces:
-<UL>
-<LI>
-<B><A HREF="#AccessibleAction">AccessibleAction</A></B> - the object can
-perform one or more actions. This interface provides the standard mechanism
-for an assistive technology to determine what those actions are and tell
-the object to perform those actions. Any object that can be manipulated
-should return an object that implements this interface when the <code>getAccessibleAction</code>
-method is called on an AccessibleContext.</LI>
-
-<LI>
-<B><A HREF="#AccessibleComponent">AccessibleComponent</A></B> - the object
-has a graphical representation. This interface provides the standard mechanism
-for an assistive technology to determine and set the graphical representation
-of the object. Any object that is rendered on the screen should return
-an object that implements this interface when the <code>getAccessibleComponent</code>
-method is called on an AccessibleContext.</LI>
-
-<LI>
-<B><A HREF="#AccessibleSelection">AccessibleSelection</A></B> - the object
-allows its children to be selected. This interface provides the standard
-mechanism for an assistive technology to determine the currently selected
-children as well as modify the selection set. Any object that has children
-that can be selected should return an object that implements this interface
-when the <code>getAccessibleSelection</code> method is called on an AccessibleContext.</LI>
-
-<LI>
-<B><A HREF="#AccessibleText">AccessibleText</A></B> - the object presents
-editable textual information on the display. This interface provides the
-standard mechanism for an assistive technology to access that text via
-its content, attributes, and spatial location. Any object that contains
-editable text should return an object that implements this interface when
-the <code>getAccessibleText</code> method is called on an AccessibleContext.</LI>
-
-<LI>
-<B><A HREF="#AccessibleHypertext">AccessibleHypertext</A></B> - the object
-presents hypertext information on the display. This interface provides
-the standard mechanism for an assistive technology to access that hypertext
-via its content, attributes, and spatial location. Any object that contains
-hypertext should return an object that implements this interface when the
-<code>getAccessibleText</code> method is called on an AccessibleContext.</LI>
-
-<LI>
-<B><A HREF="#AccessibleValue">AccessibleValue</A></B> - the object supports
-a numerical value. This interface provides the standard mechanism for an
-assistive technology to determine and set the current value of the object,
-as well as the minimum and maximum values. Any object that supports a numerical
-value should return an object that implements this interface when the <code>getAccessibleValue</code>
-method is called on an AccessibleContext.</LI>
-</UL>
-
-<H3>
-<A NAME="AccessibleRole"></A><A HREF="AccessibleRole.html">Class AccessibleRole</A></H3>
-This class encapsulates the Accessible object's role in the user interface
-and is obtained by calling the <code>getAccessibleRole</code> method on an
-<A HREF="#AccessibleContext">AccessibleContext</A>. Accessible roles include
-"Check box", "Menu Item", "Panel", etc. These roles are identified by the
-constants in this class such as <code>AccessibleRole.CHECK_BOX, AccessibleRole.MENU_ITEM,</code>
-and <code>AccessibleRole.PANEL</code>. The constants in this class present
-a strongly typed enumeration of common object roles. A public constructor
-for this class has been purposely omitted and applications should use one
-of the constants from this class. Although this class pre-defines a large
-list of standard roles, it is extensible so additional programmer-defined
-roles can be added in the future without needing to modify the base class.
-
-<H3>
-<A NAME="AccessibleState"></A><A HREF="AccessibleState.html">Class AccessibleState</A></H3>
-This class encapsulates a particular state of the Accessible object. Accessible
-states include things like "Armed", "Busy", "Checked", "Focused", etc.
-These roles are identified by the constants in this class such as <code>AccessibleState.ARMED,
-AccessibleState.BUSY, AccessibleState.CHECKED,</code> and <code>AccessibleState.FOCUSED</code>.
-The sum of all the states of an Accessible object is called the <A HREF="#AccessibleStateSet">AccessibleStateSet</A>,
-and can be obtained by calling the <code>getAccessibleStateSet</code> method
-on an <A HREF="#AccessibleContext">AccessibleContext</A>.
-
-<P>The constants in this class present a strongly typed enumeration of
-common object roles. A public constructor for this class has been purposely
-omitted and applications should use one of the constants from this class.
-Although this class pre-defines a large list of standard roles, it is extensible
-so additional, programmer-defined roles can be added in the future without
-needing to modify the base class.
-
-<H3>
-<A NAME="AccessibleStateSet"></A><A HREF="AccessibleStateSet.html">Class
-AccessibleStateSet</A></H3>
-This class encapsulates a collection of states of the Accessible object
-and is obtained by calling the <code>getAccessibleStateSet</code> method on
-an <A HREF="#AccessibleContext">AccessibleContext</A>. Since an object
-might have multiple states (e.g. it might be both "Checked" and "Focused"),
-this class is needed to encapsulate a collection of these states. Methods
-in the class provide for retrieving the individual <A HREF="#AccessibleState">AccessibleStates</A>
-on the state set.
-<H3>
-<A NAME="AccessibleBundle"></A><A HREF="AccessibleBundle.html">Class AccessibleBundle</A></H3>
-This class is used to maintain a strongly typed enumeration. It is the
-super class of both the <A HREF="#AccessibleRole">AccessibleRole</A> and
-<A HREF="#AccessibleState">AccessibleState</A> classes. Programmers normally
-do not interact with this class directly, but will instead use the <A HREF="#AccessibleRole">AccessibleRole</A>
-and <A HREF="#AccessibleState">AccessibleState</A> classes.
-
-<H3>
-<A NAME="AccessibleAction"></A><A HREF="AccessibleAction.html">Interface
-AccessibleAction</A></H3>
-The <A HREF="AccessibleAction.html">AccessibleAction</A> interface should
-be supported by any object that can perform one or more actions. This interface
-provides the standard mechanism for an assistive technology to determine
-what those actions are as well as tell the object to perform those actions.
-Any object that can be manipulated should support this interface.
-
-<P>Applications can determine if an object supports the AccessibleAction
-interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
-(see <A HREF="#Accessible">Accessible</A>) and then calling the <code>getAccessibleAction</code>
-method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
-value is not null, the object supports this interface.
-<H3>
-<A NAME="AccessibleComponent"></A><A HREF="AccessibleComponent.html">Interface
-AccessibleComponent</A></H3>
-The <A HREF="AccessibleComponent.html">AccessibleComponent</A> interface
-should be supported by any object that is rendered on the screen. This
-interface provides the standard mechanism for an assistive technology to
-determine and set the graphical representation of an object.
-
-<P>Applications can determine if an object supports the AccessibleComponent
-interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
-(see <A HREF="#Accessible">Accessible</A>) and then calling the <code>getAccessibleComponent</code>
-method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
-value is not null, the object supports this interface.
-<H3>
-<A NAME="AccessibleSelection"></A><A HREF="AccessibleSelection.html">Interface
-AccessibleSelection</A></H3>
-The <A HREF="AccessibleSelection.html">AccessibleSelection</A> interface
-provides the standard mechanism for an assistive technology to determine
-what the current selected children are, as well as modify the selection
-set. Any object that has children that can be selected should support this
-the AccessibleSelection interface.
-
-<P>Applications can determine if an object supports the AccessibleSelection
-interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
-(see <A HREF="#Accessible">Accessible</A>) and then calling the <code>getAccessibleSelection</code>
-method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
-value is not null, the object supports this interface.
-<H3>
-<A NAME="AccessibleText"></A><A HREF="AccessibleText.html">Interface AccessibleText</A></H3>
-Interface <A HREF="AccessibleText.html">AccessibleText</A> is the contract
-for making rich, editable text Accessible. Not all text displayed on the
-screen is rich and editable (e.g. text contained in buttons, labels, menus,
-etc., which users aren't expected to manipulate). However, objects containing
-editable text must implement interface AccessibleText if they are to interoperate
-with assistive technologies.
-
-<P>This interface provides support for going between pixel coordinates
-and the text at a given pixel coordinate, for retrieving the letter, word,
-and sentence at, before, or after a given position in the text. This interface
-provides support for retrieving the attributes of the character at a given
-position in the text (font, font size, style, etc.), as well as getting
-the selected text (if any), the length of the text, and the location of
-the text caret.
-
-<P>Applications can determine if an object supports the AccessibleText
-interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
-(see <A HREF="#Accessible">Accessible</A>) and then calling the <code>getAccessibleText</code>
-method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
-value is not null, the object supports this interface.
-<H3><A NAME="AccessibleHypertext"></A>
-<A HREF="AccessibleHypertext.html">Interface AccessibleHypertext</A></H3>
-The <A HREF="AccessibleHypertext.html">AccessibleHypertext</A> interface
-should be supported by any object that presents hypertext information on
-the display. This interface provides the standard mechanism for an assistive
-technology to access that text via its content, attributes, and spatial
-location. It also provides standard mechanisms for manipulating <A HREF="#AccessibleHyperlink">hyperlinks</A>.
-Applications can determine if an object supports the AccessibleHypertext
-interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
-(see <A HREF="#Accessible">Accessible</A>) and then calling the AccessibleContext.getAccessibleText()
-method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
-value is a class which extends AccessibleHypertext, then that object supports
-AccessibleHypertext.
-<H3>
-<A NAME="AccessibleHyperlink"></A><A HREF="AccessibleHyperlink.html">Interface
-AccessibleHyperlink</A></H3>
-An object that is a hyperlink should support the <A HREF="AccessibleHyperlink.html">AccessibleHyperlink</A>
-interface.&nbsp; An object that implements this interface will be returned
-by calling the getLink method on an <A HREF="#AccessibleHypertext">AccessibleHypertext</A>
-object.
-<H3>
-<A NAME="AccessibleValue"></A><A HREF="AccessibleValue.html">Interface
-AccessibleValue</A></H3>
-The <A HREF="AccessibleValue.html">AccessibleValue</A> interface should
-be supported by any object that supports a numerical value (e.g., a scroll
-bar). This interface provides the standard mechanism for an assistive technology
-to determine and set the numerical value as well as get the minimum and
-maximum values.
-
-<P>Applications can determine if an object supports the AccessibleValue
-interface by first obtaining its <A HREF="#AccessibleContext">AccessibleContext</A>
-(see <A HREF="#Accessible">Accessible</A>) and then calling the <code>getAccessibleValue</code>
-method of <A HREF="#AccessibleContext">AccessibleContext</A>. If the return
-value is not null, the object supports this interface.
-
-@since 1.2
-</BODY>
-</HTML>
-
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/event/package-info.java b/jdk/src/java.desktop/share/classes/javax/imageio/event/package-info.java
new file mode 100644
index 0000000..2c2ebcf
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/event/package-info.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * A package of the Java Image I/O API dealing with synchronous notification of
+ * events during the reading and writing of images.
+ * <p>
+ * The {@code IIOReadProgressListener} interface allows for notification of the
+ * percentage of an image that has been read successfully.
+ * <p>
+ * The {@code IIOReadUpdateListener} interface allows for notification of the
+ * portions of an image that have been read. This is useful, for example, for
+ * implementing dynamic display of an image as it is loaded.
+ * <p>
+ * The {@code IIOReadWarningListener} interface allows for notification of
+ * non-fatal errors during reading.
+ * <p>
+ * The {@code IIOWriteWarningListener} and {@code IIOWriteProgressListener}
+ * interfaces perform analogous functions for writers.
+ *
+ * @since 1.4
+ */
+package javax.imageio.event;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/event/package.html b/jdk/src/java.desktop/share/classes/javax/imageio/event/package.html
deleted file mode 100644
index 000ab8b..0000000
--- a/jdk/src/java.desktop/share/classes/javax/imageio/event/package.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-
-<body bgcolor="white">
-
-A package of the Java Image I/O API dealing with synchronous
-notification of events during the reading and writing of images.
-
-<p>
-
-The <code>IIOReadProgressListener</code> interface allows for
-notification of the percentage of an image that has been read
-successfully.
-
-<p>
-
-The <code>IIOReadUpdateListener</code> interface allows for
-notification of the portions of an image that have been read.  This is
-useful, for example, for implementing dynamic display of an image as
-it is loaded.
-
-<p>
-
-The <code>IIOReadWarningListener</code> interface allows for
-notification of non-fatal errors during reading.
-
-<p>
-
-The <code>IIOWriteWarningListener</code> and
-<code>IIOWriteProgressListener</code> interfaces perform analogous
-functions for writers.
-
-@since 1.4
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java
index c9ac737..08f3127 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java
@@ -28,7 +28,6 @@
 import org.w3c.dom.Node;
 
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/package-info.java b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/package-info.java
new file mode 100644
index 0000000..e9d75bc
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/package-info.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * A package of the Java Image I/O API dealing with reading and writing
+ * metadata.
+ * <p>
+ * When reading an image, its per-stream and per-image metadata is made
+ * available as an {@code IIOMetadata} object. The internals of this object are
+ * specific to the plug-in that created it. Its contents may be accessed in the
+ * form of an XML {@code Document}, which is implemented as a tree of
+ * {@code IIOMetadataNode} objects.
+ * <p>
+ * When writing an image, its metadata may be set by defining or modifying an
+ * {@code IIOMetadata} object. Such an object may be obtained from an
+ * {@code ImageWriter} or {@code ImageTranscoder} (from the
+ * {@code javax.imageio} package). Once such an object has been obtained, its
+ * contents may be set of modified via a {@code Document} consisting of
+ * {@code IIOMetadataNode}s. The document format may optionally be described
+ * using an {@code IIOMetadataFormat} object.
+ * <p>
+ * The format of the metadata contained in the XML {@code Document} is
+ * identified by a string which appears as the root node of the tree of
+ * {@code IIOMetadataNode} objects. This string contains a version number, e.g.
+ * "javax_imageio_jpeg_image_1.0". Readers and writers may support multiple
+ * versions of the same basic format and the Image I/O API has methods that
+ * allow specifying which version to use by passing the string to the
+ * method/constructor used to obtain an {@code IIOMetadata} object. In some
+ * cases, a more recent version may not be strictly compatible with a program
+ * written expecting an older version (for an example, see the Native Metadata
+ * Format section of the JPEG Metadata Usage Notes below).
+ * <p>
+ * Plug-ins may choose to support a
+ * <A HREF="doc-files/standard_metadata.html">standard (plug-in neutral) format
+ * </A>. This format does not provide lossless encoding of metadata, but allows
+ * a portion of the metadata to be accessed in a generic manner.
+ * <p>
+ * Each of the standard plug-ins supports a so-called "native" metadata format,
+ * which encodes its metadata losslessly:
+ * <ul>
+ *     <li><A HREF="doc-files/bmp_metadata.html">BMP metadata</A></li>
+ *     <li><A HREF="doc-files/gif_metadata.html">GIF metadata</A></li>
+ *     <li><A HREF="doc-files/jpeg_metadata.html">JPEG metadata</A></li>
+ *     <li><A HREF="doc-files/png_metadata.html">PNG metadata</A></li>
+ *     <li><A HREF="doc-files/tiff_metadata.html#StreamMetadata">
+ *         TIFF metadata</A></li>
+ *     <li><A HREF="doc-files/wbmp_metadata.html">WBMP metadata</A></li>
+ * </ul>
+ * @since 1.4
+ */
+package javax.imageio.metadata;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/package.html b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/package.html
deleted file mode 100644
index da36948..0000000
--- a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/package.html
+++ /dev/null
@@ -1,119 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-
-<body bgcolor="white">
-
-A package of the Java Image I/O API dealing with reading and writing
-metadata.
-
-<p>
-
-When reading an image, its per-stream and per-image metadata is made
-available as an <code>IIOMetadata</code> object.  The internals of
-this object are specific to the plug-in that created it.  Its contents
-may be accessed in the form of an XML <code>Document</code>, which is
-implemented as a tree of <code>IIOMetadataNode</code> objects.
-
-<p>
-
-When writing an image, its metadata may be set by defining or
-modifying an <code>IIOMetadata</code> object.  Such an object may be
-obtained from an <code>ImageWriter</code> or
-<code>ImageTranscoder</code> (from the
-<code>javax.imageio</code> package).  Once such an object has
-been obtained, its contents may be set of modified via a
-<code>Document</code> consisting of <code>IIOMetadataNode</code>s.
-The document format may optionally be described using an
-<code>IIOMetadataFormat</code> object.
-
-<p>
-
-The format of the metadata contained in the XML <code>Document</code>
-is identified by a string which appears as the root node of the tree
-of <code>IIOMetadataNode</code> objects.  This string contains a version
-number, e.g. "javax_imageio_jpeg_image_1.0".  Readers and writers may
-support multiple versions of the same basic format and the Image I/O
-API has methods that allow specifying which version to use by passing
-the string to the method/constructor used to obtain an <code>IIOMetadata</code>
-object.  In some cases, a more recent version may not be strictly
-compatible with a program written expecting an older version (for
-an example, see the Native Metadata Format section of the JPEG Metadata
-Usage Notes below).
-
-<p>
-
-Plug-ins may choose to support a <A
-HREF="doc-files/standard_metadata.html">standard (plug-in neutral)
-format</A>.  This format does not provide lossless encoding of
-metadata, but allows a portion of the metadata to be accessed in a
-generic manner.
-
-<p>
-
-Each of the standard plug-ins supports a so-called "native" metadata
-format, which encodes its metadata losslessly:
-
-<ul>
-<li>
-<A HREF="doc-files/bmp_metadata.html">
-BMP metadata
-</A>
-
-<li>
-<A HREF="doc-files/gif_metadata.html">
-GIF metadata
-</A>
-
-<li>
-<A HREF="doc-files/jpeg_metadata.html">
-JPEG metadata
-</A>
-
-<li>
-<A HREF="doc-files/png_metadata.html">
-PNG metadata
-</A>
-
-<li>
-<A HREF="doc-files/tiff_metadata.html#StreamMetadata">
-TIFF metadata
-</A>
-
-<li>
-<A HREF="doc-files/wbmp_metadata.html">
-WBMP metadata
-</A>
-
-</ul>
-
-@since 1.4
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/package-info.java b/jdk/src/java.desktop/share/classes/javax/imageio/package-info.java
new file mode 100644
index 0000000..342a6af
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/package-info.java
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * The main package of the Java Image I/O API.
+ * <p>
+ * Many common image I/O operations may be performed using the static methods of
+ * the {@code ImageIO} class.
+ * <p>
+ * This package contains the basic classes and interfaces for describing the
+ * contents of image files, including metadata and thumbnails
+ * ({@code IIOImage}); for controlling the image reading process
+ * ({@code ImageReader}, {@code ImageReadParam}, and {@code ImageTypeSpecifier})
+ * and image writing process ({@code ImageWriter} and {@code ImageWriteParam});
+ * for performing transcoding between formats ({@code ImageTranscoder}), and for
+ * reporting errors ({@code IIOException}).
+ * <p>
+ * All implementations of javax.imageio provide the following standard image
+ * format plug-ins:
+ * <div>
+ * <table border=1 cellpadding=5 style="margin: 0px auto;" summary="Standard
+ * image format plug-ins">
+ *     <tr>
+ *         <th>&nbsp;</th><th>Reading</th><th>Writing</th><th>Notes</th>
+ *         <th>Metadata</th>
+ *     </tr>
+ *
+ * <!-- BMP plugin -->
+ *     <tr>
+ *         <td><a href="https://msdn.microsoft.com/en-us/library/dd183391.aspx">
+ *         BMP</a></td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>none</td>
+ *         <td align='center'><a href='metadata/doc-files/bmp_metadata.html'>BMP
+ *         metadata format</a></td>
+ *     </tr>
+ *
+ * <!-- GIF plugin -->
+ *     <tr>
+ *         <td><a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF</a>
+ *         </td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'><a href="#gif_plugin_notes">GIF plug-in notes</a>
+ *         </td>
+ *         <td align='center'><a href='metadata/doc-files/gif_metadata.html'>GIF
+ *         metadata format</a></td>
+ *     </tr>
+ *
+ * <!-- JPEG plugin -->
+ *     <tr>
+ *         <td><a href="http://www.jpeg.org">JPEG</a></td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>none</td>
+ *         <td align='center'><a href='metadata/doc-files/jpeg_metadata.html'>
+ *         JPEG metadata format</a></td>
+ *     </tr>
+ *
+ * <!-- PNG plugin -->
+ *     <tr>
+ *         <td><a href="http://www.libpng.org/pub/png/spec/">PNG</a></td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>none</td>
+ *         <td align='center'><a href='metadata/doc-files/png_metadata.html'>PNG
+ *         metadata format</a></td>
+ *     </tr>
+ *
+ * <!-- TIFF plugin -->
+ *     <tr>
+ *         <td><a href="https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf">
+ *         TIFF</a></td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'><a href='metadata/doc-files/tiff_metadata.html#Reading'>
+ *         TIFF plug-in notes</a></td>
+ *         <td align='center'><a href='metadata/doc-files/tiff_metadata.html#StreamMetadata'>
+ *         TIFF metadata format</a></td>
+ *     </tr>
+ *
+ * <!-- WBMP plugin -->
+ *     <tr>
+ *         <td><a href="http://www.wapforum.org/what/technical/SPEC-WAESpec-19990524.pdf">
+ *         WBMP</a></td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>yes</td>
+ *         <td align='center'>none</td>
+ *         <td align='center'><a href='metadata/doc-files/wbmp_metadata.html'>
+ *         WBMP metadata format</a></td>
+ *     </tr>
+ * </table>
+ * </div>
+ * <BR>
+ * <BR>
+ * <BR>
+ *
+ * <h2> Standard Plug-in Notes</h2>
+ *
+ * <h3><a name="gif_plugin_notes">Standard plug-in for GIF image format</a></h3>
+ * ImageIO provides {@code ImageReader} and {@code ImageWriter}plug-ins for the
+ * <a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt"> Graphics
+ * Interchange Format (GIF)</a> image format. These are the "standard" GIF
+ * plug-ins, meaning those that are included in the JRE, as distinct from those
+ * included in standard extensions, or 3rd party plug-ins. The following notes
+ * and metadata specification apply to the standard plug-ins.
+ *
+ * <h3>Writing GIF images</h3>
+ * The GIF image writer plug-in guarantees lossless writing for images which
+ * meet the following requirements:
+ * <ul>
+ *     <li>the number of bands is 1;</li>
+ *     <li>the number of bits per sample is not greater than 8;</li>
+ *     <li>the size of a color component is not greater than 8;</li>
+ * </ul>
+ * <p>
+ * By default the GIF writer plug-in creates version "89a" images. This can be
+ * changed to "87a" by explicitly setting the version in the stream metadata
+ * (see
+ * <a href="metadata/doc-files/gif_metadata.html#gif_stream_metadata_format">
+ * GIF Stream Metadata Format Specification</a>).
+ *
+ * <!-- animated images -->
+ * <p>
+ * The GIF writer plug-in supports the creation of animated GIF images through
+ * the standard sequence writing methods defined in the {@code ImageWriter}
+ * class.
+ *
+ * <!-- TODO: add example here -->
+ *
+ * <!--  color tables -->
+ * <p>
+ * A global color table is written to the output stream if one of the following
+ * conditions is met:
+ * <ul>
+ *     <li>stream metadata containing a GlobalColorTable element is supplied;
+ *     </li>
+ *     <li>a sequence is being written and image metadata containing a
+ *     LocalColorTable element is supplied for the first image in the sequence;
+ *     </li>
+ *     <li>image metadata is not supplied or does not contain a LocalColorTable
+ *     element.</li>
+ * </ul>
+ * <p>
+ * In the first case the global color table in the stream metadata is used, in
+ * the second the local color table in the image metadata is used, and in the
+ * third a global color table is created from the ColorModel or SampleModel of
+ * the (first) image.
+ * <p>
+ * A local color table is written to the output stream only if image metadata
+ * containing a LocalColorTable element is supplied to the writer, or no image
+ * metadata is supplied to the writer and the local color table which would be
+ * generated from the image itself is not equal to the global color table.
+ * <p>
+ * A Graphic Control Extension block is written to the output stream only if
+ * image metadata containing a GraphicControlExtension element is supplied to
+ * the writer, or no image metadata is supplied and the local color table
+ * generated from the image requires a transparent index. Application, Plain
+ * Text, and Comment Extension blocks are written only if they are supplied to
+ * the writer via image metadata.
+ *
+ * <!-- writing interlaced images -->
+ * <p>
+ * The writing of interlaced images can be controlled by the progressive mode of
+ * the provided {@code ImageWriteParam} instance. If progressive mode is
+ * {@code MODE_DISABLED} then a non-interlaced image will be written. If
+ * progressive mode is {@code MODE_DEFAULT} then an interlaced image will be
+ * written. If progressive mode is {@code MODE_COPY_FROM_METADATA}, then the
+ * metadata setting is used (if it is provided, otherwise an interlaced image
+ * will be written).
+ * <p>
+ * The GIF image writer plug-in supports setting output stream metadata from
+ * metadata supplied to the writer in either the native GIF stream metadata
+ * format
+ * <a href="metadata/doc-files/gif_metadata.html#gif_stream_metadata_format">
+ * javax_imageio_gif_stream_1.0</a> or the standard metadata format
+ * <a href="metadata/doc-files/standard_metadata.html">javax_imageio_1.0</a>,
+ * and setting output image metadata from metadata supplied to the writer in
+ * either the native GIF image metadata format
+ * <a href="metadata/doc-files/gif_metadata.html#gif_image_metadata_format">
+ * javax_imageio_gif_image_1.0</a> or the standard metadata format
+ * <a href="metadata/doc-files/standard_metadata.html">javax_imageio_1.0</a>.
+ * The mapping of standard metadata format to the GIF native stream and image
+ * metadata formats is given in the tables
+ * <a href="metadata/doc-files/gif_metadata.html#mapping">here</a>.
+ *
+ * @since 1.4
+ */
+package javax.imageio;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/package.html b/jdk/src/java.desktop/share/classes/javax/imageio/package.html
deleted file mode 100644
index 63d6dcf..0000000
--- a/jdk/src/java.desktop/share/classes/javax/imageio/package.html
+++ /dev/null
@@ -1,253 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-
-<body bgcolor="white">
-
-The main package of the Java Image I/O API.
-
-<p>
-
-Many common image I/O operations may be performed using the static
-methods of the <code>ImageIO</code> class.
-
-<p>
-
-This package contains the basic classes and interfaces for describing
-the contents of image files, including metadata and thumbnails
-(<code>IIOImage</code>); for controlling the image reading process
-(<code>ImageReader</code>, <code>ImageReadParam</code>, and
-<code>ImageTypeSpecifier</code>) and image writing process
-(<code>ImageWriter</code> and <code>ImageWriteParam</code>); for
-performing transcoding between formats (<code>ImageTranscoder</code>),
-and for reporting errors (<code>IIOException</code>).
-
-<p>
-All implementations of javax.imageio provide the following standard
-image format plug-ins:
-</p>
-<div>
-<table border=1 align='center' cellpadding=5>
-<tr>
-    <th>&nbsp;</th> <th>Reading</th> <th>Writing</th>
-    <th>Notes</th> <th>Metadata</th>
-</tr>
-<!-- BMP plugin -->
-<tr>
-    <td><a href="https://msdn.microsoft.com/en-us/library/dd183391.aspx">BMP</a></td>
-    <td align='center'>yes</td>
-    <td align='center'>yes</td>
-    <td align='center'>none</td>
-    <td align='center'><a href='metadata/doc-files/bmp_metadata.html'>
-    BMP metadata format</a></td>
-</tr>
-<!-- GIF plugin -->
-<tr>
-    <td><a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF</a></td>
-    <td align='center'>yes</td>
-    <td align='center'>yes</td>
-    <td align='center'><a href="#gif_plugin_notes">
-    GIF plug-in notes</a></td>
-    <td align='center'><a href='metadata/doc-files/gif_metadata.html'>
-    GIF metadata format</a></td>
-</tr>
-<!-- JPEG plugin -->
-<tr>
-    <td> <a href="http://www.jpeg.org">JPEG</a></td>
-    <td align='center'>yes</td>
-    <td align='center'>yes</td>
-    <td align='center'>none</td>
-    <td align='center'><a href='metadata/doc-files/jpeg_metadata.html'>
-    JPEG metadata format</a></td>
-</tr>
-<!-- PNG plugin -->
-<tr>
-    <td><a href="http://www.libpng.org/pub/png/spec/">PNG</a></td>
-    <td align='center'>yes</td>
-    <td align='center'>yes</td>
-    <td align='center'>none</td>
-    <td align='center'><a href='metadata/doc-files/png_metadata.html'>
-    PNG metadata format</a></td>
-</tr>
-<!-- TIFF plugin -->
-<tr>
-    <td><a href="https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf">TIFF</a></td>
-    <td align='center'>yes</td>
-    <td align='center'>yes</td>
-    <td align='center'><a href='metadata/doc-files/tiff_metadata.html#Reading'>
-    TIFF plug-in notes</td>
-    <td align='center'><a href='metadata/doc-files/tiff_metadata.html#StreamMetadata'>
-    TIFF metadata format</a></td>
-</tr>
-<!-- WBMP plugin -->
-<tr>
-    <td><a href="http://www.wapforum.org/what/technical/SPEC-WAESpec-19990524.pdf">WBMP</a></td>
-    <td align='center'>yes</td>
-    <td align='center'>yes</td>
-    <td align='center'>none</td>
-    <td align='center'><a href='metadata/doc-files/wbmp_metadata.html'>
-    WBMP metadata format</a></td>
-</tr>
-</table>
-</div>
-<BR>
-<BR>
-<BR>
-
-<h2> Standard Plug-in Notes</h2>
-<h3><a name="gif_plugin_notes">Standard plug-in for GIF image format</a></h3>
-
-
-<p>
-ImageIO provides <code>ImageReader</code> and <code>ImageWriter</code>
-plug-ins for the <a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">
-Graphics Interchange Format (GIF)</a> image format.
-
-These are the "standard" GIF plug-ins, meaning those that are included in the
-JRE, as distinct from those included in standard extensions, or 3rd party
-plug-ins. The following notes and metadata specification apply to the
-standard plug-ins.
-
-<h3>Writing GIF images</h3>
- The GIF image writer plug-in guarantees lossless writing for images which meet
- the following requirements:
-<ul>
-<li>the number of bands is 1;
-<li>the number of bits per sample is not greater than 8;
-<li>the size of a color component is not greater than 8;
-</ul>
-
-<p>
- By default the GIF writer plug-in creates version "89a" images. This can be
- changed to "87a" by explicitly setting the version in the
- stream metadata (see <a
- href="metadata/doc-files/gif_metadata.html#gif_stream_metadata_format">
- GIF Stream Metadata Format Specification</a>).
-</p> 
- 
- 
-<!-- animated images -->
-<p>
- The GIF writer plug-in supports the creation of animated GIF images through
- the standard sequence writing methods defined in the
- <code>ImageWriter</code> class.
- 
- <!-- TODO: add example here --> 
-</p>
- 
-<!--  color tables -->
-<p>
- A global color table is written to the output stream if one of the
- following conditions is met:
- <ul>
- <li> stream metadata containing a GlobalColorTable element is
-  supplied; </li>
- <li> a sequence is being written and image metadata containing a
-  LocalColorTable element is supplied for the first image in the
-  sequence;</li>
- <li>image metadata is not supplied or does not contain a LocalColorTable
-  element. </li>
- </ul>
- 
- <p>
- In the first case the global color table in the stream metadata is
-  used, in the second the local color table in the image metadata is
-  used, and in the third a global color table is created from the
-  ColorModel or SampleModel of the (first) image.
- </p>
- 
- <p>
- A local color table is written to the output stream only if image
-  metadata containing a LocalColorTable element is supplied to the
-  writer, or no image metadata is supplied to the writer and the local
-  color table which would be generated from the image itself is not
-  equal to the global color table.
- </p>
- 
- <p>
- A Graphic Control Extension block is written to the output stream only
-  if image metadata containing a GraphicControlExtension element is
-  supplied to the writer, or no image metadata is supplied and the
-  local color table generated from the image requires a transparent
-  index. Application, Plain Text, and Comment Extension blocks are
-  written only if they are supplied to the writer via image metadata. 
- 
- </p>
- 
- <!-- writing interlaced images -->
- <p>
- 
-  The writing of interlaced images can be controlled by the progressive
-  mode of the provided <code>ImageWriteParam</code> instance.
-  If progressive mode is
-  <code>MODE_DISABLED</code> then a non-interlaced image will be written. If
-  progressive mode is <code>MODE_DEFAULT</code> then an interlaced image will
-  be written. If progressive mode is <code>MODE_COPY_FROM_METADATA</code>, then
-  the metadata setting is used (if it is provided, otherwise an interlaced
-  image will be written).
- </p>
- 
- <p>
- The GIF image writer plug-in supports setting output stream metadata from
- metadata supplied to the writer in either the native GIF stream
- metadata format <a href="metadata/doc-files/gif_metadata.html#gif_stream_metadata_format">
- javax_imageio_gif_stream_1.0 </a> or the standard metadata format
- <a href="metadata/doc-files/standard_metadata.html">
- javax_imageio_1.0</a>, and setting
- output image metadata from metadata supplied to the writer in either
- the native GIF image metadata format <a href="metadata/doc-files/gif_metadata.html#gif_image_metadata_format">
- javax_imageio_gif_image_1.0 </a> or the standard metadata format
- <a href="metadata/doc-files/standard_metadata.html">javax_imageio_1.0</a>.
-  
- The mapping of standard metadata format to the GIF native stream and
- image metadata formats is given in the tables <a
- href="metadata/doc-files/gif_metadata.html#mapping"> here </a>.
- </p>
-
-
-<!--
-
-<HR>
-
-Java<SUP><FONT SIZE="-2">TM</FONT></SUP> Image I/O API Specification
-<BR>
-<BR>
-Public Draft 2 (specification version 0.5)
-<BR>
-Release: October 1, 2000
-<BR>
-<BR>
-
-<HR>
-
--->
-
-@since 1.4
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/bmp/package-info.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/bmp/package-info.java
new file mode 100644
index 0000000..d423a14
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/bmp/package-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Package containing the public classes used by the built-in BMP plug-in.
+ *
+ * @since 1.5
+ */
+package javax.imageio.plugins.bmp;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/bmp/package.html b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/bmp/package.html
deleted file mode 100644
index 36467da..0000000
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/bmp/package.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-
-<body bgcolor="white">
-
-Package containing the public classes used by the built-in BMP plug-in.
-
-@since 1.5
-
-</body>
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/jpeg/package-info.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/jpeg/package-info.java
new file mode 100644
index 0000000..cd43772
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/jpeg/package-info.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Classes supporting the built-in JPEG plug-in.
+ * <p>
+ * This package contains some support classes for the built-in JPEG reader and
+ * writer plug-ins. Classes are provided for representing quantization and
+ * Huffman tables, and extensions of {@code ImageReadParam} and
+ * {@code ImageWriteParam} are provided to supply tables during the reading and
+ * writing process. For more information about the operation of the built-in
+ * JPEG plug-ins, see the
+ * <a href="../../metadata/doc-files/jpeg_metadata.html">JPEG metadata format
+ * specification and usage notes</a>.
+ *
+ * @since 1.4
+ */
+package javax.imageio.plugins.jpeg;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/jpeg/package.html b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/jpeg/package.html
deleted file mode 100644
index 60d4e8e..0000000
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/jpeg/package.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-
-<body bgcolor="white">
-
-Classes supporting the built-in JPEG plug-in.
-
-<P>
-
-This package contains some support classes for the built-in JPEG
-reader and writer plug-ins.  Classes are provided for representing
-quantization and Huffman tables, and extensions of
-<code>ImageReadParam</code> and <code>ImageWriteParam</code> are
-provided to supply tables during the reading and writing process.  For
-more information about the operation of the built-in JPEG plug-ins,
-see the <A HREF="../../metadata/doc-files/jpeg_metadata.html">JPEG
-metadata format specification and usage notes</A>.
-
-<BR>
-<BR>
-<BR>
-
-<!--
-
-<HR>
-
-Java<SUP><FONT SIZE="-2">TM</FONT></SUP> Image I/O API Specification
-<BR>
-<BR>
-Public Draft 2 (specification version 0.5)
-<BR>
-Release: October 1, 2000
-<BR>
-<BR>
-
-<HR>
-
--->
-
-@since 1.4
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package-info.java b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package-info.java
new file mode 100644
index 0000000..80defcc
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package-info.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Public classes used by the built-in TIFF plug-ins.
+ * <p>
+ * This package contains classes supporting the built-in TIFF reader and writer
+ * plug-ins. Classes are provided for simplifying interaction with metadata,
+ * including Exif metadata common in digital photography, and an extension of
+ * {@link javax.imageio.ImageReadParam} which permits specifying which metadata
+ * tags are allowed to be read. For more information about the operation of the
+ * built-in TIFF plug-ins, see the
+ * <a HREF="../../metadata/doc-files/tiff_metadata.html">TIFF metadata format
+ * specification and usage notes</a>.
+ *
+ * @since 9
+ */
+package javax.imageio.plugins.tiff;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package.html b/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package.html
deleted file mode 100644
index 7c70425..0000000
--- a/jdk/src/java.desktop/share/classes/javax/imageio/plugins/tiff/package.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</head>
-
-<body bgcolor="white">
-Public classes used by the built-in TIFF plug-ins.
-
-<p>
-This package contains classes supporting the built-in TIFF reader and writer
-plug-ins. Classes are provided for simplifying interaction with metadata,
-including Exif metadata common in digital photography, and an extension of
-{@link javax.imageio.ImageReadParam} which permits specifying which metadata
-tags are allowed to be read. For more information about the operation of the
-built-in TIFF plug-ins, see the
-<a HREF="../../metadata/doc-files/tiff_metadata.html">TIFF metadata format
-specification and usage notes</a>.
-
-<br>
-<br>
-<br>
-
-@since 9
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java b/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java
index e5961b9..dc2f232 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java
@@ -28,7 +28,6 @@
 import java.io.IOException;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Arrays;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java b/jdk/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java
index 465f155..2df6e1b 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -706,7 +706,17 @@
      *
      * @exception Throwable if an error occurs during superclass
      * finalization.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     public void finalize() throws Throwable {
         deregisterAll();
         super.finalize();
@@ -846,6 +856,7 @@
         poset.clear();
     }
 
+    @SuppressWarnings("deprecation")
     public synchronized void finalize() {
         clear();
     }
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/spi/package-info.java b/jdk/src/java.desktop/share/classes/javax/imageio/spi/package-info.java
new file mode 100644
index 0000000..bdaf57c
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/spi/package-info.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * A package of the Java Image I/O API containing the plug-in interfaces for
+ * readers, writers, transcoders, and streams, and a runtime registry.
+ * <p>
+ * The {@code javax.imageio.spi} package contains service provider interfaces
+ * for reading, writing, and transcoding images, and obtaining image input and
+ * output streams, as well as a run-time registry that discovers installed
+ * instances of Image I/O service providers and allows new instances to be
+ * registered dynamically.
+ *
+ * @since 1.4
+ */
+package javax.imageio.spi;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/spi/package.html b/jdk/src/java.desktop/share/classes/javax/imageio/spi/package.html
deleted file mode 100644
index 404e0a6..0000000
--- a/jdk/src/java.desktop/share/classes/javax/imageio/spi/package.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-
-<body bgcolor="white">
-
-A package of the Java Image I/O API containing the plug-in interfaces
-for readers, writers, transcoders, and streams, and a runtime
-registry.
-
-<p>
-
-
-The <code>javax.imageio.spi</code> package contains service
-provider interfaces for reading, writing, and transcoding images, and
-obtaining image input and output streams, as well as a run-time registry
-that discovers installed instances of Image I/O service providers and allows new
-instances to be registered dynamically.
-
-@since 1.4
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java b/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java
index f354f7a..e597490 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -260,7 +260,17 @@
 
     /**
      * {@inheritDoc}
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     protected void finalize() throws Throwable {
         // Empty finalizer: for performance reasons we instead use the
         // Disposer mechanism for ensuring that the underlying
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java b/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java
index b712908..7ecc287 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -155,7 +155,17 @@
 
     /**
      * {@inheritDoc}
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     protected void finalize() throws Throwable {
         // Empty finalizer: for performance reasons we instead use the
         // Disposer mechanism for ensuring that the underlying
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java b/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java
index c76d09f..e75c403 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -163,7 +163,17 @@
 
     /**
      * {@inheritDoc}
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     protected void finalize() throws Throwable {
         // Empty finalizer: for performance reasons we instead use the
         // Disposer mechanism for ensuring that the underlying
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java b/jdk/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
index 3d17e27..c7cdc47 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -867,7 +867,17 @@
      *
      * @exception Throwable if an error occurs during superclass
      * finalization.
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     protected void finalize() throws Throwable {
         if (!isClosed) {
             try {
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java b/jdk/src/java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java
index 87774c1..4fcb0f4 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -178,7 +178,17 @@
 
     /**
      * {@inheritDoc}
+     *
+     * @deprecated The {@code finalize} method has been deprecated.
+     *     Subclasses that override {@code finalize} in order to perform cleanup
+     *     should be modified to use alternative cleanup mechanisms and
+     *     to remove the overriding {@code finalize} method.
+     *     When overriding the {@code finalize} method, its implementation must explicitly
+     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
+     *     See the specification for {@link Object#finalize()} for further
+     *     information about migration options.
      */
+    @Deprecated(since="9")
     protected void finalize() throws Throwable {
         // Empty finalizer: for performance reasons we instead use the
         // Disposer mechanism for ensuring that the underlying
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/stream/package-info.java b/jdk/src/java.desktop/share/classes/javax/imageio/stream/package-info.java
new file mode 100644
index 0000000..b28caf0
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/stream/package-info.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * A package of the Java Image I/O API dealing with low-level I/O from files and
+ * streams.
+ * <p>
+ * The {@code ImageInputStream} interface unifies streaming and file-based
+ * operations. An abstract base class, {@code ImageInputStreamImpl} is provided
+ * to simplify writing a new {@code ImageInputStream} class. Concrete
+ * implementation classes ({@code FileImageInputStream},
+ * {@code FileCacheImageInputStream}, and {@code MemoryCacheImageInputStream})
+ * are provided that allow input to come from a {@code File} or
+ * {@code InputStream} with or without the use of a temporary cache file.
+ * <p>
+ * The {@code ImageOutputStream} interface performs an analogous function for
+ * output. An abstract base class, {@code ImageOutputStreamImpl} is provided,
+ * along with concrete implementation classes ({@code FileImageOutputStream},
+ * {@code FileCacheImageOutputStream}, and {@code MemoryCacheImageOutputStream})
+ * are provided that allow output to go to a {@code File} or
+ * {@code OutputStream} with or without the use of a temporary cache file.
+ * <p>
+ * The {@code IIOByteBuffer} class provides an alternative way to perform reads
+ * of sequences of bytes that reduces the amount of internal data copying.
+ *
+ * @since 1.4
+ */
+package javax.imageio.stream;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/stream/package.html b/jdk/src/java.desktop/share/classes/javax/imageio/stream/package.html
deleted file mode 100644
index 41f84b8..0000000
--- a/jdk/src/java.desktop/share/classes/javax/imageio/stream/package.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-
-<body bgcolor="white">
-
-A package of the Java Image I/O API dealing with low-level I/O from
-files and streams.
-
-<p>
-
-The <code>ImageInputStream</code> interface unifies streaming and
-file-based operations.  An abstract base class,
-<code>ImageInputStreamImpl</code> is provided to simplify writing
-a new <code>ImageInputStream</code> class.  Concrete implementation
-classes (<code>FileImageInputStream</code>,
-<code>FileCacheImageInputStream</code>, and
-<code>MemoryCacheImageInputStream</code>) are provided that allow
-input to come from a <code>File</code> or <code>InputStream</code>
-with or without the use of a temporary cache file.
-
-<p>
-
-The <code>ImageOutputStream</code> interface performs an analogous
-function for output.  An abstract base class,
-<code>ImageOutputStreamImpl</code> is provided, along with
-concrete implementation classes (<code>FileImageOutputStream</code>,
-<code>FileCacheImageOutputStream</code>, and
-<code>MemoryCacheImageOutputStream</code>) are provided that allow
-output to go to a <code>File</code> or <code>OutputStream</code> with
-or without the use of a temporary cache file.
-
-<p>
-
-The <code>IIOByteBuffer</code> class provides an alternative way to
-perform reads of sequences of bytes that reduces the amount of
-internal data copying.
-
-@since 1.4
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/package-info.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/package-info.java
new file mode 100644
index 0000000..f9c571f
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/package-info.java
@@ -0,0 +1,376 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interfaces that describe the types of Java&trade; Print
+ * Service attributes and how they can be collected into attribute sets.
+ *
+ * <h3>What is an Attribute?</h3>
+ * When setting up a print job, a client specifies two things: <b>print data</b>
+ * and <b>processing instructions.</b> The print data is the actual content to
+ * be printed. The processing instructions tell the printer how to print the
+ * print data, such as: what media to use, how many copies to print, and whether
+ * to print on one or both sides of a sheet. The client specifies these
+ * processing instructions with the attribute definitions of the Java Print
+ * Service API.
+ * <p>
+ * The print data and the processing instructions are separate entities. This
+ * means that:
+ * <ul>
+ *     <li>You can print the same print data at different times using different
+ *     processing instructions.<br>For example, you can print a slide
+ *     presentation on US letter-sized white paper, double-sided, stapled, 20
+ *     copies to make handouts for a talk; and you could print the same slide
+ *     presentation on US letter-sized transparencies, single-sided, one copy to
+ *     make the actual slides for the talk.</li>
+ *     <li>You can use the same processing instructions at different times to
+ *     print different data. For example, you could set your default processing
+ *     instructions to: US letter-sized paper, double sided, stapled. Whenever
+ *     you print a job, it prints with these settings, unless you explicitly
+ *     override them.</li>
+ * </ul>
+ * <p>
+ * The processing instruction does not specify how the print job processes the
+ * request; each processing instruction is only a description of the results of
+ * a print job. The print job determines the manner in which it achieves the
+ * results specified by the processing instructions. Representing processing
+ * instructions as descriptive items provides more flexibility for implementing
+ * print jobs.
+ *
+ * <h4>Attribute Categories and Values</h4>
+ * Each printer has a set of capabilities, such as the ability to print on
+ * different paper sizes or the ability to print more than one copy. Each of the
+ * capabilities has a range of values. For example, a printer's orientation
+ * capability might have this range of values: [landscape, portrait]. For each
+ * print request, the capability is set to one of these values. The Java Print
+ * Service API uses the term <b>attribute category</b> to refer to a printer
+ * capability and the term <b>attribute value</b> to refer to the value of the
+ * capability.
+ * <p>
+ * In the Java Print Service API, an attribute category is represented by a Java
+ * class implementing the <a href="Attribute.html">Attribute</a> interface.
+ * Attribute values are instances of such a class or one of its subclasses. For
+ * example, to specify the number of copies, an application constructs an
+ * instance of the <a href="standard/Copies.html">Copies</a> class with the
+ * number of desired copies and uses the {@code Copies} instance as part of the
+ * print request. In this case, the {@code Copies} class represents the
+ * attribute category, and the {@code Copies} instance represents the attribute
+ * value.
+ *
+ * <h4><a name="role"></a>Attribute Roles</h4>
+ * When submitting a print job to a printer, the client provides the attributes
+ * describing the characteristics of the print data, such as the document name,
+ * and how the print data should be printed, such as double-sided, five copies.
+ * If a print job consists of multiple pieces of print data, different pieces
+ * might have different processing instructions, such as 8 x 11 inch media for
+ * the first document, and 11 x 17 inch media for another document.
+ * <p>
+ * Once the printer starts processing the print job, additional information
+ * about the job becomes available, which might include: the job state (such as
+ * <i>completed</i> or <i>queued</i>) and the number of pages printed so far.
+ * These pieces of information are also attributes. Attributes can also describe
+ * the printer itself, such as: the printer name, the printer location, and the
+ * number of jobs queued.
+ * <p>
+ * The Java Print Service API defines these different kinds of attributes with
+ * five subinterfaces of {@code Attribute}:
+ * <ul>
+ *     <li><a href="DocAttribute.html">DocAttribute</a> specifies a
+ *     characteristic of an individual document and the print job settings to be
+ *     applied to an individual document.</li>
+ *     <li><a href="PrintRequestAttribute.html">PrintRequestAttribute</a>
+ *     specifies a setting applied to a whole print job and to all the documents
+ *     in the print job.</li>
+ *     <li><a href="PrintJobAttribute.html">PrintJobAttribute</a> reports the
+ *     status of a print job.</li>
+ *     <li><a href="PrintServiceAttribute.html">PrintServiceAttribute</a>
+ *     reports the status of a print service.</li>
+ *     <li><a href="SupportedValuesAttribute.html">SupportedValuesAttribute</a>
+ *     gives the supported values for another attribute.</li>
+ * </ul>
+ * Each attribute class implements one or more of these tagging subinterfaces to
+ * indicate where the attribute can be used in the API. If an attribute class
+ * implements multiple tagging subinterfaces, the attribute can be used in
+ * multiple contexts. For example, the media attribute can apply to one document
+ * in a print job as a {@code DocAttribute} or to an entire print job as a
+ * {@code PrintRequestAttribute}. Certain low-level attributes are never used on
+ * their own but are always aggregated into higher-level attributes. These
+ * low-level attribute classes only implement interface
+ * <a href="Attribute.html">Attribute</a>, not any of the tagging subinterfaces.
+ * <p>
+ * The Java Print Service API defines a group of standard attribute classes
+ * modeled upon the attributes in the Internet Printing Protocol (IPP) version
+ * 1.1. The standard attribute classes are in the subpackage
+ * javax.print.attribute.standard to keep the actual attribute classes
+ * conceptually separate from the generic apparatus defined in package
+ * javax.print.attribute.
+ *
+ * <h3>Attribute Sets</h3>
+ * A client usually needs to provide more than one processing instruction when
+ * submitting a print job. For example, the client might need to specify a
+ * media size of A4 and a landscape orientation. To send more than one
+ * processing instruction, the client collects the attributes into an attribute
+ * set, which the Java Print Service API represents with the
+ * <a href="AttributeSet.html">AttributeSet</a> interface.
+ * <p>
+ * The {@code AttributeSet} interface is similar to the
+ * <a href="../../../java/util/Map.html">Map</a> interface: it provides a map of
+ * key to values, in which each key is unique and can contain no more than one
+ * value. However, the {@code AttributeSet} interface is designed to
+ * specifically support the needs of the Java Print Service API. An {@code
+ * AttributeSet} requires that:
+ * <ol type=1>
+ *     <li>Each key in an {@code AttributeSet} corresponds to a category, and
+ *     the value of the key can only be  one of the attribute values that belong
+ *     to the category represented by the key. Thus, unlike a {@code Map}, an
+ *     {@code AttributeSet} restricts the possible values of a key: an attribute
+ *     category cannot be set to an attribute value that does not belong to that
+ *     category.</li>
+ *     <li>No two attributes from the same category can exist in the same set.
+ *     For example, an attribute collection must not contain both a "one-sided"
+ *     attribute and a "two-sided" attribute because these two attributes give
+ *     the printer conflicting instructions.</li>
+ *     <li>Only attributes implementing the {@code Attribute} interface can be
+ *     added to the set.</li>
+ * </ol>
+ * <p>
+ * The javax.print.attribute package includes
+ * <a href="HashAttributeSet.html">HashAttributeSet</a> as a concrete
+ * implementation of the attribute set interface. {@code HashAttributeSet}
+ * provides an attribute set based on a hash map. You can use this
+ * implementation or provide your own implementation of interface
+ * {@code AttributeSet}.
+ * <p>
+ * The Java Print Service API provides four specializations of an attribute set
+ * that are restricted to contain just one of the four kinds of attributes, as
+ * discussed in the <a href="#role">Attribute Roles</a> section:
+ * <ul>
+ *     <li><a href="DocAttributeSet.html">DocAttributeSet</a></li>
+ *     <li><a href="PrintRequestAttributeSet.html">
+ *         PrintRequestAttributeSet</a></li>
+ *     <li><a href="PrintJobAttributeSet.html">
+ *         PrintJobAttributeSet</a></li>
+ *     <li><a href="PrintServiceAttributeSet.html">
+ *         PrintServiceAttributeSet</a></li>
+ * </ul>
+ * Notice that only four kinds of attribute sets are listed here, but there are
+ * five kinds of attributes. Interface
+ * <a href="SupportedValuesAttribute.html">SupportedValuesAttribute</a>
+ * denotes an attribute that gives the supported values for another attribute.
+ * Supported-values attributes are never aggregated into attribute sets, so
+ * there is no attribute set subinterface defined for them.
+ * <p>
+ * In some contexts, an attribute set is read-only, which means that the client
+ * is only allowed to examine an attribute set's contents but not change them.
+ * In other contexts, the attribute set is read-write, which means that the
+ * client is allowed both to examine and to change an attribute set's contents.
+ * For a read-only attribute set, calling a mutating operation throws an
+ * {@code UnmodifiableSetException}.
+ * <p>
+ * Package javax.print.attribute includes one concrete implementation of each of
+ * the attribute set subinterfaces:
+ * <ul>
+ *     <li><a href="HashDocAttributeSet.html">
+ *         HashDocAttributeSet</a></li>
+ *     <li><a href="HashPrintRequestAttributeSet.html">
+ *         HashPrintRequestAttributeSet</a>,</li>
+ *     <li><a href="HashPrintJobAttributeSet.html">
+ *         HashPrintJobAttributeSet</a>,</li>
+ *     <li><a href="HashPrintServiceAttributeSet.html">
+ *         HashPrintServiceAttributeSet</a>.</li>
+ * </ul>
+ * All of these classes extend
+ * <a href="HashAttributeSet.html">HashAttributeSet</a> and enforce the
+ * restriction that the attribute set is only allowed to contain the
+ * corresponding kind of attribute.
+ *
+ * <h3>Attribute Class Design</h3>
+ * An attribute value is a small, atomic data item, such as an integer or an
+ * enumerated value. The Java Print Service API does not use primitive data
+ * types, such as int, to represent attribute values for these reasons:
+ * <ul>
+ *     <li>Primitive data types are not type-safe. For example, a compiler
+ *     should not allow a "copies" attribute value to be used for a "sides"
+ *     attribute.</li>
+ *     <li>Some attributes must be represented as a record of several values.
+ *     One example is printer resolution, which requires two numbers, such as
+ *     600 and 300 representing 600 x 300 dpi.</li>
+ * </ul>
+ * For type-safety and to represent all attributes uniformly, the Java Print
+ * Service API defines each attribute category as a class, such as class
+ * {@code Copies}, class <a href="standard/Sides.html">Sides</a>, and class
+ * <a href="standard/PrinterResolution.html">PrinterResolution</a>. Each
+ * attribute class wraps one or more primitive data items containing the
+ * attribute's value. Attribute set operations perform frequent comparisons
+ * between attribute category objects when adding attributes, finding existing
+ * attributes in the same category, and looking up an attribute given its
+ * category. Because an attribute category is represented by a class, fast
+ * attribute-value comparisons can be performed with the {@code Class.equals}
+ * method.
+ * <p>
+ * Even though the Java Print Service API includes a large number of different
+ * attribute categories, there are only a few different types of attribute
+ * values. Most attributes can be represented by a small number of data types,
+ * such as: integer values, integer ranges, text, or an enumeration of integer
+ * values. The type of the attribute value that a category accepts is called the
+ * attribute's abstract syntax. To provide consistency and reduce code
+ * duplication, the Java Print Service API defines abstract syntax classes to
+ * represent each abstract syntax, and these classes are used as the parent of
+ * standard attributes whenever possible. The abstract syntax classes are:
+ * <ul>
+ *     <li><a href="EnumSyntax.html">EnumSyntax</a> provides a type-safe
+ *     enumeration in which enumerated values are represented as singleton
+ *     objects. Each enumeration singleton is an instance of the enumeration
+ *     class that wraps a hidden int value.</li>
+ *     <li><a href="IntegerSyntax.html">IntegerSyntax</a> is the abstract syntax
+ *     for integer-valued attributes.</li>
+ *     <li><a href="TextSyntax.html">TextSyntax</a> is the abstract syntax for
+ *     text-valued attributes, and includes a locale giving the text string's
+ *     natural language.</li>
+ *     <li><a href="SetOfIntegerSyntax.html">SetOfIntegerSyntax</a> is the
+ *     abstract syntax for attributes representing a range or set of integers
+ *     <li><a href="ResolutionSyntax.html">ResolutionSyntax</a> is the abstract
+ *     syntax for attributes representing resolution values, such as 600x300
+ *     dpi.</li>
+ *     <li><a href="Size2DSyntax.html">Size2DSyntax</a> is the abstract syntax
+ *     for attributes representing a two-dimensional size, such as a paper size
+ *     of 8.5 x 11 inches.</li>
+ *     <li><a href="DateTimeSyntax.html">DateTimeSyntax</a> is the abstract
+ *     syntax for attributes whose value is a date and time.</li>
+ *     <li><a href="URISyntax.html">URISyntax</a> is the abstract syntax for
+ *     attributes whose value is a Uniform Resource Indicator.</li>
+ * </ul>
+ * The abstract syntax classes are independent of the attributes that use them.
+ * In fact, applications that have nothing to do with printing can use the
+ * abstract syntax classes. Although most of the standard attribute classes
+ * extend one of the abstract syntax classes, no attribute class is required to
+ * extend one of these classes. The abstract syntax classes merely provide a
+ * convenient implementation that can be shared by many attribute classes.
+ * <p>
+ * Each attribute class implements the {@code Attribute} interface, either
+ * directly or indirectly, to mark it as a printing attribute. An attribute
+ * class that can appear in restricted attribute sets in certain contexts also
+ * implements one or more subinterfaces of {@code Attribute}. Most attribute
+ * classes also extend the appropriate abstract syntax class to get the
+ * implementation. Consider the {@code Sides} attribute class:
+ * <blockquote>
+ * <pre>{@code
+ * public class Sides
+ *     extends EnumSyntax
+ *     implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
+ * {
+ *     public final Object getCategory()
+ *     {
+ *         return Sides.class;
+ *     }
+ * ...
+ * }}
+ * </pre>
+ * </blockquote>
+ * <p>
+ * Since every attribute class implements {@code Attribute}, every attribute
+ * class must provide an implementation for the
+ * {@link javax.print.attribute.Attribute#getCategory() getCategory} method,
+ * which returns the attribute category. In the case of {@code Sides}, the
+ * {@code getCategory} method returns {@code Sides.class}. The
+ * {@code getCategory} method is final to ensure that any vendor-defined
+ * subclasses of a standard attribute class appear in the same category. Every
+ * attribute object is immutable once constructed so that attribute object
+ * references can be passed around freely. To get a different attribute value,
+ * construct a different attribute object.
+ *
+ * <h3>Attribute Vendors</h3>
+ * The Java Print Service API is designed so that vendors can:
+ * <ul>
+ *     <li>define new vendor-specific values for any standard attribute defined
+ *     in <a href="standard/package-summary.html">javax.print.attribute.standard
+ *     </a>.</li>
+ *     <li>define new attribute categories representing the vendor printer's
+ *     proprietary capabilities not already supported by the standard
+ *     attributes.</li>
+ * </ul>
+ * To define a new value for an attribute, a client can construct instances of
+ * such attributes with arbitrary values at runtime. However, an enumerated
+ * attribute using an abstract syntax class of {@code EnumSyntax} specifies all
+ * the possible attribute values at compile time as singleton instances of the
+ * attribute class. This means that new enumerated values cannot be constructed
+ * at run time. To define new vendor-specific values for a standard enumerated
+ * attribute, the vendor must define a new attribute class specifying the new
+ * singleton instances. To ensure that the new attribute values fall in the same
+ * category as the standard attribute values, the new attribute class must be a
+ * subclass of the standard attribute class.
+ * <p>
+ * To define a new attribute category, a vendor defines a new attribute class.
+ * This attribute class, like the standard attribute classes, implements
+ * {@code Attribute} or one of its subinterfaces and extends an abstract syntax
+ * class. The vendor can either use an existing abstract syntax class or define
+ * a new one. The new vendor-defined attribute can be used wherever an
+ * {@code Attribute} is used, such as in an {@code AttributeSet}.
+ *
+ * <h3>Using Attributes</h3>
+ * A typical printing application uses the {@code PrintRequestAttributeSet}
+ * because print-request attributes are the types of attributes that client
+ * usually specifies. This example demonstrates creating an attribute set of
+ * print-request attributes and locating a printer that can print the document
+ * according to the specified attributes:
+ * <blockquote>
+ * <pre>{@code
+ * FileInputStream psStream;
+ * try {
+ *     psstream = new FileInputStream("file.ps");
+ * } catch (FileNotFoundException ffne) {
+ * }
+ * if (psstream == null) {
+ *     return;
+ * }
+ * //Set the document type. See the DocFlavor documentation for
+ * //more information.
+ * DocFlavor psInFormat = DocFlavor.INPUT_STREAM.POSTSCRIPT;
+ * Doc myDoc = new SimpleDoc(pstream, psInFormat, null);
+ * PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
+ * aset.add(new Copies(5));
+ * aset.add(MediaSize.A4);
+ * aset.add(Sides.DUPLEX);
+ * PrintService[] services =
+ *     PrintServiceLookup.lookupPrintServices(psInFormat, aset);
+ * if (services.length > 0) {
+ *     DocPrintJob job = services[0].createPrintJob();
+ *     try {
+ *         job.print(myDoc, aset);
+ *     } catch (PrintException pe) {}
+ * }
+ * }</pre>
+ * </blockquote>
+ * <p>
+ * Please note: In the javax.print APIs, a null reference parameter to methods
+ * is incorrect unless explicitly documented on the method as having a
+ * meaningful interpretation. Usage to the contrary is incorrect coding and may
+ * result in a run time exception either immediately or at some later time.
+ * IllegalArgumentException and NullPointerException are examples of typical and
+ * acceptable run time exceptions for such cases.
+ *
+ * @since 1.4
+ */
+package javax.print.attribute;
diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/package.html b/jdk/src/java.desktop/share/classes/javax/print/attribute/package.html
deleted file mode 100644
index aeedb0d..0000000
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/package.html
+++ /dev/null
@@ -1,404 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-<title>javax.print.attribute package</title>
-<!--
-Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</head>
-<body bgcolor="white">
-Provides classes and interfaces
-that describe the types of Java<sup><font size="-2">TM</font></sup> Print
-Service attributes and how they can be collected into attribute sets.
-<H3>What is an Attribute?</H3>
-When setting up a print job,
-a client specifies two things:
-<B>print data</B> and <B>processing instructions.</B>
-The print data is the actual content to be printed.
-The processing instructions tell the printer how to print the print data,
-such as: what media to use, how many copies to print, and 
-whether to print on one or both sides of a sheet.  The client specifies
-these processing instructions with the attribute definitions of the Java 
-Print Service API.
-<P>
-The print data and the processing instructions
-are separate entities.  This means that:
-<ul>
-<li>You can print the same print data
-at different times using different processing instructions.
-<br>
-For example, you can print a slide presentation
-on US letter-sized white paper,
-double-sided, stapled, 20 copies
-to make handouts for a talk;
-and you could print the same slide presentation
-on US letter-sized transparencies,
-single-sided, one copy
-to make the actual slides for the talk.
-<li>You can use the same processing instructions
-at different times to print different data.
-For example, you could set your default processing 
-instructions to: US letter-sized paper, double sided, stapled.
-Whenever you print a job, it prints with these settings,
-unless you explicitly override them.
-</ul>
-<P>
-
-The processing instruction does not specify how the print job 
-processes the request; each processing instruction is only a description 
-of the results of a print job.  The print job determines the manner in
-which it achieves the results specified by the processing instructions.
-Representing processing instructions as descriptive items
-provides more flexibility for implementing print jobs.
-<h4>Attribute Categories and Values</h4>
-Each printer has a set of capabilities, such as the ability to print on
-different paper sizes or the ability to print more than one copy.  Each of 
-the capabilities has a range of values.  For example, a printer's orientation 
-capability might have this range of values: [landscape, portrait]. 
-For each print request, the capability is set to one of these values.  The 
-Java Print Service API uses the term <b>attribute category</b> to refer to
-a printer capability and the term <b>attribute value</b> to refer to the value
-of the capability.
-<p>
-In the Java Print Service API, an attribute category is represented by a Java 
-class implementing the <a href="Attribute.html">Attribute</a> interface.  
-Attribute values are instances of such a class or 
-one of its subclasses.  For example, to specify the number of copies, an 
-application constructs an instance of the 
-<a href="standard/Copies.html">Copies</a> class with the 
-number of desired copies and uses the <code>Copies</code> instance as part of 
-the print request.  In this case, the <code>Copies</code> class represents the 
-attribute category, and the <code>Copies</code> instance represents the 
-attribute value.
-
-<h4><a name="role"></a>Attribute Roles</h4>
-
-When submitting a print job to a printer, the client provides the
-attributes describing the characteristics of the print data, such as
-the document name, and how the print data should be printed, such as
-double-sided, five copies.  If a print job consists of multiple
-pieces of print data, different pieces might have different processing
-instructions, such as 8 x 11 inch media for the first document, and
-11 x 17 inch media for another document.
-<p>
-Once the printer starts processing the print job,
-additional information about the job becomes available, which might include:
-the job state (such as <i>completed</i> or <i>queued</i>) and
-the number of pages printed so far.  These pieces of information are also
-attributes.  Attributes can also describe the printer itself, such as:
-the printer name, the printer location, and the number of jobs queued. 
-<p>
-
-The Java Print Service API defines these different kinds of attributes 
-with five subinterfaces of <code>Attribute</code>: 
-<ul>
-<li><A HREF="DocAttribute.html">DocAttribute</A> specifies a characteristic
-of an individual document and the print job settings to be applied to an
-individual document.
-<li><A HREF="PrintRequestAttribute.html">PrintRequestAttribute</A> specifies 
-a setting applied to a whole print job and to all the documents in 
-the print job. 
-<li><A HREF="PrintJobAttribute.html">PrintJobAttribute</A> reports the status
-of a print job.
-<li><A HREF="PrintServiceAttribute.html">PrintServiceAttribute</A> reports the
-status of a print service.
-<li><A HREF="SupportedValuesAttribute.html">SupportedValuesAttribute</A> gives
-the supported values for another attribute.
-</ul>
-Each attribute class
-implements one or more of these tagging subinterfaces
-to indicate where the attribute can be used in the API.
-If an attribute class implements multiple tagging subinterfaces,
-the attribute can be used in multiple contexts.  For example, the media
-attribute can apply to one document in a print job as a <code>DocAttribute</code>
-or to an entire print job as a <code>PrintRequestAttribute</code>.
-Certain low-level attributes
-are never used on their own
-but are always aggregated into higher-level attributes.
-These low-level attribute classes only
-implement interface <A HREF="Attribute.html">Attribute</A>,
-not any of the tagging subinterfaces.
-<P>
-The Java Print Service API defines a group of
-standard attribute classes modeled upon the attributes in
-the Internet Printing Protocol (IPP) version 1.1. The
-standard attribute classes are in the subpackage
-javax.print.attribute.standard to keep the actual
-attribute classes conceptually separate from the generic
-apparatus defined in package javax.print.attribute. 
-
-<H3>Attribute Sets</H3>
-A client usually needs to provide more than one processing 
-instruction when submitting a print job.  For example, the client might need to
-specify a media size of A4 and a landscape orientation.  To send more than one
-processing instruction, the client collects the attributes into an 
-attribute set, which the Java Print Service API represents with the 
-<a href="AttributeSet.html">AttributeSet</a>
- interface.
-<p>
-The <code>AttributeSet</code> interface is similar to the 
-<a href="../../../java/util/Map.html">Map</a> interface: it provides a map of 
-key to values, in which each key is unique and can contain no more than one 
-value.  However, the <code>AttributeSet</code> interface is designed to 
-specifically support the needs of the Java Print Service API.  An 
-<code>AttributeSet</code> requires that:
-<OL TYPE=1>
-<LI>Each key in an <code>AttributeSet</code> corresponds to a category, and
-the value of the key can only be one of the attribute values that belong
-to the category represented by the key.  Thus, unlike a <code>Map</code>, an 
-<code>AttributeSet</code> restricts the possible values of a key: an 
-attribute category cannot be set to an attribute value that does not belong to
-that category.
-<LI>No two attributes from the same category can exist in the same set.
-For example, an attribute collection
-must not contain both a "one-sided" attribute and a "two-sided" attribute
-because these two attributes give the printer conflicting instructions.
-<LI>Only attributes implementing the <code>Attribute</code> interface can
-be added to the set.
-</OL>
-
-<P>
-The javax.print.attribute package includes 
-<A HREF="HashAttributeSet.html">HashAttributeSet</A>
-as a concrete implementation of the attribute set interface.
-<code>HashAttributeSet</code> provides an attribute set based on a hash map.
-You can use this implementation or provide your own implementation
-of interface <code>AttributeSet</code>.
-<p>
-The Java Print Service API provides four specializations of an attribute set 
-that are restricted to contain just one of the four kinds of attributes, 
-as discussed in the <a href="#role">Attribute Roles</a> section:
-<ul>
-<li><A HREF="DocAttributeSet.html">DocAttributeSet</A>
-<li><A HREF="PrintRequestAttributeSet.html">PrintRequestAttributeSet</A>
-<li><A HREF="PrintJobAttributeSet.html">PrintJobAttributeSet</A>
-<li><A HREF="PrintServiceAttributeSet.html">PrintServiceAttributeSet</A>
-</ul>
-Notice that only four kinds of attribute sets are listed here, but there are
-five kinds of attributes.  Interface 
-<A HREF="SupportedValuesAttribute.html">SupportedValuesAttribute</A>
-denotes an attribute that gives the supported values for another attribute.
-Supported-values attributes are never aggregated into attribute sets,
-so there is no attribute set subinterface defined for them.
-
-<P>
-In some contexts, an attribute set is read-only, which means that the 
-client is only allowed to examine an attribute set's 
-contents but not change them. In other contexts, the attribute set is read-write,
-which means that the client is allowed both to examine and to change an 
-attribute set's contents. For a read-only attribute set, calling a mutating 
-operation throws an <code>UnmodifiableSetException</code>. 
-<P>
-Package javax.print.attribute includes
-one concrete implementation of each of the attribute set subinterfaces:
-<ul>
-<li><A HREF="HashDocAttributeSet.html">HashDocAttributeSet</A>
-<li><A HREF="HashPrintRequestAttributeSet.html">HashPrintRequestAttributeSet</A>,
-<li><A HREF="HashPrintJobAttributeSet.html">HashPrintJobAttributeSet</A>,
-<li><A HREF="HashPrintServiceAttributeSet.html">HashPrintServiceAttributeSet</A>.
-</ul>
-All of these classes extend <A HREF="HashAttributeSet.html">HashAttributeSet</A>
-and enforce the restriction that the attribute set is only allowed to contain
-the corresponding kind of attribute.
-<H3>Attribute Class Design</H3>
-An attribute value is a small, atomic data item,
-such as an integer or an enumerated value.  The Java Print Service API 
-does not use primitive data types, such as int, to represent attribute 
-values for these reasons:
-<ul>
-<li>Primitive data types are not type-safe.  For example, a compiler
-should not allow a "copies" attribute value to 
-be used for a "sides" attribute. 
-<li>Some attributes must be represented as a record of several
-values.  One example is printer resolution, which requires two 
-numbers, such as 600 and 300 representing 600 x 300 dpi.
-</ul>
-For type-safety and to represent all attributes uniformly, the Java 
-Print Service API defines each attribute category as a class, such as 
-class <code>Copies</code>, class <a href="standard/Sides.html">Sides</a>, and class 
-<a href="standard/PrinterResolution.html">PrinterResolution</a>.  Each 
-attribute class wraps one or more primitive data items containing the 
-attribute's value.  Attribute set operations perform frequent
-comparisons between attribute category objects when adding attributes,
-finding existing attributes in the same category, and looking
-up an attribute given its category.  Because an attribute category is 
-represented by a class, fast attribute-value comparisons can be performed 
-with the <code>Class.equals</code> method.
-<p>
-Even though the Java Print Service API includes a large number of
-different attribute categories, there are only a few different types
-of attribute values.  Most attributes can be represented by a small
-number of data types, such as: integer values, integer ranges, text,
-or an enumeration of integer values.  The type of the attribute value that
-a category accepts is called the attribute's abstract syntax.  To
-provide consistency and reduce code duplication, the Java Print Service
-API defines abstract syntax classes to represent each 
-abstract syntax, and these classes are used as the parent of standard
-attributes whenever possible.  The abstract syntax classes are:
-<ul>
-<li><a href="EnumSyntax.html">EnumSyntax</a> 
-provides a type-safe enumeration in which enumerated
-values are represented as singleton objects.  Each enumeration 
-singleton is an instance of the enumeration class that wraps a hidden
-int value.
-<li><a href="IntegerSyntax.html">IntegerSyntax</a>
- is the abstract syntax for integer-valued attributes.
-<li><a href="TextSyntax.html">TextSyntax</a> is 
-the abstract syntax for text-valued attributes, and
-includes a locale giving the text string's natural language.
-<li><a href="SetOfIntegerSyntax.html">SetOfIntegerSyntax</a>
- is the abstract syntax for attributes 
-representing a range or set of integers
-<li><a href="ResolutionSyntax.html">ResolutionSyntax</a>
- is the abstract syntax for attributes representing
- resolution values, such as 600x300 dpi.
-<li><a href="Size2DSyntax.html">Size2DSyntax</a>
- is the abstract syntax for attributes representing a 
-two-dimensional size, such as a paper size of 8.5 x 11 inches.
-<li><a href="DateTimeSyntax.html">DateTimeSyntax</a>
- is the abstract syntax for attributes whose value is a date and time.
-<li><a href="URISyntax.html">URISyntax</a> is the 
-abstract syntax for attributes whose value is a Uniform Resource
-Indicator.
-</ul>
-The abstract syntax classes are independent of the attributes that
-use them.  In fact, applications that have nothing to do with
-printing can use the abstract syntax classes.  Although most of the
-standard attribute classes extend one of the abstract syntax classes, 
-no attribute class is required to extend one of these classes.  The 
-abstract syntax classes merely provide a convenient implementation that
-can be shared by many attribute classes.
-<p>
-Each attribute class implements the <code>Attribute</code> interface, either
-directly or indirectly, to mark it as a printing attribute.  An
-attribute class that can appear in restricted attribute sets in
-certain contexts also implements one or more subinterfaces of 
-<code>Attribute</code>.  Most attribute classes also extend the appropriate 
-abstract syntax class to get the implementation.  Consider the 
-<code>Sides</code> attribute class:
-<blockquote>
-<pre>
-public class Sides
-  extends EnumSyntax
-  implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
-  {
-  public final Object getCategory()
-    {
-    return Sides.class;
-    }
-  ...
-  }
-</pre>
-</blockquote>  
-<p>
-Since every attribute class implements <code>Attribute</code>, every attribute
-class must provide an implementation for the 
-{@link javax.print.attribute.Attribute#getCategory() getCategory} method,
-which returns the attribute category.  In the case of <code>Sides</code>, the
-<code>getCategory</code> method returns <code>Sides.class</code>.  The 
-<code>getCategory</code> method is final to ensure that any vendor-defined 
-subclasses of a standard attribute class appear in the same category.  
-Every attribute object is immutable once constructed so that attribute object 
-references can be passed around freely.  To get a different attribute 
-value, construct a different attribute object.  
-
-<h3>Attribute Vendors</h3>
-
-The Java Print Service API is designed so that vendors can:
-<ul>
-<li>define new vendor-specific values for any standard attribute 
-defined in <a href="standard/package-summary.html">
-javax.print.attribute.standard</a>.
-<li>define new attribute categories representing the vendor printer's
-proprietary capabilities not already supported by the standard
-attributes.
-</ul>
-To define a new value for an attribute, a client can construct 
-instances of such attributes with arbitrary values at runtime.
-However, an enumerated attribute using an abstract syntax class
-of <code>EnumSyntax</code> specifies all the possible attribute values 
-at compile time as singleton instances of the attribute class.  This 
-means that new enumerated values cannot be constructed at run time.  
-To define new vendor-specific values for a standard enumerated 
-attribute, the vendor must define a new attribute class specifying 
-the new singleton instances.  To ensure that the new attribute values 
-fall in the same category as the standard attribute values, the new 
-attribute class must be a subclass of the standard attribute class.
-<p>
-To define a new attribute category, a vendor defines a new attribute
-class.  This attribute class, like the standard attribute classes, 
-implements <code>Attribute</code> or one of its subinterfaces and extends an
-abstract syntax class.  The vendor can either use an existing 
-abstract syntax class or define a new one.  The new vendor-defined
-attribute can be used wherever an <code>Attribute</code> is used, such as in an
-<code>AttributeSet</code>.
-
-<h3>Using Attributes</h3>
-
-A typical printing application uses the <code>PrintRequestAttributeSet</code>
-because print-request attributes are the types of attributes that
-client usually specifies.  This example demonstrates creating an attribute
-set of print-request attributes and locating a printer that can
-print the document according to the specified attributes:
-<blockquote>
-<pre>
-
-FileInputStream psStream;
-try {
-   psstream = new FileInputStream("file.ps");
-} catch (FileNotFoundException ffne) {
-}
-if (psstream == null) {
-    return;
-}
-//Set the document type.  See the DocFlavor documentation for
-//more information.
-DocFlavor psInFormat = DocFlavor.INPUT_STREAM.POSTSCRIPT;
-Doc myDoc = new SimpleDoc(pstream, psInFormat, null);  
-PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
-aset.add(new Copies(5));
-aset.add(MediaSize.A4);
-aset.add(Sides.DUPLEX);
-
-PrintService[] services = 
-		PrintServiceLookup.lookupPrintServices(psInFormat, aset);
-if (services.length > 0) {
-   DocPrintJob job = services[0].createPrintJob();
-   try {
-	job.print(myDoc, aset);
-   } catch (PrintException pe) {}
-}
-</pre>
-</blockquote>
-<P>
-Please note: In the javax.print APIs, a null reference parameter to methods 
-is incorrect unless explicitly documented on the method as having a meaningful
-interpretation. Usage to the contrary is incorrect coding and may result
-in a run time exception either immediately or at some later time.
-IllegalArgumentException and NullPointerException are examples of
-typical and acceptable run time exceptions for such cases.
-
-@since 1.4
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java
index cfe9a34..05937b5 100644
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,9 @@
  */
 package javax.print.attribute.standard;
 
+import javax.print.DocFlavor;
 import javax.print.attribute.Attribute;
+import javax.print.attribute.AttributeSet;
 import javax.print.attribute.DocAttribute;
 import javax.print.attribute.PrintJobAttribute;
 import javax.print.attribute.PrintRequestAttribute;
diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java
new file mode 100644
index 0000000..1e44ec9
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package-info.java
@@ -0,0 +1,637 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Package javax.print.attribute.standard contains classes for specific printing
+ * attributes. The parent package, <a href="../package-summary.html">
+ * javax.print.attribute</a>, provides classes and interfaces that describe the
+ * types of Java Print Service attributes and how they can be collected into
+ * attribute sets.
+ * <p>
+ * An attribute represents a printing feature that a print service can provide.
+ * For each attribute, a print service either does or does not support the
+ * attribute. For each possible value of a supported attribute, a print service
+ * either does or does not support the value.
+ * <p>
+ * The API requires every print service to support certain attributes; other
+ * attributes are optional and the service can choose whether or not to support
+ * them. Each attribute has a set of values that it accepts. The API requires
+ * every print service to support certain values for certain attributes; other
+ * attribute values are optional and the service can choose whether or not to
+ * support them. These support requirements are recorded in the documentation
+ * for each attribute class.
+ * <p>
+ * Package javax.print.attribute.standard contains standard printing attributes
+ * and standard printing attribute values that are widely used in the printing
+ * domain. A print service vendor can provide new vendor-specific printing
+ * attributes in addition to the standard ones. A vendor can also provide
+ * vendor-specific extensions (subclasses) of the standard printing attributes
+ * -- for example, to provide additional vendor-specific values for an existing
+ * standard attribute. Of course, if a vendor wants clients to be able to use
+ * any added or extended attributes, the vendor must publish the new attribute
+ * classes.
+ * <p>
+ * Many of the standard attribute classes extend one of the abstract syntax
+ * classes of the javax.print.attribute package. These abstract syntax classes
+ * each represent a different type. The <a href="../EnumSyntax.html">
+ * EnumSyntax</a> class, for example, represents a type-safe enumeration. The
+ * abstract syntax class provides a wrapper for the attribute value.
+ * <p>
+ * If an attribute class extends {@code EnumSyntax}, and the value of the
+ * attribute is an IPP-compatible value, the attribute's {@code toString} method
+ * returns the IPP string representation of the attribute value, such as
+ * "processing-stopped" for the <a href="JobState.html">JobState</a> attribute.
+ * However, because the {@code EnumSyntax} class is extensible, vendors can
+ * define their own attribute values. If an attribute uses the
+ * {@code EnumSyntax} class and is set to one of these vendor-defined values
+ * then the {@code toString} method will not return the IPP string
+ * representation of the value.
+ * <p>
+ * A printing client application will typically not need to use all the printing
+ * attribute classes in package javax.print.attribute.standard, just the ones
+ * that pertain to the application.
+ * <p>
+ * The attribute classes in package javax.print.attribute.standard are based on
+ * the Internet Printing Protocol (IPP) attributes as defined in the Internet
+ * RFC document, <i>RFC 2911 Internet Printing Protocol/1.1: Model and
+ * Semantics</i> dated September 2000. See
+ * <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> for more
+ * information. The descriptive text for each attribute class was taken largely
+ * from the above documents. The above authors' contribution to the API is
+ * gratefully acknowledged.
+ *
+ * <h3>Attribute Organization</h3>
+ * There are five kinds of printing attributes: doc attributes, print request
+ * attributes, print job attributes, print service attributes, and
+ * supported-values attributes.
+ *
+ * <h4>Doc Attributes</h4>
+ * Doc attributes specify the characteristics of an individual doc and the print
+ * job settings to be applied to an individual doc. A doc attribute class
+ * implements interface <a href="../DocAttribute.html">DocAttribute</a>. A doc
+ * attribute can appear in a <a href="../DocAttributeSet.html">
+ * DocAttributeSet</a>.
+ *
+ * <h4>Print Request Attributes</h4>
+ * Print request attributes specify the settings to be applied to a whole print
+ * job and to all the docs in the print job. A print request attribute class
+ * implements interface <a href="../PrintRequestAttribute.html">
+ * PrintRequestAttribute</a>. A print request attribute can appear in a
+ * <a href="../PrintRequestAttributeSet.html">PrintRequestAttributeSet</a>.
+ * <p>
+ * Some attributes are doc attributes but not print request attributes and may
+ * only be specified at the doc level. Some attributes are print request
+ * attributes but not doc attributes and may only be specified at the Print
+ * Request level. Some attributes are both doc attributes and print request
+ * attributes and may be specified either at the doc level or at the Print
+ * Request level.
+ * <p>
+ * When specified at the doc level, an attribute applies just to that one doc.
+ * When specified at the Print Request level, an attribute applies to the whole
+ * job, including all the docs in the job. However, an attribute specified at
+ * the doc level overrides an attribute in the same category specified at the
+ * Print Request level.
+ *
+ * <h4>Print Job Attributes</h4>
+ * Print job attributes report the status of a Print Job. A print job attribute
+ * class implements interface <a href="../PrintJobAttribute.html">
+ * PrintJobAttribute</a>. A print job attribute can appear in a
+ * <a href="../PrintJobAttributeSet.html">PrintJobAttributeSet</a>.
+ * <p>
+ * Some attributes are both print request attributes and print job attributes; a
+ * client may include such attributes in a Print Request to specify
+ * characteristics for the ensuing Print Job, and those attributes then also
+ * appear in the Print Job's attribute set. Some attributes are print job
+ * attributes but not print request attributes; the print service itself adds
+ * these attributes to the Print Job's attribute set.
+ *
+ * <h4>Print Service Attributes</h4>
+ * Print service attributes report the status of a print service. A print
+ * service attribute class implements interface
+ * <a href="../PrintServiceAttribute.html">PrintServiceAttribute</a>. A print
+ * service attribute can appear in a <a href="../PrintServiceAttributeSet.html">
+ * PrintServiceAttributeSet</a>.
+ *
+ * <h4>Supported-Values Attributes</h4>
+ * A supported-value attribute indicates the legal values for another attribute
+ * that a print service supports. A supported-values attribute class implements
+ * interface <a href="../SupportedValuesAttribute.html">
+ * SupportedValuesAttribute</a>. However, supported-values attributes never
+ * appear in attribute sets, so there is no restricted
+ * <a href="../AttributeSet.html">AttributeSet</a> subinterface for them.
+ *
+ * <h4>Attribute Table</h4>
+ * The table below lists all the printing attributes. The table shows the
+ * tagging interfaces each attribute class implements in addition to interface
+ * <a href="../Attribute.html"> Attribute</a>, thus indicating how each
+ * attribute is used in the API. For each doc attribute and print request
+ * attribute, the column marked "SupportedValuesAttribute" lists the
+ * supported-values attribute class, if any, with which a print service
+ * indicates the supported values for that attribute category.
+ * <table border=1 cellpadding=2 cellspacing=1 summary="Lists all printing
+ * attributes as described in above text">
+ *     <tr style="background-color:#E5E5E5">
+ *         <th valign="bottom">Attribute Class</th>
+ *         <th valign="bottom">Doc<br>Attribute</th>
+ *         <th valign="bottom">Print<br>Request<br>Attribute</th>
+ *         <th valign="bottom">Print<br>Job<br>Attribute</th>
+ *         <th valign="bottom">Print<br>Service<br>Attribute</th>
+ *         <th valign="bottom">SupportedValuesAttribute</th>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="Compression.html">Compression</a></td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="DocumentName.html">DocumentName</a></td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="Chromaticity.html">Chromaticity</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="Copies.html">Copies</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td><a href="CopiesSupported.html">CopiesSupported</a></td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="Finishings.html">Finishings</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobHoldUntil.html">JobHoldUntil</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobImpressions.html">JobImpressions</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td><a href="JobImpressionsSupported.html">
+ *             JobImpressionsSupported</a></td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobKOctets.html">JobKOctets</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td><a href="JobKOctetsSupported.html">JobKOctetsSupported</a></td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobMediaSheets.html">JobMediaSheets</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td><a href="JobMediaSheetsSupported.html">
+ *             JobMediaSheetsSupported</a></td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobName.html">JobName</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobPriority.html">JobPriority</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td><a href="JobPrioritySupported.html">JobPrioritySupported</a></td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobSheets.html">JobSheets</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="Media.html">Media</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="MediaSize.html">MediaSize</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="MultipleDocumentHandling.html">
+ *             MultipleDocumentHandling</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="NumberUp.html">NumberUp</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td><a href="NumberUpSupported.html">NumberUpSupported</a></td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="OrientationRequested.html">OrientationRequested</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PageRanges.html">PageRanges</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PresentationDirection.html">
+ *             PresentationDirection</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterResolution.html">PrinterResolution</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrintQuality.html">PrintQuality</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="RequestingUserName.html">RequestingUserName</a></td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="SheetCollate.html">SheetCollate</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="Sides.html">Sides</a></td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="DateTimeAtCompleted.html">DateTimeAtCompleted</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="DateTimeAtCreation.html">DateTimeAtCreation</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="DateTimeAtProcessing.html">DateTimeAtProcessing</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobImpressionsCompleted.html">
+ *             JobImpressionsCompleted</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobKOctetsProcessed.html">JobKOctetsProcessed</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobMediaSheetsCompleted.html">
+ *             JobMediaSheetsCompleted</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobMessageFromOperator.html">
+ *             JobMessageFromOperator</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobOriginatingUserName.html">
+ *             JobOriginatingUserName</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="JobState.html">JobState</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         </tr>
+ *     <tr>
+ *         <td><a href="JobStateReasons.html">JobStateReasons</a><br>
+ *             Contains zero or more --</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td>-- <a href="JobStateReason.html">JobStateReason</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="NumberOfDocuments.html">NumberOfDocuments</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="NumberOfInterveningJobs.html">
+ *             NumberOfInterveningJobs</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="OutputDeviceAssigned.html">OutputDeviceAssigned</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="ColorSupported.html">ColorSupported</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PagesPerMinute.html">PagesPerMinute</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PagesPerMinuteColor.html">PagesPerMinuteColor</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PDLOverrideSupported.html">PDLOverrideSupported</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterIsAcceptingJobs.html">
+ *             PrinterIsAcceptingJobs</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterInfo.html">PrinterInfo</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterLocation.html">PrinterLocation</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterMessageFromOperator.html">
+ *             PrinterMessageFromOperator</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterMakeAndModel.html">PrinterMakeAndModel</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterMoreInfo.html">PrinterMoreInfo</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterMoreInfoManufacturer.html">
+ *             PrinterMoreInfoManufacturer</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterName.html">PrinterName</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterState.html">PrinterState</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="PrinterStateReasons.html">PrinterStateReasons</a><br>
+ *             Contains zero or more --</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td>-- <a href="PrinterStateReason.html">PrinterStateReason</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td>-- <a href="Severity.html">Severity</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="QueuedJobCount.html">QueuedJobCount</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td align="center">X</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ *     <tr>
+ *         <td><a href="ReferenceUriSchemesSupported.html">
+ *             ReferenceUriSchemesSupported</a></td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *         <td>&nbsp;</td>
+ *     </tr>
+ * </table>
+ * <p>
+ * Please note: In the javax.print APIs, a null reference parameter to methods
+ * is incorrect unless explicitly documented on the method as having a
+ * meaningful interpretation. Usage to the contrary is incorrect coding and may
+ * result in a run time exception either immediately or at some later time.
+ * IllegalArgumentException and NullPointerException are examples of typical and
+ * acceptable run time exceptions for such cases.
+ *
+ * @since 1.4
+ */
+package javax.print.attribute.standard;
diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package.html b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package.html
deleted file mode 100644
index 78d2936..0000000
--- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/package.html
+++ /dev/null
@@ -1,292 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>javax.print.attribute.standard package</title>
-<!--
-Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</head>
-<body bgcolor="white">
-Package javax.print.attribute.standard
-contains classes for specific printing attributes.
-The parent package,
-<A HREF="../package-summary.html">
-javax.print.attribute</A>,
-provides classes and interfaces that describe the types of Java
-Print Service attributes and how they can be collected into attribute
-sets.
-<P>
-An attribute represents a printing feature
-that a print service can provide.
-For each attribute,
-a print service either does or does not support the attribute.
-For each possible value of a supported attribute,
-a print service either does or does not support the value.
-<P>
-The API requires every print service
-to support certain attributes;
-other attributes are optional
-and the service can choose whether or not to support them.
-Each attribute has a set of values that it accepts.  The API 
-requires every print service to support certain values for
-certain attributes;
-other attribute values are optional
-and the service can choose whether or not to support them.
-These support requirements are recorded in the documentation
-for each attribute class.
-<P>
-Package javax.print.attribute.standard
-contains standard printing attributes
-and standard printing attribute values
-that are widely used in the printing domain.
-A print service vendor
-can provide new vendor-specific printing attributes
-in addition to the standard ones.
-A vendor can also provide
-vendor-specific extensions (subclasses)
-of the standard printing attributes --
-for example,
-to provide additional vendor-specific values
-for an existing standard attribute.
-Of course,
-if a vendor wants clients
-to be able to use any added or extended attributes,
-the vendor must publish the new attribute classes.
-<P>
-Many of the standard attribute classes extend one of 
-the abstract syntax classes of the javax.print.attribute package.
-These abstract syntax classes each represent a 
-different type.  The <a href="../EnumSyntax.html">
-EnumSyntax</a> class, for example, represents a type-safe
-enumeration.  The abstract syntax class provides a wrapper for the attribute 
-value.  
-<p>
-If an attribute class extends <code>EnumSyntax</code>, and the value of the 
-attribute is an IPP-compatible value, the attribute's <code>toString</code> 
-method returns the IPP string representation of the attribute value, such as
-"processing-stopped" for the 
-<a href="JobState.html">JobState</a> attribute.  However, because the 
-<code>EnumSyntax</code> class is extensible, vendors can define their own 
-attribute values.  If an attribute uses the <code>EnumSyntax</code> class 
-and is set to one of these vendor-defined values then the <code>toString</code>
- method will not return the IPP string representation of the value.
-<p>
-A printing client application
-will typically not need to use
-all the printing attribute classes
-in package javax.print.attribute.standard,
-just the ones that pertain to the application.
-<P>
-The attribute classes in package javax.print.attribute.standard
-are based on the Internet Printing Protocol (IPP) attributes
-as defined in the Internet RFC document,
-<I>RFC 2911 Internet Printing Protocol/1.1: Model and Semantics</I>
-dated September 2000.
-See <a HREF="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a>
-for more information.
-The descriptive text for each attribute class
-was taken largely from the above documents.
-The above authors' contribution to the API
-is gratefully acknowledged.
-
-<H3>Attribute Organization</H3>
-There are five kinds of printing attributes:
-doc attributes,
-print request attributes,
-print job attributes,
-print service attributes,
-and supported-values attributes.
-
-<H4>Doc Attributes</H4>
-Doc attributes specify the characteristics of an individual doc
-and the print job settings to be applied to an individual doc.
-A doc attribute class implements interface
-<A HREF="../DocAttribute.html">DocAttribute</A>.
-A doc attribute can appear in a 
-<a href="../DocAttributeSet.html">
-DocAttributeSet</a>.
-
-<H4>Print Request Attributes</H4>
-Print request attributes
-specify the settings to be applied to a whole print job
-and to all the docs in the print job. 
-A print request attribute class implements interface
-<A HREF="../PrintRequestAttribute.html">
-PrintRequestAttribute</A>.
-A print request attribute can appear in a   
-<a href="../PrintRequestAttributeSet.html">
-PrintRequestAttributeSet</a>.
-
-<P>
-Some attributes are doc attributes
-but not print request attributes
-and may only be specified at the doc level.
-Some attributes are print request attributes
-but not doc attributes
-and may only be specified at the Print Request level.
-Some attributes are both doc attributes
-and print request attributes
-and may be specified either at the doc level
-or at the Print Request level.
-<P>
-When specified at the doc level,
-an attribute applies just to that one doc.
-When specified at the Print Request level,
-an attribute applies to the whole job,
-including all the docs in the job.
-However, an attribute specified at the doc level
-overrides an attribute in the same category
-specified at the Print Request level.
-
-<H4>Print Job Attributes</H4>
-Print job attributes report the status of a Print Job.
-A print job attribute class implements interface
-<A HREF="../PrintJobAttribute.html">PrintJobAttribute</A>.
-A print job attribute
-can appear in a <A HREF="../PrintJobAttributeSet.html">
-PrintJobAttributeSet</A>.
-<P>
-Some attributes are both print request attributes
-and print job attributes;
-a client may include such attributes in a Print Request
-to specify characteristics for the ensuing Print Job,
-and those attributes then also appear
-in the Print Job's attribute set.
-Some attributes are print job attributes
-but not print request attributes;
-the print service itself
-adds these attributes to the Print Job's attribute set.
-
-<H4>Print Service Attributes</H4>
-Print service attributes report the status
-of a print service.
-A print service attribute class implements interface
-<A HREF="../PrintServiceAttribute.html">
-PrintServiceAttribute</A>.
-A print service attribute
-can appear in a <A HREF="../PrintServiceAttributeSet.html">
-PrintServiceAttributeSet</A>.
-
-<H4>Supported-Values Attributes</H4>
-A supported-value attribute
-indicates the legal values for another attribute
-that a print service supports.
-A supported-values attribute class implements interface
-<A HREF="../SupportedValuesAttribute.html">
-SupportedValuesAttribute</A>.
-However, supported-values attributes
-never appear in attribute sets,
-so there is no restricted <A HREF="../AttributeSet.html">
-AttributeSet</A>
-subinterface for them.
-
-<H4>Attribute Table</H4>
-The table below lists all the printing attributes.
-The table shows the tagging interfaces
-each attribute class implements
-in addition to interface <A HREF="../Attribute.html">
-Attribute</A>,
-thus indicating how each attribute is used in the API.
-For each doc attribute and print request attribute,
-the column marked "SupportedValuesAttribute"
-lists the supported-values attribute class, if any,
-with which a print service 
-indicates the supported values for that attribute category.
-<TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Lists all printing attributes as described in above text">
-<TR BGCOLOR="#E5E5E5">
-<TH VALIGN="bottom">Attribute Class</TH>
-<TH VALIGN="bottom">Doc<BR>Attribute</TH>
-<TH VALIGN="bottom">Print<BR>Request<BR>Attribute</TH>
-<TH VALIGN="bottom">Print<BR>Job<BR>Attribute</TH>
-<TH VALIGN="bottom">Print<BR>Service<BR>Attribute</TH>
-<TH VALIGN="bottom">SupportedValuesAttribute</TH>
-</TR>
-<TR><TD><A HREF="Compression.html">Compression</A></TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="DocumentName.html">DocumentName</A></TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="Chromaticity.html">Chromaticity</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="Copies.html">Copies</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="CopiesSupported.html">CopiesSupported</A></TD></TR>
-<TR><TD><A HREF="Finishings.html">Finishings</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobHoldUntil.html">JobHoldUntil</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobImpressions.html">JobImpressions</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="JobImpressionsSupported.html">JobImpressionsSupported</A></TD></TR>
-<TR><TD><A HREF="JobKOctets.html">JobKOctets</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="JobKOctetsSupported.html">JobKOctetsSupported</A></TD></TR>
-<TR><TD><A HREF="JobMediaSheets.html">JobMediaSheets</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="JobMediaSheetsSupported.html">JobMediaSheetsSupported</A></TD></TR>
-<TR><TD><A HREF="JobName.html">JobName</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobPriority.html">JobPriority</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="JobPrioritySupported.html">JobPrioritySupported</A></TD></TR>
-<TR><TD><A HREF="JobSheets.html">JobSheets</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="Media.html">Media</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="MediaSize.html">MediaSize</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="MultipleDocumentHandling.html">MultipleDocumentHandling</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="NumberUp.html">NumberUp</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD><A HREF="NumberUpSupported.html">NumberUpSupported</A></TD></TR>
-<TR><TD><A HREF="OrientationRequested.html">OrientationRequested</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PageRanges.html">PageRanges</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PresentationDirection.html">PresentationDirection</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterResolution.html">PrinterResolution</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrintQuality.html">PrintQuality</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="RequestingUserName.html">RequestingUserName</A></TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="SheetCollate.html">SheetCollate</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="Sides.html">Sides</A></TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="DateTimeAtCompleted.html">DateTimeAtCompleted</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="DateTimeAtCreation.html">DateTimeAtCreation</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="DateTimeAtProcessing.html">DateTimeAtProcessing</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobImpressionsCompleted.html">JobImpressionsCompleted</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobKOctetsProcessed.html">JobKOctetsProcessed</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobMediaSheetsCompleted.html">JobMediaSheetsCompleted</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobMessageFromOperator.html">JobMessageFromOperator</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobOriginatingUserName.html">JobOriginatingUserName</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobState.html">JobState</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="JobStateReasons.html">JobStateReasons</A><BR>Contains zero or more --</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD>-- <A HREF="JobStateReason.html">JobStateReason</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="NumberOfDocuments.html">NumberOfDocuments</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="NumberOfInterveningJobs.html">NumberOfInterveningJobs</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="OutputDeviceAssigned.html">OutputDeviceAssigned</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="ColorSupported.html">ColorSupported</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PagesPerMinute.html">PagesPerMinute</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PagesPerMinuteColor.html">PagesPerMinuteColor</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PDLOverrideSupported.html">PDLOverrideSupported</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterIsAcceptingJobs.html">PrinterIsAcceptingJobs</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterInfo.html">PrinterInfo</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterLocation.html">PrinterLocation</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterMessageFromOperator.html">PrinterMessageFromOperator</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterMakeAndModel.html">PrinterMakeAndModel</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterMoreInfo.html">PrinterMoreInfo</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterMoreInfoManufacturer.html">PrinterMoreInfoManufacturer</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterName.html">PrinterName</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterState.html">PrinterState</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="PrinterStateReasons.html">PrinterStateReasons</A><BR>Contains zero or more --</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD>-- <A HREF="PrinterStateReason.html">PrinterStateReason</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD>-- <A HREF="Severity.html">Severity</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="QueuedJobCount.html">QueuedJobCount</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD ALIGN="center">X</TD><TD>&nbsp;</TD></TR>
-<TR><TD><A HREF="ReferenceUriSchemesSupported.html">ReferenceUriSchemesSupported</A></TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>
-</TABLE>
-<P>
-Please note: In the javax.print APIs, a null reference parameter to methods 
-is incorrect unless explicitly documented on the method as having a meaningful
-interpretation. Usage to the contrary is incorrect coding and may result
-in a run time exception either immediately or at some later time.
-IllegalArgumentException and NullPointerException are examples of
-typical and acceptable run time exceptions for such cases.
-
-@since 1.4
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/package-info.java b/jdk/src/java.desktop/share/classes/javax/print/event/package-info.java
new file mode 100644
index 0000000..ca65f56
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/print/event/package-info.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Package javax.print.event contains event classes and listener interfaces.
+ * <p>
+ * They may be used to monitor both print services (such as printers going
+ * on-line &amp; off-line), and the progress of a specific print job.
+ * <p>
+ * Please note: In the javax.print APIs, a null reference parameter to methods
+ * is incorrect unless explicitly documented on the method as having a
+ * meaningful interpretation. Usage to the contrary is incorrect coding and may
+ * result in a run time exception either immediately or at some later time.
+ * IllegalArgumentException and NullPointerException are examples of typical and
+ * acceptable run time exceptions for such cases.
+ *
+ * @since 1.4
+ */
+package javax.print.event;
diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/package.html b/jdk/src/java.desktop/share/classes/javax/print/event/package.html
deleted file mode 100644
index 6e49d8b..0000000
--- a/jdk/src/java.desktop/share/classes/javax/print/event/package.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-<title>javax.print.event package</title>
-<!--
-Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</head>
-<body bgcolor="white">
-Package javax.print.event contains event classes  and listener interfaces.
-<p>
-They may be used to monitor both print services (such as printers going
-on-line &amp; off-line), and the progress of a specific print job.
-<P>
-Please note: In the javax.print APIs, a null reference parameter to methods 
-is incorrect unless explicitly documented on the method as having a meaningful
-interpretation. Usage to the contrary is incorrect coding and may result
-in a run time exception either immediately or at some later time.
-IllegalArgumentException and NullPointerException are examples of
-typical and acceptable run time exceptions for such cases.
-
-@since 1.4
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/print/package-info.java b/jdk/src/java.desktop/share/classes/javax/print/package-info.java
new file mode 100644
index 0000000..0cdc764
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/print/package-info.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides the principal classes and interfaces for the Java&trade; Print
+ * Service API. The Java Print Service API enables client and server
+ * applications to:
+ * <ul>
+ *     <li>Discover and select print services based on their capabilities</li>
+ *     <li>Specify the format of print data</li>
+ *     <li>Submit print jobs to services that support the document type to be
+ *     printed.</li>
+ * </ul>
+ *
+ * <h3>Print Service Discovery</h3>
+ * An application invokes the static methods of the abstract class
+ * {@link javax.print.PrintServiceLookup PrintServiceLookup} to locate print
+ * services that have the capabilities to satisfy the application's print
+ * request. For example, to print a double-sided document, the application first
+ * needs to find printers that have the double-sided printing capability.
+ * <p>
+ * The JDK includes {@code PrintServiceLookup} implementations that can locate
+ * the standard platform printers. To locate other types of printers, such as
+ * IPP printers or JINI printers, a print-service provider can write
+ * implementations of {@code PrintServiceLookup}. The print-service provider can
+ * dynamically install these {@code PrintServiceLookup} implementations using
+ * the <a href="../../../technotes/guides/jar/jar.html#Service%20Provider">
+ * SPI JAR file specification</a>.
+ *
+ * <h3>Attribute Definitions</h3>
+ * The {@link javax.print.attribute} and {@link javax.print.attribute.standard}
+ * packages define print attributes, which describe the capabilities of a print
+ * service, specify the requirements of a print job, and track the progress of
+ * a print job.
+ * <p>
+ * The {@code javax.print.attribute} package describes the types of attributes
+ * and how they can be collected into sets. The
+ * {@code javax.print.attribute.standard} package enumerates all of the standard
+ * attributes supported by the API, most of which are implementations of
+ * attributes specified in the IETF Specification,
+ * <a href="http://www.ietf.org/rfc/rfc2911.txt"> RFC 2911 Internet Printing
+ * Protocol, 1.1: Model and Semantics</a>, dated September 2000. The attributes
+ * specified in {@code javax.print.attribute.standard} include common
+ * capabilities, such as: resolution, copies, media sizes, job priority, and
+ * page ranges.
+ *
+ * <h3>Document Type Specification</h3>
+ * The {@link javax.print.DocFlavor DocFlavor} class represents the print data
+ * format, such as JPEG or PostScript. A {@code DocFlavor} object consists of a
+ * MIME type, which describes the format, and a document representation class
+ * name that indicates how the document is delivered to the printer or output
+ * stream. An application uses the {@code DocFlavor} and an attribute set to
+ * find printers that can print the document type specified by the
+ * {@code DocFlavor} and have the capabilities specified by the attribute set.
+ *
+ * <h3>Using the API</h3>
+ * A typical application using the Java Print Service API performs these steps
+ * to process a print request:
+ * <ol>
+ *     <li>Chooses a {@code DocFlavor}.</li>
+ *     <li>Creates a set of attributes.</li>
+ *     <li>Locates a print service that can handle the print request as
+ *     specified by the {@code DocFlavor} and the attribute set.</li>
+ *     <li>Creates a {@link javax.print.Doc Doc} object encapsulating the
+ *     {@code DocFlavor} and the actual print data, which can take many forms
+ *     including: a Postscript file, a JPEG image, a URL, or plain text.</li>
+ *     <li>Gets a print job, represented by
+ *     {@link javax.print.DocPrintJob DocPrintJob}, from the print service.</li>
+ *     <li>Calls the print method of the print job.</li>
+ * </ol>
+ * The following code sample demonstrates a typical use of the Java Print
+ * Service API: locating printers that can print five double-sided copies of a
+ * Postscript document on size A4 paper, creating a print job from one of the
+ * returned print services, and calling print.
+ * <blockquote>
+ * <pre>{@code
+ * FileInputStream psStream;
+ * try {
+ *     psStream = new FileInputStream("file.ps");
+ * } catch (FileNotFoundException ffne) {
+ * }
+ * if (psStream == null) {
+ *     return;
+ * }
+ * DocFlavor psInFormat = DocFlavor.INPUT_STREAM.POSTSCRIPT;
+ * Doc myDoc = new SimpleDoc(psStream, psInFormat, null);
+ * PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
+ * aset.add(new Copies(5));
+ * aset.add(MediaSizeName.ISO_A4);
+ * aset.add(Sides.DUPLEX);
+ * PrintService[] services =
+ * PrintServiceLookup.lookupPrintServices(psInFormat, aset);
+ * if (services.length > 0) {
+ *     DocPrintJob job = services[0].createPrintJob();
+ *     try {
+ *         job.print(myDoc, aset);
+ *     } catch (PrintException pe) {}
+ * }
+ * }</pre>
+ * </blockquote>
+ * <P>
+ * Please note: In the javax.print APIs, a null reference parameter to methods
+ * is incorrect unless explicitly documented on the method as having a
+ * meaningful interpretation. Usage to the contrary is incorrect coding and may
+ * result in a run time exception either immediately or at some later time.
+ * IllegalArgumentException and NullPointerException are examples of typical and
+ * acceptable run time exceptions for such cases.
+ *
+ * @since 1.4
+ */
+package javax.print;
diff --git a/jdk/src/java.desktop/share/classes/javax/print/package.html b/jdk/src/java.desktop/share/classes/javax/print/package.html
deleted file mode 100644
index e306ac6..0000000
--- a/jdk/src/java.desktop/share/classes/javax/print/package.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-<title>javax.print package</title>
-<!--
-Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-</head>
-<body bgcolor="white">
-Provides the principal classes and interfaces for the 
-Java<sup><font size="-2">TM</font></sup> Print Service API.
-The Java Print Service API enables client and server applications to:
-<ul>
-<li>Discover and select print services based on their capabilities 
-<li>Specify the format of print data
-<li>Submit print jobs to services that support the document type to 
-be printed.
-</ul>
-
-
-<h3>Print Service Discovery</h3>
-<p>
-An application invokes the static methods of the abstract class 
-{@link javax.print.PrintServiceLookup PrintServiceLookup} to locate print 
-services that have the capabilities to satisfy the application's print 
-request.  For example, to print a double-sided document, the application 
-first needs to find printers that have the double-sided printing capability.
-<p>
-The JDK includes <code>PrintServiceLookup</code> implementations that
-can locate the standard platform printers.  To locate other types of printers,
-such as IPP printers or JINI printers, a print-service provider can write 
-implementations of <code>PrintServiceLookup</code>.  The print-service provider 
-can dynamically install these <code>PrintServiceLookup</code> implementations 
-using the 
-<a href="../../../technotes/guides/jar/jar.html#Service%20Provider">
-SPI JAR file specification</a>.
-
-<h3>Attribute Definitions</h3>
-
-The {@link javax.print.attribute} and {@link javax.print.attribute.standard} 
-packages define print attributes, which describe the capabilities of a print 
-service, specify the requirements of a print job, and track the progress of 
-a print job.
-<p>
-The <code>javax.print.attribute</code> package describes the types of attributes and
-how they can be collected into sets.  The <code>javax.print.attribute.standard</code>
-package enumerates all of the standard attributes supported by the API, most
-of which are implementations of attributes specified in the IETF Specification, 
-<a href="http://www.ietf.org/rfc/rfc2911.txt">
-RFC 2911 Internet Printing Protocol, 1.1: Model and Semantics</a>, dated 
-September 2000.  The attributes specified in <code>javax.print.attribute.standard</code>
-include common capabilities, such as: resolution, copies, media sizes, 
-job priority, and page ranges.
-
-<h3>Document Type Specification</h3>
-
-The {@link javax.print.DocFlavor DocFlavor} class represents the print data 
-format, such as JPEG or PostScript.  A <code>DocFlavor</code> object 
-consists of a MIME type, which describes the format, and a document 
-representation class name that indicates how the document is delivered 
-to the printer or output stream.  An application uses the 
-<code>DocFlavor</code> and an attribute set to find printers that can 
-print the document type specified by the <code>DocFlavor</code> and have 
-the capabilities specified by the attribute set.  
-
-<h3>Using the API</h3>
-
-A typical application using the Java Print Service API performs these steps
-to process a print request:
-<ol>
-<li>Chooses a <code>DocFlavor</code>.</li>
-<li>Creates a set of attributes.</li>
-<li>Locates a print service that can handle the print request as specified
-by the <code>DocFlavor</code> and the attribute set.</li>
-<li>Creates a {@link javax.print.Doc Doc} object encapsulating the 
-<code>DocFlavor</code>
-and the actual print data, which can take many forms including: a Postscript 
-file, a JPEG image, a URL, or plain text.</li>
-<li>Gets a print job, represented by {@link javax.print.DocPrintJob DocPrintJob},
- from the print service.</li>
-<li>Calls the print method of the print job.</li>
-</ol>
-The following code sample demonstrates a typical use of the Java Print 
-Service API: locating printers that can print five double-sided copies
-of a Postscript document on size A4 paper, creating a print job from 
-one of the returned print services, and calling print.
-
-<blockquote>
-<pre>
-FileInputStream psStream;
-try {
-   psStream = new FileInputStream("file.ps");
-} catch (FileNotFoundException ffne) {
-}
-if (psStream == null) {
-    return;
-}
-
-DocFlavor psInFormat = DocFlavor.INPUT_STREAM.POSTSCRIPT;
-Doc myDoc = new SimpleDoc(psStream, psInFormat, null);  
-PrintRequestAttributeSet aset = 
-	new HashPrintRequestAttributeSet();
-aset.add(new Copies(5));
-aset.add(MediaSizeName.ISO_A4);
-aset.add(Sides.DUPLEX);
-PrintService[] services = 
-  PrintServiceLookup.lookupPrintServices(psInFormat, aset);
-if (services.length > 0) {
-   DocPrintJob job = services[0].createPrintJob();
-   try {
-	job.print(myDoc, aset);
-   } catch (PrintException pe) {}
-}
-</pre>
-</blockquote>
-<P>
-Please note: In the javax.print APIs, a null reference parameter to methods 
-is incorrect unless explicitly documented on the method as having a meaningful
-interpretation. Usage to the contrary is incorrect coding and may result
-in a run time exception either immediately or at some later time.
-IllegalArgumentException and NullPointerException are examples of
-typical and acceptable run time exceptions for such cases.
-
-@since 1.4
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/sound/midi/package-info.java b/jdk/src/java.desktop/share/classes/javax/sound/midi/package-info.java
new file mode 100644
index 0000000..6b9d0f1
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/package-info.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides interfaces and classes for I/O, sequencing, and synthesis of MIDI
+ * (Musical Instrument Digital Interface) data.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, and guides, please see:
+ * <ul>
+ *     <li><a href="../../../../technotes/guides/sound">Sound</a></li>
+ * </ul>
+ *
+ * @since 1.3
+ */
+package javax.sound.midi;
diff --git a/jdk/src/java.desktop/share/classes/javax/sound/midi/package.html b/jdk/src/java.desktop/share/classes/javax/sound/midi/package.html
deleted file mode 100644
index 247e6f5..0000000
--- a/jdk/src/java.desktop/share/classes/javax/sound/midi/package.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-<body bgcolor="white">
-
-Provides interfaces and classes for I/O, sequencing, and synthesis of MIDI 
-(Musical Instrument Digital Interface) data.
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, and guides,
-please see:
-<ul>
-  <li><a href="../../../../technotes/guides/sound">Sound</a>
-</ul>
-
-
-@since 1.3
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/sound/midi/spi/package-info.java b/jdk/src/java.desktop/share/classes/javax/sound/midi/spi/package-info.java
new file mode 100644
index 0000000..3291c84
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/sound/midi/spi/package-info.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Supplies interfaces for service providers to implement when offering new MIDI
+ * devices, MIDI file readers and writers, or sound bank readers.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, and guides, please see:
+ * <ul>
+ *     <li><a href="../../../../../technotes/guides/sound">Sound</a></li>
+ * </ul>
+ *
+ * @since 1.3
+ */
+package javax.sound.midi.spi;
diff --git a/jdk/src/java.desktop/share/classes/javax/sound/midi/spi/package.html b/jdk/src/java.desktop/share/classes/javax/sound/midi/spi/package.html
deleted file mode 100644
index 6101ded..0000000
--- a/jdk/src/java.desktop/share/classes/javax/sound/midi/spi/package.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-<body bgcolor="white">
-
-Supplies interfaces for service providers to implement when
-offering new MIDI devices, MIDI file readers and writers, or sound bank readers.
-
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, and guides,
-please see:
-<ul>
-  <li><a href="../../../../../technotes/guides/sound">Sound</a>
-</ul>
-
-
-@since 1.3
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/package-info.java b/jdk/src/java.desktop/share/classes/javax/sound/sampled/package-info.java
new file mode 100644
index 0000000..c4ae9e0
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/package-info.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides interfaces and classes for capture, processing, and playback of
+ * sampled audio data.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, and guides, please see:
+ * <ul>
+ *     <li><a href="../../../../technotes/guides/sound">Sound</a></li>
+ * </ul>
+ *
+ * @since 1.3
+ */
+package javax.sound.sampled;
diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/package.html b/jdk/src/java.desktop/share/classes/javax/sound/sampled/package.html
deleted file mode 100644
index f5c00c2..0000000
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/package.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-<body bgcolor="white">
-
-Provides interfaces and classes for capture, processing, and playback of sampled audio data.
-
-
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, and guides,
-please see:
-<ul>
-  <li><a href="../../../../technotes/guides/sound">Sound</a>
-</ul>
-
-
-@since 1.3
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/package-info.java b/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/package-info.java
new file mode 100644
index 0000000..ad81b93
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/package-info.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Supplies abstract classes for service providers to subclass when offering new
+ * audio devices, sound file readers and writers, or audio format converters.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, and guides, please see:
+ * <ul>
+ *     <li><a href="../../../../../technotes/guides/sound">Sound</a></li>
+ * </ul>
+ *
+ * @since 1.3
+ */
+package javax.sound.sampled.spi;
diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/package.html b/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/package.html
deleted file mode 100644
index 93db4a2a9..0000000
--- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/spi/package.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-<body bgcolor="white">
-
-Supplies abstract classes for service providers to subclass when
-offering new audio devices, sound file readers and writers, or audio format converters.
-
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, and guides,
-please see:
-<ul>
-  <li><a href="../../../../../technotes/guides/sound">Sound</a>
-</ul>
-
-
-@since 1.3
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/Action.java b/jdk/src/java.desktop/share/classes/javax/swing/Action.java
index 8a7ae6e..f34fe51 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/Action.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/Action.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -384,8 +384,8 @@
      * @param sender the object to check, can be null
      * @return {@code true} if the action should be performed with the sender
      *         object, must be false if the action is disabled.
-     * @see isEnabled
-     * @see setEnabled
+     * @see #isEnabled
+     * @see #setEnabled
      */
     default boolean accept(Object sender) {
         return isEnabled();
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/ActionPropertyChangeListener.java b/jdk/src/java.desktop/share/classes/javax/swing/ActionPropertyChangeListener.java
index 0d33a11..1b97bb0 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/ActionPropertyChangeListener.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/ActionPropertyChangeListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
  * a strong reference will be held to the containing class, which in most
  * cases defeats the purpose of this class.
  *
- * @param T the type of JComponent the underlying Action is attached to
+ * @param <T> the type of JComponent the underlying Action is attached to
  *
  * @author Georges Saab
  * @see AbstractButton
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/Autoscroller.java b/jdk/src/java.desktop/share/classes/javax/swing/Autoscroller.java
index 6def237..979c359 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/Autoscroller.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/Autoscroller.java
@@ -82,6 +82,7 @@
     /**
      * Starts the timer targeting the passed in component.
      */
+    @SuppressWarnings("deprecation")
     private void start(JComponent c, MouseEvent e) {
         Point screenLocation = c.getLocationOnScreen();
 
@@ -156,6 +157,7 @@
      * ActionListener method. Invoked when the Timer fires. This will scroll
      * if necessary.
      */
+    @SuppressWarnings("deprecation")
     public void actionPerformed(ActionEvent x) {
         JComponent component = Autoscroller.component;
 
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/DefaultButtonModel.java b/jdk/src/java.desktop/share/classes/javax/swing/DefaultButtonModel.java
index ac8216a..5bcf6ef 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/DefaultButtonModel.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/DefaultButtonModel.java
@@ -239,6 +239,7 @@
     /**
      * {@inheritDoc}
      */
+    @SuppressWarnings("deprecation")
     public void setPressed(boolean b) {
         if((isPressed() == b) || !isEnabled()) {
             return;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JComboBox.java b/jdk/src/java.desktop/share/classes/javax/swing/JComboBox.java
index cbaa3ef..3f82483 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JComboBox.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JComboBox.java
@@ -1235,6 +1235,7 @@
      *
      * @see EventListenerList
      */
+    @SuppressWarnings("deprecation")
     protected void fireActionEvent() {
         if (!firingActionEvent) {
             // Set flag to ensure that an infinite loop is not created
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java
index 02813cb..4e9884d 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java
@@ -429,6 +429,7 @@
      * Returns the Set of <code>KeyStroke</code>s to use if the component
      * is managing focus for forward focus traversal.
      */
+    @SuppressWarnings("deprecation")
     static Set<KeyStroke> getManagingFocusForwardTraversalKeys() {
         synchronized(JComponent.class) {
             if (managingFocusForwardTraversalKeys == null) {
@@ -445,6 +446,7 @@
      * Returns the Set of <code>KeyStroke</code>s to use if the component
      * is managing focus for backward focus traversal.
      */
+    @SuppressWarnings("deprecation")
     static Set<KeyStroke> getManagingFocusBackwardTraversalKeys() {
         synchronized(JComponent.class) {
             if (managingFocusBackwardTraversalKeys == null) {
@@ -2886,6 +2888,7 @@
      *
      * @since 1.3
      */
+    @SuppressWarnings("deprecation")
     protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,
                                         int condition, boolean pressed) {
         InputMap map = getInputMap(condition, false);
@@ -3730,7 +3733,11 @@
          * Fire PropertyChange listener, if one is registered,
          * when focus events happen
          * @since 1.3
+         * @deprecated This class is no longer used or needed.
+         * {@code java.awt.Component.AccessibleAWTComponent} provides
+         * the same functionality and it is handled in {@Component}.
          */
+        @Deprecated
         protected class AccessibleFocusHandler implements FocusListener {
            public void focusGained(FocusEvent event) {
                if (accessibleContext != null) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JFileChooser.java b/jdk/src/java.desktop/share/classes/javax/swing/JFileChooser.java
index b37dd05..04a1e76 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JFileChooser.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JFileChooser.java
@@ -1754,6 +1754,7 @@
      *                the event
      * @see EventListenerList
      */
+    @SuppressWarnings("deprecation")
     protected void fireActionPerformed(String command) {
         // Guaranteed to return a non-null array
         Object[] listeners = listenerList.getListenerList();
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java b/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java
index 833b09e..1eca775 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java
@@ -286,8 +286,7 @@
             super.remove(oldGlassPane);
         }
         if (glassPane != null) {
-            AWTAccessor.getComponentAccessor().setMixingCutoutShape(glassPane,
-                    new Rectangle());
+            glassPane.setMixingCutoutShape(new Rectangle());
             glassPane.setVisible(isGlassPaneVisible);
             super.addImpl(glassPane, null, 0);
         }
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JList.java b/jdk/src/java.desktop/share/classes/javax/swing/JList.java
index 5e98663..4d96648 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JList.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JList.java
@@ -1516,6 +1516,7 @@
      * @see JComponent#setToolTipText
      * @see JComponent#getToolTipText
      */
+    @SuppressWarnings("deprecation")
     public String getToolTipText(MouseEvent event) {
         if(event != null) {
             Point p = event.getPoint();
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JMenuItem.java b/jdk/src/java.desktop/share/classes/javax/swing/JMenuItem.java
index cf80c98..e449df3 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JMenuItem.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JMenuItem.java
@@ -412,6 +412,7 @@
      * @param path  the <code>MenuElement</code> path array
      * @param manager   the <code>MenuSelectionManager</code>
      */
+    @SuppressWarnings("deprecation")
     public void processMouseEvent(MouseEvent e,MenuElement path[],MenuSelectionManager manager) {
         processMenuDragMouseEvent(
                  new MenuDragMouseEvent(e.getComponent(), e.getID(),
@@ -435,6 +436,7 @@
      * @param path the <code>MenuElement</code> path array
      * @param manager   the <code>MenuSelectionManager</code>
      */
+    @SuppressWarnings("deprecation")
     public void processKeyEvent(KeyEvent e,MenuElement path[],MenuSelectionManager manager) {
         if (DEBUG) {
             System.out.println("in JMenuItem.processKeyEvent/3 for " + getText() +
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java b/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java
index f225b2d..e793d76 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java
@@ -1385,6 +1385,7 @@
      * @param path the <code>MenuElement</code> path array
      * @param manager   the <code>MenuSelectionManager</code>
      */
+    @SuppressWarnings("deprecation")
     public void processKeyEvent(KeyEvent e, MenuElement path[],
                                 MenuSelectionManager manager) {
         MenuKeyEvent mke = new MenuKeyEvent(e.getComponent(), e.getID(),
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JRootPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JRootPane.java
index 3228af0..7407a09 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JRootPane.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JRootPane.java
@@ -663,8 +663,7 @@
             throw new NullPointerException("glassPane cannot be set to null.");
         }
 
-        AWTAccessor.getComponentAccessor().setMixingCutoutShape(glass,
-                new Rectangle());
+        glass.setMixingCutoutShape(new Rectangle());
 
         boolean visible = false;
         if (glassPane != null && glassPane.getParent() == this) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JSpinner.java b/jdk/src/java.desktop/share/classes/javax/swing/JSpinner.java
index b9a26cf..7356bac 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JSpinner.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JSpinner.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1202,7 +1202,7 @@
          * on the new <code>JFormattedTextField</code>.
          *
          * @param spinner the spinner whose model <code>this</code> editor will monitor
-         * @param decimalFormatPattern the initial pattern for the
+         * @param format the initial pattern for the
          *     <code>DecimalFormat</code> object that's used to display
          *     and parse the value of the text field.
          * @exception IllegalArgumentException if the spinners model is not
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JTable.java b/jdk/src/java.desktop/share/classes/javax/swing/JTable.java
index 94391d6..e698994 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JTable.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JTable.java
@@ -3410,8 +3410,10 @@
                 // Convert the event to the renderer's coordinate system
                 Rectangle cellRect = getCellRect(hitRowIndex, hitColumnIndex, false);
                 p.translate(-cellRect.x, -cellRect.y);
+                @SuppressWarnings("deprecation")
+                final int modifiers = event.getModifiers();
                 MouseEvent newEvent = new MouseEvent(component, event.getID(),
-                                          event.getWhen(), event.getModifiers(),
+                                          event.getWhen(), modifiers,
                                           p.x, p.y,
                                           event.getXOnScreen(),
                                           event.getYOnScreen(),
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JTextField.java b/jdk/src/java.desktop/share/classes/javax/swing/JTextField.java
index d3ec0da..b8e3ffe 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JTextField.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JTextField.java
@@ -485,6 +485,7 @@
      * first order.
      * @see EventListenerList
      */
+    @SuppressWarnings("deprecation")
     protected void fireActionPerformed() {
         // Guaranteed to return a non-null array
         Object[] listeners = listenerList.getListenerList();
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JToggleButton.java b/jdk/src/java.desktop/share/classes/javax/swing/JToggleButton.java
index 56de72a..b66465d 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JToggleButton.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JToggleButton.java
@@ -372,6 +372,7 @@
         /**
          * Sets the pressed state of the toggle button.
          */
+        @SuppressWarnings("deprecation")
         public void setPressed(boolean b) {
             if ((isPressed() == b) || !isEnabled()) {
                 return;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JTree.java b/jdk/src/java.desktop/share/classes/javax/swing/JTree.java
index 7739b9b..34f779a 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JTree.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JTree.java
@@ -1568,9 +1568,10 @@
                     Rectangle       pathBounds = getPathBounds(path);
 
                     p.translate(-pathBounds.x, -pathBounds.y);
+                    @SuppressWarnings("deprecation")
+                    final int modifiers = event.getModifiers();
                     newEvent = new MouseEvent(rComponent, event.getID(),
-                                          event.getWhen(),
-                                              event.getModifiers(),
+                                          event.getWhen(), modifiers,
                                               p.x, p.y,
                                               event.getXOnScreen(),
                                               event.getYOnScreen(),
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/KeyboardManager.java b/jdk/src/java.desktop/share/classes/javax/swing/KeyboardManager.java
index e083576..40cd7ae 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/KeyboardManager.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/KeyboardManager.java
@@ -207,6 +207,7 @@
       * want a crack at the event.
       * If one of them wants it, then it will "DO-THE-RIGHT-THING"
       */
+    @SuppressWarnings("deprecation")
     public boolean fireKeyboardAction(KeyEvent e, boolean pressed, Container topAncestor) {
 
          if (e.isConsumed()) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java b/jdk/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java
index 6df0d67..bb9c664 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java
@@ -212,6 +212,7 @@
      *
      * @param event  a MouseEvent object
      */
+    @SuppressWarnings("deprecation")
     public void processMouseEvent(MouseEvent event) {
         int screenX,screenY;
         Point p;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java b/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
index abd6b05..3f72d64 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java
@@ -346,6 +346,7 @@
      *
      * @return the new mouse event
      */
+    @SuppressWarnings("deprecation")
     public static MouseEvent convertMouseEvent(Component source,
                                                MouseEvent sourceEvent,
                                                Component destination) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/SwingWorker.java b/jdk/src/java.desktop/share/classes/javax/swing/SwingWorker.java
index 40da1c2..26a122c 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/SwingWorker.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/SwingWorker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -575,7 +575,7 @@
      * For example:
      *
      * <pre>
-     * class SwingWorkerCompletionWaiter extends PropertyChangeListener {
+     * class SwingWorkerCompletionWaiter implements PropertyChangeListener {
      *     private JDialog dialog;
      *
      *     public SwingWorkerCompletionWaiter(JDialog dialog) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java b/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java
index c645d93..a751ad8 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/ToolTipManager.java
@@ -89,6 +89,7 @@
      */
     protected boolean heavyWeightPopupEnabled = false;
 
+    @SuppressWarnings("deprecation")
     ToolTipManager() {
         enterTimer = new Timer(750, new insideTimerAction());
         enterTimer.setRepeats(false);
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/border/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/border/package-info.java
new file mode 100644
index 0000000..a964f6d
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/border/package-info.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interface for drawing specialized borders around a Swing
+ * component. You can subclass these classes to create customized borders for
+ * your components instead of using the default borders provided by the
+ * look-and-feel being used.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.html"
+ *     target="_top">How to Use Borders</a>,
+ *     a section in <em>The Java Tutorial</em></li>
+ * </ul>
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.border;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/border/package.html b/jdk/src/java.desktop/share/classes/javax/swing/border/package.html
deleted file mode 100644
index b83b1de..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/border/package.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides classes and interface for drawing
-specialized borders around a Swing component.
-You can subclass these classes to create customized borders
-for your components instead of using the default borders
-provided by the look-and-feel being used.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.html"
-      target="_top">How to Use Borders</a>,
-      a section in <em>The Java Tutorial</em>
-</ul>
-
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/colorchooser/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/colorchooser/package-info.java
new file mode 100644
index 0000000..95df95c
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/colorchooser/package-info.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Contains classes and interfaces used by the {@code JColorChooser} component.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * <h2>Related Documentation </h2>
+ * This document forms the complete API specification. For overviews, tutorials,
+ * examples, guides, and tool documentation, please see:
+ * <ul>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/colorchooser.html"
+ *     target="_top">How to Use Color Choosers</a>,
+ *     a section in <em>The Java Tutorial</em></li>
+ *     <li><a href="../../../../technotes/guides/intl/index.html"
+ *     target="_top">Internationalization Documentation</a></li>
+ *     <li><a href="../../../../technotes/guides/imf/index.html"
+ *     target="_top">Input Method Framework Documentation</a></li>
+ * </ul>
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.colorchooser;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/colorchooser/package.html b/jdk/src/java.desktop/share/classes/javax/swing/colorchooser/package.html
deleted file mode 100644
index 43ff5ee..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/colorchooser/package.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Contains classes and interfaces used by the <code>JColorChooser</code>
-component.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-
-<h2>Related Documentation </h2>
-
-This document forms the complete API specification.  For overviews, tutorials, 
-examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/colorchooser.html" target="_top">How to Use Color Choosers</a>,
-      a section in <em>The Java Tutorial</em>
-
-  <li><a href="../../../../technotes/guides/intl/index.html"
-      target="_top">Internationalization Documentation</a>
-
-  <li><a href="../../../../technotes/guides/imf/index.html"
-      target="_top">Input Method Framework Documentation</a>
-</ul>
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/event/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/event/package-info.java
new file mode 100644
index 0000000..33dca2d
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/event/package-info.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides for events fired by Swing components. It contains event classes and
+ * corresponding event listener interfaces for events fired by Swing components
+ * in addition to those events in the {@link java.awt.event} package.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/events/index.html"
+ *     target="_top">Writing Event Listeners</a>,
+ *     a section in <em>The Java Tutorial</em></li>
+ * </ul>
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.event;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/event/package.html b/jdk/src/java.desktop/share/classes/javax/swing/event/package.html
deleted file mode 100644
index 070ae42..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/event/package.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides for events fired by Swing components.  It contains
-event classes and corresponding event listener interfaces for events
-fired by Swing components in addition to those events in the
-java.awt.event package.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/events/index.html"
-      target="_top">Writing Event Listeners</a>,
-      a section in <em>The Java Tutorial</em>
-</ul>
-
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/filechooser/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/filechooser/package-info.java
new file mode 100644
index 0000000..eb16d54
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/filechooser/package-info.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Contains classes and interfaces used by the {@code JFileChooser} component.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * <h2>Related Documentation </h2>
+ * This document forms the complete API specification. For overviews, tutorials,
+ * examples, guides, and tool documentation, please see:
+ * <ul>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html"
+ *     target="_top">How to Use File Choosers</a>,
+ *     a section in <em>The Java Tutorial</em></li>
+ *     <li><a href="../../../../technotes/guides/intl/index.html"
+ *     target="_top">Internationalization Documentation</a></li>
+ *     <li><a href="../../../../technotes/guides/imf/index.html"
+ *     target="_top">Input Method Framework Documentation</a></li>
+ * </ul>
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.filechooser;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/filechooser/package.html b/jdk/src/java.desktop/share/classes/javax/swing/filechooser/package.html
deleted file mode 100644
index fa06236..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/filechooser/package.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-
-<body bgcolor="white">
-
-Contains classes and interfaces used by the <code>JFileChooser</code> component.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-
-<h2>Related Documentation </h2>
-
-This document forms the complete API specification.  For overviews, tutorials,
-examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html" target="_top">How to Use File Choosers</a>,
-      a section in <em>The Java Tutorial</em>
-  <li><a href="../../../../technotes/guides/intl/index.html"
-      target="_top">Internationalization Documentation</a>
-
-  <li><a href="../../../../technotes/guides/imf/index.html"
-      target="_top">Input Method Framework Documentation</a>
-</ul>
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/package-info.java
new file mode 100644
index 0000000..0749cf7
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/package-info.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides a set of &quot;lightweight&quot; (all-Java language) components
+ * that, to the maximum degree possible, work the same on all platforms. For a
+ * programmer's guide to using these components, see
+ * <a href="http://docs.oracle.com/javase/tutorial/uiswing/index.html"
+ * target="_top">Creating a GUI with JFC/Swing</a>, a trail in
+ * <em>The Java Tutorial</em>. For other resources, see
+ * <a href="#related">Related Documentation</a>.
+ *
+ * <h2><a name="threading">Swing's Threading Policy</a></h2>
+ * In general Swing is not thread safe. All Swing components and related
+ * classes, unless otherwise documented, must be accessed on the event
+ * dispatching thread.
+ * <p>
+ * Typical Swing applications do processing in response to an event generated
+ * from a user gesture. For example, clicking on a {@code JButton} notifies all
+ * {@code ActionListeners} added to the {@code JButton}. As all events generated
+ * from a user gesture are dispatched on the event dispatching thread, most
+ * developers are not impacted by the restriction.
+ * <p>
+ * Where the impact lies, however, is in constructing and showing a Swing
+ * application. Calls to an application's {@code main} method, or methods in
+ * {@code Applet}, are not invoked on the event dispatching thread. As such,
+ * care must be taken to transfer control to the event dispatching thread when
+ * constructing and showing an application or applet. The preferred way to
+ * transfer control and begin working with Swing is to use {@code invokeLater}.
+ * The {@code invokeLater} method schedules a {@code Runnable} to be processed
+ * on the event dispatching thread. The following two examples work equally well
+ * for transferring control and starting up a Swing application:
+ * <pre>
+ * import javax.swing.SwingUtilities;
+ *
+ * public class MyApp implements Runnable {
+ *     public void run() {
+ *         // Invoked on the event dispatching thread.
+ *         // Construct and show GUI.
+ *     }
+ *
+ *     public static void main(String[] args) {
+ *         SwingUtilities.invokeLater(new MyApp());
+ *     }
+ * }</pre>
+ * Or:<pre>
+ * import javax.swing.SwingUtilities;
+ *
+ * public class MyApp {
+ *     MyApp(String[] args) {
+ *         // Invoked on the event dispatching thread.
+ *         // Do any initialization here.
+ *     }
+ *
+ *     public void show() {
+ *         // Show the UI.
+ *     }
+ *
+ *     public static void main(final String[] args) {
+ *         // Schedule a job for the event-dispatching thread:
+ *         // creating and showing this application's GUI.
+ *         SwingUtilities.invokeLater(new Runnable() {
+ *             public void run() {
+ *                 new MyApp(args).show();
+ *             }
+ *         });
+ *     }
+ * }</pre>
+ * This restriction also applies to models attached to Swing components. For
+ * example, if a {@code TableModel} is attached to a {@code JTable}, the
+ * {@code TableModel} should only be modified on the event dispatching thread.
+ * If you modify the model on a separate thread you run the risk of exceptions
+ * and possible display corruption.
+ * <p>
+ * As all events are delivered on the event dispatching thread, care must be
+ * taken in event processing. In particular, a long running task, such as
+ * network io or computational intensive processing, executed on the event
+ * dispatching thread blocks the event dispatching thread from dispatching any
+ * other events. While the event dispatching thread is blocked the application
+ * is completely unresponsive to user input. Refer to
+ * {@link javax.swing.SwingWorker} for the preferred way to do such processing
+ * when working with Swing.
+ * <p>
+ * More information on this topic can be found in the
+ * <a href="http://docs.oracle.com/javase/tutorial/uiswing/">Swing tutorial</a>,
+ * in particular the section on
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
+ * Concurrency in Swing</a>.
+ *
+ * <h2><a name="related">Related Documentation</a></h2>
+ * For overviews, tutorials, examples, guides, and other documentation,
+ * please see:
+ * <ul>
+ *     <li><a href="http://www.oracle.com/technetwork/java/javase/tech/articles-jsp-139072.html"
+ *     target="_top">The Swing Connection</a></li>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/"
+ *     target="_top">The Java Tutorial</a></li>
+ *     <li><a href="http://www.oracle.com/technetwork/java/javase/training/index.html"
+ *     target="_top">Online Training</a>
+ *     at the Java Developer Connection <sup>SM</sup></li>
+ *     <li><a href="http://www.oracle.com/technetwork/java/javase/tech/index-jsp-142216.html"
+ *     target="_top">Java Foundation Classes (JFC)</a> home page</li>
+ * </ul>
+ *
+ * @serial exclude
+ */
+package javax.swing;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/package.html b/jdk/src/java.desktop/share/classes/javax/swing/package.html
deleted file mode 100644
index 934bb90..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/package.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-
-<HEAD>
-<!--
-Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-        <META NAME="Author" Content="Eric Armstrong">
-        <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
-        <TITLE>swing package</TITLE>
-</HEAD>
-
-<BODY bgcolor="white">
-
-<P>Provides a set of &quot;lightweight&quot;
-(all-Java language) components that,
-to the maximum degree possible, work the same on all platforms.
-For a programmer's guide to using these components, see
-<a href="http://docs.oracle.com/javase/tutorial/uiswing/index.html"
-target="_top">Creating
-a GUI with JFC/Swing</a>, a trail in <em>The Java Tutorial</em>.
-For other resources, see 
-<a href="#related">Related Documentation</a>.
-
-<H2><a name="threading">Swing's Threading Policy</a></h2>
-
-In general Swing is not thread safe. All Swing components and related
-classes, unless otherwise documented, must be accessed on the event
-dispatching thread.
-<p>
-Typical Swing applications do processing in response to an event
-generated from a user gesture. For example, clicking on a {@code
-JButton} notifies all {@code ActionListeners} added to the {@code
-JButton}. As all events generated from a user gesture are
-dispatched on the event dispatching thread, most developers are not
-impacted by the restriction.
-<p>
-Where the impact lies, however, is in constructing and showing a
-Swing application. Calls to an application's {@code main} method,
-or methods in {@code Applet}, are not invoked on the event
-dispatching thread. As such, care must be taken to transfer control
-to the event dispatching thread when constructing and showing an
-application or applet. The preferred way to transfer control and begin
-working with Swing is to use {@code invokeLater}. The {@code
-invokeLater} method schedules a {@code Runnable} to be processed on
-the event dispatching thread. The following two examples work equally
-well for transferring control and starting up a Swing application:
-<pre>
-import javax.swing.SwingUtilities;
-
-public class MyApp implements Runnable {
-    public void run() {
-        // Invoked on the event dispatching thread.
-        // Construct and show GUI.
-    }
-
-    public static void main(String[] args) {
-        SwingUtilities.invokeLater(new MyApp());
-    }
-}
-</pre>
-Or:
-<pre>
-import javax.swing.SwingUtilities;
-
-public class MyApp {
-    MyApp(String[] args) {
-        // Invoked on the event dispatching thread.
-        // Do any initialization here.
-    }
-
-    public void show() {
-        // Show the UI.
-    }
-
-    public static void main(final String[] args) {
-        // Schedule a job for the event-dispatching thread:
-        // creating and showing this application's GUI.
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                new MyApp(args).show();
-            }
-        });
-    }
-}
-</pre>
-This restriction also applies to models attached to Swing components.
-For example, if a {@code TableModel} is attached to a {@code
-JTable}, the {@code TableModel} should only be modified on the
-event dispatching thread. If you modify the model on a separate
-thread you run the risk of exceptions and possible display
-corruption.
-<p>
-As all events are delivered on the event dispatching thread, care must
-be taken in event processing. In particular, a long running task, such
-as network io or computational intensive processing, executed on the
-event dispatching thread blocks the event dispatching thread from
-dispatching any other events. While the event dispatching thread is
-blocked the application is completely unresponsive to user
-input. Refer to {@link javax.swing.SwingWorker} for the preferred way to do such
-processing when working with Swing.
-<p>
-More information on this topic can be found in the
-<a href="http://docs.oracle.com/javase/tutorial/uiswing/">Swing tutorial</a>,
-in particular the section on
-<a href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">Concurrency in Swing</a>.
-
-
-<H2>
-<a name="related">Related Documentation</a>
-</H2>
-<P>For overviews, tutorials, examples, guides, and other documentation, please see:
-
-<UL>
-   <LI><A HREF="http://www.oracle.com/technetwork/java/javase/tech/articles-jsp-139072.html"
-   target="_top">The Swing Connection</A>
-   <LI><A HREF="http://docs.oracle.com/javase/tutorial/"
-   target="_top">The Java Tutorial</A>
-   <LI><A HREF="http://www.oracle.com/technetwork/java/javase/training/index.html"
-   target="_top">Online Training</A> at the Java Developer Connection<font size=-2><sup>SM</sup></font>
-   <LI><A HREF="http://www.oracle.com/technetwork/java/javase/tech/index-jsp-142216.html"
-   target="_top">Java Foundation Classes (JFC)</A> home page
-</UL>
-
-@serial exclude
-
-</BODY>
-</HTML>
-
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
index b7f2ff6..403fe6a 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
@@ -1839,6 +1839,7 @@
         // key.  If it finds a key event that wasn't a navigation key it
         // dispatches it to JComboBox.selectWithKeyChar() so that it can do
         // type-ahead.
+        @SuppressWarnings("deprecation")
         public void keyPressed( KeyEvent e ) {
             if ( isNavigationKey(e.getKeyCode(), e.getModifiers()) ) {
                 lastTime = 0L;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java
index f2b72e0..91afce1 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboPopup.java
@@ -528,6 +528,7 @@
      */
     protected JList<Object> createList() {
         return new JList<Object>( comboBox.getModel() ) {
+            @SuppressWarnings("deprecation")
             public void processMouseEvent(MouseEvent e)  {
                 if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                     // Fix for 4234053. Filter out the Control Key from the list.
@@ -1238,6 +1239,7 @@
     protected MouseEvent convertMouseEvent( MouseEvent e ) {
         Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),
                                                             e.getPoint(), list );
+        @SuppressWarnings("deprecation")
         MouseEvent newEvent = new MouseEvent( (Component)e.getSource(),
                                               e.getID(),
                                               e.getWhen(),
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java
index 2760b1d..4122573 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java
@@ -382,6 +382,7 @@
         return c.getComponentOrientation().isLeftToRight();
     }
 
+    @SuppressWarnings("deprecation")
     static boolean isMenuShortcutKeyDown(InputEvent event) {
         return (event.getModifiers() &
                 Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) != 0;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java
index dbcfb30..86d6686 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java
@@ -1024,7 +1024,7 @@
                 return;
             }
         }
-
+        @SuppressWarnings("deprecation")
         public void mouseDragged(MouseEvent e) {
 
             if ( startingBounds == null ) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
index e797c93..44d062b 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
@@ -1026,6 +1026,7 @@
                 manager.processMouseEvent(e);
             }
         }
+        @SuppressWarnings("deprecation")
         public void mouseEntered(MouseEvent e) {
             MenuSelectionManager manager = MenuSelectionManager.defaultManager();
             int modifiers = e.getModifiers();
@@ -1037,6 +1038,7 @@
             manager.setSelectedPath(getPath());
              }
         }
+        @SuppressWarnings("deprecation")
         public void mouseExited(MouseEvent e) {
             MenuSelectionManager manager = MenuSelectionManager.defaultManager();
 
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java
index 98afcc9..01a38ce 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java
@@ -123,6 +123,7 @@
                                            getPropertyPrefix() + ".actionMap");
     }
 
+    @SuppressWarnings("deprecation")
     void updateMnemonicBinding() {
         int mnemonic = menuItem.getModel().getMnemonic();
         int[] shortcutKeys = (int[])DefaultLookup.get(menuItem, this,
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
index 737d4d0..d98a5c7 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java
@@ -268,6 +268,7 @@
         return list;
     }
 
+    @SuppressWarnings("deprecation")
     public boolean isPopupTrigger(MouseEvent e) {
         return ((e.getID()==MouseEvent.MOUSE_RELEASED)
                 && ((e.getModifiers() & MouseEvent.BUTTON3_MASK)!=0));
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
index 5b0c961..79a4131 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
@@ -328,6 +328,7 @@
     /**
      * Installs the UI defaults.
      */
+    @SuppressWarnings("deprecation")
     protected void installDefaults(){
         LookAndFeel.installBorder(splitPane, "SplitPane.border");
         LookAndFeel.installColors(splitPane, "SplitPane.background",
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java
index b80d7ef..a7985bd 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java
@@ -868,6 +868,7 @@
 
         public void keyReleased(KeyEvent e) { }
 
+        @SuppressWarnings("deprecation")
         public void keyTyped(KeyEvent e) {
             KeyStroke keyStroke = KeyStroke.getKeyStroke(e.getKeyChar(),
                     e.getModifiers());
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java
index 8acc5d7..05efd8f 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -525,7 +525,7 @@
      * adding 'TAB' and 'SHIFT-TAB' to traversalKeysSet in case
      * editor is non editable
      */
-
+    @SuppressWarnings("deprecation")
     void updateFocusTraversalKeys() {
         /*
          * Fix for 4514331 Non-editable JTextArea and similar
@@ -1783,7 +1783,7 @@
          *
          * @param axis may be either X_AXIS or Y_AXIS
          * @param len specifies where a break is desired in the span
-         * @param the current allocation of the view
+         * @param a the current allocation of the view
          * @return the fragment of the view that represents the given span
          *   if the view can be broken, otherwise null
          */
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/LazyActionMap.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/LazyActionMap.java
index d4e3854..3187cdd 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/LazyActionMap.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/LazyActionMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,6 @@
      * <p>
      * This should be used if the ActionMap can be shared.
      *
-     * @param c JComponent to install the ActionMap on.
      * @param loaderClass Class object that gets loadActionMap invoked
      *                    on.
      * @param defaultsKey Key to use to defaults table to check for
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/package-info.java
new file mode 100644
index 0000000..552be4d
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/package-info.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides user interface objects built according to the Basic look and feel.
+ * The Basic look and feel provides default behavior used by many look and feel
+ * packages. It contains components, layout managers, events, event listeners,
+ * and adapters. You can subclass the classes in this package to create your own
+ * customized look and feel.
+ * <p>
+ * These classes are designed to be used while the corresponding
+ * {@code LookAndFeel} class has been installed
+ * (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
+ * Using them while a different {@code LookAndFeel} is installed may produce
+ * unexpected results, including exceptions. Additionally, changing the
+ * {@code LookAndFeel} maintained by the {@code UIManager} without updating the
+ * corresponding {@code ComponentUI} of any {@code JComponent}s may also produce
+ * unexpected results, such as the wrong colors showing up, and is generally not
+ * encouraged.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.plaf.basic;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/package.html b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/package.html
deleted file mode 100644
index 347fc7c..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/package.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides user interface objects built according to the
-Basic look and feel. The Basic look and feel provides default 
-behavior used by many look and feel packages. 
-It contains components, layout managers,
-events, event listeners, and adapters. 
-You can subclass the classes in
-this package to create your own customized look and feel.
-
-<p>These classes are designed to be used while the
-corresponding <code>LookAndFeel</code> class has been
-installed
-(<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
-Using them while a different <code>LookAndFeel</code> is installed
-may produce unexpected results, including exceptions.
-Additionally, changing the <code>LookAndFeel</code>
-maintained by the <code>UIManager</code> without updating the
-corresponding <code>ComponentUI</code> of any
-<code>JComponent</code>s may also produce unexpected results,
-such as the wrong colors showing up, and is generally not
-encouraged.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFontDesktopProperty.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFontDesktopProperty.java
index 94d591a..254325e 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFontDesktopProperty.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFontDesktopProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,8 +65,6 @@
      * Creates a MetalFontDesktopProperty.
      *
      * @param key Key used in looking up desktop value.
-     * @param toolkit Toolkit used to fetch property from, can be null
-     *        in which default will be used.
      * @param type Type of font being used, corresponds to MetalTheme font
      *        type.
      */
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java
index b7cf964..b433ef1 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java
@@ -33,6 +33,8 @@
 import java.util.Enumeration;
 import java.util.Vector;
 import sun.swing.CachedPainter;
+import static sun.swing.SwingUtilities2.setAntialiasingHintForScaledGraphics;
+import static sun.swing.SwingUtilities2.getAndSetAntialisingHintForScaledGraphics;
 
 /**
  * Factory object that vends <code>Icon</code>s for
@@ -1247,9 +1249,15 @@
 
         protected void drawCheck(Component c, Graphics g, int x, int y) {
             int controlSize = getControlSize();
-            g.fillRect( x+3, y+5, 2, controlSize-8 );
-            g.drawLine( x+(controlSize-4), y+3, x+5, y+(controlSize-6) );
-            g.drawLine( x+(controlSize-4), y+4, x+5, y+(controlSize-5) );
+            int csx = controlSize - 3;
+            int csy1 = controlSize - 6;
+            int csy2 = controlSize - 4;
+            int csy3 = controlSize - 3;
+            int[] xPoints = {3, 5, 5, csx, csx, 5, 5, 3};
+            int[] yPoints = {5, 5, csy1, 2, 4, csy2, csy3, csy3};
+            g.translate(x, y);
+            g.fillPolygon(xPoints, yPoints, 8);
+            g.translate(-x, -y);
         }
 
         public int getIconWidth() {
@@ -1323,8 +1331,12 @@
         }
 
         public void paintIcon(Component c, Graphics g, int x, int y) {
+
+            Object aaHint = getAndSetAntialisingHintForScaledGraphics(g);
+
             if (MetalLookAndFeel.usingOcean()) {
                 paintOceanIcon(c, g, x, y);
+                setAntialiasingHintForScaledGraphics(g, aaHint);
                 return;
             }
             JRadioButton rb = (JRadioButton)c;
@@ -1358,51 +1370,25 @@
 
             // draw Dark Circle (start at top, go clockwise)
             g.setColor(darkCircle);
-            g.drawLine( 4, 0,  7, 0);
-            g.drawLine( 8, 1,  9, 1);
-            g.drawLine(10, 2, 10, 3);
-            g.drawLine(11, 4, 11, 7);
-            g.drawLine(10, 8, 10, 9);
-            g.drawLine( 9,10,  8,10);
-            g.drawLine( 7,11,  4,11);
-            g.drawLine( 3,10,  2,10);
-            g.drawLine( 1, 9,  1, 8);
-            g.drawLine( 0, 7,  0, 4);
-            g.drawLine( 1, 3,  1, 2);
-            g.drawLine( 2, 1,  3, 1);
+            g.drawOval(0, 0, 11, 11);
 
             // draw Inner Left (usually) White Arc
             //  start at lower left corner, go clockwise
             g.setColor(whiteInnerLeftArc);
-            g.drawLine( 2, 9,  2, 8);
-            g.drawLine( 1, 7,  1, 4);
-            g.drawLine( 2, 2,  2, 3);
-            g.drawLine( 2, 2,  3, 2);
-            g.drawLine( 4, 1,  7, 1);
-            g.drawLine( 8, 2,  9, 2);
+            g.drawArc(1, 1, 10, 10, 60, 160);
             // draw Outer Right White Arc
             //  start at upper right corner, go clockwise
             g.setColor(whiteOuterRightArc);
-            g.drawLine(10, 1, 10, 1);
-            g.drawLine(11, 2, 11, 3);
-            g.drawLine(12, 4, 12, 7);
-            g.drawLine(11, 8, 11, 9);
-            g.drawLine(10,10, 10,10);
-            g.drawLine( 9,11,  8,11);
-            g.drawLine( 7,12,  4,12);
-            g.drawLine( 3,11,  2,11);
+            g.drawArc(-1, -1, 13, 13, 235, 180);
 
             // selected dot
             if ( drawDot ) {
                 g.setColor(dotColor);
-                g.fillRect( 4, 4,  4, 4);
-                g.drawLine( 4, 3,  7, 3);
-                g.drawLine( 8, 4,  8, 7);
-                g.drawLine( 7, 8,  4, 8);
-                g.drawLine( 3, 7,  3, 4);
+                g.fillOval(2, 2, 7, 7);
             }
 
             g.translate(-x, -y);
+            setAntialiasingHintForScaledGraphics(g, aaHint);
         }
 
         public int getIconWidth() {
@@ -2051,16 +2037,17 @@
                     g.setColor( b.getForeground() );
                 }
             }
-            if( MetalUtils.isLeftToRight(b) ) {
-                g.drawLine( 0, 0, 0, 7 );
-                g.drawLine( 1, 1, 1, 6 );
-                g.drawLine( 2, 2, 2, 5 );
-                g.drawLine( 3, 3, 3, 4 );
+            if (MetalUtils.isLeftToRight(b)) {
+                int[] xPoints = {0, 3, 3, 0};
+                int[] yPoints = {0, 3, 4, 7};
+                g.fillPolygon(xPoints, yPoints, 4);
+                g.drawPolygon(xPoints, yPoints, 4);
+
             } else {
-                g.drawLine( 4, 0, 4, 7 );
-                g.drawLine( 3, 1, 3, 6 );
-                g.drawLine( 2, 2, 2, 5 );
-                g.drawLine( 1, 3, 1, 4 );
+                int[] xPoints = {4, 4, 1, 1};
+                int[] yPoints = {0, 7, 4, 3};
+                g.fillPolygon(xPoints, yPoints, 4);
+                g.drawPolygon(xPoints, yPoints, 4);
             }
 
             g.translate( -x, -y );
@@ -2138,10 +2125,7 @@
                     g.setColor( MetalLookAndFeel.getMenuDisabledForeground());
                 }
 
-                g.drawLine( 2, 2, 2, 6 );
-                g.drawLine( 3, 2, 3, 6 );
-                g.drawLine( 4, 4, 8, 0 );
-                g.drawLine( 4, 5, 9, 0 );
+                drawCheck(g);
             }
             g.translate( -x, -y );
         }
@@ -2217,15 +2201,18 @@
                     g.setColor( MetalLookAndFeel.getMenuDisabledForeground()  );
                 }
 
-                g.drawLine( 2, 2, 2, 6 );
-                g.drawLine( 3, 2, 3, 6 );
-                g.drawLine( 4, 4, 8, 0 );
-                g.drawLine( 4, 5, 9, 0 );
+                drawCheck(g);
             }
 
             g.translate( -x, -y );
         }
 
+        private void drawCheck(Graphics g) {
+            int[] xPoints = {2, 3, 3, 8, 9, 3, 2};
+            int[] yPoints = {2, 2, 5, 0, 0, 6, 6};
+            g.drawPolygon(xPoints, yPoints, 7);
+        }
+
         public int getIconWidth() { return menuCheckIconSize.width; }
 
         public int getIconHeight() { return menuCheckIconSize.height; }
@@ -2252,9 +2239,8 @@
                 else {
                     g.setColor(MetalLookAndFeel.getControlHighlight());
                 }
-                g.drawLine( 2, 9, 7, 9 );
-                g.drawLine( 9, 2, 9, 7 );
-                g.drawLine( 8, 8, 8, 8 );
+
+                g.drawArc(-1, -1, 10, 10, 245, 140);
 
                 if (isPressed || isArmed) {
                     g.setColor(MetalLookAndFeel.getControlInfo());
@@ -2266,14 +2252,8 @@
             else {
                 g.setColor( MetalLookAndFeel.getMenuDisabledForeground()  );
             }
-            g.drawLine( 2, 0, 6, 0 );
-            g.drawLine( 2, 8, 6, 8 );
-            g.drawLine( 0, 2, 0, 6 );
-            g.drawLine( 8, 2, 8, 6 );
-            g.drawLine( 1, 1, 1, 1 );
-            g.drawLine( 7, 1, 7, 1 );
-            g.drawLine( 1, 7, 1, 7 );
-            g.drawLine( 7, 7, 7, 7 );
+
+            g.drawOval(0, 0, 8, 8);
 
             if (isSelected) {
                 if (isEnabled) {
@@ -2288,11 +2268,9 @@
                 else {
                     g.setColor(MetalLookAndFeel.getMenuDisabledForeground());
                 }
-                g.drawLine( 3, 2, 5, 2 );
-                g.drawLine( 2, 3, 6, 3 );
-                g.drawLine( 2, 4, 6, 4 );
-                g.drawLine( 2, 5, 6, 5 );
-                g.drawLine( 3, 6, 5, 6 );
+
+                g.fillOval(2, 2, 4, 4);
+                g.drawOval(2, 2, 4, 4);
             }
 
             g.translate( -x, -y );
@@ -2300,8 +2278,12 @@
 
         public void paintIcon( Component c, Graphics g, int x, int y )
         {
+
+            Object aaHint = getAndSetAntialisingHintForScaledGraphics(g);
+
             if (MetalLookAndFeel.usingOcean()) {
                 paintOceanIcon(c, g, x, y);
+                setAntialiasingHintForScaledGraphics(g, aaHint);
                 return;
             }
             JMenuItem b = (JMenuItem) c;
@@ -2319,55 +2301,24 @@
                 if ( isPressed || isArmed )
                 {
                     g.setColor( MetalLookAndFeel.getPrimaryControl()  );
-                    g.drawLine( 3, 1, 8, 1 );
-                    g.drawLine( 2, 9, 7, 9 );
-                    g.drawLine( 1, 3, 1, 8 );
-                    g.drawLine( 9, 2, 9, 7 );
-                    g.drawLine( 2, 2, 2, 2 );
-                    g.drawLine( 8, 8, 8, 8 );
+                    g.drawOval(1, 1, 8, 8);
 
                     g.setColor( MetalLookAndFeel.getControlInfo()  );
-                    g.drawLine( 2, 0, 6, 0 );
-                    g.drawLine( 2, 8, 6, 8 );
-                    g.drawLine( 0, 2, 0, 6 );
-                    g.drawLine( 8, 2, 8, 6 );
-                    g.drawLine( 1, 1, 1, 1 );
-                    g.drawLine( 7, 1, 7, 1 );
-                    g.drawLine( 1, 7, 1, 7 );
-                    g.drawLine( 7, 7, 7, 7 );
+                    g.drawOval(0, 0, 8, 8);
                 }
                 else
                 {
                     g.setColor( MetalLookAndFeel.getControlHighlight()  );
-                    g.drawLine( 3, 1, 8, 1 );
-                    g.drawLine( 2, 9, 7, 9 );
-                    g.drawLine( 1, 3, 1, 8 );
-                    g.drawLine( 9, 2, 9, 7 );
-                    g.drawLine( 2, 2, 2, 2 );
-                    g.drawLine( 8, 8, 8, 8 );
+                    g.drawOval(1, 1, 8, 8);
 
                     g.setColor( MetalLookAndFeel.getControlDarkShadow()  );
-                    g.drawLine( 2, 0, 6, 0 );
-                    g.drawLine( 2, 8, 6, 8 );
-                    g.drawLine( 0, 2, 0, 6 );
-                    g.drawLine( 8, 2, 8, 6 );
-                    g.drawLine( 1, 1, 1, 1 );
-                    g.drawLine( 7, 1, 7, 1 );
-                    g.drawLine( 1, 7, 1, 7 );
-                    g.drawLine( 7, 7, 7, 7 );
+                    g.drawOval(0, 0, 8, 8);
                 }
             }
             else
             {
                 g.setColor( MetalLookAndFeel.getMenuDisabledForeground()  );
-                g.drawLine( 2, 0, 6, 0 );
-                g.drawLine( 2, 8, 6, 8 );
-                g.drawLine( 0, 2, 0, 6 );
-                g.drawLine( 8, 2, 8, 6 );
-                g.drawLine( 1, 1, 1, 1 );
-                g.drawLine( 7, 1, 7, 1 );
-                g.drawLine( 1, 7, 1, 7 );
-                g.drawLine( 7, 7, 7, 7 );
+                g.drawOval(0, 0, 8, 8);
             }
 
             if ( isSelected )
@@ -2388,14 +2339,12 @@
                     g.setColor( MetalLookAndFeel.getMenuDisabledForeground()  );
                 }
 
-                g.drawLine( 3, 2, 5, 2 );
-                g.drawLine( 2, 3, 6, 3 );
-                g.drawLine( 2, 4, 6, 4 );
-                g.drawLine( 2, 5, 6, 5 );
-                g.drawLine( 3, 6, 5, 6 );
+                g.fillOval(2, 2, 4, 4);
+                g.drawOval(2, 2, 4, 4);
             }
 
             g.translate( -x, -y );
+            setAntialiasingHintForScaledGraphics(g, aaHint);
         }
 
         public int getIconWidth() { return menuCheckIconSize.width; }
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java
index 1d163f2..18edf3d 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -338,7 +338,7 @@
      * and sets this value; the default is null, implying a native operating
      * system window title pane.
      *
-     * @param content the <code>JComponent</code> to use for the window title pane.
+     * @param titlePane the <code>JComponent</code> to use for the window title pane.
      */
     private void setTitlePane(JRootPane root, JComponent titlePane) {
         JLayeredPane layeredPane = root.getLayeredPane();
@@ -434,7 +434,7 @@
         /**
          * Returns the amount of space the layout would like to have.
          *
-         * @param the Container for which this layout manager is being used
+         * @param parent the Container for which this layout manager is being used
          * @return a Dimension object containing the layout's preferred size
          */
         public Dimension preferredLayoutSize(Container parent) {
@@ -486,7 +486,7 @@
         /**
          * Returns the minimum amount of space the layout needs.
          *
-         * @param the Container for which this layout manager is being used
+         * @param parent the Container for which this layout manager is being used
          * @return a Dimension object containing the layout's minimum size
          */
         public Dimension minimumLayoutSize(Container parent) {
@@ -537,7 +537,7 @@
         /**
          * Returns the maximum amount of space the layout can use.
          *
-         * @param the Container for which this layout manager is being used
+         * @param target the Container for which this layout manager is being used
          * @return a Dimension object containing the layout's maximum size
          */
         public Dimension maximumLayoutSize(Container target) {
@@ -601,7 +601,7 @@
          * Instructs the layout manager to perform the layout for the specified
          * container.
          *
-         * @param the Container for which this layout manager is being used
+         * @param parent the Container for which this layout manager is being used
          */
         public void layoutContainer(Container parent) {
             JRootPane root = (JRootPane) parent;
@@ -898,6 +898,7 @@
             w.setCursor(lastCursor);
         }
 
+        @SuppressWarnings("deprecation")
         public void mouseClicked(MouseEvent ev) {
             Window w = (Window)ev.getSource();
             Frame f = null;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java
index d851a16..d753708 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java
@@ -192,6 +192,7 @@
     // that subclasses that randomly invoke this method will see varying
     // results. If this becomes an issue, MetalToolTipUI should no longer be
     // shared.
+    @SuppressWarnings("deprecation")
     public String getAcceleratorString() {
         if (tip == null || isAcceleratorHidden()) {
             return "";
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/package-info.java
new file mode 100644
index 0000000..dbd8c71
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/package-info.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides user interface objects built according to the Java look and feel
+ * (once codenamed <em>Metal</em>), which is the default look and feel.
+ * <p>
+ * These classes are designed to be used while the corresponding
+ * {@code LookAndFeel} class has been installed
+ * (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
+ * Using them while a different {@code LookAndFeel} is installed may produce
+ * unexpected results, including exceptions. Additionally, changing the
+ * {@code LookAndFeel} maintained by the {@code UIManager} without updating the
+ * corresponding {@code ComponentUI} of any {@code JComponent}s may also produce
+ * unexpected results, such as the wrong colors showing up, and is generally not
+ * encouraged.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.plaf.metal;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/package.html b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/package.html
deleted file mode 100644
index db16ddd..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/package.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides user interface objects built according to
-the Java look and feel (once codenamed <em>Metal</em>),
-which is the default look and feel.
-
-<p>These classes are designed to be used while the
-corresponding <code>LookAndFeel</code> class has been
-installed
-(<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
-Using them while a different <code>LookAndFeel</code> is installed
-may produce unexpected results, including exceptions.
-Additionally, changing the <code>LookAndFeel</code>
-maintained by the <code>UIManager</code> without updating the
-corresponding <code>ComponentUI</code> of any
-<code>JComponent</code>s may also produce unexpected results,
-such as the wrong colors showing up, and is generally not
-encouraged.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/multi/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/multi/package-info.java
new file mode 100644
index 0000000..6857c3f
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/multi/package-info.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides user interface objects that combine two or more look and feels. When
+ * a component asks for its UI, this look and feel returns a multiplexing UI
+ * that handles all communications with both the default look and feel and one
+ * or more auxiliary look and feels. For example, if a user combines an
+ * auxiliary audio look and feel with the Motif look and feel, the
+ * {@code JButton.getUI} method would return an instance of
+ * {@code MultiButtonUI}, which would handle both a {@code MotifButtonUI} and an
+ * {@code AudioButtonUI}.
+ * <p>
+ * For more information, see
+ * <a href="doc-files/multi_tsc.html" target="_top">
+ *     Using the Multiplexing Look and Feel.</a>
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.plaf.multi;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/multi/package.html b/jdk/src/java.desktop/share/classes/javax/swing/plaf/multi/package.html
deleted file mode 100644
index 32b0d6b..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/multi/package.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides user interface objects that combine two or more look and feels.
-When a component asks
-for its UI, this look and feel returns a 
-multiplexing UI that handles all communications with both the 
-default look and feel and one or more auxiliary look and feels. 
-For example, if
-a user combines an auxiliary audio look and feel 
-with the Motif look and feel,
-the <code>JButton.getUI</code> method
-would return an instance of <code>MultiButtonUI</code>,
-which would handle both a
-<code>MotifButtonUI</code> and an <code>AudioButtonUI</code>. 
-   
-<p>
-
-For more information, see
-<a href="doc-files/multi_tsc.html" target="_top">Using
-the Multiplexing Look and Feel.</a>
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java
index ef49aab2..a619162 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -934,9 +934,7 @@
      * <p>The actual code path for determining the proper state is the same as
      * in Synth.</p>
      *
-     * @param ctx
      * @param lastState a 1 element array, allowing me to do pass-by-reference.
-     * @return
      */
     private RuntimeState getNextState(RuntimeState[] states,
                                       int[] lastState,
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/package-info.java
new file mode 100644
index 0000000..21f93aa
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/package-info.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides user interface objects built according to the cross-platform Nimbus
+ * look and feel.
+ * <p>
+ * Nimbus uses instances of the {@link javax.swing.Painter} interface to paint
+ * components. With each Swing component it associates a foreground and a
+ * background {@code Painter}, and there may be several painters for different
+ * component states.
+ * <p>
+ * Nimbus allows customizing many of its properties, including painters, by
+ * altering the {@link javax.swing.UIDefaults} table. Here's an example:
+ * <pre>
+ * UIManager.put("ProgressBar.tileWidth", myTileWidth);
+ * UIManager.put("ProgressBar[Enabled].backgroundPainter", myBgPainter);
+ * UIManager.put("ProgressBar[Enabled].foregroundPainter", myFgPainter);
+ * </pre>
+ * <p>
+ * Per-component customization is also possible. When rendering a component,
+ * Nimbus checks its client property named "Nimbus.Overrides". The value of this
+ * property should be an instance of {@code UIDefaults}. Settings from that
+ * table override the UIManager settings, but for that particular component
+ * instance only. An optional client property,
+ * "Nimbus.Overrides.InheritDefaults" of type Boolean, specifies whether the
+ * overriding settings should be merged with default ones ({@code true}), or
+ * replace them ({@code false}). By default they are merged:
+ * <pre>
+ * JProgressBar bar = new JProgressBar();
+ * UIDefaults overrides = new UIDefaults();
+ * overrides.put("ProgressBar.cycleTime", 330);
+ * ...
+ * bar.putClientProperty("Nimbus.Overrides", overrides);
+ * bar.putClientProperty("Nimbus.Overrides.InheritDefaults", false);
+ * </pre>
+ * <p>
+ * Colors in Nimbus are derived from a core set of
+ * <a href="doc-files/properties.html#primaryColors">primary colors</a>. There
+ * are also
+ * <a href="doc-files/properties.html#secondaryColors">secondary colors</a>,
+ * which are derived from primary ones, but serve themselves as base colors for
+ * other derived colors. The derivation mechanism allows for runtime
+ * customization, i.e. if a primary or secondary color is changed, all colors
+ * that are derived from it are automatically updated. The method
+ * {@link javax.swing.plaf.nimbus.NimbusLookAndFeel#getDerivedColor(java.lang.String, float, float, float, int, boolean)}
+ * may be used to create a derived color.
+ * <p>
+ * These classes are designed to be used while the corresponding
+ * {@code LookAndFeel} class has been installed
+ * (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
+ * Using them while a different {@code LookAndFeel} is installed may produce
+ * unexpected results, including exceptions. Additionally, changing the
+ * {@code LookAndFeel} maintained by the {@code UIManager} without updating the
+ * corresponding {@code ComponentUI} of any {@code JComponent}s may also produce
+ * unexpected results, such as the wrong colors showing up, and is generally not
+ * encouraged.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * @since 1.7
+ * @serial exclude
+ */
+package javax.swing.plaf.nimbus;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/package.html b/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/package.html
deleted file mode 100644
index f91d737..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/nimbus/package.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides user interface objects built according to the cross-platform
-Nimbus look and feel.
-
-<p>Nimbus uses instances of the {@link javax.swing.Painter} interface to paint
-components. With each Swing component it associates a foreground and a
-background {@code Painter}, and there may be several painters for different
-component states.
-
-<p>Nimbus allows customizing many of its properties, including painters, by
-altering the {@link javax.swing.UIDefaults} table. Here's an example:
-<pre>
-    UIManager.put("ProgressBar.tileWidth", myTileWidth);
-    UIManager.put("ProgressBar[Enabled].backgroundPainter", myBgPainter);
-    UIManager.put("ProgressBar[Enabled].foregroundPainter", myFgPainter);
-</pre>
-
-<p>Per-component customization is also possible. When rendering a component,
-Nimbus checks its client property named "Nimbus.Overrides". The value of this
-property should be an instance of {@code UIDefaults}. Settings from that table
-override the UIManager settings, but for that particular component instance
-only. An optional client property, "Nimbus.Overrides.InheritDefaults" of type
-Boolean, specifies whether the overriding settings should be merged with
-default ones ({@code true}), or replace them ({@code false}). By default they
-are merged:
-<pre>
-    JProgressBar bar = new JProgressBar();
-    UIDefaults overrides = new UIDefaults();
-    overrides.put("ProgressBar.cycleTime", 330);
-    ...
-    bar.putClientProperty("Nimbus.Overrides", overrides);
-    bar.putClientProperty("Nimbus.Overrides.InheritDefaults", false);
-</pre>
-
-<p>Colors in Nimbus are derived from a core set of
-<a href="doc-files/properties.html#primaryColors">primary colors</a>. There are also
-<a href="doc-files/properties.html#secondaryColors">secondary colors</a>, which are
-derived from primary ones, but serve themselves as base colors for other
-derived colors. The derivation mechanism allows for runtime customization,
-i.e. if a primary or secondary color is changed, all colors that are derived
-from it are automatically updated. The method
-{@link javax.swing.plaf.nimbus.NimbusLookAndFeel#getDerivedColor(java.lang.String, float, float, float, int, boolean)}
-may be used to create a derived color.
-
-<p>These classes are designed to be used while the
-corresponding <code>LookAndFeel</code> class has been
-installed
-(<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
-Using them while a different <code>LookAndFeel</code> is installed
-may produce unexpected results, including exceptions.
-Additionally, changing the <code>LookAndFeel</code>
-maintained by the <code>UIManager</code> without updating the
-corresponding <code>ComponentUI</code> of any
-<code>JComponent</code>s may also produce unexpected results,
-such as the wrong colors showing up, and is generally not
-encouraged.
-
-<p><strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-   target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-       target="_top">The Java Tutorial</a></em>.
-
-@since 1.7
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/package-info.java
new file mode 100644
index 0000000..d29ebe6
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/package-info.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides one interface and many abstract classes that Swing uses to provide
+ * its pluggable look-and-feel capabilities. Its classes are subclassed and
+ * implemented by look and feel UIs such as Basic and the Java look and feel
+ * (Metal). This package is only used by developers who cannot create a new
+ * look and feel by subclassing existing look-and-feel components (such as those
+ * provided by the {@code javax.swing.plaf.basic} and
+ * {@code javax.swing.plaf.metal} packages).
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.plaf;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/package.html b/jdk/src/java.desktop/share/classes/javax/swing/plaf/package.html
deleted file mode 100644
index 0fc8c53..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/package.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides one interface and many abstract classes that
-Swing uses to provide its pluggable look-and-feel capabilities.  Its
-classes are subclassed and implemented by look and feel UIs 
-such as Basic and the Java look and feel (Metal).
-This package is only used by developers who
-cannot create a new look and feel by subclassing existing
-look-and-feel components (such as those provided
-by the <code>javax.swing.plaf.basic</code> and
-<code>javax.swing.plaf.metal</code> packages).
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java
index 8e6c289..bc101d2 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java
@@ -80,6 +80,7 @@
      * Installs the UI defaults.
      */
     @Override
+    @SuppressWarnings("deprecation")
     protected void installDefaults() {
         updateStyle(splitPane);
 
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/package-info.java
new file mode 100644
index 0000000..e8bf9e5
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/package-info.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Synth is a skinnable look and feel in which all painting is delegated. Synth
+ * does not provide a default look. In order to use Synth you need to specify a
+ * <a href="doc-files/synthFileFormat.html">file</a>, or provide a
+ * {@link javax.swing.plaf.synth.SynthStyleFactory}. Both configuration options
+ * require an understanding of the synth architecture, which is described below,
+ * as well as an understanding of Swing's architecture.
+ * <p>
+ * Unless otherwise specified null is not a legal value to any of the methods
+ * defined in the synth package and if passed in will result in a
+ * {@code NullPointerException}.
+ *
+ * <h2>Synth</h2>
+ * Each {@link javax.swing.plaf.ComponentUI} implementation in Synth associates
+ * itself with one {@link javax.swing.plaf.synth.SynthStyle} per
+ * {@link javax.swing.plaf.synth.Region}, most {@code Components} only have one
+ * {@code Region} and therefor only one {@code SynthStyle}. {@code SynthStyle}
+ * is used to access all style related properties: fonts, colors
+ * and other {@code Component} properties. In addition {@code SynthStyle}s are
+ * used to obtain {@link javax.swing.plaf.synth.SynthPainter}s for painting the
+ * background, border, focus and other portions of a {@code Component}. The
+ * {@code ComponentUI}s obtain {@code SynthStyle}s from a
+ * {@link javax.swing.plaf.synth.SynthStyleFactory}. A {@code SynthStyleFactory}
+ * can be provided directly by way of
+ * {@link javax.swing.plaf.synth.SynthLookAndFeel#setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory)},
+ * or indirectly by way of {@link javax.swing.plaf.synth.SynthLookAndFeel#load}.
+ * The following example uses the {@code SynthLookAndFeel.load()} method to
+ * configure a {@code SynthLookAndFeel} and sets it as the current look and
+ * feel:
+ * <div class="example">
+ * <pre>{@code
+ *     SynthLookAndFeel laf = new SynthLookAndFeel();
+ *     laf.load(MyClass.class.getResourceAsStream("laf.xml"), MyClass.class);
+ *     UIManager.setLookAndFeel(laf);
+ * }</pre>
+ * </div>
+ * <p>
+ * Many {@code JComponent}s are broken down into smaller pieces and identified
+ * by the type safe enumeration in {@link javax.swing.plaf.synth.Region}. For
+ * example, a {@code JTabbedPane} consists of a {@code Region} for the
+ * {@code JTabbedPane}({@link javax.swing.plaf.synth.Region#TABBED_PANE}), the
+ * content area ({@link javax.swing.plaf.synth.Region#TABBED_PANE_CONTENT}), the
+ * area behind the tabs
+ * ({@link javax.swing.plaf.synth.Region#TABBED_PANE_TAB_AREA}), and the tabs
+ * ({@link javax.swing.plaf.synth.Region#TABBED_PANE_TAB}). Each
+ * {@code Region} of each {@code JComponent} will have a {@code SynthStyle}.
+ * This allows you to customize individual pieces of each region of each
+ * {@code JComponent}.
+ * <p>
+ * Many of the Synth methods take a {@link javax.swing.plaf.synth.SynthContext}.
+ * This is used to provide information about the current {@code Component} and
+ * includes: the {@link javax.swing.plaf.synth.SynthStyle} associated with the
+ * current {@link javax.swing.plaf.synth.Region}, the state of the
+ * {@code Component} as a bitmask (refer to
+ * {@link javax.swing.plaf.synth.SynthConstants} for the valid states), and a
+ * {@link javax.swing.plaf.synth.Region} identifying the portion of the
+ * {@code Component} being painted.
+ * <p>
+ * All text rendering by non-{@code JTextComponent}s is delegated to a
+ * {@link javax.swing.plaf.synth.SynthGraphicsUtils}, which is obtained using
+ * the {@link javax.swing.plaf.synth.SynthStyle} method
+ * {@link javax.swing.plaf.synth.SynthStyle#getGraphicsUtils}. You can customize
+ * text rendering by supplying your own
+ * {@link javax.swing.plaf.synth.SynthGraphicsUtils}.
+ *
+ * <h2>Notes on specific components</h2>
+ * <h3>JTree</h3>
+ * Synth provides a region for the cells of a tree:
+ * {@code Region.TREE_CELL}. To specify the colors of the
+ * renderer you'll want to provide a style for the
+ * {@code TREE_CELL} region. The following illustrates this:
+ * <pre>{@code
+ *   <style id="treeCellStyle">
+ *     <opaque value="TRUE"/>
+ *     <state>
+ *       <color value="WHITE" type="TEXT_FOREGROUND"/>
+ *       <color value="RED" type="TEXT_BACKGROUND"/>
+ *     </state>
+ *     <state value="SELECTED">
+ *       <color value="RED" type="TEXT_FOREGROUND"/>
+ *       <color value="WHITE" type="BACKGROUND"/>
+ *     </state>
+ *   </style>
+ *   <bind style="treeCellStyle" type="region" key="TreeCell"/>
+ * }</pre>
+ * <p>
+ * This specifies a color combination of red on white, when selected, and white
+ * on red when not selected. To see the background you need to specify that
+ * labels are not opaque. The following XML fragment does that:
+ * <pre>{@code
+ *   <style id="labelStyle">
+ *     <opaque value="FALSE"/>
+ *   </style>
+ *   <bind style="labelStyle" type="region" key="Label"/>
+ * }</pre>
+ *
+ * <h3>JList and JTable</h3>
+ * The colors that the renderers for JList and JTable use are specified by way
+ * of the list and table Regions. The following XML fragment illustrates how to
+ * specify red on white, when selected, and white on red when not selected:
+ * <pre>{@code
+ *   <style id="style">
+ *     <opaque value="TRUE"/>
+ *     <state>
+ *       <color value="WHITE" type="TEXT_FOREGROUND"/>
+ *       <color value="RED" type="TEXT_BACKGROUND"/>
+ *       <color value="RED" type="BACKGROUND"/>
+ *     </state>
+ *     <state value="SELECTED">
+ *       <color value="RED" type="TEXT_FOREGROUND"/>
+ *       <color value="WHITE" type="TEXT_BACKGROUND"/>
+ *     </state>
+ *   </style>
+ *   <bind style="style" type="region" key="Table"/>
+ *   <bind style="style" type="region" key="List"/>
+ * }</pre>
+ */
+package javax.swing.plaf.synth;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/package.html b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/package.html
deleted file mode 100644
index 6662e81..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/package.html
+++ /dev/null
@@ -1,178 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
-
-
--->
-<title></title>
-</head>
-<body bgcolor="white">
-    <p>
-      Synth is a skinnable look and feel in which all painting is
-      delegated. Synth does not provide a default look. In
-      order to use Synth you need to specify a
-      <a href="doc-files/synthFileFormat.html">file</a>, or 
-      provide a {@link
-      javax.swing.plaf.synth.SynthStyleFactory}. Both 
-      configuration options require an 
-      understanding of the synth architecture, which is described
-      below, as well as an understanding of Swing's architecture.
-    </p>
-    <p>
-      Unless otherwise specified null is not a legal value to any of
-      the methods defined in the synth package and if passed in will
-      result in a <code>NullPointerException</code>.
-      
-
-    <h2>Synth</h2>
-    <p>
-      Each {@link javax.swing.plaf.ComponentUI} implementation in Synth associates
-      itself with one {@link
-      javax.swing.plaf.synth.SynthStyle} per {@link
-      javax.swing.plaf.synth.Region}, most
-      <code>Components</code> only have one <code>Region</code> and
-      therefor only one <code>SynthStyle</code>.
-      <code>SynthStyle</code>
-      is used to access all style related properties: fonts, colors
-      and other <code>Component</code> properties. In addition
-      <code>SynthStyle</code>s are used to obtain 
-      {@link javax.swing.plaf.synth.SynthPainter}s for painting the background, border,
-      focus and other portions of a <code>Component</code>. The <code>ComponentUI</code>s obtain
-      <code>SynthStyle</code>s from a
-      {@link javax.swing.plaf.synth.SynthStyleFactory}.
-      A <code>SynthStyleFactory</code>
-      can be provided directly by way of 
-      {@link javax.swing.plaf.synth.SynthLookAndFeel#setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory)},
-      or indirectly by way of
-      {@link javax.swing.plaf.synth.SynthLookAndFeel#load}. The
-      following example uses the <code>SynthLookAndFeel.load()</code>
-      method to configure a <code>SynthLookAndFeel</code> and sets it
-      as the current look and feel:
-    </p>
-    <div class="example">
-      <pre>
-  SynthLookAndFeel laf = new SynthLookAndFeel();
-  laf.load(MyClass.class.getResourceAsStream("laf.xml"), MyClass.class);
-  UIManager.setLookAndFeel(laf);
-      </pre>
-    </div>
-    <p>
-      Many <code>JComponent</code>s are broken down into smaller
-      pieces and identified by the type safe enumeration in
-      {@link javax.swing.plaf.synth.Region}. For example, a <code>JTabbedPane</code>
-      consists of a <code>Region</code> for the
-      <code>JTabbedPane</code> ({@link
-      javax.swing.plaf.synth.Region#TABBED_PANE}), the content
-      area ({@link
-      javax.swing.plaf.synth.Region#TABBED_PANE_CONTENT}), the
-      area behind the tabs ({@link
-      javax.swing.plaf.synth.Region#TABBED_PANE_TAB_AREA}), and the
-      tabs ({@link
-      javax.swing.plaf.synth.Region#TABBED_PANE_TAB}). Each
-      <code>Region</code> of each
-      <code>JComponent</code> will have a
-      <code>SynthStyle</code>. This allows 
-      you to customize individual pieces of each region of each
-      <code>JComponent</code>.
-    <p>
-      Many of the Synth methods take a {@link javax.swing.plaf.synth.SynthContext}. This 
-      is used to provide information about the current
-      <code>Component</code> and includes: the
-      {@link javax.swing.plaf.synth.SynthStyle} associated with the current
-      {@link javax.swing.plaf.synth.Region}, the state of the <code>Component</code>
-      as a bitmask (refer to {@link
-      javax.swing.plaf.synth.SynthConstants} for the valid
-      states), and a {@link javax.swing.plaf.synth.Region} identifying the portion of 
-      the <code>Component</code> being painted.
-    <p>
-      All text rendering by non-<code>JTextComponent</code>s is
-      delegated to a {@link
-      javax.swing.plaf.synth.SynthGraphicsUtils}, which is
-      obtained using the {@link javax.swing.plaf.synth.SynthStyle} method
-      {@link javax.swing.plaf.synth.SynthStyle#getGraphicsUtils}. You can
-      customize text rendering 
-      by supplying your own {@link javax.swing.plaf.synth.SynthGraphicsUtils}.
-
-    </p>
-
-    <h2>Notes on specific components</h2>
-
-    <h3>JTree</h3>
-    <p>
-      Synth provides a region for the cells of a tree:
-      <code>Region.TREE_CELL</code>.  To specify the colors of the
-      renderer you'll want to provide a style for the
-      <code>TREE_CELL</code> region.  The following illustrates this:
-<pre>
-  &lt;style id="treeCellStyle">
-    &lt;opaque value="TRUE"/>
-    &lt;state>
-      &lt;color value="WHITE" type="TEXT_FOREGROUND"/>
-      &lt;color value="RED" type="TEXT_BACKGROUND"/>
-    &lt;/state>
-    &lt;state value="SELECTED">
-      &lt;color value="RED" type="TEXT_FOREGROUND"/>
-      &lt;color value="WHITE" type="BACKGROUND"/>
-    &lt;/state>
-  &lt;/style>
-  &lt;bind style="treeCellStyle" type="region" key="TreeCell"/>
-</pre>
-    <p>
-      This specifies a color combination of red on white, when
-      selected, and white on red when not selected.  To see the
-      background you need to specify that labels are not opaque.  The
-      following XML fragment does that:
-<pre>
-  &lt;style id="labelStyle">
-    &lt;opaque value="FALSE"/>
-  &lt;/style>
-  &lt;bind style="labelStyle" type="region" key="Label"/>
-</pre>
-      
-    <h3>JList and JTable</h3>
-    <p>
-      The colors that the renderers for JList and JTable use are
-      specified by way of the list and table Regions.  The following
-      XML fragment illustrates how to specify red on white, when
-      selected, and white on red when not selected:
-<pre>
-  &lt;style id="style">
-    &lt;opaque value="TRUE"/>
-    &lt;state>
-      &lt;color value="WHITE" type="TEXT_FOREGROUND"/>
-      &lt;color value="RED" type="TEXT_BACKGROUND"/>
-      &lt;color value="RED" type="BACKGROUND"/>
-    &lt;/state>
-    &lt;state value="SELECTED">
-      &lt;color value="RED" type="TEXT_FOREGROUND"/>
-      &lt;color value="WHITE" type="TEXT_BACKGROUND"/>
-    &lt;/state>
-  &lt;/style>
-  &lt;bind style="style" type="region" key="Table"/>
-  &lt;bind style="style" type="region" key="List"/>
-</pre>
-  </body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java b/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java
index 5d29fa9..5ba2838 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/table/JTableHeader.java
@@ -384,6 +384,7 @@
      *                          renderer and, therefore, the proper tip
      * @return the tool tip for this component
      */
+    @SuppressWarnings("deprecation")
     public String getToolTipText(MouseEvent event) {
         String tip = null;
         Point p = event.getPoint();
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/table/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/table/package-info.java
new file mode 100644
index 0000000..1ce7bd0
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/table/package-info.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interfaces for dealing with {@code javax.swing.JTable}.
+ * {@code JTable} is Swing's grid or tabular view for constructing user
+ * interfaces for tabular data structures inside an application. Use this
+ * package if you want control over how tables are constructed, updated, and
+ * rendered, as well as how data associated with the tables are viewed and
+ * managed.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/table.html"
+ *     target="_top">How to Use Tables</a>,
+ *     a section in <em>The Java Tutorial</em></li>
+ * </ul>
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.table;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/table/package.html b/jdk/src/java.desktop/share/classes/javax/swing/table/package.html
deleted file mode 100644
index cf94482..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/table/package.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides classes and interfaces for dealing with
-<code>javax.swing.JTable</code>. 
-<code>JTable</code> is Swing's grid or tabular view for
-constructing user interfaces for tabular data structures inside
-an application.  Use this package if you want control over how tables
-are constructed, updated, and rendered, as well as how data associated
-with the tables are viewed and managed.
-
-<p>
-
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/table.html" target="_top">How to Use Tables</a>,
-      a section in <em>The Java Tutorial</em>
-</ul>
-
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java
index 5045777..8d973e6 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java
@@ -372,6 +372,7 @@
     /**
      * Selects word based on the MouseEvent
      */
+    @SuppressWarnings("deprecation")
     private void selectWord(MouseEvent e) {
         if (selectedWordEvent != null
             && selectedWordEvent.getX() == e.getX()
@@ -405,6 +406,7 @@
      * @param e the mouse event
      * @see MouseListener#mouseClicked
      */
+    @SuppressWarnings("deprecation")
     public void mouseClicked(MouseEvent e) {
         if (getComponent() == null) {
             return;
@@ -513,6 +515,7 @@
     /**
      * Adjusts the caret location based on the MouseEvent.
      */
+    @SuppressWarnings("deprecation")
     private void adjustCaret(MouseEvent e) {
         if ((e.getModifiers() & ActionEvent.SHIFT_MASK) != 0 &&
             getDot() != -1) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java
index dc48035..355b76c 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2179,9 +2179,6 @@
 
         /**
          * Create this action with the appropriate identifier.
-         * @param nm  the name of the action, Action.NAME.
-         * @param select whether to extend the selection when
-         *  changing the caret position.
          */
         SelectWordAction() {
             super(selectWordAction);
@@ -2209,9 +2206,6 @@
 
         /**
          * Create this action with the appropriate identifier.
-         * @param nm  the name of the action, Action.NAME.
-         * @param select whether to extend the selection when
-         *  changing the caret position.
          */
         SelectLineAction() {
             super(selectLineAction);
@@ -2239,9 +2233,6 @@
 
         /**
          * Create this action with the appropriate identifier.
-         * @param nm  the name of the action, Action.NAME.
-         * @param select whether to extend the selection when
-         *  changing the caret position.
          */
         SelectParagraphAction() {
             super(selectParagraphAction);
@@ -2269,9 +2260,6 @@
 
         /**
          * Create this action with the appropriate identifier.
-         * @param nm  the name of the action, Action.NAME.
-         * @param select whether to extend the selection when
-         *  changing the caret position.
          */
         SelectAllAction() {
             super(selectAllAction);
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java
index 16fbdfe..175bcaf 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.Serializable;
+import java.util.Arrays;
 import javax.swing.event.*;
 import javax.swing.undo.AbstractUndoableEdit;
 import javax.swing.undo.CannotRedoException;
@@ -1263,7 +1264,7 @@
                                   int offs, int len) {
             attr = a;
             this.type = type;
-            this.data = txt;
+            this.data = txt == null ? null : Arrays.copyOf(txt, txt.length);
             this.offs = offs;
             this.len = len;
             this.direction = OriginateDirection;
@@ -1323,7 +1324,7 @@
          * @return the array
          */
         public char[] getArray() {
-            return data;
+            return data == null ? null : Arrays.copyOf(data, data.length);
         }
 
 
@@ -1796,8 +1797,6 @@
         /**
          * Pushes a new element onto the stack that represents
          * the current path.
-         * @param record Whether or not the push should be
-         *  recorded as an element change or not.
          * @param isFracture true if pushing on an element that was created
          * as the result of a fracture.
          */
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java b/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java
index f1326cd..ba68c1e 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphPainter1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -198,7 +198,7 @@
      * @param v the view
      * @param p0 the location in the model where the
      *  fragment should start its representation >= 0
-     * @param pos the graphic location along the axis that the
+     * @param x the graphic location along the axis that the
      *  broken view would occupy >= 0; this may be useful for
      *  things like tab calculations
      * @param len specifies the distance into the view
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphPainter2.java b/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphPainter2.java
index 74e5b3e..3a070bb 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphPainter2.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/GlyphPainter2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -193,7 +193,7 @@
      * @param v the view to find the model location to break at.
      * @param p0 the location in the model where the
      *  fragment should start it's representation >= 0.
-     * @param pos the graphic location along the axis that the
+     * @param x the graphic location along the axis that the
      *  broken view would occupy >= 0.  This may be useful for
      *  things like tab calculations.
      * @param len specifies the distance into the view
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java b/jdk/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java
index 2410703..d225c40 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java
@@ -4103,6 +4103,7 @@
             get(FOCUSED_COMPONENT);
     }
 
+    @SuppressWarnings("deprecation")
     private int getCurrentEventModifiers() {
         int modifiers = 0;
         AWTEvent currentEvent = EventQueue.getCurrentEvent();
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java
index a40409c..1cadf02 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/ParagraphView.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -899,7 +899,6 @@
         /**
          * Range represented by a row in the paragraph is only
          * a subset of the total range of the paragraph element.
-         * @see View#getRange
          */
         public int getStartOffset() {
             int offs = Integer.MAX_VALUE;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java
index 4430b4e..9d1b4fc 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@
 import java.security.PrivilegedAction;
 import java.util.Objects;
 import javax.swing.event.*;
-import java.lang.reflect.Module;
 import java.lang.ref.SoftReference;
 import java.util.HashMap;
 
@@ -511,8 +510,8 @@
      * Provides a mapping from the view coordinate space to the logical
      * coordinate space of the model.
      *
-     * @param fx the X coordinate &gt;= 0
-     * @param fy the Y coordinate &gt;= 0
+     * @param x the X coordinate &gt;= 0
+     * @param y the Y coordinate &gt;= 0
      * @param a the allocated region to render into
      * @return the location within the model that best represents the
      *  given point in the view &gt;= 0
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java b/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java
index d6b897f..4f26f54 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -351,6 +351,7 @@
             return rec.offset;
         }
 
+        @SuppressWarnings("deprecation")
         protected void finalize() throws Throwable {
             // schedule the record to be removed later
             // on another thread.
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/StyleContext.java b/jdk/src/java.desktop/share/classes/javax/swing/text/StyleContext.java
index f0b0a08..bdd8c26 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/StyleContext.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/StyleContext.java
@@ -794,7 +794,7 @@
          * @param attributes the attributes
          */
         public SmallAttributeSet(Object[] attributes) {
-            this.attributes = attributes;
+            this.attributes = Arrays.copyOf(attributes, attributes.length);
             updateResolveParent();
         }
 
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/TableView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/TableView.java
index cc286d8..a9a7f67 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/TableView.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/TableView.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,6 +78,7 @@
         super(elem, View.Y_AXIS);
         rows = new Vector<TableRow>();
         gridValid = false;
+        totalColumnRequirements = new SizeRequirements();
     }
 
     /**
@@ -377,6 +378,11 @@
         r.preferred = (int) pref;
         r.maximum = (int) max;
         r.alignment = 0;
+
+        totalColumnRequirements.minimum = r.minimum;
+        totalColumnRequirements.preferred = r.preferred;
+        totalColumnRequirements.maximum = r.maximum;
+
         return r;
     }
 
@@ -406,6 +412,13 @@
      * into consideration any constraining maximums.
      */
     void calculateColumnRequirements(int axis) {
+
+        for (SizeRequirements req : columnRequirements) {
+            req.minimum = 0;
+            req.preferred = 0;
+            req.maximum = Integer.MAX_VALUE;
+        }
+
         // pass 1 - single column cells
         boolean hasMultiColumn = false;
         int nrows = getRowCount();
@@ -576,6 +589,9 @@
 
     int[] columnSpans;
     int[] columnOffsets;
+
+    SizeRequirements totalColumnRequirements;
+
     SizeRequirements[] columnRequirements;
     Vector<TableRow> rows;
     boolean gridValid;
@@ -646,6 +662,53 @@
             invalidateGrid();
         }
 
+        @Override
+        protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements r) {
+            SizeRequirements req = new SizeRequirements();
+            req.minimum = totalColumnRequirements.minimum;
+            req.maximum = totalColumnRequirements.maximum;
+            req.preferred = totalColumnRequirements.preferred;
+            req.alignment = 0f;
+            return req;
+        }
+
+        @Override
+        public float getMinimumSpan(int axis) {
+            float value;
+
+            if (axis == View.X_AXIS) {
+                value = totalColumnRequirements.minimum + getLeftInset() + getRightInset();
+            } else {
+                value = super.getMinimumSpan(axis);
+            }
+            return value;
+        }
+
+        @Override
+        public float getMaximumSpan(int axis) {
+            float value;
+
+            if (axis == View.X_AXIS) {
+                // We're flexible.
+                value = (float) Integer.MAX_VALUE;
+            } else {
+                value = super.getMaximumSpan(axis);
+            }
+            return value;
+        }
+
+        @Override
+        public float getPreferredSpan(int axis) {
+            float value;
+
+            if (axis == View.X_AXIS) {
+                value = totalColumnRequirements.preferred + getLeftInset() + getRightInset();
+            } else {
+                value = super.getPreferredSpan(axis);
+            }
+            return value;
+        }
+
         /**
          * Perform layout for the major axis of the box (i.e. the
          * axis that it represents).  The results of the layout should
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/TextLayoutStrategy.java b/jdk/src/java.desktop/share/classes/javax/swing/text/TextLayoutStrategy.java
index 53924e0..581b520 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/TextLayoutStrategy.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/TextLayoutStrategy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -88,9 +88,8 @@
      * Gives notification from the document that attributes were changed
      * in a location that this view is responsible for.
      *
-     * @param changes the change information from the associated document
-     * @param a the current allocation of the view
-     * @param f the factory to use to rebuild if the view has children
+     * @param e the change information from the associated document
+     * @param alloc the current allocation of the view inside of the insets.
      * @see View#changedUpdate
      */
     public void changedUpdate(FlowView fv, DocumentEvent e, Rectangle alloc) {
@@ -117,9 +116,9 @@
      * views or view fragments) and follow that with bidi reordering
      * of the unidirectional view fragments.
      *
-     * @param row the row to fill in with views.  This is assumed
+     * @param rowIndex the row to fill in with views.  This is assumed
      *   to be empty on entry.
-     * @param pos  The current position in the children of
+     * @param p0  The current position in the children of
      *   this views element from which to start.
      * @return the position to start the next row
      */
@@ -157,7 +156,7 @@
      * calculated by the LineBreakMeasurer, this is implemented
      * to do nothing.
      *
-     * @param r the row to adjust to the current layout
+     * @param rowIndex the row to adjust to the current layout
      *  span.
      * @param desiredSpan the current layout span >= 0
      * @param x the location r starts at.
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/Utilities.java b/jdk/src/java.desktop/share/classes/javax/swing/text/Utilities.java
index b751620..96cf88a 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/Utilities.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/Utilities.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1245,7 +1245,7 @@
      *
      * @param v View to query
      * @param pos the position to convert &gt;= 0
-     * @param a the allocated region to render into
+     * @param alloc the allocated region to render into
      * @param direction the direction from the current position that can
      *  be thought of as the arrow keys typically found on a keyboard;
      *  this may be one of the following:
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSS.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSS.java
index c6e715f..1acce37 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSS.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/CSS.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -948,7 +948,6 @@
      * Returns the size of a font from the passed in string.
      *
      * @param size CSS string describing font size
-     * @param baseFontSize size to use for relative units.
      */
     float getPointSize(String size, StyleSheet ss) {
         int relSize, absSize, diff, index;
@@ -1658,8 +1657,8 @@
      * value, this method returns a CssValue object to associate with the
      * CSS attribute.
      *
-     * @param the CSS.Attribute
-     * @param a String containing the value associated HTML.Attribtue.
+     * @param cssAttr the CSS.Attribute
+     * @param htmlAttrValue a String containing the value associated HTML.Attribute.
      */
     Object getCssValue(CSS.Attribute cssAttr, String htmlAttrValue) {
         CssValue value = (CssValue)valueConvertor.get(cssAttr);
@@ -1670,7 +1669,7 @@
     /**
      * Maps an HTML.Attribute object to its appropriate CSS.Attributes.
      *
-     * @param HTML.Attribute
+     * @param hAttr HTML.Attribute
      * @return CSS.Attribute[]
      */
     private CSS.Attribute[] getCssAttribute(HTML.Attribute hAttr) {
@@ -1685,7 +1684,7 @@
      * based on the tag associated with the attribute and the
      * value of the attribute.
      *
-     * @param AttributeSet containing HTML attributes.
+     * @param tag the AttributeSet containing HTML attributes.
      * @return CSS.Attribute mapping for HTML.Attribute.ALIGN.
      */
     private CSS.Attribute getCssAlignAttribute(HTML.Tag tag,
@@ -1711,7 +1710,7 @@
     /**
      * Fetches the tag associated with the HTML AttributeSet.
      *
-     * @param  AttributeSet containing the HTML attributes.
+     * @param  htmlAttrSet the AttributeSet containing the HTML attributes.
      * @return HTML.Tag
      */
     private HTML.Tag getHTMLTag(AttributeSet htmlAttrSet) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/FormView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/FormView.java
index 3ca0dd1..787de08 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/FormView.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/FormView.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -209,7 +209,7 @@
      * Creates a component for an &lt;INPUT&gt; element based on the
      * value of the "type" attribute.
      *
-     * @param set of attributes associated with the &lt;INPUT&gt; element.
+     * @param attr set of attributes associated with the &lt;INPUT&gt; element.
      * @param model the value of the StyleConstants.ModelAttribute
      * @return the component.
      */
@@ -653,8 +653,6 @@
      * action.
      *
      * @param buffer        the buffer that contains that data to submit
-     * @param targetElement the element that triggered the
-     *                      form submission
      */
     private void getFormData(StringBuilder buffer) {
         Element formE = getFormElement();
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/FrameView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/FrameView.java
index b6d18c1..7bf7b7b 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/FrameView.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/FrameView.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -143,8 +143,7 @@
      * contains it is editable. And then proceeds to call
      * the superclass to do the paint().
      *
-     * @param parent View
-     * @see text.ComponentView#paint
+     * @see javax.swing.text.ComponentView#paint
      */
     public void paint(Graphics g, Shape allocation) {
 
@@ -289,8 +288,6 @@
      * firing the event to the outermost JEditorPane, this
      * method also invokes the setPage() method and explicitly
      * replaces the current document with the destination url.
-     *
-     * @param HyperlinkEvent
      */
     public void hyperlinkUpdate(HyperlinkEvent evt) {
 
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/NoFramesView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/NoFramesView.java
index 5f4789c..73b609e 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/NoFramesView.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/NoFramesView.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,7 +59,7 @@
      * @param g the rendering surface to use
      * @param allocation the allocated region to render into
      * @see #isVisible
-     * @see text.ParagraphView#paint
+     * @see javax.swing.text.ParagraphView#paint
      */
     public void paint(Graphics g, Shape allocation) {
         Container host = getContainer();
@@ -126,7 +126,7 @@
      *           typically the view is told to render into the span
      *           that is returned, although there is no guarantee;
      *           the parent may choose to resize or break the view
-     * @see text.ParagraphView#getPreferredSpan
+     * @see javax.swing.text.ParagraphView#getPreferredSpan
      */
     public float getPreferredSpan(int axis) {
         if (!visible) {
@@ -143,7 +143,7 @@
      * @param axis may be either <code>View.X_AXIS</code> or
      *          <code>View.Y_AXIS</code>
      * @return  the minimum span the view can be rendered into
-     * @see text.ParagraphView#getMinimumSpan
+     * @see javax.swing.text.ParagraphView#getMinimumSpan
      */
     public float getMinimumSpan(int axis) {
         if (!visible) {
@@ -160,7 +160,7 @@
      * @param axis may be either <code>View.X_AXIS</code> or
      *  <code>View.Y_AXIS</code>
      * @return  the maximum span the view can be rendered into
-     * @see text.ParagraphView#getMaximumSpan
+     * @see javax.swing.text.ParagraphView#getMaximumSpan
      */
     public float getMaximumSpan(int axis) {
         if (!visible) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/package-info.java
new file mode 100644
index 0000000..a5bab38
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/package-info.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides the class {@code HTMLEditorKit} and supporting classes for creating
+ * HTML text editors.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * <h2>Package Specification</h2>
+ * <ul>
+ *     <li><a href="http://www.w3.org/TR/REC-html32.html" target="_top">
+ *     HTML 3.2 Reference Specification</a> - The HTML specification on
+ *     which HTMLEditorKit is based.
+ * </ul>
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.text.html;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/package.html b/jdk/src/java.desktop/share/classes/javax/swing/text/html/package.html
deleted file mode 100644
index c9c41b8..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/package.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides the class <code>HTMLEditorKit</code> and supporting classes
-for creating HTML text editors.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-<h2>Package Specification</h2>
-
-
-<ul>
-  <li><a href="http://www.w3.org/TR/REC-html32.html" target="_top">
-      HTML 3.2 Reference Specification</a> - 
-      The HTML specification on which HTMLEditorKit is based.
-</ul>
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java
index 9aa36bf..3a31d25 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java
@@ -2119,8 +2119,11 @@
             }
 
             /* To account for extra read()'s that happened */
-            for (int j = 0; j < i; j++) {
-                addString(charsToAdd[j]);
+            if (i > 0) {
+                for (int j = 0; j < i; j++) {
+                    addString(charsToAdd[j]);
+                }
+                continue;
             }
             switch (ch) {
             case -1:
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/package-info.java
new file mode 100644
index 0000000..4549d5d
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/package-info.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides the default HTML parser, along with support classes. As the stream
+ * is parsed, the parser notifies a delegate, which must implement the
+ * {@code HTMLEditorKit.ParserCallback} interface.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * @see javax.swing.text.html.HTMLEditorKit.ParserCallback
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.text.html.parser;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/package.html b/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/package.html
deleted file mode 100644
index 05c5398..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/package.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides the default HTML parser, along with support classes.
-As the stream is parsed,
-the parser notifies a delegate, 
-which must implement
-the <code>HTMLEditorKit.ParserCallback</code> interface.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-@see javax.swing.text.html.HTMLEditorKit.ParserCallback
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/text/package-info.java
new file mode 100644
index 0000000..424af3b
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/package-info.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interfaces that deal with editable and noneditable text
+ * components. Examples of text components are text fields and text areas, of
+ * which password fields and document editors are special instantiations.
+ * Features that are supported by this package include selection/highlighting,
+ * editing, style, and key mapping.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/text.html"
+ *     target="_top">Using Text Components</a>,
+ *     a section in <em>The Java Tutorial</em></li>
+ * </ul>
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.text;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/package.html b/jdk/src/java.desktop/share/classes/javax/swing/text/package.html
deleted file mode 100644
index 1c38c25..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/package.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides classes and interfaces that deal with editable
-and noneditable text components.  Examples of text components are text
-fields and text areas, of which password fields and document editors
-are special instantiations.  Features that are supported by this
-package include selection/highlighting, editing, style,
-and key mapping.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/text.html" target="_top">Using Text Components</a>,
-      a section in <em>The Java Tutorial</em>
-</ul>
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java
index 226080f..fe04ed4 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,12 +42,8 @@
  * <p>Note that this is a lossy conversion since RTF's model of
  * text does not exactly correspond with LightText's.
  *
- * @see LTAttributedText
- * @see LTRTFFilter
- * @see LTTextAcceptor
  * @see java.io.OutputStream
  */
-
 class RTFGenerator extends Object
 {
     /* These dictionaries map Colors, font names, or Style objects
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java
index 2b4969d..f9a0415 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,11 +32,11 @@
  * and passes a stream of control words, text, and begin/end group
  * indications to its subclass.
  *
- * Normally programmers will only use <b>RTFFilter</b>, a subclass of this class that knows what to
+ * Normally programmers will only use <b>RTFReader</b>, a subclass of this class that knows what to
  * do with the tokens this class parses.
  *
  * @see AbstractFilter
- * @see RTFFilter
+ * @see RTFReader
  */
 abstract class RTFParser extends AbstractFilter
 {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/package-info.java
new file mode 100644
index 0000000..1fda47d
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/package-info.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides a class ({@code RTFEditorKit}) for creating Rich-Text-Format text
+ * editors.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.text.rtf;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/package.html b/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/package.html
deleted file mode 100644
index 9b62f22..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/rtf/package.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides a class (<code>RTFEditorKit</code>) for creating Rich-Text-Format
-text editors.
-
-<p>
-
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/tree/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/tree/package-info.java
new file mode 100644
index 0000000..ce57345
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/tree/package-info.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interfaces for dealing with {@code javax.swing.JTree}.
+ * You use these classes and interfaces if you want control over how trees are
+ * constructed, updated, and rendered, as well as how data associated with the
+ * tree nodes are viewed and managed.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html"
+ *     target="_top">How to Use Trees</a>,
+ *     a section in <em>The Java Tutorial</em></li>
+ * </ul>
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.tree;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/tree/package.html b/jdk/src/java.desktop/share/classes/javax/swing/tree/package.html
deleted file mode 100644
index e820b3c..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/tree/package.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Provides classes and interfaces for dealing with
-<code>javax.swing.JTree</code>. You use these classes and interfaces if you want
-control over how trees are constructed, updated, and rendered, as well
-as how data associated with the tree nodes are viewed and managed.
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html" target="_top">How to Use Trees</a>,
-      a section in <em>The Java Tutorial</em>
-</ul>
-
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/undo/package-info.java b/jdk/src/java.desktop/share/classes/javax/swing/undo/package-info.java
new file mode 100644
index 0000000..789f0f3
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/javax/swing/undo/package-info.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Allows developers to provide support for undo/redo in applications such as
+ * text editors.
+ * <p>
+ * <strong>Note:</strong>
+ * Most of the Swing API is <em>not</em> thread safe. For details, see
+ * <a
+ * href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
+ * target="_top">Concurrency in Swing</a>,
+ * a section in
+ * <em><a href="http://docs.oracle.com/javase/tutorial/"
+ * target="_top">The Java Tutorial</a></em>.
+ *
+ * <h2>Related Documentation</h2>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ *     <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/generaltext.html#undo"
+ *     target="_top">Implementing Undo and Redo</a>,
+ *     a section in <em>The Java Tutorial</em></li>
+ * </ul>
+ *
+ * @since 1.2
+ * @serial exclude
+ */
+package javax.swing.undo;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/undo/package.html b/jdk/src/java.desktop/share/classes/javax/swing/undo/package.html
deleted file mode 100644
index bf6d809..0000000
--- a/jdk/src/java.desktop/share/classes/javax/swing/undo/package.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-<title></title>
-</head>
-<body bgcolor="white">
-
-Allows developers to provide support for undo/redo
-in applications such as text editors. 
-
-<p>
-<strong>Note:</strong>
-Most of the Swing API is <em>not</em> thread safe.
-For details, see
-<a
-href="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"
-target="_top">Concurrency in Swing</a>,
-a section in
-<em><a href="http://docs.oracle.com/javase/tutorial/"
-target="_top">The Java Tutorial</a></em>.
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
-  <li><a href="http://docs.oracle.com/javase/tutorial/uiswing/components/generaltext.html#undo" target="_top">Implementing Undo and Redo</a>,
-      a section in <em>The Java Tutorial</em>
-</ul>
-
-
-@since 1.2
-@serial exclude
-
-</body>
-</html>
diff --git a/jdk/src/java.desktop/share/classes/module-info.java b/jdk/src/java.desktop/share/classes/module-info.java
index bb7abf1..29d24e6 100644
--- a/jdk/src/java.desktop/share/classes/module-info.java
+++ b/jdk/src/java.desktop/share/classes/module-info.java
@@ -26,6 +26,9 @@
 /**
  * Defines the AWT and Swing user interface toolkits, plus APIs for
  * accessibility, audio, imaging, printing, and JavaBeans.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.desktop {
     requires transitive java.datatransfer;
@@ -88,9 +91,6 @@
     exports sun.awt to
         jdk.accessibility;
 
-    exports com.sun.awt to
-        jdk.desktop;
-
     opens javax.swing.plaf.basic to
         jdk.jconsole;
     opens com.sun.java.swing.plaf.windows to
diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java
index d28374b..f5384fb 100644
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -109,7 +109,8 @@
     /**
      * get the current (first) instance of an AppletClassLoader on the stack.
      */
-    @SuppressWarnings("deprecation")
+    @SuppressWarnings({"deprecation",
+                       "removal"}) // SecurityManager.currentClassLoader()
     private AppletClassLoader currentAppletClassLoader()
     {
         // try currentClassLoader first
@@ -298,7 +299,8 @@
      * @exception  SecurityException  if the caller does not have
      *             permission to access the AWT event queue.
      */
-    @SuppressWarnings("deprecation")
+    @SuppressWarnings({"deprecation",
+                       "removal"}) //  SecurityManager.checkAwtEventQueueAccess
     public void checkAwtEventQueueAccess() {
         AppContext appContext = AppContext.getAppContext();
         AppletClassLoader appletClassLoader = currentAppletClassLoader();
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java b/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java
index 29a435c..39b14d8 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java
@@ -93,12 +93,6 @@
          * its parent.
          */
         Rectangle getBounds(Component comp);
-        /*
-         * Sets the shape of a lw component to cut out from hw components.
-         *
-         * See 6797587, 6776743, 6768307, and 6768332 for details
-         */
-        void setMixingCutoutShape(Component comp, Shape shape);
 
         /**
          * Sets GraphicsConfiguration value for the component.
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/CustomCursor.java b/jdk/src/java.desktop/share/classes/sun/awt/CustomCursor.java
index 6dad03c..2b65c5d 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/CustomCursor.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/CustomCursor.java
@@ -66,7 +66,8 @@
 
         // Scale image to nearest supported size.
         Dimension nativeSize = toolkit.getBestCursorSize(width, height);
-        if (nativeSize.width != width || nativeSize.height != height) {
+        if ((nativeSize.width != width || nativeSize.height != height) &&
+            (nativeSize.width != 0 && nativeSize.height != 0)) {
             cursor = cursor.getScaledInstance(nativeSize.width,
                                               nativeSize.height,
                                               Image.SCALE_DEFAULT);
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/HToolkit.java b/jdk/src/java.desktop/share/classes/sun/awt/HToolkit.java
index fb569e3..31ecb3a 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/HToolkit.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/HToolkit.java
@@ -175,18 +175,6 @@
     }
 
     @Override
-    public int getScreenHeight()
-        throws HeadlessException {
-        throw new HeadlessException();
-    }
-
-    @Override
-    public int getScreenWidth()
-        throws HeadlessException {
-        throw new HeadlessException();
-    }
-
-    @Override
     public Dimension getScreenSize()
         throws HeadlessException {
         throw new HeadlessException();
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/HeadlessToolkit.java b/jdk/src/java.desktop/share/classes/sun/awt/HeadlessToolkit.java
index eae0267..d603c87 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/HeadlessToolkit.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/HeadlessToolkit.java
@@ -172,16 +172,6 @@
         return null;
     }
 
-    public int getScreenHeight()
-        throws HeadlessException {
-        throw new HeadlessException();
-    }
-
-    public int getScreenWidth()
-        throws HeadlessException {
-        throw new HeadlessException();
-    }
-
     @Override
     public Dimension getScreenSize()
         throws HeadlessException {
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/NullComponentPeer.java b/jdk/src/java.desktop/share/classes/sun/awt/NullComponentPeer.java
index f95df58..90fdc12 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/NullComponentPeer.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/NullComponentPeer.java
@@ -126,6 +126,7 @@
     public void coalescePaintEvent(PaintEvent e) {
     }
 
+    @SuppressWarnings("deprecation")
     public boolean handleEvent(Event e) {
         return false;
     }
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java b/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java
index de1d303..57e36f2 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java
@@ -30,6 +30,7 @@
 import java.awt.event.KeyEvent;
 import java.awt.event.WindowEvent;
 import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
 import java.awt.image.DataBuffer;
 import java.awt.image.DataBufferInt;
 import java.awt.image.ImageObserver;
@@ -560,10 +561,17 @@
 
     @Override
     public Dimension getScreenSize() {
-        return new Dimension(getScreenWidth(), getScreenHeight());
+        return GraphicsEnvironment.getLocalGraphicsEnvironment()
+                .getDefaultScreenDevice().getDefaultConfiguration()
+                .getBounds().getSize();
     }
-    protected abstract int getScreenWidth();
-    protected abstract int getScreenHeight();
+
+    @Override
+    public ColorModel getColorModel() throws HeadlessException {
+        return GraphicsEnvironment.getLocalGraphicsEnvironment()
+                .getDefaultScreenDevice().getDefaultConfiguration()
+                .getColorModel();
+    }
 
     @Override
     @SuppressWarnings("deprecation")
@@ -1049,6 +1057,7 @@
     /**
      * Returns key modifiers used by Swing to set up a focus accelerator key stroke.
      */
+    @SuppressWarnings("deprecation")
     public int getFocusAcceleratorKeyMask() {
         return InputEvent.ALT_MASK;
     }
@@ -1059,6 +1068,7 @@
      * the way things work on Windows: here, pressing ctrl + alt allows user to enter
      * characters from the extended character set (like euro sign or math symbols)
      */
+    @SuppressWarnings("deprecation")
     public boolean isPrintableCharacterModifiersMask(int mods) {
         return ((mods & InputEvent.ALT_MASK) == (mods & InputEvent.CTRL_MASK));
     }
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/BufImgSurfaceData.java b/jdk/src/java.desktop/share/classes/sun/awt/image/BufImgSurfaceData.java
index 8d37a2d..ac42b42 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/BufImgSurfaceData.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/image/BufImgSurfaceData.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -472,6 +472,7 @@
             this.pData = pData;
         }
 
+        @SuppressWarnings("deprecation")
         public void finalize() {
             if (pData != 0L) {
                 BufImgSurfaceData.freeNativeICMData(pData);
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/BytePackedRaster.java b/jdk/src/java.desktop/share/classes/sun/awt/image/BytePackedRaster.java
index ac00075..c04aac4 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/image/BytePackedRaster.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/image/BytePackedRaster.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,16 @@
  */
 
 package sun.awt.image;
+
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.image.DataBuffer;
+import java.awt.image.DataBufferByte;
+import java.awt.image.MultiPixelPackedSampleModel;
 import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
 import java.awt.image.RasterFormatException;
 import java.awt.image.SampleModel;
-import java.awt.image.MultiPixelPackedSampleModel;
-import java.awt.image.DataBufferByte;
-import java.awt.Rectangle;
-import java.awt.Point;
+import java.awt.image.WritableRaster;
 
 /**
  * This class is useful for describing 1, 2, or 4 bit image data
diff --git a/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java b/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java
index 622a04d..bc136d7 100644
--- a/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java
+++ b/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java
@@ -93,20 +93,25 @@
          * better that it is handled internally to the CompositeFont class.
          */
         if (fm.getEUDCFont() != null) {
+            int msCnt = numMetricsSlots;
+            int fbCnt = numSlots - msCnt;
             numSlots++;
             if (componentNames != null) {
                 componentNames = new String[numSlots];
-                System.arraycopy(compNames, 0, componentNames, 0, numSlots-1);
-                componentNames[numSlots-1] =
-                    fm.getEUDCFont().getFontName(null);
+                System.arraycopy(compNames, 0, componentNames, 0, msCnt);
+                componentNames[msCnt] = fm.getEUDCFont().getFontName(null);
+                System.arraycopy(compNames, msCnt,
+                                 componentNames, msCnt+1, fbCnt);
             }
             if (componentFileNames != null) {
                 componentFileNames = new String[numSlots];
                 System.arraycopy(compFileNames, 0,
-                                  componentFileNames, 0, numSlots-1);
+                                  componentFileNames, 0, msCnt);
+                System.arraycopy(compFileNames, msCnt,
+                                  componentFileNames, msCnt+1, fbCnt);
             }
             components = new PhysicalFont[numSlots];
-            components[numSlots-1] = fm.getEUDCFont();
+            components[msCnt] = fm.getEUDCFont();
             deferredInitialisation = new boolean[numSlots];
             if (defer) {
                 for (int i=0; i<numSlots-1; i++) {
diff --git a/jdk/src/java.desktop/share/classes/sun/font/CompositeStrike.java b/jdk/src/java.desktop/share/classes/sun/font/CompositeStrike.java
index 7d3685f..be6092f 100644
--- a/jdk/src/java.desktop/share/classes/sun/font/CompositeStrike.java
+++ b/jdk/src/java.desktop/share/classes/sun/font/CompositeStrike.java
@@ -71,7 +71,9 @@
     }
 
     PhysicalStrike getStrikeForSlot(int slot) {
-
+        if (slot >= strikes.length) {
+            slot = 0;
+        }
         PhysicalStrike strike = strikes[slot];
         if (strike == null) {
             strike =
diff --git a/jdk/src/java.desktop/share/classes/sun/font/ExtendedTextSourceLabel.java b/jdk/src/java.desktop/share/classes/sun/font/ExtendedTextSourceLabel.java
index 67aee9e..657ffa1 100644
--- a/jdk/src/java.desktop/share/classes/sun/font/ExtendedTextSourceLabel.java
+++ b/jdk/src/java.desktop/share/classes/sun/font/ExtendedTextSourceLabel.java
@@ -626,7 +626,11 @@
         glyphinfo = gv.getGlyphInfo();
     }
     catch (Exception e) {
-        System.out.println(source);
+        if (DEBUG) {
+            System.err.println(source);
+            e.printStackTrace();
+        }
+        glyphinfo = new float[gv.getNumGlyphs() * numvals];
     }
 
     int numGlyphs = gv.getNumGlyphs();
@@ -775,7 +779,7 @@
         if (gx == gxlimit) {
            tgt = charInfo.length / numvals;
         } else {
-           tgt = indices[gx]-1;
+           tgt = indices[gx];
         }
         if (DEBUG) {
            System.err.println("gx=" + gx + " gxlimit=" + gxlimit +
diff --git a/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java b/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java
index 7b6cac6..16d1d41 100644
--- a/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java
+++ b/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java
@@ -27,6 +27,7 @@
 
 import java.io.File;
 import java.awt.Font;
+import java.io.IOException;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.concurrent.ConcurrentHashMap;
@@ -132,6 +133,16 @@
 
         FileFont newFont = (FileFont)font;
         File newDir = (new File(newFont.platName)).getParentFile();
+        if (existDir != null) {
+            try {
+                existDir = existDir.getCanonicalFile();
+            } catch (IOException ignored) {}
+        }
+        if (newDir != null) {
+            try {
+                newDir = newDir.getCanonicalFile();
+            } catch (IOException ignored) {}
+        }
         return java.util.Objects.equals(newDir, existDir);
     }
 
diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java
index 4c0abc9..d2ae86e 100644
--- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3633,6 +3633,7 @@
      * enough to know that if our override is empty then it should not
      * mark us as finalizeable.
      */
+    @SuppressWarnings("deprecation")
     public void finalize() {
         // DO NOT REMOVE THIS METHOD
     }
diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinRenderingEngine.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinRenderingEngine.java
index a3bddaa..d578fa8 100644
--- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinRenderingEngine.java
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinRenderingEngine.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -153,11 +153,11 @@
      * The specified {@code src} {@link Shape} is widened according
      * to the parameters specified by the {@link BasicStroke} object.
      * Adjustments are made to the path as appropriate for the
-     * {@link VALUE_STROKE_NORMALIZE} hint if the {@code normalize}
-     * boolean parameter is true.
+     * {@link java.awt.RenderingHints#VALUE_STROKE_NORMALIZE} hint if the
+     * {@code normalize} boolean parameter is true.
      * Adjustments are made to the path as appropriate for the
-     * {@link VALUE_ANTIALIAS_ON} hint if the {@code antialias}
-     * boolean parameter is true.
+     * {@link java.awt.RenderingHints#VALUE_ANTIALIAS_ON} hint if the
+     * {@code antialias} boolean parameter is true.
      * <p>
      * The geometry of the widened path is forwarded to the indicated
      * {@link PathConsumer2D} object as it is calculated.
diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RegionClipSpanIterator.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RegionClipSpanIterator.java
index 69bba24..cf8193f 100644
--- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RegionClipSpanIterator.java
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RegionClipSpanIterator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -383,6 +383,7 @@
      */
     //public native void dispose();
 
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         //dispose();
     }
diff --git a/jdk/src/java.desktop/share/classes/sun/print/DialogOnTop.java b/jdk/src/java.desktop/share/classes/sun/print/DialogOnTop.java
new file mode 100644
index 0000000..821e4e0
--- /dev/null
+++ b/jdk/src/java.desktop/share/classes/sun/print/DialogOnTop.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.print;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintRequestAttribute;
+
+/*
+ * An implementation class used to request the dialog be set always-on-top.
+ * It needs to be read and honoured by the dialog code which will use
+ * java.awt.Window.setAlwaysOnTop(true) in cases where it is supported.
+ */
+public class DialogOnTop implements PrintRequestAttribute {
+
+    private static final long serialVersionUID = -1901909867156076547L;
+
+    long id;
+
+    public DialogOnTop() {
+    }
+
+    public DialogOnTop(long id) {
+        this.id = id;
+    }
+
+    public final Class<? extends Attribute> getCategory() {
+        return DialogOnTop.class;
+    }
+
+    public long getID() {
+        return id;
+    }
+
+    public final String getName() {
+        return "dialog-on-top";
+    }
+
+    public String toString() {
+       return "dialog-on-top";
+    }
+}
diff --git a/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java
index b76321d..c273ca1 100644
--- a/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java
+++ b/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1336,6 +1336,7 @@
     /**
      * Empty finalizer as no clean up needed here.
      */
+    @SuppressWarnings("deprecation")
     public void finalize() {
     }
 
diff --git a/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java b/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java
index b62c4eb..9d9b200 100644
--- a/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java
+++ b/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -942,6 +942,7 @@
      * Ends this print job once it is no longer referenced.
      * @see #end
      */
+    @SuppressWarnings("deprecation")
     public void finalize() {
         end();
     }
diff --git a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java
index eefb49e..5d50ab8 100644
--- a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java
+++ b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1099,6 +1099,7 @@
     /**
      * Empty finalizer as no clean up needed here.
      */
+    @SuppressWarnings("deprecation")
     public void finalize() {
     }
 
diff --git a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java
index 6ded8e9..2fc6267 100644
--- a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java
+++ b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1264,6 +1264,7 @@
     /**
      * Empty finalizer as no clean up needed here.
      */
+    @SuppressWarnings("deprecation")
     public void finalize() {
     }
 
diff --git a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java
index 4988a20c..b856b4a 100644
--- a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java
+++ b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java
@@ -785,7 +785,9 @@
             PrintService pservice = getPrintService();
             PageFormat pageFrmAttrib = attributeToPageFormat(pservice,
                                                              attributes);
+            setParentWindowID(attributes);
             PageFormat page = pageDialog(pageFrmAttrib);
+            clearParentWindowID();
 
             // If user cancels the dialog, pageDialog() will return the original
             // page object and as per spec, we should return null in that case.
@@ -828,6 +830,9 @@
         int x = gcBounds.x+50;
         int y = gcBounds.y+50;
         ServiceDialog pageDialog;
+        if (onTop != null) {
+            attributes.add(onTop);
+        }
         if (w instanceof Frame) {
             pageDialog = new ServiceDialog(gc, x, y, service,
                                            DocFlavor.SERVICE_FORMATTED.PAGEABLE,
@@ -837,6 +842,7 @@
                                            DocFlavor.SERVICE_FORMATTED.PAGEABLE,
                                            attributes, (Dialog)w);
         }
+
         Rectangle dlgBounds = pageDialog.getBounds();
 
         // if portion of dialog is not within the gc boundary
@@ -880,14 +886,6 @@
         }
    }
 
-   protected PageFormat getPageFormatFromAttributes() {
-       if (attributes == null || attributes.isEmpty()) {
-            return null;
-        }
-        return attributeToPageFormat(getPrintService(), this.attributes);
-   }
-
-
    /**
      * Presents the user a dialog for changing properties of the
      * print job interactively.
@@ -923,7 +921,9 @@
 
             }
 
+            setParentWindowID(attributes);
             boolean ret = printDialog();
+            clearParentWindowID();
             this.attributes = attributes;
             return ret;
 
@@ -2539,4 +2539,26 @@
             return new String(out_chars, 0, pos);
         }
     }
+
+    private DialogOnTop onTop = null;
+
+    private long parentWindowID = 0L;
+
+    /* Called from native code */
+    private long getParentWindowID() {
+        return parentWindowID;
+    }
+
+    private void clearParentWindowID() {
+        parentWindowID = 0L;
+        onTop = null;
+    }
+
+    private void setParentWindowID(PrintRequestAttributeSet attrs) {
+        parentWindowID = 0L;
+        onTop = (DialogOnTop)attrs.get(DialogOnTop.class);
+        if (onTop != null) {
+            parentWindowID = onTop.getID();
+        }
+    }
 }
diff --git a/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java b/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java
index 5dd2b4d..c253332 100644
--- a/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java
+++ b/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java
@@ -184,6 +184,9 @@
             isAWT = true;
         }
 
+        if (attributes.get(DialogOnTop.class) != null) {
+            setAlwaysOnTop(true);
+        }
         Container c = getContentPane();
         c.setLayout(new BorderLayout());
 
@@ -275,6 +278,10 @@
         this.asOriginal = attributes;
         this.asCurrent = new HashPrintRequestAttributeSet(attributes);
 
+        if (attributes.get(DialogOnTop.class) != null) {
+            setAlwaysOnTop(true);
+        }
+
         Container c = getContentPane();
         c.setLayout(new BorderLayout());
 
diff --git a/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java b/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java
index 1d7b69d..2629e44 100644
--- a/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java
+++ b/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java
@@ -1831,6 +1831,7 @@
     private class Handler implements MouseListener {
         private MouseListener doubleClickListener;
 
+        @SuppressWarnings("deprecation")
         public void mouseClicked(MouseEvent evt) {
             JComponent source = (JComponent)evt.getSource();
 
diff --git a/jdk/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java b/jdk/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java
index e301285..f263f2b 100644
--- a/jdk/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java
+++ b/jdk/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java
@@ -175,6 +175,7 @@
         arrowSize.origWidth = arrowSize.width;
     }
 
+    @SuppressWarnings("deprecation")
     private String getAccText(String acceleratorDelimiter) {
         String accText = "";
         KeyStroke accelerator = mi.getAccelerator();
diff --git a/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java b/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java
index f55290b..c39043a 100644
--- a/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java
+++ b/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java
@@ -1460,7 +1460,7 @@
      *
      * @param ie InputEvent to check
      */
-
+    @SuppressWarnings("deprecation")
     private static boolean isAccessClipboardGesture(InputEvent ie) {
         boolean allowedGesture = false;
         if (ie instanceof KeyEvent) { //we can validate only keyboard gestures
@@ -2129,6 +2129,7 @@
         return -1;
     }
 
+    @SuppressWarnings("deprecation")
     public static int getSystemMnemonicKeyMask() {
         Toolkit toolkit = Toolkit.getDefaultToolkit();
         if (toolkit instanceof SunToolkit) {
@@ -2163,6 +2164,41 @@
         return false;
     }
 
+    /**
+     * Enables the antialiasing rendering hint for the scaled graphics and
+     * returns the previous hint value.
+     * The returned null value indicates that the passed graphics is not
+     * instance of Graphics2D.
+     *
+     * @param g the graphics
+     * @return the previous antialiasing rendering hint value if the passed
+     * graphics is instance of Graphics2D, null otherwise.
+     */
+    public static Object getAndSetAntialisingHintForScaledGraphics(Graphics g) {
+        if (isScaledGraphics(g) && isLocalDisplay()) {
+            Graphics2D g2d = (Graphics2D) g;
+            Object hint = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
+            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                    RenderingHints.VALUE_ANTIALIAS_ON);
+            return hint;
+        }
+        return null;
+    }
+
+    /**
+     * Sets the antialiasing rendering hint if its value is not null.
+     * Null hint value indicates that the passed graphics is not instance of
+     * Graphics2D.
+     *
+     * @param g the graphics
+     * @param hint the antialiasing rendering hint
+     */
+    public static void setAntialiasingHintForScaledGraphics(Graphics g, Object hint) {
+        if (hint != null) {
+            ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, hint);
+        }
+    }
+
     public static boolean isFloatingPointScale(AffineTransform tx) {
         int type = tx.getType() & ~(TYPE_FLIP | TYPE_TRANSLATION);
         if (type == 0) {
@@ -2196,6 +2232,35 @@
     }
 
     /**
+     *
+     * Returns the graphics configuration which bounds contain the given
+     * point
+     *
+     * @param current the default configuration which is checked in the first place
+     * @param x the x coordinate of the given point
+     * @param y the y coordinate of the given point
+     * @return the graphics configuration
+     */
+    public static GraphicsConfiguration getGraphicsConfigurationAtPoint(GraphicsConfiguration current, double x, double y) {
+
+        if (current.getBounds().contains(x, y)) {
+            return current;
+        }
+
+        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsDevice[] devices = env.getScreenDevices();
+
+        for (GraphicsDevice device : devices) {
+            GraphicsConfiguration config = device.getDefaultConfiguration();
+            if (config.getBounds().contains(x, y)) {
+                return config;
+            }
+        }
+
+        return current;
+    }
+
+    /**
      * Used to listen to "blit" repaints in RepaintManager.
      */
     public interface RepaintListener {
diff --git a/jdk/src/java.desktop/share/legal/colorimaging.md b/jdk/src/java.desktop/share/legal/colorimaging.md
index e5a011b..12ceea8 100644
--- a/jdk/src/java.desktop/share/legal/colorimaging.md
+++ b/jdk/src/java.desktop/share/legal/colorimaging.md
@@ -1,5 +1,7 @@
 ## Eastman Kodak Company: Kodak Color Management System (kcms) and portions of color management and imaging software
 
-### Notice
-
+### Eastman Kodak Notice
+<pre>
 Portions Copyright Eastman Kodak Company 1991-2003
+</pre>
+
diff --git a/jdk/src/java.desktop/share/legal/jpeg.md b/jdk/src/java.desktop/share/legal/jpeg.md
index 681d9f5..da64b2f 100644
--- a/jdk/src/java.desktop/share/legal/jpeg.md
+++ b/jdk/src/java.desktop/share/legal/jpeg.md
@@ -1,4 +1,4 @@
-## JPEG rb6
+## Independent JPEG Group: JPEG release 6b
 
 ### JPEG License
 <pre>
diff --git a/jdk/src/java.desktop/share/legal/libpng.md b/jdk/src/java.desktop/share/legal/libpng.md
index cd9f613..5619bd1 100644
--- a/jdk/src/java.desktop/share/legal/libpng.md
+++ b/jdk/src/java.desktop/share/legal/libpng.md
@@ -1,6 +1,6 @@
-## Libpng v 1.6.23
+## libpng v1.6.23
 
-### Libpng License
+### libpng License
 <pre>
 
 This copy of the libpng notices is provided for your convenience.  In case of
diff --git a/jdk/src/java.desktop/share/legal/mesa3d.md b/jdk/src/java.desktop/share/legal/mesa3d.md
index 50c2114..3d2168e 100644
--- a/jdk/src/java.desktop/share/legal/mesa3d.md
+++ b/jdk/src/java.desktop/share/legal/mesa3d.md
@@ -1,6 +1,6 @@
 ## Mesa 3-D Graphics Library v4.1
 
-### Mesa 3-D Graphics Library License
+### Mesa License
 <pre>
 
 Mesa 3-D graphics library
diff --git a/jdk/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc b/jdk/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc
index 8d81724..027d8d7 100644
--- a/jdk/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc
+++ b/jdk/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc
@@ -52,6 +52,9 @@
 
     *glyph = (hb_codepoint_t)
           env->CallIntMethod(font2D, sunFontIDs.f2dCharToGlyphMID, u);
+    if ((int)*glyph < 0) {
+        *glyph = 0;
+    }
     return (*glyph != 0);
 }
 
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java
index 62658c7..f33fb5a 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,17 +25,34 @@
 
 package sun.awt.X11;
 
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.peer.TrayIconPeer;
-import sun.awt.*;
-
-import java.awt.image.*;
-import java.text.BreakIterator;
-import java.util.concurrent.ArrayBlockingQueue;
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.Label;
+import java.awt.MouseInfo;
+import java.awt.Panel;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.lang.reflect.InvocationTargetException;
+import java.text.BreakIterator;
+import java.util.concurrent.ArrayBlockingQueue;
+
+import sun.awt.SunToolkit;
 
 /**
  * An utility window class. This is a base class for Tooltip and Balloon.
@@ -81,16 +98,16 @@
         Dimension size = getSize();
         Rectangle scrSize = getGraphicsConfiguration().getBounds();
 
-        if (corner.x < scrSize.width/2 && corner.y < scrSize.height/2) { // 1st square
+        if (corner.x < scrSize.x + scrSize.width/2 && corner.y < scrSize.y + scrSize.height/2) { // 1st square
             setLocation(corner.x + indent, corner.y + indent);
 
-        } else if (corner.x >= scrSize.width/2 && corner.y < scrSize.height/2) { // 2nd square
+        } else if (corner.x >= scrSize.x + scrSize.width/2 && corner.y < scrSize.y + scrSize.height/2) { // 2nd square
             setLocation(corner.x - indent - size.width, corner.y + indent);
 
-        } else if (corner.x < scrSize.width/2 && corner.y >= scrSize.height/2) { // 3rd square
+        } else if (corner.x < scrSize.x + scrSize.width/2 && corner.y >= scrSize.y + scrSize.height/2) { // 3rd square
             setLocation(corner.x + indent, corner.y - indent - size.height);
 
-        } else if (corner.x >= scrSize.width/2 && corner.y >= scrSize.height/2) { // 4th square
+        } else if (corner.x >= scrSize.x +scrSize.width/2 && corner.y >= scrSize.y +scrSize.height/2) { // 4th square
             setLocation(corner.x - indent - size.width, corner.y - indent - size.height);
         }
 
@@ -429,7 +446,7 @@
                 gtkImagesLoaded = true;
             }
         }
-
+        @SuppressWarnings("deprecation")
         private class ActionPerformer extends MouseAdapter {
             public void mouseClicked(MouseEvent e) {
                 // hide the balloon by any click
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java
index 2bb0fab..5ef2e3a 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java
@@ -385,7 +385,7 @@
         }
         return false;
     }
-
+    @SuppressWarnings("deprecation")
     void handleVSBEvent(MouseEvent e, Rectangle bounds, int x, int y) {
         int sbHeight = hsbVis ? bounds.height - SCROLLBAR_WIDTH : bounds.height;
 
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java
index bb74478..a96fefc 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,17 +25,15 @@
 package sun.awt.X11;
 
 import java.awt.*;
-import java.awt.peer.*;
 import java.awt.event.*;
-import java.awt.image.ColorModel;
 
 import sun.awt.*;
 
+import java.awt.peer.ComponentPeer;
 import java.util.ArrayList;
 import java.util.Vector;
 import sun.util.logging.PlatformLogger;
 import sun.java2d.SurfaceData;
-import sun.java2d.SunGraphics2D;
 
 /**
  * The abstract class XBaseMenuWindow is the superclass
@@ -656,28 +654,37 @@
      *
      ************************************************/
 
+    GraphicsConfiguration getCurrentGraphicsConfiguration() {
+        Component hw = SunToolkit.getHeavyweightComponent(target);
+        XWindow peer = AWTAccessor.getComponentAccessor().getPeer(hw);
+        if (peer != null && peer.graphicsConfig != null) {
+            return peer.graphicsConfig;
+        }
+        return graphicsConfig;
+    }
+
     /**
      * Checks if window fits below specified item
      * returns rectangle that the window fits to or null.
      * @param itemBounds rectangle of item in global coordinates
      * @param windowSize size of submenu window to fit
-     * @param screenSize size of screen
+     * @param screenBounds size of screen
      */
-    Rectangle fitWindowBelow(Rectangle itemBounds, Dimension windowSize, Dimension screenSize) {
+    Rectangle fitWindowBelow(Rectangle itemBounds, Dimension windowSize, Rectangle screenBounds) {
         int width = windowSize.width;
         int height = windowSize.height;
         //Fix for 6267162: PIT: Popup Menu gets hidden below the screen when opened
         //near the periphery of the screen, XToolkit
         //Window should be moved if it's outside top-left screen bounds
-        int x = (itemBounds.x > 0) ? itemBounds.x : 0;
-        int y = (itemBounds.y + itemBounds.height > 0) ? itemBounds.y + itemBounds.height : 0;
-        if (y + height <= screenSize.height) {
+        int x = (itemBounds.x > screenBounds.x) ? itemBounds.x : screenBounds.x;
+        int y = (itemBounds.y + itemBounds.height > screenBounds.y) ? itemBounds.y + itemBounds.height : screenBounds.y;
+        if (y + height <= screenBounds.y + screenBounds.height) {
             //move it to the left if needed
-            if (width > screenSize.width) {
-                width = screenSize.width;
+            if (width > screenBounds.width) {
+                width = screenBounds.width;
             }
-            if (x + width > screenSize.width) {
-                x = screenSize.width - width;
+            if (x + width > screenBounds.x + screenBounds.width) {
+                x = screenBounds.x + screenBounds.width - width;
             }
             return new Rectangle(x, y, width, height);
         } else {
@@ -690,23 +697,23 @@
      * returns rectangle that the window fits to or null.
      * @param itemBounds rectangle of item in global coordinates
      * @param windowSize size of submenu window to fit
-     * @param screenSize size of screen
+     * @param screenBounds size of screen
      */
-    Rectangle fitWindowAbove(Rectangle itemBounds, Dimension windowSize, Dimension screenSize) {
+    Rectangle fitWindowAbove(Rectangle itemBounds, Dimension windowSize, Rectangle screenBounds) {
         int width = windowSize.width;
         int height = windowSize.height;
         //Fix for 6267162: PIT: Popup Menu gets hidden below the screen when opened
         //near the periphery of the screen, XToolkit
         //Window should be moved if it's outside bottom-left screen bounds
-        int x = (itemBounds.x > 0) ? itemBounds.x : 0;
-        int y = (itemBounds.y > screenSize.height) ? screenSize.height - height : itemBounds.y - height;
-        if (y >= 0) {
+        int x = (itemBounds.x > screenBounds.x) ? itemBounds.x : screenBounds.x;
+        int y = (itemBounds.y > screenBounds.y + screenBounds.height) ? screenBounds.y + screenBounds.height - height : itemBounds.y - height;
+        if (y >= screenBounds.y) {
             //move it to the left if needed
-            if (width > screenSize.width) {
-                width = screenSize.width;
+            if (width > screenBounds.width) {
+                width = screenBounds.width;
             }
-            if (x + width > screenSize.width) {
-                x = screenSize.width - width;
+            if (x + width > screenBounds.x + screenBounds.width) {
+                x = screenBounds.x + screenBounds.width - width;
             }
             return new Rectangle(x, y, width, height);
         } else {
@@ -719,23 +726,23 @@
      * returns rectangle that the window fits to or null.
      * @param itemBounds rectangle of item in global coordinates
      * @param windowSize size of submenu window to fit
-     * @param screenSize size of screen
+     * @param screenBounds size of screen
      */
-    Rectangle fitWindowRight(Rectangle itemBounds, Dimension windowSize, Dimension screenSize) {
+    Rectangle fitWindowRight(Rectangle itemBounds, Dimension windowSize, Rectangle screenBounds) {
         int width = windowSize.width;
         int height = windowSize.height;
         //Fix for 6267162: PIT: Popup Menu gets hidden below the screen when opened
         //near the periphery of the screen, XToolkit
         //Window should be moved if it's outside top-left screen bounds
-        int x = (itemBounds.x + itemBounds.width > 0) ? itemBounds.x + itemBounds.width : 0;
-        int y = (itemBounds.y > 0) ? itemBounds.y : 0;
-        if (x + width <= screenSize.width) {
+        int x = (itemBounds.x + itemBounds.width > screenBounds.x) ? itemBounds.x + itemBounds.width : screenBounds.x;
+        int y = (itemBounds.y > screenBounds.y) ? itemBounds.y : screenBounds.y;
+        if (x + width <= screenBounds.x + screenBounds.width) {
             //move it to the top if needed
-            if (height > screenSize.height) {
-                height = screenSize.height;
+            if (height > screenBounds.height) {
+                height = screenBounds.height;
             }
-            if (y + height > screenSize.height) {
-                y = screenSize.height - height;
+            if (y + height > screenBounds.y + screenBounds.height) {
+                y = screenBounds.y + screenBounds.height - height;
             }
             return new Rectangle(x, y, width, height);
         } else {
@@ -748,23 +755,23 @@
      * returns rectangle that the window fits to or null.
      * @param itemBounds rectangle of item in global coordinates
      * @param windowSize size of submenu window to fit
-     * @param screenSize size of screen
+     * @param screenBounds size of screen
      */
-    Rectangle fitWindowLeft(Rectangle itemBounds, Dimension windowSize, Dimension screenSize) {
+    Rectangle fitWindowLeft(Rectangle itemBounds, Dimension windowSize, Rectangle screenBounds) {
         int width = windowSize.width;
         int height = windowSize.height;
         //Fix for 6267162: PIT: Popup Menu gets hidden below the screen when opened
         //near the periphery of the screen, XToolkit
         //Window should be moved if it's outside top-right screen bounds
-        int x = (itemBounds.x < screenSize.width) ? itemBounds.x - width : screenSize.width - width;
-        int y = (itemBounds.y > 0) ? itemBounds.y : 0;
-        if (x >= 0) {
+        int x = (itemBounds.x < screenBounds.x + screenBounds.width) ? itemBounds.x - width : screenBounds.x + screenBounds.width - width;
+        int y = (itemBounds.y > screenBounds.y) ? itemBounds.y : screenBounds.y;
+        if (x >= screenBounds.x) {
             //move it to the top if needed
-            if (height > screenSize.height) {
-                height = screenSize.height;
+            if (height > screenBounds.height) {
+                height = screenBounds.height;
             }
-            if (y + height > screenSize.height) {
-                y = screenSize.height - height;
+            if (y + height > screenBounds.y + screenBounds.height) {
+                y = screenBounds.y + screenBounds.height - height;
             }
             return new Rectangle(x, y, width, height);
         } else {
@@ -777,12 +784,12 @@
      * to fit it on screen - move it to the
      * top-left edge and cut by screen dimensions
      * @param windowSize size of submenu window to fit
-     * @param screenSize size of screen
+     * @param screenBounds size of screen
      */
-    Rectangle fitWindowToScreen(Dimension windowSize, Dimension screenSize) {
-        int width = (windowSize.width < screenSize.width) ? windowSize.width : screenSize.width;
-        int height = (windowSize.height < screenSize.height) ? windowSize.height : screenSize.height;
-        return new Rectangle(0, 0, width, height);
+    Rectangle fitWindowToScreen(Dimension windowSize, Rectangle screenBounds) {
+        int width = (windowSize.width < screenBounds.width) ? windowSize.width : screenBounds.width;
+        int height = (windowSize.height < screenBounds.height) ? windowSize.height : screenBounds.height;
+        return new Rectangle(screenBounds.x, screenBounds.y, width, height);
     }
 
 
@@ -1087,7 +1094,9 @@
                       }
                   } else {
                       //Invoke action event
-                      item.action(mouseEvent.getWhen(), mouseEvent.getModifiers());
+                      @SuppressWarnings("deprecation")
+                      final int modifiers = mouseEvent.getModifiers();
+                      item.action(mouseEvent.getWhen(), modifiers);
                       ungrabInput();
                   }
               } else {
@@ -1200,7 +1209,9 @@
               if (citem instanceof XMenuPeer) {
                   cwnd.selectItem(citem, true);
               } else if (citem != null) {
-                  citem.action(event.getWhen(), event.getModifiers());
+                  @SuppressWarnings("deprecation")
+                  final int modifiers = event.getModifiers();
+                  citem.action(event.getWhen(), modifiers);
                   ungrabInput();
               }
               break;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java
index 221093f..dd5a016 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java
@@ -528,12 +528,12 @@
                     if (maxBounds.width != Integer.MAX_VALUE) {
                         hints.set_max_width(scaleUp(maxBounds.width));
                     } else {
-                        hints.set_max_width(XToolkit.getDefaultScreenWidth());
+                        hints.set_max_width(XToolkit.getMaxWindowWidthInPixels());
                     }
                     if (maxBounds.height != Integer.MAX_VALUE) {
                         hints.set_max_height(scaleUp(maxBounds.height));
                     } else {
-                        hints.set_max_height(XToolkit.getDefaultScreenHeight());
+                        hints.set_max_height(XToolkit.getMaxWindowHeightInPixels());
                     }
                 } else {
                     hints.set_max_width(scaleUp(width));
@@ -545,12 +545,12 @@
                     if (maxBounds.width != Integer.MAX_VALUE) {
                         hints.set_max_width(scaleUp(maxBounds.width));
                     } else {
-                        hints.set_max_width(scaleUp(XToolkit.getDefaultScreenWidth()));
+                        hints.set_max_width(XToolkit.getMaxWindowWidthInPixels());
                     }
                     if (maxBounds.height != Integer.MAX_VALUE) {
                         hints.set_max_height(scaleUp(maxBounds.height));
                     } else {
-                        hints.set_max_height(scaleUp(XToolkit.getDefaultScreenHeight()));
+                        hints.set_max_height(XToolkit.getMaxWindowHeightInPixels());
                     }
                 } else {
                     // Leave intact
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java
index 2e2bd0e..604272c 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java
@@ -120,7 +120,9 @@
               if (XToolkit.isLeftMouseButton(e)) {
                   if (armed)
                   {
-                      action(e.getWhen(),e.getModifiers());
+                      @SuppressWarnings("deprecation")
+                      final int modifiers = e.getModifiers();
+                      action(e.getWhen(), modifiers);
                   }
                   pressed = false;
                   armed = false;
@@ -168,7 +170,9 @@
                   pressed=true;
                   armed=true;
                   repaint();
-                  action(e.getWhen(),e.getModifiers());
+                  @SuppressWarnings("deprecation")
+                  final int modifiers = e.getModifiers();
+                  action(e.getWhen(), modifiers);
               }
 
               break;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java
index 54155cf..69e92bd 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
 
 // TODO: make painting more efficient (i.e. when down arrow is pressed, only two items should need to be repainted.
 
-public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelStateListener {
+public final class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelStateListener {
     private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XChoicePeer");
 
     private static final int MAX_UNFURLED_ITEMS = 10;  // Maximum number of
@@ -482,7 +482,7 @@
         firstPress = false;
         dragStartIdx = -1;
     }
-
+    @SuppressWarnings("deprecation")
     public void mouseDragged(MouseEvent e) {
         /*
          * fix for 5003166. On Motif user are unable to drag
@@ -741,6 +741,16 @@
         }
     }
 
+    @Override
+    protected void initGraphicsConfiguration() {
+        super.initGraphicsConfiguration();
+        // The popup have the same graphic config, so update it at the same time
+        if (unfurledChoice != null) {
+            unfurledChoice.initGraphicsConfiguration();
+            unfurledChoice.doValidateSurface();
+        }
+    }
+
     /**************************************************************************/
     /* Common functionality between List & Choice
        /**************************************************************************/
@@ -749,7 +759,7 @@
      * Inner class for the unfurled Choice list
      * Much, much more docs
      */
-    class UnfurledChoice extends XWindow /*implements XScrollbarClient*/ {
+    final class UnfurledChoice extends XWindow /*implements XScrollbarClient*/ {
 
         // First try - use Choice as the target
 
@@ -785,7 +795,7 @@
                 numItemsDisplayed = Math.min(MAX_UNFURLED_ITEMS, numItems);
             }
             Point global = XChoicePeer.this.toGlobal(0,0);
-            Rectangle screen = graphicsConfig.getBounds();
+            Rectangle screenBounds = graphicsConfig.getBounds();
 
             if (alignUnder != null) {
                 Rectangle choiceRec = XChoicePeer.this.getBounds();
@@ -807,19 +817,19 @@
                 height = 2*BORDER_WIDTH +
                     numItemsDisplayed*(helper.getItemHeight()+2*ITEM_MARGIN);
             }
-            // Don't run off the edge of the screen
-            if (x < 0) {
-                x = 0;
+            // Don't run off the edge of the screenBounds
+            if (x < screenBounds.x) {
+                x = screenBounds.x;
             }
-            else if (x + width > screen.width) {
-                x = screen.width - width;
+            else if (x + width > screenBounds.x + screenBounds.width) {
+                x = screenBounds.x + screenBounds.width - width;
             }
 
-            if (y + height > screen.height) {
+            if (y + height > screenBounds.y + screenBounds.height) {
                 y = global.y - height;
             }
-            if (y < 0) {
-                y = 0;
+            if (y < screenBounds.y) {
+                y = screenBounds.y;
             }
             return new Rectangle(x, y, width, height);
         }
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java
index 1bbae4f..ab85a33 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java
@@ -452,6 +452,7 @@
         waitWindowActivated(res);
         return res;
     }
+    @SuppressWarnings("deprecation")
     private int activateServerNoWait(int prev) {
         xembedLog.fine("Activating server");
         int res = getEventPos();
@@ -467,6 +468,7 @@
         robot.mouseRelease(InputEvent.BUTTON1_MASK);
         return res;
     }
+    @SuppressWarnings("deprecation")
     private int deactivateServer() {
         xembedLog.fine("Deactivating server");
         int res = getEventPos();
@@ -480,6 +482,7 @@
         waitWindowDeactivated(res);
         return res;
     }
+    @SuppressWarnings("deprecation")
     private int focusServer() {
         xembedLog.fine("Focusing server");
         boolean weFocused = focused;
@@ -740,6 +743,7 @@
     private void ungrabKey() {
         sendMessage(XEmbedHelper.NON_STANDARD_XEMBED_GTK_UNGRAB_KEY, 0, accel_keysym, accel_mods);
     }
+    @SuppressWarnings("deprecation")
     private int showModalDialog() {
         xembedLog.fine("Showing modal dialog");
         int res = getEventPos();
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java
index e28817f..cbebaee 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java
@@ -573,7 +573,7 @@
             repaint();
         }
     }
-
+    @SuppressWarnings("deprecation")
     void mousePressed(MouseEvent mouseEvent) {
         if (log.isLoggable(PlatformLogger.Level.FINER)) {
             log.finer(mouseEvent.toString() + ", hsb " + hsbVis + ", vsb " + vsbVis);
@@ -641,6 +641,7 @@
             isMousePressed = true;
         }
     }
+    @SuppressWarnings("deprecation")
     void mouseReleased(MouseEvent mouseEvent) {
         if (isEnabled() && mouseEvent.getButton() == MouseEvent.BUTTON1) {
             //winReleaseCursorFocus();
@@ -685,6 +686,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     void mouseDragged(MouseEvent mouseEvent) {
         // TODO: can you drag w/ any other buttons?  what about multiple buttons?
         if (isEnabled() &&
@@ -810,7 +812,7 @@
               break;
         }
     }
-
+    @SuppressWarnings("deprecation")
     void keyPressed(KeyEvent e) {
         int keyCode = e.getKeyCode();
         if (log.isLoggable(PlatformLogger.Level.FINE)) {
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java
index 65dda84..4f48d7d 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuBarPeer.java
@@ -298,25 +298,25 @@
      */
     protected Rectangle getSubmenuBounds(Rectangle itemBounds, Dimension windowSize) {
         Rectangle globalBounds = toGlobal(itemBounds);
-        Dimension screenSize = graphicsConfig.getBounds().getSize();
+        Rectangle screenBounds = getCurrentGraphicsConfiguration().getBounds();
         Rectangle res;
-        res = fitWindowBelow(globalBounds, windowSize, screenSize);
+        res = fitWindowBelow(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        res = fitWindowAbove(globalBounds, windowSize, screenSize);
+        res = fitWindowAbove(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        res = fitWindowRight(globalBounds, windowSize, screenSize);
+        res = fitWindowRight(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        res = fitWindowLeft(globalBounds, windowSize, screenSize);
+        res = fitWindowLeft(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        return fitWindowToScreen(windowSize, screenSize);
+        return fitWindowToScreen(windowSize, screenBounds);
     }
 
     /**
@@ -503,6 +503,7 @@
      * This function is called from XWindow
      * @see XWindow.handleF10onEDT()
      */
+    @SuppressWarnings("deprecation")
     void handleF10KeyPress(KeyEvent event) {
         int keyState = event.getModifiers();
         if (((keyState & InputEvent.ALT_MASK) != 0) ||
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuWindow.java
index 76d034a..ab929c3 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuWindow.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XMenuWindow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -278,25 +278,25 @@
      */
     protected Rectangle getSubmenuBounds(Rectangle itemBounds, Dimension windowSize) {
         Rectangle globalBounds = toGlobal(itemBounds);
-        Dimension screenSize = graphicsConfig.getBounds().getSize();
+        Rectangle screenBounds = getCurrentGraphicsConfiguration().getBounds();
         Rectangle res;
-        res = fitWindowRight(globalBounds, windowSize, screenSize);
+        res = fitWindowRight(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        res = fitWindowBelow(globalBounds, windowSize, screenSize);
+        res = fitWindowBelow(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        res = fitWindowAbove(globalBounds, windowSize, screenSize);
+        res = fitWindowAbove(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        res = fitWindowLeft(globalBounds, windowSize, screenSize);
+        res = fitWindowLeft(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        return fitWindowToScreen(windowSize, screenSize);
+        return fitWindowToScreen(windowSize, screenBounds);
    }
 
     /**
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
index b976a2d..27170b3 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -131,6 +131,7 @@
     /*
      * From PopupMenuPeer
      */
+    @SuppressWarnings("deprecation")
     public void show(Event e) {
         target = (Component)e.target;
         // Get menus from the target.
@@ -215,25 +216,25 @@
      */
     protected Rectangle getWindowBounds(Point origin, Dimension windowSize) {
         Rectangle globalBounds = new Rectangle(origin.x, origin.y, 0, 0);
-        Dimension screenSize = graphicsConfig.getBounds().getSize();
+        Rectangle screenBounds = getCurrentGraphicsConfiguration().getBounds();
         Rectangle res;
-        res = fitWindowRight(globalBounds, windowSize, screenSize);
+        res = fitWindowRight(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        res = fitWindowLeft(globalBounds, windowSize, screenSize);
+        res = fitWindowLeft(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        res = fitWindowBelow(globalBounds, windowSize, screenSize);
+        res = fitWindowBelow(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        res = fitWindowAbove(globalBounds, windowSize, screenSize);
+        res = fitWindowAbove(globalBounds, windowSize, screenBounds);
         if (res != null) {
             return res;
         }
-        return fitWindowToScreen(windowSize, screenSize);
+        return fitWindowToScreen(windowSize, screenBounds);
    }
 
     /************************************************
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java
index 0dbd8e0..4bfe673 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
 import sun.awt.SunToolkit;
 import sun.awt.UNIXToolkit;
 import sun.awt.X11GraphicsConfig;
-import sun.awt.X11GraphicsEnvironment;
 
 class XRobotPeer implements RobotPeer {
 
@@ -77,14 +76,7 @@
 
     @Override
     public void mouseMove(int x, int y) {
-        X11GraphicsEnvironment x11ge = (X11GraphicsEnvironment)
-                GraphicsEnvironment.getLocalGraphicsEnvironment();
-        if(x11ge.runningXinerama()) {
-            Rectangle sb = xgc.getBounds();
-            mouseMoveImpl(xgc, xgc.scaleUp(x + sb.x), xgc.scaleUp(y + sb.y));
-        } else {
-            mouseMoveImpl(xgc, xgc.scaleUp(x), xgc.scaleUp(y));
-        }
+        mouseMoveImpl(xgc, xgc.scaleUp(x), xgc.scaleUp(y));
     }
 
     @Override
@@ -115,8 +107,7 @@
     @Override
     public int getRGBPixel(int x, int y) {
         int pixelArray[] = new int[1];
-        getRGBPixelsImpl(xgc, x, y, 1, 1, xgc.getScale(), pixelArray,
-                         useGtk);
+        getRGBPixelsImpl(xgc, x, y, 1, 1, pixelArray, useGtk);
         return pixelArray[0];
     }
 
@@ -124,7 +115,7 @@
     public int [] getRGBPixels(Rectangle bounds) {
         int pixelArray[] = new int[bounds.width*bounds.height];
         getRGBPixelsImpl(xgc, bounds.x, bounds.y, bounds.width, bounds.height,
-                         xgc.getScale(), pixelArray, useGtk);
+                            pixelArray, useGtk);
         return pixelArray;
     }
 
@@ -140,6 +131,5 @@
     private static synchronized native void keyReleaseImpl(int keycode);
 
     private static synchronized native void getRGBPixelsImpl(X11GraphicsConfig xgc,
-            int x, int y, int width, int height, int scale,
-            int pixelArray[], boolean isGtkSupported);
+            int x, int y, int width, int height, int pixelArray[], boolean isGtkSupported);
 }
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java
index 8015618..d6f1d23 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java
@@ -468,6 +468,7 @@
      * MouseEvent.MOUSE_EXITED
      * MouseEvent.MOUSE_DRAGGED
      */
+    @SuppressWarnings("deprecation")
     public void handleJavaMouseEvent( MouseEvent mouseEvent ) {
         super.handleJavaMouseEvent(mouseEvent);
         int modifiers = mouseEvent.getModifiers();
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbar.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbar.java
index ca43f7a..eece007 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbar.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbar.java
@@ -457,6 +457,7 @@
      * MouseEvent.MOUSE_EXITED
      * MouseEvent.MOUSE_DRAGGED
      */
+    @SuppressWarnings("deprecation")
     public void handleMouseEvent(int id, int modifiers, int x, int y) {
         if ((modifiers & InputEvent.BUTTON1_MASK) == 0) {
             return;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbarPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbarPeer.java
index cf32749..f7de357 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbarPeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XScrollbarPeer.java
@@ -126,6 +126,7 @@
      * MouseEvent.MOUSE_EXITED
      * MouseEvent.MOUSE_DRAGGED
      */
+    @SuppressWarnings("deprecation")
     public void handleJavaMouseEvent( MouseEvent mouseEvent ) {
         super.handleJavaMouseEvent(mouseEvent);
 
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java
index 5d76920..7810784 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java
@@ -1344,6 +1344,7 @@
             }
         }
 
+        @SuppressWarnings("deprecation")
         private static MouseEvent newMouseEvent(
             Component source, Point point, MouseEvent template )
         {
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
index 7751476..49349f4 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
@@ -40,7 +40,6 @@
 import java.awt.font.TextAttribute;
 import java.awt.im.InputMethodHighlight;
 import java.awt.im.spi.InputMethodDescriptor;
-import java.awt.image.ColorModel;
 import java.awt.peer.*;
 import java.beans.PropertyChangeListener;
 import java.security.AccessController;
@@ -108,12 +107,17 @@
     static UIDefaults uidefaults;
     static final X11GraphicsEnvironment localEnv;
     private static final X11GraphicsDevice device;
-    private static final X11GraphicsConfig config;
     private static final long display;
     static int awt_multiclick_time;
     static boolean securityWarningEnabled;
 
-    private static volatile int screenWidth = -1, screenHeight = -1; // Dimensions of default screen
+    /**
+     * Dimensions of default virtual screen in pixels. These values are used to
+     * limit the maximum size of the window.
+     */
+    private static volatile int maxWindowWidthInPixels = -1;
+    private static volatile int maxWindowHeightInPixels = -1;
+
     static long awt_defaultFg; // Pixel
     private static XMouseInfoPeer xPeer;
 
@@ -122,13 +126,11 @@
         if (GraphicsEnvironment.isHeadless()) {
             localEnv = null;
             device = null;
-            config = null;
             display = 0;
         } else {
             localEnv = (X11GraphicsEnvironment) GraphicsEnvironment
                 .getLocalGraphicsEnvironment();
             device = (X11GraphicsDevice) localEnv.getDefaultScreenDevice();
-            config = (X11GraphicsConfig) device.getDefaultConfiguration();
             display = device.getDisplay();
             setupModifierMap();
             initIDs();
@@ -652,8 +654,8 @@
                 @Override
                 public void displayChanged() {
                     // 7045370: Reset the cached values
-                    XToolkit.screenWidth = -1;
-                    XToolkit.screenHeight = -1;
+                    XToolkit.maxWindowWidthInPixels = -1;
+                    XToolkit.maxWindowHeightInPixels = -1;
                 }
 
                 @Override
@@ -670,7 +672,7 @@
     }
 
     private static void initScreenSize() {
-        if (screenWidth == -1 || screenHeight == -1) {
+        if (maxWindowWidthInPixels == -1 || maxWindowHeightInPixels == -1) {
             awtLock();
             try {
                 XWindowAttributes pattr = new XWindowAttributes();
@@ -678,8 +680,8 @@
                     XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
                                                      XToolkit.getDefaultRootWindow(),
                                                      pattr.pData);
-                    screenWidth  = config.scaleDown(pattr.get_width());
-                    screenHeight = config.scaleDown(pattr.get_height());
+                    maxWindowWidthInPixels = pattr.get_width();
+                    maxWindowHeightInPixels = pattr.get_height();
                 } finally {
                     pattr.dispose();
                 }
@@ -689,24 +691,14 @@
         }
     }
 
-    static int getDefaultScreenWidth() {
+    static int getMaxWindowWidthInPixels() {
         initScreenSize();
-        return screenWidth;
+        return maxWindowWidthInPixels;
     }
 
-    static int getDefaultScreenHeight() {
+    static int getMaxWindowHeightInPixels() {
         initScreenSize();
-        return screenHeight;
-    }
-
-    @Override
-    protected int getScreenWidth() {
-        return getDefaultScreenWidth();
-    }
-
-    @Override
-    protected int getScreenHeight() {
-        return getDefaultScreenHeight();
+        return maxWindowHeightInPixels;
     }
 
     private static Rectangle getWorkArea(long root, int scale)
@@ -1373,20 +1365,6 @@
     static native long getDefaultXColormap();
     static native long getDefaultScreenData();
 
-    static ColorModel screenmodel;
-
-    static ColorModel getStaticColorModel() {
-        if (screenmodel == null) {
-            screenmodel = config.getColorModel ();
-        }
-        return screenmodel;
-    }
-
-    @Override
-    public ColorModel getColorModel() {
-        return getStaticColorModel();
-    }
-
     /**
      * Returns a new input method adapter descriptor for native input methods.
      */
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java
index b4b949c..88dff84 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTrayIconPeer.java
@@ -477,6 +477,7 @@
             e.setSource(xtiPeer.target);
             XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), e);
         }
+        @SuppressWarnings("deprecation")
         public void mouseClicked(MouseEvent e) {
             if ((e.getClickCount() == 1 || xtiPeer.balloon.isVisible()) &&
                 e.getButton() == MouseEvent.BUTTON1)
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java
index 0c5cc36..be06235 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java
@@ -339,12 +339,13 @@
         return graphicsConfig.getColorModel (transparency);
     }
 
+    @Override
     public ColorModel getColorModel() {
         if (graphicsConfig != null) {
             return graphicsConfig.getColorModel ();
         }
         else {
-            return XToolkit.getStaticColorModel();
+            return Toolkit.getDefaultToolkit().getColorModel();
         }
     }
 
@@ -621,7 +622,7 @@
         // 4 and 5 buttons are usually considered assigned to a first wheel
         return button == XConstants.buttons[3] || button == XConstants.buttons[4];
     }
-
+    @SuppressWarnings("deprecation")
     static int getXModifiers(AWTKeyStroke stroke) {
         int mods = stroke.getModifiers();
         int res = 0;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java
index 0ac2a16..2e57012 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -181,6 +181,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         dispose();
         super.finalize();
diff --git a/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java b/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java
index 4d18328..aeb95e5 100644
--- a/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java
+++ b/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java
@@ -59,6 +59,7 @@
 
 import java.util.Iterator;
 import java.util.HashSet;
+import java.util.Map;
 
 
 public class IPPPrintService implements PrintService, SunPrinterJobService {
@@ -1758,6 +1759,19 @@
 
                     if (responseMap != null && responseMap.length > 0) {
                         getAttMap = responseMap[0];
+                        // If there is extra hashmap created due to duplicate
+                        // key/attribute present in IPPresponse, then use that
+                        // map too by appending to getAttMap after removing the
+                        // duplicate key/value
+                        if (responseMap.length > 1) {
+                            for (int i = 1; i < responseMap.length; i++) {
+                                for (Map.Entry<String, AttributeClass> entry : responseMap[i].entrySet()) {
+                                    if (!getAttMap.containsKey(entry.getValue())) {
+                                        getAttMap.put(entry.getKey(), entry.getValue());
+                                    }
+                                }
+                            }
+                        }
                     }
                 } else {
                     debug_println(debugPrefix+"opGetAttributes - null input stream");
diff --git a/jdk/src/java.desktop/unix/legal/fontconfig.md b/jdk/src/java.desktop/unix/legal/fontconfig.md
index abdebf3..50f353d86 100644
--- a/jdk/src/java.desktop/unix/legal/fontconfig.md
+++ b/jdk/src/java.desktop/unix/legal/fontconfig.md
@@ -1,6 +1,6 @@
-## FontConfig v2.5
+## Fontconfig v2.5
 
-### FontConfig License
+### Fontconfig License
 <pre>
 
 Copyright 2001,2003 Keith Packard
diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
index 8d6b064..3c7d642 100644
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
@@ -2021,10 +2021,14 @@
                                  X11GD_AddDisplayMode(env, arrayList,
                                         mode->width, mode->height,
                                               BIT_DEPTH_MULTI, (int)(rate +.2));
+                                 if ((*env)->ExceptionCheck(env)) {
+                                     goto ret0;
+                                 }
                                  break;
                             }
                         }
                     }
+ret0:
                     awt_XRRFreeOutputInfo(output_info);
                 }
             }
@@ -2052,12 +2056,12 @@
                                              BIT_DEPTH_MULTI,
                                              rates[j]);
                         if ((*env)->ExceptionCheck(env)) {
-                            break;
+                            goto ret1;
                         }
                     }
                 }
             }
-
+ret1:
             awt_XRRFreeScreenConfigInfo(config);
         }
     }
diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c
index b69e2c0..3b08c19 100644
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -276,7 +276,6 @@
                              jint jy,
                              jint jwidth,
                              jint jheight,
-                             jint scale,
                              jintArray pixelArray,
                              jboolean useGtk) {
     XImage *image;
@@ -298,11 +297,6 @@
 
     AWT_LOCK();
 
-    jint sx = jx * scale;
-    jint sy = jy * scale;
-    jint swidth = jwidth * scale;
-    jint sheight = jheight * scale;
-
     rootWindow = XRootWindow(awt_display, adata->awt_visInfo.screen);
 
     if (!useGtk) {
@@ -314,10 +308,10 @@
     }
 
     if (!XGetWindowAttributes(awt_display, rootWindow, &attr)
-            || sx + swidth <= attr.x
-            || attr.x + attr.width <= sx
-            || sy + sheight <= attr.y
-            || attr.y + attr.height <= sy) {
+            || jx + jwidth <= attr.x
+            || attr.x + attr.width <= jx
+            || jy + jheight <= attr.y
+            || attr.y + attr.height <= jy) {
 
         AWT_UNLOCK();
         return; // Does not intersect with root window
@@ -326,26 +320,25 @@
     gboolean gtk_failed = TRUE;
     jint _x, _y;
 
-    jint x = MAX(sx, attr.x);
-    jint y = MAX(sy, attr.y);
-    jint width = MIN(sx + swidth, attr.x + attr.width) - x;
-    jint height = MIN(sy + sheight, attr.y + attr.height) - y;
+    jint x = MAX(jx, attr.x);
+    jint y = MAX(jy, attr.y);
+    jint width = MIN(jx + jwidth, attr.x + attr.width) - x;
+    jint height = MIN(jy + jheight, attr.y + attr.height) - y;
 
-
-    int dx = attr.x > sx ? attr.x - sx : 0;
-    int dy = attr.y > sy ? attr.y - sy : 0;
+    int dx = attr.x > jx ? attr.x - jx : 0;
+    int dy = attr.y > jy ? attr.y - jy : 0;
 
     int index;
 
     if (useGtk) {
         gtk->gdk_threads_enter();
         gtk_failed = gtk->get_drawable_data(env, pixelArray, x, y, width,
-                                            height, jwidth, dx, dy, scale);
+                                            height, jwidth, dx, dy, 1);
         gtk->gdk_threads_leave();
     }
 
     if (gtk_failed) {
-        image = getWindowImage(awt_display, rootWindow, sx, sy, swidth, sheight);
+        image = getWindowImage(awt_display, rootWindow, x, y, width, height);
 
         ary = (*env)->GetPrimitiveArrayCritical(env, pixelArray, NULL);
 
@@ -355,15 +348,10 @@
             return;
         }
 
-        dx /= scale;
-        dy /= scale;
-        width /= scale;
-        height /= scale;
-
         /* convert to Java ARGB pixels */
         for (_y = 0; _y < height; _y++) {
             for (_x = 0; _x < width; _x++) {
-                jint pixel = (jint) XGetPixel(image, _x * scale, _y * scale);
+                jint pixel = (jint) XGetPixel(image, _x, _y);
                                                               /* Note ignore upper
                                                                * 32-bits on 64-bit
                                                                * OSes.
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsDevice.java b/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsDevice.java
index e7548a6..d873ad0 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsDevice.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsDevice.java
@@ -523,9 +523,9 @@
         dynamicColorModel = null;
         defaultConfig = null;
         configs = null;
+        initScaleFactors();
         // pass on to all top-level windows on this display
         topLevels.notifyListeners();
-        initScaleFactors();
     }
 
     /**
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsEnvironment.java b/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsEnvironment.java
index 464541c..ae3fac9 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsEnvironment.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsEnvironment.java
@@ -203,9 +203,6 @@
                 }
             }
         }
-        // Reset the static GC for the (possibly new) default screen
-        WToolkit.resetGC();
-
         // notify SunDisplayChanger list (e.g. VolatileSurfaceManagers and
         // CachingSurfaceManagers) about the display change event
         displayChanger.notifyListeners();
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WButtonPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WButtonPeer.java
index 36469af..5479c43 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WButtonPeer.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WButtonPeer.java
@@ -95,6 +95,7 @@
     private static native void initIDs();
 
     @Override
+    @SuppressWarnings("deprecation")
     public boolean handleJavaKeyEvent(KeyEvent e) {
          switch (e.getID()) {
             case KeyEvent.KEY_RELEASED:
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WFileDialogPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WFileDialogPeer.java
index 27a0c15..a09b5ea 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WFileDialogPeer.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WFileDialogPeer.java
@@ -263,6 +263,7 @@
     void disable() {}
     @Override
     public void reshape(int x, int y, int width, int height) {}
+    @SuppressWarnings("deprecation")
     public boolean handleEvent(Event e) { return false; }
     @Override
     public void setForeground(Color c) {}
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java
index 4bd8f7b..1d3a176 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -132,6 +132,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable
     {
         // Release the resources used by the native input context.
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPopupMenuPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPopupMenuPeer.java
index d37858d..b9103c2 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPopupMenuPeer.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPopupMenuPeer.java
@@ -70,6 +70,7 @@
 
     private native void createMenu(WComponentPeer parent);
 
+    @SuppressWarnings("deprecation")
     public void show(Event e) {
         Component origin = (Component)e.target;
         WComponentPeer peer = (WComponentPeer) WToolkit.targetToPeer(origin);
@@ -97,6 +98,7 @@
      */
     void show(Component origin, Point p) {
         WComponentPeer peer = (WComponentPeer) WToolkit.targetToPeer(origin);
+        @SuppressWarnings("deprecation")
         Event e = new Event(origin, 0, Event.MOUSE_DOWN, p.x, p.y, 0, 0);
         if (peer == null) {
             Component nativeOrigin = WToolkit.getNativeContainer(origin);
@@ -107,5 +109,6 @@
         _show(e);
     }
 
+    @SuppressWarnings("deprecation")
     private native void _show(Event e);
 }
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrintDialogPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrintDialogPeer.java
index d4ae0eb..f2a0042 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrintDialogPeer.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrintDialogPeer.java
@@ -135,6 +135,7 @@
     void disable() {}
     @Override
     public void reshape(int x, int y, int width, int height) {}
+    @SuppressWarnings("deprecation")
     public boolean handleEvent(Event e) { return false; }
     @Override
     public void setForeground(Color c) {}
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTextFieldPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTextFieldPeer.java
index 387fbfc..6917d4d 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTextFieldPeer.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTextFieldPeer.java
@@ -43,6 +43,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public boolean handleJavaKeyEvent(KeyEvent e) {
         switch (e.getID()) {
            case KeyEvent.KEY_TYPED:
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java
index 097f68d..e606e87 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java
@@ -80,8 +80,6 @@
     // Desktop property which specifies whether XP visual styles are in effect
     public static final String XPSTYLE_THEME_ACTIVE = "win.xpstyle.themeActive";
 
-    static GraphicsConfiguration config;
-
     // System clipboard.
     WClipboard clipboard;
 
@@ -145,21 +143,6 @@
     private static native void disableCustomPalette();
 
     /*
-     * Reset the static GraphicsConfiguration to the default.  Called on
-     * startup and when display settings have changed.
-     */
-    public static void resetGC() {
-        if (GraphicsEnvironment.isHeadless()) {
-            config = null;
-        } else {
-          config = (GraphicsEnvironment
-                  .getLocalGraphicsEnvironment()
-          .getDefaultScreenDevice()
-          .getDefaultConfiguration());
-        }
-    }
-
-    /*
      * NOTE: The following embedded*() methods are non-public API intended
      * for internal use only.  The methods are unsupported and could go
      * away in future releases.
@@ -615,21 +598,6 @@
     static native ColorModel makeColorModel();
     static ColorModel screenmodel;
 
-    static ColorModel getStaticColorModel() {
-        if (GraphicsEnvironment.isHeadless()) {
-            throw new IllegalArgumentException();
-        }
-        if (config == null) {
-            resetGC();
-        }
-        return config.getColorModel();
-    }
-
-    @Override
-    public ColorModel getColorModel() {
-        return getStaticColorModel();
-    }
-
     @Override
     public Insets getScreenInsets(GraphicsConfiguration gc)
     {
@@ -643,20 +611,6 @@
         return ge.getXResolution();
     }
 
-    @Override
-    protected int getScreenWidth() {
-        return GraphicsEnvironment.getLocalGraphicsEnvironment()
-                .getDefaultScreenDevice().getDefaultConfiguration()
-                .getBounds().width;
-    }
-
-    @Override
-    protected int getScreenHeight() {
-        return GraphicsEnvironment.getLocalGraphicsEnvironment()
-                .getDefaultScreenDevice().getDefaultConfiguration()
-                .getBounds().height;
-    }
-
     private native Insets getScreenInsets(int screen);
 
 
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java
index 3aaca2b..d1a2964 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java
@@ -38,6 +38,7 @@
 import sun.awt.*;
 
 import sun.java2d.pipe.Region;
+import sun.swing.SwingUtilities2;
 
 public class WWindowPeer extends WPanelPeer implements WindowPeer,
        DisplayChangedListener
@@ -80,6 +81,8 @@
      * WindowStateEvent is posted to the EventQueue.
      */
     private WindowListener windowListener;
+    private float scaleX;
+    private float scaleY;
 
     /**
      * Initialize JNI field IDs
@@ -190,7 +193,10 @@
 
         // Express our interest in display changes
         GraphicsConfiguration gc = getGraphicsConfiguration();
-        ((Win32GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
+        Win32GraphicsDevice gd = (Win32GraphicsDevice) gc.getDevice();
+        gd.addDisplayChangedListener(this);
+        scaleX = gd.getDefaultScaleX();
+        scaleY = gd.getDefaultScaleY();
 
         initActiveWindowsTracking((Window)target);
 
@@ -539,6 +545,21 @@
 
         AWTAccessor.getComponentAccessor().
             setGraphicsConfiguration((Component)target, winGraphicsConfig);
+
+        checkDPIChange(oldDev, newDev);
+    }
+
+    private void checkDPIChange(Win32GraphicsDevice oldDev,
+                                Win32GraphicsDevice newDev) {
+        float newScaleX = newDev.getDefaultScaleX();
+        float newScaleY = newDev.getDefaultScaleY();
+
+        if (scaleX != newScaleX || scaleY != newScaleY) {
+            windowDPIChange(oldDev.getScreen(), scaleX, scaleY,
+                            newDev.getScreen(), newScaleX, newScaleY);
+            scaleX = newScaleX;
+            scaleY = newScaleY;
+        }
     }
 
     /**
@@ -610,9 +631,42 @@
          sysW = width;
          sysH = height;
 
+         int cx = x + width / 2;
+         int cy = y + height / 2;
+         GraphicsConfiguration current = getGraphicsConfiguration();
+         GraphicsConfiguration other = SwingUtilities2.getGraphicsConfigurationAtPoint(current, cx, cy);
+         if (!current.equals(other)) {
+             AffineTransform tx = other.getDefaultTransform();
+             double otherScaleX = tx.getScaleX();
+             double otherScaleY = tx.getScaleY();
+             initScales();
+             if (scaleX != otherScaleX || scaleY != otherScaleY) {
+                 x = (int) Math.floor(x * otherScaleX / scaleX);
+                 y = (int) Math.floor(y * otherScaleY / scaleY);
+             }
+         }
+
          super.setBounds(x, y, width, height, op);
      }
 
+    private final void initScales() {
+
+        if (scaleX >= 1 && scaleY >= 1) {
+            return;
+        }
+
+        GraphicsConfiguration gc = getGraphicsConfiguration();
+        if (gc instanceof Win32GraphicsConfig) {
+            Win32GraphicsDevice gd = ((Win32GraphicsConfig) gc).getDevice();
+            scaleX = gd.getDefaultScaleX();
+            scaleY = gd.getDefaultScaleY();
+        } else {
+            AffineTransform tx = gc.getDefaultTransform();
+            scaleX = (float) tx.getScaleX();
+            scaleY = (float) tx.getScaleY();
+        }
+    }
+
     @Override
     public void print(Graphics g) {
         // We assume we print the whole frame,
@@ -781,6 +835,9 @@
         }
     }
 
+    native void windowDPIChange(int prevScreen, float prevScaleX, float prevScaleY,
+                                int newScreen, float newScaleX, float newScaleY);
+
     /*
      * The method maps the list of the active windows to the window's AppContext,
      * then the method registers ActiveWindowListener, GuiDisposedListener listeners;
diff --git a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsConfig.java b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsConfig.java
index a658302..144a769 100644
--- a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsConfig.java
+++ b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsConfig.java
@@ -186,7 +186,17 @@
         SurfaceData sd = d3dvsm.getPrimarySurfaceData();
         if (sd instanceof D3DSurfaceData) {
             D3DSurfaceData d3dsd = (D3DSurfaceData)sd;
-            D3DSurfaceData.swapBuffers(d3dsd, x1, y1, x2, y2);
+            double scaleX = sd.getDefaultScaleX();
+            double scaleY = sd.getDefaultScaleY();
+            if (scaleX > 1 || scaleY > 1) {
+                int sx1 = (int) Math.floor(x1 * scaleX);
+                int sy1 = (int) Math.floor(y1 * scaleY);
+                int sx2 = (int) Math.ceil(x2 * scaleX);
+                int sy2 = (int) Math.ceil(y2 * scaleY);
+                D3DSurfaceData.swapBuffers(d3dsd, sx1, sy1, sx2, sy2);
+            } else {
+                D3DSurfaceData.swapBuffers(d3dsd, x1, y1, x2, y2);
+            }
         } else {
             // the surface was likely lost could not have been restored
             Graphics g = peer.getGraphics();
diff --git a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DSurfaceData.java b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DSurfaceData.java
index e2b0801..986f293 100644
--- a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DSurfaceData.java
+++ b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DSurfaceData.java
@@ -766,7 +766,17 @@
                 final Component target = (Component)sd.getPeer().getTarget();
                 SunToolkit.executeOnEventHandlerThread(target, new Runnable() {
                     public void run() {
-                        target.repaint(x1, y1, x2, y2);
+                        double scaleX = sd.getDefaultScaleX();
+                        double scaleY = sd.getDefaultScaleY();
+                        if (scaleX > 1 || scaleY > 1) {
+                            int sx1 = (int) Math.floor(x1 / scaleX);
+                            int sy1 = (int) Math.floor(y1 / scaleY);
+                            int sx2 = (int) Math.ceil(x2 / scaleX);
+                            int sy2 = (int) Math.ceil(y2 / scaleY);
+                            target.repaint(sx1, sy1, sx2 - sx1, sy2 - sy1);
+                        } else {
+                            target.repaint(x1, y1, x2 - x1, y2 - y1);
+                        }
                     }
                 });
                 return;
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
index edd5132..5c3f4af 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
@@ -950,8 +950,11 @@
     return 1;
 }
 
+void AwtComponent::Reshape(int x, int y, int w, int h) {
+    ReshapeNoScale(ScaleUpX(x), ScaleUpY(y), ScaleUpX(w), ScaleUpY(h));
+}
 
-void AwtComponent::Reshape(int x, int y, int w, int h)
+void AwtComponent::ReshapeNoScale(int x, int y, int w, int h)
 {
 #if defined(DEBUG)
     RECT        rc;
@@ -960,11 +963,6 @@
     DTRACE_PRINTLN4("AwtComponent::Reshape from %d, %d, %d, %d", rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
 #endif
 
-    x = ScaleUpX(x);
-    y = ScaleUpY(y);
-    w = ScaleUpX(w);
-    h = ScaleUpY(h);
-
     AwtWindow* container = GetContainer();
     AwtComponent* parent = GetParent();
     if (container != NULL && container == parent) {
@@ -1507,6 +1505,9 @@
           mr = WmSysCommand(static_cast<UINT>(wParam & 0xFFF0),
                             GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
           break;
+      case WM_ENTERSIZEMOVE:
+          mr = WmEnterSizeMove();
+          break;
       case WM_EXITSIZEMOVE:
           mr = WmExitSizeMove();
           break;
@@ -2053,6 +2054,11 @@
     return mrDoDefault;
 }
 
+MsgRouting AwtComponent::WmEnterSizeMove()
+{
+    return mrDoDefault;
+}
+
 MsgRouting AwtComponent::WmExitSizeMove()
 {
     return mrDoDefault;
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.h b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.h
index 0d6bf7a..d91df64 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.h
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.h
@@ -275,6 +275,7 @@
     virtual void Show();
     virtual void Hide();
     virtual void Reshape(int x, int y, int w, int h);
+    void ReshapeNoScale(int x, int y, int w, int h);
 
     /*
      * Fix for 4046446.
@@ -582,6 +583,7 @@
     virtual MsgRouting WmNcPaint(HRGN hrgn);
     virtual MsgRouting WmNcHitTest(UINT x, UINT y, LRESULT &retVal);
     virtual MsgRouting WmSysCommand(UINT uCmdType, int xPos, int yPos);
+    virtual MsgRouting WmEnterSizeMove();
     virtual MsgRouting WmExitSizeMove();
     virtual MsgRouting WmEnterMenuLoop(BOOL isTrackPopupMenu);
     virtual MsgRouting WmExitMenuLoop(BOOL isTrackPopupMenu);
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp
index 6f75291..1560139 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp
@@ -54,6 +54,7 @@
 jmethodID AwtPrintControl::setDevmodeID;
 jmethodID AwtPrintControl::getDevnamesID;
 jmethodID AwtPrintControl::setDevnamesID;
+jmethodID AwtPrintControl::getParentWindowID;
 jfieldID  AwtPrintControl::driverDoesMultipleCopiesID;
 jfieldID  AwtPrintControl::driverDoesCollationID;
 jmethodID AwtPrintControl::getWin32MediaID;
@@ -240,6 +241,11 @@
     DASSERT(AwtPrintControl::dialogOwnerPeerID != NULL);
     CHECK_NULL(AwtPrintControl::dialogOwnerPeerID);
 
+    AwtPrintControl::getParentWindowID = env->GetMethodID(cls,
+                                       "getParentWindowID", "()J");
+    DASSERT(AwtPrintControl::getParentWindowID != NULL);
+    CHECK_NULL(AwtPrintControl::getParentWindowID);
+
     AwtPrintControl::getPrintDCID = env->GetMethodID(cls, "getPrintDC", "()J");
     DASSERT(AwtPrintControl::getPrintDCID != NULL);
     CHECK_NULL(AwtPrintControl::getPrintDCID);
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.h b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.h
index 5f66377..bc782c4 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.h
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.h
@@ -47,6 +47,7 @@
     static jmethodID setDevmodeID;
     static jmethodID getDevnamesID;
     static jmethodID setDevnamesID;
+    static jmethodID getParentWindowID;
     static jmethodID getWin32MediaID;
     static jmethodID setWin32MediaID;
     static jmethodID getWin32MediaTrayID;
@@ -97,6 +98,10 @@
                                  LPTSTR pPrinterName,
                                  LPDEVMODE *pDevMode);
 
+    inline static HWND getParentID(JNIEnv *env, jobject self) {
+      return (HWND)env->CallLongMethod(self, getParentWindowID);
+    }
+
     inline static  HDC getPrintDC(JNIEnv *env, jobject self) {
       return (HDC)env->CallLongMethod(self, getPrintDCID);
     }
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.cpp
index 7a7e7a7..0669aa1 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.cpp
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.cpp
@@ -248,6 +248,11 @@
       pd.lpfnPrintHook = (LPPRINTHOOKPROC)PrintDialogHookProc;
       pd.lpfnSetupHook = (LPSETUPHOOKPROC)PrintDialogHookProc;
       pd.Flags |= PD_ENABLESETUPHOOK | PD_ENABLEPRINTHOOK;
+      HWND parent = AwtPrintControl::getParentID(env, control);
+      if (parent != NULL && ::IsWindow(parent)) {
+          // Windows native modality is requested (used by JavaFX).
+          pd.hwndOwner = parent;
+      }
       /*
           Fix for 6488834.
           To disable Win32 native parent modality we have to set
@@ -255,7 +260,7 @@
           parentless dialogs we use NULL to show them in the taskbar,
           and for all other dialogs AwtToolkit's HWND is used.
       */
-      if (awtParent != NULL)
+      else if (awtParent != NULL)
       {
           pd.hwndOwner = AwtToolkit::GetInstance().GetHWnd();
       }
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp
index 53057bb..653fff7 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp
@@ -521,12 +521,18 @@
     AwtComponent *awtParent = (parent != NULL) ? (AwtComponent *)JNI_GET_PDATA(parent) : NULL;
     HWND hwndOwner = awtParent ? awtParent->GetHWnd() : NULL;
 
+
     jboolean doIt = JNI_FALSE; // Assume the user will cancel the dialog.
     PAGESETUPDLG setup;
     memset(&setup, 0, sizeof(setup));
 
     setup.lStructSize = sizeof(setup);
 
+    HWND parentID = AwtPrintControl::getParentID(env, self);
+    if (parentID != NULL && ::IsWindow(parentID)) {
+        // windows native modality is requested (used by JavaFX).
+        setup.hwndOwner = parentID;
+    }
     /*
       Fix for 6488834.
       To disable Win32 native parent modality we have to set
@@ -534,7 +540,7 @@
       parentless dialogs we use NULL to show them in the taskbar,
       and for all other dialogs AwtToolkit's HWND is used.
     */
-    if (awtParent != NULL)
+    else if (awtParent != NULL)
     {
         setup.hwndOwner = AwtToolkit::GetInstance().GetHWnd();
     }
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp
index 6666a6e..12432eb 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -224,24 +224,11 @@
         AwtWin32GraphicsDevice::SelectPalette(hdcMem, primaryIndex);
     AwtWin32GraphicsDevice::RealizePalette(hdcMem, primaryIndex);
 
-    Devices::InstanceAccess devices;
-    AwtWin32GraphicsDevice *device = devices->GetDevice(primaryIndex);
-    int sWidth = (device == NULL) ? width : device->ScaleUpX(width);
-    int sHeight = (device == NULL) ? height : device->ScaleUpY(height);
-
     // copy screen image to offscreen bitmap
     // CAPTUREBLT flag is required to capture WS_EX_LAYERED windows' contents
     // correctly on Win2K/XP
-    if (width == sWidth && height == sHeight) {
-        VERIFY(::BitBlt(hdcMem, 0, 0, width, height, hdcScreen, x, y,
-               SRCCOPY | CAPTUREBLT) != 0);
-    } else {
-        int sX = (device == NULL) ? x : device->ScaleUpX(x);
-        int sY = (device == NULL) ? y : device->ScaleUpY(y);
-        VERIFY(::StretchBlt(hdcMem, 0, 0, width, height,
-               hdcScreen, sX, sY, sWidth, sHeight,
-               SRCCOPY | CAPTUREBLT) != 0);
-    }
+    VERIFY(::BitBlt(hdcMem, 0, 0, width, height, hdcScreen, x, y,
+           SRCCOPY | CAPTUREBLT) != 0);
 
     static const int BITS_PER_PIXEL = 32;
     static const int BYTES_PER_PIXEL = BITS_PER_PIXEL/8;
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp
index 36501fd..56f2bfd 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp
@@ -153,6 +153,16 @@
     jboolean isFSEMState;
 };
 
+// struct for _WindowDPIChange() method
+struct ScaleStruct {
+    jobject window;
+    jint prevScreen;
+    jfloat prevScaleX;
+    jfloat prevScaleY;
+    jint screen;
+    jfloat scaleX;
+    jfloat scaleY;
+};
 
 /************************************************************************
  * AwtWindow fields
@@ -228,6 +238,10 @@
     m_alwaysOnTop = false;
 
     fullScreenExclusiveModeState = FALSE;
+    m_winSizeMove = FALSE;
+    prevScaleRec.screen = -1;
+    prevScaleRec.scaleX = -1.0f;
+    prevScaleRec.scaleY = -1.0f;
 }
 
 AwtWindow::~AwtWindow()
@@ -1792,6 +1806,19 @@
     return mrDoDefault;
 }
 
+MsgRouting AwtWindow::WmEnterSizeMove()
+{
+    m_winSizeMove = TRUE;
+    return mrDoDefault;
+}
+
+MsgRouting AwtWindow::WmExitSizeMove()
+{
+    m_winSizeMove = FALSE;
+    CheckWindowDPIChange();
+    return mrDoDefault;
+}
+
 /*
  * Override AwtComponent's size handling to first update the
  * java AWT target's dimension fields directly, since Windows
@@ -2074,6 +2101,67 @@
     }
 }
 
+void AwtWindow::CheckWindowDPIChange() {
+
+    if (prevScaleRec.screen != -1 ) {
+        float prevScaleX = prevScaleRec.scaleX;
+        float prevScaleY = prevScaleRec.scaleY;
+
+        if (prevScaleX >= 1 && prevScaleY >= 1) {
+            Devices::InstanceAccess devices;
+            AwtWin32GraphicsDevice* device = devices->GetDevice(m_screenNum);
+            if (device) {
+                float scaleX = device->GetScaleX();
+                float scaleY = device->GetScaleY();
+                if (prevScaleX != scaleX || prevScaleY != scaleY) {
+                    WindowDPIChange(prevScaleRec.screen, prevScaleX, prevScaleY,
+                                    m_screenNum, scaleX, scaleY);
+                }
+            }
+        }
+        prevScaleRec.screen = -1;
+    }
+}
+
+void AwtWindow::WindowDPIChange(int prevScreen,
+                                float prevScaleX, float prevScaleY,
+                                int screen, float scaleX,
+                                float scaleY)
+{
+    int x;
+    int y;
+    int w;
+    int h;
+    RECT rect;
+
+    if (prevScaleX == scaleX && prevScaleY == scaleY) {
+        return;
+    }
+
+    ::GetWindowRect(GetHWnd(), &rect);
+    x = rect.left;
+    y = rect.top;
+    w = (rect.right - rect.left) * scaleX / prevScaleX;
+    h = (rect.bottom - rect.top) * scaleY / prevScaleY;
+
+    if (prevScreen != screen) {
+        Devices::InstanceAccess devices;
+        AwtWin32GraphicsDevice* device = devices->GetDevice(screen);
+        if (device) {
+            RECT bounds;
+            if (MonitorBounds(device->GetMonitor(), &bounds)) {
+                x = x < bounds.left ? bounds.left : x;
+                y = y < bounds.top ? bounds.top : y;
+
+                x = (x + w > bounds.right) ? bounds.right - w : x;
+                y = (y + h > bounds.bottom) ? bounds.bottom - h : y;
+            }
+        }
+    }
+
+    ReshapeNoScale(x, y, w, h);
+}
+
 BOOL AwtWindow::IsFocusableWindow() {
     /*
      * For Window/Frame/Dialog to accept focus it should:
@@ -3102,6 +3190,41 @@
 
     env->DeleteGlobalRef(self);
 }
+
+void AwtWindow::_WindowDPIChange(void* param)
+{
+    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+
+    ScaleStruct *ss = (ScaleStruct *)param;
+    jobject self = ss->window;
+    jint prevScreen = ss->prevScreen;
+    jfloat prevScaleX = ss->prevScaleX;
+    jfloat prevScaleY = ss->prevScaleY;
+    jint screen = ss->screen;
+    jfloat scaleX = ss->scaleX;
+    jfloat scaleY = ss->scaleY;
+
+    PDATA pData;
+    JNI_CHECK_PEER_GOTO(self, ret);
+    AwtWindow *window = (AwtWindow *)pData;
+
+    if (window->m_winSizeMove) {
+        if (window->prevScaleRec.screen == -1) {
+            window->prevScaleRec.screen = prevScreen;
+            window->prevScaleRec.scaleX = prevScaleX;
+            window->prevScaleRec.scaleY = prevScaleY;
+        }
+    }
+    else {
+        window->WindowDPIChange(prevScreen, prevScaleX, prevScaleY,
+                                screen, scaleX, scaleY);
+    }
+
+ret:
+    env->DeleteGlobalRef(self);
+    delete ss;
+}
+
 extern "C" int getSystemMetricValue(int msgType);
 extern "C" {
 
@@ -3800,4 +3923,30 @@
     CATCH_BAD_ALLOC;
 }
 
+/*
+* Class:     sun_awt_windows_WWindowPeer
+* Method:    windowDPIChange
+* Signature: (IFFIFF)V
+*/
+JNIEXPORT void JNICALL
+Java_sun_awt_windows_WWindowPeer_windowDPIChange(JNIEnv *env, jobject self,
+    jint prevScreen, jfloat prevScaleX, jfloat prevScaleY,
+    jint screen, jfloat scaleX, jfloat scaleY)
+{
+    TRY;
+
+    ScaleStruct *ss = new ScaleStruct;
+    ss->window = env->NewGlobalRef(self);
+    ss->prevScreen = prevScreen;
+    ss->prevScaleX = prevScaleX;
+    ss->prevScaleY = prevScaleY;
+    ss->screen = screen;
+    ss->scaleX = scaleX;
+    ss->scaleY = scaleY;
+
+    AwtToolkit::GetInstance().InvokeFunction(AwtWindow::_WindowDPIChange, ss);
+    // global refs and ss are deleted in _WindowDPIChange
+
+    CATCH_BAD_ALLOC;
+}
 } /* extern "C" */
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.h b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.h
index 9dd91a9..55f5b0e 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.h
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Window.h
@@ -173,6 +173,8 @@
     virtual MsgRouting WmMove(int x, int y);
     virtual MsgRouting WmSize(UINT type, int w, int h);
     virtual MsgRouting WmSizing();
+    virtual MsgRouting WmEnterSizeMove();
+    virtual MsgRouting WmExitSizeMove();
     virtual MsgRouting WmPaint(HDC hDC);
     virtual MsgRouting WmSettingChange(UINT wFlag, LPCTSTR pszSection);
     virtual MsgRouting WmNcCalcSize(BOOL fCalcValidRects,
@@ -242,6 +244,7 @@
     static void _RepositionSecurityWarning(void* param);
     static void _SetFullScreenExclusiveModeState(void* param);
     static void _GetNativeWindowSize(void* param);
+    static void _WindowDPIChange(void* param);
 
     inline static BOOL IsResizing() {
         return sm_resizing;
@@ -384,7 +387,19 @@
 private:
     int m_screenNum;
 
+    typedef struct {
+        jint screen;
+        jfloat scaleX;
+        jfloat scaleY;
+    } ScaleRec;
+
+    BOOL m_winSizeMove;
+    ScaleRec prevScaleRec;
+
     void InitOwner(AwtWindow *owner);
+    void CheckWindowDPIChange();
+    void WindowDPIChange(int prevScreen, float prevScaleX, float prevScaleY,
+                         int newScreen, float scaleX, float scaleY);
 
     Type m_windowType;
     void InitType(JNIEnv *env, jobject peer);
diff --git a/jdk/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java b/jdk/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java
index 17c5bed..896f309 100644
--- a/jdk/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java
+++ b/jdk/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java
@@ -25,7 +25,6 @@
 
 package java.lang.instrument;
 
-import java.lang.reflect.Module;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
@@ -191,6 +190,9 @@
      *         if the input does not represent a well-formed class file
      * @return a well-formed class file buffer (the result of the transform),
      *         or {@code null} if no transform is performed
+     *
+     * @revised 9
+     * @spec JPMS
      */
     default byte[]
     transform(  ClassLoader         loader,
@@ -229,6 +231,7 @@
      *         or {@code null} if no transform is performed
      *
      * @since  9
+     * @spec JPMS
      */
     default byte[]
     transform(  Module              module,
diff --git a/jdk/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java b/jdk/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java
index 97986c2..65d1569 100644
--- a/jdk/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java
+++ b/jdk/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java
@@ -25,7 +25,6 @@
 
 package java.lang.instrument;
 
-import java.lang.reflect.Module;
 import java.security.ProtectionDomain;
 import java.util.List;
 import java.util.Map;
@@ -346,7 +345,7 @@
 
 
     /**
-     * Determines whether a class is modifiable by
+     * Tests whether a class is modifiable by
      * {@linkplain #retransformClasses retransformation}
      * or {@linkplain #redefineClasses redefinition}.
      * If a class is modifiable then this method returns <code>true</code>.
@@ -711,9 +710,13 @@
      *         {@code extraProvides} map contains a service provider type that
      *         is not a member of the module or an implementation of the service;
      *         or {@code extraProvides} maps a key to an empty list
+     * @throws UnmodifiableModuleException if the module cannot be modified
      * @throws NullPointerException if any of the arguments are {@code null} or
      *         any of the Sets or Maps contains a {@code null} key or value
+     *
+     * @see #isModifiableModule(Module)
      * @since 9
+     * @spec JPMS
      */
     void redefineModule(Module module,
                         Set<Module> extraReads,
@@ -721,4 +724,19 @@
                         Map<String, Set<Module>> extraOpens,
                         Set<Class<?>> extraUses,
                         Map<Class<?>, List<Class<?>>> extraProvides);
+
+    /**
+     * Tests whether a module can be modified with {@link #redefineModule
+     * redefineModule}. If a module is modifiable then this method returns
+     * {@code true}. If a module is not modifiable then this method returns
+     * {@code false}.
+     *
+     * @param module the module to test if it can be modified
+     * @return {@code true} if the module is modifiable, otherwise {@code false}
+     * @throws NullPointerException if the module is {@code null}
+     *
+     * @since 9
+     * @spec JPMS
+     */
+    boolean isModifiableModule(Module module);
 }
diff --git a/jdk/src/java.instrument/share/classes/java/lang/instrument/UnmodifiableModuleException.java b/jdk/src/java.instrument/share/classes/java/lang/instrument/UnmodifiableModuleException.java
new file mode 100644
index 0000000..be037b2
--- /dev/null
+++ b/jdk/src/java.instrument/share/classes/java/lang/instrument/UnmodifiableModuleException.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.instrument;
+
+/**
+ * Thrown to indicate that a module cannot be modified.
+ *
+ * @see Instrumentation#redefineModule
+ * @since 9
+ * @spec JPMS
+ */
+
+public class UnmodifiableModuleException extends RuntimeException {
+    private static final long serialVersionUID = 6912511912351080644L;
+
+    /**
+     * Constructs an {@code UnmodifiableModuleException} with no
+     * detail message.
+     */
+    public UnmodifiableModuleException() {
+        super();
+    }
+
+    /**
+     * Constructs an {@code UnmodifiableModuleException} with the
+     * specified detail message.
+     *
+     * @param  msg the detail message.
+     */
+    public UnmodifiableModuleException(String msg) {
+        super(msg);
+    }
+}
diff --git a/jdk/src/java.instrument/share/classes/module-info.java b/jdk/src/java.instrument/share/classes/module-info.java
index 27587d2..c0a3810 100644
--- a/jdk/src/java.instrument/share/classes/module-info.java
+++ b/jdk/src/java.instrument/share/classes/module-info.java
@@ -26,6 +26,9 @@
 /**
  * Defines services that allow agents to
  * instrument programs running on the JVM.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.instrument {
     exports java.lang.instrument;
diff --git a/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java b/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java
index b2c2a24..f31a007 100644
--- a/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java
+++ b/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java
@@ -23,11 +23,10 @@
  * questions.
  */
 
-
 package sun.instrument;
 
+import java.lang.instrument.UnmodifiableModuleException;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import java.lang.reflect.AccessibleObject;
 import java.lang.instrument.ClassFileTransformer;
 import java.lang.instrument.ClassDefinition;
@@ -132,6 +131,13 @@
         return isModifiableClass0(mNativeAgent, theClass);
     }
 
+    public boolean isModifiableModule(Module module) {
+        if (module == null) {
+            throw new NullPointerException("'module' is null");
+        }
+        return true;
+    }
+
     public boolean
     isRetransformClassesSupported() {
         // ask lazily since there is some overhead
@@ -243,6 +249,9 @@
         if (!module.isNamed())
             return;
 
+        if (!isModifiableModule(module))
+            throw new UnmodifiableModuleException(module.getName());
+
         // copy and check reads
         extraReads = new HashSet<>(extraReads);
         if (extraReads.contains(null))
@@ -312,7 +321,7 @@
             return Collections.emptyMap();
 
         Map<String, Set<Module>> result = new HashMap<>();
-        Set<String> packages = Set.of(module.getPackages());
+        Set<String> packages = module.getPackages();
         for (Map.Entry<String, Set<Module>> e : map.entrySet()) {
             String pkg = e.getKey();
             if (pkg == null)
diff --git a/jdk/src/java.instrument/share/classes/sun/instrument/TransformerManager.java b/jdk/src/java.instrument/share/classes/sun/instrument/TransformerManager.java
index dcac4b7..2966544 100644
--- a/jdk/src/java.instrument/share/classes/sun/instrument/TransformerManager.java
+++ b/jdk/src/java.instrument/share/classes/sun/instrument/TransformerManager.java
@@ -25,10 +25,8 @@
 
 package sun.instrument;
 
-
 import java.lang.instrument.Instrumentation;
 import java.lang.instrument.ClassFileTransformer;
-import java.lang.reflect.Module;
 import java.security.ProtectionDomain;
 
 /*
diff --git a/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.h b/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.h
index 008b2fa..08d6163 100644
--- a/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.h
+++ b/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.h
@@ -66,7 +66,7 @@
 #define JPLIS_INSTRUMENTIMPL_AGENTMAININVOKER_METHODSIGNATURE "(Ljava/lang/String;Ljava/lang/String;)V"
 #define JPLIS_INSTRUMENTIMPL_TRANSFORM_METHODNAME           "transform"
 #define JPLIS_INSTRUMENTIMPL_TRANSFORM_METHODSIGNATURE      \
-    "(Ljava/lang/reflect/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[BZ)[B"
+    "(Ljava/lang/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[BZ)[B"
 
 
 /*
diff --git a/jdk/src/java.logging/share/classes/java/util/logging/Level.java b/jdk/src/java.logging/share/classes/java/util/logging/Level.java
index 526161b..2af2c6d8 100644
--- a/jdk/src/java.logging/share/classes/java/util/logging/Level.java
+++ b/jdk/src/java.logging/share/classes/java/util/logging/Level.java
@@ -24,10 +24,10 @@
  */
 
 package java.util.logging;
+
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
-import java.lang.reflect.Module;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
diff --git a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java
index 7e8ec41..bb408fd 100644
--- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java
+++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java
@@ -23,7 +23,6 @@
  * questions.
  */
 
-
 package java.util.logging;
 
 import java.io.*;
@@ -43,7 +42,6 @@
 import jdk.internal.misc.JavaAWTAccess;
 import jdk.internal.misc.SharedSecrets;
 import sun.util.logging.internal.LoggingProviderImpl;
-import java.lang.reflect.Module;
 import static jdk.internal.logger.DefaultLoggerFinder.isSystem;
 
 /**
@@ -1839,6 +1837,7 @@
      *          logging configuration file.
      *
      * @see #updateConfiguration(java.io.InputStream, java.util.function.Function)
+     * @since 9
      */
     public void updateConfiguration(Function<String, BiFunction<String,String,String>> mapper)
             throws IOException {
@@ -2035,6 +2034,7 @@
      * @throws  IOException if there are problems reading from the stream,
      *          or the given stream is not in the
      *          {@linkplain java.util.Properties properties file} format.
+     * @since 9
      */
     public void updateConfiguration(InputStream ins,
             Function<String, BiFunction<String,String,String>> mapper)
diff --git a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java
index 1cfd6f9..dea2693 100644
--- a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java
+++ b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java
@@ -23,11 +23,9 @@
  * questions.
  */
 
-
 package java.util.logging;
 
 import java.lang.ref.WeakReference;
-import java.lang.reflect.Module;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
@@ -664,7 +662,7 @@
      * a new logger is created.
      * <p>
      * If a new logger is created its log level will be configured
-     * based on the LogManager configuration and it will configured
+     * based on the LogManager configuration and it will be configured
      * to also send logging output to its parent's Handlers.  It will
      * be registered in the LogManager global namespace.
      * <p>
@@ -726,7 +724,7 @@
      *
      * <p>
      * If a new logger is created its log level will be configured
-     * based on the LogManager and it will configured to also send logging
+     * based on the LogManager and it will be configured to also send logging
      * output to its parent's Handlers.  It will be registered in
      * the LogManager global namespace.
      * <p>
diff --git a/jdk/src/java.logging/share/classes/module-info.java b/jdk/src/java.logging/share/classes/module-info.java
index 293d387..2ddf82f 100644
--- a/jdk/src/java.logging/share/classes/module-info.java
+++ b/jdk/src/java.logging/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the Java Logging API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.logging {
     exports java.util.logging;
diff --git a/jdk/src/java.logging/share/classes/sun/util/logging/internal/LoggingProviderImpl.java b/jdk/src/java.logging/share/classes/sun/util/logging/internal/LoggingProviderImpl.java
index 1ccf2cf..432228a 100644
--- a/jdk/src/java.logging/share/classes/sun/util/logging/internal/LoggingProviderImpl.java
+++ b/jdk/src/java.logging/share/classes/sun/util/logging/internal/LoggingProviderImpl.java
@@ -32,7 +32,6 @@
 import java.util.function.Supplier;
 import java.lang.System.LoggerFinder;
 import java.lang.System.Logger;
-import java.lang.reflect.Module;
 import java.util.Objects;
 import java.util.logging.LogManager;
 import jdk.internal.logger.DefaultLoggerFinder;
diff --git a/jdk/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java b/jdk/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java
index 7684567..16eeff4 100644
--- a/jdk/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java
+++ b/jdk/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java
@@ -38,11 +38,11 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectStreamClass;
 import java.io.Serializable;
+import java.lang.module.ModuleDescriptor;
 import java.lang.ref.WeakReference;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Module;
 import java.lang.reflect.Proxy;
 import java.net.MalformedURLException;
 import java.rmi.MarshalledObject;
@@ -107,6 +107,8 @@
 import sun.rmi.transport.LiveRef;
 import java.io.NotSerializableException;
 
+import static java.lang.module.ModuleDescriptor.Modifier.SYNTHETIC;
+
 /**
  * <p>A connection to a remote RMI connector.  Usually, such
  * connections are made using {@link
@@ -2020,8 +2022,14 @@
                 Module rmiModule = RemoteRef.class.getModule();
 
                 String pkg = packageOf(pRefClassName);
-                assert pkg != null && pkg.length() > 0 && !pkg.equals(packageOf(proxyRefCName));
-                Module m = Modules.defineModule(cl, "jdk.remoteref", Collections.singleton(pkg));
+                assert pkg != null && pkg.length() > 0 &&
+                        !pkg.equals(packageOf(proxyRefCName));
+
+                ModuleDescriptor descriptor =
+                    ModuleDescriptor.newModule("jdk.remoteref", Set.of(SYNTHETIC))
+                        .packages(Set.of(pkg))
+                        .build();
+                Module m = Modules.defineModule(cl, descriptor, null);
 
                 // jdk.remoteref needs to read to java.base and jmxModule
                 Modules.addReads(m, Object.class.getModule());
diff --git a/jdk/src/java.management.rmi/share/classes/module-info.java b/jdk/src/java.management.rmi/share/classes/module-info.java
index ae6fc00..ac6eabc 100644
--- a/jdk/src/java.management.rmi/share/classes/module-info.java
+++ b/jdk/src/java.management.rmi/share/classes/module-info.java
@@ -46,6 +46,8 @@
  *           and load the appropriate {@code JMXConnectorServerProvider} service
  *           implementation for the given protocol.
  *
+ * @moduleGraph
+ * @since 9
  */
 module java.management.rmi {
 
diff --git a/jdk/src/java.management/share/classes/java/lang/management/LockInfo.java b/jdk/src/java.management/share/classes/java/lang/management/LockInfo.java
index 7ad4760..91e5545 100644
--- a/jdk/src/java.management/share/classes/java/lang/management/LockInfo.java
+++ b/jdk/src/java.management/share/classes/java/lang/management/LockInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,8 +38,8 @@
  * a synchronizer that may be exclusively owned by a thread and uses
  * {@link AbstractOwnableSynchronizer AbstractOwnableSynchronizer}
  * (or its subclass) to implement its synchronization property.
- * {@link ReentrantLock ReentrantLock} and
- * {@link ReentrantReadWriteLock ReentrantReadWriteLock} are
+ * {@link ReentrantLock ReentrantLock} and the write-lock (but not
+ * the read-lock) of {@link ReentrantReadWriteLock ReentrantReadWriteLock} are
  * two examples of ownable synchronizers provided by the platform.
  *
  * <h3><a name="MappedType">MXBean Mapping</a></h3>
diff --git a/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java b/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java
index 580829c..5b0b6ac 100644
--- a/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java
+++ b/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java
@@ -28,7 +28,6 @@
 import com.sun.jmx.mbeanserver.Util;
 import java.io.IOException;
 import java.io.UncheckedIOException;
-import java.lang.reflect.Module;
 import java.net.MalformedURLException;
 import java.util.Collections;
 import java.util.HashMap;
diff --git a/jdk/src/java.management/share/classes/module-info.java b/jdk/src/java.management/share/classes/module-info.java
index ef7940a..c407821 100644
--- a/jdk/src/java.management/share/classes/module-info.java
+++ b/jdk/src/java.management/share/classes/module-info.java
@@ -28,6 +28,9 @@
  * <P>
  * The JMX API consists of interfaces for monitoring and management of the
  * JVM and other components in the Java runtime.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.management {
 
diff --git a/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java b/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
index 4eb5742..5336177 100644
--- a/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
+++ b/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
@@ -45,7 +45,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import java.lang.reflect.Module;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.security.PrivilegedAction;
 import java.util.Collections;
@@ -181,8 +180,7 @@
             return AccessController.doPrivileged(new PrivilegedAction<>() {
                 @Override
                 public Class<?> run() {
-                    Optional<Module> logging = java.lang.reflect.Layer.boot()
-                        .findModule("java.logging");
+                    Optional<Module> logging = ModuleLayer.boot().findModule("java.logging");
                     if (logging.isPresent()) {
                         return Class.forName(logging.get(), className);
                     }
diff --git a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
index 8bef0da..31b9c5c 100644
--- a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
+++ b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -382,6 +382,7 @@
         listArg = ne.listArg;
     }
 
+    @SuppressWarnings("deprecation")
     protected final void finalize() {
         cleanup();
     }
diff --git a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java
index f6b42d3..c615971 100644
--- a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java
+++ b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -474,6 +474,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         if (debug > 0) System.err.println("LdapClient: finalize " + this);
         forceClose(pooled);
diff --git a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java
index 5308478..6484c39 100644
--- a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java
+++ b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2609,6 +2609,7 @@
 
    // ----------------- Connection  ---------------------
 
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         try {
             close();
diff --git a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java
index a1d53b2..e5e04a1 100644
--- a/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java
+++ b/jdk/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -129,6 +129,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         clearPassword();
     }
diff --git a/jdk/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java b/jdk/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java
index c29a88d..43dbc07 100644
--- a/jdk/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java
+++ b/jdk/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java
@@ -176,7 +176,7 @@
     InputStream getResourceAsStream(Class<?> c, String name) {
         PrivilegedAction<InputStream> act = () -> {
             try {
-                java.lang.reflect.Module m = c.getModule();
+                Module m = c.getModule();
                 return c.getModule().getResourceAsStream(resolveName(c,name));
              } catch (IOException x) {
                  return null;
diff --git a/jdk/src/java.naming/share/classes/module-info.java b/jdk/src/java.naming/share/classes/module-info.java
index f524a4c..f8ec579 100644
--- a/jdk/src/java.naming/share/classes/module-info.java
+++ b/jdk/src/java.naming/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the Java Naming and Directory Interface (JNDI) API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.naming {
     requires java.security.sasl;
diff --git a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java
index b6e53c4..1fe279b 100644
--- a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java
+++ b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java
@@ -188,8 +188,8 @@
  * administrator to replace the default preferences implementation with an
  * alternative implementation.
  *
- * <p>Implementation note: In Sun's JRE, the {@code PreferencesFactory}
- * implementation is located as follows:
+ * @implNote
+ * The {@code PreferencesFactory} implementation is located as follows:
  *
  * <ol>
  *
diff --git a/jdk/src/java.prefs/share/classes/module-info.java b/jdk/src/java.prefs/share/classes/module-info.java
index 4826cd2..b20d962 100644
--- a/jdk/src/java.prefs/share/classes/module-info.java
+++ b/jdk/src/java.prefs/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the Preferences API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.prefs {
     requires java.xml;
diff --git a/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationInstantiator.java b/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationInstantiator.java
index 8652492..2cd4733 100644
--- a/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationInstantiator.java
+++ b/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationInstantiator.java
@@ -60,7 +60,20 @@
     * initialization data, and
     *
     * <li> returning a MarshalledObject containing the stub for the
-    * remote object it created </ul>
+    * remote object it created.</ul>
+    *
+    * <p>In order for activation to be successful, one of the following requirements
+    * must be met, otherwise {@link ActivationException} is thrown:
+    *
+    * <ul><li>The class to be activated and the special activation constructor are both public,
+    * and the class resides in a package that is
+    * {@linkplain Module#isExported(String,Module) exported}
+    * to at least the {@code java.rmi} module; or
+    *
+    * <li>The class to be activated resides in a package that is
+    * {@linkplain Module#isOpen(String,Module) open}
+    * to at least the {@code java.rmi} module.
+    * </ul>
     *
     * @param id the object's activation identifier
     * @param desc the object's descriptor
diff --git a/jdk/src/java.rmi/share/classes/java/rmi/activation/Activator.java b/jdk/src/java.rmi/share/classes/java/rmi/activation/Activator.java
index 18fd82c..dca2b69 100644
--- a/jdk/src/java.rmi/share/classes/java/rmi/activation/Activator.java
+++ b/jdk/src/java.rmi/share/classes/java/rmi/activation/Activator.java
@@ -48,7 +48,7 @@
  * The <code>Activator</code> works closely with
  * <code>ActivationSystem</code>, which provides a means for registering
  * groups and objects within those groups, and <code>ActivationMonitor</code>,
- * which recives information about active and inactive objects and inactive
+ * which receives information about active and inactive objects and inactive
  * groups. <p>
  *
  * The activator is responsible for monitoring and detecting when
diff --git a/jdk/src/java.rmi/share/classes/java/rmi/server/UnicastRemoteObject.java b/jdk/src/java.rmi/share/classes/java/rmi/server/UnicastRemoteObject.java
index f18c66e..74d3c24 100644
--- a/jdk/src/java.rmi/share/classes/java/rmi/server/UnicastRemoteObject.java
+++ b/jdk/src/java.rmi/share/classes/java/rmi/server/UnicastRemoteObject.java
@@ -107,8 +107,9 @@
  * the binary name of the root class with the suffix {@code _Stub}.
  *
  * <li>The stub class is loaded by name using the class loader of the root
- * class. The stub class must extend {@link RemoteStub} and must have a
- * public constructor that has one parameter of type {@link RemoteRef}.
+ * class. The stub class must be public, it must extend {@link RemoteStub}, it must
+ * reside in a package that is exported to at least the {@code java.rmi} module, and it
+ * must have a public constructor that has one parameter of type {@link RemoteRef}.
  *
  * <li>Finally, an instance of the stub class is constructed with a
  * {@link RemoteRef}.
@@ -124,12 +125,21 @@
  *
  * <ul>
  *
- * <li>The proxy's class is defined by the class loader of the remote
- * object's class.
+ * <li>The proxy's class is defined according to the specifications for the
+ * <a href="{@docRoot}/java/lang/reflect/Proxy.html#membership">
+ * {@code Proxy}
+ * </a>
+ * class, using the class loader of the remote object's class.
  *
  * <li>The proxy implements all the remote interfaces implemented by the
  * remote object's class.
  *
+ * <li>Each remote interface must either be public and reside in a package that is
+ * {@linkplain Module#isExported(String,Module) exported}
+ * to at least the {@code java.rmi} module, or it must reside in a package that is
+ * {@linkplain Module#isOpen(String,Module) open}
+ * to at least the {@code java.rmi} module.
+ *
  * <li>The proxy's invocation handler is a {@link
  * RemoteObjectInvocationHandler} instance constructed with a
  * {@link RemoteRef}.
diff --git a/jdk/src/java.rmi/share/classes/module-info.java b/jdk/src/java.rmi/share/classes/module-info.java
index 7b97585..6509952 100644
--- a/jdk/src/java.rmi/share/classes/module-info.java
+++ b/jdk/src/java.rmi/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the Remote Method Invocation (RMI) API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.rmi {
     requires java.logging;
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java b/jdk/src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java
index 319e974..649fa22 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -128,6 +128,7 @@
     /**
      * Closes the stream when garbage is collected.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() throws IOException {
         close();
     }
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_de.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_de.properties
index 4198822..757228c 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_de.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_de.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: Warnung: Systemeigenschaft sun.rmi.activation.execPolicy\nnicht angegeben, und keine ExecPermissions/ExecOptionPermissions\nerteilt. Darauf folgende Aktivierungsversuche sind m\u00F6glicherweise aufgrund erfolgloser\nBerechtigungspr\u00FCfungen ExecPermission/ExecOptionPermission nicht erfolgreich. Weitere\nDokumentation zur Konfiguration von rmid-Sicherheit finden Sie unter:\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main: Warnung: Es wurde keine Systemeigenschaft sun.rmi.activation.execPolicy\nangegeben und keine ExecPermissions/ExecOptionPermissions\nerteilt. Nachfolgende Aktivierungsversuche scheitern m\u00F6glicherweise aufgrund\nnicht erfolgreicher Berechtigungspr\u00FCfungen ExecPermission/ExecOptionPermission. \nInformationen zur Sicherheitskonfiguration finden Sie in der rmid-Dokumentation.\n
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_es.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_es.properties
index b250cb8..1cc1b64 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_es.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_es.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: advertencia: no se han especificado las propiedades del sistema sun.rmi.activation.execPolicy\ny no se han otorgado ExecPermissions/ExecOptionPermissions;\nlos intentos de activaci\u00F3n posteriores pueden fallar debido a\ncomprobaciones de permiso ExecPermission/ExecOptionPermission incorrectas. Para\nobtener documentaci\u00F3n sobre c\u00F3mo configurar la seguridad rmid, rem\u00EDtase a:\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main: advertencia: no se han especificado las propiedades del sistema sun.rmi.activation.execPolicy\ny no se han otorgado ExecPermissions/ExecOptionPermissions;\nlos intentos de activaci\u00F3n posteriores pueden fallar debido a\ncomprobaciones de permiso ExecPermission/ExecOptionPermission incorrectas. \nPara configurar la seguridad, consulte la documentaci\u00F3n sobre rmid.\n
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_fr.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_fr.properties
index d589941..807b24a 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_fr.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_fr.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: avertissement : propri\u00E9t\u00E9 syst\u00E8me sun.rmi.activation.execPolicy\nnon sp\u00E9cifi\u00E9e et ExecPermissions/ExecOptionPermissions\nnon autoris\u00E9s ; les tentatives d'activation suivantes risquent d'\u00E9chouer en raison de la v\u00E9rification des droits\nExecPermission/ExecOptionPermission.  Pour obtenir de la\ndocumentation sur la configuration de la s\u00E9curit\u00E9 rmid, reportez-vous \u00E0 :\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://javasun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main : avertissement : propri\u00E9t\u00E9 syst\u00E8me sun.rmi.activation.execPolicy\nnon indiqu\u00E9e et ExecPermissions/ExecOptionPermissions\nnon accord\u00E9s ; les tentatives d'activation suivantes risquent d'\u00E9chouer en raison de la v\u00E9rification des droits\nExecPermission/ExecOptionPermission. \nPour configurer la s\u00E9curit\u00E9, reportez-vous \u00E0 la documentation rmid.\n
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_it.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_it.properties
index d415613..21c8b8f 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_it.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_it.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: avvertenza: sistema sun.rmi.activation.execPolicy\nPropriet\u00E0 non specificata e nessun ExecPermissions/ExecOptionPermissions\ngarantito. I tentativi di attivazione successivi potrebbero fallire a causa di \ncontrolli di autorizzazione ExecPermission/ExecOptionPermission non andati a buon fine.  Per\nla documentazione e le modalit\u00E0 di configurazione della sicurezza rmid, fare riferimento a (informazioni in inglese):\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main: avvertenza: propriet\u00E0 di sistema sun.rmi.activation.execPolicy\nnon specificata e nessun ExecPermissions/ExecOptionPermissions\nconcesso. I tentativi di attivazione successivi potrebbero fallire a causa di \ncontrolli di autorizzazione ExecPermission/ExecOptionPermission non riusciti.\nPer configurare la sicurezza, fare riferimento alla documentazione rmid.\n
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_ja.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_ja.properties
index 7d5ae8e..51960ac 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_ja.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_ja.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A:sun.rmi.activation.execPolicy\u30B7\u30B9\u30C6\u30E0\n\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u3001\u307E\u305F\u306F\nExecPermissions/ExecOptionPermissions\u304C\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002\nExecPermissions/ExecOptionPermissions\u30A2\u30AF\u30BB\u30B9\u6A29\u691C\u67FB\u3067\u8A31\u53EF\u3055\u308C\n\u306A\u3044\u305F\u3081\u3001\u5F8C\u306B\u7D9A\u304F\u8D77\u52D5\u306F\u5931\u6557\u3059\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\nrmid\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u69CB\u6210\u65B9\u6CD5\u306B\u3064\u3044\u3066\u306F\u3001\u6B21\u306E\u30DE\u30CB\u30E5\u30A2\u30EB\u3092\u53C2\u7167\u3057\u3066\n\u304F\u3060\u3055\u3044\u3002\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A:sun.rmi.activation.execPolicy\u30B7\u30B9\u30C6\u30E0\n\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u3001\u307E\u305F\u306FExecPermissions/ExecOptionPermissions\u304C\n\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002ExecPermissions/ExecOptionPermissions\u30A2\u30AF\u30BB\u30B9\u6A29\u691C\u67FB\u3067\u8A31\u53EF\u3055\u308C\n\u306A\u3044\u305F\u3081\u3001\u5F8C\u306B\u7D9A\u304F\u8D77\u52D5\u306F\u5931\u6557\u3059\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\n\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u3092\u78BA\u8A8D\u3059\u308B\u306B\u306F\u3001rmid\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_ko.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_ko.properties
index 1fd81e8..da505f2 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_ko.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_ko.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: \uACBD\uACE0: sun.rmi.activation.execPolicy \uC2DC\uC2A4\uD15C \uC18D\uC131\uC774\n\uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 ExecPermissions/ExecOptionPermissions\uAC00 \uBD80\uC5EC\uB418\uC9C0\n\uC54A\uC558\uC2B5\uB2C8\uB2E4. \uD65C\uC131\uD654\uB97C \uACC4\uC18D \uC2DC\uB3C4\uD558\uBA74 ExecPermission/ExecOptionPermission\n\uAD8C\uD55C \uAC80\uC0AC \uC2E4\uD328\uB85C \uC778\uD574 \uC2E4\uD328\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\nrmid \uBCF4\uC548 \uAD6C\uC131 \uBC29\uBC95\uC5D0 \uB300\uD55C \uC124\uBA85\uC11C\uB294 \uB2E4\uC74C \uC6F9 \uC0AC\uC774\uD2B8\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main: \uACBD\uACE0: sun.rmi.activation.execPolicy \uC2DC\uC2A4\uD15C \uC18D\uC131\uC774\n\uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 ExecPermissions/ExecOptionPermissions\uAC00 \uBD80\uC5EC\uB418\uC9C0\n\uC54A\uC558\uC2B5\uB2C8\uB2E4. \uD65C\uC131\uD654\uB97C \uACC4\uC18D \uC2DC\uB3C4\uD558\uBA74 ExecPermission/ExecOptionPermission\n\uAD8C\uD55C \uAC80\uC0AC \uC2E4\uD328\uB85C \uC778\uD574 \uC2E4\uD328\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n\uBCF4\uC548\uC744 \uAD6C\uC131\uD558\uB824\uBA74 rmid \uC124\uBA85\uC11C\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_pt_BR.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_pt_BR.properties
index cdbdcdf..a4e6087 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_pt_BR.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_pt_BR.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: advert\u00EAncia: propriedade do sistema sun.rmi.activation.execPolicy\nn\u00E3o registrada e nenhuma ExecPermission/ExecOptionPermission\nconcedida; as tentativas de ativa\u00E7\u00E3o seguintes podem falhar devido a verifica\u00E7\u00F5es malsucedidas da permiss\u00E3o\nExecPermission/ExecOptionPermission. Para obter\ndocumenta\u00E7\u00E3o sobre como configurar a seguran\u00E7a rmid, consulte:\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main: warning: sun.rmi.activation.execPolicy system\npropriedade n\u00E3o especificada e nenhuma permiss\u00E3o ExecPermissions/ExecOptionPermissions\nconcedida; as tentativas subsequentes de ativa\u00E7\u00E3o poder\u00E3o falhar por causa das\nverifica\u00E7\u00F5es malsucedidas da permiss\u00E3o ExecPermission/ExecOptionPermission. \nPara configurar a seguran\u00E7a, consulte a documenta\u00E7\u00E3o do rmid.\n
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_sv.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_sv.properties
index d1bb850..bfa7b84 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_sv.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_sv.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: varning: systemegenskapen sun.rmi.activation.execPolicy\n\u00E4r inte specificerad och inga ExecPermissions/ExecOptionPermissions\nhar utdelats. Efterf\u00F6ljande aktiveringsf\u00F6rs\u00F6k kanske inte utf\u00F6rs p\u00E5 grund av ej utf\u00F6rda\nkontroller av ExecPermission/ExecOptionPermission-beh\u00F6righet.  Mer\ninformation om hur du konfigurerar rmid-s\u00E4kerhet finns i:\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main: Varning: Systemegenskapen sun.rmi.activation.execPolicy\nhar inte angetts och inga ExecPermissions/ExecOptionPermissions har\ntilldelats. Efterf\u00F6ljande aktiveringsf\u00F6rs\u00F6k kanske inte utf\u00F6rs p\u00E5 grund\nav ej utf\u00F6rda ExecPermission/ExecOptionPermission-beh\u00F6righetskontroller. \nOm du vill konfigurera s\u00E4kerhet l\u00E4ser du i dokumentationen f\u00F6r rmid.
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_zh_CN.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_zh_CN.properties
index 6bb2256..5c3ef01 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_zh_CN.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_zh_CN.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A: sun.rmi.activation.execPolicy \u7CFB\u7EDF\n\u5C5E\u6027\u672A\u88AB\u6307\u5B9A\u4E14 ExecPermissions/ExecOptionPermissions\n\u5747\u672A\u88AB\u6388\u6743\u3002\u968F\u540E\u7684\u6FC0\u6D3B\u5C1D\u8BD5\u5931\u8D25, \u539F\u56E0\u662F\u5BF9\nExecPermission/ExecOptionPermission \u7684\u6743\u9650\u68C0\u67E5\u5931\u8D25\u3002\u6709\u5173\u5982\u4F55\n\u914D\u7F6E rmid \u5B89\u5168\u6027\u7684\u6587\u6863\u8BF4\u660E, \u8BF7\u53C2\u9605: \n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A: \u672A\u6307\u5B9A sun.rmi.activation.execPolicy\n\u7CFB\u7EDF\u5C5E\u6027\u5E76\u4E14\u672A\u6388\u4E88 ExecPermissions/ExecOptionPermissions\u3002\n\u7531\u4E8E\u5BF9 ExecPermission/ExecOptionPermission \u7684\n\u6743\u9650\u68C0\u67E5\u5931\u8D25, \u968F\u540E\u7684\u6FC0\u6D3B\u5C1D\u8BD5\u53EF\u80FD\u4F1A\u5931\u8D25\u3002\n\u8981\u914D\u7F6E\u5B89\u5168\u6027, \u8BF7\u53C2\u9605 rmid \u6587\u6863\u3002\n
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_zh_TW.properties b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_zh_TW.properties
index 1a32abc..e7f018d 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_zh_TW.properties
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/resources/rmid_zh_TW.properties
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@
 # "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and 
 # "ExecOptionPermission" should not be translated, since they refer to
 # class/permission names.
-rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A: sun.rmi.activation.execPolicy \u7CFB\u7D71\n\u5C6C\u6027\u672A\u6307\u5B9A\uFF0C\u4E26\u4E14\u672A\u6388\u4E88 ExecPermissions/ExecOptionPermissions; \n\u5F8C\u7E8C\u7684\u555F\u52D5\u5617\u8A66\u53EF\u80FD\u6703\u56E0\u70BA\u672A\u6210\u529F\u7684\nExecPermission/ExecOptionPermission \u6B0A\u9650\u6AA2\u67E5\u800C\u5931\u6557\u3002\u5982\u9700\n\u95DC\u65BC\u5982\u4F55\u8A2D\u5B9A rmid \u5B89\u5168\u7684\u8AAA\u660E\u6587\u4EF6\uFF0C\u8ACB\u53C3\u8003:\n\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html\nhttp://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html\n
+rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A: sun.rmi.activation.execPolicy \u7CFB\u7D71\n\u5C6C\u6027\u672A\u6307\u5B9A\uFF0C\u800C\u4E14\u672A\u6388\u4E88 ExecPermissions/ExecOptionPermissions;\n\u5F8C\u7E8C\u7684\u555F\u52D5\u5617\u8A66\u53EF\u80FD\u6703\u56E0\u70BA\u4E0D\u6210\u529F\u7684\nExecPermission/ExecOptionPermission \u6B0A\u9650\u6AA2\u67E5\u800C\u5931\u6557\u3002\n\u5982\u9700\u8A2D\u5B9A\u5B89\u5168\uFF0C\u8ACB\u53C3\u8003 rmid \u6587\u4EF6\u3002\n
 
 # "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
 # because they are syntax
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java b/jdk/src/java.rmi/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java
index fae0e36..42857ec 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/transport/tcp/ConnectionMultiplexer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -440,6 +440,7 @@
     /**
      * Shut down connection upon finalization.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable
     {
         super.finalize();
diff --git a/jdk/src/java.scripting/share/classes/module-info.java b/jdk/src/java.scripting/share/classes/module-info.java
index b0a5baf..42854af 100644
--- a/jdk/src/java.scripting/share/classes/module-info.java
+++ b/jdk/src/java.scripting/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the Scripting API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.scripting {
     exports javax.script;
diff --git a/jdk/src/java.se.ee/share/classes/module-info.java b/jdk/src/java.se.ee/share/classes/module-info.java
index a9caf75..983a4c7 100644
--- a/jdk/src/java.se.ee/share/classes/module-info.java
+++ b/jdk/src/java.se.ee/share/classes/module-info.java
@@ -28,8 +28,12 @@
  * <P>
  * This module requires {@code java.se} and supplements it with modules
  * that define CORBA and Java EE APIs. These modules are upgradeable.
+ *
+ * @moduleGraph
+ * @since 9
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // java.corba and other modules
 module java.se.ee {
 
     requires transitive java.se;
diff --git a/jdk/src/java.se/share/classes/module-info.java b/jdk/src/java.se/share/classes/module-info.java
index 1e1c0ed..33b99b1 100644
--- a/jdk/src/java.se/share/classes/module-info.java
+++ b/jdk/src/java.se/share/classes/module-info.java
@@ -28,6 +28,9 @@
  * <P>
  * The modules defining CORBA and Java EE APIs are not required by
  * this module, but they are required by {@code java.se.ee}.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.se {
     requires transitive java.compiler;
diff --git a/jdk/src/java.security.jgss/share/classes/module-info.java b/jdk/src/java.security.jgss/share/classes/module-info.java
index 78a7249..e73920e 100644
--- a/jdk/src/java.security.jgss/share/classes/module-info.java
+++ b/jdk/src/java.security.jgss/share/classes/module-info.java
@@ -27,6 +27,9 @@
  * Defines the Java binding of the IETF Generic Security Services API (GSS-API).
  * <P>
  * This module also contains GSS-API mechanisms including Kerberos v5 and SPNEGO.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.security.jgss {
     requires java.naming;
diff --git a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java
index 3b06c7a..019fa6f 100644
--- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -130,6 +130,7 @@
         return "N/A";
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         dispose();
     }
diff --git a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java
index 3463fd6..88274c1 100644
--- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -289,6 +289,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         dispose();
     }
diff --git a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java
index 271fcfb..d2d5367 100644
--- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -618,6 +618,7 @@
         return isInitiator;
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         dispose();
     }
diff --git a/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java b/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java
index 88ddb7f..0d521bf 100644
--- a/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java
+++ b/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -136,6 +136,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         clearPassword();
     }
diff --git a/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java b/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java
index ce92c29..7d56154 100644
--- a/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java
+++ b/jdk/src/java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -199,6 +199,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         clearPassword();
     }
diff --git a/jdk/src/java.security.sasl/share/classes/module-info.java b/jdk/src/java.security.sasl/share/classes/module-info.java
index 70f860b..162f844 100644
--- a/jdk/src/java.security.sasl/share/classes/module-info.java
+++ b/jdk/src/java.security.sasl/share/classes/module-info.java
@@ -29,6 +29,9 @@
  * <P>
  * This module also contains SASL mechanisms including DIGEST-MD5,
  * CRAM-MD5, and NTLM.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.security.sasl {
     requires java.logging;
diff --git a/jdk/src/java.smartcardio/share/classes/module-info.java b/jdk/src/java.smartcardio/share/classes/module-info.java
index 05f4588..ece968c 100644
--- a/jdk/src/java.smartcardio/share/classes/module-info.java
+++ b/jdk/src/java.smartcardio/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the Java Smart Card I/O API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.smartcardio {
     exports javax.smartcardio;
diff --git a/jdk/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java b/jdk/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java
index f3a0151..d7e8f49 100644
--- a/jdk/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java
+++ b/jdk/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -274,6 +274,7 @@
             + ", protocol " + getProtocol() + ", state " + state;
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             if (state == State.OK) {
diff --git a/jdk/src/java.smartcardio/unix/legal/pcsclite.md b/jdk/src/java.smartcardio/unix/legal/pcsclite.md
index f90e9cc..380062d 100644
--- a/jdk/src/java.smartcardio/unix/legal/pcsclite.md
+++ b/jdk/src/java.smartcardio/unix/legal/pcsclite.md
@@ -1,6 +1,6 @@
 ## PC/SC Lite for Suse Linux v1.1.1
 
-### PC/SC Lite for Suse Linux License
+### PC/SC Lite License
 <pre>
 
 Copyright (c) 1999-2004 David Corcoran <corcoran@linuxnet.com>
diff --git a/jdk/src/java.sql.rowset/share/classes/module-info.java b/jdk/src/java.sql.rowset/share/classes/module-info.java
index b2c27bc..0241390 100644
--- a/jdk/src/java.sql.rowset/share/classes/module-info.java
+++ b/jdk/src/java.sql.rowset/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the JDBC RowSet API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.sql.rowset {
     requires transitive java.logging;
diff --git a/jdk/src/java.sql/share/classes/java/sql/CallableStatement.java b/jdk/src/java.sql/share/classes/java/sql/CallableStatement.java
index c54b63b..eaafcce 100644
--- a/jdk/src/java.sql/share/classes/java/sql/CallableStatement.java
+++ b/jdk/src/java.sql/share/classes/java/sql/CallableStatement.java
@@ -60,6 +60,7 @@
  *
  * @see Connection#prepareCall
  * @see ResultSet
+ * @since 1.1
  */
 
 public interface CallableStatement extends PreparedStatement {
diff --git a/jdk/src/java.sql/share/classes/java/sql/Connection.java b/jdk/src/java.sql/share/classes/java/sql/Connection.java
index 3051c83..446f63c 100644
--- a/jdk/src/java.sql/share/classes/java/sql/Connection.java
+++ b/jdk/src/java.sql/share/classes/java/sql/Connection.java
@@ -80,6 +80,7 @@
  * @see Statement
  * @see ResultSet
  * @see DatabaseMetaData
+ * @since 1.1
  */
 public interface Connection  extends Wrapper, AutoCloseable {
 
@@ -1534,8 +1535,9 @@
      * <li>The connection pool caches {@code PooledConnection} objects</li>
      * <li>Returns a logical connection handle when {@code getConnection} is
      * called by the application</li>
-     * <li>The pool manager calls {@code Connection.close} on the logical connection handle
-     * prior to returning the {@code PooledConnection} back to the cache</li>
+     * <li>The logical {@code Connection} is closed by calling
+     * {@code Connection.close} prior to returning the {@code PooledConnection}
+     * to the cache.</li>
      * </ul>
      * @throws SQLException if an error occurs
      * @since 9
@@ -1576,8 +1578,9 @@
      * <li>The connection pool caches {@code PooledConnection} objects</li>
      * <li>Returns a logical connection handle when {@code getConnection} is
      * called by the application</li>
-     * <li>The pool manager calls {@code Connection.close} on the logical connection handle
-     * prior to returning the {@code PooledConnection} back to the cache</li>
+     * <li>The logical {@code Connection} is closed by calling
+     * {@code Connection.close} prior to returning the {@code PooledConnection}
+     * to the cache.</li>
      * </ul>
      * @throws SQLException if an error occurs
      * @since 9
@@ -1589,7 +1592,10 @@
     }
 
     /**
-     * Sets and validates the sharding keys for this connection.
+     * Sets and validates the sharding keys for this connection. A {@code null}
+     * value may be specified for the sharding Key. The validity
+     * of a {@code null} sharding key is vendor-specific. Consult your vendor&#39;s
+     * documentation for additional information.
      * @implSpec
      * The default implementation will throw a
      * {@code SQLFeatureNotSupportedException}.
@@ -1599,7 +1605,8 @@
      * {@code Connection}. The timeout value indicates how long the driver
      * should wait for the {@code Connection} to verify that the sharding key
      * is valid before {@code setShardingKeyIfValid} returns false.
-     * @param shardingKey the sharding key to be validated against this connection
+     * @param shardingKey the sharding key to be validated against this connection.
+     * The sharding key may be {@code null}
      * @param superShardingKey the super sharding key to be validated against this
      * connection. The super sharding key may be {@code null}.
      * @param timeout time in seconds before which the validation process is expected to
@@ -1609,10 +1616,10 @@
      * and set on this connection; false if the sharding keys are not valid or
      * the timeout period expires before the operation completes.
      * @throws SQLException if an error occurs while performing this validation;
-     * the {@code shardingkey} is {@code null}; a {@code superSharedingKey} is specified
+     * a {@code superSharedingKey} is specified
      * without a {@code shardingKey};
      * this method is called on a closed {@code connection}; or
-     * the {@code timeout} value is less than 0.
+     * the {@code timeout} value is negative.
      * @throws SQLFeatureNotSupportedException if the driver does not support sharding
      * @since 9
      * @see ShardingKey
@@ -1625,7 +1632,10 @@
     }
 
     /**
-     * Sets and validates the sharding key for this connection.
+     * Sets and validates the sharding key for this connection. A {@code null}
+     * value may be specified for the sharding Key. The validity
+     * of a {@code null} sharding key is vendor-specific. Consult your vendor&#39;s
+     * documentation for additional information.
      * @implSpec
      * The default implementation will throw a
      * {@code SQLFeatureNotSupportedException}.
@@ -1634,7 +1644,8 @@
      * {@code Connection}. The timeout value indicates how long the driver
      * should wait for the {@code Connection} to verify that the sharding key
      * is valid before {@code setShardingKeyIfValid} returns false.
-     * @param shardingKey the sharding key to be validated against this connection
+     * @param shardingKey the sharding key to be validated against this connection.
+     * The sharding key may be {@code null}
      * @param timeout time in seconds before which the validation process is expected to
      * be completed,else the validation process is aborted. A value of 0 indicates
      * the validation process will not time out.
@@ -1642,8 +1653,8 @@
      * set on this connection; false if the sharding key is not valid or
      * the timeout period expires before the operation completes.
      * @throws SQLException if there is an error while performing this validation;
-     * this method is called on a closed {@code connection}; the {@code shardingkey}
-     * is {@code null}; or the {@code timeout} value is less than 0.
+     * this method is called on a closed {@code connection};
+     * or the {@code timeout} value is negative.
      * @throws SQLFeatureNotSupportedException if the driver does not support sharding
      * @since 9
      * @see ShardingKey
@@ -1663,12 +1674,12 @@
      * This method sets the specified sharding keys but does not require a
      * round trip to the database to validate that the sharding keys are valid
      * for the {@code Connection}.
-     * @param shardingKey the sharding key to set on this connection.
+     * @param shardingKey the sharding key to set on this connection. The sharding
+     * key may be {@code null}
      * @param superShardingKey the super sharding key to set on this connection.
      * The super sharding key may be {@code null}
      * @throws SQLException if an error  occurs setting the sharding keys;
-     * this method is called on a closed {@code connection};
-     * the {@code shardingkey} is {@code null}; or
+     * this method is called on a closed {@code connection}; or
      * a {@code superSharedingKey} is specified without a {@code shardingKey}
      * @throws SQLFeatureNotSupportedException if the driver does not support sharding
      * @since 9
@@ -1689,10 +1700,10 @@
      * This method sets the specified sharding key but does not require a
      * round trip to the database to validate that the sharding key is valid
      * for the {@code Connection}.
-     * @param shardingKey the sharding key to set on this connection.
-     * @throws SQLException if an error  occurs setting the sharding key;
-     * this method is called on a closed {@code connection}; or the
-     * {@code shardkingKey} is {@code null}
+     * @param shardingKey the sharding key to set on this connection. The sharding
+     * key may be {@code null}
+     * @throws SQLException if an error occurs setting the sharding key; or
+     * this method is called on a closed {@code connection}
      * @throws SQLFeatureNotSupportedException if the driver does not support sharding
      * @since 9
      * @see ShardingKey
diff --git a/jdk/src/java.sql/share/classes/java/sql/DataTruncation.java b/jdk/src/java.sql/share/classes/java/sql/DataTruncation.java
index 5aef67c..1c48322 100644
--- a/jdk/src/java.sql/share/classes/java/sql/DataTruncation.java
+++ b/jdk/src/java.sql/share/classes/java/sql/DataTruncation.java
@@ -34,6 +34,8 @@
  *
  * <P>The SQLstate for a <code>DataTruncation</code> during read is <code>01004</code>.
  * <P>The SQLstate for a <code>DataTruncation</code> during write is <code>22001</code>.
+ *
+ * @since 1.1
  */
 
 public class DataTruncation extends SQLWarning {
diff --git a/jdk/src/java.sql/share/classes/java/sql/DatabaseMetaData.java b/jdk/src/java.sql/share/classes/java/sql/DatabaseMetaData.java
index 8d8c621..bc4e1fb 100644
--- a/jdk/src/java.sql/share/classes/java/sql/DatabaseMetaData.java
+++ b/jdk/src/java.sql/share/classes/java/sql/DatabaseMetaData.java
@@ -68,6 +68,7 @@
  * argument is set to <code>null</code>, that argument's criterion will
  * be dropped from the search.
  *
+ * @since 1.1
  */
 public interface DatabaseMetaData extends Wrapper {
 
diff --git a/jdk/src/java.sql/share/classes/java/sql/Date.java b/jdk/src/java.sql/share/classes/java/sql/Date.java
index f784e72..a6d8d8f 100644
--- a/jdk/src/java.sql/share/classes/java/sql/Date.java
+++ b/jdk/src/java.sql/share/classes/java/sql/Date.java
@@ -41,6 +41,8 @@
  * must be 'normalized' by setting the
  * hours, minutes, seconds, and milliseconds to zero in the particular
  * time zone with which the instance is associated.
+ *
+ * @since 1.1
  */
 public class Date extends java.util.Date {
 
diff --git a/jdk/src/java.sql/share/classes/java/sql/Driver.java b/jdk/src/java.sql/share/classes/java/sql/Driver.java
index 3bb3e0c..56c89273 100644
--- a/jdk/src/java.sql/share/classes/java/sql/Driver.java
+++ b/jdk/src/java.sql/share/classes/java/sql/Driver.java
@@ -54,6 +54,7 @@
  * @see DriverManager
  * @see Connection
  * @see DriverAction
+ * @since 1.1
  */
 public interface Driver {
 
diff --git a/jdk/src/java.sql/share/classes/java/sql/DriverManager.java b/jdk/src/java.sql/share/classes/java/sql/DriverManager.java
index 84456bd..6c4f68a 100644
--- a/jdk/src/java.sql/share/classes/java/sql/DriverManager.java
+++ b/jdk/src/java.sql/share/classes/java/sql/DriverManager.java
@@ -78,6 +78,7 @@
  *
  * @see Driver
  * @see Connection
+ * @since 1.1
  */
 public class DriverManager {
 
diff --git a/jdk/src/java.sql/share/classes/java/sql/DriverPropertyInfo.java b/jdk/src/java.sql/share/classes/java/sql/DriverPropertyInfo.java
index b5a6452..4ccf2bc 100644
--- a/jdk/src/java.sql/share/classes/java/sql/DriverPropertyInfo.java
+++ b/jdk/src/java.sql/share/classes/java/sql/DriverPropertyInfo.java
@@ -31,6 +31,8 @@
  * who need to interact with a Driver via the method
  * <code>getDriverProperties</code> to discover
  * and supply properties for connections.
+ *
+ * @since 1.1
  */
 
 public class DriverPropertyInfo {
diff --git a/jdk/src/java.sql/share/classes/java/sql/PreparedStatement.java b/jdk/src/java.sql/share/classes/java/sql/PreparedStatement.java
index efeb136..c118927 100644
--- a/jdk/src/java.sql/share/classes/java/sql/PreparedStatement.java
+++ b/jdk/src/java.sql/share/classes/java/sql/PreparedStatement.java
@@ -56,6 +56,7 @@
  *
  * @see Connection#prepareStatement
  * @see ResultSet
+ * @since 1.1
  */
 
 public interface PreparedStatement extends Statement {
diff --git a/jdk/src/java.sql/share/classes/java/sql/ResultSet.java b/jdk/src/java.sql/share/classes/java/sql/ResultSet.java
index 4170b89..07fb0b2 100644
--- a/jdk/src/java.sql/share/classes/java/sql/ResultSet.java
+++ b/jdk/src/java.sql/share/classes/java/sql/ResultSet.java
@@ -143,6 +143,7 @@
  * @see Statement#executeQuery
  * @see Statement#getResultSet
  * @see ResultSetMetaData
+ * @since 1.1
  */
 
 public interface ResultSet extends Wrapper, AutoCloseable {
diff --git a/jdk/src/java.sql/share/classes/java/sql/ResultSetMetaData.java b/jdk/src/java.sql/share/classes/java/sql/ResultSetMetaData.java
index c1dd474..ea5659f 100644
--- a/jdk/src/java.sql/share/classes/java/sql/ResultSetMetaData.java
+++ b/jdk/src/java.sql/share/classes/java/sql/ResultSetMetaData.java
@@ -40,6 +40,8 @@
  *     boolean b = rsmd.isSearchable(1);
  *
  * </PRE>
+ *
+ * @since 1.1
  */
 
 public interface ResultSetMetaData extends Wrapper {
diff --git a/jdk/src/java.sql/share/classes/java/sql/SQLException.java b/jdk/src/java.sql/share/classes/java/sql/SQLException.java
index 95276a0..b46e82f 100644
--- a/jdk/src/java.sql/share/classes/java/sql/SQLException.java
+++ b/jdk/src/java.sql/share/classes/java/sql/SQLException.java
@@ -49,6 +49,8 @@
  *       error information.
  *   <LI> the causal relationship, if any for this <code>SQLException</code>.
  * </UL>
+ *
+ * @since 1.1
  */
 public class SQLException extends java.lang.Exception
                           implements Iterable<Throwable> {
diff --git a/jdk/src/java.sql/share/classes/java/sql/SQLWarning.java b/jdk/src/java.sql/share/classes/java/sql/SQLWarning.java
index 37d3bfc..49af4fa 100644
--- a/jdk/src/java.sql/share/classes/java/sql/SQLWarning.java
+++ b/jdk/src/java.sql/share/classes/java/sql/SQLWarning.java
@@ -41,6 +41,7 @@
  * @see Connection#getWarnings
  * @see Statement#getWarnings
  * @see ResultSet#getWarnings
+ * @since 1.1
  */
 public class SQLWarning extends SQLException {
 
diff --git a/jdk/src/java.sql/share/classes/java/sql/ShardingKeyBuilder.java b/jdk/src/java.sql/share/classes/java/sql/ShardingKeyBuilder.java
index 6cf58d5..8ad3eb5 100644
--- a/jdk/src/java.sql/share/classes/java/sql/ShardingKeyBuilder.java
+++ b/jdk/src/java.sql/share/classes/java/sql/ShardingKeyBuilder.java
@@ -42,6 +42,8 @@
  *                           .build();
  * }
  * </pre>
+ *
+ * @since 9
  */
 public interface ShardingKeyBuilder {
 
diff --git a/jdk/src/java.sql/share/classes/java/sql/Statement.java b/jdk/src/java.sql/share/classes/java/sql/Statement.java
index fe40a2f..582d4f2 100644
--- a/jdk/src/java.sql/share/classes/java/sql/Statement.java
+++ b/jdk/src/java.sql/share/classes/java/sql/Statement.java
@@ -42,6 +42,7 @@
  *
  * @see Connection#createStatement
  * @see ResultSet
+ * @since 1.1
  */
 public interface Statement extends Wrapper, AutoCloseable {
 
@@ -1399,6 +1400,8 @@
      * converted to two single quotes
      * @throws NullPointerException if val is {@code null}
      * @throws SQLException if a database access error occurs
+     *
+     * @since 9
      */
      default String enquoteLiteral(String val)  throws SQLException {
          return "'" + val.replace("'", "''") +  "'";
@@ -1503,6 +1506,8 @@
      * @throws SQLFeatureNotSupportedException if the datasource does not support
      * delimited identifiers
      * @throws NullPointerException if identifier is {@code null}
+     *
+     * @since 9
      */
     default String enquoteIdentifier(String identifier, boolean alwaysQuote) throws SQLException {
         int len = identifier.length();
@@ -1576,6 +1581,8 @@
      * @return  true if  a simple SQL identifier, false otherwise
      * @throws NullPointerException if identifier is {@code null}
      * @throws SQLException if a database access error occurs
+     *
+     * @since 9
      */
     default boolean isSimpleIdentifier(String identifier) throws SQLException {
         int len = identifier.length();
@@ -1617,6 +1624,8 @@
     * then prefixed with 'N'.
     * @throws NullPointerException if val is {@code null}
     * @throws SQLException if a database access error occurs
+    *
+    * @since 9
     */
     default String enquoteNCharLiteral(String val)  throws SQLException {
         return "N'" + val.replace("'", "''") +  "'";
diff --git a/jdk/src/java.sql/share/classes/java/sql/Time.java b/jdk/src/java.sql/share/classes/java/sql/Time.java
index f764e0a..3d1f237 100644
--- a/jdk/src/java.sql/share/classes/java/sql/Time.java
+++ b/jdk/src/java.sql/share/classes/java/sql/Time.java
@@ -38,6 +38,8 @@
  * values.
  * <p>The date components should be set to the "zero epoch"
  * value of January 1, 1970 and should not be accessed.
+ *
+ * @since 1.1
  */
 public class Time extends java.util.Date {
 
diff --git a/jdk/src/java.sql/share/classes/java/sql/Timestamp.java b/jdk/src/java.sql/share/classes/java/sql/Timestamp.java
index 8421f95..968d6e7 100644
--- a/jdk/src/java.sql/share/classes/java/sql/Timestamp.java
+++ b/jdk/src/java.sql/share/classes/java/sql/Timestamp.java
@@ -69,6 +69,8 @@
  * inheritance relationship between {@code Timestamp}
  * and {@code java.util.Date} really
  * denotes implementation inheritance, and not type inheritance.
+ *
+ * @since 1.1
  */
 public class Timestamp extends java.util.Date {
 
diff --git a/jdk/src/java.sql/share/classes/java/sql/Types.java b/jdk/src/java.sql/share/classes/java/sql/Types.java
index 9f613ea..1137246 100644
--- a/jdk/src/java.sql/share/classes/java/sql/Types.java
+++ b/jdk/src/java.sql/share/classes/java/sql/Types.java
@@ -30,6 +30,8 @@
  * SQL types, called JDBC types.
  * <p>
  * This class is never instantiated.
+ *
+ * @since 1.1
  */
 public class Types {
 
diff --git a/jdk/src/java.sql/share/classes/java/sql/package.html b/jdk/src/java.sql/share/classes/java/sql/package.html
index 0d1dc67..163522d 100644
--- a/jdk/src/java.sql/share/classes/java/sql/package.html
+++ b/jdk/src/java.sql/share/classes/java/sql/package.html
@@ -2,7 +2,7 @@
 <html>
 <head>
 <!--
- Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
 This code is free software; you can redistribute it and/or modify it
@@ -32,32 +32,32 @@
 
 <body bgcolor="white">
 
-Provides the API for accessing and processing data stored in a 
-data source (usually a relational database) using the 
-Java&trade; programming language. 
+Provides the API for accessing and processing data stored in a
+data source (usually a relational database) using the
+Java&trade; programming language.
 This API includes a framework whereby different
 drivers can be installed dynamically to access different data sources.
-Although the JDBC&trade; API is mainly geared 
+Although the JDBC&trade; API is mainly geared
 to passing SQL statements to a database, it provides for reading and
 writing data from any data source with a tabular format.
-The reader/writer facility, available through the 
+The reader/writer facility, available through the
 <code>javax.sql.RowSet</code> group of interfaces, can be customized to
-use and update data from a spread sheet, flat file, or any other tabular 
+use and update data from a spread sheet, flat file, or any other tabular
 data source.
 
-<h2>What the JDBC&trade; 4.2 API Includes</h2>
-The JDBC&trade; 4.2 API includes both
+<h2>What the JDBC&trade; 4.3 API Includes</h2>
+The JDBC&trade; 4.3 API includes both
 the <code>java.sql</code> package, referred to as the JDBC core API,
 and the <code>javax.sql</code> package, referred to as the JDBC Optional
 Package API. This complete JDBC API
 is included in the Java&trade; Standard Edition (Java SE&trade;), version 7.
-The <code>javax.sql</code> package extends the functionality of the JDBC API 
+The <code>javax.sql</code> package extends the functionality of the JDBC API
 from a client-side API to a server-side API, and it is an essential part
 of the Java&trade;  Enterprise Edition
-(Java EE&trade;) technology. 
+(Java EE&trade;) technology.
 
 <h2>Versions</h2>
-The JDBC 4.2 API incorporates all of the previous JDBC API versions:
+The JDBC 4.3 API incorporates all of the previous JDBC API versions:
 <UL>
     <LI> The JDBC 4.1 API</li>
     <LI> The JDBC 4.0 API</li>
@@ -70,33 +70,35 @@
  <LI> The JDBC 1.0 API</li>
 </UL>
 <P>
-Classes, interfaces, methods, fields, constructors, and exceptions 
-have the following "since" tags that indicate when they were introduced 
+Classes, interfaces, methods, fields, constructors, and exceptions
+have the following "since" tags that indicate when they were introduced
 into the Java platform. When these "since" tags are used in
 Javadoc&trade; comments for the JDBC API,
 they indicate the following:
 <UL>
-    <LI>Since 1.8 -- new in the JDBC 4.2 API and part of the Java SE platform,
+    <LI>Since 9 -- new in the JDBC 4.3 API and part of the Java SE platform,
+        version 9</li>
+     <LI>Since 1.8 -- new in the JDBC 4.2 API and part of the Java SE platform,
         version 8</li>
  <LI>Since 1.7 -- new in the JDBC 4.1 API and part of the Java SE platform,
      version 7</li>
 <LI>Since 1.6 -- new in the JDBC 4.0 API and part of the Java SE platform,
     version 6</li>
- <LI>Since 1.4 -- new in the JDBC 3.0 API and part of the J2SE platform, 
+ <LI>Since 1.4 -- new in the JDBC 3.0 API and part of the J2SE platform,
      version 1.4</li>
- <LI>Since 1.2 -- new in the JDBC 2.0 API and part of the J2SE platform, 
+ <LI>Since 1.2 -- new in the JDBC 2.0 API and part of the J2SE platform,
      version 1.2</li>
  <LI>Since 1.1 or no "since" tag -- in the original JDBC 1.0 API and part of
      the JDK&trade;, version 1.1</li>
 </UL>
 <P>
-<b>NOTE:</b> Many of the new features are optional; consequently, there is 
-some variation in drivers and the features they support. Always 
+<b>NOTE:</b> Many of the new features are optional; consequently, there is
+some variation in drivers and the features they support. Always
 check your driver's documentation to see whether it supports a feature before
 you try to use it.
 <P>
 <b>NOTE:</b> The class <code>SQLPermission</code> was added in the
-Java&trade; 2 SDK, Standard Edition, 
+Java&trade; 2 SDK, Standard Edition,
 version 1.3 release. This class is used to prevent unauthorized
 access to the logging stream associated with the <code>DriverManager</code>,
 which may contain information such as table names, column data, and so on.
@@ -112,7 +114,7 @@
                   attempts to set up a logging stream through the
                   <code>DriverManager</code>
 	 <LI><code>Driver</code> interface -- provides the API for registering
-             and connecting drivers based on JDBC technology ("JDBC drivers"); 
+             and connecting drivers based on JDBC technology ("JDBC drivers");
              generally used only by the <code>DriverManager</code> class
 	 <LI><code>DriverPropertyInfo</code> class -- provides properties for a
              JDBC driver; not used by the general user
@@ -120,9 +122,9 @@
   <LI>Sending SQL statements to a database
   <UL>
 	 <LI><code>Statement</code> --  used to send basic SQL statements
-	 <LI><code>PreparedStatement</code> --  used to send prepared statements or 
+	 <LI><code>PreparedStatement</code> --  used to send prepared statements or
               basic SQL statements (derived from <code>Statement</code>)
-	 <LI><code>CallableStatement</code> --  used to call database stored 
+	 <LI><code>CallableStatement</code> --  used to call database stored
               procedures (derived from <code>PreparedStatement</code>)
 	 <LI><code>Connection</code> interface --  provides methods for creating
              statements and managing connections and their properties
@@ -133,20 +135,20 @@
   <UL>
 	 <LI><code>ResultSet</code> interface
   </UL>
-  <LI>Standard mappings for SQL types to classes and interfaces in the 
+  <LI>Standard mappings for SQL types to classes and interfaces in the
       Java programming language
   <UL>
-	 <LI><code>Array</code> interface -- mapping for SQL <code>ARRAY</code> 
-	 <LI><code>Blob</code> interface -- mapping for SQL <code>BLOB</code> 
+	 <LI><code>Array</code> interface -- mapping for SQL <code>ARRAY</code>
+	 <LI><code>Blob</code> interface -- mapping for SQL <code>BLOB</code>
 	 <LI><code>Clob</code> interface -- mapping for SQL <code>CLOB</code>
-	 <LI><code>Date</code> class -- mapping for SQL <code>DATE</code> 
+	 <LI><code>Date</code> class -- mapping for SQL <code>DATE</code>
 	  <LI><code>NClob</code> interface -- mapping for SQL <code>NCLOB</code>
-	 <LI><code>Ref</code> interface -- mapping for SQL <code>REF</code> 
+	 <LI><code>Ref</code> interface -- mapping for SQL <code>REF</code>
 	  <LI><code>RowId</code> interface -- mapping for SQL <code>ROWID</code>
-	 <LI><code>Struct</code> interface -- mapping for SQL <code>STRUCT</code> 
+	 <LI><code>Struct</code> interface -- mapping for SQL <code>STRUCT</code>
 	  <LI><code>SQLXML</code> interface -- mapping for SQL <code>XML</code>
-	 <LI><code>Time</code> class -- mapping for SQL <code>TIME</code> 
-	 <LI><code>Timestamp</code> class -- mapping for SQL <code>TIMESTAMP</code> 
+	 <LI><code>Time</code> class -- mapping for SQL <code>TIME</code>
+	 <LI><code>Timestamp</code> class -- mapping for SQL <code>TIMESTAMP</code>
 	 <LI><code>Types</code> class -- provides constants for SQL types
   </UL>
   <LI>Custom mapping an SQL user-defined type (UDT) to a class in the
@@ -180,10 +182,26 @@
 	</UL>
 </UL>
 
+    <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 4.3 API</h3>
+<UL>
+    <LI>Added <code>Sharding</code> support</LI>
+    <LI>Enhanced <code>Connection</code> to be able to provide hints
+        to the driver that a request, an independent unit of work,
+        is beginning or ending</LI>
+    <LI>Enhanced <code>DatabaseMetaData</code> to determine if Sharding is
+    supported</LI>
+    <LI>Added the method <code>drivers</code> to <code>DriverManager</code> 
+            to return a Stream of the currently loaded and
+            available JDBC drivers</LI>
+    <LI>Added support to <code>Statement</code> for enquoting literals
+    and simple identifiers</LI>
+    <LI>Clarified the Java SE version that methods were deprecated</LI>
+</UL>
+
     <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 4.2 API</h3>
 <UL>
     <LI>Added <code>JDBCType</code>  enum and <code>SQLType</code> interface</li>
-    <LI>Support for <code>REF CURSORS</code> in <code>CallableStatement</code> 
+    <LI>Support for <code>REF CURSORS</code> in <code>CallableStatement</code>
     </LI>
     <LI><code>DatabaseMetaData</code> methods to return maximum Logical LOB size
         and if Ref Cursors are supported</LI>
@@ -196,7 +214,7 @@
     <LI>Allow <code>Connection</code>,
         <code>ResultSet</code> and <code>Statement</code> objects to be
         used with the try-with-resources statement</LI>
-    <LI>Supported added to <code>CallableStatement</code> and
+    <LI>Support added to <code>CallableStatement</code> and
         <code>ResultSet</code> to specify the Java type to convert to via the
         <code>getObject</code> method</LI>
     <LI><code>DatabaseMetaData</code> methods to return PseudoColumns and if a
@@ -212,7 +230,7 @@
 </UL>
 <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 4.0 API</h3>
 <UL>
-  <LI>auto java.sql.Driver discovery -- no longer need to load a 
+  <LI>auto java.sql.Driver discovery -- no longer need to load a
 <code>java.sql.Driver</code> class via <code>Class.forName</code>
  <LI>National Character Set support added
  <li>Support added for the SQL:2003 XML data type
@@ -222,18 +240,18 @@
  as well as additional methods added to improve accessibility
  <li>Support added for accessing a SQL ROWID
  <li>Support added to allow a JDBC application to access an instance of a JDBC resource
- that has been wrapped by a vendor, usually in an application server or connection 
+ that has been wrapped by a vendor, usually in an application server or connection
  pooling environment.
  <li>Availability to be notified when a <code>PreparedStatement</code> that is associated
  with a <code>PooledConnection</code> has been closed or the driver determines is invalid
- 
- 
+
+
 </UL>
 
 
 <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 3.0 API</h3>
 <UL>
-  <LI>Pooled statements -- reuse of statements associated with a pooled 
+  <LI>Pooled statements -- reuse of statements associated with a pooled
        connection
   <LI>Savepoints -- allow a transaction to be rolled back to a designated
       savepoint
@@ -241,7 +259,7 @@
       how connections are to be pooled
   <LI>Metadata for parameters of a <code>PreparedStatement</code> object
   <LI>Ability to retrieve values from automatically generated columns
-  <LI>Ability to have multiple <code>ResultSet</code> objects 
+  <LI>Ability to have multiple <code>ResultSet</code> objects
        returned from <code>CallableStatement</code> objects open at the
       same time
   <LI>Ability to identify parameters to <code>CallableStatement</code>
@@ -252,7 +270,7 @@
       <code>Ref</code> object references
   <LI>Ability to programmatically update <code>BLOB</code>,
       <code>CLOB</code>, <code>ARRAY</code>, and <code>REF</code> values.
-  <LI>Addition of the <code>java.sql.Types.DATALINK</code> data type -- 
+  <LI>Addition of the <code>java.sql.Types.DATALINK</code> data type --
       allows JDBC drivers access to objects stored outside a data source
   <LI>Addition of metadata for retrieving SQL type hierarchies
 </UL>
@@ -269,7 +287,7 @@
   <LI>Miscellaneous features, including performance hints, the use of character
 	  streams, full precision for <code>java.math.BigDecimal</code> values,
 	  additional security, and
-	  support for time zones in date, time, and timestamp values. 
+	  support for time zones in date, time, and timestamp values.
 </UL>
 
 <h3><code>javax.sql</code> Features Introduced in the JDBC 2.0 Optional
@@ -277,7 +295,7 @@
 <UL>
   <LI>The <code>DataSource</code> interface as a means of making a connection.  The
       Java Naming and Directory Interface&trade;
-      (JNDI) is used for registering a <code>DataSource</code> object with a 
+      (JNDI) is used for registering a <code>DataSource</code> object with a
       naming service and also for  retrieving it.
   <LI>Pooled connections -- allowing connections to be used and reused
   <LI>Distributed transactions -- allowing a transaction to span diverse
@@ -301,13 +319,13 @@
       that contains two things:
    <ul>
        <li>the fully-qualified SQL name of the UDT
-       <li>the <code>Class</code> object for the class that implements the 
+       <li>the <code>Class</code> object for the class that implements the
            <code>SQLData</code> interface
    </ul>
 </ol>
 <p>
 When these are in place for a UDT, calling the methods
-<code>ResultSet.getObject</code> or <code>CallableStatement.getObject</code> 
+<code>ResultSet.getObject</code> or <code>CallableStatement.getObject</code>
 on that UDT will automatically retrieve the custom mapping for it. Also, the
 <code>PreparedStatement.setObject</code> method will automatically map the
 object back to its SQL type to store it in the data source.
@@ -315,7 +333,7 @@
 <h2>Package Specification</h2>
 
 <ul>
-  <li><a href="https://jcp.org/en/jsr/detail?id=221">JDBC 4.2 Specification</a>
+  <li><a href="https://jcp.org/en/jsr/detail?id=221">JDBC 4.3 Specification</a>
 </ul>
 
 <h2>Related Documentation</h2>
diff --git a/jdk/src/java.sql/share/classes/javax/sql/package.html b/jdk/src/java.sql/share/classes/javax/sql/package.html
index d404c56..75cb739 100644
--- a/jdk/src/java.sql/share/classes/javax/sql/package.html
+++ b/jdk/src/java.sql/share/classes/javax/sql/package.html
@@ -2,7 +2,7 @@
 <html>
 <head>
 <!--
-Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
 This code is free software; you can redistribute it and/or modify it
@@ -281,15 +281,12 @@
 ways, and anyone may write an implementation. Developers are encouraged 
 to use their imaginations in coming up with new ways to use rowsets.
 <P>
-<B>IMPORTANT NOTE:</B> Code that uses API marked "Since 1.6" must be run using a 
-JDBC technology driver that implements the JDBC 4.0 API.
-You must check your driver documentation to be sure that it implements
-the particular features you want to use.
+
 
 <h2>Package Specification</h2>
 
 <ul>
-  <li><a href="https://jcp.org/en/jsr/detail?id=221">JDBC 4.2 Specification</a>
+  <li><a href="https://jcp.org/en/jsr/detail?id=221">JDBC 4.3 Specification</a>
 </ul>
 
 <h2>Related Documentation</h2>
diff --git a/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java
index dc35105..0d04674 100644
--- a/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java
+++ b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java
@@ -29,6 +29,7 @@
  * The XAException is thrown by the Resource Manager (RM) to inform the
  * Transaction Manager of an error encountered by the involved transaction.
  *
+ * @since 1.4
  */
 public class XAException extends Exception {
 
diff --git a/jdk/src/java.sql/share/classes/javax/transaction/xa/XAResource.java b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAResource.java
index 489818e..f8b26ff 100644
--- a/jdk/src/java.sql/share/classes/javax/transaction/xa/XAResource.java
+++ b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAResource.java
@@ -56,6 +56,7 @@
  * the transaction manager to prepare, commit, or rollback a transaction
  * according to the two-phase commit protocol.</p>
  *
+ * @since 1.4
  */
 public interface XAResource {
 
diff --git a/jdk/src/java.sql/share/classes/javax/transaction/xa/Xid.java b/jdk/src/java.sql/share/classes/javax/transaction/xa/Xid.java
index 829ae68..abd0723 100644
--- a/jdk/src/java.sql/share/classes/javax/transaction/xa/Xid.java
+++ b/jdk/src/java.sql/share/classes/javax/transaction/xa/Xid.java
@@ -32,6 +32,8 @@
  * and branch qualifier. The Xid interface is used by the transaction
  * manager and the resource managers. This interface is not visible to
  * the application programs.
+ *
+ * @since 1.4
  */
 public interface Xid {
 
diff --git a/jdk/src/java.sql/share/classes/module-info.java b/jdk/src/java.sql/share/classes/module-info.java
index 14491db..1e232ec 100644
--- a/jdk/src/java.sql/share/classes/module-info.java
+++ b/jdk/src/java.sql/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the JDBC API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.sql {
     requires transitive java.logging;
diff --git a/jdk/src/java.transaction/share/classes/module-info.java b/jdk/src/java.transaction/share/classes/module-info.java
index 4e24512..1a3a192 100644
--- a/jdk/src/java.transaction/share/classes/module-info.java
+++ b/jdk/src/java.transaction/share/classes/module-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,11 @@
  * <P>
  * The subset consists of RMI exception types which are mapped to CORBA system
  * exceptions by the 'Java Language to IDL Mapping Specification'.
+ *
+ * @moduleGraph
+ * @since 9
  */
+@Deprecated(since="9", forRemoval=true)
 module java.transaction {
     requires transitive java.rmi;
     exports javax.transaction;
diff --git a/jdk/src/java.xml.crypto/share/classes/module-info.java b/jdk/src/java.xml.crypto/share/classes/module-info.java
index 4bd55f9..4e7db6b 100644
--- a/jdk/src/java.xml.crypto/share/classes/module-info.java
+++ b/jdk/src/java.xml.crypto/share/classes/module-info.java
@@ -24,7 +24,10 @@
  */
 
 /**
- * Defines an API for XML cryptography.
+ * Defines the API for XML cryptography.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module java.xml.crypto {
     requires transitive java.xml;
diff --git a/jdk/src/java.xml.crypto/share/legal/santuario.md b/jdk/src/java.xml.crypto/share/legal/santuario.md
index 0d8be1b..4bd7321 100644
--- a/jdk/src/java.xml.crypto/share/legal/santuario.md
+++ b/jdk/src/java.xml.crypto/share/legal/santuario.md
@@ -1,6 +1,6 @@
 ## Apache Santuario v1.5.4
 
-### Notice
+### Apache Santuario Notice
 <pre>
 
   Apache Santuario - XML Security for Java
diff --git a/jdk/src/jdk.accessibility/share/classes/module-info.java b/jdk/src/jdk.accessibility/share/classes/module-info.java
index 5f0b63f..4df2da0 100644
--- a/jdk/src/jdk.accessibility/share/classes/module-info.java
+++ b/jdk/src/jdk.accessibility/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Defines JDK utility classes used by implementors of Assistive Technologies.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.accessibility {
     requires transitive java.desktop;
     exports com.sun.java.accessibility.util;
diff --git a/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java b/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
index 34a3e29..7f33016 100644
--- a/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
+++ b/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
@@ -4527,6 +4527,10 @@
     private void _getVisibleChildrenCount(final AccessibleContext ac) {
         if (ac == null)
             return;
+        if(ac instanceof AccessibleExtendedTable) {
+            _getVisibleChildrenCount((AccessibleExtendedTable)ac);
+            return;
+        }
         int numChildren = InvocationUtils.invokeAndWait(new Callable<Integer>() {
             @Override
             public Integer call() throws Exception {
@@ -4568,6 +4572,83 @@
         }
     }
 
+    /*
+    * Recursively descends AccessibleContext and gets the number
+    * of visible children. Stops search if get to invisible part of table.
+    */
+    private void _getVisibleChildrenCount(final AccessibleExtendedTable acTable) {
+        if (acTable == null)
+            return;
+        int lastVisibleRow = -1;
+        int lastVisibleColumn = -1;
+        boolean foundVisible = false;
+        int rowCount = InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                return acTable.getAccessibleRowCount();
+            }
+        }, acTable);
+        int columnCount = InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                return acTable.getAccessibleColumnCount();
+            }
+        }, acTable);
+        for (int rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+            for (int columnIdx = 0; columnIdx < columnCount; columnIdx++) {
+                if (lastVisibleRow != -1 && rowIdx > lastVisibleRow) {
+                    continue;
+                }
+                if (lastVisibleColumn != -1 && columnIdx > lastVisibleColumn) {
+                    continue;
+                }
+                int finalRowIdx = rowIdx;
+                int finalColumnIdx = columnIdx;
+                final AccessibleContext ac2 = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                    @Override
+                    public AccessibleContext call() throws Exception {
+                        Accessible a = acTable.getAccessibleAt(finalRowIdx, finalColumnIdx);
+                        if (a == null)
+                            return null;
+                        else
+                            return a.getAccessibleContext();
+                    }
+                }, acTable);
+                if (ac2 == null ||
+                        (!InvocationUtils.invokeAndWait(new Callable<Boolean>() {
+                            @Override
+                            public Boolean call() throws Exception {
+                                return ac2.getAccessibleStateSet().contains(AccessibleState.SHOWING);
+                            }
+                        }, acTable))
+                        ) {
+                    if (foundVisible) {
+                        if (columnIdx != 0 && lastVisibleColumn == -1) {
+                            //the same row, so we found the last visible column
+                            lastVisibleColumn = columnIdx - 1;
+                        } else if (columnIdx == 0 && lastVisibleRow == -1) {
+                            lastVisibleRow = rowIdx - 1;
+                        }
+                    }
+                    continue;
+                }
+
+                foundVisible = true;
+
+                _visibleChildrenCount++;
+
+                if (InvocationUtils.invokeAndWait(new Callable<Integer>() {
+                    @Override
+                    public Integer call() throws Exception {
+                        return ac2.getAccessibleChildrenCount();
+                    }
+                }, acTable) > 0) {
+                    _getVisibleChildrenCount(ac2);
+                }
+            }
+        }
+    }
+
     /**
      * Gets the visible child of an AccessibleContext at the
      * specified index
@@ -4604,7 +4685,10 @@
         if (_visibleChild != null) {
             return;
         }
-
+        if(ac instanceof AccessibleExtendedTable) {
+            _getVisibleChild((AccessibleExtendedTable)ac, index);
+            return;
+        }
         int numChildren = InvocationUtils.invokeAndWait(new Callable<Integer>() {
             @Override
             public Integer call() throws Exception {
@@ -4613,7 +4697,7 @@
         }, ac);
         for (int i = 0; i < numChildren; i++) {
             final int idx=i;
-            final AccessibleContext ac2=InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+            final AccessibleContext ac2 = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
                 @Override
                 public AccessibleContext call() throws Exception {
                     Accessible a = ac.getAccessibleChild(idx);
@@ -4650,6 +4734,82 @@
         }
     }
 
+    private void _getVisibleChild(final AccessibleExtendedTable acTable, final int index) {
+        if (_visibleChild != null) {
+            return;
+        }
+        int lastVisibleRow = -1;
+        int lastVisibleColumn = -1;
+        boolean foundVisible = false;
+        int rowCount = InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                return acTable.getAccessibleRowCount();
+            }
+        }, acTable);
+        int columnCount = InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                return acTable.getAccessibleColumnCount();
+            }
+        }, acTable);
+        for (int rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+            for (int columnIdx = 0; columnIdx < columnCount; columnIdx++) {
+                if (lastVisibleRow != -1 && rowIdx > lastVisibleRow) {
+                    continue;
+                }
+                if (lastVisibleColumn != -1 && columnIdx > lastVisibleColumn) {
+                    continue;
+                }
+                int finalRowIdx = rowIdx;
+                int finalColumnIdx = columnIdx;
+                final AccessibleContext ac2 = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                    @Override
+                    public AccessibleContext call() throws Exception {
+                        Accessible a = acTable.getAccessibleAt(finalRowIdx, finalColumnIdx);
+                        if (a == null)
+                            return null;
+                        else
+                            return a.getAccessibleContext();
+                    }
+                }, acTable);
+                if (ac2 == null ||
+                        (!InvocationUtils.invokeAndWait(new Callable<Boolean>() {
+                            @Override
+                            public Boolean call() throws Exception {
+                                return ac2.getAccessibleStateSet().contains(AccessibleState.SHOWING);
+                            }
+                        }, acTable))) {
+                    if (foundVisible) {
+                        if (columnIdx != 0 && lastVisibleColumn == -1) {
+                            //the same row, so we found the last visible column
+                            lastVisibleColumn = columnIdx - 1;
+                        } else if (columnIdx == 0 && lastVisibleRow == -1) {
+                            lastVisibleRow = rowIdx - 1;
+                        }
+                    }
+                    continue;
+                }
+                foundVisible = true;
+
+                if (!_foundVisibleChild && _currentVisibleIndex == index) {
+                    _visibleChild = ac2;
+                    _foundVisibleChild = true;
+                    return;
+                }
+                _currentVisibleIndex++;
+
+                if (InvocationUtils.invokeAndWait(new Callable<Integer>() {
+                    @Override
+                    public Integer call() throws Exception {
+                        return ac2.getAccessibleChildrenCount();
+                    }
+                }, acTable) > 0) {
+                    _getVisibleChild(ac2, index);
+                }
+            }
+        }
+    }
 
     /* ===== Java object memory management code ===== */
 
@@ -7019,6 +7179,25 @@
          * and waits for it to finish blocking the caller thread.
          *
          * @param callable   the {@code Callable} to invoke
+         * @param accessibleTable the {@code AccessibleExtendedTable} which would be used to find the right context
+         *                   for the task execution
+         * @param <T> type parameter for the result value
+         *
+         * @return the result of the {@code Callable} execution
+         */
+        public static <T> T invokeAndWait(final Callable<T> callable,
+                                          final AccessibleExtendedTable accessibleTable) {
+            if (accessibleTable instanceof AccessibleContext) {
+                return invokeAndWait(callable, (AccessibleContext)accessibleTable);
+            }
+            throw new RuntimeException("Unmapped AccessibleContext used to dispatch event: " + accessibleTable);
+        }
+
+        /**
+         * Invokes a {@code Callable} in the {@code AppContext} of the given {@code Accessible}
+         * and waits for it to finish blocking the caller thread.
+         *
+         * @param callable   the {@code Callable} to invoke
          * @param accessible the {@code Accessible} which would be used to find the right context
          *                   for the task execution
          * @param <T> type parameter for the result value
diff --git a/jdk/src/jdk.attach/share/classes/module-info.java b/jdk/src/jdk.attach/share/classes/module-info.java
index d87b339..29f0cd6 100644
--- a/jdk/src/jdk.attach/share/classes/module-info.java
+++ b/jdk/src/jdk.attach/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the attach API.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module jdk.attach {
     requires jdk.internal.jvmstat;
diff --git a/jdk/src/jdk.charsets/share/classes/module-info.java b/jdk/src/jdk.charsets/share/classes/module-info.java
index 6e8cfc3..8d40e57 100644
--- a/jdk/src/jdk.charsets/share/classes/module-info.java
+++ b/jdk/src/jdk.charsets/share/classes/module-info.java
@@ -23,6 +23,13 @@
  * questions.
  */
 
+/**
+ * {@link java.nio.charset.Charset Charset} provider for the charsets that
+ * are not in {@code java.base} (mostly double byte and IBM charsets).
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.charsets {
     provides java.nio.charset.spi.CharsetProvider
         with sun.nio.cs.ext.ExtendedCharsets;
diff --git a/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java b/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java
index 845ae00..82c2cde 100644
--- a/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java
+++ b/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * The SunPKCS11 security provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.crypto.cryptoki {
     // Depends on SunEC provider for EC related functionality
     requires jdk.crypto.ec;
diff --git a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java
index c630598..d269766 100644
--- a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java
+++ b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -241,6 +241,7 @@
             pc.setPassword(password);  // this clones the password if not null
         }
 
+        @SuppressWarnings("deprecation")
         protected void finalize() throws Throwable {
             if (password != null) {
                 Arrays.fill(password, ' ');
@@ -1022,7 +1023,7 @@
                                     ("trusted certificates may only be set by " +
                                     "token initialization application"));
             }
-            Module module = token.provider.nssModule;
+            Secmod.Module module = token.provider.nssModule;
             if ((module.type != ModuleType.KEYSTORE) && (module.type != ModuleType.FIPS)) {
                 // XXX allow TRUSTANCHOR module
                 throw new KeyStoreException("Trusted certificates can only be "
diff --git a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java
index a9b6de3..9e3ffe7 100644
--- a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java
+++ b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java
@@ -77,7 +77,7 @@
 
     final boolean removable;
 
-    final Module nssModule;
+    final Secmod.Module nssModule;
 
     final boolean nssUseSecmodTrust;
 
@@ -148,7 +148,7 @@
 
         boolean useSecmod = config.getNssUseSecmod();
         boolean nssUseSecmodTrust = config.getNssUseSecmodTrust();
-        Module nssModule = null;
+        Secmod.Module nssModule = null;
 
         //
         // Initialization via Secmod. The way this works is as follows:
@@ -217,7 +217,7 @@
                 // XXX which exception to throw
                 throw new ProviderException("Could not initialize NSS", e);
             }
-            List<Module> modules = secmod.getModules();
+            List<Secmod.Module> modules = secmod.getModules();
             if (config.getShowInfo()) {
                 System.out.println("NSS modules: " + modules);
             }
@@ -258,7 +258,7 @@
                             ("Invalid external module: " + moduleName);
                 }
                 int k = 0;
-                for (Module module : modules) {
+                for (Secmod.Module module : modules) {
                     if (module.getType() == ModuleType.EXTERNAL) {
                         if (++k == moduleIndex) {
                             nssModule = module;
diff --git a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java
index 0b3c7a0..554f4d5 100644
--- a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java
+++ b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  */
 
 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
@@ -1531,6 +1531,7 @@
      *
      * @exception Throwable If finalization fails.
      */
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         disconnect();
     }
diff --git a/jdk/src/jdk.crypto.cryptoki/share/legal/pkcs11cryptotoken.md b/jdk/src/jdk.crypto.cryptoki/share/legal/pkcs11cryptotoken.md
index 6f7e3fb..9f786fa 100644
--- a/jdk/src/jdk.crypto.cryptoki/share/legal/pkcs11cryptotoken.md
+++ b/jdk/src/jdk.crypto.cryptoki/share/legal/pkcs11cryptotoken.md
@@ -1,4 +1,4 @@
-## PKCS #11 Cryptographic Token Interface, v2.20 amendment 3 Header Files
+## PKCS #11 Cryptographic Token Interface v2.20 Amendment 3 Header Files
 
 ### PKCS #11 Cryptographic Token Interface License
 <pre>
diff --git a/jdk/src/jdk.crypto.ec/share/classes/module-info.java b/jdk/src/jdk.crypto.ec/share/classes/module-info.java
index 227882d..54f22b6 100644
--- a/jdk/src/jdk.crypto.ec/share/classes/module-info.java
+++ b/jdk/src/jdk.crypto.ec/share/classes/module-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * The SunEC security provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.crypto.ec {
     provides java.security.Provider with sun.security.ec.SunEC;
 }
diff --git a/jdk/src/jdk.crypto.ec/share/legal/ecc.md b/jdk/src/jdk.crypto.ec/share/legal/ecc.md
index 6d4fc59..300b7d4 100644
--- a/jdk/src/jdk.crypto.ec/share/legal/ecc.md
+++ b/jdk/src/jdk.crypto.ec/share/legal/ecc.md
@@ -1,12 +1,13 @@
-## Mozilla Elliptic Curve Cryptography
+## Mozilla Elliptic Curve Cryptography (ECC)
 
-### Notice
+### Mozilla ECC Notice
 <pre>
 
 This notice is provided with respect to Elliptic Curve Cryptography,
 which is included with JRE, JDK, and OpenJDK.
 
-You are receiving a copy of the Elliptic Curve Cryptography library in source
+You are receiving a [copy](http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.crypto.ec/share/native/libsunec/impl)
+of the Elliptic Curve Cryptography library in source
 form with the JDK and OpenJDK source distributions, and as object code in
 the JRE & JDK runtimes.
 
@@ -21,7 +22,7 @@
 
 </pre>
 
-### LGPL 2.1 License
+### LGPL 2.1
 <pre>
 
                   GNU LESSER GENERAL PUBLIC LICENSE
diff --git a/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java b/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java
index 9a2801e..0121f61 100644
--- a/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java
+++ b/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * The SunMSCAPI security provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.crypto.mscapi {
     provides java.security.Provider with sun.security.mscapi.SunMSCAPI;
 }
diff --git a/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/Key.java b/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/Key.java
index 8154c48..a36656f 100644
--- a/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/Key.java
+++ b/jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/Key.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,7 @@
         /**
          * Finalization method
          */
+        @SuppressWarnings("deprecation")
         protected void finalize() throws Throwable
         {
             try {
diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java
index 161c6fe..3d96987 100644
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * The OracleUCrypto security provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.crypto.ucrypto {
     provides java.security.Provider with com.oracle.security.ucrypto.UcryptoProvider;
 }
diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg b/jdk/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg
index 5ccefad..cba2ffc 100644
--- a/jdk/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/conf/security/ucrypto-solaris.cfg
@@ -2,8 +2,5 @@
 # Configuration file for the OracleUcrypto provider
 #
 disabledServices = {
-  # disabled due to Solaris bug 7121679
-  Cipher.AES/CFB128/PKCS5Padding
-  Cipher.AES/CFB128/NoPadding
 }
 
diff --git a/jdk/src/jdk.desktop/share/classes/jdk/awt/AWTUtils.java b/jdk/src/jdk.desktop/share/classes/jdk/awt/AWTUtils.java
deleted file mode 100644
index 93b493e..0000000
--- a/jdk/src/jdk.desktop/share/classes/jdk/awt/AWTUtils.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.awt;
-
-import java.awt.Component;
-import java.awt.Shape;
-
-import com.sun.awt.AWTUtilities;
-
-/**
- * A class to allow access to JDK-specific utility methods.
- * Methods in this class are always deprecated since a caller
- * should be aware they may be removed and replaced in the future.
- * Access using reflection is highly recommended.
- * @since 9
- */
-public final class AWTUtils {
-
-    /**
-     * No-one should be creating instances of this class.
-     */
-    private AWTUtils() {
-    }
-
-    /**
-     * Sets a 'mixing-cutout' shape for the given component.
-     *
-     * By default a lightweight component is treated as an opaque rectangle for
-     * the purposes of the Heavyweight/Lightweight Components Mixing feature.
-     * This method enables developers to set an arbitrary shape to be cut out
-     * from heavyweight components positioned underneath the lightweight
-     * component in the z-order.
-     * <p>
-     * The {@code shape} argument may have the following values:
-     * <ul>
-     * <li>{@code null} - reverts the default cutout shape (the rectangle equal
-     * to the component's {@code getBounds()})
-     * <li><i>empty-shape</i> - does not cut out anything from heavyweight
-     * components. This makes the given lightweight component effectively
-     * transparent. Note that descendants of the lightweight component still
-     * affect the shapes of heavyweight components.  An example of an
-     * <i>empty-shape</i> is {@code new Rectangle()}.
-     * <li><i>non-empty-shape</i> - the given shape will be cut out from
-     * heavyweight components.
-     * </ul>
-     * <p>
-     * The most common example when the 'mixing-cutout' shape is needed is a
-     * glass pane component. The {@link JRootPane#setGlassPane()} method
-     * automatically sets the <i>empty-shape</i> as the 'mixing-cutout' shape
-     * for the given glass pane component.  If a developer needs some other
-     * 'mixing-cutout' shape for the glass pane (which is rare), this must be
-     * changed manually after installing the glass pane to the root pane.
-     * <p>
-     * Note that the 'mixing-cutout' shape neither affects painting, nor the
-     * mouse events handling for the given component. It is used exclusively
-     * for the purposes of the Heavyweight/Lightweight Components Mixing
-     * feature.
-     *
-     * @param component the component that needs non-default
-     * 'mixing-cutout' shape
-     * @param shape the new 'mixing-cutout' shape
-     * @throws NullPointerException if the component argument is {@code null}
-     * @deprecated This API may be removed or replaced.
-     */
-    @Deprecated
-    @SuppressWarnings("deprecation")
-    public static void setComponentMixingCutoutShape(Component component,
-                                                     Shape shape) {
-
-        AWTUtilities.setComponentMixingCutoutShape(component, shape);
-    }
-}
diff --git a/jdk/src/jdk.desktop/share/classes/module-info.java b/jdk/src/jdk.desktop/share/classes/module-info.java
deleted file mode 100644
index 2aac00d..0000000
--- a/jdk/src/jdk.desktop/share/classes/module-info.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Provides non-SE desktop APIs.
- */
-
-module jdk.desktop {
-    requires transitive java.desktop;
-
-    exports jdk.awt;
-}
diff --git a/jdk/src/jdk.editpad/share/classes/module-info.java b/jdk/src/jdk.editpad/share/classes/module-info.java
index ddf4bee..57077ed 100644
--- a/jdk/src/jdk.editpad/share/classes/module-info.java
+++ b/jdk/src/jdk.editpad/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Implementation of the edit pad service.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module jdk.editpad {
     requires jdk.internal.ed;
diff --git a/jdk/src/jdk.httpserver/share/classes/module-info.java b/jdk/src/jdk.httpserver/share/classes/module-info.java
index b01a387..e6c7173 100644
--- a/jdk/src/jdk.httpserver/share/classes/module-info.java
+++ b/jdk/src/jdk.httpserver/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Defines the JDK-specific API for HTTP server.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.httpserver {
 
     exports com.sun.net.httpserver;
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLDelegate.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLDelegate.java
index 2ee7864..d8f98ad 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLDelegate.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AsyncSSLDelegate.java
@@ -609,11 +609,13 @@
         }
 
         // SSLParameters.getApplicationProtocols() can't return null
+        // JDK 8 EXCL START
         for (String approto : p.getApplicationProtocols()) {
             sb.append("\n    application protocol: {")
               .append(params.size()).append("}");
             params.add(approto);
         }
+        // JDK 8 EXCL END
 
         if (p.getProtocols() != null) {
             for (String protocol : p.getProtocols()) {
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/DefaultPublisher.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/DefaultPublisher.java
index 7d8d896..ea0137b 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/DefaultPublisher.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/DefaultPublisher.java
@@ -91,11 +91,13 @@
                         for (long i = 0; i < nbItemsDemanded && !done.get(); i++) {
                             try {
                                 Optional<T> item = Objects.requireNonNull(supplier.get());
-                                item.ifPresentOrElse(subscriber::onNext, () -> {
+                                if (item.isPresent()) {
+                                    subscriber.onNext(item.get());
+                                } else {
                                     if (done.compareAndSet(false, true)) {
                                         subscriber.onComplete();
                                     }
-                                });
+                                }
                             } catch (RuntimeException e) {
                                 if (done.compareAndSet(false, true)) {
                                     subscriber.onError(e);
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java
index 8dbeed6..5e0886f 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,8 @@
 package jdk.incubator.http;
 
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.net.InetSocketAddress;
-import java.net.Proxy;
 import java.net.ProxySelector;
 import java.net.SocketPermission;
 import java.net.URI;
@@ -65,13 +65,15 @@
     final HttpRequestImpl request;
     final HttpClientImpl client;
     volatile ExchangeImpl<T> exchImpl;
+    // used to record possible cancellation raised before the exchImpl
+    // has been established.
+    private volatile IOException failed;
     final List<SocketPermission> permissions = new LinkedList<>();
     final AccessControlContext acc;
     final MultiExchange<?,T> multi;
     final Executor parentExecutor;
     final HttpRequest.BodyProcessor requestProcessor;
     boolean upgrading; // to HTTP/2
-    volatile Executor responseExecutor;
     final PushGroup<?,T> pushGroup;
 
     // buffer for receiving response headers
@@ -135,22 +137,90 @@
     }
 
     public T readBody(HttpResponse.BodyHandler<T> responseHandler) throws IOException {
-        return exchImpl.readBody(responseHandler, true);
+        // The connection will not be returned to the pool in the case of WebSocket
+        return exchImpl.readBody(responseHandler, !request.isWebSocket());
     }
 
     public CompletableFuture<T> readBodyAsync(HttpResponse.BodyHandler<T> handler) {
-        return exchImpl.readBodyAsync(handler, true, responseExecutor);
+        // The connection will not be returned to the pool in the case of WebSocket
+        return exchImpl.readBodyAsync(handler, !request.isWebSocket(), parentExecutor);
     }
 
     public void cancel() {
+        // cancel can be called concurrently before or at the same time
+        // that the exchange impl is being established.
+        // In that case we won't be able to propagate the cancellation
+        // right away
         if (exchImpl != null) {
             exchImpl.cancel();
+        } else {
+            // no impl - can't cancel impl yet.
+            // call cancel(IOException) instead which takes care
+            // of race conditions between impl/cancel.
+            cancel(new IOException("Request cancelled"));
         }
     }
 
     public void cancel(IOException cause) {
-        if (exchImpl != null) {
-            exchImpl.cancel(cause);
+        // If the impl is non null, propagate the exception right away.
+        // Otherwise record it so that it can be propagated once the
+        // exchange impl has been established.
+        ExchangeImpl<?> impl = exchImpl;
+        if (impl != null) {
+            // propagate the exception to the impl
+            impl.cancel(cause);
+        } else {
+            try {
+                // no impl yet. record the exception
+                failed = cause;
+                // now call checkCancelled to recheck the impl.
+                // if the failed state is set and the impl is not null, reset
+                // the failed state and propagate the exception to the impl.
+                checkCancelled(false);
+            } catch (IOException x) {
+                // should not happen - we passed 'false' above
+                throw new UncheckedIOException(x);
+            }
+        }
+    }
+
+    // This method will raise an exception if one was reported and if
+    // it is possible to do so. If the exception can be raised, then
+    // the failed state will be reset. Otherwise, the failed state
+    // will persist until the exception can be raised and the failed state
+    // can be cleared.
+    // Takes care of possible race conditions.
+    private void checkCancelled(boolean throwIfNoImpl) throws IOException {
+        ExchangeImpl<?> impl = null;
+        IOException cause = null;
+        if (failed != null) {
+            synchronized(this) {
+                cause = failed;
+                impl = exchImpl;
+                if (throwIfNoImpl || impl != null) {
+                    // The exception will be raised by one of the two methods
+                    // below: reset the failed state.
+                    failed = null;
+                }
+            }
+        }
+        if (cause == null) return;
+        if (impl != null) {
+            // The exception is raised by propagating it to the impl.
+            impl.cancel(cause);
+        } else if (throwIfNoImpl) {
+            // The exception is raised by throwing it immediately
+            throw cause;
+        } else {
+            Log.logTrace("Exchange: request [{0}/timeout={1}ms] no impl is set."
+                         + "\n\tCan''t cancel yet with {2}",
+                         request.uri(),
+                         request.duration() == null ? -1 :
+                         // calling duration.toMillis() can throw an exception.
+                         // this is just debugging, we don't care if it overflows.
+                         (request.duration().getSeconds() * 1000
+                          + request.duration().getNano() / 1000000),
+                         cause);
         }
     }
 
@@ -191,10 +261,26 @@
         }
     }
 
+    // get/set the exchange impl, solving race condition issues with
+    // potential concurrent calls to cancel() or cancel(IOException)
+    private void establishExchange(HttpConnection connection)
+        throws IOException, InterruptedException
+    {
+        // check if we have been cancelled first.
+        checkCancelled(true);
+        // not yet cancelled: create/get a new impl
+        exchImpl = ExchangeImpl.get(this, connection);
+        // recheck for cancelled, in case of race conditions
+        checkCancelled(true);
+        // now we're good to go. because exchImpl is no longer null
+        // cancel() will be able to propagate directly to the impl
+        // after this point.
+    }
+
     private Response responseImpl0(HttpConnection connection)
         throws IOException, InterruptedException
     {
-        exchImpl = ExchangeImpl.get(this, connection);
+        establishExchange(connection);
         exchImpl.setClientForRequest(requestProcessor);
         if (request.expectContinue()) {
             Log.logTrace("Sending Expect: 100-Continue");
@@ -224,7 +310,8 @@
 
             return checkForUpgrade(resp, exchImpl);
         } else {
-            exchImpl.sendRequest();
+            exchImpl.sendHeadersOnly();
+            exchImpl.sendBody();
             Response resp = exchImpl.getResponse();
             HttpResponseImpl.logResponse(resp);
             return checkForUpgrade(resp, exchImpl);
@@ -235,8 +322,6 @@
     // will be a non null responseAsync if expect continue returns an error
 
     public CompletableFuture<Response> responseAsync() {
-        // take one thread from supplied executor to handle response headers and body
-        responseExecutor = Utils.singleThreadExecutor(parentExecutor);
         return responseAsyncImpl(null);
     }
 
@@ -258,7 +343,7 @@
 
     CompletableFuture<Response> responseAsyncImpl0(HttpConnection connection) {
         try {
-            exchImpl = ExchangeImpl.get(this, connection);
+            establishExchange(connection);
         } catch (IOException | InterruptedException e) {
             return MinimalFuture.failedFuture(e);
         }
@@ -267,20 +352,18 @@
             Log.logTrace("Sending Expect: 100-Continue");
             return exchImpl
                     .sendHeadersAsync()
-                    .thenCompose((v) -> exchImpl.getResponseAsync(responseExecutor))
+                    .thenCompose(v -> exchImpl.getResponseAsync(parentExecutor))
                     .thenCompose((Response r1) -> {
                         HttpResponseImpl.logResponse(r1);
                         int rcode = r1.statusCode();
                         if (rcode == 100) {
                             Log.logTrace("Received 100-Continue: sending body");
-                            return exchImpl.sendBodyAsync(parentExecutor)
-                                .thenCompose((v) -> exchImpl.getResponseAsync(responseExecutor))
-                                .thenCompose((Response r2) -> {
-                                    return checkForUpgradeAsync(r2, exchImpl);
-                                }).thenApply((Response r) -> {
-                                    HttpResponseImpl.logResponse(r);
-                                    return r;
-                                });
+                            CompletableFuture<Response> cf =
+                                    exchImpl.sendBodyAsync()
+                                            .thenCompose(exIm -> exIm.getResponseAsync(parentExecutor));
+                            cf = wrapForUpgrade(cf);
+                            cf = wrapForLog(cf);
+                            return cf;
                         } else {
                             Log.logTrace("Expectation failed: Received {0}",
                                          rcode);
@@ -289,26 +372,38 @@
                                         "Unable to handle 101 while waiting for 100");
                                 return MinimalFuture.failedFuture(failed);
                             }
-                            return exchImpl.readBodyAsync(this::ignoreBody, false, responseExecutor)
-                                  .thenApply((v) -> {
-                                      return r1;
-                                  });
+                            return exchImpl.readBodyAsync(this::ignoreBody, false, parentExecutor)
+                                  .thenApply(v ->  r1);
                         }
                     });
         } else {
-            return exchImpl
-                .sendRequestAsync(parentExecutor)
-                .thenCompose((v) -> exchImpl.getResponseAsync(responseExecutor))
-                .thenCompose((Response r1) -> {
-                    return checkForUpgradeAsync(r1, exchImpl);
-                })
-                .thenApply((Response response) -> {
-                    HttpResponseImpl.logResponse(response);
-                    return response;
-                });
+            CompletableFuture<Response> cf = exchImpl
+                    .sendHeadersAsync()
+                    .thenCompose(ExchangeImpl::sendBodyAsync)
+                    .thenCompose(exIm -> exIm.getResponseAsync(parentExecutor));
+            cf = wrapForUpgrade(cf);
+            cf = wrapForLog(cf);
+            return cf;
         }
     }
 
+    private CompletableFuture<Response> wrapForUpgrade(CompletableFuture<Response> cf) {
+        if (upgrading) {
+            return cf.thenCompose(r -> checkForUpgradeAsync(r, exchImpl));
+        }
+        return cf;
+    }
+
+    private CompletableFuture<Response> wrapForLog(CompletableFuture<Response> cf) {
+        if (Log.requests()) {
+            return cf.thenApply(response -> {
+                HttpResponseImpl.logResponse(response);
+                return response;
+            });
+        }
+        return cf;
+    }
+
     HttpResponse.BodyProcessor<T> ignoreBody(int status, HttpHeaders hdrs) {
         return HttpResponse.BodyProcessor.discard((T)null);
     }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ExchangeImpl.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ExchangeImpl.java
index 0ddcf08..04e29b2 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ExchangeImpl.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ExchangeImpl.java
@@ -102,16 +102,12 @@
 
     // Blocking impl but in async style
 
-    CompletableFuture<Void> sendHeadersAsync() {
-        CompletableFuture<Void> cf = new MinimalFuture<>();
-        try {
-            sendHeadersOnly();
-            cf.complete(null);
-        } catch (Throwable t) {
-            cf.completeExceptionally(t);
-        }
+    CompletableFuture<ExchangeImpl<T>> sendHeadersAsync() {
         // this is blocking. cf will already be completed.
-        return cf;
+        return MinimalFuture.supply(() -> {
+            sendHeadersOnly();
+            return this;
+        });
     }
 
     /**
@@ -121,11 +117,11 @@
      */
     abstract Response getResponse() throws IOException;
 
-    abstract T readBody(HttpResponse.BodyHandler<T> handler, boolean returnToCache)
-            throws IOException;
+    abstract T readBody(HttpResponse.BodyHandler<T> handler,
+                        boolean returnConnectionToPool) throws IOException;
 
     abstract CompletableFuture<T> readBodyAsync(HttpResponse.BodyHandler<T> handler,
-                                                boolean returnToCache,
+                                                boolean returnConnectionToPool,
                                                 Executor executor);
 
     // Builtin processors need access to HttpClientImpl
@@ -156,40 +152,14 @@
 
     // Async version of sendBody(). This only used when body sent separately
     // to headers (100 continue)
-    CompletableFuture<Void> sendBodyAsync(Executor executor) {
-        CompletableFuture<Void> cf = new MinimalFuture<>();
-        executor.execute(() -> {
-            try {
-                sendBody();
-                cf.complete(null);
-            } catch (Throwable t) {
-                cf.completeExceptionally(t);
-            }
+    CompletableFuture<ExchangeImpl<T>> sendBodyAsync() {
+        return MinimalFuture.supply(() -> {
+            sendBody();
+            return this;
         });
-        return cf;
     }
 
     /**
-     * Sends the entire request (headers and body) blocking.
-     */
-    void sendRequest() throws IOException, InterruptedException {
-        sendHeadersOnly();
-        sendBody();
-    }
-
-    CompletableFuture<Void> sendRequestAsync(Executor executor) {
-        CompletableFuture<Void> cf = new MinimalFuture<>();
-        executor.execute(() -> {
-            try {
-                sendRequest();
-                cf.complete(null);
-            } catch (Throwable t) {
-                cf.completeExceptionally(t);
-            }
-        });
-        return cf;
-    }
-    /**
      * Cancels a request.  Not currently exposed through API.
      */
     abstract void cancel();
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Exchange.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Exchange.java
index 4e48989..a1c20b3 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Exchange.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Exchange.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,9 +46,12 @@
 class Http1Exchange<T> extends ExchangeImpl<T> {
 
     final HttpRequestImpl request;        // main request
-    final List<CompletableFuture<?>> operations; // used for cancel
+    private final List<CompletableFuture<?>> operations; // used for cancel
     final Http1Request requestAction;
-    volatile Http1Response<T> response;
+    private volatile Http1Response<T> response;
+    // use to record possible cancellation raised before any operation
+    // has been initiated.
+    private IOException failed;
     final HttpConnection connection;
     final HttpClientImpl client;
     final Executor executor;
@@ -70,7 +73,7 @@
         this.request = exchange.request();
         this.client = exchange.client();
         this.executor = exchange.executor();
-        this.operations = Collections.synchronizedList(new LinkedList<>());
+        this.operations = new LinkedList<>();
         this.buffer = exchange.getBuffer();
         if (connection != null) {
             this.connection = connection;
@@ -88,14 +91,14 @@
 
 
     @Override
-    T readBody(BodyHandler<T> handler, boolean returnToCache)
+    T readBody(BodyHandler<T> handler, boolean returnConnectionToPool)
         throws IOException
     {
         BodyProcessor<T> processor = handler.apply(response.responseCode(),
                                                    response.responseHeaders());
         setClientForResponse(processor);
         CompletableFuture<T> bodyCF = response.readBody(processor,
-                                                        returnToCache,
+                                                        returnConnectionToPool,
                                                         this::executeInline);
         try {
             return bodyCF.join();
@@ -114,14 +117,14 @@
 
     @Override
     CompletableFuture<T> readBodyAsync(BodyHandler<T> handler,
-                                       boolean returnToCache,
+                                       boolean returnConnectionToPool,
                                        Executor executor)
     {
         BodyProcessor<T> processor = handler.apply(response.responseCode(),
                                                    response.responseHeaders());
         setClientForResponse(processor);
         CompletableFuture<T> bodyCF = response.readBody(processor,
-                                                        returnToCache,
+                                                        returnConnectionToPool,
                                                         executor);
         return bodyCF;
     }
@@ -186,25 +189,32 @@
         }
         connection.close();
         int count = 0;
-        for (CompletableFuture<?> cf : operations) {
-            cf.completeExceptionally(cause);
-            count++;
+        if (operations.isEmpty()) {
+            failed = cause;
+            Log.logTrace("Http1Exchange: request [{0}/timeout={1}ms] no pending operation."
+                         + "\n\tCan''t cancel yet with {2}",
+                         request.uri(),
+                         request.duration() == null ? -1 :
+                         // calling duration.toMillis() can throw an exception.
+                         // this is just debugging, we don't care if it overflows.
+                         (request.duration().getSeconds() * 1000
+                          + request.duration().getNano() / 1000000),
+                         cause);
+        } else {
+            for (CompletableFuture<?> cf : operations) {
+                cf.completeExceptionally(cause);
+                count++;
+            }
         }
         Log.logError("Http1Exchange.cancel: count=" + count);
     }
 
     CompletableFuture<Response> getResponseAsyncImpl(Executor executor) {
-        CompletableFuture<Response> cf = new MinimalFuture<>();
-        executor.execute(() -> {
-            try {
-                response = new Http1Response<>(connection, Http1Exchange.this);
-                response.readHeaders();
-                cf.complete(response.response());
-            } catch (Throwable e) {
-                cf.completeExceptionally(e);
-            }
-        });
-        return cf;
+        return MinimalFuture.supply( () -> {
+            response = new Http1Response<>(connection, Http1Exchange.this);
+            response.readHeaders();
+            return response.response();
+        }, executor);
     }
 
     @Override
@@ -212,8 +222,24 @@
         CompletableFuture<Response> cf =
             connection.whenReceivingResponse()
                       .thenCompose((v) -> getResponseAsyncImpl(executor));
-
-        operations.add(cf);
+        IOException cause;
+        synchronized(this) {
+            operations.add(cf);
+            cause = failed;
+            failed = null;
+        }
+        if (cause != null) {
+            Log.logTrace("Http1Exchange: request [{0}/timeout={1}ms]"
+                         + "\n\tCompleting exceptionally with {2}\n",
+                         request.uri(),
+                         request.duration() == null ? -1 :
+                         // calling duration.toMillis() can throw an exception.
+                         // this is just debugging, we don't care if it overflows.
+                         (request.duration().getSeconds() * 1000
+                          + request.duration().getNano() / 1000000),
+                         cause);
+            cf.completeExceptionally(cause);
+        }
         return cf;
     }
 }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Response.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Response.java
index a5958fd..ea36bb7 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Response.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Response.java
@@ -164,6 +164,7 @@
 
     private void onFinished() {
         if (return2Cache) {
+            Log.logTrace("Returning connection to the pool: {0}", connection);
             connection.returnToCache(headers);
         }
     }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java
index d68436cc..40826d5 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java
@@ -241,14 +241,7 @@
                                                           Http2ClientImpl client2,
                                                           Exchange<?> exchange,
                                                           ByteBuffer initial) {
-        CompletableFuture<Http2Connection> cf = new MinimalFuture<>();
-        try {
-            Http2Connection c = new Http2Connection(connection, client2, exchange, initial);
-            cf.complete(c);
-        } catch (IOException | InterruptedException e) {
-            cf.completeExceptionally(e);
-        }
-        return cf;
+        return MinimalFuture.supply(() -> new Http2Connection(connection, client2, exchange, initial));
     }
 
     /**
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java
index 4d9a8ef..7959bb6 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -235,7 +235,7 @@
     sendAsync(HttpRequest req, HttpResponse.BodyHandler<T> responseHandler)
     {
         MultiExchange<Void,T> mex = new MultiExchange<>(req, this, responseHandler);
-        return mex.responseAsync(null)
+        return mex.responseAsync()
                   .thenApply((HttpResponseImpl<T> b) -> (HttpResponse<T>) b);
     }
 
@@ -582,12 +582,14 @@
     // Timers are implemented through timed Selector.select() calls.
 
     synchronized void registerTimer(TimeoutEvent event) {
+        Log.logTrace("Registering timer {0}", event);
         timeouts.add(event);
         selmgr.wakeupSelector();
     }
 
     synchronized void cancelTimer(TimeoutEvent event) {
-        timeouts.stream().filter(e -> e == event).forEach(timeouts::remove);
+        Log.logTrace("Canceling timer {0}", event);
+        timeouts.remove(event);
     }
 
     /**
@@ -595,23 +597,61 @@
      * returns the amount of time, in milliseconds, until the next earliest
      * event. A return value of 0 means that there are no events.
      */
-    private synchronized long purgeTimeoutsAndReturnNextDeadline() {
-        if (timeouts.isEmpty())
-            return 0L;
+    private long purgeTimeoutsAndReturnNextDeadline() {
+        long diff = 0L;
+        List<TimeoutEvent> toHandle = null;
+        int remaining = 0;
+        // enter critical section to retrieve the timeout event to handle
+        synchronized(this) {
+            if (timeouts.isEmpty()) return 0L;
 
-        Instant now = Instant.now();
-        Iterator<TimeoutEvent> itr = timeouts.iterator();
-        while (itr.hasNext()) {
-            TimeoutEvent event = itr.next();
-            long diff = now.until(event.deadline(), ChronoUnit.MILLIS);
-            if (diff <= 0) {
-                itr.remove();
-                event.handle();  // TODO: release lock.
-            } else {
-                return diff;
+            Instant now = Instant.now();
+            Iterator<TimeoutEvent> itr = timeouts.iterator();
+            while (itr.hasNext()) {
+                TimeoutEvent event = itr.next();
+                diff = now.until(event.deadline(), ChronoUnit.MILLIS);
+                if (diff <= 0) {
+                    itr.remove();
+                    toHandle = (toHandle == null) ? new ArrayList<>() : toHandle;
+                    toHandle.add(event);
+                } else {
+                    break;
+                }
             }
+            remaining = timeouts.size();
         }
-        return 0L;
+
+        // can be useful for debugging
+        if (toHandle != null && Log.trace()) {
+            Log.logTrace("purgeTimeoutsAndReturnNextDeadline: handling "
+                    + (toHandle == null ? 0 : toHandle.size()) + " events, "
+                    + "remaining " + remaining
+                    + ", next deadline: " + (diff < 0 ? 0L : diff));
+        }
+
+        // handle timeout events out of critical section
+        if (toHandle != null) {
+            Throwable failed = null;
+            for (TimeoutEvent event : toHandle) {
+                try {
+                   Log.logTrace("Firing timer {0}", event);
+                   event.handle();
+                } catch (Error | RuntimeException e) {
+                    // Not expected. Handle remaining events then throw...
+                    // If e is an OOME or SOE it might simply trigger a new
+                    // error from here - but in this case there's not much we
+                    // could do anyway. Just let it flow...
+                    if (failed == null) failed = e;
+                    else failed.addSuppressed(e);
+                    Log.logTrace("Failed to handle event {0}: {1}", event, e);
+                }
+            }
+            if (failed instanceof Error) throw (Error) failed;
+            if (failed instanceof RuntimeException) throw (RuntimeException) failed;
+        }
+
+        // return time to wait until next event. 0L if there's no more events.
+        return diff < 0 ? 0L : diff;
     }
 
     // used for the connection window
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java
index ed1307f..db260ff 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java
@@ -115,7 +115,7 @@
     }
 
     /* Returns either a plain HTTP connection or a plain tunnelling connection
-     * for proxied websockets */
+     * for proxied WebSocket */
     private static HttpConnection getPlainConnection(InetSocketAddress addr,
                                                      InetSocketAddress proxy,
                                                      HttpRequestImpl request,
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpRequestImpl.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpRequestImpl.java
index 4285c25..c1d93da 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpRequestImpl.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpRequestImpl.java
@@ -81,6 +81,7 @@
         this.userHeaders = request.headers();
         if (request instanceof HttpRequestImpl) {
             this.systemHeaders = ((HttpRequestImpl) request).systemHeaders;
+            this.isWebSocket = ((HttpRequestImpl) request).isWebSocket;
         } else {
             this.systemHeaders = new HttpHeadersImpl();
         }
@@ -102,6 +103,7 @@
                            HttpRequestImpl other) {
         this.method = method == null? "GET" : method;
         this.userHeaders = other.userHeaders;
+        this.isWebSocket = other.isWebSocket;
         this.systemHeaders = other.systemHeaders;
         this.uri = uri;
         this.expectContinue = other.expectContinue;
@@ -115,6 +117,9 @@
     /* used for creating CONNECT requests  */
     HttpRequestImpl(String method, HttpClientImpl client,
                     InetSocketAddress authority) {
+        // TODO: isWebSocket flag is not specified, but the assumption is that
+        // such a request will never be made on a connection that will be returned
+        // to the connection pool (we might need to revisit this constructor later)
         this.method = method;
         this.systemHeaders = new HttpHeadersImpl();
         this.userHeaders = ImmutableHeaders.empty();
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpResponse.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpResponse.java
index e11d2d4..427b70a 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpResponse.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpResponse.java
@@ -30,6 +30,8 @@
 import java.net.URI;
 import jdk.incubator.http.ResponseProcessors.MultiFile;
 import jdk.incubator.http.ResponseProcessors.MultiProcessorImpl;
+import static jdk.incubator.http.internal.common.Utils.unchecked;
+import static jdk.incubator.http.internal.common.Utils.charsetFrom;
 import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
@@ -269,19 +271,6 @@
             };
         }
 
-        /**
-         * Get the Charset from the Content-encoding header. Defaults to
-         * UTF_8
-         */
-        private static Charset charsetFrom(HttpHeaders headers) {
-            String encoding = headers.firstValue("Content-encoding")
-                    .orElse("UTF_8");
-            try {
-                return Charset.forName(encoding);
-            } catch (IllegalArgumentException e) {
-                return StandardCharsets.UTF_8;
-            }
-        }
 
         /**
          * Returns a {@code BodyHandler<Path>} that returns a
@@ -342,10 +331,6 @@
             };
         }
 
-        private static UncheckedIOException unchecked(IOException e) {
-            return new UncheckedIOException(e);
-        }
-
         /**
          * Returns a {@code BodyHandler<Path>} that returns a
          * {@link BodyProcessor BodyProcessor}{@code <Path>} obtained from
@@ -743,48 +728,5 @@
             return asMap(pushHandler, true);
         }
 
-        /**
-         * Returns a {@code MultiProcessor} which writes the response bodies to
-         * files under a given root directory and which returns an aggregate
-         * response map that is a {@code Map<HttpRequest, HttpResponse<Path>>}.
-         * The keyset of the {@code Map} represents the original request and any
-         * additional requests generated by the server. The values are the
-         * responses containing the paths of the destination files. Each file
-         * uses the URI path of the request relative to the destination parent
-         * directorycprovided.
-         *
-         * <p>
-         * All incoming additional requests (push promises) are accepted by this
-         * multi response processor. Errors are effectively ignored and any
-         * failed responses are simply omitted from the result {@code Map}.
-         * Other implementations of {@code MultiProcessor} may handle these
-         * situations.
-         *
-         * <p>
-         * <b>Example usage</b>
-         * <pre>
-         * {@code
-         *    HttpClient client = ..
-         *    HttpRequest request = HttpRequest
-         *               .create(new URI("https://www.foo.com/"))
-         *               .version(Version.HTTP2)
-         *               .GET();
-         *
-         *    Map<HttpRequest, HttpResponse<Path>>> map = client
-         *               .sendAsync(HttpResponse.MultiProcessor.multiFile("/usr/destination"))
-         *               .join();
-         *
-         * }
-         * </pre>
-         * TEMPORARILY REMOVING THIS FROM API. MIGHT NOT BE NEEDED.
-         *
-         * @param destination the destination parent directory of all response
-         * bodies
-         * @return a MultiProcessor
-         */
-        private static MultiProcessor<MultiMapResult<Path>,Path> multiFile(Path destination) {
-            MultiFile mf = new MultiFile(destination);
-            return new MultiProcessorImpl<Path>(mf::handlePush, true);
-        }
     }
 }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java
index 4c55c50..4d7a2b3 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
 import java.util.concurrent.ExecutionException;
 import java.util.function.BiFunction;
 import java.util.concurrent.Executor;
+import java.util.function.UnaryOperator;
+
 import jdk.incubator.http.internal.common.Log;
 import jdk.incubator.http.internal.common.MinimalFuture;
 import jdk.incubator.http.internal.common.Pair;
@@ -150,8 +152,7 @@
                 Exchange<T> currExchange = getExchange();
                 requestFilters(r);
                 Response response = currExchange.response();
-                Pair<Response, HttpRequestImpl> filterResult = responseFilters(response);
-                HttpRequestImpl newreq = filterResult.second;
+                HttpRequestImpl newreq = responseFilters(response);
                 if (newreq == null) {
                     if (attempts > 1) {
                         Log.logError("Succeeded on attempt: " + attempts);
@@ -213,23 +214,7 @@
         Log.logTrace("All filters applied");
     }
 
-    // Filters are assumed to be non-blocking so the async
-    // versions of these methods just call the blocking ones
-
-    private CompletableFuture<Void> requestFiltersAsync(HttpRequestImpl r) {
-        CompletableFuture<Void> cf = new MinimalFuture<>();
-        try {
-            requestFilters(r);
-            cf.complete(null);
-        } catch(Throwable e) {
-            cf.completeExceptionally(e);
-        }
-        return cf;
-    }
-
-
-    private Pair<Response,HttpRequestImpl>
-    responseFilters(Response response) throws IOException
+    private HttpRequestImpl responseFilters(Response response) throws IOException
     {
         Log.logTrace("Applying response filters");
         for (HeaderFilter filter : filters) {
@@ -237,24 +222,11 @@
             HttpRequestImpl newreq = filter.response(response);
             if (newreq != null) {
                 Log.logTrace("New request: stopping filters");
-                return pair(null, newreq);
+                return newreq;
             }
         }
         Log.logTrace("All filters applied");
-        return pair(response, null);
-    }
-
-    private CompletableFuture<Pair<Response,HttpRequestImpl>>
-    responseFiltersAsync(Response response)
-    {
-        CompletableFuture<Pair<Response,HttpRequestImpl>> cf = new MinimalFuture<>();
-        try {
-            Pair<Response,HttpRequestImpl> n = responseFilters(response); // assumed to be fast
-            cf.complete(n);
-        } catch (Throwable e) {
-            cf.completeExceptionally(e);
-        }
-        return cf;
+        return null;
     }
 
     public void cancel() {
@@ -267,24 +239,27 @@
         getExchange().cancel(cause);
     }
 
-    public CompletableFuture<HttpResponseImpl<T>> responseAsync(Void v) {
-        return responseAsync1(null)
+    public CompletableFuture<HttpResponseImpl<T>> responseAsync() {
+        CompletableFuture<Void> start = new MinimalFuture<>();
+        CompletableFuture<HttpResponseImpl<T>> cf = responseAsync0(start);
+        start.completeAsync( () -> null, executor); // trigger execution
+        return cf;
+    }
+
+    private CompletableFuture<HttpResponseImpl<T>> responseAsync0(CompletableFuture<Void> start) {
+        return start.thenCompose( v -> responseAsyncImpl())
             .thenCompose((Response r) -> {
                 Exchange<T> exch = getExchange();
                 return exch.readBodyAsync(responseHandler)
-                        .thenApply((T body) -> {
-                            Pair<Response,T> result = new Pair<>(r, body);
-                            return result;
-                        });
-            })
-            .thenApply((Pair<Response,T> result) -> {
-                return new HttpResponseImpl<>(userRequest, result.first, result.second, getExchange());
+                        .thenApply((T body) ->  new HttpResponseImpl<>(userRequest, r, body, exch));
             });
     }
 
     CompletableFuture<U> multiResponseAsync() {
-        CompletableFuture<HttpResponse<T>> mainResponse = responseAsync(null)
-                  .thenApply((HttpResponseImpl<T> b) -> {
+        CompletableFuture<Void> start = new MinimalFuture<>();
+        CompletableFuture<HttpResponseImpl<T>> cf = responseAsync0(start);
+        CompletableFuture<HttpResponse<T>> mainResponse =
+                cf.thenApply((HttpResponseImpl<T> b) -> {
                       multiResponseHandler.onResponse(b);
                       return (HttpResponse<T>)b;
                    });
@@ -295,10 +270,12 @@
             // All push promises received by now.
             pushGroup.noMorePushes(true);
         });
-        return multiResponseHandler.completion(pushGroup.groupResult(), pushGroup.pushesCF());
+        CompletableFuture<U> res = multiResponseHandler.completion(pushGroup.groupResult(), pushGroup.pushesCF());
+        start.completeAsync( () -> null, executor); // trigger execution
+        return res;
     }
 
-    private CompletableFuture<Response> responseAsync1(Void v) {
+    private CompletableFuture<Response> responseAsyncImpl() {
         CompletableFuture<Response> cf;
         if (++attempts > max_attempts) {
             cf = MinimalFuture.failedFuture(new IOException("Too many retries"));
@@ -307,48 +284,51 @@
                 timedEvent = new TimedEvent(currentreq.duration());
                 client.registerTimer(timedEvent);
             }
+            try {
+                // 1. Apply request filters
+                requestFilters(currentreq);
+            } catch (IOException e) {
+                return MinimalFuture.failedFuture(e);
+            }
             Exchange<T> exch = getExchange();
-            // 1. Apply request filters
-            cf = requestFiltersAsync(currentreq)
-                // 2. get response
-                .thenCompose((v1) -> {
-                    return exch.responseAsync();
-                })
-                // 3. Apply response filters
-                .thenCompose(this::responseFiltersAsync)
-                // 4. Check filter result and repeat or continue
-                .thenCompose((Pair<Response,HttpRequestImpl> pair) -> {
-                    Response resp = pair.first;
-                    if (resp != null) {
+            // 2. get response
+            cf = exch.responseAsync()
+                .thenCompose((Response response) -> {
+                    HttpRequestImpl newrequest = null;
+                    try {
+                        // 3. Apply response filters
+                        newrequest = responseFilters(response);
+                    } catch (IOException e) {
+                        return MinimalFuture.failedFuture(e);
+                    }
+                    // 4. Check filter result and repeat or continue
+                    if (newrequest == null) {
                         if (attempts > 1) {
                             Log.logError("Succeeded on attempt: " + attempts);
                         }
-                        return MinimalFuture.completedFuture(resp);
+                        return MinimalFuture.completedFuture(response);
                     } else {
-                        currentreq = pair.second;
-                        Exchange<T> previous = exch;
+                        currentreq = newrequest;
                         setExchange(new Exchange<>(currentreq, this, acc));
                         //reads body off previous, and then waits for next response
-                        return responseAsync1(null);
+                        return responseAsyncImpl();
                     }
                 })
-            // 5. Convert result to Pair
-            .handle((BiFunction<Response, Throwable, Pair<Response, Throwable>>) Pair::new)
-            // 6. Handle errors and cancel any timer set
-            .thenCompose((Pair<Response,Throwable> obj) -> {
-                Response response = obj.first;
+            // 5. Handle errors and cancel any timer set
+            .handle((response, ex) -> {
                 if (response != null) {
                     return MinimalFuture.completedFuture(response);
                 }
                 // all exceptions thrown are handled here
-                CompletableFuture<Response> error = getExceptionalCF(obj.second);
+                CompletableFuture<Response> error = getExceptionalCF(ex);
                 if (error == null) {
                     cancelTimer();
-                    return responseAsync1(null);
+                    return responseAsyncImpl();
                 } else {
                     return error;
                 }
-            });
+            })
+            .thenCompose(UnaryOperator.identity());
         }
         return cf;
     }
@@ -377,9 +357,5 @@
         public void handle() {
             cancel(new HttpTimeoutException("request timed out"));
         }
-        @Override
-        public String toString() {
-            return "[deadline = " + deadline() + "]";
-        }
     }
 }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java
index eb1cb4a..113df48 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainHttpConnection.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@
  */
 class PlainHttpConnection extends HttpConnection implements AsyncConnection {
 
-    protected SocketChannel chan;
+    protected final SocketChannel chan;
     private volatile boolean connected;
     private boolean closed;
 
@@ -100,6 +100,7 @@
                 chan.finishConnect();
             } catch (IOException e) {
                 cf.completeExceptionally(e);
+                return;
             }
             connected = true;
             cf.complete(null);
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java
index f093e39..6432804 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PlainTunnelingConnection.java
@@ -36,7 +36,7 @@
 
 /**
  * A plain text socket tunnel through a proxy. Uses "CONNECT" but does not
- * encrypt. Used by WebSockets. Subclassed in SSLTunnelConnection for encryption.
+ * encrypt. Used by WebSocket. Subclassed in SSLTunnelConnection for encryption.
  */
 class PlainTunnelingConnection extends HttpConnection {
 
@@ -50,7 +50,7 @@
             .thenCompose((Void v) -> {
                 HttpRequestImpl req = new HttpRequestImpl("CONNECT", client, address);
                 MultiExchange<Void,Void> mconnectExchange = new MultiExchange<>(req, client, this::ignore);
-                return mconnectExchange.responseAsync(null)
+                return mconnectExchange.responseAsync()
                     .thenCompose((HttpResponseImpl<Void> resp) -> {
                         CompletableFuture<Void> cf = new MinimalFuture<>();
                         if (resp.statusCode() != 200) {
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseProcessors.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseProcessors.java
index 5b37b04..586c76d 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseProcessors.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseProcessors.java
@@ -252,7 +252,7 @@
 
         @Override
         public void onError(HttpRequest request, Throwable t) {
-            results.put(request, CompletableFuture.failedFuture(t));
+            results.put(request, MinimalFuture.failedFuture(t));
         }
 
         @Override
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java
index 60fce9e..cb2177d 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLConnection.java
@@ -50,18 +50,11 @@
     @Override
     public CompletableFuture<Void> connectAsync() {
         return delegate.connectAsync()
-                .thenCompose((Void v) -> {
-                    CompletableFuture<Void> cf = new MinimalFuture<>();
-                    try {
-                        this.sslDelegate = new SSLDelegate(delegate.channel(),
-                                                           client,
-                                                           alpn);
-                        cf.complete(null);
-                    } catch (IOException e) {
-                        cf.completeExceptionally(e);
-                    }
-                    return cf;
-                });
+                .thenCompose((Void v) ->
+                                MinimalFuture.supply( () -> {
+                                    this.sslDelegate = new SSLDelegate(delegate.channel(), client, alpn);
+                                    return null;
+                                }));
     }
 
     @Override
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java
index 781587e..02eaefd 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java
@@ -449,9 +449,11 @@
         for (String cipher : p.getCipherSuites()) {
                 System.out.printf("cipher: %s\n", cipher);
         }
+        // JDK 8 EXCL START
         for (String approto : p.getApplicationProtocols()) {
                 System.out.printf("application protocol: %s\n", approto);
         }
+        // JDK 8 EXCL END
         for (String protocol : p.getProtocols()) {
                 System.out.printf("protocol: %s\n", protocol);
         }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java
index 0b12746..a0eb54e 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
 import java.util.concurrent.Flow.Subscription;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
+import java.util.function.Consumer;
+
 import jdk.incubator.http.internal.common.*;
 import jdk.incubator.http.internal.frame.*;
 import jdk.incubator.http.internal.hpack.DecodingCallback;
@@ -96,7 +98,7 @@
  */
 class Stream<T> extends ExchangeImpl<T> {
 
-    final Queue<Http2Frame> inputQ;
+    final AsyncDataReadQueue inputQ = new AsyncDataReadQueue();
 
     /**
      * This stream's identifier. Assigned lazily by the HTTP2Connection before
@@ -146,7 +148,7 @@
 
     @Override
     CompletableFuture<T> readBodyAsync(HttpResponse.BodyHandler<T> handler,
-                                       boolean returnToCache,
+                                       boolean returnConnectionToPool,
                                        Executor executor)
     {
         Log.logTrace("Reading body on stream {0}", streamid);
@@ -164,12 +166,12 @@
     }
 
     @Override
-    T readBody(HttpResponse.BodyHandler<T> handler, boolean returnToCache)
+    T readBody(HttpResponse.BodyHandler<T> handler, boolean returnConnectionToPool)
         throws IOException
     {
         CompletableFuture<T> cf = readBodyAsync(handler,
-                                                returnToCache,
-                                                this::executeInline);
+                                                returnConnectionToPool,
+                                                null);
         try {
             return cf.join();
         } catch (CompletionException e) {
@@ -177,10 +179,6 @@
         }
     }
 
-    void executeInline(Runnable r) {
-        r.run();
-    }
-
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -189,60 +187,69 @@
         return sb.toString();
     }
 
+    private boolean receiveDataFrame(Http2Frame frame) throws IOException, InterruptedException {
+        if (frame instanceof ResetFrame) {
+            handleReset((ResetFrame) frame);
+            return true;
+        } else if (!(frame instanceof DataFrame)) {
+            assert false;
+            return true;
+        }
+        DataFrame df = (DataFrame) frame;
+        // RFC 7540 6.1:
+        // The entire DATA frame payload is included in flow control,
+        // including the Pad Length and Padding fields if present
+        int len = df.payloadLength();
+        ByteBufferReference[] buffers = df.getData();
+        for (ByteBufferReference b : buffers) {
+            ByteBuffer buf = b.get();
+            if (buf.hasRemaining()) {
+                publisher.acceptData(Optional.of(buf));
+            }
+        }
+        connection.windowUpdater.update(len);
+        if (df.getFlag(DataFrame.END_STREAM)) {
+            setEndStreamReceived();
+            publisher.acceptData(Optional.empty());
+            return false;
+        }
+        // Don't send window update on a stream which is
+        // closed or half closed.
+        windowUpdater.update(len);
+        return true;
+    }
+
     // pushes entire response body into response processor
     // blocking when required by local or remote flow control
     CompletableFuture<T> receiveData(Executor executor) {
         CompletableFuture<T> cf = responseProcessor
                 .getBody()
                 .toCompletableFuture();
-
-        executor.execute(() -> {
-            Http2Frame frame;
-            DataFrame df = null;
-            try {
-                if (!endStreamReceived()) {
-                    do {
-                        frame = inputQ.take();
-                        if (frame instanceof ResetFrame) {
-                            handleReset((ResetFrame)frame);
-                            continue;
-                        } else if (!(frame instanceof DataFrame)) {
-                            assert false;
-                            continue;
-                        }
-                        df = (DataFrame) frame;
-                        // RFC 7540 6.1:
-                        // The entire DATA frame payload is included in flow control,
-                        // including the Pad Length and Padding fields if present
-                        int len = df.payloadLength();
-                        ByteBufferReference[] buffers = df.getData();
-                        for (ByteBufferReference b : buffers) {
-                            publisher.acceptData(Optional.of(b.get()));
-                        }
-                        connection.windowUpdater.update(len);
-                        if (df.getFlag(DataFrame.END_STREAM)) {
-                            break;
-                        }
-                        // Don't send window update on a stream which is
-                        // closed or half closed.
-                        windowUpdater.update(len);
-                    } while (true);
-                    setEndStreamReceived();
-                }
-                publisher.acceptData(Optional.empty());
-            } catch (Throwable e) {
-                Log.logTrace("receiveData: {0}", e.toString());
-                e.printStackTrace();
-                cf.completeExceptionally(e);
-                publisher.acceptError(e);
-            }
-        });
+        Consumer<Throwable> onError = e -> {
+            Log.logTrace("receiveData: {0}", e.toString());
+            e.printStackTrace();
+            cf.completeExceptionally(e);
+            publisher.acceptError(e);
+        };
+        if (executor == null) {
+            inputQ.blockingReceive(this::receiveDataFrame, onError);
+        } else {
+            inputQ.asyncReceive(executor, this::receiveDataFrame, onError);
+        }
         return cf;
     }
 
     @Override
-    void sendBody() throws IOException, InterruptedException {
-        sendBodyImpl();
+    void sendBody() throws IOException {
+        try {
+            sendBodyImpl().join();
+        } catch (CompletionException e) {
+            throw Utils.getIOException(e);
+        }
+    }
+
+    CompletableFuture<ExchangeImpl<T>> sendBodyAsync() {
+        return sendBodyImpl().thenApply( v -> this);
     }
 
     @SuppressWarnings("unchecked")
@@ -268,7 +275,6 @@
         };
         this.requestPseudoHeaders = new HttpHeadersImpl();
         // NEW
-        this.inputQ = new Queue<>();
         this.publisher = new BlockingPushPublisher<>();
         this.windowUpdater = new StreamWindowUpdateSender(connection);
     }
@@ -664,15 +670,29 @@
 
     @Override
     CompletableFuture<Response> getResponseAsync(Executor executor) {
-        CompletableFuture<Response> cf;
+        CompletableFuture<Response> cf = null;
+        // The code below deals with race condition that can be caused when
+        // completeResponse() is being called before getResponseAsync()
         synchronized (response_cfs) {
             if (!response_cfs.isEmpty()) {
+                // This CompletableFuture was created by completeResponse().
+                // it will be already completed.
                 cf = response_cfs.remove(0);
+                // if we find a cf here it should be already completed.
+                // finding a non completed cf should not happen. just assert it.
+                assert cf.isDone() : "Removing uncompleted response: could cause code to hang!";
             } else {
+                // getResponseAsync() is called first. Create a CompletableFuture
+                // that will be completed by completeResponse() when
+                // completeResponse() is called.
                 cf = new MinimalFuture<>();
                 response_cfs.add(cf);
             }
         }
+        if (executor != null && !cf.isDone()) {
+            // protect from executing later chain of CompletableFuture operations from SelectorManager thread
+            cf = cf.thenApplyAsync(r -> r, executor);
+        }
         Log.logTrace("Response future (stream={0}) is: {1}", streamid, cf);
         PushGroup<?,?> pg = exchange.getPushGroup();
         if (pg != null) {
@@ -698,7 +718,7 @@
                     cf.complete(resp);
                     response_cfs.remove(cf);
                     return;
-                }
+                } // else we found the previous response: just leave it alone.
             }
             cf = MinimalFuture.completedFuture(resp);
             Log.logTrace("Created completed future (streamid={0}): {1}",
@@ -732,10 +752,13 @@
      */
     void completeResponseExceptionally(Throwable t) {
         synchronized (response_cfs) {
-            for (CompletableFuture<Response> cf : response_cfs) {
+            // use index to avoid ConcurrentModificationException
+            // caused by removing the CF from within the loop.
+            for (int i = 0; i < response_cfs.size(); i++) {
+                CompletableFuture<Response> cf = response_cfs.get(i);
                 if (!cf.isDone()) {
                     cf.completeExceptionally(t);
-                    response_cfs.remove(cf);
+                    response_cfs.remove(i);
                     return;
                 }
             }
@@ -743,20 +766,12 @@
         }
     }
 
-    private void waitForCompletion() throws IOException {
-        try {
-            requestBodyCF.join();
-        } catch (CompletionException e) {
-            throw Utils.getIOException(e);
-        }
-    }
-
-    void sendBodyImpl() throws IOException, InterruptedException {
+    CompletableFuture<Void> sendBodyImpl() {
         RequestSubscriber subscriber = new RequestSubscriber(requestContentLen);
         subscriber.setClient(client);
         requestProcessor.subscribe(subscriber);
-        waitForCompletion();
-        requestSent();
+        requestBodyCF.whenComplete((v,t) -> requestSent());
+        return requestBodyCF;
     }
 
     @Override
@@ -846,39 +861,33 @@
         // error record it in the PushGroup. The error method is called
         // with a null value when no error occurred (is a no-op)
         @Override
-        CompletableFuture<Void> sendBodyAsync(Executor executor) {
-            return super.sendBodyAsync(executor)
-                        .whenComplete((Void v, Throwable t) -> {
-                            pushGroup.pushError(t);
-                        });
+        CompletableFuture<ExchangeImpl<T>> sendBodyAsync() {
+            return super.sendBodyAsync()
+                        .whenComplete((ExchangeImpl<T> v, Throwable t) -> pushGroup.pushError(t));
         }
 
         @Override
-        CompletableFuture<Void> sendHeadersAsync() {
+        CompletableFuture<ExchangeImpl<T>> sendHeadersAsync() {
             return super.sendHeadersAsync()
-                        .whenComplete((Void v, Throwable t) -> {
-                            pushGroup.pushError(t);
-                         });
-        }
-
-        @Override
-        CompletableFuture<Void> sendRequestAsync(Executor executor) {
-            return super.sendRequestAsync(executor)
-                        .whenComplete((v, t) -> pushGroup.pushError(t));
+                        .whenComplete((ExchangeImpl<T> ex, Throwable t) -> pushGroup.pushError(t));
         }
 
         @Override
         CompletableFuture<Response> getResponseAsync(Executor executor) {
-            return pushCF.whenComplete((v, t) -> pushGroup.pushError(t));
+            CompletableFuture<Response> cf = pushCF.whenComplete((v, t) -> pushGroup.pushError(t));
+            if(executor!=null && !cf.isDone()) {
+                cf  = cf.thenApplyAsync( r -> r, executor);
+            }
+            return cf;
         }
 
         @Override
         CompletableFuture<T> readBodyAsync(
                 HttpResponse.BodyHandler<T> handler,
-                boolean returnToCache,
+                boolean returnConnectionToPool,
                 Executor executor)
         {
-            return super.readBodyAsync(handler, returnToCache, executor)
+            return super.readBodyAsync(handler, returnConnectionToPool, executor)
                         .whenComplete((v, t) -> pushGroup.pushError(t));
         }
 
@@ -887,7 +896,8 @@
             HttpResponseImpl.logResponse(r);
             pushCF.complete(r); // not strictly required for push API
             // start reading the body using the obtained BodyProcessor
-            readBodyAsync(getPushHandler(), false, getExchange().executor())
+            CompletableFuture<Void> start = new MinimalFuture<>();
+            start.thenCompose( v -> readBodyAsync(getPushHandler(), false, getExchange().executor()))
                 .whenComplete((T body, Throwable t) -> {
                     if (t != null) {
                         responseCF.completeExceptionally(t);
@@ -896,6 +906,7 @@
                         responseCF.complete(response);
                     }
                 });
+            start.completeAsync(() -> null, getExchange().executor());
         }
 
         @Override
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/TimeoutEvent.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/TimeoutEvent.java
index 8359e95..7d8610b 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/TimeoutEvent.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/TimeoutEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,10 +27,11 @@
 
 import java.time.Duration;
 import java.time.Instant;
+import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * Timeout event notified by selector thread. Executes the given handler if
- * the timer not cancelled first.
+ * the timer not canceled first.
  *
  * Register with {@link HttpClientImpl#registerTimer(TimeoutEvent)}.
  *
@@ -38,6 +39,10 @@
  */
 abstract class TimeoutEvent implements Comparable<TimeoutEvent> {
 
+    private static final AtomicLong COUNTER = new AtomicLong();
+    // we use id in compareTo to make compareTo consistent with equals
+    // see TimeoutEvent::compareTo below;
+    private final long id = COUNTER.incrementAndGet();
     private final Instant deadline;
 
     TimeoutEvent(Duration duration) {
@@ -52,6 +57,24 @@
 
     @Override
     public int compareTo(TimeoutEvent other) {
-        return this.deadline.compareTo(other.deadline);
+        if (other == this) return 0;
+        // if two events have the same deadline, but are not equals, then the
+        // smaller is the one that was created before (has the smaller id).
+        // This is arbitrary and we don't really care which is smaller or
+        // greater, but we need a total order, so two events with the
+        // same deadline cannot compare == 0 if they are not equals.
+        final int compareDeadline = this.deadline.compareTo(other.deadline);
+        if (compareDeadline == 0 && !this.equals(other)) {
+            long diff = this.id - other.id; // should take care of wrap around
+            if (diff < 0) return -1;
+            else if (diff > 0) return 1;
+            else assert false : "Different events with same id and deadline";
+        }
+        return compareDeadline;
+    }
+
+    @Override
+    public String toString() {
+        return "TimeoutEvent[id=" + id + ", deadline=" + deadline + "]";
     }
 }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/AsyncDataReadQueue.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/AsyncDataReadQueue.java
new file mode 100644
index 0000000..2557c1f
--- /dev/null
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/AsyncDataReadQueue.java
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.incubator.http.internal.common;
+
+import jdk.incubator.http.internal.frame.DataFrame;
+import jdk.incubator.http.internal.frame.Http2Frame;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Executor;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Consumer;
+
+/**
+ * Http2Frame Producer-Consumer queue which either allows to consume all frames in blocking way
+ * or allows to consume it asynchronously. In the latter case put operation from the producer thread
+ * executes consume operation in the given executor.
+ */
+public class AsyncDataReadQueue implements Closeable {
+
+    @FunctionalInterface
+    public interface DataConsumer {
+        /**
+         *
+         * @param t - frame
+         * @return true if consuming should be continued. false when END_STREAM was received.
+         * @throws Throwable
+         */
+        boolean accept(Http2Frame t) throws Throwable;
+    }
+
+    private static final int BLOCKING = 0;
+    private static final int FLUSHING = 1;
+    private static final int REFLUSHING = 2;
+    private static final int ASYNC  = 3;
+    private static final int CLOSED = 4;
+
+
+    private final AtomicInteger state = new AtomicInteger(BLOCKING);
+    private final BlockingQueue<Http2Frame> queue = new LinkedBlockingQueue<>();
+    private Executor executor;
+    private DataConsumer onData;
+    private Consumer<Throwable> onError;
+
+    public AsyncDataReadQueue() {
+    }
+
+    public boolean tryPut(Http2Frame f) {
+        if(state.get() == CLOSED) {
+            return false;
+        } else {
+            queue.offer(f);
+            flushAsync(false);
+            return true;
+        }
+    }
+
+    public void put(Http2Frame f) throws IOException {
+        if(!tryPut(f))
+            throw new IOException("stream closed");
+    }
+
+    public void blockingReceive(DataConsumer onData, Consumer<Throwable> onError) {
+        if (state.get() == CLOSED) {
+            onError.accept(new IOException("stream closed"));
+            return;
+        }
+        assert state.get() == BLOCKING;
+        try {
+            while (onData.accept(queue.take()));
+            assert state.get() == CLOSED;
+        } catch (Throwable e) {
+            onError.accept(e);
+        }
+    }
+
+    public void asyncReceive(Executor executor, DataConsumer onData,
+                             Consumer<Throwable> onError) {
+        if (state.get() == CLOSED) {
+            onError.accept(new IOException("stream closed"));
+            return;
+        }
+
+        assert state.get() == BLOCKING;
+
+        // Validates that fields not already set.
+        if (!checkCanSet("executor", this.executor, onError)
+            || !checkCanSet("onData", this.onData, onError)
+            || !checkCanSet("onError", this.onError, onError)) {
+            return;
+        }
+
+        this.executor = executor;
+        this.onData = onData;
+        this.onError = onError;
+
+        // This will report an error if asyncReceive is called twice,
+        // because we won't be in BLOCKING state if that happens
+        if (!this.state.compareAndSet(BLOCKING, ASYNC)) {
+            onError.accept(new IOException(
+                  new IllegalStateException("State: "+this.state.get())));
+            return;
+        }
+
+        flushAsync(true);
+    }
+
+    private static <T> boolean checkCanSet(String name, T oldval, Consumer<Throwable> onError) {
+        if (oldval != null) {
+            onError.accept(new IOException(
+                     new IllegalArgumentException(name)));
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public void close() {
+        int prevState = state.getAndSet(CLOSED);
+        if(prevState == BLOCKING) {
+            // wake up blocked take()
+            queue.offer(new DataFrame(0, DataFrame.END_STREAM, new ByteBufferReference[0]));
+        }
+    }
+
+    private void flushAsync(boolean alreadyInExecutor) {
+        while(true) {
+            switch (state.get()) {
+                case BLOCKING:
+                case CLOSED:
+                case REFLUSHING:
+                    return;
+                case ASYNC:
+                    if(state.compareAndSet(ASYNC, FLUSHING)) {
+                        if(alreadyInExecutor) {
+                            flushLoop();
+                        } else {
+                            executor.execute(this::flushLoop);
+                        }
+                        return;
+                    }
+                    break;
+                case FLUSHING:
+                    if(state.compareAndSet(FLUSHING, REFLUSHING)) {
+                        return;
+                    }
+                    break;
+            }
+        }
+    }
+
+    private void flushLoop() {
+        try {
+            while(true) {
+                Http2Frame frame = queue.poll();
+                while (frame != null) {
+                    if(!onData.accept(frame)) {
+                        assert state.get() == CLOSED;
+                        return; // closed
+                    }
+                    frame = queue.poll();
+                }
+                switch (state.get()) {
+                    case BLOCKING:
+                        assert false;
+                        break;
+                    case ASYNC:
+                        throw new RuntimeException("Shouldn't happen");
+                    case FLUSHING:
+                        if(state.compareAndSet(FLUSHING, ASYNC)) {
+                            return;
+                        }
+                        break;
+                    case REFLUSHING:
+                        // We need to check if new elements were put after last
+                        // poll() and do graceful exit
+                        state.compareAndSet(REFLUSHING, FLUSHING);
+                        break;
+                    case CLOSED:
+                        return;
+                }
+            }
+        } catch (Throwable e) {
+            onError.accept(e);
+            close();
+        }
+    }
+}
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/MinimalFuture.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/MinimalFuture.java
index 1219f8b..bd338e4 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/MinimalFuture.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/MinimalFuture.java
@@ -26,6 +26,7 @@
 package jdk.incubator.http.internal.common;
 
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionException;
 import java.util.concurrent.CompletionStage;
 import java.util.concurrent.Executor;
 import java.util.function.BiConsumer;
@@ -40,6 +41,11 @@
  */
 public final class MinimalFuture<T> extends CompletableFuture<T> {
 
+    @FunctionalInterface
+    public interface ExceptionalSupplier<U> {
+        U get() throws Throwable;
+    }
+
     final static AtomicLong TOKENS = new AtomicLong();
     final long id;
 
@@ -56,6 +62,29 @@
         return f;
     }
 
+    public static <U> CompletableFuture<U> supply(ExceptionalSupplier<U> supplier) {
+        CompletableFuture<U> cf = new MinimalFuture<>();
+        try {
+            U value = supplier.get();
+            cf.complete(value);
+        } catch (Throwable t) {
+            cf.completeExceptionally(t);
+        }
+        return cf;
+    }
+
+    public static <U> CompletableFuture<U> supply(ExceptionalSupplier<U> supplier, Executor executor) {
+        CompletableFuture<U> cf = new MinimalFuture<>();
+        cf.completeAsync( () -> {
+            try {
+                return supplier.get();
+            } catch (Throwable ex) {
+                throw new CompletionException(ex);
+            }
+        }, executor);
+        return cf;
+    }
+
     public MinimalFuture() {
         super();
         this.id = TOKENS.incrementAndGet();
@@ -110,7 +139,6 @@
         }
     }
 
-    @Override
     public <U> MinimalFuture<U> newIncompleteFuture() {
         return new MinimalFuture<>();
     }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Queue.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Queue.java
index a1f2364..2f1d256 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Queue.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Queue.java
@@ -118,11 +118,13 @@
     public synchronized void closeExceptionally(Throwable t) {
         if (exception == null) exception = t;
         else if (t != null && t != exception) {
-            Stream.of(exception.getSuppressed())
+            if (!Stream.of(exception.getSuppressed())
                 .filter(x -> x == t)
                 .findFirst()
-                .ifPresentOrElse((x) -> {},
-                                 () -> exception.addSuppressed(t));
+                .isPresent())
+            {
+                exception.addSuppressed(t);
+            }
         }
         close();
     }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Utils.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Utils.java
index 9ca85f6..15dc5a7 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Utils.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Utils.java
@@ -32,12 +32,14 @@
 import java.io.ByteArrayOutputStream;
 import java.io.Closeable;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
 import java.net.NetPermission;
 import java.net.URI;
 import java.net.URLPermission;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
@@ -54,6 +56,7 @@
 import java.util.concurrent.Executors;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.function.Predicate;
+import jdk.incubator.http.HttpHeaders;
 
 /**
  * Miscellaneous utilities
@@ -259,9 +262,11 @@
         SSLParameters p1 = new SSLParameters();
         p1.setAlgorithmConstraints(p.getAlgorithmConstraints());
         p1.setCipherSuites(p.getCipherSuites());
+        // JDK 8 EXCL START
         p1.setEnableRetransmissions(p.getEnableRetransmissions());
-        p1.setEndpointIdentificationAlgorithm(p.getEndpointIdentificationAlgorithm());
         p1.setMaximumPacketSize(p.getMaximumPacketSize());
+        // JDK 8 EXCL END
+        p1.setEndpointIdentificationAlgorithm(p.getEndpointIdentificationAlgorithm());
         p1.setNeedClientAuth(p.getNeedClientAuth());
         String[] protocols = p.getProtocols();
         if (protocols != null) {
@@ -475,4 +480,21 @@
         return newb;
     }
 
+    /**
+     * Get the Charset from the Content-encoding header. Defaults to
+     * UTF_8
+     */
+    public static Charset charsetFrom(HttpHeaders headers) {
+        String encoding = headers.firstValue("Content-encoding")
+                .orElse("UTF_8");
+        try {
+            return Charset.forName(encoding);
+        } catch (IllegalArgumentException e) {
+            return StandardCharsets.UTF_8;
+        }
+    }
+
+    public static UncheckedIOException unchecked(IOException e) {
+        return new UncheckedIOException(e);
+    }
 }
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/FrameConsumer.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/FrameConsumer.java
index ac83596..d6b32d7 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/FrameConsumer.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/FrameConsumer.java
@@ -26,6 +26,7 @@
 package jdk.incubator.http.internal.websocket;
 
 import jdk.incubator.http.WebSocket.MessagePart;
+import jdk.incubator.http.internal.common.Log;
 import jdk.incubator.http.internal.websocket.Frame.Opcode;
 
 import java.nio.ByteBuffer;
@@ -33,13 +34,11 @@
 import java.nio.charset.CharacterCodingException;
 
 import static java.lang.String.format;
-import static java.lang.System.Logger.Level.TRACE;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.Objects.requireNonNull;
 import static jdk.incubator.http.internal.common.Utils.dump;
 import static jdk.incubator.http.internal.websocket.StatusCodes.NO_STATUS_CODE;
 import static jdk.incubator.http.internal.websocket.StatusCodes.checkIncomingCode;
-import static jdk.incubator.http.internal.websocket.WebSocketImpl.logger;
 
 /*
  * Consumes frame parts and notifies a message consumer, when there is
@@ -71,17 +70,13 @@
 
     @Override
     public void fin(boolean value) {
-        if (logger.isLoggable(TRACE)) {
-            logger.log(TRACE, "Reading fin: {0}", value);
-        }
+        Log.logTrace("Reading fin: {0}", value);
         fin = value;
     }
 
     @Override
     public void rsv1(boolean value) {
-        if (logger.isLoggable(TRACE)) {
-            logger.log(TRACE, "Reading rsv1: {0}", value);
-        }
+        Log.logTrace("Reading rsv1: {0}", value);
         if (value) {
             throw new FailWebSocketException("Unexpected rsv1 bit");
         }
@@ -89,9 +84,7 @@
 
     @Override
     public void rsv2(boolean value) {
-        if (logger.isLoggable(TRACE)) {
-            logger.log(TRACE, "Reading rsv2: {0}", value);
-        }
+        Log.logTrace("Reading rsv2: {0}", value);
         if (value) {
             throw new FailWebSocketException("Unexpected rsv2 bit");
         }
@@ -99,9 +92,7 @@
 
     @Override
     public void rsv3(boolean value) {
-        if (logger.isLoggable(TRACE)) {
-            logger.log(TRACE, "Reading rsv3: {0}", value);
-        }
+        Log.logTrace("Reading rsv3: {0}", value);
         if (value) {
             throw new FailWebSocketException("Unexpected rsv3 bit");
         }
@@ -109,7 +100,7 @@
 
     @Override
     public void opcode(Opcode v) {
-        logger.log(TRACE, "Reading opcode: {0}", v);
+        Log.logTrace("Reading opcode: {0}", v);
         if (v == Opcode.PING || v == Opcode.PONG || v == Opcode.CLOSE) {
             if (!fin) {
                 throw new FailWebSocketException("Fragmented control frame  " + v);
@@ -137,9 +128,7 @@
 
     @Override
     public void mask(boolean value) {
-        if (logger.isLoggable(TRACE)) {
-            logger.log(TRACE, "Reading mask: {0}", value);
-        }
+        Log.logTrace("Reading mask: {0}", value);
         if (value) {
             throw new FailWebSocketException("Masked frame received");
         }
@@ -147,10 +136,7 @@
 
     @Override
     public void payloadLen(long value) {
-        if (logger.isLoggable(TRACE)) {
-            // Checked for being loggable because of autoboxing of 'value'
-            logger.log(TRACE, "Reading payloadLen: {0}", value);
-        }
+        Log.logTrace("Reading payloadLen: {0}", value);
         if (opcode.isControl()) {
             if (value > 125) {
                 throw new FailWebSocketException(
@@ -178,9 +164,7 @@
 
     @Override
     public void payloadData(ByteBuffer data) {
-        if (logger.isLoggable(TRACE)) {
-            logger.log(TRACE, "Reading payloadData: data={0}", data);
-        }
+        Log.logTrace("Reading payloadData: data={0}", data);
         unconsumedPayloadLen -= data.remaining();
         boolean isLast = unconsumedPayloadLen == 0;
         if (opcode.isControl()) {
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/UTF8AccumulatingDecoder.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/UTF8AccumulatingDecoder.java
index 7536304..0a166cc 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/UTF8AccumulatingDecoder.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/UTF8AccumulatingDecoder.java
@@ -25,6 +25,8 @@
 
 package jdk.incubator.http.internal.websocket;
 
+import jdk.incubator.http.internal.common.Log;
+
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 import java.nio.charset.CharacterCodingException;
@@ -32,10 +34,8 @@
 import java.nio.charset.CoderResult;
 import java.nio.charset.CodingErrorAction;
 
-import static java.lang.System.Logger.Level.WARNING;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static jdk.incubator.http.internal.common.Utils.EMPTY_BYTEBUFFER;
-import static jdk.incubator.http.internal.websocket.WebSocketImpl.logger;
 
 final class UTF8AccumulatingDecoder {
 
@@ -74,9 +74,8 @@
         // Since it's UTF-8, the assumption is leftovers.remaining() < 4
         // (i.e. small). Otherwise a shared buffer should be used
         if (!(leftovers.remaining() < 4)) {
-            logger.log(WARNING,
-                       "The size of decoding leftovers is greater than expected: {0}",
-                       leftovers.remaining());
+            Log.logError("The size of decoding leftovers is greater than expected: {0}",
+                         leftovers.remaining());
         }
         b.position(b.limit()); // As if we always read to the end
         // Decoder promises that in the case of endOfInput == true:
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java
index afc92c3..863211d 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/WebSocketImpl.java
@@ -26,6 +26,7 @@
 package jdk.incubator.http.internal.websocket;
 
 import jdk.incubator.http.WebSocket;
+import jdk.incubator.http.internal.common.Log;
 import jdk.incubator.http.internal.common.Pair;
 import jdk.incubator.http.internal.websocket.OpeningHandshake.Result;
 import jdk.incubator.http.internal.websocket.OutgoingMessage.Binary;
@@ -47,8 +48,6 @@
 import java.util.function.Consumer;
 import java.util.function.Function;
 
-import static java.lang.System.Logger.Level.ERROR;
-import static java.lang.System.Logger.Level.TRACE;
 import static java.util.Objects.requireNonNull;
 import static java.util.concurrent.CompletableFuture.failedFuture;
 import static jdk.incubator.http.internal.common.Pair.pair;
@@ -61,8 +60,6 @@
  */
 final class WebSocketImpl implements WebSocket {
 
-    static final System.Logger logger = System.getLogger("jdk.httpclient.WebSocket");
-
     private final URI uri;
     private final String subprotocol;
     private final RawChannel channel;
@@ -142,7 +139,7 @@
                     try {
                         channel.close();
                     } catch (IOException e) {
-                        logger.log(ERROR, e);
+                        Log.logError(e);
                     } finally {
                         closed.set(true);
                     }
@@ -168,14 +165,14 @@
     private void signalError(Throwable error) {
         synchronized (lock) {
             if (lastMethodInvoked) {
-                logger.log(ERROR, error);
+                Log.logError(error);
             } else {
                 lastMethodInvoked = true;
                 receiver.close();
                 try {
                     listener.onError(this, error);
                 } catch (Exception e) {
-                    logger.log(ERROR, e);
+                    Log.logError(e);
                 }
             }
         }
@@ -190,7 +187,7 @@
         try {
             channel.shutdownInput();
         } catch (IOException e) {
-            logger.log(ERROR, e);
+            Log.logError(e);
         }
         boolean wasComplete = !closeReceived.complete(null);
         if (wasComplete) {
@@ -210,7 +207,7 @@
             enqueueClose(new Close(code, ""))
                     .whenComplete((r1, error1) -> {
                         if (error1 != null) {
-                            logger.log(ERROR, error1);
+                            Log.logError(error1);
                         }
                     });
         });
@@ -223,14 +220,14 @@
     private CompletionStage<?> signalClose(int statusCode, String reason) {
         synchronized (lock) {
             if (lastMethodInvoked) {
-                logger.log(TRACE, "Close: {0}, ''{1}''", statusCode, reason);
+                Log.logTrace("Close: {0}, ''{1}''", statusCode, reason);
             } else {
                 lastMethodInvoked = true;
                 receiver.close();
                 try {
                     return listener.onClose(this, statusCode, reason);
                 } catch (Exception e) {
-                    logger.log(ERROR, e);
+                    Log.logError(e);
                 }
             }
         }
@@ -289,7 +286,7 @@
             try {
                 channel.shutdownOutput();
             } catch (IOException e) {
-                logger.log(ERROR, e);
+                Log.logError(e);
             }
             boolean wasComplete = !closeSent.complete(null);
             if (wasComplete) {
diff --git a/jdk/src/jdk.incubator.httpclient/share/classes/module-info.java b/jdk/src/jdk.incubator.httpclient/share/classes/module-info.java
index 5b8f0c5..a3fb16a 100644
--- a/jdk/src/jdk.incubator.httpclient/share/classes/module-info.java
+++ b/jdk/src/jdk.incubator.httpclient/share/classes/module-info.java
@@ -26,6 +26,9 @@
 /**
  * Defines the high-level HTTP and WebSocket API.
  * {@Incubating}
+ *
+ * @moduleGraph
+ * @since 9
  */
 module jdk.incubator.httpclient {
     requires java.base;
diff --git a/jdk/src/jdk.internal.ed/share/classes/module-info.java b/jdk/src/jdk.internal.ed/share/classes/module-info.java
index f6beda7..0e0ea99 100644
--- a/jdk/src/jdk.internal.ed/share/classes/module-info.java
+++ b/jdk/src/jdk.internal.ed/share/classes/module-info.java
@@ -26,6 +26,8 @@
 /**
  * Internal editor support for JDK tools.  Includes the Service Provider
  * Interface to built-in editors.
+ *
+ * @since 9
  */
 module jdk.internal.ed {
 
diff --git a/jdk/src/jdk.internal.jvmstat/share/classes/module-info.java b/jdk/src/jdk.internal.jvmstat/share/classes/module-info.java
index 1761217..1ab1e44 100644
--- a/jdk/src/jdk.internal.jvmstat/share/classes/module-info.java
+++ b/jdk/src/jdk.internal.jvmstat/share/classes/module-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Defines an internal API for monitoring a HotSpot Java Virtual Machine using
+ * its shared memory instrumentation buffer
+ *
+ * @since 9
+ */
 module jdk.internal.jvmstat {
     exports sun.jvmstat.monitor to
         jdk.attach,
diff --git a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/ConsoleReader.java b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/ConsoleReader.java
index a7f2687..6a9fb3b 100644
--- a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/ConsoleReader.java
+++ b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/ConsoleReader.java
@@ -306,6 +306,7 @@
      * Shuts down the ConsoleReader if the JVM attempts to clean it up.
      */
     @Override
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         try {
             shutdown();
diff --git a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java
index 394d0eb..fcccd9d 100644
--- a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java
+++ b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@
                 //in.resetPromptLine(in.getPrompt(), in.getHistory().current().toString(), -1);
                 //but that would mean more re-writing on the screen, (and prints an additional
                 //empty line), so using setBuffer directly:
-                Method setBuffer = in.getClass().getDeclaredMethod("setBuffer", String.class);
+                Method setBuffer = ConsoleReader.class.getDeclaredMethod("setBuffer", String.class);
 
                 setBuffer.setAccessible(true);
                 setBuffer.invoke(in, in.getHistory().current().toString());
diff --git a/jdk/src/jdk.internal.le/share/classes/module-info.java b/jdk/src/jdk.internal.le/share/classes/module-info.java
index db859df..d45879d 100644
--- a/jdk/src/jdk.internal.le/share/classes/module-info.java
+++ b/jdk/src/jdk.internal.le/share/classes/module-info.java
@@ -25,6 +25,8 @@
 
 /**
  * Internal API for line editing
+ *
+ * @since 9
  */
 module jdk.internal.le {
     exports jdk.internal.jline to
diff --git a/jdk/src/jdk.internal.opt/share/classes/module-info.java b/jdk/src/jdk.internal.opt/share/classes/module-info.java
index be862b7..2bc5583 100644
--- a/jdk/src/jdk.internal.opt/share/classes/module-info.java
+++ b/jdk/src/jdk.internal.opt/share/classes/module-info.java
@@ -25,6 +25,8 @@
 
 /**
  * Internal option processing API
+ *
+ * @since 9
  */
 module jdk.internal.opt {
     exports jdk.internal.joptsimple to jdk.jlink, jdk.jshell;
diff --git a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java
index 0976535..abeeb10 100644
--- a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java
+++ b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
  * @deprecated This class has been deprecated.
  */
 
-@Deprecated
+@Deprecated(since="9")
 public abstract class ContentSigner {
 
     /**
diff --git a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
index a2cb8d7..daa13fe 100644
--- a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
+++ b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
  * @author Vincent Ryan
  * @deprecated This class has been deprecated.
  */
-@Deprecated
+@Deprecated(since="9")
 public interface ContentSignerParameters {
 
     /**
diff --git a/jdk/src/jdk.jartool/share/classes/module-info.java b/jdk/src/jdk.jartool/share/classes/module-info.java
index 536ca81..d852ee7 100644
--- a/jdk/src/jdk.jartool/share/classes/module-info.java
+++ b/jdk/src/jdk.jartool/share/classes/module-info.java
@@ -23,6 +23,13 @@
  * questions.
  */
 
+/**
+ * Defines tools for manipulating Java Archive (JAR) files,
+ * including the jar and jarsigner tools.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.jartool {
     exports com.sun.jarsigner;
     exports jdk.security.jarsigner;
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java
index 601a537..a6dca2c 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/GNUStyleOptions.java
@@ -95,7 +95,7 @@
                     tool.xflag = true;
                 }
             },
-            new Option(false, OptionType.MAIN_OPERATION, "--print-module-descriptor", "-d") {
+            new Option(false, OptionType.MAIN_OPERATION, "--describe-module", "-d") {
                 void process(Main tool, String opt, String arg) throws BadArgs {
                     if (tool.cflag || tool.iflag  || tool.tflag || tool.uflag || tool.xflag)
                         throw new BadArgs("error.multiple.main.operations").showUsage(true);
@@ -118,7 +118,7 @@
                 void process(Main jartool, String opt, String arg) {
                     jartool.nflag = true;
                 }
-                boolean isHidden() { return true; }
+                boolean isExtra() { return true; }
             },
             new Option(true, OptionType.CREATE_UPDATE, "--main-class", "-e") {
                 void process(Main jartool, String opt, String arg) {
@@ -157,8 +157,7 @@
                     for (String dir : dirs) {
                         paths[i++] = Paths.get(dir);
                     }
-                    jartool.moduleFinder =
-                        new ModulePath(Runtime.version(), true, paths);
+                    jartool.moduleFinder = ModulePath.of(Runtime.version(), true, paths);
                 }
             },
             new Option(false, OptionType.CREATE_UPDATE, "--do-not-resolve-by-default") {
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java
index 36e2ad3..dc9d3d9 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java
@@ -27,6 +27,7 @@
 
 import java.io.*;
 import java.lang.module.Configuration;
+import java.lang.module.FindException;
 import java.lang.module.InvalidModuleDescriptorException;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleDescriptor.Exports;
@@ -63,6 +64,7 @@
 import jdk.internal.module.ModuleInfo;
 import jdk.internal.module.ModuleInfoExtender;
 import jdk.internal.module.ModuleResolution;
+import jdk.internal.module.ModuleTarget;
 import jdk.internal.util.jar.JarIndex;
 
 import static jdk.internal.util.jar.JarIndex.INDEX_NAME;
@@ -158,7 +160,7 @@
     static final String MANIFEST_DIR = "META-INF/";
     static final String VERSIONS_DIR = MANIFEST_DIR + "versions/";
     static final String VERSION = "1.0";
-
+    static final int VERSIONS_DIR_LENGTH = VERSIONS_DIR.length();
     private static ResourceBundle rsrc;
 
     /**
@@ -237,6 +239,7 @@
         if (!parseArgs(args)) {
             return false;
         }
+        File tmpFile = null;
         try {
             if (cflag || uflag) {
                 if (fname != null) {
@@ -303,8 +306,8 @@
                         ? "tmpjar"
                         : fname.substring(fname.indexOf(File.separatorChar) + 1);
 
-                File tmpfile = createTemporaryFile(tmpbase, ".jar");
-                try (OutputStream out = new FileOutputStream(tmpfile)) {
+                tmpFile = createTemporaryFile(tmpbase, ".jar");
+                try (OutputStream out = new FileOutputStream(tmpFile)) {
                     create(new BufferedOutputStream(out, 4096), manifest);
                 }
                 if (nflag) {
@@ -313,16 +316,16 @@
                         Packer packer = Pack200.newPacker();
                         Map<String, String> p = packer.properties();
                         p.put(Packer.EFFORT, "1"); // Minimal effort to conserve CPU
-                        try (JarFile jarFile = new JarFile(tmpfile.getCanonicalPath());
+                        try (JarFile jarFile = new JarFile(tmpFile.getCanonicalPath());
                              OutputStream pack = new FileOutputStream(packFile))
                         {
                             packer.pack(jarFile, pack);
                         }
-                        if (tmpfile.exists()) {
-                            tmpfile.delete();
+                        if (tmpFile.exists()) {
+                            tmpFile.delete();
                         }
-                        tmpfile = createTemporaryFile(tmpbase, ".jar");
-                        try (OutputStream out = new FileOutputStream(tmpfile);
+                        tmpFile = createTemporaryFile(tmpbase, ".jar");
+                        try (OutputStream out = new FileOutputStream(tmpFile);
                              JarOutputStream jos = new JarOutputStream(out))
                         {
                             Unpacker unpacker = Pack200.newUnpacker();
@@ -332,9 +335,9 @@
                         Files.deleteIfExists(packFile.toPath());
                     }
                 }
-                validateAndClose(tmpfile);
+                validateAndClose(tmpFile);
             } else if (uflag) {
-                File inputFile = null, tmpFile = null;
+                File inputFile = null;
                 if (fname != null) {
                     inputFile = new File(fname);
                     tmpFile = createTempFileInSameDirectoryAs(inputFile);
@@ -406,11 +409,11 @@
                 boolean found;
                 if (fname != null) {
                     try (ZipFile zf = new ZipFile(fname)) {
-                        found = printModuleDescriptor(zf);
+                        found = describeModule(zf);
                     }
                 } else {
                     try (FileInputStream fin = new FileInputStream(FileDescriptor.in)) {
-                        found = printModuleDescriptor(fin);
+                        found = describeModule(fin);
                     }
                 }
                 if (!found)
@@ -425,6 +428,9 @@
         } catch (Throwable t) {
             t.printStackTrace();
             ok = false;
+        } finally {
+            if (tmpFile != null && tmpFile.exists())
+                tmpFile.delete();
         }
         out.flush();
         err.flush();
@@ -599,7 +605,7 @@
         int n = args.length - count;
         if (n > 0) {
             if (dflag) {
-                // "--print-module-descriptor/-d" does not require file argument(s)
+                // "--describe-module/-d" does not require file argument(s)
                 usageError(formatMsg("error.bad.dflag", args[count]));
                 return false;
             }
@@ -681,7 +687,7 @@
     void addPackageIfNamed(Set<String> packages, String name) {
         if (name.startsWith(VERSIONS_DIR)) {
             // trim the version dir prefix
-            int i0 = VERSIONS_DIR.length();
+            int i0 = VERSIONS_DIR_LENGTH;
             int i = name.indexOf('/', i0);
             if (i <= 0) {
                 warn(formatMsg("warn.release.unexpected.versioned.entry", name));
@@ -699,7 +705,7 @@
         }
         String pn = toPackageName(name);
         // add if this is a class or resource in a package
-        if (Checks.isJavaIdentifier(pn)) {
+        if (Checks.isPackageName(pn)) {
             packages.add(pn);
         }
     }
@@ -1724,34 +1730,64 @@
                            .collect(joining(", ", prefix, suffix));
     }
 
-    private boolean printModuleDescriptor(ZipFile zipFile)
-        throws IOException
-    {
-        ZipEntry entry = zipFile.getEntry(MODULE_INFO);
-        if (entry ==  null)
-            return false;
+    private boolean describeModule(ZipFile zipFile) throws IOException {
+        ZipEntry[] zes = zipFile.stream()
+            .filter(e -> isModuleInfoEntry(e.getName()))
+            .sorted(Validator.ENTRY_COMPARATOR)
+            .toArray(ZipEntry[]::new);
 
-        try (InputStream is = zipFile.getInputStream(entry)) {
-            printModuleDescriptor(is);
+        if (zes.length == 0) {
+            // No module descriptor found, derive the automatic module name
+            String fn = zipFile.getName();
+            ModuleFinder mf = ModuleFinder.of(Paths.get(fn));
+            try {
+                Set<ModuleReference> mref = mf.findAll();
+                if (mref.isEmpty()) {
+                    output(formatMsg("error.unable.derive.automodule", fn));
+                    return true;
+                }
+                ModuleDescriptor md = mref.iterator().next().descriptor();
+                output(getMsg("out.automodule"));
+                describeModule(md, null, null, "automatic");
+            } catch (FindException e) {
+                String msg = formatMsg("error.unable.derive.automodule", fn);
+                Throwable t = e.getCause();
+                if (t != null)
+                    msg = msg + "\n" + t.getMessage();
+                output(msg);
+            }
+        } else {
+            for (ZipEntry ze : zes) {
+                try (InputStream is = zipFile.getInputStream(ze)) {
+                    describeModule(is, ze.getName());
+                }
+            }
         }
         return true;
     }
 
-    private boolean printModuleDescriptor(FileInputStream fis)
+    private boolean describeModule(FileInputStream fis)
         throws IOException
     {
         try (BufferedInputStream bis = new BufferedInputStream(fis);
              ZipInputStream zis = new ZipInputStream(bis)) {
-
             ZipEntry e;
             while ((e = zis.getNextEntry()) != null) {
-                if (e.getName().equals(MODULE_INFO)) {
-                    printModuleDescriptor(zis);
-                    return true;
+                String ename = e.getName();
+                if (isModuleInfoEntry(ename)){
+                    moduleInfos.put(ename, zis.readAllBytes());
                 }
             }
         }
-        return false;
+        if (moduleInfos.size() == 0)
+            return false;
+        String[] names = moduleInfos.keySet().stream()
+            .sorted(Validator.ENTRYNAME_COMPARATOR)
+            .toArray(String[]::new);
+        for (String name : names) {
+            describeModule(new ByteArrayInputStream(moduleInfos.get(name)), name);
+        }
+        return true;
     }
 
     static <T> String toString(Collection<T> set) {
@@ -1760,18 +1796,30 @@
                   .collect(joining(" "));
     }
 
-    private void printModuleDescriptor(InputStream entryInputStream)
+    private void describeModule(InputStream entryInputStream, String ename)
         throws IOException
     {
         ModuleInfo.Attributes attrs = ModuleInfo.read(entryInputStream, null);
         ModuleDescriptor md = attrs.descriptor();
+        ModuleTarget target = attrs.target();
         ModuleHashes hashes = attrs.recordedHashes();
 
+        describeModule(md, target, hashes, ename);
+    }
+
+    private void describeModule(ModuleDescriptor md,
+                                ModuleTarget target,
+                                ModuleHashes hashes,
+                                String ename)
+        throws IOException
+    {
         StringBuilder sb = new StringBuilder();
-        sb.append("\n");
+        sb.append("\nmodule ")
+          .append(md.toNameAndVersion())
+          .append(" (").append(ename).append(")");
+
         if (md.isOpen())
-            sb.append("open ");
-        sb.append(md.toNameAndVersion());
+            sb.append("\n  open ");
 
         md.requires().stream()
             .sorted(Comparator.comparing(Requires::name))
@@ -1807,11 +1855,14 @@
 
         md.mainClass().ifPresent(v -> sb.append("\n  main-class " + v));
 
-        md.osName().ifPresent(v -> sb.append("\n  operating-system-name " + v));
-
-        md.osArch().ifPresent(v -> sb.append("\n  operating-system-architecture " + v));
-
-        md.osVersion().ifPresent(v -> sb.append("\n  operating-system-version " + v));
+        if (target != null) {
+            String osName = target.osName();
+            if (osName != null)
+                sb.append("\n  operating-system-name " + osName);
+            String osArch = target.osArch();
+            if (osArch != null)
+                sb.append("\n  operating-system-architecture " + osArch);
+       }
 
        if (hashes != null) {
            hashes.names().stream().sorted().forEach(
@@ -1879,7 +1930,7 @@
             if (end == 0)
                 return true;
             if (name.startsWith(VERSIONS_DIR)) {
-                int off = VERSIONS_DIR.length();
+                int off = VERSIONS_DIR_LENGTH;
                 if (off == end)      // meta-inf/versions/module-info.class
                     return false;
                 while (off < end - 1) {
@@ -1995,7 +2046,7 @@
             }
             // get a resolved module graph
             Configuration config =
-                Configuration.empty().resolveRequires(system, finder, roots);
+                Configuration.empty().resolve(system, finder, roots);
 
             // filter modules resolved from the system module finder
             this.modules = config.modules().stream()
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Validator.java b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Validator.java
index 691fd77..491d093 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Validator.java
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Validator.java
@@ -49,6 +49,7 @@
 
 import static java.util.jar.JarFile.MANIFEST_NAME;
 import static sun.tools.jar.Main.VERSIONS_DIR;
+import static sun.tools.jar.Main.VERSIONS_DIR_LENGTH;
 import static sun.tools.jar.Main.MODULE_INFO;
 import static sun.tools.jar.Main.getMsg;
 import static sun.tools.jar.Main.formatMsg;
@@ -59,19 +60,19 @@
 final class Validator {
     private final static boolean DEBUG = Boolean.getBoolean("jar.debug");
     private final  Map<String,FingerPrint> fps = new HashMap<>();
-    private static final int vdlen = VERSIONS_DIR.length();
     private final Main main;
     private final JarFile jf;
     private int oldVersion = -1;
     private String currentTopLevelName;
     private boolean isValid = true;
-    private Set<String> concealedPkgs;
+    private Set<String> concealedPkgs = Collections.emptySet();
     private ModuleDescriptor md;
+    private String mdName;
 
     private Validator(Main main, JarFile jf) {
         this.main = main;
         this.jf = jf;
-        loadModuleDescriptor();
+        checkModuleDescriptor(MODULE_INFO);
     }
 
     static boolean validate(Main main, JarFile jf) throws IOException {
@@ -83,7 +84,7 @@
             jf.stream()
               .filter(e -> !e.isDirectory() &&
                       !e.getName().equals(MANIFEST_NAME))
-              .sorted(entryComparator)
+              .sorted(ENTRY_COMPARATOR)
               .forEachOrdered(e -> validate(e));
             return isValid;
         } catch (InvalidJarException e) {
@@ -102,9 +103,8 @@
     // sort base entries before versioned entries, and sort entry classes with
     // nested classes so that the top level class appears before the associated
     // nested class
-    private static Comparator<JarEntry> entryComparator = (je1, je2) ->  {
-        String s1 = je1.getName();
-        String s2 = je2.getName();
+    static Comparator<String> ENTRYNAME_COMPARATOR = (s1, s2) ->  {
+
         if (s1.equals(s2)) return 0;
         boolean b1 = s1.startsWith(VERSIONS_DIR);
         boolean b2 = s2.startsWith(VERSIONS_DIR);
@@ -140,6 +140,9 @@
         return l1 - l2;
     };
 
+    static Comparator<ZipEntry> ENTRY_COMPARATOR =
+        Comparator.comparing(ZipEntry::getName, ENTRYNAME_COMPARATOR);
+
     /*
      *  Validator has state and assumes entries provided to accept are ordered
      *  from base entries first and then through the versioned entries in
@@ -158,24 +161,25 @@
 
         // validate the versioned module-info
         if (isModuleInfoEntry(entryName)) {
-            if (entryName.length() != MODULE_INFO.length())
-                checkModuleDescriptor(je);
+            if (!entryName.equals(mdName))
+                checkModuleDescriptor(entryName);
             return;
         }
 
         // figure out the version and basename from the JarEntry
         int version;
         String basename;
+        String versionStr = null;;
         if (entryName.startsWith(VERSIONS_DIR)) {
-            int n = entryName.indexOf("/", vdlen);
+            int n = entryName.indexOf("/", VERSIONS_DIR_LENGTH);
             if (n == -1) {
                 error(formatMsg("error.validator.version.notnumber", entryName));
                 isValid = false;
                 return;
             }
-            String v = entryName.substring(vdlen, n);
+            versionStr = entryName.substring(VERSIONS_DIR_LENGTH, n);
             try {
-                version = Integer.parseInt(v);
+                version = Integer.parseInt(versionStr);
             } catch (NumberFormatException x) {
                 error(formatMsg("error.validator.version.notnumber", entryName));
                 isValid = false;
@@ -196,6 +200,11 @@
         if (oldVersion != version) {
             oldVersion = version;
             currentTopLevelName = null;
+            if (md == null && versionStr != null) {
+                // don't have a base module-info.class yet, try to see if
+                // a versioned one exists
+                checkModuleDescriptor(VERSIONS_DIR + versionStr + "/" + MODULE_INFO);
+            }
         }
 
         // analyze the entry, keeping key attributes
@@ -308,61 +317,52 @@
         return;
     }
 
-    private void loadModuleDescriptor() {
-        ZipEntry je = jf.getEntry(MODULE_INFO);
-        if (je != null) {
-            try (InputStream jis = jf.getInputStream(je)) {
-                md = ModuleDescriptor.read(jis);
-                concealedPkgs = new HashSet<>(md.packages());
-                md.exports().stream().map(Exports::source).forEach(concealedPkgs::remove);
-                md.opens().stream().map(Opens::source).forEach(concealedPkgs::remove);
-                return;
-            } catch (Exception x) {
-                error(x.getMessage() + " : " + je.getName());
-                this.isValid = false;
-            }
-        }
-        md = null;
-        concealedPkgs = Collections.emptySet();
-    }
-
-    private static boolean isPlatformModule(String name) {
-        return name.startsWith("java.") || name.startsWith("jdk.");
-    }
-
     /**
      * Checks whether or not the given versioned module descriptor's attributes
-     * are valid when compared against the root module descriptor.
+     * are valid when compared against the root/base module descriptor.
      *
-     * A versioned module descriptor must be identical to the root module
+     * A versioned module descriptor must be identical to the root/base module
      * descriptor, with two exceptions:
      *  - A versioned descriptor can have different non-public `requires`
      *    clauses of platform ( `java.*` and `jdk.*` ) modules, and
      *  - A versioned descriptor can have different `uses` clauses, even of
      *    service types defined outside of the platform modules.
      */
-    private void checkModuleDescriptor(JarEntry je) {
-        try (InputStream is = jf.getInputStream(je)) {
-            ModuleDescriptor root = this.md;
-            ModuleDescriptor md = null;
-            try {
-                md = ModuleDescriptor.read(is);
-            } catch (InvalidModuleDescriptorException x) {
-                error(x.getMessage());
-                isValid = false;
-                return;
-            }
-            if (root == null) {
-                this.md = md;
-            } else {
-                if (!root.name().equals(md.name())) {
+    private void checkModuleDescriptor(String miName) {
+        ZipEntry je = jf.getEntry(miName);
+        if (je != null) {
+            try (InputStream jis = jf.getInputStream(je)) {
+                ModuleDescriptor md = ModuleDescriptor.read(jis);
+                // Initialize the base md if it's not yet. A "base" md can be either the
+                // root module-info.class or the first versioned module-info.class
+                ModuleDescriptor base = this.md;
+
+                if (base == null) {
+                    concealedPkgs = new HashSet<>(md.packages());
+                    md.exports().stream().map(Exports::source).forEach(concealedPkgs::remove);
+                    md.opens().stream().map(Opens::source).forEach(concealedPkgs::remove);
+                    // must have the implementation class of the services it 'provides'.
+                    if (md.provides().stream().map(Provides::providers)
+                          .flatMap(List::stream)
+                          .filter(p -> jf.getEntry(toBinaryName(p)) == null)
+                          .peek(p -> error(formatMsg("error.missing.provider", p)))
+                          .count() != 0) {
+                        isValid = false;
+                        return;
+                    }
+                    this.md = md;
+                    this.mdName = miName;
+                    return;
+                }
+
+                if (!base.name().equals(md.name())) {
                     error(getMsg("error.validator.info.name.notequal"));
                     isValid = false;
                 }
-                if (!root.requires().equals(md.requires())) {
-                    Set<Requires> rootRequires = root.requires();
+                if (!base.requires().equals(md.requires())) {
+                    Set<Requires> baseRequires = base.requires();
                     for (Requires r : md.requires()) {
-                        if (rootRequires.contains(r))
+                        if (baseRequires.contains(r))
                             continue;
                         if (r.modifiers().contains(Requires.Modifier.TRANSITIVE)) {
                             error(getMsg("error.validator.info.requires.transitive"));
@@ -372,7 +372,7 @@
                             isValid = false;
                         }
                     }
-                    for (Requires r : rootRequires) {
+                    for (Requires r : baseRequires) {
                         Set<Requires> mdRequires = md.requires();
                         if (mdRequires.contains(r))
                             continue;
@@ -382,33 +382,37 @@
                         }
                     }
                 }
-                if (!root.exports().equals(md.exports())) {
+                if (!base.exports().equals(md.exports())) {
                     error(getMsg("error.validator.info.exports.notequal"));
                     isValid = false;
                 }
-                if (!root.opens().equals(md.opens())) {
+                if (!base.opens().equals(md.opens())) {
                     error(getMsg("error.validator.info.opens.notequal"));
                     isValid = false;
                 }
-                if (!root.provides().equals(md.provides())) {
+                if (!base.provides().equals(md.provides())) {
                     error(getMsg("error.validator.info.provides.notequal"));
                     isValid = false;
                 }
-                if (!root.mainClass().equals(md.mainClass())) {
+                if (!base.mainClass().equals(md.mainClass())) {
                     error(formatMsg("error.validator.info.manclass.notequal", je.getName()));
                     isValid = false;
                 }
-                if (!root.version().equals(md.version())) {
+                if (!base.version().equals(md.version())) {
                     error(formatMsg("error.validator.info.version.notequal", je.getName()));
                     isValid = false;
                 }
+            } catch (Exception x) {
+                error(x.getMessage() + " : " + miName);
+                this.isValid = false;
             }
-        } catch (IOException x) {
-            error(x.getMessage());
-            isValid = false;
         }
     }
 
+    private static boolean isPlatformModule(String name) {
+        return name.startsWith("java.") || name.startsWith("jdk.");
+    }
+
     private boolean checkInternalName(String entryName, String basename, String internalName) {
         String className = className(basename);
         if (internalName.equals(className)) {
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties
index 1228af5..fe77135 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar.properties
@@ -45,7 +45,7 @@
 	'e' flag and manifest with the 'Main-Class' attribute cannot be specified \n\
 	 together!
 error.bad.dflag=\
-        '-d, --print-module-descriptor' option requires no input file(s) to be specified: {0}
+        '-d, --describe-module' option requires no input file(s) to be specified: {0}
 error.bad.reason=\
         bad reason: {0}, must be one of deprecated, deprecated-for-removal, or incubating
 error.nosuch.fileordir=\
@@ -62,6 +62,8 @@
         Hashing module {0} dependences, unable to find module {1} on module path
 error.module.options.without.info=\
         One of --module-version or --hash-modules without module-info.class
+error.unable.derive.automodule=\
+        Unable to derive module descriptor for: {0}
 error.unexpected.module-info=\
         Unexpected module descriptor {0}
 error.module.descriptor.not.found=\
@@ -129,6 +131,8 @@
         added manifest
 out.added.module-info=\
         added module-info: {0}
+out.automodule=\
+        No module descriptor found. Derived automatic module.
 out.update.manifest=\
         updated manifest
 out.update.module-info=\
@@ -224,8 +228,8 @@
 \  -u, --update               Update an existing jar archive
 main.help.opt.main.extract=\
 \  -x, --extract              Extract named (or all) files from the archive
-main.help.opt.main.print-module-descriptor=\
-\  -d, --print-module-descriptor  Print the module descriptor
+main.help.opt.main.describe-module=\
+\  -d, --describe-module      Print the module descriptor, or automatic module name
 main.help.opt.any=\
 \ Operation modifiers valid in any mode:\n\
 \n\
@@ -238,6 +242,11 @@
 \                             of the jar (i.e. META-INF/versions/VERSION/)
 main.help.opt.any.verbose=\
 \  -v, --verbose              Generate verbose output on standard output
+main.help.opt.create=\
+\ Operation modifiers valid only in create mode:\n
+main.help.opt.create.normalize=\
+\  -n, --normalize            Normalize information in the new jar archive\n\
+\                             after creation
 main.help.opt.create.update=\
 \ Operation modifiers valid only in create and update mode:\n
 main.help.opt.create.update.main-class=\
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_de.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_de.properties
index a8892cb..df9aa3a 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_de.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_de.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 # questions.
 #
 
-error.multiple.main.operations=Sie k\u00F6nnen nicht mehrere "-cuxtid"-Optionen angeben
+error.multiple.main.operations=Es ist nicht m\u00F6glich, mehrere "-cuxtid"-Optionen anzugeben
 error.cant.open=\u00D6ffnen nicht m\u00F6glich: {0}
 error.illegal.option=Ung\u00FCltige Option: {0}
 error.unrecognized.option=Unbekannte Option: {0}
@@ -33,6 +33,8 @@
 error.bad.cflag=Kennzeichen "c" erfordert Angabe von Manifest oder Eingabedateien.
 error.bad.uflag=Kennzeichen "u" erfordert Angabe von Manifest, Kennzeichen "e" oder Eingabedateien.
 error.bad.eflag=Kennzeichen "e" und Manifest mit dem Attribut "Main-Class" k\u00F6nnen nicht zusammen angegeben\nwerden.
+error.bad.dflag=F\u00FCr die Option "-d, --print-module-descriptor" muss bzw. m\u00FCssen keine Eingabedatei(en) angegeben werden: {0}
+error.bad.reason=Schlechter Grund: {0}, Grund muss entweder "deprecated", "deprecated-for-removal" oder "incubating" sein
 error.nosuch.fileordir={0}: Datei oder Verzeichnis nicht vorhanden
 error.write.file=Fehler beim Schreiben in vorhandener JAR-Datei
 error.create.dir={0}: Verzeichnis konnte nicht erstellt werden
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=Moduldeskriptor nicht gefunden
 error.validator.info.without.root=module-info.class in einem versionierten Verzeichnis gefunden, in der Root ist module-info.class jedoch nicht vorhanden
 error.validator.info.name.notequal=module-info.class in einem versionierten Verzeichnis enth\u00E4lt falschen Namen
-error.validator.info.requires.public=module-info.class in einem versionierten Verzeichnis enth\u00E4lt zus\u00E4tzlichen "requires public"
+error.validator.info.requires.transitive=module-info.class in einem versionierten Verzeichnis enth\u00E4lt zus\u00E4tzlichen "requires transitive"
 error.validator.info.requires.added=module-info.class in einem versionierten Verzeichnis enth\u00E4lt zus\u00E4tzlichen "requires"
 error.validator.info.requires.dropped=module-info.class in einem versionierten Verzeichnis enth\u00E4lt fehlenden "requires"
 error.validator.info.exports.notequal=module-info.class in einem versionierten Verzeichnis enth\u00E4lt unterschiedliche "exports"
+error.validator.info.opens.notequal=module-info.class in einem versionierten Verzeichnis enth\u00E4lt unterschiedliche "opens"
 error.validator.info.provides.notequal=module-info.class in einem versionierten Verzeichnis enth\u00E4lt unterschiedliche "provides"
 error.invalid.versioned.module.attribute=Ung\u00FCltiges Moduldeskriptorattribut {0}
 error.missing.provider=Serviceprovider nicht gefunden: {0}
 error.release.value.notnumber=Release {0} nicht g\u00FCltig
 error.release.value.toosmall=Release {0} nicht g\u00FCltig, muss >= 9 sein
+error.release.unexpected.versioned.entry=Unerwarteter versionierte Eintrag {0} f\u00FCr Release {1}
 error.validator.jarfile.exception={0} kann nicht validiert werden: {1}
 error.validator.jarfile.invalid=ung\u00FCltige Multi-Release-JAR-Datei {0} gel\u00F6scht
 error.validator.bad.entry.name=Eintragsname hat das falsche Format, {0}
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version=Eintrag {0} weist eine Klassenversion auf, die mit einer fr\u00FCheren Version inkompatibel ist
 error.validator.different.api=Eintrag {0} enth\u00E4lt eine Klasse mit einer anderen API als in der fr\u00FCheren Version
 error.validator.names.mismatch=Eintrag {0} enth\u00E4lt eine Klasse mit dem internen Namen {1}, Namen stimmen nicht \u00FCberein
-warn.validator.identical.entry=Warnung - Eintrag {0} enth\u00E4lt eine Klasse, die mit einem Eintrag identisch ist, der bereits in der JAR-Datei enthalten ist
-warn.validator.resources.with.same.name=Warnung - Eintrag {0}, mehrere Ressourcen mit demselben Namen
-warn.validator.concealed.public.class=Warnung - Eintrag {0} ist eine \u00F6ffentliche Klasse in einem verdeckten Package, \nwenn diese JAR-Datei in den Classpath gesetzt wird, kommt es zu nicht kompatiblen \u00F6ffentlichen Schnittstellen
+warn.validator.identical.entry=Warnung: Eintrag {0} enth\u00E4lt eine Klasse, die mit\neinem bereits in der JAR-Datei enthaltenen Eintrag identisch ist
+warn.validator.resources.with.same.name=Warnung: Eintrag {0}, mehrere Ressourcen mit demselben Namen
+warn.validator.concealed.public.class=Warnung: Eintrag {0} ist eine \u00F6ffentliche Klasse\nin einem verdeckten Package. Wenn Sie diese JAR-Datei in den Classpath einf\u00FCgen, kommt es\nzu nicht kompatiblen \u00F6ffentlichen Schnittstellen
 out.added.manifest=Manifest wurde hinzugef\u00FCgt
 out.added.module-info=module-info hinzugef\u00FCgt: {0}
 out.update.manifest=Manifest wurde aktualisiert
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    Die Modulversion beim Erstellen eines modularen\n                             JAR-Archivs oder Aktualisieren eines nicht modularen JAR-Archivs
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN Berechnet und zeichnet die Hashes von Modulen auf, \n                             die mit einem bestimmten Muster \u00FCbereinstimmen, und direkt oder\n                             indirekt von einem modularen JAR-Archiv abh\u00E4ngen, das erstellt\n                             wird, oder einem nicht-modularen JAR-Archiv, das aktualisiert wird
 main.help.opt.create.update.module-path=\  -p, --module-path         Speicherort von Modulabh\u00E4ngigkeit zur Generierung\n                             von Hash
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  Wird aus der Standard-Root-Gruppe von Modulen ausgeschlossen
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     Hinweis f\u00FCr ein Tool, eine Warnung auszugeben,\n                             wenn das Modul aufgel\u00F6st wird, entweder "deprecated", "deprecated-for-removal"\n                             oder "incubating"
 main.help.opt.create.update.index=\ Vorgangsmodifikatoren, die nur im Erstellungs-, Aktualisierungs- und Indexgenerierungsmodus g\u00FCltig sind:\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          Nur speichern, keine ZIP-Komprimierung verwenden
 main.help.opt.other=\ Weitere Optionen:\n
 main.help.opt.other.help=\  -?, --help[:compat]        Diese Meldung oder optional die Kompatibilit\u00E4t, Hilfe angeben
+main.help.opt.other.help-extra=\      --help-extra           Hilfe zu zus\u00E4tzlichen Optionen
 main.help.opt.other.version=\      --version              Programmversion ausgeben
 main.help.postopt=\ Ein Archiv ist ein modulares JAR-Archiv, wenn der Moduldeskriptor "module-info.class"\n in der Root der angegebenen Verzeichnisse oder in der Root des JAR-Archivs selbst\n vorhanden ist. Die folgenden Vorg\u00E4nge sind nur g\u00FCltig, wenn Sie ein modulares JAR-Archiv\n erstellen oder ein vorhandenes nicht modulares JAR-Archiv aktualisieren: "--module-version",\n "--hash-modules" und "--modulepath".\n\n Obligatorische oder optionale Argumente zu langen Optionen sind auch f\u00FCr die jeweils\n zugeh\u00F6rigen kurzen Optionen obligatorisch oder optional.
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_es.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_es.properties
index 30f4e7e..b7fc849 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_es.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_es.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
 error.bad.cflag=El indicador 'c' necesita la especificaci\u00F3n de archivos de manifiesto o de entrada.
 error.bad.uflag=El indicador 'u' necesita la especificaci\u00F3n de archivos de manifiesto, de entrada o indicador 'e'.
 error.bad.eflag=El indicador 'e' y el manifiesto con el atributo 'Main-Class' no pueden especificarse \na la vez.
+error.bad.dflag=La opci\u00F3n ''-d, --print-module-descriptor'' no requiere especificar archivos de entrada: {0}
+error.bad.reason=Motivo err\u00F3neo: {0}, debe ser anticuado, anticuado para eliminaci\u00F3n o incubando
 error.nosuch.fileordir={0} : no existe tal archivo o directorio
 error.write.file=Error al escribir un archivo jar existente
 error.create.dir={0} : no se ha podido crear el directorio
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=No se ha encontrado el descriptor de m\u00F3dulo
 error.validator.info.without.root=Se ha encontrado module-info.class en un directorio con versi\u00F3n sin module-info.class en la ra\u00EDz
 error.validator.info.name.notequal=module-info.class en un directorio con versi\u00F3n contiene un nombre incorrecto
-error.validator.info.requires.public=module-info.class en un directorio con versiones contiene "requires public" adicionales
+error.validator.info.requires.transitive=module-info.class en un directorio con versiones contiene "requisitos transitivos" adicionales
 error.validator.info.requires.added=module-info.class en un directorio con versi\u00F3n contiene "requires" adicionales
 error.validator.info.requires.dropped=module-info.class en un directorio con versiones contiene "requires" que faltan
 error.validator.info.exports.notequal=module-info.class en un directorio con versiones contiene "exports" diferentes
+error.validator.info.opens.notequal=module-info.class en un directorio con versiones contiene "aportaciones" diferentes
 error.validator.info.provides.notequal=module-info.class en un directorio con versiones contiene "provides" diferentes
 error.invalid.versioned.module.attribute=Atributo de descriptor de m\u00F3dulo no v\u00E1lido {0}
 error.missing.provider=No se ha encontrado el proveedor de servicios: {0}
 error.release.value.notnumber=versi\u00F3n {0} no v\u00E1lida
 error.release.value.toosmall=versi\u00F3n {0} no v\u00E1lida, debe ser >= 9
+error.release.unexpected.versioned.entry=Entrada versionada inesperada {0} para la versi\u00F3n {1}
 error.validator.jarfile.exception=no puede validar {0}: {1}
 error.validator.jarfile.invalid=se ha suprimido el archivo jar de varias versiones {0} no v\u00E1lido
 error.validator.bad.entry.name=nombre de entrada con formato incorrecto, {0}
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version=la entrada {0} tiene una versi\u00F3n de clase no compatible con una versi\u00F3n anterior
 error.validator.different.api=la entrada {0} contiene una clase con una api diferente de la versi\u00F3n anterior
 error.validator.names.mismatch=la entrada {0} contiene una clase con un nombre interno {1}, los nombres no coinciden
-warn.validator.identical.entry=advertencia: la entrada {0} contiene una clase id\u00E9ntica a una entrada que ya est\u00E1 en el archivo jar
-warn.validator.resources.with.same.name=advertencia: la entrada {0} tiene varios recursos con el mismo nombre
-warn.validator.concealed.public.class=advertencia: la entrada {0} es una clase p\u00FAblica en un paquete oculto. \ncolocar este jar en la ruta de clase tendr\u00E1 como resultado interfaces p\u00FAblicas no compatibles
+warn.validator.identical.entry=Advertencia: la entrada {0} contiene una clase id\u00E9ntica a una entrada que ya est\u00E1 en el archivo jar
+warn.validator.resources.with.same.name=Advertencia: la entrada {0} tiene varios recursos con el mismo nombre
+warn.validator.concealed.public.class=Advertencia: la entrada {0} es una clase p\u00FAblica\nen un paquete oculto. Colocar este archivo jar en la ruta de clase tendr\u00E1 como resultado\ninterfaces p\u00FAblicas no compatibles
 out.added.manifest=manifiesto agregado
 out.added.module-info=module-info agregado: {0}
 out.update.manifest=manifiesto actualizado
@@ -81,7 +85,7 @@
 
 usage.compat=Interfaz de compatibilidad:\nSintaxis: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files] ...Opciones: \n    -c  crear nuevo archivo\n    -t  mostrar la tabla de contenido del archivo\n    -x   extraer el archivo mencionado (o todos) del archivo\n    -u  actualizar archivo existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre del archivo de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archivo de manifiesto especificado n    -n  realizar la normalizaci\u00F3n Pack200 despu\u00E9s de crear un archivo nuevo\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archivo jar ejecutable\n    -0  solo almacenar; no utilizar compresi\u00F3n ZIP\n    -P  conservar componentes iniciales '/' (ruta absoluta) y ".." (directorio principal) en los nombres de archivo\n    -M  no crear un archivo de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archivos jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente. \nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\n especifican en el mismo orden que los indicadores 'm', 'f' y 'e'. \n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n           archivos del directorio foo/ en 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
 
-main.usage.summary=Sintaxis: jar [OPTION...] [ [--release VERSION] [-C dir] files] ...
+main.usage.summary=Sintaxis: jar [OPTION...] [ [--release VERSION] [-C dir] archivos] ...
 main.usage.summary.try=Intente `jar --help' para obtener m\u00E1s informaci\u00F3n.
 
 main.help.preopt=Sintaxis: jar [OPTION...] [ [--release VERSION] [-C dir] files] ...\njar crea un archivo para las clases y recursos y puede manipular o\nrestaurar clases individuales o recursos de un archivo.\n\n Ejemplos:\n # Crear un archivo denominado classes.jar con dos archivos de clase:\n jar --create --file classes.jar Foo.class Bar.class\n # Crear un archivo con un manifiesto existente, con todos los archivos en foo/:\n jar --create --file classes.jar --manifest mymanifest -C foo/ .\n # Crear un archivo jar modular, donde el descriptor de m\u00F3dulo est\u00E1 en\n # classes/module-info.class:\n jar --create --file foo.jar --main-class com.foo.Main --module-version 1.0\n     -C foo/ classes resources\n # Actualizar un jar no modular en un jar modular:\n jar --update --file foo.jar --main-class com.foo.Main --module-version 1.0\n     -C foo/ module-info.class\n # Crear un archivo jar de varias versiones y colocar algunos archivos en el directorio META-INF/versions/9:\n jar --create --file mr.jar -C foo classes --release 9 -C foo9 classes
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    Versi\u00F3n del m\u00F3dulo, si se va a crear un archivo jar modular\n                             o actualizar un archivo jar no modular
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN Calcular y registrar los hash de m\u00F3dulos\n                             que coinciden con el patr\u00F3n proporcionado y que dependen\n                             directa o indirectamente de la creaci\u00F3n de un archivo jar modular\n                             o de la actualizaci\u00F3n de un archivo jar no modular
 main.help.opt.create.update.module-path=\  -p, --module-path          Ubicaci\u00F3n de la dependencia de m\u00F3dulo para generar\n                             el hash
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  Excluir del conjunto de m\u00F3dulos ra\u00EDz por defecto
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     Indicaci\u00F3n para que una herramienta emita una advertencia si el m\u00F3dulo\n                             se ha resuelto. Anticuado, anticuado para eliminaci\u00F3n\n                             o incubando
 main.help.opt.create.update.index=\ Modificadores de operaci\u00F3n v\u00E1lidos solo en el modo de creaci\u00F3n, actualizaci\u00F3n y generaci\u00F3n de \u00EDndice:\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          Solo almacenar; no usar compresi\u00F3n ZIP
 main.help.opt.other=\ Otras opciones:\n
 main.help.opt.other.help=\  -?, --help[:compat]        Utilice este valor, u opcionalmente la compatibilidad, ayuda
+main.help.opt.other.help-extra=\      --help-extra           Prestar ayuda en las opciones adicionales
 main.help.opt.other.version=\      --version              Imprimir versi\u00F3n del programa
 main.help.postopt=\ Un archivo es un jar modular si el descriptor de m\u00F3dulo, 'module-info.class', est\u00E1\n en la ra\u00EDz de los directorios proporcionados o en la ra\u00EDz del archivo jar.\n Las siguientes operaciones solo son v\u00E1lidas si se va a crear un archivo jar modular\n o se va a actualizar un jar existente no modular: '--module-version',\n '--hash-modules' y '--module-path'.\n\n Los argumentos obligatorios u opcionales en las opciones largas tambi\u00E9n son obligatorios u opcionales\n en cualquiera de las opciones cortas.
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_fr.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_fr.properties
index 5ef6743..cb44d50 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_fr.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_fr.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 # questions.
 #
 
-error.multiple.main.operations=Vous ne pouvez pas sp\u00E9cifier plus d'une option '-cuxtid'
+error.multiple.main.operations=Vous ne pouvez pas indiquer plus d'une option '-cuxtid'
 error.cant.open=impossible d''ouvrir : {0}
 error.illegal.option=Option non admise : {0}
 error.unrecognized.option=option non reconnue : {0}
@@ -33,6 +33,8 @@
 error.bad.cflag=L'indicateur c requiert la sp\u00E9cification d'un fichier manifeste ou d'un fichier d'entr\u00E9e.
 error.bad.uflag=L'indicateur u requiert la sp\u00E9cification d'un fichier manifeste, d'un fichier d'entr\u00E9e ou d'un indicateur e.
 error.bad.eflag=L'indicateur e et le fichier manifeste portant l'attribut Main-Class ne peuvent pas \u00EAtre sp\u00E9cifi\u00E9s \nensemble.
+error.bad.dflag=L''option ''-d, --print-module-descriptor'' ne requiert la sp\u00E9cification d''aucun fichier d''entr\u00E9e : {0}
+error.bad.reason=raison incorrecte : {0}, la valeur doit \u00EAtre deprecated, deprecated-for-removal ou incubating
 error.nosuch.fileordir={0} : fichier ou r\u00E9pertoire introuvable
 error.write.file=Erreur lors de l'\u00E9criture d'un fichier JAR existant
 error.create.dir={0} : impossible de cr\u00E9er le r\u00E9pertoire
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=Descripteur de module introuvable
 error.validator.info.without.root=module-info.class a \u00E9t\u00E9 d\u00E9tect\u00E9 dans un r\u00E9pertoire avec num\u00E9ro de version sans module-info.class dans la racine
 error.validator.info.name.notequal=module-info.class dans un r\u00E9pertoire avec num\u00E9ro de version contient un nom incorrect
-error.validator.info.requires.public=module-info.class dans un r\u00E9pertoire avec num\u00E9ro de version contient des mots-cl\u00E9s "requires public" suppl\u00E9mentaires
+error.validator.info.requires.transitive=module-info.class dans un r\u00E9pertoire avec num\u00E9ro de version contient des "exigences transitives" suppl\u00E9mentaires
 error.validator.info.requires.added=module-info.class dans un r\u00E9pertoire avec num\u00E9ro de version contient des mots-cl\u00E9s "requires" suppl\u00E9mentaires
 error.validator.info.requires.dropped=module-info.class dans un r\u00E9pertoire avec num\u00E9ro de version contient des mots-cl\u00E9s "requires" manquants
 error.validator.info.exports.notequal=module-info.class dans un r\u00E9pertoire avec num\u00E9ro de version contient des mots-cl\u00E9s "exports" diff\u00E9rents
+error.validator.info.opens.notequal=module-info.class dans un r\u00E9pertoire avec num\u00E9ro de version contient des "ouvertures" diff\u00E9rentes
 error.validator.info.provides.notequal=module-info.class dans un r\u00E9pertoire avec num\u00E9ro de version contient des mots-cl\u00E9s "provides" diff\u00E9rents
 error.invalid.versioned.module.attribute=Attribut de descripteur de module non valide {0}
 error.missing.provider=Fournisseur de services introuvable : {0}
 error.release.value.notnumber=version {0} non valide
 error.release.value.toosmall=version {0} non valide : elle doit \u00EAtre sup\u00E9rieure ou \u00E9gale \u00E0 9
+error.release.unexpected.versioned.entry=entr\u00E9e avec num\u00E9ro de version {0} inattendue pour la version {1}
 error.validator.jarfile.exception=Impossible de valider {0} : {1}
 error.validator.jarfile.invalid=fichier JAR multiversion non valide {0} supprim\u00E9
 error.validator.bad.entry.name=nom d''entr\u00E9e au format incorrect, {0}
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version=l''entr\u00E9e : {0} a une version de classe non compatible avec une version ant\u00E9rieure
 error.validator.different.api=l''entr\u00E9e : {0} contient une classe avec une API diff\u00E9rente de la version ant\u00E9rieure
 error.validator.names.mismatch=l''entr\u00E9e : {0} contient une classe avec le nom interne {1}, les noms ne concordent pas
-warn.validator.identical.entry=avertissement - l''entr\u00E9e : {0} contient une classe identique \u00E0 une entr\u00E9e qui se trouve d\u00E9j\u00E0 dans le fichier JAR
-warn.validator.resources.with.same.name=avertissement - entr\u00E9e : {0}, plusieurs ressources du m\u00EAme nom
-warn.validator.concealed.public.class=avertissement - l''entr\u00E9e {0} est une classe publique dans un package dissimul\u00E9, \nle placement de ce fichier JAR sur le chemin de classe g\u00E9n\u00E9rera des interfaces publiques incompatibles
+warn.validator.identical.entry=Avertissement : l''entr\u00E9e {0} contient une classe\nidentique \u00E0 une entr\u00E9e qui se trouve d\u00E9j\u00E0 dans le fichier JAR
+warn.validator.resources.with.same.name=Avertissement : entr\u00E9e {0}, plusieurs ressources du m\u00EAme nom
+warn.validator.concealed.public.class=Avertissement : l''entr\u00E9e {0} est une classe publique\ndans un package dissimul\u00E9, le placement de ce fichier JAR sur le\nchemin de classe g\u00E9n\u00E9rera des interfaces publiques incompatibles
 out.added.manifest=manifeste ajout\u00E9
 out.added.module-info=module-info ajout\u00E9 : {0}
 out.update.manifest=manifeste mis \u00E0 jour
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    Version de module lors de la cr\u00E9ation d'un fichier JAR\n                             modulaire ou de la mise \u00E0 jour d'un fichier JAR non modulaire
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN Calcule et enregistre les hachages des modules \n                             mis en correspondance d'apr\u00E8s le mod\u00E8le donn\u00E9 et d\u00E9pendant\n                             directement ou indirectement d'un fichier JAR modulaire\n                             en cours de cr\u00E9ation ou d'un fichier JAR non modulaire en cours de mise \u00E0 jour
 main.help.opt.create.update.module-path=\  -p, --module-path          Emplacement de la d\u00E9pendance de module pour la g\u00E9n\u00E9ration\n                             du hachage
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  Exclure de l'ensemble racine de modules par d\u00E9faut
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     Indication en fonction de laquelle un outil \u00E9met un avertissement si le module\n                             est r\u00E9solu. La valeur doit \u00EAtre deprecated, deprecated-for-removal,\n                             ou incubating
 main.help.opt.create.update.index=\ Modificateurs d'op\u00E9ration valides uniquement en modes create, update et generate-index :\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          Stocke uniquement ; n'utilise pas de compression ZIP
 main.help.opt.other=\ Autres options :\n
 main.help.opt.other.help=\  -?, --help[:compat]        Affiche l'aide ou \u00E9ventuellement la compatibilit\u00E9
+main.help.opt.other.help-extra=\      --help-extra           Affiche l'aide sur les options suppl\u00E9mentaires
 main.help.opt.other.version=\      --version              Imprime la version de programme
 main.help.postopt=\ Une archive est un fichier JAR modulaire si un descripteur de module, 'module-info.class', se\n trouve dans la racine des r\u00E9pertoires donn\u00E9s ou dans la racine de l'archive JAR\n elle-m\u00EAme. Les op\u00E9rations suivantes sont valides uniquement lors de la cr\u00E9ation d'un fichier JAR modulaire\n ou de la mise \u00E0 jour d'un fichier JAR non modulaire existant : '--module-version',\n '--hash-modules' et '--module-path'.\n\n Les arguments obligatoires ou facultatifs pour les options longues sont \u00E9galement obligatoires ou facultatifs\n pour toute option courte correspondante.
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_it.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_it.properties
index 00925b8..67bc8ba 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_it.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_it.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
 error.bad.cflag=Per il flag 'c' \u00E8 necessario specificare file manifest o di input.
 error.bad.uflag=Per il flag 'u' \u00E8 necessario specificare il flag 'e' oppure file manifest o di input.
 error.bad.eflag=Il flag 'e' e il manifest con l'attributo 'Main-Class' non possono essere specificati\ninsieme.
+error.bad.dflag=Per l''opzione ''-d, --print-module-descriptor'' non \u00E8 necessario specificare alcun file di input: {0}
+error.bad.reason=Motivo non valido: {0}. Deve essere deprecated, deprecated-for-removal o incubating
 error.nosuch.fileordir={0} : file o directory inesistente
 error.write.file=Errore durante la scrittura del file jar esistente
 error.create.dir={0} : impossibile creare la directory
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=Descrittore di modulo non trovato
 error.validator.info.without.root=module-info.class trovato in una directory con controllo delle versioni senza module-info.class nella radice
 error.validator.info.name.notequal=module-info.class in una directory con controllo delle versioni contiene un nome errato
-error.validator.info.requires.public=module-info.class in una directory con controllo delle versioni contiene valori "requires public" aggiuntivi
+error.validator.info.requires.transitive=module-info.class in una directory con controllo delle versioni contiene valori "requires transitive" aggiuntivi
 error.validator.info.requires.added=module-info.class in una directory con controllo delle versioni contiene valori "requires" aggiuntivi
 error.validator.info.requires.dropped=module-info.class in una directory con controllo delle versioni contiene valori "requires" mancanti
 error.validator.info.exports.notequal=module-info.class in una directory con controllo delle versioni contiene "exports" differenti
+error.validator.info.opens.notequal=module-info.class in una directory con controllo delle versioni contiene valori "opens" differenti
 error.validator.info.provides.notequal=module-info.class in una directory con controllo delle versioni contiene valori "provides" differenti
 error.invalid.versioned.module.attribute=Attributo descrittore del modulo {0} non valido.
 error.missing.provider=Provider di servizi non trovato: {0}
 error.release.value.notnumber=release {0} non valida
 error.release.value.toosmall=la release {0} non \u00E8 valida: deve essere >= 9
+error.release.unexpected.versioned.entry=voce con controllo delle versioni non prevista {0} per la release {1}
 error.validator.jarfile.exception=impossibile convalidare {0}: {1}
 error.validator.jarfile.invalid=file jar {0} con pi\u00F9 release non valido eliminato
 error.validator.bad.entry.name=nome di voce {0} con formato non valido
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version=la voce {0} ha una versione incompatibile con una versione precedente
 error.validator.different.api=la voce {0} contiene una classe con un''API diversa dalla versione precedente
 error.validator.names.mismatch=la voce {0} contiene una classe con nome interno {1}. I nomi non corrispondono
-warn.validator.identical.entry=avvertenza: la voce {0} contiene una classe identica a una voce gi\u00E0 presente nel file jar
-warn.validator.resources.with.same.name=avvertenza: voce {0}. Pi\u00F9 risorse con lo stesso nome
-warn.validator.concealed.public.class=avvertenza: la voce {0} \u00E8 una classe pubblica in un package nascosto. \nIl posizionamento di questo file jar nel classpath generer\u00E0 interfacce pubbliche incompatibili
+warn.validator.identical.entry=Avvertenza: la voce {0} contiene una classe\nidentica a una voce gi\u00E0 presente nel file jar
+warn.validator.resources.with.same.name=Avvertenza: voce {0}. Pi\u00F9 risorse con lo stesso nome
+warn.validator.concealed.public.class=Avvertenza: la voce {0} \u00E8 una classe pubblica\nin un package nascosto. Il posizionamento di questo file jar nel classpath\ngenerer\u00E0 interfacce pubbliche incompatibili
 out.added.manifest=aggiunto manifest
 out.added.module-info=aggiunto module-info: {0}
 out.update.manifest=aggiornato manifest
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    Versione del modulo utilizzata durante la creazione di un file\n                             jar modulare o l'aggiornamento di un file jar non modulare
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN Calcola e registra gli hash dei moduli \n                             corrispondenti in base al pattern specificato e dipendenti\n                             in modo diretto o indiretto dalla creazione di un file jar modulare\n                             o dall'aggiornamento di un file jar non modulare
 main.help.opt.create.update.module-path=\  -p, --module-path          Posizione della dipendenza del modulo per la generazione\n                             dell'hash
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  Esclude dal set radice predefinito dei moduli
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     Suggerimento per uno strumento per l'emissione di un'avvertenza se il modulo\n                             viene risolto. Pu\u00F2 essere deprecated, deprecated-for-removal\n                             o incubating
 main.help.opt.create.update.index=\ Modificatori di funzionamento validi solo nella modalit\u00E0 di creazione, aggiornamento e di generazione dell'indice:\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          Solo per la memorizzazione. Non utilizza alcuna compressione ZIP
 main.help.opt.other=\ Altre opzioni:\n
 main.help.opt.other.help=\  -?, --help[:compat]        Fornisce questa Guida o facoltativamente la Guida sulla compatibilit\u00E0
+main.help.opt.other.help-extra=\      --help-extra           Fornisce la Guida per le opzioni non standard
 main.help.opt.other.version=\      --version              Stampa la versione del programma
 main.help.postopt=\ Un archivio \u00E8 un file jar modulare se un descrittore di modulo, 'module-info.class', si trova\n nella directory radice delle directory specificate o nella radice dell'archivio jar\n stesso. Le operazioni seguenti sono valide solo durante la creazione di un file jar modulare\n o l'aggiornamento di un file jar non modulare esistente: '--module-version',\n '--hash-modules' e '--module-path'.\n\n Gli argomenti obbligatori o facoltativi per le opzioni lunghe sono obbligatori\n  o facoltativi anche per le opzioni brevi corrispondenti.
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties
index c974444..cdd08b3 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 # questions.
 #
 
-error.multiple.main.operations=\u8907\u6570\u306E'-cuxtid'\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093
+error.multiple.main.operations=\u8907\u6570\u306E'cuxtid'\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093
 error.cant.open={0}\u3092\u958B\u304F\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093
 error.illegal.option=\u4E0D\u6B63\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}
 error.unrecognized.option=\u8A8D\u8B58\u3055\u308C\u306A\u3044\u30AA\u30D7\u30B7\u30E7\u30F3: {0}
@@ -33,6 +33,8 @@
 error.bad.cflag=\u30D5\u30E9\u30B0'c'\u3067\u306F\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u307E\u305F\u306F\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u6307\u5B9A\u304C\u5FC5\u8981\u3067\u3059\u3002
 error.bad.uflag=\u30D5\u30E9\u30B0'u'\u3067\u306F\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304B'e'\u30D5\u30E9\u30B0\u3001\u307E\u305F\u306F\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u6307\u5B9A\u304C\u5FC5\u8981\u3067\u3059\u3002
 error.bad.eflag='e'\u30D5\u30E9\u30B0\u3068'Main-Class'\u5C5E\u6027\u3092\u6301\u3064\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u306F\u540C\u6642\u306B\n\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
+error.bad.dflag=''-d, --print-module-descriptor''\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u306F\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u6307\u5B9A\u306F\u4E0D\u8981\u3067\u3059: {0}
+error.bad.reason=\u4E0D\u6B63\u306A\u7406\u7531: {0}\u3001\u975E\u63A8\u5968\u3001\u524A\u9664\u4E88\u5B9A\u306E\u975E\u63A8\u5968\u307E\u305F\u306F\u5B9F\u9A13\u7684\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 error.nosuch.fileordir={0}\u3068\u3044\u3046\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u3042\u308A\u307E\u305B\u3093
 error.write.file=\u65E2\u5B58jar\u30D5\u30A1\u30A4\u30EB\u306E\u66F8\u8FBC\u307F\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F
 error.create.dir=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 error.validator.info.without.root=module-info.class\u304C\u3001\u30EB\u30FC\u30C8\u306Bmodule-info.class\u306E\u306A\u3044\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u3055\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u898B\u3064\u304B\u308A\u307E\u3057\u305F
 error.validator.info.name.notequal=\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u3055\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Emodule-info.class\u306B\u6B63\u3057\u304F\u306A\u3044\u540D\u524D\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
-error.validator.info.requires.public=\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u3055\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Emodule-info.class\u306B\u8FFD\u52A0\u306E"requires public"\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
+error.validator.info.requires.transitive=\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Emodule-info.class\u306B\u8FFD\u52A0\u306E"requires transitive"\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
 error.validator.info.requires.added=\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u3055\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Emodule-info.class\u306B\u8FFD\u52A0\u306E"requires"\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
 error.validator.info.requires.dropped=\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u3055\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Emodule-info.class\u306B\u6B20\u843D\u3057\u3066\u3044\u308B"requires"\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
 error.validator.info.exports.notequal=\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u3055\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Emodule-info.class\u306B\u7570\u306A\u308B"exports"\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
+error.validator.info.opens.notequal=\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Emodule-info.class\u306B\u7570\u306A\u308B"opens"\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
 error.validator.info.provides.notequal=\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u3055\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Emodule-info.class\u306B\u7570\u306A\u308B"provides"\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
 error.invalid.versioned.module.attribute=\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u5C5E\u6027{0}\u304C\u7121\u52B9\u3067\u3059
 error.missing.provider=\u30B5\u30FC\u30D3\u30B9\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 error.release.value.notnumber=\u30EA\u30EA\u30FC\u30B9{0}\u306F\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093
 error.release.value.toosmall=\u30EA\u30EA\u30FC\u30B9{0}\u306F\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u30029\u4EE5\u4E0A\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
+error.release.unexpected.versioned.entry=\u30EA\u30EA\u30FC\u30B9{1}\u3067\u4E88\u671F\u3057\u306A\u3044\u30D0\u30FC\u30B8\u30E7\u30CB\u30F3\u30B0\u6E08\u30A8\u30F3\u30C8\u30EA{0}
 error.validator.jarfile.exception={0}\u3092\u691C\u8A3C\u3067\u304D\u307E\u305B\u3093: {1}
 error.validator.jarfile.invalid=\u7121\u52B9\u306A\u30DE\u30EB\u30C1\u30EA\u30EA\u30FC\u30B9jar\u30D5\u30A1\u30A4\u30EB{0}\u304C\u524A\u9664\u3055\u308C\u307E\u3057\u305F
 error.validator.bad.entry.name=\u30A8\u30F3\u30C8\u30EA\u540D\u304C\u4E0D\u6B63\u3067\u3059: {0}
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version=\u30A8\u30F3\u30C8\u30EA: {0}\u306B\u306F\u3001\u4EE5\u524D\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3068\u4E92\u63DB\u6027\u306E\u306A\u3044\u30AF\u30E9\u30B9\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u542B\u307E\u308C\u307E\u3059
 error.validator.different.api=\u30A8\u30F3\u30C8\u30EA: {0}\u306B\u306F\u3001\u4EE5\u524D\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3068\u306F\u7570\u306A\u308BAPI\u3092\u6301\u3064\u30AF\u30E9\u30B9\u304C\u542B\u307E\u308C\u307E\u3059
 error.validator.names.mismatch=\u30A8\u30F3\u30C8\u30EA: {0}\u306B\u306F\u3001\u5185\u90E8\u540D{1}\u3092\u6301\u3064\u30AF\u30E9\u30B9\u304C\u542B\u307E\u308C\u307E\u3059\u304C\u3001\u540D\u524D\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093
-warn.validator.identical.entry=\u8B66\u544A - \u30A8\u30F3\u30C8\u30EA: {0}\u306B\u306F\u3001jar\u306B\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u30A8\u30F3\u30C8\u30EA\u3068\u540C\u3058\u30AF\u30E9\u30B9\u304C\u542B\u307E\u308C\u307E\u3059
-warn.validator.resources.with.same.name=\u8B66\u544A - \u30A8\u30F3\u30C8\u30EA: {0}\u3001\u540C\u3058\u540D\u524D\u3092\u6301\u3064\u8907\u6570\u306E\u30EA\u30BD\u30FC\u30B9
-warn.validator.concealed.public.class=\u8B66\u544A - \u30A8\u30F3\u30C8\u30EA{0}\u306F\u3001\u96A0\u3057\u30D1\u30C3\u30B1\u30FC\u30B8\u5185\u306Epublic\u30AF\u30E9\u30B9\u3067\u3059\u3002 \n\u30AF\u30E9\u30B9\u30D1\u30B9\u306B\u3053\u306Ejar\u3092\u914D\u7F6E\u3059\u308B\u3068\u3001\u4E92\u63DB\u6027\u306E\u306A\u3044public\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304C\u751F\u6210\u3055\u308C\u307E\u3059
+warn.validator.identical.entry=\u8B66\u544A : \u30A8\u30F3\u30C8\u30EA{0}\u306B\u306F\u3001jar\u306B\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\n\u30A8\u30F3\u30C8\u30EA\u3068\u540C\u3058\u30AF\u30E9\u30B9\u304C\u542B\u307E\u308C\u307E\u3059
+warn.validator.resources.with.same.name=\u8B66\u544A : \u30A8\u30F3\u30C8\u30EA{0}\u3001\u540C\u3058\u540D\u524D\u3092\u6301\u3064\u8907\u6570\u306E\u30EA\u30BD\u30FC\u30B9
+warn.validator.concealed.public.class=\u8B66\u544A : \u30A8\u30F3\u30C8\u30EA{0}\u306F\u3001\u96A0\u3057\u30D1\u30C3\u30B1\u30FC\u30B8\u5185\u306Epublic\u30AF\u30E9\u30B9\u3067\u3059\u3002\n\u30AF\u30E9\u30B9\u30D1\u30B9\u306B\u3053\u306Ejar\u3092\u914D\u7F6E\u3059\u308B\u3068\u3001\u4E92\u63DB\u6027\u306E\u306A\u3044\npublic\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304C\u751F\u6210\u3055\u308C\u307E\u3059
 out.added.manifest=\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F
 out.added.module-info=module-info\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F: {0}
 out.update.manifest=\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    \u30E2\u30B8\u30E5\u30E9jar\u306E\u4F5C\u6210\u6642\u307E\u305F\u306F\u975E\u30E2\u30B8\u30E5\u30E9jar\u306E\u66F4\u65B0\u6642\u306E\n                             \u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN \u30E2\u30B8\u30E5\u30E9jar\u306E\u4F5C\u6210\u6642\u307E\u305F\u306F\u975E\u30E2\u30B8\u30E5\u30E9jar\u306E\u66F4\u65B0\u6642\u306B\n                             \u6307\u5B9A\u306E\u30D1\u30BF\u30FC\u30F3\u306B\u4E00\u81F4\u3057\u3001\u76F4\u63A5\u307E\u305F\u306F\u9593\u63A5\u7684\u306B\n                             \u4F9D\u5B58\u3057\u3066\u3044\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30CF\u30C3\u30B7\u30E5\u3092\n                             \u8A08\u7B97\u304A\u3088\u3073\u8A18\u9332\u3057\u307E\u3059
 main.help.opt.create.update.module-path=\  -p\u3001--module-path          \u30CF\u30C3\u30B7\u30E5\u3092\u751F\u6210\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u4F9D\u5B58\u6027\n                             \u306E\u5834\u6240
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30EB\u30FC\u30C8\u8A2D\u5B9A\u304B\u3089\u9664\u5916\u3057\u307E\u3059
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     \u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306F\u3001\u8B66\u544A\u3092\u767A\u884C\u3059\u308B\n                             \u30C4\u30FC\u30EB\u306E\u30D2\u30F3\u30C8\u3002\u975E\u63A8\u5968\u3001\u524A\u9664\u4E88\u5B9A\u306E\u975E\u63A8\u5968\u307E\u305F\u306F\n                             \u5B9F\u9A13\u7684\u306E\u3044\u305A\u308C\u304B
 main.help.opt.create.update.index=\ \u4F5C\u6210\u3001\u66F4\u65B0\u304A\u3088\u3073\u7D22\u5F15\u751F\u6210\u30E2\u30FC\u30C9\u3067\u306E\u307F\u6709\u52B9\u306A\u64CD\u4F5C\u4FEE\u98FE\u5B50:\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u307E\u305B\u3093
 main.help.opt.other=\ \u305D\u306E\u4ED6\u306E\u30AA\u30D7\u30B7\u30E7\u30F3:\n
 main.help.opt.other.help=\  -?, --help[:compat]        \u3053\u308C(\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u4E92\u63DB\u6027)\u3092help\u306B\u6307\u5B9A\u3057\u307E\u3059
+main.help.opt.other.help-extra=\      --help-extra           \u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30D8\u30EB\u30D7\u3092\u63D0\u4F9B\u3057\u307E\u3059
 main.help.opt.other.version=\      --version              \u30D7\u30ED\u30B0\u30E9\u30E0\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u307E\u3059
 main.help.postopt=\ \u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF'module-info.class'\u304C\u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30EB\u30FC\u30C8\u307E\u305F\u306F\n jar\u30A2\u30FC\u30AB\u30A4\u30D6\u81EA\u4F53\u306E\u30EB\u30FC\u30C8\u306B\u3042\u308B\u5834\u5408\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u306F\u30E2\u30B8\u30E5\u30E9jar\u3067\u3059\u3002\n \u6B21\u306E\u64CD\u4F5C\u306F\u3001\u30E2\u30B8\u30E5\u30E9jar\u306E\u4F5C\u6210\u6642\u307E\u305F\u306F\u65E2\u5B58\u306E\u975E\u30E2\u30B8\u30E5\u30E9jar\u306E\u66F4\u65B0\u6642\u306B\n \u306E\u307F\u6709\u52B9\u3067\u3059:  '--module-version'\u3001\n '--hash-modules'\u304A\u3088\u3073'--module-path'\u3002\n\n \u30ED\u30F3\u30B0\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3078\u306E\u5FC5\u9808\u307E\u305F\u306F\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u30B7\u30E7\u30FC\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\n \u306B\u5BFE\u3057\u3066\u3082\u5FC5\u9808\u307E\u305F\u306F\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306A\u308A\u307E\u3059\u3002
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ko.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ko.properties
index 8d1f3c0..93b9a5f 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ko.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_ko.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
 error.bad.cflag='c' \uD50C\uB798\uADF8\uB97C \uC0AC\uC6A9\uD558\uB824\uBA74 Manifest \uB610\uB294 \uC785\uB825 \uD30C\uC77C\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4!
 error.bad.uflag='u' \uD50C\uB798\uADF8\uB97C \uC0AC\uC6A9\uD558\uB824\uBA74 Manifest, 'e' \uD50C\uB798\uADF8 \uB610\uB294 \uC785\uB825 \uD30C\uC77C\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4!
 error.bad.eflag='e' \uD50C\uB798\uADF8 \uBC0F Manifest\uB97C 'Main-Class' \uC18D\uC131\uACFC \uD568\uAED8 \uC9C0\uC815\uD560 \uC218\n\uC5C6\uC2B5\uB2C8\uB2E4!
+error.bad.dflag=''-d, --print-module-descriptor'' \uC635\uC158\uC5D0\uB294 \uC785\uB825 \uD30C\uC77C\uC744 \uC9C0\uC815\uD560 \uD544\uC694\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. {0}
+error.bad.reason=\uC798\uBABB\uB41C \uC6D0\uC778: {0}\uC740(\uB294) deprecated, deprecated-for-removal \uB610\uB294 incubating \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4.
 error.nosuch.fileordir={0}: \uD574\uB2F9 \uD30C\uC77C \uB610\uB294 \uB514\uB809\uD1A0\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
 error.write.file=\uAE30\uC874 jar \uD30C\uC77C\uC5D0 \uC4F0\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.
 error.create.dir={0}: \uB514\uB809\uD1A0\uB9AC\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=\uBAA8\uB4C8 \uAE30\uC220\uC790\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C
 error.validator.info.without.root=\uB8E8\uD2B8\uC5D0\uC11C module-info.class \uC5C6\uC774 \uBC84\uC804 \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uC5D0\uC11C module-info.class\uAC00 \uBC1C\uACAC\uB428
 error.validator.info.name.notequal=\uBC84\uC804 \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uC758 module-info.class\uC5D0 \uC798\uBABB\uB41C \uC774\uB984\uC774 \uD3EC\uD568\uB428
-error.validator.info.requires.public=\uBC84\uC804 \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uC758 module-info.class\uC5D0 \uCD94\uAC00 "requires public" \uD56D\uBAA9\uC774 \uD3EC\uD568\uB428
+error.validator.info.requires.transitive=\uBC84\uC804 \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uC758 module-info.class\uC5D0 \uCD94\uAC00 "requires transitive" \uD56D\uBAA9\uC774 \uD3EC\uD568\uB428
 error.validator.info.requires.added=\uBC84\uC804 \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uC758 module-info.class\uC5D0 \uCD94\uAC00 "requires" \uD56D\uBAA9\uC774 \uD3EC\uD568\uB428
 error.validator.info.requires.dropped=\uBC84\uC804 \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uC758 module-info.class\uC5D0 \uB204\uB77D\uB41C "requires" \uD56D\uBAA9\uC774 \uD3EC\uD568\uB428
 error.validator.info.exports.notequal=\uBC84\uC804 \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uC758 module-info.class\uC5D0 \uB2E4\uB978 "exports" \uD56D\uBAA9\uC774 \uD3EC\uD568\uB428
+error.validator.info.opens.notequal=\uBC84\uC804 \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uC758 module-info.class\uC5D0 \uB2E4\uB978 "opens" \uD56D\uBAA9\uC774 \uD3EC\uD568\uB428
 error.validator.info.provides.notequal=\uBC84\uC804 \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uC758 module-info.class\uC5D0 \uB2E4\uB978 "provides" \uD56D\uBAA9\uC774 \uD3EC\uD568\uB428
 error.invalid.versioned.module.attribute=\uBD80\uC801\uD569\uD55C \uBAA8\uB4C8 \uAE30\uC220\uC790 \uC18D\uC131 {0}
 error.missing.provider=\uC11C\uBE44\uC2A4 \uC81C\uACF5\uC790\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C: {0}
 error.release.value.notnumber=\uB9B4\uB9AC\uC2A4 {0}\uC774(\uAC00) \uBD80\uC801\uD569\uD568
 error.release.value.toosmall=\uB9B4\uB9AC\uC2A4 {0}\uC774(\uAC00) \uBD80\uC801\uD569\uD568. 9 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.
+error.release.unexpected.versioned.entry={1} \uB9B4\uB9AC\uC2A4\uC5D0 \uB300\uD574 \uC608\uC0C1\uCE58 \uC54A\uC740 \uBC84\uC804\uC774 \uC9C0\uC815\uB41C \uD56D\uBAA9 {0}
 error.validator.jarfile.exception={0}\uC744(\uB97C) \uAC80\uC99D\uD560 \uC218 \uC5C6\uC74C: {1}
 error.validator.jarfile.invalid=\uBD80\uC801\uD569\uD55C \uB2E4\uC911 \uB9B4\uB9AC\uC2A4 jar \uD30C\uC77C {0}\uC774(\uAC00) \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
 error.validator.bad.entry.name=\uD56D\uBAA9 \uC774\uB984 \uD615\uC2DD\uC774 \uC798\uBABB\uB428, {0}
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version={0} \uD56D\uBAA9\uC5D0 \uC774\uC804 \uBC84\uC804\uACFC \uD638\uD658\uB418\uC9C0 \uC54A\uB294 \uD074\uB798\uC2A4 \uBC84\uC804\uC774 \uC788\uC2B5\uB2C8\uB2E4.
 error.validator.different.api={0} \uD56D\uBAA9\uC5D0 \uC774\uC804 \uBC84\uC804\uACFC \uB2E4\uB978 api\uB97C \uAC00\uC9C4 \uD074\uB798\uC2A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4.
 error.validator.names.mismatch={0} \uD56D\uBAA9\uC5D0 \uB0B4\uBD80 \uC774\uB984 {1}\uC744(\uB97C) \uAC00\uC9C4 \uD074\uB798\uC2A4\uAC00 \uC788\uC9C0\uB9CC \uC774\uB984\uC774 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
-warn.validator.identical.entry=\uACBD\uACE0 - {0} \uD56D\uBAA9\uC5D0 \uC774\uBBF8 jar\uC5D0 \uC788\uB294 \uD56D\uBAA9\uACFC \uB3D9\uC77C\uD55C \uD074\uB798\uC2A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4.
-warn.validator.resources.with.same.name=\uACBD\uACE0 - {0} \uD56D\uBAA9\uC5D0 \uB3D9\uC77C\uD55C \uC774\uB984\uC758 \uC5EC\uB7EC \uB9AC\uC18C\uC2A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4.
-warn.validator.concealed.public.class=\uACBD\uACE0 - {0} \uD56D\uBAA9\uC740 \uC228\uACA8\uC9C4 \uD328\uD0A4\uC9C0\uC5D0 \uC788\uB294 \uACF5\uC6A9 \uD074\uB798\uC2A4\uC785\uB2C8\uB2E4. \n\uC774 jar\uB97C \uD074\uB798\uC2A4 \uACBD\uB85C\uC5D0 \uBC30\uCE58\uD558\uBA74 \uACF5\uC6A9 \uC778\uD130\uD398\uC774\uC2A4\uAC00 \uD638\uD658\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
+warn.validator.identical.entry=\uACBD\uACE0: {0} \uD56D\uBAA9\uC5D0 \uC774\uBBF8 jar\uC5D0 \uC788\uB294 \uD56D\uBAA9\uACFC\n\uB3D9\uC77C\uD55C \uD074\uB798\uC2A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4.
+warn.validator.resources.with.same.name=\uACBD\uACE0: {0} \uD56D\uBAA9\uC5D0 \uB3D9\uC77C\uD55C \uC774\uB984\uC758 \uC5EC\uB7EC \uB9AC\uC18C\uC2A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4.
+warn.validator.concealed.public.class=\uACBD\uACE0: {0} \uD56D\uBAA9\uC740 \uC228\uACA8\uC9C4 \uD328\uD0A4\uC9C0\uC5D0 \uC788\uB294\n\uACF5\uC6A9 \uD074\uB798\uC2A4\uC785\uB2C8\uB2E4. \uC774 jar\uC744 \uD074\uB798\uC2A4 \uACBD\uB85C\uC5D0 \uBC30\uCE58\uD558\uBA74\n\uACF5\uC6A9 \uC778\uD130\uD398\uC774\uC2A4\uAC00 \uD638\uD658\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
 out.added.manifest=Manifest\uB97C \uCD94\uAC00\uD568
 out.added.module-info=\uCD94\uAC00\uB41C \uBAA8\uB4C8 \uC815\uBCF4: {0}
 out.update.manifest=Manifest\uB97C \uC5C5\uB370\uC774\uD2B8\uD568
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    \uBAA8\uB4C8\uD615 jar\uB97C \uC0DD\uC131\uD558\uAC70\uB098 \uBE44\uBAA8\uB4C8 jar\uB97C\n                             \uC5C5\uB370\uC774\uD2B8\uD560 \uB54C \uBAA8\uB4C8 \uBC84\uC804\uC785\uB2C8\uB2E4.
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN \uC0DD\uC131 \uC911\uC778 \uBAA8\uB4C8\uD615 jar \uB610\uB294 \uC5C5\uB370\uC774\uD2B8 \uC911\uC778 \uBE44\uBAA8\uB4C8 jar\uC5D0 \n                             \uC9C1\uC811 \uB610\uB294 \uAC04\uC811\uC801\uC73C\uB85C \uC758\uC874\uD558\uACE0 \uC8FC\uC5B4\uC9C4 \uD328\uD134\uACFC \uC77C\uCE58\uD558\uB294\n                             \uBAA8\uB4C8\uC758 \uD574\uC2DC\uB97C \uCEF4\uD4E8\uD2B8\uD558\uACE0\n                             \uAE30\uB85D\uD569\uB2C8\uB2E4.
 main.help.opt.create.update.module-path=\  -p, --module-path          \uD574\uC2DC\uB97C \uC0DD\uC131\uD558\uAE30 \uC704\uD55C \uBAA8\uB4C8 \uC885\uC18D\uC131\uC758\n                             \uC704\uCE58\uC785\uB2C8\uB2E4.
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  \uBAA8\uB4C8\uC758 \uAE30\uBCF8 \uB8E8\uD2B8 \uC9D1\uD569\uC5D0\uC11C \uC81C\uC678\uD569\uB2C8\uB2E4.
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     \uBAA8\uB4C8\uC774 \uD574\uACB0\uB41C \uACBD\uC6B0 \uACBD\uACE0\uB97C \uC2E4\uD589\uD560 \uD234\uC5D0 \uB300\uD55C\n                             \uD78C\uD2B8\uB85C, deprecated, deprecated-for-removal,\n                             \uB610\uB294 incubating \uC911 \uD558\uB098\uC785\uB2C8\uB2E4.
 main.help.opt.create.update.index=\ \uC0DD\uC131, \uC5C5\uB370\uC774\uD2B8 \uBC0F generate-index \uBAA8\uB4DC\uC5D0\uC11C\uB9CC \uC801\uD569\uD55C \uC791\uC5C5 \uC218\uC815\uC790:\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          \uC800\uC7A5 \uC804\uC6A9\uC774\uBA70 ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
 main.help.opt.other=\ \uAE30\uD0C0 \uC635\uC158:\n
 main.help.opt.other.help=\  -?, --help[:compat]        \uC774 \uB3C4\uC6C0\uB9D0(\uB610\uB294 \uC120\uD0DD\uC801\uC73C\uB85C \uD638\uD658\uC131)\uC744 \uC81C\uACF5\uD569\uB2C8\uB2E4.
+main.help.opt.other.help-extra=\      --help-extra           \uCD94\uAC00 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC81C\uACF5\uD569\uB2C8\uB2E4.
 main.help.opt.other.version=\      --version              \uD504\uB85C\uADF8\uB7A8 \uBC84\uC804\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.
 main.help.postopt=\ \uC544\uCE74\uC774\uBE0C\uB294 \uBAA8\uB4C8 \uAE30\uC220\uC790 'module-info.class'\uAC00 \uC8FC\uC5B4\uC9C4 \uB514\uB809\uD1A0\uB9AC\uC758\n \uB8E8\uD2B8 \uB610\uB294 jar \uC544\uCE74\uC774\uBE0C \uC790\uCCB4\uC758 \uB8E8\uD2B8\uC5D0 \uC704\uCE58\uD55C \uACBD\uC6B0 \uBAA8\uB4C8\uD615 jar\uC785\uB2C8\uB2E4.\n \uB2E4\uC74C \uC791\uC5C5\uC740 \uBAA8\uB4C8\uD615 jar\uB97C \uC0DD\uC131\uD558\uAC70\uB098 \uAE30\uC874 \uBE44\uBAA8\uB4C8 jar\uB97C\n \uC5C5\uB370\uC774\uD2B8\uD560 \uB54C\uB9CC \uC801\uD569\uD569\uB2C8\uB2E4. '--module-version',\n '--hash-modules' \uBC0F '--module-path'.\n\n long \uC635\uC158\uC758 \uD544\uC218 \uB610\uB294 \uC120\uD0DD\uC801 \uC778\uC218\uB294 \uD574\uB2F9\uD558\uB294 short \uC635\uC158\uC5D0 \uB300\uD574\uC11C\uB3C4\n \uD544\uC218 \uB610\uB294 \uC120\uD0DD\uC801\uC785\uB2C8\uB2E4.
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_pt_BR.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_pt_BR.properties
index 647ad8d..be961c4 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_pt_BR.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_pt_BR.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 # questions.
 #
 
-error.multiple.main.operations=Voc\u00EA n\u00E3o pode especificar mais de uma das op\u00E7\u00F5es '-cuxtid'
+error.multiple.main.operations=Voc\u00EA n\u00E3o pode especificar mais de um op\u00E7\u00E3o '-cuxtid'
 error.cant.open=n\u00E3o \u00E9 poss\u00EDvel abrir: {0}
 error.illegal.option=Op\u00E7\u00E3o inv\u00E1lida: {0}
 error.unrecognized.option=op\u00E7\u00E3o n\u00E3o reconhecida : {0}
@@ -33,6 +33,8 @@
 error.bad.cflag=flag 'c' requer que os arquivos de manifesto ou entrada sejam especificados!
 error.bad.uflag=o flag 'u' requer que arquivos de manifesto, o flag 'e' ou arquivos de entrada sejam especificados!
 error.bad.eflag=o flag 'e' e manifesto com o atributo 'Main-Class' n\u00E3o podem ser especificados \njuntos!
+error.bad.dflag=A op\u00E7\u00E3o ''-d, --print-module-descriptor'' n\u00E3o exige a especifica\u00E7\u00E3o de arquivo de sa\u00EDda: {0}
+error.bad.reason=motivo incorreto: {0}, deve ser deprecated, deprecated-for-removal ou incubating
 error.nosuch.fileordir={0} : n\u00E3o h\u00E1 tal arquivo ou diret\u00F3rio
 error.write.file=Erro ao gravar o arquivo jar existente
 error.create.dir={0} : n\u00E3o foi poss\u00EDvel criar o diret\u00F3rio
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=Descritor de m\u00F3dulo n\u00E3o encontrado
 error.validator.info.without.root=module-info.class encontrado em um diret\u00F3rio com controle de vers\u00E3o sem module-info.class na raiz
 error.validator.info.name.notequal=module-info.class em um diret\u00F3rio com controle de vers\u00E3o cont\u00E9m nome incorreto
-error.validator.info.requires.public=module-info.class em um diret\u00F3rio com controle de vers\u00E3o cont\u00E9m "requires public" adicional
+error.validator.info.requires.transitive=module-info.class em um diret\u00F3rio com controle de vers\u00E3o cont\u00E9m "requires transitive" adicional
 error.validator.info.requires.added=module-info.class em um diret\u00F3rio com controle de vers\u00E3o cont\u00E9m "requires" adicional
 error.validator.info.requires.dropped=module-info.class em um diret\u00F3rio com controle de vers\u00E3o falta "requires"
 error.validator.info.exports.notequal=module-info.class em um diret\u00F3rio com controle de vers\u00E3o cont\u00E9m "exports" diferente
+error.validator.info.opens.notequal=module-info.class em um diret\u00F3rio com controle de vers\u00E3o cont\u00E9m "opens" diferente
 error.validator.info.provides.notequal=module-info.class em um diret\u00F3rio com controle de vers\u00E3o cont\u00E9m "provides" diferente
 error.invalid.versioned.module.attribute=Atributo {0} de descritor de m\u00F3dulo inv\u00E1lido
 error.missing.provider=Prestador de servi\u00E7os  n\u00E3o encontrado: {0}
 error.release.value.notnumber=release {0} n\u00E3o v\u00E1lida
 error.release.value.toosmall=release {0} n\u00E3o v\u00E1lida; deve ser >= 9
+error.release.unexpected.versioned.entry=entrada {0} com controle de vers\u00E3o inesperada para a release {1}
 error.validator.jarfile.exception=n\u00E3o \u00E9 poss\u00EDvel validar {0}: {1}
 error.validator.jarfile.invalid=arquivo jar {0} multi-release inv\u00E1lido exclu\u00EDdo
 error.validator.bad.entry.name=nome de entrada incorreto, {0}
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version=a entrada {0} tem uma vers\u00E3o de classe incompat\u00EDvel com uma vers\u00E3o anterior
 error.validator.different.api=a entrada {0} cont\u00E9m uma classe com api diferente da vers\u00E3o anterior
 error.validator.names.mismatch=a entrada {0} cont\u00E9m uma classe com o nome interno {1}; os nomes n\u00E3o correspondem
-warn.validator.identical.entry=advert\u00EAncia - a entrada {0} cont\u00E9m uma classe id\u00EAntica a uma que j\u00E1 est\u00E1 no jar
-warn.validator.resources.with.same.name=advert\u00EAncia - entrada {0}; diversos recursos com o mesmo nome
-warn.validator.concealed.public.class=advert\u00EAncia - a entrada {0} \u00E9 uma classe p\u00FAblica em um pacote oculto, \ncolocar esse jar no caminho de classe resultar\u00E1 em interfaces p\u00FAblicas incompat\u00EDveis
+warn.validator.identical.entry=Advert\u00EAncia: a entrada {0} cont\u00E9m uma classe\nid\u00EAntica a uma que j\u00E1 est\u00E1 no jar
+warn.validator.resources.with.same.name=Advert\u00EAncia: entrada {0}; diversos recursos com o mesmo nome
+warn.validator.concealed.public.class=Advert\u00EAncia: a entrada {0} \u00E9 uma classe p\u00FAblica\nem um pacote oculto; colocar esse jar no caminho de classe resultar\u00E1\nem interfaces p\u00FAblicas incompat\u00EDveis
 out.added.manifest=manifesto adicionado
 out.added.module-info=module-info: {0} adicionado
 out.update.manifest=manifesto atualizado
@@ -81,7 +85,7 @@
 
 usage.compat=Interface de Compatibilidade:\nUso: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] arquivos] ...\nOp\u00E7\u00F5es:\n    -c  cria novo arquivo compactado\n    -t  lista o sum\u00E1rio do arquivo compactado\n    -x  extrai arquivos com o nome (ou todos) do arquivo compactado\n    -u  atualiza o arquivo compactado existente\n    -v  gera sa\u00EDda detalhada na sa\u00EDda padr\u00E3o\n    -f  especifica o nome do arquivo compactado\n    -m  inclui as informa\u00E7\u00F5es do manifesto do arquivo de manifesto especificado\n    -n   executa a normaliza\u00E7\u00E3o Pack200 ap\u00F3s a cria\u00E7\u00E3o de um novo arquivo compactado\n    -e  especifica o ponto de entrada da aplicativo para aplicativo stand-alone \n        empacotada em um arquivo jar execut\u00E1vel\n    -0  armazena somente; n\u00E3o usa compacta\u00E7\u00E3o ZIP\n    -P  preserva os componentes '/' inicial (caminho absoluto) e ".." (diret\u00F3rio pai) nos nomes dos arquivos\n    -M  n\u00E3o cria um arquivo de manifesto para as entradas\n    -i  gera informa\u00E7\u00F5es de \u00EDndice para os arquivos jar especificados\n    -C  passa para o diret\u00F3rio especificado e inclui o arquivo a seguir\nSe um arquivo tamb\u00E9m for um diret\u00F3rio, ele ser\u00E1 processado repetidamente.\nO nome do arquivo de manifesto, o nome do arquivo compactado e o nome do ponto de entrada s\u00E3o\nespecificados na mesma ordem dos flags 'm', 'f' e 'e'.\n\nExemplo 1: para arquivar dois arquivos de classe em um arquivo compactado denominado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExemplo 2: use um arquivo de manifesto existente 'mymanifest' e arquive todos os\n           arquivos no diret\u00F3rio foo/ em 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
 
-main.usage.summary=Uso: jar [OPTION...] [ [--release VERSION] [-C dir] arquivos]...
+main.usage.summary=Uso: jar [OPTION...] [ [--release VERSION] [-C dir] files] ...
 main.usage.summary.try=Tente `jar --ajuda' para obter mais informa\u00E7\u00F5es.
 
 main.help.preopt=Uso: jar [OPTION...] [ [--release VERSION] [-C dir] arquivos]...\njar cria um arquivo compactado para classes e recursos, e pode manipular ou\nrestaurar classes ou recursos individuais de um arquivo compactado.\n\n Exemplos:\n # Cria um arquivo compactado chamado classes.jar com dois arquivos de classe:\n jar --create --file classes.jar Foo.class Bar.class\n # Cria um arquivo compactado usando um manifesto existente, com todos os arquivos em foo/:\n jar --create --file classes.jar --manifest mymanifest -C foo/ .\n # Cria um arquivo compactado jar modular, em que o descritor do m\u00F3dulo se localize em\n # classes/module-info.class:\n jar --create --file foo.jar --main-class com.foo.Main --module-version 1.0\n     -C foo/ classes resources\n # Atualiza um arquivo jar n\u00E3o modular existente para um jar modular:\n jar --update --file foo.jar --main-class com.foo.Main --module-version 1.0\n     -C foo/ module-info.class\n # Cria um arquivo jar de v\u00E1rias releases, colocando alguns arquivos no diret\u00F3rio META-INF/versions/9:\n jar --create --file mr.jar -C foo classes --release 9 -C foo9 classes
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    A vers\u00E3o do m\u00F3dulo, ao criar um arquivo jar\n                             modular, ou atualizar um arquivo jar n\u00E3o modular
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN Calcula e registra os hashes dos m\u00F3dulos\n                             correlacionado pelo padr\u00E3o fornecido e do qual depende\n                             direta ou indiretamente em um arquivo jar modular que est\u00E1 sendo\n                             criado ou em um arquivo jar n\u00E3o modular que est\u00E1 sendo atualizado
 main.help.opt.create.update.module-path=\  -p, --module-path          Local de depend\u00EAncia de m\u00F3dulo para gerar\n                             o hash
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  Excluir do conjunto de m\u00F3dulos raiz padr\u00E3o
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     Dica para que uma ferramenta emita uma advert\u00EAncia se o m\u00F3dulo\n                             for resolvido. Um destes: deprecated, deprecated-for-removal,\n                             ou incubating
 main.help.opt.create.update.index=\ Modificadores de opera\u00E7\u00E3o v\u00E1lidos somente no modo de cria\u00E7\u00E3o, atualiza\u00E7\u00E3o e gera\u00E7\u00E3o de \u00EDndice:\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          Somente armazenamento; n\u00E3o use compacta\u00E7\u00E3o ZIP
 main.help.opt.other=\ Outras op\u00E7\u00F5es:\n
 main.help.opt.other.help=\  -?, --help[:compat]        Fornece esta ajuda ou, opcionalmente, a ajuda de compatibilidade
+main.help.opt.other.help-extra=\      --help-extra           Fornecer ajuda sobre op\u00E7\u00F5es extras
 main.help.opt.other.version=\      --version              Imprime a vers\u00E3o do programa
 main.help.postopt=\ Arquivo compactado ser\u00E1 um arquivo jar modular se um descritor de m\u00F3dulo, 'module-info.class', estiver\n localizado na raiz dos diret\u00F3rios em quest\u00E3o ou na raiz do pr\u00F3prio arquivo compactado\n jar. As seguintes opera\u00E7\u00F5es s\u00F3 s\u00E3o v\u00E1lidas ao criar um jar modular\n ou atualizar um jar n\u00E3o modular existente: '--module-version',\n '--hash-modules' e '--module-path'.\n\n Argumentos obrigat\u00F3rios ou opcionais para op\u00E7\u00F5es longas tamb\u00E9m s\u00E3o obrigat\u00F3rios ou opcionais\n para quaisquer op\u00E7\u00F5es curtas correspondentes.
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_sv.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_sv.properties
index f73650e..0fbc723 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_sv.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_sv.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 # questions.
 #
 
-error.multiple.main.operations=Du kan inte ange flera -cuxtid-alternativ
+error.multiple.main.operations=Du kan inte ange flera alternativ av typen '-cuxtid'
 error.cant.open=kan inte \u00F6ppna: {0}
 error.illegal.option=Otill\u00E5tet alternativ: {0}
 error.unrecognized.option=ok\u00E4nt alternativ: {0}
@@ -33,6 +33,8 @@
 error.bad.cflag=f\u00F6r c-flaggan m\u00E5ste manifest- eller indatafiler anges.
 error.bad.uflag=f\u00F6r u-flaggan m\u00E5ste manifest-, e-flagg- eller indatafiler anges.
 error.bad.eflag=e-flaggan och manifest med attributet Main-Class kan inte anges \ntillsammans.
+error.bad.dflag=alternativet ''-d, --print-module-descriptor'' kr\u00E4ver att inga indatafiler har angetts: {0}
+error.bad.reason=ogiltig orsak: {0} m\u00E5ste vara deprecated, deprecated-for-removal eller incubating
 error.nosuch.fileordir={0} : det finns ingen s\u00E5dan fil eller katalog
 error.write.file=Det uppstod ett fel vid skrivning till befintlig jar-fil.
 error.create.dir={0} : kunde inte skapa n\u00E5gon katalog
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=Moduldeskriptorn hittades inte
 error.validator.info.without.root=module-info.class hittades i en versionshanterad katalog utan module-info.class i roten
 error.validator.info.name.notequal=module-info.class i en versionshanterad katalog inneh\u00E5ller ett felaktigt namn
-error.validator.info.requires.public=module-info.class i en versionshanterad katalog inneh\u00E5ller fler "requires public"
+error.validator.info.requires.transitive=module-info.class i en versionshanterad katalog inneh\u00E5ller fler "requires transitive"
 error.validator.info.requires.added=module-info.class i en versionshanterad katalog inneh\u00E5ller fler "requires"
 error.validator.info.requires.dropped=module-info.class i en versionshanterad katalog inneh\u00E5ller saknade "requires"
 error.validator.info.exports.notequal=module-info.class i en versionshanterad katalog inneh\u00E5ller olika "exports"
+error.validator.info.opens.notequal=module-info.class i en versionshanterad katalog inneh\u00E5ller olika "opens"
 error.validator.info.provides.notequal=module-info.class i en versionshanterad katalog inneh\u00E5ller olika "provides"
 error.invalid.versioned.module.attribute=Ogiltigt attribut f\u00F6r moduldeskriptor, {0}
 error.missing.provider=Tj\u00E4nsteleverant\u00F6ren hittades inte: {0}
 error.release.value.notnumber=utg\u00E5va {0} \u00E4r inte giltig
 error.release.value.toosmall=utg\u00E5va {0} \u00E4r inte giltig, m\u00E5ste vara >= 9
+error.release.unexpected.versioned.entry=ov\u00E4ntad versionshanterad post, {0}, f\u00F6r utg\u00E5van {1}
 error.validator.jarfile.exception=kan inte validera {0}: {1}
 error.validator.jarfile.invalid=ogiltig jar-fil f\u00F6r flera utg\u00E5vor, {0}, har tagits bort
 error.validator.bad.entry.name=postnamnet {0} \u00E4r felaktigt utformat
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version=posten {0} har en klassversion som \u00E4r inkompatibel med en tidigare version
 error.validator.different.api=posten {0} inneh\u00E5ller en klass med ett annat api fr\u00E5n en tidigare version
 error.validator.names.mismatch=posten {0} inneh\u00E5ller en klass med det interna namnet {1}, namnen matchar inte
-warn.validator.identical.entry=varning - posten {0} inneh\u00E5ller en klass som \u00E4r identisk med en post som redan finns i jar-filen
-warn.validator.resources.with.same.name=varning - posten {0}, flera resurser med samma namn
-warn.validator.concealed.public.class=varning - posten {0} \u00E4r en allm\u00E4n klass i ett dolt paket. \nOm du placerar den h\u00E4r jar-filen p\u00E5 klass\u00F6kv\u00E4gen leder det till inkompatibla allm\u00E4nna gr\u00E4nssnitt
+warn.validator.identical.entry=Varning: posten {0} inneh\u00E5ller en klass som\n\u00E4r identisk med en post som redan finns i jar-filen
+warn.validator.resources.with.same.name=Varning: posten {0}, flera resurser med samma namn
+warn.validator.concealed.public.class=Varning: posten {0} \u00E4r en allm\u00E4n klass\ni ett dolt paket. Om du placerar den h\u00E4r jar-filen p\u00E5 klass\u00F6kv\u00E4gen leder\ndet till inkompatibla allm\u00E4nna gr\u00E4nssnitt
 out.added.manifest=tillagt manifestfil
 out.added.module-info=lade till module-info: {0}
 out.update.manifest=uppdaterat manifest
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    Modulversionen vid skapande av ett modul\u00E4rt\n                             jar-arkiv eller vid uppdatering av ett icke-modul\u00E4rt jar-arkiv
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN Ber\u00E4kna och registrera hashningarna f\u00F6r moduler som\n                             matchar det angivna m\u00F6nstret och som \u00E4r direkt eller\n                             indirekt beroende av att ett modul\u00E4rt jar-arkiv skapas\n                             eller att ett icke-modul\u00E4rt jar-arkiv uppdateras
 main.help.opt.create.update.module-path=\  -p, --module-path          Plats f\u00F6r modulberoende f\u00F6r att generera\n                             hashningen
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  Exkludera fr\u00E5n standardrotupps\u00E4ttningen med moduler
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     Tips f\u00F6r ett verktyg f\u00F6r att utf\u00E4rda en varning om modulen\n                             har l\u00F6sts. deprecated, deprecated-for-removal,\n                             eller incubating
 main.help.opt.create.update.index=\ \u00C5tg\u00E4rdsmodifierare som endast \u00E4r giltiga i l\u00E4gena create, update och generate-index:\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          Endast lagring, anv\u00E4nd ingen ZIP-komprimering
 main.help.opt.other=\ \u00D6vriga alternativ:\n
 main.help.opt.other.help=\  -?, --help[:compat]        Visa den h\u00E4r hj\u00E4lpen eller kompatibilitetshj\u00E4lpen (valfritt)
+main.help.opt.other.help-extra=\      --help-extra           Visa hj\u00E4lp f\u00F6r extra alternativ
 main.help.opt.other.version=\      --version              Skriv ut programversion
 main.help.postopt=\ Ett arkiv \u00E4r ett modul\u00E4rt jar-arkiv om en moduldeskriptor, 'module-info.class',\n finns i roten av de angivna katalogerna eller det angivna jar-arkivet.\n F\u00F6ljande \u00E5tg\u00E4rder \u00E4r endast giltiga vid skapande av ett modul\u00E4rt jar-arkiv och\n vid uppdatering av ett befintligt icke-modul\u00E4rt jar-arkiv: '--module-version',\n '--hash-modules' och '--module-path'.\n\n Obligatoriska och valfria alternativ f\u00F6r l\u00E5nga alternativ \u00E4r \u00E4ven obligatoriska\n respektive valfria f\u00F6r alla motsvarande korta alternativ.
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties
index 71407c5..4e6cbc8 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
 error.bad.cflag='c' \u6807\u8BB0\u8981\u6C42\u6307\u5B9A\u6E05\u5355\u6216\u8F93\u5165\u6587\u4EF6!
 error.bad.uflag='u' \u6807\u8BB0\u8981\u6C42\u6307\u5B9A\u6E05\u5355, 'e' \u6807\u8BB0\u6216\u8F93\u5165\u6587\u4EF6!
 error.bad.eflag=\u4E0D\u80FD\u540C\u65F6\u6307\u5B9A 'e' \u6807\u8BB0\u548C\u5177\u6709 'Main-Class' \u5C5E\u6027\u7684\n\u6E05\u5355!
+error.bad.dflag=''-d, --print-module-descriptor'' \u9009\u9879\u4E0D\u9700\u8981\u6307\u5B9A\u4EFB\u4F55\u8F93\u5165\u6587\u4EF6: {0}
+error.bad.reason=\u9519\u8BEF\u7684\u539F\u56E0: {0}, \u5FC5\u987B\u4E3A deprecated, deprecated-for-removal \u6216 incubating \u4E4B\u4E00
 error.nosuch.fileordir={0}: \u6CA1\u6709\u8FD9\u4E2A\u6587\u4EF6\u6216\u76EE\u5F55
 error.write.file=\u5199\u5165\u73B0\u6709\u7684 jar \u6587\u4EF6\u65F6\u51FA\u9519
 error.create.dir={0}: \u65E0\u6CD5\u521B\u5EFA\u76EE\u5F55
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=\u627E\u4E0D\u5230\u6A21\u5757\u63CF\u8FF0\u7B26
 error.validator.info.without.root=\u5728\u7248\u672C\u5316\u76EE\u5F55\u4E2D\u627E\u5230\u4E86 module-info.class, \u4F46\u6839\u4E2D\u6CA1\u6709 module-info.class
 error.validator.info.name.notequal=\u7248\u672C\u5316\u76EE\u5F55\u4E2D\u7684 module-info.class \u5305\u542B\u4E0D\u6B63\u786E\u7684\u540D\u79F0
-error.validator.info.requires.public=\u7248\u672C\u5316\u76EE\u5F55\u4E2D\u7684 module-info.class \u5305\u542B\u989D\u5916\u7684 "requires public"
+error.validator.info.requires.transitive=\u7248\u672C\u5316\u76EE\u5F55\u4E2D\u7684 module-info.class \u5305\u542B\u989D\u5916\u7684 "requires transitive"
 error.validator.info.requires.added=\u7248\u672C\u5316\u76EE\u5F55\u4E2D\u7684 module-info.class \u5305\u542B\u989D\u5916\u7684 "requires"
 error.validator.info.requires.dropped=\u7248\u672C\u5316\u76EE\u5F55\u4E2D\u7684 module-info.class \u5305\u542B\u7F3A\u5C11\u7684 "requires"
 error.validator.info.exports.notequal=\u7248\u672C\u5316\u76EE\u5F55\u4E2D\u7684 module-info.class \u5305\u542B\u4E0D\u540C\u7684 "exports"
+error.validator.info.opens.notequal=\u7248\u672C\u5316\u76EE\u5F55\u4E2D\u7684 module-info.class \u5305\u542B\u4E0D\u540C\u7684 "opens"
 error.validator.info.provides.notequal=\u7248\u672C\u5316\u76EE\u5F55\u4E2D\u7684 module-info.class \u5305\u542B\u4E0D\u540C\u7684 "provides"
 error.invalid.versioned.module.attribute=\u65E0\u6548\u7684\u6A21\u5757\u63CF\u8FF0\u7B26\u5C5E\u6027 {0}
 error.missing.provider=\u672A\u627E\u5230\u670D\u52A1\u63D0\u4F9B\u65B9: {0}
 error.release.value.notnumber=\u53D1\u884C\u7248 {0} \u65E0\u6548
 error.release.value.toosmall=\u53D1\u884C\u7248 {0} \u65E0\u6548, \u5FC5\u987B >= 9
+error.release.unexpected.versioned.entry=\u53D1\u884C\u7248 {1} \u5B58\u5728\u610F\u5916\u7684\u7248\u672C\u5316\u6761\u76EE {0}
 error.validator.jarfile.exception=\u65E0\u6CD5\u9A8C\u8BC1 {0}: {1}
 error.validator.jarfile.invalid=\u5220\u9664\u7684\u591A\u53D1\u884C\u7248 jar \u6587\u4EF6 {0} \u65E0\u6548
 error.validator.bad.entry.name=\u6761\u76EE\u540D\u79F0\u683C\u5F0F\u9519\u8BEF, {0}
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version=\u6761\u76EE {0} \u5305\u542B\u4E0E\u8F83\u65E9\u7248\u672C\u4E0D\u517C\u5BB9\u7684\u7C7B\u7248\u672C
 error.validator.different.api=\u6761\u76EE {0} \u5305\u542B\u7684\u7C7B\u5177\u6709\u4E0E\u65E9\u671F\u7248\u672C\u4E0D\u540C\u7684 api
 error.validator.names.mismatch=\u6761\u76EE {0} \u5305\u542B\u5185\u90E8\u540D\u79F0\u4E3A {1} \u7684\u7C7B, \u540D\u79F0\u4E0D\u5339\u914D
-warn.validator.identical.entry=\u8B66\u544A - \u6761\u76EE {0} \u5305\u542B\u4E0E jar \u4E2D\u7684\u73B0\u6709\u6761\u76EE\u76F8\u540C\u7684\u7C7B
-warn.validator.resources.with.same.name=\u8B66\u544A - \u6761\u76EE {0}, \u591A\u4E2A\u8D44\u6E90\u540C\u540D
-warn.validator.concealed.public.class=\u8B66\u544A - \u6761\u76EE {0} \u662F\u9690\u85CF\u7A0B\u5E8F\u5305\u4E2D\u7684\u516C\u5171\u7C7B, \n\u5C06\u6B64 jar \u653E\u7F6E\u5728\u7C7B\u8DEF\u5F84\u4E2D\u5C06\u5BFC\u81F4\u516C\u5171\u63A5\u53E3\u4E0D\u517C\u5BB9
+warn.validator.identical.entry=\u8B66\u544A: \u6761\u76EE {0} \u5305\u542B\u4E0E jar \u4E2D\u7684\n\u73B0\u6709\u6761\u76EE\u76F8\u540C\u7684\u7C7B
+warn.validator.resources.with.same.name=\u8B66\u544A: \u6761\u76EE {0}, \u591A\u4E2A\u8D44\u6E90\u5177\u6709\u76F8\u540C\u540D\u79F0
+warn.validator.concealed.public.class=\u8B66\u544A: \u6761\u76EE {0} \u662F\u5DF2\u9690\u85CF\u7A0B\u5E8F\u5305\u4E2D\u7684\n\u516C\u5171\u7C7B, \u5C06\u6B64 jar \u653E\u7F6E\u5728\u7C7B\u8DEF\u5F84\u4E2D\n\u5C06\u5BFC\u81F4\u516C\u5171\u63A5\u53E3\u4E0D\u517C\u5BB9
 out.added.manifest=\u5DF2\u6DFB\u52A0\u6E05\u5355
 out.added.module-info=\u5DF2\u6DFB\u52A0 module-info: {0}
 out.update.manifest=\u5DF2\u66F4\u65B0\u6E05\u5355
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    \u521B\u5EFA\u6A21\u5757\u5316 jar \u6216\u66F4\u65B0\n                             \u975E\u6A21\u5757\u5316 jar \u65F6\u7684\u6A21\u5757\u7248\u672C
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN \u8BA1\u7B97\u548C\u8BB0\u5F55\u6A21\u5757\u7684\u6563\u5217, \n                             \u8FD9\u4E9B\u6A21\u5757\u6309\u6307\u5B9A\u6A21\u5F0F\u5339\u914D\u5E76\u76F4\u63A5\u6216\n                             \u95F4\u63A5\u4F9D\u8D56\u4E8E\u6240\u521B\u5EFA\u7684\u6A21\u5757\u5316 jar \u6216\n                             \u6240\u66F4\u65B0\u7684\u975E\u6A21\u5757\u5316 jar
 main.help.opt.create.update.module-path=\  -p, --module-path          \u6A21\u5757\u88AB\u4F9D\u8D56\u5BF9\u8C61\u7684\u4F4D\u7F6E, \u7528\u4E8E\u751F\u6210\n                             \u6563\u5217
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  \u4ECE\u9ED8\u8BA4\u6839\u6A21\u5757\u96C6\u4E2D\u6392\u9664
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     \u63D0\u793A\u5DE5\u5177\u5728\u89E3\u6790\u6A21\u5757\u540E\u53D1\u51FA\u8B66\u544A\u3002\n                             \u53EF\u4EE5\u4E3A deprecated, deprecated-for-removal\n                             \u6216 incubating \u4E4B\u4E00
 main.help.opt.create.update.index=\ \u53EA\u5728\u521B\u5EFA, \u66F4\u65B0\u548C\u751F\u6210\u7D22\u5F15\u6A21\u5F0F\u4E0B\u6709\u6548\u7684\u64CD\u4F5C\u4FEE\u9970\u7B26:\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528 ZIP \u538B\u7F29
 main.help.opt.other=\ \u5176\u4ED6\u9009\u9879:\n
 main.help.opt.other.help=\  -?, --help[:compat]        \u63D0\u4F9B\u6B64\u5E2E\u52A9, \u4E5F\u53EF\u4EE5\u9009\u62E9\u6027\u5730\u63D0\u4F9B\u517C\u5BB9\u6027\u5E2E\u52A9
+main.help.opt.other.help-extra=\      --help-extra           \u63D0\u4F9B\u989D\u5916\u9009\u9879\u7684\u5E2E\u52A9
 main.help.opt.other.version=\      --version              \u8F93\u51FA\u7A0B\u5E8F\u7248\u672C
 main.help.postopt=\ \u5982\u679C\u6A21\u5757\u63CF\u8FF0\u7B26 'module-info.class' \u4F4D\u4E8E\u6307\u5B9A\u76EE\u5F55\u7684\n \u6839\u76EE\u5F55\u4E2D, \u6216\u8005\u4F4D\u4E8E jar \u6863\u6848\u672C\u8EAB\u7684\u6839\u76EE\u5F55\u4E2D, \u5219\n \u8BE5\u6863\u6848\u662F\u4E00\u4E2A\u6A21\u5757\u5316 jar\u3002\u4EE5\u4E0B\u64CD\u4F5C\u53EA\u5728\u521B\u5EFA\u6A21\u5757\u5316 jar,\n \u6216\u66F4\u65B0\u73B0\u6709\u7684\u975E\u6A21\u5757\u5316 jar \u65F6\u6709\u6548: '--module-version',\n '--hash-modules' \u548C '--module-path'\u3002\n\n \u5982\u679C\u4E3A\u957F\u9009\u9879\u63D0\u4F9B\u4E86\u5FC5\u9700\u53C2\u6570\u6216\u53EF\u9009\u53C2\u6570, \u5219\u5B83\u4EEC\u5BF9\u4E8E\n \u4EFB\u4F55\u5BF9\u5E94\u7684\u77ED\u9009\u9879\u4E5F\u662F\u5FC5\u9700\u6216\u53EF\u9009\u7684\u3002
diff --git a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_TW.properties b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_TW.properties
index 3c209bb..60b7161 100644
--- a/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_TW.properties
+++ b/jdk/src/jdk.jartool/share/classes/sun/tools/jar/resources/jar_zh_TW.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
 error.bad.cflag='c' \u65D7\u6A19\u8981\u6C42\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u6216\u8F38\u5165\u6A94\u6848\uFF01
 error.bad.uflag='u' \u65D7\u6A19\u8981\u6C42\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u3001'e' \u65D7\u6A19\u6216\u8F38\u5165\u6A94\u6848\uFF01
 error.bad.eflag=\u7121\u6CD5\u540C\u6642\u6307\u5B9A 'e' \u65D7\u6A19\u548C\u5177\u6709 'Main-Class' \u5C6C\u6027\u7684\n\u8CC7\u8A0A\u6E05\u55AE\uFF01
+error.bad.dflag=''-d, --print-module-descriptor'' \u9078\u9805\u4E0D\u9700\u8981\u6307\u5B9A\u8F38\u5165\u6A94: {0}
+error.bad.reason=\u932F\u8AA4\u539F\u56E0: {0}\uFF0C\u5FC5\u9808\u662F deprecated\u3001deprecated-for-removal \u6216 incubating \u5176\u4E2D\u4E4B\u4E00
 error.nosuch.fileordir={0} : \u6C92\u6709\u9019\u985E\u6A94\u6848\u6216\u76EE\u9304
 error.write.file=\u5BEB\u5165\u73FE\u6709\u7684 jar \u6A94\u6848\u6642\u767C\u751F\u932F\u8AA4
 error.create.dir={0} : \u7121\u6CD5\u5EFA\u7ACB\u76EE\u9304
@@ -44,15 +46,17 @@
 error.module.descriptor.not.found=\u627E\u4E0D\u5230\u6A21\u7D44\u63CF\u8FF0\u5340
 error.validator.info.without.root=\u5728\u5DF2\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u76EE\u9304\u4E2D\u767C\u73FE module-info.class\uFF0C\u4F46\u662F\u6839\u4E2D\u6C92\u6709 module-info.class
 error.validator.info.name.notequal=\u5DF2\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u76EE\u9304\u4E2D\u7684 module-info.class \u5305\u542B\u4E0D\u6B63\u78BA\u7684\u540D\u7A31
-error.validator.info.requires.public=\u5DF2\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u76EE\u9304\u4E2D\u7684 module-info.class \u5305\u542B\u984D\u5916\u7684 "requires public"
+error.validator.info.requires.transitive=\u5DF2\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u76EE\u9304\u4E2D\u7684 module-info.class \u5305\u542B\u984D\u5916\u7684 "requires transitive"
 error.validator.info.requires.added=\u5DF2\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u76EE\u9304\u4E2D\u7684 module-info.class \u5305\u542B\u984D\u5916\u7684 "requires"
 error.validator.info.requires.dropped=\u5DF2\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u76EE\u9304\u4E2D\u7684 module-info.class \u5305\u542B\u907A\u6F0F\u7684 "requires"
 error.validator.info.exports.notequal=\u5DF2\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u76EE\u9304\u4E2D\u7684 module-info.class \u5305\u542B\u4E0D\u540C\u7684 "exports"
+error.validator.info.opens.notequal=\u5DF2\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u76EE\u9304\u4E2D\u7684 module-info.class \u5305\u542B\u4E0D\u540C\u7684 "opens"
 error.validator.info.provides.notequal=\u5DF2\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u76EE\u9304\u4E2D\u7684 module-info.class \u5305\u542B\u4E0D\u540C\u7684 "provides"
 error.invalid.versioned.module.attribute=\u6A21\u7D44\u63CF\u8FF0\u5340\u5C6C\u6027 {0} \u7121\u6548
 error.missing.provider=\u627E\u4E0D\u5230\u670D\u52D9\u63D0\u4F9B\u8005: {0}
 error.release.value.notnumber=\u7248\u672C {0} \u7121\u6548
 error.release.value.toosmall=\u7248\u672C {0} \u7121\u6548\uFF0C\u5FC5\u9808\u5927\u65BC\u7B49\u65BC 9
+error.release.unexpected.versioned.entry=\u7248\u672C {1} \u6709\u672A\u9810\u671F\u7684\u555F\u52D5\u591A\u7248\u672C\u529F\u80FD\u9805\u76EE {0}
 error.validator.jarfile.exception=\u7121\u6CD5\u9A57\u8B49 {0}: {1}
 error.validator.jarfile.invalid=\u5DF2\u522A\u9664\u7121\u6548\u7684\u591A\u91CD\u7248\u672C jar \u6A94\u6848 {0}
 error.validator.bad.entry.name=\u9805\u76EE\u540D\u7A31 {0} \u7684\u683C\u5F0F\u932F\u8AA4
@@ -63,9 +67,9 @@
 error.validator.incompatible.class.version=\u9805\u76EE {0} \u7684\u985E\u5225\u7248\u672C\u8207\u8F03\u820A\u7248\u672C\u4E0D\u76F8\u5BB9
 error.validator.different.api=\u9805\u76EE {0} \u7684\u67D0\u500B\u985E\u5225\u542B\u6709\u8207\u8F03\u820A\u7248\u672C\u4E0D\u540C\u7684 API
 error.validator.names.mismatch=\u9805\u76EE {0} \u542B\u6709\u5167\u90E8\u540D\u7A31\u70BA {1} \u7684\u985E\u5225\uFF0C\u540D\u7A31\u4E0D\u76F8\u7B26
-warn.validator.identical.entry=\u8B66\u544A - \u9805\u76EE {0} \u7684\u67D0\u500B\u985E\u5225\u8207 jar \u4E2D\u7684\u73FE\u6709\u9805\u76EE\u76F8\u540C
-warn.validator.resources.with.same.name=\u8B66\u544A - \u9805\u76EE {0} \u4E2D\u7684\u591A\u500B\u8CC7\u6E90\u540D\u7A31\u76F8\u540C
-warn.validator.concealed.public.class=\u8B66\u544A - \u9805\u76EE {0} \u662F\u96B1\u85CF\u5957\u88DD\u7A0B\u5F0F\u4E2D\u7684\u516C\u7528\u985E\u5225, \n\u5C07\u6B64 jar \u653E\u5728\u985E\u5225\u8DEF\u5F91\u4E0A\u6703\u9020\u6210\u516C\u7528\u4ECB\u9762\u4E0D\u76F8\u5BB9
+warn.validator.identical.entry=\u8B66\u544A: \u9805\u76EE {0} \u7684\u67D0\u500B\u985E\u5225\n\u8207 jar \u4E2D\u7684\u73FE\u6709\u9805\u76EE\u76F8\u540C
+warn.validator.resources.with.same.name=\u8B66\u544A: \u9805\u76EE {0} \u4E2D\u7684\u591A\u500B\u8CC7\u6E90\u540D\u7A31\u76F8\u540C
+warn.validator.concealed.public.class=\u8B66\u544A: \u9805\u76EE {0} \u662F\u96B1\u85CF\u5957\u88DD\u7A0B\u5F0F\u4E2D\u7684\n\u516C\u7528\u985E\u5225\uFF0C\u82E5\u5C07\u6B64 jar \u653E\u5728\u985E\u5225\u8DEF\u5F91\u4E0A\n\u6703\u9020\u6210\u516C\u7528\u4ECB\u9762\u4E0D\u76F8\u5BB9
 out.added.manifest=\u5DF2\u65B0\u589E\u8CC7\u8A0A\u6E05\u55AE
 out.added.module-info=\u5DF2\u65B0\u589E module-info: {0}
 out.update.manifest=\u5DF2\u66F4\u65B0\u8CC7\u8A0A\u6E05\u55AE
@@ -102,9 +106,12 @@
 main.help.opt.create.update.module-version=\      --module-version=VERSION    \u5EFA\u7ACB\u6A21\u7D44\u5316 jar \u6216\u66F4\u65B0\u975E\u6A21\u7D44\u5316 jar \u6642\n                             \u4F7F\u7528\u7684\u6A21\u7D44\u7248\u672C
 main.help.opt.create.update.hash-modules=\      --hash-modules=PATTERN \u904B\u7B97\u53CA\u8A18\u9304\u8207\u6307\u5B9A\u6A23\u5F0F\n                             \u76F8\u7B26\u7684\u6A21\u7D44\u96DC\u6E4A\uFF0C\u9019\u76F4\u63A5\u6216\u9593\u63A5\u5730\n                             \u76F8\u4F9D\u65BC\u6B63\u5728\u5EFA\u7ACB\u7684\u6A21\u7D44\u5316 jar \u6216\u6B63\u5728\n                             \u66F4\u65B0\u7684\u975E\u6A21\u7D44\u5316 jar
 main.help.opt.create.update.module-path=\  -p, --module-path          \u6A21\u7D44\u76F8\u4F9D\u6027\u7684\u4F4D\u7F6E\uFF0C\u7528\u65BC\u7522\u751F\n                             \u96DC\u6E4A
+main.help.opt.create.update.do-not-resolve-by-default=\      --do-not-resolve-by-default  \u4E0D\u5305\u62EC\u9810\u8A2D\u7684\u6A21\u7D44\u8A2D\u5B9A\u6839\u76EE\u9304
+main.help.opt.create.update.warn-if-resolved=\      --warn-if-resolved     \u82E5\u6A21\u7D44\u5DF2\u89E3\u6790\uFF0C\u5247\u63D0\u793A\u5DE5\u5177\u4EE5\u767C\u51FA\u8B66\u544A\u3002\n                             deprecated\u3001deprecated-for-removal \u6216 incubating \n                             \u5176\u4E2D\u4E4B\u4E00
 main.help.opt.create.update.index=\ \u53EA\u80FD\u5728\u5EFA\u7ACB\u3001\u66F4\u65B0\u53CA\u7522\u751F\u7D22\u5F15\u6A21\u5F0F\u4E0B\u4F7F\u7528\u7684\u4F5C\u696D\u4FEE\u98FE\u689D\u4EF6:\n
 main.help.opt.create.update.index.no-compress=\  -0, --no-compress          \u50C5\u5132\u5B58; \u4E0D\u4F7F\u7528 ZIP \u58D3\u7E2E\u65B9\u5F0F
 main.help.opt.other=\ \u5176\u4ED6\u9078\u9805:\n
 main.help.opt.other.help=\  -?, --help[:compat]        \u63D0\u4F9B\u6B64\u8AAA\u660E\u6216\u9078\u64C7\u6027\u986F\u793A\u76F8\u5BB9\u6027\u8AAA\u660E
+main.help.opt.other.help-extra=\      --help-extra           \u63D0\u4F9B\u984D\u5916\u9078\u9805\u7684\u8AAA\u660E
 main.help.opt.other.version=\      --version              \u5217\u5370\u7A0B\u5F0F\u7248\u672C
 main.help.postopt=\ \u5982\u679C\u6A21\u7D44\u63CF\u8FF0\u5340 ('module-info.class') \u4F4D\u65BC\u6307\u5B9A\u76EE\u9304\u7684\u6839\n \u6216 jar \u5B58\u6A94\u672C\u8EAB\u7684\u6839\uFF0C\u5247\u5B58\u6A94\u6703\u662F\n \u6A21\u7D44\u5316\u7684 jar\u3002\u4E0B\u5217\u4F5C\u696D\u53EA\u80FD\u5728\u5EFA\u7ACB\u6A21\u7D44\u5316 jar \u6216\u66F4\u65B0\n \u73FE\u6709\u975E\u6A21\u7D44\u5316 jar \u6642\u9032\u884C: '--module-version'\u3001\n '--hash-modules' \u548C '--module-path'\u3002\n\n \u9577\u9078\u9805\u7684\u5F37\u5236\u6027\u6216\u9078\u64C7\u6027\u5F15\u6578\u4E5F\u6703\u662F\u4EFB\u4F55\u5C0D\u61C9\u77ED\u9078\u9805\u7684\n \u5F37\u5236\u6027\u6216\u9078\u64C7\u6027\u5F15\u6578\u3002
diff --git a/jdk/src/jdk.jcmd/share/classes/module-info.java b/jdk/src/jdk.jcmd/share/classes/module-info.java
index 5edf30c..4cda028 100644
--- a/jdk/src/jdk.jcmd/share/classes/module-info.java
+++ b/jdk/src/jdk.jcmd/share/classes/module-info.java
@@ -23,6 +23,13 @@
  * questions.
  */
 
+/**
+ * Defines tools for diagnostics and troubleshooting a JVM,
+ * including the jcmd, jps, jstat and other diagnostics tools.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.jcmd {
     requires jdk.attach;
     requires jdk.internal.jvmstat;
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java
index 8dab8e0..d8e44d3 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java
@@ -25,11 +25,11 @@
 
 package sun.tools.common;
 
-import java.lang.reflect.Module;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import com.sun.tools.attach.VirtualMachine;
 import com.sun.tools.attach.VirtualMachineDescriptor;
@@ -145,4 +145,17 @@
         return this.getVirtualMachineDescriptors(null);
     }
 
+    public Collection<String> getVirtualMachinePids(Class<?> excludeClass) {
+        if (singlePid != null) {
+            // There is a bug in AttachProvider, when VM is debuggee-suspended it's not listed by the AttachProvider.
+            // If we are talking about a specific pid, just return it.
+            return List.of(singlePid);
+        } else {
+            return getVMDs(excludeClass, matchClass).stream().map(x -> {return x.id();}).collect(Collectors.toList());
+        }
+    }
+
+    public Collection<String> getVirtualMachinePids() {
+        return this.getVirtualMachinePids(null);
+    }
 }
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/JCmd.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/JCmd.java
index 8a77c95..18b33af 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/JCmd.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/JCmd.java
@@ -80,22 +80,22 @@
             System.exit(0);
         }
 
-        Collection<VirtualMachineDescriptor> vids = ap.getVirtualMachineDescriptors(JCmd.class);
+        Collection<String> pids = ap.getVirtualMachinePids(JCmd.class);
 
-        if (vids.isEmpty()) {
+        if (pids.isEmpty()) {
             System.err.println("Could not find any processes matching : '"
                                + arg.getProcessString() + "'");
             System.exit(1);
         }
 
         boolean success = true;
-        for (VirtualMachineDescriptor vid : vids) {
-            System.out.println(vid.id() + ":");
+        for (String pid : pids) {
+            System.out.println(pid + ":");
             if (arg.isListCounters()) {
-                listCounters(vid.id());
+                listCounters(pid);
             } else {
                 try {
-                    executeCommandForPid(vid.id(), arg.getCommand());
+                    executeCommandForPid(pid, arg.getCommand());
                 } catch(AttachOperationFailedException ex) {
                     System.err.println(ex.getMessage());
                     success = false;
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo/JInfo.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo/JInfo.java
index 2c955af..99b0b3f 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo/JInfo.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo/JInfo.java
@@ -96,37 +96,37 @@
         String parg = args[optionCount];
 
         ProcessArgumentMatcher ap = new ProcessArgumentMatcher(parg);
-        Collection<VirtualMachineDescriptor> vids = ap.getVirtualMachineDescriptors(JInfo.class);
+        Collection<String> pids = ap.getVirtualMachinePids(JInfo.class);
 
-        if (vids.isEmpty()) {
+        if (pids.isEmpty()) {
             System.err.println("Could not find any processes matching : '" + parg + "'");
             System.exit(1);
         }
 
-        for (VirtualMachineDescriptor vid : vids) {
-            if (vids.size() > 1) {
-                System.out.println("Pid:" + vid.id());
+        for (String pid : pids) {
+            if (pids.size() > 1) {
+                System.out.println("Pid:" + pid);
             }
             if (!doFlag && !doFlags && !doSysprops) {
                 // Print flags and sysporps if no options given
-                sysprops(vid.id());
+                sysprops(pid);
                 System.out.println();
-                flags(vid.id());
+                flags(pid);
                 System.out.println();
-                commandLine(vid.id());
+                commandLine(pid);
             }
             if (doFlag) {
                 if (flag < 0) {
                     System.err.println("Missing flag");
                     usage(1);
                 }
-                flag(vid.id(), args[flag]);
+                flag(pid, args[flag]);
             }
             if (doFlags) {
-                flags(vid.id());
+                flags(pid);
             }
             if (doSysprops) {
-                sysprops(vid.id());
+                sysprops(pid);
             }
         }
     }
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
index 178d0a4..222358f 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
@@ -91,16 +91,15 @@
         // As more options are added we should create an abstract tool class and
         // have a table to map the options
         ProcessArgumentMatcher ap = new ProcessArgumentMatcher(pidArg);
-        Collection<VirtualMachineDescriptor> vids = ap.getVirtualMachineDescriptors(JMap.class);
+        Collection<String> pids = ap.getVirtualMachinePids(JMap.class);
 
-        if (vids.isEmpty()) {
+        if (pids.isEmpty()) {
             System.err.println("Could not find any processes matching : '" + pidArg + "'");
             System.exit(1);
         }
 
-        for (VirtualMachineDescriptor vid : vids) {
-            String pid = vid.id();
-            if (vids.size() > 1) {
+        for (String pid : pids) {
+            if (pids.size() > 1) {
                 System.out.println("Pid:" + pid);
             }
             if (option.equals("-histo")) {
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java
index 5e861ce..a4ed220 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java
@@ -84,18 +84,18 @@
             params = new String[0];
         }
         ProcessArgumentMatcher ap = new ProcessArgumentMatcher(pidArg);
-        Collection<VirtualMachineDescriptor> vids = ap.getVirtualMachineDescriptors(JStack.class);
+        Collection<String> pids = ap.getVirtualMachinePids(JStack.class);
 
-        if (vids.isEmpty()) {
+        if (pids.isEmpty()) {
             System.err.println("Could not find any processes matching : '" + pidArg + "'");
             System.exit(1);
         }
 
-        for (VirtualMachineDescriptor vid : vids) {
-            if (vids.size() > 1) {
-                System.out.println("Pid:" + vid.id());
+        for (String pid : pids) {
+            if (pids.size() > 1) {
+                System.out.println("Pid:" + pid);
             }
-            runThreadDump(vid.id(), params);
+            runThreadDump(pid, params);
         }
     }
 
diff --git a/jdk/src/jdk.jconsole/share/classes/module-info.java b/jdk/src/jdk.jconsole/share/classes/module-info.java
index 327af1e..7e1841a 100644
--- a/jdk/src/jdk.jconsole/share/classes/module-info.java
+++ b/jdk/src/jdk.jconsole/share/classes/module-info.java
@@ -23,6 +23,13 @@
  * questions.
  */
 
+/**
+ * Defines the JMX graphical tool, jconsole, for monitoring and managing
+ * a running application.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.jconsole {
     requires transitive java.desktop;
     requires transitive java.management;
diff --git a/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java b/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java
index f1e518f..cc182a4 100644
--- a/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java
+++ b/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java
@@ -128,7 +128,7 @@
             hotspotMI.setMnemonic(Resources.getMnemonicInt(Messages.HOTSPOT_MBEANS_ELLIPSIS));
             hotspotMI.setAccelerator(KeyStroke.
                                      getKeyStroke(KeyEvent.VK_H,
-                                                  InputEvent.CTRL_MASK));
+                                                  InputEvent.CTRL_DOWN_MASK));
             hotspotMI.addActionListener(this);
             connectionMenu.add(hotspotMI);
 
@@ -138,7 +138,7 @@
         connectMI = new JMenuItem(Messages.NEW_CONNECTION_ELLIPSIS);
         connectMI.setMnemonic(Resources.getMnemonicInt(Messages.NEW_CONNECTION_ELLIPSIS));
         connectMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,
-                                                        InputEvent.CTRL_MASK));
+                                                        InputEvent.CTRL_DOWN_MASK));
         connectMI.addActionListener(this);
         connectionMenu.add(connectMI);
 
@@ -147,7 +147,7 @@
         exitMI = new JMenuItem(Messages.EXIT);
         exitMI.setMnemonic(Resources.getMnemonicInt(Messages.EXIT));
         exitMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4,
-                                                     InputEvent.ALT_MASK));
+                                                     InputEvent.ALT_DOWN_MASK));
         exitMI.addActionListener(this);
         connectionMenu.add(exitMI);
 
@@ -223,7 +223,7 @@
             tileMI = new JMenuItem(Messages.TILE);
             tileMI.setMnemonic(Resources.getMnemonicInt(Messages.TILE));
             tileMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T,
-                                                         InputEvent.CTRL_MASK));
+                                                         InputEvent.CTRL_DOWN_MASK));
             tileMI.addActionListener(JConsole.this);
             add(tileMI);
 
diff --git a/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/VMPanel.java b/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/VMPanel.java
index 1561b9c..f8c7632 100644
--- a/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/VMPanel.java
+++ b/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/VMPanel.java
@@ -124,7 +124,9 @@
         addMouseListener(new MouseAdapter() {
 
             public void mouseClicked(MouseEvent e) {
-                if (connectedIconBounds != null && (e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && connectedIconBounds.contains(e.getPoint())) {
+                if (connectedIconBounds != null
+                        && (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0
+                        && connectedIconBounds.contains(e.getPoint())) {
 
                     if (isConnected()) {
                         userDisconnected = true;
diff --git a/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/Utils.java b/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/Utils.java
index e706715..aec798c 100644
--- a/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/Utils.java
+++ b/jdk/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/Utils.java
@@ -438,7 +438,7 @@
         public void keyPressed(KeyEvent e) {
             // Accept "copy" key strokes
             KeyStroke ks = KeyStroke.getKeyStroke(
-                    e.getKeyCode(), e.getModifiers());
+                    e.getKeyCode(), e.getModifiersEx());
             JComponent comp = (JComponent) e.getSource();
             for (int i = 0; i < 3; i++) {
                 InputMap im = comp.getInputMap(i);
diff --git a/jdk/src/jdk.jdi/share/classes/module-info.java b/jdk/src/jdk.jdi/share/classes/module-info.java
index 0dd61c6..e0ea5a5 100644
--- a/jdk/src/jdk.jdi/share/classes/module-info.java
+++ b/jdk/src/jdk.jdi/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Defines the Java Debugger Interface.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module jdk.jdi {
     requires jdk.attach;
diff --git a/jdk/src/jdk.jdwp.agent/share/classes/module-info.java b/jdk/src/jdk.jdwp.agent/share/classes/module-info.java
index ee7a047..82d4c86 100644
--- a/jdk/src/jdk.jdwp.agent/share/classes/module-info.java
+++ b/jdk/src/jdk.jdwp.agent/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /**
  * Java Debug Wire Protocol.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module jdk.jdwp.agent {
 }
diff --git a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c
index 0477964..88df2d9 100644
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c
@@ -29,8 +29,8 @@
 #include "ModuleReferenceImpl.h"
 
 
-static jclass jlrM(JNIEnv *env) {
-    return findClass(env, "Ljava/lang/reflect/Module;");
+static jclass jlM(JNIEnv *env) {
+    return findClass(env, "Ljava/lang/Module;");
 }
 
 static jboolean
@@ -43,7 +43,7 @@
     jobject module;
 
     if (method == NULL) {
-        method = getMethod(env, jlrM(env), "getName", "()Ljava/lang/String;");
+        method = getMethod(env, jlM(env), "getName", "()Ljava/lang/String;");
     }
     module = inStream_readModuleRef(getEnv(), in);
     if (inStream_error(in)) {
@@ -71,7 +71,7 @@
     jobject module;
 
     if (method == NULL) {
-        method = getMethod(env, jlrM(env), "getClassLoader", "()Ljava/lang/ClassLoader;");
+        method = getMethod(env, jlM(env), "getClassLoader", "()Ljava/lang/ClassLoader;");
     }
     module = inStream_readModuleRef(env, in);
     if (inStream_error(in)) {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java
index 344b920..c9cafff 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,8 +35,12 @@
 import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.function.Predicate;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
 import jdk.internal.jimage.BasicImageReader;
 import jdk.internal.jimage.ImageHeader;
 import jdk.internal.jimage.ImageLocation;
@@ -99,7 +103,7 @@
     }
 
     static class OptionsValues {
-        Task task = Task.LIST;
+        Task task = null;
         String directory = ".";
         String include = "";
         boolean fullVersion;
@@ -172,24 +176,31 @@
         }
 
         try {
-            List<String> unhandled = OPTION_HELPER.handleOptions(this, args);
+            String command;
+            String[] remaining = args;
+            try {
+                command = args[0];
+                options.task = Enum.valueOf(Task.class, args[0].toUpperCase(Locale.ENGLISH));
+                remaining = args.length > 1 ? Arrays.copyOfRange(args, 1, args.length)
+                                            : new String[0];
+            } catch (IllegalArgumentException ex) {
+                command = null;
+                options.task = null;
+            }
 
-            if(!unhandled.isEmpty()) {
-                try {
-                    options.task = Enum.valueOf(Task.class, unhandled.get(0).toUpperCase());
-                } catch (IllegalArgumentException ex) {
-                    throw TASK_HELPER.newBadArgs("err.not.a.task", unhandled.get(0));
-                }
+            // process arguments
+            List<String> unhandled = OPTION_HELPER.handleOptions(this, remaining);
+            for (String f : unhandled) {
+                options.jimages.add(new File(f));
+            }
 
-                for(int i = 1; i < unhandled.size(); i++) {
-                    options.jimages.add(new File(unhandled.get(i)));
-                }
-            } else if (!options.help && !options.version && !options.fullVersion) {
-                throw TASK_HELPER.newBadArgs("err.invalid.task", "<unspecified>");
+            if (options.task == null && !options.help && !options.version && !options.fullVersion) {
+                throw TASK_HELPER.newBadArgs("err.not.a.task",
+                    command != null ? command : "<unspecified>");
             }
 
             if (options.help) {
-                if (unhandled.isEmpty()) {
+                if (options.task == null) {
                     log.println(TASK_HELPER.getMessage("main.usage", PROGNAME));
                     Arrays.asList(RECOGNIZED_OPTIONS).stream()
                         .filter(option -> !option.isHidden())
@@ -203,15 +214,19 @@
                         log.println(TASK_HELPER.getMessage("main.usage." +
                                 options.task.toString().toLowerCase()));
                     } catch (MissingResourceException ex) {
-                        throw TASK_HELPER.newBadArgs("err.not.a.task", unhandled.get(0));
+                        throw TASK_HELPER.newBadArgs("err.not.a.task", command);
                     }
                 }
                 return EXIT_OK;
             }
 
             if (options.version || options.fullVersion) {
-                TASK_HELPER.showVersion(options.fullVersion);
+                if (options.task == null && !unhandled.isEmpty()) {
+                    throw TASK_HELPER.newBadArgs("err.not.a.task",
+                        Stream.of(args).collect(Collectors.joining(" ")));
+                }
 
+                TASK_HELPER.showVersion(options.fullVersion);
                 if (unhandled.isEmpty()) {
                     return EXIT_OK;
                 }
@@ -435,7 +450,7 @@
                 iterate(this::listTitle, null, this::verify);
                 break;
             default:
-                throw TASK_HELPER.newBadArgs("err.invalid.task",
+                throw TASK_HELPER.newBadArgs("err.not.a.task",
                         options.task.name()).showUsage(true);
         }
         return true;
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties
index 13faa3b..2bc96bd 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/resources/jimage.properties
@@ -98,3 +98,4 @@
 err.no.jimage=no jimage provided
 err.option.unsupported={0} not supported: {1}
 err.unknown.option=unknown option: {0}
+err.cannot.create.dir=cannot create directory {0}
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java
index 3c2cfbd..2ab6f18 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java
@@ -151,16 +151,8 @@
     @Override
     public void storeFiles(ResourcePool files) {
         try {
-            // populate targetOsName field up-front because it's used elsewhere.
-            Optional<ResourcePoolModule> javaBase = files.moduleView().findModule("java.base");
-            javaBase.ifPresent(mod -> {
-                // fill release information available from transformed "java.base" module!
-                ModuleDescriptor desc = mod.descriptor();
-                desc.osName().ifPresent(s -> {
-                    this.targetOsName = s;
-                });
-            });
-
+            this.targetOsName = files.moduleView().
+                findModule("java.base").get().osName();
             if (this.targetOsName == null) {
                 throw new PluginException("ModuleTarget attribute is missing for java.base module");
             }
@@ -362,7 +354,7 @@
         String module = "/" + entry.moduleName() + "/";
         String filename = entry.path().substring(module.length());
 
-        // Remove radical native|config|...
+        // Remove radical lib|config|...
         return filename.substring(filename.indexOf('/') + 1);
     }
 
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/AbstractResourcePoolEntry.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/AbstractResourcePoolEntry.java
index 55408a8..8cb71fb 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/AbstractResourcePoolEntry.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/AbstractResourcePoolEntry.java
@@ -38,7 +38,7 @@
  * <li>For jimage content: /{module name}/{package1}/.../{packageN}/{file
  * name}</li>
  * <li>For other files (shared lib, launchers, config, ...):/{module name}/
- * {@literal bin|conf|native}/{dir1}>/.../{dirN}/{file name}</li>
+ * {@literal bin|conf|lib}/{dir1}>/.../{dirN}/{file name}</li>
  * </ul>
  */
 abstract class AbstractResourcePoolEntry implements ResourcePoolEntry {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageLocationWriter.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageLocationWriter.java
index 0faf8c9..f2c7f10 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageLocationWriter.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageLocationWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -108,24 +108,24 @@
         int hash = seed;
 
         if (getModuleOffset() != 0) {
-            hash = ImageStringsReader.hashCode("/", hash);
-            hash = ImageStringsReader.hashCode(getModule(), hash);
-            hash = ImageStringsReader.hashCode("/", hash);
+            hash = ImageStringsReader.unmaskedHashCode("/", hash);
+            hash = ImageStringsReader.unmaskedHashCode(getModule(), hash);
+            hash = ImageStringsReader.unmaskedHashCode("/", hash);
         }
 
         if (getParentOffset() != 0) {
-            hash = ImageStringsReader.hashCode(getParent(), hash);
-            hash = ImageStringsReader.hashCode("/", hash);
+            hash = ImageStringsReader.unmaskedHashCode(getParent(), hash);
+            hash = ImageStringsReader.unmaskedHashCode("/", hash);
         }
 
-        hash = ImageStringsReader.hashCode(getBase(), hash);
+        hash = ImageStringsReader.unmaskedHashCode(getBase(), hash);
 
         if (getExtensionOffset() != 0) {
-            hash = ImageStringsReader.hashCode(".", hash);
-            hash = ImageStringsReader.hashCode(getExtension(), hash);
+            hash = ImageStringsReader.unmaskedHashCode(".", hash);
+            hash = ImageStringsReader.unmaskedHashCode(getExtension(), hash);
         }
 
-        return hash;
+        return hash & ImageStringsReader.POSITIVE_MASK;
     }
 
     @Override
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java
index f9d1f81..ad78055 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java
@@ -43,6 +43,8 @@
 import java.util.stream.Stream;
 
 import jdk.internal.jimage.decompressor.Decompressor;
+import jdk.internal.module.ModuleInfo.Attributes;
+import jdk.internal.module.ModuleTarget;
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.builder.ImageBuilder;
 import jdk.tools.jlink.plugin.PluginException;
@@ -298,6 +300,7 @@
             final ResourcePoolModule module;
             // lazily initialized
             ModuleDescriptor descriptor;
+            ModuleTarget target;
 
             LastModule(ResourcePoolModule module) {
                 this.module = module;
@@ -316,13 +319,31 @@
 
             @Override
             public ModuleDescriptor descriptor() {
-                if (descriptor == null) {
-                    descriptor = ResourcePoolManager.readModuleDescriptor(this);
-                }
+                initModuleAttributes();
                 return descriptor;
             }
 
             @Override
+            public String osName() {
+                initModuleAttributes();
+                return target != null? target.osName() : null;
+            }
+
+            @Override
+            public String osArch() {
+                initModuleAttributes();
+                return target != null? target.osArch() : null;
+            }
+
+            private void initModuleAttributes() {
+                if (this.descriptor == null) {
+                    Attributes attr = ResourcePoolManager.readModuleAttributes(this);
+                    this.descriptor = attr.descriptor();
+                    this.target = attr.target();
+                }
+            }
+
+            @Override
             public Set<String> packages() {
                 return module.packages();
             }
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java
index ecb63cd..5a0d3f2 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
  */
 package jdk.tools.jlink.internal;
 
-import java.lang.reflect.Layer;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleFinder;
 import java.nio.ByteOrder;
 import java.nio.file.Path;
 import java.util.ArrayList;
@@ -33,6 +34,8 @@
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
+
+import jdk.internal.module.ModulePath;
 import jdk.tools.jlink.plugin.Plugin;
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.builder.ImageBuilder;
@@ -51,10 +54,10 @@
      * @return A new plugin or null if plugin is unknown.
      */
     public static Plugin newPlugin(String name,
-            Map<String, String> configuration, Layer pluginsLayer) {
+            Map<String, String> configuration, ModuleLayer pluginsLayer) {
         Objects.requireNonNull(name);
         Objects.requireNonNull(configuration);
-        pluginsLayer = pluginsLayer == null ? Layer.boot() : pluginsLayer;
+        pluginsLayer = pluginsLayer == null ? ModuleLayer.boot() : pluginsLayer;
         return PluginRepository.newPlugin(configuration, name, pluginsLayer);
     }
 
@@ -147,8 +150,8 @@
         private final Path output;
         private final Set<String> modules;
         private final Set<String> limitmods;
-
         private final ByteOrder endian;
+        private final ModuleFinder finder;
 
         /**
          * jlink configuration,
@@ -160,31 +163,23 @@
          * @param endian Jimage byte order. Native order by default
          */
         public JlinkConfiguration(Path output,
-                List<Path> modulepaths,
-                Set<String> modules,
-                Set<String> limitmods,
-                ByteOrder endian) {
-            this.output = output;
-            this.modulepaths = modulepaths == null ? Collections.emptyList() : modulepaths;
-            this.modules = modules == null ? Collections.emptySet() : modules;
-            this.limitmods = limitmods == null ? Collections.emptySet() : limitmods;
-            this.endian = endian == null ? ByteOrder.nativeOrder() : endian;
-        }
+                                  List<Path> modulepaths,
+                                  Set<String> modules,
+                                  Set<String> limitmods,
+                                  ByteOrder endian) {
+            if (Objects.requireNonNull(modulepaths).isEmpty()) {
+                throw new IllegalArgumentException("Empty module path");
+            }
+            if (Objects.requireNonNull(modules).isEmpty()) {
+                throw new IllegalArgumentException("Empty modules");
+            }
 
-        /**
-         * jlink configuration,
-         *
-         * @param output Output directory, must not exist.
-         * @param modulepaths Modules paths
-         * @param modules Root modules to resolve
-         * @param limitmods Limit the universe of observable modules
-         */
-        public JlinkConfiguration(Path output,
-                List<Path> modulepaths,
-                Set<String> modules,
-                Set<String> limitmods) {
-            this(output, modulepaths, modules, limitmods,
-                    ByteOrder.nativeOrder());
+            this.output = output;
+            this.modulepaths = modulepaths;
+            this.modules = modules;
+            this.limitmods = Objects.requireNonNull(limitmods);
+            this.endian = Objects.requireNonNull(endian);
+            this.finder = moduleFinder();
         }
 
         /**
@@ -222,6 +217,45 @@
             return limitmods;
         }
 
+        /**
+         * Returns {@link ModuleFinder} that finds all observable modules
+         * for this jlink configuration.
+         */
+        public ModuleFinder finder() {
+            return finder;
+        }
+
+        /**
+         * Returns a {@link Configuration} of the given module path,
+         * root modules with full service binding.
+         */
+        public Configuration resolveAndBind()
+        {
+            return Configuration.empty().resolveAndBind(finder,
+                                                        ModuleFinder.of(),
+                                                        modules);
+        }
+
+        /**
+         * Returns a {@link Configuration} of the given module path,
+         * root modules with no service binding.
+         */
+        public Configuration resolve()
+        {
+            return Configuration.empty().resolve(finder,
+                                                 ModuleFinder.of(),
+                                                 modules);
+        }
+
+        private ModuleFinder moduleFinder() {
+            Path[] entries = modulepaths.toArray(new Path[0]);
+            ModuleFinder finder = ModulePath.of(Runtime.version(), true, entries);
+            if (!limitmods.isEmpty()) {
+                finder = JlinkTask.limitFinder(finder, limitmods, modules);
+            }
+            return finder;
+        }
+
         @Override
         public String toString() {
             StringBuilder builder = new StringBuilder();
@@ -295,7 +329,7 @@
 
     private PluginsConfiguration addAutoEnabledPlugins(PluginsConfiguration pluginsConfig) {
         List<Plugin> plugins = new ArrayList<>(pluginsConfig.getPlugins());
-        List<Plugin> bootPlugins = PluginRepository.getPlugins(Layer.boot());
+        List<Plugin> bootPlugins = PluginRepository.getPlugins(ModuleLayer.boot());
         for (Plugin bp : bootPlugins) {
             if (Utils.isAutoEnabled(bp)) {
                 try {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
index 0eb7ade..e7644ab 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 import java.io.PrintWriter;
 import java.io.UncheckedIOException;
 import java.lang.module.Configuration;
+import java.lang.module.FindException;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReference;
@@ -53,7 +54,6 @@
 import jdk.tools.jlink.plugin.PluginException;
 import jdk.tools.jlink.builder.DefaultImageBuilder;
 import jdk.tools.jlink.plugin.Plugin;
-import jdk.internal.module.Checks;
 import jdk.internal.module.ModulePath;
 import jdk.internal.module.ModuleResolution;
 
@@ -110,6 +110,12 @@
             Path path = Paths.get(arg);
             task.options.output = path;
         }, "--output"),
+        new Option<JlinkTask>(false, (task, opt, arg) -> {
+            task.options.bindServices = true;
+        }, "--bind-services"),
+        new Option<JlinkTask>(false, (task, opt, arg) -> {
+            task.options.suggestProviders = true;
+        }, "--suggest-providers", "", true),
         new Option<JlinkTask>(true, (task, opt, arg) -> {
             String[] values = arg.split("=");
             // check values
@@ -141,6 +147,9 @@
             }
         }, "--endian"),
         new Option<JlinkTask>(false, (task, opt, arg) -> {
+            task.options.verbose = true;
+        }, "--verbose", "-v"),
+        new Option<JlinkTask>(false, (task, opt, arg) -> {
             task.options.version = true;
         }, "--version"),
         new Option<JlinkTask>(true, (task, opt, arg) -> {
@@ -185,6 +194,7 @@
     static class OptionsValues {
         boolean help;
         String  saveoptsfile;
+        boolean verbose;
         boolean version;
         boolean fullVersion;
         final List<Path> modulePath = new ArrayList<>();
@@ -195,6 +205,8 @@
         Path packagedModulesPath;
         ByteOrder endian = ByteOrder.nativeOrder();
         boolean ignoreSigning = false;
+        boolean bindServices = false;
+        boolean suggestProviders = false;
     }
 
     int run(String[] args) {
@@ -203,7 +215,11 @@
                    new PrintWriter(System.err, true));
         }
         try {
-            optionsHelper.handleOptionsNoUnhandled(this, args);
+            List<String> remaining = optionsHelper.handleOptions(this, args);
+            if (remaining.size() > 0 && !options.suggestProviders) {
+                throw taskHelper.newBadArgs("err.orphan.arguments", toString(remaining))
+                                .showUsage(true);
+            }
             if (options.help) {
                 optionsHelper.showHelp(PROGNAME);
                 return EXIT_OK;
@@ -217,22 +233,29 @@
                 return EXIT_OK;
             }
 
-            if (taskHelper.getExistingImage() == null) {
-                if (options.modulePath.isEmpty()) {
-                    throw taskHelper.newBadArgs("err.modulepath.must.be.specified").showUsage(true);
-                }
-                createImage();
-            } else {
+            if (taskHelper.getExistingImage() != null) {
                 postProcessOnly(taskHelper.getExistingImage());
+                return EXIT_OK;
             }
 
-            if (options.saveoptsfile != null) {
-                Files.write(Paths.get(options.saveoptsfile), getSaveOpts().getBytes());
+            if (options.modulePath.isEmpty()) {
+                throw taskHelper.newBadArgs("err.modulepath.must.be.specified")
+                                .showUsage(true);
+            }
+
+            JlinkConfiguration config = initJlinkConfig();
+            if (options.suggestProviders) {
+                suggestProviders(config, remaining);
+            } else {
+                createImage(config);
+                if (options.saveoptsfile != null) {
+                    Files.write(Paths.get(options.saveoptsfile), getSaveOpts().getBytes());
+                }
             }
 
             return EXIT_OK;
         } catch (PluginException | IllegalArgumentException |
-                 UncheckedIOException |IOException | ResolutionException e) {
+                 UncheckedIOException |IOException | FindException | ResolutionException e) {
             log.println(taskHelper.getMessage("error.prefix") + " " + e.getMessage());
             if (DEBUG) {
                 e.printStackTrace(log);
@@ -266,25 +289,13 @@
         Objects.requireNonNull(config.getOutput());
         plugins = plugins == null ? new PluginsConfiguration() : plugins;
 
-        if (config.getModulepaths().isEmpty()) {
-            throw new IllegalArgumentException("Empty module paths");
-        }
-
-        ModuleFinder finder = newModuleFinder(config.getModulepaths(),
-                                              config.getLimitmods(),
-                                              config.getModules());
-
-        if (config.getModules().isEmpty()) {
-            throw new IllegalArgumentException("No modules to add");
-        }
-
         // First create the image provider
         ImageProvider imageProvider =
-                createImageProvider(finder,
-                                    config.getModules(),
-                                    config.getByteOrder(),
+                createImageProvider(config,
                                     null,
                                     IGNORE_SIGNING_DEFAULT,
+                                    false,
+                                    false,
                                     null);
 
         // Then create the Plugin Stack
@@ -319,20 +330,24 @@
 
     // the token for "all modules on the module path"
     private static final String ALL_MODULE_PATH = "ALL-MODULE-PATH";
-    private void createImage() throws Exception {
-        if (options.output == null) {
-            throw taskHelper.newBadArgs("err.output.must.be.specified").showUsage(true);
-        }
-
+    private JlinkConfiguration initJlinkConfig() throws BadArgs {
         if (options.addMods.isEmpty()) {
             throw taskHelper.newBadArgs("err.mods.must.be.specified", "--add-modules")
-                    .showUsage(true);
+                .showUsage(true);
         }
 
         Set<String> roots = new HashSet<>();
         for (String mod : options.addMods) {
             if (mod.equals(ALL_MODULE_PATH)) {
-                ModuleFinder finder = modulePathFinder();
+                Path[] entries = options.modulePath.toArray(new Path[0]);
+                ModuleFinder finder = ModulePath.of(Runtime.version(), true, entries);
+                if (!options.limitMods.isEmpty()) {
+                    // finder for the observable modules specified in
+                    // the --module-path and --limit-modules options
+                    finder = limitFinder(finder, options.limitMods, Collections.emptySet());
+                }
+
+                // all observable modules are roots
                 finder.findAll()
                       .stream()
                       .map(ModuleReference::descriptor)
@@ -343,40 +358,34 @@
             }
         }
 
-        ModuleFinder finder = newModuleFinder(options.modulePath,
-                                              options.limitMods,
-                                              roots);
+        return new JlinkConfiguration(options.output,
+                                      options.modulePath,
+                                      roots,
+                                      options.limitMods,
+                                      options.endian);
+    }
 
+    private void createImage(JlinkConfiguration config) throws Exception {
+        if (options.output == null) {
+            throw taskHelper.newBadArgs("err.output.must.be.specified").showUsage(true);
+        }
 
         // First create the image provider
-        ImageProvider imageProvider = createImageProvider(finder,
-                                                          roots,
-                                                          options.endian,
+        ImageProvider imageProvider = createImageProvider(config,
                                                           options.packagedModulesPath,
                                                           options.ignoreSigning,
+                                                          options.bindServices,
+                                                          options.verbose,
                                                           log);
 
         // Then create the Plugin Stack
-        ImagePluginStack stack = ImagePluginConfiguration.
-                parseConfiguration(taskHelper.getPluginsConfig(options.output, options.launchers));
+        ImagePluginStack stack = ImagePluginConfiguration.parseConfiguration(
+            taskHelper.getPluginsConfig(options.output, options.launchers));
 
         //Ask the stack to proceed
         stack.operate(imageProvider);
     }
 
-    /**
-     * Returns a module finder to find the observable modules specified in
-     * the --module-path and --limit-modules options
-     */
-    private ModuleFinder modulePathFinder() {
-        Path[] entries = options.modulePath.toArray(new Path[0]);
-        ModuleFinder finder = new ModulePath(Runtime.version(), true, entries);
-        if (!options.limitMods.isEmpty()) {
-            finder = limitFinder(finder, options.limitMods, Collections.emptySet());
-        }
-        return finder;
-    }
-
     /*
      * Returns a module finder of the given module path that limits
      * the observable modules to those in the transitive closure of
@@ -388,7 +397,7 @@
                                                Set<String> roots)
     {
         Path[] entries = paths.toArray(new Path[0]);
-        ModuleFinder finder = new ModulePath(Runtime.version(), true, entries);
+        ModuleFinder finder = ModulePath.of(Runtime.version(), true, entries);
 
         // if limitmods is specified then limit the universe
         if (!limitMods.isEmpty()) {
@@ -405,30 +414,33 @@
         return Paths.get(uri);
     }
 
-    private static ImageProvider createImageProvider(ModuleFinder finder,
-                                                     Set<String> roots,
-                                                     ByteOrder order,
+
+    private static ImageProvider createImageProvider(JlinkConfiguration config,
                                                      Path retainModulesPath,
                                                      boolean ignoreSigning,
+                                                     boolean bindService,
+                                                     boolean verbose,
                                                      PrintWriter log)
             throws IOException
     {
-        if (roots.isEmpty()) {
-            throw new IllegalArgumentException("empty modules and limitmods");
+        Configuration cf = bindService ? config.resolveAndBind()
+                                       : config.resolve();
+
+        if (verbose && log != null) {
+            // print modules to be linked in
+            cf.modules().stream()
+              .sorted(Comparator.comparing(ResolvedModule::name))
+              .forEach(rm -> log.format("module %s (%s)%n",
+                                        rm.name(), rm.reference().location().get()));
+
+            // print provider info
+            Set<ModuleReference> references = cf.modules().stream()
+                .map(ResolvedModule::reference).collect(Collectors.toSet());
+
+            String msg = String.format("%n%s:", taskHelper.getMessage("providers.header"));
+            printProviders(log, msg, references);
         }
 
-        Configuration cf = Configuration.empty()
-                .resolveRequires(finder,
-                                 ModuleFinder.of(),
-                                 roots);
-
-        // emit warning for modules that end with a digit
-        cf.modules().stream()
-            .map(ResolvedModule::name)
-            .filter(mn -> !Checks.hasLegalModuleNameLastCharacter(mn))
-            .forEach(mn -> System.err.println("WARNING: Module name \""
-                                              + mn + "\" may soon be illegal"));
-
         // emit a warning for any incubating modules in the configuration
         if (log != null) {
             String im = cf.modules()
@@ -445,22 +457,22 @@
 
         Map<String, Path> mods = cf.modules().stream()
             .collect(Collectors.toMap(ResolvedModule::name, JlinkTask::toPathLocation));
-        return new ImageHelper(cf, mods, order, retainModulesPath, ignoreSigning);
+        return new ImageHelper(cf, mods, config.getByteOrder(), retainModulesPath, ignoreSigning);
     }
 
     /*
      * Returns a ModuleFinder that limits observability to the given root
      * modules, their transitive dependences, plus a set of other modules.
      */
-    private static ModuleFinder limitFinder(ModuleFinder finder,
-                                            Set<String> roots,
-                                            Set<String> otherMods) {
+    public static ModuleFinder limitFinder(ModuleFinder finder,
+                                           Set<String> roots,
+                                           Set<String> otherMods) {
 
         // resolve all root modules
         Configuration cf = Configuration.empty()
-                .resolveRequires(finder,
-                                 ModuleFinder.of(),
-                                 roots);
+                .resolve(finder,
+                         ModuleFinder.of(),
+                         roots);
 
         // module name -> reference
         Map<String, ModuleReference> map = new HashMap<>();
@@ -491,6 +503,147 @@
         };
     }
 
+    /*
+     * Returns a map of each service type to the modules that use it
+     */
+    private static Map<String, Set<String>> uses(Set<ModuleReference> modules) {
+        // collects the services used by the modules and print uses
+        Map<String, Set<String>> uses = new HashMap<>();
+        modules.stream()
+               .map(ModuleReference::descriptor)
+               .forEach(md -> md.uses().forEach(s ->
+                   uses.computeIfAbsent(s, _k -> new HashSet<>()).add(md.name()))
+               );
+        return uses;
+    }
+
+    private static void printProviders(PrintWriter log,
+                                       String header,
+                                       Set<ModuleReference> modules) {
+        printProviders(log, header, modules, uses(modules));
+    }
+
+    /*
+     * Prints the providers that are used by the services specified in
+     * the given modules.
+     *
+     * The specified uses maps a service type name to the modules
+     * using the service type and that may or may not be present
+     * the given modules.
+     */
+    private static void printProviders(PrintWriter log,
+                                       String header,
+                                       Set<ModuleReference> modules,
+                                       Map<String, Set<String>> uses) {
+        if (modules.isEmpty())
+            return;
+
+        // Build a map of a service type to the provider modules
+        Map<String, Set<ModuleDescriptor>> providers = new HashMap<>();
+        modules.stream()
+            .map(ModuleReference::descriptor)
+            .forEach(md -> {
+                md.provides().stream()
+                  .filter(p -> uses.containsKey(p.service()))
+                  .forEach(p -> providers.computeIfAbsent(p.service(), _k -> new HashSet<>())
+                                         .add(md));
+            });
+
+        if (!providers.isEmpty()) {
+            log.println(header);
+        }
+
+        // print the providers of the service types used by the specified modules
+        // sorted by the service type name and then provider's module name
+        providers.entrySet().stream()
+            .sorted(Map.Entry.comparingByKey())
+            .forEach(e -> {
+                String service = e.getKey();
+                e.getValue().stream()
+                 .sorted(Comparator.comparing(ModuleDescriptor::name))
+                 .forEach(md ->
+                     md.provides().stream()
+                       .filter(p -> p.service().equals(service))
+                       .forEach(p -> log.format("  module %s provides %s, used by %s%n",
+                                                md.name(), p.service(),
+                                                uses.get(p.service()).stream()
+                                                    .sorted()
+                                                    .collect(Collectors.joining(","))))
+                 );
+            });
+    }
+
+    private void suggestProviders(JlinkConfiguration config, List<String> args)
+        throws BadArgs
+    {
+        if (args.size() > 1) {
+            throw taskHelper.newBadArgs("err.orphan.argument",
+                                        toString(args.subList(1, args.size())))
+                            .showUsage(true);
+        }
+
+        if (options.bindServices) {
+            log.println(taskHelper.getMessage("no.suggested.providers"));
+            return;
+        }
+
+        ModuleFinder finder = config.finder();
+        if (args.isEmpty()) {
+            // print providers used by the modules resolved without service binding
+            Configuration cf = config.resolve();
+            Set<ModuleReference> mrefs = cf.modules().stream()
+                .map(ResolvedModule::reference)
+                .collect(Collectors.toSet());
+
+            // print uses of the modules that would be linked into the image
+            mrefs.stream()
+                 .sorted(Comparator.comparing(mref -> mref.descriptor().name()))
+                 .forEach(mref -> {
+                     ModuleDescriptor md = mref.descriptor();
+                     log.format("module %s located (%s)%n", md.name(),
+                                mref.location().get());
+                     md.uses().stream().sorted()
+                       .forEach(s -> log.format("    uses %s%n", s));
+                 });
+
+            String msg = String.format("%n%s:", taskHelper.getMessage("suggested.providers.header"));
+            printProviders(log, msg, finder.findAll(), uses(mrefs));
+
+        } else {
+            // comma-separated service types, if specified
+            Set<String> names = Stream.of(args.get(0).split(","))
+                .collect(Collectors.toSet());
+            // find the modules that provide the specified service
+            Set<ModuleReference> mrefs = finder.findAll().stream()
+                .filter(mref -> mref.descriptor().provides().stream()
+                                    .map(ModuleDescriptor.Provides::service)
+                                    .anyMatch(names::contains))
+                .collect(Collectors.toSet());
+
+            // the specified services may or may not be in the modules that
+            // would be linked in.  So find uses declared in all observable modules
+            Map<String, Set<String>> uses = uses(finder.findAll());
+
+            // check if any name given on the command line are unused service
+            mrefs.stream()
+                 .flatMap(mref -> mref.descriptor().provides().stream()
+                                      .map(ModuleDescriptor.Provides::service))
+                 .forEach(names::remove);
+            if (!names.isEmpty()) {
+                log.println(taskHelper.getMessage("warn.unused.services",
+                                                  toString(names)));
+            }
+
+            String msg = String.format("%n%s:", taskHelper.getMessage("suggested.providers.header"));
+            printProviders(log, msg, mrefs, uses);
+        }
+    }
+
+    private static String toString(Collection<String> collection) {
+        return collection.stream().sorted()
+                         .collect(Collectors.joining(","));
+    }
+
     private String getSaveOpts() {
         StringBuilder sb = new StringBuilder();
         sb.append('#').append(new Date()).append("\n");
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModuleSorter.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModuleSorter.java
index 2b9981e..42cbe9f 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModuleSorter.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModuleSorter.java
@@ -30,6 +30,8 @@
 import jdk.tools.jlink.plugin.ResourcePoolModuleView;
 
 import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Requires.Modifier;
+
 import java.nio.ByteBuffer;
 import java.util.Deque;
 import java.util.HashMap;
@@ -67,14 +69,15 @@
 
     private ModuleSorter addModule(ResourcePoolModule module) {
         addNode(module);
-        readModuleDescriptor(module).requires().stream()
-            .forEach(req -> {
-                String dm = req.name();
-                ResourcePoolModule dep = moduleView.findModule(dm)
-                    .orElseThrow(() -> new PluginException(dm + " not found"));
+        readModuleDescriptor(module).requires().forEach(req -> {
+            ResourcePoolModule dep = moduleView.findModule(req.name()).orElse(null);
+            if (dep != null) {
                 addNode(dep);
                 edges.get(module.name()).add(dep);
-            });
+            } else if (!req.modifiers().contains(Modifier.STATIC)) {
+                throw new PluginException(req.name() + " not found");
+            }
+        });
         return this;
     }
 
@@ -113,7 +116,7 @@
             return;
         }
         visited.add(node);
-        edges.get(node.name()).stream()
+        edges.get(node.name())
              .forEach(x -> visit(x, visited, done));
         done.add(node);
         result.addLast(node);
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java
index 1d39c2c..b12bf00 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java
@@ -24,7 +24,6 @@
  */
 package jdk.tools.jlink.internal;
 
-import java.lang.reflect.Layer;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -56,7 +55,7 @@
      * @return A provider or null if not found.
      */
     public static Plugin getPlugin(String name,
-            Layer pluginsLayer) {
+            ModuleLayer pluginsLayer) {
         return getPlugin(Plugin.class, name, pluginsLayer);
     }
 
@@ -69,7 +68,7 @@
      * @return A plugin or null if no plugin found.
      */
     public static Plugin newPlugin(Map<String, String> config, String name,
-            Layer pluginsLayer) {
+            ModuleLayer pluginsLayer) {
         Objects.requireNonNull(name);
         Objects.requireNonNull(pluginsLayer);
         Plugin plugin = getPlugin(name, pluginsLayer);
@@ -107,12 +106,12 @@
         registeredPlugins.remove(name);
     }
 
-    public static List<Plugin> getPlugins(Layer pluginsLayer) {
+    public static List<Plugin> getPlugins(ModuleLayer pluginsLayer) {
         return getPlugins(Plugin.class, pluginsLayer);
     }
 
     private static <T extends Plugin> T getPlugin(Class<T> clazz, String name,
-            Layer pluginsLayer) {
+            ModuleLayer pluginsLayer) {
         Objects.requireNonNull(name);
         Objects.requireNonNull(pluginsLayer);
         @SuppressWarnings("unchecked")
@@ -136,7 +135,7 @@
      * @param pluginsLayer
      * @return The list of plugins.
      */
-    private static <T extends Plugin> List<T> getPlugins(Class<T> clazz, Layer pluginsLayer) {
+    private static <T extends Plugin> List<T> getPlugins(Class<T> clazz, ModuleLayer pluginsLayer) {
         Objects.requireNonNull(pluginsLayer);
         List<T> factories = new ArrayList<>();
         try {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolConfiguration.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolConfiguration.java
index 9c81c77..66ab836 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolConfiguration.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolConfiguration.java
@@ -51,7 +51,7 @@
         ModuleDescriptor md = mod.descriptor();
 
         // drop hashes
-        ModuleDescriptor.Builder builder = ModuleDescriptor.module(md.name());
+        ModuleDescriptor.Builder builder = ModuleDescriptor.newModule(md.name());
         md.requires().stream()
           .forEach(builder::requires);
         md.exports().stream()
@@ -62,18 +62,10 @@
           .forEach(builder::uses);
         md.provides().stream()
           .forEach(builder::provides);
-
-        // build the proper concealed packages
-        Set<String> concealed = new HashSet<>(mod.packages());
-        md.exports().stream().map(ModuleDescriptor.Exports::source).forEach(concealed::remove);
-        md.opens().stream().map(ModuleDescriptor.Opens::source).forEach(concealed::remove);
-        concealed.stream().forEach(builder::contains);
+        builder.packages(md.packages());
 
         md.version().ifPresent(builder::version);
         md.mainClass().ifPresent(builder::mainClass);
-        md.osName().ifPresent(builder::osName);
-        md.osArch().ifPresent(builder::osArch);
-        md.osVersion().ifPresent(builder::osVersion);
 
         return builder.build();
     }
@@ -102,7 +94,9 @@
             ModuleDescriptor desc = m.descriptor();
             if (!desc.packages().equals(m.packages())) {
                 throw new RuntimeException("Module " + m.name() +
-                   "'s descriptor returns inconsistent package set");
+                   "'s descriptor indicates the set of packages is : " +
+                   desc.packages() + ", but module contains packages: " +
+                   m.packages());
             }
         });
     }
@@ -124,7 +118,7 @@
             }
         };
 
-        return Configuration.empty().resolveRequires(
+        return Configuration.empty().resolve(
             finder, ModuleFinder.of(), nameToModRef.keySet());
     }
 }
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolManager.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolManager.java
index e3b0461..e6b0843 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolManager.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolManager.java
@@ -35,7 +35,10 @@
 import java.util.Set;
 import java.util.stream.Stream;
 import jdk.internal.jimage.decompressor.CompressedResourceHeader;
-import jdk.internal.loader.ResourceHelper;
+import jdk.internal.module.Resources;
+import jdk.internal.module.ModuleInfo;
+import jdk.internal.module.ModuleInfo.Attributes;
+import jdk.internal.module.ModuleTarget;
 import jdk.tools.jlink.plugin.ResourcePool;
 import jdk.tools.jlink.plugin.ResourcePoolBuilder;
 import jdk.tools.jlink.plugin.ResourcePoolEntry;
@@ -47,8 +50,8 @@
  * A manager for pool of resources.
  */
 public class ResourcePoolManager {
-    // utility to read ModuleDescriptor of the given ResourcePoolModule
-    static ModuleDescriptor readModuleDescriptor(ResourcePoolModule mod) {
+    // utility to read Module Attributes of the given ResourcePoolModule
+    static Attributes readModuleAttributes(ResourcePoolModule mod) {
         String p = "/" + mod.name() + "/module-info.class";
         Optional<ResourcePoolEntry> content = mod.findEntry(p);
         if (!content.isPresent()) {
@@ -57,9 +60,9 @@
         }
         ByteBuffer bb = ByteBuffer.wrap(content.get().contentBytes());
         try {
-            return ModuleDescriptor.read(bb);
+            return ModuleInfo.read(bb, null);
         } catch (RuntimeException re) {
-            throw new RuntimeException("module descriptor cannot be read for " + mod.name(), re);
+            throw new RuntimeException("module info cannot be read for " + mod.name(), re);
         }
     }
 
@@ -68,7 +71,7 @@
      */
     public static boolean isNamedPackageResource(String path) {
         return (path.endsWith(".class") && !path.endsWith("module-info.class")) ||
-                !ResourceHelper.isSimpleResource(path);
+                Resources.canEncapsulate(path);
     }
 
     class ResourcePoolModuleImpl implements ResourcePoolModule {
@@ -76,6 +79,8 @@
         final Map<String, ResourcePoolEntry> moduleContent = new LinkedHashMap<>();
         // lazily initialized
         private ModuleDescriptor descriptor;
+        private ModuleTarget target;
+
         final String name;
 
         private ResourcePoolModuleImpl(String name) {
@@ -100,13 +105,31 @@
 
         @Override
         public ModuleDescriptor descriptor() {
-            if (descriptor == null) {
-                descriptor = readModuleDescriptor(this);
-            }
+            initModuleAttributes();
             return descriptor;
         }
 
         @Override
+        public String osName() {
+            initModuleAttributes();
+            return target != null? target.osName() : null;
+        }
+
+        @Override
+        public String osArch() {
+            initModuleAttributes();
+            return target != null? target.osArch() : null;
+        }
+
+        private void initModuleAttributes() {
+            if (this.descriptor == null) {
+                Attributes attr = readModuleAttributes(this);
+                this.descriptor = attr.descriptor();
+                this.target = attr.target();
+            }
+        }
+
+        @Override
         public Set<String> packages() {
             Set<String> pkgs = new HashSet<>();
             moduleContent.values().stream()
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
index 7c60d79..f5a312d 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
 import java.io.PrintWriter;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -46,6 +45,7 @@
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 import java.util.Set;
+import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 import jdk.tools.jlink.internal.plugins.ExcludeJmodSectionPlugin;
@@ -101,8 +101,15 @@
         final boolean hidden;
         final String name;
         final String shortname;
+        final boolean terminalOption;
 
-        public Option(boolean hasArg, Processing<T> processing, boolean hidden, String name, String shortname) {
+        public Option(boolean hasArg,
+                      Processing<T> processing,
+                      boolean hidden,
+                      String name,
+                      String shortname,
+                      boolean isTerminal)
+        {
             if (!name.startsWith("--")) {
                 throw new RuntimeException("option name missing --, " + name);
             }
@@ -115,24 +122,33 @@
             this.hidden = hidden;
             this.name = name;
             this.shortname = shortname;
+            this.terminalOption = isTerminal;
+        }
+
+        public Option(boolean hasArg, Processing<T> processing, String name, String shortname, boolean isTerminal) {
+            this(hasArg, processing, false, name, shortname, isTerminal);
         }
 
         public Option(boolean hasArg, Processing<T> processing, String name, String shortname) {
-            this(hasArg, processing, false, name, shortname);
+            this(hasArg, processing, false, name, shortname, false);
         }
 
         public Option(boolean hasArg, Processing<T> processing, boolean hidden, String name) {
-            this(hasArg, processing, hidden, name, "");
+            this(hasArg, processing, hidden, name, "", false);
         }
 
         public Option(boolean hasArg, Processing<T> processing, String name) {
-            this(hasArg, processing, false, name, "");
+            this(hasArg, processing, false, name, "", false);
         }
 
         public boolean isHidden() {
             return hidden;
         }
 
+        public boolean isTerminal() {
+            return terminalOption;
+        }
+
         public boolean matches(String opt) {
             return opt.equals(name) ||
                    opt.equals(shortname) ||
@@ -179,12 +195,12 @@
     private static class PluginOption extends Option<PluginsHelper> {
         public PluginOption(boolean hasArg,
                 Processing<PluginsHelper> processing, boolean hidden, String name, String shortname) {
-            super(hasArg, processing, hidden, name, shortname);
+            super(hasArg, processing, hidden, name, shortname, false);
         }
 
         public PluginOption(boolean hasArg,
                 Processing<PluginsHelper> processing, boolean hidden, String name) {
-            super(hasArg, processing, hidden, name, "");
+            super(hasArg, processing, hidden, name, "", false);
         }
 
         public String resourcePrefix() {
@@ -194,7 +210,7 @@
 
     private final class PluginsHelper {
 
-        private Layer pluginsLayer = Layer.boot();
+        private ModuleLayer pluginsLayer = ModuleLayer.boot();
         private final List<Plugin> plugins;
         private String lastSorter;
         private boolean listPlugins;
@@ -498,21 +514,13 @@
             return null;
         }
 
-        // used by jimage. Return unhandled arguments like "create", "describe".
+        /**
+         * Handles all options.  This method stops processing the argument
+         * at the first non-option argument i.e. not starts with `-`, or
+         * at the first terminal option and returns the remaining arguments,
+         * if any.
+         */
         public List<String> handleOptions(T task, String[] args) throws BadArgs {
-            return handleOptions(task, args, true);
-        }
-
-        // used by jlink. No unhandled arguments like "create", "describe".
-        void handleOptionsNoUnhandled(T task, String[] args) throws BadArgs {
-            handleOptions(task, args, false);
-        }
-
-        // shared code that handles options for both jlink and jimage. jimage uses arguments like
-        // "create", "describe" etc. as "task names". Those arguments are unhandled here and returned
-        // as "unhandled arguments list". jlink does not want such arguments. "collectUnhandled" flag
-        // tells whether to allow for unhandled arguments or not.
-        private List<String> handleOptions(T task, String[] args, boolean collectUnhandled) throws BadArgs {
             // findbugs warning, copy instead of keeping a reference.
             command = Arrays.copyOf(args, args.length);
 
@@ -521,17 +529,15 @@
             // Unit tests can call Task multiple time in same JVM.
             pluginOptions = new PluginsHelper(null);
 
-            List<String> rest = collectUnhandled? new ArrayList<>() : null;
             // process options
             for (int i = 0; i < args.length; i++) {
-                if (args[i].charAt(0) == '-') {
+                if (args[i].startsWith("-")) {
                     String name = args[i];
                     PluginOption pluginOption = null;
                     Option<T> option = getOption(name);
                     if (option == null) {
                         pluginOption = pluginOptions.getOption(name);
                         if (pluginOption == null) {
-
                             throw new BadArgs("err.unknown.option", name).
                                     showUsage(true);
                         }
@@ -556,20 +562,23 @@
                         pluginOption.process(pluginOptions, name, param);
                     } else {
                         option.process(task, name, param);
+                        if (option.isTerminal()) {
+                            return ++i < args.length
+                                        ? Stream.of(Arrays.copyOfRange(args, i, args.length))
+                                                .collect(Collectors.toList())
+                                        : Collections.emptyList();
+
+                        }
                     }
                     if (opt.ignoreRest()) {
                         i = args.length;
                     }
                 } else {
-                    if (collectUnhandled) {
-                        rest.add(args[i]);
-                    } else {
-                        throw new BadArgs("err.orphan.argument", args[i]).
-                            showUsage(true);
-                    }
+                    return Stream.of(Arrays.copyOfRange(args, i, args.length))
+                                 .collect(Collectors.toList());
                 }
             }
-            return rest;
+            return Collections.emptyList();
         }
 
         private Option<T> getOption(String name) {
@@ -645,7 +654,7 @@
             return defaults;
         }
 
-        public Layer getPluginsLayer() {
+        public ModuleLayer getPluginsLayer() {
             return pluginOptions.pluginsLayer;
         }
     }
@@ -715,18 +724,18 @@
         return System.getProperty("java.version");
     }
 
-    static Layer createPluginsLayer(List<Path> paths) {
+    static ModuleLayer createPluginsLayer(List<Path> paths) {
 
         Path[] dirs = paths.toArray(new Path[0]);
-        ModuleFinder finder = new ModulePath(Runtime.version(), true, dirs);
-        Configuration bootConfiguration = Layer.boot().configuration();
+        ModuleFinder finder = ModulePath.of(Runtime.version(), true, dirs);
+        Configuration bootConfiguration = ModuleLayer.boot().configuration();
         try {
             Configuration cf = bootConfiguration
-                .resolveRequiresAndUses(ModuleFinder.of(),
-                                        finder,
-                                        Collections.emptySet());
+                .resolveAndBind(ModuleFinder.of(),
+                                finder,
+                                Collections.emptySet());
             ClassLoader scl = ClassLoader.getSystemClassLoader();
-            return Layer.boot().defineModulesWithOneLoader(cf, scl);
+            return ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
         } catch (Exception ex) {
             // Malformed plugin modules (e.g.: same package in multiple modules).
             throw new PluginException("Invalid modules in the plugins path: " + ex);
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java
index ef8fb39..fd0dc13 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java
@@ -24,7 +24,6 @@
  */
 package jdk.tools.jlink.internal;
 
-import java.lang.reflect.Module;
 import java.net.URI;
 import java.nio.file.FileSystem;
 import java.nio.file.FileSystems;
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java
index dd0889d..3632ccb 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.lang.module.ModuleFinder;
+import java.nio.ByteOrder;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -93,9 +94,12 @@
 
     public void build() throws IOException {
         // jlink main arguments
-        Jlink.JlinkConfiguration jlinkConfig = new Jlink.JlinkConfiguration(
-            new File("").toPath(), // Unused
-            modulePath, addModules, limitModules);
+        Jlink.JlinkConfiguration jlinkConfig =
+            new Jlink.JlinkConfiguration(new File("").toPath(), // Unused
+                                         modulePath,
+                                         addModules,
+                                         limitModules,
+                                         ByteOrder.nativeOrder());
 
         // plugin configuration
         List<Plugin> plugins = new ArrayList<Plugin>();
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java
index 67ce62f..69add47 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java
@@ -25,6 +25,7 @@
 package jdk.tools.jlink.internal.plugins;
 
 import java.util.Map;
+import java.util.function.Function;
 
 import jdk.tools.jlink.internal.ResourcePoolManager.ResourcePoolImpl;
 import jdk.tools.jlink.plugin.ResourcePool;
@@ -64,9 +65,10 @@
             return ss.transform(in, out);
         } else if (zip != null) {
             return zip.transform(in, out);
+        } else {
+            in.transformAndCopy(Function.identity(), out);
+            return out.build();
         }
-
-        return out.build();
     }
 
     @Override
@@ -103,21 +105,20 @@
         if (level != null) {
             switch (level) {
                 case LEVEL_0:
-                    ss = new StringSharingPlugin(resFilter);
+                    ss = null;
+                    zip = null;
                     break;
                 case LEVEL_1:
-                    zip = new ZipPlugin(resFilter);
+                    ss = new StringSharingPlugin(resFilter);
                     break;
                 case LEVEL_2:
-                    ss = new StringSharingPlugin(resFilter);
                     zip = new ZipPlugin(resFilter);
                     break;
                 default:
                     throw new IllegalArgumentException("Invalid compression level " + level);
             }
         } else {
-            ss = new StringSharingPlugin(resFilter);
-            zip = new ZipPlugin(resFilter);
+            throw new IllegalArgumentException("Invalid compression level " + level);
         }
     }
 }
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java
index 20e7ef2..be14cc9 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java
@@ -95,9 +95,9 @@
 
     /**
      * VM paths:
-     * /java.base/native/{architecture}/{server|client|minimal}/{shared lib}
-     * e.g.: /java.base/native/amd64/server/libjvm.so
-     * /java.base/native/server/libjvm.dylib
+     * /java.base/lib/{architecture}/{server|client|minimal}/{shared lib}
+     * e.g.: /java.base/lib/server/libjvm.so
+     * /java.base/lib/server/libjvm.dylib
      */
     private List<ResourcePoolEntry> getVMs(ResourcePoolModule javaBase, String[] jvmlibs) {
         List<ResourcePoolEntry> ret = javaBase.entries().filter((t) -> {
@@ -115,7 +115,7 @@
     @Override
     public ResourcePool transform(ResourcePool in, ResourcePoolBuilder out) {
         ResourcePoolModule javaBase = in.moduleView().findModule("java.base").get();
-        String[] jvmlibs = jvmlibs(javaBase.descriptor().osName().get());
+        String[] jvmlibs = jvmlibs(javaBase.osName());
         TreeSet<Jvm> existing = new TreeSet<>(new JvmComparator());
         TreeSet<Jvm> removed = new TreeSet<>(new JvmComparator());
         if (!keepAll) {
@@ -198,17 +198,17 @@
             }
             case CLIENT: {
                 target = Jvm.CLIENT;
-                exclude = "/java.base/native**server/**,/java.base/native**minimal/**";
+                exclude = "/java.base/lib**server/**,/java.base/lib**minimal/**";
                 break;
             }
             case SERVER: {
                 target = Jvm.SERVER;
-                exclude = "/java.base/native**client/**,/java.base/native**minimal/**";
+                exclude = "/java.base/lib**client/**,/java.base/lib**minimal/**";
                 break;
             }
             case MINIMAL: {
                 target = Jvm.MINIMAL;
-                exclude = "/java.base/native**server/**,/java.base/native**client/**";
+                exclude = "/java.base/lib**server/**,/java.base/lib**client/**";
                 break;
             }
             default: {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java
index 00a90f2..99771fe 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java
@@ -24,14 +24,17 @@
  */
 package jdk.tools.jlink.internal.plugins;
 
+import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.lang.invoke.MethodType;
+import java.lang.module.ModuleDescriptor;
 import java.nio.file.Files;
-import java.util.ArrayList;
 import java.util.EnumSet;
-import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
@@ -51,8 +54,13 @@
 public final class GenerateJLIClassesPlugin implements Plugin {
 
     private static final String NAME = "generate-jli-classes";
+    private static final String IGNORE_VERSION = "ignore-version";
 
     private static final String DESCRIPTION = PluginsResourceBundle.getDescription(NAME);
+    private static final String IGNORE_VERSION_WARNING = NAME + ".ignore.version.warn";
+    private static final String VERSION_MISMATCH_WARNING = NAME + ".version.mismatch.warn";
+
+    private static final String DEFAULT_TRACE_FILE = "default_jli_trace.txt";
 
     private static final String DIRECT_HOLDER = "java/lang/invoke/DirectMethodHandle$Holder";
     private static final String DMH_INVOKE_VIRTUAL = "invokeVirtual";
@@ -69,11 +77,15 @@
     private static final JavaLangInvokeAccess JLIA
             = SharedSecrets.getJavaLangInvokeAccess();
 
-    Set<String> speciesTypes;
+    Set<String> speciesTypes = Set.of();
 
-    Set<String> invokerTypes;
+    Set<String> invokerTypes = Set.of();
 
-    Map<String, Set<String>> dmhMethods;
+    Map<String, Set<String>> dmhMethods = Map.of();
+
+    String mainArgument;
+
+    boolean ignoreVersion;
 
     public GenerateJLIClassesPlugin() {
     }
@@ -157,69 +169,101 @@
 
     @Override
     public void configure(Map<String, String> config) {
-        String mainArgument = config.get(NAME);
+        mainArgument = config.get(NAME);
+        ignoreVersion = Boolean.parseBoolean(config.get(IGNORE_VERSION));
+    }
 
+    public void initialize(ResourcePool in) {
         // Start with the default configuration
-        Set<String> defaultBMHSpecies = defaultSpecies();
-        // Expand BMH species signatures
-        defaultBMHSpecies = defaultBMHSpecies.stream()
+        speciesTypes = defaultSpecies().stream()
                 .map(type -> expandSignature(type))
                 .collect(Collectors.toSet());
 
-        Set<String> defaultInvokerTypes = defaultInvokers();
-        validateMethodTypes(defaultInvokerTypes);
+        invokerTypes = defaultInvokers();
+        validateMethodTypes(invokerTypes);
 
-        Map<String, Set<String>> defaultDmhMethods = defaultDMHMethods();
-        for (Set<String> dmhMethodTypes : defaultDmhMethods.values()) {
+        dmhMethods = defaultDMHMethods();
+        for (Set<String> dmhMethodTypes : dmhMethods.values()) {
             validateMethodTypes(dmhMethodTypes);
         }
 
         // Extend the default configuration with the contents in the supplied
-        // input file
+        // input file - if none was supplied we look for the default file
         if (mainArgument == null || !mainArgument.startsWith("@")) {
-            speciesTypes = defaultBMHSpecies;
-            invokerTypes = defaultInvokerTypes;
-            dmhMethods = defaultDmhMethods;
+            try (InputStream traceFile =
+                    this.getClass().getResourceAsStream(DEFAULT_TRACE_FILE)) {
+                if (traceFile != null) {
+                    readTraceConfig(
+                        new BufferedReader(
+                            new InputStreamReader(traceFile)).lines());
+                }
+            } catch (Exception e) {
+                throw new PluginException("Couldn't read " + DEFAULT_TRACE_FILE, e);
+            }
         } else {
             File file = new File(mainArgument.substring(1));
             if (file.exists()) {
-                // Use TreeSet/TreeMap to keep things sorted in a deterministic
-                // order to avoid scrambling the layout on small changes and to
-                // ease finding methods in the generated code
-                speciesTypes = new TreeSet<>(defaultBMHSpecies);
-                invokerTypes = new TreeSet<>(defaultInvokerTypes);
-                dmhMethods = new TreeMap<>();
-                for (Map.Entry<String, Set<String>> entry : defaultDmhMethods.entrySet()) {
-                    dmhMethods.put(entry.getKey(), new TreeSet<>(entry.getValue()));
-                }
-                fileLines(file)
-                    .map(line -> line.split(" "))
-                    .forEach(parts -> {
-                        switch (parts[0]) {
-                            case "[BMH_RESOLVE]":
-                                speciesTypes.add(expandSignature(parts[1]));
-                                break;
-                            case "[LF_RESOLVE]":
-                                String methodType = parts[3];
-                                validateMethodType(methodType);
-                                if (parts[1].contains("Invokers")) {
-                                    invokerTypes.add(methodType);
-                                } else if (parts[1].contains("DirectMethodHandle")) {
-                                    String dmh = parts[2];
-                                    // ignore getObject etc for now (generated
-                                    // by default)
-                                    if (DMH_METHOD_TYPE_MAP.containsKey(dmh)) {
-                                        addDMHMethodType(dmh, methodType);
-                                    }
-                                }
-                                break;
-                            default: break; // ignore
-                        }
-                });
+                readTraceConfig(fileLines(file));
             }
         }
     }
 
+    private boolean checkVersion(Runtime.Version linkedVersion) {
+        Runtime.Version baseVersion = Runtime.version();
+        if (baseVersion.major() != linkedVersion.major() ||
+                baseVersion.minor() != linkedVersion.minor()) {
+            return false;
+        }
+        return true;
+    }
+
+    private Runtime.Version getLinkedVersion(ResourcePool in) {
+        ModuleDescriptor.Version version = in.moduleView()
+                .findModule("java.base")
+                .get()
+                .descriptor()
+                .version()
+                .orElseThrow(() -> new PluginException("No version defined in "
+                        + "the java.base being linked"));
+         return Runtime.Version.parse(version.toString());
+    }
+
+    private void readTraceConfig(Stream<String> lines) {
+        // Use TreeSet/TreeMap to keep things sorted in a deterministic
+        // order to avoid scrambling the layout on small changes and to
+        // ease finding methods in the generated code
+        speciesTypes = new TreeSet<>(speciesTypes);
+        invokerTypes = new TreeSet<>(invokerTypes);
+        TreeMap<String, Set<String>> newDMHMethods = new TreeMap<>();
+        for (Map.Entry<String, Set<String>> entry : dmhMethods.entrySet()) {
+            newDMHMethods.put(entry.getKey(), new TreeSet<>(entry.getValue()));
+        }
+        dmhMethods = newDMHMethods;
+        lines.map(line -> line.split(" "))
+             .forEach(parts -> {
+                switch (parts[0]) {
+                    case "[BMH_RESOLVE]":
+                        speciesTypes.add(expandSignature(parts[1]));
+                        break;
+                    case "[LF_RESOLVE]":
+                        String methodType = parts[3];
+                        validateMethodType(methodType);
+                        if (parts[1].contains("Invokers")) {
+                            invokerTypes.add(methodType);
+                        } else if (parts[1].contains("DirectMethodHandle")) {
+                            String dmh = parts[2];
+                            // ignore getObject etc for now (generated
+                            // by default)
+                            if (DMH_METHOD_TYPE_MAP.containsKey(dmh)) {
+                                addDMHMethodType(dmh, methodType);
+                            }
+                        }
+                        break;
+                    default: break; // ignore
+                }
+            });
+    }
+
     private void addDMHMethodType(String dmh, String methodType) {
         validateMethodType(methodType);
         Set<String> methodTypes = dmhMethods.get(dmh);
@@ -265,6 +309,25 @@
 
     @Override
     public ResourcePool transform(ResourcePool in, ResourcePoolBuilder out) {
+        if (ignoreVersion) {
+            System.out.println(
+                    PluginsResourceBundle
+                            .getMessage(IGNORE_VERSION_WARNING));
+        } else if (!checkVersion(getLinkedVersion(in))) {
+            // The linked images are not version compatible
+            if (mainArgument != null) {
+                // Log a mismatch warning if an argument was specified
+                System.out.println(
+                        PluginsResourceBundle
+                                .getMessage(VERSION_MISMATCH_WARNING,
+                                            getLinkedVersion(in),
+                                            Runtime.version()));
+            }
+            in.transformAndCopy(entry -> entry, out);
+            return out.build();
+        }
+
+        initialize(in);
         // Copy all but DMH_ENTRY to out
         in.transformAndCopy(entry -> {
                 // filter out placeholder entries
@@ -277,8 +340,18 @@
                     return entry;
                 }
             }, out);
+
+        // Generate BMH Species classes
         speciesTypes.forEach(types -> generateBMHClass(types, out));
+
+        // Generate LambdaForm Holder classes
         generateHolderClasses(out);
+
+        // Let it go
+        speciesTypes = null;
+        invokerTypes = null;
+        dmhMethods = null;
+
         return out.build();
     }
 
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java
index 4332a86..bcdb1e9 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java
@@ -27,6 +27,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.io.UncheckedIOException;
 import java.lang.module.ModuleDescriptor;
 import java.util.EnumSet;
@@ -43,8 +44,6 @@
 import jdk.tools.jlink.plugin.ResourcePoolBuilder;
 import jdk.tools.jlink.plugin.ResourcePoolEntry;
 import jdk.tools.jlink.plugin.ResourcePoolModule;
-import jdk.tools.jlink.plugin.Plugin.Category;
-import jdk.tools.jlink.plugin.Plugin.State;
 import jdk.tools.jlink.plugin.Plugin;
 
 /**
@@ -101,9 +100,9 @@
                 //     --release-info add:build_type=fastdebug,source=openjdk,java_version=9
                 // and put whatever value that was passed in command line.
 
-                config.keySet().stream().
-                    filter(s -> !NAME.equals(s)).
-                    forEach(s -> release.put(s, config.get(s)));
+                config.keySet().stream()
+                      .filter(s -> !NAME.equals(s))
+                      .forEach(s -> release.put(s, config.get(s)));
             }
             break;
 
@@ -137,21 +136,19 @@
         javaBase.ifPresent(mod -> {
             // fill release information available from transformed "java.base" module!
             ModuleDescriptor desc = mod.descriptor();
-            desc.osName().ifPresent(s -> {
-                release.put("OS_NAME", quote(s));
-            });
-            desc.osVersion().ifPresent(s -> release.put("OS_VERSION", quote(s)));
-            desc.osArch().ifPresent(s -> release.put("OS_ARCH", quote(s)));
             desc.version().ifPresent(s -> release.put("JAVA_VERSION",
                     quote(parseVersion(s.toString()))));
             desc.version().ifPresent(s -> release.put("JAVA_FULL_VERSION",
                     quote(s.toString())));
+
+            release.put("OS_NAME", quote(mod.osName()));
+            release.put("OS_ARCH", quote(mod.osArch()));
         });
 
         // put topological sorted module names separated by space
         release.put("MODULES",  new ModuleSorter(in.moduleView())
-                .sorted().map(ResourcePoolModule::name)
-                .collect(Collectors.joining(" ", "\"", "\"")));
+               .sorted().map(ResourcePoolModule::name)
+               .collect(Collectors.joining(" ", "\"", "\"")));
 
         // create a TOP level ResourcePoolEntry for "release" file.
         out.add(ResourcePoolEntry.create("/java.base/release",
@@ -162,11 +159,11 @@
     // Parse version string and return a string that includes only version part
     // leaving "pre", "build" information. See also: java.lang.Runtime.Version.
     private static String parseVersion(String str) {
-        return Runtime.Version.parse(str).
-            version().
-            stream().
-            map(Object::toString).
-            collect(Collectors.joining("."));
+        return Runtime.Version.parse(str)
+                      .version()
+                      .stream()
+                      .map(Object::toString)
+                      .collect(Collectors.joining("."));
     }
 
     private static String quote(String str) {
@@ -174,14 +171,12 @@
     }
 
     private byte[] releaseFileContent() {
-        Properties props = new Properties();
-        props.putAll(release);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        try {
-            props.store(baos, "");
-            return baos.toByteArray();
-        } catch (IOException ex) {
-            throw new UncheckedIOException(ex);
+        try (PrintWriter pw = new PrintWriter(baos)) {
+            release.entrySet().stream()
+                   .sorted(Map.Entry.comparingByKey())
+                   .forEach(e -> pw.format("%s=%s%n", e.getKey(), e.getValue()));
         }
+        return baos.toByteArray();
     }
 }
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java
index 8c3f3ea..e5c66a8 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,11 +46,17 @@
 import java.util.function.IntSupplier;
 
 import jdk.internal.module.Checks;
+import jdk.internal.module.ClassFileAttributes;
+import jdk.internal.module.ClassFileConstants;
 import jdk.internal.module.ModuleHashes;
 import jdk.internal.module.ModuleInfo.Attributes;
 import jdk.internal.module.ModuleInfoExtender;
 import jdk.internal.module.ModuleResolution;
+import jdk.internal.module.ModuleTarget;
 import jdk.internal.module.SystemModules;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.org.objectweb.asm.Opcodes;
@@ -109,6 +115,11 @@
     }
 
     @Override
+    public String getArgumentsDescription() {
+        return PluginsResourceBundle.getArgument(NAME);
+    }
+
+    @Override
     public void configure(Map<String, String> config) {
         String arg = config.get(NAME);
         if (arg != null) {
@@ -171,10 +182,11 @@
     }
 
     static class ModuleInfo {
+        private final ByteArrayInputStream bain;
         private final Attributes attrs;
         private final Set<String> packages;
-        private final ByteArrayInputStream bain;
         private final boolean dropModuleTarget;
+        private final boolean addModulePackages;
         private ModuleDescriptor descriptor;  // may be different that the original one
 
         ModuleInfo(byte[] bytes, Set<String> packages, boolean dropModuleTarget)
@@ -182,19 +194,25 @@
         {
             this.bain = new ByteArrayInputStream(bytes);
             this.packages = packages;
-
             this.attrs = jdk.internal.module.ModuleInfo.read(bain, null);
+            // If ModulePackages attribute is present, the packages from this
+            // module descriptor returns the packages in that attribute.
+            // If it's not present, ModuleDescriptor::packages only contains
+            // the exported and open packages from module-info.class
             this.descriptor = attrs.descriptor();
             if (descriptor.isAutomatic()) {
                 throw new InternalError("linking automatic module is not supported");
             }
 
-            if (dropModuleTarget) {
-                // drop target attribute only if any OS property is present
-                this.dropModuleTarget =
-                    descriptor.osName().isPresent() ||
-                    descriptor.osArch().isPresent() ||
-                    descriptor.osVersion().isPresent();
+            // add ModulePackages attribute if this module contains some packages
+            // and ModulePackages is not present
+            this.addModulePackages = packages.size() > 0 && !hasModulePackages();
+
+            // drop target attribute only if any OS property is present
+            ModuleTarget target = attrs.target();
+            if (dropModuleTarget && target != null) {
+                this.dropModuleTarget = (target.osName() != null)
+                                        || (target.osArch() != null);
             } else {
                 this.dropModuleTarget = false;
             }
@@ -213,6 +231,10 @@
             return packages;
         }
 
+        ModuleTarget target() {
+            return attrs.target();
+        }
+
         ModuleHashes recordedHashes() {
             return attrs.recordedHashes();
         }
@@ -276,53 +298,71 @@
             }
         }
 
+        boolean hasModulePackages() throws IOException {
+            Set<String> attrTypes = new HashSet<>();
+            ClassVisitor cv = new ClassVisitor(Opcodes.ASM5) {
+                @Override
+                public void visitAttribute(Attribute attr) {
+                    attrTypes.add(attr.type);
+                }
+            };
+
+            // prototype of attributes that should be parsed
+            Attribute[] attrs = new Attribute[] {
+                new ClassFileAttributes.ModulePackagesAttribute()
+            };
+
+            try (InputStream in = getInputStream()) {
+                // parse module-info.class
+                ClassReader cr = new ClassReader(in);
+                cr.accept(cv, attrs, 0);
+                return attrTypes.contains(ClassFileConstants.MODULE_PACKAGES);
+            }
+        }
+
         /**
          * Returns true if module-info.class should be written
          * 1. add ModulePackages attribute if not present; or
          * 2. drop ModuleTarget attribute except java.base
          */
         boolean shouldRewrite() {
-            return shouldAddModulePackages() || shouldDropModuleTarget();
-        }
-
-        boolean shouldAddModulePackages() {
-            return (descriptor.packages().isEmpty() && packages.size() > 0);
-        }
-
-        boolean shouldDropModuleTarget() {
-            return dropModuleTarget &&
-                        (descriptor.osName().isPresent() ||
-                         descriptor.osArch().isPresent() ||
-                         descriptor.osVersion().isPresent());
+            return addModulePackages || dropModuleTarget;
         }
 
         /**
          * Returns the bytes for the module-info.class with ModulePackages
-         * if it contains at least one package
+         * attribute added and/or with ModuleTarget attribute dropped.
          */
         byte[] getBytes() throws IOException {
-            bain.reset();
-
-            // add ModulePackages attribute if not exist
-            if (shouldRewrite()) {
-                ModuleInfoRewriter rewriter = new ModuleInfoRewriter(bain);
-                if (shouldAddModulePackages()) {
-                    rewriter.addModulePackages(packages);
+            try (InputStream in = getInputStream()) {
+                if (shouldRewrite()) {
+                    ModuleInfoRewriter rewriter = new ModuleInfoRewriter(in);
+                    if (addModulePackages) {
+                        rewriter.addModulePackages(packages);
+                    }
+                    if (dropModuleTarget) {
+                        rewriter.dropModuleTarget();
+                    }
+                    // rewritten module descriptor
+                    byte[] bytes = rewriter.getBytes();
+                    try (ByteArrayInputStream bain = new ByteArrayInputStream(bytes)) {
+                        this.descriptor = ModuleDescriptor.read(bain);
+                    }
+                    return bytes;
+                } else {
+                    return in.readAllBytes();
                 }
-                if (shouldDropModuleTarget()) {
-                    rewriter.dropModuleTarget();
-                }
-                // rewritten module descriptor
-                byte[] bytes = rewriter.getBytes();
-                try (ByteArrayInputStream bain = new ByteArrayInputStream(bytes)) {
-                     this.descriptor = ModuleDescriptor.read(bain);
-                }
-                return bytes;
-            } else {
-                return bain.readAllBytes();
             }
         }
 
+        /*
+         * Returns the input stream of the module-info.class
+         */
+        InputStream getInputStream() {
+            bain.reset();
+            return bain;
+        }
+
         class ModuleInfoRewriter extends ByteArrayOutputStream {
             final ModuleInfoExtender extender;
             ModuleInfoRewriter(InputStream in) {
@@ -337,7 +377,7 @@
             }
 
             void dropModuleTarget() {
-                extender.targetPlatform("", "", "");
+                extender.targetPlatform("", "");
             }
 
             byte[] getBytes() throws IOException {
@@ -364,6 +404,10 @@
             "java/lang/module/ModuleDescriptor$Exports$Modifier";
         private static final String OPENS_MODIFIER_CLASSNAME =
             "java/lang/module/ModuleDescriptor$Opens$Modifier";
+        private static final String MODULE_TARGET_CLASSNAME  =
+            "jdk/internal/module/ModuleTarget";
+        private static final String MODULE_TARGET_ARRAY_SIGNATURE  =
+            "[Ljdk/internal/module/ModuleTarget;";
         private static final String MODULE_HASHES_ARRAY_SIGNATURE  =
             "[Ljdk/internal/module/ModuleHashes;";
         private static final String MODULE_RESOLUTION_CLASSNAME  =
@@ -379,6 +423,7 @@
 
         private final int BUILDER_VAR    = 0;
         private final int MD_VAR         = 1;  // variable for ModuleDescriptor
+        private final int MT_VAR         = 1;  // variable for ModuleTarget
         private final int MH_VAR         = 1;  // variable for ModuleHashes
         private int nextLocalVar         = 2;  // index to next local variable
 
@@ -480,11 +525,10 @@
             if (entry.moduleName().equals("java.base")) {
                 moduleInfo = new ModuleInfo(entry.contentBytes(), packages, false);
                 ModuleDescriptor md = moduleInfo.descriptor;
-                // drop Moduletarget attribute only if java.base has all OS properties
-                // otherwise, retain it
-                if (dropModuleTarget &&
-                        md.osName().isPresent() && md.osArch().isPresent() &&
-                        md.osVersion().isPresent()) {
+                // drop ModuleTarget attribute if java.base has all OS properties
+                ModuleTarget target = moduleInfo.target();
+                if (dropModuleTarget
+                    && (target.osName() != null) && (target.osArch() != null)) {
                     dropModuleTarget = true;
                 } else {
                     dropModuleTarget = false;
@@ -549,15 +593,20 @@
 
             // generate SystemModules::descriptors
             genDescriptorsMethod();
+
+            // generate SystemModules::targets
+            genTargetsMethod();
+
             // generate SystemModules::hashes
             genHashesMethod();
+
             // generate SystemModules::moduleResolutions
             genModuleResolutionsMethod();
 
             return cw;
         }
 
-        /*
+        /**
          * Generate bytecode for SystemModules::descriptors method
          */
         private void genDescriptorsMethod() {
@@ -581,10 +630,47 @@
             mv.visitInsn(ARETURN);
             mv.visitMaxs(0, 0);
             mv.visitEnd();
-
         }
 
-        /*
+        /**
+         * Generate bytecode for SystemModules::targets method
+         */
+        private void genTargetsMethod() {
+            MethodVisitor mv = cw.visitMethod(ACC_PUBLIC+ACC_STATIC,
+                                              "targets",
+                                              "()" + MODULE_TARGET_ARRAY_SIGNATURE,
+                                              "()" + MODULE_TARGET_ARRAY_SIGNATURE,
+                                              null);
+            mv.visitCode();
+            pushInt(mv, moduleInfos.size());
+            mv.visitTypeInsn(ANEWARRAY, MODULE_TARGET_CLASSNAME);
+            mv.visitVarInsn(ASTORE, MT_VAR);
+
+            for (int index=0; index < moduleInfos.size(); index++) {
+                ModuleInfo minfo = moduleInfos.get(index);
+                if (minfo.target() != null && !minfo.dropModuleTarget) {
+                    mv.visitVarInsn(ALOAD, MT_VAR);
+                    pushInt(mv, index);
+
+                    // new ModuleTarget(String, String)
+                    mv.visitTypeInsn(NEW, MODULE_TARGET_CLASSNAME);
+                    mv.visitInsn(DUP);
+                    mv.visitLdcInsn(minfo.target().osName());
+                    mv.visitLdcInsn(minfo.target().osArch());
+                    mv.visitMethodInsn(INVOKESPECIAL, MODULE_TARGET_CLASSNAME,
+                        "<init>", "(Ljava/lang/String;Ljava/lang/String;)V", false);
+
+                    mv.visitInsn(AASTORE);
+                }
+            }
+
+            mv.visitVarInsn(ALOAD, MT_VAR);
+            mv.visitInsn(ARETURN);
+            mv.visitMaxs(0, 0);
+            mv.visitEnd();
+        }
+
+        /**
          * Generate bytecode for SystemModules::hashes method
          */
         private void genHashesMethod() {
@@ -612,10 +698,9 @@
             hmv.visitInsn(ARETURN);
             hmv.visitMaxs(0, 0);
             hmv.visitEnd();
-
         }
 
-        /*
+        /**
          * Generate bytecode for SystemModules::methodResoultions method
          */
         private void genModuleResolutionsMethod() {
@@ -714,6 +799,7 @@
             final ModuleDescriptor md;
             final Set<String> packages;
             final int index;
+
             ModuleDescriptorBuilder(ModuleDescriptor md, Set<String> packages, int index) {
                 if (md.isAutomatic()) {
                     throw new InternalError("linking automatic module is not supported");
@@ -751,11 +837,6 @@
                 // main class
                 md.mainClass().ifPresent(this::mainClass);
 
-                // os name, arch, version
-                targetPlatform(md.osName().orElse(null),
-                               md.osArch().orElse(null),
-                               md.osVersion().orElse(null));
-
                 putModuleDescriptor();
             }
 
@@ -771,9 +852,12 @@
                 if (md.isOpen()) {
                     setModuleBit("open", true);
                 }
-                if (md.isSynthetic()) {
+                if (md.modifiers().contains(ModuleDescriptor.Modifier.SYNTHETIC)) {
                     setModuleBit("synthetic", true);
                 }
+                if (md.modifiers().contains(ModuleDescriptor.Modifier.MANDATED)) {
+                    setModuleBit("mandated", true);
+                }
             }
 
             /*
@@ -1050,25 +1134,6 @@
                 mv.visitInsn(POP);
             }
 
-            /*
-             * Invoke Builder.osName(String name)
-             *        Builder.osArch(String arch)
-             *        Builder.osVersion(String version)
-             */
-            void targetPlatform(String osName, String osArch, String osVersion) {
-                if (osName != null) {
-                    invokeBuilderMethod("osName", osName);
-                }
-
-                if (osArch != null) {
-                    invokeBuilderMethod("osArch", osArch);
-                }
-
-                if (osVersion != null) {
-                    invokeBuilderMethod("osVersion", osVersion);
-                }
-            }
-
             void invokeBuilderMethod(String methodName, String value) {
                 mv.visitVarInsn(ALOAD, BUILDER_VAR);
                 mv.visitLdcInsn(value);
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ResourcePoolModule.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ResourcePoolModule.java
index 449d580..b4a736d 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ResourcePoolModule.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/ResourcePoolModule.java
@@ -28,6 +28,7 @@
 import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Stream;
+import jdk.internal.module.ModuleTarget;
 
 /**
   * Link-time representation of a module.
@@ -57,6 +58,20 @@
     public ModuleDescriptor descriptor();
 
     /**
+     * The module target OS name for this module.
+     *
+     * @return The module target OS name
+     */
+    public String osName();
+
+    /**
+     * The module target OS arch for this module.
+     *
+     * @return The module target OS arch
+     */
+    public String osArch();
+
+    /**
      * Retrieves all the packages located in this module.
      *
      * @return The set of packages.
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
index 7a63cc3..4f7558e 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,15 +24,12 @@
 #
 
 main.usage.summary=\
-Usage: {0} <options> --module-path <modulepath> --add-modules <mods> --output\n\
-\<path> use --help for a list of possible options
+Usage: {0} <options> --module-path <modulepath> --add-modules <module>[,<module>...]\n\
+\Use --help for a list of possible options
 
 main.usage=\
-Usage: {0} <options> --module-path <modulepath> --add-modules <mods> --output\n\
-\<path> Possible options include:
-
-error.prefix=Error:
-warn.prefix=Warning:
+Usage: {0} <options> --module-path <modulepath> --add-modules <module>[,<module>...]\n\
+\Possible options include:
 
 main.opt.help=\
 \  -h, --help                            Print this help message
@@ -54,9 +51,18 @@
 \      --output <path>                   Location of output path
 
 main.opt.launcher=\
-\      --launcher <command>=<module>     Launcher command name for the module\n\
-\      --launcher <command>=<module>/<main>\n\
-\                                        Launcher command name for the module and the main class
+\      --launcher <name>=<module>[/<mainclass>]\n\
+\                                        Add a launcher command of the given\n\
+\                                        name for the module and the main class\n\
+\                                        if specified  
+
+main.opt.bind-services=\
+\      --bind-services                   Do full service binding
+
+main.opt.suggest-providers=\
+\      --suggest-providers [<name>,...]  Suggest providers of services used by\n\
+\                                        the modules that would be linked, or\n\
+\                                        of the given service types
 
 main.command.files=\
 \      @<filename>                       Read options from file
@@ -75,6 +81,9 @@
 \                                        signed modular JARs are not copied to\n\
 \                                        the runtime image.
 
+main.opt.verbose=\
+\  -v, --verbose                         Enable verbose tracing
+
 main.msg.bug=\
 An exception has occurred in jlink. \
 Please file a bug at the Java Bug Database (http://bugreport.java.com/bugreport/) \
@@ -95,6 +104,9 @@
 \n\
 
 
+error.prefix=Error:
+warn.prefix=Warning:
+
 err.unknown.byte.order:unknown byte order {0}
 err.launcher.main.class.empty:launcher main class name cannot be empty: {0}
 err.launcher.module.name.empty:launcher module name cannot be empty: {0}
@@ -111,12 +123,12 @@
 err.dir.exists={0} already exists
 err.badpattern=bad pattern {0}
 err.unknown.option=unknown option: {0}
-err.orphan.argument=orphan argument: {0}
 err.missing.arg=no value given for {0}
 err.internal.error=internal error: {0} {1} {2}
 err.invalid.arg.for.option=invalid argument for option: {0}
 err.option.after.class=option must be specified before classes: {0}
 err.option.unsupported={0} not supported: {1}
+err.orphan.arguments=invalid argument: {0}
 err.config.defaults=property {0} is missing from configuration
 err.config.defaults.value=wrong value in defaults property: {0}
 err.bom.generation=bom file generation failed: {0}
@@ -126,3 +138,7 @@
 warn.signing=WARNING: signed modular JAR {0} is currently not supported
 warn.invalid.arg=invalid classname or pathname not exist: {0}
 warn.split.package=package {0} defined in {1} {2}
+warn.unused.services=Services specified in --suggest-providers not used: {0}
+no.suggested.providers=--bind-services option is specified. No additional providers suggested.
+suggested.providers.header=Suggested providers
+providers.header=Providers
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties
index 9553d31..394d157 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,30 +23,35 @@
 # questions.
 #
 
-main.usage.summary=\u4F7F\u7528\u65B9\u6CD5: {0} <options> --module-path <modulepath> --add-modules <mods> --output <path>\n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001--help\u3092\u4F7F\u7528\u3057\u307E\u3059
+main.usage.summary=\u4F7F\u7528\u65B9\u6CD5: {0} <options> --module-path <modulepath> --add-modules <mods> --output\n<path> \u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001--help\u3092\u4F7F\u7528\u3057\u307E\u3059
 
-main.usage=\u4F7F\u7528\u65B9\u6CD5: {0} <options> --module-path <modulepath> --add-modules <mods> --output <path>\n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059:
+main.usage=\u4F7F\u7528\u65B9\u6CD5: {0} <options> --module-path <modulepath> --add-modules <mods> --output
+\<path> \u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059:
 
 error.prefix=\u30A8\u30E9\u30FC:
 warn.prefix=\u8B66\u544A:
 
-main.opt.help=\  -h\u3001--help                        \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3057\u307E\u3059
+main.opt.help=\  -h\u3001--help                            \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3057\u307E\u3059
 
-main.opt.version=\  --version                         \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831
+main.opt.version=\      --version                         \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831
 
-main.opt.module-path=\  -p <modulepath>\n  --module-path <modulepath>        \u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9
+main.opt.module-path=\  -p, --module-path <path>              \u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9
 
-main.opt.add-modules=\  --add-modules <mod>[,<mod>...]    \u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB
+main.opt.add-modules=\      --add-modules <mod>[,<mod>...]    \u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB
 
-main.opt.limit-modules=\  --limit-modules <mod>[,<mod>...]  \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u9818\u57DF\u3092\u5236\u9650\u3057\u307E\u3059
+main.opt.limit-modules=\      --limit-modules <mod>[,<mod>...]  \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u9818\u57DF\u3092\u5236\u9650\u3057\u307E\u3059
 
-main.opt.output=\  --output <path>                   \u51FA\u529B\u30D1\u30B9\u306E\u5834\u6240
+main.opt.output=\      --output <path>                   \u51FA\u529B\u30D1\u30B9\u306E\u5834\u6240
 
-main.command.files=\  @<filename>                       \u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059
+main.opt.launcher=\      --launcher <command>=<module>     \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u8D77\u52D5\u30C4\u30FC\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u540D\n      --launcher <command>=<module>/<main>\n                                        \u30E2\u30B8\u30E5\u30FC\u30EB\u3068\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u306E\u8D77\u52D5\u30C4\u30FC\u30EB\u30FB\u30B3\u30DE\u30F3\u30C9\u540D
 
-main.opt.endian=\  --endian <little|big>             \u751F\u6210\u3055\u308C\u305Fjimage (default:native)\u306E\u30D0\u30A4\u30C8\u9806
+main.command.files=\      @<filename>                       \u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059
 
-main.opt.save-opts=\  --save-opts <filename>            \u6307\u5B9A\u306E\u30D5\u30A1\u30A4\u30EB\u306Bjlink\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4FDD\u5B58\u3057\u307E\u3059
+main.opt.endian=\      --endian <little|big>             \u751F\u6210\u3055\u308C\u305Fjimage\n                                        (default:native)\u306E\u30D0\u30A4\u30C8\u9806
+
+main.opt.save-opts=\      --save-opts <filename>            \u6307\u5B9A\u306E\u30D5\u30A1\u30A4\u30EB\u306Bjlink\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4FDD\u5B58\u3057\u307E\u3059
+
+main.opt.ignore-signing-information=\      --ignore-signing-information      \u7F72\u540D\u6E08\u30E2\u30B8\u30E5\u30E9JAR\u304C\u30A4\u30E1\u30FC\u30B8\u306B\u30EA\u30F3\u30AF\n                                        \u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u81F4\u547D\u7684\u30A8\u30E9\u30FC\u3092\u6291\u6B62\n                                        \u3057\u307E\u3059\u3002\u7F72\u540D\u6E08\u30E2\u30B8\u30E5\u30E9JAR\u306E\u7F72\u540D\u95A2\u9023\n                                        \u30D5\u30A1\u30A4\u30EB\u306F\u3001\u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u306B\u30B3\u30D4\u30FC\n                                        \u3055\u308C\u307E\u305B\u3093\u3002
 
 main.msg.bug=jlink\u3067\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3067\u91CD\u8907\u304C\u306A\u3044\u304B\u3092\u3054\u78BA\u8A8D\u306E\u3046\u3048\u3001Java Bug Database (http://bugreport.java.com/bugreport/)\u3067bug\u306E\u767B\u9332\u3092\u304A\u9858\u3044\u3044\u305F\u3057\u307E\u3059\u3002\u30EC\u30DD\u30FC\u30C8\u306B\u306F\u3001\u305D\u306E\u30D7\u30ED\u30B0\u30E9\u30E0\u3068\u6B21\u306E\u8A3A\u65AD\u5185\u5BB9\u3092\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u3054\u5354\u529B\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002
 
@@ -55,12 +60,15 @@
 main.extended.help.footer=<pattern-list>\u3092\u5FC5\u8981\u3068\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5834\u5408\u3001\u5024\u306F\u3001\u6B21\u306E\u5F62\u5F0F\u306E\u3044\u305A\u308C\u304B\u3092\u4F7F\u7528\u3059\u308B\u3001\u8981\u7D20\u306E\u30AB\u30F3\u30DE\u533A\u5207\u308A\u30EA\u30B9\u30C8\u306B\u306A\u308A\u307E\u3059:\n  <glob-pattern>\n  glob:<glob-pattern>\n  regex:<regex-pattern>\n  @<filename> filename\u306F\u3001\u4F7F\u7528\u3059\u308B\u30D1\u30BF\u30FC\u30F3\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB(1\u884C\u3054\u3068\u306B1\u30D1\u30BF\u30FC\u30F3)\u306E\u540D\u524D\u3067\u3059\n\n
 
 err.unknown.byte.order:\u4E0D\u660E\u306A\u30D0\u30A4\u30C8\u9806{0}
+err.launcher.main.class.empty:\u8D77\u52D5\u30C4\u30FC\u30EB\u306E\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u540D\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093: {0}
+err.launcher.module.name.empty:\u8D77\u52D5\u30C4\u30FC\u30EB\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093: {0}
+err.launcher.value.format:\u8D77\u52D5\u30C4\u30FC\u30EB\u306E\u5024\u306F<command>=<module>[/<main-class>]\u306E\u5F62\u5F0F\u306B\u3057\u3066\u304F\u3060\u3055\u3044: {0}
 err.output.must.be.specified:--output\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 err.modulepath.must.be.specified:--module-path\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 err.mods.must.be.specified:{0}\u306B\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 err.path.not.found=\u30D1\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 err.path.not.valid=\u7121\u52B9\u306A\u30D1\u30B9: {0}
-err.existing.image.must.exist=\u65E2\u5B58\u306E\u30A4\u30E1\u30FC\u30B8\u304C\u5B58\u5728\u3057\u306A\u3044\u304B\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093
+err.image.must.exist=\u30A4\u30E1\u30FC\u30B8{0}\u306F\u5B58\u5728\u3057\u306A\u3044\u304B\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093
 err.existing.image.invalid=\u65E2\u5B58\u306E\u30A4\u30E1\u30FC\u30B8\u304C\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093
 err.file.not.found=\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 err.file.error=\u30D5\u30A1\u30A4\u30EB\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {0}
@@ -76,5 +84,8 @@
 err.config.defaults=\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u304C\u69CB\u6210\u306B\u3042\u308A\u307E\u305B\u3093
 err.config.defaults.value=\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u5024\u304C\u9593\u9055\u3063\u3066\u3044\u307E\u3059: {0}
 err.bom.generation=bom\u30D5\u30A1\u30A4\u30EB\u306E\u751F\u6210\u306B\u5931\u6557\u3057\u307E\u3057\u305F: {0}
+err.not.modular.format=\u9078\u629E\u3057\u305F\u30E2\u30B8\u30E5\u30FC\u30EB{0} ({1})\u304Cjmod\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30E9JAR\u5F62\u5F0F\u3067\u306F\u3042\u308A\u307E\u305B\u3093
+err.signing=\u7F72\u540D\u6E08\u30E2\u30B8\u30E5\u30E9JAR {0}\u306F\u73FE\u5728\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30A8\u30E9\u30FC\u3092\u6291\u6B62\u3059\u308B\u306B\u306F--ignore-signing-information\u3092\u4F7F\u7528\u3057\u307E\u3059
+warn.signing=\u8B66\u544A: \u7F72\u540D\u6E08\u30E2\u30B8\u30E5\u30E9JAR {0}\u306F\u73FE\u5728\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 warn.invalid.arg=\u7121\u52B9\u306A\u30AF\u30E9\u30B9\u540D\u307E\u305F\u306F\u30D1\u30B9\u540D\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
 warn.split.package=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F{1} {2}\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties
index 9d6e83e..43f2dd4 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,30 +23,35 @@
 # questions.
 #
 
-main.usage.summary=\u7528\u6CD5: {0} <\u9009\u9879> --module-path <\u6A21\u5757\u8DEF\u5F84> --add-modules <\u6A21\u5757> --output <\u8DEF\u5F84>\n\u4F7F\u7528 --help \u53EF\u5217\u51FA\u53EF\u80FD\u7684\u9009\u9879
+main.usage.summary=\u7528\u6CD5: {0} <\u9009\u9879> --module-path <\u6A21\u5757\u8DEF\u5F84> --add-modules <\u6A21\u5757> --output\n<\u8DEF\u5F84> \u4F7F\u7528 --help \u53EF\u5217\u51FA\u53EF\u80FD\u7684\u9009\u9879
 
-main.usage=\u7528\u6CD5: {0} <\u9009\u9879> --module-path <\u6A21\u5757\u8DEF\u5F84> --add-modules <\u6A21\u5757> --output <\u8DEF\u5F84>\n\u53EF\u80FD\u7684\u9009\u9879\u5305\u62EC:
+main.usage=\u7528\u6CD5: {0} <\u9009\u9879> --module-path <\u6A21\u5757\u8DEF\u5F84> --add-modules <\u6A21\u5757> --output
+\<path> \u53EF\u80FD\u7684\u9009\u9879\u5305\u62EC:
 
 error.prefix=\u9519\u8BEF:
 warn.prefix=\u8B66\u544A:
 
-main.opt.help=\  -h, --help                        \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F
+main.opt.help=\  -h, --help                              \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F
 
-main.opt.version=\  --version                         \u7248\u672C\u4FE1\u606F
+main.opt.version=\      --version                           \u7248\u672C\u4FE1\u606F
 
-main.opt.module-path=\  -p <\u6A21\u5757\u8DEF\u5F84>\n  --module-path <\u6A21\u5757\u8DEF\u5F84>        \u6A21\u5757\u8DEF\u5F84
+main.opt.module-path=\  -p, --module-path <\u8DEF\u5F84>                \u6A21\u5757\u8DEF\u5F84
 
-main.opt.add-modules=\  --add-modules <\u6A21\u5757>[,<\u6A21\u5757>...]    \u8981\u89E3\u6790\u7684\u6839\u6A21\u5757
+main.opt.add-modules=\      --add-modules <\u6A21\u5757>[,<\u6A21\u5757>...]    \u8981\u89E3\u6790\u7684\u6839\u6A21\u5757
 
-main.opt.limit-modules=\  --limit-modules <\u6A21\u5757>[,<\u6A21\u5757>...]  \u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF
+main.opt.limit-modules=\      --limit-modules <\u6A21\u5757>[,<\u6A21\u5757>...]  \u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF
 
-main.opt.output=\  --output <path>                   \u8F93\u51FA\u8DEF\u5F84\u7684\u4F4D\u7F6E
+main.opt.output=\      --output <\u8DEF\u5F84>                     \u8F93\u51FA\u8DEF\u5F84\u7684\u4F4D\u7F6E
 
-main.command.files=\  @<filename>                       \u4ECE\u6587\u4EF6\u4E2D\u8BFB\u53D6\u9009\u9879
+main.opt.launcher=\      --launcher <\u547D\u4EE4>=<\u6A21\u5757>            \u6A21\u5757\u7684\u542F\u52A8\u7A0B\u5E8F\u547D\u4EE4\u540D\u79F0\n      --launcher <\u547D\u4EE4>=<\u6A21\u5757>/<\u4E3B\u7C7B>\n                                          \u6A21\u5757\u548C\u4E3B\u7C7B\u7684\u542F\u52A8\u7A0B\u5E8F\u547D\u4EE4\u540D\u79F0
 
-main.opt.endian=\  --endian <little|big>             \u6240\u751F\u6210 jimage \u7684\u5B57\u8282\u987A\u5E8F (\u9ED8\u8BA4\u503C: native)
+main.command.files=\      @<\u6587\u4EF6\u540D>                           \u4ECE\u6587\u4EF6\u4E2D\u8BFB\u53D6\u9009\u9879
 
-main.opt.save-opts=\  --save-opts <\u6587\u4EF6\u540D>            \u5C06 jlink \u9009\u9879\u4FDD\u5B58\u5728\u6307\u5B9A\u6587\u4EF6\u4E2D
+main.opt.endian=\      --endian <little|big>               \u6240\u751F\u6210 jimage\n                                          \u7684\u5B57\u8282\u987A\u5E8F (\u9ED8\u8BA4\u503C: native)
+
+main.opt.save-opts=\      --save-opts <\u6587\u4EF6\u540D>                \u5C06 jlink \u9009\u9879\u4FDD\u5B58\u5728\u6307\u5B9A\u6587\u4EF6\u4E2D
+
+main.opt.ignore-signing-information=\      --ignore-signing-information        \u5728\u6620\u50CF\u4E2D\u94FE\u63A5\u5DF2\u7B7E\u540D\u6A21\u5757\u5316\n                                          JAR \u7684\u60C5\u51B5\u4E0B\u9690\u85CF\u81F4\u547D\u9519\u8BEF\u3002\n                                          \u5DF2\u7B7E\u540D\u6A21\u5757\u5316 JAR \u7684\u7B7E\u540D\n                                          \u76F8\u5173\u6587\u4EF6\u5C06\u4E0D\u4F1A\u590D\u5236\u5230\n                                          \u8FD0\u884C\u65F6\u6620\u50CF\u3002
 
 main.msg.bug=jlink \u4E2D\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF\u3002\u5982\u679C\u5728 Java Bug Database (http://bugreport.java.com/bugreport/) \u4E2D\u6CA1\u6709\u627E\u5230\u8BE5\u9519\u8BEF, \u8BF7\u5728\u8BE5\u6570\u636E\u5E93\u4E2D\u5EFA\u7ACB Bug\u3002\u8BF7\u5728\u62A5\u544A\u4E2D\u9644\u4E0A\u60A8\u7684\u7A0B\u5E8F\u548C\u4EE5\u4E0B\u8BCA\u65AD\u4FE1\u606F\u3002\u8C22\u8C22\u3002
 
@@ -55,12 +60,15 @@
 main.extended.help.footer=\u5BF9\u4E8E\u9700\u8981 <\u6A21\u5F0F\u5217\u8868> \u7684\u9009\u9879, \u503C\u5C06\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5143\u7D20\u5217\u8868, \u6BCF\u4E2A\u5143\u7D20\u4F7F\u7528\u4EE5\u4E0B\u683C\u5F0F\u4E4B\u4E00:\n  <glob \u6A21\u5F0F>\n  glob:<glob \u6A21\u5F0F>\n  regex:<\u6B63\u5219\u8868\u8FBE\u5F0F\u6A21\u5F0F>\n  @<\u6587\u4EF6\u540D>, \u5176\u4E2D\u201C\u6587\u4EF6\u540D\u201D\u662F\u5305\u542B\u8981\u4F7F\u7528\u7684\u6A21\u5F0F\u7684\u6587\u4EF6\u540D, \u6BCF\u884C\u4E00\u4E2A\u6A21\u5F0F\n\n
 
 err.unknown.byte.order:\u672A\u77E5\u7684\u5B57\u8282\u987A\u5E8F {0}
+err.launcher.main.class.empty:\u542F\u52A8\u7A0B\u5E8F\u4E3B\u7C7B\u540D\u4E0D\u80FD\u4E3A\u7A7A: {0}
+err.launcher.module.name.empty:\u542F\u52A8\u7A0B\u5E8F\u6A21\u5757\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A: {0}
+err.launcher.value.format:\u542F\u52A8\u7A0B\u5E8F\u503C\u5E94\u4F7F\u7528\u201C<\u547D\u4EE4>=<\u6A21\u5757>[/<\u4E3B\u7C7B>]\u201D\u683C\u5F0F: {0}
 err.output.must.be.specified:\u5FC5\u987B\u6307\u5B9A --output
 err.modulepath.must.be.specified:\u5FC5\u987B\u6307\u5B9A --module-path
 err.mods.must.be.specified:\u6CA1\u6709\u5C06\u4EFB\u4F55\u6A21\u5757\u6307\u5B9A\u5230{0}
 err.path.not.found=\u627E\u4E0D\u5230\u8DEF\u5F84: {0}
 err.path.not.valid=\u65E0\u6548\u8DEF\u5F84: {0}
-err.existing.image.must.exist=\u73B0\u6709\u6620\u50CF\u4E0D\u5B58\u5728\u6216\u8005\u4E0D\u662F\u76EE\u5F55
+err.image.must.exist=\u6620\u50CF {0} \u4E0D\u5B58\u5728\u6216\u8005\u4E0D\u662F\u76EE\u5F55
 err.existing.image.invalid=\u73B0\u6709\u6620\u50CF\u65E0\u6548
 err.file.not.found=\u627E\u4E0D\u5230\u6587\u4EF6: {0}
 err.file.error=\u65E0\u6CD5\u8BBF\u95EE\u6587\u4EF6: {0}
@@ -76,5 +84,8 @@
 err.config.defaults=\u914D\u7F6E\u4E2D\u7F3A\u5C11\u5C5E\u6027 {0}
 err.config.defaults.value=\u9ED8\u8BA4\u5C5E\u6027\u4E2D\u7684\u503C\u9519\u8BEF: {0}
 err.bom.generation=\u672A\u80FD\u751F\u6210 bom \u6587\u4EF6: {0}
+err.not.modular.format=\u9009\u5B9A\u6A21\u5757 {0} ({1}) \u672A\u4F7F\u7528 jmod \u6216\u6A21\u5757\u5316 JAR \u683C\u5F0F
+err.signing=\u5F53\u524D\u4E0D\u652F\u6301\u5DF2\u7B7E\u540D\u6A21\u5757\u5316 JAR {0}, \u4F7F\u7528 --ignore-signing-information \u53EF\u9690\u85CF\u9519\u8BEF
+warn.signing=\u8B66\u544A: \u5F53\u524D\u4E0D\u652F\u6301\u5DF2\u7B7E\u540D\u6A21\u5757\u5316 JAR {0}
 warn.invalid.arg=\u7C7B\u540D\u65E0\u6548\u6216\u8DEF\u5F84\u540D\u4E0D\u5B58\u5728: {0}
 warn.split.package=\u5DF2\u5728{1} {2}\u4E2D\u5B9A\u4E49\u7A0B\u5E8F\u5305{0}
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties
index 4b1327b..819c353 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties
@@ -40,9 +40,9 @@
 
 compress.description=\
 Compress all resources in the output image.\n\
-Level 0: constant string sharing\n\
-Level 1: ZIP\n\
-Level 2: both.\n\
+Level 0: No compression\n\
+Level 1: Constant string sharing\n\
+Level 2: ZIP.\n\
 An optional <pattern-list> filter can be specified to list the pattern of\n\
 files to be included.
 
@@ -62,7 +62,7 @@
 exclude-files.argument=<pattern-list> of files to exclude
 
 exclude-files.description=\
-Specify files to exclude. e.g.: **.java,glob:/java.base/native/client/**
+Specify files to exclude. e.g.: **.java,glob:/java.base/lib/client/**
 
 exclude-resources.argument=<pattern-list> resources to exclude
 
@@ -75,11 +75,23 @@
 exclude-jmod-section.description=\
 Specify a JMOD section to exclude
 
-generate-jli-classes.argument=@filename
+generate-jli-classes.argument=@filename[:ignore-version=<true|false>]
 
 generate-jli-classes.description=\
-Takes a file hinting to jlink what java.lang.invoke classes to pre-generate. If\n\
-this flag is not specified a default set of classes will be generated.
+Specify a file listing the java.lang.invoke classes to pre-generate. \n\
+By default, this plugin may use a builtin list of classes to pre-generate. \n\
+If this plugin runs on a different runtime version than the image being \n\
+created then code generation will be disabled by default to guarantee \n\
+correctness - add ignore-version=true to override this.
+
+generate-jli-classes.ignore.version.warn=\
+WARNING: --generate-jli-classes set to ignore version mismatch between \n\
+JDK running jlink and target image.
+
+generate-jli-classes.version.mismatch.warn=\
+WARNING: Pre-generation of JLI classes is only supported when linking \n\
+the same version of java.base ({0}) as the JDK running jlink ({1}), \n\
+class generation skipped - specify ignore-version to override.
 
 system-modules.argument=retainModuleTarget
 
@@ -148,8 +160,10 @@
 \      --disable-plugin <pluginname>     Disable the plugin mentioned
 
 plugin.opt.compress=\
-\  -c, --compress=<0|1|2>                Enable compression of resources\n\
-\                                        More details in --list-plugins option
+\  -c, --compress=<0|1|2>                Enable compression of resources:\n\
+\                                          Level 0: No compression\n\
+\                                          Level 1: Constant string sharing\n\
+\                                          Level 2: ZIP
 
 plugin.opt.strip-debug=\
 \  -G, --strip-debug                     Strip debug information
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java
index 3ed482b..69be83d 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java
@@ -34,6 +34,7 @@
 import java.io.PrintWriter;
 import java.io.UncheckedIOException;
 import java.lang.module.Configuration;
+import java.lang.module.FindException;
 import java.lang.module.ModuleReader;
 import java.lang.module.ModuleReference;
 import java.lang.module.ModuleFinder;
@@ -95,13 +96,14 @@
 import jdk.internal.joptsimple.OptionSet;
 import jdk.internal.joptsimple.OptionSpec;
 import jdk.internal.joptsimple.ValueConverter;
-import jdk.internal.loader.ResourceHelper;
 import jdk.internal.module.ModuleHashes;
 import jdk.internal.module.ModuleHashesBuilder;
 import jdk.internal.module.ModuleInfo;
 import jdk.internal.module.ModuleInfoExtender;
 import jdk.internal.module.ModulePath;
 import jdk.internal.module.ModuleResolution;
+import jdk.internal.module.ModuleTarget;
+import jdk.internal.module.Resources;
 import jdk.tools.jlink.internal.Utils;
 
 import static java.util.stream.Collectors.joining;
@@ -177,7 +179,6 @@
         String mainClass;
         String osName;
         String osArch;
-        String osVersion;
         Pattern modulesToHash;
         ModuleResolution moduleResolution;
         boolean dryrun;
@@ -310,7 +311,9 @@
         try (JmodFile jf = new JmodFile(options.jmodFile)) {
             try (InputStream in = jf.getInputStream(Section.CLASSES, MODULE_INFO)) {
                 ModuleInfo.Attributes attrs = ModuleInfo.read(in, null);
-                printModuleDescriptor(attrs.descriptor(), attrs.recordedHashes());
+                printModuleDescriptor(attrs.descriptor(),
+                                      attrs.target(),
+                                      attrs.recordedHashes());
                 return true;
             } catch (IOException e) {
                 throw new CommandException("err.module.descriptor.not.found");
@@ -324,7 +327,9 @@
                   .collect(joining(" "));
     }
 
-    private void printModuleDescriptor(ModuleDescriptor md, ModuleHashes hashes)
+    private void printModuleDescriptor(ModuleDescriptor md,
+                                       ModuleTarget target,
+                                       ModuleHashes hashes)
         throws IOException
     {
         StringBuilder sb = new StringBuilder();
@@ -364,11 +369,14 @@
 
         md.mainClass().ifPresent(v -> sb.append("\n  main-class " + v));
 
-        md.osName().ifPresent(v -> sb.append("\n  operating-system-name " + v));
-
-        md.osArch().ifPresent(v -> sb.append("\n  operating-system-architecture " + v));
-
-        md.osVersion().ifPresent(v -> sb.append("\n  operating-system-version " + v));
+        if (target != null) {
+            String osName = target.osName();
+            if (osName != null)
+                sb.append("\n  operating-system-name " + osName);
+            String osArch = target.osArch();
+            if (osArch != null)
+                sb.append("\n  operating-system-architecture " + osArch);
+        }
 
         if (hashes != null) {
             hashes.names().stream().sorted().forEach(
@@ -431,7 +439,6 @@
         final String mainClass = options.mainClass;
         final String osName = options.osName;
         final String osArch = options.osArch;
-        final String osVersion = options.osVersion;
         final List<PathMatcher> excludes = options.excludes;
         final ModuleResolution moduleResolution = options.moduleResolution;
 
@@ -527,9 +534,9 @@
                 if (mainClass != null)
                     extender.mainClass(mainClass);
 
-                // --os-name, --os-arch, --os-version
-                if (osName != null || osArch != null || osVersion != null)
-                    extender.targetPlatform(osName, osArch, osVersion);
+                // --os-name, --os-arch
+                if (osName != null || osArch != null)
+                    extender.targetPlatform(osName, osArch);
 
                 // --module-version
                 if (moduleVersion != null)
@@ -674,7 +681,7 @@
          */
         boolean isResource(String name) {
             name = name.replace(File.separatorChar, '/');
-            return name.endsWith(".class") || !ResourceHelper.isSimpleResource(name);
+            return name.endsWith(".class") || Resources.canEncapsulate(name);
         }
 
 
@@ -851,8 +858,8 @@
             // get a resolved module graph
             Configuration config = null;
             try {
-                config = Configuration.empty().resolveRequires(system, finder, roots);
-            } catch (ResolutionException e) {
+                config = Configuration.empty().resolve(system, finder, roots);
+            } catch (FindException | ResolutionException e) {
                 throw new CommandException("err.module.resolution.fail", e.getMessage());
             }
 
@@ -1330,11 +1337,6 @@
                         .withRequiredArg()
                         .describedAs(getMessage("main.opt.os-arch.arg"));
 
-        OptionSpec<String> osVersion
-                = parser.accepts("os-version", getMessage("main.opt.os-version"))
-                        .withRequiredArg()
-                        .describedAs(getMessage("main.opt.os-version.arg"));
-
         OptionSpec<Void> doNotResolveByDefault
                 = parser.accepts("do-not-resolve-by-default",
                                  getMessage("main.opt.do-not-resolve-by-default"));
@@ -1392,7 +1394,7 @@
                 options.legalNotices = getLastElement(opts.valuesOf(legalNotices));
             if (opts.has(modulePath)) {
                 Path[] dirs = getLastElement(opts.valuesOf(modulePath)).toArray(new Path[0]);
-                options.moduleFinder = new ModulePath(Runtime.version(), true, dirs);
+                options.moduleFinder = ModulePath.of(Runtime.version(), true, dirs);
             }
             if (opts.has(moduleVersion))
                 options.moduleVersion = getLastElement(opts.valuesOf(moduleVersion));
@@ -1402,8 +1404,6 @@
                 options.osName = getLastElement(opts.valuesOf(osName));
             if (opts.has(osArch))
                 options.osArch = getLastElement(opts.valuesOf(osArch));
-            if (opts.has(osVersion))
-                options.osVersion = getLastElement(opts.valuesOf(osVersion));
             if (opts.has(warnIfResolved))
                 options.moduleResolution = getLastElement(opts.valuesOf(warnIfResolved));
             if (opts.has(doNotResolveByDefault)) {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties
index 51daee1..acc7710 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod.properties
@@ -68,8 +68,6 @@
 main.opt.os-name.arg=os-name
 main.opt.os-arch=Operating system architecture
 main.opt.os-arch.arg=os-arch
-main.opt.os-version=Operating system version
-main.opt.os-version.arg=os-version
 main.opt.module-path=Module path
 main.opt.hash-modules=Compute and record hashes to tie a packaged module\
 \ with modules matching the given <regex-pattern> and depending upon it directly\
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod_ja.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod_ja.properties
index 92dbda2..16aa2e9c 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod_ja.properties
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,27 +23,31 @@
 # questions.
 #
 
-main.usage.summary=\u4F7F\u7528\u65B9\u6CD5: {0} (create|list|describe|hash) <OPTIONS> <jmod-file>\n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001--help\u3092\u4F7F\u7528\u3057\u307E\u3059
+main.usage.summary=\u4F7F\u7528\u65B9\u6CD5: {0} (create|extract|list|describe|hash) <OPTIONS> <jmod-file>\n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001--help\u3092\u4F7F\u7528\u3057\u307E\u3059
 
-main.usage=\u4F7F\u7528\u65B9\u6CD5: {0} (create|list|describe|hash) <OPTIONS> <jmod-file>\n
+main.usage=\u4F7F\u7528\u65B9\u6CD5: {0} (create|extract|list|describe|hash) <OPTIONS> <jmod-file>\n
 error.prefix=\u30A8\u30E9\u30FC:
 warn.prefix=\u8B66\u544A:
 
 main.opt.mode=\u30E1\u30A4\u30F3\u64CD\u4F5C\u30E2\u30FC\u30C9:
 main.opt.mode.create=create    - \u65B0\u898F\u306Ejmod\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u4F5C\u6210\u3057\u307E\u3059
+main.opt.mode.extract=extract   - \u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u62BD\u51FA\u3057\u307E\u3059
 main.opt.mode.list=list      - \u3059\u3079\u3066\u306E\u30A8\u30F3\u30C8\u30EA\u306E\u540D\u524D\u3092\u51FA\u529B\u3057\u307E\u3059
 main.opt.mode.describe=describe  - \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u8A73\u7D30\u3092\u51FA\u529B\u3057\u307E\u3059
 main.opt.mode.hash=hash      - \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30CF\u30C3\u30B7\u30E5\u3092\u8A18\u9332\u3057\u307E\u3059\u3002
 
 main.opt.help=\u3053\u306E\u4F7F\u7528\u65B9\u6CD5\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3057\u307E\u3059
+main.opt.help-extra=\u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3057\u307E\u3059
 main.opt.version=\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831
 main.opt.class-path=\u30AF\u30E9\u30B9\u3092\u542B\u3080\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3jar\u30D5\u30A1\u30A4\u30EB|\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA
 main.opt.libs=\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u306E\u5834\u6240
 main.opt.cmds=\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30B3\u30DE\u30F3\u30C9\u306E\u5834\u6240
 main.opt.config=\u30E6\u30FC\u30B6\u30FC\u304C\u7DE8\u96C6\u53EF\u80FD\u306A\u69CB\u6210\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240
+main.opt.extractDir=\u62BD\u51FA\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA
 main.opt.dry-run=\u30CF\u30C3\u30B7\u30E5\u30FB\u30E2\u30FC\u30C9\u306E\u8A66\u9A13\u7684\u306A\u5B9F\u884C
 main.opt.exclude=\u5404\u8981\u7D20\u304C\u6B21\u306E\u5F62\u5F0F\u306E\u3044\u305A\u308C\u304B\u3092\u4F7F\u7528\u3059\u308B\u3001\u6307\u5B9A\u3055\u308C\u305F\u30AB\u30F3\u30DE\u533A\u5207\u308A\u30D1\u30BF\u30FC\u30F3\u30FB\u30EA\u30B9\u30C8\u306B\u4E00\u81F4\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u3092\u9664\u5916\u3057\u307E\u3059: <glob-pattern>\u3001glob:<glob-pattern>\u307E\u305F\u306Fregex:<regex-pattern>
 main.opt.header-files=\u30D8\u30C3\u30C0\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240
+main.opt.legal-notices=\u6CD5\u5F8B\u4E0A\u306E\u6CE8\u610F\u70B9\u306E\u5834\u6240
 main.opt.module-version= \u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3
 main.opt.main-class=\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9
 main.opt.main-class.arg=class-name
@@ -56,13 +60,16 @@
 main.opt.os-version.arg=os-version
 main.opt.module-path=\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9
 main.opt.hash-modules=\u6307\u5B9A\u306E<regex-pattern>\u306B\u4E00\u81F4\u3057\u3001\u76F4\u63A5\u307E\u305F\u306F\u9593\u63A5\u7684\u306B\u4F9D\u5B58\u3057\u3066\u3044\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u7D50\u5408\u3059\u308B\u30CF\u30C3\u30B7\u30E5\u3092\u8A08\u7B97\u304A\u3088\u3073\u8A18\u9332\u3057\u307E\u3059\u3002\u30CF\u30C3\u30B7\u30E5\u306F\u3001\u4F5C\u6210\u3055\u308C\u3066\u3044\u308BJMOD\u30D5\u30A1\u30A4\u30EB\u3001jmod hash\u30B3\u30DE\u30F3\u30C9\u3067\u6307\u5B9A\u3057\u305F\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u306EJMOD\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30E9JAR\u306B\u8A18\u9332\u3055\u308C\u307E\u3059\u3002
+main.opt.do-not-resolve-by-default=\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30EB\u30FC\u30C8\u8A2D\u5B9A\u304B\u3089\u9664\u5916\u3057\u307E\u3059
+main.opt.warn-if-resolved=\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306F\u3001\u8B66\u544A\u3092\u767A\u884C\u3059\u308B\u30C4\u30FC\u30EB\u306E\u30D2\u30F3\u30C8\u3002\u975E\u63A8\u5968\u3001\u524A\u9664\u4E88\u5B9A\u306E\u975E\u63A8\u5968\u307E\u305F\u306F\u5B9F\u9A13\u7684\u306E\u3044\u305A\u308C\u304B
 
 main.opt.cmdfile=\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059
 
 module.hashes.recorded=\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306E\u30CF\u30C3\u30B7\u30E5\u304C\u8A18\u9332\u3055\u308C\u307E\u3059
 
-err.missing.mode=create\u3001list\u3001describe\u307E\u305F\u306Fhash\u306E\u3044\u305A\u308C\u304B\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
-err.invalid.mode=\u30E2\u30FC\u30C9\u306Fcreate\u3001list\u3001describe\u307E\u305F\u306Fhash\u306E\u3044\u305A\u308C\u304B\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}
+err.missing.mode=create\u3001extract\u3001list\u3001describe\u307E\u305F\u306Fhash\u306E\u3044\u305A\u308C\u304B\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
+err.invalid.mode=\u30E2\u30FC\u30C9\u306Fcreate\u3001extract\u3001list\u3001describe\u307E\u305F\u306Fhash\u306E\u3044\u305A\u308C\u304B\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}
+err.cannot.create.dir=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093
 err.classpath.must.be.specified=--class-path\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 err.jmod.must.be.specified=jmod-file\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 err.invalid.version=\u7121\u52B9\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3{0}
@@ -77,11 +84,13 @@
 err.file.already.exists=\u30D5\u30A1\u30A4\u30EB\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059: {0}
 err.jmod.not.found=jmod\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 err.bad.pattern=\u4E0D\u6B63\u30D1\u30BF\u30FC\u30F3{0}
+err.bad.WarnIfResolvedReason=\u4E0D\u6B63\u306A\u7406\u7531: {0}\u3001\u975E\u63A8\u5968\u3001\u524A\u9664\u4E88\u5B9A\u306E\u975E\u63A8\u5968\u307E\u305F\u306F\u5B9F\u9A13\u7684\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 err.unknown.option=\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}
 err.missing.arg={0}\u306B\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 err.internal.error=\u5185\u90E8\u30A8\u30E9\u30FC: {0} {1} {2}
 err.invalid.dryrun.option=--dry-run\u306F\u30CF\u30C3\u30B7\u30E5\u30FB\u30E2\u30FC\u30C9\u3068\u4E00\u7DD2\u306B\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059
 err.module.descriptor.not.found=\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
+err.missing.export.or.open.packages={0}\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u305F\u304B\u305D\u3053\u3067\u30AA\u30FC\u30D7\u30F3\u3055\u308C\u3066\u3044\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {1}
 warn.invalid.arg=\u7121\u52B9\u306A\u30AF\u30E9\u30B9\u540D\u307E\u305F\u306F\u30D1\u30B9\u540D\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
 warn.no.module.hashes=\u30CF\u30C3\u30B7\u30E5\u304C\u8A18\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0}\u306B\u4F9D\u5B58\u3059\u308B\u30CF\u30C3\u30B7\u30E5\u306B\u5BFE\u3057\u3066\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 warn.module.resolution.fail=\u30CF\u30C3\u30B7\u30E5\u304C\u8A18\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0}
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod_zh_CN.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod_zh_CN.properties
index 5ac12c8..efa1934 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod_zh_CN.properties
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/resources/jmod_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,27 +23,31 @@
 # questions.
 #
 
-main.usage.summary=\u7528\u6CD5: {0} (create|list|describe|hash) <\u9009\u9879> <jmod \u6587\u4EF6>\n\u4F7F\u7528 --help \u5217\u51FA\u53EF\u80FD\u7684\u9009\u9879
+main.usage.summary=\u7528\u6CD5: {0} (create|extract|list|describe|hash) <\u9009\u9879> <jmod \u6587\u4EF6>\n\u4F7F\u7528 --help \u5217\u51FA\u53EF\u80FD\u7684\u9009\u9879
 
-main.usage=\u7528\u6CD5: {0} (create|list|describe|hash) <\u9009\u9879> <jmod \u6587\u4EF6>\n
+main.usage=\u7528\u6CD5: {0} (create|extract|list|describe|hash) <\u9009\u9879> <jmod \u6587\u4EF6>\n
 error.prefix=\u9519\u8BEF:
 warn.prefix=\u8B66\u544A:
 
 main.opt.mode=\u4E3B\u64CD\u4F5C\u6A21\u5F0F:
 main.opt.mode.create=create    - \u521B\u5EFA\u65B0\u7684 jmod \u6863\u6848
+main.opt.mode.extract=extract   - \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6240\u6709\u6587\u4EF6
 main.opt.mode.list=list      - \u8F93\u51FA\u6240\u6709\u6761\u76EE\u7684\u540D\u79F0
 main.opt.mode.describe=describe  - \u8F93\u51FA\u6A21\u5757\u8BE6\u7EC6\u4FE1\u606F
 main.opt.mode.hash=hash      - \u8BB0\u5F55\u7ED1\u5B9A\u6A21\u5757\u7684\u6563\u5217\u3002
 
 main.opt.help=\u8F93\u51FA\u6B64\u7528\u6CD5\u6D88\u606F
+main.opt.help-extra=\u8F93\u51FA\u989D\u5916\u9009\u9879\u7684\u5E2E\u52A9
 main.opt.version=\u7248\u672C\u4FE1\u606F
 main.opt.class-path=\u5305\u542B\u7C7B\u7684\u5E94\u7528\u7A0B\u5E8F jar \u6587\u4EF6|\u76EE\u5F55
 main.opt.libs=\u672C\u673A\u5E93\u7684\u4F4D\u7F6E
 main.opt.cmds=\u672C\u673A\u547D\u4EE4\u7684\u4F4D\u7F6E
 main.opt.config=\u7528\u6237\u53EF\u7F16\u8F91\u914D\u7F6E\u6587\u4EF6\u7684\u4F4D\u7F6E
+main.opt.extractDir=\u63D0\u53D6\u64CD\u4F5C\u7684\u76EE\u6807\u76EE\u5F55
 main.opt.dry-run=\u6563\u5217\u6A21\u5F0F\u7684\u6A21\u62DF\u8FD0\u884C
 main.opt.exclude=\u6392\u9664\u4E0E\u6240\u63D0\u4F9B\u9017\u53F7\u5206\u9694\u7684\u6A21\u5F0F\u5217\u8868\u5339\u914D\u7684\u6587\u4EF6, \u6BCF\u4E2A\u5143\u7D20\u4F7F\u7528\u4EE5\u4E0B\u683C\u5F0F\u4E4B\u4E00: <glob \u6A21\u5F0F>, glob:<glob \u6A21\u5F0F> \u6216 regex:<\u6B63\u5219\u8868\u8FBE\u5F0F\u6A21\u5F0F>
 main.opt.header-files=\u6807\u5934\u6587\u4EF6\u7684\u4F4D\u7F6E
+main.opt.legal-notices=\u6CD5\u5F8B\u58F0\u660E\u4F4D\u7F6E
 main.opt.module-version= \u6A21\u5757\u7248\u672C
 main.opt.main-class=\u4E3B\u7C7B
 main.opt.main-class.arg=class-name
@@ -56,13 +60,16 @@
 main.opt.os-version.arg=os-version
 main.opt.module-path=\u6A21\u5757\u8DEF\u5F84
 main.opt.hash-modules=\u8BA1\u7B97\u548C\u8BB0\u5F55\u6563\u5217, \u4EE5\u5C06\u6253\u5305\u6A21\u5757\u7ED1\u5B9A\u5230\u4E0E\u6307\u5B9A <\u6B63\u5219\u8868\u8FBE\u5F0F\u6A21\u5F0F> \u5339\u914D\u5E76\u76F4\u63A5\u6216\u95F4\u63A5\u4F9D\u8D56\u4E8E\u7684\u6A21\u5757\u3002\u6563\u5217\u8BB0\u5F55\u5728\u6240\u521B\u5EFA\u7684 JMOD \u6587\u4EF6\u4E2D, \u6216\u8005\u8BB0\u5F55\u5728 jmod hash \u547D\u4EE4\u6307\u5B9A\u7684\u6A21\u5757\u8DEF\u5F84\u7684 JMOD \u6587\u4EF6\u6216\u6A21\u5757\u5316 JAR \u4E2D\u3002
+main.opt.do-not-resolve-by-default=\u4ECE\u9ED8\u8BA4\u6839\u6A21\u5757\u96C6\u4E2D\u6392\u9664
+main.opt.warn-if-resolved=\u63D0\u793A\u5DE5\u5177\u5728\u89E3\u6790\u6A21\u5757\u540E\u53D1\u51FA\u8B66\u544A\u3002\u53EF\u4EE5\u4E3A deprecated, deprecated-for-removal \u6216 incubating \u4E4B\u4E00
 
 main.opt.cmdfile=\u4ECE\u6307\u5B9A\u6587\u4EF6\u8BFB\u53D6\u9009\u9879
 
 module.hashes.recorded=\u6563\u5217\u8BB0\u5F55\u5728\u6A21\u5757 {0} \u4E2D
 
-err.missing.mode=\u5FC5\u987B\u6307\u5B9A\u521B\u5EFA, \u5217\u51FA, \u63CF\u8FF0\u6216\u6563\u5217\u4E4B\u4E00
-err.invalid.mode=\u6A21\u5F0F\u5FC5\u987B\u4E3A\u521B\u5EFA, \u5217\u51FA, \u63CF\u8FF0\u6216\u6563\u5217\u4E4B\u4E00: {0}
+err.missing.mode=\u5FC5\u987B\u6307\u5B9A\u521B\u5EFA, \u63D0\u53D6, \u5217\u51FA, \u63CF\u8FF0\u6216\u6563\u5217\u4E4B\u4E00
+err.invalid.mode=\u6A21\u5F0F\u5FC5\u987B\u4E3A\u521B\u5EFA, \u63D0\u53D6, \u5217\u51FA, \u63CF\u8FF0\u6216\u6563\u5217\u4E4B\u4E00: {0}
+err.cannot.create.dir=\u65E0\u6CD5\u521B\u5EFA\u76EE\u5F55 {0}
 err.classpath.must.be.specified=\u5FC5\u987B\u6307\u5B9A --class-path
 err.jmod.must.be.specified=\u5FC5\u987B\u6307\u5B9A jmod-file
 err.invalid.version=\u65E0\u6548\u7684\u6A21\u5757\u7248\u672C {0}
@@ -77,11 +84,13 @@
 err.file.already.exists=\u6587\u4EF6\u5DF2\u5B58\u5728: {0}
 err.jmod.not.found=\u627E\u4E0D\u5230 jmod \u6587\u4EF6: {0}
 err.bad.pattern=\u9519\u8BEF\u7684\u6A21\u5F0F {0}
+err.bad.WarnIfResolvedReason=\u9519\u8BEF\u7684\u539F\u56E0: {0}, \u5FC5\u987B\u4E3A deprecated, deprecated-for-removal \u6216 incubating \u4E4B\u4E00
 err.unknown.option=\u672A\u77E5\u9009\u9879: {0}
 err.missing.arg=\u6CA1\u6709\u4E3A{0}\u6307\u5B9A\u503C
 err.internal.error=\u5185\u90E8\u9519\u8BEF: {0} {1} {2}
 err.invalid.dryrun.option=--dry-run \u53EA\u80FD\u7528\u4E8E\u6563\u5217\u6A21\u5F0F
 err.module.descriptor.not.found=\u627E\u4E0D\u5230\u6A21\u5757\u63CF\u8FF0\u7B26
+err.missing.export.or.open.packages=\u5728 {0} \u4E2D\u5BFC\u51FA\u6216\u6253\u5F00\u7684\u7A0B\u5E8F\u5305\u4E0D\u5B58\u5728: {1}
 warn.invalid.arg=\u7C7B\u540D\u65E0\u6548\u6216\u8DEF\u5F84\u540D\u4E0D\u5B58\u5728: {0}
 warn.no.module.hashes=\u672A\u8BB0\u5F55\u4EFB\u4F55\u6563\u5217: \u6CA1\u6709\u4E3A\u4F9D\u8D56\u4E8E {0} \u7684\u6563\u5217\u5904\u7406\u6307\u5B9A\u6A21\u5757
 warn.module.resolution.fail=\u672A\u8BB0\u5F55\u4EFB\u4F55\u6563\u5217: {0}
diff --git a/jdk/src/jdk.jlink/share/classes/module-info.java b/jdk/src/jdk.jlink/share/classes/module-info.java
index 00140ad..510b4ac 100644
--- a/jdk/src/jdk.jlink/share/classes/module-info.java
+++ b/jdk/src/jdk.jlink/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Defines the Java linker tool, jlink.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.jlink {
     requires jdk.internal.opt;
     requires jdk.jdeps;
diff --git a/jdk/src/jdk.jsobject/share/classes/module-info.java b/jdk/src/jdk.jsobject/share/classes/module-info.java
index b8f6a2d..ac69396 100644
--- a/jdk/src/jdk.jsobject/share/classes/module-info.java
+++ b/jdk/src/jdk.jsobject/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Defines the API for the JavaScript Object.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.jsobject {
     requires java.desktop;
     exports netscape.javascript;
diff --git a/jdk/src/jdk.jstatd/share/classes/module-info.java b/jdk/src/jdk.jstatd/share/classes/module-info.java
index 67f3ec0..b3e3195 100644
--- a/jdk/src/jdk.jstatd/share/classes/module-info.java
+++ b/jdk/src/jdk.jstatd/share/classes/module-info.java
@@ -23,6 +23,13 @@
  * questions.
  */
 
+/**
+ * Defines the tool for starting a daemon for the jstat tool to monitor
+ * JVM statistics remotely.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.jstatd {
     requires java.rmi;
     requires jdk.internal.jvmstat;
@@ -32,4 +39,3 @@
 
     provides sun.jvmstat.monitor.MonitoredHostService with sun.jvmstat.perfdata.monitor.protocol.rmi.MonitoredHostRmiService;
 }
-
diff --git a/jdk/src/jdk.localedata/share/classes/module-info.java b/jdk/src/jdk.localedata/share/classes/module-info.java
index 324e14b..ac27dc3 100644
--- a/jdk/src/jdk.localedata/share/classes/module-info.java
+++ b/jdk/src/jdk.localedata/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Locale data provider for locales other than {@linkplain java.util.Locale#US US locale}.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.localedata {
     provides sun.util.locale.provider.LocaleDataMetaInfo with
         sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo,
diff --git a/jdk/src/jdk.management.agent/share/classes/module-info.java b/jdk/src/jdk.management.agent/share/classes/module-info.java
index 0afeaf0..81bccdb 100644
--- a/jdk/src/jdk.management.agent/share/classes/module-info.java
+++ b/jdk/src/jdk.management.agent/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Define the JMX management agent.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.management.agent {
     requires java.management;
     requires java.management.rmi;
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java b/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java
index 69a8e94..1ddd704 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java
@@ -47,8 +47,6 @@
  * object was constructed.  The value of the VM option
  * may be changed after the {@code VMOption} object was constructed,
  *
- * @see <a href="{@docRoot}/../../../../technotes/guides/vm/index.html">
- *         Java Virtual Machine</a>
  * @author Mandy Chung
  * @since 1.6
  */
diff --git a/jdk/src/jdk.management/share/classes/module-info.java b/jdk/src/jdk.management/share/classes/module-info.java
index 327d31e..bea31dd 100644
--- a/jdk/src/jdk.management/share/classes/module-info.java
+++ b/jdk/src/jdk.management/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Defines the JDK-specific Management Interfaces for JVM.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.management {
     requires transitive java.management;
 
diff --git a/jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java b/jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java
index 6820eee..90ed8ef 100644
--- a/jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java
+++ b/jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -142,6 +142,7 @@
         resps = Collections.synchronizedMap(new HashMap<Integer, byte[]>());
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         close();
     }
diff --git a/jdk/src/jdk.naming.dns/share/classes/module-info.java b/jdk/src/jdk.naming.dns/share/classes/module-info.java
index abe26ec..71d3725 100644
--- a/jdk/src/jdk.naming.dns/share/classes/module-info.java
+++ b/jdk/src/jdk.naming.dns/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * DNS Java Naming provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.naming.dns {
     requires java.naming;
 
diff --git a/jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java b/jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java
index 874d687..81a348f 100644
--- a/jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java
+++ b/jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -119,6 +119,7 @@
         reference = ctx.reference;
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         close();
     }
@@ -593,6 +594,7 @@
         nextName = 0;
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() {
         ctx.close();
     }
@@ -633,6 +635,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     public void close () {
         finalize();
     }
diff --git a/jdk/src/jdk.naming.rmi/share/classes/module-info.java b/jdk/src/jdk.naming.rmi/share/classes/module-info.java
index debe640..bba4557 100644
--- a/jdk/src/jdk.naming.rmi/share/classes/module-info.java
+++ b/jdk/src/jdk.naming.rmi/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * RMI Java Naming provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.naming.rmi {
     requires java.naming;
     requires java.rmi;
diff --git a/jdk/src/jdk.net/share/classes/module-info.java b/jdk/src/jdk.net/share/classes/module-info.java
index 95fb579..e5ed160 100644
--- a/jdk/src/jdk.net/share/classes/module-info.java
+++ b/jdk/src/jdk.net/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Defines the JDK-specific Networking API.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.net {
     exports jdk.net;
 }
diff --git a/jdk/src/jdk.policytool/share/classes/module-info.java b/jdk/src/jdk.policytool/share/classes/module-info.java
index f972e1c..9a38186 100644
--- a/jdk/src/jdk.policytool/share/classes/module-info.java
+++ b/jdk/src/jdk.policytool/share/classes/module-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,13 @@
  * questions.
  */
 
+/**
+ * GUI tool for managing policy files.
+ *
+ * @since 9
+ * @deprecated
+ */
+@Deprecated(since="9", forRemoval=true)
 module jdk.policytool {
     requires java.desktop;
     requires java.logging;
diff --git a/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java
index b560e05..77a39b2 100644
--- a/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java
+++ b/jdk/src/jdk.policytool/share/classes/sun/security/tools/policytool/PolicyTool.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,11 +65,13 @@
  *
  * @see java.security.Policy
  * @since   1.2
- * @deprecated The policytool tool has been deprecated and
- * is planned to be removed in a future release.
+ * @deprecated {@code policytool} has been deprecated for removal because it
+ * is rarely used, and it provides little value over editing policy
+ * files using a text editor.
  */
 
-@Deprecated
+@Deprecated(since="9", forRemoval=true)
+@SuppressWarnings("removal")
 public class PolicyTool {
 
     // for i18n
@@ -878,7 +880,8 @@
  * The Permission contains the (Type, Name, Action) triplet.
  *
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class PolicyEntry {
 
     private CodeSource codesource;
@@ -1018,7 +1021,8 @@
 /**
  * The main window for the PolicyTool
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class ToolWindow extends JFrame {
     // use serialVersionUID from JDK 1.2.2 for interoperability
     private static final long serialVersionUID = 5682568601210376777L;
@@ -1552,7 +1556,8 @@
 /**
  * General dialog window
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class ToolDialog extends JDialog {
     // use serialVersionUID from JDK 1.2.2 for interoperability
     private static final long serialVersionUID = -372244357011301190L;
@@ -2916,7 +2921,8 @@
 /**
  * Event handler for the PolicyTool window
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class ToolWindowListener implements WindowListener {
 
     private PolicyTool tool;
@@ -2961,7 +2967,8 @@
 /**
  * Event handler for the Policy List
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class PolicyListListener extends MouseAdapter implements ActionListener {
 
     private PolicyTool tool;
@@ -2991,7 +2998,8 @@
 /**
  * Event handler for the File Menu
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class FileMenuListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3090,7 +3098,8 @@
 /**
  * Event handler for the main window buttons and Edit Menu
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class MainWindowListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3166,7 +3175,8 @@
  *    if edit is FALSE, then we are ADDing a new PolicyEntry,
  *    so we only need to update the GUI listing.
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class AddEntryDoneButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3233,7 +3243,8 @@
 /**
  * Event handler for ChangeKeyStoreOKButton button
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class ChangeKeyStoreOKButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3280,7 +3291,8 @@
 /**
  * Event handler for AddPrinButton button
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class AddPrinButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3306,7 +3318,8 @@
 /**
  * Event handler for AddPermButton button
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class AddPermButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3332,7 +3345,8 @@
 /**
  * Event handler for AddPrinOKButton button
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class NewPolicyPrinOKButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3396,7 +3410,8 @@
 /**
  * Event handler for AddPermOKButton button
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class NewPolicyPermOKButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3460,7 +3475,8 @@
 /**
  * Event handler for RemovePrinButton button
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class RemovePrinButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3496,7 +3512,8 @@
 /**
  * Event handler for RemovePermButton button
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class RemovePermButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -3539,7 +3556,8 @@
  * GUI listing.  If the user is editing an existing PolicyEntry, we
  * update both the GUI listing and the actual PolicyEntry.
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class EditPrinButtonListener extends MouseAdapter implements ActionListener {
 
     private PolicyTool tool;
@@ -3586,7 +3604,8 @@
  * GUI listing.  If the user is editing an existing PolicyEntry, we
  * update both the GUI listing and the actual PolicyEntry.
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class EditPermButtonListener extends MouseAdapter implements ActionListener {
 
     private PolicyTool tool;
@@ -3627,7 +3646,8 @@
 /**
  * Event handler for Principal Popup Menu
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class PrincipalTypeMenuListener implements ItemListener {
 
     private ToolDialog td;
@@ -3679,7 +3699,8 @@
 /**
  * Event handler for Permission Popup Menu
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class PermissionMenuListener implements ItemListener {
 
     private ToolDialog td;
@@ -3754,7 +3775,8 @@
 /**
  * Event handler for Permission Name Popup Menu
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class PermissionNameMenuListener implements ItemListener {
 
     private ToolDialog td;
@@ -3908,7 +3930,8 @@
 /**
  * Event handler for UserSaveYes button
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class UserSaveYesButtonListener implements ActionListener {
 
     private ToolDialog us;
@@ -3963,7 +3986,8 @@
 /**
  * Event handler for UserSaveNoButton
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class UserSaveNoButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -4012,7 +4036,8 @@
 /**
  * Event handler for ConfirmRemovePolicyEntryOKButtonListener
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class ConfirmRemovePolicyEntryOKButtonListener implements ActionListener {
 
     private PolicyTool tool;
@@ -4168,7 +4193,8 @@
     }
 }
 
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class AuthPerm extends Perm {
     AuthPerm() {
         super(javax.security.auth.AuthPermission.class,
@@ -4241,7 +4267,8 @@
     }
 }
 
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class URLPerm extends Perm {
     URLPerm() {
         super(java.net.URLPermission.class,
@@ -4406,7 +4433,8 @@
     }
 }
 
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class RuntimePerm extends Perm {
     RuntimePerm() {
         super(java.lang.RuntimePermission.class,
@@ -4447,7 +4475,8 @@
     }
 }
 
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation",
+                   "removal"}) // PolicyTool
 class SecurityPerm extends Perm {
     SecurityPerm() {
         super(java.security.SecurityPermission.class,
diff --git a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java
index 288ad52..938d8dc 100644
--- a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java
+++ b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java
@@ -145,12 +145,14 @@
          * in parseArgs, so that none of the arguments will be nulled
          * before delegating to the new implementation.
          */
-        for (int i = 0; i < argv.length; i++) {
-            if (argv[i].equals("-Xnew")) {
-                return (new sun.rmi.rmic.newrmic.Main(out,
-                                                      program)).compile(argv);
-            }
-        }
+        // disable the -Xnew option as per JDK-8146299 and JDK-8145980
+        // to allow further discussion how to progress with this feature
+        //for (int i = 0; i < argv.length; i++) {
+        //    if (argv[i].equals("-Xnew")) {
+        //        return (new sun.rmi.rmic.newrmic.Main(out,
+        //                                              program)).compile(argv);
+        //    }
+        //}
 
         if (!parseArgs(argv)) {
             return false;
diff --git a/jdk/src/jdk.sctp/share/classes/module-info.java b/jdk/src/jdk.sctp/share/classes/module-info.java
index c52ceb5..f150ed2 100644
--- a/jdk/src/jdk.sctp/share/classes/module-info.java
+++ b/jdk/src/jdk.sctp/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Defines the JDK-specific API for SCTP.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.sctp {
     exports com.sun.nio.sctp;
 }
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java
index 9116448..3e63bf3 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,6 +66,7 @@
     private boolean debug = true;
 
     // SolarisSystem to retrieve underlying system info
+    @SuppressWarnings("removal")
     private SolarisSystem ss;
 
     // the authentication status
@@ -73,9 +74,13 @@
     private boolean commitSucceeded = false;
 
     // Underlying system info
+    @SuppressWarnings("removal")
     private SolarisPrincipal userPrincipal;
+    @SuppressWarnings("removal")
     private SolarisNumericUserPrincipal UIDPrincipal;
+    @SuppressWarnings("removal")
     private SolarisNumericGroupPrincipal GIDPrincipal;
+    @SuppressWarnings("removal")
     private LinkedList<SolarisNumericGroupPrincipal> supplementaryGroups =
                 new LinkedList<>();
 
@@ -121,6 +126,7 @@
      * @return true in all cases (this {@code LoginModule}
      *          should not be ignored).
      */
+    @SuppressWarnings("removal")
     public boolean login() throws LoginException {
 
         long[] solarisGroups = null;
@@ -234,6 +240,7 @@
      * @return false if this LoginModule's own login and/or commit attempts
      *          failed, and true otherwise.
      */
+    @SuppressWarnings("removal")
     public boolean abort() throws LoginException {
         if (debug) {
             System.out.println("\t\t[SolarisLoginModule]: " +
@@ -271,6 +278,7 @@
      * @return true in all cases (this {@code LoginModule}
      *          should not be ignored).
      */
+    @SuppressWarnings("removal")
     public boolean logout() throws LoginException {
         if (debug) {
             System.out.println("\t\t[SolarisLoginModule]: " +
diff --git a/jdk/src/jdk.security.auth/share/classes/module-info.java b/jdk/src/jdk.security.auth/share/classes/module-info.java
index 4675b23..59e9f99 100644
--- a/jdk/src/jdk.security.auth/share/classes/module-info.java
+++ b/jdk/src/jdk.security.auth/share/classes/module-info.java
@@ -26,6 +26,9 @@
 /**
  * Contains the implementation of the javax.security.auth.* interfaces and
  * various authentication modules.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module jdk.security.auth {
     requires transitive java.naming;
diff --git a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java
index 7a7dc52..bb7a4e4 100644
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -158,6 +158,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws Throwable {
         dispose();
     }
diff --git a/jdk/src/jdk.security.jgss/share/classes/module-info.java b/jdk/src/jdk.security.jgss/share/classes/module-info.java
index e66017f..3e4d520 100644
--- a/jdk/src/jdk.security.jgss/share/classes/module-info.java
+++ b/jdk/src/jdk.security.jgss/share/classes/module-info.java
@@ -26,6 +26,9 @@
 /**
  * Defines Java extensions to the GSS-API and an implementation of the SASL
  * GSSAPI mechanism.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module jdk.security.jgss {
     requires transitive java.security.jgss;
diff --git a/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java b/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
index 641fa2f..a77109c 100644
--- a/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
+++ b/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
@@ -813,6 +813,7 @@
     /**
      * Tells the VM to define a class, without security checks.  By default, the
      * class loader and protection domain come from the caller's class.
+     * @see java.lang.invoke.MethodHandles.Lookup#defineClass(byte[])
      */
     @ForceInline
     public Class<?> defineClass(String name, byte[] b, int off, int len,
diff --git a/jdk/src/jdk.unsupported/share/classes/sun/reflect/Reflection.java b/jdk/src/jdk.unsupported/share/classes/sun/reflect/Reflection.java
index 29d8645..ff6c0c6 100644
--- a/jdk/src/jdk.unsupported/share/classes/sun/reflect/Reflection.java
+++ b/jdk/src/jdk.unsupported/share/classes/sun/reflect/Reflection.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
      * with {@link StackWalker.StackFrame#getDeclaringClass} instead.
      */
     @Deprecated(forRemoval=true)
+    @SuppressWarnings("removal") // Reflection.getCallerClass
     public static Class<?> getCallerClass(int depth) {
         if (depth < 0)
             throw new InternalError("depth must be positive");
diff --git a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java
index 4c0dcc9..2fec88e 100644
--- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java
+++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/JarFileSystem.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.Runtime.Version;
+import java.nio.file.NoSuchFileException;
 import java.nio.file.Path;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -86,12 +87,12 @@
         }
     }
 
-    private boolean isMultiReleaseJar() {
+    private boolean isMultiReleaseJar() throws IOException {
         try (InputStream is = newInputStream(getBytes("/META-INF/MANIFEST.MF"))) {
-            return (new Manifest(is)).getMainAttributes()
-                    .containsKey(new Attributes.Name("Multi-Release"));
-            // fixme change line above after JarFile integration to contain Attributes.Name.MULTI_RELEASE
-        } catch (IOException x) {
+            String multiRelease = new Manifest(is).getMainAttributes()
+                    .getValue(Attributes.Name.MULTI_RELEASE);
+            return "true".equalsIgnoreCase(multiRelease);
+        } catch (NoSuchFileException x) {
             return false;
         }
     }
diff --git a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java
index 498a93d..2b9891b 100644
--- a/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java
+++ b/jdk/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java
@@ -936,6 +936,7 @@
         return zc.toString(name);
     }
 
+    @SuppressWarnings("deprecation")
     protected void finalize() throws IOException {
         close();
     }
diff --git a/jdk/src/jdk.zipfs/share/classes/module-info.java b/jdk/src/jdk.zipfs/share/classes/module-info.java
index 5b7275e..bcd281f 100644
--- a/jdk/src/jdk.zipfs/share/classes/module-info.java
+++ b/jdk/src/jdk.zipfs/share/classes/module-info.java
@@ -23,6 +23,12 @@
  * questions.
  */
 
+/**
+ * Zip file system provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
 module jdk.zipfs {
     provides java.nio.file.spi.FileSystemProvider with jdk.nio.zipfs.ZipFileSystemProvider;
 }
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index f94c56a..44c8181 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -124,6 +124,9 @@
 # jdk_lang
 
 java/lang/StringCoding/CheckEncodings.sh                        7008363 generic-all
+java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java    8178776 generic-all
+
+jdk/internal/misc/JavaLangAccess/NewUnsafeString.java           8176188 generic-all
 
 ############################################################################
 
@@ -147,6 +150,7 @@
 
 com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java 8030957 aix-all
 com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java  8030957 aix-all
+sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java    8174734 generic-all
 
 ############################################################################
 
@@ -167,8 +171,6 @@
 
 java/net/DatagramSocket/SendDatagramToBadAddress.java           7143960 macosx-all
 
-java/net/httpclient/TimeoutOrdering.java                        8170940 solaris-all,windows-all
-
 ############################################################################
 
 # jdk_nio
@@ -177,14 +179,10 @@
 
 java/nio/channels/DatagramChannel/ChangingAddress.java          7141822 macosx-all
 
-java/nio/channels/Selector/OutOfBand.java                       7132677 macosx-all
-
 java/nio/file/WatchService/Basic.java                           7158947 solaris-all Solaris 11
 java/nio/file/WatchService/MayFlies.java                        7158947 solaris-all Solaris 11
 java/nio/file/WatchService/LotsOfEvents.java                    7158947 solaris-all Solaris 11
 
-sun/nio/cs/OLD/TestIBMDB.java                                   8167525 generic-all
-
 ############################################################################
 
 # jdk_rmi
@@ -199,8 +197,6 @@
 
 java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java 8169569 windows-all
 
-sun/rmi/rmic/newrmic/equivalence/run.sh                         8145980 generic-all
-
 java/rmi/registry/readTest/CodebaseTest.java                    8173324 windows-all
 
 ############################################################################
@@ -214,6 +210,9 @@
 sun/security/tools/jarsigner/warnings/BadKeyUsageTest.java      8026393 generic-all
 
 javax/net/ssl/DTLS/PacketLossRetransmission.java                8169086 macosx-x64
+javax/net/ssl/DTLS/RespondToRetransmit.java                     8169086 macosx-x64
+
+sun/security/ssl/X509KeyManager/PreferredKey.java               8176354 generic-all
 
 ############################################################################
 
@@ -251,15 +250,13 @@
 
 tools/pack200/CommandLineTests.java                             8059906 generic-all
 
-tools/launcher/ArgsEnvVar.java					8173712 generic-all
 tools/launcher/FXLauncherTest.java                              8068049 linux-all,macosx-all
 
-tools/jimage/JImageExtractTest.java                             8169713 generic-all
-tools/jimage/JImageListTest.java                                8169713 generic-all
-tools/jimage/JImageVerifyTest.java                              8169713 generic-all
+tools/jimage/JImageExtractTest.java                             8170120 generic-all
+tools/jimage/JImageListTest.java                                8170120 generic-all
+tools/jimage/JImageVerifyTest.java                              8170120 generic-all
 
-
-tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java       8169971 windows-x64
+tools/jimage/VerifyJimage.java                                  8178776 generic-all
 
 ############################################################################
 
@@ -267,7 +264,7 @@
 
 com/sun/jdi/RedefineImplementor.sh                              8004127 generic-all
 
-com/sun/jdi/JdbMethodExitTest.sh                                6902121 generic-all
+com/sun/jdi/JdbMethodExitTest.sh                                8171483 generic-all
 
 com/sun/jdi/RepStep.java                                        8043571 generic-all
 
@@ -285,7 +282,6 @@
 
 java/util/BitSet/BitSetStreamTest.java                          8079538 generic-all
 
-
 ############################################################################
 
 # jdk_instrument
@@ -296,6 +292,8 @@
 
 sun/tools/jcmd/TestJcmdSanity.java                              8031482 windows-all
 
+sun/tools/jstat/jstatClassloadOutput1.sh                        8173942 generic-all
+
 sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java    8057732 generic-all
 
 demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java       8151899 generic-all
@@ -308,6 +306,6 @@
 
 javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java 8169737 linux-all
 
-javax/xml/ws/clientjar/TestWsImport.java			8170370 generic-all
+org/omg/CORBA/OrbPropertiesTest.java			        8175177 generic-all
 
 ############################################################################
diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT
index e822c4f..f79fb4e 100644
--- a/jdk/test/TEST.ROOT
+++ b/jdk/test/TEST.ROOT
@@ -26,8 +26,8 @@
 # Allow querying of various System properties in @requires clauses
 requires.properties=sun.arch.data.model java.runtime.name
 
-# Tests using jtreg 4.2 b05 features
-requiredVersion=4.2 b05
+# Tests using jtreg 4.2 b07 features
+requiredVersion=4.2 b07
 
 # Path to libraries in the topmost test directory. This is needed so @library
 # does not need ../../ notation to reach them
diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups
index 3c8b8c6..b1fb934 100644
--- a/jdk/test/TEST.groups
+++ b/jdk/test/TEST.groups
@@ -28,8 +28,6 @@
 tier1 = \
     :jdk_lang \
     :jdk_util \
-    -java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \
-    -java/util/concurrent/forkjoin/FJExceptionTableLeak.java \
     sun/nio/cs/ISO8859x.java \
     java/nio/Buffer \
     com/sun/crypto/provider/Cipher \
@@ -37,8 +35,6 @@
     tools/pack200
 
 tier2 = \
-    java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \
-    java/util/concurrent/forkjoin/FJExceptionTableLeak.java \
     :jdk_io \
     :jdk_nio \
     -sun/nio/cs/ISO8859x.java \
@@ -74,9 +70,11 @@
     sun/reflect \
     jdk/internal/reflect \
     jdk/lambda \
+    jdk/internal/loader \
     jdk/internal/misc \
     jdk/internal/ref \
     jdk/internal/jimage \
+    jdk/internal/math \
     jdk/modules \
     vm
 
@@ -91,6 +89,7 @@
 jdk_util_other = \
     java/util \
     sun/util \
+    jdk/internal/util \
     -:jdk_collections \
     -:jdk_concurrent \
     -:jdk_stream
@@ -145,8 +144,7 @@
     java/util/stream
 
 jdk_math = \
-    java/math \
-    jdk/internal/math
+    java/math
 
 jdk_io = \
     java/io
@@ -181,6 +179,7 @@
 jdk_security3 = \
     javax/security  \
     -javax/security/auth/kerberos \
+    com/sun/jarsigner \
     com/sun/security \
     -com/sun/security/jgss \
     com/sun/org/apache/xml/internal/security \
@@ -211,7 +210,8 @@
 jdk_management = \
     java/lang/management \
     com/sun/management \
-    sun/management
+    sun/management \
+    jdk/internal/agent
 
 jdk_instrument = \
     java/lang/instrument
@@ -273,6 +273,7 @@
     jdk/internal/jline \
     com/sun/jndi \
     com/sun/corba \
+    org/omg/CORBA \
     lib/testlibrary \
     sample
 
diff --git a/jdk/test/com/oracle/security/ucrypto/TestAES.java b/jdk/test/com/oracle/security/ucrypto/TestAES.java
index 717e318..bf460d4 100644
--- a/jdk/test/com/oracle/security/ucrypto/TestAES.java
+++ b/jdk/test/com/oracle/security/ucrypto/TestAES.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7088989 8014374 8167512
+ * @bug 7088989 8014374 8167512 8173708
  * @summary Ensure the AES ciphers of OracleUcrypto provider works correctly
  * @key randomness
  * @run main TestAES
@@ -177,6 +177,12 @@
                     k += c.doFinal(eout, firstPartLen+1, eout.length - firstPartLen - 1, dout, k);
                     if (!checkArrays(in, in.length, dout, k)) testPassed = false;
                 } catch(Exception ex) {
+                    if (ex instanceof BadPaddingException &&
+                            algos[i].indexOf("CFB128") != -1 &&
+                            p.getName().equals("OracleUcrypto")) {
+                        System.out.println("Ignore due to a pre-S11.3 bug: " + ex);
+                        continue;
+                    }
                     System.out.println("Unexpected Exception: " + algos[i]);
                     ex.printStackTrace();
                     testPassed = false;
diff --git a/jdk/test/com/sun/java/swing/plaf/windows/Test8173145.java b/jdk/test/com/sun/java/swing/plaf/windows/Test8173145.java
new file mode 100644
index 0000000..cb7bb12
--- /dev/null
+++ b/jdk/test/com/sun/java/swing/plaf/windows/Test8173145.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 8173145
+   @summary Menu is activated after using mnemonic Alt/Key combination
+   @modules java.desktop/com.sun.java.swing.plaf.windows
+   @run main Test8173145
+*/
+
+import java.awt.*;
+import java.awt.event.KeyEvent;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.swing.*;
+
+public class Test8173145 {
+
+    private volatile static JButton btn;
+    private volatile static boolean uiCreated;
+
+    public static void main(String[] args) throws InvocationTargetException, InterruptedException, AWTException {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    uiCreated = createGUI();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+
+        if (uiCreated) {
+            test();
+        } else {
+            //no windows l&f, skip the test
+        }
+    }
+
+    private static void test() {
+        final Robot robot;
+        try {
+            robot = new Robot();
+        } catch (AWTException e) {
+            throw new RuntimeException(e);
+        }
+        robot.setAutoDelay(100);
+        robot.waitForIdle();
+
+        robot.keyPress(KeyEvent.VK_ALT);
+        robot.keyPress(KeyEvent.VK_M);
+        robot.keyRelease(KeyEvent.VK_M);
+        robot.keyRelease(KeyEvent.VK_ALT);
+
+        Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
+
+        if (focusOwner != btn) {
+            throw new RuntimeException("Wrong focus owner");
+        }
+    }
+
+    private static boolean createGUI() {
+        try {
+            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
+        } catch (Exception e) {
+            return false;
+        }
+        JFrame f = new JFrame();
+
+        JPanel panel = new JPanel();
+        btn = new JButton("Mmmmm");
+        btn.setMnemonic(KeyEvent.VK_M);
+        btn.setDisplayedMnemonicIndex(0);
+        panel.add(btn);
+
+        JTextField tf = new JTextField();
+        tf.setColumns(10);
+        panel.add(tf);
+
+        f.setJMenuBar(getMenuBar());
+        f.add(panel);
+        f.pack();
+        f.setVisible(true);
+        tf.requestFocus();
+        return true;
+    }
+
+    static JMenuBar getMenuBar() {
+        JMenuBar menuBar;
+        JMenu menu;
+
+        menuBar = new JMenuBar();
+
+        menu = new JMenu("Menu");
+        menuBar.add(menu);
+
+        JMenuItem mi = new JMenuItem("test");
+        menu.add(mi);
+
+        return menuBar;
+    }
+}
diff --git a/jdk/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java b/jdk/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java
index 3c0d03c..8f10085 100644
--- a/jdk/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java
+++ b/jdk/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java
@@ -26,9 +26,9 @@
  */
 
 /* @test
- * @bug 7089914
+ * @bug 7089914 8174720
  * @requires (os.family == "windows")
- * @modules java.desktop/com.sun.java.swing.plaf.windows
+ * @modules java.desktop/com.sun.java.swing.plaf.windows:open
  * @summary Focus on image icons are not visible in javaws cache with high contrast mode
  * @author Sean Chou
  */
diff --git a/jdk/test/com/sun/jdi/AcceptTimeout.java b/jdk/test/com/sun/jdi/AcceptTimeout.java
index 313a281..d9479d5 100644
--- a/jdk/test/com/sun/jdi/AcceptTimeout.java
+++ b/jdk/test/com/sun/jdi/AcceptTimeout.java
@@ -24,8 +24,7 @@
 /* @test
  * @bug 6198277
  * @summary Test that each ListeningConnector that supports a "timeout" argument will
- *     timeout with TransportTimeoutException
- * @modules jdk.jdi
+ * timeout with TransportTimeoutException
  */
 import com.sun.jdi.Bootstrap;
 import com.sun.jdi.connect.Connector;
diff --git a/jdk/test/com/sun/jdi/AccessSpecifierTest.java b/jdk/test/com/sun/jdi/AccessSpecifierTest.java
index d1c6e14..1c4df30 100644
--- a/jdk/test/com/sun/jdi/AccessSpecifierTest.java
+++ b/jdk/test/com/sun/jdi/AccessSpecifierTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4359628
- *  @summary Test fix for JDI: methods Accessible.is...() lie about array types
+ * @test
+ * @bug 4359628
+ * @summary Test fix for JDI: methods Accessible.is...() lie about array types
+ * @author Tim Bell
  *
- *  @author Tim Bell
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g AccessSpecifierTest.java
- *  @run driver AccessSpecifierTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g AccessSpecifierTest.java
+ * @run driver AccessSpecifierTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/AfterThreadDeathTest.java b/jdk/test/com/sun/jdi/AfterThreadDeathTest.java
index 93c21e6..61435a6 100644
--- a/jdk/test/com/sun/jdi/AfterThreadDeathTest.java
+++ b/jdk/test/com/sun/jdi/AfterThreadDeathTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4364671
- *  @summary Creating a StepRequest on a nonexistant thread fails
+ * @test
+ * @bug 4364671
+ * @summary Creating a StepRequest on a nonexistant thread fails
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g AfterThreadDeathTest.java
- *  @run driver AfterThreadDeathTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g AfterThreadDeathTest.java
+ * @run driver AfterThreadDeathTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/AllLineLocations.java b/jdk/test/com/sun/jdi/AllLineLocations.java
index 939880c..6b171ae 100644
--- a/jdk/test/com/sun/jdi/AllLineLocations.java
+++ b/jdk/test/com/sun/jdi/AllLineLocations.java
@@ -22,17 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4248728
- *  @summary Test ReferenceType.allLineLocations
- *  @author Gordon Hirsch
+ * @test
+ * @bug 4248728
+ * @summary Test ReferenceType.allLineLocations
+ * @author Gordon Hirsch
  *
- *  @modules jdk.jdi
- *  @run build JDIScaffold VMConnection
- *  @run compile -g RefTypes.java
- *  @run build AllLineLocations
+ * @run build JDIScaffold VMConnection
+ * @run compile -g RefTypes.java
+ * @run build AllLineLocations
  *
- *  @run driver AllLineLocations RefTypes
+ * @run driver AllLineLocations RefTypes
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ArgumentValuesTest.java b/jdk/test/com/sun/jdi/ArgumentValuesTest.java
index 13c6b2a..bcce51b 100644
--- a/jdk/test/com/sun/jdi/ArgumentValuesTest.java
+++ b/jdk/test/com/sun/jdi/ArgumentValuesTest.java
@@ -1,13 +1,38 @@
-/** hard coded linenumbers in other tests - DO NOT CHANGE
- *  @test/nodynamiccopyright/
- *  @bug 4490824
- *  @summary JDI: provide arguments when no debug attributes present
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  @author jjh
+ * 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.
  *
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile ArgumentValuesTest.java
- *  @run driver ArgumentValuesTest
+ * 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.
+ */
+
+//    THIS TEST IS LINE NUMBER SENSITIVE
+
+/**
+ * @test
+ * @bug 4490824
+ * @summary JDI: provide arguments when no debug attributes present
+ *
+ * @author jjh
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile ArgumentValuesTest.java
+ * @run driver ArgumentValuesTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
@@ -35,26 +60,26 @@
     static List<Integer> intList;
 
     public static void noArgs() {
-        int index = 0;     // line 38
+        int index = 0;     // line NO_ARGS_LINE_1
     }
 
     public static void allArgs(char p_char, byte p_byte, short p_short,
                                int p_int, long p_long, float p_float,
                                double p_double, int p_iarray[], int p_marray[][],
                                String p_sarray1[], String p_string) {
-        int index = 0;      // line 45
+        int index = 0;      // line ALL_ARGS_LINE_1
     }
 
     public static void varArgs(String ... p1) {
-        int index = 0;     // line 49
+        int index = 0;     // line VAR_ARGS_LINE_1
     }
 
     public static void genericArgs(List<Integer> p1) {
-        int index = 0;     // line 53
+        int index = 0;     // line GENERIC_ARGS_LINE_1
     }
 
     public void instanceMethod(char p_char, byte p_byte) {
-        int index = 0;     // line 57
+        int index = 0;     // line INSTANCE_METHOD_LINE_1
     }
 
     public static void main(String[] args) {
@@ -81,6 +106,12 @@
  /********** test program **********/
 
 public class ArgumentValuesTest extends TestScaffold {
+    static final int NO_ARGS_LINE_1 = 63;
+    static final int ALL_ARGS_LINE_1 = 70;
+    static final int VAR_ARGS_LINE_1 = 74;
+    static final int GENERIC_ARGS_LINE_1 = 78;
+    static final int INSTANCE_METHOD_LINE_1 = 82;
+
     // Must be in same order as args to allArgs(....)
     String fieldNames[] = {"s_char1",   "s_byte1",   "s_short1",  "s_int1",
                            "s_long1",   "s_float1",  "s_double1", "s_iarray1",
@@ -118,7 +149,7 @@
 
         {
             System.out.println("----- Testing each type of arg");
-            bpe = resumeTo("ArgumentValuesTarg", 45);
+            bpe = resumeTo("ArgumentValuesTarg", ALL_ARGS_LINE_1);
             StackFrame frame = bpe.thread().frame(0);
 
             Method mmm = frame.location().method();
@@ -147,7 +178,7 @@
         // a method with no params
         {
             System.out.println("----- Testing no args");
-            bpe = resumeTo("ArgumentValuesTarg", 38);
+            bpe = resumeTo("ArgumentValuesTarg", NO_ARGS_LINE_1);
             StackFrame frame = bpe.thread().frame(0);
 
             Method mmm = frame.location().method();
@@ -165,7 +196,7 @@
         // as a String[3] in the method.
         {
             System.out.println("----- Testing var args");
-            bpe = resumeTo("ArgumentValuesTarg", 49);
+            bpe = resumeTo("ArgumentValuesTarg", VAR_ARGS_LINE_1);
             StackFrame frame = bpe.thread().frame(0);
 
             Method mmm = frame.location().method();
@@ -199,7 +230,7 @@
         // a method with with one generic param
         {
             System.out.println("----- Testing generic args");
-            bpe = resumeTo("ArgumentValuesTarg", 53);
+            bpe = resumeTo("ArgumentValuesTarg", GENERIC_ARGS_LINE_1);
             StackFrame frame = bpe.thread().frame(0);
 
             Method mmm = frame.location().method();
@@ -224,7 +255,7 @@
         // test instance method call
         {
             System.out.println("----- Testing instance method call");
-            bpe = resumeTo("ArgumentValuesTarg", 57);
+            bpe = resumeTo("ArgumentValuesTarg", INSTANCE_METHOD_LINE_1);
             StackFrame frame = bpe.thread().frame(0);
 
             Method mmm = frame.location().method();
diff --git a/jdk/test/com/sun/jdi/ArrayRangeTest.java b/jdk/test/com/sun/jdi/ArrayRangeTest.java
index c7df22f..aa86011 100644
--- a/jdk/test/com/sun/jdi/ArrayRangeTest.java
+++ b/jdk/test/com/sun/jdi/ArrayRangeTest.java
@@ -22,18 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4439631
- *  @bug 4448721
- *  @bug 4448603
- *  @summary Test access to ranges within ArrayReferences
+ * @test
+ * @bug 4439631
+ * @bug 4448721
+ * @bug 4448603
+ * @summary Test access to ranges within ArrayReferences
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g ArrayRangeTest.java
- *  @run driver ArrayRangeTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ArrayRangeTest.java
+ * @run driver ArrayRangeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/BacktraceFieldTest.java b/jdk/test/com/sun/jdi/BacktraceFieldTest.java
index 7136eb9..294b858 100644
--- a/jdk/test/com/sun/jdi/BacktraceFieldTest.java
+++ b/jdk/test/com/sun/jdi/BacktraceFieldTest.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4446677
- *  @bug 8158237
- *  @summary debuggee used to crash when debugging under jbuilder
+ * @test
+ * @bug 4446677
+ * @bug 8158237
+ * @summary debuggee used to crash when debugging under jbuilder
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g BacktraceFieldTest.java
- *  @run driver BacktraceFieldTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g BacktraceFieldTest.java
+ * @run driver BacktraceFieldTest
  */
 
 /*
diff --git a/jdk/test/com/sun/jdi/BreakpointTest.java b/jdk/test/com/sun/jdi/BreakpointTest.java
index 1266f0a..9012c1c 100644
--- a/jdk/test/com/sun/jdi/BreakpointTest.java
+++ b/jdk/test/com/sun/jdi/BreakpointTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,19 +21,20 @@
  * questions.
  */
 
+//    THIS TEST IS LINE NUMBER SENSITIVE
+
 /**
- *  @test
- *  @bug 6496524
- *  @summary Setting breakpoint in jdb crashes Hotspot JVM
+ * @test
+ * @bug 6496524
+ * @key intermittent
+ * @summary Setting breakpoint in jdb crashes Hotspot JVM
+ * @author jjh
  *
- *  @author jjh
- *
- *  @key intermittent
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g BreakpointTest.java
- *  @run driver BreakpointTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g BreakpointTest.java
+ * @run driver BreakpointTest
  */
+
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
 import com.sun.jdi.request.*;
@@ -47,7 +48,6 @@
 
 class BreakpointTarg {
     public final static int BKPT_LINE = 56;
-            // LINE NUMBER SENSITIVE
 
     public static long count;
     static void doit() {
diff --git a/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java b/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java
index a4f8450..60712f8 100644
--- a/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java
+++ b/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java
@@ -27,10 +27,8 @@
  *  @summary Test ClassLoaderReference.visibleClasses() which is
  *  a direct pass-through of the JVMDI function GetClassLoaderClasses
  *  for inclusion of primitive arrays.
- *
  *  @author Robert Field
  *
- *  @modules jdk.jdi
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g ClassLoaderClassesTest.java
  *  @run driver ClassLoaderClassesTest
diff --git a/jdk/test/com/sun/jdi/ClassesByName.java b/jdk/test/com/sun/jdi/ClassesByName.java
index 1e92032..3857a9b 100644
--- a/jdk/test/com/sun/jdi/ClassesByName.java
+++ b/jdk/test/com/sun/jdi/ClassesByName.java
@@ -24,16 +24,14 @@
 /**
  *  @test
  *  @bug 4287992
+ *  @summary ClassesByName verifies that all the classes in the
+ *  loaded class list can be found with classesByName..
  *  @author Robert Field
  *
- *  @modules jdk.jdi
  *  @run build JDIScaffold VMConnection
  *  @run compile -g HelloWorld.java
  *  @run build ClassesByName
  *
- *  @summary ClassesByName verifies that all the classes in the
- *  loaded class list can be found with classesByName..
- *
  *  @run driver ClassesByName HelloWorld
  */
 import com.sun.jdi.*;
diff --git a/jdk/test/com/sun/jdi/ClassesByName2Test.java b/jdk/test/com/sun/jdi/ClassesByName2Test.java
index 2a7c528..c6407ed 100644
--- a/jdk/test/com/sun/jdi/ClassesByName2Test.java
+++ b/jdk/test/com/sun/jdi/ClassesByName2Test.java
@@ -22,16 +22,17 @@
  */
 
 /**
- *  @test
- *  @bug 4406439 4925740
- *  @summary ClassesByName2 verifies that all the classes in the loaded class list can be found with classesByName..
+ * @test
+ * @bug 4406439 4925740
+ * @summary ClassesByName2 verifies that all the classes in the loaded class list can be found with classesByName..
+ * @author Tim Bell (based on ClassesByName by Robert Field)
  *
- *  @author Tim Bell (based on ClassesByName by Robert Field)
+ * @modules jdk.jdi
+ *          java.desktop
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g ClassesByName2Test.java
- *  @run driver ClassesByName2Test
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ClassesByName2Test.java
+ * @run driver ClassesByName2Test
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/CompatibleConnectors.java b/jdk/test/com/sun/jdi/CompatibleConnectors.java
index 189e1b2..57e0f14 100644
--- a/jdk/test/com/sun/jdi/CompatibleConnectors.java
+++ b/jdk/test/com/sun/jdi/CompatibleConnectors.java
@@ -27,7 +27,6 @@
  *
  * This test checks that VirtualMachineManager creates Connectors that
  * are "compatible" those created by 1.4 or earilier releases.
- * @modules jdk.jdi
  */
 
 import com.sun.jdi.*;
diff --git a/jdk/test/com/sun/jdi/ConnectedVMs.java b/jdk/test/com/sun/jdi/ConnectedVMs.java
index 7e41bb1..9bf0267 100644
--- a/jdk/test/com/sun/jdi/ConnectedVMs.java
+++ b/jdk/test/com/sun/jdi/ConnectedVMs.java
@@ -22,20 +22,18 @@
  */
 
 /**
- *  @test
- *  @bug 4329140
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g InstTarg.java
- *  @run driver ConnectedVMs Kill
- *  @run driver ConnectedVMs Resume-to-exit
- *  @run driver ConnectedVMs dispose()
- *  @run driver ConnectedVMs exit()
- *
+ * @test
+ * @bug 4329140
  * @summary ConnectedVMs checks the method
  * VirtualMachineManager.connectedVirtualMachines()
+ * @author Robert Field
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InstTarg.java
+ * @run driver ConnectedVMs Kill
+ * @run driver ConnectedVMs Resume-to-exit
+ * @run driver ConnectedVMs dispose()
+ * @run driver ConnectedVMs exit()
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ConstantPoolInfo.java b/jdk/test/com/sun/jdi/ConstantPoolInfo.java
index 540d26e..097ab53 100644
--- a/jdk/test/com/sun/jdi/ConstantPoolInfo.java
+++ b/jdk/test/com/sun/jdi/ConstantPoolInfo.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 5024104
- *  @summary Test ReferenceType.majorVersion(), minorVersion, constantPoolCount and ConstantPool apis.
+ * @test
+ * @bug 5024104
+ * @summary Test ReferenceType.majorVersion(), minorVersion, constantPoolCount and ConstantPool apis.
+ * @author Swamy Venkataramanappa
  *
- *  @author Swamy Venkataramanappa
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection
- *  @run compile -g ConstantPoolInfo.java
- *  @run driver ConstantPoolInfo
+ * @run build TestScaffold VMConnection
+ * @run compile -g ConstantPoolInfo.java
+ * @run driver ConstantPoolInfo
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ConstantPoolInfoGC.java b/jdk/test/com/sun/jdi/ConstantPoolInfoGC.java
index aacf787..8aa5705 100644
--- a/jdk/test/com/sun/jdi/ConstantPoolInfoGC.java
+++ b/jdk/test/com/sun/jdi/ConstantPoolInfoGC.java
@@ -22,16 +22,16 @@
  */
 
 /*
- *  @test
- *  @bug 6822627
- *  @summary Test that ReferenceType.constantPool does not produce an NPE
+ * @test
+ * @bug 6822627
+ * @summary Test that ReferenceType.constantPool does not produce an NPE
+ * @author Egor Ushakov
  *
- *  @author Egor Ushakov
+ * @modules jdk.jdi/com.sun.tools.jdi:+open
  *
- *  @modules jdk.jdi/com.sun.tools.jdi:+open
- *  @run build TestScaffold VMConnection
- *  @run compile -g ConstantPoolInfoGC.java
- *  @run main/othervm ConstantPoolInfoGC
+ * @run build TestScaffold VMConnection
+ * @run compile -g ConstantPoolInfoGC.java
+ * @run main/othervm ConstantPoolInfoGC
  */
 
 import com.sun.jdi.ReferenceType;
diff --git a/jdk/test/com/sun/jdi/CountEvent.java b/jdk/test/com/sun/jdi/CountEvent.java
index 40086b3..37573b4 100644
--- a/jdk/test/com/sun/jdi/CountEvent.java
+++ b/jdk/test/com/sun/jdi/CountEvent.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4315352
- *  @summary disabling EventRequest expired with addCountFilter() throws
- *   InternalException.
+ * @test
+ * @bug 4315352
+ * @summary disabling EventRequest expired with addCountFilter() throws
+ * InternalException.
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetAdapter TargetListener
- *  @run compile -g CountEvent.java
- *  @run driver CountEvent
+ * @run build TestScaffold VMConnection TargetAdapter TargetListener
+ * @run compile -g CountEvent.java
+ * @run driver CountEvent
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/CountFilterTest.java b/jdk/test/com/sun/jdi/CountFilterTest.java
index e71de81..681a765 100644
--- a/jdk/test/com/sun/jdi/CountFilterTest.java
+++ b/jdk/test/com/sun/jdi/CountFilterTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4321339
- *  @summary Check correct processing of filters after a count filter
+ * @test
+ * @bug 4321339
+ * @summary Check correct processing of filters after a count filter
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g CountFilterTest.java
- *  @run driver CountFilterTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g CountFilterTest.java
+ * @run driver CountFilterTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/DebuggerThreadTest.java b/jdk/test/com/sun/jdi/DebuggerThreadTest.java
index 182c232..496f023 100644
--- a/jdk/test/com/sun/jdi/DebuggerThreadTest.java
+++ b/jdk/test/com/sun/jdi/DebuggerThreadTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4513488
- *  @summary Test for JDI: Internal JDI helper threads should setDaemon(true)
+ * @test
+ * @bug 4513488
+ * @summary Test for JDI: Internal JDI helper threads should setDaemon(true)
+ * @author Tim Bell
  *
- *  @author Tim Bell
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g DebuggerThreadTest.java
- *  @run driver DebuggerThreadTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g DebuggerThreadTest.java
+ * @run driver DebuggerThreadTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java b/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java
index a37cbb33..df805d9 100644
--- a/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java
+++ b/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java
@@ -22,17 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4528948
- *  @summary Unable to finish a debugging in NetBeans IDE
+ * @test
+ * @bug 4528948
+ * @summary Unable to finish a debugging in NetBeans IDE
+ * @author jjh
  *
- *  @author jjh
+ * @library ..
  *
- *  @library ..
- *  @modules jdk.jdi
- *  @run build  TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g DeleteAllBkptsTest.java
- *  @run driver DeleteAllBkptsTest
+ * @run build  TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g DeleteAllBkptsTest.java
+ * @run driver DeleteAllBkptsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java b/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java
index 7d4d807..c096ec7 100644
--- a/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java
+++ b/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4331872
- *  @summary erm.deleteEventRequests(erm.breakpointRequests()) throws exception
+ * @test
+ * @bug 4331872
+ * @summary erm.deleteEventRequests(erm.breakpointRequests()) throws exception
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g DeleteEventRequestsTest.java
- *  @run driver DeleteEventRequestsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g DeleteEventRequestsTest.java
+ * @run driver DeleteEventRequestsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java b/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java
index 728130b..15cb1de 100644
--- a/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java
+++ b/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java
@@ -22,15 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 6431735
- *  @summary Unexpected ClassCastException in ThreadReference.forceEarlyReturn
- *  @author Jim Holmlund
+ * @test
+ * @bug 6431735
+ * @summary Unexpected ClassCastException in ThreadReference.forceEarlyReturn
+ * @author Jim Holmlund
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g EarlyReturnNegativeTest.java
- *  @run driver EarlyReturnNegativeTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g EarlyReturnNegativeTest.java
+ * @run driver EarlyReturnNegativeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/EarlyReturnTest.java b/jdk/test/com/sun/jdi/EarlyReturnTest.java
index e76310c..ac7e532 100644
--- a/jdk/test/com/sun/jdi/EarlyReturnTest.java
+++ b/jdk/test/com/sun/jdi/EarlyReturnTest.java
@@ -22,22 +22,21 @@
  */
 
 /*
- *  @test
- *  @bug 6175634
- *  @summary Allow early return from methods
+ * @test
+ * @bug 6175634
+ * @summary Allow early return from methods
  *
- *  @bug 6431720
- *  @summary Unexpected InvalidTypeException when call ThreadReference.forceEarlyReturn with VoidValue
+ * @bug 6431720
+ * @summary Unexpected InvalidTypeException when call ThreadReference.forceEarlyReturn with VoidValue
  *
- *  @bug 6432855
- *  @summary Need a way to create JDI VoidValue for use in ThreadReference.forceEarlyReturn
+ * @bug 6432855
+ * @summary Need a way to create JDI VoidValue for use in ThreadReference.forceEarlyReturn
  *
- *  @author Tim Bell (based on MethodExitReturnValuesTest by Jim Holmlund)
+ * @author Tim Bell (based on MethodExitReturnValuesTest by Jim Holmlund)
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g EarlyReturnTest.java
- *  @run driver EarlyReturnTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g EarlyReturnTest.java
+ * @run driver EarlyReturnTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/EnumTest.java b/jdk/test/com/sun/jdi/EnumTest.java
index 660479b..324f335 100644
--- a/jdk/test/com/sun/jdi/EnumTest.java
+++ b/jdk/test/com/sun/jdi/EnumTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4728816
- *  @summary JPDA: Add support for enums
+ * @test
+ * @bug 4728816
+ * @summary JPDA: Add support for enums
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g EnumTest.java
- *  @run driver EnumTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g EnumTest.java
+ * @run driver EnumTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java b/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java
index 397373c4..c050cb7 100644
--- a/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java
+++ b/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java
@@ -22,21 +22,20 @@
  */
 
 /**
- *  @test
- *  @bug 4425852
- *  @author Robert Field
+ * @test
+ * @bug 4425852
+ * @author Robert Field
  *
- *  @modules jdk.jdi
- *  @run build VMConnection
- *  @run compile -g EventQueueDisconnectTest.java
- *  @run driver EventQueueDisconnectTest
- *
- *  @summary EventQueueDisconnectTest checks to see that
- *  VMDisconnectedException is never thrown before VMDisconnectEvent.
+ * @summary EventQueueDisconnectTest checks to see that
+ * VMDisconnectedException is never thrown before VMDisconnectEvent.
  *
  * Failure mode for this test is throwing VMDisconnectedException
  * on vm.eventQueue().remove();
  * Does not use a scaffold since we don't want that hiding the exception.
+ *
+ * @run build VMConnection
+ * @run compile -g EventQueueDisconnectTest.java
+ * @run driver EventQueueDisconnectTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ExceptionEvents.java b/jdk/test/com/sun/jdi/ExceptionEvents.java
index 8835c46..18015a9 100644
--- a/jdk/test/com/sun/jdi/ExceptionEvents.java
+++ b/jdk/test/com/sun/jdi/ExceptionEvents.java
@@ -22,43 +22,41 @@
  */
 
 /**
- *  @test
- *  @bug 4407397
- *  @summary Test the requesting of exception events
+ * @test
+ * @bug 4407397
+ * @key intermittent
+ * @summary Test the requesting of exception events
+ * @author Robert Field
  *
- *  @author Robert Field
+ * @run build TestScaffold VMConnection
+ * @run compile -g ExceptionEvents.java
  *
- *  @key intermittent
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection
- *  @run compile -g ExceptionEvents.java
- *
- *  @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.Exception
- *  @run driver ExceptionEvents C A StackOverflowCaughtTarg null
- *  @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.Error
- *  @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.StackOverflowError
- *  @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents C A StackOverflowCaughtTarg null
+ * @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.NullPointerException
 
- *  @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.Exception
- *  @run driver ExceptionEvents C T StackOverflowCaughtTarg null
- *  @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.Error
- *  @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.StackOverflowError
- *  @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents C T StackOverflowCaughtTarg null
+ * @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.NullPointerException
 
- *  @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.Exception
- *  @run driver ExceptionEvents C N StackOverflowCaughtTarg null
- *  @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.Error
- *  @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.StackOverflowError
- *  @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents C N StackOverflowCaughtTarg null
+ * @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.NullPointerException
 
- *  @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.Exception
- *  @run driver ExceptionEvents U A StackOverflowUncaughtTarg null
- *  @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.Error
- *  @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.StackOverflowError
- *  @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents U A StackOverflowUncaughtTarg null
+ * @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.Error
+ * @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.NullPointerException
 
- *  @run driver ExceptionEvents N T StackOverflowUncaughtTarg java.lang.NullPointerException
- *  @run driver ExceptionEvents N N StackOverflowUncaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N T StackOverflowUncaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N N StackOverflowUncaughtTarg java.lang.NullPointerException
 
  */
 import com.sun.jdi.*;
diff --git a/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java b/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java
index d8a30da..f3c6012 100644
--- a/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java
+++ b/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java
@@ -22,17 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4453310
- *  @summary Test the deletion of event requests that are expired
- *     by virtue of addCountFilter.
+ * @test
+ * @bug 4453310
+ * @summary Test the deletion of event requests that are expired
+ * by virtue of addCountFilter.
  *
- *  @author Robert Field
+ * @author Robert Field
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g ExpiredRequestDeletionTest.java
- *  @run driver ExpiredRequestDeletionTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ExpiredRequestDeletionTest.java
+ * @run driver ExpiredRequestDeletionTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/FetchLocals.java b/jdk/test/com/sun/jdi/FetchLocals.java
index 67d865d..1195a8d 100644
--- a/jdk/test/com/sun/jdi/FetchLocals.java
+++ b/jdk/test/com/sun/jdi/FetchLocals.java
@@ -1,13 +1,37 @@
-/** hard coded linenumbers in test - DO NOT CHANGE
- *  @test/nodynamiccopyright/
- *  @bug 4386002 4429245
- *  @summary Test fix for: Incorrect values reported for some locals of type long
+/*
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  @author Tim Bell
+ * 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.
  *
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g FetchLocals.java
- *  @run driver FetchLocals
+ * 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.
+ */
+
+//    THIS TEST IS LINE NUMBER SENSITIVE
+
+/**
+ * @test
+ * @bug 4386002 4429245
+ * @summary Test fix for: Incorrect values reported for some locals of type long
+ * @author Tim Bell
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g FetchLocals.java
+ * @run driver FetchLocals
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
@@ -59,7 +83,7 @@
         System.out.println(f);
         System.out.print("d is: ");
         System.out.println(d);
-        System.out.println();   // Thie is Line 63...
+        System.out.println();   // This is FetchLocals::LINE
         if (w == 0xde00ad00be00ef00L) {
           System.out.print  ("The debugger was here.  w modified to: 0x");
           System.out.println(Long.toHexString(w));
@@ -87,6 +111,7 @@
 }
 
 public class FetchLocals extends TestScaffold {
+    static final int LINE = 86;
 
     FetchLocals (String args[]) {
         super(args);
@@ -355,7 +380,7 @@
          * Get to the bottom of testMethod():
          */
         try {
-            BreakpointEvent bpe = resumeTo("FetchLocalsDebugee", 63);
+            BreakpointEvent bpe = resumeTo("FetchLocalsDebugee", LINE);
             /*
              * Fetch values from fields; what did we get?
              */
diff --git a/jdk/test/com/sun/jdi/FieldWatchpoints.java b/jdk/test/com/sun/jdi/FieldWatchpoints.java
index a465e9c6..60ee101 100644
--- a/jdk/test/com/sun/jdi/FieldWatchpoints.java
+++ b/jdk/test/com/sun/jdi/FieldWatchpoints.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4408582
- *  @summary Test fix for: JDWP: WatchpointEvents outside of class filtered out
+ * @test
+ * @bug 4408582
+ * @summary Test fix for: JDWP: WatchpointEvents outside of class filtered out
+ * @author Tim Bell
  *
- *  @author Tim Bell
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g FieldWatchpoints.java
- *  @run driver FieldWatchpoints
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g FieldWatchpoints.java
+ * @run driver FieldWatchpoints
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/FilterMatch.java b/jdk/test/com/sun/jdi/FilterMatch.java
index 478ec77..0721758 100644
--- a/jdk/test/com/sun/jdi/FilterMatch.java
+++ b/jdk/test/com/sun/jdi/FilterMatch.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4331522
- *  @summary addClassFilter("Foo") acts like "Foo*"
+ * @test
+ * @bug 4331522
+ * @summary addClassFilter("Foo") acts like "Foo*"
+ * @author Robert Field/Jim Holmlund
  *
- *  @author Robert Field/Jim Holmlund
- *
- *  @modules jdk.jdi
- *  @run build JDIScaffold VMConnection
- *  @run compile -g HelloWorld.java
- *  @run driver FilterMatch
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run driver FilterMatch
  */
 
 /* Look at patternMatch in JDK file:
diff --git a/jdk/test/com/sun/jdi/FilterNoMatch.java b/jdk/test/com/sun/jdi/FilterNoMatch.java
index 1c3d6b8..bf823ab 100644
--- a/jdk/test/com/sun/jdi/FilterNoMatch.java
+++ b/jdk/test/com/sun/jdi/FilterNoMatch.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4331522
- *  @summary addClassFilter("Foo") acts like "Foo*"
+ * @test
+ * @bug 4331522
+ * @summary addClassFilter("Foo") acts like "Foo*"
+ * @author Robert Field/Jim Holmlund
  *
- *  @author Robert Field/Jim Holmlund
- *
- *  @modules jdk.jdi
- *  @run build JDIScaffold VMConnection
- *  @run compile -g HelloWorld.java
- *  @run driver FilterNoMatch
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run driver FilterNoMatch
  */
 
 /* This tests the patternMatch function in JDK file:
diff --git a/jdk/test/com/sun/jdi/FinalLocalsTest.java b/jdk/test/com/sun/jdi/FinalLocalsTest.java
index f8e8deb..a76ee82 100644
--- a/jdk/test/com/sun/jdi/FinalLocalsTest.java
+++ b/jdk/test/com/sun/jdi/FinalLocalsTest.java
@@ -22,18 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4326648 4768329
- *  @summary Test to verify that table entries are generated for all final
- *           locals when a class is built for debug, even if they could be
- *           inlined otherwise.
+ * @test
+ * @bug 4326648 4768329
+ * @summary Test to verify that table entries are generated for all final
+ *          locals when a class is built for debug, even if they could be
+ *          inlined otherwise.
+ * @author Tim Bell
  *
- *  @author Tim Bell
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g FinalLocalsTest.java
- *  @run driver FinalLocalsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g FinalLocalsTest.java
+ * @run driver FinalLocalsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/FinalizerTest.java b/jdk/test/com/sun/jdi/FinalizerTest.java
index 6ac34c7..1163607 100644
--- a/jdk/test/com/sun/jdi/FinalizerTest.java
+++ b/jdk/test/com/sun/jdi/FinalizerTest.java
@@ -22,16 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4272800 4274208 4392010
- *  @summary Test debugger operations in finalize() methods
- *  @author Gordon Hirsch  (modified for HotSpot by tbell & rfield)
+ * @test
+ * @bug 4272800 4274208 4392010
+ * @summary Test debugger operations in finalize() methods
+ * @author Gordon Hirsch  (modified for HotSpot by tbell & rfield)
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g FinalizerTest.java
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g FinalizerTest.java
  *
- *  @run driver FinalizerTest
+ * @run driver FinalizerTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/FramesTest.java b/jdk/test/com/sun/jdi/FramesTest.java
index 88065b8..b60e725 100644
--- a/jdk/test/com/sun/jdi/FramesTest.java
+++ b/jdk/test/com/sun/jdi/FramesTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4434232
- *  @summary Test ThreadReference.frames(int,int)
+ * @test
+ * @bug 4434232
+ * @summary Test ThreadReference.frames(int,int)
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g FramesTest.java
- *  @run driver FramesTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g FramesTest.java
+ * @run driver FramesTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/GenericsTest.java b/jdk/test/com/sun/jdi/GenericsTest.java
index 375839a..28a3d69 100644
--- a/jdk/test/com/sun/jdi/GenericsTest.java
+++ b/jdk/test/com/sun/jdi/GenericsTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4421040
- *  @summary  JPDA: Add support for JSR-014 Generics
+ * @test
+ * @bug 4421040
+ * @summary  JPDA: Add support for JSR-014 Generics
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g GenericsTest.java
- *  @run driver GenericsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g GenericsTest.java
+ * @run driver GenericsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/GetLocalVariables.java b/jdk/test/com/sun/jdi/GetLocalVariables.java
index bc21ffd..866048f 100644
--- a/jdk/test/com/sun/jdi/GetLocalVariables.java
+++ b/jdk/test/com/sun/jdi/GetLocalVariables.java
@@ -1,14 +1,39 @@
-/** hard coded linenumbers in this test - DO NOT CHANGE
- *  @test/nodynamiccopyright/
- *  @bug 4359312 4450091
- *  @summary Test PTR 1421 JVM exceptions making a call to LocalVariable.type().name()
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  @author Tim Bell (based on the PTR 1421 report submitted by IBM).
+ * 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.
  *
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g GetLocalVariables.java
- *  @run driver GetLocalVariables
+ * 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.
  */
+
+//    THIS TEST IS LINE NUMBER SENSITIVE
+
+/**
+ * @test
+ * @bug 4359312 4450091
+ * @summary Test PTR 1421 JVM exceptions making a call to LocalVariable.type().name()
+ * @author Tim Bell (based on the PTR 1421 report submitted by IBM).
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g GetLocalVariables.java
+ * @run driver GetLocalVariables
+ */
+
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
 import com.sun.jdi.request.*;
@@ -194,7 +219,7 @@
                                      l_long, l_float, l_double, l_iarray,
                                      l_marray, l_string);
 
-        e1.test_1();            // <-- this is line 197
+        e1.test_1();            // RESUME_TO_LINE
         e3.test_1();
         e4.test_1();
         e5.test_1();
@@ -231,6 +256,7 @@
  /********** test program **********/
 
 public class GetLocalVariables extends TestScaffold {
+    static final int RESUME_TO_LINE = 222;
     ReferenceType targetClass;
     ThreadReference mainThread;
 
@@ -257,7 +283,7 @@
         mainThread = bpe.thread();
         EventRequestManager erm = vm().eventRequestManager();
 
-        bpe = resumeTo("GetLocalVariablesTarg", 197);
+        bpe = resumeTo("GetLocalVariablesTarg", RESUME_TO_LINE);
         /*
          * We've arrived.  Look around at some variables.
          */
diff --git a/jdk/test/com/sun/jdi/GetLocalVariables2Test.java b/jdk/test/com/sun/jdi/GetLocalVariables2Test.java
index 6502967..4224715 100644
--- a/jdk/test/com/sun/jdi/GetLocalVariables2Test.java
+++ b/jdk/test/com/sun/jdi/GetLocalVariables2Test.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4349534 4690242 4695338
- *  @summary regression - bad LocalVariableTable attribute when no initialization needed
+ * @test
+ * @bug 4349534 4690242 4695338
+ * @summary regression - bad LocalVariableTable attribute when no initialization needed
+ * @author Tim Bell
  *
- *  @author Tim Bell
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g GetLocalVariables2Test.java
- *  @run driver GetLocalVariables2Test
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g GetLocalVariables2Test.java
+ * @run driver GetLocalVariables2Test
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/GetSetLocalTest.java b/jdk/test/com/sun/jdi/GetSetLocalTest.java
index deaa0b4..e4420e9 100644
--- a/jdk/test/com/sun/jdi/GetSetLocalTest.java
+++ b/jdk/test/com/sun/jdi/GetSetLocalTest.java
@@ -1,13 +1,37 @@
-/** hard coded linenumbers in other tests - DO NOT CHANGE
- *  @test/nodynamiccopyright/
- *  @bug 4300412
- *  @summary Test GetLocal* and SetLocal* functions
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  @author Serguei Spitsyn
+ * 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.
  *
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g GetSetLocalTest.java
- *  @run driver GetSetLocalTest
+ * 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.
+ */
+
+//    THIS TEST IS LINE NUMBER SENSITIVE
+
+/**
+ * @test
+ * @bug 4300412
+ * @summary Test GetLocal* and SetLocal* functions
+ * @author Serguei Spitsyn
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g GetSetLocalTest.java
+ * @run driver GetSetLocalTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
@@ -35,7 +59,7 @@
         int result;
         {
              { boolean bool_1 = false;
-               intArg++;
+               intArg++; // START_LINE
              }
 
              boolean bool_2 = true;
@@ -111,7 +135,7 @@
              }
 
              Object obj_2 = new Object();
-             intArg++;  // <-- Last stop is at this point.
+             intArg++;  // STOP_LINE. Last stop is at this point.
                         //     Only obj_2 and intArg are valid
                         // Note: even result is not valid here!
         }
@@ -125,6 +149,8 @@
     /********** test program **********/
 
 public class GetSetLocalTest extends TestScaffold {
+    static final int START_LINE = 62;
+    static final int STOP_LINE = 138;
     ReferenceType targetClass;
     ThreadReference mainThread;
 
@@ -635,7 +661,7 @@
         println("EventRequestManager");
         StackFrame frame = null;
 
-        for (int line = 38; line < 118; line += 4) {
+        for (int line = START_LINE; line <= STOP_LINE; line += 4) {
             println("\n resumeTo(GetSetLocalTarg, " + line + ")");
             bpe = resumeTo("GetSetLocalTarg", line);
             frame = bpe.thread().frame(0);
diff --git a/jdk/test/com/sun/jdi/GetUninitializedStringValue.java b/jdk/test/com/sun/jdi/GetUninitializedStringValue.java
index 66bec8e..eb9ae72 100644
--- a/jdk/test/com/sun/jdi/GetUninitializedStringValue.java
+++ b/jdk/test/com/sun/jdi/GetUninitializedStringValue.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 8021897
- *  @summary Test getting the value for an uninitialized String object
+ * @test
+ * @bug 8021897
+ * @summary Test getting the value for an uninitialized String object
+ * @author Staffan Larsen
  *
- *  @author Staffan Larsen
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g GetUninitializedStringValue.java
- *  @run driver GetUninitializedStringValue
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g GetUninitializedStringValue.java
+ * @run driver GetUninitializedStringValue
  */
 import com.sun.jdi.ReferenceType;
 import com.sun.jdi.StackFrame;
diff --git a/jdk/test/com/sun/jdi/HomeTest.java b/jdk/test/com/sun/jdi/HomeTest.java
index dcc23a0..d2905fd 100644
--- a/jdk/test/com/sun/jdi/HomeTest.java
+++ b/jdk/test/com/sun/jdi/HomeTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4446294
- *  @summary JDI spec/impl: default "home" for CommandLineLaunch isn't java.home
+ * @test
+ * @bug 4446294
+ * @summary JDI spec/impl: default "home" for CommandLineLaunch isn't java.home
+ * @author Tim Bell (based on "HomeTest.java" by Eugene I. Latkin)
  *
- *  @author Tim Bell (based on "HomeTest.java" by Eugene I. Latkin)
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g HomeTest.java
- *  @run driver HomeTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g HomeTest.java
+ * @run driver HomeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.connect.*;
diff --git a/jdk/test/com/sun/jdi/ImmutableResourceTest.sh b/jdk/test/com/sun/jdi/ImmutableResourceTest.sh
index 133925e..b8b37f7 100644
--- a/jdk/test/com/sun/jdi/ImmutableResourceTest.sh
+++ b/jdk/test/com/sun/jdi/ImmutableResourceTest.sh
@@ -21,13 +21,15 @@
 # questions.
 #
 
-#   @test
-#   @bug        6287579
-#   @summary    SubClasses of ListResourceBundle should fix getContents()
-#   @author     Tim Bell
 #
-#   @run shell ImmutableResourceTest.sh
+# @test
+# @bug        6287579
+# @summary    SubClasses of ListResourceBundle should fix getContents()
+# @author     Tim Bell
 #
+# @modules jdk.jdi/com.sun.tools.example.debug.tty
+#
+# @run shell ImmutableResourceTest.sh
 #
 
 # Beginning of subroutines:
diff --git a/jdk/test/com/sun/jdi/InstanceFilter.java b/jdk/test/com/sun/jdi/InstanceFilter.java
index 43cfedd..9514779 100644
--- a/jdk/test/com/sun/jdi/InstanceFilter.java
+++ b/jdk/test/com/sun/jdi/InstanceFilter.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4312961
- *  @summary Verify that an instance filter on a MethodEntryRequest works
- *   properly.
+ * @test
+ * @bug 4312961
+ * @summary Verify that an instance filter on a MethodEntryRequest works
+ *  properly.
+ * @author Robert Field/Jim Holmlund
  *
- *  @author Robert Field/Jim Holmlund
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetAdapter TargetListener
- *  @run compile -g InstanceFilter.java
- *  @run driver InstanceFilter
+ * @run build TestScaffold VMConnection TargetAdapter TargetListener
+ * @run compile -g InstanceFilter.java
+ * @run driver InstanceFilter
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/InstancesTest.java b/jdk/test/com/sun/jdi/InstancesTest.java
index 6f5cbb4..9ef7257 100644
--- a/jdk/test/com/sun/jdi/InstancesTest.java
+++ b/jdk/test/com/sun/jdi/InstancesTest.java
@@ -22,15 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 5024119
- *  @summary Add ReferenceType.getAllInstances () method to JDI.
- *  @author jjh
+ * @test
+ * @bug 5024119
+ * @summary Add ReferenceType.getAllInstances () method to JDI.
+ * @author jjh
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g InstancesTest.java
- *  @run driver InstancesTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InstancesTest.java
+ * @run driver InstancesTest
  */
 
 /*
diff --git a/jdk/test/com/sun/jdi/InterfaceMethodsTest.java b/jdk/test/com/sun/jdi/InterfaceMethodsTest.java
index 953893b..163235b 100644
--- a/jdk/test/com/sun/jdi/InterfaceMethodsTest.java
+++ b/jdk/test/com/sun/jdi/InterfaceMethodsTest.java
@@ -22,16 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 8031195
- *  @bug 8071657
- *  @bug 8165827
- *  @summary  JDI: Add support for static, private and default methods in interfaces
+ * @test
+ * @bug 8031195
+ * @bug 8071657
+ * @bug 8165827
+ * @summary  JDI: Add support for static, private and default methods in interfaces
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run build InterfaceMethodsTest
- *  @run driver InterfaceMethodsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run build InterfaceMethodsTest
+ * @run driver InterfaceMethodsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/InterruptHangTest.java b/jdk/test/com/sun/jdi/InterruptHangTest.java
index 0e7a24a..b93bff7 100644
--- a/jdk/test/com/sun/jdi/InterruptHangTest.java
+++ b/jdk/test/com/sun/jdi/InterruptHangTest.java
@@ -26,16 +26,14 @@
 import com.sun.jdi.request.*;
 
 /**
- *  @test
- *  @bug 6459476
- *  @summary Debuggee is blocked,  looks like running
+ * @test
+ * @bug 6459476
+ * @summary Debuggee is blocked,  looks like running
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g InterruptHangTest.java
- *  @run driver InterruptHangTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InterruptHangTest.java
+ * @run driver InterruptHangTest
  */
 
 /**
diff --git a/jdk/test/com/sun/jdi/InvokeHangTest.java b/jdk/test/com/sun/jdi/InvokeHangTest.java
index 56ccbc2..528a25c 100644
--- a/jdk/test/com/sun/jdi/InvokeHangTest.java
+++ b/jdk/test/com/sun/jdi/InvokeHangTest.java
@@ -22,17 +22,18 @@
  */
 
 /**
- *  @test
- *  @bug 6293795
- *  @summary  Backend hangs when invokeMethod is called from a JDI eventHandler
+ * @test
+ * @bug 6293795
+ * @summary  Backend hangs when invokeMethod is called from a JDI eventHandler
+ * @author jjh
  *
- *  @author jjh
+ * @library /test/lib
+ * @modules java.management
+ *          jdk.jdi
  *
- *  @modules jdk.jdi
- *  @library /test/lib
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g InvokeHangTest.java
- *  @run driver InvokeHangTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InvokeHangTest.java
+ * @run driver InvokeHangTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/InvokeTest.java b/jdk/test/com/sun/jdi/InvokeTest.java
index 09fcc77..bacfc38 100644
--- a/jdk/test/com/sun/jdi/InvokeTest.java
+++ b/jdk/test/com/sun/jdi/InvokeTest.java
@@ -22,17 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4451941 4527072
- *  @summary Test argument types for invoke
+ * @test
+ * @bug 4451941 4527072
+ * @summary Test argument types for invoke
+ * @author Robert Field
  *
- *  @author Robert Field
+ * @library ..
  *
- *  @library ..
- *  @modules jdk.jdi
- *  @run build  TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g InvokeTest.java
- *  @run driver InvokeTest
+ * @run build  TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InvokeTest.java
+ * @run driver InvokeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/JITDebug.sh b/jdk/test/com/sun/jdi/JITDebug.sh
index 0f83786..21ac8d9 100644
--- a/jdk/test/com/sun/jdi/JITDebug.sh
+++ b/jdk/test/com/sun/jdi/JITDebug.sh
@@ -24,17 +24,16 @@
 #
 
 #
-#   @test       JITDebug.sh 1.7 03/09/05
-#   @bug        4291701 4376819 4422312 4522770 4913748
-#   @summary    Test JIT debugging - assure that launching on
-#               uncaught exception works
-#   @author     Tim Bell
-#   Based on test/java/awt/TEMPLATE/AutomaticShellTest.sh
+# @test       JITDebug.sh 1.7 03/09/05
+# @bug        4291701 4376819 4422312 4522770 4913748
+# @summary    Test JIT debugging - assure that launching on
+#             uncaught exception works
+# @author     Tim Bell
+# Based on test/java/awt/TEMPLATE/AutomaticShellTest.sh
 #
-#   @modules jdk.jdi
-#   @run build TestScaffold VMConnection TargetListener TargetAdapter
-#   @run compile -g JITDebug.java
-#   @run shell JITDebug.sh
+# @run build TestScaffold VMConnection TargetListener TargetAdapter
+# @run compile -g JITDebug.java
+# @run shell JITDebug.sh
 
 # Beginning of subroutines:
 status=1
diff --git a/jdk/test/com/sun/jdi/Java_gTest.java b/jdk/test/com/sun/jdi/Java_gTest.java
index 5d4c811..a87da73 100644
--- a/jdk/test/com/sun/jdi/Java_gTest.java
+++ b/jdk/test/com/sun/jdi/Java_gTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4500906 4433599 4740097
- *  @summary vmexec= debug java fails for SunCommandLineLauncher
+ * @test
+ * @bug 4500906 4433599 4740097
+ * @summary vmexec= debug java fails for SunCommandLineLauncher
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g Java_gTest.java
- *  @run driver Java_gTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g Java_gTest.java
+ * @run driver Java_gTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/LambdaBreakpointTest.java b/jdk/test/com/sun/jdi/LambdaBreakpointTest.java
index 2423b73..c0a31be 100644
--- a/jdk/test/com/sun/jdi/LambdaBreakpointTest.java
+++ b/jdk/test/com/sun/jdi/LambdaBreakpointTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,19 +21,18 @@
  * questions.
  */
 
-/********** LINE NUMBER SENSITIVE! *****************************************************************/
+//    THIS TEST IS LINE NUMBER SENSITIVE
 
 /**
- *  @test
- *  @summary Test setting breakpoints on lambda calls
+ * @test
+ * @summary Test setting breakpoints on lambda calls
+ * @author Staffan Larsen
  *
- *  @author Staffan Larsen
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g LambdaBreakpointTest.java
- *  @run driver LambdaBreakpointTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g LambdaBreakpointTest.java
+ * @run driver LambdaBreakpointTest
  */
+
 import java.util.List;
 
 import com.sun.jdi.LocalVariable;
@@ -50,22 +49,17 @@
  /********** target program **********/
 
 class LambdaBreakpointTestTarg {
-
-    static int[] breakpointLines = {
-            63, 67, 64, 65, 66, 68
-    };
-
     public static void main(String[] args) {
         test();
     }
 
     private static void test() {
-        Runnable r = () -> {                          // B1: L62
-            String from = "lambda";                   // B3: L63
-            System.out.println("Hello from " + from); // B4: L64
-        };                                            // B5: L65
-        r.run();                                      // B2: L66
-        System.out.println("Goodbye.");               // B6: L67
+        Runnable r = () -> {                          // LambdaBreakpointTest::TEST_LINE_1, BKPT_LINES[0]
+            String from = "lambda";                   // LambdaBreakpointTest::TEST_LINE_2, BKPT_LINES[2]
+            System.out.println("Hello from " + from); // LambdaBreakpointTest::TEST_LINE_3, BKPT_LINES[3]
+        };                                            // LambdaBreakpointTest::TEST_LINE_4, BKPT_LINES[4]
+        r.run();                                      // LambdaBreakpointTest::TEST_LINE_5, BKPT_LINES[1]
+        System.out.println("Goodbye.");               // LambdaBreakpointTest::TEST_LINE_6, BKPT_LINES[5]
     }
 }
 
@@ -73,6 +67,21 @@
  /********** test program **********/
 
 public class LambdaBreakpointTest extends TestScaffold {
+    private static final int TEST_LINE_1 = 57;
+    private static final int TEST_LINE_2 = TEST_LINE_1 + 1;
+    private static final int TEST_LINE_3 = TEST_LINE_1 + 2;
+    private static final int TEST_LINE_4 = TEST_LINE_1 + 3;
+    private static final int TEST_LINE_5 = TEST_LINE_1 + 4;
+    private static final int TEST_LINE_6 = TEST_LINE_1 + 5;
+
+    private static final int[] BKPT_LINES = {
+        TEST_LINE_1,
+        TEST_LINE_5,
+        TEST_LINE_2,
+        TEST_LINE_3,
+        TEST_LINE_4,
+        TEST_LINE_6,
+    };
 
     LambdaBreakpointTest (String args[]) {
         super(args);
@@ -92,7 +101,7 @@
         startToMain("LambdaBreakpointTestTarg");
 
         // Put a breakpoint on each location in the order they should happen
-        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
+        for (int line : BKPT_LINES) {
             System.out.println("Running to line: " + line);
             BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
             int stoppedAt = be.location().lineNumber();
diff --git a/jdk/test/com/sun/jdi/LambdaStepTest.java b/jdk/test/com/sun/jdi/LambdaStepTest.java
index 2b594f8..a5fd06a 100644
--- a/jdk/test/com/sun/jdi/LambdaStepTest.java
+++ b/jdk/test/com/sun/jdi/LambdaStepTest.java
@@ -22,15 +22,13 @@
  */
 
 /**
- *  @test
- *  @summary Test stepping through lambdas
+ * @test
+ * @summary Test stepping through lambdas
+ * @author Staffan Larsen
  *
- *  @author Staffan Larsen
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g LambdaStepTest.java
- *  @run driver LambdaStepTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g LambdaStepTest.java
+ * @run driver LambdaStepTest
  */
 import com.sun.jdi.LocalVariable;
 import com.sun.jdi.ObjectReference;
diff --git a/jdk/test/com/sun/jdi/LaunchCommandLine.java b/jdk/test/com/sun/jdi/LaunchCommandLine.java
index 3a55a5c..e75a5bc 100644
--- a/jdk/test/com/sun/jdi/LaunchCommandLine.java
+++ b/jdk/test/com/sun/jdi/LaunchCommandLine.java
@@ -22,17 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4245011
- *  @summary Test launcher command line construction
- *  @author Gordon Hirsch
+ * @test
+ * @bug 4245011
+ * @summary Test launcher command line construction
+ * @author Gordon Hirsch
  *
- *  @modules jdk.jdi
- *  @run build JDIScaffold VMConnection
- *  @run compile -g HelloWorld.java
- *  @run build LaunchCommandLine
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run build LaunchCommandLine
  *
- *  @run driver LaunchCommandLine
+ * @run driver LaunchCommandLine
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/LineNumberInfo.java b/jdk/test/com/sun/jdi/LineNumberInfo.java
index 5b7ff74..5172dc1 100644
--- a/jdk/test/com/sun/jdi/LineNumberInfo.java
+++ b/jdk/test/com/sun/jdi/LineNumberInfo.java
@@ -27,7 +27,6 @@
  *  @summary Test javac regressions in the generation of line number info
  *  @author Gordon Hirsch
  *
- *  @modules jdk.jdi
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -XDstringConcat=inline -g LineNumberInfo.java ControlFlow.java
  *
diff --git a/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java b/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java
index 49b558c..413ea98 100644
--- a/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java
+++ b/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java
@@ -1,13 +1,37 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+//    THIS TEST IS LINE NUMBER SENSITIVE
+
 /**
- *  @test/nodynamiccopyright/
- *  @bug 4952629 4870514
- *  @summary REGRESSION: javac generates a spurious line number entry on } else {
+ * @test
+ * @bug 4952629 4870514
+ * @summary REGRESSION: javac generates a spurious line number entry on } else {
+ * @author jjh
  *
- *  @author jjh
- *
- *  @run build VMConnection TargetListener TargetAdapter
- *  @run compile -g LineNumberOnBraceTest.java
- *  @run driver LineNumberOnBraceTest
+ * @run build VMConnection TargetListener TargetAdapter
+ * @run compile -g LineNumberOnBraceTest.java
+ * @run driver LineNumberOnBraceTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
@@ -15,29 +39,27 @@
 
 import java.util.*;
 
-    /********** LINE NUMBER SENSITIVE! *****************************************************************/
 class LineNumberOnBraceTarg {
 
-    public final static int stopLine = 29;   // THIS MUST BE THE LINE NUMBER OF THE // stopline LINE
-    public final static int stopLine2 = 35;  // THIS MUST BE THE LINE NUMBER OF THE // stopline2 LINE
-
+    public final static int STOP_LINE = 50;    // THIS MUST BE THE LINE NUMBER OF // STOP_LINE LINE
+    public final static int STOP_LINE_2 = 56;  // THIS MUST BE THE LINE NUMBER OF // STOP_LINE_2 LINE
 
     public static void main(String[] args){
         System.out.println("Howdy!");
         if (args.length == 0) {
-            System.out.println("No args to debuggee");             // stopLine
+            System.out.println("No args to debuggee");             // STOP_LINE
         } else {
             System.out.println("Some args to debuggee");
         }
-        if (args.length == 0) {
+        if (args.length == 0) {                                    // STOP_LINE + 4
             boolean b1 = false;
-            if (b1) {                                              // stopLine2
+            if (b1) {                                              // STOP_LINE_2
                 System.out.println("In 2nd else");                 // bug 4870514 is that we stop here.
             }
         } else {
             System.out.println("In 2nd else");
         }
-        System.out.println("Goodbye from LineNumberOnBraceTarg!");  // stopLine2 + 6
+        System.out.println("Goodbye from LineNumberOnBraceTarg!");
     }
 
     // This isn't part of the test; it is just here
@@ -78,7 +100,7 @@
         targetClass = bpe.location().declaringType();
         mainThread = bpe.thread();
 
-        resumeTo("LineNumberOnBraceTarg", LineNumberOnBraceTarg.stopLine);
+        resumeTo("LineNumberOnBraceTarg", LineNumberOnBraceTarg.STOP_LINE);
         StepEvent stepev = stepOverLine(mainThread);       // step to 2nd if (args.length
 
         // Bug 4952629 is that javac outputs a line number
@@ -87,24 +109,23 @@
 
         int ln = stepev.location().lineNumber();
         System.out.println("Debuggee is stopped at line " + ln);
-        if (ln != LineNumberOnBraceTarg.stopLine + 4) {
+        if (ln != LineNumberOnBraceTarg.STOP_LINE + 4) {
             failure("FAIL: Bug 4952629: Should be at line " +
-                    (LineNumberOnBraceTarg.stopLine + 4) +
+                    (LineNumberOnBraceTarg.STOP_LINE + 4) +
                     ", am at " + ln);
         } else {
             System.out.println("Passed test for 4952629");
         }
 
         // Test for bug 4870514
-        System.out.println("Resuming to " + LineNumberOnBraceTarg.stopLine2);
-        resumeTo("LineNumberOnBraceTarg", LineNumberOnBraceTarg.stopLine2);
-        System.out.println("Stopped at " + LineNumberOnBraceTarg.stopLine2);
+        System.out.println("Resuming to " + LineNumberOnBraceTarg.STOP_LINE_2);
+        resumeTo("LineNumberOnBraceTarg", LineNumberOnBraceTarg.STOP_LINE_2);
+        System.out.println("Stopped at " + LineNumberOnBraceTarg.STOP_LINE_2);
         stepev = stepOverLine(mainThread);
         ln = stepev.location().lineNumber();
         System.out.println("Debuggee is stopped at line " + ln);
-        if (ln == LineNumberOnBraceTarg.stopLine2 + 1) {
-            failure("FAIL: bug 4870514: Incorrectly stopped at " +
-                    (LineNumberOnBraceTarg.stopLine2 + 1));
+        if (ln <= LineNumberOnBraceTarg.STOP_LINE_2 + 1) {
+            failure("FAIL: bug 4870514: Incorrectly stopped at " + ln);
         } else {
             System.out.println("Passed test for 4870514");
         }
diff --git a/jdk/test/com/sun/jdi/ListenAddress.java b/jdk/test/com/sun/jdi/ListenAddress.java
index 2561390..46ec16a 100644
--- a/jdk/test/com/sun/jdi/ListenAddress.java
+++ b/jdk/test/com/sun/jdi/ListenAddress.java
@@ -26,7 +26,6 @@
  * @summary Test that startListening(Map) method of the com.sun.jdi.SocketListen
  *          Connector returns an address that is usable for the address option on
  *          remove debuggees.
- * @modules jdk.jdi
  */
 import java.net.InetAddress;
 import java.net.Inet4Address;
diff --git a/jdk/test/com/sun/jdi/LocalVariableEqual.java b/jdk/test/com/sun/jdi/LocalVariableEqual.java
index ed3ef66..7663bfa 100644
--- a/jdk/test/com/sun/jdi/LocalVariableEqual.java
+++ b/jdk/test/com/sun/jdi/LocalVariableEqual.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4916263
- *  @summary Test
+ * @test
+ * @bug 4916263
+ * @summary Test
+ * @author Serguei Spitsyn
  *
- *  @author Serguei Spitsyn
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g LocalVariableEqual.java
- *  @run driver LocalVariableEqual
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g LocalVariableEqual.java
+ * @run driver LocalVariableEqual
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/LocationTest.java b/jdk/test/com/sun/jdi/LocationTest.java
index 52a34e2..64b91a6 100644
--- a/jdk/test/com/sun/jdi/LocationTest.java
+++ b/jdk/test/com/sun/jdi/LocationTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4419453
- *  @summary Test that Method.location() returns the right values
+ * @test
+ * @bug 4419453
+ * @summary Test that Method.location() returns the right values
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g LocationTest.java
- *  @run driver LocationTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g LocationTest.java
+ * @run driver LocationTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MethodEntryExitEvents.java b/jdk/test/com/sun/jdi/MethodEntryExitEvents.java
index 174505f..5901546 100644
--- a/jdk/test/com/sun/jdi/MethodEntryExitEvents.java
+++ b/jdk/test/com/sun/jdi/MethodEntryExitEvents.java
@@ -22,17 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4409241 4432820
- *  @summary Test the bug fix for: MethodExitEvents disappear when Object-Methods are called from main
- *  @author Tim Bell
+ * @test
+ * @bug 4409241 4432820
+ * @summary Test the bug fix for: MethodExitEvents disappear when Object-Methods are called from main
+ * @author Tim Bell
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g MethodEntryExitEvents.java
- *  @run driver MethodEntryExitEvents SUSPEND_EVENT_THREAD MethodEntryExitEventsDebugee
- *  @run driver MethodEntryExitEvents SUSPEND_NONE MethodEntryExitEventsDebugee
- *  @run driver MethodEntryExitEvents SUSPEND_ALL MethodEntryExitEventsDebugee
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MethodEntryExitEvents.java
+ * @run driver MethodEntryExitEvents SUSPEND_EVENT_THREAD MethodEntryExitEventsDebugee
+ * @run driver MethodEntryExitEvents SUSPEND_NONE MethodEntryExitEventsDebugee
+ * @run driver MethodEntryExitEvents SUSPEND_ALL MethodEntryExitEventsDebugee
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java b/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java
index d9131b0..9f55258 100644
--- a/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java
+++ b/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java
@@ -22,15 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4195445 6204179
- *  @summary JDWP, JDI: Add return value to Method Exit Event
- *  @author Jim Holmlund
+ * @test
+ * @bug 4195445 6204179
+ * @summary JDWP, JDI: Add return value to Method Exit Event
+ * @author Jim Holmlund
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g MethodExitReturnValuesTest.java
- *  @run driver MethodExitReturnValuesTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MethodExitReturnValuesTest.java
+ * @run driver MethodExitReturnValuesTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MixedSuspendTest.sh b/jdk/test/com/sun/jdi/MixedSuspendTest.sh
index e18b20b..00f5f5d 100644
--- a/jdk/test/com/sun/jdi/MixedSuspendTest.sh
+++ b/jdk/test/com/sun/jdi/MixedSuspendTest.sh
@@ -23,16 +23,14 @@
 # questions.
 #
 
-#  @test
-#  @bug 6224859
-#  @summary JDWP: Mixing application suspends and debugger suspends can cause hangs
-# 
-#  @author Jim Holmlund
-# 
-#  @key intermittent
-#  @modules jdk.jdi
-#  @run build TestScaffold VMConnection TargetListener TargetAdapter
-#  @run shell MixedSuspendTest.sh
+# @test
+# @bug 6224859
+# @key intermittent
+# @summary JDWP: Mixing application suspends and debugger suspends can cause hangs
+# @author Jim Holmlund
+#
+# @run build TestScaffold VMConnection TargetListener TargetAdapter
+# @run shell MixedSuspendTest.sh
 
 classname=MixedSuspendTarg
 
@@ -84,7 +82,7 @@
                 int i = 0;
             }
         }
-            
+
         System.out.println("Debuggee: end of thread");
     }
 
@@ -113,7 +111,7 @@
 
     for ii in . $TESTSRC $TESTSRC/.. ; do
         if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh 
+            . $ii/ShellScaffold.sh
             break
         fi
     done
diff --git a/jdk/test/com/sun/jdi/ModificationWatchpoints.java b/jdk/test/com/sun/jdi/ModificationWatchpoints.java
index 482f8b7..48f259e 100644
--- a/jdk/test/com/sun/jdi/ModificationWatchpoints.java
+++ b/jdk/test/com/sun/jdi/ModificationWatchpoints.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4409582
- *  @summary Test all info returned by modification watchpoints
+ * @test
+ * @bug 4409582
+ * @summary Test all info returned by modification watchpoints
+ * @author Daniel Prusa (or someone in the FFJ group)
+ * @author Robert Field (modified to JDIScaffold)
  *
- *  @author Daniel Prusa (or someone in the FFJ group)
- *  @author Robert Field (modified to JDIScaffold)
- *
- *  @modules jdk.jdi
- *  @run build JDIScaffold VMConnection
- *  @run compile -g ModificationWatchpoints.java
- *  @run driver ModificationWatchpoints
+ * @run build JDIScaffold VMConnection
+ * @run compile -g ModificationWatchpoints.java
+ * @run driver ModificationWatchpoints
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ModulesTest.java b/jdk/test/com/sun/jdi/ModulesTest.java
index 359293f..e3495af 100644
--- a/jdk/test/com/sun/jdi/ModulesTest.java
+++ b/jdk/test/com/sun/jdi/ModulesTest.java
@@ -22,14 +22,13 @@
  */
 
 /**
- *  @test
- *  @bug 8049365
- *  @summary Tests the JDI and JDWP update for modules
+ * @test
+ * @bug 8049365
+ * @summary Tests the JDI and JDWP update for modules
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g ModulesTest.java
- *  @run driver ModulesTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ModulesTest.java
+ * @run driver ModulesTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MonitorEventTest.java b/jdk/test/com/sun/jdi/MonitorEventTest.java
index 8f33071..d8e10b2 100644
--- a/jdk/test/com/sun/jdi/MonitorEventTest.java
+++ b/jdk/test/com/sun/jdi/MonitorEventTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4401399
- *  @summary Simple basic test of jdi Monitor request and event.
+ * @test
+ * @bug 4401399
+ * @summary Simple basic test of jdi Monitor request and event.
+ * @author Swamy Venkataramanappa
  *
- *  @author Swamy Venkataramanappa
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g MonitorEventTest.java
- *  @run driver MonitorEventTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MonitorEventTest.java
+ * @run driver MonitorEventTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MonitorFrameInfo.java b/jdk/test/com/sun/jdi/MonitorFrameInfo.java
index 4201706..796039c 100644
--- a/jdk/test/com/sun/jdi/MonitorFrameInfo.java
+++ b/jdk/test/com/sun/jdi/MonitorFrameInfo.java
@@ -22,17 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 6230699
- *  @summary Test ThreadReference.ownedMonitorsAndFrames()
- *  @bug 6701700
- *  @summary MonitorInfo objects aren't invalidated when the owning thread is resumed
- *  @author Swamy Venkataramanappa
+ * @test
+ * @bug 6230699
+ * @summary Test ThreadReference.ownedMonitorsAndFrames()
+ * @bug 6701700
+ * @summary MonitorInfo objects aren't invalidated when the owning thread is resumed
+ * @author Swamy Venkataramanappa
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g MonitorFrameInfo.java
- *  @run driver MonitorFrameInfo
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MonitorFrameInfo.java
+ * @run driver MonitorFrameInfo
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MultiBreakpointsTest.java b/jdk/test/com/sun/jdi/MultiBreakpointsTest.java
index eda894e..0d007cd 100644
--- a/jdk/test/com/sun/jdi/MultiBreakpointsTest.java
+++ b/jdk/test/com/sun/jdi/MultiBreakpointsTest.java
@@ -23,16 +23,14 @@
 
 
 /**
- *  @test
- *  @bug 4359247
- *  @summary Breakpoints on multiple threads have problems.
+ * @test
+ * @bug 4359247
+ * @summary Breakpoints on multiple threads have problems.
+ * @author tbell, jjh
  *
- *  @author tbell, jjh
- *
- *  @modules jdk.jdi
- *  @build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g MultiBreakpointsTest.java
- *  @run driver MultiBreakpointsTest
+ * @build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MultiBreakpointsTest.java
+ * @run driver MultiBreakpointsTest
  */
 
 /*
diff --git a/jdk/test/com/sun/jdi/NativeInstanceFilter.java b/jdk/test/com/sun/jdi/NativeInstanceFilter.java
index c149608..04cb2ac 100644
--- a/jdk/test/com/sun/jdi/NativeInstanceFilter.java
+++ b/jdk/test/com/sun/jdi/NativeInstanceFilter.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 6426034
- *  @summary Instance filter doesn't filter event if it occurs in native method
+ * @test
+ * @bug 6426034
+ * @summary Instance filter doesn't filter event if it occurs in native method
+ * @author Keith McGuigan
  *
- *  @author Keith McGuigan
- *
- *  @modules jdk.jdi
- *  @run build JDIScaffold VMConnection
- *  @compile -XDignore.symbol.file NativeInstanceFilterTarg.java
- *  @run driver NativeInstanceFilter
+ * @run build JDIScaffold VMConnection
+ * @compile -XDignore.symbol.file NativeInstanceFilterTarg.java
+ * @run driver NativeInstanceFilter
  */
 
 /*
diff --git a/jdk/test/com/sun/jdi/NewInstanceTest.java b/jdk/test/com/sun/jdi/NewInstanceTest.java
index 3950462..42069f1 100644
--- a/jdk/test/com/sun/jdi/NewInstanceTest.java
+++ b/jdk/test/com/sun/jdi/NewInstanceTest.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4419450
- *  @summary Test newInstance() for arrays - currently covers
- *  only reference type arrays (see bug #4450091).
+ * @test
+ * @bug 4419450
+ * @summary Test newInstance() for arrays - currently covers
+ * only reference type arrays (see bug #4450091).
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g NewInstanceTest.java
- *  @run driver NewInstanceTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g NewInstanceTest.java
+ * @run driver NewInstanceTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java
index fdaa4ad..2927dd3 100644
--- a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java
+++ b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java
@@ -30,8 +30,9 @@
  * @bug        4554734 4724714
  * @summary    Test for -Xrunjdwp:[onthrow,onuncaught] suboptions require launch suboption
  * @author     Tim Bell
+ *
  * @library /lib/testlibrary
- * @modules jdk.jdi
+ *
  * @run compile -g NoLaunchOptionTest.java
  * @build jdk.testlibrary.* VMConnection
  * @run driver NoLaunchOptionTest
diff --git a/jdk/test/com/sun/jdi/NoLocInfoTest.java b/jdk/test/com/sun/jdi/NoLocInfoTest.java
index 71263c2..4bb75bb 100644
--- a/jdk/test/com/sun/jdi/NoLocInfoTest.java
+++ b/jdk/test/com/sun/jdi/NoLocInfoTest.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4642611
- *  @summary Test that method.allLineLocations() should
- *           throw AbsentInformationException exception
+ * @test
+ * @bug 4642611
+ * @summary Test that method.allLineLocations() should
+ *          throw AbsentInformationException exception
+ * @author Serguei Spitsyn
  *
- *  @author Serguei Spitsyn
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g:none NoLocInfoTest.java
- *  @run driver NoLocInfoTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g:none NoLocInfoTest.java
+ * @run driver NoLocInfoTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java b/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java
index 2afad21..66f576f 100644
--- a/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java
+++ b/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java
@@ -22,13 +22,12 @@
  */
 
 /**
- *  @test
- *  @bug 7105883
- *  @summary Ensure that JDWP doesn't crash with a null thread group name
+ * @test
+ * @bug 7105883
+ * @summary Ensure that JDWP doesn't crash with a null thread group name
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run driver NullThreadGroupNameTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run driver NullThreadGroupNameTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.connect.*;
diff --git a/jdk/test/com/sun/jdi/OnThrowTest.java b/jdk/test/com/sun/jdi/OnThrowTest.java
index ce97256..a629705 100644
--- a/jdk/test/com/sun/jdi/OnThrowTest.java
+++ b/jdk/test/com/sun/jdi/OnThrowTest.java
@@ -22,16 +22,15 @@
  */
 
 /*
- *   @test       OnThrowTest.java
- *   @bug        6263814
- *   @summary    Test for -agentlib::[onthrow,launch]
- *   @author     Kelly O'Hair
+ * @test       OnThrowTest.java
+ * @bug        6263814
+ * @summary    Test for -agentlib::[onthrow,launch]
+ * @author     Kelly O'Hair
  *
- *  @modules jdk.jdi
- *  @run compile -g OnThrowTest.java
- *  @run compile -g OnThrowTarget.java
- *  @run compile -g VMConnection.java
- *  @run driver OnThrowTest
+ * @run compile -g OnThrowTest.java
+ * @run compile -g OnThrowTarget.java
+ * @run compile -g VMConnection.java
+ * @run driver OnThrowTest
  */
 
 import java.io.File;
diff --git a/jdk/test/com/sun/jdi/OptionTest.java b/jdk/test/com/sun/jdi/OptionTest.java
index 967146c..9d7dbb2 100644
--- a/jdk/test/com/sun/jdi/OptionTest.java
+++ b/jdk/test/com/sun/jdi/OptionTest.java
@@ -22,16 +22,15 @@
  */
 
 /*
- *   @test       OptionTest
- *   @bug        5095072
- *   @summary    Test for misc jdwp options, just that the option is parsed
- *   @author     Kelly O'Hair (copied from Tim Bell's NoLaunchOptionTest)
+ * @test       OptionTest
+ * @bug        5095072
+ * @summary    Test for misc jdwp options, just that the option is parsed
+ * @author     Kelly O'Hair (copied from Tim Bell's NoLaunchOptionTest)
  *
- *  @modules jdk.jdi
- *  @run compile -g OptionTest.java
- *  @run compile -g HelloWorld.java
- *  @run compile -g VMConnection.java
- *  @run driver OptionTest
+ * @run compile -g OptionTest.java
+ * @run compile -g HelloWorld.java
+ * @run compile -g VMConnection.java
+ * @run driver OptionTest
  */
 
 import java.net.ServerSocket;
diff --git a/jdk/test/com/sun/jdi/PopAndInvokeTest.java b/jdk/test/com/sun/jdi/PopAndInvokeTest.java
index 65cd5a5..7f265f9 100644
--- a/jdk/test/com/sun/jdi/PopAndInvokeTest.java
+++ b/jdk/test/com/sun/jdi/PopAndInvokeTest.java
@@ -22,17 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 6517249
- *  @modules jdk.jdi
- *  @ignore 6951287
- *  @summary JDWP: Cannot do an invokeMethod after a popFrames operation
+ * @test
+ * @bug 6517249
+ * @summary JDWP: Cannot do an invokeMethod after a popFrames operation
+ * @author jjh
  *
- *  @author jjh
+ * @ignore 6951287
  *
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g PopAndInvokeTest.java
- *  @run driver PopAndInvokeTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g PopAndInvokeTest.java
+ * @run driver PopAndInvokeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/PopAndStepTest.java b/jdk/test/com/sun/jdi/PopAndStepTest.java
index a0150fa..598a78b 100644
--- a/jdk/test/com/sun/jdi/PopAndStepTest.java
+++ b/jdk/test/com/sun/jdi/PopAndStepTest.java
@@ -1,17 +1,39 @@
-/* /nodynamiccopyright/ */  // DO NOT DELETE ANY LINES!!!!
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
 //    THIS TEST IS LINE NUMBER SENSITIVE
+
 /**
- *  @test
- *  @bug 4530424
- *  @summary Hin says that doing a step over after a popframe acts like a resume.
+ * @test
+ * @bug 4530424
+ * @summary Hin says that doing a step over after a popframe acts like a resume.
+ * @author jjh
  *
- *  @author jjh
+ * @library ..
  *
- *  @library ..
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g PopAndStepTest.java
- *  @run driver PopAndStepTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g PopAndStepTest.java
+ * @run driver PopAndStepTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
@@ -19,25 +41,23 @@
 
 import java.util.*;
 
-    /********** LINE NUMBER SENSITIVE! *****************************************************************/
-
 class PopAndStepTarg {
     public void B() {
-        System.out.println("debuggee: in B");
-        System.out.println("debuggee: in B, back to A");   // add line breakpoint here line 27 !!!
+        System.out.println("debuggee: in B");             // B_LINE_1
+        System.out.println("debuggee: in B, back to A");  // B_LINE_2
     }
 
     public void A() {
-        System.out.println("debuggee: in A, about to call B");  // line 31
-        B();
-        System.out.println("debuggee: in A, back from B");      // line 33
-        throw new RuntimeException("debuggee: Got to line 34");
+        System.out.println("debuggee: in A, about to call B");  // A_LINE_1
+        B();                                                    // A_LINE_2
+        System.out.println("debuggee: in A, back from B");      // A_LINE_3
+        throw new RuntimeException("debuggee: Got to line A_LINE_4:" + PopAndStepTest.A_LINE_4); // A_LINE_4
     }
 
     public static void main(String[] args) {
-        System.out.println("debuggee: Howdy!");      // line 38
-        PopAndStepTarg xxx = new PopAndStepTarg();   // line 40
-        xxx.A();                                     // line 41
+        System.out.println("debuggee: Howdy!");      // MAIN_LINE_1
+        PopAndStepTarg xxx = new PopAndStepTarg();   // MAIN_LINE_2
+        xxx.A();                                     // MAIN_LINE_3
         System.out.println("debugee: Goodbye from PopAndStepTarg!");
     }
 }
@@ -46,6 +66,18 @@
     /********** test program **********/
 
 public class PopAndStepTest extends TestScaffold {
+    static final int B_LINE_1 = 46;
+    static final int B_LINE_2 = B_LINE_1 + 1;
+
+    static final int A_LINE_1 = 51;
+    static final int A_LINE_2 = A_LINE_1 + 1;
+    static final int A_LINE_3 = A_LINE_1 + 2;
+    static final int A_LINE_4 = A_LINE_1 + 3;
+
+    static final int MAIN_LINE_1 = 58;
+    static final int MAIN_LINE_2 = MAIN_LINE_1 + 1;
+    static final int MAIN_LINE_3 = MAIN_LINE_1 + 2;
+
     ReferenceType targetClass;
     ThreadReference mainThread;
 
@@ -116,10 +148,10 @@
         BreakpointEvent bpe = startToMain("PopAndStepTarg");
         targetClass = bpe.location().declaringType();
         mainThread = bpe.thread();
-        getDebuggeeLineNum(38);
+        getDebuggeeLineNum(MAIN_LINE_1);
 
-        println("Resuming to line 27");
-        bpe = resumeTo("PopAndStepTarg", 27); getDebuggeeLineNum(27);
+        println("Resuming to line B_LINE_2 : " + B_LINE_2);
+        bpe = resumeTo("PopAndStepTarg", B_LINE_2); getDebuggeeLineNum(B_LINE_2);
 
         // The failure is this:
         //   create step request
@@ -141,21 +173,21 @@
         srInto.enable(); // This fails
         mainThread.popFrames(frameFor("A"));
         //srInto.enable();   // if the enable is moved here, it passes
-        println("Popped back to line 41 in main, the call to A()");
-        println("Stepping into line 31");
-        waitForRequestedEvent(srInto);   // println
+        println("Popped back to line MAIN_LINE_3(" + MAIN_LINE_3 + ") in main, the call to A()");
+        println("Stepping into line A_LINE_1:" + A_LINE_1);
+        waitForRequestedEvent(srInto);  // println
         srInto.disable();
 
-        getDebuggeeLineNum(31);
+        getDebuggeeLineNum(A_LINE_1);
 
         // The failure occurs here.
-        println("Stepping over to line 32");
-        stepOverLine(mainThread);   // println
-        getDebuggeeLineNum(32);
+        println("Stepping over to line A_LINE_2:" + A_LINE_2);
+        stepOverLine(mainThread);       // println
+        getDebuggeeLineNum(A_LINE_2);
 
-        println("Stepping over to line 33");
-        stepOverLine(mainThread);        // call to B()
-        getDebuggeeLineNum(33);
+        println("Stepping over to line A_LINE_3:" + A_LINE_3);
+        stepOverLine(mainThread);       // call to B()
+        getDebuggeeLineNum(A_LINE_3);
 
         vm().exit(0);
 
diff --git a/jdk/test/com/sun/jdi/PopAsynchronousTest.java b/jdk/test/com/sun/jdi/PopAsynchronousTest.java
index 2adf47e..203b547 100644
--- a/jdk/test/com/sun/jdi/PopAsynchronousTest.java
+++ b/jdk/test/com/sun/jdi/PopAsynchronousTest.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4467564
- *  @summary Test the popping of frames in an asynchronous context
- *           (that is, when suspended by the debugger at random points)
+ * @test
+ * @bug 4467564
+ * @summary Test the popping of frames in an asynchronous context
+ *          (that is, when suspended by the debugger at random points)
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g PopAsynchronousTest.java
- *  @run driver PopAsynchronousTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g PopAsynchronousTest.java
+ * @run driver PopAsynchronousTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/PopSynchronousTest.java b/jdk/test/com/sun/jdi/PopSynchronousTest.java
index 674e17e..29809bf 100644
--- a/jdk/test/com/sun/jdi/PopSynchronousTest.java
+++ b/jdk/test/com/sun/jdi/PopSynchronousTest.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4467564
- *  @summary Test the popping of frames in synchronous context
- *           (that is, when stopped at an event)
+ * @test
+ * @bug 4467564
+ * @summary Test the popping of frames in synchronous context
+ *          (that is, when stopped at an event)
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g PopSynchronousTest.java
- *  @run driver PopSynchronousTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g PopSynchronousTest.java
+ * @run driver PopSynchronousTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ProcessAttachTest.java b/jdk/test/com/sun/jdi/ProcessAttachTest.java
index 6ee43f5..29a0890 100644
--- a/jdk/test/com/sun/jdi/ProcessAttachTest.java
+++ b/jdk/test/com/sun/jdi/ProcessAttachTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,11 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.List;
 import java.util.Map;
 
 import jdk.testlibrary.ProcessTools;
 
 import com.sun.jdi.Bootstrap;
-import com.sun.jdi.ThreadReference;
 import com.sun.jdi.VirtualMachine;
 import com.sun.jdi.connect.AttachingConnector;
 import com.sun.jdi.connect.Connector;
@@ -86,7 +84,7 @@
             is.read();
 
             // Attach a debugger
-            tryDebug(p.getPid());
+            tryDebug(p.pid());
         } finally {
             p.destroyForcibly();
         }
diff --git a/jdk/test/com/sun/jdi/RedefineCrossEvent.java b/jdk/test/com/sun/jdi/RedefineCrossEvent.java
index 69f24b3..c61dd3c 100644
--- a/jdk/test/com/sun/jdi/RedefineCrossEvent.java
+++ b/jdk/test/com/sun/jdi/RedefineCrossEvent.java
@@ -22,52 +22,52 @@
  */
 
 /**
- *  @test
- *  @bug 4628726
- *  @summary Test class redefinition at each event cross tested with other tests
+ * @test
+ * @bug 4628726
+ * @summary Test class redefinition at each event cross tested with other tests
+ * @author Robert Field
  *
- *  @author Robert Field
+ * @modules java.corba
+ *          jdk.jdi
  *
- *  @modules java.corba
- *           jdk.jdi
- *  @run build TestScaffold VMConnection TargetAdapter TargetListener
- *  @run compile -g AccessSpecifierTest.java
- *  @run compile -g AfterThreadDeathTest.java
- *  @run compile -g ArrayRangeTest.java
- *  @run compile -g BacktraceFieldTest.java
- *  @run compile -g ClassesByName2Test.java
- *  @run compile -g DebuggerThreadTest.java
- *  @run compile -g DeleteEventRequestsTest.java
- *  @run compile -g ExceptionEvents.java
- *  @run compile -g ExpiredRequestDeletionTest.java
- *  @run compile -g FieldWatchpoints.java
- *  @run build InstanceFilter
- *  @run compile -g LocationTest.java
- *  @run compile -g NewInstanceTest.java
- *  @run compile -g PopSynchronousTest.java
- *  @run compile -g RepStepTarg.java
- *  @run compile -g RequestReflectionTest.java
+ * @run build TestScaffold VMConnection TargetAdapter TargetListener
+ * @run compile -g AccessSpecifierTest.java
+ * @run compile -g AfterThreadDeathTest.java
+ * @run compile -g ArrayRangeTest.java
+ * @run compile -g BacktraceFieldTest.java
+ * @run compile -g ClassesByName2Test.java
+ * @run compile -g DebuggerThreadTest.java
+ * @run compile -g DeleteEventRequestsTest.java
+ * @run compile -g ExceptionEvents.java
+ * @run compile -g ExpiredRequestDeletionTest.java
+ * @run compile -g FieldWatchpoints.java
+ * @run build InstanceFilter
+ * @run compile -g LocationTest.java
+ * @run compile -g NewInstanceTest.java
+ * @run compile -g PopSynchronousTest.java
+ * @run compile -g RepStepTarg.java
+ * @run compile -g RequestReflectionTest.java
  *
- *  @run driver AccessSpecifierTest -redefstart -redefevent
- *  @run driver AfterThreadDeathTest -redefstart -redefevent
- *  @run driver ArrayRangeTest -redefstart -redefevent
- *  @run driver BacktraceFieldTest -redefstart -redefevent
- *  @run driver ClassesByName2Test -redefstart -redefevent
- *  @run driver DebuggerThreadTest -redefstart -redefevent
- *  @run driver DeleteEventRequestsTest -redefstart -redefevent
- *  @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.Exception
- *  @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg null
- *  @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg java.lang.StackOverflowError
- *  @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.NullPointerException
- *  @run driver ExceptionEvents -redefstart -redefevent C T StackOverflowCaughtTarg java.lang.Error
- *  @run driver ExceptionEvents -redefstart -redefevent N T StackOverflowCaughtTarg java.lang.NullPointerException
- *  @run driver ExceptionEvents -redefstart -redefevent N N StackOverflowCaughtTarg java.lang.Exception
- *  @run driver ExceptionEvents -redefstart -redefevent C N StackOverflowCaughtTarg java.lang.Error
- *  @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowUncaughtTarg java.lang.Exception
- *  @run driver ExpiredRequestDeletionTest -redefstart -redefevent
- *  @run driver FieldWatchpoints -redefstart -redefevent
- *  @run driver InstanceFilter -redefstart -redefevent
- *  @run driver LocationTest -redefstart -redefevent
- *  @run driver NewInstanceTest -redefstart -redefevent
- *  @run driver RequestReflectionTest -redefstart -redefevent
+ * @run driver AccessSpecifierTest -redefstart -redefevent
+ * @run driver AfterThreadDeathTest -redefstart -redefevent
+ * @run driver ArrayRangeTest -redefstart -redefevent
+ * @run driver BacktraceFieldTest -redefstart -redefevent
+ * @run driver ClassesByName2Test -redefstart -redefevent
+ * @run driver DebuggerThreadTest -redefstart -redefevent
+ * @run driver DeleteEventRequestsTest -redefstart -redefevent
+ * @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg null
+ * @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents -redefstart -redefevent C T StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents -redefstart -redefevent N T StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents -redefstart -redefevent N N StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents -redefstart -redefevent C N StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowUncaughtTarg java.lang.Exception
+ * @run driver ExpiredRequestDeletionTest -redefstart -redefevent
+ * @run driver FieldWatchpoints -redefstart -redefevent
+ * @run driver InstanceFilter -redefstart -redefevent
+ * @run driver LocationTest -redefstart -redefevent
+ * @run driver NewInstanceTest -redefstart -redefevent
+ * @run driver RequestReflectionTest -redefstart -redefevent
  */
diff --git a/jdk/test/com/sun/jdi/RedefineCrossStart.java b/jdk/test/com/sun/jdi/RedefineCrossStart.java
index 51869c6..5bacec1 100644
--- a/jdk/test/com/sun/jdi/RedefineCrossStart.java
+++ b/jdk/test/com/sun/jdi/RedefineCrossStart.java
@@ -22,29 +22,28 @@
  */
 
 /**
- *  @test
- *  @bug 4628726
- *  @summary Test class redefinition at start only (they use breakpoint
- *  or resumeTo()) cross tested with other tests.
- *  ExceptionEvents/StackOverflowUncaughtTarg are here because they hit
- *  an unrelated crash in event testing.
+ * @test
+ * @bug 4628726
+ * @summary Test class redefinition at start only (they use breakpoint
+ * or resumeTo()) cross tested with other tests.
+ * ExceptionEvents/StackOverflowUncaughtTarg are here because they hit
+ * an unrelated crash in event testing.
  *
- *  @author Robert Field
+ * @author Robert Field
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g CountEvent.java
- *  @run compile -g CountFilterTest.java
- *  @run compile -g FramesTest.java
- *  @run compile -g InvokeTest.java
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g CountEvent.java
+ * @run compile -g CountFilterTest.java
+ * @run compile -g FramesTest.java
+ * @run compile -g InvokeTest.java
  *
- *  @run driver CountEvent -redefstart
- *  @run driver CountFilterTest -redefstart
- *  @run driver FramesTest -redefstart
- *  @run driver InvokeTest -redefstart
+ * @run driver CountEvent -redefstart
+ * @run driver CountFilterTest -redefstart
+ * @run driver FramesTest -redefstart
+ * @run driver InvokeTest -redefstart
  *
- *  @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg null
- *  @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.Error
- *  @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.StackOverflowError
- *  @run driver PopSynchronousTest -redefstart
+ * @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg null
+ * @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.Error
+ * @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.StackOverflowError
+ * @run driver PopSynchronousTest -redefstart
  */
diff --git a/jdk/test/com/sun/jdi/ReferrersTest.java b/jdk/test/com/sun/jdi/ReferrersTest.java
index 3293b08..3852920 100644
--- a/jdk/test/com/sun/jdi/ReferrersTest.java
+++ b/jdk/test/com/sun/jdi/ReferrersTest.java
@@ -22,15 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 5089849
- *  @summary Add support for backtracking reference graph.
- *  @author jjh
+ * @test
+ * @bug 5089849
+ * @summary Add support for backtracking reference graph.
+ * @author jjh
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g ReferrersTest.java
- *  @run driver ReferrersTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ReferrersTest.java
+ * @run driver ReferrersTest
  */
 
 /*
diff --git a/jdk/test/com/sun/jdi/RepStep.java b/jdk/test/com/sun/jdi/RepStep.java
index fce9c2b..252cf4d 100644
--- a/jdk/test/com/sun/jdi/RepStep.java
+++ b/jdk/test/com/sun/jdi/RepStep.java
@@ -22,18 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4334008
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run compile -g RepStepTarg.java
- *  @run build VMConnection RepStep
- *
- *  @run driver RepStep
- *
+ * @test
+ * @bug 4334008
  * @summary RepStep detects missed step events due to lack of
  * frame pop events (in back-end).
+ * @author Robert Field
+ *
+ * @run compile -g RepStepTarg.java
+ * @run build VMConnection RepStep
+ *
+ * @run driver RepStep
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/RequestReflectionTest.java b/jdk/test/com/sun/jdi/RequestReflectionTest.java
index 41e3e4f..7983b87 100644
--- a/jdk/test/com/sun/jdi/RequestReflectionTest.java
+++ b/jdk/test/com/sun/jdi/RequestReflectionTest.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4425840
- *  @author Robert Field
+ * @test
+ * @bug 4425840
+ * @summary RequestReflectionTest checks to see that reflective
+ * accessors on EventRequests return what they are given.
+ * @author Robert Field
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g RequestReflectionTest.java
- *  @run driver RequestReflectionTest
- *
- *  @summary RequestReflectionTest checks to see that reflective
- *  accessors on EventRequests return what they are given.
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g RequestReflectionTest.java
+ * @run driver RequestReflectionTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ResumeOneThreadTest.java b/jdk/test/com/sun/jdi/ResumeOneThreadTest.java
index 39bc76a..68a43c6 100644
--- a/jdk/test/com/sun/jdi/ResumeOneThreadTest.java
+++ b/jdk/test/com/sun/jdi/ResumeOneThreadTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 6700889
- *  @summary  Thread resume invalidates all stack frames, even from other threads
+ * @test
+ * @bug 6700889
+ * @summary  Thread resume invalidates all stack frames, even from other threads
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g ResumeOneThreadTest.java
- *  @run driver ResumeOneThreadTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ResumeOneThreadTest.java
+ * @run driver ResumeOneThreadTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/SDENullTest.java b/jdk/test/com/sun/jdi/SDENullTest.java
index 32c08b74..d5e4c9d 100644
--- a/jdk/test/com/sun/jdi/SDENullTest.java
+++ b/jdk/test/com/sun/jdi/SDENullTest.java
@@ -22,16 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4621289
- *  @summary vm.setDefaultStratum(null) causes a Null Ptr exception
+ * @test
+ * @bug 4621289
+ * @summary vm.setDefaultStratum(null) causes a Null Ptr exception
  *
- *  @author jjh
+ * @author jjh
  *
- *  @modules jdk.jdi
- *  @run build  TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g SDENullTest.java
- *  @run driver SDENullTest
+ * @run build  TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g SDENullTest.java
+ * @run driver SDENullTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/SimulResumerTest.java b/jdk/test/com/sun/jdi/SimulResumerTest.java
index 7d9fae6..e27fa35 100644
--- a/jdk/test/com/sun/jdi/SimulResumerTest.java
+++ b/jdk/test/com/sun/jdi/SimulResumerTest.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 6751643
- *  @summary  ThreadReference.ownedMonitors() can return null
+ * @test
+ * @bug 6751643
+ * @key intermittent
+ * @summary ThreadReference.ownedMonitors() can return null
+ * @author jjh
  *
- *  @author jjh
- *
- *  @key intermittent
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g SimulResumerTest.java
- *  @run driver SimulResumerTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g SimulResumerTest.java
+ * @run driver SimulResumerTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/SourceNameFilterTest.java b/jdk/test/com/sun/jdi/SourceNameFilterTest.java
index ae3a0a2..ec5d097 100644
--- a/jdk/test/com/sun/jdi/SourceNameFilterTest.java
+++ b/jdk/test/com/sun/jdi/SourceNameFilterTest.java
@@ -22,18 +22,16 @@
  */
 
 /**
- *  @test
- *  @bug 4836939 6646613
- *  @summary JDI add addSourceNameFilter to ClassPrepareRequest
+ * @test
+ * @bug 4836939 6646613
+ * @summary JDI add addSourceNameFilter to ClassPrepareRequest
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g SourceNameFilterTest.java
- *  @run driver SourceNameFilterTest
- *  @run compile -g:none SourceNameFilterTest.java
- *  @run driver SourceNameFilterTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g SourceNameFilterTest.java
+ * @run driver SourceNameFilterTest
+ * @run compile -g:none SourceNameFilterTest.java
+ * @run driver SourceNameFilterTest
  */
 // The compile -g:none suppresses the lineNumber table to trigger bug 6646613.
 
diff --git a/jdk/test/com/sun/jdi/StepTest.java b/jdk/test/com/sun/jdi/StepTest.java
index 4e829e9..8d07334 100644
--- a/jdk/test/com/sun/jdi/StepTest.java
+++ b/jdk/test/com/sun/jdi/StepTest.java
@@ -22,16 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4270488 4787861
- *  @author Gordon Hirsch
+ * @test
+ * @bug 4270488 4787861
+ * @author Gordon Hirsch
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetAdapter TargetListener
- *  @run compile -g MethodCalls.java
- *  @run compile -g MethodCallsReflection.java
- *  @run compile -g ControlFlow.java
- *  @run build StepTest
+ * @run build TestScaffold VMConnection TargetAdapter TargetListener
+ * @run compile -g MethodCalls.java
+ * @run compile -g MethodCallsReflection.java
+ * @run compile -g ControlFlow.java
+ * @run build StepTest
  *
  * @summary StepTest starts at a method named "go()" in the debuggee and
  * repetitively steps. It will do a step into until the maximum
@@ -46,21 +45,21 @@
  * for the debuggee files- MethodCalls.java, ...
  * See LineNumberInfo.java for more info.
  *
- *                     +--- maximum stack depth in debuggee
- *                     |  +--- step granularity: "line" or "min"
- *                     |  |    +---Expected number of steps
- *                     |  |    |  +--- Debuggee command Line
- *                     V  V    V  V      Workaround-----+
- *                                                      V
- *  @run driver StepTest 2 line  2 MethodCalls
- *  @run driver StepTest 3 line 14 MethodCalls
+ *                      +--- maximum stack depth in debuggee
+ *                      |  +--- step granularity: "line" or "min"
+ *                      |  |    +---Expected number of steps
+ *                      |  |    |  +--- Debuggee command Line
+ *                      V  V    V  V      Workaround-----+
+ *                                                       V
+ * @run driver StepTest 2 line  2 MethodCalls
+ * @run driver StepTest 3 line 14 MethodCalls
  *
- *  @run driver StepTest 2 line 18 MethodCallsReflection  12
+ * @run driver StepTest 2 line 18 MethodCallsReflection  12
  *
- *  @run driver StepTest 2 min   4 MethodCalls
- *  @run driver StepTest 3 min  43 MethodCalls
+ * @run driver StepTest 2 min   4 MethodCalls
+ * @run driver StepTest 3 min  43 MethodCalls
  *
- *  @run driver StepTest 2 line 65 ControlFlow            64
+ * @run driver StepTest 2 line 65 ControlFlow            64
  */
 
 /*
diff --git a/jdk/test/com/sun/jdi/SuspendThreadTest.java b/jdk/test/com/sun/jdi/SuspendThreadTest.java
index 49b4888..5e38672 100644
--- a/jdk/test/com/sun/jdi/SuspendThreadTest.java
+++ b/jdk/test/com/sun/jdi/SuspendThreadTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 6485605
- *  @summary com.sun.jdi.InternalException: Inconsistent suspend policy in internal event handler
+ * @test
+ * @bug 6485605
+ * @summary com.sun.jdi.InternalException: Inconsistent suspend policy in internal event handler
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g SuspendThreadTest.java
- *  @run driver SuspendThreadTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g SuspendThreadTest.java
+ * @run driver SuspendThreadTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/TEST.properties b/jdk/test/com/sun/jdi/TEST.properties
new file mode 100644
index 0000000..8db30fa
--- /dev/null
+++ b/jdk/test/com/sun/jdi/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jdi
+
diff --git a/jdk/test/com/sun/jdi/TemplateTest.java b/jdk/test/com/sun/jdi/TemplateTest.java
index cff19ab..4f5425a 100644
--- a/jdk/test/com/sun/jdi/TemplateTest.java
+++ b/jdk/test/com/sun/jdi/TemplateTest.java
@@ -25,16 +25,14 @@
 // TEMPLATE: change bug number and fill out <SUMMARY> and <AUTHOR>
 // TEMPLATE: delete TEMPLATE lines
 /**
- *  @test
- *  @bug 0000000
- *  @summary <SUMMARY>
+ * @test
+ * @bug 0000000
+ * @summary <SUMMARY>
+ * @author <AUTHOR>
  *
- *  @author <AUTHOR>
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g TemplateTest.java
- *  @run driver TemplateTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g TemplateTest.java
+ * @run driver TemplateTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ThreadGroupTest.java b/jdk/test/com/sun/jdi/ThreadGroupTest.java
index cdd0f36..bcd6ea3 100644
--- a/jdk/test/com/sun/jdi/ThreadGroupTest.java
+++ b/jdk/test/com/sun/jdi/ThreadGroupTest.java
@@ -22,16 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4893530
- *  @summary If JDI is initially started from a thread group that is subsequently
- *           destroyed this should not impact subsequent thread creation by
- *           the virtual machine manager.
+ * @test
+ * @bug 4893530
+ * @summary If JDI is initially started from a thread group that is subsequently
+ *          destroyed this should not impact subsequent thread creation by
+ *          the virtual machine manager.
  *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile ThreadGroupTest.java
- *  @run driver ThreadGroupTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile ThreadGroupTest.java
+ * @run driver ThreadGroupTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.connect.*;
diff --git a/jdk/test/com/sun/jdi/TwoThreadsTest.java b/jdk/test/com/sun/jdi/TwoThreadsTest.java
index ca981d9..3e560ea 100644
--- a/jdk/test/com/sun/jdi/TwoThreadsTest.java
+++ b/jdk/test/com/sun/jdi/TwoThreadsTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 6296125
- *  @summary  JDI: Disabling an EventRequest can cause a multi-threaded debuggee to hang
+ * @test
+ * @bug 6296125
+ * @summary  JDI: Disabling an EventRequest can cause a multi-threaded debuggee to hang
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g TwoThreadsTest.java
- *  @run driver TwoThreadsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g TwoThreadsTest.java
+ * @run driver TwoThreadsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/UTF8Test.java b/jdk/test/com/sun/jdi/UTF8Test.java
index 1325a0a..945a535 100644
--- a/jdk/test/com/sun/jdi/UTF8Test.java
+++ b/jdk/test/com/sun/jdi/UTF8Test.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 5033550
- *  @summary  JDWP back end uses modified UTF-8
+ * @test
+ * @bug 5033550
+ * @summary  JDWP back end uses modified UTF-8
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g UTF8Test.java
- *  @run driver UTF8Test
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g UTF8Test.java
+ * @run driver UTF8Test
  */
 
 /*
diff --git a/jdk/test/com/sun/jdi/UnpreparedByName.java b/jdk/test/com/sun/jdi/UnpreparedByName.java
index aa7c663..43ec567 100644
--- a/jdk/test/com/sun/jdi/UnpreparedByName.java
+++ b/jdk/test/com/sun/jdi/UnpreparedByName.java
@@ -22,18 +22,17 @@
  */
 
 /**
- *  @test
- *  @bug 4368402
- *  @summary UnpreparedByName verifies that unprepared classes
- *  won't be returned by classesByName.
- *  @author Robert Field
+ * @test
+ * @bug 4368402
+ * @summary UnpreparedByName verifies that unprepared classes
+ * won't be returned by classesByName.
+ * @author Robert Field
  *
- *  @modules jdk.jdi
- *  @run build JDIScaffold VMConnection
- *  @run compile -g InnerTarg.java
- *  @run build UnpreparedByName
+ * @run build JDIScaffold VMConnection
+ * @run compile -g InnerTarg.java
+ * @run build UnpreparedByName
  *
- *  @run driver UnpreparedByName InnerTarg
+ * @run driver UnpreparedByName InnerTarg
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/UnpreparedClasses.java b/jdk/test/com/sun/jdi/UnpreparedClasses.java
index 4e96fb6..fd21a76 100644
--- a/jdk/test/com/sun/jdi/UnpreparedClasses.java
+++ b/jdk/test/com/sun/jdi/UnpreparedClasses.java
@@ -22,18 +22,17 @@
  */
 
 /**
- *  @test
- *  @bug 4368402
- *  @summary UnpreparedClasses verifies that all the classes in the
- *  loaded class list are prepared classes.
- *  @author Robert Field
+ * @test
+ * @bug 4368402
+ * @summary UnpreparedClasses verifies that all the classes in the
+ * loaded class list are prepared classes.
+ * @author Robert Field
  *
- *  @modules jdk.jdi
- *  @run build JDIScaffold VMConnection
- *  @run compile -g InnerTarg.java
- *  @run build UnpreparedClasses
+ * @run build JDIScaffold VMConnection
+ * @run compile -g InnerTarg.java
+ * @run build UnpreparedClasses
  *
- *  @run driver UnpreparedClasses InnerTarg
+ * @run driver UnpreparedClasses InnerTarg
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/VMDeathLastTest.java b/jdk/test/com/sun/jdi/VMDeathLastTest.java
index 0df54af..47b59c9 100644
--- a/jdk/test/com/sun/jdi/VMDeathLastTest.java
+++ b/jdk/test/com/sun/jdi/VMDeathLastTest.java
@@ -22,17 +22,15 @@
  */
 
 /**
- *  @test
- *  @bug 4420844 4449394
- *  @summary Checks that no events are sent after VMDeath, and test vm.canBeModified
+ * @test
+ * @bug 4420844 4449394
+ * @summary Checks that no events are sent after VMDeath, and test vm.canBeModified
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g HelloWorld.java
- *  @run build VMDeathLastTest
- *  @run driver VMDeathLastTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g HelloWorld.java
+ * @run build VMDeathLastTest
+ * @run driver VMDeathLastTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/VMDeathRequestTest.java b/jdk/test/com/sun/jdi/VMDeathRequestTest.java
index 784ddaf..67eaad3 100644
--- a/jdk/test/com/sun/jdi/VMDeathRequestTest.java
+++ b/jdk/test/com/sun/jdi/VMDeathRequestTest.java
@@ -22,22 +22,20 @@
  */
 
 /**
- *  @test
- *  @bug 4419314
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g HelloWorld.java
- *  @run build VMDeathRequestTest
- *  @run driver VMDeathRequestTest
- *
+ * @test
+ * @bug 4419314
  * @summary VMDeathRequestTest checks to see that
  * VMDisconnectedException is never thrown before VMDisconnectEvent.
  *
  * Failure mode for this test is throwing VMDisconnectedException
  * on vm.eventQueue().remove();
  * Does not use a scaffold since we don't want that hiding the exception.
+ * @author Robert Field
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g HelloWorld.java
+ * @run build VMDeathRequestTest
+ * @run driver VMDeathRequestTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/VarargsTest.java b/jdk/test/com/sun/jdi/VarargsTest.java
index 4bb015e..4bdeb15 100644
--- a/jdk/test/com/sun/jdi/VarargsTest.java
+++ b/jdk/test/com/sun/jdi/VarargsTest.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @bug 4870984
- *  @summary  JPDA: Add support for RFE 4856541 - varargs
+ * @test
+ * @bug 4870984
+ * @summary  JPDA: Add support for RFE 4856541 - varargs
+ * @author jjh
  *
- *  @author jjh
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g VarargsTest.java
- *  @run driver VarargsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g VarargsTest.java
+ * @run driver VarargsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/Vars.java b/jdk/test/com/sun/jdi/Vars.java
index edffff3..bb5e955 100644
--- a/jdk/test/com/sun/jdi/Vars.java
+++ b/jdk/test/com/sun/jdi/Vars.java
@@ -22,15 +22,13 @@
  */
 
 /**
- *  @test
- *  @summary Test Method.variables() and the like.
+ * @test
+ * @summary Test Method.variables() and the like.
+ * @author Robert Field
  *
- *  @author Robert Field
- *
- *  @modules jdk.jdi
- *  @run build JDIScaffold VMConnection
- *  @run compile -g Vars.java
- *  @run driver Vars
+ * @run build JDIScaffold VMConnection
+ * @run compile -g Vars.java
+ * @run driver Vars
  */
 
 import com.sun.jdi.*;
diff --git a/jdk/test/com/sun/jdi/VisibleMethods.java b/jdk/test/com/sun/jdi/VisibleMethods.java
index 2cc0885..95c42b8 100644
--- a/jdk/test/com/sun/jdi/VisibleMethods.java
+++ b/jdk/test/com/sun/jdi/VisibleMethods.java
@@ -22,16 +22,14 @@
  */
 
 /**
- *  @test
- *  @summary Test ReferenceType.visibleMethods
- *  @bug 8028430
+ * @test
+ * @summary Test ReferenceType.visibleMethods
+ * @bug 8028430
+ * @author Staffan Larsen
  *
- *  @author Staffan Larsen
- *
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g VisibleMethods.java
- *  @run driver VisibleMethods
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g VisibleMethods.java
+ * @run driver VisibleMethods
  */
 import com.sun.jdi.Method;
 import com.sun.jdi.ReferenceType;
diff --git a/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java b/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java
index dd3dec3..a726e19 100644
--- a/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java
+++ b/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java
@@ -30,7 +30,6 @@
  * to encapsulate the transport. This tests that the connectors are
  * created and that they have an "address" argument.
  *
- * @modules jdk.jdi/com.sun.tools.jdi
  * @build GeneratedConnectors NullTransportService SimpleLaunchingConnector
  * @run main/othervm GeneratedConnectors
  */
diff --git a/jdk/test/com/sun/jdi/redefine/RedefineTest.java b/jdk/test/com/sun/jdi/redefine/RedefineTest.java
index 1f8d125..1ef2a0c 100644
--- a/jdk/test/com/sun/jdi/redefine/RedefineTest.java
+++ b/jdk/test/com/sun/jdi/redefine/RedefineTest.java
@@ -22,20 +22,20 @@
  */
 
 /**
- *  @test
- *  @bug 4287595
- *  @bug 4462989
- *  @bug 4531511
- *  @summary Test class redefinition
+ * @test
+ * @bug 4287595
+ * @bug 4462989
+ * @bug 4531511
+ * @summary Test class redefinition
  *
- *  @author Robert Field
+ * @author Robert Field
  *
- *  @library ..
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g RedefineTest.java
- *  @run shell RedefineSetUp.sh
- *  @run driver RedefineTest
+ * @library ..
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g RedefineTest.java
+ * @run shell RedefineSetUp.sh
+ * @run driver RedefineTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java b/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java
index d504a0e..a3ae8b0 100644
--- a/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java
+++ b/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java
@@ -22,19 +22,18 @@
  */
 
 /**
- *  @test
- *  @bug 4628726
- *  @summary Test class redefinition - method data line numbers and local vars,
+ * @test
+ * @bug 4628726
+ * @summary Test class redefinition - method data line numbers and local vars,
+ * @author Robert Field
  *
- *  @author Robert Field
+ * @library ..
  *
- *  @library ..
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run compile -g RedefineTest.java
- *  @run shell RedefineSetUp.sh
- *  @run driver RedefineTest -repeat 3
- *  @run driver RedefineTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g RedefineTest.java
+ * @run shell RedefineSetUp.sh
+ * @run driver RedefineTest -repeat 3
+ * @run driver RedefineTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/sde/FilterMangleTest.java b/jdk/test/com/sun/jdi/sde/FilterMangleTest.java
index 349a73f..9646109 100644
--- a/jdk/test/com/sun/jdi/sde/FilterMangleTest.java
+++ b/jdk/test/com/sun/jdi/sde/FilterMangleTest.java
@@ -1,31 +1,30 @@
 /**
- *  @test
- *  @bug 4836939
- *  @summary JDI add addSourceNameFilter to ClassPrepareRequest
+ * @test
+ * @bug 4836939
+ * @key intermittent
+ * @summary JDI add addSourceNameFilter to ClassPrepareRequest
+ * @author Robert Field / Jim Holmlund
  *
- *  @author Robert Field / Jim Holmlund
+ * @library ..
  *
- *  @key intermittent
- *  @library ..
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
- *  @run compile FilterMangleTest.java
- *  @run compile -g onion/pickle/Mangle.java
- *  @run driver FilterMangleTest
- *  @run driver FilterMangleTest SDE-pMangle.java*
- *  @run driver FilterMangleTest SDE-pMangle.jav*
- *  @run driver FilterMangleTest SDE-pMangle.j*
- *  @run driver FilterMangleTest SDE-p*Mangle.java
- *  @run driver FilterMangleTest SDE-p*angle.java
- *  @run driver FilterMangleTest SDE-p*java
- *  @run driver FilterMangleTest SDE-pMangle.xyz
- *  @run driver FilterMangleTest SDE-pIncl.rats*
- *  @run driver FilterMangleTest SDE-pIncl.rat*
- *  @run driver FilterMangleTest SDE-p*angle.rats
- *  @run driver FilterMangleTest SDE-f*Incl.rat
- *  @run driver FilterMangleTest SDE-ffred
- *  @run driver FilterMangleTest SDE-f*ratsx
- *  @run driver FilterMangleTest SDE-fMangle.javax*
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
+ * @run compile FilterMangleTest.java
+ * @run compile -g onion/pickle/Mangle.java
+ * @run driver FilterMangleTest
+ * @run driver FilterMangleTest SDE-pMangle.java*
+ * @run driver FilterMangleTest SDE-pMangle.jav*
+ * @run driver FilterMangleTest SDE-pMangle.j*
+ * @run driver FilterMangleTest SDE-p*Mangle.java
+ * @run driver FilterMangleTest SDE-p*angle.java
+ * @run driver FilterMangleTest SDE-p*java
+ * @run driver FilterMangleTest SDE-pMangle.xyz
+ * @run driver FilterMangleTest SDE-pIncl.rats*
+ * @run driver FilterMangleTest SDE-pIncl.rat*
+ * @run driver FilterMangleTest SDE-p*angle.rats
+ * @run driver FilterMangleTest SDE-f*Incl.rat
+ * @run driver FilterMangleTest SDE-ffred
+ * @run driver FilterMangleTest SDE-f*ratsx
+ * @run driver FilterMangleTest SDE-fMangle.javax*
  */
 
 /*
diff --git a/jdk/test/com/sun/jdi/sde/MangleStepTest.java b/jdk/test/com/sun/jdi/sde/MangleStepTest.java
index 0d135f9..15f1d1f 100644
--- a/jdk/test/com/sun/jdi/sde/MangleStepTest.java
+++ b/jdk/test/com/sun/jdi/sde/MangleStepTest.java
@@ -1,21 +1,20 @@
 /**
- *  @test
- *  @bug 4390869
- *  @bug 4460328
- *  @summary Test Stepping in the new SourceDebugExtension facility
+ * @test
+ * @bug 4390869
+ * @bug 4460328
+ * @summary Test Stepping in the new SourceDebugExtension facility
+ * @author Robert Field
  *
- *  @author Robert Field
+ * @library ..
  *
- *  @library ..
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
- *  @run compile MangleStepTest.java
- *  @run compile -g  onion/pickle/Mangle.java
- *  @run driver MangleStepTest unset
- *  @run driver MangleStepTest Java
- *  @run driver MangleStepTest XYZ
- *  @run driver MangleStepTest Rats
- *  @run driver MangleStepTest bogus
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
+ * @run compile MangleStepTest.java
+ * @run compile -g  onion/pickle/Mangle.java
+ * @run driver MangleStepTest unset
+ * @run driver MangleStepTest Java
+ * @run driver MangleStepTest XYZ
+ * @run driver MangleStepTest Rats
+ * @run driver MangleStepTest bogus
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/sde/MangleTest.java b/jdk/test/com/sun/jdi/sde/MangleTest.java
index c766ffa..301bef0 100644
--- a/jdk/test/com/sun/jdi/sde/MangleTest.java
+++ b/jdk/test/com/sun/jdi/sde/MangleTest.java
@@ -1,17 +1,16 @@
 /**
- *  @test
- *  @bug 4390869
- *  @bug 4460328
- *  @summary Test the new SourceDebugExtension facility
+ * @test
+ * @bug 4390869
+ * @bug 4460328
+ * @summary Test the new SourceDebugExtension facility
+ * @author Robert Field
  *
- *  @author Robert Field
+ * @library ..
  *
- *  @library ..
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
- *  @run compile MangleTest.java
- *  @run compile -g onion/pickle/Mangle.java
- *  @run driver MangleTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
+ * @run compile MangleTest.java
+ * @run compile -g onion/pickle/Mangle.java
+ * @run driver MangleTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java b/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java
index 62b6514..fb4372f 100644
--- a/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java
+++ b/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java
@@ -1,17 +1,16 @@
 /**
- *  @test
- *  @bug 4390869
- *  @bug 4460328
- *  @summary Test the new SourceDebugExtension facility
+ * @test
+ * @bug 4390869
+ * @bug 4460328
+ * @summary Test the new SourceDebugExtension facility
+ * @author Robert Field
  *
- *  @author Robert Field
+ * @library ..
  *
- *  @library ..
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
- *  @run compile SourceDebugExtensionTest.java
- *  @run compile -g SourceDebugExtensionTarg.java
- *  @run driver SourceDebugExtensionTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
+ * @run compile SourceDebugExtensionTest.java
+ * @run compile -g SourceDebugExtensionTarg.java
+ * @run driver SourceDebugExtensionTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java b/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java
index 130e72a..36c3e71 100644
--- a/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java
+++ b/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java
@@ -1,17 +1,16 @@
 /**
- *  @test
- *  @bug 4390869
- *  @bug 4460328
- *  @summary Test the new SourceDebugExtension facility
+ * @test
+ * @bug 4390869
+ * @bug 4460328
+ * @summary Test the new SourceDebugExtension facility
+ * @author Robert Field
  *
- *  @author Robert Field
+ * @library ..
  *
- *  @library ..
- *  @modules jdk.jdi
- *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE HelloWorld
- *  @run compile TemperatureTableTest.java
- *  @run compile -g TemperatureTableServlet.java
- *  @run driver TemperatureTableTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE HelloWorld
+ * @run compile TemperatureTableTest.java
+ * @run compile -g TemperatureTableServlet.java
+ * @run driver TemperatureTableTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jndi/dns/Parser.java b/jdk/test/com/sun/jndi/dns/Parser.java
index 58c7bd5..2cc4fb5 100644
--- a/jdk/test/com/sun/jndi/dns/Parser.java
+++ b/jdk/test/com/sun/jndi/dns/Parser.java
@@ -26,7 +26,6 @@
  * @bug 8035105
  * @summary DNS resource record parsing
  * @modules jdk.naming.dns/com.sun.jndi.dns:+open
- * @compile --add-modules jdk.naming.dns Parser.java
  */
 
 import com.sun.jndi.dns.ResourceRecord;
diff --git a/jdk/test/com/sun/jndi/dns/Test6991580.java b/jdk/test/com/sun/jndi/dns/Test6991580.java
index b8763bb..191cfd1 100644
--- a/jdk/test/com/sun/jndi/dns/Test6991580.java
+++ b/jdk/test/com/sun/jndi/dns/Test6991580.java
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,6 @@
  * @summary IPv6 Nameservers in resolv.conf throws NumberFormatException
  * @modules java.desktop
  *          jdk.naming.dns/com.sun.jndi.dns
- * @compile --add-modules jdk.naming.dns IPv6NameserverPlatformParsingTest.java
  * @run main/manual Test6991580
  */
 
diff --git a/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/ContextWithNullProperties.java b/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/ContextWithNullProperties.java
index f75eb88..e18442d 100644
--- a/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/ContextWithNullProperties.java
+++ b/jdk/test/com/sun/jndi/rmi/registry/RegistryContext/ContextWithNullProperties.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
  *     java.rmi/sun.rmi.server java.rmi/sun.rmi.transport java.rmi/sun.rmi.transport.tcp
  * @library ../../../../../../java/rmi/testlibrary
  * @build TestLibrary
- * @compile --add-modules jdk.naming.rmi ContextWithNullProperties.java
  * @run main/othervm ContextWithNullProperties
  */
 
diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java
index 3bfd07f..34def00 100644
--- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java
+++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java
@@ -27,7 +27,6 @@
  * @summary Basic Test for the DiagnosticCommandMBean
  * @author  Frederic Parain, Shanliang JIANG
  *
- * @modules jdk.management
  * @run main/othervm DcmdMBeanDoubleInvocationTest
  */
 
diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java
index a42070d..f28e77a 100644
--- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java
+++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java
@@ -27,7 +27,6 @@
  * @summary Basic Test for the DiagnosticCommandMBean
  * @author  Frederic Parain, Shanliang JIANG
  *
- * @modules jdk.management
  * @run main/othervm DcmdMBeanInvocationTest
  */
 
diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java
index 748e49a..545890f 100644
--- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java
+++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java
@@ -27,7 +27,9 @@
  * @summary Permissions Tests for the DiagnosticCommandMBean
  * @author  Frederic Parain
  *
- * @modules jdk.management
+ * @modules java.logging
+ *          java.management
+ *
  * @run main/othervm DcmdMBeanPermissionsTest
  */
 
diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java
index 8f988b2..3cc9f40 100644
--- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java
+++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java
@@ -27,7 +27,6 @@
  * @summary Basic Test for the DiagnosticCommandMBean
  * @author  Frederic Parain, Shanliang JIANG
  *
- * @modules jdk.management
  * @run main/othervm DcmdMBeanTest
  */
 
diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java
index c580c49..bdb3a0c 100644
--- a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java
+++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java
@@ -27,7 +27,6 @@
  * @summary Sanity Test for GarbageCollectorMXBean.getLastGcInfo().
  * @author  Mandy Chung
  *
- * @modules jdk.management
  * @run main/othervm -XX:-ExplicitGCInvokesConcurrent LastGCInfo
  */
 // Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc()
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java
index 7e3f247..a40b9d4 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java
@@ -27,7 +27,6 @@
  * @summary Basic Test for HotSpotDiagnosticMXBean.getDiagnosticOptions()
  * @author  Daniel Fuchs
  *
- * @modules jdk.management
  * @run main GetDiagnosticOptions
  */
 
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java
index d181677..4c9f8f3 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java
@@ -27,7 +27,6 @@
  * @summary Basic Test for HotSpotDiagnosticMXBean.getVMOption() and double values
  * @author  Jaroslav Bachorik
  *
- * @modules jdk.management
  * @run main/othervm -XX:CompileThresholdScaling=0.14 GetDoubleVMOption
  */
 
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java
index 49edcc1..f380338 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java
@@ -27,7 +27,6 @@
  * @summary Basic Test for HotSpotDiagnosticMXBean.getVMOption()
  * @author  Mandy Chung
  *
- * @modules jdk.management
  * @run main/othervm -XX:+HeapDumpOnOutOfMemoryError GetVMOption
  */
 
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java
index c630ef4..b433228 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java
@@ -27,7 +27,6 @@
  * @summary Basic Test for HotSpotDiagnosticMXBean.setVMOption()
  * @author  Tomas Hurka, Daniel Fuchs
  *
- * @modules jdk.management
  * @run main SetAllVMOptions
  */
 
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java
index d11ec33..8cad178 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java
@@ -29,7 +29,6 @@
  * @author  Mandy Chung
  * @author  Jaroslav Bachorik
  *
- * @modules jdk.management
  * @run main/othervm -XX:+HeapDumpOnOutOfMemoryError SetVMOption
  */
 
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java
index 4430731..b4f08ce 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java
@@ -26,7 +26,6 @@
  * @bug     4858522 6191542
  * @summary Basic unit test of OperatingSystemMXBean.getCommittedVirtualMemorySize()
  * @author  Steve Bohne
- * @modules jdk.management
  */
 
 /*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java
index 6747bc9..6d843cc 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java
@@ -26,7 +26,6 @@
  * @bug     4858522
  * @summary Basic unit test of OperatingSystemMXBean.getFreePhysicalMemorySize()
  * @author  Steve Bohne
- * @modules jdk.management
  */
 
 /*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java
index 82ed725..3df910d 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java
@@ -26,7 +26,6 @@
  * @bug     4858522
  * @summary Basic unit test of OperatingSystemMXBean.getFreeSwapSpaceSize()
  * @author  Steve Bohne
- * @modules jdk.management
  */
 
 /*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java
index 6977178..bbf26e0 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java
@@ -26,7 +26,6 @@
  * @bug     7028071
  * @summary Basic unit test of OperatingSystemMXBean.getProcessCpuLoad()
  *
- * @modules jdk.management
  * @run main GetProcessCpuLoad
  */
 
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java
index 1e1132a..f65b261 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java
@@ -26,7 +26,6 @@
  * @bug     4858522
  * @summary Basic unit test of OperatingSystemMXBean.getProcessCpuTime()
  * @author  Steve Bohne
- * @modules jdk.management
  */
 
 /*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java
index 701b1fa..71ee209 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java
@@ -26,7 +26,6 @@
  * @bug     7028071
  * @summary Basic unit test of OperatingSystemMXBean.getProcessCpuLoad()
  *
- * @modules jdk.management
  * @run main GetSystemCpuLoad
  */
 
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java
index 57eb80f..b3f5548 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java
@@ -26,7 +26,6 @@
  * @bug     4858522
  * @summary Basic unit test of OperatingSystemMXBean.getTotalPhysicalMemorySize()
  * @author  Steve Bohne
- * @modules jdk.management
  */
 
 /*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java b/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java
index 046dbcb..d016a11 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java
@@ -29,7 +29,6 @@
  *      the GlobalMemoryStatus function can return incorrect information,
  *      reporting a value of -1 to indicate an overflow.
  *
- * @modules jdk.management
  * @run main MemoryStatusOverflow
  */
 
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java b/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java
index 8d5e7c9..b1151f9 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java
@@ -25,14 +25,13 @@
  * @test
  * @bug     4858522
  * @summary Basic unit test of OperatingSystemMXBean.getTotalSwapSpaceSize()
- *
- * @library /lib/testlibrary
- * @modules jdk.management
- * @build TestTotalSwap jdk.testlibrary.*
- * @run main TestTotalSwap
- *
  * @author  Steve Bohne
  * @author  Jaroslav Bachorik
+ *
+ * @library /lib/testlibrary
+ *
+ * @build TestTotalSwap jdk.testlibrary.*
+ * @run main TestTotalSwap
  */
 
 /*
diff --git a/jdk/test/com/sun/management/TEST.properties b/jdk/test/com/sun/management/TEST.properties
new file mode 100644
index 0000000..b6ae420
--- /dev/null
+++ b/jdk/test/com/sun/management/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.management
+
diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java
index 1729662..1fc1342 100644
--- a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java
+++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java
@@ -26,7 +26,6 @@
  * @bug     6173675
  * @summary Basic test of ThreadMXBean.getThreadAllocatedBytes
  * @author  Paul Hohensee
- * @modules jdk.management
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java
index 378abca..cbd3d1d 100644
--- a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java
+++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java
@@ -26,7 +26,6 @@
  * @bug     6173675
  * @summary Basic test of ThreadMXBean.getThreadAllocatedBytes(long[])
  * @author  Paul Hohensee
- * @modules jdk.management
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java
index 2e1046c..c7fded7 100644
--- a/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java
+++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java
@@ -24,11 +24,10 @@
 /*
  * @test
  * @bug     6173675
+ * @key randomness
  * @summary Basic test of ThreadMXBean.getThreadCpuTime(long[]) and
  *          getThreadUserTime(long[]).
  * @author  Paul Hohensee
- * @key randomness
- * @modules jdk.management
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
index a131bb5..ef089a3 100644
--- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
+++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
@@ -24,10 +24,9 @@
 #
 # @test
 # @bug     4858522
-# @summary 
+# @summary
 # @author  Steve Bohne
 #
-# @modules jdk.management
 # @run shell GetMaxFileDescriptorCount.sh
 #
 
@@ -40,7 +39,7 @@
 fi
 
 runOne()
-{ 
+{
    echo "runOne $@"
    $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d $TESTCLASSES \
        $TESTSRC/$@.java || exit 2
diff --git a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
index f490698..9074fab 100644
--- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
+++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
@@ -24,10 +24,9 @@
 #
 # @test
 # @bug     4858522
-# @summary 
+# @summary
 # @author  Steve Bohne
 #
-# @modules jdk.management
 # @run shell GetOpenFileDescriptorCount.sh
 #
 
@@ -39,7 +38,7 @@
     COMPILEJAVA="${TESTJAVA}"
 fi
 runOne()
-{ 
+{
    echo "runOne $@"
    $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d $TESTCLASSES \
        $TESTSRC/$@.java || exit 2
diff --git a/jdk/test/com/sun/management/VMOptionOpenDataTest.java b/jdk/test/com/sun/management/VMOptionOpenDataTest.java
index 5d25508..12904a0 100644
--- a/jdk/test/com/sun/management/VMOptionOpenDataTest.java
+++ b/jdk/test/com/sun/management/VMOptionOpenDataTest.java
@@ -38,7 +38,6 @@
  * @test
  * @bug     8042901
  * @summary Check that MappedMXBeanType.toOpenTypeData supports VMOption
- * @modules jdk.management/com.sun.management
  * @author  Shanliang Jiang
  */
 public class VMOptionOpenDataTest {
diff --git a/jdk/test/com/sun/tools/attach/BasicTests.java b/jdk/test/com/sun/tools/attach/BasicTests.java
index 720ae00..2a394d0 100644
--- a/jdk/test/com/sun/tools/attach/BasicTests.java
+++ b/jdk/test/com/sun/tools/attach/BasicTests.java
@@ -40,16 +40,17 @@
 /*
  * @test
  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
- * @summary Basic unit tests for the VM attach mechanism.
  * @key intermittent
+ * @summary Basic unit tests for the VM attach mechanism. This test will perform
+ * a number of basic attach tests.
+ *
  * @library /lib/testlibrary
  * @modules java.instrument
- *          java.management
+ *          jdk.attach
  *          jdk.jartool/sun.tools.jar
+ *
  * @run build jdk.testlibrary.* Agent BadAgent RedefineAgent Application RedefineDummy RunnerUtil
  * @run main BasicTests
- *
- * This test will perform a number of basic attach tests.
  */
 public class BasicTests {
 
diff --git a/jdk/test/com/sun/tools/attach/PermissionTest.java b/jdk/test/com/sun/tools/attach/PermissionTest.java
index 3254431..1d74abb 100644
--- a/jdk/test/com/sun/tools/attach/PermissionTest.java
+++ b/jdk/test/com/sun/tools/attach/PermissionTest.java
@@ -31,17 +31,15 @@
 /*
  * @test
  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
- * @summary Basic unit tests for the VM attach mechanism.
- * @modules jdk.jartool/sun.tools.jar
+ * @summary Basic unit tests for the VM attach mechanism. Unit test for Attach
+ * API - this checks that a SecurityException is thrown as expected.
+ *
  * @library /lib/testlibrary
- * @modules java.management
- *          jdk.attach
+ * @modules jdk.attach
  *          jdk.jartool/sun.tools.jar
+ *
  * @run build jdk.testlibrary.* Application
  * @run main PermissionTest
- *
- * Unit test for Attach API -
- * this checks that a SecurityException is thrown as expected.
  */
 public class PermissionTest {
 
diff --git a/jdk/test/com/sun/tools/attach/ProviderTest.java b/jdk/test/com/sun/tools/attach/ProviderTest.java
index 685cc47..6c0125b 100644
--- a/jdk/test/com/sun/tools/attach/ProviderTest.java
+++ b/jdk/test/com/sun/tools/attach/ProviderTest.java
@@ -31,16 +31,15 @@
 /*
  * @test
  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
- * @summary Basic unit tests for the VM attach mechanism.
- * @modules jdk.jartool/sun.tools.jar
+ * @summary Basic unit tests for the VM attach mechanism. The test will attach
+ * and detach to/from the running Application.
+ *
  * @library /lib/testlibrary
- * @modules java.management
- *          jdk.attach
+ * @modules jdk.attach
  *          jdk.jartool/sun.tools.jar
+ *
  * @run build jdk.testlibrary.* SimpleProvider
  * @run main ProviderTest
- *
- * The test will attach and detach to/from the running Application.
  */
 public class ProviderTest {
 
diff --git a/jdk/test/com/sun/tools/attach/StartManagementAgent.java b/jdk/test/com/sun/tools/attach/StartManagementAgent.java
index 85256fb..5abeba2 100644
--- a/jdk/test/com/sun/tools/attach/StartManagementAgent.java
+++ b/jdk/test/com/sun/tools/attach/StartManagementAgent.java
@@ -39,11 +39,12 @@
 /*
  * @test
  * @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent
- * @modules jdk.jartool/sun.tools.jar
+ *
  * @library /lib/testlibrary
- * @modules jdk.management.agent
+ * @modules java.management
  *          jdk.attach
  *          jdk.jartool/sun.tools.jar
+ *
  * @run build Application SimpleProvider jdk.testlibrary.*
  * @run main/timeout=300 StartManagementAgent
  */
diff --git a/jdk/test/com/sun/tools/attach/TempDirTest.java b/jdk/test/com/sun/tools/attach/TempDirTest.java
index ae388c8..0ae0a46 100644
--- a/jdk/test/com/sun/tools/attach/TempDirTest.java
+++ b/jdk/test/com/sun/tools/attach/TempDirTest.java
@@ -37,10 +37,11 @@
  * @test
  * @bug 8033104
  * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set
- * @modules jdk.jartool/sun.tools.jar
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ * @modules jdk.attach
  *          jdk.jartool/sun.tools.jar
+ *
  * @run build jdk.testlibrary.* Application RunnerUtil
  * @run main/timeout=200 TempDirTest
  */
diff --git a/jdk/test/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java b/jdk/test/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java
new file mode 100644
index 0000000..88f0180
--- /dev/null
+++ b/jdk/test/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Choice;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+
+/**
+ * @test
+ * @bug 8176448
+ * @run main/timeout=300 ChoicePopupLocation
+ */
+public final class ChoicePopupLocation {
+
+    private static final int SIZE = 350;
+    private static int frameWidth;
+
+    public static void main(final String[] args) throws Exception {
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsDevice[] sds = ge.getScreenDevices();
+        Point left = null;
+        Point right = null;
+        for (GraphicsDevice sd : sds) {
+            GraphicsConfiguration gc = sd.getDefaultConfiguration();
+            Rectangle bounds = gc.getBounds();
+            if (left == null || left.x > bounds.x) {
+                left = new Point(bounds.x, bounds.y + bounds.height / 2);
+            }
+            if (right == null || right.x < bounds.x + bounds.width) {
+                right = new Point(bounds.x + bounds.width,
+                                  bounds.y + bounds.height / 2);
+            }
+
+            Point point = new Point(bounds.x, bounds.y);
+            Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
+            while (point.y < bounds.y + bounds.height - insets.bottom - SIZE ) {
+                while (point.x < bounds.x + bounds.width - insets.right - SIZE) {
+                    test(point);
+                    point.translate(bounds.width / 5, 0);
+                }
+                point.setLocation(bounds.x, point.y + bounds.height / 5);
+            }
+
+        }
+        if (left != null) {
+            left.translate(-50, 0);
+            test(left);
+        }
+        if (right != null) {
+            right.translate(-frameWidth + 50, 0);
+            test(right);
+        }
+    }
+
+    private static void test(final Point tmp) throws Exception {
+        Choice choice = new Choice();
+        for (int i = 1; i < 7; i++) {
+            choice.add("Long-long-long-long-long text in the item-" + i);
+        }
+        Frame frame = new Frame();
+        try {
+            frame.setAlwaysOnTop(true);
+            frame.setLayout(new FlowLayout());
+            frame.add(choice);
+            frame.pack();
+            frameWidth = frame.getWidth();
+            frame.setSize(frameWidth, SIZE);
+            frame.setVisible(true);
+            frame.setLocation(tmp.x, tmp.y);
+            openPopup(choice);
+        } finally {
+            frame.dispose();
+        }
+    }
+
+    private static void openPopup(final Choice choice) throws Exception {
+        Robot robot = new Robot();
+        robot.setAutoDelay(100);
+        robot.setAutoWaitForIdle(true);
+        robot.waitForIdle();
+        Point pt = choice.getLocationOnScreen();
+        robot.mouseMove(pt.x + choice.getWidth() / 2,
+                        pt.y + choice.getHeight() / 2);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        int x = pt.x + choice.getWidth() / 2;
+        int y = pt.y + choice.getHeight() / 2 + 70;
+        robot.mouseMove(x, y);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        robot.waitForIdle();
+        if (choice.getSelectedIndex() == 0) {
+            throw new RuntimeException();
+        }
+    }
+}
diff --git a/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java b/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java
index de12271..8587454 100644
--- a/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java
+++ b/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  */
 
 
-import com.sun.awt.AWTUtilities;
 import java.awt.Frame;
 import java.awt.Panel;
 import java.awt.Point;
@@ -44,11 +43,10 @@
 /*
  * @test
  * @key headful
- * @bug 6776743
+ * @bug 6776743 8173409
  * @summary Opaque overlapping test for each AWT component
  * @library /java/awt/patchlib  ../../regtesthelpers
- * @modules java.desktop/com.sun.awt
- *          java.desktop/java.awt.peer
+ * @modules java.desktop/java.awt.peer
  *          java.desktop/sun.awt
  * @build java.desktop/java.awt.Helper
  * @build Util
@@ -134,12 +132,10 @@
         // flag value.
         for (int i = 0; i < 9; ++i) {
             if (i == 3) {
-                AWTUtilities.setComponentMixingCutoutShape(light,
-                        new Rectangle());
+                light.setMixingCutoutShape(new Rectangle());
             }
             if (i == 6) {
-                AWTUtilities.setComponentMixingCutoutShape(light,
-                        null);
+                light.setMixingCutoutShape(null);
             }
 
             robot.mousePress(InputEvent.BUTTON1_MASK);
diff --git a/jdk/test/java/awt/Mixing/OpaqueTest.java b/jdk/test/java/awt/Mixing/OpaqueTest.java
index 2b4781b..1c7d44b 100644
--- a/jdk/test/java/awt/Mixing/OpaqueTest.java
+++ b/jdk/test/java/awt/Mixing/OpaqueTest.java
@@ -24,11 +24,10 @@
 /*
   @test
   @key headful
-  @bug 4811096
+  @bug 4811096 8173409
   @summary Tests whether opaque and non-opaque components mix correctly
   @author anthony.petrov@...: area=awt.mixing
   @library ../regtesthelpers
-  @modules java.desktop/com.sun.awt
   @build Util
   @run main OpaqueTest
 */
@@ -44,7 +43,6 @@
 import java.awt.event.*;
 import javax.swing.*;
 import test.java.awt.regtesthelpers.Util;
-import com.sun.awt.AWTUtilities;
 
 
 
@@ -125,12 +123,10 @@
         // flag value.
         for (int i = 0; i < 9; ++i) {
             if (i == 3) {
-                AWTUtilities.setComponentMixingCutoutShape(light,
-                        new Rectangle());
+                light.setMixingCutoutShape(new Rectangle());
             }
             if (i == 6) {
-                AWTUtilities.setComponentMixingCutoutShape(light,
-                        null);
+                light.setMixingCutoutShape(null);
             }
 
             robot.mousePress(InputEvent.BUTTON1_MASK);
diff --git a/jdk/test/java/awt/MouseInfo/ComponentMousePositionTest.java b/jdk/test/java/awt/MouseInfo/ComponentMousePositionTest.java
new file mode 100644
index 0000000..f3ecef9
--- /dev/null
+++ b/jdk/test/java/awt/MouseInfo/ComponentMousePositionTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /*
+ @test
+ @key headful
+ @bug 4009555 7119774
+ @summary Test for Component's method getMousePosition()
+ @run main ComponentMousePositionTest
+ */
+import java.awt.Frame;
+import java.awt.Panel;
+import java.awt.Button;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.AWTException;
+
+public class ComponentMousePositionTest {
+
+    public void changeMousePosition() {
+        Frame frame = new Frame();
+        Panel panel = new Panel();
+        Button button = new Button("Button");
+        Button overlappedButton = new Button("Overlapped button");
+        Dimension BUTTON_DIMENSION = new Dimension(100, 100);
+        Dimension FRAME_DIMENSION = new Dimension(200, 200);
+        Point POINT_WITHOUT_COMPONENTS = new Point(10, 10);
+        Point FIRST_BUTTON_LOCATION = new Point(20, 20);
+        Point SECOND_BUTTON_LOCATION = new Point(30, 30);
+
+        button.setSize(BUTTON_DIMENSION);
+        button.setLocation(FIRST_BUTTON_LOCATION);
+        overlappedButton.setSize(BUTTON_DIMENSION);
+        overlappedButton.setLocation(SECOND_BUTTON_LOCATION);
+
+        panel.setLayout(null);
+        panel.add(button);
+        panel.add(overlappedButton);
+        frame.add(panel);
+        Robot robot;
+
+        try {
+            robot = new Robot();
+            frame.setSize(FRAME_DIMENSION);
+            frame.setVisible(true);
+            robot.delay(2000);
+
+            Point p = button.getLocationOnScreen();
+            robot.mouseMove(p.x + button.getWidth()
+                    / 2, p.y + button.getHeight() / 2);
+            robot.waitForIdle();
+
+            Point pMousePosition = button.getMousePosition();
+            if (pMousePosition == null) {
+                throw new RuntimeException("Test failed: "
+                        + "Component.getMousePosition() returned null result "
+                        + "inside Component");
+            }
+
+            if (pMousePosition.x != button.getWidth() / 2
+                    || pMousePosition.y != button.getHeight() / 2) {
+                throw new RuntimeException("Test failed: "
+                        + "Component.getMousePosition() returned incorrect "
+                        + "result inside Component");
+            }
+
+            pMousePosition = overlappedButton.getMousePosition();
+            if (pMousePosition != null) {
+                throw new RuntimeException("Test failed: Overlapped component "
+                        + "did not return null result when a pointer was inside"
+                        + " the components bounds.");
+            }
+            robot.mouseMove(panel.getLocationOnScreen().x
+                    + POINT_WITHOUT_COMPONENTS.x,
+                    panel.getLocationOnScreen().y
+                    + POINT_WITHOUT_COMPONENTS.y);
+            robot.waitForIdle();
+
+            pMousePosition = button.getMousePosition();
+            if (pMousePosition != null) {
+                throw new RuntimeException("FAILED: "
+                        + "Component.getMousePosition() returned non-null "
+                        + "results outside Component");
+            }
+
+        } catch (AWTException e) {
+            throw new RuntimeException("FAILED: AWTException by Robot" + e);
+        } finally {
+            frame.dispose();
+        }
+    }
+
+    public static void main(String args[]) {
+        ComponentMousePositionTest mousePos = new ComponentMousePositionTest();
+        mousePos.changeMousePosition();
+    }
+}
diff --git a/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java b/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java
index f04c063..53b3e10 100644
--- a/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java
+++ b/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,15 +67,19 @@
         robot.waitForIdle();
 
         AtomicReference<Rectangle> frameBounds = new AtomicReference<>();
+        AtomicReference<Insets> frameInsets = new AtomicReference<>();
         AtomicReference<Dimension> button1Size = new AtomicReference<>();
         SwingUtilities.invokeAndWait(() -> {
             frameBounds.set(frame1.getBounds());
+            frameInsets.set(frame1.getInsets());
             button1Size.set(jButton1.getSize());
         });
 
 //point mouse to center of top-left Component (button1)
-        robot.mouseMove(frameBounds.get().x + button1Size.get().width / 2,
-                        frameBounds.get().y + button1Size.get().height / 2);
+        robot.mouseMove(frameBounds.get().x + frameInsets.get().left +
+                                                    button1Size.get().width / 2,
+                        frameBounds.get().y + frameInsets.get().top +
+                                                  button1Size.get().height / 2);
 
         AtomicReference<Point> pFalse = new AtomicReference<>();
         AtomicReference<Point> pTrue = new AtomicReference<>();
@@ -108,10 +112,12 @@
         System.out.println("Test stage completed: Container.getMousePosition(boolean) returned null result outside Container. Passed.");
 
 //point mouse in place free from child components (right-botton component)
-        robot.mouseMove(frameBounds.get().x + centerC4.get().x,
-                        frameBounds.get().y + centerC4.get().y);
+        robot.mouseMove(frameBounds.get().x + frameInsets.get().left +
+                                                               centerC4.get().x,
+                        frameBounds.get().y + frameInsets.get().top +
+                                                              centerC4.get().y);
 
-        robot.delay(3000);
+        robot.waitForIdle();
         SwingUtilities.invokeAndWait(() -> {
             pFalse.set(contentPane.getMousePosition(false));
             pTrue.set(frame1.getMousePosition(true));
@@ -123,7 +129,8 @@
         }
         System.out.println("Test stage completed: Container.getMousePosition(boolean) returned non-null results  inside Container. Passed.");
 
-        if (pTrue.get().x != centerC4.get().x || pTrue.get().y != centerC4.get().y) {
+        if (pTrue.get().x != frameInsets.get().left + centerC4.get().x ||
+            pTrue.get().y != frameInsets.get().top + centerC4.get().y) {
             throw new RuntimeException("Test failed: Container.getMousePosition(true) returned incorrect result inside Container.");
         }
         System.out.println("Test stage completed: Container.getMousePosition(true) returned correct result inside Container. Passed.");
diff --git a/jdk/test/java/awt/PopupMenu/PopupMenuLocation.java b/jdk/test/java/awt/PopupMenu/PopupMenuLocation.java
new file mode 100644
index 0000000..ec1714f
--- /dev/null
+++ b/jdk/test/java/awt/PopupMenu/PopupMenuLocation.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.PopupMenu;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.*;
+
+/**
+ * @test
+ * @bug 8160270
+ * @run main/timeout=300 PopupMenuLocation
+ */
+public final class PopupMenuLocation {
+
+    private static final int SIZE = 350;
+    public static final String TEXT =
+            "Long-long-long-long-long-long-long text in the item-";
+    private static volatile boolean action = false;
+
+    public static void main(final String[] args) throws Exception {
+        GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsDevice[] sds = ge.getScreenDevices();
+        for (GraphicsDevice sd : sds) {
+            GraphicsConfiguration gc = sd.getDefaultConfiguration();
+            Rectangle bounds = gc.getBounds();
+            Point point = new Point(bounds.x, bounds.y);
+            Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
+            while (point.y < bounds.y + bounds.height - insets.bottom - SIZE) {
+                while (point.x
+                        < bounds.x + bounds.width - insets.right - SIZE) {
+                    test(point);
+                    point.translate(bounds.width / 5, 0);
+                }
+                point.setLocation(bounds.x, point.y + bounds.height / 5);
+            }
+        }
+    }
+
+    private static void test(final Point tmp) throws Exception {
+        PopupMenu pm = new PopupMenu();
+        for (int i = 1; i < 7; i++) {
+            pm.add(TEXT + i);
+        }
+        pm.addActionListener(e -> action = true);
+        Frame frame = new Frame();
+        try {
+            frame.setAlwaysOnTop(true);
+            frame.setLayout(new FlowLayout());
+            frame.add(pm);
+            frame.pack();
+            frame.setSize(SIZE, SIZE);
+            frame.setVisible(true);
+            frame.setLocation(tmp.x, tmp.y);
+            frame.addMouseListener(new MouseAdapter() {
+                public void mousePressed(MouseEvent e) {
+                    show(e);
+                }
+
+                public void mouseReleased(MouseEvent e) {
+                    show(e);
+                }
+
+                private void show(MouseEvent e) {
+                    if (e.isPopupTrigger()) {
+                        pm.show(frame, 0, 50);
+                    }
+                }
+            });
+            openPopup(frame);
+        } finally {
+            frame.dispose();
+        }
+    }
+
+    private static void openPopup(final Frame frame) throws Exception {
+        Robot robot = new Robot();
+        robot.setAutoDelay(200);
+        robot.waitForIdle();
+        Point pt = frame.getLocationOnScreen();
+        robot.mouseMove(pt.x + frame.getWidth() / 2, pt.y + 50);
+        robot.mousePress(InputEvent.BUTTON3_DOWN_MASK);
+        robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK);
+        int x = pt.x + frame.getWidth() / 2;
+        int y = pt.y + 130;
+        robot.mouseMove(x, y);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        robot.waitForIdle();
+        if (!action) {
+            throw new RuntimeException();
+        }
+        action = false;
+    }
+}
diff --git a/jdk/test/java/awt/Robot/HiDPIScreenCapture/RobotMultiDPIScreenTest.java b/jdk/test/java/awt/Robot/HiDPIScreenCapture/RobotMultiDPIScreenTest.java
new file mode 100644
index 0000000..53ece71
--- /dev/null
+++ b/jdk/test/java/awt/Robot/HiDPIScreenCapture/RobotMultiDPIScreenTest.java
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.BasicStroke;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.awt.image.MultiResolutionImage;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
+/* @test
+ * @bug 8173972
+ * @summary createScreenCapture not working as expected on multimonitor setup
+ *          with different DPI scales.
+ * @run main/manual/othervm RobotMultiDPIScreenTest
+ */
+public class RobotMultiDPIScreenTest {
+
+    private static volatile boolean testResult = false;
+    private static volatile CountDownLatch countDownLatch;
+    private static JFrame mainFrame;
+    private static Rectangle maxBounds;
+    private static Rectangle[] screenBounds;
+    private static double[][] scales;
+
+    private static final String INSTRUCTIONS = "INSTRUCTIONS:\n"
+            + "Verify that screenshots are properly taken from monitors"
+            + " with different DPI.\n"
+            + "\n"
+            + "The test is applicable for a multi-monitor system where displays"
+            + " are configured to have different DPI\n"
+            + "\n"
+            + "1. Press Take Screenshots button\n"
+            + "Check that screenshots shown on the panel are properly taken.\n";
+
+    public static void main(String args[]) throws Exception {
+
+        countDownLatch = new CountDownLatch(1);
+        SwingUtilities.invokeLater(RobotMultiDPIScreenTest::createUI);
+        countDownLatch.await(15, TimeUnit.MINUTES);
+        if (!testResult) {
+            throw new RuntimeException("Test fails!");
+        }
+    }
+
+    private static void createUI() {
+
+        initScreenBounds();
+
+        mainFrame = new JFrame("DPI change test");
+        GridBagLayout layout = new GridBagLayout();
+        JPanel mainControlPanel = new JPanel(layout);
+        JPanel resultButtonPanel = new JPanel(layout);
+
+        GridBagConstraints gbc = new GridBagConstraints();
+
+        JPanel testPanel = new JPanel(new BorderLayout());
+
+        final BufferedImage screensImage = getScreenImages();
+        final JPanel screensPanel = new JPanel() {
+
+            @Override
+            public void paint(Graphics g) {
+                super.paint(g);
+                g.drawImage(screensImage, 0, 0, getWidth(), getHeight(), this);
+            }
+        };
+
+        screensPanel.setPreferredSize(new Dimension(400, 200));
+
+        JButton frameButton = new JButton("Take Screenshots");
+        frameButton.addActionListener((e) -> {
+
+            try {
+                Robot robot = new Robot();
+                Graphics2D g = screensImage.createGraphics();
+                g.translate(-maxBounds.x, -maxBounds.y);
+
+                for (Rectangle rect : screenBounds) {
+                    MultiResolutionImage mrImage = robot.createMultiResolutionScreenCapture(rect);
+
+                    List<Image> resolutionVariants = mrImage.getResolutionVariants();
+                    Image rvImage = resolutionVariants.get(resolutionVariants.size() - 1);
+                    g.drawImage(rvImage, rect.x, rect.y, rect.width, rect.height, null);
+                }
+
+                g.dispose();
+                screensPanel.repaint();
+            } catch (Exception ex) {
+                throw new RuntimeException(ex);
+            }
+        });
+
+        testPanel.add(screensPanel, BorderLayout.CENTER);
+        testPanel.add(frameButton, BorderLayout.SOUTH);
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(testPanel, gbc);
+
+        JTextArea instructionTextArea = new JTextArea();
+        instructionTextArea.setText(INSTRUCTIONS);
+        instructionTextArea.setEditable(false);
+        instructionTextArea.setBackground(Color.white);
+
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(instructionTextArea, gbc);
+
+        JButton passButton = new JButton("Pass");
+        passButton.setActionCommand("Pass");
+        passButton.addActionListener((ActionEvent e) -> {
+            testResult = true;
+            disposeFrames();
+            countDownLatch.countDown();
+
+        });
+
+        JButton failButton = new JButton("Fail");
+        failButton.setActionCommand("Fail");
+        failButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                disposeFrames();
+                countDownLatch.countDown();
+            }
+        });
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        resultButtonPanel.add(passButton, gbc);
+
+        gbc.gridx = 1;
+        gbc.gridy = 0;
+        resultButtonPanel.add(failButton, gbc);
+
+        gbc.gridx = 0;
+        gbc.gridy = 2;
+        mainControlPanel.add(resultButtonPanel, gbc);
+
+        mainFrame.add(mainControlPanel);
+        mainFrame.pack();
+
+        mainFrame.addWindowListener(new WindowAdapter() {
+
+            @Override
+            public void windowClosing(WindowEvent e) {
+                disposeFrames();
+                countDownLatch.countDown();
+            }
+        });
+        mainFrame.setVisible(true);
+    }
+
+    private static void disposeFrames() {
+        if (mainFrame != null && mainFrame.isVisible()) {
+            mainFrame.dispose();
+        }
+    }
+
+    static void initScreenBounds() {
+
+        GraphicsDevice[] devices = GraphicsEnvironment
+                .getLocalGraphicsEnvironment()
+                .getScreenDevices();
+
+        screenBounds = new Rectangle[devices.length];
+        scales = new double[devices.length][2];
+        for (int i = 0; i < devices.length; i++) {
+            GraphicsConfiguration gc = devices[i].getDefaultConfiguration();
+            screenBounds[i] = gc.getBounds();
+            AffineTransform tx = gc.getDefaultTransform();
+            scales[i][0] = tx.getScaleX();
+            scales[i][1] = tx.getScaleY();
+        }
+
+        maxBounds = screenBounds[0];
+        for (int i = 0; i < screenBounds.length; i++) {
+            maxBounds = maxBounds.union(screenBounds[i]);
+        }
+    }
+
+    private static Rectangle getCenterRect(Rectangle rect) {
+        int w = rect.width / 2;
+        int h = rect.height / 2;
+        int x = rect.x + w / 2;
+        int y = rect.y + h / 2;
+
+        return new Rectangle(x, y, w, h);
+    }
+
+    static BufferedImage getScreenImages() {
+
+        final BufferedImage img = new BufferedImage(maxBounds.width, maxBounds.height, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g = img.createGraphics();
+        g.setColor(Color.WHITE);
+        g.fillRect(0, 0, maxBounds.width, maxBounds.height);
+        g.translate(-maxBounds.x, -maxBounds.y);
+
+        g.setStroke(new BasicStroke(8f));
+        for (int i = 0; i < screenBounds.length; i++) {
+            Rectangle r = screenBounds[i];
+            g.setColor(Color.BLACK);
+            g.drawRect(r.x, r.y, r.width, r.height);
+
+            g.setColor(Color.ORANGE);
+            Rectangle cr = getCenterRect(r);
+            g.fillRect(cr.x, cr.y, cr.width, cr.height);
+
+            double scaleX = scales[i][0];
+            double scaleY = scales[i][1];
+            float fontSize = maxBounds.height / 7;
+            g.setFont(g.getFont().deriveFont(fontSize));
+            g.setColor(Color.BLUE);
+            g.drawString(String.format("Scale: [%2.1f, %2.1f]", scaleX, scaleY),
+                    r.x + r.width / 8, r.y + r.height / 2);
+
+        }
+
+        g.dispose();
+
+        return img;
+    }
+}
diff --git a/jdk/test/java/awt/Robot/HiDPIScreenCapture/ScreenCaptureResolutionTest.java b/jdk/test/java/awt/Robot/HiDPIScreenCapture/ScreenCaptureResolutionTest.java
new file mode 100644
index 0000000..ef1ac71
--- /dev/null
+++ b/jdk/test/java/awt/Robot/HiDPIScreenCapture/ScreenCaptureResolutionTest.java
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /*
+ * @test
+ * @bug 8162959
+ * @summary Visually validate multiresolution screencapture.
+ * @run main/othervm/manual -Dsun.java2d.uiScale=2 ScreenCaptureResolutionTest
+ */
+import java.awt.AWTException;
+import java.awt.Color;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.util.concurrent.CountDownLatch;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.concurrent.TimeUnit;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import java.awt.Robot;
+import java.awt.image.BufferedImage;
+import java.util.List;
+import java.awt.Image;
+import java.awt.image.MultiResolutionImage;
+
+public class ScreenCaptureResolutionTest {
+
+    public static void main(String args[]) throws Exception {
+
+        final CountDownLatch latch = new CountDownLatch(1);
+        TestUI test = new TestUI(latch);
+
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    test.createUI();
+                } catch (Exception ex) {
+                    throw new RuntimeException("Exception while creating UI");
+                }
+            }
+        });
+        latch.await(3, TimeUnit.SECONDS);
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    test.validateScreenCapture();
+                } catch (Exception ex) {
+                    throw new RuntimeException("Exception while"
+                        + " validating ScreenCapture");
+                }
+            }
+        });
+        boolean status = latch.await(5, TimeUnit.MINUTES);
+        if (!status) {
+            System.out.println("Test timed out.");
+        }
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    test.disposeUI();
+                } catch (Exception ex) {
+                    throw new RuntimeException("Exception while disposing UI");
+                }
+            }
+        });
+
+        if (test.testResult == false) {
+            throw new RuntimeException("Test Failed.");
+        }
+    }
+}
+
+class TestUI {
+
+    private static JFrame mainFrame;
+    private static JFrame outputImageFrame;
+    private static JFrame inputImageFrame;
+    private static JPanel outputControlPanel;
+    private static JPanel mainControlPanel;
+
+    private static JTextArea instructionTextArea;
+
+    private static JPanel inputImagePanel;
+    private static JPanel resultButtonPanel;
+    private static JButton passButton;
+    private static JButton failButton;
+
+    private static GridBagLayout layout;
+    private final CountDownLatch latch;
+    public boolean testResult = false;
+
+    public TestUI(CountDownLatch latch) throws Exception {
+        this.latch = latch;
+    }
+
+    public void validateScreenCapture() throws AWTException {
+        Robot robot = new Robot();
+        outputControlPanel = new JPanel(layout);
+        GridBagConstraints ogbc = new GridBagConstraints();
+
+        MultiResolutionImage image
+                = robot.createMultiResolutionScreenCapture(inputImageFrame.getBounds());
+        List<Image> imageList = image.getResolutionVariants();
+        int size = imageList.size();
+        BufferedImage lowResImage = (BufferedImage) imageList.get(0);
+        BufferedImage highResImage = (BufferedImage) imageList.get(1);
+
+        outputImageFrame = new JFrame("Output");
+        outputImageFrame.getContentPane().setLayout(new GridBagLayout());
+        ogbc.gridx = 0;
+        ogbc.gridy = 0;
+        ogbc.fill = GridBagConstraints.HORIZONTAL;
+        outputControlPanel.add(new JLabel(new ImageIcon(lowResImage)), ogbc);
+        int width = lowResImage.getWidth();
+        int height = lowResImage.getHeight();
+        JLabel labelImg1 = new JLabel("LEFT:Width: " + width
+                                      + " Height: " + height);
+        ogbc.gridx = 0;
+        ogbc.gridy = 1;
+        outputControlPanel.add(labelImg1, ogbc);
+        ogbc.gridx = 1;
+        ogbc.gridy = 0;
+        outputControlPanel.add(new JLabel(new ImageIcon(highResImage)), ogbc);
+        width = highResImage.getWidth();
+        height = highResImage.getHeight();
+        JLabel labelImg2 = new JLabel("RIGHT:Width: " + width
+                                      + " Height: " + height);
+        ogbc.gridx = 1;
+        ogbc.gridy = 1;
+        outputControlPanel.add(labelImg2, ogbc);
+        outputControlPanel.setBackground(Color.GRAY);
+        outputImageFrame.add(outputControlPanel);
+
+        outputImageFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        outputImageFrame.setBounds(600, 0, 400, 300);
+        outputImageFrame.setLocationRelativeTo(null);
+        outputImageFrame.setVisible(true);
+    }
+
+    public final void createUI() throws Exception {
+
+        mainFrame = new JFrame("ScreenCaptureResolutionTest");
+
+        layout = new GridBagLayout();
+        mainControlPanel = new JPanel(layout);
+        resultButtonPanel = new JPanel(layout);
+
+        GridBagConstraints gbc = new GridBagConstraints();
+
+        // Create Test instructions
+        String instructions
+                = "INSTRUCTIONS:"
+                + "\n Test to Visually validate MultiResolutionn Image. "
+                + "\n 1. Check if output window contains two screenshot "
+                + "\n    of input window. "
+                + "\n 2. Right image should be twice the size of Left. "
+                + "\n 3. Quality of Right image should be better than Left. "
+                + "\n If all the three conditons are satisfied, then "
+                + "\n click pass else fail.";
+        instructionTextArea = new JTextArea();
+        instructionTextArea.setText(instructions);
+        instructionTextArea.setEnabled(false);
+        instructionTextArea.setDisabledTextColor(Color.black);
+        instructionTextArea.setBackground(Color.white);
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(instructionTextArea, gbc);
+
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+
+        inputImagePanel = new JPanel(layout);
+        JLabel label = new JLabel("Resolution");
+        inputImagePanel.add(label);
+        inputImageFrame = new JFrame("Input");
+        inputImageFrame.add(inputImagePanel);
+
+        inputImageFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        inputImageFrame.setBounds(100, 200, 100, 100);
+        inputImageFrame.setVisible(true);
+
+        passButton = new JButton("Pass");
+        passButton.setActionCommand("Pass");
+        passButton.addActionListener((ActionEvent e) -> {
+            outputImageFrame.dispose();
+            inputImageFrame.dispose();
+            testResult = true;
+            mainFrame.dispose();
+            latch.countDown();
+
+        });
+        failButton = new JButton("Fail");
+        failButton.setActionCommand("Fail");
+        failButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                outputImageFrame.dispose();
+                inputImageFrame.dispose();
+                testResult = false;
+                mainFrame.dispose();
+                latch.countDown();
+            }
+        });
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        resultButtonPanel.add(passButton, gbc);
+        gbc.gridx = 1;
+        gbc.gridy = 0;
+        resultButtonPanel.add(failButton, gbc);
+
+        gbc.gridx = 0;
+        gbc.gridy = 2;
+        mainControlPanel.add(resultButtonPanel, gbc);
+
+        mainFrame.add(mainControlPanel);
+        mainFrame.pack();
+        mainFrame.setVisible(true);
+    }
+
+    public void disposeUI() {
+        outputImageFrame.dispose();
+        inputImageFrame.dispose();
+        mainFrame.setVisible(false);
+        mainFrame.dispose();
+    }
+
+}
diff --git a/jdk/test/java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java b/jdk/test/java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java
new file mode 100644
index 0000000..7be3a91
--- /dev/null
+++ b/jdk/test/java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /*
+ * @test
+ * @bug 8162959
+ * @summary Validate output of createMultiResolutionScreenCapture
+ *          new API which returns MultiResolutionImage.
+ * @run main/othervm -Dsun.java2d.uiScale=1 ScreenCaptureTest
+ * @run main/othervm -Dsun.java2d.uiScale=2 ScreenCaptureTest
+ */
+import java.awt.Dimension;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.awt.image.MultiResolutionImage;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Color;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Panel;
+import java.awt.Robot;
+import java.util.List;
+
+public class ScreenCaptureTest {
+
+    private static Robot robot;
+    private static Frame frame;
+    private static boolean isHiDPI = true;
+    private static final Color[] COLORS = {
+        Color.GREEN, Color.BLUE, Color.ORANGE, Color.RED};
+
+    public static void main(String[] args) throws Exception {
+
+        frame = new Frame();
+        frame.setBounds(0, 0, 400, 400);
+        frame.setUndecorated(true);
+        robot = new Robot();
+        Panel panel = new Panel(new BorderLayout());
+        Canvas canvas = new Canvas() {
+            public void paint(Graphics g) {
+                super.paint(g);
+                int w = getWidth();
+                int h = getHeight();
+                g.setColor(COLORS[0]);
+                g.fillRect(0, 0, w / 2, h / 2);
+                g.setColor(COLORS[1]);
+                g.fillRect(w / 2, 0, w / 2, h / 2);
+                g.setColor(COLORS[2]);
+                g.fillRect(0, h / 2, w / 2, h / 2);
+                g.setColor(COLORS[3]);
+                g.fillRect(w / 2, h / 2, w / 2, h / 2);
+            }
+        };
+
+        panel.add(canvas);
+        frame.add(panel);
+        frame.setVisible(true);
+        robot.delay(500);
+        robot.waitForIdle();
+
+        int w = frame.getWidth();
+        int h = frame.getHeight();
+
+        // getPixelColor Test
+        // Check pixel color in first quardant GREEN; x=100, y=100
+        if (!robot.getPixelColor(w / 4, h / 4).equals(COLORS[0])) {
+            throw new RuntimeException("Wrong Pixel Color! Expected GREEN");
+        }
+        // Check pixel color in second quardant; BLUE, x=300, y=100
+        if (!robot.getPixelColor(3 * w / 4, h / 4).equals(COLORS[1])) {
+            throw new RuntimeException("Wrong Pixel Color! Expected BLUE");
+        }
+        // Check pixel color in third quardant; ORANGE, x=100, y=300
+        if (!robot.getPixelColor(w / 4, 3 * h / 4).equals(COLORS[2])) {
+            throw new RuntimeException("Wrong Pixel Color! Expected ORANGE");
+        }
+        // Check pixel color in fourth quardant; RED, x=300, y=300
+        if (!robot.getPixelColor(3 * w / 4, 3 * h / 4).equals(COLORS[3])) {
+            throw new RuntimeException("Wrong Pixel Color! Expected RED");
+        }
+
+        // createScreenCaptureTest
+        AffineTransform tx = GraphicsEnvironment.getLocalGraphicsEnvironment()
+                .getDefaultScreenDevice().getDefaultConfiguration()
+                .getDefaultTransform();
+
+        if (tx.getScaleX() == 1 && tx.getScaleY() == 1) {
+            isHiDPI = false;
+        }
+
+        MultiResolutionImage image
+                = robot.createMultiResolutionScreenCapture(frame.getBounds());
+        List<Image> imageList = image.getResolutionVariants();
+        int size = imageList.size();
+        BufferedImage lowResImage;
+        BufferedImage highResImage;
+
+        if (!isHiDPI) {
+            // Check if output is MultiResolutionImage with one variant
+            if (size != 1) {
+                throw new RuntimeException(" Invalid variant size");
+            }
+
+            lowResImage = (BufferedImage) imageList.get(0);
+            System.out.println(frame.getBounds());
+            System.out.println(lowResImage.getWidth()+" "+lowResImage.getHeight());
+            if (frame.getWidth() != lowResImage.getWidth()
+                        || frame.getHeight() != lowResImage.getHeight()) {
+                throw new RuntimeException(" Invalid Image size");
+            }
+
+        } else {
+            // Check if output contains two variants.
+            if (size != 2) {
+                throw new RuntimeException(" Invalid variant size");
+            }
+
+            // Check if hight resolution image size is scale times low resolution image.
+            lowResImage = (BufferedImage) imageList.get(0);
+            highResImage = (BufferedImage) imageList.get(1);
+
+            int lW = (int) lowResImage.getWidth();
+            int lH = (int) lowResImage.getHeight();
+            int hW = (int) highResImage.getWidth();
+            int hH = (int) highResImage.getHeight();
+
+            if ( hW != (tx.getScaleX() * lW) || hH != (tx.getScaleY() * lH)) {
+                throw new RuntimeException(" Invalid Resolution Variants");
+            }
+
+            // Check if both image colors are same at some location.
+            if (lowResImage.getRGB(lW / 4, lH / 4)
+                    != highResImage.getRGB(hW / 4, hH / 4)) {
+                throw new RuntimeException("Wrong image color!");
+            }
+
+            if (lowResImage.getRGB(3 * lW / 4, lH / 4)
+                    != highResImage.getRGB(3 * hW / 4, hH / 4)) {
+                throw new RuntimeException("Wrong image color!");
+            }
+
+            if (lowResImage.getRGB(lW / 4, 3 * lH / 4)
+                    != highResImage.getRGB(hW / 4, 3 * hH / 4)) {
+                throw new RuntimeException("Wrong image color!");
+            }
+
+            if (lowResImage.getRGB(3 * lW / 4, 3 * lH / 4)
+                    != highResImage.getRGB(3 * hW / 4, 3 * hH / 4)) {
+                throw new RuntimeException("Wrong image color!");
+            }
+
+        }
+
+        frame.dispose();
+    }
+
+}
diff --git a/jdk/test/java/awt/Robot/MultiScreenRobotPosition/MultiScreenRobotPosition.java b/jdk/test/java/awt/Robot/MultiScreenRobotPosition/MultiScreenRobotPosition.java
new file mode 100644
index 0000000..eb9d1b2f
--- /dev/null
+++ b/jdk/test/java/awt/Robot/MultiScreenRobotPosition/MultiScreenRobotPosition.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+/**
+ * @test
+ * @bug 8176009
+ */
+public class MultiScreenRobotPosition {
+
+    private static volatile boolean fail = true;
+
+    public static void main(String[] args) throws Exception {
+        GraphicsDevice[] sds = GraphicsEnvironment.getLocalGraphicsEnvironment()
+                                                  .getScreenDevices();
+        for (final GraphicsDevice gd : sds) {
+            fail = true;
+            Robot robot = new Robot(gd);
+            robot.setAutoDelay(100);
+            robot.setAutoWaitForIdle(true);
+
+            Frame frame = new Frame(gd.getDefaultConfiguration());
+            frame.setUndecorated(true);
+            frame.setSize(400, 400);
+            frame.setVisible(true);
+            robot.waitForIdle();
+
+            frame.addMouseListener(new MouseAdapter() {
+                @Override
+                public void mouseClicked(MouseEvent e) {
+                    System.out.println("e = " + e);
+                    fail = false;
+                }
+            });
+
+            Rectangle bounds = frame.getBounds();
+            robot.mouseMove(bounds.x + bounds.width / 2,
+                            bounds.y + bounds.height / 2);
+            robot.mousePress(MouseEvent.BUTTON1_DOWN_MASK);
+            robot.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK);
+            frame.dispose();
+            if (fail) {
+                System.err.println("Frame bounds = " + bounds);
+                throw new RuntimeException("Click in the wrong location");
+            }
+        }
+    }
+}
diff --git a/jdk/test/java/awt/SplashScreen/FullscreenAfterSplash/FullScreenAfterSplash.java b/jdk/test/java/awt/SplashScreen/FullscreenAfterSplash/FullScreenAfterSplash.java
index 6419ea9..afe9422 100644
--- a/jdk/test/java/awt/SplashScreen/FullscreenAfterSplash/FullScreenAfterSplash.java
+++ b/jdk/test/java/awt/SplashScreen/FullscreenAfterSplash/FullScreenAfterSplash.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,8 @@
 * questions.
 */
 
-import jdk.testlibrary.OSInfo;
-import java.awt.*;
+import java.awt.Point;
+import java.awt.Window;
 import java.awt.Robot;
 import java.awt.event.InputEvent;
 import java.lang.InterruptedException;
@@ -30,7 +30,9 @@
 import java.lang.Thread;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
-import javax.swing.*;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
 
 /*
  * @test
@@ -41,7 +43,6 @@
  * @library ../../../../lib/testlibrary
  * @modules java.desktop/sun.awt
  *          java.desktop/com.apple.eawt
- * @build jdk.testlibrary.OSInfo
  * @build GenerateTestImage
  * @run main GenerateTestImage
  * @author Petr Pchelko area=awt.event
@@ -56,10 +57,6 @@
 
     public static void main(String[] args) throws Exception {
 
-        if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
-            System.out.println("The test is applicable only to Mac OS X. Passed");
-            return;
-        }
         try {
             //Move the mouse out, because it could interfere with the test.
             Robot r = new Robot();
@@ -71,7 +68,10 @@
             sleep();
 
             Point fullScreenButtonPos = frame.getLocation();
-            fullScreenButtonPos.translate(frame.getWidth() - 10, 10);
+            if(System.getProperty("os.version").equals("10.9"))
+                fullScreenButtonPos.translate(frame.getWidth() - 10, frame.getHeight()/2);
+            else
+                fullScreenButtonPos.translate(55,frame.getHeight()/2);
             r.mouseMove(fullScreenButtonPos.x, fullScreenButtonPos.y);
 
             //Cant use waitForIdle for full screen transition.
diff --git a/jdk/test/java/awt/SplashScreen/GenerateTestImage.java b/jdk/test/java/awt/SplashScreen/GenerateTestImage.java
index 9c06133..93def33 100644
--- a/jdk/test/java/awt/SplashScreen/GenerateTestImage.java
+++ b/jdk/test/java/awt/SplashScreen/GenerateTestImage.java
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,8 @@
 */
 
 import javax.imageio.ImageIO;
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Graphics2D;
 import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -34,16 +35,16 @@
     private static final int IMAGE_SIZE = 20;
 
     public static void main(String[] args) throws Exception {
-        String path = System.getProperty("test.classes") + File.separator + "test.png";
-
+        File file = new File("test.png");
+        if (file.exists()) {
+            return;
+        }
         BufferedImage image = new BufferedImage(IMAGE_SIZE, IMAGE_SIZE, BufferedImage.TYPE_INT_ARGB);
         Graphics2D graphics2D = image.createGraphics();
         graphics2D.setColor(Color.red);
         graphics2D.fillOval(0, 0, IMAGE_SIZE, IMAGE_SIZE);
         graphics2D.dispose();;
 
-        try(FileOutputStream fos = new FileOutputStream(path)) {
-            ImageIO.write(image, "png", fos);
-        }
+       ImageIO.write(image, "png", file);
     }
 }
diff --git a/jdk/test/java/awt/TextField/DisabledUndoTest/DisabledUndoTest.java b/jdk/test/java/awt/TextField/DisabledUndoTest/DisabledUndoTest.java
new file mode 100644
index 0000000..4590b7b
--- /dev/null
+++ b/jdk/test/java/awt/TextField/DisabledUndoTest/DisabledUndoTest.java
@@ -0,0 +1,266 @@
+/*
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /*
+ * @test
+ * @key headful
+ * @bug 4302718 6753165 8177386
+ * @summary verifies that undo does not work in a disabled TextField on windows
+ * @requires (os.family == "windows")
+ * @run main/manual DisabledUndoTest
+ */
+import java.awt.Button;
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.awt.Panel;
+import java.awt.TextArea;
+import java.awt.TextField;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class DisabledUndoTest {
+
+    private static void init() throws Exception {
+        String[] instructions
+            = {
+                "1.Type a few symbols in the textfield.",
+                "2.Right-click on the textfield to invoke context menu and select \"Undo\". Make sure the typed symbol is undone.",
+                "3.Then click the button Disable textfield to disable the textfield.",
+                "4.Right-click on the textfield to invoke context menu.Verify that Undo option is disabled in context menu and you can't undo the text",
+                "5.If they are not, press Pass, else press Fail."
+                };
+
+        Sysout.createDialog();
+        Sysout.printInstructions(instructions);
+    }
+
+    static Frame mainFrame;
+    static Button bt;
+    static TextField tf;
+    static Panel p1;
+
+    public static void initTestWindow() {
+        mainFrame = new Frame();
+        p1 = new Panel();
+        mainFrame.setTitle("TestWindow");
+        mainFrame.setBounds(700, 10, 400, 100);
+
+        tf = new TextField(20);
+        tf.select(0, 10);
+        bt = new Button("Disable textfield");
+        p1.add(tf);
+        p1.add(bt);
+        mainFrame.add(p1);
+        bt.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent ae) {
+                tf.setEditable(false);
+            }
+        });
+        mainFrame.setVisible(true);
+    }
+
+    public static void dispose() {
+        Sysout.dispose();
+        mainFrame.dispose();
+    }
+
+    /**
+     * ***************************************************
+     * Standard Test Machinery Section DO NOT modify anything in this section --
+     * it's a standard chunk of code which has all of the synchronisation
+     * necessary for the test harness. By keeping it the same in all tests, it
+     * is easier to read and understand someone else's test, as well as insuring
+     * that all tests behave correctly with the test harness. There is a section
+     * following this for test-defined classes
+     * ****************************************************
+     */
+    private static boolean theTestPassed = false;
+    private static boolean testGeneratedInterrupt = false;
+    private static String failureMessage = "";
+    private static Thread mainThread = null;
+    final private static int sleepTime = 300000;
+
+    public static void main(String args[]) throws Exception {
+        mainThread = Thread.currentThread();
+        try {
+            init();
+            initTestWindow();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        try {
+            mainThread.sleep(sleepTime);
+        } catch (InterruptedException e) {
+            dispose();
+            if (testGeneratedInterrupt && !theTestPassed) {
+                throw new Exception(failureMessage);
+            }
+        }
+        if (!testGeneratedInterrupt) {
+            dispose();
+            throw new RuntimeException("Timed out after " + sleepTime / 1000
+                    + " seconds");
+        }
+    }
+
+    public static synchronized void pass() {
+        theTestPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }
+
+    public static synchronized void fail(String whyFailed) {
+        theTestPassed = false;
+        testGeneratedInterrupt = true;
+        failureMessage = whyFailed;
+        mainThread.interrupt();
+    }
+}
+
+// *********** End Standard Test Machinery Section **********
+/**
+ * **************************************************
+ * Standard Test Machinery DO NOT modify anything below -- it's a standard chunk
+ * of code whose purpose is to make user interaction uniform, and thereby make
+ * it simpler to read and understand someone else's test.
+ * **************************************************
+ */
+/**
+ * This is part of the standard test machinery. It creates a dialog (with the
+ * instructions), and is the interface for sending text messages to the user. To
+ * print the instructions, send an array of strings to Sysout.createDialog
+ * WithInstructions method. Put one line of instructions per array entry. To
+ * display a message for the tester to see, simply call Sysout.println with the
+ * string to be displayed. This mimics System.out.println but works within the
+ * test harness as well as standalone.
+ */
+class Sysout {
+
+    private static TestDialog dialog;
+    private static Frame frame;
+
+    public static void createDialog() {
+        frame = new Frame();
+        dialog = new TestDialog(frame, "Instructions");
+        String[] defInstr = {"Instructions will appear here. ", ""};
+        dialog.printInstructions(defInstr);
+        dialog.show();
+        println("Any messages for the tester will display here.");
+    }
+
+    public static void printInstructions(String[] instructions) {
+        dialog.printInstructions(instructions);
+    }
+
+    public static void println(String messageIn) {
+        dialog.displayMessage(messageIn);
+    }
+
+    public static void dispose() {
+        dialog.dispose();
+        frame.dispose();
+    }
+}
+
+/**
+ * This is part of the standard test machinery. It provides a place for the test
+ * instructions to be displayed, and a place for interactive messages to the
+ * user to be displayed. To have the test instructions displayed, see Sysout. To
+ * have a message to the user be displayed, see Sysout. Do not call anything in
+ * this dialog directly.
+ */
+class TestDialog extends Dialog implements ActionListener {
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+    Panel buttonP;
+    Button failB;
+    Button passB;
+
+    // DO NOT call this directly, go through Sysout
+    public TestDialog(Frame frame, String name) {
+        super(frame, name);
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea("", 15, maxStringLength, scrollBoth);
+        add("North", instructionsText);
+
+        messageText = new TextArea("", 5, maxStringLength, scrollBoth);
+        add("Center", messageText);
+
+        buttonP = new Panel();
+        failB = new Button("Fail");
+        failB.setActionCommand("fail");
+        failB.addActionListener(this);
+        passB = new Button("Pass");
+        buttonP.add(passB);
+        buttonP.add(failB);
+        passB.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent ae) {
+                DisabledUndoTest.pass();
+            }
+        });
+
+        add("South", buttonP);
+        pack();
+        setVisible(true);
+    }
+
+    // DO NOT call this directly, go through Sysout
+    public void printInstructions(String[] instructions) {
+        instructionsText.setText("");
+        String printStr, remainingStr;
+        for (int i = 0; i < instructions.length; i++) {
+            remainingStr = instructions[i];
+            while (remainingStr.length() > 0) {
+                if (remainingStr.length() >= maxStringLength) {
+                    int posOfSpace = remainingStr.
+                            lastIndexOf(' ', maxStringLength - 1);
+
+                    if (posOfSpace <= 0) {
+                        posOfSpace = maxStringLength - 1;
+                    }
+
+                    printStr = remainingStr.substring(0, posOfSpace + 1);
+                    remainingStr = remainingStr.substring(posOfSpace + 1);
+                } else {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+                instructionsText.append(printStr + "\n");
+            }
+        }
+    }
+
+    public void displayMessage(String messageIn) {
+        messageText.append(messageIn + "\n");
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        if (e.getActionCommand() == "fail") {
+            DisabledUndoTest.fail("User Clicked Fail");
+        }
+    }
+}
diff --git a/jdk/test/java/awt/Toolkit/IsToolkitUseTheMainScreen/IsToolkitUseTheMainScreen.java b/jdk/test/java/awt/Toolkit/IsToolkitUseTheMainScreen/IsToolkitUseTheMainScreen.java
new file mode 100644
index 0000000..ca63d12
--- /dev/null
+++ b/jdk/test/java/awt/Toolkit/IsToolkitUseTheMainScreen/IsToolkitUseTheMainScreen.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Dimension;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+import java.awt.Toolkit;
+import java.awt.image.ColorModel;
+
+/**
+ * @test
+ * @bug 8168307
+ * @run main/othervm IsToolkitUseTheMainScreen
+ * @run main/othervm -Djava.awt.headless=true IsToolkitUseTheMainScreen
+ */
+public final class IsToolkitUseTheMainScreen {
+
+    public static void main(final String[] args) {
+        if (GraphicsEnvironment.isHeadless()) {
+            testHeadless();
+        } else {
+            testHeadful();
+        }
+    }
+
+    private static void testHeadless() {
+        try {
+            Toolkit.getDefaultToolkit().getScreenSize();
+            throw new RuntimeException("HeadlessException is not thrown");
+        } catch (final HeadlessException ignored) {
+            // expected exception
+        }
+        try {
+            Toolkit.getDefaultToolkit().getColorModel();
+            throw new RuntimeException("HeadlessException is not thrown");
+        } catch (final HeadlessException ignored) {
+            // expected exception
+        }
+    }
+
+    private static void testHeadful() {
+        GraphicsEnvironment ge
+                = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsConfiguration gc
+                = ge.getDefaultScreenDevice().getDefaultConfiguration();
+        Dimension gcSize = gc.getBounds().getSize();
+        ColorModel gcCM = gc.getColorModel();
+
+        Dimension toolkitSize = Toolkit.getDefaultToolkit().getScreenSize();
+        ColorModel toolkitCM = Toolkit.getDefaultToolkit().getColorModel();
+
+        if (!gcSize.equals(toolkitSize)) {
+            System.err.println("Toolkit size = " + toolkitSize);
+            System.err.println("GraphicsConfiguration size = " + gcSize);
+            throw new RuntimeException("Incorrect size");
+        }
+        if (!gcCM.equals(toolkitCM)) {
+            System.err.println("Toolkit color model = " + toolkitCM);
+            System.err.println("GraphicsConfiguration color model = " + gcCM);
+            throw new RuntimeException("Incorrect color model");
+        }
+    }
+}
diff --git a/jdk/test/java/awt/TrayIcon/SystemTrayIconHelper.java b/jdk/test/java/awt/TrayIcon/SystemTrayIconHelper.java
index 1fcf281..e8529a3 100644
--- a/jdk/test/java/awt/TrayIcon/SystemTrayIconHelper.java
+++ b/jdk/test/java/awt/TrayIcon/SystemTrayIconHelper.java
@@ -81,7 +81,7 @@
             try {
                 // sun.lwawt.macosx.CTrayIcon
                 Field f_peer = getField( java.awt.TrayIcon.class, "peer");
-                Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.reflect.Module.class);
+                Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.Module.class);
                 m_addExports.invoke(null, "sun.lwawt.macosx", robot.getClass().getModule());
 
 
@@ -105,7 +105,7 @@
         } else {
             try {
                 // sun.awt.X11.XTrayIconPeer
-                Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.reflect.Module.class);
+                Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.Module.class);
                 m_addExports.invoke(null, "sun.awt.X11", robot.getClass().getModule());
 
                 Field f_peer = getField(java.awt.TrayIcon.class, "peer");
diff --git a/jdk/test/java/awt/Window/WindowDeadlockTest/WindowDeadlockTest.java b/jdk/test/java/awt/Window/WindowDeadlockTest/WindowDeadlockTest.java
new file mode 100644
index 0000000..01e4783
--- /dev/null
+++ b/jdk/test/java/awt/Window/WindowDeadlockTest/WindowDeadlockTest.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176490
+ * @summary Tests that there is no hang or deadlock when the visibility
+ *      of parent and child windows is changed.
+ * @library ../../regtesthelpers
+ * @build Util
+ * @run main/timeout=20 WindowDeadlockTest
+ */
+
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.awt.Robot;
+
+import test.java.awt.regtesthelpers.Util;
+
+public class WindowDeadlockTest {
+    public static void main(String[] args) throws Exception {
+        Robot robot = Util.createRobot();
+
+        Frame main = new Frame("Main");
+        main.setBounds(0, 0, 200, 100);
+        main.setVisible(true);
+
+        Dialog first = new Dialog(main, "First");
+        first.setBounds(250, 0, 200, 100);
+        first.setVisible(true);
+
+        Dialog second = new Dialog(first, "Second");
+        second.setBounds(0, 150, 200, 100);
+        second.setVisible(true);
+
+        Util.waitForIdle(robot);
+        robot.delay(2000);
+
+        Dialog third = new Dialog(first, "Third", false);
+        third.setBounds(250, 150, 200, 100);
+        third.setVisible(true);
+        first.setVisible(false); // the hang takes place here
+
+        Util.waitForIdle(robot);
+        robot.delay(2000);
+
+        third.dispose();
+        second.dispose();
+        first.dispose();
+        main.dispose();
+    }
+}
diff --git a/jdk/test/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnDPIChangingTest.java b/jdk/test/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnDPIChangingTest.java
new file mode 100644
index 0000000..e796359
--- /dev/null
+++ b/jdk/test/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnDPIChangingTest.java
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.HeadlessException;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.Panel;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.image.AbstractMultiResolutionImage;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
+/* @test
+ * @bug 8147440 8147016
+ * @summary HiDPI (Windows): Swing components have incorrect sizes after
+ *          changing display resolution
+ * @run main/manual/othervm WindowResizingOnDPIChangingTest
+ */
+public class WindowResizingOnDPIChangingTest {
+
+    private static volatile boolean testResult = false;
+    private static volatile CountDownLatch countDownLatch;
+    private static TestFrame undecoratedFrame;
+    private static TestFrame decoratedFrame;
+    private static JFrame mainFrame;
+
+    private static final String INSTRUCTIONS = "INSTRUCTIONS:\n"
+            + "Verify that window is properly resized after the display DPI updating.\n"
+            + "\n"
+            + "The test is applicable for OSes that allows to change the display DPI\n"
+            + "without the system rebooting (like Windows 8.1 and higher). Press PASS for other\n"
+            + "systems. \n"
+            + "\n"
+            + "1. Set the display DPI size to 192 (DPI scale factor 200%)\n"
+            + "2. Press Show Frames button\n"
+            + "Two frames decorated and undecorated appear.\n"
+            + "3. Check that the string \"scale 2x\" is painted on the windows.\n"
+            + "4. Set the display DPI size to 96 (DPI scale factor 100%)\n"
+            + "5. Check that the string \"scale: 1x\" is painted on the windows.\n"
+            + "6. Check that the windows are properly resized in the same way as native applications\n"
+            + "7. Check that the windows are properly repainted and do not contain drawing artifacts\n"
+            + "If so, press PASS, else press FAIL.\n";
+
+    public static void main(String args[]) throws Exception {
+
+        countDownLatch = new CountDownLatch(1);
+        SwingUtilities.invokeLater(WindowResizingOnDPIChangingTest::createUI);
+        countDownLatch.await(15, TimeUnit.MINUTES);
+        if (!testResult) {
+            throw new RuntimeException("Test fails!");
+        }
+    }
+
+    private static void createUI() {
+
+        mainFrame = new JFrame("DPI change test");
+        GridBagLayout layout = new GridBagLayout();
+        JPanel mainControlPanel = new JPanel(layout);
+        JPanel resultButtonPanel = new JPanel(layout);
+
+        GridBagConstraints gbc = new GridBagConstraints();
+
+        JPanel testPanel = new JPanel(new FlowLayout());
+        JButton frameButton = new JButton("Show Frames");
+        frameButton.addActionListener((e) -> {
+            int x = 20;
+            int y = 10;
+            int w = 400;
+            int h = 300;
+
+            undecoratedFrame = new TestFrame(w, h, true);
+            undecoratedFrame.setLocation(x, y);
+            undecoratedFrame.setVisible(true);
+
+            decoratedFrame = new TestFrame(w, h, false);
+            decoratedFrame.setLocation(x + w + 10, y);
+            decoratedFrame.setVisible(true);
+
+        });
+        testPanel.add(frameButton);
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(testPanel, gbc);
+
+        JTextArea instructionTextArea = new JTextArea();
+        instructionTextArea.setText(INSTRUCTIONS);
+        instructionTextArea.setEditable(false);
+        instructionTextArea.setBackground(Color.white);
+
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(instructionTextArea, gbc);
+
+        JButton passButton = new JButton("Pass");
+        passButton.setActionCommand("Pass");
+        passButton.addActionListener((ActionEvent e) -> {
+            testResult = true;
+            disposeFrames();
+            countDownLatch.countDown();
+
+        });
+
+        JButton failButton = new JButton("Fail");
+        failButton.setActionCommand("Fail");
+        failButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                disposeFrames();
+                countDownLatch.countDown();
+            }
+        });
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        resultButtonPanel.add(passButton, gbc);
+
+        gbc.gridx = 1;
+        gbc.gridy = 0;
+        resultButtonPanel.add(failButton, gbc);
+
+        gbc.gridx = 0;
+        gbc.gridy = 2;
+        mainControlPanel.add(resultButtonPanel, gbc);
+
+        mainFrame.add(mainControlPanel);
+        mainFrame.pack();
+
+        mainFrame.addWindowListener(new WindowAdapter() {
+
+            @Override
+            public void windowClosing(WindowEvent e) {
+                disposeFrames();
+                countDownLatch.countDown();
+            }
+        });
+        mainFrame.setVisible(true);
+    }
+
+    private static void disposeFrames() {
+        if (decoratedFrame != null && decoratedFrame.isVisible()) {
+            decoratedFrame.dispose();
+        }
+        if (undecoratedFrame != null && undecoratedFrame.isVisible()) {
+            undecoratedFrame.dispose();
+        }
+        if (mainFrame != null && mainFrame.isVisible()) {
+            mainFrame.dispose();
+        }
+    }
+
+    static class TestFrame extends Frame {
+
+        private final TestMultiResolutionImage mrImage;
+
+        public TestFrame(int width, int height, boolean undecorated) throws HeadlessException {
+            super("Test Frame. Undecorated: " + undecorated);
+            setSize(width, height);
+            mrImage = new TestMultiResolutionImage(width, height);
+
+            setUndecorated(undecorated);
+            Panel panel = new Panel(new FlowLayout()) {
+                @Override
+                public void paint(Graphics g) {
+                    super.paint(g);
+                    AffineTransform tx = ((Graphics2D) g).getTransform();
+                    mrImage.scaleX = tx.getScaleX();
+                    mrImage.scaleY = tx.getScaleY();
+                    Insets insets = getInsets();
+                    g.drawImage(mrImage, insets.left, insets.bottom, null);
+                }
+            };
+            add(panel);
+        }
+    }
+
+    static class TestMultiResolutionImage extends AbstractMultiResolutionImage {
+
+        final int width;
+        final int height;
+        double scaleX;
+        double scaleY;
+
+        public TestMultiResolutionImage(int width, int height) {
+            this.width = width;
+            this.height = height;
+        }
+
+        @Override
+        public int getWidth(ImageObserver observer) {
+            return width;
+        }
+
+        @Override
+        public int getHeight(ImageObserver observer) {
+            return height;
+        }
+
+        @Override
+        protected Image getBaseImage() {
+            return getResolutionVariant(width, height);
+        }
+
+        @Override
+        public Image getResolutionVariant(double destImageWidth, double destImageHeight) {
+
+            int w = (int) destImageWidth;
+            int h = (int) destImageHeight;
+
+            BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+            Graphics2D g = img.createGraphics();
+            g.scale(scaleX, scaleY);
+            int red = (int) (255 / scaleX);
+            int green = (int) (250 / scaleX);
+            int blue = (int) (20 / scaleX);
+            g.setColor(new Color(red, green, blue));
+            g.fillRect(0, 0, width, height);
+
+            g.setColor(Color.decode("#87CEFA"));
+            Font f = g.getFont();
+            g.setFont(new Font(f.getName(), Font.BOLD, 24));
+            g.drawString(String.format("scales: [%1.2fx, %1.2fx]", scaleX, scaleY),
+                    width / 6, height / 2);
+
+            g.dispose();
+            return img;
+        }
+
+        @Override
+        public List<Image> getResolutionVariants() {
+            return Collections.unmodifiableList(Arrays.asList(getBaseImage()));
+        }
+    }
+}
diff --git a/jdk/test/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnMovingToAnotherDisplay.java b/jdk/test/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnMovingToAnotherDisplay.java
new file mode 100644
index 0000000..7c0035f
--- /dev/null
+++ b/jdk/test/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnMovingToAnotherDisplay.java
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.HeadlessException;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.Panel;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.image.AbstractMultiResolutionImage;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
+/* @test
+ * @bug 8147440 8147016
+ * @summary HiDPI (Windows): Swing components have incorrect sizes after
+ *          changing display resolution
+ * @run main/manual/othervm WindowResizingOnMovingToAnotherDisplay
+ */
+public class WindowResizingOnMovingToAnotherDisplay {
+
+    private static volatile boolean testResult = false;
+    private static volatile CountDownLatch countDownLatch;
+    private static TestFrame frame;
+    private static JFrame mainFrame;
+
+    private static final String INSTRUCTIONS = "INSTRUCTIONS:\n"
+            + "Verify that a window is properly resized after moving to a display"
+            + " with different DPI.\n"
+            + "\n"
+            + "The test is applicable for a multi-monitor system where displays"
+            + " are configured to have different DPI\n"
+            + "\n"
+            + "1. Press Show Frame button\n"
+            + "The frame appear.\n"
+            + "2. Check that the string \"scales [ScaleX, ScaleY]\" is painted on the window"
+            + " where ScaleX and ScaleY are the scales for current display.\n"
+            + "The scales are calculated as DPI / 96 and are 1 for the DPI value 96"
+            + " and 2 for the DPI value 192.\n"
+            + "3. Move the frame to the second display.\n"
+            + "4. Check that the string \"scales [ScaleX, ScaleY]\" is updated"
+            + " to show the right display scales.\n"
+            + "5. Check that the window  is properly resized.\n"
+            + "6. Check that the window is properly repainted and does not contain drawing artifacts\n"
+            + "Try different display positions (left, right, top, bottom).\n"
+            + "If all tests are passed, press PASS, else press FAIL.\n";
+
+    public static void main(String args[]) throws Exception {
+
+        countDownLatch = new CountDownLatch(1);
+        SwingUtilities.invokeLater(WindowResizingOnMovingToAnotherDisplay::createUI);
+        countDownLatch.await(15, TimeUnit.MINUTES);
+        if (!testResult) {
+            throw new RuntimeException("Test fails!");
+        }
+    }
+
+    private static void createUI() {
+
+        mainFrame = new JFrame("DPI change test");
+        GridBagLayout layout = new GridBagLayout();
+        JPanel mainControlPanel = new JPanel(layout);
+        JPanel resultButtonPanel = new JPanel(layout);
+
+        GridBagConstraints gbc = new GridBagConstraints();
+
+        JPanel testPanel = new JPanel(new FlowLayout());
+        JButton frameButton = new JButton("Show Frame");
+        frameButton.addActionListener((e) -> {
+            int x = 20;
+            int y = 10;
+            int w = 400;
+            int h = 300;
+
+            frame = new TestFrame(w, h);
+            frame.setLocation(x, y);
+            frame.setVisible(true);
+
+        });
+        testPanel.add(frameButton);
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(testPanel, gbc);
+
+        JTextArea instructionTextArea = new JTextArea();
+        instructionTextArea.setText(INSTRUCTIONS);
+        instructionTextArea.setEditable(false);
+        instructionTextArea.setBackground(Color.white);
+
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(instructionTextArea, gbc);
+
+        JButton passButton = new JButton("Pass");
+        passButton.setActionCommand("Pass");
+        passButton.addActionListener((ActionEvent e) -> {
+            testResult = true;
+            disposeFrames();
+            countDownLatch.countDown();
+
+        });
+
+        JButton failButton = new JButton("Fail");
+        failButton.setActionCommand("Fail");
+        failButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                disposeFrames();
+                countDownLatch.countDown();
+            }
+        });
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        resultButtonPanel.add(passButton, gbc);
+
+        gbc.gridx = 1;
+        gbc.gridy = 0;
+        resultButtonPanel.add(failButton, gbc);
+
+        gbc.gridx = 0;
+        gbc.gridy = 2;
+        mainControlPanel.add(resultButtonPanel, gbc);
+
+        mainFrame.add(mainControlPanel);
+        mainFrame.pack();
+
+        mainFrame.addWindowListener(new WindowAdapter() {
+
+            @Override
+            public void windowClosing(WindowEvent e) {
+                disposeFrames();
+                countDownLatch.countDown();
+            }
+        });
+        mainFrame.setVisible(true);
+    }
+
+    private static void disposeFrames() {
+        if (frame != null && frame.isVisible()) {
+            frame.dispose();
+        }
+
+        if (mainFrame != null && mainFrame.isVisible()) {
+            mainFrame.dispose();
+        }
+    }
+
+    static class TestFrame extends Frame {
+
+        private final TestMultiResolutionImage mrImage;
+
+        public TestFrame(int width, int height) throws HeadlessException {
+            super("Test Frame");
+            setSize(width, height);
+            mrImage = new TestMultiResolutionImage(width, height);
+
+            Panel panel = new Panel(new FlowLayout()) {
+                @Override
+                public void paint(Graphics g) {
+                    super.paint(g);
+                    AffineTransform tx = ((Graphics2D) g).getTransform();
+                    mrImage.scaleX = tx.getScaleX();
+                    mrImage.scaleY = tx.getScaleY();
+                    Insets insets = getInsets();
+                    g.drawImage(mrImage, insets.left, insets.bottom, null);
+                }
+            };
+            add(panel);
+        }
+    }
+
+    static class TestMultiResolutionImage extends AbstractMultiResolutionImage {
+
+        final int width;
+        final int height;
+        double scaleX;
+        double scaleY;
+
+        public TestMultiResolutionImage(int width, int height) {
+            this.width = width;
+            this.height = height;
+        }
+
+        @Override
+        public int getWidth(ImageObserver observer) {
+            return width;
+        }
+
+        @Override
+        public int getHeight(ImageObserver observer) {
+            return height;
+        }
+
+        @Override
+        protected Image getBaseImage() {
+            return getResolutionVariant(width, height);
+        }
+
+        @Override
+        public Image getResolutionVariant(double destImageWidth, double destImageHeight) {
+
+            int w = (int) destImageWidth;
+            int h = (int) destImageHeight;
+
+            BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+            Graphics2D g = img.createGraphics();
+            g.scale(scaleX, scaleY);
+            int red = (int) (255 / scaleX);
+            int green = (int) (250 / scaleX);
+            int blue = (int) (20 / scaleX);
+            g.setColor(new Color(red, green, blue));
+            g.fillRect(0, 0, width, height);
+
+            g.setColor(Color.decode("#87CEFA"));
+            Font f = g.getFont();
+            g.setFont(new Font(f.getName(), Font.BOLD, 24));
+            g.drawString(String.format("scales: [%1.2fx, %1.2fx]", scaleX, scaleY),
+                    width / 6, height / 2);
+
+            g.dispose();
+            return img;
+        }
+
+        @Override
+        public List<Image> getResolutionVariants() {
+            return Collections.unmodifiableList(Arrays.asList(getBaseImage()));
+        }
+    }
+}
diff --git a/jdk/test/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnSetLocationTest.java b/jdk/test/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnSetLocationTest.java
new file mode 100644
index 0000000..cd6fa58
--- /dev/null
+++ b/jdk/test/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnSetLocationTest.java
@@ -0,0 +1,393 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.BasicStroke;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.HeadlessException;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.image.AbstractMultiResolutionImage;
+import java.awt.image.BufferedImage;
+import java.awt.image.ImageObserver;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+
+/* @test
+ * @bug 8175293 8176097
+ * @summary Window set location to a display with different DPI does not properly work
+ * @run main/manual/othervm WindowResizingOnSetLocationTest
+ */
+public class WindowResizingOnSetLocationTest {
+
+    private static volatile boolean testResult = false;
+    private static volatile CountDownLatch countDownLatch;
+    private static TestFrame frame;
+    private static JFrame mainFrame;
+    private static Rectangle[] screenBounds;
+    private static double[][] scales;
+    private static int screen1 = -1;
+    private static int screen2 = -1;
+
+    private static final String INSTRUCTIONS = "INSTRUCTIONS:\n"
+            + "Verify that a window is properly resized after setting the location"
+            + " to a display with different DPI.\n"
+            + "\n"
+            + "The test is applicable for a multi-monitor system where displays"
+            + " are configured to have different DPI\n"
+            + "\n"
+            + "1. Press Show Frame button\n"
+            + "  (note that the button is disabled in case there are no two monitors"
+            + " with different DPI)\n"
+            + "The frame should appear in the center of the display (either"
+            + " on the first or on the second).\n"
+            + "2. Check that the string \"scales [ScaleX, ScaleY]\" is painted on the window"
+            + " where ScaleX and ScaleY are the scales for current display.\n"
+            + "The scales are calculated as DPI / 96 and are 1 for the DPI value 96"
+            + " and 2 for the DPI value 192.\n"
+            + "3. Press 'Move to another display' button.\n"
+            + "4. Check that the frame appears on the another display.\n"
+            + "5. Check that the string \"scales [ScaleX, ScaleY]\" is updated"
+            + " to show the right display scales.\n"
+            + "6. Check that the window is properly resized.\n"
+            + "7. Check that the window is properly repainted and does not contain drawing artifacts\n"
+            + "If all tests are passed, press PASS, else press FAIL.\n";
+
+    public static void main(String args[]) throws Exception {
+
+        countDownLatch = new CountDownLatch(1);
+        SwingUtilities.invokeLater(WindowResizingOnSetLocationTest::createUI);
+        countDownLatch.await(15, TimeUnit.MINUTES);
+        if (!testResult) {
+            throw new RuntimeException("Test fails!");
+        }
+    }
+
+    private static void createUI() {
+
+        initScreenBounds();
+
+        mainFrame = new JFrame("DPI change test");
+        GridBagLayout layout = new GridBagLayout();
+        JPanel mainControlPanel = new JPanel(layout);
+        JPanel resultButtonPanel = new JPanel(layout);
+
+        GridBagConstraints gbc = new GridBagConstraints();
+
+        JPanel testPanel = new JPanel(new BorderLayout());
+        JButton frameButton = new JButton("Show Frame");
+        frameButton.addActionListener((e) -> {
+            GraphicsConfiguration gc = GraphicsEnvironment
+                    .getLocalGraphicsEnvironment()
+                    .getScreenDevices()[screen1]
+                    .getDefaultConfiguration();
+
+            Rectangle rect = getCenterRect(screenBounds[screen2]);
+            frame = new TestFrame(gc, rect);
+            frame.setVisible(true);
+
+        });
+        frameButton.setEnabled(screen1 != -1 && screen2 != -1);
+        testPanel.add(getDisplaysComponent(), BorderLayout.CENTER);
+        testPanel.add(frameButton, BorderLayout.SOUTH);
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(testPanel, gbc);
+
+        JTextArea instructionTextArea = new JTextArea();
+        instructionTextArea.setText(INSTRUCTIONS);
+        instructionTextArea.setEditable(false);
+        instructionTextArea.setBackground(Color.white);
+
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        mainControlPanel.add(instructionTextArea, gbc);
+
+        JButton passButton = new JButton("Pass");
+        passButton.setActionCommand("Pass");
+        passButton.addActionListener((ActionEvent e) -> {
+            testResult = true;
+            disposeFrames();
+            countDownLatch.countDown();
+
+        });
+
+        JButton failButton = new JButton("Fail");
+        failButton.setActionCommand("Fail");
+        failButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                disposeFrames();
+                countDownLatch.countDown();
+            }
+        });
+
+        gbc.gridx = 0;
+        gbc.gridy = 0;
+        resultButtonPanel.add(passButton, gbc);
+
+        gbc.gridx = 1;
+        gbc.gridy = 0;
+        resultButtonPanel.add(failButton, gbc);
+
+        gbc.gridx = 0;
+        gbc.gridy = 2;
+        mainControlPanel.add(resultButtonPanel, gbc);
+
+        mainFrame.add(mainControlPanel);
+        mainFrame.pack();
+
+        mainFrame.addWindowListener(new WindowAdapter() {
+
+            @Override
+            public void windowClosing(WindowEvent e) {
+                disposeFrames();
+                countDownLatch.countDown();
+            }
+        });
+        mainFrame.setVisible(true);
+    }
+
+    private static void disposeFrames() {
+        if (frame != null && frame.isVisible()) {
+            frame.dispose();
+        }
+
+        if (mainFrame != null && mainFrame.isVisible()) {
+            mainFrame.dispose();
+        }
+    }
+
+    static void initScreenBounds() {
+
+        GraphicsDevice[] devices = GraphicsEnvironment
+                .getLocalGraphicsEnvironment()
+                .getScreenDevices();
+
+        screenBounds = new Rectangle[devices.length];
+        scales = new double[devices.length][2];
+        for (int i = 0; i < devices.length; i++) {
+            GraphicsConfiguration gc = devices[i].getDefaultConfiguration();
+            screenBounds[i] = gc.getBounds();
+            AffineTransform tx = gc.getDefaultTransform();
+            scales[i][0] = tx.getScaleX();
+            scales[i][1] = tx.getScaleY();
+        }
+
+        for (int i = 0; i < devices.length; i++) {
+            for (int j = i + 1; j < devices.length; j++) {
+                if (scales[i][0] != scales[j][0] || scales[i][1] != scales[j][1]) {
+                    screen1 = i;
+                    screen2 = j;
+                }
+            }
+        }
+    }
+
+    private static Rectangle getCenterRect(Rectangle rect) {
+        int w = rect.width / 2;
+        int h = rect.height / 2;
+        int x = rect.x + w / 2;
+        int y = rect.y + h / 2;
+
+        return new Rectangle(x, y, w, h);
+    }
+
+    static JComponent getDisplaysComponent() {
+
+        Rectangle rect = screenBounds[0];
+        for (int i = 0; i < screenBounds.length; i++) {
+            rect = rect.union(screenBounds[i]);
+        }
+
+        final BufferedImage img = new BufferedImage(rect.width, rect.height, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g = img.createGraphics();
+        g.setColor(Color.WHITE);
+        g.fillRect(0, 0, rect.width, rect.height);
+        g.translate(-rect.x, -rect.y);
+
+        g.setStroke(new BasicStroke(8f));
+        for (int i = 0; i < screenBounds.length; i++) {
+            Rectangle r = screenBounds[i];
+            g.setColor(Color.BLACK);
+            g.drawRect(r.x, r.y, r.width, r.height);
+
+            g.setColor(Color.ORANGE);
+            Rectangle cr = getCenterRect(r);
+            g.fillRect(cr.x, cr.y, cr.width, cr.height);
+
+            double scaleX = scales[i][0];
+            double scaleY = scales[i][1];
+            float fontSize = rect.height / 7;
+            g.setFont(g.getFont().deriveFont(fontSize));
+            g.setColor(Color.BLUE);
+            g.drawString(String.format("Scale: [%2.1f, %2.1f]", scaleX, scaleY),
+                    r.x + r.width / 8, r.y + r.height / 2);
+
+        }
+
+        g.dispose();
+
+        JPanel panel = new JPanel() {
+
+            @Override
+            public void paint(Graphics g) {
+                super.paint(g);
+                g.drawImage(img, 0, 0, getWidth(), getHeight(), this);
+
+            }
+        };
+
+        panel.setPreferredSize(new Dimension(400, 200));
+
+        return panel;
+    }
+
+    static class TestFrame extends JFrame {
+
+        private final TestMultiResolutionImage mrImage;
+
+        public TestFrame(GraphicsConfiguration gc, Rectangle rect) throws HeadlessException {
+            super(gc);
+            setBounds(rect);
+            mrImage = new TestMultiResolutionImage(rect.width, rect.height);
+
+            JPanel panel = new JPanel(new FlowLayout()) {
+                @Override
+                public void paint(Graphics g) {
+                    super.paint(g);
+                    AffineTransform tx = ((Graphics2D) g).getTransform();
+                    mrImage.scaleX = tx.getScaleX();
+                    mrImage.scaleY = tx.getScaleY();
+                    Insets insets = getInsets();
+                    g.drawImage(mrImage, insets.left, insets.bottom, null);
+                }
+            };
+
+            JButton button = new JButton("Move to another display");
+            button.addActionListener((e) -> {
+                GraphicsConfiguration config = getGraphicsConfiguration();
+
+                GraphicsDevice[] devices = GraphicsEnvironment
+                        .getLocalGraphicsEnvironment()
+                        .getScreenDevices();
+
+
+                int index = devices[screen1].getDefaultConfiguration().equals(config)
+                        ? screen2 : screen1;
+
+                Rectangle r = getCenterRect(screenBounds[index]);
+                frame.setBounds(r);
+            });
+
+            panel.add(button);
+            add(panel);
+        }
+    }
+
+    static class TestMultiResolutionImage extends AbstractMultiResolutionImage {
+
+        final int width;
+        final int height;
+        double scaleX;
+        double scaleY;
+
+        public TestMultiResolutionImage(int width, int height) {
+            this.width = width;
+            this.height = height;
+        }
+
+        @Override
+        public int getWidth(ImageObserver observer) {
+            return width;
+        }
+
+        @Override
+        public int getHeight(ImageObserver observer) {
+            return height;
+        }
+
+        @Override
+        protected Image getBaseImage() {
+            return getResolutionVariant(width, height);
+        }
+
+        @Override
+        public Image getResolutionVariant(double destImageWidth, double destImageHeight) {
+
+            int w = (int) destImageWidth;
+            int h = (int) destImageHeight;
+
+            BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+            Graphics2D g = img.createGraphics();
+            g.scale(scaleX, scaleY);
+            int red = (int) (255 / scaleX);
+            int green = (int) (250 / scaleX);
+            int blue = (int) (20 / scaleX);
+            g.setColor(new Color(red, green, blue));
+            g.fillRect(0, 0, width, height);
+
+            g.setColor(Color.decode("#87CEFA"));
+            Font f = g.getFont();
+            g.setFont(new Font(f.getName(), Font.BOLD, 24));
+            g.drawString(String.format("scales: [%1.2fx, %1.2fx]", scaleX, scaleY),
+                    width / 6, height / 2);
+
+            g.dispose();
+            return img;
+        }
+
+        @Override
+        public List<Image> getResolutionVariants() {
+            return Collections.unmodifiableList(Arrays.asList(getBaseImage()));
+        }
+    }
+}
diff --git a/jdk/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh b/jdk/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh
index 960c5bf..f2c5098 100644
--- a/jdk/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh
+++ b/jdk/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 #!/bin/ksh -p
 #
 #   @test    IOExceptionIfEncodedURLTest.sh
-#   @bug     6193279 6619458
+#   @bug     6193279 6619458 8137087
 #   @summary REGRESSION: AppletViewer throws IOException when path is encoded URL
 #   @author  Dmitry Cherepanov: area=appletviewer
 #   @modules java.base/sun.net.www
@@ -56,7 +56,7 @@
 #Call this to run the test with a file name
 test()
  {
-   ${TESTJAVA}${FILESEP}bin${FILESEP}appletviewer -Xnosecurity ${URL} > err 2>&1 &
+   "${TESTJAVA}"${FILESEP}bin${FILESEP}appletviewer -Xnosecurity ${URL} > err 2>&1 &
    APPLET_ID=$!
    sleep 15
    kill -9 $APPLET_ID
@@ -134,7 +134,9 @@
       DEFAULT_JDK="/cygdrive/c/Program\ Files/Java/jdk1.8.0"
       FILESEP="/"
       PATHSEP=";"
-      TMP=`cd "${SystemRoot}/Temp"; echo ${PWD}`
+      TMP=`cd "${SYSTEMROOT}/Temp"; echo ${PWD}`
+      x="cygpath -m $PWD"
+      PWD=$(eval $x)
       ;;
 
     AIX )
diff --git a/jdk/test/java/awt/font/Fallback/MissingGlyphTest.java b/jdk/test/java/awt/font/Fallback/MissingGlyphTest.java
new file mode 100644
index 0000000..564c587
--- /dev/null
+++ b/jdk/test/java/awt/font/Fallback/MissingGlyphTest.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ * @test
+ * @bug 8147002
+ * @summary  Verifies if Arabic character alef is rendered in osx
+ * @run main/manual MissingGlyphTest
+ */
+import java.awt.Font;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.JComponent;
+import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
+
+public class MissingGlyphTest {
+    private static Thread mainThread;
+    private static boolean testPassed;
+    private static boolean testGeneratedInterrupt;
+    private static JFrame frame;
+
+    public static void main(String[] args) throws Exception {
+        if (!System.getProperty("os.name").startsWith("Mac")) {
+            return;
+        }
+        SwingUtilities.invokeAndWait(() -> {
+            doTest(MissingGlyphTest::glyphTest);
+        });
+        mainThread = Thread.currentThread();
+        try {
+            Thread.sleep(180000);
+        } catch (InterruptedException e) {
+            if (!testPassed && testGeneratedInterrupt) {
+                throw new RuntimeException("Alef character is not rendered");
+            }
+        }
+        if (!testGeneratedInterrupt) {
+            throw new RuntimeException("user has not executed the test");
+        }
+    }
+
+    private static void glyphTest() {
+        frame = new JFrame("Test");
+        frame.add(new MyComponent());
+        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+        frame.setSize(200, 200);
+        frame.setLocationRelativeTo(null);
+        frame.setVisible(true);
+    }
+
+    public static synchronized void pass() {
+        testPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }
+
+    public static synchronized void fail() {
+        testPassed = false;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }
+
+    private static void doTest(Runnable action) {
+        String description
+                = " The test is supposed to display arabic alef character.\n"
+                + " If it resembles like the one shown in\n "
+                + " www.fileformat.info/info/unicode/char/0627/index.htm\n "
+                + " in Italic style ,press PASS.\n"
+                + " If the glyph is not shown or empty rectangle is shown, press FAIL";
+
+        final JDialog dialog = new JDialog();
+        dialog.setTitle("printBannerTest");
+        JTextArea textArea = new JTextArea(description);
+        textArea.setEditable(false);
+        final JButton testButton = new JButton("Start Test");
+        final JButton passButton = new JButton("PASS");
+        passButton.setEnabled(false);
+        passButton.addActionListener((e) -> {
+            dialog.dispose();
+            frame.dispose();
+            pass();
+        });
+        final JButton failButton = new JButton("FAIL");
+        failButton.setEnabled(false);
+        failButton.addActionListener((e) -> {
+            dialog.dispose();
+            frame.dispose();
+            fail();
+        });
+        testButton.addActionListener((e) -> {
+            testButton.setEnabled(false);
+            action.run();
+            passButton.setEnabled(true);
+            failButton.setEnabled(true);
+        });
+        JPanel mainPanel = new JPanel(new BorderLayout());
+        mainPanel.add(textArea, BorderLayout.CENTER);
+        JPanel buttonPanel = new JPanel(new FlowLayout());
+        buttonPanel.add(testButton);
+        buttonPanel.add(passButton);
+        buttonPanel.add(failButton);
+        mainPanel.add(buttonPanel, BorderLayout.SOUTH);
+        dialog.add(mainPanel);
+        dialog.pack();
+        dialog.setVisible(true);
+        dialog.addWindowListener(new WindowAdapter() {
+           @Override
+            public void windowClosing(WindowEvent e) {
+                System.out.println("main dialog closing");
+                testGeneratedInterrupt = false;
+                mainThread.interrupt();
+            }
+        });
+    }
+}
+
+class MyComponent extends JComponent {
+    private final Font font = new Font("Menlo", Font.ITALIC, 100);
+    private final String text = "\u0627"; // Arabic letter alef
+
+    @Override
+    protected void paintComponent(Graphics g) {
+        if (font.canDisplayUpTo(text) == -1) {
+            g.setColor(Color.black);
+            g.setFont(font);
+            g.drawString(text, 70, 110);
+        }
+    }
+}
+
+
+
+
diff --git a/jdk/test/java/awt/font/TextLayout/DiacriticsDrawingTest.java b/jdk/test/java/awt/font/TextLayout/DiacriticsDrawingTest.java
new file mode 100644
index 0000000..49bdc39
--- /dev/null
+++ b/jdk/test/java/awt/font/TextLayout/DiacriticsDrawingTest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2017 JetBrains s.r.o.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8170552
+ * @summary verify enabling text layout for complex text on macOS
+ * @requires os.family == "mac"
+ */
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+
+public class DiacriticsDrawingTest {
+    private static final Font FONT = new Font("Menlo", Font.PLAIN, 12);
+    private static final int IMAGE_WIDTH = 20;
+    private static final int IMAGE_HEIGHT = 20;
+    private static final int TEXT_X = 5;
+    private static final int TEXT_Y = 15;
+
+    public static void main(String[] args) {
+        BufferedImage composed = drawString("\u00e1"); // latin small letter a with acute
+        BufferedImage decomposed = drawString("a\u0301"); // same letter in decomposed form
+
+        if (!imagesAreEqual(composed, decomposed)) {
+            throw new RuntimeException("Text rendering is supposed to be the same");
+        }
+    }
+
+    private static BufferedImage drawString(String text) {
+        BufferedImage image = new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT, BufferedImage.TYPE_INT_RGB);
+        Graphics g = image.createGraphics();
+        g.setColor(Color.white);
+        g.fillRect(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
+        g.setColor(Color.black);
+        g.setFont(FONT);
+        g.drawString(text, TEXT_X, TEXT_Y);
+        g.dispose();
+        return image;
+    }
+
+    private static boolean imagesAreEqual(BufferedImage i1, BufferedImage i2) {
+        if (i1.getWidth() != i2.getWidth() || i1.getHeight() != i2.getHeight()) return false;
+        for (int i = 0; i < i1.getWidth(); i++) {
+            for (int j = 0; j < i1.getHeight(); j++) {
+                if (i1.getRGB(i, j) != i2.getRGB(i, j)) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+}
diff --git a/jdk/test/java/awt/font/TextLayout/HitTest.java b/jdk/test/java/awt/font/TextLayout/HitTest.java
new file mode 100644
index 0000000..722adbe
--- /dev/null
+++ b/jdk/test/java/awt/font/TextLayout/HitTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @summary verify Hit index with supplementary characters.
+ * @bug 8173028
+ */
+
+import java.awt.Font;
+import java.awt.font.FontRenderContext;
+import java.awt.font.TextHitInfo;
+import java.awt.font.TextLayout;
+
+public class HitTest {
+
+  public static void main(String args[]) {
+      String s = new String(new int[]{0x1d400, 0x61}, 0, 2);
+      Font font = new Font("Dialog", Font.PLAIN, 12);
+      FontRenderContext frc = new FontRenderContext(null, false, false);
+      TextLayout tl = new TextLayout(s, font, frc);
+      TextHitInfo currHit = TextHitInfo.beforeOffset(3);
+      TextHitInfo prevHit = tl.getNextLeftHit(currHit);
+      System.out.println("index=" + prevHit.getCharIndex()+
+                         " leading edge=" + prevHit.isLeadingEdge());
+      if (prevHit.getCharIndex() != 2) {
+          throw new RuntimeException("Expected 2 for hit index");
+      }
+   }
+}
diff --git a/jdk/test/java/awt/font/TextLayout/MissingCodePointLayoutTest.java b/jdk/test/java/awt/font/TextLayout/MissingCodePointLayoutTest.java
new file mode 100644
index 0000000..3d1ff85
--- /dev/null
+++ b/jdk/test/java/awt/font/TextLayout/MissingCodePointLayoutTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ */
+
+/* @test
+ * @summary Verify no exception for unsupported code point.
+ * @bug 8172967
+ */
+import java.awt.Font;
+import java.awt.font.FontRenderContext;
+import java.awt.font.TextLayout;
+
+public class MissingCodePointLayoutTest {
+    public static void main(String[] args) {
+        Font font = new Font("Tahoma", Font.PLAIN, 12);
+        String text = "\ude00";
+        FontRenderContext frc = new FontRenderContext(null, false, false);
+        TextLayout layout = new TextLayout(text, font, frc);
+        layout.getCaretShapes(0);
+    }
+}
+
diff --git a/jdk/test/java/awt/image/ColorModel/EqualsTest.java b/jdk/test/java/awt/image/ColorModel/EqualsTest.java
new file mode 100644
index 0000000..1d2adf7
--- /dev/null
+++ b/jdk/test/java/awt/image/ColorModel/EqualsTest.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4524500 7107905
+ * @run main EqualsTest
+ * @summary Tests whether ColorModel.equals() succeeds using a
+ * user-implemented subclass of ColorModel which calls the ColorModel(int bits)
+ * constructor. The test fails if an exception is thrown when equals()
+ * is called or if equals() returns an incorrect value.
+ */
+
+import java.awt.image.ColorModel;
+
+public class EqualsTest {
+
+    public static void main(String[] args) {
+        SimpleColorModel scm1 = new SimpleColorModel(3);
+        SimpleColorModel scm2 = new SimpleColorModel(3);
+        SimpleColorModel scm3 = new SimpleColorModel(8);
+        ColorModel rgbcm = ColorModel.getRGBdefault();
+
+        try {
+            if (scm1.equals(scm2)) {
+                throw new RuntimeException("Test 1 failed: " +
+                                           "scm1 should not equal scm2");
+            }
+
+            if (scm1.equals(scm3)) {
+                throw new RuntimeException("Test 2 failed: " +
+                                           "scm1 should not equal scm3");
+            }
+
+            if (scm1.equals(rgbcm) || rgbcm.equals(scm1)) {
+                throw new RuntimeException("Test 3 failed: " +
+                                           "scm1 should not equal rgbcm");
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("Test failed: " + e);
+        }
+    }
+
+    private static class SimpleColorModel extends ColorModel {
+
+        public SimpleColorModel(int bits) {
+            super(bits);
+        }
+
+        public int getRed(int pixel) {
+            return 0;
+        }
+
+        public int getGreen(int pixel) {
+            return 0;
+        }
+
+        public int getBlue(int pixel) {
+            return 0;
+        }
+
+        public int getAlpha(int pixel) {
+            return 0;
+        }
+    }
+}
diff --git a/jdk/test/java/awt/image/ComponentColorModel/ComponentColorModelEqualsTest.java b/jdk/test/java/awt/image/ComponentColorModel/ComponentColorModelEqualsTest.java
new file mode 100644
index 0000000..995da55
--- /dev/null
+++ b/jdk/test/java/awt/image/ComponentColorModel/ComponentColorModelEqualsTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     7107905
+ * @summary Test verifies whether equals() and hashCode() methods in
+ *          ComponentColorModel works properly.
+ * @run     main ComponentColorModelEqualsTest
+ */
+
+import java.awt.Transparency;
+import java.awt.color.ColorSpace;
+import java.awt.image.ComponentColorModel;
+import java.awt.image.DataBuffer;
+
+public class ComponentColorModelEqualsTest {
+
+    private static void verifyEquals(ComponentColorModel m1,
+                                     ComponentColorModel m2) {
+        if (m1.equals(null)) {
+            throw new RuntimeException("equals(null) returns true");
+        }
+        if (!(m1.equals(m2))) {
+            throw new RuntimeException("equals() method is not working"
+                    + " properly");
+        }
+        if (!(m2.equals(m1))) {
+            throw new RuntimeException("equals() method is not working"
+                    + " properly");
+        }
+        if (m1.hashCode() != m2.hashCode()) {
+            throw new RuntimeException("HashCode is not same for same"
+                    + " ComponentColorModels");
+        }
+    }
+
+    private static void testConstructor1() {
+        /*
+         * verify equality with constructor
+         * ComponentColorModel(ColorSpace colorSpace,
+         *                  int[] bits,
+         *                  boolean hasAlpha,
+         *                  boolean isAlphaPremultiplied,
+         *                  int transparency,
+         *                  int transferType)
+         */
+        ComponentColorModel model1 =
+            new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                                    new int[] {8, 8, 8},
+                                    false,
+                                    false,
+                                    Transparency.OPAQUE,
+                                    DataBuffer.TYPE_BYTE);
+        ComponentColorModel model2 =
+            new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                                    new int[] {8, 8, 8},
+                                    false,
+                                    false,
+                                    Transparency.OPAQUE,
+                                    DataBuffer.TYPE_BYTE);
+        verifyEquals(model1, model2);
+    }
+
+    private static void testConstructor2() {
+        /*
+         * verify equality with constructor
+         * ComponentColorModel(ColorSpace colorSpace,
+         *                  boolean hasAlpha,
+         *                  boolean isAlphaPremultiplied,
+         *                  int transparency,
+         *                  int transferType)
+         */
+        ComponentColorModel model1 =
+            new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                                    false,
+                                    false,
+                                    Transparency.OPAQUE,
+                                    DataBuffer.TYPE_BYTE);
+        ComponentColorModel model2 =
+            new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                                    false,
+                                    false,
+                                    Transparency.OPAQUE,
+                                    DataBuffer.TYPE_BYTE);
+        verifyEquals(model1, model2);
+    }
+
+    private static void testSameComponentColorModel() {
+        testConstructor1();
+        testConstructor2();
+    }
+    public static void main(String[] args) {
+        // verify ComponentColorModel equality using different constructors.
+        testSameComponentColorModel();
+    }
+}
+
diff --git a/jdk/test/java/awt/image/IndexColorModel/IndexColorModelEqualsTest.java b/jdk/test/java/awt/image/IndexColorModel/IndexColorModelEqualsTest.java
new file mode 100644
index 0000000..edfe7ea
--- /dev/null
+++ b/jdk/test/java/awt/image/IndexColorModel/IndexColorModelEqualsTest.java
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     7107905
+ * @summary Test verifies whether equals() and hashCode() methods in
+ *          IndexColorModel works properly for IndexColorModel unique
+ *          properties.
+ * @run     main IndexColorModelEqualsTest
+ */
+
+import java.awt.image.DataBuffer;
+import java.awt.image.IndexColorModel;
+import java.math.BigInteger;
+
+public class IndexColorModelEqualsTest {
+
+    private static void verifyEquals(IndexColorModel m1,
+                                     IndexColorModel m2) {
+        if (m1.equals(null)) {
+            throw new RuntimeException("equals(null) returns true");
+        }
+        if (!(m1.equals(m2))) {
+            throw new RuntimeException("equals() method is not working"
+                    + " properly");
+        }
+        if (!(m2.equals(m1))) {
+            throw new RuntimeException("equals() method is not working"
+                    + " properly");
+        }
+        if (m1.hashCode() != m2.hashCode()) {
+            throw new RuntimeException("HashCode is not same for same"
+                    + " IndexColorModels");
+        }
+    }
+
+    private static void testColorMapEquality() {
+        // test with different cmap values.
+        IndexColorModel model1 = new IndexColorModel(8, 3, new int[] {1, 2, 3},
+                0, true, -1, DataBuffer.TYPE_BYTE);
+        IndexColorModel model2 = new IndexColorModel(8, 3, new int[] {4, 5, 6},
+                0, true, -1, DataBuffer.TYPE_BYTE);
+        if (model1.equals(model2)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " ColorMap equality improperly");
+        }
+        if (model2.equals(model1)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " ColorMap equality improperly");
+        }
+    }
+
+    private static void testSizeEquality() {
+        // test with different size for cmap.
+        IndexColorModel model1 = new IndexColorModel(8, 4,
+                new int[] {1, 2, 3, 4},
+                0, true, -1, DataBuffer.TYPE_BYTE);
+        IndexColorModel model2 = new IndexColorModel(8, 3,
+                new int[] {1, 2, 3},
+                0, true, -1, DataBuffer.TYPE_BYTE);
+        if (model1.equals(model2)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " Map size equality improperly");
+        }
+        if (model2.equals(model1)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " Map size equality improperly");
+        }
+    }
+
+    private static void testTransparentIndexEquality() {
+        // test with different values for transparent_index.
+        IndexColorModel model1 = new IndexColorModel(8, 3, new int[] {1, 2, 3},
+                0, true, 1, DataBuffer.TYPE_BYTE);
+        IndexColorModel model2 = new IndexColorModel(8, 3, new int[] {1, 2, 3},
+                0, true, 2, DataBuffer.TYPE_BYTE);
+        if (model1.equals(model2)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " TransparentIndex equality improperly");
+        }
+        if (model2.equals(model1)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " TransparentIndex equality improperly");
+        }
+    }
+
+    private static void testValidPixelsEquality() {
+        // test with different valid pixels.
+        /*
+         * In setRGBs() function of IndexColorModel we override
+         * transparent_index value to map to pixel value if alpha is 0x00
+         * so we should have atleast minimum alpha value to verify
+         * equality of validBits thats why we have color value as
+         * 16777216(2 ^ 24).
+         */
+        int color = 16777216;
+        IndexColorModel model1 = new IndexColorModel(8, 3, new int[] {color,
+                color, color}, 0, DataBuffer.TYPE_BYTE, new BigInteger("1"));
+        IndexColorModel model2 = new IndexColorModel(8, 3, new int[] {color,
+                color, color}, 0, DataBuffer.TYPE_BYTE, new BigInteger("2"));
+        if (model1.equals(model2)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " Valid pixels equality improperly");
+        }
+        if (model2.equals(model1)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " Valid pixels equality improperly");
+        }
+    }
+
+    private static void testConstructor1() {
+        /*
+         * verify equality with constructor
+         * IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b)
+         */
+        IndexColorModel model1 = new IndexColorModel(8, 2,
+                new byte[] {1, 2}, new byte[] {1, 2}, new byte[] {1, 2});
+        IndexColorModel model2 = new IndexColorModel(8, 2,
+                new byte[] {1, 2}, new byte[] {1, 2}, new byte[] {1, 2});
+        verifyEquals(model1, model2);
+    }
+
+    private static void testConstructor2() {
+        /*
+         * verify equality with constructor
+         * IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b,
+         * byte[] a)
+         */
+        IndexColorModel model1 = new IndexColorModel(8, 2, new byte[] {1, 2},
+                new byte[] {1, 2}, new byte[] {1, 2}, new byte[] {1, 2});
+        IndexColorModel model2 = new IndexColorModel(8, 2, new byte[] {1, 2},
+                new byte[] {1, 2}, new byte[] {1, 2}, new byte[] {1, 2});
+        verifyEquals(model1, model2);
+    }
+
+    private static void testConstructor3() {
+        /*
+         * verify equality with constructor
+         * IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b,
+         * int trans)
+         */
+        IndexColorModel model1 = new IndexColorModel(8, 2, new byte[] {1, 2},
+                new byte[] {1, 2}, new byte[] {1, 2}, 1);
+        IndexColorModel model2 = new IndexColorModel(8, 2, new byte[] {1, 2},
+                new byte[] {1, 2}, new byte[] {1, 2}, 1);
+        verifyEquals(model1, model2);
+    }
+
+    private static void testConstructor4() {
+        /*
+         * verify equality with constructor
+         * IndexColorModel(int bits, int size, byte[] cmap, int start,
+         * boolean hasalpha)
+         */
+        IndexColorModel model1 = new IndexColorModel(8, 1,
+                new byte[] {1, 2, 3, 4}, 0, true);
+        IndexColorModel model2 = new IndexColorModel(8, 1,
+                new byte[] {1, 2, 3, 4}, 0, true);
+        verifyEquals(model1, model2);
+    }
+
+    private static void testConstructor5() {
+        /*
+         * verify equality with constructor
+         * IndexColorModel(int bits, int size, byte[] cmap, int start,
+         * boolean hasalpha, int trans)
+         */
+        IndexColorModel model1 = new IndexColorModel(8, 1,
+                new byte[] {1, 2, 3, 4}, 0, true, 0);
+        IndexColorModel model2 = new IndexColorModel(8, 1,
+                new byte[] {1, 2, 3, 4}, 0, true, 0);
+        verifyEquals(model1, model2);
+    }
+
+    private static void testConstructor6() {
+        /*
+         * verify equality with constructor
+         * IndexColorModel(int bits, int size, int[] cmap, int start,
+         * boolean hasalpha, int trans, int transferType)
+         */
+        IndexColorModel model1 = new IndexColorModel(8, 3, new int[] {1, 2, 3},
+                0, true, -1, DataBuffer.TYPE_BYTE);
+        IndexColorModel model2 = new IndexColorModel(8, 3, new int[] {1, 2, 3},
+                0, true, -1, DataBuffer.TYPE_BYTE);
+        verifyEquals(model1, model2);
+    }
+
+    private static void testConstructor7() {
+        /*
+         * verify equality with constructor
+         * IndexColorModel(int bits, int size, int[] cmap, int start,
+         * int transferType, BigInteger validBits)
+         */
+        /*
+         * In setRGBs() function of IndexColorModel we override
+         * transparent_index value to map to pixel value if alpha is 0x00
+         * so we should have atleast minimum alpha value to keep
+         * both model1 and model2 same.
+         */
+        int color = 16777216;
+        IndexColorModel model1 = new IndexColorModel(8, 3, new int[] {color,
+                color, color}, 0, DataBuffer.TYPE_BYTE, new BigInteger("1"));
+        IndexColorModel model2 = new IndexColorModel(8, 3, new int[] {color,
+                color, color}, 0, DataBuffer.TYPE_BYTE, new BigInteger("1"));
+        verifyEquals(model1, model2);
+    }
+
+    private static void testSameIndexColorModel() {
+        testConstructor1();
+        testConstructor2();
+        testConstructor3();
+        testConstructor4();
+        testConstructor5();
+        testConstructor6();
+        testConstructor7();
+    }
+    public static void main(String[] args) {
+        /* test whether equals() method works properly for parameters
+         * unique to IndexColorModel.
+         */
+        testColorMapEquality();
+        testSizeEquality();
+        testTransparentIndexEquality();
+        testValidPixelsEquality();
+        // verify same IndexColorModel equality using different constructors.
+        testSameIndexColorModel();
+    }
+}
+
diff --git a/jdk/test/java/awt/image/PackedColorModel/PackedColorModelEqualsTest.java b/jdk/test/java/awt/image/PackedColorModel/PackedColorModelEqualsTest.java
new file mode 100644
index 0000000..bc51557
--- /dev/null
+++ b/jdk/test/java/awt/image/PackedColorModel/PackedColorModelEqualsTest.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     7107905
+ * @summary Test verifies whether equals() and hashCode() methods in
+ *          PackedColorModel works properly.
+ * @run     main PackedColorModelEqualsTest
+ */
+
+import java.awt.color.ColorSpace;
+import java.awt.image.DataBuffer;
+import java.awt.image.DirectColorModel;
+
+public class PackedColorModelEqualsTest {
+
+    private static void verifyEquals(DirectColorModel m1,
+                                     DirectColorModel m2) {
+        if (m1.equals(null)) {
+            throw new RuntimeException("equals(null) returns true");
+        }
+        if (!(m1.equals(m2))) {
+            throw new RuntimeException("equals() method is not working"
+                    + " properly");
+        }
+        if (!(m2.equals(m1))) {
+            throw new RuntimeException("equals() method is not working"
+                    + " properly");
+        }
+        if (m1.hashCode() != m2.hashCode()) {
+            throw new RuntimeException("HashCode is not same for same"
+                    + " PackedColorModels");
+        }
+    }
+
+    private static void testMaskArrayEquality() {
+        /*
+         * Test with different maskArray values, since PackedColorModel
+         * is abstract we use subclass DirectColorModel.
+         */
+        DirectColorModel model1 =
+            new DirectColorModel(24, 0x00FF0000, 0x0000FF00, 0x000000FF);
+        DirectColorModel model2 =
+            new DirectColorModel(24, 0x000000FF, 0x0000FF00, 0x00FF0000);
+        if (model1.equals(model2)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " ColorMap equality improperly");
+        }
+        if (model2.equals(model1)) {
+            throw new RuntimeException("equals() method is determining"
+                    + " ColorMap equality improperly");
+        }
+    }
+
+    private static void testConstructor1() {
+        /*
+         * verify equality with constructor
+         * DirectColorModel(int bits, int rmask, int gmask, int bmask,
+         *    int amask)
+         */
+        DirectColorModel model1 =
+            new DirectColorModel(32, 0xFF000000, 0x00FF0000,
+                    0x0000FF00, 0x000000FF);
+        DirectColorModel model2 =
+            new DirectColorModel(32, 0xFF000000, 0x00FF0000,
+                    0x0000FF00, 0x000000FF);
+        verifyEquals(model1, model2);
+    }
+
+    private static void testConstructor2() {
+        /*
+         * verify equality with constructor
+         * DirectColorModel(ColorSpace space, int bits, int rmask, int gmask,
+         * int bmask, int amask, boolean isAlphaPremultiplied, int transferType)
+         */
+        DirectColorModel model1 =
+            new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                    32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF,
+                    false, DataBuffer.TYPE_BYTE);
+        DirectColorModel model2 =
+            new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+                    32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF,
+                    false, DataBuffer.TYPE_BYTE);
+        verifyEquals(model1, model2);
+    }
+
+    private static void testSamePackedColorModel() {
+        testConstructor1();
+        testConstructor2();
+    }
+    public static void main(String[] args) {
+        // test with different mask array.
+        testMaskArrayEquality();
+        // verify PackedColorModel equality using different constructors.
+        testSamePackedColorModel();
+    }
+}
+
diff --git a/jdk/test/java/awt/jdk/TestJDKAWTUtils.java b/jdk/test/java/awt/jdk/TestJDKAWTUtils.java
deleted file mode 100644
index 6f0439c..0000000
--- a/jdk/test/java/awt/jdk/TestJDKAWTUtils.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8167126
- */
-import java.awt.BorderLayout;
-import java.awt.Font;
-import java.awt.Rectangle;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-
-public class TestJDKAWTUtils {
-
-    static JFrame f;
-    public static void main(String[] args) throws Exception {
-
-        SwingUtilities.invokeAndWait(() -> {
-            f = new JFrame("test");
-            JPanel p = new JPanel();
-            JButton b = new JButton("Hello");
-            b.setFont(new Font(Font.DIALOG, Font.PLAIN, 80));
-            p.setLayout(new BorderLayout());
-            p.add("Center", b);
-            f.getContentPane().add(p);
-            f.pack();
-            f.setVisible(true);
-            Rectangle r = new Rectangle(0, 0, 50, 50);
-            jdk.awt.AWTUtils.setComponentMixingCutoutShape(b, r);
-        });
-        Thread.sleep(2000);
-        SwingUtilities.invokeAndWait(() -> f.dispose());
-    }
-}
diff --git a/jdk/test/java/awt/patchlib/java.desktop/java/awt/Helper.java b/jdk/test/java/awt/patchlib/java.desktop/java/awt/Helper.java
index 6d8dbc4..d599833 100644
--- a/jdk/test/java/awt/patchlib/java.desktop/java/awt/Helper.java
+++ b/jdk/test/java/awt/patchlib/java.desktop/java/awt/Helper.java
@@ -22,7 +22,6 @@
  */
 
 package java.awt;
-import java.lang.reflect.Module;
 public class Helper {
     private Helper() { }
     public static void addExports(String pn, Module target) {
diff --git a/jdk/test/java/awt/print/PageFormat/WrongPaperPrintingTest.java b/jdk/test/java/awt/print/PageFormat/WrongPaperPrintingTest.java
new file mode 100644
index 0000000..79f0748
--- /dev/null
+++ b/jdk/test/java/awt/print/PageFormat/WrongPaperPrintingTest.java
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 8167102
+   @summary PrintRequestAttributeSet breaks page size set using PageFormat
+   @run main/manual WrongPaperPrintingTest
+ */
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.print.PageFormat;
+import java.awt.print.Paper;
+import java.awt.print.Printable;
+import java.awt.print.PrinterException;
+import java.awt.print.PrinterJob;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.attribute.Size2DSyntax;
+import javax.print.attribute.standard.Chromaticity;
+import javax.print.attribute.standard.MediaSize;
+import javax.print.attribute.standard.MediaSizeName;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.SwingUtilities;
+import javax.swing.Timer;
+import javax.swing.WindowConstants;
+
+public class WrongPaperPrintingTest implements Printable {
+    private static final CountDownLatch testEndedSignal = new CountDownLatch(1);
+    private static final int testTimeout = 300000;
+    private static volatile String testFailureMsg;
+    private static volatile boolean testPassed;
+    private static volatile boolean testFinished;
+
+    public static void main(String[] args) {
+        SwingUtilities.invokeLater(() -> createAndShowTestDialog());
+
+        try {
+            if (!testEndedSignal.await(testTimeout, TimeUnit.MILLISECONDS)) {
+                throw new RuntimeException(String.format(
+                    "Test timeout '%d ms' elapsed.", testTimeout));
+            }
+            if (!testPassed) {
+                String failureMsg = testFailureMsg;
+                if ((failureMsg != null) && (!failureMsg.trim().isEmpty())) {
+                    throw new RuntimeException(failureMsg);
+                } else {
+                    throw new RuntimeException("Test failed.");
+                }
+            }
+        } catch (InterruptedException ie) {
+            throw new RuntimeException(ie);
+        } finally {
+            testFinished = true;
+        }
+    }
+
+    private static void doTest() {
+        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
+        aset.add(Chromaticity.MONOCHROME);
+
+        MediaSize isoA5Size = MediaSize.getMediaSizeForName(MediaSizeName.ISO_A5);
+        float[] size = isoA5Size.getSize(Size2DSyntax.INCH);
+        Paper paper = new Paper();
+        paper.setSize(size[0] * 72.0, size[1] * 72.0);
+        paper.setImageableArea(0.0, 0.0, size[0] * 72.0, size[1] * 72.0);
+        PageFormat pf = new PageFormat();
+        pf.setPaper(paper);
+
+        PrinterJob job = PrinterJob.getPrinterJob();
+        job.setPrintable(new WrongPaperPrintingTest(), job.validatePage(pf));
+        if (job.printDialog()) {
+            try {
+                job.print(aset);
+            } catch (PrinterException pe) {
+                throw new RuntimeException(pe);
+            }
+        }
+    }
+
+    private static void pass() {
+        testPassed = true;
+        testEndedSignal.countDown();
+    }
+
+    private static void fail(String failureMsg) {
+        testFailureMsg = failureMsg;
+        testPassed = false;
+        testEndedSignal.countDown();
+    }
+
+    private static String convertMillisToTimeStr(int millis) {
+        if (millis < 0) {
+            return "00:00:00";
+        }
+        int hours = millis / 3600000;
+        int minutes = (millis - hours * 3600000) / 60000;
+        int seconds = (millis - hours * 3600000 - minutes * 60000) / 1000;
+        return String.format("%02d:%02d:%02d", hours, minutes, seconds);
+    }
+
+    private static void createAndShowTestDialog() {
+        String description =
+            " To run this test it is required to have a virtual PDF\r\n" +
+            " printer or any other printer supporting A5 paper size.\r\n" +
+            "\r\n" +
+            " 1. Verify that NOT A5 paper size is set as default for the\r\n" +
+            " printer to be used.\r\n" +
+            " 2. Click on \"Start Test\" button.\r\n" +
+            " 3. In the shown print dialog select the printer and click\r\n" +
+            " on \"Print\" button.\r\n" +
+            " 4. Verify that a page with a drawn rectangle is printed on\r\n" +
+            " a paper of A5 size which is (5.8 x 8.3 in) or\r\n" +
+            " (148 x 210 mm).\r\n" +
+            "\r\n" +
+            " If the printed page size is correct, click on \"PASS\"\r\n" +
+            " button, otherwise click on \"FAIL\" button.";
+
+        final JDialog dialog = new JDialog();
+        dialog.setTitle("WrongPaperPrintingTest");
+        dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        dialog.addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowClosing(WindowEvent e) {
+                dialog.dispose();
+                fail("Main dialog was closed.");
+            }
+        });
+
+        final JLabel testTimeoutLabel = new JLabel(String.format(
+            "Test timeout: %s", convertMillisToTimeStr(testTimeout)));
+        final long startTime = System.currentTimeMillis();
+        final Timer timer = new Timer(0, null);
+        timer.setDelay(1000);
+        timer.addActionListener((e) -> {
+            int leftTime = testTimeout - (int)(System.currentTimeMillis() - startTime);
+            if ((leftTime < 0) || testFinished) {
+                timer.stop();
+                dialog.dispose();
+            }
+            testTimeoutLabel.setText(String.format(
+                "Test timeout: %s", convertMillisToTimeStr(leftTime)));
+        });
+        timer.start();
+
+        JTextArea textArea = new JTextArea(description);
+        textArea.setEditable(false);
+
+        final JButton testButton = new JButton("Start Test");
+        final JButton passButton = new JButton("PASS");
+        final JButton failButton = new JButton("FAIL");
+        testButton.addActionListener((e) -> {
+            testButton.setEnabled(false);
+            new Thread(() -> {
+                try {
+                    doTest();
+
+                    SwingUtilities.invokeLater(() -> {
+                        passButton.setEnabled(true);
+                        failButton.setEnabled(true);
+                    });
+                } catch (Throwable t) {
+                    t.printStackTrace();
+                    dialog.dispose();
+                    fail("Exception occurred in a thread executing the test.");
+                }
+            }).start();
+        });
+        passButton.setEnabled(false);
+        passButton.addActionListener((e) -> {
+            dialog.dispose();
+            pass();
+        });
+        failButton.setEnabled(false);
+        failButton.addActionListener((e) -> {
+            dialog.dispose();
+            fail("Size of a printed page is wrong.");
+        });
+
+        JPanel mainPanel = new JPanel(new BorderLayout());
+        JPanel labelPanel = new JPanel(new FlowLayout());
+        labelPanel.add(testTimeoutLabel);
+        mainPanel.add(labelPanel, BorderLayout.NORTH);
+        mainPanel.add(textArea, BorderLayout.CENTER);
+        JPanel buttonPanel = new JPanel(new FlowLayout());
+        buttonPanel.add(testButton);
+        buttonPanel.add(passButton);
+        buttonPanel.add(failButton);
+        mainPanel.add(buttonPanel, BorderLayout.SOUTH);
+        dialog.add(mainPanel);
+
+        dialog.pack();
+        dialog.setVisible(true);
+    }
+
+    @Override
+    public int print(Graphics g, PageFormat pf, int pageIndex)
+        throws PrinterException {
+        if (pageIndex == 0) {
+            g.setColor(Color.RED);
+            g.drawRect((int)pf.getImageableX(), (int)pf.getImageableY(),
+                (int)pf.getImageableWidth(), (int)pf.getImageableHeight());
+            return Printable.PAGE_EXISTS;
+        } else {
+            return Printable.NO_SUCH_PAGE;
+        }
+    }
+}
diff --git a/jdk/test/java/awt/print/PrinterJob/PrintAttributeUpdateTest.java b/jdk/test/java/awt/print/PrinterJob/PrintAttributeUpdateTest.java
index f068964..1b69e0b 100644
--- a/jdk/test/java/awt/print/PrinterJob/PrintAttributeUpdateTest.java
+++ b/jdk/test/java/awt/print/PrinterJob/PrintAttributeUpdateTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
  /*
   @test
-  @bug 8042713
+  @bug 8042713 8170578
   @summary  Print Dialog does not update attribute set with page range
   @run main/manual PrintAttributeUpdateTest
  */
diff --git a/jdk/test/java/awt/regtesthelpers/Util.java b/jdk/test/java/awt/regtesthelpers/Util.java
index 62feee2..dde6557 100644
--- a/jdk/test/java/awt/regtesthelpers/Util.java
+++ b/jdk/test/java/awt/regtesthelpers/Util.java
@@ -445,7 +445,7 @@
 
         try {
             final Class _clazz = clazz;
-            Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.reflect.Module.class);
+            Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.Module.class);
             // No MToolkit anymore: nothing to do about it.
             // We may be called from non-X11 system, and this permission cannot be delegated to a test.
             m_addExports.invoke(null, "sun.awt.X11", Util.class.getModule());
diff --git a/jdk/test/java/beans/XMLDecoder/8028054/TestConstructorFinder.java b/jdk/test/java/beans/XMLDecoder/8028054/TestConstructorFinder.java
index 5a97ade..082f005 100644
--- a/jdk/test/java/beans/XMLDecoder/8028054/TestConstructorFinder.java
+++ b/jdk/test/java/beans/XMLDecoder/8028054/TestConstructorFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
  *          java.corba
  *          java.xml.bind
  * @compile -XDignore.symbol.file TestConstructorFinder.java
- * @run main/othervm --add-modules=java.activation,java.transaction,java.corba,java.xml.bind TestConstructorFinder
+ * @run main TestConstructorFinder
  */
 
 public class TestConstructorFinder {
diff --git a/jdk/test/java/beans/XMLDecoder/8028054/TestMethodFinder.java b/jdk/test/java/beans/XMLDecoder/8028054/TestMethodFinder.java
index 8dfbd20..85d8c94 100644
--- a/jdk/test/java/beans/XMLDecoder/8028054/TestMethodFinder.java
+++ b/jdk/test/java/beans/XMLDecoder/8028054/TestMethodFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
  *          java.corba
  *          java.xml.bind
  * @compile -XDignore.symbol.file TestMethodFinder.java
- * @run main/othervm --add-modules=java.activation,java.transaction,java.corba,java.xml.bind TestMethodFinder
+ * @run main TestMethodFinder
  */
 
 public class TestMethodFinder {
diff --git a/jdk/test/java/io/FileInputStream/LargeFileAvailable.java b/jdk/test/java/io/FileInputStream/LargeFileAvailable.java
index 94f6f85..2abfbd8 100644
--- a/jdk/test/java/io/FileInputStream/LargeFileAvailable.java
+++ b/jdk/test/java/io/FileInputStream/LargeFileAvailable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,10 @@
 /*
  * @test
  * @bug 6402006 7030573 8011136
+ * @key intermittent
  * @summary Test if available returns correct value when reading
  *          a large file.
+ * @run main/timeout=300 LargeFileAvailable
  */
 
 import java.io.*;
@@ -33,6 +35,7 @@
 import java.nio.channels.*;
 import java.nio.file.Files;
 import static java.nio.file.StandardOpenOption.*;
+import java.util.concurrent.TimeUnit;
 
 public class LargeFileAvailable {
     public static void main(String args[]) throws Exception {
@@ -71,6 +74,9 @@
         } finally {
             file.delete();
         }
+
+        System.out.println("Test succeeded.");
+        System.out.flush();
     }
 
     // Skip toSkip number of bytes and expect that the available() method
@@ -106,7 +112,12 @@
                               CREATE_NEW, WRITE, SPARSE)) {
             ByteBuffer bb = ByteBuffer.allocate(1).put((byte)1);
             bb.rewind();
+            System.out.println("  Writing large file...");
+            long t0 = System.nanoTime();
             int rc = fc.write(bb, filesize - 1);
+            long t1 = System.nanoTime();
+            System.out.printf("  Wrote large file in %d ns (%d ms) %n",
+                t1 - t0, TimeUnit.NANOSECONDS.toMillis(t1 - t0));
 
             if (rc != 1) {
                 throw new RuntimeException("Failed to write 1 byte"
diff --git a/jdk/test/java/io/FilePermission/Correctness.java b/jdk/test/java/io/FilePermission/Correctness.java
index 140aa8b..409afbe 100644
--- a/jdk/test/java/io/FilePermission/Correctness.java
+++ b/jdk/test/java/io/FilePermission/Correctness.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -89,12 +89,14 @@
         //check("/-", "-");
 
         try {
-            // containsPath is broken on Windows.
             containsMethod = FilePermission.class.getDeclaredMethod(
                     "containsPath", Path.class, Path.class);
             containsMethod.setAccessible(true);
             System.out.println();
 
+            // The 1st 2 args of contains() must be normalized paths.
+            // When FilePermission::containsPath is called by implies,
+            // paths have already been normalized.
             contains("x", "x", 0);
             contains("x", "x/y", 1);
             contains("x", "x/y/z", 2);
@@ -160,7 +162,7 @@
         }
     }
 
-    static void check(String s1, String s2, boolean expected) {
+    static void check0(String s1, String s2, boolean expected) {
         FilePermission fp1 = new FilePermission(s1, "read");
         FilePermission fp2 = new FilePermission(s2, "read");
         boolean b = fp1.implies(fp2);
@@ -173,6 +175,16 @@
         }
     }
 
+    static void check(String s1, String s2, boolean expected) {
+        check0(s1, s2, expected);
+        if (isWindows) {
+            check0("C:" + s1, s2, false);
+            check0(s1, "C:" + s2, false);
+            check0("C:" + s1, "D:" + s2, false);
+            check0("C:" + s1, "C:" + s2, expected);
+        }
+    }
+
     static void check(String s1, String s2) {
         check(s1, s2, true);
     }
diff --git a/jdk/test/java/io/FilePermission/ReadFileOnPath.java b/jdk/test/java/io/FilePermission/ReadFileOnPath.java
index 42ed754..05ea1a1 100644
--- a/jdk/test/java/io/FilePermission/ReadFileOnPath.java
+++ b/jdk/test/java/io/FilePermission/ReadFileOnPath.java
@@ -26,6 +26,7 @@
  * @bug 8164705
  * @library /lib/testlibrary /test/lib
  * @modules java.base/jdk.internal.misc
+ *          jdk.compiler
  * @run main ReadFileOnPath
  * @summary Still able to read file on the same path
  */
@@ -57,7 +58,7 @@
                 "module-info.class", "base", "p/App.class", "p/child");
 
         // exploded module
-        test("--module-path", "modules", "-m", "m/p.App", "SS+++++");
+        test("--module-path", "modules", "-m", "m/p.App", "SS++++0");
 
         // module in jar
         test("--module-path", "new.jar", "-m", "m/p.App", "SSSS++0");
diff --git a/jdk/test/java/lang/Class/GetModuleTest.java b/jdk/test/java/lang/Class/GetModuleTest.java
index f0d7477..4059a21 100644
--- a/jdk/test/java/lang/Class/GetModuleTest.java
+++ b/jdk/test/java/lang/Class/GetModuleTest.java
@@ -31,7 +31,6 @@
  */
 
 import java.awt.Component;
-import java.lang.reflect.Module;
 
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import static jdk.internal.org.objectweb.asm.Opcodes.*;
diff --git a/jdk/test/java/lang/Class/forName/modules/TestLayer.java b/jdk/test/java/lang/Class/forName/modules/TestLayer.java
index 645e04d..45460d1 100644
--- a/jdk/test/java/lang/Class/forName/modules/TestLayer.java
+++ b/jdk/test/java/lang/Class/forName/modules/TestLayer.java
@@ -23,9 +23,7 @@
 
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.nio.file.Path;
@@ -45,13 +43,13 @@
 
         ModuleFinder finder = ModuleFinder.of(MODS_DIR);
 
-        Configuration parent = Layer.boot().configuration();
-        Configuration cf = parent.resolveRequiresAndUses(ModuleFinder.of(),
-                                                         finder,
-                                                         modules);
+        Configuration parent = ModuleLayer.boot().configuration();
+        Configuration cf = parent.resolveAndBind(ModuleFinder.of(),
+                                                 finder,
+                                                 modules);
 
         ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
 
         Module m1 = layer.findModule("m1").get();
         Module m2 = layer.findModule("m2").get();
diff --git a/jdk/test/java/lang/Class/forName/modules/TestMain.java b/jdk/test/java/lang/Class/forName/modules/TestMain.java
index 0da5136..aa821a1 100644
--- a/jdk/test/java/lang/Class/forName/modules/TestMain.java
+++ b/jdk/test/java/lang/Class/forName/modules/TestMain.java
@@ -21,13 +21,11 @@
  * questions.
  */
 
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 
 public class TestMain {
     public static void main(String[] args) throws Exception {
-        Layer boot = Layer.boot();
+        ModuleLayer boot = ModuleLayer.boot();
         Module m1 = boot.findModule("m1").get();
         Module m2 = boot.findModule("m2").get();
 
diff --git a/jdk/test/java/lang/Class/forName/modules/src/m2/p2/test/Main.java b/jdk/test/java/lang/Class/forName/modules/src/m2/p2/test/Main.java
index 56cec62..8febc95 100644
--- a/jdk/test/java/lang/Class/forName/modules/src/m2/p2/test/Main.java
+++ b/jdk/test/java/lang/Class/forName/modules/src/m2/p2/test/Main.java
@@ -23,12 +23,9 @@
 
 package p2.test;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-
 public class Main {
     public static void main(String... args) throws Exception {
-        Layer boot = Layer.boot();
+        ModuleLayer boot = ModuleLayer.boot();
         Module m1 = boot.findModule("m1").get();
         Module m2 = Main.class.getModule();
 
diff --git a/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoAccess.java b/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoAccess.java
index 618b2fd..92002a6 100644
--- a/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoAccess.java
+++ b/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoAccess.java
@@ -26,8 +26,6 @@
 import java.io.FilePermission;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.security.AccessControlException;
@@ -47,15 +45,15 @@
 
         ModuleFinder finder = ModuleFinder.of(Paths.get("mods1"), Paths.get("mods2"));
 
-        Layer bootLayer = Layer.boot();
+        ModuleLayer bootLayer = ModuleLayer.boot();
         Configuration parent = bootLayer.configuration();
 
-        Configuration cf = parent.resolveRequiresAndUses(finder,
-                                                         ModuleFinder.of(),
-                                                         Set.of("m1", "m2"));
+        Configuration cf = parent.resolveAndBind(finder,
+                                                 ModuleFinder.of(),
+                                                 Set.of("m1", "m2"));
 
         ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = bootLayer.defineModulesWithManyLoaders(cf, scl);
+        ModuleLayer layer = bootLayer.defineModulesWithManyLoaders(cf, scl);
 
         if (sm != null) {
             System.setSecurityManager(sm);
diff --git a/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoGetClassLoaderAccess.java b/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoGetClassLoaderAccess.java
index 1c2ee70..aeed218 100644
--- a/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoGetClassLoaderAccess.java
+++ b/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoGetClassLoaderAccess.java
@@ -23,8 +23,6 @@
 
 package p3;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.security.AccessControlException;
 import java.security.Permission;
 
@@ -37,7 +35,7 @@
     private static final Permission GET_CLASSLOADER_PERMISSION = new RuntimePermission("getClassLoader");
 
     public static void main(String[] args) throws Exception {
-        Layer boot = Layer.boot();
+        ModuleLayer boot = ModuleLayer.boot();
 
         System.setSecurityManager(new SecurityManager());
         Module m1 = boot.findModule("m1").get();
diff --git a/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java b/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
index 90a34a5..35e6ede 100644
--- a/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
+++ b/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,8 @@
 import java.io.UncheckedIOException;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Field;
-import java.lang.reflect.Module;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.InaccessibleObjectException;
-import java.lang.reflect.Layer;
 import java.lang.reflect.ReflectPermission;
 import java.net.URI;
 import java.nio.file.FileSystem;
@@ -269,7 +267,7 @@
             try {
                 return Files.walk(root)
                         .filter(p -> p.getNameCount() > 2)
-                        .filter(p -> Layer.boot().findModule(p.getName(1).toString()).isPresent())
+                        .filter(p -> ModuleLayer.boot().findModule(p.getName(1).toString()).isPresent())
                         .map(p -> p.subpath(2, p.getNameCount()))
                         .map(p -> p.toString())
                         .filter(s -> s.endsWith(".class") && !s.endsWith("module-info.class"))
@@ -380,6 +378,7 @@
             permissions.add(new RuntimePermission("closeClassLoader"));
             permissions.add(new RuntimePermission("getClassLoader"));
             permissions.add(new RuntimePermission("accessDeclaredMembers"));
+            permissions.add(new RuntimePermission("accessSystemModules"));
             permissions.add(new ReflectPermission("suppressAccessChecks"));
             permissions.add(new PropertyPermission("*", "read"));
             permissions.add(new FilePermission("<<ALL FILES>>", "read"));
diff --git a/jdk/test/java/lang/Class/getPackageName/Basic.java b/jdk/test/java/lang/Class/getPackageName/Basic.java
index e0c0bd1..c079d65 100644
--- a/jdk/test/java/lang/Class/getPackageName/Basic.java
+++ b/jdk/test/java/lang/Class/getPackageName/Basic.java
@@ -154,8 +154,8 @@
         return new Object[][] {
 
             { Basic.class,                  TEST_PACKAGE },
-            { Basic[].class,                null },
-            { Basic[][].class,              null },
+            { Basic[].class,                TEST_PACKAGE },
+            { Basic[][].class,              TEST_PACKAGE },
 
             { getNestedClass1(),            TEST_PACKAGE },
             { getNestedClass2(),            TEST_PACKAGE },
@@ -174,14 +174,14 @@
             { getAnonymousClass6(),         TEST_PACKAGE },
 
             { Object.class,                 "java.lang" },
-            { Object[].class,               null },
-            { Object[][].class,             null },
+            { Object[].class,               "java.lang" },
+            { Object[][].class,             "java.lang" },
 
-            { int.class,                    null },
-            { int[].class,                  null },
-            { int[][].class,                null },
+            { int.class,                    "java.lang" },
+            { int[].class,                  "java.lang" },
+            { int[][].class,                "java.lang" },
 
-            { void.class,                   null },
+            { void.class,                   "java.lang" },
 
         };
     }
diff --git a/jdk/test/java/lang/Class/getResource/Main.java b/jdk/test/java/lang/Class/getResource/Main.java
index 96d4e68..efd5026 100644
--- a/jdk/test/java/lang/Class/getResource/Main.java
+++ b/jdk/test/java/lang/Class/getResource/Main.java
@@ -23,7 +23,6 @@
 
 import java.lang.module.Configuration;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
@@ -256,7 +255,7 @@
      * Returns the directory for the given module (by name).
      */
     static Path directoryFor(String name) {
-        Configuration cf = Layer.boot().configuration();
+        Configuration cf = ModuleLayer.boot().configuration();
         ResolvedModule resolvedModule = cf.findModule(name).orElse(null);
         if (resolvedModule == null)
             throw new RuntimeException("not found: " + name);
diff --git a/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Driver.java b/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Driver.java
new file mode 100644
index 0000000..da56df0
--- /dev/null
+++ b/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Driver.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @library /lib/testlibrary
+ * @build Driver Main JarUtils jdk.testlibrary.ProcessTools
+ * @run main Driver
+ * @summary Test ClassLoader.getResourceXXX to locate resources in an automatic
+ *          module
+ */
+
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+
+import jdk.testlibrary.ProcessTools;
+
+/**
+ * The driver creates a JAR file containing p/Foo.class, p/foo.properties,
+ * and p/resources/bar.properties. This ensures there are is a resource in
+ * a module package and a resource that is not in the module package. The
+ * test is then launched to locate every resource in the JAR file.
+ */
+
+public class Driver {
+
+    private static final String TEST_CLASSES = System.getProperty("test.classes");
+
+    public static void main(String[] args) throws Exception {
+        // create content for JAR file
+        Path dir = Files.createTempDirectory("classes");
+        Path p = Files.createDirectory(dir.resolve("p"));
+        Files.createFile(p.resolve("Foo.class"));
+        Files.createFile(p.resolve("foo.properties"));
+        Path resources = Files.createDirectory(p.resolve("resources"));
+        Files.createFile(resources.resolve("bar.properties"));
+
+        // create the JAR file, including a manifest
+        Path jarFile = Paths.get("library-1.0.jar");
+        Manifest man = new Manifest();
+        Attributes attrs = man.getMainAttributes();
+        attrs.put(Attributes.Name.MANIFEST_VERSION, "1.0.0");
+        JarUtils.createJarFile(jarFile, man, dir, p);
+
+        // get the module name
+        ModuleFinder finder = ModuleFinder.of(jarFile);
+        ModuleReference mref = finder.findAll().stream().findAny().orElse(null);
+        if (mref == null)
+            throw new RuntimeException("Module not found!!!");
+        String name = mref.descriptor().name();
+
+        // launch the test with the JAR file on the module path
+        if (ProcessTools.executeTestJava("-p", jarFile.toString(),
+                                         "--add-modules", name,
+                                         "-cp", TEST_CLASSES,
+                                         "Main", name)
+                .outputTo(System.out)
+                .errorTo(System.out)
+                .getExitValue() != 0)
+            throw new RuntimeException("Test failed - see output");
+    }
+
+}
diff --git a/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Main.java b/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Main.java
new file mode 100644
index 0000000..8141e99
--- /dev/null
+++ b/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Main.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.module.ModuleReader;
+import java.lang.module.ModuleReference;
+import java.lang.module.ResolvedModule;
+import java.net.URL;
+import java.util.Enumeration;
+
+/**
+ * Usage: Main $MODULE
+ *
+ * Finds $MODULE in the boot layer and then tests that it can locate every
+ * resource in the module content (JAR file).
+ */
+
+public class Main {
+
+    static void testFind(String name) throws Exception {
+        // getResource
+        URL url = Main.class.getClassLoader().getResource(name);
+        if (url == null)
+            throw new RuntimeException("Unable to locate: " + name);
+        System.out.println(name + " => " + url);
+
+        // getResources
+        Enumeration<URL> urls = Main.class.getClassLoader().getResources(name);
+        if (!urls.hasMoreElements())
+            throw new RuntimeException("Unable to locate: " + name);
+        URL first = urls.nextElement();
+        if (!first.toURI().equals(url.toURI()))
+            throw new RuntimeException("found " + first + " ???");
+
+        // getResourceAsStream
+        if (!url.toString().endsWith("/")) {
+            InputStream in = Main.class.getClassLoader().getResourceAsStream(name);
+            if (in == null)
+                throw new RuntimeException("Unable to locate: " + name);
+            in.close();
+        }
+    }
+
+    static void testFindUnchecked(String name) {
+        try {
+            testFind(name);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        String mn = args[0];
+
+        ModuleReference mref = ModuleLayer.boot()
+                .configuration()
+                .findModule(mn)
+                .map(ResolvedModule::reference)
+                .orElseThrow(() -> new RuntimeException(mn + " not resolved!!"));
+
+        try (ModuleReader reader = mref.open()) {
+            reader.list().forEach(name -> {
+                testFindUnchecked(name);
+
+                // if the resource is a directory then find without trailing slash
+                if (name.endsWith("/")) {
+                    testFindUnchecked(name.substring(0, name.length() - 1));
+                }
+            });
+        }
+    }
+}
diff --git a/jdk/test/java/lang/ClassLoader/getResource/modules/Main.java b/jdk/test/java/lang/ClassLoader/getResource/modules/Main.java
index e816f31..4051320 100644
--- a/jdk/test/java/lang/ClassLoader/getResource/modules/Main.java
+++ b/jdk/test/java/lang/ClassLoader/getResource/modules/Main.java
@@ -24,7 +24,6 @@
 import java.io.InputStream;
 import java.lang.module.Configuration;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
 import java.io.IOException;
 import java.net.URL;
 import java.nio.file.Files;
@@ -309,7 +308,7 @@
      * Returns the directory for the given module (by name).
      */
     static Path directoryFor(String mn) {
-        Configuration cf = Layer.boot().configuration();
+        Configuration cf = ModuleLayer.boot().configuration();
         ResolvedModule resolvedModule = cf.findModule(mn).orElse(null);
         if (resolvedModule == null)
             throw new RuntimeException("not found: " + mn);
diff --git a/jdk/test/java/lang/ClassLoader/platformClassLoader/DefinePlatformClass.java b/jdk/test/java/lang/ClassLoader/platformClassLoader/DefinePlatformClass.java
index 826b381..46fbab3 100644
--- a/jdk/test/java/lang/ClassLoader/platformClassLoader/DefinePlatformClass.java
+++ b/jdk/test/java/lang/ClassLoader/platformClassLoader/DefinePlatformClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
  * @summary Test java.* class defined by the platform class loader
  * @modules jdk.zipfs/java.fake
  * @build   jdk.zipfs/java.fake.Fake
- * @compile --add-modules jdk.zipfs DefinePlatformClass.java
  * @run main DefinePlatformClass
  */
 
diff --git a/jdk/test/java/lang/ClassLoader/securityManager/ClassLoaderTest.java b/jdk/test/java/lang/ClassLoader/securityManager/ClassLoaderTest.java
new file mode 100644
index 0000000..055de8f
--- /dev/null
+++ b/jdk/test/java/lang/ClassLoader/securityManager/ClassLoaderTest.java
@@ -0,0 +1,297 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+ /*
+ * @test
+ * @bug 8168423
+ * @summary Different types of ClassLoader running with(out) SecurityManager and
+ *          (in)valid security policy file.
+ * @library /lib/testlibrary
+ * @modules java.base/jdk.internal.module
+ * @build JarUtils CompilerUtils
+ * @run main/timeout=240 ClassLoaderTest
+ */
+import java.io.File;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.Map;
+import java.util.HashMap;
+import java.lang.module.ModuleDescriptor;
+import jdk.internal.module.ModuleInfoWriter;
+import jdk.testlibrary.ProcessTools;
+
+public class ClassLoaderTest {
+
+    private static final String SRC = System.getProperty("test.src");
+    private static final Path CL_SRC = Paths.get(SRC, "TestClassLoader.java");
+    private static final Path C_SRC = Paths.get(SRC, "TestClient.java");
+    private static final Path CL_BIN = Paths.get("classes", "clbin");
+    private static final Path C_BIN = Paths.get("classes", "cbin");
+    private static final Path ARTIFACT_DIR = Paths.get("jars");
+    private static final Path VALID_POLICY = Paths.get(SRC, "valid.policy");
+    private static final Path INVALID_POLICY
+            = Paths.get(SRC, "malformed.policy");
+    private static final Path NO_POLICY = null;
+    private static final String LOCALE = "-Duser.language=en -Duser.region=US";
+    /*
+     * Here is the naming convention followed for each jar.
+     * cl.jar   - Regular custom class loader jar.
+     * mcl.jar  - Modular custom class loader jar.
+     * c.jar    - Regular client jar.
+     * mc.jar   - Modular client jar.
+     * amc.jar  - Modular client referring automated custom class loader jar.
+     */
+    private static final Path CL_JAR = ARTIFACT_DIR.resolve("cl.jar");
+    private static final Path MCL_JAR = ARTIFACT_DIR.resolve("mcl.jar");
+    private static final Path C_JAR = ARTIFACT_DIR.resolve("c.jar");
+    private static final Path MC_JAR = ARTIFACT_DIR.resolve("mc.jar");
+    private static final Path AMC_JAR = ARTIFACT_DIR.resolve("amc.jar");
+    private static final Map<String, String> MSG_MAP = new HashMap<>();
+
+    static {
+        // This mapping help process finding expected message based
+        // on the key passed as argument while executing java command.
+        MSG_MAP.put("MissingModule", "Module cl not found, required by mc");
+        MSG_MAP.put("ErrorPolicy", "java.security.policy: error parsing file");
+        MSG_MAP.put(
+                "SystemCL", "jdk.internal.loader.ClassLoaders$AppClassLoader");
+        MSG_MAP.put("CustomCL", "cl.TestClassLoader");
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        // Generates regular and modular jars before start processing it.
+        setUp();
+        processForEachPolicyFile();
+    }
+
+    /**
+     * Test cases are based on the following logic,
+     *  for (policyFile : {"NO_POLICY", "VALID", "MALFORMED"}) {
+     *      for (classLoader : {"SystemClassLoader", "CustomClassLoader"}){
+     *          for (clientModule : {"NAMED", "AUTOMATIC", "UNNAMED"}) {
+     *              for (classLoaderModule : {"NAMED", "AUTOMATIC", "UNNAMED"}) {
+     *                  Create and run java command for each possible Test case
+     *              }
+     *          }
+     *      }
+     *  }
+     */
+    private static void processForEachPolicyFile() throws Exception {
+
+        final String regCLloc = CL_JAR.toFile().getAbsolutePath();
+        final String modCLloc = MCL_JAR.toFile().getAbsolutePath();
+        final String regCloc = C_JAR.toFile().getAbsolutePath();
+        final String modCloc = MC_JAR.toFile().getAbsolutePath();
+        final String autoModCloc = AMC_JAR.toFile().getAbsolutePath();
+        final String separator = File.pathSeparator;
+
+        for (Path policy
+                : new Path[]{NO_POLICY, VALID_POLICY, INVALID_POLICY}) {
+            final String policyFile = (policy != null)
+                    ? policy.toFile().getAbsolutePath() : null;
+            final boolean malformedPolicy
+                    = (policy == null) ? false : policy.equals(INVALID_POLICY);
+
+            for (boolean useSCL : new boolean[]{true, false}) {
+                final String clVmArg = (useSCL) ? ""
+                        : "-Djava.system.class.loader=cl.TestClassLoader";
+                final String autoAddModArg
+                        = (useSCL) ? "" : "--add-modules=cl";
+                final String addmodArg = (useSCL) ? "" : "--add-modules=mcl";
+                final String sMArg = (policy != null) ? String.format(
+                        "-Djava.security.manager -Djava.security.policy=%s",
+                        policyFile) : "";
+                final String smMsg = (policy != null) ? "With SecurityManager"
+                        : "Without SecurityManager";
+                final String expectedResult = ((!malformedPolicy)
+                        ? ((useSCL) ? "PASS SystemCL" : "PASS CustomCL")
+                        : "FAIL ErrorPolicy");
+
+                // NAMED-NAMED, NAMED-AUTOMATIC, NAMED-UNNAMED
+                System.out.printf("Case:- Modular Client and %s %s%n",
+                        ((useSCL) ? "SystemClassLoader"
+                                : "Modular CustomClassLoader"), smMsg);
+                execute(new String[]{String.format(
+                    "--module-path %s%s%s %s %s %s -m mc/c.TestClient",
+                    modCloc, separator, modCLloc, LOCALE, clVmArg, sMArg),
+                    expectedResult});
+                System.out.printf("Case:- Modular Client and %s %s%n", ((useSCL)
+                        ? "SystemClassLoader"
+                        : "Automatic modular CustomClassLoader"), smMsg);
+                execute(new String[]{String.format(
+                    "--module-path %s%s%s %s %s %s -m mc/c.TestClient",
+                    autoModCloc, separator, regCLloc, LOCALE, clVmArg, sMArg),
+                    expectedResult});
+                System.out.printf("Case:- Modular Client and %s %s%n", ((useSCL)
+                        ? "SystemClassLoader"
+                        : "Unknown modular CustomClassLoader"), smMsg);
+                execute(new String[]{String.format(
+                    "--module-path %s -cp %s %s %s %s -m mc/c.TestClient",
+                    autoModCloc, regCLloc, LOCALE, clVmArg, sMArg),
+                    "FAIL MissingModule"});
+
+                // AUTOMATIC-NAMED, AUTOMATIC-AUTOMATIC, AUTOMATIC-UNNAMED
+                System.out.printf("Case:- Automated modular Client and %s %s%n",
+                        ((useSCL) ? "SystemClassLoader"
+                                : "Modular CustomClassLoader"), smMsg);
+                execute(new String[]{String.format(
+                    "--module-path %s%s%s %s %s %s %s -m c/c.TestClient",
+                    regCloc, separator, modCLloc, addmodArg, LOCALE, clVmArg,
+                    sMArg), expectedResult});
+                System.out.printf("Case:- Automated modular Client and %s %s%n",
+                        ((useSCL) ? "SystemClassLoader"
+                                : "Automatic modular CustomClassLoader"),
+                        smMsg);
+                execute(new String[]{String.format(
+                    "--module-path %s%s%s %s %s %s %s -m c/c.TestClient",
+                    regCloc, separator, regCLloc, autoAddModArg, LOCALE,
+                    clVmArg, sMArg), expectedResult});
+                System.out.printf("Case:- Automated modular Client and %s %s%n",
+                        ((useSCL) ? "SystemClassLoader"
+                                : "Unknown modular CustomClassLoader"), smMsg);
+                execute(new String[]{String.format(
+                    "--module-path %s -cp %s %s %s %s -m c/c.TestClient",
+                    regCloc, regCLloc, LOCALE, clVmArg, sMArg),
+                    expectedResult});
+
+                // UNNAMED-NAMED, UNNAMED-AUTOMATIC, UNNAMED-UNNAMED
+                System.out.printf("Case:- Unknown modular Client and %s %s%n",
+                        ((useSCL) ? "SystemClassLoader"
+                                : "Modular CustomClassLoader"), smMsg);
+                execute(new String[]{String.format(
+                    "-cp %s --module-path %s %s %s %s %s c.TestClient",
+                    regCloc, modCLloc, addmodArg, LOCALE, clVmArg, sMArg),
+                    expectedResult});
+                System.out.printf("Case:- Unknown modular Client and %s %s%n",
+                        ((useSCL) ? "SystemClassLoader"
+                                : "Automatic modular CustomClassLoader"),
+                        smMsg);
+                execute(new String[]{String.format(
+                    "-cp %s --module-path %s %s %s %s %s c.TestClient",
+                    regCloc, regCLloc, autoAddModArg, LOCALE, clVmArg, sMArg),
+                    expectedResult});
+                System.out.printf("Case:- Unknown modular Client and %s %s%n",
+                        ((useSCL) ? "SystemClassLoader"
+                                : "Unknown modular CustomClassLoader"), smMsg);
+                execute(new String[]{String.format(
+                    "-cp %s%s%s %s %s %s c.TestClient", regCloc, separator,
+                    regCLloc, LOCALE, clVmArg, sMArg), expectedResult});
+
+                // Regular jars in module-path and Modular jars in class-path.
+                System.out.printf("Case:- Regular Client and %s "
+                        + "inside --module-path %s.%n", ((useSCL)
+                                ? "SystemClassLoader"
+                                : "Unknown modular CustomClassLoader"), smMsg);
+                execute(new String[]{String.format(
+                    "--module-path %s%s%s %s %s %s %s -m c/c.TestClient",
+                    regCloc, separator, regCLloc, autoAddModArg, LOCALE,
+                    clVmArg, sMArg), expectedResult});
+                System.out.printf("Case:- Modular Client and %s in -cp %s%n",
+                        ((useSCL) ? "SystemClassLoader"
+                                : "Modular CustomClassLoader"), smMsg);
+                execute(new String[]{String.format(
+                    "-cp %s%s%s %s %s %s c.TestClient", modCloc, separator,
+                    modCLloc, LOCALE, clVmArg, sMArg), expectedResult});
+            }
+        }
+    }
+
+    /**
+     * Execute with command arguments and process the result.
+     */
+    private static void execute(String[] args) throws Exception {
+
+        String status = null;
+        String msgKey = null;
+        if ((args != null && args.length > 1)) {
+            String[] secArgs = args[1].split("\\s+");
+            status = (secArgs.length > 0) ? secArgs[0] : null;
+            msgKey = (secArgs.length > 1) ? secArgs[1] : null;
+        }
+        String out = ProcessTools.executeTestJvm(args[0].split("\\s+"))
+                .getOutput();
+        // Handle response.
+        if ((status != null && "PASS".equals(status) && msgKey != null
+                && out.contains(MSG_MAP.get(msgKey)))) {
+            System.out.printf("PASS: Expected Result: %s.%n",
+                    MSG_MAP.get(msgKey));
+        } else if ((status != null && "FAIL".equals(status) && msgKey != null
+                && out.contains(MSG_MAP.get(msgKey)))) {
+            System.out.printf("PASS: Expected Failure: %s.%n",
+                    MSG_MAP.get(msgKey));
+        } else if (out.contains("Exception") || out.contains("Error")) {
+            System.out.printf("OUTPUT: %s", out);
+            throw new RuntimeException("FAIL: Unknown Exception.");
+        } else {
+            System.out.printf("OUTPUT: %s", out);
+            throw new RuntimeException("FAIL: Unknown Test case found");
+        }
+    }
+
+    /**
+     * Creates regular/modular jar files for TestClient and TestClassLoader.
+     */
+    private static void setUp() throws Exception {
+
+        boolean compiled = CompilerUtils.compile(CL_SRC, CL_BIN);
+        compiled &= CompilerUtils.compile(C_SRC, C_BIN);
+        if (!compiled) {
+            throw new RuntimeException("Test Setup failed.");
+        }
+        // Generate regular jar files for TestClient and TestClassLoader
+        JarUtils.createJarFile(CL_JAR, CL_BIN);
+        JarUtils.createJarFile(C_JAR, C_BIN);
+        // Generate modular jar files for TestClient and TestClassLoader with
+        // their corresponding ModuleDescriptor.
+        Files.copy(CL_JAR, MCL_JAR, StandardCopyOption.REPLACE_EXISTING);
+        updateModuleDescr(MCL_JAR, ModuleDescriptor.newModule("mcl")
+                .exports("cl").requires("java.base").build());
+        Files.copy(C_JAR, MC_JAR, StandardCopyOption.REPLACE_EXISTING);
+        updateModuleDescr(MC_JAR, ModuleDescriptor.newModule("mc")
+                .exports("c").requires("java.base").requires("mcl").build());
+        Files.copy(C_JAR, AMC_JAR, StandardCopyOption.REPLACE_EXISTING);
+        updateModuleDescr(AMC_JAR, ModuleDescriptor.newModule("mc")
+                .exports("c").requires("java.base").requires("cl").build());
+    }
+
+    /**
+     * Update regular jars and include module-info.class inside it to make
+     * modular jars.
+     */
+    private static void updateModuleDescr(Path jar, ModuleDescriptor mDescr)
+            throws Exception {
+        if (mDescr != null) {
+            Path dir = Files.createTempDirectory("tmp");
+            Path mi = dir.resolve("module-info.class");
+            try (OutputStream out = Files.newOutputStream(mi)) {
+                ModuleInfoWriter.write(mDescr, out);
+            }
+            System.out.format("Adding 'module-info.class' to jar '%s'%n", jar);
+            JarUtils.updateJarFile(jar, dir);
+        }
+    }
+}
diff --git a/jdk/test/java/lang/ClassLoader/securityManager/TestClassLoader.java b/jdk/test/java/lang/ClassLoader/securityManager/TestClassLoader.java
new file mode 100644
index 0000000..64892ae
--- /dev/null
+++ b/jdk/test/java/lang/ClassLoader/securityManager/TestClassLoader.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package cl;
+
+public class TestClassLoader extends ClassLoader {
+
+    /**
+     * This constructor is used to set the parent ClassLoader
+     */
+    public TestClassLoader(ClassLoader parent) {
+        super(parent);
+    }
+
+}
diff --git a/jdk/test/java/lang/ClassLoader/securityManager/TestClient.java b/jdk/test/java/lang/ClassLoader/securityManager/TestClient.java
new file mode 100644
index 0000000..de0fe10
--- /dev/null
+++ b/jdk/test/java/lang/ClassLoader/securityManager/TestClient.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package c;
+
+public class TestClient {
+
+    public static void main(String[] args) {
+
+        // Initialize policy file.
+        System.getProperty("test.src");
+        System.out.printf("ContextClassLoader: %s%n",
+                Thread.currentThread().getContextClassLoader().toString());
+    }
+}
diff --git a/jdk/test/java/lang/ClassLoader/securityManager/malformed.policy b/jdk/test/java/lang/ClassLoader/securityManager/malformed.policy
new file mode 100644
index 0000000..8afdf69
--- /dev/null
+++ b/jdk/test/java/lang/ClassLoader/securityManager/malformed.policy
@@ -0,0 +1,4 @@
+grant {
+    xyz;
+    permission java.util.PropertyPermission "test.src", "read";
+}
\ No newline at end of file
diff --git a/jdk/test/java/lang/ClassLoader/securityManager/valid.policy b/jdk/test/java/lang/ClassLoader/securityManager/valid.policy
new file mode 100644
index 0000000..54ef7d0
--- /dev/null
+++ b/jdk/test/java/lang/ClassLoader/securityManager/valid.policy
@@ -0,0 +1,4 @@
+grant codeBase "file:./jars/*" {
+    permission java.lang.RuntimePermission "createClassLoader";
+    permission java.util.PropertyPermission "test.src", "read";
+};
\ No newline at end of file
diff --git a/jdk/test/java/lang/ModuleLayer/BasicLayerTest.java b/jdk/test/java/lang/ModuleLayer/BasicLayerTest.java
new file mode 100644
index 0000000..eb5eeb8
--- /dev/null
+++ b/jdk/test/java/lang/ModuleLayer/BasicLayerTest.java
@@ -0,0 +1,1213 @@
+/*
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @library /lib/testlibrary
+ * @modules java.base/jdk.internal.misc
+ * @build BasicLayerTest ModuleUtils
+ * @compile layertest/Test.java
+ * @run testng BasicLayerTest
+ * @summary Basic tests for java.lang.ModuleLayer
+ */
+
+import java.lang.module.Configuration;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Requires;
+import java.lang.module.ModuleFinder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import jdk.internal.misc.SharedSecrets;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+@Test
+public class BasicLayerTest {
+
+    /**
+     * Creates a "non-strict" builder for building a module. This allows the
+     * test the create ModuleDescriptor objects that do not require java.base.
+     */
+    private static ModuleDescriptor.Builder newBuilder(String mn) {
+        return SharedSecrets.getJavaLangModuleAccess()
+                .newModuleBuilder(mn, false, Set.of());
+    }
+
+    /**
+     * Exercise ModuleLayer.empty()
+     */
+    public void testEmpty() {
+        ModuleLayer emptyLayer = ModuleLayer.empty();
+
+        assertTrue(emptyLayer.parents().isEmpty());
+
+        assertTrue(emptyLayer.configuration() == Configuration.empty());
+
+        assertTrue(emptyLayer.modules().isEmpty());
+
+        assertFalse(emptyLayer.findModule("java.base").isPresent());
+
+        try {
+            emptyLayer.findLoader("java.base");
+            assertTrue(false);
+        } catch (IllegalArgumentException expected) { }
+    }
+
+
+    /**
+     * Exercise ModuleLayer.boot()
+     */
+    public void testBoot() {
+        ModuleLayer bootLayer = ModuleLayer.boot();
+
+        // configuration
+        Configuration cf = bootLayer.configuration();
+        assertTrue(cf.findModule("java.base").get()
+                .reference()
+                .descriptor()
+                .exports()
+                .stream().anyMatch(e -> (e.source().equals("java.lang")
+                                         && !e.isQualified())));
+
+        // modules
+        Set<Module> modules = bootLayer.modules();
+        assertTrue(modules.contains(Object.class.getModule()));
+        int count = (int) modules.stream().map(Module::getName).count();
+        assertEquals(count, modules.size()); // module names are unique
+
+        // findModule
+        Module base = Object.class.getModule();
+        assertTrue(bootLayer.findModule("java.base").get() == base);
+        assertTrue(base.getLayer() == bootLayer);
+
+        // findLoader
+        assertTrue(bootLayer.findLoader("java.base") == null);
+
+        // parents
+        assertTrue(bootLayer.parents().size() == 1);
+        assertTrue(bootLayer.parents().get(0) == ModuleLayer.empty());
+    }
+
+
+    /**
+     * Exercise defineModules, created with empty layer as parent
+     */
+    public void testLayerOnEmpty() {
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .requires("m2")
+                .exports("p1")
+                .build();
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires("m3")
+                .build();
+
+        ModuleDescriptor descriptor3 = newBuilder("m3")
+                .build();
+
+        ModuleFinder finder
+            = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
+
+        Configuration cf = resolve(finder, "m1");
+
+        // map each module to its own class loader for this test
+        ClassLoader loader1 = new ClassLoader() { };
+        ClassLoader loader2 = new ClassLoader() { };
+        ClassLoader loader3 = new ClassLoader() { };
+        Map<String, ClassLoader> map = new HashMap<>();
+        map.put("m1", loader1);
+        map.put("m2", loader2);
+        map.put("m3", loader3);
+
+        ModuleLayer layer = ModuleLayer.empty().defineModules(cf, map::get);
+
+        // configuration
+        assertTrue(layer.configuration() == cf);
+        assertTrue(layer.configuration().modules().size() == 3);
+
+        // modules
+        Set<Module> modules = layer.modules();
+        assertTrue(modules.size() == 3);
+        Set<String> names = modules.stream()
+            .map(Module::getName)
+            .collect(Collectors.toSet());
+        assertTrue(names.contains("m1"));
+        assertTrue(names.contains("m2"));
+        assertTrue(names.contains("m3"));
+
+        // findModule
+        Module m1 = layer.findModule("m1").get();
+        Module m2 = layer.findModule("m2").get();
+        Module m3 = layer.findModule("m3").get();
+        assertEquals(m1.getName(), "m1");
+        assertEquals(m2.getName(), "m2");
+        assertEquals(m3.getName(), "m3");
+        assertTrue(m1.getDescriptor() == descriptor1);
+        assertTrue(m2.getDescriptor() == descriptor2);
+        assertTrue(m3.getDescriptor() == descriptor3);
+        assertTrue(m1.getLayer() == layer);
+        assertTrue(m2.getLayer() == layer);
+        assertTrue(m3.getLayer() == layer);
+        assertTrue(modules.contains(m1));
+        assertTrue(modules.contains(m2));
+        assertTrue(modules.contains(m3));
+        assertFalse(layer.findModule("godot").isPresent());
+
+        // findLoader
+        assertTrue(layer.findLoader("m1") == loader1);
+        assertTrue(layer.findLoader("m2") == loader2);
+        assertTrue(layer.findLoader("m3") == loader3);
+        try {
+            ClassLoader loader = layer.findLoader("godot");
+            assertTrue(false);
+        } catch (IllegalArgumentException ignore) { }
+
+        // parents
+        assertTrue(layer.parents().size() == 1);
+        assertTrue(layer.parents().get(0) == ModuleLayer.empty());
+    }
+
+
+    /**
+     * Exercise defineModules, created with boot layer as parent
+     */
+    public void testLayerOnBoot() {
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .requires("m2")
+                .requires("java.base")
+                .exports("p1")
+                .build();
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires("java.base")
+                .build();
+
+        ModuleFinder finder
+            = ModuleUtils.finderOf(descriptor1, descriptor2);
+
+        Configuration parent = ModuleLayer.boot().configuration();
+        Configuration cf = resolve(parent, finder, "m1");
+
+        ClassLoader loader = new ClassLoader() { };
+
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, mn -> loader);
+
+        // configuration
+        assertTrue(layer.configuration() == cf);
+        assertTrue(layer.configuration().modules().size() == 2);
+
+        // modules
+        Set<Module> modules = layer.modules();
+        assertTrue(modules.size() == 2);
+        Set<String> names = modules.stream()
+            .map(Module::getName)
+            .collect(Collectors.toSet());
+        assertTrue(names.contains("m1"));
+        assertTrue(names.contains("m2"));
+
+        // findModule
+        Module m1 = layer.findModule("m1").get();
+        Module m2 = layer.findModule("m2").get();
+        assertEquals(m1.getName(), "m1");
+        assertEquals(m2.getName(), "m2");
+        assertTrue(m1.getDescriptor() == descriptor1);
+        assertTrue(m2.getDescriptor() == descriptor2);
+        assertTrue(m1.getLayer() == layer);
+        assertTrue(m2.getLayer() == layer);
+        assertTrue(modules.contains(m1));
+        assertTrue(modules.contains(m2));
+        assertTrue(layer.findModule("java.base").get() == Object.class.getModule());
+        assertFalse(layer.findModule("godot").isPresent());
+
+        // findLoader
+        assertTrue(layer.findLoader("m1") == loader);
+        assertTrue(layer.findLoader("m2") == loader);
+        assertTrue(layer.findLoader("java.base") == null);
+
+        // parents
+        assertTrue(layer.parents().size() == 1);
+        assertTrue(layer.parents().get(0) == ModuleLayer.boot());
+    }
+
+
+    /**
+     * Exercise defineModules with a configuration of two modules that
+     * have the same module-private package.
+     */
+    public void testPackageContainedInSelfAndOther() {
+        ModuleDescriptor descriptor1 =  newBuilder("m1")
+                .requires("m2")
+                .packages(Set.of("p"))
+                .build();
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .packages(Set.of("p"))
+                .build();
+
+        ModuleFinder finder
+            = ModuleUtils.finderOf(descriptor1, descriptor2);
+
+        Configuration cf = resolve(finder, "m1");
+        assertTrue(cf.modules().size() == 2);
+
+        // one loader per module, should be okay
+        ModuleLayer.empty().defineModules(cf, mn -> new ClassLoader() { });
+
+        // same class loader
+        try {
+            ClassLoader loader = new ClassLoader() { };
+            ModuleLayer.empty().defineModules(cf, mn -> loader);
+            assertTrue(false);
+        } catch (LayerInstantiationException expected) { }
+    }
+
+
+    /**
+     * Exercise defineModules with a configuration that is a partitioned
+     * graph. The same package is exported in both partitions.
+     */
+    public void testSameExportInPartitionedGraph() {
+
+        // m1 reads m2, m2 exports p to m1
+        ModuleDescriptor descriptor1 =  newBuilder("m1")
+                .requires("m2")
+                .build();
+        ModuleDescriptor descriptor2 =  newBuilder("m2")
+                .exports("p", Set.of("m1"))
+                .build();
+
+        // m3 reads m4, m4 exports p to m3
+        ModuleDescriptor descriptor3 = newBuilder("m3")
+                .requires("m4")
+                .build();
+        ModuleDescriptor descriptor4 = newBuilder("m4")
+                .exports("p", Set.of("m3"))
+                .build();
+
+        ModuleFinder finder
+            = ModuleUtils.finderOf(descriptor1,
+                                   descriptor2,
+                                   descriptor3,
+                                   descriptor4);
+
+        Configuration cf = resolve(finder, "m1", "m3");
+        assertTrue(cf.modules().size() == 4);
+
+        // one loader per module
+        ModuleLayer.empty().defineModules(cf, mn -> new ClassLoader() { });
+
+        // m1 & m2 in one loader, m3 & m4 in another loader
+        ClassLoader loader1 = new ClassLoader() { };
+        ClassLoader loader2 = new ClassLoader() { };
+        Map<String, ClassLoader> map = new HashMap<>();
+        map.put("m1", loader1);
+        map.put("m2", loader1);
+        map.put("m3", loader2);
+        map.put("m4", loader2);
+        ModuleLayer.empty().defineModules(cf, map::get);
+
+        // same loader
+        try {
+            ClassLoader loader = new ClassLoader() { };
+            ModuleLayer.empty().defineModules(cf, mn -> loader);
+            assertTrue(false);
+        } catch (LayerInstantiationException expected) { }
+    }
+
+
+    /**
+     * Exercise defineModules with a configuration with a module that
+     * contains a package that is the same name as a non-exported package in
+     * a parent layer.
+     */
+    public void testContainsSamePackageAsBootLayer() {
+
+        // check assumption that java.base contains sun.launcher
+        ModuleDescriptor base = Object.class.getModule().getDescriptor();
+        assertTrue(base.packages().contains("sun.launcher"));
+
+        ModuleDescriptor descriptor = newBuilder("m1")
+               .requires("java.base")
+               .packages(Set.of("sun.launcher"))
+               .build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(descriptor);
+
+        Configuration parent = ModuleLayer.boot().configuration();
+        Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("m1"));
+        assertTrue(cf.modules().size() == 1);
+
+        ClassLoader loader = new ClassLoader() { };
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, mn -> loader);
+        assertTrue(layer.modules().size() == 1);
+   }
+
+
+    /**
+     * Test layers with implied readability.
+     *
+     * The test consists of three configurations:
+     * - Configuration/layer1: m1, m2 requires transitive m1
+     * - Configuration/layer2: m3 requires m1
+     */
+    public void testImpliedReadabilityWithLayers1() {
+
+        // cf1: m1 and m2, m2 requires transitive m1
+
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .build();
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
+                .build();
+
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+
+        Configuration cf1 = resolve(finder1, "m2");
+
+        ClassLoader cl1 = new ClassLoader() { };
+        ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
+
+
+        // cf2: m3, m3 requires m2
+
+        ModuleDescriptor descriptor3 = newBuilder("m3")
+                .requires("m2")
+                .build();
+
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3);
+
+        Configuration cf2 = resolve(cf1, finder2, "m3");
+
+        ClassLoader cl2 = new ClassLoader() { };
+        ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
+
+        assertTrue(layer1.parents().size() == 1);
+        assertTrue(layer1.parents().get(0) == ModuleLayer.empty());
+
+        assertTrue(layer2.parents().size() == 1);
+        assertTrue(layer2.parents().get(0) == layer1);
+
+        Module m1 = layer2.findModule("m1").get();
+        Module m2 = layer2.findModule("m2").get();
+        Module m3 = layer2.findModule("m3").get();
+
+        assertTrue(m1.getLayer() == layer1);
+        assertTrue(m2.getLayer() == layer1);
+        assertTrue(m3.getLayer() == layer2);
+
+        assertTrue(m1.getClassLoader() == cl1);
+        assertTrue(m2.getClassLoader() == cl1);
+        assertTrue(m3.getClassLoader() == cl2);
+
+        assertTrue(m1.canRead(m1));
+        assertFalse(m1.canRead(m2));
+        assertFalse(m1.canRead(m3));
+
+        assertTrue(m2.canRead(m1));
+        assertTrue(m2.canRead(m2));
+        assertFalse(m2.canRead(m3));
+
+        assertTrue(m3.canRead(m1));
+        assertTrue(m3.canRead(m2));
+        assertTrue(m3.canRead(m3));
+    }
+
+
+    /**
+     * Test layers with implied readability.
+     *
+     * The test consists of three configurations:
+     * - Configuration/layer1: m1
+     * - Configuration/layer2: m2 requires transitive m3, m3 requires m2
+     */
+    public void testImpliedReadabilityWithLayers2() {
+
+        // cf1: m1
+
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+
+        Configuration cf1 = resolve(finder1, "m1");
+
+        ClassLoader cl1 = new ClassLoader() { };
+        ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
+
+
+        // cf2: m2, m3: m2 requires transitive m1, m3 requires m2
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
+                .build();
+
+        ModuleDescriptor descriptor3 = newBuilder("m3")
+                .requires("m2")
+                .build();
+
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2, descriptor3);
+
+        Configuration cf2 = resolve(cf1, finder2, "m3");
+
+        ClassLoader cl2 = new ClassLoader() { };
+        ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
+
+        assertTrue(layer1.parents().size() == 1);
+        assertTrue(layer1.parents().get(0) == ModuleLayer.empty());
+
+        assertTrue(layer2.parents().size() == 1);
+        assertTrue(layer2.parents().get(0) == layer1);
+
+        Module m1 = layer2.findModule("m1").get();
+        Module m2 = layer2.findModule("m2").get();
+        Module m3 = layer2.findModule("m3").get();
+
+        assertTrue(m1.getLayer() == layer1);
+        assertTrue(m2.getLayer() == layer2);
+        assertTrue(m3.getLayer() == layer2);
+
+        assertTrue(m1.canRead(m1));
+        assertFalse(m1.canRead(m2));
+        assertFalse(m1.canRead(m3));
+
+        assertTrue(m2.canRead(m1));
+        assertTrue(m2.canRead(m2));
+        assertFalse(m2.canRead(m3));
+
+        assertTrue(m3.canRead(m1));
+        assertTrue(m3.canRead(m2));
+        assertTrue(m3.canRead(m3));
+    }
+
+
+    /**
+     * Test layers with implied readability.
+     *
+     * The test consists of three configurations:
+     * - Configuration/layer1: m1
+     * - Configuration/layer2: m2 requires transitive m1
+     * - Configuration/layer3: m3 requires m1
+     */
+    public void testImpliedReadabilityWithLayers3() {
+
+        // cf1: m1
+
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+
+        Configuration cf1 = resolve(finder1, "m1");
+
+        ClassLoader cl1 = new ClassLoader() { };
+        ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
+
+
+        // cf2: m2 requires transitive m1
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
+                .build();
+
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
+
+        Configuration cf2 = resolve(cf1, finder2, "m2");
+
+        ClassLoader cl2 = new ClassLoader() { };
+        ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
+
+
+        // cf3: m3 requires m2
+
+        ModuleDescriptor descriptor3 = newBuilder("m3")
+                .requires("m2")
+                .build();
+
+        ModuleFinder finder3 = ModuleUtils.finderOf(descriptor3);
+
+        Configuration cf3 = resolve(cf2, finder3, "m3");
+
+        ClassLoader cl3 = new ClassLoader() { };
+        ModuleLayer layer3 = layer2.defineModules(cf3, mn -> cl3);
+
+        assertTrue(layer1.parents().size() == 1);
+        assertTrue(layer1.parents().get(0) == ModuleLayer.empty());
+
+        assertTrue(layer2.parents().size() == 1);
+        assertTrue(layer2.parents().get(0) == layer1);
+
+        assertTrue(layer3.parents().size() == 1);
+        assertTrue(layer3.parents().get(0) == layer2);
+
+        Module m1 = layer3.findModule("m1").get();
+        Module m2 = layer3.findModule("m2").get();
+        Module m3 = layer3.findModule("m3").get();
+
+        assertTrue(m1.getLayer() == layer1);
+        assertTrue(m2.getLayer() == layer2);
+        assertTrue(m3.getLayer() == layer3);
+
+        assertTrue(m1.canRead(m1));
+        assertFalse(m1.canRead(m2));
+        assertFalse(m1.canRead(m3));
+
+        assertTrue(m2.canRead(m1));
+        assertTrue(m2.canRead(m2));
+        assertFalse(m2.canRead(m3));
+
+        assertTrue(m3.canRead(m1));
+        assertTrue(m3.canRead(m2));
+        assertTrue(m3.canRead(m3));
+    }
+
+
+    /**
+     * Test layers with implied readability.
+     *
+     * The test consists of two configurations:
+     * - Configuration/layer1: m1, m2 requires transitive m1
+     * - Configuration/layer2: m3 requires transitive m2, m4 requires m3
+     */
+    public void testImpliedReadabilityWithLayers4() {
+
+        // cf1: m1, m2 requires transitive m1
+
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .build();
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
+                .build();
+
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+
+        Configuration cf1 = resolve(finder1, "m2");
+
+        ClassLoader cl1 = new ClassLoader() { };
+        ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
+
+
+        // cf2: m3 requires transitive m2, m4 requires m3
+
+        ModuleDescriptor descriptor3 = newBuilder("m3")
+                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m2")
+                .build();
+
+        ModuleDescriptor descriptor4 = newBuilder("m4")
+                .requires("m3")
+                .build();
+
+
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3, descriptor4);
+
+        Configuration cf2 = resolve(cf1, finder2, "m3", "m4");
+
+        ClassLoader cl2 = new ClassLoader() { };
+        ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
+
+        assertTrue(layer1.parents().size() == 1);
+        assertTrue(layer1.parents().get(0) == ModuleLayer.empty());
+
+        assertTrue(layer2.parents().size() == 1);
+        assertTrue(layer2.parents().get(0) == layer1);
+
+        Module m1 = layer2.findModule("m1").get();
+        Module m2 = layer2.findModule("m2").get();
+        Module m3 = layer2.findModule("m3").get();
+        Module m4 = layer2.findModule("m4").get();
+
+        assertTrue(m1.getLayer() == layer1);
+        assertTrue(m2.getLayer() == layer1);
+        assertTrue(m3.getLayer() == layer2);
+        assertTrue(m4.getLayer() == layer2);
+
+        assertTrue(m1.canRead(m1));
+        assertFalse(m1.canRead(m2));
+        assertFalse(m1.canRead(m3));
+        assertFalse(m1.canRead(m4));
+
+        assertTrue(m2.canRead(m1));
+        assertTrue(m2.canRead(m2));
+        assertFalse(m1.canRead(m3));
+        assertFalse(m1.canRead(m4));
+
+        assertTrue(m3.canRead(m1));
+        assertTrue(m3.canRead(m2));
+        assertTrue(m3.canRead(m3));
+        assertFalse(m3.canRead(m4));
+
+        assertTrue(m4.canRead(m1));
+        assertTrue(m4.canRead(m2));
+        assertTrue(m4.canRead(m3));
+        assertTrue(m4.canRead(m4));
+    }
+
+
+    /**
+     * Test layers with a qualified export. The module exporting the package
+     * does not read the target module.
+     *
+     * m1 { exports p to m2 }
+     * m2 { }
+     */
+    public void testQualifiedExports1() {
+        ModuleDescriptor descriptor1 = newBuilder("m1").
+                exports("p", Set.of("m2"))
+                .build();
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .build();
+
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+
+        Configuration cf = resolve(finder1, "m1", "m2");
+
+        ClassLoader cl = new ClassLoader() { };
+        ModuleLayer layer = ModuleLayer.empty().defineModules(cf, mn -> cl);
+        assertTrue(layer.modules().size() == 2);
+
+        Module m1 = layer.findModule("m1").get();
+        Module m2 = layer.findModule("m2").get();
+
+        // check m1 exports p to m2
+        assertFalse(m1.isExported("p"));
+        assertTrue(m1.isExported("p", m2));
+        assertFalse(m1.isOpen("p", m2));
+    }
+
+
+    /**
+     * Test layers with a qualified export. The module exporting the package
+     * reads the target module.
+     *
+     * m1 { exports p to m2; }
+     * m2 { requires m1; }
+     */
+    public void testQualifiedExports2() {
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .exports("p", Set.of("m2"))
+                .build();
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires("m1")
+                .build();
+
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+
+        Configuration cf = resolve(finder1, "m2");
+        ClassLoader cl = new ClassLoader() { };
+        ModuleLayer layer = ModuleLayer.empty().defineModules(cf, mn -> cl);
+        assertTrue(layer.modules().size() == 2);
+
+        Module m1 = layer.findModule("m1").get();
+        Module m2 = layer.findModule("m2").get();
+
+        // check m1 exports p to m2
+        assertFalse(m1.isExported("p"));
+        assertTrue(m1.isExported("p", m2));
+        assertFalse(m1.isOpen("p", m2));
+    }
+
+
+    /**
+     * Test layers with a qualified export. The module exporting the package
+     * does not read the target module in the parent layer.
+     *
+     * - Configuration/layer1: m1 { }
+     * - Configuration/layer2: m2 { exports p to m1; }
+     */
+    public void testQualifiedExports3() {
+        // create layer1 with m1
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+        Configuration cf1 = resolve(finder1, "m1");
+        ClassLoader cl1 = new ClassLoader() { };
+        ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
+        assertTrue(layer1.modules().size() == 1);
+
+        // create layer2 with m2
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .exports("p", Set.of("m1"))
+                .build();
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
+        Configuration cf2 = resolve(cf1, finder2, "m2");
+        ClassLoader cl2 = new ClassLoader() { };
+        ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
+        assertTrue(layer2.modules().size() == 1);
+
+        Module m1 = layer1.findModule("m1").get();
+        Module m2 = layer2.findModule("m2").get();
+
+        // check m2 exports p to layer1/m1
+        assertFalse(m2.isExported("p"));
+        assertTrue(m2.isExported("p", m1));
+        assertFalse(m2.isOpen("p", m1));
+    }
+
+
+    /**
+     * Test layers with a qualified export. The module exporting the package
+     * reads the target module in the parent layer.
+     *
+     * - Configuration/layer1: m1 { }
+     * - Configuration/layer2: m2 { requires m1; exports p to m1; }
+     */
+    public void testQualifiedExports4() {
+        // create layer1 with m1
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+        Configuration cf1 = resolve(finder1, "m1");
+        ClassLoader cl1 = new ClassLoader() { };
+        ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
+        assertTrue(layer1.modules().size() == 1);
+
+        // create layer2 with m2
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires("m1")
+                .exports("p", Set.of("m1"))
+                .build();
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
+        Configuration cf2 = resolve(cf1, finder2, "m2");
+        ClassLoader cl2 = new ClassLoader() { };
+        ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
+        assertTrue(layer2.modules().size() == 1);
+
+        Module m1 = layer1.findModule("m1").get();
+        Module m2 = layer2.findModule("m2").get();
+
+        // check m2 exports p to layer1/m1
+        assertFalse(m2.isExported("p"));
+        assertTrue(m2.isExported("p", m1));
+        assertFalse(m2.isOpen("p", m1));
+    }
+
+    /**
+     * Test layers with a qualified export. The module exporting the package
+     * does not read the target module.
+     *
+     * - Configuration/layer1: m1
+     * - Configuration/layer2: m1, m2 { exports p to m1; }
+     */
+    public void testQualifiedExports5() {
+        // create layer1 with m1
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+        Configuration cf1 = resolve(finder1, "m1");
+        ClassLoader cl1 = new ClassLoader() { };
+        ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
+        assertTrue(layer1.modules().size() == 1);
+
+        // create layer2 with m1 and m2
+        ModuleDescriptor descriptor2 = newBuilder("m2").exports("p", Set.of("m1")).build();
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1, descriptor2);
+        Configuration cf2 = resolve(cf1, finder2, "m1", "m2");
+        ClassLoader cl2 = new ClassLoader() { };
+        ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
+        assertTrue(layer2.modules().size() == 2);
+
+        Module m1_v1 = layer1.findModule("m1").get();
+        Module m1_v2 = layer2.findModule("m1").get();
+        Module m2 = layer2.findModule("m2").get();
+
+        // check m2 exports p to layer2/m2
+        assertFalse(m2.isExported("p"));
+        assertTrue(m2.isExported("p", m1_v2));
+        assertFalse(m2.isExported("p", m1_v1));
+    }
+
+
+    /**
+     * Test layers with a qualified export. The module exporting the package
+     * reads the target module in the parent layer (due to requires transitive).
+     *
+     * - Configuration/layer1: m1, m2 { requires transitive m1; }
+     * - Configuration/layer2: m1, m3 { requires m2; exports p to m1; }
+     */
+    public void testQualifiedExports6() {
+        // create layer1 with m1 and m2
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
+                .build();
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+        Configuration cf1 = resolve(finder1, "m2");
+        ClassLoader loader1 = new ClassLoader() { };
+        ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> loader1);
+        assertTrue(layer1.modules().size() == 2);
+
+        // create layer2 with m1 and m3
+        ModuleDescriptor descriptor3 = newBuilder("m3")
+                .requires("m2")
+                .exports("p", Set.of("m1"))
+                .build();
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1, descriptor3);
+        Configuration cf2 = resolve(cf1, finder2, "m1", "m3");
+        ClassLoader loader2 = new ClassLoader() { };
+        ModuleLayer layer2 = layer1.defineModules(cf2, mn -> loader2);
+        assertTrue(layer2.modules().size() == 2);
+
+        Module m1_v1 = layer1.findModule("m1").get();
+        Module m2 = layer1.findModule("m2").get();
+
+        Module m1_v2 = layer2.findModule("m1").get();
+        Module m3 = layer2.findModule("m3").get();
+
+        assertTrue(m3.canRead(m1_v1));
+        assertFalse(m3.canRead(m1_v2));
+
+        assertFalse(m3.isExported("p"));
+        assertTrue(m3.isExported("p", m1_v1));
+        assertFalse(m3.isExported("p", m1_v2));
+        assertFalse(m3.isExported("p", m2));
+    }
+
+
+    /**
+     * Test layers with a qualified export. The target module is not in any layer.
+     *
+     * - Configuration/layer1: m1 { }
+     * - Configuration/layer2: m2 { exports p to m3; }
+     */
+    public void testQualifiedExports7() {
+        // create layer1 with m1
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+        Configuration cf1 = resolve(finder1, "m1");
+        ClassLoader cl1 = new ClassLoader() { };
+        ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
+        assertTrue(layer1.modules().size() == 1);
+
+        // create layer2 with m2
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .exports("p", Set.of("m3"))
+                .build();
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
+        Configuration cf2 = resolve(cf1, finder2, "m2");
+        ClassLoader cl2 = new ClassLoader() { };
+        ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
+        assertTrue(layer2.modules().size() == 1);
+
+        Module m1 = layer1.findModule("m1").get();
+        Module m2 = layer2.findModule("m2").get();
+
+        // check m2 does not export p to anyone
+        assertFalse(m2.isExported("p"));
+        assertFalse(m2.isExported("p", m1));
+    }
+
+    /**
+     * Attempt to use defineModules to create a layer with a module defined
+     * to a class loader that already has a module of the same name defined
+     * to the class loader.
+     */
+    @Test(expectedExceptions = { LayerInstantiationException.class })
+    public void testModuleAlreadyDefinedToLoader() {
+
+        ModuleDescriptor md = newBuilder("m")
+                .requires("java.base")
+                .build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(md);
+
+        Configuration parent = ModuleLayer.boot().configuration();
+
+        Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("m"));
+
+        ClassLoader loader = new ClassLoader() { };
+
+        ModuleLayer.boot().defineModules(cf, mn -> loader);
+
+        // should throw LayerInstantiationException as m1 already defined to loader
+        ModuleLayer.boot().defineModules(cf, mn -> loader);
+
+    }
+
+
+    /**
+     * Attempt to use defineModules to create a layer with a module containing
+     * package {@code p} where the class loader already has a module defined
+     * to it containing package {@code p}.
+     */
+    @Test(expectedExceptions = { LayerInstantiationException.class })
+    public void testPackageAlreadyInNamedModule() {
+
+        ModuleDescriptor md1 = newBuilder("m1")
+                .packages(Set.of("p"))
+                .requires("java.base")
+                .build();
+
+        ModuleDescriptor md2 = newBuilder("m2")
+                .packages(Set.of("p"))
+                .requires("java.base")
+                .build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(md1, md2);
+
+        ClassLoader loader = new ClassLoader() { };
+
+        // define m1 containing package p to class loader
+
+        Configuration parent = ModuleLayer.boot().configuration();
+
+        Configuration cf1 = parent.resolve(finder, ModuleFinder.of(), Set.of("m1"));
+
+        ModuleLayer layer1 = ModuleLayer.boot().defineModules(cf1, mn -> loader);
+
+        // attempt to define m2 containing package p to class loader
+
+        Configuration cf2 = parent.resolve(finder, ModuleFinder.of(), Set.of("m2"));
+
+        // should throw exception because p already in m1
+        ModuleLayer layer2 = ModuleLayer.boot().defineModules(cf2, mn -> loader);
+
+    }
+
+
+    /**
+     * Attempt to use defineModules to create a layer with a module
+     * containing a package in which a type is already loaded by the class
+     * loader.
+     */
+    @Test(expectedExceptions = { LayerInstantiationException.class })
+    public void testPackageAlreadyInUnnamedModule() throws Exception {
+
+        Class<?> c = layertest.Test.class;
+        assertFalse(c.getModule().isNamed());  // in unnamed module
+
+        ModuleDescriptor md = newBuilder("m")
+                .packages(Set.of(c.getPackageName()))
+                .requires("java.base")
+                .build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(md);
+
+        Configuration parent = ModuleLayer.boot().configuration();
+        Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("m"));
+
+        ModuleLayer.boot().defineModules(cf, mn -> c.getClassLoader());
+    }
+
+
+    /**
+     * Attempt to create a layer with a module named "java.base".
+     */
+    public void testLayerWithJavaBase() {
+        ModuleDescriptor descriptor = newBuilder("java.base")
+                .exports("java.lang")
+                .build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(descriptor);
+
+        Configuration cf = ModuleLayer.boot()
+            .configuration()
+            .resolve(finder, ModuleFinder.of(), Set.of("java.base"));
+        assertTrue(cf.modules().size() == 1);
+
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+
+        try {
+            ModuleLayer.boot().defineModules(cf, mn -> new ClassLoader() { });
+            assertTrue(false);
+        } catch (LayerInstantiationException e) { }
+
+        try {
+            ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
+            assertTrue(false);
+        } catch (LayerInstantiationException e) { }
+
+        try {
+            ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
+            assertTrue(false);
+        } catch (LayerInstantiationException e) { }
+    }
+
+
+    @DataProvider(name = "javaPackages")
+    public Object[][] javaPackages() {
+        return new Object[][] { { "m1", "java" }, { "m2", "java.x" } };
+    }
+
+    /**
+     * Attempt to create a layer with a module containing a "java" package.
+     * This should only be allowed when the module is defined to the platform
+     * class loader.
+     */
+    @Test(dataProvider = "javaPackages")
+    public void testLayerWithJavaPackage(String mn, String pn) {
+        ModuleDescriptor descriptor = newBuilder(mn).packages(Set.of(pn)).build();
+        ModuleFinder finder = ModuleUtils.finderOf(descriptor);
+
+        Configuration cf = ModuleLayer.boot()
+                .configuration()
+                .resolve(finder, ModuleFinder.of(), Set.of(mn));
+        assertTrue(cf.modules().size() == 1);
+
+        ClassLoader pcl = ClassLoader.getPlatformClassLoader();
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+
+        try {
+            ModuleLayer.boot().defineModules(cf, _mn -> new ClassLoader() { });
+            assertTrue(false);
+        } catch (LayerInstantiationException e) { }
+
+        try {
+            ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
+            assertTrue(false);
+        } catch (LayerInstantiationException e) { }
+
+        try {
+            ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
+            assertTrue(false);
+        } catch (LayerInstantiationException e) { }
+
+        // create layer with module defined to platform class loader
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, _mn -> pcl);
+        Optional<Module> om = layer.findModule(mn);
+        assertTrue(om.isPresent());
+        Module foo = om.get();
+        assertTrue(foo.getClassLoader() == pcl);
+        assertTrue(foo.getPackages().size() == 1);
+        assertTrue(foo.getPackages().iterator().next().equals(pn));
+    }
+
+
+    /**
+     * Attempt to create a layer with a module defined to the boot loader
+     */
+    @Test(expectedExceptions = { LayerInstantiationException.class })
+    public void testLayerWithBootLoader() {
+        ModuleDescriptor descriptor = newBuilder("m1")
+                .build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(descriptor);
+
+        Configuration cf = ModuleLayer.boot()
+            .configuration()
+            .resolve(finder, ModuleFinder.of(), Set.of("m1"));
+        assertTrue(cf.modules().size() == 1);
+
+        ModuleLayer.boot().defineModules(cf, mn -> null );
+    }
+
+
+    /**
+     * Parent of configuration != configuration of parent layer
+     */
+    @Test(expectedExceptions = { IllegalArgumentException.class })
+    public void testIncorrectParent1() {
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .requires("java.base")
+                .build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
+
+        Configuration parent = ModuleLayer.boot().configuration();
+        Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("m1"));
+
+        ClassLoader loader = new ClassLoader() { };
+        ModuleLayer.empty().defineModules(cf, mn -> loader);
+    }
+
+
+    /**
+     * Parent of configuration != configuration of parent layer
+     */
+    @Test(expectedExceptions = { IllegalArgumentException.class })
+    public void testIncorrectParent2() {
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
+
+        Configuration cf = resolve(finder, "m1");
+
+        ClassLoader loader = new ClassLoader() { };
+        ModuleLayer.boot().defineModules(cf, mn -> loader);
+    }
+
+
+    // null handling
+
+    @Test(expectedExceptions = { NullPointerException.class })
+    public void testCreateWithNull1() {
+        ClassLoader loader = new ClassLoader() { };
+        ModuleLayer.empty().defineModules(null, mn -> loader);
+    }
+
+    @Test(expectedExceptions = { NullPointerException.class })
+    public void testCreateWithNull2() {
+        Configuration cf = resolve(ModuleLayer.boot().configuration(), ModuleFinder.of());
+        ModuleLayer.boot().defineModules(cf, null);
+    }
+
+    @Test(expectedExceptions = { NullPointerException.class })
+    public void testCreateWithNull3() {
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+        ModuleLayer.empty().defineModulesWithOneLoader(null, scl);
+    }
+
+    @Test(expectedExceptions = { NullPointerException.class })
+    public void testCreateWithNull4() {
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+        ModuleLayer.empty().defineModulesWithManyLoaders(null, scl);
+    }
+
+    @Test(expectedExceptions = { NullPointerException.class })
+    public void testFindModuleWithNull() {
+        ModuleLayer.boot().findModule(null);
+    }
+
+    @Test(expectedExceptions = { NullPointerException.class })
+    public void testFindLoaderWithNull() {
+        ModuleLayer.boot().findLoader(null);
+    }
+
+
+    // immutable sets
+
+    @Test(expectedExceptions = { UnsupportedOperationException.class })
+    public void testImmutableSet() {
+        Module base = Object.class.getModule();
+        ModuleLayer.boot().modules().add(base);
+    }
+
+
+    /**
+     * Resolve the given modules, by name, and returns the resulting
+     * Configuration.
+     */
+    private static Configuration resolve(Configuration cf,
+                                         ModuleFinder finder,
+                                         String... roots) {
+        return cf.resolve(finder, ModuleFinder.of(), Set.of(roots));
+    }
+
+    private static Configuration resolve(ModuleFinder finder,
+                                         String... roots) {
+        return resolve(Configuration.empty(), finder, roots);
+    }
+}
diff --git a/jdk/test/java/lang/ModuleLayer/LayerAndLoadersTest.java b/jdk/test/java/lang/ModuleLayer/LayerAndLoadersTest.java
new file mode 100644
index 0000000..a67555a
--- /dev/null
+++ b/jdk/test/java/lang/ModuleLayer/LayerAndLoadersTest.java
@@ -0,0 +1,721 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @library /lib/testlibrary
+ * @modules jdk.compiler
+ * @build LayerAndLoadersTest CompilerUtils ModuleUtils
+ * @run testng LayerAndLoadersTest
+ * @summary Tests for java.lang.ModuleLayer@defineModulesWithXXX methods
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Optional;
+import java.util.ServiceLoader;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+@Test
+public class LayerAndLoadersTest {
+
+    private static final String TEST_SRC = System.getProperty("test.src");
+
+    private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
+    private static final Path MODS_DIR = Paths.get("mods");
+
+    @BeforeTest
+    public void setup() throws Exception {
+
+        // javac -d mods --module-source-path src src/**
+        assertTrue(CompilerUtils.compile(SRC_DIR, MODS_DIR,
+                "--module-source-path", SRC_DIR.toString()));
+    }
+
+
+    /**
+     * Basic test of ModuleLayer.defineModulesWithOneLoader
+     *
+     * Test scenario:
+     *   m1 requires m2 and m3
+     */
+    public void testWithOneLoader() throws Exception {
+
+        Configuration cf = resolve("m1");
+
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
+
+        checkLayer(layer, "m1", "m2", "m3");
+
+        ClassLoader cl1 = layer.findLoader("m1");
+        ClassLoader cl2 = layer.findLoader("m2");
+        ClassLoader cl3 = layer.findLoader("m3");
+
+        assertTrue(cl1.getParent() == scl);
+        assertTrue(cl2 == cl1);
+        assertTrue(cl3 == cl1);
+
+        invoke(layer, "m1", "p.Main");
+
+    }
+
+
+    /**
+     * Basic test of ModuleLayer.defineModulesWithManyLoaders
+     *
+     * Test scenario:
+     *   m1 requires m2 and m3
+     */
+    public void testWithManyLoaders() throws Exception {
+
+        Configuration cf = resolve("m1");
+
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
+
+        checkLayer(layer, "m1", "m2", "m3");
+
+        ClassLoader cl1 = layer.findLoader("m1");
+        ClassLoader cl2 = layer.findLoader("m2");
+        ClassLoader cl3 = layer.findLoader("m3");
+
+        assertTrue(cl1.getParent() == scl);
+        assertTrue(cl2.getParent() == scl);
+        assertTrue(cl3.getParent() == scl);
+        assertTrue(cl2 != cl1);
+        assertTrue(cl3 != cl1);
+        assertTrue(cl3 != cl2);
+
+        invoke(layer, "m1", "p.Main");
+
+    }
+
+
+    /**
+     * Basic test of ModuleLayer.defineModulesWithOneLoader where one of the
+     * modules is a service provider module.
+     *
+     * Test scenario:
+     *    m1 requires m2 and m3
+     *    m1 uses S
+     *    m4 provides S with ...
+     */
+    public void testServicesWithOneLoader() throws Exception {
+
+        Configuration cf = resolveAndBind("m1");
+
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
+
+        checkLayer(layer, "m1", "m2", "m3", "m4");
+
+        ClassLoader cl1 = layer.findLoader("m1");
+        ClassLoader cl2 = layer.findLoader("m2");
+        ClassLoader cl3 = layer.findLoader("m3");
+        ClassLoader cl4 = layer.findLoader("m4");
+
+        assertTrue(cl1.getParent() == scl);
+        assertTrue(cl2 == cl1);
+        assertTrue(cl3 == cl1);
+        assertTrue(cl4 == cl1);
+
+        Class<?> serviceType = cl1.loadClass("p.Service");
+        assertTrue(serviceType.getClassLoader() == cl1);
+
+        Iterator<?> iter = ServiceLoader.load(serviceType, cl1).iterator();
+        Object provider = iter.next();
+        assertTrue(serviceType.isInstance(provider));
+        assertTrue(provider.getClass().getClassLoader() == cl1);
+        assertFalse(iter.hasNext());
+
+    }
+
+
+    /**
+     * Basic test of ModuleLayer.defineModulesWithManyLoaders where one of the
+     * modules is a service provider module.
+     *
+     * Test scenario:
+     *    m1 requires m2 and m3
+     *    m1 uses S
+     *    m4 provides S with ...
+     */
+    public void testServicesWithManyLoaders() throws Exception {
+
+        Configuration cf = resolveAndBind("m1");
+
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
+
+        checkLayer(layer, "m1", "m2", "m3", "m4");
+
+        ClassLoader cl1 = layer.findLoader("m1");
+        ClassLoader cl2 = layer.findLoader("m2");
+        ClassLoader cl3 = layer.findLoader("m3");
+        ClassLoader cl4 = layer.findLoader("m4");
+
+        assertTrue(cl1.getParent() == scl);
+        assertTrue(cl2.getParent() == scl);
+        assertTrue(cl3.getParent() == scl);
+        assertTrue(cl4.getParent() == scl);
+        assertTrue(cl2 != cl1);
+        assertTrue(cl3 != cl1);
+        assertTrue(cl3 != cl2);
+        assertTrue(cl4 != cl1);
+        assertTrue(cl4 != cl2);
+        assertTrue(cl4 != cl3);
+
+        Class<?> serviceType = cl1.loadClass("p.Service");
+        assertTrue(serviceType.getClassLoader() == cl1);
+
+        // Test that the service provider can be located via any of
+        // the class loaders in the layer
+        for (Module m : layer.modules()) {
+            ClassLoader loader = m.getClassLoader();
+            Iterator<?> iter = ServiceLoader.load(serviceType, loader).iterator();
+            Object provider = iter.next();
+            assertTrue(serviceType.isInstance(provider));
+            assertTrue(provider.getClass().getClassLoader() == cl4);
+            assertFalse(iter.hasNext());
+        }
+
+    }
+
+
+    /**
+     * Tests that the class loaders created by defineModulesWithXXX delegate
+     * to the given parent class loader.
+     */
+    public void testDelegationToParent() throws Exception {
+
+        Configuration cf = resolve("m1");
+
+        ClassLoader parent = this.getClass().getClassLoader();
+        String cn = this.getClass().getName();
+
+        // one loader
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, parent);
+        testLoad(layer, cn);
+
+         // one loader with boot loader as parent
+        layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, null);
+        testLoadFail(layer, cn);
+
+        // many loaders
+        layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, parent);
+        testLoad(layer, cn);
+
+        // many loader with boot loader as parent
+        layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, null);
+        testLoadFail(layer, cn);
+
+    }
+
+
+    /**
+     * Test defineModulesWithXXX when modules that have overlapping packages.
+     *
+     * Test scenario:
+     *   m1 exports p
+     *   m2 exports p
+     */
+    public void testOverlappingPackages() {
+
+        ModuleDescriptor descriptor1
+            = ModuleDescriptor.newModule("m1").exports("p").build();
+
+        ModuleDescriptor descriptor2
+            = ModuleDescriptor.newModule("m2").exports("p").build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
+
+        Configuration cf = ModuleLayer.boot()
+            .configuration()
+            .resolve(finder, ModuleFinder.of(), Set.of("m1", "m2"));
+
+        // cannot define both module m1 and m2 to the same class loader
+        try {
+            ModuleLayer.boot().defineModulesWithOneLoader(cf, null);
+            assertTrue(false);
+        } catch (LayerInstantiationException expected) { }
+
+        // should be okay to have one module per class loader
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, null);
+        checkLayer(layer, "m1", "m2");
+
+    }
+
+
+    /**
+     * Test ModuleLayer.defineModulesWithXXX with split delegation.
+     *
+     * Test scenario:
+     *   layer1: m1 exports p, m2 exports p
+     *   layer2: m3 reads m1, m4 reads m2
+     */
+    public void testSplitDelegation() {
+
+        ModuleDescriptor descriptor1
+            = ModuleDescriptor.newModule("m1").exports("p").build();
+
+        ModuleDescriptor descriptor2
+            = ModuleDescriptor.newModule("m2").exports("p").build();
+
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+
+        Configuration cf1 = ModuleLayer.boot()
+            .configuration()
+            .resolve(finder1, ModuleFinder.of(), Set.of("m1", "m2"));
+
+        ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithManyLoaders(cf1, null);
+        checkLayer(layer1, "m1", "m2");
+
+        ModuleDescriptor descriptor3
+            = ModuleDescriptor.newModule("m3").requires("m1").build();
+
+        ModuleDescriptor descriptor4
+            = ModuleDescriptor.newModule("m4").requires("m2").build();
+
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3, descriptor4);
+
+        Configuration cf2 = cf1.resolve(finder2, ModuleFinder.of(),
+                                                Set.of("m3", "m4"));
+
+        // package p cannot be supplied by two class loaders
+        try {
+            layer1.defineModulesWithOneLoader(cf2, null);
+            assertTrue(false);
+        } catch (LayerInstantiationException expected) { }
+
+        // no split delegation when modules have their own class loader
+        ModuleLayer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
+        checkLayer(layer2, "m3", "m4");
+
+    }
+
+
+    /**
+     * Test ModuleLayer.defineModulesWithXXX when the modules that override same
+     * named modules in the parent layer.
+     *
+     * Test scenario:
+     *   layer1: m1, m2, m3 => same loader
+     *   layer2: m1, m2, m4 => same loader
+     */
+    public void testOverriding1() throws Exception {
+
+        Configuration cf1 = resolve("m1");
+
+        ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithOneLoader(cf1, null);
+        checkLayer(layer1, "m1", "m2", "m3");
+
+        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
+        Configuration cf2 = cf1.resolve(finder, ModuleFinder.of(),
+                                                Set.of("m1"));
+
+        ModuleLayer layer2 = layer1.defineModulesWithOneLoader(cf2, null);
+        checkLayer(layer2, "m1", "m2", "m3");
+        invoke(layer1, "m1", "p.Main");
+
+        ClassLoader loader1 = layer1.findLoader("m1");
+        ClassLoader loader2 = layer1.findLoader("m2");
+        ClassLoader loader3 = layer1.findLoader("m3");
+
+        ClassLoader loader4 = layer2.findLoader("m1");
+        ClassLoader loader5 = layer2.findLoader("m2");
+        ClassLoader loader6 = layer2.findLoader("m3");
+
+        assertTrue(loader1 == loader2);
+        assertTrue(loader1 == loader3);
+
+        assertTrue(loader4 == loader5);
+        assertTrue(loader4 == loader6);
+        assertTrue(loader4 != loader1);
+
+        assertTrue(loader1.loadClass("p.Main").getClassLoader() == loader1);
+        assertTrue(loader1.loadClass("q.Hello").getClassLoader() == loader1);
+        assertTrue(loader1.loadClass("w.Hello").getClassLoader() == loader1);
+
+        assertTrue(loader4.loadClass("p.Main").getClassLoader() == loader4);
+        assertTrue(loader4.loadClass("q.Hello").getClassLoader() == loader4);
+        assertTrue(loader4.loadClass("w.Hello").getClassLoader() == loader4);
+
+    }
+
+
+    /**
+     * Test Layer defineModulesWithXXX when the modules that override same
+     * named modules in the parent layer.
+     *
+     * Test scenario:
+     *   layer1: m1, m2, m3 => loader pool
+     *   layer2: m1, m2, m3 => loader pool
+     */
+    public void testOverriding2() throws Exception {
+
+        Configuration cf1 = resolve("m1");
+
+        ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithManyLoaders(cf1, null);
+        checkLayer(layer1, "m1", "m2", "m3");
+
+        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
+        Configuration cf2 = cf1.resolve(finder, ModuleFinder.of(),
+                                                Set.of("m1"));
+
+        ModuleLayer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
+        checkLayer(layer2, "m1", "m2", "m3");
+        invoke(layer1, "m1", "p.Main");
+
+        ClassLoader loader1 = layer1.findLoader("m1");
+        ClassLoader loader2 = layer1.findLoader("m2");
+        ClassLoader loader3 = layer1.findLoader("m3");
+
+        ClassLoader loader4 = layer2.findLoader("m1");
+        ClassLoader loader5 = layer2.findLoader("m2");
+        ClassLoader loader6 = layer2.findLoader("m3");
+
+        assertTrue(loader4 != loader1);
+        assertTrue(loader5 != loader2);
+        assertTrue(loader6 != loader3);
+
+        assertTrue(loader1.loadClass("p.Main").getClassLoader() == loader1);
+        assertTrue(loader1.loadClass("q.Hello").getClassLoader() == loader2);
+        assertTrue(loader1.loadClass("w.Hello").getClassLoader() == loader3);
+
+        // p.Main is not visible via loader2
+        try {
+            loader2.loadClass("p.Main");
+            assertTrue(false);
+        } catch (ClassNotFoundException expected) { }
+
+        // w.Hello is not visible via loader2
+        try {
+            loader2.loadClass("w.Hello");
+            assertTrue(false);
+        } catch (ClassNotFoundException expected) { }
+
+        // p.Main is not visible via loader3
+        try {
+            loader3.loadClass("p.Main");
+            assertTrue(false);
+        } catch (ClassNotFoundException expected) { }
+
+        // q.Hello is not visible via loader3
+        try {
+            loader3.loadClass("q.Hello");
+            assertTrue(false);
+        } catch (ClassNotFoundException expected) { }
+
+
+        assertTrue(loader4.loadClass("p.Main").getClassLoader() == loader4);
+        assertTrue(loader5.loadClass("q.Hello").getClassLoader() == loader5);
+        assertTrue(loader6.loadClass("w.Hello").getClassLoader() == loader6);
+
+        // p.Main is not visible via loader5
+        try {
+            loader5.loadClass("p.Main");
+            assertTrue(false);
+        } catch (ClassNotFoundException expected) { }
+
+        // w.Hello is not visible via loader5
+        try {
+            loader5.loadClass("w.Hello");
+            assertTrue(false);
+        } catch (ClassNotFoundException expected) { }
+
+        // p.Main is not visible via loader6
+        try {
+            loader6.loadClass("p.Main");
+            assertTrue(false);
+        } catch (ClassNotFoundException expected) { }
+
+        // q.Hello is not visible via loader6
+        try {
+            loader6.loadClass("q.Hello");
+            assertTrue(false);
+        } catch (ClassNotFoundException expected) { }
+
+    }
+
+
+    /**
+     * Test ModuleLayer.defineModulesWithXXX when the modules that override same
+     * named modules in the parent layer.
+     *
+     * layer1: m1, m2, m3 => same loader
+     * layer2: m1, m3 => same loader
+     */
+    public void testOverriding3() throws Exception {
+
+        Configuration cf1 = resolve("m1");
+
+        ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithOneLoader(cf1, null);
+        checkLayer(layer1, "m1", "m2", "m3");
+
+        ModuleFinder finder = finderFor("m1", "m3");
+
+        Configuration cf2 = cf1.resolve(finder, ModuleFinder.of(),
+                                                Set.of("m1"));
+
+        ModuleLayer layer2 = layer1.defineModulesWithOneLoader(cf2, null);
+        checkLayer(layer2, "m1", "m3");
+        invoke(layer1, "m1", "p.Main");
+
+        ClassLoader loader1 = layer1.findLoader("m1");
+        ClassLoader loader2 = layer2.findLoader("m1");
+
+        assertTrue(loader1.loadClass("p.Main").getClassLoader() == loader1);
+        assertTrue(loader1.loadClass("q.Hello").getClassLoader() == loader1);
+        assertTrue(loader1.loadClass("w.Hello").getClassLoader() == loader1);
+
+        assertTrue(loader2.loadClass("p.Main").getClassLoader() == loader2);
+        assertTrue(loader2.loadClass("q.Hello").getClassLoader() == loader1);
+        assertTrue(loader2.loadClass("w.Hello").getClassLoader() == loader2);
+
+    }
+
+
+    /**
+     * Test Layer defineModulesWithXXX when the modules that override same
+     * named modules in the parent layer.
+     *
+     * layer1: m1, m2, m3 => loader pool
+     * layer2: m1, m3 => loader pool
+     */
+    public void testOverriding4() throws Exception {
+
+        Configuration cf1 = resolve("m1");
+
+        ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithManyLoaders(cf1, null);
+        checkLayer(layer1, "m1", "m2", "m3");
+
+        ModuleFinder finder = finderFor("m1", "m3");
+
+        Configuration cf2 = cf1.resolve(finder, ModuleFinder.of(),
+                                                Set.of("m1"));
+
+        ModuleLayer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
+        checkLayer(layer2, "m1", "m3");
+        invoke(layer1, "m1", "p.Main");
+
+        ClassLoader loader1 = layer1.findLoader("m1");
+        ClassLoader loader2 = layer1.findLoader("m2");
+        ClassLoader loader3 = layer1.findLoader("m3");
+
+        ClassLoader loader4 = layer2.findLoader("m1");
+        ClassLoader loader5 = layer2.findLoader("m2");
+        ClassLoader loader6 = layer2.findLoader("m3");
+
+        assertTrue(loader4 != loader1);
+        assertTrue(loader5 == loader2);  // m2 not overridden
+        assertTrue(loader6 != loader3);
+
+        assertTrue(loader1.loadClass("p.Main").getClassLoader() == loader1);
+        assertTrue(loader1.loadClass("q.Hello").getClassLoader() == loader2);
+        assertTrue(loader1.loadClass("w.Hello").getClassLoader() == loader3);
+
+        assertTrue(loader2.loadClass("q.Hello").getClassLoader() == loader2);
+
+        assertTrue(loader3.loadClass("w.Hello").getClassLoader() == loader3);
+
+        assertTrue(loader4.loadClass("p.Main").getClassLoader() == loader4);
+        assertTrue(loader4.loadClass("q.Hello").getClassLoader() == loader2);
+        assertTrue(loader4.loadClass("w.Hello").getClassLoader() == loader6);
+
+        assertTrue(loader6.loadClass("w.Hello").getClassLoader() == loader6);
+
+    }
+
+
+    /**
+     * Basic test of resource loading with a class loader created by
+     * Layer.defineModulesWithOneLoader.
+     */
+    public void testResourcesOneLoader() throws Exception {
+        Configuration cf = resolve("m1");
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
+        ClassLoader loader = layer.findLoader("m1");
+        testResourceLoading(loader, "p/Main.class");
+    }
+
+    /**
+     * Basic test of resource loading with a class loader created by
+     * Layer.defineModulesWithOneLoader.
+     */
+    public void testResourcesManyLoaders() throws Exception {
+        Configuration cf = resolve("m1");
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
+        ClassLoader loader = layer.findLoader("m1");
+        testResourceLoading(loader, "p/Main.class");
+    }
+
+    /**
+     * Test that a resource is located by a class loader.
+     */
+    private void testResourceLoading(ClassLoader loader, String name)
+        throws IOException
+    {
+        URL url = loader.getResource(name);
+        assertNotNull(url);
+
+        try (InputStream in = loader.getResourceAsStream(name)) {
+            assertNotNull(in);
+        }
+
+        Enumeration<URL> urls = loader.getResources(name);
+        assertTrue(urls.hasMoreElements());
+    }
+
+
+    // -- supporting methods --
+
+
+    /**
+     * Resolve the given modules, by name, and returns the resulting
+     * Configuration.
+     */
+    private static Configuration resolve(String... roots) {
+        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
+        return ModuleLayer.boot()
+            .configuration()
+            .resolve(finder, ModuleFinder.of(), Set.of(roots));
+    }
+
+    /**
+     * Resolve the given modules, by name, and returns the resulting
+     * Configuration.
+     */
+    private static Configuration resolveAndBind(String... roots) {
+        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
+        return ModuleLayer.boot()
+            .configuration()
+            .resolveAndBind(finder, ModuleFinder.of(), Set.of(roots));
+    }
+
+
+    /**
+     * Invokes the static void main(String[]) method on the given class
+     * in the given module.
+     */
+    private static void invoke(ModuleLayer layer, String mn, String mc) throws Exception {
+        ClassLoader loader = layer.findLoader(mn);
+        Class<?> c = loader.loadClass(mc);
+        Method mainMethod = c.getMethod("main", String[].class);
+        mainMethod.invoke(null, (Object)new String[0]);
+    }
+
+
+    /**
+     * Checks that the given layer contains exactly the expected modules
+     * (by name).
+     */
+    private void checkLayer(ModuleLayer layer, String ... expected) {
+        Set<String> names = layer.modules().stream()
+                .map(Module::getName)
+                .collect(Collectors.toSet());
+        assertTrue(names.size() == expected.length);
+        for (String name : expected) {
+            assertTrue(names.contains(name));
+        }
+    }
+
+
+    /**
+     * Test that a class can be loaded via the class loader of all modules
+     * in the given layer.
+     */
+    static void testLoad(ModuleLayer layer, String cn) throws Exception {
+        for (Module m : layer.modules()) {
+            ClassLoader l = m.getClassLoader();
+            l.loadClass(cn);
+        }
+    }
+
+
+    /**
+     * Test that a class cannot be loaded via any of the class loaders of
+     * the modules in the given layer.
+     */
+    static void testLoadFail(ModuleLayer layer, String cn) throws Exception {
+        for (Module m : layer.modules()) {
+            ClassLoader l = m.getClassLoader();
+            try {
+                l.loadClass(cn);
+                assertTrue(false);
+            } catch (ClassNotFoundException expected) { }
+        }
+    }
+
+
+    /**
+     * Returns a ModuleFinder that only finds the given test modules
+     */
+    static ModuleFinder finderFor(String... names) {
+
+        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
+
+        Map<String, ModuleReference> mrefs = new HashMap<>();
+        for (String name : names) {
+            Optional<ModuleReference> omref = finder.find(name);
+            assert omref.isPresent();
+            mrefs.put(name, omref.get());
+        }
+
+        return new ModuleFinder() {
+            @Override
+            public Optional<ModuleReference> find(String name) {
+                ModuleReference mref = mrefs.get(name);
+                return Optional.ofNullable(mref);
+            }
+            @Override
+            public Set<ModuleReference> findAll() {
+                return mrefs.values().stream().collect(Collectors.toSet());
+            }
+        };
+    }
+
+}
diff --git a/jdk/test/java/lang/ModuleLayer/LayerControllerTest.java b/jdk/test/java/lang/ModuleLayer/LayerControllerTest.java
new file mode 100644
index 0000000..28246cf
--- /dev/null
+++ b/jdk/test/java/lang/ModuleLayer/LayerControllerTest.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @library /lib/testlibrary
+ * @build LayerControllerTest ModuleUtils
+ * @run testng LayerControllerTest
+ * @summary Basic tests for java.lang.ModuleLayer.Controller
+ */
+
+import java.lang.module.Configuration;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleFinder;
+import java.util.List;
+import java.util.Set;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+@Test
+public class LayerControllerTest {
+
+    /**
+     * Creates a Controller for a module layer containing modules m1 and m2.
+     * Module m1 contains p1, reads java.base, does not export/open any package
+     * Module m2 contains p2, reads java.base, does not export/open any package
+     */
+    private ModuleLayer.Controller createTestLayer() {
+        ModuleDescriptor descriptor1
+            = ModuleDescriptor.newModule("m1")
+                .packages(Set.of("p1"))
+                .requires("java.base")
+                .build();
+
+        ModuleDescriptor descriptor2
+            = ModuleDescriptor.newModule("m2")
+                .requires("java.base")
+                .packages(Set.of("p2"))
+                .build();
+
+        ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
+        ModuleLayer bootLayer = ModuleLayer.boot();
+
+        Configuration cf = bootLayer.configuration()
+                .resolve(finder, ModuleFinder.of(), Set.of("m1", "m2"));
+
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+
+        ModuleLayer.Controller controller
+            = ModuleLayer.defineModulesWithOneLoader(cf, List.of(bootLayer), scl);
+
+        ModuleLayer layer = controller.layer();
+
+        assertTrue(layer.modules().size() == 2);
+        assertTrue(layer.findModule("m1").isPresent());
+        assertTrue(layer.findModule("m2").isPresent());
+
+        return controller;
+    }
+
+    /**
+     * Basic test of Controller to update modules m1 and m2 to read and
+     * open packages to each other.
+     */
+    public void testBasic() {
+        ModuleLayer.Controller controller = createTestLayer();
+        ModuleLayer layer = controller.layer();
+        Module m1 = layer.findModule("m1").orElseThrow(RuntimeException::new);
+        Module m2 = layer.findModule("m2").orElseThrow(RuntimeException::new);
+
+        assertFalse(m1.canRead(m2));
+        assertFalse(m1.isExported("p1"));
+        assertFalse(m1.isOpen("p1"));
+        assertFalse(m1.isExported("p1", m2));
+        assertFalse(m1.isOpen("p1", m2));
+
+        assertFalse(m2.canRead(m1));
+        assertFalse(m2.isExported("p2"));
+        assertFalse(m2.isOpen("p2"));
+        assertFalse(m2.isExported("p2", m1));
+        assertFalse(m2.isOpen("p2", m1));
+
+        // update m1 to read m2
+        assertTrue(controller.addReads(m1, m2) == controller);
+        assertTrue(m1.canRead(m2));
+        assertFalse(m2.canRead(m1));
+
+        // update m2 to read m1
+        assertTrue(controller.addReads(m2, m1) == controller);
+        assertTrue(m1.canRead(m2));
+        assertTrue(m1.canRead(m1));
+
+        // update m1 to open p1 to m2
+        assertTrue(controller.addOpens(m1, "p1", m2) == controller);
+        assertTrue(m1.isExported("p1", m2));
+        assertTrue(m1.isOpen("p1", m2));
+        assertFalse(m1.isExported("p1"));
+        assertFalse(m1.isOpen("p1"));
+
+        // update m2 to open p2 to m1
+        assertTrue(controller.addOpens(m2, "p2", m1) == controller);
+        assertTrue(m2.isExported("p2", m1));
+        assertTrue(m2.isOpen("p2", m1));
+        assertFalse(m2.isExported("p2"));
+        assertFalse(m2.isOpen("p2"));
+    }
+
+    /**
+     * Test invalid argument handling
+     */
+    public void testBadArguments() {
+        ModuleLayer.Controller controller = createTestLayer();
+        ModuleLayer layer = controller.layer();
+        Module m1 = layer.findModule("m1").orElseThrow(RuntimeException::new);
+        Module m2 = layer.findModule("m2").orElseThrow(RuntimeException::new);
+        Module base = Object.class.getModule();
+
+        // java.base is not in layer
+        try {
+            controller.addReads(base, m2);
+            assertTrue(false);
+        } catch (IllegalArgumentException expected) { }
+
+        // java.base is not in layer
+        try {
+            controller.addOpens(base, "java.lang", m2);
+            assertTrue(false);
+        } catch (IllegalArgumentException expected) { }
+
+        // m1 does not contain java.lang
+        try {
+            controller.addOpens(m1, "java.lang", m2);
+            assertTrue(false);
+        } catch (IllegalArgumentException expected) { }
+    }
+
+    /**
+     * Test null handling
+     */
+    public void testNulls() {
+        ModuleLayer.Controller controller = createTestLayer();
+        ModuleLayer layer = controller.layer();
+        Module m1 = layer.findModule("m1").orElseThrow(RuntimeException::new);
+        Module m2 = layer.findModule("m2").orElseThrow(RuntimeException::new);
+        assertTrue(m1 != null);
+        assertTrue(m2 != null);
+
+        try {
+            controller.addReads(null, m2);
+            assertTrue(false);
+        } catch (NullPointerException expected) { }
+
+        try {
+            controller.addReads(m1, null);
+            assertTrue(false);
+        } catch (NullPointerException expected) { }
+
+        try {
+            controller.addOpens(null, "p1", m2);
+            assertTrue(false);
+        } catch (NullPointerException expected) { }
+
+        try {
+            controller.addOpens(m1, null, m2);
+            assertTrue(false);
+        } catch (NullPointerException expected) { }
+
+        try {
+            controller.addOpens(m1, "p1", null);
+            assertTrue(false);
+        } catch (NullPointerException expected) { }
+    }
+}
diff --git a/jdk/test/java/lang/ModuleLayer/layertest/Test.java b/jdk/test/java/lang/ModuleLayer/layertest/Test.java
new file mode 100644
index 0000000..5eac638
--- /dev/null
+++ b/jdk/test/java/lang/ModuleLayer/layertest/Test.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/**
+ * Supporting class for tests of java.lang.ModuleLayer.
+ */
+
+package layertest;
+
+public class Test { }
+
diff --git a/jdk/test/java/lang/reflect/Layer/src/m1/module-info.java b/jdk/test/java/lang/ModuleLayer/src/m1/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m1/module-info.java
rename to jdk/test/java/lang/ModuleLayer/src/m1/module-info.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m1/p/Main.java b/jdk/test/java/lang/ModuleLayer/src/m1/p/Main.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m1/p/Main.java
rename to jdk/test/java/lang/ModuleLayer/src/m1/p/Main.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m1/p/Service.java b/jdk/test/java/lang/ModuleLayer/src/m1/p/Service.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m1/p/Service.java
rename to jdk/test/java/lang/ModuleLayer/src/m1/p/Service.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m2/module-info.java b/jdk/test/java/lang/ModuleLayer/src/m2/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m2/module-info.java
rename to jdk/test/java/lang/ModuleLayer/src/m2/module-info.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m2/q/Hello.java b/jdk/test/java/lang/ModuleLayer/src/m2/q/Hello.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m2/q/Hello.java
rename to jdk/test/java/lang/ModuleLayer/src/m2/q/Hello.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m3/module-info.java b/jdk/test/java/lang/ModuleLayer/src/m3/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m3/module-info.java
rename to jdk/test/java/lang/ModuleLayer/src/m3/module-info.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m3/w/Hello.java b/jdk/test/java/lang/ModuleLayer/src/m3/w/Hello.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m3/w/Hello.java
rename to jdk/test/java/lang/ModuleLayer/src/m3/w/Hello.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m4/impl/ServiceImpl.java b/jdk/test/java/lang/ModuleLayer/src/m4/impl/ServiceImpl.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m4/impl/ServiceImpl.java
rename to jdk/test/java/lang/ModuleLayer/src/m4/impl/ServiceImpl.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m4/module-info.java b/jdk/test/java/lang/ModuleLayer/src/m4/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m4/module-info.java
rename to jdk/test/java/lang/ModuleLayer/src/m4/module-info.java
diff --git a/jdk/test/java/lang/ModuleTests/AddExportsTest.java b/jdk/test/java/lang/ModuleTests/AddExportsTest.java
new file mode 100644
index 0000000..e120461
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/AddExportsTest.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @modules java.base/jdk.internal.misc
+ *          java.desktop
+ * @run main/othervm --add-exports=java.desktop/sun.awt=java.base AddExportsTest
+ * @run main/othervm --add-exports=java.desktop/sun.awt=ALL-UNNAMED AddExportsTest
+ * @summary Test Module isExported methods with exports changed by -AddExportsTest
+ */
+
+import java.util.Optional;
+import java.util.stream.Stream;
+
+import jdk.internal.misc.VM;
+
+public class AddExportsTest {
+    /*
+     * jtreg sets -Dtest.modules system property to the internal APIs
+     * specified at @modules tag.  The test will exclude --add-exports set
+     * for @modules.
+     */
+    private static final String TEST_MODULES = System.getProperty("test.modules");
+
+    public static void main(String[] args) {
+
+        Optional<String> oaddExports = Stream.of(VM.getRuntimeArguments())
+            .filter(arg -> arg.startsWith("--add-exports="))
+            .filter(arg -> !arg.equals("--add-exports=" + TEST_MODULES + "=ALL-UNNAMED"))
+            .map(arg -> arg.substring("--add-exports=".length(), arg.length()))
+            .findFirst();
+
+        assertTrue(oaddExports.isPresent());
+
+        ModuleLayer bootLayer = ModuleLayer.boot();
+
+        Module unnamedModule = AddExportsTest.class.getModule();
+        assertFalse(unnamedModule.isNamed());
+
+        for (String expr : oaddExports.get().split(",")) {
+
+            String[] s = expr.split("=");
+            assertTrue(s.length == 2);
+
+            // $MODULE/$PACKAGE
+            String[] moduleAndPackage = s[0].split("/");
+            assertTrue(moduleAndPackage.length == 2);
+
+            String mn = moduleAndPackage[0];
+            String pn = moduleAndPackage[1];
+
+            // source module
+            Module source;
+            Optional<Module> om = bootLayer.findModule(mn);
+            assertTrue(om.isPresent(), mn + " not in boot layer");
+            source = om.get();
+
+            // package should not be exported unconditionally
+            assertFalse(source.isExported(pn),
+                        pn + " should not be exported unconditionally");
+
+            // $TARGET
+            String tn = s[1];
+            if ("ALL-UNNAMED".equals(tn)) {
+
+                // package is exported to all unnamed modules
+                assertTrue(source.isExported(pn, unnamedModule),
+                           pn + " should be exported to all unnamed modules");
+
+            } else {
+
+                om = bootLayer.findModule(tn);
+                assertTrue(om.isPresent());
+                Module target = om.get();
+
+                // package should be exported to target module
+                assertTrue(source.isExported(pn, target),
+                           pn + " should be exported to " + target);
+
+                // package should not be exported to unnamed modules
+                assertFalse(source.isExported(pn, unnamedModule),
+                            pn + " should not be exported to unnamed modules");
+
+            }
+
+        }
+    }
+
+    static void assertTrue(boolean cond) {
+        if (!cond) throw new RuntimeException();
+    }
+
+    static void assertTrue(boolean cond, String msg) {
+        if (!cond) throw new RuntimeException(msg);
+    }
+
+    static void assertFalse(boolean cond) {
+        if (cond) throw new RuntimeException();
+    }
+
+    static void assertFalse(boolean cond, String msg) {
+        if (cond) throw new RuntimeException(msg);
+    }
+
+}
diff --git a/jdk/test/java/lang/ModuleTests/AnnotationsTest.java b/jdk/test/java/lang/ModuleTests/AnnotationsTest.java
new file mode 100644
index 0000000..b4319a7
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/AnnotationsTest.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleFinder;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import jdk.internal.module.ClassFileAttributes;
+import jdk.internal.org.objectweb.asm.AnnotationVisitor;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ *          java.base/jdk.internal.module
+ *          java.xml
+ * @run testng AnnotationsTest
+ * @summary Basic test of annotations on modules
+ */
+
+public class AnnotationsTest {
+
+    /**
+     * Test that there are no annotations on an unnamed module.
+     */
+    @Test
+    public void testUnnamedModule() {
+        Module module = this.getClass().getModule();
+        assertTrue(module.getAnnotations().length == 0);
+    }
+
+    /**
+     * Test loading a module with a RuntimeVisibleAnnotation attribute.
+     * The test copies the module-info.class for java.xml, adds the attribute,
+     * and then loads the updated module.
+     */
+    @Test
+    public void testNamedModule() throws IOException {
+
+        // "deprecate" java.xml
+        Path dir = Files.createTempDirectory("mods");
+        deprecateModule("java.xml", true, "9", dir);
+
+        // "load" the cloned java.xml
+        Module module = loadModule(dir, "java.xml");
+
+        // check the annotation is present
+        assertTrue(module.isAnnotationPresent(Deprecated.class));
+        Deprecated d = module.getAnnotation(Deprecated.class);
+        assertNotNull(d, "@Deprecated not found");
+        assertTrue(d.forRemoval());
+        assertEquals(d.since(), "9");
+        Annotation[] a = module.getAnnotations();
+        assertTrue(a.length == 1);
+        assertTrue(a[0] instanceof Deprecated);
+    }
+
+
+    /**
+     * Copy the module-info.class for the given module, add the
+     * Deprecated annotation, and write the updated module-info.class
+     * to a directory.
+     */
+    static void deprecateModule(String name,
+                                boolean forRemoval,
+                                String since,
+                                Path output) throws IOException {
+        Module module = ModuleLayer.boot().findModule(name).orElse(null);
+        assertNotNull(module, name + " not found");
+
+        InputStream in = module.getResourceAsStream("module-info.class");
+        assertNotNull(in, "No module-info.class for " + name);
+
+        try (in) {
+            ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS
+                                             + ClassWriter.COMPUTE_FRAMES);
+
+            ClassVisitor cv = new ClassVisitor(Opcodes.ASM5, cw) { };
+
+            ClassReader cr = new ClassReader(in);
+
+            List<Attribute> attrs = new ArrayList<>();
+            attrs.add(new ClassFileAttributes.ModuleAttribute());
+            attrs.add(new ClassFileAttributes.ModulePackagesAttribute());
+            attrs.add(new ClassFileAttributes.ModuleTargetAttribute());
+            cr.accept(cv, attrs.toArray(new Attribute[0]), 0);
+
+            AnnotationVisitor annotationVisitor
+                = cv.visitAnnotation("Ljava/lang/Deprecated;", true);
+            annotationVisitor.visit("forRemoval", forRemoval);
+            annotationVisitor.visit("since", since);
+            annotationVisitor.visitEnd();
+
+            byte[] bytes = cw.toByteArray();
+            Path mi = output.resolve("module-info.class");
+            Files.write(mi, bytes);
+        }
+    }
+
+    /**
+     * Load the module of the given name in the given directory into a
+     * child layer.
+     */
+    static Module loadModule(Path dir, String name) throws IOException {
+        ModuleFinder finder = ModuleFinder.of(dir);
+
+        ModuleLayer bootLayer = ModuleLayer.boot();
+
+        Configuration cf = bootLayer.configuration()
+                .resolve(finder, ModuleFinder.of(), Set.of(name));
+
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+        ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+
+        Module module = layer.findModule(name).orElse(null);
+        assertNotNull(module, name + " not loaded");
+        return module;
+    }
+}
diff --git a/jdk/test/java/lang/ModuleTests/BasicModuleTest.java b/jdk/test/java/lang/ModuleTests/BasicModuleTest.java
new file mode 100644
index 0000000..b2f5eaa
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/BasicModuleTest.java
@@ -0,0 +1,329 @@
+/*
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.module.ModuleDescriptor.Exports;
+import java.lang.module.ResolvedModule;
+import java.nio.file.spi.FileSystemProvider;  // service type in java.base
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+import javax.print.PrintServiceLookup;        // service type in java.desktop
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/*
+ * @test
+ * @summary Basic test of java.lang.Module
+ * @modules java.desktop java.xml
+ * @run testng BasicModuleTest
+ */
+
+public class BasicModuleTest {
+
+    /**
+     * Tests that the given module reads all modules in the boot layer.
+     */
+    private void testReadsAllBootModules(Module m) {
+        ModuleLayer bootLayer = ModuleLayer.boot();
+        bootLayer.configuration()
+            .modules()
+            .stream()
+            .map(ResolvedModule::name)
+            .map(bootLayer::findModule)
+            .forEach(target -> assertTrue(m.canRead(target.get())));
+    }
+
+    /**
+     * Returns a {@code Predicate} to test if a package is exported.
+     */
+    private Predicate<Exports> doesExport(String pn) {
+        return e -> (e.source().equals(pn) && !e.isQualified());
+    }
+
+
+
+    @Test
+    public void testThisModule() {
+        Module thisModule = BasicModuleTest.class.getModule();
+        Module baseModule = Object.class.getModule();
+
+        assertFalse(thisModule.isNamed());
+        assertTrue(thisModule.getName() == null);
+        assertTrue(thisModule.getDescriptor() == null);
+        assertTrue(thisModule.getLayer() == null);
+        assertTrue(thisModule.toString().startsWith("unnamed module "));
+
+        ClassLoader thisLoader = BasicModuleTest.class.getClassLoader();
+        assertTrue(thisLoader == thisModule.getClassLoader());
+        assertTrue(thisLoader.getUnnamedModule() == thisModule);
+
+        // unnamed modules read all other modules
+        ClassLoader cl;
+        cl = ClassLoader.getPlatformClassLoader();
+        assertTrue(thisModule.canRead(cl.getUnnamedModule()));
+        cl = ClassLoader.getSystemClassLoader();
+        assertTrue(thisModule.canRead(cl.getUnnamedModule()));
+        testReadsAllBootModules(thisModule);
+
+        // unnamed modules export all packages
+        assertTrue(thisModule.isExported(""));
+        assertTrue(thisModule.isExported("", thisModule));
+        assertTrue(thisModule.isExported("", baseModule));
+        assertTrue(thisModule.isExported("p"));
+        assertTrue(thisModule.isExported("p", thisModule));
+        assertTrue(thisModule.isExported("p", baseModule));
+
+        // this test is in the unnamed package
+        assertTrue(thisModule.getPackages().contains(""));
+    }
+
+
+    @Test
+    public void testUnnamedModules() {
+        Module thisModule = BasicModuleTest.class.getModule();
+        Module baseModule = Object.class.getModule();
+
+        ClassLoader loader1 = ClassLoader.getSystemClassLoader();
+        ClassLoader loader2 = loader1.getParent();
+
+        Module m1 = loader1.getUnnamedModule();
+        Module m2 = loader2.getUnnamedModule();
+
+        assertTrue(m1 != m2);
+
+        assertFalse(m1.isNamed());
+        assertFalse(m2.isNamed());
+
+        assertTrue(m1.getLayer() == null);
+        assertTrue(m2.getLayer() == null);
+
+        assertTrue(m1.toString().startsWith("unnamed module "));
+        assertTrue(m2.toString().startsWith("unnamed module "));
+
+        // unnamed module reads all modules
+        assertTrue(m1.canRead(m2));
+        assertTrue(m2.canRead(m1));
+
+        testReadsAllBootModules(m1);
+        testReadsAllBootModules(m2);
+
+        assertTrue(m1.isExported(""));
+        assertTrue(m1.isExported("", thisModule));
+        assertTrue(m1.isExported("", baseModule));
+        assertTrue(m1.isExported("p"));
+        assertTrue(m1.isExported("p", thisModule));
+        assertTrue(m1.isExported("p", baseModule));
+    }
+
+
+
+    @Test
+    public void testBaseModule() {
+        Module base = Object.class.getModule();
+        Module thisModule = BasicModuleTest.class.getModule();
+
+        // getName
+        assertTrue(base.getName().equals("java.base"));
+
+        // getDescriptor
+        assertTrue(base.getDescriptor().exports().stream()
+                .anyMatch(doesExport("java.lang")));
+
+        // getClassLoader
+        assertTrue(base.getClassLoader() == null);
+
+        // getLayer
+        assertTrue(base.getLayer() == ModuleLayer.boot());
+
+        // toString
+        assertEquals(base.toString(), "module java.base");
+
+        // getPackages
+        assertTrue(base.getPackages().contains("java.lang"));
+
+        // canRead
+        assertTrue(base.canRead(base));
+        assertFalse(base.canRead(thisModule));
+
+        // addReads
+        try {
+            base.addReads(thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        assertFalse(base.canRead(thisModule));
+
+        // isExported
+        assertTrue(base.isExported("java.lang"));
+        assertTrue(base.isExported("java.lang", thisModule));
+        assertTrue(base.isExported("java.lang", base));
+        assertFalse(base.isExported("jdk.internal.misc"));
+        assertFalse(base.isExported("jdk.internal.misc", thisModule));
+        assertTrue(base.isExported("jdk.internal.misc", base));
+        assertFalse(base.isExported("java.wombat"));
+        assertFalse(base.isExported("java.wombat", thisModule));
+        assertFalse(base.isExported("java.wombat", base));
+
+        // addExports
+        try {
+            base.addExports("java.lang", thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        try {
+            base.addExports("jdk.internal.misc", thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        assertFalse(base.isExported("jdk.internal.misc"));
+        assertFalse(base.isExported("jdk.internal.misc", thisModule));
+
+        // isOpen
+        assertFalse(base.isOpen("java.lang"));
+        assertFalse(base.isOpen("java.lang", thisModule));
+        assertTrue(base.isOpen("java.lang", base));
+        assertFalse(base.isOpen("jdk.internal.misc"));
+        assertFalse(base.isOpen("jdk.internal.misc", thisModule));
+        assertTrue(base.isOpen("jdk.internal.misc", base));
+        assertFalse(base.isOpen("java.wombat"));
+        assertFalse(base.isOpen("java.wombat", thisModule));
+        assertFalse(base.isOpen("java.wombat", base));
+
+        // addOpens
+        try {
+            base.addOpens("jdk.internal.misc", thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        assertFalse(base.isOpen("jdk.internal.misc"));
+        assertFalse(base.isOpen("jdk.internal.misc", thisModule));
+
+        // canUse
+        assertTrue(base.canUse(FileSystemProvider.class));
+        assertFalse(base.canUse(Thread.class));
+
+        // addUses
+        try {
+            base.addUses(FileSystemProvider.class);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        try {
+            base.addUses(Thread.class);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        assertFalse(base.canUse(Thread.class));
+    }
+
+
+    @Test
+    public void testDesktopModule() {
+        Module desktop = java.awt.Component.class.getModule();
+        Module base = Object.class.getModule();
+        Module xml = javax.xml.XMLConstants.class.getModule();
+        Module thisModule = BasicModuleTest.class.getModule();
+
+        // name
+        assertTrue(desktop.getName().equals("java.desktop"));
+
+        // descriptor
+        assertTrue(desktop.getDescriptor().exports().stream()
+                   .anyMatch(doesExport("java.awt")));
+
+        // getClassLoader
+        assertTrue(desktop.getClassLoader() == null);
+
+        // getLayer
+        assertTrue(desktop.getLayer() == ModuleLayer.boot());
+
+        // toString
+        assertEquals(desktop.toString(), "module java.desktop");
+
+        // getPackages
+        assertTrue(desktop.getPackages().contains("java.awt"));
+        assertTrue(desktop.getPackages().contains("sun.awt"));
+
+        // canRead
+        assertTrue(desktop.canRead(base));
+        assertTrue(desktop.canRead(xml));
+
+        // addReads
+        try {
+            desktop.addReads(thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        assertFalse(desktop.canRead(thisModule));
+
+        // isExported
+        assertTrue(desktop.isExported("java.awt"));
+        assertTrue(desktop.isExported("java.awt", thisModule));
+        assertFalse(desktop.isExported("sun.awt"));
+        assertFalse(desktop.isExported("sun.awt", thisModule));
+        assertTrue(desktop.isExported("sun.awt", desktop));
+        assertFalse(desktop.isExported("java.wombat"));
+        assertFalse(desktop.isExported("java.wombat", thisModule));
+        assertFalse(desktop.isExported("java.wombat", base));
+
+        // addExports
+        try {
+            desktop.addExports("java.awt", thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        try {
+            desktop.addExports("sun.awt", thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        assertFalse(desktop.isExported("sun.awt"));
+        assertFalse(desktop.isExported("sun.awt", thisModule));
+
+        // isOpen
+        assertFalse(desktop.isOpen("java.awt"));
+        assertFalse(desktop.isOpen("java.awt", thisModule));
+        assertTrue(desktop.isOpen("java.awt", desktop));
+        assertFalse(desktop.isOpen("sun.awt"));
+        assertFalse(desktop.isOpen("sun.awt", thisModule));
+        assertTrue(desktop.isOpen("sun.awt", desktop));
+        assertFalse(desktop.isOpen("java.wombat"));
+        assertFalse(desktop.isOpen("java.wombat", thisModule));
+        assertFalse(desktop.isOpen("java.wombat", desktop));
+
+        // addOpens
+        try {
+            base.addOpens("sun.awt", thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        assertFalse(desktop.isOpen("sun.awt"));
+        assertFalse(desktop.isOpen("sun.awt", thisModule));
+
+        // canUse
+        assertTrue(base.canUse(FileSystemProvider.class));
+        assertFalse(base.canUse(Thread.class));
+
+        // addUses
+        try {
+            desktop.addUses(PrintServiceLookup.class);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        try {
+            desktop.addUses(Thread.class);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+        assertFalse(desktop.canUse(Thread.class));
+    }
+
+}
diff --git a/jdk/test/java/lang/ModuleTests/WithSecurityManager.java b/jdk/test/java/lang/ModuleTests/WithSecurityManager.java
new file mode 100644
index 0000000..88813c8
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/WithSecurityManager.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @modules jdk.compiler
+ * @summary Test java.lang.Module methods that specify permission checks
+ * @run main/othervm -Djava.security.policy=${test.src}/allow.policy WithSecurityManager allow
+ * @run main/othervm WithSecurityManager deny
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.util.Collections;
+import java.util.Optional;
+import java.util.Set;
+
+/**
+ * Test java.lang.Module methods that specify permission checks.
+ */
+
+public class WithSecurityManager {
+
+    // a module that will be loaded into a child layer
+    static final String ANOTHER_MODULE          = "jdk.compiler";
+    static final String ANOTHER_MODULE_RESOURCE = "com/sun/tools/javac/Main.class";
+
+    public static void main(String[] args) throws IOException {
+        boolean allow = args[0].equals("allow");
+
+        // base module, in the boot layer
+        Module base = Object.class.getModule();
+
+        // another module, in a child layer
+        Module other = loadModuleInChildLayer(ANOTHER_MODULE);
+        assertTrue(other.getLayer() != ModuleLayer.boot());
+
+        System.setSecurityManager(new SecurityManager());
+
+        test(base, "java/lang/Object.class", allow);
+        test(other, ANOTHER_MODULE_RESOURCE, allow);
+    }
+
+    /**
+     * Test the permission checks by invoking methods on the given module.
+     *
+     * If {@code allow} is {@code true} then the permission checks should succeed.
+     */
+    static void test(Module m, String name, boolean allow) throws IOException {
+
+        // test Module::getClassLoader
+        System.out.format("Test getClassLoader on %s ...%n", m);
+        try {
+            ClassLoader cl = m.getClassLoader();
+            System.out.println(cl);
+            if (!allow)
+                assertTrue("getClassLoader should have failed", false);
+        } catch (SecurityException e) {
+            System.out.println(e + " thrown");
+            if (allow)
+                throw e;
+        }
+
+        // test Module::getResourceAsStream
+        System.out.format("Test getResourceAsStream(\"%s\") on %s ...%n", name, m);
+        try (InputStream in = m.getResourceAsStream(name)) {
+            System.out.println(in);
+            if (allow && (in == null))
+                assertTrue(name + " not found", false);
+            if (!allow && (in != null))
+                assertTrue(name + " should not be found", false);
+        }
+
+    }
+
+    /**
+     * Create a module layer that contains the given system module.
+     */
+    static Module loadModuleInChildLayer(String mn) {
+        Optional<ModuleReference> omref = ModuleFinder.ofSystem().find(mn);
+        assertTrue("module " + mn + " not a system module", omref.isPresent());
+
+        // create a ModuleFinder that only finds this module
+        ModuleReference mref = omref.get();
+        ModuleFinder finder = new ModuleFinder() {
+            @Override
+            public Optional<ModuleReference> find(String name) {
+                if (name.equals(mn))
+                    return Optional.of(mref);
+                else
+                    return Optional.empty();
+            }
+
+            @Override
+            public Set<ModuleReference> findAll() {
+                return Collections.singleton(mref);
+            }
+        };
+
+        // create a child configuration and layer with this module
+        ModuleLayer bootLayer = ModuleLayer.boot();
+        Configuration cf = bootLayer
+            .configuration()
+            .resolve(finder, ModuleFinder.of(), Set.of(ANOTHER_MODULE));
+        ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, null);
+
+        Optional<Module> om = layer.findModule(mn);
+        assertTrue("module " + mn + " not in child layer", om.isPresent());
+        return om.get();
+    }
+
+    static void assertTrue(String msg, boolean e) {
+        if (!e)
+            throw new RuntimeException(msg);
+    }
+
+    static void assertTrue(boolean e) {
+        if (!e)
+            throw new RuntimeException();
+    }
+
+}
diff --git a/jdk/test/java/lang/reflect/Module/access/AccessTest.java b/jdk/test/java/lang/ModuleTests/access/AccessTest.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/AccessTest.java
rename to jdk/test/java/lang/ModuleTests/access/AccessTest.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/module-info.java b/jdk/test/java/lang/ModuleTests/access/src/target/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/module-info.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/module-info.java
diff --git a/jdk/test/java/lang/ModuleTests/access/src/target/p1/Helper.java b/jdk/test/java/lang/ModuleTests/access/src/target/p1/Helper.java
new file mode 100644
index 0000000..cbed4fb
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/access/src/target/p1/Helper.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p1;
+
+/**
+ * Helper class in target module to allow test invoke addExports[Private]
+ */
+
+public class Helper {
+    Helper() { }
+
+    public static void addExports(String pn, Module who) {
+        Helper.class.getModule().addExports(pn, who);
+    }
+
+    public static void addOpens(String pn, Module who) {
+        Helper.class.getModule().addOpens(pn, who);
+    }
+}
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/p1/Public.java b/jdk/test/java/lang/ModuleTests/access/src/target/p1/Public.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/p1/Public.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/p1/Public.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/p2/NonPublic.java b/jdk/test/java/lang/ModuleTests/access/src/target/p2/NonPublic.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/p2/NonPublic.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/p2/NonPublic.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/q1/Public.java b/jdk/test/java/lang/ModuleTests/access/src/target/q1/Public.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/q1/Public.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/q1/Public.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/q2/NonPublic.java b/jdk/test/java/lang/ModuleTests/access/src/target/q2/NonPublic.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/q2/NonPublic.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/q2/NonPublic.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/test/module-info.java b/jdk/test/java/lang/ModuleTests/access/src/test/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/test/module-info.java
rename to jdk/test/java/lang/ModuleTests/access/src/test/module-info.java
diff --git a/jdk/test/java/lang/ModuleTests/access/src/test/test/Main.java b/jdk/test/java/lang/ModuleTests/access/src/test/test/Main.java
new file mode 100644
index 0000000..dc81f25
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/access/src/test/test/Main.java
@@ -0,0 +1,377 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package test;
+
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+/**
+ * Test access to public/non-public members of public/non-public classes in
+ * exported and non-exported packages.
+ */
+
+public class Main {
+
+    public static void main(String[] args) throws Exception {
+        testPublicClassInExportedPackage();
+        testNonPublicClassInExportedPackage();
+        testPublicClassInNonExportedPackage();
+        testNonPublicClassInNonExportedPackage();
+    }
+
+    static void testPublicClassInExportedPackage() throws Exception {
+        Module thisModule = Main.class.getModule();
+        Module targetModule = getTargetModule();
+
+        assertTrue(targetModule.isExported("p1"));
+        assertTrue(targetModule.isExported("p1", thisModule));
+        assertTrue(targetModule.isExported("p1", targetModule));
+
+        assertFalse(targetModule.isOpen("p1"));
+        assertFalse(targetModule.isOpen("p1", thisModule));
+        assertTrue(targetModule.isOpen("p1", targetModule));
+
+        Class<?> clazz = Class.forName("p1.Public");
+        Constructor<?> ctor1 = clazz.getConstructor();   // public
+        Constructor<?> ctor2 = clazz.getDeclaredConstructor(Void.class); // non-public
+
+        Field f1 = clazz.getField("f1");    // public
+        Field f2 = clazz.getDeclaredField("f2");    // non-public
+
+        Method m1 = clazz.getMethod("foo");  // public
+        Method m2 = clazz.getDeclaredMethod("bar");  // non-public
+
+        tryAccessConstructor(ctor1, true);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, true);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, true);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, true);
+        trySetAccessible(ctor2, false);
+        trySetAccessible(m1, true);
+        trySetAccessible(m2, false);
+        trySetAccessible(f1, true);
+        trySetAccessible(f2, false);
+
+        targetAddOpens("p1", thisModule);
+
+        tryAccessConstructor(ctor1, true);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, true);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, true);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, true);
+        trySetAccessible(ctor2, true);
+        trySetAccessible(m1, true);
+        trySetAccessible(m2, true);
+        trySetAccessible(f1, true);
+        trySetAccessible(f2, true);
+    }
+
+    static void testNonPublicClassInExportedPackage() throws Exception {
+        Module thisModule = Main.class.getModule();
+        Module targetModule = getTargetModule();
+
+        assertTrue(targetModule.isExported("p2"));
+        assertTrue(targetModule.isExported("p2", thisModule));
+        assertTrue(targetModule.isExported("p2", targetModule));
+
+        assertFalse(targetModule.isOpen("p2"));
+        assertFalse(targetModule.isOpen("p2", thisModule));
+        assertTrue(targetModule.isOpen("p1", targetModule));
+
+        Class<?> clazz = Class.forName("p2.NonPublic");
+        Constructor<?> ctor1 = clazz.getConstructor();
+        Constructor<?> ctor2 = clazz.getDeclaredConstructor(Void.class);
+
+        Field f1 = clazz.getField("f1");    // public
+        Field f2 = clazz.getDeclaredField("f2");    // non-public
+
+        Method m1 = clazz.getMethod("foo");  // public
+        Method m2 = clazz.getDeclaredMethod("bar");  // non-public
+
+        tryAccessConstructor(ctor1, false);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, false);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, false);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, false);
+        trySetAccessible(ctor2, false);
+        trySetAccessible(m1, false);
+        trySetAccessible(m2, false);
+        trySetAccessible(f1, false);
+        trySetAccessible(f2, false);
+
+        targetAddExports("p2", thisModule);
+
+        tryAccessConstructor(ctor1, false);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, false);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, false);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, false);
+        trySetAccessible(ctor2, false);
+        trySetAccessible(m1, false);
+        trySetAccessible(m2, false);
+        trySetAccessible(f1, false);
+        trySetAccessible(f2, false);
+
+        targetAddOpens("p2", thisModule);
+
+        tryAccessConstructor(ctor1, false);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, false);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, false);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, true);
+        trySetAccessible(ctor2, true);
+        trySetAccessible(m1, true);
+        trySetAccessible(m2, true);
+        trySetAccessible(f1, true);
+        trySetAccessible(f2, true);
+    }
+
+    static void testPublicClassInNonExportedPackage() throws Exception {
+        Module thisModule = Main.class.getModule();
+        Module targetModule = getTargetModule();
+
+        assertFalse(targetModule.isExported("q1"));
+        assertFalse(targetModule.isExported("q1", thisModule));
+        assertTrue(targetModule.isExported("q1", targetModule));
+
+        assertFalse(targetModule.isOpen("q1"));
+        assertFalse(targetModule.isOpen("q1", thisModule));
+        assertTrue(targetModule.isOpen("q1", targetModule));
+
+        Class<?> clazz = Class.forName("q1.Public");
+        Constructor<?> ctor1 = clazz.getConstructor();  // public
+        Constructor<?> ctor2 = clazz.getDeclaredConstructor(Void.class);  // non-public
+
+        Field f1 = clazz.getField("f1");    // public
+        Field f2 = clazz.getDeclaredField("f2");    // non-public
+
+        Method m1 = clazz.getMethod("foo");  // public
+        Method m2 = clazz.getDeclaredMethod("bar");  // non-public
+
+        tryAccessConstructor(ctor1, false);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, false);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, false);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, false);
+        trySetAccessible(ctor2, false);
+        trySetAccessible(m1, false);
+        trySetAccessible(m2, false);
+        trySetAccessible(f1, false);
+        trySetAccessible(f2, false);
+
+        targetAddExports("q1", thisModule);
+
+        tryAccessConstructor(ctor1, true);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, true);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, true);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, true);
+        trySetAccessible(ctor2, false);
+        trySetAccessible(m1, true);
+        trySetAccessible(m2, false);
+        trySetAccessible(f1, true);
+        trySetAccessible(f2, false);
+
+        targetAddOpens("q1", thisModule);
+
+        tryAccessConstructor(ctor1, true);
+        tryAccessConstructor(ctor1, false);
+        tryAccessMethod(m1, true);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, true);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, true);
+        trySetAccessible(ctor2, true);
+        trySetAccessible(m1, true);
+        trySetAccessible(m2, true);
+        trySetAccessible(f1, true);
+        trySetAccessible(f2, true);
+    }
+
+    static void testNonPublicClassInNonExportedPackage() throws Exception {
+        Module thisModule = Main.class.getModule();
+        Module targetModule = getTargetModule();
+
+        assertFalse(targetModule.isExported("q2"));
+        assertFalse(targetModule.isExported("q2", thisModule));
+        assertTrue(targetModule.isExported("q2", targetModule));
+
+        assertFalse(targetModule.isOpen("q2"));
+        assertFalse(targetModule.isOpen("q2", thisModule));
+        assertTrue(targetModule.isOpen("q2", targetModule));
+
+        Class<?> clazz = Class.forName("q2.NonPublic");
+        Constructor<?> ctor1 = clazz.getConstructor();  // public
+        Constructor<?> ctor2 = clazz.getDeclaredConstructor(Void.class);  // non-public
+
+        Field f1 = clazz.getField("f1");    // public
+        Field f2 = clazz.getDeclaredField("f2");    // non-public
+
+        Method m1 = clazz.getMethod("foo");  // public
+        Method m2 = clazz.getDeclaredMethod("bar");  // non-public
+
+        tryAccessConstructor(ctor1, false);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, false);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, false);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, false);
+        trySetAccessible(ctor2, false);
+        trySetAccessible(m1, false);
+        trySetAccessible(m2, false);
+        trySetAccessible(f1, false);
+        trySetAccessible(f2, false);
+
+        targetAddExports("q2", thisModule);
+
+        tryAccessConstructor(ctor1, false);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, false);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, false);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, false);
+        trySetAccessible(ctor2, false);
+        trySetAccessible(m1, false);
+        trySetAccessible(m2, false);
+        trySetAccessible(f1, false);
+        trySetAccessible(f2, false);
+
+        targetAddOpens("q2", thisModule);
+
+        tryAccessConstructor(ctor1, false);
+        tryAccessConstructor(ctor2, false);
+        tryAccessMethod(m1, false);
+        tryAccessMethod(m2, false);
+        tryAccessObjectField(f1, false);
+        tryAccessObjectField(f2, false);
+
+        trySetAccessible(ctor1, true);
+        trySetAccessible(m1, true);
+        trySetAccessible(m2, true);
+        trySetAccessible(f1, true);
+        trySetAccessible(f2, true);
+    }
+
+
+    static Module getTargetModule() {
+        return ModuleLayer.boot().findModule("target").get();
+    }
+
+    static void tryAccessConstructor(Constructor<?> ctor, boolean shouldSucceed) {
+        try {
+            ctor.newInstance();
+            assertTrue(shouldSucceed);
+        } catch (Exception e) {
+            assertFalse(shouldSucceed);
+        }
+    }
+
+    static void tryAccessMethod(Method method, boolean shouldSucceed) {
+        try {
+            method.invoke(null);
+            assertTrue(shouldSucceed);
+        } catch (Exception e) {
+            e.printStackTrace();
+            assertFalse(shouldSucceed);
+        }
+    }
+
+    static void tryAccessObjectField(Field f, boolean shouldSucceed) {
+        try {
+            f.get(null);
+            assertTrue(shouldSucceed);
+        } catch (Exception e) {
+            assertFalse(shouldSucceed);
+        }
+        try {
+            f.set(null, new Object());
+            assertTrue(shouldSucceed);
+        } catch (Exception e) {
+            assertFalse(shouldSucceed);
+        }
+    }
+
+    static void trySetAccessible(AccessibleObject ao, boolean shouldSucceed) {
+        try {
+            ao.setAccessible(true);
+            assertTrue(shouldSucceed);
+        } catch (Exception e) {
+            assertFalse(shouldSucceed);
+        }
+    }
+
+    /**
+     * Update target module to export a package to the given module.
+     */
+    static void targetAddExports(String pn, Module who) throws Exception {
+        Class<?> helper = Class.forName("p1.Helper");
+        Method m = helper.getMethod("addExports", String.class, Module.class);
+        m.invoke(null, pn, who);
+    }
+
+    /**
+     * Update target module to open a package to the given module.
+     */
+    static void targetAddOpens(String pn, Module who) throws Exception {
+        Class<?> helper = Class.forName("p1.Helper");
+        Method m = helper.getMethod("addOpens", String.class, Module.class);
+        m.invoke(null, pn, who);
+    }
+
+    static void assertTrue(boolean expr) {
+        if (!expr) throw new RuntimeException();
+    }
+
+    static void assertFalse(boolean expr) {
+        assertTrue(!expr);
+    }
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/Driver.java b/jdk/test/java/lang/ModuleTests/addXXX/Driver.java
new file mode 100644
index 0000000..0daf09ff
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/Driver.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @build test/* m1/* m2/* m3/* m4/*
+ * @run testng/othervm test/test.Main
+ * @summary Basic test case for Module::addXXX methods
+ */
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/m1/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/m1/module-info.java
new file mode 100644
index 0000000..a34a266
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m1/module-info.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+module m1 {
+    exports p1;
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/m1/p1/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m1/p1/C.java
new file mode 100644
index 0000000..8635761
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m1/p1/C.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package p1;
+
+public class C {
+    public C() { }
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/m2/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/m2/module-info.java
new file mode 100644
index 0000000..918d72a
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m2/module-info.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+module m2 {
+    exports p2;
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/m2/p2/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m2/p2/C.java
new file mode 100644
index 0000000..d3c5f46
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m2/p2/C.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package p2;
+
+public class C {
+
+    public static void export(String pn, Module m) {
+        C.class.getModule().addExports(pn, m);
+    }
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/m2/p2/internal/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m2/p2/internal/C.java
new file mode 100644
index 0000000..b300961
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m2/p2/internal/C.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package p2.internal;
+
+public class C {
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/m3/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/m3/module-info.java
new file mode 100644
index 0000000..75d5c16
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m3/module-info.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+module m3 {
+    exports p3 to test;
+    opens p3 to test;
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/m3/p3/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m3/p3/C.java
new file mode 100644
index 0000000..c1013ce
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m3/p3/C.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package p3;
+
+public class C {
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/m4/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/m4/module-info.java
new file mode 100644
index 0000000..313ea94
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m4/module-info.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+module m4 {
+    exports p4;
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/m4/p4/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m4/p4/C.java
new file mode 100644
index 0000000..a5e9a12
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m4/p4/C.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package p4;
+
+import java.lang.reflect.Constructor;
+
+public class C {
+    public static Object tryNewInstance(Class<?> clazz) throws Exception {
+        Constructor<?> ctor = clazz.getDeclaredConstructor();
+        return ctor.newInstance();
+    }
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/test/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/test/module-info.java
new file mode 100644
index 0000000..ebfab74
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/test/module-info.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+module test {
+    exports test to testng;
+
+    requires m2;
+    requires m3;
+    requires m4;
+    requires testng;
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/test/test/C.java b/jdk/test/java/lang/ModuleTests/addXXX/test/test/C.java
new file mode 100644
index 0000000..e031680
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/test/test/C.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package test;
+
+public class C { }
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/test/test/Main.java b/jdk/test/java/lang/ModuleTests/addXXX/test/test/Main.java
new file mode 100644
index 0000000..9a191a1
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/test/test/Main.java
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package test;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.Constructor;
+import java.util.ServiceConfigurationError;
+import java.util.ServiceLoader;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * Basic test case for Module::addXXXX methods
+ */
+
+@Test
+public class Main {
+
+    /**
+     * Test Module::addReads
+     *
+     *     module test { }
+     *
+     *     module m1 {
+     *         exports p1;
+     *     }
+     */
+    public void testAddReads() throws Throwable {
+        Module thisModule = Main.class.getModule();
+        Class<?> clazz = Class.forName("p1.C");
+        Module m1 = clazz.getModule();
+
+        // test does not read m1
+        assertFalse(thisModule.canRead(m1));
+        MethodHandles.Lookup lookup = MethodHandles.lookup();
+        MethodType mt = MethodType.methodType(void.class);
+        try {
+            lookup.findConstructor(clazz, mt);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        // update test to read m1
+        Module result = thisModule.addReads(m1);
+        assertTrue(result== thisModule);
+        assertTrue(thisModule.canRead(m1));
+        MethodHandle mh = lookup.findConstructor(clazz, mt);
+        Object obj = mh.invoke();
+
+        // attempt to update m1 to read test
+        try {
+            m1.addReads(thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+    }
+
+
+    /**
+     * Test Module::addExports
+     *
+     *     module test {
+     *         requires m2;
+     *     }
+     *     module m2 {
+     *         exports p2;
+     *         contains package p2.internal;
+     *     }
+     */
+    public void testAddExports() throws Exception {
+        Module thisModule = Main.class.getModule();
+        Module m2 = p2.C.class.getModule();
+        Class<?> targetClass = Class.forName("p2.internal.C");
+        String p2Internal = targetClass.getPackageName();
+        assertTrue(targetClass.getModule() == m2);
+
+        // m2 does not export p2.internal to test
+        assertFalse(m2.isExported(p2Internal, thisModule));
+        Constructor<?> ctor = targetClass.getDeclaredConstructor();
+        try {
+            ctor.newInstance();
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        // update m2 to export p2.internal to test
+        p2.C.export(p2Internal, thisModule);
+        assertTrue(m2.isExported(p2Internal, thisModule));
+        ctor.newInstance(); // should succeed
+
+        // attempt to update m2 to export a package to test
+        try {
+            m2.addExports("p2.other", thisModule);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+    }
+
+    /**
+     * Test Module::addOpens
+     *
+     *     module test {
+     *         requires m3;
+     *         requires m4;
+     *     }
+     *
+     *     module m3 {
+     *         exports p3 to test;
+     *         opens p3 to test;
+     *     }
+     *
+     *     module m4 {
+     *         exports p4;
+     *     }
+     */
+    public void testAddOpens() throws Exception {
+        Module thisModule = Main.class.getModule();
+        Module m3 = p3.C.class.getModule();
+        Module m4 = p4.C.class.getModule();
+
+        // test does not open package test to m4
+        assertFalse(thisModule.isOpen("test", m4));
+        try {
+            p4.C.tryNewInstance(test.C.class);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        // open test to m4
+        thisModule.addOpens("test", m4);
+        p4.C.tryNewInstance(test.C.class);  // should succeed
+
+
+        // m3 does not open p3 to m4
+        assertFalse(m3.isOpen("p3", m4));
+        try {
+            p4.C.tryNewInstance(p3.C.class);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+
+        // m3 opens p3 to test => test allowed to open m3/p3 to m4
+        assertTrue(m3.isOpen("p3", thisModule));
+        m3.addOpens("p3", m4);
+        assertTrue(m3.isOpen("p3", m4));
+        p4.C.tryNewInstance(p3.C.class);   // should succeed
+
+
+        // attempt to update m4 to open package to m3
+        try {
+            m4.addOpens("p4", m3);
+            assertTrue(false);
+        } catch (IllegalCallerException expected) { }
+    }
+
+
+    /**
+     * Test Module::addUses
+     */
+    public void testAddUses() {
+        Module thisModule = Main.class.getModule();
+
+        assertFalse(thisModule.canUse(Service.class));
+        try {
+            ServiceLoader.load(Service.class);
+            assertTrue(false);
+        } catch (ServiceConfigurationError expected) { }
+
+        Module result = thisModule.addUses(Service.class);
+        assertTrue(result== thisModule);
+
+        assertTrue(thisModule.canUse(Service.class));
+        ServiceLoader.load(Service.class); // no exception
+    }
+
+}
diff --git a/jdk/test/java/lang/ModuleTests/addXXX/test/test/Service.java b/jdk/test/java/lang/ModuleTests/addXXX/test/test/Service.java
new file mode 100644
index 0000000..9fd5b8d
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/addXXX/test/test/Service.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package test;
+
+/**
+ * Simple service type
+ */
+public interface Service { }
diff --git a/jdk/test/java/lang/ModuleTests/allow.policy b/jdk/test/java/lang/ModuleTests/allow.policy
new file mode 100644
index 0000000..51db5b9
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/allow.policy
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+grant {
+    permission java.lang.RuntimePermission "getClassLoader";
+    permission java.lang.RuntimePermission "accessSystemModules";
+    permission java.io.FilePermission "${java.home}/modules/-", "read";    // exploded build
+};
diff --git a/jdk/test/java/lang/ModuleTests/annotation/Basic.java b/jdk/test/java/lang/ModuleTests/annotation/Basic.java
new file mode 100644
index 0000000..dc17cbb
--- /dev/null
+++ b/jdk/test/java/lang/ModuleTests/annotation/Basic.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @library src
+ * @build m/* Basic
+ * @run testng/othervm Basic
+ * @summary Basic test for annotations on modules
+ */
+
+import java.util.Arrays;
+
+import p.annotation.Foo;
+import p.annotation.Bar;
+import p.annotation.Baz;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+public class Basic {
+
+    final Module module = Foo.class.getModule();
+
+    /**
+     * {@code @Foo} does not have RUNTIME retention policy.
+     */
+    @Test
+    public void testInvisibleAnnotation() {
+        assertFalse(module.isAnnotationPresent(Foo.class));
+        assertNull(module.getAnnotation(Foo.class));
+    }
+
+    /**
+     * {@code @Bar} has RUNTIME retention policy and value "bar"
+     */
+    @Test
+    public void testBarAnnotation() {
+        assertTrue(module.isAnnotationPresent(Bar.class));
+        Bar bar = module.getAnnotation(Bar.class);
+        assertNotNull(bar);
+        assertEquals(bar.value(), "bar");
+    }
+
+    /**
+     * {@code @Baz} has RUNTIME retention policy has a repeating value
+     */
+    @Test
+    public void testBazAnnotation() {
+        assertTrue(module.isAnnotationPresent(Baz.class));
+        Baz baz = module.getAnnotation(Baz.class);
+        assertNotNull(baz);
+        String[] expected = { "one", "two", "three" };
+        assertTrue(Arrays.equals(baz.value(), expected));
+    }
+}
diff --git a/jdk/test/java/lang/reflect/Module/annotation/src/m/module-info.java b/jdk/test/java/lang/ModuleTests/annotation/src/m/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/annotation/src/m/module-info.java
rename to jdk/test/java/lang/ModuleTests/annotation/src/m/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Bar.java b/jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Bar.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Bar.java
rename to jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Bar.java
diff --git a/jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Baz.java b/jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Baz.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Baz.java
rename to jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Baz.java
diff --git a/jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Foo.java b/jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Foo.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Foo.java
rename to jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Foo.java
diff --git a/jdk/test/java/lang/Package/annotation/PackageInfoTest.java b/jdk/test/java/lang/Package/annotation/PackageInfoTest.java
index 6e41390..24806b9 100644
--- a/jdk/test/java/lang/Package/annotation/PackageInfoTest.java
+++ b/jdk/test/java/lang/Package/annotation/PackageInfoTest.java
@@ -25,8 +25,7 @@
  * @test
  * @summary Basic test of package-info in named module and duplicate
  *          package-info in unnamed module
- * @modules java.compiler
- *          java.desktop
+ * @modules java.desktop
  *          jdk.compiler
  *          jdk.xml.dom
  * @build jdk.xml.dom/org.w3c.dom.css.Fake
diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java
index 729b249..b7bb1ab 100644
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
  *      6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958
  *      4947220 7018606 7034570 4244896 5049299 8003488 8054494 8058464
  *      8067796
+ * @key intermittent
  * @summary Basic tests for Process and Environment Variable code
  * @modules java.base/java.lang:open
  * @run main/othervm/timeout=300 Basic
@@ -310,7 +311,7 @@
             if (action.equals("sleep")) {
                 Thread.sleep(10 * 60 * 1000L);
             } else if (action.equals("pid")) {
-                System.out.println(ProcessHandle.current().getPid());
+                System.out.println(ProcessHandle.current().pid());
             } else if (action.equals("testIO")) {
                 String expected = "standard input";
                 char[] buf = new char[expected.length()+1];
@@ -1234,7 +1235,7 @@
             Process p = pb.start();
             String s = commandOutput(p);
             long actualPid = Long.valueOf(s.trim());
-            long expectedPid = p.getPid();
+            long expectedPid = p.pid();
             equal(actualPid, expectedPid);
         } catch (Throwable t) {
             unexpected(t);
@@ -1244,7 +1245,7 @@
         // Test the default implementation of Process.getPid
         DelegatingProcess p = new DelegatingProcess(null);
         THROWS(UnsupportedOperationException.class,
-                () -> p.getPid(),
+                () -> p.pid(),
                 () -> p.toHandle(),
                 () -> p.supportsNormalTermination(),
                 () -> p.children(),
@@ -2242,7 +2243,7 @@
                 // Child process waits until it gets input
                 String s = p.toString();
                 check(s.contains("not exited"));
-                check(s.contains("pid=" + p.getPid() + ","));
+                check(s.contains("pid=" + p.pid() + ","));
 
                 new PrintStream(p.getOutputStream()).print("standard input");
                 p.getOutputStream().close();
@@ -2250,7 +2251,7 @@
                 // Check the toString after it exits
                 int exitValue = p.waitFor();
                 s = p.toString();
-                check(s.contains("pid=" + p.getPid() + ","));
+                check(s.contains("pid=" + p.pid() + ","));
                 check(s.contains("exitValue=" + exitValue) &&
                         !s.contains("not exited"));
             }
diff --git a/jdk/test/java/lang/ProcessBuilder/PipelineTest.java b/jdk/test/java/lang/ProcessBuilder/PipelineTest.java
index 90b277a..b2c1bd7 100644
--- a/jdk/test/java/lang/ProcessBuilder/PipelineTest.java
+++ b/jdk/test/java/lang/ProcessBuilder/PipelineTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -212,7 +212,7 @@
 
     static void print(ProcessHandle p) {
         System.out.printf("process: pid: %d, info: %s%n",
-                p.getPid(), p.info());
+                p.pid(), p.info());
     }
 
     // Check various aspects of the processes
diff --git a/jdk/test/java/lang/ProcessBuilder/Zombies.java b/jdk/test/java/lang/ProcessBuilder/Zombies.java
index 10c804e..2529960 100644
--- a/jdk/test/java/lang/ProcessBuilder/Zombies.java
+++ b/jdk/test/java/lang/ProcessBuilder/Zombies.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@
             ! new File("/bin/ps").canExecute())
             return;
         System.out.println("Looks like a Unix system.");
-        long mypid = ProcessHandle.current().getPid();
+        long mypid = ProcessHandle.current().pid();
         System.out.printf("mypid: %d%n", mypid);
 
         final Runtime rt = Runtime.getRuntime();
@@ -65,7 +65,7 @@
 
         Process p = rt.exec(TrueCommand);
         ProcessHandle pp = p.toHandle().parent().orElse(null);
-        System.out.printf("%s pid: %d, parent: %s%n", TrueCommand, p.getPid(), pp);
+        System.out.printf("%s pid: %d, parent: %s%n", TrueCommand, p.pid(), pp);
         p.waitFor();
 
         // Count all the zombies that are children of this Java process
diff --git a/jdk/test/java/lang/ProcessHandle/Basic.java b/jdk/test/java/lang/ProcessHandle/Basic.java
index c34bcab..34e1021 100644
--- a/jdk/test/java/lang/ProcessHandle/Basic.java
+++ b/jdk/test/java/lang/ProcessHandle/Basic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,13 +66,13 @@
     public static void test2() {
         try {
             ProcessHandle self = ProcessHandle.current();
-            long pid = self.getPid();       // known native process id
+            long pid = self.pid();       // known native process id
             Optional<ProcessHandle> self1 = ProcessHandle.of(pid);
             assertEquals(self1.get(), self,
-                    "ProcessHandle.of(x.getPid()) should be equal getPid() %d: %d");
+                    "ProcessHandle.of(x.pid()) should be equal pid() %d: %d");
 
             Optional<ProcessHandle> ph = ProcessHandle.of(pid);
-            assertEquals(pid, ph.get().getPid());
+            assertEquals(pid, ph.get().pid());
         } finally {
             // Cleanup any left over processes
             ProcessHandle.current().children().forEach(ProcessHandle::destroy);
@@ -98,7 +98,7 @@
             Process p = new ProcessBuilder("sleep", "0").start();
             p.waitFor();
 
-            long deadPid = p.getPid();
+            long deadPid = p.pid();
             p = null;               // Forget the process
 
             Optional<ProcessHandle> t = ProcessHandle.of(deadPid);
diff --git a/jdk/test/java/lang/ProcessHandle/JavaChild.java b/jdk/test/java/lang/ProcessHandle/JavaChild.java
index b476bf0..18bb89b 100644
--- a/jdk/test/java/lang/ProcessHandle/JavaChild.java
+++ b/jdk/test/java/lang/ProcessHandle/JavaChild.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
 import java.io.InputStreamReader;
 import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.PrintStream;
 import java.io.Reader;
 import java.io.PrintWriter;
 import java.lang.InterruptedException;
@@ -39,9 +38,11 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.Optional;
 import java.util.function.Consumer;
 
 
@@ -158,7 +159,7 @@
      */
     CompletableFuture<String> forEachOutputLine(Consumer<String> consumer) {
         final CompletableFuture<String> future = new CompletableFuture<>();
-        String name = "OutputLineReader-" + getPid();
+        String name = "OutputLineReader-" + pid();
         Thread t = new Thread(() -> {
             try (BufferedReader reader = outputReader()) {
                 String line;
@@ -166,7 +167,7 @@
                     consumer.accept(line);
                 }
             } catch (IOException | RuntimeException ex) {
-                consumer.accept("IOE (" + getPid() + "):" + ex.getMessage());
+                consumer.accept("IOE (" + pid() + "):" + ex.getMessage());
                 future.completeExceptionally(ex);
             }
             future.complete("success");
@@ -326,7 +327,7 @@
                                 try {
                                     p.getOutputStream().close();
                                 } catch (IOException ie) {
-                                    sendResult("stdin_closing", p.getPid(),
+                                    sendResult("stdin_closing", p.pid(),
                                             "exception", ie.getMessage());
                                 }
                             }
@@ -351,9 +352,9 @@
                                             "children to terminate%n");
                                     children.removeAll(completedChildren);
                                     for (JavaChild c : children) {
-                                        sendResult("stdin_noterm", c.getPid());
+                                        sendResult("stdin_noterm", c.pid());
                                         System.err.printf("  Process not terminated: " +
-                                                "pid: %d%n", c.getPid());
+                                                "pid: %d%n", c.pid());
                                     }
                                     System.exit(2);
                                 }
@@ -385,11 +386,11 @@
                         System.arraycopy(args, nextArg, subargs, 0, subargs.length);
                         for (int i = 0; i < ncount; i++) {
                             JavaChild p = spawnJavaChild(subargs);
-                            sendResult(action, p.getPid());
+                            sendResult(action, p.pid());
                             p.forEachOutputLine(JavaChild::sendRaw);
                             p.onJavaChildExit().thenAccept((p1) -> {
                                 int excode = p1.exitValue();
-                                sendResult("child_exit", p1.getPid(), excode);
+                                sendResult("child_exit", p1.pid(), excode);
                                 completedChildren.add(p1);
                             });
                             children.add(p);        // Add child to spawned list
@@ -409,7 +410,7 @@
                             if (p.isAlive()) {
                                 sentCount++;
                                 // overwrite with current pid
-                                result[0] = Long.toString(p.getPid());
+                                result[0] = Long.toString(p.pid());
                                 sendResult(action, result);
                                 p.sendAction(args[nextArg], subargs);
                             }
@@ -425,7 +426,7 @@
                         // ignoring those that are not alive
                         for (JavaChild p : children) {
                             if (p.isAlive()) {
-                                sendResult(action, p.getPid());
+                                sendResult(action, p.pid());
                                 p.getOutputStream().close();
                             }
                         }
@@ -437,6 +438,11 @@
                     case "threaddump":
                         Thread.dumpStack();
                         break;
+                    case "waitpid":
+                        long pid = Long.parseLong(args[nextArg++]);
+                        Optional<String> s = ProcessHandle.of(pid).map(ph -> waitAlive(ph));
+                        sendResult(action, s.orElse("pid not valid: " + pid));
+                        break;
                     default:
                         throw new Error("JavaChild action unknown: " + action);
                 }
@@ -447,6 +453,17 @@
         }
     }
 
+    private static String waitAlive(ProcessHandle ph) {
+        String status;
+        try {
+            boolean isAlive = ph.onExit().get().isAlive();
+            status = Boolean.toString(isAlive);
+        } catch (InterruptedException | ExecutionException ex ) {
+            status = "interrupted";
+        }
+        return status;
+    }
+
     static synchronized void sendRaw(String s) {
         System.out.println(s);
         System.out.flush();
@@ -476,6 +493,7 @@
         System.err.println("  spawn <n> command... - spawn n new children and send command");
         System.err.println("  child command... - send command to all live children");
         System.err.println("  child_eof - send eof to all live children");
+        System.err.println("  waitpid <pid> - wait for the pid to exit");
         System.err.println("  exit <exitcode>");
         System.err.println("  out arg...");
         System.err.println("  err arg...");
@@ -487,7 +505,7 @@
         String command;
         Object[] results;
         Event(String command, Object... results) {
-            this(self.getPid(), ++commandSeq, command, results);
+            this(self.pid(), ++commandSeq, command, results);
         }
         Event(long pid, int seq, String command, Object... results) {
             this.pid = pid;
diff --git a/jdk/test/java/lang/ProcessHandle/OnExitTest.java b/jdk/test/java/lang/ProcessHandle/OnExitTest.java
index ff9f4c2..9bdc566 100644
--- a/jdk/test/java/lang/ProcessHandle/OnExitTest.java
+++ b/jdk/test/java/lang/ProcessHandle/OnExitTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,11 @@
 import java.time.Instant;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 
 import jdk.test.lib.Utils;
 
@@ -102,7 +104,7 @@
 
             JavaChild proc = JavaChild.spawnJavaChild("stdin");
             procHandle = proc.toHandle();
-            printf(" spawned: %d%n", proc.getPid());
+            printf(" spawned: %d%n", proc.pid());
 
             proc.forEachOutputLine((s) -> {
                 String[] split = s.trim().split(" ");
@@ -196,4 +198,95 @@
         }
     }
 
+    /**
+     * Verify that onExit completes for a non-child process only when
+     * the process has exited.
+     * Spawn a child (A) waiting to be commanded to exit.
+     * Spawn a child (B) to wait for that process to exit.
+     * Command (A) to exit.
+     * Check that (B) does not complete until (A) has exited.
+     */
+    @Test
+    public static void peerOnExitTest() {
+        String line = null;
+        ArrayBlockingQueue<String> alines = new ArrayBlockingQueue<>(100);
+        ArrayBlockingQueue<String> blines = new ArrayBlockingQueue<>(100);
+        JavaChild A = null;
+        try {
+            String[] split;
+            A = JavaChild.spawnJavaChild("stdin");
+            A.forEachOutputLine(l -> alines.add(l));
+
+            // Verify A is running
+            A.sendAction("pid");
+            do {
+                split = getSplitLine(alines);
+            } while (!"pid".equals(split[1]));
+
+            JavaChild B = null;
+            try {
+                B = JavaChild.spawnJavaChild("stdin");
+                B.forEachOutputLine(l -> blines.add(l));
+
+                // Verify B is running
+                B.sendAction("pid");
+                do {
+                    split = getSplitLine(blines);
+                } while (!"pid".equals(split[1]));
+
+                // Tell B to wait for A's pid
+                B.sendAction("waitpid", A.pid());
+
+                // Wait a bit to see if B will prematurely report the termination of A
+                try {
+                    line = blines.poll(5L, TimeUnit.SECONDS);
+                } catch (InterruptedException ie) {
+                    Assert.fail("interrupted", ie);
+                }
+                Assert.assertNull(line, "waitpid didn't wait");
+
+                A.sendAction("exit", 0L);
+
+                // Look for B to report that A has exited
+                do {
+                    split = getSplitLine(blines);
+                } while (!"waitpid".equals(split[1]));
+
+                Assert.assertEquals(split[2], "false",  "Process A should not be alive");
+
+                B.sendAction("exit", 0L);
+            } catch (IOException ioe) {
+                Assert.fail("unable to start JavaChild B", ioe);
+            } finally {
+                B.destroyForcibly();
+            }
+        } catch (IOException ioe2) {
+            Assert.fail("unable to start JavaChild A", ioe2);
+        } finally {
+            A.destroyForcibly();
+        }
+    }
+
+    private static boolean DEBUG = true;
+
+    /**
+     * Get a line from the queue and split into words on whitespace.
+     * Log to stdout if requested.
+     * @param queue a queue of strings
+     * @return the words split from the line.
+     */
+    private static String[] getSplitLine(ArrayBlockingQueue<String> queue) {
+        try {
+            String line = queue.take();
+            String[] split = line.split("\\s");
+            if (DEBUG) {
+                System.out.printf("  Child Output: %s%n", line);
+            }
+            return split;
+        } catch (InterruptedException ie) {
+            Assert.fail("interrupted", ie);
+            return null;
+        }
+    }
+
 }
diff --git a/jdk/test/java/lang/ProcessHandle/ProcessUtil.java b/jdk/test/java/lang/ProcessHandle/ProcessUtil.java
index 48654ea..5d3ead1 100644
--- a/jdk/test/java/lang/ProcessHandle/ProcessUtil.java
+++ b/jdk/test/java/lang/ProcessHandle/ProcessUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -199,7 +199,7 @@
      */
     static void printProcess(ProcessHandle ph, String prefix) {
         printf("%spid %s, alive: %s; parent: %s, %s%n", prefix,
-                ph.getPid(), ph.isAlive(), ph.parent(), ph.info());
+                ph.pid(), ph.isAlive(), ph.parent(), ph.info());
     }
 
     /**
diff --git a/jdk/test/java/lang/ProcessHandle/TreeTest.java b/jdk/test/java/lang/ProcessHandle/TreeTest.java
index a1493b6..8e3580a 100644
--- a/jdk/test/java/lang/ProcessHandle/TreeTest.java
+++ b/jdk/test/java/lang/ProcessHandle/TreeTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@
         try {
             ProcessHandle self = ProcessHandle.current();
 
-            printf("self pid: %d%n", self.getPid());
+            printf("self pid: %d%n", self.pid());
             printDeep(self, "");
 
             for (int i = 0; i < MAXCHILDREN; i++) {
@@ -154,7 +154,7 @@
 
             JavaChild p1 = JavaChild.spawnJavaChild("stdin");
             ProcessHandle p1Handle = p1.toHandle();
-            printf("  p1 pid: %d%n", p1.getPid());
+            printf("  p1 pid: %d%n", p1.pid());
 
             // Gather the PIDs from the output of the spawing process
             p1.forEachOutputLine((s) -> {
@@ -206,7 +206,7 @@
             // show the complete list of children (for debug)
             List<ProcessHandle> descendants = getDescendants(p1Handle);
             printf(" descendants:  %s%n",
-                    descendants.stream().map(p -> p.getPid())
+                    descendants.stream().map(p -> p.pid())
                            .collect(Collectors.toList()));
 
             // Verify that all spawned children show up in the descendants  List
@@ -252,7 +252,7 @@
 
             JavaChild p1 = JavaChild.spawnJavaChild("stdin");
             ProcessHandle p1Handle = p1.toHandle();
-            printf(" p1: %s%n", p1.getPid());
+            printf(" p1: %s%n", p1.pid());
 
             int newChildren = 3;
             CountDownLatch spawnCount = new CountDownLatch(newChildren);
@@ -356,11 +356,11 @@
             parent[sortindex[i]] = processes[sortindex[i]].parent().orElse(null);
         }
         Arrays.sort(sortindex, (i1, i2) -> {
-            int cmp = Long.compare((parent[i1] == null ? 0L : parent[i1].getPid()),
-                    (parent[i2] == null ? 0L : parent[i2].getPid()));
+            int cmp = Long.compare((parent[i1] == null ? 0L : parent[i1].pid()),
+                    (parent[i2] == null ? 0L : parent[i2].pid()));
             if (cmp == 0) {
-                cmp = Long.compare((processes[i1] == null ? 0L : processes[i1].getPid()),
-                        (processes[i2] == null ? 0L : processes[i2].getPid()));
+                cmp = Long.compare((processes[i1] == null ? 0L : processes[i1].pid()),
+                        (processes[i2] == null ? 0L : processes[i2].pid()));
             }
             return cmp;
         });
@@ -397,7 +397,7 @@
             ProcessHandle p1Handle = p1.toHandle();
 
             printf("Spawning %d x %d x %d processes, pid: %d%n",
-                    factor, factor, factor, p1.getPid());
+                    factor, factor, factor, p1.pid());
 
             // Start the first tier of subprocesses
             p1.sendAction("spawn", factor, "stdin");
@@ -448,7 +448,7 @@
 
             List<ProcessHandle> subprocesses = getDescendants(p1Handle);
             printf(" descendants:  %s%n",
-                    subprocesses.stream().map(p -> p.getPid())
+                    subprocesses.stream().map(p -> p.pid())
                     .collect(Collectors.toList()));
 
             p1.getOutputStream().close();  // Close stdin for the controlling p1
diff --git a/jdk/test/java/lang/Runtime/Version/Basic.java b/jdk/test/java/lang/Runtime/Version/Basic.java
index 36ec6b4..0fbd017 100644
--- a/jdk/test/java/lang/Runtime/Version/Basic.java
+++ b/jdk/test/java/lang/Runtime/Version/Basic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /*
  * @test
  * @summary Unit test for java.lang.Runtime.Version.
- * @bug 8072379 8144062 8161236
+ * @bug 8072379 8144062 8161236 8160956
  */
 
 import java.lang.reflect.InvocationTargetException;
@@ -129,6 +129,9 @@
         testEHC("9",          "10",               false, false, -1,   -1);
         testEHC("9",          "8",                false, false,  1,    1);
 
+        testEHC("10.512.1",   "10.512.2",         false, false, -1,   -1);
+        testEHC("512.10.1",   "512.11.1",         false, false, -1,   -1);
+
         // $OPT comparison
         testEHC("9",          "9+-oink",          false, true,  -1,    0);
         testEHC("9+-ribbit",  "9+-moo",           false, true,   1,    0);
@@ -140,7 +143,7 @@
         testEHC("9.1.1.2-2a", "9.1.1.2-12",       false, false,  1,    1);
         testEHC("9.1.1.2-12", "9.1.1.2-4",        false, false,  1,    1);
 
-        testEHC("27.16",      "27.16+120",        false, false,  1,    1);
+        testEHC("27.16",      "27.16+120",        false, false, -1,   -1);
         testEHC("10",         "10-ea",            false, false,  1,    1);
         testEHC("10.1+1",     "10.1-ea+1",        false, false,  1,    1);
         testEHC("10.0.1+22",  "10.0.1+21",        false, false,  1,    1);
@@ -152,7 +155,7 @@
         testEHC("9-internal", "9",                false, false, -1,   -1);
         testEHC("9-ea+120",   "9+120",            false, false, -1,   -1);
         testEHC("9-ea+120",   "9+120",            false, false, -1,   -1);
-        testEHC("9+101",      "9",                false, false, -1,   -1);
+        testEHC("9+101",      "9",                false, false,  1,    1);
         testEHC("9+101",      "9+102",            false, false, -1,   -1);
         testEHC("1.9-ea",     "9-ea",             false, false, -1,   -1);
 
diff --git a/jdk/test/java/lang/Runtime/exec/SleepyCat.java b/jdk/test/java/lang/Runtime/exec/SleepyCat.java
index 7d2ea06..b1fb560 100644
--- a/jdk/test/java/lang/Runtime/exec/SleepyCat.java
+++ b/jdk/test/java/lang/Runtime/exec/SleepyCat.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,10 +80,10 @@
             for (Process p : pids) {
                 if (p == null)
                     continue;
-                String[] pfiles = {"pfiles", Long.toString(p.getPid())};
+                String[] pfiles = {"pfiles", Long.toString(p.pid())};
                 fds = new ProcessBuilder(pfiles).inheritIO().start();
                 fds.waitFor();
-                String[] pstack = {"pstack", Long.toString(p.getPid())};
+                String[] pstack = {"pstack", Long.toString(p.pid())};
                 fds = new ProcessBuilder(pstack).inheritIO().start();
                 fds.waitFor();
             }
diff --git a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java
index 1cf7c48..8ecf21b 100644
--- a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java
+++ b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java
@@ -80,25 +80,33 @@
         }
 
         void test() {
-            System.out.println("Testing module " + moduleName);
+            final boolean isModulePresent =
+                        ModuleLayer.boot().findModule(moduleName).isPresent();
+            System.out.format("Testing module: %1$s. Module is%2$s present.\n",
+                        moduleName, isModulePresent ? "" : " NOT");
 
-            // access to exported pkg should pass
-            testNonRestricted(exports);
+            if (isModulePresent) {
 
-            // access to opened pkg should pass
-            opens.ifPresent(Test::testNonRestricted);
+                // access to exported pkg should pass
+                testNonRestricted(exports);
 
-            // access to concealed pkg should fail
-            testRestricted(conceals);
+                // access to opened pkg should pass
+                opens.ifPresent(Test::testNonRestricted);
 
-            // access to qualified export pkg should fail
-            qualExports.ifPresent(Test::testRestricted);
+                // access to concealed pkg should fail
+                testRestricted(conceals);
 
-            // access to qualified open pkg should fail
-            qualOpens.ifPresent(Test::testRestricted);
+                // access to qualified export pkg should fail
+                qualExports.ifPresent(Test::testRestricted);
 
-            // access to qualified opened pkg that is also exported should pass
-            qualOpensAndExports.ifPresent(Test::testNonRestricted);
+                // access to qualified open pkg should fail
+                qualOpens.ifPresent(Test::testRestricted);
+
+                // access to qualified opened pkg that is also exported should pass
+                qualOpensAndExports.ifPresent(Test::testNonRestricted);
+            } else {
+                System.out.println("Skipping tests for module.");
+            }
         }
 
         private static void testRestricted(String pkg) {
diff --git a/jdk/test/java/lang/SecurityManager/CheckSecurityProvider.java b/jdk/test/java/lang/SecurityManager/CheckSecurityProvider.java
index 6aa14ca..7034f11 100644
--- a/jdk/test/java/lang/SecurityManager/CheckSecurityProvider.java
+++ b/jdk/test/java/lang/SecurityManager/CheckSecurityProvider.java
@@ -28,7 +28,6 @@
  * @run main/othervm CheckSecurityProvider
  */
 
-import java.lang.reflect.Layer;
 import java.security.Provider;
 import java.security.Security;
 import java.util.ArrayList;
@@ -45,7 +44,7 @@
  */
 public class CheckSecurityProvider {
     public static void main(String[] args) throws Exception {
-        Layer layer = Layer.boot();
+        ModuleLayer layer = ModuleLayer.boot();
 
         System.setSecurityManager(new SecurityManager());
 
diff --git a/jdk/test/java/lang/SecurityManager/modules/Test.java b/jdk/test/java/lang/SecurityManager/modules/Test.java
index 81cf617..db499ff 100644
--- a/jdk/test/java/lang/SecurityManager/modules/Test.java
+++ b/jdk/test/java/lang/SecurityManager/modules/Test.java
@@ -21,8 +21,6 @@
  * questions.
  */
 
-import java.lang.reflect.Module;
-
 public class Test {
     public static void main(String... args) {
         SecurityManager sm = System.getSecurityManager();
diff --git a/jdk/test/java/lang/StackTraceElement/PublicConstructor.java b/jdk/test/java/lang/StackTraceElement/PublicConstructor.java
index 254be78..7deb732 100644
--- a/jdk/test/java/lang/StackTraceElement/PublicConstructor.java
+++ b/jdk/test/java/lang/StackTraceElement/PublicConstructor.java
@@ -29,7 +29,6 @@
  */
 
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Module;
 
 public class PublicConstructor {
     public static void main(String... args) {
diff --git a/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java b/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java
index 85f2155..c58e9d6 100644
--- a/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java
+++ b/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @bug 6479237
  * @summary Basic test StackTraceElement with class loader names
  * @library lib /lib/testlibrary
+ * @modules jdk.compiler
  * @build m1/* WithClassLoaderName
  * @run main/othervm m1/com.app.Main
  * @run main/othervm WithClassLoaderName
diff --git a/jdk/test/java/lang/StackTraceElement/lib/m1/com/app/Utils.java b/jdk/test/java/lang/StackTraceElement/lib/m1/com/app/Utils.java
index 4c571af..ef55672 100644
--- a/jdk/test/java/lang/StackTraceElement/lib/m1/com/app/Utils.java
+++ b/jdk/test/java/lang/StackTraceElement/lib/m1/com/app/Utils.java
@@ -25,7 +25,6 @@
 
 import java.lang.StackWalker.StackFrame;
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Module;
 import java.util.Objects;
 
 public class Utils {
diff --git a/jdk/test/java/lang/StackWalker/Basic.java b/jdk/test/java/lang/StackWalker/Basic.java
index 37e51f0..8dc7627 100644
--- a/jdk/test/java/lang/StackWalker/Basic.java
+++ b/jdk/test/java/lang/StackWalker/Basic.java
@@ -23,18 +23,21 @@
 
 /*
  * @test
- * @bug 8140450
+ * @bug 8140450 8173898
  * @summary Basic test for the StackWalker::walk method
  * @run testng Basic
  */
 
 import java.lang.StackWalker.StackFrame;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 import static java.lang.StackWalker.Option.*;
 
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
+import static org.testng.Assert.*;
 
 public class Basic {
     private static boolean verbose = false;
@@ -60,6 +63,17 @@
         }
     }
 
+    @Test
+    public static void testWalkFromConstructor() throws Exception {
+        System.out.println("testWalkFromConstructor:");
+        List<String> found = ((ConstructorNewInstance)ConstructorNewInstance.class.getMethod("create")
+                             .invoke(null)).collectedFrames();
+        assertEquals(List.of(ConstructorNewInstance.class.getName()+"::<init>",
+                             ConstructorNewInstance.class.getName()+"::create",
+                             Basic.class.getName()+"::testWalkFromConstructor"),
+                     found);
+    }
+
     private final int depth;
     Basic(int depth) {
         this.depth = depth;
@@ -77,6 +91,47 @@
         assertEquals(limit, frames.size());
     }
 
+    static class ConstructorNewInstance {
+        static final StackWalker walker =
+            StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE);
+        List<String> testFramesOrReflectionFrames;
+        public ConstructorNewInstance() {
+            testFramesOrReflectionFrames = walker.walk(this::parse);
+        }
+        public List<String> collectedFrames() {
+            return testFramesOrReflectionFrames;
+        }
+        public boolean accept(StackFrame f) {
+            // Frames whose class names don't contain "."
+            // are our own test frames. These are the ones
+            // we expect.
+            // Frames whose class names contain ".reflect."
+            // are reflection frames. None should be present,
+            // since they are supposed to be filtered by
+            // by StackWalker. If we find any, we want to fail.
+            if (!f.getClassName().contains(".")
+                || f.getClassName().contains(".reflect.")) {
+                System.out.println("    " + f);
+                return true;
+            }
+            // Filter out all other frames (in particular
+            // those from the test framework) in order to
+            // have predictable results.
+            return false;
+        }
+        public String frame(StackFrame f) {
+            return f.getClassName() + "::" + f.getMethodName();
+        }
+        List<String> parse(Stream<StackFrame> s) {
+            return s.filter(this::accept)
+                    .map(this::frame)
+                    .collect(Collectors.toList());
+        }
+        public static ConstructorNewInstance create() throws Exception {
+            return ConstructorNewInstance.class.getConstructor().newInstance();
+        }
+    }
+
     class StackBuilder {
         private final int stackDepth;
         private final int limit;
@@ -131,9 +186,4 @@
         }
     }
 
-    static void assertEquals(int x, int y) {
-        if (x != y) {
-            throw new RuntimeException(x + " != " + y);
-        }
-    }
 }
diff --git a/jdk/test/java/lang/StackWalker/CallerFromMain.java b/jdk/test/java/lang/StackWalker/CallerFromMain.java
index 9bc289a..0eb0b2b 100644
--- a/jdk/test/java/lang/StackWalker/CallerFromMain.java
+++ b/jdk/test/java/lang/StackWalker/CallerFromMain.java
@@ -51,7 +51,7 @@
         try {
             Class<?> c = sw.getCallerClass();
             throw new RuntimeException("UOE not thrown. Caller: " + c);
-        } catch (IllegalStateException e) {}
+        } catch (IllegalCallerException e) {}
 
         // StackWalker::getCallerClass
         // Runnable::run
diff --git a/jdk/test/java/lang/StackWalker/CallerSensitiveMethod/csm/jdk/test/CallerSensitiveTest.java b/jdk/test/java/lang/StackWalker/CallerSensitiveMethod/csm/jdk/test/CallerSensitiveTest.java
index c09c327..609616d 100644
--- a/jdk/test/java/lang/StackWalker/CallerSensitiveMethod/csm/jdk/test/CallerSensitiveTest.java
+++ b/jdk/test/java/lang/StackWalker/CallerSensitiveMethod/csm/jdk/test/CallerSensitiveTest.java
@@ -50,7 +50,7 @@
         if (args.length > 0 && args[0].equals("sm")) {
             sm = true;
             PermissionCollection perms = new Permissions();
-            perms.add(new StackFramePermission("retainClassReference"));
+            perms.add(new RuntimePermission("getStackWalkerWithClassReference"));
             Policy.setPolicy(new Policy() {
                 @Override
                 public boolean implies(ProtectionDomain domain, Permission p) {
diff --git a/jdk/test/java/lang/StackWalker/CountLocalSlots.java b/jdk/test/java/lang/StackWalker/CountLocalSlots.java
deleted file mode 100644
index dfb1698..0000000
--- a/jdk/test/java/lang/StackWalker/CountLocalSlots.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8147039
- * @summary Confirm locals[] always has expected length, even for "dead" locals
- * @modules java.base/java.lang:open
- * @compile LocalsAndOperands.java
- * @run testng/othervm -Xcomp CountLocalSlots
- */
-
-import org.testng.annotations.Test;
-import java.lang.StackWalker.StackFrame;
-
-public class CountLocalSlots {
-    final static boolean debug = true;
-
-    @Test(dataProvider = "provider", dataProviderClass = LocalsAndOperands.class)
-    public void countLocalSlots(StackFrame... frames) {
-        for (StackFrame frame : frames) {
-            if (debug) {
-                System.out.println("Running countLocalSlots");
-                LocalsAndOperands.dumpStackWithLocals(frames);
-            }
-            // Confirm expected number of locals
-            String methodName = frame.getMethodName();
-            Integer expectedObj = (Integer) LocalsAndOperands.Tester.NUM_LOCALS.get(methodName);
-            if (expectedObj == null) {
-                if (!debug) { LocalsAndOperands.dumpStackWithLocals(frames); }
-                throw new RuntimeException("No NUM_LOCALS entry for " +
-                        methodName + "().  Update test?");
-            }
-            Object[] locals = (Object[]) LocalsAndOperands.invokeGetLocals(frame);
-            if (locals.length != expectedObj) {
-                if (!debug) { LocalsAndOperands.dumpStackWithLocals(frames); }
-                throw new RuntimeException(methodName + "(): number of locals (" +
-                        locals.length + ") did not match expected (" + expectedObj + ")");
-            }
-        }
-    }
-}
diff --git a/jdk/test/java/lang/StackWalker/GetCallerClassTest.java b/jdk/test/java/lang/StackWalker/GetCallerClassTest.java
index e3b96ee..9f1f3b0 100644
--- a/jdk/test/java/lang/StackWalker/GetCallerClassTest.java
+++ b/jdk/test/java/lang/StackWalker/GetCallerClassTest.java
@@ -55,7 +55,7 @@
     public static void main(String... args) throws Exception {
         if (args.length > 0 && args[0].equals("sm")) {
             PermissionCollection perms = new Permissions();
-            perms.add(new StackFramePermission("retainClassReference"));
+            perms.add(new RuntimePermission("getStackWalkerWithClassReference"));
             Policy.setPolicy(new Policy() {
                 @Override
                 public boolean implies(ProtectionDomain domain, Permission p) {
diff --git a/jdk/test/java/lang/StackWalker/LocalsAndOperands.java b/jdk/test/java/lang/StackWalker/LocalsAndOperands.java
index ab07c7d..1b9d71b 100644
--- a/jdk/test/java/lang/StackWalker/LocalsAndOperands.java
+++ b/jdk/test/java/lang/StackWalker/LocalsAndOperands.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,33 +23,54 @@
 
 /*
  * @test
- * @bug 8020968 8147039
+ * @bug 8020968 8147039 8156073
  * @summary Tests for locals and operands
  * @modules java.base/java.lang:open
- * @run testng LocalsAndOperands
+ * @run testng/othervm -Xint -DtestUnused=true LocalsAndOperands
+ * @run testng/othervm -Xcomp LocalsAndOperands
+ * @run testng/othervm -Xcomp -XX:-TieredCompilation LocalsAndOperands
  */
 
 import org.testng.annotations.*;
+import static org.testng.Assert.*;
 import java.lang.StackWalker.StackFrame;
+import static java.lang.StackWalker.Option.*;
 import java.lang.reflect.*;
 import java.util.*;
 import java.util.stream.*;
 
 public class LocalsAndOperands {
-    static final boolean debug = true;
+    static final boolean debug = false;
+    static final boolean is32bit;
+    static final boolean testUnused;
 
     static Class<?> liveStackFrameClass;
-    static Class<?> primitiveValueClass;
+    static Class<?> primitiveSlotClass;
+    static Class<?> primitiveSlot32Class;
+    static Class<?> primitiveSlot64Class;
+
     static StackWalker extendedWalker;
     static Method getLocals;
     static Method getOperands;
     static Method getMonitors;
-    static Method primitiveType;
+    static Method primitiveSize;
+    static Method primitiveLongValue;
+    static Method primitiveIntValue;
+    static Method getExtendedWalker;
+
+    private static final long LOWER_LONG_VAL = 4L; // Lower bits
+    private static final long UPPER_LONG_VAL = 0x123400000000L; // Upper bits
+    private static final long NEG_LONG_VAL = Long.MIN_VALUE;
+
+    private static final double LOWER_DOUBLE_VAL = Double.longBitsToDouble(0xABCDL);
+    private static final double UPPER_DOUBLE_VAL = Double.longBitsToDouble(0x432100000000L);
 
     static {
         try {
             liveStackFrameClass = Class.forName("java.lang.LiveStackFrame");
-            primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveValue");
+            primitiveSlotClass = Class.forName("java.lang.LiveStackFrame$PrimitiveSlot");
+            primitiveSlot32Class = Class.forName("java.lang.LiveStackFrameInfo$PrimitiveSlot32");
+            primitiveSlot64Class = Class.forName("java.lang.LiveStackFrameInfo$PrimitiveSlot64");
 
             getLocals = liveStackFrameClass.getDeclaredMethod("getLocals");
             getLocals.setAccessible(true);
@@ -60,12 +81,31 @@
             getMonitors = liveStackFrameClass.getDeclaredMethod("getMonitors");
             getMonitors.setAccessible(true);
 
-            primitiveType = primitiveValueClass.getDeclaredMethod("type");
-            primitiveType.setAccessible(true);
+            primitiveSize = primitiveSlotClass.getDeclaredMethod("size");
+            primitiveSize.setAccessible(true);
 
-            Method method = liveStackFrameClass.getMethod("getStackWalker");
-            method.setAccessible(true);
-            extendedWalker = (StackWalker) method.invoke(null);
+            primitiveLongValue = primitiveSlotClass.getDeclaredMethod("longValue");
+            primitiveLongValue.setAccessible(true);
+
+            primitiveIntValue = primitiveSlotClass.getDeclaredMethod("intValue");
+            primitiveIntValue.setAccessible(true);
+
+            getExtendedWalker = liveStackFrameClass.getMethod("getStackWalker", Set.class);
+            getExtendedWalker.setAccessible(true);
+            extendedWalker = (StackWalker) getExtendedWalker.invoke(null,
+                    EnumSet.noneOf(StackWalker.Option.class));
+
+            String dataModel = System.getProperty("sun.arch.data.model");
+            if ("32".equals(dataModel)) {
+                is32bit = true;
+            } else if ("64".equals(dataModel)) {
+                is32bit= false;
+            } else {
+                throw new RuntimeException("Weird data model:" + dataModel);
+            }
+            System.out.println("VM bits: " + dataModel);
+
+            testUnused = System.getProperty("testUnused") != null;
         } catch (Throwable t) { throw new RuntimeException(t); }
     }
 
@@ -80,47 +120,17 @@
      * DataProviders *
      *****************/
 
-    /** Calls testLocals() and provides LiveStackFrames for testLocals* methods */
+    /** Calls KnownLocalsTester.testLocals* and provides LiveStackFrames */
     @DataProvider
-    public static StackFrame[][] provider() {
-        return new StackFrame[][] {
-            new Tester().testLocals()
-        };
-    }
-
-    /**
-     * Calls testLocalsKeepAlive() and provides LiveStackFrames for testLocals* methods.
-     * Local variables in testLocalsKeepAlive() are ensured to not become dead.
-     */
-    @DataProvider
-    public static StackFrame[][] keepAliveProvider() {
-        return new StackFrame[][] {
-            new Tester().testLocalsKeepAlive()
-        };
-    }
-
-    /**
-     * Provides StackFrames from a StackWalker without the LOCALS_AND_OPERANDS
-     * option.
-     */
-    @DataProvider
-    public static StackFrame[][] noLocalsProvider() {
-        // Use default StackWalker
-        return new StackFrame[][] {
-            new Tester(StackWalker.getInstance(), true).testLocals()
-        };
-    }
-
-    /**
-     * Calls testLocals() and provides LiveStackFrames for *all* called methods,
-     * including test infrastructure (jtreg, testng, etc)
-     *
-     */
-    @DataProvider
-    public static StackFrame[][] unfilteredProvider() {
-        return new StackFrame[][] {
-            new Tester(extendedWalker, false).testLocals()
-        };
+    public static StackFrame[][] knownLocalsProvider() {
+        List<StackFrame[]> list = new ArrayList<>(3);
+        list.add(new KnownLocalsTester().testLocalsKeepAlive());
+        list.add(new KnownLocalsTester().testLocalsKeepAliveArgs(0xA, 'z',
+                "himom", 0x3FF00000000L + 0xFFFF, Math.PI));
+        if (testUnused) {
+            list.add(new KnownLocalsTester().testLocalsUnused());
+        }
+        return list.toArray(new StackFrame[1][1]);
     }
 
     /****************
@@ -128,135 +138,123 @@
      ****************/
 
     /**
-     * Check for expected local values and types in the LiveStackFrame
+     * Check for expected local values in the LiveStackFrame
      */
-    @Test(dataProvider = "keepAliveProvider")
+    @Test(dataProvider = "knownLocalsProvider")
     public static void checkLocalValues(StackFrame... frames) {
-        if (debug) {
-            System.out.println("Running checkLocalValues");
-            dumpStackWithLocals(frames);
-        }
-        Arrays.stream(frames).filter(f -> f.getMethodName()
-                                           .equals("testLocalsKeepAlive"))
-                                           .forEach(
-            f -> {
-                Object[] locals = invokeGetLocals(f);
-                for (int i = 0; i < locals.length; i++) {
-                    // Value
-                    String expected = Tester.LOCAL_VALUES[i];
-                    Object observed = locals[i];
-                    if (expected != null /* skip nulls in golden values */ &&
-                            !expected.equals(observed.toString())) {
-                        System.err.println("Local value mismatch:");
-                        if (!debug) { dumpStackWithLocals(frames); }
-                        throw new RuntimeException("local " + i + " value is " +
-                                observed + ", expected " + expected);
-                    }
-
-                    // Type
-                    expected = Tester.LOCAL_TYPES[i];
-                    observed = type(locals[i]);
-                    if (expected != null /* skip nulls in golden values */ &&
-                            !expected.equals(observed)) {
-                        System.err.println("Local type mismatch:");
-                        if (!debug) { dumpStackWithLocals(frames); }
-                        throw new RuntimeException("local " + i + " type is " +
-                                observed + ", expected " + expected);
-                    }
-                }
-            }
-        );
+        dumpFramesIfDebug(frames);
+        try {
+            Stream.of(frames)
+                  .filter(f -> KnownLocalsTester.TEST_METHODS.contains(f.getMethodName()))
+                  .forEach(LocalsAndOperands::checkFrameLocals);
+        } catch (Exception e) { dumpFramesIfNotDebug(frames); throw e; }
     }
 
     /**
-     * Basic sanity check for locals and operands
+     * Check the locals in the given StackFrame against the expected values.
      */
-    @Test(dataProvider = "provider")
-    public static void sanityCheck(StackFrame... frames) {
-        if (debug) {
-            System.out.println("Running sanityCheck");
-        }
-        try {
-            Stream<StackFrame> stream = Arrays.stream(frames);
-            if (debug) {
-                stream.forEach(LocalsAndOperands::printLocals);
+    private static void checkFrameLocals(StackFrame f) {
+        Object[] expectedArray = KnownLocalsTester.LOCAL_VALUES;
+        Object[] locals = invokeGetLocals(f);
+
+        for (int i = 0; i < locals.length; i++) {
+            Object expected = expectedArray[i];
+            Object observed = locals[i];
+
+            if (expected == null) { /* skip nulls in golden values */
+                continue;
+            } else if (expected instanceof KnownLocalsTester.TwoSlotValue) {
+                // confirm integrity of expected values
+                assertEquals(expectedArray[i+1], null,
+                        "Malformed array of expected values - slot after TwoSlotValue should be null");
+                assertLongIsInSlots(locals[i], locals[i+1],
+                        ((KnownLocalsTester.TwoSlotValue)expected).value);
+                i++; // skip following slot
+            } else if (primitiveSlotClass.isInstance(observed)) { // single slot primitive
+                assertTrue(primitiveValueEquals(observed, expected),
+                        "Local value mismatch: local " + i + " value is " +
+                          observed + ", expected " + expected);
+            } else if (expected instanceof Class) {
+                assertTrue(((Class)expected).isInstance(observed),
+                        "Local value mismatch: local " + i + " expected instancof " +
+                          expected + " but got " + observed);
+            } else if (expected instanceof String) {
+                assertEquals(expected, observed, "Local value mismatch: local " +
+                        i + " value is " + observed + ", expected " + expected);
             } else {
-                System.out.println(stream.count() + " frames");
+                throw new RuntimeException("Unrecognized expected local value " +
+                        i + ": " + expected);
             }
-        } catch (Throwable t) {
-            dumpStackWithLocals(frames);
-            throw t;
         }
     }
 
     /**
      * Sanity check for locals and operands, including testng/jtreg frames
+     * using all StackWalker options.
      */
-    @Test(dataProvider = "unfilteredProvider")
-    public static void unfilteredSanityCheck(StackFrame... frames) {
+    @Test
+    public synchronized void fullStackSanityCheck() throws Throwable {
         if (debug) {
-            System.out.println("Running unfilteredSanityCheck");
+            System.out.println("Running fullStackSanityCheck");
         }
-        try {
-            Stream<StackFrame> stream = Arrays.stream(frames);
+        StackWalker sw = (StackWalker) getExtendedWalker.invoke(null,
+                EnumSet.of(SHOW_HIDDEN_FRAMES, SHOW_REFLECT_FRAMES,
+                           RETAIN_CLASS_REFERENCE));
+        sw.forEach(f -> {
             if (debug) {
-                stream.forEach(f -> { System.out.println(f + ": " +
-                        invokeGetLocals(f).length + " locals"); } );
+                printLocals(f);
             } else {
-                System.out.println(stream.count() + " frames");
+                try {
+                    System.out.println("    " + f + ": " +
+                      ((Object[]) getLocals.invoke(f)).length + " locals, " +
+                      ((Object[]) getOperands.invoke(f)).length + " operands, " +
+                      ((Object[]) getMonitors.invoke(f)).length + " monitors");
+                } catch (IllegalAccessException|InvocationTargetException t) {
+                    throw new RuntimeException(t);
+                }
             }
-        } catch (Throwable t) {
-            dumpStackWithLocals(frames);
-            throw t;
-        }
+        });
     }
 
     /**
      * Test that LiveStackFrames are not provided with the default StackWalker
      * options.
      */
-    @Test(dataProvider = "noLocalsProvider")
-    public static void withoutLocalsAndOperands(StackFrame... frames) {
-        for (StackFrame frame : frames) {
-            if (liveStackFrameClass.isInstance(frame)) {
-                throw new RuntimeException("should not be LiveStackFrame");
-            }
-        }
+    @Test
+    public static void noLocalsSanityCheck() {
+        StackWalker sw = StackWalker.getInstance();
+        sw.forEach(f -> {
+            assertFalse(liveStackFrameClass.isInstance(f),
+                        "should not be LiveStackFrame");
+        });
     }
 
-    static class Tester {
+    /**
+     * Class stack-walking methods with a known set of methods and local variables.
+     */
+    static class KnownLocalsTester {
         private StackWalker walker;
-        private boolean filter = true; // Filter out testng/jtreg/etc frames?
 
-        Tester() {
+        KnownLocalsTester() {
             this.walker = extendedWalker;
         }
 
-        Tester(StackWalker walker, boolean filter) {
-            this.walker = walker;
-            this.filter = filter;
-        }
-
         /**
          * Perform stackwalk without keeping local variables alive and return an
          * array of the collected StackFrames
          */
-        private synchronized StackFrame[] testLocals() {
+        private synchronized StackFrame[] testLocalsUnused() {
             // Unused local variables will become dead
-            int x = 10;
-            char c = 'z';
+            int x = 0xA;
+            char c = 'z'; // 0x7A
             String hi = "himom";
-            long l = 1000000L;
-            double d =  3.1415926;
+            long l = 0x3FF00000000L + 0xFFFFL;
+            double d =  Math.PI;
 
-            if (filter) {
-                return walker.walk(s -> s.filter(f -> TEST_METHODS.contains(f
-                        .getMethodName())).collect(Collectors.toList()))
-                        .toArray(new StackFrame[0]);
-            } else {
-                return walker.walk(s -> s.collect(Collectors.toList()))
-                        .toArray(new StackFrame[0]);
-            }
+            return walker.walk(s ->
+                s.filter(f -> TEST_METHODS.contains(f.getMethodName()))
+                 .toArray(StackFrame[]::new)
+            );
         }
 
         /**
@@ -264,64 +262,153 @@
          * the collected StackFrames
          */
         private synchronized StackFrame[] testLocalsKeepAlive() {
-            int x = 10;
-            char c = 'z';
+            int x = 0xA;
+            char c = 'z'; // 0x7A
             String hi = "himom";
-            long l = 1000000L;
-            double d =  3.1415926;
+            long l = 0x3FF00000000L + 0xFFFFL;
+            double d =  Math.PI;
 
-            List<StackWalker.StackFrame> frames;
-            if (filter) {
-                frames = walker.walk(s -> s.filter(f -> TEST_METHODS.contains(f
-                        .getMethodName())).collect(Collectors.toList()));
-            } else {
-                frames = walker.walk(s -> s.collect(Collectors.toList()));
-            }
+            StackFrame[] frames = walker.walk(s ->
+                s.filter(f -> TEST_METHODS.contains(f.getMethodName()))
+                 .toArray(StackFrame[]::new)
+            );
 
             // Use local variables so they stay alive
-            System.out.println("Stayin' alive: "+x+" "+c+" "+hi+" "+l+" "+d);
-            return frames.toArray(new StackFrame[0]); // FIXME: convert to Array here
+            System.out.println("Stayin' alive: "+this+" "+x+" "+c+" "+hi+" "+l+" "+d);
+            return frames;
         }
 
-        // Expected values for locals in testLocals() & testLocalsKeepAlive()
-        // TODO: use real values instead of Strings, rebuild doubles & floats, etc
-        private final static String[] LOCAL_VALUES = new String[] {
-            null, // skip, LocalsAndOperands$Tester@XXX identity is different each run
-            "10",
-            "122",
+        /**
+         * Perform stackwalk, keeping method arguments alive, and return a list of
+         * the collected StackFrames
+         */
+        private synchronized StackFrame[] testLocalsKeepAliveArgs(int x, char c,
+                                                                  String hi, long l,
+                                                                  double d) {
+            StackFrame[] frames = walker.walk(s ->
+                s.filter(f -> TEST_METHODS.contains(f.getMethodName()))
+                 .toArray(StackFrame[]::new)
+            );
+
+            // Use local variables so they stay alive
+            System.out.println("Stayin' alive: "+this+" "+x+" "+c+" "+hi+" "+l+" "+d);
+            return frames;
+        }
+
+        // An expected two-slot local (i.e. long or double)
+        static class TwoSlotValue {
+            public long value;
+            public TwoSlotValue(long value) { this.value = value; }
+        }
+
+        // Expected values for locals in KnownLocalsTester.testLocals* methods
+        private final static Object[] LOCAL_VALUES = new Object[] {
+            LocalsAndOperands.KnownLocalsTester.class,
+            Integer.valueOf(0xA),
+            Integer.valueOf(0x7A),
             "himom",
-            "0",
-            null, // skip, fix in 8156073
-            null, // skip, fix in 8156073
-            null, // skip, fix in 8156073
-            "0"
+            new TwoSlotValue(0x3FF00000000L + 0xFFFFL),
+            null, // 2nd slot
+            new TwoSlotValue(Double.doubleToRawLongBits(Math.PI)),
+            null, // 2nd slot
+            Integer.valueOf(0)
         };
 
-        // Expected types for locals in testLocals() & testLocalsKeepAlive()
-        // TODO: use real types
-        private final static String[] LOCAL_TYPES = new String[] {
-            null, // skip
-            "I",
-            "I",
-            "java.lang.String",
-            "I",
-            "I",
-            "I",
-            "I",
-            "I"
-        };
-
-        final static Map NUM_LOCALS = Map.of("testLocals", 8,
-                                             "testLocalsKeepAlive",
-                                             LOCAL_VALUES.length);
-        private final static Collection<String> TEST_METHODS = NUM_LOCALS.keySet();
+        private final static List<String> TEST_METHODS =
+                List.of("testLocalsUnused",
+                        "testLocalsKeepAlive",
+                        "testLocalsKeepAliveArgs");
     }
 
+    /* Simpler tests of long & double arguments */
+
+    @Test
+    public static void testUsedLongArg() throws Exception {
+        usedLong(LOWER_LONG_VAL);
+        usedLong(UPPER_LONG_VAL);
+        usedLong(NEG_LONG_VAL);
+    }
+
+    private static void usedLong(long longArg) throws Exception {
+        StackFrame[] frames = extendedWalker.walk(s ->
+            s.filter(f -> "usedLong".equals(f.getMethodName()))
+             .toArray(StackFrame[]::new)
+        );
+        try {
+            dumpFramesIfDebug(frames);
+
+            Object[] locals = (Object[]) getLocals.invoke(frames[0]);
+            assertLongIsInSlots(locals[0], locals[1], longArg);
+            System.out.println("Stayin' alive: " + longArg);
+        } catch (Exception t) {
+            dumpFramesIfNotDebug(frames);
+            throw t;
+        }
+    }
+
+    @Test
+    public static void testUnusedLongArg() throws Exception {
+        if (testUnused) {
+            unusedLong(NEG_LONG_VAL);
+        }
+    }
+
+    private static void unusedLong(long longArg) throws Exception {
+        StackFrame[] frames = extendedWalker.walk(s ->
+            s.filter(f -> "unusedLong".equals(f.getMethodName()))
+             .toArray(StackFrame[]::new)
+        );
+        try {
+            dumpFramesIfDebug(frames);
+
+            final Object[] locals = (Object[]) getLocals.invoke(frames[0]);
+            assertLongIsInSlots(locals[0], locals[1], NEG_LONG_VAL);
+        } catch (Exception t) {
+            dumpFramesIfNotDebug(frames);
+            throw t;
+        }
+    }
+
+    @Test
+    public static void testUsedDoubleArg() throws Exception {
+        usedDouble(LOWER_DOUBLE_VAL);
+        usedDouble(UPPER_DOUBLE_VAL);
+    }
+
+    private static void usedDouble(double doubleArg) throws Exception {
+        StackFrame[] frames = extendedWalker.walk(s ->
+            s.filter(f -> "usedDouble".equals(f.getMethodName()))
+             .toArray(StackFrame[]::new)
+        );
+        try {
+            dumpFramesIfDebug(frames);
+
+            Object[] locals = (Object[]) getLocals.invoke(frames[0]);
+            assertDoubleIsInSlots(locals[0], locals[1], doubleArg);
+            System.out.println("Stayin' alive: " + doubleArg);
+        } catch (Exception t) {
+            dumpFramesIfNotDebug(frames);
+            throw t;
+        }
+    }
+
+    /*******************
+     * Utility Methods *
+     *******************/
+
     /**
      * Print stack trace with locals
      */
     public static void dumpStackWithLocals(StackFrame...frames) {
-        Arrays.stream(frames).forEach(LocalsAndOperands::printLocals);
+        Stream.of(frames).forEach(LocalsAndOperands::printLocals);
+    }
+
+    public static void dumpFramesIfDebug(StackFrame...frames) {
+        if (debug) { dumpStackWithLocals(frames); }
+    }
+
+    public static void dumpFramesIfNotDebug(StackFrame...frames) {
+        if (!debug) { dumpStackWithLocals(frames); }
     }
 
     /**
@@ -329,10 +416,21 @@
      */
     public static void printLocals(StackWalker.StackFrame frame) {
         try {
-            System.out.println(frame);
+            System.out.println("Locals for: " + frame);
             Object[] locals = (Object[]) getLocals.invoke(frame);
             for (int i = 0; i < locals.length; i++) {
-                System.out.format("  local %d: %s type %s\n", i, locals[i], type(locals[i]));
+                String localStr = null;
+
+                if (primitiveSlot64Class.isInstance(locals[i])) {
+                    localStr = String.format("0x%X",
+                            (Long)primitiveLongValue.invoke(locals[i]));
+                } else if (primitiveSlot32Class.isInstance(locals[i])) {
+                    localStr = String.format("0x%X",
+                            (Integer)primitiveIntValue.invoke(locals[i]));
+                } else if (locals[i] != null) {
+                    localStr = locals[i].toString();
+                }
+                System.out.format("  local %d: %s type %s\n", i, localStr, type(locals[i]));
             }
 
             Object[] operands = (Object[]) getOperands.invoke(frame);
@@ -352,12 +450,87 @@
         try {
             if (o == null) {
                 return "null";
-            } else if (primitiveValueClass.isInstance(o)) {
-                char c = (char)primitiveType.invoke(o);
-                return String.valueOf(c);
+            } else if (primitiveSlotClass.isInstance(o)) {
+                int s = (int)primitiveSize.invoke(o);
+                return s + "-byte primitive";
             } else {
                 return o.getClass().getName();
             }
         } catch(Exception e) { throw new RuntimeException(e); }
     }
+
+    /*
+     * Check if the PrimitiveValue "primVal" contains the specified value,
+     * either a Long or an Integer.
+     */
+    static boolean primitiveValueEquals(Object primVal, Object expectedVal) {
+        try {
+            if (expectedVal instanceof Long) {
+                assertFalse(is32bit);
+                assertTrue(primitiveSlot64Class.isInstance(primVal));
+                assertTrue(8 == (int)primitiveSize.invoke(primVal));
+                return Objects.equals(primitiveLongValue.invoke(primVal), expectedVal);
+            } else if (expectedVal instanceof Integer) {
+                int expectedInt = (Integer)expectedVal;
+                if (is32bit) {
+                    assertTrue(primitiveSlot32Class.isInstance(primVal),
+                            "expected a PrimitiveSlot32 on 32-bit VM");
+                    assertTrue(4 == (int)primitiveSize.invoke(primVal));
+                    return expectedInt == (int)primitiveIntValue.invoke(primVal);
+                } else {
+                    assertTrue(primitiveSlot64Class.isInstance(primVal),
+                            "expected a PrimitiveSlot64 on 64-bit VM");
+                    assertTrue(8 == (int)primitiveSize.invoke(primVal));
+                    // Look for int expectedVal in high- or low-order 32 bits
+                    long primValLong = (long)primitiveLongValue.invoke(primVal);
+                    return (int)(primValLong & 0x00000000FFFFFFFFL) == expectedInt ||
+                           (int)(primValLong >>> 32) == expectedInt;
+                }
+            } else {
+                throw new RuntimeException("Called with non-Integer/Long: " + expectedVal);
+            }
+        } catch (IllegalAccessException|InvocationTargetException e) {
+            throw new RuntimeException(e);
+        }
+
+    }
+
+    /*
+     * Assert that the expected 2-slot long value is stored somewhere in the
+     * pair of slots.
+     * Throw exception if long value isn't in the two slots given.
+     * Accounts for 32 vs 64 bit, but is lax on endianness (accepts either)
+     */
+    static void assertLongIsInSlots(Object primVal0, Object primVal1, long expected) {
+        try {
+            if (is32bit) {
+                int upper = (int)(expected & 0xFFFFFFFFL);
+                int lower = (int)(expected >> 32);
+
+                if (!((primitiveValueEquals(primVal0, upper) &&
+                       primitiveValueEquals(primVal1, lower)) ||
+                      (primitiveValueEquals(primVal0, lower) &&
+                       primitiveValueEquals(primVal1, upper)))) {
+                    throw new RuntimeException(String.format("0x%X and 0x%X of 0x%016X not found in 0x%X and 0x%X",
+                            upper, lower, expected,
+                            (int)primitiveIntValue.invoke(primVal0),
+                            (int)primitiveIntValue.invoke(primVal1)));
+                }
+            } else {
+                if (!(primitiveValueEquals(primVal0, expected) ||
+                      primitiveValueEquals(primVal1, expected))) {
+                    throw new RuntimeException(String.format("0x%016X not found in 0x%016X or 0x%016X",
+                            expected,
+                            (long)primitiveLongValue.invoke(primVal0),
+                            (long)primitiveLongValue.invoke(primVal1)));
+                }
+            }
+        } catch (IllegalAccessException|InvocationTargetException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    static void assertDoubleIsInSlots(Object primVal0, Object primVal1, double expected) {
+        assertLongIsInSlots(primVal0, primVal1, Double.doubleToRawLongBits(expected));
+    }
 }
diff --git a/jdk/test/java/lang/StackWalker/LocalsCrash.java b/jdk/test/java/lang/StackWalker/LocalsCrash.java
deleted file mode 100644
index 178e07c..0000000
--- a/jdk/test/java/lang/StackWalker/LocalsCrash.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8147039
- * @summary Test for -Xcomp crash that happened before 8147039 fix
- * @modules java.base/java.lang:open
- * @run testng/othervm -Xcomp LocalsCrash
- */
-
-import org.testng.annotations.*;
-import java.lang.reflect.*;
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class LocalsCrash {
-    static Class<?> liveStackFrameClass;
-    static Method getStackWalker;
-
-    static {
-        try {
-            liveStackFrameClass = Class.forName("java.lang.LiveStackFrame");
-            getStackWalker = liveStackFrameClass.getMethod("getStackWalker");
-            getStackWalker.setAccessible(true);
-        } catch (Throwable t) { throw new RuntimeException(t); }
-    }
-
-    private StackWalker walker;
-
-    LocalsCrash() {
-        try {
-            walker = (StackWalker) getStackWalker.invoke(null);
-        } catch (Exception e) { throw new RuntimeException(e); }
-    }
-
-    @Test
-    public void test00() { doStackWalk(); }
-
-    @Test
-    public void test01() { doStackWalk(); }
-
-    private synchronized List<StackWalker.StackFrame> doStackWalk() {
-        try {
-            // Unused local variables will become dead
-            int x = 10;
-            char c = 'z';
-            String hi = "himom";
-            long l = 1000000L;
-            double d =  3.1415926;
-
-            return walker.walk(s -> s.collect(Collectors.toList()));
-        } catch (Exception e) { throw new RuntimeException(e); }
-    }
-}
diff --git a/jdk/test/java/lang/StackWalker/ReflectionFrames.java b/jdk/test/java/lang/StackWalker/ReflectionFrames.java
new file mode 100644
index 0000000..eacc55f
--- /dev/null
+++ b/jdk/test/java/lang/StackWalker/ReflectionFrames.java
@@ -0,0 +1,842 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173898
+ * @summary Basic test for checking filtering of reflection frames
+ * @run testng ReflectionFrames
+ */
+
+import java.lang.StackWalker.StackFrame;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
+import java.lang.invoke.MethodType;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import static java.lang.StackWalker.Option.*;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+public class ReflectionFrames {
+    final static boolean verbose = false;
+
+    /**
+     * This test invokes new StackInspector() directly from
+     * the caller StackInspector.Caller.create method.
+     * It checks that the caller is StackInspector.Caller.
+     * It also checks the expected frames collected
+     * by walking the stack from the default StackInspector()
+     * constructor.
+     * This is done twice, once using a default StackWalker
+     * that hides reflection frames, once using a StackWalker
+     * configured to show reflection frames.
+     */
+    @Test
+    public static void testNewStackInspector() throws Exception {
+        // Sets the default walker which hides reflection
+        // frames.
+        StackInspector.walker.set(StackInspector.walkerHide);
+
+        // Calls the StackInspector.create method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The create method invokes new StackInspector() directly.
+        // No reflection frame should appear.
+        System.out.println("testNewStackInspector: create");
+
+        StackInspector obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("create", How.class)
+                             .invoke(null, How.NEW));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewStackInspector"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.reflect method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The reflect method invokes the create method through
+        // reflection.
+        // The create method invokes new StackInspector() directly.
+        // No reflection frame should appear.
+        System.out.println("testNewStackInspector: reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("reflect", How.class)
+                             .invoke(null, How.NEW));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             StackInspector.Caller.class.getName()
+                                 +"::reflect",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewStackInspector"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.handle method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The handle method invokes the create method using
+        // a MethodHandle.
+        // The create method invokes new StackInspector() directly.
+        // No reflection frame should appear.
+        System.out.println("testNewStackInspector: handle");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("handle", How.class)
+                             .invoke(null, How.NEW));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             StackInspector.Caller.class.getName()
+                                 +"::handle",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewStackInspector"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertEquals(obj.filtered, 0);
+
+        // Sets a non-default walker configured to show
+        // reflection frames
+        StackInspector.walker.set(StackInspector.walkerShow);
+
+        // Calls the StackInspector.create method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The create method invokes new StackInspector() directly.
+        // We should see all reflection frames, except the
+        // jdk.internal.reflect frames which we are filtering
+        // out in StackInspector::filter.
+        System.out.println("testNewStackInspector: create: show reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("create", How.class)
+                             .invoke(null, How.NEW));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             Method.class.getName()
+                                 +"::invoke",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewStackInspector"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertNotEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.reflect method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The reflect method invokes the create method through
+        // reflection.
+        // The create method invokes new StackInspector() directly.
+        // We should see all reflection frames, except the
+        // jdk.internal.reflect frames which we are filtering
+        // out in StackInspector::filter.
+        System.out.println("testNewStackInspector: reflect: show reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("reflect", How.class)
+                             .invoke(null, How.NEW));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             Method.class.getName()
+                                 +"::invoke",
+                             StackInspector.Caller.class.getName()
+                                 +"::reflect",
+                             Method.class.getName()
+                                 +"::invoke",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewStackInspector"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertNotEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.handle method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The handle method invokes the create method using
+        // MethodHandle.
+        // The create method invokes new StackInspector() directly.
+        // We should see all reflection frames, except the
+        // jdk.internal.reflect frames which we are filtering
+        // out in StackInspector::filter.
+        System.out.println("testNewStackInspector: handle: show reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("handle", How.class)
+                             .invoke(null, How.NEW));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             // MethodHandle::invoke remains hidden
+                             StackInspector.Caller.class.getName()
+                                 +"::handle",
+                             Method.class.getName()
+                                 +"::invoke",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewStackInspector"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertNotEquals(obj.filtered, 0);
+    }
+
+   /**
+     * This test invokes Constructor.newInstance() from
+     * the caller StackInspector.Caller.create method.
+     * It checks that the caller is StackInspector.Caller.
+     * It also checks the expected frames collected
+     * by walking the stack from the default StackInspector()
+     * constructor.
+     * This is done twice, once using a default StackWalker
+     * that hides reflection frames, once using a StackWalker
+     * configured to show reflection frames.
+     */
+    @Test
+    public static void testConstructor() throws Exception {
+        // Sets the default walker which hides reflection
+        // frames.
+        StackInspector.walker.set(StackInspector.walkerHide);
+
+        // Calls the StackInspector.create method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The create method invokes Constructor.newInstance().
+        // No reflection frame should appear.
+        System.out.println("testConstructor: create");
+
+        StackInspector obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("create", How.class)
+                             .invoke(null, How.CONSTRUCTOR));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             ReflectionFrames.class.getName()
+                                 +"::testConstructor"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.reflect method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The reflect method invokes the create method through
+        // reflection.
+        // The create method invokes Constructor.newInstance().
+        // No reflection frame should appear.
+        System.out.println("testConstructor: reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("reflect", How.class)
+                             .invoke(null, How.CONSTRUCTOR));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             StackInspector.Caller.class.getName()
+                                 +"::reflect",
+                             ReflectionFrames.class.getName()
+                                 +"::testConstructor"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.handle method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The handle method invokes the create method using
+        // MethodHandle.
+        // The create method invokes Constructor.newInstance().
+        // No reflection frame should appear.
+        System.out.println("testConstructor: handle");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("handle", How.class)
+                             .invoke(null, How.CONSTRUCTOR));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             StackInspector.Caller.class.getName()
+                                 +"::handle",
+                             ReflectionFrames.class.getName()
+                                 +"::testConstructor"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertEquals(obj.filtered, 0);
+
+        // Sets a non-default walker configured to show
+        // reflection frames
+        StackInspector.walker.set(StackInspector.walkerShow);
+
+        // Calls the StackInspector.create method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The create method invokes Constructor.newInstance().
+        // We should see all reflection frames, except the
+        // jdk.internal.reflect frames which we are filtering
+        // out in StackInspector::filter.
+        System.out.println("testConstructor: create: show reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("create", How.class)
+                             .invoke(null, How.CONSTRUCTOR));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             Constructor.class.getName()
+                                 +"::newInstance",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             Method.class.getName()
+                                 +"::invoke",
+                             ReflectionFrames.class.getName()
+                                 +"::testConstructor"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertNotEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.reflect method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The reflect method invokes the create method through
+        // reflection.
+        // The create method invokes Constructor.newInstance().
+        // We should see all reflection frames, except the
+        // jdk.internal.reflect frames which we are filtering
+        // out in StackInspector::filter.
+        System.out.println("testConstructor: reflect: show reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("reflect", How.class)
+                             .invoke(null, How.CONSTRUCTOR));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             Constructor.class.getName()
+                                 +"::newInstance",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             Method.class.getName()
+                                 +"::invoke",
+                             StackInspector.Caller.class.getName()
+                                 +"::reflect",
+                             Method.class.getName()
+                                 +"::invoke",
+                             ReflectionFrames.class.getName()
+                                 +"::testConstructor"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertNotEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.handle method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The handle method invokes the create method using
+        // MethodHandle.
+        // The create method invokes Constructor.newInstance().
+        // We should see all reflection frames, except the
+        // jdk.internal.reflect frames which we are filtering
+        // out in StackInspector::filter.
+        System.out.println("testConstructor: handle: show reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("handle", How.class)
+                             .invoke(null, How.CONSTRUCTOR));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             Constructor.class.getName()
+                                 +"::newInstance",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             // MethodHandle::invoke remains hidden
+                             StackInspector.Caller.class.getName()
+                                 +"::handle",
+                             Method.class.getName()
+                                 +"::invoke",
+                             ReflectionFrames.class.getName()
+                                 +"::testConstructor"));
+        assertEquals(obj.cls, StackInspector.Caller.class);
+        assertNotEquals(obj.filtered, 0);
+    }
+
+   /**
+     * This test invokes StackInspector.class.newInstance() from
+     * the caller StackInspector.Caller.create method. Because
+     * Class.newInstance() is not considered as a
+     * reflection frame, the the caller returned by
+     * getCallerClass() should appear to be java.lang.Class
+     * and not StackInspector.Caller.
+     * It also checks the expected frames collected
+     * by walking the stack from the default StackInspector()
+     * constructor.
+     * This is done twice, once using a default StackWalker
+     * that hides reflection frames, once using a StackWalker
+     * configured to show reflection frames.
+     */
+    @Test
+    public static void testNewInstance() throws Exception {
+        // Sets the default walker which hides reflection
+        // frames.
+        StackInspector.walker.set(StackInspector.walkerHide);
+
+        // Calls the StackInspector.create method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The create method invokes StackInspector.class.newInstance().
+        // No reflection frame should appear, except
+        // Class::newInstance which is not considered as
+        // a reflection frame.
+        System.out.println("testNewInstance: create");
+
+        StackInspector obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("create", How.class)
+                             .invoke(null, How.CLASS));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             Class.class.getName()
+                                 +"::newInstance",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewInstance"));
+        // Because Class.newInstance is not filtered, then the
+        // caller is Class.class
+        assertEquals(obj.cls, Class.class);
+        assertEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.reflect method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The reflect method invokes the create method through
+        // reflection.
+        // The create method invokes StackInspector.class.newInstance().
+        // No reflection frame should appear, except
+        // Class::newInstance which is not considered as
+        // a reflection frame.
+        System.out.println("testNewInstance: reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("reflect", How.class)
+                             .invoke(null, How.CLASS));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             Class.class.getName()
+                                 +"::newInstance",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             StackInspector.Caller.class.getName()
+                                 +"::reflect",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewInstance"));
+
+        // Because Class.newInstance is not filtered, then the
+        // caller is Class.class
+        assertEquals(obj.cls, Class.class);
+        assertEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.handle method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The handle method invokes the create method using
+        // reflection.
+        // The create method invokes StackInspector.class.newInstance().
+        // No reflection frame should appear, except
+        // Class::newInstance which is not considered as
+        // a reflection frame.
+        System.out.println("testNewInstance: handle");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("handle", How.class)
+                             .invoke(null, How.CLASS));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             Class.class.getName()
+                                 +"::newInstance",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             StackInspector.Caller.class.getName()
+                                 +"::handle",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewInstance"));
+
+        // Because Class.newInstance is not filtered, then the
+        // caller is Class.class
+        assertEquals(obj.cls, Class.class);
+        assertEquals(obj.filtered, 0);
+
+        // Sets a non-default walker configured to show
+        // reflection frames
+        StackInspector.walker.set(StackInspector.walkerShow);
+
+        // Calls the StackInspector.create method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The create method invokes StackInspector.class.newInstance().
+        // We should see all reflection frames, except the
+        // jdk.internal.reflect frames which we are filtering
+        // out in StackInspector::filter.
+        System.out.println("testNewInstance: create: show reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("create", How.class)
+                             .invoke(null, How.CLASS));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             Constructor.class.getName()
+                                 +"::newInstance",
+                             Class.class.getName()
+                                 +"::newInstance",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             Method.class.getName()
+                                 +"::invoke",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewInstance"));
+        // Because Class.newInstance is not filtered, then the
+        // caller is Class.class
+        assertEquals(obj.cls, Class.class);
+        assertNotEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.reflect method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The reflect method invokes the create method through
+        // reflection.
+        // The create method invokes StackInspector.class.newInstance().
+        // We should see all reflection frames, except the
+        // jdk.internal.reflect frames which we are filtering
+        // out in StackInspector::filter.
+        System.out.println("testNewInstance: reflect: show reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("reflect", How.class)
+                             .invoke(null, How.CLASS));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             Constructor.class.getName()
+                                 +"::newInstance",
+                             Class.class.getName()
+                                 +"::newInstance",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             Method.class.getName()
+                                 +"::invoke",
+                             StackInspector.Caller.class.getName()
+                                 +"::reflect",
+                             Method.class.getName()
+                                 +"::invoke",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewInstance"));
+
+        // Because Class.newInstance is not filtered, then the
+        // caller is Class.class
+        assertEquals(obj.cls, Class.class);
+        assertNotEquals(obj.filtered, 0);
+
+        // Calls the StackInspector.handle method through reflection
+        // and check the frames collected in the StackInspector
+        // default constructor.
+        // The handle method invokes the create method using
+        // MethodHandle.
+        // The create method invokes StackInspector.class.newInstance().
+        // We should see all reflection frames, except the
+        // jdk.internal.reflect frames which we are filtering
+        // out in StackInspector::filter.
+        System.out.println("testNewInstance: handle: show reflect");
+
+        obj = ((StackInspector)StackInspector.Caller.class
+                             .getMethod("handle", How.class)
+                             .invoke(null, How.CLASS));
+        assertEquals(obj.collectedFrames,
+                     List.of(StackInspector.class.getName()
+                                 +"::<init>",
+                             Constructor.class.getName()
+                                 +"::newInstance",
+                             Class.class.getName()
+                                 +"::newInstance",
+                             StackInspector.Caller.class.getName()
+                                 +"::create",
+                             // MethodHandle::invoke remains hidden
+                             StackInspector.Caller.class.getName()
+                                 +"::handle",
+                             Method.class.getName()
+                                 +"::invoke",
+                             ReflectionFrames.class.getName()
+                                 +"::testNewInstance"));
+
+        // Because Class.newInstance is not filtered, then the
+        // caller is Class.class
+        assertEquals(obj.cls, Class.class);
+        assertNotEquals(obj.filtered, 0);
+    }
+
+    @Test
+    public static void testGetCaller() throws Exception {
+        // Sets the default walker which hides reflection
+        // frames.
+        StackInspector.walker.set(StackInspector.walkerHide);
+
+        assertEquals(StackInspector.getCaller(), ReflectionFrames.class);
+        assertEquals(StackInspector.class.getMethod("getCaller").invoke(null),
+                     ReflectionFrames.class);
+
+        // Sets a non-default walker configured to show
+        // reflection frames
+        StackInspector.walker.set(StackInspector.walkerShow);
+
+        assertEquals(StackInspector.getCaller(), ReflectionFrames.class);
+        assertEquals(StackInspector.class.getMethod("getCaller").invoke(null),
+                     ReflectionFrames.class);
+    }
+
+    @Test
+    public static void testReflectCaller() throws Exception {
+        // Sets the default walker which hides reflection
+        // frames.
+        StackInspector.walker.set(StackInspector.walkerHide);
+
+        assertEquals(StackInspector.reflectCaller(), ReflectionFrames.class);
+        assertEquals(StackInspector.class.getMethod("reflectCaller").invoke(null),
+                     ReflectionFrames.class);
+
+        // Sets a non-default walker configured to show
+        // reflection frames
+        StackInspector.walker.set(StackInspector.walkerShow);
+
+        assertEquals(StackInspector.reflectCaller(), ReflectionFrames.class);
+        assertEquals(StackInspector.class.getMethod("reflectCaller").invoke(null),
+                     ReflectionFrames.class);
+    }
+
+    @Test
+    public static void testSupplyCaller() throws Exception {
+        // Sets the default walker which hides reflection
+        // frames.
+        StackInspector.walker.set(StackInspector.walkerHide);
+
+        assertEquals(StackInspector.supplyCaller(), ReflectionFrames.class);
+        assertEquals(StackInspector.class.getMethod("supplyCaller").invoke(null),
+                     ReflectionFrames.class);
+
+        // Sets a non-default walker configured to show
+        // reflection frames
+        StackInspector.walker.set(StackInspector.walkerShow);
+
+        assertEquals(StackInspector.supplyCaller(), ReflectionFrames.class);
+        assertEquals(StackInspector.class.getMethod("supplyCaller").invoke(null),
+                     ReflectionFrames.class);
+    }
+
+    @Test
+    public static void testHandleCaller() throws Exception {
+        // Sets the default walker which hides reflection
+        // frames.
+        StackInspector.walker.set(StackInspector.walkerHide);
+
+        assertEquals(StackInspector.handleCaller(), ReflectionFrames.class);
+        assertEquals(StackInspector.class.getMethod("handleCaller").invoke(null),
+                     ReflectionFrames.class);
+
+        // Sets a non-default walker configured to show
+        // reflection frames
+        StackInspector.walker.set(StackInspector.walkerShow);
+
+        assertEquals(StackInspector.handleCaller(), ReflectionFrames.class);
+        assertEquals(StackInspector.class.getMethod("handleCaller").invoke(null),
+                     ReflectionFrames.class);
+    }
+
+    static enum How { NEW, CONSTRUCTOR, CLASS};
+
+    /**
+     * An object that collect stack frames by walking the stack
+     * (and calling getCallerClass()) from within its constructor.
+     * For the purpose of this test, StackInspector objects are
+     * always created from the nested StackInspector.Caller class,
+     * which should therefore appear as the caller of the
+     * StackInspector constructor.
+     */
+    static class StackInspector {
+        static final StackWalker walkerHide =
+            StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE);
+        static final StackWalker walkerShow =
+            StackWalker.getInstance(EnumSet.of(
+                           StackWalker.Option.RETAIN_CLASS_REFERENCE,
+                           StackWalker.Option.SHOW_REFLECT_FRAMES));
+        final static ThreadLocal<StackWalker> walker = new ThreadLocal<>() {
+             protected StackWalker initialValue() {
+                 return walkerHide;
+             }
+        };
+
+        List<String> collectedFrames;
+        Class<?> cls = null;
+        boolean stop;
+        int filtered;
+        final boolean filterImplFrames;
+
+        public StackInspector() {
+            stop = false;
+            // if reflection frames are not hidden, we want to
+            // filter implementation frames before collecting
+            // to avoid depending on internal details.
+            filterImplFrames = walker.get() == walkerShow;
+            collectedFrames = walker.get().walk(this::parse);
+            cls = walker.get().getCallerClass();
+        }
+
+        public List<String> collectedFrames() {
+            return collectedFrames;
+        }
+
+        // The takeWhile method arrange for stopping frame collection
+        // as soon as a frame from ReflectionFrames.class is reached.
+        // The first such frame encountered is still included in the
+        // collected frames, but collection stops right after.
+        // This makes it possible to filter out anything above the
+        // the test method frame, such as frames from the test
+        // framework.
+        public boolean takeWhile(StackFrame f) {
+            if (stop) return false;
+            if (verbose) System.out.println("    " + f);
+            stop = stop || f.getDeclaringClass() == ReflectionFrames.class;
+            return true;
+        }
+
+        // filter out implementation frames to avoid depending
+        // on implementation details. If present, Class::newInstance,
+        // Method::invoke and Constructor::newInstance will
+        // still appear in the collected frames, which is
+        // sufficient for the purpose of the test.
+        // In the case where the StackWalker itself is supposed to
+        // filter the reflection frames, then this filter will always
+        // return true. This way, if such a reflection frame appears when
+        // it sjould have been filtered by StackWalker, it will make the
+        // test fail.
+        public boolean filter(StackFrame f) {
+            if (filterImplFrames &&
+                f.getClassName().startsWith("jdk.internal.reflect.")) {
+                filtered++;
+                return false;
+            }
+            if (!verbose) System.out.println("    " + f);
+            return true;
+        }
+
+        public String frame(StackFrame f) {
+            return f.getClassName() + "::" + f.getMethodName();
+        }
+
+        List<String> parse(Stream<StackFrame> s) {
+            return s.takeWhile(this::takeWhile)
+                    .filter(this::filter)
+                    .map(this::frame)
+                    .collect(Collectors.toList());
+        }
+
+        /**
+         * The Caller class is used to create instances of
+         * StackInspector, either direcltly, or throug reflection.
+         */
+        public static class Caller {
+            public static StackInspector create(How how) throws Exception {
+                switch(how) {
+                    case NEW: return new StackInspector();
+                    case CONSTRUCTOR: return StackInspector.class
+                        .getConstructor().newInstance();
+                    case CLASS: return StackInspector.class.newInstance();
+                    default: throw new AssertionError(String.valueOf(how));
+                }
+            }
+            public static StackInspector reflect(How how) throws Exception {
+                return (StackInspector) Caller.class.getMethod("create", How.class)
+                      .invoke(null, how);
+            }
+            public static StackInspector handle(How how) throws Exception {
+                Lookup lookup = MethodHandles.lookup();
+                MethodHandle mh = lookup.findStatic(Caller.class, "create",
+                        MethodType.methodType(StackInspector.class, How.class));
+                try {
+                    return (StackInspector) mh.invoke(how);
+                } catch (Error | Exception x) {
+                    throw x;
+                } catch(Throwable t) {
+                    throw new AssertionError(t);
+                }
+            }
+        }
+
+        public static Class<?> getCaller() throws Exception {
+            return walker.get().getCallerClass();
+        }
+
+        public static Class<?> reflectCaller() throws Exception {
+            return (Class<?>)StackWalker.class.getMethod("getCallerClass")
+                .invoke(walker.get());
+        }
+
+        public static Class<?> supplyCaller() throws Exception {
+            return ((Supplier<Class<?>>)StackInspector.walker.get()::getCallerClass).get();
+        }
+
+        public static Class<?> handleCaller() throws Exception {
+            Lookup lookup = MethodHandles.lookup();
+            MethodHandle mh = lookup.findVirtual(StackWalker.class, "getCallerClass",
+                    MethodType.methodType(Class.class));
+            try {
+                return (Class<?>) mh.invoke(walker.get());
+            } catch (Error | Exception x) {
+                throw x;
+            } catch(Throwable t) {
+                throw new AssertionError(t);
+            }
+        }
+    }
+}
diff --git a/jdk/test/java/lang/StackWalker/stackwalk.policy b/jdk/test/java/lang/StackWalker/stackwalk.policy
index f768dbe..fbcb6b3 100644
--- a/jdk/test/java/lang/StackWalker/stackwalk.policy
+++ b/jdk/test/java/lang/StackWalker/stackwalk.policy
@@ -1,4 +1,4 @@
 grant {
-  permission java.lang.StackFramePermission "retainClassReference";
+  permission java.lang.RuntimePermission "getStackWalkerWithClassReference";
 };
 
diff --git a/jdk/test/java/lang/StackWalker/stackwalktest.policy b/jdk/test/java/lang/StackWalker/stackwalktest.policy
index b6d3d2a..3f01936 100644
--- a/jdk/test/java/lang/StackWalker/stackwalktest.policy
+++ b/jdk/test/java/lang/StackWalker/stackwalktest.policy
@@ -1,5 +1,5 @@
 grant {
-  permission java.lang.StackFramePermission "retainClassReference";
+  permission java.lang.RuntimePermission "getStackWalkerWithClassReference";
   permission java.util.PropertyPermission "seed", "read";
 };
 
diff --git a/jdk/test/java/lang/System/Logger/custom/CustomLoggerTest.java b/jdk/test/java/lang/System/Logger/custom/CustomLoggerTest.java
index d1653ca..4e18bab 100644
--- a/jdk/test/java/lang/System/Logger/custom/CustomLoggerTest.java
+++ b/jdk/test/java/lang/System/Logger/custom/CustomLoggerTest.java
@@ -46,7 +46,6 @@
 import java.lang.System.Logger;
 import java.lang.System.Logger.Level;
 import java.util.stream.Stream;
-import java.lang.reflect.Module;
 import java.security.AllPermission;
 
 /**
diff --git a/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/BaseLoggerFinder.java b/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/BaseLoggerFinder.java
index 3db7cef..ae07c70 100644
--- a/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/BaseLoggerFinder.java
+++ b/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/BaseLoggerFinder.java
@@ -25,7 +25,6 @@
 import java.security.PrivilegedAction;
 import java.lang.System.LoggerFinder;
 import java.lang.System.Logger;
-import java.lang.reflect.Module;
 
 public  class BaseLoggerFinder extends LoggerFinder implements TestLoggerFinder {
 
diff --git a/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/TestLoggerFinder.java b/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/TestLoggerFinder.java
index cb86e51..5e08f15 100644
--- a/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/TestLoggerFinder.java
+++ b/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/TestLoggerFinder.java
@@ -30,7 +30,6 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Supplier;
 import java.lang.System.Logger;
-import java.lang.reflect.Module;
 
 /**
  * What our test provider needs to implement.
diff --git a/jdk/test/java/lang/System/LoggerFinder/LoggerFinderAPI/LoggerFinderAPI.java b/jdk/test/java/lang/System/LoggerFinder/LoggerFinderAPI/LoggerFinderAPI.java
new file mode 100644
index 0000000..3c8944e
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/LoggerFinderAPI/LoggerFinderAPI.java
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.lang.System.Logger;
+import java.lang.System.Logger.Level;
+import java.lang.System.LoggerFinder;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Objects;
+import java.util.ResourceBundle;
+import java.util.concurrent.ConcurrentHashMap;
+// Can't use testng because testng requires java.logging
+//import org.testng.annotations.Test;
+
+/**
+ * @test
+ * @bug 8177835
+ * @summary Checks that the DefaultLoggerFinder and LoggingProviderImpl
+ *          implementations of the System.LoggerFinder conform to the
+ *          LoggerFinder specification, in particular with respect to
+ *          throwing NullPointerException. The test uses --limit-module
+ *          to force the selection of one or the other.
+ * @author danielfuchs
+ * @build LoggerFinderAPI
+ * @run main/othervm --limit-modules java.base,java.logging
+ *          -Djava.util.logging.SimpleFormatter.format=LOG-%4$s:-[%2$s]-%5$s%6$s%n
+ *          LoggerFinderAPI
+ * @run main/othervm -Djdk.system.logger.format=LOG-%4$s:-[%2$s]-%5$s%6$s%n
+ *          --limit-modules java.base
+ *          LoggerFinderAPI
+ */
+public class LoggerFinderAPI {
+
+    // Simplified log format string. No white space for main/othervm line
+    static final String TEST_FORMAT = "LOG-%4$s:-[%2$s]-%5$s%6$s%n";
+    static final String JDK_FORMAT_PROP_KEY = "jdk.system.logger.format";
+    static final String JUL_FORMAT_PROP_KEY =
+        "java.util.logging.SimpleFormatter.format";
+
+    static class RecordStream extends OutputStream {
+        static final Object LOCK = new Object[0];
+        final PrintStream out;
+        final PrintStream err;
+        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        boolean record;
+        RecordStream(PrintStream out, PrintStream err) {
+            this.out = out;
+            this.err = err;
+        }
+
+        @Override
+        public void write(int i) throws IOException {
+            if (record) {
+                bos.write(i);
+                out.write(i);
+            } else {
+                err.write(i);
+            }
+        }
+
+        void startRecording() {
+            out.flush();
+            err.flush();
+            bos.reset();
+            record = true;
+        }
+        byte[] stopRecording() {
+            out.flush();
+            err.flush();
+            record = false;
+            return bos.toByteArray();
+        }
+    }
+
+    static final PrintStream ERR = System.err;
+    static final PrintStream OUT = System.out;
+    static final RecordStream LOG_STREAM = new RecordStream(OUT, ERR);
+    static {
+        Locale.setDefault(Locale.US);
+        PrintStream perr = new PrintStream(LOG_STREAM);
+        System.setErr(perr);
+    }
+
+    public static class MyResourceBundle extends ResourceBundle {
+        final ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
+        @Override
+        protected Object handleGetObject(String string) {
+            return map.computeIfAbsent(string, s -> "[localized] " + s);
+        }
+
+        @Override
+        public Enumeration<String> getKeys() {
+            return map.keys();
+        }
+
+    }
+
+    public static void main(String[] args) {
+        // Set on the command line, to ensure that the test will fail if
+        // the 'wrong' provider gets selected.
+        // System.setProperty(JDK_FORMAT_PROP_KEY, TEST_FORMAT);
+        // System.setProperty(JUL_FORMAT_PROP_KEY, TEST_FORMAT);
+        LoggerFinder finder = System.LoggerFinder.getLoggerFinder();
+        System.out.println("LoggerFinder is " + finder.getClass().getName());
+
+        LoggerFinderAPI apiTest = new LoggerFinderAPI();
+        for (Object[] params : getLoggerDataProvider()) {
+            apiTest.testGetLogger((String)params[0],
+                                  (String)params[1],
+                                  (Module)params[2],
+                                  Throwable.class.getClass().cast(params[3]));
+        }
+        for (Object[] params : getLocalizedLoggerDataProvider()) {
+            apiTest.testGetLocalizedLogger((String)params[0],
+                                  (String)params[1],
+                                  (ResourceBundle)params[2],
+                                  (Module)params[3],
+                                  Throwable.class.getClass().cast(params[4]));
+        }
+    }
+
+    //Can't use testng because testng requires java.logging
+    //@Test(dataProvider = "testGetLoggerDataProvider")
+    void testGetLogger(String desc, String name, Module mod, Class<? extends Throwable> thrown) {
+        try {
+            LoggerFinder finder = System.LoggerFinder.getLoggerFinder();
+            Logger logger = finder.getLogger(name, mod);
+            if (thrown != null) {
+                throw new AssertionError("Exception " + thrown.getName()
+                        + " not thrown for "
+                        + "LoggerFinder.getLogger"
+                        + " with " + desc);
+            }
+            // Make sure we don't fail if tests are run in parallel
+            synchronized(RecordStream.LOCK) {
+                LOG_STREAM.startRecording();
+                try {
+                    logger.log(Level.INFO, "{0} with {1}: PASSED",
+                               "LoggerFinder.getLogger",
+                               desc);
+                } finally {
+                    byte[] logged = LOG_STREAM.stopRecording();
+                    check(logged, "testGetLogger", desc, null,
+                          "LoggerFinder.getLogger");
+                }
+            }
+        } catch (Throwable x) {
+            if (thrown != null && thrown.isInstance(x)) {
+                System.out.printf("Got expected exception for %s with %s: %s\n",
+                        "LoggerFinder.getLogger", desc, String.valueOf(x));
+            } else throw x;
+        }
+    }
+
+    //Can't use testng because testng requires java.logging
+    //@Test(dataProvider = "getLocalizedLoggerDataProvider")
+    void testGetLocalizedLogger(String desc, String name, ResourceBundle bundle,
+                                Module mod, Class<? extends Throwable> thrown) {
+        try {
+            LoggerFinder finder = System.LoggerFinder.getLoggerFinder();
+            Logger logger = finder.getLocalizedLogger(name, bundle, mod);
+            if (thrown != null) {
+                throw new AssertionError("Exception " + thrown.getName()
+                        + " not thrown for "
+                        + "LoggerFinder.getLocalizedLogger"
+                        + " with " + desc);
+            }
+            // Make sure we don't fail if tests are run in parallel
+            synchronized(RecordStream.LOCK) {
+                LOG_STREAM.startRecording();
+                try {
+                    logger.log(Level.INFO, "{0} with {1}: PASSED",
+                              "LoggerFinder.getLocalizedLogger",
+                              desc);
+                } finally {
+                    byte[] logged = LOG_STREAM.stopRecording();
+                    check(logged, "testGetLocalizedLogger", desc, bundle,
+                          "LoggerFinder.getLocalizedLogger");
+                }
+            }
+        } catch (Throwable x) {
+            if (thrown != null && thrown.isInstance(x)) {
+                System.out.printf("Got expected exception for %s with %s: %s\n",
+                        "LoggerFinder.getLocalizedLogger", desc, String.valueOf(x));
+            } else throw x;
+        }
+    }
+
+    private void check(byte[] logged, String test, String desc,
+                       ResourceBundle bundle, String meth) {
+        String msg = new String(logged);
+        String expected = String.format(TEST_FORMAT, null,
+                "LoggerFinderAPI " + test, null, Level.INFO.name(),
+                (bundle==null?"":"[localized] ") + meth + " with " + desc + ": PASSED",
+                "");
+        if (!Objects.equals(msg, expected)) {
+            throw new AssertionError("Expected log message not found: "
+                                     + "\n\texpected:  " + expected
+                                     + "\n\tretrieved: " + msg);
+        }
+    }
+
+
+    static final Module MODULE = LoggerFinderAPI.class.getModule();
+    static final ResourceBundle BUNDLE = new MyResourceBundle();
+    static final Object[][] GET_LOGGER = {
+        {"null name", null, MODULE , NullPointerException.class},
+        {"null module", "foo", null, NullPointerException.class},
+        {"null name and module", null, null, NullPointerException.class},
+        {"non null name and module", "foo", MODULE, null},
+    };
+    static final Object[][] GET_LOCALIZED_LOGGER = {
+        {"null name", null, BUNDLE, MODULE , NullPointerException.class},
+        {"null module", "foo", BUNDLE, null, NullPointerException.class},
+        {"null name and module", null, BUNDLE, null, NullPointerException.class},
+        {"non null name and module", "foo", BUNDLE, MODULE, null},
+        {"null name and bundle", null, null, MODULE , NullPointerException.class},
+        {"null module and bundle", "foo", null, null, NullPointerException.class},
+        {"null name and module and bundle", null, null, null, NullPointerException.class},
+        {"non null name and module, null bundle", "foo", null, MODULE, null},
+    };
+    public static Object[][] getLoggerDataProvider() {
+        return GET_LOGGER;
+    }
+    public static Object[][] getLocalizedLoggerDataProvider() {
+        return GET_LOCALIZED_LOGGER;
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BaseDefaultLoggerFinderTest/BaseDefaultLoggerFinderTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BaseDefaultLoggerFinderTest/BaseDefaultLoggerFinderTest.java
index ab80d0f..ce5e714 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BaseDefaultLoggerFinderTest/BaseDefaultLoggerFinderTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BaseDefaultLoggerFinderTest/BaseDefaultLoggerFinderTest.java
@@ -55,7 +55,6 @@
 import jdk.internal.logger.DefaultLoggerFinder;
 import jdk.internal.logger.SimpleConsoleLogger;
 import sun.util.logging.PlatformLogger;
-import java.lang.reflect.Module;
 
 /**
  * @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BaseLoggerBridgeTest/BaseLoggerBridgeTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BaseLoggerBridgeTest/BaseLoggerBridgeTest.java
index d28481c..98ecc69 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BaseLoggerBridgeTest/BaseLoggerBridgeTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BaseLoggerBridgeTest/BaseLoggerBridgeTest.java
@@ -47,7 +47,6 @@
 import java.lang.System.Logger;
 import java.lang.System.Logger.Level;
 import java.util.stream.Stream;
-import java.lang.reflect.Module;
 
 /**
  * @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BasePlatformLoggerTest/BasePlatformLoggerTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BasePlatformLoggerTest/BasePlatformLoggerTest.java
index a9e441f..af15a51 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BasePlatformLoggerTest/BasePlatformLoggerTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BasePlatformLoggerTest/BasePlatformLoggerTest.java
@@ -47,7 +47,6 @@
 import java.security.AccessControlException;
 import java.util.stream.Stream;
 import sun.util.logging.PlatformLogger;
-import java.lang.reflect.Module;
 
 /**
  * @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java
index 1b6a5c6..19b1009 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java
@@ -30,7 +30,6 @@
 import java.util.List;
 import java.util.ResourceBundle;
 import java.util.Set;
-import java.lang.reflect.Module;
 import jdk.internal.logger.BootstrapLogger;
 import jdk.internal.logger.LazyLoggers;
 
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java
index f34ab76..8bc016b 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java
@@ -43,7 +43,6 @@
 import java.util.stream.Stream;
 import jdk.internal.logger.BootstrapLogger;
 import jdk.internal.logger.LazyLoggers;
-import java.lang.reflect.Module;
 
 /*
  * @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/LoggerBridgeTest/LoggerBridgeTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/LoggerBridgeTest/LoggerBridgeTest.java
index be5ad12..bd70d54 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/LoggerBridgeTest/LoggerBridgeTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/LoggerBridgeTest/LoggerBridgeTest.java
@@ -51,7 +51,6 @@
 import java.lang.System.Logger.Level;
 import java.util.stream.Stream;
 import sun.util.logging.PlatformLogger;
-import java.lang.reflect.Module;
 
 /**
  * @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/LoggerFinderLoaderTest/LoggerFinderLoaderTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/LoggerFinderLoaderTest/LoggerFinderLoaderTest.java
index 6343a90..192be7f 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/LoggerFinderLoaderTest/LoggerFinderLoaderTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/LoggerFinderLoaderTest/LoggerFinderLoaderTest.java
@@ -53,7 +53,6 @@
 import java.util.ServiceLoader;
 import java.util.concurrent.atomic.AtomicReference;
 import jdk.internal.logger.SimpleConsoleLogger;
-import java.lang.reflect.Module;
 
 /**
  * @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest/PlatformLoggerBridgeTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest/PlatformLoggerBridgeTest.java
index 9576e17..c409c22 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest/PlatformLoggerBridgeTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest/PlatformLoggerBridgeTest.java
@@ -49,7 +49,6 @@
 import java.lang.System.Logger.Level;
 import java.util.stream.Stream;
 import sun.util.logging.PlatformLogger;
-import java.lang.reflect.Module;
 
 /**
  * @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java b/jdk/test/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java
index 25be130..fe0f9e5 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java
@@ -28,7 +28,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
 
 /*
@@ -106,7 +105,7 @@
         }
         Class<?> platformLoggerType = platformLogger.getClass();
         System.out.println("platformLogger: " + platformLoggerType);
-        boolean simpleConsoleOnly = !Layer.boot().findModule("java.logging").isPresent();
+        boolean simpleConsoleOnly = !ModuleLayer.boot().findModule("java.logging").isPresent();
         if (simpleConsoleOnly) {
             /* Happens if the test is called with custom JDK without java.logging module
                or in case usage commandline option --limit-modules java.base */
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/backend/LoggerFinderBackendTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/backend/LoggerFinderBackendTest.java
index 6abc3c5..d2e20b3 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/backend/LoggerFinderBackendTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/backend/LoggerFinderBackendTest.java
@@ -78,7 +78,6 @@
 import java.util.logging.LogRecord;
 import java.util.logging.Logger;
 import sun.util.logging.internal.LoggingProviderImpl;
-import java.lang.reflect.Module;
 
 /**
  * @author danielfuchs
diff --git a/jdk/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java b/jdk/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java
index cba6f7b..d2348a2 100644
--- a/jdk/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java
@@ -48,7 +48,6 @@
 import java.lang.System.Logger;
 import java.util.stream.Stream;
 import sun.util.logging.internal.LoggingProviderImpl;
-import java.lang.reflect.Module;
 
 /**
  * @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/Base.java b/jdk/test/java/lang/System/LoggerFinder/modules/Base.java
new file mode 100644
index 0000000..62a0fa0
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/Base.java
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import jdk.testlibrary.JDKToolFinder;
+
+import static jdk.testlibrary.ProcessTools.executeCommand;
+
+/*
+ * Base class for tests.
+ * The tests focuse on that LoggerFinder works well in jigsaw environment,
+ * i.e. make sure correct Logger can be retrieved,
+ * also verify that basic functionality of retrieved Logger's works well.
+ *
+ * Note: As the test will take long time, to avoid timeout,
+ * split it as several tests, this class is the base class for tests.
+ */
+public class Base {
+    protected static final String JAVA_HOME = System.getProperty("java.home");
+    protected static final Path JDK_IMAGE = Paths.get(JAVA_HOME);
+    protected static final Path JMODS = Paths.get(JAVA_HOME, "jmods");
+
+    protected static final String TEST_SRC = System.getProperty("test.src");
+
+    // logger client to get logger from java.base module, it should get a lazy logger
+    // which wraps the underlying real logger implementation
+    protected static final Path SRC_PATCHED_USAGE =
+            Paths.get(TEST_SRC, "patched_usage", "java.base");
+    protected static final Path DEST_PATCHED_USAGE = Paths.get("patched_usage", "java.base");
+    protected static final Path SRC_PATCHED_CLIENT = Paths.get(TEST_SRC, "patched_client");
+    protected static final Path DEST_PATCHED_CLIENT = Paths.get("patched_client");
+
+    // logger client to get logger from bootclasspath/a, it should get a lazy logger
+    // which wraps the underlying real logger implementation
+    protected static final Path SRC_BOOT_USAGE = Paths.get(TEST_SRC, "boot_usage");
+    protected static final Path DEST_BOOT_USAGE = Paths.get("boot_usage");
+    protected static final Path SRC_BOOT_CLIENT = Paths.get(TEST_SRC, "boot_client");
+    protected static final Path DEST_BOOT_CLIENT = Paths.get("boot_client");
+
+    // logger provider in named module m.l.a
+    protected static final Path SRC_NAMED_LOGGER = Paths.get(TEST_SRC, "named_logger");
+    protected static final Path DEST_NAMED_LOGGER = Paths.get("mods_named_logger");
+
+    // logger provider in unnamed module
+    protected static final Path SRC_UNNAMED_LOGGER = Paths.get(TEST_SRC, "unnamed_logger");
+    protected static final Path DEST_UNNAMED_LOGGER = Paths.get("cp_unnamed_logger");
+    protected static final Path SRC_UNNAMED_LOGGER_SERVICE_FILE =
+            SRC_UNNAMED_LOGGER.resolve("META-INF/services/java.lang.System$LoggerFinder");
+    protected static final Path DEST_UNNAMED_LOGGER_SERVICE_DIR =
+            DEST_UNNAMED_LOGGER.resolve("META-INF/services");
+    protected static final Path DEST_UNNAMED_LOGGER_SERVICE_FILE =
+            DEST_UNNAMED_LOGGER.resolve("META-INF/services/java.lang.System$LoggerFinder");
+
+    // logger client in named module m.t.a
+    protected static final Path SRC_NAMED_CLIENT = Paths.get(TEST_SRC, "named_client");
+    protected static final Path DEST_NAMED_CLIENT = Paths.get("mods_named_client");
+
+    // logger client in unnamed module
+    protected static final Path SRC_UNNAMED_CLIENT = Paths.get(TEST_SRC, "unnamed_client");
+    protected static final Path DEST_UNNAMED_CLIENT = Paths.get("cp_unnamed_client");
+
+    // customized image with only module java.base
+    protected static final Path IMAGE = Paths.get("image");
+    // customized image with java.base and logger provider module m.l.a
+    protected static final Path IMAGE_LOGGER = Paths.get("image_logger");
+    // customized image with module java.base and logger client module m.t.a
+    protected static final Path IMAGE_CLIENT = Paths.get("image_client");
+    // customized image with module java.base, logger provider module m.l.a
+    // and logger client module m.t.a
+    protected static final Path IMAGE_CLIENT_LOGGER = Paths.get("image_all");
+
+    // lazy logger class which wraps the underlying real logger implementation
+    protected static final String LAZY_LOGGER =
+            "jdk.internal.logger.LazyLoggers$JdkLazyLogger";
+    // JUL logger class which wraps java.util.logging.Logger
+    protected static final String JUL_LOGGER =
+            "sun.util.logging.internal.LoggingProviderImpl$JULWrapper";
+    // default simple logger class when no logger provider can be found
+    protected static final String SIMPLE_LOGGER =
+            "jdk.internal.logger.SimpleConsoleLogger";
+    // logger class in named module m.l.a
+    protected static final String LOGGER_A = "pkg.a.l.LoggerA";
+    // logger class in unnamed module m.l.b
+    protected static final String LOGGER_B = "pkg.b.l.LoggerB";
+
+    // logger client in named module
+    protected static final String CLIENT_A = "m.t.a/pkg.a.t.TestA";
+    // logger client in unnamed module
+    protected static final String CLIENT_B = "pkg.b.t.TestB";
+    // logger client which gets logger through boot class BootUsage
+    protected static final String BOOT_CLIENT = "BootClient";
+    // logger client which gets logger through patched class
+    // java.base/java.lang.PatchedUsage
+    protected static final String PATCHED_CLIENT = "PatchedClient";
+
+    protected void setupAllClient() throws Throwable {
+        // compiles logger client which will get logger through patched
+        // class java.base/java.lang.PatchedUsage
+        compile(SRC_BOOT_USAGE, DEST_BOOT_USAGE);
+        compile(SRC_BOOT_CLIENT, DEST_BOOT_CLIENT,
+                "--class-path", DEST_BOOT_USAGE.toString());
+
+        // compiles logger client which will get logger through boot
+        // class BootUsage
+        compile(SRC_PATCHED_USAGE, DEST_PATCHED_USAGE,
+                "--patch-module", "java.base=" + SRC_PATCHED_USAGE.toString());
+        compile(SRC_PATCHED_CLIENT, DEST_PATCHED_CLIENT,
+                "--patch-module", "java.base=" + DEST_PATCHED_USAGE.toString());
+
+        // compiles logger client in unnamed module
+        compile(SRC_UNNAMED_CLIENT, DEST_UNNAMED_CLIENT,
+                "--source-path", SRC_UNNAMED_CLIENT.toString());
+
+        // compiles logger client in named module m.t.a
+        compile(SRC_NAMED_CLIENT, DEST_NAMED_CLIENT,
+                "--module-source-path", SRC_NAMED_CLIENT.toString());
+    }
+
+    protected void setupNamedLogger() throws Throwable {
+        // compiles logger provider in named module m.l.a
+        compile(SRC_NAMED_LOGGER, DEST_NAMED_LOGGER,
+                "--module-source-path", SRC_NAMED_LOGGER.toString());
+    }
+
+    protected void setupUnnamedLogger() throws Throwable {
+        // compiles logger provider in unnamed module
+        compile(SRC_UNNAMED_LOGGER, DEST_UNNAMED_LOGGER,
+                "--source-path", SRC_UNNAMED_LOGGER.toString());
+        Files.createDirectories(DEST_UNNAMED_LOGGER_SERVICE_DIR);
+        Files.copy(SRC_UNNAMED_LOGGER_SERVICE_FILE, DEST_UNNAMED_LOGGER_SERVICE_FILE,
+                   StandardCopyOption.REPLACE_EXISTING);
+    }
+
+    protected boolean checkJMODS() throws Throwable {
+        // if $JAVA_HOME/jmods does not exist, skip below steps
+        // as there is no way to build customized images by jlink
+        if (Files.notExists(JMODS)) {
+            System.err.println("Skip tests which require image");
+            return false;
+        }
+        return true;
+    }
+
+    protected void setupJavaBaseImage() throws Throwable {
+        if (!checkJMODS()) {
+            return;
+        }
+
+        // build image with just java.base module
+        String mpath = JMODS.toString();
+        execTool("jlink",
+                "--module-path", mpath,
+                "--add-modules", "java.base",
+                "--output", IMAGE.toString());
+    }
+
+    protected void setupLoggerImage() throws Throwable {
+        if (!checkJMODS()) {
+            return;
+        }
+
+        // build image with java.base + m.l.a modules
+        String mpath = DEST_NAMED_LOGGER.toString() + File.pathSeparator + JMODS.toString();
+        execTool("jlink",
+                "--module-path", mpath,
+                "--add-modules", "m.l.a",
+                "--output", IMAGE_LOGGER.toString());
+    }
+
+    protected void setupClientImage() throws Throwable {
+        if (!checkJMODS()) {
+            return;
+        }
+
+        // build image with java.base + m.t.a modules
+        String mpath = DEST_NAMED_CLIENT.toString() + File.pathSeparator + JMODS.toString();
+        execTool("jlink",
+                "--module-path", mpath,
+                "--add-modules", "m.t.a",
+                "--output", IMAGE_CLIENT.toString());
+    }
+
+    protected void setupFullImage() throws Throwable {
+        if (!checkJMODS()) {
+            return;
+        }
+
+        // build image with java.base + m.l.a + m.t.a modules
+        String mpath = DEST_NAMED_LOGGER.toString() + File.pathSeparator
+                + DEST_NAMED_CLIENT.toString() + File.pathSeparator + JMODS.toString();
+        execTool("jlink",
+                "--module-path", mpath,
+                "--add-modules", "m.l.a,m.t.a",
+                "--output", IMAGE_CLIENT_LOGGER.toString());
+
+    }
+
+    protected static void assertTrue(boolean b) {
+        if (!b) {
+            throw new RuntimeException("expected true, but get false.");
+        }
+    }
+
+    /*
+     * run test with supplied java image which could be jdk image or customized image
+     */
+    protected void runTest(Path image, String... opts) throws Throwable {
+        String[] options = Stream.concat(Stream.of(getJava(image)), Stream.of(opts))
+                                 .toArray(String[]::new);
+
+        ProcessBuilder pb = new ProcessBuilder(options);
+        int exitValue = executeCommand(pb).outputTo(System.out)
+                                          .errorTo(System.err)
+                                          .getExitValue();
+        assertTrue(exitValue == 0);
+    }
+
+    private void compile(Path src, Path dest, String... params) throws Throwable {
+        assertTrue(CompilerUtils.compile(src, dest, params));
+    }
+
+    private String getJava(Path image) {
+        boolean isWindows = System.getProperty("os.name").startsWith("Windows");
+        Path java = image.resolve("bin").resolve(isWindows ? "java.exe" : "java");
+        if (Files.notExists(java))
+            throw new RuntimeException(java + " not found");
+        return java.toAbsolutePath().toString();
+    }
+
+    private void execTool(String tool, String... args) throws Throwable {
+        String path = JDKToolFinder.getJDKTool(tool);
+        List<String> commands = new ArrayList<>();
+        commands.add(path);
+        Stream.of(args).forEach(commands::add);
+        ProcessBuilder pb = new ProcessBuilder(commands);
+
+        int exitValue = executeCommand(pb).outputTo(System.out)
+                                          .errorTo(System.out)
+                                          .shouldNotContain("no module is recorded in hash")
+                                          .getExitValue();
+        assertTrue(exitValue == 0);
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java b/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java
new file mode 100644
index 0000000..2e41d8e
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import jdk.testlibrary.JDKToolFinder;
+
+import static jdk.testlibrary.ProcessTools.executeCommand;
+
+/*
+ * @test
+ * @modules jdk.compiler
+ * @summary Test cases which run against customized image, check the situation where
+ *            1. logger provider is the default one supplied by java.base,
+ *            2. clients are in named/unnamed module,
+ *               patched system module, or Xbootclasspath
+ *          This test does not require existence of java.logging module,
+ *          but require jdk.compiler module
+ * @library /lib/testlibrary
+ * @build Base CompilerUtils jdk.testlibrary.*
+ * @run main/othervm JDKLoggerForImageTest
+ */
+
+public class JDKLoggerForImageTest extends Base {
+
+    public static void main(String args[]) throws Throwable {
+        JDKLoggerForImageTest t = new JDKLoggerForImageTest();
+        t.setup();
+        t.test();
+    }
+
+    private void setup() throws Throwable {
+        setupAllClient();
+
+        setupJavaBaseImage();
+    }
+
+    private void test() throws Throwable {
+        if (!checkJMODS()) {
+            return;
+        }
+
+        // logger client is in named module m.t.a
+        runTest(IMAGE,
+                "--module-path", DEST_NAMED_CLIENT.toString(),
+                "-m", CLIENT_A, "system", SIMPLE_LOGGER);
+        // logger client is in unnamed module
+        runTest(IMAGE,
+                "--class-path", DEST_UNNAMED_CLIENT.toString(),
+                CLIENT_B, "system", SIMPLE_LOGGER);
+        // logger client gets logger through boot class BootUsage
+        runTest(IMAGE,
+                "-Xbootclasspath/a:" + DEST_BOOT_USAGE.toString(),
+                "--class-path", DEST_BOOT_CLIENT.toString(),
+                BOOT_CLIENT, "system", SIMPLE_LOGGER);
+        // logger client gets logger through patched class
+        // java.base/java.lang.PatchedUsage
+        runTest(IMAGE,
+                "--patch-module", "java.base=" + DEST_PATCHED_USAGE.toString(),
+                "--class-path", DEST_PATCHED_CLIENT.toString(),
+                PATCHED_CLIENT, "system", SIMPLE_LOGGER);
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java b/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java
new file mode 100644
index 0000000..b9c8dbe
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import jdk.testlibrary.JDKToolFinder;
+
+import static jdk.testlibrary.ProcessTools.executeCommand;
+
+/*
+ * @test
+ * @modules java.logging
+ * @modules jdk.compiler
+ * @summary Test cases which run against the JDK image, check the situation where
+ *            1. logger provider is the default one supplied by the JDK,
+ *            2. clients are in named/unnamed module,
+ *               patched system module, or Xbootclasspath
+ *          This test DOES require existence of java.logging module
+ * @library /lib/testlibrary
+ * @build Base CompilerUtils jdk.testlibrary.*
+ * @run main/othervm JDKLoggerForJDKTest
+ */
+
+public class JDKLoggerForJDKTest extends Base {
+
+    public static void main(String args[]) throws Throwable {
+        JDKLoggerForJDKTest t = new JDKLoggerForJDKTest();
+        t.setup();
+        t.test();
+    }
+
+    private void setup() throws Throwable {
+        setupAllClient();
+    }
+
+    private void test() throws Throwable {
+        // logger client is in named module m.t.a
+        runTest(JDK_IMAGE,
+                "--module-path", DEST_NAMED_CLIENT.toString(),
+                "-m", CLIENT_A, "system", JUL_LOGGER);
+        // logger client is in unnamed module
+        runTest(JDK_IMAGE,
+                "--class-path", DEST_UNNAMED_CLIENT.toString(),
+                CLIENT_B, "system", JUL_LOGGER);
+        // logger client gets logger through boot class BootUsage
+        runTest(JDK_IMAGE,
+                "-Xbootclasspath/a:" + DEST_BOOT_USAGE.toString(),
+                "--class-path", DEST_BOOT_CLIENT.toString(),
+                BOOT_CLIENT, "system", LAZY_LOGGER, JUL_LOGGER);
+        // logger client gets logger through patched class
+        // java.base/java.lang.PatchedUsage
+        runTest(JDK_IMAGE,
+                "--patch-module", "java.base=" + DEST_PATCHED_USAGE.toString(),
+                "--class-path", DEST_PATCHED_CLIENT.toString(),
+                PATCHED_CLIENT, "system", LAZY_LOGGER, JUL_LOGGER);
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java b/jdk/test/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java
new file mode 100644
index 0000000..2583b1a
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import jdk.testlibrary.JDKToolFinder;
+
+import static jdk.testlibrary.ProcessTools.executeCommand;
+
+/*
+ * @test
+ * @modules jdk.compiler
+ * @summary Test cases which run against customized image, check the situation where
+ *            1. logger providers are in the customized image too,
+ *            2. clients are in named/unnamed module, image,
+ *               patched system module, or Xbootclasspath
+ *          This test does not require existence of java.logging module,
+ *          but require jdk.compiler module
+ * @library /lib/testlibrary
+ * @build Base CompilerUtils jdk.testlibrary.*
+ * @run main/othervm LoggerInImageTest
+ */
+
+public class LoggerInImageTest extends Base {
+
+    public static void main(String args[]) throws Throwable {
+        LoggerInImageTest t = new LoggerInImageTest();
+        t.setup();
+        t.test();
+    }
+
+    private void setup() throws Throwable {
+        setupAllClient();
+
+        setupNamedLogger();
+
+        setupLoggerImage();
+        setupFullImage();
+    }
+
+    private void test() throws Throwable {
+        if (!checkJMODS()) {
+            return;
+        }
+
+        // logger client is in named module m.t.a which is also in customized image
+        runTest(IMAGE_CLIENT_LOGGER,
+                "-m", CLIENT_A, "named", LOGGER_A);
+        // logger client in named module m.t.a
+        runTest(IMAGE_LOGGER,
+                "--module-path", DEST_NAMED_CLIENT.toString(),
+                "-m", CLIENT_A, "named", LOGGER_A);
+        // logger client is in unnamed module
+        runTest(IMAGE_LOGGER,
+                "--class-path", DEST_UNNAMED_CLIENT.toString(),
+                CLIENT_B, "named", LOGGER_A);
+        // logger client gets logger through boot class BootUsage
+        runTest(IMAGE_LOGGER,
+                "-Xbootclasspath/a:" + DEST_BOOT_USAGE.toString(),
+                "--class-path", DEST_BOOT_CLIENT.toString(),
+                BOOT_CLIENT, "system", LAZY_LOGGER, LOGGER_A);
+        // logger client gets logger through patched class
+        // java.base/java.lang.PatchedUsage
+        runTest(IMAGE_LOGGER,
+                "--patch-module", "java.base=" + DEST_PATCHED_USAGE.toString(),
+                "--class-path", DEST_PATCHED_CLIENT.toString(),
+                PATCHED_CLIENT, "system", LAZY_LOGGER, LOGGER_A);
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java b/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java
new file mode 100644
index 0000000..eda8b3c
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import jdk.testlibrary.JDKToolFinder;
+
+import static jdk.testlibrary.ProcessTools.executeCommand;
+
+/*
+ * @test
+ * @modules jdk.compiler
+ * @summary Test cases which run against customized image, check the situation where
+ *            1. logger providers are in named module,
+ *            2. clients are in named/unnamed module, image,
+ *               patched system module, or Xbootclasspath
+ *          This test does not require existence of java.logging module,
+ *          but require jdk.compiler module
+ * @library /lib/testlibrary
+ * @build Base CompilerUtils jdk.testlibrary.*
+ * @run main/othervm NamedLoggerForImageTest
+ */
+
+public class NamedLoggerForImageTest extends Base {
+
+    public static void main(String args[]) throws Throwable {
+        NamedLoggerForImageTest t = new NamedLoggerForImageTest();
+        t.setup();
+        t.test();
+    }
+
+    private void setup() throws Throwable {
+        setupAllClient();
+
+        setupNamedLogger();
+
+        setupJavaBaseImage();
+        setupClientImage();
+    }
+
+    private void test() throws Throwable {
+        if (!checkJMODS()) {
+            return;
+        }
+
+        // logger client is in named module m.t.a
+        runTest(IMAGE,
+                "--module-path", DEST_NAMED_LOGGER.toString()
+                    + File.pathSeparator + DEST_NAMED_CLIENT.toString(),
+                "-m", CLIENT_A, "named", LOGGER_A);
+        // logger client is in unnamed module
+        runTest(IMAGE,
+                "--module-path", DEST_NAMED_LOGGER.toString(),
+                "--class-path", DEST_UNNAMED_CLIENT.toString(),
+                CLIENT_B, "named", LOGGER_A);
+        // logger client is in named module m.t.a which is in customized image
+        runTest(IMAGE_CLIENT,
+                "--module-path", DEST_NAMED_LOGGER.toString(),
+                "-m", CLIENT_A, "named", LOGGER_A);
+        // logger client gets logger through boot class BootUsage
+        runTest(IMAGE,
+                "--module-path", DEST_NAMED_LOGGER.toString(),
+                "-Xbootclasspath/a:" + DEST_BOOT_USAGE.toString(),
+                "--class-path", DEST_BOOT_CLIENT.toString(),
+                BOOT_CLIENT, "system", LAZY_LOGGER, LOGGER_A);
+        // logger client gets logger through patched class
+        // java.base/java.lang.PatchedUsage
+        runTest(IMAGE,
+                "--module-path", DEST_NAMED_LOGGER.toString(),
+                "--patch-module", "java.base=" + DEST_PATCHED_USAGE.toString(),
+                "--class-path", DEST_PATCHED_CLIENT.toString(),
+                PATCHED_CLIENT, "system", LAZY_LOGGER, LOGGER_A);
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java b/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java
new file mode 100644
index 0000000..f6bebdc
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import jdk.testlibrary.JDKToolFinder;
+
+import static jdk.testlibrary.ProcessTools.executeCommand;
+
+/*
+ * @test
+ * @modules jdk.compiler
+ * @summary Test cases which run against the JDK image, check the situation where
+ *            1. logger providers are in named module,
+ *            2. clients are in named/unnamed module,
+ *               patched system module, or Xbootclasspath
+ *          This test does not require existence of java.logging module,
+ *          but require jdk.compiler module
+ * @library /lib/testlibrary
+ * @build Base CompilerUtils jdk.testlibrary.*
+ * @run main/othervm NamedLoggerForJDKTest
+ */
+
+public class NamedLoggerForJDKTest extends Base {
+
+    public static void main(String args[]) throws Throwable {
+        NamedLoggerForJDKTest t = new NamedLoggerForJDKTest();
+        t.setup();
+        t.test();
+    }
+
+    private void setup() throws Throwable {
+        setupAllClient();
+
+        setupNamedLogger();
+    }
+
+    private void test() throws Throwable {
+        // logger client is in named module m.t.a
+        runTest(JDK_IMAGE,
+                "--module-path", DEST_NAMED_LOGGER.toString()
+                    + File.pathSeparator + DEST_NAMED_CLIENT.toString(),
+                "-m", CLIENT_A, "named", LOGGER_A);
+        // logger client is in unnamed module
+        runTest(JDK_IMAGE,
+                "--module-path", DEST_NAMED_LOGGER.toString(),
+                "--class-path", DEST_UNNAMED_CLIENT.toString(),
+                CLIENT_B, "named", LOGGER_A);
+        // logger client gets logger through boot class BootUsage
+        runTest(JDK_IMAGE,
+                "--module-path", DEST_NAMED_LOGGER.toString(),
+                "-Xbootclasspath/a:" + DEST_BOOT_USAGE.toString(),
+                "--class-path", DEST_BOOT_CLIENT.toString(),
+                BOOT_CLIENT, "system", LAZY_LOGGER, LOGGER_A);
+        // logger client gets logger through patched class
+        // java.base/java.lang.PatchedUsage
+        runTest(JDK_IMAGE,
+                "--module-path", DEST_NAMED_LOGGER.toString(),
+                "--patch-module", "java.base=" + DEST_PATCHED_USAGE.toString(),
+                "--class-path", DEST_PATCHED_CLIENT.toString(),
+                PATCHED_CLIENT, "system", LAZY_LOGGER, LOGGER_A);
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java b/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java
new file mode 100644
index 0000000..936fe6a
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import jdk.testlibrary.JDKToolFinder;
+
+import static jdk.testlibrary.ProcessTools.executeCommand;
+
+/*
+ * @test
+ * @modules jdk.compiler
+ * @summary Test cases which run against customized image, check the situation where
+ *            1. logger providers are in unnamed module,
+ *            2. clients are in named/unnamed module, image,
+ *               patched system module, or Xbootclasspath
+ *          This test does not require existence of java.logging module,
+ *          but require jdk.compiler module
+ * @library /lib/testlibrary
+ * @build Base CompilerUtils jdk.testlibrary.*
+ * @run main/othervm UnnamedLoggerForImageTest
+ */
+
+public class UnnamedLoggerForImageTest extends Base {
+
+    public static void main(String args[]) throws Throwable {
+        UnnamedLoggerForImageTest t = new UnnamedLoggerForImageTest();
+        t.setup();
+        t.test();
+    }
+
+    private void setup() throws Throwable {
+        setupAllClient();
+
+        setupUnnamedLogger();
+
+        setupJavaBaseImage();
+        setupClientImage();
+    }
+
+    private void test() throws Throwable {
+        if (!checkJMODS()) {
+            return;
+        }
+
+        // logger client is in unnamed module
+        runTest(IMAGE,
+                "--class-path", DEST_UNNAMED_LOGGER.toString()
+                    + File.pathSeparator + DEST_UNNAMED_CLIENT.toString(),
+                CLIENT_B, "unnamed", LOGGER_B);
+        // logger client is in named module m.t.a
+        runTest(IMAGE,
+                "--class-path", DEST_UNNAMED_LOGGER.toString(),
+                "--module-path", DEST_NAMED_CLIENT.toString(),
+                "-m", CLIENT_A, "unnamed", LOGGER_B);
+        // logger client is in named module m.t.a which is in customized image
+        runTest(IMAGE_CLIENT,
+                "--class-path", DEST_UNNAMED_LOGGER.toString(),
+                "-m", CLIENT_A, "unnamed", LOGGER_B);
+        // logger client gets logger through boot class BootUsage
+        runTest(IMAGE,
+                "--class-path", DEST_UNNAMED_LOGGER.toString()
+                    + File.pathSeparator + DEST_BOOT_CLIENT.toString(),
+                "-Xbootclasspath/a:" + DEST_BOOT_USAGE.toString(),
+                BOOT_CLIENT, "system", LAZY_LOGGER, LOGGER_B);
+        // logger client gets logger through patched class
+        // java.base/java.lang.PatchedUsage
+        runTest(IMAGE,
+                "--class-path", DEST_UNNAMED_LOGGER.toString()
+                    + File.pathSeparator + DEST_PATCHED_CLIENT.toString(),
+                "--patch-module", "java.base=" + DEST_PATCHED_USAGE.toString(),
+                PATCHED_CLIENT, "system", LAZY_LOGGER, LOGGER_B);
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java b/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java
new file mode 100644
index 0000000..2049e37
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import jdk.testlibrary.JDKToolFinder;
+
+import static jdk.testlibrary.ProcessTools.executeCommand;
+
+/*
+ * @test
+ * @modules jdk.compiler
+ * @summary Test cases which run against the JDK image, check the situation where
+ *            1. logger providers are in unnamed module,
+ *            2. clients are in named/unnamed module,
+ *               patched system module, or Xbootclasspath
+ *          This test does not require existence of java.logging module,
+ *          but require jdk.compiler module
+ * @library /lib/testlibrary
+ * @build Base CompilerUtils jdk.testlibrary.*
+ * @run main/othervm UnnamedLoggerForJDKTest
+ */
+
+public class UnnamedLoggerForJDKTest extends Base {
+
+    public static void main(String args[]) throws Throwable {
+        UnnamedLoggerForJDKTest t = new UnnamedLoggerForJDKTest();
+        t.setup();
+        t.test();
+    }
+
+    private void setup() throws Throwable {
+        setupAllClient();
+
+        setupUnnamedLogger();
+    }
+
+    private void test() throws Throwable {
+        // logger client is in named module m.t.a
+        runTest(JDK_IMAGE,
+                "--class-path", DEST_UNNAMED_LOGGER.toString(),
+                "--module-path", DEST_NAMED_CLIENT.toString(),
+                "-m", CLIENT_A, "unnamed", LOGGER_B);
+        // logger client is also in unnamed module
+        runTest(JDK_IMAGE,
+                "--class-path", DEST_UNNAMED_LOGGER.toString()
+                    + File.pathSeparator + DEST_UNNAMED_CLIENT.toString(),
+                CLIENT_B, "unnamed", LOGGER_B);
+        // logger client gets logger through boot class BootUsage
+        runTest(JDK_IMAGE,
+                "--class-path", DEST_UNNAMED_LOGGER.toString()
+                    + File.pathSeparator + DEST_BOOT_CLIENT.toString(),
+                "-Xbootclasspath/a:" + DEST_BOOT_USAGE.toString(),
+                BOOT_CLIENT, "system", LAZY_LOGGER, LOGGER_B);
+        // logger client gets logger through patched class
+        // java.base/java.lang.PatchedUsage
+        runTest(JDK_IMAGE,
+                "--class-path", DEST_UNNAMED_LOGGER.toString()
+                    + File.pathSeparator + DEST_PATCHED_CLIENT.toString(),
+                "--patch-module", "java.base=" + DEST_PATCHED_USAGE.toString(),
+                PATCHED_CLIENT, "system", LAZY_LOGGER, LOGGER_B);
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/boot_client/BootClient.java b/jdk/test/java/lang/System/LoggerFinder/modules/boot_client/BootClient.java
new file mode 100644
index 0000000..b4cc85f
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/boot_client/BootClient.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.reflect.Method;
+import java.lang.System.Logger;
+import java.util.ResourceBundle;
+import java.util.ListResourceBundle;
+
+/*
+ * Tests when logger client is in Xbootclasspath
+ */
+public final class BootClient {
+
+    public static void main(String[] args) throws Exception {
+        assertTrue(args.length >= 2);
+        String loggerMode = args[0];
+        String loggerClassName = args[1];
+        String underlyingLoggerClassName = args.length >= 3 ? args[2] : null;
+
+        testLogger(loggerMode, loggerClassName, underlyingLoggerClassName);
+        testLog(underlyingLoggerClassName);
+    }
+
+    /*
+     * Tests System.getLogger(String) get expected logger.
+     */
+    private static void testLogger(String loggerMode, String loggerClassName,
+                                   String underlyingLoggerClassName) {
+        String name = "test.boot";
+        Logger logger = getLogger(name);
+        printLogger(logger);
+
+        final Module lm = logger.getClass().getModule();
+        final ClassLoader loggerCL = lm.getClassLoader();
+        if (loggerMode.equals("system")) {
+            assertTrue(lm.isNamed());
+            assertTrue(loggerCL == null);
+        } else if(loggerMode.equals("unnamed")) {
+            assertTrue(!lm.isNamed());
+            assertTrue(loggerCL != null);
+        } else {
+            throw new RuntimeException("wrong parameter");
+        }
+
+        assertTrue(loggerClassName.equals(logger.getClass().getName()));
+        if (underlyingLoggerClassName != null) {
+            String loggerName = logger.getName();
+            if (underlyingLoggerClassName.equals(
+                    "sun.util.logging.internal.LoggingProviderImpl$JULWrapper")) {
+                assertTrue(loggerName.equals(name));
+            } else {
+                assertTrue(loggerName.equals(underlyingLoggerClassName));
+            }
+        }
+    }
+
+    /*
+     * Tests Logger retrieved by System.getLogger(String, ResourceBundle) and
+     * System.getLogger(String) works well.
+     */
+    private static void testLog(String underlyingLoggerClassName) throws Exception {
+        if (underlyingLoggerClassName == null) {
+            return;
+        }
+
+        if (underlyingLoggerClassName.equals("pkg.a.l.LoggerA")
+                || underlyingLoggerClassName.equals("pkg.b.l.LoggerB")) {
+
+            String name = "test.boot.logger";
+            String plainMsg = "this is test log message #1";
+            ResourceBundle rb = new MyResourcesBoot();
+            Throwable ex = new Throwable("this is an expected exception to be logged");
+            Class<?> clazz = Class.forName(underlyingLoggerClassName);
+            Method method = clazz.getMethod("checkLog", String.class,
+                                            System.Logger.Level.class,
+                                            ResourceBundle.class, String.class,
+                                            Throwable.class, Object[].class);
+
+            Logger logger = getLogger(name);
+            printLogger(logger);
+            assertTrue(logger.getClass().getName()
+                             .equals("jdk.internal.logger.LazyLoggers$JdkLazyLogger"));
+            assertTrue(logger.getName().equals(underlyingLoggerClassName));
+            logger.log(Logger.Level.WARNING, plainMsg);
+            boolean pass = (boolean)method.invoke(null, name, Logger.Level.WARNING,
+                                                  null, plainMsg, ex, (Object)null);
+            assertTrue(pass);
+            pass = (boolean)method.invoke(null, name, Logger.Level.INFO,
+                                          rb, MyResourcesBoot.VALUE, (Throwable)null,
+                                          (Object)null);
+            assertTrue(!pass);
+
+            logger = getLogger(name, rb);
+            printLogger(logger);
+            assertTrue(logger.getClass().getName()
+                             .equals("jdk.internal.logger.LocalizedLoggerWrapper"));
+            assertTrue(logger.getName().equals(underlyingLoggerClassName));
+            logger.log(Logger.Level.INFO, MyResourcesBoot.KEY);
+            pass = (boolean)method.invoke(null, name, Logger.Level.INFO,
+                                          rb, MyResourcesBoot.VALUE, (Throwable)null,
+                                          (Object)null);
+            assertTrue(pass);
+            pass = (boolean)method.invoke(null, name, Logger.Level.WARNING,
+                                          null, plainMsg, ex, (Object)null);
+            assertTrue(pass);
+        }
+    }
+
+    private static class MyResourcesBoot extends ListResourceBundle {
+        static final String KEY = "this is the key in MyResourcesBoot";
+        static final String VALUE = "THIS IS THE VALUE IN MyResourcesBoot";
+
+        @Override
+        protected Object[][] getContents() {
+            return new Object[][] {
+                {KEY, VALUE}
+            };
+        }
+    }
+
+    private static Logger getLogger(String name) {
+        return BootUsage.getLogger(name);
+    }
+
+    private static Logger getLogger(String name, ResourceBundle rb) {
+        return BootUsage.getLogger(name, rb);
+    }
+
+    private static void printLogger(Logger logger) {
+        System.err.println("logger name: " + logger.getName()
+                           + ", logger class: " + logger.getClass());
+    }
+
+    private static void assertTrue(boolean b) {
+        if (!b) {
+            throw new RuntimeException("expected true, but get false.");
+        }
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/boot_usage/BootUsage.java b/jdk/test/java/lang/System/LoggerFinder/modules/boot_usage/BootUsage.java
new file mode 100644
index 0000000..c526cd9
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/boot_usage/BootUsage.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.System.Logger;
+import java.util.ResourceBundle;
+
+/*
+ * BootUsage is put to Xbootclasspath, it will be used by
+ * BootClient to test when logger client is in boot classpath
+ */
+public final class BootUsage {
+
+    public static Logger getLogger(String name) {
+        check();
+        return System.getLogger(name);
+    }
+
+    public static Logger getLogger(String name, ResourceBundle rb) {
+        check();
+        return System.getLogger(name, rb);
+    }
+
+    private static void check() {
+        final Module m = BootUsage.class.getModule();
+        final ClassLoader moduleCL = m.getClassLoader();
+        assertTrue(!m.isNamed());
+        assertTrue(moduleCL == null);
+    }
+
+    private static void assertTrue(boolean b) {
+        if (!b) {
+            throw new RuntimeException("expected true, but get false.");
+        }
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/named_client/m.t.a/module-info.java b/jdk/test/java/lang/System/LoggerFinder/modules/named_client/m.t.a/module-info.java
new file mode 100644
index 0000000..2e87616
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/named_client/m.t.a/module-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m.t.a {
+    exports pkg.a.t;
+    uses System.LoggerFinder;
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/named_client/m.t.a/pkg/a/t/TestA.java b/jdk/test/java/lang/System/LoggerFinder/modules/named_client/m.t.a/pkg/a/t/TestA.java
new file mode 100644
index 0000000..4e6e0d7
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/named_client/m.t.a/pkg/a/t/TestA.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg.a.t;
+
+import java.lang.reflect.Method;
+import java.lang.System.Logger;
+import java.util.ResourceBundle;
+import java.util.ListResourceBundle;
+
+/*
+ * Tests when logger client is in named module m.l.a
+ */
+public class TestA {
+
+    public static void main(String[] args) throws Exception {
+        assertTrue(args.length == 2);
+        String loggerMode = args[0];
+        String loggerClassName = args[1];
+
+        testLogger(loggerMode, loggerClassName);
+        testLog(loggerClassName);
+    }
+
+    /*
+     * Tests System.getLogger(String) get expected logger.
+     */
+    private static void testLogger(String loggerMode, String loggerClassName) {
+        final Module m = TestA.class.getModule();
+        final ClassLoader moduleCL = m.getClassLoader();
+        assertTrue(m.isNamed());
+        assertTrue(moduleCL != null);
+
+        String name = "test.a";
+        Logger logger = getLogger(name);
+        printLogger(logger);
+
+        final Module lm = logger.getClass().getModule();
+        final ClassLoader loggerCL = lm.getClassLoader();
+        if (loggerMode.equals("system")) {
+            assertTrue(lm.isNamed());
+            assertTrue(loggerCL == null);
+        } else if(loggerMode.equals("named")) {
+            assertTrue(lm.isNamed());
+            assertTrue(loggerCL != null);
+        } else if(loggerMode.equals("unnamed")) {
+            assertTrue(!lm.isNamed());
+            assertTrue(loggerCL != null);
+        } else {
+            throw new RuntimeException("wrong parameter");
+        }
+
+        assertTrue(loggerClassName.equals(logger.getClass().getName()));
+        assertTrue(!loggerClassName.equals("jdk.internal.logger.LazyLoggers$JdkLazyLogger"));
+    }
+
+    /*
+     * Tests Logger retrieved by System.getLogger(String, ResourceBundle) and
+     * System.getLogger(String) works well.
+     */
+    private static void testLog(String loggerClassName) throws Exception {
+        if (loggerClassName.equals("pkg.a.l.LoggerA")
+                || loggerClassName.equals("pkg.b.l.LoggerB")) {
+
+            String name = "test.a.A";
+            String plainMsg = "this is test log message #1";
+            ResourceBundle rb = new MyResourcesA();
+            Throwable ex = new Throwable("this is an expected exception to be logged");
+            Class<?> clazz = Class.forName(loggerClassName);
+            Method method = clazz.getMethod("checkLog", String.class,
+                                            System.Logger.Level.class,
+                                            ResourceBundle.class, String.class,
+                                            Throwable.class, Object[].class);
+
+            Logger logger = getLogger(name);
+            printLogger(logger);
+            assertTrue(logger.getClass().getName().equals(loggerClassName));
+            assertTrue(logger.getName().equals(loggerClassName));
+            logger.log(Logger.Level.WARNING, plainMsg);
+            boolean pass = (boolean)method.invoke(null, name,
+                                                  Logger.Level.WARNING,
+                                                  null, plainMsg, ex, (Object)null);
+            assertTrue(pass);
+            pass = (boolean)method.invoke(null, name, Logger.Level.INFO,
+                                          rb, MyResourcesA.VALUE, (Throwable)null,
+                                          (Object)null);
+            assertTrue(!pass);
+
+            logger = getLogger(name, rb);
+            printLogger(logger);
+            assertTrue(logger.getClass().getName()
+                             .equals("jdk.internal.logger.LocalizedLoggerWrapper"));
+            assertTrue(logger.getName().equals(loggerClassName));
+            logger.log(Logger.Level.INFO, MyResourcesA.KEY);
+            pass = (boolean)method.invoke(null, name, Logger.Level.INFO,
+                                          rb, MyResourcesA.VALUE, (Throwable)null,
+                                          (Object)null);
+            assertTrue(pass);
+            pass = (boolean)method.invoke(null, name, Logger.Level.WARNING,
+                                          null, plainMsg, ex, (Object)null);
+            assertTrue(pass);
+        }
+    }
+
+    private static class MyResourcesA extends ListResourceBundle {
+        static final String KEY = "this is the key in MyResourcesA";
+        static final String VALUE = "THIS IS THE VALUE IN MyResourcesA";
+
+        @Override
+        protected Object[][] getContents() {
+            return new Object[][] {
+                {KEY, VALUE}
+            };
+        }
+    }
+
+    private static Logger getLogger(String name) {
+        return System.getLogger(name);
+    }
+
+    private static Logger getLogger(String name, ResourceBundle rb) {
+        return System.getLogger(name, rb);
+    }
+
+    private static void printLogger(Logger logger) {
+        System.err.println("logger name: " + logger.getName()
+                           + ", logger class: " + logger.getClass());
+    }
+
+    private static void assertTrue(boolean b) {
+        if (!b) {
+            throw new RuntimeException("expected true, but get false.");
+        }
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/module-info.java b/jdk/test/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/module-info.java
new file mode 100644
index 0000000..bd4a54c
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/module-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m.l.a {
+    opens pkg.a.l;
+    provides java.lang.System.LoggerFinder with pkg.a.p.LoggerFinderA;
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/l/LoggerA.java b/jdk/test/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/l/LoggerA.java
new file mode 100644
index 0000000..8ab0f53
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/l/LoggerA.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg.a.l;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Queue;
+import java.util.ResourceBundle;
+
+public class LoggerA implements System.Logger {
+
+    // ---- test utility fields and methods ----
+
+    private static Map<String, LoggerA> map = new HashMap<>();
+
+    public static LoggerA getLogger(String name) {
+        return map.computeIfAbsent(name, (n) -> new LoggerA());
+    }
+
+    public static boolean checkLog(String name, Level level, ResourceBundle bundle,
+                                   String format, Throwable throwable, Object... params) {
+        LoggerA logger = map.get(name);
+        LogEvent event = new LogEvent(level, bundle, format, null, params);
+        for (LogEvent l : logger.queue) {
+            if (l.equals(event)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    // ---- logger implementation ----
+
+    private Queue<LogEvent> queue = new LinkedList<>();
+
+    @Override
+    public String getName() {
+        return this.getClass().getName();
+    }
+
+    @Override
+    public boolean isLoggable(Level level) {
+        return true;
+    }
+
+    @Override
+    public void log(Level level, ResourceBundle bundle, String format, Object... params) {
+        String msg = bundle != null ? bundle.getString(format) : format;
+        log(new LogEvent(level, bundle, msg, null, params));
+    }
+
+    @Override
+    public void log(Level level, ResourceBundle bundle, String format, Throwable throwable) {
+        String msg = bundle != null ? bundle.getString(format) : format;
+        log(new LogEvent(level, bundle, msg, throwable, (Object)null));
+    }
+
+    void log(LogEvent l) {
+        print(l);
+        queue.add(l);
+    }
+
+    private void print(LogEvent l) {
+        System.err.println("LoggerA Message"+ l);
+    }
+
+    public Queue<LogEvent> getLogEvent() {
+        return queue;
+    }
+
+    public static class LogEvent {
+        public LogEvent(Level level, ResourceBundle bundle, String format,
+                        Throwable throwable, Object... params) {
+            this.level = level;
+            this.bundle = bundle;
+            this.format = format;
+            this.throwable = throwable;
+            this.params = params;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o instanceof LogEvent) {
+                LogEvent e = (LogEvent)o;
+                return level == e.level
+                    && bundle == e.bundle
+                    && format == e.format
+                    && params == e.params;
+            }
+            return false;
+        }
+
+        @Override
+        public String toString() {
+            return String.format("[level: %s, bundle: %s, format: %s, throwable: %s, object: %s]",
+                    level, bundle, format, throwable, params);
+        }
+
+        private Level level;
+        private ResourceBundle bundle;
+        private String format;
+        private Throwable throwable;
+        private Object[] params;
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java b/jdk/test/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java
new file mode 100644
index 0000000..ddb3637
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/named_logger/m.l.a/pkg/a/p/LoggerFinderA.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg.a.p;
+
+import pkg.a.l.LoggerA;
+
+public class LoggerFinderA extends System.LoggerFinder {
+    @Override
+    public System.Logger getLogger(String name, Module module) {
+        return LoggerA.getLogger(name);
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/patched_client/PatchedClient.java b/jdk/test/java/lang/System/LoggerFinder/modules/patched_client/PatchedClient.java
new file mode 100644
index 0000000..922a2a8
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/patched_client/PatchedClient.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.reflect.Method;
+import java.lang.System.Logger;
+import java.util.ResourceBundle;
+import java.util.ListResourceBundle;
+
+/*
+ * Tests when logger client is in patched module
+ */
+public class PatchedClient {
+
+    public static void main(String[] args) throws Exception {
+        assertTrue(args.length >= 2);
+        String loggerMode = args[0];
+        String loggerClassName = args[1];
+        String underlyingLoggerClassName = args.length >= 3 ? args[2] : null;
+
+        testLogger(loggerMode, loggerClassName, underlyingLoggerClassName);
+        testLog(underlyingLoggerClassName);
+    }
+
+    /*
+     * Tests System.getLogger(String) get expected logger.
+     */
+    private static void testLogger(String loggerMode, String loggerClassName,
+                                   String underlyingLoggerClassName) {
+        String name = "test.patched";
+        Logger logger = getLogger(name);
+        printLogger(logger);
+
+        final Module lm = logger.getClass().getModule();
+        final ClassLoader loggerCL = lm.getClassLoader();
+        if (loggerMode.equals("system")) {
+            assertTrue(lm.isNamed());
+            assertTrue(loggerCL == null);
+        } else if(loggerMode.equals("unnamed")) {
+            assertTrue(!lm.isNamed());
+            assertTrue(loggerCL != null);
+        } else {
+            throw new RuntimeException("wrong parameter");
+        }
+
+        assertTrue(loggerClassName.equals(logger.getClass().getName()));
+        if (underlyingLoggerClassName != null) {
+            String loggerName = logger.getName();
+            if (underlyingLoggerClassName.equals(
+                    "sun.util.logging.internal.LoggingProviderImpl$JULWrapper")) {
+                assertTrue(loggerName.equals(name));
+            } else {
+                assertTrue(loggerName.equals(underlyingLoggerClassName));
+            }
+        }
+    }
+
+    /*
+     * Tests Logger retrieved by System.getLogger(String, ResourceBundle) and
+     * System.getLogger(String) works well.
+     */
+    private static void testLog(String underlyingLoggerClassName) throws Exception {
+        if (underlyingLoggerClassName == null) {
+            return;
+        }
+
+        if (underlyingLoggerClassName.equals("pkg.a.l.LoggerA")
+                || underlyingLoggerClassName.equals("pkg.b.l.LoggerB")) {
+
+            String name = "test.patched.logger";
+            String plainMsg = "this is test log message #1";
+            ResourceBundle rb = new MyResourcesPatched();
+            Throwable ex = new Throwable("this is an expected exception to be logged");
+            Class<?> clazz = Class.forName(underlyingLoggerClassName);
+            Method method = clazz.getMethod("checkLog", String.class,
+                                            System.Logger.Level.class,
+                                            ResourceBundle.class, String.class,
+                                            Throwable.class, Object[].class);
+
+            Logger logger = getLogger(name);
+            printLogger(logger);
+            assertTrue(logger.getClass().getName()
+                             .equals("jdk.internal.logger.LazyLoggers$JdkLazyLogger"));
+            assertTrue(logger.getName().equals(underlyingLoggerClassName));
+            logger.log(Logger.Level.WARNING, plainMsg);
+            boolean pass = (boolean)method.invoke(null, name, Logger.Level.WARNING,
+                                                  null, plainMsg, ex, (Object)null);
+            assertTrue(pass);
+            pass = (boolean)method.invoke(null, name, Logger.Level.INFO,
+                                          rb, MyResourcesPatched.VALUE, (Throwable)null,
+                                          (Object)null);
+            assertTrue(!pass);
+
+            logger = getLogger(name, rb);
+            printLogger(logger);
+            assertTrue(logger.getClass().getName()
+                             .equals("jdk.internal.logger.LocalizedLoggerWrapper"));
+            assertTrue(logger.getName().equals(underlyingLoggerClassName));
+            logger.log(Logger.Level.INFO, MyResourcesPatched.KEY);
+            pass = (boolean)method.invoke(null, name, Logger.Level.INFO,
+                                          rb, MyResourcesPatched.VALUE, (Throwable)null,
+                                          (Object)null);
+            assertTrue(pass);
+            pass = (boolean)method.invoke(null, name, Logger.Level.WARNING,
+                                          null, plainMsg, ex, (Object)null);
+            assertTrue(pass);
+        }
+    }
+
+    private static class MyResourcesPatched extends ListResourceBundle {
+        static final String KEY = "this is the key in MyResourcesPatched";
+        static final String VALUE = "THIS IS THE VALUE IN MyResourcesPatched";
+
+        @Override
+        protected Object[][] getContents() {
+            return new Object[][] {
+                {KEY, VALUE}
+            };
+        }
+    }
+
+    private static Logger getLogger(String name) {
+        return PatchedUsage.getLogger(name);
+    }
+
+    private static Logger getLogger(String name, ResourceBundle rb) {
+        return PatchedUsage.getLogger(name, rb);
+    }
+
+    private static void printLogger(Logger logger) {
+        System.err.println("logger name: " + logger.getName()
+                           + ", logger class: " + logger.getClass());
+    }
+
+    private static void assertTrue(boolean b) {
+        if (!b) {
+            throw new RuntimeException("expected true, but get false.");
+        }
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/patched_usage/java.base/java/lang/PatchedUsage.java b/jdk/test/java/lang/System/LoggerFinder/modules/patched_usage/java.base/java/lang/PatchedUsage.java
new file mode 100644
index 0000000..69bf3da
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/patched_usage/java.base/java/lang/PatchedUsage.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang;
+
+import java.lang.System.Logger;
+import java.util.ResourceBundle;
+
+/*
+ * PatchedUsage is patched into java.base, it will be used by
+ * PatchedClient to test when logger client is in patched module
+ */
+public class PatchedUsage {
+
+    public static Logger getLogger(String name) {
+        check();
+        return System.getLogger(name);
+    }
+
+    public static Logger getLogger(String name, ResourceBundle rb) {
+        check();
+        return System.getLogger(name, rb);
+    }
+
+    private static void check() {
+        final Module m = PatchedUsage.class.getModule();
+        final ClassLoader moduleCL = m.getClassLoader();
+        assertTrue(m.isNamed());
+        assertTrue(moduleCL == null);
+    }
+
+    private static void assertTrue(boolean b) {
+        if (!b) {
+            throw new RuntimeException("expected true, but get false.");
+        }
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java b/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java
new file mode 100644
index 0000000..8e5f0a6
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_client/pkg/b/t/TestB.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg.b.t;
+
+import java.lang.reflect.Method;
+import java.lang.System.Logger;
+import java.util.ResourceBundle;
+import java.util.ListResourceBundle;
+
+/*
+ * Tests when logger client is in unnamed module
+ */
+public class TestB {
+
+    public static void main(String[] args) throws Exception {
+        assertTrue(args.length == 2);
+        String loggerMode = args[0];
+        String loggerClassName = args[1];
+
+        testLogger(loggerMode, loggerClassName);
+        testLog(loggerClassName);
+    }
+
+    /*
+     * Tests System.getLogger(String) get expected logger.
+     */
+    private static void testLogger(String loggerMode, String loggerClassName) {
+        final Module m = TestB.class.getModule();
+        final ClassLoader moduleCL = m.getClassLoader();
+        assertTrue(!m.isNamed());
+        assertTrue(moduleCL != null);
+
+        String name = "test.b";
+        Logger logger = getLogger(name);
+        printLogger(logger);
+
+        final Module lm = logger.getClass().getModule();
+        final ClassLoader loggerCL = lm.getClassLoader();
+        if (loggerMode.equals("system")) {
+            assertTrue(lm.isNamed());
+            assertTrue(loggerCL == null);
+        } else if(loggerMode.equals("named")) {
+            assertTrue(lm.isNamed());
+            assertTrue(loggerCL != null);
+        } else if(loggerMode.equals("unnamed")) {
+            assertTrue(!lm.isNamed());
+            assertTrue(loggerCL != null);
+        } else {
+            throw new RuntimeException("wrong parameter");
+        }
+
+        assertTrue(loggerClassName.equals(logger.getClass().getName()));
+        assertTrue(!loggerClassName.equals("jdk.internal.logger.LazyLoggers$JdkLazyLogger"));
+    }
+
+    /*
+     * Tests Logger retrieved by System.getLogger(String, ResourceBundle) and
+     * System.getLogger(String) works well.
+     */
+    private static void testLog(String loggerClassName) throws Exception {
+        if (loggerClassName.equals("pkg.a.l.LoggerA")
+                || loggerClassName.equals("pkg.b.l.LoggerB")) {
+
+            String name = "test.b.B";
+            String plainMsg = "this is test log message #1";
+            ResourceBundle rb = new MyResourcesB();
+            Throwable ex = new Throwable("this is an expected exception to be logged");
+            Class<?> clazz = Class.forName(loggerClassName);
+            Method method = clazz.getMethod("checkLog", String.class,
+                                            System.Logger.Level.class,
+                                            ResourceBundle.class, String.class,
+                                            Throwable.class, Object[].class);
+
+            Logger logger = getLogger(name);
+            printLogger(logger);
+            assertTrue(logger.getClass().getName().equals(loggerClassName));
+            assertTrue(logger.getName().equals(loggerClassName));
+            logger.log(Logger.Level.WARNING, plainMsg);
+            boolean pass = (boolean)method.invoke(null, name, Logger.Level.WARNING,
+                                                  null, plainMsg, ex, (Object)null);
+            assertTrue(pass);
+            pass = (boolean)method.invoke(null, name, Logger.Level.INFO,
+                                          rb, MyResourcesB.VALUE, (Throwable)null,
+                                          (Object)null);
+            assertTrue(!pass);
+
+            logger = getLogger(name, rb);
+            printLogger(logger);
+            assertTrue(logger.getClass().getName()
+                             .equals("jdk.internal.logger.LocalizedLoggerWrapper"));
+            assertTrue(logger.getName().equals(loggerClassName));
+            logger.log(Logger.Level.INFO, MyResourcesB.KEY);
+            pass = (boolean)method.invoke(null, name, Logger.Level.INFO,
+                                          rb, MyResourcesB.VALUE, (Throwable)null,
+                                          (Object)null);
+            assertTrue(pass);
+            pass = (boolean)method.invoke(null, name, Logger.Level.WARNING,
+                                          null, plainMsg, ex, (Object)null);
+            assertTrue(pass);
+        }
+    }
+
+    private static class MyResourcesB extends ListResourceBundle {
+        static final String KEY = "this is the key in MyResourcesB";
+        static final String VALUE = "THIS IS THE VALUE IN MyResourcesB";
+
+        @Override
+        protected Object[][] getContents() {
+            return new Object[][] {
+                {KEY, VALUE}
+            };
+        }
+    }
+
+    private static Logger getLogger(String name) {
+        return System.getLogger(name);
+    }
+
+    private static Logger getLogger(String name, ResourceBundle rb) {
+        return System.getLogger(name, rb);
+    }
+
+    private static void printLogger(Logger logger) {
+        System.err.println("logger name: " + logger.getName()
+                           + ", logger class: " + logger.getClass());
+    }
+
+    private static void assertTrue(boolean b) {
+        if (!b) {
+            throw new RuntimeException("expected true, but get false.");
+        }
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_logger/META-INF/services/java.lang.System$LoggerFinder b/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_logger/META-INF/services/java.lang.System$LoggerFinder
new file mode 100644
index 0000000..023bf95
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_logger/META-INF/services/java.lang.System$LoggerFinder
@@ -0,0 +1 @@
+pkg.b.p.LoggerFinderB
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java b/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java
new file mode 100644
index 0000000..be29986
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/l/LoggerB.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg.b.l;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Queue;
+import java.util.ResourceBundle;
+
+public class LoggerB implements System.Logger {
+
+    // ---- test utility fields and methods ----
+
+    private static Map<String, LoggerB> map = new HashMap<>();
+
+    public static LoggerB getLogger(String name) {
+        return map.computeIfAbsent(name, (n) -> new LoggerB());
+    }
+
+    public static boolean checkLog(String name, Level level, ResourceBundle bundle,
+                                   String format, Throwable throwable, Object... params) {
+        LoggerB logger = map.get(name);
+        LogEvent event = new LogEvent(level, bundle, format, null, params);
+        for (LogEvent l : logger.queue) {
+            if (l.equals(event)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    // ---- logger implementation ----
+
+    private Queue<LogEvent> queue = new LinkedList<>();
+
+    @Override
+    public String getName() {
+        return this.getClass().getName();
+    }
+
+    @Override
+    public boolean isLoggable(Level level) {
+        return true;
+    }
+
+    @Override
+    public void log(Level level, ResourceBundle bundle, String format, Object... params) {
+        String msg = bundle != null ? bundle.getString(format) : format;
+        log(new LogEvent(level, bundle, msg, null, params));
+    }
+
+    @Override
+    public void log(Level level, ResourceBundle bundle, String format, Throwable throwable) {
+        String msg = bundle != null ? bundle.getString(format) : format;
+        log(new LogEvent(level, bundle, msg, throwable, (Object)null));
+    }
+
+    void log(LogEvent l) {
+        print(l);
+        queue.add(l);
+    }
+
+    private void print(LogEvent l) {
+        System.err.println("LoggerB Message"+ l);
+    }
+
+    public Queue<LogEvent> getLogEvent() {
+        return queue;
+    }
+
+    public static class LogEvent {
+        public LogEvent(Level level, ResourceBundle bundle, String format,
+                        Throwable throwable, Object... params) {
+            this.level = level;
+            this.bundle = bundle;
+            this.format = format;
+            this.throwable = throwable;
+            this.params = params;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o instanceof LogEvent) {
+                LogEvent e = (LogEvent)o;
+                return level == e.level
+                    && bundle == e.bundle
+                    && format == e.format
+                    && params == e.params;
+            }
+            return false;
+        }
+
+        private Level level;
+        private ResourceBundle bundle;
+        private String format;
+        private Throwable throwable;
+        private Object[] params;
+    }
+}
diff --git a/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/p/LoggerFinderB.java b/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/p/LoggerFinderB.java
new file mode 100644
index 0000000..376bb64
--- /dev/null
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/unnamed_logger/pkg/b/p/LoggerFinderB.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg.b.p;
+
+import pkg.b.l.LoggerB;
+
+public class LoggerFinderB extends System.LoggerFinder {
+    @Override
+    public System.Logger getLogger(String name, Module module) {
+        return LoggerB.getLogger(name);
+    }
+}
diff --git a/jdk/test/java/lang/WeakPairMap/Driver.java b/jdk/test/java/lang/WeakPairMap/Driver.java
new file mode 100644
index 0000000..4009561
--- /dev/null
+++ b/jdk/test/java/lang/WeakPairMap/Driver.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8888888
+ * @summary Functional test for WeakPairMap
+ * @build java.base/java.lang.WeakPairMapTest
+ * @run main Driver
+ */
+public class Driver {
+    public static void main(String[] args) {
+        java.lang.WeakPairMapTest.main(args);
+    }
+}
diff --git a/jdk/test/java/lang/WeakPairMap/java.base/java/lang/WeakPairMapTest.java b/jdk/test/java/lang/WeakPairMap/java.base/java/lang/WeakPairMapTest.java
new file mode 100644
index 0000000..6267d53
--- /dev/null
+++ b/jdk/test/java/lang/WeakPairMap/java.base/java/lang/WeakPairMapTest.java
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang;
+
+import java.lang.ref.Reference;
+import java.util.Objects;
+
+/**
+ * Functional test for WeakPairMap
+ *
+ * @author Peter Levart
+ */
+public class WeakPairMapTest {
+    public static void main(String[] args) {
+        WeakPairMap<Object, Object, String> pm = new WeakPairMap<>();
+        Object key1 = new Object();
+        Object key2 = new Object();
+
+        // check for emptiness
+        assertEquals(pm.containsKeyPair(key1, key2), false);
+        assertEquals(pm.get(key1, key2), null);
+
+        // check for NPE(s)
+        for (Object k1 : new Object[]{null, key1}) {
+            for (Object k2 : new Object[]{null, key2}) {
+                for (String v : new String[]{null, "abc"}) {
+
+                    if (k1 != null && k2 != null && v != null) {
+                        // skip non-null args
+                        continue;
+                    }
+
+                    try {
+                        pm.put(k1, k2, v);
+                        throw new AssertionError("Unexpected code path, k1=" +
+                                                 k1 + ", k2=" + k2 + ", v=" + v);
+                    } catch (NullPointerException e) {
+                        // expected
+                    }
+
+                    try {
+                        pm.putIfAbsent(k1, k2, v);
+                        throw new AssertionError("Unexpected code path, k1=" +
+                                                 k1 + ", k2=" + k2 + ", v=" + v);
+                    } catch (NullPointerException e) {
+                        // expected
+                    }
+
+                    if (k1 != null && k2 != null) {
+                        // skip non-null args
+                        continue;
+                    }
+
+                    try {
+                        pm.computeIfAbsent(k1, k2, (_k1, _k2) -> v);
+                        throw new AssertionError("Unexpected code path, k1=" +
+                                                 k1 + ", k2=" + k2 + ", v=" + v);
+                    } catch (NullPointerException e) {
+                        // expected
+                    }
+
+                    try {
+                        pm.containsKeyPair(k1, k2);
+                        throw new AssertionError("Unexpected code path, k1=" +
+                                                 k1 + ", k2=" + k2);
+                    } catch (NullPointerException e) {
+                        // expected
+                    }
+
+                    try {
+                        pm.get(k1, k2);
+                        throw new AssertionError("Unexpected code path, k1=" +
+                                                 k1 + ", k2=" + k2);
+                    } catch (NullPointerException e) {
+                        // expected
+                    }
+                }
+            }
+        }
+
+        // how much to wait when it is expected for entry to be retained
+        final long retentionTimeout = 500L;
+        // how much to wait when it is expected for entry to be removed
+        final long cleanupTimeout = 30_000L;
+
+        // check insertion
+        assertEquals(pm.putIfAbsent(key1, key2, "abc"), null);
+        assertEquals(pm.get(key1, key2), "abc");
+
+        // check retention while both keys are still reachable
+        assertEquals(gcAndWaitRemoved(pm, "abc", retentionTimeout), false);
+        assertEquals(pm.get(key1, key2), "abc");
+
+        // check cleanup when both keys are unreachable
+        key1 = null;
+        key2 = null;
+        assertEquals(gcAndWaitRemoved(pm, "abc", cleanupTimeout), true);
+
+        // new insertion
+        key1 = new Object();
+        key2 = new Object();
+        assertEquals(pm.putIfAbsent(key1, key2, "abc"), null);
+        assertEquals(pm.get(key1, key2), "abc");
+
+        // check retention while both keys are still reachable
+        assertEquals(gcAndWaitRemoved(pm, "abc", retentionTimeout), false);
+        assertEquals(pm.get(key1, key2), "abc");
+
+        // check cleanup when 1st key is unreachable
+        key1 = null;
+        assertEquals(gcAndWaitRemoved(pm, "abc", cleanupTimeout), true);
+        Reference.reachabilityFence(key2);
+
+        // new insertion
+        key1 = new Object();
+        key2 = new Object();
+        assertEquals(pm.putIfAbsent(key1, key2, "abc"), null);
+        assertEquals(pm.get(key1, key2), "abc");
+
+        // check retention while both keys are still reachable
+        assertEquals(gcAndWaitRemoved(pm, "abc", retentionTimeout), false);
+        assertEquals(pm.get(key1, key2), "abc");
+
+        // check cleanup when 2nd key is unreachable
+        key2 = null;
+        assertEquals(gcAndWaitRemoved(pm, "abc", cleanupTimeout), true);
+        Reference.reachabilityFence(key1);
+    }
+
+    /**
+     * Trigger GC and wait for at most {@code millis} ms for given value to
+     * be removed from given WeakPairMap.
+     *
+     * @return true if element has been removed or false if not
+     */
+    static <V> boolean gcAndWaitRemoved(WeakPairMap<?, ?, V> pm, V value,
+                                        long millis) {
+        System.gc();
+        for (int i = 0; i < (millis + 99) / 100 && pm.values().contains(value); i++) {
+            try {
+                Thread.sleep(100L);
+            } catch (InterruptedException e) {
+                throw new AssertionError("Interrupted");
+            }
+        }
+        return !pm.values().contains(value);
+    }
+
+    static void assertEquals(Object actual, Object expected) {
+        if (!Objects.equals(actual, expected)) {
+            throw new AssertionError("Expected: " + expected + ", actual: " + actual);
+        }
+    }
+}
diff --git a/jdk/test/java/lang/instrument/ATransformerManagementTestCase.java b/jdk/test/java/lang/instrument/ATransformerManagementTestCase.java
index 5f88d3c..00f3447 100644
--- a/jdk/test/java/lang/instrument/ATransformerManagementTestCase.java
+++ b/jdk/test/java/lang/instrument/ATransformerManagementTestCase.java
@@ -24,8 +24,6 @@
 
 import java.io.*;
 import java.lang.instrument.*;
-
-import java.lang.reflect.Module;
 import java.security.ProtectionDomain;
 import java.util.*;
 
diff --git a/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java b/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java
index 96d02bfa..6b0c71a 100644
--- a/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java
+++ b/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java
@@ -26,7 +26,6 @@
 import java.io.*;
 import java.lang.instrument.ClassFileTransformer;
 import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Module;
 import java.security.ProtectionDomain;
 
 public class BootstrapClassPathAgent {
diff --git a/jdk/test/java/lang/instrument/BootstrapClassPathTest.java b/jdk/test/java/lang/instrument/BootstrapClassPathTest.java
index bee8602..9f60090 100644
--- a/jdk/test/java/lang/instrument/BootstrapClassPathTest.java
+++ b/jdk/test/java/lang/instrument/BootstrapClassPathTest.java
@@ -33,7 +33,6 @@
 
 import java.io.*;
 import java.lang.instrument.*;
-import java.lang.reflect.Module;
 import java.security.ProtectionDomain;
 
 public class BootstrapClassPathTest {
diff --git a/jdk/test/java/lang/instrument/RedefineClassWithNativeMethodAgent.java b/jdk/test/java/lang/instrument/RedefineClassWithNativeMethodAgent.java
index b114671..704b85b 100644
--- a/jdk/test/java/lang/instrument/RedefineClassWithNativeMethodAgent.java
+++ b/jdk/test/java/lang/instrument/RedefineClassWithNativeMethodAgent.java
@@ -24,7 +24,6 @@
 import java.io.InputStream;
 import java.lang.instrument.ClassDefinition;
 import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Module;
 import java.util.Timer;
 import java.util.TimerTask;
 
diff --git a/jdk/test/java/lang/instrument/RedefineModuleAgent.java b/jdk/test/java/lang/instrument/RedefineModuleAgent.java
index 8d96db1..aa38d6b 100644
--- a/jdk/test/java/lang/instrument/RedefineModuleAgent.java
+++ b/jdk/test/java/lang/instrument/RedefineModuleAgent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  */
 
 import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Module;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -47,4 +46,8 @@
                                Map<Class<?>, List<Class<?>>> extraProvides) {
         inst.redefineModule(module, extraReads, extraExports, extraOpens, extraUses, extraProvides);
     }
+
+    static boolean isModifiableModule(Module module) {
+        return inst.isModifiableModule(module);
+    }
 }
diff --git a/jdk/test/java/lang/instrument/RedefineModuleTest.java b/jdk/test/java/lang/instrument/RedefineModuleTest.java
index bf54daf..60ae18f 100644
--- a/jdk/test/java/lang/instrument/RedefineModuleTest.java
+++ b/jdk/test/java/lang/instrument/RedefineModuleTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /**
  * @test
  * @summary Basic test for redefineModule
- * @modules java.instrument
+ *
  * @build java.base/java.lang.TestProvider
  *        java.base/jdk.internal.test.TestProviderImpl1
  *        java.base/jdk.internal.test.TestProviderImpl2
@@ -34,8 +34,6 @@
 
 import java.lang.TestProvider;
 import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.net.URLStreamHandler;
 import java.net.spi.URLStreamHandlerProvider;
 import java.nio.file.FileSystems;
@@ -68,6 +66,10 @@
                                            extraProvides);
     }
 
+    static boolean isModifiableModule(Module module) {
+        return RedefineModuleAgent.isModifiableModule(module);
+    }
+
 
     /**
      * Use redefineModule to update java.base to read java.instrument
@@ -138,13 +140,13 @@
         // pre-conditions
         assertFalse(baseModule.canUse(service));
         assertTrue(collect(ServiceLoader.load(service)).isEmpty());
-        assertTrue(collect(ServiceLoader.load(Layer.boot(), service)).isEmpty());
+        assertTrue(collect(ServiceLoader.load(ModuleLayer.boot(), service)).isEmpty());
 
         // update java.base to use TestProvider
         redefineModule(baseModule, Set.of(), Map.of(), Map.of(), Set.of(service), Map.of());
         assertTrue(baseModule.canUse(service));
         assertTrue(collect(ServiceLoader.load(service)).isEmpty());
-        assertTrue(collect(ServiceLoader.load(Layer.boot(), service)).isEmpty());
+        assertTrue(collect(ServiceLoader.load(ModuleLayer.boot(), service)).isEmpty());
 
         // update java.base to provide an implementation of TestProvider
         Class<?> type1 = Class.forName("jdk.internal.test.TestProviderImpl1");
@@ -162,7 +164,7 @@
         assertTrue(containsInstanceOf(collect(providers), type1));
 
         // use ServiceLoader to load implementations in the boot layer
-        providers = collect(ServiceLoader.load(Layer.boot(), service));
+        providers = collect(ServiceLoader.load(ModuleLayer.boot(), service));
         assertTrue(collect(providers).size() == 1);
         assertTrue(containsInstanceOf(collect(providers), type1));
 
@@ -184,7 +186,7 @@
         assertTrue(containsInstanceOf(providers, type2));
 
         // use ServiceLoader to load implementations in the boot layer
-        providers = collect(ServiceLoader.load(Layer.boot(), service));
+        providers = collect(ServiceLoader.load(ModuleLayer.boot(), service));
         assertTrue(collect(providers).size() == 2);
         assertTrue(containsInstanceOf(providers, type1));
         assertTrue(containsInstanceOf(providers, type2));
@@ -279,6 +281,19 @@
     }
 
     /**
+     * Exercise IsModifiableModule
+     */
+    @Test
+    public void testIsModifiableModule() {
+        ClassLoader pcl = ClassLoader.getPlatformClassLoader();
+        ClassLoader scl = ClassLoader.getSystemClassLoader();
+        assertTrue(isModifiableModule(pcl.getUnnamedModule()));
+        assertTrue(isModifiableModule(scl.getUnnamedModule()));
+        assertTrue(isModifiableModule(RedefineModuleTest.class.getModule()));
+        assertTrue(isModifiableModule(Object.class.getModule()));
+    }
+
+    /**
      * Test redefineClass with null
      */
     public void testNulls() {
diff --git a/jdk/test/java/lang/instrument/RetransformAgent.java b/jdk/test/java/lang/instrument/RetransformAgent.java
index cdba17e..698449c 100644
--- a/jdk/test/java/lang/instrument/RetransformAgent.java
+++ b/jdk/test/java/lang/instrument/RetransformAgent.java
@@ -34,7 +34,6 @@
  */
 
 import java.lang.instrument.*;
-import java.lang.reflect.Module;
 import java.security.ProtectionDomain;
 import java.io.*;
 import asmlib.*;
diff --git a/jdk/test/java/lang/instrument/SimpleIdentityTransformer.java b/jdk/test/java/lang/instrument/SimpleIdentityTransformer.java
index 78e05fc..f25e679 100644
--- a/jdk/test/java/lang/instrument/SimpleIdentityTransformer.java
+++ b/jdk/test/java/lang/instrument/SimpleIdentityTransformer.java
@@ -24,7 +24,6 @@
 import java.lang.instrument.Instrumentation;
 import java.lang.instrument.ClassFileTransformer;
 
-import java.lang.reflect.Module;
 import java.security.*;
 
 /*
diff --git a/jdk/test/java/lang/instrument/TestAgentWithLimitMods.java b/jdk/test/java/lang/instrument/TestAgentWithLimitMods.java
index 4cdbeb6..ddf51b5 100644
--- a/jdk/test/java/lang/instrument/TestAgentWithLimitMods.java
+++ b/jdk/test/java/lang/instrument/TestAgentWithLimitMods.java
@@ -26,7 +26,7 @@
  * @test
  * @summary Tests that the -javaagent option adds the java.instrument into
  * the module graph
- * @modules java.instrument
+ *
  * @run shell MakeJAR3.sh SimpleAgent
  * @run main/othervm -javaagent:SimpleAgent.jar --limit-modules java.base TestAgentWithLimitMods
  *
diff --git a/jdk/test/java/lang/invoke/AccessControlTest.java b/jdk/test/java/lang/invoke/AccessControlTest.java
index 57cec50..616ba79 100644
--- a/jdk/test/java/lang/invoke/AccessControlTest.java
+++ b/jdk/test/java/lang/invoke/AccessControlTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -118,6 +118,8 @@
                 suffix = "/noaccess";
             else if (lookupModes == PUBLIC)
                 suffix = "/public";
+             else if (lookupModes == (PUBLIC|UNCONDITIONAL))
+                suffix = "/publicLookup";
             else if (lookupModes == (PUBLIC|MODULE))
                 suffix = "/module";
             else if (lookupModes == (PUBLIC|MODULE|PACKAGE))
@@ -140,23 +142,24 @@
          * [A2] However, the resulting {@code Lookup} object is guaranteed
          * to have no more access capabilities than the original.
          * In particular, access capabilities can be lost as follows:<ul>
-         * <li>[A3] If the new lookup class differs from the old one,
-         * protected members will not be accessible by virtue of inheritance.
+         * <li> [A3] If the old lookup class is in a named module, and the new
+         * lookup class is in a different module {@code M}, then no members, not
+         * even public members in {@code M}'s exported packages, will be accessible.
+         * The exception to this is when this lookup is publicLookup, in which case
+         * public access is not lost.
+         * <li> [A4] If the old lookup class is in an unnamed module, and the new
+         * lookup class is a different module then module access is lost.
+         * <li> [A5] If the new lookup class differs from the old one then UNCONDITIONAL
+         * is lost. If the new lookup class is not within the same package member as the
+         * old one, protected members will not be accessible by virtue of inheritance.
          * (Protected members may continue to be accessible because of package sharing.)
-         * <li>[A4] If the new lookup class is in a different package
-         * than the old one, protected and default (package) members will not be accessible.
-         * <li>[A5] If the new lookup class is not within the same package member
+         * <li> [A6] If the new lookup class is in a different package than the old one,
+         * protected and default (package) members will not be accessible.
+         * <li> [A7] If the new lookup class is not within the same package member
          * as the old one, private members will not be accessible.
-         * <li>[A6] If the new lookup class is not accessible to the old lookup class,
-         * using the original access modes,
+         * <li> [A8] If the new lookup class is not accessible to the old lookup class,
          * then no members, not even public members, will be accessible.
-         * <li>[A7] If the new lookup class for this {@code Lookup} is in the unnamed module,
-         * and the new lookup class is in a named module {@code M}, then no members in
-         * {@code M}'s non-exported packages will be accessible.
-         * <li>[A8] If the lookup for this {@code Lookup} is in a named module, and the
-         * new lookup class is in a different module, then no members, not even
-         * public members in {@code M}'s exported packages, will be accessible.
-         * [A8] (In all other cases, public members will continue to be accessible.)
+         * <li> [A9] (In all other cases, public members will continue to be accessible.)
          * </ul>
          * Other than the above cases, the new lookup will have the same
          * access capabilities as the original. [A10]
@@ -171,36 +174,35 @@
             boolean sameModule = (c1.getModule() == c2.getModule()) ||
                                  (!c1.getModule().isNamed() && !c2.getModule().isNamed());
             boolean samePackage = (c1.getClassLoader() == c2.getClassLoader() &&
-                                   packagePrefix(c1).equals(packagePrefix(c2)));
+                                   c1.getPackageName().equals(c2.getPackageName()));
             boolean sameTopLevel = (topLevelClass(c1) == topLevelClass(c2));
             boolean sameClass = (c1 == c2);
             assert(samePackage  || !sameTopLevel);
             assert(sameTopLevel || !sameClass);
-            boolean accessible = sameClass;  // [A6]
+            boolean accessible = sameClass;
             if ((m1 & PACKAGE) != 0)  accessible |= samePackage;
             if ((m1 & PUBLIC ) != 0)  accessible |= (c2.getModifiers() & PUBLIC) != 0;
             if (!sameModule) {
-                if (c1.getModule().isNamed()) {
-                    accessible = false;  // [A8]
+                if (c1.getModule().isNamed() && (m1 & UNCONDITIONAL) == 0) {
+                    accessible = false;  // [A3]
                 } else {
-                    // Different module; loose MODULE and lower access.
-                    changed |= (MODULE|PACKAGE|PRIVATE|PROTECTED);  // [A7]
+                    changed |= (MODULE|PACKAGE|PRIVATE|PROTECTED);    // [A3] [A4]
                 }
             }
             if (!accessible) {
                 // Different package and no access to c2; lose all access.
-                changed |= (PUBLIC|MODULE|PACKAGE|PRIVATE|PROTECTED);  // [A6]
+                changed |= (PUBLIC|MODULE|PACKAGE|PRIVATE|PROTECTED);  // [A8]
             }
             if (!samePackage) {
                 // Different package; loose PACKAGE and lower access.
-                changed |= (PACKAGE|PRIVATE|PROTECTED);  // [A4]
+                changed |= (PACKAGE|PRIVATE|PROTECTED);  // [A6]
             }
             if (!sameTopLevel) {
-                // Different top-level class.  Lose PRIVATE and lower access.
-                changed |= (PRIVATE|PROTECTED);  // [A5]
+                // Different top-level class.  Lose PRIVATE and PROTECTED access.
+                changed |= (PRIVATE|PROTECTED);  // [A5] [A7]
             }
             if (!sameClass) {
-                changed |= (PROTECTED);     // [A3]
+                changed |= (UNCONDITIONAL);     // [A5]
             } else {
                 assert(changed == 0);       // [A10] (no deprivation if same class)
             }
@@ -228,11 +230,10 @@
             Class<?> c1 = lookupClass();
             Class<?> c2 = m.getDeclaringClass();
 
-            // if the lookup class is in a loose module with PUBLIC access then
-            // public members of public types in all unnamed modules can be accessed
-            if (isLooseModule(c1.getModule())
+            // publicLookup has access to all public types/members of types in unnamed modules
+            if ((lookupModes & UNCONDITIONAL) != 0
                 && (lookupModes & PUBLIC) != 0
-                && (!c2.getModule().isNamed())
+                && !c2.getModule().isNamed()
                 && Modifier.isPublic(c2.getModifiers())
                 && Modifier.isPublic(m.getModifiers()))
                 return true;
@@ -261,17 +262,12 @@
             if (load && c2.getClassLoader() != null) {
                 if (c1.getClassLoader() == null) {
                     // not visible
-                return false;
-            }
-                if (c1 == publicLookup().lookupClass()) {
-                    // not visible as lookup class is defined by child of the boot loader
                     return false;
                 }
             }
 
-            // if the lookup class is in a loose module with PUBLIC access then
-            // public types in all unnamed modules can be accessed
-            if (isLooseModule(c1.getModule())
+            // publicLookup has access to all public types/members of types in unnamed modules
+            if ((lookupModes & UNCONDITIONAL) != 0
                 && (lookupModes & PUBLIC) != 0
                 && (!c2.getModule().isNamed())
                 && Modifier.isPublic(c2.getModifiers()))
@@ -295,11 +291,6 @@
             }
             return r;
         }
-
-        private boolean isLooseModule(Module m) {
-            ClassLoader cl = new ClassLoader() { };
-            return m.canRead(cl.getUnnamedModule());
-        }
     }
 
     private static Class<?> topLevelClass(Class<?> cls) {
@@ -311,14 +302,6 @@
         return c;
     }
 
-    private static String packagePrefix(Class<?> c) {
-        while (c.isArray())  c = c.getComponentType();
-        String s = c.getName();
-        assert(s.indexOf('/') < 0);
-        return s.substring(0, s.lastIndexOf('.')+1);
-    }
-
-
     private final TreeSet<LookupCase> CASES = new TreeSet<>();
     private final TreeMap<LookupCase,TreeSet<LookupCase>> CASE_EDGES = new TreeMap<>();
     private final ArrayList<ClassLoader> LOADERS = new ArrayList<>();
diff --git a/jdk/test/java/lang/invoke/DefineClassTest.java b/jdk/test/java/lang/invoke/DefineClassTest.java
new file mode 100644
index 0000000..456eaf6
--- /dev/null
+++ b/jdk/test/java/lang/invoke/DefineClassTest.java
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @modules java.base/java.lang:open
+ *          java.base/jdk.internal.org.objectweb.asm
+ * @run testng/othervm test.DefineClassTest
+ * @summary Basic test for java.lang.invoke.MethodHandles.Lookup.defineClass
+ */
+
+package test;
+
+import java.lang.invoke.MethodHandles.Lookup;
+import static java.lang.invoke.MethodHandles.*;
+import static java.lang.invoke.MethodHandles.Lookup.*;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+public class DefineClassTest {
+    private static final String THIS_PACKAGE = DefineClassTest.class.getPackageName();
+
+    /**
+     * Test that a class has the same class loader, and is in the same package and
+     * protection domain, as a lookup class.
+     */
+    void testSameAbode(Class<?> clazz, Class<?> lc) {
+        assertTrue(clazz.getClassLoader() == lc.getClassLoader());
+        assertEquals(clazz.getPackageName(), lc.getPackageName());
+        assertTrue(clazz.getProtectionDomain() == lc.getProtectionDomain());
+    }
+
+    /**
+     * Tests that a class is discoverable by name using Class.forName and
+     * lookup.findClass
+     */
+    void testDiscoverable(Class<?> clazz, Lookup lookup) throws Exception {
+        String cn = clazz.getName();
+        ClassLoader loader = clazz.getClassLoader();
+        assertTrue(Class.forName(cn, false, loader) == clazz);
+        assertTrue(lookup.findClass(cn) == clazz);
+    }
+
+    /**
+     * Basic test of defineClass to define a class in the same package as test.
+     */
+    @Test
+    public void testDefineClass() throws Exception {
+        final String CLASS_NAME = THIS_PACKAGE + ".Foo";
+        Lookup lookup = lookup().dropLookupMode(PRIVATE);
+        Class<?> clazz = lookup.defineClass(generateClass(CLASS_NAME));
+
+        // test name
+        assertEquals(clazz.getName(), CLASS_NAME);
+
+        // test loader/package/protection-domain
+        testSameAbode(clazz, lookup.lookupClass());
+
+        // test discoverable
+        testDiscoverable(clazz, lookup);
+
+        // attempt defineClass again
+        try {
+            lookup.defineClass(generateClass(CLASS_NAME));
+            assertTrue(false);
+        } catch (LinkageError expected) { }
+    }
+
+    /**
+     * Test public/package/protected/private access from class defined with defineClass.
+     */
+    @Test
+    public void testAccess() throws Exception {
+        final String THIS_CLASS = this.getClass().getName();
+        final String CLASS_NAME = THIS_PACKAGE + ".Runner";
+        Lookup lookup = lookup().dropLookupMode(PRIVATE);
+
+        // public
+        byte[] classBytes = generateRunner(CLASS_NAME + nextNumber(), THIS_CLASS, "method1");
+        testInvoke(lookup.defineClass(classBytes));
+
+        // package
+        classBytes = generateRunner(CLASS_NAME + nextNumber(), THIS_CLASS, "method2");
+        testInvoke(lookup.defineClass(classBytes));
+
+        // protected (same package)
+        classBytes = generateRunner(CLASS_NAME + nextNumber(), THIS_CLASS, "method3");
+        testInvoke(lookup.defineClass(classBytes));
+
+        // private
+        classBytes = generateRunner(CLASS_NAME + nextNumber(), THIS_CLASS, "method4");
+        Class<?> clazz = lookup.defineClass(classBytes);
+        Runnable r = (Runnable) clazz.newInstance();
+        try {
+            r.run();
+            assertTrue(false);
+        } catch (IllegalAccessError expected) { }
+    }
+
+    public static void method1() { }
+    static void method2() { }
+    protected static void method3() { }
+    private static void method4() { }
+
+    void testInvoke(Class<?> clazz) throws Exception {
+        Object obj = clazz.newInstance();
+        ((Runnable) obj).run();
+    }
+
+    /**
+     * Test that defineClass does not run the class initializer
+     */
+    @Test
+    public void testInitializerNotRun() throws Exception {
+        final String THIS_CLASS = this.getClass().getName();
+        final String CLASS_NAME = THIS_PACKAGE + ".ClassWithClinit";
+
+        byte[] classBytes = generateClassWithInitializer(CLASS_NAME, THIS_CLASS, "fail");
+        Lookup lookup = lookup().dropLookupMode(PRIVATE);
+
+        Class<?> clazz = lookup.defineClass(classBytes);
+        // trigger initializer to run
+        try {
+            clazz.newInstance();
+            assertTrue(false);
+        } catch (ExceptionInInitializerError e) {
+            assertTrue(e.getCause() instanceof IllegalCallerException);
+        }
+    }
+
+    static void fail() { throw new IllegalCallerException(); }
+
+
+    /**
+     * Test defineClass to define classes in a package containing classes with
+     * different protection domains.
+     */
+    @Test
+    public void testTwoProtectionDomains() throws Exception {
+        // p.C1 in one exploded directory
+        Path dir1 = Files.createTempDirectory("classes");
+        Path p = Files.createDirectory(dir1.resolve("p"));
+        Files.write(p.resolve("C1.class"), generateClass("p.C1"));
+        URL url1 = dir1.toUri().toURL();
+
+        // p.C2 in another exploded directory
+        Path dir2 = Files.createTempDirectory("classes");
+        p = Files.createDirectory(dir2.resolve("p"));
+        Files.write(p.resolve("C2.class"), generateClass("p.C2"));
+        URL url2 = dir2.toUri().toURL();
+
+        // load p.C1 and p.C2
+        ClassLoader loader = new URLClassLoader(new URL[] { url1, url2 });
+        Class<?> target1 = Class.forName("p.C1", false, loader);
+        Class<?> target2 = Class.forName("p.C2", false, loader);
+        assertTrue(target1.getClassLoader() == loader);
+        assertTrue(target1.getClassLoader() == loader);
+        assertNotEquals(target1.getProtectionDomain(), target2.getProtectionDomain());
+
+        // protection domain 1
+        Lookup lookup1 = privateLookupIn(target1, lookup()).dropLookupMode(PRIVATE);
+
+        Class<?> clazz = lookup1.defineClass(generateClass("p.Foo"));
+        testSameAbode(clazz, lookup1.lookupClass());
+        testDiscoverable(clazz, lookup1);
+
+        // protection domain 2
+        Lookup lookup2 = privateLookupIn(target2, lookup()).dropLookupMode(PRIVATE);
+
+        clazz = lookup2.defineClass(generateClass("p.Bar"));
+        testSameAbode(clazz, lookup2.lookupClass());
+        testDiscoverable(clazz, lookup2);
+    }
+
+    /**
+     * Test defineClass defining a class to the boot loader
+     */
+    @Test
+    public void testBootLoader() throws Exception {
+        Lookup lookup = privateLookupIn(Thread.class, lookup()).dropLookupMode(PRIVATE);
+        assertTrue(lookup.getClass().getClassLoader() == null);
+
+        Class<?> clazz = lookup.defineClass(generateClass("java.lang.Foo"));
+        assertEquals(clazz.getName(), "java.lang.Foo");
+        testSameAbode(clazz, Thread.class);
+        testDiscoverable(clazz, lookup);
+    }
+
+    @Test(expectedExceptions = { IllegalArgumentException.class })
+    public void testWrongPackage() throws Exception {
+        Lookup lookup = lookup().dropLookupMode(PRIVATE);
+        lookup.defineClass(generateClass("other.C"));
+    }
+
+    @Test(expectedExceptions = { IllegalAccessException.class })
+    public void testNoPackageAccess() throws Exception {
+        Lookup lookup = lookup().dropLookupMode(PACKAGE);
+        lookup.defineClass(generateClass(THIS_PACKAGE + ".C"));
+    }
+
+    @Test(expectedExceptions = { UnsupportedOperationException.class })
+    public void testHasPrivateAccess() throws Exception {
+        Lookup lookup = lookup();
+        assertTrue(lookup.hasPrivateAccess());
+        lookup.defineClass(generateClass(THIS_PACKAGE + ".C"));
+    }
+
+    @Test(expectedExceptions = { ClassFormatError.class })
+    public void testTruncatedClassFile() throws Exception {
+        Lookup lookup = lookup().dropLookupMode(PRIVATE);
+        lookup.defineClass(new byte[0]);
+    }
+
+    @Test(expectedExceptions = { NullPointerException.class })
+    public void testNull() throws Exception {
+        Lookup lookup = lookup().dropLookupMode(PRIVATE);
+        lookup.defineClass(null);
+    }
+
+    /**
+     * Generates a class file with the given class name
+     */
+    byte[] generateClass(String className) {
+        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS
+                                         + ClassWriter.COMPUTE_FRAMES);
+        cw.visit(V1_9,
+                ACC_PUBLIC + ACC_SUPER,
+                className.replace(".", "/"),
+                null,
+                "java/lang/Object",
+                null);
+
+        // <init>
+        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+
+    /**
+     * Generate a class file with the given class name. The class implements Runnable
+     * with a run method to invokestatic the given targetClass/targetMethod.
+     */
+    byte[] generateRunner(String className,
+                          String targetClass,
+                          String targetMethod) throws Exception {
+
+        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS
+                                         + ClassWriter.COMPUTE_FRAMES);
+        cw.visit(V1_9,
+                ACC_PUBLIC + ACC_SUPER,
+                className.replace(".", "/"),
+                null,
+                "java/lang/Object",
+                new String[] { "java/lang/Runnable" });
+
+        // <init>
+        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+
+        // run()
+        String tc = targetClass.replace(".", "/");
+        mv = cw.visitMethod(ACC_PUBLIC, "run", "()V", null, null);
+        mv.visitMethodInsn(INVOKESTATIC, tc, targetMethod, "()V", false);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+
+    /**
+     * Generate a class file with the given class name. The class will initializer
+     * to invokestatic the given targetClass/targetMethod.
+     */
+    byte[] generateClassWithInitializer(String className,
+                                        String targetClass,
+                                        String targetMethod) throws Exception {
+
+        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS
+                                         + ClassWriter.COMPUTE_FRAMES);
+        cw.visit(V1_9,
+                ACC_PUBLIC + ACC_SUPER,
+                className.replace(".", "/"),
+                null,
+                "java/lang/Object",
+                null);
+
+        // <init>
+        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+
+        // <clinit>
+        String tc = targetClass.replace(".", "/");
+        mv = cw.visitMethod(ACC_STATIC, "<clinit>", "()V", null, null);
+        mv.visitMethodInsn(INVOKESTATIC, tc, targetMethod, "()V", false);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(0, 0);
+        mv.visitEnd();
+
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+
+    private int nextNumber() {
+        return ++nextNumber;
+    }
+
+    private int nextNumber;
+}
diff --git a/jdk/test/java/lang/invoke/DropLookupModeTest.java b/jdk/test/java/lang/invoke/DropLookupModeTest.java
index be7d0a6..64cb99e 100644
--- a/jdk/test/java/lang/invoke/DropLookupModeTest.java
+++ b/jdk/test/java/lang/invoke/DropLookupModeTest.java
@@ -65,6 +65,10 @@
         lookup = fullPowerLookup.dropLookupMode(PUBLIC);
         assertTrue(lookup.lookupClass() == lc);
         assertTrue(lookup.lookupModes() == 0);
+
+        lookup = fullPowerLookup.dropLookupMode(UNCONDITIONAL);
+        assertTrue(lookup.lookupClass() == lc);
+        assertTrue(lookup.lookupModes() == (PUBLIC|MODULE|PACKAGE|PRIVATE));
     }
 
     /**
@@ -108,7 +112,7 @@
     public void testPublicLookup() {
         final Lookup publicLookup = MethodHandles.publicLookup();
         final Class<?> lc = publicLookup.lookupClass();
-        assertTrue(publicLookup.lookupModes() == PUBLIC);
+        assertTrue(publicLookup.lookupModes() == (PUBLIC|UNCONDITIONAL));
 
         Lookup lookup = publicLookup.dropLookupMode(PRIVATE);
         assertTrue(lookup.lookupClass() == lc);
@@ -129,6 +133,10 @@
         lookup = publicLookup.dropLookupMode(PUBLIC);
         assertTrue(lookup.lookupClass() == lc);
         assertTrue(lookup.lookupModes() == 0);
+
+        lookup = publicLookup.dropLookupMode(UNCONDITIONAL);
+        assertTrue(lookup.lookupClass() == lc);
+        assertTrue(lookup.lookupModes() == PUBLIC);
     }
 
     @DataProvider(name = "badInput")
diff --git a/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java b/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
index d453caf..84e1dd5 100644
--- a/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
+++ b/jdk/test/java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
  * @library /lib/testlibrary/jsr292 /lib/testlibrary
  * @modules java.base/java.lang.invoke:open
  *          java.base/java.lang.ref:open
- *          jdk.management
+ *          java.management
  * @build TestMethods
  * @build LambdaFormTestCase
  * @build LFCachingTestCase
diff --git a/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java b/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
index bef4d5e..bc674b0 100644
--- a/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
+++ b/jdk/test/java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
  * @library /lib/testlibrary/jsr292 /lib/testlibrary
  * @modules java.base/java.lang.ref:open
  *          java.base/java.lang.invoke:open
+ *          java.management
  * @build TestMethods
  * @build LambdaFormTestCase
  * @build LFCachingTestCase
diff --git a/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/Driver.java b/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/Driver.java
index 5abe4eb..810351b 100644
--- a/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/Driver.java
+++ b/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/Driver.java
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @build test/* m1/* m2/* m3/*
+ * @build test/* m1/* m2/* m3/* Unnamed
  * @run testng/othervm test/p.PrivateLookupInTests
  * @summary Unit tests for MethodHandles.privateLookupIn
  */
diff --git a/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/Unnamed.java b/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/Unnamed.java
new file mode 100644
index 0000000..9bb0ff0
--- /dev/null
+++ b/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/Unnamed.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public class Unnamed { }
diff --git a/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java b/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java
index 823ae87..869a655 100644
--- a/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java
+++ b/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodHandles.Lookup;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 
 import static java.lang.invoke.MethodHandles.Lookup.*;
 
@@ -126,6 +125,26 @@
         Object obj = mh.invokeExact();
     }
 
+    // test target class in unnamed module
+    public void testTargetClassInUnnamedModule() throws Throwable {
+        Class<?> clazz = Class.forName("Unnamed");
+        assertFalse(clazz.getModule().isNamed());
+
+        // thisModule does not read the unnamed module
+        Module thisModule = getClass().getModule();
+        assertFalse(thisModule.canRead(clazz.getModule()));
+        try {
+            MethodHandles.privateLookupIn(clazz, MethodHandles.lookup());
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        // thisModule reads the unnamed module
+        thisModule.addReads(clazz.getModule());
+        Lookup lookup = MethodHandles.privateLookupIn(clazz, MethodHandles.lookup());
+        assertTrue(lookup.lookupClass() == clazz);
+        assertTrue(lookup.hasPrivateAccess());
+    }
+
     // test does not read m2, m2 opens p2 to test
     @Test(expectedExceptions = {IllegalAccessException.class})
     public void testCallerDoesNotRead() throws Throwable {
diff --git a/jdk/test/java/lang/invoke/lambda/InheritedMethodTest.java b/jdk/test/java/lang/invoke/lambda/InheritedMethodTest.java
new file mode 100644
index 0000000..bbf59d0
--- /dev/null
+++ b/jdk/test/java/lang/invoke/lambda/InheritedMethodTest.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8174399
+ * @summary LambdaMetafactory should be able to handle inherited methods as 'implMethod'
+ */
+import java.lang.ReflectiveOperationException;
+import java.lang.invoke.*;
+
+public class InheritedMethodTest {
+
+    public static MethodType mt(Class<?> ret, Class<?>... params) { return MethodType.methodType(ret, params); }
+
+    public interface StringFactory {
+        String get();
+    }
+
+    public interface I {
+        String iString();
+    }
+
+    public interface J extends I {}
+
+    public static abstract class C implements I {}
+
+    public static class D extends C implements J {
+        public String toString() { return "a"; }
+        public String iString() { return "b"; }
+    }
+
+    private static final MethodHandles.Lookup lookup = MethodHandles.lookup();
+
+    public static void main(String... args) throws Throwable {
+        test(lookup.findVirtual(C.class, "toString", mt(String.class)), "a");
+        test(lookup.findVirtual(C.class, "iString", mt(String.class)), "b");
+        test(lookup.findVirtual(J.class, "toString", mt(String.class)), "a");
+        test(lookup.findVirtual(J.class, "iString", mt(String.class)), "b");
+        test(lookup.findVirtual(I.class, "toString", mt(String.class)), "a");
+        test(lookup.findVirtual(I.class, "iString", mt(String.class)), "b");
+    }
+
+    static void test(MethodHandle implMethod, String expected) throws Throwable {
+        testMetafactory(implMethod, expected);
+        testAltMetafactory(implMethod, expected);
+    }
+
+    static void testMetafactory(MethodHandle implMethod, String expected) throws Throwable {
+        CallSite cs = LambdaMetafactory.metafactory(lookup, "get", mt(StringFactory.class, D.class), mt(String.class),
+                                                    implMethod, mt(String.class));
+        StringFactory factory = (StringFactory) cs.dynamicInvoker().invokeExact(new D());
+        String actual = factory.get();
+        if (!expected.equals(actual)) throw new AssertionError("Unexpected result: " + actual);
+    }
+
+    static void testAltMetafactory(MethodHandle implMethod, String expected) throws Throwable {
+        CallSite cs = LambdaMetafactory.altMetafactory(lookup, "get", mt(StringFactory.class, D.class), mt(String.class),
+                                                       implMethod, mt(String.class), LambdaMetafactory.FLAG_SERIALIZABLE);
+        StringFactory factory = (StringFactory) cs.dynamicInvoker().invokeExact(new D());
+        String actual = factory.get();
+        if (!expected.equals(actual)) throw new AssertionError("Unexpected result: " + actual);
+    }
+
+}
diff --git a/jdk/test/java/lang/invoke/lambda/MetafactoryDescriptorTest.java b/jdk/test/java/lang/invoke/lambda/MetafactoryDescriptorTest.java
new file mode 100644
index 0000000..a22e5da
--- /dev/null
+++ b/jdk/test/java/lang/invoke/lambda/MetafactoryDescriptorTest.java
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8035776 8173587
+ * @summary metafactory should fail if instantiatedMethodType does not match sam/bridge descriptors
+ */
+import java.lang.invoke.*;
+import java.util.*;
+
+public class MetafactoryDescriptorTest {
+
+    static final MethodHandles.Lookup lookup = MethodHandles.lookup();
+
+    static MethodType mt(Class<?> ret, Class<?>... params) {
+        return MethodType.methodType(ret, params);
+    }
+
+    public interface I {}
+
+    public static class C {
+        public static void m_void(String arg) {}
+        public static boolean m_boolean(String arg) { return true; }
+        public static char m_char(String arg) { return 'x'; }
+        public static byte m_byte(String arg) { return 12; }
+        public static short m_short(String arg) { return 12; }
+        public static int m_int(String arg) { return 12; }
+        public static long m_long(String arg) { return 12; }
+        public static float m_float(String arg) { return 12; }
+        public static double m_double(String arg) { return 12; }
+        public static String m_String(String arg) { return ""; }
+        public static Integer m_Integer(String arg) { return 23; }
+        public static Object m_Object(String arg) { return new Object(); }
+
+        public static String n_boolean(boolean arg) { return ""; }
+        public static String n_char(char arg) { return ""; }
+        public static String n_byte(byte arg) { return ""; }
+        public static String n_short(short arg) { return ""; }
+        public static String n_int(int arg) { return ""; }
+        public static String n_long(long arg) { return ""; }
+        public static String n_float(float arg) { return ""; }
+        public static String n_double(double arg) { return ""; }
+        public static String n_String(String arg) { return ""; }
+        public static String n_Integer(Integer arg) { return ""; }
+        public static String n_Object(Object arg) { return ""; }
+
+        public static MethodHandle getM(Class<?> c) {
+            try {
+                return lookup.findStatic(C.class, "m_" + c.getSimpleName(), mt(c, String.class));
+            }
+            catch (NoSuchMethodException | IllegalAccessException e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        public static MethodHandle getN(Class<?> c) {
+            if (c == void.class) return null;
+            try {
+                return lookup.findStatic(C.class, "n_" + c.getSimpleName(), mt(String.class, c));
+            }
+            catch (NoSuchMethodException | IllegalAccessException e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+    }
+
+    public static void main(String... args) {
+        Class<?>[] t = { void.class, boolean.class, char.class,
+                         byte.class, short.class, int.class, long.class, float.class, double.class,
+                         String.class, Integer.class, Object.class };
+
+        for (int i = 0; i < t.length; i++) {
+            MethodHandle m = C.getM(t[i]);
+            MethodHandle n = C.getN(t[i]); // null for void.class
+            for (int j = 0; j < t.length; j++) {
+                boolean correctRet = t[j].isAssignableFrom(t[i]) || conversions.contains(t[i], t[j]);
+                test(correctRet, m, mt(t[i], String.class), mt(t[j], String.class));
+                testBridge(correctRet, m, mt(t[i], String.class), mt(t[i], String.class),
+                           mt(t[j], Object.class));
+                testBridge(correctRet, m, mt(t[i], String.class), mt(t[i], String.class),
+                           mt(t[i], CharSequence.class), mt(t[j], Object.class));
+
+                if (t[i] != void.class && t[j] != void.class) {
+                    boolean correctParam = t[j].isAssignableFrom(t[i]);
+                    test(correctParam, n, mt(String.class, t[i]), mt(String.class, t[j]));
+                    testBridge(correctParam, n, mt(String.class, t[i]), mt(String.class, t[i]),
+                            mt(Object.class, t[j]));
+                    testBridge(correctParam, n, mt(String.class, t[i]), mt(String.class, t[i]),
+                            mt(CharSequence.class, t[i]), mt(Object.class, t[j]));
+                }
+
+            }
+        }
+    }
+
+    static void test(boolean correct, MethodHandle mh, MethodType instMT, MethodType samMT) {
+        tryMetafactory(correct, mh, instMT, samMT);
+        tryAltMetafactory(correct, mh, instMT, samMT);
+    }
+
+    static void testBridge(boolean correct, MethodHandle mh, MethodType instMT, MethodType samMT, MethodType... bridgeMTs) {
+        tryAltMetafactory(correct, mh, instMT, samMT, bridgeMTs);
+    }
+
+    static void tryMetafactory(boolean correct, MethodHandle mh, MethodType instMT, MethodType samMT) {
+        try {
+            LambdaMetafactory.metafactory(lookup, "run", mt(I.class),
+                                          samMT, mh, instMT);
+            if (!correct) {
+                throw new AssertionError("Unexpected linkage without error:" +
+                                         " impl=" + mh +
+                                         ", inst=" + instMT +
+                                         ", sam=" + samMT);
+            }
+        }
+        catch (LambdaConversionException e) {
+            if (correct) {
+                throw new AssertionError("Unexpected linkage error:" +
+                                         " e=" + e +
+                                         ", impl=" + mh +
+                                         ", inst=" + instMT +
+                                         ", sam=" + samMT);
+            }
+        }
+    }
+
+    static void tryAltMetafactory(boolean correct, MethodHandle mh, MethodType instMT, MethodType samMT,
+                                  MethodType... bridgeMTs) {
+        boolean bridge = bridgeMTs.length > 0;
+        Object[] args = new Object[bridge ? 5+bridgeMTs.length : 4];
+        args[0] = samMT;
+        args[1] = mh;
+        args[2] = instMT;
+        args[3] = bridge ? LambdaMetafactory.FLAG_BRIDGES : 0;
+        if (bridge) {
+            args[4] = bridgeMTs.length;
+            for (int i = 0; i < bridgeMTs.length; i++) args[5+i] = bridgeMTs[i];
+        }
+        try {
+            LambdaMetafactory.altMetafactory(lookup, "run", mt(I.class), args);
+            if (!correct) {
+                throw new AssertionError("Unexpected linkage without error:" +
+                                         " impl=" + mh +
+                                         ", inst=" + instMT +
+                                         ", sam=" + samMT +
+                                         ", bridges=" + Arrays.toString(bridgeMTs));
+            }
+        }
+        catch (LambdaConversionException e) {
+            if (correct) {
+                throw new AssertionError("Unexpected linkage error:" +
+                                         " e=" + e +
+                                         ", impl=" + mh +
+                                         ", inst=" + instMT +
+                                         ", sam=" + samMT +
+                                         ", bridges=" + Arrays.toString(bridgeMTs));
+            }
+        }
+    }
+
+    private static class ConversionTable {
+        private final Map<Class<?>, Set<Class<?>>> pairs = new HashMap<>();
+
+        public void put(Class<?> from, Class<?> to) {
+            Set<Class<?>> set = pairs.computeIfAbsent(from, f -> new HashSet<>());
+            set.add(to);
+        }
+
+        public boolean contains(Class<?> from, Class<?> to) {
+            return pairs.containsKey(from) && pairs.get(from).contains(to);
+        }
+    }
+
+    private static ConversionTable conversions = new ConversionTable();
+    static {
+        conversions.put(char.class, int.class);
+        conversions.put(char.class, long.class);
+        conversions.put(char.class, float.class);
+        conversions.put(char.class, double.class);
+        conversions.put(char.class, Character.class);
+        conversions.put(char.class, Object.class);
+        conversions.put(Character.class, char.class);
+        conversions.put(Character.class, int.class);
+        conversions.put(Character.class, long.class);
+        conversions.put(Character.class, float.class);
+        conversions.put(Character.class, double.class);
+
+        conversions.put(byte.class, short.class);
+        conversions.put(byte.class, int.class);
+        conversions.put(byte.class, long.class);
+        conversions.put(byte.class, float.class);
+        conversions.put(byte.class, double.class);
+        conversions.put(byte.class, Byte.class);
+        conversions.put(byte.class, Object.class);
+        conversions.put(Byte.class, byte.class);
+        conversions.put(Byte.class, short.class);
+        conversions.put(Byte.class, int.class);
+        conversions.put(Byte.class, long.class);
+        conversions.put(Byte.class, float.class);
+        conversions.put(Byte.class, double.class);
+
+        conversions.put(short.class, int.class);
+        conversions.put(short.class, long.class);
+        conversions.put(short.class, float.class);
+        conversions.put(short.class, double.class);
+        conversions.put(short.class, Short.class);
+        conversions.put(short.class, Object.class);
+        conversions.put(Short.class, short.class);
+        conversions.put(Short.class, int.class);
+        conversions.put(Short.class, long.class);
+        conversions.put(Short.class, float.class);
+        conversions.put(Short.class, double.class);
+
+        conversions.put(int.class, long.class);
+        conversions.put(int.class, float.class);
+        conversions.put(int.class, double.class);
+        conversions.put(int.class, Integer.class);
+        conversions.put(int.class, Object.class);
+        conversions.put(Integer.class, int.class);
+        conversions.put(Integer.class, long.class);
+        conversions.put(Integer.class, float.class);
+        conversions.put(Integer.class, double.class);
+
+        conversions.put(long.class, float.class);
+        conversions.put(long.class, double.class);
+        conversions.put(long.class, Long.class);
+        conversions.put(long.class, Object.class);
+        conversions.put(Long.class, long.class);
+        conversions.put(Long.class, float.class);
+        conversions.put(Long.class, double.class);
+
+        conversions.put(float.class, double.class);
+        conversions.put(float.class, Float.class);
+        conversions.put(float.class, Object.class);
+        conversions.put(Float.class, float.class);
+        conversions.put(Float.class, double.class);
+
+        conversions.put(double.class, Double.class);
+        conversions.put(double.class, Object.class);
+        conversions.put(Double.class, double.class);
+
+        conversions.put(boolean.class, Boolean.class);
+        conversions.put(boolean.class, Object.class);
+        conversions.put(Boolean.class, boolean.class);
+    }
+
+}
diff --git a/jdk/test/java/lang/invoke/lambda/MetafactoryMethodNameTest.java b/jdk/test/java/lang/invoke/lambda/MetafactoryMethodNameTest.java
new file mode 100644
index 0000000..64dd4b4
--- /dev/null
+++ b/jdk/test/java/lang/invoke/lambda/MetafactoryMethodNameTest.java
@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173587
+ * @summary metafactory should fail if the method name is not legal
+ */
+import java.lang.invoke.*;
+import java.util.*;
+
+public class MetafactoryMethodNameTest {
+
+    public static void main(String... args) {
+        goodName("x");
+        goodName("xy");
+
+        goodName("]");
+        goodName("x]");
+        goodName("]y");
+        goodName("x]y");
+
+        goodName("&");
+        goodName("x&");
+        goodName("&y");
+        goodName("x&y");
+
+        badName(".");
+        badName("x.");
+        badName(".y");
+        badName("x.y");
+
+        badName(";");
+        badName("x;");
+        badName(";y");
+        badName("x;y");
+
+        badName("[");
+        badName("x[");
+        badName("[y");
+        badName("x[y");
+
+        badName("/");
+        badName("x/");
+        badName("/y");
+        badName("x/y");
+
+        badName("<");
+        badName("x<");
+        badName("<y");
+        badName("x<y");
+
+        badName(">");
+        badName("x>");
+        badName(">y");
+        badName("x>y");
+
+        badName("");
+        badName("<init>");
+        badName("<clinit>");
+    }
+
+    static MethodType mt(Class<?> ret, Class<?>... params) {
+        return MethodType.methodType(ret, params);
+    }
+
+    static MethodHandle smh(Class<?> c, String name, MethodType desc) {
+        try {
+            return MethodHandles.lookup().findStatic(c, name, desc);
+        } catch (ReflectiveOperationException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    static Object[] arr(Object... args) {
+        return args;
+    }
+
+    public static class C {
+        public static void m() {}
+    }
+
+    public interface I {}
+
+    private static MethodHandles.Lookup lookup = MethodHandles.lookup();
+    private static MethodType toI = mt(I.class);
+    private static MethodType toVoid = mt(void.class);
+    private static MethodHandle mh = smh(C.class, "m", toVoid);
+    private static Class<?> lce = LambdaConversionException.class;
+
+    static void goodName(String name) {
+        succeedMFLinkage(lookup, name, toI, toVoid, mh, toVoid);
+        succeedAltMFLinkage(lookup, name, toI, arr(toVoid, mh, toVoid, LambdaMetafactory.FLAG_SERIALIZABLE));
+    }
+
+    static void badName(String name) {
+        failMFLinkage(lookup, name, toI, toVoid, mh, toVoid, lce);
+        failAltMFLinkage(lookup, name, toI, arr(toVoid, mh, toVoid, LambdaMetafactory.FLAG_SERIALIZABLE), lce);
+    }
+
+    static CallSite succeedMFLinkage(MethodHandles.Lookup lookup,
+                                    String name,
+                                    MethodType capType,
+                                    MethodType desc,
+                                    MethodHandle impl,
+                                    MethodType checked) {
+        try {
+            return LambdaMetafactory.metafactory(lookup, name, capType, desc, impl, checked);
+        } catch (Throwable t) {
+            String msg = String.format("Unexpected exception during linkage for metafactory(%s, %s, %s, %s, %s, %s)",
+                    lookup, name, capType, desc, impl, checked);
+            throw new AssertionError(msg, t);
+        }
+    }
+
+    static void failMFLinkage(MethodHandles.Lookup lookup,
+                              String name,
+                              MethodType capType,
+                              MethodType desc,
+                              MethodHandle impl,
+                              MethodType checked,
+                              Class<?> expectedExceptionType) {
+        try {
+            LambdaMetafactory.metafactory(lookup, name, capType, desc, impl, checked);
+        } catch (Throwable t) {
+            if (expectedExceptionType.isInstance(t)) {
+                return;
+            } else {
+                String msg = String.format("Unexpected exception: expected %s during linkage for metafactory(%s, %s, %s, %s, %s, %s)",
+                        expectedExceptionType.getName(),
+                        lookup, name, capType, desc, impl, checked);
+                throw new AssertionError(msg, t);
+            }
+        }
+        String msg = String.format("Unexpected success: expected %s during linkage for metafactory(%s, %s, %s, %s, %s, %s)",
+                expectedExceptionType.getName(),
+                lookup, name, capType, desc, impl, checked);
+        throw new AssertionError(msg);
+    }
+
+    static CallSite succeedAltMFLinkage(MethodHandles.Lookup lookup,
+                                        String name,
+                                        MethodType capType,
+                                        Object[] args) {
+        try {
+            return LambdaMetafactory.altMetafactory(lookup, name, capType, args);
+        } catch (Throwable t) {
+            String msg = String.format("Unexpected exception during linkage for metafactory(%s, %s, %s, %s)",
+                    lookup, name, capType, Arrays.asList(args));
+            throw new AssertionError(msg, t);
+        }
+    }
+
+    static void failAltMFLinkage(MethodHandles.Lookup lookup,
+                                 String name,
+                                 MethodType capType,
+                                 Object[] args,
+                                 Class<?> expectedExceptionType) {
+        try {
+            LambdaMetafactory.altMetafactory(lookup, name, capType, args);
+        } catch (Throwable t) {
+            if (expectedExceptionType.isInstance(t)) {
+                return;
+            } else {
+                String msg = String.format("Unexpected exception: expected %s during linkage for metafactory(%s, %s, %s, %s)",
+                        expectedExceptionType.getName(),
+                        lookup, name, capType, Arrays.asList(args));
+                throw new AssertionError(msg, t);
+            }
+        }
+        String msg = String.format("Unexpected success: expected %s during linkage for metafactory(%s, %s, %s, %s)",
+                expectedExceptionType.getName(),
+                lookup, name, capType, Arrays.asList(args));
+        throw new AssertionError(msg);
+    }
+
+}
diff --git a/jdk/test/java/lang/invoke/lambda/MetafactorySamReturnTest.java b/jdk/test/java/lang/invoke/lambda/MetafactorySamReturnTest.java
deleted file mode 100644
index 4caf262..0000000
--- a/jdk/test/java/lang/invoke/lambda/MetafactorySamReturnTest.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8035776
- * @summary metafactory should fail if impl return does not match sam/bridge returns
- */
-import java.lang.invoke.*;
-import java.util.Arrays;
-import static java.lang.invoke.MethodType.methodType;
-
-public class MetafactorySamReturnTest {
-
-    static final MethodHandles.Lookup lookup = MethodHandles.lookup();
-
-    public interface I {}
-
-    public static class C {
-        public static void m_void(String arg) {}
-        public static boolean m_boolean(String arg) { return true; }
-        public static char m_char(String arg) { return 'x'; }
-        public static byte m_byte(String arg) { return 12; }
-        public static short m_short(String arg) { return 12; }
-        public static int m_int(String arg) { return 12; }
-        public static long m_long(String arg) { return 12; }
-        public static float m_float(String arg) { return 12; }
-        public static double m_double(String arg) { return 12; }
-        public static String m_String(String arg) { return ""; }
-        public static Integer m_Integer(String arg) { return 23; }
-        public static Object m_Object(String arg) { return new Object(); }
-
-        public static MethodHandle getMH(Class<?> c) {
-            try {
-                return lookup.findStatic(C.class, "m_" + c.getSimpleName(), methodType(c, String.class));
-            }
-            catch (NoSuchMethodException | IllegalAccessException e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    public static void main(String... args) {
-        Class<?>[] t = { void.class, boolean.class, char.class,
-                         byte.class, short.class, int.class, long.class, float.class, double.class,
-                         String.class, Integer.class, Object.class };
-
-        for (int i = 0; i < t.length; i++) {
-            MethodHandle mh = C.getMH(t[i]);
-            for (int j = 0; j < t.length; j++) {
-                // TEMPORARY EXCEPTIONS
-                if (t[j] == void.class) continue;
-                if (t[i].isPrimitive() && t[j] == Object.class) continue;
-                if (t[i] == char.class && (t[j] == int.class || t[j] == long.class || t[j] == float.class || t[j] == double.class)) continue;
-                if (t[i] == byte.class && (t[j] == short.class || t[j] == int.class || t[j] == long.class || t[j] == float.class || t[j] == double.class)) continue;
-                if (t[i] == short.class && (t[j] == int.class || t[j] == long.class || t[j] == float.class || t[j] == double.class)) continue;
-                if (t[i] == int.class && (t[j] == long.class || t[j] == float.class || t[j] == double.class)) continue;
-                if (t[i] == long.class && (t[j] == float.class || t[j] == double.class)) continue;
-                if (t[i] == float.class && t[j] == double.class) continue;
-                if (t[i] == int.class && t[j] == Integer.class) continue;
-                if (t[i] == Integer.class && (t[j] == int.class || t[j] == long.class || t[j] == float.class || t[j] == double.class)) continue;
-                // END TEMPORARY EXCEPTIONS
-                boolean correct = (t[i].isPrimitive() || t[j].isPrimitive())
-                                  ? t[i] == t[j]
-                                  : t[j].isAssignableFrom(t[i]);
-                MethodType mti = methodType(t[i], String.class);
-                MethodType mtiCS = methodType(t[i], CharSequence.class);
-                MethodType mtj = methodType(t[j], String.class);
-                MethodType mtjObj = methodType(t[j], Object.class);
-                test(correct, mh, mti, mtj);
-                testBridge(correct, mh, mti, mti, mtjObj);
-                testBridge(correct, mh, mti, mti, mtiCS, mtjObj);
-            }
-        }
-    }
-
-    static void test(boolean correct, MethodHandle mh, MethodType instMT, MethodType samMT) {
-        tryMetafactory(correct, mh, new Class<?>[]{}, instMT, samMT);
-        tryAltMetafactory(correct, mh, new Class<?>[]{}, instMT, samMT);
-    }
-
-    static void testBridge(boolean correct, MethodHandle mh, MethodType instMT, MethodType samMT, MethodType... bridgeMTs) {
-        tryAltMetafactory(correct, mh, new Class<?>[]{}, instMT, samMT, bridgeMTs);
-    }
-
-    static void tryMetafactory(boolean correct, MethodHandle mh, Class<?>[] captured,
-                               MethodType instMT, MethodType samMT) {
-        try {
-            LambdaMetafactory.metafactory(lookup, "run", methodType(I.class, captured),
-                                          samMT, mh, instMT);
-            if (!correct) {
-                throw new AssertionError("Uncaught linkage error:" +
-                                         " impl=" + mh +
-                                         ", captured=" + Arrays.toString(captured) +
-                                         ", inst=" + instMT +
-                                         ", sam=" + samMT);
-            }
-        }
-        catch (LambdaConversionException e) {
-            if (correct) {
-                throw new AssertionError("Unexpected linkage error:" +
-                                         " e=" + e +
-                                         ", impl=" + mh +
-                                         ", captured=" + Arrays.toString(captured) +
-                                         ", inst=" + instMT +
-                                         ", sam=" + samMT);
-            }
-        }
-    }
-
-    static void tryAltMetafactory(boolean correct, MethodHandle mh, Class<?>[] captured,
-                                  MethodType instMT, MethodType samMT, MethodType... bridgeMTs) {
-        boolean bridge = bridgeMTs.length > 0;
-        Object[] args = new Object[bridge ? 5+bridgeMTs.length : 4];
-        args[0] = samMT;
-        args[1] = mh;
-        args[2] = instMT;
-        args[3] = bridge ? LambdaMetafactory.FLAG_BRIDGES : 0;
-        if (bridge) {
-            args[4] = bridgeMTs.length;
-            for (int i = 0; i < bridgeMTs.length; i++) args[5+i] = bridgeMTs[i];
-        }
-        try {
-            LambdaMetafactory.altMetafactory(lookup, "run", methodType(I.class, captured), args);
-            if (!correct) {
-                throw new AssertionError("Uncaught linkage error:" +
-                                         " impl=" + mh +
-                                         ", captured=" + Arrays.toString(captured) +
-                                         ", inst=" + instMT +
-                                         ", sam=" + samMT +
-                                         ", bridges=" + Arrays.toString(bridgeMTs));
-            }
-        }
-        catch (LambdaConversionException e) {
-            if (correct) {
-                throw new AssertionError("Unexpected linkage error:" +
-                                         " e=" + e +
-                                         ", impl=" + mh +
-                                         ", captured=" + Arrays.toString(captured) +
-                                         ", inst=" + instMT +
-                                         ", sam=" + samMT +
-                                         ", bridges=" + Arrays.toString(bridgeMTs));
-            }
-        }
-    }
-
-}
diff --git a/jdk/test/java/lang/invoke/modules/Driver.java b/jdk/test/java/lang/invoke/modules/Driver.java
new file mode 100644
index 0000000..5c00de3
--- /dev/null
+++ b/jdk/test/java/lang/invoke/modules/Driver.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @build m1/* m2/* Unnamed
+ * @run testng/othervm m1/p1.Main
+ * @summary Basic test case for module access checks and Lookup.in.
+ */
diff --git a/jdk/test/java/lang/invoke/modules/ModuleAccessControlTest.java b/jdk/test/java/lang/invoke/modules/ModuleAccessControlTest.java
deleted file mode 100644
index 32adfd9..0000000
--- a/jdk/test/java/lang/invoke/modules/ModuleAccessControlTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.List;
-
-import static jdk.testlibrary.ProcessTools.executeTestJava;
-
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-import static org.testng.Assert.*;
-
-/**
- * @test
- * @library /lib/testlibrary
- * @modules jdk.compiler
- * @build CompilerUtils jdk.testlibrary.*
- * @run testng ModuleAccessControlTest
- * @summary Driver for testing module access checking by MethodHandles.Lookup
- */
-
-public class ModuleAccessControlTest {
-
-    private static final String TEST_SRC = System.getProperty("test.src");
-
-    private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
-    private static final Path MODS_DIR = Paths.get("mods");
-
-    // the names of the modules in this test
-    private static List<String> modules = Arrays.asList("m1", "m2");
-
-
-    /**
-     * Compiles all modules used by the test
-     */
-    @BeforeTest
-    public void compileAll() throws Exception {
-        for (String mn : modules) {
-            Path msrc = SRC_DIR.resolve(mn);
-            assertTrue(CompilerUtils
-                .compile(msrc, MODS_DIR, "--module-source-path", SRC_DIR.toString()));
-        }
-    }
-
-    /**
-     * Launch the test
-     */
-    @Test
-    public void runTest() throws Exception {
-        int exitValue = executeTestJava("--module-path", MODS_DIR.toString(),
-                                        "-m", "m1/p1.Main")
-                .outputTo(System.out)
-                .errorTo(System.out)
-                .getExitValue();
-
-        assertTrue(exitValue == 0);
-    }
-
-}
diff --git a/jdk/test/java/lang/invoke/modules/Unnamed.java b/jdk/test/java/lang/invoke/modules/Unnamed.java
new file mode 100644
index 0000000..9bb0ff0
--- /dev/null
+++ b/jdk/test/java/lang/invoke/modules/Unnamed.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public class Unnamed { }
diff --git a/jdk/test/java/lang/invoke/modules/m1/module-info.java b/jdk/test/java/lang/invoke/modules/m1/module-info.java
new file mode 100644
index 0000000..9c09afc
--- /dev/null
+++ b/jdk/test/java/lang/invoke/modules/m1/module-info.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+module m1 {
+    requires m2;
+    requires testng;
+    exports p1;
+}
diff --git a/jdk/test/java/lang/invoke/modules/m1/p1/Main.java b/jdk/test/java/lang/invoke/modules/m1/p1/Main.java
new file mode 100644
index 0000000..d708d74
--- /dev/null
+++ b/jdk/test/java/lang/invoke/modules/m1/p1/Main.java
@@ -0,0 +1,365 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p1;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
+import java.lang.invoke.MethodType;
+
+import static java.lang.invoke.MethodHandles.Lookup.*;
+
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * Basic test case for module access checks and Lookup.in.
+ */
+
+@Test
+public class Main {
+
+    private Class<?> p1_Type1;        // m1, exported
+    private Class<?> p2_Type2;        // m1, not exported
+    private Class<?> q1_Type1;        // m2, exported
+    private Class<?> q2_Type2;        // m2, not exported
+    private Class<?> x500NameClass;   // java.base, not exported
+    private Class<?> unnamedClass;    // class in unnamed module
+
+    @BeforeTest
+    public void setup() throws Exception {
+        try {
+            p1_Type1 = Class.forName("p1.Type1");
+            p2_Type2 = Class.forName("p2.Type2");
+            q1_Type1 = Class.forName("q1.Type1");
+            q2_Type2 = Class.forName("q2.Type2");
+            x500NameClass = Class.forName("sun.security.x509.X500Name");
+            unnamedClass = Class.forName("Unnamed");
+        } catch (ClassNotFoundException e) {
+            throw new AssertionError(e);
+        }
+
+        // check setup
+        Module m1 = ModuleLayer.boot().findModule("m1").orElse(null);
+        assertNotNull(m1);
+        assertTrue(p1_Type1.getModule() == m1);
+        assertTrue(p2_Type2.getModule() == m1);
+        assertTrue(m1.isExported("p1"));
+        assertFalse(m1.isExported("p2"));
+
+        Module m2 = ModuleLayer.boot().findModule("m2").orElse(null);
+        assertNotNull(m2);
+        assertTrue(q1_Type1.getModule() == m2);
+        assertTrue(q2_Type2.getModule() == m2);
+        assertTrue(m2.isExported("q1"));
+        assertFalse(m2.isExported("q2"));
+
+        Module unnamedModule = unnamedClass.getModule();
+        assertFalse(unnamedModule.isNamed());
+
+        // m1 needs to read unnamed module
+        Main.class.getModule().addReads(unnamedModule);
+    }
+
+    /**
+     * MethodHandles.lookup()
+     *
+     * [A0] has module access
+     * [A1] can access all public types in m1
+     * [A2] can access public types in packages exported by modules that m1 reads
+     * [A3] cannot access public types in non-exported modules of modules that m1 reads
+     */
+    public void testLookup() throws Exception {
+        Lookup lookup = MethodHandles.lookup();
+        assertTrue((lookup.lookupModes() & MODULE) == MODULE); // [A0]
+
+        // m1
+        findConstructor(lookup, p1_Type1, void.class); // [A1]
+        findConstructor(lookup, p2_Type2, void.class); // [A1]
+
+        // m2
+        findConstructor(lookup, q1_Type1, void.class); // [A2]
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class); // [A3]
+
+        // java.base
+        findConstructor(lookup, Object.class, void.class); // [A2]
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class); // [A3]
+
+        // unnamed
+        findConstructor(lookup, unnamedClass, void.class);  // [A3]
+    }
+
+    /**
+     * Hop to lookup class in the same module
+     *
+     * [A0] module and public access is not lost
+     */
+    public void testToSameModule() throws Exception {
+        Lookup lookup = MethodHandles.lookup().in(p2_Type2);
+        assertTrue(lookup.lookupModes() == (MODULE|PUBLIC)); // [A0]
+
+        // m1
+        findConstructor(lookup, p1_Type1, void.class);
+        findConstructor(lookup, p2_Type2, void.class);
+
+        // m2
+        findConstructor(lookup, q1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class);
+
+        // java.base
+        findConstructor(lookup, Object.class, void.class);
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class);
+
+        // unnamed
+        findConstructor(lookup, unnamedClass, void.class);
+    }
+
+    /**
+     * Hop to lookup class in another named module
+     *
+     * [A0] has no access
+     */
+    public void testFromNamedToNamedModule() throws Exception {
+        Lookup lookup = MethodHandles.lookup().in(q1_Type1);
+        assertTrue(lookup.lookupModes() == 0); // [A0]
+
+        // m1
+        findConstructorExpectingIAE(lookup, p1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, p2_Type2, void.class);
+
+        // m2
+        findConstructorExpectingIAE(lookup, q1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class);
+
+        // java.base
+        findConstructorExpectingIAE(lookup, Object.class, void.class);
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class);
+
+        // unnamed
+        findConstructorExpectingIAE(lookup, unnamedClass, void.class);
+    }
+
+    /**
+     * Hop to lookup class in an unnamed module
+     *
+     * [A0] has no access
+     */
+    public void testFromNamedToUnnamedModule() throws Exception {
+        Lookup lookup = MethodHandles.lookup().in(unnamedClass);
+        assertTrue(lookup.lookupModes() == 0); // [A0]
+
+        // m1
+        findConstructorExpectingIAE(lookup, p1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, p2_Type2, void.class);
+
+        // m2
+        findConstructorExpectingIAE(lookup, q1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class);
+
+        // java.base
+        findConstructorExpectingIAE(lookup, Object.class, void.class);
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class);
+
+        // unnamed
+        findConstructorExpectingIAE(lookup, unnamedClass, void.class);
+    }
+
+    /**
+     * Hop from unnamed to named module.
+     *
+     * [A0] retains PUBLIC access
+     */
+    public void testFromUnnamedToNamedModule() throws Exception {
+        Lookup lookup = MethodHandles.lookup();
+        lookup = MethodHandles.privateLookupIn(unnamedClass, lookup).in(p1_Type1);
+        assertTrue(lookup.lookupModes() == PUBLIC); // A0
+
+        // m1
+        findConstructor(lookup, p1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, p2_Type2, void.class);
+
+        // m2
+        findConstructor(lookup, q1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class);
+
+        // java.base
+        findConstructor(lookup, Object.class, void.class);
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class);
+
+        // unnamed
+        findConstructor(lookup, unnamedClass, void.class);
+    }
+
+    /**
+     * MethodHandles.publicLookup()
+     *
+     * [A0] has PUBLIC|UNCONDITIONAL access
+     */
+    public void testPublicLookup() throws Exception {
+        Lookup lookup = MethodHandles.publicLookup();
+        assertTrue(lookup.lookupModes() == (PUBLIC|UNCONDITIONAL)); // A0
+
+        // m1
+        findConstructor(lookup, p1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, p2_Type2, void.class);
+
+        // m2
+        findConstructor(lookup, q1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class);
+
+        // java.base
+        findConstructor(lookup, Object.class, void.class);
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class);
+
+        // unnamed
+        findConstructor(lookup, unnamedClass, void.class);
+    }
+
+    /**
+     * Hop from publicLookup to accessible type in java.base
+     */
+    public void testPublicLookupToBaseModule() throws Exception {
+        Lookup lookup = MethodHandles.publicLookup().in(String.class);
+        assertTrue(lookup.lookupModes() == PUBLIC); // A0
+
+        // m1
+        findConstructorExpectingIAE(lookup, p1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, p2_Type2, void.class);
+
+        // m2
+        findConstructorExpectingIAE(lookup, q1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class);
+
+        // java.base
+        findConstructor(lookup, Object.class, void.class);
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class);
+
+        // unnamed
+        findConstructorExpectingIAE(lookup, unnamedClass, void.class);
+    }
+
+
+    /**
+     * Hop from publicLookup to accessible type in named module.
+     *
+     * [A0] has PUBLIC access
+     */
+    public void testPublicLookupToAccessibleTypeInNamedModule() throws Exception {
+        Lookup lookup = MethodHandles.publicLookup().in(p1_Type1);
+        assertTrue(lookup.lookupModes() == PUBLIC); // A0
+
+        // m1
+        findConstructor(lookup, p1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, p2_Type2, void.class);
+
+        // m2
+        findConstructor(lookup, q1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class);
+
+        // java.base
+        findConstructor(lookup, Object.class, void.class);
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class);
+
+        // unnamed
+        findConstructor(lookup, unnamedClass, void.class);
+    }
+
+    /**
+     * Teleport from publicLookup to inaccessible type in named module.
+     *
+     * [A0] has no access
+     */
+    public void testPublicLookupToInaccessibleTypeInNamedModule() throws Exception {
+        Lookup lookup = MethodHandles.publicLookup().in(p2_Type2);
+        assertTrue(lookup.lookupModes() == 0); // A0
+
+        // m1
+        findConstructorExpectingIAE(lookup, p1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, p2_Type2, void.class);
+
+        // m2
+        findConstructorExpectingIAE(lookup, q1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class);
+
+        // java.base
+        findConstructorExpectingIAE(lookup, Object.class, void.class);
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class);
+
+        // unnamed
+        findConstructorExpectingIAE(lookup, unnamedClass, void.class);
+    }
+
+    /**
+     * Teleport from publicLookup to public type in unnamed module
+     *
+     * [A0] has PUBLIC access
+     */
+    public void testPublicLookupToUnnamedModule() throws Exception {
+        Lookup lookup = MethodHandles.publicLookup().in(unnamedClass);
+        assertTrue(lookup.lookupModes() == PUBLIC); // A0
+
+        // m1
+        findConstructor(lookup, p1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, p2_Type2, void.class);
+
+        // m2
+        findConstructor(lookup, q1_Type1, void.class);
+        findConstructorExpectingIAE(lookup, q2_Type2, void.class);
+
+        // java.base
+        findConstructor(lookup, Object.class, void.class);
+        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class);
+
+        // unnamed
+        findConstructor(lookup, unnamedClass, void.class);
+    }
+
+    /**
+     * Invokes Lookup findConstructor with a method type constructored from the
+     * given return and parameter types, expecting IllegalAccessException to be
+     * thrown.
+     */
+    static void findConstructorExpectingIAE(Lookup lookup,
+                                            Class<?> clazz,
+                                            Class<?> rtype,
+                                            Class<?>... ptypes) throws Exception {
+        try {
+            findConstructor(lookup, clazz, rtype, ptypes);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+    }
+
+    /**
+     * Invokes Lookup findConstructor with a method type constructored from the
+     * given return and parameter types.
+     */
+    static MethodHandle findConstructor(Lookup lookup,
+                                        Class<?> clazz,
+                                        Class<?> rtype,
+                                        Class<?>... ptypes) throws Exception {
+        MethodType mt = MethodType.methodType(rtype, ptypes);
+        return lookup.findConstructor(clazz, mt);
+    }
+}
diff --git a/jdk/test/java/lang/invoke/modules/src/m1/p1/Type1.java b/jdk/test/java/lang/invoke/modules/m1/p1/Type1.java
similarity index 100%
rename from jdk/test/java/lang/invoke/modules/src/m1/p1/Type1.java
rename to jdk/test/java/lang/invoke/modules/m1/p1/Type1.java
diff --git a/jdk/test/java/lang/invoke/modules/src/m1/p2/Type2.java b/jdk/test/java/lang/invoke/modules/m1/p2/Type2.java
similarity index 100%
rename from jdk/test/java/lang/invoke/modules/src/m1/p2/Type2.java
rename to jdk/test/java/lang/invoke/modules/m1/p2/Type2.java
diff --git a/jdk/test/java/lang/invoke/modules/src/m2/module-info.java b/jdk/test/java/lang/invoke/modules/m2/module-info.java
similarity index 100%
rename from jdk/test/java/lang/invoke/modules/src/m2/module-info.java
rename to jdk/test/java/lang/invoke/modules/m2/module-info.java
diff --git a/jdk/test/java/lang/invoke/modules/src/m2/q1/Type1.java b/jdk/test/java/lang/invoke/modules/m2/q1/Type1.java
similarity index 100%
rename from jdk/test/java/lang/invoke/modules/src/m2/q1/Type1.java
rename to jdk/test/java/lang/invoke/modules/m2/q1/Type1.java
diff --git a/jdk/test/java/lang/invoke/modules/src/m2/q2/Type2.java b/jdk/test/java/lang/invoke/modules/m2/q2/Type2.java
similarity index 100%
rename from jdk/test/java/lang/invoke/modules/src/m2/q2/Type2.java
rename to jdk/test/java/lang/invoke/modules/m2/q2/Type2.java
diff --git a/jdk/test/java/lang/invoke/modules/src/m1/module-info.java b/jdk/test/java/lang/invoke/modules/src/m1/module-info.java
deleted file mode 100644
index 175c772..0000000
--- a/jdk/test/java/lang/invoke/modules/src/m1/module-info.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-module m1 {
-    requires m2;
-    exports p1;
-}
diff --git a/jdk/test/java/lang/invoke/modules/src/m1/p1/Main.java b/jdk/test/java/lang/invoke/modules/src/m1/p1/Main.java
deleted file mode 100644
index 3fd1a0e..0000000
--- a/jdk/test/java/lang/invoke/modules/src/m1/p1/Main.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package p1;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodHandles.Lookup;
-import java.lang.invoke.MethodType;
-
-/**
- * Basic test case for module access check, supplements AccessControlTest.
- *
- * The tests consists of two modules:
- *
- * module m1 { requires m2; exports p1; }
- * module m2 { exports q1; }
- *
- * Both modules read java.base (as every module reads java.base)
- *
- * module m1 has public types in packages p1 and p2, p2 is not exported.
- * module m2 has public types in packages q1 and q2, q2 is not exported.
- */
-
-public class Main {
-
-    static final int MODULE = Lookup.MODULE;
-
-    // Use Class.forName to get classes for test because some
-    // are not accessible at compile-time
-
-    static final Class<?> p1_Type1;        // m1, exported
-    static final Class<?> p2_Type2;        // m1, not exported
-    static final Class<?> q1_Type1;        // m2, exported, m1 reads m2
-    static final Class<?> q2_Type2;        // m2, not exported, m1 reads m2
-    static final Class<?> x500NameClass;   // java.base, not exported
-
-    static {
-        try {
-            p1_Type1 = Class.forName("p1.Type1");
-            p2_Type2 = Class.forName("p2.Type2");
-            q1_Type1 = Class.forName("q1.Type1");
-            q2_Type2 = Class.forName("q2.Type2");
-            x500NameClass = Class.forName("sun.security.x509.X500Name");
-        } catch (ClassNotFoundException e) {
-            throw new AssertionError(e);
-        }
-    }
-
-    public static void main(String[] args) throws Exception {
-        Lookup lookup, lookup2;
-
-        /**
-         * MethodHandles.lookup()
-         * has module access [A0]
-         * can access all public types in m1 [A1]
-         * can access public types in packages exported by modules that m1 reads [A2]
-         * cannot access public types in non-exported modules of modules that m1 reads [A3]
-         */
-        lookup = MethodHandles.lookup();
-        assertTrue((lookup.lookupModes() & MODULE) == MODULE); // [A0]
-        findConstructor(lookup, p1_Type1, void.class); // [A1]
-        findConstructor(lookup, p2_Type2, void.class); // [A1]
-        findConstructor(lookup, q1_Type1, void.class); // [A2]
-        findConstructorExpectingIAE(lookup, q2_Type2, void.class); // [A3]
-        findConstructor(lookup, Object.class, void.class); // [A2]
-        findConstructorExpectingIAE(lookup, x500NameClass, void.class, String.class); // [A3]
-
-        /**
-         * Teleport from MethodHandles.lookup() to lookup class in the same module
-         * module access is retained [A0]
-         * can access all public types in m1 [A1]
-         * can access public types in packages exported by modules that m1 reads [A2]
-         * cannot access public types in non-exported modules of modules that m1 reads [A3]
-         */
-        lookup2 = lookup.in(p2_Type2);
-        assertTrue((lookup2.lookupModes() & MODULE) == MODULE); // [A0]
-        findConstructor(lookup2, p1_Type1, void.class); // [A1]
-        findConstructor(lookup2, p2_Type2, void.class); // [A1]
-        findConstructor(lookup2, q1_Type1, void.class); // [A2]
-        findConstructorExpectingIAE(lookup2, q2_Type2, void.class); // [A3]
-        findConstructor(lookup2, Object.class, void.class); // [A2]
-        findConstructorExpectingIAE(lookup2, x500NameClass, void.class, String.class); // [A3]
-
-        /**
-         * Teleport from MethodHandles.lookup() to lookup class in another named module
-         * has no access [A0]
-         */
-        lookup2 = lookup.in(Object.class);
-        assertTrue(lookup2.lookupModes() == 0); // [A0]
-        findConstructorExpectingIAE(lookup2, Object.class, void.class);  // [A0]
-
-        /**
-         * Teleport from MethodHandles.lookup() to lookup class in an unnamed module
-         * has no access [A0]
-         */
-        Class<?> c = MethodHandles.publicLookup().lookupClass();
-        assertTrue(!c.getModule().isNamed());
-        lookup2 = lookup.in(c);
-        assertTrue(lookup2.lookupModes() == 0); // [A0]
-        findConstructorExpectingIAE(lookup2, Object.class, void.class);
-
-        /**
-         * MethodHandles.publicLookup()
-         * has no module access [A0]
-         * can access public types in exported packages [A1]
-         * cannot access public types in non-exported packages [A2]
-         */
-        lookup = MethodHandles.publicLookup();
-        assertTrue((lookup.lookupModes() & MODULE) == 0); // [A0]
-        findConstructor(lookup, p1_Type1, void.class); // [A1]
-        findConstructorExpectingIAE(lookup, p2_Type2, void.class); // [A1]
-        findConstructor(lookup, q1_Type1, void.class); // [A1]
-        findConstructorExpectingIAE(lookup, q2_Type2, void.class); // [A2]
-        findConstructor(lookup, Object.class, void.class); // [A1]
-        findConstructorExpectingIAE(lookup, x500NameClass, void.class); // [A2]
-
-        /**
-         * Teleport from MethodHandles.publicLookup() to lookup class in java.base
-         * has no module access [A0]
-         * can access public types in packages exported by java.base [A1]
-         * cannot access public types in non-exported packages [A2]
-         * no access to types in other named modules [A3]
-         */
-        lookup2 = lookup.in(Object.class);
-        assertTrue((lookup2.lookupModes() & MODULE) == 0); // [A0]
-        findConstructor(lookup2, String.class, void.class); // [A1]
-        findConstructorExpectingIAE(lookup2, x500NameClass, void.class, String.class); // [A2]
-        findConstructorExpectingIAE(lookup2, p1_Type1, void.class); // [A3]
-        findConstructorExpectingIAE(lookup2, q1_Type1, void.class); // [A3]
-
-        /**
-         * Teleport from MethodHandles.publicLookup() to lookup class in m1
-         * has no module access [A0]
-         * can access public types in packages exported by m1, m2 and java.base [A1]
-         * cannot access public types is non-exported packages [A2]
-         */
-        lookup2 = lookup.in(p1_Type1);
-        assertTrue((lookup2.lookupModes() & MODULE) == 0); // [A0]
-        findConstructor(lookup2, p1_Type1, void.class);  // [A1]
-        findConstructor(lookup2, q1_Type1, void.class);  // [A1]
-        findConstructor(lookup2, Object.class, void.class);  // [A1]
-        findConstructorExpectingIAE(lookup, p2_Type2, void.class); // [A2]
-        findConstructorExpectingIAE(lookup, q2_Type2, void.class); // [A2]
-        findConstructorExpectingIAE(lookup2, x500NameClass, void.class, String.class); // [A2]
-
-        /**
-         * Teleport from MethodHandles.publicLookup() to lookup class in m2
-         * has no module access [A0]
-         * can access public types in packages exported by m2 and java.base [A1]
-         * cannot access public types is non-exported packages or modules that m2 does
-         *   not read [A2]
-         */
-        lookup2 = lookup.in(q1_Type1);
-        assertTrue((lookup2.lookupModes() & MODULE) == 0); // [A0]
-        findConstructor(lookup2, q1_Type1, void.class); // [A1]
-        findConstructor(lookup2, Object.class, void.class); // [A1]
-        findConstructorExpectingIAE(lookup2, p1_Type1, void.class); // [A2]
-        findConstructorExpectingIAE(lookup, q2_Type2, void.class); // [A2]
-        findConstructorExpectingIAE(lookup2, x500NameClass, void.class, String.class);  // [A2]
-
-        /**
-         * Teleport from MethodHandles.publicLookup() to lookup class that is not
-         * in an exported package, should get no access [A0]
-         */
-        lookup2 = lookup.in(p2_Type2);
-        assertTrue(lookup2.lookupModes()  == 0); // [A0]
-        findConstructorExpectingIAE(lookup, q2_Type2, void.class); // [A0]
-    }
-
-    /**
-     * Invokes Lookup findConstructor with a method type constructored from the
-     * given return and parameter types, expecting IllegalAccessException to be
-     * thrown.
-     */
-    static MethodHandle findConstructorExpectingIAE(Lookup lookup,
-                                                    Class<?> clazz,
-                                                    Class<?> rtype,
-                                                    Class<?>... ptypes) throws Exception {
-        try {
-            findConstructor(lookup, clazz, rtype, ptypes);
-            throw new RuntimeException("IllegalAccessError expected");
-        } catch (IllegalAccessException expected) {
-            return null;
-        }
-    }
-
-    /**
-     * Invokes Lookup findConstructor with a method type constructored from the
-     * given return and parameter types.
-     */
-    static MethodHandle findConstructor(Lookup lookup,
-                                        Class<?> clazz,
-                                        Class<?> rtype,
-                                        Class<?>... ptypes) throws Exception {
-        MethodType mt = MethodType.methodType(rtype, ptypes);
-        return lookup.findConstructor(clazz, mt);
-    }
-
-    static void assertTrue(boolean condition) {
-        if (!condition)
-            throw new RuntimeException();
-    }
-
-}
diff --git a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java
index 83fa68e..203e263 100644
--- a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java
+++ b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java
@@ -28,7 +28,7 @@
  *                             ClassLoadingMXBean.getTotalLoadedClassCount()
  *                             ClassLoadingMXBean.getUnloadedClassCount()
  * @author  Alexei Guibadoulline
- * @modules java.management
+ *
  * @run main/othervm LoadCounts
  */
 
diff --git a/jdk/test/java/lang/management/CompilationMXBean/Basic.java b/jdk/test/java/lang/management/CompilationMXBean/Basic.java
index c9738cc..fd98e5d 100644
--- a/jdk/test/java/lang/management/CompilationMXBean/Basic.java
+++ b/jdk/test/java/lang/management/CompilationMXBean/Basic.java
@@ -26,7 +26,6 @@
  * @bug 5011189 8004928
  * @summary Unit test for java.lang.management.CompilationMXBean
  *
- * @modules java.management
  * @run main/othervm -Xcomp -Xbatch Basic
  */
 import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java b/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java
index cd0df92..3d6da59 100644
--- a/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java
+++ b/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java
@@ -28,7 +28,6 @@
  *          or throw exception if the input CompositeData is invalid.
  * @author  Mandy Chung
  *
- * @modules java.management
  * @build MemoryUsageCompositeData
  * @run main MemoryUsageCompositeData
  */
diff --git a/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java b/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java
index 1a84226..3510b51 100644
--- a/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java
+++ b/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java
@@ -29,7 +29,6 @@
  *          the input CompositeData is invalid.
  * @author  Mandy Chung
  *
- * @modules java.management
  * @compile OpenTypeConverter.java
  * @build ThreadInfoCompositeData
  * @run main ThreadInfoCompositeData
diff --git a/jdk/test/java/lang/management/ManagementFactory/DefaultManagementProviderTest.java b/jdk/test/java/lang/management/ManagementFactory/DefaultManagementProviderTest.java
index 70c4109..e9ccd51 100644
--- a/jdk/test/java/lang/management/ManagementFactory/DefaultManagementProviderTest.java
+++ b/jdk/test/java/lang/management/ManagementFactory/DefaultManagementProviderTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @bug 8151099
  * @summary Verify platform MXBeans initialized properly with java.management
  *          module only. No other management provider
+ * @modules java.management
  * @run main/othervm --limit-modules=java.management DefaultManagementProviderTest
  */
 import java.lang.management.ManagementFactory;
diff --git a/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java b/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java
index f8d3aac..d76bd2c 100644
--- a/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java
+++ b/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java
@@ -26,7 +26,7 @@
  * @summary Test if getObjectName handles properly when called by
  *          multiple threads simultaneously. Run in othervm mode to
  *          make sure the object name is not initialized to begin with.
- * @modules java.management
+ *
  * @run main/othervm GetObjectName
  */
 
diff --git a/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java b/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java
index 56f94fd..4d62de5 100644
--- a/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java
+++ b/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java
@@ -28,7 +28,6 @@
  *          methods and PlatformManagedObject.getObjectName()
  * @author  Mandy Chung
  *
- * @modules jdk.management
  * @run main GetPlatformMXBeans
  */
 
diff --git a/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java b/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java
index 307c6fc..98ace42 100644
--- a/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java
+++ b/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java
@@ -28,7 +28,6 @@
  *          ManagementFactory.getPlatformManagementInterfaces() method
  * @author  Frederic Parain
  *
- * @modules jdk.management
  * @run main GetPlatformManagementInterfaces
  */
 
diff --git a/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java b/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java
index 97b3c0e..4aef286 100644
--- a/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java
+++ b/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java
@@ -27,7 +27,7 @@
  * @summary Test that all the platform MXBeans are wrapped in StandardMBean so
  *          an MBeanServer which does not have support for MXBeans can be used.
  * @author Luis-Miguel Alventosa
- * @modules jdk.management
+ *
  * @run clean MBeanServerMXBeanUnsupportedTest
  * @run build MBeanServerMXBeanUnsupportedTest
  * @run main/othervm MBeanServerMXBeanUnsupportedTest
diff --git a/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java b/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java
index 2f7d639..40ec878 100644
--- a/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java
+++ b/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java
@@ -29,7 +29,6 @@
  *
  * @author  Mandy Chung
  *
- * @modules jdk.management
  * @build MXBeanException
  * @run main MXBeanException
  */
diff --git a/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java b/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java
index 73aa639..f9586e9 100644
--- a/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java
+++ b/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java
@@ -25,9 +25,9 @@
  * @test
  * @bug     5024531
  * @summary Basic Test for ManagementFactory.newPlatformMXBean().
- * @modules jdk.management
- * @run main/othervm MXBeanProxyTest
  * @author  Mandy Chung
+ *
+ * @run main/othervm MXBeanProxyTest
  */
 import javax.management.*;
 import java.lang.management.ClassLoadingMXBean;
diff --git a/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java b/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java
index b7c469a..509a18d 100644
--- a/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java
+++ b/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java
@@ -26,7 +26,9 @@
  * @bug     4947536
  * @summary Basic unit test of ManagementFactory.getPlatformMBeanServer()
  * @author  Mandy Chung
- * @modules jdk.management
+ *
+ * @modules java.logging
+ *          jdk.management
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java b/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java
index 7916867..f55b0d7 100644
--- a/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java
+++ b/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java
@@ -27,7 +27,6 @@
  * @summary Test type mapping of the platform MXBean proxy
  *          returned from Management.newPlatformMXBeanProxy().
  * @author  Mandy Chung
- * @modules jdk.management
  */
 import java.lang.management.*;
 import javax.management.*;
diff --git a/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java b/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java
index 516c75a..ed95bc8 100644
--- a/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java
+++ b/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java
@@ -28,7 +28,6 @@
  *          returned from Management.newPlatformMXBeanProxy().
  * @author  Mandy Chung
  *
- * @modules jdk.management
  * @compile ProxyTypeMapping.java
  * @run main/othervm -verbose:gc ProxyTypeMapping
  */
diff --git a/jdk/test/java/lang/management/ManagementFactory/TEST.properties b/jdk/test/java/lang/management/ManagementFactory/TEST.properties
new file mode 100644
index 0000000..b6ae420
--- /dev/null
+++ b/jdk/test/java/lang/management/ManagementFactory/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.management
+
diff --git a/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java b/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java
index dc3c97f..3d46963b 100644
--- a/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java
+++ b/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java
@@ -26,10 +26,8 @@
  * @bug     5086470 6358247 7193302
  * @summary Test type conversion when invoking ThreadMXBean.dumpAllThreads
  *          through proxy.
- *
  * @author  Mandy Chung
  *
- * @modules jdk.management
  * @run main ThreadMXBeanProxy
  */
 
diff --git a/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java b/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java
index ab2bbad..f5ada9f 100644
--- a/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java
+++ b/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java
@@ -28,7 +28,6 @@
  *          MBeanServer.
  * @author  Mandy Chung
  *
- * @modules jdk.management
  * @compile ValidateOpenTypes.java
  * @run main/othervm -verbose:gc ValidateOpenTypes
  */
diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java
index 6d4fae0..d029c8f 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java
+++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java
@@ -27,17 +27,16 @@
  * @summary Basic unit test of memory management testing:
  *          1) setUsageThreshold() and getUsageThreshold()
  *          2) test low memory detection on the old generation.
- *
  * @author  Mandy Chung
  *
- * @library /lib/testlibrary/
- * @modules java.management
- * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
- * @run main/timeout=600 LowMemoryTest
  * @requires vm.gc == "null"
  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
  * @requires vm.opt.DisableExplicitGC != "true"
+ * @library /lib/testlibrary/
+ *
+ * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
+ * @run main/timeout=600 LowMemoryTest
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh
index ee3a351..515cb8f 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh
@@ -25,8 +25,9 @@
 # @test
 # @bug     4982128
 # @summary Test low memory detection of non-heap memory pool
+#
 # @requires vm.gc=="null"
-# @modules java.management
+#
 # @run build LowMemoryTest2 MemoryUtil
 # @run shell/timeout=600 LowMemoryTest2.sh
 #
@@ -51,10 +52,10 @@
 }
 
 # Run test with each GC configuration
-# 
+#
 # Notes: To ensure that metaspace fills up we disable class unloading.
 # Also we set the max metaspace to 8MB - otherwise the test takes too
-# long to run. 
+# long to run.
 
 go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseSerialGC LowMemoryTest2
 go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseParallelGC LowMemoryTest2
diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh
index 1a0b02d..563ffe3 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh
@@ -26,8 +26,9 @@
 # @bug     4530538
 # @summary Run MemoryManagement test with concurrent mark sweep GC
 # @author  Mandy Chung
+#
 # @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
-# @modules java.management
+#
 # @run build MemoryManagement
 # @run shell/timeout=600 MemoryManagementConcMarkSweepGC.sh
 #
@@ -42,7 +43,7 @@
 fi
 
 runOne()
-{ 
+{
    echo "runOne $@"
    $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
 }
diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh
index f04f6d4..ebe7e52 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh
@@ -26,8 +26,9 @@
 # @bug     4530538
 # @summary Run MemoryManagement test with parallel GC
 # @author  Mandy Chung
+#
 # @requires vm.gc=="Parallel" | vm.gc=="null"
-# @modules java.management
+#
 # @run build MemoryManagement
 # @run shell/timeout=600 MemoryManagementParallelGC.sh
 #
@@ -42,7 +43,7 @@
 fi
 
 runOne()
-{ 
+{
    echo "runOne $@"
    $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
 }
diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh
index 567aea7..f9de8f5 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh
@@ -26,8 +26,9 @@
 # @bug     4530538
 # @summary Run MemoryManagement test with serial GC
 # @author  Mandy Chung
+#
 # @requires vm.gc=="Serial" | vm.gc=="null"
-# @modules java.management
+#
 # @run build MemoryManagement
 # @run shell/timeout=600 MemoryManagementSerialGC.sh
 #
@@ -42,7 +43,7 @@
 fi
 
 runOne()
-{ 
+{
    echo "runOne $@"
    $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
 }
diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh
index 4a8eea2..d66ba73 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh
@@ -24,10 +24,11 @@
 #
 # @test
 # @bug     4530538
-# @summary 
+# @summary
 # @author  Mandy Chung
+#
 # @requires vm.gc=="Parallel" | vm.gc=="null"
-# @modules java.management
+#
 # @run compile MemoryTest.java
 # @run shell MemoryTestAllGC.sh
 #
@@ -42,7 +43,7 @@
 fi
 
 runOne()
-{ 
+{
    echo "runOne $@"
    $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
 }
diff --git a/jdk/test/java/lang/management/MemoryMXBean/Pending.java b/jdk/test/java/lang/management/MemoryMXBean/Pending.java
index 1567082..fb7a9e6 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java
+++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java
@@ -24,8 +24,6 @@
 /*
  * @test
  * @bug     4530538
- * @modules java.base/jdk.internal.misc
- *          java.management
  * @summary Basic unit test of
  *          RuntimeMXBean.getObjectPendingFinalizationCount()
  *          1. GC and runFinalization() to get the current pending number
@@ -34,6 +32,9 @@
  *          4. GC and runFinalization() and the finalizable objects should
  *             be garbage collected.
  * @author  Alexei Guibadoulline and Mandy Chung
+ *
+ * @modules java.base/jdk.internal.misc
+ *          java.management
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java
index 2d52eeb..a3d69a9 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java
+++ b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java
@@ -32,13 +32,14 @@
  * @summary Basic Test for MemoryPool.resetPeakUsage()
  * @author  Mandy Chung
  *
- * @library /lib/testlibrary/
- * @modules jdk.management
- * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil
- * @run main ResetPeakMemoryUsage
  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  * @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
  * @requires vm.opt.DisableExplicitGC != "true"
+ * @library /lib/testlibrary/
+ * @modules jdk.management
+ *
+ * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil
+ * @run main ResetPeakMemoryUsage
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java
index 7f49e73..03038a6 100644
--- a/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java
+++ b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java
@@ -28,7 +28,6 @@
  *          MemoryPoolMXBean.isCollectionThresholdExceeded().
  * @author  Mandy Chung
  *
- * @modules java.management
  * @run main/othervm ThresholdTest
  */
 
diff --git a/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh b/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
index 0e9ad0f..dcef82b 100644
--- a/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
+++ b/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
@@ -23,11 +23,10 @@
 
 #
 # @test
+# @bug      6336608 6367473 6511738
 # @summary  Tests OperatingSystemMXBean.getSystemLoadAverage() api.
 # @author   Mandy Chung
-# @bug      6336608 6367473 6511738
 #
-# @modules java.management
 # @run build GetSystemLoadAverage
 # @run shell/timeout=300 TestSystemLoadAvg.sh
 #
diff --git a/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java b/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java
index 2cdd895..55aa90c 100644
--- a/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java
+++ b/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java
@@ -27,7 +27,6 @@
  * @summary Test if proxy for PlatformLoggingMXBean is equivalent
  *          to proxy for LoggingMXBean
  *
- * @modules jdk.management
  * @build LoggingMXBeanTest
  * @run main LoggingMXBeanTest
  */
diff --git a/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java b/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java
index 63f5c5f..9b9779a 100644
--- a/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java
+++ b/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java
@@ -24,12 +24,10 @@
 /*
  * @test
  * @bug     6876135 7024172 7067691
- *
  * @summary Test PlatformLoggingMXBean
  *          This test performs similar testing as
  *          java/util/logging/LoggingMXBeanTest.
  *
- * @modules jdk.management
  * @build PlatformLoggingMXBeanTest
  * @run main PlatformLoggingMXBeanTest
  */
diff --git a/jdk/test/java/lang/management/PlatformLoggingMXBean/TEST.properties b/jdk/test/java/lang/management/PlatformLoggingMXBean/TEST.properties
new file mode 100644
index 0000000..53fa38c
--- /dev/null
+++ b/jdk/test/java/lang/management/PlatformLoggingMXBean/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.logging
+
diff --git a/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java b/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java
index a024868..5f69235 100644
--- a/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java
+++ b/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java
@@ -26,7 +26,6 @@
  * @bug     4990512
  * @summary Basic Test for RuntimeMXBean.getSystemProperties().
  * @author  Mandy Chung
- * @modules java.management
  */
 
 import java.lang.management.ManagementFactory;
diff --git a/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java b/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java
index 47ba46a..1d9bff4 100644
--- a/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java
+++ b/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java
@@ -28,7 +28,6 @@
  *          properties contain another list of properties as the defaults.
  * @author  Mandy Chung
  *
- * @modules java.management
  * @run build PropertiesTest
  * @run main  PropertiesTest
  */
diff --git a/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh b/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh
index d76b2bd..409ce8f 100644
--- a/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh
+++ b/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh
@@ -24,9 +24,9 @@
 #
 # @test
 # @bug     4530538
-# @summary 
+# @summary
 # @author  Mandy Chung
-# @modules java.management
+#
 # @run compile InputArgument.java
 # @run shell TestInputArgument.sh
 #
@@ -41,12 +41,12 @@
 fi
 
 runOne()
-{ 
+{
    echo "runOne $@"
    $TESTJAVA/bin/java $TESTVMOPTS -classpath $TESTCLASSES "$@" || exit 2
 }
 
-runOne InputArgument 
+runOne InputArgument
 
 runOne -XX:+UseFastJNIAccessors -Xlog:gc*=debug InputArgument
 runOne -XX:+UseFastJNIAccessors -Xlog:gc*=debug InputArgument -XX:+UseFastJNIAccessors
diff --git a/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java
index aa529c9..153e3b8 100644
--- a/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java
+++ b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java
@@ -26,7 +26,6 @@
  * @bug     4530538
  * @summary Basic unit test of RuntimeMXBean.getUptime()
  * @author  Alexei Guibadoulline
- * @modules java.management
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/TEST.properties b/jdk/test/java/lang/management/TEST.properties
new file mode 100644
index 0000000..81cb3fc
--- /dev/null
+++ b/jdk/test/java/lang/management/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.management
+
diff --git a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java
index 167469b..1bb57d4 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java
@@ -24,11 +24,10 @@
 /*
  * @test
  * @bug     4530538
+ * @key intermittent
  * @summary Basic unit test of ThreadMXBean.getAllThreadIds()
  * @author  Alexei Guibadoulline and Mandy Chung
  *
- * @key intermittent
- * @modules java.management
  * @run main/othervm AllThreadIds
  */
 
diff --git a/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java b/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java
index 759abf9..eaf07fe 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java
@@ -27,7 +27,6 @@
  * @summary The capability is disabled regardless of number of times
  *          it was enabled.
  * @author  Mandy Chung
- * @modules java.management
  */
 
 import java.lang.management.ThreadMXBean;
diff --git a/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java b/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java
index 0a3a658..ed16a8e 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java
@@ -29,7 +29,6 @@
  *          and ThreadMXBean.setThreadCpuTimeEnabled().
  * @author  Mandy Chung
  *
- * @modules java.management
  * @run main EnableTest
  */
 
diff --git a/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java
index b5a7702..c2fd2a6 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java
@@ -31,7 +31,6 @@
  *          - ThreadMXBean.findMonitorDeadlockedThreads()
  * @author  Mandy Chung
  *
- * @modules java.management
  * @build MonitorDeadlock
  * @build SynchronizerDeadlock
  * @build ThreadDump
diff --git a/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java b/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java
index 8833feb..6df7217 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java
@@ -28,7 +28,6 @@
  *          - ThreadMXBean.findMonitorDeadlockedThreads()
  * @author  Mandy Chung
  *
- * @modules java.management
  * @build MonitorDeadlock
  * @build ThreadDump
  * @run main/othervm FindMonitorDeadlock
diff --git a/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java b/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java
index 8f7608f..d178685 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java
@@ -28,7 +28,6 @@
  *          if id <= 0 and returns -1 if the thread doesn't exist.
  * @author  Mandy Chung
  *
- * @modules java.management
  * @run main InvalidThreadID
  */
 
diff --git a/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java b/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java
index 85a3ebf..6dad46d 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java
@@ -34,7 +34,6 @@
  *
  * @author  Mandy Chung
  *
- * @modules java.management
  * @build Barrier
  * @build LockingThread
  * @build ThreadDump
diff --git a/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java b/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java
index 95299d5..9032438 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java
@@ -30,7 +30,6 @@
  *
  * @author  Mandy Chung
  *
- * @modules java.management
  * @build Barrier
  * @build SynchronizerLockingThread
  * @build ThreadDump
diff --git a/jdk/test/java/lang/management/ThreadMXBean/Locks.java b/jdk/test/java/lang/management/ThreadMXBean/Locks.java
index 95fa29d..fa7a5b6 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/Locks.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/Locks.java
@@ -26,11 +26,11 @@
  * @bug     4530538
  * @summary Basic unit test of ThreadInfo.getLockName()
  *          and ThreadInfo.getLockOwnerName()
- * @library /lib/testlibrary
  * @author  Mandy Chung
  * @author  Jaroslav Bachorik
  *
- * @modules java.management
+ * @library /lib/testlibrary
+ *
  * @build jdk.testlibrary.*
  * @run main/othervm Locks
  */
diff --git a/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java b/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java
index 3c6b1a6..69094b1 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java
@@ -28,7 +28,6 @@
  *          and getThreadInfo of customized JSR-166 synchronizers.
  * @author  Mandy Chung
  *
- * @modules java.management
  * @build Barrier
  * @build ThreadDump
  * @run main/othervm MyOwnSynchronizer
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java b/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java
index 5253b68..414ee4b 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java
@@ -29,7 +29,6 @@
  * @author  Mandy Chung
  * @author  Jaroslav Bachorik
  *
- * @modules java.management
  * @build ResetPeakThreadCount
  * @build ThreadDump
  * @run main/othervm ResetPeakThreadCount
diff --git a/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java b/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java
index 4034830..c714486 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java
@@ -28,7 +28,6 @@
  *          in shared mode which has no owner when a thread is parked.
  * @author  Mandy Chung
  *
- * @modules java.management
  * @run main/othervm SharedSynchronizer
  */
 
diff --git a/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java b/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java
index 336389c..7d004ed 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java
@@ -25,11 +25,9 @@
  * @test
  * @bug     4530538
  * @summary Basic unit test of the synchronization statistics support:
- *
  * @author  Mandy Chung
  * @author  Jaroslav Bachorik
  *
- * @modules java.management
  * @run main/othervm SynchronizationStatistics
  */
 
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java
index 55c171c..b08eaa1 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java
@@ -27,7 +27,7 @@
  * @summary Basic unit test of ThreadInfo.getBlockedCount()
  * @author  Alexei Guibadoulline and Mandy Chung
  * @author  Jaroslav Bachorik
- * @modules java.management
+ *
  * @run main ThreadBlockedCount
  */
 
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java
index 094144a..265b4b2 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java
@@ -30,7 +30,6 @@
  *                             mbean.getDaemonThreadCount()
  * @author  Alexei Guibadoulline
  *
- * @modules java.management
  * @run main ThreadCounts
  */
 
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java
index ae9ddf63..61fff63 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java
@@ -27,7 +27,6 @@
  * @summary Basic test of ThreadMXBean.getThreadCpuTime and
  *          getCurrentThreadCpuTime.
  * @author  Mandy Chung
- * @modules java.management
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java
index 0ec3fa8..35cad89 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java
@@ -31,7 +31,6 @@
  * @bug     6588467
  * @summary Basic test of ThreadInfo.isDaemon
  * @author  Jeremy Manson
- * @modules java.management
  */
 public class ThreadDaemonTest {
 
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java
index 93bde6f..433a3f5 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java
@@ -26,7 +26,6 @@
  * @bug 5047639
  * @summary Check that the "java-level" APIs provide a consistent view of
  *          the thread list
- * @modules java.management
  */
 import java.lang.management.ManagementFactory;
 import java.lang.management.ThreadMXBean;
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java
index 492303a..6a9c9ca 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java
@@ -27,12 +27,11 @@
  * @summary Basic unit test of thread states returned by
  *          ThreadMXBean.getThreadInfo.getThreadState().
  *          It also tests lock information returned by ThreadInfo.
- *
  * @author  Mandy Chung
  *
  * @library ../../Thread
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @build jdk.testlibrary.*
  * @build ThreadMXBeanStateTest ThreadStateController
  * @run main ThreadMXBeanStateTest
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java
index e45ac93..4842d62 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java
@@ -28,7 +28,6 @@
  *          ThreadInfo.getThreadState()
  * @author  Mandy Chung
  *
- * @modules java.management
  * @run build Utils
  * @run main ThreadStackTrace
  */
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java
index c90daa9..8f38ef8 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java
@@ -27,7 +27,6 @@
  * @summary Basic test of ThreadMXBean.getThreadUserTime and
  *          getCurrentThreadUserTime.
  * @author  Mandy Chung
- * @modules java.management
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/java/lang/module/AutomaticModulesTest.java b/jdk/test/java/lang/module/AutomaticModulesTest.java
index 07d25b9..4fce2be 100644
--- a/jdk/test/java/lang/module/AutomaticModulesTest.java
+++ b/jdk/test/java/lang/module/AutomaticModulesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,13 +33,11 @@
 import java.lang.module.Configuration;
 import java.lang.module.FindException;
 import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleDescriptor.Exports;
 import java.lang.module.ModuleDescriptor.Requires.Modifier;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReference;
+import java.lang.module.ResolutionException;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -69,13 +67,8 @@
             { "foo.jar",                    "foo" },
             { "foo4j.jar",                  "foo4j", },
 
-            { "foo1.jar",                   "foo" },
-            { "foo1.2.jar",                 "foo" },
-            { "foo1.2.3.jar",               "foo" },
-
-            { "foo10.jar",                  "foo" },
-            { "foo10.20.jar",               "foo" },
-            { "foo10.20.30.jar",            "foo" },
+            { "foo1.jar",                   "foo1" },
+            { "foo10.jar",                  "foo10" },
 
             { "foo-1.jar",                  "foo/1" },
             { "foo-1.2.jar",                "foo/1.2" },
@@ -93,6 +86,9 @@
             { "foo-bar-10.jar",             "foo.bar/10" },
             { "foo-bar-10.20.jar",          "foo.bar/10.20" },
 
+            { "foo.bar1.jar",               "foo.bar1" },
+            { "foo.bar10.jar",              "foo.bar10" },
+
             { "foo-1.2-SNAPSHOT.jar",       "foo/1.2-SNAPSHOT" },
             { "foo-bar-1.2-SNAPSHOT.jar",   "foo.bar/1.2-SNAPSHOT" },
 
@@ -108,8 +104,12 @@
     public Object[][] createBadNames() {
         return new Object[][]{
 
-            { ".jar",     null },
-            { "_.jar",    null }
+            { ".jar",          null },
+            { "_.jar",         null },
+
+            { "foo.1.jar",     null },
+            { "1foo.jar",      null },
+            { "foo.1bar.jar",  null },
 
         };
     }
@@ -137,6 +137,7 @@
         assertTrue(mref.isPresent(), mn + " not found");
 
         ModuleDescriptor descriptor = mref.get().descriptor();
+        assertTrue(descriptor.isAutomatic());
         assertEquals(descriptor.name(), mn);
         if (vs == null) {
             assertFalse(descriptor.version().isPresent());
@@ -175,17 +176,14 @@
         assertTrue(mref.isPresent(), "m not found");
 
         ModuleDescriptor descriptor = mref.get().descriptor();
+        assertTrue(descriptor.isAutomatic());
 
         assertTrue(descriptor.packages().size() == 2);
         assertTrue(descriptor.packages().contains("p"));
         assertTrue(descriptor.packages().contains("q"));
 
-        Set<String> exports = descriptor.exports().stream()
-                .map(Exports::source)
-                .collect(Collectors.toSet());
-        assertTrue(exports.size() == 2);
-        assertTrue(exports.contains("p"));
-        assertTrue(exports.contains("q"));
+        assertTrue(descriptor.exports().isEmpty());
+        assertTrue(descriptor.opens().isEmpty());
     }
 
     /**
@@ -201,15 +199,13 @@
         assertTrue(mref.isPresent(), "m not found");
 
         ModuleDescriptor descriptor = mref.get().descriptor();
+        assertTrue(descriptor.isAutomatic());
 
         assertTrue(descriptor.packages().size() == 1);
         assertTrue(descriptor.packages().contains("p"));
 
-        Set<String> exports = descriptor.exports().stream()
-                .map(Exports::source)
-                .collect(Collectors.toSet());
-        assertTrue(exports.size() == 1);
-        assertTrue(exports.contains("p"));
+        assertTrue(descriptor.exports().isEmpty());
+        assertTrue(descriptor.opens().isEmpty());
     }
 
     /**
@@ -229,10 +225,10 @@
         assertTrue(mref.isPresent(), "m not found");
 
         ModuleDescriptor descriptor = mref.get().descriptor();
+        assertTrue(descriptor.isAutomatic());
 
-        assertTrue(descriptor.packages().size() == 2);
+        assertTrue(descriptor.packages().size() == 1);
         assertTrue(descriptor.packages().contains("p"));
-        assertTrue(descriptor.packages().contains("p.resources"));
     }
 
     /**
@@ -254,9 +250,17 @@
         String provider = "p.S1";
 
         Path tmpdir = Files.createTempDirectory(USER_DIR, "tmp");
+
+        // provider class
+        Path providerClass = tmpdir.resolve(provider.replace('.', '/') + ".class");
+        Files.createDirectories(providerClass.getParent());
+        Files.createFile(providerClass);
+
+        // services configuration file
         Path services = tmpdir.resolve("META-INF").resolve("services");
         Files.createDirectories(services);
         Files.write(services.resolve(service), Set.of(provider));
+
         Path dir = Files.createTempDirectory(USER_DIR, "mods");
         JarUtils.createJarFile(dir.resolve("m.jar"), tmpdir);
 
@@ -314,7 +318,7 @@
 
                 // service type         provider type
                 { "p.S",                "-" },
-                { "p.S",                ".S1" },
+                { "p.S",                "p..S1" },
                 { "p.S",                "S1." },
         };
     }
@@ -324,13 +328,41 @@
      * values or names.
      */
     @Test(dataProvider = "badproviders", expectedExceptions = FindException.class)
-    public void testBadProvideNames(String service, String provider)
+    public void testBadProviderNames(String service, String provider)
         throws IOException
     {
         Path tmpdir = Files.createTempDirectory(USER_DIR, "tmp");
+
+        // provider class
+        Path providerClass = tmpdir.resolve(provider.replace('.', '/') + ".class");
+        Files.createDirectories(providerClass.getParent());
+        Files.createFile(providerClass);
+
+        // services configuration file
         Path services = tmpdir.resolve("META-INF").resolve("services");
         Files.createDirectories(services);
         Files.write(services.resolve(service), Set.of(provider));
+
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        JarUtils.createJarFile(dir.resolve("m.jar"), tmpdir);
+
+        // should throw FindException
+        ModuleFinder.of(dir).findAll();
+    }
+
+    /**
+     * Test JAR file with META-INF/services configuration file listing a
+     * provider that is not in the module.
+     */
+    @Test(expectedExceptions = FindException.class)
+    public void testMissingProviderPackage() throws IOException {
+        Path tmpdir = Files.createTempDirectory(USER_DIR, "tmp");
+
+        // services configuration file
+        Path services = tmpdir.resolve("META-INF").resolve("services");
+        Files.createDirectories(services);
+        Files.write(services.resolve("p.S"), Set.of("q.P"));
+
         Path dir = Files.createTempDirectory(USER_DIR, "mods");
         JarUtils.createJarFile(dir.resolve("m.jar"), tmpdir);
 
@@ -352,11 +384,12 @@
         attrs.put(Attributes.Name.MAIN_CLASS, mainClass);
 
         Path dir = Files.createTempDirectory(USER_DIR, "mods");
-        createDummyJarFile(dir.resolve("m.jar"), man);
+        String entry = mainClass.replace('.', '/') + ".class";
+        createDummyJarFile(dir.resolve("m.jar"), man, entry);
 
         ModuleFinder finder = ModuleFinder.of(dir);
 
-        Configuration parent = Layer.boot().configuration();
+        Configuration parent = ModuleLayer.boot().configuration();
         Configuration cf = resolve(parent, finder, "m");
 
         ModuleDescriptor descriptor = findDescriptor(cf, "m");
@@ -366,20 +399,21 @@
     }
 
 
-    // Main-Class files that do not map to a legal Java identifier
+    // Main-Class files that do not map to a legal qualified type name
     @DataProvider(name = "badmainclass")
     public Object[][] createBadMainClass() {
         return new Object[][]{
 
+            { "Main",        null },
+            { "p..Main",     null },
             { "p-.Main",     null },
-            { ".Main",       null }
 
         };
     }
 
     /**
-     * Test that a JAR file with a Main-Class attribute that is not a valid
-     * Java identifier
+     * Test that a JAR file with a Main-Class attribute that is not a qualified
+     * type name.
      */
     @Test(dataProvider = "badmainclass", expectedExceptions = FindException.class)
     public void testBadMainClass(String mainClass, String ignore) throws IOException {
@@ -389,6 +423,24 @@
         attrs.put(Attributes.Name.MAIN_CLASS, mainClass);
 
         Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        String entry = mainClass.replace('.', '/') + ".class";
+        createDummyJarFile(dir.resolve("m.jar"), man, entry);
+
+        // should throw FindException
+        ModuleFinder.of(dir).findAll();
+    }
+
+    /**
+     * Test that a JAR file with a Main-Class attribute that is not in the module
+     */
+    @Test(expectedExceptions = FindException.class)
+    public void testMissingMainClassPackage() throws IOException {
+        Manifest man = new Manifest();
+        Attributes attrs = man.getMainAttributes();
+        attrs.put(Attributes.Name.MANIFEST_VERSION, "1.0.0");
+        attrs.put(Attributes.Name.MAIN_CLASS, "p.Main");
+
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
         createDummyJarFile(dir.resolve("m.jar"), man);
 
         // should throw FindException
@@ -405,7 +457,7 @@
      */
     public void testConfiguration1() throws Exception {
         ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("a")
+            = ModuleDescriptor.newModule("a")
                 .requires("b")
                 .requires("c")
                 .requires("java.base")
@@ -417,11 +469,11 @@
         createDummyJarFile(dir.resolve("c.jar"), "q/T.class");
 
         // module finder locates a and the modules in the directory
-        ModuleFinder finder
-            = ModuleFinder.compose(ModuleUtils.finderOf(descriptor1),
-                ModuleFinder.of(dir));
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+        ModuleFinder finder2 = ModuleFinder.of(dir);
+        ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
 
-        Configuration parent = Layer.boot().configuration();
+        Configuration parent = ModuleLayer.boot().configuration();
         Configuration cf = resolve(parent, finder, "a");
 
         assertTrue(cf.modules().size() == 3);
@@ -430,7 +482,7 @@
         assertTrue(cf.findModule("c").isPresent());
 
         ResolvedModule base = cf.findModule("java.base").get();
-        assertTrue(base.configuration() == Layer.boot().configuration());
+        assertTrue(base.configuration() == ModuleLayer.boot().configuration());
         ResolvedModule a = cf.findModule("a").get();
         ResolvedModule b = cf.findModule("b").get();
         ResolvedModule c = cf.findModule("c").get();
@@ -465,13 +517,13 @@
      */
     public void testInConfiguration2() throws IOException {
         ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("a")
+            = ModuleDescriptor.newModule("a")
                 .requires("b")
                 .requires("java.base")
                 .build();
 
         ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("b")
+            = ModuleDescriptor.newModule("b")
                 .requires("c")
                 .requires("java.base")
                 .build();
@@ -482,11 +534,11 @@
         createDummyJarFile(dir.resolve("d.jar"), "q/T.class");
 
         // module finder locates a and the modules in the directory
-        ModuleFinder finder
-            = ModuleFinder.compose(ModuleUtils.finderOf(descriptor1, descriptor2),
-                                   ModuleFinder.of(dir));
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+        ModuleFinder finder2 = ModuleFinder.of(dir);
+        ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
 
-        Configuration parent = Layer.boot().configuration();
+        Configuration parent = ModuleLayer.boot().configuration();
         Configuration cf = resolve(parent, finder, "a", "d");
 
         assertTrue(cf.modules().size() == 4);
@@ -502,7 +554,7 @@
         // readability
 
         ResolvedModule base = cf.findModule("java.base").get();
-        assertTrue(base.configuration() == Layer.boot().configuration());
+        assertTrue(base.configuration() == ModuleLayer.boot().configuration());
         ResolvedModule a = cf.findModule("a").get();
         ResolvedModule b = cf.findModule("b").get();
         ResolvedModule c = cf.findModule("c").get();
@@ -538,13 +590,13 @@
      */
     public void testInConfiguration3() throws IOException {
         ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("a")
+            = ModuleDescriptor.newModule("a")
                 .requires("b")
                 .requires("java.base")
                 .build();
 
         ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("b")
+            = ModuleDescriptor.newModule("b")
                 .requires(Set.of(Modifier.TRANSITIVE), "c")
                 .requires("java.base")
                 .build();
@@ -555,11 +607,11 @@
         createDummyJarFile(dir.resolve("d.jar"), "q/T.class");
 
         // module finder locates a and the modules in the directory
-        ModuleFinder finder
-            = ModuleFinder.compose(ModuleUtils.finderOf(descriptor1, descriptor2),
-                ModuleFinder.of(dir));
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+        ModuleFinder finder2 = ModuleFinder.of(dir);
+        ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
 
-        Configuration parent = Layer.boot().configuration();
+        Configuration parent = ModuleLayer.boot().configuration();
         Configuration cf = resolve(parent, finder, "a", "d");
 
         assertTrue(cf.modules().size() == 4);
@@ -569,7 +621,7 @@
         assertTrue(cf.findModule("d").isPresent());
 
         ResolvedModule base = cf.findModule("java.base").get();
-        assertTrue(base.configuration() == Layer.boot().configuration());
+        assertTrue(base.configuration() == ModuleLayer.boot().configuration());
         ResolvedModule a = cf.findModule("a").get();
         ResolvedModule b = cf.findModule("b").get();
         ResolvedModule c = cf.findModule("c").get();
@@ -609,11 +661,250 @@
 
 
     /**
-     * Basic test of Layer containing automatic modules
+     * Basic test to ensure that no automatic modules are resolved when
+     * an automatic module is not a root or required by other modules.
+     */
+    public void testInConfiguration4() throws IOException {
+        ModuleDescriptor descriptor1
+            = ModuleDescriptor.newModule("m1")
+                .requires("java.base")
+                .build();
+
+        // automatic modules
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        createDummyJarFile(dir.resolve("auto1.jar"), "p1/C.class");
+        createDummyJarFile(dir.resolve("auto2.jar"), "p2/C.class");
+        createDummyJarFile(dir.resolve("auto3.jar"), "p3/C.class");
+
+        // module finder locates m1 and the modules in the directory
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+        ModuleFinder finder2 =  ModuleFinder.of(dir);
+        ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
+
+        Configuration parent = ModuleLayer.boot().configuration();
+        Configuration cf = resolve(parent, finder, "m1");
+
+        // ensure that no automatic module is resolved
+        assertTrue(cf.modules().size() == 1);
+        assertTrue(cf.findModule("m1").isPresent());
+    }
+
+
+    /**
+     * Basic test to ensure that if an automatic module is resolved then
+     * all observable automatic modules are resolved.
+     */
+    public void testInConfiguration5() throws IOException {
+        // m1 requires m2
+        ModuleDescriptor descriptor1
+            = ModuleDescriptor.newModule("m1")
+                .requires("m2").build();
+
+        // m2 requires automatic module
+        ModuleDescriptor descriptor2
+            = ModuleDescriptor.newModule("m2")
+                .requires("auto1")
+                .build();
+
+        // automatic modules
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        createDummyJarFile(dir.resolve("auto1.jar"), "p1/C.class");
+        createDummyJarFile(dir.resolve("auto2.jar"), "p2/C.class");
+        createDummyJarFile(dir.resolve("auto3.jar"), "p3/C.class");
+
+        // module finder locates m1, m2, and the modules in the directory
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+        ModuleFinder finder2 =  ModuleFinder.of(dir);
+        ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
+
+        Configuration parent = ModuleLayer.boot().configuration();
+        Configuration cf = resolve(parent, finder, "m1");
+
+        // all automatic modules should be resolved
+        assertTrue(cf.modules().size() == 5);
+        assertTrue(cf.findModule("m1").isPresent());
+        assertTrue(cf.findModule("m2").isPresent());
+        assertTrue(cf.findModule("auto1").isPresent());
+        assertTrue(cf.findModule("auto2").isPresent());
+        assertTrue(cf.findModule("auto3").isPresent());
+
+        ResolvedModule base = parent.findModule("java.base")
+                                    .orElseThrow(() -> new RuntimeException());
+        ResolvedModule m1 = cf.findModule("m1").get();
+        ResolvedModule m2 = cf.findModule("m2").get();
+        ResolvedModule auto1 = cf.findModule("auto1").get();
+        ResolvedModule auto2 = cf.findModule("auto2").get();
+        ResolvedModule auto3 = cf.findModule("auto3").get();
+
+        // m1 does not read the automatic modules
+        assertTrue(m1.reads().size() == 2);
+        assertTrue(m1.reads().contains(m2));
+        assertTrue(m1.reads().contains(base));
+
+        // m2 should read all the automatic modules
+        assertTrue(m2.reads().size() == 4);
+        assertTrue(m2.reads().contains(auto1));
+        assertTrue(m2.reads().contains(auto2));
+        assertTrue(m2.reads().contains(auto3));
+        assertTrue(m2.reads().contains(base));
+
+        assertTrue(auto1.reads().contains(m1));
+        assertTrue(auto1.reads().contains(m2));
+        assertTrue(auto1.reads().contains(auto2));
+        assertTrue(auto1.reads().contains(auto3));
+        assertTrue(auto1.reads().contains(base));
+
+        assertTrue(auto2.reads().contains(m1));
+        assertTrue(auto2.reads().contains(m2));
+        assertTrue(auto2.reads().contains(auto1));
+        assertTrue(auto2.reads().contains(auto3));
+        assertTrue(auto2.reads().contains(base));
+
+        assertTrue(auto3.reads().contains(m1));
+        assertTrue(auto3.reads().contains(m2));
+        assertTrue(auto3.reads().contains(auto1));
+        assertTrue(auto3.reads().contains(auto2));
+        assertTrue(auto3.reads().contains(base));
+    }
+
+
+    /**
+     * Basic test of automatic modules in a child configuration. All automatic
+     * modules that are found with the before finder should be resolved. The
+     * automatic modules that are found by the after finder and not shadowed
+     * by the before finder, or parent configurations, should also be resolved.
+     */
+    public void testInConfiguration6() throws IOException {
+        // m1 requires auto1
+        ModuleDescriptor descriptor1
+            = ModuleDescriptor.newModule("m1")
+                .requires("auto1")
+                .build();
+
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        createDummyJarFile(dir.resolve("auto1.jar"), "p1/C.class");
+
+        // module finder locates m1 and auto1
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+        ModuleFinder finder2 =  ModuleFinder.of(dir);
+        ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
+
+        Configuration parent = ModuleLayer.boot().configuration();
+        Configuration cf1 = resolve(parent, finder, "m1");
+
+        assertTrue(cf1.modules().size() == 2);
+        assertTrue(cf1.findModule("m1").isPresent());
+        assertTrue(cf1.findModule("auto1").isPresent());
+
+        ResolvedModule base = parent.findModule("java.base")
+                                    .orElseThrow(() -> new RuntimeException());
+        ResolvedModule m1 = cf1.findModule("m1").get();
+        ResolvedModule auto1 = cf1.findModule("auto1").get();
+
+        assertTrue(m1.reads().size() == 2);
+        assertTrue(m1.reads().contains(auto1));
+        assertTrue(m1.reads().contains(base));
+
+        assertTrue(auto1.reads().contains(m1));
+        assertTrue(auto1.reads().contains(base));
+
+
+        // create child configuration - the after finder locates auto1
+
+        dir = Files.createTempDirectory(USER_DIR, "mods");
+        createDummyJarFile(dir.resolve("auto2.jar"), "p2/C.class");
+        ModuleFinder beforeFinder =  ModuleFinder.of(dir);
+
+        dir = Files.createTempDirectory(USER_DIR, "mods");
+        createDummyJarFile(dir.resolve("auto1.jar"), "p1/C.class");
+        createDummyJarFile(dir.resolve("auto2.jar"), "p2/C.class");
+        createDummyJarFile(dir.resolve("auto3.jar"), "p3/C.class");
+        ModuleFinder afterFinder =  ModuleFinder.of(dir);
+
+        Configuration cf2 = cf1.resolve(beforeFinder, afterFinder, Set.of("auto2"));
+
+        // auto1 should be found in parent and should not be in cf2
+        assertTrue(cf2.modules().size() == 2);
+        assertTrue(cf2.findModule("auto2").isPresent());
+        assertTrue(cf2.findModule("auto3").isPresent());
+
+        ResolvedModule auto2 = cf2.findModule("auto2").get();
+        ResolvedModule auto3 = cf2.findModule("auto3").get();
+
+        assertTrue(auto2.reads().contains(m1));
+        assertTrue(auto2.reads().contains(auto1));
+        assertTrue(auto2.reads().contains(auto3));
+        assertTrue(auto2.reads().contains(base));
+
+        assertTrue(auto3.reads().contains(m1));
+        assertTrue(auto3.reads().contains(auto1));
+        assertTrue(auto3.reads().contains(auto2));
+        assertTrue(auto3.reads().contains(base));
+    }
+
+
+    /**
+     * Basic test of a configuration created with automatic modules
+     *   a requires b* and c*
+     *   b* contains p
+     *   c* contains p
+     */
+    @Test(expectedExceptions = { ResolutionException.class })
+    public void testDuplicateSuppliers1() throws IOException {
+        ModuleDescriptor descriptor
+            = ModuleDescriptor.newModule("a")
+                .requires("b")
+                .requires("c")
+                .build();
+
+        // c and d are automatic modules with the same package
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        createDummyJarFile(dir.resolve("b.jar"), "p/T.class");
+        createDummyJarFile(dir.resolve("c.jar"), "p/T.class");
+
+        // module finder locates 'a' and the modules in the directory
+        ModuleFinder finder
+            = ModuleFinder.compose(ModuleUtils.finderOf(descriptor),
+                                   ModuleFinder.of(dir));
+
+        Configuration parent = ModuleLayer.boot().configuration();
+        resolve(parent, finder, "a");
+    }
+
+
+    /**
+     * Basic test of a configuration created with automatic modules
+     *   a contains p, requires b*
+     *   b* contains p
+     */
+    @Test(expectedExceptions = { ResolutionException.class })
+    public void testDuplicateSuppliers2() throws IOException {
+        ModuleDescriptor descriptor
+            = ModuleDescriptor.newModule("a")
+                .packages(Set.of("p"))
+                .requires("b")
+                .build();
+
+        // c and d are automatic modules with the same package
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        createDummyJarFile(dir.resolve("b.jar"), "p/T.class");
+
+        // module finder locates 'a' and the modules in the directory
+        ModuleFinder finder
+            = ModuleFinder.compose(ModuleUtils.finderOf(descriptor),
+                                   ModuleFinder.of(dir));
+
+        Configuration parent = ModuleLayer.boot().configuration();
+        resolve(parent, finder, "a");
+    }
+
+
+    /**
+     * Basic test of layer containing automatic modules
      */
     public void testInLayer() throws IOException {
         ModuleDescriptor descriptor
-            = ModuleDescriptor.module("a")
+            = ModuleDescriptor.newModule("a")
                 .requires("b")
                 .requires("c")
                 .build();
@@ -628,12 +919,12 @@
             = ModuleFinder.compose(ModuleUtils.finderOf(descriptor),
                 ModuleFinder.of(dir));
 
-        Configuration parent = Layer.boot().configuration();
+        Configuration parent = ModuleLayer.boot().configuration();
         Configuration cf = resolve(parent, finder, "a");
         assertTrue(cf.modules().size() == 3);
 
         // each module gets its own loader
-        Layer layer = Layer.boot().defineModules(cf, mn -> new ClassLoader() { });
+        ModuleLayer layer = ModuleLayer.boot().defineModules(cf, mn -> new ClassLoader() { });
 
         // an unnamed module
         Module unnamed = (new ClassLoader() { }).getUnnamedModule();
@@ -664,20 +955,17 @@
 
         // test miscellaneous methods
         assertTrue(m.isAutomatic());
-        assertFalse(m.isSynthetic());
-        assertFalse(m.osName().isPresent());
-        assertFalse(m.osArch().isPresent());
-        assertFalse(m.osVersion().isPresent());
+        assertFalse(m.modifiers().contains(ModuleDescriptor.Modifier.SYNTHETIC));
     }
 
 
     /**
-     * Invokes parent.resolveRequires to resolve the given root modules.
+     * Invokes parent.resolve to resolve the given root modules.
      */
     static Configuration resolve(Configuration parent,
                                  ModuleFinder finder,
                                  String... roots) {
-        return parent.resolveRequires(finder, ModuleFinder.of(), Set.of(roots));
+        return parent.resolve(finder, ModuleFinder.of(), Set.of(roots));
     }
 
     /**
@@ -699,7 +987,7 @@
      */
     static void testReadAllBootModules(Configuration cf, String mn) {
 
-        Set<String> bootModules = Layer.boot().modules().stream()
+        Set<String> bootModules = ModuleLayer.boot().modules().stream()
                 .map(Module::getName)
                 .collect(Collectors.toSet());
 
@@ -708,10 +996,10 @@
     }
 
     /**
-     * Test that the given Module reads all module in the given Layer
-     * and its parent Layers.
+     * Test that the given Module reads all module in the given layer
+     * and its parent layers.
      */
-    static void testsReadsAll(Module m, Layer layer) {
+    static void testsReadsAll(Module m, ModuleLayer layer) {
         // check that m reads all modules in the layer
         layer.configuration().modules().stream()
             .map(ResolvedModule::name)
diff --git a/jdk/test/java/lang/module/ConfigurationTest.java b/jdk/test/java/lang/module/ConfigurationTest.java
index 7ae8672..d59612d 100644
--- a/jdk/test/java/lang/module/ConfigurationTest.java
+++ b/jdk/test/java/lang/module/ConfigurationTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,23 +24,31 @@
 /**
  * @test
  * @library /lib/testlibrary
+ * @modules java.base/jdk.internal.misc
+ *          java.base/jdk.internal.module
  * @build ConfigurationTest ModuleUtils
  * @run testng ConfigurationTest
  * @summary Basic tests for java.lang.module.Configuration
  */
 
+import java.io.IOException;
+import java.io.OutputStream;
 import java.lang.module.Configuration;
+import java.lang.module.FindException;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleDescriptor.Requires;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ResolutionException;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
-import java.util.HashSet;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
 
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.module.ModuleInfoWriter;
+import jdk.internal.module.ModuleTarget;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
@@ -48,30 +56,35 @@
 @Test
 public class ConfigurationTest {
 
+    /**
+     * Creates a "non-strict" builder for building a module. This allows the
+     * test the create ModuleDescriptor objects that do not require java.base.
+     */
+    private static ModuleDescriptor.Builder newBuilder(String mn) {
+        return SharedSecrets.getJavaLangModuleAccess()
+                .newModuleBuilder(mn, false, Set.of());
+    }
 
     /**
      * Basic test of resolver
      *     m1 requires m2, m2 requires m3
      */
     public void testBasic() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires("m2")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m3")
                 .build();
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .build();
 
         ModuleFinder finder
             = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
 
-        Configuration cf = resolveRequires(finder, "m1");
+        Configuration cf = resolve(finder, "m1");
 
         assertTrue(cf.modules().size() == 3);
 
@@ -110,24 +123,21 @@
      */
     public void testRequiresTransitive1() {
         // m1 requires m2, m2 requires transitive m3
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires("m2")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires(Set.of(Requires.Modifier.TRANSITIVE), "m3")
                 .build();
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .build();
 
         ModuleFinder finder
             = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
 
-        Configuration cf = resolveRequires(finder, "m1");
+        Configuration cf = resolve(finder, "m1");
 
         assertTrue(cf.modules().size() == 3);
 
@@ -167,18 +177,16 @@
 
         // cf1: m1 and m2, m2 requires transitive m1
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
 
-        Configuration cf1 = resolveRequires(finder1, "m2");
+        Configuration cf1 = resolve(finder1, "m2");
 
         assertTrue(cf1.modules().size() == 2);
         assertTrue(cf1.findModule("m1").isPresent());
@@ -196,14 +204,13 @@
 
         // cf2: m3, m3 requires m2
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m2")
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3);
 
-        Configuration cf2 = resolveRequires(cf1, finder2, "m3");
+        Configuration cf2 = resolve(cf1, finder2, "m3");
 
         assertTrue(cf2.modules().size() == 1);
         assertTrue(cf2.findModule("m1").isPresent());  // in parent
@@ -231,13 +238,11 @@
 
         // cf1: m1
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf1 = resolveRequires(finder1, "m1");
+        Configuration cf1 = resolve(finder1, "m1");
 
         assertTrue(cf1.modules().size() == 1);
         assertTrue(cf1.findModule("m1").isPresent());
@@ -250,19 +255,17 @@
 
         // cf2: m2, m3: m2 requires transitive m1, m3 requires m2
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
                 .build();
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m2")
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2, descriptor3);
 
-        Configuration cf2 = resolveRequires(cf1, finder2, "m3");
+        Configuration cf2 = resolve(cf1, finder2, "m3");
 
         assertTrue(cf2.modules().size() == 2);
         assertTrue(cf2.findModule("m1").isPresent());   // in parent
@@ -297,13 +300,11 @@
 
         // cf1: m1
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf1 = resolveRequires(finder1, "m1");
+        Configuration cf1 = resolve(finder1, "m1");
 
         assertTrue(cf1.modules().size() == 1);
         assertTrue(cf1.findModule("m1").isPresent());
@@ -316,14 +317,13 @@
 
         // cf2: m2 requires transitive m1
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
 
-        Configuration cf2 = resolveRequires(cf1, finder2, "m2");
+        Configuration cf2 = resolve(cf1, finder2, "m2");
 
         assertTrue(cf2.modules().size() == 1);
         assertTrue(cf2.findModule("m1").isPresent());  // in parent
@@ -340,14 +340,13 @@
 
         // cf3: m3 requires m2
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m2")
                 .build();
 
         ModuleFinder finder3 = ModuleUtils.finderOf(descriptor3);
 
-        Configuration cf3 = resolveRequires(cf2, finder3, "m3");
+        Configuration cf3 = resolve(cf2, finder3, "m3");
 
         assertTrue(cf3.modules().size() == 1);
         assertTrue(cf3.findModule("m1").isPresent());  // in parent
@@ -376,18 +375,16 @@
 
         // cf1: m1, m2 requires transitive m1
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
 
-        Configuration cf1 = resolveRequires(finder1, "m2");
+        Configuration cf1 = resolve(finder1, "m2");
 
         assertTrue(cf1.modules().size() == 2);
         assertTrue(cf1.findModule("m1").isPresent());
@@ -408,20 +405,18 @@
 
         // cf2: m3 requires transitive m2, m4 requires m3
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires(Set.of(Requires.Modifier.TRANSITIVE), "m2")
                 .build();
 
-        ModuleDescriptor descriptor4
-            = ModuleDescriptor.module("m4")
+        ModuleDescriptor descriptor4 = newBuilder("m4")
                 .requires("m3")
                 .build();
 
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3, descriptor4);
 
-        Configuration cf2 = resolveRequires(cf1, finder2, "m3", "m4");
+        Configuration cf2 = resolve(cf1, finder2, "m3", "m4");
 
         assertTrue(cf2.modules().size() == 2);
         assertTrue(cf2.findModule("m1").isPresent());   // in parent
@@ -448,88 +443,19 @@
 
 
     /**
-     * Basic test of "requires transitive" with configurations.
-     *
-     * The test consists of three configurations:
-     * - Configuration cf1: m1, m2 requires transitive m1
-     * - Configuration cf2: m1, m3 requires transitive m1
-     * - Configuration cf3(cf1,cf2): m4 requires m2, m3
-     */
-    public void testRequiresTransitive6() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
-                .build();
-
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
-                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
-                .build();
-
-        ModuleDescriptor descriptor4
-            = ModuleDescriptor.module("m4")
-                .requires("m2")
-                .requires("m3")
-                .build();
-
-        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
-        Configuration cf1 = resolveRequires(finder1, "m2");
-        assertTrue(cf1.modules().size() == 2);
-        assertTrue(cf1.findModule("m1").isPresent());
-        assertTrue(cf1.findModule("m2").isPresent());
-        assertTrue(cf1.parents().size() == 1);
-        assertTrue(cf1.parents().get(0) == Configuration.empty());
-
-        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1, descriptor3);
-        Configuration cf2 = resolveRequires(finder2, "m3");
-        assertTrue(cf2.modules().size() == 2);
-        assertTrue(cf2.findModule("m3").isPresent());
-        assertTrue(cf2.findModule("m1").isPresent());
-        assertTrue(cf2.parents().size() == 1);
-        assertTrue(cf2.parents().get(0) == Configuration.empty());
-
-        ModuleFinder finder3 = ModuleUtils.finderOf(descriptor4);
-        Configuration cf3 = Configuration.resolveRequires(finder3,
-                List.of(cf1, cf2),
-                ModuleFinder.of(),
-                Set.of("m4"));
-        assertTrue(cf3.modules().size() == 1);
-        assertTrue(cf3.findModule("m4").isPresent());
-
-        ResolvedModule m1_l = cf1.findModule("m1").get();
-        ResolvedModule m1_r = cf2.findModule("m1").get();
-        ResolvedModule m2 = cf1.findModule("m2").get();
-        ResolvedModule m3 = cf2.findModule("m3").get();
-        ResolvedModule m4 = cf3.findModule("m4").get();
-        assertTrue(m4.configuration() == cf3);
-
-        assertTrue(m4.reads().size() == 4);
-        assertTrue(m4.reads().contains(m1_l));
-        assertTrue(m4.reads().contains(m1_r));
-        assertTrue(m4.reads().contains(m2));
-        assertTrue(m4.reads().contains(m3));
-    }
-
-
-    /**
      * Basic test of "requires static":
      *     m1 requires static m2
      *     m2 is not observable
      *     resolve m1
      */
     public void testRequiresStatic1() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires(Set.of(Requires.Modifier.STATIC), "m2")
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf = resolveRequires(finder, "m1");
+        Configuration cf = resolve(finder, "m1");
 
         assertTrue(cf.modules().size() == 1);
 
@@ -545,18 +471,16 @@
      *     resolve m1
      */
     public void testRequiresStatic2() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires(Set.of(Requires.Modifier.STATIC), "m2")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
 
-        Configuration cf = resolveRequires(finder, "m1");
+        Configuration cf = resolve(finder, "m1");
 
         assertTrue(cf.modules().size() == 1);
 
@@ -572,18 +496,16 @@
      *     resolve m1, m2
      */
     public void testRequiresStatic3() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires(Set.of(Requires.Modifier.STATIC), "m2")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
 
-        Configuration cf = resolveRequires(finder, "m1", "m2");
+        Configuration cf = resolve(finder, "m1", "m2");
 
         assertTrue(cf.modules().size() == 2);
 
@@ -604,25 +526,22 @@
      *     m3
      */
     public void testRequiresStatic4() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires("m2")
                 .requires("m3")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires(Set.of(Requires.Modifier.STATIC), "m3")
                 .build();
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .build();
 
         ModuleFinder finder
-                = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
+            = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
 
-        Configuration cf = resolveRequires(finder, "m1");
+        Configuration cf = resolve(finder, "m1");
 
         assertTrue(cf.modules().size() == 3);
 
@@ -648,31 +567,28 @@
      * - Configuration cf2: m3 requires m1, requires static m2
      */
     public void testRequiresStatic5() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
 
-        Configuration cf1 = resolveRequires(finder1, "m1", "m2");
+        Configuration cf1 = resolve(finder1, "m1", "m2");
 
         assertTrue(cf1.modules().size() == 2);
         assertTrue(cf1.findModule("m1").isPresent());
         assertTrue(cf1.findModule("m2").isPresent());
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m1")
                 .requires(Set.of(Requires.Modifier.STATIC), "m2")
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3);
 
-        Configuration cf2 = resolveRequires(cf1, finder2, "m3");
+        Configuration cf2 = resolve(cf1, finder2, "m3");
 
         assertTrue(cf2.modules().size() == 1);
         assertTrue(cf2.findModule("m3").isPresent());
@@ -694,26 +610,24 @@
      * - Configuration cf2: m3 requires m1, requires static m2
      */
     public void testRequiresStatic6() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf1 = resolveRequires(finder1, "m1");
+        Configuration cf1 = resolve(finder1, "m1");
 
         assertTrue(cf1.modules().size() == 1);
         assertTrue(cf1.findModule("m1").isPresent());
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m1")
                 .requires(Set.of(Requires.Modifier.STATIC), "m2")
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3);
 
-        Configuration cf2 = resolveRequires(cf1, finder2, "m3");
+        Configuration cf2 = resolve(cf1, finder2, "m3");
 
         assertTrue(cf2.modules().size() == 1);
         assertTrue(cf2.findModule("m3").isPresent());
@@ -735,21 +649,19 @@
     public void testRequiresStatic7() {
         ModuleDescriptor descriptor1 = null;  // not observable
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires(Set.of(Requires.Modifier.TRANSITIVE,
                                 Requires.Modifier.STATIC),
                          "m1")
                 .build();
 
-        ModuleDescriptor descriptor3
-                = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m2")
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor2, descriptor3);
 
-        Configuration cf = resolveRequires(finder, "m3");
+        Configuration cf = resolve(finder, "m3");
 
         assertTrue(cf.modules().size() == 2);
         assertTrue(cf.findModule("m2").isPresent());
@@ -770,8 +682,7 @@
     public void testRequiresStatic8() {
         ModuleDescriptor descriptor1 = null;  // not observable
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires(Set.of(Requires.Modifier.TRANSITIVE,
                                 Requires.Modifier.STATIC),
                         "m1")
@@ -779,21 +690,20 @@
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor2);
 
-        Configuration cf1 = resolveRequires(finder1, "m2");
+        Configuration cf1 = resolve(finder1, "m2");
 
         assertTrue(cf1.modules().size() == 1);
         assertTrue(cf1.findModule("m2").isPresent());
         ResolvedModule m2 = cf1.findModule("m2").get();
         assertTrue(m2.reads().isEmpty());
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m2")
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3);
 
-        Configuration cf2 = resolveRequires(cf1, finder2, "m3");
+        Configuration cf2 = resolve(cf1, finder2, "m3");
 
         assertTrue(cf2.modules().size() == 1);
         assertTrue(cf2.findModule("m3").isPresent());
@@ -810,22 +720,19 @@
      */
     public void testServiceBinding1() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .exports("p")
                 .uses("p.S")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
-                .contains("q")
-                .provides("p.S", "q.T")
+                .provides("p.S", List.of("q.T"))
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
 
-        Configuration cf = resolveRequiresAndUses(finder, "m1");
+        Configuration cf = resolveAndBind(finder, "m1");
 
         assertTrue(cf.modules().size() == 2);
         assertTrue(cf.findModule("m1").isPresent());
@@ -853,31 +760,26 @@
      */
     public void testServiceBinding2() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .exports("p")
                 .uses("p.S1")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
                 .uses("p.S2")
-                .contains("q")
-                .provides("p.S1", "q.Service1Impl")
+                .provides("p.S1", List.of("q.Service1Impl"))
                 .build();
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m1")
-                .contains("q")
-                .provides("p.S2", "q.Service2Impl")
+                .provides("p.S2", List.of("q.Service2Impl"))
                 .build();
 
         ModuleFinder finder
             = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
 
-        Configuration cf = resolveRequiresAndUses(finder, "m1");
+        Configuration cf = resolveAndBind(finder, "m1");
 
         assertTrue(cf.modules().size() == 3);
         assertTrue(cf.findModule("m1").isPresent());
@@ -912,29 +814,26 @@
      */
     public void testServiceBindingWithConfigurations1() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .exports("p")
                 .uses("p.S")
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf1 = resolveRequires(finder1, "m1");
+        Configuration cf1 = resolve(finder1, "m1");
 
         assertTrue(cf1.modules().size() == 1);
         assertTrue(cf1.findModule("m1").isPresent());
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
-                .contains("q")
-                .provides("p.S", "q.T")
+                .provides("p.S", List.of("q.T"))
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
 
-        Configuration cf2 = resolveRequiresAndUses(cf1, finder2); // no roots
+        Configuration cf2 = resolveAndBind(cf1, finder2); // no roots
 
         assertTrue(cf2.parents().size() == 1);
         assertTrue(cf2.parents().get(0) == cf1);
@@ -961,47 +860,39 @@
      */
     public void testServiceBindingWithConfigurations2() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .exports("p")
                 .uses("p.S")
-                .contains("p1")
-                .provides("p.S", "p1.ServiceImpl")
+                .provides("p.S", List.of("p1.ServiceImpl"))
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
-                .contains("p2")
-                .provides("p.S", "p2.ServiceImpl")
+                .provides("p.S", List.of("p2.ServiceImpl"))
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
 
-        Configuration cf1 = resolveRequiresAndUses(finder1, "m1");
+        Configuration cf1 = resolveAndBind(finder1, "m1");
 
         assertTrue(cf1.modules().size() == 2);
         assertTrue(cf1.findModule("m1").isPresent());
         assertTrue(cf1.findModule("m2").isPresent());
 
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m1")
-                .contains("p3")
-                .provides("p.S", "p3.ServiceImpl")
+                .provides("p.S", List.of("p3.ServiceImpl"))
                 .build();
 
-        ModuleDescriptor descriptor4
-            = ModuleDescriptor.module("m4")
+        ModuleDescriptor descriptor4 = newBuilder("m4")
                 .requires("m1")
-                .contains("p4")
-                .provides("p.S", "p4.ServiceImpl")
+                .provides("p.S", List.of("p4.ServiceImpl"))
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3, descriptor4);
 
-        Configuration cf2 = resolveRequiresAndUses(cf1, finder2); // no roots
+        Configuration cf2 = resolveAndBind(cf1, finder2); // no roots
 
         assertTrue(cf2.parents().size() == 1);
         assertTrue(cf2.parents().get(0) == cf1);
@@ -1037,22 +928,19 @@
      */
     public void testServiceBindingWithConfigurations3() {
 
-        ModuleDescriptor service
-            = ModuleDescriptor.module("s")
+        ModuleDescriptor service = newBuilder("s")
                 .exports("p")
                 .build();
 
-        ModuleDescriptor provider_v1
-            = ModuleDescriptor.module("p")
+        ModuleDescriptor provider_v1 = newBuilder("p")
                 .version("1.0")
                 .requires("s")
-                .contains("q")
-                .provides("p.S", "q.T")
+                .provides("p.S", List.of("q.T"))
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(service, provider_v1);
 
-        Configuration cf1 = resolveRequires(finder1, "p");
+        Configuration cf1 = resolve(finder1, "p");
 
         assertTrue(cf1.modules().size() == 2);
         assertTrue(cf1.findModule("s").isPresent());
@@ -1063,18 +951,15 @@
         assertEquals(p.reference().descriptor(), provider_v1);
 
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires("s")
                 .uses("p.S")
                 .build();
 
-        ModuleDescriptor provider_v2
-            = ModuleDescriptor.module("p")
+        ModuleDescriptor provider_v2 = newBuilder("p")
                 .version("2.0")
                 .requires("s")
-                .contains("q")
-                .provides("p.S", "q.T")
+                .provides("p.S", List.of("q.T"))
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1, provider_v2);
@@ -1082,7 +967,7 @@
 
         // finder2 is the before ModuleFinder and so p@2.0 should be located
 
-        Configuration cf2 = resolveRequiresAndUses(cf1, finder2, "m1");
+        Configuration cf2 = resolveAndBind(cf1, finder2, "m1");
 
         assertTrue(cf2.parents().size() == 1);
         assertTrue(cf2.parents().get(0) == cf1);
@@ -1097,7 +982,7 @@
         // finder2 is the after ModuleFinder and so p@2.0 should not be located
         // as module p is in parent configuration.
 
-        cf2 = resolveRequiresAndUses(cf1, ModuleFinder.of(), finder2, "m1");
+        cf2 = resolveAndBind(cf1, ModuleFinder.of(), finder2, "m1");
 
         assertTrue(cf2.parents().size() == 1);
         assertTrue(cf2.parents().get(0) == cf1);
@@ -1117,25 +1002,22 @@
      */
     public void testWithTwoFinders1() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires("m2")
                 .build();
 
-        ModuleDescriptor descriptor2_v1
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2_v1 = newBuilder("m2")
                 .version("1.0")
                 .build();
 
-        ModuleDescriptor descriptor2_v2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2_v2 = newBuilder("m2")
                 .version("2.0")
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor2_v1);
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1, descriptor2_v2);
 
-        Configuration cf = resolveRequires(finder1, finder2, "m1");
+        Configuration cf = resolve(finder1, finder2, "m1");
 
         assertTrue(cf.modules().size() == 2);
         assertTrue(cf.findModule("m1").isPresent());
@@ -1157,30 +1039,25 @@
      */
     public void testWithTwoFinders2() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .exports("p")
                 .uses("p.S")
                 .build();
 
-        ModuleDescriptor descriptor2_v1
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2_v1 = newBuilder("m2")
                 .requires("m1")
-                .contains("q")
-                .provides("p.S", "q.T")
+                .provides("p.S", List.of("q.T"))
                 .build();
 
-        ModuleDescriptor descriptor2_v2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2_v2 = newBuilder("m2")
                 .requires("m1")
-                .contains("q")
-                .provides("p.S", "q.T")
+                .provides("p.S", List.of("q.T"))
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2_v1);
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2_v2);
 
-        Configuration cf = resolveRequiresAndUses(finder1, finder2, "m1");
+        Configuration cf = resolveAndBind(finder1, finder2, "m1");
 
         assertTrue(cf.modules().size() == 2);
         assertTrue(cf.findModule("m1").isPresent());
@@ -1200,18 +1077,17 @@
      */
     public void testResolvedInParent1() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf1 = resolveRequires(finder, "m1");
+        Configuration cf1 = resolve(finder, "m1");
 
         assertTrue(cf1.modules().size() == 1);
         assertTrue(cf1.findModule("m1").isPresent());
 
-        Configuration cf2 = resolveRequires(cf1, finder, "m1");
+        Configuration cf2 = resolve(cf1, finder, "m1");
 
         assertTrue(cf2.modules().size() == 1);
     }
@@ -1223,26 +1099,23 @@
      */
     public void testResolvedInParent2() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf1 = resolveRequires(finder1, "m1");
+        Configuration cf1 = resolve(finder1, "m1");
 
         assertTrue(cf1.modules().size() == 1);
         assertTrue(cf1.findModule("m1").isPresent());
 
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
 
-        Configuration cf2 = resolveRequires(cf1, ModuleFinder.of(), finder2, "m2");
+        Configuration cf2 = resolve(cf1, ModuleFinder.of(), finder2, "m2");
 
         assertTrue(cf2.modules().size() == 1);
         assertTrue(cf2.findModule("m2").isPresent());
@@ -1268,29 +1141,28 @@
     public void testResolvedInMultipleParents1() {
 
         // Configuration cf1: m1
-        ModuleDescriptor descriptor1 = ModuleDescriptor.module("m1").build();
-        Configuration cf1 = resolveRequires(ModuleUtils.finderOf(descriptor1), "m1");
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+        Configuration cf1 = resolve(ModuleUtils.finderOf(descriptor1), "m1");
         assertEquals(cf1.parents(), List.of(Configuration.empty()));
         assertTrue(cf1.findModule("m1").isPresent());
         ResolvedModule m1 = cf1.findModule("m1").get();
         assertTrue(m1.configuration() == cf1);
 
         // Configuration cf2: m2
-        ModuleDescriptor descriptor2 = ModuleDescriptor.module("m2").build();
-        Configuration cf2 = resolveRequires(ModuleUtils.finderOf(descriptor2), "m2");
+        ModuleDescriptor descriptor2 = newBuilder("m2").build();
+        Configuration cf2 = resolve(ModuleUtils.finderOf(descriptor2), "m2");
         assertEquals(cf2.parents(), List.of(Configuration.empty()));
         assertTrue(cf2.findModule("m2").isPresent());
         ResolvedModule m2 = cf2.findModule("m2").get();
         assertTrue(m2.configuration() == cf2);
 
         // Configuration cf3(cf1,cf2): m3 requires m1 and m2
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m1")
                 .requires("m2")
                 .build();
         ModuleFinder finder = ModuleUtils.finderOf(descriptor3);
-        Configuration cf3 = Configuration.resolveRequires(
+        Configuration cf3 = Configuration.resolve(
                 finder,
                 List.of(cf1, cf2),  // parents
                 ModuleFinder.of(),
@@ -1319,19 +1191,18 @@
      */
     public void testResolvedInMultipleParents2() {
         // Configuration cf1: m1
-        ModuleDescriptor descriptor1 = ModuleDescriptor.module("m1").build();
-        Configuration cf1 = resolveRequires(ModuleUtils.finderOf(descriptor1), "m1");
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+        Configuration cf1 = resolve(ModuleUtils.finderOf(descriptor1), "m1");
         assertEquals(cf1.parents(), List.of(Configuration.empty()));
         assertTrue(cf1.findModule("m1").isPresent());
         ResolvedModule m1 = cf1.findModule("m1").get();
         assertTrue(m1.configuration() == cf1);
 
         // Configuration cf2(cf1): m2 requires m1
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
                 .build();
-        Configuration cf2 = Configuration.resolveRequires(
+        Configuration cf2 = Configuration.resolve(
                 ModuleUtils.finderOf(descriptor2),
                 List.of(cf1),  // parents
                 ModuleFinder.of(),
@@ -1342,11 +1213,10 @@
         assertTrue(m2.configuration() == cf2);
 
         // Configuration cf3(cf1): m3 requires m1
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m1")
                 .build();
-        Configuration cf3 = Configuration.resolveRequires(
+        Configuration cf3 = Configuration.resolve(
                 ModuleUtils.finderOf(descriptor3),
                 List.of(cf1),  // parents
                 ModuleFinder.of(),
@@ -1357,13 +1227,12 @@
         assertTrue(m3.configuration() == cf3);
 
         // Configuration cf4(cf2,cf3): m4 requires m1,m2,m3
-        ModuleDescriptor descriptor4
-            = ModuleDescriptor.module("m4")
+        ModuleDescriptor descriptor4 = newBuilder("m4")
                 .requires("m1")
                 .requires("m2")
                 .requires("m3")
                 .build();
-        Configuration cf4 = Configuration.resolveRequires(
+        Configuration cf4 = Configuration.resolve(
                 ModuleUtils.finderOf(descriptor4),
                 List.of(cf2, cf3),  // parents
                 ModuleFinder.of(),
@@ -1395,35 +1264,34 @@
         ModuleDescriptor descriptor1, descriptor2, descriptor3;
 
         // Configuration cf1: m1@1
-        descriptor1 = ModuleDescriptor.module("m1").version("1").build();
-        Configuration cf1 = resolveRequires(ModuleUtils.finderOf(descriptor1), "m1");
+        descriptor1 = newBuilder("m1").version("1").build();
+        Configuration cf1 = resolve(ModuleUtils.finderOf(descriptor1), "m1");
         assertEquals(cf1.parents(), List.of(Configuration.empty()));
 
         // Configuration cf2: m1@2, m2@2
-        descriptor1 = ModuleDescriptor.module("m1").version("2").build();
-        descriptor2 = ModuleDescriptor.module("m2").version("2").build();
-        Configuration cf2 = resolveRequires(
+        descriptor1 = newBuilder("m1").version("2").build();
+        descriptor2 = newBuilder("m2").version("2").build();
+        Configuration cf2 = resolve(
                 ModuleUtils.finderOf(descriptor1, descriptor2),
                 "m1", "m2");
         assertEquals(cf2.parents(), List.of(Configuration.empty()));
 
         // Configuration cf3: m1@3, m2@3, m3@3
-        descriptor1 = ModuleDescriptor.module("m1").version("3").build();
-        descriptor2 = ModuleDescriptor.module("m2").version("3").build();
-        descriptor3 = ModuleDescriptor.module("m3").version("3").build();
-        Configuration cf3 = resolveRequires(
+        descriptor1 = newBuilder("m1").version("3").build();
+        descriptor2 = newBuilder("m2").version("3").build();
+        descriptor3 = newBuilder("m3").version("3").build();
+        Configuration cf3 = resolve(
                 ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3),
                 "m1", "m2", "m3");
         assertEquals(cf3.parents(), List.of(Configuration.empty()));
 
         // Configuration cf4(cf1,cf2,cf3): m4 requires m1,m2,m3
-        ModuleDescriptor descriptor4
-                = ModuleDescriptor.module("m4")
+        ModuleDescriptor descriptor4 = newBuilder("m4")
                 .requires("m1")
                 .requires("m2")
                 .requires("m3")
                 .build();
-        Configuration cf4 = Configuration.resolveRequires(
+        Configuration cf4 = Configuration.resolve(
                 ModuleUtils.finderOf(descriptor4),
                 List.of(cf1, cf2, cf3),  // parents
                 ModuleFinder.of(),
@@ -1470,17 +1338,15 @@
      * configuration.
      */
     public void testOverriding1() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf1 = resolveRequires(finder, "m1");
+        Configuration cf1 = resolve(finder, "m1");
         assertTrue(cf1.modules().size() == 1);
         assertTrue(cf1.findModule("m1").isPresent());
 
-        Configuration cf2 = resolveRequires(cf1, finder, "m1");
+        Configuration cf2 = resolve(cf1, finder, "m1");
         assertTrue(cf2.modules().size() == 1);
         assertTrue(cf2.findModule("m1").isPresent());
     }
@@ -1490,24 +1356,24 @@
      * configuration.
      */
     public void testOverriding2() {
-        ModuleDescriptor descriptor1 = ModuleDescriptor.module("m1").build();
-        Configuration cf1 = resolveRequires(ModuleUtils.finderOf(descriptor1), "m1");
+        ModuleDescriptor descriptor1 = newBuilder("m1").build();
+        Configuration cf1 = resolve(ModuleUtils.finderOf(descriptor1), "m1");
         assertTrue(cf1.modules().size() == 1);
         assertTrue(cf1.findModule("m1").isPresent());
 
-        ModuleDescriptor descriptor2 = ModuleDescriptor.module("m2").build();
-        Configuration cf2 = resolveRequires(ModuleUtils.finderOf(descriptor2), "m2");
+        ModuleDescriptor descriptor2 = newBuilder("m2").build();
+        Configuration cf2 = resolve(ModuleUtils.finderOf(descriptor2), "m2");
         assertTrue(cf2.modules().size() == 1);
         assertTrue(cf2.findModule("m2").isPresent());
 
-        ModuleDescriptor descriptor3 = ModuleDescriptor.module("m3").build();
-        Configuration cf3 = resolveRequires(ModuleUtils.finderOf(descriptor3), "m3");
+        ModuleDescriptor descriptor3 = newBuilder("m3").build();
+        Configuration cf3 = resolve(ModuleUtils.finderOf(descriptor3), "m3");
         assertTrue(cf3.modules().size() == 1);
         assertTrue(cf3.findModule("m3").isPresent());
 
         // override m2, m1 and m3 should be found in parent configurations
         ModuleFinder finder = ModuleUtils.finderOf(descriptor2);
-        Configuration cf4 = Configuration.resolveRequires(
+        Configuration cf4 = Configuration.resolve(
                 finder,
                 List.of(cf1, cf2, cf3),
                 ModuleFinder.of(),
@@ -1530,18 +1396,16 @@
      */
     public void testOverriding3() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
                 .build();
 
         ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
 
-        Configuration cf1 = resolveRequires(finder1, "m2");
+        Configuration cf1 = resolve(finder1, "m2");
 
         assertTrue(cf1.modules().size() == 2);
         assertTrue(cf1.findModule("m1").isPresent());
@@ -1549,14 +1413,13 @@
 
         // cf2: m3 requires m2, m1
 
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m2")
                 .build();
 
         ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1, descriptor3);
 
-        Configuration cf2 = resolveRequires(cf1, finder2, "m1", "m3");
+        Configuration cf2 = resolve(cf1, finder2, "m1", "m3");
 
         assertTrue(cf2.parents().size() == 1);
         assertTrue(cf2.parents().get(0) == cf1);
@@ -1585,64 +1448,58 @@
     /**
      * Root module not found
      */
-    @Test(expectedExceptions = { ResolutionException.class })
+    @Test(expectedExceptions = { FindException.class })
     public void testRootNotFound() {
-        resolveRequires(ModuleFinder.of(), "m1");
+        resolve(ModuleFinder.of(), "m1");
     }
 
 
     /**
      * Direct dependency not found
      */
-    @Test(expectedExceptions = { ResolutionException.class })
+    @Test(expectedExceptions = { FindException.class })
     public void testDirectDependencyNotFound() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1").requires("m2").build();
+        ModuleDescriptor descriptor1 = newBuilder("m1").requires("m2").build();
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
-        resolveRequires(finder, "m1");
+        resolve(finder, "m1");
     }
 
 
     /**
      * Transitive dependency not found
      */
-    @Test(expectedExceptions = { ResolutionException.class })
+    @Test(expectedExceptions = { FindException.class })
     public void testTransitiveDependencyNotFound() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1").requires("m2").build();
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2").requires("m3").build();
+        ModuleDescriptor descriptor1 = newBuilder("m1").requires("m2").build();
+        ModuleDescriptor descriptor2 = newBuilder("m2").requires("m3").build();
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
-        resolveRequires(finder, "m1");
+        resolve(finder, "m1");
     }
 
 
     /**
      * Service provider dependency not found
      */
-    @Test(expectedExceptions = { ResolutionException.class })
+    @Test(expectedExceptions = { FindException.class })
     public void testServiceProviderDependencyNotFound() {
 
         // service provider dependency (on m3) not found
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .exports("p")
                 .uses("p.S")
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
                 .requires("m3")
-                .contains("q")
-                .provides("p.S", "q.T")
+                .provides("p.S", List.of("q.T"))
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
 
         // should throw ResolutionException because m3 is not found
-        Configuration cf = resolveRequiresAndUses(finder, "m1");
+        Configuration cf = resolveAndBind(finder, "m1");
     }
 
 
@@ -1651,15 +1508,12 @@
      */
     @Test(expectedExceptions = { ResolutionException.class })
     public void testSimpleCycle() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1").requires("m2").build();
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2").requires("m3").build();
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3").requires("m1").build();
+        ModuleDescriptor descriptor1 = newBuilder("m1").requires("m2").build();
+        ModuleDescriptor descriptor2 = newBuilder("m2").requires("m3").build();
+        ModuleDescriptor descriptor3 = newBuilder("m3").requires("m1").build();
         ModuleFinder finder
             = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
-        resolveRequires(finder, "m1");
+        resolve(finder, "m1");
     }
 
     /**
@@ -1668,20 +1522,16 @@
     @Test(expectedExceptions = { ResolutionException.class })
     public void testCycleInProvider() {
 
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .exports("p")
                 .uses("p.S")
                 .build();
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
                 .requires("m3")
-                .contains("q")
-                .provides("p.S", "q.T")
+                .provides("p.S", List.of("q.T"))
                 .build();
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .requires("m2")
                 .build();
 
@@ -1689,7 +1539,77 @@
             = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
 
         // should throw ResolutionException because of the m2 <--> m3 cycle
-        resolveRequiresAndUses(finder, "m1");
+        resolveAndBind(finder, "m1");
+    }
+
+
+    /**
+     * Basic test to detect reading a module with the same name as itself
+     *
+     * The test consists of three configurations:
+     * - Configuration cf1: m1, m2 requires transitive m1
+     * - Configuration cf2: m1 requires m2
+     */
+    @Test(expectedExceptions = { ResolutionException.class })
+    public void testReadModuleWithSameNameAsSelf() {
+        ModuleDescriptor descriptor1_v1 = newBuilder("m1")
+                .build();
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
+                .build();
+
+        ModuleDescriptor descriptor1_v2 = newBuilder("m1")
+                .requires("m2")
+                .build();
+
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1_v1, descriptor2);
+        Configuration cf1 = resolve(finder1, "m2");
+        assertTrue(cf1.modules().size() == 2);
+
+        // resolve should throw ResolutionException
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1_v2);
+        resolve(cf1, finder2, "m1");
+    }
+
+
+    /**
+     * Basic test to detect reading two modules with the same name
+     *
+     * The test consists of three configurations:
+     * - Configuration cf1: m1, m2 requires transitive m1
+     * - Configuration cf2: m1, m3 requires transitive m1
+     * - Configuration cf3(cf1,cf2): m4 requires m2, m3
+     */
+    @Test(expectedExceptions = { ResolutionException.class })
+    public void testReadTwoModuleWithSameName() {
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .build();
+
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
+                .build();
+
+        ModuleDescriptor descriptor3 = newBuilder("m3")
+                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
+                .build();
+
+        ModuleDescriptor descriptor4 = newBuilder("m4")
+                .requires("m2")
+                .requires("m3")
+                .build();
+
+        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+        Configuration cf1 = resolve(finder1, "m2");
+        assertTrue(cf1.modules().size() == 2);
+
+        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1, descriptor3);
+        Configuration cf2 = resolve(finder2, "m3");
+        assertTrue(cf2.modules().size() == 2);
+
+        // should throw ResolutionException as m4 will read modules named "m1".
+        ModuleFinder finder3 = ModuleUtils.finderOf(descriptor4);
+        Configuration.resolve(finder3, List.of(cf1, cf2), ModuleFinder.of(), Set.of("m4"));
     }
 
 
@@ -1699,19 +1619,16 @@
     @Test(expectedExceptions = { ResolutionException.class })
     public void testPackageSuppliedByTwoOthers() {
 
-        ModuleDescriptor descriptor1
-            =  ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires("m2")
                 .requires("m3")
                 .build();
 
-        ModuleDescriptor descriptor2
-            =  ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .exports("p")
                 .build();
 
-        ModuleDescriptor descriptor3
-            =  ModuleDescriptor.module("m3")
+        ModuleDescriptor descriptor3 = newBuilder("m3")
                 .exports("p", Set.of("m1"))
                 .build();
 
@@ -1719,7 +1636,7 @@
             = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
 
         // m2 and m3 export package p to module m1
-        resolveRequires(finder, "m1");
+        resolve(finder, "m1");
     }
 
 
@@ -1730,21 +1647,19 @@
     @Test(expectedExceptions = { ResolutionException.class })
     public void testPackageSuppliedBySelfAndOther() {
 
-        ModuleDescriptor descriptor1
-            =  ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires("m2")
-                .contains("p")
+                .packages(Set.of("p"))
                 .build();
 
-        ModuleDescriptor descriptor2
-            =  ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .exports("p")
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
 
         // m1 contains package p, module m2 exports package p to m1
-        resolveRequires(finder, "m1");
+        resolve(finder, "m1");
     }
 
 
@@ -1753,20 +1668,18 @@
      * a module that also contains a package p.
      */
     public void testContainsPackageInSelfAndOther() {
-        ModuleDescriptor descriptor1
-            =  ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .requires("m2")
-                .contains("p")
+                .packages(Set.of("p"))
                 .build();
 
-        ModuleDescriptor descriptor2
-            =  ModuleDescriptor.module("m2")
-                .contains("p")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
+                .packages(Set.of("p"))
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
 
-        Configuration cf = resolveRequires(finder, "m1");
+        Configuration cf = resolve(finder, "m1");
 
         assertTrue(cf.modules().size() == 2);
         assertTrue(cf.findModule("m1").isPresent());
@@ -1787,18 +1700,17 @@
      */
     @Test(expectedExceptions = { ResolutionException.class })
     public void testExportSamePackageAsBootLayer() {
-        ModuleDescriptor descriptor
-            =  ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor = newBuilder("m1")
                 .requires("java.base")
                 .exports("java.lang")
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor);
 
-        Configuration bootConfiguration = Layer.boot().configuration();
+        Configuration bootConfiguration = ModuleLayer.boot().configuration();
 
         // m1 contains package java.lang, java.base exports package java.lang to m1
-        resolveRequires(bootConfiguration, finder, "m1");
+        resolve(bootConfiguration, finder, "m1");
     }
 
 
@@ -1806,15 +1718,14 @@
      * Test "uses p.S" where p is contained in the same module.
      */
     public void testContainsService1() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .contains("p")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .packages(Set.of("p"))
                 .uses("p.S")
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf = resolveRequires(finder, "m1");
+        Configuration cf = resolve(finder, "m1");
 
         assertTrue(cf.modules().size() == 1);
         assertTrue(cf.findModule("m1").isPresent());
@@ -1826,13 +1737,11 @@
      */
     @Test(expectedExceptions = { ResolutionException.class })
     public void testContainsService2() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .contains("p")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .packages(Set.of("p"))
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
                 .uses("p.S")
                 .build();
@@ -1840,7 +1749,7 @@
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
 
         // m2 does not read a module that exports p
-        resolveRequires(finder, "m2");
+        resolve(finder, "m2");
     }
 
 
@@ -1848,16 +1757,14 @@
      * Test "provides p.S" where p is contained in the same module.
      */
     public void testContainsService3() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .contains("p")
-                .contains("q")
-                .provides("p.S", "q.S1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .packages(Set.of("p", "q"))
+                .provides("p.S", List.of("q.S1"))
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
 
-        Configuration cf = resolveRequires(finder, "m1");
+        Configuration cf = resolve(finder, "m1");
 
         assertTrue(cf.modules().size() == 1);
         assertTrue(cf.findModule("m1").isPresent());
@@ -1869,22 +1776,19 @@
      */
     @Test(expectedExceptions = { ResolutionException.class })
     public void testContainsService4() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .contains("p")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .packages(Set.of("p"))
                 .build();
 
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
+        ModuleDescriptor descriptor2 = newBuilder("m2")
                 .requires("m1")
-                .contains("q")
-                .provides("p.S", "q.S1")
+                .provides("p.S", List.of("q.S1"))
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
 
         // m2 does not read a module that exports p
-        resolveRequires(finder, "m2");
+        resolve(finder, "m2");
     }
 
 
@@ -1893,15 +1797,14 @@
      */
     @Test(expectedExceptions = { ResolutionException.class })
     public void testServiceTypePackageNotExported1() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
                 .uses("p.S")
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
 
         // m1 does not read a module that exports p
-        resolveRequires(finder, "m1");
+        resolve(finder, "m1");
     }
 
 
@@ -1910,40 +1813,14 @@
      */
     @Test(expectedExceptions = { ResolutionException.class })
     public void testServiceTypePackageNotExported2() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .contains("q")
-                .provides("p.S", "q.T")
+        ModuleDescriptor descriptor1 = newBuilder("m1")
+                .provides("p.S", List.of("q.T"))
                 .build();
 
         ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
 
         // m1 does not read a module that exports p
-        resolveRequires(finder, "m1");
-    }
-
-
-    /**
-     * Test "provides p.S with q.T" where q.T is not local
-     */
-    @Test(expectedExceptions = { ResolutionException.class })
-    public void testProviderPackageNotLocal() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .exports("p")
-                .exports("q")
-                .build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .requires("m1")
-                .provides("p.S", "q.T")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
-
-        // q.T not in module m2
-        resolveRequires(finder, "m2");
+        resolve(finder, "m1");
     }
 
 
@@ -1966,26 +1843,17 @@
     public Object[][] createPlatformMatches() {
         return new Object[][]{
 
-            { "linux-*-*",       "*-*-*" },
-            { "*-arm-*",         "*-*-*" },
-            { "*-*-2.6",         "*-*-*" },
+            { "linux-arm",     "*-*" },
+            { "linux-*",       "*-*" },
+            { "*-arm",         "*-*" },
 
-            { "linux-arm-*",     "*-*-*" },
-            { "linux-*-2.6",     "*-*-*" },
-            { "*-arm-2.6",       "*-*-*" },
+            { "linux-*",       "linux-*" },
+            { "linux-arm",     "linux-*" },
 
-            { "linux-arm-2.6",   "*-*-*" },
+            { "*-arm",         "*-arm" },
+            { "linux-arm",     "*-arm" },
 
-            { "linux-*-*",       "linux-*-*" },
-            { "*-arm-*",         "*-arm-*"   },
-            { "*-*-2.6",         "*-*-2.6"   },
-
-            { "linux-arm-*",     "linux-arm-*" },
-            { "linux-arm-*",     "linux-*-*"   },
-            { "linux-*-2.6",     "linux-*-2.6" },
-            { "linux-*-2.6",     "linux-arm-*" },
-
-            { "linux-arm-2.6",   "linux-arm-2.6" },
+            { "linux-arm",   "linux-arm" },
 
         };
 
@@ -1995,9 +1863,10 @@
     public Object[][] createBad() {
         return new Object[][] {
 
-            { "linux-*-*",        "solaris-*-*"   },
-            { "linux-x86-*",      "linux-arm-*"   },
-            { "linux-*-2.4",      "linux-x86-2.6" },
+            { "linux-*",        "solaris-*"     },
+            { "*-arm",          "*-sparc"       },
+            { "linux-x86",      "solaris-sparc" },
+
         };
     }
 
@@ -2005,38 +1874,25 @@
      * Test creating a configuration containing platform specific modules.
      */
     @Test(dataProvider = "platformmatch")
-    public void testPlatformMatch(String s1, String s2) {
+    public void testPlatformMatch(String s1, String s2) throws IOException {
 
-        ModuleDescriptor.Builder builder
-            = ModuleDescriptor.module("m1").requires("m2");
+        ModuleDescriptor base =  ModuleDescriptor.newModule("java.base").build();
+        Path system = writeModule(base, "*-*");
 
-        String[] s = s1.split("-");
-        if (!s[0].equals("*"))
-            builder.osName(s[0]);
-        if (!s[1].equals("*"))
-            builder.osArch(s[1]);
-        if (!s[2].equals("*"))
-            builder.osVersion(s[2]);
+        ModuleDescriptor descriptor1 = ModuleDescriptor.newModule("m1")
+                .requires("m2")
+                .build();
+        Path dir1 = writeModule(descriptor1, s1);
 
-        ModuleDescriptor descriptor1 = builder.build();
+        ModuleDescriptor descriptor2 = ModuleDescriptor.newModule("m2").build();
+        Path dir2 = writeModule(descriptor2, s2);
 
-        builder = ModuleDescriptor.module("m2");
+        ModuleFinder finder = ModuleFinder.of(system, dir1, dir2);
 
-        s = s2.split("-");
-        if (!s[0].equals("*"))
-            builder.osName(s[0]);
-        if (!s[1].equals("*"))
-            builder.osArch(s[1]);
-        if (!s[2].equals("*"))
-            builder.osVersion(s[2]);
+        Configuration cf = resolve(finder, "m1");
 
-        ModuleDescriptor descriptor2 = builder.build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
-
-        Configuration cf = resolveRequires(finder, "m1");
-
-        assertTrue(cf.modules().size() == 2);
+        assertTrue(cf.modules().size() == 3);
+        assertTrue(cf.findModule("java.base").isPresent());
         assertTrue(cf.findModule("m1").isPresent());
         assertTrue(cf.findModule("m2").isPresent());
     }
@@ -2046,24 +1902,60 @@
      * platforms.
      */
     @Test(dataProvider = "platformmismatch",
-          expectedExceptions = ResolutionException.class )
-    public void testPlatformMisMatch(String s1, String s2) {
+          expectedExceptions = FindException.class )
+    public void testPlatformMisMatch(String s1, String s2) throws IOException {
         testPlatformMatch(s1, s2);
     }
 
-
     // no parents
 
     @Test(expectedExceptions = { IllegalArgumentException.class })
     public void testResolveRequiresWithNoParents() {
         ModuleFinder empty = ModuleFinder.of();
-        Configuration.resolveRequires(empty, List.of(), empty, Set.of());
+        Configuration.resolve(empty, List.of(), empty, Set.of());
     }
 
     @Test(expectedExceptions = { IllegalArgumentException.class })
     public void testResolveRequiresAndUsesWithNoParents() {
         ModuleFinder empty = ModuleFinder.of();
-        Configuration.resolveRequiresAndUses(empty, List.of(), empty, Set.of());
+        Configuration.resolveAndBind(empty, List.of(), empty, Set.of());
+    }
+
+
+    // parents with modules for specific platforms
+    @Test(dataProvider = "platformmatch")
+    public void testResolveRequiresWithCompatibleParents(String s1, String s2)
+        throws IOException
+    {
+        ModuleDescriptor base =  ModuleDescriptor.newModule("java.base").build();
+        Path system = writeModule(base, "*-*");
+
+        ModuleDescriptor descriptor1 = ModuleDescriptor.newModule("m1").build();
+        Path dir1 = writeModule(descriptor1, s1);
+
+        ModuleDescriptor descriptor2 = ModuleDescriptor.newModule("m2").build();
+        Path dir2 = writeModule(descriptor2, s2);
+
+        ModuleFinder finder1 = ModuleFinder.of(system, dir1);
+        Configuration cf1 = resolve(finder1, "m1");
+
+        ModuleFinder finder2 = ModuleFinder.of(system, dir2);
+        Configuration cf2 = resolve(finder2, "m2");
+
+        Configuration cf3 = Configuration.resolve(ModuleFinder.of(),
+                                                  List.of(cf1, cf2),
+                                                  ModuleFinder.of(),
+                                                  Set.of());
+        assertTrue(cf3.parents().size() == 2);
+    }
+
+
+    @Test(dataProvider = "platformmismatch",
+          expectedExceptions = IllegalArgumentException.class )
+    public void testResolveRequiresWithConflictingParents(String s1, String s2)
+        throws IOException
+    {
+        testResolveRequiresWithCompatibleParents(s1, s2);
     }
 
 
@@ -2074,72 +1966,72 @@
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresWithNull1() {
-        resolveRequires((ModuleFinder)null, ModuleFinder.of());
+        resolve((ModuleFinder)null, ModuleFinder.of());
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresWithNull2() {
-        resolveRequires(ModuleFinder.of(), (ModuleFinder)null);
+        resolve(ModuleFinder.of(), (ModuleFinder)null);
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresWithNull3() {
         Configuration empty = Configuration.empty();
-        Configuration.resolveRequires(null, List.of(empty),  ModuleFinder.of(), Set.of());
+        Configuration.resolve(null, List.of(empty),  ModuleFinder.of(), Set.of());
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresWithNull4() {
         ModuleFinder empty = ModuleFinder.of();
-        Configuration.resolveRequires(empty, null, empty, Set.of());
+        Configuration.resolve(empty, null, empty, Set.of());
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresWithNull5() {
-        Configuration cf = Layer.boot().configuration();
-        Configuration.resolveRequires(ModuleFinder.of(), List.of(cf), null, Set.of());
+        Configuration cf = ModuleLayer.boot().configuration();
+        Configuration.resolve(ModuleFinder.of(), List.of(cf), null, Set.of());
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresWithNull6() {
         ModuleFinder empty = ModuleFinder.of();
-        Configuration cf = Layer.boot().configuration();
-        Configuration.resolveRequires(empty, List.of(cf), empty, null);
+        Configuration cf = ModuleLayer.boot().configuration();
+        Configuration.resolve(empty, List.of(cf), empty, null);
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresAndUsesWithNull1() {
-        resolveRequiresAndUses((ModuleFinder) null, ModuleFinder.of());
+        resolveAndBind((ModuleFinder) null, ModuleFinder.of());
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresAndUsesWithNull2() {
-        resolveRequiresAndUses(ModuleFinder.of(), (ModuleFinder) null);
+        resolveAndBind(ModuleFinder.of(), (ModuleFinder) null);
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresAndUsesWithNull3() {
         Configuration empty = Configuration.empty();
-        Configuration.resolveRequiresAndUses(null, List.of(empty), ModuleFinder.of(), Set.of());
+        Configuration.resolveAndBind(null, List.of(empty), ModuleFinder.of(), Set.of());
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresAndUsesWithNull4() {
         ModuleFinder empty = ModuleFinder.of();
-        Configuration.resolveRequiresAndUses(empty, null, empty, Set.of());
+        Configuration.resolveAndBind(empty, null, empty, Set.of());
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresAndUsesWithNull5() {
-        Configuration cf = Layer.boot().configuration();
-        Configuration.resolveRequiresAndUses(ModuleFinder.of(), List.of(cf), null, Set.of());
+        Configuration cf = ModuleLayer.boot().configuration();
+        Configuration.resolveAndBind(ModuleFinder.of(), List.of(cf), null, Set.of());
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testResolveRequiresAndUsesWithNull6() {
         ModuleFinder empty = ModuleFinder.of();
-        Configuration cf = Layer.boot().configuration();
-        Configuration.resolveRequiresAndUses(empty, List.of(cf), empty, null);
+        Configuration cf = ModuleLayer.boot().configuration();
+        Configuration.resolveAndBind(empty, List.of(cf), empty, null);
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
@@ -2151,88 +2043,93 @@
 
     @Test(expectedExceptions = { UnsupportedOperationException.class })
     public void testImmutableSet1() {
-        Configuration cf = Layer.boot().configuration();
+        Configuration cf = ModuleLayer.boot().configuration();
         ResolvedModule base = cf.findModule("java.base").get();
         cf.modules().add(base);
     }
 
     @Test(expectedExceptions = { UnsupportedOperationException.class })
     public void testImmutableSet2() {
-        Configuration cf = Layer.boot().configuration();
+        Configuration cf = ModuleLayer.boot().configuration();
         ResolvedModule base = cf.findModule("java.base").get();
         base.reads().add(base);
     }
 
 
     /**
-     * Invokes parent.resolveRequires(...)
+     * Invokes parent.resolve(...)
      */
-    private Configuration resolveRequires(Configuration parent,
-                                          ModuleFinder before,
-                                          ModuleFinder after,
-                                          String... roots) {
-        return parent.resolveRequires(before, after, Set.of(roots));
+    private Configuration resolve(Configuration parent,
+                                  ModuleFinder before,
+                                  ModuleFinder after,
+                                  String... roots) {
+        return parent.resolve(before, after, Set.of(roots));
     }
 
-    private Configuration resolveRequires(Configuration parent,
-                                          ModuleFinder before,
-                                          String... roots) {
-        return resolveRequires(parent, before, ModuleFinder.of(), roots);
+    private Configuration resolve(Configuration parent,
+                                  ModuleFinder before,
+                                  String... roots) {
+        return resolve(parent, before, ModuleFinder.of(), roots);
     }
 
-    private Configuration resolveRequires(ModuleFinder before,
-                                          ModuleFinder after,
-                                          String... roots) {
-        return resolveRequires(Configuration.empty(), before, after, roots);
+    private Configuration resolve(ModuleFinder before,
+                                  ModuleFinder after,
+                                  String... roots) {
+        return resolve(Configuration.empty(), before, after, roots);
     }
 
-    private Configuration resolveRequires(ModuleFinder before,
-                                          String... roots) {
-        return resolveRequires(Configuration.empty(), before, roots);
+    private Configuration resolve(ModuleFinder before,
+                                  String... roots) {
+        return resolve(Configuration.empty(), before, roots);
     }
 
 
     /**
-     * Invokes parent.resolveRequiresAndUses(...)
+     * Invokes parent.resolveAndBind(...)
      */
-    private Configuration resolveRequiresAndUses(Configuration parent,
-                                                 ModuleFinder before,
-                                                 ModuleFinder after,
-                                                 String... roots) {
-        return parent.resolveRequiresAndUses(before, after, Set.of(roots));
+    private Configuration resolveAndBind(Configuration parent,
+                                         ModuleFinder before,
+                                         ModuleFinder after,
+                                         String... roots) {
+        return parent.resolveAndBind(before, after, Set.of(roots));
     }
 
-    private Configuration resolveRequiresAndUses(Configuration parent,
-                                                 ModuleFinder before,
-                                                 String... roots) {
-        return resolveRequiresAndUses(parent, before, ModuleFinder.of(), roots);
+    private Configuration resolveAndBind(Configuration parent,
+                                         ModuleFinder before,
+                                         String... roots) {
+        return resolveAndBind(parent, before, ModuleFinder.of(), roots);
     }
 
-    private Configuration resolveRequiresAndUses(ModuleFinder before,
-                                                 ModuleFinder after,
-                                                 String... roots) {
-        return resolveRequiresAndUses(Configuration.empty(), before, after, roots);
+    private Configuration resolveAndBind(ModuleFinder before,
+                                         ModuleFinder after,
+                                         String... roots) {
+        return resolveAndBind(Configuration.empty(), before, after, roots);
     }
 
-    private Configuration resolveRequiresAndUses(ModuleFinder before,
-                                                 String... roots) {
-        return resolveRequiresAndUses(Configuration.empty(), before, roots);
+    private Configuration resolveAndBind(ModuleFinder before,
+                                         String... roots) {
+        return resolveAndBind(Configuration.empty(), before, roots);
     }
 
 
     /**
-     * Returns {@code true} if the configuration contains module mn1
-     * that reads module mn2.
+     * Decodes the platform string and calls the builder osName/osArch/osVersion
+     * methods to set the platform constraints.
      */
-    static boolean reads(Configuration cf, String mn1, String mn2) {
-        Optional<ResolvedModule> om1 = cf.findModule(mn1);
-        if (!om1.isPresent())
-            return false;
+    static Path writeModule(ModuleDescriptor descriptor, String platformString)
+        throws IOException
+    {
+        String[] s = platformString.split("-");
+        String osName = !s[0].equals("*") ? s[0] : null;
+        String osArch = !s[1].equals("*") ? s[1] : null;
+        ModuleTarget target = new ModuleTarget(osName, osArch);
 
-        return om1.get().reads().stream()
-                .map(ResolvedModule::name)
-                .anyMatch(mn2::equals);
+        String name = descriptor.name();
+        Path dir = Files.createTempDirectory(name);
+        Path mi = dir.resolve("module-info.class");
+        try (OutputStream out = Files.newOutputStream(mi)) {
+            ModuleInfoWriter.write(descriptor, target, out);
+        }
+        return dir;
     }
-
-
 }
diff --git a/jdk/test/java/lang/module/ModuleDescriptorTest.java b/jdk/test/java/lang/module/ModuleDescriptorTest.java
index 276ecf7..f4726a5 100644
--- a/jdk/test/java/lang/module/ModuleDescriptorTest.java
+++ b/jdk/test/java/lang/module/ModuleDescriptorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /**
  * @test
  * @modules java.base/jdk.internal.module
+ *          java.base/jdk.internal.misc
  * @run testng ModuleDescriptorTest
  * @summary Basic test for java.lang.module.ModuleDescriptor and its builder
  */
@@ -40,16 +41,22 @@
 import java.lang.module.ModuleDescriptor.Provides;
 import java.lang.module.ModuleDescriptor.Requires.Modifier;
 import java.lang.module.ModuleDescriptor.Version;
-import java.lang.reflect.Module;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import static java.lang.module.ModuleDescriptor.Requires.Modifier.*;
 
+import jdk.internal.misc.JavaLangModuleAccess;
+import jdk.internal.misc.SharedSecrets;
 import jdk.internal.module.ModuleInfoWriter;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
@@ -84,21 +91,27 @@
     // requires
 
     private Requires requires(Set<Modifier> mods, String mn) {
-        return ModuleDescriptor.module("m")
-            .requires(mods, mn)
-            .build()
-            .requires()
-            .iterator()
-            .next();
+        return requires(mods, mn, null);
     }
 
     private Requires requires(Set<Modifier> mods, String mn, Version v) {
-        return ModuleDescriptor.module("m")
-            .requires(mods, mn, v)
-            .build()
-            .requires()
-            .iterator()
-            .next();
+        Builder builder = ModuleDescriptor.newModule("m");
+        if (v == null) {
+            builder.requires(mods, mn);
+        } else {
+            builder.requires(mods, mn, v);
+        }
+        Set<Requires> requires = builder.build().requires();
+        assertTrue(requires.size() == 2);
+        Iterator<Requires> iterator = requires.iterator();
+        Requires r = iterator.next();
+        if (r.name().equals("java.base")) {
+            r = iterator.next();
+        } else {
+            Requires other = iterator.next();
+            assertEquals(other.name(), "java.base");
+        }
+        return r;
     }
 
     private Requires requires(String mn) {
@@ -107,7 +120,7 @@
 
     public void testRequiresWithRequires() {
         Requires r1 = requires("foo");
-        ModuleDescriptor descriptor = ModuleDescriptor.module("m").requires(r1).build();
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule("m").requires(r1).build();
         Requires r2 = descriptor.requires().iterator().next();
         assertEquals(r1, r2);
     }
@@ -162,28 +175,28 @@
     @Test(expectedExceptions = IllegalStateException.class)
     public void testRequiresWithDuplicatesRequires() {
         Requires r = requires("foo");
-        ModuleDescriptor.module("m").requires(r).requires(r);
+        ModuleDescriptor.newModule("m").requires(r).requires(r);
     }
 
     @Test(expectedExceptions = IllegalArgumentException.class)
     public void testRequiresSelfWithRequires() {
         Requires r = requires("foo");
-        ModuleDescriptor.module("foo").requires(r);
+        ModuleDescriptor.newModule("foo").requires(r);
     }
 
     @Test(expectedExceptions = IllegalArgumentException.class)
     public void testRequiresSelfWithNoModifier() {
-        ModuleDescriptor.module("m").requires("m");
+        ModuleDescriptor.newModule("m").requires("m");
     }
 
     @Test(expectedExceptions = IllegalArgumentException.class)
     public void testRequiresSelfWithOneModifier() {
-        ModuleDescriptor.module("m").requires(Set.of(TRANSITIVE), "m");
+        ModuleDescriptor.newModule("m").requires(Set.of(TRANSITIVE), "m");
     }
 
     @Test(expectedExceptions = IllegalArgumentException.class)
     public void testRequiresSelfWithAllModifiers() {
-        ModuleDescriptor.module("m").requires(EnumSet.allOf(Modifier.class), "m");
+        ModuleDescriptor.newModule("m").requires(EnumSet.allOf(Modifier.class), "m");
     }
 
     @Test(dataProvider = "invalidjavaidentifiers",
@@ -194,17 +207,17 @@
 
     @Test(expectedExceptions = NullPointerException.class)
     public void testRequiresWithNullRequires() {
-        ModuleDescriptor.module("m").requires((Requires) null);
+        ModuleDescriptor.newModule("m").requires((Requires) null);
     }
 
     @Test(expectedExceptions = NullPointerException.class)
     public void testRequiresWithNullModifiers() {
-        ModuleDescriptor.module("m").requires(null, "foo");
+        ModuleDescriptor.newModule("m").requires(null, "foo");
     }
 
     @Test(expectedExceptions = NullPointerException.class)
     public void testRequiresWithNullVersion() {
-        ModuleDescriptor.module("m").requires(Set.of(), "foo", null);
+        ModuleDescriptor.newModule("m").requires(Set.of(), "foo", null);
     }
 
     public void testRequiresCompare() {
@@ -284,7 +297,7 @@
     // exports
 
     private Exports exports(Set<Exports.Modifier> mods, String pn) {
-        return ModuleDescriptor.module("foo")
+        return ModuleDescriptor.newModule("foo")
             .exports(mods, pn)
             .build()
             .exports()
@@ -297,7 +310,7 @@
     }
 
     private Exports exports(Set<Exports.Modifier> mods, String pn, String target) {
-        return ModuleDescriptor.module("foo")
+        return ModuleDescriptor.newModule("foo")
             .exports(mods, pn, Set.of(target))
             .build()
             .exports()
@@ -312,7 +325,7 @@
 
     public void testExportsExports() {
         Exports e1 = exports("p");
-        ModuleDescriptor descriptor = ModuleDescriptor.module("m").exports(e1).build();
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule("m").exports(e1).build();
         Exports e2 = descriptor.exports().iterator().next();
         assertEquals(e1, e2);
     }
@@ -341,7 +354,7 @@
         targets.add("bar");
         targets.add("gus");
         Exports e
-            = ModuleDescriptor.module("foo")
+            = ModuleDescriptor.newModule("foo")
                 .exports("p", targets)
                 .build()
                 .exports()
@@ -380,69 +393,80 @@
     @Test(expectedExceptions = IllegalStateException.class)
     public void testExportsWithDuplicate1() {
         Exports e = exports("p");
-        ModuleDescriptor.module("foo").exports(e).exports(e);
+        ModuleDescriptor.newModule("foo").exports(e).exports(e);
     }
 
     @Test(expectedExceptions = IllegalStateException.class)
     public void testExportsWithDuplicate2() {
-        ModuleDescriptor.module("foo").exports("p").exports("p");
-    }
-
-    @Test(expectedExceptions = IllegalStateException.class)
-    public void testExportsOnContainedPackage() {
-        ModuleDescriptor.module("foo").contains("p").exports("p");
-    }
-
-    @Test(expectedExceptions = IllegalStateException.class)
-    public void testExportsToTargetOnContainedPackage() {
-        ModuleDescriptor.module("foo").contains("p").exports("p", Set.of("bar"));
+        ModuleDescriptor.newModule("foo").exports("p").exports("p");
     }
 
     @Test(expectedExceptions = IllegalArgumentException.class )
     public void testExportsWithEmptySet() {
-        ModuleDescriptor.module("foo").exports("p", Collections.emptySet());
+        ModuleDescriptor.newModule("foo").exports("p", Collections.emptySet());
     }
 
     @Test(dataProvider = "invalidjavaidentifiers",
           expectedExceptions = IllegalArgumentException.class )
     public void testExportsWithBadName(String pn, String ignore) {
-        ModuleDescriptor.module("foo").exports(pn);
+        ModuleDescriptor.newModule("foo").exports(pn);
     }
 
     @Test(expectedExceptions = NullPointerException.class )
     public void testExportsWithNullExports() {
-        ModuleDescriptor.module("foo").exports((Exports) null);
+        ModuleDescriptor.newModule("foo").exports((Exports) null);
     }
 
     @Test(expectedExceptions = NullPointerException.class )
     public void testExportsWithNullTargets() {
-        ModuleDescriptor.module("foo").exports("p", (Set<String>) null);
+        ModuleDescriptor.newModule("foo").exports("p", (Set<String>) null);
     }
 
-    public void testExportsEqualsAndHashCode() {
-        Exports e1, e2;
-
-        e1 = exports("p");
-        e2 = exports("p");
+    public void testExportsCompare() {
+        Exports e1 = exports("p");
+        Exports e2 = exports("p");
         assertEquals(e1, e2);
         assertTrue(e1.hashCode() == e2.hashCode());
+        assertTrue(e1.compareTo(e2) == 0);
+        assertTrue(e2.compareTo(e1) == 0);
+    }
 
-        e1 = exports(Set.of(Exports.Modifier.SYNTHETIC), "p");
-        e2 = exports(Set.of(Exports.Modifier.SYNTHETIC), "p");
+    public void testExportsCompareWithSameModifiers() {
+        Exports e1 = exports(Set.of(Exports.Modifier.SYNTHETIC), "p");
+        Exports e2 = exports(Set.of(Exports.Modifier.SYNTHETIC), "p");
         assertEquals(e1, e2);
         assertTrue(e1.hashCode() == e2.hashCode());
+        assertTrue(e1.compareTo(e2) == 0);
+        assertTrue(e2.compareTo(e1) == 0);
+    }
 
-        e1 = exports("p");
-        e2 = exports("q");
+    public void testExportsCompareWithDifferentModifiers() {
+        Exports e1 = exports(Set.of(Exports.Modifier.SYNTHETIC), "p");
+        Exports e2 = exports("p");
         assertNotEquals(e1, e2);
+        assertTrue(e1.compareTo(e2) == 1);
+        assertTrue(e2.compareTo(e1) == -1);
+    }
 
-        e1 = exports(Set.of(Exports.Modifier.SYNTHETIC), "p");
-        e2 = exports(Set.of(), "p");
+    public void testExportsCompareWithSameTargets() {
+        Exports e1 = exports("p", "x");
+        Exports e2 = exports("p", "x");
+        assertEquals(e1, e2);
+        assertTrue(e1.hashCode() == e2.hashCode());
+        assertTrue(e1.compareTo(e2) == 0);
+        assertTrue(e2.compareTo(e1) == 0);
+    }
+
+    public void testExportsCompareWithDifferentTargets() {
+        Exports e1 = exports("p", "y");
+        Exports e2 = exports("p", "x");
         assertNotEquals(e1, e2);
+        assertTrue(e1.compareTo(e2) == 1);
+        assertTrue(e2.compareTo(e1) == -1);
     }
 
     public void testExportsToString() {
-        String s = ModuleDescriptor.module("foo")
+        String s = ModuleDescriptor.newModule("foo")
             .exports("p1", Set.of("bar"))
             .build()
             .exports()
@@ -457,7 +481,7 @@
     // opens
 
     private Opens opens(Set<Opens.Modifier> mods, String pn) {
-        return ModuleDescriptor.module("foo")
+        return ModuleDescriptor.newModule("foo")
                 .opens(mods, pn)
                 .build()
                 .opens()
@@ -470,7 +494,7 @@
     }
 
     private Opens opens(Set<Opens.Modifier> mods, String pn, String target) {
-        return ModuleDescriptor.module("foo")
+        return ModuleDescriptor.newModule("foo")
                 .opens(mods, pn, Set.of(target))
                 .build()
                 .opens()
@@ -484,7 +508,7 @@
 
     public void testOpensOpens() {
         Opens o1 = opens("p");
-        ModuleDescriptor descriptor = ModuleDescriptor.module("m").opens(o1).build();
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule("m").opens(o1).build();
         Opens o2 = descriptor.opens().iterator().next();
         assertEquals(o1, o2);
     }
@@ -513,7 +537,7 @@
         Set<String> targets = new HashSet<>();
         targets.add("bar");
         targets.add("gus");
-        Opens o = ModuleDescriptor.module("foo")
+        Opens o = ModuleDescriptor.newModule("foo")
                 .opens("p", targets)
                 .build()
                 .opens()
@@ -528,98 +552,83 @@
         assertTrue(o.targets().contains("gus"));
     }
 
-    /*
-
-    public void testOpensToAllWithModifier() {
-        Exports e = exports(Set.of(Exports.Modifier.SYNTHETIC), "p");
-        assertEquals(e, e);
-        assertTrue(e.modifiers().size() == 1);
-        assertTrue(e.modifiers().contains(Exports.Modifier.SYNTHETIC));
-        assertEquals(e.source(), "p");
-        assertFalse(e.isQualified());
-        assertTrue(e.targets().isEmpty());
-    }
-
-    public void testOpensToTargetWithModifier() {
-        Exports e = exports(Set.of(Exports.Modifier.SYNTHETIC), "p", Set.of("bar"));
-        assertEquals(e, e);
-        assertTrue(e.modifiers().size() == 1);
-        assertTrue(e.modifiers().contains(Exports.Modifier.SYNTHETIC));
-        assertEquals(e.source(), "p");
-        assertTrue(e.isQualified());
-        assertTrue(e.targets().size() == 1);
-        assertTrue(e.targets().contains("bar"));
-    }
-
-
-    */
-
     @Test(expectedExceptions = IllegalStateException.class)
     public void testOpensWithDuplicate1() {
         Opens o = opens("p");
-        ModuleDescriptor.module("foo").opens(o).opens(o);
+        ModuleDescriptor.newModule("foo").opens(o).opens(o);
     }
 
     @Test(expectedExceptions = IllegalStateException.class)
     public void testOpensWithDuplicate2() {
-        ModuleDescriptor.module("foo").opens("p").opens("p");
-    }
-
-    @Test(expectedExceptions = IllegalStateException.class)
-    public void testOpensOnContainedPackage() {
-        ModuleDescriptor.module("foo").contains("p").opens("p");
-    }
-
-    @Test(expectedExceptions = IllegalStateException.class)
-    public void testOpensToTargetOnContainedPackage() {
-        ModuleDescriptor.module("foo").contains("p").opens("p", Set.of("bar"));
+        ModuleDescriptor.newModule("foo").opens("p").opens("p");
     }
 
     @Test(expectedExceptions = IllegalArgumentException.class )
     public void testOpensWithEmptySet() {
-        ModuleDescriptor.module("foo").opens("p", Collections.emptySet());
+        ModuleDescriptor.newModule("foo").opens("p", Collections.emptySet());
     }
 
     @Test(dataProvider = "invalidjavaidentifiers",
             expectedExceptions = IllegalArgumentException.class )
     public void testOpensWithBadName(String pn, String ignore) {
-        ModuleDescriptor.module("foo").opens(pn);
+        ModuleDescriptor.newModule("foo").opens(pn);
     }
 
     @Test(expectedExceptions = NullPointerException.class )
     public void testOpensWithNullExports() {
-        ModuleDescriptor.module("foo").opens((Opens) null);
+        ModuleDescriptor.newModule("foo").opens((Opens) null);
     }
 
     @Test(expectedExceptions = NullPointerException.class )
     public void testOpensWithNullTargets() {
-        ModuleDescriptor.module("foo").opens("p", (Set<String>) null);
+        ModuleDescriptor.newModule("foo").opens("p", (Set<String>) null);
     }
 
-    public void testOpensEqualsAndHashCode() {
-        Opens o1, o2;
-
-        o1 = opens("p");
-        o2 = opens("p");
-        assertEquals(o1, o2);
-        assertTrue(o1.hashCode() == o1.hashCode());
-
-        o1 = opens(Set.of(Opens.Modifier.SYNTHETIC), "p");
-        o2 = opens(Set.of(Opens.Modifier.SYNTHETIC), "p");
+    public void testOpensCompare() {
+        Opens o1 = opens("p");
+        Opens o2 = opens("p");
         assertEquals(o1, o2);
         assertTrue(o1.hashCode() == o2.hashCode());
+        assertTrue(o1.compareTo(o2) == 0);
+        assertTrue(o2.compareTo(o1) == 0);
+    }
 
-        o1 = opens("p");
-        o2 = opens("q");
-        assertNotEquals(o1, o2);
+    public void testOpensCompareWithSameModifiers() {
+        Opens o1 = opens(Set.of(Opens.Modifier.SYNTHETIC), "p");
+        Opens o2 = opens(Set.of(Opens.Modifier.SYNTHETIC), "p");
+        assertEquals(o1, o2);
+        assertTrue(o1.hashCode() == o2.hashCode());
+        assertTrue(o1.compareTo(o2) == 0);
+        assertTrue(o2.compareTo(o1) == 0);
+    }
 
-        o1 = opens(Set.of(Opens.Modifier.SYNTHETIC), "p");
-        o2 = opens(Set.of(), "p");
+    public void testOpensCompareWithDifferentModifiers() {
+        Opens o1 = opens(Set.of(Opens.Modifier.SYNTHETIC), "p");
+        Opens o2 = opens("p");
         assertNotEquals(o1, o2);
+        assertTrue(o1.compareTo(o2) == 1);
+        assertTrue(o2.compareTo(o1) == -1);
+    }
+
+    public void testOpensCompareWithSameTargets() {
+        Opens o1 = opens("p", "x");
+        Opens o2 = opens("p", "x");
+        assertEquals(o1, o2);
+        assertTrue(o1.hashCode() == o2.hashCode());
+        assertTrue(o1.compareTo(o2) == 0);
+        assertTrue(o2.compareTo(o1) == 0);
+    }
+
+    public void testOpensCompareWithDifferentTargets() {
+        Opens o1 = opens("p", "y");
+        Opens o2 = opens("p", "x");
+        assertNotEquals(o1, o2);
+        assertTrue(o1.compareTo(o2) == 1);
+        assertTrue(o2.compareTo(o1) == -1);
     }
 
     public void testOpensToString() {
-        String s = ModuleDescriptor.module("foo")
+        String s = ModuleDescriptor.newModule("foo")
                 .opens("p1", Set.of("bar"))
                 .build()
                 .opens()
@@ -635,7 +644,7 @@
 
     public void testUses() {
         Set<String> uses
-            = ModuleDescriptor.module("foo")
+            = ModuleDescriptor.newModule("foo")
                 .uses("p.S")
                 .uses("q.S")
                 .build()
@@ -647,30 +656,44 @@
 
     @Test(expectedExceptions = IllegalStateException.class)
     public void testUsesWithDuplicate() {
-        ModuleDescriptor.module("foo").uses("p.S").uses("p.S");
+        ModuleDescriptor.newModule("foo").uses("p.S").uses("p.S");
+    }
+
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testUsesWithSimpleIdentifier() {
+        ModuleDescriptor.newModule("foo").uses("S");
     }
 
     @Test(dataProvider = "invalidjavaidentifiers",
           expectedExceptions = IllegalArgumentException.class )
     public void testUsesWithBadName(String service, String ignore) {
-        ModuleDescriptor.module("foo").uses(service);
+        ModuleDescriptor.newModule("foo").uses(service);
     }
 
 
     // provides
 
     private Provides provides(String st, String pc) {
-        return ModuleDescriptor.module("foo")
-            .provides(st, pc)
+        return ModuleDescriptor.newModule("foo")
+            .provides(st, List.of(pc))
             .build()
             .provides()
             .iterator()
             .next();
     }
 
+    private Provides provides(String st, List<String> pns) {
+        return ModuleDescriptor.newModule("foo")
+                .provides(st, pns)
+                .build()
+                .provides()
+                .iterator()
+                .next();
+    }
+
     public void testProvidesWithProvides() {
         Provides p1 = provides("p.S", "q.S1");
-        ModuleDescriptor descriptor = ModuleDescriptor.module("m")
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule("m")
                 .provides(p1)
                 .build();
         Provides p2 = descriptor.provides().iterator().next();
@@ -679,7 +702,7 @@
 
 
     public void testProvides() {
-        Set<Provides> set = ModuleDescriptor.module("foo")
+        Set<Provides> set = ModuleDescriptor.newModule("foo")
                 .provides("p.S", List.of("q.P1", "q.P2"))
                 .build()
                 .provides();
@@ -696,59 +719,86 @@
     @Test(expectedExceptions = IllegalStateException.class )
     public void testProvidesWithDuplicateProvides() {
         Provides p = provides("p.S", "q.S2");
-        ModuleDescriptor.module("m").provides("p.S", "q.S1").provides(p);
+        ModuleDescriptor.newModule("m").provides("p.S", List.of("q.S1")).provides(p);
     }
 
     @Test(expectedExceptions = IllegalArgumentException.class )
     public void testProvidesWithEmptySet() {
-        ModuleDescriptor.module("foo").provides("p.Service", Collections.emptyList());
+        ModuleDescriptor.newModule("foo").provides("p.Service", Collections.emptyList());
+    }
+
+    @Test(expectedExceptions = IllegalArgumentException.class )
+    public void testProvidesWithSimpleIdentifier1() {
+        ModuleDescriptor.newModule("foo").provides("S", List.of("q.P"));
+    }
+
+    @Test(expectedExceptions = IllegalArgumentException.class )
+    public void testProvidesWithSimpleIdentifier2() {
+        ModuleDescriptor.newModule("foo").provides("p.S", List.of("P"));
     }
 
     @Test(dataProvider = "invalidjavaidentifiers",
           expectedExceptions = IllegalArgumentException.class )
     public void testProvidesWithBadService(String service, String ignore) {
-        ModuleDescriptor.module("foo").provides(service, "p.Provider");
+        ModuleDescriptor.newModule("foo").provides(service, List.of("p.Provider"));
     }
 
     @Test(dataProvider = "invalidjavaidentifiers",
           expectedExceptions = IllegalArgumentException.class )
     public void testProvidesWithBadProvider(String provider, String ignore) {
-        ModuleDescriptor.module("foo").provides("p.Service", provider);
+        List<String> names = new ArrayList<>(); // allows nulls
+        names.add(provider);
+        ModuleDescriptor.newModule("foo").provides("p.Service", names);
     }
 
     @Test(expectedExceptions = NullPointerException.class )
     public void testProvidesWithNullProvides() {
-        ModuleDescriptor.module("foo").provides((Provides) null);
+        ModuleDescriptor.newModule("foo").provides((Provides) null);
     }
 
     @Test(expectedExceptions = NullPointerException.class )
     public void testProvidesWithNullProviders() {
-        ModuleDescriptor.module("foo").provides("p.S", (List<String>) null);
+        ModuleDescriptor.newModule("foo").provides("p.S", (List<String>) null);
     }
 
-    public void testProvidesEqualsAndHashCode() {
-        Provides p1, p2;
-
-        p1 = provides("p.S", "q.S1");
-        p2 = provides("p.S", "q.S1");
+    public void testProvidesCompare() {
+        Provides p1 = provides("p.S", "q.S1");
+        Provides p2 = provides("p.S", "q.S1");
         assertEquals(p1, p2);
         assertTrue(p1.hashCode() == p2.hashCode());
-
-        p1 = provides("p.S", "q.S1");
-        p2 = provides("p.S", "q.S2");
-        assertNotEquals(p1, p2);
-
-        p1 = provides("p.S", "q.S1");
-        p2 = provides("p.S2", "q.S1");
-        assertNotEquals(p1, p2);
+        assertTrue(p1.compareTo(p2) == 0);
+        assertTrue(p2.compareTo(p1) == 0);
     }
 
-    // contains
+    public void testProvidesCompareWithDifferentService() {
+        Provides p1 = provides("p.S2", "q.S1");
+        Provides p2 = provides("p.S1", "q.S1");
+        assertNotEquals(p1, p2);
+        assertTrue(p1.compareTo(p2) == 1);
+        assertTrue(p2.compareTo(p1) == -1);
+    }
 
-    public void testContains() {
-        Set<String> packages = ModuleDescriptor.module("foo")
-                .contains("p")
-                .contains("q")
+    public void testProvidesCompareWithDifferentProviders1() {
+        Provides p1 = provides("p.S", "q.S2");
+        Provides p2 = provides("p.S", "q.S1");
+        assertNotEquals(p1, p2);
+        assertTrue(p1.compareTo(p2) == 1);
+        assertTrue(p2.compareTo(p1) == -1);
+    }
+
+    public void testProvidesCompareWithDifferentProviders2() {
+        Provides p1 = provides("p.S", List.of("q.S1", "q.S2"));
+        Provides p2 = provides("p.S", "q.S1");
+        assertNotEquals(p1, p2);
+        assertTrue(p1.compareTo(p2) == 1);
+        assertTrue(p2.compareTo(p1) == -1);
+    }
+
+    // packages
+
+    public void testPackages1() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .packages(Set.of("p", "q"))
                 .build()
                 .packages();
         assertTrue(packages.size() == 2);
@@ -756,56 +806,147 @@
         assertTrue(packages.contains("q"));
     }
 
-    public void testContainsWithEmptySet() {
-        Set<String> packages = ModuleDescriptor.module("foo")
-                .contains(Collections.emptySet())
+    public void testPackages2() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .packages(Set.of("p"))
+                .packages(Set.of("q"))
+                .build()
+                .packages();
+        assertTrue(packages.size() == 2);
+        assertTrue(packages.contains("p"));
+        assertTrue(packages.contains("q"));
+    }
+
+
+    public void testPackagesWithEmptySet() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .packages(Collections.emptySet())
                 .build()
                 .packages();
         assertTrue(packages.size() == 0);
     }
 
-    @Test(expectedExceptions = IllegalStateException.class)
-    public void testContainsWithDuplicate() {
-        ModuleDescriptor.module("foo").contains("p").contains("p");
+    public void testPackagesDuplicate() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .packages(Set.of("p"))
+                .packages(Set.of("p"))
+                .build()
+                .packages();
+        assertTrue(packages.size() == 1);
+        assertTrue(packages.contains("p"));
     }
 
-    @Test(expectedExceptions = IllegalStateException.class)
-    public void testContainsWithExportedPackage() {
-        ModuleDescriptor.module("foo").exports("p").contains("p");
+    public void testPackagesAndExportsPackage1() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .packages(Set.of("p"))
+                .exports("p")
+                .build()
+                .packages();
+        assertTrue(packages.size() == 1);
+        assertTrue(packages.contains("p"));
+    }
+
+    public void testPackagesAndExportsPackage2() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .exports("p")
+                .packages(Set.of("p"))
+                .build()
+                .packages();
+        assertTrue(packages.size() == 1);
+        assertTrue(packages.contains("p"));
+    }
+
+    public void testPackagesAndOpensPackage1() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .packages(Set.of("p"))
+                .opens("p")
+                .build()
+                .packages();
+        assertTrue(packages.size() == 1);
+        assertTrue(packages.contains("p"));
+    }
+
+    public void testPackagesAndOpensPackage2() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .opens("p")
+                .packages(Set.of("p"))
+                .build()
+                .packages();
+        assertTrue(packages.size() == 1);
+        assertTrue(packages.contains("p"));
+    }
+
+    public void testPackagesAndProvides1() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .packages(Set.of("p"))
+                .provides("q.S", List.of("p.T"))
+                .build()
+                .packages();
+        assertTrue(packages.size() == 1);
+        assertTrue(packages.contains("p"));
+    }
+
+    public void testPackagesAndProvides2() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .provides("q.S", List.of("p.T"))
+                .packages(Set.of("p"))
+                .build()
+                .packages();
+        assertTrue(packages.size() == 1);
+        assertTrue(packages.contains("p"));
+    }
+
+    public void testPackagesAndMainClass1() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .packages(Set.of("p"))
+                .mainClass("p.Main")
+                .build()
+                .packages();
+        assertTrue(packages.size() == 1);
+        assertTrue(packages.contains("p"));
+    }
+
+    public void testPackagesAndMainClass2() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .mainClass("p.Main")
+                .packages(Set.of("p"))
+                .build()
+                .packages();
+        assertTrue(packages.size() == 1);
+        assertTrue(packages.contains("p"));
+    }
+
+    public void testPackagesAndAll() {
+        Set<String> packages = ModuleDescriptor.newModule("foo")
+                .exports("p1")
+                .opens("p2")
+                .packages(Set.of("p3"))
+                .provides("q.S", List.of("p4.T"))
+                .mainClass("p5.Main")
+                .build()
+                .packages();
+        assertTrue(Objects.equals(packages, Set.of("p1", "p2", "p3", "p4", "p5")));
     }
 
     @Test(dataProvider = "invalidjavaidentifiers",
           expectedExceptions = IllegalArgumentException.class )
-    public void testContainsWithBadName(String pn, String ignore) {
-        ModuleDescriptor.module("foo").contains(pn);
+    public void testPackagesWithBadName(String pn, String ignore) {
+        Set<String> pkgs = new HashSet<>();  // allows nulls
+        pkgs.add(pn);
+        ModuleDescriptor.newModule("foo").packages(pkgs);
     }
 
-
-    // packages
-
-    public void testPackages() {
-        Set<String> packages = ModuleDescriptor.module("foo")
-                .exports("p")
-                .contains("q")
-                .build()
-                .packages();
-        assertTrue(packages.size() == 2);
-        assertTrue(packages.contains("p"));
-        assertTrue(packages.contains("q"));
-    }
-
-
     // name
 
     public void testModuleName() {
-        String mn = ModuleDescriptor.module("foo").build().name();
+        String mn = ModuleDescriptor.newModule("foo").build().name();
         assertEquals(mn, "foo");
     }
 
     @Test(dataProvider = "invalidjavaidentifiers",
           expectedExceptions = IllegalArgumentException.class )
     public void testBadModuleName(String mn, String ignore) {
-        ModuleDescriptor.module(mn);
+        ModuleDescriptor.newModule(mn);
     }
 
 
@@ -813,7 +954,7 @@
 
     public void testVersion1() {
         Version v1 = Version.parse("1.0");
-        Version v2 = ModuleDescriptor.module("foo")
+        Version v2 = ModuleDescriptor.newModule("foo")
                 .version(v1)
                 .build()
                 .version()
@@ -823,7 +964,7 @@
 
     public void testVersion2() {
         String vs = "1.0";
-        Version v1 = ModuleDescriptor.module("foo")
+        Version v1 = ModuleDescriptor.newModule("foo")
                 .version(vs)
                 .build()
                 .version()
@@ -834,86 +975,279 @@
 
     @Test(expectedExceptions = NullPointerException.class )
     public void testNullVersion1() {
-        ModuleDescriptor.module("foo").version((Version) null);
+        ModuleDescriptor.newModule("foo").version((Version) null);
     }
 
     @Test(expectedExceptions = IllegalArgumentException.class )
     public void testNullVersion2() {
-        ModuleDescriptor.module("foo").version((String) null);
+        ModuleDescriptor.newModule("foo").version((String) null);
     }
 
     @Test(expectedExceptions = IllegalArgumentException.class )
     public void testEmptyVersion() {
-        ModuleDescriptor.module("foo").version("");
+        ModuleDescriptor.newModule("foo").version("");
+    }
+
+
+    @DataProvider(name = "unparseableVersions")
+    public Object[][] unparseableVersions() {
+        return new Object[][]{
+
+                { null,  "A1" },    // no version < unparseable
+                { "A1",  "A2" },    // unparseable < unparseable
+                { "A1",  "1.0" },   // unparseable < parseable
+
+        };
+    }
+
+    /**
+     * Basic test for unparseable module versions
+     */
+    @Test(dataProvider = "unparseableVersions")
+    public void testUnparseableModuleVersion(String vs1, String vs2) {
+        ModuleDescriptor descriptor1 = newModule("m", vs1);
+        ModuleDescriptor descriptor2 = newModule("m", vs2);
+
+        if (vs1 != null && !isParsableVersion(vs1)) {
+            assertFalse(descriptor1.version().isPresent());
+            assertTrue(descriptor1.rawVersion().isPresent());
+            assertEquals(descriptor1.rawVersion().get(), vs1);
+        }
+
+        if (vs2 != null && !isParsableVersion(vs2)) {
+            assertFalse(descriptor2.version().isPresent());
+            assertTrue(descriptor2.rawVersion().isPresent());
+            assertEquals(descriptor2.rawVersion().get(), vs2);
+        }
+
+        assertFalse(descriptor1.equals(descriptor2));
+        assertFalse(descriptor2.equals(descriptor1));
+        assertTrue(descriptor1.compareTo(descriptor2) == -1);
+        assertTrue(descriptor2.compareTo(descriptor1) == 1);
+    }
+
+    /**
+     * Basic test for requiring a module with an unparseable version recorded
+     * at compile version.
+     */
+    @Test(dataProvider = "unparseableVersions")
+    public void testUnparseableCompiledVersion(String vs1, String vs2) {
+        Requires r1 = newRequires("m", vs1);
+        Requires r2 = newRequires("m", vs2);
+
+        if (vs1 != null && !isParsableVersion(vs1)) {
+            assertFalse(r1.compiledVersion().isPresent());
+            assertTrue(r1.rawCompiledVersion().isPresent());
+            assertEquals(r1.rawCompiledVersion().get(), vs1);
+        }
+
+        if (vs2 != null && !isParsableVersion(vs2)) {
+            assertFalse(r2.compiledVersion().isPresent());
+            assertTrue(r2.rawCompiledVersion().isPresent());
+            assertEquals(r2.rawCompiledVersion().get(), vs2);
+        }
+
+        assertFalse(r1.equals(r2));
+        assertFalse(r2.equals(r1));
+        assertTrue(r1.compareTo(r2) == -1);
+        assertTrue(r2.compareTo(r1) == 1);
+    }
+
+    private ModuleDescriptor newModule(String name, String vs) {
+        JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess();
+        Builder builder = JLMA.newModuleBuilder(name, false, Set.of());
+        if (vs != null)
+            builder.version(vs);
+        builder.requires("java.base");
+        ByteBuffer bb = ModuleInfoWriter.toByteBuffer(builder.build());
+        return ModuleDescriptor.read(bb);
+    }
+
+    private Requires newRequires(String name, String vs) {
+        JavaLangModuleAccess JLMA = SharedSecrets.getJavaLangModuleAccess();
+        Builder builder = JLMA.newModuleBuilder("foo", false, Set.of());
+        if (vs == null) {
+            builder.requires(name);
+        } else {
+            JLMA.requires(builder, Set.of(), name, vs);
+        }
+        Set<ModuleDescriptor.Requires> requires = builder.build().requires();
+        Iterator<ModuleDescriptor.Requires> iterator = requires.iterator();
+        ModuleDescriptor.Requires r = iterator.next();
+        if (r.name().equals("java.base")) {
+            r = iterator.next();
+        }
+        return r;
+    }
+
+    private boolean isParsableVersion(String vs) {
+        try {
+            Version.parse(vs);
+            return true;
+        } catch (IllegalArgumentException e) {
+            return false;
+        }
     }
 
 
     // toNameAndVersion
 
     public void testToNameAndVersion() {
-        ModuleDescriptor md1 = ModuleDescriptor.module("foo").build();
+        ModuleDescriptor md1 = ModuleDescriptor.newModule("foo").build();
         assertEquals(md1.toNameAndVersion(), "foo");
 
-        ModuleDescriptor md2 = ModuleDescriptor.module("foo").version("1.0").build();
+        ModuleDescriptor md2 = ModuleDescriptor.newModule("foo").version("1.0").build();
         assertEquals(md2.toNameAndVersion(), "foo@1.0");
     }
 
 
     // open modules
 
-    public void testOpenModules() {
-        ModuleDescriptor descriptor = ModuleDescriptor.openModule("m")
-                .requires("java.base")
-                .contains("p")
+    public void testOpenModule() {
+        ModuleDescriptor descriptor = ModuleDescriptor.newOpenModule("foo")
+                .requires("bar")
+                .exports("p")
+                .provides("p.Service", List.of("q.ServiceImpl"))
                 .build();
+
+        // modifiers
+        assertTrue(descriptor.modifiers().contains(ModuleDescriptor.Modifier.OPEN));
         assertTrue(descriptor.isOpen());
-        assertTrue(descriptor.packages().size() == 1);
-        assertTrue(descriptor.packages().contains("p"));
-        assertTrue(descriptor.exports().isEmpty());
+
+        // requires
+        assertTrue(descriptor.requires().size() == 2);
+        Set<String> names = descriptor.requires()
+                .stream()
+                .map(Requires::name)
+                .collect(Collectors.toSet());
+        assertEquals(names, Set.of("bar", "java.base"));
+
+        // packages
+        assertEquals(descriptor.packages(), Set.of("p", "q"));
+
+        // exports
+        assertTrue(descriptor.exports().size() == 1);
+        names = descriptor.exports()
+                .stream()
+                .map(Exports::source)
+                .collect(Collectors.toSet());
+        assertEquals(names, Set.of("p"));
+
+        // opens
+        assertTrue(descriptor.opens().isEmpty());
     }
 
     @Test(expectedExceptions = IllegalStateException.class)
-    public void testOpensOnWeakModule1() {
-        ModuleDescriptor.openModule("foo").opens("p");
+    public void testOpensOnOpenModule1() {
+        ModuleDescriptor.newOpenModule("foo").opens("p");
     }
 
     @Test(expectedExceptions = IllegalStateException.class)
-    public void testOpensOnWeakModule2() {
-        ModuleDescriptor.openModule("foo").opens("p", Set.of("bar"));
+    public void testOpensOnOpenModule2() {
+        ModuleDescriptor.newOpenModule("foo").opens("p", Set.of("bar"));
     }
 
     public void testIsOpen() {
-        assertFalse(ModuleDescriptor.module("m").build().isOpen());
-        assertFalse(ModuleDescriptor.automaticModule("m").build().isOpen());
-        assertTrue(ModuleDescriptor.openModule("m").build().isOpen());
+        assertFalse(ModuleDescriptor.newModule("m").build().isOpen());
+        assertFalse(ModuleDescriptor.newAutomaticModule("m").build().isOpen());
+        assertTrue(ModuleDescriptor.newOpenModule("m").build().isOpen());
     }
 
 
     // automatic modules
 
+    public void testAutomaticModule() {
+        ModuleDescriptor descriptor = ModuleDescriptor.newAutomaticModule("foo")
+                .packages(Set.of("p"))
+                .provides("p.Service", List.of("q.ServiceImpl"))
+                .build();
+
+        // modifiers
+        assertTrue(descriptor.modifiers().contains(ModuleDescriptor.Modifier.AUTOMATIC));
+        assertTrue(descriptor.isAutomatic());
+
+        // requires
+        assertTrue(descriptor.requires().size() == 1);
+        Set<String> names = descriptor.requires()
+                .stream()
+                .map(Requires::name)
+                .collect(Collectors.toSet());
+        assertEquals(names, Set.of("java.base"));
+
+        // packages
+        assertEquals(descriptor.packages(), Set.of("p", "q"));
+        assertTrue(descriptor.exports().isEmpty());
+        assertTrue(descriptor.opens().isEmpty());
+    }
+
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void testRequiresOnAutomaticModule() {
+        ModuleDescriptor.newAutomaticModule("foo").requires("java.base");
+    }
+
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void testExportsOnAutomaticModule1() {
+        ModuleDescriptor.newAutomaticModule("foo").exports("p");
+    }
+
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void testExportsOnAutomaticModule2() {
+        ModuleDescriptor.newAutomaticModule("foo").exports("p", Set.of("bar"));
+    }
+
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void testOpensOnAutomaticModule1() {
+        ModuleDescriptor.newAutomaticModule("foo").opens("p");
+    }
+
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void testOpensOnAutomaticModule2() {
+        ModuleDescriptor.newAutomaticModule("foo").opens("p", Set.of("bar"));
+    }
+
+    @Test(expectedExceptions = IllegalStateException.class)
+    public void testUsesOnAutomaticModule() {
+        ModuleDescriptor.newAutomaticModule("foo").uses("p.Service");
+    }
+
     public void testIsAutomatic() {
-        ModuleDescriptor descriptor1 = ModuleDescriptor.module("foo").build();
+        ModuleDescriptor descriptor1 = ModuleDescriptor.newModule("foo").build();
         assertFalse(descriptor1.isAutomatic());
 
-        ModuleDescriptor descriptor2 = ModuleDescriptor.openModule("foo").build();
+        ModuleDescriptor descriptor2 = ModuleDescriptor.newOpenModule("foo").build();
         assertFalse(descriptor2.isAutomatic());
 
-        ModuleDescriptor descriptor3 = ModuleDescriptor.automaticModule("foo").build();
+        ModuleDescriptor descriptor3 = ModuleDescriptor.newAutomaticModule("foo").build();
         assertTrue(descriptor3.isAutomatic());
     }
 
-    // isSynthetic
-    public void testIsSynthetic() {
-        assertFalse(Object.class.getModule().getDescriptor().isSynthetic());
 
-        ModuleDescriptor descriptor1 = ModuleDescriptor.module("foo").build();
-        assertFalse(descriptor1.isSynthetic());
+    // newModule with modifiers
 
-        ModuleDescriptor descriptor2 = ModuleDescriptor.openModule("foo").build();
-        assertFalse(descriptor2.isSynthetic());
+    public void testNewModuleToBuildAutomaticModule() {
+        Set<ModuleDescriptor.Modifier> ms = Set.of(ModuleDescriptor.Modifier.AUTOMATIC);
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule("foo", ms).build();
+        assertTrue(descriptor.modifiers().equals(ms));
+        assertTrue(descriptor.isAutomatic());
+    }
 
-        ModuleDescriptor descriptor3 = ModuleDescriptor.automaticModule("foo").build();
-        assertFalse(descriptor3.isSynthetic());
+    public void testNewModuleToBuildOpenModule() {
+        Set<ModuleDescriptor.Modifier> ms = Set.of(ModuleDescriptor.Modifier.OPEN);
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule("foo", ms).build();
+        assertTrue(descriptor.modifiers().equals(ms));
+        assertTrue(descriptor.isOpen());
+
+        ms = Set.of(ModuleDescriptor.Modifier.OPEN, ModuleDescriptor.Modifier.SYNTHETIC);
+        descriptor = ModuleDescriptor.newModule("foo", ms).build();
+        assertTrue(descriptor.modifiers().equals(ms));
+        assertTrue(descriptor.isOpen());
+    }
+
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testNewModuleToBuildAutomaticAndOpenModule() {
+        Set<ModuleDescriptor.Modifier> ms = Set.of(ModuleDescriptor.Modifier.AUTOMATIC,
+                                                   ModuleDescriptor.Modifier.OPEN);
+        ModuleDescriptor.newModule("foo", ms);
     }
 
 
@@ -921,71 +1255,23 @@
 
     public void testMainClass() {
         String mainClass
-            = ModuleDescriptor.module("foo").mainClass("p.Main").build().mainClass().get();
+            = ModuleDescriptor.newModule("foo").mainClass("p.Main").build().mainClass().get();
         assertEquals(mainClass, "p.Main");
     }
 
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testMainClassWithSimpleIdentifier() {
+        ModuleDescriptor.newModule("foo").mainClass("Main");
+    }
+
     @Test(dataProvider = "invalidjavaidentifiers",
           expectedExceptions = IllegalArgumentException.class )
     public void testMainClassWithBadName(String mainClass, String ignore) {
-        Builder builder = ModuleDescriptor.module("foo");
+        Builder builder = ModuleDescriptor.newModule("foo");
         builder.mainClass(mainClass);
     }
 
 
-    // osName
-
-    public void testOsName() {
-        String osName = ModuleDescriptor.module("foo").osName("Linux").build().osName().get();
-        assertEquals(osName, "Linux");
-    }
-
-    @Test(expectedExceptions = IllegalArgumentException.class)
-    public void testNullOsName() {
-        ModuleDescriptor.module("foo").osName(null);
-    }
-
-    @Test(expectedExceptions = IllegalArgumentException.class)
-    public void testEmptyOsName() {
-        ModuleDescriptor.module("foo").osName("");
-    }
-
-
-    // osArch
-
-    public void testOsArch() {
-        String osArch = ModuleDescriptor.module("foo").osName("arm").build().osName().get();
-        assertEquals(osArch, "arm");
-    }
-
-    @Test(expectedExceptions = IllegalArgumentException.class)
-    public void testNullOsArch() {
-        ModuleDescriptor.module("foo").osArch(null);
-    }
-
-    @Test(expectedExceptions = IllegalArgumentException.class)
-    public void testEmptyOsArch() {
-        ModuleDescriptor.module("foo").osArch("");
-    }
-
-
-    // osVersion
-
-    public void testOsVersion() {
-        String osVersion = ModuleDescriptor.module("foo").osName("11.2").build().osName().get();
-        assertEquals(osVersion, "11.2");
-    }
-
-    @Test(expectedExceptions = IllegalArgumentException.class)
-    public void testNullOsVersion() {
-        ModuleDescriptor.module("foo").osVersion(null);
-    }
-
-    @Test(expectedExceptions = IllegalArgumentException.class)
-    public void testEmptyOsVersion() {
-        ModuleDescriptor.module("foo").osVersion("");
-    }
-
     // reads
 
     private static InputStream EMPTY_INPUT_STREAM = new InputStream() {
@@ -1002,7 +1288,9 @@
         }
     };
 
-    // basic test reading module-info.class
+    /**
+     * Basic test reading module-info.class
+     */
     public void testRead() throws Exception {
         Module base = Object.class.getModule();
 
@@ -1019,11 +1307,12 @@
             assertEquals(descriptor.name(), "java.base");
         }
     }
+
     /**
      * Test ModuleDescriptor with a packager finder
      */
     public void testReadsWithPackageFinder() throws Exception {
-        ModuleDescriptor descriptor = ModuleDescriptor.module("foo")
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule("foo")
                 .requires("java.base")
                 .build();
 
@@ -1044,7 +1333,7 @@
      */
     @Test(expectedExceptions = InvalidModuleDescriptorException.class)
     public void testReadsWithBadPackageFinder() throws Exception {
-        ModuleDescriptor descriptor = ModuleDescriptor.module("foo")
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule("foo")
                 .requires("java.base")
                 .exports("p")
                 .build();
@@ -1077,7 +1366,7 @@
     @Test(expectedExceptions = InvalidModuleDescriptorException.class)
     public void testReadOfJavaBaseWithRequires() {
         ModuleDescriptor descriptor
-            = ModuleDescriptor.module("java.base")
+            = ModuleDescriptor.newModule("java.base")
                 .requires("other")
                 .build();
         ByteBuffer bb = ModuleInfoWriter.toByteBuffer(descriptor);
@@ -1087,7 +1376,8 @@
     // The requires table must have an entry for java.base
     @Test(expectedExceptions = InvalidModuleDescriptorException.class)
     public void testReadWithEmptyRequires() {
-        ModuleDescriptor descriptor = ModuleDescriptor.module("m1").build();
+        ModuleDescriptor descriptor = SharedSecrets.getJavaLangModuleAccess()
+                .newModuleBuilder("m1", false, Set.of()).build();
         ByteBuffer bb = ModuleInfoWriter.toByteBuffer(descriptor);
         ModuleDescriptor.read(bb);
     }
@@ -1095,10 +1385,8 @@
     // The requires table must have an entry for java.base
     @Test(expectedExceptions = InvalidModuleDescriptorException.class)
     public void testReadWithNoRequiresBase() {
-        ModuleDescriptor descriptor
-            = ModuleDescriptor.module("m1")
-                .requires("m2")
-                .build();
+        ModuleDescriptor descriptor = SharedSecrets.getJavaLangModuleAccess()
+                .newModuleBuilder("m1", false, Set.of()).requires("m2").build();
         ByteBuffer bb = ModuleInfoWriter.toByteBuffer(descriptor);
         ModuleDescriptor.read(bb);
     }
@@ -1138,22 +1426,50 @@
     // equals/hashCode/compareTo/toString
 
     public void testEqualsAndHashCode() {
-        ModuleDescriptor md1 = ModuleDescriptor.module("foo").build();
-        ModuleDescriptor md2 = ModuleDescriptor.module("foo").build();
+        ModuleDescriptor md1 = ModuleDescriptor.newModule("m").build();
+        ModuleDescriptor md2 = ModuleDescriptor.newModule("m").build();
         assertEquals(md1, md1);
         assertEquals(md1.hashCode(), md2.hashCode());
+        assertTrue(md1.compareTo(md2) == 0);
+        assertTrue(md2.compareTo(md1) == 0);
     }
 
-    public void testCompare() {
-        ModuleDescriptor md1 = ModuleDescriptor.module("foo").build();
-        ModuleDescriptor md2 = ModuleDescriptor.module("bar").build();
-        int n = "foo".compareTo("bar");
-        assertTrue(md1.compareTo(md2) == n);
-        assertTrue(md2.compareTo(md1) == -n);
+    @DataProvider(name = "sortedModuleDescriptors")
+    public Object[][] sortedModuleDescriptors() {
+        return new Object[][]{
+
+            { ModuleDescriptor.newModule("m2").build(),
+              ModuleDescriptor.newModule("m1").build()
+            },
+
+            { ModuleDescriptor.newModule("m").version("2").build(),
+              ModuleDescriptor.newModule("m").version("1").build()
+            },
+
+            { ModuleDescriptor.newModule("m").version("1").build(),
+              ModuleDescriptor.newModule("m").build()
+            },
+
+            { ModuleDescriptor.newOpenModule("m").build(),
+              ModuleDescriptor.newModule("m").build()
+            },
+
+        };
+    }
+
+    @Test(dataProvider = "sortedModuleDescriptors")
+    public void testCompare(ModuleDescriptor md1, ModuleDescriptor md2) {
+        assertNotEquals(md1, md2);
+        assertTrue(md1.compareTo(md2) == 1);
+        assertTrue(md2.compareTo(md1) == -1);
     }
 
     public void testToString() {
-        String s = ModuleDescriptor.module("m1").requires("m2").exports("p1").build().toString();
+        String s = ModuleDescriptor.newModule("m1")
+                .requires("m2")
+                .exports("p1")
+                .build()
+                .toString();
         assertTrue(s.contains("m1"));
         assertTrue(s.contains("m2"));
         assertTrue(s.contains("p1"));
diff --git a/jdk/test/java/lang/module/ModuleFinderTest.java b/jdk/test/java/lang/module/ModuleFinderTest.java
index 278b4b9..79feee5 100644
--- a/jdk/test/java/lang/module/ModuleFinderTest.java
+++ b/jdk/test/java/lang/module/ModuleFinderTest.java
@@ -373,7 +373,7 @@
 
 
     /**
-     * Test ModuleModule with a JAR file containing a .class file in the top
+     * Test ModuleFinder with a JAR file containing a .class file in the top
      * level directory.
      */
     public void testOfOneJarFileWithTopLevelClass() throws Exception {
@@ -386,6 +386,7 @@
             assertTrue(false);
         } catch (FindException e) {
             assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
+            assertTrue(e.getCause().getMessage().contains("Mojo.class"));
         }
 
         finder = ModuleFinder.of(jar);
@@ -394,11 +395,12 @@
             assertTrue(false);
         } catch (FindException e) {
             assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
+            assertTrue(e.getCause().getMessage().contains("Mojo.class"));
         }
     }
 
     /**
-     * Test ModuleModule with a JAR file containing a .class file in the top
+     * Test ModuleFinder with a JAR file containing a .class file in the top
      * level directory.
      */
     public void testOfOneExplodedModuleWithTopLevelClass() throws Exception {
@@ -411,6 +413,7 @@
             assertTrue(false);
         } catch (FindException e) {
             assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
+            assertTrue(e.getCause().getMessage().contains("Mojo.class"));
         }
 
         finder = ModuleFinder.of(m_dir);
@@ -419,6 +422,7 @@
             assertTrue(false);
         } catch (FindException e) {
             assertTrue(e.getCause() instanceof InvalidModuleDescriptorException);
+            assertTrue(e.getCause().getMessage().contains("Mojo.class"));
         }
     }
 
@@ -471,37 +475,11 @@
      * Test ModuleFinder.of with a file path to a directory containing a file
      * that will not be recognized as a module.
      */
-    public void testOfWithUnrecognizedEntryInDirectory() throws Exception {
+    public void testOfWithUnrecognizedEntryInDirectory1() throws Exception {
         Path dir = Files.createTempDirectory(USER_DIR, "mods");
         Files.createTempFile(dir, "m", ".junk");
 
         ModuleFinder finder = ModuleFinder.of(dir);
-        try {
-            finder.find("java.rhubarb");
-            assertTrue(false);
-        } catch (FindException e) {
-            // expected
-        }
-
-        finder = ModuleFinder.of(dir);
-        try {
-            finder.findAll();
-            assertTrue(false);
-        } catch (FindException e) {
-            // expected
-        }
-    }
-
-
-    /**
-     * Test ModuleFinder.of with a file path to a directory containing a file
-     * starting with ".", the file should be ignored.
-     */
-    public void testOfWithHiddenEntryInDirectory() throws Exception {
-        Path dir = Files.createTempDirectory(USER_DIR, "mods");
-        Files.createTempFile(dir, ".marker", "");
-
-        ModuleFinder finder = ModuleFinder.of(dir);
         assertFalse(finder.find("java.rhubarb").isPresent());
 
         finder = ModuleFinder.of(dir);
@@ -510,6 +488,24 @@
 
 
     /**
+     * Test ModuleFinder.of with a file path to a directory containing a file
+     * that will not be recognized as a module.
+     */
+    public void testOfWithUnrecognizedEntryInDirectory2() throws Exception {
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        createModularJar(dir.resolve("m1.jar"), "m1");
+        Files.createTempFile(dir, "m2", ".junk");
+
+        ModuleFinder finder = ModuleFinder.of(dir);
+        assertTrue(finder.find("m1").isPresent());
+        assertFalse(finder.find("m2").isPresent());
+
+        finder = ModuleFinder.of(dir);
+        assertTrue(finder.findAll().size() == 1);
+    }
+
+
+    /**
      * Test ModuleFinder.of with a directory that contains two
      * versions of the same module
      */
@@ -533,6 +529,30 @@
 
 
     /**
+     * Test ModuleFinder.of with a directory containing hidden files
+     */
+    public void testOfWithHiddenFiles() throws Exception {
+        Path dir = Files.createTempDirectory(USER_DIR, "mods");
+        createExplodedModule(dir.resolve("m"), "m",
+                "com/.ignore",
+                "com/foo/.ignore",
+                "com/foo/foo.properties");
+
+        ModuleFinder finder = ModuleFinder.of(dir);
+        ModuleReference mref = finder.find("m").orElse(null);
+        assertNotNull(mref);
+
+        Set<String> expectedPackages;
+        if (System.getProperty("os.name").startsWith("Windows")) {
+            expectedPackages = Set.of("com", "com.foo");
+        } else {
+            expectedPackages = Set.of("com.foo");
+        }
+        assertEquals(mref.descriptor().packages(), expectedPackages);
+    }
+
+
+    /**
      * Test ModuleFinder.of with a truncated module-info.class
      */
     public void testOfWithTruncatedModuleInfo() throws Exception {
@@ -748,7 +768,7 @@
             vs = mid.substring(i+1);
         }
         ModuleDescriptor.Builder builder
-            = ModuleDescriptor.module(mn).requires("java.base");
+            = ModuleDescriptor.newModule(mn).requires("java.base");
         if (vs != null)
             builder.version(vs);
         return builder.build();
diff --git a/jdk/test/java/lang/module/ModuleFinderWithSecurityManager.java b/jdk/test/java/lang/module/ModuleFinderWithSecurityManager.java
new file mode 100644
index 0000000..0fe6a0b
--- /dev/null
+++ b/jdk/test/java/lang/module/ModuleFinderWithSecurityManager.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @run main/othervm ModuleFinderWithSecurityManager allow
+ * @run main/othervm ModuleFinderWithSecurityManager deny
+ * @summary Basic test for ModuleFinder.ofSystem() with security manager
+ */
+
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Set;
+
+public class ModuleFinderWithSecurityManager {
+    public static void main(String[] args) throws Exception {
+        boolean allow = args[0].equals("allow");
+
+        // set security policy to allow access
+        if (allow) {
+            String testSrc = System.getProperty("test.src");
+            if (testSrc == null)
+                testSrc = ".";
+            Path policyFile = Paths.get(testSrc, "java.policy");
+            System.setProperty("java.security.policy", policyFile.toString());
+        }
+
+        System.setSecurityManager(new SecurityManager());
+
+        ModuleFinder finder = null;
+        try {
+            finder = ModuleFinder.ofSystem();
+            if (!allow) throw new RuntimeException("SecurityException expected");
+        } catch (SecurityException e) {
+            if (allow) throw new RuntimeException("SecurityException not expected");
+        }
+
+        // no additional permissions should be required to locate modules
+        if (finder != null) {
+            ModuleReference base = finder.find("java.base").orElse(null);
+            if (base == null)
+                throw new RuntimeException("java.base not found");
+            Set<ModuleReference> allModules = finder.findAll();
+            if (!allModules.contains(base))
+                throw new RuntimeException("java.base not in all modules");
+        }
+    }
+}
diff --git a/jdk/test/java/lang/module/ModuleNamesTest.java b/jdk/test/java/lang/module/ModuleNamesTest.java
index c0790ea..afeadac 100644
--- a/jdk/test/java/lang/module/ModuleNamesTest.java
+++ b/jdk/test/java/lang/module/ModuleNamesTest.java
@@ -235,7 +235,7 @@
      */
     private Builder newBuilder(String mn) {
         return SharedSecrets.getJavaLangModuleAccess()
-                            .newModuleBuilder(mn, false, false, false);
+                            .newModuleBuilder(mn, false, Set.of());
     }
 
     /**
diff --git a/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java b/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java
index d956c24..773b114 100644
--- a/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java
+++ b/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java
@@ -37,7 +37,6 @@
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReader;
 import java.lang.module.ModuleReference;
-import java.lang.reflect.Module;
 import java.net.URI;
 import java.net.URL;
 import java.net.URLConnection;
@@ -79,14 +78,60 @@
         "java/lang/Object.class"
     };
 
+    // (directory) resources that may be in the base module
+    private static final String[] MAYBE_BASE_RESOURCES = {
+        "java",
+        "java/",
+        "java/lang",
+        "java/lang/",
+    };
+
+    // resource names that should not be found in the base module
+    private static final String[] NOT_BASE_RESOURCES = {
+        "NotFound",
+        "/java",
+        "//java",
+        "/java/lang",
+        "//java/lang",
+        "java//lang",
+        "/java/lang/Object.class",
+        "//java/lang/Object.class",
+        "java/lang/Object.class/",
+        "java//lang//Object.class",
+        "./java/lang/Object.class",
+        "java/./lang/Object.class",
+        "java/lang/./Object.class",
+        "../java/lang/Object.class",
+        "java/../lang/Object.class",
+        "java/lang/../Object.class",
+    };
+
     // resources in test module (can't use module-info.class as a test
     // resource as it will be modified by the jmod tool)
     private static final String[] TEST_RESOURCES = {
         "p/Main.class"
     };
 
-    // a resource that is not in the base or test module
-    private static final String NOT_A_RESOURCE = "NotAResource";
+    // (directory) resources that may be in the test module
+    private static final String[] MAYBE_TEST_RESOURCES = {
+        "p",
+        "p/"
+    };
+
+    // resource names that should not be found in the test module
+    private static final String[] NOT_TEST_RESOURCES = {
+        "NotFound",
+        "/p",
+        "//p",
+        "/p/Main.class",
+        "//p/Main.class",
+        "p/Main.class/",
+        "p//Main.class",
+        "./p/Main.class",
+        "p/./Main.class",
+        "../p/Main.class",
+        "p/../p/Main.class"
+    };
 
 
     @BeforeTest
@@ -122,14 +167,23 @@
                 testOpen(reader, name, expectedBytes);
                 testRead(reader, name, expectedBytes);
                 testList(reader, name);
-
             }
 
-            // test "not found"
-            assertFalse(reader.find(NOT_A_RESOURCE).isPresent());
-            assertFalse(reader.open(NOT_A_RESOURCE).isPresent());
-            assertFalse(reader.read(NOT_A_RESOURCE).isPresent());
+            // test resources that may be in the base module
+            for (String name : MAYBE_BASE_RESOURCES) {
+                Optional<URI> ouri = reader.find(name);
+                ouri.ifPresent(uri -> {
+                    if (name.endsWith("/"))
+                        assertTrue(uri.toString().endsWith("/"));
+                });
+            }
 
+            // test "not found" in java.base module
+            for (String name : NOT_BASE_RESOURCES) {
+                assertFalse(reader.find(name).isPresent());
+                assertFalse(reader.open(name).isPresent());
+                assertFalse(reader.read(name).isPresent());
+            }
 
             // test nulls
             try {
@@ -216,13 +270,13 @@
      */
     void test(Path mp) throws IOException {
 
-        ModuleFinder finder = new ModulePath(Runtime.version(), true, mp);
+        ModuleFinder finder = ModulePath.of(Runtime.version(), true, mp);
         ModuleReference mref = finder.find(TEST_MODULE).get();
         ModuleReader reader = mref.open();
 
         try (reader) {
 
-            // test each of the known resources in the module
+            // test resources in test module
             for (String name : TEST_RESOURCES) {
                 byte[] expectedBytes
                     = Files.readAllBytes(MODS_DIR
@@ -235,10 +289,22 @@
                 testList(reader, name);
             }
 
-            // test "not found"
-            assertFalse(reader.find(NOT_A_RESOURCE).isPresent());
-            assertFalse(reader.open(NOT_A_RESOURCE).isPresent());
-            assertFalse(reader.read(NOT_A_RESOURCE).isPresent());
+            // test resources that may be in the test module
+            for (String name : MAYBE_TEST_RESOURCES) {
+                System.out.println(name);
+                Optional<URI> ouri = reader.find(name);
+                ouri.ifPresent(uri -> {
+                    if (name.endsWith("/"))
+                        assertTrue(uri.toString().endsWith("/"));
+                });
+            }
+
+            // test "not found" in test module
+            for (String name : NOT_TEST_RESOURCES) {
+                assertFalse(reader.find(name).isPresent());
+                assertFalse(reader.open(name).isPresent());
+                assertFalse(reader.read(name).isPresent());
+            }
 
             // test nulls
             try {
@@ -353,9 +419,6 @@
         for (String e : names) {
             assertTrue(reader.find(e).isPresent());
         }
-
-        // should not contain directories
-        names.forEach(e -> assertFalse(e.endsWith("/")));
     }
 
 }
diff --git a/jdk/test/java/lang/module/ModuleReferenceTest.java b/jdk/test/java/lang/module/ModuleReferenceTest.java
index bf2db12..f3cbb28 100644
--- a/jdk/test/java/lang/module/ModuleReferenceTest.java
+++ b/jdk/test/java/lang/module/ModuleReferenceTest.java
@@ -31,6 +31,7 @@
 import java.lang.module.ModuleReader;
 import java.lang.module.ModuleReference;
 import java.net.URI;
+import java.util.Set;
 
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
@@ -49,10 +50,10 @@
 
     public void testBasic() throws Exception {
         ModuleDescriptor descriptor
-            = ModuleDescriptor.module("m")
+            = ModuleDescriptor.newModule("m")
                 .exports("p")
                 .exports("q")
-                .contains("p.internal")
+                .packages(Set.of("p.internal"))
                 .build();
 
         URI uri = URI.create("module:/m");
@@ -71,7 +72,7 @@
 
     public void testNullLocation() {
         ModuleDescriptor descriptor
-            = ModuleDescriptor.module("m")
+            = ModuleDescriptor.newModule("m")
                 .exports("p")
                 .build();
         ModuleReference mref = newModuleReference(descriptor, null);
diff --git a/jdk/test/java/lang/module/MultiReleaseJarTest.java b/jdk/test/java/lang/module/MultiReleaseJarTest.java
index 7daddb1..4c58e93 100644
--- a/jdk/test/java/lang/module/MultiReleaseJarTest.java
+++ b/jdk/test/java/lang/module/MultiReleaseJarTest.java
@@ -65,7 +65,7 @@
 
     private static final String MODULE_INFO = "module-info.class";
 
-    private static final int RELEASE = Runtime.version().major();
+    private static final int VERSION = Runtime.version().major();
 
     // are multi-release JARs enabled?
     private static final boolean MULTI_RELEASE;
@@ -80,7 +80,7 @@
     public void testBasic() throws Exception {
         String name = "m1";
 
-        ModuleDescriptor descriptor = ModuleDescriptor.module(name)
+        ModuleDescriptor descriptor = ModuleDescriptor.newModule(name)
                 .requires("java.base")
                 .build();
 
@@ -88,8 +88,8 @@
                 .moduleInfo("module-info.class", descriptor)
                 .resource("p/Main.class")
                 .resource("p/Helper.class")
-                .resource("META-INF/versions/9/p/Helper.class")
-                .resource("META-INF/versions/9/p/internal/Helper9.class")
+                .resource("META-INF/versions/" + VERSION + "/p/Helper.class")
+                .resource("META-INF/versions/" + VERSION + "/p/internal/Helper.class")
                 .build();
 
         // find the module
@@ -117,12 +117,12 @@
     public void testModuleInfoInVersionedSection() throws Exception {
         String name = "m1";
 
-        ModuleDescriptor descriptor1 = ModuleDescriptor.module(name)
+        ModuleDescriptor descriptor1 = ModuleDescriptor.newModule(name)
                 .requires("java.base")
                 .build();
 
         // module descriptor for versioned section
-        ModuleDescriptor descriptor2 = ModuleDescriptor.module(name)
+        ModuleDescriptor descriptor2 = ModuleDescriptor.newModule(name)
                 .requires("java.base")
                 .requires("jdk.unsupported")
                 .build();
@@ -131,9 +131,9 @@
                 .moduleInfo(MODULE_INFO, descriptor1)
                 .resource("p/Main.class")
                 .resource("p/Helper.class")
-                .moduleInfo("META-INF/versions/9/" + MODULE_INFO, descriptor2)
-                .resource("META-INF/versions/9/p/Helper.class")
-                .resource("META-INF/versions/9/p/internal/Helper9.class")
+                .moduleInfo("META-INF/versions/" + VERSION + "/" + MODULE_INFO, descriptor2)
+                .resource("META-INF/versions/" + VERSION + "/p/Helper.class")
+                .resource("META-INF/versions/" + VERSION + "/p/internal/Helper.class")
                 .build();
 
         // find the module
@@ -161,8 +161,8 @@
         Path jar = new JarBuilder(name)
                 .resource("p/Main.class")
                 .resource("p/Helper.class")
-                .resource("META-INF/versions/9/p/Helper.class")
-                .resource("META-INF/versions/9/p/internal/Helper9.class")
+                .resource("META-INF/versions/" + VERSION + "/p/Helper.class")
+                .resource("META-INF/versions/" + VERSION + "/p/internal/Helper.class")
                 .build();
 
         // find the module
@@ -188,19 +188,19 @@
     public void testModuleReader() throws Exception {
         String name = "m1";
 
-        ModuleDescriptor descriptor1 = ModuleDescriptor.module(name)
+        ModuleDescriptor descriptor1 = ModuleDescriptor.newModule(name)
                 .requires("java.base")
                 .build();
 
         // module descriptor for versioned section
-        ModuleDescriptor descriptor2 = ModuleDescriptor.module(name)
+        ModuleDescriptor descriptor2 = ModuleDescriptor.newModule(name)
                 .requires("java.base")
                 .requires("jdk.unsupported")
                 .build();
 
         Path jar = new JarBuilder(name)
                 .moduleInfo(MODULE_INFO, descriptor1)
-                .moduleInfo("META-INF/versions/9/" + MODULE_INFO, descriptor2)
+                .moduleInfo("META-INF/versions/" + VERSION + "/" + MODULE_INFO, descriptor2)
                 .build();
 
         // find the module
@@ -243,7 +243,7 @@
 
             String expectedTail = "!/";
             if (MULTI_RELEASE)
-                expectedTail += "META-INF/versions/" + RELEASE + "/";
+                expectedTail += "META-INF/versions/" + VERSION + "/";
             expectedTail += MODULE_INFO;
             assertTrue(uri.toString().endsWith(expectedTail));
 
diff --git a/jdk/test/java/lang/module/java.policy b/jdk/test/java/lang/module/java.policy
new file mode 100644
index 0000000..179334b
--- /dev/null
+++ b/jdk/test/java/lang/module/java.policy
@@ -0,0 +1,4 @@
+grant {
+    // ModuleFinder.ofSystem() needs this
+    permission java.lang.RuntimePermission "accessSystemModules";
+};
diff --git a/jdk/test/java/lang/ref/ReferenceEnqueue.java b/jdk/test/java/lang/ref/ReferenceEnqueue.java
index c246591..e45adfa 100644
--- a/jdk/test/java/lang/ref/ReferenceEnqueue.java
+++ b/jdk/test/java/lang/ref/ReferenceEnqueue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,17 +22,23 @@
  */
 
 /* @test
- * @bug 4268317 8132306
+ * @bug 4268317 8132306 8175797
  * @summary Test if Reference.enqueue() works properly with GC
+ * @run main ReferenceEnqueue
+ * @run main/othervm -Djdk.lang.ref.disableClearAndEnqueue=true ReferenceEnqueue
  */
 
 import java.lang.ref.*;
+import java.util.ArrayList;
+import java.util.List;
 
 public class ReferenceEnqueue {
 
     public static void main(String args[]) throws Exception {
-        for (int i=0; i < 5; i++)
+        for (int i=0; i < 5; i++) {
             new WeakRef().run();
+            new ExplicitEnqueue().run();
+        }
         System.out.println("Test passed.");
     }
 
@@ -76,4 +82,50 @@
             }
         }
     }
+
+    static class ExplicitEnqueue {
+        final ReferenceQueue<Object> queue = new ReferenceQueue<>();
+        final List<Reference<Object>> refs = new ArrayList<>();
+        final int iterations = 1000;
+        final boolean disableClearAndEnqueue =
+            Boolean.parseBoolean("jdk.lang.ref.disableClearAndEnqueue");
+
+        ExplicitEnqueue() {
+            this.refs.add(new SoftReference<>(new Object(), queue));
+            this.refs.add(new WeakReference<>(new Object(), queue));
+            this.refs.add(new PhantomReference<>(new Object(), queue));
+        }
+
+        void run() throws InterruptedException {
+            for (Reference<Object> ref : refs) {
+                if (ref.enqueue() == false) {
+                    throw new RuntimeException("Error: enqueue failed");
+                }
+                if (disableClearAndEnqueue && ref.get() == null) {
+                    throw new RuntimeException("Error: clearing should be disabled");
+                }
+                if (!disableClearAndEnqueue && ref.get() != null) {
+                    throw new RuntimeException("Error: referent must be cleared");
+                }
+            }
+
+            System.gc();
+            for (int i = 0; refs.size() > 0 && i < iterations; i++) {
+                Reference<Object> ref = (Reference<Object>)queue.poll();
+                if (ref == null) {
+                    System.gc();
+                    Thread.sleep(100);
+                    continue;
+                }
+
+                if (refs.remove(ref) == false) {
+                    throw new RuntimeException("Error: unknown reference " + ref);
+                }
+            }
+
+            if (!refs.isEmpty()) {
+                throw new RuntimeException("Error: not all references are removed");
+            }
+        }
+    }
 }
diff --git a/jdk/test/java/lang/reflect/AccessibleObject/CanAccessTest.java b/jdk/test/java/lang/reflect/AccessibleObject/CanAccessTest.java
new file mode 100644
index 0000000..c73eb79
--- /dev/null
+++ b/jdk/test/java/lang/reflect/AccessibleObject/CanAccessTest.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @build CanAccessTest
+ * @modules java.base/jdk.internal.misc:+open
+ * @run testng CanAccessTest
+ * @summary Test AccessibleObject::canAccess method
+ */
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.security.SecureClassLoader;
+
+import jdk.internal.misc.Unsafe;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+@Test
+public class CanAccessTest {
+    private static Unsafe INSTANCE = Unsafe.getUnsafe();
+
+    /**
+     * null object parameter for Constructor
+     */
+    public void testConstructor() throws Exception {
+        Constructor<?> ctor = Unsafe.class.getDeclaredConstructor();
+        assertFalse(ctor.canAccess(null));
+        assertTrue(ctor.trySetAccessible());
+
+        try {
+            // non-null object parameter
+            ctor.canAccess(INSTANCE);
+            assertTrue(false);
+        } catch (IllegalArgumentException expected) {}
+    }
+
+    /**
+     * Test protected constructors
+     */
+    public void testProtectedConstructor() throws Exception {
+        TestLoader.testProtectedConstructorNonOpenedPackage();
+
+        Constructor<?> ctor = TestLoader.class.getDeclaredConstructor();
+        assertTrue(ctor.canAccess(null));
+    }
+
+    /**
+     * null object parameter  for static members
+     */
+    public void testStaticMember() throws Exception {
+        Method m = Unsafe.class.getDeclaredMethod("throwIllegalAccessError");
+        assertFalse(m.canAccess(null));
+        assertTrue(m.trySetAccessible());
+
+        try {
+            // non-null object parameter
+            m.canAccess(INSTANCE);
+            assertTrue(false);
+        } catch (IllegalArgumentException expected) { }
+    }
+
+    /**
+     * Test protected static
+     */
+    public void testProtectedStatic() throws Exception {
+        Method m = TestLoader.testProtectedStatic();
+        assertFalse(m.canAccess(null));
+    }
+
+    /**
+     * the specified object must be an instance of the declaring class
+     * for instance members
+     */
+    public void testInstanceMethod() throws Exception {
+        Method m = Unsafe.class.getDeclaredMethod("addressSize0");
+        assertFalse(m.canAccess(INSTANCE));
+
+        try {
+            m.canAccess(null);
+            assertTrue(false);
+        } catch (IllegalArgumentException expected) { }
+    }
+
+    /**
+     * the specified object must be an instance of the declaring class
+     * for instance members
+     */
+    public void testInvalidInstanceObject() throws Exception {
+        Class<?> clazz = Class.forName("sun.security.x509.X500Name");
+        Method m = clazz.getDeclaredMethod("size");
+
+        try {
+            m.canAccess(INSTANCE);
+            assertTrue(false);
+        } catch (IllegalArgumentException expected) { }
+    }
+
+
+    static class TestLoader extends SecureClassLoader {
+        public static Method testProtectedStatic() throws Exception {
+            Method m = ClassLoader.class.getDeclaredMethod("registerAsParallelCapable");
+            assertTrue(m.canAccess(null));
+            return m;
+        }
+
+        protected TestLoader() throws Exception {
+            Constructor<?> ctor = SecureClassLoader.class.getDeclaredConstructor();
+            assertFalse(ctor.canAccess(null));
+            assertFalse(ctor.trySetAccessible());
+        }
+
+        public static void testProtectedConstructorNonOpenedPackage() throws Exception {
+            new TestLoader();
+        }
+    }
+}
diff --git a/jdk/test/java/lang/reflect/AccessibleObject/ModuleSetAccessibleTest.java b/jdk/test/java/lang/reflect/AccessibleObject/ModuleSetAccessibleTest.java
index da5d264..a287e6f 100644
--- a/jdk/test/java/lang/reflect/AccessibleObject/ModuleSetAccessibleTest.java
+++ b/jdk/test/java/lang/reflect/AccessibleObject/ModuleSetAccessibleTest.java
@@ -30,14 +30,12 @@
  * @summary Test java.lang.reflect.AccessibleObject with modules
  */
 
-import java.lang.module.ModuleDescriptor;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.InaccessibleObjectException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 
 import jdk.internal.misc.Unsafe;
 
diff --git a/jdk/test/java/lang/reflect/AccessibleObject/TrySetAccessibleTest.java b/jdk/test/java/lang/reflect/AccessibleObject/TrySetAccessibleTest.java
new file mode 100644
index 0000000..340e7d0
--- /dev/null
+++ b/jdk/test/java/lang/reflect/AccessibleObject/TrySetAccessibleTest.java
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @build TrySetAccessibleTest
+ * @modules java.base/java.lang:open
+ *          java.base/jdk.internal.perf
+ *          java.base/jdk.internal.misc:+open
+ * @run testng TrySetAccessibleTest
+ * @summary Test AccessibleObject::trySetAccessible method
+ */
+
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import jdk.internal.misc.Unsafe;
+import jdk.internal.perf.Perf;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+@Test
+public class TrySetAccessibleTest {
+    /**
+     * Invoke a private constructor on a public class in an exported package
+     */
+    public void testPrivateConstructorInExportedPackage() throws Exception {
+        Constructor<?> ctor = Perf.class.getDeclaredConstructor();
+
+        try {
+            ctor.newInstance();
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        assertFalse(ctor.trySetAccessible());
+        assertFalse(ctor.canAccess(null));
+    }
+
+    /**
+     * Invoke a private constructor on a public class in an open package
+     */
+    public void testPrivateConstructorInOpenedPackage() throws Exception {
+        Constructor<?> ctor = Unsafe.class.getDeclaredConstructor();
+
+        try {
+            ctor.newInstance();
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        assertTrue(ctor.trySetAccessible());
+        assertTrue(ctor.canAccess(null));
+        Unsafe unsafe = (Unsafe) ctor.newInstance();
+    }
+
+    /**
+     * Invoke a private method on a public class in an exported package
+     */
+    public void testPrivateMethodInExportedPackage() throws Exception {
+        Method m = Perf.class.getDeclaredMethod("getBytes", String.class);
+        try {
+            m.invoke(null);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        assertFalse(m.trySetAccessible());
+        assertFalse(m.canAccess(null));
+    }
+
+
+    /**
+     * Invoke a private method on a public class in an open package
+     */
+    public void testPrivateMethodInOpenedPackage() throws Exception {
+        Method m = Unsafe.class.getDeclaredMethod("throwIllegalAccessError");
+        assertFalse(m.canAccess(null));
+
+        try {
+            m.invoke(null);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        assertTrue(m.trySetAccessible());
+        assertTrue(m.canAccess(null));
+        try {
+            m.invoke(null);
+            assertTrue(false);
+        } catch (InvocationTargetException e) {
+            // thrown by throwIllegalAccessError
+            assertTrue(e.getCause() instanceof IllegalAccessError);
+        }
+    }
+
+    /**
+     * Invoke a private method on a public class in an exported package
+     */
+    public void testPrivateFieldInExportedPackage() throws Exception {
+        Field f = Perf.class.getDeclaredField("instance");
+        try {
+            f.get(null);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        assertFalse(f.trySetAccessible());
+        assertFalse(f.canAccess(null));
+        try {
+            f.get(null);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) {}
+    }
+
+    /**
+     * Access a private field in a public class that is an exported package
+     */
+    public void testPrivateFieldInOpenedPackage() throws Exception {
+        Field f = Unsafe.class.getDeclaredField("theUnsafe");
+
+        try {
+            f.get(null);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        assertTrue(f.trySetAccessible());
+        assertTrue(f.canAccess(null));
+        Unsafe unsafe = (Unsafe) f.get(null);
+    }
+
+
+    /**
+     * Invoke a public constructor on a public class in a non-exported package
+     */
+    public void testPublicConstructorInNonExportedPackage() throws Exception {
+        Class<?> clazz = Class.forName("sun.security.x509.X500Name");
+        Constructor<?> ctor = clazz.getConstructor(String.class);
+
+        try {
+            ctor.newInstance("cn=duke");
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        assertFalse(ctor.trySetAccessible());
+        assertFalse(ctor.canAccess(null));
+        assertTrue(ctor.trySetAccessible() == ctor.isAccessible());
+    }
+
+
+    /**
+     * Access a public field in a public class that in a non-exported package
+     */
+    public void testPublicFieldInNonExportedPackage() throws Exception {
+        Class<?> clazz = Class.forName("sun.security.x509.X500Name");
+        Field f = clazz.getField("SERIALNUMBER_OID");
+
+        try {
+            f.get(null);
+            assertTrue(false);
+        } catch (IllegalAccessException expected) { }
+
+        assertFalse(f.trySetAccessible());
+        assertFalse(f.canAccess(null));
+    }
+
+
+    /**
+     * Test that the Class constructor cannot be make accessible.
+     */
+    public void testJavaLangClass() throws Exception {
+
+        // non-public constructor
+        Constructor<?> ctor
+            = Class.class.getDeclaredConstructor(ClassLoader.class, Class.class);
+        AccessibleObject[] ctors = { ctor };
+
+        assertFalse(ctor.trySetAccessible());
+        assertFalse(ctor.canAccess(null));
+    }
+
+}
diff --git a/jdk/test/java/lang/reflect/Layer/BasicLayerTest.java b/jdk/test/java/lang/reflect/Layer/BasicLayerTest.java
deleted file mode 100644
index 8f14171..0000000
--- a/jdk/test/java/lang/reflect/Layer/BasicLayerTest.java
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @test
- * @library /lib/testlibrary
- * @build BasicLayerTest ModuleUtils
- * @compile layertest/Test.java
- * @run testng BasicLayerTest
- * @summary Basic tests for java.lang.reflect.Layer
- */
-
-import java.lang.module.Configuration;
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleDescriptor.Requires;
-import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.LayerInstantiationException;
-import java.lang.reflect.Module;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.testng.annotations.Test;
-import static org.testng.Assert.*;
-
-@Test
-public class BasicLayerTest {
-
-    /**
-     * Exercise Layer.empty()
-     */
-    public void testEmpty() {
-        Layer emptyLayer = Layer.empty();
-
-        assertTrue(emptyLayer.parents().isEmpty());
-
-        assertTrue(emptyLayer.configuration() == Configuration.empty());
-
-        assertTrue(emptyLayer.modules().isEmpty());
-
-        assertFalse(emptyLayer.findModule("java.base").isPresent());
-
-        try {
-            emptyLayer.findLoader("java.base");
-            assertTrue(false);
-        } catch (IllegalArgumentException expected) { }
-    }
-
-
-    /**
-     * Exercise Layer.boot()
-     */
-    public void testBoot() {
-        Layer bootLayer = Layer.boot();
-
-        // configuration
-        Configuration cf = bootLayer.configuration();
-        assertTrue(cf.findModule("java.base").get()
-                .reference()
-                .descriptor()
-                .exports()
-                .stream().anyMatch(e -> (e.source().equals("java.lang")
-                                         && !e.isQualified())));
-
-        // modules
-        Set<Module> modules = bootLayer.modules();
-        assertTrue(modules.contains(Object.class.getModule()));
-        int count = (int) modules.stream().map(Module::getName).count();
-        assertEquals(count, modules.size()); // module names are unique
-
-        // findModule
-        Module base = Object.class.getModule();
-        assertTrue(bootLayer.findModule("java.base").get() == base);
-        assertTrue(base.getLayer() == bootLayer);
-
-        // findLoader
-        assertTrue(bootLayer.findLoader("java.base") == null);
-
-        // parents
-        assertTrue(bootLayer.parents().size() == 1);
-        assertTrue(bootLayer.parents().get(0) == Layer.empty());
-    }
-
-
-    /**
-     * Exercise Layer defineModules, created with empty layer as parent
-     */
-    public void testLayerOnEmpty() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .requires("m2")
-                .exports("p1")
-                .build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .requires("m3")
-                .build();
-
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
-                .build();
-
-        ModuleFinder finder
-            = ModuleUtils.finderOf(descriptor1, descriptor2, descriptor3);
-
-        Configuration cf = resolveRequires(finder, "m1");
-
-        // map each module to its own class loader for this test
-        ClassLoader loader1 = new ClassLoader() { };
-        ClassLoader loader2 = new ClassLoader() { };
-        ClassLoader loader3 = new ClassLoader() { };
-        Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", loader1);
-        map.put("m2", loader2);
-        map.put("m3", loader3);
-
-        Layer layer = Layer.empty().defineModules(cf, map::get);
-
-        // configuration
-        assertTrue(layer.configuration() == cf);
-        assertTrue(layer.configuration().modules().size() == 3);
-
-        // modules
-        Set<Module> modules = layer.modules();
-        assertTrue(modules.size() == 3);
-        Set<String> names = modules.stream()
-            .map(Module::getName)
-            .collect(Collectors.toSet());
-        assertTrue(names.contains("m1"));
-        assertTrue(names.contains("m2"));
-        assertTrue(names.contains("m3"));
-
-        // findModule
-        Module m1 = layer.findModule("m1").get();
-        Module m2 = layer.findModule("m2").get();
-        Module m3 = layer.findModule("m3").get();
-        assertEquals(m1.getName(), "m1");
-        assertEquals(m2.getName(), "m2");
-        assertEquals(m3.getName(), "m3");
-        assertTrue(m1.getDescriptor() == descriptor1);
-        assertTrue(m2.getDescriptor() == descriptor2);
-        assertTrue(m3.getDescriptor() == descriptor3);
-        assertTrue(m1.getLayer() == layer);
-        assertTrue(m2.getLayer() == layer);
-        assertTrue(m3.getLayer() == layer);
-        assertTrue(modules.contains(m1));
-        assertTrue(modules.contains(m2));
-        assertTrue(modules.contains(m3));
-        assertFalse(layer.findModule("godot").isPresent());
-
-        // findLoader
-        assertTrue(layer.findLoader("m1") == loader1);
-        assertTrue(layer.findLoader("m2") == loader2);
-        assertTrue(layer.findLoader("m3") == loader3);
-        try {
-            ClassLoader loader = layer.findLoader("godot");
-            assertTrue(false);
-        } catch (IllegalArgumentException ignore) { }
-
-        // parents
-        assertTrue(layer.parents().size() == 1);
-        assertTrue(layer.parents().get(0) == Layer.empty());
-    }
-
-
-    /**
-     * Exercise Layer defineModules, created with boot layer as parent
-     */
-    public void testLayerOnBoot() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .requires("m2")
-                .requires("java.base")
-                .exports("p1")
-                .build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .requires("java.base")
-                .build();
-
-        ModuleFinder finder
-            = ModuleUtils.finderOf(descriptor1, descriptor2);
-
-        Configuration parent = Layer.boot().configuration();
-        Configuration cf = resolveRequires(parent, finder, "m1");
-
-        ClassLoader loader = new ClassLoader() { };
-
-        Layer layer = Layer.boot().defineModules(cf, mn -> loader);
-
-        // configuration
-        assertTrue(layer.configuration() == cf);
-        assertTrue(layer.configuration().modules().size() == 2);
-
-        // modules
-        Set<Module> modules = layer.modules();
-        assertTrue(modules.size() == 2);
-        Set<String> names = modules.stream()
-            .map(Module::getName)
-            .collect(Collectors.toSet());
-        assertTrue(names.contains("m1"));
-        assertTrue(names.contains("m2"));
-
-        // findModule
-        Module m1 = layer.findModule("m1").get();
-        Module m2 = layer.findModule("m2").get();
-        assertEquals(m1.getName(), "m1");
-        assertEquals(m2.getName(), "m2");
-        assertTrue(m1.getDescriptor() == descriptor1);
-        assertTrue(m2.getDescriptor() == descriptor2);
-        assertTrue(m1.getLayer() == layer);
-        assertTrue(m2.getLayer() == layer);
-        assertTrue(modules.contains(m1));
-        assertTrue(modules.contains(m2));
-        assertTrue(layer.findModule("java.base").get() == Object.class.getModule());
-        assertFalse(layer.findModule("godot").isPresent());
-
-        // findLoader
-        assertTrue(layer.findLoader("m1") == loader);
-        assertTrue(layer.findLoader("m2") == loader);
-        assertTrue(layer.findLoader("java.base") == null);
-
-        // parents
-        assertTrue(layer.parents().size() == 1);
-        assertTrue(layer.parents().get(0) == Layer.boot());
-    }
-
-
-    /**
-     * Exercise Layer defineModules with a configuration of two modules that
-     * have the same module-private package.
-     */
-    public void testPackageContainedInSelfAndOther() {
-        ModuleDescriptor descriptor1
-            =  ModuleDescriptor.module("m1")
-                .requires("m2")
-                .contains("p")
-                .build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .contains("p")
-                .build();
-
-        ModuleFinder finder
-            = ModuleUtils.finderOf(descriptor1, descriptor2);
-
-        Configuration cf = resolveRequires(finder, "m1");
-        assertTrue(cf.modules().size() == 2);
-
-        // one loader per module, should be okay
-        Layer.empty().defineModules(cf, mn -> new ClassLoader() { });
-
-        // same class loader
-        try {
-            ClassLoader loader = new ClassLoader() { };
-            Layer.empty().defineModules(cf, mn -> loader);
-            assertTrue(false);
-        } catch (LayerInstantiationException expected) { }
-    }
-
-
-    /**
-     * Exercise Layer defineModules with a configuration that is a partitioned
-     * graph. The same package is exported in both partitions.
-     */
-    public void testSameExportInPartitionedGraph() {
-
-        // m1 reads m2, m2 exports p to m1
-        ModuleDescriptor descriptor1
-            =  ModuleDescriptor.module("m1")
-                .requires("m2")
-                .build();
-        ModuleDescriptor descriptor2
-            =  ModuleDescriptor.module("m2")
-                .exports("p", Set.of("m1"))
-                .build();
-
-        // m3 reads m4, m4 exports p to m3
-        ModuleDescriptor descriptor3
-            =  ModuleDescriptor.module("m3")
-                .requires("m4")
-                .build();
-        ModuleDescriptor descriptor4
-            =  ModuleDescriptor.module("m4")
-                .exports("p", Set.of("m3"))
-                .build();
-
-        ModuleFinder finder
-            = ModuleUtils.finderOf(descriptor1,
-                                   descriptor2,
-                                   descriptor3,
-                                   descriptor4);
-
-        Configuration cf = resolveRequires(finder, "m1", "m3");
-        assertTrue(cf.modules().size() == 4);
-
-        // one loader per module
-        Layer.empty().defineModules(cf, mn -> new ClassLoader() { });
-
-        // m1 & m2 in one loader, m3 & m4 in another loader
-        ClassLoader loader1 = new ClassLoader() { };
-        ClassLoader loader2 = new ClassLoader() { };
-        Map<String, ClassLoader> map = new HashMap<>();
-        map.put("m1", loader1);
-        map.put("m2", loader1);
-        map.put("m3", loader2);
-        map.put("m4", loader2);
-        Layer.empty().defineModules(cf, map::get);
-
-        // same loader
-        try {
-            ClassLoader loader = new ClassLoader() { };
-            Layer.empty().defineModules(cf, mn -> loader);
-            assertTrue(false);
-        } catch (LayerInstantiationException expected) { }
-    }
-
-
-    /**
-     * Exercise Layer defineModules with a configuration with a module that
-     * contains a package that is the same name as a non-exported package in
-     * a parent layer.
-     */
-    public void testContainsSamePackageAsBootLayer() {
-
-        // check assumption that java.base contains sun.launcher
-        ModuleDescriptor base = Object.class.getModule().getDescriptor();
-        assertTrue(base.packages().contains("sun.launcher"));
-
-        ModuleDescriptor descriptor
-            = ModuleDescriptor.module("m1")
-               .requires("java.base")
-               .contains("sun.launcher")
-               .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor);
-
-        Configuration parent = Layer.boot().configuration();
-        Configuration cf = parent.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
-        assertTrue(cf.modules().size() == 1);
-
-        ClassLoader loader = new ClassLoader() { };
-        Layer layer = Layer.boot().defineModules(cf, mn -> loader);
-        assertTrue(layer.modules().size() == 1);
-   }
-
-
-    /**
-     * Test layers with implied readability.
-     *
-     * The test consists of three configurations:
-     * - Configuration/layer1: m1, m2 requires transitive m1
-     * - Configuration/layer2: m3 requires m1
-     */
-    public void testImpliedReadabilityWithLayers1() {
-
-        // cf1: m1 and m2, m2 requires transitive m1
-
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
-                .build();
-
-        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
-
-        Configuration cf1 = resolveRequires(finder1, "m2");
-
-        ClassLoader cl1 = new ClassLoader() { };
-        Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
-
-
-        // cf2: m3, m3 requires m2
-
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
-                .requires("m2")
-                .build();
-
-        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3);
-
-        Configuration cf2 = resolveRequires(cf1, finder2, "m3");
-
-        ClassLoader cl2 = new ClassLoader() { };
-        Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
-
-        assertTrue(layer1.parents().size() == 1);
-        assertTrue(layer1.parents().get(0) == Layer.empty());
-
-        assertTrue(layer2.parents().size() == 1);
-        assertTrue(layer2.parents().get(0) == layer1);
-
-        Module m1 = layer2.findModule("m1").get();
-        Module m2 = layer2.findModule("m2").get();
-        Module m3 = layer2.findModule("m3").get();
-
-        assertTrue(m1.getLayer() == layer1);
-        assertTrue(m2.getLayer() == layer1);
-        assertTrue(m3.getLayer() == layer2);
-
-        assertTrue(m1.getClassLoader() == cl1);
-        assertTrue(m2.getClassLoader() == cl1);
-        assertTrue(m3.getClassLoader() == cl2);
-
-        assertTrue(m1.canRead(m1));
-        assertFalse(m1.canRead(m2));
-        assertFalse(m1.canRead(m3));
-
-        assertTrue(m2.canRead(m1));
-        assertTrue(m2.canRead(m2));
-        assertFalse(m2.canRead(m3));
-
-        assertTrue(m3.canRead(m1));
-        assertTrue(m3.canRead(m2));
-        assertTrue(m3.canRead(m3));
-    }
-
-
-    /**
-     * Test layers with implied readability.
-     *
-     * The test consists of three configurations:
-     * - Configuration/layer1: m1
-     * - Configuration/layer2: m2 requires transitive m3, m3 requires m2
-     */
-    public void testImpliedReadabilityWithLayers2() {
-
-        // cf1: m1
-
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
-
-        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
-
-        Configuration cf1 = resolveRequires(finder1, "m1");
-
-        ClassLoader cl1 = new ClassLoader() { };
-        Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
-
-
-        // cf2: m2, m3: m2 requires transitive m1, m3 requires m2
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
-                .build();
-
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
-                .requires("m2")
-                .build();
-
-        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2, descriptor3);
-
-        Configuration cf2 = resolveRequires(cf1, finder2, "m3");
-
-        ClassLoader cl2 = new ClassLoader() { };
-        Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
-
-        assertTrue(layer1.parents().size() == 1);
-        assertTrue(layer1.parents().get(0) == Layer.empty());
-
-        assertTrue(layer2.parents().size() == 1);
-        assertTrue(layer2.parents().get(0) == layer1);
-
-        Module m1 = layer2.findModule("m1").get();
-        Module m2 = layer2.findModule("m2").get();
-        Module m3 = layer2.findModule("m3").get();
-
-        assertTrue(m1.getLayer() == layer1);
-        assertTrue(m2.getLayer() == layer2);
-        assertTrue(m3.getLayer() == layer2);
-
-        assertTrue(m1.canRead(m1));
-        assertFalse(m1.canRead(m2));
-        assertFalse(m1.canRead(m3));
-
-        assertTrue(m2.canRead(m1));
-        assertTrue(m2.canRead(m2));
-        assertFalse(m2.canRead(m3));
-
-        assertTrue(m3.canRead(m1));
-        assertTrue(m3.canRead(m2));
-        assertTrue(m3.canRead(m3));
-    }
-
-
-    /**
-     * Test layers with implied readability.
-     *
-     * The test consists of three configurations:
-     * - Configuration/layer1: m1
-     * - Configuration/layer2: m2 requires transitive m1
-     * - Configuration/layer3: m3 requires m1
-     */
-    public void testImpliedReadabilityWithLayers3() {
-
-        // cf1: m1
-
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
-
-        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
-
-        Configuration cf1 = resolveRequires(finder1, "m1");
-
-        ClassLoader cl1 = new ClassLoader() { };
-        Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
-
-
-        // cf2: m2 requires transitive m1
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
-                .build();
-
-        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
-
-        Configuration cf2 = resolveRequires(cf1, finder2, "m2");
-
-        ClassLoader cl2 = new ClassLoader() { };
-        Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
-
-
-        // cf3: m3 requires m2
-
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
-                .requires("m2")
-                .build();
-
-        ModuleFinder finder3 = ModuleUtils.finderOf(descriptor3);
-
-        Configuration cf3 = resolveRequires(cf2, finder3, "m3");
-
-        ClassLoader cl3 = new ClassLoader() { };
-        Layer layer3 = layer2.defineModules(cf3, mn -> cl3);
-
-        assertTrue(layer1.parents().size() == 1);
-        assertTrue(layer1.parents().get(0) == Layer.empty());
-
-        assertTrue(layer2.parents().size() == 1);
-        assertTrue(layer2.parents().get(0) == layer1);
-
-        assertTrue(layer3.parents().size() == 1);
-        assertTrue(layer3.parents().get(0) == layer2);
-
-        Module m1 = layer3.findModule("m1").get();
-        Module m2 = layer3.findModule("m2").get();
-        Module m3 = layer3.findModule("m3").get();
-
-        assertTrue(m1.getLayer() == layer1);
-        assertTrue(m2.getLayer() == layer2);
-        assertTrue(m3.getLayer() == layer3);
-
-        assertTrue(m1.canRead(m1));
-        assertFalse(m1.canRead(m2));
-        assertFalse(m1.canRead(m3));
-
-        assertTrue(m2.canRead(m1));
-        assertTrue(m2.canRead(m2));
-        assertFalse(m2.canRead(m3));
-
-        assertTrue(m3.canRead(m1));
-        assertTrue(m3.canRead(m2));
-        assertTrue(m3.canRead(m3));
-    }
-
-
-    /**
-     * Test layers with implied readability.
-     *
-     * The test consists of two configurations:
-     * - Configuration/layer1: m1, m2 requires transitive m1
-     * - Configuration/layer2: m3 requires transitive m2, m4 requires m3
-     */
-    public void testImpliedReadabilityWithLayers4() {
-
-        // cf1: m1, m2 requires transitive m1
-
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m1")
-                .build();
-
-        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
-
-        Configuration cf1 = resolveRequires(finder1, "m2");
-
-        ClassLoader cl1 = new ClassLoader() { };
-        Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
-
-
-        // cf2: m3 requires transitive m2, m4 requires m3
-
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3")
-                .requires(Set.of(Requires.Modifier.TRANSITIVE), "m2")
-                .build();
-
-        ModuleDescriptor descriptor4
-            = ModuleDescriptor.module("m4")
-                .requires("m3")
-                .build();
-
-
-        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3, descriptor4);
-
-        Configuration cf2 = resolveRequires(cf1, finder2, "m3", "m4");
-
-        ClassLoader cl2 = new ClassLoader() { };
-        Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
-
-        assertTrue(layer1.parents().size() == 1);
-        assertTrue(layer1.parents().get(0) == Layer.empty());
-
-        assertTrue(layer2.parents().size() == 1);
-        assertTrue(layer2.parents().get(0) == layer1);
-
-        Module m1 = layer2.findModule("m1").get();
-        Module m2 = layer2.findModule("m2").get();
-        Module m3 = layer2.findModule("m3").get();
-        Module m4 = layer2.findModule("m4").get();
-
-        assertTrue(m1.getLayer() == layer1);
-        assertTrue(m2.getLayer() == layer1);
-        assertTrue(m3.getLayer() == layer2);
-        assertTrue(m4.getLayer() == layer2);
-
-        assertTrue(m1.canRead(m1));
-        assertFalse(m1.canRead(m2));
-        assertFalse(m1.canRead(m3));
-        assertFalse(m1.canRead(m4));
-
-        assertTrue(m2.canRead(m1));
-        assertTrue(m2.canRead(m2));
-        assertFalse(m1.canRead(m3));
-        assertFalse(m1.canRead(m4));
-
-        assertTrue(m3.canRead(m1));
-        assertTrue(m3.canRead(m2));
-        assertTrue(m3.canRead(m3));
-        assertFalse(m3.canRead(m4));
-
-        assertTrue(m4.canRead(m1));
-        assertTrue(m4.canRead(m2));
-        assertTrue(m4.canRead(m3));
-        assertTrue(m4.canRead(m4));
-    }
-
-
-    /**
-     * Attempt to use Layer defineModules to create a layer with a module
-     * defined to a class loader that already has a module of the same name
-     * defined to the class loader.
-     */
-    @Test(expectedExceptions = { LayerInstantiationException.class })
-    public void testModuleAlreadyDefinedToLoader() {
-
-        ModuleDescriptor md
-            = ModuleDescriptor.module("m")
-                .requires("java.base")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(md);
-
-        Configuration parent = Layer.boot().configuration();
-
-        Configuration cf = parent.resolveRequires(finder, ModuleFinder.of(), Set.of("m"));
-
-        ClassLoader loader = new ClassLoader() { };
-
-        Layer.boot().defineModules(cf, mn -> loader);
-
-        // should throw LayerInstantiationException as m1 already defined to loader
-        Layer.boot().defineModules(cf, mn -> loader);
-
-    }
-
-
-    /**
-     * Attempt to use Layer defineModules to create a Layer with a module
-     * containing package {@code p} where the class loader already has a module
-     * defined to it containing package {@code p}.
-     */
-    @Test(expectedExceptions = { LayerInstantiationException.class })
-    public void testPackageAlreadyInNamedModule() {
-
-        ModuleDescriptor md1
-            = ModuleDescriptor.module("m1")
-                .contains("p")
-                .requires("java.base")
-                .build();
-
-        ModuleDescriptor md2
-            = ModuleDescriptor.module("m2")
-                .contains("p")
-                .requires("java.base")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(md1, md2);
-
-        ClassLoader loader = new ClassLoader() { };
-
-        // define m1 containing package p to class loader
-
-        Configuration parent = Layer.boot().configuration();
-
-        Configuration cf1 = parent.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
-
-        Layer layer1 = Layer.boot().defineModules(cf1, mn -> loader);
-
-        // attempt to define m2 containing package p to class loader
-
-        Configuration cf2 = parent.resolveRequires(finder, ModuleFinder.of(), Set.of("m2"));
-
-        // should throw exception because p already in m1
-        Layer layer2 = Layer.boot().defineModules(cf2, mn -> loader);
-
-    }
-
-
-    /**
-     * Attempt to use Layer defineModules to create a Layer with a module
-     * containing a package in which a type is already loaded by the class
-     * loader.
-     */
-    @Test(expectedExceptions = { LayerInstantiationException.class })
-    public void testPackageAlreadyInUnnamedModule() throws Exception {
-
-        Class<?> c = layertest.Test.class;
-        assertFalse(c.getModule().isNamed());  // in unnamed module
-
-        ModuleDescriptor md
-            = ModuleDescriptor.module("m")
-                .contains(c.getPackageName())
-                .requires("java.base")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(md);
-
-        Configuration parent = Layer.boot().configuration();
-        Configuration cf = parent.resolveRequires(finder, ModuleFinder.of(), Set.of("m"));
-
-        Layer.boot().defineModules(cf, mn -> c.getClassLoader());
-    }
-
-
-    /**
-     * Attempt to create a Layer with a module named "java.base".
-     */
-    public void testLayerWithJavaBase() {
-        ModuleDescriptor descriptor
-            = ModuleDescriptor.module("java.base")
-                .exports("java.lang")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor);
-
-        Configuration cf = Layer.boot()
-            .configuration()
-            .resolveRequires(finder, ModuleFinder.of(), Set.of("java.base"));
-        assertTrue(cf.modules().size() == 1);
-
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-
-        try {
-            Layer.boot().defineModules(cf, mn -> new ClassLoader() { });
-            assertTrue(false);
-        } catch (LayerInstantiationException e) { }
-
-        try {
-            Layer.boot().defineModulesWithOneLoader(cf, scl);
-            assertTrue(false);
-        } catch (LayerInstantiationException e) { }
-
-        try {
-            Layer.boot().defineModulesWithManyLoaders(cf, scl);
-            assertTrue(false);
-        } catch (LayerInstantiationException e) { }
-    }
-
-
-    /**
-     * Attempt to create a Layer with a module containing a "java." package.
-     * This should only be allowed when the module is defined to the platform
-     * class loader.
-     */
-    @Test(enabled = false)
-    public void testLayerWithJavaPackage() {
-        ModuleDescriptor descriptor
-            = ModuleDescriptor.module("foo")
-                .contains("java.foo")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor);
-
-        Configuration cf = Layer.boot()
-                .configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("foo"));
-        assertTrue(cf.modules().size() == 1);
-
-        ClassLoader pcl = ClassLoader.getPlatformClassLoader();
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-
-        try {
-            Layer.boot().defineModules(cf, mn -> new ClassLoader() { });
-            assertTrue(false);
-        } catch (LayerInstantiationException e) { }
-
-        try {
-            Layer.boot().defineModulesWithOneLoader(cf, scl);
-            assertTrue(false);
-        } catch (LayerInstantiationException e) { }
-
-        try {
-            Layer.boot().defineModulesWithManyLoaders(cf, scl);
-            assertTrue(false);
-        } catch (LayerInstantiationException e) { }
-
-        // create layer with module defined to platform class loader
-        Layer layer = Layer.boot().defineModules(cf, mn -> pcl);
-        Optional<Module> om = layer.findModule("foo");
-        assertTrue(om.isPresent());
-        Module foo = om.get();
-        assertTrue(foo.getClassLoader() == pcl);
-        assertTrue(foo.getPackages().length == 1);
-        assertTrue(foo.getPackages()[0].equals("java.foo"));
-    }
-
-
-    /**
-     * Attempt to create a Layer with a module defined to the boot loader
-     */
-    @Test(expectedExceptions = { LayerInstantiationException.class })
-    public void testLayerWithBootLoader() {
-        ModuleDescriptor descriptor
-            = ModuleDescriptor.module("m1")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor);
-
-        Configuration cf = Layer.boot()
-            .configuration()
-            .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
-        assertTrue(cf.modules().size() == 1);
-
-        Layer.boot().defineModules(cf, mn -> null );
-    }
-
-
-    /**
-     * Parent of configuration != configuration of parent Layer
-     */
-    @Test(expectedExceptions = { IllegalArgumentException.class })
-    public void testIncorrectParent1() {
-
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .requires("java.base")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
-
-        Configuration parent = Layer.boot().configuration();
-        Configuration cf = parent.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
-
-        ClassLoader loader = new ClassLoader() { };
-        Layer.empty().defineModules(cf, mn -> loader);
-    }
-
-
-    /**
-     * Parent of configuration != configuration of parent Layer
-     */
-    @Test(expectedExceptions = { IllegalArgumentException.class })
-    public void testIncorrectParent2() {
-
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
-
-        Configuration cf = resolveRequires(finder, "m1");
-
-        ClassLoader loader = new ClassLoader() { };
-        Layer.boot().defineModules(cf, mn -> loader);
-    }
-
-
-    // null handling
-
-    @Test(expectedExceptions = { NullPointerException.class })
-    public void testCreateWithNull1() {
-        ClassLoader loader = new ClassLoader() { };
-        Layer.empty().defineModules(null, mn -> loader);
-    }
-
-    @Test(expectedExceptions = { NullPointerException.class })
-    public void testCreateWithNull2() {
-        Configuration cf = resolveRequires(Layer.boot().configuration(), ModuleFinder.of());
-        Layer.boot().defineModules(cf, null);
-    }
-
-    @Test(expectedExceptions = { NullPointerException.class })
-    public void testCreateWithNull3() {
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer.empty().defineModulesWithOneLoader(null, scl);
-    }
-
-    @Test(expectedExceptions = { NullPointerException.class })
-    public void testCreateWithNull4() {
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer.empty().defineModulesWithManyLoaders(null, scl);
-    }
-
-    @Test(expectedExceptions = { NullPointerException.class })
-    public void testFindModuleWithNull() {
-        Layer.boot().findModule(null);
-    }
-
-    @Test(expectedExceptions = { NullPointerException.class })
-    public void testFindLoaderWithNull() {
-        Layer.boot().findLoader(null);
-    }
-
-
-    // immutable sets
-
-    @Test(expectedExceptions = { UnsupportedOperationException.class })
-    public void testImmutableSet() {
-        Module base = Object.class.getModule();
-        Layer.boot().modules().add(base);
-    }
-
-
-    /**
-     * Resolve the given modules, by name, and returns the resulting
-     * Configuration.
-     */
-    private static Configuration resolveRequires(Configuration cf,
-                                                 ModuleFinder finder,
-                                                 String... roots) {
-        return cf.resolveRequires(finder, ModuleFinder.of(), Set.of(roots));
-    }
-
-    private static Configuration resolveRequires(ModuleFinder finder,
-                                                 String... roots) {
-        return resolveRequires(Configuration.empty(), finder, roots);
-    }
-}
diff --git a/jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java b/jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java
deleted file mode 100644
index 23c7d06..0000000
--- a/jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java
+++ /dev/null
@@ -1,724 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @test
- * @library /lib/testlibrary
- * @modules jdk.compiler
- * @build LayerAndLoadersTest CompilerUtils ModuleUtils
- * @run testng LayerAndLoadersTest
- * @summary Tests for java.lang.reflect.Layer@createWithXXX methods
- */
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.module.Configuration;
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleFinder;
-import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
-import java.lang.reflect.LayerInstantiationException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Module;
-import java.net.URL;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Optional;
-import java.util.ServiceLoader;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-import static org.testng.Assert.*;
-
-@Test
-public class LayerAndLoadersTest {
-
-    private static final String TEST_SRC = System.getProperty("test.src");
-
-    private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
-    private static final Path MODS_DIR = Paths.get("mods");
-
-    @BeforeTest
-    public void setup() throws Exception {
-
-        // javac -d mods --module-source-path src src/**
-        assertTrue(CompilerUtils.compile(SRC_DIR, MODS_DIR,
-                "--module-source-path", SRC_DIR.toString()));
-    }
-
-
-    /**
-     * Basic test of Layer defineModulesWithOneLoader
-     *
-     * Test scenario:
-     *   m1 requires m2 and m3
-     */
-    public void testWithOneLoader() throws Exception {
-
-        Configuration cf = resolveRequires("m1");
-
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-
-        Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
-
-        checkLayer(layer, "m1", "m2", "m3");
-
-        ClassLoader cl1 = layer.findLoader("m1");
-        ClassLoader cl2 = layer.findLoader("m2");
-        ClassLoader cl3 = layer.findLoader("m3");
-
-        assertTrue(cl1.getParent() == scl);
-        assertTrue(cl2 == cl1);
-        assertTrue(cl3 == cl1);
-
-        invoke(layer, "m1", "p.Main");
-
-    }
-
-
-    /**
-     * Basic test of Layer defineModulesWithManyLoaders
-     *
-     * Test scenario:
-     *   m1 requires m2 and m3
-     */
-    public void testWithManyLoaders() throws Exception {
-
-        Configuration cf = resolveRequires("m1");
-
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-
-        Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
-
-        checkLayer(layer, "m1", "m2", "m3");
-
-        ClassLoader cl1 = layer.findLoader("m1");
-        ClassLoader cl2 = layer.findLoader("m2");
-        ClassLoader cl3 = layer.findLoader("m3");
-
-        assertTrue(cl1.getParent() == scl);
-        assertTrue(cl2.getParent() == scl);
-        assertTrue(cl3.getParent() == scl);
-        assertTrue(cl2 != cl1);
-        assertTrue(cl3 != cl1);
-        assertTrue(cl3 != cl2);
-
-        invoke(layer, "m1", "p.Main");
-
-    }
-
-
-    /**
-     * Basic test of Layer defineModulesWithOneLoader where one of the modules
-     * is a service provider module.
-     *
-     * Test scenario:
-     *    m1 requires m2 and m3
-     *    m1 uses S
-     *    m4 provides S with ...
-     */
-    public void testServicesWithOneLoader() throws Exception {
-
-        Configuration cf = resolveRequiresAndUses("m1");
-
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-
-        Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
-
-        checkLayer(layer, "m1", "m2", "m3", "m4");
-
-        ClassLoader cl1 = layer.findLoader("m1");
-        ClassLoader cl2 = layer.findLoader("m2");
-        ClassLoader cl3 = layer.findLoader("m3");
-        ClassLoader cl4 = layer.findLoader("m4");
-
-        assertTrue(cl1.getParent() == scl);
-        assertTrue(cl2 == cl1);
-        assertTrue(cl3 == cl1);
-        assertTrue(cl4 == cl1);
-
-        Class<?> serviceType = cl1.loadClass("p.Service");
-        assertTrue(serviceType.getClassLoader() == cl1);
-
-        Iterator<?> iter = ServiceLoader.load(serviceType, cl1).iterator();
-        Object provider = iter.next();
-        assertTrue(serviceType.isInstance(provider));
-        assertTrue(provider.getClass().getClassLoader() == cl1);
-        assertFalse(iter.hasNext());
-
-    }
-
-
-    /**
-     * Basic test of Layer defineModulesWithManyLoaders where one of the
-     * modules is a service provider module.
-     *
-     * Test scenario:
-     *    m1 requires m2 and m3
-     *    m1 uses S
-     *    m4 provides S with ...
-     */
-    public void testServicesWithManyLoaders() throws Exception {
-
-        Configuration cf = resolveRequiresAndUses("m1");
-
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-
-        Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
-
-        checkLayer(layer, "m1", "m2", "m3", "m4");
-
-        ClassLoader cl1 = layer.findLoader("m1");
-        ClassLoader cl2 = layer.findLoader("m2");
-        ClassLoader cl3 = layer.findLoader("m3");
-        ClassLoader cl4 = layer.findLoader("m4");
-
-        assertTrue(cl1.getParent() == scl);
-        assertTrue(cl2.getParent() == scl);
-        assertTrue(cl3.getParent() == scl);
-        assertTrue(cl4.getParent() == scl);
-        assertTrue(cl2 != cl1);
-        assertTrue(cl3 != cl1);
-        assertTrue(cl3 != cl2);
-        assertTrue(cl4 != cl1);
-        assertTrue(cl4 != cl2);
-        assertTrue(cl4 != cl3);
-
-        Class<?> serviceType = cl1.loadClass("p.Service");
-        assertTrue(serviceType.getClassLoader() == cl1);
-
-        // Test that the service provider can be located via any of
-        // the class loaders in the layer
-        for (Module m : layer.modules()) {
-            ClassLoader loader = m.getClassLoader();
-            Iterator<?> iter = ServiceLoader.load(serviceType, loader).iterator();
-            Object provider = iter.next();
-            assertTrue(serviceType.isInstance(provider));
-            assertTrue(provider.getClass().getClassLoader() == cl4);
-            assertFalse(iter.hasNext());
-        }
-
-    }
-
-
-    /**
-     * Tests that the class loaders created by defineModulesWithXXX delegate
-     * to the given parent class loader.
-     */
-    public void testDelegationToParent() throws Exception {
-
-        Configuration cf = resolveRequires("m1");
-
-        ClassLoader parent = this.getClass().getClassLoader();
-        String cn = this.getClass().getName();
-
-        // one loader
-        Layer layer = Layer.boot().defineModulesWithOneLoader(cf, parent);
-        testLoad(layer, cn);
-
-         // one loader with boot loader as parent
-        layer = Layer.boot().defineModulesWithOneLoader(cf, null);
-        testLoadFail(layer, cn);
-
-        // many loaders
-        layer = Layer.boot().defineModulesWithManyLoaders(cf, parent);
-        testLoad(layer, cn);
-
-        // many loader with boot loader as parent
-        layer = Layer.boot().defineModulesWithManyLoaders(cf, null);
-        testLoadFail(layer, cn);
-
-    }
-
-
-    /**
-     * Test defineModulesWithXXX when modules that have overlapping packages.
-     *
-     * Test scenario:
-     *   m1 exports p
-     *   m2 exports p
-     */
-    public void testOverlappingPackages() {
-
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1").exports("p").build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2").exports("p").build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
-
-        Configuration cf = Layer.boot()
-            .configuration()
-            .resolveRequires(finder, ModuleFinder.of(), Set.of("m1", "m2"));
-
-        // cannot define both module m1 and m2 to the same class loader
-        try {
-            Layer.boot().defineModulesWithOneLoader(cf, null);
-            assertTrue(false);
-        } catch (LayerInstantiationException expected) { }
-
-        // should be okay to have one module per class loader
-        Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, null);
-        checkLayer(layer, "m1", "m2");
-
-    }
-
-
-    /**
-     * Test Layer defineModulesWithXXX with split delegation.
-     *
-     * Test scenario:
-     *   layer1: m1 exports p, m2 exports p
-     *   layer2: m3 reads m1, m4 reads m2
-     */
-    public void testSplitDelegation() {
-
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1").exports("p").build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2").exports("p").build();
-
-        ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
-
-        Configuration cf1 = Layer.boot()
-            .configuration()
-            .resolveRequires(finder1, ModuleFinder.of(), Set.of("m1", "m2"));
-
-        Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, null);
-        checkLayer(layer1, "m1", "m2");
-
-        ModuleDescriptor descriptor3
-            = ModuleDescriptor.module("m3").requires("m1").build();
-
-        ModuleDescriptor descriptor4
-            = ModuleDescriptor.module("m4").requires("m2").build();
-
-        ModuleFinder finder2 = ModuleUtils.finderOf(descriptor3, descriptor4);
-
-        Configuration cf2 = cf1.resolveRequires(finder2, ModuleFinder.of(),
-                                                Set.of("m3", "m4"));
-
-        // package p cannot be supplied by two class loaders
-        try {
-            layer1.defineModulesWithOneLoader(cf2, null);
-            assertTrue(false);
-        } catch (LayerInstantiationException expected) { }
-
-        // no split delegation when modules have their own class loader
-        Layer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
-        checkLayer(layer2, "m3", "m4");
-
-    }
-
-
-    /**
-     * Test Layer defineModulesWithXXX when the modules that override same
-     * named modules in the parent layer.
-     *
-     * Test scenario:
-     *   layer1: m1, m2, m3 => same loader
-     *   layer2: m1, m2, m4 => same loader
-     */
-    public void testOverriding1() throws Exception {
-
-        Configuration cf1 = resolveRequires("m1");
-
-        Layer layer1 = Layer.boot().defineModulesWithOneLoader(cf1, null);
-        checkLayer(layer1, "m1", "m2", "m3");
-
-        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        Configuration cf2 = cf1.resolveRequires(finder, ModuleFinder.of(),
-                                                Set.of("m1"));
-
-        Layer layer2 = layer1.defineModulesWithOneLoader(cf2, null);
-        checkLayer(layer2, "m1", "m2", "m3");
-        invoke(layer1, "m1", "p.Main");
-
-        ClassLoader loader1 = layer1.findLoader("m1");
-        ClassLoader loader2 = layer1.findLoader("m2");
-        ClassLoader loader3 = layer1.findLoader("m3");
-
-        ClassLoader loader4 = layer2.findLoader("m1");
-        ClassLoader loader5 = layer2.findLoader("m2");
-        ClassLoader loader6 = layer2.findLoader("m3");
-
-        assertTrue(loader1 == loader2);
-        assertTrue(loader1 == loader3);
-
-        assertTrue(loader4 == loader5);
-        assertTrue(loader4 == loader6);
-        assertTrue(loader4 != loader1);
-
-        assertTrue(loader1.loadClass("p.Main").getClassLoader() == loader1);
-        assertTrue(loader1.loadClass("q.Hello").getClassLoader() == loader1);
-        assertTrue(loader1.loadClass("w.Hello").getClassLoader() == loader1);
-
-        assertTrue(loader4.loadClass("p.Main").getClassLoader() == loader4);
-        assertTrue(loader4.loadClass("q.Hello").getClassLoader() == loader4);
-        assertTrue(loader4.loadClass("w.Hello").getClassLoader() == loader4);
-
-    }
-
-
-    /**
-     * Test Layer defineModulesWithXXX when the modules that override same
-     * named modules in the parent layer.
-     *
-     * Test scenario:
-     *   layer1: m1, m2, m3 => loader pool
-     *   layer2: m1, m2, m3 => loader pool
-     */
-    public void testOverriding2() throws Exception {
-
-        Configuration cf1 = resolveRequires("m1");
-
-        Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, null);
-        checkLayer(layer1, "m1", "m2", "m3");
-
-        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        Configuration cf2 = cf1.resolveRequires(finder, ModuleFinder.of(),
-                                                Set.of("m1"));
-
-        Layer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
-        checkLayer(layer2, "m1", "m2", "m3");
-        invoke(layer1, "m1", "p.Main");
-
-        ClassLoader loader1 = layer1.findLoader("m1");
-        ClassLoader loader2 = layer1.findLoader("m2");
-        ClassLoader loader3 = layer1.findLoader("m3");
-
-        ClassLoader loader4 = layer2.findLoader("m1");
-        ClassLoader loader5 = layer2.findLoader("m2");
-        ClassLoader loader6 = layer2.findLoader("m3");
-
-        assertTrue(loader4 != loader1);
-        assertTrue(loader5 != loader2);
-        assertTrue(loader6 != loader3);
-
-        assertTrue(loader1.loadClass("p.Main").getClassLoader() == loader1);
-        assertTrue(loader1.loadClass("q.Hello").getClassLoader() == loader2);
-        assertTrue(loader1.loadClass("w.Hello").getClassLoader() == loader3);
-
-        // p.Main is not visible via loader2
-        try {
-            loader2.loadClass("p.Main");
-            assertTrue(false);
-        } catch (ClassNotFoundException expected) { }
-
-        // w.Hello is not visible via loader2
-        try {
-            loader2.loadClass("w.Hello");
-            assertTrue(false);
-        } catch (ClassNotFoundException expected) { }
-
-        // p.Main is not visible via loader3
-        try {
-            loader3.loadClass("p.Main");
-            assertTrue(false);
-        } catch (ClassNotFoundException expected) { }
-
-        // q.Hello is not visible via loader3
-        try {
-            loader3.loadClass("q.Hello");
-            assertTrue(false);
-        } catch (ClassNotFoundException expected) { }
-
-
-        assertTrue(loader4.loadClass("p.Main").getClassLoader() == loader4);
-        assertTrue(loader5.loadClass("q.Hello").getClassLoader() == loader5);
-        assertTrue(loader6.loadClass("w.Hello").getClassLoader() == loader6);
-
-        // p.Main is not visible via loader5
-        try {
-            loader5.loadClass("p.Main");
-            assertTrue(false);
-        } catch (ClassNotFoundException expected) { }
-
-        // w.Hello is not visible via loader5
-        try {
-            loader5.loadClass("w.Hello");
-            assertTrue(false);
-        } catch (ClassNotFoundException expected) { }
-
-        // p.Main is not visible via loader6
-        try {
-            loader6.loadClass("p.Main");
-            assertTrue(false);
-        } catch (ClassNotFoundException expected) { }
-
-        // q.Hello is not visible via loader6
-        try {
-            loader6.loadClass("q.Hello");
-            assertTrue(false);
-        } catch (ClassNotFoundException expected) { }
-
-    }
-
-
-    /**
-     * Test Layer defineModulesWithXXX when the modules that override same
-     * named modules in the parent layer.
-     *
-     * layer1: m1, m2, m3 => same loader
-     * layer2: m1, m3 => same loader
-     */
-    public void testOverriding3() throws Exception {
-
-        Configuration cf1 = resolveRequires("m1");
-
-        Layer layer1 = Layer.boot().defineModulesWithOneLoader(cf1, null);
-        checkLayer(layer1, "m1", "m2", "m3");
-
-        ModuleFinder finder = finderFor("m1", "m3");
-
-        Configuration cf2 = cf1.resolveRequires(finder, ModuleFinder.of(),
-                                                Set.of("m1"));
-
-        Layer layer2 = layer1.defineModulesWithOneLoader(cf2, null);
-        checkLayer(layer2, "m1", "m3");
-        invoke(layer1, "m1", "p.Main");
-
-        ClassLoader loader1 = layer1.findLoader("m1");
-        ClassLoader loader2 = layer2.findLoader("m1");
-
-        assertTrue(loader1.loadClass("p.Main").getClassLoader() == loader1);
-        assertTrue(loader1.loadClass("q.Hello").getClassLoader() == loader1);
-        assertTrue(loader1.loadClass("w.Hello").getClassLoader() == loader1);
-
-        assertTrue(loader2.loadClass("p.Main").getClassLoader() == loader2);
-        assertTrue(loader2.loadClass("q.Hello").getClassLoader() == loader1);
-        assertTrue(loader2.loadClass("w.Hello").getClassLoader() == loader2);
-
-    }
-
-
-    /**
-     * Test Layer defineModulesWithXXX when the modules that override same
-     * named modules in the parent layer.
-     *
-     * layer1: m1, m2, m3 => loader pool
-     * layer2: m1, m3 => loader pool
-     */
-    public void testOverriding4() throws Exception {
-
-        Configuration cf1 = resolveRequires("m1");
-
-        Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, null);
-        checkLayer(layer1, "m1", "m2", "m3");
-
-        ModuleFinder finder = finderFor("m1", "m3");
-
-        Configuration cf2 = cf1.resolveRequires(finder, ModuleFinder.of(),
-                                                Set.of("m1"));
-
-        Layer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
-        checkLayer(layer2, "m1", "m3");
-        invoke(layer1, "m1", "p.Main");
-
-        ClassLoader loader1 = layer1.findLoader("m1");
-        ClassLoader loader2 = layer1.findLoader("m2");
-        ClassLoader loader3 = layer1.findLoader("m3");
-
-        ClassLoader loader4 = layer2.findLoader("m1");
-        ClassLoader loader5 = layer2.findLoader("m2");
-        ClassLoader loader6 = layer2.findLoader("m3");
-
-        assertTrue(loader4 != loader1);
-        assertTrue(loader5 == loader2);  // m2 not overridden
-        assertTrue(loader6 != loader3);
-
-        assertTrue(loader1.loadClass("p.Main").getClassLoader() == loader1);
-        assertTrue(loader1.loadClass("q.Hello").getClassLoader() == loader2);
-        assertTrue(loader1.loadClass("w.Hello").getClassLoader() == loader3);
-
-        assertTrue(loader2.loadClass("q.Hello").getClassLoader() == loader2);
-
-        assertTrue(loader3.loadClass("w.Hello").getClassLoader() == loader3);
-
-        assertTrue(loader4.loadClass("p.Main").getClassLoader() == loader4);
-        assertTrue(loader4.loadClass("q.Hello").getClassLoader() == loader2);
-        assertTrue(loader4.loadClass("w.Hello").getClassLoader() == loader6);
-
-        assertTrue(loader6.loadClass("w.Hello").getClassLoader() == loader6);
-
-    }
-
-
-    /**
-     * Basic test of resource loading with a class loader created by
-     * Layer.defineModulesWithOneLoader.
-     */
-    public void testResourcesOneLoader() throws Exception {
-        Configuration cf = resolveRequires("m1");
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
-        ClassLoader loader = layer.findLoader("m1");
-        testResourceLoading(loader, "p/Main.class");
-    }
-
-    /**
-     * Basic test of resource loading with a class loader created by
-     * Layer.defineModulesWithOneLoader.
-     */
-    public void testResourcesManyLoaders() throws Exception {
-        Configuration cf = resolveRequires("m1");
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
-        ClassLoader loader = layer.findLoader("m1");
-        testResourceLoading(loader, "p/Main.class");
-    }
-
-    /**
-     * Test that a resource is located by a class loader.
-     */
-    private void testResourceLoading(ClassLoader loader, String name)
-        throws IOException
-    {
-        URL url = loader.getResource(name);
-        assertNotNull(url);
-
-        try (InputStream in = loader.getResourceAsStream(name)) {
-            assertNotNull(in);
-        }
-
-        Enumeration<URL> urls = loader.getResources(name);
-        assertTrue(urls.hasMoreElements());
-    }
-
-
-    // -- supporting methods --
-
-
-    /**
-     * Resolve the given modules, by name, and returns the resulting
-     * Configuration.
-     */
-    private static Configuration resolveRequires(String... roots) {
-        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        return Layer.boot()
-            .configuration()
-            .resolveRequires(finder, ModuleFinder.of(), Set.of(roots));
-    }
-
-    /**
-     * Resolve the given modules, by name, and returns the resulting
-     * Configuration.
-     */
-    private static Configuration resolveRequiresAndUses(String... roots) {
-        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        return Layer.boot()
-            .configuration()
-            .resolveRequiresAndUses(finder, ModuleFinder.of(), Set.of(roots));
-    }
-
-
-    /**
-     * Invokes the static void main(String[]) method on the given class
-     * in the given module.
-     */
-    private static void invoke(Layer layer, String mn, String mc) throws Exception {
-        ClassLoader loader = layer.findLoader(mn);
-        Class<?> c = loader.loadClass(mc);
-        Method mainMethod = c.getMethod("main", String[].class);
-        mainMethod.invoke(null, (Object)new String[0]);
-    }
-
-
-    /**
-     * Checks that the given layer contains exactly the expected modules
-     * (by name).
-     */
-    private void checkLayer(Layer layer, String ... expected) {
-        Set<String> names = layer.modules().stream()
-                .map(Module::getName)
-                .collect(Collectors.toSet());
-        assertTrue(names.size() == expected.length);
-        for (String name : expected) {
-            assertTrue(names.contains(name));
-        }
-    }
-
-
-    /**
-     * Test that a class can be loaded via the class loader of all modules
-     * in the given layer.
-     */
-    static void testLoad(Layer layer, String cn) throws Exception {
-        for (Module m : layer.modules()) {
-            ClassLoader l = m.getClassLoader();
-            l.loadClass(cn);
-        }
-    }
-
-
-    /**
-     * Test that a class cannot be loaded via any of the class loaders of
-     * the modules in the given layer.
-     */
-    static void testLoadFail(Layer layer, String cn) throws Exception {
-        for (Module m : layer.modules()) {
-            ClassLoader l = m.getClassLoader();
-            try {
-                l.loadClass(cn);
-                assertTrue(false);
-            } catch (ClassNotFoundException expected) { }
-        }
-    }
-
-
-    /**
-     * Returns a ModuleFinder that only finds the given test modules
-     */
-    static ModuleFinder finderFor(String... names) {
-
-        ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-
-        Map<String, ModuleReference> mrefs = new HashMap<>();
-        for (String name : names) {
-            Optional<ModuleReference> omref = finder.find(name);
-            assert omref.isPresent();
-            mrefs.put(name, omref.get());
-        }
-
-        return new ModuleFinder() {
-            @Override
-            public Optional<ModuleReference> find(String name) {
-                ModuleReference mref = mrefs.get(name);
-                return Optional.ofNullable(mref);
-            }
-            @Override
-            public Set<ModuleReference> findAll() {
-                return mrefs.values().stream().collect(Collectors.toSet());
-            }
-        };
-    }
-
-}
diff --git a/jdk/test/java/lang/reflect/Layer/LayerControllerTest.java b/jdk/test/java/lang/reflect/Layer/LayerControllerTest.java
deleted file mode 100644
index 6582e49..0000000
--- a/jdk/test/java/lang/reflect/Layer/LayerControllerTest.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @test
- * @library /lib/testlibrary
- * @build LayerControllerTest ModuleUtils
- * @run testng LayerControllerTest
- * @summary Basic tests for java.lang.reflect.Layer.Controller
- */
-
-import java.lang.module.Configuration;
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-import java.util.List;
-import java.util.Set;
-
-import org.testng.annotations.Test;
-import static org.testng.Assert.*;
-
-@Test
-public class LayerControllerTest {
-
-    /**
-     * Creates a Controller for a module layer containing modules m1 and m2.
-     * Module m1 contains p1, reads java.base, does not export/open any package
-     * Module m2 contains p2, reads java.base, does not export/open any package
-     */
-    private Layer.Controller createTestLayer() {
-        ModuleDescriptor descriptor1
-            = ModuleDescriptor.module("m1")
-                .contains("p1")
-                .requires("java.base")
-                .build();
-
-        ModuleDescriptor descriptor2
-            = ModuleDescriptor.module("m2")
-                .requires("java.base")
-                .contains("p2")
-                .build();
-
-        ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
-        Layer bootLayer = Layer.boot();
-
-        Configuration cf = bootLayer.configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of("m1", "m2"));
-
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-
-        Layer.Controller controller
-                = Layer.defineModulesWithOneLoader(cf, List.of(bootLayer), scl);
-
-        Layer layer = controller.layer();
-
-        assertTrue(layer.modules().size() == 2);
-        assertTrue(layer.findModule("m1").isPresent());
-        assertTrue(layer.findModule("m2").isPresent());
-
-        return controller;
-    }
-
-    /**
-     * Basic test of Layer.Controller to update modules m1 and m2 to read and
-     * open packages to each other.
-     */
-    public void testBasic() {
-        Layer.Controller controller = createTestLayer();
-        Layer layer = controller.layer();
-        Module m1 = layer.findModule("m1").orElseThrow(RuntimeException::new);
-        Module m2 = layer.findModule("m2").orElseThrow(RuntimeException::new);
-
-        assertFalse(m1.canRead(m2));
-        assertFalse(m1.isExported("p1"));
-        assertFalse(m1.isOpen("p1"));
-        assertFalse(m1.isExported("p1", m2));
-        assertFalse(m1.isOpen("p1", m2));
-
-        assertFalse(m2.canRead(m1));
-        assertFalse(m2.isExported("p2"));
-        assertFalse(m2.isOpen("p2"));
-        assertFalse(m2.isExported("p2", m1));
-        assertFalse(m2.isOpen("p2", m1));
-
-        // update m1 to read m2
-        assertTrue(controller.addReads(m1, m2) == controller);
-        assertTrue(m1.canRead(m2));
-        assertFalse(m2.canRead(m1));
-
-        // update m2 to read m1
-        assertTrue(controller.addReads(m2, m1) == controller);
-        assertTrue(m1.canRead(m2));
-        assertTrue(m1.canRead(m1));
-
-        // update m1 to open p1 to m2
-        assertTrue(controller.addOpens(m1, "p1", m2) == controller);
-        assertTrue(m1.isExported("p1", m2));
-        assertTrue(m1.isOpen("p1", m2));
-        assertFalse(m1.isExported("p1"));
-        assertFalse(m1.isOpen("p1"));
-
-        // update m2 to open p2 to m1
-        assertTrue(controller.addOpens(m2, "p2", m1) == controller);
-        assertTrue(m2.isExported("p2", m1));
-        assertTrue(m2.isOpen("p2", m1));
-        assertFalse(m2.isExported("p2"));
-        assertFalse(m2.isOpen("p2"));
-    }
-
-    /**
-     * Test invalid argument handling
-     */
-    public void testBadArguments() {
-        Layer.Controller controller = createTestLayer();
-        Layer layer = controller.layer();
-        Module m1 = layer.findModule("m1").orElseThrow(RuntimeException::new);
-        Module m2 = layer.findModule("m2").orElseThrow(RuntimeException::new);
-        Module base = Object.class.getModule();
-
-        // java.base is not in layer
-        try {
-            controller.addReads(base, m2);
-            assertTrue(false);
-        } catch (IllegalArgumentException expected) { }
-
-        // java.base is not in layer
-        try {
-            controller.addOpens(base, "java.lang", m2);
-            assertTrue(false);
-        } catch (IllegalArgumentException expected) { }
-
-        // m1 does not contain java.lang
-        try {
-            controller.addOpens(m1, "java.lang", m2);
-            assertTrue(false);
-        } catch (IllegalArgumentException expected) { }
-    }
-
-    /**
-     * Test null handling
-     */
-    public void testNulls() {
-        Layer.Controller controller = createTestLayer();
-        Layer layer = controller.layer();
-        Module m1 = layer.findModule("m1").orElseThrow(RuntimeException::new);
-        Module m2 = layer.findModule("m2").orElseThrow(RuntimeException::new);
-        assertTrue(m1 != null);
-        assertTrue(m2 != null);
-
-        try {
-            controller.addReads(null, m2);
-            assertTrue(false);
-        } catch (NullPointerException expected) { }
-
-        try {
-            controller.addReads(m1, null);
-            assertTrue(false);
-        } catch (NullPointerException expected) { }
-
-        try {
-            controller.addOpens(null, "p1", m2);
-            assertTrue(false);
-        } catch (NullPointerException expected) { }
-
-        try {
-            controller.addOpens(m1, null, m2);
-            assertTrue(false);
-        } catch (NullPointerException expected) { }
-
-        try {
-            controller.addOpens(m1, "p1", null);
-            assertTrue(false);
-        } catch (NullPointerException expected) { }
-    }
-}
\ No newline at end of file
diff --git a/jdk/test/java/lang/reflect/Layer/layertest/Test.java b/jdk/test/java/lang/reflect/Layer/layertest/Test.java
deleted file mode 100644
index f5c76cc..0000000
--- a/jdk/test/java/lang/reflect/Layer/layertest/Test.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-/**
- * Supporting class for tests of java.lang.reflect.Layer.
- */
-
-package layertest;
-
-public class Test { }
-
diff --git a/jdk/test/java/lang/reflect/Module/AddExportsTest.java b/jdk/test/java/lang/reflect/Module/AddExportsTest.java
deleted file mode 100644
index 3f44536..0000000
--- a/jdk/test/java/lang/reflect/Module/AddExportsTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @test
- * @modules java.base/jdk.internal.misc
- *          java.desktop
- * @run main/othervm --add-exports=java.desktop/sun.awt=java.base AddExportsTest
- * @run main/othervm --add-exports=java.desktop/sun.awt=ALL-UNNAMED AddExportsTest
- * @summary Test Module isExported methods with exports changed by -AddExportsTest
- */
-
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-import java.util.Optional;
-import java.util.stream.Stream;
-
-import jdk.internal.misc.VM;
-
-public class AddExportsTest {
-    /*
-     * jtreg sets -Dtest.modules system property to the internal APIs
-     * specified at @modules tag.  The test will exclude --add-exports set
-     * for @modules.
-     */
-    private static final String TEST_MODULES = System.getProperty("test.modules");
-
-    public static void main(String[] args) {
-
-        Optional<String> oaddExports = Stream.of(VM.getRuntimeArguments())
-            .filter(arg -> arg.startsWith("--add-exports="))
-            .filter(arg -> !arg.equals("--add-exports=" + TEST_MODULES + "=ALL-UNNAMED"))
-            .map(arg -> arg.substring("--add-exports=".length(), arg.length()))
-            .findFirst();
-
-        assertTrue(oaddExports.isPresent());
-
-        Layer bootLayer = Layer.boot();
-
-        Module unnamedModule = AddExportsTest.class.getModule();
-        assertFalse(unnamedModule.isNamed());
-
-        for (String expr : oaddExports.get().split(",")) {
-
-            String[] s = expr.split("=");
-            assertTrue(s.length == 2);
-
-            // $MODULE/$PACKAGE
-            String[] moduleAndPackage = s[0].split("/");
-            assertTrue(moduleAndPackage.length == 2);
-
-            String mn = moduleAndPackage[0];
-            String pn = moduleAndPackage[1];
-
-            // source module
-            Module source;
-            Optional<Module> om = bootLayer.findModule(mn);
-            assertTrue(om.isPresent(), mn + " not in boot layer");
-            source = om.get();
-
-            // package should not be exported unconditionally
-            assertFalse(source.isExported(pn),
-                        pn + " should not be exported unconditionally");
-
-            // $TARGET
-            String tn = s[1];
-            if ("ALL-UNNAMED".equals(tn)) {
-
-                // package is exported to all unnamed modules
-                assertTrue(source.isExported(pn, unnamedModule),
-                           pn + " should be exported to all unnamed modules");
-
-            } else {
-
-                om = bootLayer.findModule(tn);
-                assertTrue(om.isPresent());
-                Module target = om.get();
-
-                // package should be exported to target module
-                assertTrue(source.isExported(pn, target),
-                           pn + " should be exported to " + target);
-
-                // package should not be exported to unnamed modules
-                assertFalse(source.isExported(pn, unnamedModule),
-                            pn + " should not be exported to unnamed modules");
-
-            }
-
-        }
-    }
-
-    static void assertTrue(boolean cond) {
-        if (!cond) throw new RuntimeException();
-    }
-
-    static void assertTrue(boolean cond, String msg) {
-        if (!cond) throw new RuntimeException(msg);
-    }
-
-    static void assertFalse(boolean cond) {
-        if (cond) throw new RuntimeException();
-    }
-
-    static void assertFalse(boolean cond, String msg) {
-        if (cond) throw new RuntimeException(msg);
-    }
-
-}
diff --git a/jdk/test/java/lang/reflect/Module/AnnotationsTest.java b/jdk/test/java/lang/reflect/Module/AnnotationsTest.java
deleted file mode 100644
index 0390698..0000000
--- a/jdk/test/java/lang/reflect/Module/AnnotationsTest.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.module.Configuration;
-import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-import java.nio.file.Files;
-import java.nio.file.Path;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import jdk.internal.module.ClassFileAttributes;
-import jdk.internal.org.objectweb.asm.AnnotationVisitor;
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Opcodes;
-
-import org.testng.annotations.Test;
-import static org.testng.Assert.*;
-
-/**
- * @test
- * @modules java.base/jdk.internal.org.objectweb.asm
- *          java.base/jdk.internal.module
- *          java.xml
- * @run testng AnnotationsTest
- * @summary Basic test of annotations on modules
- */
-
-public class AnnotationsTest {
-
-    /**
-     * Test that there are no annotations on an unnamed module.
-     */
-    @Test
-    public void testUnnamedModule() {
-        Module module = this.getClass().getModule();
-        assertTrue(module.getAnnotations().length == 0);
-    }
-
-    /**
-     * Test loading a module with a RuntimeVisibleAnnotation attribute.
-     * The test copies the module-info.class for java.xml, adds the attribute,
-     * and then loads the updated module.
-     */
-    @Test
-    public void testNamedModule() throws IOException {
-
-        // "deprecate" java.xml
-        Path dir = Files.createTempDirectory("mods");
-        deprecateModule("java.xml", true, "9", dir);
-
-        // "load" the cloned java.xml
-        Module module = loadModule(dir, "java.xml");
-
-        // check the annotation is present
-        assertTrue(module.isAnnotationPresent(Deprecated.class));
-        Deprecated d = module.getAnnotation(Deprecated.class);
-        assertNotNull(d, "@Deprecated not found");
-        assertTrue(d.forRemoval());
-        assertEquals(d.since(), "9");
-        Annotation[] a = module.getAnnotations();
-        assertTrue(a.length == 1);
-        assertTrue(a[0] instanceof Deprecated);
-    }
-
-
-    /**
-     * Copy the module-info.class for the given module, add the
-     * Deprecated annotation, and write the updated module-info.class
-     * to a directory.
-     */
-    static void deprecateModule(String name,
-                                boolean forRemoval,
-                                String since,
-                                Path output) throws IOException {
-        Module module = Layer.boot().findModule(name).orElse(null);
-        assertNotNull(module, name + " not found");
-
-        InputStream in = module.getResourceAsStream("module-info.class");
-        assertNotNull(in, "No module-info.class for " + name);
-
-        try (in) {
-            ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS
-                                             + ClassWriter.COMPUTE_FRAMES);
-
-            ClassVisitor cv = new ClassVisitor(Opcodes.ASM5, cw) { };
-
-            ClassReader cr = new ClassReader(in);
-
-            List<Attribute> attrs = new ArrayList<>();
-            attrs.add(new ClassFileAttributes.ModuleAttribute());
-            attrs.add(new ClassFileAttributes.ModulePackagesAttribute());
-            attrs.add(new ClassFileAttributes.ModuleTargetAttribute());
-            cr.accept(cv, attrs.toArray(new Attribute[0]), 0);
-
-            AnnotationVisitor annotationVisitor
-                = cv.visitAnnotation("Ljava/lang/Deprecated;", true);
-            annotationVisitor.visit("forRemoval", forRemoval);
-            annotationVisitor.visit("since", since);
-            annotationVisitor.visitEnd();
-
-            byte[] bytes = cw.toByteArray();
-            Path mi = output.resolve("module-info.class");
-            Files.write(mi, bytes);
-        }
-    }
-
-    /**
-     * Load the module of the given name in the given directory into a
-     * child layer.
-     */
-    static Module loadModule(Path dir, String name) throws IOException {
-        ModuleFinder finder = ModuleFinder.of(dir);
-
-        Layer bootLayer = Layer.boot();
-
-        Configuration cf = bootLayer.configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of(name));
-
-        ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
-
-        Module module = layer.findModule(name).orElse(null);
-        assertNotNull(module, name + " not loaded");
-        return module;
-    }
-}
diff --git a/jdk/test/java/lang/reflect/Module/BasicModuleTest.java b/jdk/test/java/lang/reflect/Module/BasicModuleTest.java
deleted file mode 100644
index bafa57b..0000000
--- a/jdk/test/java/lang/reflect/Module/BasicModuleTest.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.lang.module.ModuleDescriptor.Exports;
-import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-import java.util.function.Predicate;
-import java.util.stream.Stream;
-
-import org.testng.annotations.Test;
-import static org.testng.Assert.*;
-
-/*
- * @test
- * @summary Basic test of java.lang.reflect.Module
- * @modules java.desktop java.xml
- * @run testng BasicModuleTest
- */
-
-public class BasicModuleTest {
-
-    /**
-     * Tests that the given module reads all modules in the boot Layer.
-     */
-    private void testReadsAllBootModules(Module m) {
-        Layer bootLayer = Layer.boot();
-        bootLayer.configuration()
-            .modules()
-            .stream()
-            .map(ResolvedModule::name)
-            .map(bootLayer::findModule)
-            .forEach(target -> assertTrue(m.canRead(target.get())));
-    }
-
-    /**
-     * Returns {@code true} if the array contains the given object.
-     */
-    private <T> boolean contains(T[] array, T obj) {
-        return Stream.of(array).anyMatch(obj::equals);
-    }
-
-    /**
-     * Returns a {@code Predicate} to test if a package is exported.
-     */
-    private Predicate<Exports> doesExport(String pn) {
-        return e -> (e.source().equals(pn) && !e.isQualified());
-    }
-
-
-
-    @Test
-    public void testThisModule() {
-        Module thisModule = BasicModuleTest.class.getModule();
-        Module baseModule = Object.class.getModule();
-
-        assertFalse(thisModule.isNamed());
-        assertTrue(thisModule.getName() == null);
-        assertTrue(thisModule.getDescriptor() == null);
-        assertTrue(thisModule.getLayer() == null);
-        assertTrue(thisModule.toString().startsWith("unnamed module "));
-
-        ClassLoader thisLoader = BasicModuleTest.class.getClassLoader();
-        assertTrue(thisLoader == thisModule.getClassLoader());
-        assertTrue(thisLoader.getUnnamedModule() == thisModule);
-
-        // unnamed modules read all other modules
-        ClassLoader cl;
-        cl = ClassLoader.getPlatformClassLoader();
-        assertTrue(thisModule.canRead(cl.getUnnamedModule()));
-        cl = ClassLoader.getSystemClassLoader();
-        assertTrue(thisModule.canRead(cl.getUnnamedModule()));
-        testReadsAllBootModules(thisModule);
-
-        // unnamed modules export all packages
-        assertTrue(thisModule.isExported(""));
-        assertTrue(thisModule.isExported("", thisModule));
-        assertTrue(thisModule.isExported("", baseModule));
-        assertTrue(thisModule.isExported("p"));
-        assertTrue(thisModule.isExported("p", thisModule));
-        assertTrue(thisModule.isExported("p", baseModule));
-
-        // this test is in the unnamed package
-        assertTrue(contains(thisModule.getPackages(), ""));
-    }
-
-
-    @Test
-    public void testUnnamedModules() {
-        Module thisModule = BasicModuleTest.class.getModule();
-        Module baseModule = Object.class.getModule();
-
-        ClassLoader loader1 = ClassLoader.getSystemClassLoader();
-        ClassLoader loader2 = loader1.getParent();
-
-        Module m1 = loader1.getUnnamedModule();
-        Module m2 = loader2.getUnnamedModule();
-
-        assertTrue(m1 != m2);
-
-        assertFalse(m1.isNamed());
-        assertFalse(m2.isNamed());
-
-        assertTrue(m1.getLayer() == null);
-        assertTrue(m2.getLayer() == null);
-
-        assertTrue(m1.toString().startsWith("unnamed module "));
-        assertTrue(m2.toString().startsWith("unnamed module "));
-
-        // unnamed module reads all modules
-        assertTrue(m1.canRead(m2));
-        assertTrue(m2.canRead(m1));
-
-        testReadsAllBootModules(m1);
-        testReadsAllBootModules(m2);
-
-        assertTrue(m1.isExported(""));
-        assertTrue(m1.isExported("", thisModule));
-        assertTrue(m1.isExported("", baseModule));
-        assertTrue(m1.isExported("p"));
-        assertTrue(m1.isExported("p", thisModule));
-        assertTrue(m1.isExported("p", baseModule));
-    }
-
-
-
-    @Test
-    public void testBaseModule() {
-        Module base = Object.class.getModule();
-        Module thisModule = BasicModuleTest.class.getModule();
-
-        // getName
-        assertTrue(base.getName().equals("java.base"));
-
-        // getDescriptor
-        assertTrue(base.getDescriptor().exports().stream()
-                .anyMatch(doesExport("java.lang")));
-
-        // getClassLoader
-        assertTrue(base.getClassLoader() == null);
-
-        // getLayer
-        assertTrue(base.getLayer() == Layer.boot());
-
-        // toString
-        assertEquals(base.toString(), "module java.base");
-
-        // getPackages
-        assertTrue(contains(base.getPackages(), "java.lang"));
-
-        // canRead
-        assertTrue(base.canRead(base));
-
-        // isExported
-        assertTrue(base.isExported("java.lang"));
-        assertTrue(base.isExported("java.lang", thisModule));
-        assertTrue(base.isExported("java.lang", base));
-        assertFalse(base.isExported("jdk.internal.misc"));
-        assertFalse(base.isExported("jdk.internal.misc", thisModule));
-        assertTrue(base.isExported("jdk.internal.misc", base));
-        assertFalse(base.isExported("java.wombat"));
-        assertFalse(base.isExported("java.wombat", thisModule));
-        assertFalse(base.isExported("java.wombat", base));
-
-        // isOpen
-        assertFalse(base.isOpen("java.lang"));
-        assertFalse(base.isOpen("java.lang", thisModule));
-        assertTrue(base.isOpen("java.lang", base));
-        assertFalse(base.isOpen("jdk.internal.misc"));
-        assertFalse(base.isOpen("jdk.internal.misc", thisModule));
-        assertTrue(base.isOpen("jdk.internal.misc", base));
-        assertFalse(base.isOpen("java.wombat"));
-        assertFalse(base.isOpen("java.wombat", thisModule));
-        assertFalse(base.isOpen("java.wombat", base));
-    }
-
-
-    @Test
-    public void testDesktopModule() {
-        Module desktop = java.awt.Component.class.getModule();
-        Module base = Object.class.getModule();
-        Module xml = javax.xml.XMLConstants.class.getModule();
-        Module thisModule = BasicModuleTest.class.getModule();
-
-        // name
-        assertTrue(desktop.getName().equals("java.desktop"));
-
-        // descriptor
-        assertTrue(desktop.getDescriptor().exports().stream()
-                   .anyMatch(doesExport("java.awt")));
-
-        // getClassLoader
-        assertTrue(desktop.getClassLoader() == null);
-
-        // getLayer
-        assertTrue(desktop.getLayer() == Layer.boot());
-
-        // toString
-        assertEquals(desktop.toString(), "module java.desktop");
-
-        // getPackages
-        assertTrue(contains(desktop.getPackages(), "java.awt"));
-        assertTrue(contains(desktop.getPackages(), "sun.awt"));
-
-        // canRead
-        assertTrue(desktop.canRead(base));
-        assertTrue(desktop.canRead(xml));
-
-        // isExported
-        assertTrue(desktop.isExported("java.awt"));
-        assertTrue(desktop.isExported("java.awt", thisModule));
-        assertFalse(desktop.isExported("java.wombat"));
-        assertFalse(desktop.isExported("java.wombat", thisModule));
-    }
-
-
-    @Test(expectedExceptions = { NullPointerException.class })
-    public void testIsExportedNull() {
-        Module thisModule = this.getClass().getModule();
-        thisModule.isExported(null, thisModule);
-    }
-
-
-    @Test(expectedExceptions = { NullPointerException.class })
-    public void testIsExportedToNull() {
-        Module thisModule = this.getClass().getModule();
-        thisModule.isExported("", null);
-    }
-
-
-}
diff --git a/jdk/test/java/lang/reflect/Module/WithSecurityManager.java b/jdk/test/java/lang/reflect/Module/WithSecurityManager.java
deleted file mode 100644
index dfb6b76..0000000
--- a/jdk/test/java/lang/reflect/Module/WithSecurityManager.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @test
- * @modules jdk.compiler
- * @summary Test java.lang.reflect.Module methods that specify permission checks
- * @run main/othervm -Djava.security.policy=${test.src}/allow.policy WithSecurityManager allow
- * @run main/othervm WithSecurityManager deny
- */
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.module.Configuration;
-import java.lang.module.ModuleFinder;
-import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-import java.util.Collections;
-import java.util.Optional;
-import java.util.Set;
-
-/**
- * Test java.lang.reflect.Module methods that specify permission checks.
- */
-
-public class WithSecurityManager {
-
-    // a module that will be loaded into a child layer
-    static final String ANOTHER_MODULE          = "jdk.compiler";
-    static final String ANOTHER_MODULE_RESOURCE = "com/sun/tools/javac/Main.class";
-
-    public static void main(String[] args) throws IOException {
-        boolean allow = args[0].equals("allow");
-
-        // base module, in the boot layer
-        Module base = Object.class.getModule();
-
-        // another module, in a child layer
-        Module other = loadModuleInChildLayer(ANOTHER_MODULE);
-        assertTrue(other.getLayer() != Layer.boot());
-
-        System.setSecurityManager(new SecurityManager());
-
-        test(base, "java/lang/Object.class", allow);
-        test(other, ANOTHER_MODULE_RESOURCE, allow);
-    }
-
-    /**
-     * Test the permission checks by invoking methods on the given module.
-     *
-     * If {@code allow} is {@code true} then the permission checks should succeed.
-     */
-    static void test(Module m, String name, boolean allow) throws IOException {
-
-        // test Module::getClassLoader
-        System.out.format("Test getClassLoader on %s ...%n", m);
-        try {
-            ClassLoader cl = m.getClassLoader();
-            System.out.println(cl);
-            if (!allow)
-                assertTrue("getClassLoader should have failed", false);
-        } catch (SecurityException e) {
-            System.out.println(e + " thrown");
-            if (allow)
-                throw e;
-        }
-
-        // test Module::getResourceAsStream
-        System.out.format("Test getResourceAsStream(\"%s\") on %s ...%n", name, m);
-        try (InputStream in = m.getResourceAsStream(name)) {
-            System.out.println(in);
-            if (allow && (in == null))
-                assertTrue(name + " not found", false);
-            if (!allow && (in != null))
-                assertTrue(name + " should not be found", false);
-        }
-
-    }
-
-    /**
-     * Create a module layer that contains the given system module.
-     */
-    static Module loadModuleInChildLayer(String mn) {
-        Optional<ModuleReference> omref = ModuleFinder.ofSystem().find(mn);
-        assertTrue("module " + mn + " not a system module", omref.isPresent());
-
-        // create a ModuleFinder that only finds this module
-        ModuleReference mref = omref.get();
-        ModuleFinder finder = new ModuleFinder() {
-            @Override
-            public Optional<ModuleReference> find(String name) {
-                if (name.equals(mn))
-                    return Optional.of(mref);
-                else
-                    return Optional.empty();
-            }
-
-            @Override
-            public Set<ModuleReference> findAll() {
-                return Collections.singleton(mref);
-            }
-        };
-
-        // create a child configuration and layer with this module
-        Layer bootLayer = Layer.boot();
-        Configuration cf = bootLayer
-            .configuration()
-            .resolveRequires(finder, ModuleFinder.of(), Set.of(ANOTHER_MODULE));
-        Layer layer = bootLayer.defineModulesWithOneLoader(cf, null);
-
-        Optional<Module> om = layer.findModule(mn);
-        assertTrue("module " + mn + " not in child layer", om.isPresent());
-        return om.get();
-    }
-
-    static void assertTrue(String msg, boolean e) {
-        if (!e)
-            throw new RuntimeException(msg);
-    }
-
-    static void assertTrue(boolean e) {
-        if (!e)
-            throw new RuntimeException();
-    }
-
-}
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/p1/Helper.java b/jdk/test/java/lang/reflect/Module/access/src/target/p1/Helper.java
deleted file mode 100644
index e0e45e8..0000000
--- a/jdk/test/java/lang/reflect/Module/access/src/target/p1/Helper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package p1;
-
-import java.lang.reflect.Module;
-
-/**
- * Helper class in target module to allow test invoke addExports[Private]
- */
-
-public class Helper {
-    Helper() { }
-
-    public static void addExports(String pn, Module who) {
-        Helper.class.getModule().addExports(pn, who);
-    }
-
-    public static void addOpens(String pn, Module who) {
-        Helper.class.getModule().addOpens(pn, who);
-    }
-}
diff --git a/jdk/test/java/lang/reflect/Module/access/src/test/test/Main.java b/jdk/test/java/lang/reflect/Module/access/src/test/test/Main.java
deleted file mode 100644
index c58b8e2..0000000
--- a/jdk/test/java/lang/reflect/Module/access/src/test/test/Main.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package test;
-
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Method;
-import java.lang.reflect.Module;
-
-/**
- * Test access to public/non-public members of public/non-public classes in
- * exported and non-exported packages.
- */
-
-public class Main {
-
-    public static void main(String[] args) throws Exception {
-        testPublicClassInExportedPackage();
-        testNonPublicClassInExportedPackage();
-        testPublicClassInNonExportedPackage();
-        testNonPublicClassInNonExportedPackage();
-    }
-
-    static void testPublicClassInExportedPackage() throws Exception {
-        Module thisModule = Main.class.getModule();
-        Module targetModule = getTargetModule();
-
-        assertTrue(targetModule.isExported("p1"));
-        assertTrue(targetModule.isExported("p1", thisModule));
-        assertTrue(targetModule.isExported("p1", targetModule));
-
-        assertFalse(targetModule.isOpen("p1"));
-        assertFalse(targetModule.isOpen("p1", thisModule));
-        assertTrue(targetModule.isOpen("p1", targetModule));
-
-        Class<?> clazz = Class.forName("p1.Public");
-        Constructor<?> ctor1 = clazz.getConstructor();   // public
-        Constructor<?> ctor2 = clazz.getDeclaredConstructor(Void.class); // non-public
-
-        Field f1 = clazz.getField("f1");    // public
-        Field f2 = clazz.getDeclaredField("f2");    // non-public
-
-        Method m1 = clazz.getMethod("foo");  // public
-        Method m2 = clazz.getDeclaredMethod("bar");  // non-public
-
-        tryAccessConstructor(ctor1, true);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, true);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, true);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, true);
-        trySetAccessible(ctor2, false);
-        trySetAccessible(m1, true);
-        trySetAccessible(m2, false);
-        trySetAccessible(f1, true);
-        trySetAccessible(f2, false);
-
-        targetAddOpens("p1", thisModule);
-
-        tryAccessConstructor(ctor1, true);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, true);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, true);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, true);
-        trySetAccessible(ctor2, true);
-        trySetAccessible(m1, true);
-        trySetAccessible(m2, true);
-        trySetAccessible(f1, true);
-        trySetAccessible(f2, true);
-    }
-
-    static void testNonPublicClassInExportedPackage() throws Exception {
-        Module thisModule = Main.class.getModule();
-        Module targetModule = getTargetModule();
-
-        assertTrue(targetModule.isExported("p2"));
-        assertTrue(targetModule.isExported("p2", thisModule));
-        assertTrue(targetModule.isExported("p2", targetModule));
-
-        assertFalse(targetModule.isOpen("p2"));
-        assertFalse(targetModule.isOpen("p2", thisModule));
-        assertTrue(targetModule.isOpen("p1", targetModule));
-
-        Class<?> clazz = Class.forName("p2.NonPublic");
-        Constructor<?> ctor1 = clazz.getConstructor();
-        Constructor<?> ctor2 = clazz.getDeclaredConstructor(Void.class);
-
-        Field f1 = clazz.getField("f1");    // public
-        Field f2 = clazz.getDeclaredField("f2");    // non-public
-
-        Method m1 = clazz.getMethod("foo");  // public
-        Method m2 = clazz.getDeclaredMethod("bar");  // non-public
-
-        tryAccessConstructor(ctor1, false);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, false);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, false);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, false);
-        trySetAccessible(ctor2, false);
-        trySetAccessible(m1, false);
-        trySetAccessible(m2, false);
-        trySetAccessible(f1, false);
-        trySetAccessible(f2, false);
-
-        targetAddExports("p2", thisModule);
-
-        tryAccessConstructor(ctor1, false);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, false);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, false);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, false);
-        trySetAccessible(ctor2, false);
-        trySetAccessible(m1, false);
-        trySetAccessible(m2, false);
-        trySetAccessible(f1, false);
-        trySetAccessible(f2, false);
-
-        targetAddOpens("p2", thisModule);
-
-        tryAccessConstructor(ctor1, false);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, false);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, false);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, true);
-        trySetAccessible(ctor2, true);
-        trySetAccessible(m1, true);
-        trySetAccessible(m2, true);
-        trySetAccessible(f1, true);
-        trySetAccessible(f2, true);
-    }
-
-    static void testPublicClassInNonExportedPackage() throws Exception {
-        Module thisModule = Main.class.getModule();
-        Module targetModule = getTargetModule();
-
-        assertFalse(targetModule.isExported("q1"));
-        assertFalse(targetModule.isExported("q1", thisModule));
-        assertTrue(targetModule.isExported("q1", targetModule));
-
-        assertFalse(targetModule.isOpen("q1"));
-        assertFalse(targetModule.isOpen("q1", thisModule));
-        assertTrue(targetModule.isOpen("q1", targetModule));
-
-        Class<?> clazz = Class.forName("q1.Public");
-        Constructor<?> ctor1 = clazz.getConstructor();  // public
-        Constructor<?> ctor2 = clazz.getDeclaredConstructor(Void.class);  // non-public
-
-        Field f1 = clazz.getField("f1");    // public
-        Field f2 = clazz.getDeclaredField("f2");    // non-public
-
-        Method m1 = clazz.getMethod("foo");  // public
-        Method m2 = clazz.getDeclaredMethod("bar");  // non-public
-
-        tryAccessConstructor(ctor1, false);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, false);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, false);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, false);
-        trySetAccessible(ctor2, false);
-        trySetAccessible(m1, false);
-        trySetAccessible(m2, false);
-        trySetAccessible(f1, false);
-        trySetAccessible(f2, false);
-
-        targetAddExports("q1", thisModule);
-
-        tryAccessConstructor(ctor1, true);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, true);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, true);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, true);
-        trySetAccessible(ctor2, false);
-        trySetAccessible(m1, true);
-        trySetAccessible(m2, false);
-        trySetAccessible(f1, true);
-        trySetAccessible(f2, false);
-
-        targetAddOpens("q1", thisModule);
-
-        tryAccessConstructor(ctor1, true);
-        tryAccessConstructor(ctor1, false);
-        tryAccessMethod(m1, true);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, true);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, true);
-        trySetAccessible(ctor2, true);
-        trySetAccessible(m1, true);
-        trySetAccessible(m2, true);
-        trySetAccessible(f1, true);
-        trySetAccessible(f2, true);
-    }
-
-    static void testNonPublicClassInNonExportedPackage() throws Exception {
-        Module thisModule = Main.class.getModule();
-        Module targetModule = getTargetModule();
-
-        assertFalse(targetModule.isExported("q2"));
-        assertFalse(targetModule.isExported("q2", thisModule));
-        assertTrue(targetModule.isExported("q2", targetModule));
-
-        assertFalse(targetModule.isOpen("q2"));
-        assertFalse(targetModule.isOpen("q2", thisModule));
-        assertTrue(targetModule.isOpen("q2", targetModule));
-
-        Class<?> clazz = Class.forName("q2.NonPublic");
-        Constructor<?> ctor1 = clazz.getConstructor();  // public
-        Constructor<?> ctor2 = clazz.getDeclaredConstructor(Void.class);  // non-public
-
-        Field f1 = clazz.getField("f1");    // public
-        Field f2 = clazz.getDeclaredField("f2");    // non-public
-
-        Method m1 = clazz.getMethod("foo");  // public
-        Method m2 = clazz.getDeclaredMethod("bar");  // non-public
-
-        tryAccessConstructor(ctor1, false);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, false);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, false);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, false);
-        trySetAccessible(ctor2, false);
-        trySetAccessible(m1, false);
-        trySetAccessible(m2, false);
-        trySetAccessible(f1, false);
-        trySetAccessible(f2, false);
-
-        targetAddExports("q2", thisModule);
-
-        tryAccessConstructor(ctor1, false);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, false);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, false);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, false);
-        trySetAccessible(ctor2, false);
-        trySetAccessible(m1, false);
-        trySetAccessible(m2, false);
-        trySetAccessible(f1, false);
-        trySetAccessible(f2, false);
-
-        targetAddOpens("q2", thisModule);
-
-        tryAccessConstructor(ctor1, false);
-        tryAccessConstructor(ctor2, false);
-        tryAccessMethod(m1, false);
-        tryAccessMethod(m2, false);
-        tryAccessObjectField(f1, false);
-        tryAccessObjectField(f2, false);
-
-        trySetAccessible(ctor1, true);
-        trySetAccessible(m1, true);
-        trySetAccessible(m2, true);
-        trySetAccessible(f1, true);
-        trySetAccessible(f2, true);
-    }
-
-
-    static Module getTargetModule() {
-        return Layer.boot().findModule("target").get();
-    }
-
-    static void tryAccessConstructor(Constructor<?> ctor, boolean shouldSucceed) {
-        try {
-            ctor.newInstance();
-            assertTrue(shouldSucceed);
-        } catch (Exception e) {
-            assertFalse(shouldSucceed);
-        }
-    }
-
-    static void tryAccessMethod(Method method, boolean shouldSucceed) {
-        try {
-            method.invoke(null);
-            assertTrue(shouldSucceed);
-        } catch (Exception e) {
-            e.printStackTrace();
-            assertFalse(shouldSucceed);
-        }
-    }
-
-    static void tryAccessObjectField(Field f, boolean shouldSucceed) {
-        try {
-            f.get(null);
-            assertTrue(shouldSucceed);
-        } catch (Exception e) {
-            assertFalse(shouldSucceed);
-        }
-        try {
-            f.set(null, new Object());
-            assertTrue(shouldSucceed);
-        } catch (Exception e) {
-            assertFalse(shouldSucceed);
-        }
-    }
-
-    static void trySetAccessible(AccessibleObject ao, boolean shouldSucceed) {
-        try {
-            ao.setAccessible(true);
-            assertTrue(shouldSucceed);
-        } catch (Exception e) {
-            assertFalse(shouldSucceed);
-        }
-    }
-
-    /**
-     * Update target module to export a package to the given module.
-     */
-    static void targetAddExports(String pn, Module who) throws Exception {
-        Class<?> helper = Class.forName("p1.Helper");
-        Method m = helper.getMethod("addExports", String.class, Module.class);
-        m.invoke(null, pn, who);
-    }
-
-    /**
-     * Update target module to open a package to the given module.
-     */
-    static void targetAddOpens(String pn, Module who) throws Exception {
-        Class<?> helper = Class.forName("p1.Helper");
-        Method m = helper.getMethod("addOpens", String.class, Module.class);
-        m.invoke(null, pn, who);
-    }
-
-    static void assertTrue(boolean expr) {
-        if (!expr) throw new RuntimeException();
-    }
-
-    static void assertFalse(boolean expr) {
-        assertTrue(!expr);
-    }
-}
diff --git a/jdk/test/java/lang/reflect/Module/allow.policy b/jdk/test/java/lang/reflect/Module/allow.policy
deleted file mode 100644
index 08998cf..0000000
--- a/jdk/test/java/lang/reflect/Module/allow.policy
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-grant {
-    permission java.lang.RuntimePermission "getClassLoader";
-    permission java.io.FilePermission "${java.home}/-", "read";
-};
diff --git a/jdk/test/java/lang/reflect/Module/annotation/Basic.java b/jdk/test/java/lang/reflect/Module/annotation/Basic.java
deleted file mode 100644
index 4373378..0000000
--- a/jdk/test/java/lang/reflect/Module/annotation/Basic.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @test
- * @library src
- * @build m/* Basic
- * @run testng/othervm Basic
- * @summary Basic test for annotations on modules
- */
-
-import java.lang.reflect.Module;
-import java.util.Arrays;
-
-import p.annotation.Foo;
-import p.annotation.Bar;
-import p.annotation.Baz;
-
-import org.testng.annotations.Test;
-import static org.testng.Assert.*;
-
-public class Basic {
-
-    final Module module = Foo.class.getModule();
-
-    /**
-     * {@code @Foo} does not have RUNTIME retention policy.
-     */
-    @Test
-    public void testInvisibleAnnotation() {
-        assertFalse(module.isAnnotationPresent(Foo.class));
-        assertNull(module.getAnnotation(Foo.class));
-    }
-
-    /**
-     * {@code @Bar} has RUNTIME retention policy and value "bar"
-     */
-    @Test
-    public void testBarAnnotation() {
-        assertTrue(module.isAnnotationPresent(Bar.class));
-        Bar bar = module.getAnnotation(Bar.class);
-        assertNotNull(bar);
-        assertEquals(bar.value(), "bar");
-    }
-
-    /**
-     * {@code @Baz} has RUNTIME retention policy has a repeating value
-     */
-    @Test
-    public void testBazAnnotation() {
-        assertTrue(module.isAnnotationPresent(Baz.class));
-        Baz baz = module.getAnnotation(Baz.class);
-        assertNotNull(baz);
-        String[] expected = { "one", "two", "three" };
-        assertTrue(Arrays.equals(baz.value(), expected));
-    }
-}
diff --git a/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java b/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java
index 55e11f1..da7b169 100644
--- a/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java
@@ -23,7 +23,6 @@
 
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Proxy;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -88,12 +87,12 @@
     @Test
     public void testNoReadAccess() throws Exception {
         ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        Layer bootLayer = Layer.boot();
+        ModuleLayer bootLayer = ModuleLayer.boot();
         Configuration cf = bootLayer
                 .configuration()
-                .resolveRequiresAndUses(ModuleFinder.of(), finder, modules);
+                .resolveAndBind(ModuleFinder.of(), finder, modules);
         ClassLoader parentLoader = this.getClass().getClassLoader();
-        Layer layer = bootLayer.defineModulesWithOneLoader(cf, parentLoader);
+        ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, parentLoader);
 
         ClassLoader loader = layer.findLoader("m1");
         Class<?>[] interfaces = new Class<?>[] {
diff --git a/jdk/test/java/lang/reflect/Proxy/ProxyForMethodHandle.java b/jdk/test/java/lang/reflect/Proxy/ProxyForMethodHandle.java
index 1c45901..a587701 100644
--- a/jdk/test/java/lang/reflect/Proxy/ProxyForMethodHandle.java
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyForMethodHandle.java
@@ -28,7 +28,6 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Module;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
diff --git a/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java b/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java
index 5b04c93..c420ab4 100644
--- a/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java
@@ -24,7 +24,6 @@
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
 import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Proxy;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -70,18 +69,18 @@
     }
 
     /**
-     * Test proxy implementing interfaces in a Layer defined in
+     * Test proxy implementing interfaces in a layer defined in
      * an unnamed module
      */
     @Test
     public void testProxyInUnnamed() throws Exception {
         ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        Layer bootLayer = Layer.boot();
+        ModuleLayer bootLayer = ModuleLayer.boot();
         Configuration cf = bootLayer
                 .configuration()
-                .resolveRequiresAndUses(ModuleFinder.of(), finder, Arrays.asList(modules));
+                .resolveAndBind(ModuleFinder.of(), finder, Arrays.asList(modules));
         ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+        ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
 
         ClassLoader loader = layer.findLoader("m1");
 
@@ -110,12 +109,12 @@
     @Test
     public void testProxyInDynamicModule() throws Exception {
         ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        Layer bootLayer = Layer.boot();
+        ModuleLayer bootLayer = ModuleLayer.boot();
         Configuration cf = bootLayer
                 .configuration()
-                .resolveRequiresAndUses(ModuleFinder.of(), finder, Arrays.asList(modules));
+                .resolveAndBind(ModuleFinder.of(), finder, Arrays.asList(modules));
         ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+        ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
 
         ClassLoader loader = layer.findLoader("m1");
 
@@ -140,12 +139,12 @@
     @Test
     public void testNoReadAccess() throws Exception {
         ModuleFinder finder = ModuleFinder.of(MODS_DIR);
-        Layer bootLayer = Layer.boot();
+        ModuleLayer bootLayer = ModuleLayer.boot();
         Configuration cf = bootLayer
                 .configuration()
-                .resolveRequiresAndUses(ModuleFinder.of(), finder, Arrays.asList(modules));
+                .resolveAndBind(ModuleFinder.of(), finder, Arrays.asList(modules));
         ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+        ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
 
         ClassLoader loader = layer.findLoader("m1");
 
diff --git a/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java b/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java
index bd8d1b0..4985adf 100644
--- a/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java
@@ -23,7 +23,6 @@
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Module;
 import java.lang.reflect.Proxy;
 
 /*
diff --git a/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/Main.java b/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/Main.java
index 188e3d9..0a342d2 100644
--- a/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/Main.java
+++ b/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/Main.java
@@ -25,7 +25,6 @@
 
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.lang.reflect.Module;
 import static jdk.test.ProxyTest.*;
 
 public class Main {
diff --git a/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/ProxyTest.java b/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/ProxyTest.java
index bbe260b..ee5c024 100644
--- a/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/ProxyTest.java
+++ b/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/ProxyTest.java
@@ -26,7 +26,6 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Module;
 import java.lang.reflect.Proxy;
 import java.util.Arrays;
 
diff --git a/jdk/test/java/lang/reflect/PublicMethods/PublicMethodsTest.java b/jdk/test/java/lang/reflect/PublicMethods/PublicMethodsTest.java
index 0859c8d..d603efe 100644
--- a/jdk/test/java/lang/reflect/PublicMethods/PublicMethodsTest.java
+++ b/jdk/test/java/lang/reflect/PublicMethods/PublicMethodsTest.java
@@ -57,6 +57,8 @@
 /*
  * @test
  * @bug 8062389
+ * @modules jdk.compiler
+ *          jdk.zipfs
  * @summary Nearly exhaustive test of Class.getMethod() and Class.getMethods()
  * @run main PublicMethodsTest
  */
diff --git a/jdk/test/java/lang/reflect/WeakPairMap/Driver.java b/jdk/test/java/lang/reflect/WeakPairMap/Driver.java
deleted file mode 100644
index f84956d..0000000
--- a/jdk/test/java/lang/reflect/WeakPairMap/Driver.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * @test
- * @bug 8888888
- * @summary Functional test for WeakPairMap
- * @build java.base/java.lang.reflect.WeakPairMapTest
- * @run main Driver
- */
-public class Driver {
-    public static void main(String[] args) {
-        java.lang.reflect.WeakPairMapTest.main(args);
-    }
-}
diff --git a/jdk/test/java/lang/reflect/WeakPairMap/java.base/java/lang/reflect/WeakPairMapTest.java b/jdk/test/java/lang/reflect/WeakPairMap/java.base/java/lang/reflect/WeakPairMapTest.java
deleted file mode 100644
index 3247bb3..0000000
--- a/jdk/test/java/lang/reflect/WeakPairMap/java.base/java/lang/reflect/WeakPairMapTest.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.lang.reflect;
-
-import java.lang.ref.Reference;
-import java.util.Objects;
-
-/**
- * Functional test for WeakPairMap
- *
- * @author Peter Levart
- */
-public class WeakPairMapTest {
-    public static void main(String[] args) {
-        WeakPairMap<Object, Object, String> pm = new WeakPairMap<>();
-        Object key1 = new Object();
-        Object key2 = new Object();
-
-        // check for emptiness
-        assertEquals(pm.containsKeyPair(key1, key2), false);
-        assertEquals(pm.get(key1, key2), null);
-
-        // check for NPE(s)
-        for (Object k1 : new Object[]{null, key1}) {
-            for (Object k2 : new Object[]{null, key2}) {
-                for (String v : new String[]{null, "abc"}) {
-
-                    if (k1 != null && k2 != null && v != null) {
-                        // skip non-null args
-                        continue;
-                    }
-
-                    try {
-                        pm.put(k1, k2, v);
-                        throw new AssertionError("Unexpected code path, k1=" +
-                                                 k1 + ", k2=" + k2 + ", v=" + v);
-                    } catch (NullPointerException e) {
-                        // expected
-                    }
-
-                    try {
-                        pm.putIfAbsent(k1, k2, v);
-                        throw new AssertionError("Unexpected code path, k1=" +
-                                                 k1 + ", k2=" + k2 + ", v=" + v);
-                    } catch (NullPointerException e) {
-                        // expected
-                    }
-
-                    if (k1 != null && k2 != null) {
-                        // skip non-null args
-                        continue;
-                    }
-
-                    try {
-                        pm.computeIfAbsent(k1, k2, (_k1, _k2) -> v);
-                        throw new AssertionError("Unexpected code path, k1=" +
-                                                 k1 + ", k2=" + k2 + ", v=" + v);
-                    } catch (NullPointerException e) {
-                        // expected
-                    }
-
-                    try {
-                        pm.containsKeyPair(k1, k2);
-                        throw new AssertionError("Unexpected code path, k1=" +
-                                                 k1 + ", k2=" + k2);
-                    } catch (NullPointerException e) {
-                        // expected
-                    }
-
-                    try {
-                        pm.get(k1, k2);
-                        throw new AssertionError("Unexpected code path, k1=" +
-                                                 k1 + ", k2=" + k2);
-                    } catch (NullPointerException e) {
-                        // expected
-                    }
-                }
-            }
-        }
-
-        // how much to wait when it is expected for entry to be retained
-        final long retentionTimeout = 500L;
-        // how much to wait when it is expected for entry to be removed
-        final long cleanupTimeout = 30_000L;
-
-        // check insertion
-        assertEquals(pm.putIfAbsent(key1, key2, "abc"), null);
-        assertEquals(pm.get(key1, key2), "abc");
-
-        // check retention while both keys are still reachable
-        assertEquals(gcAndWaitRemoved(pm, "abc", retentionTimeout), false);
-        assertEquals(pm.get(key1, key2), "abc");
-
-        // check cleanup when both keys are unreachable
-        key1 = null;
-        key2 = null;
-        assertEquals(gcAndWaitRemoved(pm, "abc", cleanupTimeout), true);
-
-        // new insertion
-        key1 = new Object();
-        key2 = new Object();
-        assertEquals(pm.putIfAbsent(key1, key2, "abc"), null);
-        assertEquals(pm.get(key1, key2), "abc");
-
-        // check retention while both keys are still reachable
-        assertEquals(gcAndWaitRemoved(pm, "abc", retentionTimeout), false);
-        assertEquals(pm.get(key1, key2), "abc");
-
-        // check cleanup when 1st key is unreachable
-        key1 = null;
-        assertEquals(gcAndWaitRemoved(pm, "abc", cleanupTimeout), true);
-        Reference.reachabilityFence(key2);
-
-        // new insertion
-        key1 = new Object();
-        key2 = new Object();
-        assertEquals(pm.putIfAbsent(key1, key2, "abc"), null);
-        assertEquals(pm.get(key1, key2), "abc");
-
-        // check retention while both keys are still reachable
-        assertEquals(gcAndWaitRemoved(pm, "abc", retentionTimeout), false);
-        assertEquals(pm.get(key1, key2), "abc");
-
-        // check cleanup when 2nd key is unreachable
-        key2 = null;
-        assertEquals(gcAndWaitRemoved(pm, "abc", cleanupTimeout), true);
-        Reference.reachabilityFence(key1);
-    }
-
-    /**
-     * Trigger GC and wait for at most {@code millis} ms for given value to
-     * be removed from given WeakPairMap.
-     *
-     * @return true if element has been removed or false if not
-     */
-    static <V> boolean gcAndWaitRemoved(WeakPairMap<?, ?, V> pm, V value,
-                                        long millis) {
-        System.gc();
-        for (int i = 0; i < (millis + 99) / 100 && pm.values().contains(value); i++) {
-            try {
-                Thread.sleep(100L);
-            } catch (InterruptedException e) {
-                throw new AssertionError("Interrupted");
-            }
-        }
-        return !pm.values().contains(value);
-    }
-
-    static void assertEquals(Object actual, Object expected) {
-        if (!Objects.equals(actual, expected)) {
-            throw new AssertionError("Expected: " + expected + ", actual: " + actual);
-        }
-    }
-}
diff --git a/jdk/test/java/net/Inet6Address/B6206527.java b/jdk/test/java/net/Inet6Address/B6206527.java
index 74455cb..4fc90e1 100644
--- a/jdk/test/java/net/Inet6Address/B6206527.java
+++ b/jdk/test/java/net/Inet6Address/B6206527.java
@@ -25,10 +25,14 @@
  * @test 1.1 05/01/05
  * @bug 6206527
  * @summary "cannot assign address" when binding ServerSocket on Suse 9
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.NetworkConfiguration
+ * @run main B6206527
  */
 
 import java.net.*;
 import java.util.*;
+import jdk.testlibrary.NetworkConfiguration;
 
 public class B6206527 {
 
@@ -53,21 +57,12 @@
         ss.bind(new InetSocketAddress(addr, 0));
     }
 
-    public static Inet6Address getLocalAddr () throws Exception {
-        Enumeration e = NetworkInterface.getNetworkInterfaces();
-        while (e.hasMoreElements()) {
-            NetworkInterface ifc = (NetworkInterface) e.nextElement();
-            Enumeration addrs = ifc.getInetAddresses();
-            while (addrs.hasMoreElements()) {
-                InetAddress a = (InetAddress)addrs.nextElement();
-                if (a instanceof Inet6Address) {
-                    Inet6Address ia6 = (Inet6Address) a;
-                    if (ia6.isLinkLocalAddress()) {
-                        return ia6;
-                    }
-                }
-            }
-        }
-        return null;
+    public static Inet6Address getLocalAddr() throws Exception {
+        Optional<Inet6Address> oaddr = NetworkConfiguration.probe()
+                .ip6Addresses()
+                .filter(a -> a.isLinkLocalAddress())
+                .findFirst();
+
+        return oaddr.orElseGet(() -> null);
     }
 }
diff --git a/jdk/test/java/net/Inet6Address/B6558853.java b/jdk/test/java/net/Inet6Address/B6558853.java
index bece918..3c546c2 100644
--- a/jdk/test/java/net/Inet6Address/B6558853.java
+++ b/jdk/test/java/net/Inet6Address/B6558853.java
@@ -21,43 +21,42 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 6558853
  * @summary  getHostAddress() on connections using IPv6 link-local addrs should have zone id
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.NetworkConfiguration
+ * @run main B6558853
  */
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.*;
-import java.util.Enumeration;
+import java.util.Optional;
+import jdk.testlibrary.NetworkConfiguration;
 
 public class B6558853 implements Runnable {
     private InetAddress addr = null;
     private int port = 0;
 
     public static void main(String[] args) throws Exception {
-        ServerSocket ss = new ServerSocket(0);
-        int port = ss.getLocalPort();
-        Enumeration<NetworkInterface> l = NetworkInterface.getNetworkInterfaces();
-        InetAddress dest = null;
-        while (l.hasMoreElements() && dest == null) {
-            NetworkInterface nif = l.nextElement();
-            if (!nif.isUp())
-                continue;
+        Optional<Inet6Address> oaddr = NetworkConfiguration.probe()
+                .ip6Addresses()
+                .filter(a -> a.isLinkLocalAddress())
+                .findFirst();
 
-            for (InterfaceAddress a : nif.getInterfaceAddresses()) {
-                if (a.getAddress() instanceof Inet6Address) {
-                    Inet6Address a6 = (Inet6Address) a.getAddress();
-                    if (a6.isLinkLocalAddress()) {
-                        dest = a6;
-                    }
-                    break;
-                }
-            }
+        if (!oaddr.isPresent()) {
+            System.out.println("No suitable interface found. Exiting.");
+            return;
         }
+
+        Inet6Address dest = oaddr.get();
         System.out.println("Using " + dest);
-        if (dest != null) {
+
+        try (ServerSocket ss = new ServerSocket(0)) {
+            int port = ss.getLocalPort();
             B6558853 test = new B6558853(dest, port);
             Thread thread = new Thread(test);
             thread.start();
diff --git a/jdk/test/java/net/InetAddress/CheckJNI.java b/jdk/test/java/net/InetAddress/CheckJNI.java
index ad121d1..89f00a9 100644
--- a/jdk/test/java/net/InetAddress/CheckJNI.java
+++ b/jdk/test/java/net/InetAddress/CheckJNI.java
@@ -24,11 +24,15 @@
 /* @test
    @bug 4889870 4890033
    @summary java -Xcheck:jni failing in net code on Solaris / [Datagram]Socket.getLocalAddress() failure
+   @library /lib/testlibrary
+   @build jdk.testlibrary.NetworkConfiguration
    @run main/othervm -Xcheck:jni CheckJNI
 */
 
 import java.net.*;
 import java.util.*;
+import java.util.stream.Collectors;
+import jdk.testlibrary.NetworkConfiguration;
 
 public class CheckJNI {
     static Socket s;
@@ -49,32 +53,23 @@
         dg2 = new DatagramSocket (0, InetAddress.getByName ("127.0.0.1"));
         testDatagrams (dg1, dg2);
 
-        /* Use NetworkInterface to find link local IPv6 addrs to test */
+        /* Find link local IPv6 addrs to test */
+        List<Inet6Address> addrs = NetworkConfiguration.probe()
+                .ip6Addresses()
+                .filter(Inet6Address::isLinkLocalAddress)
+                .collect(Collectors.toList());
 
-        Enumeration ifs = NetworkInterface.getNetworkInterfaces();
-        server = new ServerSocket (0);
+        server = new ServerSocket(0);
+        for (Inet6Address ia6 : addrs) {
+            System.out.println("Address:" + ia6);
+            System.out.println("Testing IPv6 Socket");
+            s = new Socket(ia6, server.getLocalPort());
+            s.close();
 
-        while (ifs.hasMoreElements()) {
-            NetworkInterface nif = (NetworkInterface)ifs.nextElement();
-            if (!nif.isUp())
-                continue;
-            Enumeration addrs = nif.getInetAddresses();
-            while (addrs.hasMoreElements()) {
-                InetAddress addr = (InetAddress) addrs.nextElement();
-                if (addr instanceof Inet6Address) {
-                    Inet6Address ia6 = (Inet6Address) addr;
-                    if (ia6.isLinkLocalAddress()) {
-                        System.out.println ("Testing IPv6 Socket");
-                        s = new Socket (ia6, server.getLocalPort());
-                        s.close();
-
-                        System.out.println ("Testing IPv6 DatagramSocket");
-                        dg1 = new DatagramSocket (0, ia6);
-                        dg2 = new DatagramSocket (0, ia6);
-                        testDatagrams (dg1, dg2);
-                    }
-                }
-            }
+            System.out.println("Testing IPv6 DatagramSocket");
+            dg1 = new DatagramSocket(0, ia6);
+            dg2 = new DatagramSocket(0, ia6);
+            testDatagrams(dg1, dg2);
         }
         server.close();
         System.out.println ("OK");
diff --git a/jdk/test/java/net/MulticastSocket/B6427403.java b/jdk/test/java/net/MulticastSocket/B6427403.java
index b910ae6..d6e8789 100644
--- a/jdk/test/java/net/MulticastSocket/B6427403.java
+++ b/jdk/test/java/net/MulticastSocket/B6427403.java
@@ -23,15 +23,12 @@
 
 /*
  * @test
- *
  * @bug 6427403
- *
  * @summary java.net.MulticastSocket.joinGroup() reports 'socket closed'
- *
  */
 import java.net.*;
 import java.io.*;
-import java.util.*;
+
 public class B6427403 {
     public static void main( String[] args ) throws IOException {
         InetAddress lh = InetAddress.getLocalHost();
@@ -39,4 +36,4 @@
         ms.joinGroup( InetAddress.getByName("224.80.80.80") );
         ms.close();
     }
-}
+}
\ No newline at end of file
diff --git a/jdk/test/java/net/MulticastSocket/JoinGroup.java b/jdk/test/java/net/MulticastSocket/JoinGroup.java
deleted file mode 100644
index 8e711aa..0000000
--- a/jdk/test/java/net/MulticastSocket/JoinGroup.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 4091811 4148753
- * @summary Test java.net.MulticastSocket joinGroup and leaveGroup
- *
- */
-
-import java.io.*;
-import java.net.*;
-
-
-public class JoinGroup {
-
-    public static void main(String args[]) throws Exception  {
-        MulticastSocket soc = null;
-        InetAddress sin = null;
-
-        soc = new MulticastSocket();
-        sin = InetAddress.getByName("224.80.80.80");
-        soc.joinGroup(sin);
-        soc.leaveGroup(sin);
-    }
-}
diff --git a/jdk/test/java/net/MulticastSocket/JoinLeave.java b/jdk/test/java/net/MulticastSocket/JoinLeave.java
new file mode 100644
index 0000000..93dd939
--- /dev/null
+++ b/jdk/test/java/net/MulticastSocket/JoinLeave.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4091811 4148753 4102731
+ * @summary Test java.net.MulticastSocket joinGroup and leaveGroup
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.NetworkConfiguration
+ * @run main JoinLeave
+ */
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.net.InetAddress;
+import java.net.MulticastSocket;
+import java.net.NetworkInterface;
+import jdk.testlibrary.NetworkConfiguration;
+
+public class JoinLeave {
+
+    public static void main(String args[]) throws IOException  {
+        InetAddress ip4Group = InetAddress.getByName("224.80.80.80");
+        InetAddress ip6Group = InetAddress.getByName("ff02::a");
+
+        NetworkConfiguration nc = NetworkConfiguration.probe();
+        nc.ip4MulticastInterfaces().forEach(nic -> joinLeave(ip4Group, nic));
+        nc.ip6MulticastInterfaces().forEach(nic -> joinLeave(ip6Group, nic));
+    }
+
+    static void joinLeave(InetAddress group, NetworkInterface nif)
+    {
+        System.out.println("Joining:" + group + " on " + nif);
+        try (MulticastSocket soc = new MulticastSocket()) {
+            soc.setNetworkInterface(nif);
+            soc.joinGroup(group);
+            soc.leaveGroup(group);
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+}
diff --git a/jdk/test/java/net/MulticastSocket/Leave.java b/jdk/test/java/net/MulticastSocket/Leave.java
deleted file mode 100644
index 0ca23b3..0000000
--- a/jdk/test/java/net/MulticastSocket/Leave.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 4102731
- * @summary Test the java.net.multicastsocket.leave method
- *
- */
-
-import java.net.*;
-import java.io.*;
-
-public class Leave {
-
-    public static void main(String args[]) throws Exception {
-        MulticastSocket socket = null;
-        InetAddress mca = null;
-
-        mca = InetAddress.getByName("224.80.80.80");
-        socket = new MulticastSocket();
-        socket.joinGroup(mca);
-        socket.leaveGroup(mca);
-        socket.close();
-    }
-}
diff --git a/jdk/test/java/net/MulticastSocket/NetworkInterfaceEmptyGetInetAddressesTest.java b/jdk/test/java/net/MulticastSocket/NetworkInterfaceEmptyGetInetAddressesTest.java
new file mode 100644
index 0000000..5eb3bdf
--- /dev/null
+++ b/jdk/test/java/net/MulticastSocket/NetworkInterfaceEmptyGetInetAddressesTest.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8175325
+ * @summary test NetworkInterface getInterfaceAddresses method on the NetworkInterface returned
+ * from the getNetworkInterface invocation on a MulticastSocket bound to a wildcard address.
+ *
+ */
+
+import java.net.MulticastSocket;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+
+public class NetworkInterfaceEmptyGetInetAddressesTest {
+
+    static int exceptionCount = 0;
+
+    public static void testMethods(NetworkInterface netIf) throws Exception {
+        testNetworkInterface_getInterfaceAddresses(netIf);
+
+        if (exceptionCount > 0) {
+            throw new RuntimeException("Unexpected Exceptions in test");
+        }
+    }
+
+    private static void testNetworkInterface_getInterfaceAddresses(
+            NetworkInterface netIf) {
+        try {
+            netIf.getInterfaceAddresses();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            incrementExceptionCount();
+        }
+    }
+
+    private static void incrementExceptionCount() {
+        exceptionCount++;
+    }
+
+    public static void main(String[] args) throws Exception {
+        MulticastSocket mcastSock = null;
+        try {
+            mcastSock = new MulticastSocket();
+            System.out.println("macst socket address == "
+                    + mcastSock.getLocalAddress());
+            NetworkInterface netIf = mcastSock.getNetworkInterface();
+            testMethods(netIf);
+        } finally {
+            if (mcastSock != null) {
+                mcastSock.close();
+            }
+        }
+    }
+}
diff --git a/jdk/test/java/net/NetworkConfigurationProbe.java b/jdk/test/java/net/NetworkConfigurationProbe.java
new file mode 100644
index 0000000..8b8127a
--- /dev/null
+++ b/jdk/test/java/net/NetworkConfigurationProbe.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @summary NOT A TEST. Captures the network interface configuration.
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.NetworkConfiguration
+ * @run main NetworkConfigurationProbe
+ */
+
+import java.net.Inet4Address;
+import java.net.Inet6Address;
+import java.net.NetworkInterface;
+import jdk.testlibrary.NetworkConfiguration;
+import static java.util.stream.Collectors.joining;
+import static java.lang.System.out;
+
+/**
+ * Not a test. Captures the network interface configuration.
+ */
+public class NetworkConfigurationProbe {
+
+    public static void main(String... args) throws Exception {
+        NetworkConfiguration.printSystemConfiguration(out);
+
+        NetworkConfiguration nc = NetworkConfiguration.probe();
+        String list;
+        list = nc.ip4MulticastInterfaces()
+                  .map(NetworkInterface::getName)
+                  .collect(joining(" "));
+        out.println("ip4MulticastInterfaces: " +  list);
+
+        list = nc.ip4Addresses()
+                  .map(Inet4Address::toString)
+                  .collect(joining(" "));
+        out.println("ip4Addresses: " +  list);
+
+        list = nc.ip6MulticastInterfaces()
+                  .map(NetworkInterface::getName)
+                  .collect(joining(" "));
+        out.println("ip6MulticastInterfaces: " +  list);
+
+        list = nc.ip6Addresses()
+                  .map(Inet6Address::toString)
+                  .collect(joining(" "));
+        out.println("ip6Addresses: " +  list);
+    }
+}
diff --git a/jdk/test/java/net/Socket/LinkLocal.java b/jdk/test/java/net/Socket/LinkLocal.java
index 35cd96a..e62522c 100644
--- a/jdk/test/java/net/Socket/LinkLocal.java
+++ b/jdk/test/java/net/Socket/LinkLocal.java
@@ -26,9 +26,15 @@
  * @bug 4469866
  * @summary Connecting to a link-local IPv6 address should not
  *          causes a SocketException to be thrown.
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.NetworkConfiguration
+ * @run main LinkLocal
  */
+import jdk.testlibrary.NetworkConfiguration;
+
 import java.net.*;
-import java.util.Enumeration;
+import java.util.List;
+import java.util.stream.Collectors;
 
 public class LinkLocal {
 
@@ -134,22 +140,13 @@
          * IPv6 address.
          */
         if (args.length == 0) {
-            Enumeration nifs = NetworkInterface.getNetworkInterfaces();
-            while (nifs.hasMoreElements()) {
-                NetworkInterface ni = (NetworkInterface)nifs.nextElement();
-                if (!ni.isUp())
-                    continue;
+            List<Inet6Address> addrs = NetworkConfiguration.probe()
+                    .ip6Addresses()
+                    .filter(Inet6Address::isLinkLocalAddress)
+                    .collect(Collectors.toList());
 
-                Enumeration addrs = ni.getInetAddresses();
-                while (addrs.hasMoreElements()) {
-                    InetAddress addr = (InetAddress)addrs.nextElement();
-
-                    if (addr instanceof Inet6Address &&
-                        addr.isLinkLocalAddress()) {
-
-                        TestAddress(addr);
-                    }
-                }
+            for (Inet6Address addr : addrs) {
+                TestAddress(addr);
             }
         }
 
diff --git a/jdk/test/java/net/SocketPermission/SocketPermissionTest.java b/jdk/test/java/net/SocketPermission/SocketPermissionTest.java
index b77b425..e67802a 100644
--- a/jdk/test/java/net/SocketPermission/SocketPermissionTest.java
+++ b/jdk/test/java/net/SocketPermission/SocketPermissionTest.java
@@ -25,13 +25,17 @@
  * @test
  * @bug 8047031
  * @summary SocketPermission tests for legacy socket types
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.NetworkConfiguration
  * @run testng/othervm SocketPermissionTest
  */
+
 import java.io.IOException;
 import java.net.DatagramPacket;
 import java.net.DatagramSocket;
 import java.net.InetAddress;
 import java.net.MulticastSocket;
+import java.net.NetworkInterface;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.net.SocketPermission;
@@ -44,11 +48,14 @@
 import java.security.Policy;
 import java.security.PrivilegedExceptionAction;
 import java.security.ProtectionDomain;
+import java.util.Optional;
 
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
+
 import static org.testng.Assert.*;
 
+import static jdk.testlibrary.NetworkConfiguration.probe;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 public class SocketPermissionTest {
@@ -210,12 +217,17 @@
                     new SocketPermission(addr, "listen,resolve"),
                     new SocketPermission("229.227.226.221", "connect,accept"));
 
-            // Positive
-            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
-                s.joinGroup(group);
-                s.leaveGroup(group);
-                return null;
-            }, acc);
+            // Positive ( requires a functional network interface )
+            Optional<NetworkInterface> onif = probe().ip4MulticastInterfaces().findFirst();
+            if (!onif.isPresent()) {
+                s.setNetworkInterface(onif.get());
+
+                AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
+                    s.joinGroup(group);
+                    s.leaveGroup(group);
+                    return null;
+                }, acc);
+            }
 
             // Negative
             try {
diff --git a/jdk/test/java/net/URL/JarHandlerPkgPrefix/JarHandlerPkgPrefix.java b/jdk/test/java/net/URL/JarHandlerPkgPrefix/JarHandlerPkgPrefix.java
new file mode 100644
index 0000000..0ad66fa
--- /dev/null
+++ b/jdk/test/java/net/URL/JarHandlerPkgPrefix/JarHandlerPkgPrefix.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import handlers.jar.Handler;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/*
+ * @test
+ * @bug 8174151
+ * @summary Test for java.protocol.handler.pkgs with jar protocol handler
+ * @library /lib/testlibrary/java/util/jar
+ * @compile handlers/jar/Handler.java
+ * @run main/othervm -Djava.protocol.handler.pkgs=handlers JarHandlerPkgPrefix
+ */
+public class JarHandlerPkgPrefix {
+
+    static void createJar(Path p) throws Exception {
+        JarBuilder jb = new JarBuilder(p.toString());
+        jb.addEntry("resource.txt", "CONTENTS".getBytes());
+        jb.build();
+    }
+
+    public static void main(String[] args) throws Exception {
+        Path jarPath = Paths.get(System.getProperty("user.dir", "."), "test.jar");
+        try {
+            createJar(jarPath);
+
+            URL j = new URL("jar:file:" + jarPath.toString() + "!/");
+            URLClassLoader ucl = new URLClassLoader(new URL[]{j});
+            ucl.findResource("resource.txt");
+
+            URL r = new URL("jar:file:" + jarPath.toString() + "!/resource.txt");
+            if (!Handler.URLS.contains(r))
+                throw new AssertionError("jar: URL handler not invoked");
+        }
+        finally {
+            Files.delete(jarPath);
+        }
+    }
+}
\ No newline at end of file
diff --git a/jdk/test/java/net/URL/JarHandlerPkgPrefix/handlers/jar/Handler.java b/jdk/test/java/net/URL/JarHandlerPkgPrefix/handlers/jar/Handler.java
new file mode 100644
index 0000000..b0309a9
--- /dev/null
+++ b/jdk/test/java/net/URL/JarHandlerPkgPrefix/handlers/jar/Handler.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package handlers.jar;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class Handler extends URLStreamHandler {
+    public static Set<URL> URLS = Collections.synchronizedSet(new HashSet<>());
+
+    @Override
+    protected URLConnection openConnection(URL u) throws IOException {
+        URLS.add(u);
+        return null;
+    }
+}
diff --git a/jdk/test/java/net/URLConnection/SetDefaultUseCaches.java b/jdk/test/java/net/URLConnection/SetDefaultUseCaches.java
index 2c12889..73c822a 100644
--- a/jdk/test/java/net/URLConnection/SetDefaultUseCaches.java
+++ b/jdk/test/java/net/URLConnection/SetDefaultUseCaches.java
@@ -22,46 +22,95 @@
  */
 
 /* @test
- * @bug 8163449
+ * @bug 8163449 8175261
  * @summary Allow per protocol setting for URLConnection defaultUseCaches
- * @run main/othervm SetDefaultUseCaches
+ * @run testng/othervm SetDefaultUseCaches
  */
 
-import java.net.*;
-import java.io.*;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.net.URL;
+import java.net.URLConnection;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
 
 public class SetDefaultUseCaches {
-    static void testAssert(boolean value, boolean comparator) {
-        if (value != comparator) {
-            System.err.println("Expected " + comparator + " Got " + value);
-            throw new RuntimeException("Test failed:");
-        } else
-            System.err.println("OK");
+
+    final URL fileURL = uncheckURL("file:///a/b.txt");
+    final URL httpURL = uncheckURL("http://www.foo.com/");
+    final URL jarFileURL = uncheckURL("jar:file:///a/b.jar!/anEntry");
+    final URL jarHttpURL = uncheckURL("jar:http://www.foo.com/a/b.jar!/anEntry");
+
+    @Test
+    public void test() throws Exception {
+        // check JAR both before and after other protocol tests as JAR URLs
+        // effectively wrap/embed other URLs. The syntax is jar:<url>!/{entry}
+        checkJAR(true);
+        checkJAR(false);
+        checkJAR(true);
+
+        checkHTTP();
+        checkFile();
+
+        // ensure that JAR URLs still respect their per-protocol value
+        checkJAR(false);
+        checkJAR(true);
+        checkJAR(false);
     }
 
-    public static void main(String s[]) throws Exception {
-        URL url = new URL("http://www.foo.com/");
-        URL url1 = new URL("file:///a/b.txt");
-
+    void checkHTTP() throws IOException {
         // check default default is true
-        URLConnection urlc = url.openConnection();
-        testAssert(urlc.getDefaultUseCaches(), true);
+        URLConnection httpURLConn = httpURL.openConnection();
+        assertTrue(httpURLConn.getDefaultUseCaches());
 
         // set default for http to false and check
         URLConnection.setDefaultUseCaches("HTTP", false);
 
-        urlc = url.openConnection();
-        testAssert(urlc.getDefaultUseCaches(), true);
-        testAssert(urlc.getUseCaches(), false);
-        testAssert(URLConnection.getDefaultUseCaches("http"), false);
+        httpURLConn = httpURL.openConnection();
+        assertTrue(httpURLConn.getDefaultUseCaches());
+        assertFalse(httpURLConn.getUseCaches());
+        assertFalse(URLConnection.getDefaultUseCaches("http"));
+    }
 
-        URLConnection urlc1 = url1.openConnection();
-        testAssert(urlc1.getDefaultUseCaches(), true);
+    void checkFile() throws IOException {
+        URLConnection fileURLConn = fileURL.openConnection();
+        assertTrue(fileURLConn.getDefaultUseCaches());
 
         // set default default to false and check other values the same
-        urlc.setDefaultUseCaches(false);
-        urlc1.setDefaultUseCaches("fiLe", true);
-        testAssert(urlc1.getDefaultUseCaches(), false);
-        testAssert(URLConnection.getDefaultUseCaches("fiLE"), true);
+        fileURLConn.setDefaultUseCaches(false);
+        fileURLConn.setDefaultUseCaches("fiLe", true);
+        assertFalse(fileURLConn.getDefaultUseCaches());
+        assertTrue(URLConnection.getDefaultUseCaches("fiLE"));
+    }
+
+    void checkJAR(boolean defaultValue) throws IOException {
+        URLConnection.setDefaultUseCaches("JAR", defaultValue);
+        assertEquals(URLConnection.getDefaultUseCaches("JAr"), defaultValue);
+
+        URLConnection jarFileURLConn = jarFileURL.openConnection();
+        URLConnection jarHttpURLConn = jarHttpURL.openConnection();
+        assertEquals(jarFileURLConn.getUseCaches(), defaultValue);
+        assertEquals(jarHttpURLConn.getUseCaches(), defaultValue);
+        jarFileURLConn.setUseCaches(!defaultValue);
+        jarHttpURLConn.setUseCaches(!defaultValue);
+        assertEquals(jarFileURLConn.getUseCaches(), !defaultValue);
+        assertEquals(jarHttpURLConn.getUseCaches(), !defaultValue);
+
+        URLConnection.setDefaultUseCaches("JaR", !defaultValue); // case-insensitive
+        assertEquals(URLConnection.getDefaultUseCaches("jAR"), !defaultValue);
+
+        jarFileURLConn = jarFileURL.openConnection();
+        jarHttpURLConn = jarHttpURL.openConnection();
+        assertEquals(jarFileURLConn.getUseCaches(), !defaultValue);
+        assertEquals(jarHttpURLConn.getUseCaches(), !defaultValue);
+        jarFileURLConn.setUseCaches(defaultValue);
+        jarHttpURLConn.setUseCaches(defaultValue);
+        assertEquals(jarFileURLConn.getUseCaches(), defaultValue);
+        assertEquals(jarHttpURLConn.getUseCaches(), defaultValue);
+    }
+
+    static URL uncheckURL(String url) {
+        try { return new URL(url); }
+        catch (IOException e) { throw new UncheckedIOException(e); }
     }
 }
diff --git a/jdk/test/java/net/httpclient/HandshakePhase.java b/jdk/test/java/net/httpclient/HandshakePhase.java
deleted file mode 100644
index 2585ce7..0000000
--- a/jdk/test/java/net/httpclient/HandshakePhase.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.net.InetSocketAddress;
-import java.net.URI;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.channels.ServerSocketChannel;
-import java.nio.channels.SocketChannel;
-import java.nio.charset.CharacterCodingException;
-import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Arrays;
-import java.util.Base64;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CompletableFuture;
-import java.util.function.Function;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-import static java.lang.String.format;
-import static java.util.Objects.requireNonNull;
-
-//
-// Performs a simple opening handshake and yields the channel.
-//
-// Client Request:
-//
-//    GET /chat HTTP/1.1
-//    Host: server.example.com
-//    Upgrade: websocket
-//    Connection: Upgrade
-//    Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
-//    Origin: http://example.com
-//    Sec-WebSocket-Protocol: chat, superchat
-//    Sec-WebSocket-Version: 13
-//
-//
-// Server Response:
-//
-//    HTTP/1.1 101 Switching Protocols
-//    Upgrade: websocket
-//    Connection: Upgrade
-//    Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
-//    Sec-WebSocket-Protocol: chat
-//
-final class HandshakePhase {
-
-    private final ServerSocketChannel ssc;
-
-    HandshakePhase(InetSocketAddress address) {
-        requireNonNull(address);
-        try {
-            ssc = ServerSocketChannel.open();
-            ssc.bind(address);
-        } catch (IOException e) {
-            throw new UncheckedIOException(e);
-        }
-    }
-
-    //
-    // Returned CF completes normally after the handshake has been performed
-    //
-    CompletableFuture<SocketChannel> afterHandshake(
-            Function<List<String>, List<String>> mapping) {
-        return CompletableFuture.supplyAsync(
-                () -> {
-                    SocketChannel socketChannel = accept();
-                    try {
-                        StringBuilder request = new StringBuilder();
-                        if (!readRequest(socketChannel, request)) {
-                            throw new IllegalStateException();
-                        }
-                        List<String> strings = Arrays.asList(
-                                request.toString().split("\r\n")
-                        );
-                        List<String> response = mapping.apply(strings);
-                        writeResponse(socketChannel, response);
-                        return socketChannel;
-                    } catch (Throwable t) {
-                        try {
-                            socketChannel.close();
-                        } catch (IOException ignored) { }
-                        throw t;
-                    }
-                });
-    }
-
-    CompletableFuture<SocketChannel> afterHandshake() {
-        return afterHandshake((request) -> {
-            List<String> response = new LinkedList<>();
-            Iterator<String> iterator = request.iterator();
-            if (!iterator.hasNext()) {
-                throw new IllegalStateException("The request is empty");
-            }
-            if (!"GET / HTTP/1.1".equals(iterator.next())) {
-                throw new IllegalStateException
-                        ("Unexpected status line: " + request.get(0));
-            }
-            response.add("HTTP/1.1 101 Switching Protocols");
-            Map<String, String> requestHeaders = new HashMap<>();
-            while (iterator.hasNext()) {
-                String header = iterator.next();
-                String[] split = header.split(": ");
-                if (split.length != 2) {
-                    throw new IllegalStateException
-                            ("Unexpected header: " + header
-                                    + ", split=" + Arrays.toString(split));
-                }
-                if (requestHeaders.put(split[0], split[1]) != null) {
-                    throw new IllegalStateException
-                            ("Duplicating headers: " + Arrays.toString(split));
-                }
-            }
-            if (requestHeaders.containsKey("Sec-WebSocket-Protocol")) {
-                throw new IllegalStateException("Subprotocols are not expected");
-            }
-            if (requestHeaders.containsKey("Sec-WebSocket-Extensions")) {
-                throw new IllegalStateException("Extensions are not expected");
-            }
-            expectHeader(requestHeaders, "Connection", "Upgrade");
-            response.add("Connection: Upgrade");
-            expectHeader(requestHeaders, "Upgrade", "websocket");
-            response.add("Upgrade: websocket");
-            expectHeader(requestHeaders, "Sec-WebSocket-Version", "13");
-            String key = requestHeaders.get("Sec-WebSocket-Key");
-            if (key == null) {
-                throw new IllegalStateException("Sec-WebSocket-Key is missing");
-            }
-            MessageDigest sha1 = null;
-            try {
-                sha1 = MessageDigest.getInstance("SHA-1");
-            } catch (NoSuchAlgorithmException e) {
-                throw new InternalError(e);
-            }
-            String x = key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
-            sha1.update(x.getBytes(StandardCharsets.ISO_8859_1));
-            String v = Base64.getEncoder().encodeToString(sha1.digest());
-            response.add("Sec-WebSocket-Accept: " + v);
-            return response;
-        });
-    }
-
-    private String expectHeader(Map<String, String> headers,
-                                String name,
-                                String value) {
-        String v = headers.get(name);
-        if (!value.equals(v)) {
-            throw new IllegalStateException(
-                    format("Expected '%s: %s', actual: '%s: %s'",
-                            name, value, name, v)
-            );
-        }
-        return v;
-    }
-
-    URI getURI() {
-        InetSocketAddress a;
-        try {
-            a = (InetSocketAddress) ssc.getLocalAddress();
-        } catch (IOException e) {
-            throw new UncheckedIOException(e);
-        }
-        return URI.create("ws://" + a.getHostName() + ":" + a.getPort());
-    }
-
-    private int read(SocketChannel socketChannel, ByteBuffer buffer) {
-        try {
-            int num = socketChannel.read(buffer);
-            if (num == -1) {
-                throw new IllegalStateException("Unexpected EOF");
-            }
-            assert socketChannel.isBlocking() && num > 0;
-            return num;
-        } catch (IOException e) {
-            throw new UncheckedIOException(e);
-        }
-    }
-
-    private SocketChannel accept() {
-        SocketChannel socketChannel = null;
-        try {
-            socketChannel = ssc.accept();
-            socketChannel.configureBlocking(true);
-        } catch (IOException e) {
-            if (socketChannel != null) {
-                try {
-                    socketChannel.close();
-                } catch (IOException ignored) { }
-            }
-            throw new UncheckedIOException(e);
-        }
-        return socketChannel;
-    }
-
-    private boolean readRequest(SocketChannel socketChannel,
-                                StringBuilder request) {
-        ByteBuffer buffer = ByteBuffer.allocateDirect(512);
-        read(socketChannel, buffer);
-        CharBuffer decoded;
-        buffer.flip();
-        try {
-            decoded =
-                    StandardCharsets.ISO_8859_1.newDecoder().decode(buffer);
-        } catch (CharacterCodingException e) {
-            throw new UncheckedIOException(e);
-        }
-        request.append(decoded);
-        return Pattern.compile("\r\n\r\n").matcher(request).find();
-    }
-
-    private void writeResponse(SocketChannel socketChannel,
-                               List<String> response) {
-        String s = response.stream().collect(Collectors.joining("\r\n"))
-                + "\r\n\r\n";
-        ByteBuffer encoded;
-        try {
-            encoded =
-                    StandardCharsets.ISO_8859_1.newEncoder().encode(CharBuffer.wrap(s));
-        } catch (CharacterCodingException e) {
-            throw new UncheckedIOException(e);
-        }
-        write(socketChannel, encoded);
-    }
-
-    private void write(SocketChannel socketChannel, ByteBuffer buffer) {
-        try {
-            while (buffer.hasRemaining()) {
-                socketChannel.write(buffer);
-            }
-        } catch (IOException e) {
-            try {
-                socketChannel.close();
-            } catch (IOException ignored) { }
-            throw new UncheckedIOException(e);
-        }
-    }
-}
diff --git a/jdk/test/java/net/httpclient/SmallTimeout.java b/jdk/test/java/net/httpclient/SmallTimeout.java
new file mode 100644
index 0000000..c06994c
--- /dev/null
+++ b/jdk/test/java/net/httpclient/SmallTimeout.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.URI;
+import jdk.incubator.http.HttpClient;
+import jdk.incubator.http.HttpRequest;
+import jdk.incubator.http.HttpResponse;
+import jdk.incubator.http.HttpTimeoutException;
+import java.time.Duration;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
+import static java.lang.System.out;
+import static jdk.incubator.http.HttpResponse.BodyHandler.discard;
+
+/**
+ * @test
+ * @bug 8178147
+ * @summary Ensures that small timeouts do not cause hangs due to race conditions
+ * @run main/othervm SmallTimeout
+ */
+
+// To enable logging use. Not enabled by default as it changes the dynamics
+// of the test.
+// @run main/othervm -Djdk.httpclient.HttpClient.log=all,frames:all SmallTimeout
+
+public class SmallTimeout {
+
+    static int[] TIMEOUTS = {2, 1, 3, 2, 100, 1};
+
+    // A queue for placing timed out requests so that their order can be checked.
+    static LinkedBlockingQueue<HttpRequest> queue = new LinkedBlockingQueue<>();
+
+    static volatile boolean error;
+
+    public static void main(String[] args) throws Exception {
+        HttpClient client = HttpClient.newHttpClient();
+
+        try (ServerSocket ss = new ServerSocket(0, 20)) {
+            int port = ss.getLocalPort();
+            URI uri = new URI("http://127.0.0.1:" + port + "/");
+
+            HttpRequest[] requests = new HttpRequest[TIMEOUTS.length];
+
+            out.println("--- TESTING Async");
+            for (int i = 0; i < TIMEOUTS.length; i++) {
+                requests[i] = HttpRequest.newBuilder(uri)
+                                         .timeout(Duration.ofMillis(TIMEOUTS[i]))
+                                         .GET()
+                                         .build();
+
+                final HttpRequest req = requests[i];
+                CompletableFuture<HttpResponse<Object>> response = client
+                    .sendAsync(req, discard(null))
+                    .whenComplete((HttpResponse<Object> r, Throwable t) -> {
+                        if (r != null) {
+                            out.println("Unexpected response: " + r);
+                            error = true;
+                        }
+                        if (t != null) {
+                            if (!(t.getCause() instanceof HttpTimeoutException)) {
+                                out.println("Wrong exception type:" + t.toString());
+                                Throwable c = t.getCause() == null ? t : t.getCause();
+                                c.printStackTrace();
+                                error = true;
+                            } else {
+                                out.println("Caught expected timeout: " + t.getCause());
+                            }
+                        }
+                        if (t == null && r == null) {
+                            out.println("Both response and throwable are null!");
+                            error = true;
+                        }
+                        queue.add(req);
+                    });
+            }
+            System.out.println("All requests submitted. Waiting ...");
+
+            checkReturn(requests);
+
+            if (error)
+                throw new RuntimeException("Failed. Check output");
+
+            // Repeat blocking in separate threads. Use queue to wait.
+            out.println("--- TESTING Sync");
+
+            // For running blocking response tasks
+            ExecutorService executor = Executors.newCachedThreadPool();
+
+            for (int i = 0; i < TIMEOUTS.length; i++) {
+                requests[i] = HttpRequest.newBuilder(uri)
+                                         .timeout(Duration.ofMillis(TIMEOUTS[i]))
+                                         .GET()
+                                         .build();
+
+                final HttpRequest req = requests[i];
+                executor.execute(() -> {
+                    try {
+                        client.send(req, discard(null));
+                    } catch (HttpTimeoutException e) {
+                        out.println("Caught expected timeout: " + e);
+                        queue.offer(req);
+                    } catch (IOException | InterruptedException ee) {
+                        Throwable c = ee.getCause() == null ? ee : ee.getCause();
+                        c.printStackTrace();
+                        error = true;
+                    }
+                });
+            }
+            System.out.println("All requests submitted. Waiting ...");
+
+            checkReturn(requests);
+
+            executor.shutdownNow();
+
+            if (error)
+                throw new RuntimeException("Failed. Check output");
+
+        } finally {
+            ((ExecutorService) client.executor()).shutdownNow();
+        }
+    }
+
+    static void checkReturn(HttpRequest[] requests) throws InterruptedException {
+        // wait for exceptions and check order
+        for (int j = 0; j < TIMEOUTS.length; j++) {
+            HttpRequest req = queue.take();
+            out.println("Got request from queue " + req + ", order: " + getRequest(req, requests));
+        }
+        out.println("Return ok");
+    }
+
+    /** Returns the index of the request in the array. */
+    static String getRequest(HttpRequest req, HttpRequest[] requests) {
+        for (int i=0; i<requests.length; i++) {
+            if (req == requests[i]) {
+                return "r" + i;
+            }
+        }
+        throw new AssertionError("Unknown request: " + req);
+    }
+}
diff --git a/jdk/test/java/net/httpclient/TimeoutOrdering.java b/jdk/test/java/net/httpclient/TimeoutOrdering.java
index 36603c4..ce0a9ea 100644
--- a/jdk/test/java/net/httpclient/TimeoutOrdering.java
+++ b/jdk/test/java/net/httpclient/TimeoutOrdering.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,9 @@
  * @run main/othervm TimeoutOrdering
  */
 
+// To enable logging use
+// @run main/othervm -Djdk.httpclient.HttpClient.log=all,frames:all TimeoutOrdering
+
 public class TimeoutOrdering {
 
     // The assumption is that 5 secs is sufficiently large enough, without being
@@ -81,6 +84,8 @@
                         if (t != null) {
                             if (!(t.getCause() instanceof HttpTimeoutException)) {
                                 out.println("Wrong exception type:" + t.toString());
+                                Throwable c = t.getCause() == null ? t : t.getCause();
+                                c.printStackTrace();
                                 error = true;
                             } else {
                                 out.println("Caught expected timeout: " + t.getCause());
@@ -116,6 +121,8 @@
                         out.println("Caught expected timeout: " + e);
                         queue.offer(req);
                     } catch (IOException | InterruptedException ee) {
+                        Throwable c = ee.getCause() == null ? ee : ee.getCause();
+                        c.printStackTrace();
                         error = true;
                     }
                 });
diff --git a/jdk/test/java/net/httpclient/http2/BasicTest.java b/jdk/test/java/net/httpclient/http2/BasicTest.java
index 730ed69..615843d 100644
--- a/jdk/test/java/net/httpclient/http2/BasicTest.java
+++ b/jdk/test/java/net/httpclient/http2/BasicTest.java
@@ -94,6 +94,7 @@
         } catch (Throwable tt) {
             System.err.println("tt caught");
             tt.printStackTrace();
+            throw tt;
         } finally {
             httpServer.stop();
             httpsServer.stop();
@@ -223,7 +224,7 @@
         CompletableFuture[] responses = new CompletableFuture[LOOPS];
         final Path source = TestUtil.getAFile(FILESIZE);
         HttpRequest request = HttpRequest.newBuilder(uri)
-                                         .POST(fromFile(tempFile()))
+                                         .POST(fromFile(source))
                                          .build();
         for (int i = 0; i < LOOPS; i++) {
             responses[i] = client.sendAsync(request, asFile(tempFile()))
diff --git a/jdk/test/java/net/httpclient/http2/FixedThreadPoolTest.java b/jdk/test/java/net/httpclient/http2/FixedThreadPoolTest.java
new file mode 100644
index 0000000..3967614
--- /dev/null
+++ b/jdk/test/java/net/httpclient/http2/FixedThreadPoolTest.java
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8087112
+ * @library /lib/testlibrary server
+ * @build jdk.testlibrary.SimpleSSLContext
+ * @modules jdk.incubator.httpclient/jdk.incubator.http.internal.common
+ *          jdk.incubator.httpclient/jdk.incubator.http.internal.frame
+ *          jdk.incubator.httpclient/jdk.incubator.http.internal.hpack
+ * @run testng/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors FixedThreadPoolTest
+ */
+
+import java.net.*;
+import jdk.incubator.http.*;
+import static jdk.incubator.http.HttpClient.Version.HTTP_2;
+import javax.net.ssl.*;
+import java.nio.file.*;
+import java.util.concurrent.*;
+import jdk.testlibrary.SimpleSSLContext;
+import static jdk.incubator.http.HttpRequest.BodyProcessor.fromFile;
+import static jdk.incubator.http.HttpRequest.BodyProcessor.fromString;
+import static jdk.incubator.http.HttpResponse.BodyHandler.asFile;
+import static jdk.incubator.http.HttpResponse.BodyHandler.asString;
+
+import org.testng.annotations.Test;
+
+@Test
+public class FixedThreadPoolTest {
+    static int httpPort, httpsPort;
+    static Http2TestServer httpServer, httpsServer;
+    static HttpClient client = null;
+    static ExecutorService exec;
+    static SSLContext sslContext;
+
+    static String httpURIString, httpsURIString;
+
+    static void initialize() throws Exception {
+        try {
+            SimpleSSLContext sslct = new SimpleSSLContext();
+            sslContext = sslct.get();
+            client = getClient();
+            httpServer = new Http2TestServer(false, 0, exec, sslContext);
+            httpServer.addHandler(new EchoHandler(), "/");
+            httpPort = httpServer.getAddress().getPort();
+
+            httpsServer = new Http2TestServer(true, 0, exec, sslContext);
+            httpsServer.addHandler(new EchoHandler(), "/");
+
+            httpsPort = httpsServer.getAddress().getPort();
+            httpURIString = "http://127.0.0.1:" + httpPort + "/foo/";
+            httpsURIString = "https://127.0.0.1:" + httpsPort + "/bar/";
+
+            httpServer.start();
+            httpsServer.start();
+        } catch (Throwable e) {
+            System.err.println("Throwing now");
+            e.printStackTrace();
+            throw e;
+        }
+    }
+
+    @Test(timeOut=3000000)
+    public static void test() throws Exception {
+        try {
+            initialize();
+            simpleTest(false);
+            simpleTest(true);
+            streamTest(false);
+            streamTest(true);
+            paramsTest();
+            Thread.sleep(1000 * 4);
+        } catch (Exception | Error tt) {
+            tt.printStackTrace();
+            throw tt;
+        } finally {
+            httpServer.stop();
+            httpsServer.stop();
+            exec.shutdownNow();
+        }
+    }
+
+    static HttpClient getClient() {
+        if (client == null) {
+            exec = Executors.newCachedThreadPool();
+            client = HttpClient.newBuilder()
+                               .executor(Executors.newFixedThreadPool(2))
+                               .sslContext(sslContext)
+                               .version(HTTP_2)
+                               .build();
+        }
+        return client;
+    }
+
+    static URI getURI(boolean secure) {
+        if (secure)
+            return URI.create(httpsURIString);
+        else
+            return URI.create(httpURIString);
+    }
+
+    static void checkStatus(int expected, int found) throws Exception {
+        if (expected != found) {
+            System.err.printf ("Test failed: wrong status code %d/%d\n",
+                expected, found);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    static void checkStrings(String expected, String found) throws Exception {
+        if (!expected.equals(found)) {
+            System.err.printf ("Test failed: wrong string %s/%s\n",
+                expected, found);
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    static Void compareFiles(Path path1, Path path2) {
+        return TestUtil.compareFiles(path1, path2);
+    }
+
+    static Path tempFile() {
+        return TestUtil.tempFile();
+    }
+
+    static final String SIMPLE_STRING = "Hello world Goodbye world";
+
+    static final int LOOPS = 32;
+    static final int FILESIZE = 64 * 1024 + 200;
+
+    static void streamTest(boolean secure) throws Exception {
+        URI uri = getURI(secure);
+        System.err.printf("streamTest %b to %s\n" , secure, uri);
+
+        HttpClient client = getClient();
+        Path src = TestUtil.getAFile(FILESIZE * 4);
+        HttpRequest req = HttpRequest.newBuilder(uri)
+                                     .POST(fromFile(src))
+                                     .build();
+
+        Path dest = Paths.get("streamtest.txt");
+        dest.toFile().delete();
+        CompletableFuture<Path> response = client.sendAsync(req, asFile(dest))
+                .thenApply(resp -> {
+                    if (resp.statusCode() != 200)
+                        throw new RuntimeException();
+                    return resp.body();
+                });
+        response.join();
+        compareFiles(src, dest);
+        System.err.println("DONE");
+    }
+
+    static void paramsTest() throws Exception {
+        System.err.println("paramsTest");
+        Http2TestServer server = new Http2TestServer(true, 0, exec, sslContext);
+        server.addHandler((t -> {
+            SSLSession s = t.getSSLSession();
+            String prot = s.getProtocol();
+            if (prot.equals("TLSv1.2")) {
+                t.sendResponseHeaders(200, -1);
+            } else {
+                System.err.printf("Protocols =%s\n", prot);
+                t.sendResponseHeaders(500, -1);
+            }
+        }), "/");
+        server.start();
+        int port = server.getAddress().getPort();
+        URI u = new URI("https://127.0.0.1:"+port+"/foo");
+        HttpClient client = getClient();
+        HttpRequest req = HttpRequest.newBuilder(u).build();
+        HttpResponse<String> resp = client.sendAsync(req, asString()).get();
+        int stat = resp.statusCode();
+        if (stat != 200) {
+            throw new RuntimeException("paramsTest failed "
+                + Integer.toString(stat));
+        }
+    }
+
+    static void simpleTest(boolean secure) throws Exception {
+        URI uri = getURI(secure);
+        System.err.println("Request to " + uri);
+
+        // Do a simple warmup request
+
+        HttpClient client = getClient();
+        HttpRequest req = HttpRequest.newBuilder(uri)
+                                     .POST(fromString(SIMPLE_STRING))
+                                     .build();
+        HttpResponse<String> response = client.sendAsync(req, asString()).get();
+        HttpHeaders h = response.headers();
+
+        checkStatus(200, response.statusCode());
+
+        String responseBody = response.body();
+        checkStrings(SIMPLE_STRING, responseBody);
+
+        checkStrings(h.firstValue("x-hello").get(), "world");
+        checkStrings(h.firstValue("x-bye").get(), "universe");
+
+        // Do loops asynchronously
+
+        CompletableFuture[] responses = new CompletableFuture[LOOPS];
+        final Path source = TestUtil.getAFile(FILESIZE);
+        HttpRequest request = HttpRequest.newBuilder(uri)
+                                         .POST(fromFile(source))
+                                         .build();
+        for (int i = 0; i < LOOPS; i++) {
+            responses[i] = client.sendAsync(request, asFile(tempFile()))
+                //.thenApply(resp -> compareFiles(resp.body(), source));
+                .thenApply(resp -> {
+                    System.out.printf("Resp status %d body size %d\n",
+                                      resp.statusCode(), resp.body().toFile().length());
+                    return compareFiles(resp.body(), source);
+                });
+        }
+        CompletableFuture.allOf(responses).join();
+        System.err.println("DONE");
+    }
+}
diff --git a/jdk/test/java/net/httpclient/http2/server/Http2TestServerConnection.java b/jdk/test/java/net/httpclient/http2/server/Http2TestServerConnection.java
index a49f06d..f88f8da 100644
--- a/jdk/test/java/net/httpclient/http2/server/Http2TestServerConnection.java
+++ b/jdk/test/java/net/httpclient/http2/server/Http2TestServerConnection.java
@@ -392,9 +392,11 @@
         //System.err.println ("Stream window size = " + winsize);
 
         final InputStream bis;
-        if (endStreamReceived) {
+        if (endStreamReceived && queue.size() == 0) {
+            System.err.println("Server: got END_STREAM for stream " + streamid);
             bis = NullInputStream.INSTANCE;
         } else {
+            System.err.println("Server: creating input stream for stream " + streamid);
             bis = new BodyInputStream(queue, streamid, this);
         }
         try (bis;
diff --git a/jdk/test/java/net/httpclient/security/Driver.java b/jdk/test/java/net/httpclient/security/Driver.java
index 64b5608..5b58757 100644
--- a/jdk/test/java/net/httpclient/security/Driver.java
+++ b/jdk/test/java/net/httpclient/security/Driver.java
@@ -127,6 +127,7 @@
             cmd.add("-Dtest.src=" + testSrc);
             cmd.add("-Dtest.classes=" + testClasses);
             cmd.add("-Djava.security.manager");
+            cmd.add("--add-modules=jdk.incubator.httpclient");
             cmd.add("-Djava.security.policy=" + testSrc + sep + policy);
             cmd.add("-Dport.number=" + Integer.toString(Utils.getFreePort()));
             cmd.add("-Dport.number1=" + Integer.toString(Utils.getFreePort()));
diff --git a/jdk/test/java/net/httpclient/websocket/ConnectionHandover.java b/jdk/test/java/net/httpclient/websocket/ConnectionHandover.java
new file mode 100644
index 0000000..e89ce79
--- /dev/null
+++ b/jdk/test/java/net/httpclient/websocket/ConnectionHandover.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.incubator.http.HttpClient;
+import jdk.incubator.http.WebSocket;
+
+import java.io.IOException;
+import java.net.URI;
+
+/*
+ * @test
+ * @bug 8164625
+ * @summary Verifies HttpClient yields the connection to the WebSocket
+ * @run main/othervm -Djdk.httpclient.HttpClient.log=trace ConnectionHandover
+ */
+public class ConnectionHandover {
+
+    static {
+        LoggingHelper.setupLogging();
+    }
+
+    /*
+     * An I/O channel associated with the connection is closed by WebSocket.abort().
+     * If this connection is returned to the connection pool, then the second
+     * attempt to use it would fail with a ClosedChannelException.
+     *
+     * The assumption is that since the WebSocket client is connecting to the
+     * same URI, the pooled connection is to be used.
+     */
+    public static void main(String[] args) throws IOException {
+        try (DummyWebSocketServer server = new DummyWebSocketServer()) {
+            server.open();
+            URI uri = server.getURI();
+            WebSocket.Builder webSocketBuilder =
+                    HttpClient.newHttpClient().newWebSocketBuilder(uri, new WebSocket.Listener() { });
+
+            WebSocket ws1 = webSocketBuilder.buildAsync().join();
+            try {
+                ws1.abort();
+            } catch (IOException ignored) { }
+
+            WebSocket ws2 = webSocketBuilder.buildAsync().join(); // Exception here if the connection was pooled
+            try {
+                ws2.abort();
+            } catch (IOException ignored) { }
+        }
+    }
+}
diff --git a/jdk/test/java/net/httpclient/websocket/DummyWebSocketServer.java b/jdk/test/java/net/httpclient/websocket/DummyWebSocketServer.java
new file mode 100644
index 0000000..a76fc21
--- /dev/null
+++ b/jdk/test/java/net/httpclient/websocket/DummyWebSocketServer.java
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.net.InetSocketAddress;
+import java.net.URI;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.channels.ClosedByInterruptException;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+import java.nio.charset.CharacterCodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import static java.lang.String.format;
+import static java.lang.System.Logger.Level.ERROR;
+import static java.lang.System.Logger.Level.INFO;
+import static java.lang.System.Logger.Level.TRACE;
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
+import static java.util.Arrays.asList;
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Dummy WebSocket Server.
+ *
+ * Performs simpler version of the WebSocket Opening Handshake over HTTP (i.e.
+ * no proxying, cookies, etc.) Supports sequential connections, one at a time,
+ * i.e. in order for a client to connect to the server the previous client must
+ * disconnect first.
+ *
+ * Expected client request:
+ *
+ *     GET /chat HTTP/1.1
+ *     Host: server.example.com
+ *     Upgrade: websocket
+ *     Connection: Upgrade
+ *     Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
+ *     Origin: http://example.com
+ *     Sec-WebSocket-Protocol: chat, superchat
+ *     Sec-WebSocket-Version: 13
+ *
+ * This server response:
+ *
+ *     HTTP/1.1 101 Switching Protocols
+ *     Upgrade: websocket
+ *     Connection: Upgrade
+ *     Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
+ *     Sec-WebSocket-Protocol: chat
+ */
+public final class DummyWebSocketServer implements Closeable {
+
+    private final static System.Logger log = System.getLogger(DummyWebSocketServer.class.getName());
+    private final AtomicBoolean started = new AtomicBoolean();
+    private final Thread thread;
+    private volatile ServerSocketChannel ssc;
+    private volatile InetSocketAddress address;
+
+    public DummyWebSocketServer() {
+        this(defaultMapping());
+    }
+
+    public DummyWebSocketServer(Function<List<String>, List<String>> mapping) {
+        requireNonNull(mapping);
+        thread = new Thread(() -> {
+            try {
+                while (!Thread.currentThread().isInterrupted()) {
+                    log.log(INFO, "Accepting next connection at: " + ssc);
+                    SocketChannel channel = ssc.accept();
+                    log.log(INFO, "Accepted: " + channel);
+                    try {
+                        channel.configureBlocking(true);
+                        StringBuilder request = new StringBuilder();
+                        if (!readRequest(channel, request)) {
+                            throw new IOException("Bad request");
+                        }
+                        List<String> strings = asList(request.toString().split("\r\n"));
+                        List<String> response = mapping.apply(strings);
+                        writeResponse(channel, response);
+                        // Read until the thread is interrupted or an error occurred
+                        // or the input is shutdown
+                        ByteBuffer b = ByteBuffer.allocate(1024);
+                        while (channel.read(b) != -1) {
+                            b.clear();
+                        }
+                    } catch (IOException e) {
+                        log.log(TRACE, () -> "Error in connection: " + channel, e);
+                    } finally {
+                        log.log(INFO, "Closed: " + channel);
+                        close(channel);
+                    }
+                }
+            } catch (ClosedByInterruptException ignored) {
+            } catch (IOException e) {
+                log.log(ERROR, e);
+            } finally {
+                close(ssc);
+                log.log(INFO, "Stopped at: " + getURI());
+            }
+        });
+        thread.setName("DummyWebSocketServer");
+        thread.setDaemon(false);
+    }
+
+    public void open() throws IOException {
+        log.log(INFO, "Starting");
+        if (!started.compareAndSet(false, true)) {
+            throw new IllegalStateException("Already started");
+        }
+        ssc = ServerSocketChannel.open();
+        try {
+            ssc.configureBlocking(true);
+            ssc.bind(new InetSocketAddress("localhost", 0));
+            address = (InetSocketAddress) ssc.getLocalAddress();
+            thread.start();
+        } catch (IOException e) {
+            close(ssc);
+        }
+        log.log(INFO, "Started at: " + getURI());
+    }
+
+    @Override
+    public void close() {
+        log.log(INFO, "Stopping: " + getURI());
+        thread.interrupt();
+    }
+
+    URI getURI() {
+        if (!started.get()) {
+            throw new IllegalStateException("Not yet started");
+        }
+        return URI.create("ws://" + address.getHostName() + ":" + address.getPort());
+    }
+
+    private boolean readRequest(SocketChannel channel, StringBuilder request)
+            throws IOException
+    {
+        ByteBuffer buffer = ByteBuffer.allocate(512);
+        int num = channel.read(buffer);
+        if (num == -1) {
+            return false;
+        }
+        CharBuffer decoded;
+        buffer.flip();
+        try {
+            decoded = ISO_8859_1.newDecoder().decode(buffer);
+        } catch (CharacterCodingException e) {
+            throw new UncheckedIOException(e);
+        }
+        request.append(decoded);
+        return Pattern.compile("\r\n\r\n").matcher(request).find();
+    }
+
+    private void writeResponse(SocketChannel channel, List<String> response)
+            throws IOException
+    {
+        String s = response.stream().collect(Collectors.joining("\r\n"))
+                + "\r\n\r\n";
+        ByteBuffer encoded;
+        try {
+            encoded = ISO_8859_1.newEncoder().encode(CharBuffer.wrap(s));
+        } catch (CharacterCodingException e) {
+            throw new UncheckedIOException(e);
+        }
+        while (encoded.hasRemaining()) {
+            channel.write(encoded);
+        }
+    }
+
+    private static Function<List<String>, List<String>> defaultMapping() {
+        return request -> {
+            List<String> response = new LinkedList<>();
+            Iterator<String> iterator = request.iterator();
+            if (!iterator.hasNext()) {
+                throw new IllegalStateException("The request is empty");
+            }
+            if (!"GET / HTTP/1.1".equals(iterator.next())) {
+                throw new IllegalStateException
+                        ("Unexpected status line: " + request.get(0));
+            }
+            response.add("HTTP/1.1 101 Switching Protocols");
+            Map<String, String> requestHeaders = new HashMap<>();
+            while (iterator.hasNext()) {
+                String header = iterator.next();
+                String[] split = header.split(": ");
+                if (split.length != 2) {
+                    throw new IllegalStateException
+                            ("Unexpected header: " + header
+                                     + ", split=" + Arrays.toString(split));
+                }
+                if (requestHeaders.put(split[0], split[1]) != null) {
+                    throw new IllegalStateException
+                            ("Duplicating headers: " + Arrays.toString(split));
+                }
+            }
+            if (requestHeaders.containsKey("Sec-WebSocket-Protocol")) {
+                throw new IllegalStateException("Subprotocols are not expected");
+            }
+            if (requestHeaders.containsKey("Sec-WebSocket-Extensions")) {
+                throw new IllegalStateException("Extensions are not expected");
+            }
+            expectHeader(requestHeaders, "Connection", "Upgrade");
+            response.add("Connection: Upgrade");
+            expectHeader(requestHeaders, "Upgrade", "websocket");
+            response.add("Upgrade: websocket");
+            expectHeader(requestHeaders, "Sec-WebSocket-Version", "13");
+            String key = requestHeaders.get("Sec-WebSocket-Key");
+            if (key == null) {
+                throw new IllegalStateException("Sec-WebSocket-Key is missing");
+            }
+            MessageDigest sha1 = null;
+            try {
+                sha1 = MessageDigest.getInstance("SHA-1");
+            } catch (NoSuchAlgorithmException e) {
+                throw new InternalError(e);
+            }
+            String x = key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
+            sha1.update(x.getBytes(ISO_8859_1));
+            String v = Base64.getEncoder().encodeToString(sha1.digest());
+            response.add("Sec-WebSocket-Accept: " + v);
+            return response;
+        };
+    }
+
+    protected static String expectHeader(Map<String, String> headers,
+                                         String name,
+                                         String value) {
+        String v = headers.get(name);
+        if (!value.equals(v)) {
+            throw new IllegalStateException(
+                    format("Expected '%s: %s', actual: '%s: %s'",
+                           name, value, name, v)
+            );
+        }
+        return v;
+    }
+
+    private static void close(AutoCloseable... acs) {
+        for (AutoCloseable ac : acs) {
+            try {
+                ac.close();
+            } catch (Exception ignored) { }
+        }
+    }
+}
diff --git a/jdk/test/java/net/httpclient/websocket/LoggingHelper.java b/jdk/test/java/net/httpclient/websocket/LoggingHelper.java
new file mode 100644
index 0000000..026d8ad
--- /dev/null
+++ b/jdk/test/java/net/httpclient/websocket/LoggingHelper.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+
+public final class LoggingHelper {
+
+    /*
+     * I wish we had a support for java.util.logging in jtreg similar to what we
+     * have for security policy files:
+     *
+     *     @run main/othervm/jul=logging.properties ClassUnderTest
+     */
+    public static void setupLogging() {
+        String path = System.getProperty("test.src") + File.separator + "logging.properties";
+        System.setProperty("java.util.logging.config.file", path);
+    }
+}
diff --git a/jdk/test/java/net/httpclient/websocket/logging.properties b/jdk/test/java/net/httpclient/websocket/logging.properties
new file mode 100644
index 0000000..fb8a8db
--- /dev/null
+++ b/jdk/test/java/net/httpclient/websocket/logging.properties
@@ -0,0 +1,5 @@
+handlers=java.util.logging.ConsoleHandler
+.level=ALL
+java.util.logging.ConsoleHandler.level=ALL
+java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
+java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n
diff --git a/jdk/test/java/net/ipv6tests/B6521014.java b/jdk/test/java/net/ipv6tests/B6521014.java
index 4dbc928..5efa77d 100644
--- a/jdk/test/java/net/ipv6tests/B6521014.java
+++ b/jdk/test/java/net/ipv6tests/B6521014.java
@@ -25,13 +25,15 @@
  * @test
  * @bug 6521014 6543428
  * @summary IOException thrown when Socket tries to bind to an local IPv6 address on SuSE Linux
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.NetworkConfiguration
+ * @run main B6521014
  */
 
-
 import java.net.*;
 import java.io.*;
 import java.util.*;
-
+import jdk.testlibrary.NetworkConfiguration;
 
 /*
  *
@@ -52,38 +54,26 @@
  */
 public class B6521014 {
 
-    static InetAddress sin;
-
-    static Inet6Address getLocalAddr () throws Exception {
-        Enumeration e = NetworkInterface.getNetworkInterfaces();
-        while (e.hasMoreElements()) {
-            NetworkInterface ifc = (NetworkInterface) e.nextElement();
-            if (!ifc.isUp())
-                continue;
-            Enumeration addrs = ifc.getInetAddresses();
-            while (addrs.hasMoreElements()) {
-                InetAddress a = (InetAddress)addrs.nextElement();
-                if (a instanceof Inet6Address) {
-                    Inet6Address ia6 = (Inet6Address) a;
-                    if (ia6.isLinkLocalAddress()) {
-                        // remove %scope suffix
-                        return (Inet6Address)InetAddress.getByAddress(ia6.getAddress());
-                    }
-                }
-            }
+    static Inet6Address removeScope(Inet6Address addr) {
+        try {
+            return (Inet6Address)InetAddress.getByAddress(addr.getAddress());
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
         }
-        return null;
     }
 
-    static void test1() throws Exception {
-        ServerSocket ssock;
-        Socket sock;
-        int port;
+    static Optional<Inet6Address> getLocalAddr() throws Exception {
+        return NetworkConfiguration.probe()
+                .ip6Addresses()
+                .filter(Inet6Address::isLinkLocalAddress)
+                .map(B6521014::removeScope)
+                .findFirst();
+    }
 
-        ssock = new ServerSocket(0);
-        port = ssock.getLocalPort();
-        sock = new Socket();
-        try {
+    static void test1(Inet6Address sin) throws Exception {
+        try (ServerSocket ssock = new ServerSocket(0);
+             Socket sock = new Socket()) {
+            int port = ssock.getLocalPort();
             sock.connect(new InetSocketAddress(sin, port), 100);
         } catch (SocketTimeoutException e) {
             // time out exception is okay
@@ -91,36 +81,29 @@
         }
     }
 
-    static void test2() throws Exception {
-        Socket sock;
-        ServerSocket ssock;
-        int port;
-
-        ssock = new ServerSocket(0);
-        ssock.setSoTimeout(100);
-        port = ssock.getLocalPort();
-        sock = new Socket();
-        sock.bind(new InetSocketAddress(sin, 0));
-        try {
+    static void test2(Inet6Address sin) throws Exception {
+        try (ServerSocket ssock = new ServerSocket(0);
+             Socket sock = new Socket()) {
+            int port = ssock.getLocalPort();
+            ssock.setSoTimeout(100);
+            sock.bind(new InetSocketAddress(sin, 0));
             sock.connect(new InetSocketAddress(sin, port), 100);
-        } catch (SocketTimeoutException e) {
+        } catch (SocketTimeoutException expected) {
             // time out exception is okay
             System.out.println("timed out when connecting.");
         }
     }
 
     public static void main(String[] args) throws Exception {
-        sin = getLocalAddr();
-        if (sin == null) {
+        Optional<Inet6Address> oaddr = getLocalAddr();
+        if (!oaddr.isPresent()) {
             System.out.println("Cannot find a link-local address.");
             return;
         }
 
-        try {
-            test1();
-            test2();
-        } catch (IOException e) {
-            throw new RuntimeException("Test failed: cannot create socket.", e);
-        }
+        Inet6Address addr = oaddr.get();
+        System.out.println("Using " + addr);
+        test1(addr);
+        test2(addr);
     }
 }
diff --git a/jdk/test/java/net/ipv6tests/Tests.java b/jdk/test/java/net/ipv6tests/Tests.java
index 95a2024..d258b98 100644
--- a/jdk/test/java/net/ipv6tests/Tests.java
+++ b/jdk/test/java/net/ipv6tests/Tests.java
@@ -27,7 +27,10 @@
 
 public class Tests {
 
-    static boolean isWindows = System.getProperty("os.name").startsWith("Windows");
+    static final boolean isWindows =
+            System.getProperty("os.name").startsWith("Windows");
+    static final boolean isMacOS =
+            System.getProperty("os.name").contains("OS X");
 
     /**
      * performs a simple exchange of data between the two sockets
@@ -278,6 +281,8 @@
                         String dName = nic.getDisplayName();
                         if (dName != null && dName.contains("Teredo"))
                             continue;
+                    } else if (isMacOS && nic.getName().contains("awdl")) {
+                        continue;
                     }
                     try {
                         if (nic.isUp() && !nic.isLoopback())
diff --git a/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java b/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java
index b39ffd1..6d28773 100644
--- a/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java
+++ b/jdk/test/java/net/spi/URLStreamHandlerProvider/Basic.java
@@ -53,8 +53,7 @@
 /*
  * @test
  * @bug 8064924
- * @modules java.compiler
- *          jdk.compiler
+ * @modules jdk.compiler
  * @summary Basic test for URLStreamHandlerProvider
  * @library /lib/testlibrary
  * @build jdk.testlibrary.FileUtils jdk.testlibrary.JDKToolFinder
diff --git a/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java b/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java
index 8f6bf99..654697f 100644
--- a/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java
+++ b/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java
@@ -25,6 +25,7 @@
  * @bug 4460583 4470470 4840199 6419424 6710579 6596323 6824135 6395224 7142919
  *      8151582 8068693 8153209
  * @run main/othervm AsyncCloseAndInterrupt
+ * @key intermittent
  * @summary Comprehensive test of asynchronous closing and interruption
  * @author Mark Reinhold
  */
diff --git a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
index f98fca0..64861b4 100644
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,24 +23,27 @@
 
 /* @test
  * @bug 4607272 6842687 6878369 6944810 7023403
- * @summary Unit test for AsynchronousSocketChannel
+ * @summary Unit test for AsynchronousSocketChannel(use -Dseed=X to set PRNG seed)
+ * @library /lib/testlibrary/
+ * @build jdk.testlibrary.*
  * @run main Basic -skipSlowConnectTest
  * @key randomness intermittent
  */
 
-import java.nio.ByteBuffer;
-import java.nio.channels.*;
-import static java.net.StandardSocketOptions.*;
-import java.net.*;
-import java.util.Random;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
 import java.io.Closeable;
 import java.io.IOException;
+import java.net.*;
+import static java.net.StandardSocketOptions.*;
+import java.nio.ByteBuffer;
+import java.nio.channels.*;
+import java.util.Random;
 import java.util.Set;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+import jdk.testlibrary.RandomFactory;
 
 public class Basic {
-    static final Random rand = new Random();
+    private static final Random RAND = RandomFactory.getRandom();
 
     static boolean skipSlowConnectTest = false;
 
@@ -327,8 +330,10 @@
                 new AtomicReference<Throwable>();
 
             // write bytes to fill socket buffer
+            final AtomicInteger numCompleted = new AtomicInteger();
             ch.write(genBuffer(), ch, new CompletionHandler<Integer,AsynchronousSocketChannel>() {
                 public void completed(Integer result, AsynchronousSocketChannel ch) {
+                    numCompleted.incrementAndGet();
                     ch.write(genBuffer(), ch, this);
                 }
                 public void failed(Throwable x, AsynchronousSocketChannel ch) {
@@ -336,10 +341,21 @@
                 }
             });
 
-            // give time for socket buffer to fill up.
-            Thread.sleep(5*1000);
+            // give time for socket buffer to fill up -
+            // take pauses until the handler is no longer being invoked
+            // because all writes are being pended which guarantees that
+            // the internal channel state indicates it is writing
+            int prevNumCompleted = numCompleted.get();
+            do {
+                Thread.sleep(1000);
+                if (numCompleted.get() == prevNumCompleted) {
+                    break;
+                }
+                prevNumCompleted = numCompleted.get();
+            } while (true);
 
-            //  attempt a concurrent write - should fail with WritePendingException
+            // attempt a concurrent write -
+            // should fail with WritePendingException
             try {
                 ch.write(genBuffer());
                 throw new RuntimeException("WritePendingException expected");
@@ -497,12 +513,12 @@
             // trickle the writing
             do {
                 int rem = src.remaining();
-                int size = (rem <= 100) ? rem : 50 + rand.nextInt(rem - 100);
+                int size = (rem <= 100) ? rem : 50 + RAND.nextInt(rem - 100);
                 ByteBuffer buf = ByteBuffer.allocate(size);
                 for (int i=0; i<size; i++)
                     buf.put(src.get());
                 buf.flip();
-                Thread.sleep(50 + rand.nextInt(1500));
+                Thread.sleep(50 + RAND.nextInt(1500));
                 while (buf.hasRemaining())
                     sc.write(buf);
             } while (src.hasRemaining());
@@ -715,7 +731,7 @@
     }
 
     static void testShutdown() throws Exception {
-        System.out.println("-- shutdown--");
+        System.out.println("-- shutdown --");
 
         try (Server server = new Server();
              AsynchronousSocketChannel ch = AsynchronousSocketChannel.open())
@@ -759,6 +775,7 @@
     }
 
     static void testTimeout(final long timeout, final TimeUnit unit) throws Exception {
+        System.out.printf("---- timeout: %d ms%n", unit.toMillis(timeout));
         try (Server server = new Server()) {
             AsynchronousSocketChannel ch = AsynchronousSocketChannel.open();
             ch.connect(server.address()).get();
@@ -847,10 +864,10 @@
 
     // returns ByteBuffer with random bytes
     static ByteBuffer genBuffer() {
-        int size = 1024 + rand.nextInt(16000);
+        int size = 1024 + RAND.nextInt(16000);
         byte[] buf = new byte[size];
-        rand.nextBytes(buf);
-        boolean useDirect = rand.nextBoolean();
+        RAND.nextBytes(buf);
+        boolean useDirect = RAND.nextBoolean();
         if (useDirect) {
             ByteBuffer bb = ByteBuffer.allocateDirect(buf.length);
             bb.put(buf);
@@ -865,7 +882,7 @@
     static ByteBuffer[] genBuffers(int max) {
         int len = 1;
         if (max > 1)
-            len += rand.nextInt(max);
+            len += RAND.nextInt(max);
         ByteBuffer[] bufs = new ByteBuffer[len];
         for (int i=0; i<len; i++)
             bufs[i] = genBuffer();
@@ -875,17 +892,17 @@
     // return random SocketAddress
     static SocketAddress genSocketAddress() {
         StringBuilder sb = new StringBuilder("10.");
-        sb.append(rand.nextInt(256));
+        sb.append(RAND.nextInt(256));
         sb.append('.');
-        sb.append(rand.nextInt(256));
+        sb.append(RAND.nextInt(256));
         sb.append('.');
-        sb.append(rand.nextInt(256));
+        sb.append(RAND.nextInt(256));
         InetAddress rh;
         try {
             rh = InetAddress.getByName(sb.toString());
         } catch (UnknownHostException x) {
             throw new InternalError("Should not happen");
         }
-        return new InetSocketAddress(rh, rand.nextInt(65535)+1);
+        return new InetSocketAddress(rh, RAND.nextInt(65535)+1);
     }
 }
diff --git a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java
index 776542b..c326af5 100644
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Leaky.java
@@ -24,6 +24,7 @@
 /* @test
  * @bug 4607272 6999915 7185340
  * @summary Unit test for AsynchronousSocketChannel
+ * @modules java.management
  * @run main/othervm -XX:+DisableExplicitGC -XX:MaxDirectMemorySize=75m Leaky
  */
 
diff --git a/jdk/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java b/jdk/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java
index 6bb5c94..74aca29 100644
--- a/jdk/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java
+++ b/jdk/test/java/nio/channels/DatagramChannel/NetworkConfiguration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,22 +57,11 @@
         return ip6Interfaces.get(nif);
     }
 
-    // IPv6 not supported for Windows XP/Server 2003
-    static boolean isIPv6Supported() {
-        if (System.getProperty("os.name").startsWith("Windows")) {
-            String ver = System.getProperty("os.version");
-            int major = Integer.parseInt(ver.split("\\.")[0]);
-            return (major >= 6);
-        }
-        return true;
-    }
-
     static NetworkConfiguration probe() throws IOException {
         Map<NetworkInterface,List<InetAddress>> ip4Interfaces =
             new HashMap<NetworkInterface,List<InetAddress>>();
         Map<NetworkInterface,List<InetAddress>> ip6Interfaces =
             new HashMap<NetworkInterface,List<InetAddress>>();
-        boolean isIPv6Supported = isIPv6Supported();
 
         // find the interfaces that support IPv4 and IPv6
         List<NetworkInterface> nifs = Collections
@@ -92,7 +81,7 @@
                         }
                         list.add(addr);
                         ip4Interfaces.put(nif, list);
-                    } else if (isIPv6Supported && (addr instanceof Inet6Address)) {
+                    } else if (addr instanceof Inet6Address) {
                         List<InetAddress> list = ip6Interfaces.get(nif);
                         if (list == null) {
                             list = new LinkedList<InetAddress>();
diff --git a/jdk/test/java/nio/channels/FileChannel/InterruptDeadlock.java b/jdk/test/java/nio/channels/FileChannel/InterruptDeadlock.java
index 102d7db..b3b361f 100644
--- a/jdk/test/java/nio/channels/FileChannel/InterruptDeadlock.java
+++ b/jdk/test/java/nio/channels/FileChannel/InterruptDeadlock.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
                     if (n > 0)
                         pos += n;
                     // fc.size is important here as it is position sensitive
-                    if (pos > fc.size())
+                    if (pos >= fc.size())
                         pos = 0L;
                 }
             } catch (ClosedChannelException x) {
diff --git a/jdk/test/java/nio/channels/FileChannel/LoopingTruncate.java b/jdk/test/java/nio/channels/FileChannel/LoopingTruncate.java
index f81712c..a0cebab 100644
--- a/jdk/test/java/nio/channels/FileChannel/LoopingTruncate.java
+++ b/jdk/test/java/nio/channels/FileChannel/LoopingTruncate.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,11 @@
 /**
  * @test
  * @bug 8137121 8137230
+ * @key intermittent
  * @summary (fc) Infinite loop FileChannel.truncate
  * @library /lib/testlibrary
  * @build jdk.testlibrary.Utils
- * @run main/othervm LoopingTruncate
+ * @run main/othervm/timeout=300 LoopingTruncate
  */
 
 import java.nio.ByteBuffer;
@@ -36,6 +37,7 @@
 import java.nio.file.Files;
 import java.nio.file.Path;
 import static java.nio.file.StandardOpenOption.*;
+import java.util.concurrent.TimeUnit;
 import static jdk.testlibrary.Utils.adjustTimeout;
 
 public class LoopingTruncate {
@@ -50,11 +52,21 @@
         Path path = Files.createTempFile("LoopingTruncate.tmp", null);
         try (FileChannel fc = FileChannel.open(path, CREATE, WRITE)) {
             fc.position(FATEFUL_SIZE + 1L);
+            System.out.println("  Writing large file...");
+            long t0 = System.nanoTime();
             fc.write(ByteBuffer.wrap(new byte[] {0}));
+            long t1 = System.nanoTime();
+            System.out.printf("  Wrote large file in %d ns (%d ms) %n",
+                t1 - t0, TimeUnit.NANOSECONDS.toMillis(t1 - t0));
 
             Thread th = new Thread(() -> {
                 try {
+                    System.out.println("  Truncating large file...");
+                    long t2 = System.nanoTime();
                     fc.truncate(FATEFUL_SIZE);
+                    long t3 = System.nanoTime();
+                    System.out.printf("  Truncated large file in %d ns (%d ms) %n",
+                        t3 - t2, TimeUnit.NANOSECONDS.toMillis(t3 - t2));
                 } catch (ClosedByInterruptException ignore) {
                 } catch (Exception e) {
                     throw new RuntimeException(e);
@@ -76,5 +88,8 @@
         } finally {
             Files.deleteIfExists(path);
         }
+
+        System.out.println("Test succeeded.");
+        System.out.flush();
     }
 }
diff --git a/jdk/test/java/nio/channels/FileChannel/Transfer.java b/jdk/test/java/nio/channels/FileChannel/Transfer.java
index 04a0f32..c36e7cf 100644
--- a/jdk/test/java/nio/channels/FileChannel/Transfer.java
+++ b/jdk/test/java/nio/channels/FileChannel/Transfer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,45 +22,46 @@
  */
 
 /* @test
- * @bug 4434723 4482726 4559072 4638365 4795550 5081340 5103988 6253145
- *   6984545
- * @summary Test FileChannel.transferFrom and transferTo
+ * @bug 4434723 4482726 4559072 4795550 5081340 5103988 6984545
+ * @key intermittent
+ * @summary Test FileChannel.transferFrom and transferTo (use -Dseed=X to set PRNG seed)
  * @library ..
+ * @library /lib/testlibrary/
+ * @build jdk.testlibrary.*
+ * @run testng/timeout=300 Transfer
  * @key randomness
  */
 
-import java.io.*;
-import java.net.*;
-import java.nio.*;
-import java.nio.channels.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.io.Reader;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.NonReadableChannelException;
+import java.nio.channels.Pipe;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
 import java.nio.channels.spi.SelectorProvider;
-import java.nio.file.StandardOpenOption;
-import java.nio.file.FileAlreadyExistsException;
 import java.util.Random;
+import java.util.concurrent.TimeUnit;
 
+import jdk.testlibrary.RandomFactory;
+
+import org.testng.annotations.Test;
 
 public class Transfer {
 
-    private static Random generator = new Random();
+    private static Random generator = RandomFactory.getRandom();
 
-    private static int[] testSizes = {
-        0, 10, 1023, 1024, 1025, 2047, 2048, 2049 };
-
-    public static void main(String[] args) throws Exception {
-        testFileChannel();
-        for (int i=0; i<testSizes.length; i++)
-            testReadableByteChannel(testSizes[i]);
-        xferTest02(); // for bug 4482726
-        xferTest03(); // for bug 4559072
-        xferTest04(); // for bug 4638365
-        xferTest05(); // for bug 4638365
-        xferTest06(); // for bug 5081340
-        xferTest07(); // for bug 5103988
-        xferTest08(); // for bug 6253145
-        xferTest09(); // for bug 6984545
-    }
-
-    private static void testFileChannel() throws Exception {
+    @Test
+    public void testFileChannel() throws Exception {
         File source = File.createTempFile("source", null);
         source.deleteOnExit();
         File sink = File.createTempFile("sink", null);
@@ -105,52 +106,58 @@
         sink.delete();
     }
 
-    private static void testReadableByteChannel(int size) throws Exception {
-        SelectorProvider sp = SelectorProvider.provider();
-        Pipe p = sp.openPipe();
-        Pipe.SinkChannel sink = p.sink();
-        Pipe.SourceChannel source = p.source();
-        sink.configureBlocking(false);
+    @Test
+    public void testReadableByteChannel() throws Exception {
+        int[] testSizes = { 0, 10, 1023, 1024, 1025, 2047, 2048, 2049 };
 
-        ByteBuffer outgoingdata = ByteBuffer.allocateDirect(size + 10);
-        byte[] someBytes = new byte[size + 10];
-        generator.nextBytes(someBytes);
-        outgoingdata.put(someBytes);
-        outgoingdata.flip();
+        for (int size : testSizes) {
+            SelectorProvider sp = SelectorProvider.provider();
+            Pipe p = sp.openPipe();
+            Pipe.SinkChannel sink = p.sink();
+            Pipe.SourceChannel source = p.source();
+            sink.configureBlocking(false);
 
-        int totalWritten = 0;
-        while (totalWritten < size + 10) {
-            int written = sink.write(outgoingdata);
-            if (written < 0)
-                throw new Exception("Write failed");
-            totalWritten += written;
+            ByteBuffer outgoingdata = ByteBuffer.allocateDirect(size + 10);
+            byte[] someBytes = new byte[size + 10];
+            generator.nextBytes(someBytes);
+            outgoingdata.put(someBytes);
+            outgoingdata.flip();
+
+            int totalWritten = 0;
+            while (totalWritten < size + 10) {
+                int written = sink.write(outgoingdata);
+                if (written < 0)
+                    throw new Exception("Write failed");
+                totalWritten += written;
+            }
+
+            File f = File.createTempFile("blah"+size, null);
+            f.deleteOnExit();
+            RandomAccessFile raf = new RandomAccessFile(f, "rw");
+            FileChannel fc = raf.getChannel();
+            long oldPosition = fc.position();
+
+            long bytesWritten = fc.transferFrom(source, 0, size);
+            fc.force(true);
+            if (bytesWritten != size)
+                throw new RuntimeException("Transfer failed");
+
+            if (fc.position() != oldPosition)
+                throw new RuntimeException("Position changed");
+
+            if (fc.size() != size)
+                throw new RuntimeException("Unexpected sink size "+ fc.size());
+
+            fc.close();
+            sink.close();
+            source.close();
+
+            f.delete();
         }
-
-        File f = File.createTempFile("blah"+size, null);
-        f.deleteOnExit();
-        RandomAccessFile raf = new RandomAccessFile(f, "rw");
-        FileChannel fc = raf.getChannel();
-        long oldPosition = fc.position();
-
-        long bytesWritten = fc.transferFrom(source, 0, size);
-        fc.force(true);
-        if (bytesWritten != size)
-            throw new RuntimeException("Transfer failed");
-
-        if (fc.position() != oldPosition)
-            throw new RuntimeException("Position changed");
-
-        if (fc.size() != size)
-            throw new RuntimeException("Unexpected sink size "+ fc.size());
-
-        fc.close();
-        sink.close();
-        source.close();
-
-        f.delete();
     }
 
-    public static void xferTest02() throws Exception {
+    @Test
+    public void xferTest02() throws Exception { // for bug 4482726
         byte[] srcData = new byte[5000];
         for (int i=0; i<5000; i++)
             srcData[i] = (byte)generator.nextInt();
@@ -187,7 +194,8 @@
         dest.delete();
     }
 
-    public static void xferTest03() throws Exception {
+    @Test
+    public void xferTest03() throws Exception { // for bug 4559072
         byte[] srcData = new byte[] {1,2,3,4} ;
 
         // get filechannel for the source file.
@@ -224,103 +232,7 @@
         dest.delete();
     }
 
-    // Test transferTo with large file
-    public static void xferTest04() throws Exception {
-        // Windows and Linux can't handle the really large file sizes for a
-        // truncate or a positional write required by the test for 4563125
-        String osName = System.getProperty("os.name");
-        if (!(osName.startsWith("SunOS") || osName.contains("OS X")))
-            return;
-        File source = File.createTempFile("blah", null);
-        source.deleteOnExit();
-        long testSize = ((long)Integer.MAX_VALUE) * 2;
-        initTestFile(source, 10);
-        RandomAccessFile raf = new RandomAccessFile(source, "rw");
-        FileChannel fc = raf.getChannel();
-        fc.write(ByteBuffer.wrap("Use the source!".getBytes()), testSize - 40);
-        fc.close();
-        raf.close();
-
-        File sink = File.createTempFile("sink", null);
-        sink.deleteOnExit();
-
-        FileInputStream fis = new FileInputStream(source);
-        FileChannel sourceChannel = fis.getChannel();
-
-        raf = new RandomAccessFile(sink, "rw");
-        FileChannel sinkChannel = raf.getChannel();
-
-        long bytesWritten = sourceChannel.transferTo(testSize -40, 10,
-                                                     sinkChannel);
-        if (bytesWritten != 10) {
-            throw new RuntimeException("Transfer test 4 failed " +
-                                       bytesWritten);
-        }
-        sourceChannel.close();
-        sinkChannel.close();
-
-        source.delete();
-        sink.delete();
-    }
-
-    // Test transferFrom with large file
-    public static void xferTest05() throws Exception {
-        // Create a source file & large sink file for the test
-        File source = File.createTempFile("blech", null);
-        source.deleteOnExit();
-        initTestFile(source, 100);
-
-        // Create the sink file as a sparse file if possible
-        File sink = null;
-        FileChannel fc = null;
-        while (fc == null) {
-            sink = File.createTempFile("sink", null);
-            // re-create as a sparse file
-            sink.delete();
-            try {
-                fc = FileChannel.open(sink.toPath(),
-                                      StandardOpenOption.CREATE_NEW,
-                                      StandardOpenOption.WRITE,
-                                      StandardOpenOption.SPARSE);
-            } catch (FileAlreadyExistsException ignore) {
-                // someone else got it
-            }
-        }
-        sink.deleteOnExit();
-
-        long testSize = ((long)Integer.MAX_VALUE) * 2;
-        try {
-            fc.write(ByteBuffer.wrap("Use the source!".getBytes()),
-                     testSize - 40);
-        } catch (IOException e) {
-            // Can't set up the test, abort it
-            System.err.println("xferTest05 was aborted.");
-            return;
-        } finally {
-            fc.close();
-        }
-
-        // Get new channels for the source and sink and attempt transfer
-        FileChannel sourceChannel = new FileInputStream(source).getChannel();
-        try {
-            FileChannel sinkChannel = new RandomAccessFile(sink, "rw").getChannel();
-            try {
-                long bytesWritten = sinkChannel.transferFrom(sourceChannel,
-                                                             testSize - 40, 10);
-                if (bytesWritten != 10) {
-                    throw new RuntimeException("Transfer test 5 failed " +
-                                               bytesWritten);
-                }
-            } finally {
-                sinkChannel.close();
-            }
-        } finally {
-            sourceChannel.close();
-        }
-
-        source.delete();
-        sink.delete();
-    }
+    // xferTest04() and xferTest05() moved to Transfer4GBFile.java
 
     static void checkFileData(File file, String expected) throws Exception {
         FileInputStream fis = new FileInputStream(file);
@@ -337,7 +249,8 @@
     }
 
     // Test transferFrom asking for more bytes than remain in source
-    public static void xferTest06() throws Exception {
+    @Test
+    public void xferTest06() throws Exception { // for bug 5081340
         String data = "Use the source, Luke!";
 
         File source = File.createTempFile("source", null);
@@ -370,7 +283,8 @@
     }
 
     // Test transferTo to non-blocking socket channel
-    public static void xferTest07() throws Exception {
+    @Test
+    public void xferTest07() throws Exception { // for bug 5103988
         File source = File.createTempFile("source", null);
         source.deleteOnExit();
 
@@ -403,113 +317,12 @@
         source.delete();
     }
 
-
-    // Test transferTo with file positions larger than 2 and 4GB
-    public static void xferTest08() throws Exception {
-        // Creating a sparse 6GB file on Windows takes too long
-        String osName = System.getProperty("os.name");
-        if (osName.startsWith("Windows"))
-            return;
-
-        final long G = 1024L * 1024L * 1024L;
-
-        // Create 6GB file
-
-        File file = File.createTempFile("source", null);
-        file.deleteOnExit();
-
-        RandomAccessFile raf = new RandomAccessFile(file, "rw");
-        FileChannel fc = raf.getChannel();
-
-        try {
-            fc.write(ByteBuffer.wrap("0123456789012345".getBytes("UTF-8")), 6*G);
-        } catch (IOException x) {
-            System.err.println("Unable to create test file:" + x);
-            fc.close();
-            return;
-        }
-
-        // Setup looback connection and echo server
-
-        ServerSocketChannel ssc = ServerSocketChannel.open();
-        ssc.socket().bind(new InetSocketAddress(0));
-
-        InetAddress lh = InetAddress.getLocalHost();
-        InetSocketAddress isa = new InetSocketAddress(lh, ssc.socket().getLocalPort());
-        SocketChannel source = SocketChannel.open(isa);
-        SocketChannel sink = ssc.accept();
-
-        Thread thr = new Thread(new EchoServer(sink));
-        thr.start();
-
-        // Test data is array of positions and counts
-
-        long testdata[][] = {
-            { 2*G-1,    1 },
-            { 2*G-1,    10 },       // across 2GB boundary
-            { 2*G,      1 },
-            { 2*G,      10 },
-            { 2*G+1,    1 },
-            { 4*G-1,    1 },
-            { 4*G-1,    10 },       // across 4GB boundary
-            { 4*G,      1 },
-            { 4*G,      10 },
-            { 4*G+1,    1 },
-            { 5*G-1,    1 },
-            { 5*G-1,    10 },
-            { 5*G,      1 },
-            { 5*G,      10 },
-            { 5*G+1,    1 },
-            { 6*G,      1 },
-        };
-
-        ByteBuffer sendbuf = ByteBuffer.allocateDirect(100);
-        ByteBuffer readbuf = ByteBuffer.allocateDirect(100);
-
-        try {
-            byte value = 0;
-            for (int i=0; i<testdata.length; i++) {
-                long position = testdata[(int)i][0];
-                long count = testdata[(int)i][1];
-
-                // generate bytes
-                for (long j=0; j<count; j++) {
-                    sendbuf.put(++value);
-                }
-                sendbuf.flip();
-
-                // write to file and transfer to echo server
-                fc.write(sendbuf, position);
-                fc.transferTo(position, count, source);
-
-                // read from echo server
-                long nread = 0;
-                while (nread < count) {
-                    int n = source.read(readbuf);
-                    if (n < 0)
-                        throw new RuntimeException("Premature EOF!");
-                    nread += n;
-                }
-
-                // check reply from echo server
-                readbuf.flip();
-                sendbuf.flip();
-                if (!readbuf.equals(sendbuf))
-                    throw new RuntimeException("Echo'ed bytes do not match!");
-                readbuf.clear();
-                sendbuf.clear();
-            }
-        } finally {
-            source.close();
-            ssc.close();
-            fc.close();
-            file.delete();
-        }
-    }
+    // xferTest08() moved to TransferTo6GBFile.java
 
     // Test that transferFrom with FileChannel source that is not readable
     // throws NonReadableChannelException
-    static void xferTest09() throws Exception {
+    @Test
+    public void xferTest09() throws Exception { // for bug 6984545
         File source = File.createTempFile("source", null);
         source.deleteOnExit();
 
@@ -527,56 +340,4 @@
             fc2.close();
         }
     }
-
-    /**
-     * Creates file blah of specified size in bytes.
-     */
-    private static void initTestFile(File blah, long size) throws Exception {
-        if (blah.exists())
-            blah.delete();
-        FileOutputStream fos = new FileOutputStream(blah);
-        BufferedWriter awriter
-            = new BufferedWriter(new OutputStreamWriter(fos, "8859_1"));
-
-        for(int i=0; i<size; i++) {
-            awriter.write("e");
-        }
-        awriter.flush();
-        awriter.close();
-    }
-
-    /**
-     * Simple in-process server to echo bytes read by a given socket channel
-     */
-    static class EchoServer implements Runnable {
-        private SocketChannel sc;
-
-        public EchoServer(SocketChannel sc) {
-            this.sc = sc;
-        }
-
-        public void run() {
-            ByteBuffer bb = ByteBuffer.allocateDirect(1024);
-            try {
-                for (;;) {
-                    int n = sc.read(bb);
-                    if (n < 0)
-                        break;
-
-                    bb.flip();
-                    while (bb.remaining() > 0) {
-                        sc.write(bb);
-                    }
-                    bb.clear();
-                }
-            } catch (IOException x) {
-                x.printStackTrace();
-            } finally {
-                try {
-                    sc.close();
-                } catch (IOException ignore) { }
-            }
-        }
-    }
-
 }
diff --git a/jdk/test/java/nio/channels/FileChannel/Transfer4GBFile.java b/jdk/test/java/nio/channels/FileChannel/Transfer4GBFile.java
new file mode 100644
index 0000000..22240e7
--- /dev/null
+++ b/jdk/test/java/nio/channels/FileChannel/Transfer4GBFile.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 4638365
+ * @key intermittent
+ * @summary Test FileChannel.transferFrom and transferTo for 4GB files
+ * @run testng/timeout=300 Transfer4GBFile
+ */
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.io.RandomAccessFile;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.file.StandardOpenOption;
+import java.nio.file.FileAlreadyExistsException;
+import java.util.concurrent.TimeUnit;
+
+import org.testng.annotations.Test;
+
+public class Transfer4GBFile {
+
+    private static PrintStream err = System.err;
+    private static PrintStream out = System.out;
+
+    // Test transferTo with large file
+    @Test
+    public void xferTest04() throws Exception { // for bug 4638365
+        File source = File.createTempFile("blah", null);
+        source.deleteOnExit();
+        long testSize = ((long)Integer.MAX_VALUE) * 2;
+        initTestFile(source, 10);
+        RandomAccessFile raf = new RandomAccessFile(source, "rw");
+        FileChannel fc = raf.getChannel();
+        out.println("  Writing large file...");
+        long t0 = System.nanoTime();
+        fc.write(ByteBuffer.wrap("Use the source!".getBytes()), testSize - 40);
+        long t1 = System.nanoTime();
+        out.printf("  Wrote large file in %d ns (%d ms) %n",
+            t1 - t0, TimeUnit.NANOSECONDS.toMillis(t1 - t0));
+
+        fc.close();
+        raf.close();
+
+        File sink = File.createTempFile("sink", null);
+        sink.deleteOnExit();
+
+        FileInputStream fis = new FileInputStream(source);
+        FileChannel sourceChannel = fis.getChannel();
+
+        raf = new RandomAccessFile(sink, "rw");
+        FileChannel sinkChannel = raf.getChannel();
+
+        long bytesWritten = sourceChannel.transferTo(testSize -40, 10,
+                                                     sinkChannel);
+        if (bytesWritten != 10) {
+            throw new RuntimeException("Transfer test 4 failed " +
+                                       bytesWritten);
+        }
+        sourceChannel.close();
+        sinkChannel.close();
+
+        source.delete();
+        sink.delete();
+    }
+
+    // Test transferFrom with large file
+    @Test
+    public void xferTest05() throws Exception { // for bug 4638365
+        // Create a source file & large sink file for the test
+        File source = File.createTempFile("blech", null);
+        source.deleteOnExit();
+        initTestFile(source, 100);
+
+        // Create the sink file as a sparse file if possible
+        File sink = null;
+        FileChannel fc = null;
+        while (fc == null) {
+            sink = File.createTempFile("sink", null);
+            // re-create as a sparse file
+            sink.delete();
+            try {
+                fc = FileChannel.open(sink.toPath(),
+                                      StandardOpenOption.CREATE_NEW,
+                                      StandardOpenOption.WRITE,
+                                      StandardOpenOption.SPARSE);
+            } catch (FileAlreadyExistsException ignore) {
+                // someone else got it
+            }
+        }
+        sink.deleteOnExit();
+
+        long testSize = ((long)Integer.MAX_VALUE) * 2;
+        try {
+            out.println("  Writing large file...");
+            long t0 = System.nanoTime();
+            fc.write(ByteBuffer.wrap("Use the source!".getBytes()),
+                     testSize - 40);
+            long t1 = System.nanoTime();
+            out.printf("  Wrote large file in %d ns (%d ms) %n",
+            t1 - t0, TimeUnit.NANOSECONDS.toMillis(t1 - t0));
+        } catch (IOException e) {
+            // Can't set up the test, abort it
+            err.println("xferTest05 was aborted.");
+            return;
+        } finally {
+            fc.close();
+        }
+
+        // Get new channels for the source and sink and attempt transfer
+        FileChannel sourceChannel = new FileInputStream(source).getChannel();
+        try {
+            FileChannel sinkChannel = new RandomAccessFile(sink, "rw").getChannel();
+            try {
+                long bytesWritten = sinkChannel.transferFrom(sourceChannel,
+                                                             testSize - 40, 10);
+                if (bytesWritten != 10) {
+                    throw new RuntimeException("Transfer test 5 failed " +
+                                               bytesWritten);
+                }
+            } finally {
+                sinkChannel.close();
+            }
+        } finally {
+            sourceChannel.close();
+        }
+
+        source.delete();
+        sink.delete();
+    }
+
+    /**
+     * Creates file blah of specified size in bytes.
+     */
+    private static void initTestFile(File blah, long size) throws Exception {
+        if (blah.exists())
+            blah.delete();
+        FileOutputStream fos = new FileOutputStream(blah);
+        BufferedWriter awriter
+            = new BufferedWriter(new OutputStreamWriter(fos, "8859_1"));
+
+        for(int i=0; i<size; i++) {
+            awriter.write("e");
+        }
+        awriter.flush();
+        awriter.close();
+    }
+}
diff --git a/jdk/test/java/nio/channels/FileChannel/TransferTo6GBFile.java b/jdk/test/java/nio/channels/FileChannel/TransferTo6GBFile.java
new file mode 100644
index 0000000..2365351
--- /dev/null
+++ b/jdk/test/java/nio/channels/FileChannel/TransferTo6GBFile.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 6253145
+ * @key intermittent
+ * @summary Test FileChannel.transferTo with file positions up to 8GB
+ * @run testng/timeout=300 TransferTo6GBFile
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.RandomAccessFile;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+import java.util.concurrent.TimeUnit;
+
+import org.testng.annotations.Test;
+
+public class TransferTo6GBFile {
+
+    private static PrintStream err = System.err;
+    private static PrintStream out = System.out;
+
+    // Test transferTo with file positions larger than 2 and 4GB
+    @Test
+    public void xferTest08() throws Exception { // for bug 6253145
+        final long G = 1024L * 1024L * 1024L;
+
+        // Create 6GB file
+
+        File file = File.createTempFile("source", null);
+        file.deleteOnExit();
+
+        RandomAccessFile raf = new RandomAccessFile(file, "rw");
+        FileChannel fc = raf.getChannel();
+
+        out.println("  Writing large file...");
+        long t0 = System.nanoTime();
+        try {
+            fc.write(ByteBuffer.wrap("0123456789012345".getBytes("UTF-8")), 6*G);
+            long t1 = System.nanoTime();
+            out.printf("  Wrote large file in %d ns (%d ms) %n",
+            t1 - t0, TimeUnit.NANOSECONDS.toMillis(t1 - t0));
+        } catch (IOException x) {
+            err.println("  Unable to create test file:" + x);
+            fc.close();
+            return;
+        }
+
+        // Setup looback connection and echo server
+
+        ServerSocketChannel ssc = ServerSocketChannel.open();
+        ssc.socket().bind(new InetSocketAddress(0));
+
+        InetAddress lh = InetAddress.getLocalHost();
+        InetSocketAddress isa = new InetSocketAddress(lh, ssc.socket().getLocalPort());
+        SocketChannel source = SocketChannel.open(isa);
+        SocketChannel sink = ssc.accept();
+
+        Thread thr = new Thread(new EchoServer(sink));
+        thr.start();
+
+        // Test data is array of positions and counts
+
+        long testdata[][] = {
+            { 2*G-1,    1 },
+            { 2*G-1,    10 },       // across 2GB boundary
+            { 2*G,      1 },
+            { 2*G,      10 },
+            { 2*G+1,    1 },
+            { 4*G-1,    1 },
+            { 4*G-1,    10 },       // across 4GB boundary
+            { 4*G,      1 },
+            { 4*G,      10 },
+            { 4*G+1,    1 },
+            { 5*G-1,    1 },
+            { 5*G-1,    10 },
+            { 5*G,      1 },
+            { 5*G,      10 },
+            { 5*G+1,    1 },
+            { 6*G,      1 },
+        };
+
+        ByteBuffer sendbuf = ByteBuffer.allocateDirect(100);
+        ByteBuffer readbuf = ByteBuffer.allocateDirect(100);
+
+        try {
+            byte value = 0;
+            for (int i=0; i<testdata.length; i++) {
+                long position = testdata[(int)i][0];
+                long count = testdata[(int)i][1];
+
+                // generate bytes
+                for (long j=0; j<count; j++) {
+                    sendbuf.put(++value);
+                }
+                sendbuf.flip();
+
+                // write to file and transfer to echo server
+                fc.write(sendbuf, position);
+                t0 = System.nanoTime();
+                fc.transferTo(position, count, source);
+                out.printf("  transferTo(%d, %2d, source): %d ns%n",
+                    position, count, System.nanoTime() - t0);
+
+                // read from echo server
+                long nread = 0;
+                while (nread < count) {
+                    int n = source.read(readbuf);
+                    if (n < 0)
+                        throw new RuntimeException("Premature EOF!");
+                    nread += n;
+                }
+
+                // check reply from echo server
+                readbuf.flip();
+                sendbuf.flip();
+                if (!readbuf.equals(sendbuf))
+                    throw new RuntimeException("Echoed bytes do not match!");
+                readbuf.clear();
+                sendbuf.clear();
+            }
+        } finally {
+            source.close();
+            ssc.close();
+            fc.close();
+            file.delete();
+        }
+    }
+
+    /**
+     * Simple in-process server to echo bytes read by a given socket channel
+     */
+    static class EchoServer implements Runnable {
+        private SocketChannel sc;
+
+        public EchoServer(SocketChannel sc) {
+            this.sc = sc;
+        }
+
+        public void run() {
+            ByteBuffer bb = ByteBuffer.allocateDirect(1024);
+            try {
+                for (;;) {
+                    int n = sc.read(bb);
+                    if (n < 0)
+                        break;
+
+                    bb.flip();
+                    while (bb.remaining() > 0) {
+                        sc.write(bb);
+                    }
+                    bb.clear();
+                }
+            } catch (IOException x) {
+                x.printStackTrace();
+            } finally {
+                try {
+                    sc.close();
+                } catch (IOException ignore) { }
+            }
+        }
+    }
+}
diff --git a/jdk/test/java/nio/channels/FileChannel/Transfers.java b/jdk/test/java/nio/channels/FileChannel/Transfers.java
index a414b59..32c7616 100644
--- a/jdk/test/java/nio/channels/FileChannel/Transfers.java
+++ b/jdk/test/java/nio/channels/FileChannel/Transfers.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,11 @@
  */
 
 /* @test
+ * @key intermittent
  * @summary Comprehensive test for FileChannel.transfer{From,To}
  * @bug 4708120
  * @author Mark Reinhold
+ * @run main/timeout=300 Transfers
  */
 
 import java.io.*;
diff --git a/jdk/test/java/nio/channels/Selector/ChangingInterests.java b/jdk/test/java/nio/channels/Selector/ChangingInterests.java
index bd8ab27..c5164c4 100644
--- a/jdk/test/java/nio/channels/Selector/ChangingInterests.java
+++ b/jdk/test/java/nio/channels/Selector/ChangingInterests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,12 +51,26 @@
         return "(" + s + ")";
     }
 
-    static void write1(SocketChannel peer) throws IOException {
-        peer.write(ByteBuffer.wrap(new byte[1]));
-        // give time for other end to be readable
-        try {
-            Thread.sleep(50);
-        } catch (InterruptedException ignore) { }
+    /**
+     * Writes two bytes to 'out' and reads one byte from 'in' so
+     * as to make 'in' readable.
+     */
+    static void makeReadable(SocketChannel out, SocketChannel in) throws IOException {
+        out.write(ByteBuffer.wrap(new byte[2]));
+        ByteBuffer oneByte = ByteBuffer.wrap(new byte[1]);
+        do {
+            int n = in.read(oneByte);
+            if (n == 1) {
+                break;
+            } else if (n == 0) {
+                try {
+                    Thread.sleep(50);
+                } catch (InterruptedException ignore) { }
+            } else {
+                throw new RuntimeException
+                    ("Expected to read 0 or 1 byte; actual number was " + n);
+            }
+        } while (true);
     }
 
     static void drain(SocketChannel sc) throws IOException {
@@ -147,7 +161,7 @@
         sc.configureBlocking(false);
 
         // ensure that channel "sc" is readable
-        write1(peer);
+        makeReadable(peer, sc);
 
         try (Selector sel = Selector.open()) {
             SelectionKey key = sc.register(sel, 0);
@@ -172,7 +186,7 @@
                         drain(sc);
                         testForSpin(sel);
                         System.out.println("Make channel readable again");
-                        write1(peer);
+                        makeReadable(peer, sc);
                     }
 
                     System.out.println();
diff --git a/jdk/test/java/nio/channels/Selector/OutOfBand.java b/jdk/test/java/nio/channels/Selector/OutOfBand.java
index 78322fa..e2d76b7 100644
--- a/jdk/test/java/nio/channels/Selector/OutOfBand.java
+++ b/jdk/test/java/nio/channels/Selector/OutOfBand.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,9 @@
 
 /* @test
  * @bug 6213702
+ * @requires (os.family != "mac") | (os.version == "10.10.5")
+ *    | (os.simpleVersion != "10.8" & os.simpleVersion != "10.9"
+ *        & os.simpleVersion != "10.10")
  * @summary OOB data causes a SocketChannel, with OOBINLINE disabled, to be
  *    selected
  */
diff --git a/jdk/test/java/nio/channels/Selector/SelectAndClose.java b/jdk/test/java/nio/channels/Selector/SelectAndClose.java
index a545e94..9c1673b 100644
--- a/jdk/test/java/nio/channels/Selector/SelectAndClose.java
+++ b/jdk/test/java/nio/channels/Selector/SelectAndClose.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,19 +29,22 @@
 
 import java.nio.channels.*;
 import java.io.IOException;
+import java.util.concurrent.CountDownLatch;
 
 public class SelectAndClose {
     static Selector selector;
-    static boolean awakened = false;
-    static boolean closed = false;
+    static volatile boolean awakened = false;
+    static volatile boolean closed = false;
 
     public static void main(String[] args) throws Exception {
         selector = Selector.open();
 
         // Create and start a selector in a separate thread.
+        final CountDownLatch selectLatch = new CountDownLatch(1);
         new Thread(new Runnable() {
                 public void run() {
                     try {
+                        selectLatch.countDown();
                         selector.select();
                         awakened = true;
                     } catch (IOException e) {
@@ -51,10 +54,11 @@
             }).start();
 
         // Wait for above thread to get to select() before we call close.
-        Thread.sleep(3000);
+        selectLatch.await();
+        Thread.sleep(2000);
 
         // Try to close. This should wakeup select.
-        new Thread(new Runnable() {
+        Thread closeThread = new Thread(new Runnable() {
                 public void run() {
                     try {
                         selector.close();
@@ -63,10 +67,11 @@
                         System.err.println(e);
                     }
                 }
-            }).start();
+            });
+        closeThread.start();
 
         // Wait for select() to be awakened, which should be done by close.
-        Thread.sleep(3000);
+        closeThread.join();
 
         if (!awakened)
             selector.wakeup();
diff --git a/jdk/test/java/nio/channels/Selector/SelectTimeout.java b/jdk/test/java/nio/channels/Selector/SelectTimeout.java
index 797a363..cc4de4b 100644
--- a/jdk/test/java/nio/channels/Selector/SelectTimeout.java
+++ b/jdk/test/java/nio/channels/Selector/SelectTimeout.java
@@ -30,14 +30,13 @@
  */
 import java.io.IOException;
 import java.nio.channels.Selector;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
 
 public class SelectTimeout {
     private static final long BIG_TIMEOUT    = 100_000_001_000L; // 8165000
     private static final long BIGGER_TIMEOUT = 850_000_000_000_000L; // 8172547
-    private static final long SLEEP_MILLIS   = 10000;
-
-    private static volatile Exception theException;
-    private static volatile boolean isTimedOut;
+    private static final long SLEEP_MILLIS   = 10_000;
 
     public static void main(String[] args)
         throws IOException, InterruptedException {
@@ -59,17 +58,18 @@
 
     private static boolean test(final long timeout)
         throws InterruptedException, IOException {
-        theException = null;
+        AtomicReference<Exception> theException =
+            new AtomicReference<>();
+        AtomicBoolean isTimedOut = new AtomicBoolean();
 
         Selector selector = Selector.open();
 
         Thread t = new Thread(() -> {
             try {
-                isTimedOut = false;
                 selector.select(timeout);
-                isTimedOut = true;
+                isTimedOut.set(true);
             } catch (IOException ioe) {
-                theException = ioe;
+                theException.set(ioe);
             }
         });
         t.start();
@@ -77,8 +77,8 @@
         t.join(SLEEP_MILLIS);
 
         boolean result;
-        if (theException == null) {
-            if (timeout > SLEEP_MILLIS && isTimedOut) {
+        if (theException.get() == null) {
+            if (timeout > SLEEP_MILLIS && isTimedOut.get()) {
                 System.err.printf("Test timed out early with timeout %d%n",
                     timeout);
                 result = false;
@@ -88,11 +88,12 @@
             }
         } else {
             System.err.printf("Test failed with timeout %d%n", timeout);
-            theException.printStackTrace();
+            theException.get().printStackTrace();
             result = false;
         }
 
         t.interrupt();
+        selector.close();
 
         return result;
     }
diff --git a/jdk/test/java/nio/channels/Selector/SelectorLimit.java b/jdk/test/java/nio/channels/Selector/SelectorLimit.java
index cc34a30..6b7fb48 100644
--- a/jdk/test/java/nio/channels/Selector/SelectorLimit.java
+++ b/jdk/test/java/nio/channels/Selector/SelectorLimit.java
@@ -66,15 +66,6 @@
     static final int MIN_KEYS = 100;
 
     public static void main(String[] args) throws Exception {
-        // win9X can't handle many connections at once
-        String osName = System.getProperty("os.name");
-        if (osName.toLowerCase().startsWith("win")) {
-            if (!(osName.equals("Windows NT")
-                  || osName.equals("Windows 2000")
-                  || osName.equals("Windows XP")))
-                return;
-        }
-
         ServerSocketChannel ssc = ServerSocketChannel.open();
         TestUtil.bind(ssc);
         Listener lth = new Listener(ssc);
diff --git a/jdk/test/java/nio/channels/Selector/WakeupAfterClose.java b/jdk/test/java/nio/channels/Selector/WakeupAfterClose.java
index f193634..da4c806 100644
--- a/jdk/test/java/nio/channels/Selector/WakeupAfterClose.java
+++ b/jdk/test/java/nio/channels/Selector/WakeupAfterClose.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,12 @@
 /* @test
  * @bug 6524172
  * @summary Invoking wakeup on closed Selector can throw NPE if close resets interrupt status
+ * @key intermittent
  */
 
-import java.nio.channels.Selector;
 import java.io.IOException;
+import java.nio.channels.ClosedSelectorException;
+import java.nio.channels.Selector;
 
 public class WakeupAfterClose {
 
@@ -40,6 +42,9 @@
                     sel.select();
                 } catch (IOException x) {
                     x.printStackTrace();
+                } catch (ClosedSelectorException y) {
+                    System.err.println
+                        ("Caught expected ClosedSelectorException");
                 }
             }
         };
diff --git a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java
index 4242be4..907d1b2 100644
--- a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java
+++ b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,10 @@
  */
 
 /* @test
- * @summary Test socketchannel vector IO
- * @library ..
+ * @summary Test socketchannel vector IO (use -Dseed=X to set PRNG seed)
+ * @library .. /lib/testlibrary/
+ * @build jdk.testlibrary.RandomFactory
+ * @run main VectorIO
  * @key randomness
  */
 
@@ -32,11 +34,11 @@
 import java.nio.*;
 import java.nio.channels.*;
 import java.util.*;
-
+import jdk.testlibrary.RandomFactory;
 
 public class VectorIO {
 
-    static Random generator = new Random();
+    private static Random generator = RandomFactory.getRandom();
 
     static int testSize;
 
@@ -100,8 +102,6 @@
     static class Server
         extends TestThread
     {
-        static Random generator = new Random();
-
         final int testSize;
         final ServerSocketChannel ssc;
 
diff --git a/jdk/test/java/nio/channels/etc/AdaptorCloseAndInterrupt.java b/jdk/test/java/nio/channels/etc/AdaptorCloseAndInterrupt.java
index 3e48ace..368437a 100644
--- a/jdk/test/java/nio/channels/etc/AdaptorCloseAndInterrupt.java
+++ b/jdk/test/java/nio/channels/etc/AdaptorCloseAndInterrupt.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.Random;
 
 
@@ -46,6 +47,9 @@
     final DatagramChannel peer;
     final int port;
 
+    final AtomicBoolean isClosed = new AtomicBoolean();
+    final AtomicBoolean isInterrupted = new AtomicBoolean();
+
     public AdaptorCloseAndInterrupt() {
         listener = null;
         peer = null;
@@ -96,6 +100,7 @@
 
             try {
                 sc.socket().getInputStream().read(new byte[100]);
+                System.err.format("close() was invoked: %s%n", isClosed.get());
                 throw new RuntimeException("read should not have completed");
             } catch (ClosedChannelException expected) {}
 
@@ -119,7 +124,10 @@
                 sc.socket().getInputStream().read(new byte[100]);
                 throw new RuntimeException("read should not have completed");
             } catch (ClosedByInterruptException expected) {
-                Thread.currentThread().interrupted();
+                System.out.format("interrupt() was invoked: %s%n",
+                    isInterrupted.get());
+                System.out.format("scReadAsyncInterrupt was interrupted: %s%n",
+                    Thread.currentThread().interrupted());
             }
 
             if (!sc.socket().isClosed())
@@ -140,6 +148,7 @@
 
         try {
             dc.socket().receive(new DatagramPacket(new byte[100], 100));
+            System.err.format("close() was invoked: %s%n", isClosed.get());
             throw new RuntimeException("receive should not have completed");
         } catch (ClosedChannelException expected) {}
 
@@ -159,7 +168,16 @@
             dc.socket().receive(new DatagramPacket(new byte[100], 100));
             throw new RuntimeException("receive should not have completed");
         } catch (ClosedByInterruptException expected) {
-            Thread.currentThread().interrupted();
+            System.out.format("interrupt() was invoked: %s%n",
+                isInterrupted.get());
+            System.out.format("dcReceiveAsyncInterrupt was interrupted: %s%n",
+                Thread.currentThread().interrupted());
+        } catch (SocketTimeoutException unexpected) {
+            System.err.format("Receive thread interrupt invoked: %s%n",
+                isInterrupted.get());
+            System.err.format("Receive thread was interrupted: %s%n",
+                Thread.currentThread().isInterrupted());
+            throw unexpected;
         }
 
         if (!dc.socket().isClosed())
@@ -175,6 +193,7 @@
 
         try {
             ssc.socket().accept();
+            System.err.format("close() was invoked: %s%n", isClosed.get());
             throw new RuntimeException("accept should not have completed");
         } catch (ClosedChannelException expected) {}
 
@@ -193,7 +212,10 @@
             ssc.socket().accept();
             throw new RuntimeException("accept should not have completed");
         } catch (ClosedByInterruptException expected) {
-            Thread.currentThread().interrupted();
+            System.out.format("interrupt() was invoked: %s%n",
+                isInterrupted.get());
+            System.out.format("ssAcceptAsyncInterrupt was interrupted: %s%n",
+                Thread.currentThread().interrupted());
         }
 
         if (!ssc.socket().isClosed())
@@ -204,6 +226,7 @@
         AdaptorCloseAndInterrupt.pool.schedule(new Callable<Void>() {
             public Void call() throws Exception {
                 sc.close();
+                isClosed.set(true);
                 return null;
             }
         }, new Random().nextInt(1000), TimeUnit.MILLISECONDS);
@@ -214,6 +237,7 @@
         AdaptorCloseAndInterrupt.pool.schedule(new Callable<Void>() {
             public Void call() throws Exception {
                 current.interrupt();
+                isInterrupted.set(true);
                 return null;
             }
         }, new Random().nextInt(1000), TimeUnit.MILLISECONDS);
diff --git a/jdk/test/java/nio/charset/Charset/CharsetContainmentTest.java b/jdk/test/java/nio/charset/Charset/CharsetContainmentTest.java
index 42c2577..a3983f2 100644
--- a/jdk/test/java/nio/charset/Charset/CharsetContainmentTest.java
+++ b/jdk/test/java/nio/charset/Charset/CharsetContainmentTest.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4626545 4696726
-   @summary Checks the inter containment relationships between NIO charsets
+ * @bug 4626545 4696726
+ * @summary Checks the inter containment relationships between NIO charsets
+ * @modules jdk.charsets
  */
 
 import java.nio.charset.*;
diff --git a/jdk/test/java/nio/charset/Charset/Contains.java b/jdk/test/java/nio/charset/Charset/Contains.java
index ed785bfe..3028098 100644
--- a/jdk/test/java/nio/charset/Charset/Contains.java
+++ b/jdk/test/java/nio/charset/Charset/Contains.java
@@ -24,6 +24,7 @@
 /* @test
  * @summary Unit test for charset containment
  * @bug 6798572
+ * @modules jdk.charsets
  */
 
 import java.nio.charset.*;
diff --git a/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java b/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
index 601ca24..73e7093 100644
--- a/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
+++ b/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java
@@ -25,6 +25,7 @@
  * @test
  * @bug 4777124 6920545 6911753 8073924
  * @summary Verify that all Charset subclasses are available through the API
+ * @modules jdk.charsets
  */
 
 import java.net.URI;
diff --git a/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java b/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java
index 4fd3dbb..c501eb8 100644
--- a/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java
+++ b/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java
@@ -25,6 +25,7 @@
  * @bug 4473201 4696726 4652234 4482298 4784385 4966197 4267354 5015668
         6911753 8071447
  * @summary Check that registered charsets are actually registered
+ * @modules jdk.charsets
  */
 
 import java.io.*;
diff --git a/jdk/test/java/nio/charset/CharsetEncoder/Flush.java b/jdk/test/java/nio/charset/CharsetEncoder/Flush.java
index 02aad13..89b2637 100644
--- a/jdk/test/java/nio/charset/CharsetEncoder/Flush.java
+++ b/jdk/test/java/nio/charset/CharsetEncoder/Flush.java
@@ -24,6 +24,7 @@
 /* @test
  * @bug 6227608
  * @summary Test proper handling of flush()
+ * @modules jdk.charsets
  * @author Martin Buchholz
  */
 
diff --git a/jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java b/jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java
index fe9c359..07f20b8 100644
--- a/jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java
+++ b/jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4454622
-   @summary Check if all supported sun.io encoding names are supported in nio.charset
+ * @bug 4454622
+ * @summary Check if all supported sun.io encoding names are supported in nio.charset
+ * @modules jdk.charsets
  */
 
 import java.util.HashMap;
diff --git a/jdk/test/java/nio/charset/coders/Check.java b/jdk/test/java/nio/charset/coders/Check.java
index 8f7781a..4a1a317 100644
--- a/jdk/test/java/nio/charset/coders/Check.java
+++ b/jdk/test/java/nio/charset/coders/Check.java
@@ -24,6 +24,7 @@
 /* @test
  * @bug 4712786
  * @summary Check charsets against reference files
+ * @modules jdk.charsets
  *
  * @build Util
  * @run main Check shift_jis ref.shift_jis
diff --git a/jdk/test/java/nio/charset/coders/ResetISO2022JP.java b/jdk/test/java/nio/charset/coders/ResetISO2022JP.java
index ba621ab..a894793 100644
--- a/jdk/test/java/nio/charset/coders/ResetISO2022JP.java
+++ b/jdk/test/java/nio/charset/coders/ResetISO2022JP.java
@@ -22,9 +22,10 @@
  */
 
 /* @test
-   @bug 6226510
-   @summary Check that ISO-2022-JP's encoder correctly resets to ASCII mode
-   @author Martin Buchholz
+ * @bug 6226510
+ * @summary Check that ISO-2022-JP's encoder correctly resets to ASCII mode
+ * @modules jdk.charsets
+ * @author Martin Buchholz
  */
 
 import java.nio.*;
diff --git a/jdk/test/java/nio/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java
index 14479e3..c2b482d 100644
--- a/jdk/test/java/nio/file/FileStore/Basic.java
+++ b/jdk/test/java/nio/file/FileStore/Basic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,11 @@
 /* @test
  * @bug 4313887 6873621 6979526 7006126 7020517
  * @summary Unit test for java.nio.file.FileStore
- * @library ..
  * @key intermittent
+ * @library ..
+ * @library .. /lib/testlibrary
+ * @build jdk.testlibrary.FileUtils
+ * @run main Basic
  */
 
 import java.nio.file.*;
@@ -33,6 +36,8 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.*;
+import jdk.testlibrary.FileUtils;
+
 
 public class Basic {
 
@@ -110,31 +115,36 @@
         /**
          * Test: Enumerate all FileStores
          */
-        FileStore prev = null;
-        for (FileStore store: FileSystems.getDefault().getFileStores()) {
-            System.out.format("%s (name=%s type=%s)\n", store, store.name(),
-                store.type());
+        if (FileUtils.areFileSystemsAccessible()) {
+            FileStore prev = null;
+            for (FileStore store: FileSystems.getDefault().getFileStores()) {
+                System.out.format("%s (name=%s type=%s)\n", store, store.name(),
+                    store.type());
 
-            // check space attributes are accessible
-            try {
-                store.getTotalSpace();
-                store.getUnallocatedSpace();
-                store.getUsableSpace();
-            } catch (NoSuchFileException nsfe) {
-                // ignore exception as the store could have been
-                // deleted since the iterator was instantiated
-                System.err.format("%s was not found\n", store);
-            } catch (AccessDeniedException ade) {
-                // ignore exception as the lack of ability to access the
-                // store due to lack of file permission or similar does not
-                // reflect whether the space attributes would be accessible
-                // were access to be permitted
-                System.err.format("%s is inaccessible\n", store);
+                // check space attributes are accessible
+                try {
+                    store.getTotalSpace();
+                    store.getUnallocatedSpace();
+                    store.getUsableSpace();
+                } catch (NoSuchFileException nsfe) {
+                    // ignore exception as the store could have been
+                    // deleted since the iterator was instantiated
+                    System.err.format("%s was not found\n", store);
+                } catch (AccessDeniedException ade) {
+                    // ignore exception as the lack of ability to access the
+                    // store due to lack of file permission or similar does not
+                    // reflect whether the space attributes would be accessible
+                    // were access to be permitted
+                    System.err.format("%s is inaccessible\n", store);
+                }
+
+                // two distinct FileStores should not be equal
+                assertTrue(!store.equals(prev));
+                prev = store;
             }
-
-            // two distinct FileStores should not be equal
-            assertTrue(!store.equals(prev));
-            prev = store;
+        } else {
+            System.err.println
+                ("Skipping FileStore check due to file system access failure");
         }
     }
 }
diff --git a/jdk/test/java/nio/file/FileSystem/Basic.java b/jdk/test/java/nio/file/FileSystem/Basic.java
index 4b02ff4..bc4c77b 100644
--- a/jdk/test/java/nio/file/FileSystem/Basic.java
+++ b/jdk/test/java/nio/file/FileSystem/Basic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,10 +30,16 @@
  */
 
 import java.io.File;
-import java.nio.file.*;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.nio.file.Files;
+import java.nio.file.FileStore;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.ProviderNotFoundException;
 import java.util.HashMap;
 import jdk.testlibrary.FileUtils;
 
@@ -47,6 +53,20 @@
             throw new RuntimeException(msg);
     }
 
+    static void checkFileStores(FileSystem fs) throws IOException {
+        // sanity check method
+        if (FileUtils.areFileSystemsAccessible()) {
+            System.out.println("\n--- Begin FileStores ---");
+            for (FileStore store: fs.getFileStores()) {
+                System.out.println(store);
+            }
+            System.out.println("--- EndFileStores ---\n");
+        } else {
+            System.err.println
+                ("Skipping FileStore check due to file system access failure");
+        }
+    }
+
     static void checkSupported(FileSystem fs, String... views) {
         for (String view: views) {
             check(fs.supportedFileAttributeViews().contains(view),
@@ -70,7 +90,9 @@
         }
     }
 
-    public static void main(String[] args) throws IOException, URISyntaxException {
+    public static void main(String[] args)
+        throws IOException, URISyntaxException {
+        String os = System.getProperty("os.name");
         FileSystem fs = FileSystems.getDefault();
 
         // close should throw UOE
@@ -85,15 +107,11 @@
         check(fs.provider().getScheme().equals("file"),
             "should use 'file' scheme");
 
-        // santity check method - need to re-visit this in future as I/O errors
-        // are possible
-        for (FileStore store: fs.getFileStores()) {
-            System.out.println(store);
-        }
+        // sanity check FileStores
+        checkFileStores(fs);
 
         // sanity check supportedFileAttributeViews
         checkSupported(fs, "basic");
-        String os = System.getProperty("os.name");
         if (os.equals("SunOS"))
             checkSupported(fs, "posix", "unix", "owner", "acl", "user");
         if (os.equals("Linux"))
diff --git a/jdk/test/java/nio/file/WatchService/LotsOfEvents.java b/jdk/test/java/nio/file/WatchService/LotsOfEvents.java
index 042dfd9..6990c1e 100644
--- a/jdk/test/java/nio/file/WatchService/LotsOfEvents.java
+++ b/jdk/test/java/nio/file/WatchService/LotsOfEvents.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,22 +23,25 @@
 
 /* @test
  * @bug 6907760 6929532
- * @summary Tests WatchService behavior when lots of events are pending
+ * @summary Tests WatchService behavior when lots of events are pending (use -Dseed=X to set PRNG seed)
  * @library ..
+ * @library /lib/testlibrary/
+ * @build jdk.testlibrary.*
  * @run main/timeout=180 LotsOfEvents
  * @key randomness
  */
 
-import java.nio.file.*;
-import static java.nio.file.StandardWatchEventKinds.*;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.nio.file.*;
+import static java.nio.file.StandardWatchEventKinds.*;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
+import jdk.testlibrary.RandomFactory;
 
 public class LotsOfEvents {
 
-    static final Random rand = new Random();
+    private static final Random RAND = RandomFactory.getRandom();
 
     public static void main(String[] args) throws Exception {
         Path dir = TestUtil.createTemporaryDirectory();
@@ -70,7 +73,7 @@
             Thread.sleep(1000);
 
             // check that we see the create events (or overflow)
-            drainAndCheckOverflowEvents(watcher, ENTRY_CREATE, n);
+            drainAndCheckOverflowEvents(dir, watcher, ENTRY_CREATE, n);
 
             // delete the files
             for (int i=0; i<n; i++) {
@@ -81,11 +84,12 @@
             Thread.sleep(1000);
 
             // check that we see the delete events (or overflow)
-            drainAndCheckOverflowEvents(watcher, ENTRY_DELETE, n);
+            drainAndCheckOverflowEvents(dir, watcher, ENTRY_DELETE, n);
         }
     }
 
-    static void drainAndCheckOverflowEvents(WatchService watcher,
+    static void drainAndCheckOverflowEvents(Path dir,
+                                            WatchService watcher,
                                             WatchEvent.Kind<?> expectedKind,
                                             int count)
         throws IOException, InterruptedException
@@ -123,8 +127,25 @@
         }
 
         // check that all expected events were received or there was an overflow
-        if (nread < count && !gotOverflow)
-            throw new RuntimeException("Insufficient events");
+        if (nread < count && !gotOverflow) {
+            System.err.printf("Test directory %s contains %d files%n",
+                dir, Files.list(dir).count());
+
+            long timeBeforePoll = System.nanoTime();
+            key = watcher.poll(15, TimeUnit.SECONDS);
+            long timeAfterPoll = System.nanoTime();
+            if (key == null) {
+                System.err.println("key still null after extra polling");
+            } else {
+                List<WatchEvent<?>> events = key.pollEvents();
+                System.err.printf("Retrieved key with %d events after %d ns%n",
+                    events.size(), timeAfterPoll - timeBeforePoll);
+            }
+
+            throw new RuntimeException("Insufficient "
+                + expectedKind.name() + "  events: expected "
+                + count + ", received " + nread);
+        }
     }
 
     /**
@@ -134,14 +155,14 @@
         throws IOException, InterruptedException
     {
         // this test uses a random number of files
-        final int nfiles = 5 + rand.nextInt(10);
+        final int nfiles = 5 + RAND.nextInt(10);
         DirectoryEntry[] entries = new DirectoryEntry[nfiles];
         for (int i=0; i<nfiles; i++) {
             entries[i] = new DirectoryEntry(dir.resolve("foo" + i));
 
             // "some" of the files exist, some do not.
             entries[i].deleteIfExists();
-            if (rand.nextBoolean())
+            if (RAND.nextBoolean())
                 entries[i].create();
         }
 
@@ -153,8 +174,8 @@
 
                 // make some noise!!!
                 for (int i=0; i<100; i++) {
-                    DirectoryEntry entry = entries[rand.nextInt(nfiles)];
-                    int action = rand.nextInt(10);
+                    DirectoryEntry entry = entries[RAND.nextInt(nfiles)];
+                    int action = RAND.nextInt(10);
                     switch (action) {
                         case 0 : entry.create(); break;
                         case 1 : entry.deleteIfExists(); break;
diff --git a/jdk/test/java/security/Provider/DefaultProviderList.java b/jdk/test/java/security/Provider/DefaultProviderList.java
index 4aaeffe..9a015b0 100644
--- a/jdk/test/java/security/Provider/DefaultProviderList.java
+++ b/jdk/test/java/security/Provider/DefaultProviderList.java
@@ -33,7 +33,6 @@
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.ServiceLoader;
-import java.lang.reflect.Module;
 
 public class DefaultProviderList {
 
diff --git a/jdk/test/java/security/SignedObject/Chain.java b/jdk/test/java/security/SignedObject/Chain.java
index 1393999..65e1ebb 100644
--- a/jdk/test/java/security/SignedObject/Chain.java
+++ b/jdk/test/java/security/SignedObject/Chain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
 /*
  * @test
  * @bug 8050374
- * @key intermittent
  * @summary Verify a chain of signed objects
  */
 public class Chain {
@@ -137,8 +136,17 @@
             PrivateKey[] privKeys = new PrivateKey[N];
             PublicKey[] pubKeys = new PublicKey[N];
             PublicKey[] anotherPubKeys = new PublicKey[N];
-            KeyPairGenerator kpg = KeyPairGenerator.getInstance(
-                    test.keyAlg.name);
+            Signature signature;
+            KeyPairGenerator kpg;
+            if (test.provider != Provider.Default) {
+                signature = Signature.getInstance(test.sigAlg.name,
+                        test.provider.name);
+                kpg = KeyPairGenerator.getInstance(
+                    test.keyAlg.name, test.provider.name);
+            } else {
+                signature = Signature.getInstance(test.sigAlg.name);
+                kpg = KeyPairGenerator.getInstance(test.keyAlg.name);
+            }
             for (int j=0; j < N; j++) {
                 KeyPair kp = kpg.genKeyPair();
                 KeyPair anotherKp = kpg.genKeyPair();
@@ -154,14 +162,6 @@
                 }
             }
 
-            Signature signature;
-            if (test.provider != Provider.Default) {
-                signature = Signature.getInstance(test.sigAlg.name,
-                        test.provider.name);
-            } else {
-                signature = Signature.getInstance(test.sigAlg.name);
-            }
-
             // Create a chain of signed objects
             SignedObject[] objects = new SignedObject[N];
             objects[0] = new SignedObject(str, privKeys[0], signature);
diff --git a/jdk/test/java/security/modules/ModularTest.java b/jdk/test/java/security/modules/ModularTest.java
index 9e67094..56635c9 100644
--- a/jdk/test/java/security/modules/ModularTest.java
+++ b/jdk/test/java/security/modules/ModularTest.java
@@ -164,9 +164,9 @@
         final Builder builder;
         if (moduleType == MODULE_TYPE.EXPLICIT) {
             System.out.format(" %nGenerating ModuleDescriptor object");
-            builder = ModuleDescriptor.module(moduleName).exports(pkg);
+            builder = ModuleDescriptor.newModule(moduleName).exports(pkg);
             if (isService && serviceInterface != null && serviceImpl != null) {
-                builder.provides(serviceInterface, serviceImpl);
+                builder.provides(serviceInterface, List.of(serviceImpl));
             } else {
                 if (serviceInterface != null) {
                     builder.uses(serviceInterface);
diff --git a/jdk/test/java/security/testlibrary/Proc.java b/jdk/test/java/security/testlibrary/Proc.java
index 7248757..dc1f9e7 100644
--- a/jdk/test/java/security/testlibrary/Proc.java
+++ b/jdk/test/java/security/testlibrary/Proc.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -176,6 +176,14 @@
         prop.put(a, b);
         return this;
     }
+    // Inherit the value of a system property
+    public Proc inheritProp(String k) {
+        String v = System.getProperty(k);
+        if (v != null) {
+            prop.put(k, v);
+        }
+        return this;
+    }
     // Sets classpath. If not called, Proc will choose a classpath. If called
     // with no arg, no classpath will be used. Can be called multiple times.
     public Proc cp(String... s) {
diff --git a/jdk/test/java/time/TEST.properties b/jdk/test/java/time/TEST.properties
index f522b84..346e3e2 100644
--- a/jdk/test/java/time/TEST.properties
+++ b/jdk/test/java/time/TEST.properties
@@ -1,6 +1,5 @@
-# Threeten test uses TestNG
+# java.time tests use TestNG
 TestNG.dirs = .
 othervm.dirs = tck/java/time/chrono test/java/time/chrono test/java/time/format
 lib.dirs = ../../lib/testlibrary
 lib.build = jdk.testlibrary.RandomFactory
-modules = java.base/java.time:open java.base/java.time.chrono:open java.base/java.time.zone:open
diff --git a/jdk/test/java/time/tck/java/time/AbstractTCKTest.java b/jdk/test/java/time/tck/java/time/AbstractTCKTest.java
index d960114..6272ea7 100644
--- a/jdk/test/java/time/tck/java/time/AbstractTCKTest.java
+++ b/jdk/test/java/time/tck/java/time/AbstractTCKTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,14 +69,35 @@
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamConstants;
 import java.io.Serializable;
-import java.lang.reflect.Field;
 import java.util.Formatter;
+import java.util.Map;
 
 /**
  * Base test class.
  */
 public abstract class AbstractTCKTest {
 
+    /**
+     * Map from package name to the serialVersionUID of the .Ser class for the package.
+     */
+    private static Map<String, Long> serialVersionUIDs = Map.of(
+                "java.time",        -7683839454370182990L,
+                "java.time.chrono", -6103370247208168577L,
+                "java.time.zone",   -8885321777449118786L
+                );
+
+    /**
+     * Returns the serialVersionUID for the class.
+     * The SUIDs are defined by the specification for each class.
+     * @param serClass the class to return the SUID of
+     * @return returns the serialVersionUID for the class
+     */
+    public final static long getSUID(Class<?> serClass) {
+        String pkgName = serClass.getPackageName();
+        return serialVersionUIDs.get(pkgName);
+    }
+
+
     protected static boolean isIsoLeap(long year) {
         if (year % 4 != 0) {
             return false;
@@ -111,10 +132,8 @@
 
     protected static void assertSerializedBySer(Object object, byte[] expectedBytes, byte[]... matches) throws Exception {
         String serClass = object.getClass().getPackage().getName() + ".Ser";
-        Class<?> serCls = Class.forName(serClass);
-        Field field = serCls.getDeclaredField("serialVersionUID");
-        field.setAccessible(true);
-        long serVer = (Long) field.get(null);
+        long serVer = getSUID(object.getClass());
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (ObjectOutputStream oos = new ObjectOutputStream(baos) ) {
             oos.writeObject(object);
@@ -172,9 +191,8 @@
      * @throws Exception if an unexpected condition occurs
      */
     protected static void assertNotSerializable(Class<?> serClass) throws Exception {
-        Field field = serClass.getDeclaredField("serialVersionUID");
-        field.setAccessible(true);
-        long serVer = (Long) field.get(null);
+        long serVer = getSUID(serClass);
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (DataOutputStream out = new DataOutputStream(baos)) {
             out.writeShort(ObjectStreamConstants.STREAM_MAGIC);
@@ -201,7 +219,6 @@
         fail("Class should not be deserializable " + serClass.getName());
     }
 
-
     /**
      * Utility method to dump a byte array in a java syntax.
      * @param bytes and array of bytes
diff --git a/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java b/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java
index 991b447..1234083 100644
--- a/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java
+++ b/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -104,8 +104,6 @@
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.time.Clock;
 import java.time.DateTimeException;
 import java.time.Duration;
@@ -470,24 +468,12 @@
     //-----------------------------------------------------------------------
     @Test(expectedExceptions=NullPointerException.class)
     public void constructor_nullTime() throws Throwable  {
-        Constructor<OffsetDateTime> con = OffsetDateTime.class.getDeclaredConstructor(LocalDateTime.class, ZoneOffset.class);
-        con.setAccessible(true);
-        try {
-            con.newInstance(null, OFFSET_PONE);
-        } catch (InvocationTargetException ex) {
-            throw ex.getCause();
-        }
+        OffsetDateTime.of(null, OFFSET_PONE);
     }
 
     @Test(expectedExceptions=NullPointerException.class)
     public void constructor_nullOffset() throws Throwable  {
-        Constructor<OffsetDateTime> con = OffsetDateTime.class.getDeclaredConstructor(LocalDateTime.class, ZoneOffset.class);
-        con.setAccessible(true);
-        try {
-            con.newInstance(LocalDateTime.of(LocalDate.of(2008, 6, 30), LocalTime.of(11, 30)), null);
-        } catch (InvocationTargetException ex) {
-            throw ex.getCause();
-        }
+        OffsetDateTime.of(LocalDateTime.of(LocalDate.of(2008, 6, 30), LocalTime.of(11, 30)), null);
     }
 
     //-----------------------------------------------------------------------
diff --git a/jdk/test/java/time/tck/java/time/TCKOffsetTime.java b/jdk/test/java/time/tck/java/time/TCKOffsetTime.java
index 016cfc3..738bb86 100644
--- a/jdk/test/java/time/tck/java/time/TCKOffsetTime.java
+++ b/jdk/test/java/time/tck/java/time/TCKOffsetTime.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -89,8 +89,6 @@
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.time.Clock;
 import java.time.DateTimeException;
 import java.time.Instant;
@@ -465,28 +463,16 @@
     }
 
     //-----------------------------------------------------------------------
-    // constructor
+    // constructor via factory
     //-----------------------------------------------------------------------
     @Test(expectedExceptions=NullPointerException.class)
     public void constructor_nullTime() throws Throwable  {
-        Constructor<OffsetTime> con = OffsetTime.class.getDeclaredConstructor(LocalTime.class, ZoneOffset.class);
-        con.setAccessible(true);
-        try {
-            con.newInstance(null, OFFSET_PONE);
-        } catch (InvocationTargetException ex) {
-            throw ex.getCause();
-        }
+        OffsetTime.of(null, OFFSET_PONE);
     }
 
     @Test(expectedExceptions=NullPointerException.class)
     public void constructor_nullOffset() throws Throwable  {
-        Constructor<OffsetTime> con = OffsetTime.class.getDeclaredConstructor(LocalTime.class, ZoneOffset.class);
-        con.setAccessible(true);
-        try {
-            con.newInstance(LocalTime.of(11, 30, 0, 0), null);
-        } catch (InvocationTargetException ex) {
-            throw ex.getCause();
-        }
+       OffsetTime.of(LocalTime.of(11, 30, 0, 0), null);
     }
 
     //-----------------------------------------------------------------------
diff --git a/jdk/test/java/time/tck/java/time/serial/TCKZoneIdSerialization.java b/jdk/test/java/time/tck/java/time/serial/TCKZoneIdSerialization.java
index c6f3abe..34c79c3 100644
--- a/jdk/test/java/time/tck/java/time/serial/TCKZoneIdSerialization.java
+++ b/jdk/test/java/time/tck/java/time/serial/TCKZoneIdSerialization.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,8 +63,11 @@
 import org.testng.annotations.Test;
 import tck.java.time.AbstractTCKTest;
 
-import java.io.*;
-import java.lang.reflect.Field;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamConstants;
 import java.time.DateTimeException;
 import java.time.ZoneId;
 import java.time.zone.ZoneRulesException;
@@ -153,10 +156,8 @@
 
     private ZoneId deserialize(String id) throws Exception {
         String serClass = ZoneId.class.getPackage().getName() + ".Ser";
-        Class<?> serCls = Class.forName(serClass);
-        Field field = serCls.getDeclaredField("serialVersionUID");
-        field.setAccessible(true);
-        long serVer = (Long) field.get(null);
+        long serVer = getSUID(ZoneId.class);
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (DataOutputStream dos = new DataOutputStream(baos)) {
             dos.writeShort(ObjectStreamConstants.STREAM_MAGIC);
diff --git a/jdk/test/java/time/test/java/time/TEST.properties b/jdk/test/java/time/test/java/time/TEST.properties
new file mode 100644
index 0000000..75b4dd4
--- /dev/null
+++ b/jdk/test/java/time/test/java/time/TEST.properties
@@ -0,0 +1,2 @@
+# java.time test system clock
+modules = java.base/java.time:open
diff --git a/jdk/test/java/util/ResourceBundle/modules/cache/src/test/jdk/test/Main.java b/jdk/test/java/util/ResourceBundle/modules/cache/src/test/jdk/test/Main.java
index a6ae872..234e841 100644
--- a/jdk/test/java/util/ResourceBundle/modules/cache/src/test/jdk/test/Main.java
+++ b/jdk/test/java/util/ResourceBundle/modules/cache/src/test/jdk/test/Main.java
@@ -23,7 +23,6 @@
 
 package jdk.test;
 
-import java.lang.reflect.Module;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
@@ -56,4 +55,4 @@
             jdk.test.util.Bundles.getBundle();
         }
     }
-}
\ No newline at end of file
+}
diff --git a/jdk/test/java/util/ResourceBundle/modules/casesensitive/CaseInsensitiveNameClash.java b/jdk/test/java/util/ResourceBundle/modules/casesensitive/CaseInsensitiveNameClash.java
new file mode 100644
index 0000000..b3eef5d
--- /dev/null
+++ b/jdk/test/java/util/ResourceBundle/modules/casesensitive/CaseInsensitiveNameClash.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8177980
+ * @library /lib/testlibrary
+ * @modules jdk.compiler
+ * @build CompilerUtils jdk.testlibrary.ProcessTools CaseInsensitiveNameClash
+ * @run testng CaseInsensitiveNameClash
+ */
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import jdk.testlibrary.ProcessTools;
+
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+public class CaseInsensitiveNameClash {
+
+    private static final String TEST_SRC = System.getProperty("test.src");
+
+    private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
+    private static final Path MODS_DIR = Paths.get("mods");
+
+    private static final String MODULE = "resbundle";
+    private static final String MAIN_CLASS = MODULE + "/jdk.test.Main";
+
+    /**
+     * Compiles the module used by the test
+     */
+    @BeforeTest
+    public void compileAll() throws Exception {
+        Path msrc = SRC_DIR.resolve(MODULE);
+        assertTrue(CompilerUtils.compile(msrc, MODS_DIR,
+                                         "--module-source-path", SRC_DIR.toString()));
+        Path propsFile = Paths.get("jdk", "test", "main.properties");
+        Files.copy(msrc.resolve(propsFile), MODS_DIR.resolve(MODULE).resolve(propsFile));
+    }
+
+    @Test
+    public void test() throws Exception {
+        assertTrue(ProcessTools.executeTestJava("--module-path", MODS_DIR.toString(),
+                                                "-m", MAIN_CLASS)
+                               .outputTo(System.out)
+                               .errorTo(System.out)
+                               .getExitValue() == 0);
+    }
+}
diff --git a/jdk/test/java/util/ResourceBundle/modules/casesensitive/src/resbundle/jdk/test/Main.java b/jdk/test/java/util/ResourceBundle/modules/casesensitive/src/resbundle/jdk/test/Main.java
new file mode 100644
index 0000000..73ff726
--- /dev/null
+++ b/jdk/test/java/util/ResourceBundle/modules/casesensitive/src/resbundle/jdk/test/Main.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test;
+
+import java.util.ResourceBundle;
+
+public class Main {
+    public static void main(String[] args) throws Exception {
+        ResourceBundle bundle = ResourceBundle.getBundle("jdk.test.main");
+        if (!bundle.getString("key").equals("value")) {
+            throw new RuntimeException("Expected: value but get " + bundle.getString("key"));
+        }
+    }
+}
diff --git a/jdk/test/java/util/ResourceBundle/modules/casesensitive/src/resbundle/jdk/test/main.properties b/jdk/test/java/util/ResourceBundle/modules/casesensitive/src/resbundle/jdk/test/main.properties
new file mode 100644
index 0000000..7b89edb
--- /dev/null
+++ b/jdk/test/java/util/ResourceBundle/modules/casesensitive/src/resbundle/jdk/test/main.properties
@@ -0,0 +1 @@
+key=value
diff --git a/jdk/test/java/util/ResourceBundle/modules/casesensitive/src/resbundle/module-info.java b/jdk/test/java/util/ResourceBundle/modules/casesensitive/src/resbundle/module-info.java
new file mode 100644
index 0000000..fdb2838
--- /dev/null
+++ b/jdk/test/java/util/ResourceBundle/modules/casesensitive/src/resbundle/module-info.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module resbundle {
+}
diff --git a/jdk/test/java/util/ResourceBundle/modules/security/src/test/jdk/test/Main.java b/jdk/test/java/util/ResourceBundle/modules/security/src/test/jdk/test/Main.java
index ecea6ab..88b9222 100644
--- a/jdk/test/java/util/ResourceBundle/modules/security/src/test/jdk/test/Main.java
+++ b/jdk/test/java/util/ResourceBundle/modules/security/src/test/jdk/test/Main.java
@@ -24,7 +24,6 @@
 package jdk.test;
 
 import p1.Bundle;
-import java.lang.reflect.Module;
 import java.util.ResourceBundle;
 
 public class Main {
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithNoModuleArg.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithNoModuleArg.java
index 5e100ab..1b7aef1 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithNoModuleArg.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithNoModuleArg.java
@@ -23,7 +23,6 @@
 
 package jdk.embargo;
 
-import java.lang.reflect.Module;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithUnnamedModuleArg.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithUnnamedModuleArg.java
index 8f2ca8e..b2df284 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithUnnamedModuleArg.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithUnnamedModuleArg.java
@@ -23,7 +23,6 @@
 
 package jdk.embargo;
 
-import java.lang.reflect.Module;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/pkg/jdk/pkg/test/Main.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/pkg/jdk/pkg/test/Main.java
index 54ac2e7..8706ab2 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/pkg/jdk/pkg/test/Main.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/pkg/jdk/pkg/test/Main.java
@@ -23,7 +23,6 @@
 
 package jdk.pkg.test;
 
-import java.lang.reflect.Module;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithNoModuleArg.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithNoModuleArg.java
index 19de28a..3a16a41 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithNoModuleArg.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithNoModuleArg.java
@@ -23,7 +23,6 @@
 
 package jdk.test;
 
-import java.lang.reflect.Module;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithUnnamedModuleArg.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithUnnamedModuleArg.java
index d36b53f..fc6cd20 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithUnnamedModuleArg.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithUnnamedModuleArg.java
@@ -23,7 +23,6 @@
 
 package jdk.test;
 
-import java.lang.reflect.Module;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ServiceLoader/basic/basic.sh b/jdk/test/java/util/ServiceLoader/basic/basic.sh
index 4ffd56a..1a3a348 100644
--- a/jdk/test/java/util/ServiceLoader/basic/basic.sh
+++ b/jdk/test/java/util/ServiceLoader/basic/basic.sh
@@ -76,6 +76,7 @@
       (cd $JARD; "$JAR" ${TESTTOOLVMOPTS} -cf ../p$n.jar *)
     done
 
+    cp p2.jar p2dup.jar
     mv p3.jar $EXTD
 
     cp $TESTCLASSES/Load.class $TESTD
@@ -117,6 +118,8 @@
 
 go ".${SEP}p2.jar" "" FooProvider2
 
+go ".${SEP}p2.jar${SEP}p2dup.jar" "" FooProvider2
+
 go "${P3JAR}${SEP}p2.jar" "" FooProvider3 FooProvider2
 
 go "$TESTD${SEP}p2.jar" "" FooProvider1 FooProvider2
diff --git a/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java b/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java
index c28e3b9..a1bf4ab 100644
--- a/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java
+++ b/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java
@@ -33,7 +33,6 @@
 
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -87,14 +86,14 @@
     private List<Provider> loadProviders(Path mp, String moduleName) throws Exception {
         ModuleFinder finder = ModuleFinder.of(mp);
 
-        Layer bootLayer = Layer.boot();
+        ModuleLayer bootLayer = ModuleLayer.boot();
 
         Configuration cf = bootLayer.configuration()
-                .resolveRequiresAndUses(finder, ModuleFinder.of(), Set.of(moduleName));
+                .resolveAndBind(finder, ModuleFinder.of(), Set.of(moduleName));
 
         ClassLoader scl = ClassLoader.getSystemClassLoader();
 
-        Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
 
         Class<?> service = layer.findLoader(moduleName).loadClass(TEST_SERVICE);
 
diff --git a/jdk/test/java/util/ServiceLoader/modules/Basic.java b/jdk/test/java/util/ServiceLoader/modules/Basic.java
index 7833c0e..75e30bc 100644
--- a/jdk/test/java/util/ServiceLoader/modules/Basic.java
+++ b/jdk/test/java/util/ServiceLoader/modules/Basic.java
@@ -24,6 +24,7 @@
 /**
  * @test
  * @library modules
+ * @modules java.scripting
  * @build bananascript/*
  * @compile src/pearscript/org/pear/PearScriptEngineFactory.java
  *          src/pearscript/org/pear/PearScript.java
@@ -33,7 +34,6 @@
 
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -228,7 +228,7 @@
      */
     @Test
     public void testWithCustomLayer1() {
-        Layer layer = createCustomLayer("bananascript");
+        ModuleLayer layer = createCustomLayer("bananascript");
 
         ClassLoader loader = layer.findLoader("bananascript");
         List<ScriptEngineFactory> providers
@@ -257,7 +257,7 @@
      */
     @Test
     public void testWithCustomLayer2() {
-        Layer layer = createCustomLayer("bananascript");
+        ModuleLayer layer = createCustomLayer("bananascript");
 
         List<ScriptEngineFactory> factories
             = collectAll(ServiceLoader.load(layer, ScriptEngineFactory.class));
@@ -292,7 +292,7 @@
      */
     @Test
     public void testWithCustomLayer3() {
-        Layer bootLayer = Layer.boot();
+        ModuleLayer bootLayer = ModuleLayer.boot();
         Configuration cf0 = bootLayer.configuration();
 
         // boot layer should contain "bananascript"
@@ -311,21 +311,22 @@
         ModuleFinder finder = ModuleFinder.of(dir);
 
         // layer1
-        Configuration cf1 = cf0.resolveRequiresAndUses(finder, ModuleFinder.of(), Set.of());
-        Layer layer1 = bootLayer.defineModulesWithOneLoader(cf1, scl);
+        Configuration cf1 = cf0.resolveAndBind(finder, ModuleFinder.of(), Set.of());
+        ModuleLayer layer1 = bootLayer.defineModulesWithOneLoader(cf1, scl);
         assertTrue(layer1.modules().size() == 1);
 
         // layer2
-        Configuration cf2 = cf0.resolveRequiresAndUses(finder, ModuleFinder.of(), Set.of());
-        Layer layer2 = bootLayer.defineModulesWithOneLoader(cf2, scl);
+        Configuration cf2 = cf0.resolveAndBind(finder, ModuleFinder.of(), Set.of());
+        ModuleLayer layer2 = bootLayer.defineModulesWithOneLoader(cf2, scl);
         assertTrue(layer2.modules().size() == 1);
 
         // layer3 with layer1 and layer2 as parents
-        Configuration cf3 = Configuration.resolveRequiresAndUses(finder,
+        Configuration cf3 = Configuration.resolveAndBind(finder,
                 List.of(cf1, cf2),
                 ModuleFinder.of(),
                 Set.of());
-        Layer layer3 = Layer.defineModulesWithOneLoader(cf3, List.of(layer1, layer2), scl).layer();
+        ModuleLayer layer3
+            = ModuleLayer.defineModulesWithOneLoader(cf3, List.of(layer1, layer2), scl).layer();
         assertTrue(layer3.modules().size() == 1);
 
 
@@ -389,12 +390,12 @@
     @Test(expectedExceptions = { NullPointerException.class })
     public void testLoadNull3() {
         class S { }
-        ServiceLoader.load((Layer) null, S.class);
+        ServiceLoader.load((ModuleLayer) null, S.class);
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
     public void testLoadNull4() {
-        ServiceLoader.load(Layer.empty(), null);
+        ServiceLoader.load(ModuleLayer.empty(), null);
     }
 
     @Test(expectedExceptions = { NullPointerException.class })
@@ -403,19 +404,19 @@
     }
 
     /**
-     * Create a custom Layer by resolving the given module names. The modules
+     * Create a custom layer by resolving the given module names. The modules
      * are located in the {@code ${test.classes}/modules} directory.
      */
-    private Layer createCustomLayer(String... modules) {
+    private ModuleLayer createCustomLayer(String... modules) {
         Path dir = Paths.get(System.getProperty("test.classes", "."), "modules");
         ModuleFinder finder = ModuleFinder.of(dir);
         Set<String> roots = new HashSet<>();
         Collections.addAll(roots, modules);
-        Layer bootLayer = Layer.boot();
+        ModuleLayer bootLayer = ModuleLayer.boot();
         Configuration parent = bootLayer.configuration();
-        Configuration cf = parent.resolveRequires(finder, ModuleFinder.of(), roots);
+        Configuration cf = parent.resolve(finder, ModuleFinder.of(), roots);
         ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+        ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
         assertTrue(layer.modules().size() == 1);
         return layer;
     }
diff --git a/jdk/test/java/util/Spliterator/SpliteratorCollisions.java b/jdk/test/java/util/Spliterator/SpliteratorCollisions.java
index 733dff4..43c0fc6 100644
--- a/jdk/test/java/util/Spliterator/SpliteratorCollisions.java
+++ b/jdk/test/java/util/Spliterator/SpliteratorCollisions.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,20 +24,19 @@
 /**
  * @test
  * @bug 8005698
+ * @library ../stream/bootlib
+ * @build java.base/java.util.SpliteratorTestHelper
  * @run testng SpliteratorCollisions
  * @summary Spliterator traversing and splitting hash maps containing colliding hashes
- * @author Brent Christian
  */
 
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
-import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Deque;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
@@ -45,19 +44,15 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 import java.util.TreeSet;
-import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.function.UnaryOperator;
 
-import static org.testng.Assert.*;
-import static org.testng.Assert.assertEquals;
+public class SpliteratorCollisions extends SpliteratorTestHelper {
 
-@Test
-public class SpliteratorCollisions {
-
-    private static List<Integer> SIZES = Arrays.asList(0, 1, 10, 100, 1000);
+    private static final List<Integer> SIZES = Arrays.asList(0, 1, 10, 100, 1000);
 
     private static class SpliteratorDataBuilder<T> {
         List<Object[]> data;
@@ -214,492 +209,134 @@
     }
 
     @Test(dataProvider = "HashableIntSpliterator")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testNullPointerException(String description, Collection exp, Supplier<Spliterator> s) {
+    void testNullPointerException(String description,
+                                  Collection<HashableInteger> exp,
+                                  Supplier<Spliterator<HashableInteger>> s) {
         executeAndCatch(NullPointerException.class, () -> s.get().forEachRemaining(null));
         executeAndCatch(NullPointerException.class, () -> s.get().tryAdvance(null));
     }
 
     @Test(dataProvider = "HashableIntSpliteratorWithNull")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testNullPointerExceptionWithNull(String description, Collection exp, Supplier<Spliterator> s) {
+    void testNullPointerExceptionWithNull(String description,
+                                          Collection<HashableInteger> exp,
+                                          Supplier<Spliterator<HashableInteger>> s) {
         executeAndCatch(NullPointerException.class, () -> s.get().forEachRemaining(null));
         executeAndCatch(NullPointerException.class, () -> s.get().tryAdvance(null));
     }
 
 
     @Test(dataProvider = "HashableIntSpliterator")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testForEach(String description, Collection exp, Supplier<Spliterator> s) {
-        testForEach(exp, s, (Consumer<Object> b) -> b);
+    void testForEach(String description,
+                     Collection<HashableInteger> exp,
+                     Supplier<Spliterator<HashableInteger>> s) {
+        testForEach(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "HashableIntSpliteratorWithNull")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testForEachWithNull(String description, Collection exp, Supplier<Spliterator> s) {
-        testForEach(exp, s, (Consumer<Object> b) -> b);
+    void testForEachWithNull(String description,
+                             Collection<HashableInteger> exp,
+                             Supplier<Spliterator<HashableInteger>> s) {
+        testForEach(exp, s, UnaryOperator.identity());
     }
 
 
     @Test(dataProvider = "HashableIntSpliterator")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testTryAdvance(String description, Collection exp, Supplier<Spliterator> s) {
-        testTryAdvance(exp, s, (Consumer<Object> b) -> b);
+    void testTryAdvance(String description,
+                        Collection<HashableInteger> exp,
+                        Supplier<Spliterator<HashableInteger>> s) {
+        testTryAdvance(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "HashableIntSpliteratorWithNull")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testTryAdvanceWithNull(String description, Collection exp, Supplier<Spliterator> s) {
-        testTryAdvance(exp, s, (Consumer<Object> b) -> b);
+    void testTryAdvanceWithNull(String description,
+                                Collection<HashableInteger> exp,
+                                Supplier<Spliterator<HashableInteger>> s) {
+        testTryAdvance(exp, s, UnaryOperator.identity());
     }
 
-/* skip this test until 8013649 is fixed
-    @Test(dataProvider = "HashableIntSpliterator")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testMixedTryAdvanceForEach(String description, Collection exp, Supplier<Spliterator> s) {
-        testMixedTryAdvanceForEach(exp, s, (Consumer<Object> b) -> b);
-    }
-
-    @Test(dataProvider = "HashableIntSpliteratorWithNull")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testMixedTryAdvanceForEachWithNull(String description, Collection exp, Supplier<Spliterator> s) {
-        testMixedTryAdvanceForEach(exp, s, (Consumer<Object> b) -> b);
-    }
-*/
-
     @Test(dataProvider = "HashableIntSpliterator")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitAfterFullTraversal(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitAfterFullTraversal(s, (Consumer<Object> b) -> b);
+    void testMixedTryAdvanceForEach(String description,
+                                    Collection<HashableInteger> exp,
+                                    Supplier<Spliterator<HashableInteger>> s) {
+        testMixedTryAdvanceForEach(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "HashableIntSpliteratorWithNull")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitAfterFullTraversalWithNull(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitAfterFullTraversal(s, (Consumer<Object> b) -> b);
+    void testMixedTryAdvanceForEachWithNull(String description,
+                                            Collection<HashableInteger> exp,
+                                            Supplier<Spliterator<HashableInteger>> s) {
+        testMixedTryAdvanceForEach(exp, s, UnaryOperator.identity());
+    }
+
+    @Test(dataProvider = "HashableIntSpliterator")
+    void testMixedTraverseAndSplit(String description,
+                                   Collection<HashableInteger> exp,
+                                   Supplier<Spliterator<HashableInteger>> s) {
+        testMixedTraverseAndSplit(exp, s, UnaryOperator.identity());
+    }
+
+    @Test(dataProvider = "HashableIntSpliteratorWithNull")
+    void testMixedTraverseAndSplitWithNull(String description,
+                                           Collection<HashableInteger> exp,
+                                           Supplier<Spliterator<HashableInteger>> s) {
+        testMixedTraverseAndSplit(exp, s, UnaryOperator.identity());
+    }
+
+    @Test(dataProvider = "HashableIntSpliterator")
+    void testSplitAfterFullTraversal(String description,
+                                     Collection<HashableInteger> exp,
+                                     Supplier<Spliterator<HashableInteger>> s) {
+        testSplitAfterFullTraversal(s, UnaryOperator.identity());
+    }
+
+    @Test(dataProvider = "HashableIntSpliteratorWithNull")
+    void testSplitAfterFullTraversalWithNull(String description,
+                                             Collection<HashableInteger> exp,
+                                             Supplier<Spliterator<HashableInteger>> s) {
+        testSplitAfterFullTraversal(s, UnaryOperator.identity());
     }
 
 
     @Test(dataProvider = "HashableIntSpliterator")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitOnce(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitOnce(exp, s, (Consumer<Object> b) -> b);
+    void testSplitOnce(String description,
+                       Collection<HashableInteger> exp,
+                       Supplier<Spliterator<HashableInteger>> s) {
+        testSplitOnce(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "HashableIntSpliteratorWithNull")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitOnceWithNull(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitOnce(exp, s, (Consumer<Object> b) -> b);
+    void testSplitOnceWithNull(String description,
+                               Collection<HashableInteger> exp,
+                               Supplier<Spliterator<HashableInteger>> s) {
+        testSplitOnce(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "HashableIntSpliterator")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitSixDeep(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitSixDeep(exp, s, (Consumer<Object> b) -> b);
+    void testSplitSixDeep(String description,
+                          Collection<HashableInteger> exp,
+                          Supplier<Spliterator<HashableInteger>> s) {
+        testSplitSixDeep(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "HashableIntSpliteratorWithNull")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitSixDeepWithNull(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitSixDeep(exp, s, (Consumer<Object> b) -> b);
+    void testSplitSixDeepWithNull(String description,
+                                  Collection<HashableInteger> exp,
+                                  Supplier<Spliterator<HashableInteger>> s) {
+        testSplitSixDeep(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "HashableIntSpliterator")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitUntilNull(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitUntilNull(exp, s, (Consumer<Object> b) -> b);
+    void testSplitUntilNull(String description,
+                            Collection<HashableInteger> exp,
+                            Supplier<Spliterator<HashableInteger>> s) {
+        testSplitUntilNull(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "HashableIntSpliteratorWithNull")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitUntilNullWithNull(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitUntilNull(exp, s, (Consumer<Object> b) -> b);
-    }
-
-    private static <T, S extends Spliterator<T>> void testForEach(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        ArrayList<T> fromForEach = new ArrayList<>();
-        spliterator = supplier.get();
-        Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add);
-        spliterator.forEachRemaining(addToFromForEach);
-
-        // Assert that forEach now produces no elements
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-        // Assert that tryAdvance now produce no elements
-        spliterator.tryAdvance(boxingAdapter.apply(e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-        // assert that size, tryAdvance, and forEach are consistent
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, exp.size());
-        }
-        if (exp.contains(null)) {
-            assertTrue(fromForEach.contains(null));
-        }
-        assertEquals(fromForEach.size(), exp.size());
-
-        assertContents(fromForEach, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testTryAdvance(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        spliterator = supplier.get();
-        ArrayList<T> fromTryAdvance = new ArrayList<>();
-        Consumer<T> addToFromTryAdvance = boxingAdapter.apply(fromTryAdvance::add);
-        while (spliterator.tryAdvance(addToFromTryAdvance)) { }
-
-        // Assert that forEach now produces no elements
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-        // Assert that tryAdvance now produce no elements
-        spliterator.tryAdvance(boxingAdapter.apply(e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-        // assert that size, tryAdvance, and forEach are consistent
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, exp.size());
-        }
-        assertEquals(fromTryAdvance.size(), exp.size());
-
-        assertContents(fromTryAdvance, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testMixedTryAdvanceForEach(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        // tryAdvance first few elements, then forEach rest
-        ArrayList<T> dest = new ArrayList<>();
-        spliterator = supplier.get();
-        Consumer<T> addToDest = boxingAdapter.apply(dest::add);
-        for (int i = 0; i < 10 && spliterator.tryAdvance(addToDest); i++) { }
-        spliterator.forEachRemaining(addToDest);
-
-        // Assert that forEach now produces no elements
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-        // Assert that tryAdvance now produce no elements
-        spliterator.tryAdvance(boxingAdapter.apply(e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, dest.size());
-        }
-        assertEquals(dest.size(), exp.size());
-
-        if (isOrdered) {
-            assertEquals(dest, exp);
-        }
-        else {
-            assertContentsUnordered(dest, exp);
-        }
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitAfterFullTraversal(
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        // Full traversal using tryAdvance
-        Spliterator<T> spliterator = supplier.get();
-        while (spliterator.tryAdvance(boxingAdapter.apply(e -> { }))) { }
-        Spliterator<T> split = spliterator.trySplit();
-        assertNull(split);
-
-        // Full traversal using forEach
-        spliterator = supplier.get();
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> {
-        }));
-        split = spliterator.trySplit();
-        assertNull(split);
-
-        // Full traversal using tryAdvance then forEach
-        spliterator = supplier.get();
-        spliterator.tryAdvance(boxingAdapter.apply(e -> { }));
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> {
-        }));
-        split = spliterator.trySplit();
-        assertNull(split);
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitOnce(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        ArrayList<T> fromSplit = new ArrayList<>();
-        Spliterator<T> s1 = supplier.get();
-        Spliterator<T> s2 = s1.trySplit();
-        long s1Size = s1.getExactSizeIfKnown();
-        long s2Size = (s2 != null) ? s2.getExactSizeIfKnown() : 0;
-
-        Consumer<T> addToFromSplit = boxingAdapter.apply(fromSplit::add);
-        if (s2 != null)
-            s2.forEachRemaining(addToFromSplit);
-        s1.forEachRemaining(addToFromSplit);
-
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, fromSplit.size());
-            if (s1Size >= 0 && s2Size >= 0)
-                assertEquals(sizeIfKnown, s1Size + s2Size);
-        }
-        assertContents(fromSplit, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitSixDeep(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        for (int depth=0; depth < 6; depth++) {
-            List<T> dest = new ArrayList<>();
-            spliterator = supplier.get();
-
-            assertSpliterator(spliterator);
-
-            // verify splitting with forEach
-            visit(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), false);
-            assertContents(dest, exp, isOrdered);
-
-            // verify splitting with tryAdvance
-            dest.clear();
-            spliterator = supplier.get();
-            visit(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), true);
-            assertContents(dest, exp, isOrdered);
-        }
-    }
-
-    private static <T, S extends Spliterator<T>> void visit(int depth, int curLevel,
-                                                            List<T> dest, S spliterator, UnaryOperator<Consumer<T>> boxingAdapter,
-                                                            int rootCharacteristics, boolean useTryAdvance) {
-        if (curLevel < depth) {
-            long beforeSize = spliterator.getExactSizeIfKnown();
-            Spliterator<T> split = spliterator.trySplit();
-            if (split != null) {
-                assertSpliterator(split, rootCharacteristics);
-                assertSpliterator(spliterator, rootCharacteristics);
-
-                if ((rootCharacteristics & Spliterator.SUBSIZED) != 0 &&
-                    (rootCharacteristics & Spliterator.SIZED) != 0) {
-                    assertEquals(beforeSize, split.estimateSize() + spliterator.estimateSize());
-                }
-                visit(depth, curLevel + 1, dest, split, boxingAdapter, rootCharacteristics, useTryAdvance);
-            }
-            visit(depth, curLevel + 1, dest, spliterator, boxingAdapter, rootCharacteristics, useTryAdvance);
-        }
-        else {
-            long sizeIfKnown = spliterator.getExactSizeIfKnown();
-            if (useTryAdvance) {
-                Consumer<T> addToDest = boxingAdapter.apply(dest::add);
-                int count = 0;
-                while (spliterator.tryAdvance(addToDest)) {
-                    ++count;
-                }
-
-                if (sizeIfKnown >= 0)
-                    assertEquals(sizeIfKnown, count);
-
-                // Assert that forEach now produces no elements
-                spliterator.forEachRemaining(boxingAdapter.apply(e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-
-                Spliterator<T> split = spliterator.trySplit();
-                assertNull(split);
-            }
-            else {
-                List<T> leafDest = new ArrayList<>();
-                Consumer<T> addToLeafDest = boxingAdapter.apply(leafDest::add);
-                spliterator.forEachRemaining(addToLeafDest);
-
-                if (sizeIfKnown >= 0)
-                    assertEquals(sizeIfKnown, leafDest.size());
-
-                // Assert that forEach now produces no elements
-                spliterator.tryAdvance(boxingAdapter.apply(e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-                Spliterator<T> split = spliterator.trySplit();
-                assertNull(split);
-
-                dest.addAll(leafDest);
-            }
-        }
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitUntilNull(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        Spliterator<T> s = supplier.get();
-        boolean isOrdered = s.hasCharacteristics(Spliterator.ORDERED);
-        assertSpliterator(s);
-
-        List<T> splits = new ArrayList<>();
-        Consumer<T> c = boxingAdapter.apply(splits::add);
-
-        testSplitUntilNull(new SplitNode<T>(c, s));
-        assertContents(splits, exp, isOrdered);
-    }
-
-    private static class SplitNode<T> {
-        // Constant for every node
-        final Consumer<T> c;
-        final int rootCharacteristics;
-
-        final Spliterator<T> s;
-
-        SplitNode(Consumer<T> c, Spliterator<T> s) {
-            this(c, s.characteristics(), s);
-        }
-
-        private SplitNode(Consumer<T> c, int rootCharacteristics, Spliterator<T> s) {
-            this.c = c;
-            this.rootCharacteristics = rootCharacteristics;
-            this.s = s;
-        }
-
-        SplitNode<T> fromSplit(Spliterator<T> split) {
-            return new SplitNode<>(c, rootCharacteristics, split);
-        }
-    }
-
-    /**
-     * Set the maximum stack capacity to 0.25MB. This should be more than enough to detect a bad spliterator
-     * while not unduly disrupting test infrastructure given the test data sizes that are used are small.
-     * Note that j.u.c.ForkJoinPool sets the max queue size to 64M (1 << 26).
-     */
-    private static final int MAXIMUM_STACK_CAPACITY = 1 << 18; // 0.25MB
-
-    private static <T> void testSplitUntilNull(SplitNode<T> e) {
-        // Use an explicit stack to avoid a StackOverflowException when testing a Spliterator
-        // that when repeatedly split produces a right-balanced (and maybe degenerate) tree, or
-        // for a spliterator that is badly behaved.
-        Deque<SplitNode<T>> stack = new ArrayDeque<>();
-        stack.push(e);
-
-        int iteration = 0;
-        while (!stack.isEmpty()) {
-            assertTrue(iteration++ < MAXIMUM_STACK_CAPACITY, "Exceeded maximum stack modification count of 1 << 18");
-
-            e = stack.pop();
-            Spliterator<T> parentAndRightSplit = e.s;
-
-            long parentEstimateSize = parentAndRightSplit.estimateSize();
-            assertTrue(parentEstimateSize >= 0,
-                       String.format("Split size estimate %d < 0", parentEstimateSize));
-
-            long parentSize = parentAndRightSplit.getExactSizeIfKnown();
-            Spliterator<T> leftSplit = parentAndRightSplit.trySplit();
-            if (leftSplit == null) {
-                parentAndRightSplit.forEachRemaining(e.c);
-                continue;
-            }
-
-            assertSpliterator(leftSplit, e.rootCharacteristics);
-            assertSpliterator(parentAndRightSplit, e.rootCharacteristics);
-
-            if (parentEstimateSize != Long.MAX_VALUE && leftSplit.estimateSize() > 0 && parentAndRightSplit.estimateSize() > 0) {
-                assertTrue(leftSplit.estimateSize() < parentEstimateSize,
-                           String.format("Left split size estimate %d >= parent split size estimate %d", leftSplit.estimateSize(), parentEstimateSize));
-                assertTrue(parentAndRightSplit.estimateSize() < parentEstimateSize,
-                           String.format("Right split size estimate %d >= parent split size estimate %d", leftSplit.estimateSize(), parentEstimateSize));
-            }
-            else {
-                assertTrue(leftSplit.estimateSize() <= parentEstimateSize,
-                           String.format("Left split size estimate %d > parent split size estimate %d", leftSplit.estimateSize(), parentEstimateSize));
-                assertTrue(parentAndRightSplit.estimateSize() <= parentEstimateSize,
-                           String.format("Right split size estimate %d > parent split size estimate %d", leftSplit.estimateSize(), parentEstimateSize));
-            }
-
-            long leftSize = leftSplit.getExactSizeIfKnown();
-            long rightSize = parentAndRightSplit.getExactSizeIfKnown();
-            if (parentSize >= 0 && leftSize >= 0 && rightSize >= 0)
-                assertEquals(parentSize, leftSize + rightSize,
-                             String.format("exact left split size %d + exact right split size %d != parent exact split size %d",
-                                           leftSize, rightSize, parentSize));
-
-            // Add right side to stack first so left side is popped off first
-            stack.push(e.fromSplit(parentAndRightSplit));
-            stack.push(e.fromSplit(leftSplit));
-        }
-    }
-
-    private static void assertSpliterator(Spliterator<?> s, int rootCharacteristics) {
-        if ((rootCharacteristics & Spliterator.SUBSIZED) != 0) {
-            assertTrue(s.hasCharacteristics(Spliterator.SUBSIZED),
-                       "Child split is not SUBSIZED when root split is SUBSIZED");
-        }
-        assertSpliterator(s);
-    }
-
-    private static void assertSpliterator(Spliterator<?> s) {
-        if (s.hasCharacteristics(Spliterator.SUBSIZED)) {
-            assertTrue(s.hasCharacteristics(Spliterator.SIZED));
-        }
-        if (s.hasCharacteristics(Spliterator.SIZED)) {
-            assertTrue(s.estimateSize() != Long.MAX_VALUE);
-            assertTrue(s.getExactSizeIfKnown() >= 0);
-        }
-        try {
-            s.getComparator();
-            assertTrue(s.hasCharacteristics(Spliterator.SORTED));
-        } catch (IllegalStateException e) {
-            assertFalse(s.hasCharacteristics(Spliterator.SORTED));
-        }
-    }
-
-    private static<T> void assertContents(Collection<T> actual, Collection<T> expected, boolean isOrdered) {
-        if (isOrdered) {
-            assertEquals(actual, expected);
-        }
-        else {
-            assertContentsUnordered(actual, expected);
-        }
-    }
-
-    private static<T> void assertContentsUnordered(Iterable<T> actual, Iterable<T> expected) {
-        assertEquals(toBoxedMultiset(actual), toBoxedMultiset(expected));
-    }
-
-    private static <T> Map<T, HashableInteger> toBoxedMultiset(Iterable<T> c) {
-        Map<T, HashableInteger> result = new HashMap<>();
-        c.forEach(e -> {
-            if (result.containsKey(e)) {
-                result.put(e, new HashableInteger(result.get(e).value + 1, 10));
-            } else {
-                result.put(e, new HashableInteger(1, 10));
-            }
-        });
-        return result;
-    }
-
-    private void executeAndCatch(Class<? extends Exception> expected, Runnable r) {
-        Exception caught = null;
-        try {
-            r.run();
-        }
-        catch (Exception e) {
-            caught = e;
-        }
-
-        assertNotNull(caught,
-                      String.format("No Exception was thrown, expected an Exception of %s to be thrown",
-                                    expected.getName()));
-        assertTrue(expected.isInstance(caught),
-                   String.format("Exception thrown %s not an instance of %s",
-                                 caught.getClass().getName(), expected.getName()));
+    void testSplitUntilNullWithNull(String description,
+                                    Collection<HashableInteger> exp,
+                                    Supplier<Spliterator<HashableInteger>> s) {
+        testSplitUntilNull(exp, s, UnaryOperator.identity());
     }
 
 }
diff --git a/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java b/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java
index a8338ca..eb3647a 100644
--- a/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java
+++ b/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
 /**
  * @test
  * @summary Spliterator traversing and splitting tests
+ * @library ../stream/bootlib
+ * @build java.base/java.util.SpliteratorTestHelper
  * @run testng SpliteratorTraversingAndSplittingTest
  * @bug 8020016 8071477 8072784 8169838
  */
@@ -42,7 +44,6 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.Deque;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.IdentityHashMap;
@@ -58,6 +59,7 @@
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 import java.util.Spliterators;
 import java.util.Stack;
 import java.util.TreeMap;
@@ -85,11 +87,8 @@
 import java.util.stream.IntStream;
 
 import static java.util.stream.Collectors.toList;
-import static org.testng.Assert.*;
-import static org.testng.Assert.assertEquals;
 
-@Test
-public class SpliteratorTraversingAndSplittingTest {
+public class SpliteratorTraversingAndSplittingTest extends SpliteratorTestHelper {
 
     private static final List<Integer> SIZES = Arrays.asList(0, 1, 10, 42);
 
@@ -668,52 +667,49 @@
     }
 
     @Test(dataProvider = "Spliterator<Integer>")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testNullPointerException(String description, Collection exp, Supplier<Spliterator> s) {
+    public void testNullPointerException(String description, Collection<Integer> exp, Supplier<Spliterator<Integer>> s) {
         executeAndCatch(NullPointerException.class, () -> s.get().forEachRemaining(null));
         executeAndCatch(NullPointerException.class, () -> s.get().tryAdvance(null));
     }
 
     @Test(dataProvider = "Spliterator<Integer>")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testForEach(String description, Collection exp, Supplier<Spliterator> s) {
-        testForEach(exp, s, (Consumer<Object> b) -> b);
+    public void testForEach(String description, Collection<Integer> exp, Supplier<Spliterator<Integer>> s) {
+        testForEach(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "Spliterator<Integer>")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testTryAdvance(String description, Collection exp, Supplier<Spliterator> s) {
-        testTryAdvance(exp, s, (Consumer<Object> b) -> b);
+    public void testTryAdvance(String description, Collection<Integer> exp, Supplier<Spliterator<Integer>> s) {
+        testTryAdvance(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "Spliterator<Integer>")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testMixedTryAdvanceForEach(String description, Collection exp, Supplier<Spliterator> s) {
-        testMixedTryAdvanceForEach(exp, s, (Consumer<Object> b) -> b);
+    public void testMixedTryAdvanceForEach(String description, Collection<Integer> exp, Supplier<Spliterator<Integer>> s) {
+        testMixedTryAdvanceForEach(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "Spliterator<Integer>")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitAfterFullTraversal(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitAfterFullTraversal(s, (Consumer<Object> b) -> b);
+    public void testMixedTraverseAndSplit(String description, Collection<Integer> exp, Supplier<Spliterator<Integer>> s) {
+        testMixedTraverseAndSplit(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "Spliterator<Integer>")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitOnce(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitOnce(exp, s, (Consumer<Object> b) -> b);
+    public void testSplitAfterFullTraversal(String description, Collection<Integer> exp, Supplier<Spliterator<Integer>> s) {
+        testSplitAfterFullTraversal(s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "Spliterator<Integer>")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitSixDeep(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitSixDeep(exp, s, (Consumer<Object> b) -> b);
+    public void testSplitOnce(String description, Collection<Integer> exp, Supplier<Spliterator<Integer>> s) {
+        testSplitOnce(exp, s, UnaryOperator.identity());
     }
 
     @Test(dataProvider = "Spliterator<Integer>")
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public void testSplitUntilNull(String description, Collection exp, Supplier<Spliterator> s) {
-        testSplitUntilNull(exp, s, (Consumer<Object> b) -> b);
+    public void testSplitSixDeep(String description, Collection<Integer> exp, Supplier<Spliterator<Integer>> s) {
+        testSplitSixDeep(exp, s, UnaryOperator.identity());
+    }
+
+    @Test(dataProvider = "Spliterator<Integer>")
+    public void testSplitUntilNull(String description, Collection<Integer> exp, Supplier<Spliterator<Integer>> s) {
+        testSplitUntilNull(exp, s, UnaryOperator.identity());
     }
 
     //
@@ -922,28 +918,6 @@
         return exp;
     }
 
-    private static UnaryOperator<Consumer<Integer>> intBoxingConsumer() {
-        class BoxingAdapter implements Consumer<Integer>, IntConsumer {
-            private final Consumer<Integer> b;
-
-            BoxingAdapter(Consumer<Integer> b) {
-                this.b = b;
-            }
-
-            @Override
-            public void accept(Integer value) {
-                throw new IllegalStateException();
-            }
-
-            @Override
-            public void accept(int value) {
-                b.accept(value);
-            }
-        }
-
-        return b -> new BoxingAdapter(b);
-    }
-
     @Test(dataProvider = "Spliterator.OfInt")
     public void testIntNullPointerException(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
         executeAndCatch(NullPointerException.class, () -> s.get().forEachRemaining((IntConsumer) null));
@@ -966,6 +940,11 @@
     }
 
     @Test(dataProvider = "Spliterator.OfInt")
+    public void testIntMixedTraverseAndSplit(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
+        testMixedTraverseAndSplit(exp, s, intBoxingConsumer());
+    }
+
+    @Test(dataProvider = "Spliterator.OfInt")
     public void testIntSplitAfterFullTraversal(String description, Collection<Integer> exp, Supplier<Spliterator.OfInt> s) {
         testSplitAfterFullTraversal(s, intBoxingConsumer());
     }
@@ -1082,28 +1061,6 @@
         return exp;
     }
 
-    private static UnaryOperator<Consumer<Long>> longBoxingConsumer() {
-        class BoxingAdapter implements Consumer<Long>, LongConsumer {
-            private final Consumer<Long> b;
-
-            BoxingAdapter(Consumer<Long> b) {
-                this.b = b;
-            }
-
-            @Override
-            public void accept(Long value) {
-                throw new IllegalStateException();
-            }
-
-            @Override
-            public void accept(long value) {
-                b.accept(value);
-            }
-        }
-
-        return b -> new BoxingAdapter(b);
-    }
-
     @Test(dataProvider = "Spliterator.OfLong")
     public void testLongNullPointerException(String description, Collection<Long> exp, Supplier<Spliterator.OfLong> s) {
         executeAndCatch(NullPointerException.class, () -> s.get().forEachRemaining((LongConsumer) null));
@@ -1126,6 +1083,11 @@
     }
 
     @Test(dataProvider = "Spliterator.OfLong")
+    public void testLongMixedTraverseAndSplit(String description, Collection<Long> exp, Supplier<Spliterator.OfLong> s) {
+        testMixedTraverseAndSplit(exp, s, longBoxingConsumer());
+    }
+
+    @Test(dataProvider = "Spliterator.OfLong")
     public void testLongSplitAfterFullTraversal(String description, Collection<Long> exp, Supplier<Spliterator.OfLong> s) {
         testSplitAfterFullTraversal(s, longBoxingConsumer());
     }
@@ -1242,28 +1204,6 @@
         return exp;
     }
 
-    private static UnaryOperator<Consumer<Double>> doubleBoxingConsumer() {
-        class BoxingAdapter implements Consumer<Double>, DoubleConsumer {
-            private final Consumer<Double> b;
-
-            BoxingAdapter(Consumer<Double> b) {
-                this.b = b;
-            }
-
-            @Override
-            public void accept(Double value) {
-                throw new IllegalStateException();
-            }
-
-            @Override
-            public void accept(double value) {
-                b.accept(value);
-            }
-        }
-
-        return b -> new BoxingAdapter(b);
-    }
-
     @Test(dataProvider = "Spliterator.OfDouble")
     public void testDoubleNullPointerException(String description, Collection<Double> exp, Supplier<Spliterator.OfDouble> s) {
         executeAndCatch(NullPointerException.class, () -> s.get().forEachRemaining((DoubleConsumer) null));
@@ -1286,6 +1226,11 @@
     }
 
     @Test(dataProvider = "Spliterator.OfDouble")
+    public void testDoubleMixedTraverseAndSplit(String description, Collection<Double> exp, Supplier<Spliterator.OfDouble> s) {
+        testMixedTraverseAndSplit(exp, s, doubleBoxingConsumer());
+    }
+
+    @Test(dataProvider = "Spliterator.OfDouble")
     public void testDoubleSplitAfterFullTraversal(String description, Collection<Double> exp, Supplier<Spliterator.OfDouble> s) {
         testSplitAfterFullTraversal(s, doubleBoxingConsumer());
     }
@@ -1305,392 +1250,4 @@
         testSplitUntilNull(exp, s, doubleBoxingConsumer());
     }
 
-    //
-
-    private static <T, S extends Spliterator<T>> void testForEach(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        ArrayList<T> fromForEach = new ArrayList<>();
-        spliterator = supplier.get();
-        Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add);
-        spliterator.forEachRemaining(addToFromForEach);
-
-        // Assert that forEach now produces no elements
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-        // Assert that tryAdvance now produce no elements
-        spliterator.tryAdvance(boxingAdapter.apply(e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-        // assert that size, tryAdvance, and forEach are consistent
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, exp.size());
-        }
-        assertEquals(fromForEach.size(), exp.size());
-
-        assertContents(fromForEach, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testTryAdvance(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        spliterator = supplier.get();
-        ArrayList<T> fromTryAdvance = new ArrayList<>();
-        Consumer<T> addToFromTryAdvance = boxingAdapter.apply(fromTryAdvance::add);
-        while (spliterator.tryAdvance(addToFromTryAdvance)) { }
-
-        // Assert that forEach now produces no elements
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-        // Assert that tryAdvance now produce no elements
-        spliterator.tryAdvance(boxingAdapter.apply(e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-        // assert that size, tryAdvance, and forEach are consistent
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, exp.size());
-        }
-        assertEquals(fromTryAdvance.size(), exp.size());
-
-        assertContents(fromTryAdvance, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testMixedTryAdvanceForEach(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        // tryAdvance first few elements, then forEach rest
-        ArrayList<T> dest = new ArrayList<>();
-        spliterator = supplier.get();
-        Consumer<T> addToDest = boxingAdapter.apply(dest::add);
-        for (int i = 0; i < 10 && spliterator.tryAdvance(addToDest); i++) { }
-        spliterator.forEachRemaining(addToDest);
-
-        // Assert that forEach now produces no elements
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-        // Assert that tryAdvance now produce no elements
-        spliterator.tryAdvance(boxingAdapter.apply(e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, dest.size());
-        }
-        assertEquals(dest.size(), exp.size());
-
-        if (isOrdered) {
-            assertEquals(dest, exp);
-        }
-        else {
-            assertContentsUnordered(dest, exp);
-        }
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitAfterFullTraversal(
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        // Full traversal using tryAdvance
-        Spliterator<T> spliterator = supplier.get();
-        while (spliterator.tryAdvance(boxingAdapter.apply(e -> { }))) { }
-        Spliterator<T> split = spliterator.trySplit();
-        assertNull(split);
-
-        // Full traversal using forEach
-        spliterator = supplier.get();
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> {
-        }));
-        split = spliterator.trySplit();
-        assertNull(split);
-
-        // Full traversal using tryAdvance then forEach
-        spliterator = supplier.get();
-        spliterator.tryAdvance(boxingAdapter.apply(e -> { }));
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> {
-        }));
-        split = spliterator.trySplit();
-        assertNull(split);
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitOnce(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        ArrayList<T> fromSplit = new ArrayList<>();
-        Spliterator<T> s1 = supplier.get();
-        Spliterator<T> s2 = s1.trySplit();
-        long s1Size = s1.getExactSizeIfKnown();
-        long s2Size = (s2 != null) ? s2.getExactSizeIfKnown() : 0;
-        Consumer<T> addToFromSplit = boxingAdapter.apply(fromSplit::add);
-        if (s2 != null)
-            s2.forEachRemaining(addToFromSplit);
-        s1.forEachRemaining(addToFromSplit);
-
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, fromSplit.size());
-            if (s1Size >= 0 && s2Size >= 0)
-                assertEquals(sizeIfKnown, s1Size + s2Size);
-        }
-        assertContents(fromSplit, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitSixDeep(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        S spliterator = supplier.get();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        for (int depth=0; depth < 6; depth++) {
-            List<T> dest = new ArrayList<>();
-            spliterator = supplier.get();
-
-            assertRootSpliterator(spliterator);
-
-            // verify splitting with forEach
-            visit(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), false);
-            assertContents(dest, exp, isOrdered);
-
-            // verify splitting with tryAdvance
-            dest.clear();
-            spliterator = supplier.get();
-            visit(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), true);
-            assertContents(dest, exp, isOrdered);
-        }
-    }
-
-    private static <T, S extends Spliterator<T>> void visit(int depth, int curLevel,
-                                                            List<T> dest, S spliterator, UnaryOperator<Consumer<T>> boxingAdapter,
-                                                            int rootCharacteristics, boolean useTryAdvance) {
-        if (curLevel < depth) {
-            long beforeSize = spliterator.getExactSizeIfKnown();
-            Spliterator<T> split = spliterator.trySplit();
-            if (split != null) {
-                assertSpliterator(split, rootCharacteristics);
-                assertSpliterator(spliterator, rootCharacteristics);
-
-                if ((rootCharacteristics & Spliterator.SUBSIZED) != 0 &&
-                    (rootCharacteristics & Spliterator.SIZED) != 0) {
-                    assertEquals(beforeSize, split.estimateSize() + spliterator.estimateSize());
-                }
-                visit(depth, curLevel + 1, dest, split, boxingAdapter, rootCharacteristics, useTryAdvance);
-            }
-            visit(depth, curLevel + 1, dest, spliterator, boxingAdapter, rootCharacteristics, useTryAdvance);
-        }
-        else {
-            long sizeIfKnown = spliterator.getExactSizeIfKnown();
-            if (useTryAdvance) {
-                Consumer<T> addToDest = boxingAdapter.apply(dest::add);
-                int count = 0;
-                while (spliterator.tryAdvance(addToDest)) {
-                    ++count;
-                }
-
-                if (sizeIfKnown >= 0)
-                    assertEquals(sizeIfKnown, count);
-
-                // Assert that forEach now produces no elements
-                spliterator.forEachRemaining(boxingAdapter.apply(e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-
-                Spliterator<T> split = spliterator.trySplit();
-                assertNull(split);
-            }
-            else {
-                List<T> leafDest = new ArrayList<>();
-                Consumer<T> addToLeafDest = boxingAdapter.apply(leafDest::add);
-                spliterator.forEachRemaining(addToLeafDest);
-
-                if (sizeIfKnown >= 0)
-                    assertEquals(sizeIfKnown, leafDest.size());
-
-                // Assert that forEach now produces no elements
-                spliterator.tryAdvance(boxingAdapter.apply(e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-                Spliterator<T> split = spliterator.trySplit();
-                assertNull(split);
-
-                dest.addAll(leafDest);
-            }
-        }
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitUntilNull(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        Spliterator<T> s = supplier.get();
-        boolean isOrdered = s.hasCharacteristics(Spliterator.ORDERED);
-        assertRootSpliterator(s);
-
-        List<T> splits = new ArrayList<>();
-        Consumer<T> c = boxingAdapter.apply(splits::add);
-
-        testSplitUntilNull(new SplitNode<T>(c, s));
-        assertContents(splits, exp, isOrdered);
-    }
-
-    private static class SplitNode<T> {
-        // Constant for every node
-        final Consumer<T> c;
-        final int rootCharacteristics;
-
-        final Spliterator<T> s;
-
-        SplitNode(Consumer<T> c, Spliterator<T> s) {
-            this(c, s.characteristics(), s);
-        }
-
-        private SplitNode(Consumer<T> c, int rootCharacteristics, Spliterator<T> s) {
-            this.c = c;
-            this.rootCharacteristics = rootCharacteristics;
-            this.s = s;
-        }
-
-        SplitNode<T> fromSplit(Spliterator<T> split) {
-            return new SplitNode<>(c, rootCharacteristics, split);
-        }
-    }
-
-    /**
-     * Set the maximum stack capacity to 0.25MB. This should be more than enough to detect a bad spliterator
-     * while not unduly disrupting test infrastructure given the test data sizes that are used are small.
-     * Note that j.u.c.ForkJoinPool sets the max queue size to 64M (1 << 26).
-     */
-    private static final int MAXIMUM_STACK_CAPACITY = 1 << 18; // 0.25MB
-
-    private static <T> void testSplitUntilNull(SplitNode<T> e) {
-        // Use an explicit stack to avoid a StackOverflowException when testing a Spliterator
-        // that when repeatedly split produces a right-balanced (and maybe degenerate) tree, or
-        // for a spliterator that is badly behaved.
-        Deque<SplitNode<T>> stack = new ArrayDeque<>();
-        stack.push(e);
-
-        int iteration = 0;
-        while (!stack.isEmpty()) {
-            assertTrue(iteration++ < MAXIMUM_STACK_CAPACITY, "Exceeded maximum stack modification count of 1 << 18");
-
-            e = stack.pop();
-            Spliterator<T> parentAndRightSplit = e.s;
-
-            long parentEstimateSize = parentAndRightSplit.estimateSize();
-            assertTrue(parentEstimateSize >= 0,
-                       String.format("Split size estimate %d < 0", parentEstimateSize));
-
-            long parentSize = parentAndRightSplit.getExactSizeIfKnown();
-            Spliterator<T> leftSplit = parentAndRightSplit.trySplit();
-            if (leftSplit == null) {
-                parentAndRightSplit.forEachRemaining(e.c);
-                continue;
-            }
-
-            assertSpliterator(leftSplit, e.rootCharacteristics);
-            assertSpliterator(parentAndRightSplit, e.rootCharacteristics);
-
-            if (parentEstimateSize != Long.MAX_VALUE && leftSplit.estimateSize() > 0 && parentAndRightSplit.estimateSize() > 0) {
-                assertTrue(leftSplit.estimateSize() < parentEstimateSize,
-                           String.format("Left split size estimate %d >= parent split size estimate %d", leftSplit.estimateSize(), parentEstimateSize));
-                assertTrue(parentAndRightSplit.estimateSize() < parentEstimateSize,
-                           String.format("Right split size estimate %d >= parent split size estimate %d", leftSplit.estimateSize(), parentEstimateSize));
-            }
-            else {
-                assertTrue(leftSplit.estimateSize() <= parentEstimateSize,
-                           String.format("Left split size estimate %d > parent split size estimate %d", leftSplit.estimateSize(), parentEstimateSize));
-                assertTrue(parentAndRightSplit.estimateSize() <= parentEstimateSize,
-                           String.format("Right split size estimate %d > parent split size estimate %d", leftSplit.estimateSize(), parentEstimateSize));
-            }
-
-            long leftSize = leftSplit.getExactSizeIfKnown();
-            long rightSize = parentAndRightSplit.getExactSizeIfKnown();
-            if (parentSize >= 0 && leftSize >= 0 && rightSize >= 0)
-                assertEquals(parentSize, leftSize + rightSize,
-                             String.format("exact left split size %d + exact right split size %d != parent exact split size %d",
-                                           leftSize, rightSize, parentSize));
-
-            // Add right side to stack first so left side is popped off first
-            stack.push(e.fromSplit(parentAndRightSplit));
-            stack.push(e.fromSplit(leftSplit));
-        }
-    }
-
-    private static void assertRootSpliterator(Spliterator<?> s) {
-        assertFalse(s.hasCharacteristics(Spliterator.SIZED | Spliterator.CONCURRENT),
-                    "Root spliterator should not be SIZED and CONCURRENT");
-
-        assertSpliterator(s);
-    }
-
-    private static void assertSpliterator(Spliterator<?> s, int rootCharacteristics) {
-        if ((rootCharacteristics & Spliterator.SUBSIZED) != 0) {
-            assertTrue(s.hasCharacteristics(Spliterator.SUBSIZED),
-                       "Child split is not SUBSIZED when root split is SUBSIZED");
-        }
-        assertSpliterator(s);
-    }
-
-    private static void assertSpliterator(Spliterator<?> s) {
-        if (s.hasCharacteristics(Spliterator.SUBSIZED)) {
-            assertTrue(s.hasCharacteristics(Spliterator.SIZED));
-        }
-        if (s.hasCharacteristics(Spliterator.SIZED)) {
-            assertTrue(s.estimateSize() != Long.MAX_VALUE);
-            assertTrue(s.getExactSizeIfKnown() >= 0);
-        }
-        try {
-            s.getComparator();
-            assertTrue(s.hasCharacteristics(Spliterator.SORTED));
-        } catch (IllegalStateException e) {
-            assertFalse(s.hasCharacteristics(Spliterator.SORTED));
-        }
-    }
-
-    private static<T> void assertContents(Collection<T> actual, Collection<T> expected, boolean isOrdered) {
-        if (isOrdered) {
-            assertEquals(actual, expected);
-        }
-        else {
-            assertContentsUnordered(actual, expected);
-        }
-    }
-
-    private static<T> void assertContentsUnordered(Iterable<T> actual, Iterable<T> expected) {
-        assertEquals(toBoxedMultiset(actual), toBoxedMultiset(expected));
-    }
-
-    private static <T> Map<T, Integer> toBoxedMultiset(Iterable<T> c) {
-        Map<T, Integer> result = new HashMap<>();
-        c.forEach(e -> {
-            if (result.containsKey(e)) result.put(e, result.get(e) + 1);
-            else result.put(e, 1);
-        });
-        return result;
-    }
-
-    private void executeAndCatch(Class<? extends Exception> expected, Runnable r) {
-        Exception caught = null;
-        try {
-            r.run();
-        }
-        catch (Exception e) {
-            caught = e;
-        }
-
-        assertNotNull(caught,
-                      String.format("No Exception was thrown, expected an Exception of %s to be thrown",
-                                    expected.getName()));
-        assertTrue(expected.isInstance(caught),
-                   String.format("Exception thrown %s not an instance of %s",
-                                 caught.getClass().getName(), expected.getName()));
-    }
-
 }
diff --git a/jdk/test/java/util/TimeZone/UTCAliasTest.java b/jdk/test/java/util/TimeZone/UTCAliasTest.java
index aa70793..ffe7b63 100644
--- a/jdk/test/java/util/TimeZone/UTCAliasTest.java
+++ b/jdk/test/java/util/TimeZone/UTCAliasTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
  * @summary Make sure that "UTC" is an alias of "Etc/UTC" as defined in the tzdata backward.
  * @modules java.base/sun.util.calendar
  * @compile -XDignore.symbol.file UTCAliasTest.java
+ * @run main UTCAliasTest
  */
 
 import java.util.*;
diff --git a/jdk/test/java/util/concurrent/ArrayBlockingQueue/IteratorConsistency.java b/jdk/test/java/util/concurrent/ArrayBlockingQueue/IteratorConsistency.java
deleted file mode 100644
index 0068e38..0000000
--- a/jdk/test/java/util/concurrent/ArrayBlockingQueue/IteratorConsistency.java
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file is available under and governed by the GNU General Public
- * License version 2 only, as published by the Free Software Foundation.
- * However, the following notice accompanied the original version of this
- * file:
- *
- * Written by Martin Buchholz with assistance from members of JCP
- * JSR-166 Expert Group and released to the public domain, as
- * explained at http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.ArrayDeque;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Queue;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ThreadLocalRandom;
-
-/*
- * @test
- * @bug 7014263
- * @modules java.base/java.util.concurrent:open
- * @summary White box testing of ArrayBlockingQueue iterators.
- */
-
-/**
- * Tightly coupled to the implementation of ArrayBlockingQueue.
- * Uses reflection to inspect queue and iterator state.
- */
-@SuppressWarnings({"unchecked", "rawtypes"})
-public class IteratorConsistency {
-    final ThreadLocalRandom rnd = ThreadLocalRandom.current();
-    final int CAPACITY = 20;
-    Field itrsField;
-    Field itemsField;
-    Field takeIndexField;
-    Field headField;
-    Field nextField;
-    Field prevTakeIndexField;
-
-    void test(String[] args) throws Throwable {
-        itrsField = ArrayBlockingQueue.class.getDeclaredField("itrs");
-        itemsField = ArrayBlockingQueue.class.getDeclaredField("items");
-        takeIndexField = ArrayBlockingQueue.class.getDeclaredField("takeIndex");
-        headField = Class.forName("java.util.concurrent.ArrayBlockingQueue$Itrs").getDeclaredField("head");
-        nextField = Class.forName("java.util.concurrent.ArrayBlockingQueue$Itrs$Node").getDeclaredField("next");
-        prevTakeIndexField = Class.forName("java.util.concurrent.ArrayBlockingQueue$Itr").getDeclaredField("prevTakeIndex");
-        itrsField.setAccessible(true);
-        itemsField.setAccessible(true);
-        takeIndexField.setAccessible(true);
-        headField.setAccessible(true);
-        nextField.setAccessible(true);
-        prevTakeIndexField.setAccessible(true);
-        test(CAPACITY, true);
-        test(CAPACITY, false);
-    }
-
-    Object itrs(ArrayBlockingQueue q) {
-        try { return itrsField.get(q); }
-        catch (Throwable ex) { throw new AssertionError(ex); }
-    }
-
-    int takeIndex(ArrayBlockingQueue q) {
-        try { return takeIndexField.getInt(q); }
-        catch (Throwable ex) { throw new AssertionError(ex); }
-    }
-
-    List<Iterator> trackedIterators(Object itrs) {
-        try {
-            List<Iterator> its = new ArrayList<>();
-            if (itrs != null)
-                for (Object p = headField.get(itrs); p != null; p = nextField.get(p))
-                    its.add(((WeakReference<Iterator>)(p)).get());
-            Collections.reverse(its);
-            return its;
-        } catch (Throwable ex) { throw new AssertionError(ex); }
-    }
-
-    List<Iterator> trackedIterators(ArrayBlockingQueue q) {
-        return trackedIterators(itrs(q));
-    }
-
-    List<Iterator> attachedIterators(Object itrs) {
-        try {
-            List<Iterator> its = new ArrayList<>();
-            if (itrs != null)
-                for (Object p = headField.get(itrs); p != null; p = nextField.get(p)) {
-                    Iterator it = ((WeakReference<Iterator>)(p)).get();
-                    if (it != null && !isDetached(it))
-                        its.add(it);
-                }
-            Collections.reverse(its);
-            return its;
-        } catch (Throwable ex) { unexpected(ex); return null; }
-    }
-
-    List<Iterator> attachedIterators(ArrayBlockingQueue q) {
-        return attachedIterators(itrs(q));
-    }
-
-    Object[] internalArray(ArrayBlockingQueue q) {
-        try { return (Object[]) itemsField.get(q); }
-        catch (Throwable ex) { throw new AssertionError(ex); }
-    }
-
-    void printInternalArray(ArrayBlockingQueue q) {
-        System.err.println(Arrays.toString(internalArray(q)));
-    }
-
-    void checkExhausted(Iterator it) {
-        if (rnd.nextBoolean()) {
-            check(!it.hasNext());
-            check(isDetached(it));
-        }
-        if (rnd.nextBoolean()) {
-            it.forEachRemaining(e -> { throw new AssertionError(); });
-            checkDetached(it);
-        }
-        if (rnd.nextBoolean())
-            try { it.next(); fail("should throw"); }
-            catch (NoSuchElementException success) {}
-    }
-
-    boolean isDetached(Iterator it) {
-        try {
-            return prevTakeIndexField.getInt(it) < 0;
-        } catch (IllegalAccessException t) { unexpected(t); return false; }
-    }
-
-    void checkDetached(Iterator it) {
-        check(isDetached(it));
-    }
-
-    void removeUsingIterator(ArrayBlockingQueue q, Object element) {
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            Object x = it.next();
-            if (element.equals(x))
-                it.remove();
-            checkRemoveThrowsISE(it);
-        }
-    }
-
-    void checkRemoveThrowsISE(Iterator it) {
-        if (rnd.nextBoolean())
-            return;
-        try { it.remove(); fail("should throw"); }
-        catch (IllegalStateException success) {}
-    }
-
-    void checkRemoveHasNoEffect(Iterator it, Collection c) {
-        if (rnd.nextBoolean())
-            return;
-        int size = c.size();
-        it.remove(); // no effect
-        equal(c.size(), size);
-        checkRemoveThrowsISE(it);
-    }
-
-    void checkIterationSanity(Queue q) {
-        if (rnd.nextBoolean())
-            return;
-        int size = q.size();
-        Object[] a = q.toArray();
-        Object[] b = new Object[size+2];
-        Arrays.fill(b, Boolean.TRUE);
-        Object[] c = q.toArray(b);
-        equal(a.length, size);
-        check(b == c);
-        check(b[size] == null);
-        check(b[size+1] == Boolean.TRUE);
-        equal(q.toString(), Arrays.toString(a));
-        Integer[] xx = null, yy = null;
-        if (size > 0) {
-            xx = new Integer[size - 1];
-            Arrays.fill(xx, 42);
-            yy = ((Queue<Integer>)q).toArray(xx);
-            for (Integer zz : xx)
-                equal(42, zz);
-        }
-        Iterator it = q.iterator();
-        for (int i = 0; i < size; i++) {
-            check(it.hasNext());
-            Object x = it.next();
-            check(x == a[i]);
-            check(x == b[i]);
-            if (xx != null) check(x == yy[i]);
-        }
-        check(!it.hasNext());
-    }
-
-    private static void waitForFinalizersToRun() {
-        for (int i = 0; i < 2; i++)
-            tryWaitForFinalizersToRun();
-    }
-
-    private static void tryWaitForFinalizersToRun() {
-        System.gc();
-        final CountDownLatch fin = new CountDownLatch(1);
-        new Object() { protected void finalize() { fin.countDown(); }};
-        System.gc();
-        try { fin.await(); }
-        catch (InterruptedException ie) { throw new Error(ie); }
-    }
-
-    void test(int capacity, boolean fair) {
-        //----------------------------------------------------------------
-        // q.clear will clear out itrs.
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            List<Iterator> its = new ArrayList<>();
-            for (int i = 0; i < capacity; i++)
-                check(q.add(i));
-            check(itrs(q) == null);
-            for (int i = 0; i < capacity; i++) {
-                its.add(q.iterator());
-                equal(trackedIterators(q), its);
-                q.poll();
-                q.add(capacity+i);
-            }
-            q.clear();
-            check(itrs(q) == null);
-            int j = 0;
-            for (Iterator it : its) {
-                if (rnd.nextBoolean())
-                    check(it.hasNext());
-                equal(it.next(), j++);
-                checkExhausted(it);
-            }
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // q emptying will clear out itrs.
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            List<Iterator> its = new ArrayList<>();
-            for (int i = 0; i < capacity; i++)
-                q.add(i);
-            check(itrs(q) == null);
-            for (int i = 0; i < capacity; i++) {
-                its.add(q.iterator());
-                equal(trackedIterators(q), its);
-                q.poll();
-                q.add(capacity+i);
-            }
-            for (int i = 0; i < capacity; i++)
-                q.poll();
-            check(itrs(q) == null);
-            int j = 0;
-            for (Iterator it : its) {
-                if (rnd.nextBoolean())
-                    check(it.hasNext());
-                equal(it.next(), j++);
-                checkExhausted(it);
-            }
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Advancing 2 cycles will remove iterators.
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            List<Iterator> its = new ArrayList<>();
-            for (int i = 0; i < capacity; i++)
-                q.add(i);
-            check(itrs(q) == null);
-            for (int i = capacity; i < 3 * capacity; i++) {
-                its.add(q.iterator());
-                equal(trackedIterators(q), its);
-                q.poll();
-                q.add(i);
-            }
-            for (int i = 3 * capacity; i < 4 * capacity; i++) {
-                equal(trackedIterators(q), its.subList(capacity,2*capacity));
-                q.poll();
-                q.add(i);
-            }
-            check(itrs(q) == null);
-            int j = 0;
-            for (Iterator it : its) {
-                if (rnd.nextBoolean())
-                    check(it.hasNext());
-                equal(it.next(), j++);
-                checkExhausted(it);
-            }
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Interior removal of elements used by an iterator will cause
-        // it to be untracked.
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            q.add(0);
-            for (int i = 1; i < 2 * capacity; i++) {
-                q.add(i);
-                Integer[] elts = { -1, -2, -3 };
-                for (Integer elt : elts) q.add(elt);
-                equal(q.remove(), i - 1);
-                Iterator it = q.iterator();
-                equal(it.next(), i);
-                equal(it.next(), elts[0]);
-                Collections.shuffle(Arrays.asList(elts));
-                check(q.remove(elts[0]));
-                check(q.remove(elts[1]));
-                equal(trackedIterators(q), Collections.singletonList(it));
-                check(q.remove(elts[2]));
-                check(itrs(q) == null);
-                equal(it.next(), -2);
-                if (rnd.nextBoolean()) checkExhausted(it);
-                if (rnd.nextBoolean()) checkDetached(it);
-            }
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Check iterators on an empty q
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            for (int i = 0; i < 4; i++) {
-                Iterator it = q.iterator();
-                check(itrs(q) == null);
-                if (rnd.nextBoolean()) checkExhausted(it);
-                if (rnd.nextBoolean()) checkDetached(it);
-                checkRemoveThrowsISE(it);
-            }
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Check "interior" removal of iterator's last element
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            List<Iterator> its = new ArrayList<>();
-            for (int i = 0; i < capacity; i++)
-                q.add(i);
-            for (int i = 0; i < capacity; i++) {
-                Iterator it = q.iterator();
-                its.add(it);
-                for (int j = 0; j < i; j++)
-                    equal(j, it.next());
-                equal(attachedIterators(q), its);
-            }
-            q.remove(capacity - 1);
-            equal(attachedIterators(q), its);
-            for (int i = 1; i < capacity - 1; i++) {
-                q.remove(capacity - i - 1);
-                Iterator it = its.get(capacity - i);
-                checkDetached(it);
-                equal(attachedIterators(q), its.subList(0, capacity - i));
-                if (rnd.nextBoolean()) check(it.hasNext());
-                equal(it.next(), capacity - i);
-                checkExhausted(it);
-            }
-            equal(attachedIterators(q), its.subList(0, 2));
-            q.remove(0);
-            check(q.isEmpty());
-            check(itrs(q) == null);
-            Iterator it = its.get(0);
-            equal(it.next(), 0);
-            checkRemoveHasNoEffect(it, q);
-            checkExhausted(it);
-            checkDetached(it);
-            checkRemoveHasNoEffect(its.get(1), q);
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Check "interior" removal of alternating elements, straddling 2 cycles
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            List<Iterator> its = new ArrayList<>();
-            // Move takeIndex to middle
-            for (int i = 0; i < capacity/2; i++) {
-                check(q.add(i));
-                equal(q.poll(), i);
-            }
-            check(takeIndex(q) == capacity/2);
-            for (int i = 0; i < capacity; i++)
-                q.add(i);
-            for (int i = 0; i < capacity; i++) {
-                Iterator it = q.iterator();
-                its.add(it);
-                for (int j = 0; j < i; j++)
-                    equal(j, it.next());
-                equal(attachedIterators(q), its);
-            }
-            // Remove all even elements, in either direction using
-            // q.remove(), or iterator.remove()
-            switch (rnd.nextInt(3)) {
-            case 0:
-                for (int i = 0; i < capacity; i+=2) {
-                    check(q.remove(i));
-                    equal(attachedIterators(q), its);
-                }
-                break;
-            case 1:
-                for (int i = capacity - 2; i >= 0; i-=2) {
-                    check(q.remove(i));
-                    equal(attachedIterators(q), its);
-                }
-                break;
-            case 2:
-                Iterator it = q.iterator();
-                while (it.hasNext()) {
-                    int i = (Integer) it.next();
-                    if ((i & 1) == 0)
-                        it.remove();
-                }
-                equal(attachedIterators(q), its);
-                break;
-            default: throw new AssertionError();
-            }
-
-            for (int i = 0; i < capacity; i++) {
-                Iterator it = its.get(i);
-                boolean even = ((i & 1) == 0);
-                if (even) {
-                    if (rnd.nextBoolean()) check(it.hasNext());
-                    equal(i, it.next());
-                    for (int j = i+1; j < capacity; j += 2)
-                        equal(j, it.next());
-                    check(!isDetached(it));
-                    check(!it.hasNext());
-                    check(isDetached(it));
-                } else { /* odd */
-                    if (rnd.nextBoolean()) check(it.hasNext());
-                    checkRemoveHasNoEffect(it, q);
-                    equal(i, it.next());
-                    for (int j = i+2; j < capacity; j += 2)
-                        equal(j, it.next());
-                    check(!isDetached(it));
-                    check(!it.hasNext());
-                    check(isDetached(it));
-                }
-            }
-            equal(trackedIterators(q), Collections.emptyList());
-            check(itrs(q) == null);
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Check garbage collection of discarded iterators
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            List<Iterator> its = new ArrayList<>();
-            for (int i = 0; i < capacity; i++)
-                q.add(i);
-            for (int i = 0; i < capacity; i++) {
-                its.add(q.iterator());
-                equal(attachedIterators(q), its);
-            }
-            its = null;
-            waitForFinalizersToRun();
-            List<Iterator> trackedIterators = trackedIterators(q);
-            equal(trackedIterators.size(), capacity);
-            for (Iterator x : trackedIterators)
-                check(x == null);
-            Iterator it = q.iterator();
-            equal(trackedIterators(q), Collections.singletonList(it));
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Check garbage collection of discarded iterators,
-        // with a randomly retained subset.
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            List<Iterator> its = new ArrayList<>();
-            List<Iterator> retained = new ArrayList<>();
-            final int size = 1 + rnd.nextInt(capacity);
-            for (int i = 0; i < size; i++)
-                q.add(i);
-            for (int i = 0; i < size; i++) {
-                Iterator it = q.iterator();
-                its.add(it);
-                equal(attachedIterators(q), its);
-            }
-            // Leave sufficient gaps in retained
-            for (int i = 0; i < size; i+= 2+rnd.nextInt(3))
-                retained.add(its.get(i));
-            its = null;
-            waitForFinalizersToRun();
-            List<Iterator> trackedIterators = trackedIterators(q);
-            equal(trackedIterators.size(), size);
-            for (Iterator it : trackedIterators)
-                check((it == null) ^ retained.contains(it));
-            Iterator it = q.iterator(); // trigger another sweep
-            retained.add(it);
-            equal(trackedIterators(q), retained);
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Check incremental sweeping of discarded iterators.
-        // Excessively white box?!
-        //----------------------------------------------------------------
-        try {
-            final int SHORT_SWEEP_PROBES = 4;
-            final int LONG_SWEEP_PROBES = 16;
-            final int PROBE_HOP = LONG_SWEEP_PROBES + 6 * SHORT_SWEEP_PROBES;
-            final int PROBE_HOP_COUNT = 10;
-            // Expect around 8 sweeps per PROBE_HOP
-            final int SWEEPS_PER_PROBE_HOP = 8;
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            List<Iterator> its = new ArrayList<>();
-            for (int i = 0; i < capacity; i++)
-                q.add(i);
-            for (int i = 0; i < PROBE_HOP_COUNT * PROBE_HOP; i++) {
-                its.add(q.iterator());
-                equal(attachedIterators(q), its);
-            }
-            // make some garbage, separated by PROBE_HOP
-            for (int i = 0; i < its.size(); i += PROBE_HOP)
-                its.set(i, null);
-            waitForFinalizersToRun();
-            int retries;
-            for (retries = 0;
-                 trackedIterators(q).contains(null) && retries < 1000;
-                 retries++)
-                // one round of sweeping
-                its.add(q.iterator());
-            check(retries >= PROBE_HOP_COUNT * (SWEEPS_PER_PROBE_HOP - 2));
-            check(retries <= PROBE_HOP_COUNT * (SWEEPS_PER_PROBE_HOP + 2));
-            Iterator itsit = its.iterator();
-            while (itsit.hasNext())
-                if (itsit.next() == null)
-                    itsit.remove();
-            equal(trackedIterators(q), its);
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Check safety of iterator.remove while in detached mode.
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            List<Iterator> its = new ArrayList<>();
-            for (int i = 0; i < capacity/2; i++) {
-                q.add(i);
-                q.remove();
-            }
-            check(takeIndex(q) == capacity/2);
-            for (int i = 0; i < capacity; i++)
-                q.add(i);
-            for (int i = 0; i < capacity; i++) {
-                Iterator it = q.iterator();
-                its.add(it);
-                for (int j = 0; j < i; j++)
-                    equal(j, it.next());
-                equal(attachedIterators(q), its);
-            }
-            for (int i = capacity - 1; i >= 0; i--) {
-                Iterator it = its.get(i);
-                equal(i, it.next()); // last element
-                check(!isDetached(it));
-                check(!it.hasNext()); // first hasNext failure
-                check(isDetached(it));
-                int size = q.size();
-                check(q.contains(i));
-                switch (rnd.nextInt(3)) {
-                case 0:
-                    it.remove();
-                    check(!q.contains(i));
-                    equal(q.size(), size - 1);
-                    break;
-                case 1:
-                    // replace i with impostor
-                    if (q.remainingCapacity() == 0) {
-                        check(q.remove(i));
-                        check(q.add(-1));
-                    } else {
-                        check(q.add(-1));
-                        check(q.remove(i));
-                    }
-                    it.remove(); // should have no effect
-                    equal(size, q.size());
-                    check(q.contains(-1));
-                    check(q.remove(-1));
-                    break;
-                case 2:
-                    // replace i with true impostor
-                    if (i != 0) {
-                        check(q.remove(i));
-                        check(q.add(i));
-                    }
-                    it.remove();
-                    check(!q.contains(i));
-                    equal(q.size(), size - 1);
-                    break;
-                default: throw new AssertionError();
-                }
-                checkRemoveThrowsISE(it);
-                check(isDetached(it));
-                check(!trackedIterators(q).contains(it));
-            }
-            check(q.isEmpty());
-            check(itrs(q) == null);
-            for (Iterator it : its)
-                checkExhausted(it);
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Check dequeues bypassing iterators' current positions.
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            Queue<Iterator> its0 = new ArrayDeque<>();
-            Queue<Iterator> itsMid = new ArrayDeque<>();
-            List<Iterator> its = new ArrayList<>();
-            for (int i = 0; i < capacity; i++)
-                q.add(i);
-            for (int i = 0; i < 2 * capacity + 1; i++) {
-                Iterator it = q.iterator();
-                its.add(it);
-                its0.add(it);
-            }
-            for (int i = 0; i < 2 * capacity + 1; i++) {
-                Iterator it = q.iterator();
-                for (int j = 0; j < capacity/2; j++)
-                    equal(j, it.next());
-                its.add(it);
-                itsMid.add(it);
-            }
-            for (int i = capacity; i < 3 * capacity; i++) {
-                Iterator it;
-
-                it = its0.remove();
-                checkRemoveThrowsISE(it);
-                if (rnd.nextBoolean()) check(it.hasNext());
-                equal(0, it.next());
-                int victim = i - capacity;
-                for (int j = victim + (victim == 0 ? 1 : 0); j < i; j++) {
-                    if (rnd.nextBoolean()) check(it.hasNext());
-                    equal(j, it.next());
-                }
-                checkExhausted(it);
-
-                it = itsMid.remove();
-                if (victim >= capacity/2)
-                    checkRemoveHasNoEffect(it, q);
-                equal(capacity/2, it.next());
-                if (victim > capacity/2)
-                    checkRemoveHasNoEffect(it, q);
-                for (int j = Math.max(victim, capacity/2 + 1); j < i; j++) {
-                    if (rnd.nextBoolean()) check(it.hasNext());
-                    equal(j, it.next());
-                }
-                checkExhausted(it);
-
-                if (rnd.nextBoolean()) {
-                    equal(victim, q.remove());
-                } else {
-                    ArrayList list = new ArrayList(1);
-                    q.drainTo(list, 1);
-                    equal(list.size(), 1);
-                    equal(victim, list.get(0));
-                }
-                check(q.add(i));
-            }
-            // takeIndex has wrapped twice.
-            Iterator it0 = its0.remove();
-            Iterator itMid = itsMid.remove();
-            check(isDetached(it0));
-            check(isDetached(itMid));
-            if (rnd.nextBoolean()) check(it0.hasNext());
-            if (rnd.nextBoolean()) check(itMid.hasNext());
-            checkRemoveThrowsISE(it0);
-            checkRemoveHasNoEffect(itMid, q);
-            if (rnd.nextBoolean()) equal(0, it0.next());
-            if (rnd.nextBoolean()) equal(capacity/2, itMid.next());
-            check(isDetached(it0));
-            check(isDetached(itMid));
-            equal(capacity, q.size());
-            equal(0, q.remainingCapacity());
-        } catch (Throwable t) { unexpected(t); }
-
-        //----------------------------------------------------------------
-        // Check collective sanity of iteration, toArray() and toString()
-        //----------------------------------------------------------------
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
-            for (int i = 0; i < capacity; i++) {
-                checkIterationSanity(q);
-                equal(capacity, q.size() + q.remainingCapacity());
-                q.add(i);
-            }
-            for (int i = 0; i < (capacity + (capacity >> 1)); i++) {
-                checkIterationSanity(q);
-                equal(capacity, q.size() + q.remainingCapacity());
-                equal(i, q.peek());
-                equal(i, q.poll());
-                checkIterationSanity(q);
-                equal(capacity, q.size() + q.remainingCapacity());
-                q.add(capacity + i);
-            }
-            for (int i = 0; i < capacity; i++) {
-                checkIterationSanity(q);
-                equal(capacity, q.size() + q.remainingCapacity());
-                int expected = i + capacity + (capacity >> 1);
-                equal(expected, q.peek());
-                equal(expected, q.poll());
-            }
-            checkIterationSanity(q);
-        } catch (Throwable t) { unexpected(t); }
-
-    }
-
-    //--------------------- Infrastructure ---------------------------
-    volatile int passed = 0, failed = 0;
-    void pass() {passed++;}
-    void fail() {failed++; Thread.dumpStack();}
-    void fail(String msg) {System.err.println(msg); fail();}
-    void unexpected(Throwable t) {failed++; t.printStackTrace();}
-    void check(boolean cond) {if (cond) pass(); else fail();}
-    void equal(Object x, Object y) {
-        if (x == null ? y == null : x.equals(y)) pass();
-        else fail(x + " not equal to " + y);}
-    public static void main(String[] args) throws Throwable {
-        new IteratorConsistency().instanceMain(args);}
-    public void instanceMain(String[] args) throws Throwable {
-        try {test(args);} catch (Throwable t) {unexpected(t);}
-        System.err.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
-        if (failed > 0) throw new AssertionError("Some tests failed");}
-}
diff --git a/jdk/test/java/util/concurrent/ArrayBlockingQueue/WhiteBox.java b/jdk/test/java/util/concurrent/ArrayBlockingQueue/WhiteBox.java
new file mode 100644
index 0000000..890748f
--- /dev/null
+++ b/jdk/test/java/util/concurrent/ArrayBlockingQueue/WhiteBox.java
@@ -0,0 +1,759 @@
+/*
+ * 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.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * Written by Martin Buchholz with assistance from members of JCP
+ * JSR-166 Expert Group and released to the public domain, as
+ * explained at http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+/*
+ * @test
+ * @modules java.base/java.util.concurrent:open
+ * @run testng WhiteBox
+ * @summary White box tests of implementation details
+ */
+
+import static org.testng.Assert.*;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.lang.ref.WeakReference;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Queue;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.TimeUnit;
+import java.util.function.BooleanSupplier;
+
+@Test
+public class WhiteBox {
+    final ThreadLocalRandom rnd = ThreadLocalRandom.current();
+    final MethodHandles.Lookup lookup = MethodHandles.lookup();
+    final VarHandle ITRS, ITEMS, TAKEINDEX, PUTINDEX, COUNT, HEAD, NEXT, PREVTAKEINDEX;
+
+    WhiteBox() throws ReflectiveOperationException {
+        Class<?> qClass = ArrayBlockingQueue.class;
+        Class<?> itrClass  = Class.forName(qClass.getName() + "$Itr");
+        Class<?> itrsClass = Class.forName(qClass.getName() + "$Itrs");
+        Class<?> nodeClass = Class.forName(itrsClass.getName() + "$Node");
+        ITRS      = findVarHandle(qClass, "itrs", itrsClass);
+        ITEMS     = findVarHandle(qClass, "items", Object[].class);
+        TAKEINDEX = findVarHandle(qClass, "takeIndex", int.class);
+        PUTINDEX  = findVarHandle(qClass, "putIndex", int.class);
+        COUNT     = findVarHandle(qClass, "count", int.class);
+        HEAD      = findVarHandle(itrsClass, "head", nodeClass);
+        NEXT      = findVarHandle(nodeClass, "next", nodeClass);
+        PREVTAKEINDEX = findVarHandle(itrClass, "prevTakeIndex", int.class);
+    }
+
+    VarHandle findVarHandle(Class<?> recv, String name, Class<?> type)
+        throws ReflectiveOperationException {
+        return MethodHandles.privateLookupIn(recv, lookup)
+            .findVarHandle(recv, name, type);
+    }
+
+    Object itrs(ArrayBlockingQueue q) { return ITRS.get(q); }
+    Object[] items(ArrayBlockingQueue q) { return (Object[]) ITEMS.get(q); }
+    int takeIndex(ArrayBlockingQueue q) { return (int) TAKEINDEX.get(q); }
+    int putIndex(ArrayBlockingQueue q) { return (int) PUTINDEX.get(q); }
+    int count(ArrayBlockingQueue q) { return (int) COUNT.get(q); }
+    Object head(Object itrs) { return HEAD.get(itrs); }
+    Object next(Object node) { return NEXT.get(node); }
+    int prevTakeIndex(Iterator itr) { return (int) PREVTAKEINDEX.get(itr); }
+
+    boolean isDetached(Iterator it) {
+        return prevTakeIndex(it) < 0;
+    }
+
+    void assertIteratorExhausted(Iterator it) {
+        if (rnd.nextBoolean()) {
+            assertTrue(!it.hasNext());
+            assertTrue(isDetached(it));
+        }
+        if (rnd.nextBoolean()) {
+            it.forEachRemaining(e -> { throw new AssertionError(); });
+            assertTrue(isDetached(it));
+        }
+        if (rnd.nextBoolean())
+            try { it.next(); fail("should throw"); }
+            catch (NoSuchElementException success) {}
+    }
+
+    List<Iterator> trackedIterators(ArrayBlockingQueue q) {
+        List<Iterator> its = new ArrayList<>();
+        Object itrs = itrs(q);
+        if (itrs != null) {
+            for (Object p = head(itrs); p != null; p = next(p))
+                its.add(((WeakReference<Iterator>)(p)).get());
+            Collections.reverse(its);
+        }
+        return its;
+    }
+
+    List<Iterator> attachedIterators(ArrayBlockingQueue q) {
+        List<Iterator> its = new ArrayList<>();
+        Object itrs = itrs(q);
+        if (itrs != null) {
+            for (Object p = head(itrs); p != null; p = next(p)) {
+                Iterator it = ((WeakReference<Iterator>)(p)).get();
+                if (it != null && !isDetached(it))
+                    its.add(it);
+            }
+            Collections.reverse(its);
+        }
+        return its;
+    }
+
+    void assertRemoveThrowsISE(Iterator it) {
+        if (rnd.nextBoolean())
+            try { it.remove(); fail("should throw"); }
+            catch (IllegalStateException success) {}
+    }
+
+    void assertRemoveHasNoEffect(Iterator it, Collection c) {
+        if (rnd.nextBoolean()) {
+            int size = c.size();
+            it.remove(); // no effect
+            assertEquals(c.size(), size);
+            assertRemoveThrowsISE(it);
+        }
+    }
+
+    void checkIterationSanity(Queue q) {
+        if (rnd.nextBoolean())
+            return;
+        int size = q.size();
+        Object[] a = q.toArray();
+        Object[] b = new Object[size+2];
+        Arrays.fill(b, Boolean.TRUE);
+        Object[] c = q.toArray(b);
+        assertEquals(a.length, size);
+        assertSame(b, c);
+        assertNull(b[size]);
+        assertSame(b[size+1], Boolean.TRUE);
+        assertEquals(q.toString(), Arrays.toString(a));
+        Integer[] xx = null, yy = null;
+        if (size > 0) {
+            xx = new Integer[size - 1];
+            Arrays.fill(xx, 42);
+            yy = ((Queue<Integer>)q).toArray(xx);
+            for (Integer zz : xx)
+                assertEquals(42, (int) zz);
+        }
+        Iterator it = q.iterator();
+        for (int i = 0; i < size; i++) {
+            if (rnd.nextBoolean()) assertTrue(it.hasNext());
+            Object x = it.next();
+            assertSame(x, a[i]);
+            assertSame(x, b[i]);
+            if (xx != null) assertSame(x, yy[i]);
+        }
+        if (rnd.nextBoolean()) assertTrue(!it.hasNext());
+    }
+
+    /**
+     * Instead of having putIndex (and takeIndex) at the initial
+     * default of 0, move them to a random location.
+     */
+    void randomizePutIndex(ArrayBlockingQueue q) {
+        assertTrue(q.isEmpty());
+        int capacity = q.remainingCapacity();
+        int n = rnd.nextInt(capacity + 1);
+        int putIndex = putIndex(q);
+        for (int i = n; i-->0; ) q.add(Boolean.TRUE);
+        for (int i = n; i-->0; ) q.remove();
+        assertEquals(putIndex(q), (putIndex + n) % items(q).length);
+    }
+
+    /** No guarantees, but effective in practice. */
+    static void forceFullGc() {
+        CountDownLatch finalizeDone = new CountDownLatch(1);
+        WeakReference<?> ref = new WeakReference<Object>(new Object() {
+            protected void finalize() { finalizeDone.countDown(); }});
+        try {
+            for (int i = 0; i < 10; i++) {
+                System.gc();
+                if (finalizeDone.await(1L, TimeUnit.SECONDS) && ref.get() == null) {
+                    System.runFinalization(); // try to pick up stragglers
+                    return;
+                }
+            }
+        } catch (InterruptedException unexpected) {
+            throw new AssertionError("unexpected InterruptedException");
+        }
+        throw new AssertionError("failed to do a \"full\" gc");
+    }
+
+    static void gcAwait(BooleanSupplier s) {
+        for (int i = 0; i < 10; i++) {
+            if (s.getAsBoolean())
+                return;
+            forceFullGc();
+        }
+        throw new AssertionError("failed to satisfy condition");
+    }
+
+    public void clear_willClearItrs() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(2, 10);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        List<Iterator> its = new ArrayList<>();
+        for (int i = 0; i < capacity; i++)
+            assertTrue(q.add(i));
+        assertNull(itrs(q));
+        for (int i = 0; i < capacity; i++) {
+            its.add(q.iterator());
+            assertEquals(trackedIterators(q), its);
+            q.poll();
+            q.add(capacity + i);
+        }
+        q.clear();
+        assertNull(itrs(q));
+        int j = 0;
+        for (Iterator it : its) {
+            assertTrue(isDetached(it));
+            if (rnd.nextBoolean()) assertTrue(it.hasNext());
+            if (rnd.nextBoolean()) {
+                assertEquals(it.next(), j);
+                assertIteratorExhausted(it);
+            }
+            j++;
+        }
+    }
+
+    public void queueEmptyingWillClearItrs() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(2, 10);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        List<Iterator> its = new ArrayList<>();
+        for (int i = 0; i < capacity; i++)
+            q.add(i);
+        assertNull(itrs(q));
+        for (int i = 0; i < capacity; i++) {
+            its.add(q.iterator());
+            assertEquals(trackedIterators(q), its);
+            q.poll();
+            q.add(capacity+i);
+        }
+        for (int i = 0; i < capacity; i++)
+            q.poll();
+        assertNull(itrs(q));
+        int j = 0;
+        for (Iterator it : its) {
+            assertTrue(isDetached(it));
+            if (rnd.nextBoolean()) assertTrue(it.hasNext());
+            if (rnd.nextBoolean()) {
+                assertEquals(it.next(), j);
+                assertIteratorExhausted(it);
+            }
+            j++;
+        }
+    }
+
+    public void advancing2CyclesWillRemoveIterators() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(2, 10);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        List<Iterator> its = new ArrayList<>();
+        for (int i = 0; i < capacity; i++)
+            q.add(i);
+        assertNull(itrs(q));
+        for (int i = capacity; i < 3 * capacity; i++) {
+            its.add(q.iterator());
+            assertEquals(trackedIterators(q), its);
+            q.poll();
+            q.add(i);
+        }
+        for (int i = 3 * capacity; i < 4 * capacity; i++) {
+            assertEquals(trackedIterators(q), its.subList(capacity,2*capacity));
+            q.poll();
+            q.add(i);
+        }
+        assertNull(itrs(q));
+        int j = 0;
+        for (Iterator it : its) {
+            assertTrue(isDetached(it));
+            if (rnd.nextBoolean()) assertTrue(it.hasNext());
+            if (rnd.nextBoolean()) {
+                assertEquals(it.next(), j);
+                assertIteratorExhausted(it);
+            }
+            j++;
+        }
+    }
+
+    /**
+     * Interior removal of elements used by an iterator will cause it
+     * to be untracked.
+     */
+    public void interiorRemovalOfElementsUsedByIterator() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(10, 20);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        q.add(0);
+        for (int i = 1; i < 2 * capacity; i++) {
+            q.add(i);
+            Integer[] elts = { -1, -2, -3 };
+            for (Integer elt : elts) q.add(elt);
+            assertEquals(q.remove(), i - 1);
+            Iterator it = q.iterator();
+            assertEquals(it.next(), i);
+            assertEquals(it.next(), elts[0]);
+            Collections.shuffle(Arrays.asList(elts));
+            assertTrue(q.remove(elts[0]));
+            assertTrue(q.remove(elts[1]));
+            assertEquals(trackedIterators(q), Collections.singletonList(it));
+            assertTrue(q.remove(elts[2]));
+            assertNull(itrs(q));
+            assertEquals(it.next(), -2);
+            assertIteratorExhausted(it);
+            assertTrue(isDetached(it));
+        }
+    }
+
+    public void iteratorsOnEmptyQueue() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(1, 10);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        for (int i = 0; i < 4; i++) {
+            Iterator it = q.iterator();
+            assertNull(itrs(q));
+            assertIteratorExhausted(it);
+            assertTrue(isDetached(it));
+            assertRemoveThrowsISE(it);
+        }
+    }
+
+    public void interiorRemovalOfIteratorsLastElement() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(3, 10);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        List<Iterator> its = new ArrayList<>();
+        for (int i = 0; i < capacity; i++)
+            q.add(i);
+        for (int i = 0; i < capacity; i++) {
+            Iterator it = q.iterator();
+            its.add(it);
+            for (int j = 0; j < i; j++)
+                assertEquals(j, it.next());
+            assertEquals(attachedIterators(q), its);
+        }
+        q.remove(capacity - 1);
+        assertEquals(attachedIterators(q), its);
+        for (int i = 1; i < capacity - 1; i++) {
+            q.remove(capacity - i - 1);
+            Iterator it = its.get(capacity - i);
+            assertTrue(isDetached(it));
+            assertEquals(attachedIterators(q), its.subList(0, capacity - i));
+            if (rnd.nextBoolean()) assertTrue(it.hasNext());
+            assertEquals(it.next(), capacity - i);
+            assertIteratorExhausted(it);
+        }
+        assertEquals(attachedIterators(q), its.subList(0, 2));
+        q.remove(0);
+        assertTrue(q.isEmpty());
+        assertNull(itrs(q));
+        Iterator it = its.get(0);
+        assertEquals(it.next(), 0);
+        assertRemoveHasNoEffect(it, q);
+        assertIteratorExhausted(it);
+        assertTrue(isDetached(it));
+        assertRemoveHasNoEffect(its.get(1), q);
+    }
+
+    /**
+     * Checks "interior" removal of alternating elements, straddling 2 cycles
+     */
+    public void interiorRemovalOfAlternatingElements() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = 2 * rnd.nextInt(2, 10);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        List<Iterator> its = new ArrayList<>();
+        // Move takeIndex to middle
+        for (int i = 0; i < capacity/2; i++) {
+            assertTrue(q.add(i));
+            assertEquals(q.poll(), i);
+        }
+        assertEquals(takeIndex(q), capacity/2);
+        for (int i = 0; i < capacity; i++)
+            q.add(i);
+        for (int i = 0; i < capacity; i++) {
+            Iterator it = q.iterator();
+            its.add(it);
+            for (int j = 0; j < i; j++)
+                assertEquals(j, it.next());
+            assertEquals(attachedIterators(q), its);
+        }
+
+        // Remove all even elements, in either direction, using
+        // q.remove(), or iterator.remove()
+        switch (rnd.nextInt(3)) {
+        case 0:
+            for (int i = 0; i < capacity; i+=2) assertTrue(q.remove(i));
+            break;
+        case 1:
+            for (int i = capacity - 2; i >= 0; i-=2) assertTrue(q.remove(i));
+            break;
+        case 2:
+            Iterator it = q.iterator();
+            while (it.hasNext()) {
+                int i = (Integer) it.next();
+                if ((i & 1) == 0)
+                    it.remove();
+            }
+            break;
+        default: throw new AssertionError();
+        }
+        assertEquals(attachedIterators(q), its);
+
+        for (int i = 0; i < capacity; i++) {
+            Iterator it = its.get(i);
+            boolean even = ((i & 1) == 0);
+            if (even) {
+                if (rnd.nextBoolean()) assertTrue(it.hasNext());
+                assertEquals(i, it.next());
+                for (int j = i+1; j < capacity; j += 2)
+                    assertEquals(j, it.next());
+                assertTrue(!isDetached(it));
+                assertTrue(!it.hasNext());
+                assertTrue(isDetached(it));
+            } else { /* odd */
+                if (rnd.nextBoolean()) assertTrue(it.hasNext());
+                assertRemoveHasNoEffect(it, q);
+                assertEquals(i, it.next());
+                for (int j = i+2; j < capacity; j += 2)
+                    assertEquals(j, it.next());
+                assertTrue(!isDetached(it));
+                assertTrue(!it.hasNext());
+                assertTrue(isDetached(it));
+            }
+        }
+        assertEquals(trackedIterators(q), Collections.emptyList());
+        assertNull(itrs(q));
+    }
+
+    public void garbageCollectionOfUnreachableIterators() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(1, 10);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        List<Iterator> its = new ArrayList<>();
+        for (int i = 0; i < capacity; i++) q.add(i);
+        for (int i = 0; i < capacity; i++) its.add(q.iterator());
+        assertEquals(attachedIterators(q), its);
+        its = null;
+        gcAwait(() -> {
+            List<Iterator> trackedIterators = trackedIterators(q);
+            assertEquals(trackedIterators.size(), capacity);
+            for (Iterator x : trackedIterators)
+                if (x != null) return false;
+            return true;
+        });
+        Iterator it = q.iterator(); //
+        assertEquals(trackedIterators(q), Collections.singletonList(it));
+    }
+
+    public void garbageCollectionOfUnreachableIteratorsWithRandomlyRetainedSubset() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(10, 20);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        List<Iterator> its = new ArrayList<>();
+        List<Iterator> retained = new ArrayList<>();
+        final int size = 1 + rnd.nextInt(capacity);
+        for (int i = 0; i < size; i++) q.add(i);
+        for (int i = 0; i < size; i++) its.add(q.iterator());
+        assertEquals(attachedIterators(q), its);
+        // Leave sufficient gaps in retained
+        for (int i = 0; i < size; i+= 2+rnd.nextInt(3))
+            retained.add(its.get(i));
+        its = null;
+        gcAwait(() -> {
+            List<Iterator> trackedIterators = trackedIterators(q);
+            assertEquals(trackedIterators.size(), size);
+            for (Iterator it : trackedIterators)
+                if ((it != null) ^ retained.contains(it)) return false;
+            return true;
+        });
+        Iterator it = q.iterator(); // trigger another sweep
+        retained.add(it);
+        assertEquals(trackedIterators(q), retained);
+    }
+
+    /**
+     * Checks incremental sweeping of unreachable iterators.
+     * Excessively white box?!
+     */
+    public void incrementalSweepingOfUnreachableIterators() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(10, 20);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        final int SHORT_SWEEP_PROBES = 4;
+        final int LONG_SWEEP_PROBES = 16;
+        final int PROBE_HOP = LONG_SWEEP_PROBES + 6 * SHORT_SWEEP_PROBES;
+        final int PROBE_HOP_COUNT = 10;
+        // Expect around 8 sweeps per PROBE_HOP
+        final int SWEEPS_PER_PROBE_HOP = 8;
+        List<Iterator> its = new ArrayList<>();
+        for (int i = 0; i < capacity; i++)
+            q.add(i);
+        for (int i = 0; i < PROBE_HOP_COUNT * PROBE_HOP; i++)
+            its.add(q.iterator());
+        assertEquals(attachedIterators(q), its);
+        // make some garbage, separated by PROBE_HOP
+        for (int i = 0; i < its.size(); i += PROBE_HOP)
+            its.set(i, null);
+        its.removeIf(it -> it == null);
+        forceFullGc();
+        int retries;
+        for (retries = 0;
+             trackedIterators(q).contains(null) && retries < 1000;
+             retries++)
+            // one round of sweeping
+            its.add(q.iterator());
+        assertTrue(retries >= PROBE_HOP_COUNT * (SWEEPS_PER_PROBE_HOP - 2));
+        assertTrue(retries <= PROBE_HOP_COUNT * (SWEEPS_PER_PROBE_HOP + 2));
+        assertEquals(trackedIterators(q), its);
+    }
+
+    public void Iterator_remove_safetyWhileInDetachedMode() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(10, 20);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        List<Iterator> its = new ArrayList<>();
+        for (int i = 0; i < capacity/2; i++) {
+            q.add(i);
+            q.remove();
+        }
+        assertEquals(takeIndex(q), capacity/2);
+        for (int i = 0; i < capacity; i++)
+            q.add(i);
+        for (int i = 0; i < capacity; i++) {
+            Iterator it = q.iterator();
+            its.add(it);
+            for (int j = 0; j < i; j++)
+                assertEquals(j, it.next());
+        }
+        assertEquals(attachedIterators(q), its);
+        for (int i = capacity - 1; i >= 0; i--) {
+            Iterator it = its.get(i);
+            assertEquals(i, it.next()); // last element
+            assertTrue(!isDetached(it));
+            assertTrue(!it.hasNext()); // first hasNext failure
+            assertTrue(isDetached(it));
+            int size = q.size();
+            assertTrue(q.contains(i));
+            switch (rnd.nextInt(3)) {
+            case 0:
+                it.remove();
+                assertTrue(!q.contains(i));
+                assertEquals(q.size(), size - 1);
+                break;
+            case 1:
+                // replace i with impostor
+                if (q.remainingCapacity() == 0) {
+                    assertTrue(q.remove(i));
+                    assertTrue(q.add(-1));
+                } else {
+                    assertTrue(q.add(-1));
+                    assertTrue(q.remove(i));
+                }
+                it.remove(); // should have no effect
+                assertEquals(size, q.size());
+                assertTrue(q.contains(-1));
+                assertTrue(q.remove(-1));
+                break;
+            case 2:
+                // replace i with true impostor
+                if (i != 0) {
+                    assertTrue(q.remove(i));
+                    assertTrue(q.add(i));
+                }
+                it.remove();
+                assertTrue(!q.contains(i));
+                assertEquals(q.size(), size - 1);
+                break;
+            default: throw new AssertionError();
+            }
+            assertRemoveThrowsISE(it);
+            assertTrue(isDetached(it));
+            assertTrue(!trackedIterators(q).contains(it));
+        }
+        assertTrue(q.isEmpty());
+        assertNull(itrs(q));
+        for (Iterator it : its)
+            assertIteratorExhausted(it);
+    }
+
+    /**
+     * Checks dequeues bypassing iterators' current positions.
+     */
+    public void dequeuesBypassingIteratorCurrentPositions() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(10, 20);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        Queue<Iterator> its0 = new ArrayDeque<>();
+        Queue<Iterator> itsMid = new ArrayDeque<>();
+        List<Iterator> its = new ArrayList<>();
+        for (int i = 0; i < capacity; i++)
+            q.add(i);
+        for (int i = 0; i < 2 * capacity + 1; i++) {
+            Iterator it = q.iterator();
+            its.add(it);
+            its0.add(it);
+        }
+        for (int i = 0; i < 2 * capacity + 1; i++) {
+            Iterator it = q.iterator();
+            for (int j = 0; j < capacity/2; j++)
+                assertEquals(j, it.next());
+            its.add(it);
+            itsMid.add(it);
+        }
+        for (int i = capacity; i < 3 * capacity; i++) {
+            Iterator it;
+
+            it = its0.remove();
+            assertRemoveThrowsISE(it);
+            if (rnd.nextBoolean()) assertTrue(it.hasNext());
+            assertEquals(0, it.next());
+            int victim = i - capacity;
+            for (int j = victim + (victim == 0 ? 1 : 0); j < i; j++) {
+                if (rnd.nextBoolean()) assertTrue(it.hasNext());
+                assertEquals(j, it.next());
+            }
+            assertIteratorExhausted(it);
+
+            it = itsMid.remove();
+            if (victim >= capacity/2)
+                assertRemoveHasNoEffect(it, q);
+            assertEquals(capacity/2, it.next());
+            if (victim > capacity/2)
+                assertRemoveHasNoEffect(it, q);
+            for (int j = Math.max(victim, capacity/2 + 1); j < i; j++) {
+                if (rnd.nextBoolean()) assertTrue(it.hasNext());
+                assertEquals(j, it.next());
+            }
+            assertIteratorExhausted(it);
+
+            if (rnd.nextBoolean()) {
+                assertEquals(victim, q.remove());
+            } else {
+                ArrayList list = new ArrayList(1);
+                q.drainTo(list, 1);
+                assertEquals(list.size(), 1);
+                assertEquals(victim, list.get(0));
+            }
+            assertTrue(q.add(i));
+        }
+        // takeIndex has wrapped twice.
+        Iterator it0 = its0.remove();
+        Iterator itMid = itsMid.remove();
+        assertTrue(isDetached(it0));
+        assertTrue(isDetached(itMid));
+        if (rnd.nextBoolean()) assertTrue(it0.hasNext());
+        if (rnd.nextBoolean()) assertTrue(itMid.hasNext());
+        assertRemoveThrowsISE(it0);
+        assertRemoveHasNoEffect(itMid, q);
+        if (rnd.nextBoolean()) assertEquals(0, it0.next());
+        if (rnd.nextBoolean()) assertEquals(capacity/2, itMid.next());
+        assertTrue(isDetached(it0));
+        assertTrue(isDetached(itMid));
+        assertEquals(capacity, q.size());
+        assertEquals(0, q.remainingCapacity());
+    }
+
+    /**
+     * Checks collective sanity of iteration, toArray() and toString().
+     */
+    public void collectiveSanity() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(10, 20);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        for (int i = 0; i < capacity; i++) {
+            checkIterationSanity(q);
+            assertEquals(capacity, q.size() + q.remainingCapacity());
+            q.add(i);
+        }
+        for (int i = 0; i < (capacity + (capacity >> 1)); i++) {
+            checkIterationSanity(q);
+            assertEquals(capacity, q.size() + q.remainingCapacity());
+            assertEquals(i, q.peek());
+            assertEquals(i, q.poll());
+            checkIterationSanity(q);
+            assertEquals(capacity, q.size() + q.remainingCapacity());
+            q.add(capacity + i);
+        }
+        for (int i = 0; i < capacity; i++) {
+            checkIterationSanity(q);
+            assertEquals(capacity, q.size() + q.remainingCapacity());
+            int expected = i + capacity + (capacity >> 1);
+            assertEquals(expected, q.peek());
+            assertEquals(expected, q.poll());
+        }
+        checkIterationSanity(q);
+    }
+
+    public void iteratorsDetachedWhenExhaustedAndLastRetRemoved() {
+        boolean fair = rnd.nextBoolean();
+        int capacity = rnd.nextInt(2, 10);
+        ArrayBlockingQueue q = new ArrayBlockingQueue(capacity, fair);
+        randomizePutIndex(q);
+        int size = rnd.nextInt(1, capacity + 1);
+        for (int i = 0; i < size; i++) q.add(i);
+        Iterator it = q.iterator();
+        for (int i = 0; i < size - 1; i++) assertEquals(i, it.next());
+        assertEquals(trackedIterators(q), Collections.singletonList(it));
+        assertFalse(isDetached(it));
+        switch (rnd.nextInt(2)) {
+        case 0: assertTrue(q.remove(size - 1)); break;
+        case 1: assertTrue(q.removeIf(e -> e.equals(size - 1))); break;
+        default: throw new AssertionError();
+        }
+        assertEquals(size - 1, it.next()); // should trigger detach
+        assertNull(itrs(q));
+        assertTrue(isDetached(it));
+        assertRemoveHasNoEffect(it, q);
+    }
+}
diff --git a/jdk/test/java/util/concurrent/ScheduledThreadPoolExecutor/GCRetention.java b/jdk/test/java/util/concurrent/ScheduledThreadPoolExecutor/GCRetention.java
index 76e5eb9..f1a764b 100644
--- a/jdk/test/java/util/concurrent/ScheduledThreadPoolExecutor/GCRetention.java
+++ b/jdk/test/java/util/concurrent/ScheduledThreadPoolExecutor/GCRetention.java
@@ -34,12 +34,12 @@
 /*
  * @test
  * @summary Ensure that waiting pool threads don't retain refs to tasks.
- * @library /lib/testlibrary/
  */
 
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-
+import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.concurrent.Delayed;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
@@ -47,10 +47,8 @@
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-import jdk.testlibrary.Utils;
 
 public class GCRetention {
-    static final long LONG_DELAY_MS = Utils.adjustTimeout(10_000);
 
     /**
      * A custom thread pool with a custom RunnableScheduledFuture, for the
@@ -80,53 +78,48 @@
         }
     }
 
-    int countRefsCleared(WeakReference<?>[] refs) {
-        int count = 0;
-        for (WeakReference<?> ref : refs)
-            if (ref.get() == null)
-                count++;
-        return count;
+    void removeAll(ReferenceQueue<?> q, int n) throws InterruptedException {
+        for (int j = n; j--> 0; ) {
+            if (q.poll() == null) {
+                for (;;) {
+                    System.gc();
+                    if (q.remove(1000) != null)
+                        break;
+                    System.out.printf(
+                        "%d/%d unqueued references remaining%n", j, n);
+                }
+            }
+        }
+        check(q.poll() == null);
     }
 
     void test(String[] args) throws Throwable {
-        CustomPool pool = new CustomPool(10);
+        final CustomPool pool = new CustomPool(10);
         final int size = 100;
-        WeakReference<?>[] refs = new WeakReference<?>[size];
-        Future<?>[] futures = new Future<?>[size];
-        for (int i = 0; i < size; i++) {
-            final Object x = new Object();
-            refs[i] = new WeakReference<Object>(x);
-            // Create a Runnable with a strong ref to x.
-            Runnable r = new Runnable() {
-                    public void run() { System.out.println(x); }
-                };
-            // Schedule a custom task with a strong reference to r.
-            // Later tasks have earlier expiration, to ensure multiple
-            // residents of queue head.
-            futures[i] = pool.schedule(r, size*2-i, TimeUnit.MINUTES);
+        final ReferenceQueue<Object> q = new ReferenceQueue<>();
+        final List<WeakReference<?>> refs = new ArrayList<>(size);
+        final List<Future<?>> futures = new ArrayList<>(size);
+
+        // Schedule custom tasks with strong references.
+        class Task implements Runnable {
+            final Object x;
+            Task() { refs.add(new WeakReference<>(x = new Object(), q)); }
+            public void run() { System.out.println(x); }
         }
-        Thread.sleep(10);
-        for (int i = 0; i < size; i++) {
-            if (futures[i] != null) {
-                futures[i].cancel(false);
-                futures[i] = null;
-            }
-        }
+        // Give tasks added later earlier expiration, to ensure
+        // multiple residents of queue head.
+        for (int i = size; i--> 0; )
+            futures.add(pool.schedule(new Task(), i + 1, TimeUnit.MINUTES));
+        futures.forEach(future -> future.cancel(false));
+        futures.clear();
+
         pool.purge();
-        int cleared = 0;
-        for (int i = 0;
-             i < 10 && (cleared = countRefsCleared(refs)) < size;
-             i++) {
-            System.gc();
-            System.runFinalization();
-            Thread.sleep(10);
-        }
+        removeAll(q, size);
+        for (WeakReference<?> ref : refs) check(ref.get() == null);
+
         pool.shutdown();
-        pool.awaitTermination(LONG_DELAY_MS, MILLISECONDS);
-        if (cleared < size)
-            throw new Error(String.format
-                            ("references to %d/%d tasks retained (\"leaked\")",
-                             size - cleared, size));
+        // rely on test harness to handle timeout
+        pool.awaitTermination(1L, TimeUnit.DAYS);
     }
 
     //--------------------- Infrastructure ---------------------------
diff --git a/jdk/test/java/util/concurrent/tck/ForkJoinPool9Test.java b/jdk/test/java/util/concurrent/tck/ForkJoinPool9Test.java
index 08cdfeb..8a87e47 100644
--- a/jdk/test/java/util/concurrent/tck/ForkJoinPool9Test.java
+++ b/jdk/test/java/util/concurrent/tck/ForkJoinPool9Test.java
@@ -32,9 +32,14 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.VarHandle;
-import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ForkJoinPool;
+import java.util.concurrent.ForkJoinTask;
+import java.util.concurrent.Future;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -53,29 +58,43 @@
      */
     public void testCommonPoolThreadContextClassLoader() throws Throwable {
         if (!testImplementationDetails) return;
+
+        // Ensure common pool has at least one real thread
+        String prop = System.getProperty(
+            "java.util.concurrent.ForkJoinPool.common.parallelism");
+        if ("0".equals(prop)) return;
+
         VarHandle CCL =
             MethodHandles.privateLookupIn(Thread.class, MethodHandles.lookup())
             .findVarHandle(Thread.class, "contextClassLoader", ClassLoader.class);
         ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
         boolean haveSecurityManager = (System.getSecurityManager() != null);
-        CompletableFuture.runAsync(
-            () -> {
-                assertSame(systemClassLoader,
-                           Thread.currentThread().getContextClassLoader());
-                assertSame(systemClassLoader,
-                           CCL.get(Thread.currentThread()));
-                if (haveSecurityManager)
-                    assertThrows(
-                        SecurityException.class,
-                        () -> System.getProperty("foo"),
-                        () -> Thread.currentThread().setContextClassLoader(null));
-
-                // TODO ?
-//                 if (haveSecurityManager
-//                     && Thread.currentThread().getClass().getSimpleName()
-//                     .equals("InnocuousForkJoinWorkerThread"))
-//                     assertThrows(SecurityException.class, /* ?? */);
-            }).join();
+        CountDownLatch taskStarted = new CountDownLatch(1);
+        Runnable runInCommonPool = () -> {
+            taskStarted.countDown();
+            assertTrue(ForkJoinTask.inForkJoinPool());
+            assertSame(ForkJoinPool.commonPool(),
+                       ForkJoinTask.getPool());
+            assertSame(systemClassLoader,
+                       Thread.currentThread().getContextClassLoader());
+            assertSame(systemClassLoader,
+                       CCL.get(Thread.currentThread()));
+            if (haveSecurityManager)
+                assertThrows(
+                    SecurityException.class,
+                    () -> System.getProperty("foo"),
+                    () -> Thread.currentThread().setContextClassLoader(null));
+            // TODO ?
+//          if (haveSecurityManager
+//              && Thread.currentThread().getClass().getSimpleName()
+//                 .equals("InnocuousForkJoinWorkerThread"))
+//              assertThrows(SecurityException.class, /* ?? */);
+        };
+        Future<?> f = ForkJoinPool.commonPool().submit(runInCommonPool);
+        // Ensure runInCommonPool is truly running in the common pool,
+        // by giving this thread no opportunity to "help" on get().
+        assertTrue(taskStarted.await(LONG_DELAY_MS, MILLISECONDS));
+        assertNull(f.get());
     }
 
 }
diff --git a/jdk/test/java/util/concurrent/tck/JSR166TestCase.java b/jdk/test/java/util/concurrent/tck/JSR166TestCase.java
index 80eb346..1037eb8 100644
--- a/jdk/test/java/util/concurrent/tck/JSR166TestCase.java
+++ b/jdk/test/java/util/concurrent/tck/JSR166TestCase.java
@@ -1326,21 +1326,61 @@
                 startTime = System.nanoTime();
             else if (millisElapsedSince(startTime) > timeoutMillis) {
                 threadAssertTrue(thread.isAlive());
-                return;
+                fail("timed out waiting for thread to enter wait state");
             }
             Thread.yield();
         }
     }
 
     /**
-     * Waits up to LONG_DELAY_MS for the given thread to enter a wait
-     * state: BLOCKED, WAITING, or TIMED_WAITING.
+     * Spin-waits up to the specified number of milliseconds for the given
+     * thread to enter a wait state: BLOCKED, WAITING, or TIMED_WAITING,
+     * and additionally satisfy the given condition.
+     */
+    void waitForThreadToEnterWaitState(
+        Thread thread, long timeoutMillis, Callable<Boolean> waitingForGodot) {
+        long startTime = 0L;
+        for (;;) {
+            Thread.State s = thread.getState();
+            if (s == Thread.State.BLOCKED ||
+                s == Thread.State.WAITING ||
+                s == Thread.State.TIMED_WAITING) {
+                try {
+                    if (waitingForGodot.call())
+                        return;
+                } catch (Throwable fail) { threadUnexpectedException(fail); }
+            }
+            else if (s == Thread.State.TERMINATED)
+                fail("Unexpected thread termination");
+            else if (startTime == 0L)
+                startTime = System.nanoTime();
+            else if (millisElapsedSince(startTime) > timeoutMillis) {
+                threadAssertTrue(thread.isAlive());
+                fail("timed out waiting for thread to enter wait state");
+            }
+            Thread.yield();
+        }
+    }
+
+    /**
+     * Spin-waits up to LONG_DELAY_MS milliseconds for the given thread to
+     * enter a wait state: BLOCKED, WAITING, or TIMED_WAITING.
      */
     void waitForThreadToEnterWaitState(Thread thread) {
         waitForThreadToEnterWaitState(thread, LONG_DELAY_MS);
     }
 
     /**
+     * Spin-waits up to LONG_DELAY_MS milliseconds for the given thread to
+     * enter a wait state: BLOCKED, WAITING, or TIMED_WAITING,
+     * and additionally satisfy the given condition.
+     */
+    void waitForThreadToEnterWaitState(
+        Thread thread, Callable<Boolean> waitingForGodot) {
+        waitForThreadToEnterWaitState(thread, LONG_DELAY_MS, waitingForGodot);
+    }
+
+    /**
      * Returns the number of milliseconds since time given by
      * startNanoTime, which must have been previously returned from a
      * call to {@link System#nanoTime()}.
diff --git a/jdk/test/java/util/concurrent/tck/LinkedTransferQueueTest.java b/jdk/test/java/util/concurrent/tck/LinkedTransferQueueTest.java
index 55965e6..6a22b0e 100644
--- a/jdk/test/java/util/concurrent/tck/LinkedTransferQueueTest.java
+++ b/jdk/test/java/util/concurrent/tck/LinkedTransferQueueTest.java
@@ -42,6 +42,7 @@
 import java.util.NoSuchElementException;
 import java.util.Queue;
 import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ExecutorService;
@@ -766,9 +767,11 @@
             }});
 
         threadStarted.await();
-        waitForThreadToEnterWaitState(t);
-        assertEquals(1, q.getWaitingConsumerCount());
-        assertTrue(q.hasWaitingConsumer());
+        Callable<Boolean> oneConsumer
+            = new Callable<Boolean>() { public Boolean call() {
+                return q.hasWaitingConsumer()
+                && q.getWaitingConsumerCount() == 1; }};
+        waitForThreadToEnterWaitState(t, oneConsumer);
 
         assertTrue(q.offer(one));
         assertEquals(0, q.getWaitingConsumerCount());
@@ -790,7 +793,7 @@
 
     /**
      * transfer waits until a poll occurs. The transfered element
-     * is returned by this associated poll.
+     * is returned by the associated poll.
      */
     public void testTransfer2() throws InterruptedException {
         final LinkedTransferQueue<Integer> q = new LinkedTransferQueue<>();
@@ -804,8 +807,11 @@
             }});
 
         threadStarted.await();
-        waitForThreadToEnterWaitState(t);
-        assertEquals(1, q.size());
+        Callable<Boolean> oneElement
+            = new Callable<Boolean>() { public Boolean call() {
+                return !q.isEmpty() && q.size() == 1; }};
+        waitForThreadToEnterWaitState(t, oneElement);
+
         assertSame(five, q.poll());
         checkEmpty(q);
         awaitTermination(t);
@@ -868,7 +874,7 @@
 
     /**
      * transfer waits until a take occurs. The transfered element
-     * is returned by this associated take.
+     * is returned by the associated take.
      */
     public void testTransfer5() throws InterruptedException {
         final LinkedTransferQueue<Integer> q = new LinkedTransferQueue<>();
diff --git a/jdk/test/java/util/concurrent/tck/PhaserTest.java b/jdk/test/java/util/concurrent/tck/PhaserTest.java
index 1b4d083..832fe3c 100644
--- a/jdk/test/java/util/concurrent/tck/PhaserTest.java
+++ b/jdk/test/java/util/concurrent/tck/PhaserTest.java
@@ -550,7 +550,7 @@
             }});
 
         await(pleaseArrive);
-        waitForThreadToEnterWaitState(t, SHORT_DELAY_MS);
+        waitForThreadToEnterWaitState(t);
         assertEquals(0, phaser.arrive());
         awaitTermination(t);
 
@@ -578,7 +578,7 @@
             }});
 
         await(pleaseArrive);
-        waitForThreadToEnterWaitState(t, SHORT_DELAY_MS);
+        waitForThreadToEnterWaitState(t);
         t.interrupt();
         assertEquals(0, phaser.arrive());
         awaitTermination(t);
@@ -594,20 +594,20 @@
     public void testArriveAndAwaitAdvanceAfterInterrupt() {
         final Phaser phaser = new Phaser();
         assertEquals(0, phaser.register());
-        final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
+        final CountDownLatch pleaseArrive = new CountDownLatch(1);
 
         Thread t = newStartedThread(new CheckedRunnable() {
             public void realRun() {
                 Thread.currentThread().interrupt();
                 assertEquals(0, phaser.register());
-                pleaseInterrupt.countDown();
+                pleaseArrive.countDown();
                 assertTrue(Thread.currentThread().isInterrupted());
                 assertEquals(1, phaser.arriveAndAwaitAdvance());
-                assertTrue(Thread.currentThread().isInterrupted());
+                assertTrue(Thread.interrupted());
             }});
 
-        await(pleaseInterrupt);
-        waitForThreadToEnterWaitState(t, SHORT_DELAY_MS);
+        await(pleaseArrive);
+        waitForThreadToEnterWaitState(t);
         Thread.currentThread().interrupt();
         assertEquals(1, phaser.arriveAndAwaitAdvance());
         assertTrue(Thread.interrupted());
@@ -628,11 +628,11 @@
                 assertFalse(Thread.currentThread().isInterrupted());
                 pleaseInterrupt.countDown();
                 assertEquals(1, phaser.arriveAndAwaitAdvance());
-                assertTrue(Thread.currentThread().isInterrupted());
+                assertTrue(Thread.interrupted());
             }});
 
         await(pleaseInterrupt);
-        waitForThreadToEnterWaitState(t, SHORT_DELAY_MS);
+        waitForThreadToEnterWaitState(t);
         t.interrupt();
         Thread.currentThread().interrupt();
         assertEquals(1, phaser.arriveAndAwaitAdvance());
@@ -807,7 +807,7 @@
         assertEquals(THREADS, phaser.getArrivedParties());
         assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
         for (Thread thread : threads)
-            waitForThreadToEnterWaitState(thread, SHORT_DELAY_MS);
+            waitForThreadToEnterWaitState(thread);
         for (Thread thread : threads)
             assertTrue(thread.isAlive());
         assertState(phaser, 0, THREADS + 1, 1);
diff --git a/jdk/test/java/util/concurrent/tck/StampedLockTest.java b/jdk/test/java/util/concurrent/tck/StampedLockTest.java
index ea0b8f9..65ef48d 100644
--- a/jdk/test/java/util/concurrent/tck/StampedLockTest.java
+++ b/jdk/test/java/util/concurrent/tck/StampedLockTest.java
@@ -299,7 +299,6 @@
      * interruptible operations throw InterruptedException when pre-interrupted
      */
     public void testInterruptibleOperationsThrowInterruptedExceptionWhenPreInterrupted() {
-        final CountDownLatch running = new CountDownLatch(1);
         final StampedLock lock = new StampedLock();
 
         Action[] interruptibleLockActions = {
@@ -364,7 +363,6 @@
      * interruptible operations throw InterruptedException when write locked and interrupted
      */
     public void testInterruptibleOperationsThrowInterruptedExceptionWriteLockedInterrupted() {
-        final CountDownLatch running = new CountDownLatch(1);
         final StampedLock lock = new StampedLock();
         long s = lock.writeLock();
 
@@ -387,7 +385,6 @@
      * interruptible operations throw InterruptedException when read locked and interrupted
      */
     public void testInterruptibleOperationsThrowInterruptedExceptionReadLockedInterrupted() {
-        final CountDownLatch running = new CountDownLatch(1);
         final StampedLock lock = new StampedLock();
         long s = lock.readLock();
 
@@ -506,29 +503,32 @@
     }
 
     /**
-     * A writelock succeeds only after a reading thread unlocks
+     * writeLock() succeeds only after a reading thread unlocks
      */
     public void testWriteAfterReadLock() throws InterruptedException {
-        final CountDownLatch running = new CountDownLatch(1);
+        final CountDownLatch aboutToLock = new CountDownLatch(1);
         final StampedLock lock = new StampedLock();
         long rs = lock.readLock();
         Thread t = newStartedThread(new CheckedRunnable() {
             public void realRun() {
-                running.countDown();
+                aboutToLock.countDown();
                 long s = lock.writeLock();
+                assertTrue(lock.isWriteLocked());
+                assertFalse(lock.isReadLocked());
                 lock.unlockWrite(s);
             }});
 
-        running.await();
-        waitForThreadToEnterWaitState(t, MEDIUM_DELAY_MS);
+        aboutToLock.await();
+        waitForThreadToEnterWaitState(t);
         assertFalse(lock.isWriteLocked());
+        assertTrue(lock.isReadLocked());
         lock.unlockRead(rs);
         awaitTermination(t);
-        assertFalse(lock.isWriteLocked());
+        assertUnlocked(lock);
     }
 
     /**
-     * A writelock succeeds only after reading threads unlock
+     * writeLock() succeeds only after reading threads unlock
      */
     public void testWriteAfterMultipleReadLocks() {
         final StampedLock lock = new StampedLock();
@@ -551,35 +551,36 @@
         assertFalse(lock.isWriteLocked());
         lock.unlockRead(s);
         awaitTermination(t2);
-        assertFalse(lock.isWriteLocked());
+        assertUnlocked(lock);
     }
 
     /**
-     * Readlocks succeed only after a writing thread unlocks
+     * readLock() succeed only after a writing thread unlocks
      */
     public void testReadAfterWriteLock() {
         final StampedLock lock = new StampedLock();
         final CountDownLatch threadsStarted = new CountDownLatch(2);
         final long s = lock.writeLock();
-        Thread t1 = newStartedThread(new CheckedRunnable() {
+        final Runnable acquireReleaseReadLock = new CheckedRunnable() {
             public void realRun() {
                 threadsStarted.countDown();
                 long rs = lock.readLock();
+                assertTrue(lock.isReadLocked());
+                assertFalse(lock.isWriteLocked());
                 lock.unlockRead(rs);
-            }});
-        Thread t2 = newStartedThread(new CheckedRunnable() {
-            public void realRun() {
-                threadsStarted.countDown();
-                long rs = lock.readLock();
-                lock.unlockRead(rs);
-            }});
+            }};
+        Thread t1 = newStartedThread(acquireReleaseReadLock);
+        Thread t2 = newStartedThread(acquireReleaseReadLock);
 
         await(threadsStarted);
-        waitForThreadToEnterWaitState(t1, MEDIUM_DELAY_MS);
-        waitForThreadToEnterWaitState(t2, MEDIUM_DELAY_MS);
+        waitForThreadToEnterWaitState(t1);
+        waitForThreadToEnterWaitState(t2);
+        assertTrue(lock.isWriteLocked());
+        assertFalse(lock.isReadLocked());
         releaseWriteLock(lock, s);
         awaitTermination(t1);
         awaitTermination(t2);
+        assertUnlocked(lock);
     }
 
     /**
@@ -765,22 +766,24 @@
      */
     public void testValidateOptimisticWriteLocked2()
             throws InterruptedException {
-        final CountDownLatch running = new CountDownLatch(1);
+        final CountDownLatch locked = new CountDownLatch(1);
         final StampedLock lock = new StampedLock();
         final long p = assertValid(lock, lock.tryOptimisticRead());
 
         Thread t = newStartedThread(new CheckedInterruptedRunnable() {
             public void realRun() throws InterruptedException {
                 lock.writeLockInterruptibly();
-                running.countDown();
+                locked.countDown();
                 lock.writeLockInterruptibly();
             }});
 
-        running.await();
+        locked.await();
         assertFalse(lock.validate(p));
         assertEquals(0L, lock.tryOptimisticRead());
+        waitForThreadToEnterWaitState(t);
         t.interrupt();
         awaitTermination(t);
+        assertTrue(lock.isWriteLocked());
     }
 
     /**
diff --git a/jdk/test/java/util/concurrent/tck/SubmissionPublisherTest.java b/jdk/test/java/util/concurrent/tck/SubmissionPublisherTest.java
index 2b4fea0..102d1b5 100644
--- a/jdk/test/java/util/concurrent/tck/SubmissionPublisherTest.java
+++ b/jdk/test/java/util/concurrent/tck/SubmissionPublisherTest.java
@@ -560,17 +560,21 @@
     }
 
     /**
-     * Negative request causes error
+     * Non-positive request causes error
      */
     public void testRequest3() {
         SubmissionPublisher<Integer> p = basicPublisher();
         TestSubscriber s1 = new TestSubscriber();
         TestSubscriber s2 = new TestSubscriber();
+        TestSubscriber s3 = new TestSubscriber();
         p.subscribe(s1);
         p.subscribe(s2);
+        p.subscribe(s3);
+        s3.awaitSubscribe();
         s2.awaitSubscribe();
         s1.awaitSubscribe();
         s1.sn.request(-1L);
+        s3.sn.request(0L);
         p.submit(1);
         p.submit(2);
         p.close();
@@ -580,6 +584,9 @@
         s1.awaitError();
         assertEquals(1, s1.errors);
         assertTrue(s1.lastError instanceof IllegalArgumentException);
+        s3.awaitError();
+        assertEquals(1, s3.errors);
+        assertTrue(s3.lastError instanceof IllegalArgumentException);
     }
 
     /**
diff --git a/jdk/test/java/util/logging/LocalizedLevelName.java b/jdk/test/java/util/logging/LocalizedLevelName.java
index 627789f..4bb75b6 100644
--- a/jdk/test/java/util/logging/LocalizedLevelName.java
+++ b/jdk/test/java/util/logging/LocalizedLevelName.java
@@ -21,7 +21,6 @@
  * questions.
  */
 
-import java.lang.reflect.Module;
 import java.util.*;
 import java.util.logging.*;
 
diff --git a/jdk/test/java/util/logging/LoggingDeadlock2.java b/jdk/test/java/util/logging/LoggingDeadlock2.java
index ca4f330..4aa3121 100644
--- a/jdk/test/java/util/logging/LoggingDeadlock2.java
+++ b/jdk/test/java/util/logging/LoggingDeadlock2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -263,7 +263,7 @@
                     sleep(ms);
                     System.err.println("Timeout reached: " + ms);
                     if (process.isAlive()) {
-                        long pid = process.getPid();
+                        long pid = process.pid();
                         ProcessBuilder jstack = new ProcessBuilder(jstackExe, String.valueOf(pid));
                         System.err.println("Dumping subprocess stack: " + pid);
                         Process p = jstack.inheritIO().start();
diff --git a/jdk/test/java/util/logging/modules/pkgs/p3/test/ResourceBundleTest.java b/jdk/test/java/util/logging/modules/pkgs/p3/test/ResourceBundleTest.java
index 03d2614..0eef17a 100644
--- a/jdk/test/java/util/logging/modules/pkgs/p3/test/ResourceBundleTest.java
+++ b/jdk/test/java/util/logging/modules/pkgs/p3/test/ResourceBundleTest.java
@@ -23,7 +23,6 @@
 
 package p3.test;
 
-import java.lang.reflect.Module;
 import java.util.logging.Logger;
 import java.util.MissingResourceException;
 import java.util.PropertyResourceBundle;
diff --git a/jdk/test/java/util/regex/RegExTest.java b/jdk/test/java/util/regex/RegExTest.java
index 64eb2d0f..d60c1ca 100644
--- a/jdk/test/java/util/regex/RegExTest.java
+++ b/jdk/test/java/util/regex/RegExTest.java
@@ -35,6 +35,7 @@
  * 8027645 8035076 8039124 8035975 8074678 6854417 8143854 8147531 7071819
  * 8151481 4867170 7080302 6728861 6995635 6736245 4916384
  * 6328855 6192895 6345469 6988218 6693451 7006761 8140212 8143282 8158482
+ * 8176029
  *
  * @library /lib/testlibrary
  * @build jdk.testlibrary.*
@@ -4567,10 +4568,15 @@
         String linebreaks = new String (new char[] {
             0x0A, 0x0B, 0x0C, 0x0D, 0x85, 0x2028, 0x2029 });
         String crnl = "\r\n";
-        if (!Pattern.compile("\\R+").matcher(linebreaks).matches() ||
-            !Pattern.compile("\\R").matcher(crnl).matches() ||
-            Pattern.compile("\\R\\R").matcher(crnl).matches())
+        if (!(Pattern.compile("\\R+").matcher(linebreaks).matches() &&
+              Pattern.compile("\\R").matcher(crnl).matches() &&
+              Pattern.compile("\\Rabc").matcher(crnl + "abc").matches() &&
+              Pattern.compile("\\Rabc").matcher("\rabc").matches() &&
+              Pattern.compile("\\R\\R").matcher(crnl).matches() &&  // backtracking
+              Pattern.compile("\\R\\n").matcher(crnl).matches()) && // backtracking
+              !Pattern.compile("((?<!\\R)\\s)*").matcher(crnl).matches()) { // #8176029
             failCount++;
+        }
         report("linebreakTest");
     }
 
diff --git a/jdk/test/java/util/spi/ResourceBundleControlProvider/test/jdk/test/ResourceBundleDelegate.java b/jdk/test/java/util/spi/ResourceBundleControlProvider/test/jdk/test/ResourceBundleDelegate.java
index 13a604a..b9f2a59 100644
--- a/jdk/test/java/util/spi/ResourceBundleControlProvider/test/jdk/test/ResourceBundleDelegate.java
+++ b/jdk/test/java/util/spi/ResourceBundleControlProvider/test/jdk/test/ResourceBundleDelegate.java
@@ -23,7 +23,6 @@
 
 package jdk.test;
 
-import java.lang.reflect.Module;
 import java.util.Locale;
 import java.util.ResourceBundle;
 
diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/SpliteratorTestHelper.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/SpliteratorTestHelper.java
new file mode 100644
index 0000000..0876584
--- /dev/null
+++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/SpliteratorTestHelper.java
@@ -0,0 +1,769 @@
+/*
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util;
+
+import java.util.function.*;
+import java.util.stream.LambdaTestHelpers;
+
+import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.fail;
+
+/**
+ * Assertion methods for spliterators, to be called from other tests
+ */
+public class SpliteratorTestHelper {
+
+    public interface ContentAsserter<T> {
+        void assertContents(Collection<T> actual, Collection<T> expected, boolean isOrdered);
+    }
+
+    private static ContentAsserter<Object> DEFAULT_CONTENT_ASSERTER
+            = SpliteratorTestHelper::assertContents;
+
+    @SuppressWarnings("unchecked")
+    private static <T> ContentAsserter<T> defaultContentAsserter() {
+        return (ContentAsserter<T>) DEFAULT_CONTENT_ASSERTER;
+    }
+
+    public static void testSpliterator(Supplier<Spliterator<Integer>> supplier) {
+        testSpliterator(supplier, defaultContentAsserter());
+    }
+
+    public static void testSpliterator(Supplier<Spliterator<Integer>> supplier,
+                                       ContentAsserter<Integer> asserter) {
+        testSpliterator(supplier, (Consumer<Integer> b) -> b, asserter);
+    }
+
+    public static void testIntSpliterator(Supplier<Spliterator.OfInt> supplier) {
+        testIntSpliterator(supplier, defaultContentAsserter());
+    }
+
+    public static void testIntSpliterator(Supplier<Spliterator.OfInt> supplier,
+                                          ContentAsserter<Integer> asserter) {
+        testSpliterator(supplier, intBoxingConsumer(), asserter);
+    }
+
+    public static void testLongSpliterator(Supplier<Spliterator.OfLong> supplier) {
+        testLongSpliterator(supplier, defaultContentAsserter());
+    }
+
+    public static void testLongSpliterator(Supplier<Spliterator.OfLong> supplier,
+                                           ContentAsserter<Long> asserter) {
+        testSpliterator(supplier, longBoxingConsumer(), asserter);
+    }
+
+    public static void testDoubleSpliterator(Supplier<Spliterator.OfDouble> supplier) {
+        testDoubleSpliterator(supplier, defaultContentAsserter());
+    }
+
+    public static void testDoubleSpliterator(Supplier<Spliterator.OfDouble> supplier,
+                                             ContentAsserter<Double> asserter) {
+        testSpliterator(supplier, doubleBoxingConsumer(), asserter);
+    }
+
+    public static UnaryOperator<Consumer<Integer>> intBoxingConsumer() {
+        class BoxingAdapter implements Consumer<Integer>, IntConsumer {
+            private final Consumer<Integer> b;
+
+            BoxingAdapter(Consumer<Integer> b) {
+                this.b = b;
+            }
+
+            @Override
+            public void accept(Integer value) {
+                throw new IllegalStateException();
+            }
+
+            @Override
+            public void accept(int value) {
+                b.accept(value);
+            }
+        }
+
+        return b -> new BoxingAdapter(b);
+    }
+
+    public static UnaryOperator<Consumer<Long>> longBoxingConsumer() {
+        class BoxingAdapter implements Consumer<Long>, LongConsumer {
+            private final Consumer<Long> b;
+
+            BoxingAdapter(Consumer<Long> b) {
+                this.b = b;
+            }
+
+            @Override
+            public void accept(Long value) {
+                throw new IllegalStateException();
+            }
+
+            @Override
+            public void accept(long value) {
+                b.accept(value);
+            }
+        }
+
+        return b -> new BoxingAdapter(b);
+    }
+
+    public static UnaryOperator<Consumer<Double>> doubleBoxingConsumer() {
+        class BoxingAdapter implements Consumer<Double>, DoubleConsumer {
+            private final Consumer<Double> b;
+
+            BoxingAdapter(Consumer<Double> b) {
+                this.b = b;
+            }
+
+            @Override
+            public void accept(Double value) {
+                throw new IllegalStateException();
+            }
+
+            @Override
+            public void accept(double value) {
+                b.accept(value);
+            }
+        }
+
+        return b -> new BoxingAdapter(b);
+    }
+
+    public static <T, S extends Spliterator<T>> void testSpliterator(Supplier<S> supplier,
+                                                              UnaryOperator<Consumer<T>> boxingAdapter,
+                                                              ContentAsserter<T> asserter) {
+        ArrayList<T> fromForEach = new ArrayList<>();
+        Spliterator<T> spliterator = supplier.get();
+        Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add);
+        spliterator.forEachRemaining(addToFromForEach);
+
+        Collection<T> exp = Collections.unmodifiableList(fromForEach);
+
+        testNullPointerException(supplier);
+        testForEach(exp, supplier, boxingAdapter, asserter);
+        testTryAdvance(exp, supplier, boxingAdapter, asserter);
+        testMixedTryAdvanceForEach(exp, supplier, boxingAdapter, asserter);
+        testMixedTraverseAndSplit(exp, supplier, boxingAdapter, asserter);
+        testSplitAfterFullTraversal(supplier, boxingAdapter);
+        testSplitOnce(exp, supplier, boxingAdapter, asserter);
+        testSplitSixDeep(exp, supplier, boxingAdapter, asserter);
+        testSplitUntilNull(exp, supplier, boxingAdapter, asserter);
+    }
+
+    public static <T, S extends Spliterator<T>> void testForEach(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter) {
+        testForEach(exp, supplier, boxingAdapter, defaultContentAsserter());
+    }
+
+    public static <T, S extends Spliterator<T>> void testTryAdvance(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter) {
+        testTryAdvance(exp, supplier, boxingAdapter, defaultContentAsserter());
+    }
+
+    public static <T, S extends Spliterator<T>> void testMixedTryAdvanceForEach(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter) {
+        testMixedTryAdvanceForEach(exp, supplier, boxingAdapter, defaultContentAsserter());
+    }
+
+    public static <T, S extends Spliterator<T>> void testMixedTraverseAndSplit(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter) {
+        testMixedTraverseAndSplit(exp, supplier, boxingAdapter, defaultContentAsserter());
+    }
+
+    public static <T, S extends Spliterator<T>> void testSplitOnce(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter) {
+        testSplitOnce(exp, supplier, boxingAdapter, defaultContentAsserter());
+    }
+
+    public static <T, S extends Spliterator<T>> void testSplitSixDeep(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter) {
+        testSplitSixDeep(exp, supplier, boxingAdapter, defaultContentAsserter());
+    }
+
+    public static <T, S extends Spliterator<T>> void testSplitUntilNull(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter) {
+        testSplitUntilNull(exp, supplier, boxingAdapter, defaultContentAsserter());
+    }
+
+    private static <T, S extends Spliterator<T>> void testNullPointerException(Supplier<S> s) {
+        S sp = s.get();
+        // Have to check instances and use casts to avoid tripwire messages and
+        // directly test the primitive methods
+        if (sp instanceof Spliterator.OfInt) {
+            Spliterator.OfInt psp = (Spliterator.OfInt) sp;
+            executeAndCatch(NullPointerException.class, () -> psp.forEachRemaining((IntConsumer) null));
+            executeAndCatch(NullPointerException.class, () -> psp.tryAdvance((IntConsumer) null));
+        }
+        else if (sp instanceof Spliterator.OfLong) {
+            Spliterator.OfLong psp = (Spliterator.OfLong) sp;
+            executeAndCatch(NullPointerException.class, () -> psp.forEachRemaining((LongConsumer) null));
+            executeAndCatch(NullPointerException.class, () -> psp.tryAdvance((LongConsumer) null));
+        }
+        else if (sp instanceof Spliterator.OfDouble) {
+            Spliterator.OfDouble psp = (Spliterator.OfDouble) sp;
+            executeAndCatch(NullPointerException.class, () -> psp.forEachRemaining((DoubleConsumer) null));
+            executeAndCatch(NullPointerException.class, () -> psp.tryAdvance((DoubleConsumer) null));
+        }
+        else {
+            executeAndCatch(NullPointerException.class, () -> sp.forEachRemaining(null));
+            executeAndCatch(NullPointerException.class, () -> sp.tryAdvance(null));
+        }
+    }
+
+    private static <T, S extends Spliterator<T>> void testForEach(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter,
+            ContentAsserter<T> asserter) {
+        S spliterator = supplier.get();
+        long sizeIfKnown = spliterator.getExactSizeIfKnown();
+        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
+
+        ArrayList<T> fromForEach = new ArrayList<>();
+        spliterator = supplier.get();
+        Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add);
+        spliterator.forEachRemaining(addToFromForEach);
+
+        // Assert that forEach now produces no elements
+        spliterator.forEachRemaining(boxingAdapter.apply(
+                e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
+        // Assert that tryAdvance now produce no elements
+        spliterator.tryAdvance(boxingAdapter.apply(
+                e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
+
+        // assert that size, tryAdvance, and forEach are consistent
+        if (sizeIfKnown >= 0) {
+            assertEquals(sizeIfKnown, exp.size());
+        }
+        if (exp.contains(null)) {
+            assertTrue(fromForEach.contains(null));
+        }
+        assertEquals(fromForEach.size(), exp.size());
+
+        asserter.assertContents(fromForEach, exp, isOrdered);
+    }
+
+    private static <T, S extends Spliterator<T>> void testTryAdvance(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter,
+            ContentAsserter<T> asserter) {
+        S spliterator = supplier.get();
+        long sizeIfKnown = spliterator.getExactSizeIfKnown();
+        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
+
+        spliterator = supplier.get();
+        ArrayList<T> fromTryAdvance = new ArrayList<>();
+        Consumer<T> addToFromTryAdvance = boxingAdapter.apply(fromTryAdvance::add);
+        while (spliterator.tryAdvance(addToFromTryAdvance)) { }
+
+        // Assert that forEach now produces no elements
+        spliterator.forEachRemaining(boxingAdapter.apply(
+                e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
+        // Assert that tryAdvance now produce no elements
+        spliterator.tryAdvance(boxingAdapter.apply(
+                e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
+
+        // assert that size, tryAdvance, and forEach are consistent
+        if (sizeIfKnown >= 0) {
+            assertEquals(sizeIfKnown, exp.size());
+        }
+        assertEquals(fromTryAdvance.size(), exp.size());
+
+        asserter.assertContents(fromTryAdvance, exp, isOrdered);
+    }
+
+    private static <T, S extends Spliterator<T>> void testMixedTryAdvanceForEach(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter,
+            ContentAsserter<T> asserter) {
+        S spliterator = supplier.get();
+        long sizeIfKnown = spliterator.getExactSizeIfKnown();
+        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
+
+        // tryAdvance first few elements, then forEach rest
+        ArrayList<T> dest = new ArrayList<>();
+        spliterator = supplier.get();
+        Consumer<T> addToDest = boxingAdapter.apply(dest::add);
+        for (int i = 0; i < 10 && spliterator.tryAdvance(addToDest); i++) { }
+        spliterator.forEachRemaining(addToDest);
+
+        // Assert that forEach now produces no elements
+        spliterator.forEachRemaining(boxingAdapter.apply(
+                e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
+        // Assert that tryAdvance now produce no elements
+        spliterator.tryAdvance(boxingAdapter.apply(
+                e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
+
+        if (sizeIfKnown >= 0) {
+            assertEquals(sizeIfKnown, dest.size());
+        }
+        assertEquals(dest.size(), exp.size());
+
+        asserter.assertContents(dest, exp, isOrdered);
+    }
+
+    private static <T, S extends Spliterator<T>> void testMixedTraverseAndSplit(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter,
+            ContentAsserter<T> asserter) {
+        S spliterator = supplier.get();
+        long sizeIfKnown = spliterator.getExactSizeIfKnown();
+        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
+
+        // tryAdvance first few elements, then forEach rest
+        ArrayList<T> dest = new ArrayList<>();
+        spliterator = supplier.get();
+        Consumer<T> b = boxingAdapter.apply(dest::add);
+
+        Spliterator<T> spl1, spl2, spl3;
+        spliterator.tryAdvance(b);
+        spl2 = spliterator.trySplit();
+        if (spl2 != null) {
+            spl2.tryAdvance(b);
+            spl1 = spl2.trySplit();
+            if (spl1 != null) {
+                spl1.tryAdvance(b);
+                spl1.forEachRemaining(b);
+            }
+            spl2.tryAdvance(b);
+            spl2.forEachRemaining(b);
+        }
+        spliterator.tryAdvance(b);
+        spl3 = spliterator.trySplit();
+        if (spl3 != null) {
+            spl3.tryAdvance(b);
+            spl3.forEachRemaining(b);
+        }
+        spliterator.tryAdvance(b);
+        spliterator.forEachRemaining(b);
+
+        if (sizeIfKnown >= 0) {
+            assertEquals(sizeIfKnown, dest.size());
+        }
+        assertEquals(dest.size(), exp.size());
+
+        asserter.assertContents(dest, exp, isOrdered);
+    }
+
+    public static <T, S extends Spliterator<T>> void testSplitAfterFullTraversal(
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter) {
+        // Full traversal using tryAdvance
+        Spliterator<T> spliterator = supplier.get();
+        while (spliterator.tryAdvance(boxingAdapter.apply(e -> { }))) { }
+        Spliterator<T> split = spliterator.trySplit();
+        assertNull(split);
+
+        // Full traversal using forEach
+        spliterator = supplier.get();
+        spliterator.forEachRemaining(boxingAdapter.apply(e -> { }));
+        split = spliterator.trySplit();
+        assertNull(split);
+
+        // Full traversal using tryAdvance then forEach
+        spliterator = supplier.get();
+        spliterator.tryAdvance(boxingAdapter.apply(e -> { }));
+        spliterator.forEachRemaining(boxingAdapter.apply(e -> { }));
+        split = spliterator.trySplit();
+        assertNull(split);
+    }
+
+    private static <T, S extends Spliterator<T>> void testSplitOnce(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter,
+            ContentAsserter<T> asserter) {
+        S spliterator = supplier.get();
+        long sizeIfKnown = spliterator.getExactSizeIfKnown();
+        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
+
+        ArrayList<T> fromSplit = new ArrayList<>();
+        Spliterator<T> s1 = supplier.get();
+        Spliterator<T> s2 = s1.trySplit();
+        long s1Size = s1.getExactSizeIfKnown();
+        long s2Size = (s2 != null) ? s2.getExactSizeIfKnown() : 0;
+        Consumer<T> addToFromSplit = boxingAdapter.apply(fromSplit::add);
+        if (s2 != null)
+            s2.forEachRemaining(addToFromSplit);
+        s1.forEachRemaining(addToFromSplit);
+
+        if (sizeIfKnown >= 0) {
+            assertEquals(sizeIfKnown, fromSplit.size());
+            if (s1Size >= 0 && s2Size >= 0)
+                assertEquals(sizeIfKnown, s1Size + s2Size);
+        }
+
+        asserter.assertContents(fromSplit, exp, isOrdered);
+    }
+
+    private static <T, S extends Spliterator<T>> void testSplitSixDeep(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter,
+            ContentAsserter<T> asserter) {
+        S spliterator = supplier.get();
+        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
+
+        for (int depth=0; depth < 6; depth++) {
+            List<T> dest = new ArrayList<>();
+            spliterator = supplier.get();
+
+            assertSpliterator(spliterator);
+
+            // verify splitting with forEach
+            splitSixDeepVisitor(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), false);
+            asserter.assertContents(dest, exp, isOrdered);
+
+            // verify splitting with tryAdvance
+            dest.clear();
+            spliterator = supplier.get();
+            splitSixDeepVisitor(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), true);
+            asserter.assertContents(dest, exp, isOrdered);
+        }
+    }
+
+    private static <T, S extends Spliterator<T>>
+    void splitSixDeepVisitor(int depth, int curLevel,
+                             List<T> dest, S spliterator, UnaryOperator<Consumer<T>> boxingAdapter,
+                             int rootCharacteristics, boolean useTryAdvance) {
+        if (curLevel < depth) {
+            long beforeSize = spliterator.getExactSizeIfKnown();
+            Spliterator<T> split = spliterator.trySplit();
+            if (split != null) {
+                assertSpliterator(split, rootCharacteristics);
+                assertSpliterator(spliterator, rootCharacteristics);
+
+                if ((rootCharacteristics & Spliterator.SUBSIZED) != 0 &&
+                    (rootCharacteristics & Spliterator.SIZED) != 0) {
+                    assertEquals(beforeSize, split.estimateSize() + spliterator.estimateSize());
+                }
+                splitSixDeepVisitor(depth, curLevel + 1, dest, split, boxingAdapter, rootCharacteristics, useTryAdvance);
+            }
+            splitSixDeepVisitor(depth, curLevel + 1, dest, spliterator, boxingAdapter, rootCharacteristics, useTryAdvance);
+        }
+        else {
+            long sizeIfKnown = spliterator.getExactSizeIfKnown();
+            if (useTryAdvance) {
+                Consumer<T> addToDest = boxingAdapter.apply(dest::add);
+                int count = 0;
+                while (spliterator.tryAdvance(addToDest)) {
+                    ++count;
+                }
+
+                if (sizeIfKnown >= 0)
+                    assertEquals(sizeIfKnown, count);
+
+                // Assert that forEach now produces no elements
+                spliterator.forEachRemaining(boxingAdapter.apply(
+                        e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
+
+                Spliterator<T> split = spliterator.trySplit();
+                assertNull(split);
+            }
+            else {
+                List<T> leafDest = new ArrayList<>();
+                Consumer<T> addToLeafDest = boxingAdapter.apply(leafDest::add);
+                spliterator.forEachRemaining(addToLeafDest);
+
+                if (sizeIfKnown >= 0)
+                    assertEquals(sizeIfKnown, leafDest.size());
+
+                // Assert that forEach now produces no elements
+                spliterator.tryAdvance(boxingAdapter.apply(
+                        e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
+
+                Spliterator<T> split = spliterator.trySplit();
+                assertNull(split);
+
+                dest.addAll(leafDest);
+            }
+        }
+    }
+
+    private static <T, S extends Spliterator<T>> void testSplitUntilNull(
+            Collection<T> exp,
+            Supplier<S> supplier,
+            UnaryOperator<Consumer<T>> boxingAdapter,
+            ContentAsserter<T> asserter) {
+        Spliterator<T> s = supplier.get();
+        boolean isOrdered = s.hasCharacteristics(Spliterator.ORDERED);
+        assertSpliterator(s);
+
+        List<T> splits = new ArrayList<>();
+        Consumer<T> c = boxingAdapter.apply(splits::add);
+
+        testSplitUntilNull(new SplitNode<T>(c, s));
+        asserter.assertContents(splits, exp, isOrdered);
+    }
+
+    private static class SplitNode<T> {
+        // Constant for every node
+        final Consumer<T> c;
+        final int rootCharacteristics;
+
+        final Spliterator<T> s;
+
+        SplitNode(Consumer<T> c, Spliterator<T> s) {
+            this(c, s.characteristics(), s);
+        }
+
+        private SplitNode(Consumer<T> c, int rootCharacteristics, Spliterator<T> s) {
+            this.c = c;
+            this.rootCharacteristics = rootCharacteristics;
+            this.s = s;
+        }
+
+        SplitNode<T> fromSplit(Spliterator<T> split) {
+            return new SplitNode<>(c, rootCharacteristics, split);
+        }
+    }
+
+    /**
+     * Set the maximum stack capacity to 0.25MB. This should be more than enough to detect a bad spliterator
+     * while not unduly disrupting test infrastructure given the test data sizes that are used are small.
+     * Note that j.u.c.ForkJoinPool sets the max queue size to 64M (1 << 26).
+     */
+    private static final int MAXIMUM_STACK_CAPACITY = 1 << 18; // 0.25MB
+
+    private static <T> void testSplitUntilNull(SplitNode<T> e) {
+        // Use an explicit stack to avoid a StackOverflowException when testing a Spliterator
+        // that when repeatedly split produces a right-balanced (and maybe degenerate) tree, or
+        // for a spliterator that is badly behaved.
+        Deque<SplitNode<T>> stack = new ArrayDeque<>();
+        stack.push(e);
+
+        int iteration = 0;
+        while (!stack.isEmpty()) {
+            assertTrue(iteration++ < MAXIMUM_STACK_CAPACITY, "Exceeded maximum stack modification count of 1 << 18");
+
+            e = stack.pop();
+            Spliterator<T> parentAndRightSplit = e.s;
+
+            long parentEstimateSize = parentAndRightSplit.estimateSize();
+            assertTrue(parentEstimateSize >= 0,
+                       String.format("Split size estimate %d < 0", parentEstimateSize));
+
+            long parentSize = parentAndRightSplit.getExactSizeIfKnown();
+            Spliterator<T> leftSplit = parentAndRightSplit.trySplit();
+            if (leftSplit == null) {
+                parentAndRightSplit.forEachRemaining(e.c);
+                continue;
+            }
+
+            assertSpliterator(leftSplit, e.rootCharacteristics);
+            assertSpliterator(parentAndRightSplit, e.rootCharacteristics);
+
+            if (parentEstimateSize != Long.MAX_VALUE && leftSplit.estimateSize() > 0
+                && parentAndRightSplit.estimateSize() > 0) {
+                assertTrue(leftSplit.estimateSize() < parentEstimateSize,
+                           String.format("Left split size estimate %d >= parent split size estimate %d",
+                                         leftSplit.estimateSize(), parentEstimateSize));
+                assertTrue(parentAndRightSplit.estimateSize() < parentEstimateSize,
+                           String.format("Right split size estimate %d >= parent split size estimate %d",
+                                         leftSplit.estimateSize(), parentEstimateSize));
+            }
+            else {
+                assertTrue(leftSplit.estimateSize() <= parentEstimateSize,
+                           String.format("Left split size estimate %d > parent split size estimate %d",
+                                         leftSplit.estimateSize(), parentEstimateSize));
+                assertTrue(parentAndRightSplit.estimateSize() <= parentEstimateSize,
+                           String.format("Right split size estimate %d > parent split size estimate %d",
+                                         leftSplit.estimateSize(), parentEstimateSize));
+            }
+
+            long leftSize = leftSplit.getExactSizeIfKnown();
+            long rightSize = parentAndRightSplit.getExactSizeIfKnown();
+            if (parentSize >= 0 && leftSize >= 0 && rightSize >= 0)
+                assertEquals(parentSize, leftSize + rightSize,
+                             String.format("exact left split size %d + exact right split size %d != parent exact split size %d",
+                                           leftSize, rightSize, parentSize));
+
+            // Add right side to stack first so left side is popped off first
+            stack.push(e.fromSplit(parentAndRightSplit));
+            stack.push(e.fromSplit(leftSplit));
+        }
+    }
+
+    private static void assertSpliterator(Spliterator<?> s, int rootCharacteristics) {
+        if ((rootCharacteristics & Spliterator.SUBSIZED) != 0) {
+            assertTrue(s.hasCharacteristics(Spliterator.SUBSIZED),
+                       "Child split is not SUBSIZED when root split is SUBSIZED");
+        }
+        assertSpliterator(s);
+    }
+
+    private static void assertSpliterator(Spliterator<?> s) {
+        if (s.hasCharacteristics(Spliterator.SUBSIZED)) {
+            assertTrue(s.hasCharacteristics(Spliterator.SIZED));
+        }
+        if (s.hasCharacteristics(Spliterator.SIZED)) {
+            assertTrue(s.estimateSize() != Long.MAX_VALUE);
+            assertTrue(s.getExactSizeIfKnown() >= 0);
+        }
+        try {
+            s.getComparator();
+            assertTrue(s.hasCharacteristics(Spliterator.SORTED));
+        } catch (IllegalStateException e) {
+            assertFalse(s.hasCharacteristics(Spliterator.SORTED));
+        }
+    }
+
+    private static<T> void assertContents(Collection<T> actual, Collection<T> expected, boolean isOrdered) {
+        if (isOrdered) {
+            assertEquals(actual, expected);
+        }
+        else {
+            LambdaTestHelpers.assertContentsUnordered(actual, expected);
+        }
+    }
+
+    public static void executeAndCatch(Class<? extends Exception> expected, Runnable r) {
+        Exception caught = null;
+        try {
+            r.run();
+        }
+        catch (Exception e) {
+            caught = e;
+        }
+
+        assertNotNull(caught,
+                      String.format("No Exception was thrown, expected an Exception of %s to be thrown",
+                                    expected.getName()));
+        assertTrue(expected.isInstance(caught),
+                   String.format("Exception thrown %s not an instance of %s",
+                                 caught.getClass().getName(), expected.getName()));
+    }
+
+    public static<U> void mixedTraverseAndSplit(Consumer<U> b, Spliterator<U> splTop) {
+        Spliterator<U> spl1, spl2, spl3;
+        splTop.tryAdvance(b);
+        spl2 = splTop.trySplit();
+        if (spl2 != null) {
+            spl2.tryAdvance(b);
+            spl1 = spl2.trySplit();
+            if (spl1 != null) {
+                spl1.tryAdvance(b);
+                spl1.forEachRemaining(b);
+            }
+            spl2.tryAdvance(b);
+            spl2.forEachRemaining(b);
+        }
+        splTop.tryAdvance(b);
+        spl3 = splTop.trySplit();
+        if (spl3 != null) {
+            spl3.tryAdvance(b);
+            spl3.forEachRemaining(b);
+        }
+        splTop.tryAdvance(b);
+        splTop.forEachRemaining(b);
+    }
+
+    public static void mixedTraverseAndSplit(IntConsumer b, Spliterator.OfInt splTop) {
+        Spliterator.OfInt spl1, spl2, spl3;
+        splTop.tryAdvance(b);
+        spl2 = splTop.trySplit();
+        if (spl2 != null) {
+            spl2.tryAdvance(b);
+            spl1 = spl2.trySplit();
+            if (spl1 != null) {
+                spl1.tryAdvance(b);
+                spl1.forEachRemaining(b);
+            }
+            spl2.tryAdvance(b);
+            spl2.forEachRemaining(b);
+        }
+        splTop.tryAdvance(b);
+        spl3 = splTop.trySplit();
+        if (spl3 != null) {
+            spl3.tryAdvance(b);
+            spl3.forEachRemaining(b);
+        }
+        splTop.tryAdvance(b);
+        splTop.forEachRemaining(b);
+    }
+
+    public static void mixedTraverseAndSplit(LongConsumer b, Spliterator.OfLong splTop) {
+        Spliterator.OfLong spl1, spl2, spl3;
+        splTop.tryAdvance(b);
+        spl2 = splTop.trySplit();
+        if (spl2 != null) {
+            spl2.tryAdvance(b);
+            spl1 = spl2.trySplit();
+            if (spl1 != null) {
+                spl1.tryAdvance(b);
+                spl1.forEachRemaining(b);
+            }
+            spl2.tryAdvance(b);
+            spl2.forEachRemaining(b);
+        }
+        splTop.tryAdvance(b);
+        spl3 = splTop.trySplit();
+        if (spl3 != null) {
+            spl3.tryAdvance(b);
+            spl3.forEachRemaining(b);
+        }
+        splTop.tryAdvance(b);
+        splTop.forEachRemaining(b);
+    }
+
+    public static void mixedTraverseAndSplit(DoubleConsumer b, Spliterator.OfDouble splTop) {
+        Spliterator.OfDouble spl1, spl2, spl3;
+        splTop.tryAdvance(b);
+        spl2 = splTop.trySplit();
+        if (spl2 != null) {
+            spl2.tryAdvance(b);
+            spl1 = spl2.trySplit();
+            if (spl1 != null) {
+                spl1.tryAdvance(b);
+                spl1.forEachRemaining(b);
+            }
+            spl2.tryAdvance(b);
+            spl2.forEachRemaining(b);
+        }
+        splTop.tryAdvance(b);
+        spl3 = splTop.trySplit();
+        if (spl3 != null) {
+            spl3.tryAdvance(b);
+            spl3.forEachRemaining(b);
+        }
+        splTop.tryAdvance(b);
+        splTop.forEachRemaining(b);
+    }
+
+}
diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/DoubleStreamTestScenario.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/DoubleStreamTestScenario.java
index f1ff338..c717e22 100644
--- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/DoubleStreamTestScenario.java
+++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/DoubleStreamTestScenario.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import java.util.PrimitiveIterator;
 import java.util.Set;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 import java.util.function.Consumer;
 import java.util.function.DoubleConsumer;
 import java.util.function.Function;
diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/IntStreamTestScenario.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/IntStreamTestScenario.java
index 526638d..37bf656 100644
--- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/IntStreamTestScenario.java
+++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/IntStreamTestScenario.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import java.util.PrimitiveIterator;
 import java.util.Set;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.IntConsumer;
diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LongStreamTestScenario.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LongStreamTestScenario.java
index acc2492..9cfc8c6 100644
--- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LongStreamTestScenario.java
+++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LongStreamTestScenario.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import java.util.PrimitiveIterator;
 import java.util.Set;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.LongConsumer;
diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/SpliteratorTestHelper.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/SpliteratorTestHelper.java
deleted file mode 100644
index a3446ff..0000000
--- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/SpliteratorTestHelper.java
+++ /dev/null
@@ -1,715 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.util.stream;
-
-import org.testng.annotations.Test;
-
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Spliterator;
-import java.util.function.*;
-
-import static org.testng.Assert.*;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.fail;
-
-/**
- * Assertion methods for spliterators, to be called from other tests
- */
-public class SpliteratorTestHelper {
-
-    public interface ContentAsserter<T> {
-        void assertContents(Collection<T> actual, Collection<T> expected, boolean isOrdered);
-    }
-
-    private static ContentAsserter<Object> DEFAULT_CONTENT_ASSERTER
-            = SpliteratorTestHelper::assertContents;
-
-    @SuppressWarnings("unchecked")
-    private static <T> ContentAsserter<T> defaultContentAsserter() {
-        return (ContentAsserter<T>) DEFAULT_CONTENT_ASSERTER;
-    }
-
-    public static void testSpliterator(Supplier<Spliterator<Integer>> supplier) {
-        testSpliterator(supplier, defaultContentAsserter());
-    }
-
-    public static void testSpliterator(Supplier<Spliterator<Integer>> supplier,
-                                       ContentAsserter<Integer> asserter) {
-        testSpliterator(supplier, (Consumer<Integer> b) -> b, asserter);
-    }
-
-    public static void testIntSpliterator(Supplier<Spliterator.OfInt> supplier) {
-        testIntSpliterator(supplier, defaultContentAsserter());
-    }
-
-    public static void testIntSpliterator(Supplier<Spliterator.OfInt> supplier,
-                                          ContentAsserter<Integer> asserter) {
-        class BoxingAdapter implements Consumer<Integer>, IntConsumer {
-            private final Consumer<Integer> b;
-
-            BoxingAdapter(Consumer<Integer> b) {
-                this.b = b;
-            }
-
-            @Override
-            public void accept(Integer value) {
-                throw new IllegalStateException();
-            }
-
-            @Override
-            public void accept(int value) {
-                b.accept(value);
-            }
-        }
-
-        testSpliterator(supplier, BoxingAdapter::new, asserter);
-    }
-
-    public static void testLongSpliterator(Supplier<Spliterator.OfLong> supplier) {
-        testLongSpliterator(supplier, defaultContentAsserter());
-    }
-
-    public static void testLongSpliterator(Supplier<Spliterator.OfLong> supplier,
-                                           ContentAsserter<Long> asserter) {
-        class BoxingAdapter implements Consumer<Long>, LongConsumer {
-            private final Consumer<Long> b;
-
-            BoxingAdapter(Consumer<Long> b) {
-                this.b = b;
-            }
-
-            @Override
-            public void accept(Long value) {
-                throw new IllegalStateException();
-            }
-
-            @Override
-            public void accept(long value) {
-                b.accept(value);
-            }
-        }
-
-        testSpliterator(supplier, BoxingAdapter::new, asserter);
-    }
-
-    public static void testDoubleSpliterator(Supplier<Spliterator.OfDouble> supplier) {
-        testDoubleSpliterator(supplier, defaultContentAsserter());
-    }
-
-    public static void testDoubleSpliterator(Supplier<Spliterator.OfDouble> supplier,
-                                             ContentAsserter<Double> asserter) {
-        class BoxingAdapter implements Consumer<Double>, DoubleConsumer {
-            private final Consumer<Double> b;
-
-            BoxingAdapter(Consumer<Double> b) {
-                this.b = b;
-            }
-
-            @Override
-            public void accept(Double value) {
-                throw new IllegalStateException();
-            }
-
-            @Override
-            public void accept(double value) {
-                b.accept(value);
-            }
-        }
-
-        testSpliterator(supplier, BoxingAdapter::new, asserter);
-    }
-
-    static <T, S extends Spliterator<T>> void testSpliterator(Supplier<S> supplier,
-                                                              UnaryOperator<Consumer<T>> boxingAdapter,
-                                                              ContentAsserter<T> asserter) {
-        ArrayList<T> fromForEach = new ArrayList<>();
-        Spliterator<T> spliterator = supplier.get();
-        Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add);
-        spliterator.forEachRemaining(addToFromForEach);
-
-        Collection<T> exp = Collections.unmodifiableList(fromForEach);
-
-        testNullPointerException(supplier);
-        testForEach(exp, supplier, boxingAdapter, asserter);
-        testTryAdvance(exp, supplier, boxingAdapter, asserter);
-        testMixedTryAdvanceForEach(exp, supplier, boxingAdapter, asserter);
-        testMixedTraverseAndSplit(exp, supplier, boxingAdapter, asserter);
-        testSplitAfterFullTraversal(supplier, boxingAdapter);
-        testSplitOnce(exp, supplier, boxingAdapter, asserter);
-        testSplitSixDeep(exp, supplier, boxingAdapter, asserter);
-        testSplitUntilNull(exp, supplier, boxingAdapter, asserter);
-    }
-
-    //
-
-    private static <T, S extends Spliterator<T>> void testNullPointerException(Supplier<S> s) {
-        S sp = s.get();
-        // Have to check instances and use casts to avoid tripwire messages and
-        // directly test the primitive methods
-        if (sp instanceof Spliterator.OfInt) {
-            Spliterator.OfInt psp = (Spliterator.OfInt) sp;
-            executeAndCatch(NullPointerException.class, () -> psp.forEachRemaining((IntConsumer) null));
-            executeAndCatch(NullPointerException.class, () -> psp.tryAdvance((IntConsumer) null));
-        }
-        else if (sp instanceof Spliterator.OfLong) {
-            Spliterator.OfLong psp = (Spliterator.OfLong) sp;
-            executeAndCatch(NullPointerException.class, () -> psp.forEachRemaining((LongConsumer) null));
-            executeAndCatch(NullPointerException.class, () -> psp.tryAdvance((LongConsumer) null));
-        }
-        else if (sp instanceof Spliterator.OfDouble) {
-            Spliterator.OfDouble psp = (Spliterator.OfDouble) sp;
-            executeAndCatch(NullPointerException.class, () -> psp.forEachRemaining((DoubleConsumer) null));
-            executeAndCatch(NullPointerException.class, () -> psp.tryAdvance((DoubleConsumer) null));
-        }
-        else {
-            executeAndCatch(NullPointerException.class, () -> sp.forEachRemaining(null));
-            executeAndCatch(NullPointerException.class, () -> sp.tryAdvance(null));
-        }
-    }
-
-    private static <T, S extends Spliterator<T>> void testForEach(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter,
-            ContentAsserter<T> asserter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        ArrayList<T> fromForEach = new ArrayList<>();
-        spliterator = supplier.get();
-        Consumer<T> addToFromForEach = boxingAdapter.apply(fromForEach::add);
-        spliterator.forEachRemaining(addToFromForEach);
-
-        // Assert that forEach now produces no elements
-        spliterator.forEachRemaining(boxingAdapter.apply(
-                e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-        // Assert that tryAdvance now produce no elements
-        spliterator.tryAdvance(boxingAdapter.apply(
-                e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-        // assert that size, tryAdvance, and forEach are consistent
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, exp.size());
-        }
-        assertEquals(fromForEach.size(), exp.size());
-
-        asserter.assertContents(fromForEach, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testTryAdvance(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter,
-            ContentAsserter<T> asserter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        spliterator = supplier.get();
-        ArrayList<T> fromTryAdvance = new ArrayList<>();
-        Consumer<T> addToFromTryAdvance = boxingAdapter.apply(fromTryAdvance::add);
-        while (spliterator.tryAdvance(addToFromTryAdvance)) { }
-
-        // Assert that forEach now produces no elements
-        spliterator.forEachRemaining(boxingAdapter.apply(
-                e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-        // Assert that tryAdvance now produce no elements
-        spliterator.tryAdvance(boxingAdapter.apply(
-                e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-        // assert that size, tryAdvance, and forEach are consistent
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, exp.size());
-        }
-        assertEquals(fromTryAdvance.size(), exp.size());
-
-        asserter.assertContents(fromTryAdvance, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testMixedTryAdvanceForEach(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter,
-            ContentAsserter<T> asserter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        // tryAdvance first few elements, then forEach rest
-        ArrayList<T> dest = new ArrayList<>();
-        spliterator = supplier.get();
-        Consumer<T> addToDest = boxingAdapter.apply(dest::add);
-        for (int i = 0; i < 10 && spliterator.tryAdvance(addToDest); i++) { }
-        spliterator.forEachRemaining(addToDest);
-
-        // Assert that forEach now produces no elements
-        spliterator.forEachRemaining(boxingAdapter.apply(
-                e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-        // Assert that tryAdvance now produce no elements
-        spliterator.tryAdvance(boxingAdapter.apply(
-                e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, dest.size());
-        }
-        assertEquals(dest.size(), exp.size());
-
-        asserter.assertContents(dest, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testMixedTraverseAndSplit(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter,
-            ContentAsserter<T> asserter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        // tryAdvance first few elements, then forEach rest
-        ArrayList<T> dest = new ArrayList<>();
-        spliterator = supplier.get();
-        Consumer<T> b = boxingAdapter.apply(dest::add);
-
-        Spliterator<T> spl1, spl2, spl3;
-        spliterator.tryAdvance(b);
-        spl2 = spliterator.trySplit();
-        if (spl2 != null) {
-            spl2.tryAdvance(b);
-            spl1 = spl2.trySplit();
-            if (spl1 != null) {
-                spl1.tryAdvance(b);
-                spl1.forEachRemaining(b);
-            }
-            spl2.tryAdvance(b);
-            spl2.forEachRemaining(b);
-        }
-        spliterator.tryAdvance(b);
-        spl3 = spliterator.trySplit();
-        if (spl3 != null) {
-            spl3.tryAdvance(b);
-            spl3.forEachRemaining(b);
-        }
-        spliterator.tryAdvance(b);
-        spliterator.forEachRemaining(b);
-
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, dest.size());
-        }
-        assertEquals(dest.size(), exp.size());
-
-        asserter.assertContents(dest, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitAfterFullTraversal(
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter) {
-        // Full traversal using tryAdvance
-        Spliterator<T> spliterator = supplier.get();
-        while (spliterator.tryAdvance(boxingAdapter.apply(e -> { }))) { }
-        Spliterator<T> split = spliterator.trySplit();
-        assertNull(split);
-
-        // Full traversal using forEach
-        spliterator = supplier.get();
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> { }));
-        split = spliterator.trySplit();
-        assertNull(split);
-
-        // Full traversal using tryAdvance then forEach
-        spliterator = supplier.get();
-        spliterator.tryAdvance(boxingAdapter.apply(e -> { }));
-        spliterator.forEachRemaining(boxingAdapter.apply(e -> { }));
-        split = spliterator.trySplit();
-        assertNull(split);
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitOnce(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter,
-            ContentAsserter<T> asserter) {
-        S spliterator = supplier.get();
-        long sizeIfKnown = spliterator.getExactSizeIfKnown();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        ArrayList<T> fromSplit = new ArrayList<>();
-        Spliterator<T> s1 = supplier.get();
-        Spliterator<T> s2 = s1.trySplit();
-        long s1Size = s1.getExactSizeIfKnown();
-        long s2Size = (s2 != null) ? s2.getExactSizeIfKnown() : 0;
-        Consumer<T> addToFromSplit = boxingAdapter.apply(fromSplit::add);
-        if (s2 != null)
-            s2.forEachRemaining(addToFromSplit);
-        s1.forEachRemaining(addToFromSplit);
-
-        if (sizeIfKnown >= 0) {
-            assertEquals(sizeIfKnown, fromSplit.size());
-            if (s1Size >= 0 && s2Size >= 0)
-                assertEquals(sizeIfKnown, s1Size + s2Size);
-        }
-
-        asserter.assertContents(fromSplit, exp, isOrdered);
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitSixDeep(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter,
-            ContentAsserter<T> asserter) {
-        S spliterator = supplier.get();
-        boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED);
-
-        for (int depth=0; depth < 6; depth++) {
-            List<T> dest = new ArrayList<>();
-            spliterator = supplier.get();
-
-            assertSpliterator(spliterator);
-
-            // verify splitting with forEach
-            splitSixDeepVisitor(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), false);
-            asserter.assertContents(dest, exp, isOrdered);
-
-            // verify splitting with tryAdvance
-            dest.clear();
-            spliterator = supplier.get();
-            splitSixDeepVisitor(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), true);
-            asserter.assertContents(dest, exp, isOrdered);
-        }
-    }
-
-    private static <T, S extends Spliterator<T>>
-    void splitSixDeepVisitor(int depth, int curLevel,
-                             List<T> dest, S spliterator, UnaryOperator<Consumer<T>> boxingAdapter,
-                             int rootCharacteristics, boolean useTryAdvance) {
-        if (curLevel < depth) {
-            long beforeSize = spliterator.getExactSizeIfKnown();
-            Spliterator<T> split = spliterator.trySplit();
-            if (split != null) {
-                assertSpliterator(split, rootCharacteristics);
-                assertSpliterator(spliterator, rootCharacteristics);
-
-                if ((rootCharacteristics & Spliterator.SUBSIZED) != 0 &&
-                    (rootCharacteristics & Spliterator.SIZED) != 0) {
-                    assertEquals(beforeSize, split.estimateSize() + spliterator.estimateSize());
-                }
-                splitSixDeepVisitor(depth, curLevel + 1, dest, split, boxingAdapter, rootCharacteristics, useTryAdvance);
-            }
-            splitSixDeepVisitor(depth, curLevel + 1, dest, spliterator, boxingAdapter, rootCharacteristics, useTryAdvance);
-        }
-        else {
-            long sizeIfKnown = spliterator.getExactSizeIfKnown();
-            if (useTryAdvance) {
-                Consumer<T> addToDest = boxingAdapter.apply(dest::add);
-                int count = 0;
-                while (spliterator.tryAdvance(addToDest)) {
-                    ++count;
-                }
-
-                if (sizeIfKnown >= 0)
-                    assertEquals(sizeIfKnown, count);
-
-                // Assert that forEach now produces no elements
-                spliterator.forEachRemaining(boxingAdapter.apply(
-                        e -> fail("Spliterator.forEach produced an element after spliterator exhausted: " + e)));
-
-                Spliterator<T> split = spliterator.trySplit();
-                assertNull(split);
-            }
-            else {
-                List<T> leafDest = new ArrayList<>();
-                Consumer<T> addToLeafDest = boxingAdapter.apply(leafDest::add);
-                spliterator.forEachRemaining(addToLeafDest);
-
-                if (sizeIfKnown >= 0)
-                    assertEquals(sizeIfKnown, leafDest.size());
-
-                // Assert that forEach now produces no elements
-                spliterator.tryAdvance(boxingAdapter.apply(
-                        e -> fail("Spliterator.tryAdvance produced an element after spliterator exhausted: " + e)));
-
-                Spliterator<T> split = spliterator.trySplit();
-                assertNull(split);
-
-                dest.addAll(leafDest);
-            }
-        }
-    }
-
-    private static <T, S extends Spliterator<T>> void testSplitUntilNull(
-            Collection<T> exp,
-            Supplier<S> supplier,
-            UnaryOperator<Consumer<T>> boxingAdapter,
-            ContentAsserter<T> asserter) {
-        Spliterator<T> s = supplier.get();
-        boolean isOrdered = s.hasCharacteristics(Spliterator.ORDERED);
-        assertSpliterator(s);
-
-        List<T> splits = new ArrayList<>();
-        Consumer<T> c = boxingAdapter.apply(splits::add);
-
-        testSplitUntilNull(new SplitNode<T>(c, s));
-        asserter.assertContents(splits, exp, isOrdered);
-    }
-
-    private static class SplitNode<T> {
-        // Constant for every node
-        final Consumer<T> c;
-        final int rootCharacteristics;
-
-        final Spliterator<T> s;
-
-        SplitNode(Consumer<T> c, Spliterator<T> s) {
-            this(c, s.characteristics(), s);
-        }
-
-        private SplitNode(Consumer<T> c, int rootCharacteristics, Spliterator<T> s) {
-            this.c = c;
-            this.rootCharacteristics = rootCharacteristics;
-            this.s = s;
-        }
-
-        SplitNode<T> fromSplit(Spliterator<T> split) {
-            return new SplitNode<>(c, rootCharacteristics, split);
-        }
-    }
-
-    /**
-     * Set the maximum stack capacity to 0.25MB. This should be more than enough to detect a bad spliterator
-     * while not unduly disrupting test infrastructure given the test data sizes that are used are small.
-     * Note that j.u.c.ForkJoinPool sets the max queue size to 64M (1 << 26).
-     */
-    private static final int MAXIMUM_STACK_CAPACITY = 1 << 18; // 0.25MB
-
-    private static <T> void testSplitUntilNull(SplitNode<T> e) {
-        // Use an explicit stack to avoid a StackOverflowException when testing a Spliterator
-        // that when repeatedly split produces a right-balanced (and maybe degenerate) tree, or
-        // for a spliterator that is badly behaved.
-        Deque<SplitNode<T>> stack = new ArrayDeque<>();
-        stack.push(e);
-
-        int iteration = 0;
-        while (!stack.isEmpty()) {
-            assertTrue(iteration++ < MAXIMUM_STACK_CAPACITY, "Exceeded maximum stack modification count of 1 << 18");
-
-            e = stack.pop();
-            Spliterator<T> parentAndRightSplit = e.s;
-
-            long parentEstimateSize = parentAndRightSplit.estimateSize();
-            assertTrue(parentEstimateSize >= 0,
-                       String.format("Split size estimate %d < 0", parentEstimateSize));
-
-            long parentSize = parentAndRightSplit.getExactSizeIfKnown();
-            Spliterator<T> leftSplit = parentAndRightSplit.trySplit();
-            if (leftSplit == null) {
-                parentAndRightSplit.forEachRemaining(e.c);
-                continue;
-            }
-
-            assertSpliterator(leftSplit, e.rootCharacteristics);
-            assertSpliterator(parentAndRightSplit, e.rootCharacteristics);
-
-            if (parentEstimateSize != Long.MAX_VALUE && leftSplit.estimateSize() > 0
-                && parentAndRightSplit.estimateSize() > 0) {
-                assertTrue(leftSplit.estimateSize() < parentEstimateSize,
-                           String.format("Left split size estimate %d >= parent split size estimate %d",
-                                         leftSplit.estimateSize(), parentEstimateSize));
-                assertTrue(parentAndRightSplit.estimateSize() < parentEstimateSize,
-                           String.format("Right split size estimate %d >= parent split size estimate %d",
-                                         leftSplit.estimateSize(), parentEstimateSize));
-            }
-            else {
-                assertTrue(leftSplit.estimateSize() <= parentEstimateSize,
-                           String.format("Left split size estimate %d > parent split size estimate %d",
-                                         leftSplit.estimateSize(), parentEstimateSize));
-                assertTrue(parentAndRightSplit.estimateSize() <= parentEstimateSize,
-                           String.format("Right split size estimate %d > parent split size estimate %d",
-                                         leftSplit.estimateSize(), parentEstimateSize));
-            }
-
-            long leftSize = leftSplit.getExactSizeIfKnown();
-            long rightSize = parentAndRightSplit.getExactSizeIfKnown();
-            if (parentSize >= 0 && leftSize >= 0 && rightSize >= 0)
-                assertEquals(parentSize, leftSize + rightSize,
-                             String.format("exact left split size %d + exact right split size %d != parent exact split size %d",
-                                           leftSize, rightSize, parentSize));
-
-            // Add right side to stack first so left side is popped off first
-            stack.push(e.fromSplit(parentAndRightSplit));
-            stack.push(e.fromSplit(leftSplit));
-        }
-    }
-
-    private static void assertSpliterator(Spliterator<?> s, int rootCharacteristics) {
-        if ((rootCharacteristics & Spliterator.SUBSIZED) != 0) {
-            assertTrue(s.hasCharacteristics(Spliterator.SUBSIZED),
-                       "Child split is not SUBSIZED when root split is SUBSIZED");
-        }
-        assertSpliterator(s);
-    }
-
-    private static void assertSpliterator(Spliterator<?> s) {
-        if (s.hasCharacteristics(Spliterator.SUBSIZED)) {
-            assertTrue(s.hasCharacteristics(Spliterator.SIZED));
-        }
-        if (s.hasCharacteristics(Spliterator.SIZED)) {
-            assertTrue(s.estimateSize() != Long.MAX_VALUE);
-            assertTrue(s.getExactSizeIfKnown() >= 0);
-        }
-        try {
-            s.getComparator();
-            assertTrue(s.hasCharacteristics(Spliterator.SORTED));
-        } catch (IllegalStateException e) {
-            assertFalse(s.hasCharacteristics(Spliterator.SORTED));
-        }
-    }
-
-    private static<T> void assertContents(Collection<T> actual, Collection<T> expected, boolean isOrdered) {
-        if (isOrdered) {
-            assertEquals(actual, expected);
-        }
-        else {
-            LambdaTestHelpers.assertContentsUnordered(actual, expected);
-        }
-    }
-
-    private static void executeAndCatch(Class<? extends Exception> expected, Runnable r) {
-        Exception caught = null;
-        try {
-            r.run();
-        }
-        catch (Exception e) {
-            caught = e;
-        }
-
-        assertNotNull(caught,
-                      String.format("No Exception was thrown, expected an Exception of %s to be thrown",
-                                    expected.getName()));
-        assertTrue(expected.isInstance(caught),
-                   String.format("Exception thrown %s not an instance of %s",
-                                 caught.getClass().getName(), expected.getName()));
-    }
-
-    static<U> void mixedTraverseAndSplit(Consumer<U> b, Spliterator<U> splTop) {
-        Spliterator<U> spl1, spl2, spl3;
-        splTop.tryAdvance(b);
-        spl2 = splTop.trySplit();
-        if (spl2 != null) {
-            spl2.tryAdvance(b);
-            spl1 = spl2.trySplit();
-            if (spl1 != null) {
-                spl1.tryAdvance(b);
-                spl1.forEachRemaining(b);
-            }
-            spl2.tryAdvance(b);
-            spl2.forEachRemaining(b);
-        }
-        splTop.tryAdvance(b);
-        spl3 = splTop.trySplit();
-        if (spl3 != null) {
-            spl3.tryAdvance(b);
-            spl3.forEachRemaining(b);
-        }
-        splTop.tryAdvance(b);
-        splTop.forEachRemaining(b);
-    }
-
-    static void mixedTraverseAndSplit(IntConsumer b, Spliterator.OfInt splTop) {
-        Spliterator.OfInt spl1, spl2, spl3;
-        splTop.tryAdvance(b);
-        spl2 = splTop.trySplit();
-        if (spl2 != null) {
-            spl2.tryAdvance(b);
-            spl1 = spl2.trySplit();
-            if (spl1 != null) {
-                spl1.tryAdvance(b);
-                spl1.forEachRemaining(b);
-            }
-            spl2.tryAdvance(b);
-            spl2.forEachRemaining(b);
-        }
-        splTop.tryAdvance(b);
-        spl3 = splTop.trySplit();
-        if (spl3 != null) {
-            spl3.tryAdvance(b);
-            spl3.forEachRemaining(b);
-        }
-        splTop.tryAdvance(b);
-        splTop.forEachRemaining(b);
-    }
-    static void mixedTraverseAndSplit(LongConsumer b, Spliterator.OfLong splTop) {
-        Spliterator.OfLong spl1, spl2, spl3;
-        splTop.tryAdvance(b);
-        spl2 = splTop.trySplit();
-        if (spl2 != null) {
-            spl2.tryAdvance(b);
-            spl1 = spl2.trySplit();
-            if (spl1 != null) {
-                spl1.tryAdvance(b);
-                spl1.forEachRemaining(b);
-            }
-            spl2.tryAdvance(b);
-            spl2.forEachRemaining(b);
-        }
-        splTop.tryAdvance(b);
-        spl3 = splTop.trySplit();
-        if (spl3 != null) {
-            spl3.tryAdvance(b);
-            spl3.forEachRemaining(b);
-        }
-        splTop.tryAdvance(b);
-        splTop.forEachRemaining(b);
-    }
-
-    static void mixedTraverseAndSplit(DoubleConsumer b, Spliterator.OfDouble splTop) {
-        Spliterator.OfDouble spl1, spl2, spl3;
-        splTop.tryAdvance(b);
-        spl2 = splTop.trySplit();
-        if (spl2 != null) {
-            spl2.tryAdvance(b);
-            spl1 = spl2.trySplit();
-            if (spl1 != null) {
-                spl1.tryAdvance(b);
-                spl1.forEachRemaining(b);
-            }
-            spl2.tryAdvance(b);
-            spl2.forEachRemaining(b);
-        }
-        splTop.tryAdvance(b);
-        spl3 = splTop.trySplit();
-        if (spl3 != null) {
-            spl3.tryAdvance(b);
-            spl3.forEachRemaining(b);
-        }
-        splTop.tryAdvance(b);
-        splTop.forEachRemaining(b);
-    }
-}
diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestScenario.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestScenario.java
index 899dfdb..bf7b4e6 100644
--- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestScenario.java
+++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestScenario.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import java.util.Iterator;
 import java.util.Set;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 import java.util.function.Consumer;
 import java.util.function.Function;
 
diff --git a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/DoubleNodeTest.java b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/DoubleNodeTest.java
index c1e8a30..d96bd8c 100644
--- a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/DoubleNodeTest.java
+++ b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/DoubleNodeTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import java.util.List;
 import java.util.PrimitiveIterator;
 import java.util.Spliterators;
+import java.util.SpliteratorTestHelper;
 import java.util.function.Function;
 
 import org.testng.annotations.DataProvider;
diff --git a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/IntNodeTest.java b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/IntNodeTest.java
index e050e63d..459dad4 100644
--- a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/IntNodeTest.java
+++ b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/IntNodeTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import java.util.List;
 import java.util.PrimitiveIterator;
 import java.util.Spliterators;
+import java.util.SpliteratorTestHelper;
 import java.util.function.Function;
 
 import org.testng.annotations.DataProvider;
diff --git a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/LongNodeTest.java b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/LongNodeTest.java
index d266fd7..dbe28c8 100644
--- a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/LongNodeTest.java
+++ b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/LongNodeTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import java.util.List;
 import java.util.PrimitiveIterator;
 import java.util.Spliterators;
+import java.util.SpliteratorTestHelper;
 import java.util.function.Function;
 
 import org.testng.annotations.DataProvider;
diff --git a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/NodeTest.java b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/NodeTest.java
index da71003..61532a5 100644
--- a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/NodeTest.java
+++ b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/NodeTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
+import java.util.SpliteratorTestHelper;
 import java.util.function.Function;
 
 import org.testng.annotations.DataProvider;
diff --git a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/SliceSpliteratorTest.java b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/SliceSpliteratorTest.java
index 7aa27bf..ef0e848 100644
--- a/jdk/test/java/util/stream/boottest/java.base/java/util/stream/SliceSpliteratorTest.java
+++ b/jdk/test/java/util/stream/boottest/java.base/java/util/stream/SliceSpliteratorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 import java.util.Collection;
 import java.util.List;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 
 import static java.util.stream.Collectors.toList;
 import static org.testng.Assert.assertEquals;
diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java
index 20ae203..f9d3385 100644
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 import java.util.Arrays;
 import java.util.Optional;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 import java.util.stream.IntStream;
 import java.util.stream.LongStream;
 import java.util.stream.OpTestCase;
-import java.util.stream.SpliteratorTestHelper;
 import java.util.stream.Stream;
 import java.util.stream.TestData;
 
diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SpliteratorTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SpliteratorTest.java
index d69c585..395b2b6 100644
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SpliteratorTest.java
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SpliteratorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 import java.util.List;
 import java.util.function.Supplier;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 import java.util.stream.*;
 
 import static org.testng.Assert.*;
diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java
index 0d07e7c..d3b0d25 100644
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 import java.util.Comparator;
 import java.util.List;
 import java.util.Spliterator;
+import java.util.SpliteratorTestHelper;
 import java.util.function.Consumer;
 import java.util.function.DoubleConsumer;
 import java.util.function.Function;
@@ -46,7 +47,6 @@
 import java.util.stream.LongStream;
 import java.util.stream.LongStreamTestDataProvider;
 import java.util.stream.OpTestCase;
-import java.util.stream.SpliteratorTestHelper;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
 import java.util.stream.StreamTestDataProvider;
diff --git a/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java b/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
index ae454b5..cc77fce 100644
--- a/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
+++ b/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
@@ -29,7 +29,7 @@
  * test codebase has the java permission to read the "java.runtime.version"
  * system property.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ImplVersionTest ImplVersionCommand
  * @run build ImplVersionTest ImplVersionCommand ImplVersionReader
  * @run main ImplVersionTest
diff --git a/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java b/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java
index 0afb509..43b466f 100644
--- a/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java
+++ b/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java
@@ -27,7 +27,10 @@
  * @summary Test that having a security manager doesn't trigger a
  *          NotCompliantMBeanException
  * @author Daniel Fuchs, Yves Joan
- * @modules java.management
+ *
+ * @modules java.desktop
+ *          java.management
+ *
  * @run clean AnnotationSecurityTest Described UnDescribed DescribedMBean
  *            UnDescribedMBean SqeDescriptorKey DescribedMX DescribedMXBean
  * @run build AnnotationSecurityTest Described UnDescribed DescribedMBean
diff --git a/jdk/test/javax/management/Introspector/AnnotationTest.java b/jdk/test/javax/management/Introspector/AnnotationTest.java
index f14502f..7d0021d 100644
--- a/jdk/test/javax/management/Introspector/AnnotationTest.java
+++ b/jdk/test/javax/management/Introspector/AnnotationTest.java
@@ -27,7 +27,7 @@
  * @summary Test that annotations in Standard MBean interfaces
  * correctly produce Descriptor entries
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean AnnotationTest
  * @run build AnnotationTest
  * @run main AnnotationTest
diff --git a/jdk/test/javax/management/Introspector/ChangingNotifsTest.java b/jdk/test/javax/management/Introspector/ChangingNotifsTest.java
index ec2043c..57451d6 100644
--- a/jdk/test/javax/management/Introspector/ChangingNotifsTest.java
+++ b/jdk/test/javax/management/Introspector/ChangingNotifsTest.java
@@ -27,7 +27,7 @@
  * @summary Check that Standard MBeans can change their MBeanNotificationInfo[]
  * and MXBeans cannot
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ChangingNotifsTest
  * @run build ChangingNotifsTest
  * @run main ChangingNotifsTest
diff --git a/jdk/test/javax/management/Introspector/ClassLeakTest.java b/jdk/test/javax/management/Introspector/ClassLeakTest.java
index 5fe43fd..c613633 100644
--- a/jdk/test/javax/management/Introspector/ClassLeakTest.java
+++ b/jdk/test/javax/management/Introspector/ClassLeakTest.java
@@ -26,7 +26,7 @@
  * @bug 4909536
  * @summary Ensure that the Introspector does not retain refs to classes
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ClassLeakTest
  * @run build ClassLeakTest
  * @run main ClassLeakTest
diff --git a/jdk/test/javax/management/Introspector/DuplicateGetterTest.java b/jdk/test/javax/management/Introspector/DuplicateGetterTest.java
index 7be19a0..ec9ed43 100644
--- a/jdk/test/javax/management/Introspector/DuplicateGetterTest.java
+++ b/jdk/test/javax/management/Introspector/DuplicateGetterTest.java
@@ -27,7 +27,6 @@
  * @summary Test that an MBean interface can inherit two methods with
  * the same signature from two unrelated parent interfaces
  * @author Eamonn McManus
- * @modules java.management
  */
 
 import java.util.*;
diff --git a/jdk/test/javax/management/Introspector/FeatureOrderTest.java b/jdk/test/javax/management/Introspector/FeatureOrderTest.java
index 96ad78e..d109abf 100644
--- a/jdk/test/javax/management/Introspector/FeatureOrderTest.java
+++ b/jdk/test/javax/management/Introspector/FeatureOrderTest.java
@@ -27,7 +27,6 @@
  * @summary Test that attributes and operations appear in the same order
  * in MBeanInfo as they did in the Standard MBean or MXBean Interface.
  * @author Eamonn McManus
- * @modules java.management
  */
 
 /*
diff --git a/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java b/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java
index bfc71b7..7152e0d 100644
--- a/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java
+++ b/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java
@@ -27,7 +27,7 @@
  * @summary Test that the exception thrown by DynamicMBean.getMBeanInfo()
  *          keeps the init cause.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean GetMBeanInfoExceptionTest
  * @run build GetMBeanInfoExceptionTest
  * @run main GetMBeanInfoExceptionTest
diff --git a/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java b/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java
index 9cbad77..d971894 100644
--- a/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java
+++ b/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java
@@ -27,7 +27,7 @@
  * @summary Check that MBeans with the same class have identical MBeanInfo
  * unless they are NotificationBroadcasters
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean IdenticalMBeanInfoTest
  * @run build IdenticalMBeanInfoTest
  * @run main IdenticalMBeanInfoTest
diff --git a/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java b/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java
index 48804938..4c7467a 100644
--- a/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java
+++ b/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java
@@ -27,7 +27,7 @@
  * @summary Check that a StandardMBean has immutableInfo=true if it is
  * a NotificationBroadcasterSupport that doesn't override getNotificationInfo()
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ImmutableNotificationInfoTest
  * @run build ImmutableNotificationInfoTest
  * @run main ImmutableNotificationInfoTest
diff --git a/jdk/test/javax/management/Introspector/InvokeGettersTest.java b/jdk/test/javax/management/Introspector/InvokeGettersTest.java
index 5dacf04..6036069 100644
--- a/jdk/test/javax/management/Introspector/InvokeGettersTest.java
+++ b/jdk/test/javax/management/Introspector/InvokeGettersTest.java
@@ -26,7 +26,7 @@
  * @bug 6317101
  * @summary Test that the jmx.invoke.getters system property works
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean InvokeGettersTest
  * @run build InvokeGettersTest
  * @run main InvokeGettersTest
diff --git a/jdk/test/javax/management/Introspector/IsMethodTest.java b/jdk/test/javax/management/Introspector/IsMethodTest.java
index a1ec7db..8a719c6 100644
--- a/jdk/test/javax/management/Introspector/IsMethodTest.java
+++ b/jdk/test/javax/management/Introspector/IsMethodTest.java
@@ -26,7 +26,7 @@
  * @bug 4947001 4954369 4954409 4954410
  * @summary Test that "Boolean isX()" and "int isX()" define operations
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean IsMethodTest
  * @run build IsMethodTest
  * @run main IsMethodTest
diff --git a/jdk/test/javax/management/Introspector/LegacyConstructorPropertiesTest.java b/jdk/test/javax/management/Introspector/LegacyConstructorPropertiesTest.java
index 4848aad..f8f33ec 100644
--- a/jdk/test/javax/management/Introspector/LegacyConstructorPropertiesTest.java
+++ b/jdk/test/javax/management/Introspector/LegacyConstructorPropertiesTest.java
@@ -37,8 +37,10 @@
  *          j.b.ConstructorProperties and j.m.ConstructorProperties annotations
  *          only j.m.ConstructorProperties annotation is considered.
  * @author Jaroslav Bachorik
- * @modules java.management
- *          java.desktop
+ *
+ * @modules java.desktop
+ *          java.management
+ *
  * @run main LegacyConstructorPropertiesTest
  */
 
diff --git a/jdk/test/javax/management/Introspector/NotAnMBeanTest.java b/jdk/test/javax/management/Introspector/NotAnMBeanTest.java
index 4fccc43..3bcb68b 100644
--- a/jdk/test/javax/management/Introspector/NotAnMBeanTest.java
+++ b/jdk/test/javax/management/Introspector/NotAnMBeanTest.java
@@ -26,7 +26,7 @@
  * @bug 4914805
  * @summary Ensure that the right exception is thrown for illegal MBeans
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean NotAnMBeanTest
  * @run build NotAnMBeanTest
  * @run main NotAnMBeanTest
diff --git a/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java b/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java
index 063d30c..056f00c 100644
--- a/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java
+++ b/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java
@@ -27,7 +27,7 @@
  * @summary Test that NotCompliantMBeanException has a cause in case of
  *          type mapping problems.
  * @author Daniel Fuchs, Alexander Shusherov
- * @modules java.management
+ *
  * @run clean NotCompliantCauseTest
  * @run build NotCompliantCauseTest
  * @run main NotCompliantCauseTest
@@ -40,7 +40,6 @@
  */
 
 import java.util.Random;
-import java.util.logging.Logger;
 
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
@@ -55,12 +54,6 @@
 public class NotCompliantCauseTest {
 
     /**
-     * A logger for this class.
-     **/
-    private static final Logger LOG =
-            Logger.getLogger(NotCompliantCauseTest.class.getName());
-
-    /**
      * Creates a new instance of NotCompliantCauseTest
      */
     public NotCompliantCauseTest() {
diff --git a/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java b/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java
index 111aec1..b1762d0 100644
--- a/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java
+++ b/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java
@@ -27,7 +27,7 @@
  * @summary Check that setting the wrong type of an attribute in a Standard
  * MBean or MXBean causes InvalidAttributeValueException
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean SetWrongTypeAttributeTest
  * @run build SetWrongTypeAttributeTest
  * @run main SetWrongTypeAttributeTest
diff --git a/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java b/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java
index c2695d7..d18a72b 100644
--- a/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java
+++ b/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java
@@ -28,7 +28,7 @@
  *          the supplied MBean although DynamicMBean.getMBeanInfo() throws
  *          a runtime exception.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean UnregisterMBeanExceptionTest
  * @run build UnregisterMBeanExceptionTest
  * @run main UnregisterMBeanExceptionTest
diff --git a/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java b/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java
index 2e71b9d..0f12667 100644
--- a/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java
+++ b/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java
@@ -26,7 +26,7 @@
  * @bug 5071110
  * @summary Test whether an null descriptor will cause an NullPointerException.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean EqualExceptionTest
  * @run build EqualExceptionTest
  * @run main EqualExceptionTest
diff --git a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java
index d433190..ff67ff7 100644
--- a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java
+++ b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java
@@ -36,7 +36,7 @@
  * @bug 8023954
  * @summary Test that MBean*Info.equals do not throw NPE
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean MBeanInfoEqualsNPETest
  * @run build MBeanInfoEqualsNPETest
  * @run main MBeanInfoEqualsNPETest
diff --git a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java
index 239cf5c..f2dfeb9 100644
--- a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java
+++ b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java
@@ -26,7 +26,7 @@
  * @bug 4719923
  * @summary Test that MBeanInfo.equals works even for mutable subclasses
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean MBeanInfoEqualsTest
  * @run build MBeanInfoEqualsTest
  * @run main MBeanInfoEqualsTest
diff --git a/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java b/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java
index 2a175d7..ee32233 100644
--- a/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java
+++ b/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java
@@ -35,7 +35,7 @@
  * @bug 8023669
  * @summary Test that hashCode()throws NullPointerException
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean MBeanInfoHashCodeNPETest
  * @run build MBeanInfoHashCodeNPETest
  * @run main MBeanInfoHashCodeNPETest
diff --git a/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java b/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java
index c608d78..ca0c332 100644
--- a/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java
+++ b/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java
@@ -27,7 +27,7 @@
  * @summary Test that an MBeanInfo works even if it is deserialized from
  * an implementation where its array fields can be null.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean NullInfoArraysTest
  * @run build NullInfoArraysTest
  * @run main NullInfoArraysTest
diff --git a/jdk/test/javax/management/MBeanInfo/SerializationTest.java b/jdk/test/javax/management/MBeanInfo/SerializationTest.java
index c83fd92e..0781cdb 100644
--- a/jdk/test/javax/management/MBeanInfo/SerializationTest.java
+++ b/jdk/test/javax/management/MBeanInfo/SerializationTest.java
@@ -26,7 +26,7 @@
  * @bug 6288100
  * @summary Test the new serialization/deserialization methods.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean SerializationTest
  * @run build SerializationTest
  * @run main SerializationTest
diff --git a/jdk/test/javax/management/MBeanInfo/SerializationTest1.java b/jdk/test/javax/management/MBeanInfo/SerializationTest1.java
index a33898a..6ccd206 100644
--- a/jdk/test/javax/management/MBeanInfo/SerializationTest1.java
+++ b/jdk/test/javax/management/MBeanInfo/SerializationTest1.java
@@ -26,7 +26,7 @@
  * @bug 6783290
  * @summary Test correct reading of an empty Descriptor.
  * @author Jaroslav Bachorik
- * @modules java.management
+ *
  * @run clean SerializationTest1
  * @run build SerializationTest1
  * @run main SerializationTest1
diff --git a/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java b/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java
index 55782e4..03be567 100644
--- a/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java
+++ b/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java
@@ -27,7 +27,7 @@
  * @summary Test that a method inherited from two different interfaces
  *          appears only once in MBeanInfo.
  * @author dfuchs
- * @modules java.management
+ *
  * @run clean TooManyFooTest
  * @run build TooManyFooTest
  * @run main TooManyFooTest
@@ -55,12 +55,6 @@
  */
 public class TooManyFooTest {
 
-    /**
-     * A logger for this class.
-     **/
-    private static final Logger LOG =
-            Logger.getLogger(TooManyFooTest.class.getName());
-
     public static class NumberHolder {
         public Integer getNumber() { return 0;}
         public void setNumber(Integer n) {};
diff --git a/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java b/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java
index 3fec474..602e1f2 100644
--- a/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java
+++ b/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java
@@ -26,7 +26,6 @@
  * @bug 6336968
  * @summary Test adding non-Attribute values to an AttributeList.
  * @author Eamonn McManus
- * @modules java.management
  */
 
 import java.util.Collections;
diff --git a/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java b/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java
index 4e908b3..31b8530 100644
--- a/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java
+++ b/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java
@@ -28,8 +28,7 @@
  * RuntimeMBeanException and (for Standard MBeans) that checked exceptions
  * are wrapped in MBeanException
  * @author Eamonn McManus
- * @modules java.management
- * @compile MBeanExceptionTest.java
+ *
  * @run main MBeanExceptionTest
  */
 
diff --git a/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java b/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java
index b6ab026..6cf5085 100644
--- a/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java
+++ b/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java
@@ -33,7 +33,7 @@
  *          It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic"
  *          system property must be set before c.s.j.m.MBeanAnalyzer has been loaded.
  * @author Jaroslav Bachorik
- * @modules java.management
+ *
  * @run clean MBeanFallbackTest
  * @run build MBeanFallbackTest
  * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MBeanFallbackTest
diff --git a/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java b/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java
index b0008f3..441f18c 100644
--- a/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java
+++ b/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java
@@ -26,7 +26,7 @@
  * @bug 5092515
  * @summary Test how to unwrap a user specific exception
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean MBeanServerInvocationHandlerExceptionTest
  * @run build MBeanServerInvocationHandlerExceptionTest
  * @run main MBeanServerInvocationHandlerExceptionTest
diff --git a/jdk/test/javax/management/MBeanServer/MBeanTest.java b/jdk/test/javax/management/MBeanServer/MBeanTest.java
index 342e15d..628b607 100644
--- a/jdk/test/javax/management/MBeanServer/MBeanTest.java
+++ b/jdk/test/javax/management/MBeanServer/MBeanTest.java
@@ -31,7 +31,7 @@
  * @bug 8010285
  * @summary General MBean test.
  * @author Jaroslav Bachorik
- * @modules java.management
+ *
  * @run clean MBeanTest
  * @run build MBeanTest
  * @run main MBeanTest
diff --git a/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java b/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java
index cbccf23..ae92a91 100644
--- a/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java
+++ b/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java
@@ -26,7 +26,7 @@
  * @bug 4757273
  * @summary Test that registered notification is sent early enough
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean NewMBeanListenerTest
  * @run build NewMBeanListenerTest
  * @run main NewMBeanListenerTest
diff --git a/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java b/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java
index c46a90f..4020add 100644
--- a/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java
+++ b/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java
@@ -26,7 +26,7 @@
  * @bug 4757273
  * @summary Test deadlock in MBeanServerDelegate listeners
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean NotifDeadlockTest
  * @run build NotifDeadlockTest
  * @run main NotifDeadlockTest
diff --git a/jdk/test/javax/management/MBeanServer/PostExceptionTest.java b/jdk/test/javax/management/MBeanServer/PostExceptionTest.java
index 35db83c..3e3c802 100644
--- a/jdk/test/javax/management/MBeanServer/PostExceptionTest.java
+++ b/jdk/test/javax/management/MBeanServer/PostExceptionTest.java
@@ -27,8 +27,7 @@
  * @summary Check behaviour of MBeanServer when postRegister and postDeregister
  *          throw exceptions.
  * @author Daniel Fuchs
- * @modules java.management
- * @compile PostExceptionTest.java
+ *
  * @run main PostExceptionTest
  */
 
diff --git a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java
index 81876af..cb19863 100644
--- a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java
+++ b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java
@@ -26,7 +26,7 @@
  * @bug 6417044
  * @summary Test deadlock in MBeanRegistration.postRegister method
  * @author Eamonn McManus, Daniel Fuchs
- * @modules java.management
+ *
  * @run clean PostRegisterDeadlockTest
  * @run build PostRegisterDeadlockTest
  * @run main PostRegisterDeadlockTest
diff --git a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java
index d6d5230..c816a16 100644
--- a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java
+++ b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java
@@ -26,7 +26,7 @@
  * @bug 6417044
  * @summary Test that a failing MBean registration does not lead to a deadlock
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run main PostRegisterDeadlockTest2
  */
 
diff --git a/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java b/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java
index f3eb915..33d8c59 100644
--- a/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java
+++ b/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java
@@ -26,7 +26,7 @@
  * @bug 6318664
  * @summary Test deadlock in MBeanRegistration.preDeregister method
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean PreDeregisterDeadlockTest
  * @run build PreDeregisterDeadlockTest
  * @run main PreDeregisterDeadlockTest
diff --git a/jdk/test/javax/management/MBeanServer/PreRegisterTest.java b/jdk/test/javax/management/MBeanServer/PreRegisterTest.java
index 7b10981..4f72fec 100644
--- a/jdk/test/javax/management/MBeanServer/PreRegisterTest.java
+++ b/jdk/test/javax/management/MBeanServer/PreRegisterTest.java
@@ -26,7 +26,7 @@
  * @bug 4911846
  * @summary Test that MBeanRegistration can change caller ObjectName
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean PreRegisterTest
  * @run build PreRegisterTest
  * @run main PreRegisterTest
diff --git a/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java b/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java
index d9d792b..aa3dd19 100644
--- a/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java
+++ b/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java
@@ -27,7 +27,7 @@
  * @summary Test that the releaseMBeanServer(MBeanServer mbeanServer) method
  *          throws IllegalArgumentException as expected
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ReleaseMBeanServerTest
  * @run build ReleaseMBeanServerTest
  * @run main ReleaseMBeanServerTest
diff --git a/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java b/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java
index 005b1e7..56a5e14 100644
--- a/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java
+++ b/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java
@@ -28,7 +28,7 @@
  * IllegalArgumentException when attribute names, operation names, and
  * Java type names do not strictly follow the expected Java syntax.
  * @author Daniel Fuchs
- * @modules java.management
+ *
  * @run clean MustBeValidCommand
  * @run build MustBeValidCommand
  * @run main MustBeValidCommand
diff --git a/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java b/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java
index 0435329..2c45830 100644
--- a/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java
+++ b/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java
@@ -26,7 +26,7 @@
  * @bug 5001857
  * @summary Test queryNames() and queryMBeans() with a buggy DynamicMBean
  * @author Daniel Fuchs
- * @modules java.management
+ *
  * @run clean MBeanInfoFailTest
  * @run build MBeanInfoFailTest
  * @run main MBeanInfoFailTest
diff --git a/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java b/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java
index 33e8497..b44d32e 100644
--- a/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java
+++ b/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java
@@ -26,7 +26,7 @@
  * @bug 5015663
  * @summary Test ObjectInstance(name,null).hashCode() and .equals()
  * @author Daniel Fuchs
- * @modules java.management
+ *
  * @run clean ObjectInstanceNullTest
  * @run build ObjectInstanceNullTest
  * @run main ObjectInstanceNullTest
diff --git a/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java b/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java
index 166d06c..b9be856 100644
--- a/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java
+++ b/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java
@@ -26,7 +26,7 @@
  * @bug 5080083
  * @summary Test new added method "toString"
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean ToStringMethodTest
  * @run build ToStringMethodTest
  * @run main ToStringMethodTest
diff --git a/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java b/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java
index 8842712..8033e6b 100644
--- a/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java
+++ b/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java
@@ -27,7 +27,7 @@
  * @summary Test the ObjectName.apply(ObjectName) method
  *          with wildcards in the key properties value part.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ApplyWildcardTest
  * @run build ApplyWildcardTest
  * @run main ApplyWildcardTest
diff --git a/jdk/test/javax/management/ObjectName/ComparatorTest.java b/jdk/test/javax/management/ObjectName/ComparatorTest.java
index 2803302..4f8f17e 100644
--- a/jdk/test/javax/management/ObjectName/ComparatorTest.java
+++ b/jdk/test/javax/management/ObjectName/ComparatorTest.java
@@ -26,7 +26,7 @@
  * @bug 5036680
  * @summary Test the ObjectName.compareTo() method.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ComparatorTest
  * @run build ComparatorTest
  * @run main ComparatorTest
diff --git a/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java b/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java
index 030b629..4d0bf24 100644
--- a/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java
+++ b/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java
@@ -27,7 +27,7 @@
  * @summary Test that MBeanServerDelegate.DELEGATE_NAME and ObjectName.WILDCARD
  *          public constants have been initialized properly.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean DelegateNameWildcardNameTest
  * @run build DelegateNameWildcardNameTest
  * @run main DelegateNameWildcardNameTest
diff --git a/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java b/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java
index 385b58c..ac84c58 100644
--- a/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java
+++ b/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java
@@ -26,7 +26,7 @@
  * @bug 6229396
  * @summary Test null/empty key/values in ObjectName constructors.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean NullEmptyKeyValueTest
  * @run build NullEmptyKeyValueTest
  * @run main NullEmptyKeyValueTest
diff --git a/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java b/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java
index 12d0f1c..b121c80 100644
--- a/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java
+++ b/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java
@@ -26,7 +26,7 @@
  * @bug 4894801
  * @summary Test that ObjectName.getInstance(ObjectName) preserves key order
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ObjectNameGetInstanceTest
  * @run build ObjectNameGetInstanceTest
  * @run main ObjectNameGetInstanceTest
diff --git a/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java b/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java
index 6eba9ff..821673d 100644
--- a/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java
+++ b/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java
@@ -27,7 +27,7 @@
  * @summary Test if the repository supports correctly the use of
  *          wildcards in the ObjectName key properties value part.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean RepositoryWildcardTest
  * @run build RepositoryWildcardTest
  * @run main RepositoryWildcardTest
diff --git a/jdk/test/javax/management/ObjectName/SerialCompatTest.java b/jdk/test/javax/management/ObjectName/SerialCompatTest.java
index cbab37d..14b8720 100644
--- a/jdk/test/javax/management/ObjectName/SerialCompatTest.java
+++ b/jdk/test/javax/management/ObjectName/SerialCompatTest.java
@@ -26,7 +26,7 @@
  * @bug 6211220 6616825
  * @summary Test that jmx.serial.form=1.0 works for ObjectName
  * @author Eamonn McManus, Daniel Fuchs
- * @modules java.management
+ *
  * @run clean SerialCompatTest
  * @run build SerialCompatTest
  * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true -Djmx.serial.form=1.0 SerialCompatTest
diff --git a/jdk/test/javax/management/ObjectName/ValueWildcardTest.java b/jdk/test/javax/management/ObjectName/ValueWildcardTest.java
index ee436bd..bdc2db5 100644
--- a/jdk/test/javax/management/ObjectName/ValueWildcardTest.java
+++ b/jdk/test/javax/management/ObjectName/ValueWildcardTest.java
@@ -26,7 +26,7 @@
  * @bug 4716807
  * @summary Test wildcards in ObjectName key properties value part.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ValueWildcardTest
  * @run build ValueWildcardTest
  * @run main ValueWildcardTest
diff --git a/jdk/test/javax/management/TEST.properties b/jdk/test/javax/management/TEST.properties
new file mode 100644
index 0000000..81cb3fc
--- /dev/null
+++ b/jdk/test/javax/management/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.management
+
diff --git a/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java b/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java
index 9b3d120..0fc5edf 100644
--- a/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java
+++ b/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java
@@ -26,7 +26,7 @@
  * @bug 6204469
  * @summary Test that MBean*Info can be constructed with default descriptor
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean DefaultDescriptorTest
  * @run build DefaultDescriptorTest
  * @run main DefaultDescriptorTest
diff --git a/jdk/test/javax/management/descriptor/DescriptorTest.java b/jdk/test/javax/management/descriptor/DescriptorTest.java
index cb2fd79..e16446d 100644
--- a/jdk/test/javax/management/descriptor/DescriptorTest.java
+++ b/jdk/test/javax/management/descriptor/DescriptorTest.java
@@ -26,7 +26,7 @@
  * @bug 6204469 6273765
  * @summary Test various aspects of the Descriptor interface
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean DescriptorTest
  * @run build DescriptorTest
  * @run main DescriptorTest
diff --git a/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java b/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java
index ca8caaa..de68565 100644
--- a/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java
+++ b/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java
@@ -26,7 +26,7 @@
  * @bug 6255956
  * @summary Test equals and hashCode for descriptors
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean EqualsHashCodeTest
  * @run build EqualsHashCodeTest
  * @run main EqualsHashCodeTest
diff --git a/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java b/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java
index 4313845..3826a68 100644
--- a/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java
+++ b/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java
@@ -27,7 +27,7 @@
  * @summary Test that immutability of ImmutableDescriptor cannot be
  * compromised by modifying field values that are arrays.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ImmutableArrayFieldTest
  * @run build ImmutableArrayFieldTest
  * @run main ImmutableArrayFieldTest
diff --git a/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java b/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java
index c1f8b20..61385e5 100644
--- a/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java
+++ b/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java
@@ -26,7 +26,7 @@
  * @bug 6204469
  * @summary Test ImmutableDescriptor serialization.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ImmutableDescriptorSerialTest
  * @run build ImmutableDescriptorSerialTest
  * @run main ImmutableDescriptorSerialTest
diff --git a/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java b/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java
index 49cbf62..7e587bc 100644
--- a/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java
+++ b/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java
@@ -28,7 +28,7 @@
  * null name in it and calling setFields with a field names array with an
  * empty name in it throw the expected exceptions.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ImmutableDescriptorSetFieldsTest
  * @run build ImmutableDescriptorSetFieldsTest
  * @run main ImmutableDescriptorSetFieldsTest
diff --git a/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java b/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java
index 96a0101..68a668c 100644
--- a/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java
+++ b/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java
@@ -26,7 +26,7 @@
  * @bug 6204469
  * @summary Check that descriptors have not broken serial interop.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean MBeanInfoInteropTest SerializedInfo
  * @run build MBeanInfoInteropTest SerializedInfo
  * @run main MBeanInfoInteropTest SerializedInfo
diff --git a/jdk/test/javax/management/descriptor/UnionTest.java b/jdk/test/javax/management/descriptor/UnionTest.java
index 3fc8590..27dc2b8 100644
--- a/jdk/test/javax/management/descriptor/UnionTest.java
+++ b/jdk/test/javax/management/descriptor/UnionTest.java
@@ -26,7 +26,7 @@
  * @bug 6273752
  * @summary Test ImmutableDescriptor.union
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean UnionTest
  * @run build UnionTest
  * @run main UnionTest
diff --git a/jdk/test/javax/management/generified/GenericTest.java b/jdk/test/javax/management/generified/GenericTest.java
index c445276..8a56f44 100644
--- a/jdk/test/javax/management/generified/GenericTest.java
+++ b/jdk/test/javax/management/generified/GenericTest.java
@@ -26,7 +26,7 @@
  * @bug 4847959 6191402
  * @summary Test newly-generified APIs
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean GenericTest
  * @run build GenericTest
  * @run main GenericTest
diff --git a/jdk/test/javax/management/generified/ListTypeCheckTest.java b/jdk/test/javax/management/generified/ListTypeCheckTest.java
index 9a57678..a28ffba 100644
--- a/jdk/test/javax/management/generified/ListTypeCheckTest.java
+++ b/jdk/test/javax/management/generified/ListTypeCheckTest.java
@@ -26,7 +26,7 @@
  * @bug 6250772
  * @summary Test that *List objects are checked after asList is called.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ListTypeCheckTest
  * @run build ListTypeCheckTest
  * @run main ListTypeCheckTest
diff --git a/jdk/test/javax/management/loading/ArrayClassTest.java b/jdk/test/javax/management/loading/ArrayClassTest.java
index 45a88cf..ce4cb4e 100644
--- a/jdk/test/javax/management/loading/ArrayClassTest.java
+++ b/jdk/test/javax/management/loading/ArrayClassTest.java
@@ -27,7 +27,7 @@
  * @summary Test that array classes can be found in signatures always
  * and can be deserialized by the deprecated MBeanServer.deserialize method
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ArrayClassTest
  * @run build ArrayClassTest
  * @run main ArrayClassTest
diff --git a/jdk/test/javax/management/loading/DocumentRootTest.java b/jdk/test/javax/management/loading/DocumentRootTest.java
index b517d63..ae598dd 100644
--- a/jdk/test/javax/management/loading/DocumentRootTest.java
+++ b/jdk/test/javax/management/loading/DocumentRootTest.java
@@ -27,7 +27,7 @@
  * @summary Test parsing error when the mlet file is
  *          located in the web server's document root.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean DocumentRootTest
  * @run build DocumentRootTest
  * @run main DocumentRootTest
diff --git a/jdk/test/javax/management/loading/GetMBeansFromURLTest.java b/jdk/test/javax/management/loading/GetMBeansFromURLTest.java
index 8ca12dc..5f4d889 100644
--- a/jdk/test/javax/management/loading/GetMBeansFromURLTest.java
+++ b/jdk/test/javax/management/loading/GetMBeansFromURLTest.java
@@ -28,7 +28,7 @@
  *          given MLet instance throws a ServiceNotFoundException exception
  *          with a non null cause.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean GetMBeansFromURLTest
  * @run build GetMBeansFromURLTest
  * @run main GetMBeansFromURLTest
diff --git a/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java b/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java
index a858388..d2c07d2 100644
--- a/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java
+++ b/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java
@@ -27,7 +27,7 @@
  * @summary Test that the same native library coming from the same jar file can
  * be loaded twice by two different MLets on the same JVM without conflict.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean LibraryLoaderTest
  * @run build LibraryLoaderTest
  * @run main/othervm LibraryLoaderTest
diff --git a/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java b/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java
index 728ee23..2519f43 100644
--- a/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java
+++ b/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java
@@ -28,7 +28,7 @@
  * for the test codebase as it is executed by the MLet code using
  * doPrivileged.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean MLetCommand
  * @run build MLetCommand
  * @run main/othervm/java.security.policy=policy MLetCommand
diff --git a/jdk/test/javax/management/loading/MLetContentTest.java b/jdk/test/javax/management/loading/MLetContentTest.java
index 76f04b4..0fa9ce9 100644
--- a/jdk/test/javax/management/loading/MLetContentTest.java
+++ b/jdk/test/javax/management/loading/MLetContentTest.java
@@ -26,7 +26,7 @@
  * @bug 4796780
  * @summary The class MLetContentTest becomes public
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean MLetContentTest
  * @run build MLetContentTest
  * @run main MLetContentTest
diff --git a/jdk/test/javax/management/loading/MletParserLocaleTest.java b/jdk/test/javax/management/loading/MletParserLocaleTest.java
index b541e57..c1f25dd 100644
--- a/jdk/test/javax/management/loading/MletParserLocaleTest.java
+++ b/jdk/test/javax/management/loading/MletParserLocaleTest.java
@@ -26,7 +26,7 @@
  * @bug 7065236
  * @summary Checking MletParser for Locale insensitive strings
  * @author Harsha Wardhana B
- * @modules java.management
+ *
  * @run clean MletParserLocaleTest
  * @run build MletParserLocaleTest
  * @run main/othervm/timeout=5 MletParserLocaleTest mlet4.html
diff --git a/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java b/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java
index f0f4da0..0ae1433 100644
--- a/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java
+++ b/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java
@@ -29,7 +29,7 @@
  * terminated with the corresponding '>' and an opening '<' for
  * the subsequent tag is encountered.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ParserInfiniteLoopTest
  * @run build ParserInfiniteLoopTest
  * @run main/othervm/timeout=5 ParserInfiniteLoopTest mlet1.html
diff --git a/jdk/test/javax/management/loading/SystemClassLoaderTest.java b/jdk/test/javax/management/loading/SystemClassLoaderTest.java
index 73430b5..d31c5d1 100644
--- a/jdk/test/javax/management/loading/SystemClassLoaderTest.java
+++ b/jdk/test/javax/management/loading/SystemClassLoaderTest.java
@@ -27,7 +27,7 @@
  * @summary Test that a class can load MBeans from its class loader
  * (at least if it is the system class loader)
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean SystemClassLoaderTest
  * @run build SystemClassLoaderTest
  * @run main SystemClassLoaderTest
diff --git a/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java b/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java
index 049e0be..609766a 100644
--- a/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java
+++ b/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java
@@ -30,7 +30,7 @@
  * no other attributes.
  * @author Yves Joan
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean AddAttributeChangeNotificationListenerTest
  * @run build AddAttributeChangeNotificationListenerTest
  * @run main AddAttributeChangeNotificationListenerTest
diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java
index b83d274..c65af34 100644
--- a/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java
+++ b/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java
@@ -26,7 +26,7 @@
  * @bug 6332962
  * @summary Test that DescriptorSupport does not serialize targetObject
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean DescriptorSupportSerialTest
  * @run build DescriptorSupportSerialTest
  * @run main DescriptorSupportSerialTest
diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java
index a19044c..ed33c73 100644
--- a/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java
+++ b/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java
@@ -26,7 +26,7 @@
  * @bug 4883712 4869006 4894856 5016685
  * @summary Test that DescriptorSupport correctly validates fields
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean DescriptorSupportTest
  * @run build DescriptorSupportTest
  * @run main DescriptorSupportTest
diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java
index 402bff7..340e426 100644
--- a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java
+++ b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java
@@ -26,7 +26,7 @@
  * @bug 7065236
  * @summary Test for locale insensitive strings in DescriptorSupport class
  * @author Harsha Wardhana B
- * @modules java.management
+ *
  * @run clean DescriptorSupportXMLLocaleTest
  * @run build DescriptorSupportXMLLocaleTest
  * @run main DescriptorSupportXMLLocaleTest
diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java
index 2e0aee6..dc66b2a 100644
--- a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java
+++ b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java
@@ -27,7 +27,7 @@
  * @summary Test that DescriptorSupport.toXMLString() can be used to
  * reconstruct an equivalent DescriptorSupport
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean DescriptorSupportXMLTest
  * @run build DescriptorSupportXMLTest
  * @run main DescriptorSupportXMLTest
diff --git a/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java b/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java
index a937917..649379e 100644
--- a/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java
+++ b/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java
@@ -27,7 +27,7 @@
  * @summary Test that a custom ModelMBean implementation can have custom
  * targetType values in its ModelMBeanOperationInfo descriptors.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ExoticTargetTypeTest
  * @run build ExoticTargetTypeTest
  * @run main ExoticTargetTypeTest
diff --git a/jdk/test/javax/management/modelmbean/InfoSupportTest.java b/jdk/test/javax/management/modelmbean/InfoSupportTest.java
index 01f92ba..4854a79 100644
--- a/jdk/test/javax/management/modelmbean/InfoSupportTest.java
+++ b/jdk/test/javax/management/modelmbean/InfoSupportTest.java
@@ -29,7 +29,7 @@
  * that getDescriptors("mbean") works, and that default values for
  * MBean descriptors are correctly assigned.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean InfoSupportTest
  * @run build InfoSupportTest
  * @run main InfoSupportTest
diff --git a/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java b/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java
index 92516cd..94dfee0 100644
--- a/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java
+++ b/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java
@@ -29,7 +29,9 @@
  * when traces enabled and no attributes.
  * @author Luis-Miguel Alventosa
  * @author Paul Cheeseman
- * @modules java.management
+ *
+ * @modules java.logging
+ *          java.management
  */
 
 import java.util.logging.ConsoleHandler;
diff --git a/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java b/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java
index fd272fb..b0b24f6 100644
--- a/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java
+++ b/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java
@@ -27,7 +27,7 @@
  * @summary Test that  ModelMBeanInfoSupport.getDescriptors(null) also
  *          returns the MBean's descriptor.
  * @author Eamonn McManus, Daniel Fuchs
- * @modules java.management
+ *
  * @run clean GetAllDescriptorsTest
  * @run build GetAllDescriptorsTest
  * @run main/othervm/java.security.policy=policy  GetAllDescriptorsTest
diff --git a/jdk/test/javax/management/modelmbean/OnUnregisterTest.java b/jdk/test/javax/management/modelmbean/OnUnregisterTest.java
index dab8dc6..4d8ada2 100644
--- a/jdk/test/javax/management/modelmbean/OnUnregisterTest.java
+++ b/jdk/test/javax/management/modelmbean/OnUnregisterTest.java
@@ -27,7 +27,7 @@
  * @summary Check that OnUnregister is an allowed value for persistPolicy
  * in ModelMBeanAttributeInfo
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean OnUnregisterTest
  * @run build OnUnregisterTest
  * @run main OnUnregisterTest
diff --git a/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java b/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java
index 855de5f..ca2a676 100644
--- a/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java
+++ b/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java
@@ -36,7 +36,7 @@
  * - the declared name can be loaded by the value's class loader and
  *   produces a class to which the value can be assigned.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean RequiredModelMBeanGetAttributeTest
  * @run build RequiredModelMBeanGetAttributeTest
  * @run main RequiredModelMBeanGetAttributeTest
diff --git a/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java b/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java
index 54d86c8..0ab0e7b 100644
--- a/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java
+++ b/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java
@@ -28,7 +28,7 @@
  * from the RequiredModelMBean class itself if they are not in the
  * ModelMBeanInfo
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean RequiredModelMBeanMethodTest
  * @run build RequiredModelMBeanMethodTest
  * @run main RequiredModelMBeanMethodTest
diff --git a/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java b/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java
index 7f83c28..949a56f 100644
--- a/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java
+++ b/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java
@@ -28,7 +28,7 @@
  * MBeanException wrapping a ServiceNotFoundException is thrown is setAttribute
  * called but no setMethod field has been provided.
  * @author Jean-Francois Denise
- * @modules java.management
+ *
  * @run clean RequiredModelMBeanSetAttributeTest
  * @run build RequiredModelMBeanSetAttributeTest
  * @run main RequiredModelMBeanSetAttributeTest
diff --git a/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java b/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java
index de7fba1..5953935 100644
--- a/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java
+++ b/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java
@@ -28,7 +28,7 @@
  * IllegalArgumentException when attribute names, operation names, and
  * Java type names do not strictly follow the expected Java syntax.
  * @author Eamonn McManus, Daniel Fuchs
- * @modules java.management
+ *
  * @run clean SimpleModelMBeanCommand
  * @run build SimpleModelMBeanCommand
  * @run main/othervm/java.security.policy=policy  SimpleModelMBeanCommand
diff --git a/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java
index 61115d6..be211c8 100644
--- a/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java
+++ b/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java
@@ -27,7 +27,7 @@
  * @summary Test that no locks are held when a monitor attribute is sampled
  * or notif delivered.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean CounterMonitorDeadlockTest
  * @run build CounterMonitorDeadlockTest
  * @run main CounterMonitorDeadlockTest 1
diff --git a/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java b/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java
index a0abb88..ce55042 100644
--- a/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java
+++ b/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java
@@ -28,7 +28,7 @@
  *          objects added before the counter monitor is started as well as by
  *          the observed objects which are added once the monitor is started.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean CounterMonitorInitThresholdTest
  * @run build CounterMonitorInitThresholdTest
  * @run main CounterMonitorInitThresholdTest
diff --git a/jdk/test/javax/management/monitor/CounterMonitorTest.java b/jdk/test/javax/management/monitor/CounterMonitorTest.java
index 07dba04..9577899 100644
--- a/jdk/test/javax/management/monitor/CounterMonitorTest.java
+++ b/jdk/test/javax/management/monitor/CounterMonitorTest.java
@@ -27,7 +27,7 @@
  * @summary Test that the counter monitor, when running in difference mode,
  *          emits a notification every time the threshold is exceeded.
  * @author Luis-Miguel Alventosa, Shanliang JIANG
- * @modules java.management
+ *
  * @run clean CounterMonitorTest
  * @run build CounterMonitorTest
  * @run main CounterMonitorTest
diff --git a/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java b/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java
index 4463551..911ec60 100644
--- a/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java
+++ b/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java
@@ -26,7 +26,7 @@
  * @bug 6229368 8025207
  * @summary Wrong threshold value in CounterMonitor with offset and modulus.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean CounterMonitorThresholdTest
  * @run build CounterMonitorThresholdTest
  * @run main CounterMonitorThresholdTest
diff --git a/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java b/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java
index 038df90..36b9dd4 100644
--- a/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java
+++ b/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java
@@ -26,7 +26,7 @@
  * @bug 6683213
  * @summary Test that the initial derived gauge is (Integer)0
  * @author Daniel Fuchs
- * @modules java.management
+ *
  * @run clean DerivedGaugeMonitorTest
  * @run build DerivedGaugeMonitorTest
  * @run main DerivedGaugeMonitorTest
diff --git a/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java
index 4f50b41..b6e3469 100644
--- a/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java
+++ b/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java
@@ -27,8 +27,9 @@
  * @summary Test that no locks are held when a monitor attribute is sampled
  * or notif delivered.
  * @author Eamonn McManus
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @run clean GaugeMonitorDeadlockTest
  * @run build GaugeMonitorDeadlockTest
  * @run main GaugeMonitorDeadlockTest 1
diff --git a/jdk/test/javax/management/monitor/MultiMonitorTest.java b/jdk/test/javax/management/monitor/MultiMonitorTest.java
index 9ec7e51..9f4c960 100644
--- a/jdk/test/javax/management/monitor/MultiMonitorTest.java
+++ b/jdk/test/javax/management/monitor/MultiMonitorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,13 @@
 /*
  * @test
  * @bug 4984057
+ * @key randomness
  * @summary Test that monitors can sample a large number of attributes
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean MultiMonitorTest
  * @run build MultiMonitorTest
  * @run main MultiMonitorTest
- * @key randomness
  */
 
 import java.util.*;
@@ -116,6 +116,7 @@
         // A couple of granularity periods to detect bad behaviour
         Thread.sleep(2);
 
+        System.out.println("Checking for all listeners to be 0");
         if (!listenersAreAll(0, listeners)) {
             System.out.println("TEST FAILED: listeners not all 0");
             System.exit(1);
@@ -124,20 +125,18 @@
         for (int i = 0; i < 3; i++)
             proxies[i].start();
 
-        long startTime = System.currentTimeMillis();
-        while (!listenersAreAll(N, listeners)
-               && System.currentTimeMillis() < startTime + 5000)
-            Thread.sleep(1);
+        System.out.println("Waiting for listeners to all : " + N);
+        int iterations = 0;
+        while (!listenersAreAll(N, listeners)) {
+            Thread.sleep(500);
 
-        // More time for bad behaviour
-        Thread.sleep(1000);
-
-        if (!listenersAreAll(N, listeners)) {
-            System.out.print("TEST FAILED: listener counts wrong:");
-            for (int i = 0; i < listeners.length; i++)
-                System.out.print(" " + listeners[i].getCount());
-            System.out.println();
-            System.exit(1);
+            if (++iterations == 10) {
+               for (int i = 0; i < listeners.length; i++) {
+                   System.out.print(" " + listeners[i].getCount());
+               }
+               System.out.println();
+               iterations = 0;
+            }
         }
 
         for (int i = 0; i < 3; i++) {
diff --git a/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java b/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java
index ada24cb..2a4920a 100644
--- a/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java
+++ b/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java
@@ -28,7 +28,7 @@
  *          jmx.monitor.error.type notification when the attribute
  *          being monitored returns a non comparable value.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean NonComparableAttributeValueTest
  * @run build NonComparableAttributeValueTest
  * @run main NonComparableAttributeValueTest
diff --git a/jdk/test/javax/management/monitor/NullAttributeValueTest.java b/jdk/test/javax/management/monitor/NullAttributeValueTest.java
index 7bedeee..f25b19b 100644
--- a/jdk/test/javax/management/monitor/NullAttributeValueTest.java
+++ b/jdk/test/javax/management/monitor/NullAttributeValueTest.java
@@ -29,7 +29,7 @@
  *          being monitored returns a null value.
  * @author Luis-Miguel Alventosa
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean NullAttributeValueTest
  * @run build NullAttributeValueTest
  * @run main NullAttributeValueTest
diff --git a/jdk/test/javax/management/monitor/ReflectionExceptionTest.java b/jdk/test/javax/management/monitor/ReflectionExceptionTest.java
index a196c0d..ff5acb2 100644
--- a/jdk/test/javax/management/monitor/ReflectionExceptionTest.java
+++ b/jdk/test/javax/management/monitor/ReflectionExceptionTest.java
@@ -24,11 +24,11 @@
 /*
  * @test
  * @bug 6205072
+ * @key intermittent
  * @summary Test that the jmx.monitor.error.runtime monitor notification
  *          is emitted when getAttribute throws ReflectionException.
  * @author Luis-Miguel Alventosa
- * @key intermittent
- * @modules java.management
+ *
  * @run clean ReflectionExceptionTest MBeanServerBuilderImpl
  *            MBeanServerForwarderInvocationHandler
  * @run build ReflectionExceptionTest MBeanServerBuilderImpl
diff --git a/jdk/test/javax/management/monitor/RuntimeExceptionTest.java b/jdk/test/javax/management/monitor/RuntimeExceptionTest.java
index 097b0c2..e6b5446 100644
--- a/jdk/test/javax/management/monitor/RuntimeExceptionTest.java
+++ b/jdk/test/javax/management/monitor/RuntimeExceptionTest.java
@@ -27,7 +27,7 @@
  * @summary Test that the jmx.monitor.error.runtime monitor notification
  *          is emitted when getAttribute throws RuntimeException.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean RuntimeExceptionTest MBeanServerBuilderImpl
  *            MBeanServerForwarderInvocationHandler
  * @run build RuntimeExceptionTest MBeanServerBuilderImpl
diff --git a/jdk/test/javax/management/monitor/StartStopTest.java b/jdk/test/javax/management/monitor/StartStopTest.java
index 5d5ff35..82ff161 100644
--- a/jdk/test/javax/management/monitor/StartStopTest.java
+++ b/jdk/test/javax/management/monitor/StartStopTest.java
@@ -27,8 +27,9 @@
  * @summary Test that tasks are cancelled properly when
  *          monitors are started and stopped in a loop.
  * @author Luis-Miguel Alventosa
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @build jdk.testlibrary.*
  * @run clean StartStopTest
  * @run build StartStopTest
diff --git a/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java
index 1359ad4..a89fef6 100644
--- a/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java
+++ b/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java
@@ -24,11 +24,11 @@
 /*
  * @test
  * @bug 6303187
+ * @key intermittent
  * @summary Test that no locks are held when a monitor attribute is sampled
  * or notif delivered.
  * @author Eamonn McManus
- * @key intermittent
- * @modules java.management
+ *
  * @run clean StringMonitorDeadlockTest
  * @run build StringMonitorDeadlockTest
  * @run main StringMonitorDeadlockTest 1
diff --git a/jdk/test/javax/management/monitor/ThreadPoolAccTest.java b/jdk/test/javax/management/monitor/ThreadPoolAccTest.java
index 71b7c5e..5982fb1 100644
--- a/jdk/test/javax/management/monitor/ThreadPoolAccTest.java
+++ b/jdk/test/javax/management/monitor/ThreadPoolAccTest.java
@@ -27,7 +27,7 @@
  * @summary Test that each thread in the thread pool runs
  *          in the context of the monitor.start() caller.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ThreadPoolAccTest
  * @run build ThreadPoolAccTest
  * @run main ThreadPoolAccTest
diff --git a/jdk/test/javax/management/monitor/ThreadPoolTest.java b/jdk/test/javax/management/monitor/ThreadPoolTest.java
index dce81da..b97a92e 100644
--- a/jdk/test/javax/management/monitor/ThreadPoolTest.java
+++ b/jdk/test/javax/management/monitor/ThreadPoolTest.java
@@ -27,7 +27,7 @@
  * @summary Test that all monitors will be well started when sharing
  * a single thread pool.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ThreadPoolTest
  * @run build ThreadPoolTest
  * @run main/othervm/timeout=300 ThreadPoolTest 1
diff --git a/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java b/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java
index 0766d1a..5ffb7c0 100644
--- a/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java
+++ b/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java
@@ -26,7 +26,7 @@
  * @bug 6175517 6278707
  * @summary Test that ambiguous ConstructorProperties annotations are detected.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean AmbiguousConstructorTest
  * @run build AmbiguousConstructorTest
  * @run main AmbiguousConstructorTest
diff --git a/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java b/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java
index 2de6cb1..ac9d0e4 100644
--- a/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java
+++ b/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java
@@ -26,7 +26,6 @@
  * @bug 6601652
  * @summary Test exception when SortedMap or SortedSet has non-null Comparator
  * @author Eamonn McManus
- * @modules java.management
  */
 
 import java.util.SortedMap;
diff --git a/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java b/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java
index 16ece4d..e944b51 100644
--- a/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java
+++ b/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java
@@ -26,7 +26,6 @@
  * @bug 6713777
  * @summary Test that exception messages include all relevant information
  * @author Eamonn McManus
- * @modules java.management
  */
 
 import javax.management.ConstructorParameters;
diff --git a/jdk/test/javax/management/mxbean/GenericTypeTest.java b/jdk/test/javax/management/mxbean/GenericTypeTest.java
index 44cfbaa..08015b4 100644
--- a/jdk/test/javax/management/mxbean/GenericTypeTest.java
+++ b/jdk/test/javax/management/mxbean/GenericTypeTest.java
@@ -26,7 +26,7 @@
  * @bug 6376416 6406447
  * @summary Test use of generic types in MXBeans (mostly illegal).
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run main GenericTypeTest
  */
 
diff --git a/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java b/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java
index 21be355..2fbb54f 100644
--- a/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java
+++ b/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java
@@ -27,7 +27,7 @@
  * @summary Ensure the registration of an invalid MXBean
  *          throws NotCompliantMBeanException.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean InvalidMXBeanRegistrationTest
  * @run build InvalidMXBeanRegistrationTest
  * @run main InvalidMXBeanRegistrationTest
diff --git a/jdk/test/javax/management/mxbean/LeakTest.java b/jdk/test/javax/management/mxbean/LeakTest.java
index 43ac996..a715d0e 100644
--- a/jdk/test/javax/management/mxbean/LeakTest.java
+++ b/jdk/test/javax/management/mxbean/LeakTest.java
@@ -25,7 +25,7 @@
  * @bug 6482247
  * @summary Test that creating MXBeans does not introduce memory leaks.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run build LeakTest RandomMXBeanTest MerlinMXBean TigerMXBean
  * @run main LeakTest
  */
diff --git a/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java b/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java
index 2f63e7f..960a084 100644
--- a/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java
+++ b/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java
@@ -26,7 +26,7 @@
  * @bug 6359948
  * @summary Check that MXBean operations have the expected ReturnType in MBeanOperationInfo
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean MBeanOperationInfoTest
  * @run build MBeanOperationInfoTest
  * @run main MBeanOperationInfoTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java b/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java
index 62d1f22..793c689 100644
--- a/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java
@@ -26,7 +26,7 @@
  * @bug 6316491
  * @summary Check that the MXBean annotation works as advertised
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean MXBeanAnnotationTest
  * @run build MXBeanAnnotationTest
  * @run main MXBeanAnnotationTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java b/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java
index e0243e8..00fd1c4 100644
--- a/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java
@@ -28,7 +28,7 @@
  *          It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic"
  *          system property must be set before c.s.j.m.MBeanAnalyzer has been loaded.
  * @author Jaroslav Bachorik
- * @modules java.management
+ *
  * @run clean MXBeanFallbackTest
  * @run build MXBeanFallbackTest
  * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MXBeanFallbackTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanFlagTest.java b/jdk/test/javax/management/mxbean/MXBeanFlagTest.java
index 71b1fc2..36821d5 100644
--- a/jdk/test/javax/management/mxbean/MXBeanFlagTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanFlagTest.java
@@ -26,7 +26,7 @@
  * @bug 6335337
  * @summary Test correctness of mxbean flag in descriptor.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean MXBeanFlagTest
  * @run build MXBeanFlagTest
  * @run main MXBeanFlagTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanLoadingTest1.java b/jdk/test/javax/management/mxbean/MXBeanLoadingTest1.java
index 2dd9abd..bcfc6fc 100644
--- a/jdk/test/javax/management/mxbean/MXBeanLoadingTest1.java
+++ b/jdk/test/javax/management/mxbean/MXBeanLoadingTest1.java
@@ -26,8 +26,9 @@
  * @bug 8058865
  * @summary Checks correct collection of MXBean's class after unregistration
  * @author Olivier Lagneau
- * @modules java.management
+ *
  * @library /lib/testlibrary
+ *
  * @run main/othervm/timeout=300 MXBeanLoadingTest1
  */
 
diff --git a/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java b/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java
index b8d9382..72833c7 100644
--- a/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java
@@ -27,7 +27,7 @@
  * @summary Ensure that preRegister etc are called, but not when wrapped
  * by the class StandardMBean
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean MXBeanPreRegisterTest
  * @run build MXBeanPreRegisterTest
  * @run main MXBeanPreRegisterTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanRefTest.java b/jdk/test/javax/management/mxbean/MXBeanRefTest.java
index 19cf5f9..df46f69 100644
--- a/jdk/test/javax/management/mxbean/MXBeanRefTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanRefTest.java
@@ -26,7 +26,7 @@
  * @bug 6296433 6283873
  * @summary Test that inter-MXBean references work as expected.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean MXBeanRefTest
  * @run build MXBeanRefTest
  * @run main MXBeanRefTest
diff --git a/jdk/test/javax/management/mxbean/MiscTest.java b/jdk/test/javax/management/mxbean/MiscTest.java
index 27ce7bd..148d9e0 100644
--- a/jdk/test/javax/management/mxbean/MiscTest.java
+++ b/jdk/test/javax/management/mxbean/MiscTest.java
@@ -28,7 +28,7 @@
  *          interfaceClassName, openType, originalType, StandardMBean,
  *          StandardEmitterMBean.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean MiscTest
  * @run build MiscTest
  * @run main MiscTest
diff --git a/jdk/test/javax/management/mxbean/OperationImpactTest.java b/jdk/test/javax/management/mxbean/OperationImpactTest.java
index 85e1597..29e3446 100644
--- a/jdk/test/javax/management/mxbean/OperationImpactTest.java
+++ b/jdk/test/javax/management/mxbean/OperationImpactTest.java
@@ -26,7 +26,7 @@
  * @bug 6320104
  * @summary Check that MXBean operations have impact UNKNOWN.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean OperationImpactTest
  * @run build OperationImpactTest
  * @run main OperationImpactTest
diff --git a/jdk/test/javax/management/mxbean/OverloadTest.java b/jdk/test/javax/management/mxbean/OverloadTest.java
index 6f6349c..b22b155 100644
--- a/jdk/test/javax/management/mxbean/OverloadTest.java
+++ b/jdk/test/javax/management/mxbean/OverloadTest.java
@@ -26,7 +26,7 @@
  * @bug 6175517
  * @summary Test that MXBean interfaces can contain overloaded methods
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean OverloadTest
  * @run build OverloadTest
  * @run main OverloadTest
diff --git a/jdk/test/javax/management/mxbean/PreRegisterNameTest.java b/jdk/test/javax/management/mxbean/PreRegisterNameTest.java
index 2dabe17..411b7bb 100644
--- a/jdk/test/javax/management/mxbean/PreRegisterNameTest.java
+++ b/jdk/test/javax/management/mxbean/PreRegisterNameTest.java
@@ -26,7 +26,6 @@
  * @bug 6448042
  * @summary Test that MXBeans can define their own names in preRegister
  * @author Eamonn McManus
- * @modules java.management
  */
 
 import java.lang.management.ManagementFactory;
diff --git a/jdk/test/javax/management/mxbean/PropertyNamesTest.java b/jdk/test/javax/management/mxbean/PropertyNamesTest.java
index 534f76c..00be0c0 100644
--- a/jdk/test/javax/management/mxbean/PropertyNamesTest.java
+++ b/jdk/test/javax/management/mxbean/PropertyNamesTest.java
@@ -26,7 +26,7 @@
  * @bug 6175517
  * @summary Test the PropertyNames annotation with MXBeans
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean PropertyNamesTest
  * @run build PropertyNamesTest
  * @run main PropertyNamesTest
diff --git a/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java b/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java
index c71a256..10022c5 100644
--- a/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java
+++ b/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java
@@ -28,7 +28,7 @@
  * names produces an exception
  * @author Alexander Shusherov
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run main SameObjectTwoNamesTest
  * @run main/othervm -Djmx.mxbean.multiname=true SameObjectTwoNamesTest
  */
diff --git a/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java b/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java
index c6c6be6..9ae65e7 100644
--- a/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java
+++ b/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java
@@ -29,7 +29,7 @@
  *          getMBeanInfo and getNotificationInfo in StandardMBean and
  *          StandardEmitterMBean.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean StandardMBeanOverrideTest
  * @run build StandardMBeanOverrideTest
  * @run main StandardMBeanOverrideTest
diff --git a/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java b/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java
index 2752d4b..3bfef07 100644
--- a/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java
+++ b/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java
@@ -24,13 +24,13 @@
 /*
  * @test
  * @bug 6305746
+ * @key randomness
  * @summary Test that the null values returned by the ThreadMXBean work.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ThreadMXBeanTest
  * @run build ThreadMXBeanTest
  * @run main ThreadMXBeanTest
- * @key randomness
  */
 
 import java.lang.management.*;
diff --git a/jdk/test/javax/management/mxbean/TypeNameTest.java b/jdk/test/javax/management/mxbean/TypeNameTest.java
index fdd7a94..55c9b22 100644
--- a/jdk/test/javax/management/mxbean/TypeNameTest.java
+++ b/jdk/test/javax/management/mxbean/TypeNameTest.java
@@ -26,7 +26,6 @@
  * @bug 6757225 6763051
  * @summary Test that type names in MXBeans match their spec.
  * @author Eamonn McManus
- * @modules java.management
  */
 
 import java.lang.reflect.Field;
diff --git a/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java b/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java
index d4ba0ba..be3f0d8 100644
--- a/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java
+++ b/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java
@@ -27,7 +27,7 @@
  * @summary Test that NotificationBroadcasterSupport can be subclassed
  * and used with synchronized(this) without causing deadlock
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean BroadcasterSupportDeadlockTest
  * @run build BroadcasterSupportDeadlockTest
  * @run main BroadcasterSupportDeadlockTest
diff --git a/jdk/test/javax/management/notification/FilterExceptionTest.java b/jdk/test/javax/management/notification/FilterExceptionTest.java
index c0d02db..b2dcc8f 100644
--- a/jdk/test/javax/management/notification/FilterExceptionTest.java
+++ b/jdk/test/javax/management/notification/FilterExceptionTest.java
@@ -26,7 +26,7 @@
  * @bug 6244855 6244863
  * @summary Exception thrown by NotificationFilter should be ignored
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean FilterExceptionTest
  * @run build FilterExceptionTest
  * @run main FilterExceptionTest
diff --git a/jdk/test/javax/management/notification/NotifExecutorTest.java b/jdk/test/javax/management/notification/NotifExecutorTest.java
index 24e9e93..537135e 100644
--- a/jdk/test/javax/management/notification/NotifExecutorTest.java
+++ b/jdk/test/javax/management/notification/NotifExecutorTest.java
@@ -26,7 +26,7 @@
  * @bug 4661545
  * @summary Tests to use an executor to send notifications.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean NotifExecutorTest
  * @run build NotifExecutorTest
  * @run main NotifExecutorTest
diff --git a/jdk/test/javax/management/notification/NotifInfoTest.java b/jdk/test/javax/management/notification/NotifInfoTest.java
index f1ebaa1..6980cc6 100644
--- a/jdk/test/javax/management/notification/NotifInfoTest.java
+++ b/jdk/test/javax/management/notification/NotifInfoTest.java
@@ -26,7 +26,7 @@
  * @bug 4506105 6303698
  * @summary NotificationBroadcasterSupport should have a ctor with MBeanNotificationInfo[]
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean NotifInfoTest
  * @run build NotifInfoTest
  * @run main NotifInfoTest
diff --git a/jdk/test/javax/management/openmbean/ArrayTypeTest.java b/jdk/test/javax/management/openmbean/ArrayTypeTest.java
index c4b88b4..9f5acc9 100644
--- a/jdk/test/javax/management/openmbean/ArrayTypeTest.java
+++ b/jdk/test/javax/management/openmbean/ArrayTypeTest.java
@@ -26,7 +26,7 @@
  * @bug 5045358
  * @summary Test that Open MBeans support arrays of primitive types.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean ArrayTypeTest
  * @run build ArrayTypeTest
  * @run main ArrayTypeTest
diff --git a/jdk/test/javax/management/openmbean/BadConstraintTest.java b/jdk/test/javax/management/openmbean/BadConstraintTest.java
index 5f39ea8..bd407ee 100644
--- a/jdk/test/javax/management/openmbean/BadConstraintTest.java
+++ b/jdk/test/javax/management/openmbean/BadConstraintTest.java
@@ -27,7 +27,7 @@
  * @summary Test that Open MBean attributes and parameters cannot have
  * illegal constraints like min greater than max
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean BadConstraintTest
  * @run build BadConstraintTest
  * @run main BadConstraintTest
diff --git a/jdk/test/javax/management/openmbean/CompositeDataStringTest.java b/jdk/test/javax/management/openmbean/CompositeDataStringTest.java
index f49a6aa..776c61d 100644
--- a/jdk/test/javax/management/openmbean/CompositeDataStringTest.java
+++ b/jdk/test/javax/management/openmbean/CompositeDataStringTest.java
@@ -26,7 +26,6 @@
  * @bug 6610174
  * @summary Test that CompositeDataSupport.toString() represents arrays correctly
  * @author Eamonn McManus
- * @modules java.management
  */
 
 import javax.management.openmbean.ArrayType;
diff --git a/jdk/test/javax/management/openmbean/ConstraintTest.java b/jdk/test/javax/management/openmbean/ConstraintTest.java
index 5457ba0..b74bada 100644
--- a/jdk/test/javax/management/openmbean/ConstraintTest.java
+++ b/jdk/test/javax/management/openmbean/ConstraintTest.java
@@ -26,7 +26,7 @@
  * @bug 6204469
  * @summary Test that Open MBean attributes and parameters check constraints
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ConstraintTest
  * @run build ConstraintTest
  * @run main ConstraintTest
diff --git a/jdk/test/javax/management/openmbean/EqualsTest.java b/jdk/test/javax/management/openmbean/EqualsTest.java
index 7d63daf..79fbe83 100644
--- a/jdk/test/javax/management/openmbean/EqualsTest.java
+++ b/jdk/test/javax/management/openmbean/EqualsTest.java
@@ -26,7 +26,7 @@
  * @bug 5072174
  * @summary Test CompositeDataSupport.equals with ArrayType
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean EqualsTest
  * @run build EqualsTest
  * @run main EqualsTest
diff --git a/jdk/test/javax/management/openmbean/IsValueTest.java b/jdk/test/javax/management/openmbean/IsValueTest.java
index 93fa251..94b8303 100644
--- a/jdk/test/javax/management/openmbean/IsValueTest.java
+++ b/jdk/test/javax/management/openmbean/IsValueTest.java
@@ -26,7 +26,6 @@
  * @bug 5072004
  * @summary Test new rules for isValue
  * @author Eamonn McManus
- * @modules java.management
  */
 
 import javax.management.openmbean.*;
diff --git a/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java b/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java
index 0b0c418..167fb3d 100644
--- a/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java
+++ b/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java
@@ -26,7 +26,6 @@
  * @bug 6434298
  * @summary Test IAE is thrown when typeName or description parameter is null for TabularType and CompositeType constructors
  * @author Joel FERAUD
- * @modules java.management
  */
 
 import javax.management.openmbean.*;
diff --git a/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java b/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java
index 2679615..d34c57d 100644
--- a/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java
+++ b/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java
@@ -41,7 +41,7 @@
  * @bug 8023529
  * @summary Test that OpenMBean*Info.equals do not throw NPE
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean OpenMBeanInfoEqualsNPETest
  * @run build OpenMBeanInfoEqualsNPETest
  * @run main OpenMBeanInfoEqualsNPETest
diff --git a/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java b/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java
index 3cd70d3..ee864d6 100644
--- a/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java
+++ b/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java
@@ -40,7 +40,7 @@
  * @bug 8023529
  * @summary Test that OpenMBean*Info.hashCode do not throw NPE
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean OpenMBeanInfoHashCodeNPETest
  * @run build OpenMBeanInfoHashCodeNPETest
  * @run main OpenMBeanInfoHashCodeNPETest
diff --git a/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java b/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java
index 885634e..33b209b 100644
--- a/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java
+++ b/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java
@@ -28,7 +28,7 @@
  * @summary Test that Open*MBeanInfo classes include "openType" in descriptor
  *          and also test serial compatibility with Java 5.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean OpenTypeDescriptorTest
  * @run build OpenTypeDescriptorTest
  * @run main OpenTypeDescriptorTest
diff --git a/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java b/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java
index f157457..c68a936 100644
--- a/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java
+++ b/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java
@@ -34,7 +34,7 @@
  *          It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic"
  *          system property must be set before c.s.j.m.MBeanAnalyzer has been loaded.
  * @author Jaroslav Bachorik
- * @modules java.management
+ *
  * @run clean JMXProxyFallbackTest
  * @run build JMXProxyFallbackTest
  * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true JMXProxyFallbackTest
diff --git a/jdk/test/javax/management/proxy/JMXProxyTest.java b/jdk/test/javax/management/proxy/JMXProxyTest.java
index 33cae1d..d9e2fcd 100644
--- a/jdk/test/javax/management/proxy/JMXProxyTest.java
+++ b/jdk/test/javax/management/proxy/JMXProxyTest.java
@@ -33,7 +33,7 @@
  * @summary Tests that javax.management.JMX creates proxies only for the
  *          compliant MBeans/MXBeans
  * @author Jaroslav Bachorik
- * @modules java.management
+ *
  * @run clean JMXProxyTest
  * @run build JMXProxyTest
  * @run main JMXProxyTest
diff --git a/jdk/test/javax/management/proxy/NotificationEmitterProxy.java b/jdk/test/javax/management/proxy/NotificationEmitterProxy.java
index 2c602b9..c1f43f4 100644
--- a/jdk/test/javax/management/proxy/NotificationEmitterProxy.java
+++ b/jdk/test/javax/management/proxy/NotificationEmitterProxy.java
@@ -26,7 +26,7 @@
  * @summary Test that we can create proxies which are NotificationEmitters.
  * @bug 6411747
  * @author Daniel Fuchs
- * @modules java.management
+ *
  * @run clean NotificationEmitterProxy
  * @run build NotificationEmitterProxy
  * @run main NotificationEmitterProxy
diff --git a/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java b/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java
index 30238c8..c554ca0 100644
--- a/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java
+++ b/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java
@@ -26,7 +26,7 @@
  * @bug 6177524
  * @summary Test how to execute the 3 Object methods by a Proxy.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean ProxyObjectMethodsTest
  * @run build ProxyObjectMethodsTest
  * @run main ProxyObjectMethodsTest
diff --git a/jdk/test/javax/management/query/CustomQueryTest.java b/jdk/test/javax/management/query/CustomQueryTest.java
index 7ba7396..f1c3f59 100644
--- a/jdk/test/javax/management/query/CustomQueryTest.java
+++ b/jdk/test/javax/management/query/CustomQueryTest.java
@@ -26,7 +26,6 @@
  * @bug 6692027
  * @summary Check that custom subclasses of QueryEval can be serialized.
  * @author Eamonn McManus
- * @modules java.management
  */
 
 import java.io.ByteArrayInputStream;
diff --git a/jdk/test/javax/management/query/InstanceOfExpTest.java b/jdk/test/javax/management/query/InstanceOfExpTest.java
index bd36da3..4478255 100644
--- a/jdk/test/javax/management/query/InstanceOfExpTest.java
+++ b/jdk/test/javax/management/query/InstanceOfExpTest.java
@@ -26,7 +26,7 @@
  * @bug 5072174 6335848
  * @summary test the new method javax.management.Query.isInstanceOf("className")
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean InstanceOfExpTest
  * @run build InstanceOfExpTest
  * @run main InstanceOfExpTest
diff --git a/jdk/test/javax/management/query/QueryExpStringTest.java b/jdk/test/javax/management/query/QueryExpStringTest.java
index 7969658..ab4eebb 100644
--- a/jdk/test/javax/management/query/QueryExpStringTest.java
+++ b/jdk/test/javax/management/query/QueryExpStringTest.java
@@ -26,7 +26,7 @@
  * @bug 4886011
  * @summary Test that QueryExp.toString() is reversible
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean QueryExpStringTest
  * @run build QueryExpStringTest
  * @run main QueryExpStringTest
diff --git a/jdk/test/javax/management/query/QueryMatchTest.java b/jdk/test/javax/management/query/QueryMatchTest.java
index ec5c2a0..fa359ab 100644
--- a/jdk/test/javax/management/query/QueryMatchTest.java
+++ b/jdk/test/javax/management/query/QueryMatchTest.java
@@ -26,7 +26,7 @@
  * @bug 6266438
  * @summary Query.match code for character sequences like [a-z] is wrong.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean QueryMatchTest
  * @run build QueryMatchTest
  * @run main QueryMatchTest
diff --git a/jdk/test/javax/management/query/QuerySubstringTest.java b/jdk/test/javax/management/query/QuerySubstringTest.java
index 7b0a3d8..925e853 100644
--- a/jdk/test/javax/management/query/QuerySubstringTest.java
+++ b/jdk/test/javax/management/query/QuerySubstringTest.java
@@ -27,7 +27,7 @@
  * @summary Query.{initial,any,final}SubString fail if the
  *          matching constraint string contains wildcards.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean QuerySubstringTest
  * @run build QuerySubstringTest
  * @run main QuerySubstringTest
diff --git a/jdk/test/javax/management/relation/NonArrayListTest.java b/jdk/test/javax/management/relation/NonArrayListTest.java
index 28de757..0304c19 100644
--- a/jdk/test/javax/management/relation/NonArrayListTest.java
+++ b/jdk/test/javax/management/relation/NonArrayListTest.java
@@ -26,7 +26,7 @@
  * @bug 4848474
  * @summary Test that relation service doesn't require List params to be ArrayList
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean NonArrayListTest
  * @run build NonArrayListTest
  * @run main NonArrayListTest
diff --git a/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java b/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java
index b4c974f..783fe2b 100644
--- a/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java
+++ b/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java
@@ -26,7 +26,6 @@
  * @bug 6701459
  * @summary Test sequence numbers in RelationService notifications.
  * @author Eamonn McManus
- * @modules java.management
  */
 
 /*
diff --git a/jdk/test/javax/management/relation/RelationNotificationSourceTest.java b/jdk/test/javax/management/relation/RelationNotificationSourceTest.java
index 0133d1a..8a74fa1 100644
--- a/jdk/test/javax/management/relation/RelationNotificationSourceTest.java
+++ b/jdk/test/javax/management/relation/RelationNotificationSourceTest.java
@@ -26,7 +26,7 @@
  * @bug 4892674
  * @summary Test that RelationNotification can be constructed with ObjectName.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean RelationNotificationSourceTest
  * @run build RelationNotificationSourceTest
  * @run main RelationNotificationSourceTest
diff --git a/jdk/test/javax/management/relation/RelationTypeTest.java b/jdk/test/javax/management/relation/RelationTypeTest.java
index cfcb088..b7fa3fc 100644
--- a/jdk/test/javax/management/relation/RelationTypeTest.java
+++ b/jdk/test/javax/management/relation/RelationTypeTest.java
@@ -26,7 +26,7 @@
  * @bug 4716675
  * @summary Test that relation type checking uses isInstanceOf
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean RelationTypeTest
  * @run build RelationTypeTest
  * @run main RelationTypeTest
diff --git a/jdk/test/javax/management/remote/mandatory/TEST.properties b/jdk/test/javax/management/remote/mandatory/TEST.properties
new file mode 100644
index 0000000..cbe51d3
--- /dev/null
+++ b/jdk/test/javax/management/remote/mandatory/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.management.rmi
+
diff --git a/jdk/test/javax/management/remote/mandatory/URLTest.java b/jdk/test/javax/management/remote/mandatory/URLTest.java
index d10c1c7..d3e39b5 100644
--- a/jdk/test/javax/management/remote/mandatory/URLTest.java
+++ b/jdk/test/javax/management/remote/mandatory/URLTest.java
@@ -26,7 +26,7 @@
  * @bug 5057532
  * @summary Tests that host names are parsed correctly in URLs
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean URLTest
  * @run build URLTest
  * @run main URLTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java b/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java
index eb8897e..556ef78 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java
@@ -26,7 +26,7 @@
  * @bug 6238815
  * @summary test the new interface Addressable
  * @author Shanliang JIANG
- * @modules java.management.rmi
+ *
  * @run clean AddressableTest
  * @run build AddressableTest
  * @run main AddressableTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java
index 590c726..e3570a5 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java
@@ -24,10 +24,10 @@
 /*
  * @test
  * @bug 4940957 8025205
+ * @key intermittent
  * @summary Tests behaviour when connections break
  * @author Eamonn McManus
- * @key intermittent
- * @modules java.management.rmi
+ *
  * @run clean BrokenConnectionTest
  * @run build BrokenConnectionTest
  * @run main BrokenConnectionTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java
index 2eb59b3..b93b3bb 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java
@@ -26,7 +26,7 @@
  * @bug 4921888
  * @summary Tests that we do not get a NullPointException.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean CloseFailedClientTest
  * @run build CloseFailedClientTest
  * @run main CloseFailedClientTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java
index a1944ba..e99be18 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java
@@ -26,7 +26,7 @@
  * @bug 4838640
  * @summary test server close in different conditions.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean CloseServerTest
  * @run build CloseServerTest
  * @run main CloseServerTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java
index 3492568..e933dd8 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java
@@ -26,7 +26,7 @@
  * @bug 4897052
  * @summary Tests that opening and immediately closing a connector works
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean CloseUnconnectedTest
  * @run build CloseUnconnectedTest
  * @run main CloseUnconnectedTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java
index 791cd89..d49cd7a 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java
@@ -28,7 +28,7 @@
  *          the method "void close() throws IOException;" extend
  *          or implement the java.io.Closeable interface.
  * @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
  * @run clean CloseableTest
  * @run build CloseableTest
  * @run main CloseableTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java b/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java
index cbe2165..18f49d2 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java
@@ -26,7 +26,7 @@
  * @bug 4943248
  * @summary Tests that NullPointerException is thrown when listener is null.
  * @author Daniel Fuchs
- * @modules java.management.rmi
+ *
  * @run clean ConnectionListenerNullTest
  * @run build ConnectionListenerNullTest
  * @run main ConnectionListenerNullTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java
index c16412d..db2f5ef 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java
@@ -26,7 +26,7 @@
  * @bug 4865397
  * @summary Tests remote JMX connections
  * @author Eamonn McManus
- * @modules java.management.rmi
+ *
  * @run clean ConnectionTest
  * @run build ConnectionTest
  * @run main ConnectionTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java b/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java
index de0184c..73f04b6 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java
@@ -28,7 +28,7 @@
  * @summary test the connector server option that causes it not to prevent the
  * VM from exiting
  * @author Shanliang JIANG, Eamonn McManus
- * @modules java.management.rmi
+ *
  * @run main/othervm DaemonRMIExporterTest
  */
 import java.util.Arrays;
diff --git a/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java b/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java
index 65c4068..e9f0602 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java
@@ -26,7 +26,7 @@
  * @bug 5039210
  * @summary test on a client notification deadlock.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean DeadLockTest
  * @run build DeadLockTest
  * @run main DeadLockTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java
index b231bba..d1f3c7b 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java
@@ -27,7 +27,7 @@
  * @bug 4939578
  * @summary test to get an IOException.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean FailedConnectionTest
  * @run build FailedConnectionTest
  * @run main FailedConnectionTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java
index 7c3bf66..f161525 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java
@@ -26,7 +26,7 @@
  * @bug 4951414
  * @summary Try to get an IOException.
  * @author Shanliang JIANG
- * @modules java.management.rmi
+ *
  * @run clean GetConnectionTest
  * @run build GetConnectionTest
  * @run main GetConnectionTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java b/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java
index 49aa0e4..cdbf829 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java
@@ -26,7 +26,7 @@
  * @bug 4886799
  * @summary Check that IIOP URLs have /ior/ in the path
  * @author Eamonn McManus
- * @modules java.management.rmi
+ *
  * @run clean IIOPURLTest
  * @run build IIOPURLTest
  * @run main IIOPURLTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java b/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java
index 4ff6020..1336b18 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java
@@ -26,7 +26,7 @@
  * @bug 7065236
  * @summary Test for locale insensitive strings in JMXServiceURL class
  * @author Harsha Wardhana B
- * @modules java.management
+ *
  * @run clean JMXServiceURLLocaleTest
  * @run build JMXServiceURLLocaleTest
  * @run main JMXServiceURLLocaleTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java b/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java
index fc913a6..2fa2975 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java
@@ -26,7 +26,7 @@
  * @bug 1234567
  * @summary Open, connect then close multi-connectors.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean MultiOpenCloseTest
  * @run build MultiOpenCloseTest
  * @run main MultiOpenCloseTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java b/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java
index 63542a4..4f82efc 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java
@@ -45,7 +45,7 @@
  * @bug 6697180
  * @summary test on a client notification deadlock.
  * @author Shanliang JIANG
- * @modules java.management.rmi
+ *
  * @run clean MultiThreadDeadLockTest
  * @run build MultiThreadDeadLockTest
  * @run main MultiThreadDeadLockTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java
index 3b86bc8..e518ae6 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java
@@ -26,7 +26,7 @@
  * @bug 4901808 7183800
  * @summary Check that RMI connection ids include IP address of a client network interface
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean RMIConnectionIdTest
  * @run build RMIConnectionIdTest
  * @run main RMIConnectionIdTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java
index 2284180..dad2964 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java
@@ -55,6 +55,9 @@
  * @bug 8147857
  * @summary Tests whether RMIConnector logs attribute names correctly.
  * @author Severin Gehwolf
+ *
+ * @modules java.logging
+ *          java.management.rmi
  */
 public class RMIConnectorLogAttributesTest {
 
diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java
index df81b36..06f8417 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java
@@ -27,7 +27,7 @@
  * @bug 4917237
  * @summary test that process exit immediately after stop() / close() called
  * @author Jean Francois Denise
- * @modules java.management.rmi
+ *
  * @run clean RMIExitTest
  * @run build RMIExitTest
  * @run main RMIExitTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java
index ac5331d..faba7b7 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java
@@ -26,7 +26,7 @@
  * @summary Tests to serialize RMIConnector
  * @bug 5032052
  * @author Shanliang JIANG
- * @modules java.management.rmi
+ *
  * @run clean RMISerializeTest
  * @run build RMISerializeTest
  * @run main RMISerializeTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java b/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java
index a2a110e..6c3ca9a 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java
@@ -26,7 +26,7 @@
  * @bug 4927217
  * @summary test to reconnect
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean ReconnectTest
  * @run build ReconnectTest
  * @run main ReconnectTest
diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java
index ad84f39..4a72328 100644
--- a/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java
@@ -26,7 +26,6 @@
  * @bug 6475157
  * @summary Tests deadlock in simultaneous connection and connector-server close
  * @author Eamonn McManus
- * @modules java.management.rmi
  */
 
 /* This test is somewhat dependent on implementation details.  If it suddenly
diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java
index d102ecb..3e2555b 100644
--- a/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java
@@ -27,7 +27,7 @@
  * @summary Tests that JNDI bind failure doesn't leave an orphan RMI
  * Connector Server object
  * @author Eamonn McManus
- * @modules java.management.rmi
+ *
  * @run clean JNDIFailureTest
  * @run build JNDIFailureTest
  * @run main JNDIFailureTest
diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java
index 1d0355e..7c3f1e7 100644
--- a/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java
@@ -27,7 +27,7 @@
  * @summary Test that setting an MBeanServerForwarder on an already
  *          started RMI connector server has the expected behavior.
  * @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
  * @run clean MBSFPreStartPostStartTest
  * @run build MBSFPreStartPostStartTest
  * @run main MBSFPreStartPostStartTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java b/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java
index e0aab2f..8db4113f 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java
@@ -26,7 +26,7 @@
  * @bug 4884913
  * @summary Tests that default protocols are loaded correctly
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean DefaultProviderTest
  * @run build DefaultProviderTest
  * @run main DefaultProviderTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java b/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java
index 2cb8d87..301b999 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java
@@ -26,7 +26,7 @@
  * @bug 4924683
  * @summary Check RMI/JRMP stubs can be deserialized using user's loader
  * @author Eamonn McManus
- * @modules java.management.rmi
+ *
  * @run clean DeserializeEncodedURLTest SingleClassLoader
  * @run build DeserializeEncodedURLTest SingleClassLoader
  * @run main DeserializeEncodedURLTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java b/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java
index cb68a99..ce70611 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java
@@ -26,8 +26,9 @@
  * @bug 4898478
  * @summary Tests client default class loader used before JSR 160 loader
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @library /lib/testlibrary
+ *
  * @run clean MethodResultTest
  * @run build MethodResultTest
  * @run main MethodResultTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java b/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java
index 7c93e0c..326dd37 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java
@@ -24,13 +24,13 @@
 /*
  * @test
  * @bug 4915825 4921009 4934965 4977469 8019584
+ * @key randomness
  * @summary Tests behavior when client or server gets object of unknown class
  * @author Eamonn McManus
- * @modules java.management.rmi
+ *
  * @run clean MissingClassTest SingleClassLoader
  * @run build MissingClassTest SingleClassLoader
  * @run main MissingClassTest
- * @key randomness
  */
 
 /*
diff --git a/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java b/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java
index ebdf181..c757bae 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java
@@ -26,7 +26,7 @@
  * @bug 5021246
  * @summary Check that class downloading is supported by RMI connector
  * @author Eamonn McManus
- * @modules java.management.rmi
+ *
  * @run main RMIDownloadTest receive without
  * @run main RMIDownloadTest send without
  * @run main RMIDownloadTest receive with
diff --git a/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java b/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java
index a5df385..9d94999 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java
@@ -26,7 +26,7 @@
  * @bug 4910428
  * @summary Tests target MBean class loader used before JSR 160 loader
  * @author Eamonn McManus
- * @modules java.management.rmi
+ *
  * @run clean TargetMBeanTest
  * @run build TargetMBeanTest
  * @run main TargetMBeanTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java b/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java
index e634d6c..7836762 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java
@@ -26,7 +26,7 @@
  * @bug 6356458
  * @summary test to not lose a user classloader
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean UserClassLoaderTest
  * @run build UserClassLoaderTest
  * @run main UserClassLoaderTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java b/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java
index a3b4337..e4885b4 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java
@@ -27,7 +27,7 @@
  * @bug 4838640 4917194
  * @summary test on add/remove NotificationListener
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean AddRemoveTest
  * @run build AddRemoveTest
  * @run main AddRemoveTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java b/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java
index a7830fa..eb13087 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java
@@ -26,7 +26,7 @@
  * @bug 7120365
  * @summary test on Concurrent Modification
  * @author Shanliang JIANG
- * @modules java.management.rmi
+ *
  * @run main ConcurrentModificationTest
  */
 
diff --git a/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java b/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java
index 8ed989c..467c84b 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java
@@ -26,7 +26,7 @@
  * @bug 4911721
  * @summary test on add/remove NotificationListener
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean DiffHBTest
  * @run build DiffHBTest
  * @run main DiffHBTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java b/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java
index 5041a6b..79d5476 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java
@@ -27,7 +27,7 @@
  * @summary Check that the expected notification is received by the JMX
  *          client even when the domain in the ObjectName is not specified
  * @author Shanliang JIANG
- * @modules java.management.rmi
+ *
  * @run clean EmptyDomainNotificationTest
  * @run build EmptyDomainNotificationTest
  * @run main EmptyDomainNotificationTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java b/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java
index bc6922f..e9e3445 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java
@@ -26,9 +26,9 @@
  * @bug 6338874
  * @summary Check that notification dispatch is not linear in number of MBeans.
  * @author Eamonn McManus
- * @modules java.management.rmi
  *
  * @library /lib/testlibrary
+ *
  * @run build jdk.testlibrary.* ListenerScaleTest
  * @run main ListenerScaleTest
  */
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java
index 8bd7aea..600f0de 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java
@@ -23,10 +23,10 @@
 
 /*
  * @test
- * @summary Tests to send a not serializable notification.
  * @bug 5022196 8132003
+ * @summary Tests to send a not serializable notification.
  * @author Shanliang JIANG
- * @modules java.management.rmi
+ *
  * @run clean NotSerializableNotifTest
  * @run build NotSerializableNotifTest
  * @run main NotSerializableNotifTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java
index bb7af6c..94a0690 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java
@@ -26,7 +26,7 @@
  * @bug 6174229
  * @summary Verify the property name specifying server notification buffer size.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean NotifBufferSizePropertyNameTest
  * @run build NotifBufferSizePropertyNameTest
  * @run main NotifBufferSizePropertyNameTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java
index 74b2ee58..72319d7 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java
@@ -26,7 +26,7 @@
  * @bug 6199899
  * @summary Tests reconnection done by a fetching notif thread.
  * @author Shanliang JIANG
- * @modules java.management.rmi
+ *
  * @run clean NotifReconnectDeadlockTest
  * @run build NotifReconnectDeadlockTest
  * @run main NotifReconnectDeadlockTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java
index 030d9c2..cfc5765 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java
@@ -26,7 +26,7 @@
  * @bug 4934236
  * @summary Tests that NotificationBuffer is created when used.
  * @author jfd@...
- * @modules java.management.rmi
+ *
  * @run clean NotificationBufferCreationTest NotificationSender
  * @run build NotificationBufferCreationTest
  * @run main NotificationBufferCreationTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java
index 68e7129..fd708e0 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java
@@ -27,7 +27,7 @@
  * @summary Tests NotificationBuffer doesn't hold locks when adding listeners,
  *  if test times out then deadlock is suspected.
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean NotificationBufferDeadlockTest
  * @run build NotificationBufferDeadlockTest
  * @run main NotificationBufferDeadlockTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java
index bdacde2..a54030d 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java
@@ -24,11 +24,11 @@
 /*
  * @test
  * @bug 5106721
+ * @key intermittent
  * @summary Check the emission of notifications when a Security Manager is
  * installed. Test the property "jmx.remote.x.check.notification.emission".
  * @author Luis-Miguel Alventosa
- * @key intermittent
- * @modules java.management.rmi
+ *
  * @run clean NotificationEmissionTest
  * @run build NotificationEmissionTest
  * @run main NotificationEmissionTest 1
diff --git a/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java b/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java
index 6531b44..9f1a91d 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java
@@ -25,9 +25,8 @@
  * @test
  * @bug 7654321
  * @summary Tests to receive notifications for opened and closed connections
-ions
  * @author sjiang
- * @modules java.management.rmi
+ *
  * @run clean RMINotifTest
  * @run build RMINotifTest
  * @run main RMINotifTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java b/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java
index 036ef7f..b222f9c 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java
@@ -27,7 +27,7 @@
  * @summary Tests the reception of the notifications for opened and closed
  * connections
  * @author sjiang
- * @modules java.management.rmi
+ *
  * @run clean ServerNotifs
  * @run build ServerNotifs
  * @run main ServerNotifs
diff --git a/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java b/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java
index 39a7f44..3b7c7c6 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java
@@ -27,7 +27,7 @@
  * @summary Tests whether a listener receives notifs emitted before the
  * listener is registered.
  * @author Shanliang JIANG
- * @modules java.management.rmi
+ *
  * @run clean UnexpectedNotifTest
  * @run build UnexpectedNotifTest
  * @run main UnexpectedNotifTest
diff --git a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java
index b178b04..2726120e2 100644
--- a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java
+++ b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java
@@ -27,7 +27,7 @@
  * @summary Tests that MBeanServerFileAccessController supports
  *          principals other than JMXPrincipal.
  * @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
  * @run clean NonJMXPrincipalsTest SimpleStandard SimpleStandardMBean
  * @run build NonJMXPrincipalsTest SimpleStandard SimpleStandardMBean
  * @run main NonJMXPrincipalsTest
diff --git a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java
index 43e1777..5e79436 100644
--- a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java
+++ b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java
@@ -27,7 +27,7 @@
  * @summary Tests the use of the "jmx.remote.x.password.file" and
  *          "jmx.remote.x.access.file" environment map properties.
  * @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
  * @run clean PasswordAccessFileTest SimpleStandard SimpleStandardMBean
  * @run build PasswordAccessFileTest SimpleStandard SimpleStandardMBean
  * @run main PasswordAccessFileTest
diff --git a/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java b/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java
index 8491f24..1e02e92 100644
--- a/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java
+++ b/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java
@@ -24,7 +24,7 @@
 /*
  * @test ProviderTest.java
  * @summary Tests jar services provider are called
- * @modules java.management.rmi
+ *
  * @run clean ProviderTest provider.JMXConnectorProviderImpl provider.JMXConnectorServerProviderImpl
  * @run build ProviderTest provider.JMXConnectorProviderImpl provider.JMXConnectorServerProviderImpl
  * @run main ProviderTest
diff --git a/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java b/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java
index c8aa8bd..cbdb5e6 100644
--- a/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java
+++ b/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java
@@ -26,7 +26,7 @@
  * @bug 7654321
  * @summary Tests the use of the custom RMI socket factories.
  * @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
  * @run clean RMISocketFactoriesTest
  * @run build RMISocketFactoriesTest RMIClientFactory RMIServerFactory
  * @run main RMISocketFactoriesTest test_server_factory
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java
index c555302..4e03de3 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,6 @@
 import java.rmi.RemoteException;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Properties;
 import javax.management.Attribute;
@@ -57,24 +56,11 @@
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXConnectorServer;
 import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXPrincipal;
 import javax.management.remote.JMXServiceURL;
-import javax.security.auth.Subject;
 
 public class SubjectDelegation2Test {
 
     public static void main(String[] args) throws Exception {
-        // Check for supported operating systems: Solaris
-        //
-        // This test runs only on Solaris due to CR 6285916
-        //
-        String osName = System.getProperty("os.name");
-        System.out.println("os.name = " + osName);
-        if (!osName.equals("SunOS")) {
-            System.out.println("This test runs on Solaris only.");
-            System.out.println("Bye! Bye!");
-            return;
-        }
         String policyFile = args[0];
         String testResult = args[1];
         System.out.println("Policy file = " + policyFile);
@@ -137,9 +123,8 @@
             // Create an RMI connector server
             //
             System.out.println("Create an RMI connector server");
-            JMXServiceURL url =
-                new JMXServiceURL("rmi", null, 0,
-                                  "/jndi/rmi://:" + port + "/server" + port);
+            JMXServiceURL url = new JMXServiceURL("rmi", null, 0);
+
             jmxcs =
                 JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
             jmxcs.start();
@@ -151,7 +136,7 @@
             //
             String[] credentials = new String[] { "monitorRole" , "QED" };
             cli_env.put("jmx.remote.credentials", credentials);
-            jmxc = JMXConnectorFactory.connect(url, cli_env);
+            jmxc = JMXConnectorFactory.connect(jmxcs.getAddress(), cli_env);
             MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
             // Get domains from MBeanServer
             //
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java
index 27479d1..b999c9e 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,17 +65,6 @@
 public class SubjectDelegation3Test {
 
     public static void main(String[] args) throws Exception {
-        // Check for supported operating systems: Solaris
-        //
-        // This test runs only on Solaris due to CR 6285916
-        //
-        String osName = System.getProperty("os.name");
-        System.out.println("os.name = " + osName);
-        if (!osName.equals("SunOS")) {
-            System.out.println("This test runs on Solaris only.");
-            System.out.println("Bye! Bye!");
-            return;
-        }
         String policyFile = args[0];
         String testResult = args[1];
         System.out.println("Policy file = " + policyFile);
@@ -139,8 +128,7 @@
             //
             System.out.println("Create an RMI connector server");
             JMXServiceURL url =
-                new JMXServiceURL("rmi", null, 0,
-                                  "/jndi/rmi://:" + port + "/server" + port);
+                new JMXServiceURL("rmi", null, 0);
             jmxcs =
                 JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
             jmxcs.start();
@@ -152,7 +140,7 @@
             //
             String[] credentials = new String[] { "monitorRole" , "QED" };
             cli_env.put("jmx.remote.credentials", credentials);
-            jmxc = JMXConnectorFactory.connect(url, cli_env);
+            jmxc = JMXConnectorFactory.connect(jmxcs.getAddress(), cli_env);
             Subject delegationSubject =
                 new Subject(true,
                             Collections.singleton(new JMXPrincipal("delegate")),
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy21 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy21
index 4b83e5f..5419fa2 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy21
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy21
@@ -2,6 +2,7 @@
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
     permission java.security.SecurityPermission "createAccessControlContext";
+    permission java.lang.RuntimePermission "*";
     permission javax.management.MBeanPermission "*", "getDomains";
     permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
     permission javax.security.auth.AuthPermission "getSubject";
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy22 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy22
index 7db4277..87d39c8 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy22
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy22
@@ -1,6 +1,7 @@
 grant codebase "file:/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+    permission java.lang.RuntimePermission "*";
     permission java.security.SecurityPermission "createAccessControlContext";
 //    permission javax.management.MBeanPermission "*", "getDomains";
     permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy23 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy23
index 4a92cb5..584cb47 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy23
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy23
@@ -1,6 +1,7 @@
 grant codebase "file:/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+    permission java.lang.RuntimePermission "*";
     permission java.security.SecurityPermission "createAccessControlContext";
     permission javax.management.MBeanPermission "*", "getDomains";
     permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy24 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy24
index cbb92df..ed7f2c9 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy24
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy24
@@ -1,5 +1,6 @@
 grant codebase "file:/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
+    permission java.lang.RuntimePermission "*";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
     permission java.security.SecurityPermission "createAccessControlContext";
     permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy25 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy25
index 98b83de..9acbd1a 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy25
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy25
@@ -1,5 +1,6 @@
 grant codebase "file:/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
+    permission java.lang.RuntimePermission "*";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
     permission java.security.SecurityPermission "createAccessControlContext";
     permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy31 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy31
index 70939f5..43d28c3 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy31
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy31
@@ -1,6 +1,7 @@
 grant codebase "file:/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+    permission java.lang.RuntimePermission "*";
     permission java.security.SecurityPermission "createAccessControlContext";
     permission javax.management.MBeanPermission "*", "getDomains";
     permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy32 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy32
index 3f5354e..bc4c7d4 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy32
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy32
@@ -1,6 +1,7 @@
 grant codebase "file:/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+    permission java.lang.RuntimePermission "*";
     permission java.security.SecurityPermission "createAccessControlContext";
 //    permission javax.management.MBeanPermission "*", "getDomains";
     permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy33 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy33
index b11df45..9a41f4c 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy33
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy33
@@ -1,6 +1,7 @@
 grant codebase "file:/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
+    permission java.lang.RuntimePermission "*";
     permission java.security.SecurityPermission "createAccessControlContext";
     permission javax.management.MBeanPermission "*", "getDomains";
     permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy34 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy34
index 761444e..dd935b0 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy34
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy34
@@ -1,5 +1,6 @@
 grant codebase "file:/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
+    permission java.lang.RuntimePermission "*";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
     permission java.security.SecurityPermission "createAccessControlContext";
     permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy35 b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy35
index 5aebb6b..29b1023 100644
--- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy35
+++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/policy35
@@ -1,5 +1,6 @@
 grant codebase "file:/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
+    permission java.lang.RuntimePermission "*";
     permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
     permission java.security.SecurityPermission "createAccessControlContext";
     permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
diff --git a/jdk/test/javax/management/remote/mandatory/threads/ExecutorShutdownTest.java b/jdk/test/javax/management/remote/mandatory/threads/ExecutorShutdownTest.java
index 003780c..7620b0c 100644
--- a/jdk/test/javax/management/remote/mandatory/threads/ExecutorShutdownTest.java
+++ b/jdk/test/javax/management/remote/mandatory/threads/ExecutorShutdownTest.java
@@ -26,7 +26,7 @@
  * @bug 8141591
  * @summary Tests if notifications are received after executor is shutdown
  * @author Harsha Wardhana B
- * @modules java.management
+ *
  * @run clean ExecutorShutdownTest
  * @run build ExecutorShutdownTest
  * @run main ExecutorShutdownTest
diff --git a/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java b/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java
index 02351a6..a1248fe 100644
--- a/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java
+++ b/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java
@@ -26,7 +26,7 @@
  * @bug 6190873
  * @summary Tests that thread creation can use a user-supplied Executor
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean ExecutorTest
  * @run build ExecutorTest
  * @run main ExecutorTest
diff --git a/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java b/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java
index ec88e51..f07840e 100644
--- a/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java
+++ b/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java
@@ -26,7 +26,7 @@
  * @bug 6192124
  * @summary Tests that you can turn off the server connection timeout thread
  * @author Eamonn McManus
- * @modules java.management
+ *
  * @run clean NoServerTimeoutTest
  * @run build NoServerTimeoutTest
  * @run main NoServerTimeoutTest
diff --git a/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java b/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
index 1e3662c..8ee4e76 100644
--- a/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
@@ -29,7 +29,7 @@
  * test codebase has the java permission to read the "java.runtime.version"
  * system property.
  * @author Luis-Miguel Alventosa, Joel Feraud
- * @modules java.management
+ *
  * @run clean ImplVersionTest ImplVersionCommand
  * @run build ImplVersionTest ImplVersionCommand ImplVersionReader
  * @run main ImplVersionTest
diff --git a/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java b/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java
index b4a781b..cd91a82 100644
--- a/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java
+++ b/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java
@@ -27,7 +27,7 @@
  * @summary Test that MBeanServer.queryNames doesn't call getMBeanInfo on every
  *          resultant MBean when there is no security manager installed.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean AvoidGetMBeanInfoCallsTest
  * @run build AvoidGetMBeanInfoCallsTest
  * @run main AvoidGetMBeanInfoCallsTest
diff --git a/jdk/test/javax/management/security/MBeanPermissionTest.java b/jdk/test/javax/management/security/MBeanPermissionTest.java
index 6ac0fc2..21a032c 100644
--- a/jdk/test/javax/management/security/MBeanPermissionTest.java
+++ b/jdk/test/javax/management/security/MBeanPermissionTest.java
@@ -26,7 +26,7 @@
  * @bug 6228749
  * @summary MBeanPermission(null,"") should throw IllegalArgumentException.
  * @author Luis-Miguel Alventosa
- * @modules java.management
+ *
  * @run clean MBeanPermissionTest
  * @run build MBeanPermissionTest
  * @run main MBeanPermissionTest
diff --git a/jdk/test/javax/management/standardmbean/DeadlockTest.java b/jdk/test/javax/management/standardmbean/DeadlockTest.java
index 7bd6739..3381240 100644
--- a/jdk/test/javax/management/standardmbean/DeadlockTest.java
+++ b/jdk/test/javax/management/standardmbean/DeadlockTest.java
@@ -26,7 +26,7 @@
  * @bug 6331746
  * @summary Test a deadlock and will be blocked forever if the deadlock is present.
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run main DeadlockTest
  */
 
diff --git a/jdk/test/javax/management/timer/MissingNotificationTest.java b/jdk/test/javax/management/timer/MissingNotificationTest.java
index e4bb8c2..16de79c 100644
--- a/jdk/test/javax/management/timer/MissingNotificationTest.java
+++ b/jdk/test/javax/management/timer/MissingNotificationTest.java
@@ -24,13 +24,13 @@
 /*
  * @test
  * @bug 6809322
+ * @key randomness
  * @summary Test for missing notifications in a high concurrency environment
  * @author Jaroslav Bachorik
- * @modules java.management
+ *
  * @run clean MissingNotificationTest
  * @run build MissingNotificationTest
  * @run main MissingNotificationTest
- * @key randomness
  */
 
 import java.util.Date;
diff --git a/jdk/test/javax/management/timer/StartTest.java b/jdk/test/javax/management/timer/StartTest.java
index 50f03d4..a29a671 100644
--- a/jdk/test/javax/management/timer/StartTest.java
+++ b/jdk/test/javax/management/timer/StartTest.java
@@ -26,7 +26,7 @@
  * @bug 6659215
  * @summary Test on timer start method with past notifications
  * @author Shanliang JIANG
- * @modules java.management
+ *
  * @run clean StartTest
  * @run build StartTest
  * @run main StartTest
diff --git a/jdk/test/javax/naming/TEST.properties b/jdk/test/javax/naming/TEST.properties
new file mode 100644
index 0000000..88ac1ce
--- /dev/null
+++ b/jdk/test/javax/naming/TEST.properties
@@ -0,0 +1 @@
+modules = java.naming
diff --git a/jdk/test/javax/net/ssl/DTLS/CipherSuite.java b/jdk/test/javax/net/ssl/DTLS/CipherSuite.java
index 3509878..cfca351 100644
--- a/jdk/test/javax/net/ssl/DTLS/CipherSuite.java
+++ b/jdk/test/javax/net/ssl/DTLS/CipherSuite.java
@@ -27,6 +27,7 @@
 /*
  * @test
  * @bug 8043758
+ * @key intermittent
  * @summary Datagram Transport Layer Security (DTLS)
  * @modules java.base/sun.security.util
  *          jdk.crypto.ec
diff --git a/jdk/test/javax/security/auth/PrivateCredentialPermission/MoreThenOnePrincipals.java b/jdk/test/javax/security/auth/PrivateCredentialPermission/MoreThenOnePrincipals.java
index 09f7f01..f08301b 100644
--- a/jdk/test/javax/security/auth/PrivateCredentialPermission/MoreThenOnePrincipals.java
+++ b/jdk/test/javax/security/auth/PrivateCredentialPermission/MoreThenOnePrincipals.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 /*
  * @test
  * @bug 8050409
+ * @modules jdk.security.auth
  * @summary Tests with Subject.getPrivateCredentials to check permission checks with one or more principals.
  * @run testng/othervm/policy=MoreThenOnePrincipals.policy MoreThenOnePrincipals
  */
diff --git a/jdk/test/javax/security/auth/PrivateCredentialPermission/Subset.java b/jdk/test/javax/security/auth/PrivateCredentialPermission/Subset.java
index 34d5744..a48e1f9 100644
--- a/jdk/test/javax/security/auth/PrivateCredentialPermission/Subset.java
+++ b/jdk/test/javax/security/auth/PrivateCredentialPermission/Subset.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,15 @@
  * @test
  * @author  Ram Marti
  * @bug 4326852
+ * @modules jdk.security.auth
  * @summary Retrive a subset of private credentials can be accessed
  * @run main/othervm/policy=Subset.policy Subset
  */
 
-import java.util.*;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
 import com.sun.security.auth.SolarisPrincipal;
 import javax.security.auth.Subject;
 
diff --git a/jdk/test/javax/security/auth/Subject/Serial.java b/jdk/test/javax/security/auth/Subject/Serial.java
index f4fc860..001f8a9 100644
--- a/jdk/test/javax/security/auth/Subject/Serial.java
+++ b/jdk/test/javax/security/auth/Subject/Serial.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,19 @@
 /*
  * @test
  * @bug 4364826
+ * @modules jdk.security.auth
  * @summary     Subject serialized principal set is
  *              implementation-dependent class
  * @run main/othervm/policy=Serial.policy Serial
  */
 
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.HashSet;
+import java.util.Set;
 import javax.security.auth.Subject;
-import java.io.*;
-import java.util.*;
 
 public class Serial implements java.io.Serializable {
 
diff --git a/jdk/test/javax/security/auth/SubjectDomainCombiner/Regression.java b/jdk/test/javax/security/auth/SubjectDomainCombiner/Regression.java
index 3662275..b2ee189 100644
--- a/jdk/test/javax/security/auth/SubjectDomainCombiner/Regression.java
+++ b/jdk/test/javax/security/auth/SubjectDomainCombiner/Regression.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,20 @@
 /*
  * @test
  * @bug 4390546
+ * @modules jdk.security.auth
  * @summary     performance regression and other bugs in
  *              SubjectDomainCombiner.combine
  *
  * @run main/othervm/policy=Regression.policy -Djava.security.auth.debug=combiner Regression
  */
 
-import javax.security.auth.*;
 import java.security.ProtectionDomain;
 import java.security.CodeSource;
 import java.net.URL;
 import java.util.Set;
 import java.util.HashSet;
+import javax.security.auth.Subject;
+import javax.security.auth.SubjectDomainCombiner;
 
 public class Regression {
 
diff --git a/jdk/test/javax/security/auth/kerberos/TEST.properties b/jdk/test/javax/security/auth/kerberos/TEST.properties
new file mode 100644
index 0000000..e7aa6bb
--- /dev/null
+++ b/jdk/test/javax/security/auth/kerberos/TEST.properties
@@ -0,0 +1 @@
+modules = java.security.jgss
diff --git a/jdk/test/javax/security/auth/login/Configuration/GetInstance.java b/jdk/test/javax/security/auth/login/Configuration/GetInstance.java
index 2f4d7e1..4be056b 100644
--- a/jdk/test/javax/security/auth/login/Configuration/GetInstance.java
+++ b/jdk/test/javax/security/auth/login/Configuration/GetInstance.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,16 +25,21 @@
  * @test
  * @bug 6268315
  * @bug 6273812
+ * @modules jdk.security.auth
  * @summary Configuration should be provider-based
  * @build GetInstanceConfigSpi GetInstanceProvider
  * @run main/othervm -Djava.security.auth.login.config==${test.src}${/}GetInstance.config GetInstance
  */
 
-import javax.security.auth.login.*;
-
-import java.security.*;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.Provider;
+import java.security.Security;
+import java.security.URIParameter;
 import java.io.File;
 import java.net.URI;
+import javax.security.auth.login.AppConfigurationEntry;
+import javax.security.auth.login.Configuration;
 
 public class GetInstance {
 
diff --git a/jdk/test/javax/security/auth/login/Configuration/GetInstanceSecurity.java b/jdk/test/javax/security/auth/login/Configuration/GetInstanceSecurity.java
index ebd5805..fc2bec0 100644
--- a/jdk/test/javax/security/auth/login/Configuration/GetInstanceSecurity.java
+++ b/jdk/test/javax/security/auth/login/Configuration/GetInstanceSecurity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 6268315
+ * @modules jdk.security.auth
  * @summary Configuration should be provider-based
  * @build GetInstanceConfigSpi GetInstanceProvider
  * @run main/othervm/policy=GetInstanceSecurity.policy GetInstanceSecurity
@@ -31,8 +32,10 @@
 
 import java.io.File;
 import java.net.URI;
-import java.security.*;
-import javax.security.auth.login.*;
+import java.security.Policy;
+import java.security.Security;
+import java.security.URIParameter;
+import javax.security.auth.login.Configuration;
 
 public class GetInstanceSecurity {
 
diff --git a/jdk/test/javax/security/auth/login/LoginContext/ConfigConstructor.java b/jdk/test/javax/security/auth/login/LoginContext/ConfigConstructor.java
index 3b0f130..0fc36c1 100644
--- a/jdk/test/javax/security/auth/login/LoginContext/ConfigConstructor.java
+++ b/jdk/test/javax/security/auth/login/LoginContext/ConfigConstructor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,10 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4703361
+ * @modules jdk.security.auth
  * @summary can not specify Configuration to LoginContext constructor
  *
  * @run main/othervm/policy=ConfigConstructor.policy -Djava.security.auth.login.config=file:${test.src}/ConfigConstructor.config ConfigConstructor
@@ -37,10 +38,13 @@
  */
 
 import java.util.Map;
-import javax.security.auth.*;
-import javax.security.auth.login.*;
-import javax.security.auth.spi.*;
-import javax.security.auth.callback.*;
+import javax.security.auth.Subject;
+import javax.security.auth.login.AppConfigurationEntry;
+import javax.security.auth.login.Configuration;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
+import javax.security.auth.callback.CallbackHandler;
 
 public class ConfigConstructor {
 
diff --git a/jdk/test/javax/security/auth/login/LoginContext/ConfigConstructorNoPerm.java b/jdk/test/javax/security/auth/login/LoginContext/ConfigConstructorNoPerm.java
index ece8bd1..84287ba 100644
--- a/jdk/test/javax/security/auth/login/LoginContext/ConfigConstructorNoPerm.java
+++ b/jdk/test/javax/security/auth/login/LoginContext/ConfigConstructorNoPerm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,10 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4703361
+ * @modules jdk.security.auth
  * @summary can not specify Configuration to LoginContext constructor
  *
  * @run main/othervm/policy=ConfigConstructorNoPerm.policy -Djava.security.auth.login.config=file:${test.src}/ConfigConstructor.config ConfigConstructorNoPerm
@@ -36,10 +37,11 @@
  */
 
 import java.util.Map;
-import javax.security.auth.*;
-import javax.security.auth.login.*;
-import javax.security.auth.spi.*;
-import javax.security.auth.callback.*;
+import javax.security.auth.Subject;
+import javax.security.auth.login.AppConfigurationEntry;
+import javax.security.auth.login.Configuration;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.callback.CallbackHandler;
 
 public class ConfigConstructorNoPerm {
 
diff --git a/jdk/test/javax/security/auth/login/LoginContext/ModuleSubject.java b/jdk/test/javax/security/auth/login/LoginContext/ModuleSubject.java
index e75f3f0..4aef84b 100644
--- a/jdk/test/javax/security/auth/login/LoginContext/ModuleSubject.java
+++ b/jdk/test/javax/security/auth/login/LoginContext/ModuleSubject.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 4378100
+ * @modules jdk.security.auth
  * @summary LoginContext doesn't reinit modules with new Subject
  *      if authentication fails
  *
@@ -31,9 +32,9 @@
  * @run main/othervm -Djava.security.auth.login.config=file:${test.src}/ModuleSubject.config ModuleSubject
  */
 
-import javax.security.auth.*;
-import javax.security.auth.login.*;
 import java.security.Principal;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
 
 public class ModuleSubject {
 
diff --git a/jdk/test/javax/security/sasl/Sasl/PassSysProps.java b/jdk/test/javax/security/sasl/Sasl/PassSysProps.java
index 97aabcb..fa89c9b 100644
--- a/jdk/test/javax/security/sasl/Sasl/PassSysProps.java
+++ b/jdk/test/javax/security/sasl/Sasl/PassSysProps.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,10 +21,11 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @author Vincent Ryan
  * @bug 6228412
+ * @modules java.security.sasl
  * @summary Check that a Properties object can be passed to the Sasl create
  *          client and create server methods.
  */
@@ -32,8 +33,12 @@
 import java.util.Hashtable;
 import java.util.Map;
 import java.util.Properties;
-import javax.security.sasl.*;
-import javax.security.auth.callback.*;
+import javax.security.sasl.Sasl;
+import javax.security.sasl.SaslClient;
+import javax.security.sasl.SaslException;
+import javax.security.sasl.SaslServer;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
 import org.ietf.jgss.GSSException;
 
 public class PassSysProps {
diff --git a/jdk/test/javax/smartcardio/CommandAPDUTest.java b/jdk/test/javax/smartcardio/CommandAPDUTest.java
index f34a2ea..edfb1e1 100644
--- a/jdk/test/javax/smartcardio/CommandAPDUTest.java
+++ b/jdk/test/javax/smartcardio/CommandAPDUTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,7 @@
  * @bug 8049021
  * @summary Test different constructors for CommandAPDU and check CLA,INS,NC,NE,
  * P1,and P2
- * @compile --add-modules=java.smartcardio CommandAPDUTest.java
- * @run testng/othervm --add-modules=java.smartcardio CommandAPDUTest
+ * @run testng CommandAPDUTest
  */
 import java.nio.ByteBuffer;
 import javax.smartcardio.CommandAPDU;
diff --git a/jdk/test/javax/smartcardio/HistoricalBytes.java b/jdk/test/javax/smartcardio/HistoricalBytes.java
index c44bbe0..b7324d4 100644
--- a/jdk/test/javax/smartcardio/HistoricalBytes.java
+++ b/jdk/test/javax/smartcardio/HistoricalBytes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,6 @@
  * @bug 6445367
  * @summary Verify that ATR.getHistoricalBytes() works
  * @author Andreas Sterbenz
- * @compile --add-modules=java.smartcardio HistoricalBytes.java
- * @run main/othervm --add-modules=java.smartcardio HistoricalBytes
  */
 
 import java.util.Arrays;
diff --git a/jdk/test/javax/smartcardio/ResponseAPDUTest.java b/jdk/test/javax/smartcardio/ResponseAPDUTest.java
index 470002d..bec322e 100644
--- a/jdk/test/javax/smartcardio/ResponseAPDUTest.java
+++ b/jdk/test/javax/smartcardio/ResponseAPDUTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,7 @@
  * @test
  * @bug 8049021
  * @summary Construct ResponseAPDU from byte array and check NR< SW, SW1 and SW2
- * @compile --add-modules=java.smartcardio ResponseAPDUTest.java
- * @run testng/othervm --add-modules=java.smartcardio ResponseAPDUTest
+ * @run testng ResponseAPDUTest
  */
 import javax.smartcardio.ResponseAPDU;
 import static org.testng.Assert.*;
diff --git a/jdk/test/javax/smartcardio/Serialize.java b/jdk/test/javax/smartcardio/Serialize.java
index 7becee4..611c24e 100644
--- a/jdk/test/javax/smartcardio/Serialize.java
+++ b/jdk/test/javax/smartcardio/Serialize.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,6 @@
  * @bug 6445367
  * @summary make sure serialization works
  * @author Andreas Sterbenz
- * @compile --add-modules=java.smartcardio Serialize.java
- * @run main/othervm --add-modules=java.smartcardio Serialize
  */
 
 import java.io.*;
diff --git a/jdk/test/javax/smartcardio/TEST.properties b/jdk/test/javax/smartcardio/TEST.properties
new file mode 100644
index 0000000..89d0076
--- /dev/null
+++ b/jdk/test/javax/smartcardio/TEST.properties
@@ -0,0 +1 @@
+modules = java.smartcardio
diff --git a/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java b/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java
index 853ce2d..a741440 100644
--- a/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java
+++ b/jdk/test/javax/smartcardio/TerminalFactorySpiTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,7 @@
  * @test
  * @bug 8049021
  * @summary Test if we can write new provider for smart card
- * @compile --add-modules=java.smartcardio TerminalFactorySpiTest.java
- * @run main/othervm/java.security.policy=policy --add-modules=java.smartcardio TerminalFactorySpiTest
+ * @run main/othervm/java.security.policy=policy TerminalFactorySpiTest
  */
 import java.security.Provider;
 import java.security.Security;
diff --git a/jdk/test/javax/smartcardio/TestCardPermission.java b/jdk/test/javax/smartcardio/TestCardPermission.java
index b148d2c..cbeb15d 100644
--- a/jdk/test/javax/smartcardio/TestCardPermission.java
+++ b/jdk/test/javax/smartcardio/TestCardPermission.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,6 @@
  * @bug 6293767 6469513
  * @summary Test for the CardPermission class
  * @author Andreas Sterbenz
- * @compile --add-modules=java.smartcardio TestCardPermission.java
- * @run main/othervm --add-modules=java.smartcardio TestCardPermission
  */
 
 import javax.smartcardio.*;
diff --git a/jdk/test/javax/smartcardio/TestCommandAPDU.java b/jdk/test/javax/smartcardio/TestCommandAPDU.java
index d8374e1..a9e841a 100644
--- a/jdk/test/javax/smartcardio/TestCommandAPDU.java
+++ b/jdk/test/javax/smartcardio/TestCommandAPDU.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,6 @@
  * @summary Test for the CommandAPDU class
  * @author Andreas Sterbenz
  * @key randomness
- * @compile --add-modules=java.smartcardio TestCommandAPDU.java
- * @run main/othervm --add-modules=java.smartcardio TestCommandAPDU
  */
 
 import java.util.*;
diff --git a/jdk/test/javax/sound/midi/Devices/InitializationHang.java b/jdk/test/javax/sound/midi/Devices/InitializationHang.java
index 9b94a7a..c19ed00 100644
--- a/jdk/test/javax/sound/midi/Devices/InitializationHang.java
+++ b/jdk/test/javax/sound/midi/Devices/InitializationHang.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,21 @@
 import java.awt.Toolkit;
 
 import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
 
 /**
  * @test
  * @bug 8068412
- * @key headful
- * @author Sergey Bylokhov
  */
 public final class InitializationHang {
 
-    public static void main(final String[] argv) throws Exception {
-        MidiSystem.getReceiver();
-        Toolkit.getDefaultToolkit();
+    public static void main(final String[] argv) {
+        try {
+            MidiSystem.getReceiver();
+            Toolkit.getDefaultToolkit();
+        } catch (final MidiUnavailableException ignored) {
+            // the test is not applicable
+        }
     }
 }
 
diff --git a/jdk/test/javax/sound/midi/Sequencer/SeqRecordDoesNotCopy.java b/jdk/test/javax/sound/midi/Sequencer/SeqRecordDoesNotCopy.java
index 99d8509..2c8d2a2 100644
--- a/jdk/test/javax/sound/midi/Sequencer/SeqRecordDoesNotCopy.java
+++ b/jdk/test/javax/sound/midi/Sequencer/SeqRecordDoesNotCopy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 import javax.sound.midi.MidiEvent;
 import javax.sound.midi.MidiMessage;
 import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
 import javax.sound.midi.Receiver;
 import javax.sound.midi.Sequence;
 import javax.sound.midi.Sequencer;
@@ -34,12 +35,18 @@
  * @test
  * @bug 5048381
  * @summary Sequencer doesn't create distinct messages when recording events.
- * @key headful
  */
 public class SeqRecordDoesNotCopy {
-    public static void main(String argv[]) throws Exception {
-        Sequencer s = MidiSystem.getSequencer();
-        s.open();
+
+    public static void main(String argv[]) {
+        Sequencer s = null;
+        try {
+            s = MidiSystem.getSequencer();
+            s.open();
+        } catch (final MidiUnavailableException ignored) {
+            // the test is not applicable
+            return;
+        }
         try {
             Sequence seq = new Sequence(Sequence.PPQ, 384, 2);
             s.setSequence(seq);
@@ -86,7 +93,7 @@
         } catch (Exception e) {
             System.out.println("Unexpected Exception: "+e);
             //e.printStackTrace();
-            throw new Exception("Test FAILED!");
+            throw new RuntimeException("Test FAILED!");
         } finally {
             s.close();
         }
diff --git a/jdk/test/javax/sound/midi/Sequencer/SeqRecordsRealTimeEvents.java b/jdk/test/javax/sound/midi/Sequencer/SeqRecordsRealTimeEvents.java
index 11c240e..021e962 100644
--- a/jdk/test/javax/sound/midi/Sequencer/SeqRecordsRealTimeEvents.java
+++ b/jdk/test/javax/sound/midi/Sequencer/SeqRecordsRealTimeEvents.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 import javax.sound.midi.MidiEvent;
 import javax.sound.midi.MidiMessage;
 import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
 import javax.sound.midi.Receiver;
 import javax.sound.midi.Sequence;
 import javax.sound.midi.Sequencer;
@@ -34,12 +35,18 @@
  * @test
  * @bug 5048381
  * @summary Sequencer records real time messages into the sequence
- * @key headful
  */
 public class SeqRecordsRealTimeEvents {
-    public static void main(String argv[]) throws Exception {
-        Sequencer s = MidiSystem.getSequencer();
-        s.open();
+
+    public static void main(String argv[]) {
+        Sequencer s = null;
+        try {
+            s = MidiSystem.getSequencer();
+            s.open();
+        } catch (final MidiUnavailableException ignored) {
+            // the test is not applicable
+            return;
+        }
         try {
             Sequence seq = new Sequence(Sequence.PPQ, 384, 2);
             s.setSequence(seq);
@@ -90,7 +97,7 @@
         } catch (Exception e) {
             System.out.println("Unexpected Exception: "+e);
             //e.printStackTrace();
-            throw new Exception("Test FAILED!");
+            throw new RuntimeException("Test FAILED!");
         } finally {
             s.close();
         }
diff --git a/jdk/test/javax/sound/midi/Sequencer/SeqStartRecording.java b/jdk/test/javax/sound/midi/Sequencer/SeqStartRecording.java
index 423c7a2..876565f 100644
--- a/jdk/test/javax/sound/midi/Sequencer/SeqStartRecording.java
+++ b/jdk/test/javax/sound/midi/Sequencer/SeqStartRecording.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,25 +22,32 @@
  */
 
 import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
 import javax.sound.midi.Sequencer;
 
 /**
  * @test
  * @bug 5001943
  * @summary Sequencer.startRecording throws unexpected NPE
- * @key headful
  */
 public class SeqStartRecording {
-    public static void main(String argv[]) throws Exception {
-        Sequencer seq = MidiSystem.getSequencer();
-        seq.open();
+
+    public static void main(String argv[]) {
+        Sequencer seq = null;
+        try {
+            seq = MidiSystem.getSequencer();
+            seq.open();
+        } catch (final MidiUnavailableException ignored) {
+            // the test is not applicable
+            return;
+        }
         try {
             seq.startRecording();
             System.out.println("Test passed.");
         } catch (NullPointerException npe) {
             System.out.println("Caught NPE: "+npe);
             npe.printStackTrace();
-            throw new Exception("Test FAILED!");
+            throw new RuntimeException("Test FAILED!");
         } catch (Exception e) {
             System.out.println("Unexpected Exception: "+e);
             e.printStackTrace();
diff --git a/jdk/test/javax/sound/midi/Synthesizer/bug4685396.java b/jdk/test/javax/sound/midi/Synthesizer/bug4685396.java
index 43f1470..f67f7c4 100644
--- a/jdk/test/javax/sound/midi/Synthesizer/bug4685396.java
+++ b/jdk/test/javax/sound/midi/Synthesizer/bug4685396.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
 
 import javax.sound.midi.Instrument;
 import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
 import javax.sound.midi.Soundbank;
 import javax.sound.midi.Synthesizer;
 
@@ -31,7 +32,6 @@
  * @bug 4685396
  * @summary Tests that Synthesizer.remapInstrument works
  * @run main bug4685396
- * @key headful
  */
 public class bug4685396 {
 
@@ -49,8 +49,7 @@
             boolean reloadInstr,    // reload all instruments?
             boolean unloadFrom,     // unload "from" instrument?
             boolean unloadTo        // unload "to" instrument?
-            ) throws Exception
-    {
+            ) throws MidiUnavailableException {
         log("Starting test: reloadInstr=" + reloadInstr
                 + ", unloadFrom=" + unloadFrom
                 + ", unloadTo=" + unloadTo
@@ -164,6 +163,9 @@
         boolean success = false;
         try {
             success = test(reloadInstr, unloadFrom, unloadTo);
+        } catch (final MidiUnavailableException ignored) {
+            // the test is not applicable
+            success = true;
         } catch (Exception ex) {
             log("Exception: " + ex.toString());
         }
@@ -171,7 +173,7 @@
         return success;
     }
 
-    public static void main(String args[]) throws Exception {
+    public static void main(String args[]) {
         boolean failed = false;
         if (!runTest(true, false, false))
             failed = true;
diff --git a/jdk/test/javax/sound/sampled/Clip/ClipCloseLoss.java b/jdk/test/javax/sound/sampled/Clip/ClipCloseLoss.java
index b7f4fa4..24226dd 100644
--- a/jdk/test/javax/sound/sampled/Clip/ClipCloseLoss.java
+++ b/jdk/test/javax/sound/sampled/Clip/ClipCloseLoss.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@
  * @bug 4946913
  * @summary DirectClip doesn't kill the thread correctly, sometimes
  * @run main/othervm ClipCloseLoss
- * @key headful
  */
 public class ClipCloseLoss {
     static int frameCount = 441000; // lets say 10 seconds
diff --git a/jdk/test/javax/sound/sampled/Clip/bug5070081.java b/jdk/test/javax/sound/sampled/Clip/bug5070081.java
index 8c9206b..e7bf7e3 100644
--- a/jdk/test/javax/sound/sampled/Clip/bug5070081.java
+++ b/jdk/test/javax/sound/sampled/Clip/bug5070081.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,17 +21,19 @@
  * questions.
  */
 
+import java.util.concurrent.TimeUnit;
+
 import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioSystem;
 import javax.sound.sampled.Clip;
 import javax.sound.sampled.DataLine;
+import javax.sound.sampled.LineUnavailableException;
 
 /*
  * @test
  * @bug 5070081
  * @summary Tests that javax.sound.sampled.Clip does not loses position through
  *          stop/start
- * @key headful
  */
 public class bug5070081 {
 
@@ -43,10 +45,15 @@
 
     static boolean test() throws Exception {
         DataLine.Info info = new DataLine.Info(Clip.class, format);
-        Clip clip = (Clip)AudioSystem.getLine(info);
-        clip.open(format, soundData, 0, soundData.length);
-
+        Clip clip = null;
         boolean bSuccess = true;
+        try {
+            clip = (Clip) AudioSystem.getLine(info);
+            clip.open(format, soundData, 0, soundData.length);
+        } catch (LineUnavailableException | IllegalArgumentException ignored) {
+            // the test is not applicable
+            return bSuccess;
+        }
 
         long nLengthMS = clip.getMicrosecondLength()/1000;
 
@@ -56,18 +63,22 @@
 
         clip.start();                               // start playing
         Thread.sleep(1000);                         // wait a sec
-        long time1 = System.currentTimeMillis();
+        long time1 = currentTimeMillis();
         long pos1 = clip.getFramePosition();        // store the position
-        System.out.println("  Position before stop: " + pos1);
         clip.stop();                                // and then stop
         long pos2 = clip.getFramePosition();        // 2nd try
-        long time2 = System.currentTimeMillis();
+        long time2 = currentTimeMillis();
+
+        System.out.println("  Position before stop: " + pos1);
         System.out.println("  Position after stop: " + pos2);
 
-        System.out.println("  d(time): " + Math.abs(time2-time1) + " ms;"
-                + "d(clip pos): " + Math.abs(pos2 - pos1) + " ms.");
+        long timeDiff = Math.abs(time2 - time1);
+        // sample rate is 22050 per second, so 22.05 per ms
+        long posDiff = (long) (Math.abs(pos2 - pos1) / 22.05);
+        System.out.println("  d(time): " + timeDiff + " ms;"
+                + "d(clip pos time): " + posDiff + " ms.");
 
-        long nDerivation = Math.abs(pos2 - pos1) - Math.abs(time2-time1);
+        long nDerivation = posDiff - timeDiff;
         // add 50 ms for deviation (delay for stopping and errors due timer precision)
         if (nDerivation > 50) {
             System.out.println("  ERROR(1): The deviation is too much: " + nDerivation + " ms");
@@ -104,4 +115,8 @@
 
         System.out.println("Test passed sucessfully");
     }
+
+    private static long currentTimeMillis() {
+        return TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
+    }
 }
diff --git a/jdk/test/javax/sound/sampled/DataLine/LongFramePosition.java b/jdk/test/javax/sound/sampled/DataLine/LongFramePosition.java
index e952fa8..079a785 100644
--- a/jdk/test/javax/sound/sampled/DataLine/LongFramePosition.java
+++ b/jdk/test/javax/sound/sampled/DataLine/LongFramePosition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
  * @test
  * @bug 5049129
  * @summary DataLine.getLongFramePosition
- * @key headful
  */
 public class LongFramePosition {
 
@@ -59,12 +58,12 @@
             } finally {
                 sdl.close();
             }
-        } catch(LineUnavailableException e){
+        } catch (LineUnavailableException | IllegalArgumentException e) {
             System.out.println(e);
             System.out.println("Cannot execute test.");
             return;
         }
-        if (failed) throw new Exception("Test FAILED!");
+        if (failed) throw new RuntimeException("Test FAILED!");
         System.out.println("Test Passed.");
     }
 }
diff --git a/jdk/test/javax/sound/sampled/DirectAudio/bug6372428.java b/jdk/test/javax/sound/sampled/DirectAudio/bug6372428.java
index d5baa4a..177ebce 100644
--- a/jdk/test/javax/sound/sampled/DirectAudio/bug6372428.java
+++ b/jdk/test/javax/sound/sampled/DirectAudio/bug6372428.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@
  * @summary playback and capture doesn't interrupt after terminating thread that
  *          calls start()
  * @run main bug6372428
- * @key headful
  */
 public class bug6372428 {
     public bug6372428() {
diff --git a/jdk/test/javax/sql/rowset/TEST.properties b/jdk/test/javax/sql/rowset/TEST.properties
new file mode 100644
index 0000000..6c5a2c7
--- /dev/null
+++ b/jdk/test/javax/sql/rowset/TEST.properties
@@ -0,0 +1 @@
+modules = java.sql.rowset
diff --git a/jdk/test/javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java b/jdk/test/javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java
new file mode 100644
index 0000000..bff9137
--- /dev/null
+++ b/jdk/test/javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+/**
+ * @test
+ * @bug 8175301
+ * @summary Java GUI hangs on Windows when Display set to 125%
+ * @run main/othervm -Dsun.java2d.uiScale=2 ScaledFrameBackgroundTest
+ * @run main/othervm -Dsun.java2d.uiScale=2 -Dsun.java2d.d3d=true ScaledFrameBackgroundTest
+ * @run main/othervm -Dsun.java2d.uiScale=2 -Dsun.java2d.opengl=true ScaledFrameBackgroundTest
+ */
+public class ScaledFrameBackgroundTest {
+
+    private static final Color BACKGROUND = Color.RED;
+    private static JFrame frame;
+
+    public static void main(String[] args) throws Exception {
+
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        SwingUtilities.invokeAndWait(() -> {
+            frame = new JFrame();
+            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+            frame.setSize(400, 300);
+            JPanel panel = new JPanel();
+            panel.setBackground(BACKGROUND);
+            frame.getContentPane().add(panel);
+            frame.setVisible(true);
+        });
+
+        robot.waitForIdle();
+        Thread.sleep(200);
+
+        Rectangle[] rects = new Rectangle[1];
+        SwingUtilities.invokeAndWait(() -> {
+            rects[0] = frame.getBounds();
+        });
+
+        Rectangle bounds = rects[0];
+
+        int x = bounds.x + bounds.width / 4;
+        int y = bounds.y + bounds.height / 4;
+
+        Color color = robot.getPixelColor(x, y);
+
+        if (!BACKGROUND.equals(color)) {
+            throw new RuntimeException("Wrong backgound color!");
+        }
+
+        x = bounds.x + 3 * bounds.width / 4;
+        y = bounds.y + 3 * bounds.height / 4;
+
+        color = robot.getPixelColor(x, y);
+
+        if (!BACKGROUND.equals(color)) {
+            throw new RuntimeException("Wrong backgound color!");
+        }
+    }
+}
diff --git a/jdk/test/javax/swing/JPopupMenu/4458079/bug4458079.java b/jdk/test/javax/swing/JPopupMenu/4458079/bug4458079.java
index d4f21b5..c68841a 100644
--- a/jdk/test/javax/swing/JPopupMenu/4458079/bug4458079.java
+++ b/jdk/test/javax/swing/JPopupMenu/4458079/bug4458079.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,25 +33,26 @@
  */
 
 import java.awt.Robot;
-import java.awt.Toolkit;
 import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.event.*;
 import java.awt.event.KeyEvent;
-import java.util.ArrayList;
 
 public class bug4458079 extends JFrame implements PopupMenuListener {
     public JMenu menu;
 
     static volatile boolean itemASelected = false;
     public static void main(String[] args) throws Exception {
+        Robot robot = new Robot();
+        robot.waitForIdle();
+        // move mouse outside menu to prevent auto selection
+        robot.mouseMove(100,100);
+
         SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 new bug4458079().createAndShowGUI();
             }
         });
-        Robot robot = new Robot();
-        robot.waitForIdle();
 
         robot.setAutoDelay(50);
 
@@ -84,6 +85,7 @@
         setSize(300, 300);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         pack();
+        setLocationRelativeTo(null);
         setVisible(true);
     }
 
diff --git a/jdk/test/javax/swing/JPopupMenu/6827786/bug6827786.java b/jdk/test/javax/swing/JPopupMenu/6827786/bug6827786.java
index c377a7b..db268fd 100644
--- a/jdk/test/javax/swing/JPopupMenu/6827786/bug6827786.java
+++ b/jdk/test/javax/swing/JPopupMenu/6827786/bug6827786.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,6 +47,8 @@
     public static void main(String[] args) throws Exception {
         Robot robot = new Robot();
         robot.setAutoDelay(50);
+        // move mouse outside menu to prevent auto selection
+        robot.mouseMove(100,100);
 
         SwingUtilities.invokeAndWait(new Runnable() {
 
@@ -147,6 +149,7 @@
         focusable = new JButton("Set Focus Here");
         frame.add(focusable);
         frame.pack();
+        frame.setLocationRelativeTo(null);
         frame.setVisible(true);
     }
 }
diff --git a/jdk/test/javax/swing/SwingContainer/SwingContainerIsForContainerOnly/SwingContainerIsForContainerOnly.java b/jdk/test/javax/swing/SwingContainer/SwingContainerIsForContainerOnly/SwingContainerIsForContainerOnly.java
new file mode 100644
index 0000000..42bbf3c
--- /dev/null
+++ b/jdk/test/javax/swing/SwingContainer/SwingContainerIsForContainerOnly/SwingContainerIsForContainerOnly.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Container;
+import java.io.IOException;
+import java.net.URI;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+
+import javax.swing.SwingContainer;
+
+/**
+ * @test
+ * @bug 8176177
+ */
+public final class SwingContainerIsForContainerOnly {
+
+    public static void main(String[] args) throws IOException {
+        FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
+        fs.getFileStores();
+        Files.walkFileTree(fs.getPath("/modules/java.desktop"), new SimpleFileVisitor<>() {
+            @Override
+            public FileVisitResult visitFile(Path file,
+                                             BasicFileAttributes attrs) {
+                file = file.subpath(2, file.getNameCount());
+                String name = file.toString();
+                if (name.endsWith(".class")) {
+                    name = name.substring(0, name.indexOf(".")).replace('/', '.');
+
+                    final Class<?> type;
+                    try {
+                        type = Class.forName(name, false, null);
+                    } catch (Throwable e) {
+                        return FileVisitResult.CONTINUE;
+                    }
+                    if (type.isAnnotationPresent(SwingContainer.class)) {
+                        if (!Container.class.isAssignableFrom(type)) {
+                            System.err.println("Wrong annotation for: " + type);
+                            throw new RuntimeException();
+                        }
+                    }
+                }
+                return FileVisitResult.CONTINUE;
+            };
+        });
+    }
+}
diff --git a/jdk/test/javax/swing/plaf/basic/BasicComboPopup/7072653/bug7072653.java b/jdk/test/javax/swing/plaf/basic/BasicComboPopup/7072653/bug7072653.java
index fbaabf0..7835c3c 100644
--- a/jdk/test/javax/swing/plaf/basic/BasicComboPopup/7072653/bug7072653.java
+++ b/jdk/test/javax/swing/plaf/basic/BasicComboPopup/7072653/bug7072653.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,77 +24,78 @@
 /*
  * @test
  * @key headful
- * @bug 7072653 8144161
+ * @bug 7072653 8144161 8176448
  * @summary JComboBox popup mispositioned if its height exceeds the screen height
  * @run main bug7072653
  */
+
 import java.awt.FlowLayout;
 import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
 import java.awt.Insets;
+import java.awt.Rectangle;
 import java.awt.Robot;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
 import java.awt.Toolkit;
 import java.awt.Window;
-import java.util.Arrays;
+
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.JComboBox;
 import javax.swing.JFrame;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
 
 public class bug7072653 {
 
     private static JComboBox combobox;
     private static JFrame frame;
     private static Robot robot;
-    private static volatile String errorString = "";
 
     public static void main(String[] args) throws Exception {
         robot = new Robot();
-        robot.delay(100);
-        UIManager.LookAndFeelInfo[] lookAndFeelArray
-                = UIManager.getInstalledLookAndFeels();
-        for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
-            executeCase(lookAndFeelItem.getClassName());
-            robot.delay(1000);
-        }
-        if (!"".equals(errorString)) {
-
-            throw new RuntimeException("Error Log:\n" + errorString);
+        GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        UIManager.LookAndFeelInfo[] lookAndFeelArray =
+                UIManager.getInstalledLookAndFeels();
+        for (GraphicsDevice sd : ge.getScreenDevices()) {
+            for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
+                executeCase(lookAndFeelItem.getClassName(), sd);
+                robot.waitForIdle();
+            }
         }
     }
 
-    private static void executeCase(String lookAndFeelString) throws Exception {
+    private static void executeCase(String lookAndFeelString, GraphicsDevice sd)
+            throws Exception {
         if (tryLookAndFeel(lookAndFeelString)) {
-            SwingUtilities.invokeAndWait(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        setup(lookAndFeelString);
-                        test();
-                    } catch (Exception ex) {
-                        errorString += "\n";
-                        errorString += Arrays.toString(ex.getStackTrace());
-                    }
-                    finally {
-                        frame.dispose();
-                    }
+            SwingUtilities.invokeAndWait(() -> {
+                try {
+                    setup(lookAndFeelString, sd);
+                    test();
+                } catch (Exception ex) {
+                    throw new RuntimeException(ex);
+                } finally {
+                    frame.dispose();
                 }
             });
         }
-
     }
 
-    private static void setup(String lookAndFeelString)
+    private static void setup(String lookAndFeelString, GraphicsDevice sd)
             throws Exception {
-
-        frame = new JFrame("JComboBox Test " + lookAndFeelString);
+        GraphicsConfiguration gc = sd.getDefaultConfiguration();
+        Rectangle gcBounds = gc.getBounds();
+        frame = new JFrame("JComboBox Test " + lookAndFeelString, gc);
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        frame.setSize(320, 200);
+        frame.setSize(400, 200);
         frame.getContentPane().setLayout(new FlowLayout());
-        frame.setLocationRelativeTo(null);
+        frame.setLocation(
+                gcBounds.x + gcBounds.width / 2 - frame.getWidth() / 2,
+                gcBounds.y + gcBounds.height / 2 - frame.getHeight() / 2);
+
         combobox = new JComboBox(new DefaultComboBoxModel() {
             @Override
             public Object getElementAt(int index) {
@@ -108,6 +109,7 @@
         });
 
         combobox.setMaximumRowCount(100);
+        combobox.putClientProperty("JComboBox.isPopDown", true);
         frame.getContentPane().add(combobox);
         frame.setVisible(true);
         combobox.addPopupMenuListener(new PopupMenuListener() {
@@ -120,30 +122,24 @@
                 int height = 0;
                 for (Window window : JFrame.getWindows()) {
                     if (Window.Type.POPUP == window.getType()) {
-                        height = window.getSize().height;
-                        break;
+                        if (window.getOwner().isVisible()) {
+                            height = window.getSize().height;
+                            break;
+                        }
                     }
                 }
-                GraphicsConfiguration gc
-                        = combobox.getGraphicsConfiguration();
-                Insets screenInsets = Toolkit.getDefaultToolkit()
-                        .getScreenInsets(gc);
+                GraphicsConfiguration gc = combobox.getGraphicsConfiguration();
+                Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
                 int gcHeight = gc.getBounds().height;
-                if (lookAndFeelString.contains("aqua")) {
-                    gcHeight = gcHeight - screenInsets.top;
-                    //For Aqua LAF
-                } else {
-                    gcHeight = gcHeight - screenInsets.top
-                            - screenInsets.bottom;
-                }
+                gcHeight = gcHeight - insets.top - insets.bottom;
                 if (height == gcHeight) {
                     return;
                 }
 
                 String exception = "Popup window height "
                         + "For LookAndFeel" + lookAndFeelString + " is wrong"
-                        + "\nShould be " + height + "Actually " + gcHeight;
-                errorString += exception;
+                        + "\nShould be " + gcHeight + ", Actually " + height;
+                throw new RuntimeException(exception);
             }
 
             @Override
diff --git a/jdk/test/javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java b/jdk/test/javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java
new file mode 100644
index 0000000..20db73f
--- /dev/null
+++ b/jdk/test/javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.EventQueue;
+import java.awt.FlowLayout;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.UIManager;
+
+/**
+ * @test
+ * @bug 8176448
+ * @run main/timeout=600 JComboBoxPopupLocation
+ */
+public final class JComboBoxPopupLocation {
+
+    private static final int SIZE = 300;
+    public static final String PROPERTY_NAME = "JComboBox.isPopDown";
+    private static volatile Robot robot;
+    private static volatile JComboBox<String> comboBox;
+    private static volatile JFrame frame;
+
+    public static void main(final String[] args) throws Exception {
+        robot = new Robot();
+        robot.setAutoDelay(100);
+        robot.setAutoWaitForIdle(true);
+        GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsDevice[] sds = ge.getScreenDevices();
+        UIManager.LookAndFeelInfo[] lookAndFeelArray =
+                UIManager.getInstalledLookAndFeels();
+        for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
+            System.setProperty(PROPERTY_NAME, "true");
+            step(sds, lookAndFeelItem);
+            if (lookAndFeelItem.getClassName().contains("Aqua")) {
+                System.setProperty(PROPERTY_NAME, "false");
+                step(sds, lookAndFeelItem);
+            }
+        }
+    }
+
+    private static void step(GraphicsDevice[] sds,
+                             UIManager.LookAndFeelInfo lookAndFeelItem)
+            throws Exception {
+        UIManager.setLookAndFeel(lookAndFeelItem.getClassName());
+        Point left = null;
+        for (final GraphicsDevice sd : sds) {
+            GraphicsConfiguration gc = sd.getDefaultConfiguration();
+            Rectangle bounds = gc.getBounds();
+            if (left == null || left.x > bounds.x) {
+                left = new Point(bounds.x, bounds.y + bounds.height / 2);
+            }
+            Point point = new Point(bounds.x, bounds.y);
+            Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
+            while (point.y < bounds.y + bounds.height - insets.bottom - SIZE ) {
+                while (point.x < bounds.x + bounds.width - insets.right - SIZE) {
+                    try {
+                        EventQueue.invokeAndWait(() -> {
+                            setup(point);
+                        });
+                        robot.waitForIdle();
+                        test(comboBox);
+                        robot.waitForIdle();
+                        validate(comboBox);
+                        robot.waitForIdle();
+                        point.translate(bounds.width / 5, 0);
+                    } finally {
+                        dispose();
+                    }
+                }
+                point.setLocation(bounds.x, point.y + bounds.height / 5);
+            }
+        }
+        if (left != null) {
+            final Point finalLeft = left;
+            finalLeft.translate(-50, 0);
+            try {
+                EventQueue.invokeAndWait(() -> {
+                    setup(finalLeft);
+                });
+                robot.waitForIdle();
+                test(comboBox);
+                robot.waitForIdle();
+                validate(comboBox);
+            } finally {
+                dispose();
+            }
+        }
+    }
+
+    private static void dispose() throws Exception {
+        EventQueue.invokeAndWait(() -> {
+            if (frame != null) {
+                frame.dispose();
+            }
+        });
+    }
+
+    private static void setup(final Point tmp) {
+        comboBox = new JComboBox<>();
+        for (int i = 1; i < 7; i++) {
+            comboBox.addItem("Long-long-long-long-long text in the item-" + i);
+        }
+        String property = System.getProperty(PROPERTY_NAME);
+        comboBox.putClientProperty(PROPERTY_NAME, Boolean.valueOf(property));
+        frame = new JFrame();
+        frame.setAlwaysOnTop(true);
+        frame.setLayout(new FlowLayout());
+        frame.add(comboBox);
+        frame.pack();
+        frame.setSize(frame.getWidth(), SIZE);
+        frame.setVisible(true);
+        frame.setLocation(tmp.x, tmp.y);
+    }
+
+    private static void test(final JComboBox comboBox) throws Exception {
+        Point pt = comboBox.getLocationOnScreen();
+        robot.mouseMove(pt.x + comboBox.getWidth() / 2,
+                        pt.y + comboBox.getHeight() / 2);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        int x = pt.x + comboBox.getWidth() / 2;
+        int y = pt.y + comboBox.getHeight() / 2 + 70;
+        robot.mouseMove(x, y);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+    }
+
+    private static void validate(final JComboBox comboBox) throws Exception {
+        EventQueue.invokeAndWait(() -> {
+            if (comboBox.getSelectedIndex() == 0) {
+                throw new RuntimeException();
+            }
+        });
+    }
+}
diff --git a/jdk/test/javax/swing/plaf/basic/BasicScrollPaneUI/8166591/TooMuchWheelRotationEventsTest.java b/jdk/test/javax/swing/plaf/basic/BasicScrollPaneUI/8166591/TooMuchWheelRotationEventsTest.java
index 4504475..640cc05 100644
--- a/jdk/test/javax/swing/plaf/basic/BasicScrollPaneUI/8166591/TooMuchWheelRotationEventsTest.java
+++ b/jdk/test/javax/swing/plaf/basic/BasicScrollPaneUI/8166591/TooMuchWheelRotationEventsTest.java
@@ -40,7 +40,7 @@
 
 /*
  * @test
- * @bug 8166591
+ * @bug 8166591 8173876
  * @key headful
  * @summary [macos 10.12] Trackpad scrolling of text on OS X 10.12 Sierra
  *    is very fast (Trackpad, Retina only)
diff --git a/jdk/test/javax/swing/plaf/metal/MetalBumps/Test6657026.java b/jdk/test/javax/swing/plaf/metal/MetalBumps/Test6657026.java
index d333ed3..b573747 100644
--- a/jdk/test/javax/swing/plaf/metal/MetalBumps/Test6657026.java
+++ b/jdk/test/javax/swing/plaf/metal/MetalBumps/Test6657026.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,8 +29,6 @@
  * @modules java.desktop/sun.awt
  */
 
-import sun.awt.SunToolkit;
-
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.Font;
@@ -42,9 +40,12 @@
 import java.awt.image.BufferedImage;
 import java.awt.image.ImageObserver;
 import java.text.AttributedCharacterIterator;
-import javax.swing.Icon;
+
+import javax.swing.JToolBar;
 import javax.swing.plaf.metal.MetalBorders.ToolBarBorder;
 
+import sun.awt.SunToolkit;
+
 public class Test6657026 extends ToolBarBorder implements Runnable {
 
     public static void main(String[] args) throws Exception {
@@ -63,8 +64,8 @@
 
     private void test() {
         MyGraphics mg = new MyGraphics();
-        Icon icon = bumps;
-        icon.paintIcon(mg.component, mg, 0, 0);
+        ToolBarBorder border = new ToolBarBorder();
+        border.paintBorder(mg.component, mg, 0, 0, 10, 10);
         if (mg.image != null) {
             boolean failed = true;
             int value = mg.image.getRGB(0, 0);
@@ -86,7 +87,7 @@
 
     private static class MyGraphics extends Graphics {
 
-        private final Component component = new Component() {};
+        private final Component component = new JToolBar() {};
         private BufferedImage image;
 
         public Graphics create() {
diff --git a/jdk/test/javax/swing/plaf/metal/MetalIcons/MetalHiDPIIconsTest.java b/jdk/test/javax/swing/plaf/metal/MetalIcons/MetalHiDPIIconsTest.java
index 6c6a459..6474291 100644
--- a/jdk/test/javax/swing/plaf/metal/MetalIcons/MetalHiDPIIconsTest.java
+++ b/jdk/test/javax/swing/plaf/metal/MetalIcons/MetalHiDPIIconsTest.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8160986
+ * @bug 8160986 8174845 8176883
  * @summary Bad rendering of Swing UI controls with Metal L&F on HiDPI display
  * @run main/manual MetalHiDPIIconsTest
  */
@@ -56,6 +56,8 @@
             + "  - JCheckBox\n"
             + "  - JComboBox\n"
             + "  - JScrollPane (vertical and horizontal scroll bars)\n"
+            + "  - JRadioButtonMenuItem\n"
+            + "  - JCheckBoxMenuItem\n"
             + "and others...\n\n"
             + "If so, press PASS, else press FAIL.\n";
 
diff --git a/jdk/test/javax/swing/plaf/windows/WindowsRootPaneUI/WrongAltProcessing/WrongAltProcessing.java b/jdk/test/javax/swing/plaf/windows/WindowsRootPaneUI/WrongAltProcessing/WrongAltProcessing.java
index a13a1be..18f4498 100644
--- a/jdk/test/javax/swing/plaf/windows/WindowsRootPaneUI/WrongAltProcessing/WrongAltProcessing.java
+++ b/jdk/test/javax/swing/plaf/windows/WindowsRootPaneUI/WrongAltProcessing/WrongAltProcessing.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 
 /* @test
-   @bug 8001633 8028271
+   @bug 8001633 8028271 8039888
    @summary Wrong alt processing during switching between windows
    @author mikhail.cherkasov@oracle.com
    @run main WrongAltProcessing
@@ -54,8 +54,8 @@
                 createWindows();
             }
         });
-        robot.waitForIdle();
         initRobot();
+        robot.waitForIdle();
         runScript();
         SwingUtilities.invokeLater(new Runnable() {
             @Override
diff --git a/jdk/test/javax/swing/text/TableView/I18nLayoutTest.java b/jdk/test/javax/swing/text/TableView/I18nLayoutTest.java
deleted file mode 100644
index 61bf8a0..0000000
--- a/jdk/test/javax/swing/text/TableView/I18nLayoutTest.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @key headful
- * @bug 8133864
- * @summary  Wrong display, when the document I18n properties is true.
- * @author Semyon Sadetsky
- * @run main I18nLayoutTest
- */
-
-import javax.swing.*;
-import javax.swing.text.*;
-import java.awt.*;
-import java.util.ArrayList;
-
-public class I18nLayoutTest extends JFrame {
-
-    private static int height;
-    JEditorPane edit = new JEditorPane();
-    private static I18nLayoutTest frame;
-
-    public I18nLayoutTest() {
-        super("Code example for a TableView bug");
-        setUndecorated(true);
-        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        edit.setEditorKit(new CodeBugEditorKit());
-        initCodeBug();
-        this.getContentPane().add(new JScrollPane(edit));
-        this.pack();
-        this.setLocationRelativeTo(null);
-
-    }
-
-    private void initCodeBug() {
-        CodeBugDocument doc = (CodeBugDocument) edit.getDocument();
-        try {
-            doc.insertString(0, "TextB TextE", null);
-        } catch (BadLocationException ex) {
-        }
-        doc.insertTable(6, 4, 3);
-        try {
-            doc.insertString(7, "Cell11", null);
-            doc.insertString(14, "Cell12", null);
-            doc.insertString(21, "Cell13", null);
-            doc.insertString(28, "Cell21", null);
-            doc.insertString(35, "Cell22", null);
-            doc.insertString(42, "Cell23", null);
-            doc.insertString(49, "Cell31", null);
-            doc.insertString(56, "Cell32", null);
-            doc.insertString(63, "Cell33", null);
-            doc.insertString(70, "Cell41", null);
-            doc.insertString(77, "Cell42", null);
-            doc.insertString(84, "Cell43", null);
-        } catch (BadLocationException ex) {
-        }
-    }
-
-    public static void main(String[] args) throws Exception {
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                frame = new I18nLayoutTest();
-                frame.setVisible(true);
-            }
-        });
-        Robot robot = new Robot();
-        robot.delay(200);
-        robot.waitForIdle();
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                height = frame.getHeight();
-            }
-        });
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                frame.dispose();
-            }
-        });
-        if (height < 32) {
-            throw new RuntimeException(
-                    "TableView layout height is wrong " + height);
-        }
-        System.out.println("ok");
-    }
-}
-
-//------------------------------------------------------------------------------
-class CodeBugEditorKit extends StyledEditorKit {
-
-    ViewFactory defaultFactory = new TableFactory();
-
-    @Override
-    public ViewFactory getViewFactory() {
-        return defaultFactory;
-    }
-
-    @Override
-    public Document createDefaultDocument() {
-        return new CodeBugDocument();
-    }
-}
-//------------------------------------------------------------------------------
-
-class TableFactory implements ViewFactory {
-
-    @Override
-    public View create(Element elem) {
-        String kind = elem.getName();
-        if (kind != null) {
-            if (kind.equals(AbstractDocument.ContentElementName)) {
-                return new LabelView(elem);
-            } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
-                return new ParagraphView(elem);
-            } else if (kind.equals(AbstractDocument.SectionElementName)) {
-                return new BoxView(elem, View.Y_AXIS);
-            } else if (kind.equals(StyleConstants.ComponentElementName)) {
-                return new ComponentView(elem);
-            } else if (kind.equals(CodeBugDocument.ELEMENT_TABLE)) {
-                return new tableView(elem);
-            } else if (kind.equals(StyleConstants.IconElementName)) {
-                return new IconView(elem);
-            }
-        }
-        // default to text display
-        return new LabelView(elem);
-
-    }
-}
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-class tableView extends TableView implements ViewFactory {
-
-    public tableView(Element elem) {
-        super(elem);
-    }
-
-    @Override
-    public void setParent(View parent) {
-        super.setParent(parent);
-    }
-
-    @Override
-    public void setSize(float width, float height) {
-        super.setSize(width, height);
-    }
-
-    @Override
-    public ViewFactory getViewFactory() {
-        return this;
-    }
-
-    @Override
-    public float getMinimumSpan(int axis) {
-        return getPreferredSpan(axis);
-    }
-
-    @Override
-    public float getMaximumSpan(int axis) {
-        return getPreferredSpan(axis);
-    }
-
-    @Override
-    public float getAlignment(int axis) {
-        return 0.5f;
-    }
-
-    @Override
-    public float getPreferredSpan(int axis) {
-        if (axis == 0) return super.getPreferredSpan(0);
-        float preferredSpan = super.getPreferredSpan(axis);
-        return preferredSpan;
-    }
-
-    @Override
-    public void paint(Graphics g, Shape allocation) {
-        super.paint(g, allocation);
-        Rectangle alloc = allocation.getBounds();
-        int lastY = alloc.y + alloc.height - 1;
-        g.drawLine(alloc.x, lastY, alloc.x + alloc.width, lastY);
-    }
-
-    @Override
-    protected void paintChild(Graphics g, Rectangle alloc, int index) {
-        super.paintChild(g, alloc, index);
-        int lastX = alloc.x + alloc.width;
-        g.drawLine(alloc.x, alloc.y, lastX, alloc.y);
-    }
-
-    @Override
-    public View create(Element elem) {
-        String kind = elem.getName();
-        if (kind != null) {
-            if (kind.equals(CodeBugDocument.ELEMENT_TR)) {
-                return new trView(elem);
-            } else if (kind.equals(CodeBugDocument.ELEMENT_TD)) {
-                return new BoxView(elem, View.Y_AXIS);
-
-            }
-        }
-
-        // default is to delegate to the normal factory
-        View p = getParent();
-        if (p != null) {
-            ViewFactory f = p.getViewFactory();
-            if (f != null) {
-                return f.create(elem);
-            }
-        }
-
-        return null;
-    }
-
-    public class trView extends TableRow {
-        @Override
-        public void setParent(View parent) {
-            super.setParent(parent);
-        }
-
-        public trView(Element elem) {
-            super(elem);
-        }
-
-        public float getMinimumSpan(int axis) {
-            return getPreferredSpan(axis);
-        }
-
-        public float getMaximumSpan(int axis) {
-            return getPreferredSpan(axis);
-        }
-
-        public float getAlignment(int axis) {
-            return 0f;
-        }
-
-        @Override
-        protected void paintChild(Graphics g, Rectangle alloc, int index) {
-            super.paintChild(g, alloc, index);
-            int lastY = alloc.y + alloc.height - 1;
-            g.drawLine(alloc.x, alloc.y, alloc.x, lastY);
-            int lastX = alloc.x + alloc.width;
-            g.drawLine(lastX, alloc.y, lastX, lastY);
-        }
-    }
-
-    ;
-}
-
-//------------------------------------------------------------------------------
-class CodeBugDocument extends DefaultStyledDocument {
-
-    public static final String ELEMENT_TABLE = "table";
-    public static final String ELEMENT_TR = "table cells row";
-    public static final String ELEMENT_TD = "table data cell";
-
-    public CodeBugDocument() {
-        putProperty("i18n", Boolean.TRUE);
-    }
-
-
-    protected void insertTable(int offset, int rowCount, int colCount) {
-        try {
-            ArrayList Specs = new ArrayList();
-            ElementSpec gapTag = new ElementSpec(new SimpleAttributeSet(),
-                    ElementSpec.ContentType, "\n".toCharArray(), 0, 1);
-            Specs.add(gapTag);
-
-            SimpleAttributeSet tableAttrs = new SimpleAttributeSet();
-            tableAttrs.addAttribute(ElementNameAttribute, ELEMENT_TABLE);
-            ElementSpec tableStart =
-                    new ElementSpec(tableAttrs, ElementSpec.StartTagType);
-            Specs.add(tableStart); //start table tag
-
-
-            fillRowSpecs(Specs, rowCount, colCount);
-
-            ElementSpec[] spec = new ElementSpec[Specs.size()];
-            Specs.toArray(spec);
-
-            this.insert(offset, spec);
-        } catch (BadLocationException ex) {
-        }
-    }
-
-    protected void fillRowSpecs(ArrayList Specs, int rowCount, int colCount) {
-        SimpleAttributeSet rowAttrs = new SimpleAttributeSet();
-        rowAttrs.addAttribute(ElementNameAttribute, ELEMENT_TR);
-        for (int i = 0; i < rowCount; i++) {
-            ElementSpec rowStart =
-                    new ElementSpec(rowAttrs, ElementSpec.StartTagType);
-            Specs.add(rowStart);
-
-            fillCellSpecs(Specs, colCount);
-
-            ElementSpec rowEnd =
-                    new ElementSpec(rowAttrs, ElementSpec.EndTagType);
-            Specs.add(rowEnd);
-        }
-
-    }
-
-    protected void fillCellSpecs(ArrayList Specs, int colCount) {
-        for (int i = 0; i < colCount; i++) {
-            SimpleAttributeSet cellAttrs = new SimpleAttributeSet();
-            cellAttrs.addAttribute(ElementNameAttribute, ELEMENT_TD);
-
-            ElementSpec cellStart =
-                    new ElementSpec(cellAttrs, ElementSpec.StartTagType);
-            Specs.add(cellStart);
-
-            ElementSpec parStart = new ElementSpec(new SimpleAttributeSet(),
-                    ElementSpec.StartTagType);
-            Specs.add(parStart);
-            ElementSpec parContent = new ElementSpec(new SimpleAttributeSet(),
-                    ElementSpec.ContentType, "\n".toCharArray(), 0, 1);
-            Specs.add(parContent);
-            ElementSpec parEnd = new ElementSpec(new SimpleAttributeSet(),
-                    ElementSpec.EndTagType);
-            Specs.add(parEnd);
-            ElementSpec cellEnd =
-                    new ElementSpec(cellAttrs, ElementSpec.EndTagType);
-            Specs.add(cellEnd);
-        }
-    }
-}
diff --git a/jdk/test/javax/swing/text/TableView/TableViewLayoutTest.java b/jdk/test/javax/swing/text/TableView/TableViewLayoutTest.java
new file mode 100644
index 0000000..eb7b3f2
--- /dev/null
+++ b/jdk/test/javax/swing/text/TableView/TableViewLayoutTest.java
@@ -0,0 +1,467 @@
+/*
+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @key headful
+ * @bug 8133864 8158209
+ * @summary  Wrong display, when the document I18n properties is true.
+ */
+import javax.swing.*;
+import javax.swing.text.*;
+import java.awt.*;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import javax.swing.event.CaretEvent;
+import javax.swing.event.CaretListener;
+
+public class TableViewLayoutTest extends JFrame {
+
+    private static double yCaret;
+    private static double xCaret;
+
+    // Number of iteration to verify the stability of the test with different robot delays :
+    // Work well with robot.delay(50) in hitKey method.
+    // But if the robot delay is too low, the test is not stable.
+    // Put this to 100, and reduce robot delay sometimes answers may be different.
+    private static int tn = 2;
+
+    // The four caret positions to test.
+    private static double yCarFLTab;
+    private static double yCarLLTab;
+    private static double xCarBTab;
+    private static double xCarETab;
+
+    // The caret coordonate differences along axis after the insertion and the removing cycle.
+    // 0 if the table layout is right.
+    private static double dyCarFLTab;
+    private static double dyCarLLTab;
+    private static double dxCarBTab;
+    private static double dxCarETab;
+
+    private static JEditorPane edit = new JEditorPane();
+    private static TableViewLayoutTest frame;
+
+    private static String Prop = "\n";
+    private static boolean isTabWrong = Boolean.FALSE;
+
+    private static Boolean isI18n = false;
+
+    public TableViewLayoutTest() {
+
+        super("Code example for a TableView bug");
+        setUndecorated(true);
+        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        edit.setEditorKit(new CodeBugEditorKit());
+        initCodeBug();
+        this.getContentPane().add(new JScrollPane(edit));
+        this.pack();
+        this.setLocationRelativeTo(null);
+
+        edit.addCaretListener(new CaretListener() {
+            public void caretUpdate(CaretEvent e) {
+                JTextComponent textComp = (JTextComponent) e.getSource();
+                try {
+                    Rectangle rect = textComp.getUI().modelToView(textComp, e.getDot());
+                    yCaret = rect.getY();
+                    xCaret = rect.getX();
+                } catch (BadLocationException ex) {
+                    throw new RuntimeException("Failed to get pixel position of caret", ex);
+                }
+            }
+        });
+    }
+
+    private void initCodeBug() {
+        CodeBugDocument doc = (CodeBugDocument) edit.getDocument();
+        try {
+            doc.insertString(0, "TextB  TextE", null);
+        } catch (BadLocationException ex) {
+        }
+        doc.insertTable(6, 4, 3);
+        try {
+            doc.insertString(7, "Cell11", null);
+            doc.insertString(14, "Cell12", null);
+            doc.insertString(21, "Cell13", null);
+            doc.insertString(28, "Cell21", null);
+            doc.insertString(35, "Cell22", null);
+            doc.insertString(42, "Cell23", null);
+            doc.insertString(49, "Cell31", null);
+            doc.insertString(56, "Cell32", null);
+            doc.insertString(63, "Cell33", null);
+            doc.insertString(70, "Cell41", null);
+            doc.insertString(77, "Cell42", null);
+            doc.insertString(84, "Cell43", null);
+        } catch (BadLocationException ex) {
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        for (int i = 0; i < tn; i++) {
+            Robot rob = new Robot();
+
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    frame = new TableViewLayoutTest();
+                    frame.setVisible(true);
+                }
+            });
+
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    //Enable or disable i18n.
+                    isI18n = !isI18n;
+                    edit.getDocument().putProperty("i18n", isI18n);
+
+                    //Made a change to update table layout.
+                    //Without any change the table i18n property change is not take in account.
+                    edit.select(11, 12);
+                    edit.replaceSelection("1");
+
+                    //Catch the four caret positions to test before insertions.
+                    edit.setCaretPosition(6);
+                    xCarBTab = xCaret;
+                    edit.setCaretPosition(91);
+                    xCarETab = xCaret;
+
+                    edit.setCaretPosition(74);
+                    yCarLLTab = yCaret;
+                    edit.setCaretPosition(11);
+                    yCarFLTab = yCaret;
+                }
+            });
+
+            hitKey(rob, KeyEvent.VK_T);
+            hitKey(rob, KeyEvent.VK_E);
+            hitKey(rob, KeyEvent.VK_S);
+            hitKey(rob, KeyEvent.VK_T);
+            hitKey(rob, KeyEvent.VK_BACK_SPACE);
+            hitKey(rob, KeyEvent.VK_BACK_SPACE);
+            hitKey(rob, KeyEvent.VK_BACK_SPACE);
+            hitKey(rob, KeyEvent.VK_BACK_SPACE);
+
+            rob.waitForIdle();
+
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    //Calculate caret coordinate differences and catch caret positions after insertions.
+                    edit.setCaretPosition(6);
+                    dxCarBTab = Math.abs(xCarBTab - xCaret);
+                    edit.setCaretPosition(91);
+                    dxCarETab = Math.abs(xCarETab - xCaret);
+
+                    edit.setCaretPosition(74);
+                    dyCarLLTab = Math.abs(yCarLLTab - yCaret);
+                    edit.setCaretPosition(11);
+                    dyCarFLTab = Math.abs(yCarFLTab - yCaret);
+
+                    edit.setCaretPosition(74);
+                    yCarLLTab = yCaret;
+                    edit.setCaretPosition(11);
+                    yCarFLTab = yCaret;
+                }
+            });
+
+            Object dp = edit.getDocument().getProperty("i18n");
+            Boolean isI18n = dp instanceof Boolean ? (Boolean) dp : Boolean.FALSE;
+            String i18n = isI18n ? "\nWhen i18n enable, " : "\nWhen i18n disable, ";
+
+            if (Math.abs(yCarFLTab - yCarLLTab) < 10) {
+                isTabWrong = Boolean.TRUE;
+                Prop = Prop + i18n + "test can't be completed : TableView layout wrong, lines overlap, see JDK-8133864.";
+            } else {
+                if (dyCarFLTab != 0 || dyCarLLTab != 0) {
+                    isTabWrong = Boolean.TRUE;
+                    Prop = Prop + i18n + "TableView layout wrong : Table high change when inserts and removes caracters, bug never reported yet. First Line dy=" + dyCarFLTab + " Last Line dy=" + dyCarLLTab;
+                }
+                if (dxCarBTab != 0 || dxCarETab != 0) {
+                    isTabWrong = Boolean.TRUE;
+                    Prop = Prop + i18n + "TableView layout wrong : Table width change when inserts and removes caracters, see JDK-8158209 and JDK-7169915. Before Table dx=" + dxCarBTab + " After Table dx=" + dxCarETab;
+                }
+            }
+            rob.waitForIdle();
+
+            SwingUtilities.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    frame.dispose();
+                }
+            });
+        }
+        if (isTabWrong) {
+            throw new RuntimeException(Prop);
+        }
+
+        System.out.println("ok");
+    }
+
+    private static void hitKey(Robot robot, int k) throws Exception {
+        robot.delay(50);
+        robot.keyPress(k);
+        robot.keyRelease(k);
+        robot.delay(50);
+    }
+}
+
+//------------------------------------------------------------------------------
+class CodeBugEditorKit extends StyledEditorKit {
+
+    ViewFactory defaultFactory = new TableFactory();
+
+    @Override
+    public ViewFactory getViewFactory() {
+        return defaultFactory;
+    }
+
+    @Override
+    public Document createDefaultDocument() {
+        return new CodeBugDocument();
+    }
+}
+//------------------------------------------------------------------------------
+
+class TableFactory implements ViewFactory {
+
+    @Override
+    public View create(Element elem) {
+        String kind = elem.getName();
+        if (kind != null) {
+            if (kind.equals(AbstractDocument.ContentElementName)) {
+                return new LabelView(elem);
+            } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
+                return new ParagraphView(elem);
+            } else if (kind.equals(AbstractDocument.SectionElementName)) {
+                return new BoxView(elem, View.Y_AXIS);
+            } else if (kind.equals(StyleConstants.ComponentElementName)) {
+                return new ComponentView(elem);
+            } else if (kind.equals(CodeBugDocument.ELEMENT_TABLE)) {
+                return new tableView(elem);
+            } else if (kind.equals(StyleConstants.IconElementName)) {
+                return new IconView(elem);
+            }
+        }
+        // default to text display
+        return new LabelView(elem);
+
+    }
+}
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+class tableView extends TableView implements ViewFactory {
+
+    public tableView(Element elem) {
+        super(elem);
+    }
+
+    @Override
+    public void setParent(View parent) {
+        super.setParent(parent);
+    }
+
+    @Override
+    public void setSize(float width, float height) {
+        super.setSize(width, height);
+    }
+
+    @Override
+    public ViewFactory getViewFactory() {
+        return this;
+    }
+
+    @Override
+    public float getMinimumSpan(int axis) {
+        return getPreferredSpan(axis);
+    }
+
+    @Override
+    public float getMaximumSpan(int axis) {
+        return getPreferredSpan(axis);
+    }
+
+    @Override
+    public float getAlignment(int axis) {
+        return 0.5f;
+    }
+
+    @Override
+    public float getPreferredSpan(int axis) {
+        if (axis == 0) {
+            return super.getPreferredSpan(0);
+        }
+        float preferredSpan = super.getPreferredSpan(axis);
+        return preferredSpan;
+    }
+
+    @Override
+    public void paint(Graphics g, Shape allocation) {
+        super.paint(g, allocation);
+        Rectangle alloc = allocation.getBounds();
+        int lastY = alloc.y + alloc.height - 1;
+        g.drawLine(alloc.x, lastY, alloc.x + alloc.width, lastY);
+    }
+
+    @Override
+    protected void paintChild(Graphics g, Rectangle alloc, int index) {
+        super.paintChild(g, alloc, index);
+        int lastX = alloc.x + alloc.width;
+        g.drawLine(alloc.x, alloc.y, lastX, alloc.y);
+    }
+
+    @Override
+    public View create(Element elem) {
+        String kind = elem.getName();
+        if (kind != null) {
+            if (kind.equals(CodeBugDocument.ELEMENT_TR)) {
+                return new trView(elem);
+            } else if (kind.equals(CodeBugDocument.ELEMENT_TD)) {
+                return new BoxView(elem, View.Y_AXIS);
+
+            }
+        }
+
+        // default is to delegate to the normal factory
+        View p = getParent();
+        if (p != null) {
+            ViewFactory f = p.getViewFactory();
+            if (f != null) {
+                return f.create(elem);
+            }
+        }
+
+        return null;
+    }
+
+    public class trView extends TableRow {
+
+        @Override
+        public void setParent(View parent) {
+            super.setParent(parent);
+        }
+
+        public trView(Element elem) {
+            super(elem);
+        }
+
+        public float getMinimumSpan(int axis) {
+            return getPreferredSpan(axis);
+        }
+
+        public float getMaximumSpan(int axis) {
+            return getPreferredSpan(axis);
+        }
+
+        public float getAlignment(int axis) {
+            return 0f;
+        }
+
+        @Override
+        protected void paintChild(Graphics g, Rectangle alloc, int index) {
+            super.paintChild(g, alloc, index);
+            int lastY = alloc.y + alloc.height - 1;
+            g.drawLine(alloc.x, alloc.y, alloc.x, lastY);
+            int lastX = alloc.x + alloc.width;
+            g.drawLine(lastX, alloc.y, lastX, lastY);
+        }
+    };
+}
+
+//------------------------------------------------------------------------------
+class CodeBugDocument extends DefaultStyledDocument {
+
+    public static final String ELEMENT_TABLE = "table";
+    public static final String ELEMENT_TR = "table cells row";
+    public static final String ELEMENT_TD = "table data cell";
+
+    public CodeBugDocument() {
+        //putProperty("i18n", Boolean.TRUE);
+    }
+
+    protected void insertTable(int offset, int rowCount, int colCount) {
+        try {
+            ArrayList Specs = new ArrayList();
+            ElementSpec gapTag = new ElementSpec(new SimpleAttributeSet(),
+                    ElementSpec.ContentType, "\n".toCharArray(), 0, 1);
+            Specs.add(gapTag);
+
+            SimpleAttributeSet tableAttrs = new SimpleAttributeSet();
+            tableAttrs.addAttribute(ElementNameAttribute, ELEMENT_TABLE);
+            ElementSpec tableStart
+                    = new ElementSpec(tableAttrs, ElementSpec.StartTagType);
+            Specs.add(tableStart); //start table tag
+
+            fillRowSpecs(Specs, rowCount, colCount);
+
+            ElementSpec[] spec = new ElementSpec[Specs.size()];
+            Specs.toArray(spec);
+
+            this.insert(offset, spec);
+        } catch (BadLocationException ex) {
+        }
+    }
+
+    protected void fillRowSpecs(ArrayList Specs, int rowCount, int colCount) {
+        SimpleAttributeSet rowAttrs = new SimpleAttributeSet();
+        rowAttrs.addAttribute(ElementNameAttribute, ELEMENT_TR);
+        for (int i = 0; i < rowCount; i++) {
+            ElementSpec rowStart
+                    = new ElementSpec(rowAttrs, ElementSpec.StartTagType);
+            Specs.add(rowStart);
+
+            fillCellSpecs(Specs, colCount);
+
+            ElementSpec rowEnd
+                    = new ElementSpec(rowAttrs, ElementSpec.EndTagType);
+            Specs.add(rowEnd);
+        }
+
+    }
+
+    protected void fillCellSpecs(ArrayList Specs, int colCount) {
+        for (int i = 0; i < colCount; i++) {
+            SimpleAttributeSet cellAttrs = new SimpleAttributeSet();
+            cellAttrs.addAttribute(ElementNameAttribute, ELEMENT_TD);
+
+            ElementSpec cellStart
+                    = new ElementSpec(cellAttrs, ElementSpec.StartTagType);
+            Specs.add(cellStart);
+
+            ElementSpec parStart = new ElementSpec(new SimpleAttributeSet(),
+                    ElementSpec.StartTagType);
+            Specs.add(parStart);
+            ElementSpec parContent = new ElementSpec(new SimpleAttributeSet(),
+                    ElementSpec.ContentType, "\n".toCharArray(), 0, 1);
+            Specs.add(parContent);
+            ElementSpec parEnd = new ElementSpec(new SimpleAttributeSet(),
+                    ElementSpec.EndTagType);
+            Specs.add(parEnd);
+            ElementSpec cellEnd
+                    = new ElementSpec(cellAttrs, ElementSpec.EndTagType);
+            Specs.add(cellEnd);
+        }
+    }
+}
diff --git a/jdk/test/javax/swing/text/html/StyleSheet/bug4936917.java b/jdk/test/javax/swing/text/html/StyleSheet/bug4936917.java
index 10fe6e8..e490f93 100644
--- a/jdk/test/javax/swing/text/html/StyleSheet/bug4936917.java
+++ b/jdk/test/javax/swing/text/html/StyleSheet/bug4936917.java
@@ -21,7 +21,7 @@
  * questions.
  */
 /* @test
-   @bug 4936917 7190578
+   @bug 4936917 7190578 8174717
    @summary  Tests if background is correctly painted when <BODY> has css margins
    @author Denis Sharypov
    @library ../../../regtesthelpers
@@ -72,6 +72,7 @@
         blockTillDisplayed(editorPane);
         Robot robot  = new Robot();
         robot.waitForIdle();
+        robot.delay(300);
 
         int x0 = p.x + 15 ;
         int y = p.y + 15;
diff --git a/jdk/test/javax/swing/text/html/parser/Parser/HtmlCommentTagParseTest/HtmlCommentTagParseTest.java b/jdk/test/javax/swing/text/html/parser/Parser/HtmlCommentTagParseTest/HtmlCommentTagParseTest.java
new file mode 100644
index 0000000..0f36517
--- /dev/null
+++ b/jdk/test/javax/swing/text/html/parser/Parser/HtmlCommentTagParseTest/HtmlCommentTagParseTest.java
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* This code is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License version 2 only, as
+* published by the Free Software Foundation.
+*
+* This code is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+* version 2 for more details (a copy is included in the LICENSE file that
+* accompanied this code).
+*
+* You should have received a copy of the GNU General Public License version
+* 2 along with this work; if not, write to the Free Software Foundation,
+* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+*
+* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+* or visit www.oracle.com if you need additional information or have any
+* questions.
+*/
+
+import javax.swing.*;
+import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.html.HTML;
+import javax.swing.text.html.HTMLDocument;
+import javax.swing.text.html.HTMLEditorKit;
+import java.io.*;
+import java.lang.reflect.InvocationTargetException;
+
+/* @test
+   @bug 8177450
+   @summary  javax.swing.text.html.parser.Parser parseScript ignores a character after commend end
+   @author Mikhail Cherkasov
+   @run main HtmlCommentTagParseTest
+*/
+public class HtmlCommentTagParseTest {
+    private static volatile boolean failed = false;
+    public static void main(String[] args) throws IOException, InvocationTargetException, InterruptedException {
+        SwingUtilities.invokeAndWait(() -> {
+                MyParser cb = new MyParser();
+                HTMLEditorKit htmlKit = new HTMLEditorKit();
+                HTMLDocument htmlDoc = (HTMLDocument)
+                        htmlKit.createDefaultDocument();
+            FileReader reader = null;
+            try {
+                reader = new FileReader(getDirURL() + "test.html");
+                htmlDoc.getParser().parse(reader, cb, true);
+                if(failed) {
+                    throw new RuntimeException("Test failed");
+                }
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        });
+    }
+    private static String getDirURL() {
+        return new File(System.getProperty("test.src", ".")).getAbsolutePath() +
+                File.separator;
+    }
+
+    private static class MyParser extends HTMLEditorKit.ParserCallback {
+        @Override
+        public void handleError(String errorMsg, int pos) {
+            failed = errorMsg.contains("eof.script");
+        }
+    }
+}
\ No newline at end of file
diff --git a/jdk/test/javax/swing/text/html/parser/Parser/HtmlCommentTagParseTest/test.html b/jdk/test/javax/swing/text/html/parser/Parser/HtmlCommentTagParseTest/test.html
new file mode 100644
index 0000000..ded588a
--- /dev/null
+++ b/jdk/test/javax/swing/text/html/parser/Parser/HtmlCommentTagParseTest/test.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+<script><!-- --></script>
+</body>
+</html>
\ No newline at end of file
diff --git a/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java b/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java
index d5c3196..994b6d0 100644
--- a/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java
+++ b/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java
@@ -39,7 +39,6 @@
 import com.sun.org.apache.xml.internal.serializer.EncodingInfo;
 import com.sun.org.apache.xml.internal.serializer.Encodings;
 import java.io.InputStreamReader;
-import java.lang.reflect.Module;
 import java.lang.reflect.Method;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
diff --git a/jdk/test/javax/xml/jaxp/common/8035437/Document.java b/jdk/test/javax/xml/jaxp/common/8035437/patch-src1/org/w3c/dom/Document.java
similarity index 100%
rename from jdk/test/javax/xml/jaxp/common/8035437/Document.java
rename to jdk/test/javax/xml/jaxp/common/8035437/patch-src1/org/w3c/dom/Document.java
diff --git a/jdk/test/javax/xml/jaxp/common/8035437/Node.java b/jdk/test/javax/xml/jaxp/common/8035437/patch-src1/org/w3c/dom/Node.java
similarity index 100%
rename from jdk/test/javax/xml/jaxp/common/8035437/Node.java
rename to jdk/test/javax/xml/jaxp/common/8035437/patch-src1/org/w3c/dom/Node.java
diff --git a/jdk/test/javax/xml/jaxp/common/8035437/DocumentImpl.java b/jdk/test/javax/xml/jaxp/common/8035437/patch-src2/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java
similarity index 100%
rename from jdk/test/javax/xml/jaxp/common/8035437/DocumentImpl.java
rename to jdk/test/javax/xml/jaxp/common/8035437/patch-src2/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java
diff --git a/jdk/test/javax/xml/jaxp/common/8035437/run.sh b/jdk/test/javax/xml/jaxp/common/8035437/run.sh
index ea377c67..9b1d327 100644
--- a/jdk/test/javax/xml/jaxp/common/8035437/run.sh
+++ b/jdk/test/javax/xml/jaxp/common/8035437/run.sh
@@ -28,13 +28,43 @@
 # @summary Tests that java.lang.AbstractMethodError is not thrown when
 #    serializing improper version of DocumentImpl class.
 
+OS=`uname -s`
+case "$OS" in
+  SunOS )
+    PS=":"
+    ;;
+  Linux )
+    PS=":"
+    ;;
+  Darwin )
+    PS=":"
+    ;;
+  AIX )
+    PS=":"
+    ;;
+  Windows*)
+    PS=";"
+    ;;
+  CYGWIN*)
+    PS=";"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
 mkdir -p exec/java.xml compile/java.xml
 
 $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
-   -d compile/java.xml -Xmodule:java.xml $TESTSRC/Document.java $TESTSRC/Node.java || exit 1
+   -d compile/java.xml --patch-module java.xml=$TESTSRC/patch-src1 \
+   $TESTSRC/patch-src1/org/w3c/dom/Document.java \
+   $TESTSRC/patch-src1/org/w3c/dom/Node.java || exit 1
 
 $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
-   -d exec/java.xml --patch-module java.xml=compile/java.xml -Xmodule:java.xml $TESTSRC/DocumentImpl.java || exit 2
+   -d exec/java.xml --patch-module java.xml=compile/java.xml${PS}$TESTSRC/patch-src2 \
+   $TESTSRC/patch-src2/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java \
+   || exit 2
 
 $COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
    $TESTSRC/AbstractMethodErrorTest.java -d exec || exit 3
diff --git a/jdk/test/jdk/internal/jimage/JImageOpenTest.java b/jdk/test/jdk/internal/jimage/JImageOpenTest.java
index 06c1993..9c828d7 100644
--- a/jdk/test/jdk/internal/jimage/JImageOpenTest.java
+++ b/jdk/test/jdk/internal/jimage/JImageOpenTest.java
@@ -21,7 +21,6 @@
  * questions.
  */
 
-import java.lang.reflect.Layer;
 import java.net.URI;
 import java.nio.file.FileSystem;
 import java.nio.file.FileSystems;
@@ -48,7 +47,7 @@
 
         final List<String> names = Files.walk(root)
                 .filter(p -> p.getNameCount() > 2)
-                .filter(p -> Layer.boot().findModule(p.getName(1).toString()).isPresent())
+                .filter(p -> ModuleLayer.boot().findModule(p.getName(1).toString()).isPresent())
                 .map(p -> p.subpath(2, p.getNameCount()))
                 .map(p -> p.toString())
                 .filter(s -> s.endsWith(".class") && !s.endsWith("module-info.class"))
diff --git a/jdk/test/jdk/internal/jrtfs/java.policy b/jdk/test/jdk/internal/jrtfs/java.policy
index 5df300a..276543b 100644
--- a/jdk/test/jdk/internal/jrtfs/java.policy
+++ b/jdk/test/jdk/internal/jrtfs/java.policy
@@ -1,3 +1,3 @@
 grant {
-    permission java.io.FilePermission "${java.home}/-", "read";
+    permission java.lang.RuntimePermission "accessSystemModules";
 };
diff --git a/jdk/test/jdk/internal/misc/JavaLangAccess/NewUnsafeString.java b/jdk/test/jdk/internal/misc/JavaLangAccess/NewUnsafeString.java
index 5023510..302fb18 100644
--- a/jdk/test/jdk/internal/misc/JavaLangAccess/NewUnsafeString.java
+++ b/jdk/test/jdk/internal/misc/JavaLangAccess/NewUnsafeString.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
  * @summary Test JavaLangAccess.newUnsafeString
  * @modules java.base/jdk.internal.misc
  * @compile -XDignore.symbol.file NewUnsafeString.java
+ * @run main NewUnsafeString
  */
 public class NewUnsafeString {
 
diff --git a/jdk/test/jdk/internal/reflect/CallerSensitive/CheckCSMs.java b/jdk/test/jdk/internal/reflect/CallerSensitive/CheckCSMs.java
new file mode 100644
index 0000000..126df3a
--- /dev/null
+++ b/jdk/test/jdk/internal/reflect/CallerSensitive/CheckCSMs.java
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.sun.tools.classfile.*;
+import com.sun.tools.jdeps.ClassFileReader;
+import static com.sun.tools.classfile.ConstantPool.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.net.URI;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.FutureTask;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/*
+ * @test
+ * @summary CallerSensitive methods should be static or final instance
+ *          methods except the known list of non-final instance methods
+ * @modules jdk.jdeps/com.sun.tools.classfile
+ *          jdk.jdeps/com.sun.tools.jdeps
+ * @build CheckCSMs
+ * @run main/othervm/timeout=900 CheckCSMs
+ */
+public class CheckCSMs {
+    private static int numThreads = 3;
+    private static boolean listCSMs = false;
+    private final ExecutorService pool;
+
+    // The goal is to remove this list of Non-final instance @CS methods
+    // over time.  Do not add any new one to this list.
+    private static Set<String> KNOWN_NON_FINAL_CSMS =
+      Set.of("java/io/ObjectStreamField#getType ()Ljava/lang/Class;",
+             "java/io/ObjectStreamClass#forClass ()Ljava/lang/Class;",
+             "java/lang/Runtime#load (Ljava/lang/String;)V",
+             "java/lang/Runtime#loadLibrary (Ljava/lang/String;)V",
+             "java/lang/Thread#getContextClassLoader ()Ljava/lang/ClassLoader;",
+             "javax/sql/rowset/serial/SerialJavaObject#getFields ()[Ljava/lang/reflect/Field;"
+      );
+
+    public static void main(String[] args) throws Exception {
+        if (args.length > 0 && args[0].equals("--list")) {
+            listCSMs = true;
+        }
+
+        CheckCSMs checkCSMs = new CheckCSMs();
+        Set<String> result = checkCSMs.run(getPlatformClasses());
+        if (!KNOWN_NON_FINAL_CSMS.equals(result)) {
+            Set<String> diff = new HashSet<>(result);
+            diff.removeAll(KNOWN_NON_FINAL_CSMS);
+            throw new RuntimeException("Unexpected non-final instance method: " +
+                result.stream().sorted()
+                      .collect(Collectors.joining("\n", "\n", "")));
+        }
+    }
+
+    private final Set<String> nonFinalCSMs = new ConcurrentSkipListSet<>();
+    private final ReferenceFinder finder;
+    public CheckCSMs() {
+        this.finder = new ReferenceFinder(getFilter(), getVisitor());
+        pool = Executors.newFixedThreadPool(numThreads);
+
+    }
+
+    public Set<String> run(Stream<Path> classes)
+        throws IOException, InterruptedException, ExecutionException,
+               ConstantPoolException
+    {
+        classes.forEach(this::processPath);
+        waitForCompletion();
+        pool.shutdown();
+        return nonFinalCSMs;
+    }
+
+
+    private ReferenceFinder.Filter getFilter() {
+        final String classname = "jdk/internal/reflect/Reflection";
+        final String method = "getCallerClass";
+        return new ReferenceFinder.Filter() {
+            public boolean accept(ConstantPool cpool, CPRefInfo cpref) {
+                try {
+                    CONSTANT_NameAndType_info nat = cpref.getNameAndTypeInfo();
+                    return cpref.getClassName().equals(classname) && nat.getName().equals(method);
+                } catch (ConstantPoolException ex) {
+                    throw new RuntimeException(ex);
+                }
+            }
+        };
+    }
+
+    private ReferenceFinder.Visitor getVisitor() {
+        return new ReferenceFinder.Visitor() {
+            public void visit(ClassFile cf, Method m,  List<CPRefInfo> refs) {
+                try {
+                    // ignore jdk.unsupported/sun.reflect.Reflection.getCallerClass
+                    // which is a "special" delegate to the internal getCallerClass
+                    if (cf.getName().equals("sun/reflect/Reflection") &&
+                        m.getName(cf.constant_pool).equals("getCallerClass"))
+                        return;
+
+                    String name = String.format("%s#%s %s", cf.getName(),
+                                                m.getName(cf.constant_pool),
+                                                m.descriptor.getValue(cf.constant_pool));
+                    if (!CheckCSMs.isStaticOrFinal(cf, m, cf.constant_pool)) {
+                        System.err.println("Unsupported @CallerSensitive: " + name);
+                        nonFinalCSMs.add(name);
+                    } else {
+                        if (listCSMs) {
+                            System.out.format("@CS  %s%n", name);
+                        }
+                    }
+                } catch (ConstantPoolException ex) {
+                    throw new RuntimeException(ex);
+                }
+            }
+        };
+    }
+
+    void processPath(Path path) {
+        try {
+            ClassFileReader reader = ClassFileReader.newInstance(path);
+            for (ClassFile cf : reader.getClassFiles()) {
+                if (cf.access_flags.is(AccessFlags.ACC_MODULE))
+                    continue;
+
+                String classFileName = cf.getName();
+                // for each ClassFile
+                //    parse constant pool to find matching method refs
+                //      parse each method (caller)
+                //      - visit and find method references matching the given method name
+                pool.submit(getTask(cf));
+            }
+        } catch (IOException x) {
+            throw new UncheckedIOException(x);
+        } catch (ConstantPoolException x) {
+            throw new RuntimeException(x);
+        }
+    }
+
+    private static final String CALLER_SENSITIVE_ANNOTATION
+        = "Ljdk/internal/reflect/CallerSensitive;";
+
+    private static boolean isCallerSensitive(Method m, ConstantPool cp)
+        throws ConstantPoolException
+    {
+        RuntimeAnnotations_attribute attr =
+            (RuntimeAnnotations_attribute)m.attributes.get(Attribute.RuntimeVisibleAnnotations);
+        if (attr != null) {
+            for (int i = 0; i < attr.annotations.length; i++) {
+                Annotation ann = attr.annotations[i];
+                String annType = cp.getUTF8Value(ann.type_index);
+                if (CALLER_SENSITIVE_ANNOTATION.equals(annType)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    private static boolean isStaticOrFinal(ClassFile cf, Method m, ConstantPool cp)
+        throws ConstantPoolException
+    {
+        if (!isCallerSensitive(m, cp))
+            return false;
+
+        // either a static method or a final instance method
+        return m.access_flags.is(AccessFlags.ACC_STATIC) ||
+               m.access_flags.is(AccessFlags.ACC_FINAL) ||
+               cf.access_flags.is(AccessFlags.ACC_FINAL);
+    }
+
+    private final List<FutureTask<Void>> tasks = new ArrayList<FutureTask<Void>>();
+    private FutureTask<Void> getTask(final ClassFile cf) {
+        FutureTask<Void> task = new FutureTask<Void>(new Callable<Void>() {
+            public Void call() throws Exception {
+                finder.parse(cf);
+                return null;
+            }
+        });
+        tasks.add(task);
+        return task;
+    }
+
+    private void waitForCompletion() throws InterruptedException, ExecutionException {
+        for (FutureTask<Void> t : tasks) {
+            t.get();
+        }
+        if (tasks.isEmpty()) {
+            throw new RuntimeException("No classes found, or specified.");
+        }
+        System.out.println("Parsed " + tasks.size() + " classfiles");
+    }
+
+    static Stream<Path> getPlatformClasses() throws IOException {
+        Path home = Paths.get(System.getProperty("java.home"));
+
+        // Either an exploded build or an image.
+        File classes = home.resolve("modules").toFile();
+        if (classes.isDirectory()) {
+            return Stream.of(classes.toPath());
+        } else {
+            return jrtPaths();
+        }
+    }
+
+    static Stream<Path> jrtPaths() {
+        FileSystem jrt = FileSystems.getFileSystem(URI.create("jrt:/"));
+        Path root = jrt.getPath("/");
+
+        try {
+            return Files.walk(root)
+                    .filter(p -> p.getNameCount() > 1)
+                    .filter(p -> p.toString().endsWith(".class"));
+        } catch (IOException x) {
+            throw new UncheckedIOException(x);
+        }
+    }
+}
diff --git a/jdk/test/jdk/internal/util/jar/TestVersionedStream.java b/jdk/test/jdk/internal/util/jar/TestVersionedStream.java
index 5dbef93..1f043b2 100644
--- a/jdk/test/jdk/internal/util/jar/TestVersionedStream.java
+++ b/jdk/test/jdk/internal/util/jar/TestVersionedStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UncheckedIOException;
-import java.net.URI;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -168,23 +167,23 @@
 
             // verify the contents
             Map<String,String> contents = new HashMap<>();
-            contents.put("p/Bar.class", "base/p/Bar.class\n");
-            contents.put("p/Main.class", "base/p/Main.class\n");
+            contents.put("p/Bar.class", "base/p/Bar.class");
+            contents.put("p/Main.class", "base/p/Main.class");
             switch (version.major()) {
                 case 8:
-                    contents.put("p/Foo.class", "base/p/Foo.class\n");
+                    contents.put("p/Foo.class", "base/p/Foo.class");
                     break;
                 case 9:
-                    contents.put("p/Foo.class", "v9/p/Foo.class\n");
+                    contents.put("p/Foo.class", "v9/p/Foo.class");
                     break;
                 case 10:
-                    contents.put("p/Foo.class", "v10/p/Foo.class\n");
-                    contents.put("q/Bar.class", "v10/q/Bar.class\n");
+                    contents.put("p/Foo.class", "v10/p/Foo.class");
+                    contents.put("q/Bar.class", "v10/q/Bar.class");
                     break;
                 case 11:
-                    contents.put("p/Bar.class", "v11/p/Bar.class\n");
-                    contents.put("p/Foo.class", "v11/p/Foo.class\n");
-                    contents.put("q/Bar.class", "v10/q/Bar.class\n");
+                    contents.put("p/Bar.class", "v11/p/Bar.class");
+                    contents.put("p/Foo.class", "v11/p/Foo.class");
+                    contents.put("q/Bar.class", "v10/q/Bar.class");
                     break;
                 default:
                     Assert.fail("Test out of date, please add more cases");
@@ -196,7 +195,7 @@
                 Assert.assertTrue(i != -1, name + " not in enames");
                 JarEntry je = versionedEntries.get(i);
                 try (InputStream is = jf.getInputStream(je)) {
-                    String s = new String(is.readAllBytes());
+                    String s = new String(is.readAllBytes()).replaceAll(System.lineSeparator(), "");
                     Assert.assertTrue(s.endsWith(e.getValue()), s);
                 } catch (IOException x) {
                     throw new UncheckedIOException(x);
@@ -208,16 +207,13 @@
     private void createFiles(String... files) {
         ArrayList<String> list = new ArrayList();
         Arrays.stream(files)
-                .map(f -> "file:///" + userdir + "/" + f)
-                .map(f -> URI.create(f))
-                .filter(u -> u != null)
-                .map(u -> Paths.get(u))
+                .map(f -> Paths.get(userdir.toAbsolutePath().toString(), f))
                 .forEach(p -> {
                     try {
                         Files.createDirectories(p.getParent());
                         Files.createFile(p);
                         list.clear();
-                        list.add(p.toString());
+                        list.add(p.toString().replace(File.separatorChar, '/'));
                         Files.write(p, list);
                     } catch (IOException x) {
                         throw new UncheckedIOException(x);
diff --git a/jdk/test/jdk/modules/etc/JdkQualifiedExportTest.java b/jdk/test/jdk/modules/etc/JdkQualifiedExportTest.java
new file mode 100644
index 0000000..d4dc0ea
--- /dev/null
+++ b/jdk/test/jdk/modules/etc/JdkQualifiedExportTest.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8176537
+ * @summary Check JDK modules have no qualified export to any upgradeable module
+ * @modules java.base/jdk.internal.module
+ * @run main JdkQualifiedExportTest
+ */
+
+import jdk.internal.module.ModuleHashes;
+import jdk.internal.module.ModuleInfo;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UncheckedIOException;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Exports;
+import java.lang.module.ModuleDescriptor.Opens;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class JdkQualifiedExportTest {
+    public static void main(String... args) {
+        // check all system modules
+        ModuleFinder.ofSystem().findAll()
+                    .stream()
+                    .map(ModuleReference::descriptor)
+                    .sorted(Comparator.comparing(ModuleDescriptor::name))
+                    .forEach(JdkQualifiedExportTest::check);
+    }
+
+    static void check(ModuleDescriptor md) {
+        // skip checking if this is an upgradeable module
+        if (!HashedModules.contains(md.name())) {
+            return;
+        }
+
+        checkExports(md);
+        checkOpens(md);
+    }
+
+    static Set<String> KNOWN_EXCEPTIONS =
+        Set.of("java.xml/com.sun.xml.internal.stream.writers",
+               "jdk.jsobject/jdk.internal.netscape.javascript.spi");
+    static Set<String> DEPLOY_MODULES =
+        Set.of("jdk.deploy", "jdk.plugin", "jdk.javaws");
+
+    static void checkExports(ModuleDescriptor md) {
+        // build a map of upgradeable module to Exports that are qualified to it
+        // skip the qualified exports
+        Map<String, Set<Exports>> targetToExports = new HashMap<>();
+        md.exports().stream()
+          .filter(Exports::isQualified)
+          .forEach(e -> e.targets().stream()
+                         .filter(mn -> !HashedModules.contains(mn) &&
+                                           ModuleFinder.ofSystem().find(mn).isPresent())
+                         .forEach(t -> targetToExports.computeIfAbsent(t, _k -> new HashSet<>())
+                                                      .add(e)));
+
+        if (targetToExports.size() > 0) {
+            String mn = md.name();
+
+            System.err.println(mn);
+            targetToExports.entrySet().stream()
+                .sorted(Map.Entry.comparingByKey())
+                .forEach(e -> {
+                    e.getValue().stream()
+                     .forEach(exp -> System.err.format("    exports %s to %s%n",
+                                                       exp.source(), e.getKey()));
+                });
+
+            // workaround until all qualified exports to upgradeable modules
+            // are eliminated
+            if (targetToExports.entrySet().stream()
+                    .filter(e -> !DEPLOY_MODULES.contains(e.getKey()))
+                    .flatMap(e -> e.getValue().stream())
+                    .anyMatch(e -> !KNOWN_EXCEPTIONS.contains(mn + "/" + e.source()))) {
+                throw new RuntimeException(mn + " can't export package to upgradeable modules");
+            }
+        }
+    }
+
+    static void checkOpens(ModuleDescriptor md) {
+        // build a map of upgradeable module to Exports that are qualified to it
+        // skip the qualified exports
+        Map<String, Set<Opens>> targetToOpens = new HashMap<>();
+        md.opens().stream()
+            .filter(Opens::isQualified)
+            .forEach(e -> e.targets().stream()
+                           .filter(mn -> !HashedModules.contains(mn) &&
+                                            ModuleFinder.ofSystem().find(mn).isPresent())
+                           .forEach(t -> targetToOpens.computeIfAbsent(t, _k -> new HashSet<>())
+                                                      .add(e)));
+
+        if (targetToOpens.size() > 0) {
+            String mn = md.name();
+
+            System.err.println(mn);
+            targetToOpens.entrySet().stream()
+                .sorted(Map.Entry.comparingByKey())
+                .forEach(e -> {
+                    e.getValue().stream()
+                     .forEach(exp -> System.err.format("    opens %s to %s%n",
+                                                       exp.source(), e.getKey()));
+                });
+
+            throw new RuntimeException(mn + " can't open package to upgradeable modules");
+        }
+    }
+
+    private static class HashedModules {
+        static Set<String> HASHED_MODULES = hashedModules();
+
+        static Set<String> hashedModules() {
+            Module javaBase = Object.class.getModule();
+            try (InputStream in = javaBase.getResourceAsStream("module-info.class")) {
+                ModuleInfo.Attributes attrs = ModuleInfo.read(in, null);
+                ModuleHashes hashes = attrs.recordedHashes();
+                if (hashes == null)
+                    return Collections.emptySet();
+
+                Set<String> names = new HashSet<>(hashes.names());
+                names.add(javaBase.getName());
+                return names;
+            } catch (IOException e) {
+                throw new UncheckedIOException(e);
+            }
+        }
+
+        /*
+         * Returns true if the named module is tied with java.base,
+         * i.e. non-upgradeable
+         */
+        static boolean contains(String mn) {
+            return HASHED_MODULES.contains(mn);
+        }
+    }
+}
diff --git a/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java b/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java
index 72e3370..2d8b30c 100644
--- a/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java
+++ b/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java
@@ -31,8 +31,6 @@
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.Set;
 import static java.util.stream.Collectors.toSet;
 
@@ -46,10 +44,10 @@
     private static final String JAVA_BASE = "java.base";
 
     private static final ModuleDescriptor BASE
-        = ModuleDescriptor.module(JAVA_BASE).build();
+        = ModuleDescriptor.newModule(JAVA_BASE).build();
 
     private static final Set<ModuleDescriptor> MREFS
-            = Layer.boot().modules().stream().map(Module::getDescriptor)
+            = ModuleLayer.boot().modules().stream().map(Module::getDescriptor)
                 .collect(toSet());
 
     private void check(ModuleDescriptor md, ModuleDescriptor ref) {
@@ -69,7 +67,7 @@
 
     @Test
     public void checkLoaderDelegation() {
-        Layer boot = Layer.boot();
+        ModuleLayer boot = ModuleLayer.boot();
         MREFS.stream()
              .forEach(md -> md.requires().stream().forEach(req ->
                  {
diff --git a/jdk/test/jdk/modules/incubator/DefaultImage.java b/jdk/test/jdk/modules/incubator/DefaultImage.java
index ff6f526..dc22363 100644
--- a/jdk/test/jdk/modules/incubator/DefaultImage.java
+++ b/jdk/test/jdk/modules/incubator/DefaultImage.java
@@ -34,6 +34,9 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -41,13 +44,13 @@
 import java.util.stream.Stream;
 
 import org.testng.annotations.BeforeTest;
-import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static jdk.testlibrary.ProcessTools.executeCommand;
 import static org.testng.Assert.*;
 
+@Test
 public class DefaultImage {
     private static final String JAVA_HOME = System.getProperty("java.home");
     private static final Path TEST_SRC = Paths.get(System.getProperty("test.src"));
@@ -72,19 +75,13 @@
             .resultChecker(r -> r.assertOutputDoesNotContain("jdk.incubator"));
     }
 
-    @DataProvider(name = "tokens")
-    public Object[][] singleModuleValues() throws IOException {
-        return new Object[][]{ { "ALL-DEFAULT" }, { "ALL-SYSTEM"} };
-    }
-
-    @Test(dataProvider = "tokens")
-    public void testAddMods(String addModsToken) throws Throwable {
+    public void testAllDefault() throws Throwable {
         if (isExplodedBuild()) {
             System.out.println("Test cannot run on exploded build");
             return;
         }
 
-        java("--add-modules", addModsToken,
+        java("--add-modules", "ALL-DEFAULT",
              "-cp", CP_DIR.toString(),
              "listmods.ListModules")
             .assertSuccess()
@@ -92,6 +89,22 @@
             .resultChecker(r -> r.assertOutputDoesNotContain("jdk.incubator"));
     }
 
+    public void testAllSystem() throws Throwable {
+        if (isExplodedBuild()) {
+            System.out.println("Test cannot run on exploded build");
+            return;
+        }
+
+        if (containsAnyIncubatorModules()) {
+            java("--add-modules", "ALL-SYSTEM",
+                 "-cp", CP_DIR.toString(),
+                 "listmods.ListModules")
+                .assertSuccess()
+                .resultChecker(r -> r.assertOutputContains("java.base"))
+                .resultChecker(r -> r.assertOutputContains("jdk.incubator"));
+        }
+    }
+
     static ToolResult java(String... opts) throws Throwable {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         PrintStream ps = new PrintStream(baos);
@@ -155,4 +168,14 @@
         Path modulesPath = Paths.get(JAVA_HOME).resolve("lib").resolve("modules");
         return Files.notExists(modulesPath);
     }
+
+    static boolean containsAnyIncubatorModules() {
+        return ModuleFinder.ofSystem().findAll().stream()
+                .map(ModuleReference::descriptor)
+                .map(ModuleDescriptor::name)
+                .filter(mn -> mn.startsWith("jdk.incubator"))
+                .map(mn -> true)
+                .findAny()
+                .orElse(false);
+    }
 }
diff --git a/jdk/test/jdk/modules/incubator/ImageModules.java b/jdk/test/jdk/modules/incubator/ImageModules.java
index 347b1d4..cf3d297 100644
--- a/jdk/test/jdk/modules/incubator/ImageModules.java
+++ b/jdk/test/jdk/modules/incubator/ImageModules.java
@@ -98,7 +98,7 @@
               List.of("hello world", "message.converter", "java.base"),
               List.of("WARNING") },
             { "--do-not-resolve-by-default",
-              List.of("ALL-DEFAULT", "ALL-SYSTEM"),
+              List.of("ALL-DEFAULT"),
               ToolResult.ASSERT_FAILURE,
               List.of("java.base", "java.lang.ClassNotFoundException: converter.MessageConverter"),
               List.of("WARNING", "message.converter") },
@@ -109,7 +109,7 @@
                       "WARNING: Using incubator modules: message.converter"),
               List.of() },
             { "--do-not-resolve-by-default --warn-if-resolved=incubating",
-              List.of("ALL-DEFAULT", "ALL-SYSTEM"),
+              List.of("ALL-DEFAULT"),
               ToolResult.ASSERT_FAILURE,
               List.of("java.base", "java.lang.ClassNotFoundException: converter.MessageConverter"),
               List.of("WARNING", "message.converter") },
@@ -215,13 +215,13 @@
               List.of() },
             { "--do-not-resolve-by-default",
               "",
-              List.of("ALL-DEFAULT", "ALL-SYSTEM"),
+              List.of("ALL-DEFAULT"),
               ToolResult.ASSERT_FAILURE,
               List.of("java.lang.ClassNotFoundException: writer.MessageWriter", "java.base"),
               List.of("message.writer") },
             { "--do-not-resolve-by-default",
               "--do-not-resolve-by-default",
-              List.of("ALL-DEFAULT", "ALL-SYSTEM"),
+              List.of("ALL-DEFAULT"),
               ToolResult.ASSERT_FAILURE,
               List.of("java.lang.ClassNotFoundException: writer.MessageWriter", "java.base"),
               List.of("message.converter", "message.writer") },
@@ -239,7 +239,8 @@
               ToolResult.ASSERT_SUCCESS,
               List.of("HELLO CHEGAR !!!", "message.writer", "message.converter", "java.base",
                       "WARNING: Using incubator modules: message.converter"),
-              List.of() } };
+              List.of() }
+            };
         return values;
     }
 
diff --git a/jdk/test/jdk/modules/incubator/src/cp/listmods/ListModules.java b/jdk/test/jdk/modules/incubator/src/cp/listmods/ListModules.java
index 2d80d19..ceac4c5 100644
--- a/jdk/test/jdk/modules/incubator/src/cp/listmods/ListModules.java
+++ b/jdk/test/jdk/modules/incubator/src/cp/listmods/ListModules.java
@@ -23,13 +23,11 @@
 
 package listmods;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import static java.util.stream.Collectors.joining;
 
 public class ListModules {
     public static void main(String[] args) throws Exception {
-        System.out.println(Layer.boot()
+        System.out.println(ModuleLayer.boot()
                                 .modules()
                                 .stream()
                                 .map(Module::getName)
diff --git a/jdk/test/jdk/modules/incubator/src/cp/test/ConvertToLowerCase.java b/jdk/test/jdk/modules/incubator/src/cp/test/ConvertToLowerCase.java
index cf0d1c7..4d0cc85 100644
--- a/jdk/test/jdk/modules/incubator/src/cp/test/ConvertToLowerCase.java
+++ b/jdk/test/jdk/modules/incubator/src/cp/test/ConvertToLowerCase.java
@@ -23,13 +23,11 @@
 
 package test;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import static java.util.stream.Collectors.joining;
 
 public class ConvertToLowerCase {
     public static void main(String[] args) {
-        System.out.println(Layer.boot()
+        System.out.println(ModuleLayer.boot()
                                 .modules()
                                 .stream()
                                 .map(Module::getName)
diff --git a/jdk/test/jdk/modules/incubator/src/cp/test/WriteUpperCase.java b/jdk/test/jdk/modules/incubator/src/cp/test/WriteUpperCase.java
index 844fccb..f0662a5 100644
--- a/jdk/test/jdk/modules/incubator/src/cp/test/WriteUpperCase.java
+++ b/jdk/test/jdk/modules/incubator/src/cp/test/WriteUpperCase.java
@@ -23,13 +23,11 @@
 
 package test;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import static java.util.stream.Collectors.joining;
 
 public class WriteUpperCase {
     public static void main(String[] args) {
-        System.out.println(Layer.boot()
+        System.out.println(ModuleLayer.boot()
                                 .modules()
                                 .stream()
                                 .map(Module::getName)
diff --git a/jdk/test/jdk/modules/open/Basic.java b/jdk/test/jdk/modules/open/Basic.java
index 2af576e..f63b145 100644
--- a/jdk/test/jdk/modules/open/Basic.java
+++ b/jdk/test/jdk/modules/open/Basic.java
@@ -36,7 +36,6 @@
 import java.lang.module.ModuleDescriptor;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InaccessibleObjectException;
-import java.lang.reflect.Module;
 
 import org.testng.annotations.Test;
 import org.testng.annotations.BeforeTest;
diff --git a/jdk/test/jdk/modules/scenarios/automaticmodules/src/basictest/test/Main.java b/jdk/test/jdk/modules/scenarios/automaticmodules/src/basictest/test/Main.java
index 01d8283..4a72979 100644
--- a/jdk/test/jdk/modules/scenarios/automaticmodules/src/basictest/test/Main.java
+++ b/jdk/test/jdk/modules/scenarios/automaticmodules/src/basictest/test/Main.java
@@ -23,9 +23,6 @@
 
 package test;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-
 import http.HttpServer;
 
 /**
@@ -47,8 +44,8 @@
         cl = ClassLoader.getSystemClassLoader();
         assertTrue(httpModule.canRead(cl.getUnnamedModule()));
 
-        // and read all modules in the boot Layer
-        Layer layer = Layer.boot();
+        // and read all modules in the boot layer
+        ModuleLayer layer = ModuleLayer.boot();
         layer.modules().forEach(m -> assertTrue(httpModule.canRead(m)));
 
         // run code in the automatic modue, ensures access is allowed
diff --git a/jdk/test/jdk/modules/scenarios/automaticmodules/src/sptest/test/Main.java b/jdk/test/jdk/modules/scenarios/automaticmodules/src/sptest/test/Main.java
index 5897d67..dc079b8 100644
--- a/jdk/test/jdk/modules/scenarios/automaticmodules/src/sptest/test/Main.java
+++ b/jdk/test/jdk/modules/scenarios/automaticmodules/src/sptest/test/Main.java
@@ -26,8 +26,6 @@
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleDescriptor.Requires;
 import java.lang.module.ModuleDescriptor.Provides;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.Map;
 import java.util.Optional;
 import java.util.ServiceLoader;
@@ -36,7 +34,7 @@
 import javax.script.ScriptEngineFactory;
 
 /**
- * Test that the automatic module "bananascript" is in the boot Layer and
+ * Test that the automatic module "bananascript" is in the boot layer and
  * it behaves as a service provider.
  */
 
@@ -44,7 +42,7 @@
 
     public static void main(String[] args) throws Exception {
 
-        Optional<Module> om = Layer.boot().findModule("bananascript");
+        Optional<Module> om = ModuleLayer.boot().findModule("bananascript");
         assertTrue(om.isPresent());
 
         ModuleDescriptor descriptor = om.get().getDescriptor();
diff --git a/jdk/test/jdk/modules/scenarios/container/src/container/container/Main.java b/jdk/test/jdk/modules/scenarios/container/src/container/container/Main.java
index 67f2416..05b8513 100644
--- a/jdk/test/jdk/modules/scenarios/container/src/container/container/Main.java
+++ b/jdk/test/jdk/modules/scenarios/container/src/container/container/Main.java
@@ -27,9 +27,7 @@
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Set;
@@ -43,7 +41,7 @@
     public static void main(String[] args) throws Exception {
 
         System.out.println("Boot layer");
-        Layer.boot()
+        ModuleLayer.boot()
              .modules()
              .stream()
              .map(Module::getName)
@@ -70,10 +68,10 @@
 
         ModuleFinder finder = ModuleFinder.of(paths);
 
-        Configuration cf = Layer.boot().configuration()
-            .resolveRequiresAndUses(finder,
-                                    ModuleFinder.of(),
-                                    Set.of(appModuleName));
+        Configuration cf = ModuleLayer.boot().configuration()
+            .resolveAndBind(finder,
+                            ModuleFinder.of(),
+                            Set.of(appModuleName));
 
         System.out.println("Resolved");
         cf.modules().stream()
@@ -81,9 +79,9 @@
           .sorted()
           .forEach(mn -> System.out.format("  %s%n", mn));
 
-        // reify the configuration as a Layer
+        // reify the configuration as a module layer
         ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
+        ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
 
         // invoke application main method
         ClassLoader loader = layer.findLoader(appModuleName);
diff --git a/jdk/test/jdk/nio/zipfs/MultiReleaseJarTest.java b/jdk/test/jdk/nio/zipfs/MultiReleaseJarTest.java
index 6c11601..870b6fa 100644
--- a/jdk/test/jdk/nio/zipfs/MultiReleaseJarTest.java
+++ b/jdk/test/jdk/nio/zipfs/MultiReleaseJarTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8144355 8144062
+ * @bug 8144355 8144062 8176709
  * @summary Test aliasing additions to ZipFileSystem for multi-release jar files
  * @library /lib/testlibrary/java/util/jar
  * @build Compiler JarBuilder CreateMultiReleaseTestJars
@@ -42,6 +42,7 @@
 import java.nio.file.*;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import org.testng.Assert;
 import org.testng.annotations.*;
@@ -50,6 +51,7 @@
     final private int MAJOR_VERSION = Runtime.version().major();
 
     final private String userdir = System.getProperty("user.dir",".");
+    final private CreateMultiReleaseTestJars creator =  new CreateMultiReleaseTestJars();
     final private Map<String,String> stringEnv = new HashMap<>();
     final private Map<String,Integer> integerEnv = new HashMap<>();
     final private Map<String,Version> versionEnv = new HashMap<>();
@@ -63,7 +65,6 @@
 
     @BeforeClass
     public void initialize() throws Exception {
-        CreateMultiReleaseTestJars creator =  new CreateMultiReleaseTestJars();
         creator.compileEntries();
         creator.buildUnversionedJar();
         creator.buildMultiReleaseJar();
@@ -187,6 +188,45 @@
         }
     }
 
+    @Test
+    public void testIsMultiReleaseJar() throws Exception {
+        // Re-examine commented out tests as part of JDK-8176843
+        testCustomMultiReleaseValue("true", true);
+        testCustomMultiReleaseValue("true\r\nOther: value", true);
+        testCustomMultiReleaseValue("true\nOther: value", true);
+        //testCustomMultiReleaseValue("true\rOther: value", true);
+
+        testCustomMultiReleaseValue("false", false);
+        testCustomMultiReleaseValue(" true", false);
+        testCustomMultiReleaseValue("true ", false);
+        //testCustomMultiReleaseValue("true\n ", false);
+        //testCustomMultiReleaseValue("true\r ", false);
+        //testCustomMultiReleaseValue("true\n true", false);
+        //testCustomMultiReleaseValue("true\r\n true", false);
+    }
+
+    private static final AtomicInteger JAR_COUNT = new AtomicInteger(0);
+
+    private void testCustomMultiReleaseValue(String value, boolean expected)
+            throws Exception {
+        String fileName = "custom-mr" + JAR_COUNT.incrementAndGet() + ".jar";
+        creator.buildCustomMultiReleaseJar(fileName, value, Map.of(),
+                /*addEntries*/true);
+
+        Map<String,String> env = Map.of("multi-release", "runtime");
+        Path filePath = Paths.get(userdir, fileName);
+        String ssp = filePath.toUri().toString();
+        URI customJar = new URI("jar", ssp , null);
+        try (FileSystem fs = FileSystems.newFileSystem(customJar, env)) {
+            if (expected) {
+                Assert.assertTrue(readAndCompare(fs, MAJOR_VERSION));
+            } else {
+                Assert.assertTrue(readAndCompare(fs, 8));
+            }
+        }
+        Files.delete(filePath);
+    }
+
     private static class ByteArrayClassLoader extends ClassLoader {
         final private FileSystem fs;
 
diff --git a/jdk/test/lib/testlibrary/ModuleTargetHelper.java b/jdk/test/lib/testlibrary/ModuleTargetHelper.java
new file mode 100644
index 0000000..b01e184
--- /dev/null
+++ b/jdk/test/lib/testlibrary/ModuleTargetHelper.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.lang.module.ModuleReader;
+import java.lang.module.ModuleReference;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import jdk.internal.module.ClassFileConstants;
+import jdk.internal.module.ClassFileAttributes;
+import jdk.internal.module.ClassFileAttributes.ModuleTargetAttribute;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+public class ModuleTargetHelper {
+    private ModuleTargetHelper() {}
+
+    public static final class ModuleTarget {
+        private String osName, osArch;
+
+        public ModuleTarget(String osName, String osArch) {
+            this.osName = osName;
+            this.osArch = osArch;
+        }
+
+        public String osName() {
+            return osName;
+        }
+
+        public String osArch() {
+            return osArch;
+        }
+    }
+
+    public static ModuleTarget getJavaBaseTarget() throws IOException {
+        Path p = Paths.get(URI.create("jrt:/modules/java.base/module-info.class"));
+        try (InputStream in = Files.newInputStream(p)) {
+            return read(in);
+        }
+    }
+
+    public static ModuleTarget read(InputStream in) throws IOException {
+        ModuleTargetAttribute[] modTargets = new ModuleTargetAttribute[1];
+        ClassVisitor cv = new ClassVisitor(Opcodes.ASM5) {
+            @Override
+            public void visitAttribute(Attribute attr) {
+                if (attr instanceof ModuleTargetAttribute) {
+                    modTargets[0] = (ModuleTargetAttribute)attr;
+                }
+            }
+        };
+
+        // prototype of attributes that should be parsed
+        Attribute[] attrs = new Attribute[] {
+            new ModuleTargetAttribute()
+        };
+
+        // parse module-info.class
+        ClassReader cr = new ClassReader(in);
+        cr.accept(cv, attrs, 0);
+        if (modTargets[0] != null) {
+            return new ModuleTarget(modTargets[0].osName(), modTargets[0].osArch());
+        }
+
+        return null;
+    }
+
+    public static ModuleTarget read(ModuleReference modRef) throws IOException {
+        ModuleReader reader = modRef.open();
+        try (InputStream in = reader.open("module-info.class").get()) {
+            return read(in);
+        } finally {
+            reader.close();
+        }
+    }
+}
diff --git a/jdk/test/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java b/jdk/test/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java
index 504472f..afde13b 100644
--- a/jdk/test/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java
+++ b/jdk/test/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -109,9 +109,17 @@
 
     public void buildCustomMultiReleaseJar(String filename, String multiReleaseValue,
             Map<String, String> extraAttributes) throws IOException {
+        buildCustomMultiReleaseJar(filename, multiReleaseValue, extraAttributes, false);
+    }
+
+    public void buildCustomMultiReleaseJar(String filename, String multiReleaseValue,
+            Map<String, String> extraAttributes, boolean addEntries) throws IOException {
         JarBuilder jb = new JarBuilder(filename);
         extraAttributes.entrySet()
                 .forEach(entry -> jb.addAttribute(entry.getKey(), entry.getValue()));
+        if (addEntries) {
+            addEntries(jb);
+        }
         jb.addAttribute("Multi-Release", multiReleaseValue);
         jb.build();
     }
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/FileUtils.java b/jdk/test/lib/testlibrary/jdk/testlibrary/FileUtils.java
index 3c85782..9c41b8e 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/FileUtils.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/FileUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 
 
 /**
@@ -190,4 +191,40 @@
         }
         return excs;
     }
+
+    /**
+     * Checks whether all file systems are accessible. This is performed
+     * by checking free disk space on all mounted file systems via a
+     * separate, spawned process. File systems are considered to be
+     * accessible if this process completes successfully before a given
+     * fixed duration has elapsed.
+     *
+     * @implNote On Unix this executes the {@code df} command in a separate
+     * process and on Windows always returns {@code true}.
+     */
+    public static boolean areFileSystemsAccessible() throws IOException {
+        boolean areFileSystemsAccessible = true;
+        if (!isWindows) {
+            // try to check whether 'df' hangs
+            System.out.println("\n--- df output ---");
+            System.out.flush();
+            Process proc = new ProcessBuilder("df").inheritIO().start();
+            try {
+                proc.waitFor(90, TimeUnit.SECONDS);
+            } catch (InterruptedException ignored) {
+            }
+            try {
+                int exitValue = proc.exitValue();
+                if (exitValue != 0) {
+                    System.err.printf("df process exited with %d != 0%n",
+                        exitValue);
+                    areFileSystemsAccessible = false;
+                }
+            } catch (IllegalThreadStateException ignored) {
+                System.err.println("df command apparently hung");
+                areFileSystemsAccessible = false;
+            }
+        }
+        return areFileSystemsAccessible;
+    }
 }
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/NetworkConfiguration.java b/jdk/test/lib/testlibrary/jdk/testlibrary/NetworkConfiguration.java
new file mode 100644
index 0000000..77544d2
--- /dev/null
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/NetworkConfiguration.java
@@ -0,0 +1,267 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.testlibrary;
+
+import java.io.PrintStream;
+import java.io.UncheckedIOException;
+import java.io.IOException;
+import java.net.Inet4Address;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+import static java.net.NetworkInterface.getNetworkInterfaces;
+import static java.util.Collections.list;
+
+/**
+ * Helper class for retrieving network interfaces and local addresses
+ * suitable for testing.
+ */
+public class NetworkConfiguration {
+
+    static final boolean isWindows =
+            System.getProperty("os.name").startsWith("Windows");
+    static final boolean isMacOS =
+            System.getProperty("os.name").contains("OS X");
+
+    private Map<NetworkInterface,List<Inet4Address>> ip4Interfaces;
+    private Map<NetworkInterface,List<Inet6Address>> ip6Interfaces;
+
+    private NetworkConfiguration(Map<NetworkInterface,List<Inet4Address>> ip4Interfaces,
+                                 Map<NetworkInterface,List<Inet6Address>> ip6Interfaces)
+    {
+        this.ip4Interfaces = ip4Interfaces;
+        this.ip6Interfaces = ip6Interfaces;
+    }
+
+    /**
+     * Returns a stream of interfaces suitable for functional tests.
+     */
+    public Stream<NetworkInterface> interfaces() {
+        return Stream.concat(ip4Interfaces(), ip6Interfaces())
+                     .distinct();
+    }
+
+    /**
+     * Returns a stream of interfaces suitable for IPv4 functional tests.
+     */
+    public Stream<NetworkInterface> ip4Interfaces() {
+        return ip4Interfaces.keySet().stream()
+                .filter(NetworkConfiguration::isNotExcludedInterface)
+                .filter(hasIp4Addresses);
+    }
+
+    /**
+     * Returns a stream of interfaces suitable for IPv6 functional tests.
+     */
+    public Stream<NetworkInterface> ip6Interfaces() {
+        return ip6Interfaces.keySet().stream()
+                .filter(NetworkConfiguration::isNotExcludedInterface)
+                .filter(hasIp6Addresses);
+    }
+
+    private static boolean isNotExcludedInterface(NetworkInterface nif) {
+        if (isMacOS && nif.getName().contains("awdl"))
+            return false;
+        String dName = nif.getDisplayName();
+        if (isWindows && dName != null && dName.contains("Teredo"))
+            return false;
+        return true;
+    }
+
+    private final Predicate<NetworkInterface> hasIp4Addresses = nif -> {
+        Optional<?> addr = ip4Interfaces.get(nif).stream()
+                .filter(a -> !a.isAnyLocalAddress())
+                .findAny();
+
+        return addr.isPresent();
+    };
+
+    private final Predicate<NetworkInterface> hasIp6Addresses = nif -> {
+        Optional<?> addr = ip6Interfaces.get(nif).stream()
+                .filter(a -> !a.isAnyLocalAddress())
+                .findAny();
+
+        return addr.isPresent();
+    };
+
+
+    /**
+     * Returns a stream of interfaces suitable for IPv4 multicast tests.
+     */
+    public Stream<NetworkInterface> ip4MulticastInterfaces() {
+        return ip4Interfaces().filter(supportsIp4Multicast);
+    }
+
+    /**
+     * Returns a stream of interfaces suitable for IPv6 multicast tests.
+     */
+    public Stream<NetworkInterface> ip6MulticastInterfaces() {
+        return ip6Interfaces().filter(supportsIp6Multicast);
+    }
+
+    private final Predicate<NetworkInterface> supportsIp4Multicast = nif -> {
+        try {
+            if (!nif.supportsMulticast() || nif.isLoopback())
+                return false;
+
+            Optional<?> addr = ip4Interfaces.get(nif).stream()
+                    .filter(a -> !a.isAnyLocalAddress())
+                    .findAny();
+
+            return addr.isPresent();
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    };
+
+    private final Predicate<NetworkInterface> supportsIp6Multicast = nif -> {
+        try {
+            if (!nif.supportsMulticast() || nif.isLoopback())
+                return false;
+
+            Optional<?> addr = ip6Interfaces.get(nif).stream()
+                    .filter(a -> !a.isAnyLocalAddress())
+                    .findAny();
+
+            return addr.isPresent();
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    };
+
+    /**
+     * Returns all addresses on all "functional" interfaces.
+     */
+    public Stream<InetAddress> addresses(NetworkInterface nif) {
+        return Stream.concat(ip4Interfaces.get(nif).stream(),
+                             ip6Interfaces.get(nif).stream());
+    }
+
+    /**
+     * Returns all IPv4 addresses on all "functional" interfaces.
+     */
+    public Stream<Inet4Address> ip4Addresses() {
+        return ip4Interfaces().flatMap(nif -> ip4Addresses(nif));
+    }
+
+    /**
+     * Returns all IPv6 addresses on all "functional" interfaces.
+     */
+    public Stream<Inet6Address> ip6Addresses() {
+        return ip6Interfaces().flatMap(nif -> ip6Addresses(nif));
+    }
+
+    /**
+     * Returns all IPv4 addresses the given interface.
+     */
+    public Stream<Inet4Address> ip4Addresses(NetworkInterface nif) {
+        return ip4Interfaces.get(nif).stream();
+    }
+
+    /**
+     * Returns all IPv6 addresses for the given interface.
+     */
+    public Stream<Inet6Address> ip6Addresses(NetworkInterface nif) {
+        return ip6Interfaces.get(nif).stream();
+    }
+
+    /**
+     * Return a NetworkConfiguration instance.
+     */
+    public static NetworkConfiguration probe() throws IOException {
+        Map<NetworkInterface, List<Inet4Address>> ip4Interfaces = new HashMap<>();
+        Map<NetworkInterface, List<Inet6Address>> ip6Interfaces = new HashMap<>();
+
+        List<NetworkInterface> nifs = list(getNetworkInterfaces());
+        for (NetworkInterface nif : nifs) {
+            // ignore interfaces that are down
+            if (!nif.isUp() || nif.isPointToPoint())
+                continue;
+
+            List<Inet4Address> ip4Addresses = new LinkedList<>();
+            List<Inet6Address> ip6Addresses = new LinkedList<>();
+            ip4Interfaces.put(nif, ip4Addresses);
+            ip6Interfaces.put(nif, ip6Addresses);
+            for (InetAddress addr : list(nif.getInetAddresses())) {
+                if (addr instanceof Inet4Address)
+                    ip4Addresses.add((Inet4Address)addr);
+                else if (addr instanceof Inet6Address)
+                    ip6Addresses.add((Inet6Address)addr);
+            }
+        }
+        return new NetworkConfiguration(ip4Interfaces, ip6Interfaces);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        interfaces().forEach(nif -> sb.append(interfaceInformation(nif)));
+        return sb.toString();
+    }
+
+    /** Returns detailed information for the given interface. */
+    public static String interfaceInformation(NetworkInterface nif) {
+        StringBuilder sb = new StringBuilder();
+        try {
+            sb.append("Display name: " + nif.getDisplayName() + "\n");
+            sb.append("Name: " + nif.getName() + "\n");
+            for (InetAddress inetAddress : list(nif.getInetAddresses()))
+                sb.append("InetAddress: " + inetAddress + "\n");
+            sb.append("Up? " + nif.isUp() + "\n");
+            sb.append("Loopback? " + nif.isLoopback() + "\n");
+            sb.append("PointToPoint? " + nif.isPointToPoint() + "\n");
+            sb.append("Supports multicast? " + nif.supportsMulticast() + "\n");
+            sb.append("Virtual? " + nif.isVirtual() + "\n");
+            sb.append("Hardware address: " +
+                    Arrays.toString(nif.getHardwareAddress()) + "\n");
+            sb.append("MTU: " + nif.getMTU() + "\n");
+            sb.append("Index: " + nif.getIndex() + "\n");
+            sb.append("\n");
+            return sb.toString();
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+
+    /** Prints all the system interface information to the give stream. */
+    public static void printSystemConfiguration(PrintStream out) {
+        try {
+            out.println("*** all system network interface configuration ***");
+            List<NetworkInterface> nifs = list(getNetworkInterfaces());
+            for (NetworkInterface nif : nifs)
+                out.print(interfaceInformation(nif));
+            out.println("*** end ***");
+        } catch (IOException e) {
+            throw new UncheckedIOException(e);
+        }
+    }
+}
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java
index 9cd49ad..b929c5c 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessThread.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 import java.io.PrintWriter;
 
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
 import java.util.function.Predicate;
 
 /**
@@ -195,7 +194,7 @@
          * @return The PID associated with this process runnable
          */
         public long getPid() throws InterruptedException {
-            return getProcess().getPid();
+            return getProcess().pid();
         }
 
         public void sendMessage(String message) throws InterruptedException {
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java
index 224ab0e..d4626fa 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -256,7 +256,7 @@
      * @return Process id
      */
     public static long getProcessId() {
-        return ProcessHandle.current().getPid();
+        return ProcessHandle.current().pid();
     }
 
     /**
@@ -542,8 +542,8 @@
         }
 
         @Override
-        public long getPid() {
-            return p.getPid();
+        public long pid() {
+            return p.pid();
         }
 
         @Override
diff --git a/jdk/test/org/omg/CORBA/OrbPropertiesTest.java b/jdk/test/org/omg/CORBA/OrbPropertiesTest.java
new file mode 100644
index 0000000..977b2e9
--- /dev/null
+++ b/jdk/test/org/omg/CORBA/OrbPropertiesTest.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import org.omg.CORBA.ORB;
+
+/*
+ * @test
+ * @bug 8049375
+ * @summary Extend how the org.omg.CORBA.ORB handles the search for orb.properties
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.*
+ * @modules java.corba
+ * @compile OrbPropertiesTest.java TestOrbImpl.java TestSingletonOrbImpl.java
+ * @run main/othervm
+ *    -Djava.naming.provider.url=iiop://localhost:1050
+ *    -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
+ *    OrbPropertiesTest -port 1049
+ * @run main/othervm/secure=java.lang.SecurityManager/policy=jtreg.test.policy
+ *    -Djava.naming.provider.url=iiop://localhost:3050
+ *    -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
+ *    OrbPropertiesTest -port 3049
+ */
+public class OrbPropertiesTest {
+
+    public static void main(String[] args) throws Exception {
+        updateOrbPropertiesFile();
+        // create and initialize the ORB
+        ORB orb = ORB.init(args, null);
+        if (!(orb instanceof TestOrbImpl)) {
+            throw new RuntimeException("org.omg.CORBA.ORBClass property not set as expected");
+        }
+        ORB singletonOrb = ORB.init();
+        System.out.println("singletonOrb class == " + singletonOrb.getClass().getName());
+        if (!(singletonOrb instanceof TestSingletonOrbImpl)) {
+            throw new RuntimeException("org.omg.CORBA.ORBSingletonClass property not set as expected");
+        }
+
+    }
+
+    private static void updateOrbPropertiesFile() throws Exception {
+        String orbPropertiesFile = System.getProperty("java.home", ".") + "/conf/orb.properties";
+        String orbClassMapping = "org.omg.CORBA.ORBClass TestOrbImpl";
+        String orbSingletonClassMapping = "org.omg.CORBA.ORBSingletonClass TestSingletonOrbImpl";
+        String orbPropertiesMappings = orbClassMapping + "\n" + orbSingletonClassMapping +"\n";
+        try (PrintWriter hfPWriter = new PrintWriter(new BufferedWriter(
+                new FileWriter(orbPropertiesFile, false)))) {
+            hfPWriter.println(orbPropertiesMappings);
+        } catch (IOException ioEx) {
+            ioEx.printStackTrace();
+            throw ioEx;
+        }
+    }
+}
diff --git a/jdk/test/org/omg/CORBA/TestOrbImpl.java b/jdk/test/org/omg/CORBA/TestOrbImpl.java
new file mode 100644
index 0000000..1dd7d66
--- /dev/null
+++ b/jdk/test/org/omg/CORBA/TestOrbImpl.java
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.applet.Applet;
+import java.util.Properties;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.Context;
+import org.omg.CORBA.ContextList;
+import org.omg.CORBA.Environment;
+import org.omg.CORBA.ExceptionList;
+import org.omg.CORBA.NVList;
+import org.omg.CORBA.NamedValue;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Object;
+import org.omg.CORBA.Request;
+import org.omg.CORBA.StructMember;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.UnionMember;
+import org.omg.CORBA.WrongTransaction;
+import org.omg.CORBA.ORBPackage.InvalidName;
+import org.omg.CORBA.portable.OutputStream;
+
+
+public class TestOrbImpl extends ORB{
+
+    @Override
+    protected void set_parameters(String[] args, Properties props) {
+
+    }
+
+    @Override
+    protected void set_parameters(Applet app, Properties props) {
+
+    }
+
+    @Override
+    public String[] list_initial_services() {
+        return null;
+    }
+
+    @Override
+    public Object resolve_initial_references(String object_name)
+            throws InvalidName {
+        return null;
+    }
+
+    @Override
+    public String object_to_string(Object obj) {
+        return null;
+    }
+
+    @Override
+    public Object string_to_object(String str) {
+        return null;
+    }
+
+    @Override
+    public NVList create_list(int count) {
+        return null;
+    }
+
+    @Override
+    public NamedValue create_named_value(String s, Any any, int flags) {
+        return null;
+    }
+
+    @Override
+    public ExceptionList create_exception_list() {
+        return null;
+    }
+
+    @Override
+    public ContextList create_context_list() {
+        return null;
+    }
+
+    @Override
+    public Context get_default_context() {
+        return null;
+    }
+
+    @Override
+    public Environment create_environment() {
+        return null;
+    }
+
+    @Override
+    public OutputStream create_output_stream() {
+        return null;
+    }
+
+    @Override
+    public void send_multiple_requests_oneway(Request[] req) {
+
+    }
+
+    @Override
+    public void send_multiple_requests_deferred(Request[] req) {
+
+    }
+
+    @Override
+    public boolean poll_next_response() {
+        return false;
+    }
+
+    @Override
+    public Request get_next_response() throws WrongTransaction {
+        return null;
+    }
+
+    @Override
+    public TypeCode get_primitive_tc(TCKind tcKind) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_struct_tc(String id, String name,
+            StructMember[] members) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_union_tc(String id, String name,
+            TypeCode discriminator_type, UnionMember[] members) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_enum_tc(String id, String name, String[] members) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_alias_tc(String id, String name,
+            TypeCode original_type) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_exception_tc(String id, String name,
+            StructMember[] members) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_interface_tc(String id, String name) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_string_tc(int bound) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_wstring_tc(int bound) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_sequence_tc(int bound, TypeCode element_type) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_recursive_sequence_tc(int bound, int offset) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_array_tc(int length, TypeCode element_type) {
+        return null;
+    }
+
+    @Override
+    public Any create_any() {
+        return null;
+    }
+
+}
diff --git a/jdk/test/org/omg/CORBA/TestSingletonOrbImpl.java b/jdk/test/org/omg/CORBA/TestSingletonOrbImpl.java
new file mode 100644
index 0000000..fb6a26f
--- /dev/null
+++ b/jdk/test/org/omg/CORBA/TestSingletonOrbImpl.java
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.applet.Applet;
+import java.util.Properties;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.Context;
+import org.omg.CORBA.ContextList;
+import org.omg.CORBA.Environment;
+import org.omg.CORBA.ExceptionList;
+import org.omg.CORBA.NVList;
+import org.omg.CORBA.NamedValue;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Object;
+import org.omg.CORBA.Request;
+import org.omg.CORBA.StructMember;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.UnionMember;
+import org.omg.CORBA.WrongTransaction;
+import org.omg.CORBA.ORBPackage.InvalidName;
+import org.omg.CORBA.portable.OutputStream;
+
+
+public class TestSingletonOrbImpl extends ORB {
+
+    @Override
+    protected void set_parameters(String[] args, Properties props) {
+
+    }
+
+    @Override
+    protected void set_parameters(Applet app, Properties props) {
+
+    }
+
+    @Override
+    public String[] list_initial_services() {
+        return null;
+    }
+
+    @Override
+    public Object resolve_initial_references(String object_name)
+            throws InvalidName {
+        return null;
+    }
+
+    @Override
+    public String object_to_string(Object obj) {
+        return null;
+    }
+
+    @Override
+    public Object string_to_object(String str) {
+        return null;
+    }
+
+    @Override
+    public NVList create_list(int count) {
+        return null;
+    }
+
+    @Override
+    public NamedValue create_named_value(String s, Any any, int flags) {
+        return null;
+    }
+
+    @Override
+    public ExceptionList create_exception_list() {
+        return null;
+    }
+
+    @Override
+    public ContextList create_context_list() {
+        return null;
+    }
+
+    @Override
+    public Context get_default_context() {
+        return null;
+    }
+
+    @Override
+    public Environment create_environment() {
+        return null;
+    }
+
+    @Override
+    public OutputStream create_output_stream() {
+        return null;
+    }
+
+    @Override
+    public void send_multiple_requests_oneway(Request[] req) {
+
+    }
+
+    @Override
+    public void send_multiple_requests_deferred(Request[] req) {
+
+    }
+
+    @Override
+    public boolean poll_next_response() {
+        return false;
+    }
+
+    @Override
+    public Request get_next_response() throws WrongTransaction {
+        return null;
+    }
+
+    @Override
+    public TypeCode get_primitive_tc(TCKind tcKind) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_struct_tc(String id, String name,
+            StructMember[] members) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_union_tc(String id, String name,
+            TypeCode discriminator_type, UnionMember[] members) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_enum_tc(String id, String name, String[] members) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_alias_tc(String id, String name,
+            TypeCode original_type) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_exception_tc(String id, String name,
+            StructMember[] members) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_interface_tc(String id, String name) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_string_tc(int bound) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_wstring_tc(int bound) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_sequence_tc(int bound, TypeCode element_type) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_recursive_sequence_tc(int bound, int offset) {
+        return null;
+    }
+
+    @Override
+    public TypeCode create_array_tc(int length, TypeCode element_type) {
+        return null;
+    }
+
+    @Override
+    public Any create_any() {
+        return null;
+    }
+
+}
diff --git a/jdk/test/org/omg/CORBA/jtreg.test.policy b/jdk/test/org/omg/CORBA/jtreg.test.policy
new file mode 100644
index 0000000..0e24009
--- /dev/null
+++ b/jdk/test/org/omg/CORBA/jtreg.test.policy
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+grant {
+  permission java.util.PropertyPermission "*", "read";
+  permission java.io.FilePermission "<<ALL FILES>>", "read, write, execute";
+};
+
+grant codeBase "file:${test.classes}/*" {
+  permission java.net.SocketPermission "*:*", "connect, accept, listen, resolve";
+  permission java.lang.RuntimePermission "accessClassInPackage.com.sun.jndi.cosnaming";
+};
diff --git a/jdk/test/sanity/client/SwingSet/src/DialogDemoTest.java b/jdk/test/sanity/client/SwingSet/src/DialogDemoTest.java
new file mode 100644
index 0000000..69ee970
--- /dev/null
+++ b/jdk/test/sanity/client/SwingSet/src/DialogDemoTest.java
@@ -0,0 +1,104 @@
+
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import org.jtregext.GuiTestListener;
+import com.sun.swingset3.demos.dialog.DialogDemo;
+import static com.sun.swingset3.demos.dialog.DialogDemo.*;
+import java.awt.Dimension;
+import java.awt.Point;
+import javax.swing.JDialog;
+import static org.testng.AssertJUnit.*;
+import org.testng.annotations.Test;
+import static org.jemmy2ext.JemmyExt.isIconified;
+import static org.jemmy2ext.JemmyExt.ByClassChooser;
+import org.netbeans.jemmy.ClassReference;
+import org.netbeans.jemmy.ComponentChooser;
+import static org.netbeans.jemmy.WindowWaiter.countWindows;
+import org.netbeans.jemmy.operators.JFrameOperator;
+import org.netbeans.jemmy.operators.JDialogOperator;
+import org.netbeans.jemmy.operators.JLabelOperator;
+import org.netbeans.jemmy.operators.JButtonOperator;
+import org.testng.annotations.Listeners;
+
+/*
+ * @test
+ * @key headful
+ * @summary Verifies SwingSet3 DialogDemo by checking that separate JDialog is
+ *          shown, it contains predefined label and no new dialogs are opened
+ *          when the "Show JDialog..." button is clicked.
+ *
+ * @library /sanity/client/lib/jemmy/src
+ * @library /sanity/client/lib/Extensions/src
+ * @library /sanity/client/lib/SwingSet3/src
+ * @modules java.desktop
+ *          java.logging
+ * @build org.jemmy2ext.JemmyExt
+ * @build com.sun.swingset3.demos.dialog.DialogDemo
+ * @run testng DialogDemoTest
+ */
+@Listeners(GuiTestListener.class)
+public class DialogDemoTest {
+
+    private final ComponentChooser jDialogClassChooser = new ByClassChooser(JDialog.class);
+
+    @Test
+    public void test() throws Exception {
+        new ClassReference(DialogDemo.class.getCanonicalName()).startApplication();
+        JFrameOperator mainFrame = new JFrameOperator(DIALOG_DEMO_TITLE);
+        JDialogOperator dialog = new JDialogOperator(DIALOG_TITLE);
+        JButtonOperator showJDialogButton = new JButtonOperator(mainFrame, SHOW_BUTTON_TITLE);
+        initialCheckWithLabel(mainFrame, dialog);
+        checkShowDialogButton(dialog, showJDialogButton);
+        TestHelpers.checkChangeSize(dialog, new Dimension(dialog.getSize().width * 2,
+                dialog.getSize().height * 2));
+        TestHelpers.checkChangeLocation(dialog, new Point(dialog.getLocation().x + 100,
+                dialog.getLocation().y + 100));
+    }
+
+    private void initialCheckWithLabel(JFrameOperator frame, JDialogOperator jdo) {
+        JLabelOperator label = new JLabelOperator(jdo);
+        assertFalse("JFrame is not iconified", isIconified(frame));
+        assertEquals("Only one JDialog is present", 1,
+                countWindows(jDialogClassChooser));
+        assertEquals(LABEL_CONTENT, label.getText());
+    }
+
+    private void checkShowDialogButton(JDialogOperator jdo, JButtonOperator jbo)
+            throws InterruptedException {
+        //Check that the button does not change the number of JDialog
+        jbo.push();
+        Thread.sleep(500);
+        assertEquals("Only one JDialog is present", 1,
+                countWindows(jDialogClassChooser));
+        assertTrue("Check JDialog is visible", jdo.isVisible());
+        jdo.requestClose();
+        jdo.waitClosed();
+        //Check that the button makes the JDialog visible
+        //and that 1 jDialog is present.
+        jbo.push();
+        jdo.waitComponentVisible(true);
+        Thread.sleep(500);
+        assertEquals("Only one JDialog is present", 1,
+                countWindows(jDialogClassChooser));
+    }
+}
diff --git a/jdk/test/sanity/client/SwingSet/src/SliderDemoTest.java b/jdk/test/sanity/client/SwingSet/src/SliderDemoTest.java
new file mode 100644
index 0000000..092743c
--- /dev/null
+++ b/jdk/test/sanity/client/SwingSet/src/SliderDemoTest.java
@@ -0,0 +1,235 @@
+
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import org.jtregext.GuiTestListener;
+import com.sun.swingset3.demos.slider.SliderDemo;
+import java.awt.Component;
+import java.awt.event.KeyEvent;
+import java.util.function.Predicate;
+
+import static org.testng.AssertJUnit.*;
+import org.testng.annotations.Test;
+import org.netbeans.jemmy.ClassReference;
+import org.netbeans.jemmy.ComponentChooser;
+import org.netbeans.jemmy.operators.JFrameOperator;
+import org.netbeans.jemmy.operators.JSliderOperator;
+import org.netbeans.jemmy.accessibility.AccessibleNameChooser;
+import static com.sun.swingset3.demos.slider.SliderDemo.*;
+import org.testng.annotations.Listeners;
+
+/*
+ * @test
+ * @key headful
+ * @summary Verifies SwingSet3 SliderDemo by moving the sliders through
+ *  different means, checking the slider value corresponding to it,
+ *  checking maximum and minimum values, checking Snap to tick is working
+ *  and checking the presence of ticks and labels.
+ *
+ * @library /sanity/client/lib/jemmy/src
+ * @library /sanity/client/lib/Extensions/src
+ * @library /sanity/client/lib/SwingSet3/src
+ * @modules java.desktop
+ *          java.logging
+ * @build org.jemmy2ext.JemmyExt
+ * @build com.sun.swingset3.demos.slider.SliderDemo
+ * @run testng SliderDemoTest
+ */
+@Listeners(GuiTestListener.class)
+public class SliderDemoTest {
+
+    private static final int PLAIN_SLIDER_MINIMUM = -10;
+    private static final int PLAIN_SLIDER_MAXIMUM = 100;
+    private static final int HORIZONTAL_MINOR_TICKS_SLIDER_MINIMUM = 0;
+    private static final int HORIZONTAL_MINOR_TICKS_SLIDER_MAXIMUM = 11;
+    private static final int VERTICAL_MINOR_TICKS_SLIDER_MINIMUM = 0;
+    private static final int VERTICAL_MINOR_TICKS_SLIDER_MAXIMUM = 100;
+
+    @Test
+    public void test() throws Exception {
+        new ClassReference(SliderDemo.class.getCanonicalName()).startApplication();
+        JFrameOperator frame = new JFrameOperator(DEMO_TITLE);
+        plain(frame, HORIZONTAL_PLAIN_SLIDER);
+        majorTicks(frame, HORIZONTAL_MAJOR_TICKS_SLIDER);
+        minorTicks(frame, HORIZONTAL_MINOR_TICKS_SLIDER);
+        disabled(frame, HORIZONTAL_DISABLED_SLIDER);
+        plain(frame, VERTICAL_PLAIN_SLIDER);
+        majorTicks(frame, VERTICAL_MAJOR_TICKS_SLIDER);
+        minorTicks(frame, VERTICAL_MINOR_TICKS_SLIDER);
+        disabled(frame, VERTICAL_DISABLED_SLIDER);
+    }
+
+    private void plain(JFrameOperator jfo, String accessibleName) {
+        JSliderOperator jso = new JSliderOperator(jfo,
+                new AccessibleNameChooser(accessibleName));
+        if (accessibleName.equals(HORIZONTAL_PLAIN_SLIDER)) {
+            checkKeyboard(jso);
+            checkMouse(jso);
+        }
+        checkMaximum(jso, PLAIN_SLIDER_MAXIMUM);
+        checkMinimum(jso, PLAIN_SLIDER_MINIMUM);
+        checkMoveForward(jso, 10);
+    }
+
+    private void majorTicks(JFrameOperator jfo, String accessibleName) {
+        JSliderOperator jso = new JSliderOperator(jfo,
+                new AccessibleNameChooser(accessibleName));
+        checkMoveForward(jso, 40);
+        assertTrue(jso.getPaintTicks());
+        assertEquals(100, jso.getMajorTickSpacing());
+    }
+
+    private void minorTicks(JFrameOperator jfo, String accessibleName) {
+        JSliderOperator jso = new JSliderOperator(jfo,
+                new AccessibleNameChooser(accessibleName));
+        if (accessibleName.equals(HORIZONTAL_MINOR_TICKS_SLIDER)) {
+            checkMaximum(jso, HORIZONTAL_MINOR_TICKS_SLIDER_MAXIMUM);
+            checkMinimum(jso, HORIZONTAL_MINOR_TICKS_SLIDER_MINIMUM);
+            checkMoveForward(jso, 2);
+            checkSnapToTick(jso, 5, 6);
+            assertEquals(5, jso.getMajorTickSpacing());
+            assertEquals(1, jso.getMinorTickSpacing());
+        } else {
+            checkMaximum(jso, VERTICAL_MINOR_TICKS_SLIDER_MAXIMUM);
+            checkMinimum(jso, VERTICAL_MINOR_TICKS_SLIDER_MINIMUM);
+            checkMoveForward(jso, 10);
+            assertEquals(20, jso.getMajorTickSpacing());
+            assertEquals(5, jso.getMinorTickSpacing());
+        }
+        assertTrue(jso.getPaintTicks());
+        assertTrue(jso.getPaintLabels());
+    }
+
+    private void disabled(JFrameOperator jfo, String accessibleName)
+            throws InterruptedException {
+        JSliderOperator jso = new JSliderOperator(jfo,
+                new AccessibleNameChooser(accessibleName));
+        int initialvalue;
+        initialvalue = jso.getValue();
+        jso.clickMouse(jso.getCenterXForClick(), jso.getCenterYForClick(), 10);
+        Thread.sleep(500);
+        assertFalse(jso.hasFocus());
+        assertEquals(initialvalue, jso.getValue());
+    }
+
+    private void checkMaximum(JSliderOperator jso, int maxValue) {
+        jso.scrollToMaximum();
+        waitSliderValue(jso, jSlider -> jSlider.getValue() == maxValue);
+    }
+
+    private void checkMinimum(JSliderOperator jso, int minValue) {
+        jso.scrollToMinimum();
+        waitSliderValue(jso, jSlider -> jSlider.getValue() == minValue);
+    }
+
+    private void checkKeyboard(JSliderOperator jso) {
+        checkKeyPress(jso, KeyEvent.VK_HOME,
+                jSlider -> jSlider.getValue() == jso.getMinimum());
+
+        {
+            int expectedValue = jso.getValue() + 1;
+            checkKeyPress(jso, KeyEvent.VK_UP,
+                    jSlider -> jSlider.getValue() >= expectedValue);
+        }
+        {
+            int expectedValue = jso.getValue() + 1;
+            checkKeyPress(jso, KeyEvent.VK_RIGHT,
+                    jSlider -> jSlider.getValue() >= expectedValue);
+        }
+        {
+            int expectedValue = jso.getValue() + 11;
+            checkKeyPress(jso, KeyEvent.VK_PAGE_UP,
+                    jSlider -> jSlider.getValue() >= expectedValue);
+        }
+
+        checkKeyPress(jso, KeyEvent.VK_END,
+                jSlider -> jSlider.getValue() == jso.getMaximum());
+
+        {
+            int expectedValue = jso.getValue() - 1;
+            checkKeyPress(jso, KeyEvent.VK_DOWN,
+                    jSlider -> jSlider.getValue() <= expectedValue);
+        }
+        {
+            int expectedValue = jso.getValue() - 1;
+            checkKeyPress(jso, KeyEvent.VK_LEFT,
+                    jSlider -> jSlider.getValue() <= expectedValue);
+        }
+        {
+            int expectedValue = jso.getValue() - 11;
+            checkKeyPress(jso, KeyEvent.VK_PAGE_DOWN,
+                    jSlider -> jSlider.getValue() <= expectedValue);
+        }
+    }
+
+    private void checkKeyPress(JSliderOperator jso, int keyCode,
+            Predicate<JSliderOperator> predicate) {
+        jso.pushKey(keyCode);
+        waitSliderValue(jso, predicate);
+    }
+
+    private void waitSliderValue(JSliderOperator jso,
+            Predicate<JSliderOperator> predicate) {
+        jso.waitState(new ComponentChooser() {
+            public boolean checkComponent(Component comp) {
+                return predicate.test(jso);
+            }
+
+            public String getDescription() {
+                return "Wait till Slider attains the specified state.";
+            }
+        });
+    }
+
+    private void checkMoveForward(JSliderOperator jso, int value) {
+        jso.setValue(jso.getMinimum());
+        int finalValue = jso.getValue() + value;
+        jso.scrollToValue(finalValue);
+        waitSliderValue(jso, jSlider -> jSlider.getValue() == finalValue);
+    }
+
+    private void checkSnapToTick(JSliderOperator jso, int expectedLower,
+            int expectedHigher) {
+        jso.pressMouse(jso.getCenterXForClick(), jso.getCenterYForClick());
+        waitSliderValue(jso, jSlider -> jSlider.getValue() == expectedLower
+                || jSlider.getValue() == expectedHigher);
+        jso.releaseMouse();
+    }
+
+    private void checkMouse(JSliderOperator jso) {
+        // Check mouse dragging by pressing on the center of Slider and then
+        // dragging the mouse till the end of the track.
+        // We set the initial value of the slider as 45,
+        // which is the value of the slider at the middle.
+        jso.setValue((jso.getMaximum() + jso.getMinimum()) / 2);
+        jso.pressMouse(jso.getCenterXForClick(), jso.getCenterYForClick());
+        jso.dragMouse(jso.getWidth() + 10, jso.getHeight());
+        waitSliderValue(jso, jSlider -> jSlider.getValue() == jSlider.getMaximum());
+        jso.releaseMouse();
+
+        // Check mouse click by clicking on the center of the track 2 times
+        // and waiting till the slider value has changed from its previous
+        // value as a result of the clicks.
+        jso.clickMouse(jso.getCenterXForClick(), jso.getCenterYForClick(), 2);
+        waitSliderValue(jso, jSlider -> jSlider.getValue() != jSlider.getMaximum());
+    }
+}
diff --git a/jdk/test/sanity/client/SwingSet/src/TestHelpers.java b/jdk/test/sanity/client/SwingSet/src/TestHelpers.java
new file mode 100644
index 0000000..24c2e9d
--- /dev/null
+++ b/jdk/test/sanity/client/SwingSet/src/TestHelpers.java
@@ -0,0 +1,24 @@
+
+import java.awt.Dimension;
+import java.awt.Point;
+
+import org.netbeans.jemmy.operators.ComponentOperator;
+
+public class TestHelpers {
+
+    public static void checkChangeLocation(ComponentOperator component,
+            Point finalLocation) {
+        Point initialLocation = component.getLocation();
+        component.setLocation(finalLocation);
+        component.waitComponentLocation(finalLocation);
+        component.setLocation(initialLocation);
+    }
+
+    public static void checkChangeSize(ComponentOperator component,
+            Dimension dimensionFinal) {
+        Dimension dimensionInitial = component.getSize();
+        component.setSize(dimensionFinal);
+        component.waitComponentSize(dimensionFinal);
+        component.setSize(dimensionInitial);
+    }
+}
diff --git a/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/dialog/DialogDemo.java b/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/dialog/DialogDemo.java
new file mode 100644
index 0000000..4ff166c
--- /dev/null
+++ b/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/dialog/DialogDemo.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.swingset3.demos.dialog;
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+import com.sun.swingset3.DemoProperties;
+import com.sun.swingset3.demos.DemoUtilities;
+import com.sun.swingset3.demos.ResourceManager;
+import com.sun.swingset3.demos.slider.SliderDemo;
+
+/**
+ *
+ * @author aim
+ */
+@DemoProperties(
+        value = "JDialog Demo",
+        category = "Toplevel Containers",
+        description = "Demonstrates JDialog, Swing's top-level dialog container.",
+        sourceFiles = {
+            "com/sun/swingset3/demos/dialog/DialogDemo.java",
+            "com/sun/swingset3/demos/DemoUtilities.java",
+            "com/sun/swingset3/demos/dialog/resources/images/DialogDemo.gif"
+        }
+)
+public class DialogDemo extends JPanel {
+
+    private JDialog dialog;
+    private JComponent dialogSpaceholder;
+
+    public static final String DIALOG_TITLE = "Demo JDialog";
+    public static final String SHOW_BUTTON_TITLE = "Show JDialog...";
+    public static final String LABEL_CONTENT = "I'm content.";
+    public static final String DIALOG_DEMO_TITLE = DialogDemo.class
+            .getAnnotation(DemoProperties.class).value();
+
+    public DialogDemo() {
+        initComponents();
+    }
+
+    protected void initComponents() {
+        dialog = createDialog();
+
+        setLayout(new BorderLayout());
+
+        add(createControlPanel(), BorderLayout.WEST);
+        dialogSpaceholder = createDialogSpaceholder(dialog);
+        add(dialogSpaceholder, BorderLayout.CENTER);
+    }
+
+    private static JComponent createDialogSpaceholder(JDialog dialog) {
+        // Create placeholder panel to provide space in which to
+        // display the toplevel dialog so that the control panel is not
+        // obscured by it.
+        JPanel placeholder = new JPanel();
+        Dimension prefSize = dialog.getPreferredSize();
+        prefSize.width += 12;
+        prefSize.height += 12;
+        placeholder.setPreferredSize(prefSize);
+        return placeholder;
+    }
+
+    protected JComponent createControlPanel() {
+        // Create control panel on Left
+        Box panel = Box.createVerticalBox();
+        panel.setBorder(new EmptyBorder(8, 8, 8, 8));
+
+        // Create button to control visibility of frame
+        JButton showButton = new JButton(SHOW_BUTTON_TITLE);
+        showButton.addActionListener(new ShowActionListener());
+        panel.add(showButton);
+
+        return panel;
+    }
+
+    private static JDialog createDialog() {
+
+        //<snip>Create dialog
+        JDialog dialog = new JDialog(new JFrame(), DIALOG_TITLE, false);
+        //</snip>
+
+        //<snip>Add dialog's content
+        JLabel label = new JLabel(LABEL_CONTENT);
+        label.setHorizontalAlignment(JLabel.CENTER);
+        label.setPreferredSize(new Dimension(200, 140));
+        dialog.add(label);
+        //</snip>
+
+        //<snip>Initialize dialog's size
+        // which will shrink-to-fit its contents
+        dialog.pack();
+        //</snip>
+
+        return dialog;
+    }
+
+    public void start() {
+        DemoUtilities.setToplevelLocation(dialog, dialogSpaceholder, SwingConstants.CENTER);
+        showDialog();
+    }
+
+    public void stop() {
+        //<snip>Hide dialog
+        dialog.setVisible(false);
+        //</snip>
+    }
+
+    public void showDialog() {
+        //<snip>Show dialog
+        // if dialog already visible, then bring to the front
+        if (dialog.isShowing()) {
+            dialog.toFront();
+        } else {
+            dialog.setVisible(true);
+        }
+        //</snip>
+    }
+
+    private class ShowActionListener implements ActionListener {
+
+        public void actionPerformed(ActionEvent actionEvent) {
+            showDialog();
+        }
+    }
+
+    public static void main(String args[]) {
+        EventQueue.invokeLater(new Runnable() {
+            public void run() {
+                JFrame frame = new JFrame(DIALOG_DEMO_TITLE);
+                DialogDemo demo = new DialogDemo();
+                frame.add(demo);
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                frame.pack();
+                frame.setVisible(true);
+                demo.start();
+            }
+        });
+    }
+}
diff --git a/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/slider/SliderDemo.java b/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/slider/SliderDemo.java
new file mode 100644
index 0000000..7bec4af
--- /dev/null
+++ b/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/slider/SliderDemo.java
@@ -0,0 +1,280 @@
+/*
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.swingset3.demos.slider;
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.border.BevelBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import com.sun.swingset3.DemoProperties;
+import com.sun.swingset3.demos.ResourceManager;
+import com.sun.swingset3.demos.textfield.TextFieldDemo;
+
+/**
+ * JSlider Demo
+ *
+ * @version 1.9 11/17/05
+ * @author Dave Kloba
+ * @author Jeff Dinkins
+ */
+@DemoProperties(
+        value = "Slider Demo",
+        category = "Controls",
+        description = "Demonstrates the JSlider, a control which supports linear adjustment",
+        sourceFiles = {
+            "com/sun/swingset3/demos/slider/SliderDemo.java",
+            "com/sun/swingset3/demos/ResourceManager.java",
+            "com/sun/swingset3/demos/slider/resources/SliderDemo.properties",
+            "com/sun/swingset3/demos/slider/resources/images/SliderDemo.gif"
+        }
+)
+public class SliderDemo extends JPanel {
+
+    private static final Dimension HGAP5 = new Dimension(5, 1);
+    private static final Dimension VGAP5 = new Dimension(1, 5);
+    private static final Dimension HGAP10 = new Dimension(10, 1);
+    private static final Dimension VGAP10 = new Dimension(1, 10);
+    private static final Dimension HGAP20 = new Dimension(20, 1);
+    private static final Dimension HGAP25 = new Dimension(25, 1);
+    private final ResourceManager resourceManager = new ResourceManager(this.getClass());
+    public static final String DEMO_TITLE = SliderDemo.class.getAnnotation(DemoProperties.class).value();
+    public static final String HORIZONTAL_PLAIN_SLIDER = "Horizontal Plain Slider";
+    public static final String HORIZONTAL_MAJOR_TICKS_SLIDER = "Horizontal Major Ticks Slider";
+    public static final String HORIZONTAL_MINOR_TICKS_SLIDER = "Horizontal Minor Ticks Slider";
+    public static final String HORIZONTAL_DISABLED_SLIDER = "Horizontal Disabled Slider";
+    public static final String VERTICAL_PLAIN_SLIDER = "Vertical Plain Slider";
+    public static final String VERTICAL_MAJOR_TICKS_SLIDER = "Vertical Major Ticks Slider";
+    public static final String VERTICAL_MINOR_TICKS_SLIDER = "Vertical Minor Ticks Slider";
+    public static final String VERTICAL_DISABLED_SLIDER = "Vertical Disabled Slider";
+
+    /**
+     * main method allows us to run as a standalone demo.
+     */
+    public static void main(String[] args) {
+        JFrame frame = new JFrame(SliderDemo.class.getAnnotation(DemoProperties.class).value());
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.getContentPane().add(new SliderDemo());
+        frame.setPreferredSize(new Dimension(800, 600));
+        frame.pack();
+        frame.setLocationRelativeTo(null);
+        frame.setVisible(true);
+    }
+
+    /**
+     * SliderDemo Constructor
+     */
+    public SliderDemo() {
+        createSliderDemo();
+    }
+
+    private void createSliderDemo() {
+        JSlider s;
+        JPanel hp;
+        JPanel vp;
+        GridLayout g;
+        JPanel tp;
+        JLabel tf;
+        ChangeListener listener;
+
+        setLayout(new BorderLayout());
+        tf = new JLabel(resourceManager.getString("SliderDemo.slidervalue"));
+        add(tf, BorderLayout.SOUTH);
+        tp = new JPanel();
+        g = new GridLayout(1, 2);
+        g.setHgap(5);
+        g.setVgap(5);
+        tp.setLayout(g);
+        add(tp, BorderLayout.CENTER);
+        listener = new SliderListener(tf);
+        BevelBorder border = new BevelBorder(BevelBorder.LOWERED);
+        hp = new JPanel();
+        hp.setLayout(new BoxLayout(hp, BoxLayout.Y_AXIS));
+        hp.setBorder(new TitledBorder(
+                border,
+                resourceManager.getString("SliderDemo.horizontal"),
+                TitledBorder.LEFT,
+                TitledBorder.ABOVE_TOP));
+        tp.add(hp);
+        vp = new JPanel();
+        vp.setLayout(new BoxLayout(vp, BoxLayout.X_AXIS));
+        vp.setBorder(new TitledBorder(
+                border,
+                resourceManager.getString("SliderDemo.vertical"),
+                TitledBorder.LEFT,
+                TitledBorder.ABOVE_TOP));
+        tp.add(vp);
+
+        // Horizontal Slider 1
+        JPanel p = new JPanel();
+        p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
+        p.setBorder(new TitledBorder(resourceManager.getString("SliderDemo.plain")));
+        s = new JSlider(-10, 100, 20);
+        s.getAccessibleContext().setAccessibleName(HORIZONTAL_PLAIN_SLIDER);
+        s.getAccessibleContext().setAccessibleDescription(resourceManager.getString("SliderDemo.a_plain_slider"));
+        s.addChangeListener(listener);
+        p.add(Box.createRigidArea(VGAP5));
+        p.add(s);
+        p.add(Box.createRigidArea(VGAP5));
+        hp.add(p);
+        hp.add(Box.createRigidArea(VGAP10));
+
+        // Horizontal Slider 2
+        p = new JPanel();
+        p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
+        p.setBorder(new TitledBorder(resourceManager.getString("SliderDemo.majorticks")));
+        s = new JSlider(100, 1000, 400);
+        s.setPaintTicks(true);
+        s.setMajorTickSpacing(100);
+        s.getAccessibleContext().setAccessibleName(HORIZONTAL_MAJOR_TICKS_SLIDER);
+        s.getAccessibleContext().setAccessibleDescription(resourceManager.getString("SliderDemo.majorticksdescription"));
+        s.addChangeListener(listener);
+        p.add(Box.createRigidArea(VGAP5));
+        p.add(s);
+        p.add(Box.createRigidArea(VGAP5));
+        hp.add(p);
+        hp.add(Box.createRigidArea(VGAP10));
+
+        // Horizontal Slider 3
+        p = new JPanel();
+        p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
+        p.setBorder(new TitledBorder(resourceManager.getString("SliderDemo.ticks")));
+        s = new JSlider(0, 11, 6);
+        s.putClientProperty("JSlider.isFilled", Boolean.TRUE);
+        s.setPaintTicks(true);
+        s.setMajorTickSpacing(5);
+        s.setMinorTickSpacing(1);
+        s.setPaintLabels(true);
+        s.setSnapToTicks(true);
+        s.getLabelTable().put(new Integer(11), new JLabel(Integer.toString(11), JLabel.CENTER));
+        s.setLabelTable(s.getLabelTable());
+        s.getAccessibleContext().setAccessibleName(HORIZONTAL_MINOR_TICKS_SLIDER);
+        s.getAccessibleContext().setAccessibleDescription(resourceManager.getString("SliderDemo.minorticksdescription"));
+        s.addChangeListener(listener);
+        p.add(Box.createRigidArea(VGAP5));
+        p.add(s);
+        p.add(Box.createRigidArea(VGAP5));
+        hp.add(p);
+        hp.add(Box.createRigidArea(VGAP10));
+
+        // Horizontal Slider 4
+        p = new JPanel();
+        p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
+        p.setBorder(new TitledBorder(resourceManager.getString("SliderDemo.disabled")));
+        BoundedRangeModel brm = new DefaultBoundedRangeModel(80, 0, 0, 100);
+        s = new JSlider(brm);
+        s.setPaintTicks(true);
+        s.setMajorTickSpacing(20);
+        s.setMinorTickSpacing(5);
+        s.setEnabled(false);
+        s.getAccessibleContext().setAccessibleName(HORIZONTAL_DISABLED_SLIDER);
+        s.getAccessibleContext().setAccessibleDescription(resourceManager.getString("SliderDemo.disableddescription"));
+        s.addChangeListener(listener);
+        p.add(Box.createRigidArea(VGAP5));
+        p.add(s);
+        p.add(Box.createRigidArea(VGAP5));
+        hp.add(p);
+
+        //////////////////////////////////////////////////////////////////////////////
+        // Vertical Slider 1
+        p = new JPanel();
+        p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
+        p.setBorder(new TitledBorder(resourceManager.getString("SliderDemo.plain")));
+        s = new JSlider(JSlider.VERTICAL, -10, 100, 20);
+        s.getAccessibleContext().setAccessibleName(VERTICAL_PLAIN_SLIDER);
+        s.getAccessibleContext().setAccessibleDescription(resourceManager.getString("SliderDemo.a_plain_slider"));
+        s.addChangeListener(listener);
+        p.add(Box.createRigidArea(HGAP10));
+        p.add(s);
+        p.add(Box.createRigidArea(HGAP10));
+        vp.add(p);
+        vp.add(Box.createRigidArea(HGAP10));
+
+        // Vertical Slider 2
+        p = new JPanel();
+        p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
+        p.setBorder(new TitledBorder(resourceManager.getString("SliderDemo.majorticks")));
+        s = new JSlider(JSlider.VERTICAL, 100, 1000, 400);
+        s.putClientProperty("JSlider.isFilled", Boolean.TRUE);
+        s.setPaintTicks(true);
+        s.setMajorTickSpacing(100);
+        s.getAccessibleContext().setAccessibleName(VERTICAL_MAJOR_TICKS_SLIDER);
+        s.getAccessibleContext().setAccessibleDescription(resourceManager.getString("SliderDemo.majorticksdescription"));
+        s.addChangeListener(listener);
+        p.add(Box.createRigidArea(HGAP25));
+        p.add(s);
+        p.add(Box.createRigidArea(HGAP25));
+        vp.add(p);
+        vp.add(Box.createRigidArea(HGAP5));
+
+        // Vertical Slider 3
+        p = new JPanel();
+        p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
+        p.setBorder(new TitledBorder(resourceManager.getString("SliderDemo.minorticks")));
+        s = new JSlider(JSlider.VERTICAL, 0, 100, 60);
+        s.setPaintTicks(true);
+        s.setMajorTickSpacing(20);
+        s.setMinorTickSpacing(5);
+        s.setPaintLabels(true);
+        s.getAccessibleContext().setAccessibleName(VERTICAL_MINOR_TICKS_SLIDER);
+        s.getAccessibleContext().setAccessibleDescription(resourceManager.getString("SliderDemo.minorticksdescription"));
+        s.addChangeListener(listener);
+        p.add(Box.createRigidArea(HGAP10));
+        p.add(s);
+        p.add(Box.createRigidArea(HGAP10));
+        vp.add(p);
+        vp.add(Box.createRigidArea(HGAP5));
+
+        // Vertical Slider 4
+        p = new JPanel();
+        p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
+        p.setBorder(new TitledBorder(resourceManager.getString("SliderDemo.disabled")));
+        s = new JSlider(JSlider.VERTICAL, 0, 100, 80);
+        s.setPaintTicks(true);
+        s.setMajorTickSpacing(20);
+        s.setMinorTickSpacing(5);
+        s.setEnabled(false);
+        s.getAccessibleContext().setAccessibleName(VERTICAL_DISABLED_SLIDER);
+        s.getAccessibleContext().setAccessibleDescription(resourceManager.getString("SliderDemo.disableddescription"));
+        s.addChangeListener(listener);
+        p.add(Box.createRigidArea(HGAP20));
+        p.add(s);
+        p.add(Box.createRigidArea(HGAP20));
+        vp.add(p);
+    }
+
+    private class SliderListener implements ChangeListener {
+
+        private final JLabel tf;
+
+        public SliderListener(JLabel f) {
+            tf = f;
+        }
+
+        public void stateChanged(ChangeEvent e) {
+            JSlider s1 = (JSlider) e.getSource();
+            tf.setText(resourceManager.getString("SliderDemo.slidervalue") + s1.getValue());
+        }
+    }
+}
diff --git a/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/slider/resources/SliderDemo.properties b/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/slider/resources/SliderDemo.properties
new file mode 100644
index 0000000..7d3cd7e
--- /dev/null
+++ b/jdk/test/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/slider/resources/SliderDemo.properties
@@ -0,0 +1,18 @@
+### Slider Demo ###
+
+SliderDemo.accessible_description=This demo shows an example of using the JSlider component.
+SliderDemo.tooltip=JSlider demo
+SliderDemo.name=Slider Demo
+
+SliderDemo.slidervalue=Slider Value:
+SliderDemo.horizontal=Horizontal
+SliderDemo.vertical=Vertical
+SliderDemo.plain=Plain
+SliderDemo.a_plain_slider=A Plain Slider
+SliderDemo.majorticks=Major Ticks
+SliderDemo.majorticksdescription=A slider showing major tick marks
+SliderDemo.ticks=Minor Ticks, Snap-to-ticks and Labels
+SliderDemo.minorticks=Minor Ticks
+SliderDemo.minorticksdescription=A slider showing major and minor tick marks, with slider action snapping to tick marks, with some ticks visibly labeled
+SliderDemo.disabled=Disabled
+SliderDemo.disableddescription=A slider showing major and minor tick marks that is not enabled (cannot be manipulated
diff --git a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/WindowWaiter.java b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/WindowWaiter.java
index 7d48000..4ca6949 100644
--- a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/WindowWaiter.java
+++ b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/WindowWaiter.java
@@ -25,6 +25,7 @@
 import java.awt.Component;
 import java.awt.Frame;
 import java.awt.Window;
+import java.util.stream.Stream;
 
 /**
  * A WindowWaiter is a utility class used to look or wait for Windows. It
@@ -282,6 +283,91 @@
         return waitWindow(o, ch, 0);
     }
 
+    /**
+     * Wait till the count of windows which meet the the search criteria becomes
+     * equal to count.
+     *
+     * @param ch a component chooser used to define and apply the search
+     * criteria.
+     * @param count the number of expected windows meeting the search criteria.
+     * @throws InterruptedException
+     */
+    public static void waitWindowCount(ComponentChooser ch, int count)
+            throws InterruptedException {
+        waitWindowCount(null, ch, count);
+    }
+
+    /**
+     * Wait till the count of windows which meet the the search criteria becomes
+     * equal to count.
+     *
+     * @param owner The owner window of all the windows to be checked
+     * @param ch a component chooser used to define and apply the search
+     * criteria.
+     * @param count the number of expected windows meeting the search criteria.
+     * @throws InterruptedException
+     */
+    public static void waitWindowCount(Window owner, ComponentChooser ch, int count)
+            throws InterruptedException {
+        Waiter<String, Void> stateWaiter = new Waiter<>(new Waitable<String, Void>() {
+            @Override
+            public String actionProduced(Void obj) {
+                return countWindows(owner, ch) == count ? "" : null;
+            }
+
+            @Override
+            public String getDescription() {
+                return "Wait till the count of windows matching the criteria "
+                        + "specified by ComponentChooser reaches :" + count;
+            }
+
+            @Override
+            public String toString() {
+                return "Operator.waitState.Waitable{description = "
+                        + getDescription() + '}';
+            }
+        });
+        stateWaiter.waitAction(null);
+    }
+
+    /**
+     * Counts all the windows owned by the owner window which match the
+     * criterion specified by component chooser.
+     *
+     * @param owner The owner window of all the windows to be checked
+     * @param ch A component chooser used to define and apply the search
+     * criteria
+     * @return the number of matched windows
+     */
+    public static int countWindows(Window owner, ComponentChooser ch) {
+        return new QueueTool().invokeAndWait(new QueueTool.QueueAction<Integer>(null) {
+
+            @Override
+            public Integer launch() {
+                Window[] windows;
+                if (owner == null) {
+                    windows = Window.getWindows();
+                } else {
+                    windows = owner.getOwnedWindows();
+                }
+                return (int) Stream.of(windows)
+                        .filter(x -> ch.checkComponent(x)).count();
+            }
+        });
+    }
+
+    /**
+     * Counts all the windows which match the criterion specified by component
+     * chooser.
+     *
+     * @param ch A component chooser used to define and apply the search
+     * criteria
+     * @return the number of matched windows
+     */
+    public static int countWindows(ComponentChooser ch) {
+        return countWindows(null, ch);
+    }
+
     @Override
     public String getDescription() {
         return chooser.getDescription();
diff --git a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/scrolling/JSliderAPIDriver.java b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/scrolling/JSliderAPIDriver.java
index 290c431..9fbff80 100644
--- a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/scrolling/JSliderAPIDriver.java
+++ b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/scrolling/JSliderAPIDriver.java
@@ -66,20 +66,15 @@
         if (adj.getScrollDirection() == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
             newValue = (scroll.getValue() > scroll.getMinimum()
                     + getUnitIncrement(scroll))
-                    ? scroll.getValue() - getUnitIncrement(scroll)
-                    : scroll.getMinimum();
+                            ? scroll.getValue() - getUnitIncrement(scroll)
+                            : scroll.getMinimum();
+            scroll.setValue(newValue);
         } else if (adj.getScrollDirection() == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
             newValue = (scroll.getValue() < scroll.getMaximum()
                     - getUnitIncrement(scroll))
-                    ? scroll.getValue() + getUnitIncrement(scroll)
-                    : scroll.getMaximum();
-        }
-        setValue(oper, newValue);
-    }
-
-    private void setValue(ComponentOperator oper, int value) {
-        if (value != -1) {
-            ((JSliderOperator) oper).setValue(value);
+                            ? scroll.getValue() + getUnitIncrement(scroll)
+                            : scroll.getMaximum();
+            scroll.setValue(newValue);
         }
     }
 
@@ -96,15 +91,16 @@
         if (adj.getScrollDirection() == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
             newValue = (scroll.getValue() > scroll.getMinimum()
                     + getBlockIncrement(scroll))
-                    ? scroll.getValue() - getBlockIncrement(scroll)
-                    : scroll.getMinimum();
+                            ? scroll.getValue() - getBlockIncrement(scroll)
+                            : scroll.getMinimum();
+            scroll.setValue(newValue);
         } else if (adj.getScrollDirection() == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
             newValue = (scroll.getValue() < scroll.getMaximum()
                     - getBlockIncrement(scroll))
-                    ? scroll.getValue() + getBlockIncrement(scroll)
-                    : scroll.getMaximum();
+                            ? scroll.getValue() + getBlockIncrement(scroll)
+                            : scroll.getMaximum();
+            scroll.setValue(newValue);
         }
-        setValue(oper, newValue);
     }
 
     @Override
diff --git a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/windows/DefaultFrameDriver.java b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/windows/DefaultFrameDriver.java
index 055bc87..0152050 100644
--- a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/windows/DefaultFrameDriver.java
+++ b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/drivers/windows/DefaultFrameDriver.java
@@ -22,9 +22,7 @@
  */
 package org.netbeans.jemmy.drivers.windows;
 
-import java.awt.Dimension;
 import java.awt.Frame;
-import java.awt.Toolkit;
 import java.awt.Window;
 import java.awt.event.WindowEvent;
 
@@ -61,16 +59,28 @@
         ((FrameOperator) oper).setState(Frame.NORMAL);
     }
 
+    /** Maximizes the frame.
+     *
+     * @param oper Frame operator.
+     * @throws UnsupportedOperatorException if operator class name is not in
+     *         the list of supported classes names
+     */
     @Override
     public void maximize(ComponentOperator oper) {
         checkSupported(oper);
-        oper.setLocation(0, 0);
-        Dimension ssize = Toolkit.getDefaultToolkit().getScreenSize();
-        oper.setSize(ssize.width, ssize.height);
+        ((FrameOperator) oper).setExtendedState(Frame.MAXIMIZED_BOTH);
     }
 
+    /** Demaximizes the frame.
+     *
+     * @param oper Frame operator.
+     * @throws UnsupportedOperatorException if operator class name is not in
+     *         the list of supported classes names
+     */
     @Override
     public void demaximize(ComponentOperator oper) {
         checkSupported(oper);
+        ((FrameOperator) oper).setExtendedState(Frame.NORMAL);
     }
+
 }
diff --git a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/ComponentOperator.java b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/ComponentOperator.java
index 804ad6e..3d647ed 100644
--- a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/ComponentOperator.java
+++ b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/ComponentOperator.java
@@ -57,6 +57,8 @@
 import java.util.Hashtable;
 import java.util.Locale;
 
+import static java.lang.Math.abs;
+
 import org.netbeans.jemmy.CharBindingMap;
 import org.netbeans.jemmy.ComponentChooser;
 import org.netbeans.jemmy.ComponentSearcher;
@@ -1137,6 +1139,87 @@
     }
 
     /**
+     * Wait till the Size of the component becomes as expected.
+     *
+     * @param exactSize the exact expected size.
+     */
+    public void waitComponentSize(Dimension exactSize) {
+        waitComponentSize(exactSize, exactSize);
+    }
+
+    /**
+     * Wait till the Size of the component becomes between minSize and maxSize.
+     *
+     * @param minSize the minimum allowed size.
+     * @param maxSize the maximum allowed size.
+     */
+    public void waitComponentSize(Dimension minSize, Dimension maxSize) {
+        waitState(new ComponentChooser() {
+            @Override
+            public boolean checkComponent(Component comp) {
+                Dimension componentSize = comp.getSize();
+                return componentSize.height >= minSize.height
+                        && componentSize.height <= maxSize.height
+                        && componentSize.width >= minSize.width
+                        && componentSize.width <= maxSize.width;
+            }
+
+            @Override
+            public String getDescription() {
+                return "Component Size becomes between: " + minSize
+                        + "and " + maxSize;
+            }
+
+            @Override
+            public String toString() {
+                return "ComponentOperator.waitComponentSize"
+                        + ".Waitable{description = " + getDescription() + '}';
+            }
+        });
+    }
+
+    /**
+     * Wait till the component reaches exact location.
+     *
+     * @param exactlocation exact expected location.
+     */
+    public void waitComponentLocation(Point exactlocation) {
+        waitComponentLocation(exactlocation, exactlocation);
+    }
+
+    /**
+     * Wait till the component reaches location between minLocation and
+     * maxLocation
+     *
+     * @param minLocation minimum expected location.
+     * @param maxLocation maximum expected location.
+     */
+    public void waitComponentLocation(Point minLocation, Point maxLocation) {
+        waitState(new ComponentChooser() {
+            @Override
+            public boolean checkComponent(Component comp) {
+                Point componentLocation = comp.getLocation();
+                return componentLocation.x >= minLocation.x
+                        && componentLocation.x <= maxLocation.x
+                        && componentLocation.y >= minLocation.y
+                        && componentLocation.y <= maxLocation.y;
+            }
+
+            @Override
+            public String getDescription() {
+                return "Component reaches location between :" + minLocation
+                        + "and " + maxLocation;
+            }
+
+            @Override
+            public String toString() {
+                return "ComponentOperator.waitComponentLocation"
+                        + ".Waitable{description = " + getDescription() + '}';
+            }
+        });
+    }
+
+    /**
      * Returns information about component.
      */
     @Override
diff --git a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/FrameOperator.java b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/FrameOperator.java
index d66a8e9..da6d1d5 100644
--- a/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/FrameOperator.java
+++ b/jdk/test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/FrameOperator.java
@@ -274,7 +274,7 @@
         output.printGolden("Maximizing frame");
         driver.maximize(this);
         if (getVerification()) {
-            waitState(Frame.NORMAL);
+            waitState(Frame.MAXIMIZED_BOTH);
         }
     }
 
@@ -306,7 +306,7 @@
         waitState(new ComponentChooser() {
             @Override
             public boolean checkComponent(Component comp) {
-                return ((Frame) comp).getState() == state;
+                return ((Frame) comp).getExtendedState() == state;
             }
 
             @Override
@@ -376,6 +376,19 @@
     }
 
     /**
+     * Maps {@code Frame.getExtendedState()} through queue
+     * @return the state of the frame
+     */
+    public int getExtendedState() {
+        return (runMapping(new MapAction<Integer>("getExtendedState") {
+            @Override
+            public Integer map() {
+                return ((Frame) getSource()).getExtendedState();
+            }
+        }));
+    }
+
+    /**
      * Maps {@code Frame.getTitle()} through queue
      */
     public String getTitle() {
@@ -448,6 +461,21 @@
     }
 
     /**
+     * Maps {@code Frame.setExtendedState(int)} through queue
+     * @param state of the frame
+     */
+    public void setExtendedState(final int state) {
+        runMapping(new MapAction<Void>("setExtendedState") {
+            @Override
+            public Void map() {
+                ((Frame) getSource()).setExtendedState(state);
+                return null;
+            }
+        });
+
+    }
+
+    /**
      * Maps {@code Frame.setTitle(String)} through queue
      */
     public void setTitle(final String string) {
diff --git a/jdk/test/sun/jvmstat/TEST.properties b/jdk/test/sun/jvmstat/TEST.properties
new file mode 100644
index 0000000..0f0bd8b
--- /dev/null
+++ b/jdk/test/sun/jvmstat/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.internal.jvmstat/sun.jvmstat.monitor
+
diff --git a/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java b/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java
index 38c464e..98b6781 100644
--- a/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java
+++ b/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java
@@ -24,8 +24,10 @@
 /*
  * @test
  * @bug 4990825
- * @modules jdk.internal.jvmstat/sun.jvmstat.monitor
  * @summary test that HostIdentifier objects get created as expected
+ *
+ * @modules java.xml
+ *          jdk.internal.jvmstat/sun.jvmstat.monitor
  */
 
 import java.io.*;
diff --git a/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java b/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java
index 8f9d9d6..3548260 100644
--- a/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java
+++ b/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java
@@ -40,9 +40,10 @@
  * @test
  * @bug 6672135
  * @summary setInterval() for local MonitoredHost and local MonitoredVm
- * @modules jdk.internal.jvmstat/sun.jvmstat.monitor
+ *
  * @library /lib/testlibrary
  * @library /test/lib
+ *
  * @build jdk.testlibrary.*
  * @build jdk.test.lib.apps.*
  * @run main TestPollingInterval
diff --git a/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java b/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java
index e3bdb4c..f5f1579 100644
--- a/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java
+++ b/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java
@@ -24,8 +24,10 @@
 /*
  * @test
  * @bug 4990825
- * @modules jdk.internal.jvmstat/sun.jvmstat.monitor
  * @summary test that VmIdentifier objects get created as expected
+ *
+ * @modules java.xml
+ *          jdk.internal.jvmstat/sun.jvmstat.monitor
  */
 
 import java.io.*;
diff --git a/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java b/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java
index 2443881..edacd65 100644
--- a/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java
+++ b/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java
@@ -24,9 +24,9 @@
 /*
  * @test
  * @bug 4990825
- * @modules jdk.internal.jvmstat/sun.jvmstat.monitor
- * @run main/othervm -XX:+UsePerfData PrologSizeSanityCheck
  * @summary prolog size and overflow sanity checks
+ *
+ * @run main/othervm -XX:+UsePerfData PrologSizeSanityCheck
  */
 
 import sun.jvmstat.monitor.*;
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java
index 51111af..fd45002 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java
@@ -26,7 +26,7 @@
  * @bug     4858522
  * @summary Basic unit test of HotspotClassLoadingMBean.getClassInitializationTime()
  * @author  Steve Bohne
- * @modules java.management/sun.management
+ *
  * @run main/othervm -XX:+UsePerfData GetClassInitializationTime
  */
 
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java
index 37971f7..1e1d5aa 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java
@@ -26,7 +26,7 @@
  * @bug     4858522
  * @summary Basic unit test of HotspotClassLoadingMBean.getClassLoadingTime()
  * @author  Steve Bohne
- * @modules java.management/sun.management
+ *
  * @build ClassToLoad0
  * @run main/othervm -XX:+UsePerfData GetClassLoadingTime
  */
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java
index 72025d8..b6f966c 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java
@@ -26,7 +26,7 @@
  * @bug     4858522
  * @summary Basic unit test of HotspotClassLoadingMBean.getInitializedClassCount()
  * @author  Steve Bohne
- * @modules java.management/sun.management
+ *
  * @run main/othervm -XX:+UsePerfData GetInitializedClassCount
  */
 
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java
index 2ca1b85..9ba6fe6 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java
@@ -26,7 +26,7 @@
  * @bug     4858522
  * @summary Basic unit test of HotspotClassLoadingMBean.getLoadedClassSize()
  * @author  Steve Bohne
- * @modules java.management/sun.management
+ *
  * @run main/othervm -XX:+UsePerfData GetLoadedClassSize
  */
 
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java
index a8e5f43..8164ba7 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java
@@ -26,7 +26,7 @@
  * @bug     4858522
  * @summary Basic unit test of HotspotClassLoadingMBean.getMethodDataSize()
  * @author  Steve Bohne
- * @modules java.management/sun.management
+ *
  * @run main/othervm -XX:+UsePerfData GetMethodDataSize
  */
 
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java
index 6319c9a..84e8445 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java
@@ -26,7 +26,7 @@
  * @bug     4858522
  * @summary Basic unit test of HotspotClassLoadingMBean.getUnloadedClassSize()
  * @author  Steve Bohne
- * @modules java.management/sun.management
+ *
  * @run main/othervm -XX:+UsePerfData GetUnloadedClassSize
  */
 
diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java
index 7d85e41..a96d282 100644
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java
@@ -26,7 +26,7 @@
  * @bug     4858522
  * @summary Basic unit test of HotspotClassLoadingMBean.getSafepointCount()
  * @author  Steve Bohne
- * @modules java.management/sun.management
+ *
  * @run main/othervm -XX:+UsePerfData GetSafepointCount
  */
 
diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
index d2a5a7c..7b25aaf 100644
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
@@ -26,7 +26,7 @@
  * @bug     4858522
  * @summary Basic unit test of HotspotRuntimeMBean.getSafepointSyncTime()
  * @author  Steve Bohne
- * @modules java.management/sun.management
+ *
  * @run main/othervm -XX:+UsePerfData GetSafepointSyncTime
  */
 
diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java
index 9502285..b2769e2 100644
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java
@@ -24,8 +24,8 @@
 /*
  * @test
  * @bug     4858522
- * @modules java.management/sun.management
  * @summary Basic unit test of HotspotRuntimeMBean.getTotalSafepointTime()
+ *
  * @run main/othervm -XX:+UsePerfData GetTotalSafepointTime
  */
 
diff --git a/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java b/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java
index 5d8fe48..9990adc 100644
--- a/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java
+++ b/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java
@@ -27,7 +27,7 @@
  * @summary Basic Test for HotspotThreadMBean.getInternalThreadCount()
  *          and getInternalThreadCpuTime()
  * @author  Mandy Chung
- * @modules java.management/sun.management
+ *
  * @run main/othervm -XX:+UsePerfData GetInternalThreads
  */
 
diff --git a/jdk/test/sun/management/LazyCompositeDataTest.java b/jdk/test/sun/management/LazyCompositeDataTest.java
index c3d0652..7835dd1 100644
--- a/jdk/test/sun/management/LazyCompositeDataTest.java
+++ b/jdk/test/sun/management/LazyCompositeDataTest.java
@@ -36,7 +36,6 @@
  * @test
  * @bug 8139870
  * @summary sun.management.LazyCompositeData.isTypeMatched() fails for composite types with items of ArrayType
- * @modules java.management/sun.management
  * @author Jaroslav Bachorik
  */
 
@@ -160,4 +159,5 @@
         }
         System.out.println("=== PASSED");
     }
-}
\ No newline at end of file
+}
+
diff --git a/jdk/test/sun/management/LoggingTest/LoggingWithJULTest.java b/jdk/test/sun/management/LoggingTest/LoggingWithJULTest.java
index a15e529..a2c7e79 100644
--- a/jdk/test/sun/management/LoggingTest/LoggingWithJULTest.java
+++ b/jdk/test/sun/management/LoggingTest/LoggingWithJULTest.java
@@ -26,11 +26,14 @@
 /**
  * @test
  * @bug 8172971
- * @modules java.management java.logging
  * @summary Smoke test to check that logging in java.management works as expected.
+ * @author danielfuchs
+ *
+ * @modules java.management
+ *          java.logging
+ *
  * @build LoggingTest LoggingWithJULTest
  * @run main/othervm LoggingWithJULTest
- * @author danielfuchs
  */
 public class LoggingWithJULTest {
 
diff --git a/jdk/test/sun/management/LoggingTest/LoggingWithLoggerFinderTest.java b/jdk/test/sun/management/LoggingTest/LoggingWithLoggerFinderTest.java
index feec435..27671f1 100644
--- a/jdk/test/sun/management/LoggingTest/LoggingWithLoggerFinderTest.java
+++ b/jdk/test/sun/management/LoggingTest/LoggingWithLoggerFinderTest.java
@@ -24,13 +24,13 @@
 /**
  * @test
  * @bug 8172971
- * @modules java.management
  * @summary Smoke test to check that logging in java.management is performed
  *          through System.Logger. This test installs a LoggerFinder service
  *          provider and verifies that it gets the traces.
+ * @author danielfuchs
+ *
  * @build test.loggerfinder/test.loggerfinder.TestLoggerFinder LoggingTest LoggingWithLoggerFinderTest
  * @run main/othervm --add-modules test.loggerfinder LoggingWithLoggerFinderTest
- * @author danielfuchs
  */
 public class LoggingWithLoggerFinderTest {
 
diff --git a/jdk/test/sun/management/LoggingTest/test.loggerfinder/test/loggerfinder/TestLoggerFinder.java b/jdk/test/sun/management/LoggingTest/test.loggerfinder/test/loggerfinder/TestLoggerFinder.java
index 39c555e..c9ee916 100644
--- a/jdk/test/sun/management/LoggingTest/test.loggerfinder/test/loggerfinder/TestLoggerFinder.java
+++ b/jdk/test/sun/management/LoggingTest/test.loggerfinder/test/loggerfinder/TestLoggerFinder.java
@@ -26,7 +26,6 @@
 import java.lang.System.Logger;
 import java.lang.System.Logger.Level;
 import java.lang.System.LoggerFinder;
-import java.lang.reflect.Module;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Optional;
diff --git a/jdk/test/sun/management/StackTraceElementCompositeData/CompatibilityTest.java b/jdk/test/sun/management/StackTraceElementCompositeData/CompatibilityTest.java
index 00789c8..6984eb7 100644
--- a/jdk/test/sun/management/StackTraceElementCompositeData/CompatibilityTest.java
+++ b/jdk/test/sun/management/StackTraceElementCompositeData/CompatibilityTest.java
@@ -15,9 +15,9 @@
  * @test
  * @bug     8139587
  * @summary Check backward compatibility of StackTraceElementCompositeData
- * @modules java.management/sun.management
- * @run testng CompatibilityTest
  * @author  Jaroslav Bachorik
+ *
+ * @run testng CompatibilityTest
  */
 
 public class CompatibilityTest {
@@ -69,4 +69,5 @@
         assertNull(ste.getModuleName());
         assertNull(ste.getModuleVersion());
     }
-}
\ No newline at end of file
+}
+
diff --git a/jdk/test/sun/management/TEST.properties b/jdk/test/sun/management/TEST.properties
new file mode 100644
index 0000000..d2adce1
--- /dev/null
+++ b/jdk/test/sun/management/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.management/sun.management
+
diff --git a/jdk/test/sun/management/jdp/DynamicLauncher.java b/jdk/test/sun/management/jdp/DynamicLauncher.java
index 934002c..f55d0c8 100644
--- a/jdk/test/sun/management/jdp/DynamicLauncher.java
+++ b/jdk/test/sun/management/jdp/DynamicLauncher.java
@@ -58,6 +58,11 @@
                 }
             }
         } while (tryAgain);
+        output.shouldHaveExitValue(0);
+        // java.lang.Exception is thrown by JdpTestCase if something goes wrong
+        // for instance - see JdpTestCase::shutdown()
+        output.shouldNotContain("java.lang.Exception:");
+        output.shouldNotContain("Error: Could not find or load main class");
     }
 
     protected OutputAnalyzer runVM() throws Exception {
diff --git a/jdk/test/sun/management/jdp/JdpDefaultsTest.java b/jdk/test/sun/management/jdp/JdpDefaultsTest.java
index 8236e5e..2f40747 100644
--- a/jdk/test/sun/management/jdp/JdpDefaultsTest.java
+++ b/jdk/test/sun/management/jdp/JdpDefaultsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,10 +30,11 @@
 /*
  * @test JdpDefaultsTest
  * @summary Assert that we can read JDP packets from a multicast socket connection, on default IP and port.
+ *
  * @library /lib/testlibrary
- * @modules jdk.management.agent/sun.management.jdp
+ *
  * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
- * @run main JdpDefaultsTest
+ * @run main/othervm JdpDefaultsTest
  */
 
 public class JdpDefaultsTest extends DynamicLauncher {
diff --git a/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java b/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java
index 9ee4a0c..b5d04d5 100644
--- a/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java
+++ b/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java
@@ -22,14 +22,15 @@
  */
 
 /**
- *  @test JdpJmxRemoteDynamicPortTest.java
- *  @bug 8167337
- *  @summary Verify a non-zero value is assigned to jmxremote.port
- *           when VM is started with jmxremote.port=0.
- *  @library /lib/testlibrary
- *  @modules java.management/sun.management.jdp
- *  @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpJmxRemoteDynamicPortTestCase DynamicLauncher
- *  @run main JdpJmxRemoteDynamicPortTest
+ * @test JdpJmxRemoteDynamicPortTest.java
+ * @bug 8167337
+ * @summary Verify a non-zero value is assigned to jmxremote.port
+ *          when VM is started with jmxremote.port=0.
+ *
+ * @library /lib/testlibrary
+ *
+ * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpJmxRemoteDynamicPortTestCase DynamicLauncher
+ * @run main/othervm JdpJmxRemoteDynamicPortTest
  */
 
 import java.lang.management.ManagementFactory;
@@ -40,7 +41,6 @@
     public static void main(String[] args) throws Exception {
         DynamicLauncher launcher = new JdpJmxRemoteDynamicPortTest();
         launcher.run();
-        launcher.getProcessOutpoutAnalyzer().stderrShouldNotContain("java.lang.Exception:");
     }
 
     protected String[] options() {
diff --git a/jdk/test/sun/management/jdp/JdpOffTest.java b/jdk/test/sun/management/jdp/JdpOffTest.java
index a1aa618..2f50e84 100644
--- a/jdk/test/sun/management/jdp/JdpOffTest.java
+++ b/jdk/test/sun/management/jdp/JdpOffTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,10 +31,11 @@
 /*
  * @test JdpOffTest.java
  * @summary Assert that no JDP packets are sent to the default address and port.
+ *
  * @library /lib/testlibrary
- * @modules jdk.management.agent/sun.management.jdp
+ *
  * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOffTestCase DynamicLauncher
- * @run main JdpOffTest
+ * @run main/othervm JdpOffTest
  */
 
 
diff --git a/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java b/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java
index f982164..f628e54 100644
--- a/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java
+++ b/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,10 +30,11 @@
 /*
  * @test JdpSpecificAddressTest
  * @summary Assert that we can read JDP packets from a multicast socket connection, on specific IP and port.
+ *
  * @library /lib/testlibrary
- * @modules jdk.management.agent/sun.management.jdp
+ *
  * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
- * @run main JdpSpecificAddressTest
+ * @run main/othervm JdpSpecificAddressTest
  */
 
 
diff --git a/jdk/test/sun/management/jdp/TEST.properties b/jdk/test/sun/management/jdp/TEST.properties
new file mode 100644
index 0000000..122ad1c
--- /dev/null
+++ b/jdk/test/sun/management/jdp/TEST.properties
@@ -0,0 +1,3 @@
+modules = jdk.management.agent/sun.management.jdp \
+          java.logging
+
diff --git a/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java b/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java
index 6179a33..223d252 100644
--- a/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java
+++ b/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java
@@ -22,15 +22,14 @@
  */
 
 /**
- *  @test LocalRMIServerSocketFactoryTest.java
- *  @bug 6774170
- *  @summary Connect to a server socket returned by the LocalRMIServerSocketFactory.
+ * @test LocalRMIServerSocketFactoryTest.java
+ * @bug 6774170
+ * @summary Connect to a server socket returned by the LocalRMIServerSocketFactory.
  *
- *  @author Daniel Fuchs
+ * @author Daniel Fuchs
  *
- *  @modules jdk.management.agent/sun.management.jmxremote
- *  @run compile -XDignore.symbol.file=true -g LocalRMIServerSocketFactoryTest.java
- *  @run main LocalRMIServerSocketFactoryTest
+ * @run compile -XDignore.symbol.file=true -g LocalRMIServerSocketFactoryTest.java
+ * @run main LocalRMIServerSocketFactoryTest
  */
 
 import sun.management.jmxremote.LocalRMIServerSocketFactory;
diff --git a/jdk/test/sun/management/jmxremote/TEST.properties b/jdk/test/sun/management/jmxremote/TEST.properties
new file mode 100644
index 0000000..c846853
--- /dev/null
+++ b/jdk/test/sun/management/jmxremote/TEST.properties
@@ -0,0 +1,3 @@
+modules = jdk.management.agent/jdk.internal.agent \
+          jdk.management.agent/sun.management.jmxremote
+
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java
index 0e1ebcf..8f4b553 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,12 +40,16 @@
 /**
  * @test
  * @bug 6434402 8004926
+ * @author Jaroslav Bachorik
+ *
  * @library /lib/testlibrary
- * @modules jdk.management.agent/jdk.internal.agent
+ * @modules java.management
+ *          jdk.attach
+ *          jdk.management.agent/jdk.internal.agent
+ *
  * @build jdk.testlibrary.*
  * @build TestManager TestApplication CustomLauncherTest
  * @run main/othervm CustomLauncherTest
- * @author Jaroslav Bachorik
  */
 public class CustomLauncherTest {
     private static final  String TEST_CLASSPATH = System.getProperty("test.class.path");
@@ -140,7 +144,7 @@
 
             System.out.println("Attaching test manager:");
             System.out.println("=========================");
-            System.out.println("  PID           : " + serverPrc.getPid());
+            System.out.println("  PID           : " + serverPrc.pid());
             System.out.println("  shutdown port : " + port.get());
 
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
@@ -148,7 +152,7 @@
                 TEST_CLASSPATH,
                 "--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED",
                 "TestManager",
-                String.valueOf(serverPrc.getPid()),
+                String.valueOf(serverPrc.pid()),
                 port.get(),
                 "true"
             );
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java
index a7ed6e4..862c46a 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java
@@ -48,9 +48,9 @@
  * @summary Test JMX agent host address binding. Same ports but different
  *          interfaces to bind to (using plain sockets and SSL sockets).
  *
- * @modules jdk.management.agent/jdk.internal.agent
- *          jdk.management.agent/sun.management.jmxremote
  * @library /lib/testlibrary
+ * @modules java.management.rmi
+ *
  * @build jdk.testlibrary.* JMXAgentInterfaceBinding
  * @run main/timeout=5 JMXInterfaceBindingTest
  */
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
index f731c07..75f903f 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
@@ -27,7 +27,11 @@
  * @summary Tests that the jvmstat counters published by the out-of-the-box
  *          management agent for the JMX connection details are correct.
  * @author Luis-Miguel Alventosa
- * @modules jdk.management.agent/jdk.internal.agent
+ *
+ * @modules java.management
+ *          jdk.attach
+ *          jdk.management.agent/jdk.internal.agent
+ *
  * @run clean JvmstatCountersTest
  * @run build JvmstatCountersTest
  * @run main/othervm/timeout=600 -XX:+UsePerfData JvmstatCountersTest 1
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
index ae935f3..909fedd 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,13 +32,17 @@
 
 /**
  * @test
- * @library /lib/testlibrary
  * @bug 5016507 6173612 6319776 6342019 6484550 8004926
  * @summary Start a managed VM and test that a management tool can connect
  *          without connection or username/password details.
  *          TestManager will attempt a connection to the address obtained from
  *          both agent properties and jvmstat buffer.
- * @modules jdk.management.agent/jdk.internal.agent
+ *
+ * @library /lib/testlibrary
+ * @modules java.management
+ *          jdk.attach
+ *          jdk.management.agent/jdk.internal.agent
+ *
  * @build jdk.testlibrary.* TestManager TestApplication
  * @run main/othervm/timeout=300 LocalManagementTest
  */
@@ -125,7 +129,7 @@
 
             System.out.println("Attaching test manager:");
             System.out.println("=========================");
-            System.out.println("  PID           : " + serverPrc.getPid());
+            System.out.println("  PID           : " + serverPrc.pid());
             System.out.println("  shutdown port : " + port.get());
 
             ProcessBuilder client = ProcessTools.createJavaProcessBuilder(
@@ -133,7 +137,7 @@
                 TEST_CLASSPATH,
                 "--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED",
                 "TestManager",
-                String.valueOf(serverPrc.getPid()),
+                String.valueOf(serverPrc.pid()),
                 port.get(),
                 "true"
             );
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java
index 22f18a4..1d9a280 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java
@@ -25,14 +25,14 @@
 
 /**
  * @test
- * @library /lib/testlibrary
  * @bug 6557093
  * @summary Check SSL config file permission for out-of-the-box management
- * @modules jdk.management.agent
+ * @author Taras Ledkov
+ *
+ * @library /lib/testlibrary
+ *
  * @build jdk.testlibrary.* AbstractFilePermissionTest Dummy
  * @run main/timeout=300 PasswordFilePermissionTest
- *
- * @author Taras Ledkov
  */
 public class PasswordFilePermissionTest extends AbstractFilePermissionTest {
 
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh
index d4da383..f767505 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh
@@ -24,12 +24,11 @@
 #
 # @test
 # @bug     6528083
+# @key intermittent
 # @summary Test RMI Bootstrap
 #
-# @key intermittent
 # @library /lib/testlibrary
-# @modules jdk.management.agent/jdk.internal.agent
-#          jdk.management.agent/sun.management.jmxremote
+#
 # @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest
 # @run shell/timeout=300  RmiBootstrapTest.sh
 
@@ -44,7 +43,7 @@
 
 rm -rf ${TESTCLASSES}/ssl
 mkdir -p ${TESTCLASSES}/ssl
-cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl 
+cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl
 chmod -R 777 ${TESTCLASSES}/ssl
 
 DEBUGOPTIONS=""
@@ -56,7 +55,7 @@
 
 # Call the common generic test
 #
-# No need to since bug 4267864 is now fixed. 
+# No need to since bug 4267864 is now fixed.
 #
 echo -------------------------------------------------------------
 echo Launching test for `basename $0 .sh`
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java b/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java
index f111006..1aeaeb7 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java
@@ -39,13 +39,14 @@
 
 /**
  * @test
- * @library /lib/testlibrary
  * @bug 6228231
  * @summary Test that RMI registry uses SSL.
- * @modules jdk.management.agent
+ * @author Luis-Miguel Alventosa, Taras Ledkov
+ *
+ * @library /lib/testlibrary
+ *
  * @build jdk.testlibrary.* RmiRegistrySslTestApp
  * @run main/timeout=300 RmiRegistrySslTest
- * @author Luis-Miguel Alventosa, Taras Ledkov
  */
 public class RmiRegistrySslTest {
     private final String TEST_CLASS_PATH = System.getProperty("test.class.path");
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh
index cd1fde0..67ae17b 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh
@@ -27,8 +27,7 @@
 # @summary Test RMI Bootstrap with SSL
 #
 # @library /lib/testlibrary
-# @modules jdk.management.agent/jdk.internal.agent
-#          jdk.management.agent/sun.management.jmxremote
+#
 # @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest
 # @run shell/timeout=300  RmiSslBootstrapTest.sh
 
@@ -43,7 +42,7 @@
 
 rm -rf ${TESTCLASSES}/ssl
 mkdir -p ${TESTCLASSES}/ssl
-cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl 
+cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl
 chmod -R 777 ${TESTCLASSES}/ssl
 
 DEBUGOPTIONS=""
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh
index 5b88d90..a257cdc 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh
@@ -24,10 +24,8 @@
 #
 # @test
 # @summary Test RMI Bootstrap with SSL and no keystore.
-#
 # @bug 4932854
-# @modules jdk.management.agent/jdk.internal.agent
-#          jdk.management.agent/sun.management.jmxremote
+#
 # @build TestLogger RmiSslNoKeyStoreTest
 # @run shell/timeout=300  RmiSslNoKeyStoreTest.sh
 
@@ -42,7 +40,7 @@
 
 rm -rf ${TESTCLASSES}/ssl
 mkdir -p ${TESTCLASSES}/ssl
-cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl 
+cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl
 chmod -R 777 ${TESTCLASSES}/ssl
 
 DEBUGOPTIONS=""
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java
index 749d927..176f154 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java
@@ -25,14 +25,14 @@
 
 /**
  * @test
- * @library /lib/testlibrary
  * @bug 6557093
- * @modules jdk.management.agent
- * @build jdk.testlibrary.* Dummy AbstractFilePermissionTest
  * @summary Check SSL config file permission for out-of-the-box management
- * @run main/timeout=300 SSLConfigFilePermissionTest
- *
  * @author Taras Ledkov
+ *
+ * @library /lib/testlibrary
+ *
+ * @build jdk.testlibrary.* Dummy AbstractFilePermissionTest
+ * @run main/timeout=300 SSLConfigFilePermissionTest
  */
 public class SSLConfigFilePermissionTest extends AbstractFilePermissionTest {
 
diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
index 4bdc949..90c2e27 100644
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,13 +53,17 @@
 /**
  * @test
  * @bug 7110104
- * @library /lib/testlibrary
- * @modules jdk.management.agent/jdk.internal.agent
- * @build jdk.testlibrary.* JMXStartStopTest PortAllocator TestApp ManagementAgentJcmd
- * @run main/othervm/timeout=600 -XX:+UsePerfData JMXStartStopTest
+ * @key randomness intermittent
  * @summary Makes sure that enabling/disabling the management agent through JCMD
  *          achieves the desired results
- * @key randomness intermittent
+ *
+ * @library /lib/testlibrary
+ * @modules java.management
+ *          java.rmi
+ *          jdk.management.agent/jdk.internal.agent
+ *
+ * @build jdk.testlibrary.* JMXStartStopTest PortAllocator TestApp ManagementAgentJcmd
+ * @run main/othervm/timeout=600 -XX:+UsePerfData JMXStartStopTest
  */
 public class JMXStartStopTest {
     private static final String TEST_APP_NAME = "TestApp";
@@ -342,7 +346,7 @@
                         throw new BindException("Starting process failed due to " +
                                                 "the requested port not being available");
                     }
-                    pid = p.getPid();
+                    pid = p.pid();
                 } catch (TimeoutException e) {
                     if (p != null) {
                         p.destroy();
diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java
index 2fb8ef6..14298f8 100644
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java
@@ -38,11 +38,12 @@
 /**
  * @test
  * @bug 8075926
+ * @key intermittent
  * @summary Makes sure that the current management agent status is reflected
  *          in the related performance counters.
- * @key intermittent
+ *
  * @library /lib/testlibrary
- * @modules jdk.management.agent/jdk.internal.agent
+ *
  * @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd
  * @run testng/othervm -XX:+UsePerfData JMXStatusPerfCountersTest
  */
diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java
index 31c96c3..ddc951b 100644
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java
@@ -37,8 +37,9 @@
  * @summary Performs a sanity test for the ManagementAgent.status diagnostic command.
  *          Management agent may be disabled, started (only local connections) and started.
  *          The test asserts that the expected text is being printed.
+ *
  * @library /lib/testlibrary
- * @modules jdk.management.agent/jdk.internal.agent
+ *
  * @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd
  *        JMXStatusTest JMXStatus1Test JMXStatus2Test
  * @run testng/othervm -XX:+UsePerfData JMXStatus1Test
diff --git a/jdk/test/sun/net/www/http/HttpClient/B8025710.java b/jdk/test/sun/net/www/http/HttpClient/B8025710.java
index 8074c76..0c3a934 100644
--- a/jdk/test/sun/net/www/http/HttpClient/B8025710.java
+++ b/jdk/test/sun/net/www/http/HttpClient/B8025710.java
@@ -37,6 +37,7 @@
  * @test
  * @bug 8025710
  * @summary Proxied https connection reuse by HttpClient can send CONNECT to the server
+ * @run main/othervm B8025710
  */
 public class B8025710 {
 
diff --git a/jdk/test/sun/net/www/http/KeepAliveCache/B5045306.java b/jdk/test/sun/net/www/http/KeepAliveCache/B5045306.java
index 022e140..88526fb 100644
--- a/jdk/test/sun/net/www/http/KeepAliveCache/B5045306.java
+++ b/jdk/test/sun/net/www/http/KeepAliveCache/B5045306.java
@@ -25,6 +25,7 @@
  * @test
  * @bug 5045306 6356004 6993490
  * @modules java.base/sun.net.www
+ *          java.management
  * @library ../../httptest/
  * @build HttpCallback TestHttpServer HttpTransaction
  * @run main/othervm B5045306
diff --git a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java
index 72bae7e..fbdad8c 100644
--- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java
+++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java
@@ -31,9 +31,9 @@
  * @bug 6216082
  * @summary  Redirect problem with HttpsURLConnection using a proxy
  * @modules java.base/sun.net.www
- * @library ..
+ * @library .. /lib/testlibrary
  * @build HttpCallback TestHttpsServer ClosedChannelList
- *        HttpTransaction TunnelProxy
+ *        HttpTransaction TunnelProxy jdk.testlibrary.NetworkConfiguration
  * @key intermittent
  * @run main/othervm B6216082
  */
@@ -43,6 +43,8 @@
 import javax.net.ssl.*;
 import java.util.*;
 
+import jdk.testlibrary.NetworkConfiguration;
+
 public class B6216082 {
     static SimpleHttpTransaction httpTrans;
     static TestHttpsServer server;
@@ -118,21 +120,17 @@
     }
 
     public static InetAddress getNonLoAddress() throws Exception {
-        NetworkInterface loNIC = NetworkInterface.getByInetAddress(InetAddress.getByName("localhost"));
-        Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces();
-        while (nics.hasMoreElements()) {
-            NetworkInterface nic = nics.nextElement();
-            if (!nic.getName().equalsIgnoreCase(loNIC.getName())) {
-                Enumeration<InetAddress> addrs = nic.getInetAddresses();
-                while (addrs.hasMoreElements()) {
-                    InetAddress addr = addrs.nextElement();
-                    if (!addr.isLoopbackAddress())
-                        return addr;
-                }
-            }
-        }
+        InetAddress lh = InetAddress.getByName("localhost");
+        NetworkInterface loNIC = NetworkInterface.getByInetAddress(lh);
 
-        return null;
+        NetworkConfiguration nc = NetworkConfiguration.probe();
+        Optional<InetAddress> oaddr = nc.interfaces()
+                .filter(nif -> !nif.getName().equalsIgnoreCase(loNIC.getName()))
+                .flatMap(nif -> nc.addresses(nif))
+                .filter(a -> !a.isLoopbackAddress())
+                .findFirst();
+
+        return oaddr.orElseGet(() -> null);
     }
 
     public static void startHttpServer() throws IOException {
diff --git a/jdk/test/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java b/jdk/test/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java
index 4446401..45fce65 100644
--- a/jdk/test/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java
+++ b/jdk/test/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java
@@ -26,8 +26,7 @@
  * @bug 8132734 8144062 8159785
  * @summary Test that URL connections to multi-release jars can be runtime versioned
  * @library /lib/testlibrary/java/util/jar
- * @modules java.compiler
- *          jdk.compiler
+ * @modules jdk.compiler
  *          jdk.httpserver
  *          jdk.jartool
  * @build Compiler JarBuilder CreateMultiReleaseTestJars SimpleHttpServer
diff --git a/jdk/test/sun/net/www/protocol/jrt/java.policy b/jdk/test/sun/net/www/protocol/jrt/java.policy
index 5df300a..276543b 100644
--- a/jdk/test/sun/net/www/protocol/jrt/java.policy
+++ b/jdk/test/sun/net/www/protocol/jrt/java.policy
@@ -1,3 +1,3 @@
 grant {
-    permission java.io.FilePermission "${java.home}/-", "read";
+    permission java.lang.RuntimePermission "accessSystemModules";
 };
diff --git a/jdk/test/sun/nio/cs/CheckHistoricalNames.java b/jdk/test/sun/nio/cs/CheckHistoricalNames.java
index 0b1ee60..be73b06 100644
--- a/jdk/test/sun/nio/cs/CheckHistoricalNames.java
+++ b/jdk/test/sun/nio/cs/CheckHistoricalNames.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4513767 4961027 6217210
-   @summary Checks canonical names match between old and (NIO) core charsets
+ * @bug 4513767 4961027 6217210
+ * @summary Checks canonical names match between old and (NIO) core charsets
+ * @modules jdk.charsets
  */
 import java.io.InputStreamReader;
 import java.io.IOException;
diff --git a/jdk/test/sun/nio/cs/EuroConverter.java b/jdk/test/sun/nio/cs/EuroConverter.java
index ea4b656..5e86a3f 100644
--- a/jdk/test/sun/nio/cs/EuroConverter.java
+++ b/jdk/test/sun/nio/cs/EuroConverter.java
@@ -27,6 +27,7 @@
  * @summary  Make sure the euro converters, which are derived from
  * existing converters, only differ from their parents at the expected
  * code point.
+ * @modules jdk.charsets
  */
 
 import java.text.*;
diff --git a/jdk/test/sun/nio/cs/HWKatakanaMS932EncodeTest.java b/jdk/test/sun/nio/cs/HWKatakanaMS932EncodeTest.java
index 5d06aa4..76373a9 100644
--- a/jdk/test/sun/nio/cs/HWKatakanaMS932EncodeTest.java
+++ b/jdk/test/sun/nio/cs/HWKatakanaMS932EncodeTest.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4715330
-   @summary Check MS932/windows-31j encoding (char->byte) for halfwidth katakana chars
+ * @bug 4715330
+ * @summary Check MS932/windows-31j encoding (char->byte) for halfwidth katakana chars
+ * @modules jdk.charsets
  */
 
 /*
diff --git a/jdk/test/sun/nio/cs/ISCIITest.java b/jdk/test/sun/nio/cs/ISCIITest.java
index 7897fc3..1a7fa4a 100644
--- a/jdk/test/sun/nio/cs/ISCIITest.java
+++ b/jdk/test/sun/nio/cs/ISCIITest.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4328178
-   @summary Performs baseline and regression test on the ISCII91 charset
+ * @bug 4328178
+ * @summary Performs baseline and regression test on the ISCII91 charset
+ * @modules jdk.charsets
  */
 
 import java.io.*;
diff --git a/jdk/test/sun/nio/cs/JISAutoDetectTest.java b/jdk/test/sun/nio/cs/JISAutoDetectTest.java
index f527dac5..a00095b 100644
--- a/jdk/test/sun/nio/cs/JISAutoDetectTest.java
+++ b/jdk/test/sun/nio/cs/JISAutoDetectTest.java
@@ -26,6 +26,7 @@
  * @bug 4087261 4184592
  * @summary Make sure to determine Japanese text encoding as correctly
  * as possible.
+ * @modules jdk.charsets
  */
 
 import java.nio.charset.*;
diff --git a/jdk/test/sun/nio/cs/NIOJISAutoDetectTest.java b/jdk/test/sun/nio/cs/NIOJISAutoDetectTest.java
index 42a4180..9071e00 100644
--- a/jdk/test/sun/nio/cs/NIOJISAutoDetectTest.java
+++ b/jdk/test/sun/nio/cs/NIOJISAutoDetectTest.java
@@ -25,6 +25,7 @@
  * @test
  * @bug 4831163 5053096 5056440 8022224
  * @summary NIO charset basic verification of JISAutodetect decoder
+ * @modules jdk.charsets
  * @author Martin Buchholz
  */
 
diff --git a/jdk/test/sun/nio/cs/SJISCanEncode.java b/jdk/test/sun/nio/cs/SJISCanEncode.java
index 219f9d1..01292ca 100644
--- a/jdk/test/sun/nio/cs/SJISCanEncode.java
+++ b/jdk/test/sun/nio/cs/SJISCanEncode.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4913702
-   @summary validates canEncode(char c) method for sun.nio.cs.Shift_JIS
+ * @bug 4913702
+ * @summary validates canEncode(char c) method for sun.nio.cs.Shift_JIS
+ * @modules jdk.charsets
  */
 
 
diff --git a/jdk/test/sun/nio/cs/StreamEncoderClose.java b/jdk/test/sun/nio/cs/StreamEncoderClose.java
index e40d6d3..68b4111 100644
--- a/jdk/test/sun/nio/cs/StreamEncoderClose.java
+++ b/jdk/test/sun/nio/cs/StreamEncoderClose.java
@@ -22,10 +22,11 @@
  */
 
 /* @test
-   @bug 5005426
-   @summary Check if StreamEncoder close() method works correctly from
-            error recovery after the underneath OutputStream failed to
-            close the first time.
+ * @bug 5005426
+ * @summary Check if StreamEncoder close() method works correctly from
+ *          error recovery after the underneath OutputStream failed to
+ *          close the first time.
+ * @modules jdk.charsets
  */
 
 import java.io.*;
diff --git a/jdk/test/sun/nio/cs/Test6254467.java b/jdk/test/sun/nio/cs/Test6254467.java
index 5ade998..39f0b212 100644
--- a/jdk/test/sun/nio/cs/Test6254467.java
+++ b/jdk/test/sun/nio/cs/Test6254467.java
@@ -22,9 +22,10 @@
  */
 
 /* @test
-   @bug 6254467
-   @summary Checks if Charset.forName() accepts legal IANA alias names
-            for charset IBM037.
+ * @bug 6254467
+ * @summary Checks if Charset.forName() accepts legal IANA alias names
+ *          for charset IBM037.
+ * @modules jdk.charsets
  */
 import java.nio.charset.Charset;
 
diff --git a/jdk/test/sun/nio/cs/TestConverterDroppedCharacters.java b/jdk/test/sun/nio/cs/TestConverterDroppedCharacters.java
index 2e1171a..660ef43 100644
--- a/jdk/test/sun/nio/cs/TestConverterDroppedCharacters.java
+++ b/jdk/test/sun/nio/cs/TestConverterDroppedCharacters.java
@@ -22,11 +22,12 @@
  */
 
 /* @test
-   @bug 4122961
-   @summary Verify that converters don't drop characters on buffer boundaries
+ * @bug 4122961
+ * @summary Verify that converters don't drop characters on buffer boundaries
 
-   This is a slightly modified version of the attachment supplied with the
-   bug report.
+ * This is a slightly modified version of the attachment supplied with the
+ * bug report.
+ * @modules jdk.charsets
  */
 import java.io.*;
 
diff --git a/jdk/test/sun/nio/cs/TestCp834_SBCS.java b/jdk/test/sun/nio/cs/TestCp834_SBCS.java
index d935b84..539594e 100644
--- a/jdk/test/sun/nio/cs/TestCp834_SBCS.java
+++ b/jdk/test/sun/nio/cs/TestCp834_SBCS.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 6379808
-   @summary Check all Cp933 SBCS characters are not supported in Cp834
+ * @bug 6379808
+ * @summary Check all Cp933 SBCS characters are not supported in Cp834
+ * @modules jdk.charsets
  */
 
 import java.io.*;
diff --git a/jdk/test/sun/nio/cs/TestCp93xSISO.java b/jdk/test/sun/nio/cs/TestCp93xSISO.java
index 6ff0441..1f4162d 100644
--- a/jdk/test/sun/nio/cs/TestCp93xSISO.java
+++ b/jdk/test/sun/nio/cs/TestCp93xSISO.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4429358
-   @summary Remove illegal SI/SO char to byte mappings
+ * @bug 4429358
+ * @summary Remove illegal SI/SO char to byte mappings
+ * @modules jdk.charsets
  */
 
 public class TestCp93xSISO {
diff --git a/jdk/test/sun/nio/cs/TestIBM1364.java b/jdk/test/sun/nio/cs/TestIBM1364.java
index 78912bd..7f4291c 100644
--- a/jdk/test/sun/nio/cs/TestIBM1364.java
+++ b/jdk/test/sun/nio/cs/TestIBM1364.java
@@ -23,8 +23,9 @@
 
 
 /* @test
-   @bug 6803681
-   @summary Test IBM1364
+ * @bug 6803681
+ * @summary Test IBM1364
+ * @modules jdk.charsets
  */
 
 import java.util.Arrays;
diff --git a/jdk/test/sun/nio/cs/TestIBMBugs.java b/jdk/test/sun/nio/cs/TestIBMBugs.java
index 9b551c8..e870bbb 100644
--- a/jdk/test/sun/nio/cs/TestIBMBugs.java
+++ b/jdk/test/sun/nio/cs/TestIBMBugs.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 6371437 6371422 6371416 6371619 5058184 6371431 6639450 6569191 6577466
-   @summary Check if the problems reported in above bugs have been fixed
+ * @bug 6371437 6371422 6371416 6371619 5058184 6371431 6639450 6569191 6577466
+ * @summary Check if the problems reported in above bugs have been fixed
+ * @modules jdk.charsets
  */
 
 import java.io.*;
diff --git a/jdk/test/sun/nio/cs/TestISO2022CNDecoder.java b/jdk/test/sun/nio/cs/TestISO2022CNDecoder.java
index 5037579..ac63aec 100644
--- a/jdk/test/sun/nio/cs/TestISO2022CNDecoder.java
+++ b/jdk/test/sun/nio/cs/TestISO2022CNDecoder.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4779029 4924625 6392664 6730652
-   @summary Test decoding of various permutations of valid ISO-2022-CN byte sequences
+ * @bug 4779029 4924625 6392664 6730652
+ * @summary Test decoding of various permutations of valid ISO-2022-CN byte sequences
+ * @modules jdk.charsets
  */
 
 /*
diff --git a/jdk/test/sun/nio/cs/TestISO2022JP.java b/jdk/test/sun/nio/cs/TestISO2022JP.java
index fa533ef..79ceb7f 100644
--- a/jdk/test/sun/nio/cs/TestISO2022JP.java
+++ b/jdk/test/sun/nio/cs/TestISO2022JP.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4626545 4879522 4913711 4119445 8042125
-   @summary Check full coverage encode/decode for ISO-2022-JP
+ * @bug 4626545 4879522 4913711 4119445 8042125
+ * @summary Check full coverage encode/decode for ISO-2022-JP
+ * @modules jdk.charsets
  */
 
 /*
diff --git a/jdk/test/sun/nio/cs/TestISO2022JPEncoder.java b/jdk/test/sun/nio/cs/TestISO2022JPEncoder.java
index f0d550c..b9d557c 100644
--- a/jdk/test/sun/nio/cs/TestISO2022JPEncoder.java
+++ b/jdk/test/sun/nio/cs/TestISO2022JPEncoder.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4251646
-   @summary Make sure buffer boundary convert works
+ * @bug 4251646
+ * @summary Make sure buffer boundary convert works
+ * @modules jdk.charsets
  */
 
 import java.nio.*;
diff --git a/jdk/test/sun/nio/cs/TestISO2022JPSubBytes.java b/jdk/test/sun/nio/cs/TestISO2022JPSubBytes.java
index 3181530..672ac03 100644
--- a/jdk/test/sun/nio/cs/TestISO2022JPSubBytes.java
+++ b/jdk/test/sun/nio/cs/TestISO2022JPSubBytes.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4262894 6233303
-   @summary Testing substitute character Escape sequence
+ * @bug 4262894 6233303
+ * @summary Testing substitute character Escape sequence
+ * @modules jdk.charsets
  */
 
 import java.nio.*;
diff --git a/jdk/test/sun/nio/cs/TestIllegalISO2022Esc.java b/jdk/test/sun/nio/cs/TestIllegalISO2022Esc.java
index d5a0663..98e1305 100644
--- a/jdk/test/sun/nio/cs/TestIllegalISO2022Esc.java
+++ b/jdk/test/sun/nio/cs/TestIllegalISO2022Esc.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4429369
-   @summary  ISO2022CN and ISO2022KR converters throw exception
+ * @bug 4429369
+ * @summary  ISO2022CN and ISO2022KR converters throw exception
+ * @modules jdk.charsets
  */
 
 import java.io.*;
diff --git a/jdk/test/sun/nio/cs/TestIllegalSJIS.java b/jdk/test/sun/nio/cs/TestIllegalSJIS.java
index 29aa8a8..c1c7f09 100644
--- a/jdk/test/sun/nio/cs/TestIllegalSJIS.java
+++ b/jdk/test/sun/nio/cs/TestIllegalSJIS.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4117820
-   @summary Verify that SJIS.Decoder works properly for values between 0xA000 and 0xA0FC
+ * @bug 4117820
+ * @summary Verify that SJIS.Decoder works properly for values between 0xA000 and 0xA0FC
+ * @modules jdk.charsets
  */
 
 import java.nio.charset.*;
diff --git a/jdk/test/sun/nio/cs/TestMS5022X.java b/jdk/test/sun/nio/cs/TestMS5022X.java
index bb1ee4f..fe9c273 100644
--- a/jdk/test/sun/nio/cs/TestMS5022X.java
+++ b/jdk/test/sun/nio/cs/TestMS5022X.java
@@ -22,9 +22,10 @@
  */
 
 /* @test
-   @bug 6173388 6319716
-   @summary Check full coverage encode/decode for Microsoft
-            ISO2022_JP variants MS50220, MS50221 and MSISO2022JP
+ * @bug 6173388 6319716
+ * @summary Check full coverage encode/decode for Microsoft
+ *          ISO2022_JP variants MS50220, MS50221 and MSISO2022JP
+ * @modules jdk.charsets
  */
 
 import java.io.*;
diff --git a/jdk/test/sun/nio/cs/TestSJIS0213.java b/jdk/test/sun/nio/cs/TestSJIS0213.java
index d8ef138..da6b0e1 100644
--- a/jdk/test/sun/nio/cs/TestSJIS0213.java
+++ b/jdk/test/sun/nio/cs/TestSJIS0213.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 6529796 6710199
-   @summary Test SJIS/MS932_0213 charsets
+ * @bug 6529796 6710199
+ * @summary Test SJIS/MS932_0213 charsets
+ * @modules jdk.charsets
  */
 
 import java.util.Arrays;
diff --git a/jdk/test/sun/nio/cs/TestSJIS0213_SM.java b/jdk/test/sun/nio/cs/TestSJIS0213_SM.java
index 753cfb7..fe85d4e 100644
--- a/jdk/test/sun/nio/cs/TestSJIS0213_SM.java
+++ b/jdk/test/sun/nio/cs/TestSJIS0213_SM.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 7152690
-   @summary Initialize SJIS_0213 charset with SecurityManager enabled
+ * @bug 7152690
+ * @summary Initialize SJIS_0213 charset with SecurityManager enabled
+ * @modules jdk.charsets
  */
 public class TestSJIS0213_SM {
     public static void main(String[] args) throws Throwable {
diff --git a/jdk/test/sun/nio/cs/TestTrailingEscapesISO2022JP.java b/jdk/test/sun/nio/cs/TestTrailingEscapesISO2022JP.java
index 51758e7..c927a17 100644
--- a/jdk/test/sun/nio/cs/TestTrailingEscapesISO2022JP.java
+++ b/jdk/test/sun/nio/cs/TestTrailingEscapesISO2022JP.java
@@ -22,8 +22,9 @@
  */
 
 /* @test
-   @bug 4697605 4741233
-   @summary Check decoder behaves correctly in ISO2022_JP
+ * @bug 4697605 4741233
+ * @summary Check decoder behaves correctly in ISO2022_JP
+ * @modules jdk.charsets
  */
 
 import java.io.*;
diff --git a/jdk/test/sun/rmi/rmic/newrmic/equivalence/run.sh b/jdk/test/sun/rmi/rmic/newrmic/equivalence/run.sh
index 27c8604..a2e84bc 100644
--- a/jdk/test/sun/rmi/rmic/newrmic/equivalence/run.sh
+++ b/jdk/test/sun/rmi/rmic/newrmic/equivalence/run.sh
@@ -22,6 +22,8 @@
 #
 
 # @test
+# @ignore test is disabled, while further discussion on the rmic -Xnew feature
+# takes place (c.f JDK-8146299, JDK-8145980).
 # @bug 4911536
 # @summary This test verifies that the new implementation of rmic
 # generates equivalent classes as the old implementation, for a set
diff --git a/jdk/test/sun/security/ec/SignedObjectChain.java b/jdk/test/sun/security/ec/SignedObjectChain.java
index 6e93053..7c320c0 100644
--- a/jdk/test/sun/security/ec/SignedObjectChain.java
+++ b/jdk/test/sun/security/ec/SignedObjectChain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,9 @@
 /*
  * @test
  * @bug 8050374
- * @compile ../../../java/security/SignedObject/Chain.java
  * @summary Verify a chain of signed objects
+ * @compile ../../../java/security/SignedObject/Chain.java
+ * @run main SignedObjectChain
  */
 public class SignedObjectChain {
 
diff --git a/jdk/test/sun/security/ec/TestEC.java b/jdk/test/sun/security/ec/TestEC.java
index eb4202a..c8345d4 100644
--- a/jdk/test/sun/security/ec/TestEC.java
+++ b/jdk/test/sun/security/ec/TestEC.java
@@ -35,7 +35,6 @@
  * @library ../pkcs11/sslecc
  * @library ../../../java/security/testlibrary
  * @modules jdk.crypto.cryptoki/sun.security.pkcs11.wrapper
- * @compile --add-modules jdk.crypto.cryptoki TestEC.java
  * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" TestEC
  * @run main/othervm/java.security.policy=TestEC.policy -Djdk.tls.namedGroups="secp256r1,sect193r1" TestEC
  */
diff --git a/jdk/test/sun/security/krb5/auto/BadKdc.java b/jdk/test/sun/security/krb5/auto/BadKdc.java
deleted file mode 100644
index d1ace1a..0000000
--- a/jdk/test/sun/security/krb5/auto/BadKdc.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.*;
-import java.net.BindException;
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import javax.security.auth.login.LoginException;
-import sun.security.krb5.Asn1Exception;
-import sun.security.krb5.Config;
-
-public class BadKdc {
-
-    // Matches the krb5 debug output:
-    // >>> KDCCommunication: kdc=kdc.rabbit.hole UDP:14319, timeout=2000,...
-    //                                               ^ kdc#         ^ timeout
-    static final Pattern re = Pattern.compile(
-            ">>> KDCCommunication: kdc=kdc.rabbit.hole UDP:(\\d)...., " +
-            "timeout=(\\d+),");
-
-    // Ratio for timeout values of all timeout tests. Not final so that
-    // each test can choose their own.
-    static float ratio = 2f;
-
-    static void setRatio(float ratio) {
-        BadKdc.ratio = ratio;
-    }
-
-    static float getRatio() {
-        return ratio;
-    }
-
-    // Gets real timeout value. This method is called when writing krb5.conf
-    static int toReal(int from) {
-        return (int)(from * ratio + .5);
-    }
-
-    // De-ratio a millisecond value to second
-    static int toSymbolicSec(int from) {
-        return (int)(from / ratio / 1000f + 0.5);
-    }
-
-    /*
-     * There are several cases this test fails:
-     *
-     * 1. The random selected port is used by another process. No good way to
-     * prevent this happening, coz krb5.conf must be written before KDC starts.
-     * There are two different outcomes:
-     *
-     *  a. Cannot start the KDC. A BindException thrown.
-     *  b. When trying to access a non-existing KDC, a response is received!
-     *     Most likely a Asn1Exception thrown
-     *
-     * 2. Even if a KDC is started, and more than 20 seconds pass by, a timeout
-     * can still happens for the first UDP request. In fact, the KDC did not
-     * received it at all. This happens on almost all platforms, especially
-     * solaris-i586 and solaris-x64.
-     *
-     * To avoid them:
-     *
-     * 1. Catch those exceptions and ignore
-     *
-     * 2. a. Make the timeout longer? useless
-     *    b. Read the output carefully, if there is a timeout, it's OK.
-     *       Just make sure the retries times and KDCs are correct.
-     *       This is tough.
-     *    c. Feed the KDC a UDP packet first. The current "solution".
-     */
-    public static void go(String... expected)
-            throws Exception {
-        try {
-            go0(expected);
-        } catch (BindException be) {
-            System.out.println("The random port is used by another process");
-        } catch (LoginException le) {
-            Throwable cause = le.getCause();
-            if (cause instanceof Asn1Exception) {
-                System.out.println("Bad packet possibly from another process");
-                return;
-            }
-            throw le;
-        }
-    }
-
-    public static void go0(String... expected)
-            throws Exception {
-        System.setProperty("sun.security.krb5.debug", "true");
-
-        // Idle UDP sockets will trigger a SocketTimeoutException, without it,
-        // a PortUnreachableException will be thrown.
-        DatagramSocket d1 = null, d2 = null, d3 = null;
-
-        // Make sure KDCs' ports starts with 1 and 2 and 3,
-        // useful for checking debug output.
-        int p1 = 10000 + new java.util.Random().nextInt(10000);
-        int p2 = 20000 + new java.util.Random().nextInt(10000);
-        int p3 = 30000 + new java.util.Random().nextInt(10000);
-
-        FileWriter fw = new FileWriter("alternative-krb5.conf");
-
-        fw.write("[libdefaults]\n" +
-                "default_realm = " + OneKDC.REALM + "\n" +
-                "kdc_timeout = " + toReal(2000) + "\n");
-        fw.write("[realms]\n" + OneKDC.REALM + " = {\n" +
-                "kdc = " + OneKDC.KDCHOST + ":" + p1 + "\n" +
-                "kdc = " + OneKDC.KDCHOST + ":" + p2 + "\n" +
-                "kdc = " + OneKDC.KDCHOST + ":" + p3 + "\n" +
-                "}\n");
-
-        fw.close();
-        System.setProperty("java.security.krb5.conf", "alternative-krb5.conf");
-        Config.refresh();
-
-        // Turn on k3 only
-        d1 = new DatagramSocket(p1);
-        d2 = new DatagramSocket(p2);
-        KDC k3 = on(p3);
-
-        test(expected[0]);
-        test(expected[1]);
-        Config.refresh();
-        test(expected[2]);
-
-        k3.terminate(); // shutdown k3
-        d3 = new DatagramSocket(p3);
-
-        d2.close();
-        on(p2);         // k2 is on
-
-        test(expected[3]);
-        d1.close();
-        on(p1);         // k1 and k2 is on
-        test(expected[4]);
-
-        d3.close();
-    }
-
-    private static KDC on(int p) throws Exception {
-        KDC k = new KDC(OneKDC.REALM, OneKDC.KDCHOST, p, true);
-        k.addPrincipal(OneKDC.USER, OneKDC.PASS);
-        k.addPrincipalRandKey("krbtgt/" + OneKDC.REALM);
-        // Feed a packet to newly started KDC to warm it up
-        System.err.println("-------- IGNORE THIS ERROR MESSAGE --------");
-        new DatagramSocket().send(
-                new DatagramPacket("Hello".getBytes(), 5,
-                        InetAddress.getByName(OneKDC.KDCHOST), p));
-        return k;
-    }
-
-    private static void test(String expected) throws Exception {
-        ByteArrayOutputStream bo = new ByteArrayOutputStream();
-        System.out.println("----------------- TEST -----------------");
-        try {
-            test0(bo, expected);
-        } catch (Exception e) {
-            System.out.println("----------------- ERROR -----------------");
-            System.out.println(new String(bo.toByteArray()));
-            System.out.println("--------------- ERROR END ---------------");
-            throw e;
-        }
-    }
-
-    /**
-     * One round of test for max_retries and timeout.
-     * @param expected the expected kdc# timeout kdc# timeout...
-     */
-    private static void test0(ByteArrayOutputStream bo, String expected)
-            throws Exception {
-        PrintStream oldout = System.out;
-        boolean failed = false;
-        System.setOut(new PrintStream(bo));
-        try {
-            Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
-        } catch (Exception e) {
-            failed = true;
-        } finally {
-            System.setOut(oldout);
-        }
-
-        String[] lines = new String(bo.toByteArray()).split("\n");
-        StringBuilder sb = new StringBuilder();
-        for (String line: lines) {
-            Matcher m = re.matcher(line);
-            if (m.find()) {
-                System.out.println(line);
-                sb.append(m.group(1))
-                        .append(toSymbolicSec(Integer.parseInt(m.group(2))));
-            }
-        }
-        if (failed) sb.append('-');
-
-        String output = sb.toString();
-        System.out.println("Expected: " + expected + ", actual " + output);
-        if (!output.matches(expected)) {
-            throw new Exception("Does not match");
-        }
-    }
-}
diff --git a/jdk/test/sun/security/krb5/auto/BadKdc1.java b/jdk/test/sun/security/krb5/auto/BadKdc1.java
deleted file mode 100644
index 0ac77b6..0000000
--- a/jdk/test/sun/security/krb5/auto/BadKdc1.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 6843127
- * @run main/othervm/timeout=300 BadKdc1
- * @summary krb5 should not try to access unavailable kdc too often
- */
-
-import java.security.Security;
-
-public class BadKdc1 {
-
-   public static void main(String[] args)
-           throws Exception {
-
-       // 5 sec is default timeout for tryLess
-       if (BadKdc.getRatio() > 2.5) {
-           Security.setProperty("krb5.kdc.bad.policy",
-                   "tryLess:1," + BadKdc.toReal(2000));
-       } else {
-           Security.setProperty("krb5.kdc.bad.policy", "tryLess");
-       }
-
-       BadKdc.go(
-               "121212222222(32){1,3}1222(32){1,3}", // 1 2
-               // The above line means try kdc1 for 2 seconds then kdc1
-               // for 2 seconds... finally kdc3 for 2 seconds.
-               "1222(32){1,3}1222(32){1,3}",    // 1 2
-               // refresh
-               "121212222222(32){1,3}1222(32){1,3}",  // 1 2
-               // k3 off k2 on
-               "(122212(22){1,3}|1222323232-)", // 1
-               // k1 on
-               "(12(12){1,3}|122212|122232-)"  // empty
-       );
-   }
-}
diff --git a/jdk/test/sun/security/krb5/auto/BadKdc2.java b/jdk/test/sun/security/krb5/auto/BadKdc2.java
deleted file mode 100644
index a490ca7..0000000
--- a/jdk/test/sun/security/krb5/auto/BadKdc2.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 6843127
- * @run main/othervm/timeout=300 BadKdc2
- * @summary krb5 should not try to access unavailable kdc too often
- */
-
-import java.io.*;
-import java.security.Security;
-
-public class BadKdc2 {
-
-    public static void main(String[] args)
-            throws Exception {
-
-        // 1 sec is too short.
-        BadKdc.setRatio(3.0f);
-
-        Security.setProperty(
-                "krb5.kdc.bad.policy", "tryLess:2," + BadKdc.toReal(1000));
-        BadKdc.go(
-                "121212222222(32){1,3}11112121(32){1,3}", // 1 2
-                "11112121(32){1,3}11112121(32){1,3}", // 1 2
-                // refresh
-                "121212222222(32){1,3}11112121(32){1,3}", // 1 2
-                // k3 off k2 on
-                "1111(21){1,3}1111(22){1,3}", // 1
-                // k1 on
-                "(11){1,3}(12){1,3}"  // empty
-        );
-    }
-}
diff --git a/jdk/test/sun/security/krb5/auto/BadKdc3.java b/jdk/test/sun/security/krb5/auto/BadKdc3.java
deleted file mode 100644
index 4bafd9a..0000000
--- a/jdk/test/sun/security/krb5/auto/BadKdc3.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 6843127
- * @run main/othervm/timeout=300 BadKdc3
- * @summary krb5 should not try to access unavailable kdc too often
- */
-
-import java.io.*;
-import java.security.Security;
-
-public class BadKdc3 {
-
-    public static void main(String[] args)
-            throws Exception {
-        Security.setProperty("krb5.kdc.bad.policy", "tryLast");
-        BadKdc.go(
-                "121212222222(32){2,4}", // 1 2
-                "(32){2,4}", // 1 2
-                // refresh
-                "121212222222(32){2,4}", // 1 2
-                // k3 off k2 on
-                "323232121212(22){2,4}", // 1 3
-                // k1 on
-                "(22){2,4}"  // 1 3
-        );
-    }
-}
diff --git a/jdk/test/sun/security/krb5/auto/BadKdc4.java b/jdk/test/sun/security/krb5/auto/BadKdc4.java
deleted file mode 100644
index 8d64db2..0000000
--- a/jdk/test/sun/security/krb5/auto/BadKdc4.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 6843127
- * @run main/othervm/timeout=300 BadKdc4
- * @summary krb5 should not try to access unavailable kdc too often
- */
-
-import java.io.*;
-import java.security.Security;
-
-public class BadKdc4 {
-
-    public static void main(String[] args)
-            throws Exception {
-        Security.setProperty("krb5.kdc.bad.policy", "");
-        BadKdc.go(
-            "121212222222(32){1,3}121212222222(32){1,3}",
-            "121212222222(32){1,3}121212222222(32){1,3}",
-            // refresh
-            "121212222222(32){1,3}121212222222(32){1,3}",
-            // k3 off k2 on
-            "121212(22){1,3}121212(22){1,3}",
-            // k1 on
-            "(12){2,4}"
-        );
-    }
-}
diff --git a/jdk/test/sun/security/krb5/auto/Basic.java b/jdk/test/sun/security/krb5/auto/Basic.java
index e61928b..6216bf3 100644
--- a/jdk/test/sun/security/krb5/auto/Basic.java
+++ b/jdk/test/sun/security/krb5/auto/Basic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,10 @@
 
 /*
  * @test
- * @bug 7152176 8164437
+ * @bug 7152176
  * @summary More krb5 tests
  * @compile -XDignore.symbol.file Basic.java
- * @run main/othervm
- *      Basic jdk.security.jgss
- * @run main/othervm --limit-modules java.security.jgss,jdk.security.auth
- *      Basic java.security.jgss
+ * @run main/othervm Basic
  */
 
 import sun.security.jgss.GSSUtil;
@@ -63,12 +60,5 @@
         b.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
 
         Context.handshake(s2, b);
-
-        // Bonus test for 8164437.
-        String moduleName = c.x().getClass().getModule().getName();
-        if (!moduleName.equals(args[0])) {
-            throw new Exception("Expected: " + args[0]
-                    + ". Actual: " + moduleName);
-        }
     }
 }
diff --git a/jdk/test/sun/security/krb5/auto/CommMatcher.java b/jdk/test/sun/security/krb5/auto/CommMatcher.java
deleted file mode 100644
index 1cfe25a..0000000
--- a/jdk/test/sun/security/krb5/auto/CommMatcher.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Matches the krb5 debug output:
- * >>> KDCCommunication: kdc=host UDP:11555, timeout=100,Attempt =1, #bytes=138
- *
- * Example:
- *   CommMatcher cm = new CommMatcher();
- *   cm.addPort(12345).addPort(23456);
- *   for (String line : debugOutput) {
- *       if (cm.match(line)) {
- *           println("KDC: %c, %s, Timeout: %d\n",
- *              cm.kdc(), cm.protocol(), cm.timeout());
- *       }
- *   }
- */
-public class CommMatcher {
-
-    static final Pattern re = Pattern.compile(
-            ">>> KDCCommunication: kdc=\\S+ (TCP|UDP):(\\d+), " +
-                    "timeout=(\\d+),Attempt\\s*=(\\d+)");
-
-    List<Integer> kdcPorts = new ArrayList<>();
-    Matcher matcher;
-
-    /**
-     * Add KDC ports one by one. The 1st KDC will be 'a' in {@link #kdc()},
-     * 2nd is 'b', etc, etc.
-     */
-    public CommMatcher addPort(int port) {
-        if (port > 0) {
-            kdcPorts.add(port);
-        } else {
-            kdcPorts.clear();
-        }
-        return this;
-    }
-
-    public boolean match(String line) {
-        matcher = re.matcher(line);
-        return matcher.find();
-    }
-
-    public String protocol() {
-        return matcher.group(1);
-    }
-
-    public char kdc() {
-        int port = Integer.parseInt(matcher.group(2));
-        return (char)(kdcPorts.indexOf(port) + 'a');
-    }
-
-    public int timeout() {
-        return BadKdc.toSymbolicSec(Integer.parseInt(matcher.group(3)));
-    }
-
-    public int attempt() {
-        return Integer.parseInt(matcher.group(4));
-    }
-}
diff --git a/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java b/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java
index 55f2d1a..1447d81 100644
--- a/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java
+++ b/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,16 @@
 /*
  * @test
  * @bug 6578647 6829283 8171340
+ * @modules java.base/sun.security.util
+ *          java.security.jgss/sun.security.krb5.internal:+open
+ *          java.security.jgss/sun.security.jgss
+ *          java.security.jgss/sun.security.krb5:+open
+ *          java.security.jgss/sun.security.krb5.internal.ccache
+ *          java.security.jgss/sun.security.krb5.internal.crypto
+ *          java.security.jgss/sun.security.krb5.internal.ktab
+ *          jdk.security.auth
+ *          jdk.security.jgss
+ *          jdk.httpserver
  * @run main/othervm HttpNegotiateServer
  * @summary Undefined requesting URL in java.net.Authenticator
  *          .getPasswordAuthentication()
diff --git a/jdk/test/sun/security/krb5/auto/MaxRetries.java b/jdk/test/sun/security/krb5/auto/MaxRetries.java
deleted file mode 100644
index 973873a..0000000
--- a/jdk/test/sun/security/krb5/auto/MaxRetries.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 6844193
- * @compile -XDignore.symbol.file MaxRetries.java
- * @run main/othervm/timeout=300 MaxRetries
- * @summary support max_retries in krb5.conf
- */
-
-import javax.security.auth.login.LoginException;
-import java.io.*;
-import java.net.DatagramSocket;
-import java.security.Security;
-
-public class MaxRetries {
-
-    static int idlePort = -1;
-    static CommMatcher cm = new CommMatcher();
-
-    public static void main(String[] args)
-            throws Exception {
-
-        System.setProperty("sun.security.krb5.debug", "true");
-        OneKDC kdc = new OneKDC(null).writeJAASConf();
-
-        // An idle UDP socket to prevent PortUnreachableException
-        DatagramSocket ds = new DatagramSocket();
-        idlePort = ds.getLocalPort();
-
-        cm.addPort(idlePort);
-        cm.addPort(kdc.getPort());
-
-        System.setProperty("java.security.krb5.conf", "alternative-krb5.conf");
-
-        Security.setProperty("krb5.kdc.bad.policy", "trylast");
-
-        // We always make the real timeout to be 1 second
-        BadKdc.setRatio(0.25f);
-        rewriteMaxRetries(4);
-
-        // Explanation: In this case, max_retries=4 and timeout=4s.
-        // For AS-REQ without preauth, we will see 4 4s timeout on kdc#1
-        // ("a4" repeat 4 times), and one 4s timeout on kdc#2 ("b4"). For
-        // AS-REQ with preauth, one 4s timeout on kdc#2 (second "b4").
-        // we tolerate 4 real timeout on kdc#2, so make it "(b4){2,6}".
-        test1("a4a4a4a4b4b4", "a4a4a4a4(b4){2,6}");
-        test1("b4b4", "(b4){2,6}");
-
-        BadKdc.setRatio(1f);
-        rewriteMaxRetries(1);
-        // Explanation: Since max_retries=1 only, we could fail in 1st or 2nd
-        // AS-REQ to kdc#2.
-        String actual = test1("a1b1b1", "(a1b1b1|a1b1x|a1b1b1x)");
-        if (actual.endsWith("x")) {
-            // If 1st attempt fails, all bads are back available
-            test1("a1b1b1", "(a1b1b1|a1b1x|a1b1b1x)");
-        } else {
-            test1("b1b1", "(b1b1|b1x|b1b1x)");
-        }
-
-        BadKdc.setRatio(0.2f);
-        rewriteMaxRetries(-1);
-        test1("a5a5a5b5b5", "a5a5a5(b5){2,4}");
-        test1("b5b5", "(b5){2,4}");
-
-        BadKdc.setRatio(0.25f);
-        Security.setProperty("krb5.kdc.bad.policy",
-                "tryless:1,1000");
-        rewriteMaxRetries(4);
-        test1("a4a4a4a4b4a4b4", "a4a4a4a4(b4){1,3}a4(b4){1,3}");
-        test1("a4b4a4b4", "a4(b4){1,3}a4(b4){1,3}");
-
-        BadKdc.setRatio(1f);
-        rewriteMaxRetries(1);
-        actual = test1("a1b1a1b1", "(a1b1|a1b1x|a1b1a1b1|a1b1a1b1x)");
-        if (actual.endsWith("x")) {
-            test1("a1b1a1b1", "(a1b1|a1b1x|a1b1a1b1|a1b1a1b1x)");
-        } else {
-            test1("a1b1a1b1", "(a1b1|a1b1x|a1b1a1b1|a1b1a1b1x)");
-        }
-
-        BadKdc.setRatio(.2f);
-        rewriteMaxRetries(-1);
-        test1("a5a5a5b5a5b5", "a5a5a5(b5){1,2}a5(b5){1,2}");
-        test1("a5b5a5b5", "a5(b5){1,2}a5(b5){1,2}");
-
-        BadKdc.setRatio(1f);
-        rewriteMaxRetries(2);
-        if (BadKdc.toReal(2000) > 1000) {
-            // Explanation: if timeout is longer than 1s in tryLess,
-            // we will see "a1" at 2nd kdc#1 access
-            test1("a2a2b2a1b2", "a2a2(b2){1,2}a1(b2){1,2}");
-        } else {
-            test1("a2a2b2a2b2", "a2a2(b2){1,2}a2(b2){1,2}");
-        }
-
-        BadKdc.setRatio(1f);
-
-        rewriteUdpPrefLimit(-1, -1);    // default, no limit
-        test2("UDP");
-
-        rewriteUdpPrefLimit(10, -1);    // global rules
-        test2("TCP");
-
-        rewriteUdpPrefLimit(10, 10000); // realm rules
-        test2("UDP");
-
-        rewriteUdpPrefLimit(10000, 10); // realm rules
-        test2("TCP");
-
-        ds.close();
-    }
-
-    /**
-     * One round of test for max_retries and timeout.
-     *
-     * @param exact the expected exact match, where no timeout
-     *              happens for real KDCs
-     * @param relaxed the expected relaxed match, where some timeout
-     *                could happen for real KDCs
-     * @return the actual result
-     */
-    private static String test1(String exact, String relaxed) throws Exception {
-        ByteArrayOutputStream bo = new ByteArrayOutputStream();
-        PrintStream oldout = System.out;
-        System.setOut(new PrintStream(bo));
-        boolean failed = false;
-        long start = System.nanoTime();
-        try {
-            Context c = Context.fromJAAS("client");
-        } catch (LoginException e) {
-            failed = true;
-        }
-        System.setOut(oldout);
-
-        String[] lines = new String(bo.toByteArray()).split("\n");
-        System.out.println("----------------- TEST (" + exact
-                + ") -----------------");
-
-        // Result, a series of timeout + kdc#
-        StringBuilder sb = new StringBuilder();
-        for (String line: lines) {
-            if (cm.match(line)) {
-                System.out.println(line);
-                sb.append(cm.kdc()).append(cm.timeout());
-            }
-        }
-        if (failed) {
-            sb.append("x");
-        }
-        System.out.println("Time: " + (System.nanoTime() - start) / 1000000000d);
-        String actual = sb.toString();
-        System.out.println("Actual: " + actual);
-        if (actual.equals(exact)) {
-            System.out.println("Exact match: " + exact);
-        } else if (actual.matches(relaxed)) {
-            System.out.println("!!!! Tolerant match: " + relaxed);
-        } else {
-            throw new Exception("Match neither " + exact + " nor " + relaxed);
-        }
-        return actual;
-    }
-
-    /**
-     * One round of test for udp_preference_limit.
-     * @param proto the expected protocol used
-     */
-    private static void test2(String proto) throws Exception {
-        ByteArrayOutputStream bo = new ByteArrayOutputStream();
-        PrintStream oldout = System.out;
-        System.setOut(new PrintStream(bo));
-        Context c = Context.fromJAAS("client");
-        System.setOut(oldout);
-
-        int count = 2;
-        String[] lines = new String(bo.toByteArray()).split("\n");
-        System.out.println("----------------- TEST -----------------");
-        for (String line: lines) {
-            if (cm.match(line)) {
-                System.out.println(line);
-                count--;
-                if (!cm.protocol().equals(proto)) {
-                    throw new Exception("Wrong protocol value");
-                }
-            }
-        }
-        if (count != 0) {
-            throw new Exception("Retry count is " + count + " less");
-        }
-    }
-
-    /**
-     * Set udp_preference_limit for global and realm
-     */
-    private static void rewriteUdpPrefLimit(int global, int realm)
-            throws Exception {
-        BufferedReader fr = new BufferedReader(new FileReader(OneKDC.KRB5_CONF));
-        FileWriter fw = new FileWriter("alternative-krb5.conf");
-        while (true) {
-            String s = fr.readLine();
-            if (s == null) {
-                break;
-            }
-            if (s.startsWith("[realms]")) {
-                // Reconfig global setting
-                fw.write("kdc_timeout = 5000\n");
-                if (global != -1) {
-                    fw.write("udp_preference_limit = " + global + "\n");
-                }
-            } else if (s.trim().startsWith("kdc = ")) {
-                if (realm != -1) {
-                    // Reconfig for realm
-                    fw.write("    udp_preference_limit = " + realm + "\n");
-                }
-            }
-            fw.write(s + "\n");
-        }
-        fr.close();
-        fw.close();
-        sun.security.krb5.Config.refresh();
-    }
-
-    /**
-     * Set max_retries and timeout value for realm. The global value is always
-     * 3 and 5000.
-     *
-     * @param value max_retries and timeout/1000 for a realm, -1 means none.
-     */
-    private static void rewriteMaxRetries(int value) throws Exception {
-        BufferedReader fr = new BufferedReader(new FileReader(OneKDC.KRB5_CONF));
-        FileWriter fw = new FileWriter("alternative-krb5.conf");
-        while (true) {
-            String s = fr.readLine();
-            if (s == null) {
-                break;
-            }
-            if (s.startsWith("[realms]")) {
-                // Reconfig global setting
-                fw.write("max_retries = 3\n");
-                fw.write("kdc_timeout = " + BadKdc.toReal(5000) + "\n");
-            } else if (s.trim().startsWith("kdc = ")) {
-                if (value != -1) {
-                    // Reconfig for realm
-                    fw.write("    max_retries = " + value + "\n");
-                    fw.write("    kdc_timeout = " + BadKdc.toReal(value*1000) + "\n");
-                }
-                // Add a bad KDC as the first candidate
-                fw.write("    kdc = localhost:" + idlePort + "\n");
-            }
-            fw.write(s + "\n");
-        }
-        fr.close();
-        fw.close();
-        sun.security.krb5.Config.refresh();
-    }
-}
diff --git a/jdk/test/sun/security/krb5/auto/ModuleName.java b/jdk/test/sun/security/krb5/auto/ModuleName.java
new file mode 100644
index 0000000..499d35a
--- /dev/null
+++ b/jdk/test/sun/security/krb5/auto/ModuleName.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8164437
+ * @summary GSSContext type when jdk.security.jgss is not available
+ * @library /test/lib
+ * @compile -XDignore.symbol.file ModuleName.java
+ * @run main/othervm ModuleName
+ */
+
+import jdk.test.lib.process.ProcessTools;
+import sun.security.jgss.GSSUtil;
+
+import java.util.List;
+import java.util.stream.Stream;
+
+public class ModuleName {
+
+    public static void main(String[] args) throws Throwable {
+
+        if (args.length == 0) { // jtreg launched here
+
+            // With all modules
+            test("jdk.security.jgss");
+
+            // With limited modules
+            List<String> cmd = ProcessTools.createJavaProcessBuilder().command();
+            Stream.of(jdk.internal.misc.VM.getRuntimeArguments())
+                    .filter(arg -> arg.startsWith("--add-exports=") ||
+                            arg.startsWith("--add-opens="))
+                    .forEach(cmd::add);
+            cmd.addAll(List.of(
+                    "-Dtest.src=" + System.getProperty("test.src"),
+                    "--add-modules",
+                        "java.base,java.security.jgss,jdk.security.auth",
+                    "--limit-modules",
+                        "java.security.jgss,jdk.security.auth",
+                    "ModuleName",
+                    "launched-limited"));
+            ProcessTools.executeCommand(cmd.toArray(new String[cmd.size()]))
+                    .shouldHaveExitValue(0);
+        } else { // Launched by ProcessTools above, with limited modules.
+            test("java.security.jgss");
+        }
+    }
+
+    static void test(String expected) throws Exception {
+
+        new OneKDC(null).writeJAASConf();
+
+        Context c = Context.fromJAAS("client");
+        c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID);
+
+        String moduleName = c.x().getClass().getModule().getName();
+        if (!moduleName.equals(expected)) {
+            throw new Exception("Expected: " + expected
+                    + ". Actual: " + moduleName);
+        }
+    }
+}
diff --git a/jdk/test/sun/security/krb5/auto/Renew.java b/jdk/test/sun/security/krb5/auto/Renew.java
index 41e3fcd..0c44149 100644
--- a/jdk/test/sun/security/krb5/auto/Renew.java
+++ b/jdk/test/sun/security/krb5/auto/Renew.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,12 +26,6 @@
  * @bug 8058290
  * @summary JAAS Krb5LoginModule has suspect ticket-renewal logic,
  *          relies on clockskew grace
- * @modules java.base/sun.security.util
- *          java.security.jgss/sun.security.krb5:+open
- *          java.security.jgss/sun.security.krb5.internal:+open
- *          java.security.jgss/sun.security.krb5.internal.ccache
- *          java.security.jgss/sun.security.krb5.internal.crypto
- *          java.security.jgss/sun.security.krb5.internal.ktab
  * @compile -XDignore.symbol.file Renew.java
  * @run main/othervm Renew 1
  * @run main/othervm Renew 2
diff --git a/jdk/test/sun/security/krb5/auto/TEST.properties b/jdk/test/sun/security/krb5/auto/TEST.properties
index 777c20d..fa23fd6 100644
--- a/jdk/test/sun/security/krb5/auto/TEST.properties
+++ b/jdk/test/sun/security/krb5/auto/TEST.properties
@@ -6,4 +6,6 @@
         java.security.jgss/sun.security.krb5.internal.ccache \
         java.security.jgss/sun.security.krb5.internal.rcache \
         java.security.jgss/sun.security.krb5.internal.crypto \
-        java.security.jgss/sun.security.krb5.internal.ktab
+        java.security.jgss/sun.security.krb5.internal.ktab \
+        jdk.security.auth \
+        jdk.security.jgss
diff --git a/jdk/test/sun/security/krb5/auto/TcpTimeout.java b/jdk/test/sun/security/krb5/auto/TcpTimeout.java
deleted file mode 100644
index 45699fb..0000000
--- a/jdk/test/sun/security/krb5/auto/TcpTimeout.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 6952519
- * @compile -XDignore.symbol.file TcpTimeout.java
- * @run main/othervm TcpTimeout
- * @summary kdc_timeout is not being honoured when using TCP
- */
-
-import java.io.*;
-import java.net.ServerSocket;
-import sun.security.krb5.Config;
-
-public class TcpTimeout {
-    public static void main(String[] args)
-            throws Exception {
-
-        // Set debug to grab debug output like ">>> KDCCommunication"
-        System.setProperty("sun.security.krb5.debug", "true");
-
-        // Called before new ServerSocket on p1 and p2 to make sure
-        // customized nameservice is used
-        KDC k = new KDC(OneKDC.REALM, OneKDC.KDCHOST, 0, true);
-        int p3 = k.getPort();
-        k.addPrincipal(OneKDC.USER, OneKDC.PASS);
-        k.addPrincipalRandKey("krbtgt/" + OneKDC.REALM);
-
-        // Start two listener that does not communicate, simulate timeout
-        ServerSocket ss1 = null;
-        ServerSocket ss2 = null;
-
-        try {
-            ss1 = new ServerSocket(0);
-            ss2 = new ServerSocket(0);
-            int p1 = ss1.getLocalPort();
-            int p2 = ss2.getLocalPort();
-
-            FileWriter fw = new FileWriter("alternative-krb5.conf");
-
-            fw.write("[libdefaults]\n" +
-                    "udp_preference_limit = 1\n" +
-                    "max_retries = 2\n" +
-                    "default_realm = " + OneKDC.REALM + "\n" +
-                    "kdc_timeout = " + BadKdc.toReal(5000) + "\n");
-            fw.write("[realms]\n" + OneKDC.REALM + " = {\n" +
-                    "kdc = " + OneKDC.KDCHOST + ":" + p1 + "\n" +
-                    "kdc = " + OneKDC.KDCHOST + ":" + p2 + "\n" +
-                    "kdc = " + OneKDC.KDCHOST + ":" + p3 + "\n" +
-                    "}\n");
-
-            fw.close();
-            System.setProperty("java.security.krb5.conf",
-                    "alternative-krb5.conf");
-            Config.refresh();
-
-            System.out.println("Ports opened on " + p1 + ", " + p2 + ", " + p3);
-
-            // The correct behavior should be:
-            // 5 sec on p1, 5 sec on p1, fail
-            // 5 sec on p2, 5 sec on p2, fail
-            // p3 ok, p3 ok again for preauth.
-            int count = 6;
-
-            ByteArrayOutputStream bo = new ByteArrayOutputStream();
-            PrintStream oldout = System.out;
-            System.setOut(new PrintStream(bo));
-            Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
-            System.setOut(oldout);
-
-            String[] lines = new String(bo.toByteArray()).split("\n");
-            for (String line: lines) {
-                if (line.startsWith(">>> KDCCommunication")) {
-                    System.out.println(line);
-                    count--;
-                }
-            }
-            if (count != 0) {
-                throw new Exception("Retry count is " + count + " less");
-            }
-        } finally {
-            if (ss1 != null) ss1.close();
-            if (ss2 != null) ss2.close();
-        }
-    }
-}
diff --git a/jdk/test/sun/security/krb5/auto/UdpTcp.java b/jdk/test/sun/security/krb5/auto/UdpTcp.java
deleted file mode 100644
index ae54b79..0000000
--- a/jdk/test/sun/security/krb5/auto/UdpTcp.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 4966382 8039132
- * @run main/othervm UdpTcp UDP
- * @run main/othervm UdpTcp TCP
- * @summary udp or tcp
- */
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import sun.security.krb5.Config;
-
-public class UdpTcp {
-
-    public static void main(String[] args)
-            throws Exception {
-
-        System.setProperty("sun.security.krb5.debug", "true");
-
-        OneKDC kdc = new OneKDC(null);
-        kdc.writeJAASConf();
-
-        // Two styles of kdc_timeout setting. One global, one realm-specific.
-        if (args[0].equals("UDP")) {
-            KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
-                    "kdc_timeout = 10s");
-        } else {
-            kdc.addConf("kdc_timeout = 10s");
-            KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
-                    "udp_preference_limit = 1");
-        }
-        Config.refresh();
-
-        ByteArrayOutputStream bo = new ByteArrayOutputStream();
-        PrintStream oldout = System.out;
-        System.setOut(new PrintStream(bo));
-        Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
-        System.setOut(oldout);
-
-        for (String line: new String(bo.toByteArray()).split("\n")) {
-            if (line.contains(">>> KDCCommunication")) {
-                if (!line.contains(args[0]) || !line.contains("timeout=10000")) {
-                    throw new Exception("No " + args[0] + " in: " + line);
-                }
-            }
-        }
-    }
-}
diff --git a/jdk/test/sun/security/mscapi/IsSunMSCAPIAvailable.java b/jdk/test/sun/security/mscapi/IsSunMSCAPIAvailable.java
index ba1cff4..28a2242 100644
--- a/jdk/test/sun/security/mscapi/IsSunMSCAPIAvailable.java
+++ b/jdk/test/sun/security/mscapi/IsSunMSCAPIAvailable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
  * @bug 6318171 6931562
  * @requires os.family == "windows"
  * @modules jdk.crypto.mscapi/sun.security.mscapi
- * @compile --add-modules jdk.crypto.mscapi IsSunMSCAPIAvailable.java
  * @run main/othervm IsSunMSCAPIAvailable
  */
 
diff --git a/jdk/test/sun/security/mscapi/SignedObjectChain.java b/jdk/test/sun/security/mscapi/SignedObjectChain.java
index d436612..0c5a409 100644
--- a/jdk/test/sun/security/mscapi/SignedObjectChain.java
+++ b/jdk/test/sun/security/mscapi/SignedObjectChain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,10 @@
 /*
  * @test
  * @bug 8050374
+ * @summary Verify a chain of signed objects
  * @compile ../../../java/security/SignedObject/Chain.java
  * @requires os.family == "windows"
- * @summary Verify a chain of signed objects
+ * @run main SignedObjectChain
  */
 public class SignedObjectChain {
 
diff --git a/jdk/test/sun/security/pkcs/pkcs8/PKCS8Test.java b/jdk/test/sun/security/pkcs/pkcs8/PKCS8Test.java
index 9c3f40b..6e893cd 100644
--- a/jdk/test/sun/security/pkcs/pkcs8/PKCS8Test.java
+++ b/jdk/test/sun/security/pkcs/pkcs8/PKCS8Test.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -195,12 +195,12 @@
     public static void main(String[] args)
             throws IOException, InvalidKeyException {
 
-        BigInteger p = BigInteger.valueOf(1);
-        BigInteger q = BigInteger.valueOf(2);
-        BigInteger g = BigInteger.valueOf(3);
-        BigInteger x = BigInteger.valueOf(4);
+        BigInteger x = BigInteger.valueOf(1);
+        BigInteger p = BigInteger.valueOf(2);
+        BigInteger q = BigInteger.valueOf(3);
+        BigInteger g = BigInteger.valueOf(4);
 
-        DSAPrivateKey priv = new DSAPrivateKey(p, q, g, x);
+        DSAPrivateKey priv = new DSAPrivateKey(x, p, q, g);
 
         byte[] encodedKey = priv.getEncoded();
         byte[] expectedBytes = new byte[EXPECTED.length];
diff --git a/jdk/test/sun/security/pkcs/pkcs8/TestLeadingZeros.java b/jdk/test/sun/security/pkcs/pkcs8/TestLeadingZeros.java
new file mode 100644
index 0000000..92a2045
--- /dev/null
+++ b/jdk/test/sun/security/pkcs/pkcs8/TestLeadingZeros.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8175251
+ * @summary ensure that PKCS8-encoded private key with leading 0s
+ * can be loaded.
+ * @run main TestLeadingZeros
+ */
+
+import java.io.*;
+import java.security.*;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.interfaces.*;
+import java.util.*;
+
+public class TestLeadingZeros {
+
+    // The following test vectors are various BER encoded PKCS8 bytes
+    static final String[] PKCS8_ENCODINGS  = {
+        // first is the original one from PKCS8Test
+        "301e020100301206052b0e03020c30090201020201030201040403020101A000",
+        // changed original to version w/ 1 leading 0
+        "301f02020000301206052b0e03020c30090201020201030201040403020101A000",
+        // changed original to P w/ 1 leading 0
+        "301f020100301306052b0e03020c300a020200020201030201040403020101A000",
+        // changed original to X w/ 2 leading 0s
+        "3020020100301206052b0e03020c300902010202010302010404050203000001A000"
+    };
+
+    public static void main(String[] argv) throws Exception {
+        KeyFactory factory = KeyFactory.getInstance("DSA", "SUN");
+
+        for (String encodings : PKCS8_ENCODINGS) {
+            byte[] encodingBytes = hexToBytes(encodings);
+            PKCS8EncodedKeySpec encodedKeySpec =
+                new PKCS8EncodedKeySpec(encodingBytes);
+            DSAPrivateKey privKey2 = (DSAPrivateKey)
+                factory.generatePrivate(encodedKeySpec);
+            System.out.println("key: " + privKey2);
+        }
+        System.out.println("Test Passed");
+    }
+
+    private static byte[] hexToBytes(String hex) {
+        if (hex.length() % 2 != 0) {
+            throw new RuntimeException("Input should be even length");
+        }
+        int size = hex.length() / 2;
+        byte[] result = new byte[size];
+        for (int i = 0; i < size; i++) {
+            int hi = Character.digit(hex.charAt(2 * i), 16);
+            int lo = Character.digit(hex.charAt(2 * i + 1), 16);
+            if ((hi == -1) || (lo == -1)) {
+                throw new RuntimeException("Input should be hexadecimal");
+            }
+            result[i] = (byte) (16 * hi + lo);
+        }
+        return result;
+    }
+}
diff --git a/jdk/test/sun/security/pkcs11/ec/TestCurves.java b/jdk/test/sun/security/pkcs11/ec/TestCurves.java
index 6cf32c4..a610d6b 100644
--- a/jdk/test/sun/security/pkcs11/ec/TestCurves.java
+++ b/jdk/test/sun/security/pkcs11/ec/TestCurves.java
@@ -28,7 +28,6 @@
  * @author Andreas Sterbenz
  * @library ..
  * @modules jdk.crypto.cryptoki/sun.security.pkcs11.wrapper
- * @compile --add-modules jdk.crypto.cryptoki TestCurves.java
  * @run main/othervm TestCurves
  * @run main/othervm TestCurves sm
  * @key randomness
diff --git a/jdk/test/sun/security/provider/PolicyFile/Modules.java b/jdk/test/sun/security/provider/PolicyFile/Modules.java
index fa7d33a..a3f1e82 100644
--- a/jdk/test/sun/security/provider/PolicyFile/Modules.java
+++ b/jdk/test/sun/security/provider/PolicyFile/Modules.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
  *          jdk.net
  *          jdk.security.auth
  *          jdk.security.jgss
- * @compile --add-modules=java.xml.ws,java.smartcardio Modules.java
  * @run main/othervm/java.security.policy==modules.policy Modules
  */
 
diff --git a/jdk/test/sun/security/rsa/SignedObjectChain.java b/jdk/test/sun/security/rsa/SignedObjectChain.java
index 7bda7cd..cc41d17 100644
--- a/jdk/test/sun/security/rsa/SignedObjectChain.java
+++ b/jdk/test/sun/security/rsa/SignedObjectChain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,9 @@
 /*
  * @test
  * @bug 8050374
- * @compile ../../../java/security/SignedObject/Chain.java
  * @summary Verify a chain of signed objects
+ * @compile ../../../java/security/SignedObject/Chain.java
+ * @run main SignedObjectChain
  */
 public class SignedObjectChain {
 
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/JSSEClient.java b/jdk/test/sun/security/ssl/CertPathRestrictions/JSSEClient.java
new file mode 100644
index 0000000..636809b
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/JSSEClient.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
+
+/*
+ * A SSL socket client.
+ */
+public class JSSEClient {
+
+    public static void main(String[] args) throws Exception {
+        System.out.println("Client: arguments=" + String.join("; ", args));
+
+        int port = Integer.valueOf(args[0]);
+        String[] trustNames = args[1].split(TLSRestrictions.DELIMITER);
+        String[] certNames = args[2].split(TLSRestrictions.DELIMITER);
+        String constraint = args[3];
+
+        TLSRestrictions.setConstraint("Client", constraint);
+
+        SSLContext context = TLSRestrictions.createSSLContext(
+                trustNames, certNames);
+        SSLSocketFactory socketFactory = context.getSocketFactory();
+        try (SSLSocket socket = (SSLSocket) socketFactory.createSocket()) {
+            socket.connect(new InetSocketAddress("localhost", port),
+                    TLSRestrictions.TIMEOUT);
+            socket.setSoTimeout(TLSRestrictions.TIMEOUT);
+            System.out.println("Client: connected");
+
+            InputStream sslIS = socket.getInputStream();
+            OutputStream sslOS = socket.getOutputStream();
+            sslOS.write('C');
+            sslOS.flush();
+            sslIS.read();
+            System.out.println("Client: finished");
+        } catch (Exception e) {
+            throw new RuntimeException("Client: failed.", e);
+        }
+    }
+}
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/JSSEServer.java b/jdk/test/sun/security/ssl/CertPathRestrictions/JSSEServer.java
new file mode 100644
index 0000000..80d76e9
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/JSSEServer.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLServerSocket;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSocket;
+
+/*
+ * A SSL socket server.
+ */
+public class JSSEServer {
+
+    private SSLServerSocket server = null;
+
+    private Exception exception = null;
+
+    public JSSEServer(SSLContext context, String constraint,
+            boolean needClientAuth) throws Exception {
+        TLSRestrictions.setConstraint("Server", constraint);
+
+        SSLServerSocketFactory serverFactory = context.getServerSocketFactory();
+        server = (SSLServerSocket) serverFactory.createServerSocket(0);
+        server.setSoTimeout(TLSRestrictions.TIMEOUT);
+        server.setNeedClientAuth(needClientAuth); // for dual authentication
+        System.out.println("Server: port=" + getPort());
+    }
+
+    public void start() {
+        new Thread(new Runnable() {
+
+            @Override
+            public void run() {
+                try {
+                    System.out.println("Server: started");
+                    try (SSLSocket socket = (SSLSocket) server.accept()) {
+                        socket.setSoTimeout(TLSRestrictions.TIMEOUT);
+                        InputStream sslIS = socket.getInputStream();
+                        OutputStream sslOS = socket.getOutputStream();
+                        sslIS.read();
+                        sslOS.write('S');
+                        sslOS.flush();
+                        System.out.println("Server: finished");
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace(System.out);
+                    exception = e;
+                }
+            }
+        }).start();
+    }
+
+    public int getPort() {
+        return server.getLocalPort();
+    }
+
+    public Exception getException() {
+        return exception;
+    }
+}
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java
new file mode 100644
index 0000000..35293d1
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/TLSRestrictions.java
@@ -0,0 +1,544 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.SocketTimeoutException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.security.KeyFactory;
+import java.security.KeyStore;
+import java.security.PrivateKey;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.util.Base64;
+import java.util.stream.Collectors;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.TrustManagerFactory;
+
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+
+/*
+ * @test
+ * @summary Verify the restrictions for certificate path on JSSE with custom trust store.
+ * @library /test/lib
+ * @compile JSSEClient.java
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions DEFAULT
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C1
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions S1
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C2
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions S2
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C3
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions S3
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C4
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions S4
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C5
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions S5
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C6
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions S6
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C7
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions S7
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C8
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions S8
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions C9
+ * @run main/othervm -Djava.security.debug=certpath TLSRestrictions S9
+ */
+public class TLSRestrictions {
+
+    private static final String TEST_CLASSES = System.getProperty("test.classes");
+    private static final char[] PASSWORD = "".toCharArray();
+    private static final String CERT_DIR = System.getProperty("cert.dir",
+            System.getProperty("test.src") + "/certs");
+
+    static final String PROP = "jdk.certpath.disabledAlgorithms";
+    static final String NOSHA1 = "MD2, MD5";
+    private static final String TLSSERVER = "SHA1 usage TLSServer";
+    private static final String TLSCLIENT = "SHA1 usage TLSClient";
+    static final String JDKCATLSSERVER = "SHA1 jdkCA & usage TLSServer";
+    static final String JDKCATLSCLIENT = "SHA1 jdkCA & usage TLSClient";
+
+    // This is a space holder in command arguments, and stands for none certificate.
+    static final String NONE_CERT = "NONE_CERT";
+
+    static final String DELIMITER = ",";
+    static final int TIMEOUT = 30000;
+
+    // It checks if java.security contains constraint "SHA1 jdkCA & usage TLSServer"
+    // for jdk.certpath.disabledAlgorithms by default.
+    private static void checkDefaultConstraint() {
+        System.out.println(
+                "Case: Checks the default value of jdk.certpath.disabledAlgorithms");
+        if (!Security.getProperty(PROP).contains(JDKCATLSSERVER)) {
+            throw new RuntimeException(String.format(
+                    "%s doesn't contain constraint \"%s\", the real value is \"%s\".",
+                    PROP, JDKCATLSSERVER, Security.getProperty(PROP)));
+        }
+    }
+
+    /*
+     * This method creates trust store and key store with specified certificates
+     * respectively. And then it creates SSL context with the stores.
+     * If trustNames contains NONE_CERT only, it does not create a custom trust
+     * store, but the default one in JDK.
+     *
+     * @param trustNames Trust anchors, which are used to create custom trust store.
+     *                   If null, no custom trust store is created and the default
+     *                   trust store in JDK is used.
+     * @param certNames Certificate chain, which is used to create key store.
+     *                  It cannot be null.
+     */
+    static SSLContext createSSLContext(String[] trustNames,
+            String[] certNames) throws Exception {
+        CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+
+        TrustManagerFactory tmf = null;
+        if (trustNames != null && trustNames.length > 0
+                && !trustNames[0].equals(NONE_CERT)) {
+            KeyStore trustStore = KeyStore.getInstance("JKS");
+            trustStore.load(null, null);
+            for (int i = 0; i < trustNames.length; i++) {
+                try (InputStream is = new ByteArrayInputStream(
+                        loadCert(trustNames[i]).getBytes())) {
+                    Certificate trustCert = certFactory.generateCertificate(is);
+                    trustStore.setCertificateEntry("trustCert-" + i, trustCert);
+                }
+            }
+
+            tmf = TrustManagerFactory.getInstance("PKIX");
+            tmf.init(trustStore);
+        }
+
+        Certificate[] certChain = new Certificate[certNames.length];
+        for (int i = 0; i < certNames.length; i++) {
+            try (InputStream is = new ByteArrayInputStream(
+                    loadCert(certNames[i]).getBytes())) {
+                Certificate cert = certFactory.generateCertificate(is);
+                certChain[i] = cert;
+            }
+        }
+
+        PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(
+                Base64.getMimeDecoder().decode(loadPrivKey(certNames[0])));
+        KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+        PrivateKey privKey = keyFactory.generatePrivate(privKeySpec);
+
+        KeyStore keyStore = KeyStore.getInstance("JKS");
+        keyStore.load(null, null);
+        keyStore.setKeyEntry("keyCert", privKey, PASSWORD, certChain);
+
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509");
+        kmf.init(keyStore, PASSWORD);
+
+        SSLContext context = SSLContext.getInstance("TLS");
+        context.init(kmf.getKeyManagers(),
+                tmf == null ? null : tmf.getTrustManagers(), null);
+        return context;
+    }
+
+    /*
+     * This method sets jdk.certpath.disabledAlgorithms, and then retrieves
+     * and prints its value.
+     */
+    static void setConstraint(String side, String constraint) {
+        System.out.printf("%s: Old %s=%s%n", side, PROP,
+                Security.getProperty(PROP));
+        Security.setProperty(PROP, constraint);
+        System.out.printf("%s: New %s=%s%n", side, PROP,
+                Security.getProperty(PROP));
+    }
+
+    /*
+     * This method is used to run a variety of cases.
+     * It launches a server, and then takes a client to connect the server.
+     * Both of server and client use the same certificates.
+     *
+     * @param trustNames Trust anchors, which are used to create custom trust store.
+     *                   If null, the default trust store in JDK is used.
+     * @param certNames Certificate chain, which is used to create key store.
+     *                  It cannot be null. The first certificate is regarded as
+     *                  the end entity.
+     * @param serverConstraint jdk.certpath.disabledAlgorithms value on server side.
+     * @param clientConstraint jdk.certpath.disabledAlgorithms value on client side.
+     * @param needClientAuth If true, server side acquires client authentication;
+     *                       otherwise, false.
+     * @param pass If true, the connection should be blocked; otherwise, false.
+     */
+    static void testConstraint(String[] trustNames, String[] certNames,
+            String serverConstraint, String clientConstraint,
+            boolean needClientAuth, boolean pass) throws Exception {
+        String trustNameStr = trustNames == null ? ""
+                : String.join(DELIMITER, trustNames);
+        String certNameStr = certNames == null ? ""
+                : String.join(DELIMITER, certNames);
+
+        System.out.printf("Case:%n"
+                + "  trustNames=%s; certNames=%s%n"
+                + "  serverConstraint=%s; clientConstraint=%s%n"
+                + "  needClientAuth=%s%n"
+                + "  pass=%s%n%n",
+                trustNameStr, certNameStr,
+                serverConstraint, clientConstraint,
+                needClientAuth,
+                pass);
+
+        JSSEServer server = new JSSEServer(
+                createSSLContext(trustNames, certNames),
+                serverConstraint,
+                needClientAuth);
+        int port = server.getPort();
+        server.start();
+
+        // Run client on another JVM so that its properties cannot be in conflict
+        // with server's.
+        OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
+                "-Dcert.dir=" + CERT_DIR,
+                "-Djava.security.debug=certpath",
+                "-classpath",
+                TEST_CLASSES,
+                "JSSEClient",
+                port + "",
+                trustNameStr,
+                certNameStr,
+                clientConstraint);
+        int exitValue = outputAnalyzer.getExitValue();
+        String clientOut = outputAnalyzer.getOutput();
+
+        Exception serverException = server.getException();
+        if (serverException != null) {
+            System.out.println("Server: failed");
+        }
+
+        System.out.println("---------- Client output start ----------");
+        System.out.println(clientOut);
+        System.out.println("---------- Client output end ----------");
+
+        if (serverException instanceof SocketTimeoutException
+                || clientOut.contains("SocketTimeoutException")) {
+            System.out.println("The communication gets timeout and skips the test.");
+            return;
+        }
+
+        if (pass) {
+            if (serverException != null || exitValue != 0) {
+                throw new RuntimeException(
+                        "Unexpected failure. Operation was blocked.");
+            }
+        } else {
+            if (serverException == null && exitValue == 0) {
+                throw new RuntimeException(
+                        "Unexpected pass. Operation was allowed.");
+            }
+
+            // The test may encounter non-SSL issues, like network problem.
+            if (!(serverException instanceof SSLHandshakeException
+                    || clientOut.contains("SSLHandshakeException"))) {
+                throw new RuntimeException("Failure with unexpected exception.");
+            }
+        }
+    }
+
+    /*
+     * This method is used to run a variety of cases, which don't require client
+     * authentication by default.
+     */
+    static void testConstraint(String[] trustNames, String[] certNames,
+            String serverConstraint, String clientConstraint, boolean pass)
+            throws Exception {
+        testConstraint(trustNames, certNames, serverConstraint, clientConstraint,
+                false, pass);
+    }
+
+    public static void main(String[] args) throws Exception {
+        switch (args[0]) {
+        // Case DEFAULT only checks one of default settings for
+        // jdk.certpath.disabledAlgorithms in JDK/conf/security/java.security.
+        case "DEFAULT":
+            checkDefaultConstraint();
+            break;
+
+        // Cases C1 and S1 use SHA256 root CA in trust store,
+        // and use SHA256 end entity in key store.
+        // C1 only sets constraint "SHA1 usage TLSServer" on client side;
+        // S1 only sets constraint "SHA1 usage TLSClient" on server side with client auth.
+        // The connection of the both cases should not be blocked.
+        case "C1":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA256" },
+                    new String[] { "INTER_CA_SHA256-ROOT_CA_SHA256" },
+                    NOSHA1,
+                    TLSSERVER,
+                    true);
+            break;
+        case "S1":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA256" },
+                    new String[] { "INTER_CA_SHA256-ROOT_CA_SHA256" },
+                    TLSCLIENT,
+                    NOSHA1,
+                    true,
+                    true);
+            break;
+
+        // Cases C2 and S2 use SHA256 root CA in trust store,
+        // and use SHA1 end entity in key store.
+        // C2 only sets constraint "SHA1 usage TLSServer" on client side;
+        // S2 only sets constraint "SHA1 usage TLSClient" on server side with client auth.
+        // The connection of the both cases should be blocked.
+        case "C2":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA256" },
+                    new String[] { "INTER_CA_SHA1-ROOT_CA_SHA256" },
+                    NOSHA1,
+                    TLSSERVER,
+                    false);
+            break;
+        case "S2":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA256" },
+                    new String[] { "INTER_CA_SHA1-ROOT_CA_SHA256" },
+                    TLSCLIENT,
+                    NOSHA1,
+                    true,
+                    false);
+            break;
+
+        // Cases C3 and S3 use SHA1 root CA in trust store,
+        // and use SHA1 end entity in key store.
+        // C3 only sets constraint "SHA1 usage TLSServer" on client side;
+        // S3 only sets constraint "SHA1 usage TLSClient" on server side with client auth.
+        // The connection of the both cases should be blocked.
+        case "C3":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA1" },
+                    new String[] { "INTER_CA_SHA1-ROOT_CA_SHA1" },
+                    NOSHA1,
+                    TLSSERVER,
+                    false);
+            break;
+        case "S3":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA1" },
+                    new String[] { "INTER_CA_SHA1-ROOT_CA_SHA1" },
+                    TLSCLIENT,
+                    NOSHA1,
+                    true,
+                    false);
+            break;
+
+        // Cases C4 and S4 use SHA1 root CA as trust store,
+        // and use SHA256 end entity in key store.
+        // C4 only sets constraint "SHA1 usage TLSServer" on client side;
+        // S4 only sets constraint "SHA1 usage TLSClient" on server side with client auth.
+        // The connection of the both cases should not be blocked.
+        case "C4":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA1" },
+                    new String[] { "INTER_CA_SHA256-ROOT_CA_SHA1" },
+                    NOSHA1,
+                    TLSSERVER,
+                    true);
+            break;
+        case "S4":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA1" },
+                    new String[] { "INTER_CA_SHA256-ROOT_CA_SHA1" },
+                    TLSCLIENT,
+                    NOSHA1,
+                    true,
+                    true);
+            break;
+
+        // Cases C5 and S5 use SHA1 root CA in trust store,
+        // and use SHA256 intermediate CA and SHA256 end entity in key store.
+        // C5 only sets constraint "SHA1 usage TLSServer" on client side;
+        // S5 only sets constraint "SHA1 usage TLSClient" on server side with client auth.
+        // The connection of the both cases should not be blocked.
+        case "C5":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA1" },
+                    new String[] {
+                            "END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA1",
+                            "INTER_CA_SHA256-ROOT_CA_SHA1" },
+                    NOSHA1,
+                    TLSSERVER,
+                    true);
+            break;
+        case "S5":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA1" },
+                    new String[] {
+                            "END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA1",
+                            "INTER_CA_SHA256-ROOT_CA_SHA1" },
+                    TLSCLIENT,
+                    NOSHA1,
+                    true,
+                    true);
+            break;
+
+        // Cases C6 and S6 use SHA1 root CA as trust store,
+        // and use SHA1 intermediate CA and SHA256 end entity in key store.
+        // C6 only sets constraint "SHA1 usage TLSServer" on client side;
+        // S6 only sets constraint "SHA1 usage TLSClient" on server side with client auth.
+        // The connection of the both cases should be blocked.
+        case "C6":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA1" },
+                    new String[] {
+                            "END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA1",
+                            "INTER_CA_SHA1-ROOT_CA_SHA1" },
+                    NOSHA1,
+                    TLSSERVER,
+                    false);
+            break;
+        case "S6":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA1" },
+                    new String[] {
+                            "END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA1",
+                            "INTER_CA_SHA1-ROOT_CA_SHA1" },
+                    TLSCLIENT,
+                    NOSHA1,
+                    true,
+                    false);
+            break;
+
+        // Cases C7 and S7 use SHA256 root CA in trust store,
+        // and use SHA256 intermediate CA and SHA1 end entity in key store.
+        // C7 only sets constraint "SHA1 usage TLSServer" on client side;
+        // S7 only sets constraint "SHA1 usage TLSClient" on server side with client auth.
+        // The connection of the both cases should be blocked.
+        case "C7":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA256" },
+                    new String[] {
+                            "END_ENTITY_SHA1-INTER_CA_SHA256-ROOT_CA_SHA256",
+                            "INTER_CA_SHA256-ROOT_CA_SHA256" },
+                    NOSHA1,
+                    TLSSERVER,
+                    false);
+            break;
+        case "S7":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA256" },
+                    new String[] {
+                            "END_ENTITY_SHA1-INTER_CA_SHA256-ROOT_CA_SHA256",
+                            "INTER_CA_SHA256-ROOT_CA_SHA256" },
+                    TLSCLIENT,
+                    NOSHA1,
+                    true,
+                    false);
+            break;
+
+        // Cases C8 and S8 use SHA256 root CA in trust store,
+        // and use SHA1 intermediate CA and SHA256 end entity in key store.
+        // C8 only sets constraint "SHA1 usage TLSServer" on client side;
+        // S8 only sets constraint "SHA1 usage TLSClient" on server side with client auth.
+        // The connection of the both cases should be blocked.
+        case "C8":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA256" },
+                    new String[] {
+                            "END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256",
+                            "INTER_CA_SHA1-ROOT_CA_SHA256" },
+                    NOSHA1,
+                    TLSSERVER,
+                    false);
+            break;
+        case "S8":
+            testConstraint(
+                    new String[] { "ROOT_CA_SHA256" },
+                    new String[] {
+                            "END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256",
+                            "INTER_CA_SHA1-ROOT_CA_SHA256" },
+                    TLSCLIENT,
+                    NOSHA1,
+                    true,
+                    false);
+            break;
+
+        // Cases C9 and S9 use SHA256 root CA and SHA1 intermediate CA in trust store,
+        // and use SHA256 end entity in key store.
+        // C9 only sets constraint "SHA1 usage TLSServer" on client side;
+        // S9 only sets constraint "SHA1 usage TLSClient" on server side with client auth.
+        // The connection of the both cases should not be blocked.
+        case "C9":
+            testConstraint(
+                    new String[] {
+                            "ROOT_CA_SHA256",
+                            "INTER_CA_SHA1-ROOT_CA_SHA256" },
+                    new String[] {
+                            "END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256" },
+                    NOSHA1,
+                    TLSSERVER,
+                    true);
+            break;
+        case "S9":
+            testConstraint(
+                    new String[] {
+                            "ROOT_CA_SHA256",
+                            "INTER_CA_SHA1-ROOT_CA_SHA256" },
+                    new String[] {
+                            "END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256" },
+                    TLSCLIENT,
+                    NOSHA1,
+                    true,
+                    true);
+            break;
+        }
+
+        System.out.println("Case passed");
+        System.out.println("========================================");
+    }
+
+    private static String loadCert(String certName) {
+        try {
+            Path certFilePath = Paths.get(CERT_DIR, certName + ".cer");
+            return String.join("\n",
+                    Files.lines(certFilePath).filter((String line) -> {
+                        return !line.startsWith("Certificate")
+                                && !line.startsWith(" ");
+                    }).collect(Collectors.toList()));
+        } catch (IOException e) {
+            throw new RuntimeException("Load certificate failed", e);
+        }
+    }
+
+    private static String loadPrivKey(String certName) {
+        Path priveKeyFilePath = Paths.get(CERT_DIR, certName + "-PRIV.key");
+        try {
+            return new String(Files.readAllBytes(priveKeyFilePath));
+        } catch (IOException e) {
+            throw new RuntimeException("Load private key failed", e);
+        }
+    }
+}
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA1-INTER_CA_SHA256-ROOT_CA_SHA256-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA1-INTER_CA_SHA256-ROOT_CA_SHA256-PRIV.key
new file mode 100644
index 0000000..8da367c
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA1-INTER_CA_SHA256-ROOT_CA_SHA256-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCYQDZxHxNJV8dQ
+I6mfJjuIZxAe5CX9GCrS3Fajh5DXIQwdcvQ4s6YdKzwFn+8dUdspdNTnS+bWjfYw
+0iAbsMt6L6ewutaZf6aufh1EBYiwNOvN8C8Cx0iiE8NiBo833AYWHKhDC4qu63QR
+dYwb9j+Jg8t6p0lQ64sFLDN/RJOcWlaPQbJbSNBKePQR7WOFvdJgFAdQmQjL+ND6
+PSui9QByyXQ+3nfs7ID4paUxYbCrJMh5/AJqaT04DYDEumfmURUn5+ZOIqmqvI2I
+pNXN5gVzL3b8mM2WGr5dpRY5cZ1X//BQ91SNjrKNJlmKFr7nMCfAdzxIW4b/sArv
+eYNE2Vy7AgMBAAECggEBAJNtkopFoiJiKnFypxyiJAG4cwbGu/ZxwX3/uLGPY3S9
+3oJhvxVs+IzEQdHchempSwTAyizS9cuLGfs6bbcConZF0Sa0NXvb/SZ4npQwm6St
+Ci2Xx530JWQ0qPyyB1r65rXguBp8AaXR/8msPqkQ8YOSqKWzea4u96Zhn9g8Koe6
+AD/8FeSzJBDVbJ+C7jKX/7sKsHbYqulzLMQf0lqXFxpGW+5UJaozoQOWXnnmqU3T
+0i4uaGUCXHbQM8eh3fvMFCU4UQMYVS1QOSvZJTnO5bSb8SqeQnCMnQ18ltq4sL43
+qFsEcmAjrlhNoBwslqvfY1bX9NtXyFZ8PuD8OvoFxPkCgYEAxlVfD2qcrAoOcbDe
+Em9hDVPizRuzGuCHi9K2YLDrLVDNd6NF3Pk65JiTsd1fA2AZdi+ljKGEwBhNFOyk
+qwmK2K4sYy7zvyV3Blmwvyo7+OaeexYF8RIw5keGlRsgHTGarzlQAlJu91UmyAmE
+C/99fZbSWo9QndJ0FVR6G3ti71UCgYEAxITBJqVtNFnv4PGdc3FNsYXlRQcSWjs9
+/1lsppLQjC6HMsb6JpxYUF3D4oFiUESKe/9kZzl1H/65Cm2mYq8sj+7lug8P5tz7
+DQa91dFM02r8JLO6TitSuZfbc0XH0K450ntuQlKX581icYSGBUwQHGApespuNVlh
+Mg7CmwNse88CgYAienrhEjaUTdc++nFQoR4tE/UslPEo7fmCXCoqWvc3VIGzl6Ww
+iX8seD3MwOAglRc4DYZpETcjsdXMmmrx9OG3U2gSAfqLszai2vq38N6mIWlRmn2D
+8BaiIbMKvsFxccsjRQJctPnnc10fj0/uSgcFyy9cYOex2AEoKBxmJKgJVQKBgA0c
+HhaJ6qMXbN1AwRQ2dsxk9kqIkjzavuQN/yWNncP8RqCojX+N5oZV+v9dSkW4jNSA
+0R3hw2KDB60ea38h2IMxmLm0z4bDLyxLSta8w7dG59M6+i7EzRv8eXNTMGVHeiwE
+d/KMt/2Kwgp4oMgxrtF1yM6cOoXslINWYL0emVoZAoGAcEKzO8LgPJsIVjRFz3ri
+0AQqiXQzYek2WAXYhlQCvBVn8in3MYcxKhjA3Og3Lym0xvZ+/8SbII9QNaidbgIH
+HDreeJW4KE5EfVnDaYcxwK/9LXZXndIxrpR0YKNSvZT7DuuQtFCoxJcASxb1k9Tc
+5MPT+pyPL+9v2q56ry56qas=
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA1-INTER_CA_SHA256-ROOT_CA_SHA256.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA1-INTER_CA_SHA256-ROOT_CA_SHA256.cer
new file mode 100644
index 0000000..21872d7
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA1-INTER_CA_SHA256-ROOT_CA_SHA256.cer
@@ -0,0 +1,81 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            e8:33:78:c7:69:9c:28:c2
+    Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=INTER_CA_SHA256-ROOT_CA_SHA256
+        Validity
+            Not Before: Mar 30 04:51:07 2017 GMT
+            Not After : Mar 28 04:51:07 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=END_ENTITY_SHA1-INTER_CA_SHA256-ROOT_CA_SHA256
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:98:40:36:71:1f:13:49:57:c7:50:23:a9:9f:26:
+                    3b:88:67:10:1e:e4:25:fd:18:2a:d2:dc:56:a3:87:
+                    90:d7:21:0c:1d:72:f4:38:b3:a6:1d:2b:3c:05:9f:
+                    ef:1d:51:db:29:74:d4:e7:4b:e6:d6:8d:f6:30:d2:
+                    20:1b:b0:cb:7a:2f:a7:b0:ba:d6:99:7f:a6:ae:7e:
+                    1d:44:05:88:b0:34:eb:cd:f0:2f:02:c7:48:a2:13:
+                    c3:62:06:8f:37:dc:06:16:1c:a8:43:0b:8a:ae:eb:
+                    74:11:75:8c:1b:f6:3f:89:83:cb:7a:a7:49:50:eb:
+                    8b:05:2c:33:7f:44:93:9c:5a:56:8f:41:b2:5b:48:
+                    d0:4a:78:f4:11:ed:63:85:bd:d2:60:14:07:50:99:
+                    08:cb:f8:d0:fa:3d:2b:a2:f5:00:72:c9:74:3e:de:
+                    77:ec:ec:80:f8:a5:a5:31:61:b0:ab:24:c8:79:fc:
+                    02:6a:69:3d:38:0d:80:c4:ba:67:e6:51:15:27:e7:
+                    e6:4e:22:a9:aa:bc:8d:88:a4:d5:cd:e6:05:73:2f:
+                    76:fc:98:cd:96:1a:be:5d:a5:16:39:71:9d:57:ff:
+                    f0:50:f7:54:8d:8e:b2:8d:26:59:8a:16:be:e7:30:
+                    27:c0:77:3c:48:5b:86:ff:b0:0a:ef:79:83:44:d9:
+                    5c:bb
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA256
+                serial:84:A1:70:1D:0A:92:D3:CC
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+         22:63:2a:de:80:70:92:f7:53:e4:7f:ea:01:2b:13:b3:1b:02:
+         2e:10:b4:1d:b7:33:7f:6f:0d:88:46:5a:b8:db:83:95:77:e2:
+         db:da:2e:31:0a:85:c6:9a:75:84:ca:73:5c:be:e3:30:22:7e:
+         bc:60:43:49:7c:69:06:14:4a:89:e4:23:ca:25:99:85:d6:06:
+         16:d5:9e:a8:fd:25:43:88:07:12:0a:7e:de:24:33:71:ab:a4:
+         23:aa:4e:dc:0f:89:ef:a9:09:89:55:a1:1d:ee:48:35:ea:10:
+         42:ff:98:15:2a:e8:5c:46:e0:e4:4f:4c:b9:07:e0:da:08:6f:
+         ce:4a:fe:98:3e:ae:c5:e5:6a:6e:50:0f:2d:39:01:55:ed:59:
+         0b:65:30:54:e8:72:26:ee:9f:cf:3f:ce:6a:20:c8:87:c9:81:
+         bc:f8:b3:ec:77:bb:bc:5b:8c:3f:18:fd:08:76:ad:27:59:fc:
+         b8:74:96:0d:cd:ed:97:91:6b:95:89:3a:f3:78:de:9f:06:a6:
+         ce:36:01:f0:be:ae:d8:d6:c4:3d:51:8a:2a:e0:43:59:8c:b4:
+         eb:63:93:9d:53:72:f8:4b:a3:c7:4a:da:2e:56:33:b6:46:1b:
+         45:a8:23:1b:82:de:6d:4e:e0:18:cf:9b:ba:22:68:8b:8c:de:
+         6f:08:2d:bc
+-----BEGIN CERTIFICATE-----
+MIID/jCCAuagAwIBAgIJAOgzeMdpnCjCMA0GCSqGSIb3DQEBBQUAMG8xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMScwJQYDVQQDDB5JTlRFUl9DQV9TSEEyNTYtUk9PVF9D
+QV9TSEEyNTYwHhcNMTcwMzMwMDQ1MTA3WhcNMjcwMzI4MDQ1MTA3WjB/MQswCQYD
+VQQGEwJVUzELMAkGA1UECAwCQ0ExDTALBgNVBAcMBENpdHkxDDAKBgNVBAoMA09y
+ZzENMAsGA1UECwwESmF2YTE3MDUGA1UEAwwuRU5EX0VOVElUWV9TSEExLUlOVEVS
+X0NBX1NIQTI1Ni1ST09UX0NBX1NIQTI1NjCCASIwDQYJKoZIhvcNAQEBBQADggEP
+ADCCAQoCggEBAJhANnEfE0lXx1AjqZ8mO4hnEB7kJf0YKtLcVqOHkNchDB1y9Diz
+ph0rPAWf7x1R2yl01OdL5taN9jDSIBuwy3ovp7C61pl/pq5+HUQFiLA0683wLwLH
+SKITw2IGjzfcBhYcqEMLiq7rdBF1jBv2P4mDy3qnSVDriwUsM39Ek5xaVo9BsltI
+0Ep49BHtY4W90mAUB1CZCMv40Po9K6L1AHLJdD7ed+zsgPilpTFhsKskyHn8Ampp
+PTgNgMS6Z+ZRFSfn5k4iqaq8jYik1c3mBXMvdvyYzZYavl2lFjlxnVf/8FD3VI2O
+so0mWYoWvucwJ8B3PEhbhv+wCu95g0TZXLsCAwEAAaOBjDCBiTB5BgNVHSMEcjBw
+oWOkYTBfMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExDTALBgNVBAcMBENpdHkx
+DDAKBgNVBAoMA09yZzENMAsGA1UECwwESmF2YTEXMBUGA1UEAwwOUk9PVF9DQV9T
+SEEyNTaCCQCEoXAdCpLTzDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IB
+AQAiYyregHCS91Pkf+oBKxOzGwIuELQdtzN/bw2IRlq424OVd+Lb2i4xCoXGmnWE
+ynNcvuMwIn68YENJfGkGFEqJ5CPKJZmF1gYW1Z6o/SVDiAcSCn7eJDNxq6Qjqk7c
+D4nvqQmJVaEd7kg16hBC/5gVKuhcRuDkT0y5B+DaCG/OSv6YPq7F5WpuUA8tOQFV
+7VkLZTBU6HIm7p/PP85qIMiHyYG8+LPsd7u8W4w/GP0Idq0nWfy4dJYNze2XkWuV
+iTrzeN6fBqbONgHwvq7Y1sQ9UYoq4ENZjLTrY5OdU3L4S6PHStouVjO2RhtFqCMb
+gt5tTuAYz5u6ImiLjN5vCC28
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA1-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA1-PRIV.key
new file mode 100644
index 0000000..cd99ead
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA1-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDaYlKNTU1iQes/
+BtivvM1ixjCk1muM1RdMkJQItZB21y1kM1OLp3EmGKqVqwKbS5OTrMIxjPUwD9Ly
+aRJMvSP1xve7zwmNXOngA8eukmQ2olQU58ble6IAHcj4qg7a38E1ITvDmAswhTzK
+fI4Z6okLCjKfYafnfbi5JA+E6fiArB3zimjne+tiUNYZh2eYspsOOw6cmaLtIbMP
+ZyXy4iP6OCNIikb08Da27zjVn04i1SeUEv1YFmn4B9GWcNLAXyM1LmCNi70+SATp
+aZYRjr/BBR6LNZMBsNKJblWFXK3UtfYFiypyirgQjzPtLb1XsuMhfqMt8QZDh8n3
+YvYTW59xAgMBAAECggEAb4NPdhnoDulsL5XWZf55vhtH0ZQv/Qz+xbj57myQJS8B
+Xa4b1i8dRv/Hc3+MaDIyXHEWBGle9jjOVbwzfP4D88eyzrMMxKOSRTKI72qPQ5qm
+ZrpnxNzZv0d2TQvBZCBnrzKWKu1joVYX0anCghdR/VIqwVoDe+Clx9xTFGLI4yKO
+7v0dkr4Hxn3NT6bTV18V6PoGbUgIsmpNYQPFyUM/IHG2ewDffLP+tm7RsEfKYmcx
+Hr70pmWBpM9hwTAC+uXHuNXnsX4IjEQOXmm4PJ/A/sm2Bad93SPwi15e29MV8YbO
+vvirGLaepa7AUvqoK0DFNCLU6vCeFJ7DUZ/u2P8x8QKBgQDxNOWvy3EV4/P/ocSf
+itMtXZWj4driT4vUGwFZWfr3CVpZVaUmqXYeVdzNGuoWlmXOiOAuOepnlA36FCb5
+aGE4cq/hbdtbr+v6awEj5/A2me/ax1W1z6lD0pg0QJ7KvqFCBzVol5yTiWZKBVE+
+jp2waPfes770AUHczw9KKvEGtQKBgQDnxxiZAxtoNmOaB/NZmPNBKvWDw858+QX2
++u/jEH3pW393tUnipgIoo6yvd6djhJ6/4ViOxdioMIQCBab/xuSB4lfQsrJsWvS9
+uYB794s7CV2r3kUa3ux8wAovW6Fc369nD7JjUPX/Cq3zdlyTDt9LVLRCpZ6Li1xB
+r0ZVlpgPTQKBgQCgKay+X0tW6sdxHfyOp8Lz46liaa1LCuDhVZE+wHXZpXc9zJXe
+JzZMjF0SQGXh27n8O30IlOJmJrRlMw5yG/I6ZkUNXkIDDryVyom2SuOBjhPrZOMv
+15UgeO0h/Sqzm4M+ccTwD4Qjn1+xlPhOnqpsoja8xQPtyAvwz/jqGbtz5QKBgH01
+pSgj8Y5es3fmi6P/aInv9ynzgX0p2fsOnMEBi8Og1j+JBB0YqVni8crozNiKMGhg
+CEM4xk41x1qASzMp8w/ngqEPqCu5BzXnHG3b0K9X4+6Q6KwXeZH6/IWQ7p8Jh+wZ
+IrlcZ0gcMNSxQFmBU0eSvr6yUe/4nSIu2cQq0oKRAoGAUEFd0LxZw50BdCdpJlcQ
++oTbSUYQhAzPF2ybfR6i8IxXoOjVxpvRehlbwXIQV7XEqamXFTmBLIvuAlF1yWoH
+hzxNJuEgPRTPztnHD6LVzvuf2ain+CFZuDrXBT2l8PyF9BNL4/DMRrbgdCxr9F0O
+Ti0VJo1TRE8vVzUfVc9w1RI=
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA1.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA1.cer
new file mode 100644
index 0000000..c2cb37c
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA1.cer
@@ -0,0 +1,81 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            86:09:85:57:41:bf:86:65
+    Signature Algorithm: sha256WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=INTER_CA_SHA1-ROOT_CA_SHA1
+        Validity
+            Not Before: Mar 30 04:51:06 2017 GMT
+            Not After : Mar 28 04:51:06 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA1
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:da:62:52:8d:4d:4d:62:41:eb:3f:06:d8:af:bc:
+                    cd:62:c6:30:a4:d6:6b:8c:d5:17:4c:90:94:08:b5:
+                    90:76:d7:2d:64:33:53:8b:a7:71:26:18:aa:95:ab:
+                    02:9b:4b:93:93:ac:c2:31:8c:f5:30:0f:d2:f2:69:
+                    12:4c:bd:23:f5:c6:f7:bb:cf:09:8d:5c:e9:e0:03:
+                    c7:ae:92:64:36:a2:54:14:e7:c6:e5:7b:a2:00:1d:
+                    c8:f8:aa:0e:da:df:c1:35:21:3b:c3:98:0b:30:85:
+                    3c:ca:7c:8e:19:ea:89:0b:0a:32:9f:61:a7:e7:7d:
+                    b8:b9:24:0f:84:e9:f8:80:ac:1d:f3:8a:68:e7:7b:
+                    eb:62:50:d6:19:87:67:98:b2:9b:0e:3b:0e:9c:99:
+                    a2:ed:21:b3:0f:67:25:f2:e2:23:fa:38:23:48:8a:
+                    46:f4:f0:36:b6:ef:38:d5:9f:4e:22:d5:27:94:12:
+                    fd:58:16:69:f8:07:d1:96:70:d2:c0:5f:23:35:2e:
+                    60:8d:8b:bd:3e:48:04:e9:69:96:11:8e:bf:c1:05:
+                    1e:8b:35:93:01:b0:d2:89:6e:55:85:5c:ad:d4:b5:
+                    f6:05:8b:2a:72:8a:b8:10:8f:33:ed:2d:bd:57:b2:
+                    e3:21:7e:a3:2d:f1:06:43:87:c9:f7:62:f6:13:5b:
+                    9f:71
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA1
+                serial:8D:A0:D2:8A:EE:0B:CF:65
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha256WithRSAEncryption
+         29:b0:10:dc:45:ee:68:77:5f:12:9b:fc:de:eb:70:41:2e:6a:
+         a2:5f:a9:cc:ca:97:24:01:4a:1d:c2:78:52:57:34:9c:83:7f:
+         60:f5:d9:68:a2:32:89:e9:d7:25:71:72:71:e5:76:e3:37:af:
+         41:25:cc:8b:a4:fd:81:ef:6b:15:2b:91:3c:68:a5:25:53:cf:
+         c1:b9:aa:49:b4:cd:e3:3c:a2:8e:38:ea:e8:51:7c:7b:92:41:
+         bd:a3:22:7d:97:59:ad:55:e2:7d:9d:6a:bb:1f:95:84:1c:50:
+         00:e9:6c:74:1d:bb:6c:07:ca:bc:6a:a2:dd:c1:66:37:64:bd:
+         fe:1a:c0:8c:a7:8c:a1:60:b8:c3:d2:5f:92:80:ee:ad:79:29:
+         f2:ad:e2:9f:74:39:bf:3b:a4:b6:25:2a:87:3f:36:49:b9:52:
+         fd:91:33:be:1d:41:a9:76:29:47:6e:c7:db:a8:ab:6e:78:91:
+         c0:13:56:1c:25:41:51:a7:64:4f:07:c0:2a:a8:80:63:8d:98:
+         e0:54:7d:a6:f4:22:6b:70:fa:1c:16:82:f4:07:2e:e1:ba:94:
+         96:ec:c7:9e:8e:0a:24:1e:a4:e9:c0:92:ca:bd:32:98:ef:1f:
+         e1:a6:e6:4d:1f:c5:68:1b:77:d0:e0:35:1a:a9:c9:ee:98:72:
+         7b:c3:e7:51
+-----BEGIN CERTIFICATE-----
+MIID9jCCAt6gAwIBAgIJAIYJhVdBv4ZlMA0GCSqGSIb3DQEBCwUAMGsxCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMSMwIQYDVQQDDBpJTlRFUl9DQV9TSEExLVJPT1RfQ0Ff
+U0hBMTAeFw0xNzAzMzAwNDUxMDZaFw0yNzAzMjgwNDUxMDZaMH0xCzAJBgNVBAYT
+AlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3JnMQ0w
+CwYDVQQLDARKYXZhMTUwMwYDVQQDDCxFTkRfRU5USVRZX1NIQTI1Ni1JTlRFUl9D
+QV9TSEExLVJPT1RfQ0FfU0hBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBANpiUo1NTWJB6z8G2K+8zWLGMKTWa4zVF0yQlAi1kHbXLWQzU4uncSYYqpWr
+AptLk5OswjGM9TAP0vJpEky9I/XG97vPCY1c6eADx66SZDaiVBTnxuV7ogAdyPiq
+DtrfwTUhO8OYCzCFPMp8jhnqiQsKMp9hp+d9uLkkD4Tp+ICsHfOKaOd762JQ1hmH
+Z5iymw47DpyZou0hsw9nJfLiI/o4I0iKRvTwNrbvONWfTiLVJ5QS/VgWafgH0ZZw
+0sBfIzUuYI2LvT5IBOlplhGOv8EFHos1kwGw0oluVYVcrdS19gWLKnKKuBCPM+0t
+vVey4yF+oy3xBkOHyfdi9hNbn3ECAwEAAaOBijCBhzB3BgNVHSMEcDBuoWGkXzBd
+MQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExDTALBgNVBAcMBENpdHkxDDAKBgNV
+BAoMA09yZzENMAsGA1UECwwESmF2YTEVMBMGA1UEAwwMUk9PVF9DQV9TSEExggkA
+jaDSiu4Lz2UwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAKbAQ3EXu
+aHdfEpv83utwQS5qol+pzMqXJAFKHcJ4Ulc0nIN/YPXZaKIyienXJXFyceV24zev
+QSXMi6T9ge9rFSuRPGilJVPPwbmqSbTN4zyijjjq6FF8e5JBvaMifZdZrVXifZ1q
+ux+VhBxQAOlsdB27bAfKvGqi3cFmN2S9/hrAjKeMoWC4w9JfkoDurXkp8q3in3Q5
+vzuktiUqhz82SblS/ZEzvh1BqXYpR27H26irbniRwBNWHCVBUadkTwfAKqiAY42Y
+4FR9pvQia3D6HBaC9Acu4bqUluzHno4KJB6k6cCSyr0ymO8f4abmTR/FaBt30OA1
+GqnJ7phye8PnUQ==
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256-PRIV.key
new file mode 100644
index 0000000..3f9ad53
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDaCsiXcNnu7WpV
+t+FarvFhtaRr4RMQbKGhiIHi4aV0vqWmpX/eFde01eQZTZcPGJzEnjJrkyFo3Wbd
+31bjBLpt40kkI7kbODHrA2L+vY/hoCQeXK8+BrGioX9qHOpD7OLI3Esm1+KDiPPK
+w6qr9O9nS/fOID3zly92r+obY2ZuW6jQC0Yah3K9INrSIjH+rHXsmj2U5dCnktfi
+LzRcocvqtQHASYXFXEhWr1TCMnSz7h+l07O5YgYpmhwkRIPCkcdP+9wGhO2eOJYU
+kfaBteodDh7vHj2F+A6Lheosa4mi/nysyhQJl8uBFw97dqab9ul5Tb03iHmaY/q0
+xJKcEohnAgMBAAECggEBAJsa6K6yHJWWVfo8IBb+M7+qExiat5ELdb8O+DaJBcYS
+iIwPVvKI3zVIokZNp5OZkotbbcqQk0ehl7dlVM2RY30gHbuTne36/6eKdTV5a4y4
++niOviqFYH+sGpNFlnBTZtAzxVIQaJXhKmum3RYN2u/EXrdGwEsz1RO89/AbuZXu
+VdtEKkjPHXrIjnBkiT4271sm3OiPwOe6g0NKBMJ4InTyB+YtpgxlXtF+vv5cv6Vt
+ayT3sNsdsD8HLrenMmwv/k7nTYgNbhaJX2YCs9W7ZEscU2th6F7Cx6Z0z9h1SElC
++OKKhU6HnG/pWFMfWu80ZNjb3NTpXzTv4CLKjEYvz6ECgYEA8qEe+Ga7+XD0XwPB
+bFjoKmhOQhv0VCIiu9RgvIxQn5DuGX4H2hO1GP8LYOQZBm25nICIa+DyDZEaFGgL
+QgfPI4boK/rdV8syFTUNfw1Wq+W/pHhqzgUGHAnzRpX8jBQa9of14O+B7//ZFdGj
+5nt0qFTOAgNGslXMvSicKD/g0mMCgYEA5g7MpMmZI8zPf/PKLBkrQegdX2TBBiI5
+3KzvQuA29tEFdVwUIuhkgQkmy1u9Ujw0jZZ8NVBOsqfg7e7XkVr6/OF+MVWBjWl3
+Jn3DMCHl/HCLIZ4ZOM6/ydIMpBX6Ii53nvpO6vxRaOUg2T2gVHadVjjQAN9Oj68r
+TKUHfs4rTy0CgYB/g5QuQnfqKaYUxXmDQtqJZxYyAlUPXn1Yr85DaY75vYaVGTpx
+L0hPIcNOIbLRQRt6l8aaw7cS0D6fmOrJwibn6f/dFVP8zwq8QIyeSFlTsERe4PZo
+3hUO6V/UqgD3cZ2WEXB0zgtBIfpqUCpOeHWf/inivuwJz7PxegVP1fqHNwKBgA0p
+CZHfqm/+1lvmcUlGg0/43D1JwTT9nju+dM1pkBtcZ6iIBOreSmmLQXnenJzorsTu
+t9pA5s+XhOl3gUNiZfszVwmxb4DMaLF9/j1xovtm4L6ikaTLRvNfnbOBQlbUO6mP
+fhY5KtsKSG/E87gBNQzqoRN7sr3Lcnmm8x/Q4W9dAoGAITDcOI7UgPcnKMO8JUI5
+96Po3c/S7nBilVZRFOwjn0z6jrjzNTd+1IqkzIKBWfs5WlRkzXI6LPJVghwPUqUa
+q2C/3hQATD3FchEIohLfd8bj/wObaZNlKJB59a1RjxRZxuVQl3jvovvpn/hdXuJB
+nGIx7MryEG/yRpfrk2DL0bI=
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256.cer
new file mode 100644
index 0000000..22390ed
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256.cer
@@ -0,0 +1,81 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            9e:f7:d7:79:1c:06:83:d5
+    Signature Algorithm: sha256WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=INTER_CA_SHA1-ROOT_CA_SHA256
+        Validity
+            Not Before: Mar 30 04:51:05 2017 GMT
+            Not After : Mar 28 04:51:05 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=END_ENTITY_SHA256-INTER_CA_SHA1-ROOT_CA_SHA256-PRIV
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:da:0a:c8:97:70:d9:ee:ed:6a:55:b7:e1:5a:ae:
+                    f1:61:b5:a4:6b:e1:13:10:6c:a1:a1:88:81:e2:e1:
+                    a5:74:be:a5:a6:a5:7f:de:15:d7:b4:d5:e4:19:4d:
+                    97:0f:18:9c:c4:9e:32:6b:93:21:68:dd:66:dd:df:
+                    56:e3:04:ba:6d:e3:49:24:23:b9:1b:38:31:eb:03:
+                    62:fe:bd:8f:e1:a0:24:1e:5c:af:3e:06:b1:a2:a1:
+                    7f:6a:1c:ea:43:ec:e2:c8:dc:4b:26:d7:e2:83:88:
+                    f3:ca:c3:aa:ab:f4:ef:67:4b:f7:ce:20:3d:f3:97:
+                    2f:76:af:ea:1b:63:66:6e:5b:a8:d0:0b:46:1a:87:
+                    72:bd:20:da:d2:22:31:fe:ac:75:ec:9a:3d:94:e5:
+                    d0:a7:92:d7:e2:2f:34:5c:a1:cb:ea:b5:01:c0:49:
+                    85:c5:5c:48:56:af:54:c2:32:74:b3:ee:1f:a5:d3:
+                    b3:b9:62:06:29:9a:1c:24:44:83:c2:91:c7:4f:fb:
+                    dc:06:84:ed:9e:38:96:14:91:f6:81:b5:ea:1d:0e:
+                    1e:ef:1e:3d:85:f8:0e:8b:85:ea:2c:6b:89:a2:fe:
+                    7c:ac:ca:14:09:97:cb:81:17:0f:7b:76:a6:9b:f6:
+                    e9:79:4d:bd:37:88:79:9a:63:fa:b4:c4:92:9c:12:
+                    88:67
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA256
+                serial:84:A1:70:1D:0A:92:D3:CD
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha256WithRSAEncryption
+         89:84:ce:6d:80:83:e7:19:80:21:a5:d3:79:ac:c4:2f:5c:5f:
+         47:f1:1c:e7:40:2a:57:ec:76:01:a9:10:b6:a2:2b:1b:02:ac:
+         f7:46:b1:67:b3:36:0f:fa:f0:a3:40:c2:5a:38:00:67:a9:9d:
+         e8:59:be:2f:5b:d0:c6:6c:20:90:c0:3b:6b:af:75:8c:93:ac:
+         5a:1e:8b:66:2c:79:0b:6d:9d:0d:d3:68:b5:b6:df:d6:04:6b:
+         24:f7:5a:b9:f0:18:08:81:b1:50:1c:ac:1b:7a:b7:b8:d8:8e:
+         6f:15:78:7e:23:5f:41:5c:df:76:09:1a:67:36:15:35:6a:77:
+         36:09:19:50:12:6d:60:20:c1:7a:36:cb:4c:ee:a8:d7:b7:c7:
+         29:26:31:04:0a:44:48:25:be:dd:00:92:ea:8c:00:ee:b4:eb:
+         52:4a:da:47:97:d7:42:df:dd:7d:17:de:e3:a1:14:49:3b:2d:
+         aa:ac:e7:83:0f:c0:2d:3f:31:c5:af:bb:b1:1e:53:d1:a7:13:
+         55:e3:25:f6:67:95:a1:75:e9:b8:a1:81:eb:d0:de:8a:a3:af:
+         78:dc:d0:39:d0:e7:d6:61:9e:39:7b:8b:f9:ee:44:48:78:92:
+         e7:22:fa:9c:a4:d0:6b:2b:89:0a:fa:78:3d:7a:af:44:91:e5:
+         8a:40:2f:10
+-----BEGIN CERTIFICATE-----
+MIIEAjCCAuqgAwIBAgIJAJ7313kcBoPVMA0GCSqGSIb3DQEBCwUAMG0xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMSUwIwYDVQQDDBxJTlRFUl9DQV9TSEExLVJPT1RfQ0Ff
+U0hBMjU2MB4XDTE3MDMzMDA0NTEwNVoXDTI3MDMyODA0NTEwNVowgYQxCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMTwwOgYDVQQDDDNFTkRfRU5USVRZX1NIQTI1Ni1JTlRF
+Ul9DQV9TSEExLVJPT1RfQ0FfU0hBMjU2LVBSSVYwggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQDaCsiXcNnu7WpVt+FarvFhtaRr4RMQbKGhiIHi4aV0vqWm
+pX/eFde01eQZTZcPGJzEnjJrkyFo3Wbd31bjBLpt40kkI7kbODHrA2L+vY/hoCQe
+XK8+BrGioX9qHOpD7OLI3Esm1+KDiPPKw6qr9O9nS/fOID3zly92r+obY2ZuW6jQ
+C0Yah3K9INrSIjH+rHXsmj2U5dCnktfiLzRcocvqtQHASYXFXEhWr1TCMnSz7h+l
+07O5YgYpmhwkRIPCkcdP+9wGhO2eOJYUkfaBteodDh7vHj2F+A6Lheosa4mi/nys
+yhQJl8uBFw97dqab9ul5Tb03iHmaY/q0xJKcEohnAgMBAAGjgYwwgYkweQYDVR0j
+BHIwcKFjpGEwXzELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ0wCwYDVQQHDARD
+aXR5MQwwCgYDVQQKDANPcmcxDTALBgNVBAsMBEphdmExFzAVBgNVBAMMDlJPT1Rf
+Q0FfU0hBMjU2ggkAhKFwHQqS080wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsF
+AAOCAQEAiYTObYCD5xmAIaXTeazEL1xfR/Ec50AqV+x2AakQtqIrGwKs90axZ7M2
+D/rwo0DCWjgAZ6md6Fm+L1vQxmwgkMA7a691jJOsWh6LZix5C22dDdNotbbf1gRr
+JPdaufAYCIGxUBysG3q3uNiObxV4fiNfQVzfdgkaZzYVNWp3NgkZUBJtYCDBejbL
+TO6o17fHKSYxBApESCW+3QCS6owA7rTrUkraR5fXQt/dfRfe46EUSTstqqzngw/A
+LT8xxa+7sR5T0acTVeMl9meVoXXpuKGB69DeiqOveNzQOdDn1mGeOXuL+e5ESHiS
+5yL6nKTQayuJCvp4PXqvRJHlikAvEA==
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA1-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA1-PRIV.key
new file mode 100644
index 0000000..8584f50
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA1-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDHC0ieOFNTJjP+
+HMlFQ/w50Hx/+FYh9z9w3i08dVvi8oEhGUop7fvsqEyuAj3U/BYG87Wsv27wfa9l
+qSJRSgqUT3yI4jsMY/ozUInuKpp/yL97abyZVDUZc3diDZqryA/Qur8HNVLyA2hD
+DA9x8Ioeu5EDFl7AeqV3jx+A8fbulwVeCa29GByVkWRUEVF/48a1jpazBf2YQvrm
+5ElWoG8fuMrz6vgj+gYZYb1GPXmJQrtAIRp4Z1/AquPS4A/O21DnPLEM8WSw+rSC
+KGGKMqefJw74zeVyPlOiOmjFTeNfeVDViQrDgU++CTDjFa8XhweU6v+MtY5Mmzmf
+2AETGyd9AgMBAAECggEANCdMu8hebOcRsH+ybSfHKw7p0E4to3C5esV8bN8DWI/a
+LeYGfL4SyIvAq8eClBAJZYDuFXmDhBgqoSSUDWCtLPc21lcQycpYgKGVwoX/PYRI
+R/oIpNRfpW+P1G1kHaaqHjMQYr8iIK+r3gWG9n/kcPEMqhZudVitiopB4vODlDgf
+OI0goNWwYOPzoBkJSBbgfYC7vSz0dg+j9ooYPDnyUnHjykhu95mkmBHYc/MVMP8s
+ntFB5pgtWuLQATZImW4A1dtZiqCsF6APvJIQASxVq+wv3dwhejF9xMZR96QchVZJ
+QvPOcH76njIH4fThb0e46Dn54+KBpCnveSnDtAz5sQKBgQD2u6gWOK/Z4VqGlff1
+diLqzesdalCJhydKzOGRzRiJeW4E4MhEpUjIo44zPGkQ64zq6nefqIltdiaE7T9C
+Fnyu/+vd0zE1v3Ipgv0wD3NgTj3gGrBwl2gkY5sfSbCR+8vS/DhRU+s3KN45m3s4
+XfM27Uw/Zh/DFIe7jmGezfe/3wKBgQDOhRjDfxDDLCEXw4QFQb7Sp/43EGfoTd8h
+m700T/QXUTGx6qRhzHF9mUVea7FT+3I6CEqYNnZtFlYsJlq1g457rnvUJnTjJZb7
+wFl1h+u4u3IKo/lUUh2vD89PPOkMUF/uamJLh5jK7KNkOjwEDN2yPkRgaedY++nv
+NBcUPpGUIwKBgEkFmOWauVC+hVA3qj8XS5Y6g08dW+CYA2T75faEwLJPIeSHsj2+
+vR/EaB15z46WaApOgkDaXHHs+dF1dbdVeGlCjMgF7RZ/JoZqogxLRlZGUcG1pGpu
+JQBACnTkFkHeR6CVzQUk1QRqL/rUrU8tXwHukRZiXxwZQ2Ka7QFW6+/5AoGAHGem
+Dk2NyqppKtGTeP2f921vw7cX85WyWPcIwQc2NXbPdP8m+OSbv4CzT9dUHo75GQ5G
+5ESpaTunQo9L7qdXk59eHMHlVdC3wYylQUsemtv9RYVkJ7rbplZwVx+zliP/7dTo
+DCdsVozRtFlmI9B5Najm0rP+Q/jyJhpuCjTI5S0CgYEAsYcmFZZotwOyT4oJ/1Fu
+BtSOsoxnCa1vPJTVXEoX3F28ZUP4X0iWgGDO1e3aoWWYxWusf1fUj9BWbVnbtJfb
+gJ5JtQTAuMvmjCwFRWcBUytdxTUsWFbuDc5fw7DMW7YqjkCCISkd6Q8JyaFsJPy1
+7uFzumBnFtZGUIo2w4l8yrQ=
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA1.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA1.cer
new file mode 100644
index 0000000..8b9f080
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA1.cer
@@ -0,0 +1,81 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            9e:b3:99:30:15:24:2c:69
+    Signature Algorithm: sha256WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=INTER_CA_SHA256-ROOT_CA_SHA1
+        Validity
+            Not Before: Mar 30 04:51:06 2017 GMT
+            Not After : Mar 28 04:51:06 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA1
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:c7:0b:48:9e:38:53:53:26:33:fe:1c:c9:45:43:
+                    fc:39:d0:7c:7f:f8:56:21:f7:3f:70:de:2d:3c:75:
+                    5b:e2:f2:81:21:19:4a:29:ed:fb:ec:a8:4c:ae:02:
+                    3d:d4:fc:16:06:f3:b5:ac:bf:6e:f0:7d:af:65:a9:
+                    22:51:4a:0a:94:4f:7c:88:e2:3b:0c:63:fa:33:50:
+                    89:ee:2a:9a:7f:c8:bf:7b:69:bc:99:54:35:19:73:
+                    77:62:0d:9a:ab:c8:0f:d0:ba:bf:07:35:52:f2:03:
+                    68:43:0c:0f:71:f0:8a:1e:bb:91:03:16:5e:c0:7a:
+                    a5:77:8f:1f:80:f1:f6:ee:97:05:5e:09:ad:bd:18:
+                    1c:95:91:64:54:11:51:7f:e3:c6:b5:8e:96:b3:05:
+                    fd:98:42:fa:e6:e4:49:56:a0:6f:1f:b8:ca:f3:ea:
+                    f8:23:fa:06:19:61:bd:46:3d:79:89:42:bb:40:21:
+                    1a:78:67:5f:c0:aa:e3:d2:e0:0f:ce:db:50:e7:3c:
+                    b1:0c:f1:64:b0:fa:b4:82:28:61:8a:32:a7:9f:27:
+                    0e:f8:cd:e5:72:3e:53:a2:3a:68:c5:4d:e3:5f:79:
+                    50:d5:89:0a:c3:81:4f:be:09:30:e3:15:af:17:87:
+                    07:94:ea:ff:8c:b5:8e:4c:9b:39:9f:d8:01:13:1b:
+                    27:7d
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA1
+                serial:8D:A0:D2:8A:EE:0B:CF:64
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha256WithRSAEncryption
+         2b:43:e4:c1:37:36:00:a3:ed:25:15:c7:9f:6b:25:0e:24:cd:
+         1c:e8:d2:8c:a6:11:05:a9:2b:b5:dc:7b:fd:55:8e:be:1d:15:
+         d7:8b:a8:a6:44:cf:03:ba:ba:78:74:26:b9:19:11:c0:03:9b:
+         4d:2f:f9:f7:ea:da:a3:2f:82:f9:9e:d0:77:d6:bf:eb:fd:57:
+         c8:eb:03:54:0a:0c:2b:36:0c:e5:99:b7:93:4d:a9:9d:e9:50:
+         80:66:4e:73:c1:bd:83:13:09:ee:b9:01:62:ed:90:0e:4f:ff:
+         9d:92:f3:cd:db:1f:ba:da:fc:67:9d:cb:a0:09:99:8b:3e:ea:
+         9d:61:55:ac:6f:fb:11:5c:c0:fe:fb:ff:5b:15:7d:a7:c1:aa:
+         3a:cd:30:43:35:ea:44:8a:21:ae:9f:af:bc:5c:ae:3a:01:2c:
+         3b:eb:b6:8c:6a:e1:1c:4e:55:0a:84:5b:f8:68:71:aa:97:02:
+         9b:5d:c4:c9:42:df:19:91:28:4a:12:35:8d:2e:3d:10:ec:35:
+         8a:b1:d7:e0:e2:a6:f9:f6:47:4b:17:75:84:8e:2d:66:e8:74:
+         be:d6:27:6b:a2:28:23:26:41:70:92:c2:7c:50:e2:81:c9:e0:
+         10:84:5d:87:4f:db:93:ce:dd:09:d2:48:63:3d:53:66:31:64:
+         5a:13:b5:a6
+-----BEGIN CERTIFICATE-----
+MIID+jCCAuKgAwIBAgIJAJ6zmTAVJCxpMA0GCSqGSIb3DQEBCwUAMG0xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMSUwIwYDVQQDDBxJTlRFUl9DQV9TSEEyNTYtUk9PVF9D
+QV9TSEExMB4XDTE3MDMzMDA0NTEwNloXDTI3MDMyODA0NTEwNlowfzELMAkGA1UE
+BhMCVVMxCzAJBgNVBAgMAkNBMQ0wCwYDVQQHDARDaXR5MQwwCgYDVQQKDANPcmcx
+DTALBgNVBAsMBEphdmExNzA1BgNVBAMMLkVORF9FTlRJVFlfU0hBMjU2LUlOVEVS
+X0NBX1NIQTI1Ni1ST09UX0NBX1NIQTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQDHC0ieOFNTJjP+HMlFQ/w50Hx/+FYh9z9w3i08dVvi8oEhGUop7fvs
+qEyuAj3U/BYG87Wsv27wfa9lqSJRSgqUT3yI4jsMY/ozUInuKpp/yL97abyZVDUZ
+c3diDZqryA/Qur8HNVLyA2hDDA9x8Ioeu5EDFl7AeqV3jx+A8fbulwVeCa29GByV
+kWRUEVF/48a1jpazBf2YQvrm5ElWoG8fuMrz6vgj+gYZYb1GPXmJQrtAIRp4Z1/A
+quPS4A/O21DnPLEM8WSw+rSCKGGKMqefJw74zeVyPlOiOmjFTeNfeVDViQrDgU++
+CTDjFa8XhweU6v+MtY5Mmzmf2AETGyd9AgMBAAGjgYowgYcwdwYDVR0jBHAwbqFh
+pF8wXTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ0wCwYDVQQHDARDaXR5MQww
+CgYDVQQKDANPcmcxDTALBgNVBAsMBEphdmExFTATBgNVBAMMDFJPT1RfQ0FfU0hB
+MYIJAI2g0oruC89kMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBACtD
+5ME3NgCj7SUVx59rJQ4kzRzo0oymEQWpK7Xce/1Vjr4dFdeLqKZEzwO6unh0JrkZ
+EcADm00v+ffq2qMvgvme0HfWv+v9V8jrA1QKDCs2DOWZt5NNqZ3pUIBmTnPBvYMT
+Ce65AWLtkA5P/52S883bH7ra/Gedy6AJmYs+6p1hVaxv+xFcwP77/1sVfafBqjrN
+MEM16kSKIa6fr7xcrjoBLDvrtoxq4RxOVQqEW/hocaqXAptdxMlC3xmRKEoSNY0u
+PRDsNYqx1+Dipvn2R0sXdYSOLWbodL7WJ2uiKCMmQXCSwnxQ4oHJ4BCEXYdP25PO
+3QnSSGM9U2YxZFoTtaY=
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA256-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA256-PRIV.key
new file mode 100644
index 0000000..7fa6368
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA256-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDuH2+6I/ytoLeW
+AG3J0xMQafYmxYDZNaDjiWBl7TGpL4TjRY84FuHI/G8ib0VY9DKtyUixm7qZev+b
+ExrfQGk9ZV7Dn41uBvmGcUMSqwb0QV/5/hneP7/3EXhoWjsCFUe0r0zOgCM7O9+F
+jUlSuxEHyaFE09PxWGVZpU4Yu71PeoI/JJGITV81o2Fst7Urz65NE5OWrvbO+pfD
+EiRvjLv/uil7znYV28lCbH7U1K8q5nGVtnpgTguhGL6/N3lIgvxoBtoXEQwdMV59
+APsH8anA19rHn5h/ZmknryxAs0c6Rg9Plo30MonIU/eAVZwNw8TczD276Rc02xnW
+RmbmxToRAgMBAAECggEAbK3OWV9JWJlMkNqbQQzj247w+FsV5ozSZGbzpzFtg/Eb
+Lns11XykCg4kTswIE4RIiQaf9efEb34yoL1Ee3YzUgEtEg2FCB2IzvJskV2ba+lW
+e4uclNH1tDa2BLKB0f6SXoXPgUP8UHGQH60PNQIJ0MsWnoorZjBY+WQ305QD3/yB
+fMonkjpWN+ZNTY8Y3vA2SsS4EoY0Ndy2FpmWPwKKMCcqXw6xzVjKvq+jpFfsGpcj
+i3MlKsCG5koreWrXdyt28CVOc6eMW5rsJfAHRw+OSn7PdLaGyZCUUsFXCjG0Vq2G
+YwuMfTJprrZk+lbi3XUXWk7XUEURB7Q4lIBxAcskAQKBgQD8pVj0OIsVHAGjQQ7C
+ZAnxFlON7XX3fgPdLtil9c+a1GlcPA2K52fBp8YlKlAS4bmZIQHbbkEBjh8KfG1P
+x7zBHoUXV8ruo/axzRPoeBVQat5NQKcKnlITrqdf8J3a+8iMxpMpd53h97HGiayq
+W04ZQNf7wjXvR+pJVluTEaoVUQKBgQDxSLruMmCsYvD+sipaQ3rBEMIAI3kc7ctl
+fEnipEk5wtPkKKldw+rvbh/AwY2i2JMUDcW92hkB5vCvbcKmCEkEO3FbawNkJnJi
+qfwbvHP/fGThMV3gbWWF3GZvBKY2+toSa2rwoR5kYTT1e4+byk38NAp/HAItFHIT
+DgAgMy6owQKBgQCjd8jKnBtBmVFl9B48oMXd+/gsCM0fSaXuYvVCzH17TJyvVRve
+GEQGBSwrt+j/jpWsArNU602cV/y1qDSCPlZfDgRHSkK/jc9805hh/fCsi7kyevaZ
+5D5vBb6+UM2Sdv8YNxPY7NB2+PFJ6KKTx2gM5uvYtZx4KivpL7souXE3QQKBgDxg
+FZ5q7rPUIjepP13MyteqqNC+D51Eh4PCgP58W3JfpQPPhOnYj14QMVPbWuSnys3W
+0Gc8PsuyDQHoti8znYm4khntAjE6SZ8Up+gM1P3WE6wh3Tq+RQwk5WDcSfcx+AVp
+6Z2Cw4ccp9LRc1LpYXA9WW8LBCRhnFXWSAPGquNBAoGAdCsvFzSipQ5qxWPlClRM
+lKqDdQheRl9IKCuImXZAvdX952VhmP7QV5PUwLV/CkVquvSdRSshrMO/fqFjfkjr
+puajXghFXa+YppQW42tPYBmKDnNVgxW5d5sC62AYaykh2iNw3v4BJyN+MMmkSf0M
+4/mKvs5m8N2OkOpY6r2wCp8=
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA256.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA256.cer
new file mode 100644
index 0000000..c503f92
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA256.cer
@@ -0,0 +1,81 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            e8:33:78:c7:69:9c:28:c1
+    Signature Algorithm: sha256WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=INTER_CA_SHA256-ROOT_CA_SHA256
+        Validity
+            Not Before: Mar 30 04:51:04 2017 GMT
+            Not After : Mar 28 04:51:04 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=END_ENTITY_SHA256-INTER_CA_SHA256-ROOT_CA_SHA256
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:ee:1f:6f:ba:23:fc:ad:a0:b7:96:00:6d:c9:d3:
+                    13:10:69:f6:26:c5:80:d9:35:a0:e3:89:60:65:ed:
+                    31:a9:2f:84:e3:45:8f:38:16:e1:c8:fc:6f:22:6f:
+                    45:58:f4:32:ad:c9:48:b1:9b:ba:99:7a:ff:9b:13:
+                    1a:df:40:69:3d:65:5e:c3:9f:8d:6e:06:f9:86:71:
+                    43:12:ab:06:f4:41:5f:f9:fe:19:de:3f:bf:f7:11:
+                    78:68:5a:3b:02:15:47:b4:af:4c:ce:80:23:3b:3b:
+                    df:85:8d:49:52:bb:11:07:c9:a1:44:d3:d3:f1:58:
+                    65:59:a5:4e:18:bb:bd:4f:7a:82:3f:24:91:88:4d:
+                    5f:35:a3:61:6c:b7:b5:2b:cf:ae:4d:13:93:96:ae:
+                    f6:ce:fa:97:c3:12:24:6f:8c:bb:ff:ba:29:7b:ce:
+                    76:15:db:c9:42:6c:7e:d4:d4:af:2a:e6:71:95:b6:
+                    7a:60:4e:0b:a1:18:be:bf:37:79:48:82:fc:68:06:
+                    da:17:11:0c:1d:31:5e:7d:00:fb:07:f1:a9:c0:d7:
+                    da:c7:9f:98:7f:66:69:27:af:2c:40:b3:47:3a:46:
+                    0f:4f:96:8d:f4:32:89:c8:53:f7:80:55:9c:0d:c3:
+                    c4:dc:cc:3d:bb:e9:17:34:db:19:d6:46:66:e6:c5:
+                    3a:11
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA256
+                serial:84:A1:70:1D:0A:92:D3:CC
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha256WithRSAEncryption
+         1d:1a:87:7d:11:0e:cc:cd:7f:6c:ed:21:1a:2c:35:de:09:b8:
+         c4:cf:0c:31:00:3d:f5:bd:d4:6e:f0:4f:7e:c2:8d:d6:c5:28:
+         ed:38:9d:d7:52:32:e2:8d:7b:64:c8:1d:4e:69:7e:49:5f:e1:
+         5e:04:c7:d3:96:d2:63:ef:2c:35:4f:eb:08:2b:9d:b0:15:df:
+         33:d8:1c:59:8e:bb:f1:28:4f:f0:85:bb:3c:56:e1:86:a4:75:
+         2b:44:8a:1c:98:ae:94:f3:b6:76:a9:a3:e7:d6:bc:58:ef:fe:
+         32:11:6f:76:5b:85:f8:14:91:83:2c:b6:20:a5:48:48:8b:6e:
+         ee:a8:6c:2b:12:18:94:3e:59:5e:a6:66:53:dc:40:b2:da:fd:
+         a4:5f:16:35:b6:20:2b:31:86:9b:91:55:b2:35:63:d2:47:bd:
+         91:7e:43:bc:d6:0e:dc:95:1a:f0:8d:08:e5:66:cd:d1:0b:32:
+         d6:92:26:3e:78:e8:70:74:e1:14:64:b0:39:5d:7c:d0:28:23:
+         c7:83:53:02:90:fe:fc:9e:aa:9a:fb:c4:ef:9d:d5:22:f6:c1:
+         fd:e4:07:04:25:4f:8f:b2:13:6f:0d:51:cc:54:b4:38:d3:ac:
+         31:aa:94:c5:d0:c8:5a:58:35:13:87:3e:f6:74:26:8c:2b:7d:
+         6c:8e:36:a5
+-----BEGIN CERTIFICATE-----
+MIIEATCCAumgAwIBAgIJAOgzeMdpnCjBMA0GCSqGSIb3DQEBCwUAMG8xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMScwJQYDVQQDDB5JTlRFUl9DQV9TSEEyNTYtUk9PVF9D
+QV9TSEEyNTYwHhcNMTcwMzMwMDQ1MTA0WhcNMjcwMzI4MDQ1MTA0WjCBgTELMAkG
+A1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ0wCwYDVQQHDARDaXR5MQwwCgYDVQQKDANP
+cmcxDTALBgNVBAsMBEphdmExOTA3BgNVBAMMMEVORF9FTlRJVFlfU0hBMjU2LUlO
+VEVSX0NBX1NIQTI1Ni1ST09UX0NBX1NIQTI1NjCCASIwDQYJKoZIhvcNAQEBBQAD
+ggEPADCCAQoCggEBAO4fb7oj/K2gt5YAbcnTExBp9ibFgNk1oOOJYGXtMakvhONF
+jzgW4cj8byJvRVj0Mq3JSLGbupl6/5sTGt9AaT1lXsOfjW4G+YZxQxKrBvRBX/n+
+Gd4/v/cReGhaOwIVR7SvTM6AIzs734WNSVK7EQfJoUTT0/FYZVmlThi7vU96gj8k
+kYhNXzWjYWy3tSvPrk0Tk5au9s76l8MSJG+Mu/+6KXvOdhXbyUJsftTUryrmcZW2
+emBOC6EYvr83eUiC/GgG2hcRDB0xXn0A+wfxqcDX2sefmH9maSevLECzRzpGD0+W
+jfQyichT94BVnA3DxNzMPbvpFzTbGdZGZubFOhECAwEAAaOBjDCBiTB5BgNVHSME
+cjBwoWOkYTBfMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExDTALBgNVBAcMBENp
+dHkxDDAKBgNVBAoMA09yZzENMAsGA1UECwwESmF2YTEXMBUGA1UEAwwOUk9PVF9D
+QV9TSEEyNTaCCQCEoXAdCpLTzDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUA
+A4IBAQAdGod9EQ7MzX9s7SEaLDXeCbjEzwwxAD31vdRu8E9+wo3WxSjtOJ3XUjLi
+jXtkyB1OaX5JX+FeBMfTltJj7yw1T+sIK52wFd8z2BxZjrvxKE/whbs8VuGGpHUr
+RIocmK6U87Z2qaPn1rxY7/4yEW92W4X4FJGDLLYgpUhIi27uqGwrEhiUPllepmZT
+3ECy2v2kXxY1tiArMYabkVWyNWPSR72RfkO81g7clRrwjQjlZs3RCzLWkiY+eOhw
+dOEUZLA5XXzQKCPHg1MCkP78nqqa+8TvndUi9sH95AcEJU+PshNvDVHMVLQ406wx
+qpTF0MhaWDUThz72dCaMK31sjjal
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA1-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA1-PRIV.key
new file mode 100644
index 0000000..cb07762
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA1-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDX1pPNXGpnPQNc
+x9ReXrjbcHkIoyXcdXbhO0TnUBV5aGJTEn5/meDsK76Y2KDVyU/EO2jXpaQ5QiGn
+UzY6vKIn6boqTov4NLYwBsVPdAG/xZyr5q7p6bnJ8WRj40A2JeOeZ3FMglRtBCNg
+rYeEC4MDp2F41OVxsJZ4huodq94arqhD/hjE40g06UNa0I+/2dIpI2cSamIC5b3L
+/DK3ol+gIw/OOxMCgzAUSjeH6nTrrW1hUeSKx0NPGWRLWzLQ2yxhYcXlsedNuKHo
+ux/p3EkGXoGPajK7s7IlKj9CPQYwlQez37jCLJGovArqTr/8hxfrKMdZOl5bp+6H
+6uWh6af7AgMBAAECggEAXrUsM79qfRR7pjmVCTe9G6T1pwGXum3clSYhrPIqChTw
+mA0Ubr9Bv7/OKVlc8ZIdKzj6Xy2yquFGzRopQIrHCIZ5htjieC4BB3/hEmUP42s9
+vPxDIibJvD/s0hvEcD4d68LuJylFDHT1ZRWf0iQPAApxLckVSNa4n/hrQEvK8J+G
+HIH8VATq9iHp/GQmmFB8b3ubqn46zDGqly14+TGP2KtVJlY9FuCpvmtZZZjJ+K09
+vYM+BATwje6N6PqX5a3Z+NFC1NK9CmC+U6ECJ27uhySn8kvlU/i/SOAnrPftByO7
+g7K8p2Qzq1LlVIUU/JTidNZGXTaTMOVg8eHLmyt92QKBgQD9a94rLqk9BUtVsTYa
+AImt+KbUMB+Zi83cYDiCfNBkfIYw4dVUFJecmqZwg7IeqNwuSmXP41fASOvDel/L
+8bOj/rPccVSG9pmU0ir5WK9n8zobogfAzvaFr8cmo+TVv0FOZZA8e/+UfVsiKAsW
+3nwhwxN8ieILU1dtaNV1IfnAPwKBgQDaCM9URf+DFILI2WpuzKpk1loF6HrlklIn
++N0IFFcalqUpC8GhXTw7suypRBCZ+cp32h7WEcN9aHLMrnkDQP3bGTv53pJT5N9k
+7nk9Bfrk0CJCxeMRKwtuMhLkOmT0eh2aB1lWR0owA5b1Gjtiz5kTW7NN2+paJCDz
+SiDLVoFpRQKBgQCHvt0N4nuy/QACkd86BGm7b8LlTDXRCMsnrb73XqY9/VngG0gr
+NrCTqV9YS6MAu1Dd1uo8djnN/QGU/xsLYpfoU4nCnk450SQpTH7Ke8/Rbb8FiECA
+7hutNqAFuardOApiVRLy4zTfNFq5rBtsj5aMezMX9b/Ic0cUiyA0ExP1/wKBgQCp
+SDvI34wRdqRQUtWa7xbAsdg1TBnXEjLtTAA4nKpAP4Q+CR2uLlhstW+fv/PvyIwV
+X+mfJS2VubmgBzp3d0dhjAcP6mnL7yAvGiRRZ8ozSxG+rCuvEa+PQBuAzYHCeulu
+xJPtM+56tt7GsDY5cpsT95eQNNWQZQqcOgqaNTDGzQKBgCmMwRP1HN0qUSSVO1d8
+8N17OoZe5yntppEjesYQrLf4AEgPS3Qj8dv0qfe3z1B0gAKlG9+OR8cUBCMGVyum
+b51SiSi3LSm1VeuMfT7JDMSxTkbaI5CY7v+/5yCRFqikgBtCkHM9m4K95d3dVDO8
+JGrlKiKVIbu5LnQZMkPHRIEX
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA1.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA1.cer
new file mode 100644
index 0000000..58a4043
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA1.cer
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            8d:a0:d2:8a:ee:0b:cf:65
+    Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=ROOT_CA_SHA1
+        Validity
+            Not Before: Mar 30 04:51:04 2017 GMT
+            Not After : Mar 28 04:51:04 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=INTER_CA_SHA1-ROOT_CA_SHA1
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:d7:d6:93:cd:5c:6a:67:3d:03:5c:c7:d4:5e:5e:
+                    b8:db:70:79:08:a3:25:dc:75:76:e1:3b:44:e7:50:
+                    15:79:68:62:53:12:7e:7f:99:e0:ec:2b:be:98:d8:
+                    a0:d5:c9:4f:c4:3b:68:d7:a5:a4:39:42:21:a7:53:
+                    36:3a:bc:a2:27:e9:ba:2a:4e:8b:f8:34:b6:30:06:
+                    c5:4f:74:01:bf:c5:9c:ab:e6:ae:e9:e9:b9:c9:f1:
+                    64:63:e3:40:36:25:e3:9e:67:71:4c:82:54:6d:04:
+                    23:60:ad:87:84:0b:83:03:a7:61:78:d4:e5:71:b0:
+                    96:78:86:ea:1d:ab:de:1a:ae:a8:43:fe:18:c4:e3:
+                    48:34:e9:43:5a:d0:8f:bf:d9:d2:29:23:67:12:6a:
+                    62:02:e5:bd:cb:fc:32:b7:a2:5f:a0:23:0f:ce:3b:
+                    13:02:83:30:14:4a:37:87:ea:74:eb:ad:6d:61:51:
+                    e4:8a:c7:43:4f:19:64:4b:5b:32:d0:db:2c:61:61:
+                    c5:e5:b1:e7:4d:b8:a1:e8:bb:1f:e9:dc:49:06:5e:
+                    81:8f:6a:32:bb:b3:b2:25:2a:3f:42:3d:06:30:95:
+                    07:b3:df:b8:c2:2c:91:a8:bc:0a:ea:4e:bf:fc:87:
+                    17:eb:28:c7:59:3a:5e:5b:a7:ee:87:ea:e5:a1:e9:
+                    a7:fb
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA1
+                serial:F1:3B:B7:FB:28:3F:52:09
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+         d3:ce:da:23:e1:7c:73:fb:7f:26:d7:a4:3c:7b:17:01:75:ce:
+         a5:bd:75:f1:65:1b:56:27:ae:f8:97:a6:c4:ca:94:93:c9:12:
+         bb:c7:ec:2b:d5:38:d5:43:3a:6c:c2:51:3a:79:2f:d7:4e:da:
+         2d:12:1f:b8:c2:4f:c8:ba:33:d3:f5:0c:78:cc:26:69:24:47:
+         3f:ed:17:a0:7f:d0:20:fe:11:ca:75:50:1a:61:e1:91:b5:fa:
+         91:04:e9:14:59:77:d4:29:0f:43:19:e0:dc:dd:a6:18:14:f4:
+         33:3e:f0:cb:36:7b:18:04:03:dd:be:35:41:c4:3e:65:d2:67:
+         44:73:ab:7f:d1:b9:26:7e:b3:1e:d0:e4:a4:52:83:60:a9:e6:
+         e1:bf:62:bb:9b:16:0c:97:ad:11:1a:2f:eb:92:ca:7e:98:15:
+         46:23:59:5d:26:d9:ec:57:85:51:5b:09:f1:9b:1b:d3:5d:53:
+         02:67:1a:e4:24:49:67:87:04:75:66:13:56:1b:8b:a1:08:de:
+         c8:4b:f8:87:73:6e:c2:31:ee:f6:32:14:45:32:a3:3f:e4:b1:
+         0f:23:28:29:b4:a3:86:65:4f:2e:57:ad:8f:44:77:f8:4b:ea:
+         7b:9d:8e:dc:cb:07:ee:b4:78:46:db:cd:12:eb:ad:ef:9b:8f:
+         22:ba:83:7b
+-----BEGIN CERTIFICATE-----
+MIID1jCCAr6gAwIBAgIJAI2g0oruC89lMA0GCSqGSIb3DQEBBQUAMF0xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMRUwEwYDVQQDDAxST09UX0NBX1NIQTEwHhcNMTcwMzMw
+MDQ1MTA0WhcNMjcwMzI4MDQ1MTA0WjBrMQswCQYDVQQGEwJVUzELMAkGA1UECAwC
+Q0ExDTALBgNVBAcMBENpdHkxDDAKBgNVBAoMA09yZzENMAsGA1UECwwESmF2YTEj
+MCEGA1UEAwwaSU5URVJfQ0FfU0hBMS1ST09UX0NBX1NIQTEwggEiMA0GCSqGSIb3
+DQEBAQUAA4IBDwAwggEKAoIBAQDX1pPNXGpnPQNcx9ReXrjbcHkIoyXcdXbhO0Tn
+UBV5aGJTEn5/meDsK76Y2KDVyU/EO2jXpaQ5QiGnUzY6vKIn6boqTov4NLYwBsVP
+dAG/xZyr5q7p6bnJ8WRj40A2JeOeZ3FMglRtBCNgrYeEC4MDp2F41OVxsJZ4huod
+q94arqhD/hjE40g06UNa0I+/2dIpI2cSamIC5b3L/DK3ol+gIw/OOxMCgzAUSjeH
+6nTrrW1hUeSKx0NPGWRLWzLQ2yxhYcXlsedNuKHoux/p3EkGXoGPajK7s7IlKj9C
+PQYwlQez37jCLJGovArqTr/8hxfrKMdZOl5bp+6H6uWh6af7AgMBAAGjgYowgYcw
+dwYDVR0jBHAwbqFhpF8wXTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ0wCwYD
+VQQHDARDaXR5MQwwCgYDVQQKDANPcmcxDTALBgNVBAsMBEphdmExFTATBgNVBAMM
+DFJPT1RfQ0FfU0hBMYIJAPE7t/soP1IJMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN
+AQEFBQADggEBANPO2iPhfHP7fybXpDx7FwF1zqW9dfFlG1YnrviXpsTKlJPJErvH
+7CvVONVDOmzCUTp5L9dO2i0SH7jCT8i6M9P1DHjMJmkkRz/tF6B/0CD+Ecp1UBph
+4ZG1+pEE6RRZd9QpD0MZ4NzdphgU9DM+8Ms2exgEA92+NUHEPmXSZ0Rzq3/RuSZ+
+sx7Q5KRSg2Cp5uG/YrubFgyXrREaL+uSyn6YFUYjWV0m2exXhVFbCfGbG9NdUwJn
+GuQkSWeHBHVmE1Ybi6EI3shL+IdzbsIx7vYyFEUyoz/ksQ8jKCm0o4ZlTy5XrY9E
+d/hL6nudjtzLB+60eEbbzRLrre+bjyK6g3s=
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA256-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA256-PRIV.key
new file mode 100644
index 0000000..8997b5f
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA256-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDWN68vV57EPqPZ
+Dtvi2+NI4tfxUgkaWJXbqrLKuAJC8bff9edZpMXGAyqMpDDr7MAjs/3TDYpVaWYN
+Id5iwqamImbBLYf/K0LOkaX6+TyogaqwwdNVryR5eYcGXEiJY1MJ2mgzCNeGJ091
+4qwll3xkjAFolB6o9QoIbLB3cctl0vw6oAoi3TKWQxJ+UI6/uBotX5eQ9z1b/MDs
+6PNXHB22jYAj4tOePMZxq7AVCwTFpWbHK8j5ftXxpVoU5ECNHfIAHLprJqc/lKdf
+7rMyflbsjD8nV7TwY+FW7WfOQgiJhk0OK3VaBeSsovpOOwjS4Lpsazh3eUXeZJUk
+lrYrMfI3AgMBAAECggEAEpXmNx9NAQ3GPXDSlw4o3AwCXEeXzpdc+SAIPxpT5+b8
+4wt8tQRcvF9N88HTFMUHrpFRNlx4Ygyw8/a6SqtEtilJ7Py8TeE8/JsaYXn6T0xg
+uNE4OrjlWzy2AFFFYdYiQDqYy8S6nkMO29V8xg4slrSm8qHXPyVzZ2O2s8ZFtWG+
+ItAMb+Gv7FU2M4te/TwRnadljFAoyWry0XCXle1fN1Y3QJXtu3VDdmLmU0t+VGfa
+wuZ5k0FIb9TFIQuxtgUNXJZmIjZw4Ych3luUc1bMSn9FPHeOzk8J3yo1tGqQu15M
+KMLHxASTgt6opfhDbYIpD0fJJqCPdiJlMrqXHBPYwQKBgQDy8lrmsjBE97H0U2sS
+tqlJq+7VOe2ien+z6seXFxd6XHBI8D/wTi2Q/7BpIGbpek3xc0ujxaFbcqo/RJZA
+TUzYmc5leQLTwy4a54Neo33+sOuYPg8fQIMPT1OGa3DXv3EPSC8FdQrweNjn/bDX
+YXbXJ2nKc3RgdTVehuMh6mw25wKBgQDhuitrTL3dlyHMGhO+djxW3cgjsUbJXQsK
+1GnkGw5mzzL67M6ixw4WNxNJjuXEUI5Vat8iJzhZOA+Ae84DDbeN2FCM7UBpUsyB
+9T9aApBYLLMflZhl4PXK/zkh1J9vA5NqqJbAcw6a5uH0kjtuJOSvP5CVQc2xsX9i
+U9+eZesQMQKBgHo4Znasqg/oNIRf+vvdHOlNL8fhbqVQzzHqKSLfoRYTrwFirCfu
+jInnuA4LGPrYZqHTiPgJEpX456EQli4fNUu6hNUTvdJe3LD4S2SvB1G8G6npfp4Q
+TF7FX5W+M3S2gOBZRh6OtUQo56Y+QFr6U1kGIPiSgLeN/51gap/DWVF9AoGBAMmL
+hMEloFF+Y/rtPbvNrkqRc+YKn32jyfw9dN7rGYzKbGaHkmjc+sLzIhGHubfzhWLX
+Law9AJ8I4y6BXIx1bvMDtche/igMefV/mLUxnNhd8QG+fHhayJwcDlMamdBxjOqq
+5Q+oq927UP0ipFXQMzAWvW3Hd3W1WlvdL8kqjxvBAoGBAMaZ9JZO48Zn17IUweZC
+oVfM99YaHa+dm3L47PdQN6Ag6UjQ+sZ/6SLGIIg67SDhUQ+nuPCL8PH3Rf7PCuqW
+oHW3F+44SIrVdLlMkWb444dxdP6Xvb9aOMpvopBDuvzYPR3xzZ202DZbZ0sIEVu8
+8a+09JbRmEI2/Ee+em6a/Y4T
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA256.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA256.cer
new file mode 100644
index 0000000..440b9c3
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA1-ROOT_CA_SHA256.cer
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            84:a1:70:1d:0a:92:d3:cd
+    Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=ROOT_CA_SHA256
+        Validity
+            Not Before: Mar 30 04:51:03 2017 GMT
+            Not After : Mar 28 04:51:03 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=INTER_CA_SHA1-ROOT_CA_SHA256
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:d6:37:af:2f:57:9e:c4:3e:a3:d9:0e:db:e2:db:
+                    e3:48:e2:d7:f1:52:09:1a:58:95:db:aa:b2:ca:b8:
+                    02:42:f1:b7:df:f5:e7:59:a4:c5:c6:03:2a:8c:a4:
+                    30:eb:ec:c0:23:b3:fd:d3:0d:8a:55:69:66:0d:21:
+                    de:62:c2:a6:a6:22:66:c1:2d:87:ff:2b:42:ce:91:
+                    a5:fa:f9:3c:a8:81:aa:b0:c1:d3:55:af:24:79:79:
+                    87:06:5c:48:89:63:53:09:da:68:33:08:d7:86:27:
+                    4f:75:e2:ac:25:97:7c:64:8c:01:68:94:1e:a8:f5:
+                    0a:08:6c:b0:77:71:cb:65:d2:fc:3a:a0:0a:22:dd:
+                    32:96:43:12:7e:50:8e:bf:b8:1a:2d:5f:97:90:f7:
+                    3d:5b:fc:c0:ec:e8:f3:57:1c:1d:b6:8d:80:23:e2:
+                    d3:9e:3c:c6:71:ab:b0:15:0b:04:c5:a5:66:c7:2b:
+                    c8:f9:7e:d5:f1:a5:5a:14:e4:40:8d:1d:f2:00:1c:
+                    ba:6b:26:a7:3f:94:a7:5f:ee:b3:32:7e:56:ec:8c:
+                    3f:27:57:b4:f0:63:e1:56:ed:67:ce:42:08:89:86:
+                    4d:0e:2b:75:5a:05:e4:ac:a2:fa:4e:3b:08:d2:e0:
+                    ba:6c:6b:38:77:79:45:de:64:95:24:96:b6:2b:31:
+                    f2:37
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA256
+                serial:A3:52:9D:82:6F:DD:C6:1D
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+         56:fb:b0:ab:a6:bb:3a:55:04:ed:5c:3b:ae:0c:0d:32:8f:aa:
+         ec:b7:24:2c:d5:37:b9:1f:91:64:21:c2:c0:6d:bc:d4:d4:5e:
+         e2:f1:12:ad:34:02:93:65:10:6c:93:93:2c:23:53:e8:ed:96:
+         c7:3b:6b:44:df:ff:24:8b:c1:cc:26:b2:1e:8f:26:66:34:3a:
+         bb:7d:ef:4e:a6:7e:b2:c8:93:c9:f7:46:5a:de:40:88:70:28:
+         c7:d1:fd:27:c3:99:fd:6a:a1:a5:e1:6d:c3:5a:bc:99:28:95:
+         e9:17:ed:a4:56:a5:04:ad:fb:74:a2:01:26:2a:5a:45:bc:7b:
+         0d:df:0c:41:79:8b:b4:15:50:cd:88:ce:f5:a7:ee:cb:d2:5b:
+         76:81:4c:1b:09:92:0e:e9:c6:42:df:b7:81:9e:89:3d:49:ed:
+         17:fa:d2:2f:bd:8b:74:d5:cb:ce:af:46:6a:74:b3:34:a0:c5:
+         a0:64:66:7a:80:59:15:1e:de:16:df:11:3d:1e:96:e2:e5:2d:
+         f1:4d:20:f3:f6:f1:19:aa:ac:f8:b4:6e:76:a0:26:6c:cd:90:
+         f2:23:35:a0:8b:c8:e8:5d:27:5d:34:d3:69:74:61:c5:ac:6a:
+         54:e9:86:8d:ca:ca:16:03:48:7f:cd:23:43:41:e2:77:3a:5d:
+         f2:3e:de:fa
+-----BEGIN CERTIFICATE-----
+MIID3DCCAsSgAwIBAgIJAIShcB0KktPNMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMRcwFQYDVQQDDA5ST09UX0NBX1NIQTI1NjAeFw0xNzAz
+MzAwNDUxMDNaFw0yNzAzMjgwNDUxMDNaMG0xCzAJBgNVBAYTAlVTMQswCQYDVQQI
+DAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3JnMQ0wCwYDVQQLDARKYXZh
+MSUwIwYDVQQDDBxJTlRFUl9DQV9TSEExLVJPT1RfQ0FfU0hBMjU2MIIBIjANBgkq
+hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1jevL1eexD6j2Q7b4tvjSOLX8VIJGliV
+26qyyrgCQvG33/XnWaTFxgMqjKQw6+zAI7P90w2KVWlmDSHeYsKmpiJmwS2H/ytC
+zpGl+vk8qIGqsMHTVa8keXmHBlxIiWNTCdpoMwjXhidPdeKsJZd8ZIwBaJQeqPUK
+CGywd3HLZdL8OqAKIt0ylkMSflCOv7gaLV+XkPc9W/zA7OjzVxwdto2AI+LTnjzG
+cauwFQsExaVmxyvI+X7V8aVaFORAjR3yABy6ayanP5SnX+6zMn5W7Iw/J1e08GPh
+Vu1nzkIIiYZNDit1WgXkrKL6TjsI0uC6bGs4d3lF3mSVJJa2KzHyNwIDAQABo4GM
+MIGJMHkGA1UdIwRyMHChY6RhMF8xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEN
+MAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3JnMQ0wCwYDVQQLDARKYXZhMRcwFQYD
+VQQDDA5ST09UX0NBX1NIQTI1NoIJAKNSnYJv3cYdMAwGA1UdEwQFMAMBAf8wDQYJ
+KoZIhvcNAQEFBQADggEBAFb7sKumuzpVBO1cO64MDTKPquy3JCzVN7kfkWQhwsBt
+vNTUXuLxEq00ApNlEGyTkywjU+jtlsc7a0Tf/ySLwcwmsh6PJmY0Ort9706mfrLI
+k8n3RlreQIhwKMfR/SfDmf1qoaXhbcNavJkolekX7aRWpQSt+3SiASYqWkW8ew3f
+DEF5i7QVUM2IzvWn7svSW3aBTBsJkg7pxkLft4GeiT1J7Rf60i+9i3TVy86vRmp0
+szSgxaBkZnqAWRUe3hbfET0eluLlLfFNIPP28RmqrPi0bnagJmzNkPIjNaCLyOhd
+J10002l0YcWsalTpho3KyhYDSH/NI0NB4nc6XfI+3vo=
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA1-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA1-PRIV.key
new file mode 100644
index 0000000..e1388a1
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA1-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDh12cWta4H1sY6
+KHyfvxSJk1JIUAe08JFmHwvO0Eb6LRmKrqwbXEyGs0CPGhMlnmxjvrfXbKkUjodY
+9ByxSBa7zYaVdPDGKDQ3HvPxyjZ0npPrHDII2wR+0UOD0ftkDbPHWQFBsl0OY/sI
+pRzihYRh8MwCrADdza3vHPrNBz2umuM5jnN20FVIGKhGMGbg5eackBmgvcaWT6BW
+B67iYRWVRwLywdSE+imOIS4P7ivndBe1DlB+z4oBmbBwYkM+5WyR3yT4+stdByyn
+naL+kExsC/TWDw+sE9TQUo2zqRbNI1j8UhBaQZz1pbX5YeGPTq/Z2J8EGvPxz6VY
+PmkDyMl3AgMBAAECggEAKrlDKUqpZ5Y73di26smNKxGRqVhqfNJdz0HkS/We18kc
+Yd31dR+a4oial/fI038K5ju4L6rAucDU3gEgRHFsy45v/Won+nS0nBDg+UbV0m4F
+cZ7d4Er+qLcR3KgmtKDa98VgtXr2m7hSTypdMoUrrBOPpJnBeDRmyStkTtEl3Bfa
+Fh72SZXNauGvB5+qrbPhls1HoWVbzZ3i6oUCBDrfmLD6G0ipGM+AQICmXjYX8OxT
+Ye5u/6DU4TkWu5A6/1m0Q4clGZXSeMx2d4PkZ0jZKOXdhwvzAaGh7I0AkuA4ZlCj
+slXENyAzQhm4EHHWxvld11e8oEh4DUfWtUXeLttawQKBgQDybE5gjAZdv+5BJXWV
+l2G+zb5tKHWd0XQQ2epktX+i+iA5lA0bLkAA4rrmZVsDEc4D2yjINsopBHTjwvtV
+F/LBBWIynm6MkIyjY6+0fBfoikz9ebKikuf1YRoRC5Dl0pd2Wa/ps2wowDbQnj3o
+4e6x+z0WviyL+uRr1JyotR2J5wKBgQDufVw64Z6AdWThlnP8qXqW12QQBd5qChPr
+fHJEkx0ViBoM97yalVzDssXn4X2ESVDqtsxH21SzKzDGzLoCG3PwCPgp9zWk9GS/
+HfhXFzI3qHIlI+s6481vjqDnXtvJ7oHutxYkkYQXSMgC69jeRY0nW78Bz03BAYjQ
+boRmeK1x8QKBgQDw9VBOTMADLUPvQwGGKAsC8VQHAgEuVcONAF0nrvPoFcA0GwGP
+87+wYayuVy5IdckVMiBuKW91p7VbsjHJGd2zl9tMPwfY9dCkkvBRcEr/W4A9Llqt
+l2GyF8smCB4FIfZkr67Xlvy54Jxbbf5RXUi5ZeUJlwuGM2IaACGa2zM6HwKBgEmW
+iOTqRTwh/RTWlcd6jAcLQybmiLBzl53r8l5SfoDsVA14S8vvFoaUHRjlrRMqhDtI
+WFQ7yzDVvOE6vpJz4hxIyDo6u2TAvG10U/Kbh7VA1qe7I5QyQmuPuPprfKocXB9K
+gxyZggalQIIWP/6lu15PoupuCvHpBUw7LcNorSwhAoGAXXBcp4U369B3ld+M+hC9
+G+2VttaC2917iqoM8R7WOiwez+10s+fNv89B6DjZxeX5haa7bbB+RvfqN8OysIRK
+m0Bh4w6q/JuRydj9T5sJLk9oUrEFLncqihlNT+1WEwR5x50OODYjpHz1YORo5HzL
+cnXKk8xTZFE7mXD1ZJoRLxc=
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA1.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA1.cer
new file mode 100644
index 0000000..3756ab2
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA1.cer
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            8d:a0:d2:8a:ee:0b:cf:64
+    Signature Algorithm: sha256WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=ROOT_CA_SHA1
+        Validity
+            Not Before: Mar 30 04:51:03 2017 GMT
+            Not After : Mar 28 04:51:03 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=INTER_CA_SHA256-ROOT_CA_SHA1
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:e1:d7:67:16:b5:ae:07:d6:c6:3a:28:7c:9f:bf:
+                    14:89:93:52:48:50:07:b4:f0:91:66:1f:0b:ce:d0:
+                    46:fa:2d:19:8a:ae:ac:1b:5c:4c:86:b3:40:8f:1a:
+                    13:25:9e:6c:63:be:b7:d7:6c:a9:14:8e:87:58:f4:
+                    1c:b1:48:16:bb:cd:86:95:74:f0:c6:28:34:37:1e:
+                    f3:f1:ca:36:74:9e:93:eb:1c:32:08:db:04:7e:d1:
+                    43:83:d1:fb:64:0d:b3:c7:59:01:41:b2:5d:0e:63:
+                    fb:08:a5:1c:e2:85:84:61:f0:cc:02:ac:00:dd:cd:
+                    ad:ef:1c:fa:cd:07:3d:ae:9a:e3:39:8e:73:76:d0:
+                    55:48:18:a8:46:30:66:e0:e5:e6:9c:90:19:a0:bd:
+                    c6:96:4f:a0:56:07:ae:e2:61:15:95:47:02:f2:c1:
+                    d4:84:fa:29:8e:21:2e:0f:ee:2b:e7:74:17:b5:0e:
+                    50:7e:cf:8a:01:99:b0:70:62:43:3e:e5:6c:91:df:
+                    24:f8:fa:cb:5d:07:2c:a7:9d:a2:fe:90:4c:6c:0b:
+                    f4:d6:0f:0f:ac:13:d4:d0:52:8d:b3:a9:16:cd:23:
+                    58:fc:52:10:5a:41:9c:f5:a5:b5:f9:61:e1:8f:4e:
+                    af:d9:d8:9f:04:1a:f3:f1:cf:a5:58:3e:69:03:c8:
+                    c9:77
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA1
+                serial:F1:3B:B7:FB:28:3F:52:09
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha256WithRSAEncryption
+         24:74:94:0a:7d:81:62:16:ed:4e:0f:e2:19:06:bd:8b:7a:e4:
+         35:63:4c:73:ec:3a:45:d7:2a:8c:80:e6:6b:d9:26:7d:78:9f:
+         6b:36:f9:fd:94:f7:ac:86:3c:0e:95:66:80:f3:0b:93:0f:44:
+         0a:05:76:d9:1d:c6:37:6f:ea:02:b9:29:e9:96:11:d1:e6:1e:
+         70:95:31:77:22:ed:3c:96:ad:9f:74:8c:41:f5:44:47:a2:4e:
+         d4:58:86:92:31:36:94:90:05:9d:94:16:8c:f8:c8:18:7b:45:
+         dc:49:45:53:63:06:bb:c6:a9:33:72:fe:48:7b:0e:21:89:e2:
+         6c:44:29:3c:10:65:c6:7d:8e:6c:cb:95:ea:a1:ae:3b:c1:12:
+         98:ce:b9:c8:98:12:0d:ac:a7:bd:31:cc:aa:ac:51:b4:a7:33:
+         5b:60:0d:d6:ed:e0:29:5a:29:f5:fc:e0:27:db:77:88:fd:59:
+         0c:02:70:d8:f4:1d:89:88:13:94:55:5b:77:a3:a6:8e:18:9a:
+         b8:82:5b:64:27:8c:ef:10:6a:df:ed:fd:a4:b5:2b:44:0f:5f:
+         89:08:15:48:df:b0:13:08:7c:08:cc:07:ea:b8:a6:17:ab:35:
+         65:07:2c:b9:ec:9a:d0:1f:e7:b9:a7:36:9e:24:f7:73:10:e0:
+         70:6c:78:6e
+-----BEGIN CERTIFICATE-----
+MIID2DCCAsCgAwIBAgIJAI2g0oruC89kMA0GCSqGSIb3DQEBCwUAMF0xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMRUwEwYDVQQDDAxST09UX0NBX1NIQTEwHhcNMTcwMzMw
+MDQ1MTAzWhcNMjcwMzI4MDQ1MTAzWjBtMQswCQYDVQQGEwJVUzELMAkGA1UECAwC
+Q0ExDTALBgNVBAcMBENpdHkxDDAKBgNVBAoMA09yZzENMAsGA1UECwwESmF2YTEl
+MCMGA1UEAwwcSU5URVJfQ0FfU0hBMjU2LVJPT1RfQ0FfU0hBMTCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAOHXZxa1rgfWxjoofJ+/FImTUkhQB7TwkWYf
+C87QRvotGYqurBtcTIazQI8aEyWebGO+t9dsqRSOh1j0HLFIFrvNhpV08MYoNDce
+8/HKNnSek+scMgjbBH7RQ4PR+2QNs8dZAUGyXQ5j+wilHOKFhGHwzAKsAN3Nre8c
++s0HPa6a4zmOc3bQVUgYqEYwZuDl5pyQGaC9xpZPoFYHruJhFZVHAvLB1IT6KY4h
+Lg/uK+d0F7UOUH7PigGZsHBiQz7lbJHfJPj6y10HLKedov6QTGwL9NYPD6wT1NBS
+jbOpFs0jWPxSEFpBnPWltflh4Y9Or9nYnwQa8/HPpVg+aQPIyXcCAwEAAaOBijCB
+hzB3BgNVHSMEcDBuoWGkXzBdMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExDTAL
+BgNVBAcMBENpdHkxDDAKBgNVBAoMA09yZzENMAsGA1UECwwESmF2YTEVMBMGA1UE
+AwwMUk9PVF9DQV9TSEExggkA8Tu3+yg/UgkwDAYDVR0TBAUwAwEB/zANBgkqhkiG
+9w0BAQsFAAOCAQEAJHSUCn2BYhbtTg/iGQa9i3rkNWNMc+w6RdcqjIDma9kmfXif
+azb5/ZT3rIY8DpVmgPMLkw9ECgV22R3GN2/qArkp6ZYR0eYecJUxdyLtPJatn3SM
+QfVER6JO1FiGkjE2lJAFnZQWjPjIGHtF3ElFU2MGu8apM3L+SHsOIYnibEQpPBBl
+xn2ObMuV6qGuO8ESmM65yJgSDaynvTHMqqxRtKczW2AN1u3gKVop9fzgJ9t3iP1Z
+DAJw2PQdiYgTlFVbd6OmjhiauIJbZCeM7xBq3+39pLUrRA9fiQgVSN+wEwh8CMwH
+6rimF6s1ZQcsueya0B/nuac2niT3cxDgcGx4bg==
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA256-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA256-PRIV.key
new file mode 100644
index 0000000..e01b5ae
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA256-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDbXbqJwTisc3wF
+Z6MYWonNxMsWBfNfwFB/KLQfEfZ+phvReORvJZ5lVT/1gTVs5/QhREU0qW48OxyM
+NXKgkcBZGLkRvVlDaOEcbTIDa4PYf7rnsTtU8DWYuyqqmeBnJ2ViKJ3ZGA750ctm
+ZsDZlWdwE5iCqX3hA/pfHGu+CNiW2jWSulookdIPqdJeLiwgnntm5tZFxoZ9hD1h
+J88iRqmqpS4joYXPxUNxfJ49Nx4iRfrx7HpyUVg3i5Q2q/AVuVSwbbPfNaQrG71V
+EbK0K7EjtL8Gw8DCS8Gvr0ApIpabA644BueWA9skjns9lvfSuH76Y5e2nHGJiOz7
+LWMFV24LAgMBAAECggEAD546u7gQCucl+1SHniJEEWxjcSv3SeftU0BYoqWqwRWe
+gWl0Ch3Jizlollger6RME1pC+x7dBFjJDYp4oMn/wdgqxQKQKmZ7MITtvKSY/H8L
+lZdevAtmJXud7AuMmIuLglOV+XDnEA5Jxv6l2Ff0x1v9zb+3gJ/B4aeqXBtRIFxD
+CfCcvcN1Bl+jj2fvS8iRrqofGa6DGXZVZvtIVjIvJnR1YBVMVYBNs6kcscM5Nblr
+PJFDDsg+Ph7hq5gpwj7pyb4e54sn06pdfBLgGkHJ82tCNkc+f4Ee2M7MoS//m4IC
+ajV+xht4REHuB7h5GM50TF5Gziianyc3g8//M7sC8QKBgQD7tvSzJK1N0w9NPK1e
+Q5zfEWxU1c7dJ/hr81OpvEzUut1vZeKT1mydtA0YJftDTFTXe5fsPKNTIrL4BWUw
+PLa3jWQNNDSLDNhdoqKrno+017pD7+p8G8x3AfyHxn6x2Shoz0jHTnGf+Q0vnvdT
+ZTFpWU+3J8Wp4+1Nx2lwGGEJXwKBgQDfGcnk/fTSs/QQNgzkC1HaQ35b66eEBwK3
+yi8KNsNxDByvdYGxaK/tLRiZIsKMxAV+3jebfA4WSgDkenmzGLn4gYUr5gkkmEW5
+irETT+HDK8LeM2iIbCROactwu3ytJrgpaoDXxRbDsGCUf98hjz1JDCR94wjGH78H
+K3Pmbm6e1QKBgEIuTVIYj5RJrNlC3dZN8p3Xx+LaQER3cOJ5HIMhJhY8d2IFqLf0
+BaTFJTg3LEP6esgZD82l988w7Vs2l+9B10yVWTv7gOEaZHzh+OEklGYY3jlkiANP
+j8eudwX/02nRTcWY0mrMniVQZv4hTqfXkFFBkSr3wwmzCr6LcpZtYn4DAoGBAIEm
+2bTBu1/aoxhbYd0GHI1g8x5dbm1E7bLdzZt5Fm00GMsOGFVOiEGiEJJeCAgbVh8a
+n1BYYYNPtfKOYDNoxgfxWtmN4o8Xw41kl5vZa5VjmPyu//2xtNbb8dTCBKvsNUJs
+kEfYpZQFX/O3jsFLvauy5tElhCfFqv2IjyC/nzQ9AoGBAJLCz62crl/AXqArSnAH
+efX9ozrNMJMQDMDtw5xB/EqRMazmTlqkYr0H4iTS69QNAPr8czdmpY6uO6BRE9+/
+f/tWZXQj7eT8pd1Dp2Ed1vHsOfiAUha0cYUMrqshsqKNXrCxl7144iRGZY7OjFI1
+USqVVNaci2IrtW5+NGV62BYP
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA256.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA256.cer
new file mode 100644
index 0000000..8c7e21c
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/INTER_CA_SHA256-ROOT_CA_SHA256.cer
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            84:a1:70:1d:0a:92:d3:cc
+    Signature Algorithm: sha256WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=ROOT_CA_SHA256
+        Validity
+            Not Before: Mar 30 04:51:02 2017 GMT
+            Not After : Mar 28 04:51:02 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=INTER_CA_SHA256-ROOT_CA_SHA256
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:db:5d:ba:89:c1:38:ac:73:7c:05:67:a3:18:5a:
+                    89:cd:c4:cb:16:05:f3:5f:c0:50:7f:28:b4:1f:11:
+                    f6:7e:a6:1b:d1:78:e4:6f:25:9e:65:55:3f:f5:81:
+                    35:6c:e7:f4:21:44:45:34:a9:6e:3c:3b:1c:8c:35:
+                    72:a0:91:c0:59:18:b9:11:bd:59:43:68:e1:1c:6d:
+                    32:03:6b:83:d8:7f:ba:e7:b1:3b:54:f0:35:98:bb:
+                    2a:aa:99:e0:67:27:65:62:28:9d:d9:18:0e:f9:d1:
+                    cb:66:66:c0:d9:95:67:70:13:98:82:a9:7d:e1:03:
+                    fa:5f:1c:6b:be:08:d8:96:da:35:92:ba:5a:28:91:
+                    d2:0f:a9:d2:5e:2e:2c:20:9e:7b:66:e6:d6:45:c6:
+                    86:7d:84:3d:61:27:cf:22:46:a9:aa:a5:2e:23:a1:
+                    85:cf:c5:43:71:7c:9e:3d:37:1e:22:45:fa:f1:ec:
+                    7a:72:51:58:37:8b:94:36:ab:f0:15:b9:54:b0:6d:
+                    b3:df:35:a4:2b:1b:bd:55:11:b2:b4:2b:b1:23:b4:
+                    bf:06:c3:c0:c2:4b:c1:af:af:40:29:22:96:9b:03:
+                    ae:38:06:e7:96:03:db:24:8e:7b:3d:96:f7:d2:b8:
+                    7e:fa:63:97:b6:9c:71:89:88:ec:fb:2d:63:05:57:
+                    6e:0b
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA256
+                serial:A3:52:9D:82:6F:DD:C6:1D
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha256WithRSAEncryption
+         3f:f2:91:96:59:da:c1:8a:8c:4d:eb:25:1f:74:87:6f:fc:2e:
+         92:7e:44:ff:a7:0b:78:aa:6d:2b:fe:b8:0a:b9:e9:bc:19:87:
+         44:15:e1:3a:e4:54:e6:4b:54:3c:75:d9:f8:c9:07:83:74:f4:
+         4c:ab:e4:6b:19:64:b6:4b:69:44:6e:74:f6:66:cf:16:43:8f:
+         9c:cb:20:e4:7a:5e:78:13:00:6f:28:78:8d:c5:05:46:a9:92:
+         0f:d0:38:c3:8b:0e:39:d4:87:e9:ee:35:07:78:dd:1a:1a:8c:
+         3a:36:56:4e:3b:96:7a:d1:2c:29:95:06:29:ac:b2:f7:5c:fc:
+         09:1c:72:24:e2:9e:72:bf:60:3a:7a:9b:59:35:48:6a:d2:3e:
+         76:7f:ad:41:45:a5:6f:93:96:10:c4:4c:cf:3f:f1:1d:00:5f:
+         d1:60:f1:88:86:d8:ef:ff:72:63:8f:4c:df:9e:35:cb:17:2c:
+         16:7b:d4:6c:0e:67:b6:ee:bc:68:07:b0:99:df:c5:f3:88:28:
+         a1:46:bb:6d:f5:2c:45:6b:e9:90:c0:78:35:20:73:14:5a:d0:
+         a5:56:cb:04:f4:43:a7:cf:28:f5:a3:5b:ac:f2:a3:4c:f6:39:
+         3c:ef:f4:b1:42:20:8e:2a:14:0d:a1:b4:38:b2:f2:6c:14:33:
+         05:04:bb:a7
+-----BEGIN CERTIFICATE-----
+MIID3jCCAsagAwIBAgIJAIShcB0KktPMMA0GCSqGSIb3DQEBCwUAMF8xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMRcwFQYDVQQDDA5ST09UX0NBX1NIQTI1NjAeFw0xNzAz
+MzAwNDUxMDJaFw0yNzAzMjgwNDUxMDJaMG8xCzAJBgNVBAYTAlVTMQswCQYDVQQI
+DAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3JnMQ0wCwYDVQQLDARKYXZh
+MScwJQYDVQQDDB5JTlRFUl9DQV9TSEEyNTYtUk9PVF9DQV9TSEEyNTYwggEiMA0G
+CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDbXbqJwTisc3wFZ6MYWonNxMsWBfNf
+wFB/KLQfEfZ+phvReORvJZ5lVT/1gTVs5/QhREU0qW48OxyMNXKgkcBZGLkRvVlD
+aOEcbTIDa4PYf7rnsTtU8DWYuyqqmeBnJ2ViKJ3ZGA750ctmZsDZlWdwE5iCqX3h
+A/pfHGu+CNiW2jWSulookdIPqdJeLiwgnntm5tZFxoZ9hD1hJ88iRqmqpS4joYXP
+xUNxfJ49Nx4iRfrx7HpyUVg3i5Q2q/AVuVSwbbPfNaQrG71VEbK0K7EjtL8Gw8DC
+S8Gvr0ApIpabA644BueWA9skjns9lvfSuH76Y5e2nHGJiOz7LWMFV24LAgMBAAGj
+gYwwgYkweQYDVR0jBHIwcKFjpGEwXzELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNB
+MQ0wCwYDVQQHDARDaXR5MQwwCgYDVQQKDANPcmcxDTALBgNVBAsMBEphdmExFzAV
+BgNVBAMMDlJPT1RfQ0FfU0hBMjU2ggkAo1Kdgm/dxh0wDAYDVR0TBAUwAwEB/zAN
+BgkqhkiG9w0BAQsFAAOCAQEAP/KRllnawYqMTeslH3SHb/wukn5E/6cLeKptK/64
+CrnpvBmHRBXhOuRU5ktUPHXZ+MkHg3T0TKvkaxlktktpRG509mbPFkOPnMsg5Hpe
+eBMAbyh4jcUFRqmSD9A4w4sOOdSH6e41B3jdGhqMOjZWTjuWetEsKZUGKayy91z8
+CRxyJOKecr9gOnqbWTVIatI+dn+tQUWlb5OWEMRMzz/xHQBf0WDxiIbY7/9yY49M
+3541yxcsFnvUbA5ntu68aAewmd/F84gooUa7bfUsRWvpkMB4NSBzFFrQpVbLBPRD
+p88o9aNbrPKjTPY5PO/0sUIgjioUDaG0OLLybBQzBQS7pw==
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA1-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA1-PRIV.key
new file mode 100644
index 0000000..c56e9f1
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA1-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDhROyqYZ5UdQJ0
+xJdG4B+aXPHbIKV0w5AvJ7r4SuvIJ/4pEmV6fIU3+4CvN2sXKzW+0DppOBz99Oe6
+19jfMAx5t0pKHkwh5J0bduLf1k83lm8CvoX1a9lYY6ER4Y8wWtTcHG016onl8Lxq
+QVqlqbk9zsbNipvWxipIQOgzq7DmTXQ2Hrx0tg4DROlgwuarPBWcZjq6dG09nI0E
+zSY/Wis619L/6sdCxGFhvnJ0YbULvIqdR2J638KEO+rx1RXD66Jqc0KhnGZLf7NT
+YfTlY0zIMHE8oMkJPdH9tPKbyXMXhiG/u5x81RcJxT4gLi5fq2yrvMsaUC13bnJJ
+npFNy6XTAgMBAAECggEAPS4h9Jg0jw2EUEBAMaCXFK5fhTrVlOO0Ggp5TgvTA3ZR
+Ich8RQrih3TH2056yD0VCLC23HK/9Pz5npYWsW70RG5SP9UAqkfTn2znaxFiTF+P
+4Lfr296hlc7hJOEUqXZRz0HtKzJ6pzd9hIIhY1K4G6A4AATAFFGXlC4Eolvj3Hf0
+NgVFDYaFDEpEiin+fAsM5c1ZE0pxRZSVE5Emr9XvkvxLm5dK9lKOyyOQ+5RHhxQ6
+J4n+6Ct0O+FkeP9u3jTMtew9gxTwvHSgkf05hSRoqgMKcusKpqhHp6E4mT7sus7q
+AYzdv5sNIcx7PpojuHjploMH7ghhYxCmVOOFxXJ4CQKBgQD2naA8zZnh5BfbVC8p
+C9A6HfwnZ7cCjGtL30y8fh8OAMHbdGE4JXlhifPgW7PDxZ0Yho4rYd9MxLVcGl+p
+YPOKKcaKbzwdUJwZ4Zs1dJC+LTRqku6O3qlEofeojHN5IctLoLqDsiZBD7aT4l+O
+wmAWqwLZZQtiFpA/jbCb/Qw7tQKBgQDp11rFSHLKuVdMuSnUon3WN6lj9WNM3KFy
+C8R4EN/DTnuHrVL0MCff9eddBYvpQe0z/LA74oAD9fSjmtYe/24qIm2lAWVkwxBm
+yyspUmOybU8Q3GN8xw1Vrwg8JR5JVAOwKHwCGmybT7Zs+9eJRONnnZ6nUbTQ94cP
+sJVkyGUgZwKBgQCd/0CAk+xpl1tdbiLEtkfSZBF/IWhTXqkDM+2SuW6l5wBL29TJ
+RuDsB5jR/Y4+96T86H++9XY9Va0nc9IjzvRYaQlE+ZzW3yUTQ8HPTn3JCWcSfE4Q
+BEEHsojbWBhG28rGChRUeVceybVcK2SzLn6nJyqtIppXXkNOJDWoykcDHQKBgHzY
+27+k1JTjq3ZtDaZXMvQiN7AEnYW17gRjv/uSlsVBq7ZelYGGDGQIeAQ0J+Tbq/cr
+nDP80/hJYtnOmy9llL2uL/f+7NGFS8Z2Bo9DS7NBpQsNf5ho9fefQbhK4Qapcmak
+1sCQtxec0XsSYpsJSphRkRkoCG/hGB0KXFi4nTVVAoGAJrrh1rG1UMXmFUpraXIy
+Mc58lEYB87EkMOthyK8XklxLoYKPZlVS7AZZDtQMpRC6YnweiX6LmO4AamtlT71x
+BzQgmwHn4wOaysDPHFuf5hNCobXJREoiNzHb4AcqiZ7SNAW5Jd+0/PSY47hrDnRy
+wNFyg3O0k3kaXz5h3lVhxo4=
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA1.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA1.cer
new file mode 100644
index 0000000..490d03b
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA1.cer
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            f1:3b:b7:fb:28:3f:52:09
+    Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=ROOT_CA_SHA1
+        Validity
+            Not Before: Mar 30 04:51:01 2017 GMT
+            Not After : Mar 28 04:51:01 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=ROOT_CA_SHA1
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:e1:44:ec:aa:61:9e:54:75:02:74:c4:97:46:e0:
+                    1f:9a:5c:f1:db:20:a5:74:c3:90:2f:27:ba:f8:4a:
+                    eb:c8:27:fe:29:12:65:7a:7c:85:37:fb:80:af:37:
+                    6b:17:2b:35:be:d0:3a:69:38:1c:fd:f4:e7:ba:d7:
+                    d8:df:30:0c:79:b7:4a:4a:1e:4c:21:e4:9d:1b:76:
+                    e2:df:d6:4f:37:96:6f:02:be:85:f5:6b:d9:58:63:
+                    a1:11:e1:8f:30:5a:d4:dc:1c:6d:35:ea:89:e5:f0:
+                    bc:6a:41:5a:a5:a9:b9:3d:ce:c6:cd:8a:9b:d6:c6:
+                    2a:48:40:e8:33:ab:b0:e6:4d:74:36:1e:bc:74:b6:
+                    0e:03:44:e9:60:c2:e6:ab:3c:15:9c:66:3a:ba:74:
+                    6d:3d:9c:8d:04:cd:26:3f:5a:2b:3a:d7:d2:ff:ea:
+                    c7:42:c4:61:61:be:72:74:61:b5:0b:bc:8a:9d:47:
+                    62:7a:df:c2:84:3b:ea:f1:d5:15:c3:eb:a2:6a:73:
+                    42:a1:9c:66:4b:7f:b3:53:61:f4:e5:63:4c:c8:30:
+                    71:3c:a0:c9:09:3d:d1:fd:b4:f2:9b:c9:73:17:86:
+                    21:bf:bb:9c:7c:d5:17:09:c5:3e:20:2e:2e:5f:ab:
+                    6c:ab:bc:cb:1a:50:2d:77:6e:72:49:9e:91:4d:cb:
+                    a5:d3
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA1
+                serial:F1:3B:B7:FB:28:3F:52:09
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+         0b:be:7b:c7:53:14:87:37:02:66:37:f5:6f:38:3c:75:b3:72:
+         f6:f8:9c:77:4d:9a:e4:5c:23:3a:4a:5f:aa:6e:90:23:e9:b8:
+         48:fd:6d:e1:88:b5:a2:a5:0a:30:c0:7d:33:a8:6f:79:42:52:
+         80:f8:87:4b:2a:15:0a:ff:14:88:97:21:12:89:1c:d3:33:bf:
+         fa:4f:5e:68:9a:c6:69:2f:aa:1d:31:aa:80:f5:b0:d3:72:c9:
+         fa:ce:3b:5f:15:a6:61:e0:f1:d1:ab:e7:40:48:c1:d4:30:bd:
+         0a:13:37:0d:ea:ac:38:b2:af:1b:78:3a:29:53:ee:90:71:3b:
+         2b:a4:8b:16:e9:da:94:59:44:3d:7f:34:fb:0a:d1:6b:db:3d:
+         66:01:a6:0f:98:b5:cc:57:39:b9:09:f2:01:cc:e5:89:86:7d:
+         f2:9a:b2:ad:08:3d:da:05:f9:24:1e:30:98:cc:92:a9:4c:4a:
+         cf:a3:53:6e:7f:5e:db:aa:43:9c:ac:b1:b5:80:ab:7e:a3:89:
+         71:37:c2:4a:c1:16:9d:26:d5:70:89:8a:8e:a8:cb:40:3b:b8:
+         f0:d2:31:54:c2:1f:fc:24:5e:29:c1:5e:86:48:1e:83:4e:44:
+         30:ff:8d:46:47:b6:0e:9c:77:bf:ba:08:8b:bd:eb:b7:ca:45:
+         0a:e3:0c:ec
+-----BEGIN CERTIFICATE-----
+MIIDyDCCArCgAwIBAgIJAPE7t/soP1IJMA0GCSqGSIb3DQEBBQUAMF0xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMRUwEwYDVQQDDAxST09UX0NBX1NIQTEwHhcNMTcwMzMw
+MDQ1MTAxWhcNMjcwMzI4MDQ1MTAxWjBdMQswCQYDVQQGEwJVUzELMAkGA1UECAwC
+Q0ExDTALBgNVBAcMBENpdHkxDDAKBgNVBAoMA09yZzENMAsGA1UECwwESmF2YTEV
+MBMGA1UEAwwMUk9PVF9DQV9TSEExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEA4UTsqmGeVHUCdMSXRuAfmlzx2yCldMOQLye6+ErryCf+KRJlenyFN/uA
+rzdrFys1vtA6aTgc/fTnutfY3zAMebdKSh5MIeSdG3bi39ZPN5ZvAr6F9WvZWGOh
+EeGPMFrU3BxtNeqJ5fC8akFapam5Pc7GzYqb1sYqSEDoM6uw5k10Nh68dLYOA0Tp
+YMLmqzwVnGY6unRtPZyNBM0mP1orOtfS/+rHQsRhYb5ydGG1C7yKnUdiet/ChDvq
+8dUVw+uianNCoZxmS3+zU2H05WNMyDBxPKDJCT3R/bTym8lzF4Yhv7ucfNUXCcU+
+IC4uX6tsq7zLGlAtd25ySZ6RTcul0wIDAQABo4GKMIGHMHcGA1UdIwRwMG6hYaRf
+MF0xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoG
+A1UECgwDT3JnMQ0wCwYDVQQLDARKYXZhMRUwEwYDVQQDDAxST09UX0NBX1NIQTGC
+CQDxO7f7KD9SCTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQALvnvH
+UxSHNwJmN/VvODx1s3L2+Jx3TZrkXCM6Sl+qbpAj6bhI/W3hiLWipQowwH0zqG95
+QlKA+IdLKhUK/xSIlyESiRzTM7/6T15omsZpL6odMaqA9bDTcsn6zjtfFaZh4PHR
+q+dASMHUML0KEzcN6qw4sq8beDopU+6QcTsrpIsW6dqUWUQ9fzT7CtFr2z1mAaYP
+mLXMVzm5CfIBzOWJhn3ymrKtCD3aBfkkHjCYzJKpTErPo1Nuf17bqkOcrLG1gKt+
+o4lxN8JKwRadJtVwiYqOqMtAO7jw0jFUwh/8JF4pwV6GSB6DTkQw/41GR7YOnHe/
+ugiLveu3ykUK4wzs
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA256-PRIV.key b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA256-PRIV.key
new file mode 100644
index 0000000..4c53e23
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA256-PRIV.key
@@ -0,0 +1,26 @@
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC2DzrIXts3huIs
+dtX+ZbY6RR5/S4yXUs3jJXc4mbITLn7PO1QVBT528NZVOu6jUxXsPTpTg1jgresh
+6Pcv1LNj7bP30uPXhmyawgQVUgLTGyU0+JWLJrpU7cEOTK4f/j58A+UHL255fM7T
+B3EvIj2Ad1MAYwIvVZnAXPSFt72YGz15doYiewp8dTXcX4TsFisCbypFikWxpXIF
+qjVqbAUx8fYgQxfPWFw4HbVvo3Nu1LqypswAfsmHd2v5nMv8wkAcPG5dIYHACN9r
+kPLMoUNUcBLn6QdIUrhk7dldRlR0TWT+VtRLKVWlGkMk9rRK+RnskNSuPg8fjb/Y
+gM0m5p0JAgMBAAECggEAPVk8cbClJjzpkhopWiRkF5abBEItCgD5KAXD+uqvuw77
+5FEVsE+oEORvFSFasOaaiJTJRsMH/A4fIbojMZb3LEE5V9VUuZeumSevwI92LDUF
+gKgTnGRcfanwWCU2t8kwvRGC57zv+Tg5aZskZMGg/901tvemENVDjjLEoxqbZNmX
+WZnhB8XiPxl9K32K0l+qNW3HvKJ8lkaW0L6/4HWWU4rYwbc9TZpzHDOXhAICQB76
+fCw4hcy1K6KjfGjfE/6afqMa76KSxxeCvUYorZlm2gk1WcEafkg9Jwzz2SWtsa8W
+L+YzbTd1GE8Z9bDA88Dw3vgdC1Pt0ywX/fJ/GCDHUQKBgQDjNaW/enKYXGTsM5C1
+I94OgSmgnjnjPZIBY0u89iCAf07ueqrNaLJgOEkGpCrLEa4tC2qc57ge1DO2rxTa
+6RowUzqG3Oqdsq21QaQZAmjjDC5mXlYPRpWvWVjBRaIDKw9zAUg9qEy24e/pRjdP
+cugR30d1OaxExdgoAt8iOqZ67wKBgQDNIPqF/+npd1UAqgdC9lOxnPQly1zjz/zY
+jbeJeww9Ut9aCXj0+we4gKhD37d178y1H2QBod+IPpqQ/uZmbNmN5JP+MIk2kZKB
+4jquQLa5jEc+y57h8UrWJBY+Ls7xiu/cw3aCAk0JaZRSrH/KzWE91x3s7o2yV43d
+dMkRmTTHhwKBgQCHaq4C1WP/UvIDpSgWDe6HDoxU4nj16vheQ2Qcl0T/0OCmWg36
+pu/JUUKU5rtqlHsO9cLxCVo/ZZH8y5TOdCfbrX8wafKbUqcdZKX9EeaZi+ULtiXs
+rNEB1WqEpo/M+5kVnioENY6jYT2v9t14SK/wFvdr8pet1YzjK/L5X6NhmQKBgFK4
+0u7I9k61Ve0vpEAH0FaXIgo/yZUBYkj+VZ62pYfxbKsFmObKeSGZmMHObVC9RMNi
+BlV2LwvlmzWP5eA2U0GahWgDsMH10KxaTCnLZSTMgkq7mLYrNW/IG8Q14jScQAC6
+PodNYD3EexEgCWUCkA19O885oKDkGAzPtOpI63TvAoGBAJvbKiJSFJNd3CIQlrOM
+wNw+Sww+c2Qw4PZZvIJNzjWumjesfUsuAyySrO2nXPzzSOrh7dRW98suaFi1Mih6
+ZwBpIll5VQsd2dwEa6vp6RFGWFNKPvDILEVgcCEOmckKRWDo+fb5bx2VHj1v4kfG
+MHDqy8Y2ercsU0Z5mEN8bUD7
diff --git a/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA256.cer b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA256.cer
new file mode 100644
index 0000000..09d0dbd
--- /dev/null
+++ b/jdk/test/sun/security/ssl/CertPathRestrictions/certs/ROOT_CA_SHA256.cer
@@ -0,0 +1,80 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            a3:52:9d:82:6f:dd:c6:1d
+    Signature Algorithm: sha256WithRSAEncryption
+        Issuer: C=US, ST=CA, L=City, O=Org, OU=Java, CN=ROOT_CA_SHA256
+        Validity
+            Not Before: Mar 30 04:51:01 2017 GMT
+            Not After : Mar 28 04:51:01 2027 GMT
+        Subject: C=US, ST=CA, L=City, O=Org, OU=Java, CN=ROOT_CA_SHA256
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+                Public-Key: (2048 bit)
+                Modulus:
+                    00:b6:0f:3a:c8:5e:db:37:86:e2:2c:76:d5:fe:65:
+                    b6:3a:45:1e:7f:4b:8c:97:52:cd:e3:25:77:38:99:
+                    b2:13:2e:7e:cf:3b:54:15:05:3e:76:f0:d6:55:3a:
+                    ee:a3:53:15:ec:3d:3a:53:83:58:e0:ad:eb:21:e8:
+                    f7:2f:d4:b3:63:ed:b3:f7:d2:e3:d7:86:6c:9a:c2:
+                    04:15:52:02:d3:1b:25:34:f8:95:8b:26:ba:54:ed:
+                    c1:0e:4c:ae:1f:fe:3e:7c:03:e5:07:2f:6e:79:7c:
+                    ce:d3:07:71:2f:22:3d:80:77:53:00:63:02:2f:55:
+                    99:c0:5c:f4:85:b7:bd:98:1b:3d:79:76:86:22:7b:
+                    0a:7c:75:35:dc:5f:84:ec:16:2b:02:6f:2a:45:8a:
+                    45:b1:a5:72:05:aa:35:6a:6c:05:31:f1:f6:20:43:
+                    17:cf:58:5c:38:1d:b5:6f:a3:73:6e:d4:ba:b2:a6:
+                    cc:00:7e:c9:87:77:6b:f9:9c:cb:fc:c2:40:1c:3c:
+                    6e:5d:21:81:c0:08:df:6b:90:f2:cc:a1:43:54:70:
+                    12:e7:e9:07:48:52:b8:64:ed:d9:5d:46:54:74:4d:
+                    64:fe:56:d4:4b:29:55:a5:1a:43:24:f6:b4:4a:f9:
+                    19:ec:90:d4:ae:3e:0f:1f:8d:bf:d8:80:cd:26:e6:
+                    9d:09
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Authority Key Identifier: 
+                DirName:/C=US/ST=CA/L=City/O=Org/OU=Java/CN=ROOT_CA_SHA256
+                serial:A3:52:9D:82:6F:DD:C6:1D
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha256WithRSAEncryption
+         6f:2f:a4:56:d5:58:6d:20:74:6b:66:b7:41:eb:c2:8c:56:2e:
+         1b:51:79:b0:07:a6:63:28:8b:20:40:b9:72:4b:f5:e0:6b:18:
+         39:5b:b4:ae:50:58:25:81:86:e3:19:ec:b1:dd:fb:5c:f5:d4:
+         a8:7d:a0:50:46:ac:1e:80:dc:cc:aa:0c:61:f8:a3:41:af:03:
+         35:a4:02:4f:23:c7:5c:36:26:90:fe:51:07:58:0f:e7:14:26:
+         34:c2:a7:bd:f2:34:33:cf:67:e4:2d:82:b6:e8:94:85:d6:8b:
+         01:6f:ba:3d:78:f6:db:3d:dc:ba:6e:6d:83:fa:ea:d0:60:ab:
+         1b:ad:9b:e2:ba:e3:e3:9f:26:5b:9a:c7:fb:9f:c1:7d:cc:0b:
+         cf:23:e0:ac:e1:e4:09:08:84:98:d4:6e:16:34:a5:5e:74:d5:
+         a8:61:e1:65:f7:9a:51:9f:f0:9f:86:65:ce:4f:b8:b6:64:7d:
+         86:62:21:ec:71:50:70:ca:6b:2e:74:12:51:b1:68:b0:4a:66:
+         19:60:e9:f8:b0:bf:6e:d8:ad:75:29:c3:31:13:73:01:3d:d5:
+         d4:5b:c2:60:bb:c4:c8:e6:29:cf:a3:49:65:8d:c2:1d:7d:c9:
+         75:33:9b:97:73:38:99:5c:7d:b3:9f:b0:be:0d:f4:6a:c6:19:
+         8d:98:a1:ca
+-----BEGIN CERTIFICATE-----
+MIIDzjCCAragAwIBAgIJAKNSnYJv3cYdMA0GCSqGSIb3DQEBCwUAMF8xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3Jn
+MQ0wCwYDVQQLDARKYXZhMRcwFQYDVQQDDA5ST09UX0NBX1NIQTI1NjAeFw0xNzAz
+MzAwNDUxMDFaFw0yNzAzMjgwNDUxMDFaMF8xCzAJBgNVBAYTAlVTMQswCQYDVQQI
+DAJDQTENMAsGA1UEBwwEQ2l0eTEMMAoGA1UECgwDT3JnMQ0wCwYDVQQLDARKYXZh
+MRcwFQYDVQQDDA5ST09UX0NBX1NIQTI1NjCCASIwDQYJKoZIhvcNAQEBBQADggEP
+ADCCAQoCggEBALYPOshe2zeG4ix21f5ltjpFHn9LjJdSzeMldziZshMufs87VBUF
+Pnbw1lU67qNTFew9OlODWOCt6yHo9y/Us2Pts/fS49eGbJrCBBVSAtMbJTT4lYsm
+ulTtwQ5Mrh/+PnwD5Qcvbnl8ztMHcS8iPYB3UwBjAi9VmcBc9IW3vZgbPXl2hiJ7
+Cnx1NdxfhOwWKwJvKkWKRbGlcgWqNWpsBTHx9iBDF89YXDgdtW+jc27UurKmzAB+
+yYd3a/mcy/zCQBw8bl0hgcAI32uQ8syhQ1RwEufpB0hSuGTt2V1GVHRNZP5W1Esp
+VaUaQyT2tEr5GeyQ1K4+Dx+Nv9iAzSbmnQkCAwEAAaOBjDCBiTB5BgNVHSMEcjBw
+oWOkYTBfMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExDTALBgNVBAcMBENpdHkx
+DDAKBgNVBAoMA09yZzENMAsGA1UECwwESmF2YTEXMBUGA1UEAwwOUk9PVF9DQV9T
+SEEyNTaCCQCjUp2Cb93GHTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IB
+AQBvL6RW1VhtIHRrZrdB68KMVi4bUXmwB6ZjKIsgQLlyS/Xgaxg5W7SuUFglgYbj
+Geyx3ftc9dSofaBQRqwegNzMqgxh+KNBrwM1pAJPI8dcNiaQ/lEHWA/nFCY0wqe9
+8jQzz2fkLYK26JSF1osBb7o9ePbbPdy6bm2D+urQYKsbrZviuuPjnyZbmsf7n8F9
+zAvPI+Cs4eQJCISY1G4WNKVedNWoYeFl95pRn/CfhmXOT7i2ZH2GYiHscVBwymsu
+dBJRsWiwSmYZYOn4sL9u2K11KcMxE3MBPdXUW8Jgu8TI5inPo0lljcIdfcl1M5uX
+cziZXH2zn7C+DfRqxhmNmKHK
+-----END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/ServerHandshaker/HelloExtensionsTest.java b/jdk/test/sun/security/ssl/ServerHandshaker/HelloExtensionsTest.java
new file mode 100644
index 0000000..bb84d5f
--- /dev/null
+++ b/jdk/test/sun/security/ssl/ServerHandshaker/HelloExtensionsTest.java
@@ -0,0 +1,287 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173783
+ * @summary 6u141 IllegalArgumentException: jdk.tls.namedGroups
+ * run main/othervm HelloExtensionsTest
+ * run main/othervm HelloExtensionsTest -Djdk.tls.namedGroups="bug, bug"
+ * run main/othervm HelloExtensionsTest -Djdk.tls.namedGroups="secp521r1"
+ *
+ */
+import javax.crypto.*;
+import javax.net.ssl.*;
+import javax.net.ssl.SSLEngineResult.*;
+import java.io.*;
+import java.nio.*;
+import java.security.*;
+
+public class HelloExtensionsTest {
+
+    private static boolean debug = false;
+    private static boolean proceed = true;
+    private static boolean EcAvailable = isEcAvailable();
+
+    static String pathToStores = "../../../../javax/net/ssl/etc";
+    private static String keyStoreFile = "keystore";
+    private static String trustStoreFile = "truststore";
+    private static String passwd = "passphrase";
+
+    private static String keyFilename =
+            System.getProperty("test.src", "./") + "/" + pathToStores +
+                "/" + keyStoreFile;
+    private static String trustFilename =
+            System.getProperty("test.src", "./") + "/" + pathToStores +
+                "/" + trustStoreFile;
+
+    private static void checkDone(SSLEngine ssle) throws Exception {
+        if (!ssle.isInboundDone()) {
+            throw new Exception("isInboundDone isn't done");
+        }
+        if (!ssle.isOutboundDone()) {
+            throw new Exception("isOutboundDone isn't done");
+        }
+    }
+
+    private static void runTest(SSLEngine ssle) throws Exception {
+
+         /*
+
+         A client hello message captured via wireshark by selecting
+         a TLSv1.2 Client Hello record and clicking through to the
+         TLSv1.2 Record Layer line and then selecting the hex stream
+         via "copy -> bytes -> hex stream".
+
+         For Record purposes, here's the ClientHello :
+
+         *** ClientHello, TLSv1.2
+         RandomCookie:  GMT: 1469560450 bytes = { 108, 140, 12, 202,
+         2, 213, 10, 236, 143, 223, 58, 162, 228, 155, 239, 3, 98,
+         232, 89, 41, 116, 120, 13, 37, 105, 153, 97, 241 }
+         Session ID:  {}
+         Cipher Suites: [TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
+         TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256,
+         TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256,
+         TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256,
+         TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
+         TLS_DHE_DSS_WITH_AES_128_CBC_SHA256,
+         TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
+         TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
+         TLS_RSA_WITH_AES_128_CBC_SHA,
+         TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
+         TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,
+         TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
+         TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
+         TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+         TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+         TLS_RSA_WITH_AES_128_GCM_SHA256,
+         TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
+         TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256,
+         TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
+         TLS_DHE_DSS_WITH_AES_128_GCM_SHA256,
+         TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
+         TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
+         SSL_RSA_WITH_3DES_EDE_CBC_SHA,
+         TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,
+         TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,
+         SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
+         SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
+         TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
+         Compression Methods:  { 0 }
+         Extension elliptic_curves, curve names: {secp256r1,
+         sect163k1, sect163r2, secp192r1, secp224r1, sect233k1, sect233r1,
+         sect283k1, sect283r1, secp384r1, sect409k1, sect409r1, secp521r1,
+         sect571k1, sect571r1, secp160k1, secp160r1, secp160r2, sect163r1,
+         secp192k1, sect193r1, sect193r2, secp224k1, sect239k1, secp256k1}
+         Extension ec_point_formats, formats: [uncompressed]
+         Extension signature_algorithms, signature_algorithms:
+         SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA,
+         SHA256withECDSA, SHA256withRSA, Unknown (hash:0x3, signature:0x3),
+         Unknown (hash:0x3, signature:0x1), SHA1withECDSA,
+         SHA1withRSA, SHA1withDSA
+         Extension server_name, server_name:
+         [host_name: bugs.openjdk.java.net]
+         */
+
+        String hello = "16030300df010000db03035898b7826c8c0cc" +
+            "a02d50aec8fdf3aa2e49bef0362e8592974780d25699961f" +
+            "100003ac023c027003cc025c02900670040c009c013002fc" +
+            "004c00e00330032c02bc02f009cc02dc031009e00a2c008c" +
+            "012000ac003c00d0016001300ff01000078000a003400320" +
+            "0170001000300130015000600070009000a0018000b000c0" +
+            "019000d000e000f001000110002001200040005001400080" +
+            "016000b00020100000d00180016060306010503050104030" +
+            "401030303010203020102020000001a00180000156275677" +
+            "32e6f70656e6a646b2e6a6176612e6e6574";
+
+        byte[] msg_clihello = hexStringToByteArray(hello);
+        ByteBuffer bf_clihello = ByteBuffer.wrap(msg_clihello);
+
+        SSLSession session = ssle.getSession();
+        int appBufferMax = session.getApplicationBufferSize();
+        int netBufferMax = session.getPacketBufferSize();
+
+        ByteBuffer serverIn = ByteBuffer.allocate(appBufferMax + 50);
+        ByteBuffer serverOut = ByteBuffer.wrap("I'm Server".getBytes());
+        ByteBuffer sTOc = ByteBuffer.allocate(netBufferMax);
+
+        ssle.beginHandshake();
+
+        // unwrap the clientHello message.
+        SSLEngineResult result = ssle.unwrap(bf_clihello, serverIn);
+        System.out.println("server unwrap " + result);
+        runDelegatedTasks(result, ssle);
+
+        if (!proceed) {
+            //expected exception occurred. Don't process anymore
+            return;
+        }
+
+        // one more step, ensure the clientHello message is parsed.
+        SSLEngineResult.HandshakeStatus status = ssle.getHandshakeStatus();
+        if ( status == HandshakeStatus.NEED_UNWRAP) {
+            result = ssle.unwrap(bf_clihello, serverIn);
+            System.out.println("server unwrap " + result);
+            runDelegatedTasks(result, ssle);
+        } else if ( status == HandshakeStatus.NEED_WRAP) {
+            result = ssle.wrap(serverOut, sTOc);
+            System.out.println("server wrap " + result);
+            runDelegatedTasks(result, ssle);
+        } else {
+            throw new Exception("unexpected handshake status " + status);
+        }
+
+        // enough, stop
+    }
+
+    /*
+     * If the result indicates that we have outstanding tasks to do,
+     * go ahead and run them in this thread.
+     */
+    private static void runDelegatedTasks(SSLEngineResult result,
+            SSLEngine engine) throws Exception {
+
+        if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) {
+            Runnable runnable;
+            try {
+                while ((runnable = engine.getDelegatedTask()) != null) {
+                    log("\trunning delegated task...");
+                    runnable.run();
+                }
+            } catch (ExceptionInInitializerError e) {
+                String v = System.getProperty("jdk.tls.namedGroups");
+                if (!EcAvailable || v == null) {
+                    // we weren't expecting this if no EC providers
+                    throw new RuntimeException("Unexpected Error :" + e);
+                }
+                if (v != null && v.contains("bug")) {
+                    // OK - we were expecting this Error
+                    log("got expected error for bad jdk.tls.namedGroups");
+                    proceed = false;
+                    return;
+                } else {
+                    System.out.println("Unexpected error. " +
+                        "jdk.tls.namedGroups value: " + v);
+                    throw e;
+                }
+            }
+            HandshakeStatus hsStatus = engine.getHandshakeStatus();
+            if (hsStatus == HandshakeStatus.NEED_TASK) {
+                throw new Exception(
+                    "handshake shouldn't need additional tasks");
+            }
+            log("\tnew HandshakeStatus: " + hsStatus);
+        }
+    }
+
+    private static byte[] hexStringToByteArray(String s) {
+        int len = s.length();
+        byte[] data = new byte[len / 2];
+        for (int i = 0; i < len; i += 2) {
+            data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+                + Character.digit(s.charAt(i+1), 16));
+        }
+        return data;
+    }
+
+    private static boolean isEcAvailable() {
+        try {
+            Signature.getInstance("SHA1withECDSA");
+            Signature.getInstance("NONEwithECDSA");
+            KeyAgreement.getInstance("ECDH");
+            KeyFactory.getInstance("EC");
+            KeyPairGenerator.getInstance("EC");
+            AlgorithmParameters.getInstance("EC");
+        } catch (Exception e) {
+            log("EC not available. Received: " + e);
+            return false;
+        }
+        return true;
+    }
+
+    public static void main(String args[]) throws Exception {
+        SSLEngine ssle = createSSLEngine(keyFilename, trustFilename);
+        runTest(ssle);
+        System.out.println("Test Passed.");
+    }
+
+    /*
+     * Create an initialized SSLContext to use for this test.
+     */
+    static private SSLEngine createSSLEngine(String keyFile, String trustFile)
+            throws Exception {
+
+        SSLEngine ssle;
+
+        KeyStore ks = KeyStore.getInstance("JKS");
+        KeyStore ts = KeyStore.getInstance("JKS");
+
+        char[] passphrase = "passphrase".toCharArray();
+
+        ks.load(new FileInputStream(keyFile), passphrase);
+        ts.load(new FileInputStream(trustFile), passphrase);
+
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
+        kmf.init(ks, passphrase);
+
+        TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
+        tmf.init(ts);
+
+        SSLContext sslCtx = SSLContext.getInstance("TLS");
+
+        sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+
+        ssle = sslCtx.createSSLEngine();
+        ssle.setUseClientMode(false);
+
+        return ssle;
+    }
+
+
+    private static void log(String str) {
+        if (debug) {
+            System.out.println(str);
+        }
+    }
+}
diff --git a/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java b/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java
index ba4b00c..212384a 100644
--- a/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java
+++ b/jdk/test/sun/security/ssl/rsa/SignedObjectChain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,9 @@
 /*
  * @test
  * @bug 8050374
- * @compile ../../../../java/security/SignedObject/Chain.java
  * @summary Verify a chain of signed objects
+ * @compile ../../../../java/security/SignedObject/Chain.java
+ * @run main SignedObjectChain
  */
 public class SignedObjectChain {
 
diff --git a/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java b/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java
index 9ba18ac..928bc5a 100644
--- a/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java
+++ b/jdk/test/sun/security/tools/jarsigner/TimestampCheck.java
@@ -43,6 +43,7 @@
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 
+import jdk.test.lib.SecurityTools;
 import jdk.testlibrary.*;
 import jdk.testlibrary.JarUtils;
 import sun.security.pkcs.ContentInfo;
@@ -66,6 +67,7 @@
  *          java.base/sun.security.util
  *          java.base/sun.security.tools.keytool
  * @library /lib/testlibrary
+ * @library /test/lib
  * @run main/timeout=600 TimestampCheck
  */
 public class TimestampCheck {
@@ -456,7 +458,19 @@
                 .shouldMatch("Timestamp signature algorithm: .*key.*weak");
         verify(file, "-J-Djava.security.debug=jar")
                 .shouldHaveExitValue(0)
-                .shouldMatch("SignatureException:.*Disabled");
+                .shouldMatch("SignatureException:.*disabled");
+
+        // For 8171319: keytool should print out warnings when reading or
+        //              generating cert/cert req using weak algorithms.
+        // Must call keytool the command, otherwise doPrintCert() might not
+        // be able to reset "jdk.certpath.disabledAlgorithms".
+        String sout = SecurityTools.keytool("-printcert -jarfile weak.jar")
+                .stderrShouldContain("The TSA certificate uses a 512-bit RSA key" +
+                        " which is considered a security risk.")
+                .getStdout();
+        if (sout.indexOf("weak", sout.indexOf("Timestamp:")) < 0) {
+            throw new RuntimeException("timestamp not weak: " + sout);
+        }
     }
 
     static void checkHalfWeak(String file) throws Throwable {
diff --git a/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java b/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java
index de225b2..cfe2393 100644
--- a/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java
+++ b/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,10 @@
 
 /**
  * @test
- * @bug 8024302 8026037
+ * @bug 8024302 8026037 8176320
  * @summary The test signs and verifies a jar file with -tsacert option
  * @library /lib/testlibrary warnings
+ * @library /test/lib
  * @modules java.base/sun.security.pkcs
  *          java.base/sun.security.timestamp
  *          java.base/sun.security.tools.keytool
diff --git a/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java b/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java
index 0c718db..89d86e9 100644
--- a/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java
+++ b/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 8138766
+ * @key intermittent
  * @summary New default -sigalg for keytool
  * @modules java.base/sun.security.tools.keytool
  * @modules jdk.crypto.ec
diff --git a/jdk/test/sun/security/tools/keytool/WeakAlg.java b/jdk/test/sun/security/tools/keytool/WeakAlg.java
new file mode 100644
index 0000000..bb7ae77
--- /dev/null
+++ b/jdk/test/sun/security/tools/keytool/WeakAlg.java
@@ -0,0 +1,606 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8171319 8177569
+ * @summary keytool should print out warnings when reading or generating
+  *         cert/cert req using weak algorithms
+ * @library /test/lib
+ * @modules java.base/sun.security.tools.keytool
+ *          java.base/sun.security.tools
+ *          java.base/sun.security.util
+ * @run main/othervm/timeout=600 -Duser.language=en -Duser.country=US WeakAlg
+ */
+
+import jdk.test.lib.SecurityTools;
+import jdk.test.lib.process.OutputAnalyzer;
+import sun.security.tools.KeyStoreUtil;
+import sun.security.util.DisabledAlgorithmConstraints;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.security.CryptoPrimitive;
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class WeakAlg {
+
+    public static void main(String[] args) throws Throwable {
+
+        rm("ks");
+
+        // -genkeypair, and -printcert, -list -alias, -exportcert
+        // (w/ different formats)
+        checkGenKeyPair("a", "-keyalg RSA -sigalg MD5withRSA", "MD5withRSA");
+        checkGenKeyPair("b", "-keyalg RSA -keysize 512", "512-bit RSA key");
+        checkGenKeyPair("c", "-keyalg RSA", null);
+
+        kt("-list")
+                .shouldContain("Warning:")
+                .shouldMatch("<a>.*MD5withRSA.*risk")
+                .shouldMatch("<b>.*512-bit RSA key.*risk");
+        kt("-list -v")
+                .shouldContain("Warning:")
+                .shouldMatch("<a>.*MD5withRSA.*risk")
+                .shouldContain("MD5withRSA (weak)")
+                .shouldMatch("<b>.*512-bit RSA key.*risk")
+                .shouldContain("512-bit RSA key (weak)");
+
+        // Multiple warnings for multiple cert in -printcert
+        // or -list or -exportcert
+
+        // -certreq, -printcertreq, -gencert
+        checkCertReq("a", "", null);
+        gencert("c-a", "")
+                .shouldNotContain("Warning"); // new sigalg is not weak
+        gencert("c-a", "-sigalg MD2withRSA")
+                .shouldContain("Warning:")
+                .shouldMatch("The generated certificate.*MD2withRSA.*risk");
+
+        checkCertReq("a", "-sigalg MD5withRSA", "MD5withRSA");
+        gencert("c-a", "")
+                .shouldContain("Warning:")
+                .shouldMatch("The certificate request.*MD5withRSA.*risk");
+        gencert("c-a", "-sigalg MD2withRSA")
+                .shouldContain("Warning:")
+                .shouldMatch("The certificate request.*MD5withRSA.*risk")
+                .shouldMatch("The generated certificate.*MD2withRSA.*risk");
+
+        checkCertReq("b", "", "512-bit RSA key");
+        gencert("c-b", "")
+                .shouldContain("Warning:")
+                .shouldMatch("The certificate request.*512-bit RSA key.*risk")
+                .shouldMatch("The generated certificate.*512-bit RSA key.*risk");
+
+        checkCertReq("c", "", null);
+        gencert("a-c", "")
+                .shouldContain("Warning:")
+                .shouldMatch("The issuer.*MD5withRSA.*risk");
+
+        // but the new cert is not weak
+        kt("-printcert -file a-c.cert")
+                .shouldNotContain("Warning")
+                .shouldNotContain("weak");
+
+        gencert("b-c", "")
+                .shouldContain("Warning:")
+                .shouldMatch("The issuer.*512-bit RSA key.*risk");
+
+        // -importcert
+        checkImport();
+
+        // -importkeystore
+        checkImportKeyStore();
+
+        // -gencrl, -printcrl
+
+        checkGenCRL("a", "", null);
+        checkGenCRL("a", "-sigalg MD5withRSA", "MD5withRSA");
+        checkGenCRL("b", "", "512-bit RSA key");
+        checkGenCRL("c", "", null);
+
+        kt("-delete -alias b");
+        kt("-printcrl -file b.crl")
+                .shouldContain("WARNING: not verified");
+    }
+
+    static void checkImportKeyStore() throws Exception {
+
+        saveStore();
+
+        rm("ks");
+        kt("-importkeystore -srckeystore ks2 -srcstorepass changeit")
+                .shouldContain("3 entries successfully imported")
+                .shouldContain("Warning")
+                .shouldMatch("<b>.*512-bit RSA key.*risk")
+                .shouldMatch("<a>.*MD5withRSA.*risk");
+
+        rm("ks");
+        kt("-importkeystore -srckeystore ks2 -srcstorepass changeit -srcalias a")
+                .shouldContain("Warning")
+                .shouldMatch("<a>.*MD5withRSA.*risk");
+
+        reStore();
+    }
+
+    static void checkImport() throws Exception {
+
+        saveStore();
+
+        // add trusted cert
+
+        // cert already in
+        kt("-importcert -alias d -file a.cert", "no")
+                .shouldContain("Certificate already exists in keystore")
+                .shouldContain("Warning")
+                .shouldMatch("The input.*MD5withRSA.*risk")
+                .shouldContain("Do you still want to add it?");
+        kt("-importcert -alias d -file a.cert -noprompt")
+                .shouldContain("Warning")
+                .shouldMatch("The input.*MD5withRSA.*risk")
+                .shouldNotContain("[no]");
+
+        // cert is self-signed
+        kt("-delete -alias a");
+        kt("-delete -alias d");
+        kt("-importcert -alias d -file a.cert", "no")
+                .shouldContain("Warning")
+                .shouldContain("MD5withRSA (weak)")
+                .shouldMatch("The input.*MD5withRSA.*risk")
+                .shouldContain("Trust this certificate?");
+        kt("-importcert -alias d -file a.cert -noprompt")
+                .shouldContain("Warning")
+                .shouldMatch("The input.*MD5withRSA.*risk")
+                .shouldNotContain("[no]");
+
+        // JDK-8177569: no warning for sigalg of trusted cert
+        String weakSigAlgCA = null;
+        KeyStore ks = KeyStoreUtil.getCacertsKeyStore();
+        if (ks != null) {
+            DisabledAlgorithmConstraints disabledCheck =
+                    new DisabledAlgorithmConstraints(
+                            DisabledAlgorithmConstraints.PROPERTY_CERTPATH_DISABLED_ALGS);
+            Set<CryptoPrimitive> sigPrimitiveSet = Collections
+                    .unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE));
+
+            for (String s : Collections.list(ks.aliases())) {
+                if (ks.isCertificateEntry(s)) {
+                    X509Certificate c = (X509Certificate)ks.getCertificate(s);
+                    String sigAlg = c.getSigAlgName();
+                    if (!disabledCheck.permits(sigPrimitiveSet, sigAlg, null)) {
+                        weakSigAlgCA = sigAlg;
+                        Files.write(Paths.get("ca.cert"),
+                                ks.getCertificate(s).getEncoded());
+                        break;
+                    }
+                }
+            }
+        }
+        if (weakSigAlgCA != null) {
+            // The following 2 commands still have a warning on why not using
+            // the -cacerts option directly.
+            kt("-list -keystore " + KeyStoreUtil.getCacerts())
+                    .shouldNotContain("risk");
+            kt("-list -v -keystore " + KeyStoreUtil.getCacerts())
+                    .shouldNotContain("risk");
+
+            // -printcert will always show warnings
+            kt("-printcert -file ca.cert")
+                    .shouldContain("name: " + weakSigAlgCA + " (weak)")
+                    .shouldContain("Warning")
+                    .shouldMatch("The certificate.*" + weakSigAlgCA + ".*risk");
+            kt("-printcert -file ca.cert -trustcacerts") // -trustcacerts useless
+                    .shouldContain("name: " + weakSigAlgCA + " (weak)")
+                    .shouldContain("Warning")
+                    .shouldMatch("The certificate.*" + weakSigAlgCA + ".*risk");
+
+            // Importing with -trustcacerts ignore CA cert's sig alg
+            kt("-delete -alias d");
+            kt("-importcert -alias d -trustcacerts -file ca.cert", "no")
+                    .shouldContain("Certificate already exists in system-wide CA")
+                    .shouldNotContain("risk")
+                    .shouldContain("Do you still want to add it to your own keystore?");
+            kt("-importcert -alias d -trustcacerts -file ca.cert -noprompt")
+                    .shouldNotContain("risk")
+                    .shouldNotContain("[no]");
+
+            // but not without -trustcacerts
+            kt("-delete -alias d");
+            kt("-importcert -alias d -file ca.cert", "no")
+                    .shouldContain("name: " + weakSigAlgCA + " (weak)")
+                    .shouldContain("Warning")
+                    .shouldMatch("The input.*" + weakSigAlgCA + ".*risk")
+                    .shouldContain("Trust this certificate?");
+            kt("-importcert -alias d -file ca.cert -noprompt")
+                    .shouldContain("Warning")
+                    .shouldMatch("The input.*" + weakSigAlgCA + ".*risk")
+                    .shouldNotContain("[no]");
+        }
+
+        // a non self-signed weak cert
+        reStore();
+        certreq("b", "");
+        gencert("c-b", "");
+        kt("-importcert -alias d -file c-b.cert")   // weak only, no prompt
+                .shouldContain("Warning")
+                .shouldNotContain("512-bit RSA key (weak)")
+                .shouldMatch("The input.*512-bit RSA key.*risk")
+                .shouldNotContain("[no]");
+
+        kt("-delete -alias b");
+        kt("-delete -alias c");
+        kt("-delete -alias d");
+
+        kt("-importcert -alias d -file c-b.cert", "no") // weak and not trusted
+                .shouldContain("Warning")
+                .shouldContain("512-bit RSA key (weak)")
+                .shouldMatch("The input.*512-bit RSA key.*risk")
+                .shouldContain("Trust this certificate?");
+        kt("-importcert -alias d -file c-b.cert -noprompt")
+                .shouldContain("Warning")
+                .shouldMatch("The input.*512-bit RSA key.*risk")
+                .shouldNotContain("[no]");
+
+        // a non self-signed strong cert
+        reStore();
+        certreq("a", "");
+        gencert("c-a", "");
+        kt("-importcert -alias d -file c-a.cert") // trusted
+                .shouldNotContain("Warning")
+                .shouldNotContain("[no]");
+
+        kt("-delete -alias a");
+        kt("-delete -alias c");
+        kt("-delete -alias d");
+
+        kt("-importcert -alias d -file c-a.cert", "no") // not trusted
+                .shouldNotContain("Warning")
+                .shouldContain("Trust this certificate?");
+        kt("-importcert -alias d -file c-a.cert -noprompt")
+                .shouldNotContain("Warning")
+                .shouldNotContain("[no]");
+
+        // install reply
+
+        reStore();
+        certreq("c", "");
+        gencert("a-c", "");
+        kt("-importcert -alias c -file a-c.cert")
+                .shouldContain("Warning")
+                .shouldMatch("Issuer <a>.*MD5withRSA.*risk");
+
+        // JDK-8177569: no warning for sigalg of trusted cert
+        reStore();
+        // Change a into a TrustedCertEntry
+        kt("-exportcert -alias a -file a.cert");
+        kt("-delete -alias a");
+        kt("-importcert -alias a -file a.cert -noprompt");
+        kt("-list -alias a -v")
+                .shouldNotContain("weak")
+                .shouldNotContain("Warning");
+        // This time a is trusted and no warning on its weak sig alg
+        kt("-importcert -alias c -file a-c.cert")
+                .shouldNotContain("Warning");
+
+        reStore();
+
+        gencert("a-b", "");
+        gencert("b-c", "");
+
+        // Full chain with root
+        cat("a-a-b-c.cert", "b-c.cert", "a-b.cert", "a.cert");
+        kt("-importcert -alias c -file a-a-b-c.cert")   // only weak
+                .shouldContain("Warning")
+                .shouldMatch("Reply #2 of 3.*512-bit RSA key.*risk")
+                .shouldMatch("Reply #3 of 3.*MD5withRSA.*risk")
+                .shouldNotContain("[no]");
+
+        // Without root
+        cat("a-b-c.cert", "b-c.cert", "a-b.cert");
+        kt("-importcert -alias c -file a-b-c.cert")     // only weak
+                .shouldContain("Warning")
+                .shouldMatch("Reply #2 of 2.*512-bit RSA key.*risk")
+                .shouldMatch("Issuer <a>.*MD5withRSA.*risk")
+                .shouldNotContain("[no]");
+
+        reStore();
+        gencert("b-a", "");
+
+        kt("-importcert -alias a -file b-a.cert")
+                .shouldContain("Warning")
+                .shouldMatch("Issuer <b>.*512-bit RSA key.*risk")
+                .shouldNotContain("[no]");
+
+        kt("-importcert -alias a -file c-a.cert")
+                .shouldNotContain("Warning");
+
+        kt("-importcert -alias b -file c-b.cert")
+                .shouldContain("Warning")
+                .shouldMatch("The input.*512-bit RSA key.*risk")
+                .shouldNotContain("[no]");
+
+        reStore();
+        gencert("b-a", "");
+
+        cat("c-b-a.cert", "b-a.cert", "c-b.cert");
+
+        kt("-printcert -file c-b-a.cert")
+                .shouldContain("Warning")
+                .shouldMatch("The certificate #2 of 2.*512-bit RSA key.*risk");
+
+        kt("-delete -alias b");
+
+        kt("-importcert -alias a -file c-b-a.cert")
+                .shouldContain("Warning")
+                .shouldMatch("Reply #2 of 2.*512-bit RSA key.*risk")
+                .shouldNotContain("[no]");
+
+        kt("-delete -alias c");
+        kt("-importcert -alias a -file c-b-a.cert", "no")
+                .shouldContain("Top-level certificate in reply:")
+                .shouldContain("512-bit RSA key (weak)")
+                .shouldContain("Warning")
+                .shouldMatch("Reply #2 of 2.*512-bit RSA key.*risk")
+                .shouldContain("Install reply anyway?");
+        kt("-importcert -alias a -file c-b-a.cert -noprompt")
+                .shouldContain("Warning")
+                .shouldMatch("Reply #2 of 2.*512-bit RSA key.*risk")
+                .shouldNotContain("[no]");
+
+        reStore();
+    }
+
+    private static void cat(String dest, String... src) throws IOException {
+        System.out.println("---------------------------------------------");
+        System.out.printf("$ cat ");
+
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        for (String s : src) {
+            System.out.printf(s + " ");
+            bout.write(Files.readAllBytes(Paths.get(s)));
+        }
+        Files.write(Paths.get(dest), bout.toByteArray());
+        System.out.println("> " + dest);
+    }
+
+    static void checkGenCRL(String alias, String options, String bad) {
+
+        OutputAnalyzer oa = kt("-gencrl -alias " + alias
+                + " -id 1 -file " + alias + ".crl " + options);
+        if (bad == null) {
+            oa.shouldNotContain("Warning");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldMatch("The generated CRL.*" + bad + ".*risk");
+        }
+
+        oa = kt("-printcrl -file " + alias + ".crl");
+        if (bad == null) {
+            oa.shouldNotContain("Warning")
+                    .shouldContain("Verified by " + alias + " in keystore")
+                    .shouldNotContain("(weak");
+        } else {
+            oa.shouldContain("Warning:")
+                    .shouldMatch("The CRL.*" + bad + ".*risk")
+                    .shouldContain("Verified by " + alias + " in keystore")
+                    .shouldContain(bad + " (weak)");
+        }
+    }
+
+    static void checkCertReq(
+            String alias, String options, String bad) {
+
+        OutputAnalyzer oa = certreq(alias, options);
+        if (bad == null) {
+            oa.shouldNotContain("Warning");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldMatch("The generated certificate request.*" + bad + ".*risk");
+        }
+
+        oa = kt("-printcertreq -file " + alias + ".req");
+        if (bad == null) {
+            oa.shouldNotContain("Warning")
+                    .shouldNotContain("(weak)");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldMatch("The certificate request.*" + bad + ".*risk")
+                    .shouldContain(bad + " (weak)");
+        }
+    }
+
+    static void checkGenKeyPair(
+            String alias, String options, String bad) {
+
+        OutputAnalyzer oa = genkeypair(alias, options);
+        if (bad == null) {
+            oa.shouldNotContain("Warning");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldMatch("The generated certificate.*" + bad + ".*risk");
+        }
+
+        oa = kt("-exportcert -alias " + alias + " -file " + alias + ".cert");
+        if (bad == null) {
+            oa.shouldNotContain("Warning");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldMatch("The certificate.*" + bad + ".*risk");
+        }
+
+        oa = kt("-exportcert -rfc -alias " + alias + " -file " + alias + ".cert");
+        if (bad == null) {
+            oa.shouldNotContain("Warning");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldMatch("The certificate.*" + bad + ".*risk");
+        }
+
+        oa = kt("-printcert -rfc -file " + alias + ".cert");
+        if (bad == null) {
+            oa.shouldNotContain("Warning");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldMatch("The certificate.*" + bad + ".*risk");
+        }
+
+        oa = kt("-list -alias " + alias);
+        if (bad == null) {
+            oa.shouldNotContain("Warning");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldMatch("The certificate.*" + bad + ".*risk");
+        }
+
+        // With cert content
+
+        oa = kt("-printcert -file " + alias + ".cert");
+        if (bad == null) {
+            oa.shouldNotContain("Warning");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldContain(bad + " (weak)")
+                    .shouldMatch("The certificate.*" + bad + ".*risk");
+        }
+
+        oa = kt("-list -v -alias " + alias);
+        if (bad == null) {
+            oa.shouldNotContain("Warning");
+        } else {
+            oa.shouldContain("Warning")
+                    .shouldContain(bad + " (weak)")
+                    .shouldMatch("The certificate.*" + bad + ".*risk");
+        }
+    }
+
+    // This is slow, but real keytool process is launched.
+    static OutputAnalyzer kt1(String cmd, String... input) {
+        cmd = "-keystore ks -storepass changeit " +
+                "-keypass changeit " + cmd;
+        System.out.println("---------------------------------------------");
+        try {
+            SecurityTools.setResponse(input);
+            return SecurityTools.keytool(cmd);
+        } catch (Throwable e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    // Fast keytool execution by directly calling its main() method
+    static OutputAnalyzer kt(String cmd, String... input) {
+        PrintStream out = System.out;
+        PrintStream err = System.err;
+        InputStream ins = System.in;
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        ByteArrayOutputStream berr = new ByteArrayOutputStream();
+        boolean succeed = true;
+        try {
+            cmd = "-keystore ks -storepass changeit " +
+                    "-keypass changeit " + cmd;
+            System.out.println("---------------------------------------------");
+            System.out.println("$ keytool " + cmd);
+            System.out.println();
+            String feed = "";
+            if (input.length > 0) {
+                feed = Stream.of(input).collect(Collectors.joining("\n")) + "\n";
+            }
+            System.setIn(new ByteArrayInputStream(feed.getBytes()));
+            System.setOut(new PrintStream(bout));
+            System.setErr(new PrintStream(berr));
+            sun.security.tools.keytool.Main.main(
+                    cmd.trim().split("\\s+"));
+        } catch (Exception e) {
+            // Might be a normal exception when -debug is on or
+            // SecurityException (thrown by jtreg) when System.exit() is called
+            if (!(e instanceof SecurityException)) {
+                e.printStackTrace();
+            }
+            succeed = false;
+        } finally {
+            System.setOut(out);
+            System.setErr(err);
+            System.setIn(ins);
+        }
+        String sout = new String(bout.toByteArray());
+        String serr = new String(berr.toByteArray());
+        System.out.println("STDOUT:\n" + sout + "\nSTDERR:\n" + serr);
+        if (!succeed) {
+            throw new RuntimeException();
+        }
+        return new OutputAnalyzer(sout, serr);
+    }
+
+    static OutputAnalyzer genkeypair(String alias, String options) {
+        return kt("-genkeypair -alias " + alias + " -dname CN=" + alias
+                + " -keyalg RSA -storetype JKS " + options);
+    }
+
+    static OutputAnalyzer certreq(String alias, String options) {
+        return kt("-certreq -alias " + alias
+                + " -file " + alias + ".req " + options);
+    }
+
+    static OutputAnalyzer exportcert(String alias) {
+        return kt("-exportcert -alias " + alias + " -file " + alias + ".cert");
+    }
+
+    static OutputAnalyzer gencert(String relation, String options) {
+        int pos = relation.indexOf("-");
+        String issuer = relation.substring(0, pos);
+        String subject = relation.substring(pos + 1);
+        return kt(" -gencert -alias " + issuer + " -infile " + subject
+                + ".req -outfile " + relation + ".cert " + options);
+    }
+
+    static void saveStore() throws IOException {
+        System.out.println("---------------------------------------------");
+        System.out.println("$ cp ks ks2");
+        Files.copy(Paths.get("ks"), Paths.get("ks2"),
+                StandardCopyOption.REPLACE_EXISTING);
+    }
+
+    static void reStore() throws IOException {
+        System.out.println("---------------------------------------------");
+        System.out.println("$ cp ks2 ks");
+        Files.copy(Paths.get("ks2"), Paths.get("ks"),
+                StandardCopyOption.REPLACE_EXISTING);
+    }
+
+    static void rm(String s) throws IOException {
+        System.out.println("---------------------------------------------");
+        System.out.println("$ rm " + s);
+        Files.deleteIfExists(Paths.get(s));
+    }
+}
diff --git a/jdk/test/sun/security/util/FilePermCompat/CompatImpact.java b/jdk/test/sun/security/util/FilePermCompat/CompatImpact.java
index 7b2db04..3ead581 100644
--- a/jdk/test/sun/security/util/FilePermCompat/CompatImpact.java
+++ b/jdk/test/sun/security/util/FilePermCompat/CompatImpact.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,14 @@
 
 /*
  * @test
- * @bug 8164705
+ * @bug 8164705 8168410
  * @summary check compatibility after FilePermission change
  * @library /java/security/testlibrary/
  * @modules java.base/jdk.internal.misc
  * @run main CompatImpact prepare
  * @run main CompatImpact builtin
- * @run main CompatImpact mine
+ * @run main/othervm -Djdk.security.filePermCompat=true CompatImpact mine
+ * @run main/fail CompatImpact mine
  * @run main CompatImpact dopriv
  */
 
@@ -72,7 +73,8 @@
                 Files.copy(Paths.get(cp, "CompatImpact$DoPrivInner.class"),
                         Paths.get("inner", "CompatImpact$DoPrivInner.class"));
                 break;
-            // run tests with different policy impls
+            // default policy always covered, user-defined depends on
+            // system property jdk.security.filePermCompact.
             case "builtin":
             case "mine":
                 cp = System.getProperty("test.classes");
@@ -222,7 +224,8 @@
     // Return a Proc object for different policy types
     private static Proc p(String type, String f) throws Exception {
         Proc p = Proc.create("CompatImpact")
-                .prop("java.security.manager", "");
+                .prop("java.security.manager", "")
+                .inheritProp("jdk.security.filePermCompat");
         p.args("test", type);
         switch (type) {
             case "builtin":
diff --git a/jdk/test/sun/security/util/FilePermCompat/Flag.java b/jdk/test/sun/security/util/FilePermCompat/Flag.java
index 30c97e2..dab4cff 100644
--- a/jdk/test/sun/security/util/FilePermCompat/Flag.java
+++ b/jdk/test/sun/security/util/FilePermCompat/Flag.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,16 @@
  * @test
  * @bug 8164705
  * @summary check jdk.filepermission.canonicalize
- * @library /java/security/testlibrary/
- * @modules java.base/jdk.internal.misc
- * @run main/othervm -Djdk.io.permissionsUseCanonicalPath=true Flag truetrue
- * @run main/othervm -Djdk.io.permissionsUseCanonicalPath=false Flag falsetrue
- * @run main/othervm Flag falsetrue
+ * @run main/othervm/policy=flag.policy
+  *     -Djdk.io.permissionsUseCanonicalPath=true Flag true true
+ * @run main/othervm/policy=flag.policy
+  *     -Djdk.io.permissionsUseCanonicalPath=false Flag false true
+ * @run main/othervm/policy=flag.policy Flag false true
  */
 
 import java.io.File;
 import java.io.FilePermission;
 import java.lang.*;
-import java.security.Permission;
-import java.security.Policy;
-import java.security.ProtectionDomain;
 
 public class Flag {
     public static void main(String[] args) throws Exception {
@@ -51,15 +48,6 @@
         FilePermission fp2 = new FilePermission(abs.toString(), "read");
         test1 = fp1.equals(fp2);
 
-        Policy pol = new Policy() {
-            @java.lang.Override
-            public boolean implies(ProtectionDomain domain, Permission permission) {
-                return fp1.implies(permission);
-            }
-        };
-
-        Policy.setPolicy(pol);
-        System.setSecurityManager(new SecurityManager());
         try {
             System.getSecurityManager().checkPermission(fp2);
             test2 = true;
@@ -67,8 +55,9 @@
             test2 = false;
         }
 
-        if (!args[0].equals(test1 + "" + test2)) {
-            throw new Exception("Test failed: " + test1 + test2);
+        if (test1 != Boolean.parseBoolean(args[0]) ||
+                test2 != Boolean.parseBoolean(args[1])) {
+            throw new Exception("Test failed: " + test1 + " " + test2);
         }
     }
 }
diff --git a/jdk/test/sun/security/util/FilePermCompat/flag.policy b/jdk/test/sun/security/util/FilePermCompat/flag.policy
new file mode 100644
index 0000000..70e052a
--- /dev/null
+++ b/jdk/test/sun/security/util/FilePermCompat/flag.policy
@@ -0,0 +1,4 @@
+grant {
+    permission java.io.FilePermission "x", "read";
+    permission java.util.PropertyPermission "user.dir", "read";
+};
diff --git a/jdk/test/sun/text/IntHashtable/Bug4170614Test.sh b/jdk/test/sun/text/IntHashtable/Bug4170614Test.sh
index 0c31934..e70f490 100644
--- a/jdk/test/sun/text/IntHashtable/Bug4170614Test.sh
+++ b/jdk/test/sun/text/IntHashtable/Bug4170614Test.sh
@@ -60,8 +60,8 @@
 TEST_JAVABASE=${TESTCLASSES}/java.base
 mkdir -p ${TEST_JAVABASE}
 ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
-    -Xmodule:java.base \
-    -d ${TEST_JAVABASE} Bug4170614Test.java
+    --patch-module java.base=patch-src \
+    -d ${TEST_JAVABASE} patch-src/java/text/Bug4170614Test.java
 
 ${TESTJAVA}/bin/java ${TESTVMOPTS} --patch-module java.base=${TEST_JAVABASE} java.text.Bug4170614Test
 
diff --git a/jdk/test/sun/text/IntHashtable/Bug4170614Test.java b/jdk/test/sun/text/IntHashtable/patch-src/java/text/Bug4170614Test.java
similarity index 100%
rename from jdk/test/sun/text/IntHashtable/Bug4170614Test.java
rename to jdk/test/sun/text/IntHashtable/patch-src/java/text/Bug4170614Test.java
diff --git a/jdk/test/sun/tools/jcmd/TEST.properties b/jdk/test/sun/tools/jcmd/TEST.properties
new file mode 100644
index 0000000..0bd03a7
--- /dev/null
+++ b/jdk/test/sun/tools/jcmd/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java b/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java
index 36481d6..22da2ff 100644
--- a/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java
+++ b/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java
@@ -34,15 +34,14 @@
 import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.Utils;
 
-/**
- * Unit test for jcmd utility. Tests jcmd options which do not send
- * requests to a specific JVM process.
- */
 /*
  * @test
  * @bug 7104647
+ * @summary Unit test for jcmd utility. Tests jcmd options which do not send
+ * requests to a specific JVM process.
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @build jdk.testlibrary.*
  * @run main TestJcmdDefaults
  */
diff --git a/jdk/test/sun/tools/jcmd/TestJcmdSanity.java b/jdk/test/sun/tools/jcmd/TestJcmdSanity.java
index c36c9e8..9a21404 100644
--- a/jdk/test/sun/tools/jcmd/TestJcmdSanity.java
+++ b/jdk/test/sun/tools/jcmd/TestJcmdSanity.java
@@ -35,15 +35,14 @@
 import jdk.testlibrary.ProcessTools;
 import jdk.testlibrary.Utils;
 
-/**
- * Unit test for jcmd utility. The test will send different diagnostic command
- * requests to the current java process.
- */
 /*
  * @test
  * @bug 7104647 7154822
+ * @summary Unit test for jcmd utility. The test will send different diagnostic
+ * command requests to the current java process.
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @build jdk.testlibrary.*
  * @run main/othervm -XX:+UsePerfData TestJcmdSanity
  */
diff --git a/jdk/test/sun/tools/jconsole/ResourceCheckTest.java b/jdk/test/sun/tools/jconsole/ResourceCheckTest.java
index 6d91b5b..a678a47 100644
--- a/jdk/test/sun/tools/jconsole/ResourceCheckTest.java
+++ b/jdk/test/sun/tools/jconsole/ResourceCheckTest.java
@@ -22,18 +22,18 @@
  */
 
 /**
+ * @test
+ * @bug 5008856 5023573 5024917 5062569 7172176
+ * @summary 'missing resource key' error for key = "Operating system"
  *
- *  @test
- *  @bug 5008856 5023573 5024917 5062569 7172176
- *  @summary 'missing resource key' error for key = "Operating system"
- *  @modules jdk.jconsole/sun.tools.jconsole
- *           jdk.jconsole/sun.tools.jconsole.resources:open
- *  @run main ResourceCheckTest
+ * @modules jdk.jconsole/sun.tools.jconsole
+ *          jdk.jconsole/sun.tools.jconsole.resources:open
+ *
+ * @run main ResourceCheckTest
  */
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
diff --git a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java
index 9285044..6191cae 100644
--- a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java
+++ b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,6 @@
 
             try (OutputStream out = toolProcess.getOutputStream()) {
                 out.write("universe\n".getBytes());
-                out.write("printmdo -a\n".getBytes());
                 out.write("quit\n".getBytes());
             }
 
@@ -94,13 +93,6 @@
             try (BufferedReader reader =
                  new BufferedReader(new InputStreamReader(toolProcess.getInputStream()))) {
                 String line;
-                String unexpectedMsg =
-                   "One or more of 'VirtualCallData', 'CounterData', " +
-                   "'ReceiverTypeData', 'bci', 'MethodData' "  +
-                   "or 'java/lang/Object' not found";
-                boolean knownClassFound = false;
-                boolean knownProfileDataTypeFound = false;
-                boolean knownTokensFound = false;
 
                 while ((line = reader.readLine()) != null) {
                     line = line.trim();
@@ -110,27 +102,6 @@
                         unexpected = new RuntimeException("CollectedHeap type should be known.");
                         break;
                     }
-                    else if (line.contains("missing reason for ")) {
-                        unexpected = new RuntimeException("missing reason for ");
-                        break;
-                    }
-                    if (line.contains("VirtualCallData")  ||
-                        line.contains("CounterData")      ||
-                        line.contains("ReceiverTypeData")) {
-                        knownProfileDataTypeFound = true;
-                    }
-                    if (line.contains("bci") ||
-                        line.contains("MethodData")) {
-                        knownTokensFound = true;
-                    }
-                    if (line.contains("java/lang/Object")) {
-                        knownClassFound = true;
-                    }
-                }
-                if ((knownClassFound           == false)  ||
-                    (knownTokensFound          == false)  ||
-                    (knownProfileDataTypeFound == false)) {
-                    unexpected = new RuntimeException(unexpectedMsg);
                 }
             }
 
@@ -144,9 +115,6 @@
                 throw unexpected;
             }
 
-            if (unexpected != null) {
-                throw unexpected;
-            }
         } catch (Exception ex) {
             throw new RuntimeException("Test ERROR " + ex, ex);
         } finally {
diff --git a/jdk/test/sun/tools/jhsdb/TEST.properties b/jdk/test/sun/tools/jhsdb/TEST.properties
new file mode 100644
index 0000000..7b91d85
--- /dev/null
+++ b/jdk/test/sun/tools/jhsdb/TEST.properties
@@ -0,0 +1,3 @@
+modules = jdk.hotspot.agent \
+          java.management
+
diff --git a/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java b/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java
index 75437fa..9e5a1f1 100644
--- a/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java
+++ b/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java
@@ -36,11 +36,12 @@
  * @test
  * @bug 8042397
  * @summary Unit test for jmap utility test heap configuration reader
- * @modules jdk.hotspot.agent/sun.jvm.hotspot
+ *
  * @library /test/lib
  * @library /lib/testlibrary
- * @build jdk.testlibrary.*
- * @build jdk.test.lib.apps.*
+ * @modules java.management
+ *          jdk.hotspot.agent/sun.jvm.hotspot
+ *
  * @build JMapHeapConfigTest TmtoolTestScenario
  * @run main JMapHeapConfigTest
  */
diff --git a/jdk/test/sun/tools/jinfo/JInfoTest.java b/jdk/test/sun/tools/jinfo/JInfoTest.java
index 720874b..a7b6bc3 100644
--- a/jdk/test/sun/tools/jinfo/JInfoTest.java
+++ b/jdk/test/sun/tools/jinfo/JInfoTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,11 +36,12 @@
 /*
  * @test
  * @summary Unit test for jinfo utility
- * @modules java.base/jdk.internal.misc
+ *
  * @library /test/lib
- * @build jdk.test.lib.*
- * @build jdk.test.lib.apps.*
- * @build jdk.test.lib.process.*
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ *          jdk.jcmd
+ *
  * @run main JInfoTest
  */
 public class JInfoTest {
@@ -88,8 +89,8 @@
             LingeredApp.startApp(params, app2);
             OutputAnalyzer output = jinfo("JInfoTestLingeredApp");
             output.shouldHaveExitValue(0);
-            // "HotSpot(TM)" written once per proc
-            documentMatch(output.getStdout(), ".*HotSpot\\(TM\\).*HotSpot\\(TM\\).*");
+            // "Runtime Environment" written once per proc
+            documentMatch(output.getStdout(), ".*Runtime Environment.*Runtime Environment.*");
         } finally {
             JInfoTestLingeredApp.stopApp(app1);
             JInfoTestLingeredApp.stopApp(app2);
diff --git a/jdk/test/sun/tools/jinfo/TEST.properties b/jdk/test/sun/tools/jinfo/TEST.properties
new file mode 100644
index 0000000..0bd03a7
--- /dev/null
+++ b/jdk/test/sun/tools/jinfo/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jmap/TEST.properties b/jdk/test/sun/tools/jmap/TEST.properties
new file mode 100644
index 0000000..0bd03a7
--- /dev/null
+++ b/jdk/test/sun/tools/jmap/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jps/LingeredApp.java b/jdk/test/sun/tools/jps/LingeredApp.java
index b4aab24..0de7945 100644
--- a/jdk/test/sun/tools/jps/LingeredApp.java
+++ b/jdk/test/sun/tools/jps/LingeredApp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,7 +141,7 @@
         if (appProcess == null) {
             throw new RuntimeException("Process is not alive");
         }
-        return appProcess.getPid();
+        return appProcess.pid();
     }
 
     /**
diff --git a/jdk/test/sun/tools/jstack/TEST.properties b/jdk/test/sun/tools/jstack/TEST.properties
new file mode 100644
index 0000000..0bd03a7
--- /dev/null
+++ b/jdk/test/sun/tools/jstack/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jstat/JStatInterval.java b/jdk/test/sun/tools/jstat/JStatInterval.java
index 3b29136..e3e017e 100644
--- a/jdk/test/sun/tools/jstat/JStatInterval.java
+++ b/jdk/test/sun/tools/jstat/JStatInterval.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,11 +36,8 @@
 import jdk.testlibrary.ProcessTools;
 import jdk.testlibrary.JDKToolLauncher;
 
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
 
 public class JStatInterval {
     private static final String READY = "READY";
@@ -88,7 +85,7 @@
             throw new Error("Unable to start the monitored application.");
         }
 
-        String pidStr = String.valueOf(app.getPid());
+        String pidStr = String.valueOf(app.pid());
         JDKToolLauncher l = JDKToolLauncher.createUsingTestJDK("jstat");
         l.addToolArg("-compiler");
         l.addToolArg(pidStr);
diff --git a/jdk/test/sun/tools/jstat/TEST.properties b/jdk/test/sun/tools/jstat/TEST.properties
new file mode 100644
index 0000000..0bd03a7
--- /dev/null
+++ b/jdk/test/sun/tools/jstat/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jstatd/TEST.properties b/jdk/test/sun/tools/jstatd/TEST.properties
new file mode 100644
index 0000000..4741e99
--- /dev/null
+++ b/jdk/test/sun/tools/jstatd/TEST.properties
@@ -0,0 +1,5 @@
+modules = java.management \
+          java.rmi
+          jdk.jcmd \
+          jdk.jstatd
+
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java
index 1b0011b..9cecd9c 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java
@@ -25,8 +25,9 @@
  * @test
  * @bug 4990825
  * @key intermittent
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdDefaults
  */
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java
index 9c9b564..bed7045 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java
@@ -25,8 +25,9 @@
  * @test
  * @bug 4990825 7092186
  * @key intermittent
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdExternalRegistry
  */
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdPort.java b/jdk/test/sun/tools/jstatd/TestJstatdPort.java
index 8443b3e..393def6 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdPort.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdPort.java
@@ -25,8 +25,9 @@
  * @test
  * @bug 4990825
  * @key intermittent
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdPort
  */
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java
index 9cce98a..c2d6faf 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java
@@ -25,8 +25,9 @@
  * @test
  * @bug 4990825
  * @key intermittent
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdPortAndServer
  */
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdServer.java b/jdk/test/sun/tools/jstatd/TestJstatdServer.java
index 565f799..8d440d2 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdServer.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdServer.java
@@ -25,8 +25,9 @@
  * @test
  * @bug 4990825
  * @key intermittent
+ *
  * @library /lib/testlibrary
- * @modules java.management
+ *
  * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
  * @run main/timeout=60 TestJstatdServer
  */
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/VERSION b/jdk/test/sun/util/calendar/zi/tzdata/VERSION
index 016d94c..eb5b459 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/VERSION
+++ b/jdk/test/sun/util/calendar/zi/tzdata/VERSION
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2016j
+tzdata2017b
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/africa b/jdk/test/sun/util/calendar/zi/tzdata/africa
index 67918af..d3de96d 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/africa
+++ b/jdk/test/sun/util/calendar/zi/tzdata/africa
@@ -29,15 +29,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2017-02-20):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -54,39 +54,33 @@
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
 #
+# European-style abbreviations are commonly used along the Mediterranean.
+# For sub-Saharan Africa abbreviations were less standardized.
 # Previous editions of this database used WAT, CAT, SAT, and EAT
-# for +0:00 through +3:00, respectively,
-# but Mark R V Murray reports that
-# 'SAST' is the official abbreviation for +2:00 in the country of South Africa,
-# 'CAT' is commonly used for +2:00 in countries north of South Africa, and
-# 'WAT' is probably the best name for +1:00, as the common phrase for
+# for UT +00 through +03, respectively,
+# but in 1997 Mark R V Murray reported that
+# 'SAST' is the official abbreviation for +02 in the country of South Africa,
+# 'CAT' is commonly used for +02 in countries north of South Africa, and
+# 'WAT' is probably the best name for +01, as the common phrase for
 # the area that includes Nigeria is "West Africa".
-# He has heard of "Western Sahara Time" for +0:00 but can find no reference.
 #
-# To make things confusing, 'WAT' seems to have been used for -1:00 long ago;
-# I'd guess that this was because people needed _some_ name for -1:00,
-# and at the time, far west Africa was the only major land area in -1:00.
-# This usage is now obsolete, as the last use of -1:00 on the African
-# mainland seems to have been 1976 in Western Sahara.
-#
-# To summarize, the following abbreviations seem to have some currency:
-#	-1:00	WAT	West Africa Time (no longer used)
-#	 0:00	GMT	Greenwich Mean Time
-#	 2:00	CAT	Central Africa Time
-#	 2:00	SAST	South Africa Standard Time
-# and Murray suggests the following abbreviation:
-#	 1:00	WAT	West Africa Time
-# I realize that this leads to 'WAT' being used for both -1:00 and 1:00
-# for times before 1976, but this is the best I can think of
-# until we get more information.
+# To summarize, the following abbreviations seemed to have some currency:
+#	 +00	GMT	Greenwich Mean Time
+#	 +02	CAT	Central Africa Time
+#	 +02	SAST	South Africa Standard Time
+# and Murray suggested the following abbreviation:
+#	 +01	WAT	West Africa Time
+# Murray's suggestion seems to have caught on in news reports and the like.
+# I vaguely recall 'WAT' also being used for -01 in the past but
+# cannot now come up with solid citations.
 #
 # I invented the following abbreviations; corrections are welcome!
-#	 2:00	WAST	West Africa Summer Time
-#	 2:30	BEAT	British East Africa Time (no longer used)
-#	 2:45	BEAUT	British East Africa Unified Time (no longer used)
-#	 3:00	CAST	Central Africa Summer Time (no longer used)
-#	 3:00	SAST	South Africa Summer Time (no longer used)
-#	 3:00	EAT	East Africa Time
+#	 +02	WAST	West Africa Summer Time
+#	 +03	CAST	Central Africa Summer Time (no longer used)
+#	 +03	SAST	South Africa Summer Time (no longer used)
+#	 +03	EAT	East Africa Time
+# 'EAT' also seems to have caught on; the others are rare but are paired
+# with better-attested non-DST abbreviations.
 
 # Algeria
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -144,17 +138,17 @@
 
 # Cape Verde / Cabo Verde
 #
-# Shanks gives 1907 for the transition to CVT.
+# Shanks gives 1907 for the transition to +02.
 # Perhaps the 1911-05-26 Portuguese decree
-# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
+# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
 # merely made it official?
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Atlantic/Cape_Verde -1:34:04 -	LMT	1907        # Praia
-			-2:00	-	CVT	1942 Sep
-			-2:00	1:00	CVST	1945 Oct 15
-			-2:00	-	CVT	1975 Nov 25  2:00
-			-1:00	-	CVT
+			-2:00	-	-02	1942 Sep
+			-2:00	1:00	-01	1945 Oct 15
+			-2:00	-	-02	1975 Nov 25  2:00
+			-1:00	-	-01
 
 # Central African Republic
 # See Africa/Lagos.
@@ -411,7 +405,7 @@
 Rule	Ghana	1920	1942	-	Dec	31	0:00	0	GMT
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Accra	-0:00:52 -	LMT	1918
-			 0:00	Ghana	%s
+			 0:00	Ghana	GMT/+0020
 
 # Guinea
 # See Africa/Abidjan.
@@ -420,20 +414,20 @@
 #
 # Shanks gives 1911-05-26 for the transition to WAT,
 # evidently confusing the date of the Portuguese decree
-# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
+# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
 # with the date that it took effect, namely 1912-01-01.
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Bissau	-1:02:20 -	LMT	1912 Jan  1
-			-1:00	-	WAT	1975
+			-1:00	-	-01	1975
 			 0:00	-	GMT
 
 # Kenya
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Nairobi	2:27:16	-	LMT	1928 Jul
 			3:00	-	EAT	1930
-			2:30	-	BEAT	1940
-			2:45	-	BEAUT	1960
+			2:30	-	+0230	1940
+			2:45	-	+0245	1960
 			3:00	-	EAT
 Link Africa/Nairobi Africa/Addis_Ababa	 # Ethiopia
 Link Africa/Nairobi Africa/Asmara	 # Eritrea
@@ -449,18 +443,25 @@
 # See Africa/Johannesburg.
 
 # Liberia
-# From Paul Eggert (2006-03-22):
-# In 1972 Liberia was the last country to switch
-# from a UTC offset that was not a multiple of 15 or 20 minutes.
-# Howse reports that it was in honor of their president's birthday.
-# Shank & Pottenger report the date as May 1, whereas Howse reports Jan;
-# go with Shanks & Pottenger.
-# For Liberia before 1972, Shanks & Pottenger report -0:44, whereas Howse and
-# Whitman each report -0:44:30; go with the more precise figure.
+#
+# From Paul Eggert (2017-03-02):
+#
+# The Nautical Almanac for the Year 1970, p 264, is the source for -0:44:30.
+#
+# In 1972 Liberia was the last country to switch from a UTC offset
+# that was not a multiple of 15 or 20 minutes.  The 1972 change was on
+# 1972-01-07, according to an entry dated 1972-01-04 on p 330 of:
+# Presidential Papers: First year of the administration of
+# President William R. Tolbert, Jr., July 23, 1971-July 31, 1972.
+# Monrovia: Executive Mansion.
+#
+# Use the abbreviation "MMT" before 1972, as the more-accurate numeric
+# abbreviation "-004430" would be one byte over the POSIX limit.
+#
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Monrovia	-0:43:08 -	LMT	1882
 			-0:43:08 -	MMT	1919 Mar # Monrovia Mean Time
-			-0:44:30 -	LRT	1972 May # Liberia Time
+			-0:44:30 -	MMT	1972 Jan 7 # approximately MMT
 			 0:00	-	GMT
 
 ###############################################################################
@@ -619,7 +620,7 @@
 Rule Mauritius	2009	only	-	Mar	lastSun	2:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Indian/Mauritius	3:50:00 -	LMT	1907 # Port Louis
-			4:00 Mauritius	MU%sT	# Mauritius Time
+			4:00 Mauritius	+04/+05
 # Agalega Is, Rodriguez
 # no information; probably like Indian/Mauritius
 
@@ -938,14 +939,14 @@
 # since most of it was then controlled by Morocco.
 
 Zone Africa/El_Aaiun	-0:52:48 -	LMT	1934 Jan # El Aaiún
-			-1:00	-	WAT	1976 Apr 14
+			-1:00	-	-01	1976 Apr 14
 			 0:00	Morocco	WE%sT
 
 # Mozambique
 #
 # Shanks gives 1903-03-01 for the transition to CAT.
 # Perhaps the 1911-05-26 Portuguese decree
-# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
+# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
 # merely made it official?
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -972,16 +973,19 @@
 # the country are close to 40 minutes earlier in sunrise than the rest
 # of the country.
 #
-# From Paul Eggert (2007-03-31):
-# Apparently the Caprivi Strip informally observes Botswana time, but
-# we have no details.  In the meantime people there can use Africa/Gaborone.
+# From Paul Eggert (2017-02-22):
+# Although the Zambezi Region (formerly known as Caprivi) informally
+# observes Botswana time, we have no details about historical practice.
+# In the meantime people there can use Africa/Gaborone.
+# See: Immanuel S. The Namibian. 2017-02-23.
+# http://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
 
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Namibia	1994	max	-	Sep	Sun>=1	2:00	1:00	S
 Rule	Namibia	1995	max	-	Apr	Sun>=1	2:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Windhoek	1:08:24 -	LMT	1892 Feb 8
-			1:30	-	SWAT	1903 Mar    # SW Africa Time
+			1:30	-	+0130	1903 Mar
 			2:00	-	SAST	1942 Sep 20  2:00
 			2:00	1:00	SAST	1943 Mar 21  2:00
 			2:00	-	SAST	1990 Mar 21 # independence
@@ -1008,7 +1012,7 @@
 # Réunion
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Reunion	3:41:52 -	LMT	1911 Jun # Saint-Denis
-			4:00	-	RET	# Réunion Time
+			4:00	-	+04
 #
 # Crozet Islands also observes Réunion time; see the 'antarctica' file.
 #
@@ -1043,7 +1047,7 @@
 # Seychelles
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Mahe	3:41:48 -	LMT	1906 Jun # Victoria
-			4:00	-	SCT	# Seychelles Time
+			4:00	-	+04
 # From Paul Eggert (2001-05-30):
 # Aldabra, Farquhar, and Desroches, originally dependencies of the
 # Seychelles, were transferred to the British Indian Ocean Territory
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/antarctica b/jdk/test/sun/util/calendar/zi/tzdata/antarctica
index 2398ac5..c88c0b4 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/antarctica
+++ b/jdk/test/sun/util/calendar/zi/tzdata/antarctica
@@ -133,7 +133,8 @@
 # O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
 # Prat, -6230-05941
 # Villa Las Estrellas (a town), around the Frei base, since 1984-04-09
-# These locations have always used Santiago time; use TZ='America/Santiago'.
+# These locations employ Region of Magallanes time; use
+# TZ='America/Punta_Arenas'.
 
 # China - year-round bases
 # Great Wall, King George Island, -6213-05858, since 1985-02-20
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/asia b/jdk/test/sun/util/calendar/zi/tzdata/asia
index ac20740..306a2aa 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/asia
+++ b/jdk/test/sun/util/calendar/zi/tzdata/asia
@@ -29,15 +29,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2015-08-08):
+# From Paul Eggert (2017-01-13):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -58,29 +58,24 @@
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
 #
-# I invented the abbreviations marked '*' in the following table;
-# the rest are from earlier versions of this file, or from other sources.
-# Corrections are welcome!
+# The following alphabetic abbreviations appear in these tables:
 #	     std  dst
 #	     LMT	Local Mean Time
 #	2:00 EET  EEST	Eastern European Time
 #	2:00 IST  IDT	Israel
-#	3:00 AST  ADT	Arabia*
-#	3:30 IRST IRDT	Iran*
-#	4:00 GST	Gulf*
 #	5:30 IST	India
-#	7:00 ICT	Indochina, most times and locations*
 #	7:00 WIB	west Indonesia (Waktu Indonesia Barat)
 #	8:00 WITA	central Indonesia (Waktu Indonesia Tengah)
 #	8:00 CST	China
-#	8:00 IDT	Indochina, 1943-45, 1947-55, 1960-75 (some locations)*
-#	8:00 JWST	Western Standard Time (Japan, 1896/1937)*
-#	8:30 KST  KDT	Korea when at +0830*
-#	9:00 JCST	Central Standard Time (Japan, 1896/1937)
+#	8:30 KST  KDT	Korea when at +0830
 #	9:00 WIT	east Indonesia (Waktu Indonesia Timur)
 #	9:00 JST  JDT	Japan
 #	9:00 KST  KDT	Korea when at +09
 #	9:30 ACST	Australian Central Standard Time
+# Otherwise, these tables typically use numeric abbreviations like +03
+# and +0330 for integer hour and minute UTC offsets.  Although earlier
+# editions invented alphabetic time zone abbreviations for every
+# offset, this did not reflect common practice.
 #
 # See the 'europe' file for Russia and Turkey in Asia.
 
@@ -88,7 +83,7 @@
 # Incorporates data for Singapore from Robert Elz' asia 1.1, as well as
 # additional information from Tom Yap, Sun Microsystems Intercontinental
 # Technical Support (including a page from the Official Airline Guide -
-# Worldwide Edition).  The names for time zones are guesses.
+# Worldwide Edition).
 
 ###############################################################################
 
@@ -109,8 +104,8 @@
 # Afghanistan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Kabul	4:36:48 -	LMT	1890
-			4:00	-	AFT	1945
-			4:30	-	AFT
+			4:00	-	+04	1945
+			4:30	-	+0430
 
 # Armenia
 # From Paul Eggert (2006-03-22):
@@ -253,18 +248,17 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
-			6:30	-	BURT	1942 May 15 # Burma Time
-			5:30	-	IST	1942 Sep
-			6:30	-	BURT	1951 Sep 30
-			6:00	-	DACT	1971 Mar 26 # Dacca Time
-			6:00	-	BDT	2009
-			6:00	Dhaka	BD%sT
+			6:30	-	+0630	1942 May 15
+			5:30	-	+0530	1942 Sep
+			6:30	-	+0630	1951 Sep 30
+			6:00	-	+06	2009
+			6:00	Dhaka	+06/+07
 
 # Bhutan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Thimphu	5:58:36 -	LMT	1947 Aug 15 # or Thimbu
-			5:30	-	IST	1987 Oct
-			6:00	-	BTT	# Bhutan Time
+			5:30	-	+0530	1987 Oct
+			6:00	-	+06
 
 # British Indian Ocean Territory
 # Whitman and the 1995 CIA time zone map say 5:00, but the
@@ -274,14 +268,14 @@
 # then contained the Chagos Archipelago).
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Chagos	4:49:40	-	LMT	1907
-			5:00	-	IOT	1996 # BIOT Time
-			6:00	-	IOT
+			5:00	-	+05	1996
+			6:00	-	+06
 
 # Brunei
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Brunei	7:39:40 -	LMT	1926 Mar # Bandar Seri Begawan
-			7:30	-	BNT	1933
-			8:00	-	BNT
+			7:30	-	+0730	1933
+			8:00	-	+08
 
 # Burma / Myanmar
 
@@ -290,9 +284,9 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Yangon	6:24:40 -	LMT	1880        # or Rangoon
 			6:24:40	-	RMT	1920        # Rangoon Mean Time?
-			6:30	-	BURT	1942 May    # Burma Time
-			9:00	-	JST	1945 May  3
-			6:30	-	MMT	# Myanmar Time
+			6:30	-	+0630	1942 May
+			9:00	-	+09	1945 May  3
+			6:30	-	+0630
 
 # Cambodia
 # See Asia/Bangkok.
@@ -355,7 +349,7 @@
 # (could be true), for the moment I am assuming that those two
 # counties are mistakes in the astro.com data.
 
-# From Paul Eggert (2014-06-30):
+# From Paul Eggert (2017-01-05):
 # Alois Treindl kindly sent me translations of the following two sources:
 #
 # (1)
@@ -413,28 +407,26 @@
 # mainly observed in coastal areas), the five zones were:
 #
 # Changbai Time ("Long-white Time", Long-white = Heilongjiang area) UT +08:30
-# Asia/Harbin (currently a link to Asia/Shanghai)
+# Now part of Asia/Shanghai; its pre-1970 times are not recorded here.
 # Heilongjiang (except Mohe county), Jilin
 #
 # Zhongyuan Time ("Central plain Time") UT +08
-# Asia/Shanghai
+# Now part of Asia/Shanghai.
 # most of China
-# This currently represents most other zones as well,
-# as apparently these regions have been the same since 1970.
 # Milne gives 8:05:43.2 for Xujiahui Observatory time; round to nearest.
 # Guo says Shanghai switched to UT +08 "from the end of the 19th century".
 #
-# Long-shu Time (probably due to Long and Shu being two names of the area) UT +07
-# Asia/Chongqing (currently a link to Asia/Shanghai)
+# Long-shu Time (probably as Long and Shu were two names of the area) UT +07
+# Now part of Asia/Shanghai; its pre-1970 times are not recorded here.
 # Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
-# most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
+# most of Gansu; west Inner Mongolia; east Qinghai; and the Guangdong
 # counties Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing,
 # Yangchun, Yangjiang, Yu'nan, and Yunfu.
 #
 # Xin-zang Time ("Xinjiang-Tibet Time") UT +06
-# Asia/Urumqi
-# This currently represents Kunlun Time as well,
-# as apparently the two regions have been the same since 1970.
+# This region is now part of either Asia/Urumqi or Asia/Shanghai with
+# current boundaries uncertain; times before 1970 for areas that
+# disagree with Ürümqi or Shanghai are not recorded here.
 # The Gansu counties Aksay, Anxi, Dunhuang, Subei; west Qinghai;
 # the Guangdong counties  Xuwen, Haikang, Suixi, Lianjiang,
 # Zhanjiang, Wuchuan, Huazhou, Gaozhou, Maoming, Dianbai, and Xinyi;
@@ -445,7 +437,7 @@
 # Fukang, Kuitun, Kumukuli, Miquan, Qitai, and Turfan.
 #
 # Kunlun Time UT +05:30
-# Asia/Kashgar (currently a link to Asia/Urumqi)
+# This region is now in the same status as Xin-zang Time (see above).
 # West Tibet, including Pulan, Aheqi, Shufu, Shule;
 # West Xinjiang, including Aksu, Atushi, Yining, Hetian, Cele, Luopu, Nileke,
 # Zhaosu, Tekesi, Gongliu, Chabuchaer, Huocheng, Bole, Pishan, Suiding,
@@ -546,7 +538,7 @@
 # Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi
 # / Wulumuqi.  (Please use Asia/Shanghai if you prefer Beijing time.)
 Zone	Asia/Urumqi	5:50:20	-	LMT	1928
-			6:00	-	XJT
+			6:00	-	+06
 
 
 # Hong Kong (Xianggang)
@@ -765,30 +757,29 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 # Taipei or Taibei or T'ai-pei
 Zone	Asia/Taipei	8:06:00 -	LMT	1896 Jan  1
-			8:00	-	JWST	1937 Oct  1
+			8:00	-	CST	1937 Oct  1
 			9:00	-	JST	1945 Sep 21  1:00
 			8:00	Taiwan	C%sT
 
 # Macau (Macao, Aomen)
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Macau	1961	1962	-	Mar	Sun>=16	3:30	1:00	S
-Rule	Macau	1961	1964	-	Nov	Sun>=1	3:30	0	-
-Rule	Macau	1963	only	-	Mar	Sun>=16	0:00	1:00	S
-Rule	Macau	1964	only	-	Mar	Sun>=16	3:30	1:00	S
-Rule	Macau	1965	only	-	Mar	Sun>=16	0:00	1:00	S
-Rule	Macau	1965	only	-	Oct	31	0:00	0	-
-Rule	Macau	1966	1971	-	Apr	Sun>=16	3:30	1:00	S
-Rule	Macau	1966	1971	-	Oct	Sun>=16	3:30	0	-
-Rule	Macau	1972	1974	-	Apr	Sun>=15	0:00	1:00	S
-Rule	Macau	1972	1973	-	Oct	Sun>=15	0:00	0	-
-Rule	Macau	1974	1977	-	Oct	Sun>=15	3:30	0	-
-Rule	Macau	1975	1977	-	Apr	Sun>=15	3:30	1:00	S
-Rule	Macau	1978	1980	-	Apr	Sun>=15	0:00	1:00	S
-Rule	Macau	1978	1980	-	Oct	Sun>=15	0:00	0	-
+Rule	Macau	1961	1962	-	Mar	Sun>=16	3:30	1:00	D
+Rule	Macau	1961	1964	-	Nov	Sun>=1	3:30	0	S
+Rule	Macau	1963	only	-	Mar	Sun>=16	0:00	1:00	D
+Rule	Macau	1964	only	-	Mar	Sun>=16	3:30	1:00	D
+Rule	Macau	1965	only	-	Mar	Sun>=16	0:00	1:00	D
+Rule	Macau	1965	only	-	Oct	31	0:00	0	S
+Rule	Macau	1966	1971	-	Apr	Sun>=16	3:30	1:00	D
+Rule	Macau	1966	1971	-	Oct	Sun>=16	3:30	0	S
+Rule	Macau	1972	1974	-	Apr	Sun>=15	0:00	1:00	D
+Rule	Macau	1972	1973	-	Oct	Sun>=15	0:00	0	S
+Rule	Macau	1974	1977	-	Oct	Sun>=15	3:30	0	S
+Rule	Macau	1975	1977	-	Apr	Sun>=15	3:30	1:00	D
+Rule	Macau	1978	1980	-	Apr	Sun>=15	0:00	1:00	D
+Rule	Macau	1978	1980	-	Oct	Sun>=15	0:00	0	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Macau	7:34:20 -	LMT	1912 Jan  1
-			8:00	Macau	MO%sT	1999 Dec 20 # return to China
-			8:00	PRC	C%sT
+			8:00	Macau	C%sT
 
 
 ###############################################################################
@@ -904,11 +895,10 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dili	8:22:20 -	LMT	1912 Jan  1
-			8:00	-	TLT	1942 Feb 21 23:00 # E Timor Time
-			9:00	-	JST	1945 Sep 23
-			9:00	-	TLT	1976 May  3
-			8:00	-	WITA	2000 Sep 17  0:00
-			9:00	-	TLT
+			8:00	-	+08	1942 Feb 21 23:00
+			9:00	-	+09	1976 May  3
+			8:00	-	+08	2000 Sep 17  0:00
+			9:00	-	+09
 
 # India
 
@@ -923,9 +913,9 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Kolkata	5:53:28 -	LMT	1880        # Kolkata
 			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
-			6:30	-	BURT	1942 May 15 # Burma Time
+			6:30	-	+0630	1942 May 15
 			5:30	-	IST	1942 Sep
-			5:30	1:00	IST	1945 Oct 15
+			5:30	1:00	+0630	1945 Oct 15
 			5:30	-	IST
 # The following are like Asia/Kolkata:
 #	Andaman Is
@@ -976,33 +966,33 @@
 # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
 # but this must be a typo.
 			7:07:12	-	BMT	1923 Dec 31 23:47:12 # Batavia
-			7:20	-	JAVT	1932 Nov    # Java Time
-			7:30	-	WIB	1942 Mar 23
-			9:00	-	JST	1945 Sep 23
-			7:30	-	WIB	1948 May
-			8:00	-	WIB	1950 May
-			7:30	-	WIB	1964
+			7:20	-	+0720	1932 Nov
+			7:30	-	+0730	1942 Mar 23
+			9:00	-	+09	1945 Sep 23
+			7:30	-	+0730	1948 May
+			8:00	-	+08	1950 May
+			7:30	-	+0730	1964
 			7:00	-	WIB
 # west and central Borneo
 Zone Asia/Pontianak	7:17:20	-	LMT	1908 May
 			7:17:20	-	PMT	1932 Nov    # Pontianak MT
-			7:30	-	WIB	1942 Jan 29
-			9:00	-	JST	1945 Sep 23
-			7:30	-	WIB	1948 May
-			8:00	-	WIB	1950 May
-			7:30	-	WIB	1964
+			7:30	-	+0730	1942 Jan 29
+			9:00	-	+09	1945 Sep 23
+			7:30	-	+0730	1948 May
+			8:00	-	+08	1950 May
+			7:30	-	+0730	1964
 			8:00	-	WITA	1988 Jan  1
 			7:00	-	WIB
 # Sulawesi, Lesser Sundas, east and south Borneo
 Zone Asia/Makassar	7:57:36 -	LMT	1920
 			7:57:36	-	MMT	1932 Nov    # Macassar MT
-			8:00	-	WITA	1942 Feb  9
-			9:00	-	JST	1945 Sep 23
+			8:00	-	+08	1942 Feb  9
+			9:00	-	+09	1945 Sep 23
 			8:00	-	WITA
 # Maluku Islands, West Papua, Papua
 Zone Asia/Jayapura	9:22:48 -	LMT	1932 Nov
-			9:00	-	WIT	1944 Sep  1
-			9:30	-	ACST	1964
+			9:00	-	+09	1944 Sep  1
+			9:30	-	+0930	1964
 			9:00	-	WIT
 
 # Iran
@@ -1034,8 +1024,6 @@
 # for at least the last 5 years.  Before that, for a few years, the
 # date used was the first Thursday night of Farvardin and the last
 # Thursday night of Shahrivar, but I can't give exact dates....
-# I have also changed the abbreviations to what is considered correct
-# here in Iran, IRST for regular time and IRDT for daylight saving time.
 #
 # From Roozbeh Pournader (2005-04-05):
 # The text of the Iranian law, in effect since 1925, clearly mentions
@@ -1142,9 +1130,9 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Tehran	3:25:44	-	LMT	1916
 			3:25:44	-	TMT	1946     # Tehran Mean Time
-			3:30	-	IRST	1977 Nov
-			4:00	Iran	IR%sT	1979
-			3:30	Iran	IR%sT
+			3:30	-	+0330	1977 Nov
+			4:00	Iran	+04/+05	1979
+			3:30	Iran	+0330/+0430
 
 
 # Iraq
@@ -1187,8 +1175,8 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Baghdad	2:57:40	-	LMT	1890
 			2:57:36	-	BMT	1918     # Baghdad Mean Time?
-			3:00	-	AST	1982 May
-			3:00	Iraq	A%sT
+			3:00	-	+03	1982 May
+			3:00	Iraq	+03/+04
 
 
 ###############################################################################
@@ -1487,8 +1475,6 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Tokyo	9:18:59	-	LMT	1887 Dec 31 15:00u
-			9:00	-	JST	1896 Jan  1
-			9:00	-	JCST	1937 Oct  1
 			9:00	Japan	J%sT
 # Since 1938, all Japanese possessions have been like Asia/Tokyo.
 
@@ -1764,7 +1750,23 @@
 # Kazakh 1992-01-13 act appears to provide the same rules and 1992-03-27
 # act was to be enacted on the last Sunday of March 1992.
 
-# From Paul Eggert (2016-11-07):
+# From Stepan Golosunov (2016-11-08):
+# Turgai reorganization should affect only southern part of Qostanay
+# oblast.  Which should probably be separated into Asia/Arkalyk zone.
+# (There were also 1970, 1988 and 1990 Turgai oblast reorganizations
+# according to wikipedia.)
+#
+# [For Qostanay] http://www.ng.kz/gazeta/195/hranit/
+# suggests that clocks were to be moved 40 minutes backwards on
+# 1920-01-01 to the fourth time belt.  But I do not understand
+# how that could happen....
+#
+# [For Atyrau and Oral] 1919 decree
+# (http://www.worldtimezone.com/dst_news/dst_news_russia-1919-02-08.html
+# and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in
+# the third time belt (before 1930 this means +03).
+
+# From Paul Eggert (2016-12-06):
 # The tables below reflect Golosunov's remarks, with exceptions as noted.
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1794,7 +1796,7 @@
 			6:00	-	+06
 # The following zone is like Asia/Qyzylorda except for being one
 # hour earlier from 1991-09-29 to 1992-03-29.  The 1991/2 rules for
-# Qostenay are unclear partly because of the 1997 Turgai
+# Qostanay are unclear partly because of the 1997 Turgai
 # reorganization, so this zone is commented out for now.
 #Zone	Asia/Qostanay	4:14:20 -	LMT	1924 May  2
 #			4:00	-	+04	1930 Jun 21
@@ -1831,7 +1833,7 @@
 # Atyraū (KZ-ATY) is like Mangghystaū except it switched from
 # +04/+05 to +05/+06 in spring 1999, not fall 1994.
 Zone	Asia/Atyrau	3:27:44	-	LMT	1924 May  2
-			4:00	-	+04	1930 Jun 21
+			3:00	-	+03	1930 Jun 21
 			5:00	-	+05	1981 Oct  1
 			6:00	-	+06	1982 Apr  1
 			5:00 RussiaAsia	+05/+06	1991 Mar 31  2:00s
@@ -1843,7 +1845,7 @@
 # From Paul Eggert (2016-03-18):
 # The 1989 transition is from USSR act No. 227 (1989-03-14).
 Zone	Asia/Oral	3:25:24	-	LMT	1924 May  2 # or Ural'sk
-			4:00	-	+04	1930 Jun 21
+			3:00	-	+03	1930 Jun 21
 			5:00	-	+05	1981 Apr  1
 			5:00	1:00	+06	1981 Oct  1
 			6:00	-	+06	1982 Apr  1
@@ -1949,14 +1951,12 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Seoul	8:27:52	-	LMT	1908 Apr  1
 			8:30	-	KST	1912 Jan  1
-			9:00	-	JCST	1937 Oct  1
 			9:00	-	JST	1945 Sep  8
 			9:00	-	KST	1954 Mar 21
 			8:30	ROK	K%sT	1961 Aug 10
 			9:00	ROK	K%sT
 Zone	Asia/Pyongyang	8:23:00 -	LMT	1908 Apr  1
 			8:30	-	KST	1912 Jan  1
-			9:00	-	JCST	1937 Oct  1
 			9:00	-	JST	1945 Aug 24
 			9:00	-	KST	2015 Aug 15 00:00
 			8:30	-	KST
@@ -2011,30 +2011,29 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Asia/Kuala_Lumpur	6:46:46 -	LMT	1901 Jan  1
 			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
-			7:00	-	MALT	1933 Jan  1 # Malaya Time
-			7:00	0:20	MALST	1936 Jan  1
-			7:20	-	MALT	1941 Sep  1
-			7:30	-	MALT	1942 Feb 16
-			9:00	-	JST	1945 Sep 12
-			7:30	-	MALT	1982 Jan  1
-			8:00	-	MYT	# Malaysia Time
+			7:00	-	+07	1933 Jan  1
+			7:00	0:20	+0720	1936 Jan  1
+			7:20	-	+0720	1941 Sep  1
+			7:30	-	+0730	1942 Feb 16
+			9:00	-	+09	1945 Sep 12
+			7:30	-	+0730	1982 Jan  1
+			8:00	-	+08
 # Sabah & Sarawak
 # From Paul Eggert (2014-08-12):
 # The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945
 # and 1982 transition dates are from Mok Ly Yng.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Asia/Kuching	7:21:20	-	LMT	1926 Mar
-			7:30	-	BORT	1933        # Borneo Time
-			8:00	NBorneo	BOR%sT	1942 Feb 16
-			9:00	-	JST	1945 Sep 12
-			8:00	-	BORT	1982 Jan  1
-			8:00	-	MYT
+			7:30	-	+0730	1933
+			8:00 NBorneo  +08/+0820	1942 Feb 16
+			9:00	-	+09	1945 Sep 12
+			8:00	-	+08
 
 # Maldives
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Maldives	4:54:00 -	LMT	1880 # Male
 			4:54:00	-	MMT	1960 # Male Mean Time
-			5:00	-	MVT	# Maldives Time
+			5:00	-	+05
 
 # Mongolia
 
@@ -2161,37 +2160,41 @@
 # correction of 02:00 (in the previous edition) not being done correctly
 # in the latest edition; so ignore it for now.
 
+# From Ganbold Tsagaankhuu (2017-02-09):
+# Mongolian Government meeting has concluded today to cancel daylight
+# saving time adoption in Mongolia.  Source: http://zasag.mn/news/view/16192
+
 Rule	Mongol	1985	1998	-	Mar	lastSun	0:00	1:00	S
 Rule	Mongol	1984	1998	-	Sep	lastSun	0:00	0	-
 # IATA SSIM (1999-09) says Mongolia no longer observes DST.
 Rule	Mongol	2001	only	-	Apr	lastSat	2:00	1:00	S
 Rule	Mongol	2001	2006	-	Sep	lastSat	2:00	0	-
 Rule	Mongol	2002	2006	-	Mar	lastSat	2:00	1:00	S
-Rule	Mongol	2015	max	-	Mar	lastSat	2:00	1:00	S
-Rule	Mongol	2015	max	-	Sep	lastSat	0:00	0	-
+Rule	Mongol	2015	2016	-	Mar	lastSat	2:00	1:00	S
+Rule	Mongol	2015	2016	-	Sep	lastSat	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 # Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
 Zone	Asia/Hovd	6:06:36 -	LMT	1905 Aug
-			6:00	-	HOVT	1978     # Hovd Time
-			7:00	Mongol	HOV%sT
+			6:00	-	+06	1978
+			7:00	Mongol	+07/+08
 # Ulaanbaatar, a.k.a. Ulan Bataar, Ulan Bator, Urga
 Zone	Asia/Ulaanbaatar 7:07:32 -	LMT	1905 Aug
-			7:00	-	ULAT	1978     # Ulaanbaatar Time
-			8:00	Mongol	ULA%sT
+			7:00	-	+07	1978
+			8:00	Mongol	+08/+09
 # Choibalsan, a.k.a. Bajan Tümen, Bajan Tumen, Chojbalsan,
 # Choybalsan, Sanbejse, Tchoibalsan
 Zone	Asia/Choibalsan	7:38:00 -	LMT	1905 Aug
-			7:00	-	ULAT	1978
-			8:00	-	ULAT	1983 Apr
-			9:00	Mongol	CHO%sT	2008 Mar 31 # Choibalsan Time
-			8:00	Mongol	CHO%sT
+			7:00	-	+07	1978
+			8:00	-	+08	1983 Apr
+			9:00	Mongol	+09/+10	2008 Mar 31
+			8:00	Mongol	+08/+09
 
 # Nepal
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Kathmandu	5:41:16 -	LMT	1920
-			5:30	-	IST	1986
-			5:45	-	NPT	# Nepal Time
+			5:30	-	+0530	1986
+			5:45	-	+0545
 
 # Oman
 # See Asia/Dubai.
@@ -2340,10 +2343,10 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
-			5:30	-	IST	1942 Sep
-			5:30	1:00	IST	1945 Oct 15
-			5:30	-	IST	1951 Sep 30
-			5:00	-	KART	1971 Mar 26 # Karachi Time
+			5:30	-	+0530	1942 Sep
+			5:30	1:00	+0630	1945 Oct 15
+			5:30	-	+0530	1951 Sep 30
+			5:00	-	+05	1971 Mar 26
 			5:00 Pakistan	PK%sT	# Pakistan Time
 
 # Palestine
@@ -2708,15 +2711,15 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Manila	-15:56:00 -	LMT	1844 Dec 31
 			8:04:00 -	LMT	1899 May 11
-			8:00	Phil	PH%sT	1942 May
-			9:00	-	JST	1944 Nov
-			8:00	Phil	PH%sT
+			8:00	Phil	+08/+09	1942 May
+			9:00	-	+09	1944 Nov
+			8:00	Phil	+08/+09
 
 # Qatar
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Qatar	3:26:08 -	LMT	1920     # Al Dawhah / Doha
-			4:00	-	GST	1972 Jun
-			3:00	-	AST
+			4:00	-	+04	1972 Jun
+			3:00	-	+03
 Link Asia/Qatar Asia/Bahrain
 
 # Saudi Arabia
@@ -2743,7 +2746,7 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Riyadh	3:06:52 -	LMT	1947 Mar 14
-			3:00	-	AST
+			3:00	-	+03
 Link Asia/Riyadh Asia/Aden	# Yemen
 Link Asia/Riyadh Asia/Kuwait
 
@@ -2753,14 +2756,13 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Singapore	6:55:25 -	LMT	1901 Jan  1
 			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
-			7:00	-	MALT	1933 Jan  1 # Malaya Time
-			7:00	0:20	MALST	1936 Jan  1
-			7:20	-	MALT	1941 Sep  1
-			7:30	-	MALT	1942 Feb 16
-			9:00	-	JST	1945 Sep 12
-			7:30	-	MALT	1965 Aug  9 # independence
-			7:30	-	SGT	1982 Jan  1 # Singapore Time
-			8:00	-	SGT
+			7:00	-	+07	1933 Jan  1
+			7:00	0:20	+0720	1936 Jan  1
+			7:20	-	+0720	1941 Sep  1
+			7:30	-	+0730	1942 Feb 16
+			9:00	-	+09	1945 Sep 12
+			7:30	-	+0730	1982 Jan  1
+			8:00	-	+08
 
 # Spratly Is
 # no information
@@ -2819,8 +2821,8 @@
 Zone	Asia/Colombo	5:19:24 -	LMT	1880
 			5:19:32	-	MMT	1906        # Moratuwa Mean Time
 			5:30	-	+0530	1942 Jan  5
-			5:30	0:30	+0530/+06 1942 Sep
-			5:30	1:00	+0530/+0630 1945 Oct 16  2:00
+			5:30	0:30	+06	1942 Sep
+			5:30	1:00	+0630	1945 Oct 16  2:00
 			5:30	-	+0530	1996 May 25  0:00
 			6:30	-	+0630	1996 Oct 26  0:30
 			6:00	-	+06	2006 Apr 15  0:30
@@ -3002,7 +3004,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Bangkok	6:42:04	-	LMT	1880
 			6:42:04	-	BMT	1920 Apr # Bangkok Mean Time
-			7:00	-	ICT
+			7:00	-	+07
 Link Asia/Bangkok Asia/Phnom_Penh	# Cambodia
 Link Asia/Bangkok Asia/Vientiane	# Laos
 
@@ -3018,7 +3020,7 @@
 # United Arab Emirates
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dubai	3:41:12 -	LMT	1920
-			4:00	-	GST
+			4:00	-	+04
 Link Asia/Dubai Asia/Muscat	# Oman
 
 # Uzbekistan
@@ -3091,15 +3093,15 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Asia/Ho_Chi_Minh	7:06:40 -	LMT	1906 Jul  1
-			7:06:30	-	PLMT	1911 May  1
-			7:00	-	ICT	1942 Dec 31 23:00
-			8:00	-	IDT	1945 Mar 14 23:00
-			9:00	-	JST	1945 Sep  2
-			7:00	-	ICT	1947 Apr  1
-			8:00	-	IDT	1955 Jul  1
-			7:00	-	ICT	1959 Dec 31 23:00
-			8:00	-	IDT	1975 Jun 13
-			7:00	-	ICT
+			7:06:30	-	PLMT	1911 May  1 # Phù Liá»…n MT
+			7:00	-	+07	1942 Dec 31 23:00
+			8:00	-	+08	1945 Mar 14 23:00
+			9:00	-	+09	1945 Sep  2
+			7:00	-	+07	1947 Apr  1
+			8:00	-	+08	1955 Jul  1
+			7:00	-	+07	1959 Dec 31 23:00
+			8:00	-	+08	1975 Jun 13
+			7:00	-	+07
 
 # Yemen
 # See Asia/Riyadh.
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/australasia b/jdk/test/sun/util/calendar/zi/tzdata/australasia
index 81ef521..db7e7f7 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/australasia
+++ b/jdk/test/sun/util/calendar/zi/tzdata/australasia
@@ -67,8 +67,8 @@
 			 8:00	Aus	AW%sT	1943 Jul
 			 8:00	AW	AW%sT
 Zone Australia/Eucla	 8:35:28 -	LMT	1895 Dec
-			 8:45	Aus	ACW%sT	1943 Jul
-			 8:45	AW	ACW%sT
+			 8:45	Aus +0845/+0945	1943 Jul
+			 8:45	AW  +0845/+0945
 
 # Queensland
 #
@@ -235,7 +235,8 @@
 Rule	LH	2008	max	-	Oct	Sun>=1	2:00	0:30	D
 Zone Australia/Lord_Howe 10:36:20 -	LMT	1895 Feb
 			10:00	-	AEST	1981 Mar
-			10:30	LH	LH%sT
+			10:30	LH	+1030/+1130 1985 Jul
+			10:30	LH	+1030/+11
 
 # Australian miscellany
 #
@@ -273,19 +274,19 @@
 			0	-	-00	1948 Mar 25
 			10:00	Aus	AE%sT	1967
 			10:00	AT	AE%sT	2010 Apr  4  3:00
-			11:00	-	MIST	# Macquarie I Standard Time
+			11:00	-	+11
 
 # Christmas
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Indian/Christmas	7:02:52 -	LMT	1895 Feb
-			7:00	-	CXT	# Christmas Island Time
+			7:00	-	+07
 
 # Cocos (Keeling) Is
 # These islands were ruled by the Ross family from about 1830 to 1978.
 # We don't know when standard time was introduced; for now, we guess 1900.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Cocos	6:27:40	-	LMT	1900
-			6:30	-	CCT	# Cocos Islands Time
+			6:30	-	+0630
 
 
 # Fiji
@@ -398,16 +399,16 @@
 Rule	Fiji	2015	max	-	Jan	Sun>=15	3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:55:44 -	LMT	1915 Oct 26 # Suva
-			12:00	Fiji	FJ%sT	# Fiji Time
+			12:00	Fiji	+12/+13
 
 # French Polynesia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Gambier	 -8:59:48 -	LMT	1912 Oct # Rikitea
-			 -9:00	-	GAMT	# Gambier Time
+			 -9:00	-	-09
 Zone	Pacific/Marquesas -9:18:00 -	LMT	1912 Oct
-			 -9:30	-	MART	# Marquesas Time
+			 -9:30	-	-0930
 Zone	Pacific/Tahiti	 -9:58:16 -	LMT	1912 Oct # Papeete
-			-10:00	-	TAHT	# Tahiti Time
+			-10:00	-	-10
 # Clipperton (near North America) is administered from French Polynesia;
 # it is uninhabited.
 
@@ -422,15 +423,15 @@
 # Kiribati
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Tarawa	 11:32:04 -	LMT	1901 # Bairiki
-			 12:00	-	GILT	# Gilbert Is Time
+			 12:00	-	+12
 Zone Pacific/Enderbury	-11:24:20 -	LMT	1901
-			-12:00	-	PHOT	1979 Oct # Phoenix Is Time
-			-11:00	-	PHOT	1995
-			 13:00	-	PHOT
+			-12:00	-	-12	1979 Oct
+			-11:00	-	-11	1995
+			 13:00	-	+13
 Zone Pacific/Kiritimati	-10:29:20 -	LMT	1901
-			-10:40	-	LINT	1979 Oct # Line Is Time
-			-10:00	-	LINT	1995
-			 14:00	-	LINT
+			-10:40	-	-1040	1979 Oct
+			-10:00	-	-10	1995
+			 14:00	-	+14
 
 # N Mariana Is
 # See Pacific/Guam.
@@ -438,31 +439,31 @@
 # Marshall Is
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Majuro	11:24:48 -	LMT	1901
-			11:00	-	MHT	1969 Oct # Marshall Islands Time
-			12:00	-	MHT
+			11:00	-	+11	1969 Oct
+			12:00	-	+12
 Zone Pacific/Kwajalein	11:09:20 -	LMT	1901
-			11:00	-	MHT	1969 Oct
-			-12:00	-	KWAT	1993 Aug 20 # Kwajalein Time
-			12:00	-	MHT
+			11:00	-	+11	1969 Oct
+			-12:00	-	-12	1993 Aug 20
+			12:00	-	+12
 
 # Micronesia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Chuuk	10:07:08 -	LMT	1901
-			10:00	-	CHUT	# Chuuk Time
+			10:00	-	+10
 Zone Pacific/Pohnpei	10:32:52 -	LMT	1901 # Kolonia
-			11:00	-	PONT	# Pohnpei Time
+			11:00	-	+11
 Zone Pacific/Kosrae	10:51:56 -	LMT	1901
-			11:00	-	KOST	1969 Oct # Kosrae Time
-			12:00	-	KOST	1999
-			11:00	-	KOST
+			11:00	-	+11	1969 Oct
+			12:00	-	+12	1999
+			11:00	-	+11
 
 # Nauru
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Nauru	11:07:40 -	LMT	1921 Jan 15 # Uaobe
-			11:30	-	NRT	1942 Mar 15 # Nauru Time
-			9:00	-	JST	1944 Aug 15
-			11:30	-	NRT	1979 May
-			12:00	-	NRT
+			11:30	-	+1130	1942 Mar 15
+			9:00	-	+09	1944 Aug 15
+			11:30	-	+1130	1979 May
+			12:00	-	+12
 
 # New Caledonia
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -473,7 +474,7 @@
 Rule	NC	1997	only	-	Mar	 2	2:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Noumea	11:05:48 -	LMT	1912 Jan 13 # Nouméa
-			11:00	NC	NC%sT
+			11:00	NC	+11/+12
 
 
 ###############################################################################
@@ -514,8 +515,8 @@
 			11:30	NZ	NZ%sT	1946 Jan  1
 			12:00	NZ	NZ%sT
 Zone Pacific/Chatham	12:13:48 -	LMT	1868 Nov  2
-			12:15	-	CHAST	1946 Jan  1
-			12:45	Chatham	CHA%sT
+			12:15	-	+1215	1946 Jan  1
+			12:45	Chatham	+1245/+1345
 
 Link Pacific/Auckland Antarctica/McMurdo
 
@@ -537,8 +538,8 @@
 Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901        # Avarua
-			-10:30	-	CKT	1978 Nov 12 # Cook Is Time
-			-10:00	Cook	CK%sT
+			-10:30	-	-1030	1978 Nov 12
+			-10:00	Cook	-10/-0930
 
 ###############################################################################
 
@@ -546,29 +547,29 @@
 # Niue
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Niue	-11:19:40 -	LMT	1901        # Alofi
-			-11:20	-	NUT	1951        # Niue Time
-			-11:30	-	NUT	1978 Oct  1
-			-11:00	-	NUT
+			-11:20	-	-1120	1951
+			-11:30	-	-1130	1978 Oct  1
+			-11:00	-	-11
 
 # Norfolk
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Norfolk	11:11:52 -	LMT	1901 # Kingston
-			11:12	-	NMT	1951 # Norfolk Mean Time
-			11:30	-	NFT	1974 Oct 27 02:00 # Norfolk T.
-			11:30	1:00	NFST	1975 Mar  2 02:00
-			11:30	-	NFT	2015 Oct  4 02:00
-			11:00	-	NFT
+			11:12	-	+1112	1951
+			11:30	-	+1130	1974 Oct 27 02:00
+			11:30	1:00	+1230	1975 Mar  2 02:00
+			11:30	-	+1130	2015 Oct  4 02:00
+			11:00	-	+11
 
 # Palau (Belau)
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Palau	8:57:56 -	LMT	1901 # Koror
-			9:00	-	PWT	# Palau Time
+			9:00	-	+09
 
 # Papua New Guinea
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Port_Moresby 9:48:40 -	LMT	1880
 			9:48:32	-	PMMT	1895 # Port Moresby Mean Time
-			10:00	-	PGT	# Papua New Guinea Time
+			10:00	-	+10
 #
 # From Paul Eggert (2014-10-13):
 # Base the Bougainville entry on the Arawa-Kieta region, which appears to have
@@ -583,28 +584,26 @@
 # and seem to have controlled it until their 1945-08-21 surrender.
 #
 # The Autonomous Region of Bougainville switched from UT +10 to +11
-# on 2014-12-28 at 02:00.  They call +11 "Bougainville Standard Time";
-# abbreviate this as BST.  See:
+# on 2014-12-28 at 02:00.  They call +11 "Bougainville Standard Time".
+# See:
 # http://www.bougainville24.com/bougainville-issues/bougainville-gets-own-timezone/
 #
 Zone Pacific/Bougainville 10:22:16 -	LMT	1880
 			 9:48:32 -	PMMT	1895
-			10:00	-	PGT	1942 Jul
-			 9:00	-	JST	1945 Aug 21
-			10:00	-	PGT	2014 Dec 28  2:00
-			11:00	-	BST
+			10:00	-	+10	1942 Jul
+			 9:00	-	+09	1945 Aug 21
+			10:00	-	+10	2014 Dec 28  2:00
+			11:00	-	+11
 
 # Pitcairn
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Pitcairn	-8:40:20 -	LMT	1901        # Adamstown
-			-8:30	-	PNT	1998 Apr 27  0:00
-			-8:00	-	PST	# Pitcairn Standard Time
+			-8:30	-	-0830	1998 Apr 27  0:00
+			-8:00	-	-08
 
 # American Samoa
 Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1879 Jul  5
 			-11:22:48 -	LMT	1911
-			-11:00	-	NST	1967 Apr    # N=Nome
-			-11:00	-	BST	1983 Nov 30 # B=Bering
 			-11:00	-	SST	            # S=Samoa
 Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
 
@@ -685,17 +684,17 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
-			-11:30	-	WSST	1950
-			-11:00	WS	S%sT	2011 Dec 29 24:00 # S=Samoa
-			 13:00	WS	WS%sT
+			-11:30	-	-1130	1950
+			-11:00	WS	-11/-10	2011 Dec 29 24:00
+			 13:00	WS	+13/+14
 
 # Solomon Is
 # excludes Bougainville, for which see Papua New Guinea
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Guadalcanal 10:39:48 -	LMT	1912 Oct # Honiara
-			11:00	-	SBT	# Solomon Is Time
+			11:00	-	+11
 
-# Tokelau Is
+# Tokelau
 #
 # From Gwillim Law (2011-12-29)
 # A correspondent informed me that Tokelau, like Samoa, will be skipping
@@ -716,8 +715,8 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fakaofo	-11:24:56 -	LMT	1901
-			-11:00	-	TKT	2011 Dec 30 # Tokelau Time
-			13:00	-	TKT
+			-11:00	-	-11	2011 Dec 30
+			13:00	-	+13
 
 # Tonga
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -736,7 +735,7 @@
 # Tuvalu
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Pacific/Funafuti	11:56:52 -	LMT	1901
-			12:00	-	TVT	# Tuvalu Time
+			12:00	-	+12
 
 
 # US minor outlying islands
@@ -760,10 +759,11 @@
 
 # Johnston
 #
-# From Paul Eggert (2014-03-11):
+# From Paul Eggert (2017-02-10):
 # Sometimes Johnston kept Hawaii time, and sometimes it was an hour behind.
 # Details are uncertain.  We have no data for Johnston after 1970, so
-# treat it like Hawaii for now.
+# treat it like Hawaii for now.  Since Johnston is now uninhabited,
+# its link to Pacific/Honolulu is in the 'backward' file.
 #
 # In his memoirs of June 6th to October 4, 1945
 # <http://www.315bw.org/Herb_Bach.htm> (2005), Herbert C. Bach writes,
@@ -783,8 +783,6 @@
 # See the table on page 4 where he lists GMT and local times for the tests; a
 # footnote for the JI tests reads that local time is "JI time = Hawaii Time
 # Minus One Hour".
-#
-# See 'northamerica' for Pacific/Johnston.
 
 # Kingman
 # uninhabited
@@ -798,7 +796,7 @@
 # Wake
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Wake	11:06:28 -	LMT	1901
-			12:00	-	WAKT	# Wake Time
+			12:00	-	+12
 
 
 # Vanuatu
@@ -811,12 +809,12 @@
 Rule	Vanuatu	1992	only	-	Oct	Sun>=23	0:00	1:00	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Efate	11:13:16 -	LMT	1912 Jan 13 # Vila
-			11:00	Vanuatu	VU%sT	# Vanuatu Time
+			11:00	Vanuatu	+11/+12
 
 # Wallis and Futuna
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Wallis	12:15:20 -	LMT	1901
-			12:00	-	WFT	# Wallis & Futuna Time
+			12:00	-	+12
 
 ###############################################################################
 
@@ -827,15 +825,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2017-02-10):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -852,28 +850,19 @@
 # A reliable and entertaining source about time zones is
 # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
 #
-# I invented the abbreviations marked '*' in the following table;
-# the rest are from earlier versions of this file, or from other sources.
+# The following abbreviations are from other sources.
 # Corrections are welcome!
 #		std	dst
 #		LMT		Local Mean Time
 #	  8:00	AWST	AWDT	Western Australia
-#	  8:45	ACWST	ACWDT	Central Western Australia*
-#	  9:00	JST		Japan
 #	  9:30	ACST	ACDT	Central Australia
 #	 10:00	AEST	AEDT	Eastern Australia
+#	 10:00	GST		Guam through 2000
 #	 10:00	ChST		Chamorro
-#	 10:30	LHST	LHDT	Lord Howe*
-#	 11:00	BST		Bougainville*
 #	 11:30	NZMT	NZST	New Zealand through 1945
 #	 12:00	NZST	NZDT	New Zealand 1946-present
-#	 12:15	CHAST		Chatham through 1945*
-#	 12:45	CHAST	CHADT	Chatham 1946-present*
-#	 13:00	WSST	WSDT	(western) Samoa 2011-present*
-#	-11:30	WSST		Western Samoa through 1950*
 #	-11:00	SST		Samoa
 #	-10:00	HST		Hawaii
-#	- 8:00	PST		Pitcairn*
 #
 # See the 'northamerica' file for Hawaii.
 # See the 'southamerica' file for Easter I and the Galápagos Is.
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/backward b/jdk/test/sun/util/calendar/zi/tzdata/backward
index ec96c7e..b4cf3be 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/backward
+++ b/jdk/test/sun/util/calendar/zi/tzdata/backward
@@ -119,6 +119,7 @@
 Link	Pacific/Chatham		NZ-CHAT
 Link	America/Denver		Navajo
 Link	Asia/Shanghai		PRC
+Link	Pacific/Honolulu	Pacific/Johnston
 Link	Pacific/Pohnpei		Pacific/Ponape
 Link	Pacific/Pago_Pago	Pacific/Samoa
 Link	Pacific/Chuuk		Pacific/Truk
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/europe b/jdk/test/sun/util/calendar/zi/tzdata/europe
index 9cede59..0d8a40e 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/europe
+++ b/jdk/test/sun/util/calendar/zi/tzdata/europe
@@ -29,15 +29,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2017-02-10):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -79,26 +79,23 @@
 #	History of Summer Time
 #	<http://pcdsh01.on.br/HISTHV.htm>
 #	(1998-09-21, in Portuguese)
-
 #
 # I invented the abbreviations marked '*' in the following table;
-# the rest are from earlier versions of this file, or from other sources.
-# Corrections are welcome!
-#                   std dst  2dst
-#                   LMT           Local Mean Time
-#       -4:00       AST ADT       Atlantic
-#       -3:00       WGT WGST      Western Greenland*
-#       -1:00       EGT EGST      Eastern Greenland*
-#        0:00       GMT BST  BDST Greenwich, British Summer
-#        0:00       GMT IST       Greenwich, Irish Summer
-#        0:00       WET WEST WEMT Western Europe
-#        0:19:32.13 AMT NST       Amsterdam, Netherlands Summer (1835-1937)*
-#        0:20       NET NEST      Netherlands (1937-1940)*
-#        1:00       BST           British Standard (1968-1971)
-#        1:00       CET CEST CEMT Central Europe
-#        1:00:14    SET           Swedish (1879-1899)*
-#        2:00       EET EEST      Eastern Europe
-#        3:00       MSK MSD       Moscow
+# the rest are variants of the "xMT" pattern for a city's mean time,
+# or are from other sources.  Corrections are welcome!
+#                   std  dst  2dst
+#                   LMT             Local Mean Time
+#       -4:00       AST  ADT        Atlantic
+#        0:00       GMT  BST  BDST  Greenwich, British Summer
+#        0:00       GMT  IST        Greenwich, Irish Summer
+#        0:00       WET  WEST WEMT  Western Europe
+#        0:19:32.13 AMT* NST*       Amsterdam, Netherlands Summer (1835-1937)
+#        1:00       BST             British Standard (1968-1971)
+#        1:00       CET  CEST CEMT  Central Europe
+#        1:00:14    SET             Swedish (1879-1899)
+#        1:36:34    RMT* LST*       Riga, Latvian Summer (1880-1926)*
+#        2:00       EET  EEST       Eastern Europe
+#        3:00       MSK  MSD  MDST* Moscow
 
 # From Peter Ilieve (1994-12-04),
 # The original six [EU members]: Belgium, France, (West) Germany, Italy,
@@ -498,7 +495,7 @@
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Dublin	-0:25:00 -	LMT	1880 Aug  2
-			-0:25:21 -	DMT	1916 May 21  2:00
+			-0:25:21 -	DMT	1916 May 21  2:00 # Dublin MT
 			-0:25:21 1:00	IST	1916 Oct  1  2:00s
 			 0:00	GB-Eire	%s	1921 Dec  6 # independence
 			 0:00	GB-Eire	GMT/IST	1940 Feb 25  2:00
@@ -1087,16 +1084,16 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Danmarkshavn -1:14:40 -	LMT	1916 Jul 28
-			-3:00	-	WGT	1980 Apr  6  2:00
-			-3:00	EU	WG%sT	1996
+			-3:00	-	-03	1980 Apr  6  2:00
+			-3:00	EU	-03/-02	1996
 			0:00	-	GMT
 Zone America/Scoresbysund -1:27:52 -	LMT	1916 Jul 28 # Ittoqqortoormiit
-			-2:00	-	CGT	1980 Apr  6  2:00
-			-2:00	C-Eur	CG%sT	1981 Mar 29
-			-1:00	EU	EG%sT
+			-2:00	-	-02	1980 Apr  6  2:00
+			-2:00	C-Eur	-02/-01	1981 Mar 29
+			-1:00	EU	-01/+00
 Zone America/Godthab	-3:26:56 -	LMT	1916 Jul 28 # Nuuk
-			-3:00	-	WGT	1980 Apr  6  2:00
-			-3:00	EU	WG%sT
+			-3:00	-	-03	1980 Apr  6  2:00
+			-3:00	EU	-03/-02
 Zone America/Thule	-4:35:08 -	LMT	1916 Jul 28 # Pituffik air base
 			-4:00	Thule	A%sT
 
@@ -1511,7 +1508,7 @@
 Rule	Iceland	1967	only	-	Oct	29	 1:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Atlantic/Reykjavik	-1:28	-	LMT	1908
-			-1:00	Iceland	IS%sT	1968 Apr  7  1:00s
+			-1:00	Iceland	-01/+00	1968 Apr  7  1:00s
 			 0:00	-	GMT
 
 # Italy
@@ -1975,7 +1972,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Europe/Amsterdam	0:19:32 -	LMT	1835
 			0:19:32	Neth	%s	1937 Jul  1
-			0:20	Neth	NE%sT	1940 May 16  0:00 # Dutch Time
+			0:20	Neth +0020/+0120 1940 May 16  0:00
 			1:00	C-Eur	CE%sT	1945 Apr  2  2:00
 			1:00	Neth	CE%sT	1977
 			1:00	EU	CE%sT
@@ -2192,16 +2189,34 @@
 			 0:00	W-Eur	WE%sT	1992 Sep 27  1:00s
 			 1:00	EU	CE%sT	1996 Mar 31  1:00u
 			 0:00	EU	WE%sT
+# This Zone can be simplified once we assume zic %z.
 Zone Atlantic/Azores	-1:42:40 -	LMT	1884        # Ponta Delgada
 			-1:54:32 -	HMT	1912 Jan  1 # Horta Mean Time
-			-2:00	Port	AZO%sT	1966 Apr  3  2:00  # Azores Time
-			-1:00	Port	AZO%sT	1983 Sep 25  1:00s
-			-1:00	W-Eur	AZO%sT	1992 Sep 27  1:00s
+			-2:00	Port	-02/-01	1942 Apr 25 22:00s
+			-2:00	Port	+00	1942 Aug 15 22:00s
+			-2:00	Port	-02/-01	1943 Apr 17 22:00s
+			-2:00	Port	+00	1943 Aug 28 22:00s
+			-2:00	Port	-02/-01	1944 Apr 22 22:00s
+			-2:00	Port	+00	1944 Aug 26 22:00s
+			-2:00	Port	-02/-01	1945 Apr 21 22:00s
+			-2:00	Port	+00	1945 Aug 25 22:00s
+			-2:00	Port	-02/-01	1966 Apr  3  2:00
+			-1:00	Port	-01/+00	1983 Sep 25  1:00s
+			-1:00	W-Eur	-01/+00	1992 Sep 27  1:00s
 			 0:00	EU	WE%sT	1993 Mar 28  1:00u
-			-1:00	EU	AZO%sT
+			-1:00	EU	-01/+00
+# This Zone can be simplified once we assume zic %z.
 Zone Atlantic/Madeira	-1:07:36 -	LMT	1884        # Funchal
 			-1:07:36 -	FMT	1912 Jan  1 # Funchal Mean Time
-			-1:00	Port	MAD%sT	1966 Apr  3  2:00 # Madeira Time
+			-1:00	Port	-01/+00	1942 Apr 25 22:00s
+			-1:00	Port	+01	1942 Aug 15 22:00s
+			-1:00	Port	-01/+00	1943 Apr 17 22:00s
+			-1:00	Port	+01	1943 Aug 28 22:00s
+			-1:00	Port	-01/+00	1944 Apr 22 22:00s
+			-1:00	Port	+01	1944 Aug 26 22:00s
+			-1:00	Port	-01/+00	1945 Apr 21 22:00s
+			-1:00	Port	+01	1945 Aug 25 22:00s
+			-1:00	Port	-01/+00	1966 Apr  3  2:00
 			 0:00	Port	WE%sT	1983 Sep 25  1:00s
 			 0:00	EU	WE%sT
 
@@ -2559,10 +2574,8 @@
 			 3:00	-	MSK
 
 
-# From Tim Parenti (2014-07-03):
-# Europe/Simferopol covers...
-# **	****	Crimea, Republic of
-# **	****	Sevastopol
+# From Paul Eggert (2016-12-06):
+# Europe/Simferopol covers Crimea.
 
 Zone Europe/Simferopol	 2:16:24 -	LMT	1880
 			 2:16	-	SMT	1924 May  2 # Simferopol Mean T
@@ -3255,46 +3268,77 @@
 # See Europe/Belgrade.
 
 # Spain
+#
+# From Paul Eggert (2016-12-14):
+#
+# The source for Europe/Madrid before 2013 is:
+# Planesas P. La hora oficial en España y sus cambios.
+# Anuario del Observatorio Astronómico de Madrid (2013, in Spanish).
+# http://astronomia.ign.es/rknowsys-theme/images/webAstro/paginas/documentos/Anuario/lahoraoficialenespana.pdf
+# As this source says that historical time in the Canaries is obscure,
+# and it does not discuss Ceuta, stick with Shanks for now for that data.
+#
+# In the 1918 and 1919 fallback transitions in Spain, the clock for
+# the hour-longer day officially kept going after midnight, so that
+# the repeated instances of that day's 00:00 hour were 24 hours apart,
+# with a fallback transition from the second occurrence of 00:59... to
+# the next day's 00:00.  Our data format cannot represent this
+# directly, and instead repeats the first hour of the next day, with a
+# fallback transition from the next day's 00:59... to 00:00.
+
+# From Michael Deckers (2016-12-15):
+# The Royal Decree of 1900-06-26 quoted by Planesas, online at
+# https://www.boe.es/datos/pdfs/BOE//1900/209/A00383-00384.pdf
+# says in its article 5 (my translation):
+# These dispositions will enter into force beginning with the
+# instant at which, according to the time indicated in article 1,
+# the 1st day of January of 1901 will begin.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# For 1917-1919 Whitman gives Apr Sat>=1 - Oct Sat>=1;
-# go with Shanks & Pottenger.
-Rule	Spain	1917	only	-	May	 5	23:00s	1:00	S
-Rule	Spain	1917	1919	-	Oct	 6	23:00s	0	-
-Rule	Spain	1918	only	-	Apr	15	23:00s	1:00	S
-Rule	Spain	1919	only	-	Apr	 5	23:00s	1:00	S
-# Whitman gives 1921 Feb 28 - Oct 14; go with Shanks & Pottenger.
-Rule	Spain	1924	only	-	Apr	16	23:00s	1:00	S
-# Whitman gives 1924 Oct 14; go with Shanks & Pottenger.
-Rule	Spain	1924	only	-	Oct	 4	23:00s	0	-
-Rule	Spain	1926	only	-	Apr	17	23:00s	1:00	S
-# Whitman says no DST in 1929; go with Shanks & Pottenger.
-Rule	Spain	1926	1929	-	Oct	Sat>=1	23:00s	0	-
-Rule	Spain	1927	only	-	Apr	 9	23:00s	1:00	S
-Rule	Spain	1928	only	-	Apr	14	23:00s	1:00	S
-Rule	Spain	1929	only	-	Apr	20	23:00s	1:00	S
-# Whitman gives 1937 Jun 16, 1938 Apr 16, 1940 Apr 13;
-# go with Shanks & Pottenger.
-Rule	Spain	1937	only	-	May	22	23:00s	1:00	S
-Rule	Spain	1937	1939	-	Oct	Sat>=1	23:00s	0	-
-Rule	Spain	1938	only	-	Mar	22	23:00s	1:00	S
-Rule	Spain	1939	only	-	Apr	15	23:00s	1:00	S
-Rule	Spain	1940	only	-	Mar	16	23:00s	1:00	S
-# Whitman says no DST 1942-1945; go with Shanks & Pottenger.
-Rule	Spain	1942	only	-	May	 2	22:00s	2:00	M # Midsummer
-Rule	Spain	1942	only	-	Sep	 1	22:00s	1:00	S
-Rule	Spain	1943	1946	-	Apr	Sat>=13	22:00s	2:00	M
-Rule	Spain	1943	only	-	Oct	 3	22:00s	1:00	S
-Rule	Spain	1944	only	-	Oct	10	22:00s	1:00	S
-Rule	Spain	1945	only	-	Sep	30	 1:00	1:00	S
-Rule	Spain	1946	only	-	Sep	30	 0:00	0	-
+Rule	Spain	1918	only	-	Apr	15	23:00	1:00	S
+Rule	Spain	1918	1919	-	Oct	 6	24:00s	0	-
+Rule	Spain	1919	only	-	Apr	 6	23:00	1:00	S
+Rule	Spain	1924	only	-	Apr	16	23:00	1:00	S
+Rule	Spain	1924	only	-	Oct	 4	24:00s	0	-
+Rule	Spain	1926	only	-	Apr	17	23:00	1:00	S
+Rule	Spain	1926	1929	-	Oct	Sat>=1	24:00s	0	-
+Rule	Spain	1927	only	-	Apr	 9	23:00	1:00	S
+Rule	Spain	1928	only	-	Apr	15	 0:00	1:00	S
+Rule	Spain	1929	only	-	Apr	20	23:00	1:00	S
+# Republican Spain during the civil war; it controlled Madrid until 1939-03-28.
+Rule	Spain	1937	only	-	Jun	16	23:00	1:00	S
+Rule	Spain	1937	only	-	Oct	 2	24:00s	0	-
+Rule	Spain	1938	only	-	Apr	 2	23:00	1:00	S
+Rule	Spain	1938	only	-	Apr	30	23:00	2:00	M
+Rule	Spain	1938	only	-	Oct	 2	24:00	1:00	S
+# The following rules are for unified Spain again.
+#
+# Planesas does not say what happened in Madrid between its fall on
+# 1939-03-28 and the Nationalist spring-forward transition on
+# 1939-04-15.  For lack of better info, assume Madrid's clocks did not
+# change during that period.
+#
+# The first rule is commented out, as it is redundant for Republican Spain.
+#Rule	Spain	1939	only	-	Apr	15	23:00	1:00	S
+Rule	Spain	1939	only	-	Oct	 7	24:00s	0	-
+Rule	Spain	1942	only	-	May	 2	23:00	1:00	S
+Rule	Spain	1942	only	-	Sep	 1	 1:00	0	-
+Rule	Spain	1943	1946	-	Apr	Sat>=13	23:00	1:00	S
+Rule	Spain	1943	1944	-	Oct	Sun>=1	 1:00	0	-
+Rule	Spain	1945	1946	-	Sep	lastSun	 1:00	0	-
 Rule	Spain	1949	only	-	Apr	30	23:00	1:00	S
-Rule	Spain	1949	only	-	Sep	30	 1:00	0	-
-Rule	Spain	1974	1975	-	Apr	Sat>=13	23:00	1:00	S
+Rule	Spain	1949	only	-	Oct	 2	 1:00	0	-
+Rule	Spain	1974	1975	-	Apr	Sat>=12	23:00	1:00	S
 Rule	Spain	1974	1975	-	Oct	Sun>=1	 1:00	0	-
 Rule	Spain	1976	only	-	Mar	27	23:00	1:00	S
 Rule	Spain	1976	1977	-	Sep	lastSun	 1:00	0	-
-Rule	Spain	1977	1978	-	Apr	 2	23:00	1:00	S
-Rule	Spain	1978	only	-	Oct	 1	 1:00	0	-
+Rule	Spain	1977	only	-	Apr	 2	23:00	1:00	S
+Rule	Spain	1978	only	-	Apr	 2	 2:00s	1:00	S
+Rule	Spain	1978	only	-	Oct	 1	 2:00s	0	-
+# Nationalist Spain during the civil war
+#Rule NatSpain	1937	only	-	May	22	23:00	1:00	S
+#Rule NatSpain	1937	1938	-	Oct	Sat>=1	24:00s	0	-
+#Rule NatSpain	1938	only	-	Mar	26	23:00	1:00	S
 # The following rules are copied from Morocco from 1967 through 1978.
 Rule SpainAfrica 1967	only	-	Jun	 3	12:00	1:00	S
 Rule SpainAfrica 1967	only	-	Oct	 1	 0:00	0	-
@@ -3306,11 +3350,11 @@
 Rule SpainAfrica 1978	only	-	Jun	 1	 0:00	1:00	S
 Rule SpainAfrica 1978	only	-	Aug	 4	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Madrid	-0:14:44 -	LMT	1901 Jan  1  0:00s
-			 0:00	Spain	WE%sT	1946 Sep 30
+Zone	Europe/Madrid	-0:14:44 -	LMT	1900 Dec 31 23:45:16
+			 0:00	Spain	WE%sT	1940 Mar 16 23:00
 			 1:00	Spain	CE%sT	1979
 			 1:00	EU	CE%sT
-Zone	Africa/Ceuta	-0:21:16 -	LMT	1901
+Zone	Africa/Ceuta	-0:21:16 -	LMT	1900 Dec 31 23:38:44
 			 0:00	-	WET	1918 May  6 23:00
 			 0:00	1:00	WEST	1918 Oct  7 23:00
 			 0:00	-	WET	1924
@@ -3319,7 +3363,7 @@
 			 1:00	-	CET	1986
 			 1:00	EU	CE%sT
 Zone	Atlantic/Canary	-1:01:36 -	LMT	1922 Mar # Las Palmas de Gran C.
-			-1:00	-	CANT	1946 Sep 30  1:00 # Canaries T
+			-1:00	-	-01	1946 Sep 30  1:00
 			 0:00	-	WET	1980 Apr  6  0:00s
 			 0:00	1:00	WEST	1980 Sep 28  1:00u
 			 0:00	EU	WE%sT
@@ -3732,7 +3776,7 @@
 # spelling, except omit the apostrophe as it is not allowed in
 # portable Posix file names.
 Zone Europe/Zaporozhye	2:20:40 -	LMT	1880
-			2:20	-	CUT	1924 May  2 # Central Ukraine T
+			2:20	-	+0220	1924 May  2
 			2:00	-	EET	1930 Jun 21
 			3:00	-	MSK	1941 Aug 25
 			1:00	C-Eur	CE%sT	1943 Oct 25
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab b/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab
index 004a4a7..38a3a1e 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab
+++ b/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab
@@ -32,8 +32,8 @@
 # All text uses UTF-8 encoding.  The columns of the table are as follows:
 #
 # 1.  ISO 3166-1 alpha-2 country code, current as of
-#     ISO 3166-1 Newsletter VI-16 (2013-07-11).  See: Updates on ISO 3166
-#   http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm
+#     ISO 3166-1 N905 (2016-11-15).  See: Updates on ISO 3166-1
+#     http://isotc.iso.org/livelink/livelink/Open/16944257
 # 2.  The usual English name for the coded region,
 #     chosen so that alphabetic sorting of subsets produces helpful lists.
 #     This is not the same as the English name in the ISO 3166 tables.
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/leapseconds b/jdk/test/sun/util/calendar/zi/tzdata/leapseconds
index 71d774d..3823c9a 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/leapseconds
+++ b/jdk/test/sun/util/calendar/zi/tzdata/leapseconds
@@ -81,5 +81,5 @@
 Leap	2015	Jun	30	23:59:60	+	S
 Leap	2016	Dec	31	23:59:60	+	S
 
-#	Updated through IERS Bulletin C52
-#	File expires on:  28 June 2017
+#	Updated through IERS Bulletin C53
+#	File expires on:  28 December 2017
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/northamerica b/jdk/test/sun/util/calendar/zi/tzdata/northamerica
index 56b089c..d59d270 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/northamerica
+++ b/jdk/test/sun/util/calendar/zi/tzdata/northamerica
@@ -201,22 +201,6 @@
 Zone	MST7MDT		 -7:00	US	M%sT
 Zone	PST8PDT		 -8:00	US	P%sT
 
-# From Bob Devine (1988-01-28):
-# ...Alaska (and Hawaii) had the timezone names changed in 1967.
-#    old			 new
-#    Pacific Standard Time(PST)  -same-
-#    Yukon Standard Time(YST)    -same-
-#    Central Alaska S.T. (CAT)   Alaska-Hawaii St[an]dard Time (AHST)
-#    Nome Standard Time (NT)     Bering Standard Time (BST)
-#
-# ...Alaska's timezone lines were redrawn in 1983 to give only 2 tz.
-#    The YST zone now covers nearly all of the state, AHST just part
-#    of the Aleutian islands.   No DST.
-
-# From Paul Eggert (1995-12-19):
-# The tables below use 'NST', not 'NT', for Nome Standard Time.
-# I invented 'CAWT' for Central Alaska War Time.
-
 # From U. S. Naval Observatory (1989-01-19):
 # USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
 # USA  EASTERN       4 H  BEHIND UTC    APR 3 - OCT 30
@@ -273,6 +257,21 @@
 #	Samoa standard time
 # The law doesn't give abbreviations.
 #
+# From Paul Eggert (2016-12-19):
+# Here are URLs for the 1918 and 1966 legislation:
+# http://uscode.house.gov/statviewer.htm?volume=40&page=451
+# http://uscode.house.gov/statviewer.htm?volume=80&page=108
+# Although the 1918 names were officially "United States Standard
+# Eastern Time" and similarly for "Central", "Mountain", "Pacific",
+# and "Alaska", in practice "Standard" was placed just before "Time",
+# as codified in 1966.  In practice, Alaska time was abbreviated "AST"
+# before 1968.  Summarizing the 1967 name changes:
+#	1918 names			1967 names
+#  -08	Standard Pacific Time (PST)	Pacific standard time (PST)
+#  -09	(unofficial) Yukon (YST)	Yukon standard time (YST)
+#  -10	Standard Alaska Time (AST)	Alaska-Hawaii standard time (AHST)
+#  -11	(unofficial) Nome (NST)		Bering standard time (BST)
+#
 # From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
 # Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time"
 # for time in Guam and the Northern Marianas.  See the file "australasia".
@@ -328,6 +327,15 @@
 # Roberts, city administrator in Phenix City. as saying "We are in the Central
 # time zone, but we do go by the Eastern time zone because so many people work
 # in Columbus."
+#
+# From Paul Eggert (2017-02-22):
+# Four cities are involved.  The two not mentioned above are Smiths Station
+# and Valley.  Barbara Brooks, Valley's assistant treasurer, heard it started
+# because West Point Pepperell textile mills were in Alabama while the
+# corporate office was in Georgia, and residents voted to keep Eastern
+# time even after the mills closed.  See: Kazek K. Did you know which
+# Alabama towns are in a different time zone?  al.com 2017-02-06.
+# http://www.al.com/living/index.ssf/2017/02/do_you_know_which_alabama_town.html
 
 # From Paul Eggert (2014-09-06):
 # Monthly Notices of the Royal Astronomical Society 44, 4 (1884-02-08), 208
@@ -505,7 +513,7 @@
 			-8:00	US	P%sT
 
 # Alaska
-# AK%sT is the modern abbreviation for -9:00 per USNO.
+# AK%sT is the modern abbreviation for -09 per USNO.
 #
 # From Paul Eggert (2001-05-30):
 # Howse writes that Alaska switched from the Julian to the Gregorian calendar,
@@ -611,10 +619,8 @@
 			 -9:00	US	AK%sT
 Zone America/Anchorage	 14:00:24 -	LMT	1867 Oct 18
 			 -9:59:36 -	LMT	1900 Aug 20 12:00
-			-10:00	-	CAT	1942
-			-10:00	US	CAT/CAWT 1945 Aug 14 23:00u
-			-10:00	US	CAT/CAPT 1946 # Peace
-			-10:00	-	CAT	1967 Apr
+			-10:00	-	AST	1942
+			-10:00	US	A%sT	1967 Apr
 			-10:00	-	AHST	1969
 			-10:00	US	AH%sT	1983 Oct 30  2:00
 			 -9:00	US	Y%sT	1983 Nov 30
@@ -703,7 +709,6 @@
 			-10:30	1:00	HDT	1945 Sep 30  2:00
 			-10:30	-	HST	1947 Jun  8  2:00
 			-10:00	-	HST
-Link Pacific/Honolulu Pacific/Johnston
 
 # Now we turn to US areas that have diverged from the consensus since 1970.
 
@@ -1091,15 +1096,15 @@
 ################################################################################
 
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2017-02-10):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -2757,15 +2762,15 @@
 # Belize
 # Whitman entirely disagrees with Shanks; go with Shanks & Pottenger.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Belize	1918	1942	-	Oct	Sun>=2	0:00	0:30	HD
-Rule	Belize	1919	1943	-	Feb	Sun>=9	0:00	0	S
-Rule	Belize	1973	only	-	Dec	 5	0:00	1:00	D
-Rule	Belize	1974	only	-	Feb	 9	0:00	0	S
-Rule	Belize	1982	only	-	Dec	18	0:00	1:00	D
-Rule	Belize	1983	only	-	Feb	12	0:00	0	S
+Rule	Belize	1918	1942	-	Oct	Sun>=2	0:00	0:30	-0530
+Rule	Belize	1919	1943	-	Feb	Sun>=9	0:00	0	CST
+Rule	Belize	1973	only	-	Dec	 5	0:00	1:00	CDT
+Rule	Belize	1974	only	-	Feb	 9	0:00	0	CST
+Rule	Belize	1982	only	-	Dec	18	0:00	1:00	CDT
+Rule	Belize	1983	only	-	Feb	12	0:00	0	CST
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Belize	-5:52:48 -	LMT	1912 Apr
-			-6:00	Belize	C%sT
+			-6:00	Belize	%s
 
 # Bermuda
 
@@ -3037,16 +3042,16 @@
 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	DR	1966	only	-	Oct	30	0:00	1:00	D
-Rule	DR	1967	only	-	Feb	28	0:00	0	S
-Rule	DR	1969	1973	-	Oct	lastSun	0:00	0:30	HD
-Rule	DR	1970	only	-	Feb	21	0:00	0	S
-Rule	DR	1971	only	-	Jan	20	0:00	0	S
-Rule	DR	1972	1974	-	Jan	21	0:00	0	S
+Rule	DR	1966	only	-	Oct	30	0:00	1:00	EDT
+Rule	DR	1967	only	-	Feb	28	0:00	0	EST
+Rule	DR	1969	1973	-	Oct	lastSun	0:00	0:30	-0430
+Rule	DR	1970	only	-	Feb	21	0:00	0	EST
+Rule	DR	1971	only	-	Jan	20	0:00	0	EST
+Rule	DR	1972	1974	-	Jan	21	0:00	0	EST
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Santo_Domingo -4:39:36 -	LMT	1890
 			-4:40	-	SDMT	1933 Apr  1 12:00 # S. Dom. MT
-			-5:00	DR	E%sT	1974 Oct 27
+			-5:00	DR	%s	1974 Oct 27
 			-4:00	-	AST	2000 Oct 29  2:00
 			-5:00	US	E%sT	2000 Dec  3  1:00
 			-4:00	-	AST
@@ -3157,6 +3162,12 @@
 # http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
 # http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
 
+# From Steffen Thorsen (2017-03-12):
+# We have received 4 mails from different people telling that Haiti
+# has started DST again today, and this source seems to confirm that,
+# I have not been able to find a more authoritative source:
+# https://www.haitilibre.com/en/news-20319-haiti-notices-time-change-in-haiti.html
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Haiti	1983	only	-	May	8	0:00	1:00	D
 Rule	Haiti	1984	1987	-	Apr	lastSun	0:00	1:00	D
@@ -3169,6 +3180,8 @@
 Rule	Haiti	2005	2006	-	Oct	lastSun	0:00	0	S
 Rule	Haiti	2012	2015	-	Mar	Sun>=8	2:00	1:00	D
 Rule	Haiti	2012	2015	-	Nov	Sun>=1	2:00	0	S
+Rule	Haiti	2017	max	-	Mar	Sun>=8	2:00	1:00	D
+Rule	Haiti	2017	max	-	Nov	Sun>=1	2:00	0	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Port-au-Prince -4:49:20 -	LMT	1890
 			-4:49	-	PPMT	1917 Jan 24 12:00 # P-a-P MT
@@ -3336,8 +3349,8 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15 # St Pierre
 			-4:00	-	AST	1980 May
-			-3:00	-	PMST	1987 # Pierre & Miquelon Time
-			-3:00	Canada	PM%sT
+			-3:00	-	-03	1987
+			-3:00	Canada	-03/-02
 
 # St Vincent and the Grenadines
 # See America/Port_of_Spain.
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/southamerica b/jdk/test/sun/util/calendar/zi/tzdata/southamerica
index bbc0a95..44dbd95 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/southamerica
+++ b/jdk/test/sun/util/calendar/zi/tzdata/southamerica
@@ -29,15 +29,15 @@
 # tz@iana.org for general use in the future).  For more, please see
 # the file CONTRIBUTING in the tz distribution.
 
-# From Paul Eggert (2014-10-31):
+# From Paul Eggert (2016-12-05):
 #
 # Unless otherwise specified, the source for data through 1990 is:
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
 # Unfortunately this book contains many errors and cites no sources.
 #
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
+# Many years ago Gwillim Law wrote that a good source
+# for time zone data was the International Air Transport
 # Association's Standard Schedules Information Manual (IATA SSIM),
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.  Except where otherwise noted,
@@ -47,32 +47,10 @@
 # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
 # http://www.jstor.org/stable/1774359
 #
-# Earlier editions of these tables used the North American style (e.g. ARST and
-# ARDT for Argentine Standard and Daylight Time), but the following quote
-# suggests that it's better to use European style (e.g. ART and ARST).
-#	I suggest the use of _Summer time_ instead of the more cumbersome
-#	_daylight-saving time_.  _Summer time_ seems to be in general use
-#	in Europe and South America.
-#	-- E O Cutler, _New York Times_ (1937-02-14), quoted in
-#	H L Mencken, _The American Language: Supplement I_ (1960), p 466
-#
-# Earlier editions of these tables also used the North American style
-# for time zones in Brazil, but this was incorrect, as Brazilians say
-# "summer time".  Reinaldo Goulart, a São Paulo businessman active in
-# the railroad sector, writes (1999-07-06):
-#	The subject of time zones is currently a matter of discussion/debate in
-#	Brazil.  Let's say that "the Brasília time" is considered the
-#	"official time" because Brasília is the capital city.
-#	The other three time zones are called "Brasília time "minus one" or
-#	"plus one" or "plus two".  As far as I know there is no such
-#	name/designation as "Eastern Time" or "Central Time".
-# So I invented the following (English-language) abbreviations for now.
-# Corrections are welcome!
-#		std	dst
-#	-2:00	FNT	FNST	Fernando de Noronha
-#	-3:00	BRT	BRST	Brasília
-#	-4:00	AMT	AMST	Amazon
-#	-5:00	ACT	ACST	Acre
+# These tables use numeric abbreviations like -03 and -0330 for
+# integer hour and minute UTC offsets.  Although earlier editions used
+# alphabetic time zone abbreviations, these abbreviations were
+# invented and did not reflect common practice.
 
 ###############################################################################
 
@@ -407,12 +385,6 @@
 #
 # So I guess a new set of rules, besides "Arg", must be made and the last
 # America/Argentina/San_Luis entries should change to use these...
-#
-# I'm enclosing a patch that does what I say... regretfully, the San Luis
-# timezone must be called "WART/WARST" even when most of the time (like,
-# right now) WARST == ART... that is, since last Sunday, all the country
-# is using UTC-3, but in my patch, San Luis calls it "WARST" and the rest
-# of the country calls it "ART".
 # ...
 
 # From Alexander Krivenyshev (2010-04-09):
@@ -451,11 +423,11 @@
 # Buenos Aires (BA), Capital Federal (CF),
 Zone America/Argentina/Buenos_Aires -3:53:48 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May    # Córdoba Mean Time
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	Arg	-03/-02
 #
 # Córdoba (CB), Santa Fe (SF), Entre Ríos (ER), Corrientes (CN), Misiones (MN),
 # Chaco (CC), Formosa (FM), Santiago del Estero (SE)
@@ -469,113 +441,113 @@
 #
 Zone America/Argentina/Cordoba -4:16:48 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  3
+			-4:00	-	-04	1991 Oct 20
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	Arg	-03/-02
 #
 # Salta (SA), La Pampa (LP), Neuquén (NQ), Rio Negro (RN)
 Zone America/Argentina/Salta -4:21:40 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  3
+			-4:00	-	-04	1991 Oct 20
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Tucumán (TM)
 Zone America/Argentina/Tucuman -4:20:52 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 13
-			-3:00	Arg	AR%sT
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  3
+			-4:00	-	-04	1991 Oct 20
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 Jun  1
+			-4:00	-	-04	2004 Jun 13
+			-3:00	Arg	-03/-02
 #
 # La Rioja (LR)
 Zone America/Argentina/La_Rioja -4:27:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  1
-			-4:00	-	WART	1991 May  7
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  1
+			-4:00	-	-04	1991 May  7
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 Jun  1
+			-4:00	-	-04	2004 Jun 20
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # San Juan (SJ)
 Zone America/Argentina/San_Juan -4:34:04 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  1
-			-4:00	-	WART	1991 May  7
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 May 31
-			-4:00	-	WART	2004 Jul 25
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  1
+			-4:00	-	-04	1991 May  7
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 May 31
+			-4:00	-	-04	2004 Jul 25
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Jujuy (JY)
 Zone America/Argentina/Jujuy -4:21:12 -	LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1990 Mar  4
-			-4:00	-	WART	1990 Oct 28
-			-4:00	1:00	WARST	1991 Mar 17
-			-4:00	-	WART	1991 Oct  6
-			-3:00	1:00	ARST	1992
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1990 Mar  4
+			-4:00	-	-04	1990 Oct 28
+			-4:00	1:00	-03	1991 Mar 17
+			-4:00	-	-04	1991 Oct  6
+			-3:00	1:00	-02	1992
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Catamarca (CT), Chubut (CH)
 Zone America/Argentina/Catamarca -4:23:08 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1991 Mar  3
+			-4:00	-	-04	1991 Oct 20
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 Jun  1
+			-4:00	-	-04	2004 Jun 20
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Mendoza (MZ)
 Zone America/Argentina/Mendoza -4:35:16 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1990 Mar  4
-			-4:00	-	WART	1990 Oct 15
-			-4:00	1:00	WARST	1991 Mar  1
-			-4:00	-	WART	1991 Oct 15
-			-4:00	1:00	WARST	1992 Mar  1
-			-4:00	-	WART	1992 Oct 18
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 May 23
-			-4:00	-	WART	2004 Sep 26
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1990 Mar  4
+			-4:00	-	-04	1990 Oct 15
+			-4:00	1:00	-03	1991 Mar  1
+			-4:00	-	-04	1991 Oct 15
+			-4:00	1:00	-03	1992 Mar  1
+			-4:00	-	-04	1992 Oct 18
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 May 23
+			-4:00	-	-04	2004 Sep 26
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # San Luis (SL)
 
@@ -584,44 +556,44 @@
 
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1990
-			-3:00	1:00	ARST	1990 Mar 14
-			-4:00	-	WART	1990 Oct 15
-			-4:00	1:00	WARST	1991 Mar  1
-			-4:00	-	WART	1991 Jun  1
-			-3:00	-	ART	1999 Oct  3
-			-4:00	1:00	WARST	2000 Mar  3
-			-3:00	-	ART	2004 May 31
-			-4:00	-	WART	2004 Jul 25
-			-3:00	Arg	AR%sT	2008 Jan 21
-			-4:00	SanLuis	WAR%sT	2009 Oct 11
-			-3:00	-	ART
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1990
+			-3:00	1:00	-02	1990 Mar 14
+			-4:00	-	-04	1990 Oct 15
+			-4:00	1:00	-03	1991 Mar  1
+			-4:00	-	-04	1991 Jun  1
+			-3:00	-	-03	1999 Oct  3
+			-4:00	1:00	-03	2000 Mar  3
+			-3:00	-	-03	2004 May 31
+			-4:00	-	-04	2004 Jul 25
+			-3:00	Arg	-03/-02	2008 Jan 21
+			-4:00	SanLuis	-04/-03	2009 Oct 11
+			-3:00	-	-03
 #
 # Santa Cruz (SC)
 Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May    # Córdoba Mean Time
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 Jun  1
+			-4:00	-	-04	2004 Jun 20
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 #
 # Tierra del Fuego, Antártida e Islas del Atlántico Sur (TF)
 Zone America/Argentina/Ushuaia -4:33:12 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May    # Córdoba Mean Time
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 May 30
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	-04	1930 Dec
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1999 Oct  3
+			-4:00	Arg	-04/-03	2000 Mar  3
+			-3:00	-	-03	2004 May 30
+			-4:00	-	-04	2004 Jun 20
+			-3:00	Arg	-03/-02	2008 Oct 18
+			-3:00	-	-03
 
 # Aruba
 Link America/Curacao America/Aruba
@@ -631,7 +603,7 @@
 Zone	America/La_Paz	-4:32:36 -	LMT	1890
 			-4:32:36 -	CMT	1931 Oct 15 # Calamarca MT
 			-4:32:36 1:00	BOST	1932 Mar 21 # Bolivia ST
-			-4:00	-	BOT	# Bolivia Time
+			-4:00	-	-04
 
 # Brazil
 
@@ -983,12 +955,12 @@
 #
 # Fernando de Noronha (administratively part of PE)
 Zone America/Noronha	-2:09:40 -	LMT	1914
-			-2:00	Brazil	FN%sT	1990 Sep 17
-			-2:00	-	FNT	1999 Sep 30
-			-2:00	Brazil	FN%sT	2000 Oct 15
-			-2:00	-	FNT	2001 Sep 13
-			-2:00	Brazil	FN%sT	2002 Oct  1
-			-2:00	-	FNT
+			-2:00	Brazil	-02/-01	1990 Sep 17
+			-2:00	-	-02	1999 Sep 30
+			-2:00	Brazil	-02/-01	2000 Oct 15
+			-2:00	-	-02	2001 Sep 13
+			-2:00	Brazil	-02/-01	2002 Oct  1
+			-2:00	-	-02
 # Other Atlantic islands have no permanent settlement.
 # These include Trindade and Martim Vaz (administratively part of ES),
 # Rocas Atoll (RN), and the St Peter and St Paul Archipelago (PE).
@@ -1001,119 +973,119 @@
 # In the north a very small part from the river Javary (now Jari I guess,
 # the border with Amapá) to the Amazon, then to the Xingu.
 Zone America/Belem	-3:13:56 -	LMT	1914
-			-3:00	Brazil	BR%sT	1988 Sep 12
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1988 Sep 12
+			-3:00	-	-03
 #
 # west Pará (PA)
 # West Pará includes Altamira, Óbidos, Prainha, Oriximiná, and Santarém.
 Zone America/Santarem	-3:38:48 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT	2008 Jun 24  0:00
-			-3:00	-	BRT
+			-4:00	Brazil	-04/-03	1988 Sep 12
+			-4:00	-	-04	2008 Jun 24  0:00
+			-3:00	-	-03
 #
 # Maranhão (MA), Piauí (PI), Ceará (CE), Rio Grande do Norte (RN),
 # Paraíba (PB)
 Zone America/Fortaleza	-2:34:00 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 22
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1990 Sep 17
+			-3:00	-	-03	1999 Sep 30
+			-3:00	Brazil	-03/-02	2000 Oct 22
+			-3:00	-	-03	2001 Sep 13
+			-3:00	Brazil	-03/-02	2002 Oct  1
+			-3:00	-	-03
 #
 # Pernambuco (PE) (except Atlantic islands)
 Zone America/Recife	-2:19:36 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 15
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1990 Sep 17
+			-3:00	-	-03	1999 Sep 30
+			-3:00	Brazil	-03/-02	2000 Oct 15
+			-3:00	-	-03	2001 Sep 13
+			-3:00	Brazil	-03/-02	2002 Oct  1
+			-3:00	-	-03
 #
 # Tocantins (TO)
 Zone America/Araguaina	-3:12:48 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1995 Sep 14
-			-3:00	Brazil	BR%sT	2003 Sep 24
-			-3:00	-	BRT	2012 Oct 21
-			-3:00	Brazil	BR%sT	2013 Sep
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1990 Sep 17
+			-3:00	-	-03	1995 Sep 14
+			-3:00	Brazil	-03/-02	2003 Sep 24
+			-3:00	-	-03	2012 Oct 21
+			-3:00	Brazil	-03/-02	2013 Sep
+			-3:00	-	-03
 #
 # Alagoas (AL), Sergipe (SE)
 Zone America/Maceio	-2:22:52 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1995 Oct 13
-			-3:00	Brazil	BR%sT	1996 Sep  4
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 22
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	1990 Sep 17
+			-3:00	-	-03	1995 Oct 13
+			-3:00	Brazil	-03/-02	1996 Sep  4
+			-3:00	-	-03	1999 Sep 30
+			-3:00	Brazil	-03/-02	2000 Oct 22
+			-3:00	-	-03	2001 Sep 13
+			-3:00	Brazil	-03/-02	2002 Oct  1
+			-3:00	-	-03
 #
 # Bahia (BA)
 # There are too many Salvadors elsewhere, so use America/Bahia instead
 # of America/Salvador.
 Zone America/Bahia	-2:34:04 -	LMT	1914
-			-3:00	Brazil	BR%sT	2003 Sep 24
-			-3:00	-	BRT	2011 Oct 16
-			-3:00	Brazil	BR%sT	2012 Oct 21
-			-3:00	-	BRT
+			-3:00	Brazil	-03/-02	2003 Sep 24
+			-3:00	-	-03	2011 Oct 16
+			-3:00	Brazil	-03/-02	2012 Oct 21
+			-3:00	-	-03
 #
 # Goiás (GO), Distrito Federal (DF), Minas Gerais (MG),
 # Espírito Santo (ES), Rio de Janeiro (RJ), São Paulo (SP), Paraná (PR),
 # Santa Catarina (SC), Rio Grande do Sul (RS)
 Zone America/Sao_Paulo	-3:06:28 -	LMT	1914
-			-3:00	Brazil	BR%sT	1963 Oct 23  0:00
-			-3:00	1:00	BRST	1964
-			-3:00	Brazil	BR%sT
+			-3:00	Brazil	-03/-02	1963 Oct 23  0:00
+			-3:00	1:00	-02	1964
+			-3:00	Brazil	-03/-02
 #
 # Mato Grosso do Sul (MS)
 Zone America/Campo_Grande -3:38:28 -	LMT	1914
-			-4:00	Brazil	AM%sT
+			-4:00	Brazil	-04/-03
 #
 # Mato Grosso (MT)
 Zone America/Cuiaba	-3:44:20 -	LMT	1914
-			-4:00	Brazil	AM%sT	2003 Sep 24
-			-4:00	-	AMT	2004 Oct  1
-			-4:00	Brazil	AM%sT
+			-4:00	Brazil	-04/-03	2003 Sep 24
+			-4:00	-	-04	2004 Oct  1
+			-4:00	Brazil	-04/-03
 #
 # Rondônia (RO)
 Zone America/Porto_Velho -4:15:36 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT
+			-4:00	Brazil	-04/-03	1988 Sep 12
+			-4:00	-	-04
 #
 # Roraima (RR)
 Zone America/Boa_Vista	-4:02:40 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT	1999 Sep 30
-			-4:00	Brazil	AM%sT	2000 Oct 15
-			-4:00	-	AMT
+			-4:00	Brazil	-04/-03	1988 Sep 12
+			-4:00	-	-04	1999 Sep 30
+			-4:00	Brazil	-04/-03	2000 Oct 15
+			-4:00	-	-04
 #
 # east Amazonas (AM): Boca do Acre, Jutaí, Manaus, Floriano Peixoto
 # The great circle line from Tabatinga to Porto Acre divides
 # east from west Amazonas.
 Zone America/Manaus	-4:00:04 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT	1993 Sep 28
-			-4:00	Brazil	AM%sT	1994 Sep 22
-			-4:00	-	AMT
+			-4:00	Brazil	-04/-03	1988 Sep 12
+			-4:00	-	-04	1993 Sep 28
+			-4:00	Brazil	-04/-03	1994 Sep 22
+			-4:00	-	-04
 #
 # west Amazonas (AM): Atalaia do Norte, Boca do Maoco, Benjamin Constant,
 #	Eirunepé, Envira, Ipixuna
 Zone America/Eirunepe	-4:39:28 -	LMT	1914
-			-5:00	Brazil	AC%sT	1988 Sep 12
-			-5:00	-	ACT	1993 Sep 28
-			-5:00	Brazil	AC%sT	1994 Sep 22
-			-5:00	-	ACT	2008 Jun 24  0:00
-			-4:00	-	AMT	2013 Nov 10
-			-5:00	-	ACT
+			-5:00	Brazil	-05/-04	1988 Sep 12
+			-5:00	-	-05	1993 Sep 28
+			-5:00	Brazil	-05/-04	1994 Sep 22
+			-5:00	-	-05	2008 Jun 24  0:00
+			-4:00	-	-04	2013 Nov 10
+			-5:00	-	-05
 #
 # Acre (AC)
 Zone America/Rio_Branco	-4:31:12 -	LMT	1914
-			-5:00	Brazil	AC%sT	1988 Sep 12
-			-5:00	-	ACT	2008 Jun 24  0:00
-			-4:00	-	AMT	2013 Nov 10
-			-5:00	-	ACT
+			-5:00	Brazil	-05/-04	1988 Sep 12
+			-5:00	-	-05	2008 Jun 24  0:00
+			-4:00	-	-04	2013 Nov 10
+			-5:00	-	-05
 
 # Chile
 
@@ -1258,6 +1230,18 @@
 # to mean 24:00 mainland time, not 24:00 local time, so that Easter
 # Island is always two hours behind the mainland.
 
+# From Juan Correa (2016-12-04):
+# Magallanes region ... will keep DST (UTC -3) all year round....
+# http://www.soychile.cl/Santiago/Sociedad/2016/12/04/433428/Bachelet-firmo-el-decreto-para-establecer-un-horario-unico-para-la-Region-de-Magallanes.aspx
+#
+# From Deborah Goldsmith (2017-01-19):
+# http://www.diariooficial.interior.gob.cl/publicaciones/2017/01/17/41660/01/1169626.pdf
+# From Paul Eggert (2017-01-19):
+# The above says the Magallanes change expires 2019-05-11 at 24:00,
+# so in theory, they will revert to -04/-03 after that, which means
+# they will switch from -03 to -04 one hour after Santiago does that day.
+# For now, assume that they will not revert.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1931	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1298,22 +1282,35 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Santiago	-4:42:46 -	LMT	1890
 			-4:42:46 -	SMT	1910 Jan 10 # Santiago Mean Time
-			-5:00	-	CLT	1916 Jul  1 # Chile Time
+			-5:00	-	-05	1916 Jul  1
 			-4:42:46 -	SMT	1918 Sep 10
-			-4:00	-	CLT	1919 Jul  1
+			-4:00	-	-04	1919 Jul  1
 			-4:42:46 -	SMT	1927 Sep  1
-			-5:00	Chile	CL%sT	1932 Sep  1
-			-4:00	-	CLT	1942 Jun  1
-			-5:00	-	CLT	1942 Aug  1
-			-4:00	-	CLT	1946 Jul 15
-			-4:00	1:00	CLST	1946 Sep  1 # central Chile
-			-4:00	-	CLT	1947 Apr  1
-			-5:00	-	CLT	1947 May 21 23:00
-			-4:00	Chile	CL%sT
+			-5:00	Chile	-05/-04	1932 Sep  1
+			-4:00	-	-04	1942 Jun  1
+			-5:00	-	-05	1942 Aug  1
+			-4:00	-	-04	1946 Jul 15
+			-4:00	1:00	-03	1946 Sep  1 # central Chile
+			-4:00	-	-04	1947 Apr  1
+			-5:00	-	-05	1947 May 21 23:00
+			-4:00	Chile	-04/-03
+Zone America/Punta_Arenas -4:43:40 -	LMT	1890
+			-4:42:46 -	SMT	1910 Jan 10
+			-5:00	-	-05	1916 Jul  1
+			-4:42:46 -	SMT	1918 Sep 10
+			-4:00	-	-04	1919 Jul  1
+			-4:42:46 -	SMT	1927 Sep  1
+			-5:00	Chile	-05/-04	1932 Sep  1
+			-4:00	-	-04	1942 Jun  1
+			-5:00	-	-05	1942 Aug  1
+			-4:00	-	-04	1947 Apr  1
+			-5:00	-	-05	1947 May 21 23:00
+			-4:00	Chile	-04/-03	2016 Dec  4
+			-3:00	-	-03
 Zone Pacific/Easter	-7:17:28 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
-			-7:00	Chile	EAS%sT	1982 Mar 14 3:00u # Easter Time
-			-6:00	Chile	EAS%sT
+			-7:00	Chile	-07/-06	1982 Mar 14 3:00u # Easter Time
+			-6:00	Chile	-06/-05
 #
 # Salas y Gómez Island is uninhabited.
 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
@@ -1333,9 +1330,10 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Antarctica/Palmer	0	-	-00	1965
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1982 May
-			-4:00	Chile	CL%sT
+			-4:00	Arg	-04/-03	1969 Oct  5
+			-3:00	Arg	-03/-02	1982 May
+			-4:00	Chile	-04/-03	2016 Dec  4
+			-3:00	-	-03
 
 # Colombia
 
@@ -1348,7 +1346,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Bogota	-4:56:16 -	LMT	1884 Mar 13
 			-4:56:16 -	BMT	1914 Nov 23 # Bogotá Mean Time
-			-5:00	CO	CO%sT	# Colombia Time
+			-5:00	CO	-05/-04
 # Malpelo, Providencia, San Andres
 # no information; probably like America/Bogota
 
@@ -1372,7 +1370,7 @@
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Curacao	-4:35:47 -	LMT	1912 Feb 12 # Willemstad
-			-4:30	-	ANT	1965 # Netherlands Antilles Time
+			-4:30	-	-0430	1965
 			-4:00	-	AST
 
 # From Arthur David Olson (2011-06-15):
@@ -1387,19 +1385,32 @@
 #
 # Milne says the Central and South American Telegraph Company used -5:24:15.
 #
-# From Paul Eggert (2007-03-04):
-# Apparently Ecuador had a failed experiment with DST in 1992.
-# <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and
-# <http://www.hoy.com.ec/NoticiaNue.asp?row_id=249856> (2006-11-06) both
-# talk about "hora Sixto".  Leave this alone for now, as we have no data.
+# From Alois Treindl (2016-12-15):
+# http://www.elcomercio.com/actualidad/hora-sixto-1993.html
+# ... Whether the law applied also to Galápagos, I do not know.
+# From Paul Eggert (2016-12-15):
+# http://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
+# This says President Sixto Durán Ballén signed decree No. 285, which
+# established DST from 1992-11-28 to 1993-02-05; it does not give transition
+# times.  The people called it "hora de Sixto" ("Sixto hour").  The change did
+# not go over well; a popular song "Qué hora es" by Jaime Guevara had lyrics
+# that included "Amanecía en mitad de la noche, los guaguas iban a clase sin
+# sol" ("It was dawning in the middle of the night, the buses went to class
+# without sun").  Although Ballén's campaign slogan was "Ni un paso atrás"
+# (Not one step back), the clocks went back in 1993 and the experiment was not
+# repeated.  For now, assume transitions were at 00:00 local time country-wide.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Ecuador	1992	only	-	Nov	28	0:00	1:00	S
+Rule	Ecuador	1993	only	-	Feb	 5	0:00	0	-
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Guayaquil	-5:19:20 -	LMT	1890
 			-5:14:00 -	QMT	1931 # Quito Mean Time
-			-5:00	-	ECT	# Ecuador Time
+			-5:00	Ecuador	-05/-04
 Zone Pacific/Galapagos	-5:58:24 -	LMT	1931 # Puerto Baquerizo Moreno
-			-5:00	-	ECT	1986
-			-6:00	-	GALT	# Galápagos Time
+			-5:00	-	-05	1986
+			-6:00	Ecuador	-06/-05
 
 # Falklands
 
@@ -1499,25 +1510,24 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Atlantic/Stanley	-3:51:24 -	LMT	1890
 			-3:51:24 -	SMT	1912 Mar 12 # Stanley Mean Time
-			-4:00	Falk	FK%sT	1983 May    # Falkland Is Time
-			-3:00	Falk	FK%sT	1985 Sep 15
-			-4:00	Falk	FK%sT	2010 Sep  5  2:00
-			-3:00	-	FKST
+			-4:00	Falk	-04/-03	1983 May
+			-3:00	Falk	-03/-02	1985 Sep 15
+			-4:00	Falk	-04/-03	2010 Sep  5  2:00
+			-3:00	-	-03
 
 # French Guiana
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Cayenne	-3:29:20 -	LMT	1911 Jul
-			-4:00	-	GFT	1967 Oct # French Guiana Time
-			-3:00	-	GFT
+			-4:00	-	-04	1967 Oct
+			-3:00	-	-03
 
 # Guyana
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Guyana	-3:52:40 -	LMT	1915 Mar    # Georgetown
-			-3:45	-	GBGT	1966 May 26 # Br Guiana Time
-			-3:45	-	GYT	1975 Jul 31 # Guyana Time
-			-3:00	-	GYT	1991
+			-3:45	-	-0345	1975 Jul 31
+			-3:00	-	-03	1991
 # IATA SSIM (1996-06) says -4:00.  Assume a 1991 switch.
-			-4:00	-	GYT
+			-4:00	-	-04
 
 # Paraguay
 #
@@ -1609,9 +1619,9 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Asuncion	-3:50:40 -	LMT	1890
 			-3:50:40 -	AMT	1931 Oct 10 # Asunción Mean Time
-			-4:00	-	PYT	1972 Oct    # Paraguay Time
-			-3:00	-	PYT	1974 Apr
-			-4:00	Para	PY%sT
+			-4:00	-	-04	1972 Oct
+			-3:00	-	-03	1974 Apr
+			-4:00	Para	-04/-03
 
 # Peru
 #
@@ -1638,12 +1648,12 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Lima	-5:08:12 -	LMT	1890
 			-5:08:36 -	LMT	1908 Jul 28 # Lima Mean Time?
-			-5:00	Peru	PE%sT	# Peru Time
+			-5:00	Peru	-05/-04
 
 # South Georgia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Atlantic/South_Georgia -2:26:08 -	LMT	1890 # Grytviken
-			-2:00	-	GST	# South Georgia Time
+			-2:00	-	-02
 
 # South Sandwich Is
 # uninhabited; scientific personnel have wintered
@@ -1653,9 +1663,8 @@
 Zone America/Paramaribo	-3:40:40 -	LMT	1911
 			-3:40:52 -	PMT	1935     # Paramaribo Mean Time
 			-3:40:36 -	PMT	1945 Oct    # The capital moved?
-			-3:30	-	NEGT	1975 Nov 20 # Dutch Guiana Time
-			-3:30	-	SRT	1984 Oct    # Suriname Time
-			-3:00	-	SRT
+			-3:30	-	-0330	1984 Oct
+			-3:00	-	-03
 
 # Trinidad and Tobago
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1758,11 +1767,16 @@
 # [dated 2015-06-29; repeals Decree 311/006 dated 2006-09-04]
 Rule	Uruguay	2006	2014	-	Oct	Sun>=1	 2:00	1:00	S
 Rule	Uruguay	2007	2015	-	Mar	Sun>=8	 2:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+
+# This Zone can be simplified once we assume zic %z.
 Zone America/Montevideo	-3:44:44 -	LMT	1898 Jun 28
 			-3:44:44 -	MMT	1920 May  1 # Montevideo MT
-			-3:30	Uruguay	UY%sT	1942 Dec 14 # Uruguay Time
-			-3:00	Uruguay	UY%sT
+			-3:30	Uruguay	-0330/-03 1942 Dec 14
+			-3:00	Uruguay	-03/-02	1968
+			-3:00	Uruguay	-03/-0230 1971
+			-3:00	Uruguay	-03/-02	1974
+			-3:00	Uruguay	-03/-0230 1974 Dec 22
+			-3:00	Uruguay	-03/-02
 
 # Venezuela
 #
@@ -1796,7 +1810,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	America/Caracas	-4:27:44 -	LMT	1890
 			-4:27:40 -	CMT	1912 Feb 12 # Caracas Mean Time?
-			-4:30	-	VET	1965 Jan  1  0:00 # Venezuela T.
-			-4:00	-	VET	2007 Dec  9  3:00
-			-4:30	-	VET	2016 May  1  2:30
-			-4:00	-	VET
+			-4:30	-	-0430	1965 Jan  1  0:00
+			-4:00	-	-04	2007 Dec  9  3:00
+			-4:30	-	-0430	2016 May  1  2:30
+			-4:00	-	-04
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/zone.tab b/jdk/test/sun/util/calendar/zi/tzdata/zone.tab
index 7255ea5..8d6247d 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/zone.tab
+++ b/jdk/test/sun/util/calendar/zi/tzdata/zone.tab
@@ -165,6 +165,7 @@
 CI	+0519-00402	Africa/Abidjan
 CK	-2114-15946	Pacific/Rarotonga
 CL	-3327-07040	America/Santiago	Chile (most areas)
+CL	-5309-07055	America/Punta_Arenas	Region of Magallanes
 CL	-2709-10926	Pacific/Easter	Easter Island
 CM	+0403+00942	Africa/Douala
 CN	+3114+12128	Asia/Shanghai	Beijing Time
@@ -420,7 +421,6 @@
 UA	+4837+02218	Europe/Uzhgorod	Ruthenia
 UA	+4750+03510	Europe/Zaporozhye	Zaporozh'ye/Zaporizhia; Lugansk/Luhansk (east)
 UG	+0019+03225	Africa/Kampala
-UM	+1645-16931	Pacific/Johnston	Johnston Atoll
 UM	+2813-17722	Pacific/Midway	Midway Islands
 UM	+1917+16637	Pacific/Wake	Wake Island
 US	+404251-0740023	America/New_York	Eastern (most areas)
diff --git a/jdk/test/tools/jar/mmrjar/Basic.java b/jdk/test/tools/jar/mmrjar/Basic.java
index 6b0ad84..5716d53 100644
--- a/jdk/test/tools/jar/mmrjar/Basic.java
+++ b/jdk/test/tools/jar/mmrjar/Basic.java
@@ -268,7 +268,7 @@
 
         actual = lines(outbytes);
         expected = Set.of(
-                "hi",
+                "module hi (module-info.class)",
                 "requires mandated java.base",
                 "contains p",
                 "contains p.internal"
@@ -304,7 +304,7 @@
 
         actual = lines(outbytes);
         expected = Set.of(
-                "hi",
+                "module hi (module-info.class)",
                 "requires mandated java.base",
                 "contains p",
                 "contains p.internal",
@@ -331,7 +331,7 @@
         ModuleInfoExtender mie = ModuleInfoExtender.newExtender(
             new ByteArrayInputStream(mdBytes));
 
-        mie.mainClass("foo.main");
+        mie.mainClass("p.Main");
         mie.version(Version.parse("1.0"));
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -345,7 +345,7 @@
 
         // different main-class
         mie = ModuleInfoExtender.newExtender(new ByteArrayInputStream(mdBytes));
-        mie.mainClass("foo.main2");
+        mie.mainClass("p.Main2");
         mie.version(Version.parse("1.0"));
         baos.reset();
         mie.write(baos);
@@ -360,7 +360,7 @@
 
         // different version
         mie = ModuleInfoExtender.newExtender(new ByteArrayInputStream(mdBytes));
-        mie.mainClass("foo.main");
+        mie.mainClass("p.Main");
         mie.version(Version.parse("2.0"));
         baos.reset();
         mie.write(baos);
@@ -395,21 +395,21 @@
         Files.copy(Paths.get("test7-v9", "module-info.class"),
                    Paths.get("test7-v10", "module-info.class"));
 
-        int rc = jar("--create --file mmr.jar --main-class=foo.main -C test7 . --release 9 -C test7-v9 . --release 10 -C test7-v10 .");
-
-System.out.println("-----------------------");
-System.out.println( new String(errbytes.toByteArray()));
-
-
+        int rc = jar("--create --file mmr.jar --main-class=p.Main -C test7 . --release 9 -C test7-v9 . --release 10 -C test7-v10 .");
         Assert.assertEquals(rc, 0);
 
+        jar("-d --file=mmr.jar");
+        System.out.println("-----------------------");
+        System.out.println( new String(outbytes.toByteArray()));
+        Assert.assertEquals(lines(outbytes),
+                            Set.of(
+                           "module m1 (META-INF/versions/9/module-info.class)",
+                           "module m1 (META-INF/versions/10/module-info.class)",
+                           "requires mandated java.base",
+                           "exports p",
+                           "main-class p.Main"));
 
-        jar("-tf mmr.jar");
-
-System.out.println("-----------------------");
-System.out.println( new String(outbytes.toByteArray()));
-
-        Optional<String> exp = Optional.of("foo.main");
+        Optional<String> exp = Optional.of("p.Main");
         try (ZipFile zf = new ZipFile("mmr.jar")) {
             Assert.assertTrue(zf.getEntry("module-info.class") == null);
 
diff --git a/jdk/test/tools/jar/modularJar/Basic.java b/jdk/test/tools/jar/modularJar/Basic.java
index 8a9d441..92cc0a9 100644
--- a/jdk/test/tools/jar/modularJar/Basic.java
+++ b/jdk/test/tools/jar/modularJar/Basic.java
@@ -39,6 +39,7 @@
 import jdk.testlibrary.FileUtils;
 import jdk.testlibrary.JDKToolFinder;
 import org.testng.annotations.BeforeTest;
+import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 import static java.lang.String.format;
@@ -46,7 +47,7 @@
 
 /*
  * @test
- * @bug 8167328 8171830
+ * @bug 8167328 8171830 8165640 8174248 8176772
  * @library /lib/testlibrary
  * @modules jdk.compiler
  *          jdk.jartool
@@ -241,11 +242,6 @@
 
         java(mp, FOO.moduleName + "/" + FOO.mainClass)
             .assertSuccess()
-.resultChecker(r -> {
-        System.out.println("===================================");
-        System.out.println(r.output);
-        System.out.println("===================================");
-})
             .resultChecker(r -> assertModuleData(r, FOO));
         try (InputStream fis = Files.newInputStream(modularJar);
              JarInputStream jis = new JarInputStream(fis)) {
@@ -338,7 +334,7 @@
         // A "bad" main class in first create ( and no version )
         jar("--create",
             "--file=" + modularJar.toString(),
-            "--main-class=" + "IAmNotTheEntryPoint",
+            "--main-class=" + "jdk.test.foo.IAmNotTheEntryPoint",
             "--no-manifest",
             "-C", modClasses.toString(), ".")  // includes module-info.class
            .assertSuccess();
@@ -484,7 +480,7 @@
             .resultChecker(r -> {
                 // Expect similar output: "bar, requires mandated foo, ...
                 // conceals jdk.test.foo, conceals jdk.test.foo.internal"
-                Pattern p = Pattern.compile("\\s+bar\\s+requires\\s++foo");
+                Pattern p = Pattern.compile("module bar \\(module-info.class\\)\\s+requires\\s++foo");
                 assertTrue(p.matcher(r.output).find(),
                            "Expecting to find \"bar, requires foo,...\"",
                            "in output, but did not: [" + r.output + "]");
@@ -740,6 +736,53 @@
     }
 
     @Test
+    public void servicesCreateWithoutFailureNonRootMRMJAR() throws IOException {
+        // without a root module-info.class
+        Path mp = Paths.get("servicesCreateWithoutFailureNonRootMRMJAR");
+        createTestDir(mp);
+        Path modClasses = MODULE_CLASSES.resolve("baz");
+        Path mrjarDir = MRJAR_DIR.resolve("baz");
+        Path modularJar = mp.resolve("baz.jar");
+
+        jar("--create",
+            "--file=" + modularJar.toString(),
+            "--main-class=" + "jdk.test.baz.Baz",
+            "-m", mrjarDir.resolve("META-INF/MANIFEST.MF").toRealPath().toString(),
+            "-C", mrjarDir.toString(), "META-INF/versions/9/module-info.class",
+            "-C", modClasses.toString(), "jdk/test/baz/BazService.class",
+            "-C", modClasses.toString(), "jdk/test/baz/Baz.class",
+            "-C", modClasses.toString(), "jdk/test/baz/internal/BazServiceImpl.class")
+            .assertSuccess();
+
+
+        for (String option : new String[]  {"--describe-module", "-d" }) {
+
+            jar(option,
+                "--file=" + modularJar.toString())
+                .assertSuccess()
+                .resultChecker(r ->
+                    assertTrue(r.output.contains("main-class jdk.test.baz.Baz"),
+                              "Expected to find ", "main-class jdk.test.baz.Baz",
+                               " in [", r.output, "]"));
+
+            jarWithStdin(modularJar.toFile(),  option)
+                .assertSuccess()
+                .resultChecker(r ->
+                    assertTrue(r.output.contains("main-class jdk.test.baz.Baz"),
+                              "Expected to find ", "main-class jdk.test.baz.Baz",
+                               " in [", r.output, "]"));
+
+        }
+        // run module maain class
+        java(mp, "baz/jdk.test.baz.Baz")
+            .assertSuccess()
+            .resultChecker(r ->
+               assertTrue(r.output.contains("mainClass:jdk.test.baz.Baz"),
+                          "Expected to find ", "mainClass:jdk.test.baz.Baz",
+                          " in [", r.output, "]"));
+    }
+
+    @Test
     public void exportCreateWithMissingPkg() throws IOException {
 
         Path foobar = TEST_SRC.resolve("src").resolve("foobar");
@@ -759,8 +802,8 @@
     }
 
     @Test
-    public void printModuleDescriptorFoo() throws IOException {
-        Path mp = Paths.get("printModuleDescriptorFoo");
+    public void describeModuleFoo() throws IOException {
+        Path mp = Paths.get("describeModuleFoo");
         createTestDir(mp);
         Path modClasses = MODULE_CLASSES.resolve(FOO.moduleName);
         Path modularJar = mp.resolve(FOO.moduleName + ".jar");
@@ -773,7 +816,7 @@
             "-C", modClasses.toString(), ".")
             .assertSuccess();
 
-        for (String option : new String[]  {"--print-module-descriptor", "-d" }) {
+        for (String option : new String[]  {"--describe-module", "-d" }) {
             jar(option,
                 "--file=" + modularJar.toString())
                 .assertSuccess()
@@ -794,8 +837,8 @@
     }
 
     @Test
-    public void printModuleDescriptorFooFromStdin() throws IOException {
-        Path mp = Paths.get("printModuleDescriptorFooFromStdin");
+    public void describeModuleFooFromStdin() throws IOException {
+        Path mp = Paths.get("describeModuleFooFromStdin");
         createTestDir(mp);
         Path modClasses = MODULE_CLASSES.resolve(FOO.moduleName);
         Path modularJar = mp.resolve(FOO.moduleName + ".jar");
@@ -808,7 +851,7 @@
             "-C", modClasses.toString(), ".")
             .assertSuccess();
 
-        for (String option : new String[]  {"--print-module-descriptor", "-d" }) {
+        for (String option : new String[]  {"--describe-module", "-d" }) {
             jarWithStdin(modularJar.toFile(),
                          option)
                          .assertSuccess()
@@ -820,6 +863,50 @@
         }
     }
 
+
+    @DataProvider(name = "autoNames")
+    public Object[][] autoNames() {
+        return new Object[][] {
+            // JAR file name                module-name[@version]
+            { "foo.jar",                    "foo" },
+            { "foo1.jar",                   "foo1" },
+            { "foo4j.jar",                  "foo4j", },
+            { "foo-1.2.3.4.jar",            "foo@1.2.3.4" },
+            { "foo-bar.jar",                "foo.bar" },
+            { "foo-1.2-SNAPSHOT.jar",       "foo@1.2-SNAPSHOT" },
+        };
+    }
+
+    @Test(dataProvider = "autoNames")
+    public void describeAutomaticModule(String jarName, String mid)
+        throws IOException
+    {
+        Path mp = Paths.get("describeAutomaticModule");
+        createTestDir(mp);
+        Path regularJar = mp.resolve(jarName);
+        Path t = Paths.get("t");
+        if (Files.notExists(t))
+            Files.createFile(t);
+
+        jar("--create",
+            "--file=" + regularJar.toString(),
+            t.toString())
+            .assertSuccess();
+
+        for (String option : new String[]  {"--describe-module", "-d" }) {
+            jar(option,
+                "--file=" + regularJar.toString())
+                .assertSuccess()
+                .resultChecker(r -> {
+                    assertTrue(r.output.contains("No module descriptor found"));
+                    assertTrue(r.output.contains("Derived automatic module"));
+                    assertTrue(r.output.contains("module " + mid),
+                               "Expected [", "module " + mid,"] in [", r.output, "]");
+                    }
+                );
+        }
+    }
+
     // -- Infrastructure
 
     static Result jarWithStdin(File stdinSource, String... args) {
diff --git a/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java b/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java
index 2d1d844..a7bd3f1 100644
--- a/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java
+++ b/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java
@@ -28,7 +28,6 @@
 import java.lang.module.ModuleDescriptor.Provides;
 import java.lang.module.ModuleReference;
 import java.lang.module.ResolvedModule;
-import java.lang.reflect.Module;
 import java.util.Optional;
 import java.util.StringJoiner;
 import java.util.HashSet;
diff --git a/jdk/test/tools/jar/modularJar/src/baz/jdk/test/baz/Baz.java b/jdk/test/tools/jar/modularJar/src/baz/jdk/test/baz/Baz.java
new file mode 100644
index 0000000..e2bb5a3
--- /dev/null
+++ b/jdk/test/tools/jar/modularJar/src/baz/jdk/test/baz/Baz.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.baz;
+
+import java.lang.module.ModuleDescriptor;
+
+public class Baz {
+    public static void main(String[] args) {
+        ModuleDescriptor md = Baz.class.getModule().getDescriptor();
+        System.out.println("nameAndVersion:" + md.toNameAndVersion());
+        md.mainClass().ifPresent(mc -> System.out.println("mainClass:" + mc));
+    }
+}
diff --git a/jdk/test/tools/jlink/IntegrationTest.java b/jdk/test/tools/jlink/IntegrationTest.java
index 9bf0190..de2c118 100644
--- a/jdk/test/tools/jlink/IntegrationTest.java
+++ b/jdk/test/tools/jlink/IntegrationTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.UncheckedIOException;
+import java.nio.ByteOrder;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -135,17 +136,12 @@
         }
         System.out.println(jl);
 
-        JlinkConfiguration config
-                = new JlinkConfiguration(null, null, null, null);
-
-        System.out.println(config);
-
         Plugin p = Jlink.newPlugin("toto", Collections.emptyMap(), null);
         if (p != null) {
             throw new Exception("Plugin should be null");
         }
 
-        Plugin p2 = Jlink.newPlugin("compress", Collections.emptyMap(), null);
+        Plugin p2 = Jlink.newPlugin("compress", Map.of("compress", "1"), null);
         if (p2 == null) {
             throw new Exception("Plugin should not be null");
         }
@@ -163,7 +159,7 @@
         Set<String> limits = new HashSet<>();
         limits.add("java.management");
         JlinkConfiguration config = new Jlink.JlinkConfiguration(output,
-                modulePaths, mods, limits, null);
+                modulePaths, mods, limits, ByteOrder.nativeOrder());
 
         List<Plugin> lst = new ArrayList<>();
 
@@ -214,7 +210,8 @@
         checkReleaseProperty(props, "JAVA_FULL_VERSION");
         checkReleaseProperty(props, "OS_NAME");
         checkReleaseProperty(props, "OS_ARCH");
-        checkReleaseProperty(props, "OS_VERSION");
+        // OS_VERSION is added from makefile. We're testing API-way to create image here!
+        // checkReleaseProperty(props, "OS_VERSION");
 
         if (!Files.exists(output.resolve("toto.txt"))) {
             throw new AssertionError("Post processing not called");
diff --git a/jdk/test/tools/jlink/JLink2Test.java b/jdk/test/tools/jlink/JLink2Test.java
index 9eed823..5c0f7f3 100644
--- a/jdk/test/tools/jlink/JLink2Test.java
+++ b/jdk/test/tools/jlink/JLink2Test.java
@@ -39,7 +39,6 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.lang.reflect.Layer;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.ArrayList;
@@ -88,7 +87,7 @@
 
     private static void testOptions() throws Exception {
         List<Plugin> builtInPlugins = new ArrayList<>();
-        builtInPlugins.addAll(PluginRepository.getPlugins(Layer.boot()));
+        builtInPlugins.addAll(PluginRepository.getPlugins(ModuleLayer.boot()));
         if(builtInPlugins.isEmpty()) {
             throw new Exception("No builtin plugins");
         }
diff --git a/jdk/test/tools/jlink/JLinkNegativeTest.java b/jdk/test/tools/jlink/JLinkNegativeTest.java
index f8ac809..d02ecbb 100644
--- a/jdk/test/tools/jlink/JLinkNegativeTest.java
+++ b/jdk/test/tools/jlink/JLinkNegativeTest.java
@@ -25,6 +25,7 @@
  * @test
  * @summary Negative tests for jlink
  * @bug 8130861
+ * @bug 8174718
  * @author Andrei Eremeev
  * @library ../lib
  * @modules java.base/jdk.internal.jimage
@@ -50,6 +51,7 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.Set;
 
 import jdk.internal.module.ModuleInfoWriter;
 import org.testng.SkipException;
@@ -191,7 +193,7 @@
                     .output(imageFile)
                     .addMods("not_zip")
                     .modulePath(helper.defaultModulePath())
-                    .call().assertFailure("Error: java.io.IOException: Invalid jmod file");
+                    .call().assertFailure("Error: java.io.IOException: Invalid JMOD file");
         } finally {
             deleteDirectory(jmod);
         }
@@ -250,7 +252,7 @@
         String moduleName = "hacked4";
         Path jmod = helper.generateDefaultJModule(moduleName).assertSuccess();
         JImageGenerator.addFiles(jmod,
-                new InMemoryFile("/native", new byte[0]),
+                new InMemoryFile("/lib", new byte[0]),
                 new InMemoryFile("/conf", new byte[0]),
                 new InMemoryFile("/bin", new byte[0]));
         try {
@@ -274,7 +276,7 @@
                 helper.getJmodSrcDir(), helper.getJmodClassesDir(), moduleName2, classNames);
 
         try (OutputStream out = Files.newOutputStream(module2.resolve("module-info.class"))) {
-            ModuleInfoWriter.write(ModuleDescriptor.module(moduleName1)
+            ModuleInfoWriter.write(ModuleDescriptor.newModule(moduleName1)
                     .requires("java.base").build(), out);
         }
 
@@ -332,7 +334,7 @@
                 helper.getJarSrcDir(), helper.getJarClassesDir(), moduleName2, classNames);
 
         try (OutputStream out = Files.newOutputStream(module2.resolve("module-info.class"))) {
-            ModuleInfoWriter.write(ModuleDescriptor.module(moduleName1)
+            ModuleInfoWriter.write(ModuleDescriptor.newModule(moduleName1)
                     .requires("java.base").build(), out);
         }
 
@@ -346,4 +348,27 @@
             deleteDirectory(jar2);
         }
     }
+
+    public void testInconsistentModuleInfo() throws IOException {
+        String moduleName = "inconsistentJar";
+        List<String> classNames = Arrays.asList("xorg.acme.internal.B");
+        Path module = helper.generateModuleCompiledClasses(
+                helper.getJarSrcDir(), helper.getJarClassesDir(), moduleName, classNames);
+
+        try (OutputStream out = Files.newOutputStream(module.resolve("module-info.class"))) {
+            ModuleInfoWriter.write(ModuleDescriptor.newModule(moduleName)
+                    .requires("java.base")
+                    .packages(Set.of("org.acme.internal"))
+                    .build(), out);
+        }
+
+        Path jar = JImageGenerator.createJarFile(helper.getJarDir().resolve(moduleName + ".jar"), module);
+        try {
+            helper.generateDefaultImage(moduleName)
+                  .assertFailure("Module inconsistentJar's descriptor indicates the set of packages is : " +
+                  "[org.acme.internal], but module contains packages: [xorg.acme.internal]");
+        } finally {
+            deleteDirectory(jar);
+        }
+    }
 }
diff --git a/jdk/test/tools/jlink/JLinkTest.java b/jdk/test/tools/jlink/JLinkTest.java
index 4690bb1..64b2207 100644
--- a/jdk/test/tools/jlink/JLinkTest.java
+++ b/jdk/test/tools/jlink/JLinkTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -88,7 +87,7 @@
         {
             // number of built-in plugins
             List<Plugin> builtInPlugins = new ArrayList<>();
-            builtInPlugins.addAll(PluginRepository.getPlugins(Layer.boot()));
+            builtInPlugins.addAll(PluginRepository.getPlugins(ModuleLayer.boot()));
             totalPlugins = builtInPlugins.size();
             // actual num. of plugins loaded from jdk.jlink module
             int actualJLinkPlugins = 0;
@@ -274,7 +273,7 @@
             String[] userOptions = {"--compress", "2", "foo" };
             String moduleName = "orphanarg1";
             helper.generateDefaultJModule(moduleName, "composite2");
-            helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: orphan argument: foo");
+            helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: invalid argument: foo");
         }
 
         // orphan argument - JDK-8166810
@@ -282,7 +281,7 @@
             String[] userOptions = {"--output", "foo", "bar" };
             String moduleName = "orphanarg2";
             helper.generateDefaultJModule(moduleName, "composite2");
-            helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: orphan argument: bar");
+            helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: invalid argument: bar");
         }
 
         // basic check for --help - JDK-8173717
diff --git a/jdk/test/tools/jlink/basic/src/test/jdk/test/Test.java b/jdk/test/tools/jlink/basic/src/test/jdk/test/Test.java
index e038745..79d07d8 100644
--- a/jdk/test/tools/jlink/basic/src/test/jdk/test/Test.java
+++ b/jdk/test/tools/jlink/basic/src/test/jdk/test/Test.java
@@ -23,9 +23,6 @@
 
 package jdk.test;
 
-import java.lang.reflect.Module;
-import java.lang.reflect.Layer;
-
 public class Test {
     public static void main(String[] args) {
         System.out.println(Test.class + " ...");
@@ -36,7 +33,7 @@
         ClassLoader scl = ClassLoader.getSystemClassLoader();
         ClassLoader cl1 = Test.class.getClassLoader();
         Module testModule = Test.class.getModule();
-        ClassLoader cl2 = Layer.boot().findLoader(testModule.getName());
+        ClassLoader cl2 = ModuleLayer.boot().findLoader(testModule.getName());
 
         if (cl1 != scl)
             throw new RuntimeException("Not loaded by system class loader");
diff --git a/jdk/test/tools/jlink/bindservices/BindServices.java b/jdk/test/tools/jlink/bindservices/BindServices.java
new file mode 100644
index 0000000..1c57d21
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/BindServices.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.spi.ToolProvider;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static jdk.testlibrary.Asserts.assertTrue;
+import static jdk.testlibrary.ProcessTools.*;
+
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @bug 8174826
+ * @library /lib/testlibrary
+ * @modules jdk.compiler jdk.jlink
+ * @build BindServices CompilerUtils jdk.testlibrary.ProcessTools
+ * @run testng BindServices
+ */
+
+public class BindServices {
+    private static final String JAVA_HOME = System.getProperty("java.home");
+    private static final String TEST_SRC = System.getProperty("test.src");
+
+    private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
+    private static final Path MODS_DIR = Paths.get("mods");
+
+    private static final String MODULE_PATH =
+        Paths.get(JAVA_HOME, "jmods").toString() +
+            File.pathSeparator + MODS_DIR.toString();
+
+    // the names of the modules in this test
+    private static String[] modules = new String[] {"m1", "m2", "m3"};
+
+
+    private static boolean hasJmods() {
+        if (!Files.exists(Paths.get(JAVA_HOME, "jmods"))) {
+            System.err.println("Test skipped. NO jmods directory");
+            return false;
+        }
+        return true;
+    }
+
+    /*
+     * Compiles all modules used by the test
+     */
+    @BeforeTest
+    public void compileAll() throws Throwable {
+        if (!hasJmods()) return;
+
+        for (String mn : modules) {
+            Path msrc = SRC_DIR.resolve(mn);
+            assertTrue(CompilerUtils.compile(msrc, MODS_DIR,
+                "--module-source-path", SRC_DIR.toString()));
+        }
+    }
+
+    @Test
+    public void noServiceBinding() throws Throwable {
+        if (!hasJmods()) return;
+
+        Path dir = Paths.get("noServiceBinding");
+
+        // no service binding and does not link m2,m3 providers.
+        JLink.run("--output", dir.toString(),
+                  "--module-path", MODULE_PATH,
+                  "--add-modules", "m1").output();
+
+        testImage(dir, "m1");
+    }
+
+    @Test
+    public void fullServiceBinding() throws Throwable {
+        if (!hasJmods()) return;
+
+        Path dir = Paths.get("fullServiceBinding");
+
+        // full service binding
+        // m2 is a provider used by m1.  During service binding, when m2 is
+        // resolved, m2 uses p2.T that causes m3 to be linked as it is a
+        // provider to p2.T
+        JLink.run("--output", dir.toString(),
+                  "--module-path", MODULE_PATH,
+                  "--add-modules", "m1",
+                  "--bind-services",
+                  "--limit-modules", "m1,m2,m3,java.base");
+
+        testImage(dir, "m1", "m2", "m3");
+    }
+
+    @Test
+    public void testVerbose() throws Throwable {
+        if (!hasJmods()) return;
+
+        Path dir = Paths.get("verbose");
+
+        List<String> output =
+            JLink.run("--output", dir.toString(),
+                      "--module-path", MODULE_PATH,
+                      "--add-modules", "m1",
+                      "--bind-services",
+                      "--verbose",
+                      "--limit-modules", "m1,m2,m3,java.base").output();
+
+        List<String> expected = List.of(
+            "module m1 (" + MODS_DIR.resolve("m1").toUri().toString() + ")",
+            "module m2 (" + MODS_DIR.resolve("m2").toUri().toString() + ")",
+            "module m3 (" + MODS_DIR.resolve("m3").toUri().toString() + ")",
+            "module m1 provides p1.S, used by m1",
+            "module m2 provides p1.S, used by m1",
+            "module m2 provides p2.T, used by m2",
+            "module m3 provides p2.T, used by m2"
+        );
+
+        assertTrue(output.containsAll(expected));
+
+        testImage(dir, "m1", "m2", "m3");
+    }
+
+    /*
+     * Tests the given ${java.home} to only contain the specified modules
+     */
+    private void testImage(Path javaHome, String... modules) throws Throwable {
+        Path java = javaHome.resolve("bin").resolve("java");
+        String[] cmd = Stream.concat(
+            Stream.of(java.toString(), "-m", "m1/p1.Main"),
+            Stream.of(modules)).toArray(String[]::new);
+
+        assertTrue(executeProcess(cmd).outputTo(System.out)
+                                      .errorTo(System.out)
+                                      .getExitValue() == 0);
+    }
+
+    static class JLink {
+        static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink")
+            .orElseThrow(() ->
+                new RuntimeException("jlink tool not found")
+            );
+
+        static JLink run(String... options) {
+            JLink jlink = new JLink();
+            assertTrue(jlink.execute(options) == 0);
+            return jlink;
+        }
+
+        final List<String> output = new ArrayList<>();
+        private int execute(String... options) {
+            System.out.println("jlink " +
+                Stream.of(options).collect(Collectors.joining(" ")));
+
+            StringWriter writer = new StringWriter();
+            PrintWriter pw = new PrintWriter(writer);
+            int rc = JLINK_TOOL.run(pw, pw, options);
+            System.out.println(writer.toString());
+            Stream.of(writer.toString().split("\\v"))
+                  .map(String::trim)
+                  .forEach(output::add);
+            return rc;
+        }
+
+        boolean contains(String s) {
+            return output.contains(s);
+        }
+
+        List<String> output() {
+            return output;
+        }
+    }
+}
diff --git a/jdk/test/tools/jlink/bindservices/SuggestProviders.java b/jdk/test/tools/jlink/bindservices/SuggestProviders.java
new file mode 100644
index 0000000..a1adf27
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/SuggestProviders.java
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.spi.ToolProvider;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static jdk.testlibrary.Asserts.assertTrue;
+
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @bug 8174826
+ * @library /lib/testlibrary
+ * @modules jdk.charsets jdk.compiler jdk.jlink
+ * @build SuggestProviders CompilerUtils
+ * @run testng SuggestProviders
+ */
+
+public class SuggestProviders {
+    private static final String JAVA_HOME = System.getProperty("java.home");
+    private static final String TEST_SRC = System.getProperty("test.src");
+
+    private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
+    private static final Path MODS_DIR = Paths.get("mods");
+
+    private static final String MODULE_PATH =
+        Paths.get(JAVA_HOME, "jmods").toString() +
+        File.pathSeparator + MODS_DIR.toString();
+
+    // the names of the modules in this test
+    private static String[] modules = new String[] {"m1", "m2", "m3"};
+
+
+    private static boolean hasJmods() {
+        if (!Files.exists(Paths.get(JAVA_HOME, "jmods"))) {
+            System.err.println("Test skipped. NO jmods directory");
+            return false;
+        }
+        return true;
+    }
+
+    /*
+     * Compiles all modules used by the test
+     */
+    @BeforeTest
+    public void compileAll() throws Throwable {
+        if (!hasJmods()) return;
+
+        for (String mn : modules) {
+            Path msrc = SRC_DIR.resolve(mn);
+            assertTrue(CompilerUtils.compile(msrc, MODS_DIR,
+                "--module-source-path", SRC_DIR.toString()));
+        }
+    }
+
+    @Test
+    public void suggestProviders() throws Throwable {
+        if (!hasJmods()) return;
+
+        List<String> output = JLink.run("--module-path", MODULE_PATH,
+                                        "--add-modules", "m1",
+                                        "--suggest-providers").output();
+        // check a subset of services used by java.base
+        List<String> expected = List.of(
+            "uses java.lang.System$LoggerFinder",
+            "uses java.net.ContentHandlerFactory",
+            "uses java.net.spi.URLStreamHandlerProvider",
+            "uses java.nio.channels.spi.AsynchronousChannelProvider",
+            "uses java.nio.channels.spi.SelectorProvider",
+            "uses java.nio.charset.spi.CharsetProvider",
+            "uses java.nio.file.spi.FileSystemProvider",
+            "uses java.nio.file.spi.FileTypeDetector",
+            "uses java.security.Provider",
+            "uses java.util.spi.ToolProvider",
+            "uses p1.S",
+            "module jdk.charsets provides java.nio.charset.spi.CharsetProvider, used by java.base",
+            "module jdk.compiler provides java.util.spi.ToolProvider, used by java.base",
+            "module jdk.jlink provides java.util.spi.ToolProvider, used by java.base",
+            "module m1 provides p1.S, used by m1",
+            "module m2 provides p1.S, used by m1"
+        );
+
+        assertTrue(output.containsAll(expected));
+    }
+
+    @Test
+    public void providersForServices() throws Throwable {
+        if (!hasJmods()) return;
+
+        List<String> output =
+            JLink.run("--module-path", MODULE_PATH,
+                      "--add-modules", "m1",
+                      "--suggest-providers",
+                      "java.nio.charset.spi.CharsetProvider,p1.S,p2.T").output();
+
+        System.out.println(output);
+        List<String> expected = List.of(
+            "module jdk.charsets provides java.nio.charset.spi.CharsetProvider, used by java.base",
+            "module m1 provides p1.S, used by m1",
+            "module m2 provides p1.S, used by m1",
+            "module m2 provides p2.T, used by m2",
+            "module m3 provides p2.T, used by m2"
+        );
+
+        assertTrue(output.containsAll(expected));
+    }
+
+    @Test
+    public void unusedService() throws Throwable {
+        if (!hasJmods()) return;
+
+        List<String> output =
+            JLink.run("--module-path", MODULE_PATH,
+                "--add-modules", "m1",
+                "--suggest-providers",
+                "nonExistentType").output();
+
+        System.out.println(output);
+        List<String> expected = List.of(
+            "Services specified in --suggest-providers not used: nonExistentType"
+        );
+
+        assertTrue(output.containsAll(expected));
+    }
+
+    @Test
+    public void noSuggestProviders() throws Throwable {
+        if (!hasJmods()) return;
+
+        List<String> output =
+            JLink.run("--module-path", MODULE_PATH,
+                      "--add-modules", "m1",
+                      "--bind-services",
+                      "--limit-modules", "m1,m2,m3,java.base",
+                      "--suggest-providers").output();
+
+        String expected = "--bind-services option is specified. No additional providers suggested.";
+        assertTrue(output.contains(expected));
+
+    }
+
+    static class JLink {
+        static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink")
+            .orElseThrow(() ->
+                new RuntimeException("jlink tool not found")
+            );
+
+        static JLink run(String... options) {
+            JLink jlink = new JLink();
+            assertTrue(jlink.execute(options) == 0);
+            return jlink;
+        }
+
+        final List<String> output = new ArrayList<>();
+        private int execute(String... options) {
+            System.out.println("jlink " +
+                Stream.of(options).collect(Collectors.joining(" ")));
+
+            StringWriter writer = new StringWriter();
+            PrintWriter pw = new PrintWriter(writer);
+            int rc = JLINK_TOOL.run(pw, pw, options);
+            System.out.println(writer.toString());
+            Stream.of(writer.toString().split("\\v"))
+                  .map(String::trim)
+                  .forEach(output::add);
+            return rc;
+        }
+
+        boolean contains(String s) {
+            return output.contains(s);
+        }
+
+        List<String> output() {
+            return output;
+        }
+    }
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m1/module-info.java b/jdk/test/tools/jlink/bindservices/src/m1/module-info.java
new file mode 100644
index 0000000..59ebbe8
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m1/module-info.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m1 {
+    exports p1;
+    uses p1.S;
+    provides p1.S with p1.Impl;
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m1/p1/Impl.java b/jdk/test/tools/jlink/bindservices/src/m1/p1/Impl.java
new file mode 100644
index 0000000..b03f4e5
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m1/p1/Impl.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p1;
+
+public class Impl implements S {
+    public String name() {
+        return this.getClass().getName();
+    }
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m1/p1/Main.java b/jdk/test/tools/jlink/bindservices/src/m1/p1/Main.java
new file mode 100644
index 0000000..d3a07ed
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m1/p1/Main.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package p1;
+
+import java.lang.module.ModuleFinder;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * This tests if JAVA_HOME is linked only with the specified modules.
+ */
+public class Main {
+    public static void main(String... args) {
+        Set<String> modules = ModuleFinder.ofSystem().findAll().stream()
+            .map(mref -> mref.descriptor().name())
+            .filter(mn -> !mn.equals("java.base"))
+            .collect(Collectors.toSet());
+
+        Set<String> notLinked = Stream.of(args).filter(mn -> !modules.contains(mn))
+                                      .collect(Collectors.toSet());
+        if (!notLinked.isEmpty()) {
+            throw new RuntimeException("Expected modules not linked in the image: "
+                + notLinked);
+        }
+        Stream.of(args).forEach(modules::remove);
+
+        if (!modules.isEmpty()) {
+            throw new RuntimeException("Unexpected modules linked in the image: "
+                + modules);
+        }
+    }
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m1/p1/S.java b/jdk/test/tools/jlink/bindservices/src/m1/p1/S.java
new file mode 100644
index 0000000..5b43138
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m1/p1/S.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p1;
+
+public interface S {
+    String name();
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m2/module-info.java b/jdk/test/tools/jlink/bindservices/src/m2/module-info.java
new file mode 100644
index 0000000..c32e334
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m2/module-info.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m2 {
+    requires m1;
+    exports p2;
+    uses p2.T;
+    provides p1.S with p2.Impl;
+    provides p2.T with p2.Impl;
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m2/p2/Impl.java b/jdk/test/tools/jlink/bindservices/src/m2/p2/Impl.java
new file mode 100644
index 0000000..d790e9e
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m2/p2/Impl.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p2;
+
+public class Impl implements p1.S, T {
+    public String name() {
+        return this.getClass().getName();
+    }
+
+    public void run() {
+    }
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m2/p2/T.java b/jdk/test/tools/jlink/bindservices/src/m2/p2/T.java
new file mode 100644
index 0000000..dea3050
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m2/p2/T.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p2;
+
+public interface T {
+    void run();
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m3/module-info.java b/jdk/test/tools/jlink/bindservices/src/m3/module-info.java
new file mode 100644
index 0000000..e487692
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m3/module-info.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m3 {
+    requires m2;
+    provides p2.T with p3.Impl;
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m3/p3/Impl.java b/jdk/test/tools/jlink/bindservices/src/m3/p3/Impl.java
new file mode 100644
index 0000000..4d328cd
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m3/p3/Impl.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p3;
+
+public class Impl implements p2.T {
+    public void run() {
+    }
+}
diff --git a/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java b/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java
index 874f5ea..a61f592 100644
--- a/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java
+++ b/jdk/test/tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,16 +26,15 @@
  * @bug 8156499
  * @summary Test image creation from Multi-Release JAR
  * @author Steve Drach
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules java.base/jdk.internal.jimage
  *          java.base/jdk.internal.module
- * @build jdk.testlibrary.FileUtils jdk.test.lib.process.*
+ * @build jdk.test.lib.process.*
  * @run testng JLinkMultiReleaseJarTest
 */
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.io.UncheckedIOException;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
@@ -54,10 +53,8 @@
 import jdk.internal.jimage.BasicImageReader;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.testlibrary.FileUtils;
 
 import org.testng.Assert;
-import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
@@ -138,23 +135,6 @@
         Assert.assertEquals(rc, 0);
     }
 
-    @AfterClass
-    public void close() throws IOException {
-        Files.walk(userdir, 1)
-                .filter(p -> !p.equals(userdir))
-                .forEach(p -> {
-                    try {
-                        if (Files.isDirectory(p)) {
-                            FileUtils.deleteFileTreeWithRetry(p);
-                        } else {
-                            FileUtils.deleteFileIfExistsWithRetry(p);
-                        }
-                    } catch (IOException x) {
-                        throw new UncheckedIOException(x);
-                    }
-                });
-    }
-
     @Test
     public void basicTest() throws Throwable {
         if (ignoreTest()) return;
diff --git a/jdk/test/tools/jlink/plugins/CompressorPluginTest.java b/jdk/test/tools/jlink/plugins/CompressorPluginTest.java
index aea5c21..dbed1a7 100644
--- a/jdk/test/tools/jlink/plugins/CompressorPluginTest.java
+++ b/jdk/test/tools/jlink/plugins/CompressorPluginTest.java
@@ -93,80 +93,53 @@
                 new ResourceDecompressorFactory[]{
                     new StringSharingDecompressorFactory()});
 
-        // compress == ZIP + String sharing
-        Properties options = new Properties();
-        options.setProperty(ZipPlugin.NAME, "");
-        checkCompress(classes, new DefaultCompressPlugin(), options,
+        // compress level 0 == no compression
+        Properties options0 = new Properties();
+        options0.setProperty(DefaultCompressPlugin.NAME,
+                "0");
+        checkCompress(classes, new DefaultCompressPlugin(),
+                options0,
                 new ResourceDecompressorFactory[]{
-                    new ZipDecompressorFactory(),
-                    new StringSharingDecompressorFactory()
                 });
 
-        // compress == ZIP + String sharing + filter
-        options.setProperty(DefaultCompressPlugin.FILTER,
-                "**Exception.class");
-        checkCompress(classes, new DefaultCompressPlugin(), options,
-                new ResourceDecompressorFactory[]{
-                    new ZipDecompressorFactory(),
-                    new StringSharingDecompressorFactory()
-                }, Collections.singletonList(".*Exception.class"));
-
-        // compress level 1 == ZIP
+        // compress level 1 == String sharing
         Properties options1 = new Properties();
-        options1.setProperty(DefaultCompressPlugin.NAME,
-                "1");
+        options1.setProperty(DefaultCompressPlugin.NAME, "1");
         checkCompress(classes, new DefaultCompressPlugin(),
                 options1,
                 new ResourceDecompressorFactory[]{
-                    new ZipDecompressorFactory()
+                    new StringSharingDecompressorFactory()
                 });
 
-        // compress level 1 == ZIP
+        // compress level 1 == String sharing + filter
         options1.setProperty(DefaultCompressPlugin.FILTER,
                 "**Exception.class");
+        options1.setProperty(DefaultCompressPlugin.NAME, "1");
         checkCompress(classes, new DefaultCompressPlugin(),
                 options1,
                 new ResourceDecompressorFactory[]{
+                    new StringSharingDecompressorFactory()
+                }, Collections.singletonList(".*Exception.class"));
+
+        // compress level 2 == ZIP
+        Properties options2 = new Properties();
+        options2.setProperty(DefaultCompressPlugin.FILTER,
+                "**Exception.class");
+        options2.setProperty(DefaultCompressPlugin.NAME, "2");
+        checkCompress(classes, new DefaultCompressPlugin(),
+                options2,
+                new ResourceDecompressorFactory[]{
                     new ZipDecompressorFactory()
                 }, Collections.singletonList(".*Exception.class"));
 
-        // compress level 2 == ZIP + String sharing
-        Properties options2 = new Properties();
-        options2.setProperty(DefaultCompressPlugin.NAME,
-                "2");
-        checkCompress(classes, new DefaultCompressPlugin(),
-                options2,
-                new ResourceDecompressorFactory[]{
-                    new ZipDecompressorFactory(),
-                    new StringSharingDecompressorFactory()
-                });
-
-        // compress level 2 == ZIP + String sharing + filter
+        // compress level 2 == ZIP + filter
         options2.setProperty(DefaultCompressPlugin.FILTER,
                 "**Exception.class");
+        options2.setProperty(DefaultCompressPlugin.NAME, "2");
         checkCompress(classes, new DefaultCompressPlugin(),
                 options2,
                 new ResourceDecompressorFactory[]{
                     new ZipDecompressorFactory(),
-                    new StringSharingDecompressorFactory()
-                }, Collections.singletonList(".*Exception.class"));
-
-        // compress level 0 == String sharing
-        Properties options0 = new Properties();
-        options0.setProperty(DefaultCompressPlugin.NAME, "0");
-        checkCompress(classes, new DefaultCompressPlugin(),
-                options0,
-                new ResourceDecompressorFactory[]{
-                    new StringSharingDecompressorFactory()
-                });
-
-        // compress level 0 == String sharing + filter
-        options0.setProperty(DefaultCompressPlugin.FILTER,
-                "**Exception.class");
-        checkCompress(classes, new DefaultCompressPlugin(),
-                options0,
-                new ResourceDecompressorFactory[]{
-                    new StringSharingDecompressorFactory()
                 }, Collections.singletonList(".*Exception.class"));
     }
 
@@ -234,6 +207,11 @@
             Properties config,
             ResourceDecompressorFactory[] factories,
             List<String> includes) throws Exception {
+        if (factories.length == 0) {
+            // no compression, nothing to check!
+            return;
+        }
+
         long[] original = new long[1];
         long[] compressed = new long[1];
         resources.entries().forEach(resource -> {
diff --git a/jdk/test/tools/jlink/plugins/ExcludeVMPluginTest.java b/jdk/test/tools/jlink/plugins/ExcludeVMPluginTest.java
index f581e9b..ee4bfab 100644
--- a/jdk/test/tools/jlink/plugins/ExcludeVMPluginTest.java
+++ b/jdk/test/tools/jlink/plugins/ExcludeVMPluginTest.java
@@ -155,10 +155,10 @@
             String[] winput = new String[input.length];
             String[] woutput = new String[expectedOutput.length];
             for (int i = 0; i < input.length; i++) {
-                winput[i] = "/java.base/native" + arch + input[i];
+                winput[i] = "/java.base/lib" + arch + input[i];
             }
             for (int i = 0; i < expectedOutput.length; i++) {
-                woutput[i] = "/java.base/native" + arch + expectedOutput[i];
+                woutput[i] = "/java.base/lib" + arch + expectedOutput[i];
             }
             doCheckVM(vm, winput, jvmcfg, woutput, expectdJvmCfg);
         }
@@ -169,7 +169,7 @@
         byte[] jvmcfgContent = jvmcfg.getBytes();
         ResourcePoolManager poolMgr = new ResourcePoolManager();
         poolMgr.add(
-            ResourcePoolEntry.create("/java.base/native/jvm.cfg",
+            ResourcePoolEntry.create("/java.base/lib/jvm.cfg",
                 ResourcePoolEntry.Type.NATIVE_LIB, jvmcfgContent));
 
         // java.base/module-info.class is used by exclude vm plugin
@@ -192,7 +192,7 @@
         p.configure(config);
         ResourcePool out = p.transform(poolMgr.resourcePool(), outMgr.resourcePoolBuilder());
 
-        String newContent = new String(out.findEntry("/java.base/native/jvm.cfg").get().contentBytes());
+        String newContent = new String(out.findEntry("/java.base/lib/jvm.cfg").get().contentBytes());
 
         if (!expectdJvmCfg.equals(newContent)) {
             throw new Exception("Got content " + newContent + " expected " + expectdJvmCfg);
@@ -209,7 +209,7 @@
         }
 
         out.entries().forEach(md -> {
-            if (md.path().equals("/java.base/native/jvm.cfg") ||
+            if (md.path().equals("/java.base/lib/jvm.cfg") ||
                 md.path().equals("/java.base/module-info.class")) {
                 return;
             }
diff --git a/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java b/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java
index 6119fe4..17ae87e 100644
--- a/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java
+++ b/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java
@@ -30,7 +30,6 @@
  *          jdk.jlink/jdk.tools.jlink.plugin
  * @run main/othervm PluginsNegativeTest
  */
-import java.lang.reflect.Layer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -63,7 +62,7 @@
 
     private void testDuplicateBuiltInProviders() {
         List<Plugin> javaPlugins = new ArrayList<>();
-        javaPlugins.addAll(PluginRepository.getPlugins(Layer.boot()));
+        javaPlugins.addAll(PluginRepository.getPlugins(ModuleLayer.boot()));
         for (Plugin javaPlugin : javaPlugins) {
             System.out.println("Registered plugin: " + javaPlugin.getName());
         }
@@ -72,7 +71,7 @@
             try {
                 PluginRepository.registerPlugin(new CustomPlugin(pluginName));
                 try {
-                    PluginRepository.getPlugin(pluginName, Layer.boot());
+                    PluginRepository.getPlugin(pluginName, ModuleLayer.boot());
                     throw new AssertionError("Exception is not thrown for duplicate plugin: " + pluginName);
                 } catch (Exception ignored) {
                 }
@@ -83,7 +82,7 @@
     }
 
     private void testUnknownProvider() {
-        if (PluginRepository.getPlugin("unknown", Layer.boot()) != null) {
+        if (PluginRepository.getPlugin("unknown", ModuleLayer.boot()) != null) {
             throw new AssertionError("Exception expected for unknown plugin name");
         }
     }
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java
index fb7f556..36f82a9 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java
@@ -81,9 +81,13 @@
             Path msrc = SRC_DIR.resolve(mn);
             if (version.equals("0")) {
                 assertTrue(CompilerUtils.compile(msrc, MODS_DIR,
+                    "--add-exports", "java.base/jdk.internal.module=m1",
+                    "--add-exports", "java.base/jdk.internal.org.objectweb.asm=m1",
                     "--module-source-path", SRC_DIR.toString()));
             } else {
                 assertTrue(CompilerUtils.compile(msrc, MODS_DIR,
+                    "--add-exports", "java.base/jdk.internal.module=m1",
+                    "--add-exports", "java.base/jdk.internal.org.objectweb.asm=m1",
                     "--module-source-path", SRC_DIR.toString(),
                     "--module-version", version));
             }
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java
index ce25cd7..b2d6d9b 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java
@@ -25,6 +25,8 @@
 import java.lang.module.ModuleDescriptor.*;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReference;
+import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -40,7 +42,11 @@
 /**
  * @test
  * @bug 8142968 8173381
+ * @library /lib/testlibrary
  * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.module
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ * @build ModuleTargetHelper
  * @run testng SystemModulesTest
  * @summary Verify the properties of ModuleDescriptor created
  *          by SystemModules
@@ -62,7 +68,6 @@
             return;
 
         ModuleFinder.ofSystem().findAll().stream()
-                    .map(ModuleReference::descriptor)
                     .forEach(this::checkAttributes);
     }
 
@@ -72,9 +77,7 @@
         if (name.equals(OS_NAME))
             return true;
 
-        if (OS_NAME.equals("Mac OS X")) {
-            return name.equals("Darwin");
-        } else if (OS_NAME.startsWith("Windows")) {
+        if (OS_NAME.startsWith("Windows")) {
             return name.startsWith("Windows");
         } else {
             System.err.println("ERROR: " + name + " but expected: " + OS_NAME);
@@ -89,28 +92,28 @@
         switch (OS_ARCH) {
             case "i386":
             case "x86":
-                return name.equals("i586");
+                return name.equals("x86");
+            case "amd64":
+                return name.equals("x86_64");
             default:
                 System.err.println("ERROR: " + name + " but expected: " + OS_ARCH);
                 return false;
         }
     }
 
-    private void checkAttributes(ModuleDescriptor md) {
-        System.out.format("%s %s %s %s%n", md.name(),
-                          md.osName(), md.osArch(), md.osVersion());
-
-        if (md.name().equals("java.base")) {
-            assertTrue(checkOSName(md.osName().get()));
-            assertTrue(checkOSArch(md.osArch().get()));
-            assertTrue(md.osVersion().isPresent());
-        } else {
-            // target platform attribute is dropped by jlink plugin
-            assertFalse(md.osName().isPresent());
-            assertFalse(md.osArch().isPresent());
-            assertFalse(md.osVersion().isPresent());
-            assertTrue(md.packages().size() > 0
-                || EMPTY_MODULES.contains(md.name()), md.name());
+    private void checkAttributes(ModuleReference modRef) {
+        try {
+            if (modRef.descriptor().name().equals("java.base")) {
+                ModuleTargetHelper.ModuleTarget mt = ModuleTargetHelper.read(modRef);
+                assertTrue(checkOSName(mt.osName()));
+                assertTrue(checkOSArch(mt.osArch()));
+            } else {
+                // target platform attribute is dropped by jlink plugin for other modules
+                ModuleTargetHelper.ModuleTarget mt = ModuleTargetHelper.read(modRef);
+                assertTrue(mt == null || (mt.osName() == null && mt.osArch() == null));
+            }
+        } catch (IOException exp) {
+            throw new UncheckedIOException(exp);
         }
     }
 
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java
index 3c58d2a..ecdebe5 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
 import java.io.File;
 import java.io.IOException;
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -38,17 +37,18 @@
 
 import static jdk.testlibrary.ProcessTools.*;
 
-
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
 /**
  * @test
- * @bug 8142968 8173381
+ * @bug 8142968 8173381 8174740
  * @library /lib/testlibrary
  * @modules jdk.compiler jdk.jlink
- * @build UserModuleTest CompilerUtils jdk.testlibrary.FileUtils jdk.testlibrary.ProcessTools
+ * @modules java.base/jdk.internal.module
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ * @build ModuleTargetHelper UserModuleTest CompilerUtils jdk.testlibrary.FileUtils jdk.testlibrary.ProcessTools
  * @run testng UserModuleTest
  */
 
@@ -64,7 +64,7 @@
     private static final String MAIN_MID = "m1/p1.Main";
 
     // the names of the modules in this test
-    private static String[] modules = new String[] {"m1", "m2", "m3", "m4"};
+    private static String[] modules = new String[] {"m1", "m2", "m3", "m4", "m5"};
 
 
     private static boolean hasJmods() {
@@ -85,7 +85,9 @@
         for (String mn : modules) {
             Path msrc = SRC_DIR.resolve(mn);
             assertTrue(CompilerUtils.compile(msrc, MODS_DIR,
-                "--module-source-path", SRC_DIR.toString()));
+                "--module-source-path", SRC_DIR.toString(),
+                "--add-exports", "java.base/jdk.internal.module=" + mn,
+                "--add-exports", "java.base/jdk.internal.org.objectweb.asm=" + mn));
         }
 
         if (Files.exists(IMAGE)) {
@@ -106,7 +108,10 @@
         if (!hasJmods()) return;
 
         Path java = IMAGE.resolve("bin").resolve("java");
-        assertTrue(executeProcess(java.toString(), "-m", MAIN_MID)
+        assertTrue(executeProcess(java.toString(),
+                        "--add-exports", "java.base/jdk.internal.module=m1,m4",
+                        "--add-exports", "java.base/jdk.internal.org.objectweb.asm=m1,m4",
+                        "-m", MAIN_MID)
                         .outputTo(System.out)
                         .errorTo(System.out)
                         .getExitValue() == 0);
@@ -136,6 +141,8 @@
 
         Path java = IMAGE.resolve("bin").resolve("java");
         assertTrue(executeProcess(java.toString(),
+                                  "--add-exports", "java.base/jdk.internal.module=m1,m4",
+                                  "--add-exports", "java.base/jdk.internal.org.objectweb.asm=m1,m4",
                                   "-Djdk.system.module.finder.disabledFastPath",
                                   "-m", MAIN_MID)
                         .outputTo(System.out)
@@ -154,18 +161,67 @@
         Path dir = Paths.get("dedupSetTest");
         createImage(dir, "m1", "m2", "m3", "m4");
         Path java = dir.resolve("bin").resolve("java");
-        assertTrue(executeProcess(java.toString(), "-m", MAIN_MID)
+        assertTrue(executeProcess(java.toString(),
+                         "--add-exports", "java.base/jdk.internal.module=m1,m4",
+                         "--add-exports", "java.base/jdk.internal.org.objectweb.asm=m1,m4",
+                         "-m", MAIN_MID)
+                        .outputTo(System.out)
+                        .errorTo(System.out)
+                        .getExitValue() == 0);
+    }
+
+    @Test
+    public void testRequiresStatic() throws Throwable {
+        if (!hasJmods()) return;
+
+        Path dir = Paths.get("requiresStatic");
+        createImage(dir, "m5");
+        Path java = dir.resolve("bin").resolve("java");
+        assertTrue(executeProcess(java.toString(), "-m", "m5/p5.Main")
+                        .outputTo(System.out)
+                        .errorTo(System.out)
+                        .getExitValue() == 0);
+
+        // run with m3 present
+        assertTrue(executeProcess(java.toString(),
+                                  "--module-path", MODS_DIR.toString(),
+                                  "--add-modules", "m3",
+                                  "-m", "m5/p5.Main")
+                        .outputTo(System.out)
+                        .errorTo(System.out)
+                        .getExitValue() == 0);
+    }
+
+    @Test
+    public void testRequiresStatic2() throws Throwable {
+        if (!hasJmods()) return;
+
+        Path dir = Paths.get("requiresStatic2");
+        createImage(dir, "m3", "m5");
+
+        Path java = dir.resolve("bin").resolve("java");
+        assertTrue(executeProcess(java.toString(), "-m", "m5/p5.Main")
+                        .outputTo(System.out)
+                        .errorTo(System.out)
+                        .getExitValue() == 0);
+
+        // boot layer with m3 and m5
+        assertTrue(executeProcess(java.toString(),
+                                  "--add-modules", "m3",
+                                  "-m", "m5/p5.Main")
                         .outputTo(System.out)
                         .errorTo(System.out)
                         .getExitValue() == 0);
     }
 
     private void createJmods(String... modules) throws IOException {
-        // use the same target platform as in java.base
-        ModuleDescriptor md = Layer.boot().findModule("java.base").get()
-                                   .getDescriptor();
-        String osName = md.osName().get();
-        String osArch = md.osArch().get();
+        ModuleTargetHelper.ModuleTarget mt = ModuleTargetHelper.getJavaBaseTarget();
+        if (mt == null) {
+            throw new RuntimeException("ModuleTarget is missing for java.base");
+        }
+
+        String osName = mt.osName();
+        String osArch = mt.osArch();
 
         // create JMOD files
         Files.createDirectories(JMODS_DIR);
@@ -202,6 +258,8 @@
         // verify ModuleDescriptor
         Path java = dir.resolve("bin").resolve("java");
         assertTrue(executeProcess(java.toString(),
+                        "--add-exports", "java.base/jdk.internal.module=m1,m4",
+                        "--add-exports", "java.base/jdk.internal.org.objectweb.asm=m1,m4",
                         "--add-modules=m1", "-m", "m4")
             .outputTo(System.out)
             .errorTo(System.out)
@@ -231,6 +289,8 @@
         // verify ModuleDescriptor
         Path java = dir.resolve("bin").resolve("java");
         assertTrue(executeProcess(java.toString(),
+                        "--add-exports", "java.base/jdk.internal.module=m1,m4",
+                        "--add-exports", "java.base/jdk.internal.org.objectweb.asm=m1,m4",
                         "--add-modules=m1", "-m", "m4", "retainModuleTarget")
             .outputTo(System.out)
             .errorTo(System.out)
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/module-info.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/module-info.java
index f6ecf6b..870680b 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/module-info.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/module-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,5 +21,9 @@
  * questions.
  */
 
+/*
+ * m1 has an exported package and also internal package
+ */
 module m1 {
+    exports p1;
 }
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/p1/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/p1/Main.java
index 4b4bf35..aef19f5 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/p1/Main.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/p1/Main.java
@@ -23,10 +23,9 @@
 
 package p1;
 
+import java.io.InputStream;
 import java.io.IOException;
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.net.URI;
 import java.nio.file.FileSystem;
 import java.nio.file.FileSystems;
@@ -35,7 +34,38 @@
 import java.util.Collections;
 import java.util.Set;
 
+import jdk.internal.module.ClassFileAttributes;
+import jdk.internal.module.ClassFileAttributes.ModuleTargetAttribute;
+import jdk.internal.module.ClassFileConstants;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
 public class Main {
+    private static boolean hasModuleTarget(InputStream in) throws IOException {
+        ModuleTargetAttribute[] modTargets = new ModuleTargetAttribute[1];
+        ClassVisitor cv = new ClassVisitor(Opcodes.ASM5) {
+            @Override
+            public void visitAttribute(Attribute attr) {
+                if (attr instanceof ModuleTargetAttribute) {
+                    modTargets[0] = (ModuleTargetAttribute)attr;
+                }
+            }
+        };
+
+        // prototype of attributes that should be parsed
+        Attribute[] attrs = new Attribute[] {
+            new ModuleTargetAttribute()
+        };
+
+        // parse module-info.class
+        ClassReader cr = new ClassReader(in);
+        cr.accept(cv, attrs, 0);
+        return modTargets[0] != null &&
+            (modTargets[0].osName() != null || modTargets[0].osArch() != null);
+    }
+
     public static void main(String... args) throws Exception {
         // load another package
         p2.T.test();
@@ -44,12 +74,13 @@
         validate(Main.class.getModule());
 
         // validate the Moduletarget attribute for java.base
-        ModuleDescriptor md = Layer.boot().findModule("java.base").get()
-                                   .getDescriptor();
-        if (!md.osName().isPresent() || !md.osArch().isPresent() ||
-                !md.osVersion().isPresent()) {
-            throw new RuntimeException("java.base: " + md.osName() + " " +
-                    md.osArch() + " " + md.osVersion());
+        FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"),
+                                                  Collections.emptyMap());
+        Path path = fs.getPath("/", "modules", "java.base", "module-info.class");
+        try (InputStream in = Files.newInputStream(path)) {
+            if (! hasModuleTarget(in)) {
+                throw new RuntimeException("Missing ModuleTarget for java.base");
+            }
         }
     }
 
@@ -67,9 +98,9 @@
         checkPackages(md.packages(), "p1", "p2");
         checkPackages(md1.packages(), "p1", "p2");
 
-        // check ModuleTarget attribute
-        checkModuleTargetAttribute(md);
-        checkModuleTargetAttribute(md1);
+        try (InputStream in = Files.newInputStream(path)) {
+            checkModuleTargetAttribute(in, "p1");
+        }
     }
 
     static void checkPackages(Set<String> pkgs, String... expected) {
@@ -78,10 +109,9 @@
         }
     }
 
-    static void checkModuleTargetAttribute(ModuleDescriptor md) {
-        if (md.osName().isPresent() || md.osArch().isPresent() ||
-                md.osVersion().isPresent()) {
-            throw new RuntimeException(md.osName() + " " + md.osArch() + " " + md.osVersion());
+    static void checkModuleTargetAttribute(InputStream in, String modName) throws IOException {
+        if (hasModuleTarget(in)) {
+            throw new RuntimeException("ModuleTarget present for " + modName);
         }
     }
 }
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/module-info.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/module-info.java
index c2e7fb6..69e08be 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/module-info.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/module-info.java
@@ -23,4 +23,5 @@
 
 module m3 {
     requires m4;
+    exports p3;
 }
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Foo.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Foo.java
new file mode 100644
index 0000000..07a7f51
--- /dev/null
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Foo.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p3;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Documented
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.SOURCE)
+public @interface Foo {
+}
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Lib.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Lib.java
new file mode 100644
index 0000000..7a8ad28
--- /dev/null
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Lib.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p3;
+
+public class Lib {
+    public static String concat(String x, String y) {
+        return x + y;
+    }
+}
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Main.java
index c7ff38e..aa7563e 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Main.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Main.java
@@ -26,7 +26,6 @@
 import p4.Foo;
 import java.lang.module.ModuleDescriptor;
 import java.lang.reflect.Field;
-import java.lang.reflect.Module;
 
 import static java.lang.module.ModuleDescriptor.Exports.Modifier.*;
 
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m4/p4/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m4/p4/Main.java
index d4ca677..a08fe01 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m4/p4/Main.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m4/p4/Main.java
@@ -27,7 +27,6 @@
 import java.io.InputStream;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
 import java.net.URI;
 import java.nio.file.FileSystem;
 import java.nio.file.FileSystems;
@@ -36,7 +35,47 @@
 import java.util.Collections;
 import java.util.Set;
 
+import jdk.internal.module.ClassFileAttributes;
+import jdk.internal.module.ClassFileAttributes.ModuleTargetAttribute;
+import jdk.internal.module.ClassFileConstants;
+import jdk.internal.org.objectweb.asm.Attribute;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
 public class Main {
+    private static boolean hasModuleTarget(InputStream in) throws IOException {
+        ModuleTargetAttribute[] modTargets = new ModuleTargetAttribute[1];
+        ClassVisitor cv = new ClassVisitor(Opcodes.ASM5) {
+            @Override
+            public void visitAttribute(Attribute attr) {
+                if (attr instanceof ModuleTargetAttribute) {
+                    modTargets[0] = (ModuleTargetAttribute)attr;
+                }
+            }
+        };
+
+        // prototype of attributes that should be parsed
+        Attribute[] attrs = new Attribute[] {
+            new ModuleTargetAttribute()
+        };
+
+        // parse module-info.class
+        ClassReader cr = new ClassReader(in);
+        cr.accept(cv, attrs, 0);
+        return modTargets[0] != null &&
+            (modTargets[0].osName() != null || modTargets[0].osArch() != null);
+    }
+
+    private static boolean hasModuleTarget(String modName) throws IOException {
+        FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"),
+                                                  Collections.emptyMap());
+        Path path = fs.getPath("/", "modules", modName, "module-info.class");
+        try (InputStream in = Files.newInputStream(path)) {
+            return hasModuleTarget(in);
+        }
+    }
+
     // the system module plugin by default drops ModuleTarget attribute
     private static boolean expectModuleTarget = false;
     public static void main(String... args) throws IOException {
@@ -49,13 +88,8 @@
         }
 
         // java.base is packaged with osName/osArch/osVersion
-        ModuleDescriptor md = Layer.boot().findModule("java.base").get()
-                                   .getDescriptor();
-        if (!md.osName().isPresent() ||
-                !md.osArch().isPresent() ||
-                !md.osVersion().isPresent()) {
-            throw new RuntimeException("osName/osArch/osVersion is missing: " +
-                md.osName() + " " + md.osArch() + " " + md.osVersion());
+        if (! hasModuleTarget("java.base")) {
+            throw new RuntimeException("ModuleTarget absent for java.base");
         }
 
         // verify module-info.class for m1 and m4
@@ -65,7 +99,7 @@
 
     private static void checkModule(String mn, String... packages) throws IOException {
         // verify ModuleDescriptor from the runtime module
-        ModuleDescriptor md = Layer.boot().findModule(mn).get()
+        ModuleDescriptor md = ModuleLayer.boot().findModule(mn).get()
                                    .getDescriptor();
         checkModuleDescriptor(md, packages);
 
@@ -82,7 +116,7 @@
         checkModuleDescriptor(ModuleDescriptor.read(Files.newInputStream(path)), packages);
     }
 
-    static void checkModuleDescriptor(ModuleDescriptor md, String... packages) {
+    static void checkModuleDescriptor(ModuleDescriptor md, String... packages) throws IOException {
         String mainClass = md.name().replace('m', 'p') + ".Main";
         if (!md.mainClass().get().equals(mainClass)) {
             throw new RuntimeException(md.mainClass().toString());
@@ -90,22 +124,16 @@
 
         if (expectModuleTarget) {
             // ModuleTarget attribute is retained
-            if (!md.osName().isPresent() || !md.osArch().isPresent()) {
-                throw new RuntimeException("osName or osArch is missing: " +
-                    md.osName() + " " + md.osArch());
+            if (! hasModuleTarget(md.name())) {
+                throw new RuntimeException("ModuleTarget missing for " + md.name());
             }
         } else {
             // by default ModuleTarget attribute is dropped
-            if (md.osName().isPresent() || md.osArch().isPresent()) {
-                throw new RuntimeException("osName and osArch should not be set: " +
-                    md.osName() + " " + md.osArch());
+            if (hasModuleTarget(md.name())) {
+                throw new RuntimeException("ModuleTarget present for " + md.name());
             }
         }
 
-        if (md.osVersion().isPresent()) {
-            throw new RuntimeException("Expected no osVersion set: " + md.osVersion());
-        }
-
         Set<String> pkgs = md.packages();
         if (!pkgs.equals(Set.of(packages))) {
             throw new RuntimeException(pkgs + " expected: " + Set.of(packages));
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/module-info.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/module-info.java
new file mode 100644
index 0000000..ce1d369
--- /dev/null
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/module-info.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m5 {
+    requires static m3;
+    exports p5;
+}
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/p5/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/p5/Main.java
new file mode 100644
index 0000000..f0f46e6
--- /dev/null
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/p5/Main.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p5;
+
+import p3.Foo;
+import p3.Lib;
+
+/**
+ * This test verifies jlink support of requires static.
+ */
+public class Main {
+    public static void main(String... args) {
+        boolean libPresent = ModuleLayer.boot().findModule("m3").isPresent();
+        if (LibHelper.libClassFound != libPresent) {
+            throw new RuntimeException("Expected module m3 not in the boot layer");
+        }
+
+        if (libPresent) {
+            // p3.Lib must be present
+            LibHelper.concat("x", "y");
+        }
+    }
+
+    static class LibHelper {
+        @Foo
+        static final boolean libClassFound;
+
+        static {
+            boolean found = false;
+            try {
+                Class<?> c = Class.forName("p3.Lib");
+                found = true;
+            } catch (ClassNotFoundException e) {
+            }
+            libClassFound = found;
+        }
+
+        public static String concat(String x, String y) {
+            return Lib.concat(x, y);
+        }
+    }
+}
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/test/jdk/test/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/test/jdk/test/Main.java
index e5c6fe8..d7f3658 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/test/jdk/test/Main.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/test/jdk/test/Main.java
@@ -24,8 +24,6 @@
 package jdk.test;
 
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.net.URI;
 import java.nio.file.FileSystem;
 import java.nio.file.FileSystems;
@@ -65,7 +63,7 @@
         // check the module descriptor of a system module
         for (int i=0; i < modules.size(); i++) {
             String mn = modules.get(i);
-            Module module = Layer.boot().findModule(mn).orElseThrow(
+            Module module = ModuleLayer.boot().findModule(mn).orElseThrow(
                 () -> new RuntimeException(mn + " not found")
             );
 
diff --git a/jdk/test/tools/jmod/JmodTest.java b/jdk/test/tools/jmod/JmodTest.java
index 27dc839..0439678 100644
--- a/jdk/test/tools/jmod/JmodTest.java
+++ b/jdk/test/tools/jmod/JmodTest.java
@@ -66,7 +66,7 @@
 
     static final String CLASSES_PREFIX = "classes/";
     static final String CMDS_PREFIX = "bin/";
-    static final String LIBS_PREFIX = "native/";
+    static final String LIBS_PREFIX = "lib/";
     static final String CONFIGS_PREFIX = "conf/";
 
     @BeforeTest
diff --git a/jdk/test/tools/jmod/hashes/HashesTest.java b/jdk/test/tools/jmod/hashes/HashesTest.java
index 3700554..1068092 100644
--- a/jdk/test/tools/jmod/hashes/HashesTest.java
+++ b/jdk/test/tools/jmod/hashes/HashesTest.java
@@ -312,9 +312,7 @@
         assertTrue(ht.hashes("m2") == null);
 
         // should not override any JDK packaged modules
-        ModuleFinder finder = new ModulePath(Runtime.version(),
-                                             true,
-                                             mpath);
+        ModuleFinder finder = ModulePath.of(Runtime.version(), true, mpath);
         assertTrue(ht.hashes(finder,"jdk.compiler") == null);
         assertTrue(ht.hashes(finder,"jdk.attach") == null);
     }
@@ -325,9 +323,7 @@
     }
 
     private ModuleHashes hashes(String name) {
-        ModuleFinder finder = new ModulePath(Runtime.version(),
-                                             true,
-                                             lib);
+        ModuleFinder finder = ModulePath.of(Runtime.version(), true, lib);
         return hashes(finder, name);
     }
 
diff --git a/jdk/test/tools/launcher/ArgsEnvVar.java b/jdk/test/tools/launcher/ArgsEnvVar.java
index 30644e1..fe18e1d 100644
--- a/jdk/test/tools/launcher/ArgsEnvVar.java
+++ b/jdk/test/tools/launcher/ArgsEnvVar.java
@@ -40,7 +40,7 @@
     private static File testJar = null;
     private static Map<String, String> env = new HashMap<>();
 
-    private static String JAVA_OPTIONS = "JAVA_OPTIONS";
+    private static String JDK_JAVA_OPTIONS = "JDK_JAVA_OPTIONS";
 
     static void init() throws IOException {
         if  (testJar != null) {
@@ -105,7 +105,7 @@
         File argFile2 = createArgFile("argFile2", List.of("-Darg.file2=TWO"));
         File argFile3 = createArgFile("argFile3", List.of("-Darg.file3=THREE"));
 
-        env.put(JAVA_OPTIONS, "@argFile1\n-Xint\r-cp @@escaped\t@argFile2");
+        env.put(JDK_JAVA_OPTIONS, "@argFile1\n-Xint\r-cp @@escaped\t@argFile2");
 
         TestResult tr = doExec(env, javaCmd, "@argFile3", "-cp", "test.jar", "Foo", "uarg1", "@uarg2");
 
@@ -133,13 +133,13 @@
     }
 
     private TestResult testInEnv(List<String> options) {
-        env.put(JAVA_OPTIONS, String.join(" ", options));
+        env.put(JDK_JAVA_OPTIONS, String.join(" ", options));
         return doExec(env, javaCmd, "-jar", "test.jar");
     }
 
     private TestResult testInEnvAsArgFile(List<String> options) throws IOException {
         File argFile = createArgFile("argFile", options);
-        env.put(JAVA_OPTIONS, "@argFile");
+        env.put(JDK_JAVA_OPTIONS, "@argFile");
         TestResult tr = doExec(env, javaCmd, "-jar", "test.jar");
         argFile.delete();
         return tr;
@@ -187,7 +187,7 @@
         File argFile1 = createArgFile("arg File 1", List.of("-Xint"));
         File argFile2 = createArgFile("arg File 2", List.of("-Dprop='value with spaces'"));
         File argFile3 = createArgFile("arg File 3", List.of("-Xmx32m"));
-        env.put(JAVA_OPTIONS, "'@arg File 1' @\"arg File 2\" @'arg File'\" 3\"");
+        env.put(JDK_JAVA_OPTIONS, "'@arg File 1' @\"arg File 2\" @'arg File'\" 3\"");
 
         TestResult tr = doExec(env, javaCmd, "-jar", "test.jar");
         List<String> options = new ArrayList<>();
@@ -204,7 +204,7 @@
 
     @Test
     public void openQuoteShouldFail() {
-        env.put(JAVA_OPTIONS, "-Dprop='value missing close quote");
+        env.put(JDK_JAVA_OPTIONS, "-Dprop='value missing close quote");
         TestResult tr = doExec(env, javaCmd, "-version");
         tr.checkNegative();
         if (!tr.testStatus) {
@@ -215,11 +215,11 @@
 
     @Test
     public void noWildcard() {
-        env.put(JAVA_OPTIONS, "-cp *");
+        env.put(JDK_JAVA_OPTIONS, "-cp *");
         TestResult tr = doExec(env, javaCmd, "-jar", "test.jar");
         verifyOptions(List.of("-cp", "*", "-jar", "test.jar"), tr);
 
-        env.put(JAVA_OPTIONS, "-p ?");
+        env.put(JDK_JAVA_OPTIONS, "-p ?");
         tr = doExec(env, javaCmd, "-jar", "test.jar", "one", "two");
         verifyOptions(List.of("-p", "?", "-jar", "test.jar", "one", "two"), tr);
     }
diff --git a/jdk/test/tools/launcher/I18NArgTest.java b/jdk/test/tools/launcher/I18NArgTest.java
index 25f4ec1..fa09736 100644
--- a/jdk/test/tools/launcher/I18NArgTest.java
+++ b/jdk/test/tools/launcher/I18NArgTest.java
@@ -95,21 +95,19 @@
             throw new RuntimeException("test fails");
         }
 
-        // Test via JAVA_OPTIONS
-/*
+        // Test via JDK_JAVA_OPTIONS
         Map<String, String> env = new HashMap<>();
         String cmd = "-Dtest.src=" + TEST_SOURCES_DIR.getAbsolutePath() +
                 " -Dtest.classes=" + TEST_CLASSES_DIR.getAbsolutePath() +
                 " -cp " + TEST_CLASSES_DIR.getAbsolutePath() +
                 " I18NArgTest " + unicodeStr + " " + hexValue;
-        env.put("JAVA_OPTIONS", cmd);
+        env.put("JDK_JAVA_OPTIONS", cmd);
         tr = doExec(env, javaCmd);
         System.out.println(tr.testOutput);
         if (!tr.isOK()) {
             System.err.println(tr);
             throw new RuntimeException("test fails");
         }
-*/
     }
 
     static void testCharacters(String... args) {
diff --git a/jdk/test/tools/launcher/Jexec.java b/jdk/test/tools/launcher/Jexec.java
new file mode 100644
index 0000000..f2c9cfc
--- /dev/null
+++ b/jdk/test/tools/launcher/Jexec.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8175000
+ * @summary test jexec
+ * @build TestHelper
+ * @run main Jexec
+ */
+
+import java.io.File;
+import java.io.IOException;
+
+public class Jexec extends TestHelper {
+    private final File testJar;
+    private final File jexecCmd;
+    private final String message = "Hello, do you read me ?";
+
+    Jexec() throws IOException {
+        jexecCmd = new File(JAVA_LIB, "jexec");
+        if (!jexecCmd.exists() || !jexecCmd.canExecute()) {
+            throw new Error("jexec: does not exist or not executable");
+        }
+
+        testJar = new File("test.jar");
+        StringBuilder tsrc = new StringBuilder();
+        tsrc.append("public static void main(String... args) {\n");
+        tsrc.append("   for (String x : args) {\n");
+        tsrc.append("        System.out.println(x);\n");
+        tsrc.append("   }\n");
+        tsrc.append("}\n");
+        createJar(testJar, tsrc.toString());
+    }
+
+    public static void main(String... args) throws Exception {
+        // linux is the only supported platform, give the others a pass
+        if (!isLinux) {
+            System.err.println("Warning: unsupported platform test passes vacuously");
+            return;
+        }
+        // ok to run the test now
+        Jexec t = new Jexec();
+        t.run(null);
+    }
+
+    @Test
+    void jexec() throws Exception {
+        TestResult tr = doExec(jexecCmd.getAbsolutePath(),
+                testJar.getAbsolutePath(), message);
+        if (!tr.isOK()) {
+            System.err.println(tr);
+            throw new Exception("incorrect exit value");
+        }
+        if (!tr.contains(message)) {
+            System.err.println(tr);
+            throw new Exception("expected message \'" + message + "\' not found");
+        }
+    }
+}
diff --git a/jdk/test/tools/launcher/MainClassCantBeLoadedTest.java b/jdk/test/tools/launcher/MainClassCantBeLoadedTest.java
new file mode 100644
index 0000000..4469497
--- /dev/null
+++ b/jdk/test/tools/launcher/MainClassCantBeLoadedTest.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8174694
+ * @summary improve error message shown when main class can't be loaded
+ * @compile MainClassCantBeLoadedTest.java
+ * @run main MainClassCantBeLoadedTest
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class MainClassCantBeLoadedTest extends TestHelper {
+    private MainClassCantBeLoadedTest(){}
+
+    @Test
+    void testLoadingClassWithMissingSuper() throws Exception {
+        if (!isEnglishLocale()) {
+            return;
+        }
+
+        File cwd = new File(".");
+        File srcDir = new File(cwd, "src");
+        if (srcDir.exists()) {
+            recursiveDelete(srcDir);
+        }
+        srcDir.mkdirs();
+
+        /* we want to generate two classes A and B, where B is the superclass of A
+         * class A has a main method
+         */
+        ArrayList<String> scratchpad = new ArrayList<>();
+        scratchpad.add("public class A extends B {");
+        scratchpad.add("    public static void main(String... args) {}");
+        scratchpad.add("}");
+        createFile(new File(srcDir, "A.java"), scratchpad);
+
+        scratchpad.clear();
+        scratchpad.add("class B {}");
+        createFile(new File(srcDir, "B.java"), scratchpad);
+
+        // let's compile both
+        TestResult trCompilation = doExec(javacCmd,
+                "-d", "out",
+                new File(srcDir, "A.java").toString(),
+                new File(srcDir, "B.java").toString());
+        if (!trCompilation.isOK()) {
+            System.err.println(trCompilation);
+            throw new RuntimeException("Error: compiling");
+        }
+
+        // and now B is removed
+        File outDir = new File(cwd, "out");
+        File bClass = new File(outDir, "B.class");
+        bClass.delete();
+
+        // if A is executed
+        TestResult trExecution = doExec(javaCmd, "-cp", "out", "A");
+        // then this error message should be generated
+        trExecution.contains("Error: Could not find or load main class A");
+        trExecution.contains("Caused by: java.lang.NoClassDefFoundError: B");
+        if (!trExecution.testStatus)
+            System.err.println(trExecution);
+    }
+
+    public static void main(String[] args) throws Exception {
+        MainClassCantBeLoadedTest a = new MainClassCantBeLoadedTest();
+        a.run(args);
+        if (testExitValue > 0) {
+            System.out.println("Total of " + testExitValue + " failed");
+            throw new RuntimeException("Test failed");
+        } else {
+            System.out.println("Test passed");
+        }
+    }
+}
diff --git a/jdk/test/tools/launcher/ToolsOpts.java b/jdk/test/tools/launcher/ToolsOpts.java
index f8920c6..5837c62 100644
--- a/jdk/test/tools/launcher/ToolsOpts.java
+++ b/jdk/test/tools/launcher/ToolsOpts.java
@@ -87,11 +87,16 @@
         contents.add("       }\n");
         contents.add("    }\n");
         contents.add("}\n");
-        createFile(new File(mainJava), contents);
+        String mainJavaPath = "patch-src/com/sun/tools/javac/" + mainJava;
+        File mainJavaFile = new File(mainJavaPath.replace('/', File.separatorChar));
+        mainJavaFile.getParentFile().mkdirs();
+        createFile(mainJavaFile, contents);
 
         // compile Main.java into directory to override classes in jdk.compiler
         new File("jdk.compiler").mkdir();
-        compile("-Xmodule:jdk.compiler", "-d", "jdk.compiler", mainJava);
+        compile("--patch-module", "jdk.compiler=patch-src",
+                "-d", "jdk.compiler",
+                mainJavaFile.toString());
     }
 
     static void pass(String msg) {
diff --git a/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java b/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java
index ed2f7c0..0a20fec 100644
--- a/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java
+++ b/jdk/test/tools/launcher/modules/addexports/AddExportsTestWarningError.java
@@ -134,16 +134,16 @@
         return new Object[][]{
 
             // source not found
-            {"DoesNotExist/p=m1",  "WARNING: Unknown module: DoesNotExist specified in --add-exports"},
+            {"DoesNotExist/p=m1",  "WARNING: Unknown module: DoesNotExist specified to --add-exports"},
             {"m1/DoesNotExist=m2", "WARNING: package DoesNotExist not in m1"},
 
             // target not found
-            {"m1/p1=DoesNotExist", "WARNING: Unknown module: DoesNotExist specified in --add-exports"},
+            {"m1/p1=DoesNotExist", "WARNING: Unknown module: DoesNotExist specified to --add-exports"},
 
             // bad names
-            {"m*/p1=m2",           "WARNING: Unknown module: m* specified in --add-exports"},
+            {"m*/p1=m2",           "WARNING: Unknown module: m* specified to --add-exports"},
             {"m1/p!=m2",           "WARNING: package p! not in m1"},
-            {"m1/p1=m!",           "WARNING: Unknown module: m! specified in --add-exports"},
+            {"m1/p1=m!",           "WARNING: Unknown module: m! specified to --add-exports"},
 
         };
     }
diff --git a/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java b/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java
index 5b85583..6c9ee56 100644
--- a/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java
+++ b/jdk/test/tools/launcher/modules/addreads/AddReadsTestWarningError.java
@@ -168,14 +168,14 @@
         return new Object[][]{
 
             // source not found
-            {"DoesNotExist=m2",    "WARNING: Unknown module: DoesNotExist specified in --add-reads"},
+            {"DoesNotExist=m2",    "WARNING: Unknown module: DoesNotExist specified to --add-reads"},
 
             // target not found
-            {"m2=DoesNotExist",    "WARNING: Unknown module: DoesNotExist specified in --add-reads"},
+            {"m2=DoesNotExist",    "WARNING: Unknown module: DoesNotExist specified to --add-reads"},
 
             // bad names
-            {"m*=m2",              "WARNING: Unknown module: m* specified in --add-reads"},
-            {"m2=m!",              "WARNING: Unknown module: m! specified in --add-reads"},
+            {"m*=m2",              "WARNING: Unknown module: m* specified to --add-reads"},
+            {"m2=m!",              "WARNING: Unknown module: m! specified to --add-reads"},
 
         };
     }
diff --git a/jdk/test/tools/launcher/modules/basic/InitErrors.java b/jdk/test/tools/launcher/modules/basic/InitErrors.java
new file mode 100644
index 0000000..dd3a983
--- /dev/null
+++ b/jdk/test/tools/launcher/modules/basic/InitErrors.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @library /lib/testlibrary
+ * @build InitErrors jdk.testlibrary.*
+ * @run testng InitErrors
+ * @summary Basic test to ensure that module system initialization errors
+ *          go the right stream and with the right level of verbosity
+ */
+
+
+import java.util.Arrays;
+import jdk.testlibrary.ProcessTools;
+import jdk.testlibrary.OutputAnalyzer;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+public class InitErrors {
+
+    // the option to cause module initialization to fail
+    private static final String ADD_UNKNOWN_MODULE = "--add-modules=XXX";
+
+    // the expected error message
+    private static final String UNKNOWN_MODULE_NOT_FOUND= "Module XXX not found";
+
+    // output expected in the stack trace when using -Xlog:init=debug
+    private static final String STACK_FRAME = "java.base/java.lang.System.initPhase2";
+
+
+    /**
+     * Default behavior, send error message to stdout
+     */
+    @Test
+    public void testDefaultOutput() throws Exception {
+        expectFail(showVersion(ADD_UNKNOWN_MODULE)
+                .stdoutShouldContain(UNKNOWN_MODULE_NOT_FOUND)
+                .stdoutShouldNotContain(STACK_FRAME)
+                .stderrShouldNotContain(UNKNOWN_MODULE_NOT_FOUND)
+                .stderrShouldNotContain(STACK_FRAME));
+    }
+
+    /**
+     * -XX:+DisplayVMOutputToStderr should send error message to stderr
+     */
+    @Test
+    public void testOutputToStderr() throws Exception {
+        expectFail(showVersion(ADD_UNKNOWN_MODULE, "-XX:+DisplayVMOutputToStderr")
+                .stdoutShouldNotContain(UNKNOWN_MODULE_NOT_FOUND)
+                .stdoutShouldNotContain(STACK_FRAME)
+                .stderrShouldContain(UNKNOWN_MODULE_NOT_FOUND)
+                .stderrShouldNotContain(STACK_FRAME));
+    }
+
+    /**
+     * -Xlog:init=debug should print stack trace to stdout
+     */
+    @Test
+    public void testStackTrace() throws Exception {
+        expectFail(showVersion(ADD_UNKNOWN_MODULE, "-Xlog:init=debug")
+                .stdoutShouldContain(UNKNOWN_MODULE_NOT_FOUND)
+                .stdoutShouldContain(STACK_FRAME)
+                .stderrShouldNotContain(UNKNOWN_MODULE_NOT_FOUND)
+                .stderrShouldNotContain(STACK_FRAME));
+    }
+
+    /**
+     * -Xlog:init=debug -XX:+DisplayVMOutputToStderr should print stack trace
+     * to stderr
+     */
+    @Test
+    public void testStackTraceToStderr() throws Exception {
+        expectFail(showVersion(ADD_UNKNOWN_MODULE,
+                               "-Xlog:init=debug",
+                               "-XX:+DisplayVMOutputToStderr")
+                .stdoutShouldNotContain(UNKNOWN_MODULE_NOT_FOUND)
+                .stdoutShouldNotContain(STACK_FRAME)
+                .stderrShouldContain(UNKNOWN_MODULE_NOT_FOUND)
+                .stderrShouldContain(STACK_FRAME));
+    }
+
+    private OutputAnalyzer showVersion(String... args) throws Exception {
+        int len = args.length;
+        args = Arrays.copyOf(args, len+1);
+        args[len] = "-version";
+        return ProcessTools.executeTestJava(args)
+                .outputTo(System.out)
+                .errorTo(System.out);
+    }
+
+    private void expectFail(OutputAnalyzer output) {
+        assertFalse(output.getExitValue() == 0);
+    }
+
+}
diff --git a/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java b/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java
index fe9a293..afb1fbc 100644
--- a/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java
+++ b/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java
@@ -167,22 +167,6 @@
         // test main method with and without --add-modules mm
         int exitValue = exec("--module-path", LIBS_DIR.toString(),
                              "-m", mid);
-        assertTrue(exitValue != 0);
-
-        exitValue = exec("--module-path", LIBS_DIR.toString(),
-                         "--add-modules", M_MODULE,
-                         "-m", mid);
-        assertTrue(exitValue == 0);
-
-        // test dry run with and without --add-modules m
-        // no resolution failure
-        exitValue = exec("--dry-run", "--module-path", LIBS_DIR.toString(),
-                         "-m", mid);
-        assertTrue(exitValue == 0);
-
-        exitValue = exec("--dry-run", "--module-path", LIBS_DIR.toString(),
-                         "--add-modules", M_MODULE,
-                         "-m", mid);
         assertTrue(exitValue == 0);
     }
 
diff --git a/jdk/test/tools/launcher/modules/listmods/ListModsTest.java b/jdk/test/tools/launcher/modules/listmods/ListModsTest.java
index 7b1dd93..8628539 100644
--- a/jdk/test/tools/launcher/modules/listmods/ListModsTest.java
+++ b/jdk/test/tools/launcher/modules/listmods/ListModsTest.java
@@ -115,7 +115,7 @@
                 .outputTo(System.out)
                 .errorTo(System.out);
         output.shouldNotContain("java.base");
-        output.shouldContain("java.rhubarb not observable");
+        output.shouldContain("java.rhubarb not found");
         assertTrue(output.getExitValue() == 0);
     }
 
diff --git a/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java b/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java
index 968336a..15457cf 100644
--- a/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java
+++ b/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java
@@ -105,22 +105,24 @@
                                                 MODS_DIR.resolve("test"));
         assertTrue(compiled, "classes did not compile");
 
-        // javac -Xmodule:$MODULE -d patches1/$MODULE patches1/$MODULE/**
+        // javac --patch-module $MODULE=patches1/$MODULE -d patches1/$MODULE patches1/$MODULE/**
         // jar cf patches/$MODULE-1.jar -C patches1/$MODULE .
         for (Path src : Files.newDirectoryStream(SRC1_DIR)) {
             Path output = PATCHES1_DIR.resolve(src.getFileName());
             String mn = src.getFileName().toString();
-            compiled  = CompilerUtils.compile(src, output, "-Xmodule:" + mn);
+            compiled  = CompilerUtils.compile(src, output,
+                                              "--patch-module", mn + "=" + src.toString());
             assertTrue(compiled, "classes did not compile");
             JarUtils.createJarFile(PATCHES_DIR.resolve(mn + "-1.jar"), output);
         }
 
-        // javac -Xmodule:$MODULE -d patches2/$MODULE patches2/$MODULE/**
+        // javac --patch-module $MODULE=patches2/$MODULE -d patches2/$MODULE patches2/$MODULE/**
         // jar cf patches/$MODULE-2.jar -C patches2/$MODULE .
         for (Path src : Files.newDirectoryStream(SRC2_DIR)) {
             Path output = PATCHES2_DIR.resolve(src.getFileName());
             String mn = src.getFileName().toString();
-            compiled  = CompilerUtils.compile(src, output, "-Xmodule:" + mn);
+            compiled  = CompilerUtils.compile(src, output,
+                                              "--patch-module", mn + "=" + src.toString());
             assertTrue(compiled, "classes did not compile");
             JarUtils.createJarFile(PATCHES_DIR.resolve(mn + "-2.jar"), output);
         }
diff --git a/jdk/test/tools/launcher/modules/patch/basic/PatchTestWarningError.java b/jdk/test/tools/launcher/modules/patch/basic/PatchTestWarningError.java
index 711bedf..2d5b14b 100644
--- a/jdk/test/tools/launcher/modules/patch/basic/PatchTestWarningError.java
+++ b/jdk/test/tools/launcher/modules/patch/basic/PatchTestWarningError.java
@@ -93,20 +93,22 @@
                                                 MODS_DIR.resolve("test"));
         assertTrue(compiled, "classes did not compile");
 
-        // javac -Xmodule:$MODULE -d patches1/$MODULE patches1/$MODULE/**
+        // javac --patch-module $MODULE=patches1/$MODULE -d patches1/$MODULE patches1/$MODULE/**
         Path src = SRC1_DIR.resolve("java.base");
         Path output = PATCHES1_DIR.resolve(src.getFileName());
         Files.createDirectories(output);
         String mn = src.getFileName().toString();
-        compiled  = CompilerUtils.compile(src, output, "-Xmodule:" + mn);
+        compiled  = CompilerUtils.compile(src, output,
+                                          "--patch-module", mn + "=" + src.toString());
         assertTrue(compiled, "classes did not compile");
 
-        // javac -Xmodule:$MODULE -d patches2/$MODULE patches2/$MODULE/**
+        // javac --patch-module $MODULE=patches2/$MODULE -d patches2/$MODULE patches2/$MODULE/**
         src = SRC2_DIR.resolve("java.base");
         output = PATCHES2_DIR.resolve(src.getFileName());
         Files.createDirectories(output);
         mn = src.getFileName().toString();
-        compiled  = CompilerUtils.compile(src, output, "-Xmodule:" + mn);
+        compiled  = CompilerUtils.compile(src, output,
+                                          "--patch-module", mn + "=" + src.toString());
         assertTrue(compiled, "classes did not compile");
 
     }
@@ -177,7 +179,7 @@
                             "-m", "test/jdk.test.Main", arg)
                 .outputTo(System.out)
                 .errorTo(System.out)
-                .shouldContain("WARNING: Unknown module: DoesNotExist specified in --patch-module")
+                .shouldContain("WARNING: Unknown module: DoesNotExist specified to --patch-module")
                 .getExitValue();
 
         assertTrue(exitValue == 0);
diff --git a/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java b/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java
index f274a17..e23e38d 100644
--- a/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java
+++ b/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java
@@ -28,8 +28,6 @@
 
 package jdk.test;
 
-import java.lang.reflect.Module;
-
 public class Main {
 
     public static void main(String[] args) throws Exception {
diff --git a/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java b/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java
index 9a5c84c..1f1ff31 100644
--- a/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java
+++ b/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java
@@ -73,9 +73,10 @@
         }
 
         // compile patched source
+        String patchDir = PATCH_SRC_DIR.resolve(JAVA_BASE).toString();
         assertTrue(CompilerUtils.compile(PATCH_SRC_DIR.resolve(JAVA_BASE),
                                          PATCH_DIR.resolve(JAVA_BASE),
-                                         "-Xmodule:java.base"));
+                                         "--patch-module", "java.base=" + patchDir));
         assertTrue(CompilerUtils.compile(PATCH_SRC_DIR.resolve("m2"),
                                          PATCH_DIR.resolve("m2")));
 
diff --git a/jdk/test/tools/launcher/modules/patch/systemmodules/src1/java.base/jdk/internal/modules/SystemModules.java b/jdk/test/tools/launcher/modules/patch/systemmodules/src1/java.base/jdk/internal/modules/SystemModules.java
index a774fc7..0eef57b 100644
--- a/jdk/test/tools/launcher/modules/patch/systemmodules/src1/java.base/jdk/internal/modules/SystemModules.java
+++ b/jdk/test/tools/launcher/modules/patch/systemmodules/src1/java.base/jdk/internal/modules/SystemModules.java
@@ -30,6 +30,8 @@
 public final class SystemModules {
     public static final String[] MODULE_NAMES = new String[0];
 
+    public static int PACKAGES_IN_BOOT_LAYER = 1024;
+
     public static boolean hasSplitPackages() {
         return true;
     }
diff --git a/jdk/test/tools/launcher/modules/permit/AttemptAccess.java b/jdk/test/tools/launcher/modules/permit/AttemptAccess.java
new file mode 100644
index 0000000..900dfb1
--- /dev/null
+++ b/jdk/test/tools/launcher/modules/permit/AttemptAccess.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/**
+ * Launched by PermitIllegalAccess to attempt illegal access.
+ */
+
+public class AttemptAccess {
+
+    public static void main(String[] args) throws Exception {
+        String action = args[0];
+        int count = Integer.parseInt(args[1]);
+
+        for (int i=0; i<count; i++) {
+            switch (action) {
+                case "access":
+                    tryAccess();
+                    break;
+                case "setAccessible":
+                    trySetAccessible();
+                    break;
+                case "trySetAccessible":
+                    tryTrySetAccessible();
+                    break;
+            }
+        }
+    }
+
+    static void tryAccess() throws Exception {
+        Class<?> clazz = Class.forName("sun.security.x509.X500Name");
+        Constructor<?> ctor = clazz.getConstructor(String.class);
+        Object name = ctor.newInstance("CN=user");
+    }
+
+    static void trySetAccessible() throws Exception {
+        Method find = ClassLoader.class.getDeclaredMethod("findClass", String.class);
+        find.setAccessible(true);
+    }
+
+    static void tryTrySetAccessible() throws Exception {
+        Method find = ClassLoader.class.getDeclaredMethod("findClass", String.class);
+        find.trySetAccessible();
+    }
+
+}
diff --git a/jdk/test/tools/launcher/modules/permit/PermitIllegalAccess.java b/jdk/test/tools/launcher/modules/permit/PermitIllegalAccess.java
new file mode 100644
index 0000000..0c60c15
--- /dev/null
+++ b/jdk/test/tools/launcher/modules/permit/PermitIllegalAccess.java
@@ -0,0 +1,263 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @library /lib/testlibrary
+ * @build PermitIllegalAccess AttemptAccess jdk.testlibrary.*
+ * @run testng PermitIllegalAccess
+ * @summary Basic test for java --permit-illegal-access
+ */
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+
+import jdk.testlibrary.ProcessTools;
+import jdk.testlibrary.OutputAnalyzer;
+
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * Basic test of --permit-illegal-access to ensure that it permits access
+ * via core reflection and setAccessible/trySetAccessible.
+ */
+
+@Test
+public class PermitIllegalAccess {
+
+    static final String TEST_CLASSES = System.getProperty("test.classes");
+    static final String TEST_MAIN = "AttemptAccess";
+
+    static final String WARNING = "WARNING";
+    static final String STARTUP_WARNING =
+        "WARNING: --permit-illegal-access will be removed in the next major release";
+    static final String ILLEGAL_ACCESS_WARNING =
+        "WARNING: Illegal access by " + TEST_MAIN;
+
+    /**
+     * Launches AttemptAccess to execute an action, returning the OutputAnalyzer
+     * to analyze the output/exitCode.
+     */
+    private OutputAnalyzer tryAction(String action, int count, String... args)
+        throws Exception
+    {
+        Stream<String> s1 = Stream.of(args);
+        Stream<String> s2 = Stream.of("-cp", TEST_CLASSES, TEST_MAIN, action, "" + count);
+        String[] opts = Stream.concat(s1, s2).toArray(String[]::new);
+        return ProcessTools.executeTestJava(opts)
+                .outputTo(System.out)
+                .errorTo(System.out);
+    }
+
+    /**
+     * Launches AttemptAccess with --permit-illegal-access to execute an action,
+     * returning the OutputAnalyzer to analyze the output/exitCode.
+     */
+    private OutputAnalyzer tryActionPermittingIllegalAccess(String action, int count)
+        throws Exception
+    {
+        return tryAction(action, count, "--permit-illegal-access");
+    }
+
+    /**
+     * Sanity check to ensure that IllegalAccessException is thrown.
+     */
+    public void testAccessFail() throws Exception {
+        int exitValue = tryAction("access", 1)
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("IllegalAccessException")
+                .stderrShouldNotContain(WARNING)
+                .stderrShouldContain("IllegalAccessException")
+                .getExitValue();
+        assertTrue(exitValue != 0);
+    }
+
+    /**
+     * Sanity check to ensure that InaccessibleObjectException is thrown.
+     */
+    public void testSetAccessibleFail() throws Exception {
+        int exitValue = tryAction("setAccessible", 1)
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("InaccessibleObjectException")
+                .stderrShouldNotContain(WARNING)
+                .stderrShouldContain("InaccessibleObjectException")
+                .getExitValue();
+        assertTrue(exitValue != 0);
+    }
+
+    /**
+     * Permit illegal access to succeed
+     */
+    public void testAccessPermitted() throws Exception {
+        tryActionPermittingIllegalAccess("access", 1)
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("IllegalAccessException")
+                .stderrShouldContain(STARTUP_WARNING)
+                .stderrShouldNotContain("IllegalAccessException")
+                .stderrShouldContain(ILLEGAL_ACCESS_WARNING)
+                .shouldHaveExitValue(0);
+    }
+
+    /**
+     * Permit repeated illegal access to succeed
+     */
+    public void testRepeatedAccessPermitted() throws Exception {
+        OutputAnalyzer outputAnalyzer = tryActionPermittingIllegalAccess("access", 10)
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("IllegalAccessException")
+                .stderrShouldContain(STARTUP_WARNING)
+                .stderrShouldNotContain("IllegalAccessException")
+                .stderrShouldContain(ILLEGAL_ACCESS_WARNING)
+                .shouldHaveExitValue(0);;
+
+        // should only have one illegal access warning
+        assertTrue(containsCount(outputAnalyzer.asLines(), ILLEGAL_ACCESS_WARNING) == 1);
+    }
+
+    /**
+     * Permit setAccessible to succeed
+     */
+    public void testSetAccessiblePermitted() throws Exception {
+        tryActionPermittingIllegalAccess("setAccessible", 1)
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("InaccessibleObjectException")
+                .stderrShouldContain(STARTUP_WARNING)
+                .stderrShouldNotContain("InaccessibleObjectException")
+                .stderrShouldContain(ILLEGAL_ACCESS_WARNING)
+                .shouldHaveExitValue(0);
+    }
+
+    /**
+     * Permit repeated calls to setAccessible to succeed
+     */
+    public void testRepeatedSetAccessiblePermitted() throws Exception {
+        OutputAnalyzer outputAnalyzer = tryActionPermittingIllegalAccess("setAccessible", 10)
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("InaccessibleObjectException")
+                .stderrShouldContain(STARTUP_WARNING)
+                .stderrShouldNotContain("InaccessibleObjectException")
+                .stderrShouldContain(ILLEGAL_ACCESS_WARNING)
+                .shouldHaveExitValue(0);
+
+        // should only have one illegal access warning
+        assertTrue(containsCount(outputAnalyzer.asLines(), ILLEGAL_ACCESS_WARNING) == 1);
+    }
+
+    /**
+     * Permit trySetAccessible to succeed
+     */
+    public void testTrySetAccessiblePermitted() throws Exception {
+        tryActionPermittingIllegalAccess("trySetAccessible", 1)
+                .stdoutShouldNotContain(WARNING)
+                .stderrShouldContain(STARTUP_WARNING)
+                .stderrShouldContain(ILLEGAL_ACCESS_WARNING)
+                .shouldHaveExitValue(0);
+    }
+
+    /**
+     * Permit repeated calls to trySetAccessible to succeed
+     */
+    public void testRepeatedTrySetAccessiblePermitted() throws Exception {
+        OutputAnalyzer outputAnalyzer = tryActionPermittingIllegalAccess("trySetAccessible", 10)
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("InaccessibleObjectException")
+                .stderrShouldContain(STARTUP_WARNING)
+                .stderrShouldNotContain("InaccessibleObjectException")
+                .stderrShouldContain(ILLEGAL_ACCESS_WARNING)
+                .shouldHaveExitValue(0);
+
+        // should only have one illegal access warning
+        assertTrue(containsCount(outputAnalyzer.asLines(), ILLEGAL_ACCESS_WARNING) == 1);
+
+    }
+
+    /**
+     * Permit access to succeed with --add-exports. No warning should be printed.
+     */
+    public void testAccessWithAddExports() throws Exception {
+        tryAction("access", 1, "--add-exports", "java.base/sun.security.x509=ALL-UNNAMED")
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("IllegalAccessException")
+                .stderrShouldNotContain(WARNING)
+                .stderrShouldNotContain("IllegalAccessException")
+                .shouldHaveExitValue(0);
+    }
+
+    /**
+     * Permit access to succeed with --add-exports and --permit-illegal-access.
+     * The only warning emitted should be the startup warning.
+     */
+    public void testAccessWithePermittedAddExports() throws Exception {
+        tryAction("access", 1, "--permit-illegal-access",
+                    "--add-exports", "java.base/sun.security.x509=ALL-UNNAMED")
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("IllegalAccessException")
+                .stderrShouldContain(STARTUP_WARNING)
+                .stderrShouldNotContain("IllegalAccessException")
+                .stderrShouldNotContain(ILLEGAL_ACCESS_WARNING)
+                .shouldHaveExitValue(0);
+    }
+
+    /**
+     * Permit setAccessible to succeed with --add-opens. No warning should be printed.
+     */
+    public void testSetAccessibleWithAddOpens() throws Exception {
+        tryAction("setAccessible", 1, "--add-opens", "java.base/java.lang=ALL-UNNAMED")
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("InaccessibleObjectException")
+                .stderrShouldNotContain(WARNING)
+                .stderrShouldNotContain("InaccessibleObjectException")
+                .shouldHaveExitValue(0);
+    }
+
+    /**
+     * Permit setAccessible to succeed with both --add-opens and --permit-illegal-access.
+     * The only warning emitted should be the startup warning.
+     */
+    public void testSetAccessiblePermittedWithAddOpens() throws Exception {
+        tryAction("setAccessible", 1, "--permit-illegal-access",
+                    "--add-opens", "java.base/java.lang=ALL-UNNAMED")
+                .stdoutShouldNotContain(WARNING)
+                .stdoutShouldNotContain("InaccessibleObjectException")
+                .stderrShouldContain(STARTUP_WARNING)
+                .stderrShouldNotContain("InaccessibleObjectException")
+                .stderrShouldNotContain(ILLEGAL_ACCESS_WARNING)
+                .shouldHaveExitValue(0);
+    }
+
+
+    /**
+     * Returns the number of lines in the given input that contain the
+     * given char sequence.
+     */
+    private int containsCount(List<String> lines, CharSequence cs) {
+        int count = 0;
+        for (String line : lines) {
+            if (line.contains(cs)) count++;
+        }
+        return count;
+    }
+}
diff --git a/jdk/test/tools/launcher/modules/upgrademodulepath/src/test/jdk/test/Main.java b/jdk/test/tools/launcher/modules/upgrademodulepath/src/test/jdk/test/Main.java
index e5540ad..b6ab265 100644
--- a/jdk/test/tools/launcher/modules/upgrademodulepath/src/test/jdk/test/Main.java
+++ b/jdk/test/tools/launcher/modules/upgrademodulepath/src/test/jdk/test/Main.java
@@ -24,7 +24,6 @@
 package jdk.test;
 
 import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
 import java.net.URI;
 
 import javax.enterprise.context.Scope;
@@ -53,7 +52,7 @@
 
         // javax.transaction should be found in boot layer.
         ModuleReference ref =
-                Layer.boot().configuration().findModule(TRANSACTION_MODULE).get().reference();
+                ModuleLayer.boot().configuration().findModule(TRANSACTION_MODULE).get().reference();
         // check uri of java.transaction found on the upgrade module path.
         URI uri = ref.location().get();
         System.out.println("uri: " + uri);
diff --git a/jdk/test/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java b/jdk/test/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java
index 97e5f76..17fcf67 100644
--- a/jdk/test/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java
+++ b/jdk/test/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java
@@ -1544,7 +1544,6 @@
         Element e = new Element(x.getCpString(attr.attribute_name_index));
         e.add(x.getCpString(attr.os_name_index));
         e.add(x.getCpString(attr.os_arch_index));
-        e.add(x.getCpString(attr.os_version_index));
         e.trimToSize();
         p.add(e);
         return null;
diff --git a/langtools/.hgtags b/langtools/.hgtags
index b0dfd87..aa208af 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -398,3 +398,12 @@
 03f48cd283f5dd6b7153fd7e0cf2df8582b14391 jdk-9+153
 6a9dd3d893b0a493a3e5d8d392815b5ee76a02d9 jdk-9+154
 dfcfdb2db85f1bb434209f56ca557ea6f9830aa8 jdk-9+155
+6f91e41163bc09e9b3ec72e8d1185f39296ee5d4 jdk-9+156
+162b521af7bb097019a8afaa44e1f8069ce274eb jdk-9+157
+4eb737a8d439f49a197e8000de26c6580cb4d57b jdk-9+158
+39449d2a6398fee779630f041c55c0466f5fd2c0 jdk-9+159
+0f4fef68d2d84ad78b3aaf6eab2c07873aedf971 jdk-9+160
+2340259b31554a3761e9909953c8ab8ef124ac07 jdk-9+161
+440c45c2e8cee78f6883fa6f2505a781505f323c jdk-9+162
+24582dd2649a155876de89273975ebe1adb5f18c jdk-9+163
+c7f3df19667b093538c6eecb73dcb3fb531706b4 jdk-9+164
diff --git a/langtools/make/CompileInterim.gmk b/langtools/make/CompileInterim.gmk
index 33a2380..20b967a 100644
--- a/langtools/make/CompileInterim.gmk
+++ b/langtools/make/CompileInterim.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,8 @@
           $$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)), \
       EXCLUDES := sun com/sun/tools/jdeps com/sun/tools/javap \
           com/sun/tools/jdeprscan, \
-      EXCLUDE_FILES := module-info.java JavacToolProvider.java JavadocToolProvider.java, \
+      EXCLUDE_FILES := module-info.java JavacToolProvider.java \
+	  JavadocToolProvider.java Standard.java, \
       COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
       BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/$(strip $1), \
       ADD_JAVAC_FLAGS := -Xbootclasspath/p:$$(call PathList, \
diff --git a/langtools/make/build.properties b/langtools/make/build.properties
index 4deb152..9ee7170 100644
--- a/langtools/make/build.properties
+++ b/langtools/make/build.properties
@@ -56,7 +56,7 @@
 tool.javap.main.class=com.sun.tools.javap.Main
 tool.javah.main.class=com.sun.tools.javah.Main
 tool.sjavac.main.class=com.sun.tools.sjavac.Main
-tool.jshell.main.class=jdk.internal.jshell.tool.JShellTool
+tool.jshell.main.class=jdk.internal.jshell.tool.JShellToolProvider
 
 #test configuration:
 jtreg.tests=
diff --git a/langtools/make/build.xml b/langtools/make/build.xml
index 864f2cb..c39ff0e 100644
--- a/langtools/make/build.xml
+++ b/langtools/make/build.xml
@@ -89,16 +89,22 @@
     </pathconvert>
 
     <pathconvert property="xpatch.rest" pathsep=" --patch-module=">
-        <regexpmapper from="/([^$/]+)$"
-                      to='\1="${build.modules}/\1"'
-                      handledirsep="yes"/>
+        <scriptmapper language="javascript">
+            fs = project.getProperty("file.separator");
+            path = project.getProperty("build.modules");
+            mod = source.substr(source.lastIndexOf(fs)+1);
+            self.addMappedName(mod + "=\"" + path + fs + mod + "\"");
+        </scriptmapper>
         <dirset dir="${src.dir}" includes="*.*"/>
     </pathconvert>
 
     <pathconvert property="xpatch.noquotes.rest" pathsep=" --patch-module=">
-        <regexpmapper from="/([^$/]+)$"
-                      to="\1=${build.modules}/\1"
-                      handledirsep="yes"/>
+        <scriptmapper language="javascript">
+            fs = project.getProperty("file.separator");
+            path = project.getProperty("build.modules");
+            mod = source.substr(source.lastIndexOf(fs)+1);
+            self.addMappedName(mod + "=" + path + fs + mod);
+        </scriptmapper>
         <dirset dir="${src.dir}" includes="*.*"/>
     </pathconvert>
 
@@ -341,7 +347,7 @@
             <attribute name="agentvm" default="true"/>
             <attribute name="verbose" default="${default.jtreg.verbose}"/>
             <attribute name="options" default="${other.jtreg.options}"/>
-            <attribute name="keywords" default="-keywords:!ignore"/>
+            <attribute name="ignore" default="-keywords:!ignore -exclude:${test.dir}/ProblemList.txt"/>
             <attribute name="jpda.jvmargs" default=""/>
             <attribute name="extra.jvmargs" default=""/>
             <attribute name="build.modules" default="${build.modules}"/>
@@ -360,7 +366,7 @@
                     failonerror="false" resultproperty="jtreg.@{name}.result"
                     vmoptions="${coverage.options} @{extra.jvmargs} ${xpatch.noquotes.cmd}">
                     <arg value="-debug:@{jpda.jvmargs}"/>
-                    <arg line="@{keywords}"/>
+                    <arg line="@{ignore}"/>
                     <arg line="@{options}"/>
                     <arg line="@{tests}"/>
                 </jtreg>
diff --git a/langtools/make/intellij/runConfigurations/javadoc.xml b/langtools/make/intellij/runConfigurations/javadoc.xml
index 9da56c3..4ca7b73 100644
--- a/langtools/make/intellij/runConfigurations/javadoc.xml
+++ b/langtools/make/intellij/runConfigurations/javadoc.xml
@@ -1,8 +1,8 @@
 <component name="ProjectRunConfigurationManager">
   <configuration default="false" name="javadoc" type="Application" factoryName="Application">
     <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
-    <option name="MAIN_CLASS_NAME" value="com.sun.tools.javadoc.Main" />
-    <option name="VM_PARAMETERS" value='@XPATCH@' />
+    <option name="MAIN_CLASS_NAME" value="jdk.javadoc.internal.tool.Main" />
+    <option name="VM_PARAMETERS" value='@XPATCH@ --add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED' />
     <option name="PROGRAM_PARAMETERS" value="" />
     <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
     <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
diff --git a/langtools/make/intellij/runConfigurations/jshell.xml b/langtools/make/intellij/runConfigurations/jshell.xml
index c548919..051b02f 100644
--- a/langtools/make/intellij/runConfigurations/jshell.xml
+++ b/langtools/make/intellij/runConfigurations/jshell.xml
@@ -1,7 +1,7 @@
 <component name="ProjectRunConfigurationManager">
   <configuration default="false" name="jshell" type="Application" factoryName="Application">
     <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
-    <option name="MAIN_CLASS_NAME" value="jdk.internal.jshell.tool.JShellTool" />
+    <option name="MAIN_CLASS_NAME" value="jdk.internal.jshell.tool.JShellToolProvider" />
     <option name="VM_PARAMETERS" value='@XPATCH@ --add-exports=jdk.jshell/jdk.internal.jshell.tool=ALL-UNNAMED' />
     <option name="PROGRAM_PARAMETERS" value="" />
     <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
diff --git a/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java b/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
index 7f22059..4924353 100644
--- a/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
+++ b/langtools/make/intellij/src/idea/LangtoolsIdeaAntLogger.java
@@ -263,6 +263,7 @@
                 project.addBuildListener(this);
             }
         }
+        logger.setMessageOutputLevel(3);
         tasks.push(Task.ROOT);
     }
 
diff --git a/langtools/make/tools/crules/CodingRulesAnalyzerPlugin.java b/langtools/make/tools/crules/CodingRulesAnalyzerPlugin.java
index 5e60f3f..0144c00 100644
--- a/langtools/make/tools/crules/CodingRulesAnalyzerPlugin.java
+++ b/langtools/make/tools/crules/CodingRulesAnalyzerPlugin.java
@@ -23,8 +23,6 @@
 
 package crules;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -76,7 +74,7 @@
     private void addExports(String moduleName, String... packageNames) {
         for (String packageName : packageNames) {
             try {
-                Layer layer = Layer.boot();
+                ModuleLayer layer = ModuleLayer.boot();
                 Optional<Module> m = layer.findModule(moduleName);
                 if (!m.isPresent())
                     throw new Error("module not found: " + moduleName);
diff --git a/langtools/make/tools/crules/MutableFieldsAnalyzer.java b/langtools/make/tools/crules/MutableFieldsAnalyzer.java
index 1e14e39..b5c0dd7 100644
--- a/langtools/make/tools/crules/MutableFieldsAnalyzer.java
+++ b/langtools/make/tools/crules/MutableFieldsAnalyzer.java
@@ -102,7 +102,7 @@
         ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$ModuleFinder",
                 "moduleFinderClass", "ofMethod");
         ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$Configuration",
-                "configurationClass", "resolveRequiresAndUsesMethod");
+                "configurationClass", "resolveAndBindMethod");
         ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$Layer",
                 "layerClass", "bootMethod", "defineModulesWithOneLoaderMethod", "configurationMethod");
         ignoreFields("com.sun.tools.javac.util.JDK9Wrappers$Module",
diff --git a/langtools/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java b/langtools/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java
index 0a8287b..62fb6d5 100644
--- a/langtools/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java
+++ b/langtools/src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -92,7 +92,7 @@
      * same set of strings as the annotation.  If the class is not so
      * annotated, an empty set is returned.
      *
-     * If the {@link ProcessingEvironment#getSourceVersion source
+     * If the {@link ProcessingEnvironment#getSourceVersion source
      * version} does not support modules, in other words if it is less
      * than or equal to {@link SourceVersion#RELEASE_8 RELEASE_8},
      * then any leading {@link Processor#getSupportedAnnotationTypes
diff --git a/langtools/src/java.compiler/share/classes/javax/annotation/processing/Filer.java b/langtools/src/java.compiler/share/classes/javax/annotation/processing/Filer.java
index 9a81988..f0027dc 100644
--- a/langtools/src/java.compiler/share/classes/javax/annotation/processing/Filer.java
+++ b/langtools/src/java.compiler/share/classes/javax/annotation/processing/Filer.java
@@ -28,6 +28,7 @@
 import javax.tools.JavaFileManager;
 import javax.tools.*;
 import javax.lang.model.element.Element;
+import javax.lang.model.util.Elements;
 import java.io.IOException;
 
 /**
@@ -157,6 +158,12 @@
      * example, to create a source file for type {@code a.B} in module
      * {@code foo}, use a {@code name} argument of {@code "foo/a.B"}.
      *
+     * <p>If no explicit module prefix is given and modules are supported
+     * in the environment, a suitable module is inferred. If a suitable
+     * module cannot be inferred {@link FilerException} is thrown.
+     * An implementation may use information about the configuration of
+     * the annotation processing tool as part of the inference.
+     *
      * <p>Creating a source file in or for an unnamed package in a named
      * module is <em>not</em> supported.
      *
@@ -176,6 +183,17 @@
      * ProcessingEnvironment#getSourceVersion source version} being used
      * for this run.
      *
+     * @implNote In the reference implementation, if the annotation
+     * processing tool is processing a single module <i>M</i>,
+     * then <i>M</i> is used as the module for files created without
+     * an explicit module prefix. If the tool is processing multiple
+     * modules, and {@link
+     * Elements#getPackageElement(java.lang.CharSequence)
+     * Elements.getPackageElement(package-of(name))}
+     * returns a package, the module that owns the returned package is used
+     * as the target module. A separate option may be used to provide the target
+     * module if it cannot be determined using the above rules.
+     *
      * @param name  canonical (fully qualified) name of the principal type
      *          being declared in this file or a package name followed by
      *          {@code ".package-info"} for a package information file
@@ -184,8 +202,11 @@
      * {@code null}
      * @return a {@code JavaFileObject} to write the new source file
      * @throws FilerException if the same pathname has already been
-     * created, the same type has already been created, or the name is
-     * otherwise not valid for the entity requested to being created
+     * created, the same type has already been created, the name is
+     * otherwise not valid for the entity requested to being created,
+     * if the target module cannot be determined, if the target
+     * module is not writable, or a module is specified when the environment
+     * doesn't support modules.
      * @throws IOException if the file cannot be created
      * @jls 7.3 Compilation Units
      */
@@ -213,6 +234,12 @@
      * example, to create a class file for type {@code a.B} in module
      * {@code foo}, use a {@code name} argument of {@code "foo/a.B"}.
      *
+     * <p>If no explicit module prefix is given and modules are supported
+     * in the environment, a suitable module is inferred. If a suitable
+     * module cannot be inferred {@link FilerException} is thrown.
+     * An implementation may use information about the configuration of
+     * the annotation processing tool as part of the inference.
+     *
      * <p>Creating a class file in or for an unnamed package in a named
      * module is <em>not</em> supported.
      *
@@ -221,6 +248,17 @@
      * ProcessingEnvironment#getSourceVersion source version} being
      * used for this run.
      *
+     * @implNote In the reference implementation, if the annotation
+     * processing tool is processing a single module <i>M</i>,
+     * then <i>M</i> is used as the module for files created without
+     * an explicit module prefix. If the tool is processing multiple
+     * modules, and {@link
+     * Elements#getPackageElement(java.lang.CharSequence)
+     * Elements.getPackageElement(package-of(name))}
+     * returns a package, the module that owns the returned package is used
+     * as the target module. A separate option may be used to provide the target
+     * module if it cannot be determined using the above rules.
+     *
      * @param name binary name of the type being written or a package name followed by
      *          {@code ".package-info"} for a package information file
      * @param originatingElements type or package or module elements causally
@@ -228,8 +266,10 @@
      * {@code null}
      * @return a {@code JavaFileObject} to write the new class file
      * @throws FilerException if the same pathname has already been
-     * created, the same type has already been created, or the name is
-     * not valid for a type
+     * created, the same type has already been created, the name is
+     * not valid for a type, if the target module cannot be determined,
+     * if the target module is not writable, or a module is specified when
+     * the environment doesn't support modules.
      * @throws IOException if the file cannot be created
      */
     JavaFileObject createClassFile(CharSequence name,
@@ -255,11 +295,37 @@
      * does not contain a "{@code /}" character, the entire argument
      * is interpreted as a package name.
      *
+     * <p>If the given location is neither a {@linkplain
+     * JavaFileManager.Location#isModuleOrientedLocation()
+     * module oriented location}, nor an {@linkplain
+     * JavaFileManager.Location#isOutputLocation()
+     * output location containing multiple modules}, and the explicit
+     * module prefix is given, {@link FilerException} is thrown.
+     *
+     * <p>If the given location is either a module oriented location,
+     * or an output location containing multiple modules, and no explicit
+     * modules prefix is given, a suitable module is
+     * inferred. If a suitable module cannot be inferred {@link
+     * FilerException} is thrown. An implementation may use information
+     * about the configuration of the annotation processing tool
+     * as part of the inference.
+     *
      * <p>Files created via this method are <em>not</em> registered for
      * annotation processing, even if the full pathname of the file
      * would correspond to the full pathname of a new source file
      * or new class file.
      *
+     * @implNote In the reference implementation, if the annotation
+     * processing tool is processing a single module <i>M</i>,
+     * then <i>M</i> is used as the module for files created without
+     * an explicit module prefix. If the tool is processing multiple
+     * modules, and {@link
+     * Elements#getPackageElement(java.lang.CharSequence)
+     * Elements.getPackageElement(package-of(name))}
+     * returns a package, the module that owns the returned package is used
+     * as the target module. A separate option may be used to provide the target
+     * module if it cannot be determined using the above rules.
+     *
      * @param location location of the new file
      * @param moduleAndPkg module and/or package relative to which the file
      *           should be named, or the empty string if none
@@ -270,7 +336,9 @@
      * @return a {@code FileObject} to write the new resource
      * @throws IOException if the file cannot be created
      * @throws FilerException if the same pathname has already been
-     * created
+     * created, if the target module cannot be determined,
+     * or if the target module is not writable, or if an explicit
+     * target module is specified and the location does not support it.
      * @throws IllegalArgumentException for an unsupported location
      * @throws IllegalArgumentException if {@code moduleAndPkg} is ill-formed
      * @throws IllegalArgumentException if {@code relativeName} is not relative
@@ -294,13 +362,41 @@
      * does not contain a "{@code /}" character, the entire argument
      * is interpreted as a package name.
      *
+     * <p>If the given location is neither a {@linkplain
+     * JavaFileManager.Location#isModuleOrientedLocation()
+     * module oriented location}, nor an {@linkplain
+     * JavaFileManager.Location#isOutputLocation()
+     * output location containing multiple modules}, and the explicit
+     * module prefix is given, {@link FilerException} is thrown.
+     *
+     * <p>If the given location is either a module oriented location,
+     * or an output location containing multiple modules, and no explicit
+     * modules prefix is given, a suitable module is
+     * inferred. If a suitable module cannot be inferred {@link
+     * FilerException} is thrown. An implementation may use information
+     * about the configuration of the annotation processing tool
+     * as part of the inference.
+     *
+     * @implNote In the reference implementation, if the annotation
+     * processing tool is processing a single module <i>M</i>,
+     * then <i>M</i> is used as the module for files read without
+     * an explicit module prefix. If the tool is processing multiple
+     * modules, and {@link
+     * Elements#getPackageElement(java.lang.CharSequence)
+     * Elements.getPackageElement(package-of(name))}
+     * returns a package, the module that owns the returned package is used
+     * as the source module. A separate option may be used to provide the target
+     * module if it cannot be determined using the above rules.
+     *
      * @param location location of the file
      * @param moduleAndPkg module and/or package relative to which the file
      *          should be searched for, or the empty string if none
      * @param relativeName final pathname components of the file
      * @return an object to read the file
      * @throws FilerException if the same pathname has already been
-     * opened for writing
+     * opened for writing, if the source module cannot be determined,
+     * or if the target module is not writable, or if an explicit target
+     * module is specified and the location does not support it.
      * @throws IOException if the file cannot be opened
      * @throws IllegalArgumentException for an unsupported location
      * @throws IllegalArgumentException if {@code moduleAndPkg} is ill-formed
diff --git a/langtools/src/java.compiler/share/classes/javax/annotation/processing/Generated.java b/langtools/src/java.compiler/share/classes/javax/annotation/processing/Generated.java
new file mode 100644
index 0000000..34deb61
--- /dev/null
+++ b/langtools/src/java.compiler/share/classes/javax/annotation/processing/Generated.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javax.annotation.processing;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * The Generated annotation is used to mark source code that has been generated.
+ * It can also be used to differentiate user written code from generated code in
+ * a single file.
+ *
+ * <h3>Examples:</h3>
+ * <pre>
+ *   &#064;Generated("com.example.Generator")
+ * </pre>
+ * <pre>
+ *   &#064;Generated(value="com.example.Generator", date= "2017-07-04T12:08:56.235-0700")
+ * </pre>
+ * <pre>
+ *   &#064;Generated(value="com.example.Generator", date= "2017-07-04T12:08:56.235-0700",
+ *      comments= "comment 1")
+ * </pre>
+ *
+ * @since 9
+ */
+@Documented
+@Retention(SOURCE)
+@Target({PACKAGE, TYPE, METHOD, CONSTRUCTOR, FIELD,
+    LOCAL_VARIABLE, PARAMETER})
+public @interface Generated {
+
+    /**
+     * The value element MUST have the name of the code generator. The
+     * name is the fully qualified name of the code generator.
+     *
+     * @return The name of the code generator
+     */
+    String[] value();
+
+    /**
+     * Date when the source was generated. The date element must follow the ISO
+     * 8601 standard. For example the date element would have the following
+     * value 2017-07-04T12:08:56.235-0700 which represents 2017-07-04 12:08:56
+     * local time in the U.S. Pacific Time time zone.
+     *
+     * @return The date the source was generated
+     */
+    String date() default "";
+
+    /**
+     * A place holder for any comments that the code generator may want to
+     * include in the generated code.
+     *
+     * @return Comments that the code generated included
+     */
+    String comments() default "";
+}
diff --git a/langtools/src/java.compiler/share/classes/javax/annotation/processing/Processor.java b/langtools/src/java.compiler/share/classes/javax/annotation/processing/Processor.java
index e7a8278..3fb8392 100644
--- a/langtools/src/java.compiler/share/classes/javax/annotation/processing/Processor.java
+++ b/langtools/src/java.compiler/share/classes/javax/annotation/processing/Processor.java
@@ -291,7 +291,7 @@
      * @apiNote When running in an environment which supports modules,
      * processors are encouraged to include the module prefix when
      * describing their supported annotation types. The method {@link
-     * AbstractProcessor.getSupportedAnnotationTypes
+     * AbstractProcessor#getSupportedAnnotationTypes
      * AbstractProcessor.getSupportedAnnotationTypes} provides support
      * for stripping off the module prefix when running in an
      * environment without modules.
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/element/Element.java b/langtools/src/java.compiler/share/classes/javax/lang/model/element/Element.java
index e1b7502..7d93d15 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/element/Element.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/element/Element.java
@@ -123,6 +123,8 @@
      * @see TypeElement#getSimpleName
      * @see VariableElement#getSimpleName
      * @see ModuleElement#getSimpleName
+     * @revised 9
+     * @spec JPMS
      */
     Name getSimpleName();
 
@@ -158,6 +160,8 @@
      *
      * @return the enclosing element, or {@code null} if there is none
      * @see Elements#getPackageOf
+     * @revised 9
+     * @spec JPMS
      */
     Element getEnclosingElement();
 
@@ -193,6 +197,8 @@
      * @see Elements#getAllMembers
      * @jls 8.8.9 Default Constructor
      * @jls 8.9 Enums
+     * @revised 9
+     * @spec JPMS
      */
     List<? extends Element> getEnclosedElements();
 
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java b/langtools/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java
index e98d454..d8af1ca 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java
@@ -99,6 +99,7 @@
     /**
      * A module.
      * @since 9
+     * @spec JPMS
      */
      MODULE;
 
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java b/langtools/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java
index 290c36f..955c364 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java
@@ -159,6 +159,7 @@
      * @param p  a visitor-specified parameter
      * @return a visitor-specified result
      * @since 9
+     * @spec JPMS
      */
     default R visitModule(ModuleElement e, P p) {
         return visitUnknown(e, p);
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java b/langtools/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java
index cf3f6b1..fbbc522 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java
@@ -33,6 +33,7 @@
  *
  * @see javax.lang.model.util.Elements#getModuleOf
  * @since 9
+ * @spec JPMS
  */  // TODO: add @jls to module section
 public interface ModuleElement extends Element, QualifiedNameable {
 
@@ -104,6 +105,7 @@
      * future versions of the Java&trade; programming language.
      *
      * @since 9
+     * @spec JPMS
      */
     enum DirectiveKind {
         /** A "requires (static|transitive)* module-name" directive. */
@@ -122,6 +124,7 @@
      * Represents a "module statement" within the declaration of this module.
      *
      * @since 9
+     * @spec JPMS
      *
      */ // TODO: add jls to Module Statement
     interface Directive {
@@ -131,11 +134,134 @@
          * @return the kind of this directive
          */
         DirectiveKind getKind();
+
+        /**
+         * Applies a visitor to this directive.
+         *
+         * @param <R> the return type of the visitor's methods
+         * @param <P> the type of the additional parameter to the visitor's methods
+         * @param v   the visitor operating on this directive
+         * @param p   additional parameter to the visitor
+         * @return a visitor-specified result
+         */
+        <R, P> R accept(DirectiveVisitor<R, P> v, P p);
+    }
+
+    /**
+     * A visitor of module directives, in the style of the visitor design
+     * pattern.  Classes implementing this interface are used to operate
+     * on a directive when the kind of directive is unknown at compile time.
+     * When a visitor is passed to a directive's {@link Directive#accept
+     * accept} method, the <tt>visit<i>Xyz</i></tt> method applicable
+     * to that directive is invoked.
+     *
+     * <p> Classes implementing this interface may or may not throw a
+     * {@code NullPointerException} if the additional parameter {@code p}
+     * is {@code null}; see documentation of the implementing class for
+     * details.
+     *
+     * <p> <b>WARNING:</b> It is possible that methods will be added to
+     * this interface to accommodate new, currently unknown, language
+     * structures added to future versions of the Java&trade; programming
+     * language. Methods to accommodate new language constructs will
+     * be added in a source <em>compatible</em> way using
+     * <em>default methods</em>.
+     *
+     * @param <R> the return type of this visitor's methods.  Use {@link
+     *            Void} for visitors that do not need to return results.
+     * @param <P> the type of the additional parameter to this visitor's
+     *            methods.  Use {@code Void} for visitors that do not need an
+     *            additional parameter.
+     *
+     * @since 9
+     * @spec JPMS
+     */
+    interface DirectiveVisitor<R, P> {
+        /**
+         * Visits any directive as if by passing itself to that
+         * directive's {@link Directive#accept accept} method and passing
+         * {@code null} for the additional parameter.
+         * The invocation {@code v.visit(d)} is equivalent to
+         * {@code d.accept(v, null)}.
+         * @param d  the directive to visit
+         * @return a visitor-specified result
+         * @implSpec This implementation is {@code visit(d, null)}
+         */
+        default R visit(Directive d) {
+            return d.accept(this, null);
+        }
+
+        /**
+         * Visits any directive as if by passing itself to that
+         * directive's {@link Directive#accept accept} method.
+         * The invocation {@code v.visit(d, p)} is equivalent to
+         * {@code d.accept(v, p)}.
+         * @param d  the directive to visit
+         * @param p  a visitor-specified parameter
+         * @return a visitor-specified result
+         */
+        default R visit(Directive d, P p) {
+            return d.accept(this, p);
+        }
+
+        /**
+         * Visits a {@code requires} directive.
+         * @param d  the directive to visit
+         * @param p  a visitor-specified parameter
+         * @return a visitor-specified result
+         */
+        R visitRequires(RequiresDirective d, P p);
+
+        /**
+         * Visits an {@code exports} directive.
+         * @param d  the directive to visit
+         * @param p  a visitor-specified parameter
+         * @return a visitor-specified result
+         */
+        R visitExports(ExportsDirective d, P p);
+
+        /**
+         * Visits an {@code opens} directive.
+         * @param d  the directive to visit
+         * @param p  a visitor-specified parameter
+         * @return a visitor-specified result
+         */
+        R visitOpens(OpensDirective d, P p);
+
+        /**
+         * Visits a {@code uses} directive.
+         * @param d  the directive to visit
+         * @param p  a visitor-specified parameter
+         * @return a visitor-specified result
+         */
+        R visitUses(UsesDirective d, P p);
+
+        /**
+         * Visits a {@code provides} directive.
+         * @param d  the directive to visit
+         * @param p  a visitor-specified parameter
+         * @return a visitor-specified result
+         */
+        R visitProvides(ProvidesDirective d, P p);
+
+        /**
+         * Visits an unknown directive.
+         * This can occur if the language evolves and new kinds of directive are added.
+         * @param d  the directive to visit
+         * @param p  a visitor-specified parameter
+         * @return a visitor-specified result
+         * @throws UnknownDirectiveException a visitor implementation may optionally throw this exception
+         * @implSpec This implementation throws {@code new UnknownDirectiveException(d, p)}.
+         */
+        default R visitUnknown(Directive d, P p) {
+            throw new UnknownDirectiveException(d, p);
+        }
     }
 
     /**
      * A dependency of a module.
      * @since 9
+     * @spec JPMS
      */
     interface RequiresDirective extends Directive {
         /**
@@ -160,6 +286,7 @@
     /**
      * An exported package of a module.
      * @since 9
+     * @spec JPMS
      */
     interface ExportsDirective extends Directive {
 
@@ -181,6 +308,7 @@
     /**
      * An opened package of a module.
      * @since 9
+     * @spec JPMS
      */
     interface OpensDirective extends Directive {
 
@@ -202,6 +330,7 @@
     /**
      * An implementation of a service provided by a module.
      * @since 9
+     * @spec JPMS
      */
     interface ProvidesDirective extends Directive {
         /**
@@ -220,6 +349,7 @@
     /**
      * A reference to a service used by a module.
      * @since 9
+     * @spec JPMS
      */
     interface UsesDirective extends Directive {
         /**
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java b/langtools/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java
index 6535c00..ad2fc6b 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/element/PackageElement.java
@@ -93,6 +93,9 @@
      * source version} without modules.
      *
      * @return the enclosing module or {@code null} if no such module exists
+     *
+     * @revised 9
+     * @spec JPMS
      */
     @Override
     Element getEnclosingElement();
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java b/langtools/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java
index 73bcf1d..de9ca37 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java
@@ -75,8 +75,9 @@
      * originating source of information about the type.  For example,
      * if the information about the type is originating from a source
      * file, the elements will be returned in source code order.
-     * (However, in that case the the ordering of elements, such as a
-     * default constructor, is not specified.)
+     * (However, in that case the the ordering of {@linkplain
+     * Elements.Origin#MANDATED implicitly declared} elements, such as
+     * default constructors, is not specified.)
      *
      * @return the enclosed elements in proper order, or an empty list if none
      *
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/element/UnknownDirectiveException.java b/langtools/src/java.compiler/share/classes/javax/lang/model/element/UnknownDirectiveException.java
new file mode 100644
index 0000000..60cf54a
--- /dev/null
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/element/UnknownDirectiveException.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.element;
+
+import javax.lang.model.UnknownEntityException;
+
+/**
+ * Indicates that an unknown kind of module directive was encountered.
+ * This can occur if the language evolves and new kinds of directives are
+ * added to the {@code Directive} hierarchy.  May be thrown by a
+ * {@linkplain ModuleElement.DirectiveVisitor directive visitor} to
+ * indicate that the visitor was created for a prior version of the language.
+ *
+ * @author Joseph D. Darcy
+ * @author Scott Seligman
+ * @author Peter von der Ah&eacute;
+ * @see ModuleElement.DirectiveVisitor#visitUnknown
+ * @since 9
+ * @spec JPMS
+ */
+public class UnknownDirectiveException extends UnknownEntityException {
+
+    private static final long serialVersionUID = 269L;
+
+    private final transient ModuleElement.Directive directive;
+    private final transient Object parameter;
+
+    /**
+     * Creates a new {@code UnknownElementException}.  The {@code p}
+     * parameter may be used to pass in an additional argument with
+     * information about the context in which the unknown directive was
+     * encountered; for example, the visit methods of {@link
+     * ModuleElement.DirectiveVisitor DirectiveVisitor} may pass in
+     * their additional parameter.
+     *
+     * @param d the unknown directive, may be {@code null}
+     * @param p an additional parameter, may be {@code null}
+     */
+    public UnknownDirectiveException(ModuleElement.Directive d, Object p) {
+        super("Unknown directive: " + d);
+        directive = d;
+        parameter = p;
+    }
+
+    /**
+     * Returns the unknown directive.
+     * The value may be unavailable if this exception has been
+     * serialized and then read back in.
+     *
+     * @return the unknown directive, or {@code null} if unavailable
+     */
+    public ModuleElement.Directive getUnknownDirective() {
+        return directive;
+    }
+
+    /**
+     * Returns the additional argument.
+     *
+     * @return the additional argument, or {@code null} if unavailable
+     */
+    public Object getArgument() {
+        return parameter;
+    }
+}
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/type/TypeKind.java b/langtools/src/java.compiler/share/classes/javax/lang/model/type/TypeKind.java
index b0a1b62..4618757 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/type/TypeKind.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/type/TypeKind.java
@@ -157,6 +157,7 @@
      * A pseudo-type corresponding to a module element.
      * @see NoType
      * @since 9
+     * @spec JPMS
      */
     MODULE;
 
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/type/TypeMirror.java b/langtools/src/java.compiler/share/classes/javax/lang/model/type/TypeMirror.java
index 5e5358b..3f5d691 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/type/TypeMirror.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/type/TypeMirror.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,9 +34,9 @@
  * Represents a type in the Java programming language.
  * Types include primitive types, declared types (class and interface types),
  * array types, type variables, and the null type.
- * Also represented are wildcard type arguments,
- * the signature and return types of executables,
- * and pseudo-types corresponding to packages and to the keyword {@code void}.
+ * Also represented are wildcard type arguments, the signature and
+ * return types of executables, and pseudo-types corresponding to
+ * packages, modules, and the keyword {@code void}.
  *
  * <p> Types should be compared using the utility methods in {@link
  * Types}.  There is no guarantee that any particular type will always
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
index 46cc270..6edba8e 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
@@ -79,9 +79,9 @@
     protected AbstractAnnotationValueVisitor6() {}
 
     /**
-     * Visits an annotation value as if by passing itself to that
+     * Visits any annotation value as if by passing itself to that
      * value's {@link AnnotationValue#accept accept}.  The invocation
-     * {@code v.visit(av)} is equivalent to {@code av.accept(v, p)}.
+     * {@code v.visit(av, p)} is equivalent to {@code av.accept(v, p)}.
      * @param av {@inheritDoc}
      * @param p  {@inheritDoc}
      */
@@ -106,7 +106,7 @@
      *
      * @implSpec The default implementation of this method in {@code
      * AbstractAnnotationValueVisitor6} will always throw {@code
-     * UnknownAnnotationValueException}.  This behavior is not
+     * new UnknownAnnotationValueException(av, p)}.  This behavior is not
      * required of a subclass.
      *
      * @param av {@inheritDoc}
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
index 0db2e75..7901f85 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
@@ -81,7 +81,7 @@
     /**
      * Visits any program element as if by passing itself to that
      * element's {@link Element#accept accept} method.  The invocation
-     * {@code v.visit(elem)} is equivalent to {@code elem.accept(v,
+     * {@code v.visit(elem, p)} is equivalent to {@code elem.accept(v,
      * p)}.
      *
      * @param e  the element to visit
@@ -111,7 +111,7 @@
      *
      * @implSpec The default implementation of this method in
      * {@code AbstractElementVisitor6} will always throw
-     * {@code UnknownElementException}.
+     * {@code new UnknownElementException(e, p)}.
      * This behavior is not required of a subclass.
      *
      * @param e {@inheritDoc}
@@ -136,6 +136,7 @@
      * @return the result of {@code visitUnknown}
      *
      * @since 9
+     * @spec JPMS
      */
     @Override
     public R visitModule(ModuleElement e, P p) {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java
index d313514..95f64c9 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java
@@ -63,6 +63,7 @@
  * @see AbstractElementVisitor7
  * @see AbstractElementVisitor8
  * @since 9
+ * @spec JPMS
  */
 @SupportedSourceVersion(RELEASE_9)
 public abstract class AbstractElementVisitor9<R, P> extends AbstractElementVisitor8<R, P> {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
index 99fead8..be64848 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
@@ -142,7 +142,7 @@
      *
      * @implSpec The default implementation of this method in {@code
      * AbstractTypeVisitor6} will always throw {@code
-     * UnknownTypeException}.  This behavior is not required of a
+     * new UnknownTypeException(t, p)}.  This behavior is not required of a
      * subclass.
      *
      * @param t  {@inheritDoc}
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
index db5c987..c342974 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
@@ -189,6 +189,7 @@
      * @return a list of modules in {@code elements}
      * @param elements the elements to filter
      * @since 9
+     * @spec JPMS
      */
     public static List<ModuleElement>
             modulesIn(Iterable<? extends Element> elements) {
@@ -200,6 +201,7 @@
      * @return a set of modules in {@code elements}
      * @param elements the elements to filter
      * @since 9
+     * @spec JPMS
      */
     public static Set<ModuleElement>
             modulesIn(Set<? extends Element> elements) {
@@ -236,6 +238,7 @@
      * @return a list of {@code exports} directives in {@code directives}
      * @param directives the directives to filter
      * @since 9
+     * @spec JPMS
      */
     public static List<ExportsDirective>
             exportsIn(Iterable<? extends Directive> directives) {
@@ -258,6 +261,7 @@
      * @return a list of {@code provides} directives in {@code directives}
      * @param directives the directives to filter
      * @since 9
+     * @spec JPMS
      */
     public static List<ProvidesDirective>
             providesIn(Iterable<? extends Directive> directives) {
@@ -269,6 +273,7 @@
      * @return a list of {@code requires} directives in {@code directives}
      * @param directives the directives to filter
      * @since 9
+     * @spec JPMS
      */
     public static List<RequiresDirective>
             requiresIn(Iterable<? extends Directive> directives) {
@@ -280,6 +285,7 @@
      * @return a list of {@code uses} directives in {@code directives}
      * @param directives the directives to filter
      * @since 9
+     * @spec JPMS
      */
     public static List<UsesDirective>
             usesIn(Iterable<? extends Directive> directives) {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
index fc5a985..d40971e 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
@@ -75,6 +75,7 @@
  * @see ElementKindVisitor7
  * @see ElementKindVisitor8
  * @since 9
+ * @spec JPMS
  */
 @SupportedSourceVersion(RELEASE_9)
 public class ElementKindVisitor9<R, P> extends ElementKindVisitor8<R, P> {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
index b7dd53b..8cab8fd 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
@@ -88,6 +88,7 @@
  * @see ElementScanner7
  * @see ElementScanner8
  * @since 9
+ * @spec JPMS
  */
 @SupportedSourceVersion(RELEASE_9)
 public class ElementScanner9<R, P> extends ElementScanner8<R, P> {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/Elements.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/Elements.java
index c8038b7..3f89e27 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/Elements.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/Elements.java
@@ -25,9 +25,12 @@
 
 package javax.lang.model.util;
 
-
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.LinkedHashSet;
 
 import javax.lang.model.AnnotatedConstruct;
 import javax.lang.model.element.*;
@@ -65,6 +68,7 @@
      * @param name  fully qualified package name, or an empty string for an unnamed package
      * @param module module relative to which the lookup should happen
      * @return the specified package, or {@code null} if it cannot be found
+     * @see #getAllPackageElements
      * @since 9
      */
     default PackageElement getPackageElement(ModuleElement module, CharSequence name) {
@@ -72,6 +76,49 @@
     }
 
     /**
+     * Returns all package elements with the given canonical name.
+     *
+     * There may be more than one package element with the same canonical
+     * name if the package elements are in different modules.
+     *
+     * @implSpec The default implementation of this method calls
+     * {@link #getAllModuleElements() getAllModuleElements} and stores
+     * the result. If the set of modules is empty, {@link
+     * #getPackageElement(CharSequence) getPackageElement(name)} is
+     * called passing through the name argument. If {@code
+     * getPackageElement(name)} is {@code null}, an empty set of
+     * package elements is returned; otherwise, a single-element set
+     * with the found package element is returned. If the set of
+     * modules is nonempty, the modules are iterated over and any
+     * non-{@code null} results of {@link
+     * #getPackageElement(ModuleElement, CharSequence)
+     * getPackageElement(module, name)} are accumulated into a
+     * set. The set is then returned.
+     *
+     * @param name  the canonical name
+     * @return the package elements, or an empty set if no package with the name can be found
+     * @see #getPackageElement(ModuleElement, CharSequence)
+     * @since 9
+     */
+    default Set<? extends PackageElement> getAllPackageElements(CharSequence name) {
+        Set<? extends ModuleElement> modules = getAllModuleElements();
+        if (modules.isEmpty()) {
+            PackageElement packageElt = getPackageElement(name);
+            return (packageElt != null) ?
+                Collections.singleton(packageElt):
+                Collections.emptySet();
+        } else {
+            Set<PackageElement> result = new LinkedHashSet<>(1); // Usually expect at most 1 result
+            for (ModuleElement module: modules) {
+                PackageElement packageElt = getPackageElement(module, name);
+                if (packageElt != null)
+                    result.add(packageElt);
+            }
+            return Collections.unmodifiableSet(result);
+        }
+    }
+
+    /**
      * Returns a type element given its canonical name if the type element is unique in the environment.
      * If running with modules, all modules in the modules graph are searched for matching
      * type elements.
@@ -90,6 +137,7 @@
      * @param name  the canonical name
      * @param module module relative to which the lookup should happen
      * @return the named type element, or {@code null} if it cannot be found
+     * @see #getAllTypeElements
      * @since 9
      */
     default TypeElement getTypeElement(ModuleElement module, CharSequence name) {
@@ -97,11 +145,54 @@
     }
 
     /**
+     * Returns all type elements with the given canonical name.
+     *
+     * There may be more than one type element with the same canonical
+     * name if the type elements are in different modules.
+     *
+     * @implSpec The default implementation of this method calls
+     * {@link #getAllModuleElements() getAllModuleElements} and stores
+     * the result. If the set of modules is empty, {@link
+     * #getTypeElement(CharSequence) getTypeElement(name)} is called
+     * passing through the name argument. If {@code
+     * getTypeElement(name)} is {@code null}, an empty set of type
+     * elements is returned; otherwise, a single-element set with the
+     * found type element is returned. If the set of modules is
+     * nonempty, the modules are iterated over and any non-{@code null}
+     * results of {@link #getTypeElement(ModuleElement,
+     * CharSequence) getTypeElement(module, name)} are accumulated
+     * into a set. The set is then returned.
+     *
+     * @param name  the canonical name
+     * @return the type elements, or an empty set if no type with the name can be found
+     * @see #getTypeElement(ModuleElement, CharSequence)
+     * @since 9
+     */
+    default Set<? extends TypeElement> getAllTypeElements(CharSequence name) {
+        Set<? extends ModuleElement> modules = getAllModuleElements();
+        if (modules.isEmpty()) {
+            TypeElement typeElt = getTypeElement(name);
+            return (typeElt != null) ?
+                Collections.singleton(typeElt):
+                Collections.emptySet();
+        } else {
+            Set<TypeElement> result = new LinkedHashSet<>(1); // Usually expect at most 1 result
+            for (ModuleElement module: modules) {
+                TypeElement typeElt = getTypeElement(module, name);
+                if (typeElt != null)
+                    result.add(typeElt);
+            }
+            return Collections.unmodifiableSet(result);
+        }
+    }
+
+    /**
      * Returns a module element given its fully qualified name.
-     * If the named module cannot be found, null is returned. One situation where a module
-     * cannot be found is if the environment does not include modules, such as
-     * an annotation processing environment configured for
-     * a {@linkplain
+     *
+     * If the named module cannot be found, {@code null} is
+     * returned. One situation where a module cannot be found is if
+     * the environment does not include modules, such as an annotation
+     * processing environment configured for a {@linkplain
      * javax.annotation.processing.ProcessingEnvironment#getSourceVersion
      * source version} without modules.
      *
@@ -110,13 +201,36 @@
      *
      * @param name  the name
      * @return the named module element, or {@code null} if it cannot be found
+     * @see #getAllModuleElements
      * @since 9
+     * @spec JPMS
      */
     default ModuleElement getModuleElement(CharSequence name) {
         return null;
     }
 
     /**
+     * Returns all module elements in the current environment.
+     *
+     * If no modules are present, an empty set is returned. One
+     * situation where no modules are present occurs when the
+     * environment does not include modules, such as an annotation
+     * processing environment configured for a {@linkplain
+     * javax.annotation.processing.ProcessingEnvironment#getSourceVersion
+     * source version} without modules.
+     *
+     * @implSpec The default implementation of this method returns
+     * an empty set.
+     *
+     * @return the known module elements, or an empty set if there are no modules
+     * @see #getModuleElement(CharSequence)
+     * @since 9
+     */
+    default Set<? extends ModuleElement> getAllModuleElements() {
+        return Collections.emptySet();
+    }
+
+    /**
      * Returns the values of an annotation's elements, including defaults.
      *
      * @see AnnotationMirror#getElementValues()
@@ -359,6 +473,7 @@
      * @param type the element being examined
      * @return the module of an element
      * @since 9
+     * @spec JPMS
      */
     default ModuleElement getModuleOf(Element type) {
         return null;
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
index 3b9f3f0..dad6c4e 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
@@ -71,6 +71,7 @@
  * @see SimpleElementVisitor7
  * @see SimpleElementVisitor8
  * @since 9
+ * @spec JPMS
  */
 @SupportedSourceVersion(RELEASE_9)
 public class SimpleElementVisitor9<R, P> extends SimpleElementVisitor8<R, P> {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java
index 7563ec8..566888c 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@
  *
  * @see SimpleTypeVisitor6
  * @see SimpleTypeVisitor7
- * @since 1.8
+ * @since 9
  */
 @SupportedSourceVersion(RELEASE_9)
 public class SimpleTypeVisitor9<R, P> extends SimpleTypeVisitor8<R, P> {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/Types.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/Types.java
index e4bc4e8..1c736c7 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/Types.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/Types.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -91,7 +91,7 @@
      * @param t2  the second type
      * @return {@code true} if and only if the first type is a subtype
      *          of the second
-     * @throws IllegalArgumentException if given an executable or package type
+     * @throws IllegalArgumentException if given a type for an executable, package, or module
      * @jls 4.10 Subtyping
      */
     boolean isSubtype(TypeMirror t1, TypeMirror t2);
@@ -103,7 +103,7 @@
      * @param t2  the second type
      * @return {@code true} if and only if the first type is assignable
      *          to the second
-     * @throws IllegalArgumentException if given an executable or package type
+     * @throws IllegalArgumentException if given a type for an executable, package, or module
      * @jls 5.2 Assignment Conversion
      */
     boolean isAssignable(TypeMirror t1, TypeMirror t2);
@@ -114,7 +114,7 @@
      * @param t1  the first type
      * @param t2  the second type
      * @return {@code true} if and only if the first type contains the second
-     * @throws IllegalArgumentException if given an executable or package type
+     * @throws IllegalArgumentException if given a type for an executable, package, or module
      * @jls 4.5.1.1 Type Argument Containment and Equivalence
      */
     boolean contains(TypeMirror t1, TypeMirror t2);
@@ -139,7 +139,7 @@
      *
      * @param t  the type being examined
      * @return the direct supertypes, or an empty list if none
-     * @throws IllegalArgumentException if given an executable or package type
+     * @throws IllegalArgumentException if given a type for an executable, package, or module
      * @jls 4.10 Subtyping
      */
     List<? extends TypeMirror> directSupertypes(TypeMirror t);
@@ -149,7 +149,7 @@
      *
      * @param t  the type to be erased
      * @return the erasure of the given type
-     * @throws IllegalArgumentException if given a package type
+     * @throws IllegalArgumentException if given a type for a package or module
      * @jls 4.6 Type Erasure
      */
     TypeMirror erasure(TypeMirror t);
@@ -181,7 +181,7 @@
      *
      * @param t  the type to be converted
      * @return the result of applying capture conversion
-     * @throws IllegalArgumentException if given an executable or package type
+     * @throws IllegalArgumentException if given a type for an executable, package, or module
      * @jls 5.1.10 Capture Conversion
      */
     TypeMirror capture(TypeMirror t);
@@ -206,9 +206,14 @@
      * Returns a pseudo-type used where no actual type is appropriate.
      * The kind of type to return may be either
      * {@link TypeKind#VOID VOID} or {@link TypeKind#NONE NONE}.
-     * For packages, use
-     * {@link Elements#getPackageElement(CharSequence)}{@code .asType()}
-     * instead.
+     *
+     * <p>To get the pseudo-type corresponding to a package or module,
+     * call {@code asType()} on the element modeling the {@linkplain
+     * PackageElement package} or {@linkplain ModuleElement
+     * module}. Names can be converted to elements for packages or
+     * modules using {@link Elements#getPackageElement(CharSequence)}
+     * or {@link Elements#getModuleElement(CharSequence)},
+     * respectively.
      *
      * @param kind  the kind of type to return
      * @return a pseudo-type of kind {@code VOID} or {@code NONE}
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/DocumentationTool.java b/langtools/src/java.compiler/share/classes/javax/tools/DocumentationTool.java
index aeb7b98..6ca4b15 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/DocumentationTool.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/DocumentationTool.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,8 @@
 /**
  * Interface to invoke Java&trade; programming language documentation tools from
  * programs.
+ *
+ * @since 1.8
  */
 public interface DocumentationTool extends Tool, OptionChecker {
     /**
@@ -121,7 +123,21 @@
      */
     interface DocumentationTask extends Callable<Boolean> {
         /**
-         * Set the locale to be applied when formatting diagnostics and
+         * Adds root modules to be taken into account during module
+         * resolution.
+         * Invalid module names may cause either
+         * {@code IllegalArgumentException} to be thrown,
+         * or diagnostics to be reported when the task is started.
+         * @param moduleNames the names of the root modules
+         * @throws IllegalArgumentException may be thrown for some
+         *      invalid module names
+         * @throws IllegalStateException if the task has started
+         * @since 9
+         */
+        void addModules(Iterable<String> moduleNames);
+
+        /**
+         * Sets the locale to be applied when formatting diagnostics and
          * other localized data.
          *
          * @param locale the locale to apply; {@code null} means apply no
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java b/langtools/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java
index 040a843..50d7c2b 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -165,22 +165,42 @@
         fileManager.close();
     }
 
+    /**
+     * @since 9
+     * @spec JPMS
+     */
     public Location getLocationForModule(Location location, String moduleName) throws IOException {
         return fileManager.getLocationForModule(location, moduleName);
     }
 
-    public Location getLocationForModule(Location location, JavaFileObject fo, String pkgName) throws IOException {
-        return fileManager.getLocationForModule(location, fo, pkgName);
+    /**
+     * @since 9
+     * @spec JPMS
+     */
+    public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
+        return fileManager.getLocationForModule(location, fo);
     }
 
+    /**
+     * @since 9
+     * @spec JPMS
+     */
     public <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service) throws  IOException {
         return fileManager.getServiceLoader(location, service);
     }
 
+    /**
+     * @since 9
+     * @spec JPMS
+     */
     public String inferModuleName(Location location) throws IOException {
         return fileManager.inferModuleName(location);
     }
 
+    /**
+     * @since 9
+     * @spec JPMS
+     */
     public Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException {
         return fileManager.listLocationsForModules(location);
     }
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/JavaCompiler.java b/langtools/src/java.compiler/share/classes/javax/tools/JavaCompiler.java
index 2aae7ae..3c6ce0d 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/JavaCompiler.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/JavaCompiler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 
 package javax.tools;
 
-import java.io.File;
 import java.io.Writer;
 import java.nio.charset.Charset;
 import java.util.Locale;
@@ -296,6 +295,19 @@
      * {@linkplain #setProcessors setProcessors} method.
      */
     interface CompilationTask extends Callable<Boolean> {
+        /**
+         * Adds root modules to be taken into account during module
+         * resolution.
+         * Invalid module names may cause either
+         * {@code IllegalArgumentException} to be thrown,
+         * or diagnostics to be reported when the task is started.
+         * @param moduleNames the names of the root modules
+         * @throws IllegalArgumentException may be thrown for some
+         *      invalid module names
+         * @throws IllegalStateException if the task has started
+         * @since 9
+         */
+        void addModules(Iterable<String> moduleNames);
 
         /**
          * Sets processors (for annotation processing).  This will
@@ -307,7 +319,7 @@
         void setProcessors(Iterable<? extends Processor> processors);
 
         /**
-         * Set the locale to be applied when formatting diagnostics and
+         * Sets the locale to be applied when formatting diagnostics and
          * other localized data.
          *
          * @param locale the locale to apply; {@code null} means apply no
@@ -330,6 +342,7 @@
          * in user code.
          * @throws IllegalStateException if called more than once
          */
+        @Override
         Boolean call();
     }
 }
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/JavaFileManager.java b/langtools/src/java.compiler/share/classes/javax/tools/JavaFileManager.java
index 3f1122a..ec2e6c3 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/JavaFileManager.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/JavaFileManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@
      * It is not possible to directly list the classes in a module-oriented
      * location. Instead, you can get a package-oriented location for any specific module
      * using methods like {@link JavaFileManager#getLocationForModule} or
-     * {@link JavaFileManager#listLocationsForModule}.
+     * {@link JavaFileManager#listLocationsForModules}.
      */
     interface Location {
         /**
@@ -165,6 +165,7 @@
          *
          * @return true if this location is expected to contain modules
          * @since 9
+         * @spec JPMS
          */
         default boolean isModuleOrientedLocation() {
             return getName().matches("\\bMODULE\\b");
@@ -472,26 +473,23 @@
      * @throws IllegalArgumentException if the location is neither an output location nor a
      * module-oriented location
      * @since 9
+     * @spec JPMS
      */ // TODO: describe failure modes
     default Location getLocationForModule(Location location, String moduleName) throws IOException {
         throw new UnsupportedOperationException();
     }
 
     /**
-     * Gets a location for the module containing a specific file representing a Java
-     * source or class, to be found within a location, which may be either
+     * Gets a location for the module containing a specific file
+     * to be found within a location, which may be either
      * a module-oriented location or an output location.
      * The result will be an output location if the given location is
      * an output location, or it will be a package-oriented location.
      *
-     * @apiNote the package name is used to identify the position of the file object
-     * within the <em>module/package/class</em> hierarchy identified by by the location.
-     *
      * @implSpec This implementation throws {@code UnsupportedOperationException}.
      *
      * @param location the module-oriented location
      * @param fo the file
-     * @param pkgName the package name for the class(es) defined in this file
      * @return the module containing the file
      *
      * @throws IOException if an I/O error occurred
@@ -499,8 +497,9 @@
      * @throws IllegalArgumentException if the location is neither an output location nor a
      * module-oriented location
      * @since 9
+     * @spec JPMS
      */
-    default Location getLocationForModule(Location location, JavaFileObject fo, String pkgName) throws IOException {
+    default Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
         throw new UnsupportedOperationException();
     }
 
@@ -522,6 +521,7 @@
      * @throws IOException if an I/O error occurred
      * @throws UnsupportedOperationException if this operation if not supported by this file manager
      * @since 9
+     * @spec JPMS
      */ // TODO: describe failure modes
     default <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service) throws  IOException {
         throw new UnsupportedOperationException();
@@ -540,6 +540,7 @@
      * @throws UnsupportedOperationException if this operation if not supported by this file manager
      * @throws IllegalArgumentException if the location is not one known to this file manager
      * @since 9
+     * @spec JPMS
      */ // TODO: describe failure modes
     default String inferModuleName(Location location) throws IOException {
         throw new UnsupportedOperationException();
@@ -559,6 +560,7 @@
      * @throws UnsupportedOperationException if this operation if not supported by this file manager
      * @throws IllegalArgumentException if the location is not a module-oriented location
      * @since 9
+     * @spec JPMS
      */ // TODO: describe failure modes
     default Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException {
         throw new UnsupportedOperationException();
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java b/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
index 2c33367..9d5661b 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -142,6 +142,17 @@
  * files in the {@linkplain java.nio.file.FileSystems#getDefault() default file system.}
  * It is recommended that implementations should support Path objects from any filesystem.</p>
  *
+ *
+ * @apiNote
+ * Some methods on this interface take a {@code Collection<? extends Path>}
+ * instead of {@code Iterable<? extends Path>}.
+ * This is to prevent the possibility of accidentally calling the method
+ * with a single {@code Path} as such an argument, because although
+ * {@code Path} implements {@code Iterable<Path>}, it would almost never be
+ * correct to call these methods with a single {@code Path} and have it be treated as
+ * an {@code Iterable} of its components.
+ *
+ *
  * @author Peter von der Ah&eacute;
  * @since 1.6
  */
@@ -266,6 +277,10 @@
      * Associates the given search path with the given location.  Any
      * previous value will be discarded.
      *
+     * If the location is a module-oriented or output location, any module-specific
+     * associations set up by {@linkplain #setLocationForModule setLocationForModule}
+     * will be cancelled.
+     *
      * @param location a location
      * @param files a list of files, if {@code null} use the default
      * search path for this location
@@ -279,24 +294,18 @@
         throws IOException;
 
     /**
-     * Associates the given search path with the given location.  Any
-     * previous value will be discarded.
+     * Associates the given search path with the given location.
+     * Any previous value will be discarded.
      *
-     * @apiNote
-     * The type of the {@code paths} parameter is a {@code Collection}
-     * and not {@code Iterable}. This is to prevent the possibility of
-     * accidentally calling the method with a single {@code Path} as
-     * the second argument, because although {@code Path} implements
-     * {@code Iterable<Path>}, it would almost never be correct to call
-     * this method with a single {@code Path} and have it be treated as
-     * an {@code Iterable} of its components.
-     *
+     * If the location is a module-oriented or output location, any module-specific
+     * associations set up by {@linkplain #setLocationForModule setLocationForModule}
+     * will be cancelled.
      *
      * @implSpec
      * The default implementation converts each path to a file and calls
      * {@link #getJavaFileObjectsFromFiles getJavaObjectsFromFiles}.
-     * IllegalArgumentException will be thrown if any of the paths
-     * cannot be converted to a file.
+     * {@linkplain IllegalArgumentException IllegalArgumentException}
+     * will be thrown if any of the paths cannot be converted to a file.
      *
      * @param location a location
      * @param paths a list of paths, if {@code null} use the default
@@ -316,6 +325,39 @@
     }
 
     /**
+     * Associates the given search path with the given module and location,
+     * which must be a module-oriented or output location.
+     * Any previous value will be discarded.
+     * This overrides any default association derived from the search path
+     * associated with the location itself.
+     *
+     * All such module-specific associations will be cancelled if a
+     * new search path is associated with the location by calling
+     * {@linkplain #setLocation setLocation } or
+     * {@linkplain #setLocationFromPaths setLocationFromPaths}.
+     *
+     * @throws IllegalStateException if the location is not a module-oriented
+     *  or output location.
+     * @throws UnsupportedOperationException if this operation is not supported by
+     *  this file manager.
+     * @throws IOException if {@code location} is an output location and
+     * {@code paths} does not represent an existing directory
+     *
+     * @param location the location
+     * @param moduleName the name of the module
+     * @param paths the search path to associate with the location and module.
+     *
+     * @see setLocation
+     * @see setLocationFromPaths
+     *
+     * @since 9
+     */
+    default void setLocationForModule(Location location, String moduleName,
+            Collection<? extends Path> paths) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
      * Returns the search path associated with the given location.
      *
      * @param location a location
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/StandardLocation.java b/langtools/src/java.compiler/share/classes/javax/tools/StandardLocation.java
index b90f016..ee4bbb1 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/StandardLocation.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/StandardLocation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,6 +64,7 @@
 
     /**
      * Location to search for modules containing annotation processors.
+     * @spec JPMS
      * @since 9
      */
     ANNOTATION_PROCESSOR_MODULE_PATH,
@@ -82,27 +83,38 @@
 
     /**
      * Location to search for the source code of modules.
+     * @spec JPMS
      * @since 9
      */
     MODULE_SOURCE_PATH,
 
     /**
      * Location to search for upgradeable system modules.
+     * @spec JPMS
      * @since 9
      */
     UPGRADE_MODULE_PATH,
 
     /**
      * Location to search for system modules.
+     * @spec JPMS
      * @since 9
      */
     SYSTEM_MODULES,
 
     /**
      * Location to search for precompiled user modules.
+     * @spec JPMS
      * @since 9
      */
-    MODULE_PATH;
+    MODULE_PATH,
+
+    /**
+     * Location to search for module patches.
+     * @spec JPMS
+     * @since 9
+     */
+    PATCH_MODULE_PATH;
 
     /**
      * Returns a location object with the given name.  The following
@@ -115,6 +127,9 @@
      *
      * @param name a name
      * @return a location
+     *
+     * @revised 9
+     * @spec JPMS
      */
     public static Location locationFor(final String name) {
         if (locations.isEmpty()) {
@@ -150,6 +165,10 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     * @since 9
+     */
     @Override
     public boolean isModuleOrientedLocation() {
         switch (this) {
@@ -158,6 +177,7 @@
             case UPGRADE_MODULE_PATH:
             case SYSTEM_MODULES:
             case MODULE_PATH:
+            case PATCH_MODULE_PATH:
                 return true;
             default:
                 return false;
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java b/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java
index a77f161..91203e1 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java
@@ -106,7 +106,7 @@
     static {
         Class<?> c = null;
         try {
-            c = Class.forName("java.lang.reflect.Module");
+            c = Class.forName("java.lang.Module");
         } catch (Throwable t) {
         }
         useLegacy = (c == null);
diff --git a/langtools/src/java.compiler/share/classes/module-info.java b/langtools/src/java.compiler/share/classes/module-info.java
index 093f748..b7fbef6 100644
--- a/langtools/src/java.compiler/share/classes/module-info.java
+++ b/langtools/src/java.compiler/share/classes/module-info.java
@@ -29,6 +29,9 @@
   * These APIs model declarations and types of the Java programming language,
   * and define interfaces for tools such as compilers which can be invoked
   * from a program.
+  *
+  * @moduleGraph
+  * @since 9
   */
 module java.compiler {
     exports javax.annotation.processing;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties
index c419bcc..2b8d951 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -41,8 +41,10 @@
 dc.exception.not.thrown = \u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0}
 dc.invalid.anchor = \u30A2\u30F3\u30AB\u30FC\u306E\u540D\u524D\u304C\u7121\u52B9\u3067\u3059: "{0}"
 dc.invalid.param = \u7121\u52B9\u306A@param\u306E\u4F7F\u7528
+dc.invalid.provides = \u7121\u52B9\u306A@provides\u306E\u4F7F\u7528
 dc.invalid.return = \u7121\u52B9\u306A@return\u306E\u4F7F\u7528
 dc.invalid.throws = \u7121\u52B9\u306A@throws\u306E\u4F7F\u7528
+dc.invalid.uses = \u7121\u52B9\u306A@uses\u306E\u4F7F\u7528
 dc.invalid.uri = \u7121\u52B9\u306AURI: "{0}"
 dc.missing.comment = \u30B3\u30E1\u30F3\u30C8\u306A\u3057
 dc.missing.param = {0}\u306E@param\u304C\u3042\u308A\u307E\u305B\u3093
@@ -52,6 +54,7 @@
 dc.no.summary.or.caption.for.table=\u8868\u306E\u8981\u7D04\u307E\u305F\u306F\u30AD\u30E3\u30D7\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u305B\u3093
 dc.param.name.not.found = @param name\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 dc.ref.not.found = \u53C2\u7167\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
+dc.service.not.found = \u30B5\u30FC\u30D3\u30B9\u30FB\u30BF\u30A4\u30D7\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 dc.tag.code.within.code = <code>\u5185\u306E'{@code'}
 dc.tag.empty = \u7A7A\u306E<{0}>\u30BF\u30B0
 dc.tag.end.not.permitted = \u7121\u52B9\u306A\u7D42\u4E86\u30BF\u30B0: </{0}>
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties
index 6455601..7461081 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -41,8 +41,10 @@
 dc.exception.not.thrown = \u672A\u629B\u51FA\u5F02\u5E38\u9519\u8BEF: {0}
 dc.invalid.anchor = \u951A\u5B9A\u70B9\u7684\u540D\u79F0\u65E0\u6548: "{0}"
 dc.invalid.param = @param \u7684\u7528\u6CD5\u65E0\u6548
+dc.invalid.provides = @provides \u7684\u7528\u6CD5\u65E0\u6548
 dc.invalid.return = @return \u7684\u7528\u6CD5\u65E0\u6548
 dc.invalid.throws = @throws \u7684\u7528\u6CD5\u65E0\u6548
+dc.invalid.uses = @uses \u7684\u7528\u6CD5\u65E0\u6548
 dc.invalid.uri = URI \u65E0\u6548: "{0}"
 dc.missing.comment = \u6CA1\u6709\u6CE8\u91CA
 dc.missing.param = {0}\u6CA1\u6709 @param
@@ -52,6 +54,7 @@
 dc.no.summary.or.caption.for.table=\u8868\u6CA1\u6709\u6982\u8981\u6216\u6807\u9898
 dc.param.name.not.found = @param name \u672A\u627E\u5230
 dc.ref.not.found = \u627E\u4E0D\u5230\u5F15\u7528
+dc.service.not.found = \u627E\u4E0D\u5230\u670D\u52A1\u7C7B\u578B
 dc.tag.code.within.code = '{@code'} \u5728 <code> \u4E2D
 dc.tag.empty = <{0}> \u6807\u8BB0\u4E3A\u7A7A
 dc.tag.end.not.permitted = \u65E0\u6548\u7684\u7ED3\u675F\u6807\u8BB0: </{0}>
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/BasicJavacTask.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/BasicJavacTask.java
index 43c0e90..f96d8df 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/BasicJavacTask.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/BasicJavacTask.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -155,6 +155,11 @@
     }
 
     @Override @DefinedBy(Api.COMPILER)
+    public void addModules(Iterable<String> moduleNames) {
+        throw new IllegalStateException();
+    }
+
+    @Override @DefinedBy(Api.COMPILER)
     public void setProcessors(Iterable<? extends Processor> processors) {
         throw new IllegalStateException();
     }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java
index 9745052..fc699f01 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -359,9 +359,9 @@
         }
 
         @Override @DefinedBy(Api.COMPILER)
-        public Location getLocationForModule(Location location, JavaFileObject fo, String pkgName) throws IOException {
+        public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
             try {
-                return clientJavaFileManager.getLocationForModule(location, fo, pkgName);
+                return clientJavaFileManager.getLocationForModule(location, unwrap(fo));
             } catch (ClientCodeException e) {
                 throw e;
             } catch (RuntimeException | Error e) {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
index 2793462..90e4b31 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,17 +33,12 @@
 
 import javax.annotation.processing.Processor;
 import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
 import javax.lang.model.element.TypeElement;
-import javax.lang.model.util.ElementFilter;
 import javax.tools.*;
-import javax.tools.JavaFileObject.Kind;
 
 import com.sun.source.tree.*;
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
-import com.sun.tools.javac.code.Symbol.ModuleSymbol;
-import com.sun.tools.javac.code.Symbol.PackageSymbol;
 import com.sun.tools.javac.comp.*;
 import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.main.*;
@@ -82,6 +77,7 @@
     private ListBuffer<Env<AttrContext>> genList;
     private final AtomicBoolean used = new AtomicBoolean();
     private Iterable<? extends Processor> processors;
+    private ListBuffer<String> addModules = new ListBuffer<>();
 
     protected JavacTaskImpl(Context context) {
         super(context, true);
@@ -101,7 +97,7 @@
                 prepareCompiler(false);
                 if (compiler.errorCount() > 0)
                     return Main.Result.ERROR;
-                compiler.compile(args.getFileObjects(), args.getClassNames(), processors);
+                compiler.compile(args.getFileObjects(), args.getClassNames(), processors, addModules);
                 return (compiler.errorCount() > 0) ? Main.Result.ERROR : Main.Result.OK; // FIXME?
             }, Main.Result.SYSERR, Main.Result.ABNORMAL);
         } finally {
@@ -114,6 +110,18 @@
     }
 
     @Override @DefinedBy(Api.COMPILER)
+    public void addModules(Iterable<String> moduleNames) {
+        Objects.requireNonNull(moduleNames);
+        // not mt-safe
+        if (used.get())
+            throw new IllegalStateException();
+        for (String m : moduleNames) {
+            Objects.requireNonNull(m);
+            addModules.add(m);
+        }
+    }
+
+    @Override @DefinedBy(Api.COMPILER)
     public void setProcessors(Iterable<? extends Processor> processors) {
         Objects.requireNonNull(processors);
         // not mt-safe
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java
index 32b2113..f57ab01 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -418,6 +418,7 @@
 
     private Symbol attributeDocReference(TreePath path, DCReference ref) {
         Env<AttrContext> env = getAttrContext(path);
+        if (env == null) return null;
 
         Log.DeferredDiagnosticHandler deferredDiagnosticHandler =
                 new Log.DeferredDiagnosticHandler(log);
@@ -482,7 +483,7 @@
                 paramTypes = lb.toList();
             }
 
-            ClassSymbol sym = (ClassSymbol) types.cvarUpperBound(tsym.type).tsym;
+            ClassSymbol sym = (ClassSymbol) types.skipTypeVars(tsym.type, false).tsym;
 
             Symbol msym = (memberName == sym.name)
                     ? findConstructor(sym, paramTypes)
@@ -881,6 +882,7 @@
                 case INTERFACE:
 //                    System.err.println("CLASS: " + ((JCClassDecl)tree).sym.getSimpleName());
                     env = enter.getClassEnv(((JCClassDecl)tree).sym);
+                    if (env == null) return null;
                     break;
                 case METHOD:
 //                    System.err.println("METHOD: " + ((JCMethodDecl)tree).sym.getSimpleName());
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java
index c9c1523..e7a782e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java
@@ -553,20 +553,47 @@
 
         Location classLocn = msym.classLocation;
         Location sourceLocn = msym.sourceLocation;
+        Location patchLocn = msym.patchLocation;
+        Location patchOutLocn = msym.patchOutputLocation;
 
-        if (wantClassFiles && (classLocn != null)) {
-            fillIn(p, classLocn,
-                   list(classLocn,
-                        p,
-                        packageName,
-                        classKinds));
-        }
-        if (wantSourceFiles && (sourceLocn != null)) {
-            fillIn(p, sourceLocn,
-                   list(sourceLocn,
-                        p,
-                        packageName,
-                        sourceKinds));
+        boolean prevPreferCurrent = preferCurrent;
+
+        try {
+            preferCurrent = false;
+            if (wantClassFiles && (patchOutLocn != null)) {
+                fillIn(p, patchOutLocn,
+                       list(patchOutLocn,
+                            p,
+                            packageName,
+                            classKinds));
+            }
+            if ((wantClassFiles || wantSourceFiles) && (patchLocn != null)) {
+                Set<JavaFileObject.Kind> combined = EnumSet.noneOf(JavaFileObject.Kind.class);
+                combined.addAll(classKinds);
+                combined.addAll(sourceKinds);
+                fillIn(p, patchLocn,
+                       list(patchLocn,
+                            p,
+                            packageName,
+                            combined));
+            }
+            preferCurrent = true;
+            if (wantClassFiles && (classLocn != null)) {
+                fillIn(p, classLocn,
+                       list(classLocn,
+                            p,
+                            packageName,
+                            classKinds));
+            }
+            if (wantSourceFiles && (sourceLocn != null)) {
+                fillIn(p, sourceLocn,
+                       list(sourceLocn,
+                            p,
+                            packageName,
+                            sourceKinds));
+            }
+        } finally {
+            preferCurrent = prevPreferCurrent;
         }
     }
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java
index e8ae0be..8f9c33c 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,8 +30,7 @@
 import java.util.Set;
 
 import javax.lang.model.element.ModuleElement;
-import javax.lang.model.element.PackageElement;
-import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.ModuleElement.DirectiveVisitor;
 
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.code.Symbol.ModuleSymbol;
@@ -53,8 +52,8 @@
 
     /** Flags for RequiresDirective. */
     public enum RequiresFlag {
-        TRANSITIVE(0x0010),
-        STATIC_PHASE(0x0020),
+        TRANSITIVE(0x0020),
+        STATIC_PHASE(0x0040),
         SYNTHETIC(0x1000),
         MANDATED(0x8000),
         EXTRA(0x10000);
@@ -138,6 +137,11 @@
             else
                 return "Exports[" + packge + ":" + modules + "]";
         }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public <R, P> R accept(DirectiveVisitor<R, P> v, P p) {
+            return v.visitExports(this, p);
+        }
     }
 
     /** Flags for OpensDirective. */
@@ -204,6 +208,11 @@
             else
                 return "Opens[" + packge + ":" + modules + "]";
         }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public <R, P> R accept(DirectiveVisitor<R, P> v, P p) {
+            return v.visitOpens(this, p);
+        }
     }
 
     /**
@@ -239,6 +248,11 @@
             return "Provides[" + service + "," + impls + "]";
         }
 
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public <R, P> R accept(DirectiveVisitor<R, P> v, P p) {
+            return v.visitProvides(this, p);
+        }
+
         // TODO: delete?
         @Override
         public boolean equals(Object obj) {
@@ -297,6 +311,11 @@
         public String toString() {
             return "Requires[" + flags + "," + module + "]";
         }
+
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public <R, P> R accept(DirectiveVisitor<R, P> v, P p) {
+            return v.visitRequires(this, p);
+        }
     }
 
     /**
@@ -325,6 +344,11 @@
             return "Uses[" + service + "]";
         }
 
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public <R, P> R accept(DirectiveVisitor<R, P> v, P p) {
+            return v.visitUses(this, p);
+        }
+
         // TODO: delete?
         @Override
         public boolean equals(Object obj) {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java
index 8a05092..1e301d5 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java
@@ -118,6 +118,7 @@
             if (source.compareTo(Source.JDK1_9) >= 0) {
                 values.add(LintCategory.DEP_ANN);
             }
+            values.add(LintCategory.REQUIRES_TRANSITIVE_AUTOMATIC);
             values.add(LintCategory.OPENS);
             values.add(LintCategory.MODULE);
             values.add(LintCategory.REMOVAL);
@@ -254,6 +255,16 @@
         REMOVAL("removal"),
 
         /**
+         * Warn about use of automatic modules in the requires clauses.
+         */
+        REQUIRES_AUTOMATIC("requires-automatic"),
+
+        /**
+         * Warn about automatic modules in requires transitive.
+         */
+        REQUIRES_TRANSITIVE_AUTOMATIC("requires-transitive-automatic"),
+
+        /**
          * Warn about Serializable classes that do not provide a serial version ID.
          */
         SERIAL("serial"),
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ModuleFinder.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ModuleFinder.java
index 30de50c..3ee91a9 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ModuleFinder.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ModuleFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
 import javax.tools.JavaFileObject.Kind;
 import javax.tools.StandardLocation;
 
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.code.Symbol.Completer;
 import com.sun.tools.javac.code.Symbol.CompletionFailure;
 import com.sun.tools.javac.code.Symbol.ModuleSymbol;
@@ -90,7 +91,7 @@
 
     private ModuleNameReader moduleNameReader;
 
-    public ModuleInfoSourceFileCompleter sourceFileCompleter;
+    public ModuleNameFromSourceReader moduleNameFromSourceReader;
 
     /** Get the ModuleFinder instance for this invocation. */
     public static ModuleFinder instance(Context context) {
@@ -190,8 +191,6 @@
         return list;
     }
 
-    private boolean inFindSingleModule;
-
     public ModuleSymbol findSingleModule() {
         try {
             JavaFileObject src_fo = getModuleInfoFromLocation(StandardLocation.SOURCE_PATH, Kind.SOURCE);
@@ -204,44 +203,14 @@
             if (fo == null) {
                 msym = syms.unnamedModule;
             } else {
-                switch (fo.getKind()) {
-                    case SOURCE:
-                        if (!inFindSingleModule) {
-                            try {
-                                inFindSingleModule = true;
-                                // Note: the following will trigger a re-entrant call to Modules.enter
-                                msym = sourceFileCompleter.complete(fo);
-                                msym.module_info.classfile = fo;
-                            } finally {
-                                inFindSingleModule = false;
-                            }
-                        } else {
-                            //the module-info.java does not contain a module declaration,
-                            //avoid infinite recursion:
-                            msym = syms.unnamedModule;
-                        }
-                        break;
-                    case CLASS:
-                        Name name;
-                        try {
-                            name = names.fromString(readModuleName(fo));
-                        } catch (BadClassFile | IOException ex) {
-                            //fillIn will report proper errors:
-                            name = names.error;
-                        }
-                        msym = syms.enterModule(name);
-                        msym.module_info.classfile = fo;
-                        msym.completer = Completer.NULL_COMPLETER;
-                        classFinder.fillIn(msym.module_info);
-                        break;
-                    default:
-                        Assert.error();
-                        msym = syms.unnamedModule;
-                        break;
-                }
+                msym = readModule(fo);
             }
 
-            msym.classLocation = StandardLocation.CLASS_OUTPUT;
+            if (msym.patchLocation == null) {
+                msym.classLocation = StandardLocation.CLASS_OUTPUT;
+            } else {
+                msym.patchOutputLocation = StandardLocation.CLASS_OUTPUT;
+            }
             return msym;
 
         } catch (IOException e) {
@@ -249,6 +218,54 @@
         }
     }
 
+    private ModuleSymbol readModule(JavaFileObject fo) throws IOException {
+        Name name;
+        switch (fo.getKind()) {
+            case SOURCE:
+                name = moduleNameFromSourceReader.readModuleName(fo);
+                if (name == null) {
+                    JCDiagnostic diag =
+                        diags.fragment("file.does.not.contain.module");
+                    ClassSymbol errModuleInfo = syms.defineClass(names.module_info, syms.errModule);
+                    throw new ClassFinder.BadClassFile(errModuleInfo, fo, diag, diags);
+                }
+                break;
+            case CLASS:
+                try {
+                    name = names.fromString(readModuleName(fo));
+                } catch (BadClassFile | IOException ex) {
+                    //fillIn will report proper errors:
+                    name = names.error;
+                }
+                break;
+            default:
+                Assert.error();
+                name = names.error;
+                break;
+        }
+
+        ModuleSymbol msym = syms.enterModule(name);
+        msym.module_info.classfile = fo;
+        if (fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH) && name != names.error) {
+            msym.patchLocation = fileManager.getLocationForModule(StandardLocation.PATCH_MODULE_PATH, name.toString());
+
+            if (msym.patchLocation != null) {
+                JavaFileObject patchFO = getModuleInfoFromLocation(StandardLocation.CLASS_OUTPUT, Kind.CLASS);
+                patchFO = preferredFileObject(getModuleInfoFromLocation(msym.patchLocation, Kind.CLASS), patchFO);
+                patchFO = preferredFileObject(getModuleInfoFromLocation(msym.patchLocation, Kind.SOURCE), patchFO);
+
+                if (patchFO != null) {
+                    msym.module_info.classfile = patchFO;
+                }
+            }
+        }
+
+        msym.completer = Completer.NULL_COMPLETER;
+        classFinder.fillIn(msym.module_info);
+
+        return msym;
+    }
+
     private String readModuleName(JavaFileObject jfo) throws IOException, ModuleNameReader.BadClassFile {
         if (moduleNameReader == null)
             moduleNameReader = new ModuleNameReader();
@@ -256,7 +273,7 @@
     }
 
     private JavaFileObject getModuleInfoFromLocation(Location location, Kind kind) throws IOException {
-        if (!fileManager.hasLocation(location))
+        if (location == null || !fileManager.hasLocation(location))
             return null;
 
         return fileManager.getJavaFileForInput(location,
@@ -267,6 +284,7 @@
     private List<ModuleSymbol> scanModulePath(ModuleSymbol toFind) {
         ListBuffer<ModuleSymbol> results = new ListBuffer<>();
         Map<Name, Location> namesInSet = new HashMap<>();
+        boolean multiModuleMode = fileManager.hasLocation(StandardLocation.MODULE_SOURCE_PATH);
         while (moduleLocationIterator.hasNext()) {
             Set<Location> locns = (moduleLocationIterator.next());
             namesInSet.clear();
@@ -279,10 +297,25 @@
                             // module has already been found, so ignore this instance
                             continue;
                         }
+                        if (fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH) &&
+                            msym.patchLocation == null) {
+                            msym.patchLocation =
+                                    fileManager.getLocationForModule(StandardLocation.PATCH_MODULE_PATH,
+                                                                     msym.name.toString());
+                            if (msym.patchLocation != null &&
+                                multiModuleMode &&
+                                fileManager.hasLocation(StandardLocation.CLASS_OUTPUT)) {
+                                msym.patchOutputLocation =
+                                        fileManager.getLocationForModule(StandardLocation.CLASS_OUTPUT,
+                                                                         msym.name.toString());
+                            }
+                        }
                         if (moduleLocationIterator.outer == StandardLocation.MODULE_SOURCE_PATH) {
                             msym.sourceLocation = l;
                             if (fileManager.hasLocation(StandardLocation.CLASS_OUTPUT)) {
-                                msym.classLocation = fileManager.getLocationForModule(StandardLocation.CLASS_OUTPUT, msym.name.toString());
+                                msym.classLocation =
+                                        fileManager.getLocationForModule(StandardLocation.CLASS_OUTPUT,
+                                                                         msym.name.toString());
                             }
                         } else {
                             msym.classLocation = l;
@@ -291,7 +324,8 @@
                             moduleLocationIterator.outer == StandardLocation.UPGRADE_MODULE_PATH) {
                             msym.flags_field |= Flags.SYSTEM_MODULE;
                         }
-                        if (toFind == msym || toFind == null) {
+                        if (toFind == null ||
+                            (toFind == msym && (msym.sourceLocation != null || msym.classLocation != null))) {
                             // Note: cannot return msym directly, because we must finish
                             // processing this set first
                             results.add(msym);
@@ -313,17 +347,16 @@
 
     private void findModuleInfo(ModuleSymbol msym) {
         try {
-            JavaFileObject src_fo = (msym.sourceLocation == null) ? null
-                    : fileManager.getJavaFileForInput(msym.sourceLocation,
-                            names.module_info.toString(), Kind.SOURCE);
+            JavaFileObject fo;
 
-            JavaFileObject class_fo = (msym.classLocation == null) ? null
-                    : fileManager.getJavaFileForInput(msym.classLocation,
-                            names.module_info.toString(), Kind.CLASS);
+            fo = getModuleInfoFromLocation(msym.patchOutputLocation, Kind.CLASS);
+            fo = preferredFileObject(getModuleInfoFromLocation(msym.patchLocation, Kind.CLASS), fo);
+            fo = preferredFileObject(getModuleInfoFromLocation(msym.patchLocation, Kind.SOURCE), fo);
 
-            JavaFileObject fo = (src_fo == null) ? class_fo :
-                    (class_fo == null) ? src_fo :
-                    classFinder.preferredFileObject(src_fo, class_fo);
+            if (fo == null) {
+                fo = getModuleInfoFromLocation(msym.classLocation, Kind.CLASS);
+                fo = preferredFileObject(getModuleInfoFromLocation(msym.sourceLocation, Kind.SOURCE), fo);
+            }
 
             if (fo == null) {
                 String moduleName = msym.sourceLocation == null && msym.classLocation != null ?
@@ -352,6 +385,12 @@
         }
     }
 
+    private JavaFileObject preferredFileObject(JavaFileObject fo1, JavaFileObject fo2) {
+        if (fo1 == null) return fo2;
+        if (fo2 == null) return fo1;
+        return classFinder.preferredFileObject(fo1, fo2);
+    }
+
     Fragment getDescription(StandardLocation l) {
         switch (l) {
             case MODULE_PATH: return Fragments.LocnModule_path;
@@ -363,8 +402,8 @@
         }
     }
 
-    public interface ModuleInfoSourceFileCompleter {
-        public ModuleSymbol complete(JavaFileObject file);
+    public interface ModuleNameFromSourceReader {
+        public Name readModuleName(JavaFileObject file);
     }
 
 }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java
index 43df27f..337ca48 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java
@@ -29,8 +29,6 @@
 import java.lang.ref.WeakReference;
 import java.util.*;
 import java.util.function.BiConsumer;
-import java.util.stream.Stream;
-import java.util.stream.StreamSupport;
 
 import com.sun.tools.javac.code.Symbol.CompletionFailure;
 import com.sun.tools.javac.code.Symbol.TypeSymbol;
@@ -40,6 +38,8 @@
 
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
 import static com.sun.tools.javac.code.Scope.LookupKind.RECURSIVE;
+import static com.sun.tools.javac.util.Iterators.createCompoundIterator;
+import static com.sun.tools.javac.util.Iterators.createFilterIterator;
 
 /** A scope represents an area of visibility in a Java program. The
  *  Scope class is a container for symbols which provides
@@ -898,7 +898,11 @@
                         return tsym.members().getSymbols(sf, lookupKind);
                     }
                 };
-                return si.importFrom((TypeSymbol) origin.owner) :: iterator;
+                List<Iterable<Symbol>> results =
+                        si.importFrom((TypeSymbol) origin.owner, List.nil());
+                return () -> createFilterIterator(createCompoundIterator(results,
+                                                                         Iterable::iterator),
+                                                  s -> filter.accepts(origin, s));
             } catch (CompletionFailure cf) {
                 cfHandler.accept(imp, cf);
                 return Collections.emptyList();
@@ -918,7 +922,11 @@
                         return tsym.members().getSymbolsByName(name, sf, lookupKind);
                     }
                 };
-                return si.importFrom((TypeSymbol) origin.owner) :: iterator;
+                List<Iterable<Symbol>> results =
+                        si.importFrom((TypeSymbol) origin.owner, List.nil());
+                return () -> createFilterIterator(createCompoundIterator(results,
+                                                                         Iterable::iterator),
+                                                  s -> filter.accepts(origin, s));
             } catch (CompletionFailure cf) {
                 cfHandler.accept(imp, cf);
                 return Collections.emptyList();
@@ -942,22 +950,19 @@
             public SymbolImporter(boolean inspectSuperTypes) {
                 this.inspectSuperTypes = inspectSuperTypes;
             }
-            Stream<Symbol> importFrom(TypeSymbol tsym) {
+            List<Iterable<Symbol>> importFrom(TypeSymbol tsym, List<Iterable<Symbol>> results) {
                 if (tsym == null || !processed.add(tsym))
-                    return Stream.empty();
+                    return results;
 
-                Stream<Symbol> result = Stream.empty();
 
                 if (inspectSuperTypes) {
                     // also import inherited names
-                    result = importFrom(types.supertype(tsym.type).tsym);
+                    results = importFrom(types.supertype(tsym.type).tsym, results);
                     for (Type t : types.interfaces(tsym.type))
-                        result = Stream.concat(importFrom(t.tsym), result);
+                        results = importFrom(t.tsym, results);
                 }
 
-                return Stream.concat(StreamSupport.stream(doLookup(tsym).spliterator(), false)
-                                                  .filter(s -> filter.accepts(origin, s)),
-                                     result);
+                return results.prepend(doLookup(tsym));
             }
             abstract Iterable<Symbol> doLookup(TypeSymbol tsym);
         }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
index 4fd7b90..2298d19 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
@@ -908,6 +908,8 @@
         public Name version;
         public JavaFileManager.Location sourceLocation;
         public JavaFileManager.Location classLocation;
+        public JavaFileManager.Location patchLocation;
+        public JavaFileManager.Location patchOutputLocation;
 
         /** All directives, in natural order. */
         public List<com.sun.tools.javac.code.Directive> directives;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java
index e3704c5..71d5ed2 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java
@@ -30,12 +30,12 @@
 import java.util.Collections;
 import java.util.EnumMap;
 import java.util.Map;
-import java.util.function.Function;
 
 import javax.lang.model.type.*;
 
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.TypeMetadata.Entry;
+import com.sun.tools.javac.code.Types.TypeMapping;
 import com.sun.tools.javac.comp.Infer.IncorporationAction;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.DefinedBy.Api;
@@ -222,18 +222,12 @@
         this.metadata = metadata;
     }
 
-    /** An abstract class for mappings from types to types
+    /**
+     * A subclass of {@link Types.TypeMapping} which applies a mapping recursively to the subterms
+     * of a given type expression. This mapping returns the original type is no changes occurred
+     * when recursively mapping the original type's subterms.
      */
-    public static abstract class TypeMapping<S> extends Types.MapVisitor<S> implements Function<Type, Type> {
-
-        @Override
-        public Type apply(Type type) {
-            return visit(type);
-        }
-
-        List<Type> visit(List<Type> ts, S s) {
-            return ts.map(t -> visit(t, s));
-        }
+    public static abstract class StructuralTypeMapping<S> extends Types.TypeMapping<S> {
 
         @Override
         public Type visitClassType(ClassType t, S s) {
@@ -299,11 +293,6 @@
         }
 
         @Override
-        public Type visitCapturedType(CapturedType t, S s) {
-            return visitTypeVar(t, s);
-        }
-
-        @Override
         public Type visitForAll(ForAll t, S s) {
             return visit(t.qtype, s);
         }
@@ -373,7 +362,7 @@
         return accept(stripMetadata, null);
     }
     //where
-        private final static TypeMapping<Void> stripMetadata = new TypeMapping<Void>() {
+        private final static TypeMapping<Void> stripMetadata = new StructuralTypeMapping<Void>() {
             @Override
             public Type visitClassType(ClassType t, Void aVoid) {
                 return super.visitClassType((ClassType)t.typeNoMetadata(), aVoid);
@@ -2125,7 +2114,7 @@
             }
         }
         //where
-            TypeMapping<Void> toTypeVarMap = new TypeMapping<Void>() {
+            TypeMapping<Void> toTypeVarMap = new StructuralTypeMapping<Void>() {
                 @Override
                 public Type visitUndetVar(UndetVar uv, Void _unused) {
                     return uv.inst != null ? uv.inst : uv.qtype;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
index a8efe5e..5e4e406 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
@@ -34,6 +34,7 @@
 import java.util.Set;
 import java.util.WeakHashMap;
 import java.util.function.BiPredicate;
+import java.util.function.Function;
 import java.util.stream.Collector;
 
 import javax.tools.JavaFileObject;
@@ -2095,7 +2096,7 @@
         }
         }
     // where
-        private TypeMapping<Boolean> erasure = new TypeMapping<Boolean>() {
+        private TypeMapping<Boolean> erasure = new StructuralTypeMapping<Boolean>() {
             private Type combineMetadata(final Type s,
                                          final Type t) {
                 if (t.getMetadata() != TypeMetadata.EMPTY) {
@@ -3019,7 +3020,7 @@
         return t.map(new Subst(from, to));
     }
 
-    private class Subst extends TypeMapping<Void> {
+    private class Subst extends StructuralTypeMapping<Void> {
         List<Type> from;
         List<Type> to;
 
@@ -4707,6 +4708,25 @@
         final public Type visit(Type t) { return t.accept(this, null); }
         public Type visitType(Type t, S s) { return t; }
     }
+
+    /**
+     * An abstract class for mappings from types to types (see {@link Type#map(TypeMapping)}.
+     * This class implements the functional interface {@code Function}, that allows it to be used
+     * fluently in stream-like processing.
+     */
+    public static class TypeMapping<S> extends MapVisitor<S> implements Function<Type, Type> {
+        @Override
+        public Type apply(Type type) { return visit(type); }
+
+        List<Type> visit(List<Type> ts, S s) {
+            return ts.map(t -> visit(t, s));
+        }
+
+        @Override
+        public Type visitCapturedType(CapturedType t, S s) {
+            return visitTypeVar(t, s);
+        }
+    }
     // </editor-fold>
 
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
index 8c0539b..9cf7eae 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -362,14 +362,9 @@
 
             TreeMapper treeMapper = new TreeMapper(context);
             //TODO: to further refine the analysis, try all rewriting combinations
-            LocalCacheContext localCacheContext = argumentAttr.withLocalCacheContext();
-            try {
-                deferredAttr.attribSpeculative(fakeBlock, env, attr.statInfo, treeMapper,
-                        t -> new AnalyzeDeferredDiagHandler(context));
-            } finally {
-                localCacheContext.leave();
-            }
-
+            deferredAttr.attribSpeculative(fakeBlock, env, attr.statInfo, treeMapper,
+                    t -> new AnalyzeDeferredDiagHandler(context),
+                    argumentAttr.withLocalCacheContext());
             context.treeMap.entrySet().forEach(e -> {
                 context.treesToAnalyzer.get(e.getKey())
                         .process(e.getKey(), e.getValue(), context.errors.nonEmpty());
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java
index 7030511..eb8311d 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -105,7 +105,7 @@
     private Env<AttrContext> env;
 
     /** Result of method attribution. */
-    private Type result;
+    Type result;
 
     /** Cache for argument types; behavior is influences by the currrently selected cache policy. */
     Map<UniquePos, ArgumentType<?>> argumentTypeCache = new LinkedHashMap<>();
@@ -215,13 +215,8 @@
         processArg(that, () -> {
             T speculativeTree = (T)deferredAttr.attribSpeculative(that, env, attr.new MethodAttrInfo() {
                 @Override
-                protected void attr(JCTree tree, Env<AttrContext> env) {
-                    //avoid speculative attribution loops
-                    if (!new UniquePos(tree).equals(pos)) {
-                        super.attr(tree, env);
-                    } else {
-                        visitTree(tree);
-                    }
+                protected boolean needsArgumentAttr(JCTree tree) {
+                    return !new UniquePos(tree).equals(pos);
                 }
             });
             return argumentTypeFactory.apply(speculativeTree);
@@ -260,8 +255,10 @@
     public void visitReference(JCMemberReference tree) {
         //perform arity-based check
         Env<AttrContext> localEnv = env.dup(tree);
-        JCExpression exprTree = (JCExpression)deferredAttr.attribSpeculative(tree.getQualifierExpression(), localEnv,
-                attr.memberReferenceQualifierResult(tree));
+        JCExpression exprTree;
+        exprTree = (JCExpression)deferredAttr.attribSpeculative(tree.getQualifierExpression(), localEnv,
+                attr.memberReferenceQualifierResult(tree),
+                withLocalCacheContext());
         JCMemberReference mref2 = new TreeCopier<Void>(attr.make).copy(tree);
         mref2.expr = exprTree;
         Symbol lhsSym = TreeInfo.symbol(exprTree);
@@ -277,9 +274,9 @@
                 (res.flags() & Flags.VARARGS) != 0 ||
                 (TreeInfo.isStaticSelector(exprTree, tree.name.table.names) &&
                 exprTree.type.isRaw() && !exprTree.type.hasTag(ARRAY))) {
-            tree.overloadKind = JCMemberReference.OverloadKind.OVERLOADED;
+            tree.setOverloadKind(JCMemberReference.OverloadKind.OVERLOADED);
         } else {
-            tree.overloadKind = JCMemberReference.OverloadKind.UNOVERLOADED;
+            tree.setOverloadKind(JCMemberReference.OverloadKind.UNOVERLOADED);
         }
         //return a plain old deferred type for this
         setResult(tree, deferredAttr.new DeferredType(tree, env));
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
index 353bb1f..9ff0df0 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -448,13 +448,21 @@
 
         NORMAL,
 
-        NO_TREE_UPDATE {     // Mode signalling 'fake check' - skip tree update
+        /**
+         * Mode signalling 'fake check' - skip tree update. A side-effect of this mode is
+         * that the captured var cache in {@code InferenceContext} will be used in read-only
+         * mode when performing inference checks.
+         */
+        NO_TREE_UPDATE {
             @Override
             public boolean updateTreeType() {
                 return false;
             }
         },
-        NO_INFERENCE_HOOK { // Mode signalling that caller will manage free types in tree decorations.
+        /**
+         * Mode signalling that caller will manage free types in tree decorations.
+         */
+        NO_INFERENCE_HOOK {
             @Override
             public boolean installPostInferenceHook() {
                 return false;
@@ -497,9 +505,12 @@
             this.checkMode = checkMode;
         }
 
-        protected void attr(JCTree tree, Env<AttrContext> env) {
-            tree.accept(Attr.this);
-        }
+        /**
+         * Should {@link Attr#attribTree} use the {@ArgumentAttr} visitor instead of this one?
+         * @param tree The tree to be type-checked.
+         * @return true if {@ArgumentAttr} should be used.
+         */
+        protected boolean needsArgumentAttr(JCTree tree) { return false; }
 
         protected Type check(final DiagnosticPosition pos, final Type found) {
             return chk.checkType(pos, found, pt, checkContext);
@@ -545,8 +556,8 @@
         }
 
         @Override
-        protected void attr(JCTree tree, Env<AttrContext> env) {
-            result = argumentAttr.attribArg(tree, env);
+        protected boolean needsArgumentAttr(JCTree tree) {
+            return true;
         }
 
         protected ResultInfo dup(Type newPt) {
@@ -636,7 +647,11 @@
         try {
             this.env = env;
             this.resultInfo = resultInfo;
-            resultInfo.attr(tree, env);
+            if (resultInfo.needsArgumentAttr(tree)) {
+                result = argumentAttr.attribArg(tree, env);
+            } else {
+                tree.accept(this);
+            }
             if (tree == breakTree &&
                     resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) {
                 throw new BreakAttr(copyEnv(env));
@@ -974,8 +989,11 @@
 
             ClassSymbol owner = env.enclClass.sym;
             if ((owner.flags() & ANNOTATION) != 0 &&
-                    tree.params.nonEmpty())
-                log.error(tree.params.head.pos(),
+                    (tree.params.nonEmpty() ||
+                    tree.recvparam != null))
+                log.error(tree.params.nonEmpty() ?
+                        tree.params.head.pos() :
+                        tree.recvparam.pos(),
                         "intf.annotation.members.cant.have.params");
 
             // Attribute all value parameters.
@@ -1514,7 +1532,9 @@
                             isBooleanOrNumeric(env, condTree.falsepart);
                 case APPLY:
                     JCMethodInvocation speculativeMethodTree =
-                            (JCMethodInvocation)deferredAttr.attribSpeculative(tree, env, unknownExprInfo);
+                            (JCMethodInvocation)deferredAttr.attribSpeculative(
+                                    tree, env, unknownExprInfo,
+                                    argumentAttr.withLocalCacheContext());
                     Symbol msym = TreeInfo.symbol(speculativeMethodTree.meth);
                     Type receiverType = speculativeMethodTree.meth.hasTag(IDENT) ?
                             env.enclClass.type :
@@ -1525,10 +1545,13 @@
                     JCExpression className =
                             removeClassParams.translate(((JCNewClass)tree).clazz);
                     JCExpression speculativeNewClassTree =
-                            (JCExpression)deferredAttr.attribSpeculative(className, env, unknownTypeInfo);
+                            (JCExpression)deferredAttr.attribSpeculative(
+                                    className, env, unknownTypeInfo,
+                                    argumentAttr.withLocalCacheContext());
                     return primitiveOrBoxed(speculativeNewClassTree.type);
                 default:
-                    Type speculativeType = deferredAttr.attribSpeculative(tree, env, unknownExprInfo).type;
+                    Type speculativeType = deferredAttr.attribSpeculative(tree, env, unknownExprInfo,
+                            argumentAttr.withLocalCacheContext()).type;
                     return primitiveOrBoxed(speculativeType);
             }
         }
@@ -3058,7 +3081,8 @@
 
         if (!returnType.hasTag(VOID) && !resType.hasTag(VOID)) {
             if (resType.isErroneous() ||
-                    new FunctionalReturnContext(checkContext).compatible(resType, returnType, types.noWarnings)) {
+                    new FunctionalReturnContext(checkContext).compatible(resType, returnType,
+                            checkContext.checkWarner(tree, resType, returnType))) {
                 incompatibleReturnType = null;
             }
         }
@@ -3765,7 +3789,7 @@
                 break;
             case MTH: {
                 owntype = checkMethod(site, sym,
-                        new ResultInfo(resultInfo.pkind, resultInfo.pt.getReturnType(), resultInfo.checkContext),
+                        new ResultInfo(resultInfo.pkind, resultInfo.pt.getReturnType(), resultInfo.checkContext, resultInfo.checkMode),
                         env, TreeInfo.args(env.tree), resultInfo.pt.getParameterTypes(),
                         resultInfo.pt.getTypeArguments());
                 break;
@@ -3994,10 +4018,16 @@
                         rs.methodArguments(argtypes.map(checkDeferredMap)),
                         kindName(sym.location()),
                         sym.location());
-               owntype = new MethodType(owntype.getParameterTypes(),
-                       types.erasure(owntype.getReturnType()),
-                       types.erasure(owntype.getThrownTypes()),
-                       syms.methodClass);
+                if (resultInfo.pt != Infer.anyPoly ||
+                        !owntype.hasTag(METHOD) ||
+                        !owntype.isPartial()) {
+                    //if this is not a partially inferred method type, erase return type. Otherwise,
+                    //erasure is carried out in PartiallyInferredMethodType.check().
+                    owntype = new MethodType(owntype.getParameterTypes(),
+                            types.erasure(owntype.getReturnType()),
+                            types.erasure(owntype.getThrownTypes()),
+                            syms.methodClass);
+                }
             }
 
             PolyKind pkind = (sym.type.hasTag(FORALL) &&
@@ -4959,6 +4989,9 @@
                 that.sym = new VarSymbol(0, that.name, that.type, syms.noSymbol);
                 that.sym.adr = 0;
             }
+            if (that.vartype == null) {
+                that.vartype = make.Erroneous();
+            }
             super.visitVarDef(that);
         }
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java
index 573e894..b186da0 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -79,6 +79,10 @@
      */
     boolean isNewClass = false;
 
+    /** Indicate if the type being visited is a service implementation
+     */
+    boolean visitingServiceImplementation = false;
+
     /** Are arguments to current function applications boxed into an array for varargs?
      */
     Resolve.MethodResolutionPhase pendingResolutionPhase = null;
@@ -127,6 +131,7 @@
         info.isAnonymousDiamond = isAnonymousDiamond;
         info.isNewClass = isNewClass;
         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
+        info.visitingServiceImplementation = visitingServiceImplementation;
         return info;
     }
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
index 117da71..317f759 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
@@ -2107,10 +2107,32 @@
         Name moduleName = tree.sym.name;
         Assert.checkNonNull(moduleName);
         if (lint.isEnabled(LintCategory.MODULE)) {
-            String moduleNameString = moduleName.toString();
-            int nameLength = moduleNameString.length();
-            if (nameLength > 0 && Character.isDigit(moduleNameString.charAt(nameLength - 1))) {
-                log.warning(Lint.LintCategory.MODULE, tree.qualId.pos(), Warnings.PoorChoiceForModuleName(moduleName));
+            JCExpression qualId = tree.qualId;
+            while (qualId != null) {
+                Name componentName;
+                DiagnosticPosition pos;
+                switch (qualId.getTag()) {
+                    case SELECT:
+                        JCFieldAccess selectNode = ((JCFieldAccess) qualId);
+                        componentName = selectNode.name;
+                        pos = selectNode.pos();
+                        qualId = selectNode.selected;
+                        break;
+                    case IDENT:
+                        componentName = ((JCIdent) qualId).name;
+                        pos = qualId.pos();
+                        qualId = null;
+                        break;
+                    default:
+                        throw new AssertionError("Unexpected qualified identifier: " + qualId.toString());
+                }
+                if (componentName != null) {
+                    String moduleNameComponentString = componentName.toString();
+                    int nameLength = moduleNameComponentString.length();
+                    if (nameLength > 0 && Character.isDigit(moduleNameComponentString.charAt(nameLength - 1))) {
+                        log.warning(Lint.LintCategory.MODULE, pos, Warnings.PoorChoiceForModuleName(componentName));
+                    }
+                }
             }
         }
     }
@@ -3886,4 +3908,16 @@
         }
     }
 
+    void checkModuleRequires(final DiagnosticPosition pos, final RequiresDirective rd) {
+        if ((rd.module.flags() & Flags.AUTOMATIC_MODULE) != 0) {
+            deferredLintHandler.report(() -> {
+                if (rd.isTransitive() && lint.isEnabled(LintCategory.REQUIRES_TRANSITIVE_AUTOMATIC)) {
+                    log.warning(pos, Warnings.RequiresTransitiveAutomatic);
+                } else if (lint.isEnabled(LintCategory.REQUIRES_AUTOMATIC)) {
+                    log.warning(pos, Warnings.RequiresAutomatic);
+                }
+            });
+        }
+    }
+
 }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
index 3dcb047..0c726d8 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,8 @@
 import com.sun.source.tree.LambdaExpressionTree.BodyKind;
 import com.sun.source.tree.NewClassTree;
 import com.sun.tools.javac.code.*;
-import com.sun.tools.javac.code.Type.TypeMapping;
+import com.sun.tools.javac.code.Type.StructuralTypeMapping;
+import com.sun.tools.javac.code.Types.TypeMapping;
 import com.sun.tools.javac.comp.ArgumentAttr.LocalCacheContext;
 import com.sun.tools.javac.comp.Resolve.ResolveError;
 import com.sun.tools.javac.resources.CompilerProperties.Fragments;
@@ -55,6 +56,9 @@
 import java.util.WeakHashMap;
 import java.util.function.Function;
 
+import com.sun.source.tree.MemberReferenceTree;
+import com.sun.tools.javac.tree.JCTree.JCMemberReference.OverloadKind;
+
 import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
@@ -147,6 +151,27 @@
                         return super.visitNewClass(node, p);
                     }
                 }
+
+                @Override @DefinedBy(Api.COMPILER_TREE)
+                public JCTree visitMemberReference(MemberReferenceTree node, Void p) {
+                    JCMemberReference t = (JCMemberReference) node;
+                    JCExpression expr = copy(t.expr, p);
+                    List<JCExpression> typeargs = copy(t.typeargs, p);
+                    /** once the value for overloadKind is determined for a copy, it can be safely forwarded to
+                     *  the copied tree, we want to profit from that
+                     */
+                    JCMemberReference result = new JCMemberReference(t.mode, t.name, expr, typeargs) {
+                        @Override
+                        public void setOverloadKind(OverloadKind overloadKind) {
+                            super.setOverloadKind(overloadKind);
+                            if (t.getOverloadKind() == null) {
+                                t.setOverloadKind(overloadKind);
+                            }
+                        }
+                    };
+                    result.pos = t.pos;
+                    return result;
+                }
             };
         deferredCopier = new TypeMapping<Void> () {
                 @Override
@@ -445,11 +470,17 @@
      */
     JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) {
         return attribSpeculative(tree, env, resultInfo, treeCopier,
-                (newTree)->new DeferredAttrDiagHandler(log, newTree));
+                (newTree)->new DeferredAttrDiagHandler(log, newTree), null);
+    }
+
+    JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo, LocalCacheContext localCache) {
+        return attribSpeculative(tree, env, resultInfo, treeCopier,
+                (newTree)->new DeferredAttrDiagHandler(log, newTree), localCache);
     }
 
     <Z> JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo, TreeCopier<Z> deferredCopier,
-                                 Function<JCTree, DeferredDiagnosticHandler> diagHandlerCreator) {
+                                 Function<JCTree, DeferredDiagnosticHandler> diagHandlerCreator,
+                                 LocalCacheContext localCache) {
         final JCTree newTree = deferredCopier.copy(tree);
         Env<AttrContext> speculativeEnv = env.dup(newTree, env.info.dup(env.info.scope.dupUnshared(env.info.scope.owner)));
         speculativeEnv.info.isSpeculative = true;
@@ -460,6 +491,9 @@
         } finally {
             new UnenterScanner(env.toplevel.modle).scan(newTree);
             log.popDiagnosticHandler(deferredDiagnosticHandler);
+            if (localCache != null) {
+                localCache.leave();
+            }
         }
     }
     //where
@@ -846,6 +880,7 @@
 
             @Override
             public void visitReference(JCMemberReference tree) {
+                Assert.checkNonNull(tree.getOverloadKind());
                 Check.CheckContext checkContext = resultInfo.checkContext;
                 Type pt = resultInfo.pt;
                 if (!inferenceContext.inferencevars.contains(pt)) {
@@ -855,8 +890,9 @@
                         checkContext.report(null, ex.getDiagnostic());
                     }
                     Env<AttrContext> localEnv = env.dup(tree);
-                    JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
-                            attr.memberReferenceQualifierResult(tree));
+                    JCExpression exprTree;
+                    exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
+                            attr.memberReferenceQualifierResult(tree), argumentAttr.withLocalCacheContext());
                     ListBuffer<Type> argtypes = new ListBuffer<>();
                     for (Type t : types.findDescriptorType(pt).getParameterTypes()) {
                         argtypes.append(Type.noType);
@@ -929,7 +965,7 @@
      * where T is computed by retrieving the type that has already been
      * computed for D during a previous deferred attribution round of the given kind.
      */
-    class DeferredTypeMap extends TypeMapping<Void> {
+    class DeferredTypeMap extends StructuralTypeMapping<Void> {
         DeferredAttrContext deferredAttrContext;
 
         protected DeferredTypeMap(AttrMode mode, Symbol msym, MethodResolutionPhase phase) {
@@ -1124,7 +1160,7 @@
             Type descType = types.findDescriptorType(pt);
             List<Type> freeArgVars = inferenceContext.freeVarsIn(descType.getParameterTypes());
             if (freeArgVars.nonEmpty() &&
-                    tree.overloadKind == JCMemberReference.OverloadKind.OVERLOADED) {
+                    tree.getOverloadKind() == JCMemberReference.OverloadKind.OVERLOADED) {
                 stuckVars.addAll(freeArgVars);
                 depVars.addAll(inferenceContext.freeVarsIn(descType.getReturnType()));
             }
@@ -1189,7 +1225,7 @@
         @Override
         public void visitReference(JCMemberReference tree) {
             super.visitReference(tree);
-            if (tree.overloadKind == JCMemberReference.OverloadKind.OVERLOADED) {
+            if (tree.getOverloadKind() == JCMemberReference.OverloadKind.OVERLOADED) {
                 stuck = true;
             }
         }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java
index 63e84b9..4869ae3 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 import javax.tools.JavaFileManager;
 
 import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Kinds.KindName;
 import com.sun.tools.javac.code.Kinds.KindSelector;
 import com.sun.tools.javac.code.Scope.*;
 import com.sun.tools.javac.code.Symbol.*;
@@ -155,6 +156,7 @@
 
     public Env<AttrContext> getClassEnv(TypeSymbol sym) {
         Env<AttrContext> localEnv = getEnv(sym);
+        if (localEnv == null) return null;
         Env<AttrContext> lintEnv = localEnv;
         while (lintEnv.info.lint == null)
             lintEnv = lintEnv.next;
@@ -400,8 +402,14 @@
             c = syms.enterClass(env.toplevel.modle, tree.name, packge);
             packge.members().enterIfAbsent(c);
             if ((tree.mods.flags & PUBLIC) != 0 && !classNameMatchesFileName(c, env)) {
+                KindName topElement = KindName.CLASS;
+                if ((tree.mods.flags & ENUM) != 0) {
+                    topElement = KindName.ENUM;
+                } else if ((tree.mods.flags & INTERFACE) != 0) {
+                    topElement = KindName.INTERFACE;
+                }
                 log.error(tree.pos(),
-                          "class.public.should.be.in.file", tree.name);
+                          "class.public.should.be.in.file", topElement, tree.name);
             }
         } else {
             if (!tree.name.isEmpty() &&
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
index 184e438..e369c04 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
@@ -26,6 +26,8 @@
 package com.sun.tools.javac.comp;
 
 import com.sun.tools.javac.code.Type.UndetVar.UndetVarListener;
+import com.sun.tools.javac.code.Types.TypeMapping;
+import com.sun.tools.javac.comp.Attr.CheckMode;
 import com.sun.tools.javac.tree.JCTree;
 import com.sun.tools.javac.tree.JCTree.JCTypeCast;
 import com.sun.tools.javac.tree.TreeInfo;
@@ -61,9 +63,6 @@
 import java.util.Set;
 import java.util.function.BiFunction;
 import java.util.function.BiPredicate;
-import java.util.stream.Collectors;
-
-import com.sun.tools.javac.main.Option;
 
 import static com.sun.tools.javac.code.TypeTag.*;
 
@@ -192,28 +191,29 @@
                 doIncorporation(inferenceContext, warn);
                 //we are inside method attribution - just return a partially inferred type
                 return new PartiallyInferredMethodType(mt, inferenceContext, env, warn);
-            } else if (allowGraphInference &&
-                    resultInfo != null &&
-                    !warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)) {
+            } else if (allowGraphInference && resultInfo != null) {
+
                 //inject return constraints earlier
                 doIncorporation(inferenceContext, warn); //propagation
 
-                boolean shouldPropagate = shouldPropagate(mt.getReturnType(), resultInfo, inferenceContext);
+                if (!warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)) {
+                    boolean shouldPropagate = shouldPropagate(mt.getReturnType(), resultInfo, inferenceContext);
 
-                InferenceContext minContext = shouldPropagate ?
-                        inferenceContext.min(roots(mt, deferredAttrContext), true, warn) :
-                        inferenceContext;
+                    InferenceContext minContext = shouldPropagate ?
+                            inferenceContext.min(roots(mt, deferredAttrContext), true, warn) :
+                            inferenceContext;
 
-                Type newRestype = generateReturnConstraints(env.tree, resultInfo,  //B3
-                        mt, minContext);
-                mt = (MethodType)types.createMethodTypeWithReturn(mt, newRestype);
+                    Type newRestype = generateReturnConstraints(env.tree, resultInfo,  //B3
+                            mt, minContext);
+                    mt = (MethodType)types.createMethodTypeWithReturn(mt, newRestype);
 
-                //propagate outwards if needed
-                if (shouldPropagate) {
-                    //propagate inference context outwards and exit
-                    minContext.dupTo(resultInfo.checkContext.inferenceContext());
-                    deferredAttrContext.complete();
-                    return mt;
+                    //propagate outwards if needed
+                    if (shouldPropagate) {
+                        //propagate inference context outwards and exit
+                        minContext.dupTo(resultInfo.checkContext.inferenceContext());
+                        deferredAttrContext.complete();
+                        return mt;
+                    }
                 }
             }
 
@@ -319,7 +319,8 @@
                  *  need to use it several times: with several targets.
                  */
                 saved_undet = inferenceContext.save();
-                if (allowGraphInference && !warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)) {
+                boolean unchecked = warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED);
+                if (!unchecked) {
                     boolean shouldPropagate = shouldPropagate(getReturnType(), resultInfo, inferenceContext);
 
                     InferenceContext minContext = shouldPropagate ?
@@ -338,7 +339,14 @@
                     }
                 }
                 inferenceContext.solve(noWarnings);
-                return inferenceContext.asInstType(this).getReturnType();
+                Type ret = inferenceContext.asInstType(this).getReturnType();
+                if (unchecked) {
+                    //inline logic from Attr.checkMethod - if unchecked conversion was required, erase
+                    //return type _after_ resolution, and check against target
+                    ret = types.erasure(ret);
+                    resultInfo.check(env.tree, ret);
+                }
+                return ret;
             } catch (InferenceException ex) {
                 resultInfo.checkContext.report(null, ex.getDiagnostic());
                 Assert.error(); //cannot get here (the above should throw)
@@ -412,7 +420,7 @@
             }
         } else if (rsInfoInfContext.free(resultInfo.pt)) {
             //propagation - cache captured vars
-            qtype = inferenceContext.asUndetVar(rsInfoInfContext.cachedCapture(tree, from, false));
+            qtype = inferenceContext.asUndetVar(rsInfoInfContext.cachedCapture(tree, from, !resultInfo.checkMode.updateTreeType()));
         }
         Assert.check(allowGraphInference || !rsInfoInfContext.free(to),
                 "legacy inference engine cannot handle constraints on both sides of a subtyping assertion");
@@ -502,7 +510,7 @@
         inferenceContext.solve(List.of(from.qtype), new Warner());
         inferenceContext.notifyChange();
         Type capturedType = resultInfo.checkContext.inferenceContext()
-                .cachedCapture(tree, from.getInst(), false);
+                .cachedCapture(tree, from.getInst(), !resultInfo.checkMode.updateTreeType());
         if (types.isConvertible(capturedType,
                 resultInfo.checkContext.inferenceContext().asUndetVar(to))) {
             //effectively skip additional return-type constraint generation (compatibility)
@@ -624,7 +632,7 @@
             }
         }
 
-    TypeMapping<Void> fromTypeVarFun = new TypeMapping<Void>() {
+    TypeMapping<Void> fromTypeVarFun = new StructuralTypeMapping<Void>() {
         @Override
         public Type visitTypeVar(TypeVar tv, Void aVoid) {
             UndetVar uv = new UndetVar(tv, incorporationEngine(), types);
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java
index c73a421..da9128d 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -334,6 +334,9 @@
     }
 
     InferenceContext min(List<Type> roots, boolean shouldSolve, Warner warn) {
+        if (roots.length() == inferencevars.length()) {
+            return this;
+        }
         ReachabilityVisitor rv = new ReachabilityVisitor();
         rv.scan(roots);
         if (rv.min.size() == inferencevars.length()) {
@@ -347,8 +350,8 @@
         ListBuffer<Type> minUndetVars = new ListBuffer<>();
         for (Type minVar : minVars) {
             UndetVar uv = (UndetVar)asUndetVar(minVar);
-            Assert.check(uv.incorporationActions.size() == 0);
-            UndetVar uv2 = new UndetVar((TypeVar)minVar, infer.incorporationEngine(), types);
+            Assert.check(uv.incorporationActions.isEmpty());
+            UndetVar uv2 = uv.dup(types);
             for (InferenceBound ib : InferenceBound.values()) {
                 List<Type> newBounds = uv.getBounds(ib).stream()
                         .filter(b -> !redundantVars.contains(b))
@@ -363,15 +366,19 @@
         for (Type t : minContext.inferencevars) {
             //add listener that forwards notifications to original context
             minContext.addFreeTypeListener(List.of(t), (inferenceContext) -> {
-                    List<Type> depVars = List.from(rv.minMap.get(t));
-                    solve(depVars, warn);
-                    notifyChange();
+                ((UndetVar)asUndetVar(t)).setInst(inferenceContext.asInstType(t));
+                infer.doIncorporation(inferenceContext, warn);
+                solve(List.from(rv.minMap.get(t)), warn);
+                notifyChange();
             });
         }
         if (shouldSolve) {
             //solve definitively unreachable variables
             List<Type> unreachableVars = redundantVars.diff(List.from(rv.equiv));
-            solve(unreachableVars, warn);
+            minContext.addFreeTypeListener(minVars, (inferenceContext) -> {
+                solve(unreachableVars, warn);
+                notifyChange();
+            });
         }
         return minContext;
     }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java
index c0e6543..3e9e184 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java
@@ -89,7 +89,6 @@
 import com.sun.tools.javac.tree.JCTree.JCExpression;
 import com.sun.tools.javac.tree.JCTree.JCModuleDecl;
 import com.sun.tools.javac.tree.JCTree.JCOpens;
-import com.sun.tools.javac.tree.JCTree.JCPackageDecl;
 import com.sun.tools.javac.tree.JCTree.JCProvides;
 import com.sun.tools.javac.tree.JCTree.JCRequires;
 import com.sun.tools.javac.tree.JCTree.JCUses;
@@ -112,6 +111,7 @@
 import static com.sun.tools.javac.code.Flags.ENUM;
 import static com.sun.tools.javac.code.Flags.PUBLIC;
 import static com.sun.tools.javac.code.Flags.UNATTRIBUTED;
+import com.sun.tools.javac.code.Kinds;
 import static com.sun.tools.javac.code.Kinds.Kind.ERR;
 import static com.sun.tools.javac.code.Kinds.Kind.MDL;
 import static com.sun.tools.javac.code.Kinds.Kind.MTH;
@@ -145,7 +145,7 @@
 
     public final boolean multiModuleMode;
 
-    private final String moduleOverride;
+    private final String legacyModuleOverride;
 
     private final Name java_se;
     private final Name java_;
@@ -167,6 +167,8 @@
     private Set<ModuleSymbol> rootModules = null;
     private final Set<ModuleSymbol> warnedMissing = new HashSet<>();
 
+    public PackageNameFinder findPackageInFile;
+
     public static Modules instance(Context context) {
         Modules instance = context.get(Modules.class);
         if (instance == null)
@@ -192,7 +194,7 @@
 
         lintOptions = options.isUnset(Option.XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option);
 
-        moduleOverride = options.get(Option.XMODULE);
+        legacyModuleOverride = options.get(Option.XMODULE);
 
         multiModuleMode = fileManager.hasLocation(StandardLocation.MODULE_SOURCE_PATH);
         ClassWriter classWriter = ClassWriter.instance(context);
@@ -366,9 +368,33 @@
 
                 JavaFileObject prev = log.useSource(tree.sourcefile);
                 try {
-                    Location locn = getModuleLocation(tree);
-                    if (locn != null) {
-                        Name name = names.fromString(fileManager.inferModuleName(locn));
+                    Location msplocn = getModuleLocation(tree);
+                    Location plocn = fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH) ?
+                            fileManager.getLocationForModule(StandardLocation.PATCH_MODULE_PATH,
+                                                             tree.sourcefile) :
+                            null;
+
+                    if (plocn != null) {
+                        Name name = names.fromString(fileManager.inferModuleName(plocn));
+                        ModuleSymbol msym = moduleFinder.findModule(name);
+                        tree.modle = msym;
+                        rootModules.add(msym);
+
+                        if (msplocn != null) {
+                            Name mspname = names.fromString(fileManager.inferModuleName(msplocn));
+                            if (name != mspname) {
+                                log.error(tree.pos(), Errors.FilePatchedAndMsp(name, mspname));
+                            }
+                        }
+                    } else if (msplocn != null) {
+                        if (tree.getModuleDecl() != null) {
+                            JavaFileObject canonical =
+                                    fileManager.getJavaFileForInput(msplocn, "module-info", Kind.SOURCE);
+                            if (canonical == null || !fileManager.isSameFile(canonical, tree.sourcefile)) {
+                                log.error(tree.pos(), Errors.ModuleNotFoundOnModuleSourcePath);
+                            }
+                        }
+                        Name name = names.fromString(fileManager.inferModuleName(msplocn));
                         ModuleSymbol msym;
                         JCModuleDecl decl = tree.getModuleDecl();
                         if (decl != null) {
@@ -383,10 +409,19 @@
                             msym = syms.enterModule(name);
                         }
                         if (msym.sourceLocation == null) {
-                            msym.sourceLocation = locn;
+                            msym.sourceLocation = msplocn;
+                            if (fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH)) {
+                                msym.patchLocation = fileManager.getLocationForModule(
+                                        StandardLocation.PATCH_MODULE_PATH, msym.name.toString());
+                            }
                             if (fileManager.hasLocation(StandardLocation.CLASS_OUTPUT)) {
-                                msym.classLocation = fileManager.getLocationForModule(
+                                Location outputLocn = fileManager.getLocationForModule(
                                         StandardLocation.CLASS_OUTPUT, msym.name.toString());
+                                if (msym.patchLocation == null) {
+                                    msym.classLocation = outputLocn;
+                                } else {
+                                    msym.patchOutputLocation = outputLocn;
+                                }
                             }
                         }
                         tree.modle = msym;
@@ -414,7 +449,9 @@
             }
             defaultModule = syms.unnamedModule;
         } else {
+            ModuleSymbol module = null;
             if (defaultModule == null) {
+                String moduleOverride = singleModuleOverride(trees);
                 switch (rootModules.size()) {
                     case 0:
                         defaultModule = moduleFinder.findSingleModule();
@@ -422,38 +459,60 @@
                             if (moduleOverride != null) {
                                 checkNoAllModulePath();
                                 defaultModule = moduleFinder.findModule(names.fromString(moduleOverride));
-                                defaultModule.sourceLocation = StandardLocation.SOURCE_PATH;
+                                if (legacyModuleOverride != null) {
+                                    defaultModule.sourceLocation = StandardLocation.SOURCE_PATH;
+                                }
+                                defaultModule.patchOutputLocation = StandardLocation.CLASS_OUTPUT;
                             } else {
                                 // Question: why not do findAllModules and initVisiblePackages here?
                                 // i.e. body of unnamedModuleCompleter
                                 defaultModule.completer = getUnnamedModuleCompleter();
+                                defaultModule.sourceLocation = StandardLocation.SOURCE_PATH;
                                 defaultModule.classLocation = StandardLocation.CLASS_PATH;
                             }
                         } else {
-                            checkSpecifiedModule(trees, Errors.ModuleInfoWithXmoduleClasspath);
                             checkNoAllModulePath();
                             defaultModule.complete();
                             // Question: why not do completeModule here?
                             defaultModule.completer = sym -> completeModule((ModuleSymbol) sym);
+                            defaultModule.sourceLocation = StandardLocation.SOURCE_PATH;
                         }
                         rootModules.add(defaultModule);
                         break;
                     case 1:
-                        checkSpecifiedModule(trees, Errors.ModuleInfoWithXmoduleSourcepath);
                         checkNoAllModulePath();
                         defaultModule = rootModules.iterator().next();
-                        defaultModule.classLocation = StandardLocation.CLASS_OUTPUT;
+                        defaultModule.sourceLocation = StandardLocation.SOURCE_PATH;
+                        if (fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH)) {
+                            try {
+                                defaultModule.patchLocation = fileManager.getLocationForModule(
+                                        StandardLocation.PATCH_MODULE_PATH, defaultModule.name.toString());
+                            } catch (IOException ex) {
+                                throw new Error(ex);
+                            }
+                        }
+                        if (defaultModule.patchLocation == null) {
+                            defaultModule.classLocation = StandardLocation.CLASS_OUTPUT;
+                        } else {
+                            defaultModule.patchOutputLocation = StandardLocation.CLASS_OUTPUT;
+                        }
                         break;
                     default:
                         Assert.error("too many modules");
                 }
-                defaultModule.sourceLocation = StandardLocation.SOURCE_PATH;
-            } else if (rootModules.size() == 1 && defaultModule == rootModules.iterator().next()) {
-                defaultModule.complete();
-                defaultModule.completer = sym -> completeModule((ModuleSymbol) sym);
+            } else if (rootModules.size() == 1) {
+                module = rootModules.iterator().next();
+                module.complete();
+                module.completer = sym -> completeModule((ModuleSymbol) sym);
             } else {
                 Assert.check(rootModules.isEmpty());
-                rootModules.add(defaultModule);
+                String moduleOverride = singleModuleOverride(trees);
+                if (moduleOverride != null) {
+                    module = moduleFinder.findModule(names.fromString(moduleOverride));
+                } else {
+                    module = defaultModule;
+                }
+                rootModules.add(module);
             }
 
             if (defaultModule != syms.unnamedModule) {
@@ -461,9 +520,43 @@
                 syms.unnamedModule.classLocation = StandardLocation.CLASS_PATH;
             }
 
-            for (JCCompilationUnit tree: trees) {
-                tree.modle = defaultModule;
+            if (module == null) {
+                module = defaultModule;
             }
+
+            for (JCCompilationUnit tree: trees) {
+                tree.modle = module;
+            }
+        }
+    }
+
+    private String singleModuleOverride(List<JCCompilationUnit> trees) {
+        if (!fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH)) {
+            return legacyModuleOverride;
+        }
+
+        Set<String> override = new LinkedHashSet<>();
+        for (JCCompilationUnit tree : trees) {
+            JavaFileObject fo = tree.sourcefile;
+
+            try {
+                Location loc =
+                        fileManager.getLocationForModule(StandardLocation.PATCH_MODULE_PATH, fo);
+
+                if (loc != null) {
+                    override.add(fileManager.inferModuleName(loc));
+                }
+            } catch (IOException ex) {
+                throw new Error(ex);
+            }
+        }
+
+        switch (override.size()) {
+            case 0: return legacyModuleOverride;
+            case 1: return override.iterator().next();
+            default:
+                log.error(Errors.TooManyPatchedModules(override));
+                return null;
         }
     }
 
@@ -478,42 +571,19 @@
      * @throws IOException if there is a problem while searching for the module.
      */
     private Location getModuleLocation(JCCompilationUnit tree) throws IOException {
-        Name pkgName;
-        if (tree.getModuleDecl() != null) {
-            pkgName = null;
-        } else {
-            JCPackageDecl pkg = tree.getPackage();
-            pkgName = (pkg == null) ? names.empty : TreeInfo.fullName(pkg.pid);
-        }
-
         JavaFileObject fo = tree.sourcefile;
 
-        // For now, just check module source path.
-        // We may want to check source path as well.
         Location loc =
-                fileManager.getLocationForModule(StandardLocation.MODULE_SOURCE_PATH,
-                                                 fo, (pkgName == null) ? null : pkgName.toString());
+                fileManager.getLocationForModule(StandardLocation.MODULE_SOURCE_PATH, fo);
         if (loc == null) {
             Location sourceOutput = fileManager.hasLocation(StandardLocation.SOURCE_OUTPUT) ?
                     StandardLocation.SOURCE_OUTPUT : StandardLocation.CLASS_OUTPUT;
             loc =
-                fileManager.getLocationForModule(sourceOutput,
-                                                 fo, (pkgName == null) ? null : pkgName.toString());
+                fileManager.getLocationForModule(sourceOutput, fo);
         }
         return loc;
     }
 
-    private void checkSpecifiedModule(List<JCCompilationUnit> trees, JCDiagnostic.Error error) {
-        if (moduleOverride != null) {
-            JavaFileObject prev = log.useSource(trees.head.sourcefile);
-            try {
-                log.error(trees.head.pos(), error);
-            } finally {
-                log.useSource(prev);
-            }
-        }
-    }
-
     private void checkNoAllModulePath() {
         if (addModsOpt != null && Arrays.asList(addModsOpt.split(",")).contains(ALL_MODULE_PATH)) {
             log.error(Errors.AddmodsAllModulePathInvalid);
@@ -644,6 +714,11 @@
         return rootModules.contains(module);
     }
 
+    public Set<ModuleSymbol> getRootModules() {
+        Assert.checkNonNull(rootModules);
+        return rootModules;
+    }
+
     class ModuleVisitor extends JCTree.Visitor {
         private ModuleSymbol sym;
         private final Set<ModuleSymbol> allRequires = new HashSet<>();
@@ -888,7 +963,30 @@
 
         @Override
         public void visitExports(JCExports tree) {
-            if (tree.directive.packge.members().isEmpty()) {
+            Iterable<Symbol> packageContent = tree.directive.packge.members().getSymbols();
+            List<JavaFileObject> filesToCheck = List.nil();
+            boolean packageNotEmpty = false;
+            for (Symbol sym : packageContent) {
+                if (sym.kind != Kinds.Kind.TYP)
+                    continue;
+                ClassSymbol csym = (ClassSymbol) sym;
+                if (sym.completer.isTerminal() ||
+                    csym.classfile.getKind() == Kind.CLASS) {
+                    packageNotEmpty = true;
+                    filesToCheck = List.nil();
+                    break;
+                }
+                if (csym.classfile.getKind() == Kind.SOURCE) {
+                    filesToCheck = filesToCheck.prepend(csym.classfile);
+                }
+            }
+            for (JavaFileObject jfo : filesToCheck) {
+                if (findPackageInFile.findPackageNameOf(jfo) == tree.directive.packge.fullname) {
+                    packageNotEmpty = true;
+                    break;
+                }
+            }
+            if (!packageNotEmpty) {
                 log.error(tree.qualid.pos(), Errors.PackageEmptyOrNotFound(tree.directive.packge));
             }
             msym.directives = msym.directives.prepend(tree.directive);
@@ -931,8 +1029,18 @@
             }
             ListBuffer<ClassSymbol> impls = new ListBuffer<>();
             for (JCExpression implName : tree.implNames) {
-                Type it = attr.attribType(implName, env, syms.objectType);
+                Type it;
+                boolean prevVisitingServiceImplementation = env.info.visitingServiceImplementation;
+                try {
+                    env.info.visitingServiceImplementation = true;
+                    it = attr.attribType(implName, env, syms.objectType);
+                } finally {
+                    env.info.visitingServiceImplementation = prevVisitingServiceImplementation;
+                }
                 ClassSymbol impl = (ClassSymbol) it.tsym;
+                if ((impl.flags_field & PUBLIC) == 0) {
+                    log.error(implName.pos(), Errors.NotDefPublic(impl, impl.location()));
+                }
                 //find provider factory:
                 MethodSymbol factory = factoryMethod(impl);
                 if (factory != null) {
@@ -976,6 +1084,7 @@
         public void visitRequires(JCRequires tree) {
             if (tree.directive != null && allModules().contains(tree.directive.module)) {
                 chk.checkDeprecated(tree.moduleName.pos(), msym, tree.directive.module);
+                chk.checkModuleRequires(tree.moduleName.pos(), tree.directive);
                 msym.directives = msym.directives.prepend(tree.directive);
             }
         }
@@ -1132,7 +1241,7 @@
                     case ALL_SYSTEM:
                         modules = new HashSet<>(syms.getAllModules())
                                 .stream()
-                                .filter(systemModulePred.and(observablePred).and(noIncubatorPred));
+                                .filter(systemModulePred.and(observablePred));
                         break;
                     case ALL_MODULE_PATH:
                         modules = new HashSet<>(syms.getAllModules())
@@ -1157,6 +1266,15 @@
 
         result.add(syms.unnamedModule);
 
+        boolean hasAutomatic = result.stream().anyMatch(IS_AUTOMATIC);
+
+        if (hasAutomatic) {
+            syms.getAllModules()
+                .stream()
+                .filter(IS_AUTOMATIC)
+                .forEach(result::add);
+        }
+
         String incubatingModules = result.stream()
                 .filter(msym -> msym.resolutionFlags.contains(ModuleResolutionFlags.WARN_INCUBATING))
                 .map(msym -> msym.name.toString())
@@ -1174,6 +1292,9 @@
             rootModules.forEach(m -> m.version = version);
         }
     }
+    //where:
+        private static final Predicate<ModuleSymbol> IS_AUTOMATIC =
+                m -> (m.flags_field & Flags.AUTOMATIC_MODULE) != 0;
 
     public boolean isInModuleGraph(ModuleSymbol msym) {
         return allModules == null || allModules.contains(msym);
@@ -1594,8 +1715,12 @@
     }
 
     public void newRound() {
-        rootModules = null;
         allModules = null;
+        rootModules = null;
         warnedMissing.clear();
     }
+
+    public interface PackageNameFinder {
+        public Name findPackageNameOf(JavaFileObject jfo);
+    }
 }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
index 3b1743d..5f1de99 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
@@ -307,6 +307,11 @@
         if (env.enclMethod != null && (env.enclMethod.mods.flags & ANONCONSTR) != 0)
             return true;
 
+        if (env.info.visitingServiceImplementation &&
+            env.toplevel.modle == c.packge().modle) {
+            return true;
+        }
+
         boolean isAccessible = false;
         switch ((short)(c.flags() & AccessFlags)) {
             case PRIVATE:
@@ -329,7 +334,10 @@
                     currModule.complete();
                     PackageSymbol p = c.packge();
                     isAccessible =
-                        (currModule == p.modle) || currModule.visiblePackages.get(p.fullname) == p || p == syms.rootPackage;
+                        currModule == p.modle ||
+                        currModule.visiblePackages.get(p.fullname) == p ||
+                        p == syms.rootPackage ||
+                        (p.modle == syms.unnamedModule && currModule.readModules.contains(p.modle));
                 } else {
                     isAccessible = true;
                 }
@@ -389,6 +397,11 @@
         if (env.enclMethod != null && (env.enclMethod.mods.flags & ANONCONSTR) != 0)
             return true;
 
+        if (env.info.visitingServiceImplementation &&
+            env.toplevel.modle == sym.packge().modle) {
+            return true;
+        }
+
         switch ((short)(sym.flags() & AccessFlags)) {
         case PRIVATE:
             return
@@ -2094,7 +2107,7 @@
 
         for (S sym : candidates) {
             if (validate.test(sym))
-                return new InvisibleSymbolError(env, suppressError, sym);
+                return createInvisibleSymbolError(env, suppressError, sym);
         }
 
         Set<ModuleSymbol> recoverableModules = new HashSet<>(syms.getAllModules());
@@ -2113,7 +2126,7 @@
                     S sym = load.apply(ms, name);
 
                     if (sym != null && validate.test(sym)) {
-                        return new InvisibleSymbolError(env, suppressError, sym);
+                        return createInvisibleSymbolError(env, suppressError, sym);
                     }
                 }
             }
@@ -2122,6 +2135,21 @@
         return defaultResult;
     }
 
+    private Symbol createInvisibleSymbolError(Env<AttrContext> env, boolean suppressError, Symbol sym) {
+        if (symbolPackageVisible(env, sym)) {
+            return new AccessError(env, null, sym);
+        } else {
+            return new InvisibleSymbolError(env, suppressError, sym);
+        }
+    }
+
+    private boolean symbolPackageVisible(Env<AttrContext> env, Symbol sym) {
+        ModuleSymbol envMod = env.toplevel.modle;
+        PackageSymbol symPack = sym.packge();
+        return envMod == symPack.modle ||
+               envMod.visiblePackages.containsKey(symPack.fullname);
+    }
+
     /**
      * Find a type declared in a scope (not inherited).  Return null
      * if none is found.
@@ -4094,8 +4122,7 @@
                             pos, "not.def.access.package.cant.access",
                         sym, sym.location(), inaccessiblePackageReason(env, sym.packge()));
                 } else if (   sym.packge() != syms.rootPackage
-                           && sym.packge().modle != env.toplevel.modle
-                           && !isAccessible(env, sym.outermostClass())) {
+                           && !symbolPackageVisible(env, sym)) {
                     return diags.create(dkind, log.currentSource(),
                             pos, "not.def.access.class.intf.cant.access.reason",
                             sym, sym.location(), sym.location().packge(),
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java
index d28bd58..9083c67 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java
@@ -186,37 +186,12 @@
                         Class.forName(classLoaderClass).asSubclass(ClassLoader.class);
                 Class<?>[] constrArgTypes = { URL[].class, ClassLoader.class };
                 Constructor<? extends ClassLoader> constr = loader.getConstructor(constrArgTypes);
-                return ensureReadable(constr.newInstance(urls, thisClassLoader));
+                return constr.newInstance(urls, thisClassLoader);
             } catch (ReflectiveOperationException t) {
                 // ignore errors loading user-provided class loader, fall through
             }
         }
-        return ensureReadable(new URLClassLoader(urls, thisClassLoader));
-    }
-
-    /**
-     * Ensures that the unnamed module of the given classloader is readable to this
-     * module.
-     */
-    private ClassLoader ensureReadable(ClassLoader targetLoader) {
-        try {
-            Method getModuleMethod = Class.class.getMethod("getModule");
-            Object thisModule = getModuleMethod.invoke(this.getClass());
-            Method getUnnamedModuleMethod = ClassLoader.class.getMethod("getUnnamedModule");
-            Object targetModule = getUnnamedModuleMethod.invoke(targetLoader);
-
-            Class<?> moduleClass = getModuleMethod.getReturnType();
-            Method addReadsMethod = moduleClass.getMethod("addReads", moduleClass);
-            addReadsMethod.invoke(thisModule, targetModule);
-        } catch (NoSuchMethodException e) {
-            // ignore
-        } catch (IllegalAccessException
-                | IllegalArgumentException
-                | SecurityException
-                | InvocationTargetException e) {
-            throw new Abort(e);
-        }
-        return targetLoader;
+        return new URLClassLoader(urls, thisClassLoader);
     }
 
     public boolean isDefaultBootClassPath() {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
index b5a200f..959c88b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -473,10 +473,14 @@
                     }
                 } else {
                     if (isValidFile(fname, fileKinds)) {
-                        RelativeFile file = new RelativeFile(subdirectory, fname);
-                        JavaFileObject fe = PathFileObject.forDirectoryPath(JavacFileManager.this,
-                                file.resolveAgainst(directory), userPath, file);
-                        resultList.append(fe);
+                        try {
+                            RelativeFile file = new RelativeFile(subdirectory, fname);
+                            JavaFileObject fe = PathFileObject.forDirectoryPath(JavacFileManager.this,
+                                    file.resolveAgainst(directory), userPath, file);
+                            resultList.append(fe);
+                        } catch (InvalidPathException e) {
+                            throw new IOException("error accessing directory " + directory + e);
+                        }
                     }
                 }
             }
@@ -968,7 +972,7 @@
             Collection<Path> paths = locations.getLocation(location);
             ModuleFinder finder = ModuleFinder.of(paths.toArray(new Path[paths.size()]));
             Layer bootLayer = Layer.boot();
-            Configuration cf = bootLayer.configuration().resolveRequiresAndUses(ModuleFinder.of(), finder, Collections.emptySet());
+            Configuration cf = bootLayer.configuration().resolveAndBind(ModuleFinder.of(), finder, Collections.emptySet());
             Layer layer = bootLayer.defineModulesWithOneLoader(cf, ClassLoader.getSystemClassLoader());
             return ServiceLoaderHelper.load(layer, service);
         } else {
@@ -977,31 +981,21 @@
     }
 
     @Override @DefinedBy(Api.COMPILER)
-    public Location getLocationForModule(Location location, JavaFileObject fo, String pkgName) throws IOException {
+    public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
         checkModuleOrientedOrOutputLocation(location);
         if (!(fo instanceof PathFileObject))
-            throw new IllegalArgumentException(fo.getName());
-        int depth = 1; // allow 1 for filename
-        if (pkgName != null && !pkgName.isEmpty()) {
-            depth += 1;
-            for (int i = 0; i < pkgName.length(); i++) {
-                switch (pkgName.charAt(i)) {
-                    case '/': case '.':
-                        depth++;
-                }
-            }
-        }
-        Path p = Locations.normalize(((PathFileObject) fo).path);
-        int fc = p.getNameCount();
-        if (depth < fc) {
-            Path root = p.getRoot();
-            Path subpath = p.subpath(0, fc - depth);
-            Path dir = (root == null) ? subpath : root.resolve(subpath);
-            // need to find dir in location
-            return locations.getLocationForModule(location, dir);
-        } else {
             return null;
-        }
+        Path p = Locations.normalize(((PathFileObject) fo).path);
+            // need to find p in location
+        return locations.getLocationForModule(location, p);
+    }
+
+    @Override @DefinedBy(Api.COMPILER)
+    public void setLocationForModule(Location location, String moduleName, Collection<? extends Path> paths)
+            throws IOException {
+        nullCheck(location);
+        checkModuleOrientedOrOutputLocation(location);
+        locations.setLocationForModule(location, nullCheck(moduleName), nullCheck(paths));
     }
 
     @Override @DefinedBy(Api.COMPILER)
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
index e14fb7d..29d801a 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
@@ -60,6 +60,7 @@
 import java.util.Objects;
 import java.util.NoSuchElementException;
 import java.util.Set;
+import java.util.function.Predicate;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -398,7 +399,7 @@
      * @see #initHandlers
      * @see #getHandler
      */
-    protected abstract class LocationHandler {
+    protected static abstract class LocationHandler {
 
         /**
          * @see JavaFileManager#handleOption
@@ -420,7 +421,13 @@
         /**
          * @see StandardJavaFileManager#setLocation
          */
-        abstract void setPaths(Iterable<? extends Path> files) throws IOException;
+        abstract void setPaths(Iterable<? extends Path> paths) throws IOException;
+
+        /**
+         * @see StandardJavaFileManager#setLocationForModule
+         */
+        abstract void setPathsForModule(String moduleName, Iterable<? extends Path> paths)
+                throws IOException;
 
         /**
          * @see JavaFileManager#getLocationForModule(Location, String)
@@ -432,7 +439,7 @@
         /**
          * @see JavaFileManager#getLocationForModule(Location, JavaFileObject, String)
          */
-        Location getLocationForModule(Path dir) {
+        Location getLocationForModule(Path file) throws IOException  {
             return null;
         }
 
@@ -454,7 +461,7 @@
     /**
      * A LocationHandler for a given Location, and associated set of options.
      */
-    private abstract class BasicLocationHandler extends LocationHandler {
+    private static abstract class BasicLocationHandler extends LocationHandler {
 
         final Location location;
         final Set<Option> options;
@@ -473,6 +480,36 @@
                     ? EnumSet.noneOf(Option.class)
                     : EnumSet.copyOf(Arrays.asList(options));
         }
+
+        @Override
+        void setPathsForModule(String moduleName, Iterable<? extends Path> files) throws IOException {
+            // should not happen: protected by check in JavacFileManager
+            throw new UnsupportedOperationException("not supported for " + location);
+        }
+
+        protected Path checkSingletonDirectory(Iterable<? extends Path> paths) throws IOException {
+            Iterator<? extends Path> pathIter = paths.iterator();
+            if (!pathIter.hasNext()) {
+                throw new IllegalArgumentException("empty path for directory");
+            }
+            Path path = pathIter.next();
+            if (pathIter.hasNext()) {
+                throw new IllegalArgumentException("path too long for directory");
+            }
+            checkDirectory(path);
+            return path;
+        }
+
+        protected Path checkDirectory(Path path) throws IOException {
+            Objects.requireNonNull(path);
+            if (!Files.exists(path)) {
+                throw new FileNotFoundException(path + ": does not exist");
+            }
+            if (!Files.isDirectory(path)) {
+                throw new IOException(path + ": not a directory");
+            }
+            return path;
+        }
     }
 
     /**
@@ -483,8 +520,7 @@
     private class OutputLocationHandler extends BasicLocationHandler {
 
         private Path outputDir;
-        private Map<String, Location> moduleLocations;
-        private Map<Path, Location> pathLocations;
+        private ModuleTable moduleTable;
 
         OutputLocationHandler(Location location, Option... options) {
             super(location, options);
@@ -510,51 +546,51 @@
         }
 
         @Override
-        void setPaths(Iterable<? extends Path> files) throws IOException {
-            if (files == null) {
+        void setPaths(Iterable<? extends Path> paths) throws IOException {
+            if (paths == null) {
                 outputDir = null;
             } else {
-                Iterator<? extends Path> pathIter = files.iterator();
-                if (!pathIter.hasNext()) {
-                    throw new IllegalArgumentException("empty path for directory");
-                }
-                Path dir = pathIter.next();
-                if (pathIter.hasNext()) {
-                    throw new IllegalArgumentException("path too long for directory");
-                }
-                if (!Files.exists(dir)) {
-                    throw new FileNotFoundException(dir + ": does not exist");
-                } else if (!Files.isDirectory(dir)) {
-                    throw new IOException(dir + ": not a directory");
-                }
-                outputDir = dir;
+                outputDir = checkSingletonDirectory(paths);
             }
-            moduleLocations = null;
-            pathLocations = null;
+            moduleTable = null;
+            listed = false;
         }
 
         @Override
         Location getLocationForModule(String name) {
-            if (moduleLocations == null) {
-                moduleLocations = new HashMap<>();
-                pathLocations = new HashMap<>();
+            if (moduleTable == null) {
+                moduleTable = new ModuleTable();
             }
-            Location l = moduleLocations.get(name);
+            ModuleLocationHandler l = moduleTable.get(name);
             if (l == null) {
                 Path out = outputDir.resolve(name);
-                l = new ModuleLocationHandler(location.getName() + "[" + name + "]",
-                        name,
-                        Collections.singleton(out),
-                        true, false);
-                moduleLocations.put(name, l);
-                pathLocations.put(out.toAbsolutePath(), l);
-           }
+                l = new ModuleLocationHandler(this, location.getName() + "[" + name + "]",
+                        name, Collections.singletonList(out), true);
+                moduleTable.add(l);
+            }
             return l;
         }
 
         @Override
-        Location getLocationForModule(Path dir) {
-            return (pathLocations == null) ? null : pathLocations.get(dir);
+        void setPathsForModule(String name, Iterable<? extends Path> paths) throws IOException {
+            Path out = checkSingletonDirectory(paths);
+            if (moduleTable == null) {
+                moduleTable = new ModuleTable();
+            }
+            ModuleLocationHandler l = moduleTable.get(name);
+            if (l == null) {
+                l = new ModuleLocationHandler(this, location.getName() + "[" + name + "]",
+                        name, Collections.singletonList(out), true);
+                moduleTable.add(l);
+           } else {
+                l.searchPath = Collections.singletonList(out);
+                moduleTable.updatePaths(l);
+            }
+        }
+
+        @Override
+        Location getLocationForModule(Path file) {
+            return (moduleTable == null) ? null : moduleTable.get(file);
         }
 
         private boolean listed;
@@ -569,11 +605,11 @@
                 }
                 listed = true;
             }
-            if (moduleLocations == null)
+
+            if (moduleTable == null || moduleTable.isEmpty())
                 return Collections.emptySet();
-            Set<Location> locns = new LinkedHashSet<>();
-            moduleLocations.forEach((k, v) -> locns.add(v));
-            return Collections.singleton(locns);
+
+            return Collections.singleton(moduleTable.locations());
         }
     }
 
@@ -860,33 +896,20 @@
      * The Location can be specified to accept overriding classes from the
      * {@code --patch-module <module>=<path> } parameter.
      */
-    private class ModuleLocationHandler extends LocationHandler implements Location {
-        protected final String name;
-        protected final String moduleName;
-        protected final Collection<Path> searchPath;
-        protected final Collection<Path> searchPathWithOverrides;
-        protected final boolean output;
+    private static class ModuleLocationHandler extends LocationHandler implements Location {
+        private final LocationHandler parent;
+        private final String name;
+        private final String moduleName;
+        private final boolean output;
+        Collection<Path> searchPath;
 
-        ModuleLocationHandler(String name, String moduleName, Collection<Path> searchPath,
-                boolean output, boolean allowOverrides) {
+        ModuleLocationHandler(LocationHandler parent, String name, String moduleName,
+                Collection<Path> searchPath, boolean output) {
+            this.parent = parent;
             this.name = name;
             this.moduleName = moduleName;
             this.searchPath = searchPath;
             this.output = output;
-
-            if (allowOverrides && patchMap != null) {
-                SearchPath mPatch = patchMap.get(moduleName);
-                if (mPatch != null) {
-                    SearchPath sp = new SearchPath();
-                    sp.addAll(mPatch);
-                    sp.addAll(searchPath);
-                    searchPathWithOverrides = sp;
-                } else {
-                    searchPathWithOverrides = searchPath;
-                }
-            } else {
-                searchPathWithOverrides = searchPath;
-            }
         }
 
         @Override @DefinedBy(Api.COMPILER)
@@ -906,21 +929,88 @@
 
         @Override // defined by LocationHandler
         Collection<Path> getPaths() {
-            // For now, we always return searchPathWithOverrides. This may differ from the
-            // JVM behavior if there is a module-info.class to be found in the overriding
-            // classes.
-            return searchPathWithOverrides;
+            return Collections.unmodifiableCollection(searchPath);
         }
 
         @Override // defined by LocationHandler
-        void setPaths(Iterable<? extends Path> files) throws IOException {
-            throw new UnsupportedOperationException();
+        void setPaths(Iterable<? extends Path> paths) throws IOException {
+            // defer to the parent to determine if this is acceptable
+            parent.setPathsForModule(moduleName, paths);
+        }
+
+        @Override // defined by LocationHandler
+        void setPathsForModule(String moduleName, Iterable<? extends Path> paths) {
+            throw new UnsupportedOperationException("not supported for " + name);
         }
 
         @Override // defined by LocationHandler
         String inferModuleName() {
             return moduleName;
         }
+
+        @Override
+        public String toString() {
+            return name;
+        }
+    }
+
+    /**
+     * A table of module location handlers, indexed by name and path.
+     */
+    private static class ModuleTable {
+        private final Map<String, ModuleLocationHandler> nameMap = new LinkedHashMap<>();
+        private final Map<Path, ModuleLocationHandler> pathMap = new LinkedHashMap<>();
+
+        void add(ModuleLocationHandler h) {
+            nameMap.put(h.moduleName, h);
+            for (Path p : h.searchPath) {
+                pathMap.put(normalize(p), h);
+            }
+        }
+
+        void updatePaths(ModuleLocationHandler h) {
+            // use iterator, to be able to remove old entries
+            for (Iterator<Map.Entry<Path, ModuleLocationHandler>> iter = pathMap.entrySet().iterator();
+                    iter.hasNext(); ) {
+                Map.Entry<Path, ModuleLocationHandler> e = iter.next();
+                if (e.getValue() == h) {
+                    iter.remove();
+                }
+            }
+            for (Path p : h.searchPath) {
+                pathMap.put(normalize(p), h);
+            }
+        }
+
+        ModuleLocationHandler get(String name) {
+            return nameMap.get(name);
+        }
+
+        ModuleLocationHandler get(Path path) {
+            while (path != null) {
+                ModuleLocationHandler l = pathMap.get(path);
+
+                if (l != null)
+                    return l;
+
+                path = path.getParent();
+            }
+
+            return null;
+        }
+
+        void clear() {
+            nameMap.clear();
+            pathMap.clear();
+        }
+
+        boolean isEmpty() {
+            return nameMap.isEmpty();
+        }
+
+        Set<Location> locations() {
+            return Collections.unmodifiableSet(nameMap.values().stream().collect(Collectors.toSet()));
+        }
     }
 
     /**
@@ -928,7 +1018,7 @@
      * like UPGRADE_MODULE_PATH and MODULE_PATH.
      */
     private class ModulePathLocationHandler extends SimpleLocationHandler {
-        private Map<String, ModuleLocationHandler> pathModules;
+        private ModuleTable moduleTable;
 
         ModulePathLocationHandler(Location location, Option... options) {
             super(location, options);
@@ -945,8 +1035,8 @@
 
         @Override
         public Location getLocationForModule(String moduleName) {
-            initPathModules();
-            return pathModules.get(moduleName);
+            initModuleLocations();
+            return moduleTable.get(moduleName);
         }
 
         @Override
@@ -965,26 +1055,60 @@
                 }
             }
             super.setPaths(paths);
+            moduleTable = null;
         }
 
-        private void initPathModules() {
-            if (pathModules != null) {
+        @Override
+        void setPathsForModule(String name, Iterable<? extends Path> paths) throws IOException {
+            List<Path> checkedPaths = checkPaths(paths);
+            // how far should we go to validate the paths provide a module?
+            // e.g. contain module-info with the correct name?
+            initModuleLocations();
+            ModuleLocationHandler l = moduleTable.get(name);
+            if (l == null) {
+                l = new ModuleLocationHandler(this, location.getName() + "[" + name + "]",
+                        name, checkedPaths, true);
+                moduleTable.add(l);
+           } else {
+                l.searchPath = checkedPaths;
+                moduleTable.updatePaths(l);
+            }
+        }
+
+        private List<Path> checkPaths(Iterable<? extends Path> paths) throws IOException {
+            Objects.requireNonNull(paths);
+            List<Path> validPaths = new ArrayList<>();
+            for (Path p : paths) {
+                validPaths.add(checkDirectory(p));
+            }
+            return validPaths;
+        }
+
+        private void initModuleLocations() {
+            if (moduleTable != null) {
                 return;
             }
 
-            pathModules = new LinkedHashMap<>();
+            moduleTable = new ModuleTable();
 
             for (Set<Location> set : listLocationsForModules()) {
                 for (Location locn : set) {
                     if (locn instanceof ModuleLocationHandler) {
-                        ModuleLocationHandler h = (ModuleLocationHandler) locn;
-                        pathModules.put(h.moduleName, h);
+                        ModuleLocationHandler l = (ModuleLocationHandler) locn;
+                        if (!moduleTable.nameMap.containsKey(l.moduleName)) {
+                            moduleTable.add(l);
+                        }
                     }
                 }
             }
         }
 
         private void checkValidModulePathEntry(Path p) {
+            if (!Files.exists(p)) {
+                // warning may be generated later
+                return;
+            }
+
             if (Files.isDirectory(p)) {
                 // either an exploded module or a directory of modules
                 return;
@@ -1062,8 +1186,9 @@
                         String moduleName = readModuleName(moduleInfoClass);
                         String name = location.getName()
                                 + "[" + pathIndex + ":" + moduleName + "]";
-                        ModuleLocationHandler l = new ModuleLocationHandler(name, moduleName,
-                                Collections.singleton(path), false, true);
+                        ModuleLocationHandler l = new ModuleLocationHandler(
+                                ModulePathLocationHandler.this, name, moduleName,
+                                Collections.singletonList(path), false);
                         return Collections.singleton(l);
                     } catch (ModuleNameReader.BadClassFile e) {
                         log.error(Errors.LocnBadModuleInfo(path));
@@ -1087,8 +1212,9 @@
                     Path modulePath = module.snd;
                     String name = location.getName()
                             + "[" + pathIndex + "." + (index++) + ":" + moduleName + "]";
-                    ModuleLocationHandler l = new ModuleLocationHandler(name, moduleName,
-                            Collections.singleton(modulePath), false, true);
+                    ModuleLocationHandler l = new ModuleLocationHandler(
+                            ModulePathLocationHandler.this, name, moduleName,
+                            Collections.singletonList(modulePath), false);
                     result.add(l);
                 }
                 return result;
@@ -1104,8 +1230,9 @@
                 Path modulePath = module.snd;
                 String name = location.getName()
                         + "[" + pathIndex + ":" + moduleName + "]";
-                ModuleLocationHandler l = new ModuleLocationHandler(name, moduleName,
-                        Collections.singleton(modulePath), false, true);
+                ModuleLocationHandler l = new ModuleLocationHandler(
+                        ModulePathLocationHandler.this, name, moduleName,
+                        Collections.singletonList(modulePath), false);
                 return Collections.singleton(l);
             }
 
@@ -1155,8 +1282,7 @@
                     }
 
                     // finally clean up the module name
-                    mn =  mn.replaceAll("(\\.|\\d)*$", "")    // remove trailing version
-                            .replaceAll("[^A-Za-z0-9]", ".")  // replace non-alphanumeric
+                    mn =  mn.replaceAll("[^A-Za-z0-9]", ".")  // replace non-alphanumeric
                             .replaceAll("(\\.)(\\1)+", ".")   // collapse repeating dots
                             .replaceAll("^\\.", "")           // drop leading dots
                             .replaceAll("\\.$", "");          // drop trailing dots
@@ -1222,9 +1348,7 @@
     }
 
     private class ModuleSourcePathLocationHandler extends BasicLocationHandler {
-
-        private Map<String, Location> moduleLocations;
-        private Map<Path, Location> pathLocations;
+        private ModuleTable moduleTable;
 
         ModuleSourcePathLocationHandler() {
             super(StandardLocation.MODULE_SOURCE_PATH,
@@ -1243,7 +1367,7 @@
                 expandBraces(s, segments);
             }
 
-            Map<String, Collection<Path>> map = new LinkedHashMap<>();
+            Map<String, List<Path>> map = new LinkedHashMap<>();
             final String MARKER = "*";
             for (String seg: segments) {
                 int markStart = seg.indexOf(MARKER);
@@ -1268,22 +1392,28 @@
                 }
             }
 
-            moduleLocations = new LinkedHashMap<>();
-            pathLocations = new LinkedHashMap<>();
-            map.forEach((k, v) -> {
-                String name = location.getName() + "[" + k + "]";
-                ModuleLocationHandler h = new ModuleLocationHandler(name, k, v, false, false);
-                moduleLocations.put(k, h);
-                v.forEach(p -> pathLocations.put(normalize(p), h));
+            moduleTable = new ModuleTable();
+            map.forEach((modName, modPath) -> {
+                boolean hasModuleInfo = modPath.stream().anyMatch(checkModuleInfo);
+                if (hasModuleInfo) {
+                    String locnName = location.getName() + "[" + modName + "]";
+                    ModuleLocationHandler l = new ModuleLocationHandler(this, locnName, modName,
+                            modPath, false);
+                    moduleTable.add(l);
+                }
             });
         }
+        //where:
+            private final Predicate<Path> checkModuleInfo =
+                    p -> Files.exists(p.resolve("module-info.java"));
+
 
         private boolean isSeparator(char ch) {
             // allow both separators on Windows
             return (ch == File.separatorChar) || (ch == '/');
         }
 
-        void add(Map<String, Collection<Path>> map, Path prefix, Path suffix) {
+        void add(Map<String, List<Path>> map, Path prefix, Path suffix) {
             if (!Files.isDirectory(prefix)) {
                 if (warn) {
                     String key = Files.exists(prefix)
@@ -1298,7 +1428,7 @@
                     Path path = (suffix == null) ? entry : entry.resolve(suffix);
                     if (Files.isDirectory(path)) {
                         String name = entry.getFileName().toString();
-                        Collection<Path> paths = map.get(name);
+                        List<Path> paths = map.get(name);
                         if (paths == null)
                             map.put(name, paths = new ArrayList<>());
                         paths.add(path);
@@ -1374,7 +1504,7 @@
 
         @Override
         boolean isSet() {
-            return (moduleLocations != null);
+            return (moduleTable != null);
         }
 
         @Override
@@ -1388,22 +1518,51 @@
         }
 
         @Override
-        Location getLocationForModule(String name) {
-            return (moduleLocations == null) ? null : moduleLocations.get(name);
+        void setPathsForModule(String name, Iterable<? extends Path> paths) throws IOException {
+            List<Path> validPaths = checkPaths(paths);
+
+            if (moduleTable == null)
+                moduleTable = new ModuleTable();
+
+            ModuleLocationHandler l = moduleTable.get(name);
+            if (l == null) {
+                l = new ModuleLocationHandler(this,
+                        location.getName() + "[" + name + "]",
+                        name,
+                        validPaths,
+                        true);
+                moduleTable.add(l);
+           } else {
+                l.searchPath = validPaths;
+                moduleTable.updatePaths(l);
+            }
+        }
+
+        private List<Path> checkPaths(Iterable<? extends Path> paths) throws IOException {
+            Objects.requireNonNull(paths);
+            List<Path> validPaths = new ArrayList<>();
+            for (Path p : paths) {
+                validPaths.add(checkDirectory(p));
+            }
+            return validPaths;
         }
 
         @Override
-        Location getLocationForModule(Path dir) {
-            return (pathLocations == null) ? null : pathLocations.get(dir);
+        Location getLocationForModule(String name) {
+            return (moduleTable == null) ? null : moduleTable.get(name);
+        }
+
+        @Override
+        Location getLocationForModule(Path file) {
+            return (moduleTable == null) ? null : moduleTable.get(file);
         }
 
         @Override
         Iterable<Set<Location>> listLocationsForModules() {
-            if (moduleLocations == null)
+            if (moduleTable == null)
                 return Collections.emptySet();
-            Set<Location> locns = new LinkedHashSet<>();
-            moduleLocations.forEach((k, v) -> locns.add(v));
-            return Collections.singleton(locns);
+
+            return Collections.singleton(moduleTable.locations());
         }
 
     }
@@ -1411,7 +1570,7 @@
     private class SystemModulesLocationHandler extends BasicLocationHandler {
         private Path systemJavaHome;
         private Path modules;
-        private Map<String, ModuleLocationHandler> systemModules;
+        private ModuleTable moduleTable;
 
         SystemModulesLocationHandler() {
             super(StandardLocation.SYSTEM_MODULES, Option.SYSTEM);
@@ -1446,23 +1605,38 @@
             if (files == null) {
                 systemJavaHome = null;
             } else {
-                Iterator<? extends Path> pathIter = files.iterator();
-                if (!pathIter.hasNext()) {
-                    throw new IllegalArgumentException("empty path for directory"); // TODO: FIXME
-                }
-                Path dir = pathIter.next();
-                if (pathIter.hasNext()) {
-                    throw new IllegalArgumentException("path too long for directory"); // TODO: FIXME
-                }
-                if (!Files.exists(dir)) {
-                    throw new FileNotFoundException(dir + ": does not exist");
-                } else if (!Files.isDirectory(dir)) {
-                    throw new IOException(dir + ": not a directory");
-                }
+                Path dir = checkSingletonDirectory(files);
                 update(dir);
             }
         }
 
+        @Override
+        void setPathsForModule(String name, Iterable<? extends Path> paths) throws IOException {
+            List<Path> checkedPaths = checkPaths(paths);
+            initSystemModules();
+            ModuleLocationHandler l = moduleTable.get(name);
+            if (l == null) {
+                l = new ModuleLocationHandler(this,
+                        location.getName() + "[" + name + "]",
+                        name,
+                        checkedPaths,
+                        true);
+                moduleTable.add(l);
+           } else {
+                l.searchPath = checkedPaths;
+                moduleTable.updatePaths(l);
+            }
+        }
+
+        private List<Path> checkPaths(Iterable<? extends Path> paths) throws IOException {
+            Objects.requireNonNull(paths);
+            List<Path> validPaths = new ArrayList<>();
+            for (Path p : paths) {
+                validPaths.add(checkDirectory(p));
+            }
+            return validPaths;
+        }
+
         private void update(Path p) {
             if (!isCurrentPlatform(p) && !Files.exists(p.resolve("lib").resolve("jrt-fs.jar")) &&
                     !Files.exists(systemJavaHome.resolve("modules")))
@@ -1482,25 +1656,27 @@
         @Override
         Location getLocationForModule(String name) throws IOException {
             initSystemModules();
-            return systemModules.get(name);
+            return moduleTable.get(name);
+        }
+
+        @Override
+        Location getLocationForModule(Path file) throws IOException {
+            initSystemModules();
+            return moduleTable.get(file);
         }
 
         @Override
         Iterable<Set<Location>> listLocationsForModules() throws IOException {
             initSystemModules();
-            Set<Location> locns = new LinkedHashSet<>();
-            for (Location l: systemModules.values())
-                locns.add(l);
-            return Collections.singleton(locns);
+            return Collections.singleton(moduleTable.locations());
         }
 
         private void initSystemModules() throws IOException {
-            if (systemModules != null) {
+            if (moduleTable != null)
                 return;
-            }
 
             if (systemJavaHome == null) {
-                systemModules = Collections.emptyMap();
+                moduleTable = new ModuleTable();
                 return;
             }
 
@@ -1538,19 +1714,95 @@
                 }
             }
 
-            systemModules = new LinkedHashMap<>();
+            moduleTable = new ModuleTable();
             try (DirectoryStream<Path> stream = Files.newDirectoryStream(modules, Files::isDirectory)) {
                 for (Path entry : stream) {
                     String moduleName = entry.getFileName().toString();
                     String name = location.getName() + "[" + moduleName + "]";
-                    ModuleLocationHandler h = new ModuleLocationHandler(name, moduleName,
-                            Collections.singleton(entry), false, true);
-                    systemModules.put(moduleName, h);
+                    ModuleLocationHandler h = new ModuleLocationHandler(this,
+                            name, moduleName, Collections.singletonList(entry), false);
+                    moduleTable.add(h);
                 }
             }
         }
     }
 
+    private class PatchModulesLocationHandler extends BasicLocationHandler {
+        private final ModuleTable moduleTable = new ModuleTable();
+
+        PatchModulesLocationHandler() {
+            super(StandardLocation.PATCH_MODULE_PATH, Option.PATCH_MODULE);
+        }
+
+        @Override
+        boolean handleOption(Option option, String value) {
+            if (!options.contains(option)) {
+                return false;
+            }
+
+            moduleTable.clear();
+
+            // Allow an extended syntax for --patch-module consisting of a series
+            // of values separated by NULL characters. This is to facilitate
+            // supporting deferred file manager options on the command line.
+            // See Option.PATCH_MODULE for the code that composes these multiple
+            // values.
+            for (String v : value.split("\0")) {
+                int eq = v.indexOf('=');
+                if (eq > 0) {
+                    String moduleName = v.substring(0, eq);
+                    SearchPath mPatchPath = new SearchPath()
+                            .addFiles(v.substring(eq + 1));
+                    String name = location.getName() + "[" + moduleName + "]";
+                    ModuleLocationHandler h = new ModuleLocationHandler(this, name,
+                            moduleName, mPatchPath, false);
+                    moduleTable.add(h);
+                } else {
+                    // Should not be able to get here;
+                    // this should be caught and handled in Option.PATCH_MODULE
+                    log.error(Errors.LocnInvalidArgForXpatch(value));
+                }
+            }
+
+            return true;
+        }
+
+        @Override
+        boolean isSet() {
+            return !moduleTable.isEmpty();
+        }
+
+        @Override
+        Collection<Path> getPaths() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        void setPaths(Iterable<? extends Path> files) throws IOException {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override // defined by LocationHandler
+        void setPathsForModule(String moduleName, Iterable<? extends Path> files) throws IOException {
+            throw new UnsupportedOperationException(); // not yet
+        }
+
+        @Override
+        Location getLocationForModule(String name) throws IOException {
+            return moduleTable.get(name);
+        }
+
+        @Override
+        Location getLocationForModule(Path file) throws IOException {
+            return moduleTable.get(file);
+        }
+
+        @Override
+        Iterable<Set<Location>> listLocationsForModules() throws IOException {
+            return Collections.singleton(moduleTable.locations());
+        }
+    }
+
     Map<Location, LocationHandler> handlersForLocation;
     Map<Option, LocationHandler> handlersForOption;
 
@@ -1568,7 +1820,7 @@
             new OutputLocationHandler(StandardLocation.SOURCE_OUTPUT, Option.S),
             new OutputLocationHandler(StandardLocation.NATIVE_HEADER_OUTPUT, Option.H),
             new ModuleSourcePathLocationHandler(),
-            // TODO: should UPGRADE_MODULE_PATH be merged with SYSTEM_MODULES?
+            new PatchModulesLocationHandler(),
             new ModulePathLocationHandler(StandardLocation.UPGRADE_MODULE_PATH, Option.UPGRADE_MODULE_PATH),
             new ModulePathLocationHandler(StandardLocation.MODULE_PATH, Option.MODULE_PATH),
             new SystemModulesLocationHandler(),
@@ -1582,51 +1834,9 @@
         }
     }
 
-    private Map<String, SearchPath> patchMap;
-
     boolean handleOption(Option option, String value) {
-        switch (option) {
-            case PATCH_MODULE:
-                if (value == null) {
-                    patchMap = null;
-                } else {
-                    // Allow an extended syntax for --patch-module consisting of a series
-                    // of values separated by NULL characters. This is to facilitate
-                    // supporting deferred file manager options on the command line.
-                    // See Option.PATCH_MODULE for the code that composes these multiple
-                    // values.
-                    for (String v : value.split("\0")) {
-                        int eq = v.indexOf('=');
-                        if (eq > 0) {
-                            String mName = v.substring(0, eq);
-                            SearchPath mPatchPath = new SearchPath()
-                                    .addFiles(v.substring(eq + 1));
-                            boolean ok = true;
-                            for (Path p : mPatchPath) {
-                                Path mi = p.resolve("module-info.class");
-                                if (Files.exists(mi)) {
-                                    log.error(Errors.LocnModuleInfoNotAllowedOnPatchPath(mi));
-                                    ok = false;
-                                }
-                            }
-                            if (ok) {
-                                if (patchMap == null) {
-                                    patchMap = new LinkedHashMap<>();
-                                }
-                                patchMap.put(mName, mPatchPath);
-                            }
-                        } else {
-                            // Should not be able to get here;
-                            // this should be caught and handled in Option.PATCH_MODULE
-                            log.error(Errors.LocnInvalidArgForXpatch(value));
-                        }
-                    }
-                }
-                return true;
-            default:
-                LocationHandler h = handlersForOption.get(option);
-                return (h == null ? false : h.handleOption(option, value));
-        }
+        LocationHandler h = handlersForOption.get(option);
+        return (h == null ? false : h.handleOption(option, value));
     }
 
     boolean hasLocation(Location location) {
@@ -1665,9 +1875,23 @@
         return (h == null ? null : h.getLocationForModule(name));
     }
 
-    Location getLocationForModule(Location location, Path dir) {
+    Location getLocationForModule(Location location, Path file) throws IOException {
         LocationHandler h = getHandler(location);
-        return (h == null ? null : h.getLocationForModule(dir));
+        return (h == null ? null : h.getLocationForModule(file));
+    }
+
+    void setLocationForModule(Location location, String moduleName,
+            Iterable<? extends Path> files) throws IOException {
+        LocationHandler h = getHandler(location);
+        if (h == null) {
+            if (location.isOutputLocation()) {
+                h = new OutputLocationHandler(location);
+            } else {
+                h = new ModulePathLocationHandler(location);
+            }
+            handlersForLocation.put(location, h);
+        }
+        h.setPathsForModule(moduleName, files);
     }
 
     String inferModuleName(Location location) {
@@ -1703,5 +1927,4 @@
             return p.toAbsolutePath().normalize();
         }
     }
-
 }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
index 433c3a2..d4aeb99 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
@@ -2354,7 +2354,7 @@
                 (flags & ABSTRACT) == 0 && !name.equals(names.clinit)) {
             if (majorVersion > Version.V52.major ||
                     (majorVersion == Version.V52.major && minorVersion >= Version.V52.minor)) {
-                if ((flags & STATIC) == 0) {
+                if ((flags & (STATIC | PRIVATE)) == 0) {
                     currentOwner.flags_field |= DEFAULT;
                     flags |= DEFAULT | ABSTRACT;
                 }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
index 7a9ad62..2230fc7 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,6 @@
 import com.sun.tools.javac.code.Type.*;
 import com.sun.tools.javac.jvm.Code.*;
 import com.sun.tools.javac.jvm.Items.*;
-import com.sun.tools.javac.main.Option;
 import com.sun.tools.javac.tree.EndPosTable;
 import com.sun.tools.javac.tree.JCTree.*;
 
@@ -67,10 +66,9 @@
     private final TreeMaker make;
     private final Names names;
     private final Target target;
-    private Name accessDollar;
+    private final Name accessDollar;
     private final Types types;
     private final Lower lower;
-    private final Flow flow;
     private final Annotate annotate;
     private final StringConcat concat;
 
@@ -95,7 +93,7 @@
 
     /** Constant pool, reset by genClass.
      */
-    private Pool pool;
+    private final Pool pool;
 
     protected Gen(Context context) {
         context.put(genKey, this);
@@ -113,7 +111,6 @@
         methodType = new MethodType(null, null, null, syms.methodClass);
         accessDollar = names.
             fromString("access" + target.syntheticNameChar());
-        flow = Flow.instance(context);
         lower = Lower.instance(context);
 
         Options options = Options.instance(context);
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java
index 179cd04..efe6538 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java
@@ -39,6 +39,7 @@
 import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Predicate;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Stream;
@@ -283,23 +284,14 @@
     }
 
     /**
-     * Processes strings containing options and operands.
-     * @param args the strings to be processed
-     * @param allowableOpts the set of option declarations that are applicable
-     * @param helper a help for use by Option.process
-     * @param allowOperands whether or not to check for files and classes
-     * @param checkFileManager whether or not to check if the file manager can handle
-     *      options which are not recognized by any of allowableOpts
-     * @return true if all the strings were successfully processed; false otherwise
-     * @throws IllegalArgumentException if a problem occurs and errorMode is set to
-     *      ILLEGAL_ARGUMENT
+     * Handles the {@code --release} option.
+     *
+     * @param additionalOptions a predicate to handle additional options implied by the
+     * {@code --release} option. The predicate should return true if all the additional
+     * options were processed successfully.
+     * @return true if successful, false otherwise
      */
-    private boolean processArgs(Iterable<String> args,
-            Set<Option> allowableOpts, OptionHelper helper,
-            boolean allowOperands, boolean checkFileManager) {
-        if (!doProcessArgs(args, allowableOpts, helper, allowOperands, checkFileManager))
-            return false;
-
+    public boolean handleReleaseOptions(Predicate<Iterable<String>> additionalOptions) {
         String platformString = options.get(Option.RELEASE);
 
         checkOptionAllowed(platformString == null,
@@ -323,7 +315,7 @@
 
             context.put(PlatformDescription.class, platformDescription);
 
-            if (!doProcessArgs(platformDescription.getAdditionalOptions(), allowableOpts, helper, allowOperands, checkFileManager))
+            if (!additionalOptions.test(platformDescription.getAdditionalOptions()))
                 return false;
 
             Collection<Path> platformCP = platformDescription.getPlatformPath();
@@ -348,6 +340,30 @@
             }
         }
 
+        return true;
+    }
+
+    /**
+     * Processes strings containing options and operands.
+     * @param args the strings to be processed
+     * @param allowableOpts the set of option declarations that are applicable
+     * @param helper a help for use by Option.process
+     * @param allowOperands whether or not to check for files and classes
+     * @param checkFileManager whether or not to check if the file manager can handle
+     *      options which are not recognized by any of allowableOpts
+     * @return true if all the strings were successfully processed; false otherwise
+     * @throws IllegalArgumentException if a problem occurs and errorMode is set to
+     *      ILLEGAL_ARGUMENT
+     */
+    private boolean processArgs(Iterable<String> args,
+            Set<Option> allowableOpts, OptionHelper helper,
+            boolean allowOperands, boolean checkFileManager) {
+        if (!doProcessArgs(args, allowableOpts, helper, allowOperands, checkFileManager))
+            return false;
+
+        if (!handleReleaseOptions(extra -> doProcessArgs(extra, allowableOpts, helper, allowOperands, checkFileManager)))
+            return false;
+
         options.notifyListeners();
 
         return true;
@@ -598,9 +614,6 @@
                     && !fm.hasLocation(StandardLocation.CLASS_OUTPUT)) {
                 log.error(Errors.NoOutputDir);
             }
-            if (options.isSet(Option.XMODULE)) {
-                log.error(Errors.XmoduleNoModuleSourcepath);
-            }
         }
 
         if (fm.hasLocation(StandardLocation.ANNOTATION_PROCESSOR_MODULE_PATH) &&
@@ -617,6 +630,7 @@
         validateAddModules(sv);
         validateAddReads(sv);
         validateLimitModules(sv);
+        validateDefaultModuleForCreatedFiles(sv);
 
         if (lintOptions && options.isSet(Option.ADD_OPENS)) {
             log.warning(LintCategory.OPTIONS, Warnings.AddopensIgnored);
@@ -754,6 +768,17 @@
         }
     }
 
+    private void validateDefaultModuleForCreatedFiles(SourceVersion sv) {
+        String moduleName = options.get(Option.DEFAULT_MODULE_FOR_CREATED_FILES);
+        if (moduleName != null) {
+            if (!SourceVersion.isName(moduleName, sv)) {
+                // syntactically invalid module name:  e.g. --default-module-for-created-files m!
+                log.error(Errors.BadNameForOption(Option.DEFAULT_MODULE_FOR_CREATED_FILES,
+                                                  moduleName));
+            }
+        }
+    }
+
     /**
      * Returns true if there are no files or classes specified for use.
      * @return true if there are no files or classes specified for use
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/CommandLine.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/CommandLine.java
index 9fc5441..9e63987 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/CommandLine.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/CommandLine.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,8 +29,9 @@
 import java.io.Reader;
 import java.nio.file.Files;
 import java.nio.file.Paths;
-
-import com.sun.tools.javac.util.ListBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * Various utility methods for processing Java tool command line arguments.
@@ -55,28 +56,80 @@
      * @throws IOException if there is a problem reading any of the @files
      */
     public static String[] parse(String[] args) throws IOException {
-        ListBuffer<String> newArgs = new ListBuffer<>();
+        List<String> newArgs = new ArrayList<>();
+        appendParsedCommandArgs(newArgs, Arrays.asList(args));
+        return newArgs.toArray(new String[newArgs.size()]);
+    }
+
+    private static void appendParsedCommandArgs(List<String> newArgs, List<String> args) throws IOException {
         for (String arg : args) {
             if (arg.length() > 1 && arg.charAt(0) == '@') {
                 arg = arg.substring(1);
                 if (arg.charAt(0) == '@') {
-                    newArgs.append(arg);
+                    newArgs.add(arg);
                 } else {
                     loadCmdFile(arg, newArgs);
                 }
             } else {
-                newArgs.append(arg);
+                newArgs.add(arg);
             }
         }
-        return newArgs.toList().toArray(new String[newArgs.length()]);
     }
 
-    private static void loadCmdFile(String name, ListBuffer<String> args) throws IOException {
+    /**
+     * Process the given environment variable and appends any Win32-style
+     * command files for the specified command line arguments and return
+     * the resulting arguments. A command file argument
+     * is of the form '@file' where 'file' is the name of the file whose
+     * contents are to be parsed for additional arguments. The contents of
+     * the command file are parsed using StreamTokenizer and the original
+     * '@file' argument replaced with the resulting tokens. Recursive command
+     * files are not supported. The '@' character itself can be quoted with
+     * the sequence '@@'.
+     * @param envVariable the env variable to process
+     * @param args the arguments that may contain @files
+     * @return the arguments, with environment variable's content and expansion of @files
+     * @throws IOException if there is a problem reading any of the @files
+     * @throws com.sun.tools.javac.main.CommandLine.UnmatchedQuote
+     */
+    public static List<String> parse(String envVariable, List<String> args)
+            throws IOException, UnmatchedQuote {
+
+        List<String> inArgs = new ArrayList<>();
+        appendParsedEnvVariables(inArgs, envVariable);
+        inArgs.addAll(args);
+        List<String> newArgs = new ArrayList<>();
+        appendParsedCommandArgs(newArgs, inArgs);
+        return newArgs;
+    }
+
+    /**
+     * Process the given environment variable and appends any Win32-style
+     * command files for the specified command line arguments and return
+     * the resulting arguments. A command file argument
+     * is of the form '@file' where 'file' is the name of the file whose
+     * contents are to be parsed for additional arguments. The contents of
+     * the command file are parsed using StreamTokenizer and the original
+     * '@file' argument replaced with the resulting tokens. Recursive command
+     * files are not supported. The '@' character itself can be quoted with
+     * the sequence '@@'.
+     * @param envVariable the env variable to process
+     * @param args the arguments that may contain @files
+     * @return the arguments, with environment variable's content and expansion of @files
+     * @throws IOException if there is a problem reading any of the @files
+     * @throws com.sun.tools.javac.main.CommandLine.UnmatchedQuote
+     */
+    public static String[] parse(String envVariable, String[] args) throws IOException, UnmatchedQuote {
+        List<String> out = parse(envVariable, Arrays.asList(args));
+        return out.toArray(new String[out.size()]);
+    }
+
+    private static void loadCmdFile(String name, List<String> args) throws IOException {
         try (Reader r = Files.newBufferedReader(Paths.get(name))) {
             Tokenizer t = new Tokenizer(r);
             String s;
             while ((s = t.nextToken()) != null) {
-                args.append(s);
+                args.add(s);
             }
         }
     }
@@ -188,4 +241,75 @@
             }
         }
     }
+
+    @SuppressWarnings("fallthrough")
+    private static void appendParsedEnvVariables(List<String> newArgs, String envVariable)
+            throws UnmatchedQuote {
+
+        if (envVariable == null) {
+            return;
+        }
+        String in = System.getenv(envVariable);
+        if (in == null || in.trim().isEmpty()) {
+            return;
+        }
+
+        final char NUL = (char)0;
+        final int len = in.length();
+
+        int pos = 0;
+        StringBuilder sb = new StringBuilder();
+        char quote = NUL;
+        char ch;
+
+        loop:
+        while (pos < len) {
+            ch = in.charAt(pos);
+            switch (ch) {
+                case '\"': case '\'':
+                    if (quote == NUL) {
+                        quote = ch;
+                    } else if (quote == ch) {
+                        quote = NUL;
+                    } else {
+                        sb.append(ch);
+                    }
+                    pos++;
+                    break;
+                case '\f': case '\n': case '\r': case '\t': case ' ':
+                    if (quote == NUL) {
+                        newArgs.add(sb.toString());
+                        sb.setLength(0);
+                        while (ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') {
+                            pos++;
+                            if (pos >= len) {
+                                break loop;
+                            }
+                            ch = in.charAt(pos);
+                        }
+                        break;
+                    }
+                    // fall through
+                default:
+                    sb.append(ch);
+                    pos++;
+            }
+        }
+        if (sb.length() != 0) {
+            newArgs.add(sb.toString());
+        }
+        if (quote != NUL) {
+            throw new UnmatchedQuote(envVariable);
+        }
+    }
+
+    public static class UnmatchedQuote extends Exception {
+        private static final long serialVersionUID = 0;
+
+        public final String variableName;
+
+        UnmatchedQuote(String variable) {
+            this.variableName = variable;
+        }
+    }
 }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java
index 8f0819e..8fa91a2 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java
@@ -69,12 +69,12 @@
 import com.sun.tools.javac.tree.JCTree.JCLambda;
 import com.sun.tools.javac.tree.JCTree.JCMemberReference;
 import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
-import com.sun.tools.javac.tree.JCTree.JCModuleDecl;
 import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
-import com.sun.tools.javac.tree.JCTree.Tag;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.DefinedBy.Api;
 import com.sun.tools.javac.util.JCDiagnostic.Factory;
+import com.sun.tools.javac.util.Log.DiagnosticHandler;
+import com.sun.tools.javac.util.Log.DiscardDiagnosticHandler;
 import com.sun.tools.javac.util.Log.WriterKind;
 
 import static com.sun.tools.javac.code.Kinds.Kind.*;
@@ -89,6 +89,8 @@
 
 import static javax.tools.StandardLocation.CLASS_OUTPUT;
 
+import com.sun.tools.javac.tree.JCTree.JCModuleDecl;
+
 /** This class could be the main entry point for GJC when GJC is used as a
  *  component in a larger software system. It provides operations to
  *  construct a new compiler, and to run a new compiler on a set of source
@@ -340,13 +342,6 @@
     protected final Symbol.Completer sourceCompleter =
             sym -> readSourceFile((ClassSymbol) sym);
 
-    protected final ModuleFinder.ModuleInfoSourceFileCompleter moduleInfoSourceFileCompleter =
-            fo -> (ModuleSymbol) readSourceFile(parseImplicitFile(fo), null, tl -> {
-                return tl.defs.nonEmpty() && tl.defs.head.hasTag(Tag.MODULEDEF) ?
-                        ((JCModuleDecl) tl.defs.head).sym.module_info :
-                        syms.defineClass(names.module_info, syms.errModule);
-            }).owner;
-
     /**
      * Command line options.
      */
@@ -417,7 +412,8 @@
         diags = Factory.instance(context);
 
         finder.sourceCompleter = sourceCompleter;
-        moduleFinder.sourceFileCompleter = moduleInfoSourceFileCompleter;
+        modules.findPackageInFile = this::findPackageInFile;
+        moduleFinder.moduleNameFromSourceReader = this::readModuleName;
 
         options = Options.instance(context);
 
@@ -787,19 +783,6 @@
         readSourceFile(null, c);
     }
 
-    private JCTree.JCCompilationUnit parseImplicitFile(JavaFileObject filename) {
-        JavaFileObject prev = log.useSource(filename);
-        try {
-            JCTree.JCCompilationUnit t = parse(filename, filename.getCharContent(false));
-            return t;
-        } catch (IOException e) {
-            log.error("error.reading.file", filename, JavacFileManager.getMessage(e));
-            return make.TopLevel(List.nil());
-        } finally {
-            log.useSource(prev);
-        }
-    }
-
     /** Compile a ClassSymbol from source, optionally using the given compilation unit as
      *  the source tree.
      *  @param tree the compilation unit in which the given ClassSymbol resides,
@@ -810,20 +793,20 @@
         if (completionFailureName == c.fullname) {
             throw new CompletionFailure(c, "user-selected completion failure by class name");
         }
+        JavaFileObject filename = c.classfile;
+        JavaFileObject prev = log.useSource(filename);
 
         if (tree == null) {
-            tree = parseImplicitFile(c.classfile);
+            try {
+                tree = parse(filename, filename.getCharContent(false));
+            } catch (IOException e) {
+                log.error("error.reading.file", filename, JavacFileManager.getMessage(e));
+                tree = make.TopLevel(List.<JCTree>nil());
+            } finally {
+                log.useSource(prev);
+            }
         }
 
-        readSourceFile(tree, c, cut -> c);
-    }
-
-    private ClassSymbol readSourceFile(JCCompilationUnit tree,
-                                       ClassSymbol expectedSymbol,
-                                       Function<JCCompilationUnit, ClassSymbol> symbolGetter)
-                                           throws CompletionFailure {
-        Assert.checkNonNull(tree);
-
         if (!taskListener.isEmpty()) {
             TaskEvent e = new TaskEvent(TaskEvent.Kind.ENTER, tree);
             taskListener.started(e);
@@ -835,20 +818,18 @@
         // Note that if module resolution failed, we may not even
         // have enough modules available to access java.lang, and
         // so risk getting FatalError("no.java.lang") from MemberEnter.
-        if (!modules.enter(List.of(tree), expectedSymbol)) {
-            throw new CompletionFailure(symbolGetter.apply(tree),
-                                        diags.fragment("cant.resolve.modules"));
+        if (!modules.enter(List.of(tree), c)) {
+            throw new CompletionFailure(c, diags.fragment("cant.resolve.modules"));
         }
 
-        enter.complete(List.of(tree), expectedSymbol);
+        enter.complete(List.of(tree), c);
 
         if (!taskListener.isEmpty()) {
             TaskEvent e = new TaskEvent(TaskEvent.Kind.ENTER, tree);
             taskListener.finished(e);
         }
 
-        ClassSymbol sym = symbolGetter.apply(tree);
-        if (sym == null || enter.getEnv(sym) == null) {
+        if (enter.getEnv(c) == null) {
             boolean isPkgInfo =
                 tree.sourcefile.isNameCompatible("package-info",
                                                  JavaFileObject.Kind.SOURCE);
@@ -859,26 +840,24 @@
                 if (enter.getEnv(tree.modle) == null) {
                     JCDiagnostic diag =
                         diagFactory.fragment("file.does.not.contain.module");
-                    throw new ClassFinder.BadClassFile(sym, tree.sourcefile, diag, diagFactory);
+                    throw new ClassFinder.BadClassFile(c, filename, diag, diagFactory);
                 }
             } else if (isPkgInfo) {
                 if (enter.getEnv(tree.packge) == null) {
                     JCDiagnostic diag =
                         diagFactory.fragment("file.does.not.contain.package",
-                                                 sym.location());
-                    throw new ClassFinder.BadClassFile(sym, tree.sourcefile, diag, diagFactory);
+                                                 c.location());
+                    throw new ClassFinder.BadClassFile(c, filename, diag, diagFactory);
                 }
             } else {
                 JCDiagnostic diag =
                         diagFactory.fragment("file.doesnt.contain.class",
-                                            sym.getQualifiedName());
-                throw new ClassFinder.BadClassFile(sym, tree.sourcefile, diag, diagFactory);
+                                            c.getQualifiedName());
+                throw new ClassFinder.BadClassFile(c, filename, diag, diagFactory);
             }
         }
 
         implicitSourceFilesRead = true;
-
-        return sym;
     }
 
     /** Track when the JavaCompiler has been used to compile something. */
@@ -888,7 +867,7 @@
 
     public void compile(List<JavaFileObject> sourceFileObject)
         throws Throwable {
-        compile(sourceFileObject, List.nil(), null);
+        compile(sourceFileObject, List.nil(), null, List.nil());
     }
 
     /**
@@ -898,10 +877,13 @@
      * @param classnames class names to process for annotations
      * @param processors user provided annotation processors to bypass
      * discovery, {@code null} means that no processors were provided
+     * @param addModules additional root modules to be used during
+     * module resolution.
      */
     public void compile(Collection<JavaFileObject> sourceFileObjects,
                         Collection<String> classnames,
-                        Iterable<? extends Processor> processors)
+                        Iterable<? extends Processor> processors,
+                        Collection<String> addModules)
     {
         if (!taskListener.isEmpty()) {
             taskListener.started(new TaskEvent(TaskEvent.Kind.COMPILATION));
@@ -932,6 +914,10 @@
                 }
             }
 
+            for (String moduleName : addModules) {
+                modules.addExtraAddModules(moduleName);
+            }
+
             // These method calls must be chained to avoid memory leaks
             processAnnotations(
                 enterTrees(
@@ -1450,6 +1436,11 @@
             return;
         }
 
+        if (!modules.multiModuleMode && env.toplevel.modle != modules.getDefaultModule()) {
+            //can only generate classfiles for a single module:
+            return;
+        }
+
         if (compileStates.isDone(env, CompileState.LOWER)) {
             results.addAll(desugaredEnvs.get(env));
             return;
@@ -1739,6 +1730,32 @@
         return enterDone;
     }
 
+    private Name readModuleName(JavaFileObject fo) {
+        return parseAndGetName(fo, t -> {
+            JCModuleDecl md = t.getModuleDecl();
+
+            return md != null ? TreeInfo.fullName(md.getName()) : null;
+        });
+    }
+
+    private Name findPackageInFile(JavaFileObject fo) {
+        return parseAndGetName(fo, t -> t.getPackage() != null ?
+                                        TreeInfo.fullName(t.getPackage().getPackageName()) : null);
+    }
+
+    private Name parseAndGetName(JavaFileObject fo,
+                                 Function<JCTree.JCCompilationUnit, Name> tree2Name) {
+        DiagnosticHandler dh = new DiscardDiagnosticHandler(log);
+        try {
+            JCTree.JCCompilationUnit t = parse(fo, fo.getCharContent(false));
+            return tree2Name.apply(t);
+        } catch (IOException e) {
+            return null;
+        } finally {
+            log.popDiagnosticHandler(dh);
+        }
+    }
+
     /** Close the compiler, flushing the logs
      */
     public void close() {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java
index 3056829..d356f4a 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
 import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.jvm.Target;
+import com.sun.tools.javac.main.CommandLine.UnmatchedQuote;
 import com.sun.tools.javac.platform.PlatformDescription;
 import com.sun.tools.javac.processing.AnnotationProcessingError;
 import com.sun.tools.javac.util.*;
@@ -80,6 +81,7 @@
      */
     boolean apiMode;
 
+    private static final String ENV_OPT_NAME = "JDK_JAVAC_OPTIONS";
 
     /** Result codes.
      */
@@ -201,19 +203,12 @@
             return Result.CMDERR;
         }
 
-        // prefix argv with contents of _JAVAC_OPTIONS if set
-        String envOpt = System.getenv("_JAVAC_OPTIONS");
-        if (envOpt != null && !envOpt.trim().isEmpty()) {
-            String[] envv = envOpt.split("\\s+");
-            String[] result = new String[envv.length + argv.length];
-            System.arraycopy(envv, 0, result, 0, envv.length);
-            System.arraycopy(argv, 0, result, envv.length, argv.length);
-            argv = result;
-        }
-
-        // expand @-files
+        // prefix argv with contents of environment variable and expand @-files
         try {
-            argv = CommandLine.parse(argv);
+            argv = CommandLine.parse(ENV_OPT_NAME, argv);
+        } catch (UnmatchedQuote ex) {
+            error("err.unmatched.quote", ex.variableName);
+            return Result.CMDERR;
         } catch (FileNotFoundException | NoSuchFileException e) {
             warning("err.file.not.found", e.getMessage());
             return Result.SYSERR;
@@ -304,7 +299,7 @@
         }
 
         try {
-            comp.compile(args.getFileObjects(), args.getClassNames(), null);
+            comp.compile(args.getFileObjects(), args.getClassNames(), null, List.nil());
 
             if (log.expectDiagKeys != null) {
                 if (log.expectDiagKeys.isEmpty()) {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java
index c7fba06..0c39b3d 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java
@@ -399,6 +399,30 @@
         }
     },
 
+    DEFAULT_MODULE_FOR_CREATED_FILES("--default-module-for-created-files",
+                                     "opt.arg.default.module.for.created.files",
+                                     "opt.default.module.for.created.files", EXTENDED, BASIC) {
+        @Override
+        public void process(OptionHelper helper, String option, String arg) throws InvalidValueException {
+            String prev = helper.get(DEFAULT_MODULE_FOR_CREATED_FILES);
+            if (prev != null) {
+                throw helper.newInvalidValueException("err.option.too.many",
+                                                      DEFAULT_MODULE_FOR_CREATED_FILES.primaryName);
+            } else if (arg.isEmpty()) {
+                throw helper.newInvalidValueException("err.no.value.for.option", option);
+            } else if (getPattern().matcher(arg).matches()) {
+                helper.put(DEFAULT_MODULE_FOR_CREATED_FILES.primaryName, arg);
+            } else {
+                throw helper.newInvalidValueException("err.bad.value.for.option", option, arg);
+            }
+        }
+
+        @Override
+        public Pattern getPattern() {
+            return Pattern.compile("[^,].*");
+        }
+    },
+
     X("--help-extra -X", "opt.X", STANDARD, INFO) {
         @Override
         public void process(OptionHelper helper, String option) throws InvalidValueException {
@@ -579,7 +603,7 @@
         }
     },
 
-    XMODULE("-Xmodule:", "opt.arg.module", "opt.module", EXTENDED, BASIC) {
+    XMODULE("-Xmodule:", "opt.arg.module", "opt.module", HIDDEN, BASIC) {
         @Override
         public void process(OptionHelper helper, String option, String arg) throws InvalidValueException {
             String prev = helper.get(XMODULE);
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java
index 465af2f..a02e34e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java
@@ -25,6 +25,7 @@
 
 package com.sun.tools.javac.model;
 
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.Map;
@@ -117,6 +118,14 @@
     }
 
     @Override @DefinedBy(Api.LANGUAGE_MODEL)
+    public Set<? extends ModuleElement> getAllModuleElements() {
+        if (allowModules)
+            return Collections.unmodifiableSet(modules.allModules());
+        else
+            return Collections.emptySet();
+    }
+
+    @Override @DefinedBy(Api.LANGUAGE_MODEL)
     public ModuleSymbol getModuleElement(CharSequence name) {
         ensureEntered("getModuleElement");
         if (modules.getDefaultModule() == syms.noModule)
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java
index 89f7f78..e3e158a 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java
@@ -93,22 +93,22 @@
 
     @DefinedBy(Api.LANGUAGE_MODEL)
     public boolean isSubtype(TypeMirror t1, TypeMirror t2) {
-        validateTypeNotIn(t1, EXEC_OR_PKG);
-        validateTypeNotIn(t2, EXEC_OR_PKG);
+        validateTypeNotIn(t1, EXEC_OR_PKG_OR_MOD);
+        validateTypeNotIn(t2, EXEC_OR_PKG_OR_MOD);
         return types.isSubtype((Type) t1, (Type) t2);
     }
 
     @DefinedBy(Api.LANGUAGE_MODEL)
     public boolean isAssignable(TypeMirror t1, TypeMirror t2) {
-        validateTypeNotIn(t1, EXEC_OR_PKG);
-        validateTypeNotIn(t2, EXEC_OR_PKG);
+        validateTypeNotIn(t1, EXEC_OR_PKG_OR_MOD);
+        validateTypeNotIn(t2, EXEC_OR_PKG_OR_MOD);
         return types.isAssignable((Type) t1, (Type) t2);
     }
 
     @DefinedBy(Api.LANGUAGE_MODEL)
     public boolean contains(TypeMirror t1, TypeMirror t2) {
-        validateTypeNotIn(t1, EXEC_OR_PKG);
-        validateTypeNotIn(t2, EXEC_OR_PKG);
+        validateTypeNotIn(t1, EXEC_OR_PKG_OR_MOD);
+        validateTypeNotIn(t2, EXEC_OR_PKG_OR_MOD);
         return types.containsType((Type) t1, (Type) t2);
     }
 
@@ -119,7 +119,7 @@
 
     @DefinedBy(Api.LANGUAGE_MODEL)
     public List<Type> directSupertypes(TypeMirror t) {
-        validateTypeNotIn(t, EXEC_OR_PKG);
+        validateTypeNotIn(t, EXEC_OR_PKG_OR_MOD);
         Type ty = (Type)t;
         return types.directSupertypes(ty).stream()
                 .map(Type::stripMetadataIfNeeded)
@@ -128,7 +128,8 @@
 
     @DefinedBy(Api.LANGUAGE_MODEL)
     public TypeMirror erasure(TypeMirror t) {
-        if (t.getKind() == TypeKind.PACKAGE)
+        TypeKind kind = t.getKind();
+        if (kind == TypeKind.PACKAGE || kind == TypeKind.MODULE)
             throw new IllegalArgumentException(t.toString());
         return types.erasure((Type)t).stripMetadataIfNeeded();
     }
@@ -150,7 +151,7 @@
 
     @DefinedBy(Api.LANGUAGE_MODEL)
     public TypeMirror capture(TypeMirror t) {
-        validateTypeNotIn(t, EXEC_OR_PKG);
+        validateTypeNotIn(t, EXEC_OR_PKG_OR_MOD);
         return types.capture((Type)t).stripMetadataIfNeeded();
     }
 
@@ -192,6 +193,7 @@
         case EXECUTABLE:
         case WILDCARD:  // heh!
         case PACKAGE:
+        case MODULE:
             throw new IllegalArgumentException(componentType.toString());
         }
         return new Type.ArrayType((Type) componentType, syms.arrayClass);
@@ -299,8 +301,8 @@
     }
 
 
-    private static final Set<TypeKind> EXEC_OR_PKG =
-            EnumSet.of(TypeKind.EXECUTABLE, TypeKind.PACKAGE);
+    private static final Set<TypeKind> EXEC_OR_PKG_OR_MOD =
+        EnumSet.of(TypeKind.EXECUTABLE, TypeKind.PACKAGE, TypeKind.MODULE);
 
     /**
      * Throws an IllegalArgumentException if a type's kind is one of a set.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java
index 61b25bc..557af98 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,8 @@
 import com.sun.tools.javac.util.DefinedBy.Api;
 
 import static com.sun.tools.javac.code.Lint.LintCategory.PROCESSING;
+import com.sun.tools.javac.code.Symbol.PackageSymbol;
+import com.sun.tools.javac.main.Option;
 
 /**
  * The FilerImplementation class must maintain a number of
@@ -384,6 +386,8 @@
 
     private final Set<String> initialClassNames;
 
+    private final String defaultTargetModule;
+
     JavacFiler(Context context) {
         this.context = context;
         fileManager = context.get(JavaFileManager.class);
@@ -408,6 +412,10 @@
         initialClassNames  = new LinkedHashSet<>();
 
         lint = (Lint.instance(context)).isEnabled(PROCESSING);
+
+        Options options = Options.instance(context);
+
+        defaultTargetModule = options.get(Option.DEFAULT_MODULE_FOR_CREATED_FILES);
     }
 
     @Override @DefinedBy(Api.ANNOTATION_PROCESSING)
@@ -427,29 +435,42 @@
     private Pair<ModuleSymbol, String> checkOrInferModule(CharSequence moduleAndPkg) throws FilerException {
         String moduleAndPkgString = moduleAndPkg.toString();
         int slash = moduleAndPkgString.indexOf('/');
+        String module;
+        String pkg;
 
-        if (slash != (-1)) {
-            //module name specified:
-            String module = moduleAndPkgString.substring(0, slash);
+        if (slash == (-1)) {
+            //module name not specified:
+            int lastDot = moduleAndPkgString.lastIndexOf('.');
+            String pack = lastDot != (-1) ? moduleAndPkgString.substring(0, lastDot) : "";
+            ModuleSymbol msym = inferModule(pack);
 
-            ModuleSymbol explicitModule = syms.getModule(names.fromString(module));
-
-            if (explicitModule == null) {
-                throw new FilerException("Module: " + module + " does not exist.");
+            if (msym != null) {
+                return Pair.of(msym, moduleAndPkgString);
             }
 
-            if (!modules.isRootModule(explicitModule)) {
-                throw new FilerException("Cannot write to the given module!");
+            if (defaultTargetModule == null) {
+                throw new FilerException("Cannot determine target module.");
             }
 
-            return Pair.of(explicitModule, moduleAndPkgString.substring(slash + 1));
+            module = defaultTargetModule;
+            pkg = moduleAndPkgString;
         } else {
-            if (modules.multiModuleMode) {
-                throw new FilerException("No module to write to specified!");
-            }
-
-            return Pair.of(modules.getDefaultModule(), moduleAndPkgString);
+            //module name specified:
+            module = moduleAndPkgString.substring(0, slash);
+            pkg = moduleAndPkgString.substring(slash + 1);
         }
+
+        ModuleSymbol explicitModule = syms.getModule(names.fromString(module));
+
+        if (explicitModule == null) {
+            throw new FilerException("Module: " + module + " does not exist.");
+        }
+
+        if (!modules.isRootModule(explicitModule)) {
+            throw new FilerException("Cannot write to the given module.");
+        }
+
+        return Pair.of(explicitModule, pkg);
     }
 
     private JavaFileObject createSourceOrClassFile(ModuleSymbol mod, boolean isSourceFile, String name) throws IOException {
@@ -495,17 +516,13 @@
                                      CharSequence moduleAndPkg,
                                      CharSequence relativeName,
                                      Element... originatingElements) throws IOException {
-        Pair<ModuleSymbol, String> moduleAndPackage = checkOrInferModule(moduleAndPkg);
-        ModuleSymbol msym = moduleAndPackage.fst;
-        String pkg = moduleAndPackage.snd;
+        Tuple3<Location, ModuleSymbol, String> locationModuleAndPackage = checkOrInferModule(location, moduleAndPkg, true);
+        location = locationModuleAndPackage.a;
+        ModuleSymbol msym = locationModuleAndPackage.b;
+        String pkg = locationModuleAndPackage.c;
 
         locationCheck(location);
 
-        if (modules.multiModuleMode) {
-            Assert.checkNonNull(msym);
-            location = this.fileManager.getLocationForModule(location, msym.name.toString());
-        }
-
         String strPkg = pkg.toString();
         if (strPkg.length() > 0)
             checkName(strPkg);
@@ -534,14 +551,9 @@
     public FileObject getResource(JavaFileManager.Location location,
                                   CharSequence moduleAndPkg,
                                   CharSequence relativeName) throws IOException {
-        Pair<ModuleSymbol, String> moduleAndPackage = checkOrInferModule(moduleAndPkg);
-        ModuleSymbol msym = moduleAndPackage.fst;
-        String pkg = moduleAndPackage.snd;
-
-        if (modules.multiModuleMode) {
-            Assert.checkNonNull(msym);
-            location = this.fileManager.getLocationForModule(location, msym.name.toString());
-        }
+        Tuple3<Location, ModuleSymbol, String> locationModuleAndPackage = checkOrInferModule(location, moduleAndPkg, false);
+        location = locationModuleAndPackage.a;
+        String pkg = locationModuleAndPackage.c;
 
         if (pkg.length() > 0)
             checkName(pkg);
@@ -578,6 +590,99 @@
         return new FilerInputFileObject(fileObject);
     }
 
+    private Tuple3<JavaFileManager.Location, ModuleSymbol, String> checkOrInferModule(JavaFileManager.Location location,
+                                                           CharSequence moduleAndPkg,
+                                                           boolean write) throws IOException {
+        String moduleAndPkgString = moduleAndPkg.toString();
+        int slash = moduleAndPkgString.indexOf('/');
+        boolean multiModuleLocation = location.isModuleOrientedLocation() ||
+                                      (modules.multiModuleMode && location.isOutputLocation());
+        String module;
+        String pkg;
+
+        if (slash == (-1)) {
+            //module name not specified:
+            if (!multiModuleLocation) {
+                //package oriented location:
+                return new Tuple3<>(location, modules.getDefaultModule(), moduleAndPkgString);
+            }
+
+            if (location.isOutputLocation()) {
+                ModuleSymbol msym = inferModule(moduleAndPkgString);
+
+                if (msym != null) {
+                    Location moduleLoc =
+                            fileManager.getLocationForModule(location, msym.name.toString());
+                    return new Tuple3<>(moduleLoc, msym, moduleAndPkgString);
+                }
+            }
+
+            if (defaultTargetModule == null) {
+                throw new FilerException("No module specified and the location is either " +
+                                         "a module-oriented location, or a multi-module " +
+                                         "output location.");
+            }
+
+            module = defaultTargetModule;
+            pkg = moduleAndPkgString;
+        } else {
+            //module name specified:
+            module = moduleAndPkgString.substring(0, slash);
+            pkg = moduleAndPkgString.substring(slash + 1);
+        }
+
+        if (multiModuleLocation) {
+            ModuleSymbol explicitModule = syms.getModule(names.fromString(module));
+
+            if (explicitModule == null) {
+                throw new FilerException("Module: " + module + " does not exist.");
+            }
+
+            if (write && !modules.isRootModule(explicitModule)) {
+                throw new FilerException("Cannot write to the given module.");
+            }
+
+            Location moduleLoc = fileManager.getLocationForModule(location, module);
+
+            return new Tuple3<>(moduleLoc, explicitModule, pkg);
+        } else {
+            throw new FilerException("Module specified but the location is neither " +
+                                     "a module-oriented location, nor a multi-module " +
+                                     "output location.");
+        }
+    }
+
+    static final class Tuple3<A, B, C> {
+        final A a;
+        final B b;
+        final C c;
+
+        public Tuple3(A a, B b, C c) {
+            this.a = a;
+            this.b = b;
+            this.c = c;
+        }
+    }
+
+    private ModuleSymbol inferModule(String pkg) {
+        if (modules.getDefaultModule() == syms.noModule)
+            return modules.getDefaultModule();
+
+        Set<ModuleSymbol> rootModules = modules.getRootModules();
+
+        if (rootModules.size() == 1) {
+            return rootModules.iterator().next();
+        }
+
+        PackageSymbol pack = elementUtils.getPackageElement(pkg);
+
+        if (pack != null && pack.modle != syms.unnamedModule) {
+            return pack.modle;
+        }
+
+        return null;
+    }
+
     private void checkName(String name) throws FilerException {
         checkName(name, false);
     }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java
index 4a2ecb0..3da5a54 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java
@@ -1059,8 +1059,10 @@
             roots = prev.roots.appendList(parsedFiles);
 
             // Check for errors after parsing
-            if (unrecoverableError())
+            if (unrecoverableError()) {
+                compiler.initModules(List.nil());
                 return;
+            }
 
             roots = compiler.initModules(roots);
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java
index f165b75..afedf3e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java
@@ -323,72 +323,77 @@
 
         private void printDirective(ModuleElement.Directive directive) {
             indent();
-            switch (directive.getKind()) {
-            case EXPORTS: // "exports package-name [to module-name-list]"
-                {
-                    ExportsDirective exportsDirective = (ExportsDirective) directive;
-                    writer.print("exports ");
-                    writer.print(exportsDirective.getPackage().getQualifiedName());
-                    printModuleList(exportsDirective.getTargetModules());
-                }
-                break;
-
-            case OPENS: // opens package-name [to module-name-list]
-                {
-                    OpensDirective opensDirective = (OpensDirective) directive;
-                    writer.print("opens ");
-                    writer.print(opensDirective.getPackage().getQualifiedName());
-                    printModuleList(opensDirective.getTargetModules());
-                }
-                break;
-
-            case PROVIDES: // provides service-name with implementation-name
-                {
-                    ProvidesDirective providesDirective = (ProvidesDirective) directive;
-                    writer.print("provides ");
-                    writer.print(providesDirective.getService().getQualifiedName());
-                    writer.print(" with ");
-                    printNameableList(providesDirective.getImplementations());
-                }
-                break;
-
-            case REQUIRES: // requires (static|transitive)* module-name
-                {
-                    RequiresDirective requiresDirective = (RequiresDirective) directive;
-                    writer.print("requires ");
-                    if (requiresDirective.isStatic())
-                        writer.print("static ");
-                    if (requiresDirective.isTransitive())
-                        writer.print("transitive ");
-                    writer.print(requiresDirective.getDependency().getQualifiedName());
-                }
-                break;
-
-            case USES: // uses service-name
-                {
-                    UsesDirective usesDirective = (UsesDirective) directive;
-                    writer.print("uses ");
-                    writer.print(usesDirective.getService().getQualifiedName());
-                }
-                break;
-
-            default:
-                throw new UnsupportedOperationException("unknown directive " + directive);
-            }
+            (new PrintDirective(writer)).visit(directive);
             writer.println(";");
         }
 
-        private void printModuleList(List<? extends ModuleElement> modules) {
-            if (modules != null) {
-                writer.print(" to ");
-                printNameableList(modules);
-            }
-        }
+        private static class PrintDirective implements ModuleElement.DirectiveVisitor<Void, Void> {
+            private final PrintWriter writer;
 
-        private void printNameableList(List<? extends QualifiedNameable> nameables) {
+            PrintDirective(PrintWriter writer) {
+                this.writer = writer;
+            }
+
+            @Override @DefinedBy(Api.LANGUAGE_MODEL)
+            public Void visitExports(ExportsDirective d, Void p) {
+                // "exports package-name [to module-name-list]"
+                writer.print("exports ");
+                writer.print(d.getPackage().getQualifiedName());
+                printModuleList(d.getTargetModules());
+                return null;
+            }
+
+            @Override @DefinedBy(Api.LANGUAGE_MODEL)
+            public Void visitOpens(OpensDirective d, Void p) {
+                // opens package-name [to module-name-list]
+                writer.print("opens ");
+                writer.print(d.getPackage().getQualifiedName());
+                printModuleList(d.getTargetModules());
+                return null;
+            }
+
+            @Override @DefinedBy(Api.LANGUAGE_MODEL)
+            public Void visitProvides(ProvidesDirective d, Void p) {
+                // provides service-name with implementation-name
+                writer.print("provides ");
+                writer.print(d.getService().getQualifiedName());
+                writer.print(" with ");
+                printNameableList(d.getImplementations());
+                return null;
+            }
+
+            @Override @DefinedBy(Api.LANGUAGE_MODEL)
+            public Void visitRequires(RequiresDirective d, Void p) {
+                // requires (static|transitive)* module-name
+                writer.print("requires ");
+                if (d.isStatic())
+                    writer.print("static ");
+                if (d.isTransitive())
+                    writer.print("transitive ");
+                writer.print(d.getDependency().getQualifiedName());
+                return null;
+            }
+
+            @Override @DefinedBy(Api.LANGUAGE_MODEL)
+            public Void visitUses(UsesDirective d, Void p) {
+                // uses service-name
+                writer.print("uses ");
+                writer.print(d.getService().getQualifiedName());
+                return null;
+            }
+
+            private void printModuleList(List<? extends ModuleElement> modules) {
+                if (modules != null) {
+                    writer.print(" to ");
+                    printNameableList(modules);
+                }
+            }
+
+            private void printNameableList(List<? extends QualifiedNameable> nameables) {
                 writer.print(nameables.stream().
                              map(QualifiedNameable::getQualifiedName).
                              collect(Collectors.joining(", ")));
+            }
         }
 
         public void flush() {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
index 4824305..08484b1 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -915,6 +915,10 @@
     {0} is not public in {1}; cannot be accessed from outside package
 
 # 0: symbol, 1: symbol
+compiler.err.not.def.public=\
+    {0} is not public in {1}
+
+# 0: symbol, 1: symbol
 compiler.misc.not.def.public.cant.access=\
     {0} is not public in {1}; cannot be accessed from outside package
 
@@ -1246,9 +1250,9 @@
 
 # In the following string, {0} is the name of the class in the Java source.
 # It really should be used two times..
-# 0: name
+# 0: kind name, 1: name
 compiler.err.class.public.should.be.in.file=\
-    class {0} is public, should be declared in a file named {0}.java
+    {0} {1} is public, should be declared in a file named {1}.java
 
 ## All errors which do not refer to a particular line in the source code are
 ## preceded by this string.
@@ -1292,7 +1296,7 @@
 compiler.warn.outdir.is.in.exploded.module=\
     the output directory is within an exploded module: {0}
 
-# 0: path
+# 0: file object
 compiler.err.locn.module-info.not.allowed.on.patch.path=\
     module-info.class not allowed on patch path: {0}
 
@@ -1438,7 +1442,7 @@
 
 # 0: string, 1: string, 2: string
 compiler.note.multiple.elements=\
-    Multiple elements named '{1}' in modules '{2}' were found by javax.lang.model.util.Elements.{0}.
+    Multiple elements named ''{1}'' in modules ''{2}'' were found by javax.lang.model.util.Elements.{0}.
 
 #####
 
@@ -1533,7 +1537,7 @@
 
 # 0: name
 compiler.warn.poor.choice.for.module.name=\
-    module name {0} should avoid terminal digits
+    module name component {0} should avoid terminal digits
 
 # 0: string
 compiler.warn.incubating.modules=\
@@ -1660,6 +1664,12 @@
 compiler.warn.future.attr=\
     {0} attribute introduced in version {1}.{2} class files is ignored in version {3}.{4} class files
 
+compiler.warn.requires.automatic=\
+    requires directive for an automatic module
+
+compiler.warn.requires.transitive.automatic=\
+    requires transitive directive for an automatic module
+
 # Warnings related to annotation processing
 # 0: string
 compiler.warn.proc.package.does.not.exist=\
@@ -2957,14 +2967,14 @@
 compiler.err.module.decl.sb.in.module-info.java=\
     module declarations should be in a file named module-info.java
 
-compiler.err.module-info.with.xmodule.sourcepath=\
-    illegal combination of -Xmodule and module-info on sourcepath
+# 0: set of string
+compiler.err.too.many.patched.modules=\
+    too many patched modules ({0}), use --module-source-path
 
-compiler.err.module-info.with.xmodule.classpath=\
-    illegal combination of -Xmodule and module-info on classpath
-
-compiler.err.xmodule.no.module.sourcepath=\
-    illegal combination of -Xmodule and --module-source-path
+# 0: name, 1: name
+compiler.err.file.patched.and.msp=\
+    file accessible from both --patch-module and --module-source-path, \
+    but belongs to a different module on each path: {0}, {1}
 
 compiler.err.processorpath.no.processormodulepath=\
     illegal combination of -processorpath and --processor-module-path
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties
index 1f5663d..338cf87 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -593,14 +593,66 @@
 
 compiler.err.not.annotation.type={0}\u306F\u6CE8\u91C8\u578B\u3067\u306F\u3042\u308A\u307E\u305B\u3093
 
+# 0: symbol, 1: symbol, 2: message segment
+compiler.err.not.def.access.package.cant.access={0} \u306F\u8868\u793A\u4E0D\u53EF\u3067\u3059\n({2})
+
+# 0: symbol, 1: symbol, 2: message segment
+compiler.misc.not.def.access.package.cant.access={0} \u306F\u8868\u793A\u4E0D\u53EF\u3067\u3059\n({2})
+
+# 0: symbol, 1: message segment
+compiler.err.package.not.visible=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u8868\u793A\u4E0D\u53EF\u3067\u3059\n({1})
+
+# 0: symbol, 1: message segment
+compiler.misc.package.not.visible=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u8868\u793A\u4E0D\u53EF\u3067\u3059\n({1})
+
+# {0} - current module
+# {1} - package in which the invisible class is declared
+# {2} - module in which {1} is declared
+# 0: symbol, 1: symbol, 2: symbol
+compiler.misc.not.def.access.does.not.read=\u30D1\u30C3\u30B1\u30FC\u30B8{1}\u306F\u30E2\u30B8\u30E5\u30FC\u30EB{2}\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306B\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
 # 0: symbol, 1: symbol
-compiler.err.not.def.access.package.cant.access=\u30D1\u30C3\u30B1\u30FC\u30B8{1}\u304C\u53EF\u8996\u3067\u306F\u306A\u3044\u305F\u3081\u3001{0}\u306F\u53EF\u8996\u3067\u306F\u3042\u308A\u307E\u305B\u3093
+compiler.misc.not.def.access.does.not.read.from.unnamed=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u30E2\u30B8\u30E5\u30FC\u30EB{1}\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B0\u30E9\u30D5\u306B\u3042\u308A\u307E\u305B\u3093
+
+# {0} - package in which the invisible class is declared
+# {1} - current module
+# 0: symbol, 1: symbol
+compiler.misc.not.def.access.does.not.read.unnamed=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306B\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
+# 0: symbol, 1: symbol
+compiler.misc.not.def.access.not.exported=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u30E2\u30B8\u30E5\u30FC\u30EB{1}\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
+# 0: symbol, 1: symbol
+compiler.misc.not.def.access.not.exported.from.unnamed=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u30E2\u30B8\u30E5\u30FC\u30EB{1}\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
+# {2} - current module
+# 0: symbol, 1: symbol, 2: symbol
+compiler.misc.not.def.access.not.exported.to.module=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u30E2\u30B8\u30E5\u30FC\u30EB{1}\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u30E2\u30B8\u30E5\u30FC\u30EB{2}\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
+# 0: symbol, 1: symbol
+compiler.misc.not.def.access.not.exported.to.module.from.unnamed=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u30E2\u30B8\u30E5\u30FC\u30EB{1}\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 
 # 0: symbol, 1: symbol
-compiler.err.not.def.access.class.intf.cant.access={1}\u306E{0}\u304C\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
+compiler.err.not.def.access.class.intf.cant.access={1}.{0}\u306F\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
 
 # 0: symbol, 1: symbol
-compiler.misc.not.def.access.class.intf.cant.access={1}\u306E{0}\u304C\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
+compiler.misc.not.def.access.class.intf.cant.access={1}.{0}\u306F\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
+
+# 0: symbol, 1: symbol, 2: symbol, 3: message segment
+compiler.err.not.def.access.class.intf.cant.access.reason=\u30D1\u30C3\u30B1\u30FC\u30B8{2}\u306E{1}.{0}\u306B\u306F\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n({3})
+
+# 0: symbol, 1: symbol, 2: symbol, 3: message segment
+compiler.misc.not.def.access.class.intf.cant.access.reason=\u30D1\u30C3\u30B1\u30FC\u30B8{2}\u306E{1}.{0}\u306B\u306F\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n({3})
 
 # 0: symbol, 1: list of type, 2: type
 compiler.misc.cant.access.inner.cls.constr=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF{0}({1})\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n\u5185\u90E8\u30AF\u30E9\u30B9\u3092\u56F2\u3080\u578B{2}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u30B9\u30B3\u30FC\u30D7\u5185\u306B\u3042\u308A\u307E\u305B\u3093
@@ -627,6 +679,8 @@
 
 compiler.err.pkg.annotations.sb.in.package-info.java=\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u6CE8\u91C8\u306F\u30D5\u30A1\u30A4\u30EBpackage-info.java\u5185\u306B\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 
+compiler.err.no.pkg.in.module-info.java=package\u53E5\u304C\u30D5\u30A1\u30A4\u30EBmodule-info.java\u306B\u3042\u3063\u3066\u306F\u306A\u308A\u307E\u305B\u3093
+
 # 0: symbol
 compiler.err.pkg.clashes.with.class.of.same.name=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u540C\u540D\u306E\u30AF\u30E9\u30B9\u3068\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059
 
@@ -1048,6 +1102,9 @@
 
 compiler.warn.finally.cannot.complete=finally\u7BC0\u304C\u6B63\u5E38\u306B\u5B8C\u4E86\u3067\u304D\u307E\u305B\u3093
 
+# 0: name
+compiler.warn.poor.choice.for.module.name=\u30E2\u30B8\u30E5\u30FC\u30EB\u540D{0}\u306E\u672B\u5C3E\u306F\u6570\u5B57\u306B\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044
+
 # 0: symbol, 1: symbol
 compiler.warn.has.been.deprecated={1}\u306E{0}\u306F\u63A8\u5968\u3055\u308C\u307E\u305B\u3093
 
@@ -1055,6 +1112,12 @@
 compiler.warn.has.been.deprecated.for.removal={1}\u306E{0}\u306F\u63A8\u5968\u3055\u308C\u3066\u304A\u3089\u305A\u3001\u524A\u9664\u7528\u306B\u30DE\u30FC\u30AF\u3055\u308C\u3066\u3044\u307E\u3059
 
 # 0: symbol
+compiler.warn.has.been.deprecated.module=\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306F\u63A8\u5968\u3055\u308C\u307E\u305B\u3093
+
+# 0: symbol
+compiler.warn.has.been.deprecated.for.removal.module=\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306F\u63A8\u5968\u3055\u308C\u3066\u304A\u3089\u305A\u3001\u524A\u9664\u7528\u306B\u30DE\u30FC\u30AF\u3055\u308C\u3066\u3044\u307E\u3059
+
+# 0: symbol
 compiler.warn.sun.proprietary={0}\u306F\u5185\u90E8\u6240\u6709\u306EAPI\u3067\u3042\u308A\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059
 
 compiler.warn.illegal.char.for.encoding=\u3053\u306E\u6587\u5B57\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306B\u30DE\u30C3\u30D7\u3067\u304D\u307E\u305B\u3093
@@ -1210,6 +1273,8 @@
 # 0: symbol kind
 compiler.warn.deprecated.annotation.has.no.effect=@Deprecated\u6CE8\u91C8\u306F\u3001\u3053\u306E{0}\u5BA3\u8A00\u306B\u306F\u5F71\u97FF\u3057\u307E\u305B\u3093
 
+compiler.warn.invalid.path=\u30D5\u30A1\u30A4\u30EB\u540D\u304C\u7121\u52B9\u3067\u3059: {0}
+
 compiler.warn.invalid.archive.file=\u30D1\u30B9\u4E0A\u306E\u4E88\u671F\u3057\u306A\u3044\u30D5\u30A1\u30A4\u30EB: {0}
 
 compiler.warn.unexpected.archive.file=\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u4E88\u671F\u3057\u306A\u3044\u62E1\u5F35\u5B50: {0}
@@ -1293,6 +1358,8 @@
 compiler.err.premature.eof=\u69CB\u6587\u89E3\u6790\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u306E\u7D42\u308F\u308A\u306B\u79FB\u308A\u307E\u3057\u305F
 
 ## The following are related in form, but do not easily fit the above paradigm.
+compiler.err.expected.module=''\u30E2\u30B8\u30E5\u30FC\u30EB''\u304C\u5FC5\u8981\u3067\u3059
+
 compiler.err.dot.class.expected=''.class''\u304C\u3042\u308A\u307E\u305B\u3093
 
 ## The argument to this string will always be either 'case' or 'default'.
@@ -1358,6 +1425,12 @@
 
 compiler.misc.class.file.not.found={0}\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 
+# 0: string (constant value), 1: symbol (constant field), 2: type (field type)
+compiler.misc.bad.constant.range={1}\u306E\u5B9A\u6570\u5024''{0}''\u306F{2}\u306E\u60F3\u5B9A\u7BC4\u56F2\u5916\u3067\u3059
+
+# 0: string (constant value), 1: symbol (constant field), 2: string (expected class)
+compiler.misc.bad.constant.value={1}\u306E\u5B9A\u6570\u5024''{0}''\u306F\u4E0D\u6B63\u3067\u3059\u3002{2}\u304C\u5FC5\u8981\u3067\u3059
+
 # 0: string (classfile major version), 1: string (classfile minor version)
 compiler.misc.invalid.default.interface=\u30D0\u30FC\u30B8\u30E7\u30F3{0}.{1}\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F
 
@@ -1518,6 +1591,9 @@
 
 compiler.misc.arg.length.mismatch=\u5B9F\u5F15\u6570\u30EA\u30B9\u30C8\u3068\u4EEE\u5F15\u6570\u30EA\u30B9\u30C8\u306E\u9577\u3055\u304C\u7570\u306A\u308A\u307E\u3059
 
+# 0: string
+compiler.misc.wrong.number.type.args=\u578B\u5F15\u6570\u306E\u6570\u304C\u4E0D\u6B63\u3067\u3059\u3002{0}\u500B\u5FC5\u8981\u3067\u3059
+
 # 0: message segment
 compiler.misc.no.conforming.assignment.exists=\u5F15\u6570\u306E\u4E0D\u4E00\u81F4: {0}
 
@@ -1785,7 +1861,7 @@
 compiler.err.default.methods.not.supported.in.source=\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
 
 # 0: string
-compiler.err.intersection.types.in.cast.not.supported.in.source=\u30AD\u30E3\u30B9\u30C8\u5185\u306Eintersection\u578B\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
+compiler.err.intersection.types.in.cast.not.supported.in.source=\u30AD\u30E3\u30B9\u30C8\u5185\u306Eintersection\u578B\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30AD\u30E3\u30B9\u30C8\u5185\u306Eintersection\u578B\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
 
 # 0: string
 compiler.err.static.intf.methods.not.supported.in.source=static\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(static\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 8\u4EE5\u4E0A\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
@@ -1932,6 +2008,9 @@
 # 0: symbol
 compiler.err.module.not.found=\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 
+# 0: symbol
+compiler.warn.module.not.found=\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
+
 compiler.err.too.many.modules=\u691C\u51FA\u3055\u308C\u305F\u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u304C\u591A\u3059\u304E\u307E\u3059
 
 # 0: symbol
@@ -1941,7 +2020,18 @@
 compiler.err.duplicate.requires=\u5FC5\u9808\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: {0}
 
 # 0: symbol
-compiler.err.duplicate.exports=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: {0}
+compiler.err.conflicting.exports=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u304C\u91CD\u8907\u307E\u305F\u306F\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059: {0}
+
+# 0: symbol
+compiler.err.conflicting.opens=\u30AA\u30FC\u30D7\u30F3\u304C\u91CD\u8907\u307E\u305F\u306F\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059: {0}
+
+# 0: symbol
+compiler.err.conflicting.exports.to.module=\u30E2\u30B8\u30E5\u30FC\u30EB\u3078\u306E\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u304C\u91CD\u8907\u307E\u305F\u306F\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059: {0}
+
+# 0: symbol
+compiler.err.conflicting.opens.to.module=\u30E2\u30B8\u30E5\u30FC\u30EB\u3078\u306E\u30AA\u30FC\u30D7\u30F3\u304C\u91CD\u8907\u307E\u305F\u306F\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059: {0}
+
+compiler.err.no.opens.unless.strong=''opens''\u306F\u5F37\u56FA\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u306E\u307F\u8A31\u53EF\u3055\u308C\u307E\u3059
 
 # 0: symbol, 1: symbol
 compiler.err.duplicate.provides=\u6307\u5B9A\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: \u30B5\u30FC\u30D3\u30B9{0}\u3001\u5B9F\u88C5{1}
@@ -1952,15 +2042,14 @@
 # 0: symbol
 compiler.err.service.implementation.is.abstract=\u30B5\u30FC\u30D3\u30B9\u5B9F\u88C5\u304C\u62BD\u8C61\u30AF\u30E9\u30B9\u3067\u3059: {0}
 
-compiler.err.service.implementation.must.be.subtype.of.service.interface=\u30B5\u30FC\u30D3\u30B9\u5B9F\u88C5\u30BF\u30A4\u30D7\u306F\u3001\u30B5\u30FC\u30D3\u30B9\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u30B5\u30D6\u30BF\u30A4\u30D7\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
+compiler.err.service.implementation.must.be.subtype.of.service.interface=\u30B5\u30FC\u30D3\u30B9\u5B9F\u88C5\u30BF\u30A4\u30D7\u306F\u3001\u30B5\u30FC\u30D3\u30B9\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u30B5\u30D6\u30BF\u30A4\u30D7\u3067\u3042\u308B\u304B\u3001\u30B5\u30FC\u30D3\u30B9\u5B9F\u88C5\u3092\u623B\u3057\u3001\u5F15\u6570\u3092\u6301\u305F\u306A\u3044\u3001"provider"\u3068\u3044\u3046\u540D\u524D\u306Epublic static\u30E1\u30BD\u30C3\u30C9\u3092\u6301\u3064\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
+
+compiler.err.service.implementation.provider.return.must.be.subtype.of.service.interface="provider"\u30E1\u30BD\u30C3\u30C9\u306E\u623B\u308A\u30BF\u30A4\u30D7\u306F\u3001\u30B5\u30FC\u30D3\u30B9\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306E\u30B5\u30D6\u30BF\u30A4\u30D7\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 
 # 0: symbol
 compiler.err.service.implementation.is.inner=\u30B5\u30FC\u30D3\u30B9\u5B9F\u88C5\u304C\u5185\u90E8\u30AF\u30E9\u30B9\u3067\u3059: {0}
 
 # 0: symbol
-compiler.err.service.definition.is.inner=\u30B5\u30FC\u30D3\u30B9\u5B9A\u7FA9\u304C\u5185\u90E8\u30AF\u30E9\u30B9\u3067\u3059: {0}
-
-# 0: symbol
 compiler.err.service.definition.is.enum=\u30B5\u30FC\u30D3\u30B9\u5B9A\u7FA9\u304C\u5217\u6319\u578B\u3067\u3059: {0}
 
 # 0: symbol
@@ -1982,6 +2071,12 @@
 # 0: name, 1: name
 compiler.misc.module.name.mismatch=\u30E2\u30B8\u30E5\u30FC\u30EB\u540D{0}\u306F\u5FC5\u8981\u306A\u540D\u524D{1}\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093
 
+# 0: name
+compiler.err.module.non.zero.opens=\u30AA\u30FC\u30D7\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306F\u30BC\u30ED\u3067\u306A\u3044opens_count\u3092\u6301\u3061\u307E\u3059
+
+# 0: name
+compiler.misc.module.non.zero.opens=\u30AA\u30FC\u30D7\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB{0}\u306F\u30BC\u30ED\u3067\u306A\u3044opens_count\u3092\u6301\u3061\u307E\u3059
+
 compiler.err.module.decl.sb.in.module-info.java=\u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306Fmodule-info.java\u3068\u3044\u3046\u540D\u524D\u306E\u30D5\u30A1\u30A4\u30EB\u306B\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 
 compiler.err.module-info.with.xmodule.sourcepath=\u30BD\u30FC\u30B9\u30D1\u30B9\u306E-Xmodule\u3068module-info\u306E\u7D44\u5408\u305B\u304C\u4E0D\u6B63\u3067\u3059
@@ -2014,20 +2109,19 @@
 # 0: fragment, 1: name
 compiler.err.duplicate.module.on.path={0}\u3067\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\n{1}\u306E\u30E2\u30B8\u30E5\u30FC\u30EB
 
-# 0:  string
-compiler.err.xaddexports.malformed.entry=--add-exports {0}\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059
+# 0: option name, 1: string
+compiler.warn.bad.name.for.option={0}\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5024\u306B\u542B\u307E\u308C\u308B\u540D\u524D\u304C\u4E0D\u6B63\u3067\u3059: ''{1}''
 
-# 0: string
-compiler.err.xaddexports.too.many={0}\u306E--add-exports\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8907\u6570\u3042\u308A\u307E\u3059
+# 0: option name, 1: string
+compiler.err.bad.name.for.option={0}\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5024\u306B\u542B\u307E\u308C\u308B\u540D\u524D\u304C\u4E0D\u6B63\u3067\u3059: ''{1}''
 
-# 0:  string
-compiler.err.xaddreads.malformed.entry=--add-reads {0}\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059
-
-# 0: string
-compiler.err.xaddreads.too.many={0}\u306E--add-reads\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8907\u6570\u3042\u308A\u307E\u3059
+# 0: option name, 1: symbol
+compiler.warn.module.for.option.not.found={0}\u30AA\u30D7\u30B7\u30E7\u30F3\u5185\u306B\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {1}
 
 compiler.err.addmods.all.module.path.invalid=--add-modules ALL-MODULE-PATH\u306F\u3001\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u6642\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059
 
+compiler.warn.addopens.ignored=--add-opens\u306F\u3001\u30B3\u30F3\u30D1\u30A4\u30EB\u6642\u306B\u306F\u7121\u52B9\u3067\u3059
+
 compiler.misc.locn.module_source_path=\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30BD\u30FC\u30B9\u30FB\u30D1\u30B9
 
 compiler.misc.locn.upgrade_module_path=\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9
@@ -2038,9 +2132,6 @@
 
 compiler.misc.cant.resolve.modules=\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093
 
-# 0: symbol
-compiler.err.cant.find.module=\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
-
 # 0: string
 compiler.err.invalid.module.specifier=\u30E2\u30B8\u30E5\u30FC\u30EB\u6307\u5B9A\u5B50\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093: {0}
 
@@ -2052,7 +2143,7 @@
 # 0: kind name, 1: symbol, 2: symbol
 compiler.warn.leaks.not.accessible.unexported=\u30E2\u30B8\u30E5\u30FC\u30EB{2}\u306E{0} {1}\u306F\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093
 # 0: kind name, 1: symbol, 2: symbol
-compiler.warn.leaks.not.accessible.not.required.public=\u30E2\u30B8\u30E5\u30FC\u30EB{2}\u306E{0} {1}\u306F\u3001''requires public''\u3092\u4F7F\u7528\u3057\u3066\u9593\u63A5\u7684\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093
+compiler.warn.leaks.not.accessible.not.required.transitive=\u30E2\u30B8\u30E5\u30FC\u30EB{2}\u306E{0} {1}\u306F\u3001''requires transitive''\u3092\u4F7F\u7528\u3057\u3066\u9593\u63A5\u7684\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093
 # 0: kind name, 1: symbol, 2: symbol
 compiler.warn.leaks.not.accessible.unexported.qualified=\u30E2\u30B8\u30E5\u30FC\u30EB{2}\u306E{0} {1}\u306F\u3001\u3053\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u5FC5\u8981\u3068\u3059\u308B\u3059\u3079\u3066\u306E\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u306B\u8868\u793A\u3055\u308C\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties
index 91e8584..0eabd0f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -593,14 +593,66 @@
 
 compiler.err.not.annotation.type={0}\u4E0D\u662F\u6CE8\u91CA\u7C7B\u578B
 
+# 0: symbol, 1: symbol, 2: message segment
+compiler.err.not.def.access.package.cant.access={0} \u4E0D\u53EF\u89C1\n({2})
+
+# 0: symbol, 1: symbol, 2: message segment
+compiler.misc.not.def.access.package.cant.access={0} \u4E0D\u53EF\u89C1\n({2})
+
+# 0: symbol, 1: message segment
+compiler.err.package.not.visible=\u7A0B\u5E8F\u5305 {0} \u4E0D\u53EF\u89C1\n({1})
+
+# 0: symbol, 1: message segment
+compiler.misc.package.not.visible=\u7A0B\u5E8F\u5305 {0} \u4E0D\u53EF\u89C1\n({1})
+
+# {0} - current module
+# {1} - package in which the invisible class is declared
+# {2} - module in which {1} is declared
+# 0: symbol, 1: symbol, 2: symbol
+compiler.misc.not.def.access.does.not.read=\u7A0B\u5E8F\u5305 {1} \u5DF2\u5728\u6A21\u5757 {2} \u4E2D\u58F0\u660E, \u4F46\u6A21\u5757 {0} \u672A\u8BFB\u53D6\u5B83
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
 # 0: symbol, 1: symbol
-compiler.err.not.def.access.package.cant.access=\u7531\u4E8E\u7A0B\u5E8F\u5305 {1} \u4E0D\u53EF\u89C1, \u56E0\u6B64 {0} \u4E0D\u53EF\u89C1
+compiler.misc.not.def.access.does.not.read.from.unnamed=\u7A0B\u5E8F\u5305 {0} \u5DF2\u5728\u6A21\u5757 {1} \u4E2D\u58F0\u660E, \u4F46\u8BE5\u6A21\u5757\u4E0D\u5728\u6A21\u5757\u56FE\u4E2D
+
+# {0} - package in which the invisible class is declared
+# {1} - current module
+# 0: symbol, 1: symbol
+compiler.misc.not.def.access.does.not.read.unnamed=\u7A0B\u5E8F\u5305 {0} \u5DF2\u5728\u672A\u547D\u540D\u6A21\u5757\u4E2D\u58F0\u660E, \u4F46\u6A21\u5757 {0} \u672A\u8BFB\u53D6\u5B83
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
+# 0: symbol, 1: symbol
+compiler.misc.not.def.access.not.exported=\u7A0B\u5E8F\u5305 {0} \u5DF2\u5728\u6A21\u5757 {1} \u4E2D\u58F0\u660E, \u4F46\u8BE5\u6A21\u5757\u672A\u5BFC\u51FA\u5B83
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
+# 0: symbol, 1: symbol
+compiler.misc.not.def.access.not.exported.from.unnamed=\u7A0B\u5E8F\u5305 {0} \u5DF2\u5728\u6A21\u5757 {1} \u4E2D\u58F0\u660E, \u4F46\u8BE5\u6A21\u5757\u672A\u5BFC\u51FA\u5B83
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
+# {2} - current module
+# 0: symbol, 1: symbol, 2: symbol
+compiler.misc.not.def.access.not.exported.to.module=\u7A0B\u5E8F\u5305 {0} \u5DF2\u5728\u6A21\u5757 {1} \u4E2D\u58F0\u660E, \u4F46\u8BE5\u6A21\u5757\u672A\u5C06\u5B83\u5BFC\u51FA\u5230\u6A21\u5757 {2}
+
+# {0} - package in which the invisible class is declared
+# {1} - module in which {0} is declared
+# 0: symbol, 1: symbol
+compiler.misc.not.def.access.not.exported.to.module.from.unnamed=\u7A0B\u5E8F\u5305 {0} \u5DF2\u5728\u6A21\u5757 {1} \u4E2D\u58F0\u660E, \u4F46\u8BE5\u6A21\u5757\u672A\u5C06\u5B83\u5BFC\u51FA\u5230\u672A\u547D\u540D\u6A21\u5757
 
 # 0: symbol, 1: symbol
-compiler.err.not.def.access.class.intf.cant.access={1}\u4E2D\u7684{0}\u662F\u5728\u4E0D\u53EF\u8BBF\u95EE\u7684\u7C7B\u6216\u63A5\u53E3\u4E2D\u5B9A\u4E49\u7684
+compiler.err.not.def.access.class.intf.cant.access={1}.{0} \u662F\u5728\u4E0D\u53EF\u8BBF\u95EE\u7684\u7C7B\u6216\u63A5\u53E3\u4E2D\u5B9A\u4E49\u7684
 
 # 0: symbol, 1: symbol
-compiler.misc.not.def.access.class.intf.cant.access={1}\u4E2D\u7684{0}\u662F\u5728\u4E0D\u53EF\u8BBF\u95EE\u7684\u7C7B\u6216\u63A5\u53E3\u4E2D\u5B9A\u4E49\u7684
+compiler.misc.not.def.access.class.intf.cant.access={1}.{0} \u662F\u5728\u4E0D\u53EF\u8BBF\u95EE\u7684\u7C7B\u6216\u63A5\u53E3\u4E2D\u5B9A\u4E49\u7684
+
+# 0: symbol, 1: symbol, 2: symbol, 3: message segment
+compiler.err.not.def.access.class.intf.cant.access.reason=\u7A0B\u5E8F\u5305 {2} \u4E2D\u7684 {1}.{0} \u4E0D\u53EF\u8BBF\u95EE\n({3})
+
+# 0: symbol, 1: symbol, 2: symbol, 3: message segment
+compiler.misc.not.def.access.class.intf.cant.access.reason=\u7A0B\u5E8F\u5305 {2} \u4E2D\u7684 {1}.{0} \u4E0D\u53EF\u8BBF\u95EE\n({3})
 
 # 0: symbol, 1: list of type, 2: type
 compiler.misc.cant.access.inner.cls.constr=\u65E0\u6CD5\u8BBF\u95EE\u6784\u9020\u5668 {0}({1})\n\u4F5C\u7528\u57DF\u4E2D\u6CA1\u6709\u7C7B\u578B\u4E3A{2}\u7684\u5C01\u95ED\u5B9E\u4F8B
@@ -627,6 +679,8 @@
 
 compiler.err.pkg.annotations.sb.in.package-info.java=\u7A0B\u5E8F\u5305\u6CE8\u91CA\u5E94\u5728\u6587\u4EF6 package-info.java \u4E2D
 
+compiler.err.no.pkg.in.module-info.java=\u7A0B\u5E8F\u5305\u5B50\u53E5\u4E0D\u5E94\u5728\u6587\u4EF6 module-info.java \u4E2D
+
 # 0: symbol
 compiler.err.pkg.clashes.with.class.of.same.name=\u7A0B\u5E8F\u5305{0}\u4E0E\u5E26\u6709\u76F8\u540C\u540D\u79F0\u7684\u7C7B\u51B2\u7A81
 
@@ -1048,6 +1102,9 @@
 
 compiler.warn.finally.cannot.complete=finally \u5B50\u53E5\u65E0\u6CD5\u6B63\u5E38\u5B8C\u6210
 
+# 0: name
+compiler.warn.poor.choice.for.module.name=\u6A21\u5757\u540D\u79F0 {0} \u5E94\u907F\u514D\u4EE5\u6570\u5B57\u7ED3\u5C3E
+
 # 0: symbol, 1: symbol
 compiler.warn.has.been.deprecated={1}\u4E2D\u7684{0}\u5DF2\u8FC7\u65F6
 
@@ -1055,6 +1112,12 @@
 compiler.warn.has.been.deprecated.for.removal={1} \u4E2D\u7684 {0} \u5DF2\u8FC7\u65F6, \u4E14\u6807\u8BB0\u4E3A\u5F85\u5220\u9664
 
 # 0: symbol
+compiler.warn.has.been.deprecated.module=\u6A21\u5757 {0} \u5DF2\u8FC7\u65F6
+
+# 0: symbol
+compiler.warn.has.been.deprecated.for.removal.module=\u6A21\u5757 {0} \u5DF2\u8FC7\u65F6, \u4E14\u6807\u8BB0\u4E3A\u5F85\u5220\u9664
+
+# 0: symbol
 compiler.warn.sun.proprietary={0}\u662F\u5185\u90E8\u4E13\u7528 API, \u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664
 
 compiler.warn.illegal.char.for.encoding=\u7F16\u7801{0}\u7684\u4E0D\u53EF\u6620\u5C04\u5B57\u7B26
@@ -1210,6 +1273,8 @@
 # 0: symbol kind
 compiler.warn.deprecated.annotation.has.no.effect=@Deprecated \u6CE8\u91CA\u5BF9\u6B64 {0} \u58F0\u660E\u6CA1\u6709\u4EFB\u4F55\u6548\u679C
 
+compiler.warn.invalid.path=\u65E0\u6548\u6587\u4EF6\u540D: {0}
+
 compiler.warn.invalid.archive.file=\u4EE5\u4E0B\u8DEF\u5F84\u4E2D\u5B58\u5728\u610F\u5916\u7684\u6587\u4EF6: {0}
 
 compiler.warn.unexpected.archive.file=\u4EE5\u4E0B\u6863\u6848\u6587\u4EF6\u5B58\u5728\u610F\u5916\u7684\u6269\u5C55\u540D: {0}
@@ -1293,6 +1358,8 @@
 compiler.err.premature.eof=\u8FDB\u884C\u89E3\u6790\u65F6\u5DF2\u5230\u8FBE\u6587\u4EF6\u7ED3\u5C3E
 
 ## The following are related in form, but do not easily fit the above paradigm.
+compiler.err.expected.module=\u9700\u8981 ''module''
+
 compiler.err.dot.class.expected=\u9700\u8981 ''.class''
 
 ## The argument to this string will always be either 'case' or 'default'.
@@ -1358,6 +1425,12 @@
 
 compiler.misc.class.file.not.found=\u627E\u4E0D\u5230{0}\u7684\u7C7B\u6587\u4EF6
 
+# 0: string (constant value), 1: symbol (constant field), 2: type (field type)
+compiler.misc.bad.constant.range={1} \u7684\u5E38\u91CF\u503C ''{0}'' \u8D85\u51FA\u4E86 {2} \u7684\u9884\u671F\u8303\u56F4
+
+# 0: string (constant value), 1: symbol (constant field), 2: string (expected class)
+compiler.misc.bad.constant.value={1} \u7684\u5E38\u91CF\u503C ''{0}'' \u9519\u8BEF, \u9884\u671F\u4E3A {2}
+
 # 0: string (classfile major version), 1: string (classfile minor version)
 compiler.misc.invalid.default.interface=\u5728 {0}.{1} \u7248\u7C7B\u6587\u4EF6\u4E2D\u627E\u5230\u9ED8\u8BA4\u65B9\u6CD5
 
@@ -1518,6 +1591,9 @@
 
 compiler.misc.arg.length.mismatch=\u5B9E\u9645\u53C2\u6570\u5217\u8868\u548C\u5F62\u5F0F\u53C2\u6570\u5217\u8868\u957F\u5EA6\u4E0D\u540C
 
+# 0: string
+compiler.misc.wrong.number.type.args=\u7C7B\u578B\u53D8\u91CF\u6570\u76EE\u9519\u8BEF; \u9700\u8981{0}
+
 # 0: message segment
 compiler.misc.no.conforming.assignment.exists=\u53C2\u6570\u4E0D\u5339\u914D; {0}
 
@@ -1785,7 +1861,7 @@
 compiler.err.default.methods.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u9ED8\u8BA4\u65B9\u6CD5\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u9ED8\u8BA4\u65B9\u6CD5)
 
 # 0: string
-compiler.err.intersection.types.in.cast.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u8F6C\u6362\u4E2D\u7684\u4EA4\u53C9\u7C7B\u578B\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u9ED8\u8BA4\u65B9\u6CD5)
+compiler.err.intersection.types.in.cast.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u8F6C\u6362\u4E2D\u7684\u4EA4\u53C9\u7C7B\u578B\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u8F6C\u6362\u4E2D\u7684\u4EA4\u53C9\u7C7B\u578B)
 
 # 0: string
 compiler.err.static.intf.methods.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u9759\u6001\u63A5\u53E3\u65B9\u6CD5\n(\u8BF7\u4F7F\u7528 -source 8 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u9759\u6001\u63A5\u53E3\u65B9\u6CD5)
@@ -1932,6 +2008,9 @@
 # 0: symbol
 compiler.err.module.not.found=\u627E\u4E0D\u5230\u6A21\u5757: {0}
 
+# 0: symbol
+compiler.warn.module.not.found=\u627E\u4E0D\u5230\u6A21\u5757: {0}
+
 compiler.err.too.many.modules=\u627E\u5230\u592A\u591A\u7684\u6A21\u5757\u58F0\u660E
 
 # 0: symbol
@@ -1941,7 +2020,18 @@
 compiler.err.duplicate.requires=\u91CD\u590D\u7684 requires \u6307\u4EE4: {0}
 
 # 0: symbol
-compiler.err.duplicate.exports=\u91CD\u590D\u7684 export \u6307\u4EE4: {0}
+compiler.err.conflicting.exports=\u91CD\u590D\u6216\u51B2\u7A81\u7684\u5BFC\u51FA\u64CD\u4F5C: {0}
+
+# 0: symbol
+compiler.err.conflicting.opens=\u91CD\u590D\u6216\u51B2\u7A81\u7684\u6253\u5F00\u64CD\u4F5C: {0}
+
+# 0: symbol
+compiler.err.conflicting.exports.to.module=\u91CD\u590D\u6216\u51B2\u7A81\u7684\u5BFC\u51FA\u5230\u6A21\u5757\u64CD\u4F5C: {0}
+
+# 0: symbol
+compiler.err.conflicting.opens.to.module=\u91CD\u590D\u6216\u51B2\u7A81\u7684\u6253\u5F00\u5230\u6A21\u5757\u64CD\u4F5C: {0}
+
+compiler.err.no.opens.unless.strong=\u53EA\u5141\u8BB8\u5728\u5F3A\u6A21\u5757\u4E2D\u4F7F\u7528 ''opens''
 
 # 0: symbol, 1: symbol
 compiler.err.duplicate.provides=\u91CD\u590D\u7684 provides \u6307\u4EE4: \u670D\u52A1 {0}, \u5B9E\u73B0 {1}
@@ -1952,15 +2042,14 @@
 # 0: symbol
 compiler.err.service.implementation.is.abstract=\u670D\u52A1\u5B9E\u73B0\u662F\u62BD\u8C61\u7C7B: {0}
 
-compiler.err.service.implementation.must.be.subtype.of.service.interface=\u670D\u52A1\u5B9E\u73B0\u7C7B\u578B\u5FC5\u987B\u662F\u670D\u52A1\u63A5\u53E3\u7C7B\u578B\u7684\u5B50\u7C7B\u578B
+compiler.err.service.implementation.must.be.subtype.of.service.interface=\u670D\u52A1\u5B9E\u73B0\u7C7B\u578B\u5FC5\u987B\u662F\u670D\u52A1\u63A5\u53E3\u7C7B\u578B\u7684\u5B50\u7C7B\u578B, \u6216\u8005\u5177\u6709\u540D\u4E3A "provider" \u7684, \u8FD4\u56DE\u670D\u52A1\u5B9E\u73B0\u7684\u516C\u5171\u9759\u6001\u65E0\u53C2\u6570\u65B9\u6CD5
+
+compiler.err.service.implementation.provider.return.must.be.subtype.of.service.interface="provider" \u65B9\u6CD5\u8FD4\u56DE\u7C7B\u578B\u5FC5\u987B\u662F\u670D\u52A1\u63A5\u53E3\u7C7B\u578B\u7684\u5B50\u7C7B\u578B
 
 # 0: symbol
 compiler.err.service.implementation.is.inner=\u670D\u52A1\u5B9E\u73B0\u662F\u5185\u90E8\u7C7B: {0}
 
 # 0: symbol
-compiler.err.service.definition.is.inner=\u670D\u52A1\u5B9A\u4E49\u662F\u5185\u90E8\u7C7B: {0}
-
-# 0: symbol
 compiler.err.service.definition.is.enum=\u670D\u52A1\u5B9A\u4E49\u662F\u679A\u4E3E: {0}
 
 # 0: symbol
@@ -1982,6 +2071,12 @@
 # 0: name, 1: name
 compiler.misc.module.name.mismatch=\u6A21\u5757\u540D\u79F0 {0} \u4E0E\u9884\u671F\u540D\u79F0 {1} \u4E0D\u5339\u914D
 
+# 0: name
+compiler.err.module.non.zero.opens=\u6253\u5F00\u7684\u6A21\u5757 {0} \u5177\u6709\u975E\u96F6 opens_count
+
+# 0: name
+compiler.misc.module.non.zero.opens=\u6253\u5F00\u7684\u6A21\u5757 {0} \u5177\u6709\u975E\u96F6 opens_count
+
 compiler.err.module.decl.sb.in.module-info.java=\u6A21\u5757\u58F0\u660E\u5E94\u8BE5\u5728\u540D\u4E3A module-info.java \u7684\u6587\u4EF6\u4E2D
 
 compiler.err.module-info.with.xmodule.sourcepath=\u6E90\u8DEF\u5F84\u4E0A\u7684 -Xmodule \u4E0E module-info \u7684\u7EC4\u5408\u975E\u6CD5
@@ -2014,20 +2109,19 @@
 # 0: fragment, 1: name
 compiler.err.duplicate.module.on.path={1} \u4E2D\u7684 {0} \u4E0A\u5B58\u5728\n\u91CD\u590D\u7684\u6A21\u5757
 
-# 0:  string
-compiler.err.xaddexports.malformed.entry=--add-exports {0} \u7684\u503C\u9519\u8BEF
+# 0: option name, 1: string
+compiler.warn.bad.name.for.option={0} \u9009\u9879\u7684\u503C\u4E2D\u6709\u9519\u8BEF\u7684\u540D\u79F0: ''{1}''
 
-# 0: string
-compiler.err.xaddexports.too.many={0} \u5B58\u5728\u591A\u4E2A --add-exports \u9009\u9879
+# 0: option name, 1: string
+compiler.err.bad.name.for.option={0} \u9009\u9879\u7684\u503C\u4E2D\u6709\u9519\u8BEF\u7684\u540D\u79F0: ''{1}''
 
-# 0:  string
-compiler.err.xaddreads.malformed.entry=--add-reads {0} \u7684\u503C\u9519\u8BEF
-
-# 0: string
-compiler.err.xaddreads.too.many={0} \u5B58\u5728\u591A\u4E2A --add-reads \u9009\u9879
+# 0: option name, 1: symbol
+compiler.warn.module.for.option.not.found=\u627E\u4E0D\u5230 {0} \u9009\u9879\u4E2D\u7684\u6A21\u5757\u540D\u79F0: {1}
 
 compiler.err.addmods.all.module.path.invalid=--add-modules ALL-MODULE-PATH \u53EA\u80FD\u5728\u7F16\u8BD1\u672A\u547D\u540D\u6A21\u5757\u65F6\u4F7F\u7528
 
+compiler.warn.addopens.ignored=--add-opens \u5728\u7F16\u8BD1\u65F6\u6CA1\u6709\u4EFB\u4F55\u6548\u679C
+
 compiler.misc.locn.module_source_path=\u6A21\u5757\u6E90\u8DEF\u5F84
 
 compiler.misc.locn.upgrade_module_path=\u5347\u7EA7\u6A21\u5757\u8DEF\u5F84
@@ -2038,9 +2132,6 @@
 
 compiler.misc.cant.resolve.modules=\u65E0\u6CD5\u89E3\u6790\u6A21\u5757
 
-# 0: symbol
-compiler.err.cant.find.module=\u627E\u4E0D\u5230\u6A21\u5757: {0}
-
 # 0: string
 compiler.err.invalid.module.specifier=\u4E0D\u5141\u8BB8\u6A21\u5757\u8BF4\u660E\u7B26: {0}
 
@@ -2052,7 +2143,7 @@
 # 0: kind name, 1: symbol, 2: symbol
 compiler.warn.leaks.not.accessible.unexported=\u672A\u5BFC\u51FA\u6A21\u5757 {2} \u4E2D\u7684 {0} {1}
 # 0: kind name, 1: symbol, 2: symbol
-compiler.warn.leaks.not.accessible.not.required.public=\u672A\u4F7F\u7528 ''requires public'' \u95F4\u63A5\u5BFC\u51FA\u6A21\u5757 {2} \u4E2D\u7684 {0} {1}
+compiler.warn.leaks.not.accessible.not.required.transitive=\u672A\u4F7F\u7528 ''requires transitive'' \u95F4\u63A5\u5BFC\u51FA\u6A21\u5757 {2} \u4E2D\u7684 {0} {1}
 # 0: kind name, 1: symbol, 2: symbol
 compiler.warn.leaks.not.accessible.unexported.qualified=\u6A21\u5757 {2} \u4E2D\u7684 {0} {1} \u53EF\u80FD\u5BF9\u9700\u8981\u8BE5\u6A21\u5757\u7684\u6240\u6709\u5BA2\u6237\u673A\u90FD\u4E0D\u53EF\u89C1
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties
index b92a26a..18d8c2d 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties
@@ -131,6 +131,8 @@
     "name args"
 javac.opt.arg.multi-release=\
     <release>
+javac.opt.arg.default.module.for.created.files=\
+    <module-name>
 
 ## extended options
 
@@ -228,6 +230,12 @@
 javac.opt.Xlint.desc.removal=\
     Warn about use of API that has been marked for removal.
 
+javac.opt.Xlint.desc.requires-automatic=\
+    Warn about use of automatic modules in the requires clauses.
+
+javac.opt.Xlint.desc.requires-transitive-automatic=\
+    Warn about automatic modules in requires transitive.
+
 javac.opt.Xlint.desc.serial=\
     Warn about Serializable classes that do not provide a serial version ID. \n\
 \                             Also warn about access to non-public members from a serializable element.
@@ -323,6 +331,8 @@
     <version>
 javac.opt.inherit_runtime_environment=\
     Inherit module system configuration options from the runtime environment.
+javac.opt.default.module.for.created.files=\
+    Fallback target module for files created by annotation processors, if none specified or inferred.
 
 ## errors
 
@@ -377,6 +387,9 @@
 javac.err.repeated.value.for.patch.module=\
     --patch-module specified more than once for {0}
 
+javac.err.unmatched.quote=\
+    unmatched quote in environment variable %s
+
 ## messages
 
 javac.msg.usage.header=\
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_ja.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_ja.properties
index 8fff8c9..eb32dea 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_ja.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -119,6 +119,8 @@
 
 javac.opt.Xlint.desc.finally=\u6B63\u5E38\u306B\u5B8C\u4E86\u3057\u306A\u3044finally\u7BC0\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
 
+javac.opt.Xlint.desc.module=\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B7\u30B9\u30C6\u30E0\u95A2\u9023\u306E\u554F\u984C\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
+
 javac.opt.Xlint.desc.options=\u30B3\u30DE\u30F3\u30C9\u884C\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u4F7F\u7528\u306B\u95A2\u3059\u308B\u554F\u984C\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
 
 javac.opt.Xlint.desc.overloads=\u30E1\u30BD\u30C3\u30C9\u306E\u30AA\u30FC\u30D0\u30FC\u30ED\u30FC\u30C9\u306B\u95A2\u3059\u308B\u554F\u984C\u306B\u3064\u3044\u3066\u8B66\u544A\u3057\u307E\u3059\u3002
@@ -156,8 +158,8 @@
 javac.opt.Xdoclint.package.desc=\u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\u5404<package>\u306F\u3001\n\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u3001\u307E\u305F\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306E\u63A5\u982D\u8F9E\u306E\u5F8C\u306B''.*''\u3092\u6307\u5B9A\n(\u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u3059\u3079\u3066\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u62E1\u5F35)\u3057\u305F\u3082\u306E\u3067\u3059\u3002\u5404<package>\u306E\u524D\u306B\n'-'\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u6307\u5B9A\u3057\u305F1\u3064\u4EE5\u4E0A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u95A2\u3059\u308B\u30C1\u30A7\u30C3\u30AF\u3092\u7121\u52B9\u306B\u3067\u304D\u307E\u3059\u3002
 
 javac.opt.Xstdout=\u6A19\u6E96\u51FA\u529B\u3092\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3059\u308B
-javac.opt.X=\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3059\u308B
-javac.opt.help=\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3059\u308B
+javac.opt.X=\u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3057\u307E\u3059
+javac.opt.help=\u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3057\u307E\u3059
 javac.opt.print=\u6307\u5B9A\u3057\u305F\u578B\u306E\u30C6\u30AD\u30B9\u30C8\u8868\u793A\u3092\u51FA\u529B\u3059\u308B
 javac.opt.printRounds=\u6CE8\u91C8\u51E6\u7406\u306E\u5F80\u5FA9\u306B\u3064\u3044\u3066\u306E\u60C5\u5831\u3092\u5370\u5237\u3059\u308B
 javac.opt.printProcessorInfo=\u30D7\u30ED\u30BB\u30C3\u30B5\u304C\u51E6\u7406\u3092\u4F9D\u983C\u3055\u308C\u308B\u6CE8\u91C8\u306B\u3064\u3044\u3066\u306E\u60C5\u5831\u3092\u5370\u5237\u3059\u308B
@@ -177,6 +179,8 @@
 javac.opt.arg.addmods=<module>(,<module>)*
 javac.opt.limitmods=\u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u9818\u57DF\u3092\u5236\u9650\u3057\u307E\u3059
 javac.opt.arg.limitmods=<module>(,<module>)*
+javac.opt.module.version=\u30B3\u30F3\u30D1\u30A4\u30EB\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u307E\u3059
+javac.opt.arg.module.version=<\u30D0\u30FC\u30B8\u30E7\u30F3>
 javac.opt.inherit_runtime_environment=\u5B9F\u884C\u6642\u74B0\u5883\u304B\u3089\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B7\u30B9\u30C6\u30E0\u69CB\u6210\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u7D99\u627F\u3057\u307E\u3059\u3002
 
 ## errors
@@ -203,6 +207,9 @@
 javac.err.file.not.directory=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0}
 javac.err.file.not.file=\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0}
 javac.err.cannot.access.runtime.env=\u5B9F\u884C\u6642\u74B0\u5883\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093
+javac.err.bad.value.for.option={0}\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059: ''{1}''
+javac.err.no.value.for.option={0}\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5024\u304C\u3042\u308A\u307E\u305B\u3093
+javac.err.repeated.value.for.patch.module={0}\u306B\u5BFE\u3057\u3066--patch-module\u304C\u8907\u6570\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059
 
 ## messages
 
@@ -210,7 +217,7 @@
 
 javac.msg.usage=\u4F7F\u7528\u65B9\u6CD5: {0} <options> <source files>\n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001--help\u3092\u4F7F\u7528\u3057\u307E\u3059
 
-javac.msg.usage.nonstandard.footer=\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002
+javac.msg.usage.nonstandard.footer=\u3053\u306E\u8FFD\u52A0\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002
 
 javac.msg.bug=\u30B3\u30F3\u30D1\u30A4\u30E9\u3067\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F({0})\u3002Bug Database (http://bugs.java.com)\u3067\u91CD\u8907\u304C\u306A\u3044\u304B\u3092\u3054\u78BA\u8A8D\u306E\u3046\u3048\u3001Java bug\u30EC\u30DD\u30FC\u30C8\u30FB\u30DA\u30FC\u30B8(http://bugreport.java.com)\u3067Java\u30B3\u30F3\u30D1\u30A4\u30E9\u306B\u5BFE\u3059\u308Bbug\u306E\u767B\u9332\u3092\u304A\u9858\u3044\u3044\u305F\u3057\u307E\u3059\u3002\u30EC\u30DD\u30FC\u30C8\u306B\u306F\u3001\u305D\u306E\u30D7\u30ED\u30B0\u30E9\u30E0\u3068\u4E0B\u8A18\u306E\u8A3A\u65AD\u5185\u5BB9\u3092\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u3054\u5354\u529B\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
index 0417a89..29e8545 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -119,6 +119,8 @@
 
 javac.opt.Xlint.desc.finally=\u6709\u5173 finally \u5B50\u53E5\u672A\u6B63\u5E38\u7EC8\u6B62\u7684\u8B66\u544A\u3002
 
+javac.opt.Xlint.desc.module=\u6709\u5173\u6A21\u5757\u7CFB\u7EDF\u76F8\u5173\u95EE\u9898\u7684\u8B66\u544A\u3002
+
 javac.opt.Xlint.desc.options=\u6709\u5173\u4E0E\u4F7F\u7528\u547D\u4EE4\u884C\u9009\u9879\u76F8\u5173\u7684\u95EE\u9898\u7684\u8B66\u544A\u3002
 
 javac.opt.Xlint.desc.overloads=\u6709\u5173\u4E0E\u65B9\u6CD5\u91CD\u8F7D\u76F8\u5173\u7684\u95EE\u9898\u7684\u8B66\u544A\u3002
@@ -156,8 +158,8 @@
 javac.opt.Xdoclint.package.desc=\u5728\u7279\u5B9A\u7684\u7A0B\u5E8F\u5305\u4E2D\u542F\u7528\u6216\u7981\u7528\u68C0\u67E5\u3002\u6BCF\u4E2A <\u7A0B\u5E8F\u5305> \u662F\n\u7A0B\u5E8F\u5305\u7684\u9650\u5B9A\u540D\u79F0, \u6216\u7A0B\u5E8F\u5305\u540D\u79F0\u524D\u7F00\u540E\u8DDF '.*', \n\u5B83\u6269\u5C55\u5230\u7ED9\u5B9A\u7A0B\u5E8F\u5305\u7684\u6240\u6709\u5B50\u7A0B\u5E8F\u5305\u3002\u5728\u6BCF\u4E2A <\u7A0B\u5E8F\u5305>\n\u524D\u9762\u52A0\u4E0A '-' \u53EF\u4EE5\u4E3A\u6307\u5B9A\u7A0B\u5E8F\u5305\u7981\u7528\u68C0\u67E5\u3002
 
 javac.opt.Xstdout=\u91CD\u5B9A\u5411\u6807\u51C6\u8F93\u51FA
-javac.opt.X=\u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u63D0\u8981
-javac.opt.help=\u8F93\u51FA\u6807\u51C6\u9009\u9879\u7684\u63D0\u8981
+javac.opt.X=\u8F93\u51FA\u989D\u5916\u9009\u9879\u7684\u5E2E\u52A9
+javac.opt.help=\u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F
 javac.opt.print=\u8F93\u51FA\u6307\u5B9A\u7C7B\u578B\u7684\u6587\u672C\u8868\u793A
 javac.opt.printRounds=\u8F93\u51FA\u6709\u5173\u6CE8\u91CA\u5904\u7406\u5FAA\u73AF\u7684\u4FE1\u606F
 javac.opt.printProcessorInfo=\u8F93\u51FA\u6709\u5173\u8BF7\u6C42\u5904\u7406\u7A0B\u5E8F\u5904\u7406\u54EA\u4E9B\u6CE8\u91CA\u7684\u4FE1\u606F
@@ -177,6 +179,8 @@
 javac.opt.arg.addmods=<\u6A21\u5757>(,<\u6A21\u5757>)*
 javac.opt.limitmods=\u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF
 javac.opt.arg.limitmods=<\u6A21\u5757>(,<\u6A21\u5757>)*
+javac.opt.module.version=\u6307\u5B9A\u6B63\u5728\u7F16\u8BD1\u7684\u6A21\u5757\u7248\u672C
+javac.opt.arg.module.version=<\u7248\u672C>
 javac.opt.inherit_runtime_environment=\u4ECE\u8FD0\u884C\u65F6\u73AF\u5883\u7EE7\u627F\u6A21\u5757\u7CFB\u7EDF\u914D\u7F6E\u9009\u9879\u3002
 
 ## errors
@@ -203,6 +207,9 @@
 javac.err.file.not.directory=\u4E0D\u662F\u76EE\u5F55: {0}
 javac.err.file.not.file=\u4E0D\u662F\u6587\u4EF6: {0}
 javac.err.cannot.access.runtime.env=\u65E0\u6CD5\u8BBF\u95EE\u8FD0\u884C\u65F6\u73AF\u5883
+javac.err.bad.value.for.option={0} \u9009\u9879\u7684\u503C\u9519\u8BEF: ''{1}''
+javac.err.no.value.for.option={0} \u9009\u9879\u6CA1\u6709\u503C
+javac.err.repeated.value.for.patch.module=\u4E3A {0} \u591A\u6B21\u6307\u5B9A\u4E86 --patch-module
 
 ## messages
 
@@ -210,7 +217,7 @@
 
 javac.msg.usage=\u7528\u6CD5: {0} <\u9009\u9879> <\u6E90\u6587\u4EF6>\n\u4F7F\u7528 --help \u53EF\u5217\u51FA\u53EF\u80FD\u7684\u9009\u9879
 
-javac.msg.usage.nonstandard.footer=\u8FD9\u4E9B\u9009\u9879\u90FD\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002
+javac.msg.usage.nonstandard.footer=\u8FD9\u4E9B\u989D\u5916\u9009\u9879\u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002
 
 javac.msg.bug=\u7F16\u8BD1\u5668 ({0}) \u4E2D\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF\u3002\u5982\u679C\u5728 Bug Database (http://bugs.java.com) \u4E2D\u6CA1\u6709\u627E\u5230\u8BE5\u9519\u8BEF, \u8BF7\u901A\u8FC7 Java Bug \u62A5\u544A\u9875 (http://bugreport.java.com) \u5EFA\u7ACB\u8BE5 Java \u7F16\u8BD1\u5668 Bug\u3002\u8BF7\u5728\u62A5\u544A\u4E2D\u9644\u4E0A\u60A8\u7684\u7A0B\u5E8F\u548C\u4EE5\u4E0B\u8BCA\u65AD\u4FE1\u606F\u3002\u8C22\u8C22\u3002
 
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java
index 3cccddc..054a5b6 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2133,7 +2133,7 @@
         public Type varargsElement;
         public PolyKind refPolyKind;
         public boolean ownerAccessible;
-        public OverloadKind overloadKind;
+        private OverloadKind overloadKind;
         public Type referentType;
 
         public enum OverloadKind {
@@ -2174,7 +2174,7 @@
             }
         }
 
-        protected JCMemberReference(ReferenceMode mode, Name name, JCExpression expr, List<JCExpression> typeargs) {
+        public JCMemberReference(ReferenceMode mode, Name name, JCExpression expr, List<JCExpression> typeargs) {
             this.mode = mode;
             this.name = name;
             this.expr = expr;
@@ -2205,6 +2205,20 @@
         public boolean hasKind(ReferenceKind kind) {
             return this.kind == kind;
         }
+
+        /**
+         * @return the overloadKind
+         */
+        public OverloadKind getOverloadKind() {
+            return overloadKind;
+        }
+
+        /**
+         * @param overloadKind the overloadKind to set
+         */
+        public void setOverloadKind(OverloadKind overloadKind) {
+            this.overloadKind = overloadKind;
+        }
     }
 
     /**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java
index 976c7a0..a2258e9 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -442,6 +442,7 @@
     @Override
     public void visitModuleDef(JCModuleDecl tree) {
         try {
+            printDocComment(tree);
             printAnnotations(tree.mods.annotations);
             if (tree.getModuleType() == ModuleKind.OPEN) {
                 print("open ");
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Iterators.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Iterators.java
index 0cec314..d8ecd37 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Iterators.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Iterators.java
@@ -28,6 +28,7 @@
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.function.Function;
+import java.util.function.Predicate;
 
 /** Utilities for Iterators.
  *
@@ -92,4 +93,32 @@
             return null;
         }
     };
+
+    public static <E> Iterator<E> createFilterIterator(Iterator<E> input, Predicate<E> test) {
+        return new Iterator<E>() {
+            private E current = update();
+            private E update () {
+                while (input.hasNext()) {
+                    E sym = input.next();
+                    if (test.test(sym)) {
+                        return sym;
+                    }
+                }
+
+                return null;
+            }
+            @Override
+            public boolean hasNext() {
+                return current != null;
+            }
+
+            @Override
+            public E next() {
+                E res = current;
+                current = update();
+                return res;
+            }
+        };
+    }
+
 }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JDK9Wrappers.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JDK9Wrappers.java
index fe28731..40b8f24 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JDK9Wrappers.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JDK9Wrappers.java
@@ -183,7 +183,7 @@
     }
 
     /**
-     * Wrapper class for java.lang.reflect.Module. To materialize a handle use the static factory
+     * Wrapper class for java.lang.Module. To materialize a handle use the static factory
      * methods Module#getModule(Class<?>) or Module#getUnnamedModule(ClassLoader).
      */
     public static class Module {
@@ -236,9 +236,9 @@
         }
 
         // -----------------------------------------------------------------------------------------
-        // on java.lang.reflect.Module
+        // on java.lang.Module
         private static Method addExportsMethod = null;
-        // on java.lang.reflect.Module
+        // on java.lang.Module
         private static Method addUsesMethod = null;
         // on java.lang.Class
         private static Method getModuleMethod;
@@ -248,7 +248,7 @@
         private static void init() {
             if (addExportsMethod == null) {
                 try {
-                    Class<?> moduleClass = Class.forName("java.lang.reflect.Module", false, null);
+                    Class<?> moduleClass = Class.forName("java.lang.Module", false, null);
                     addUsesMethod = moduleClass.getDeclaredMethod("addUses", new Class<?>[] { Class.class });
                     addExportsMethod = moduleClass.getDeclaredMethod("addExports",
                                                         new Class<?>[] { String.class, moduleClass });
@@ -272,12 +272,12 @@
             init();
         }
 
-        public Configuration resolveRequiresAndUses(
+        public Configuration resolveAndBind(
                 ModuleFinder beforeFinder,
                 ModuleFinder afterFinder,
                 Collection<String> roots) {
             try {
-                Object result = resolveRequiresAndUsesMethod.invoke(theRealConfiguration,
+                Object result = resolveAndBindMethod.invoke(theRealConfiguration,
                                     beforeFinder.theRealModuleFinder,
                                     afterFinder.theRealModuleFinder,
                                     roots
@@ -293,7 +293,7 @@
         // -----------------------------------------------------------------------------------------
 
         private static Class<?> configurationClass = null;
-        private static Method resolveRequiresAndUsesMethod;
+        private static Method resolveAndBindMethod;
 
         static final Class<?> getConfigurationClass() {
             init();
@@ -305,7 +305,7 @@
                 try {
                     configurationClass = Class.forName("java.lang.module.Configuration", false, null);
                     Class<?> moduleFinderInterface = ModuleFinder.getModuleFinderClass();
-                    resolveRequiresAndUsesMethod = configurationClass.getDeclaredMethod("resolveRequiresAndUses",
+                    resolveAndBindMethod = configurationClass.getDeclaredMethod("resolveAndBind",
                                 moduleFinderInterface,
                                 moduleFinderInterface,
                                 Collection.class
@@ -318,7 +318,7 @@
     }
 
     /**
-     * Wrapper class for java.lang.module.Layer.
+     * Wrapper class for java.lang.ModuleLayer.
      */
     public static final class Layer {
         private final Object theRealLayer;
@@ -372,7 +372,7 @@
         private static void init() {
             if (layerClass == null) {
                 try {
-                    layerClass = Class.forName("java.lang.reflect.Layer", false, null);
+                    layerClass = Class.forName("java.lang.ModuleLayer", false, null);
                     bootMethod = layerClass.getDeclaredMethod("boot");
                     defineModulesWithOneLoaderMethod = layerClass.getDeclaredMethod("defineModulesWithOneLoader",
                                 Configuration.getConfigurationClass(),
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SmartFileManager.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SmartFileManager.java
index 5a0df7b..cb271bb 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SmartFileManager.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SmartFileManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -204,8 +204,8 @@
     }
 
     @Override @DefinedBy(Api.COMPILER)
-    public Location getLocationForModule(Location location, JavaFileObject fo, String pkgName) throws IOException {
-        return super.getLocationForModule(location, locUnwrap(fo), pkgName);
+    public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
+        return super.getLocationForModule(location, locUnwrap(fo));
     }
 
     private static String packageNameFromFileName(String fn) {
diff --git a/langtools/src/jdk.compiler/share/classes/jdk/internal/shellsupport/doc/JavadocHelper.java b/langtools/src/jdk.compiler/share/classes/jdk/internal/shellsupport/doc/JavadocHelper.java
index bb9a5a4..42fa300 100644
--- a/langtools/src/jdk.compiler/share/classes/jdk/internal/shellsupport/doc/JavadocHelper.java
+++ b/langtools/src/jdk.compiler/share/classes/jdk/internal/shellsupport/doc/JavadocHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,12 +49,15 @@
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ElementKind;
 import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.ModuleElement;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.element.VariableElement;
 import javax.lang.model.type.DeclaredType;
 import javax.lang.model.type.TypeKind;
 import javax.lang.model.type.TypeMirror;
 import javax.lang.model.util.ElementFilter;
+import javax.lang.model.util.Elements;
+import javax.tools.ForwardingJavaFileManager;
 import javax.tools.JavaCompiler;
 import javax.tools.JavaFileManager;
 import javax.tools.JavaFileObject;
@@ -542,8 +545,13 @@
             if (type == null)
                 return null;
 
-            String binaryName = origin.getElements().getBinaryName(type).toString();
-            Pair<JavacTask, CompilationUnitTree> source = findSource(binaryName);
+            Elements elements = origin.getElements();
+            String binaryName = elements.getBinaryName(type).toString();
+            ModuleElement module = elements.getModuleOf(type);
+            String moduleName = module == null || module.isUnnamed()
+                    ? null
+                    : module.getQualifiedName().toString();
+            Pair<JavacTask, CompilationUnitTree> source = findSource(moduleName, binaryName);
 
             if (source == null)
                 return null;
@@ -636,7 +644,8 @@
                 }.scan(cut, null);
             }
 
-        private Pair<JavacTask, CompilationUnitTree> findSource(String binaryName) throws IOException {
+        private Pair<JavacTask, CompilationUnitTree> findSource(String moduleName,
+                                                                String binaryName) throws IOException {
             JavaFileObject jfo = fm.getJavaFileForInput(StandardLocation.SOURCE_PATH,
                                                         binaryName,
                                                         JavaFileObject.Kind.SOURCE);
@@ -645,7 +654,10 @@
                 return null;
 
             List<JavaFileObject> jfos = Arrays.asList(jfo);
-            JavacTaskImpl task = (JavacTaskImpl) compiler.getTask(null, baseFileManager, d -> {}, null, null, jfos);
+            JavaFileManager patchFM = moduleName != null
+                    ? new PatchModuleFileManager(baseFileManager, jfo, moduleName)
+                    : baseFileManager;
+            JavacTaskImpl task = (JavacTaskImpl) compiler.getTask(null, patchFM, d -> {}, null, null, jfos);
             Iterable<? extends CompilationUnitTree> cuts = task.parse();
 
             task.enter();
@@ -657,6 +669,60 @@
         public void close() throws IOException {
             fm.close();
         }
+
+        private static final class PatchModuleFileManager
+                extends ForwardingJavaFileManager<JavaFileManager> {
+
+            private final JavaFileObject file;
+            private final String moduleName;
+
+            public PatchModuleFileManager(JavaFileManager fileManager,
+                                          JavaFileObject file,
+                                          String moduleName) {
+                super(fileManager);
+                this.file = file;
+                this.moduleName = moduleName;
+            }
+
+            @Override @DefinedBy(Api.COMPILER)
+            public Location getLocationForModule(Location location,
+                                                 JavaFileObject fo) throws IOException {
+                return fo == file
+                        ? PATCH_LOCATION
+                        : super.getLocationForModule(location, fo);
+            }
+
+            @Override @DefinedBy(Api.COMPILER)
+            public String inferModuleName(Location location) throws IOException {
+                return location == PATCH_LOCATION
+                        ? moduleName
+                        : super.inferModuleName(location);
+            }
+
+            @Override @DefinedBy(Api.COMPILER)
+            public boolean hasLocation(Location location) {
+                return location == StandardLocation.PATCH_MODULE_PATH ||
+                       super.hasLocation(location);
+            }
+
+            private static final Location PATCH_LOCATION = new Location() {
+                @Override @DefinedBy(Api.COMPILER)
+                public String getName() {
+                    return "PATCH_LOCATION";
+                }
+
+                @Override @DefinedBy(Api.COMPILER)
+                public boolean isOutputLocation() {
+                    return false;
+                }
+
+                @Override @DefinedBy(Api.COMPILER)
+                public boolean isModuleOrientedLocation() {
+                    return false;
+                }
+
+            };
+        }
     }
 
 }
diff --git a/langtools/src/jdk.compiler/share/classes/module-info.java b/langtools/src/jdk.compiler/share/classes/module-info.java
index ddfc508..b777cec 100644
--- a/langtools/src/jdk.compiler/share/classes/module-info.java
+++ b/langtools/src/jdk.compiler/share/classes/module-info.java
@@ -26,6 +26,9 @@
 /** Defines the implementation of the
  *  {@link javax.tools.ToolProvider#getSystemJavaCompiler system Java compiler}
  *  and its command line equivalent, <em>javac</em>, as well as <em>javah</em>.
+ *
+ *  @moduleGraph
+ *  @since 9
  */
 module jdk.compiler {
     requires transitive java.compiler;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
index 676672d..5f2107d 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
@@ -1705,7 +1705,6 @@
         if (lessThanPos < 0) {
             return text;
         }
-
         StringBuilder result = new StringBuilder();
     main: while (lessThanPos != -1) {
             int currPos = lessThanPos + 1;
@@ -1740,17 +1739,16 @@
                     if (ch == '>' && quoteKind == null) {
                         foundGT = true;
                     }
-                    if (++currPos == len)
+                    if (++currPos == len) {
                         break;
+                    }
                     ch = text.charAt(currPos);
                 }
-                startPos = currPos + 1;
-                currPos = startPos;
+                startPos = currPos;
             }
             lessThanPos = text.indexOf('<', currPos);
         }
         result.append(text.substring(startPos));
-
         return result.toString();
     }
 
@@ -1760,10 +1758,6 @@
                 ('1' <= ch && ch <= '6');
     }
 
-    private static boolean isWhitespace(char ch) {
-        return Character.isWhitespace(ch);
-    }
-
     /**
      * Add a link to the stylesheet file.
      *
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
index aa5a2dc..030dc66 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
@@ -292,7 +292,7 @@
             Method getModuleMethod = Class.class.getDeclaredMethod("getModule");
             Object thisModule = getModuleMethod.invoke(getClass());
 
-            Class<?> moduleClass = Class.forName("java.lang.reflect.Module");
+            Class<?> moduleClass = Class.forName("java.lang.Module");
             Method addExportsMethod = moduleClass.getDeclaredMethod("addExports", String.class, moduleClass);
 
             Method getUnnamedModuleMethod = ClassLoader.class.getDeclaredMethod("getUnnamedModule");
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java
index 127becd..e75ddc6 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/standard/Standard.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
  * @deprecated The doclet has been superseded by its replacement,
  * {@code jdk.javadoc.doclets.StandardDoclet}.
  */
-@Deprecated
+@Deprecated(forRemoval=true, since="9")
 public class Standard {
 
     public static int optionLength(String option) {
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocletInvoker.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocletInvoker.java
index 4626586..5cd96e5 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocletInvoker.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocletInvoker.java
@@ -379,7 +379,7 @@
             Method getModuleMethod = Class.class.getDeclaredMethod("getModule");
             Object thisModule = getModuleMethod.invoke(getClass());
 
-            Class<?> moduleClass = Class.forName("java.lang.reflect.Module");
+            Class<?> moduleClass = Class.forName("java.lang.Module");
             Method addExportsMethod = moduleClass.getDeclaredMethod("addExports", String.class, moduleClass);
 
             Method getUnnamedModuleMethod = ClassLoader.class.getDeclaredMethod("getUnnamedModule");
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java
index e74aad1..e84e659 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java
@@ -204,13 +204,6 @@
         }
     },
 
-    XMODULE("-Xmodule:", false) {
-        @Override
-        public void process(Helper helper, String arg) throws InvalidValueException {
-            Option.XMODULE.process(helper.getOptionHelper(), arg);
-        }
-    },
-
     PATCH_MODULE("--patch-module", true) {
         @Override
         public void process(Helper helper, String arg) throws InvalidValueException {
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc.properties b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc.properties
index 0547990..f2e193d 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc.properties
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc.properties
@@ -82,7 +82,6 @@
 \                                   Specify additional modules to be considered as required by a\n\
 \                                   given module. <other-module> may be ALL-UNNAMED to require\n\
 \                                   the unnamed module.\n\
-\  -Xmodule:<module-name>           Specify a module to which the classes being compiled belong.\n\
 \  --patch-module <module>=<file>(:<file>)*\n\
 \                                   Override or augment a module with classes and resources\n\
 \                                   in JAR files or directories\n
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties
index 29a5a1c..3639b9c 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,6 +71,7 @@
 main.release.bootclasspath.conflict=\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306F-release\u3068\u4E00\u7DD2\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
 main.unsupported.release.version=\u30EA\u30EA\u30FC\u30B9\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3{0}\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 main.release.not.standard.file.manager=-release\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u6307\u5B9A\u3055\u308C\u305FJavaFileManager\u306FStandardJavaFileManager\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
+main.option.invalid.value={0}
 tag.illegal_char_in_arr_dim=\u30BF\u30B0{0}: \u914D\u5217\u306E\u5927\u304D\u3055\u3001\u30E1\u30BD\u30C3\u30C9\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF{1}\u306B\u69CB\u6587\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059
 tag.illegal_see_tag=\u30BF\u30B0{0}: \u30E1\u30BD\u30C3\u30C9\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF{1}\u306B\u69CB\u6587\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059
 tag.missing_comma_space=\u30BF\u30B0{0}: \u30E1\u30BD\u30C3\u30C9\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF{1}\u306B\u30AB\u30F3\u30DE\u307E\u305F\u306F\u7A7A\u767D\u6587\u5B57\u304C\u3042\u308A\u307E\u305B\u3093
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties
index 53baad4..dddbeae 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -71,6 +71,7 @@
 main.release.bootclasspath.conflict=\u9009\u9879{0}\u65E0\u6CD5\u4E0E -release \u4E00\u8D77\u4F7F\u7528
 main.unsupported.release.version=\u4E0D\u652F\u6301\u53D1\u884C\u7248\u672C {0}
 main.release.not.standard.file.manager=\u6307\u5B9A\u4E86 -release \u9009\u9879, \u4F46\u63D0\u4F9B\u7684 JavaFileManager \u4E0D\u662F StandardJavaFileManager\u3002
+main.option.invalid.value={0}
 tag.illegal_char_in_arr_dim=\u6807\u8BB0{0}: \u6570\u7EC4\u7EF4\u4E2D\u6709\u8BED\u6CD5\u9519\u8BEF, \u65B9\u6CD5\u53C2\u6570: {1}
 tag.illegal_see_tag=\u6807\u8BB0{0}: \u65B9\u6CD5\u53C2\u6570\u4E2D\u6709\u8BED\u6CD5\u9519\u8BEF: {1}
 tag.missing_comma_space=\u6807\u8BB0{0}: \u65B9\u6CD5\u53C2\u6570\u4E2D\u7F3A\u5C11\u9017\u53F7\u6216\u7A7A\u683C: {1}
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java
new file mode 100644
index 0000000..a82181cd
--- /dev/null
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/StandardDoclet.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.javadoc.doclet;
+
+import java.util.Locale;
+import java.util.Set;
+
+import javax.lang.model.SourceVersion;
+
+import jdk.javadoc.internal.doclets.formats.html.HtmlDoclet;
+
+/**
+ * This doclet generates HTML-formatted documentation for the specified modules, packages and types.
+ */
+public class StandardDoclet implements Doclet {
+
+    private final HtmlDoclet htmlDoclet;
+
+    public StandardDoclet() {
+        htmlDoclet = new HtmlDoclet();
+    }
+
+    @Override
+    public void init(Locale locale, Reporter reporter) {
+        htmlDoclet.init(locale, reporter);
+    }
+
+    @Override
+    public String getName() {
+        return "Standard";
+    }
+
+    @Override
+    public Set<Doclet.Option> getSupportedOptions() {
+        return htmlDoclet.getSupportedOptions();
+    }
+
+    @Override
+    public SourceVersion getSupportedSourceVersion() {
+        return htmlDoclet.getSupportedSourceVersion();
+    }
+
+    @Override
+    public boolean run(DocletEnvironment docEnv) {
+        return htmlDoclet.run(docEnv);
+    }
+}
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Taglet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Taglet.java
new file mode 100644
index 0000000..9e806cc
--- /dev/null
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Taglet.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.javadoc.doclet;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.lang.model.element.Element;
+
+import com.sun.source.doctree.DocTree;
+
+/**
+ * The interface for a custom taglet supported by doclets such as
+ * the {@link jdk.javadoc.doclet.StandardDoclet standard doclet}.
+ * Custom taglets are used to handle custom tags in documentation
+ * comments.
+ *
+ * <p>A custom taglet must implement this interface, and must have
+ * a public default constructor (i.e. a public constructor with no
+ * parameters), by which, the doclet will instantiate and
+ * register the custom taglet.
+ *
+ * @since 9
+ */
+
+public interface Taglet {
+
+    /**
+     * Returns the set of locations in which a tag may be used.
+     * @return the set of locations in which a tag may be used
+     */
+    Set<Location> getAllowedLocations();
+
+    /**
+     * Indicates whether this taglet is for inline tags or not.
+     * @return true if this taglet is for an inline tag, and false otherwise
+     */
+    boolean isInlineTag();
+
+    /**
+     * Returns the name of the tag.
+     * @return the name of this custom tag.
+     */
+    String getName();
+
+    /**
+     * Initializes this taglet with the given doclet environment and doclet.
+     *
+     * @apiNote
+     * The environment may be used to access utility classes for
+     * {@link javax.lang.model.util.Elements elements} and
+     * {@link javax.lang.model.util.Types types} if needed.
+     *
+     * @implSpec
+     * This implementation does nothing.
+     *
+     * @param env the environment in which the doclet and taglet are running
+     * @param doclet the doclet that instantiated this taglet
+     */
+    default void init(DocletEnvironment env, Doclet doclet) { }
+
+    /**
+     * Returns the string representation of a series of instances of
+     * this tag to be included in the generated output.
+     * If this taglet is for an {@link #isInlineTag inline} tag} it will
+     * be called once per instance of the tag, each time with a singleton list.
+     * Otherwise, if this tag is a block tag, it will be called once per
+     * comment, with a list of all the instances of the tag in a comment.
+     * @param tags the list of instances of this tag
+     * @param element the element to which the enclosing comment belongs
+     * @return the string representation of the tags to be included in
+     *  the generated output
+     */
+    String toString(List<? extends DocTree> tags, Element element);
+
+    /**
+     * The kind of location in which a tag may be used.
+     */
+    public static enum Location {
+        /** In an Overview document. */
+        OVERVIEW,
+        /** In the documentation for a module. */
+        MODULE,
+        /** In the documentation for a package. */
+        PACKAGE,
+        /** In the documentation for a class, interface or enum. */
+        TYPE,
+        /** In the documentation for a constructor. */
+        CONSTRUCTOR,
+        /** In the documentation for a method. */
+        METHOD,
+        /** In the documentation for a field. */
+        FIELD
+    }
+}
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java
index 8d84060..a960cef 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java
@@ -29,6 +29,12 @@
  * to inspect the source-level structures of programs and
  * libraries, including API comments embedded in the source.
  *
+ * <p>
+ * The {@link StandardDoclet standard doclet} can be used to
+ * generate HTML-formatted documentation. It supports user-defined
+ * {@link Taglet taglets}, which can be used to generate customized
+ * output for user-defined tags in documentation comments.
+ *
  * <p style="font-style: italic">
  * <b>Note:</b> The declarations in this package supersede those
  * in the older package {@code com.sun.javadoc}. For details on the
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/taglet/Taglet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/taglet/Taglet.java
deleted file mode 100644
index 3880680..0000000
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/taglet/Taglet.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.javadoc.doclet.taglet;
-
-import java.util.List;
-import java.util.Set;
-
-import com.sun.source.doctree.DocTree;
-
-/**
- * The interface for a custom tag used by Doclets. A custom
- * tag must implement this interface, and must have a public
- * default constructor (i.e. a public constructor with no
- * parameters), by which, the doclet will instantiate and
- * register the custom tag.
- *
- * @since 9
- */
-
-public interface Taglet {
-
-    /**
-     * Returns the set of locations in which a taglet may be used.
-     * @return the set of locations in which a taglet may be used
-     * allowed in or an empty set.
-     */
-    Set<Location> getAllowedLocations();
-
-    /**
-     * Indicates the tag is an inline or a body tag.
-     * @return true if this <code>Taglet</code>
-     * is an inline tag, false otherwise.
-     */
-    boolean isInlineTag();
-
-    /**
-     * Returns the name of the tag.
-     * @return the name of this custom tag.
-     */
-    String getName();
-
-    /**
-     * Given the {@link DocTree DocTree} representation of this custom
-     * tag, return its string representation, which is output
-     * to the generated page.
-     * @param tag the <code>Tag</code> representation of this custom tag.
-     * @return the string representation of this <code>Tag</code>.
-     */
-    String toString(DocTree tag);
-
-    /**
-     * Given a List of {@link DocTree DocTrees} representing this custom
-     * tag, return its string representation, which is output
-     * to the generated page.  This method should
-     * return null if this taglet represents an inline or body tag.
-     * @param tags the list of <code>DocTree</code>s representing this custom tag.
-     * @return the string representation of this <code>Tag</code>.
-     */
-    String toString(List<? extends DocTree> tags);
-
-    /**
-     * The kind of location.
-     */
-    public static enum Location {
-        /** In an Overview document. */
-        OVERVIEW,
-        /** In the documentation for a module. */
-        MODULE,
-        /** In the documentation for a package. */
-        PACKAGE,
-        /** In the documentation for a class, interface or enum. */
-        TYPE,
-        /** In the documentation for a constructor. */
-        CONSTRUCTOR,
-        /** In the documentation for a method. */
-        METHOD,
-        /** In the documentation for a field. */
-        FIELD
-    }
-}
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/taglet/package-info.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/taglet/package-info.java
deleted file mode 100644
index 066f5e6..0000000
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/taglet/package-info.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * The Taglet API provides a way to declare custom tags that can be
- * used by the standard doclet.
- *
- * <p style="font-style: italic">
- * <b>Note:</b> The declarations in this package supersede those
- * in the older package {@code com.sun.tools.doclets}.
- * </p>
- *
- * @since 9
- */
-package jdk.javadoc.doclet.taglet;
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclets/StandardDoclet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclets/StandardDoclet.java
deleted file mode 100644
index 6b0d7e7..0000000
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclets/StandardDoclet.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.javadoc.doclets;
-
-import java.util.Locale;
-import java.util.Set;
-
-import javax.lang.model.SourceVersion;
-
-import jdk.javadoc.doclet.Doclet;
-import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.doclet.Reporter;
-import jdk.javadoc.internal.doclets.formats.html.HtmlDoclet;
-
-/**
- * This doclet generates HTML-formatted documentation for the specified modules, packages and types.
- */
-public class StandardDoclet implements Doclet {
-
-    private final HtmlDoclet htmlDoclet;
-
-    public StandardDoclet() {
-        htmlDoclet = new HtmlDoclet();
-    }
-
-    @Override
-    public void init(Locale locale, Reporter reporter) {
-        htmlDoclet.init(locale, reporter);
-    }
-
-    @Override
-    public String getName() {
-        return "Standard";
-    }
-
-    @Override
-    public Set<Doclet.Option> getSupportedOptions() {
-        return htmlDoclet.getSupportedOptions();
-    }
-
-    @Override
-    public SourceVersion getSupportedSourceVersion() {
-        return htmlDoclet.getSupportedSourceVersion();
-    }
-
-    @Override
-    public boolean run(DocletEnvironment docEnv) {
-        return htmlDoclet.run(docEnv);
-    }
-}
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclets/package-info.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclets/package-info.java
deleted file mode 100644
index 057c771..0000000
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/doclets/package-info.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * This package contains standard, supported doclets.
- */
-package jdk.javadoc.doclets;
-
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/api/JavadocTaskImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/api/JavadocTaskImpl.java
index 42622c3..9179328 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/api/JavadocTaskImpl.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/api/JavadocTaskImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,15 +25,20 @@
 
 package jdk.javadoc.internal.api;
 
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.List;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.tools.DocumentationTool.DocumentationTask;
 import javax.tools.JavaFileObject;
 
+import com.sun.tools.javac.main.Option;
 import com.sun.tools.javac.util.ClientCodeException;
 import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.Options;
 import jdk.javadoc.internal.tool.Start;
 
 /**
@@ -53,6 +58,7 @@
     private Iterable<String> options;
     private Iterable<? extends JavaFileObject> fileObjects;
     private Locale locale;
+    private List<String> addModules = new ArrayList<>();
 
     public JavadocTaskImpl(Context context, Class<?> docletClass,
             Iterable<String> options, Iterable<? extends JavaFileObject> fileObjects) {
@@ -72,6 +78,16 @@
         this.locale = locale;
     }
 
+    @Override
+    public void addModules(Iterable<String> moduleNames) {
+        nullCheck(moduleNames);
+        if (used.get())
+            throw new IllegalStateException();
+        for (String name : moduleNames) {
+            addModules.add(name);
+        }
+    }
+
     public Boolean call() {
         if (!used.getAndSet(true)) {
             initContext();
@@ -89,6 +105,12 @@
     private void initContext() {
         //initialize compiler's default locale
         context.put(Locale.class, locale);
+        if (!addModules.isEmpty()) {
+            String names = String.join(",", addModules);
+            Options opts = Options.instance(context);
+            String prev = opts.get(Option.ADD_MODULES);
+            opts.put(Option.ADD_MODULES, (prev == null) ? names : prev + "," + names);
+        }
     }
 
     private static <T> Iterable<T> nullCheck(Iterable<T> items) {
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
index 7ce394b..c8d89e4 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -199,6 +199,7 @@
      */
     protected void addParameters(ExecutableElement member,
             boolean includeAnnotations, Content htmltree, int indentSize) {
+        htmltree.addContent(Contents.ZERO_WIDTH_SPACE);
         htmltree.addContent("(");
         String sep = "";
         List<? extends VariableElement> parameters = member.getParameters();
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
index 5be296e..80b58ce 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 
 import java.util.List;
 
+import javax.lang.model.element.ModuleElement;
 import javax.lang.model.element.PackageElement;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.type.TypeMirror;
@@ -191,10 +192,21 @@
         bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.addStyle(HtmlStyle.header);
+        if (configuration.showModules) {
+            ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(annotationType);
+            Content typeModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
+            Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typeModuleLabel);
+            moduleNameDiv.addContent(Contents.SPACE);
+            moduleNameDiv.addContent(getModuleLink(mdle, new StringContent(mdle.getQualifiedName())));
+            div.addContent(moduleNameDiv);
+        }
         PackageElement pkg = utils.containingPackage(annotationType);
         if (!pkg.isUnnamed()) {
-            Content pkgNameContent = new StringContent(utils.getPackageName(pkg));
-            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
+            Content typePackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel);
+            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, typePackageLabel);
+            pkgNameDiv.addContent(Contents.SPACE);
+            Content pkgNameContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
+            pkgNameDiv.addContent(pkgNameContent);
             div.addContent(pkgNameDiv);
         }
         LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
index 85b2f3f..f1a160e 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -205,7 +205,7 @@
         div.addStyle(HtmlStyle.header);
         if (configuration.showModules) {
             ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(typeElement);
-            Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInClass, contents.moduleLabel);
+            Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInType, contents.moduleLabel);
             Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel);
             moduleNameDiv.addContent(Contents.SPACE);
             moduleNameDiv.addContent(getModuleLink(mdle,
@@ -214,7 +214,7 @@
         }
         PackageElement pkg = utils.containingPackage(typeElement);
         if (!pkg.isUnnamed()) {
-            Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInClass, contents.packageLabel);
+            Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInType, contents.packageLabel);
             Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel);
             pkgNameDiv.addContent(Contents.SPACE);
             Content pkgNameContent = getPackageLink(pkg,
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java
index 9543b1a..b26e473 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConfigurationImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -240,7 +240,8 @@
      * Constructor. Initializes resource for the
      * {@link com.sun.tools.doclets.internal.toolkit.util.MessageRetriever MessageRetriever}.
      */
-    public ConfigurationImpl() {
+    public ConfigurationImpl(Doclet doclet) {
+        super(doclet);
         resources = new Resources(this,
                 Configuration.sharedResourceBundleName,
                 "jdk.javadoc.internal.doclets.formats.html.resources.standard");
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java
index 612c2e0..9a4eb9f 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,9 +69,9 @@
     public ConstructorWriterImpl(SubWriterHolderWriter writer, TypeElement typeElement) {
         super(writer, typeElement);
 
-        VisibleMemberMap visibleMemberMap = new VisibleMemberMap(
+        VisibleMemberMap visibleMemberMap = configuration.getVisibleMemberMap(
                 typeElement,
-                VisibleMemberMap.Kind.CONSTRUCTORS, configuration);
+                VisibleMemberMap.Kind.CONSTRUCTORS);
         List<Element> constructors = visibleMemberMap.getMembers(typeElement);
         for (Element constructor : constructors) {
             if (utils.isProtected(constructor) || utils.isPrivate(constructor)) {
@@ -169,11 +169,7 @@
      */
     @Override
     public void setSummaryColumnStyleAndScope(HtmlTree thTree) {
-        if (foundNonPubConstructor) {
-            thTree.addStyle(HtmlStyle.colSecond);
-        } else {
-            thTree.addStyle(HtmlStyle.colFirst);
-        }
+        thTree.addStyle(HtmlStyle.colConstructorName);
         thTree.addAttr(HtmlAttr.SCOPE, "row");
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java
index 0ed12a6..827053d 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@
  */
 public class Contents {
     public static final Content SPACE = RawHtml.nbsp;
+    public static final Content ZERO_WIDTH_SPACE = RawHtml.zws;
 
     public final Content allClassesLabel;
     public final Content allImplementedInterfacesLabel;
@@ -129,6 +130,7 @@
     public final Content nextPackageLabel;
     public final Content noFramesLabel;
     public final Content noScriptMessage;
+    public final Content openModuleLabel;
     public final Content overridesLabel;
     public final Content overviewLabel;
     public final Content packageHierarchies;
@@ -243,6 +245,7 @@
         nextPackageLabel = getNonBreakContent("doclet.Next_Package");
         noFramesLabel = getNonBreakContent("doclet.No_Frames");
         noScriptMessage = getContent("doclet.No_Script_Message");
+        openModuleLabel = getContent("doclet.Open_Module");
         overridesLabel = getContent("doclet.Overrides");
         overviewLabel = getContent("doclet.Overview");
         packageHierarchies = getContent("doclet.Package_Hierarchies");
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java
index d8f52ae..b6456d9 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
 public class HtmlDoclet extends AbstractDoclet {
 
     public HtmlDoclet() {
-        configuration = new ConfigurationImpl();
+        configuration = new ConfigurationImpl(this);
     }
 
     @Override // defined by Doclet
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
index 432806b..a7dfa8f 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
@@ -647,6 +647,13 @@
                 tree.addContent(fixedNavDiv);
                 HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Contents.SPACE);
                 tree.addContent(paddingDiv);
+                HtmlTree scriptTree = HtmlTree.SCRIPT();
+                String scriptCode = "<!--\n"
+                        + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                        + "//-->\n";
+                RawHtml scriptContent = new RawHtml(scriptCode.replace("\n", DocletConstants.NL));
+                scriptTree.addContent(scriptContent);
+                tree.addContent(scriptTree);
             } else {
                 subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_BOTTOM));
                 tree.addContent(subDiv);
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java
index 2d83177..02f43ef 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -183,19 +183,9 @@
     protected void addOverviewHeader(Content body) {
         addConfigurationTitle(body);
         if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
-            HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
-            subTitleDiv.addStyle(HtmlStyle.subTitle);
-            addSummaryComment(configuration.overviewElement, subTitleDiv);
-            Content div = HtmlTree.DIV(HtmlStyle.header, subTitleDiv);
-            Content see = new ContentBuilder();
-            see.addContent(contents.seeLabel);
-            see.addContent(" ");
-            Content descPara = HtmlTree.P(see);
-            Content descLink = getHyperLink(getDocLink(
-                    SectionName.OVERVIEW_DESCRIPTION),
-                    contents.descriptionLabel, "", "");
-            descPara.addContent(descLink);
-            div.addContent(descPara);
+            HtmlTree div = new HtmlTree(HtmlTag.DIV);
+            div.addStyle(HtmlStyle.contentContainer);
+            addOverviewComment(div);
             if (configuration.allowTag(HtmlTag.MAIN)) {
                 htmlTree.addContent(div);
             } else {
@@ -213,27 +203,19 @@
      */
     protected void addOverviewComment(Content htmltree) {
         if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
-            htmltree.addContent(getMarkerAnchor(SectionName.OVERVIEW_DESCRIPTION));
             addInlineComment(configuration.overviewElement, htmltree);
         }
     }
 
     /**
-     * Adds the tag information as provided in the file specified by the
-     * "-overview" option on the command line.
+     * For HTML 5, add the htmlTree to the body. For HTML 4, do nothing.
      *
      * @param body the documentation tree to which the overview will be added
      */
     @Override
     protected void addOverview(Content body) {
-        HtmlTree div = new HtmlTree(HtmlTag.DIV);
-        div.addStyle(HtmlStyle.contentContainer);
-        addOverviewComment(div);
         if (configuration.allowTag(HtmlTag.MAIN)) {
-            htmlTree.addContent(div);
             body.addContent(htmlTree);
-        } else {
-            body.addContent(div);
         }
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
index 16d7250..70b56ac 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
+import java.util.Collections;
 import java.util.EnumSet;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -97,19 +98,19 @@
             = new TreeMap<>(utils.makeModuleComparator());
 
     /**
-     * Map of additional modules and modifiers, transitive closure, required by this module.
+     * Map of indirect modules and modifiers, transitive closure, required by this module.
      */
-    private final Map<ModuleElement, Content> additionalModules
+    private final Map<ModuleElement, Content> indirectModules
             = new TreeMap<>(utils.makeModuleComparator());
 
     /**
-     * Map of packages exported by this module and the modules it's been exported to.
+     * Map of packages exported by this module and the modules it has been exported to.
      */
     private final Map<PackageElement, SortedSet<ModuleElement>> exportedPackages
             = new TreeMap<>(utils.makePackageComparator());
 
     /**
-     * Map of opened packages by this module and the modules it's been opened to.
+     * Map of opened packages by this module and the modules it has been opened to.
      */
     private final Map<PackageElement, SortedSet<ModuleElement>> openedPackages
             = new TreeMap<>(utils.makePackageComparator());
@@ -120,15 +121,15 @@
     private final SortedSet<PackageElement> concealedPackages = new TreeSet<>(utils.makePackageComparator());
 
     /**
-     * Map of additional modules (transitive closure) and its exported packages.
+     * Map of indirect modules (transitive closure) and their exported packages.
      */
-    private final Map<ModuleElement, SortedSet<PackageElement>> additionalPackages
+    private final Map<ModuleElement, SortedSet<PackageElement>> indirectPackages
             = new TreeMap<>(utils.makeModuleComparator());
 
     /**
-     * Map of additional modules (transitive closure) and its open packages.
+     * Map of indirect modules (transitive closure) and their open packages.
      */
-    private final Map<ModuleElement, SortedSet<PackageElement>> additionalOpenPackages
+    private final Map<ModuleElement, SortedSet<PackageElement>> indirectOpenPackages
             = new TreeMap<>(utils.makeModuleComparator());
 
     /**
@@ -211,8 +212,10 @@
         Content annotationContent = new HtmlTree(HtmlTag.P);
         addAnnotationInfo(mdle, annotationContent);
         div.addContent(annotationContent);
+        Content label = mdle.isOpen() && (configuration.docEnv.getModuleMode() == ModuleMode.ALL)
+                ? contents.openModuleLabel : contents.moduleLabel;
         Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
-                HtmlStyle.title, contents.moduleLabel);
+                HtmlStyle.title, label);
         tHeading.addContent(Contents.SPACE);
         Content moduleHead = new RawHtml(heading);
         tHeading.addContent(moduleHead);
@@ -263,12 +266,12 @@
         CommentHelper ch = utils.getCommentHelper(mdle);
         // Get module dependencies using the module's transitive closure.
         Map<ModuleElement, String> dependentModules = utils.getDependentModules(mdle);
-        // Add all dependent modules to additional modules set. We will remove the modules,
-        // listed using the requires directive, from this set to come up with the table of additional
+        // Add all dependent modules to indirect modules set. We will remove the modules,
+        // listed using the requires directive, from this set to come up with the table of indirect
         // required modules.
         dependentModules.forEach((module, mod) -> {
             if (shouldDocument(module)) {
-                additionalModules.put(module, new StringContent(mod));
+                indirectModules.put(module, new StringContent(mod));
             }
         });
         (ElementFilter.requiresIn(mdle.getDirectives())).forEach((directive) -> {
@@ -277,19 +280,21 @@
                 if (moduleMode == ModuleMode.ALL || directive.isTransitive()) {
                     requires.put(m, new StringContent(utils.getModifiers(directive)));
             } else {
-                // For api mode, just keep the public requires in dependentModules for display of
-                    // additional packages in the "Packages" section.
+                    // For api mode, just keep the public requires in dependentModules for display of
+                    // indirect packages in the "Packages" section.
                     dependentModules.remove(m);
-            }
-                additionalModules.remove(m);
+                }
+                indirectModules.remove(m);
         }
         });
+
         // Get all packages for the module and put it in the concealed packages set.
-        (utils.getModulePackageMap().get(mdle)).forEach((pkg) -> {
+        utils.getModulePackageMap().getOrDefault(mdle, Collections.emptySet()).forEach((pkg) -> {
             if (shouldDocument(pkg)) {
                 concealedPackages.add(pkg);
             }
         });
+
         // Get all exported packages for the module using the exports directive for the module.
         (ElementFilter.exportsIn(mdle.getDirectives())).forEach((directive) -> {
             PackageElement p = directive.getPackage();
@@ -317,7 +322,7 @@
                     mdleList.addAll(targetMdles);
                 }
                 // Qualified opens should not be displayed in the api mode. So if mdleList is empty,
-                // it's opened to all modules and hence can be added.
+                // it is opened to all modules and hence can be added.
                 if (moduleMode == ModuleMode.ALL || mdleList.isEmpty()) {
                     openedPackages.put(p, mdleList);
                 }
@@ -328,7 +333,7 @@
         concealedPackages.removeAll(exportedPackages.keySet());
         concealedPackages.removeAll(openedPackages.keySet());
         // Get all the exported and opened packages, for the transitive closure of the module, to be displayed in
-        // the additional packages tables.
+        // the indirect packages tables.
         dependentModules.forEach((module, mod) -> {
             SortedSet<PackageElement> pkgList = new TreeSet<>(utils.makePackageComparator());
             (ElementFilter.exportsIn(module.getDirectives())).forEach((directive) -> {
@@ -340,7 +345,7 @@
             // If none of the transitive modules have exported packages to be displayed, we should not be
             // displaying the table and so it should not be added to the map.
             if (!pkgList.isEmpty()) {
-                additionalPackages.put(module, pkgList);
+                indirectPackages.put(module, pkgList);
             }
             SortedSet<PackageElement> openPkgList = new TreeSet<>(utils.makePackageComparator());
             (ElementFilter.opensIn(module.getDirectives())).forEach((directive) -> {
@@ -352,7 +357,7 @@
             // If none of the transitive modules have opened packages to be displayed, we should not be
             // displaying the table and so it should not be added to the map.
             if (!openPkgList.isEmpty()) {
-                additionalOpenPackages.put(module, openPkgList);
+                indirectOpenPackages.put(module, openPkgList);
             }
         });
         // Get all the services listed as uses directive.
@@ -468,31 +473,31 @@
      * {@inheritDoc}
      */
     public void addModulesSummary(Content summaryContentTree) {
-        if (display(requires) || display(additionalModules)) {
+        if (display(requires) || display(indirectModules)) {
             HtmlTree li = new HtmlTree(HtmlTag.LI);
             li.addStyle(HtmlStyle.blockList);
             addSummaryHeader(HtmlConstants.START_OF_MODULES_SUMMARY, SectionName.MODULES,
                     contents.navModules, li);
             if (display(requires)) {
-            String text = configuration.getText("doclet.Requires_Summary");
-            String tableSummary = configuration.getText("doclet.Member_Table_Summary",
-                    configuration.getText("doclet.Requires_Summary"),
-                    configuration.getText("doclet.modules"));
+                String text = configuration.getText("doclet.Requires_Summary");
+                String tableSummary = configuration.getText("doclet.Member_Table_Summary",
+                        configuration.getText("doclet.Requires_Summary"),
+                        configuration.getText("doclet.modules"));
                 Content table = getTableHeader(text, tableSummary, HtmlStyle.requiresSummary, requiresTableHeader);
                 Content tbody = new HtmlTree(HtmlTag.TBODY);
                 addModulesList(requires, tbody);
                 table.addContent(tbody);
                 li.addContent(table);
             }
-            // Display additional modules table in both "api" and "all" mode.
-            if (display(additionalModules)) {
-                String amrText = configuration.getText("doclet.Additional_Modules_Required_Summary");
+            // Display indirect modules table in both "api" and "all" mode.
+            if (display(indirectModules)) {
+                String amrText = configuration.getText("doclet.Indirect_Requires_Summary");
                 String amrTableSummary = configuration.getText("doclet.Member_Table_Summary",
-                        configuration.getText("doclet.Additional_Modules_Required_Summary"),
+                        configuration.getText("doclet.Indirect_Requires_Summary"),
                         configuration.getText("doclet.modules"));
                 Content amrTable = getTableHeader(amrText, amrTableSummary, HtmlStyle.requiresSummary, requiresTableHeader);
                 Content amrTbody = new HtmlTree(HtmlTag.TBODY);
-                addModulesList(additionalModules, amrTbody);
+                addModulesList(indirectModules, amrTbody);
                 amrTable.addContent(amrTbody);
                 li.addContent(amrTable);
             }
@@ -527,7 +532,7 @@
 
     public void addPackagesSummary(Content summaryContentTree) {
         if (display(exportedPackages) || display(openedPackages) || display(concealedPackages)
-                || display(additionalPackages) || display(additionalOpenPackages)) {
+                || display(indirectPackages) || display(indirectOpenPackages)) {
             HtmlTree li = new HtmlTree(HtmlTag.LI);
             li.addStyle(HtmlStyle.blockList);
             addSummaryHeader(HtmlConstants.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
@@ -538,29 +543,29 @@
             if (display(exportedPackages) || display(openedPackages) || display(concealedPackages)) {
                 addPackageSummary(tableSummary, li);
             }
-            if (display(additionalPackages)) {
-                String aepText = configuration.getText("doclet.Additional_Exported_Packages_Summary");
-                String aepTableSummary = configuration.getText("doclet.Additional_Packages_Table_Summary",
-                        configuration.getText("doclet.Additional_Exported_Packages_Summary"),
+            if (display(indirectPackages)) {
+                String aepText = configuration.getText("doclet.Indirect_Exports_Summary");
+                String aepTableSummary = configuration.getText("doclet.Indirect_Packages_Table_Summary",
+                        configuration.getText("doclet.Indirect_Exports_Summary"),
                         configuration.getText("doclet.modules"),
                         configuration.getText("doclet.packages"));
                 Content aepTable = getTableHeader(aepText, aepTableSummary, HtmlStyle.packagesSummary,
-                        additionalPackagesTableHeader);
+                        indirectPackagesTableHeader);
                 Content aepTbody = new HtmlTree(HtmlTag.TBODY);
-                addAdditionalPackages(aepTbody, additionalPackages);
+                addIndirectPackages(aepTbody, indirectPackages);
                 aepTable.addContent(aepTbody);
                 li.addContent(aepTable);
             }
-            if (display(additionalOpenPackages)) {
-                String aopText = configuration.getText("doclet.Additional_Opened_Packages_Summary");
-                String aopTableSummary = configuration.getText("doclet.Additional_Packages_Table_Summary",
-                        configuration.getText("doclet.Additional_Opened_Packages_Summary"),
+            if (display(indirectOpenPackages)) {
+                String aopText = configuration.getText("doclet.Indirect_Opens_Summary");
+                String aopTableSummary = configuration.getText("doclet.Indirect_Packages_Table_Summary",
+                        configuration.getText("doclet.Indirect_Opens_Summary"),
                         configuration.getText("doclet.modules"),
                         configuration.getText("doclet.packages"));
                 Content aopTable = getTableHeader(aopText, aopTableSummary, HtmlStyle.packagesSummary,
-                        additionalPackagesTableHeader);
+                        indirectPackagesTableHeader);
                 Content aopTbody = new HtmlTree(HtmlTag.TBODY);
-                addAdditionalPackages(aopTbody, additionalOpenPackages);
+                addIndirectPackages(aopTbody, indirectOpenPackages);
                 aopTable.addContent(aopTbody);
                 li.addContent(aopTable);
             }
@@ -731,14 +736,14 @@
     }
 
     /**
-     * Add the additional packages for the module being documented.
+     * Add the indirect packages for the module being documented.
      *
      * @param tbody the content tree to which the table will be added
-     * @param ap additional packages to be added
+     * @param ip indirect packages to be added
      */
-    public void addAdditionalPackages(Content tbody, Map<ModuleElement, SortedSet<PackageElement>> ap) {
+    public void addIndirectPackages(Content tbody, Map<ModuleElement, SortedSet<PackageElement>> ip) {
         boolean altColor = true;
-        for (Map.Entry<ModuleElement, SortedSet<PackageElement>> entry : ap.entrySet()) {
+        for (Map.Entry<ModuleElement, SortedSet<PackageElement>> entry : ip.entrySet()) {
             ModuleElement m = entry.getKey();
             SortedSet<PackageElement> pkgList = entry.getValue();
             Content moduleLinkContent = getModuleLink(m, new StringContent(m.getQualifiedName()));
@@ -770,19 +775,6 @@
                     contents.navServices, li);
             String text;
             String tableSummary;
-            if (display(uses)) {
-                text = configuration.getText("doclet.Uses_Summary");
-                tableSummary = configuration.getText("doclet.Member_Table_Summary",
-                        configuration.getText("doclet.Uses_Summary"),
-                        configuration.getText("doclet.types"));
-                Content table = getTableHeader(text, tableSummary, HtmlStyle.usesSummary, usesTableHeader);
-                Content tbody = new HtmlTree(HtmlTag.TBODY);
-                addUsesList(tbody);
-                if (!tbody.isEmpty()) {
-                    table.addContent(tbody);
-                    li.addContent(table);
-            }
-            }
             if (display(provides)) {
                 text = configuration.getText("doclet.Provides_Summary");
                 tableSummary = configuration.getText("doclet.Member_Table_Summary",
@@ -796,6 +788,19 @@
                     li.addContent(table);
                 }
             }
+            if (display(uses)) {
+                text = configuration.getText("doclet.Uses_Summary");
+                tableSummary = configuration.getText("doclet.Member_Table_Summary",
+                        configuration.getText("doclet.Uses_Summary"),
+                        configuration.getText("doclet.types"));
+                Content table = getTableHeader(text, tableSummary, HtmlStyle.usesSummary, usesTableHeader);
+                Content tbody = new HtmlTree(HtmlTag.TBODY);
+                addUsesList(tbody);
+                if (!tbody.isEmpty()) {
+                    table.addContent(tbody);
+                    li.addContent(table);
+                }
+            }
             HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
             summaryContentTree.addContent(ul);
         }
@@ -972,12 +977,12 @@
                 ? getHyperLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription)
                 : contents.navModuleDescription);
         addNavGap(liNav);
-        liNav.addContent((display(requires) || display(additionalModules))
+        liNav.addContent((display(requires) || display(indirectModules))
                 ? getHyperLink(SectionName.MODULES, contents.navModules)
                 : contents.navModules);
         addNavGap(liNav);
         liNav.addContent((display(exportedPackages) || display(openedPackages) || display(concealedPackages)
-                || display(additionalPackages) || display(additionalOpenPackages))
+                || display(indirectPackages) || display(indirectOpenPackages))
                 ? getHyperLink(SectionName.PACKAGES, contents.navPackages)
                 : contents.navPackages);
         addNavGap(liNav);
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
index cf5f1da..71deeaa 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -176,19 +176,9 @@
     protected void addOverviewHeader(Content body) {
         addConfigurationTitle(body);
         if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
-            HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
-            subTitleDiv.addStyle(HtmlStyle.subTitle);
-            addSummaryComment(configuration.overviewElement, subTitleDiv);
-            Content div = HtmlTree.DIV(HtmlStyle.header, subTitleDiv);
-            Content descBody = new ContentBuilder();
-            descBody.addContent(contents.seeLabel);
-            descBody.addContent(" ");
-            Content descPara = HtmlTree.P(descBody);
-            Content descLink = getHyperLink(getDocLink(
-                    SectionName.OVERVIEW_DESCRIPTION),
-                    contents.descriptionLabel, "", "");
-            descPara.addContent(descLink);
-            div.addContent(descPara);
+            HtmlTree div = new HtmlTree(HtmlTag.DIV);
+            div.addStyle(HtmlStyle.contentContainer);
+            addOverviewComment(div);
             if (configuration.allowTag(HtmlTag.MAIN)) {
                 htmlTree.addContent(div);
             } else {
@@ -206,27 +196,19 @@
      */
     protected void addOverviewComment(Content htmltree) {
         if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
-            htmltree.addContent(getMarkerAnchor(SectionName.OVERVIEW_DESCRIPTION));
             addInlineComment(configuration.overviewElement, htmltree);
         }
     }
 
     /**
-     * Adds the tag information as provided in the file specified by the
-     * "-overview" option on the command line.
+     * For HTML 5, add the htmlTree to the body. For HTML 4, do nothing.
      *
      * @param body the documentation tree to which the overview will be added
      */
     @Override
     protected void addOverview(Content body) {
-        HtmlTree div = new HtmlTree(HtmlTag.DIV);
-        div.addStyle(HtmlStyle.contentContainer);
-        addOverviewComment(div);
         if (configuration.allowTag(HtmlTag.MAIN)) {
-            htmlTree.addContent(div);
             body.addContent(htmlTree);
-        } else {
-            body.addContent(div);
         }
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java
index 75d46ca..303534c 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -127,7 +127,7 @@
         div.addStyle(HtmlStyle.header);
         if (configuration.showModules) {
             ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(packageElement);
-            Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInClass, contents.moduleLabel);
+            Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInPackage, contents.moduleLabel);
             Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel);
             moduleNameDiv.addContent(Contents.SPACE);
             moduleNameDiv.addContent(getModuleLink(mdle,
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java
index 32f3871..2892801 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java
@@ -106,7 +106,7 @@
         String desc = ch.getText(itt.getDescription());
 
         String anchorName = htmlWriter.getName(tagText);
-        Content result = HtmlTree.A_ID(anchorName, new StringContent(tagText));
+        Content result = HtmlTree.A_ID(HtmlStyle.searchTagResult, anchorName, new StringContent(tagText));
         if (configuration.createindex && !tagText.isEmpty()) {
             SearchIndexItem si = new SearchIndexItem();
             si.setLabel(tagText);
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java
index e6c262d..ad6c183 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,7 @@
     bottomNav,
     circle,
     classUseContainer,
+    colConstructorName,
     colFirst,
     colLast,
     colSecond,
@@ -78,7 +79,8 @@
     memberNameLabel,
     memberNameLink,
     memberSummary,
-    moduleLabelInClass,
+    moduleLabelInPackage,
+    moduleLabelInType,
     nameValue,
     navBarCell1Rev,
     navList,
@@ -87,7 +89,7 @@
     overrideSpecifyLabel,
     overviewSummary,
     packageHierarchyLabel,
-    packageLabelInClass,
+    packageLabelInType,
     packagesSummary,
     paramLabel,
     providesSummary,
@@ -97,6 +99,7 @@
     rightIframe,
     rowColor,
     searchTagLink,
+    searchTagResult,
     seeLabel,
     serializedFormContainer,
     simpleTagLabel,
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java
index b3ab27d..4600193 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -265,6 +265,21 @@
     }
 
     /**
+     * Generates an HTML anchor tag with a style class, id attribute and a body.
+     *
+     * @param styleClass stylesheet class for the tag
+     * @param id id for the anchor tag
+     * @param body body for the anchor tag
+     * @return an HtmlTree object
+     */
+    public static HtmlTree A_ID(HtmlStyle styleClass, String id, Content body) {
+        HtmlTree htmltree = A_ID(id, body);
+        if (styleClass != null)
+            htmltree.addStyle(styleClass);
+        return htmltree;
+    }
+
+    /**
      * Generates a CAPTION tag with some content.
      *
      * @param body content for the tag
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java
index 706d729..f1f1b9e 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@
 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
 import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
 import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
-import jdk.javadoc.internal.doclets.toolkit.util.ModulePackageTypes;
 import jdk.javadoc.internal.doclets.toolkit.util.TableTabTypes;
 
 
@@ -88,7 +87,7 @@
     /**
      * Header for tables displaying modules and exported packages.
      */
-    protected final List<String> additionalPackagesTableHeader;
+    protected final List<String> indirectPackagesTableHeader;
 
     /**
      * Header for tables displaying types and description.
@@ -136,18 +135,18 @@
         packageTableHeader.add(resources.getText("doclet.Package"));
         packageTableHeader.add(resources.getText("doclet.Description"));
         requiresTableHeader = new ArrayList<>();
-        requiresTableHeader.add(resources.getText("doclet.Modifier"));
+            requiresTableHeader.add(resources.getText("doclet.Modifier"));
         requiresTableHeader.add(resources.getText("doclet.Module"));
         requiresTableHeader.add(resources.getText("doclet.Description"));
         exportedPackagesTableHeader = new ArrayList<>();
         exportedPackagesTableHeader.add(resources.getText("doclet.Package"));
         if (configuration.docEnv.getModuleMode() == ModuleMode.ALL) {
-        exportedPackagesTableHeader.add(resources.getText("doclet.Module"));
+            exportedPackagesTableHeader.add(resources.getText("doclet.Module"));
         }
         exportedPackagesTableHeader.add(resources.getText("doclet.Description"));
-        additionalPackagesTableHeader = new ArrayList<>();
-        additionalPackagesTableHeader.add(resources.getText("doclet.Module"));
-        additionalPackagesTableHeader.add(resources.getText("doclet.Packages"));
+        indirectPackagesTableHeader = new ArrayList<>();
+        indirectPackagesTableHeader.add(resources.getText("doclet.From"));
+        indirectPackagesTableHeader.add(resources.getText("doclet.Packages"));
         usesTableHeader = new ArrayList<>();
         usesTableHeader.add(resources.getText("doclet.Type"));
         usesTableHeader.add(resources.getText("doclet.Description"));
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/RawHtml.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/RawHtml.java
index 0a2c360..a374531 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/RawHtml.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/RawHtml.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,6 +47,8 @@
 
     public static final Content nbsp = new RawHtml("&nbsp;");
 
+    public static final Content zws = new RawHtml("&#8203;");
+
     /**
      * Constructor to construct a RawHtml object.
      *
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js
index 6e4ea9b..7ce9904 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -169,11 +169,42 @@
             var tresult = new Array();
             var mresult = new Array();
             var tgresult = new Array();
+            var secondaryresult = new Array();
             var displayCount = 0;
             var exactMatcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(request.term) + "$", "i");
             camelCaseRegexp = ($.ui.autocomplete.escapeRegex(request.term)).split(/(?=[A-Z])/).join("([a-z0-9_$]*?)");
             var camelCaseMatcher = new RegExp("^" + camelCaseRegexp);
             secondaryMatcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
+
+            // Return the nested innermost name from the specified object
+            function nestedName(e) {
+                return e.l.substring(e.l.lastIndexOf(".") + 1);
+            }
+
+            // Sort array items by short name (as opposed to fully qualified name).
+            // Additionally, sort by the nested type name, when present,
+            // as opposed to top level short name.
+            function sortAndConcatResults(a1, a2) {
+                var sortingKey;
+                var sortArray = function(e1, e2) {
+                    var l = sortingKey(e1);
+                    var m = sortingKey(e2);
+                    if (l < m)
+                        return -1;
+                    if (l > m)
+                        return 1;
+                    return 0;
+                };
+                sortingKey = function(e) {
+                    return nestedName(e).toUpperCase();
+                };
+                a1.sort(sortArray);
+                a2.sort(sortArray);
+                a1 = a1.concat(a2);
+                a2.length = 0;
+                return a1;
+            }
+
             if (moduleSearchIndex) {
                 var mdleCount = 0;
                 $.each(moduleSearchIndex, function(index, item) {
@@ -184,10 +215,11 @@
                     } else if (camelCaseMatcher.test(item.l)) {
                         result.unshift(item);
                     } else if (secondaryMatcher.test(item.l)) {
-                        result.push(item);
+                        secondaryresult.push(item);
                     }
                 });
                 displayCount = mdleCount;
+                result = sortAndConcatResults(result, secondaryresult);
             }
             if (packageSearchIndex) {
                 var pCount = 0;
@@ -203,42 +235,44 @@
                     } else if (camelCaseMatcher.test(pkg)) {
                         presult.unshift(item);
                     } else if (secondaryMatcher.test(pkg)) {
-                        presult.push(item);
+                        secondaryresult.push(item);
                     }
                 });
-                result = result.concat(presult);
+                result = result.concat(sortAndConcatResults(presult, secondaryresult));
                 displayCount = (pCount > displayCount) ? pCount : displayCount;
             }
             if (typeSearchIndex) {
                 var tCount = 0;
                 $.each(typeSearchIndex, function(index, item) {
                     item[category] = catTypes;
-                    if (exactMatcher.test(item.l)) {
+                    var s = nestedName(item);
+                    if (exactMatcher.test(s)) {
                         tresult.unshift(item);
                         tCount++;
-                    } else if (camelCaseMatcher.test(item.l)) {
+                    } else if (camelCaseMatcher.test(s)) {
                         tresult.unshift(item);
                     } else if (secondaryMatcher.test(item.p + "." + item.l)) {
-                        tresult.push(item);
+                        secondaryresult.push(item);
                     }
                 });
-                result = result.concat(tresult);
+                result = result.concat(sortAndConcatResults(tresult, secondaryresult));
                 displayCount = (tCount > displayCount) ? tCount : displayCount;
             }
             if (memberSearchIndex) {
                 var mCount = 0;
                 $.each(memberSearchIndex, function(index, item) {
                     item[category] = catMembers;
-                    if (exactMatcher.test(item.l)) {
+                    var s = nestedName(item);
+                    if (exactMatcher.test(s)) {
                         mresult.unshift(item);
                         mCount++;
-                    } else if (camelCaseMatcher.test(item.l)) {
+                    } else if (camelCaseMatcher.test(s)) {
                         mresult.unshift(item);
                     } else if (secondaryMatcher.test(item.c + "." + item.l)) {
-                        mresult.push(item);
+                        secondaryresult.push(item);
                     }
                 });
-                result = result.concat(mresult);
+                result = result.concat(sortAndConcatResults(mresult, secondaryresult));
                 displayCount = (mCount > displayCount) ? mCount : displayCount;
             }
             if (tagSearchIndex) {
@@ -249,10 +283,10 @@
                         tgresult.unshift(item);
                         tgCount++;
                     } else if (secondaryMatcher.test(item.l)) {
-                        tgresult.push(item);
+                        secondaryresult.push(item);
                     }
                 });
-                result = result.concat(tgresult);
+                result = result.concat(sortAndConcatResults(tgresult, secondaryresult));
                 displayCount = (tgCount > displayCount) ? tgCount : displayCount;
             }
             displayCount = (displayCount > 500) ? displayCount : 500;
@@ -312,4 +346,4 @@
             }
         }
     });
-});
\ No newline at end of file
+});
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties
index 8990c4d..6fa9121 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties
@@ -6,6 +6,7 @@
 doclet.Element=Element
 doclet.Package=Package
 doclet.Module=Module
+doclet.Open_Module=Open Module
 doclet.All_Packages=All Packages
 doclet.All_Modules=All Modules
 doclet.None=None
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties
index 1328366..a9728fe 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties
@@ -3,10 +3,12 @@
 doclet.Overview=\u6982\u8981
 doclet.Window_Overview=\u6982\u8981\u30EA\u30B9\u30C8
 doclet.Window_Overview_Summary=\u6982\u8981
+doclet.Element=\u8981\u7D20
 doclet.Package=\u30D1\u30C3\u30B1\u30FC\u30B8
 doclet.Module=\u30E2\u30B8\u30E5\u30FC\u30EB
 doclet.All_Packages=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8
 doclet.All_Modules=\u3059\u3079\u3066\u306E\u30E2\u30B8\u30E5\u30FC\u30EB
+doclet.None=\u306A\u3057
 doclet.Tree=\u968E\u5C64\u30C4\u30EA\u30FC
 doclet.Class_Hierarchy=\u30AF\u30E9\u30B9\u968E\u5C64
 doclet.Window_Class_Hierarchy=\u30AF\u30E9\u30B9\u968E\u5C64
@@ -71,6 +73,8 @@
 doclet.see.class_or_package_not_accessible=\u30BF\u30B0{0}: \u53C2\u7167\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {1}
 doclet.tag.invalid_usage=\u30BF\u30B0{0}\u306E\u4F7F\u7528\u65B9\u6CD5\u304C\u7121\u52B9\u3067\u3059
 doclet.Deprecated_API=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044API
+doclet.Deprecated_For_Removal=\u524A\u9664\u4E88\u5B9A\u306E\u975E\u63A8\u5968
+doclet.Deprecated_Modules=\u975E\u63A8\u5968\u30E2\u30B8\u30E5\u30FC\u30EB
 doclet.Deprecated_Packages=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30D1\u30C3\u30B1\u30FC\u30B8
 doclet.Deprecated_Classes=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30AF\u30E9\u30B9
 doclet.Deprecated_Enums=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B
@@ -83,6 +87,8 @@
 doclet.Deprecated_Methods=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30E1\u30BD\u30C3\u30C9
 doclet.Deprecated_Enum_Constants=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B\u5B9A\u6570
 doclet.Deprecated_Annotation_Type_Members=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u6CE8\u91C8\u578B\u306E\u8981\u7D20
+doclet.deprecated_for_removal=\u524A\u9664\u4E88\u5B9A\u306E\u975E\u63A8\u5968
+doclet.deprecated_modules=\u975E\u63A8\u5968\u30E2\u30B8\u30E5\u30FC\u30EB
 doclet.deprecated_packages=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30D1\u30C3\u30B1\u30FC\u30B8
 doclet.deprecated_classes=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30AF\u30E9\u30B9
 doclet.deprecated_enums=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties
index 949044a..f42c6a5 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties
@@ -3,10 +3,12 @@
 doclet.Overview=\u6982\u89C8
 doclet.Window_Overview=\u6982\u89C8\u5217\u8868
 doclet.Window_Overview_Summary=\u6982\u89C8
+doclet.Element=\u5143\u7D20
 doclet.Package=\u7A0B\u5E8F\u5305
 doclet.Module=\u6A21\u5757
 doclet.All_Packages=\u6240\u6709\u7A0B\u5E8F\u5305
 doclet.All_Modules=\u5168\u90E8\u6A21\u5757
+doclet.None=\u65E0
 doclet.Tree=\u6811
 doclet.Class_Hierarchy=\u7C7B\u5206\u5C42\u7ED3\u6784
 doclet.Window_Class_Hierarchy=\u7C7B\u5206\u5C42\u7ED3\u6784
@@ -71,6 +73,8 @@
 doclet.see.class_or_package_not_accessible=\u6807\u8BB0{0}: \u65E0\u6CD5\u8BBF\u95EE\u5F15\u7528: {1}
 doclet.tag.invalid_usage=\u6807\u8BB0 {0} \u7684\u7528\u6CD5\u65E0\u6548
 doclet.Deprecated_API=\u5DF2\u8FC7\u65F6\u7684 API
+doclet.Deprecated_For_Removal=\u5DF2\u8FC7\u65F6, \u5F85\u5220\u9664
+doclet.Deprecated_Modules=\u5DF2\u8FC7\u65F6\u6A21\u5757
 doclet.Deprecated_Packages=\u5DF2\u8FC7\u65F6\u7A0B\u5E8F\u5305
 doclet.Deprecated_Classes=\u5DF2\u8FC7\u65F6\u7684\u7C7B
 doclet.Deprecated_Enums=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E
@@ -83,6 +87,8 @@
 doclet.Deprecated_Methods=\u5DF2\u8FC7\u65F6\u7684\u65B9\u6CD5
 doclet.Deprecated_Enum_Constants=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E\u5E38\u91CF
 doclet.Deprecated_Annotation_Type_Members=\u5DF2\u8FC7\u65F6\u7684\u6CE8\u91CA\u7C7B\u578B\u5143\u7D20
+doclet.deprecated_for_removal=\u5DF2\u8FC7\u65F6, \u5F85\u5220\u9664
+doclet.deprecated_modules=\u5DF2\u8FC7\u65F6\u6A21\u5757
 doclet.deprecated_packages=\u5DF2\u8FC7\u65F6\u7A0B\u5E8F\u5305
 doclet.deprecated_classes=\u5DF2\u8FC7\u65F6\u7684\u7C7B
 doclet.deprecated_enums=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java
index 118614c..a18b502 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java
@@ -34,7 +34,7 @@
 
 import jdk.javadoc.doclet.Doclet;
 import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.doclets.StandardDoclet;
+import jdk.javadoc.doclet.StandardDoclet;
 import jdk.javadoc.internal.doclets.formats.html.HtmlDoclet;
 import jdk.javadoc.internal.doclets.toolkit.builders.AbstractBuilder;
 import jdk.javadoc.internal.doclets.toolkit.builders.BuilderFactory;
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java
index d34323f..90992c7 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Configuration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,13 +26,13 @@
 package jdk.javadoc.internal.doclets.toolkit;
 
 import java.io.*;
+import java.lang.ref.*;
 import java.util.*;
 
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ModuleElement;
 import javax.lang.model.element.PackageElement;
 import javax.lang.model.element.TypeElement;
-import javax.lang.model.util.ElementFilter;
 import javax.lang.model.util.SimpleElementVisitor9;
 import javax.tools.JavaFileManager;
 import javax.tools.JavaFileObject;
@@ -55,7 +55,9 @@
 import jdk.javadoc.internal.doclets.toolkit.util.SimpleDocletException;
 import jdk.javadoc.internal.doclets.toolkit.util.TypeElementCatalog;
 import jdk.javadoc.internal.doclets.toolkit.util.Utils;
+import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.GetterSetter;
+import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind;
 
 import static javax.tools.Diagnostic.Kind.*;
 
@@ -75,6 +77,10 @@
  * @author Jamie Ho
  */
 public abstract class Configuration {
+    /**
+     * The doclet that created this configuration.
+     */
+    public final Doclet doclet;
 
     /**
      * The factory for builders.
@@ -293,6 +299,8 @@
 
     private List<GroupContainer> groups;
 
+    private final Map<TypeElement, EnumMap<Kind, Reference<VisibleMemberMap>>> typeElementMemberCache;
+
     public abstract Messages getMessages();
     public abstract Resources getResources();
 
@@ -343,13 +351,16 @@
             "jdk.javadoc.internal.doclets.toolkit.resources.doclets";
     /**
      * Constructs the configurations needed by the doclet.
+     * @param doclet the doclet that created this configuration
      */
-    public Configuration() {
+    public Configuration(Doclet doclet) {
+        this.doclet = doclet;
         excludedDocFileDirs = new HashSet<>();
         excludedQualifiers = new HashSet<>();
         setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH);
         metakeywords = new MetaKeywords(this);
         groups = new ArrayList<>(0);
+        typeElementMemberCache = new HashMap<>();
     }
 
     private boolean initialized = false;
@@ -442,6 +453,11 @@
             }
         }
 
+        // add entries for modules which may not have exported packages
+        modules.forEach((ModuleElement mdle) -> {
+            modulePackages.computeIfAbsent(mdle, m -> Collections.emptySet());
+        });
+
         modules.addAll(modulePackages.keySet());
         showModules = !modules.isEmpty();
         for (Set<PackageElement> pkgs : modulePackages.values()) {
@@ -1116,7 +1132,7 @@
 
         @Override
         public String toString() {
-            return names.toString();
+            return Arrays.toString(names);
         }
 
         @Override
@@ -1249,4 +1265,18 @@
     public boolean isAllowScriptInComments() {
         return allowScriptInComments;
     }
+
+    public VisibleMemberMap getVisibleMemberMap(TypeElement te, VisibleMemberMap.Kind kind) {
+        EnumMap<Kind, Reference<VisibleMemberMap>> cacheMap = typeElementMemberCache
+                .computeIfAbsent(te, k -> new EnumMap<>(VisibleMemberMap.Kind.class));
+
+        Reference<VisibleMemberMap> vmapRef = cacheMap.get(kind);
+        // recompute, if referent has been garbage collected
+        VisibleMemberMap vMap = vmapRef == null ? null : vmapRef.get();
+        if (vMap == null) {
+            vMap = new VisibleMemberMap(te, kind, this);
+            cacheMap.put(kind, new SoftReference<>(vMap));
+        }
+        return vMap;
+    }
 }
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WorkArounds.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WorkArounds.java
index 50ffb6b..782a0df 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WorkArounds.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WorkArounds.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,6 @@
 import javax.lang.model.util.Elements;
 import javax.tools.FileObject;
 import javax.tools.JavaFileManager.Location;
-import javax.tools.JavaFileObject;
 
 import com.sun.source.tree.CompilationUnitTree;
 import com.sun.source.util.JavacTask;
@@ -62,7 +61,6 @@
 import com.sun.tools.javac.code.Symbol.ModuleSymbol;
 import com.sun.tools.javac.code.Symbol.PackageSymbol;
 import com.sun.tools.javac.code.Symbol.VarSymbol;
-import com.sun.tools.javac.code.Symtab;
 import com.sun.tools.javac.comp.AttrContext;
 import com.sun.tools.javac.comp.Env;
 import com.sun.tools.javac.model.JavacElements;
@@ -297,6 +295,33 @@
         return null;
     }
 
+    // TODO: the method jx.l.m.Elements::overrides does not check
+    // the return type, see JDK-8174840 until that is resolved,
+    // use a  copy of the same method, with a return type check.
+
+    // Note: the rider.overrides call in this method *must* be consistent
+    // with the call in overrideType(....), the method above.
+    public boolean overrides(ExecutableElement e1, ExecutableElement e2, TypeElement cls) {
+        MethodSymbol rider = (MethodSymbol)e1;
+        MethodSymbol ridee = (MethodSymbol)e2;
+        ClassSymbol origin = (ClassSymbol)cls;
+
+        return rider.name == ridee.name &&
+
+               // not reflexive as per JLS
+               rider != ridee &&
+
+               // we don't care if ridee is static, though that wouldn't
+               // compile
+               !rider.isStatic() &&
+
+               // Symbol.overrides assumes the following
+               ridee.isMemberOf(origin, toolEnv.getTypes()) &&
+
+               // check access, signatures and check return types
+               rider.overrides(ridee, origin, toolEnv.getTypes(), true);
+    }
+
     // TODO: jx.l.m ?
     public Location getLocationForModule(ModuleElement mdle) {
         ModuleSymbol msym = (ModuleSymbol)mdle;
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java
index 9026429..4a6512d 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@
         super(context);
         this.typeElement = typeElement;
         this.writer = writer;
-        this.visibleMemberMap = new VisibleMemberMap(typeElement, memberType, configuration);
+        this.visibleMemberMap = configuration.getVisibleMemberMap(typeElement, memberType);
         this.members = this.visibleMemberMap.getMembers(typeElement);
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
index 412f723..e88da11 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -91,7 +91,7 @@
         super(context);
         this.typeElement = typeElement;
         this.writer = writer;
-        this.visibleMemberMap = new VisibleMemberMap(typeElement, memberType, configuration);
+        this.visibleMemberMap = configuration.getVisibleMemberMap(typeElement, memberType);
         this.members = this.visibleMemberMap.getMembers(typeElement);
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java
index 75a01fa..a1909f7 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -273,8 +273,8 @@
      * @return true if the given package has constant fields to document.
      */
     private boolean hasConstantField (TypeElement typeElement) {
-        VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(typeElement,
-            VisibleMemberMap.Kind.FIELDS, configuration);
+        VisibleMemberMap visibleMemberMapFields = configuration.getVisibleMemberMap(typeElement,
+            VisibleMemberMap.Kind.FIELDS);
         List<Element> fields = visibleMemberMapFields.getLeafMembers();
         for (Element f : fields) {
             VariableElement field = (VariableElement)f;
@@ -329,10 +329,10 @@
          */
         public ConstantFieldBuilder(TypeElement typeElement) {
             this.typeElement = typeElement;
-            visibleMemberMapFields = new VisibleMemberMap(typeElement,
-                VisibleMemberMap.Kind.FIELDS, configuration);
-            visibleMemberMapEnumConst = new VisibleMemberMap(typeElement,
-                VisibleMemberMap.Kind.ENUM_CONSTANTS, configuration);
+            visibleMemberMapFields = configuration.getVisibleMemberMap(typeElement,
+                VisibleMemberMap.Kind.FIELDS);
+            visibleMemberMapEnumConst = configuration.getVisibleMemberMap(typeElement,
+                VisibleMemberMap.Kind.ENUM_CONSTANTS);
         }
 
         /**
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java
index ee8076b..b938e24 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,11 +94,8 @@
         super(context);
         this.typeElement = typeElement;
         this.writer = writer;
-        visibleMemberMap =
-                new VisibleMemberMap(
-                typeElement,
-                VisibleMemberMap.Kind.CONSTRUCTORS,
-                configuration);
+        visibleMemberMap = configuration.getVisibleMemberMap(typeElement,
+                VisibleMemberMap.Kind.CONSTRUCTORS);
         constructors = visibleMemberMap.getMembers(typeElement);
         for (Element ctor : constructors) {
             if (utils.isProtected(ctor) || utils.isPrivate(ctor)) {
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java
index ddb6619..409a6ac 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -89,11 +89,8 @@
         super(context);
         this.typeElement = typeElement;
         this.writer = writer;
-        visibleMemberMap =
-                new VisibleMemberMap(
-                typeElement,
-                VisibleMemberMap.Kind.ENUM_CONSTANTS,
-                configuration);
+        visibleMemberMap = configuration.getVisibleMemberMap(typeElement,
+                VisibleMemberMap.Kind.ENUM_CONSTANTS);
         enumConstants = visibleMemberMap.getMembers(typeElement);
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java
index ccb5671..ebd3b0e 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,11 +90,8 @@
         super(context);
         this.typeElement = typeElement;
         this.writer = writer;
-        visibleMemberMap =
-                new VisibleMemberMap(
-                typeElement,
-                VisibleMemberMap.Kind.FIELDS,
-                configuration);
+        visibleMemberMap = configuration.getVisibleMemberMap(typeElement,
+                VisibleMemberMap.Kind.FIELDS);
         fields = visibleMemberMap.getLeafMembers();
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java
index 886c31f..c4c600f 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,12 @@
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.element.VariableElement;
+import javax.lang.model.type.ArrayType;
+import javax.lang.model.type.DeclaredType;
+import javax.lang.model.type.ExecutableType;
+import javax.lang.model.type.PrimitiveType;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.util.SimpleTypeVisitor9;
 
 import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.DocTree.Kind;
@@ -64,10 +70,6 @@
     public static final String NAME = "MemberSummary";
 
     /**
-     * The visible members for the given class.
-     */
-    private final EnumMap<VisibleMemberMap.Kind, VisibleMemberMap> visibleMemberMaps;
-    /**
      * The member summary writers for the given class.
      */
     private final EnumMap<VisibleMemberMap.Kind, MemberSummaryWriter> memberSummaryWriters;
@@ -88,14 +90,6 @@
         super(context);
         this.typeElement = typeElement;
         memberSummaryWriters = new EnumMap<>(VisibleMemberMap.Kind.class);
-        visibleMemberMaps = new EnumMap<>(VisibleMemberMap.Kind.class);
-        for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.values()) {
-            visibleMemberMaps.put(kind,
-                    new VisibleMemberMap(
-                    typeElement,
-                    kind,
-                    configuration));
-        }
     }
 
     /**
@@ -111,7 +105,7 @@
                 classWriter.getTypeElement());
         WriterFactory wf = context.configuration.getWriterFactory();
         for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.values()) {
-            MemberSummaryWriter msw = builder.visibleMemberMaps.get(kind).noVisibleMembers()
+            MemberSummaryWriter msw =  builder.getVisibleMemberMap(kind).noVisibleMembers()
                     ? null
                     : wf.getMemberSummaryWriter(classWriter, kind);
             builder.memberSummaryWriters.put(kind, msw);
@@ -132,7 +126,7 @@
                 annotationTypeWriter.getAnnotationTypeElement());
         WriterFactory wf = context.configuration.getWriterFactory();
         for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.values()) {
-            MemberSummaryWriter msw = builder.visibleMemberMaps.get(kind).noVisibleMembers()
+            MemberSummaryWriter msw = builder.getVisibleMemberMap(kind).noVisibleMembers()
                     ? null
                     : wf.getMemberSummaryWriter(annotationTypeWriter, kind);
             builder.memberSummaryWriters.put(kind, msw);
@@ -151,25 +145,25 @@
     /**
      * Return the specified visible member map.
      *
-     * @param type the type of visible member map to return.
+     * @param kind the kind of visible member map to return.
      * @return the specified visible member map.
      * @throws ArrayIndexOutOfBoundsException when the type is invalid.
      * @see VisibleMemberMap
      */
-    public VisibleMemberMap getVisibleMemberMap(VisibleMemberMap.Kind type) {
-        return visibleMemberMaps.get(type);
+    public VisibleMemberMap getVisibleMemberMap(VisibleMemberMap.Kind kind) {
+        return configuration.getVisibleMemberMap(typeElement, kind);
     }
 
     /**.
      * Return the specified member summary writer.
      *
-     * @param type the type of member summary writer to return.
+     * @param kind the kind of member summary writer to return.
      * @return the specified member summary writer.
      * @throws ArrayIndexOutOfBoundsException when the type is invalid.
      * @see VisibleMemberMap
      */
-    public MemberSummaryWriter getMemberSummaryWriter(VisibleMemberMap.Kind type) {
-        return memberSummaryWriters.get(type);
+    public MemberSummaryWriter getMemberSummaryWriter(VisibleMemberMap.Kind kind) {
+        return memberSummaryWriters.get(kind);
     }
 
     /**
@@ -177,13 +171,13 @@
      * This information can be used for doclet specific documentation
      * generation.
      *
-     * @param type the type of members to return.
+     * @param kind the kind of elements to return.
      * @return a list of methods that will be documented.
      * @see VisibleMemberMap
      */
-    public SortedSet<Element> members(VisibleMemberMap.Kind type) {
+    public SortedSet<Element> members(VisibleMemberMap.Kind kind) {
         TreeSet<Element> out = new TreeSet<>(comparator);
-        out.addAll(visibleMemberMaps.get(type).getLeafMembers());
+        out.addAll(getVisibleMemberMap(kind).getLeafMembers());
         return out;
     }
 
@@ -198,7 +192,7 @@
             return !utils.getAnnotationMethods(typeElement).isEmpty();
         }
         for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.values()) {
-            VisibleMemberMap members = visibleMemberMaps.get(kind);
+            VisibleMemberMap members = getVisibleMemberMap(kind);
             if (!members.noVisibleMembers()) {
                 return true;
             }
@@ -216,7 +210,7 @@
         MemberSummaryWriter writer =
                 memberSummaryWriters.get(VisibleMemberMap.Kind.ENUM_CONSTANTS);
         VisibleMemberMap visibleMemberMap =
-                visibleMemberMaps.get(VisibleMemberMap.Kind.ENUM_CONSTANTS);
+                getVisibleMemberMap(VisibleMemberMap.Kind.ENUM_CONSTANTS);
         addSummary(writer, visibleMemberMap, false, memberSummaryTree);
     }
 
@@ -230,7 +224,7 @@
         MemberSummaryWriter writer =
                 memberSummaryWriters.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS);
         VisibleMemberMap visibleMemberMap =
-                visibleMemberMaps.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS);
+                getVisibleMemberMap(VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS);
         addSummary(writer, visibleMemberMap, false, memberSummaryTree);
     }
 
@@ -244,7 +238,7 @@
         MemberSummaryWriter writer =
                 memberSummaryWriters.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL);
         VisibleMemberMap visibleMemberMap =
-                visibleMemberMaps.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL);
+                getVisibleMemberMap(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL);
         addSummary(writer, visibleMemberMap, false, memberSummaryTree);
     }
 
@@ -258,7 +252,7 @@
         MemberSummaryWriter writer =
                 memberSummaryWriters.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_REQUIRED);
         VisibleMemberMap visibleMemberMap =
-                visibleMemberMaps.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_REQUIRED);
+                getVisibleMemberMap(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_REQUIRED);
         addSummary(writer, visibleMemberMap, false, memberSummaryTree);
     }
 
@@ -272,7 +266,7 @@
         MemberSummaryWriter writer =
                 memberSummaryWriters.get(VisibleMemberMap.Kind.FIELDS);
         VisibleMemberMap visibleMemberMap =
-                visibleMemberMaps.get(VisibleMemberMap.Kind.FIELDS);
+                getVisibleMemberMap(VisibleMemberMap.Kind.FIELDS);
         addSummary(writer, visibleMemberMap, true, memberSummaryTree);
     }
 
@@ -283,7 +277,7 @@
         MemberSummaryWriter writer =
                 memberSummaryWriters.get(VisibleMemberMap.Kind.PROPERTIES);
         VisibleMemberMap visibleMemberMap =
-                visibleMemberMaps.get(VisibleMemberMap.Kind.PROPERTIES);
+                getVisibleMemberMap(VisibleMemberMap.Kind.PROPERTIES);
         addSummary(writer, visibleMemberMap, true, memberSummaryTree);
     }
 
@@ -297,7 +291,7 @@
         MemberSummaryWriter writer =
                 memberSummaryWriters.get(VisibleMemberMap.Kind.INNER_CLASSES);
         VisibleMemberMap visibleMemberMap =
-                visibleMemberMaps.get(VisibleMemberMap.Kind.INNER_CLASSES);
+                getVisibleMemberMap(VisibleMemberMap.Kind.INNER_CLASSES);
         addSummary(writer, visibleMemberMap, true, memberSummaryTree);
     }
 
@@ -311,7 +305,7 @@
         MemberSummaryWriter writer =
                 memberSummaryWriters.get(VisibleMemberMap.Kind.METHODS);
         VisibleMemberMap visibleMemberMap =
-                visibleMemberMaps.get(VisibleMemberMap.Kind.METHODS);
+               getVisibleMemberMap(VisibleMemberMap.Kind.METHODS);
         addSummary(writer, visibleMemberMap, true, memberSummaryTree);
     }
 
@@ -325,7 +319,7 @@
         MemberSummaryWriter writer =
                 memberSummaryWriters.get(VisibleMemberMap.Kind.CONSTRUCTORS);
         VisibleMemberMap visibleMemberMap =
-                visibleMemberMaps.get(VisibleMemberMap.Kind.CONSTRUCTORS);
+                getVisibleMemberMap(VisibleMemberMap.Kind.CONSTRUCTORS);
         addSummary(writer, visibleMemberMap, false, memberSummaryTree);
     }
 
@@ -440,16 +434,10 @@
 
             if (null != setter) {
                 VariableElement param = setter.getParameters().get(0);
-                String typeName = utils.getTypeName(param.asType(), false);
-                // Removal of type parameters and package information.
-                typeName = typeName.split("<")[0];
-                if (typeName.contains(".")) {
-                    typeName = typeName.substring(typeName.lastIndexOf(".") + 1);
-                }
                 StringBuilder sb = new StringBuilder("#");
                 sb.append(utils.getSimpleName(setter));
                 if (!utils.isTypeVariable(param.asType())) {
-                    sb.append("(").append(typeName).append(")");
+                    sb.append("(").append(utils.getTypeSignature(param.asType(), false, true)).append(")");
                 }
                 blockTags.add(cmtutils.makeSeeTree(sb.toString(), setter));
             }
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java
index ba0e88a..402b09d 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,10 +94,8 @@
         super(context);
         this.typeElement = typeElement;
         this.writer = writer;
-        visibleMemberMap = new VisibleMemberMap(
-                typeElement,
-                VisibleMemberMap.Kind.METHODS,
-                configuration);
+        visibleMemberMap = configuration.getVisibleMemberMap(typeElement,
+                VisibleMemberMap.Kind.METHODS);
         methods = visibleMemberMap.getLeafMembers();
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java
index 986924f..0d59210 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,11 +90,8 @@
         super(context);
         this.typeElement = typeElement;
         this.writer = writer;
-        visibleMemberMap =
-                new VisibleMemberMap(
-                typeElement,
-                VisibleMemberMap.Kind.PROPERTIES,
-                configuration);
+        visibleMemberMap = configuration.getVisibleMemberMap(typeElement,
+                VisibleMemberMap.Kind.PROPERTIES);
         properties = visibleMemberMap.getMembers(typeElement);
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclet.xml b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclet.xml
index 7a6c54d..3148605 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclet.xml
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclet.xml
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='utf-8'?>
 
 <!--
- Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -33,8 +33,8 @@
             <ModuleDescription/>
             <ModuleTags/>
             <Summary>
-                <ModulesSummary/>
                 <PackagesSummary/>
+                <ModulesSummary/>
                 <ServicesSummary/>
             </Summary>
         </Content>
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties
index 926da0f..14b0ef8 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties
@@ -86,12 +86,13 @@
 doclet.javafx_tag_misuse=Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters.
 doclet.Package_Summary=Package Summary
 doclet.Requires_Summary=Requires
-doclet.Additional_Modules_Required_Summary=Additional Modules Required
-doclet.Additional_Exported_Packages_Summary=Additional Exported Packages
-doclet.Additional_Opened_Packages_Summary=Additional Opened Packages
-doclet.Exported_Packages_Summary=Exported Packages
-doclet.Opened_Packages_Summary=Opened Packages
-doclet.Concealed_Packages_Summary=Concealed Packages
+doclet.Indirect_Requires_Summary=Indirect Requires
+doclet.Indirect_Exports_Summary=Indirect Exports
+doclet.Indirect_Opens_Summary=Indirect Opens
+doclet.Exported_Packages_Summary=Exports
+doclet.Opened_Packages_Summary=Opens
+doclet.Concealed_Packages_Summary=Concealed
+doclet.From=From
 doclet.Packages_Summary=Packages
 doclet.Uses_Summary=Uses
 doclet.Provides_Summary=Provides
@@ -160,7 +161,7 @@
 doclet.Method_Detail=Method Detail
 doclet.Constructor_Detail=Constructor Detail
 doclet.Deprecated=Deprecated.
-doclet.DeprecatedForRemoval=Deprecated, for removal: This API element is subject to removal in a future version. 
+doclet.DeprecatedForRemoval=Deprecated, for removal: This API element is subject to removal in a future version.
 doclet.Hidden=Hidden
 doclet.Groupname_already_used=In -group option, groupname already used: {0}
 doclet.value_tag_invalid_reference={0} (referenced by @value tag) is an unknown reference.
@@ -171,7 +172,7 @@
 doclet.Use_Table_Summary=Use table, listing {0}, and an explanation
 doclet.Constants_Table_Summary={0} table, listing constant fields, and values
 doclet.Member_Table_Summary={0} table, listing {1}, and an explanation
-doclet.Additional_Packages_Table_Summary={0} table, listing {1}, and {2}
+doclet.Indirect_Packages_Table_Summary={0} table, listing {1}, and {2}
 doclet.fields=fields
 doclet.Fields=Fields
 doclet.properties=properties
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties
index 42022d0..9ec50ee 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties
@@ -74,7 +74,13 @@
 doclet.javafx_tag_misuse=\u30BF\u30B0@propertyGetter\u3001@propertySetter\u304A\u3088\u3073@propertyDescription\u306F\u3001JavaFX\u306E\u30D7\u30ED\u30D1\u30C6\u30A3getter\u3068setter\u306E\u307F\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
 doclet.Package_Summary=\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u6982\u8981
 doclet.Requires_Summary=\u5FC5\u8981
+doclet.Additional_Modules_Required_Summary=\u8FFD\u52A0\u30E2\u30B8\u30E5\u30FC\u30EB\u5FC5\u9808
+doclet.Additional_Exported_Packages_Summary=\u8FFD\u52A0\u306E\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8
+doclet.Additional_Opened_Packages_Summary=\u8FFD\u52A0\u306E\u30AA\u30FC\u30D7\u30F3\u3055\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8
 doclet.Exported_Packages_Summary=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3055\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8
+doclet.Opened_Packages_Summary=\u30AA\u30FC\u30D7\u30F3\u3055\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8
+doclet.Concealed_Packages_Summary=\u96A0\u3057\u30D1\u30C3\u30B1\u30FC\u30B8
+doclet.Packages_Summary=\u30D1\u30C3\u30B1\u30FC\u30B8
 doclet.Uses_Summary=\u4F7F\u7528
 doclet.Provides_Summary=\u63D0\u4F9B
 doclet.Module_Summary=\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u6982\u8981
@@ -142,6 +148,7 @@
 doclet.Method_Detail=\u30E1\u30BD\u30C3\u30C9\u306E\u8A73\u7D30
 doclet.Constructor_Detail=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u8A73\u7D30
 doclet.Deprecated=\u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
+doclet.DeprecatedForRemoval=\u975E\u63A8\u5968\u3001\u524A\u9664\u4E88\u5B9A: \u3053\u306EAPI\u8981\u7D20\u306F\u5C06\u6765\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3067\u524A\u9664\u4E88\u5B9A\u3067\u3059\u3002 
 doclet.Hidden=\u975E\u8868\u793A
 doclet.Groupname_already_used=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u304A\u3044\u3066\u3001\u3059\u3067\u306B\u30B0\u30EB\u30FC\u30D7\u540D\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0}
 doclet.value_tag_invalid_reference={0}(@value\u30BF\u30B0\u306B\u3088\u308A\u53C2\u7167\u3055\u308C\u3066\u3044\u308B)\u306F\u4E0D\u660E\u306A\u53C2\u7167\u3067\u3059\u3002
@@ -152,6 +159,7 @@
 doclet.Use_Table_Summary=\u8868\u3001{0}\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073\u8AAC\u660E\u306E\u4F7F\u7528
 doclet.Constants_Table_Summary={0}\u8868\u3001\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073\u5024
 doclet.Member_Table_Summary={0}\u8868\u3001{1}\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073\u8AAC\u660E
+doclet.Additional_Packages_Table_Summary={0}\u8868\u3001{1}\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073{2}
 doclet.fields=\u30D5\u30A3\u30FC\u30EB\u30C9
 doclet.Fields=\u30D5\u30A3\u30FC\u30EB\u30C9
 doclet.properties=\u30D7\u30ED\u30D1\u30C6\u30A3
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties
index 7129b65..665c078 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties
@@ -74,7 +74,13 @@
 doclet.javafx_tag_misuse=\u6807\u8BB0 @propertyGetter, @propertySetter \u548C @propertyDescription \u53EA\u80FD\u5728 JavaFX \u5C5E\u6027 getter \u548C setter \u4E2D\u4F7F\u7528\u3002
 doclet.Package_Summary=\u7A0B\u5E8F\u5305\u6982\u8981
 doclet.Requires_Summary=\u5FC5\u9700\u9879
+doclet.Additional_Modules_Required_Summary=\u6240\u9700\u7684\u9644\u52A0\u6A21\u5757
+doclet.Additional_Exported_Packages_Summary=\u5BFC\u51FA\u7684\u9644\u52A0\u7A0B\u5E8F\u5305
+doclet.Additional_Opened_Packages_Summary=\u6253\u5F00\u7684\u9644\u52A0\u7A0B\u5E8F\u5305
 doclet.Exported_Packages_Summary=\u5BFC\u51FA\u7684\u7A0B\u5E8F\u5305
+doclet.Opened_Packages_Summary=\u6253\u5F00\u7684\u7A0B\u5E8F\u5305
+doclet.Concealed_Packages_Summary=\u9690\u85CF\u7684\u7A0B\u5E8F\u5305
+doclet.Packages_Summary=\u7A0B\u5E8F\u5305
 doclet.Uses_Summary=\u4F7F\u7528
 doclet.Provides_Summary=\u63D0\u4F9B
 doclet.Module_Summary=\u6A21\u5757\u6982\u8981
@@ -142,6 +148,7 @@
 doclet.Method_Detail=\u65B9\u6CD5\u8BE6\u7EC6\u8D44\u6599
 doclet.Constructor_Detail=\u6784\u9020\u5668\u8BE6\u7EC6\u8D44\u6599
 doclet.Deprecated=\u5DF2\u8FC7\u65F6\u3002
+doclet.DeprecatedForRemoval=\u5DF2\u8FC7\u65F6, \u5F85\u5220\u9664: \u6B64 API \u5143\u7D20\u5C06\u4ECE\u4EE5\u540E\u7684\u7248\u672C\u4E2D\u5220\u9664\u3002
 doclet.Hidden=\u9690\u85CF
 doclet.Groupname_already_used=\u5728 -group \u9009\u9879\u4E2D, groupname \u5DF2\u4F7F\u7528: {0}
 doclet.value_tag_invalid_reference={0} (\u7531 @value \u6807\u8BB0\u5F15\u7528) \u4E3A\u672A\u77E5\u5F15\u7528\u3002
@@ -152,6 +159,7 @@
 doclet.Use_Table_Summary=\u4F7F\u7528\u8868, \u5217\u8868{0}\u548C\u89E3\u91CA
 doclet.Constants_Table_Summary={0}\u8868, \u5217\u8868\u5E38\u91CF\u5B57\u6BB5\u548C\u503C
 doclet.Member_Table_Summary={0}\u8868, \u5217\u8868{1}\u548C\u89E3\u91CA
+doclet.Additional_Packages_Table_Summary={0} \u8868, \u5176\u4E2D\u5217\u51FA {1} \u548C {2}
 doclet.fields=\u5B57\u6BB5
 doclet.Fields=\u5B57\u6BB5
 doclet.properties=\u5C5E\u6027
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js
index 56c76bd..50a08ad 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js
@@ -92,6 +92,9 @@
     if (!tagSearchIndex) {
         createElem(doc, tag, 'tag-search-index.js');
     }
+    $(window).resize(function() {
+        $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
+    });
 }
 
 function createElem(doc, tag, path) {
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
index 98aec12..25b7cf3 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
@@ -42,15 +42,14 @@
     text-decoration:none;
     color:#353833;
 }
-a[name]:before, a[name]:target {
+a[name]:before, a[name]:target, a[id]:before, a[id]:target {
     content:"";
-    display:block;
-    height:120px;
-    margin:-120px 0 0;
-}
-a[id]:before, a[id]:target {
+    display:inline-block;
+    position:relative;
     padding-top:129px;
     margin-top:-129px;
+}
+.searchTagResult:before, .searchTagResult:target {
     color:red;
 }
 pre {
@@ -144,7 +143,7 @@
     margin:0;
 }
 .navPadding {
-    padding-top: 100px;
+    padding-top: 107px;
 }
 .fixedNav {
     position:fixed;
@@ -540,14 +539,14 @@
     text-align:left;
     padding:0px 0px 12px 10px;
 }
-th.colFirst, th.colSecond, th.colLast, .useSummary th, .constantsSummary th, .packagesSummary th,
+th.colFirst, th.colSecond, th.colLast, th.colConstructorName, .useSummary th, .constantsSummary th, .packagesSummary th,
 td.colFirst, td.colSecond, td.colLast, .useSummary td, .constantsSummary td {
     vertical-align:top;
     padding-right:0px;
     padding-top:8px;
     padding-bottom:3px;
 }
-th.colFirst, th.colSecond, th.colLast, .constantsSummary th, .packagesSummary th {
+th.colFirst, th.colSecond, th.colLast, th.colConstructorName, .constantsSummary th, .packagesSummary th {
     background:#dee3e9;
     text-align:left;
     padding:8px 3px 3px 7px;
@@ -556,7 +555,7 @@
     white-space:nowrap;
     font-size:13px;
 }
-td.colSecond, th.colSecond, td.colLast, th.colLast {
+td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colLast {
     font-size:13px;
 }
 .constantsSummary th, .packagesSummary th {
@@ -573,8 +572,8 @@
 .usesSummary td.colFirst, .usesSummary th.colFirst,
 .providesSummary td.colFirst, .providesSummary th.colFirst,
 .memberSummary td.colFirst, .memberSummary th.colFirst,
-.memberSummary td.colSecond, .memberSummary th.colSecond,
-.typeSummary td.colFirst{
+.memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName,
+.typeSummary td.colFirst {
     vertical-align:top;
 }
 .packagesSummary th.colLast, .packagesSummary td.colLast {
@@ -584,6 +583,8 @@
 td.colSecond a:link, td.colSecond a:active, td.colSecond a:visited, td.colSecond a:hover,
 th.colFirst a:link, th.colFirst a:active, th.colFirst a:visited, th.colFirst a:hover,
 th.colSecond a:link, th.colSecond a:active, th.colSecond a:visited, th.colSecond a:hover,
+th.colConstructorName a:link, th.colConstructorName a:active, th.colConstructorName a:visited,
+th.colConstructorName a:hover,
 td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover,
 .constantValuesContainer td a:link, .constantValuesContainer td a:active,
 .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
@@ -647,7 +648,7 @@
     color:#474747;
 }
 .deprecatedLabel, .descfrmTypeLabel, .implementationLabel, .memberNameLabel, .memberNameLink,
-.moduleLabelInClass, .overrideSpecifyLabel, .packageLabelInClass,
+.moduleLabelInPackage, .moduleLabelInType, .overrideSpecifyLabel, .packageLabelInType,
 .packageHierarchyLabel, .paramLabel, .returnLabel, .seeLabel, .simpleTagLabel,
 .throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink {
     font-weight:bold;
@@ -787,3 +788,15 @@
     font-style:italic;
     font-size:12px;
 }
+
+.moduleGraph span {
+    display:none;
+    position:absolute;
+}
+.moduleGraph:hover span {
+    display:block;
+    margin: -100px 0 0 100px;
+    z-index: 1;
+}
+
+
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java
index 676cabd..ba64475 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 package jdk.javadoc.internal.doclets.toolkit.taglets;
 
 import java.io.*;
+import java.lang.reflect.InvocationTargetException;
 import java.util.*;
 
 import javax.lang.model.element.Element;
@@ -39,6 +40,8 @@
 import javax.tools.StandardJavaFileManager;
 
 import com.sun.source.doctree.DocTree;
+import jdk.javadoc.doclet.Doclet;
+import jdk.javadoc.doclet.DocletEnvironment;
 import jdk.javadoc.internal.doclets.toolkit.Configuration;
 import jdk.javadoc.internal.doclets.toolkit.Messages;
 import jdk.javadoc.internal.doclets.toolkit.Resources;
@@ -125,6 +128,9 @@
      */
     private List<Taglet> serializedFormTags;
 
+    private final DocletEnvironment docEnv;
+    private final Doclet doclet;
+
     private final Messages messages;
     private final Resources resources;
 
@@ -184,7 +190,7 @@
      * @param showversion true if we want to use @version tags.
      * @param showauthor true if we want to use @author tags.
      * @param javafx indicates whether javafx is active.
-     * @param message the message retriever to print warnings.
+     * @param configuration the configuration for this taglet manager
      */
     public TagletManager(boolean nosince, boolean showversion,
                          boolean showauthor, boolean javafx,
@@ -199,6 +205,8 @@
         this.showversion = showversion;
         this.showauthor = showauthor;
         this.javafx = javafx;
+        this.docEnv = configuration.docEnv;
+        this.doclet = configuration.doclet;
         this.messages = configuration.getMessages();
         this.resources = configuration.getResources();
         initStandardTaglets();
@@ -236,7 +244,7 @@
      */
     public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) {
         try {
-            ClassLoader tagClassLoader = null;
+            ClassLoader tagClassLoader;
             if (!fileManager.hasLocation(TAGLET_PATH)) {
                 List<File> paths = new ArrayList<>();
                 if (tagletPath != null) {
@@ -249,9 +257,11 @@
                 }
             }
             tagClassLoader = fileManager.getClassLoader(TAGLET_PATH);
-            Class<?> customTagClass = tagClassLoader.loadClass(classname);
-            Object instance = customTagClass.getConstructor().newInstance();
-            Taglet newLegacy = new UserTaglet((jdk.javadoc.doclet.taglet.Taglet)instance);
+            Class<? extends jdk.javadoc.doclet.Taglet> customTagClass =
+                    tagClassLoader.loadClass(classname).asSubclass(jdk.javadoc.doclet.Taglet.class);
+            jdk.javadoc.doclet.Taglet instance = customTagClass.getConstructor().newInstance();
+            instance.init(docEnv, doclet);
+            Taglet newLegacy = new UserTaglet(instance);
             String tname = newLegacy.getName();
             Taglet t = customTags.get(tname);
             if (t != null) {
@@ -315,8 +325,8 @@
     private void checkTaglet(Object taglet) {
         if (taglet instanceof Taglet) {
             checkTagName(((Taglet) taglet).getName());
-        } else if (taglet instanceof jdk.javadoc.doclet.taglet.Taglet) {
-            jdk.javadoc.doclet.taglet.Taglet legacyTaglet = (jdk.javadoc.doclet.taglet.Taglet) taglet;
+        } else if (taglet instanceof jdk.javadoc.doclet.Taglet) {
+            jdk.javadoc.doclet.Taglet legacyTaglet = (jdk.javadoc.doclet.Taglet) taglet;
             customTags.remove(legacyTaglet.getName());
             customTags.put(legacyTaglet.getName(), new UserTaglet(legacyTaglet));
             checkTagName(legacyTaglet.getName());
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/UserTaglet.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/UserTaglet.java
index 2f4bc95..cb6ebb6 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/UserTaglet.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/UserTaglet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
  */
 package jdk.javadoc.internal.doclets.toolkit.taglets;
 
+import java.util.Collections;
 import java.util.List;
 
 import javax.lang.model.element.Element;
@@ -33,10 +34,10 @@
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.util.Utils;
 
-import static jdk.javadoc.doclet.taglet.Taglet.Location.*;
+import static jdk.javadoc.doclet.Taglet.Location.*;
 
 /**
- * A taglet wrapper, allows the public taglet {@link jdk.javadoc.doclet.taglet.Taglet}
+ * A taglet wrapper, allows the public taglet {@link jdk.javadoc.doclet.Taglet}
  * wrapped into an internal Taglet representation.
  *
  *  <p><b>This is NOT part of any supported API.
@@ -48,9 +49,9 @@
  */
 public class UserTaglet implements Taglet {
 
-    final private jdk.javadoc.doclet.taglet.Taglet userTaglet;
+    final private jdk.javadoc.doclet.Taglet userTaglet;
 
-    public UserTaglet(jdk.javadoc.doclet.taglet.Taglet t) {
+    public UserTaglet(jdk.javadoc.doclet.Taglet t) {
         userTaglet = t;
     }
 
@@ -131,7 +132,7 @@
      */
     public Content getTagletOutput(Element element, DocTree tag, TagletWriter writer){
         Content output = writer.getOutputInstance();
-        output.addContent(new RawHtml(userTaglet.toString(tag)));
+        output.addContent(new RawHtml(userTaglet.toString(Collections.singletonList(tag), element)));
         return output;
     }
 
@@ -143,7 +144,7 @@
         Utils utils = writer.configuration().utils;
         List<? extends DocTree> tags = utils.getBlockTags(holder, getName());
         if (!tags.isEmpty()) {
-            String tagString = userTaglet.toString(tags);
+            String tagString = userTaglet.toString(tags, holder);
             if (tagString != null) {
                 output.addContent(new RawHtml(tagString));
             }
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/JavaScriptScanner.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/JavaScriptScanner.java
index c476c53..8699bed 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/JavaScriptScanner.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/JavaScriptScanner.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@
             case "datasrc":  case "for":  case "href":  case "longdesc":  case "profile":
             case "src":  case "usemap":
                 List<? extends DocTree> value = tree.getValue();
-                if (!value.isEmpty() && value.get(0).getKind() == Kind.TEXT) {
+                if (value != null && !value.isEmpty() && value.get(0).getKind() == Kind.TEXT) {
                     String v = value.get(0).toString().trim().toLowerCase(Locale.ENGLISH);
                     if (v.startsWith("javascript:")) {
                         f.accept(getCurrentPath());
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
index 4cc17b8..9143002 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
@@ -725,7 +725,7 @@
         return result.toString();
     }
 
-    private String getTypeSignature(TypeMirror t, boolean qualifiedName, boolean noTypeParameters) {
+    public String getTypeSignature(TypeMirror t, boolean qualifiedName, boolean noTypeParameters) {
         return new SimpleTypeVisitor9<StringBuilder, Void>() {
             final StringBuilder sb = new StringBuilder();
 
@@ -893,7 +893,7 @@
             }
             List<? extends Element> methods = te.getEnclosedElements();
             for (ExecutableElement ee : ElementFilter.methodsIn(methods)) {
-                if (elementUtils.overrides(method, ee, origin)) {
+                if (configuration.workArounds.overrides(method, ee, origin)) {
                     return ee;
                 }
             }
@@ -1886,11 +1886,6 @@
             }
 
             @Override
-            public String visitPrimitive(PrimitiveType t, Void p) {
-                return t.toString();
-            }
-
-            @Override
             public String visitTypeVariable(javax.lang.model.type.TypeVariable t, Void p) {
                 // The knee jerk reaction is to do this but don't!, as we would like
                 // it to be compatible with the old world, now if we decide to do so
@@ -1900,9 +1895,10 @@
             }
 
             @Override
-            protected String defaultAction(TypeMirror e, Void p) {
-                throw new UnsupportedOperationException("should not happen");
+            protected String defaultAction(TypeMirror t, Void p) {
+                return t.toString();
             }
+
         }.visit(t);
     }
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
index 5b1a8e7..7cf4086 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ElementsTable.java
@@ -30,6 +30,7 @@
 import java.util.Collections;
 import java.util.EnumMap;
 import java.util.EnumSet;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -53,6 +54,7 @@
 import javax.tools.StandardLocation;
 
 import com.sun.tools.javac.code.Kinds.Kind;
+import com.sun.tools.javac.code.Source;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.code.Symbol.CompletionFailure;
@@ -60,8 +62,11 @@
 import com.sun.tools.javac.code.Symbol.PackageSymbol;
 import com.sun.tools.javac.code.Symtab;
 import com.sun.tools.javac.comp.Modules;
+import com.sun.tools.javac.main.JavaCompiler;
 import com.sun.tools.javac.tree.JCTree.JCClassDecl;
 import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
+import com.sun.tools.javac.tree.JCTree.JCModuleDecl;
+import com.sun.tools.javac.tree.TreeInfo;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.ListBuffer;
 import com.sun.tools.javac.util.Name;
@@ -70,7 +75,10 @@
 import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
 
 import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE;
+
+import static javax.lang.model.util.Elements.Origin.*;
 import static javax.tools.JavaFileObject.Kind.*;
+
 import static jdk.javadoc.internal.tool.Main.Result.*;
 import static jdk.javadoc.internal.tool.JavadocTool.isValidClassName;
 
@@ -153,10 +161,11 @@
     private final Symtab syms;
     private final Names names;
     private final JavaFileManager fm;
-    private final Location location;
+    private final List<Location> locations;
     private final Modules modules;
     private final Map<ToolOption, Object> opts;
     private final Messager messager;
+    private final JavaCompiler compiler;
 
     private final Map<String, Entry> entries = new LinkedHashMap<>();
 
@@ -201,12 +210,22 @@
         this.modules = Modules.instance(context);
         this.opts = opts;
         this.messager = Messager.instance0(context);
+        this.compiler = JavaCompiler.instance(context);
+        Source source = Source.instance(context);
 
-        this.location = modules.multiModuleMode
-                ? StandardLocation.MODULE_SOURCE_PATH
-                : toolEnv.fileManager.hasLocation(StandardLocation.SOURCE_PATH)
-                    ? StandardLocation.SOURCE_PATH
-                    : StandardLocation.CLASS_PATH;
+        List<Location> locs = new ArrayList<>();
+        if (modules.multiModuleMode) {
+            locs.add(StandardLocation.MODULE_SOURCE_PATH);
+        } else {
+            if (toolEnv.fileManager.hasLocation(StandardLocation.SOURCE_PATH))
+                locs.add(StandardLocation.SOURCE_PATH);
+            else
+                locs.add(StandardLocation.CLASS_PATH);
+        }
+        if (source.allowModules() && toolEnv.fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH))
+            locs.add(StandardLocation.PATCH_MODULE_PATH);
+        this.locations = Collections.unmodifiableList(locs);
+
         getEntry("").excluded = false;
 
         accessFilter = new ModifierFilter(opts);
@@ -341,6 +360,52 @@
         return this;
     }
 
+    /*
+     * This method sanity checks the following cases:
+     * a. a source-path containing a single module and many modules specified with --module
+     * b. no modules on source-path
+     * c. mismatched source-path and many modules specified with --module
+     */
+    void sanityCheckSourcePathModules(List<String> moduleNames) throws ToolException {
+        if (!haveSourceLocationWithModule)
+            return;
+
+        if (moduleNames.size() > 1) {
+            String text = messager.getText("main.cannot_use_sourcepath_for_modules",
+                    String.join(", ", moduleNames));
+            throw new ToolException(CMDERR, text);
+        }
+
+        String foundModule = getModuleName(StandardLocation.SOURCE_PATH);
+        if (foundModule == null) {
+            String text = messager.getText("main.module_not_found_on_sourcepath", moduleNames.get(0));
+            throw new ToolException(CMDERR, text);
+        }
+
+        if (!moduleNames.get(0).equals(foundModule)) {
+            String text = messager.getText("main.sourcepath_does_not_contain_module", moduleNames.get(0));
+            throw new ToolException(CMDERR, text);
+        }
+    }
+
+    private String getModuleName(Location location) throws ToolException {
+        try {
+            JavaFileObject jfo = fm.getJavaFileForInput(location,
+                    "module-info", JavaFileObject.Kind.SOURCE);
+            if (jfo != null) {
+                JCCompilationUnit jcu = compiler.parse(jfo);
+                JCModuleDecl module = TreeInfo.getModule(jcu);
+                if (module != null) {
+                    return module.getName().toString();
+                }
+            }
+        } catch (IOException ioe) {
+            String text = messager.getText("main.file.manager.list", location);
+            throw new ToolException(SYSERR, text, ioe);
+        }
+        return null;
+    }
+
     @SuppressWarnings("unchecked")
     ElementsTable scanSpecifiedItems() throws ToolException {
 
@@ -349,15 +414,17 @@
                 s -> Collections.EMPTY_LIST);
         List<String> mlist = new ArrayList<>();
         for (String m : moduleNames) {
-            Location moduleLoc = getModuleLocation(location, m);
-            if (moduleLoc == null) {
+            List<Location> moduleLocations = getModuleLocation(locations, m);
+            if (moduleLocations.isEmpty()) {
                 String text = messager.getText("main.module_not_found", m);
                 throw new ToolException(CMDERR, text);
-            } else {
-                mlist.add(m);
-                ModuleSymbol msym = syms.enterModule(names.fromString(m));
-                specifiedModuleElements.add((ModuleElement) msym);
             }
+            if (moduleLocations.contains(StandardLocation.SOURCE_PATH)) {
+                sanityCheckSourcePathModules(moduleNames);
+            }
+            mlist.add(m);
+            ModuleSymbol msym = syms.enterModule(names.fromString(m));
+            specifiedModuleElements.add((ModuleElement) msym);
         }
 
         // scan for modules with qualified packages
@@ -448,35 +515,47 @@
         });
 
         for (ModulePackage modpkg : subPackages) {
-            Location packageLocn = getLocation(modpkg);
-            Iterable<JavaFileObject> list = null;
-            try {
-                list = fm.list(packageLocn, modpkg.packageName, sourceKinds, true);
-            } catch (IOException ioe) {
-                String text = messager.getText("main.file.manager.list", modpkg.packageName);
-                throw new ToolException(SYSERR, text, ioe);
+            List<Location> locs = getLocation(modpkg);
+            for (Location loc : locs) {
+                addPackagesFromLocations(loc, modpkg);
             }
-            for (JavaFileObject fo : list) {
-                String binaryName = fm.inferBinaryName(packageLocn, fo);
-                String pn = getPackageName(binaryName);
-                String simpleName = getSimpleName(binaryName);
-                Entry e = getEntry(pn);
-                if (!e.isExcluded() && isValidClassName(simpleName)) {
-                    ModuleSymbol msym = (modpkg.hasModule())
-                            ? syms.getModule(names.fromString(modpkg.moduleName))
-                            : findModuleOfPackageName(modpkg.packageName);
+        }
+    }
 
-                    if (msym != null && !msym.isUnnamed()) {
-                        syms.enterPackage(msym, names.fromString(pn));
-                        ModulePackage npkg = new ModulePackage(msym.toString(), pn);
-                        cmdLinePackages.add(npkg);
-                    } else {
-                        cmdLinePackages.add(e.modpkg);
-                    }
-                    e.files = (e.files == null
-                            ? com.sun.tools.javac.util.List.of(fo)
-                            : e.files.prepend(fo));
+    /* Call fm.list and wrap any IOException that occurs in a ToolException */
+    private Iterable<JavaFileObject> fmList(Location location,
+                                            String packagename,
+                                            Set<JavaFileObject.Kind> kinds,
+                                            boolean recurse) throws ToolException {
+        try {
+            return fm.list(location, packagename, kinds, recurse);
+        } catch (IOException ioe) {
+            String text = messager.getText("main.file.manager.list", packagename);
+            throw new ToolException(SYSERR, text, ioe);
+        }
+    }
+
+    private void addPackagesFromLocations(Location packageLocn, ModulePackage modpkg) throws ToolException {
+        for (JavaFileObject fo : fmList(packageLocn, modpkg.packageName, sourceKinds, true)) {
+            String binaryName = fm.inferBinaryName(packageLocn, fo);
+            String pn = getPackageName(binaryName);
+            String simpleName = getSimpleName(binaryName);
+            Entry e = getEntry(pn);
+            if (!e.isExcluded() && isValidClassName(simpleName)) {
+                ModuleSymbol msym = (modpkg.hasModule())
+                        ? syms.getModule(names.fromString(modpkg.moduleName))
+                        : findModuleOfPackageName(modpkg.packageName);
+
+                if (msym != null && !msym.isUnnamed()) {
+                    syms.enterPackage(msym, names.fromString(pn));
+                    ModulePackage npkg = new ModulePackage(msym.toString(), pn);
+                    cmdLinePackages.add(npkg);
+                } else {
+                    cmdLinePackages.add(e.modpkg);
                 }
+                e.files = (e.files == null
+                        ? com.sun.tools.javac.util.List.of(fo)
+                        : e.files.prepend(fo));
             }
         }
     }
@@ -484,25 +563,51 @@
     /**
      * Returns the "requires" modules for the target module.
      * @param mdle the target module element
-     * @param isPublic true gets all the public requires, otherwise
-     *                 gets all the non-public requires
+     * @param onlyTransitive true gets all the requires transitive, otherwise
+     *                 gets all the non-transitive requires
      *
      * @return a set of modules
      */
-    private Set<ModuleElement> getModuleRequires(ModuleElement mdle, boolean isPublic) {
+    private Set<ModuleElement> getModuleRequires(ModuleElement mdle, boolean onlyTransitive) throws ToolException {
         Set<ModuleElement> result = new HashSet<>();
         for (RequiresDirective rd : ElementFilter.requiresIn(mdle.getDirectives())) {
-            if (isPublic && rd.isTransitive()) {
-                result.add(rd.getDependency());
-            }
-            if (!isPublic && !rd.isTransitive()) {
-                result.add(rd.getDependency());
+            ModuleElement dep = rd.getDependency();
+            if (result.contains(dep))
+                continue;
+            if (!isMandated(mdle, rd) && onlyTransitive == rd.isTransitive()) {
+                if (!haveModuleSources(dep)) {
+                    messager.printWarning(dep, "main.module_not_found", dep.getSimpleName());
+                }
+                result.add(dep);
+            } else if (isMandated(mdle, rd) && haveModuleSources(dep)) {
+                result.add(dep);
             }
         }
         return result;
     }
 
-    private void computeSpecifiedModules() {
+    private boolean isMandated(ModuleElement mdle, RequiresDirective rd) {
+        return toolEnv.elements.getOrigin(mdle, rd) == MANDATED;
+    }
+
+    Map<ModuleSymbol, Boolean> haveModuleSourcesCache = new HashMap<>();
+    private boolean haveModuleSources(ModuleElement mdle) throws ToolException {
+        ModuleSymbol msym =  (ModuleSymbol)mdle;
+        if (msym.sourceLocation != null) {
+            return true;
+        }
+        if (msym.patchLocation != null) {
+            Boolean value = haveModuleSourcesCache.get(msym);
+            if (value == null) {
+                value = fmList(msym.patchLocation, "", sourceKinds, true).iterator().hasNext();
+                haveModuleSourcesCache.put(msym, value);
+            }
+            return value;
+        }
+        return false;
+    }
+
+    private void computeSpecifiedModules() throws ToolException {
         if (expandRequires == null) { // no expansion requested
             specifiedModuleElements = Collections.unmodifiableSet(specifiedModuleElements);
             return;
@@ -544,20 +649,17 @@
     private Set<PackageElement> getAllModulePackages(ModuleElement mdle) throws ToolException {
         Set<PackageElement> result = new HashSet<>();
         ModuleSymbol msym = (ModuleSymbol) mdle;
-        Location msymloc = getModuleLocation(location, msym.name.toString());
-        try {
-            for (JavaFileObject fo : fm.list(msymloc, "", sourceKinds, true)) {
-                if (fo.getName().endsWith("module-info.java"))
+        List<Location> msymlocs = getModuleLocation(locations, msym.name.toString());
+        for (Location msymloc : msymlocs) {
+            for (JavaFileObject fo : fmList(msymloc, "", sourceKinds, true)) {
+                if (fo.getName().endsWith("module-info.java")) {
                     continue;
+                }
                 String binaryName = fm.inferBinaryName(msymloc, fo);
                 String pn = getPackageName(binaryName);
                 PackageSymbol psym = syms.enterPackage(msym, names.fromString(pn));
                 result.add((PackageElement) psym);
             }
-
-        } catch (IOException ioe) {
-            String text = messager.getText("main.file.manager.list", msymloc.getName());
-            throw new ToolException(SYSERR, text, ioe);
         }
         return result;
     }
@@ -653,10 +755,9 @@
 
         Set<PackageElement> packlist = new LinkedHashSet<>();
         cmdLinePackages.forEach((modpkg) -> {
-            ModuleElement mdle = null;
             PackageElement pkg;
             if (modpkg.hasModule()) {
-                mdle = toolEnv.elements.getModuleElement(modpkg.moduleName);
+                ModuleElement mdle = toolEnv.elements.getModuleElement(modpkg.moduleName);
                 pkg = toolEnv.elements.getPackageElement(mdle, modpkg.packageName);
             } else {
                 pkg = toolEnv.elements.getPackageElement(modpkg.toString());
@@ -741,25 +842,20 @@
         }
 
         ListBuffer<JavaFileObject> lb = new ListBuffer<>();
-        Location packageLocn = getLocation(modpkg);
-        if (packageLocn == null) {
+        List<Location> locs = getLocation(modpkg);
+        if (locs.isEmpty()) {
             return Collections.emptyList();
         }
         String pname = modpkg.packageName;
-
-        try {
-            for (JavaFileObject fo : fm.list(packageLocn, pname, sourceKinds, recurse)) {
+        for (Location packageLocn : locs) {
+            for (JavaFileObject fo : fmList(packageLocn, pname, sourceKinds, recurse)) {
                 String binaryName = fm.inferBinaryName(packageLocn, fo);
                 String simpleName = getSimpleName(binaryName);
                 if (isValidClassName(simpleName)) {
                     lb.append(fo);
                 }
             }
-        } catch (IOException ioe) {
-            String text = messager.getText("main.file.manager.list", pname);
-            throw new ToolException(SYSERR, text, ioe);
         }
-
         return lb.toList();
     }
 
@@ -774,24 +870,49 @@
             return null;
     }
 
-    private Location getLocation(ModulePackage modpkg) throws ToolException {
-        if (location != StandardLocation.MODULE_SOURCE_PATH) {
-            return location;
+    private List<Location> getLocation(ModulePackage modpkg) throws ToolException {
+        if (locations.size() == 1 && !locations.contains(StandardLocation.MODULE_SOURCE_PATH)) {
+            return Collections.singletonList(locations.get(0));
         }
 
         if (modpkg.hasModule()) {
-            return getModuleLocation(location, modpkg.moduleName);
+            return getModuleLocation(locations, modpkg.moduleName);
         }
         // TODO: handle invalid results better.
         ModuleSymbol msym = findModuleOfPackageName(modpkg.packageName);
         if (msym == null) {
-            return null;
+            return Collections.emptyList();
         }
-        return getModuleLocation(location, msym.name.toString());
+        return getModuleLocation(locations, msym.name.toString());
     }
 
-    private Location getModuleLocation(Location location, String msymName)
-            throws ToolException {
+    boolean haveSourceLocationWithModule = false;
+
+    private List<Location> getModuleLocation(List<Location> locations, String msymName) throws ToolException {
+        List<Location> out = new ArrayList<>();
+        // search in the patch module first, this overrides others
+        if (locations.contains(StandardLocation.PATCH_MODULE_PATH)) {
+            Location loc = getModuleLocation(StandardLocation.PATCH_MODULE_PATH, msymName);
+            if (loc != null)
+                out.add(loc);
+        }
+        for (Location location : locations) {
+            // skip patch module, already done
+            if (location == StandardLocation.PATCH_MODULE_PATH) {
+                continue;
+            } else if (location == StandardLocation.MODULE_SOURCE_PATH) {
+                Location loc = getModuleLocation(location, msymName);
+                if (loc != null)
+                    out.add(loc);
+            } else if (location == StandardLocation.SOURCE_PATH) {
+                haveSourceLocationWithModule = true;
+                out.add(StandardLocation.SOURCE_PATH);
+            }
+        }
+        return out;
+    }
+
+    private Location getModuleLocation(Location location, String msymName) throws ToolException {
         try {
             return fm.getLocationForModule(location, msymName);
         } catch (IOException ioe) {
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocEnter.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocEnter.java
index 1af4c21..cffaebc 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocEnter.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocEnter.java
@@ -74,12 +74,14 @@
 
     @Override
     public void main(List<JCCompilationUnit> trees) {
-        // count all Enter errors as warnings.
+        // cache the error count if we need to convert Enter errors as warnings.
         int nerrors = messager.nerrors;
         super.main(trees);
         compiler.enterDone();
-        messager.nwarnings += (messager.nerrors - nerrors);
-        messager.nerrors = nerrors;
+        if (toolEnv.ignoreSourceErrors) {
+            messager.nwarnings += (messager.nerrors - nerrors);
+            messager.nerrors = nerrors;
+        }
     }
 
     @Override
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java
index 89693ae..5f67d50 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java
@@ -160,11 +160,7 @@
             // Parse the files and collect the package names.
             for (String arg: javaNames) {
                 if (fm != null && arg.endsWith(".java") && new File(arg).exists()) {
-                    if (new File(arg).getName().equals("module-info.java")) {
-                        messager.printWarningUsingKey("main.file_ignored", arg);
-                    } else {
-                        parse(fm.getJavaFileObjects(arg), classTrees, true);
-                    }
+                    parse(fm.getJavaFileObjects(arg), classTrees, true);
                 } else if (isValidPackageName(arg)) {
                     packageNames.add(arg);
                 } else if (arg.endsWith(".java")) {
@@ -188,6 +184,11 @@
                     .classTrees(classTrees.toList())
                     .scanSpecifiedItems();
 
+            // abort, if errors were encountered during modules initialization
+            if (messager.hasErrors()) {
+                return null;
+            }
+
             // Parse the files in the packages and subpackages to be documented
             ListBuffer<JCCompilationUnit> packageTrees = new ListBuffer<>();
             parse(etable.getFilesToParse(), packageTrees, false);
@@ -200,6 +201,11 @@
             // Enter symbols for all files
             toolEnv.notice("main.Building_tree");
             javadocEnter.main(classTrees.toList().appendList(packageTrees));
+
+            if (messager.hasErrors()) {
+                return null;
+            }
+
             etable.setClassDeclList(listClasses(classTrees.toList()));
 
             etable.analyze();
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java
index 7f31da1..7fb5130 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -88,12 +88,11 @@
  */
 public class Start extends ToolOption.Helper {
 
-    @SuppressWarnings("deprecation")
-    private static final Class<?> OldStdDoclet =
-            com.sun.tools.doclets.standard.Standard.class;
+    private static final String OldStdDocletName =
+        "com.sun.tools.doclets.standard.Standard";
 
     private static final Class<?> StdDoclet =
-            jdk.javadoc.doclets.StandardDoclet.class;
+            jdk.javadoc.doclet.StandardDoclet.class;
     /** Context for this invocation. */
     private final Context context;
 
@@ -334,7 +333,7 @@
                     messager.getWriter(WriterKind.ERROR),
                     messager.getWriter(WriterKind.WARNING),
                     messager.getWriter(WriterKind.NOTICE),
-                    "com.sun.tools.doclets.standard.Standard",
+                    OldStdDocletName,
                     nargv);
             return (rc == 0) ? OK : ERROR;
         }
@@ -421,9 +420,7 @@
 
         Result result = OK;
         try {
-            result = parseAndExecute(options, fileObjects)
-                    ? OK
-                    : ERROR;
+            result = parseAndExecute(options, fileObjects);
         } catch (com.sun.tools.javac.main.Option.InvalidValueException e) {
             messager.printError(e.getMessage());
             Throwable t = e.getCause();
@@ -501,7 +498,7 @@
      * Main program - internal
      */
     @SuppressWarnings("unchecked")
-    private boolean parseAndExecute(List<String> argList, Iterable<? extends JavaFileObject> fileObjects)
+    private Result parseAndExecute(List<String> argList, Iterable<? extends JavaFileObject> fileObjects)
             throws ToolException, OptionException, com.sun.tools.javac.main.Option.InvalidValueException {
         long tm = System.currentTimeMillis();
 
@@ -515,61 +512,35 @@
         } catch (com.sun.tools.javac.main.Option.InvalidValueException ignore) {
         }
 
-        doclet.init(locale, messager);
-        parseArgs(argList, javaNames);
-
         Arguments arguments = Arguments.instance(context);
         arguments.init(ProgramName);
         arguments.allowEmpty();
-        arguments.validate();
+
+        doclet.init(locale, messager);
+        parseArgs(argList, javaNames);
+
+        if (!arguments.handleReleaseOptions(extra -> true)) {
+            // Arguments does not always increase the error count in the
+            // case of errors, so increment the error count only if it has
+            // not been updated previously, preventing complaints by callers
+            if (!messager.hasErrors() && !messager.hasWarnings())
+                messager.nerrors++;
+            return CMDERR;
+        }
+
+        if (!arguments.validate()) {
+            // Arguments does not always increase the error count in the
+            // case of errors, so increment the error count only if it has
+            // not been updated previously, preventing complaints by callers
+            if (!messager.hasErrors() && !messager.hasWarnings())
+                messager.nerrors++;
+            return CMDERR;
+        }
 
         if (fileManager instanceof BaseFileManager) {
             ((BaseFileManager) fileManager).handleOptions(fileManagerOpts);
         }
 
-        String platformString = compOpts.get("--release");
-
-        if (platformString != null) {
-            if (compOpts.isSet("-source")) {
-                String text = messager.getText("main.release.bootclasspath.conflict", "-source");
-                throw new ToolException(CMDERR, text);
-            }
-            if (fileManagerOpts.containsKey(BOOT_CLASS_PATH)) {
-                String text = messager.getText("main.release.bootclasspath.conflict",
-                        BOOT_CLASS_PATH.getPrimaryName());
-                throw new ToolException(CMDERR, text);
-            }
-
-            PlatformDescription platformDescription =
-                    PlatformUtils.lookupPlatformDescription(platformString);
-
-            if (platformDescription == null) {
-                String text = messager.getText("main.unsupported.release.version", platformString);
-                throw new IllegalArgumentException(text);
-            }
-
-            compOpts.put(SOURCE, platformDescription.getSourceVersion());
-
-            context.put(PlatformDescription.class, platformDescription);
-
-            Collection<Path> platformCP = platformDescription.getPlatformPath();
-
-            if (platformCP != null) {
-                if (fileManager instanceof StandardJavaFileManager) {
-                    StandardJavaFileManager sfm = (StandardJavaFileManager) fileManager;
-                    try {
-                        sfm.setLocationFromPaths(StandardLocation.PLATFORM_CLASS_PATH, platformCP);
-                    } catch (IOException ioe) {
-                        throw new ToolException(SYSERR, ioe.getMessage(), ioe);
-                    }
-                } else {
-                    String text = messager.getText("main.release.not.standard.file.manager",
-                                                    platformString);
-                    throw new ToolException(ABNORMAL, text);
-                }
-            }
-        }
-
         compOpts.notifyListeners();
         List<String> modules = (List<String>) jdtoolOpts.computeIfAbsent(ToolOption.MODULE,
                 s -> Collections.EMPTY_LIST);
@@ -586,7 +557,7 @@
         }
 
         JavadocTool comp = JavadocTool.make0(context);
-        if (comp == null) return false;
+        if (comp == null) return ABNORMAL;
 
         DocletEnvironment docEnv = comp.getEnvironment(jdtoolOpts,
                 javaNames,
@@ -600,8 +571,9 @@
             trees.setBreakIterator(BreakIterator.getSentenceInstance(locale));
         }
         // pass off control to the doclet
-        boolean ok = docEnv != null;
-        if (ok) ok = doclet.run(docEnv);
+        Result returnStatus = docEnv != null && doclet.run(docEnv)
+                ? OK
+                : ERROR;
 
         // We're done.
         if (compOpts.get("-verbose") != null) {
@@ -609,7 +581,7 @@
             messager.notice("main.done_in", Long.toString(tm));
         }
 
-        return ok;
+        return returnStatus;
     }
 
     boolean matches(List<String> names, String arg) {
@@ -791,27 +763,31 @@
 
         // Step 4: we have a doclet, try loading it
         if (docletName != null) {
-            try {
-                return Class.forName(docletName, true, getClass().getClassLoader());
-            } catch (ClassNotFoundException cnfe) {
-                if (apiMode) {
-                    throw new IllegalArgumentException("Cannot find doclet class " + userDocletName);
-                }
-                String text = messager.getText("main.doclet_class_not_found", userDocletName);
-                throw new ToolException(CMDERR, text, cnfe);
-            }
+            return loadDocletClass(docletName);
         }
 
         // Step 5: we don't have a doclet specified, do we have taglets ?
         if (!userTagletNames.isEmpty() && hasOldTaglet(userTagletNames, userTagletPath)) {
             // found a bogey, return the old doclet
-            return OldStdDoclet;
+            return loadDocletClass(OldStdDocletName);
         }
 
         // finally
         return StdDoclet;
     }
 
+    private Class<?> loadDocletClass(String docletName) throws ToolException {
+        try {
+            return Class.forName(docletName, true, getClass().getClassLoader());
+        } catch (ClassNotFoundException cnfe) {
+            if (apiMode) {
+                throw new IllegalArgumentException("Cannot find doclet class " + docletName);
+            }
+            String text = messager.getText("main.doclet_class_not_found", docletName);
+            throw new ToolException(CMDERR, text, cnfe);
+        }
+    }
+
     /*
      * This method returns true iff it finds a legacy taglet, but for
      * all other conditions including errors it returns false, allowing
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolEnvironment.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolEnvironment.java
index 22550d0..c568d1d 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolEnvironment.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolEnvironment.java
@@ -103,11 +103,12 @@
 
     final Symbol externalizableSym;
 
-    /**
-     * True if we do not want to print any notifications at all.
-     */
+    /** If true, prevent printing of any notifications. */
     boolean quiet = false;
 
+    /** If true, ignore all errors encountered during Enter. */
+    boolean ignoreSourceErrors = false;
+
     Check chk;
     com.sun.tools.javac.code.Types types;
     JavaFileManager fileManager;
@@ -163,6 +164,7 @@
 
     public void initialize(Map<ToolOption, Object> toolOpts) {
         this.quiet = (boolean)toolOpts.getOrDefault(ToolOption.QUIET, false);
+        this.ignoreSourceErrors = (boolean)toolOpts.getOrDefault(ToolOption.IGNORE_SOURCE_ERRORS, false);
     }
 
     /**
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java
index 2a60a07..5b338f4 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -181,13 +181,6 @@
         }
     },
 
-    XMODULE("-Xmodule:", EXTENDED, false) {
-        @Override
-        public void process(Helper helper, String arg) throws InvalidValueException {
-            Option.XMODULE.process(helper.getOptionHelper(), arg);
-        }
-    },
-
     PATCH_MODULE("--patch-module", EXTENDED, true) {
         @Override
         public void process(Helper helper, String arg) throws InvalidValueException {
@@ -336,6 +329,13 @@
         }
     },
 
+    IGNORE_SOURCE_ERRORS("--ignore-source-errors", HIDDEN) {
+        @Override
+        public void process(Helper helper) {
+            helper.jdtoolOpts.put(IGNORE_SOURCE_ERRORS, true);
+        }
+    },
+
     // ----- help options -----
 
     HELP("--help -help", STANDARD) {
@@ -345,7 +345,7 @@
         }
     },
 
-    X("-X", STANDARD) {
+    HELP_EXTRA("--help-extra -X", STANDARD) {
         @Override
         public void process(Helper helper) throws OptionException {
            throw new OptionException(OK, helper::Xusage);
@@ -419,9 +419,7 @@
 
     static ToolOption get(String name) {
         String oname = name;
-        if (name.contains(":")) {
-            oname = name.substring(0, name.indexOf(':') + 1);
-        } else if (name.contains("=")) {
+        if (name.startsWith("--") && name.contains("=")) {
             oname = name.substring(0, name.indexOf('='));
         }
         for (ToolOption o : values()) {
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties
index 7985449..77ed152 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -85,10 +85,10 @@
 main.opt.expand.requires.desc=\
     Instructs the tool to expand the set of modules to be\n\
     documented. By default, only the modules given explicitly on\n\
-    the command line will be documented. A value of "transitive" will\n\
-    additionally include all "requires transitive" dependencies of\n\
-    those modules. A value of "all" will include all dependencies\n\
-    of those modules.
+    the command line will be documented. A value of "transitive"\n\
+    will additionally include all "requires transitive"\n\
+    dependencies of those modules. A value of "all" will include\n\
+    all dependencies of those modules.
 
 main.opt.help.desc=\
     Display command line options and exit
@@ -205,7 +205,7 @@
 main.opt.J.desc=\
     Pass <flag> directly to the runtime system
 
-main.opt.X.desc=\
+main.opt.help.extra.desc=\
     Print a synopsis of nonstandard options and exit
 
 main.usage.foot=\n\
@@ -238,11 +238,6 @@
     given module. <other-module> may be ALL-UNNAMED to require\n\
     the unnamed module.
 
-main.opt.Xmodule.arg=\
-    <module-name>
-main.opt.Xmodule.desc=\
-    Specify a module to which the classes being compiled belong
-
 main.opt.patch.module.arg=\
     <module>=<file>(:<file>)*
 main.opt.patch.module.desc=\
@@ -263,6 +258,9 @@
 main.invalid_flag=invalid flag: {0}
 main.No_modules_packages_or_classes_specified=No modules, packages or classes specified.
 main.module_not_found=module {0} not found.\n
+main.cannot_use_sourcepath_for_modules=cannot use source path for multiple modules {0}
+main.module_not_found_on_sourcepath=module {0} not found on source path
+main.sourcepath_does_not_contain_module=source path does not contain module {0}
 main.cant.read=cannot read {0}
 main.Loading_source_files_for_package=Loading source files for package {0}...
 main.Loading_source_file=Loading source file {0}...
@@ -283,13 +281,9 @@
 main.illegal_locale_name=Locale not available: {0}
 main.malformed_locale_name=Malformed locale name: {0}
 main.file_not_found=File not found: "{0}"
-main.file_ignored=File ignored: "{0}" (not yet supported)
 main.illegal_class_name=Illegal class name: "{0}"
 main.illegal_package_name=Illegal package name: "{0}"
 main.illegal_option_value=Illegal option value: "{0}"
-main.release.bootclasspath.conflict=option {0} cannot be used together with -release
-main.unsupported.release.version=release version {0} not supported
-main.release.not.standard.file.manager=-release option specified, but the provided JavaFileManager is not a StandardJavaFileManager.
 main.file.manager.list=FileManager error listing files: "{0}"
 main.assertion.error=assertion failed: "{0}}"
 main.unknown.error=an unknown error has occurred
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc_ja.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc_ja.properties
index e510b5b..7782e03 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc_ja.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
 main.opt.show.module.contents.desc=\u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u306E\u7C92\u5EA6\u3092\u6307\u5B9A\u3059\u308B\u3002\n\u4F7F\u7528\u53EF\u80FD\u306A\u5024\u306F\u3001"api"\u307E\u305F\u306F"all"\u3067\u3059\u3002
 
 main.opt.expand.requires.arg=<value>
-main.opt.expand.requires.desc=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30BB\u30C3\u30C8\u3092\u62E1\u5F35\u3059\u308B\u305F\u3081\u306E\n\u30C4\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3067\u660E\u793A\u7684\u306B\n\u6307\u5B9A\u3055\u308C\u305F\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u307F\u304C\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u307E\u3059\u3002"public"\u306E\u5024\u306F\u3001\n\u305D\u308C\u3089\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u3059\u3079\u3066\u306E"requires public"\u4F9D\u5B58\u6027\u3092\u8FFD\u52A0\u3067\n\u542B\u3081\u307E\u3059\u3002"all"\u306E\u5024\u306F\u3001\u305D\u308C\u3089\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u3059\u3079\u3066\u306E\u4F9D\u5B58\u6027\u3092\n\u542B\u3081\u307E\u3059\u3002
+main.opt.expand.requires.desc=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30BB\u30C3\u30C8\u3092\u62E1\u5F35\u3059\u308B\u305F\u3081\u306E\n\u30C4\u30FC\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3067\u660E\u793A\u7684\u306B\n\u6307\u5B9A\u3055\u308C\u305F\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u307F\u304C\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u307E\u3059\u3002"transitive"\u306E\u5024\u306F\u3001\n\u305D\u308C\u3089\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u3059\u3079\u3066\u306E"requires transitive"\u4F9D\u5B58\u6027\u3092\u8FFD\u52A0\u3067\n\u542B\u3081\u307E\u3059\u3002"all"\u306E\u5024\u306F\u3001\u305D\u308C\u3089\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u3059\u3079\u3066\u306E\u4F9D\u5B58\u6027\u3092\n\u542B\u3081\u307E\u3059\u3002
 
 main.opt.help.desc=\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B
 
diff --git a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc_zh_CN.properties b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc_zh_CN.properties
index 086827c..8cade49 100644
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc_zh_CN.properties
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/resources/javadoc_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
 main.opt.show.module.contents.desc=\u6307\u5B9A\u6A21\u5757\u58F0\u660E\u7684\u6587\u6863\u7C92\u5EA6\u3002\n\u53EF\u80FD\u7684\u503C\u4E3A "api" \u6216 "all"\u3002
 
 main.opt.expand.requires.arg=<\u503C>
-main.opt.expand.requires.desc=\u6307\u793A\u5DE5\u5177\u5C55\u5F00\u8981\u6587\u6863\u5316\u7684\u6A21\u5757\u96C6\u3002\n\u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u4EC5\u6587\u6863\u5316\u547D\u4EE4\u884C\u4E2D\u660E\u786E\n\u6307\u5B9A\u7684\u6A21\u5757\u3002\u503C "public" \u5C06\u989D\u5916\u5305\u542B\n\u8FD9\u4E9B\u6A21\u5757\u7684\u6240\u6709 "requires public"\n\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\u503C "all" \u5C06\u5305\u542B\u8FD9\u4E9B\u6A21\u5757\n\u7684\u6240\u6709\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002
+main.opt.expand.requires.desc=\u6307\u793A\u5DE5\u5177\u5C55\u5F00\u8981\u6587\u6863\u5316\u7684\u6A21\u5757\u96C6\u3002\n\u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u5C06\u4EC5\u6587\u6863\u5316\u547D\u4EE4\u884C\u4E2D\u660E\u786E\n\u6307\u5B9A\u7684\u6A21\u5757\u3002\u503C "transitive" \u5C06\u989D\u5916\u5305\u542B\n\u8FD9\u4E9B\u6A21\u5757\u7684\u6240\u6709 "requires transitive"\n\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\u503C "all" \u5C06\u5305\u542B\u8FD9\u4E9B\u6A21\u5757\n\u7684\u6240\u6709\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002
 
 main.opt.help.desc=\u663E\u793A\u547D\u4EE4\u884C\u9009\u9879\u5E76\u9000\u51FA
 
diff --git a/langtools/src/jdk.javadoc/share/classes/module-info.java b/langtools/src/jdk.javadoc/share/classes/module-info.java
index 7690a69..8e7d4e1 100644
--- a/langtools/src/jdk.javadoc/share/classes/module-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/module-info.java
@@ -26,6 +26,9 @@
 /** Defines the implementation of the
  *  {@link javax.tools.ToolProvider#getSystemDocumentationTool system documentation tool}
  *  and its command line equivalent, <em>javadoc</em>.
+ *
+ *  @moduleGraph
+ *  @since 9
  */
 module jdk.javadoc {
     requires transitive java.compiler;
@@ -38,8 +41,6 @@
     exports com.sun.tools.javadoc;
 
     exports jdk.javadoc.doclet;
-    exports jdk.javadoc.doclet.taglet;
-    exports jdk.javadoc.doclets;
 
     provides java.util.spi.ToolProvider
         with jdk.javadoc.internal.tool.JavadocToolProvider;
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java
index f1e0b60..a093fb7 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java
@@ -618,7 +618,6 @@
         public Void visitModuleTarget(ModuleTarget_attribute attr, ClassOutputStream out) {
             out.writeShort(attr.os_name_index);
             out.writeShort(attr.os_arch_index);
-            out.writeShort(attr.os_version_index);
             return null;
         }
 
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java
index 630eac1..ca317ad 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java
@@ -40,7 +40,6 @@
         super(name_index, length);
         os_name_index = cr.readUnsignedShort();
         os_arch_index = cr.readUnsignedShort();
-        os_version_index = cr.readUnsignedShort();
     }
 
     @Override
@@ -50,5 +49,4 @@
 
     public final int os_name_index;
     public final int os_arch_index;
-    public final int os_version_index;
 }
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Module_attribute.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Module_attribute.java
index 67f9c75..6b0b525 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Module_attribute.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Module_attribute.java
@@ -38,8 +38,8 @@
  *  deletion without notice.</b>
  */
 public class Module_attribute extends Attribute {
-    public static final int ACC_TRANSITIVE      =   0x10;
-    public static final int ACC_STATIC_PHASE    =   0x20;
+    public static final int ACC_TRANSITIVE      =   0x20;
+    public static final int ACC_STATIC_PHASE    =   0x40;
     public static final int ACC_OPEN            =   0x20;
     public static final int ACC_SYNTHETIC       = 0x1000;
     public static final int ACC_MANDATED        = 0x8000;
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
index 00f09d0..c5950a1 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
@@ -680,12 +680,6 @@
             print("// " + getOSArch(attr));
         }
         println();
-        print("os_version: #" + attr.os_version_index);
-        if (attr.os_version_index != 0) {
-            tab();
-            print("// " + getOSVersion(attr));
-        }
-        println();
         indent(-1);
         return null;
     }
@@ -706,14 +700,6 @@
         }
     }
 
-    private String getOSVersion(ModuleTarget_attribute attr) {
-        try {
-            return constant_pool.getUTF8Value(attr.os_version_index);
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
-
     @Override
     public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, Void ignore) {
         println("RuntimeVisibleAnnotations:");
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_ja.properties b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_ja.properties
index dbde9ce..5cdac48 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_ja.properties
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_ja.properties
@@ -25,7 +25,7 @@
 main.usage.summary=\u4F7F\u7528\u65B9\u6CD5: {0} <options> <classes>\n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001-help\u3092\u4F7F\u7528\u3057\u307E\u3059
 
 warn.prefix=\u8B66\u544A:
-warn.unexpected.class=\u30D0\u30A4\u30CA\u30EA\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306B{1}\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059
+warn.unexpected.class=\u30D5\u30A1\u30A4\u30EB{0}\u306B\u30AF\u30E9\u30B9{1}\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093
 
 note.prefix=\u6CE8:
 
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties
index 74b5cca..9aaafbc 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties
@@ -25,7 +25,7 @@
 main.usage.summary=\u7528\u6CD5: {0} <options> <classes>\n\u4F7F\u7528 -help \u5217\u51FA\u53EF\u80FD\u7684\u9009\u9879
 
 warn.prefix=\u8B66\u544A:
-warn.unexpected.class=\u4E8C\u8FDB\u5236\u6587\u4EF6{0}\u5305\u542B{1}
+warn.unexpected.class=\u6587\u4EF6 {0} \u4E0D\u5305\u542B\u7C7B {1}
 
 note.prefix=\u6CE8:
 
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan.properties b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan.properties
index a5cc3a5..a30511c 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan.properties
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan.properties
@@ -75,24 +75,52 @@
 
 scan.process.class=Processing class {0}...
 
+# The "removal tag": empty for normal deprecations,
+# nonempty for removal deprecations; do not translate.
 scan.dep.normal=
 scan.dep.removal=(forRemoval=true)
 
 scan.err.exception=error: unexpected exception {0}
 scan.err.noclass=error: cannot find class {0}
 scan.err.nofile=error: cannot find file {0}
+
+# 0: class name, 1: method name, 2: parameter and return types
 scan.err.nomethod=error: cannot resolve Methodref {0}.{1}:{2}
 
 scan.head.jar=Jar file {0}:
 scan.head.dir=Directory {0}:
 
+# In all of the messages below, 0 and 1 are as follows:
+#   0: type kind (class, interface, enum, or annotation type)
+#   1: type name
+# The last element is generally a "removal tag"; see above.
+
+# 2: class name, 3: removal tag
 scan.out.extends={0} {1} extends deprecated class {2} {3}
+
+# 2: interface name, 3: removal tag
 scan.out.implements={0} {1} implements deprecated interface {2} {3}
+
+# 2: class name, 3: removal tag
 scan.out.usesclass={0} {1} uses deprecated class {2} {3}
+
+# 2: class name, 3: method name, 4: method parameter and return types, 5: removal tag
 scan.out.usesmethod={0} {1} uses deprecated method {2}::{3}{4} {5}
+
+# 2: class name, 3: method name, 4: method parameter and return types, 5: removal tag
 scan.out.usesintfmethod={0} {1} uses deprecated method {2}::{3}{4} {5}
+
+# 2: class name, 3: field name, 4: removal tag
 scan.out.usesfield={0} {1} uses deprecated field {2}::{3} {4}
+
+# 2: field name, 3: type name, 4: removal tag
 scan.out.hasfield={0} {1} has field named {2} of deprecated type {3} {4}
+
+# 2: method name, 3: parameter type, 4: removal tag
 scan.out.methodparmtype={0} {1} has method named {2} having deprecated parameter type {3} {4}
+
+# 2: method name, 3: return type, 4: removal tag
 scan.out.methodrettype={0} {1} has method named {2} having deprecated return type {3} {4}
+
+# 2: class name, 3: method name, 4: method parameter and return types, 5: removal tag
 scan.out.methodoverride={0} {1} overrides deprecated method {2}::{3}{4} {5}
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan_ja.properties b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan_ja.properties
new file mode 100644
index 0000000..b9f505a
--- /dev/null
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan_ja.properties
@@ -0,0 +1,29 @@
+main.usage=\u4F7F\u7528\u65B9\u6CD5: jdeprscan [options] '{dir|jar|class}' ...\n\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n       --class-path PATH\n       --for-removal\n       --full-version\n  -h   --help\n  -l   --list\n       --release 6|7|8|9\n  -v   --verbose\n       --version
+
+main.help=\u975E\u63A8\u5968API\u306E\u4F7F\u7528\u306B\u3064\u3044\u3066\u5404\u5F15\u6570\u3092\u30B9\u30AD\u30E3\u30F3\u3057\u307E\u3059\u3002\u5F15\u6570\u306B\u306F\u3001\n\u30D1\u30C3\u30B1\u30FC\u30B8\u968E\u5C64\u306E\u30EB\u30FC\u30C8\u3092\u6307\u5B9A\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001JAR\u30D5\u30A1\u30A4\u30EB\u3001\n\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30AF\u30E9\u30B9\u540D\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\u30AF\u30E9\u30B9\u540D\u306F\u3001\n\u5B8C\u5168\u4FEE\u98FE\u30AF\u30E9\u30B9\u540D\u3092\u4F7F\u7528\u3057\u3066\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30CD\u30B9\u30C8\u3055\u308C\u305F\n\u30AF\u30E9\u30B9\u306F$\u3067\u533A\u5207\u308A\u307E\u3059\u3002\u4F8B:\n\n    java.lang.Thread$State\n\n--class-path\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u4F9D\u5B58\u3059\u308B\u30AF\u30E9\u30B9\u306E\u89E3\u6C7A\u306E\u305F\u3081\u306E\n\u691C\u7D22\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\n\n--for-removal\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u30B9\u30AD\u30E3\u30F3\u3068\u30EA\u30B9\u30C8\u5316\u3092\u524A\u9664\u4E88\u5B9A\u3067\u975E\u63A8\u5968\u306EAPI\u306B\n\u9650\u5B9A\u3057\u307E\u3059\u3002\u30EA\u30EA\u30FC\u30B9\u5024\u304C6\u30017\u307E\u305F\u306F8\u306E\u5834\u5408\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n\n--full-version\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u30C4\u30FC\u30EB\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u306E\u5168\u4F53\u3092\u51FA\u529B\u3057\u307E\u3059\u3002\n\n--help\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u5168\u4F53\u3092\u51FA\u529B\u3057\u307E\u3059\u3002\n\n--list (-l)\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u63A8\u5968API\u30BB\u30C3\u30C8\u3092\u51FA\u529B\u3057\u307E\u3059\u3002\u30B9\u30AD\u30E3\u30F3\u306F\u884C\u308F\u308C\u306A\u3044\n\u305F\u3081\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001JAR\u307E\u305F\u306F\u30AF\u30E9\u30B9\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n\n--release\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u30B9\u30AD\u30E3\u30F3\u3059\u308B\u975E\u63A8\u5968API\u306E\u30BB\u30C3\u30C8\u3092\u63D0\u4F9B\u3059\u308BJava SE\n\u30EA\u30EA\u30FC\u30B9\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\n\n--verbose (-v)\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3059\u308B\u3068\u3001\u51E6\u7406\u4E2D\u306B\u8FFD\u52A0\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3067\u304D\u307E\u3059\u3002\n\n--version\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u7C21\u7565\u5316\u3055\u308C\u305F\u30C4\u30FC\u30EB\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u6587\u5B57\u5217\u3092\u51FA\u529B\u3057\u307E\u3059\u3002
+
+main.xhelp=\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30AA\u30D7\u30B7\u30E7\u30F3:\n\n  --Xload-class CLASS\n      \u6307\u5B9A\u3057\u305F\u30AF\u30E9\u30B9\u304B\u3089\u975E\u63A8\u5968\u60C5\u5831\u3092\u30ED\u30FC\u30C9\u3057\u307E\u3059\u3002\n  --Xload-csv CSVFILE\n      \u6307\u5B9A\u3057\u305FCSV\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u975E\u63A8\u5968\u60C5\u5831\u3092\u30ED\u30FC\u30C9\u3057\u307E\u3059\u3002\n  --Xload-dir DIR\n      \u6307\u5B9A\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3042\u308B\u30AF\u30E9\u30B9\u968E\u5C64\u304B\u3089\u975E\u63A8\u5968\u60C5\u5831\u3092\n      \u30ED\u30FC\u30C9\u3057\u307E\u3059\u3002\n  --Xload-jar JARFILE\n      \u6307\u5B9A\u3057\u305FJAR\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u975E\u63A8\u5968\u60C5\u5831\u3092\u30ED\u30FC\u30C9\u3057\u307E\u3059\u3002\n  --Xload-jdk9 JAVA_HOME\n      JAVA_HOME\u306B\u3042\u308BJDK\u304B\u3089\u975E\u63A8\u5968\u60C5\u5831\u3092\u30ED\u30FC\u30C9\u3057\u307E\u3059\u3002\n      \u30E2\u30B8\u30E5\u30E9JDK\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n  --Xload-old-jdk JAVA_HOME\n      JAVA_HOME\u306B\u3042\u308BJDK\u304B\u3089\u975E\u63A8\u5968\u60C5\u5831\u3092\u30ED\u30FC\u30C9\u3057\u307E\u3059\u3002\n      \u30E2\u30B8\u30E5\u30E9JDK\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u6307\u5B9A\u3057\u305FJDK\u306F\n      rt.jar\u30D5\u30A1\u30A4\u30EB\u3092\u6301\u3064"\u30AF\u30E9\u30B7\u30C3\u30AF"\u306AJDK\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n  --Xload-self\n      \u5B9F\u884C\u4E2DJDK\u30A4\u30E1\u30FC\u30B8\u306Ejrt:\u30D5\u30A1\u30A4\u30EB\u30B7\u30B9\u30C6\u30E0\u3092\u8D70\u67FB\u3059\u308B\u3053\u3068\u306B\u3088\u308A\n      \u975E\u63A8\u5968\u60C5\u5831\u3092\u30ED\u30FC\u30C9\u3057\u307E\u3059\u3002\n  --Xcompiler-arg ARG\n      \u30B3\u30F3\u30D1\u30A4\u30E9\u5F15\u6570\u306E\u30EA\u30B9\u30C8\u306BARG\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n  --Xcsv-comment COMMENT\n      \u30B3\u30E1\u30F3\u30C8\u884C\u3068\u3057\u3066COMMENT\u3092\u51FA\u529BCSV\u30D5\u30A1\u30A4\u30EB\u306B\u8FFD\u52A0\u3057\u307E\u3059\u3002\n      -Xprint-csv\u3082\u6307\u5B9A\u3057\u305F\u5834\u5408\u306E\u307F\u6709\u52B9\u3067\u3059\u3002\n  --Xhelp\n      \u3053\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3057\u307E\u3059\u3002\n  --Xprint-csv\n      \u3042\u3089\u3086\u308B\u30AF\u30E9\u30B9\u307E\u305F\u306FJAR\u30D5\u30A1\u30A4\u30EB\u3092\u30B9\u30AD\u30E3\u30F3\u3059\u308B\u304B\u308F\u308A\u306B\n      \u30ED\u30FC\u30C9\u3057\u305F\u975E\u63A8\u5968\u60C5\u5831\u3092\u542B\u3080CSV\u30D5\u30A1\u30A4\u30EB\u3092\u51FA\u529B\u3057\u307E\u3059\u3002
+
+scan.process.class=\u51E6\u7406\u30AF\u30E9\u30B9 {0}...
+
+scan.dep.normal=
+scan.dep.removal=(forRemoval=true)
+
+scan.err.exception=\u30A8\u30E9\u30FC: \u4E88\u671F\u3057\u306A\u3044\u4F8B\u5916{0}
+scan.err.noclass=\u30A8\u30E9\u30FC: \u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
+scan.err.nofile=\u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
+scan.err.nomethod=\u30A8\u30E9\u30FC: Methodref {0}.{1}:{2}\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093
+
+scan.head.jar=JAR\u30D5\u30A1\u30A4\u30EB {0}:
+scan.head.dir=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA {0}:
+
+scan.out.extends={0} {1}\u304C\u975E\u63A8\u5968\u306E\u30AF\u30E9\u30B9{2}\u3092\u62E1\u5F35\u3057\u3066\u3044\u307E\u3059 {3}
+scan.out.implements={0} {1}\u304C\u975E\u63A8\u5968\u306E\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{2}\u3092\u5B9F\u88C5\u3057\u3066\u3044\u307E\u3059 {3}
+scan.out.usesclass={0} {1}\u304C\u975E\u63A8\u5968\u306E\u30AF\u30E9\u30B9{2}\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059 {3}
+scan.out.usesmethod={0} {1}\u304C\u975E\u63A8\u5968\u30E1\u30BD\u30C3\u30C9{2}::{3}{4}\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059 {5}
+scan.out.usesintfmethod={0} {1}\u304C\u975E\u63A8\u5968\u30E1\u30BD\u30C3\u30C9{2}::{3}{4}\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059 {5}
+scan.out.usesfield={0} {1}\u304C\u975E\u63A8\u5968\u30D5\u30A3\u30FC\u30EB\u30C9{2}::{3}{4}\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059
+scan.out.hasfield={0} {1}\u306B\u306F\u3001\u975E\u63A8\u5968\u306E\u30BF\u30A4\u30D7{3} {4}\u306E\u3001{2}\u3068\u3044\u3046\u540D\u524D\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3042\u308A\u307E\u3059
+scan.out.methodparmtype={0} {1}\u306B\u306F\u3001\u975E\u63A8\u5968\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30BF\u30A4\u30D7{3} {4}\u3092\u6301\u3064{2}\u3068\u3044\u3046\u540D\u524D\u306E\u30E1\u30BD\u30C3\u30C9\u304C\u3042\u308A\u307E\u3059
+scan.out.methodrettype={0} {1}\u306B\u306F\u3001\u975E\u63A8\u5968\u306E\u623B\u308A\u30BF\u30A4\u30D7{3} {4}\u3092\u6301\u3064{2}\u3068\u3044\u3046\u540D\u524D\u306E\u30E1\u30BD\u30C3\u30C9\u304C\u3042\u308A\u307E\u3059
+scan.out.methodoverride={0} {1}\u304C\u975E\u63A8\u5968\u30E1\u30BD\u30C3\u30C9{2}::{3}{4}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059 {5}
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan_zh_CN.properties b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan_zh_CN.properties
new file mode 100644
index 0000000..023b872
--- /dev/null
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/resources/jdeprscan_zh_CN.properties
@@ -0,0 +1,29 @@
+main.usage=\u7528\u6CD5: jdeprscan [\u9009\u9879] '{dir|jar|class}' ...\n\n\u9009\u9879:\n       --class-path PATH\n       --for-removal\n       --full-version\n  -h   --help\n  -l   --list\n       --release 6|7|8|9\n  -v   --verbose\n       --version
+
+main.help=\u626B\u63CF\u6BCF\u4E2A\u53C2\u6570\u4EE5\u4E86\u89E3\u662F\u5426\u4F7F\u7528\u4E86\u8FC7\u65F6\u7684 API\u3002\n\u53C2\u6570\u53EF\u4EE5\u662F\u6307\u5B9A\u7A0B\u5E8F\u5305\u5206\u5C42\u7ED3\u6784, JAR \u6587\u4EF6, \n\u7C7B\u6587\u4EF6\u6216\u7C7B\u540D\u7684\u6839\u7684\u76EE\u5F55\u3002\u7C7B\u540D\u5FC5\u987B\n\u4F7F\u7528\u5168\u9650\u5B9A\u7C7B\u540D\u6307\u5B9A, \u5E76\u4F7F\u7528 $ \u5206\u9694\u7B26\n\u6307\u5B9A\u5D4C\u5957\u7C7B, \u4F8B\u5982,\n\n    java.lang.Thread$State\n\n--class-path \u9009\u9879\u63D0\u4F9B\u4E86\u7528\u4E8E\u89E3\u6790\u4ECE\u5C5E\u7C7B\u7684\n\u641C\u7D22\u8DEF\u5F84\u3002\n\n--for-removal \u9009\u9879\u9650\u5236\u626B\u63CF\u6216\u5217\u51FA\u5DF2\u8FC7\u65F6\u5E76\u5F85\u5220\u9664\n\u7684 API\u3002\u4E0D\u80FD\u4E0E\u53D1\u884C\u7248\u503C 6, 7 \u6216 8 \u4E00\u8D77\u4F7F\u7528\u3002\n\n--full-version \u9009\u9879\u8F93\u51FA\u5DE5\u5177\u7684\u5B8C\u6574\u7248\u672C\u5B57\u7B26\u4E32\u3002\n\n--help \u9009\u9879\u8F93\u51FA\u5B8C\u6574\u7684\u5E2E\u52A9\u6D88\u606F\u3002\n\n--list (-l) \u9009\u9879\u8F93\u51FA\u4E00\u7EC4\u5DF2\u8FC7\u65F6\u7684 API\u3002\u4E0D\u6267\u884C\u626B\u63CF, \n\u56E0\u6B64\u4E0D\u5E94\u63D0\u4F9B\u4EFB\u4F55\u76EE\u5F55, jar \u6216\u7C7B\u53C2\u6570\u3002\n\n--release \u9009\u9879\u6307\u5B9A\u63D0\u4F9B\u8981\u626B\u63CF\u7684\u5DF2\u8FC7\u65F6 API \u96C6\n\u7684 Java SE \u53D1\u884C\u7248\u3002\n\n--verbose (-v) \u9009\u9879\u5728\u5904\u7406\u671F\u95F4\u542F\u7528\u9644\u52A0\u6D88\u606F\u8F93\u51FA\u3002\n\n--version \u9009\u9879\u8F93\u51FA\u5DE5\u5177\u7684\u7F29\u5199\u7248\u672C\u5B57\u7B26\u4E32\u3002
+
+main.xhelp=\u4E0D\u652F\u6301\u7684\u9009\u9879:\n\n  --Xload-class CLASS\n      \u4ECE\u5DF2\u547D\u540D\u7C7B\u52A0\u8F7D\u8FC7\u65F6\u4FE1\u606F\u3002\n  --Xload-csv CSVFILE\n      \u4ECE\u5DF2\u547D\u540D CSV \u6587\u4EF6\u52A0\u8F7D\u8FC7\u65F6\u4FE1\u606F\u3002\n  --Xload-dir DIR\n      \u4ECE\u5DF2\u547D\u540D\u76EE\u5F55\u4E2D\u7684\u7C7B\u5206\u5C42\u7ED3\u6784\u52A0\u8F7D\n      \u8FC7\u65F6\u4FE1\u606F\u3002\n  --Xload-jar JARFILE\n      \u4ECE\u5DF2\u547D\u540D JAR \u6587\u4EF6\u52A0\u8F7D\u8FC7\u65F6\u4FE1\u606F\u3002\n  --Xload-jdk9 JAVA_HOME\n      \u4ECE\u4F4D\u4E8E JAVA_HOME \u7684 JDK \u4E2D\u52A0\u8F7D\u8FC7\u65F6\u4FE1\u606F, \n      \u8BE5 JDK \u5FC5\u987B\u662F\u4E00\u4E2A\u6A21\u5757\u5316 JDK\u3002\n  --Xload-old-jdk JAVA_HOME\n      \u4ECE\u4F4D\u4E8E JAVA_HOME \u7684 JDK \u4E2D\u52A0\u8F7D\u8FC7\u65F6\u4FE1\u606F, \n      \u8BE5 JDK \u4E0D\u80FD\u662F\u4E00\u4E2A\u6A21\u5757\u5316 JDK\u3002\u76F8\u53CD, \n      \u5DF2\u547D\u540D JDK \u5FC5\u987B\u662F\u5E26\u6709 rt.jar \u6587\u4EF6\u7684 "\u7ECF\u5178" JDK\u3002\n  --Xload-self\n      \u901A\u8FC7\u904D\u5386\u6B63\u5728\u8FD0\u884C\u7684 JDK \u6620\u50CF\u7684 jrt: \u6587\u4EF6\u7CFB\u7EDF:\n      \u52A0\u8F7D\u8FC7\u65F6\u4FE1\u606F\u3002\n  --Xcompiler-arg ARG\n      \u5C06 ARG \u6DFB\u52A0\u5230\u7F16\u8BD1\u5668\u53C2\u6570\u5217\u8868\u4E2D\u3002\n  --Xcsv-comment COMMENT\n      \u5C06 COMMENT \u4F5C\u4E3A\u6CE8\u91CA\u884C\u6DFB\u52A0\u5230\u8F93\u51FA CSV \u6587\u4EF6\u3002\n      \u4EC5\u5F53\u540C\u65F6\u63D0\u4F9B\u4E86 -Xprint-csv \u624D\u6709\u6548\u3002\n  --Xhelp\n      \u8F93\u51FA\u6B64\u6D88\u606F\u3002\n  --Xprint-csv\n      \u8F93\u51FA\u5305\u542B\u5DF2\u52A0\u8F7D\u8FC7\u65F6\u4FE1\u606F\u7684 CSV \u6587\u4EF6\n      \u800C\u4E0D\u626B\u63CF\u4EFB\u4F55\u7C7B\u6216 JAR \u6587\u4EF6\u3002
+
+scan.process.class=\u6B63\u5728\u5904\u7406\u7C7B {0}...
+
+scan.dep.normal=
+scan.dep.removal=(forRemoval=true)
+
+scan.err.exception=\u9519\u8BEF: \u51FA\u73B0\u610F\u5916\u7684\u5F02\u5E38\u9519\u8BEF {0}
+scan.err.noclass=\u9519\u8BEF: \u627E\u4E0D\u5230\u7C7B {0}
+scan.err.nofile=\u9519\u8BEF: \u627E\u4E0D\u5230\u6587\u4EF6 {0}
+scan.err.nomethod=\u9519\u8BEF: \u65E0\u6CD5\u89E3\u6790 Methodref {0}.{1}:{2}
+
+scan.head.jar=Jar \u6587\u4EF6 {0}:
+scan.head.dir=\u76EE\u5F55 {0}:
+
+scan.out.extends={0} {1} \u6269\u5C55\u5DF2\u8FC7\u65F6\u7684\u7C7B {2} {3}
+scan.out.implements={0} {1} \u5B9E\u73B0\u5DF2\u8FC7\u65F6\u7684\u63A5\u53E3 {2} {3}
+scan.out.usesclass={0} {1} \u4F7F\u7528\u5DF2\u8FC7\u65F6\u7684\u7C7B {2} {3}
+scan.out.usesmethod={0} {1} \u4F7F\u7528\u5DF2\u8FC7\u65F6\u7684\u65B9\u6CD5 {2}::{3}{4} {5}
+scan.out.usesintfmethod={0} {1} \u4F7F\u7528\u5DF2\u8FC7\u65F6\u7684\u65B9\u6CD5 {2}::{3}{4} {5}
+scan.out.usesfield={0} {1} \u4F7F\u7528\u5DF2\u8FC7\u65F6\u7684\u5B57\u6BB5 {2}::{3} {4}
+scan.out.hasfield={0} {1} \u5177\u6709\u540D\u4E3A {2} \u7684\u5B57\u6BB5, \u5176\u7C7B\u578B\u4E3A\u5DF2\u8FC7\u65F6\u7684 {3} {4}
+scan.out.methodparmtype={0} {1} \u5177\u6709\u540D\u4E3A {2} \u7684\u65B9\u6CD5, \u5176\u53C2\u6570\u7C7B\u578B\u4E3A\u5DF2\u8FC7\u65F6\u7684 {3} {4}
+scan.out.methodrettype={0} {1} \u5177\u6709\u540D\u4E3A {2} \u7684\u65B9\u6CD5, \u5176\u8FD4\u56DE\u7C7B\u578B\u4E3A\u5DF2\u8FC7\u65F6\u7684 {3} {4}
+scan.out.methodoverride={0} {1} \u8986\u76D6\u5DF2\u8FC7\u65F6\u7684\u65B9\u6CD5 {2}::{3}{4} {5}
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Graph.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Graph.java
index 9499e39..3c46394 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Graph.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Graph.java
@@ -116,7 +116,7 @@
                 .forEach(u -> g.adjacentNodes(u).stream()
                                 .filter(v -> isAdjacent(u, v))
                                 .forEach(v -> builder.addEdge(u, v)));
-        return builder.build();
+        return builder.build().reduce();
     }
 
     /**
@@ -274,7 +274,7 @@
         }
 
         public void addNodes(Set<T> nodes) {
-            nodes.addAll(nodes);
+            this.nodes.addAll(nodes);
         }
 
         public void addEdge(T u, T v) {
@@ -335,67 +335,4 @@
             result.addLast(node);
         }
     }
-
-    public static class DotGraph {
-        static final String ORANGE = "#e76f00";
-        static final String BLUE = "#437291";
-        static final String GRAY = "#dddddd";
-
-        static final String REEXPORTS = "";
-        static final String REQUIRES = "style=\"dashed\"";
-        static final String REQUIRES_BASE = "color=\"" + GRAY + "\"";
-
-        static final Set<String> javaModules = modules(name ->
-            (name.startsWith("java.") && !name.equals("java.smartcardio")));
-        static final Set<String> jdkModules = modules(name ->
-            (name.startsWith("java.") ||
-                name.startsWith("jdk.") ||
-                name.startsWith("javafx.")) && !javaModules.contains(name));
-
-        private static Set<String> modules(Predicate<String> predicate) {
-            return ModuleFinder.ofSystem().findAll()
-                               .stream()
-                               .map(ModuleReference::descriptor)
-                               .map(ModuleDescriptor::name)
-                               .filter(predicate)
-                               .collect(Collectors.toSet());
-        }
-
-        static void printAttributes(PrintWriter out) {
-            out.format("  size=\"25,25\";%n");
-            out.format("  nodesep=.5;%n");
-            out.format("  ranksep=1.5;%n");
-            out.format("  pencolor=transparent;%n");
-            out.format("  node [shape=plaintext, fontname=\"DejaVuSans\", fontsize=36, margin=\".2,.2\"];%n");
-            out.format("  edge [penwidth=4, color=\"#999999\", arrowhead=open, arrowsize=2];%n");
-        }
-
-        static void printNodes(PrintWriter out, Graph<String> graph) {
-            out.format("  subgraph se {%n");
-            graph.nodes().stream()
-                 .filter(javaModules::contains)
-                 .forEach(mn -> out.format("  \"%s\" [fontcolor=\"%s\", group=%s];%n",
-                                           mn, ORANGE, "java"));
-            out.format("  }%n");
-            graph.nodes().stream()
-                 .filter(jdkModules::contains)
-                 .forEach(mn -> out.format("    \"%s\" [fontcolor=\"%s\", group=%s];%n",
-                                           mn, BLUE, "jdk"));
-
-            graph.nodes().stream()
-                 .filter(mn -> !javaModules.contains(mn) && !jdkModules.contains(mn))
-                 .forEach(mn -> out.format("  \"%s\";%n", mn));
-        }
-
-        static void printEdges(PrintWriter out, Graph<String> graph,
-                               String node, Set<String> requiresTransitive) {
-            graph.adjacentNodes(node).forEach(dn -> {
-                String attr = dn.equals("java.base") ? REQUIRES_BASE
-                        : (requiresTransitive.contains(dn) ? REEXPORTS : REQUIRES);
-                out.format("  \"%s\" -> \"%s\" [%s];%n", node, dn, attr);
-            });
-        }
-    }
-
-
 }
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java
index b34d740..65294d7 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -118,7 +118,7 @@
         }
 
         this.configuration = Configuration.empty()
-                .resolveRequires(finder, ModuleFinder.of(), mods);
+                .resolve(finder, ModuleFinder.of(), mods);
 
         this.configuration.modules().stream()
                 .map(ResolvedModule::reference)
@@ -207,16 +207,6 @@
     }
 
     /**
-     * Returns the modules that the given module can read
-     */
-    public Stream<Module> reads(Module module) {
-        return configuration.findModule(module.name()).get()
-            .reads().stream()
-            .map(ResolvedModule::name)
-            .map(nameToModule::get);
-    }
-
-    /**
      * Returns the list of packages that split between resolved module and
      * unnamed module
      */
@@ -267,16 +257,15 @@
         return nameToModule;
     }
 
-    public Stream<Module> resolve(Set<String> roots) {
-        if (roots.isEmpty()) {
-            return nameToModule.values().stream();
-        } else {
-            return Configuration.empty()
-                    .resolveRequires(finder, ModuleFinder.of(), roots)
-                    .modules().stream()
-                    .map(ResolvedModule::name)
-                    .map(nameToModule::get);
-        }
+    /**
+     * Returns Configuration with the given roots
+     */
+    public Configuration resolve(Set<String> roots) {
+        if (roots.isEmpty())
+            throw new IllegalArgumentException("empty roots");
+
+        return Configuration.empty()
+                    .resolve(finder, ModuleFinder.of(), roots);
     }
 
     public List<Archive> classPathArchives() {
@@ -422,18 +411,13 @@
         }
 
         private ModuleDescriptor dropHashes(ModuleDescriptor md) {
-            ModuleDescriptor.Builder builder = ModuleDescriptor.module(md.name());
+            ModuleDescriptor.Builder builder = ModuleDescriptor.newModule(md.name());
             md.requires().forEach(builder::requires);
             md.exports().forEach(builder::exports);
             md.opens().forEach(builder::opens);
             md.provides().stream().forEach(builder::provides);
             md.uses().stream().forEach(builder::uses);
-
-            Set<String> concealed = new HashSet<>(md.packages());
-            md.exports().stream().map(Exports::source).forEach(concealed::remove);
-            md.opens().stream().map(Opens::source).forEach(concealed::remove);
-            concealed.forEach(builder::contains);
-
+            builder.packages(md.packages());
             return builder.build();
         }
 
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java
index faa052a..0f030f8 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java
@@ -524,7 +524,7 @@
             e.printStackTrace();
             return EXIT_CMDERR;
         } catch (MultiReleaseException e) {
-            reportError(e.getKey(), (Object)e.getMsg());
+            reportError(e.getKey(), e.getParams());
             return EXIT_CMDERR;  // could be EXIT_ABNORMAL sometimes
         } finally {
             log.flush();
@@ -721,9 +721,9 @@
             return run(config, writer, type);
         }
 
-        boolean run(JdepsConfiguration config, JdepsWriter writer, Type type) throws IOException {
-
-
+        boolean run(JdepsConfiguration config, JdepsWriter writer, Type type)
+            throws IOException
+        {
             // analyze the dependencies
             DepsAnalyzer analyzer = new DepsAnalyzer(config,
                                                      dependencyFilter(config),
@@ -1024,8 +1024,10 @@
         boolean run(JdepsConfiguration config) throws IOException {
             if ((options.showSummary || options.verbose == MODULE) &&
                 !options.addmods.isEmpty() && inputArgs.isEmpty()) {
-                // print module descriptor
-                return new ModuleAnalyzer(config, log).genDotFiles(dotOutputDir);
+                // generate dot graph from the resolved graph from module
+                // resolution.  No class dependency analysis is performed.
+                return new ModuleDotGraph(config, options.apiOnly)
+                        .genDotFiles(dotOutputDir);
             }
 
             Type type = getAnalyzerType();
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
index e49a7f7..b5d77c0 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
@@ -26,8 +26,6 @@
 package com.sun.tools.jdeps;
 
 import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleDescriptor.Exports;
-import java.lang.module.ModuleDescriptor.Opens;
 import java.net.URI;
 import java.util.Collections;
 import java.util.HashMap;
@@ -55,6 +53,7 @@
 
     private final ModuleDescriptor descriptor;
     private final Map<String, Set<String>> exports;
+    private final Map<String, Set<String>> opens;
     private final boolean isSystem;
     private final URI location;
 
@@ -63,6 +62,7 @@
         this.descriptor = null;
         this.location = null;
         this.exports = Collections.emptyMap();
+        this.opens = Collections.emptyMap();
         this.isSystem = true;
     }
 
@@ -70,12 +70,14 @@
                    URI location,
                    ModuleDescriptor descriptor,
                    Map<String, Set<String>> exports,
+                   Map<String, Set<String>> opens,
                    boolean isSystem,
                    ClassFileReader reader) {
         super(name, location, reader);
         this.descriptor = descriptor;
         this.location = location;
         this.exports = Collections.unmodifiableMap(exports);
+        this.opens = Collections.unmodifiableMap(opens);
         this.isSystem = isSystem;
     }
 
@@ -124,35 +126,52 @@
         return descriptor.packages();
     }
 
-    /**
-     * Tests if the package of the given name is exported.
-     */
-    public boolean isExported(String pn) {
-        return exports.containsKey(pn) ? exports.get(pn).isEmpty() : false;
-    }
-
     public boolean isJDKUnsupported() {
         return JDK_UNSUPPORTED.equals(this.name());
     }
 
     /**
-     * Converts this module to a strict module with the given dependences
+     * Converts this module to a normal module with the given dependences
      *
      * @throws IllegalArgumentException if this module is not an automatic module
      */
-    public Module toStrictModule(Map<String, Boolean> requires) {
+    public Module toNormalModule(Map<String, Boolean> requires) {
         if (!isAutomatic()) {
-            throw new IllegalArgumentException(name() + " already a strict module");
+            throw new IllegalArgumentException(name() + " not an automatic module");
         }
-        return new StrictModule(this, requires);
+        return new NormalModule(this, requires);
     }
 
     /**
-     * Tests if the package of the given name is qualifiedly exported
-     * to the target.
+     * Tests if the package of the given name is exported.
+     */
+    public boolean isExported(String pn) {
+        return exports.containsKey(pn) && exports.get(pn).isEmpty();
+    }
+
+    /**
+     * Tests if the package of the given name is exported to the target
+     * in a qualified fashion.
      */
     public boolean isExported(String pn, String target) {
-        return isExported(pn) || exports.containsKey(pn) && exports.get(pn).contains(target);
+        return isExported(pn)
+                || exports.containsKey(pn) && exports.get(pn).contains(target);
+    }
+
+    /**
+     * Tests if the package of the given name is open.
+     */
+    public boolean isOpen(String pn) {
+        return opens.containsKey(pn) && opens.get(pn).isEmpty();
+    }
+
+    /**
+     * Tests if the package of the given name is open to the target
+     * in a qualified fashion.
+     */
+    public boolean isOpen(String pn, String target) {
+        return isOpen(pn)
+            || opens.containsKey(pn) && opens.get(pn).contains(target);
     }
 
     @Override
@@ -193,19 +212,28 @@
             }
 
             Map<String, Set<String>> exports = new HashMap<>();
+            Map<String, Set<String>> opens = new HashMap<>();
 
-            descriptor.exports().stream()
-                .forEach(exp -> exports.computeIfAbsent(exp.source(), _k -> new HashSet<>())
-                                    .addAll(exp.targets()));
-
-            return new Module(name, location, descriptor, exports, isSystem, reader);
+            if (descriptor.isAutomatic()) {
+                // ModuleDescriptor::exports and opens returns an empty set
+                descriptor.packages().forEach(pn -> exports.put(pn, Collections.emptySet()));
+                descriptor.packages().forEach(pn -> opens.put(pn, Collections.emptySet()));
+            } else {
+                descriptor.exports().stream()
+                          .forEach(exp -> exports.computeIfAbsent(exp.source(), _k -> new HashSet<>())
+                                                 .addAll(exp.targets()));
+                descriptor.opens().stream()
+                    .forEach(exp -> opens.computeIfAbsent(exp.source(), _k -> new HashSet<>())
+                        .addAll(exp.targets()));
+            }
+            return new Module(name, location, descriptor, exports, opens, isSystem, reader);
         }
     }
 
     private static class UnnamedModule extends Module {
         private UnnamedModule() {
             super("unnamed", null, null,
-                  Collections.emptyMap(),
+                  Collections.emptyMap(), Collections.emptyMap(),
                   false, null);
         }
 
@@ -230,19 +258,22 @@
         }
     }
 
-    private static class StrictModule extends Module {
+    /**
+     * A normal module has a module-info.class
+     */
+    private static class NormalModule extends Module {
         private final ModuleDescriptor md;
 
         /**
-         * Converts the given automatic module to a strict module.
+         * Converts the given automatic module to a normal module.
          *
          * Replace this module's dependences with the given requires and also
          * declare service providers, if specified in META-INF/services configuration file
          */
-        private StrictModule(Module m, Map<String, Boolean> requires) {
-            super(m.name(), m.location, m.descriptor, m.exports, m.isSystem, m.reader());
+        private NormalModule(Module m, Map<String, Boolean> requires) {
+            super(m.name(), m.location, m.descriptor, m.exports, m.opens, m.isSystem, m.reader());
 
-            ModuleDescriptor.Builder builder = ModuleDescriptor.module(m.name());
+            ModuleDescriptor.Builder builder = ModuleDescriptor.newModule(m.name());
             requires.keySet().forEach(mn -> {
                 if (requires.get(mn).equals(Boolean.TRUE)) {
                     builder.requires(Set.of(ModuleDescriptor.Requires.Modifier.TRANSITIVE), mn);
@@ -250,16 +281,10 @@
                     builder.requires(mn);
                 }
             });
-            m.descriptor.exports().forEach(e -> builder.exports(e));
-            m.descriptor.opens().forEach(o -> builder.opens(o));
-            m.descriptor.uses().forEach(s -> builder.uses(s));
-            m.descriptor.provides().forEach(p -> builder.provides(p));
-
-            Set<String> concealed = new HashSet<>(m.descriptor.packages());
-            m.descriptor.exports().stream().map(Exports::source).forEach(concealed::remove);
-            m.descriptor.opens().stream().map(Opens::source).forEach(concealed::remove);
-            concealed.forEach(builder::contains);
-
+            // exports all packages
+            m.descriptor.packages().forEach(builder::exports);
+            m.descriptor.uses().forEach(builder::uses);
+            m.descriptor.provides().forEach(builder::provides);
             this.md = builder.build();
         }
 
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleAnalyzer.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleAnalyzer.java
index 6da1628..233f62b 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleAnalyzer.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleAnalyzer.java
@@ -59,15 +59,10 @@
 
     private final JdepsConfiguration configuration;
     private final PrintWriter log;
-
     private final DependencyFinder dependencyFinder;
     private final Map<Module, ModuleDeps> modules;
 
     public ModuleAnalyzer(JdepsConfiguration config,
-                          PrintWriter log) {
-        this(config, log, Collections.emptySet());
-    }
-    public ModuleAnalyzer(JdepsConfiguration config,
                           PrintWriter log,
                           Set<String> names) {
         this.configuration = config;
@@ -150,7 +145,7 @@
         private ModuleDescriptor descriptor(Set<Module> requiresTransitive,
                                             Set<Module> requires) {
 
-            ModuleDescriptor.Builder builder = ModuleDescriptor.module(root.name());
+            ModuleDescriptor.Builder builder = ModuleDescriptor.newModule(root.name());
 
             if (!root.name().equals(JAVA_BASE))
                 builder.requires(Set.of(MANDATED), JAVA_BASE);
@@ -333,88 +328,6 @@
         return true;
     }
 
-    /**
-     * Generate dotfile from module descriptor
-     *
-     * @param dir output directory
-     */
-    public boolean genDotFiles(Path dir) throws IOException {
-        Files.createDirectories(dir);
-        for (Module m : modules.keySet()) {
-            genDotFile(dir, m.name());
-        }
-        return true;
-    }
-
-
-    private void genDotFile(Path dir, String name) throws IOException {
-        try (OutputStream os = Files.newOutputStream(dir.resolve(name + ".dot"));
-             PrintWriter out = new PrintWriter(os)) {
-            Set<Module> modules = configuration.resolve(Set.of(name))
-                .collect(Collectors.toSet());
-
-            // transitive reduction
-            Graph<String> graph = gengraph(modules);
-
-            out.format("digraph \"%s\" {%n", name);
-            DotGraph.printAttributes(out);
-            DotGraph.printNodes(out, graph);
-
-            modules.stream()
-                .map(Module::descriptor)
-                .sorted(Comparator.comparing(ModuleDescriptor::name))
-                .forEach(md -> {
-                    String mn = md.name();
-                    Set<String> requiresTransitive = md.requires().stream()
-                        .filter(d -> d.modifiers().contains(TRANSITIVE))
-                        .map(d -> d.name())
-                        .collect(toSet());
-
-                    DotGraph.printEdges(out, graph, mn, requiresTransitive);
-                });
-
-            out.println("}");
-        }
-    }
-
-    /**
-     * Returns a Graph of the given Configuration after transitive reduction.
-     *
-     * Transitive reduction of requires transitive edge and requires edge have
-     * to be applied separately to prevent the requires transitive edges
-     * (e.g. U -> V) from being reduced by a path (U -> X -> Y -> V)
-     * in which  V would not be re-exported from U.
-     */
-    private Graph<String> gengraph(Set<Module> modules) {
-        // build a Graph containing only requires transitive edges
-        // with transitive reduction.
-        Graph.Builder<String> rpgbuilder = new Graph.Builder<>();
-        for (Module module : modules) {
-            ModuleDescriptor md = module.descriptor();
-            String mn = md.name();
-            md.requires().stream()
-                    .filter(d -> d.modifiers().contains(TRANSITIVE))
-                    .map(d -> d.name())
-                    .forEach(d -> rpgbuilder.addEdge(mn, d));
-        }
-
-        Graph<String> rpg = rpgbuilder.build().reduce();
-
-        // build the readability graph
-        Graph.Builder<String> builder = new Graph.Builder<>();
-        for (Module module : modules) {
-            ModuleDescriptor md = module.descriptor();
-            String mn = md.name();
-            builder.addNode(mn);
-            configuration.reads(module)
-                    .map(Module::name)
-                    .forEach(d -> builder.addEdge(mn, d));
-        }
-
-        // transitive reduction of requires edges
-        return builder.build().reduce(rpg);
-    }
-
     // ---- for testing purpose
     public ModuleDescriptor[] descriptors(String name) {
         ModuleDeps moduleDeps = modules.keySet().stream()
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleDotGraph.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleDotGraph.java
new file mode 100644
index 0000000..4e11172
--- /dev/null
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleDotGraph.java
@@ -0,0 +1,410 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.tools.jdeps;
+
+import static java.lang.module.ModuleDescriptor.Requires.Modifier.*;
+import static java.util.stream.Collectors.*;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.*;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
+import java.lang.module.ResolvedModule;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Deque;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * Generate dot graph for modules
+ */
+public class ModuleDotGraph {
+    private final Map<String, Configuration> configurations;
+    private final boolean apiOnly;
+    public ModuleDotGraph(JdepsConfiguration config, boolean apiOnly) {
+        this(config.rootModules().stream()
+                   .map(Module::name)
+                   .sorted()
+                   .collect(toMap(Function.identity(), mn -> config.resolve(Set.of(mn)))),
+             apiOnly);
+    }
+
+    public ModuleDotGraph(Map<String, Configuration> configurations, boolean apiOnly) {
+        this.configurations = configurations;
+        this.apiOnly = apiOnly;
+    }
+
+    /**
+     * Generate dotfile for all modules
+     *
+     * @param dir output directory
+     */
+    public boolean genDotFiles(Path dir) throws IOException {
+        return genDotFiles(dir, DotGraphAttributes.DEFAULT);
+    }
+
+    public boolean genDotFiles(Path dir, Attributes attributes)
+        throws IOException
+    {
+        Files.createDirectories(dir);
+        for (String mn : configurations.keySet()) {
+            Path path = dir.resolve(mn + ".dot");
+            genDotFile(path, mn, configurations.get(mn), attributes);
+        }
+        return true;
+    }
+
+    /**
+     * Generate dotfile of the given path
+     */
+    public void genDotFile(Path path, String name,
+                           Configuration configuration,
+                           Attributes attributes)
+        throws IOException
+    {
+        // transitive reduction
+        Graph<String> graph = apiOnly
+                ? requiresTransitiveGraph(configuration, Set.of(name))
+                : gengraph(configuration);
+
+        DotGraphBuilder builder = new DotGraphBuilder(name, graph, attributes);
+        builder.subgraph("se", "java", attributes.javaSubgraphColor(),
+                         DotGraphBuilder.JAVA_SE_SUBGRAPH)
+               .subgraph("jdk", "jdk", attributes.jdkSubgraphColor(),
+                         DotGraphBuilder.JDK_SUBGRAPH)
+               .modules(graph.nodes().stream()
+                                 .map(mn -> configuration.findModule(mn).get()
+                                                .reference().descriptor()));
+        // build dot file
+        builder.build(path);
+    }
+
+    /**
+     * Returns a Graph of the given Configuration after transitive reduction.
+     *
+     * Transitive reduction of requires transitive edge and requires edge have
+     * to be applied separately to prevent the requires transitive edges
+     * (e.g. U -> V) from being reduced by a path (U -> X -> Y -> V)
+     * in which  V would not be re-exported from U.
+     */
+    private Graph<String> gengraph(Configuration cf) {
+        Graph.Builder<String> builder = new Graph.Builder<>();
+        cf.modules().stream()
+            .forEach(rm -> {
+                String mn = rm.name();
+                builder.addNode(mn);
+                rm.reads().stream()
+                  .map(ResolvedModule::name)
+                  .forEach(target -> builder.addEdge(mn, target));
+            });
+
+        Graph<String> rpg = requiresTransitiveGraph(cf, builder.nodes);
+        return builder.build().reduce(rpg);
+    }
+
+
+    /**
+     * Returns a Graph containing only requires transitive edges
+     * with transitive reduction.
+     */
+    public Graph<String> requiresTransitiveGraph(Configuration cf,
+                                                 Set<String> roots)
+    {
+        Deque<String> deque = new ArrayDeque<>(roots);
+        Set<String> visited = new HashSet<>();
+        Graph.Builder<String> builder = new Graph.Builder<>();
+
+        while (deque.peek() != null) {
+            String mn = deque.pop();
+            if (visited.contains(mn))
+                continue;
+
+            visited.add(mn);
+            builder.addNode(mn);
+            cf.findModule(mn).get()
+              .reference().descriptor().requires().stream()
+              .filter(d -> d.modifiers().contains(TRANSITIVE)
+                                || d.name().equals("java.base"))
+              .map(Requires::name)
+              .forEach(d -> {
+                  deque.add(d);
+                  builder.addEdge(mn, d);
+              });
+        }
+
+        return builder.build().reduce();
+    }
+
+    public interface Attributes {
+        static final String ORANGE = "#e76f00";
+        static final String BLUE = "#437291";
+        static final String BLACK = "#000000";
+        static final String DARK_GRAY = "#999999";
+        static final String LIGHT_GRAY = "#dddddd";
+
+        int fontSize();
+        String fontName();
+        String fontColor();
+
+        int arrowSize();
+        int arrowWidth();
+        String arrowColor();
+
+        default double rankSep() {
+            return 1;
+        }
+
+        default List<Set<String>> ranks() {
+            return Collections.emptyList();
+        }
+
+        default int weightOf(String s, String t) {
+            return 1;
+        }
+
+        default String requiresMandatedColor() {
+            return LIGHT_GRAY;
+        }
+
+        default String javaSubgraphColor() {
+            return ORANGE;
+        }
+
+        default String jdkSubgraphColor() {
+            return BLUE;
+        }
+    }
+
+    static class DotGraphAttributes implements Attributes {
+        static final DotGraphAttributes DEFAULT = new DotGraphAttributes();
+
+        static final String FONT_NAME = "DejaVuSans";
+        static final int FONT_SIZE = 12;
+        static final int ARROW_SIZE = 1;
+        static final int ARROW_WIDTH = 2;
+
+        @Override
+        public int fontSize() {
+            return FONT_SIZE;
+        }
+
+        @Override
+        public String fontName() {
+            return FONT_NAME;
+        }
+
+        @Override
+        public String fontColor() {
+            return BLACK;
+        }
+
+        @Override
+        public int arrowSize() {
+            return ARROW_SIZE;
+        }
+
+        @Override
+        public int arrowWidth() {
+            return ARROW_WIDTH;
+        }
+
+        @Override
+        public String arrowColor() {
+            return DARK_GRAY;
+        }
+    }
+
+    private static class DotGraphBuilder {
+        static final String REEXPORTS = "";
+        static final String REQUIRES = "style=\"dashed\"";
+
+        static final Set<String> JAVA_SE_SUBGRAPH = javaSE();
+        static final Set<String> JDK_SUBGRAPH = jdk();
+
+        private static Set<String> javaSE() {
+            String root = "java.se.ee";
+            ModuleFinder system = ModuleFinder.ofSystem();
+            if (system.find(root).isPresent()) {
+                return Stream.concat(Stream.of(root),
+                                     Configuration.empty().resolve(system,
+                                                                   ModuleFinder.of(),
+                                                                   Set.of(root))
+                                                  .findModule(root).get()
+                                                  .reads().stream()
+                                                  .map(ResolvedModule::name))
+                             .collect(toSet());
+            } else {
+                // approximation
+                return system.findAll().stream()
+                    .map(ModuleReference::descriptor)
+                    .map(ModuleDescriptor::name)
+                    .filter(name -> name.startsWith("java.") &&
+                                        !name.equals("java.smartcardio"))
+                    .collect(Collectors.toSet());
+            }
+        }
+
+        private static Set<String> jdk() {
+            return ModuleFinder.ofSystem().findAll().stream()
+                    .map(ModuleReference::descriptor)
+                    .map(ModuleDescriptor::name)
+                    .filter(name -> !JAVA_SE_SUBGRAPH.contains(name) &&
+                                        (name.startsWith("java.") ||
+                                            name.startsWith("jdk.") ||
+                                            name.startsWith("javafx.")))
+                    .collect(Collectors.toSet());
+        }
+
+        static class SubGraph {
+            final String name;
+            final String group;
+            final String color;
+            final Set<String> nodes;
+            SubGraph(String name, String group, String color, Set<String> nodes) {
+                this.name = Objects.requireNonNull(name);
+                this.group = Objects.requireNonNull(group);
+                this.color = Objects.requireNonNull(color);
+                this.nodes = Objects.requireNonNull(nodes);
+            }
+        }
+
+        private final String name;
+        private final Graph<String> graph;
+        private final Set<ModuleDescriptor> descriptors = new TreeSet<>();
+        private final List<SubGraph> subgraphs = new ArrayList<>();
+        private final Attributes attributes;
+        public DotGraphBuilder(String name,
+                               Graph<String> graph,
+                               Attributes attributes) {
+            this.name = name;
+            this.graph = graph;
+            this.attributes = attributes;
+        }
+
+        public DotGraphBuilder modules(Stream<ModuleDescriptor> descriptors) {
+            descriptors.forEach(this.descriptors::add);
+            return this;
+        }
+
+        public void build(Path filename) throws IOException {
+            try (BufferedWriter writer = Files.newBufferedWriter(filename);
+                 PrintWriter out = new PrintWriter(writer)) {
+
+                out.format("digraph \"%s\" {%n", name);
+                out.format("  nodesep=.5;%n");
+                out.format("  ranksep=%f;%n", attributes.rankSep());
+                out.format("  pencolor=transparent;%n");
+                out.format("  node [shape=plaintext, fontcolor=\"%s\", fontname=\"%s\","
+                                + " fontsize=%d, margin=\".2,.2\"];%n",
+                           attributes.fontColor(),
+                           attributes.fontName(),
+                           attributes.fontSize());
+                out.format("  edge [penwidth=%d, color=\"%s\", arrowhead=open, arrowsize=%d];%n",
+                           attributes.arrowWidth(),
+                           attributes.arrowColor(),
+                           attributes.arrowSize());
+
+                // same RANKS
+                attributes.ranks().stream()
+                    .map(nodes -> descriptors.stream()
+                                        .map(ModuleDescriptor::name)
+                                        .filter(nodes::contains)
+                                        .map(mn -> "\"" + mn + "\"")
+                                        .collect(joining(",")))
+                    .filter(group -> group.length() > 0)
+                    .forEach(group -> out.format("  {rank=same %s}%n", group));
+
+                subgraphs.forEach(subgraph -> {
+                    out.format("  subgraph %s {%n", subgraph.name);
+                    descriptors.stream()
+                        .map(ModuleDescriptor::name)
+                        .filter(subgraph.nodes::contains)
+                        .forEach(mn -> printNode(out, mn, subgraph.color, subgraph.group));
+                    out.format("  }%n");
+                });
+
+                descriptors.stream()
+                    .filter(md -> graph.contains(md.name()) &&
+                                    !graph.adjacentNodes(md.name()).isEmpty())
+                    .forEach(md -> printNode(out, md, graph.adjacentNodes(md.name())));
+
+                out.println("}");
+            }
+        }
+
+        public DotGraphBuilder subgraph(String name, String group, String color,
+                                 Set<String> nodes) {
+            subgraphs.add(new SubGraph(name, group, color, nodes));
+            return this;
+        }
+
+        public void printNode(PrintWriter out, String node, String color, String group) {
+            out.format("  \"%s\" [fontcolor=\"%s\", group=%s];%n",
+                       node, color, group);
+        }
+
+        public void printNode(PrintWriter out, ModuleDescriptor md, Set<String> edges) {
+            Set<String> requiresTransitive = md.requires().stream()
+                .filter(d -> d.modifiers().contains(TRANSITIVE))
+                .map(d -> d.name())
+                .collect(toSet());
+
+            String mn = md.name();
+            edges.stream().forEach(dn -> {
+                String attr;
+                if (dn.equals("java.base")) {
+                    attr = "color=\"" + attributes.requiresMandatedColor() + "\"";
+                } else {
+                    attr = (requiresTransitive.contains(dn) ? REEXPORTS : REQUIRES);
+                }
+
+                int w = attributes.weightOf(mn, dn);
+                if (w > 1) {
+                    if (!attr.isEmpty())
+                        attr += ", ";
+
+                    attr += "weight=" + w;
+                }
+                out.format("  \"%s\" -> \"%s\" [%s];%n", mn, dn, attr);
+            });
+        }
+
+    }
+}
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleExportsAnalyzer.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleExportsAnalyzer.java
index d760d1b..723ac19 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleExportsAnalyzer.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleExportsAnalyzer.java
@@ -181,7 +181,7 @@
         RootModule(String name) {
             super(name);
 
-            ModuleDescriptor.Builder builder = ModuleDescriptor.module(name);
+            ModuleDescriptor.Builder builder = ModuleDescriptor.newModule(name);
             this.descriptor = builder.build();
         }
 
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleInfoBuilder.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleInfoBuilder.java
index 06a31cd..1843ea0 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleInfoBuilder.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleInfoBuilder.java
@@ -43,10 +43,12 @@
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 import java.util.function.Function;
+import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import static java.util.stream.Collectors.*;
 
@@ -60,8 +62,8 @@
     final Analyzer analyzer;
 
     // an input JAR file (loaded as an automatic module for analysis)
-    // maps to an explicit module to generate module-info.java
-    final Map<Module, Module> automaticToExplicitModule;
+    // maps to a normal module to generate module-info.java
+    final Map<Module, Module> automaticToNormalModule;
     public ModuleInfoBuilder(JdepsConfiguration configuration,
                              List<String> args,
                              Path outputdir,
@@ -78,20 +80,20 @@
             .map(fn -> Paths.get(fn))
             .collect(toList());
 
-        // automatic module to convert to explicit module
-        this.automaticToExplicitModule = ModuleFinder.of(paths.toArray(new Path[0]))
+        // automatic module to convert to normal module
+        this.automaticToNormalModule = ModuleFinder.of(paths.toArray(new Path[0]))
                 .findAll().stream()
                 .map(configuration::toModule)
                 .collect(toMap(Function.identity(), Function.identity()));
 
-        Optional<Module> om = automaticToExplicitModule.keySet().stream()
+        Optional<Module> om = automaticToNormalModule.keySet().stream()
                                     .filter(m -> !m.descriptor().isAutomatic())
                                     .findAny();
         if (om.isPresent()) {
             throw new UncheckedBadArgs(new BadArgs("err.genmoduleinfo.not.jarfile",
                                                    om.get().getPathName()));
         }
-        if (automaticToExplicitModule.isEmpty()) {
+        if (automaticToNormalModule.isEmpty()) {
             throw new UncheckedBadArgs(new BadArgs("err.invalid.path", args));
         }
     }
@@ -115,13 +117,13 @@
                 Path file = outputdir.resolve(m.name()).resolve("module-info.java");
 
                 // computes requires and requires transitive
-                Module explicitModule = toExplicitModule(m, apiDeps);
-                if (explicitModule != null) {
-                    automaticToExplicitModule.put(m, explicitModule);
+                Module normalModule = toNormalModule(m, apiDeps);
+                if (normalModule != null) {
+                    automaticToNormalModule.put(m, normalModule);
 
                     // generate module-info.java
                     System.out.format("writing to %s%n", file);
-                    writeModuleInfo(file,  explicitModule.descriptor());
+                    writeModuleInfo(file,  normalModule.descriptor());
                 } else {
                     // find missing dependences
                     System.out.format("Missing dependence: %s not generated%n", file);
@@ -139,7 +141,7 @@
         return m == NOT_FOUND || m == REMOVED_JDK_INTERNALS;
     }
 
-    private Module toExplicitModule(Module module, Set<Archive> requiresTransitive)
+    private Module toNormalModule(Module module, Set<Archive> requiresTransitive)
         throws IOException
     {
         // done analysis
@@ -159,21 +161,21 @@
             .map(Archive::getModule)
             .forEach(d -> requires.putIfAbsent(d.name(), Boolean.FALSE));
 
-        return module.toStrictModule(requires);
+        return module.toNormalModule(requires);
     }
 
     /**
      * Returns the stream of resulting modules
      */
     Stream<Module> modules() {
-        return automaticToExplicitModule.values().stream();
+        return automaticToNormalModule.values().stream();
     }
 
     /**
      * Returns the stream of resulting ModuleDescriptors
      */
     public Stream<ModuleDescriptor> descriptors() {
-        return automaticToExplicitModule.entrySet().stream()
+        return automaticToNormalModule.entrySet().stream()
                     .map(Map.Entry::getValue)
                     .map(Module::descriptor);
     }
@@ -205,13 +207,14 @@
         md.requires().stream()
           .filter(req -> !req.name().equals("java.base"))   // implicit requires
           .sorted(Comparator.comparing(Requires::name))
-          .forEach(req -> writer.format("    requires %s;%n", req));
+          .forEach(req -> writer.format("    requires %s;%n",
+                                        toString(req.modifiers(), req.name())));
 
         if (!open) {
             md.exports().stream()
               .peek(exp -> {
-                 if (exp.targets().size() > 0)
-                    throw new InternalError(md.name() + " qualified exports: " + exp);
+                  if (exp.isQualified())
+                      throw new InternalError(md.name() + " qualified exports: " + exp);
               })
               .sorted(Comparator.comparing(Exports::source))
               .forEach(exp -> writer.format("    exports %s;%n", exp.source()));
@@ -231,7 +234,16 @@
     }
 
     private Set<Module> automaticModules() {
-        return automaticToExplicitModule.keySet();
+        return automaticToNormalModule.keySet();
+    }
+
+    /**
+     * Returns a string containing the given set of modifiers and label.
+     */
+    private static <M> String toString(Set<M> mods, String what) {
+        return (Stream.concat(mods.stream().map(e -> e.toString().toLowerCase(Locale.US)),
+                              Stream.of(what)))
+                      .collect(Collectors.joining(" "));
     }
 
     /**
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java
index feb3598..65fce01 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java
@@ -34,7 +34,7 @@
 class MultiReleaseException extends RuntimeException {
     private static final long serialVersionUID = 4474870142461654108L;
     private final String key;
-    private final String[] msg;
+    private final Object[] params;
 
     /**
      * Constructs an {@code MultiReleaseException} with the specified detail
@@ -42,13 +42,13 @@
      *
      * @param key
      *        The key that identifies the message in the jdeps.properties file
-     * @param msg
+     * @param params
      *        The detail message array
      */
-    public MultiReleaseException(String key, String... msg) {
+    public MultiReleaseException(String key, Object... params) {
         super();
         this.key = key;
-        this.msg = msg;
+        this.params = params;
     }
 
     /**
@@ -63,7 +63,7 @@
      *
      * @return the detailed error message array
      */
-    public String[] getMsg() {
-        return msg;
+    public Object[] getParams() {
+        return params;
     }
 }
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
index acdc6ff..3fcf238 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
@@ -93,7 +93,7 @@
 main.opt.R=\
 \  -R       -recursive           Recursively traverse all run-time dependences.\n\
 \                                The -R option implies -filter:none.  If -p,\n\
-\                                -e, -foption is specified, only the matching\n\
+\                                -e, -f option is specified, only the matching\n\
 \                                dependences are analyzed.
 
 main.opt.I=\
@@ -196,8 +196,8 @@
 err.root.module.not.set=root module set empty
 err.option.already.specified={0} option specified more than once.
 err.filter.not.specified=--package (-p), --regex (-e), --require option must be specified
-err.multirelease.option.exists={0} is not a multi-release jar file, but the --multi-release option is set
-err.multirelease.option.notfound={0} is a multi-release jar file, but the --multi-release option is not set
+err.multirelease.option.exists={0} is not a multi-release jar file but --multi-release option is set
+err.multirelease.option.notfound={0} is a multi-release jar file but --multi-release option is not set
 err.multirelease.version.associated=class {0} already associated with version {1}, trying to add version {2}
 err.multirelease.jar.malformed=malformed multi-release jar, {0}, bad entry: {1}
 warn.invalid.arg=Path does not exist: {0}
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties
index 81987eb..b93d206 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties
@@ -44,7 +44,9 @@
 
 main.opt.apionly=\  -apionly\n  --api-only                    \u5206\u6790\u3092API\u3001\u3064\u307E\u308A\u3001\u30D1\u30D6\u30EA\u30C3\u30AF\u30FB\u30AF\u30E9\u30B9\u306E\n                                \u30D1\u30D6\u30EA\u30C3\u30AF\u30FB\u30E1\u30F3\u30D0\u30FC\u304A\u3088\u3073\u4FDD\u8B77\u3055\u308C\u305F\u30E1\u30F3\u30D0\u30FC\u306E\n                                \u7F72\u540D\u306B\u304A\u3051\u308B\u4F9D\u5B58\u6027(\u30D5\u30A3\u30FC\u30EB\u30C9\u30FB\u30BF\u30A4\u30D7\u3001\u30E1\u30BD\u30C3\u30C9\u30FB\n                                \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30BF\u30A4\u30D7\u3001\u623B\u3055\u308C\u305F\u30BF\u30A4\u30D7\u3001\u30C1\u30A7\u30C3\u30AF\u3055\u308C\u305F\n                                \u4F8B\u5916\u30BF\u30A4\u30D7\u306A\u3069)\u306B\u5236\u9650\u3057\u307E\u3059\u3002
 
-main.opt.generate-module-info=\  --generate-module-info <dir>  \u6307\u5B9A\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Bmodule-info.java\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n                                \u6307\u5B9A\u3057\u305FJAR\u30D5\u30A1\u30A4\u30EB\u3092\u5206\u6790\u3057\u307E\u3059\u3002\n                                \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F--dot-output\u307E\u305F\u306F--class-path\n                                \u3068\u4E00\u7DD2\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
+main.opt.generate-module-info=\  --generate-module-info <dir>  \u6307\u5B9A\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306Bmodule-info.java\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n                                \u6307\u5B9A\u3057\u305FJAR\u30D5\u30A1\u30A4\u30EB\u3092\u5206\u6790\u3057\u307E\u3059\u3002\n                                \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F--dot-output\u307E\u305F\u306F--class-path\n                                \u3068\u4E00\u7DD2\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u30AA\u30FC\u30D7\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u306F\n                                --generate-open-module\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
+
+main.opt.generate-open-module=\  --generate-open-module <dir>  \u6307\u5B9A\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3001\u6307\u5B9A\u3057\u305F\n                                JAR\u30D5\u30A1\u30A4\u30EB\u306Emodule-info.java\u3092\u30AA\u30FC\u30D7\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u3068\u3057\u3066\n                                \u751F\u6210\u3057\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F--dot-output\n                                \u307E\u305F\u306F--class-path\u3068\u4E00\u7DD2\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
 
 main.opt.check=\  --check <module-name>[,<module-name>...\n                                \u6307\u5B9A\u3057\u305F\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u4F9D\u5B58\u6027\u3092\u5206\u6790\u3057\u307E\u3059\n                                \u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u3001\u5206\u6790\u5F8C\u306E\u7D50\u679C\u30E2\u30B8\u30E5\u30FC\u30EB\u4F9D\u5B58\u6027\n                                \u304A\u3088\u3073\u9077\u79FB\u524A\u6E1B\u5F8C\u306E\u30B0\u30E9\u30D5\u3092\n                                \u51FA\u529B\u3057\u307E\u3059\u3002\n                                \u672A\u4F7F\u7528\u306E\u4FEE\u98FE\u3055\u308C\u305F\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3082\u8B58\u5225\u3057\u307E\u3059\u3002
 
@@ -53,14 +55,20 @@
 
 main.opt.jdkinternals=\  -jdkinternals\n  --jdk-internals               JDK\u5185\u90E8API\u306E\u30AF\u30E9\u30B9\u30EC\u30D9\u30EB\u306E\u4F9D\u5B58\u6027\u3092\u691C\u51FA\u3057\u307E\u3059\u3002\n                                \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001-include\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u306A\u3044\u3068\u3001\n                                --class-path\u306E\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3068\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u3092\u5206\u6790\u3057\u307E\u3059\u3002\n                                \u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F-p\u3001-e\u304A\u3088\u3073-s\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u4E00\u7DD2\u306B\n                                \u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n                                \u8B66\u544A: JDK\u5185\u90E8API\u306F\u3001\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3059\u3002
 
+main.opt.list-deps=\  --list-deps                   \u4F9D\u5B58\u95A2\u4FC2\u3068JDK\u5185\u90E8API\u306E\u4F7F\u7528\u3092\n                                \u30EA\u30B9\u30C8\u3057\u307E\u3059\u3002
+
+main.opt.list-reduced-deps=\  --list-reduced-deps           --list-deps\u3068\u540C\u3058\u3067\u3059\u304C\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B0\u30E9\u30D5\n                                \u304B\u3089\u542B\u610F\u3055\u308C\u305F\u8AAD\u53D6\u308A\u30A8\u30C3\u30B8\u3092\u30EA\u30B9\u30C8\u3057\u307E\u305B\u3093\n                                \u30E2\u30B8\u30E5\u30FC\u30EBM1\u304CM2\u3068M3\u306B\u4F9D\u5B58\u3057\u3066\u304A\u308A\u3001\n                                M2\u304CM3\u4E0A\u3067requires public\u3067\u3042\u308B\u5834\u5408\u3001M3\u3092\u8AAD\u307F\u53D6\u308BM1\u306F\n                                \u542B\u610F\u3055\u308C\u3066\u304A\u308A\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B0\u30E9\u30D5\u304B\u3089\u524A\u9664\u3055\u308C\u307E\u3059\u3002
+
 main.opt.depth=\  -depth=<depth>                \u63A8\u79FB\u7684\u306A\u4F9D\u5B58\u6027\u5206\u6790\u306E\u6DF1\u3055\u3092\n                                \u6307\u5B9A\u3057\u307E\u3059
 
 main.opt.q=\  -q       -quiet               --generate-module-info\u51FA\u529B\u3067\n                                 \u6B20\u843D\u3057\u3066\u3044\u308B\u4F9D\u5B58\u6027\u3092\u8868\u793A\u3057\u307E\u305B\u3093\u3002
 
 main.opt.multi-release=\  --multi-release <version>     \u30DE\u30EB\u30C1\u30EA\u30EA\u30FC\u30B9jar\u30D5\u30A1\u30A4\u30EB\u3092\u51E6\u7406\u3059\u308B\u969B\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\n                                \u6307\u5B9A\u3057\u307E\u3059\u3002<version>\u306F\u30019\u307E\u305F\u306F\u30D9\u30FC\u30B9\u4EE5\u4E0A\u306E\n                                \u6574\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
 
+err.command.set=\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u3068{1}\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
 err.unknown.option=\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}
 err.missing.arg={0}\u306B\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+err.missing.dependences=\u4F9D\u5B58\u6027\u304C\u6B20\u843D\u3057\u3066\u3044\u307E\u3059
 err.invalid.arg.for.option=\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059: {0}
 err.option.after.class=\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u30AF\u30E9\u30B9\u306E\u524D\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}
 err.genmoduleinfo.not.jarfile={0}\u306F\u3001--generate-module-info\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3068\u3082\u306B\u6307\u5B9A\u3067\u304D\u306A\u3044\u30E2\u30B8\u30E5\u30E9JAR\u30D5\u30A1\u30A4\u30EB\u3067\u3059
@@ -68,11 +76,11 @@
 err.profiles.msg=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093
 err.exception.message={0}
 err.invalid.path=\u7121\u52B9\u306A\u30D1\u30B9: {0}
-err.invalid.module.option={0}\u306F{1}\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u4E00\u7DD2\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
-err.invalid.filters=--package (-p)\u3001--regex (-e)\u3001--require\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u3044\u305A\u308C\u304B\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u3059
+err.invalid.options={0}\u306F{1}\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u4E00\u7DD2\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
 err.module.not.found=\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
 err.root.module.not.set=\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30BB\u30C3\u30C8\u304C\u7A7A\u3067\u3059
-err.invalid.inverse.option={0}\u306F--inverse\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u4E00\u7DD2\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
+err.option.already.specified={0}\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8907\u6570\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
+err.filter.not.specified=--package (-p)\u3001--regex (-e)\u3001--require\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
 err.multirelease.option.exists={0}\u306F\u30DE\u30EB\u30C1\u30EA\u30EA\u30FC\u30B9jar\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u304C\u3001--multi-release\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059
 err.multirelease.option.notfound={0}\u306F\u30DE\u30EB\u30C1\u30EA\u30EA\u30FC\u30B9jar\u30D5\u30A1\u30A4\u30EB\u3067\u3059\u304C\u3001--multi-release\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
 err.multirelease.version.associated=\u30AF\u30E9\u30B9{0}\u306F\u3059\u3067\u306B\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u307E\u3059\u3002\u30D0\u30FC\u30B8\u30E7\u30F3{2}\u306E\u8FFD\u52A0\u3092\u8A66\u307F\u307E\u3059
@@ -82,5 +90,10 @@
 warn.split.package=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F{1} {2}\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
 warn.replace.useJDKInternals=JDK\u5185\u90E8API\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u304A\u3089\u305A\u3001JDK\u5B9F\u88C5\u5C02\u7528\u3067\u3059\u304C\u3001\u4E92\u63DB\u6027\u306A\u3057\u3067\n\u524A\u9664\u307E\u305F\u306F\u5909\u66F4\u3055\u308C\u308B\u5834\u5408\u304C\u3042\u308A\u3001\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u4E2D\u65AD\u3055\u305B\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\nJDK\u5185\u90E8API\u306E\u4F9D\u5B58\u6027\u3092\u524A\u9664\u3059\u308B\u3088\u3046\u30B3\u30FC\u30C9\u3092\u5909\u66F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002\nJDK\u5185\u90E8API\u306E\u7F6E\u63DB\u306B\u95A2\u3059\u308B\u6700\u65B0\u306E\u66F4\u65B0\u306B\u3064\u3044\u3066\u306F\u3001\u6B21\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044:\n{0}
 
+split.package=\u5206\u5272\u30D1\u30C3\u30B1\u30FC\u30B8: {0} {1}\n
+inverse.transitive.dependencies.on={0}\u4E0A\u3067\u63A8\u79FB\u7684\u306A\u4F9D\u5B58\u6027\u3092\u9006\u8EE2\u3057\u307E\u3059
+inverse.transitive.dependencies.matching={0}\u306B\u4E00\u81F4\u3059\u308B\u63A8\u79FB\u7684\u306A\u4F9D\u5B58\u6027\u3092\u9006\u8EE2\u3057\u307E\u3059
+internal.api.column.header=JDK\u5185\u90E8API
+public.api.replacement.column.header=\u4FEE\u6B63\u5019\u88DC
 artifact.not.found=\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 jdeps.wiki.url=https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties
index 2275bc3..bacd980 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties
@@ -44,7 +44,9 @@
 
 main.opt.apionly=\  -apionly\n  --api-only                    \u901A\u8FC7\u516C\u5171\u7C7B (\u5305\u62EC\u5B57\u6BB5\u7C7B\u578B, \u65B9\u6CD5\n                                \u53C2\u6570\u7C7B\u578B, \u8FD4\u56DE\u7C7B\u578B, \u53D7\u63A7\u5F02\u5E38\u9519\u8BEF\n                                \u7C7B\u578B\u7B49) \u7684\u516C\u5171\u548C\u53D7\u4FDD\u62A4\u6210\u5458\u7684\u7B7E\u540D\n                                \u9650\u5236\u5BF9 API (\u5373\u88AB\u4F9D\u8D56\u5BF9\u8C61)\n                                \u8FDB\u884C\u5206\u6790\u3002
 
-main.opt.generate-module-info=\  --generate-module-info <\u76EE\u5F55> \u5728\u6307\u5B9A\u76EE\u5F55\u4E0B\u751F\u6210 module-info.java\u3002\n                                \u5C06\u5206\u6790\u6307\u5B9A\u7684 JAR \u6587\u4EF6\u3002\n                                \u6B64\u9009\u9879\u4E0D\u80FD\u4E0E --dot-output \n                                \u6216 --class-path \u4E00\u8D77\u4F7F\u7528\u3002
+main.opt.generate-module-info=\  --generate-module-info <\u76EE\u5F55> \u5728\u6307\u5B9A\u76EE\u5F55\u4E0B\u751F\u6210 module-info.java\u3002\n                                \u5C06\u5206\u6790\u6307\u5B9A\u7684 JAR \u6587\u4EF6\u3002\n                                \u6B64\u9009\u9879\u4E0D\u80FD\u4E0E --dot-output \n                                \u6216 --class-path \u4E00\u8D77\u4F7F\u7528\u3002\u5BF9\u6253\u5F00\u7684\n                                \u6A21\u5757\u4F7F\u7528 --generate-open-module \u9009\u9879\u3002
+
+main.opt.generate-open-module=\  --generate-open-module <dir>  \u4EE5\u6253\u5F00\u6A21\u5757\u7684\u65B9\u5F0F\u4E3A\u6307\u5B9A\u76EE\u5F55\u4E0B\u7684\n                                \u6307\u5B9A JAR \u6587\u4EF6\u751F\u6210 module-info.java\u3002\n                                \u6B64\u9009\u9879\u4E0D\u80FD\u4E0E --dot-output \u6216\n                                --class-path \u4E00\u8D77\u4F7F\u7528\u3002
 
 main.opt.check=\  --check <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...\n                                \u5206\u6790\u6307\u5B9A\u6A21\u5757\u7684\u88AB\u4F9D\u8D56\u5BF9\u8C61\n                                \u5B83\u8F93\u51FA\u6A21\u5757\u63CF\u8FF0\u7B26, \u5206\u6790\u4E4B\u540E\n                                \u751F\u6210\u7684\u6A21\u5757\u88AB\u4F9D\u8D56\u5BF9\u8C61\u4EE5\u53CA\n                                \u8F6C\u6362\u51CF\u5C11\u4E4B\u540E\u7684\u56FE\u5F62\u3002\u5B83\u8FD8\n                                \u6307\u793A\u4EFB\u4F55\u672A\u4F7F\u7528\u7684\u5408\u683C\u5BFC\u51FA\u3002
 
@@ -53,14 +55,20 @@
 
 main.opt.jdkinternals=\  -jdkinternals\n  --jdk-internals               \u5728 JDK \u5185\u90E8 API \u4E0A\u67E5\u627E\u7C7B\u7EA7\u522B\u7684\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002\n                                \u9664\u975E\u6307\u5B9A\u4E86 -include \u9009\u9879, \u5426\u5219\u9ED8\u8BA4\u60C5\u51B5\u4E0B,\n                                \u5B83\u5206\u6790 --class-path \u4E0A\u7684\u6240\u6709\u7C7B\u548C\u8F93\u5165\u6587\u4EF6\u3002\n                                \u6B64\u9009\u9879\u4E0D\u80FD\u4E0E -p, -e \u548C -s \u9009\u9879\n                                \u4E00\u8D77\u4F7F\u7528\u3002\n                                \u8B66\u544A: \u65E0\u6CD5\u8BBF\u95EE JDK \u5185\u90E8 API\u3002
 
+main.opt.list-deps=\  --list-deps                   \u5217\u51FA JDK \u5185\u90E8 API \u7684\n                                \u88AB\u4F9D\u8D56\u5BF9\u8C61\u548C\u4F7F\u7528\u60C5\u51B5\u3002
+
+main.opt.list-reduced-deps=\  --list-reduced-deps           \u4E0E --list-deps \u76F8\u540C, \u4E0D\u5217\u51FA\n                                \u6A21\u5757\u56FE\u4E2D\u7684\u9690\u5F0F\u8BFB\u53D6\u7EF4\u8FB9\u3002\n                                \u5982\u679C\u6A21\u5757 M1 \u4F9D\u8D56\u4E8E M2 \u548C M3,\n                                M2 \u8981\u6C42\u5728 M3 \u4E0A\u662F\u516C\u5171\u7684, \u5219 M1 \u8BFB\u53D6 M3 \n                                \u7684\u64CD\u4F5C\u662F\u9690\u5F0F\u7684, \u5E76\u4E14\u4F1A\u4ECE\u6A21\u5757\u56FE\u4E2D\u5220\u9664\u3002
+
 main.opt.depth=\  -depth=<\u6DF1\u5EA6>                 \u6307\u5B9A\u8FC7\u6E21\u88AB\u4F9D\u8D56\u5BF9\u8C61\u5206\u6790\n                                \u7684\u6DF1\u5EA6
 
 main.opt.q=\  -q       -quiet               \u5728 --generate-module-info \u8F93\u51FA\u4E2D\n                                \u4E0D\u663E\u793A\u7F3A\u5C11\u7684\u88AB\u4F9D\u8D56\u5BF9\u8C61\u3002
 
 main.opt.multi-release=\  --multi-release <\u7248\u672C>        \u6307\u5B9A\u5904\u7406\u591A\u53D1\u884C\u7248 jar \u6587\u4EF6\u65F6\u7684\n                                \u7248\u672C\u3002<\u7248\u672C> \u5E94\u4E3A\u5927\u4E8E\u7B49\u4E8E 9 \n                                \u7684\u6574\u6570\u6216\u57FA\u6570\u3002
 
+err.command.set=\u6307\u5B9A\u4E86 {0} \u548C {1} \u9009\u9879\u3002
 err.unknown.option=\u672A\u77E5\u9009\u9879: {0}
 err.missing.arg=\u6CA1\u6709\u4E3A{0}\u6307\u5B9A\u503C
+err.missing.dependences=\u7F3A\u5C11\u88AB\u4F9D\u8D56\u5BF9\u8C61
 err.invalid.arg.for.option=\u9009\u9879\u7684\u53C2\u6570\u65E0\u6548: {0}
 err.option.after.class=\u5FC5\u987B\u5728\u7C7B\u4E4B\u524D\u6307\u5B9A\u9009\u9879: {0}
 err.genmoduleinfo.not.jarfile={0} \u662F\u65E0\u6CD5\u4F7F\u7528 --generate-module-info \u9009\u9879\u6307\u5B9A\u7684\u6A21\u5757\u5316 JAR \u6587\u4EF6
@@ -68,11 +76,11 @@
 err.profiles.msg=\u6CA1\u6709\u914D\u7F6E\u6587\u4EF6\u4FE1\u606F
 err.exception.message={0}
 err.invalid.path=\u65E0\u6548\u8DEF\u5F84: {0}
-err.invalid.module.option=\u65E0\u6CD5\u4F7F\u7528 {1} \u9009\u9879\u8BBE\u7F6E {0}\u3002
-err.invalid.filters=\u53EA\u80FD\u8BBE\u7F6E --package (-p), --regex (-e), --require \u9009\u9879\u4E2D\u7684\u4E00\u4E2A
+err.invalid.options={0} \u4E0D\u80FD\u4E0E {1} \u9009\u9879\u4E00\u8D77\u4F7F\u7528
 err.module.not.found=\u627E\u4E0D\u5230\u6A21\u5757: {0}
 err.root.module.not.set=\u6839\u6A21\u5757\u96C6\u4E3A\u7A7A
-err.invalid.inverse.option={0} \u4E0D\u80FD\u4E0E --inverse \u9009\u9879\u4E00\u8D77\u4F7F\u7528
+err.option.already.specified=\u591A\u6B21\u6307\u5B9A\u4E86 {0} \u9009\u9879\u3002
+err.filter.not.specified=\u5FC5\u987B\u6307\u5B9A --package (-p), --regex (-e), --require \u9009\u9879
 err.multirelease.option.exists={0} \u4E0D\u662F\u591A\u53D1\u884C\u7248 jar \u6587\u4EF6, \u4F46\u8BBE\u7F6E\u4E86 --multi-release \u9009\u9879
 err.multirelease.option.notfound={0} \u662F\u591A\u53D1\u884C\u7248 jar \u6587\u4EF6, \u4F46\u672A\u8BBE\u7F6E --multi-release \u9009\u9879
 err.multirelease.version.associated=\u7C7B {0} \u5DF2\u4E0E\u7248\u672C {1} \u5173\u8054, \u6B63\u5728\u5C1D\u8BD5\u6DFB\u52A0\u7248\u672C {2}
@@ -82,5 +90,10 @@
 warn.split.package=\u5DF2\u5728{1} {2}\u4E2D\u5B9A\u4E49\u7A0B\u5E8F\u5305{0}
 warn.replace.useJDKInternals=\u4E0D\u652F\u6301 JDK \u5185\u90E8 API, \u5B83\u4EEC\u4E13\u7528\u4E8E\u901A\u8FC7\u4E0D\u517C\u5BB9\u65B9\u5F0F\u6765\n\u5220\u9664\u6216\u66F4\u6539\u7684 JDK \u5B9E\u73B0, \u53EF\u80FD\u4F1A\u635F\u574F\u60A8\u7684\u5E94\u7528\u7A0B\u5E8F\u3002\n\u8BF7\u4FEE\u6539\u60A8\u7684\u4EE3\u7801, \u6D88\u9664\u4E0E\u4EFB\u4F55 JDK \u5185\u90E8 API \u7684\u76F8\u5173\u6027\u3002\n\u6709\u5173 JDK \u5185\u90E8 API \u66FF\u6362\u7684\u6700\u65B0\u66F4\u65B0, \u8BF7\u67E5\u770B:\n{0}
 
+split.package=\u62C6\u5206\u7A0B\u5E8F\u5305: {0} {1}\n
+inverse.transitive.dependencies.on={0} \u7684\u9006\u5411\u8FC7\u6E21\u88AB\u4F9D\u8D56\u5BF9\u8C61
+inverse.transitive.dependencies.matching=\u4E0E {0} \u5339\u914D\u7684\u9006\u5411\u8FC7\u6E21\u88AB\u4F9D\u8D56\u5BF9\u8C61
+internal.api.column.header=JDK \u5185\u90E8 API
+public.api.replacement.column.header=\u5EFA\u8BAE\u7684\u66FF\u6362
 artifact.not.found=\u627E\u4E0D\u5230
 jdeps.wiki.url=https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool
diff --git a/langtools/src/jdk.jdeps/share/classes/module-info.java b/langtools/src/jdk.jdeps/share/classes/module-info.java
index 87e2135..a770826 100644
--- a/langtools/src/jdk.jdeps/share/classes/module-info.java
+++ b/langtools/src/jdk.jdeps/share/classes/module-info.java
@@ -25,6 +25,9 @@
 
 /** Defines tools for analysing dependencies in Java libraries and programs, including
  *  the <em>jdeps</em> and <em>javap</em> tools.
+ *
+ *  @moduleGraph
+ *  @since 9
  */
 module jdk.jdeps {
     requires java.base;
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java
index 8aa2042..a5854d8 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java
@@ -90,6 +90,17 @@
     }
 
     /**
+     * Release a JShell instance.
+     *
+     * @param state the JShell instance
+     */
+    public static void release(JShell state) {
+        if (debugMap != null) {
+            debugMap.remove(state);
+        }
+    }
+
+    /**
      * Tests if any of the specified debug flags are enabled.
      *
      * @param state the JShell instance
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java
index 3cc4eb0..ed3ad8c 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
 import java.io.InputStream;
 import java.io.InterruptedIOException;
 import java.io.PrintStream;
-import java.io.UncheckedIOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -43,9 +42,8 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Optional;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.BooleanSupplier;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -60,10 +58,10 @@
 import jdk.internal.jline.console.KeyMap;
 import jdk.internal.jline.console.Operation;
 import jdk.internal.jline.console.UserInterruptException;
-import jdk.internal.jline.console.completer.Completer;
 import jdk.internal.jline.console.history.History;
 import jdk.internal.jline.console.history.MemoryHistory;
 import jdk.internal.jline.extra.EditingHistory;
+import jdk.internal.jline.internal.NonBlockingInputStream;
 import jdk.internal.jshell.tool.StopDetectingInputStream.State;
 import jdk.internal.misc.Signal;
 import jdk.internal.misc.Signal.Handler;
@@ -82,7 +80,7 @@
 
     ConsoleIOContext(JShellTool repl, InputStream cmdin, PrintStream cmdout) throws Exception {
         this.repl = repl;
-        this.input = new StopDetectingInputStream(() -> repl.state.stop(), ex -> repl.hard("Error on input: %s", ex));
+        this.input = new StopDetectingInputStream(() -> repl.stop(), ex -> repl.hard("Error on input: %s", ex));
         Terminal term;
         if (System.getProperty("test.jdk") != null) {
             term = new TestTerminal(input);
@@ -92,10 +90,14 @@
             term = new JShellUnixTerminal(input);
         }
         term.init();
-        AtomicBoolean allowSmart = new AtomicBoolean();
+        List<CompletionTask> completionTODO = new ArrayList<>();
         in = new ConsoleReader(cmdin, cmdout, term) {
             @Override public KeyMap getKeys() {
-                return new CheckCompletionKeyMap(super.getKeys(), allowSmart);
+                return new CheckCompletionKeyMap(super.getKeys(), completionTODO);
+            }
+            @Override
+            protected boolean complete() throws IOException {
+                return ConsoleIOContext.this.complete(completionTODO);
             }
         };
         in.setExpandEvents(false);
@@ -112,67 +114,7 @@
         });
         in.setBellEnabled(true);
         in.setCopyPasteDetection(true);
-        in.addCompleter(new Completer() {
-            @Override public int complete(String test, int cursor, List<CharSequence> result) {
-                int[] anchor = new int[] {-1};
-                List<Suggestion> suggestions;
-                if (prefix.isEmpty() && test.trim().startsWith("/")) {
-                    suggestions = repl.commandCompletionSuggestions(test, cursor, anchor);
-                } else {
-                    int prefixLength = prefix.length();
-                    suggestions = repl.analysis.completionSuggestions(prefix + test, cursor + prefixLength, anchor);
-                    anchor[0] -= prefixLength;
-                }
-                boolean smart = allowSmart.get() &&
-                                suggestions.stream()
-                                           .anyMatch(Suggestion::matchesType);
-
-                allowSmart.set(!allowSmart.get());
-
-                suggestions.stream()
-                           .filter(s -> !smart || s.matchesType())
-                           .map(Suggestion::continuation)
-                           .forEach(result::add);
-
-                boolean onlySmart = suggestions.stream()
-                                               .allMatch(Suggestion::matchesType);
-
-                if (smart && !onlySmart) {
-                    Optional<String> prefix =
-                            suggestions.stream()
-                                       .map(Suggestion::continuation)
-                                       .reduce(ConsoleIOContext::commonPrefix);
-
-                    String prefixStr = prefix.orElse("").substring(cursor - anchor[0]);
-                    try {
-                        in.putString(prefixStr);
-                        cursor += prefixStr.length();
-                    } catch (IOException ex) {
-                        throw new IllegalStateException(ex);
-                    }
-                    result.add(repl.messageFormat("jshell.console.see.more"));
-                    return cursor; //anchor should not be used.
-                }
-
-                if (result.isEmpty()) {
-                    try {
-                        //provide "empty completion" feedback
-                        //XXX: this only works correctly when there is only one Completer:
-                        in.beep();
-                    } catch (IOException ex) {
-                        throw new UncheckedIOException(ex);
-                    }
-                }
-
-                return anchor[0];
-            }
-        });
-        bind(DOCUMENTATION_SHORTCUT, (Runnable) () -> documentation(repl));
-        for (FixComputer computer : FIX_COMPUTERS) {
-            for (String shortcuts : SHORTCUT_FIXES) {
-                bind(shortcuts + computer.shortcut, (Runnable) () -> fixes(computer));
-            }
-        }
+        bind(FIXES_SHORTCUT, (Runnable) () -> fixes());
         try {
             Signal.handle(new Signal("CONT"), new Handler() {
                 @Override public void handle(Signal sig) {
@@ -249,134 +191,184 @@
         }
     }
 
-    private static final String DOCUMENTATION_SHORTCUT = "\033\133\132"; //Shift-TAB
-    private static final String[] SHORTCUT_FIXES = {
-        "\033\015", //Alt-Enter (Linux)
-        "\033\012", //Alt-Enter (Linux)
-        "\033\133\061\067\176", //F6/Alt-F1 (Mac)
-        "\u001BO3P" //Alt-F1 (Linux)
-    };
+    private static final String FIXES_SHORTCUT = "\033\133\132"; //Shift-TAB
 
-    private String lastDocumentationBuffer;
-    private int lastDocumentationCursor = (-1);
+    private static final String LINE_SEPARATOR = System.getProperty("line.separator");
+    private static final String LINE_SEPARATORS2 = LINE_SEPARATOR + LINE_SEPARATOR;
 
-    private void documentation(JShellTool repl) {
-        String buffer = in.getCursorBuffer().buffer.toString();
-        int cursor = in.getCursorBuffer().cursor;
-        boolean firstInvocation = !buffer.equals(lastDocumentationBuffer) || cursor != lastDocumentationCursor;
-        lastDocumentationBuffer = buffer;
-        lastDocumentationCursor = cursor;
-        List<String> doc;
-        String seeMore;
-        Terminal term = in.getTerminal();
-        if (prefix.isEmpty() && buffer.trim().startsWith("/")) {
-            doc = Arrays.asList(repl.commandDocumentation(buffer, cursor, firstInvocation));
-            seeMore = "jshell.console.see.help";
-        } else {
-            JavadocFormatter formatter = new JavadocFormatter(term.getWidth(),
-                                                              term.isAnsiSupported());
-            Function<Documentation, String> convertor;
-            if (firstInvocation) {
-                convertor = Documentation::signature;
-            } else {
-                convertor = d -> formatter.formatJavadoc(d.signature(), d.javadoc()) +
-                                 (d.javadoc() == null ? repl.messageFormat("jshell.console.no.javadoc")
-                                                      : "");
-            }
-            doc = repl.analysis.documentation(prefix + buffer, cursor + prefix.length(), !firstInvocation)
-                               .stream()
-                               .map(convertor)
-                               .collect(Collectors.toList());
-            seeMore = "jshell.console.see.javadoc";
-        }
-
+    @SuppressWarnings("fallthrough")
+    private boolean complete(List<CompletionTask> todo) {
+        //The completion has multiple states (invoked by subsequent presses of <tab>).
+        //On the first invocation in a given sequence, all steps are precomputed
+        //and placed into the todo list. The todo list is then followed on both the first
+        //and subsequent <tab> presses:
         try {
-            if (doc != null && !doc.isEmpty()) {
-                if (firstInvocation) {
-                    in.println();
-                    in.println(doc.stream().collect(Collectors.joining("\n")));
-                    in.println(repl.messageFormat(seeMore));
-                    in.redrawLine();
-                    in.flush();
+            String text = in.getCursorBuffer().toString();
+            int cursor = in.getCursorBuffer().cursor;
+            if (todo.isEmpty()) {
+                int[] anchor = new int[] {-1};
+                List<Suggestion> suggestions;
+                List<String> doc;
+                boolean command = prefix.isEmpty() && text.trim().startsWith("/");
+                if (command) {
+                    suggestions = repl.commandCompletionSuggestions(text, cursor, anchor);
+                    doc = repl.commandDocumentation(text, cursor, true);
                 } else {
-                    in.println();
+                    int prefixLength = prefix.length();
+                    suggestions = repl.analysis.completionSuggestions(prefix + text, cursor + prefixLength, anchor);
+                    anchor[0] -= prefixLength;
+                    doc = repl.analysis.documentation(prefix + text, cursor + prefix.length(), false)
+                                       .stream()
+                                       .map(Documentation::signature)
+                                       .collect(Collectors.toList());
+                }
+                long smartCount = suggestions.stream().filter(Suggestion::matchesType).count();
+                boolean hasSmart = smartCount > 0 && smartCount <= in.getAutoprintThreshold();
+                boolean hasBoth = hasSmart &&
+                                  suggestions.stream()
+                                             .map(s -> s.matchesType())
+                                             .distinct()
+                                             .count() == 2;
+                boolean tooManyItems = suggestions.size() > in.getAutoprintThreshold();
+                CompletionTask ordinaryCompletion = new OrdinaryCompletionTask(suggestions, anchor[0], !command && !doc.isEmpty(), hasSmart);
+                CompletionTask allCompletion = new AllSuggestionsCompletionTask(suggestions, anchor[0]);
 
-                    int height = term.getHeight();
-                    String lastNote = "";
+                //the main decission tree:
+                if (command) {
+                    CompletionTask shortDocumentation = new CommandSynopsisTask(doc);
+                    CompletionTask fullDocumentation = new CommandFullDocumentationTask(todo);
 
-                    PRINT_DOC: for (Iterator<String> docIt = doc.iterator(); docIt.hasNext(); ) {
-                        String currentDoc = docIt.next();
-                        String[] lines = currentDoc.split("\n");
-                        int firstLine = 0;
-
-                        PRINT_PAGE: while (true) {
-                            int toPrint = height - 1;
-
-                            while (toPrint > 0 && firstLine < lines.length) {
-                                in.println(lines[firstLine++]);
-                                toPrint--;
-                            }
-
-                            if (firstLine >= lines.length) {
-                                break;
-                            }
-
-                            lastNote = repl.getResourceString("jshell.console.see.next.page");
-                            in.print(lastNote + ConsoleReader.RESET_LINE);
-                            in.flush();
-
-                            while (true) {
-                                int r = in.readCharacter();
-
-                                switch (r) {
-                                    case ' ': continue PRINT_PAGE;
-                                    case 'q':
-                                    case 3:
-                                        break PRINT_DOC;
-                                    default:
-                                        in.beep();
-                                        break;
-                                }
-                            }
+                    if (!doc.isEmpty()) {
+                        if (tooManyItems) {
+                            todo.add(new NoopCompletionTask());
+                            todo.add(allCompletion);
+                        } else {
+                            todo.add(ordinaryCompletion);
                         }
+                        todo.add(shortDocumentation);
+                        todo.add(fullDocumentation);
+                    } else {
+                        todo.add(new NoSuchCommandCompletionTask());
+                    }
+                } else {
+                    if (doc.isEmpty()) {
+                        if (hasSmart) {
+                            todo.add(ordinaryCompletion);
+                        } else if (tooManyItems) {
+                            todo.add(new NoopCompletionTask());
+                        }
+                        if (!hasSmart || hasBoth) {
+                            todo.add(allCompletion);
+                        }
+                    } else {
+                        CompletionTask shortDocumentation = new ExpressionSignaturesTask(doc);
+                        CompletionTask fullDocumentation = new ExpressionJavadocTask(todo);
 
-                        if (docIt.hasNext()) {
-                            lastNote = repl.getResourceString("jshell.console.see.next.javadoc");
-                            in.print(lastNote + ConsoleReader.RESET_LINE);
-                            in.flush();
-
-                            while (true) {
-                                int r = in.readCharacter();
-
-                                switch (r) {
-                                    case ' ': continue PRINT_DOC;
-                                    case 'q':
-                                    case 3:
-                                        break PRINT_DOC;
-                                    default:
-                                        in.beep();
-                                        break;
-                                }
-                            }
+                        if (hasSmart) {
+                            todo.add(ordinaryCompletion);
+                        }
+                        todo.add(shortDocumentation);
+                        if (!hasSmart || hasBoth) {
+                            todo.add(allCompletion);
+                        }
+                        if (tooManyItems) {
+                            todo.add(todo.size() - 1, fullDocumentation);
+                        } else {
+                            todo.add(fullDocumentation);
                         }
                     }
-                    //clear the "press space" line:
-                    in.getCursorBuffer().buffer.replace(0, buffer.length(), lastNote);
-                    in.getCursorBuffer().cursor = 0;
-                    in.killLine();
-                    in.getCursorBuffer().buffer.append(buffer);
-                    in.getCursorBuffer().cursor = cursor;
-                    in.redrawLine();
-                    in.flush();
                 }
-            } else {
-                in.beep();
             }
+
+            boolean success = false;
+            boolean repaint = true;
+
+            OUTER: while (!todo.isEmpty()) {
+                CompletionTask.Result result = todo.remove(0).perform(text, cursor);
+
+                switch (result) {
+                    case CONTINUE:
+                        break;
+                    case SKIP_NOREPAINT:
+                        repaint = false;
+                    case SKIP:
+                        todo.clear();
+                        //intentional fall-through
+                    case FINISH:
+                        success = true;
+                        //intentional fall-through
+                    case NO_DATA:
+                        if (!todo.isEmpty()) {
+                            in.println();
+                            in.println(todo.get(0).description());
+                        }
+                        break OUTER;
+                }
+            }
+
+            if (repaint) {
+                in.redrawLine();
+                in.flush();
+            }
+
+            return success;
         } catch (IOException ex) {
             throw new IllegalStateException(ex);
         }
     }
 
+    private CompletionTask.Result doPrintFullDocumentation(List<CompletionTask> todo, List<String> doc, boolean command) {
+        if (doc != null && !doc.isEmpty()) {
+            Terminal term = in.getTerminal();
+            int pageHeight = term.getHeight() - NEEDED_LINES;
+            List<CompletionTask> thisTODO = new ArrayList<>();
+
+            for (Iterator<String> docIt = doc.iterator(); docIt.hasNext(); ) {
+                String currentDoc = docIt.next();
+                String[] lines = currentDoc.split("\n");
+                int firstLine = 0;
+
+                while (firstLine < lines.length) {
+                    boolean first = firstLine == 0;
+                    String[] thisPageLines =
+                            Arrays.copyOfRange(lines,
+                                               firstLine,
+                                               Math.min(firstLine + pageHeight, lines.length));
+
+                    thisTODO.add(new CompletionTask() {
+                        @Override
+                        public String description() {
+                            String key =  !first ? "jshell.console.see.next.page"
+                                                 : command ? "jshell.console.see.next.command.doc"
+                                                           : "jshell.console.see.next.javadoc";
+
+                            return repl.getResourceString(key);
+                        }
+
+                        @Override
+                        public Result perform(String text, int cursor) throws IOException {
+                            in.println();
+                            for (String line : thisPageLines) {
+                                in.println(line);
+                            }
+                            return Result.FINISH;
+                        }
+                    });
+
+                    firstLine += pageHeight;
+                }
+            }
+
+            todo.addAll(0, thisTODO);
+
+            return CompletionTask.Result.CONTINUE;
+        }
+
+        return CompletionTask.Result.FINISH;
+    }
+    //where:
+        private static final int NEEDED_LINES = 4;
+
     private static String commonPrefix(String str1, String str2) {
         for (int i = 0; i < str2.length(); i++) {
             if (!str1.startsWith(str2.substring(0, i + 1))) {
@@ -387,6 +379,262 @@
         return str2;
     }
 
+    private interface CompletionTask {
+        public String description();
+        public Result perform(String text, int cursor) throws IOException;
+
+        enum Result {
+            NO_DATA,
+            CONTINUE,
+            FINISH,
+            SKIP,
+            SKIP_NOREPAINT;
+        }
+    }
+
+    private final class NoopCompletionTask implements CompletionTask {
+
+        @Override
+        public String description() {
+            throw new UnsupportedOperationException("Should not get here.");
+        }
+
+        @Override
+        public Result perform(String text, int cursor) throws IOException {
+            return Result.FINISH;
+        }
+
+    }
+
+    private final class NoSuchCommandCompletionTask implements CompletionTask {
+
+        @Override
+        public String description() {
+            throw new UnsupportedOperationException("Should not get here.");
+        }
+
+        @Override
+        public Result perform(String text, int cursor) throws IOException {
+            in.println();
+            in.println(repl.getResourceString("jshell.console.no.such.command"));
+            in.println();
+            return Result.SKIP;
+        }
+
+    }
+
+    private final class OrdinaryCompletionTask implements CompletionTask {
+        private final List<Suggestion> suggestions;
+        private final int anchor;
+        private final boolean cont;
+        private final boolean smart;
+
+        public OrdinaryCompletionTask(List<Suggestion> suggestions,
+                                      int anchor,
+                                      boolean cont,
+                                      boolean smart) {
+            this.suggestions = suggestions;
+            this.anchor = anchor;
+            this.cont = cont;
+            this.smart = smart;
+        }
+
+        @Override
+        public String description() {
+            throw new UnsupportedOperationException("Should not get here.");
+        }
+
+        @Override
+        public Result perform(String text, int cursor) throws IOException {
+            List<CharSequence> toShow;
+
+            if (smart) {
+                toShow =
+                    suggestions.stream()
+                               .filter(Suggestion::matchesType)
+                               .map(Suggestion::continuation)
+                               .distinct()
+                               .collect(Collectors.toList());
+            } else {
+                toShow =
+                    suggestions.stream()
+                               .map(Suggestion::continuation)
+                               .distinct()
+                               .collect(Collectors.toList());
+            }
+
+            if (toShow.isEmpty()) {
+                return Result.CONTINUE;
+            }
+
+            Optional<String> prefix =
+                    suggestions.stream()
+                               .map(Suggestion::continuation)
+                               .reduce(ConsoleIOContext::commonPrefix);
+
+            String prefixStr = prefix.orElse("").substring(cursor - anchor);
+            in.putString(prefixStr);
+
+            boolean showItems = toShow.size() > 1 || smart;
+
+            if (showItems) {
+                in.println();
+                in.printColumns(toShow);
+            }
+
+            if (!prefixStr.isEmpty())
+                return showItems ? Result.SKIP : Result.SKIP_NOREPAINT;
+
+            return cont ? Result.CONTINUE : Result.FINISH;
+        }
+
+    }
+
+    private final class AllSuggestionsCompletionTask implements CompletionTask {
+        private final List<Suggestion> suggestions;
+        private final int anchor;
+
+        public AllSuggestionsCompletionTask(List<Suggestion> suggestions,
+                                            int anchor) {
+            this.suggestions = suggestions;
+            this.anchor = anchor;
+        }
+
+        @Override
+        public String description() {
+            if (suggestions.size() <= in.getAutoprintThreshold()) {
+                return repl.getResourceString("jshell.console.completion.all.completions");
+            } else {
+                return repl.messageFormat("jshell.console.completion.all.completions.number", suggestions.size());
+            }
+        }
+
+        @Override
+        public Result perform(String text, int cursor) throws IOException {
+            List<String> candidates =
+                    suggestions.stream()
+                               .map(Suggestion::continuation)
+                               .distinct()
+                               .collect(Collectors.toList());
+
+            Optional<String> prefix =
+                    candidates.stream()
+                              .reduce(ConsoleIOContext::commonPrefix);
+
+            String prefixStr = prefix.map(str -> str.substring(cursor - anchor)).orElse("");
+            in.putString(prefixStr);
+            if (candidates.size() > 1) {
+                in.println();
+                in.printColumns(candidates);
+            }
+            return suggestions.isEmpty() ? Result.NO_DATA : Result.FINISH;
+        }
+
+    }
+
+    private final class CommandSynopsisTask implements CompletionTask {
+
+        private final List<String> synopsis;
+
+        public CommandSynopsisTask(List<String> synposis) {
+            this.synopsis = synposis;
+        }
+
+        @Override
+        public String description() {
+            return repl.getResourceString("jshell.console.see.synopsis");
+        }
+
+        @Override
+        public Result perform(String text, int cursor) throws IOException {
+            try {
+                in.println();
+                in.println(synopsis.stream()
+                                   .map(l -> l.replaceAll("\n", LINE_SEPARATOR))
+                                   .collect(Collectors.joining(LINE_SEPARATORS2)));
+            } catch (IOException ex) {
+                throw new IllegalStateException(ex);
+            }
+            return Result.FINISH;
+        }
+
+    }
+
+    private final class CommandFullDocumentationTask implements CompletionTask {
+
+        private final List<CompletionTask> todo;
+
+        public CommandFullDocumentationTask(List<CompletionTask> todo) {
+            this.todo = todo;
+        }
+
+        @Override
+        public String description() {
+            return repl.getResourceString("jshell.console.see.full.documentation");
+        }
+
+        @Override
+        public Result perform(String text, int cursor) throws IOException {
+            List<String> fullDoc = repl.commandDocumentation(text, cursor, false);
+            return doPrintFullDocumentation(todo, fullDoc, true);
+        }
+
+    }
+
+    private final class ExpressionSignaturesTask implements CompletionTask {
+
+        private final List<String> doc;
+
+        public ExpressionSignaturesTask(List<String> doc) {
+            this.doc = doc;
+        }
+
+        @Override
+        public String description() {
+            throw new UnsupportedOperationException("Should not get here.");
+        }
+
+        @Override
+        public Result perform(String text, int cursor) throws IOException {
+            in.println();
+            in.println(repl.getResourceString("jshell.console.completion.current.signatures"));
+            in.println(doc.stream().collect(Collectors.joining(LINE_SEPARATOR)));
+            return Result.FINISH;
+        }
+
+    }
+
+    private final class ExpressionJavadocTask implements CompletionTask {
+
+        private final List<CompletionTask> todo;
+
+        public ExpressionJavadocTask(List<CompletionTask> todo) {
+            this.todo = todo;
+        }
+
+        @Override
+        public String description() {
+            return repl.getResourceString("jshell.console.see.documentation");
+        }
+
+        @Override
+        public Result perform(String text, int cursor) throws IOException {
+            //schedule showing javadoc:
+            Terminal term = in.getTerminal();
+            JavadocFormatter formatter = new JavadocFormatter(term.getWidth(),
+                                                              term.isAnsiSupported());
+            Function<Documentation, String> convertor = d -> formatter.formatJavadoc(d.signature(), d.javadoc()) +
+                             (d.javadoc() == null ? repl.messageFormat("jshell.console.no.javadoc")
+                                                  : "");
+            List<String> doc = repl.analysis.documentation(prefix + text, cursor + prefix.length(), true)
+                                            .stream()
+                                            .map(convertor)
+                                            .collect(Collectors.toList());
+            return doPrintFullDocumentation(todo, doc, false);
+        }
+
+    }
+
     @Override
     public boolean terminalEditorRunning() {
         Terminal terminal = in.getTerminal();
@@ -427,6 +675,50 @@
         history.fullHistoryReplace(source);
     }
 
+    private static final long ESCAPE_TIMEOUT = 100;
+
+    private void fixes() {
+        try {
+            int c = in.readCharacter();
+
+            if (c == (-1)) {
+                return ;
+            }
+
+            for (FixComputer computer : FIX_COMPUTERS) {
+                if (computer.shortcut == c) {
+                    fixes(computer);
+                    return ;
+                }
+            }
+
+            readOutRemainingEscape(c);
+
+            in.beep();
+            in.println();
+            in.println(repl.getResourceString("jshell.fix.wrong.shortcut"));
+            in.redrawLine();
+            in.flush();
+        } catch (IOException ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    private void readOutRemainingEscape(int c) throws IOException {
+        if (c == '\033') {
+            //escape, consume waiting input:
+            InputStream inp = in.getInput();
+
+            if (inp instanceof NonBlockingInputStream) {
+                NonBlockingInputStream nbis = (NonBlockingInputStream) inp;
+
+                while (nbis.isNonBlockingEnabled() && nbis.peek(ESCAPE_TIMEOUT) > 0) {
+                    in.readCharacter();
+                }
+            }
+        }
+    }
+
     //compute possible options/Fixes based on the selected FixComputer, present them to the user,
     //and perform the selected one:
     private void fixes(FixComputer computer) {
@@ -492,7 +784,7 @@
                 in.flush();
             }
         } catch (IOException ex) {
-            ex.printStackTrace();
+            throw new IllegalStateException(ex);
         }
     }
 
@@ -615,7 +907,7 @@
 
                             @Override
                             public void perform(ConsoleReader in) throws IOException {
-                                repl.state.eval("import " + type + ";");
+                                repl.processCompleteSource("import " + type + ";");
                                 in.println("Imported: " + type);
                                 performToVar(in, stype);
                             }
@@ -639,7 +931,7 @@
 
                         @Override
                         public void perform(ConsoleReader in) throws IOException {
-                            repl.state.eval("import " + fqn + ";");
+                            repl.processCompleteSource("import " + fqn + ";");
                             in.println("Imported: " + fqn);
                             in.redrawLine();
                         }
@@ -765,7 +1057,7 @@
         public TestTerminal(StopDetectingInputStream input) throws Exception {
             super(true);
             setAnsiSupported(false);
-            setEchoEnabled(true);
+            setEchoEnabled(false);
             this.input = input;
         }
 
@@ -785,12 +1077,12 @@
     private static final class CheckCompletionKeyMap extends KeyMap {
 
         private final KeyMap del;
-        private final AtomicBoolean allowSmart;
+        private final List<CompletionTask> completionTODO;
 
-        public CheckCompletionKeyMap(KeyMap del, AtomicBoolean allowSmart) {
+        public CheckCompletionKeyMap(KeyMap del, List<CompletionTask> completionTODO) {
             super(del.getName(), del.isViKeyMap());
             this.del = del;
-            this.allowSmart = allowSmart;
+            this.completionTODO = completionTODO;
         }
 
         @Override
@@ -818,7 +1110,7 @@
             Object res = del.getBound(keySeq);
 
             if (res != Operation.COMPLETE) {
-                allowSmart.set(true);
+                completionTODO.clear();
             }
 
             return res;
@@ -834,4 +1126,4 @@
             return "check: " + del.toString();
         }
     }
-}
+    }
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java
index 80641a5..bbd9196 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java
@@ -116,6 +116,13 @@
                 name, type, value, unresolved, errorLines);
     }
 
+    public String format(String field, FormatCase fc, FormatAction fa, FormatWhen fw,
+                    FormatResolve fr, FormatUnresolved fu, FormatErrors fe,
+                    String name, String type, String value, String unresolved, List<String> errorLines) {
+        return mode.format(field, fc, fa, fw, fr, fu, fe,
+                name, type, value, unresolved, errorLines);
+    }
+
     public String truncateVarValue(String value) {
         return mode.truncateVarValue(value);
     }
@@ -463,6 +470,14 @@
         String format(FormatCase fc, FormatAction fa, FormatWhen fw,
                     FormatResolve fr, FormatUnresolved fu, FormatErrors fe,
                     String name, String type, String value, String unresolved, List<String> errorLines) {
+            return format("display", fc, fa, fw, fr, fu, fe,
+                name, type, value, unresolved, errorLines);
+        }
+
+        // Compute the display output given full context and values
+        String format(String field, FormatCase fc, FormatAction fa, FormatWhen fw,
+                    FormatResolve fr, FormatUnresolved fu, FormatErrors fe,
+                    String name, String type, String value, String unresolved, List<String> errorLines) {
             // Convert the context into a bit representation used as selectors for store field formats
             long bits = bits(fc, fa, fw, fr, fu, fe);
             String fname = name==null? "" : name;
@@ -476,7 +491,7 @@
                             fname, ftype, fvalue, funresolved, "*cannot-use-errors-here*", el))
                     .collect(joining());
             return String.format(
-                    format("display", bits),
+                    format(field, bits),
                     fname, ftype, fvalue, funresolved, errors, "*cannot-use-err-here*");
         }
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
index 6cc5165..1c4283d 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,12 +36,9 @@
 import java.io.PrintStream;
 import java.io.Reader;
 import java.io.StringReader;
-import java.net.URL;
 import java.nio.charset.Charset;
-import java.nio.file.AccessDeniedException;
 import java.nio.file.FileSystems;
 import java.nio.file.Files;
-import java.nio.file.NoSuchFileException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.text.MessageFormat;
@@ -190,7 +187,7 @@
     private Options options;
 
     SourceCodeAnalysis analysis;
-    JShell state = null;
+    private JShell state = null;
     Subscription shutdownSubscription = null;
 
     static final EditorSetting BUILT_IN_EDITOR = new EditorSetting(null, false);
@@ -198,6 +195,7 @@
     private boolean debug = false;
     public boolean testPrompt = false;
     private Startup startup = null;
+    private boolean isCurrentlyRunningStartup = false;
     private String executionControlSpec = null;
     private EditorSetting editor = BUILT_IN_EDITOR;
 
@@ -352,9 +350,56 @@
             }
         }
 
+        // check that the supplied string represent valid class/module paths
+        // converting any ~/ to user home
+        private Collection<String> validPaths(Collection<String> vals, String context, boolean isModulePath) {
+            Stream<String> result = vals.stream()
+                    .map(s -> Arrays.stream(s.split(File.pathSeparator))
+                        .map(sp -> toPathResolvingUserHome(sp))
+                        .filter(p -> checkValidPathEntry(p, context, isModulePath))
+                        .map(p -> p.toString())
+                        .collect(Collectors.joining(File.pathSeparator)));
+            if (failed) {
+                return Collections.emptyList();
+            } else {
+                return result.collect(toList());
+            }
+        }
+
+        // Adapted from compiler method Locations.checkValidModulePathEntry
+        private boolean checkValidPathEntry(Path p, String context, boolean isModulePath) {
+            if (!Files.exists(p)) {
+                msg("jshell.err.file.not.found", context, p);
+                failed = true;
+                return false;
+            }
+            if (Files.isDirectory(p)) {
+                // if module-path, either an exploded module or a directory of modules
+                return true;
+            }
+
+            String name = p.getFileName().toString();
+            int lastDot = name.lastIndexOf(".");
+            if (lastDot > 0) {
+                switch (name.substring(lastDot)) {
+                    case ".jar":
+                        return true;
+                    case ".jmod":
+                        if (isModulePath) {
+                            return true;
+                        }
+                }
+            }
+            msg("jshell.err.arg", context, p);
+            failed = true;
+            return false;
+        }
+
         Options parse(OptionSet options) {
-            addOptions(OptionKind.CLASS_PATH, options.valuesOf(argClassPath));
-            addOptions(OptionKind.MODULE_PATH, options.valuesOf(argModulePath));
+            addOptions(OptionKind.CLASS_PATH,
+                    validPaths(options.valuesOf(argClassPath), "--class-path", false));
+            addOptions(OptionKind.MODULE_PATH,
+                    validPaths(options.valuesOf(argModulePath), "--module-path", true));
             addOptions(OptionKind.ADD_MODULES, options.valuesOf(argAddModules));
             addOptions(OptionKind.ADD_EXPORTS, options.valuesOf(argAddExports).stream()
                     .map(mp -> mp.contains("=") ? mp : mp + "=ALL-UNNAMED")
@@ -812,6 +857,12 @@
         }
     }
 
+    /**
+     * The entry point into the JShell tool.
+     *
+     * @param args the command-line arguments
+     * @throws Exception catastrophic fatal exception
+     */
     public void start(String[] args) throws Exception {
         OptionParserCommandLine commandLineArgs = new OptionParserCommandLine();
         options = commandLineArgs.parse(args);
@@ -842,30 +893,33 @@
                 hardmsg("jshell.msg.welcome", version());
             }
             // Be sure history is always saved so that user code isn't lost
-            Runtime.getRuntime().addShutdownHook(new Thread() {
+            Thread shutdownHook = new Thread() {
                 @Override
                 public void run() {
                     replayableHistory.storeHistory(prefs);
                 }
-            });
+            };
+            Runtime.getRuntime().addShutdownHook(shutdownHook);
             // execute from user input
             try (IOContext in = new ConsoleIOContext(this, cmdin, console)) {
-                start(in);
-            }
-        }
-    }
-
-    private void start(IOContext in) {
-        try {
-            while (regenerateOnDeath) {
-                if (!live) {
-                    resetState();
+                while (regenerateOnDeath) {
+                    if (!live) {
+                        resetState();
+                    }
+                    run(in);
                 }
-                run(in);
+            } finally {
+                replayableHistory.storeHistory(prefs);
+                closeState();
+                try {
+                    Runtime.getRuntime().removeShutdownHook(shutdownHook);
+                } catch (Exception ex) {
+                    // ignore, this probably caused by VM aready being shutdown
+                    // and this is the last act anyhow
+                }
             }
-        } finally {
-            closeState();
         }
+        closeState();
     }
 
     private EditorSetting configEditor() {
@@ -966,7 +1020,19 @@
         analysis = state.sourceCodeAnalysis();
         live = true;
 
-        startUpRun(startup.toString());
+        // Run the start-up script.
+        // Avoid an infinite loop running start-up while running start-up.
+        // This could, otherwise, occur when /env /reset or /reload commands are
+        // in the start-up script.
+        if (!isCurrentlyRunningStartup) {
+            try {
+                isCurrentlyRunningStartup = true;
+                startUpRun(startup.toString());
+            } finally {
+                isCurrentlyRunningStartup = false;
+            }
+        }
+        // Record subsequent snippets in the main namespace.
         currentNameSpace = mainNamespace;
     }
 
@@ -1019,6 +1085,8 @@
         live = false;
         JShell oldState = state;
         if (oldState != null) {
+            state = null;
+            analysis = null;
             oldState.unsubscribe(shutdownSubscription); // No notification
             oldState.close();
         }
@@ -1361,12 +1429,18 @@
             List<Suggestion> result;
             int pastSpace = code.indexOf(' ') + 1; // zero if no space
             if (pastSpace == 0) {
+                // initially suggest commands (with slash) and subjects,
+                // however, if their subject starts without slash, include
+                // commands without slash
+                boolean noslash = code.length() > 0 && !code.startsWith("/");
                 result = new FixedCompletionProvider(commands.values().stream()
                         .filter(cmd -> cmd.kind.showInHelp || cmd.kind == CommandKind.HELP_SUBJECT)
-                        .map(c -> c.command + " ")
+                        .map(c -> ((noslash && c.command.startsWith("/"))
+                                ? c.command.substring(1)
+                                : c.command) + " ")
                         .toArray(String[]::new))
                         .completionSuggestions(code, cursor, anchor);
-            } else if (code.startsWith("/se")) {
+            } else if (code.startsWith("/se") || code.startsWith("se")) {
                 result = new FixedCompletionProvider(SET_SUBCOMMANDS)
                         .completionSuggestions(code.substring(pastSpace), cursor - pastSpace, anchor);
             } else {
@@ -1621,19 +1695,34 @@
         return commandCompletions.completionSuggestions(code, cursor, anchor);
     }
 
-    public String commandDocumentation(String code, int cursor, boolean shortDescription) {
+    public List<String> commandDocumentation(String code, int cursor, boolean shortDescription) {
         code = code.substring(0, cursor);
         int space = code.indexOf(' ');
+        String prefix = space != (-1) ? code.substring(0, space) : code;
+        List<String> result = new ArrayList<>();
 
-        if (space != (-1)) {
-            String cmd = code.substring(0, space);
-            Command command = commands.get(cmd);
-            if (command != null) {
-                return getResourceString(command.helpKey + (shortDescription ? ".summary" : ""));
+        List<Entry<String, Command>> toShow =
+                commands.entrySet()
+                        .stream()
+                        .filter(e -> e.getKey().startsWith(prefix))
+                        .filter(e -> e.getValue().kind.showInHelp)
+                        .sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey()))
+                        .collect(Collectors.toList());
+
+        if (toShow.size() == 1) {
+            result.add(getResourceString(toShow.get(0).getValue().helpKey + (shortDescription ? ".summary" : "")));
+        } else {
+            for (Entry<String, Command> e : toShow) {
+                result.add(e.getKey() + "\n" +getResourceString(e.getValue().helpKey + (shortDescription ? ".summary" : "")));
             }
         }
 
-        return null;
+        return result;
+    }
+
+    // Attempt to stop currently running evaluation
+    void stop() {
+        state.stop();
     }
 
     // --- Command implementations ---
@@ -2006,7 +2095,6 @@
     private boolean cmdExit() {
         regenerateOnDeath = false;
         live = false;
-        replayableHistory.storeHistory(prefs);
         fluffmsg("jshell.msg.goodbye");
         return true;
     }
@@ -2015,8 +2103,11 @@
         ArgTokenizer at = new ArgTokenizer("/help", arg);
         String subject = at.next();
         if (subject != null) {
+            // check if the requested subject is a help subject or
+            // a command, with or without slash
             Command[] matches = commands.values().stream()
-                    .filter(c -> c.command.startsWith(subject))
+                    .filter(c -> c.command.startsWith(subject)
+                              || c.command.substring(1).startsWith(subject))
                     .toArray(Command[]::new);
             if (matches.length == 1) {
                 String cmd = matches[0].command;
@@ -2041,6 +2132,18 @@
                 }
                 return true;
             } else {
+                // failing everything else, check if this is the start of
+                // a /set sub-command name
+                String[] subs = Arrays.stream(SET_SUBCOMMANDS)
+                        .filter(s -> s.startsWith(subject))
+                        .toArray(String[]::new);
+                if (subs.length > 0) {
+                    for (String sub : subs) {
+                        hardrb("help.set." + sub);
+                        hard("");
+                    }
+                    return true;
+                }
                 errormsg("jshell.err.help.arg", arg);
             }
         }
@@ -2614,9 +2717,16 @@
         if (stream == null) {
             return false;
         }
-        stream.forEachOrdered(mk
-                -> hard("  %s %s", mk.name(), mk.signature())
-        );
+        stream.forEachOrdered(meth -> {
+            String sig = meth.signature();
+            int i = sig.lastIndexOf(")") + 1;
+            if (i <= 0) {
+                hard("  %s", meth.name());
+            } else {
+                hard("  %s %s%s", sig.substring(i), meth.name(), sig.substring(0, i));
+            }
+            printSnippetStatus(meth, true);
+        });
         return true;
     }
 
@@ -2648,6 +2758,7 @@
                     break;
             }
             hard("  %s %s", kind, ck.name());
+            printSnippetStatus(ck, true);
         });
         return true;
     }
@@ -2782,7 +2893,7 @@
         }
     }
     //where
-    private boolean processCompleteSource(String source) throws IllegalStateException {
+    boolean processCompleteSource(String source) throws IllegalStateException {
         debug("Compiling: %s", source);
         boolean failed = false;
         boolean isActive = false;
@@ -2837,7 +2948,8 @@
                         return true;
                     }
                 } else {
-                    new DisplayEvent(ste, false, ste.value(), diagnostics).displayDeclarationAndValue();
+                    new DisplayEvent(ste, FormatWhen.PRIMARY, ste.value(), diagnostics)
+                            .displayDeclarationAndValue();
                 }
             } else {
                 if (diagnostics.isEmpty()) {
@@ -2851,7 +2963,8 @@
                 List<Diag> other = errorsOnly(diagnostics);
 
                 // display update information
-                new DisplayEvent(ste, true, ste.value(), other).displayDeclarationAndValue();
+                new DisplayEvent(ste, FormatWhen.UPDATE, ste.value(), other)
+                        .displayDeclarationAndValue();
             }
         }
         return false;
@@ -2889,10 +3002,7 @@
     }
     //where
     void printUnresolvedException(UnresolvedReferenceException ex) {
-        DeclarationSnippet corralled =  ex.getSnippet();
-        List<Diag> otherErrors = errorsOnly(state.diagnostics(corralled).collect(toList()));
-        new DisplayEvent(corralled, state.status(corralled), FormatAction.USED, true, null, otherErrors)
-                .displayDeclarationAndValue();
+        printSnippetStatus(ex.getSnippet(), false);
     }
     //where
     void printEvalException(EvalException ex) {
@@ -2934,23 +3044,38 @@
         return act;
     }
 
+    void printSnippetStatus(DeclarationSnippet sn, boolean resolve) {
+        List<Diag> otherErrors = errorsOnly(state.diagnostics(sn).collect(toList()));
+        new DisplayEvent(sn, state.status(sn), resolve, otherErrors)
+                .displayDeclarationAndValue();
+    }
+
     class DisplayEvent {
         private final Snippet sn;
         private final FormatAction action;
-        private final boolean update;
+        private final FormatWhen update;
         private final String value;
         private final List<String> errorLines;
         private final FormatResolve resolution;
         private final String unresolved;
         private final FormatUnresolved unrcnt;
         private final FormatErrors errcnt;
+        private final boolean resolve;
 
-        DisplayEvent(SnippetEvent ste, boolean update, String value, List<Diag> errors) {
-            this(ste.snippet(), ste.status(), toAction(ste.status(), ste.previousStatus(), ste.isSignatureChange()), update, value, errors);
+        DisplayEvent(SnippetEvent ste, FormatWhen update, String value, List<Diag> errors) {
+            this(ste.snippet(), ste.status(), false,
+                    toAction(ste.status(), ste.previousStatus(), ste.isSignatureChange()),
+                    update, value, errors);
         }
 
-        DisplayEvent(Snippet sn, Status status, FormatAction action, boolean update, String value, List<Diag> errors) {
+        DisplayEvent(Snippet sn, Status status, boolean resolve, List<Diag> errors) {
+            this(sn, status, resolve, FormatAction.USED, FormatWhen.UPDATE, null, errors);
+        }
+
+        private DisplayEvent(Snippet sn, Status status, boolean resolve,
+                FormatAction action, FormatWhen update, String value, List<Diag> errors) {
             this.sn = sn;
+            this.resolve =resolve;
             this.action = action;
             this.update = update;
             this.value = value;
@@ -2958,6 +3083,12 @@
             for (Diag d : errors) {
                 displayDiagnostics(sn.source(), d, errorLines);
             }
+            if (resolve) {
+                // resolve needs error lines indented
+                for (int i = 0; i < errorLines.size(); ++i) {
+                    errorLines.set(i, "    " + errorLines.get(i));
+                }
+            }
             long unresolvedCount;
             if (sn instanceof DeclarationSnippet && (status == Status.RECOVERABLE_DEFINED || status == Status.RECOVERABLE_NOT_DEFINED)) {
                 resolution = (status == Status.RECOVERABLE_NOT_DEFINED)
@@ -3012,10 +3143,17 @@
         }
 
         private void custom(FormatCase fcase, String name, String type) {
-            String display = feedback.format(fcase, action, (update ? FormatWhen.UPDATE : FormatWhen.PRIMARY),
-                    resolution, unrcnt, errcnt,
-                    name, type, value, unresolved, errorLines);
-            if (interactive()) {
+            if (resolve) {
+                String resolutionErrors = feedback.format("resolve", fcase, action, update,
+                        resolution, unrcnt, errcnt,
+                        name, type, value, unresolved, errorLines);
+                if (!resolutionErrors.trim().isEmpty()) {
+                    hard("    %s", resolutionErrors);
+                }
+            } else if (interactive()) {
+                String display = feedback.format(fcase, action, update,
+                        resolution, unrcnt, errcnt,
+                        name, type, value, unresolved, errorLines);
                 cmdout.print(display);
             }
         }
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties
index b743f15..734b280 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -97,7 +97,10 @@
 jshell.msg.help.subject =\n\
 For more information type ''/help'' followed by the name of a\n\
 command or a subject.\n\
-For example ''/help /list'' or ''/help intro''.  Subjects:\n
+For example ''/help /list'' or ''/help intro''.\n\
+\n\
+Subjects:\n\
+\n
 
 jshell.err.drop.arg =\
 In the /drop argument, please specify an import, variable, method, or class to drop.\n\
@@ -150,12 +153,17 @@
 
 jshell.err.corrupted.stored.startup = Corrupted stored startup, using default -- {0}
 
-jshell.console.see.more = <press tab to see more>
-jshell.console.see.javadoc = <press shift-tab again to see javadoc>
-jshell.console.see.help = <press shift-tab again to see detailed help>
-jshell.console.see.next.page = <press space for next page, Q to quit>
-jshell.console.see.next.javadoc = <press space for next javadoc, Q to quit>
-jshell.console.no.javadoc = <no javadoc found>
+jshell.console.see.synopsis = <press tab again to see synopsis>
+jshell.console.see.full.documentation = <press tab again to see full documentation>
+jshell.console.see.documentation = <press tab again to see documentation>
+jshell.console.see.next.page = <press tab again to see next page>
+jshell.console.see.next.javadoc = <press tab to see next documentation>
+jshell.console.see.next.command.doc = <press tab to see next command>
+jshell.console.no.such.command = No such command
+jshell.console.completion.current.signatures = Signatures:
+jshell.console.completion.all.completions.number = <press tab again to see all possible completions; total possible completions: {0}>
+jshell.console.completion.all.completions = <press tab again to see all possible completions>
+jshell.console.no.javadoc = <no documentation found>
 jshell.console.do.nothing = Do nothing
 jshell.console.choice = Choice: \
 
@@ -403,7 +411,7 @@
 /help\n\t\
      List the jshell commands and help subjects.\n\n\
 /help <command>\n\t\
-     Display information about the specified comand. The slash must be included.\n\t\
+     Display information about the specified command. The slash must be included.\n\t\
      Only the first few letters of the command are needed -- if more than one\n\t\
      each will be displayed.  Example:  /help /li\n\n\
 /help <subject>\n\t\
@@ -444,7 +452,7 @@
 /?\n\t\
      Display list of commands and help subjects.\n\
 /? <command>\n\t\
-     Display information about the specified comand. The slash must be included.\n\t\
+     Display information about the specified command. The slash must be included.\n\t\
      Only the first few letters of the command are needed -- if more than one\n\t\
      match, each will be displayed.  Example:  /? /li\n\
 /? <subject>\n\t\
@@ -478,7 +486,8 @@
 \n\
 For a list of commands: /help
 
-help.shortcuts.summary = a description of shortcuts
+help.shortcuts.summary = a description of keystrokes for snippet and command completion,\n\
+information access, and automatic code generation
 help.shortcuts =\
 Supported shortcuts include:\n\
 \n\
@@ -486,19 +495,16 @@
         After entering the first few letters of a Java identifier,\n\t\t\
         a jshell command, or, in some cases, a jshell command argument,\n\t\t\
         press the <tab> key to complete the input.\n\t\t\
-        If there is more than one completion, show possible completions.\n\n\
-Shift-<tab>\n\t\t\
-        After the name and open parenthesis of a method or constructor invocation,\n\t\t\
-        hold the <shift> key and press the <tab> to see a synopsis of all\n\t\t\
-        matching methods/constructors.\n\n\
-<fix-shortcut> v\n\t\t\
-        After a complete expression, press "<fix-shortcut> v" to introduce a new variable\n\t\t\
-        whose type is based on the type of the expression.\n\t\t\
-        The "<fix-shortcut>" is either Alt-F1 or Alt-Enter, depending on the platform.\n\n\
-<fix-shortcut> i\n\t\t\
-        After an unresolvable identifier, press "<fix-shortcut> i" and jshell will propose\n\t\t\
-        possible fully qualified names based on the content of the specified classpath.\n\t\t\
-        The "<fix-shortcut>" is either Alt-F1 or Alt-Enter, depending on the platform.
+        If there is more than one completion, then possible completions will be shown.\n\t\t\
+        Will show documentation if available and appropriate.\n\n\
+Shift-<tab> v\n\t\t\
+        After a complete expression, hold down <shift> while pressing <tab>,\n\t\t\
+        then release and press "v", the expression will be converted to\n\t\t\
+        a variable declaration whose type is based on the type of the expression.\n\n\
+Shift-<tab> i\n\t\t\
+        After an unresolvable identifier, hold down <shift> while pressing <tab>,\n\t\t\
+        then release and press "i", and jshell will propose possible imports\n\t\t\
+        which will resolve the identifier based on the content of the specified classpath.
 
 help.context.summary = the evaluation context options for /env /reload and /reset
 help.context =\
@@ -650,7 +656,7 @@
    varinit    -- variable declaration with init\n\t\
    expression -- expression -- note: {name}==scratch-variable-name\n\t\
    varvalue   -- variable value expression\n\t\
-   assignment -- assign variable\n\t\
+   assignment -- assign variable\n\
 The action selector kind describes what happened to the snippet.  The values are:\n\t\
    added     -- snippet has been added\n\t\
    modified  -- an existing snippet has been modified\n\t\
@@ -791,7 +797,7 @@
 help.set.start =\
 Set the start-up configuration -- a sequence of snippets and commands read at start-up:\n\
 \n\t\
-/set start [-retain] <file>\n\
+/set start [-retain] <file>...\n\
 \n\t\
 /set start [-retain] -default\n\
 \n\t\
@@ -806,9 +812,9 @@
 /set start\n\
 \n\
 The contents of the specified <file> become the start-up snippets and commands used\n\
-when the /reset or /reload commands are used in this session.\n\
-If instead the -default option is specified, the predefined start-up snippets\n\
-will be used.\n\
+when the /reset, /reload, or /env commands are used in this session.\n\
+If instead the -default option is specified, the predefined start-up import\n\
+snippets will be used.\n\
 If the -none option is used, the start-up will be empty -- no start-up snippets\n\
 or commands will be used.\n\
 This command is good for testing the start-up settings.  To retain them for future\n\
@@ -820,7 +826,16 @@
 \n\
 The form without <file> or options shows the start-up setting.\n\
 Note: if the start-up was last set from a file, this is shown with the\n\
-contents of the file followed by a 'set start' command.
+'set start' command followed by the contents of the file.\n\
+\n\
+The <file> may be an operating system file name, or one of the predefined\n\
+startup file names: DEFAULT, PRINTING, or JAVASE.\n\
+These are respectively: the default import snippets (as used by -default),\n\
+definitions of print(), println(), and printf() method snippets, or\n\
+imports of all Java SE packages.\n\
+More than one <file> may be specified, for example:\n\
+\n\t\
+/set start -retain DEFAULT PRINTING
 
 startup.feedback = \
 /set mode verbose -command    \n\
@@ -845,12 +860,12 @@
 /set format verbose action '  update overwrote' overwrote-update    \n\
 /set format verbose action '  update dropped' dropped-update    \n\
 \n\
-/set format verbose until ', however, it cannot be instanciated or its methods invoked until'   defined-class-primary    \n\
+/set format verbose until ', however, it cannot be instantiated or its methods invoked until'   defined-class-primary    \n\
 /set format verbose until ', however, its methods cannot be invoked until'                      defined-interface-primary    \n\
 /set format verbose until ', however, it cannot be used until'                                  defined-enum,annotation-primary    \n\
 /set format verbose until ', however, it cannot be invoked until'                               defined-method-primary    \n\
 /set format verbose until ', however, it cannot be referenced until'                            notdefined-primary    \n\
-/set format verbose until ' which cannot be instanciated or its methods invoked until'          defined-class-update    \n\
+/set format verbose until ' which cannot be instantiated or its methods invoked until'          defined-class-update    \n\
 /set format verbose until ' whose methods cannot be invoked until'                              defined-interface-update    \n\
 /set format verbose until ' which cannot be invoked until'                                      defined-method-update    \n\
 /set format verbose until ' which cannot be referenced until'                                   notdefined-update    \n\
@@ -911,3 +926,7 @@
 /set format silent errorpre '|  '    \n\
 /set format silent errorpost '%n'    \n\
 /set format silent display ''    \n
+
+jshell.fix.wrong.shortcut =\
+Unexpected character after Shift-Tab.  Use "i" for auto-import or "v" for variable creation.  For more information see:\n\
+   /help shortcuts
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties
index 1ffec58..09c1c3c 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,11 @@
 # questions.
 #
 
-jshell.msg.welcome =JShell\u3078\u3088\u3046\u3053\u305D -- \u30D0\u30FC\u30B8\u30E7\u30F3{0}\n\u6982\u8981\u306B\u3064\u3044\u3066\u306F\u3001\u6B21\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: /help intro\n
+jshell.msg.welcome =JShell\u3078\u3088\u3046\u3053\u305D -- \u30D0\u30FC\u30B8\u30E7\u30F3{0}\n\u6982\u8981\u306B\u3064\u3044\u3066\u306F\u3001\u6B21\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: /help intro
 jshell.err.opt.arg = {0}\u3078\u306E\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093\u3002
 jshell.err.opt.invalid = \u7121\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}\u3002
 jshell.err.opt.one = {0}\u30AA\u30D7\u30B7\u30E7\u30F3\u306F1\u3064\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
-jshell.err.opt.startup.one = --startup\u307E\u305F\u306F--no-startup\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u3069\u3061\u3089\u304B\u4E00\u65B9\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
+jshell.err.opt.startup.conflict = \u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7AF6\u5408: --startup\u3068--no-startup\u306E\u4E21\u65B9\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u3002
 jshell.err.opt.feedback.one = \u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3(--feedback\u3001-q\u3001-s\u307E\u305F\u306F-v)\u306F1\u3064\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002
 jshell.err.opt.unknown = \u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}
 
@@ -48,12 +48,15 @@
 
 jshell.err.no.such.command.or.snippet.id = \u6307\u5B9A\u3055\u308C\u305F\u30B3\u30DE\u30F3\u30C9\u307E\u305F\u306F\u30B9\u30CB\u30DA\u30C3\u30C8ID\u306F\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
 jshell.err.command.ambiguous = \u30B3\u30DE\u30F3\u30C9: ''{0}''\u306F\u3042\u3044\u307E\u3044\u3067\u3059: {1}
+jshell.msg.set.restore = \u65B0\u3057\u3044\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u8A2D\u5B9A\u3068\u72B6\u614B\u306E\u5FA9\u5143\u3002
 jshell.msg.set.editor.set = \u30A8\u30C7\u30A3\u30BF\u306F\u6B21\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059: {0}
 jshell.msg.set.editor.retain = \u30A8\u30C7\u30A3\u30BF\u8A2D\u5B9A\u304C\u4FDD\u6301\u3055\u308C\u3066\u3044\u307E\u3059: {0}
-jshell.err.cant.launch.editor = \u30A8\u30C7\u30A3\u30BF\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093 -- \u4E88\u671F\u3057\u306A\u3044\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {0}
-jshell.msg.try.set.editor = \u5916\u90E8\u30A8\u30C7\u30A3\u30BF\u3092\u4F7F\u7528\u3059\u308B\u306B\u306F\u3001/set editor\u3092\u5B9F\u884C\u3057\u3066\u3057\u3066\u304F\u3060\u3055\u3044\u3002
+jshell.err.no.builtin.editor = \u7D44\u8FBC\u307F\u30A8\u30C7\u30A3\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002
+jshell.err.cant.launch.editor = \u7D44\u8FBC\u307F\u30A8\u30C7\u30A3\u30BF\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093 -- \u4E88\u671F\u3057\u306A\u3044\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {0}
+jshell.msg.try.set.editor = \u5916\u90E8\u30A8\u30C7\u30A3\u30BF\u3092\u4F7F\u7528\u3059\u308B\u306B\u306F\u3001''/help /set editor''\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
 jshell.msg.press.return.to.leave.edit.mode = \u300C\u623B\u308B\u300D\u3092\u62BC\u3059\u3068\u7DE8\u96C6\u30E2\u30FC\u30C9\u304C\u7D42\u4E86\u3057\u307E\u3059\u3002
 jshell.err.wait.applies.to.external.editor = -wait\u306F\u5916\u90E8\u30A8\u30C7\u30A3\u30BF\u306B\u9069\u7528\u3055\u308C\u307E\u3059
+jshell.label.editpad = Shell Edit Pad
 
 jshell.err.setting.to.retain.must.be.specified = \u4FDD\u6301\u3059\u308B\u8A2D\u5B9A\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 -- {0}
 jshell.msg.set.show.mode.settings = \n\u30E2\u30FC\u30C9\u8A2D\u5B9A\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001''/set prompt''\u3001''/set truncation'' ...\u3092\u4F7F\u7528\u3059\u308B\u304B\u3001\n''/set mode''\u306E\u5F8C\u306B\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u540D\u3092\u7D9A\u3051\u3066\u4F7F\u7528\u3057\u307E\u3059\u3002
@@ -84,7 +87,7 @@
 
 jshell.err.help.arg = \u6307\u5B9A\u3057\u305F\u5F15\u6570\u3067\u59CB\u307E\u308B\u30B3\u30DE\u30F3\u30C9\u307E\u305F\u306F\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u306F\u3042\u308A\u307E\u305B\u3093: {0}
 jshell.msg.help.begin =Java\u8A00\u8A9E\u306E\u5F0F\u3001\u6587\u307E\u305F\u306F\u5BA3\u8A00\u3092\u5165\u529B\u3057\u307E\u3059\u3002\n\u307E\u305F\u306F\u3001\u6B21\u306E\u30B3\u30DE\u30F3\u30C9\u306E\u3044\u305A\u308C\u304B\u3092\u5165\u529B\u3057\u307E\u3059:\n
-jshell.msg.help.subject =\n\u8A73\u7D30\u306F\u3001''/help''\u306E\u5F8C\u306B\u30B3\u30DE\u30F3\u30C9\u307E\u305F\u306F\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u540D\u524D\u3092\u7D9A\u3051\u3066\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u305F\u3068\u3048\u3070\u3001''/help /list''\u307E\u305F\u306F''/help intro''\u306A\u3069\u3067\u3059\u3002\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8:\n
+jshell.msg.help.subject =\n\u8A73\u7D30\u306F\u3001''/help''\u306E\u5F8C\u306B\u30B3\u30DE\u30F3\u30C9\u307E\u305F\u306F\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u540D\u524D\u3092\u7D9A\u3051\u3066\n\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u305F\u3068\u3048\u3070\u3001''/help /list''\u307E\u305F\u306F''/help intro''\u306A\u3069\u3067\u3059\u3002\u30B5\u30D6\u30B8\u30A7\u30AF\u30C8:\n
 
 jshell.err.drop.arg =/drop\u5F15\u6570\u306B\u306F\u3001\u524A\u9664\u3059\u308B\u30A4\u30F3\u30DD\u30FC\u30C8\u3001\u5909\u6570\u3001\u30E1\u30BD\u30C3\u30C9\u307E\u305F\u306F\u30AF\u30E9\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\nID\u307E\u305F\u306F\u540D\u524D\u3067\u6307\u5B9A\u3057\u307E\u3059\u3002ID\u3092\u53C2\u7167\u3059\u308B\u306B\u306F/list\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u3059\u3079\u3066\u306E\u72B6\u614B\u3092\u30EA\u30BB\u30C3\u30C8\u3059\u308B\u306B\u306F/reset\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
 jshell.err.drop.ambiguous = \u5F15\u6570\u304C\u3001\u8907\u6570\u306E\u30A4\u30F3\u30DD\u30FC\u30C8\u3001\u5909\u6570\u3001\u30E1\u30BD\u30C3\u30C9\u307E\u305F\u306F\u30AF\u30E9\u30B9\u3092\u53C2\u7167\u3057\u3066\u3044\u307E\u3059\u3002
@@ -133,6 +136,11 @@
 jshell.err.retained.mode.failure = \u4FDD\u6301\u3055\u308C\u305F\u30E2\u30FC\u30C9\u3067\u5931\u6557\u3057\u307E\u3057\u305F(\u30E2\u30FC\u30C9\u306F\u30AF\u30EA\u30A2\u3055\u308C\u307E\u3057\u305F) -- {0} {1}
 
 jshell.console.see.more = <\u8A73\u7D30\u306F\u3001\u30BF\u30D6\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044>
+jshell.console.see.javadoc = <javadoc\u3092\u53C2\u7167\u3059\u308B\u306B\u306F[Shift]-[Tab]\u3092\u3082\u3046\u4E00\u5EA6\u62BC\u3057\u307E\u3059>
+jshell.console.see.help = <\u8A73\u7D30\u30D8\u30EB\u30D7\u3092\u53C2\u7167\u3059\u308B\u306B\u306F[Shift]-[Tab]\u3092\u3082\u3046\u4E00\u5EA6\u62BC\u3057\u307E\u3059>
+jshell.console.see.next.page = <\u6B21\u306E\u30DA\u30FC\u30B8\u306B\u9032\u3080\u306B\u306F\u30B9\u30DA\u30FC\u30B9\u3092\u3001\u7D42\u4E86\u3059\u308B\u306B\u306FQ\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044>
+jshell.console.see.next.javadoc = <\u6B21\u306Ejavadoc\u306B\u9032\u3080\u306B\u306F\u30B9\u30DA\u30FC\u30B9\u3092\u3001\u7D42\u4E86\u3059\u308B\u306B\u306FQ\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044>
+jshell.console.no.javadoc = <Javadoc\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093>
 jshell.console.do.nothing = \u4F55\u3082\u3057\u306A\u3044
 jshell.console.choice = \u9078\u629E: 
 jshell.console.create.variable = \u5909\u6570\u306E\u4F5C\u6210
@@ -142,7 +150,7 @@
 
 
 help.usage = \u4F7F\u7528\u65B9\u6CD5:   jshell <options> <load files>\n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059:\n    --class-path <path>   \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3057\u307E\u3059\n    --module-path <path>  \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3057\u307E\u3059\n    --add-modules <module>(,<module>)*\n                          \u89E3\u6C7A\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u3001\u307E\u305F\u306F<module>\u304CALL-MODULE-PATH\n                           \u3067\u3042\u308B\u5834\u5408\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u306E\u3059\u3079\u3066\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u6307\u5B9A\u3057\u307E\u3059\n    --startup <file>      \u8D77\u52D5\u5B9A\u7FA9\u306E\u4EE3\u66FF\u3068\u3057\u3066\u5B9F\u884C\u3055\u308C\u307E\u3059\n    --no-startup          \u8D77\u52D5\u5B9A\u7FA9\u3092\u5B9F\u884C\u3057\u307E\u305B\u3093\n    --feedback <mode>     \u521D\u671F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\u30E2\u30FC\u30C9\u306F\n                           \u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B(silent\u3001concise\u3001normal\u307E\u305F\u306Fverbose)\u304B\u3001\n                           \u4E8B\u524D\u306B\u30E6\u30FC\u30B6\u30FC\u304C\u5B9A\u7FA9\u3067\u304D\u307E\u3059\n    -q                    \u7C21\u6F54\u306A\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3002--feedback concise\u3068\u540C\u3058\n    -s                    \u975E\u5E38\u306B\u7C21\u6F54\u306A\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3002--feedback silent\u3068\u540C\u3058\n    -v                    \u8A73\u7D30\u306A\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3002--feedback verbose\u3068\u540C\u3058\n    -J<flag>              <flag>\u3092\u5B9F\u884C\u6642\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3057\u307E\u3059\u3002\n                            \u5B9F\u884C\u6642\u30D5\u30E9\u30B0\u307E\u305F\u306F\u30D5\u30E9\u30B0\u5F15\u6570\u3054\u3068\u306B1\u3064\u306E-J\u3092\u4F7F\u7528\u3057\u307E\u3059\n    -R<flag>              <flag>\u3092\u30EA\u30E2\u30FC\u30C8\u5B9F\u884C\u6642\u30B7\u30B9\u30C6\u30E0\u306B\u6E21\u3057\u307E\u3059\u3002\n                            \u30EA\u30E2\u30FC\u30C8\u30FB\u30D5\u30E9\u30B0\u307E\u305F\u306F\u30D5\u30E9\u30B0\u5F15\u6570\u3054\u3068\u306B1\u3064\u306E-R\u3092\u4F7F\u7528\u3057\u307E\u3059\n    -C<flag>              <flag>\u3092\u30B3\u30F3\u30D1\u30A4\u30E9\u306B\u6E21\u3057\u307E\u3059\u3002\n                            \u30B3\u30F3\u30D1\u30A4\u30E9\u30FB\u30D5\u30E9\u30B0\u307E\u305F\u306F\u30D5\u30E9\u30B0\u5F15\u6570\u3054\u3068\u306B1\u3064\u306E-C\u3092\u4F7F\u7528\u3057\u307E\u3059\n    --help                \u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3057\u307E\u3059\n    --version             \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\n    -X                    \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3057\u307E\u3059\n
-help.usage.x = \    --add-exports <module>/<package>   \u6307\u5B9A\u3057\u305F\u30E2\u30B8\u30E5\u30FC\u30EB\u56FA\u6709\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30B9\u30CB\u30DA\u30C3\u30C8\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\n    \n\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\n
+help.usage.x = \    --add-exports <module>/<package>   \u6307\u5B9A\u3057\u305F\u30E2\u30B8\u30E5\u30FC\u30EB\u56FA\u6709\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30B9\u30CB\u30DA\u30C3\u30C8\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\n    ---execution <spec>                 \u4EE3\u66FF\u5B9F\u884C\u30A8\u30F3\u30B8\u30F3\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\n                                         \u3053\u3053\u3067\u3001<spec>\u306FExecutionControl spec\u3067\u3059\u3002\n                                         spec\u306E\u69CB\u6587\u306B\u3064\u3044\u3066\u306F\u3001\u30D1\u30C3\u30B1\u30FC\u30B8jdk.jshell.spi\u306E\n                                         \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n    \n\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\n
 
 help.list.summary = \u5165\u529B\u3057\u305F\u30BD\u30FC\u30B9\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059
 help.list.args = [<name or id>|-all|-start]
@@ -185,16 +193,16 @@
 help.exit =jshell\u30C4\u30FC\u30EB\u3092\u7D42\u4E86\u3057\u307E\u3059\u3002\u4F5C\u696D\u306F\u4FDD\u5B58\u3055\u308C\u307E\u305B\u3093\u3002\n\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3059\u308B\u524D\u306B\u3059\u3079\u3066\u306E\u4F5C\u696D\u3092\u4FDD\u5B58\u3057\u3066\u304F\u3060\u3055\u3044
 
 help.reset.summary = reset jshell
-help.reset.args =
-help.reset =jshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30FC\u30C9\u304A\u3088\u3073\u5B9F\u884C\u72B6\u614B\u3092\u30EA\u30BB\u30C3\u30C8\u3057\u307E\u3059:\n\t* \u5165\u529B\u3057\u305F\u3059\u3079\u3066\u306E\u30B3\u30FC\u30C9\u304C\u5931\u308F\u308C\u307E\u3059\u3002\n\t* \u8D77\u52D5\u30B3\u30FC\u30C9\u304C\u518D\u5B9F\u884C\u3055\u308C\u307E\u3059\u3002\n\t* \u5B9F\u884C\u72B6\u614B\u306F\u518D\u5EA6\u958B\u59CB\u3055\u308C\u307E\u3059\u3002\n\t* \u30AF\u30E9\u30B9\u30D1\u30B9\u306F\u30AF\u30EA\u30A2\u3055\u308C\u307E\u3059\u3002\n\u30C4\u30FC\u30EB\u8A2D\u5B9A\u306F\u6B21\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u3088\u3046\u306B\u4FDD\u6301\u3055\u308C\u307E\u3059: /set ...\n\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3059\u308B\u524D\u306B\u3059\u3079\u3066\u306E\u4F5C\u696D\u3092\u4FDD\u5B58\u3057\u3066\u304F\u3060\u3055\u3044
+help.reset.args = [-class-path <path>] [-module-path <path>] [-add-modules <modules>]...
+help.reset =jshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30FC\u30C9\u304A\u3088\u3073\u5B9F\u884C\u72B6\u614B\u3092\u30EA\u30BB\u30C3\u30C8\u3057\u307E\u3059:\n\t* \u5165\u529B\u3057\u305F\u3059\u3079\u3066\u306E\u30B3\u30FC\u30C9\u304C\u5931\u308F\u308C\u307E\u3059\u3002\n\t* \u8D77\u52D5\u30B3\u30FC\u30C9\u304C\u518D\u5B9F\u884C\u3055\u308C\u307E\u3059\u3002\n\t* \u5B9F\u884C\u72B6\u614B\u306F\u518D\u5EA6\u958B\u59CB\u3055\u308C\u307E\u3059\u3002\n\t\u30C4\u30FC\u30EB\u8A2D\u5B9A\u306F\u6B21\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u3088\u3046\u306B\u4FDD\u6301\u3055\u308C\u307E\u3059: /set ...\n\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3059\u308B\u524D\u306B\u3059\u3079\u3066\u306E\u4F5C\u696D\u3092\u4FDD\u5B58\u3057\u3066\u304F\u3060\u3055\u3044\n/reset\u30B3\u30DE\u30F3\u30C9\u306F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u53D7\u3051\u5165\u308C\u307E\u3059\u3002\u6B21\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044:\n\n\t/help context\n
 
 help.reload.summary = \u30EA\u30BB\u30C3\u30C8\u3057\u3066\u95A2\u9023\u3059\u308B\u5C65\u6B74\u3092\u30EA\u30D7\u30EC\u30A4\u3057\u307E\u3059 -- \u73FE\u5728\u307E\u305F\u306F\u4EE5\u524D(-restore)
-help.reload.args = [-restore] [-quiet]
-help.reload =jshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30FC\u30C9\u304A\u3088\u3073\u5B9F\u884C\u72B6\u614B\u3092\u30EA\u30BB\u30C3\u30C8\u3057\u3001\u5404\u6709\u52B9\u30B9\u30CB\u30DA\u30C3\u30C8\n\u304A\u3088\u3073\u4EFB\u610F\u306E/drop\u307E\u305F\u306F/classpath\u30B3\u30DE\u30F3\u30C9\u3092\u5165\u529B\u3055\u308C\u305F\u9806\u756A\u3067\u30EA\u30D7\u30EC\u30A4\u3057\u307E\u3059\u3002\n\n/reload\n\t\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u3001jshell\u304C\u5165\u529B\u3055\u308C\u305F\u3001\u3042\u308B\u3044\u306F/reset\u307E\u305F\u306F\n\t/reload\u30B3\u30DE\u30F3\u30C9\u304C\u5B9F\u884C\u3055\u308C\u305F(\u6700\u65B0\u306E\u3044\u305A\u308C\u304B)\u4EE5\u964D\u306E\u6709\u52B9\u306A\u5C65\u6B74\u304C\n\t\u30EA\u30D7\u30EC\u30A4\u3055\u308C\u307E\u3059\u3002\n\n/reload -restore\n\t\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u3001jshell\u304C\u5165\u529B\u3055\u308C\u305F\u3001\u3042\u308B\u3044\u306F/reset\u307E\u305F\u306F/reload\u30B3\u30DE\u30F3\u30C9\u304C\n\t\u5B9F\u884C\u3055\u308C\u305F\u4EE5\u524D\u3068\u6700\u65B0\u306E\u6642\u9593\u306E\u9593\u306E\u6709\u52B9\u306A\u5C65\u6B74\u304C\u30EA\u30D7\u30EC\u30A4\u3055\u308C\u307E\u3059\u3002\n\t\u305D\u306E\u305F\u3081\u3001\u3053\u308C\u306F\u4EE5\u524D\u306Ejshell\u30C4\u30FC\u30EB\u30FB\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u5FA9\u5143\u306B\n\t\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n\n/reload [-restore] -quiet\n\t'-quiet'\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u30EA\u30D7\u30EC\u30A4\u304C\u8868\u793A\u3055\u308C\u307E\u305B\u3093\u3002\u30A8\u30E9\u30FC\u306F\u8868\u793A\u3055\u308C\u307E\u3059\u3002
+help.reload.args = [-restore] [-quiet] [-class-path <path>] [-module-path <path>]...
+help.reload =jshell\u30C4\u30FC\u30EB\u30FB\u30B3\u30FC\u30C9\u304A\u3088\u3073\u5B9F\u884C\u72B6\u614B\u3092\u30EA\u30BB\u30C3\u30C8\u3057\u3001\u5404\u6709\u52B9\u30B9\u30CB\u30DA\u30C3\u30C8\n\u304A\u3088\u3073\u4EFB\u610F\u306E/drop\u30B3\u30DE\u30F3\u30C9\u3092\u5165\u529B\u3055\u308C\u305F\u9806\u756A\u3067\u30EA\u30D7\u30EC\u30A4\u3057\u307E\u3059\u3002\n\n/reload\n\t\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u3001jshell\u304C\u5165\u529B\u3055\u308C\u305F\u3001\u3042\u308B\u3044\u306F/reset\u307E\u305F\u306F\n\t/reload\u30B3\u30DE\u30F3\u30C9\u304C\u5B9F\u884C\u3055\u308C\u305F(\u6700\u65B0\u306E\u3044\u305A\u308C\u304B)\u4EE5\u964D\u306E\u6709\u52B9\u306A\u5C65\u6B74\u304C\n\t\u30EA\u30D7\u30EC\u30A4\u3055\u308C\u307E\u3059\u3002\n\n/reload -restore\n\t\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u3001jshell\u304C\u5165\u529B\u3055\u308C\u305F\u3001\u3042\u308B\u3044\u306F/reset\u307E\u305F\u306F/reload\u30B3\u30DE\u30F3\u30C9\u304C\n\t\u5B9F\u884C\u3055\u308C\u305F\u4EE5\u524D\u3068\u6700\u65B0\u306E\u6642\u9593\u306E\u9593\u306E\u6709\u52B9\u306A\u5C65\u6B74\u304C\u30EA\u30D7\u30EC\u30A4\u3055\u308C\u307E\u3059\u3002\n\t\u305D\u306E\u305F\u3081\u3001\u3053\u308C\u306F\u4EE5\u524D\u306Ejshell\u30C4\u30FC\u30EB\u30FB\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u5FA9\u5143\u306B\n\t\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n\n/reload [-restore] -quiet\n\t'-quiet'\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u30EA\u30D7\u30EC\u30A4\u304C\u8868\u793A\u3055\u308C\u307E\u305B\u3093\u3002\u30A8\u30E9\u30FC\u306F\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\n\u4E0A\u306E\u5404\u3005\u306F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u53D7\u3051\u5165\u308C\u307E\u3059\u3002\u6B21\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044:\n\n\t/help context\n\n\u4F8B:\n\n\t/reload -add-modules com.greetings -restore
 
-help.classpath.summary = \u30AF\u30E9\u30B9\u30D1\u30B9\u306B\u30D1\u30B9\u3092\u8FFD\u52A0\u3057\u307E\u3059
-help.classpath.args = <path>
-help.classpath =\u30AF\u30E9\u30B9\u30D1\u30B9\u306B\u30D1\u30B9\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002
+help.env.summary = \u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8868\u793A\u307E\u305F\u306F\u5909\u66F4\u3057\u307E\u3059
+help.env.args = [-class-path <path>] [-module-path <path>] [-add-modules <modules>] ...
+help.env =\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8868\u793A\u307E\u305F\u306F\u5909\u66F4\u3057\u307E\u3059\u3002\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306F\u3001\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u3001\n\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9\u306A\u3069\u3067\u3059\u3002\n/env\n\t\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3057\u3066\u8868\u793A\u3055\u308C\u3066\u3044\u308B\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u793A\u3057\u307E\u3059\u3002\n\n/env [-class-path <path>] [-module-path <path>] [-add-modules <modules>] ...\n\t1\u3064\u4EE5\u4E0A\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306B\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002\n\t\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u5B9F\u884C\u72B6\u614B\u306F\u65B0\u3057\u3044\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u3001\n\t\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u30EA\u30D7\u30EC\u30A4\u3055\u308C\u307E\u3059\u3002\u305F\u3060\u3057\u30EA\u30D7\u30EC\u30A4\u306F\u8868\u793A\u3055\u308C\u305A\u3001\n\t\u30A8\u30E9\u30FC\u306F\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u3053\u308C\u306F\u6B21\u3068\u540C\u3058\u3067\u3059: /reload -quiet\n\t\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u8A73\u7D30\u306F\u3001\u6B21\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044:\n\n\t\t/help context\n\n\t\u4F8B:\n\n\t\t/env -add-modules com.greetings
 
 help.history.summary = \u5165\u529B\u3057\u305F\u5185\u5BB9\u306E\u5C65\u6B74
 help.history.args =
@@ -234,6 +242,8 @@
 help.shortcuts.summary = \u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u306E\u8AAC\u660E
 help.shortcuts =\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u30B7\u30E7\u30FC\u30C8\u30AB\u30C3\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\n<tab>\n\t\tJava\u8B58\u5225\u5B50\u3001jshell\u30B3\u30DE\u30F3\u30C9\u3001\u5834\u5408\u306B\u3088\u3063\u3066\u306F\n\t\tjshell\u30B3\u30DE\u30F3\u30C9\u5F15\u6570\u306E\u6700\u521D\u306E\u6570\u6587\u5B57\u3092\u5165\u529B\u3057\u305F\u5F8C\u306B\u3001\n\t\t<tab>\u30AD\u30FC\u3092\u62BC\u3059\u3068\u3001\u5165\u529B\u304C\u5B8C\u6210\u3057\u307E\u3059\u3002\n\t\t\u5B8C\u6210\u7D50\u679C\u304C\u8907\u6570\u3042\u308B\u5834\u5408\u3001\u4F7F\u7528\u53EF\u80FD\u306A\u5B8C\u6210\u7D50\u679C\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\nShift-<tab>\n\t\t\u30E1\u30BD\u30C3\u30C9\u307E\u305F\u306F\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u547C\u51FA\u3057\u306E\u540D\u524D\u3068\u5DE6\u4E38\u30AB\u30C3\u30B3\u306E\u5F8C\u306B\n\t\t<shift>\u30AD\u30FC\u3092\u62BC\u3057\u306A\u304C\u3089<tab>\u3092\u62BC\u3059\u3068\u3001\u4E00\u81F4\u3059\u308B\u3059\u3079\u3066\u306E\u30E1\u30BD\u30C3\u30C9/\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\n\t\t\u30B7\u30CE\u30D7\u30B7\u30B9\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\n<fix-shortcut> v\n\t\t\u5B8C\u5168\u306A\u5F0F\u306E\u5F8C\u306B\u3001\u300C<fix-shortcut> v\u300D\u3092\u62BC\u3059\u3068\u3001\u5F0F\u306E\u30BF\u30A4\u30D7\u306B\u57FA\u3065\u3044\u305F\u30BF\u30A4\u30D7\u306E\n\t\t\u65B0\u3057\u3044\u5909\u6570\u304C\u5C0E\u5165\u3055\u308C\u307E\u3059\u3002\n\t\t\u300C<fix-shortcut>\u300D\u306F[Alt]+[F1]\u307E\u305F\u306F[Alt]+[Enter]\u3067\u3001\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306B\u3088\u3063\u3066\u7570\u306A\u308A\u307E\u3059\u3002\n\n<fix-shortcut> i\n\t\t\u89E3\u6C7A\u3067\u304D\u306A\u3044\u8B58\u5225\u5B50\u306E\u5F8C\u306B\u3001\u300C<fix-shortcut> i\u300D\u3092\u62BC\u3059\u3068\u3001jshell\u306F\u6307\u5B9A\u3057\u305F\n\t\t\u30AF\u30E9\u30B9\u30D1\u30B9\u306E\u5185\u5BB9\u306B\u57FA\u3065\u3044\u3066\u4F7F\u7528\u53EF\u80FD\u306A\u5B8C\u5168\u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u3092\u63D0\u793A\u3057\u307E\u3059\u3002\n\t\t\u300C<fix-shortcut>\u300D\u306F[Alt]+[F1]\u307E\u305F\u306F[Alt]+[Enter]\u3067\u3001\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306B\u3088\u3063\u3066\u7570\u306A\u308A\u307E\u3059\u3002
 
+help.context.summary = /env /reload\u304A\u3088\u3073/reset\u306E\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3
+help.context =\u8A55\u4FA1\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u69CB\u6210\u3057\u307E\u3059\u3002\u3053\u308C\u3089\u306F\u3001jshell\u8D77\u52D5\u6642\u306B\n\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3067\u3001\u307E\u305F\u306F\u30B3\u30DE\u30F3\u30C9/env\u3001/reload\u307E\u305F\u306F/reset\u3067\u518D\u8D77\u52D5\u3059\u308B\n\u3053\u3068\u306B\u3088\u308A\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\n\n\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\t--class-path <class search path of directories and zip/jar files>\n\t\t\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n\t\tJAR\u30A2\u30FC\u30AB\u30A4\u30D6\u3001ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u30EA\u30B9\u30C8\u3002\n\t\t\u30EA\u30B9\u30C8\u306F\u30D1\u30B9\u533A\u5207\u308A\u6587\u5B57\u3067\u533A\u5207\u308A\u307E\u3059\n\t\t(UNIX/Linux/Mac\u3067\u306F\u300C:\u300D\u3001Windows\u3067\u306F\u300C;\u300D)\u3002\n\t--module-path <module path>...\n\t\t\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30EA\u30B9\u30C8\u3002\u5404\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\n\t\t\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\u3002\n\t\t\u30EA\u30B9\u30C8\u306F\u30D1\u30B9\u533A\u5207\u308A\u6587\u5B57\u3067\u533A\u5207\u308A\u307E\u3059\n\t\t(UNIX/Linux/Mac\u3067\u306F\u300C:\u300D\u3001Windows\u3067\u306F\u300C;\u300D)\u3002\n\t--add-modules <modulename>[,<modulename>...]\n\t\t\u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u52A0\u3048\u3066\u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u3002\n\t\t<modulename>\u306B\u306F\u3001ALL-DEFAULT\u3001ALL-SYSTEM\u3001\n\t\tALL-MODULE-PATH\u3082\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n\t--add-exports <module>/<package>=<target-module>(,<target-module>)*\n\t\t\u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066\n\t\t<package>\u3092<target-module>\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\n\t\t<target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\n\t\t\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002jshell\u3067\u306F\u3001<target-module>\u3092\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408(\u300C=\u300D\u306A\u3057)\u3001\n\t\tALL-UNNAMED\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\n\n\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3067\u306F\u3001\u3053\u308C\u3089\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F2\u3064\u306E\u30C0\u30C3\u30B7\u30E5\u304C\u5FC5\u8981\u3067\u3059\u3002\u4F8B: --module-path\njshell\u30B3\u30DE\u30F3\u30C9\u3067\u306F\u3001\u30C0\u30C3\u30B7\u30E5\u306F1\u3064\u3067\u30822\u3064\u3067\u3082\u304B\u307E\u3044\u307E\u305B\u3093\u3002\u4F8B: -module-path\n
 help.set._retain = '-retain'\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u3088\u308A\u3001\u5C06\u6765\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u3067\u4F7F\u7528\u3059\u308B\u305F\u3081\u306B\u8A2D\u5B9A\u3092\u4FDD\u5B58\u3057\u307E\u3059\u3002\n-retain\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001/set\u306E\u6B21\u306E\u5F62\u5F0F\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059:\n\n\t/set editor -retain\n\t/set start -retain\n\t/set feedback -retain\n\t/set mode -retain\n\n\u8A73\u7D30\u306F\u3001\u3053\u308C\u3089\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044 -- \u4F8B: /help /set editor
 
 help.set.format = \u30B9\u30CB\u30DA\u30C3\u30C8\u30FB\u30A4\u30D9\u30F3\u30C8\u3092\u30EC\u30DD\u30FC\u30C8\u3059\u308B\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3059:\n\n\t/set format <mode> <field> "<format>" <selector>...\n\n\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059:\n\n\t/set format [<mode> [<field>]]\n\n<mode>\u306F\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u306E\u540D\u524D\u3067\u3059 -- '/help /set mode'\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n<field>\u306F\u5B9A\u7FA9\u3059\u308B\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u56FA\u6709\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u306E\u540D\u524D\u3067\u3059\u3002\n<format>\u306F\u5F15\u7528\u7B26\u306B\u56F2\u307E\u308C\u305F\u6587\u5B57\u5217\u3067\u3001\u6B21\u306E\u5834\u5408\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5024\u3067\u3059: \n\u30BB\u30EC\u30AF\u30BF\u304C\u4E00\u81F4\u3059\u308B(\u307E\u305F\u306F\u30BB\u30EC\u30AF\u30BF\u304C\u306A\u3044)\u3002\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304C\u4F7F\u7528\u3055\u308C\u308B\u5834\u5408\u3001\n\u4E2D\u30AB\u30C3\u30B3\u3067\u56F2\u307E\u308C\u3066\u3044\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u540D\u304C\u305D\u306E\u3068\u304D\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5024\u3067\u7F6E\u63DB\u3055\u308C\u307E\u3059\n\u3053\u308C\u3089\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306F\u3001\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3067\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3082\u3001\n\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u56FA\u6709\u306E\u3053\u308C\u3089\u306E\u4E8B\u524D\u5B9A\u7FA9\u6E08\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5834\u5408\u3082\u3042\u308A\u307E\u3059:\n\t{name}       == \u540D\u524D\u3001\u4F8B: \u5909\u6570\u540D\u3001 ...\n\t{type}       == \u30BF\u30A4\u30D7\u540D\u3002\u5909\u6570\u307E\u305F\u306F\u5F0F\u306E\u30BF\u30A4\u30D7\u3001\n\t\t\t\u30E1\u30BD\u30C3\u30C9\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30BF\u30A4\u30D7\n\t{value}      == \u5F0F\u307E\u305F\u306F\u5909\u6570\u306E\u521D\u671F\u5316\u306E\u7D50\u679C\u5024\n\t{unresolved} == \u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u30EA\u30B9\u30C8\n\t{errors}     == \u30EA\u30AB\u30D0\u30EA\u53EF\u80FD\u306A\u30A8\u30E9\u30FC\u306E\u30EA\u30B9\u30C8(\u51E6\u7406\u6642-\n\t\t\t"display"\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u307F)\n\t{err}        == \u672A\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30FB\u30A8\u30E9\u30FC\u884C(\u51E6\u7406\u6642-\n\t\t\t"errorline"\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u307F)\n\u6B21\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306F\u30C4\u30FC\u30EB\u306B\u3088\u3063\u3066\u30A2\u30AF\u30BB\u30B9\u3055\u308C\u3001\u8868\u793A\u3055\u308C\u308B\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u6C7A\u5B9A\u3057\u307E\u3059:\n\t{display}    == \u30B9\u30CB\u30DA\u30C3\u30C8\u30FB\u30A4\u30D9\u30F3\u30C8\u306B\u5BFE\u3057\u3066\u8868\u793A\u3055\u308C\u308B\u30E1\u30C3\u30BB\u30FC\u30B8\n\t{errorline}  == \u300Cerrors\u300D\u30D5\u30A3\u30FC\u30EB\u30C9\u5185\u306E\u30A8\u30E9\u30FC\u884C\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\n\t{pre}        == \u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u63A5\u982D\u8F9E(\u30B3\u30DE\u30F3\u30C9\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u958B\u59CB\u3059\u308B)\n\t{post}       == \u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u63A5\u5C3E\u8F9E(\u30B3\u30DE\u30F3\u30C9\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u7D42\u4E86\u3059\u308B)\n\t{errorpre}   == \u30A8\u30E9\u30FC\u63A5\u982D\u8F9E(\u30A8\u30E9\u30FC\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u958B\u59CB\u3059\u308B)\n\t{errorpost}  == \
@@ -247,7 +257,7 @@
 
 help.set.mode = \u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u65E2\u5B58\u306E\u30E2\u30FC\u30C9\u304B\u3089\u30B3\u30D4\u30FC\u3057\u307E\u3059:\n\n\t/set mode <mode> [<old-mode>] [-command|-quiet|-delete]\n\u5C06\u6765\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u305F\u3081\u306B\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u3092\u4FDD\u6301\u3057\u307E\u3059:\n\n\t/set mode -retain <mode>\n\n\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u3092\u524A\u9664\u3057\u307E\u3059:\n\n\t/set mode -delete [-retain] <mode>\n\n\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059:\n\n\t/set mode [<mode>]\n\n<new-mode>\u306F\u4F5C\u6210\u3059\u308B\u30E2\u30FC\u30C9\u306E\u540D\u524D\u3067\u3059\u3002\n<old-mode>\u306F\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u306E\u540D\u524D\u3067\u3059\u3002\n<old-mode>\u304C\u3042\u308B\u5834\u5408\u3001\u305D\u306E\u8A2D\u5B9A\u304C\u65B0\u898F\u30E2\u30FC\u30C9\u306B\u30B3\u30D4\u30FC\u3055\u308C\u307E\u3059\u3002\n'-command'\u307E\u305F\u306F'-quiet'\u306B\u3088\u308A\u3001\u60C5\u5831/\u691C\u8A3C\u4E2D\u306E\u30B3\u30DE\u30F3\u30C9\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u8868\u793A\u3059\u308B\u304B\u3069\u3046\u304B\u304C\u6C7A\u5B9A\u3057\u307E\u3059\u3002\n\n\u65B0\u898F\u30E2\u30FC\u30C9\u3092\u4F5C\u6210\u3057\u305F\u3089\u3001'/set format'\u3001'/set prompt'\u304A\u3088\u3073'/set truncation'\u3092\u4F7F\u7528\u3057\u3066\n\u69CB\u6210\u3057\u307E\u3059\u3002\u65B0\u898F\u30E2\u30FC\u30C9\u3092\u4F7F\u7528\u3059\u308B\u306B\u306F\u3001'/set feedback'\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\n\n-retain\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30E2\u30FC\u30C9(\u305D\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u3001\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304A\u3088\u3073\u5207\u6368\u3066\u8A2D\u5B9A\u3092\u542B\u3080)\u306F\u3001\njshell\u30C4\u30FC\u30EB\u306E\u3053\u306E\u5B9F\u884C\u3068\u5C06\u6765\u306E\u5B9F\u884C\u3067\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n-retain\u3068-delete\u306E\u4E21\u65B9\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30E2\u30FC\u30C9\u306F\u73FE\u5728\u304A\u3088\u3073\u5C06\u6765\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u304B\u3089\n\u524A\u9664\u3055\u308C\u307E\u3059\u3002\n\n\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u306A\u3044\u5F62\u5F0F\u306F\u3001\u30E2\u30FC\u30C9\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n<mode>\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u305D\u306E\u30E2\u30FC\u30C9\u306E\u30E2\u30FC\u30C9\u8A2D\u5B9A\u306E\u307F\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\u6CE8\u610F: \u30E2\u30FC\u30C9\u306E\u8A2D\u5B9A\u306B\u306F\u3001\u30D7\u30ED\u30F3\u30D7\u30C8\u3001\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304A\u3088\u3073\u5207\u6368\u3066\u306E\u8A2D\u5B9A\u304C\u542B\u307E\u308C\u308B\u305F\u3081\u3001\n\u3053\u308C\u3089\u3082\u540C\u69D8\u306B\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\u4F8B:\n\t/set mode myformat\n\u30E2\u30FC\u30C9myformat\u306E\u30E2\u30FC\u30C9\u3001\u30D7\u30ED\u30F3\u30D7\u30C8\u3001\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304A\u3088\u3073\u5207\u6368\u3066\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059\n
 
-help.set.prompt = \u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002\u6A19\u6E96\u30D7\u30ED\u30F3\u30D7\u30C8\u3068\u7D9A\u884C\u30D7\u30ED\u30F3\u30D7\u30C8\u306E\u4E21\u65B9\u3092\u8A2D\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059:\n\n\t/set prompt <mode> "<prompt>" "<continuation-prompt>"\n\n\u6A19\u6E96\u30D7\u30ED\u30F3\u30D7\u30C8\u3068\u7D9A\u884C\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8868\u793A\u3057\u307E\u3059:\n\n\t/set prompt [<mode>]\n\n<mode>\u306F\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u306E\u540D\u524D\u3067\u3059\u3002\n<prompt>\u304A\u3088\u3073<continuation-prompt>\u306F\u5165\u529B\u30D7\u30ED\u30F3\u30D7\u30C8\u3068\u3057\u3066\u51FA\u529B\u3055\u308C\u308B\u5F15\u7528\u7B26\u3067\u56F2\u307E\u308C\u305F\u6587\u5B57\u5217\u3067\u3059\u3002\n\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3001\u4E21\u65B9\u3068\u3082\u3001\u6B21\u306E\u30B9\u30CB\u30DA\u30C3\u30C8ID\u3067\u7F6E\u304D\u63DB\u3048\u3089\u308C\u308B'%s'\u3092\u542B\u3080\u3053\u3068\u304C\u3067\u304D\u307E\u3059 --\n\u5165\u529B\u3057\u305F\u5185\u5BB9\u304C\u305D\u306EID\u306B\u5272\u308A\u5F53\u3066\u3089\u308C\u306A\u3044\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u305F\u3068\u3048\u3070\u3001\u30A8\u30E9\u30FC\u307E\u305F\u306F\u30B3\u30DE\u30F3\u30C9\u3067\u3042\u308B\u5834\u5408\u306A\u3069\u3067\u3059\u3002\n\u7D9A\u884C\u30D7\u30ED\u30F3\u30D7\u30C8\u306F\u8907\u6570\u884C\u30B9\u30CB\u30DA\u30C3\u30C8\u306E2\u884C\u76EE\u4EE5\u964D\u3067\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n\n<prompt>\u306E\u306A\u3044\u5F62\u5F0F\u306F\u3001\u73FE\u5728\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n<mode>\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u305D\u306E\u30E2\u30FC\u30C9\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u306E\u307F\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\u4F8B:\n\t/set prompt myformat\n\u30E2\u30FC\u30C9myformat\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n
+help.set.prompt = \u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002\u6A19\u6E96\u30D7\u30ED\u30F3\u30D7\u30C8\u3068\u7D9A\u884C\u30D7\u30ED\u30F3\u30D7\u30C8\u306E\u4E21\u65B9\u3092\u8A2D\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059:\n\n\t/set prompt <mode> "<prompt>" "<continuation-prompt>"\n\n\u6A19\u6E96\u30D7\u30ED\u30F3\u30D7\u30C8\u3068\u7D9A\u884C\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8868\u793A\u3057\u307E\u3059:\n\n\t/set prompt [<mode>]\n\n<mode>\u306F\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u306E\u540D\u524D\u3067\u3059\u3002\n<prompt>\u304A\u3088\u3073<continuation-prompt>\u306F\u5165\u529B\u30D7\u30ED\u30F3\u30D7\u30C8\u3068\u3057\u3066\u51FA\u529B\u3055\u308C\u308B\u5F15\u7528\u7B26\u3067\u56F2\u307E\u308C\u305F\u6587\u5B57\u5217\u3067\u3059\u3002\n\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3001\u4E21\u65B9\u3068\u3082\u3001\u6B21\u306E\u30B9\u30CB\u30DA\u30C3\u30C8ID\u3067\u7F6E\u304D\u63DB\u3048\u3089\u308C\u308B'%%s'\u3092\u542B\u3080\u3053\u3068\u304C\u3067\u304D\u307E\u3059 --\n\u5165\u529B\u3057\u305F\u5185\u5BB9\u304C\u305D\u306EID\u306B\u5272\u308A\u5F53\u3066\u3089\u308C\u306A\u3044\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\u305F\u3068\u3048\u3070\u3001\u30A8\u30E9\u30FC\u307E\u305F\u306F\u30B3\u30DE\u30F3\u30C9\u3067\u3042\u308B\u5834\u5408\u306A\u3069\u3067\u3059\u3002\n\u7D9A\u884C\u30D7\u30ED\u30F3\u30D7\u30C8\u306F\u8907\u6570\u884C\u30B9\u30CB\u30DA\u30C3\u30C8\u306E2\u884C\u76EE\u4EE5\u964D\u3067\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n\n<prompt>\u306E\u306A\u3044\u5F62\u5F0F\u306F\u3001\u73FE\u5728\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n<mode>\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u305D\u306E\u30E2\u30FC\u30C9\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u306E\u307F\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\u4F8B:\n\t/set prompt myformat\n\u30E2\u30FC\u30C9myformat\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n
 
 help.set.editor =/edit\u30B3\u30DE\u30F3\u30C9\u3067\u8D77\u52D5\u3059\u308B\u30B3\u30DE\u30F3\u30C9\u3092\u6307\u5B9A\u3057\u307E\u3059:\n\n\t/set editor [-retain] [-wait] <command>\n\n\t/set editor [-retain] -default\n\n\t/set editor [-retain] -delete\n\n\u5C06\u6765\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u305F\u3081\u306B\u73FE\u5728\u306E\u30A8\u30C7\u30A3\u30BF\u8A2D\u5B9A\u3092\u4FDD\u6301\u3057\u307E\u3059:\n\n\t/set editor -retain\n\n/edit\u30B3\u30DE\u30F3\u30C9\u3067\u8D77\u52D5\u3059\u308B\u30B3\u30DE\u30F3\u30C9\u3092\u8868\u793A\u3057\u307E\u3059:\n\n\t/set editor\n\n<command>\u306F\u30AA\u30DA\u30EC\u30FC\u30C6\u30A3\u30F3\u30B0\u30FB\u30B7\u30B9\u30C6\u30E0\u4F9D\u5B58\u6587\u5B57\u5217\u3067\u3059\u3002\n<command>\u306B\u306F\u30B9\u30DA\u30FC\u30B9\u3067\u533A\u5207\u3089\u308C\u305F\u5F15\u6570(\u30D5\u30E9\u30B0\u306A\u3069)\u304C\u542B\u307E\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\n\n-default\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u7D44\u8FBC\u307F\u30A8\u30C7\u30A3\u30BF\u304C\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n\n-delete\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u4EE5\u524D\u306E\u8A2D\u5B9A\u306F\u7121\u8996\u3055\u308C\u307E\u3059 -- \u30A8\u30C7\u30A3\u30BF\n\u8A2D\u5B9A\u306F\u3001jshell\u30C4\u30FC\u30EB\u306E\u8D77\u52D5\u6642\u306B\u521D\u671F\u5316\u3055\u308C\u307E\u3059\u3002\u5177\u4F53\u7684\u306B\u306F\u3001\u4FDD\u6301\u3055\u308C\u305F\u8A2D\u5B9A\u304C\n\u5B58\u5728\u3059\u308B\u5834\u5408\u3001(\u4FDD\u6301\u3055\u308C\u305F\u8A2D\u5B9A\u3092\u524A\u9664\u3059\u308B-retain\u3068-delete\u306E\u4E21\u65B9\u304C\u6307\u5B9A\u3055\u308C\u3066\n\u3044\u306A\u3051\u308C\u3070)\u305D\u308C\u304C\u4F7F\u7528\u3055\u308C\u3001\u6B21\u306E\u74B0\u5883\u5909\u6570\u306E\u3044\u305A\u308C\u304B\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\n\u305D\u308C\u304C(\u305D\u306E\u9806\u5E8F\u3067)\u4F7F\u7528\u3055\u308C\u307E\u3059: JSHELLEDITOR\u3001VISUAL\u307E\u305F\u306FEDITOR\u3002\n\u305D\u308C\u4EE5\u5916\u306E\u5834\u5408\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u7D44\u8FBC\u307F\u30A8\u30C7\u30A3\u30BF\u304C\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n\n<command>\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u305D\u308C\u304C\u5916\u90E8\u30A8\u30C7\u30A3\u30BF\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002<command>\u306F\u3001\n\u30D7\u30ED\u30B0\u30E9\u30E0\u3068\u30BC\u30ED\u500B\u4EE5\u4E0A\u306E\u30D7\u30ED\u30B0\u30E9\u30E0\u5F15\u6570\u3067\u69CB\u6210\u3055\u308C\u307E\u3059\u3002<command>\u304C\u4F7F\u7528\u3055\u308C\u308B\u5834\u5408\u3001\n\u7DE8\u96C6\u5BFE\u8C61\u306E\u4E00\u6642\u30D5\u30A1\u30A4\u30EB\u304C\u6700\u5F8C\u306E\u5F15\u6570\u3068\u3057\u3066\u8FFD\u52A0\u3055\u308C\u307E\u3059\u3002\n\u901A\u5E38\u3001\u7DE8\u96C6\u30E2\u30FC\u30C9\u306F\u5916\u90E8\u30A8\u30C7\u30A3\u30BF\u304C\u7D42\u4E86\u3059\u308B\u307E\u3067\u7D99\u7D9A\u3057\u307E\u3059\u3002\u4E00\u90E8\u306E\u5916\u90E8\u30A8\u30C7\u30A3\u30BF\u306F\u3001\n\u305F\u3068\u3048\u3070\u7DE8\u96C6\u30A6\u30A3\u30F3\u30C9\u30A6\u304C\u7D42\u4E86\u3059\u308B\u3068\u5373\u5EA7\u306B\u7D42\u4E86\u3059\u308B\u305F\u3081\u3001\u5916\u90E8\u30A8\u30C7\u30A3\u30BF\u30FB\u30D5\u30E9\u30B0\u3092\u4F7F\u7528\u3057\u3066\n\u5373\u6642\u306E\u7D42\u4E86\u3092\u56DE\u907F\u3059\u308B\u304B\u3001-wait\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u3001\u7DE8\u96C6\u30E2\u30FC\u30C9\u304C\u7D42\u4E86\u3059\u308B\u30BF\u30A4\u30DF\u30F3\u30B0\u3092\n\u6307\u5B9A\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u8981\u6C42\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u6CE8\u610F: \
 \u7DE8\u96C6\u30E2\u30FC\u30C9\u4E2D\u3001\u30B3\u30DE\u30F3\u30C9\u5165\u529B\u306F\u8868\u793A\u3055\u308C\u307E\u305B\u3093\u3002\u7DE8\u96C6\u30E2\u30FC\u30C9\u306E\u7D42\u4E86\u5F8C\u3001\u7DE8\u96C6\u3055\u308C\u305F\n\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u5909\u66F4\u5185\u5BB9\u306F\u8868\u793A\u3055\u308C\u307E\u305B\u3093\u3002\n\n-retain\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u8A2D\u5B9A\u306Fjshell\u30C4\u30FC\u30EB\u306E\u3053\u306E\u5B9F\u884C\u3068\u5C06\u6765\u306E\n\u5B9F\u884C\u3067\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n\n<command>\u307E\u305F\u306F\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u306A\u3044\u5F62\u5F0F\u306F\u3001\u30A8\u30C7\u30A3\u30BF\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties
index f755130..7fb001b 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_zh_CN.properties
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,11 @@
 # questions.
 #
 
-jshell.msg.welcome =\u6B22\u8FCE\u4F7F\u7528 JShell -- \u7248\u672C {0}\n\u8981\u5927\u81F4\u4E86\u89E3\u8BE5\u7248\u672C, \u8BF7\u952E\u5165: /help intro\n
+jshell.msg.welcome =\u6B22\u8FCE\u4F7F\u7528 JShell -- \u7248\u672C {0}\n\u8981\u5927\u81F4\u4E86\u89E3\u8BE5\u7248\u672C, \u8BF7\u952E\u5165: /help intro
 jshell.err.opt.arg = \u7F3A\u5C11 {0} \u7684\u53C2\u6570\u3002
 jshell.err.opt.invalid = \u65E0\u6548\u7684\u9009\u9879: {0}\u3002
 jshell.err.opt.one = \u53EA\u80FD\u4F7F\u7528\u4E00\u4E2A {0} \u9009\u9879\u3002
-jshell.err.opt.startup.one = \u53EA\u80FD\u4F7F\u7528\u4E00\u4E2A --startup \u6216 --no-startup \u9009\u9879\u3002
+jshell.err.opt.startup.conflict = \u51B2\u7A81\u7684\u9009\u9879: \u540C\u65F6\u4F7F\u7528\u4E86 --startup \u548C --no-startup\u3002
 jshell.err.opt.feedback.one = \u53EA\u80FD\u4F7F\u7528\u4E00\u4E2A\u53CD\u9988\u9009\u9879 (--feedback, -q, -s \u6216 -v)\u3002
 jshell.err.opt.unknown = \u672A\u77E5\u9009\u9879: {0}
 
@@ -48,12 +48,15 @@
 
 jshell.err.no.such.command.or.snippet.id = \u6CA1\u6709\u8FD9\u6837\u7684\u547D\u4EE4\u6216\u7247\u6BB5 id: {0}
 jshell.err.command.ambiguous = \u547D\u4EE4 ''{0}'' \u4E0D\u660E\u786E: {1}
+jshell.msg.set.restore = \u6B63\u5728\u8BBE\u7F6E\u65B0\u9009\u9879\u5E76\u8FD8\u539F\u72B6\u6001\u3002
 jshell.msg.set.editor.set = \u7F16\u8F91\u5668\u8BBE\u7F6E\u4E3A: {0}
 jshell.msg.set.editor.retain = \u4FDD\u7559\u7684\u7F16\u8F91\u5668\u8BBE\u7F6E: {0}
-jshell.err.cant.launch.editor = \u65E0\u6CD5\u542F\u52A8\u7F16\u8F91\u5668 -- \u610F\u5916\u7684\u5F02\u5E38\u9519\u8BEF: {0}
-jshell.msg.try.set.editor = \u8BF7\u5C1D\u8BD5\u901A\u8FC7 /set editor \u6765\u4F7F\u7528\u5916\u90E8\u7F16\u8F91\u5668\u3002
+jshell.err.no.builtin.editor = \u5185\u7F6E\u7F16\u8F91\u5668\u4E0D\u53EF\u7528\u3002
+jshell.err.cant.launch.editor = \u65E0\u6CD5\u542F\u52A8\u5185\u7F6E\u7F16\u8F91\u5668 -- \u610F\u5916\u7684\u5F02\u5E38\u9519\u8BEF: {0}
+jshell.msg.try.set.editor = \u8BF7\u53C2\u9605 ''/help /set editor'' \u6765\u4E86\u89E3\u5982\u4F55\u4F7F\u7528\u5916\u90E8\u7F16\u8F91\u5668\u3002
 jshell.msg.press.return.to.leave.edit.mode = \u6309\u201C\u8FD4\u56DE\u201D\u9000\u51FA\u7F16\u8F91\u6A21\u5F0F\u3002
 jshell.err.wait.applies.to.external.editor = -wait \u9002\u7528\u4E8E\u5916\u90E8\u7F16\u8F91\u5668
+jshell.label.editpad = JShell Edit Pad
 
 jshell.err.setting.to.retain.must.be.specified = \u5FC5\u987B\u6307\u5B9A\u8981\u4FDD\u7559\u7684\u8BBE\u7F6E -- {0}
 jshell.msg.set.show.mode.settings = \n\u8981\u663E\u793A\u6A21\u5F0F\u8BBE\u7F6E, \u8BF7\u4F7F\u7528 ''/set prompt'', ''/set truncation'', ...\n\u6216\u8005\u4F7F\u7528 ''/set mode'' \u540E\u8DDF\u53CD\u9988\u6A21\u5F0F\u540D\u79F0\u3002
@@ -84,7 +87,7 @@
 
 jshell.err.help.arg = \u6CA1\u6709\u547D\u4EE4\u6216\u4E3B\u9898\u4EE5\u63D0\u4F9B\u7684\u53C2\u6570\u5F00\u59CB: {0}
 jshell.msg.help.begin =\u952E\u5165 Java \u8BED\u8A00\u8868\u8FBE\u5F0F, \u8BED\u53E5\u6216\u58F0\u660E\u3002\n\u6216\u8005\u952E\u5165\u4EE5\u4E0B\u547D\u4EE4\u4E4B\u4E00:\n
-jshell.msg.help.subject =\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u952E\u5165 ''/help'', \u540E\u8DDF\u547D\u4EE4\u6216\u4E3B\u9898\u7684\u540D\u79F0\u3002\n\u4F8B\u5982 ''/help /list'' \u6216 ''/help intro''\u3002\u4E3B\u9898:\n
+jshell.msg.help.subject =\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u952E\u5165 ''/help'', \u540E\u8DDF\n\u547D\u4EE4\u6216\u4E3B\u9898\u7684\u540D\u79F0\u3002\n\u4F8B\u5982 ''/help /list'' \u6216 ''/help intro''\u3002\u4E3B\u9898:\n
 
 jshell.err.drop.arg =\u5728 /drop \u53C2\u6570\u4E2D, \u8BF7\u6307\u5B9A\u8981\u5220\u9664\u7684\u5BFC\u5165, \u53D8\u91CF, \u65B9\u6CD5\u6216\u7C7B\u3002\n\u6309 id \u6216\u540D\u79F0\u6307\u5B9A\u3002\u4F7F\u7528 /list \u53EF\u67E5\u770B id\u3002\u4F7F\u7528 /reset \u53EF\u91CD\u7F6E\u6240\u6709\u72B6\u6001\u3002
 jshell.err.drop.ambiguous = \u53C2\u6570\u5F15\u7528\u4E86\u591A\u4E2A\u5BFC\u5165, \u53D8\u91CF, \u65B9\u6CD5\u6216\u7C7B\u3002
@@ -133,6 +136,11 @@
 jshell.err.retained.mode.failure = \u4FDD\u7559\u6A21\u5F0F\u4E2D\u51FA\u73B0\u6545\u969C (\u5DF2\u6E05\u9664\u6A21\u5F0F) -- {0} {1}
 
 jshell.console.see.more = <\u6309 Tab \u53EF\u67E5\u770B\u66F4\u591A\u5185\u5BB9>
+jshell.console.see.javadoc = <\u518D\u6B21\u6309 shift-tab \u53EF\u67E5\u770B javadoc>
+jshell.console.see.help = <\u518D\u6B21\u6309 shift-tab \u53EF\u67E5\u770B\u8BE6\u7EC6\u5E2E\u52A9>
+jshell.console.see.next.page = <\u6309\u7A7A\u683C\u4EE5\u67E5\u770B\u4E0B\u4E00\u9875, \u6309 Q \u4EE5\u9000\u51FA>
+jshell.console.see.next.javadoc = <\u6309\u7A7A\u683C\u4EE5\u67E5\u770B\u4E0B\u4E00\u4E2A javadoc, \u6309 Q \u4EE5\u9000\u51FA>
+jshell.console.no.javadoc = <\u627E\u4E0D\u5230 javadoc>
 jshell.console.do.nothing = \u4E0D\u6267\u884C\u4EFB\u4F55\u64CD\u4F5C
 jshell.console.choice = \u9009\u9879: 
 jshell.console.create.variable = \u521B\u5EFA\u53D8\u91CF
@@ -142,7 +150,7 @@
 
 
 help.usage = \u7528\u6CD5:   jshell <\u9009\u9879> <\u52A0\u8F7D\u6587\u4EF6>\n\u5176\u4E2D, \u53EF\u80FD\u7684\u9009\u9879\u5305\u62EC:\n    --class-path <\u8DEF\u5F84>   \u6307\u5B9A\u67E5\u627E\u7528\u6237\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n    --module-path <\u8DEF\u5F84>  \u6307\u5B9A\u67E5\u627E\u5E94\u7528\u7A0B\u5E8F\u6A21\u5757\u7684\u4F4D\u7F6E\n    --add-modules <\u6A21\u5757>(,<\u6A21\u5757>)*\n                          \u6307\u5B9A\u8981\u89E3\u6790\u7684\u6A21\u5757; \u5982\u679C <\u6A21\u5757> \n                          \u4E3A ALL-MODULE-PATH, \u5219\u4E3A\u6A21\u5757\u8DEF\u5F84\u4E2D\u7684\u6240\u6709\u6A21\u5757\n    --startup <\u6587\u4EF6>      \u5BF9\u542F\u52A8\u5B9A\u4E49\u6267\u884C\u5355\u6B21\u66FF\u6362\n    --no-startup          \u4E0D\u8FD0\u884C\u542F\u52A8\u5B9A\u4E49\n    --feedback <\u6A21\u5F0F>     \u6307\u5B9A\u521D\u59CB\u53CD\u9988\u6A21\u5F0F\u3002\u8BE5\u6A21\u5F0F\u53EF\u4EE5\u662F\n                           \u9884\u5B9A\u4E49\u7684 (silent, concise, normal \u6216 verbose), \n                           \u4E5F\u53EF\u662F\u4EE5\u524D\u7528\u6237\u5B9A\u4E49\u7684\n    -q                    \u65E0\u63D0\u793A\u53CD\u9988\u3002\u7B49\u540C\u4E8E: --feedback concise\n    -s                    \u771F\u6B63\u65E0\u63D0\u793A\u53CD\u9988\u3002\u7B49\u540C\u4E8E: --feedback silent\n    -v                    \u8BE6\u7EC6\u53CD\u9988\u3002\u7B49\u540C\u4E8E: --feedback verbose\n    -J<\u6807\u8BB0>              \u76F4\u63A5\u5C06 <\u6807\u8BB0> \u4F20\u9012\u5230\u8FD0\u884C\u65F6\u7CFB\u7EDF\u3002\n                           \u4E3A\u6BCF\u4E2A\u8FD0\u884C\u65F6\u6807\u8BB0\u6216\u6807\u8BB0\u53C2\u6570\u4F7F\u7528\u4E00\u4E2A -J\n    -R<\u6807\u8BB0>              \u5C06 <\u6807\u8BB0> \u4F20\u9012\u5230\u8FDC\u7A0B\u8FD0\u884C\u65F6\u7CFB\u7EDF\u3002\n                           \u4E3A\u6BCF\u4E2A\u8FDC\u7A0B\u6807\u8BB0\u6216\u6807\u8BB0\u53C2\u6570\u4F7F\u7528\u4E00\u4E2A -R\n    -C<\u6807\u8BB0>              \u5C06 <\u6807\u8BB0> \u4F20\u9012\u5230\u7F16\u8BD1\u5668\u3002\n                           \u4E3A\u6BCF\u4E2A\u7F16\u8BD1\u5668\u6807\u8BB0\u6216\u6807\u8BB0\u53C2\u6570\u4F7F\u7528\u4E00\u4E2A -C\n    --help                \u8F93\u51FA\u6807\u51C6\u9009\u9879\u7684\u6B64\u63D0\u8981\n    --version             \u7248\u672C\u4FE1\u606F\n    -X                    \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n
-help.usage.x = \    --add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>   \u5C06\u6307\u5B9A\u7684\u6A21\u5757\u4E13\u7528\u7A0B\u5E8F\u5305\u5BFC\u51FA\u5230\u7247\u6BB5\n    \n\u8FD9\u4E9B\u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
+help.usage.x = \    --add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>      \u5C06\u6307\u5B9A\u7684\u6A21\u5757\u4E13\u7528\u7A0B\u5E8F\u5305\u5BFC\u51FA\u5230\u7247\u6BB5\n    --execution <\u89C4\u8303>                 \u6307\u5B9A\u66FF\u4EE3\u6267\u884C\u5F15\u64CE\u3002\n                                         \u5176\u4E2D <\u89C4\u8303> \u662F ExecutionControl \u89C4\u8303\u3002\n                                         \u6709\u5173\u89C4\u8303\u7684\u8BED\u6CD5, \u8BF7\u53C2\u9605\u7A0B\u5E8F\u5305\n                                         jdk.jshell.spi \u7684\u6587\u6863\n    \n\u8FD9\u4E9B\u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
 
 help.list.summary = \u5217\u51FA\u60A8\u952E\u5165\u7684\u6E90
 help.list.args = [<\u540D\u79F0\u6216 id>|-all|-start]
@@ -185,16 +193,16 @@
 help.exit =\u9000\u51FA jshell \u5DE5\u5177\u3002\u4E0D\u4FDD\u5B58\u5DE5\u4F5C\u3002\n\u5728\u4F7F\u7528\u6B64\u547D\u4EE4\u524D\u5E94\u8BE5\u5148\u4FDD\u5B58\u4EFB\u4F55\u5DE5\u4F5C
 
 help.reset.summary = \u91CD\u542F jshell
-help.reset.args =
-help.reset =\u91CD\u542F jshell \u5DE5\u5177\u4EE3\u7801\u548C\u6267\u884C\u72B6\u6001:\n\t* \u6240\u6709\u8F93\u5165\u7684\u4EE3\u7801\u90FD\u5C06\u4E22\u5931\u3002\n\t* \u91CD\u65B0\u6267\u884C\u542F\u52A8\u4EE3\u7801\u3002\n\t* \u91CD\u65B0\u542F\u52A8\u6267\u884C\u72B6\u6001\u3002\n\t* \u6E05\u9664\u7C7B\u8DEF\u5F84\u3002\n\u5C06\u5DE5\u5177\u8BBE\u7F6E\u4FDD\u6301\u4E3A\u901A\u8FC7\u4EE5\u4E0B\u547D\u4EE4\u6267\u884C\u7684\u8BBE\u7F6E: /set ...\n\u5728\u4F7F\u7528\u6B64\u547D\u4EE4\u524D\u5E94\u8BE5\u5148\u4FDD\u5B58\u4EFB\u4F55\u5DE5\u4F5C
+help.reset.args = [-class-path <\u8DEF\u5F84>] [-module-path <\u8DEF\u5F84>] [-add-modules <\u6A21\u5757>]...
+help.reset =\u91CD\u7F6E jshell \u5DE5\u5177\u4EE3\u7801\u548C\u6267\u884C\u72B6\u6001:\n\t* \u6240\u6709\u8F93\u5165\u7684\u4EE3\u7801\u90FD\u5C06\u4E22\u5931\u3002\n\t* \u91CD\u65B0\u6267\u884C\u542F\u52A8\u4EE3\u7801\u3002\n\t* \u91CD\u65B0\u542F\u52A8\u6267\u884C\u72B6\u6001\u3002\n\t\u5C06\u5DE5\u5177\u8BBE\u7F6E\u4FDD\u6301\u4E3A\u901A\u8FC7\u4EE5\u4E0B\u547D\u4EE4\u6267\u884C\u7684\u8BBE\u7F6E: /set ...\n\u5728\u4F7F\u7528\u6B64\u547D\u4EE4\u524D\u5E94\u8BE5\u5148\u4FDD\u5B58\u4EFB\u4F55\u5DE5\u4F5C\u3002\n/reset \u547D\u4EE4\u63A5\u53D7\u4E0A\u4E0B\u6587\u9009\u9879, \u8BF7\u53C2\u9605:\n\n\t/help context\n
 
-help.reload.summary = \u91CD\u542F\u548C\u91CD\u653E\u76F8\u5173\u5386\u53F2\u8BB0\u5F55 -- \u5F53\u524D\u5386\u53F2\u8BB0\u5F55\u6216\u4E0A\u4E00\u4E2A\u5386\u53F2\u8BB0\u5F55 (-restore)
-help.reload.args = [-restore] [-quiet]
-help.reload =\u91CD\u7F6E jshell \u5DE5\u5177\u4EE3\u7801\u548C\u6267\u884C\u72B6\u6001, \u7136\u540E\u6309\u7167\u5404\u6709\u6548\u7247\u6BB5\u548C\n\u4EFB\u4F55 /drop \u6216 /classpath \u547D\u4EE4\u7684\u8F93\u5165\u987A\u5E8F\u91CD\u653E\u5B83\u4EEC\u3002\n\n/reload\n\t\u91CD\u7F6E\u548C\u91CD\u653E\u81EA\u8FDB\u5165 jshell \u4EE5\u6765\u7684\u6709\u6548\u5386\u53F2\u8BB0\u5F55, \n\t\u6216\u8005\u6267\u884C /reset \u6216 /reload \u547D\u4EE4\u4E2D\u6700\u65B0\u7684\u90A3\u4E2A\n\t\u547D\u4EE4\u3002\n\n/reload -restore\n\t\u91CD\u7F6E\u5E76\u91CD\u653E\u4E0A\u4E00\u6B21\u8FDB\u5165 jshell \u4EE5\u53CA\u6700\u8FD1\u8FDB\u5165 jshell\n\t\u4E4B\u95F4\u7684\u6709\u6548\u5386\u53F2\u8BB0\u5F55, \u6216\u8005\u6267\u884C /reset \u6216 /reload\n\t\u547D\u4EE4\u3002\u8FD9\u8FDB\u800C\u53EF\u7528\u4E8E\u8FD8\u539F\u4E0A\u4E00\u4E2A\n\tjshell \u5DE5\u5177\u4F1A\u8BDD\u3002\n\n/reload [-restore] -quiet\n\t\u4F7F\u7528 '-quiet' \u53C2\u6570\u65F6, \u4E0D\u663E\u793A\u91CD\u653E\u3002\u5C06\u663E\u793A\u9519\u8BEF\u3002
+help.reload.summary = \u91CD\u7F6E\u548C\u91CD\u653E\u76F8\u5173\u5386\u53F2\u8BB0\u5F55 -- \u5F53\u524D\u5386\u53F2\u8BB0\u5F55\u6216\u4E0A\u4E00\u4E2A\u5386\u53F2\u8BB0\u5F55 (-restore)
+help.reload.args = [-restore] [-quiet] [-class-path <\u8DEF\u5F84>] [-module-path <\u8DEF\u5F84>]...
+help.reload =\u91CD\u7F6E jshell \u5DE5\u5177\u4EE3\u7801\u548C\u6267\u884C\u72B6\u6001, \u7136\u540E\u6309\u7167\u5404\u6709\u6548\u7247\u6BB5\u548C\n\u4EFB\u4F55 /drop \u6216 /classpath \u547D\u4EE4\u7684\u8F93\u5165\u987A\u5E8F\u91CD\u653E\u5B83\u4EEC\u3002\n\n/reload\n\t\u91CD\u7F6E\u548C\u91CD\u653E\u81EA\u8FDB\u5165 jshell \u4EE5\u6765\u7684\u6709\u6548\u5386\u53F2\u8BB0\u5F55, \n\t\u6216\u8005\u6267\u884C /reset \u6216 /reload \u547D\u4EE4\u4E2D\u6700\u65B0\u7684\u90A3\u4E2A\n\t\u547D\u4EE4\u3002\n\n/reload -restore\n\t\u91CD\u7F6E\u5E76\u91CD\u653E\u4E0A\u4E00\u6B21\u8FDB\u5165 jshell \u4E0E\u6700\u8FD1\u8FDB\u5165 jshell\n\t\u4E4B\u95F4\u7684\u6709\u6548\u5386\u53F2\u8BB0\u5F55, \u6216\u8005\u6267\u884C /reset \u6216 /reload\n\t\u547D\u4EE4\u3002\u8FD9\u8FDB\u800C\u53EF\u7528\u4E8E\u8FD8\u539F\u4E0A\u4E00\u4E2A\n\tjshell \u5DE5\u5177\u4F1A\u8BDD\u3002\n\n/reload [-restore] -quiet\n\t\u4F7F\u7528 '-quiet' \u53C2\u6570\u65F6, \u4E0D\u663E\u793A\u91CD\u653E\u3002\u5C06\u663E\u793A\u9519\u8BEF\u3002\n\n\u4E0A\u9762\u6BCF\u4E2A\u547D\u4EE4\u90FD\u63A5\u53D7\u4E0A\u4E0B\u6587\u9009\u9879, \u8BF7\u53C2\u9605:\n\n\t/help context\n\n\u4F8B\u5982:\n\n\t/reload -add-modules com.greetings -restore
 
-help.classpath.summary = \u5C06\u8DEF\u5F84\u6DFB\u52A0\u5230\u7C7B\u8DEF\u5F84
-help.classpath.args = <path>
-help.classpath =\u5411\u7C7B\u8DEF\u5F84\u9644\u52A0\u5176\u4ED6\u8DEF\u5F84\u3002
+help.env.summary = \u67E5\u770B\u6216\u66F4\u6539\u8BC4\u4F30\u4E0A\u4E0B\u6587
+help.env.args = [-class-path <\u8DEF\u5F84>] [-module-path <\u8DEF\u5F84>] [-add-modules <\u6A21\u5757>] ...
+help.env =\u67E5\u770B\u6216\u66F4\u6539\u8BC4\u4F30\u4E0A\u4E0B\u6587\u3002\u8BC4\u4F30\u4E0A\u4E0B\u6587\u662F\u7C7B\u8DEF\u5F84, \n\u6A21\u5757\u8DEF\u5F84\u7B49\u7B49\u3002\n/env\n\t\u663E\u793A\u4F5C\u4E3A\u4E0A\u4E0B\u6587\u9009\u9879\u663E\u793A\u7684\u8BC4\u4F30\u4E0A\u4E0B\u6587\u3002\n\n/env [-class-path <\u8DEF\u5F84>] [-module-path <\u8DEF\u5F84>] [-add-modules <\u6A21\u5757>] ...\n\t\u5728\u81F3\u5C11\u8BBE\u7F6E\u4E00\u4E2A\u9009\u9879\u7684\u60C5\u51B5\u4E0B, \u8BBE\u7F6E\u8BC4\u4F30\u4E0A\u4E0B\u6587\u3002\u5982\u679C\n\t\u5DF2\u5B9A\u4E49\u7247\u6BB5, \u5219\u5C06\u4F7F\u7528\u65B0\u8BC4\u4F30\u4E0A\u4E0B\u6587\u91CD\u7F6E\n\t\u6267\u884C\u72B6\u6001, \u5E76\u4E14\u5C06\u91CD\u653E\u7247\u6BB5 -- \u4E0D\u663E\u793A\n\t\u91CD\u653E, \u4F46\u662F\u5C06\u663E\u793A\u9519\u8BEF\u3002\u8FD9\u7B49\u540C\u4E8E: /reload -quiet\n\t\u6709\u5173\u4E0A\u4E0B\u6587\u9009\u9879\u7684\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605:\n\n\t\t/help context\n\n\t\u4F8B\u5982:\n\n\t\t/env -add-modules com.greetings
 
 help.history.summary = \u60A8\u952E\u5165\u7684\u5185\u5BB9\u7684\u5386\u53F2\u8BB0\u5F55
 help.history.args =
@@ -234,6 +242,8 @@
 help.shortcuts.summary = \u5FEB\u6377\u65B9\u5F0F\u7684\u8BF4\u660E
 help.shortcuts =\u652F\u6301\u7684\u5FEB\u6377\u65B9\u5F0F\u5305\u62EC:\n\n<tab>\n\t\t\u5728\u8F93\u5165 Java \u6807\u8BC6\u7B26, jshell \u547D\u4EE4\u6216 jshell\n\t\t\u547D\u4EE4\u53C2\u6570 (\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B) \u7684\u524D\u51E0\u4E2A\u5B57\u6BCD\u540E,\n\t\t\u6309 <tab> \u952E\u53EF\u4EE5\u5B8C\u6210\u8F93\u5165\u3002\n\t\t\u5982\u679C\u6709\u591A\u4E2A\u8F93\u5165\u63D0\u793A, \u5219\u663E\u793A\u53EF\u80FD\u7684\u8F93\u5165\u63D0\u793A\u3002\n\nShift-<tab>\n\t\t\u5728\u65B9\u6CD5\u6216\u6784\u9020\u5668\u8C03\u7528\u7684\u540D\u79F0\u548C\u5DE6\u62EC\u53F7\u540E\u9762,\n\t\t\u6309\u4F4F <shift> \u952E\u5E76\u6309 <tab> \u53EF\u67E5\u770B\u6240\u6709\n\t\t\u5339\u914D\u7684\u65B9\u6CD5/\u6784\u9020\u5668\u7684\u63D0\u8981\u3002\n\n<fix-shortcut> v\n\t\t\u5728\u5B8C\u6574\u7684\u8868\u8FBE\u5F0F\u540E\u9762, \u6309 "<fix-shortcut> v" \u53EF\u4EE5\u5F15\u5165\u65B0\u7684\u53D8\u91CF,\n\t\t\u5176\u7C7B\u578B\u57FA\u4E8E\u8868\u8FBE\u5F0F\u7684\u7C7B\u578B\u3002\n\t\t"<fix-shortcut>" \u53EF\u4EE5\u662F Alt-F1 \u6216 Alt-Enter, \u5177\u4F53\u53D6\u51B3\u4E8E\u5E73\u53F0\u3002\n\n<fix-shortcut> i\n\t\t\u5728\u4E0D\u53EF\u89E3\u6790\u7684\u6807\u8BC6\u7B26\u540E\u9762, \u6309 "<fix-shortcut> i", \u6B64\u65F6 jshell \u5C06\u4F1A\n\t\t\u6839\u636E\u6307\u5B9A\u7C7B\u8DEF\u5F84\u7684\u5185\u5BB9\u63D0\u8BAE\u53EF\u80FD\u7684\u5168\u9650\u5B9A\u540D\u79F0\u3002\n\t\t"<fix-shortcut>" \u53EF\u4EE5\u662F Alt-F1 \u6216 Alt-Enter, \u5177\u4F53\u53D6\u51B3\u4E8E\u5E73\u53F0\u3002
 
+help.context.summary = /env /reload \u548C /reset \u7684\u8BC4\u4F30\u4E0A\u4E0B\u6587\u9009\u9879
+help.context =\u8FD9\u4E9B\u9009\u9879\u7528\u4E8E\u914D\u7F6E\u8BC4\u4F30\u4E0A\u4E0B\u6587, \u5B83\u4EEC\u53EF\u4EE5\u5728\u542F\u52A8\njshell \u65F6\u6307\u5B9A: \u5728\u547D\u4EE4\u884C\u4E0A, \u6216\u8005\u4F7F\u7528\u547D\u4EE4 /env,\n/reload \u6216 /reset \u91CD\u65B0\u542F\u52A8\u65F6\u3002\n\n\u5B83\u4EEC\u662F:\n\t--class-path <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n\t\t\u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u7684\u76EE\u5F55, JAR \n\t\t\u6863\u6848\u548C ZIP \u6863\u6848\u7684\u5217\u8868\u3002\n\t\t\u8BE5\u5217\u8868\u4F7F\u7528\u8DEF\u5F84\u5206\u9694\u7B26\u5206\u9694\n\t\t(\u5728 unix/linux/mac \u4E0A\u4F7F\u7528 :, \u5728 Windows \u4E0A\u4F7F\u7528 ;)\u3002\n\t--module-path <\u6A21\u5757\u8DEF\u5F84>...\n\t\t\u76EE\u5F55\u5217\u8868, \u5176\u4E2D\u6BCF\u4E2A\u76EE\u5F55\n\t\t\u90FD\u662F\u4E00\u4E2A\u5305\u542B\u6A21\u5757\u7684\u76EE\u5F55\u3002\n\t\t\u8BE5\u5217\u8868\u4F7F\u7528\u8DEF\u5F84\u5206\u9694\u7B26\u5206\u9694\n\t\t(\u5728 unix/linux/mac \u4E0A\u4F7F\u7528 :, \u5728 Windows \u4E0A\u4F7F\u7528 ;)\u3002\n\t--add-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n\t\t\u9664\u4E86\u521D\u59CB\u6A21\u5757\u4E4B\u5916\u8981\u89E3\u6790\u7684\u6839\u6A21\u5757\u3002\n\t\t<\u6A21\u5757\u540D\u79F0> \u8FD8\u53EF\u4EE5\u662F ALL-DEFAULT, ALL-SYSTEM,\n\t\tALL-MODULE-PATH\u3002\n\t--add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n\t\t\u66F4\u65B0 <\u6A21\u5757> \u4EE5\u5C06 <\u7A0B\u5E8F\u5305> \u5BFC\u51FA\u5230 <\u76EE\u6807\u6A21\u5757>,\n\t\t\u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n\t\t<\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u5BFC\u51FA\u5230\u5168\u90E8\n\t\t\u672A\u547D\u540D\u6A21\u5757\u3002\u5728 jshell \u4E2D, \u5982\u679C\u672A\u6307\u5B9A \n\t\t<\u76EE\u6807\u6A21\u5757> (no =), \u5219\u4F7F\u7528 ALL-UNNAMED\u3002\n\n\u5728\u547D\u4EE4\u884C\u4E0A, \u8FD9\u4E9B\u9009\u9879\u5FC5\u987B\u6709\u4E24\u4E2A\u77ED\u5212\u7EBF, \u4F8B\u5982: --module-path\n\u5728 jshell \u547D\u4EE4\u4E0A, \u5B83\u4EEC\u53EF\u4EE5\u6709\u4E00\u4E2A\u6216\u4E24\u4E2A\u77ED\u5212\u7EBF, \u4F8B\u5982: -module-path\n
 help.set._retain = '-retain' \u9009\u9879\u4FDD\u5B58\u8BBE\u7F6E\u4EE5\u4FBF\u5728\u5C06\u6765\u4F1A\u8BDD\u4E2D\u4F7F\u7528\u3002\n\u53EF\u4EE5\u5728 /set \u7684\u4EE5\u4E0B\u683C\u5F0F\u4E2D\u4F7F\u7528 -retain \u9009\u9879:\n\n\t/set editor -retain\n\t/set start -retain\n\t/set feedback -retain\n\t/set mode -retain\n\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605\u8FD9\u4E9B\u547D\u4EE4 -- \u4F8B\u5982, /help /set editor
 
 help.set.format = \u8BBE\u7F6E\u7528\u4E8E\u62A5\u544A\u7247\u6BB5\u4E8B\u4EF6\u7684\u683C\u5F0F\uFF1A\n\n\t/set format <\u6A21\u5F0F> <\u5B57\u6BB5> "<\u683C\u5F0F>" <\u9009\u62E9\u5668>...\n\n\u663E\u793A\u683C\u5F0F\u8BBE\u7F6E:\n\n\t/set format [<\u6A21\u5F0F> [<\u5B57\u6BB5>]]\n\n\u5176\u4E2D <\u6A21\u5F0F> \u662F\u4EE5\u524D\u5B9A\u4E49\u7684\u53CD\u9988\u6A21\u5F0F\u7684\u540D\u79F0 -- \u8BF7\u53C2\u9605 '/help /set mode'\u3002\n\u5176\u4E2D <\u5B57\u6BB5> \u662F\u8981\u5B9A\u4E49\u7684\u4E0A\u4E0B\u6587\u7279\u5B9A\u683C\u5F0F\u7684\u540D\u79F0\u3002\n\u5176\u4E2D <\u683C\u5F0F> \u662F\u4E00\u4E2A\u5E26\u5F15\u53F7\u7684\u5B57\u7B26\u4E32, \u8BE5\u5B57\u7B26\u4E32\u5C06\u4E3A\n\u5B57\u6BB5\u7684\u503C (\u5982\u679C\u9009\u62E9\u5668\u5339\u914D, \u6216\u8005\u6CA1\u6709\u4EFB\u4F55\u9009\u62E9\u5668)\u3002\n\u5728\u4F7F\u7528\u683C\u5F0F\u65F6, \u7528\u5927\u62EC\u53F7\u62EC\u8D77\u7684\u5B57\u6BB5\u540D\u5C06\u4F1A\u5728\u76F8\u5E94\u65F6\u95F4\n\u4F7F\u7528\u5B57\u6BB5\u503C\u66FF\u6362\u3002\u8FD9\u4E9B\u5B57\u6BB5\u53EF\u80FD\u5DF2\u4F7F\u7528\u6B64\u547D\u4EE4\u5B9A\u4E49, \n\u4E5F\u53EF\u80FD\u662F\u7279\u5B9A\u4E8E\u4E0A\u4E0B\u6587\u7684\u4EE5\u4E0B\u9884\u5B9A\u4E49\u5B57\u6BB5\u4E4B\u4E00:\n\t{name}       == \u540D\u79F0, \u4F8B\u5982: \u53D8\u91CF\u7684\u540D\u79F0, ...\n\t{type}       == \u7C7B\u578B\u540D\u79F0\u3002\u53D8\u91CF\u6216\u8868\u8FBE\u5F0F\u7684\u7C7B\u578B,\n\t\t\t\u65B9\u6CD5\u7684\u53C2\u6570\u7C7B\u578B\n\t{value}      == \u8868\u8FBE\u5F0F\u6216\u53D8\u91CF\u521D\u59CB\u5316\u7684\u7ED3\u679C\u503C\n\t{unresolved} == \u672A\u89E3\u6790\u5F15\u7528\u7684\u5217\u8868\n\t{errors}     == \u53EF\u6062\u590D\u9519\u8BEF\u7684\u5217\u8868 (\u53EA\u5728\u5904\u7406\n\t\t\t"display" \u5B57\u6BB5\u671F\u95F4)\n\t{err}        == \u65E0\u683C\u5F0F\u7684\u9519\u8BEF\u884C (\u53EA\u5728\u5904\u7406\n\t\t\t"errorline" \u5B57\u6BB5\u671F\u95F4)\n\u8BE5\u5DE5\u5177\u8BBF\u95EE\u4EE5\u4E0B\u5B57\u6BB5\u6765\u786E\u5B9A\u6240\u663E\u793A\u7684\u53CD\u9988:\n\t{display}    == \u4E3A\u7247\u6BB5\u4E8B\u4EF6\u663E\u793A\u7684\u6D88\u606F\n\t{errorline}  == "errors" \u5B57\u6BB5\u4E2D\u7684\u4E00\u4E2A\u9519\u8BEF\u884C\u7684\u683C\u5F0F\n\t{pre}        == \u53CD\u9988\u524D\u7F00 (\u4F5C\u4E3A\u547D\u4EE4\u53CD\u9988\u7684\u5F00\u5934)\n\t{post}       == \u53CD\u9988\u540E\u7F00 (\u4F5C\u4E3A\u547D\u4EE4\u53CD\u9988\u7684\u7ED3\u5C3E)\n\t{errorpre}   == \u9519\u8BEF\u524D\u7F00 (\u4F5C\u4E3A\u9519\u8BEF\u53CD\u9988\u7684\u5F00\u5934)\n\t{errorpost}  == \u9519\u8BEF\u540E\u7F00 (\u4F5C\u4E3A\u9519\u8BEF\u53CD\u9988\u7684\u7ED3\u5C3E)\n\u8FD9\u4E9B\u5B57\u6BB5\u5177\u6709\u9ED8\u8BA4\u8BBE\u7F6E (\u53EF\u8986\u76D6)\u3002\n\u5176\u4E2D <selector> \u662F\u5E94\u7528\u683C\u5F0F\u7684\u4E0A\u4E0B\u6587\u3002\n\u9009\u62E9\u5668\u7ED3\u6784\u662F\u4E00\u4E2A\u7531\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u6784\u6210\u7684\u5217\u8868, \u4F7F\u7528\u8FDE\u5B57\u7B26\u5206\u9694\u3002\n\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u662F\u5355\u4E2A\u9009\u62E9\u5668\u7C7B\u578B\u7684\u503C\u7684\u5217\u8868, \u4F7F\u7528\u9017\u53F7\u5206\u9694\u3002\n\u5982\u679C\u6BCF\u4E2A\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u5339\u914D, \u5219\u9009\u62E9\u5668\u5339\u914D; \u5982\u679C\u5176\u4E2D\u67D0\u4E2A\u503C\n\u5339\u914D, \u5219\u9009\u62E9\u5668\u7C7B\u578B\u5217\u8868\u5339\u914D\u3002\n\ncase \u9009\u62E9\u5668\u7C7B\u578B\u63CF\u8FF0\u4E86\u7247\u6BB5\u7684\u7C7B\u578B\u3002\u503C\u5305\u62EC:\n\timport     -- \u5BFC\u5165\u58F0\u660E\n\tclass      -- \u7C7B\u58F0\u660E\n\tinterface  -- \u63A5\u53E3\u58F0\u660E\n\tenum       -- \u679A\u4E3E\u58F0\u660E\n\tannotation -- \u6CE8\u91CA\u63A5\u53E3\u58F0\u660E\n\tmethod     -- \u65B9\u6CD5\u58F0\u660E -- \u6CE8: {type}==parameter-types\n\tvardecl    -- \u4E0D\u5E26\u521D\u59CB\u5316\u7684\u53D8\u91CF\u58F0\u660E\n\tvardecl    -- \u5E26\u521D\u59CB\u5316\u7684\u53D8\u91CF\u58F0\u660E\n\texpression -- \u8868\u8FBE\u5F0F -- \u6CE8: \
@@ -245,7 +255,7 @@
 
 help.set.mode = \u521B\u5EFA\u7528\u6237\u5B9A\u4E49\u7684\u53CD\u9988\u6A21\u5F0F, \u4E5F\u53EF\u4EE5\u9009\u62E9\u4ECE\u73B0\u6709\u6A21\u5F0F\u590D\u5236:\n\n\t/set mode <\u6A21\u5F0F> [<\u65E7\u6A21\u5F0F>] [-command|-quiet|-delete]\n\u4FDD\u7559\u7528\u6237\u5B9A\u4E49\u7684\u53CD\u9988\u6A21\u5F0F\u4EE5\u4FBF\u5728\u5C06\u6765\u4F1A\u8BDD\u4E2D\u4F7F\u7528:\n\n\t/set mode -retain <\u6A21\u5F0F>\n\n\u5220\u9664\u7528\u6237\u5B9A\u4E49\u7684\u53CD\u9988\u6A21\u5F0F:\n\n\t/set mode -delete [-retain] <\u6A21\u5F0F>\n\n\u663E\u793A\u53CD\u9988\u6A21\u5F0F\u8BBE\u7F6E:\n\n\t/set mode [<\u6A21\u5F0F>]\n\n\u5176\u4E2D <\u65B0\u6A21\u5F0F> \u662F\u60A8\u5E0C\u671B\u521B\u5EFA\u7684\u6A21\u5F0F\u7684\u540D\u79F0\u3002\n\u800C <\u65E7\u6A21\u5F0F> \u662F\u4EE5\u524D\u5B9A\u4E49\u7684\u53CD\u9988\u6A21\u5F0F\u540D\u79F0\u3002\n\u5982\u679C\u5B58\u5728 <\u65E7\u6A21\u5F0F>, \u5176\u8BBE\u7F6E\u5C06\u4F1A\u590D\u5236\u5230\u65B0\u6A21\u5F0F\u3002\n'-command' \u4E0E '-quiet' \u51B3\u5B9A\u4E86\u662F\u5426\u663E\u793A\u4FE1\u606F\u6027/\u9A8C\u8BC1\u547D\u4EE4\u53CD\u9988\u3002\n\n\u4E00\u65E6\u521B\u5EFA\u65B0\u6A21\u5F0F, \u5373\u53EF\u4F7F\u7528 '/set format', '/set prompt' \u548C '/set truncation'\n\u8FDB\u884C\u914D\u7F6E\u3002\u4F7F\u7528 '/set feedback' \u53EF\u4F7F\u7528\u65B0\u6A21\u5F0F\u3002\n\n\u4F7F\u7528 -retain \u9009\u9879\u65F6, \u5C06\u5728\u672C\u6B21\u8FD0\u884C\u548C\u5C06\u6765\u8FD0\u884C jshell \u5DE5\u5177\u65F6\n\u4F7F\u7528\u8BE5\u6A21\u5F0F (\u5305\u62EC\u5176\u7EC4\u4EF6\u63D0\u793A, \u683C\u5F0F\u548C\u622A\u65AD\u8BBE\u7F6E)\u3002\n\u540C\u65F6\u4F7F\u7528 -retain \u548C -delete \u65F6, \u5C06\u4ECE\u5F53\u524D\u548C\u5C06\u6765\u4F1A\u8BDD\u4E2D\n\u5220\u9664\u8BE5\u6A21\u5F0F\u3002\n\n\u4E0D\u5E26\u9009\u9879\u7684\u683C\u5F0F\u663E\u793A\u6A21\u5F0F\u8BBE\u7F6E\u3002\n\u6307\u5B9A <\u6A21\u5F0F> \u65F6, \u5C06\u4EC5\u663E\u793A\u8BE5\u6A21\u5F0F\u7684\u6A21\u5F0F\u8BBE\u7F6E\u3002\n\u6CE8: \u6A21\u5F0F\u8BBE\u7F6E\u5305\u62EC\u63D0\u793A, \u683C\u5F0F\u548C\u622A\u65AD\u7684\n\u8BBE\u7F6E -- \u56E0\u6B64\u8FD8\u4F1A\u663E\u793A\u8FD9\u4E9B\u8BBE\u7F6E\u3002\n\u793A\u4F8B:\n\t/set mode myformat\n\u663E\u793A\u6A21\u5F0F myformat \u7684\u6A21\u5F0F, \u63D0\u793A, \u683C\u5F0F\u548C\u622A\u65AD\u8BBE\u7F6E\n
 
-help.set.prompt = \u8BBE\u7F6E\u63D0\u793A\u7B26\u3002\u5FC5\u987B\u540C\u65F6\u8BBE\u7F6E\u6B63\u5E38\u63D0\u793A\u548C\u66F4\u591A\u63D0\u793A:\n\n\t/set prompt <\u6A21\u5F0F> "<\u63D0\u793A>" "<\u66F4\u591A\u63D0\u793A>"\n\n\u663E\u793A\u6B63\u5E38\u63D0\u793A\u548C\u66F4\u591A\u63D0\u793A:\n\n\t/set prompt [<\u6A21\u5F0F>]\n\n\u5176\u4E2D <\u6A21\u5F0F> \u662F\u4EE5\u524D\u5B9A\u4E49\u7684\u53CD\u9988\u6A21\u5F0F\u540D\u79F0\u3002\n\u800C <\u63D0\u793A> \u548C <\u66F4\u591A\u63D0\u793A> \u662F\u4F5C\u4E3A\u8F93\u5165\u63D0\u793A\u7B26\u8F93\u51FA\u7684\u5E26\u5F15\u53F7\u7684\u5B57\u7B26\u4E32;\n\u5B83\u4EEC\u5747\u53EF\u9009\u62E9\u6027\u5730\u5305\u542B '%s', \u8BE5\u53D8\u91CF\u5C06\u88AB\u66FF\u6362\u4E3A\u4E0B\u4E00\u4E2A\u7247\u6BB5 ID --\n\u8BF7\u6CE8\u610F, \u53EF\u80FD\u65E0\u6CD5\u5411\u6240\u8F93\u5165\u5185\u5BB9\u5206\u914D\u8BE5 ID, \u4F8B\u5982\u8FD9\u53EF\u80FD\u662F\u4E00\u4E2A\u9519\u8BEF\u6216\u547D\u4EE4\u3002\n\u66F4\u591A\u63D0\u793A\u5728\u591A\u884C\u7247\u6BB5\u7684\u7B2C\u4E8C\u884C\u4EE5\u53CA\u540E\u7EED\u884C\u4E0A\u4F7F\u7528\u3002\n\n\u4E0D\u5E26 <\u63D0\u793A> \u7684\u683C\u5F0F\u663E\u793A\u5F53\u524D\u8BBE\u7F6E\u63D0\u793A\u3002\n\u6307\u5B9A <\u6A21\u5F0F> \u65F6, \u5C06\u4EC5\u663E\u793A\u8BE5\u6A21\u5F0F\u7684\u63D0\u793A\u3002\n\u793A\u4F8B:\n\t/set prompt myformat\n\u663E\u793A\u4E3A\u6A21\u5F0F myformat \u8BBE\u7F6E\u7684\u63D0\u793A\n
+help.set.prompt = \u8BBE\u7F6E\u63D0\u793A\u3002\u5FC5\u987B\u540C\u65F6\u8BBE\u7F6E\u6B63\u5E38\u63D0\u793A\u548C\u66F4\u591A\u63D0\u793A:\n\n\t/set prompt <\u6A21\u5F0F> "<\u63D0\u793A>" "<\u66F4\u591A\u63D0\u793A>"\n\n\u663E\u793A\u6B63\u5E38\u63D0\u793A\u548C\u66F4\u591A\u63D0\u793A:\n\n\t/set prompt [<\u6A21\u5F0F>]\n\n\u5176\u4E2D <\u6A21\u5F0F> \u662F\u4EE5\u524D\u5B9A\u4E49\u7684\u53CD\u9988\u6A21\u5F0F\u540D\u79F0\u3002\n\u800C <\u63D0\u793A> \u548C <\u66F4\u591A\u63D0\u793A> \u662F\u4F5C\u4E3A\u8F93\u5165\u63D0\u793A\u8F93\u51FA\u7684\u5E26\u5F15\u53F7\u7684\u5B57\u7B26\u4E32;\n\u5B83\u4EEC\u5747\u53EF\u9009\u62E9\u6027\u5730\u5305\u542B '%%s', \u8BE5\u53D8\u91CF\u5C06\u88AB\u66FF\u6362\u4E3A\u4E0B\u4E00\u4E2A\u7247\u6BB5 ID --\n\u8BF7\u6CE8\u610F, \u53EF\u80FD\u65E0\u6CD5\u5411\u6240\u8F93\u5165\u5185\u5BB9\u5206\u914D\u8BE5 ID, \u4F8B\u5982\u8FD9\u53EF\u80FD\u662F\u4E00\u4E2A\u9519\u8BEF\u6216\u547D\u4EE4\u3002\n\u66F4\u591A\u63D0\u793A\u5728\u591A\u884C\u7247\u6BB5\u7684\u7B2C\u4E8C\u884C\u4EE5\u53CA\u540E\u7EED\u884C\u4E0A\u4F7F\u7528\u3002\n\n\u4E0D\u5E26 <\u63D0\u793A> \u7684\u683C\u5F0F\u663E\u793A\u5F53\u524D\u8BBE\u7F6E\u7684\u63D0\u793A\u3002\n\u6307\u5B9A <\u6A21\u5F0F> \u65F6, \u5C06\u4EC5\u663E\u793A\u8BE5\u6A21\u5F0F\u7684\u63D0\u793A\u3002\n\u793A\u4F8B:\n\t/set prompt myformat\n\u663E\u793A\u4E3A\u6A21\u5F0F myformat \u8BBE\u7F6E\u7684\u63D0\u793A\n
 
 help.set.editor =\u6307\u5B9A\u8981\u4E3A /edit \u547D\u4EE4\u542F\u52A8\u7684\u547D\u4EE4:\n\n\t/set editor [-retain] [-wait] <\u547D\u4EE4>\n\n\t/set editor [-retain] -default\n\n\t/set editor [-retain] -delete\n\n\u4FDD\u7559\u5F53\u524D\u7F16\u8F91\u5668\u8BBE\u7F6E\u4EE5\u4FBF\u5728\u5C06\u6765\u4F1A\u8BDD\u4E2D\u4F7F\u7528:\n\n\t/set editor -retain\n\n\u663E\u793A\u8981\u4E3A /edit \u547D\u4EE4\u542F\u52A8\u7684\u547D\u4EE4:\n\n\t/set editor\n\n<\u547D\u4EE4> \u662F\u4E0E\u64CD\u4F5C\u7CFB\u7EDF\u76F8\u5173\u7684\u5B57\u7B26\u4E32\u3002\n<\u547D\u4EE4> \u53EF\u4EE5\u5305\u542B\u7528\u7A7A\u683C\u5206\u9694\u7684\u53C2\u6570 (\u4F8B\u5982\u6807\u8BB0)\n\n\u5982\u679C\u6307\u5B9A\u4E86 -default \u9009\u9879, \u5C06\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u7F16\u8F91\u5668\u3002\n\n\u5982\u679C\u6307\u5B9A\u4E86 -delete \u9009\u9879, \u5C06\u5FFD\u7565\u4EE5\u524D\u7684\u8BBE\u7F6E -- \u542F\u52A8\njshell \u5DE5\u5177\u65F6\u5C06\u521D\u59CB\u5316\u7F16\u8F91\u5668\u8BBE\u7F6E\u3002\u5177\u4F53\u6765\u8BF4, \u5982\u679C\u5B58\u5728\n\u4FDD\u7559\u7684\u8BBE\u7F6E, \u5C06\u4F7F\u7528\u4FDD\u7559\u7684\u8BBE\u7F6E (\u9664\u975E\u540C\u65F6\u6307\u5B9A -retain \u548C -delete --\n\u8FD9\u5C06\u5220\u9664\u4FDD\u7559\u7684\u8BBE\u7F6E), \u5982\u679C\u8BBE\u7F6E\u4E86\u4EE5\u4E0B\u67D0\u4E2A\u73AF\u5883\u53D8\u91CF, \n\u5C06\u4F7F\u7528\u5B83: JSHELLEDITOR, VISUAL \u6216 EDITOR (\u6309\u6B64\u987A\u5E8F)\u3002\u5426\u5219\u5C06\u4F7F\u7528\n\u5185\u7F6E\u9ED8\u8BA4\u7F16\u8F91\u5668\u3002\n\n\u5982\u679C\u6307\u5B9A\u4E86 <\u547D\u4EE4>, \u5B83\u5C06\u7528\u4F5C\u5916\u90E8\u7F16\u8F91\u5668\u3002<\u547D\u4EE4>\n\u7531\u7A0B\u5E8F\u53CA\u96F6\u4E2A\u6216\u591A\u4E2A\u7A0B\u5E8F\u53C2\u6570\u7EC4\u6210\u3002\u4F7F\u7528 <\u547D\u4EE4>\n\u65F6, \u8981\u7F16\u8F91\u7684\u4E34\u65F6\u6587\u4EF6\u5C06\u4F5C\u4E3A\u6700\u540E\u4E00\u4E2A\u53C2\u6570\u9644\u52A0\u3002\n\u901A\u5E38, \u7F16\u8F91\u6A21\u5F0F\u5C06\u6301\u7EED\u5230\u9000\u51FA\u5916\u90E8\u7F16\u8F91\u5668\u4E3A\u6B62\u3002\u67D0\u4E9B\u5916\u90E8\u7F16\u8F91\u5668\n\u5C06\u7ACB\u5373\u9000\u51FA (\u4F8B\u5982, \u5982\u679C\u9000\u51FA\u7F16\u8F91\u7A97\u53E3), \u5E94\u4F7F\u7528\u5916\u90E8\u7F16\u8F91\u5668\n\u6807\u8BB0\u963B\u6B62\u7ACB\u5373\u9000\u51FA, \u6216\u8005\u4F7F\u7528 -wait \u9009\u9879\n\u63D0\u793A\u7528\u6237\u6307\u793A\u4F55\u65F6\u5E94\u7ED3\u675F\u7F16\u8F91\u6A21\u5F0F\u3002\n\n\u6CE8: \u5728\u7F16\u8F91\u6A21\u5F0F\u4E0B, \u4E0D\u4F1A\u663E\u793A\u4EFB\u4F55\u547D\u4EE4\u8F93\u5165\u3002\u9000\u51FA\u7F16\u8F91\u6A21\u5F0F\u540E, \n\u5C06\u4E0D\u4F1A\u663E\u793A\u5BF9\u7F16\u8F91\u7684\u7247\u6BB5\u6240\u505A\u7684\u4EFB\u4F55\u66F4\u6539\u3002\n\n\u4F7F\u7528 -retain \u9009\u9879\u65F6, \u5C06\u5728\u672C\u6B21\u8FD0\u884C\u548C\u5C06\u6765\u8FD0\u884C jshell \u5DE5\u5177\u65F6\n\u4F7F\u7528\u8BE5\u8BBE\u7F6E\u3002\n\n\u4E0D\u5E26 <\u547D\u4EE4> \u6216\u9009\u9879\u7684\u683C\u5F0F\u663E\u793A\u7F16\u8F91\u5668\u8BBE\u7F6E\u3002\n
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/DeclarationSnippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/DeclarationSnippet.java
index f1645e3..26a349a 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/DeclarationSnippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/DeclarationSnippet.java
@@ -45,6 +45,8 @@
  * <code>DeclarationSnippet</code> is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
+ * @since 9
  */
 public abstract class DeclarationSnippet extends PersistentSnippet {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Diag.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Diag.java
index 4d527fc..56f615d 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Diag.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Diag.java
@@ -30,6 +30,8 @@
 
 /**
  * Diagnostic information for a Snippet.
+ *
+ * @since 9
  * @see jdk.jshell.JShell#diagnostics(jdk.jshell.Snippet)
  */
 public abstract class Diag {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/ErroneousSnippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/ErroneousSnippet.java
index 80793ec..9f2acde 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/ErroneousSnippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/ErroneousSnippet.java
@@ -34,6 +34,8 @@
  * <code>ErroneousSnippet</code> is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
+ * @since 9
  */
 public class ErroneousSnippet extends Snippet {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/EvalException.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/EvalException.java
index 27c351d..7088374 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/EvalException.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/EvalException.java
@@ -38,6 +38,8 @@
  * the Snippet id and for snippets without a method name (for example an
  * expression) <code>StackTraceElement.getMethodName()</code> will be the
  * empty string.
+ *
+ * @since 9
  */
 @SuppressWarnings("serial")             // serialVersionUID intentionally omitted
 public class EvalException extends JShellException {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/ExpressionSnippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/ExpressionSnippet.java
index 4501f76..547cb4c 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/ExpressionSnippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/ExpressionSnippet.java
@@ -34,6 +34,8 @@
  * <code>ExpressionSnippet</code> is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
+ * @since 9
  * @jls 15: Expression.
  */
 public class ExpressionSnippet extends Snippet {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/ImportSnippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/ImportSnippet.java
index e4b2e65..58c5a7e 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/ImportSnippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/ImportSnippet.java
@@ -34,6 +34,8 @@
  * {@code ImportSnippet} is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
+ * @since 9
  * @jls 8.3: importDeclaration.
  */
 public class ImportSnippet extends PersistentSnippet {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShell.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShell.java
index f3348b1..372c30e0 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShell.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShell.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,8 +44,10 @@
 import java.util.function.BiFunction;
 import java.util.function.Consumer;
 
+import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.stream.Stream;
+import javax.tools.StandardJavaFileManager;
 import jdk.internal.jshell.debug.InternalDebugControl;
 import jdk.jshell.Snippet.Status;
 import jdk.jshell.spi.ExecutionControl.EngineTerminationException;
@@ -77,7 +79,9 @@
  * <p>
  * This class is not thread safe, except as noted, all access should be through
  * a single thread.
+ *
  * @author Robert Field
+ * @since 9
  */
 public class JShell implements AutoCloseable {
 
@@ -92,6 +96,7 @@
     final BiFunction<Snippet, Integer, String> idGenerator;
     final List<String> extraRemoteVMOptions;
     final List<String> extraCompilerOptions;
+    final Function<StandardJavaFileManager, StandardJavaFileManager> fileManagerMapping;
 
     private int nextKeyIndex = 1;
 
@@ -115,6 +120,7 @@
         this.idGenerator = b.idGenerator;
         this.extraRemoteVMOptions = b.extraRemoteVMOptions;
         this.extraCompilerOptions = b.extraCompilerOptions;
+        this.fileManagerMapping = b.fileManagerMapping;
         try {
             if (b.executionControlProvider != null) {
                 executionControl = b.executionControlProvider.generate(new ExecutionEnvImpl(),
@@ -171,6 +177,7 @@
         ExecutionControlProvider executionControlProvider;
         Map<String,String> executionControlParameters;
         String executionControlSpec;
+        Function<StandardJavaFileManager, StandardJavaFileManager> fileManagerMapping;
 
         Builder() { }
 
@@ -365,6 +372,28 @@
         }
 
         /**
+         * Configure the {@code FileManager} to be used by compilation and
+         * source analysis.
+         * If not set or passed null, the compiler's standard file manager will
+         * be used (identity mapping).
+         * For use in special applications where the compiler's normal file
+         * handling needs to be overridden.  See the file manager APIs for more
+         * information.
+         * The file manager input enables forwarding file managers, if this
+         * is not needed, the incoming file manager can be ignored (constant
+         * function).
+         *
+         * @param mapping a function that given the compiler's standard file
+         * manager, returns a file manager to use
+         * @return the {@code Builder} instance (for use in chained
+         * initialization)
+         */
+        public Builder fileManager(Function<StandardJavaFileManager, StandardJavaFileManager> mapping) {
+            this.fileManagerMapping = mapping;
+            return this;
+        }
+
+        /**
          * Builds a JShell state engine. This is the entry-point to all JShell
          * functionality. This creates a remote process for execution. It is
          * thus important to close the returned instance.
@@ -501,6 +530,7 @@
      * @throws IllegalStateException if this {@code JShell} instance is closed.
      */
     public void addToClasspath(String path) {
+        checkIfAlive();
         // Compiler
         taskFactory.addToClasspath(path);
         // Runtime
@@ -543,17 +573,7 @@
      */
     @Override
     public void close() {
-        if (!closed) {
-            closeDown();
-            try {
-                executionControl().close();
-            } catch (Throwable ex) {
-                // don't care about exceptions on close
-            }
-            if (sourceCodeAnalysis != null) {
-                sourceCodeAnalysis.close();
-            }
-        }
+        closeDown();
     }
 
     /**
@@ -826,6 +846,15 @@
             } catch (Throwable thr) {
                 // Don't care about dying exceptions
             }
+            try {
+                executionControl().close();
+            } catch (Throwable ex) {
+                // don't care about exceptions on close
+            }
+            if (sourceCodeAnalysis != null) {
+                sourceCodeAnalysis.close();
+            }
+            InternalDebugControl.release(this);
         }
     }
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShellException.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShellException.java
index 721bf1e..a9fe6a0 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShellException.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/JShellException.java
@@ -27,6 +27,8 @@
 
 /**
  * The superclass of JShell generated exceptions
+ *
+ * @since 9
  */
 @SuppressWarnings("serial")             // serialVersionUID intentionally omitted
 public class JShellException extends Exception {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java
index 82e1b95..a0aa2c6 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/MemoryFileManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,8 +30,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.net.URI;
 import java.nio.file.FileSystems;
 import java.nio.file.Files;
@@ -71,10 +69,6 @@
 
     private final JShell proc;
 
-    // Upcoming Jigsaw
-    private Method inferModuleNameMethod = null;
-    private Method listLocationsForModulesMethod = null;
-
     Iterable<? extends Path> getLocationAsPaths(Location loc) {
         return this.stdFileManager.getLocationAsPaths(loc);
     }
@@ -165,7 +159,9 @@
     }
 
     public MemoryFileManager(StandardJavaFileManager standardManager, JShell proc) {
-        this.stdFileManager = standardManager;
+        this.stdFileManager = proc.fileManagerMapping != null
+                ? proc.fileManagerMapping.apply(standardManager)
+                : standardManager;
         this.proc = proc;
     }
 
@@ -184,43 +180,6 @@
         return new SourceMemoryJavaFileObject(origin, name, code);
     }
 
-    // Make compatible with Jigsaw
-    public String inferModuleName(Location location) {
-        try {
-            if (inferModuleNameMethod == null) {
-                inferModuleNameMethod = JavaFileManager.class.getDeclaredMethod("inferModuleName", Location.class);
-            }
-            @SuppressWarnings("unchecked")
-            String result = (String) inferModuleNameMethod.invoke(stdFileManager, location);
-            return result;
-        } catch (NoSuchMethodException | SecurityException ex) {
-            throw new InternalError("Cannot lookup JavaFileManager method", ex);
-        } catch (IllegalAccessException |
-                IllegalArgumentException |
-                InvocationTargetException ex) {
-            throw new InternalError("Cannot invoke JavaFileManager method", ex);
-        }
-    }
-
-    // Make compatible with Jigsaw
-    public Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException {
-        try {
-            if (listLocationsForModulesMethod == null) {
-                listLocationsForModulesMethod = JavaFileManager.class.getDeclaredMethod("listLocationsForModules", Location.class);
-            }
-            @SuppressWarnings("unchecked")
-            Iterable<Set<Location>> result = (Iterable<Set<Location>>) listLocationsForModulesMethod.invoke(stdFileManager, location);
-            return result;
-        } catch (NoSuchMethodException | SecurityException ex) {
-            throw new InternalError("Cannot lookup JavaFileManager method", ex);
-        } catch (IllegalAccessException |
-                IllegalArgumentException |
-                InvocationTargetException ex) {
-            throw new InternalError("Cannot invoke JavaFileManager method", ex);
-        }
-    }
-
-
     /**
      * Returns a class loader for loading plug-ins from the given location. For
      * example, to load annotation processors, a compiler will request a class
@@ -580,6 +539,26 @@
                 ", sibling: " + sibling);
     }
 
+    @Override
+    public Location getLocationForModule(Location location, String moduleName) throws IOException {
+        return stdFileManager.getLocationForModule(location, moduleName);
+    }
+
+    @Override
+    public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
+        return stdFileManager.getLocationForModule(location, fo);
+    }
+
+    @Override
+    public String inferModuleName(Location location) throws IOException {
+        return stdFileManager.inferModuleName(location);
+    }
+
+    @Override
+    public Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException {
+        return stdFileManager.listLocationsForModules(location);
+    }
+
     /**
      * Flushes any resources opened for output by this file manager
      * directly or indirectly.  Flushing a closed file manager has no
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/MethodSnippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/MethodSnippet.java
index 317b4d6..6a17f28 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/MethodSnippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/MethodSnippet.java
@@ -35,6 +35,8 @@
  * <code>MethodSnippet</code> is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
+ * @since 9
  * @jls 8.4: MethodDeclaration.
  */
 public class MethodSnippet extends DeclarationSnippet {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterImportSnippetWrap.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterImportSnippetWrap.java
index de1d1a2..5bbd48a 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterImportSnippetWrap.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterImportSnippetWrap.java
@@ -32,7 +32,7 @@
  * The outer wrap for a set of snippets wrapped in a generated class
  * @author Robert Field
  */
-public class OuterImportSnippetWrap extends OuterWrap {
+class OuterImportSnippetWrap extends OuterWrap {
 
     private final Snippet snippet;
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterSnippetsClassWrap.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterSnippetsClassWrap.java
index 5a58ade..61e6585 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterSnippetsClassWrap.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterSnippetsClassWrap.java
@@ -35,7 +35,7 @@
  * The outer wrap for a set of snippets wrapped in a generated class
  * @author Robert Field
  */
-public class OuterSnippetsClassWrap extends OuterWrap {
+class OuterSnippetsClassWrap extends OuterWrap {
 
     private final String className;
     private final LinkedHashMap<Wrap, Snippet> wrapToSnippet;
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrapMap.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrapMap.java
index 29f4351..8311c8e 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrapMap.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrapMap.java
@@ -44,7 +44,7 @@
  *
  * @author Robert Field
  */
-public class OuterWrapMap {
+class OuterWrapMap {
 
     private final JShell state;
     private final Map<String,OuterSnippetsClassWrap> classOuters = new HashMap<>();
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/PersistentSnippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/PersistentSnippet.java
index b615c78..01b0b14 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/PersistentSnippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/PersistentSnippet.java
@@ -34,6 +34,8 @@
  * <code>PersistentSnippet</code> is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
+ * @since 9
  */
 public abstract class PersistentSnippet extends Snippet {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java
index 3268dd6..116245b 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/Snippet.java
@@ -39,7 +39,9 @@
  * state engine, query {@code JShell} passing the Snippet.
  * <p>
  * Because it is immutable, {@code Snippet} (and subclasses) is thread-safe.
+ *
  * @author Robert Field
+ * @since 9
  * @see jdk.jshell.JShell#status
  */
 public abstract class Snippet {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/SnippetEvent.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/SnippetEvent.java
index 683038b..f18fa42 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/SnippetEvent.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/SnippetEvent.java
@@ -38,7 +38,9 @@
  * {@code SnippetEvent} is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
  * @author Robert Field
+ * @since 9
  */
 public class SnippetEvent {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysis.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysis.java
index cd20f77..3645474 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysis.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysis.java
@@ -39,6 +39,7 @@
  * etc.
  * Also includes completion suggestions, as might be used in tab-completion.
  *
+ * @since 9
  */
 public abstract class SourceCodeAnalysis {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
index 9312814..fccf5ce 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
@@ -381,7 +381,18 @@
                     }
                     ImportTree it = findImport(tp);
                     if (it != null) {
-                        addElements(membersOf(at, at.getElements().getPackageElement("").asType(), false), it.isStatic() ? STATIC_ONLY.and(accessibility) : accessibility, smartFilter, result);
+                        // the context of the identifier is an import, look for
+                        // package names that start with the identifier.
+                        // If and when Java allows imports from the default
+                        // package to the the default package which would allow
+                        // JShell to change to use the default package, and that
+                        // change is done, then this should use some variation
+                        // of membersOf(at, at.getElements().getPackageElement("").asType(), false)
+                        addElements(listPackages(at, ""),
+                                it.isStatic()
+                                        ? STATIC_ONLY.and(accessibility)
+                                        : accessibility,
+                                smartFilter, result);
                     }
                     break;
                 case CLASS: {
@@ -1266,12 +1277,16 @@
                  .allMatch(param -> param.getSimpleName().toString().startsWith("arg"));
     }
 
+    private static List<Path> availableSourcesOverride; //for tests
     private List<Path> availableSources;
 
     private List<Path> findSources() {
         if (availableSources != null) {
             return availableSources;
         }
+        if (availableSourcesOverride != null) {
+            return availableSources = availableSourcesOverride;
+        }
         List<Path> result = new ArrayList<>();
         Path home = Paths.get(System.getProperty("java.home"));
         Path srcZip = home.resolve("lib").resolve("src.zip");
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/StatementSnippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/StatementSnippet.java
index 9e9fef8..423bfd7 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/StatementSnippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/StatementSnippet.java
@@ -34,6 +34,8 @@
  * <code>StatementSnippet</code> is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
+ * @since 9
  * @jls 14.5: Statement.
  */
 public class StatementSnippet extends Snippet {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/TypeDeclSnippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/TypeDeclSnippet.java
index 49d49a8..0e71784 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/TypeDeclSnippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/TypeDeclSnippet.java
@@ -36,6 +36,8 @@
  * <code>TypeDeclSnippet</code> is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
+ * @since 9
  */
 public class TypeDeclSnippet extends DeclarationSnippet {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/UnresolvedReferenceException.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/UnresolvedReferenceException.java
index be91686..0bc2918 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/UnresolvedReferenceException.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/UnresolvedReferenceException.java
@@ -36,6 +36,8 @@
  * the Snippet id and for snippets without a method name (for example an
  * expression) <code>StackTraceElement.getName()</code> will be the
  * empty string.
+ *
+ * @since 9
  */
 @SuppressWarnings("serial")             // serialVersionUID intentionally omitted
 public class UnresolvedReferenceException extends JShellException {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/VarSnippet.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/VarSnippet.java
index aaa25de..3757c55 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/VarSnippet.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/VarSnippet.java
@@ -35,6 +35,8 @@
  * <code>VarSnippet</code> is immutable: an access to
  * any of its methods will always return the same result.
  * and thus is thread-safe.
+ *
+ * @since 9
  * @jls 8.3: FieldDeclaration.
  */
 public class VarSnippet extends DeclarationSnippet {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/VarTypePrinter.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/VarTypePrinter.java
index 239152e..4d69b1a 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/VarTypePrinter.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/VarTypePrinter.java
@@ -36,7 +36,7 @@
 import com.sun.tools.javac.code.Flags;
 import com.sun.tools.javac.code.Symtab;
 import com.sun.tools.javac.code.Type.CapturedType;
-import com.sun.tools.javac.code.Type.TypeMapping;
+import com.sun.tools.javac.code.Type.StructuralTypeMapping;
 import com.sun.tools.javac.code.Type.TypeVar;
 import com.sun.tools.javac.code.Type.WildcardType;
 import com.sun.tools.javac.code.Types;
@@ -158,7 +158,7 @@
         }
     }
 
-    class TypeProjection extends TypeMapping<Boolean> {
+    class TypeProjection extends StructuralTypeMapping<Boolean> {
 
         List<Type> vars;
         Set<Type> seen = new HashSet<>();
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java
index d40e10a..c6a220f 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java
@@ -39,6 +39,7 @@
  *
  * @author Robert Field
  * @author Jan Lahoda
+ * @since 9
  */
 public class DirectExecutionControl implements ExecutionControl {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/FailOverExecutionControlProvider.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/FailOverExecutionControlProvider.java
index 4894efc..090a3dd 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/FailOverExecutionControlProvider.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/FailOverExecutionControlProvider.java
@@ -37,6 +37,8 @@
 
 /**
  * Tries other providers in sequence until one works.
+ *
+ * @since 9
  */
 public class FailOverExecutionControlProvider  implements ExecutionControlProvider{
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiDefaultExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiDefaultExecutionControl.java
index bce34fe..c4c2ff0 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiDefaultExecutionControl.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiDefaultExecutionControl.java
@@ -33,6 +33,7 @@
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -60,6 +61,7 @@
  *
  * @author Robert Field
  * @author Jan Lahoda
+ * @since 9
  */
 public class JdiDefaultExecutionControl extends JdiExecutionControl {
 
@@ -97,7 +99,8 @@
 
             // Set-up the JDI connection
             JdiInitiator jdii = new JdiInitiator(port,
-                    env.extraRemoteVMOptions(), remoteAgent, isLaunch, host, timeout);
+                    env.extraRemoteVMOptions(), remoteAgent, isLaunch, host,
+                    timeout, Collections.emptyMap());
             VirtualMachine vm = jdii.vm();
             Process process = jdii.process();
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControl.java
index 2d27a3d..cf07818 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControl.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControl.java
@@ -37,7 +37,9 @@
 import static java.util.stream.Collectors.toMap;
 
 /**
- * Abstract JDI implementation of {@link jdk.jshell.spi.ExecutionControl}
+ * Abstract JDI implementation of {@link jdk.jshell.spi.ExecutionControl}.
+ *
+ * @since 9
  */
 public abstract class JdiExecutionControl extends StreamingExecutionControl implements ExecutionControl {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControlProvider.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControlProvider.java
index 21531ed..e80bd07 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControlProvider.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiExecutionControlProvider.java
@@ -35,7 +35,9 @@
 
 /**
  * A provider of remote JDI-controlled execution engines.
+ *
  * @author Robert Field
+ * @since 9
  */
 public class JdiExecutionControlProvider implements ExecutionControlProvider {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java
index 127b332..bba5b97 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016,2017 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,6 +47,8 @@
 /**
  * Sets up a JDI connection, providing the resulting JDI {@link VirtualMachine}
  * and the {@link Process} the remote agent is running in.
+ *
+ * @since 9
  */
 public class JdiInitiator {
 
@@ -66,16 +68,20 @@
      * Start the remote agent and establish a JDI connection to it.
      *
      * @param port the socket port for (non-JDI) commands
-     * @param remoteVMOptions any user requested VM options
+     * @param remoteVMOptions any user requested VM command-line options
      * @param remoteAgent full class name of remote agent to launch
      * @param isLaunch does JDI do the launch? That is, LaunchingConnector,
      * otherwise we start explicitly and use ListeningConnector
      * @param host explicit hostname to use, if null use discovered
      * hostname, applies to listening only (!isLaunch)
-     * @param timeout the start-up time-out in milliseconds
+     * @param timeout the start-up time-out in milliseconds. If zero or negative,
+     * will not wait thus will timeout immediately if not already started.
+     * @param customConnectorArgs custom arguments passed to the connector.
+     * These are JDI com.sun.jdi.connect.Connector arguments.
      */
     public JdiInitiator(int port, List<String> remoteVMOptions, String remoteAgent,
-            boolean isLaunch, String host, int timeout) {
+            boolean isLaunch, String host, int timeout,
+            Map<String, String> customConnectorArgs) {
         this.remoteAgent = remoteAgent;
         this.connectTimeout = (int) (timeout * CONNECT_TIMEOUT_FACTOR);
         String connectorName
@@ -96,6 +102,7 @@
                 argumentName2Value.put("localAddress", host);
             }
         }
+        argumentName2Value.putAll(customConnectorArgs);
         this.connectorArgs = mergeConnectorArgs(connector, argumentName2Value);
         this.vm = isLaunch
                 ? launchTarget()
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LoaderDelegate.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LoaderDelegate.java
index b1d7e33..7a1566c 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LoaderDelegate.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LoaderDelegate.java
@@ -34,6 +34,8 @@
  * This interface specifies the loading specific subset of
  * {@link jdk.jshell.spi.ExecutionControl}.  For use in encapsulating the
  * {@link java.lang.ClassLoader} implementation.
+ *
+ * @since 9
  */
 public interface LoaderDelegate {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java
index 97c7cc3..c17ceb8 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java
@@ -33,6 +33,7 @@
  * in the same JVM as the JShell-core.
  *
  * @author Grigory Ptashko
+ * @since 9
  */
 public class LocalExecutionControl extends DirectExecutionControl {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControlProvider.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControlProvider.java
index bda448b..cc3879c 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControlProvider.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControlProvider.java
@@ -32,7 +32,9 @@
 
 /**
  * A provider of execution engines which run in the same process as JShell.
+ *
  * @author Robert Field
+ * @since 9
  */
 public class LocalExecutionControlProvider implements ExecutionControlProvider{
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java
index c0d95c5..3a1a4ea 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java
@@ -45,6 +45,7 @@
  *
  * @author Jan Lahoda
  * @author Robert Field
+ * @since 9
  */
 public class RemoteExecutionControl extends DirectExecutionControl implements ExecutionControl {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java
index 6055289..7c4d8fb 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java
@@ -37,6 +37,7 @@
  * execution takes place.
  *
  * @author Robert Field
+ * @since 9
  */
 public class StreamingExecutionControl implements ExecutionControl {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java
index e5e7ea80..abcbcf0 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/Util.java
@@ -53,6 +53,7 @@
  *
  * @author Jan Lahoda
  * @author Robert Field
+ * @since 9
  */
 public class Util {
 
@@ -60,7 +61,7 @@
     private static final int TAG_CLOSED = 1;
     private static final int TAG_EXCEPTION = 2;
 
-    // never instanciated
+    // never instantiated
     private Util() {}
 
     /**
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/package-info.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/package-info.java
index 6127c10..0e9c896 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/package-info.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/package-info.java
@@ -30,5 +30,7 @@
  * Also, provides related communication utilities.
  * This package may be used to define alternative execution engines.
  * The default JShell execution engine is included.
+ *
+ * @since 9
  */
 package jdk.jshell.execution;
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/package-info.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/package-info.java
index 7e96546..ce3728b 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/package-info.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/package-info.java
@@ -140,6 +140,8 @@
  * provide source boundary and completeness analysis to address cases like
  * those.  <code>SourceCodeAnalysis</code> also provides suggested completions
  * of input, as might be used in tab-completion.
+ *
+ * @since 9
  */
 
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java
index a054f99..82de0fb1 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java
@@ -45,6 +45,8 @@
  * <p>
  * Methods defined in this interface should only be called by the core JShell
  * implementation.
+ *
+ * @since 9
  */
 public interface ExecutionControl extends AutoCloseable {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControlProvider.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControlProvider.java
index 393fb98..2ebbbc6 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControlProvider.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControlProvider.java
@@ -33,7 +33,9 @@
  * evaluate Snippets.  Alternate execution engines can be created by
  * implementing this interface, then configuring JShell with the provider or
  * the providers name and parameter specifier.
+ *
  * @author Robert Field
+ * @since 9
  */
 public interface ExecutionControlProvider {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionEnv.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionEnv.java
index f98f989..36780b9 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionEnv.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionEnv.java
@@ -36,6 +36,7 @@
  * This interface is designed to provide the access to core JShell functionality
  * needed to implement ExecutionControl.
  *
+ * @since 9
  * @see ExecutionControl
  */
 public interface ExecutionEnv {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/SPIResolutionException.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/SPIResolutionException.java
index f15ed8d..c9199ab 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/SPIResolutionException.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/SPIResolutionException.java
@@ -33,6 +33,8 @@
  * <p>
  * This exception is seen by the execution engine, but not seen by
  * the end user nor through the JShell API.
+ *
+ * @since 9
  */
 @SuppressWarnings("serial")             // serialVersionUID intentionally omitted
 public class SPIResolutionException extends RuntimeException {
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/package-info.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/package-info.java
index c5abd85..bda0f83 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/package-info.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/package-info.java
@@ -66,6 +66,7 @@
  *   <li>failover:1(jdi),2(jdi:launch(true),timeout(3000)),3(local)</li>
  * </ul>
  *
+ * @since 9
  * @see jdk.jshell.execution for execution implementation support
  */
 package jdk.jshell.spi;
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/JavaShellToolBuilder.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/JavaShellToolBuilder.java
index 1712977..72713e4 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/JavaShellToolBuilder.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/JavaShellToolBuilder.java
@@ -40,6 +40,8 @@
  * configuration methods have sensible defaults which will be used if they are
  * not called.. After zero or more calls to configuration methods, the tool is
  * launched with a call to {@link #run(java.lang.String...) }.
+ *
+ * @since 9
  */
 public interface JavaShellToolBuilder {
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/package-info.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/package-info.java
index 83a5cdf..eb008f7 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/package-info.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/package-info.java
@@ -47,6 +47,8 @@
  *             .run("--feedback", "silent", "MyStart");
  * }
  * </pre>
+ *
+ * @since 9
  */
 
 
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/resources/PRINTING.jsh b/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/resources/PRINTING.jsh
index 52aaea4..3c6e5f6 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/resources/PRINTING.jsh
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/tool/resources/PRINTING.jsh
@@ -17,5 +17,5 @@
 void println(char s[]) { System.out.println(s); }
 void println(String s) { System.out.println(s); }
 void println(Object obj) { System.out.println(obj); }
-void printf(Locale l, String format, Object... args) { System.out.printf(l, format, args); }
+void printf(java.util.Locale l, String format, Object... args) { System.out.printf(l, format, args); }
 void printf(String format, Object... args) { System.out.printf(format, args); }
diff --git a/langtools/src/jdk.jshell/share/classes/module-info.java b/langtools/src/jdk.jshell/share/classes/module-info.java
index 6c83112..8cf9bb0 100644
--- a/langtools/src/jdk.jshell/share/classes/module-info.java
+++ b/langtools/src/jdk.jshell/share/classes/module-info.java
@@ -51,6 +51,9 @@
  *     independent, operate at different levels, and do not share functionality or
  *     definitions.
  * </p>
+ *
+ * @moduleGraph
+ * @since 9
  */
 module jdk.jshell {
     requires transitive java.compiler;
diff --git a/langtools/test/ProblemList.txt b/langtools/test/ProblemList.txt
index 182deac..6dbdfcd 100644
--- a/langtools/test/ProblemList.txt
+++ b/langtools/test/ProblemList.txt
@@ -36,7 +36,7 @@
 #
 # jshell
 
-jdk/jshell/UserJdiUserRemoteTest.java                                           8173204    linux-all
+jdk/jshell/UserJdiUserRemoteTest.java                                           8173079    linux-all
 jdk/jshell/UserInputTest.java                                                   8169536    generic-all   
 
 ###########################################################################
@@ -54,6 +54,7 @@
 tools/javac/annotations/typeAnnotations/referenceinfos/NestedTypes.java         8057687    generic-all    emit correct byte code an attributes for type annotations
 tools/javac/warnings/suppress/TypeAnnotations.java                              8057683    generic-all    improve ordering of errors with type annotations
 tools/javac/modules/T8159439/NPEForModuleInfoWithNonZeroSuperClassTest.java     8160396    generic-all    current version of jtreg needs a new promotion to include lastes version of ASM
+tools/javac/platform/PlatformProviderTest.java                                  8176801    generic-all    fails due to warnings printed to stderr
 
 ###########################################################################
 #
diff --git a/langtools/test/TEST.ROOT b/langtools/test/TEST.ROOT
index a4780af..30351ed 100644
--- a/langtools/test/TEST.ROOT
+++ b/langtools/test/TEST.ROOT
@@ -14,8 +14,8 @@
 # Group definitions
 groups=TEST.groups
 
-# Tests using jtreg 4.2 b05 features
-requiredVersion=4.2 b05
+# Tests using jtreg 4.2 b07 features
+requiredVersion=4.2 b07
 
 # Use new module options
 useNewOptions=true
diff --git a/langtools/test/com/sun/javadoc/testCustomTag/taglets/CustomTag.java b/langtools/test/com/sun/javadoc/testCustomTag/taglets/CustomTag.java
index cb6f9e2..d626771 100644
--- a/langtools/test/com/sun/javadoc/testCustomTag/taglets/CustomTag.java
+++ b/langtools/test/com/sun/javadoc/testCustomTag/taglets/CustomTag.java
@@ -23,8 +23,6 @@
 
 package taglets;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 
 import com.sun.javadoc.*;
diff --git a/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/BoldTaglet.java b/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/BoldTaglet.java
index 951406e..82f3a15 100644
--- a/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/BoldTaglet.java
+++ b/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/BoldTaglet.java
@@ -23,8 +23,6 @@
 
 package testtaglets;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 
 import com.sun.javadoc.*;
diff --git a/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/GreenTaglet.java b/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/GreenTaglet.java
index daff71f..87273c4 100644
--- a/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/GreenTaglet.java
+++ b/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/GreenTaglet.java
@@ -23,8 +23,6 @@
 
 package testtaglets;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 
 import com.sun.javadoc.*;
diff --git a/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/UnderlineTaglet.java b/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/UnderlineTaglet.java
index f22ebe4..f5465fd 100644
--- a/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/UnderlineTaglet.java
+++ b/langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/UnderlineTaglet.java
@@ -23,8 +23,6 @@
 
 package testtaglets;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 
 import com.sun.javadoc.*;
diff --git a/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/C.java b/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/C.java
index 09b8a23..735a2d5 100644
--- a/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/C.java
+++ b/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/C.java
@@ -71,4 +71,9 @@
      * caseA <ul type='"a">b'> <li> end of sentence. <li> more </ul>
      */
     public void caseA() {}
+
+    /**
+     * caseB <blockquote>A block quote example:</blockquote>
+     */
+    public void caseB() {}
 }
diff --git a/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/Negative.java b/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/Negative.java
new file mode 100644
index 0000000..0bbe3f3
--- /dev/null
+++ b/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/Negative.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public class Negative {
+    /**
+     * case1: A hanging &lt;  : <blockquote>xx</blockquote><
+     */
+    public void case1() {}
+}
diff --git a/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java b/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java
index ba37152..0dc129d 100644
--- a/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java
+++ b/langtools/test/com/sun/javadoc/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8048628
+ * @bug      8048628 8174715
  * @summary  Verify html inline tags are removed correctly in the first sentence.
  * @library  ../lib
  * @modules jdk.javadoc
@@ -39,22 +39,34 @@
     }
 
     @Test
-    void test() {
-        javadoc("-d", "out",
+    void testPositive() {
+        javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 testSrc("C.java"));
         checkExit(Exit.OK);
 
         checkOutput("C.html", true,
-                "<div class=\"block\">case1 end of sentence.</div>",
-                "<div class=\"block\">case2 end of sentence.</div>",
-                "<div class=\"block\">case3 end of sentence.</div>",
-                "<div class=\"block\">case4 end of sentence.</div>",
-                "<div class=\"block\">case5 end of sentence.</div>",
-                "<div class=\"block\">case6 end of sentence.</div>",
-                "<div class=\"block\">case7 end of sentence.</div>",
-                "<div class=\"block\">case8 end of sentence.</div>",
-                "<div class=\"block\">case9 end of sentence.</div>",
-                "<div class=\"block\">caseA end of sentence.</div>");
+                "<div class=\"block\">case1   end of sentence.</div>",
+                "<div class=\"block\">case2   end of sentence.</div>",
+                "<div class=\"block\">case3   end of sentence.</div>",
+                "<div class=\"block\">case4   end of sentence.</div>",
+                "<div class=\"block\">case5   end of sentence.</div>",
+                "<div class=\"block\">case6   end of sentence.</div>",
+                "<div class=\"block\">case7   end of sentence.</div>",
+                "<div class=\"block\">case8   end of sentence.</div>",
+                "<div class=\"block\">case9   end of sentence.</div>",
+                "<div class=\"block\">caseA   end of sentence.</div>",
+                "<div class=\"block\">caseB A block quote example:</div>");
+    }
+
+    @Test
+    void testNegative() {
+        javadoc("-d", "out2",
+                "-sourcepath", testSrc,
+                testSrc("Negative.java"));
+        checkExit(Exit.FAILED);
+
+        checkOutput("Negative.html", true,
+                "<div class=\"block\">case1: A hanging &lt;  : xx<</div>");
     }
 }
diff --git a/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java b/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java
index da37f80..731f253 100644
--- a/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java
+++ b/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java
@@ -23,8 +23,6 @@
 
 package taglets;
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 
 import com.sun.javadoc.*;
diff --git a/langtools/test/jdk/javadoc/doclet/testBadHtml/TestBadHtml.java b/langtools/test/jdk/javadoc/doclet/testBadHtml/TestBadHtml.java
new file mode 100644
index 0000000..1b2b053
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testBadHtml/TestBadHtml.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176901
+ * @summary The doclet should cope with bad HTML form
+ * @library ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build JavadocTester
+ * @run main TestBadHtml
+ */
+
+public class TestBadHtml extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestBadHtml tester = new TestBadHtml();
+        tester.runTests();
+    }
+
+    @Test
+    void testNegative() {
+        javadoc("-d", "out1",
+                "-sourcepath", testSrc,
+                "pkg1");
+
+        checkExit(Exit.ERROR);
+
+        checkOutput(Output.STDERR, false, "NullPointerException");
+        checkOutput(Output.OUT, false, "NullPointerException");
+    }
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testBadHtml/pkg1/A.java b/langtools/test/jdk/javadoc/doclet/testBadHtml/pkg1/A.java
new file mode 100644
index 0000000..f33d142
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testBadHtml/pkg1/A.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg1;
+
+/**
+ * The first sentence.
+ * <parameters the word action is crucial here object>
+ * <parameters the word cite is crucial here object>
+ * <parameters the word classid is crucial here object>
+ * <parameters the word codebase is crucial here object>
+ * <parameters the word data is crucial here object>
+ * <parameters the word datasrc is crucial here object>
+ * <parameters the word for is crucial here object>
+ * <parameters the word href is crucial here object>
+ * <parameters the word longdesc is crucial here object>
+ * <parameters the word profile is crucial here object>
+ * <parameters the word src is crucial here object>
+ * <parameters the word usemap is crucial here object>
+ */
+
+public class A {}
diff --git a/langtools/test/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java b/langtools/test/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java
index ee0f1d5..68d3a69 100644
--- a/langtools/test/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java
+++ b/langtools/test/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8163800
+ * @bug 8163800 8175200
  * @summary The fix for JDK-8072052 shows up other minor incorrect use of styles
  * @library ../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -51,11 +51,11 @@
 
         checkOutput("p/C1.html", true,
                 "<code><a href=\"../p/C2.html\" title=\"class in p\">C2</a></code>",
-                "<code><span class=\"memberNameLink\"><a href=\"../p/C1.html#C1--\">C1</a></span>()</code>");
+                "<code><span class=\"memberNameLink\"><a href=\"../p/C1.html#C1--\">C1</a></span>&#8203;()</code>");
 
         checkOutput("p/C2.html", true,
                 "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
-                "<code><span class=\"memberNameLink\"><a href=\"../p/C2.html#C2--\">C2</a></span>()</code>");
+                "<code><span class=\"memberNameLink\"><a href=\"../p/C2.html#C2--\">C2</a></span>&#8203;()</code>");
 
         checkOutput("p/C3.html", true,
                 "<code><a href=\"../p/I1.html\" title=\"interface in p\">I1</a></code>, "
@@ -63,7 +63,7 @@
                 + "<code><a href=\"../p/I2.html\" title=\"interface in p\">I2</a></code>, "
                 + "<code><a href=\"../p/IT1.html\" title=\"interface in p\">IT1</a>&lt;T&gt;</code>, "
                 + "<code><a href=\"../p/IT2.html\" title=\"interface in p\">IT2</a>&lt;java.lang.String&gt;</code>",
-                "<code><span class=\"memberNameLink\"><a href=\"../p/C3.html#C3--\">C3</a></span>()</code>");
+                "<code><span class=\"memberNameLink\"><a href=\"../p/C3.html#C3--\">C3</a></span>&#8203;()</code>");
 
         checkOutput("p/I1.html", true,
                 "<code><a href=\"../p/C3.html\" title=\"class in p\">C3</a></code>",
diff --git a/langtools/test/jdk/javadoc/doclet/testClassTree/pkg/Coin.java b/langtools/test/jdk/javadoc/doclet/testClassTree/pkg/Coin.java
index ec13a84..5d1f9a6 100644
--- a/langtools/test/jdk/javadoc/doclet/testClassTree/pkg/Coin.java
+++ b/langtools/test/jdk/javadoc/doclet/testClassTree/pkg/Coin.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,9 +29,7 @@
  * @author Jamie Ho
  */
 public enum Coin {
+    Penny, Nickel, Dime;
 
-  Penny, Nickel, Dime;
-
-public Coin(int i) {}
-
+    Coin(int i) {}
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testConstructors/TestConstructors.java b/langtools/test/jdk/javadoc/doclet/testConstructors/TestConstructors.java
index f1afc69..2385390 100644
--- a/langtools/test/jdk/javadoc/doclet/testConstructors/TestConstructors.java
+++ b/langtools/test/jdk/javadoc/doclet/testConstructors/TestConstructors.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8025524 8031625 8081854
+ * @bug 8025524 8031625 8081854 8175200
  * @summary Test for constructor name which should be a non-qualified name.
  * @author Bhavesh Patel
  * @library ../lib
@@ -58,21 +58,21 @@
                 + "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>, "
                 + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>"
                 + "NestedInner(int)</code></a>",
-                "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>()",
+                "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>&#8203;()",
                 "<a name=\"Outer--\">",
-                "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>(int&nbsp;i)",
+                "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>&#8203;(int&nbsp;i)",
                 "<a name=\"Outer-int-\">");
 
         checkOutput("pkg1/Outer.Inner.html", true,
-                "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>()",
+                "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>&#8203;()",
                 "<a name=\"Inner--\">",
-                "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>(int&nbsp;i)",
+                "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>&#8203;(int&nbsp;i)",
                 "<a name=\"Inner-int-\">");
 
         checkOutput("pkg1/Outer.Inner.NestedInner.html", true,
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>()",
+                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>&#8203;()",
                 "<a name=\"NestedInner--\">",
-                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>(int&nbsp;i)",
+                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>&#8203;(int&nbsp;i)",
                 "<a name=\"NestedInner-int-\">");
 
         checkOutput("pkg1/Outer.Inner.html", false,
diff --git a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java
index 8d590f3..a801c88 100644
--- a/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java
+++ b/langtools/test/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4927552 8026567 8071982 8162674
+ * @bug      4927552 8026567 8071982 8162674 8175200 8175218
  * @summary  <DESC>
  * @author   jamieh
  * @library  ../lib
@@ -81,16 +81,16 @@
                 + "extends java.lang.Object</pre>",
                 "<pre>@Deprecated(forRemoval=true)\n"
                 + "public&nbsp;int field</pre>\n"
-                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;</div>",
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;</div>",
                 "<pre>@Deprecated(forRemoval=true)\n"
-                + "public&nbsp;DeprecatedClassByAnnotation()</pre>\n"
-                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;</div>",
+                + "public&nbsp;DeprecatedClassByAnnotation&#8203;()</pre>\n"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;</div>",
                 "<pre>@Deprecated\n"
-                + "public&nbsp;void&nbsp;method()</pre>\n"
+                + "public&nbsp;void&nbsp;method&#8203;()</pre>\n"
                 + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;</div>");
 
         checkOutput("pkg/TestAnnotationType.html", true,
-                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">annotation_test1 passes.</span></div>\n"
                 + "</div>\n"
                 + "<br>\n"
@@ -100,16 +100,16 @@
                 "<pre>@Deprecated(forRemoval=true)\n"
                 + "static final&nbsp;int&nbsp;field</pre>\n"
                 + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This "
-                + "API element is subject to removal in a future version. </span>&nbsp;<span class=\"deprecationComment\">annotation_test4 passes.</span></div>",
+                + "API element is subject to removal in a future version.</span>&nbsp;<span class=\"deprecationComment\">annotation_test4 passes.</span></div>",
                 "<pre>@Deprecated(forRemoval=true)\n"
                 + "int&nbsp;required</pre>\n"
-                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;"
                 + "<span class=\"deprecationComment\">annotation_test3 passes.</span></div>",
                 "<pre>java.lang.String&nbsp;optional</pre>\n"
                 + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;<span class=\"deprecationComment\">annotation_test2 passes.</span></div>");
 
         checkOutput("pkg/TestClass.html", true,
-                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">class_test1 passes.</span></div>\n"
                 + "</div>\n"
                 + "<br>\n"
@@ -117,12 +117,12 @@
                 + "public class <span class=\"typeNameLabel\">TestClass</span>\n"
                 + "extends java.lang.Object</pre>",
                 "<pre>@Deprecated(forRemoval=true)\n"
-                + "public&nbsp;TestClass()</pre>\n"
-                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;"
+                + "public&nbsp;TestClass&#8203;()</pre>\n"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;"
                 + "<span class=\"deprecationComment\">class_test3 passes.</span></div>");
 
         checkOutput("pkg/TestEnum.html", true,
-                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">enum_test1 passes.</span></div>\n"
                 + "</div>\n"
                 + "<br>\n"
@@ -131,11 +131,11 @@
                 + "extends java.lang.Enum&lt;<a href=\"../pkg/TestEnum.html\" title=\"enum in pkg\">TestEnum</a>&gt;</pre>",
                 "<pre>@Deprecated(forRemoval=true)\n"
                 + "public static final&nbsp;<a href=\"../pkg/TestEnum.html\" title=\"enum in pkg\">TestEnum</a> FOR_REMOVAL</pre>\n"
-                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;"
+                + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;"
                 + "<span class=\"deprecationComment\">enum_test3 passes.</span></div>");
 
         checkOutput("pkg/TestError.html", true,
-                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">error_test1 passes.</span></div>\n"
                 + "</div>\n"
                 + "<br>\n"
@@ -144,7 +144,7 @@
                 + "extends java.lang.Error</pre>");
 
         checkOutput("pkg/TestException.html", true,
-                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">exception_test1 passes.</span></div>\n"
                 + "</div>\n"
                 + "<br>\n"
@@ -153,7 +153,7 @@
                 + "extends java.lang.Exception</pre>");
 
         checkOutput("pkg/TestInterface.html", true,
-                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version. </span>&nbsp;\n"
+                "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated, for removal: This API element is subject to removal in a future version.</span>&nbsp;\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">interface_test1 passes.</span></div>\n"
                 + "</div>\n"
                 + "<br>\n"
diff --git a/langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java b/langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java
index 720628c..6750944 100644
--- a/langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java
+++ b/langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4934778 4777599 6553182 8146427 8146475
+ * @bug      4934778 4777599 6553182 8146427 8146475 8175055
  * @summary  Make sure that -help, -helpfile and -nohelp options work correctly.
  * @author   jamieh
  * @library ../lib
@@ -111,7 +111,7 @@
                 "-helpfile", testSrc("test-help.html"),
                 "-helpfile", testSrc("test-help.html"),
                 testSrc("Sample.java"));
-        checkExit(Exit.ERROR);
+        checkExit(Exit.CMDERR);
     }
 
     @Test
@@ -121,7 +121,7 @@
                 "-helpfile", testSrc("test-help.html"),
                 "-nohelp",
                 testSrc("Sample.java"));
-        checkExit(Exit.ERROR);
+        checkExit(Exit.CMDERR);
     }
 
     private void checkOutput(boolean withOption) {
diff --git a/langtools/test/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java b/langtools/test/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
index 7584be0..6e516a4 100644
--- a/langtools/test/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
+++ b/langtools/test/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6786690 6820360 8025633 8026567
+ * @bug 6786690 6820360 8025633 8026567 8175200
  * @summary This test verifies the nesting of definition list tags.
  * @author Bhavesh Patel
  * @library ../lib
@@ -367,12 +367,12 @@
         // Test with -nocomment and -nodeprecated options. The ClassDocs whould
         // not display definition lists for any member details.
         checkOutput("pkg1/C1.html", expectFound,
-                "<pre>public&nbsp;void&nbsp;readObject()\n" +
+                "<pre>public&nbsp;void&nbsp;readObject&#8203;()\n" +
                 "                throws java.io.IOException</pre>\n" +
                 "</li>");
 
         checkOutput("pkg1/C2.html", expectFound,
-                "<pre>public&nbsp;C2()</pre>\n" +
+                "<pre>public&nbsp;C2&#8203;()</pre>\n" +
                 "</li>");
 
         checkOutput("pkg1/C1.ModalExclusionType.html", expectFound,
diff --git a/langtools/test/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java b/langtools/test/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java
index 0ff1c99..b5ca068 100644
--- a/langtools/test/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java
+++ b/langtools/test/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8072945 8081854 8141492 8148985 8150188 4649116 8173707
+ * @bug 8072945 8081854 8141492 8148985 8150188 4649116 8173707 8151743
  * @summary Test the version of HTML generated by the javadoc tool.
  * @author bpatel
  * @library ../lib
@@ -710,6 +710,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<table class=\"constantsSummary\" summary=\"Constant Field Values table, listing constant fields, and values\">");
 
@@ -723,6 +727,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">\n"
                 + "<h1 title=\"Deprecated API\" class=\"title\">Deprecated API</h1>\n"
                 + "<h2 title=\"Contents\">Contents</h2>",
@@ -747,6 +755,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<li class=\"blockList\">\n"
                 + "<h2 title=\"Package\">Package&nbsp;pkg</h2>");
@@ -761,6 +773,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<div class=\"contentContainer\">\n"
                 + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
@@ -779,6 +795,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"contentContainer\">");
 
         // Negated test for src-html page
@@ -797,6 +817,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
@@ -1005,6 +1029,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">",
                 "<li class=\"blockList\"><a name=\"pkg\">\n"
@@ -1123,6 +1151,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<table class=\"constantsSummary\" summary=\"Constant Field Values table, listing constant fields, and values\">");
 
@@ -1136,6 +1168,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">\n"
                 + "<h1 title=\"Deprecated API\" class=\"title\">Deprecated API</h1>\n"
                 + "<h2 title=\"Contents\">Contents</h2>",
@@ -1160,6 +1196,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<li class=\"blockList\">\n"
                 + "<h2 title=\"Package\">Package&nbsp;pkg</h2>");
@@ -1175,6 +1215,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<h1 class=\"title\">Hierarchy For All Packages</h1>\n"
                 + "<span class=\"packageHierarchyLabel\">Package Hierarchies:</span>",
@@ -1195,6 +1239,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"contentContainer\">");
 
         // Test for src-html page
@@ -1213,6 +1261,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
@@ -1421,6 +1473,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">",
                 "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">",
                 "<li class=\"blockList\"><a name=\"pkg\">\n"
diff --git a/langtools/test/jdk/javadoc/doclet/testIndentation/TestIndentation.java b/langtools/test/jdk/javadoc/doclet/testIndentation/TestIndentation.java
index 69eb7a5..4b1ae68 100644
--- a/langtools/test/jdk/javadoc/doclet/testIndentation/TestIndentation.java
+++ b/langtools/test/jdk/javadoc/doclet/testIndentation/TestIndentation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8011288 8062647
+ * @bug      8011288 8062647 8175200
  * @summary  Erratic/inconsistent indentation of signatures
  * @library  ../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -46,7 +46,7 @@
         checkExit(Exit.OK);
 
         checkOutput("p/Indent.html", true,
-                "<pre>public&nbsp;&lt;T&gt;&nbsp;void&nbsp;m(T&nbsp;t1,",
+                "<pre>public&nbsp;&lt;T&gt;&nbsp;void&nbsp;m&#8203;(T&nbsp;t1,",
                 "\n"
                 + "                  T&nbsp;t2)",
                 "\n"
diff --git a/langtools/test/jdk/javadoc/doclet/testInterface/TestInterface.java b/langtools/test/jdk/javadoc/doclet/testInterface/TestInterface.java
index a0ac819..fe24c9c 100644
--- a/langtools/test/jdk/javadoc/doclet/testInterface/TestInterface.java
+++ b/langtools/test/jdk/javadoc/doclet/testInterface/TestInterface.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4682448 4947464 5029946 8025633 8026567 8035473 8139101
+ * @bug      4682448 4947464 5029946 8025633 8026567 8035473 8139101 8175200
  * @summary  Verify that the public modifier does not show up in the
  *           documentation for public methods, as recommended by the JLS.
  *           If A implements I and B extends A, B should be in the list of
@@ -64,7 +64,7 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/Interface.html", true,
-                "<pre>int&nbsp;method()</pre>",
+                "<pre>int&nbsp;method&#8203;()</pre>",
                 "<pre>static final&nbsp;int field</pre>",
                 // Make sure known implementing class list is correct and omits type parameters.
                 "<dl>\n"
@@ -119,7 +119,7 @@
                 + "</dl>");
 
         checkOutput("pkg/Interface.html", false,
-                "public int&nbsp;method()",
+                "public int&nbsp;method&#8203;()",
                 "public static final&nbsp;int field");
 
         checkOutput("pkg/ClassWithStaticMethod.html", false,
diff --git a/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java b/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java
index c666c33..0bb6f2a 100644
--- a/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java
+++ b/langtools/test/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7112427 8012295 8025633 8026567 8061305 8081854 8150130 8162363 8167967 8172528
+ * @bug 7112427 8012295 8025633 8026567 8061305 8081854 8150130 8162363 8167967 8172528 8175200
  * @summary Test of the JavaFX doclet features.
  * @author jvalenta
  * @library ../lib
@@ -53,11 +53,11 @@
                 + "<dd><a href=\"../pkg1/C.html#getRate--\"><code>getRate()</code></a>, \n"
                 + "<a href=\"../pkg1/C.html#setRate-double-\">"
                 + "<code>setRate(double)</code></a></dd>",
-                "<pre>public final&nbsp;void&nbsp;setRate(double&nbsp;value)</pre>\n"
+                "<pre>public final&nbsp;void&nbsp;setRate&#8203;(double&nbsp;value)</pre>\n"
                 + "<div class=\"block\">Sets the value of the property rate.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>",
-                "<pre>public final&nbsp;double&nbsp;getRate()</pre>\n"
+                "<pre>public final&nbsp;double&nbsp;getRate&#8203;()</pre>\n"
                 + "<div class=\"block\">Gets the value of the property rate.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>",
@@ -77,7 +77,7 @@
                 "<span class=\"simpleTagLabel\">Property description:</span>",
                 "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"../pkg1/C.html#setTestMethodProperty--\">"
-                + "setTestMethodProperty</a></span>()</code></th>",
+                + "setTestMethodProperty</a></span>&#8203;()</code></th>",
                 "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"../pkg1/C.html#pausedProperty\">paused</a></span></code></th>\n"
                 + "<td class=\"colLast\">\n"
@@ -87,10 +87,10 @@
                 + "title=\"class in pkg1\">C.BooleanProperty</a> pausedProperty</pre>\n"
                 + "<div class=\"block\">Defines if paused. The second line.</div>",
                 "<h4>isPaused</h4>\n"
-                + "<pre>public final&nbsp;double&nbsp;isPaused()</pre>\n"
+                + "<pre>public final&nbsp;double&nbsp;isPaused&#8203;()</pre>\n"
                 + "<div class=\"block\">Gets the value of the property paused.</div>",
                 "<h4>setPaused</h4>\n"
-                + "<pre>public final&nbsp;void&nbsp;setPaused(boolean&nbsp;value)</pre>\n"
+                + "<pre>public final&nbsp;void&nbsp;setPaused&#8203;(boolean&nbsp;value)</pre>\n"
                 + "<div class=\"block\">Sets the value of the property paused.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>\n"
@@ -98,7 +98,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
                 + "<dd>false</dd>",
                 "<h4>isPaused</h4>\n"
-                + "<pre>public final&nbsp;double&nbsp;isPaused()</pre>\n"
+                + "<pre>public final&nbsp;double&nbsp;isPaused&#8203;()</pre>\n"
                 + "<div class=\"block\">Gets the value of the property paused.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>\n"
@@ -112,7 +112,7 @@
                 + "<code>Timeline</code> is expected to\n"
                 + " be played. This is the second line.</div>",
                 "<h4>setRate</h4>\n"
-                + "<pre>public final&nbsp;void&nbsp;setRate(double&nbsp;value)</pre>\n"
+                + "<pre>public final&nbsp;void&nbsp;setRate&#8203;(double&nbsp;value)</pre>\n"
                 + "<div class=\"block\">Sets the value of the property rate.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>\n"
@@ -123,7 +123,7 @@
                 + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
                 + "<dd>JavaFX 8.0</dd>",
                 "<h4>getRate</h4>\n"
-                + "<pre>public final&nbsp;double&nbsp;getRate()</pre>\n"
+                + "<pre>public final&nbsp;double&nbsp;getRate&#8203;()</pre>\n"
                 + "<div class=\"block\">Gets the value of the property rate.</div>\n"
                 + "<dl>\n"
                 + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>\n"
@@ -239,26 +239,26 @@
                 + "<td class=\"colFirst\"><code>&lt;T&gt;&nbsp;java.lang.Object</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"../pkg2/Test.html#alphaProperty-java.util.List-\">alphaProperty</a>"
-                + "</span>(java.util.List&lt;T&gt;&nbsp;foo)</code></th>\n"
+                + "</span>&#8203;(java.util.List&lt;T&gt;&nbsp;foo)</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr id=\"i1\" class=\"rowColor\">\n"
                 + "<td class=\"colFirst\"><code>java.lang.Object</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#betaProperty--\">betaProperty</a></span>()</code></th>\n"
+                + "<a href=\"../pkg2/Test.html#betaProperty--\">betaProperty</a></span>&#8203;()</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr id=\"i2\" class=\"altColor\">\n"
                 + "<td class=\"colFirst\"><code>java.util.List&lt;java.util.Set&lt;? super java.lang.Object&gt;&gt;"
                 + "</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#deltaProperty--\">deltaProperty</a></span>()</code></th>\n"
+                + "<a href=\"../pkg2/Test.html#deltaProperty--\">deltaProperty</a></span>&#8203;()</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>\n"
                 + "<tr id=\"i3\" class=\"rowColor\">\n"
                 + "<td class=\"colFirst\"><code>java.util.List&lt;java.lang.String&gt;</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
-                + "<a href=\"../pkg2/Test.html#gammaProperty--\">gammaProperty</a></span>()</code></th>\n"
+                + "<a href=\"../pkg2/Test.html#gammaProperty--\">gammaProperty</a></span>&#8203;()</code></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>"
         );
     }
diff --git a/langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java b/langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java
index 246265e..4b27ccd 100644
--- a/langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java
+++ b/langtools/test/jdk/javadoc/doclet/testJavascript/TestJavascript.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4665566 4855876 7025314 8012375 8015997 8016328 8024756 8148985 8151921
+ * @bug      4665566 4855876 7025314 8012375 8015997 8016328 8024756 8148985 8151921 8151743
  * @summary  Verify that the output has the right javascript.
  * @author   jamieh
  * @library  ../lib
@@ -47,7 +47,11 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/C.html", true,
-                "<a href=\"../index.html?pkg/C.html\" target=\"_top\">Frames</a>");
+                "<a href=\"../index.html?pkg/C.html\" target=\"_top\">Frames</a>",
+                "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>");
 
         checkOutput("TestJavascript.html", true,
                 "<a href=\"index.html?TestJavascript.html\" target=\"_top\">Frames</a>");
@@ -119,5 +123,10 @@
                 + "    }\n"
                 + "    catch(err) {\n"
                 + "    }");
+
+        checkOutput("script.js", true,
+                "$(window).resize(function() {\n"
+                + "        $('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "    });");
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java b/langtools/test/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java
index d303160..5591dfd 100644
--- a/langtools/test/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java
+++ b/langtools/test/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8004893 8022738 8029143
+ * @bug      8004893 8022738 8029143 8175200
  * @summary  Make sure that the lambda feature changes work fine in
  *           javadoc.
  * @author   bpatel
@@ -55,7 +55,7 @@
 
         checkOutput("pkg/A.html", true,
                 "<td class=\"colFirst\"><code>default void</code></td>",
-                "<pre>default&nbsp;void&nbsp;defaultMethod()</pre>",
+                "<pre>default&nbsp;void&nbsp;defaultMethod&#8203;()</pre>",
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>"
                 + "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>"
                 + "<span id=\"t2\" class=\"tableTab\"><span>"
@@ -83,7 +83,7 @@
 
         checkOutput("pkg/A.html", false,
                 "<td class=\"colFirst\"><code>default default void</code></td>",
-                "<pre>default&nbsp;default&nbsp;void&nbsp;defaultMethod()</pre>");
+                "<pre>default&nbsp;default&nbsp;void&nbsp;defaultMethod&#8203;()</pre>");
 
         checkOutput("pkg/B.html", false,
                 "<td class=\"colFirst\"><code>default void</code></td>",
diff --git a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/Check.java b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/Check.java
index cbf6522..4ec80f9 100644
--- a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/Check.java
+++ b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/Check.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,14 @@
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Set;
+import javax.lang.model.element.Element;
 
 import com.sun.source.doctree.DocTree;
-import jdk.javadoc.doclet.taglet.Taglet;
+import jdk.javadoc.doclet.Taglet;
 
 public class Check implements Taglet {
 
     private static final String TAG_NAME = "check";
-    private static final String TAG_HEADER = "Check:";
 
     private final EnumSet<Location> allowedSet = EnumSet.allOf(Location.class);
 
@@ -45,6 +45,7 @@
      *
      * @return false since the tag is not an inline tag.
      */
+    @Override
     public boolean isInlineTag() {
         return false;
     }
@@ -54,29 +55,21 @@
      *
      * @return the name of this tag.
      */
+    @Override
     public String getName() {
         return TAG_NAME;
     }
 
     /**
-     * Given the DocTree representation of this custom tag, return its string
-     * representation.
-     *
-     * @param tag the DocTree representing this custom tag.
-     */
-    public String toString(DocTree tag) {
-        return "<dt><span class=\"simpleTagLabel\">" + TAG_HEADER + ":</span></dt><dd>" +
-                tag.toString() + "</dd>\n";
-    }
-
-    /**
-     * Given an array of DocTrees representing this custom tag, return its string
+     * Given a list of DocTrees representing this custom tag, return its string
      * representation.
      *
      * @param tags the array of tags representing this custom tag.
+     * @param element the declaration to which the enclosing comment belongs
      * @return null to test if the javadoc throws an exception or not.
      */
-    public String toString(List<? extends DocTree> tags) {
+    @Override
+    public String toString(List<? extends DocTree> tags, Element element) {
         return null;
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/TestLegacyTaglet.java b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/TestLegacyTaglet.java
index 685724c..84d3d3b 100644
--- a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/TestLegacyTaglet.java
+++ b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/TestLegacyTaglet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4638723 8015882
+ * @bug 4638723 8015882 8176131 8176331
  * @summary Test to ensure that the refactored version of the standard
  * doclet still works with Taglets that implement the 1.4.0 interface.
  * @author jamieh
diff --git a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/ToDoTaglet.java b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/ToDoTaglet.java
index 1a75f05..bd77982 100644
--- a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/ToDoTaglet.java
+++ b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/ToDoTaglet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,17 +24,17 @@
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Map;
-
 import java.util.Set;
+import javax.lang.model.element.Element;
 
 import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.TextTree;
 import com.sun.source.doctree.UnknownBlockTagTree;
 import com.sun.source.doctree.UnknownInlineTagTree;
 import com.sun.source.util.SimpleDocTreeVisitor;
-import jdk.javadoc.doclet.taglet.Taglet;
-import jdk.javadoc.doclet.taglet.Taglet.Location;
-import static jdk.javadoc.doclet.taglet.Taglet.Location.*;
+import jdk.javadoc.doclet.Taglet;
+import jdk.javadoc.doclet.Taglet.Location;
+import static jdk.javadoc.doclet.Taglet.Location.*;
 
 
 /**
@@ -84,27 +84,15 @@
     }
 
     /**
-     * Given the <code>DocTree</code> representation of this custom
-     * tag, return its string representation.
-     * @param tag   the <code>DocTree</code> representing this custom tag.
-     */
-    public String toString(DocTree tag) {
-
-        return "<DT><B>" + HEADER + "</B><DD>"
-               + "<table summary=\"Summary\" cellpadding=2 cellspacing=0><tr><td bgcolor=\"yellow\">"
-               + getText(tag)
-               + "</td></tr></table></DD>\n";
-    }
-
-    /**
      * Given an array of <code>Tag</code>s representing this custom
      * tag, return its string representation.
      * @param tags  the array of <code>DocTree</code>s representing this custom tag.
+     * @param element the declaration to which the enclosing comment belongs
      */
     @Override
-    public String toString(List<? extends DocTree> tags) {
+    public String toString(List<? extends DocTree> tags, Element element) {
         if (tags.isEmpty()) {
-            return null;
+            return "";
         }
         String result = "\n<DT><B>" + HEADER + "</B><DD>";
         result += "<table summary=\"Summary\" cellpadding=2 cellspacing=0><tr><td bgcolor=\"yellow\">";
diff --git a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/UnderlineTaglet.java b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/UnderlineTaglet.java
index 5631251..6f56ac1 100644
--- a/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/UnderlineTaglet.java
+++ b/langtools/test/jdk/javadoc/doclet/testLegacyTaglet/UnderlineTaglet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,11 @@
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Set;
+import javax.lang.model.element.Element;
 
 import com.sun.source.doctree.DocTree;
-import jdk.javadoc.doclet.taglet.Taglet;
-import static jdk.javadoc.doclet.taglet.Taglet.Location.*;
+import jdk.javadoc.doclet.Taglet;
+import static jdk.javadoc.doclet.Taglet.Location.*;
 
 /**
  * A sample Inline Taglet representing {@underline ...}.  The text
@@ -69,20 +70,11 @@
     /**
      * Given the <code>DocTree</code> representation of this custom
      * tag, return its string representation.
-     * @param tag he <code>DocTree</code> representation of this custom tag.
+     * @param tags the <code>DocTree</code> representation of this custom tag.
+     * @param element the declaration to which the enclosing comment belongs
      */
     @Override
-    public String toString(DocTree tag) {
-        return "<u>" + ToDoTaglet.getText(tag) + "</u>";
-    }
-
-    /**
-     * This method should not be called since arrays of inline tags do not
-     * exist.  Method {@link #tostring(DocTree)} should be used to convert this
-     * inline tag to a string.
-     */
-    @Override
-    public String toString(List<? extends DocTree> tags) {
-        return null;
+    public String toString(List<? extends DocTree> tags, Element element) {
+        return "<u>" + ToDoTaglet.getText(tags.get(0)) + "</u>";
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java b/langtools/test/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java
index bd34513..f91013c 100644
--- a/langtools/test/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java
+++ b/langtools/test/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8002387 8014636 8078320
+ * @bug      8002387 8014636 8078320 8175200
  * @summary  Improve rendered HTML formatting for {@code}
  * @library  ../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -47,19 +47,19 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/Test.html", true,
-                "no_pre()</pre>\n"
+                "no_pre&#8203;()</pre>\n"
                 + "<div class=\"block\">abc<code>def</code>ghi</div>",
-                "no_pre_extra_whitespace()</pre>\n"
+                "no_pre_extra_whitespace&#8203;()</pre>\n"
                 + "<div class=\"block\">abc<code> def  </code>ghi</div>",
-                "in_pre()</pre>\n"
+                "in_pre&#8203;()</pre>\n"
                 + "<div class=\"block\"><pre> abc<code> def  </code>ghi</pre></div>",
-                "pre_after_text()</pre>\n"
+                "pre_after_text&#8203;()</pre>\n"
                 + "<div class=\"block\">xyz <pre> abc<code> def  </code>ghi</pre></div>",
-                "after_pre()</pre>\n"
+                "after_pre&#8203;()</pre>\n"
                 + "<div class=\"block\">xyz <pre> pqr </pre> abc<code> def  </code>ghi</div>",
-                "back_in_pre()</pre>\n"
+                "back_in_pre&#8203;()</pre>\n"
                 + "<div class=\"block\">xyz <pre> pqr </pre> mno <pre> abc<code> def  </code>ghi</pre></div>",
-                "typical_usage_code()</pre>\n"
+                "typical_usage_code&#8203;()</pre>\n"
                 + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
                 + " Example:  <pre><code>\n"
                 + "   line 0 @Override\n"
@@ -68,7 +68,7 @@
                 + "   line 3 }\n"
                 + " </code></pre>\n"
                 + " and so it goes.</div>",
-                "typical_usage_literal()</pre>\n"
+                "typical_usage_literal&#8203;()</pre>\n"
                 + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
                 + " Example:  <pre>\n"
                 + "   line 0 @Override\n"
@@ -77,7 +77,7 @@
                 + "   line 3 }\n"
                 + " </pre>\n"
                 + " and so it goes.</div>",
-                "recommended_usage_literal()</pre>\n"
+                "recommended_usage_literal&#8203;()</pre>\n"
                 + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
                 + " Example:  <pre>\n"
                 + "   line 0 @Override\n"
@@ -89,7 +89,7 @@
                 + " <PRE>\n"
                 + " <b>id           </b>\n"
                 + " </PRE></div>",
-                "<pre>public&nbsp;void&nbsp;htmlAttrInPre1()</pre>\n"
+                "<pre>public&nbsp;void&nbsp;htmlAttrInPre1&#8203;()</pre>\n"
                 + "<div class=\"block\">More html tag outliers.\n"
                 + " <pre>\n"
                 + " @Override\n"
diff --git a/langtools/test/jdk/javadoc/doclet/testMemberInheritence/TestMemberInheritence.java b/langtools/test/jdk/javadoc/doclet/testMemberInheritence/TestMemberInheritence.java
index 3ad67a2..62235ee 100644
--- a/langtools/test/jdk/javadoc/doclet/testMemberInheritence/TestMemberInheritence.java
+++ b/langtools/test/jdk/javadoc/doclet/testMemberInheritence/TestMemberInheritence.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4638588 4635809 6256068 6270645 8025633 8026567 8162363
+ * @bug 4638588 4635809 6256068 6270645 8025633 8026567 8162363 8175200
  * @summary Test to make sure that members are inherited properly in the Javadoc.
  *          Verify that inheritence labels are correct.
  * @author jamieh
@@ -92,7 +92,7 @@
                 "<td class=\"colFirst\"><code>static java.time.Period</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"../pkg1/Implementer.html#between-java.time.LocalDate-java.time.LocalDate-\">"
-                + "between</a></span>(java.time.LocalDate&nbsp;startDateInclusive,\n"
+                + "between</a></span>&#8203;(java.time.LocalDate&nbsp;startDateInclusive,\n"
                 + "       java.time.LocalDate&nbsp;endDateExclusive)</code></th>",
                 // check the inherited from interfaces
                 "<h3>Methods inherited from interface&nbsp;pkg1.<a href=\"../pkg1/Interface.html\""
diff --git a/langtools/test/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java b/langtools/test/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java
index 560c9f1..1b44346 100644
--- a/langtools/test/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java
+++ b/langtools/test/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4951228 6290760 8025633 8026567 8081854 8162363
+ * @bug      4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417
  * @summary  Test the case where the overriden method returns a different
  *           type than the method in the child class.  Make sure the
  *           documentation is inherited but the return type isn't.
@@ -43,7 +43,7 @@
 
     @Test
     void test() {
-        javadoc("-d", "out",
+        javadoc("-d", "out", "-private",
                 "-sourcepath", testSrc,
                 "pkg","pkg2");
         checkExit(Exit.OK);
@@ -52,10 +52,18 @@
                 // Check return type in member summary.
                 "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">"
-                + "returnTypeTest</a></span>()</code>",
+                + "returnTypeTest</a></span>&#8203;()</code>",
                 // Check return type in member detail.
                 "<pre>public&nbsp;<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">"
-                + "PublicChild</a>&nbsp;returnTypeTest()</pre>");
+                + "PublicChild</a>&nbsp;returnTypeTest&#8203;()</pre>",
+                "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
+                + "<a href=\"../pkg/PublicChild.html#PublicChild--\">PublicChild</a></span>&#8203;()</code></th>");
+
+        checkOutput("pkg/PrivateParent.html", true,
+                "<td class=\"colFirst\"><code>private </code></td>\n"
+                + "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
+                + "<a href=\"../pkg/PrivateParent.html#PrivateParent-int-\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
+                + "</th>");
 
         // Legacy anchor dimensions (6290760)
         checkOutput("pkg2/A.html", true,
diff --git a/langtools/test/jdk/javadoc/doclet/testMemberSummary/pkg/PrivateParent.java b/langtools/test/jdk/javadoc/doclet/testMemberSummary/pkg/PrivateParent.java
index a3fa4bd..86d671d 100644
--- a/langtools/test/jdk/javadoc/doclet/testMemberSummary/pkg/PrivateParent.java
+++ b/langtools/test/jdk/javadoc/doclet/testMemberSummary/pkg/PrivateParent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,12 @@
 package pkg;
 
 class PrivateParent {
+    /**
+     * Test private constructor.
+     * @param i a test parameter.
+     */
+    private PrivateParent(int i) {
+    }
 
     /**
      * Test to make sure the member summary inherits documentation
diff --git a/langtools/test/jdk/javadoc/doclet/testMissingType/TestMissingType.java b/langtools/test/jdk/javadoc/doclet/testMissingType/TestMissingType.java
new file mode 100644
index 0000000..b544f7c
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testMissingType/TestMissingType.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug      8173804
+ * @summary  make sure doclet can handle missing types
+ * @library  ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build    JavadocTester
+ * @run main TestMissingType
+ */
+
+public class TestMissingType extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestMissingType tester = new TestMissingType();
+        tester.runTests();
+    }
+
+    @Test
+    void test() {
+        javadoc("-d", "out",
+                "-use",
+                "-sourcepath", testSrc,
+                "p");
+        checkExit(Exit.ERROR);
+        checkOutput(Output.STDERR, false,
+                "java.lang.UnsupportedOperationException: should not happen");
+    }
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testMissingType/p/MissingType.java b/langtools/test/jdk/javadoc/doclet/testMissingType/p/MissingType.java
new file mode 100644
index 0000000..619b584
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testMissingType/p/MissingType.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package p;
+
+public final class MissingType  {
+    /**
+     * Do something with a missing type.
+     *
+     * @param out use the missing type
+     */
+    public void encode(MissingMe out) {}
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java b/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java
index 892b246..5c026ea 100644
--- a/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java
+++ b/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,8 @@
 
 /*
  * @test
- * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 8168766 8168688 8162674 8160196
+ * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
+ *      8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
  * @summary Test modules support in javadoc.
  * @author bpatel
  * @library ../lib
@@ -44,6 +45,7 @@
     @Test
     void testHtml4() {
         javadoc("-d", "out", "-use",
+                "-overview", testSrc("overview.html"),
                 "--module-source-path", testSrc,
                 "--module", "moduleA,moduleB",
                 "testpkgmdlA", "testpkgmdlB");
@@ -65,6 +67,7 @@
     @Test
     void testHtml5() {
         javadoc("-d", "out-html5", "-html5", "-use",
+                "-overview", testSrc("overview.html"),
                 "--module-source-path", testSrc,
                 "--module", "moduleA,moduleB",
                 "testpkgmdlA", "testpkgmdlB");
@@ -86,6 +89,7 @@
     @Test
     void testHtml4NoComment() {
         javadoc("-d", "out-nocomment", "-nocomment", "-use",
+                "-overview", testSrc("overview.html"),
                 "--module-source-path", testSrc,
                 "--module", "moduleA,moduleB",
                 "testpkgmdlA", "testpkgmdlB");
@@ -103,6 +107,7 @@
     @Test
     void testHtml5NoComment() {
         javadoc("-d", "out-html5-nocomment", "-nocomment", "-html5", "-use",
+                "-overview", testSrc("overview.html"),
                 "--module-source-path", testSrc,
                 "--module", "moduleA,moduleB",
                 "testpkgmdlA", "testpkgmdlB");
@@ -120,6 +125,7 @@
     @Test
     void testHtml4UnnamedModule() {
         javadoc("-d", "out-nomodule", "-use",
+                "-overview", testSrc("overview.html"),
                 "-sourcepath", testSrc,
                 "testpkgnomodule", "testpkgnomodule1");
         checkExit(Exit.OK);
@@ -136,6 +142,7 @@
     @Test
     void testHtml5UnnamedModule() {
         javadoc("-d", "out-html5-nomodule", "-html5", "-use",
+                "-overview", testSrc("overview.html"),
                 "-sourcepath", testSrc,
                 "testpkgnomodule", "testpkgnomodule1");
         checkExit(Exit.OK);
@@ -175,17 +182,30 @@
     }
 
     /**
+     * Test generated module summary page of an aggregating module.
+     */
+    @Test
+    void testAggregatorModuleSummary() {
+        javadoc("-d", "out-aggregatorModuleSummary", "-use",
+                "--module-source-path", testSrc,
+                "--expand-requires", "transitive",
+                "--module", "moduleT");
+        checkExit(Exit.OK);
+        checkAggregatorModuleSummary();
+    }
+
+    /**
      * Test generated module pages and pages with link to modules.
      */
     @Test
     void testModuleFilesAndLinks() {
         javadoc("-d", "out-modulelinks",
                 "--module-source-path", testSrc,
-                "--module", "moduleA",
-                "testpkgmdlA");
+                "--module", "moduleA,moduleB",
+                "testpkgmdlA", "testpkgmdlB");
         checkExit(Exit.OK);
         checkModuleFilesAndLinks(true);
-        checkNegatedOverviewFrame();
+        checkOverviewFrame(true);
     }
 
     /**
@@ -257,14 +277,31 @@
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<div class=\"block\">This is a test description for the moduleA module. Search "
-                + "phrase <a id=\"searchphrase\">search phrase</a>.</div>");
+                + "phrase <a id=\"searchphrase\" class=\"searchTagResult\">search phrase</a>.</div>");
         checkOutput("moduleB-summary.html", found,
                 "<!-- ============ MODULE DESCRIPTION =========== -->\n"
                 + "<a name=\"module.description\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<div class=\"block\">This is a test description for the moduleB module. Search "
-                + "word <a id=\"search_word\">search_word</a> with no description.</div>");
+                + "word <a id=\"search_word\" class=\"searchTagResult\">search_word</a> with no description.</div>");
+        checkOutput("overview-summary.html", found,
+                "</script>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">The overview summary page header.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
+        checkOutput("overview-summary.html", false,
+                "</table>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">The overview summary page header.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
+                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
 
     void checkNoDescription(boolean found) {
@@ -274,7 +311,7 @@
                 + "<li class=\"blockList\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
-                + "<!-- ============ MODULES SUMMARY =========== -->");
+                + "<!-- ============ PACKAGES SUMMARY =========== -->");
         checkOutput("moduleB-summary.html", found,
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
@@ -288,7 +325,7 @@
         checkOutput("moduleA-summary.html", found,
                 "<section role=\"region\">\n"
                 + "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated, for removal:"
-                + " This API element is subject to removal in a future version. </span>\n"
+                + " This API element is subject to removal in a future version.</span>\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
                 + "</div>\n"
                 + "<!-- ============ MODULE DESCRIPTION =========== -->\n"
@@ -296,7 +333,7 @@
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<div class=\"block\">This is a test description for the moduleA module. Search "
-                + "phrase <a id=\"searchphrase\">search phrase</a>.</div>");
+                + "phrase <a id=\"searchphrase\" class=\"searchTagResult\">search phrase</a>.</div>");
         checkOutput("moduleB-summary.html", found,
                 "<section role=\"region\">\n"
                 + "<!-- ============ MODULE DESCRIPTION =========== -->\n"
@@ -304,7 +341,28 @@
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<div class=\"block\">This is a test description for the moduleB module. Search "
-                + "word <a id=\"search_word\">search_word</a> with no description.</div>");
+                + "word <a id=\"search_word\" class=\"searchTagResult\">search_word</a> with no description.</div>");
+        checkOutput("overview-summary.html", found,
+                "</nav>\n"
+                + "</header>\n"
+                + "<main role=\"main\">\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">The overview summary page header.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<table class=\"overviewSummary\">\n"
+                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
+        checkOutput("overview-summary.html", false,
+                "</table>\n"
+                + "</div>\n"
+                + "</main>\n"
+                + "<main role=\"main\">\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">The overview summary page header.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<table class=\"overviewSummary\">\n"
+                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
 
     void checkHtml5NoDescription(boolean found) {
@@ -314,7 +372,7 @@
                 + "<li class=\"blockList\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
-                + "<!-- ============ MODULES SUMMARY =========== -->");
+                + "<!-- ============ PACKAGES SUMMARY =========== -->");
         checkOutput("moduleB-summary.html", found,
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
@@ -403,14 +461,29 @@
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>");
+                + "</tr>",
+                "</table>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">The overview summary page header.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
+                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
         checkOutput("overview-summary.html", true,
                 "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
                 + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>");
+                + "</tr>",
+                "</script>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">The overview summary page header.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
+                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
 
     void checkHtml5OverviewSummaryModules() {
@@ -437,14 +510,34 @@
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>");
+                + "</tr>",
+                "</table>\n"
+                + "</div>\n"
+                + "</main>\n"
+                + "<main role=\"main\">\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">The overview summary page header.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<table class=\"overviewSummary\">\n"
+                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
         checkOutput("overview-summary.html", true,
                 "<table class=\"overviewSummary\">\n"
                 + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
-                + "</tr>");
+                + "</tr>",
+                "</script>\n"
+                + "</nav>\n"
+                + "</header>\n"
+                + "<main role=\"main\">\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">The overview summary page header.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<table class=\"overviewSummary\">\n"
+                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
     }
 
     void checkModuleSummary() {
@@ -502,7 +595,7 @@
                 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterface2InModuleB.html\" title=\"interface in testpkg2mdlB\">TestInterface2InModuleB</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>\n"
                 + "</tr>",
-                "<caption><span>Opened Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                "<caption><span>Opens</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
@@ -519,6 +612,32 @@
                 + "</tr>");
     }
 
+    void checkAggregatorModuleSummary() {
+        checkOutput("moduleT-summary.html", true,
+                "<div class=\"header\">\n"
+                + "<h1 title=\"Module\" class=\"title\">Module&nbsp;moduleT</h1>\n"
+                + "</div>",
+                "<div class=\"block\">This is a test description for the moduleT module. "
+                + "Search phrase <a id=\"searchphrase\" class=\"searchTagResult\">search phrase</a>. "
+                + "Make sure there are no exported packages.</div>",
+                "<tbody>\n"
+                + "<tr class=\"altColor\">\n"
+                + "<td class=\"colFirst\">transitive</td>\n"
+                + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n"
+                + "<td class=\"colLast\">\n"
+                + "<div class=\"block\">This is a test description for the moduleA module.</div>\n"
+                + "</td>\n"
+                + "</tr>\n"
+                + "<tr class=\"rowColor\">\n"
+                + "<td class=\"colFirst\">transitive</td>\n"
+                + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
+                + "<td class=\"colLast\">\n"
+                + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
+                + "</td>\n"
+                + "</tr>\n"
+                + "</tbody>");
+    }
+
     void checkNegatedModuleSummary() {
         checkOutput("moduleA-summary.html", false,
                 "<!-- ============ SERVICES SUMMARY =========== -->\n"
@@ -552,12 +671,17 @@
     void checkModuleFilesAndLinks(boolean found) {
         checkFileAndOutput("testpkgmdlA/package-summary.html", found,
                 "<li><a href=\"../moduleA-summary.html\">Module</a></li>",
-                "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span>&nbsp;"
+                "<div class=\"subTitle\"><span class=\"moduleLabelInPackage\">Module</span>&nbsp;"
                 + "<a href=\"../moduleA-summary.html\">moduleA</a></div>");
         checkFileAndOutput("testpkgmdlA/TestClassInModuleA.html", found,
                 "<li><a href=\"../moduleA-summary.html\">Module</a></li>",
-                "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span>&nbsp;"
+                "<div class=\"subTitle\"><span class=\"moduleLabelInType\">Module</span>&nbsp;"
                 + "<a href=\"../moduleA-summary.html\">moduleA</a></div>");
+        checkFileAndOutput("testpkgmdlB/AnnotationType.html", found,
+                "<div class=\"subTitle\"><span class=\"moduleLabelInType\">Module</span>&nbsp;"
+                + "<a href=\"../moduleB-summary.html\">moduleB</a></div>",
+                "<div class=\"subTitle\"><span class=\"packageLabelInType\">"
+                + "Package</span>&nbsp;<a href=\"../testpkgmdlB/package-summary.html\">testpkgmdlB</a></div>");
         checkFiles(found,
                 "moduleA-frame.html",
                 "moduleA-summary.html",
@@ -584,7 +708,7 @@
                 + "search_word</a></span> - Search tag in moduleB</dt>\n"
                 + "<dd>&nbsp;</dd>\n"
                 + "</dl>");
-}
+    }
 
     void checkModuleModeCommon() {
         checkOutput("overview-summary.html", true,
@@ -606,17 +730,12 @@
         checkOutput("moduleA-summary.html", true,
                 "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a href=\"#modules.summary\">"
                 + "Modules</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;Services</li>",
-                "<td class=\"colFirst\">transitive</td>\n"
-                + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
-                + "<td class=\"colLast\">\n"
-                + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
-                + "</td>",
-                "<table class=\"packagesSummary\" summary=\"Additional Exported Packages table, listing modules, and packages\">\n"
-                + "<caption><span>Additional Exported Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>",
-                "<table class=\"packagesSummary\" summary=\"Additional Opened Packages table, listing modules, and packages\">\n"
-                + "<caption><span>Additional Opened Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                "<table class=\"packagesSummary\" summary=\"Indirect Exports table, listing modules, and packages\">\n"
+                + "<caption><span>Indirect Exports</span><span class=\"tabEnd\">&nbsp;</span></caption>",
+                "<table class=\"packagesSummary\" summary=\"Indirect Opens table, listing modules, and packages\">\n"
+                + "<caption><span>Indirect Opens</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
+                + "<th class=\"colFirst\" scope=\"col\">From</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
                 + "</tr>\n",
                 "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
@@ -627,15 +746,15 @@
         checkOutput("moduletags-summary.html", true,
                 "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a href=\"#modules.summary\">Modules"
                 + "</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;Services</li>",
-                "<table class=\"requiresSummary\" summary=\"Additional Modules Required table, listing modules, and an explanation\">\n"
-                + "<caption><span>Additional Modules Required</span><span class=\"tabEnd\">&nbsp;</span></caption>",
+                "<table class=\"requiresSummary\" summary=\"Indirect Requires table, listing modules, and an explanation\">\n"
+                + "<caption><span>Indirect Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 "<td class=\"colFirst\">transitive</td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
                 + "</td>",
-                "<table class=\"packagesSummary\" summary=\"Additional Exported Packages table, listing modules, and packages\">\n"
-                + "<caption><span>Additional Exported Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>",
+                "<table class=\"packagesSummary\" summary=\"Indirect Exports table, listing modules, and packages\">\n"
+                + "<caption><span>Indirect Exports</span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 "<td class=\"colFirst\">transitive static</td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n"
                 + "<td class=\"colLast\">\n"
@@ -647,16 +766,16 @@
                 + "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
                 + "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>",
-                "<table class=\"requiresSummary\" summary=\"Additional Modules Required table, listing modules, and an explanation\">\n"
-                + "<caption><span>Additional Modules Required</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                "<table class=\"requiresSummary\" summary=\"Indirect Requires table, listing modules, and an explanation\">\n"
+                + "<caption><span>Indirect Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
                 + "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>",
-                "<table class=\"packagesSummary\" summary=\"Additional Opened Packages table, listing modules, and packages\">\n"
-                + "<caption><span>Additional Opened Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                "<table class=\"packagesSummary\" summary=\"Indirect Opens table, listing modules, and packages\">\n"
+                + "<caption><span>Indirect Opens</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
-                + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
+                + "<th class=\"colFirst\" scope=\"col\">From</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
                 + "</tr>\n",
                 "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
@@ -673,7 +792,7 @@
                 "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
                 + "<td class=\"colLast\">&nbsp;</td>",
                 "<table class=\"packagesSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
-                + "<caption><span>Opened Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<caption><span>Opens</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
@@ -706,9 +825,9 @@
                 + "<td class=\"colSecond\">All Modules</td>\n"
                 + "<td class=\"colLast\">&nbsp;</td>",
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;</span></span>"
-                + "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showPkgs(1);\">Exported Packages</a></span>"
+                + "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showPkgs(1);\">Exports</a></span>"
                 + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:showPkgs(4);\">"
-                + "Concealed Packages</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
+                + "Concealed</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
                 "<th class=\"colFirst\" scope=\"row\"><a href=\"concealedpkgmdlA/package-summary.html\">concealedpkgmdlA</a></th>\n"
                 + "<td class=\"colSecond\">None</td>\n"
                 + "<td class=\"colLast\">&nbsp;</td>");
@@ -730,10 +849,10 @@
                 + "<td class=\"colLast\">&nbsp;<br>(<span class=\"implementationLabel\">Implementation(s):</span>&nbsp;<a href=\"testpkgmdlB/TestClassInModuleB.html\" "
                 + "title=\"class in testpkgmdlB\">TestClassInModuleB</a>)</td>",
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\"><span>"
-                + "<a href=\"javascript:showPkgs(1);\">Exported Packages</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span>"
-                + "<a href=\"javascript:showPkgs(2);\">Opened Packages</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>");
+                + "<a href=\"javascript:showPkgs(1);\">Exports</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span>"
+                + "<a href=\"javascript:showPkgs(2);\">Opens</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>");
         checkOutput("moduleC-summary.html", found,
-                "<caption><span>Exported Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                "<caption><span>Exports</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
                 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
                 + "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
@@ -748,7 +867,7 @@
     void checkModuleDeprecation(boolean found) {
         checkOutput("moduleA-summary.html", found,
                 "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated, for removal:"
-                + " This API element is subject to removal in a future version. </span>\n"
+                + " This API element is subject to removal in a future version.</span>\n"
                 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
                 + "</div>");
         checkOutput("deprecated-list.html", found,
@@ -778,19 +897,12 @@
                 + "</p>");
         checkOutput("moduleB-summary.html", false,
                 "@AnnotationTypeUndocumented");
-}
+    }
 
     void checkOverviewFrame(boolean found) {
         checkOutput("index.html", !found,
                 "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>");
         checkOutput("index.html", found,
                 "<iframe src=\"module-overview-frame.html\" name=\"packageListFrame\" title=\"All Modules\"></iframe>");
-}
-
-    void checkNegatedOverviewFrame() {
-        checkOutput("index.html", false,
-                "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>");
-        checkOutput("index.html", false,
-                "<iframe src=\"module-overview-frame.html\" name=\"packageListFrame\" title=\"All Modules\"></iframe>");
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationType.java b/langtools/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationType.java
index 6f37a34..26da965 100644
--- a/langtools/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationType.java
+++ b/langtools/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 /**
  * This is a test annotation type.
  */
-@Documented public @interface AnnotationType {
+@Documented @Target(ElementType.MODULE)   public @interface AnnotationType {
 
     /**
      * The copyright holder.
diff --git a/langtools/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationTypeUndocumented.java b/langtools/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationTypeUndocumented.java
index 066551c..00bf360 100644
--- a/langtools/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationTypeUndocumented.java
+++ b/langtools/test/jdk/javadoc/doclet/testModules/moduleB/testpkgmdlB/AnnotationTypeUndocumented.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
  * This is a test annotation type this is not documented because it
  * is missing the @Documented tag.
  */
-public @interface AnnotationTypeUndocumented {
+@Target(ElementType.MODULE) public @interface AnnotationTypeUndocumented {
 
     /**
      * The copyright holder.
diff --git a/langtools/test/jdk/javadoc/doclet/testModules/moduleT/module-info.java b/langtools/test/jdk/javadoc/doclet/testModules/moduleT/module-info.java
new file mode 100644
index 0000000..653c11b
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testModules/moduleT/module-info.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+  * This is a test description for the moduleT module. Search phrase {@index "search phrase" with description}. Make sure there are no exported packages.
+  *
+  */
+module moduleT {
+    requires transitive moduleA;
+    requires transitive moduleB;
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testModules/overview.html b/langtools/test/jdk/javadoc/doclet/testModules/overview.html
new file mode 100644
index 0000000..eda7631
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testModules/overview.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+    The overview summary page header.
+</body>
+</html>
diff --git a/langtools/test/jdk/javadoc/doclet/testNavigation/TestNavigation.java b/langtools/test/jdk/javadoc/doclet/testNavigation/TestNavigation.java
index f8a5042..2f219a7 100644
--- a/langtools/test/jdk/javadoc/doclet/testNavigation/TestNavigation.java
+++ b/langtools/test/jdk/javadoc/doclet/testNavigation/TestNavigation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188
+ * @bug      4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743
  * @summary  Make sure the Next/Prev Class links iterate through all types.
  *           Make sure the navagation is 2 columns, not 3.
  * @author   jamieh
@@ -77,12 +77,20 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<!-- ======== START OF CLASS DATA ======== -->");
 
         checkOutput("pkg/package-summary.html", true,
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">");
     }
 
@@ -98,6 +106,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "</nav>\n"
                 + "</header>\n"
                 + "<!-- ======== START OF CLASS DATA ======== -->");
@@ -106,6 +118,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "</nav>");
     }
 
@@ -121,12 +137,20 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<!-- ======== START OF CLASS DATA ======== -->");
 
         checkOutput("pkg/package-summary.html", false,
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "<div class=\"header\">");
     }
 
@@ -142,6 +166,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "</nav>\n"
                 + "</header>\n"
                 + "<!-- ======== START OF CLASS DATA ======== -->");
@@ -150,6 +178,10 @@
                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
                 + "</div>\n"
                 + "<div class=\"navPadding\">&nbsp;</div>\n"
+                + "<script type=\"text/javascript\"><!--\n"
+                + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+                + "//-->\n"
+                + "</script>\n"
                 + "</nav>");
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java b/langtools/test/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java
index 048c310..e1003ca 100644
--- a/langtools/test/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java
+++ b/langtools/test/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug      4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344 8025633 8026567 8162363
+ *           8175200
  * @summary  Run Javadoc on a set of source files that demonstrate new
  *           language features.  Check the output to ensure that the new
  *           language features are properly documented.
@@ -80,7 +81,7 @@
                 "Overloaded valueOf() method has correct documentation.",
                 "Overloaded values method  has correct documentation.",
                 "<pre>public static&nbsp;<a href=\"../pkg/Coin.html\" title=\"enum in pkg\">Coin</a>" +
-                "&nbsp;valueOf(java.lang.String&nbsp;name)</pre>\n" +
+                "&nbsp;valueOf&#8203;(java.lang.String&nbsp;name)</pre>\n" +
                 "<div class=\"block\">Returns the enum constant of this type with the specified name.\n" +
                 "The string must match <i>exactly</i> an identifier used to declare an\n" +
                 "enum constant in this type.  (Extraneous whitespace characters are \n" +
@@ -136,17 +137,17 @@
                 + "title=\"type parameter in TypeParameters\">E</a>[]</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"../pkg/TypeParameters.html#methodThatReturnsTypeParameterA-E:A-\">"
-                + "methodThatReturnsTypeParameterA</a></span>(<a href=\"../pkg/TypeParameters.html\" "
+                + "methodThatReturnsTypeParameterA</a></span>&#8203;(<a href=\"../pkg/TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;e)</code>",
                 "<pre>public&nbsp;<a href=\"../pkg/TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;"
-                + "methodThatReturnsTypeParameterA(<a href=\"../pkg/TypeParameters.html\" "
+                + "methodThatReturnsTypeParameterA&#8203;(<a href=\"../pkg/TypeParameters.html\" "
                 + "title=\"type parameter in TypeParameters\">E</a>[]&nbsp;e)</pre>\n",
                 "<td class=\"colFirst\"><code>&lt;T extends java.lang.Object &amp; java.lang.Comparable&lt;? super T&gt;&gt;"
                 + "<br>T</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"../pkg/TypeParameters.html#methodtThatReturnsTypeParametersB-java.util.Collection-\">"
-                + "methodtThatReturnsTypeParametersB</a></span>(java.util.Collection&lt;? extends T&gt;&nbsp;coll)</code>",
+                + "methodtThatReturnsTypeParametersB</a></span>&#8203;(java.util.Collection&lt;? extends T&gt;&nbsp;coll)</code>",
                 "<div class=\"block\">Returns TypeParameters</div>\n",
                 // Method takes a TypeVariable
                 "<td class=\"colFirst\"><code>&lt;X extends java.lang.Throwable&gt;<br>"
@@ -154,7 +155,7 @@
                 + "</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"../pkg/TypeParameters.html#orElseThrow-java.util.function.Supplier-\">"
-                + "orElseThrow</a></span>(java.util.function.Supplier&lt;? extends X&gt;&nbsp;exceptionSupplier)</code>"
+                + "orElseThrow</a></span>&#8203;(java.util.function.Supplier&lt;? extends X&gt;&nbsp;exceptionSupplier)</code>"
                 );
 
         checkOutput("pkg/Wildcards.html", true,
@@ -208,7 +209,7 @@
         // Handle multiple bounds.
         //==============================================================
         checkOutput("pkg/MultiTypeParameters.html", true,
-                "public&nbsp;&lt;T extends java.lang.Number &amp; java.lang.Runnable&gt;&nbsp;T&nbsp;foo(T&nbsp;t)");
+                "public&nbsp;&lt;T extends java.lang.Number &amp; java.lang.Runnable&gt;&nbsp;T&nbsp;foo&#8203;(T&nbsp;t)");
 
         //==============================================================
         // Test Class-Use Documentation for Type Parameters.
@@ -231,7 +232,7 @@
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest1."
                 + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/"
                 + "ClassUseTest1.html#method-T-\">method</a></span>"
-                + "(T&nbsp;t)</code></th>",
+                + "&#8203;(T&nbsp;t)</code></th>",
                 "<caption><span>Fields in <a href=\"../../pkg2/"
                 + "package-summary.html\">pkg2</a> with type parameters of "
                 + "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">"
@@ -272,7 +273,7 @@
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">"
                 + "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../../"
                 + "pkg2/ClassUseTest1.html#method-T-\">method</a></span>"
-                + "(T&nbsp;t)</code></th>"
+                + "&#8203;(T&nbsp;t)</code></th>"
         );
 
         // ClassUseTest2: <T extends ParamTest<Foo3>>
@@ -295,7 +296,7 @@
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
                 + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/"
                 + "ClassUseTest2.html#method-T-\">method</a></span>"
-                + "(T&nbsp;t)</code></th>",
+                + "&#8203;(T&nbsp;t)</code></th>",
                 "<caption><span>Fields in <a href=\"../../pkg2/"
                 + "package-summary.html\">pkg2</a> declared as <a href=\"../"
                 + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest"
@@ -336,7 +337,7 @@
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest2."
                 + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/"
                 + "ClassUseTest2.html#method-T-\">method</a></span>"
-                + "(T&nbsp;t)</code></th>",
+                + "&#8203;(T&nbsp;t)</code></th>",
                 "<caption><span>Methods in <a href=\"../../pkg2/"
                 + "package-summary.html\">pkg2</a> that return types with "
                 + "arguments of type <a href=\"../../pkg2/Foo3.html\" title"
@@ -370,7 +371,7 @@
                 + "&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3"
                 + ".</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3."
-                + "html#method-T-\">method</a></span>(T&nbsp;t)</code></th>",
+                + "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code></th>",
                 "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../"
                 + "../pkg2/ParamTest2.html\" title=\"class in pkg2\">"
                 + "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".."
@@ -399,7 +400,7 @@
                 + "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;</span></caption>",
                 "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
                 + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3."
-                + "html#method-T-\">method</a></span>(T&nbsp;t)</code>"
+                + "html#method-T-\">method</a></span>&#8203;(T&nbsp;t)</code>"
                 + "</th>",
                 "<caption><span>Methods in <a href=\"../../pkg2/"
                 + "package-summary.html\">pkg2</a> that return types with "
@@ -433,7 +434,7 @@
                 + "<td class=\"colFirst\"><code>void</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><span class=\"typeNameLabel\">ClassUseTest3."
                 + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3."
-                + "html#method-java.util.Set-\">method</a></span>(java."
+                + "html#method-java.util.Set-\">method</a></span>&#8203;(java."
                 + "util.Set&lt;<a href=\"../../pkg2/Foo4.html\" title=\""
                 + "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code></th>",
                 "<caption><span>Constructor parameters in <a href=\"../../"
@@ -548,7 +549,7 @@
                 + "=\"Constructor Annotation\",\n"
                 + "                <a href=\"../pkg/AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
-                + "public&nbsp;AnnotationTypeUsage()</pre>",
+                + "public&nbsp;AnnotationTypeUsage&#8203;()</pre>",
                 // METHOD
                 "<pre><a href=\"../pkg/AnnotationType.html\" "
                 + "title=\"annotation in pkg\">@AnnotationType</a>("
@@ -556,9 +557,9 @@
                 + "=\"Method Annotation\",\n"
                 + "                <a href=\"../pkg/AnnotationType.html#required--\">"
                 + "required</a>=1994)\n"
-                + "public&nbsp;void&nbsp;method()</pre>",
+                + "public&nbsp;void&nbsp;method&#8203;()</pre>",
                 // METHOD PARAMS
-                "<pre>public&nbsp;void&nbsp;methodWithParams("
+                "<pre>public&nbsp;void&nbsp;methodWithParams&#8203;("
                 + "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">"
                 + "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">"
                 + "optional</a>=\"Parameter Annotation\",<a "
@@ -566,7 +567,7 @@
                 + "                             int&nbsp;documented,\n"
                 + "                             int&nbsp;undocmented)</pre>",
                 // CONSTRUCTOR PARAMS
-                "<pre>public&nbsp;AnnotationTypeUsage(<a "
+                "<pre>public&nbsp;AnnotationTypeUsage&#8203;(<a "
                 + "href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">"
                 + "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">"
                 + "optional</a>=\"Constructor Param Annotation\",<a "
@@ -629,11 +630,11 @@
                 // CONSTRUCTOR
                 "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\",\n"
                 + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
-                + "public <span class=\"typeNameLabel\">AnnotationTypeUsage</span>()",
+                + "public <span class=\"typeNameLabel\">AnnotationTypeUsage</span>&#8203;()",
                 // METHOD
                 "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\",\n"
                 + "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n"
-                + "public void <span class=\"memberNameLabel\">method</span>()");
+                + "public void <span class=\"memberNameLabel\">method</span>&#8203;()");
 
         //=================================
         // Make sure annotation types do not
diff --git a/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/C.java b/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/C.java
index 09b8a23..735a2d5 100644
--- a/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/C.java
+++ b/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/C.java
@@ -71,4 +71,9 @@
      * caseA <ul type='"a">b'> <li> end of sentence. <li> more </ul>
      */
     public void caseA() {}
+
+    /**
+     * caseB <blockquote>A block quote example:</blockquote>
+     */
+    public void caseB() {}
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/Negative.java b/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/Negative.java
new file mode 100644
index 0000000..0bbe3f3
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/Negative.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public class Negative {
+    /**
+     * case1: A hanging &lt;  : <blockquote>xx</blockquote><
+     */
+    public void case1() {}
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java b/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java
index f1f85b5..b24fb81 100644
--- a/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java
+++ b/langtools/test/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8048628
+ * @bug      8048628 8174715
  * @summary  Verify html inline tags are removed correctly in the first sentence.
  * @library  ../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -39,8 +39,8 @@
     }
 
     @Test
-    void test() {
-        javadoc("-d", "out",
+    void testPositive() {
+        javadoc("-d", "out1",
                 "-sourcepath", testSrc,
                 testSrc("C.java"));
         checkExit(Exit.OK);
@@ -55,6 +55,18 @@
                 "<div class=\"block\">case7   end of sentence.</div>",
                 "<div class=\"block\">case8   end of sentence.</div>",
                 "<div class=\"block\">case9   end of sentence.</div>",
-                "<div class=\"block\">caseA   end of sentence.</div>");
+                "<div class=\"block\">caseA   end of sentence.</div>",
+                "<div class=\"block\">caseB A block quote example:</div>");
+    }
+
+    @Test
+    void testNegative() {
+        javadoc("-d", "out2",
+                "-sourcepath", testSrc,
+                testSrc("Negative.java"));
+        checkExit(Exit.ERROR);
+
+        checkOutput("Negative.html", true,
+                "<div class=\"block\">case1: A hanging &lt;  : xx<</div>");
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testOptions/TestOptions.java b/langtools/test/jdk/javadoc/doclet/testOptions/TestOptions.java
index 69bbcf4..9d90916 100644
--- a/langtools/test/jdk/javadoc/doclet/testOptions/TestOptions.java
+++ b/langtools/test/jdk/javadoc/doclet/testOptions/TestOptions.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4749567 8071982
+ * @bug      4749567 8071982 8175200
  * @summary  Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree, -stylesheetfile options.
  * @author   Bhavesh Patel
  * @library  ../lib
@@ -148,7 +148,7 @@
                 "<pre>public&nbsp;java.lang.Object <a href="
                 + "\"../src-html/linksource/Properties.html#line.31\">someProperty</a></pre>",
                 "<pre>public&nbsp;java.lang.Object&nbsp;<a href="
-                + "\"../src-html/linksource/Properties.html#line.31\">someProperty</a>()</pre>");
+                + "\"../src-html/linksource/Properties.html#line.31\">someProperty</a>&#8203;()</pre>");
 
         checkOutput("src-html/linksource/Properties.html", true,
                 "<title>Source code</title>",
@@ -161,9 +161,9 @@
                 "<pre>public&nbsp;int <a href=\"../src-html/linksource/SomeClass.html#line.31\">"
                 + "field</a></pre>",
                 "<pre>public&nbsp;<a href=\"../src-html/linksource/SomeClass.html#line.33\">"
-                + "SomeClass</a>()</pre>",
+                + "SomeClass</a>&#8203;()</pre>",
                 "<pre>public&nbsp;int&nbsp;<a href=\"../src-html/linksource/SomeClass.html#line.36\">"
-                + "method</a>()</pre>");
+                + "method</a>&#8203;()</pre>");
 
         checkOutput("src-html/linksource/SomeClass.html", true,
                 "<title>Source code</title>",
diff --git a/langtools/test/jdk/javadoc/doclet/testOverridenMethods/TestBadOverride.java b/langtools/test/jdk/javadoc/doclet/testOverridenMethods/TestBadOverride.java
new file mode 100644
index 0000000..9681686
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testOverridenMethods/TestBadOverride.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug      8174839 8175200
+ * @summary  Bad overriding method should not crash
+ * @library  ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build    JavadocTester
+ * @run main TestBadOverride
+ */
+
+public class TestBadOverride extends JavadocTester {
+
+    /**
+     * The entry point of the test.
+     * @param args the array of command line arguments.
+     */
+    public static void main(String... args) throws Exception {
+        TestBadOverride tester = new TestBadOverride();
+        tester.runTests();
+    }
+
+    @Test
+    void test() {
+        javadoc("-d", "out",
+                "-sourcepath", testSrc,
+                "pkg4");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg4/Foo.html", true,
+                "<li class=\"blockList\">\n"
+                + "<h4>toString</h4>\n"
+                + "<pre>public&nbsp;void&nbsp;toString&#8203;()</pre>\n"
+                + "<div class=\"block\">Why can't I do this ?</div>\n"
+                + "</li>");
+    }
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testOverridenMethods/pkg4/Foo.java b/langtools/test/jdk/javadoc/doclet/testOverridenMethods/pkg4/Foo.java
new file mode 100644
index 0000000..fded741
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testOverridenMethods/pkg4/Foo.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg4;
+
+public class Foo {
+    /**
+     * Why can't I do this ?
+     */
+    public void toString() {}
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testOverview/TestOverview.java b/langtools/test/jdk/javadoc/doclet/testOverview/TestOverview.java
new file mode 100644
index 0000000..e4f105b
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testOverview/TestOverview.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173302
+ * @summary make sure the overview-summary and module-summary pages don't
+ *          don't have the See link, and the overview is copied correctly.
+ * @library ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build JavadocTester
+ * @run main TestOverview
+ */
+
+public class TestOverview extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestOverview tester = new TestOverview();
+        tester.runTests();
+    }
+
+    @Test
+    void test1() {
+        javadoc("-d", "out-1",
+                    "-doctitle", "Document Title",
+                    "-windowtitle", "Window Title",
+                    "-overview", testSrc("overview.html"),
+                    "-sourcepath", testSrc("src"),
+                    "p1", "p2");
+        checkExit(Exit.OK);
+        checkOutput("overview-summary.html", true,
+                "<div class=\"header\">\n"
+                + "<h1 class=\"title\">Document Title</h1>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">This is line1. This is line 2.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">"
+        );
+    }
+
+    @Test
+    void test2() {
+        javadoc("-d", "out-2",
+                    "-doctitle", "Document Title",
+                    "-windowtitle", "Window Title",
+                    "-overview", testSrc("overview.html"),
+                    "-sourcepath", testSrc("msrc"),
+                    "p1", "p2");
+        checkExit(Exit.OK);
+        checkOutput("overview-summary.html", true,
+                "<div class=\"header\">\n"
+                + "<h1 class=\"title\">Document Title</h1>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div class=\"block\">This is line1. This is line 2.</div>\n"
+                + "</div>\n"
+                + "<div class=\"contentContainer\">"
+        );
+    }
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testOverview/msrc/module-info.java b/langtools/test/jdk/javadoc/doclet/testOverview/msrc/module-info.java
new file mode 100644
index 0000000..c5d6328
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testOverview/msrc/module-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+  *  Test module acme.
+  */
+module acme {
+    exports p1;
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testOverview/msrc/p1/C.java b/langtools/test/jdk/javadoc/doclet/testOverview/msrc/p1/C.java
new file mode 100644
index 0000000..db9ab5d
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testOverview/msrc/p1/C.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p1;
+
+public class C {}
diff --git a/langtools/test/jdk/javadoc/doclet/testOverview/msrc/p2/C2.java b/langtools/test/jdk/javadoc/doclet/testOverview/msrc/p2/C2.java
new file mode 100644
index 0000000..65039aa
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testOverview/msrc/p2/C2.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p2;
+
+public class C2 {}
diff --git a/langtools/test/jdk/javadoc/doclet/testOverview/overview.html b/langtools/test/jdk/javadoc/doclet/testOverview/overview.html
new file mode 100644
index 0000000..07351cd
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testOverview/overview.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<body bgcolor="white">
+    This is line1. This is line 2.
+</body>
+</html>
diff --git a/langtools/test/jdk/javadoc/doclet/testOverview/src/p1/C.java b/langtools/test/jdk/javadoc/doclet/testOverview/src/p1/C.java
new file mode 100644
index 0000000..db9ab5d
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testOverview/src/p1/C.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p1;
+
+public class C {}
diff --git a/langtools/test/jdk/javadoc/doclet/testOverview/src/p2/C2.java b/langtools/test/jdk/javadoc/doclet/testOverview/src/p2/C2.java
new file mode 100644
index 0000000..65039aa
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testOverview/src/p2/C2.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package p2;
+
+public class C2 {}
diff --git a/langtools/test/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java b/langtools/test/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java
index ea95afe..3ff5a7f 100644
--- a/langtools/test/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java
+++ b/langtools/test/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4780441 4874845 4978816 8014017 8016328 8025633 8026567
+ * @bug      4780441 4874845 4978816 8014017 8016328 8025633 8026567 8175200
  * @summary  Make sure that when the -private flag is not used, members
  *           inherited from package private class are documented in the child.
  *
@@ -74,7 +74,7 @@
                 + "</li>\n"
                 + "</ul>",
                 // Method is documented as though it is declared in the inheriting method.
-                "<pre>public&nbsp;void&nbsp;methodInheritedFromParent(int&nbsp;p1)",
+                "<pre>public&nbsp;void&nbsp;methodInheritedFromParent&#8203;(int&nbsp;p1)",
                 "<dl>\n"
                 + "<dt>All Implemented Interfaces:</dt>\n"
                 + "<dd><code><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">"
@@ -96,12 +96,12 @@
                 // Should not document comments from private inherited interfaces
                 "<td class=\"colLast\"><code><span class=\"memberNameLink\">" +
                 "<a href=\"../pkg/PublicChild.html#methodInterface-int-\">" +
-                "methodInterface</a></span>(int&nbsp;p1)</code>\n" +
+                "methodInterface</a></span>&#8203;(int&nbsp;p1)</code>\n" +
                 "<div class=\"block\">Comment from interface.</div>\n</td>",
                 // and similarly one more
                 "<td class=\"colLast\"><code><span class=\"memberNameLink\">" +
                 "<a href=\"../pkg/PublicChild.html#methodInterface2-int-\">" +
-                "methodInterface2</a></span>(int&nbsp;p1)</code>\n" +
+                "methodInterface2</a></span>&#8203;(int&nbsp;p1)</code>\n" +
                 "<div class=\"block\">Comment from interface.</div>\n</td>"
         );
 
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/TestProperty.java b/langtools/test/jdk/javadoc/doclet/testProperty/TestProperty.java
new file mode 100644
index 0000000..69eec3a
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/TestProperty.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug      8176231
+ * @summary  Test JavaFX property.
+ * @library  ../lib/
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build    JavadocTester TestProperty
+ * @run main TestProperty
+ */
+
+public class TestProperty extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestProperty tester = new TestProperty();
+        tester.runTests();
+    }
+
+    @Test
+    void testArrays() {
+        javadoc("-d", "out",
+                "-javafx",
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg/MyClass.html", true,
+                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>"
+                + "&lt;<a href=\"../pkg/MyObj.html\" "
+                + "title=\"class in pkg\">MyObj</a>&gt; goodProperty</pre>\n"
+                + "<div class=\"block\">This is an Object property where the "
+                + "Object is a single Object.</div>\n"
+                + "<dl>\n"
+                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+                + "<dd><a href=\"../pkg/MyClass.html#getGood--\"><code>getGood()</code></a>, \n"
+                + "<a href=\"../pkg/MyClass.html#setGood-pkg.MyObj-\">"
+                + "<code>setGood(MyObj)</code></a></dd>\n"
+                + "</dl>",
+
+                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>"
+                + "&lt;<a href=\"../pkg/MyObj.html\" "
+                + "title=\"class in pkg\">MyObj</a>[]&gt; badProperty</pre>\n"
+                + "<div class=\"block\">This is an Object property where the "
+                + "Object is an array.</div>\n"
+                + "<dl>\n"
+                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+                + "<dd><a href=\"../pkg/MyClass.html#getBad--\"><code>getBad()</code></a>, \n"
+                + "<a href=\"../pkg/MyClass.html#setBad-pkg.MyObj:A-\">"
+                + "<code>setBad(MyObj[])</code></a></dd>\n"
+                + "</dl>"
+        );
+
+        checkOutput("pkg/MyClassT.html", true,
+                "<pre>public final&nbsp;<a href=\"../pkg/ObjectProperty.html\" "
+                + "title=\"class in pkg\">ObjectProperty</a>"
+                + "&lt;java.util.List&lt;<a href=\"../pkg/MyClassT.html\" "
+                + "title=\"type parameter in MyClassT\">T</a>&gt;&gt; "
+                + "listProperty</pre>\n"
+                + "<div class=\"block\">This is an Object property where the "
+                + "Object is a single <code>List&lt;T&gt;</code>.</div>\n"
+                + "<dl>\n"
+                + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
+                + "<dd><a href=\"../pkg/MyClassT.html#getList--\">"
+                + "<code>getList()</code></a>, \n"
+                + "<a href=\"../pkg/MyClassT.html#setList-java.util.List-\">"
+                + "<code>setList(List)</code></a></dd>\n"
+                + "</dl>"
+        );
+    }
+}
+
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClass.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClass.java
new file mode 100644
index 0000000..429977f
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClass.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+/**
+ * Test program for javadoc properties.
+ */
+public class MyClass {
+
+    private SimpleObjectProperty<MyObj> good
+            = new SimpleObjectProperty<MyObj>();
+
+    /**
+     * This is an Object property where the Object is a single Object.
+     *
+     * @return the good
+     */
+    public final ObjectProperty<MyObj> goodProperty() {
+        return good;
+    }
+
+    public final void setGood(MyObj good) {
+    }
+
+    public final MyObj getGood() {
+        return good.get();
+    }
+
+
+    private SimpleObjectProperty<MyObj[]> bad
+            = new SimpleObjectProperty<MyObj[]>();
+
+    /**
+     * This is an Object property where the Object is an array.
+     *
+     * @return the bad
+     */
+    public final ObjectProperty<MyObj[]> badProperty() {
+        return bad;
+    }
+
+    public final void setBad(MyObj[] bad) {
+    }
+
+    public final MyObj[] getBad() {
+        return bad.get();
+    }
+
+}
+
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClassT.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClassT.java
new file mode 100644
index 0000000..c428d5b
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyClassT.java
@@ -0,0 +1,32 @@
+package pkg;
+
+import java.util.List;
+
+//import javafx.beans.property.*;
+
+/**
+ * Test program for javadoc properties.
+ */
+public class MyClassT<T> {
+
+    private SimpleObjectProperty<List<T>> list
+            = new SimpleObjectProperty<List<T>>();
+
+    /**
+     * This is an Object property where the Object is a single {@code List<T>}.
+     *
+     * @return the list
+     */
+    public final ObjectProperty<List<T>> listProperty() {
+        return list;
+    }
+
+    public final void setList(List<T> list) {
+    }
+
+    public final List<T> getList() {
+        return list.get();
+    }
+
+
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyObj.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyObj.java
new file mode 100644
index 0000000..564f4c7
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/MyObj.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+public class MyObj {
+}
+
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/ObjectProperty.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/ObjectProperty.java
new file mode 100644
index 0000000..eecf8c3
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/ObjectProperty.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+public class ObjectProperty<T> { }
+
diff --git a/langtools/test/jdk/javadoc/doclet/testProperty/pkg/SimpleObjectProperty.java b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/SimpleObjectProperty.java
new file mode 100644
index 0000000..3d64a9e
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testProperty/pkg/SimpleObjectProperty.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+public class SimpleObjectProperty<T> { }
+
diff --git a/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java b/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java
index 0979d25..d332239 100644
--- a/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java
+++ b/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,22 +61,7 @@
                 + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
                 + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>,"
                 + "<a href=\"../pkg/RegContaineeNotDoc.html\" "
-                + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})",
-                "<a href=\"../pkg/ContaineeSynthDoc.html\" "
-                + "title=\"annotation in pkg\">@ContaineeSynthDoc</a> "
-                + "<a href=\"../pkg/ContaineeSynthDoc.html\" "
-                + "title=\"annotation in pkg\">@ContaineeSynthDoc</a> "
-                + "<a href=\"../pkg/ContaineeSynthDoc.html\" "
-                + "title=\"annotation in pkg\">@ContaineeSynthDoc</a>",
-                "<a href=\"../pkg/ContainerSynthDoc.html\" "
-                + "title=\"annotation in pkg\">@ContainerSynthDoc</a>("
-                + ""
-                + "<a href=\"../pkg/ContaineeSynthDoc.html\" "
-                + "title=\"annotation in pkg\">@ContaineeSynthDoc</a>)",
-                "<a href=\"../pkg/ContaineeSynthDoc.html\" "
-                + "title=\"annotation in pkg\">@ContaineeSynthDoc</a> "
-                + "<a href=\"../pkg/ContaineeSynthDoc.html\" "
-                + "title=\"annotation in pkg\">@ContaineeSynthDoc</a>");
+                + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})");
 
         checkOutput("pkg/D.html", true,
                 "<a href=\"../pkg/RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>"
@@ -88,7 +73,8 @@
                 "<a href=\"../pkg/NonSynthDocContainer.html\" "
                 + "title=\"annotation in pkg\">@NonSynthDocContainer</a>"
                 + "("
-                + "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>)");
+                + "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>"
+                + "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>=1))");
 
         checkOutput("pkg1/C.html", true,
                 "<a href=\"../pkg1/RegContainerValDoc.html\" "
diff --git a/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/pkg/C.java b/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/pkg/C.java
index c8b6289..3d4f925 100644
--- a/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/pkg/C.java
+++ b/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/pkg/C.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
 @RegContainerDoc({@RegContaineeNotDoc,@RegContaineeNotDoc})
 @ContainerRegNotDoc({@RegContaineeDoc,@RegContaineeDoc})
 @RegContainerNotDoc({@RegContaineeNotDoc,@RegContaineeNotDoc})
-@ContaineeSynthDoc @ContaineeSynthDoc @ContaineeSynthDoc
 public class C {
 
     @ContainerSynthDoc({@ContaineeSynthDoc})
diff --git a/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/pkg/D.java b/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/pkg/D.java
index 1559247..8067801 100644
--- a/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/pkg/D.java
+++ b/langtools/test/jdk/javadoc/doclet/testRepeatedAnnotations/pkg/D.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,6 @@
     @RegArryDoc(y={1,2})
     public void test2() {}
 
-    @NonSynthDocContainer({@RegArryDoc})
+    @NonSynthDocContainer({@RegArryDoc(y={1})})
     public void test3() {}
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java
index daceff1..5be26d2 100644
--- a/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java
+++ b/langtools/test/jdk/javadoc/doclet/testSearch/TestSearch.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8141492 8071982 8141636 8147890 8166175
+ * @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218
  * @summary Test the search feature of javadoc.
  * @author bpatel
  * @library ../lib
@@ -321,9 +321,9 @@
                 + "pkg2.<a href=\"pkg2/TestEnum.html\" title=\"enum in pkg2\">TestEnum</a></dt>");
         checkOutput("index-all.html", true,
                 "<div class=\"block\"><span class=\"deprecationComment\">class_test1 passes. Search tag"
-                + " <a id=\"SearchTagDeprecatedClass\">SearchTagDeprecatedClass</a></span></div>",
+                + " <a id=\"SearchTagDeprecatedClass\" class=\"searchTagResult\">SearchTagDeprecatedClass</a></span></div>",
                 "<div class=\"block\"><span class=\"deprecationComment\">error_test3 passes. Search tag for\n"
-                + " method <a id=\"SearchTagDeprecatedMethod\">SearchTagDeprecatedMethod</a></span></div>");
+                + " method <a id=\"SearchTagDeprecatedMethod\" class=\"searchTagResult\">SearchTagDeprecatedMethod</a></span></div>");
     }
 
     void checkSplitIndex() {
@@ -486,6 +486,11 @@
         checkOutput("search.js", true,
                 "camelCaseRegexp = ($.ui.autocomplete.escapeRegex(request.term)).split(/(?=[A-Z])/).join(\"([a-z0-9_$]*?)\");",
                 "var camelCaseMatcher = new RegExp(\"^\" + camelCaseRegexp);",
-                "camelCaseMatcher.test(item.l)");
+                "camelCaseMatcher.test(item.l)",
+                "var secondaryresult = new Array();",
+                "function nestedName(e) {",
+                "function sortAndConcatResults(a1, a2) {",
+                "if (exactMatcher.test(item.l)) {\n"
+                + "                        presult.unshift(item);");
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java b/langtools/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java
index c54e98c..f649f3b 100644
--- a/langtools/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java
+++ b/langtools/test/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,8 @@
 
 /*
  * @test
- * @bug      4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196
+ * @bug      4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196 8151743 8177417
+ *           8175218
  * @summary  Run tests on doclet stylesheet.
  * @author   jamieh
  * @library  ../lib
@@ -140,8 +141,8 @@
                 + ".usesSummary td.colFirst, .usesSummary th.colFirst,\n"
                 + ".providesSummary td.colFirst, .providesSummary th.colFirst,\n"
                 + ".memberSummary td.colFirst, .memberSummary th.colFirst,\n"
-                + ".memberSummary td.colSecond, .memberSummary th.colSecond,\n"
-                + ".typeSummary td.colFirst{\n"
+                + ".memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName,\n"
+                + ".typeSummary td.colFirst {\n"
                 + "    vertical-align:top;\n"
                 + "}",
                 ".overviewSummary td, .memberSummary td, .typeSummary td,\n"
@@ -159,7 +160,20 @@
                 + "    float:none;\n"
                 + "    display:inline;\n"
                 + "}",
-                "@import url('resources/fonts/dejavu.css');");
+                "@import url('resources/fonts/dejavu.css');",
+                ".navPadding {\n"
+                + "    padding-top: 107px;\n"
+                + "}",
+                "a[name]:before, a[name]:target, a[id]:before, a[id]:target {\n"
+                + "    content:\"\";\n"
+                + "    display:inline-block;\n"
+                + "    position:relative;\n"
+                + "    padding-top:129px;\n"
+                + "    margin-top:-129px;\n"
+                + "}\n"
+                + ".searchTagResult:before, .searchTagResult:target {\n"
+                + "    color:red;\n"
+                + "}");
 
         // Test whether a link to the stylesheet file is inserted properly
         // in the class documentation.
diff --git a/langtools/test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java b/langtools/test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java
index 810d503..ecfc18b 100644
--- a/langtools/test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java
+++ b/langtools/test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7010342 8150000
+ * @bug 7010342 8150000 8174974
  * @summary Test for correct sub title generation.
  * @author Bhavesh Patel
  * @library ../lib
@@ -50,7 +50,7 @@
             "<div class=\"block\">This is the description of package pkg.</div>");
 
         checkOutput("pkg/C.html", true,
-                "<div class=\"subTitle\"><span class=\"packageLabelInClass\">" +
+                "<div class=\"subTitle\"><span class=\"packageLabelInType\">" +
                 "Package</span>&nbsp;<a href=\"../pkg/package-summary.html\">pkg</a></div>");
 
         checkOutput("pkg/package-summary.html", false,
diff --git a/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java b/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java
index 04f0fd6..aa17903 100644
--- a/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java
+++ b/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8005091 8009686 8025633 8026567 6469562 8071982 8071984 8162363
+ * @bug      8005091 8009686 8025633 8026567 6469562 8071982 8071984 8162363 8175200
  * @summary  Make sure that type annotations are displayed correctly
  * @author   Bhavesh Patel
  * @library  ../lib
@@ -155,17 +155,17 @@
         checkOutput("typeannos/MtdDefaultScope.html", true,
                 "<pre>public&nbsp;&lt;T&gt;&nbsp;<a href=\"../typeannos/MRtnA.html\" "
                 + "title=\"annotation in typeannos\">@MRtnA</a> java.lang.String"
-                + "&nbsp;method()</pre>",
+                + "&nbsp;method&#8203;()</pre>",
 
                 // When JDK-8068737 is fixed, we should change the order
                 "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in typeannos\">"
                 + "@MRtnA</a> java.lang.String "
                 + "<a href=\"../typeannos/MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> [] "
                 + "<a href=\"../typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> []"
-                + "&nbsp;array2Deep()</pre>",
+                + "&nbsp;array2Deep&#8203;()</pre>",
 
                 "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in "
-                + "typeannos\">@MRtnA</a> java.lang.String[][]&nbsp;array2()</pre>");
+                + "typeannos\">@MRtnA</a> java.lang.String[][]&nbsp;array2&#8203;()</pre>");
 
         checkOutput("typeannos/MtdModifiedScoped.html", true,
                 "<pre>public final&nbsp;<a href=\"../typeannos/MtdParameterized.html\" "
@@ -177,25 +177,25 @@
                 + "String,<a href=\"../typeannos/MRtnB.html\" title=\"annotation in "
                 + "typeannos\">@MRtnB</a> java.lang.String&gt;,<a href=\"../typeannos/"
                 + "MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> java."
-                + "lang.String&gt;&nbsp;nestedMtdParameterized()</pre>");
+                + "lang.String&gt;&nbsp;nestedMtdParameterized&#8203;()</pre>");
 
         // Test for type annotations on method type parameters (MethodTypeParameters.java).
         checkOutput("typeannos/UnscopedUnmodified.html", true,
                 "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\""
                 + "annotation in typeannos\">@MTyParamA</a> java.lang.String&gt;"
-                + "&nbsp;void&nbsp;methodExtends()</pre>",
+                + "&nbsp;void&nbsp;methodExtends&#8203;()</pre>",
 
                 "<pre>&lt;K extends <a href=\"../typeannos/MTyParamA.html\" title=\""
                 + "annotation in typeannos\">@MTyParamA</a> <a href=\"../typeannos/"
                 + "MtdTyParameterized.html\" title=\"class in typeannos\">"
                 + "MtdTyParameterized</a>&lt;<a href=\"../typeannos/MTyParamB.html\" "
                 + "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String"
-                + "&gt;&gt;&nbsp;void&nbsp;nestedExtends()</pre>");
+                + "&gt;&gt;&nbsp;void&nbsp;nestedExtends&#8203;()</pre>");
 
         checkOutput("typeannos/PublicModifiedMethods.html", true,
                 "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/"
                 + "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> "
-                + "java.lang.String&gt;&nbsp;void&nbsp;methodExtends()</pre>",
+                + "java.lang.String&gt;&nbsp;void&nbsp;methodExtends&#8203;()</pre>",
 
                 "<pre>public final&nbsp;&lt;K extends <a href=\"../typeannos/"
                 + "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> "
@@ -204,16 +204,16 @@
                 + "typeannos/MtdTyParameterized.html\" title=\"class in typeannos\">"
                 + "MtdTyParameterized</a>&lt;<a href=\"../typeannos/MTyParamB.html\" "
                 + "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String"
-                + "&gt;&gt;&nbsp;void&nbsp;dual()</pre>");
+                + "&gt;&gt;&nbsp;void&nbsp;dual&#8203;()</pre>");
 
         // Test for type annotations on parameters (Parameters.java).
         checkOutput("typeannos/Parameters.html", true,
-                "<pre>void&nbsp;unannotated(<a href=\"../typeannos/"
+                "<pre>void&nbsp;unannotated&#8203;(<a href=\"../typeannos/"
                 + "ParaParameterized.html\" title=\"class in typeannos\">"
                 + "ParaParameterized</a>&lt;java.lang.String,java.lang.String&gt;"
                 + "&nbsp;a)</pre>",
 
-                "<pre>void&nbsp;nestedParaParameterized(<a href=\"../typeannos/"
+                "<pre>void&nbsp;nestedParaParameterized&#8203;(<a href=\"../typeannos/"
                 + "ParaParameterized.html\" title=\"class in typeannos\">"
                 + "ParaParameterized</a>&lt;<a href=\"../typeannos/ParamA.html\" "
                 + "title=\"annotation in typeannos\">@ParamA</a> <a href=\"../"
@@ -226,7 +226,7 @@
                 + "</a> java.lang.String&gt;&nbsp;a)</pre>",
 
                 // When JDK-8068737 is fixed, we should change the order
-                "<pre>void&nbsp;array2Deep(<a href=\"../typeannos/ParamA.html\" "
+                "<pre>void&nbsp;array2Deep&#8203;(<a href=\"../typeannos/ParamA.html\" "
                 + "title=\"annotation in typeannos\">@ParamA</a> java.lang.String "
                 + "<a href=\"../typeannos/ParamB.html\" title=\"annotation in typeannos\">"
                 + "@ParamB</a> [] "
@@ -236,34 +236,34 @@
 
         // Test for type annotations on throws (Throws.java).
         checkOutput("typeannos/ThrDefaultUnmodified.html", true,
-                "<pre>void&nbsp;oneException()\n"
+                "<pre>void&nbsp;oneException&#8203;()\n"
                 + "           throws <a href=\"../typeannos/ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>",
 
-                "<pre>void&nbsp;twoExceptions()\n"
+                "<pre>void&nbsp;twoExceptions&#8203;()\n"
                 + "            throws <a href=\"../typeannos/ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n"
                 + "                   <a href=\"../typeannos/ThrA.html\" title=\""
                 + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
 
         checkOutput("typeannos/ThrPublicModified.html", true,
-                "<pre>public final&nbsp;void&nbsp;oneException(java.lang.String&nbsp;a)\n"
+                "<pre>public final&nbsp;void&nbsp;oneException&#8203;(java.lang.String&nbsp;a)\n"
                 + "                        throws <a href=\"../typeannos/ThrA.html\" "
                 + "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>",
 
-                "<pre>public final&nbsp;void&nbsp;twoExceptions(java.lang.String&nbsp;a)\n"
+                "<pre>public final&nbsp;void&nbsp;twoExceptions&#8203;(java.lang.String&nbsp;a)\n"
                 + "                         throws <a href=\"../typeannos/ThrA.html\" "
                 + "title=\"annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n"
                 + "                                <a href=\"../typeannos/ThrA.html\" "
                 + "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
 
         checkOutput("typeannos/ThrWithValue.html", true,
-                "<pre>void&nbsp;oneException()\n"
+                "<pre>void&nbsp;oneException&#8203;()\n"
                 + "           throws <a href=\"../typeannos/ThrB.html\" title=\""
                 + "annotation in typeannos\">@ThrB</a>("
                 + "\"m\") java.lang.Exception</pre>",
 
-                "<pre>void&nbsp;twoExceptions()\n"
+                "<pre>void&nbsp;twoExceptions&#8203;()\n"
                 + "            throws <a href=\"../typeannos/ThrB.html\" title=\""
                 + "annotation in typeannos\">@ThrB</a>("
                 + "\"m\") java.lang.RuntimeException,\n"
@@ -275,12 +275,12 @@
                 "<pre>&lt;K,<a href=\"../typeannos/TyParaA.html\" title=\"annotation in typeannos\">"
                 + "@TyParaA</a> V extends <a href=\"../typeannos/TyParaA.html\" "
                 + "title=\"annotation in typeannos\">@TyParaA</a> "
-                + "java.lang.String&gt;&nbsp;void&nbsp;secondAnnotated()</pre>"
+                + "java.lang.String&gt;&nbsp;void&nbsp;secondAnnotated&#8203;()</pre>"
         );
 
         // Test for type annotations on wildcard type (Wildcards.java).
         checkOutput("typeannos/BoundTest.html", true,
-                "<pre>void&nbsp;wcExtends(<a href=\"../typeannos/MyList.html\" "
+                "<pre>void&nbsp;wcExtends&#8203;(<a href=\"../typeannos/MyList.html\" "
                 + "title=\"class in typeannos\">MyList</a>&lt;? extends <a href=\""
                 + "../typeannos/WldA.html\" title=\"annotation in typeannos\">@WldA"
                 + "</a> java.lang.String&gt;&nbsp;l)</pre>",
@@ -288,10 +288,10 @@
                 "<pre><a href=\"../typeannos/MyList.html\" title=\"class in "
                 + "typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/WldA.html\" "
                 + "title=\"annotation in typeannos\">@WldA</a> java.lang.String&gt;"
-                + "&nbsp;returnWcSuper()</pre>");
+                + "&nbsp;returnWcSuper&#8203;()</pre>");
 
         checkOutput("typeannos/BoundWithValue.html", true,
-                "<pre>void&nbsp;wcSuper(<a href=\"../typeannos/MyList.html\" title=\""
+                "<pre>void&nbsp;wcSuper&#8203;(<a href=\"../typeannos/MyList.html\" title=\""
                 + "class in typeannos\">MyList</a>&lt;? super <a href=\"../typeannos/"
                 + "WldB.html\" title=\"annotation in typeannos\">@WldB</a>("
                 + "\"m\") java.lang."
@@ -301,41 +301,41 @@
                 + "typeannos\">MyList</a>&lt;? extends <a href=\"../typeannos/WldB."
                 + "html\" title=\"annotation in typeannos\">@WldB</a>("
                 + "\"m\") java.lang.String"
-                + "&gt;&nbsp;returnWcExtends()</pre>");
+                + "&gt;&nbsp;returnWcExtends&#8203;()</pre>");
 
         // Test for receiver annotations (Receivers.java).
         checkOutput("typeannos/DefaultUnmodified.html", true,
-                "<pre>void&nbsp;withException(<a href=\"../typeannos/RcvrA.html\" "
+                "<pre>void&nbsp;withException&#8203;(<a href=\"../typeannos/RcvrA.html\" "
                 + "title=\"annotation in typeannos\">@RcvrA</a>&nbsp;"
                 + "DefaultUnmodified&nbsp;this)\n"
                 + "            throws java."
                 + "lang.Exception</pre>",
 
-                "<pre>java.lang.String&nbsp;nonVoid(<a href=\"../typeannos/RcvrA."
+                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"../typeannos/RcvrA."
                 + "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\"../"
                 + "typeannos/RcvrB.html\" title=\"annotation in typeannos\">@RcvrB"
                 + "</a>(\"m\")"
                 + "&nbsp;DefaultUnmodified&nbsp;this)</pre>",
 
-                "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept("
+                "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept&#8203;("
                 + "<a href=\"../typeannos/RcvrA.html\" title=\"annotation in "
                 + "typeannos\">@RcvrA</a>&nbsp;DefaultUnmodified&nbsp;this,\n"
                 + "                                           T&nbsp;r)\n"
                 + "                                    throws java.lang.Exception</pre>");
 
         checkOutput("typeannos/PublicModified.html", true,
-                "<pre>public final&nbsp;java.lang.String&nbsp;nonVoid(<a href=\""
+                "<pre>public final&nbsp;java.lang.String&nbsp;nonVoid&#8203;(<a href=\""
                 + "../typeannos/RcvrA.html\" title=\"annotation in typeannos\">"
                 + "@RcvrA</a>&nbsp;PublicModified&nbsp;this)</pre>",
 
                 "<pre>public final&nbsp;&lt;T extends java.lang.Runnable&gt;&nbsp;"
-                + "void&nbsp;accept(<a href=\"../typeannos/RcvrA.html\" title=\""
+                + "void&nbsp;accept&#8203;(<a href=\"../typeannos/RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;PublicModified&nbsp;this,\n"
                 + "                                                        T&nbsp;r)\n"
                 + "                                                 throws java.lang.Exception</pre>");
 
         checkOutput("typeannos/WithValue.html", true,
-                "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept("
+                "<pre>&lt;T extends java.lang.Runnable&gt;&nbsp;void&nbsp;accept&#8203;("
                 + "<a href=\"../typeannos/RcvrB.html\" title=\"annotation in "
                 + "typeannos\">@RcvrB</a>("
                 + "\"m\")&nbsp;WithValue&nbsp;this,\n"
@@ -343,17 +343,17 @@
                 + "                                    throws java.lang.Exception</pre>");
 
         checkOutput("typeannos/WithFinal.html", true,
-                "<pre>java.lang.String&nbsp;nonVoid(<a href=\"../typeannos/RcvrB."
-                + "html\" title=\"annotation in typeannos\">@RcvrB</a>("
-                + "\"m\")&nbsp;WithFinal"
-                + "&nbsp;this)</pre>");
+                "<pre>java.lang.String&nbsp;nonVoid&#8203;(<a href=\"../typeannos/RcvrB.html\" "
+                + "title=\"annotation in typeannos\">@RcvrB</a>(\"m\") "
+                + "<a href=\"../typeannos/WithFinal.html\" title=\"class in typeannos\">"
+                + "WithFinal</a>&nbsp;afield)</pre>");
 
         checkOutput("typeannos/WithBody.html", true,
-                "<pre>void&nbsp;field(<a href=\"../typeannos/RcvrA.html\" title=\""
+                "<pre>void&nbsp;field&#8203;(<a href=\"../typeannos/RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;WithBody&nbsp;this)</pre>");
 
         checkOutput("typeannos/Generic2.html", true,
-                "<pre>void&nbsp;test2(<a href=\"../typeannos/RcvrA.html\" title=\""
+                "<pre>void&nbsp;test2&#8203;(<a href=\"../typeannos/RcvrA.html\" title=\""
                 + "annotation in typeannos\">@RcvrA</a>&nbsp;Generic2&lt;X&gt;&nbsp;this)</pre>");
 
 
@@ -396,7 +396,7 @@
                 + "\"../typeannos/RepConstructorB.html\" title=\"annotation in typeannos"
                 + "\">@RepConstructorB</a> <a href=\"../typeannos/RepConstructorB.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorB</a>\n"
-                + "RepeatingOnConstructor()</pre>",
+                + "RepeatingOnConstructor&#8203;()</pre>",
 
                 "<pre><a href=\"../typeannos/RepConstructorA.html\" title=\"annotation in typeannos"
                 + "\">@RepConstructorA</a> <a href=\"../typeannos/RepConstructorA.html"
@@ -404,7 +404,7 @@
                 + "\"../typeannos/RepConstructorB.html\" title=\"annotation in typeannos"
                 + "\">@RepConstructorB</a> <a href=\"../typeannos/RepConstructorB.html"
                 + "\" title=\"annotation in typeannos\">@RepConstructorB</a>\n"
-                + "RepeatingOnConstructor(int&nbsp;i,\n                       int&nbsp;j)</pre>",
+                + "RepeatingOnConstructor&#8203;(int&nbsp;i,\n                       int&nbsp;j)</pre>",
 
                 "<pre><a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos"
                 + "\">@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html"
@@ -412,10 +412,10 @@
                 + "<a href=\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos"
                 + "\">@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html"
                 + "\" title=\"annotation in typeannos\">@RepAllContextsB</a>\n"
-                + "RepeatingOnConstructor(int&nbsp;i,\n                       int&nbsp;j,\n"
+                + "RepeatingOnConstructor&#8203;(int&nbsp;i,\n                       int&nbsp;j,\n"
                 + "                       int&nbsp;k)</pre>",
 
-                "<pre>RepeatingOnConstructor(<a href=\"../typeannos/RepParameterA.html"
+                "<pre>RepeatingOnConstructor&#8203;(<a href=\"../typeannos/RepParameterA.html"
                 + "\" title=\"annotation in typeannos\">@RepParameterA</a> <a href="
                 + "\"../typeannos/RepParameterA.html\" title=\"annotation in typeannos"
                 + "\">@RepParameterA</a> <a href=\"../typeannos/RepParameterB.html"
@@ -440,7 +440,7 @@
         checkOutput("typeannos/RepeatingOnConstructor.Inner.html", true,
                 "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnConstructor.Inner.html"
                 + "#Inner-java.lang.String-java.lang.String...-\">Inner</a></span>"
-                + "(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
+                + "&#8203;(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
                 + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
@@ -448,7 +448,7 @@
                 + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> ...&nbsp;vararg)</code>",
 
-                "Inner(<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
+                "Inner&#8203;(<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href="
@@ -574,7 +574,7 @@
         checkOutput("typeannos/RepeatingOnMethod.html", true,
                 "<code>(package private) java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\">"
                 + "<code><span class=\"memberNameLink\"><a href="
-                + "\"../typeannos/RepeatingOnMethod.html#test1--\">test1</a></span>()</code>",
+                + "\"../typeannos/RepeatingOnMethod.html#test1--\">test1</a></span>&#8203;()</code>",
 
                 "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
@@ -584,7 +584,7 @@
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"../typeannos/RepeatingOnMethod.html#test2--\">test2</a>"
-                + "</span>()</code>",
+                + "</span>&#8203;()</code>",
 
                 "<code>(package private) <a href=\"../typeannos/RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
@@ -594,7 +594,7 @@
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String</code>"
                 + "</td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
                 + "<a href=\"../typeannos/RepeatingOnMethod.html#test3--\">test3</a>"
-                + "</span>()</code>",
+                + "</span>&#8203;()</code>",
 
                 "<code>(package private) <a href=\"../typeannos/RepAllContextsA.html\" "
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
@@ -604,11 +604,11 @@
                 + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
                 + "@RepAllContextsB</a> java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\">"
                 + "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnMethod.html"
-                + "#test4--\">test4</a></span>()</code>",
+                + "#test4--\">test4</a></span>&#8203;()</code>",
 
                 "<code><span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnMethod.html"
                 + "#test5-java.lang.String-java.lang.String...-\">test5</a></span>"
-                + "(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
+                + "&#8203;(java.lang.String&nbsp;parameter,\n     java.lang.String <a href="
                 + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
@@ -621,13 +621,13 @@
                 + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html\""
                 + " title=\"annotation in typeannos\">@RepMethodB</a> <a href="
                 + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodB</a>\njava.lang.String&nbsp;test1()",
+                + "@RepMethodB</a>\njava.lang.String&nbsp;test1&#8203;()",
 
                 "<a href=\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html\" title="
                 + "\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" "
-                + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test2()",
+                + "title=\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test2&#8203;()",
 
                 "<a href=\"../typeannos/RepMethodA.html\" title=\"annotation in typeannos\">"
                 + "@RepMethodA</a> <a href=\"../typeannos/RepMethodA.html\" title="
@@ -639,7 +639,7 @@
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
                 + "\"../typeannos/RepTypeUseB.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
-                + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test3()",
+                + "\"annotation in typeannos\">@RepTypeUseB</a> java.lang.String&nbsp;test3&#8203;()",
 
                 "<a href=\"../typeannos/RepAllContextsA.html\" title=\"annotation in typeannos\">"
                 + "@RepAllContextsA</a> <a href=\"../typeannos/RepAllContextsA.html\" "
@@ -652,9 +652,9 @@
                 + "title=\"annotation in typeannos\">@RepAllContextsA</a> <a href="
                 + "\"../typeannos/RepAllContextsB.html\" title=\"annotation in typeannos\">"
                 + "@RepAllContextsB</a> <a href=\"../typeannos/RepAllContextsB.html\" "
-                + "title=\"annotation in typeannos\">@RepAllContextsB</a> java.lang.String&nbsp;test4()",
+                + "title=\"annotation in typeannos\">@RepAllContextsB</a> java.lang.String&nbsp;test4&#8203;()",
 
-                "java.lang.String&nbsp;test5(<a href=\"../typeannos/RepTypeUseA.html\" "
+                "java.lang.String&nbsp;test5&#8203;(<a href=\"../typeannos/RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
                 + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
@@ -684,12 +684,12 @@
                 "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
                 + "\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
-                + "genericMethod-T-\">genericMethod</a></span>(T&nbsp;t)</code>",
+                + "genericMethod-T-\">genericMethod</a></span>&#8203;(T&nbsp;t)</code>",
 
                 "<code>(package private) &lt;T&gt;&nbsp;java.lang.String</code></td>\n"
                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href="
                 + "\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
-                + "genericMethod2-T-\">genericMethod2</a></span>(<a href=\"../typeannos/RepTypeUseA.html"
+                + "genericMethod2-T-\">genericMethod2</a></span>&#8203;(<a href=\"../typeannos/RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseA.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html"
                 + "\" title=\"annotation in typeannos\">@RepTypeUseB</a> <a href=\"../typeannos/RepTypeUseB.html"
@@ -697,9 +697,9 @@
 
                 "<code>(package private) java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\"><code>"
                 + "<span class=\"memberNameLink\"><a href=\"../typeannos/RepeatingOnTypeParametersBoundsTypeArgumentsOnMethod.html#"
-                + "test--\">test</a></span>()</code>",
+                + "test--\">test</a></span>&#8203;()</code>",
 
-                "java.lang.String&nbsp;test(<a href=\"../typeannos/RepTypeUseA.html\" "
+                "java.lang.String&nbsp;test&#8203;(<a href=\"../typeannos/RepTypeUseA.html\" "
                 + "title=\"annotation in typeannos\">@RepTypeUseA</a> <a href="
                 + "\"../typeannos/RepTypeUseA.html\" title=\"annotation in typeannos\">"
                 + "@RepTypeUseA</a> <a href=\"../typeannos/RepTypeUseB.html\" title="
@@ -718,6 +718,6 @@
                 + "\"annotation in typeannos\">@RepMethodA</a>\n<a href=\"../typeannos/RepMethodB.html"
                 + "\" title=\"annotation in typeannos\">@RepMethodB</a> <a href="
                 + "\"../typeannos/RepMethodB.html\" title=\"annotation in typeannos\">"
-                + "@RepMethodB</a>\nvoid&nbsp;test()");
+                + "@RepMethodB</a>\nvoid&nbsp;test&#8203;()");
     }
 }
diff --git a/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Receivers.java b/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Receivers.java
index a46dd39..7bc3f5c 100644
--- a/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Receivers.java
+++ b/langtools/test/jdk/javadoc/doclet/testTypeAnnotations/typeannos/Receivers.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,11 +53,12 @@
 }
 
 class WithFinal {
-    void plain(final @RcvrB("m") WithFinal this) { }
-    <T> void generic(final @RcvrB("m") WithFinal this) { }
-    void withException(final @RcvrB("m") WithFinal this) throws Exception { }
-    String nonVoid(final @RcvrB("m") WithFinal this) { return null; }
-    <T extends Runnable> void accept(final @RcvrB("m") WithFinal this, T r) throws Exception { }
+    WithFinal afield;
+    void plain(final @RcvrB("m") WithFinal afield) { }
+    <T> void generic(final @RcvrB("m") WithFinal afield) { }
+    void withException(final @RcvrB("m") WithFinal afield) throws Exception { }
+    String nonVoid(final @RcvrB("m") WithFinal afield) { return null; }
+    <T extends Runnable> void accept(final @RcvrB("m") WithFinal afield, T r) throws Exception { }
 }
 
 class WithBody {
diff --git a/langtools/test/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java b/langtools/test/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java
new file mode 100644
index 0000000..9d1672f
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8174805
+ * @summary JavacTrees should use Types.skipTypeVars() to get the upper bound of type variables
+ * @library ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build JavadocTester
+ * @run main TestTypeVariableLinks
+ */
+
+public class TestTypeVariableLinks extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestTypeVariableLinks tester = new TestTypeVariableLinks();
+        tester.runTests();
+    }
+
+    @Test
+    void test1() {
+        javadoc("-d", "out", "-sourcepath", testSrc, "-package", "pkg1");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg1/C.html", true,
+                "<div class=\"block\">Linking to Object.equals() <code>Object.equals(Object)</code></div>");
+        checkOutput("pkg1/C.html", true,
+                "<div class=\"block\">Linking to List.clear() <code>List.clear()</code></div>");
+        checkOutput("pkg1/C.html", true,
+                "<div class=\"block\">Linking to Additional.doAction() <a href=\"../pkg1/Additional.html#doAction--\"><code>Additional.doAction()</code></a></div>");
+        checkOutput("pkg1/C.html", true,
+                "<div class=\"block\">Linking to I.abstractAction() <a href=\"../pkg1/I.html#abstractAction--\"><code>I.abstractAction()</code></a></div>");
+    }
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testTypeVariableLinks/pkg1/C.java b/langtools/test/jdk/javadoc/doclet/testTypeVariableLinks/pkg1/C.java
new file mode 100644
index 0000000..5a16761
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testTypeVariableLinks/pkg1/C.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg1;
+
+import java.util.List;
+
+public class C<T, F extends List<String>, G extends Additional & I> {
+    /**
+     * Linking to Object.equals() {@link T#equals(Object)}
+     */
+    public void m1() {}
+    /**
+     * Linking to List.clear() {@link F#clear()}
+     */
+    public void m2() {}
+    /**
+     * Linking to Additional.doAction() {@link G#doAction()}
+     */
+    public void m3() {}
+    /**
+     * Linking to I.abstractAction() {@link G#abstractAction()}
+     */
+    public void m4() {}
+}
+
+class Additional {
+    public void doAction() {}
+}
+
+interface I {
+    void abstractAction();
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testUseOption/TestUseOption.java b/langtools/test/jdk/javadoc/doclet/testUseOption/TestUseOption.java
index 409969b..cc1e634 100644
--- a/langtools/test/jdk/javadoc/doclet/testUseOption/TestUseOption.java
+++ b/langtools/test/jdk/javadoc/doclet/testUseOption/TestUseOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4496290 4985072 7006178 7068595 8016328 8050031 8048351 8081854 8071982 8162363
+ * @bug 4496290 4985072 7006178 7068595 8016328 8050031 8048351 8081854 8071982 8162363 8175200
  * @summary A simple test to ensure class-use files are correct.
  * @author jamieh
  * @library ../lib
@@ -134,7 +134,7 @@
             "<td class=\"colFirst\"><code>void</code></td>\n<th class=\"colSecond\" scope=\"row\"><span class="
             + "\"typeNameLabel\">C1.</span><code><span class=\"memberNameLink\">"
             + "<a href=\"../../pkg1/C1.html#methodInC1ThrowsThrowable--\">methodInC1ThrowsThrowable"
-            + "</a></span>()</code></th>"
+            + "</a></span>&#8203;()</code></th>"
         );
     }
 
diff --git a/langtools/test/jdk/javadoc/doclet/testUserTaglet/InfoTaglet.java b/langtools/test/jdk/javadoc/doclet/testUserTaglet/InfoTaglet.java
new file mode 100644
index 0000000..19d4ee8
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testUserTaglet/InfoTaglet.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
+import javax.lang.model.element.Element;
+
+import jdk.javadoc.doclet.Doclet;
+import jdk.javadoc.doclet.DocletEnvironment;
+import jdk.javadoc.doclet.Taglet;
+import static jdk.javadoc.doclet.Taglet.Location.*;
+
+import com.sun.source.doctree.DocTree;
+
+/**
+ * A taglet to test access to a taglet's context.
+ */
+public class InfoTaglet implements Taglet {
+    private DocletEnvironment env;
+    private Doclet doclet;
+
+    @Override
+    public void init(DocletEnvironment env, Doclet doclet) {
+        this.env = env;
+        this.doclet = doclet;
+    }
+
+    @Override
+    public Set<Location> getAllowedLocations() {
+        return EnumSet.of(TYPE);
+    }
+
+    @Override
+    public boolean isInlineTag() {
+        return false;
+    }
+
+    @Override
+    public String getName() {
+        return "info";
+    }
+
+    @Override
+    public String toString(List<? extends DocTree> tags, Element element) {
+        // The content lines below are primarily to help verify the element
+        // and the values passed to init.
+        return "<dt>"
+                +"<span class=\"simpleTagLabel\">Info:</span>\n"
+                + "</dt>"
+                + "<dd>"
+                + "<ul>\n"
+                + "<li>Element: " + element.getKind() + " " + element.getSimpleName() + "\n"
+                + "<li>Element supertypes: " +
+                        env.getTypeUtils().directSupertypes(element.asType()) + "\n"
+                + "<li>Doclet: " + doclet.getClass() + "\n"
+                + "</ul>\n"
+                + "</dd>";
+    }
+}
+
diff --git a/langtools/test/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java b/langtools/test/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java
new file mode 100644
index 0000000..4451d5c
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug      8176836
+ * @summary  Provide Taglet with context
+ * @library  ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build    JavadocTester InfoTaglet
+ * @run main TestUserTaglet
+ */
+
+public class TestUserTaglet extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestUserTaglet tester = new TestUserTaglet();
+        tester.runTests();
+    }
+
+    @Test
+    void test() {
+        javadoc("-d", "out",
+                "-sourcepath", testSrc,
+                "-tagletpath", System.getProperty("test.class.path"),
+                "-taglet", "InfoTaglet",
+                "pkg");
+        checkExit(Exit.OK);
+
+        // The following checks verify that information was successfully
+        // derived from the context information available to the taglet.
+        checkOutput("pkg/C.html", true,
+            "<li>Element: CLASS C",
+            "<li>Element supertypes: [java.lang.Object]",
+            "<li>Doclet: class jdk.javadoc.internal.doclets.formats.html.HtmlDoclet"
+        );
+    }
+}
diff --git a/langtools/test/jdk/javadoc/doclet/testUserTaglet/pkg/C.java b/langtools/test/jdk/javadoc/doclet/testUserTaglet/pkg/C.java
new file mode 100644
index 0000000..ea52594
--- /dev/null
+++ b/langtools/test/jdk/javadoc/doclet/testUserTaglet/pkg/C.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+/** @info */
+public class C { }
+
diff --git a/langtools/test/jdk/javadoc/doclet/testXOption/TestXOption.java b/langtools/test/jdk/javadoc/doclet/testXOption/TestXOption.java
index 422c840..5997735 100644
--- a/langtools/test/jdk/javadoc/doclet/testXOption/TestXOption.java
+++ b/langtools/test/jdk/javadoc/doclet/testXOption/TestXOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,16 @@
     }
 
     @Test
+    void testWithHelpExtraOption() {
+        javadoc("-d", "out1",
+                "-sourcepath", testSrc,
+                "--help-extra",
+                testSrc("TestXOption.java"));
+        checkExit(Exit.OK);
+        checkOutput(true);
+    }
+
+    @Test
     void testWithOption() {
         javadoc("-d", "out1",
                 "-sourcepath", testSrc,
diff --git a/langtools/test/jdk/javadoc/tool/BadOptionsTest.java b/langtools/test/jdk/javadoc/tool/BadOptionsTest.java
index 28ddf3b..ed0a947 100644
--- a/langtools/test/jdk/javadoc/tool/BadOptionsTest.java
+++ b/langtools/test/jdk/javadoc/tool/BadOptionsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8169676
+ * @bug 8169676 8175055
  * @summary boolean result of Option.process is often ignored
  * @modules jdk.compiler/com.sun.tools.javac.api
  * @modules jdk.compiler/com.sun.tools.javac.main
@@ -37,20 +37,6 @@
 import java.io.IOException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Locale;
-import java.util.Objects;
-import java.util.Set;
-
-import javax.lang.model.SourceVersion;
-
-import jdk.javadoc.doclet.Doclet;
-import jdk.javadoc.doclet.DocletEnvironment;
-import jdk.javadoc.doclet.Reporter;
 
 import toolbox.JavadocTask;
 import toolbox.ModuleBuilder;
@@ -146,6 +132,25 @@
         checkNotFound(result, "Exception", "at jdk.javadoc/");
     }
 
+    @Test
+    public void testSourcePathAndModuleSourceConflict() throws IOException {
+        Path msrc = Paths.get("msrc");
+        new ModuleBuilder(tb, "m1")
+                .exports("p1")
+                .classes("package p1; public class C1 { }")
+                .write(msrc);
+        Task.Result result = new JavadocTask(tb, Task.Mode.CMDLINE)
+                .options("-sourcepath", "src",
+                        "--module-source-path", msrc.getFileName().toString(),
+                        "--module", "m1")
+                .run(Task.Expect.FAIL)
+                .writeAll();
+        checkFound(result.getOutput(Task.OutputKind.DIRECT),
+                "javadoc: cannot specify both --source-path and --module-source-path");
+        checkFound(result.getOutput(Task.OutputKind.DIRECT),
+                "1 error");
+    }
+
     private void checkFound(String log, String... expect) {
         for (String e : expect) {
             if (!log.contains(e)) {
diff --git a/langtools/test/jdk/javadoc/tool/CheckResourceKeys.java b/langtools/test/jdk/javadoc/tool/CheckResourceKeys.java
index e1df11e..898a8fc 100644
--- a/langtools/test/jdk/javadoc/tool/CheckResourceKeys.java
+++ b/langtools/test/jdk/javadoc/tool/CheckResourceKeys.java
@@ -33,8 +33,6 @@
  */
 
 import java.io.*;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 import javax.tools.*;
 import com.sun.tools.classfile.*;
@@ -265,7 +263,7 @@
      * Get the set of keys from the javadoc resource bundles.
      */
     Set<String> getResourceKeys() {
-        Module jdk_javadoc = Layer.boot().findModule("jdk.javadoc").get();
+        Module jdk_javadoc = ModuleLayer.boot().findModule("jdk.javadoc").get();
         String[] names = {
                 "jdk.javadoc.internal.doclets.formats.html.resources.standard",
                 "jdk.javadoc.internal.doclets.toolkit.resources.doclets",
diff --git a/langtools/test/jdk/javadoc/tool/EnsureNewOldDoclet.java b/langtools/test/jdk/javadoc/tool/EnsureNewOldDoclet.java
index fe3b2f9..1dfc19f 100644
--- a/langtools/test/jdk/javadoc/tool/EnsureNewOldDoclet.java
+++ b/langtools/test/jdk/javadoc/tool/EnsureNewOldDoclet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8035473 8154482 8154399 8159096
+ * @bug 8035473 8154482 8154399 8159096 8176131 8176331
  * @summary make sure the javadoc tool responds correctly to Xold,
  *          old doclets and taglets.
  * @library /tools/lib
@@ -40,6 +40,7 @@
 import java.util.Set;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
+import javax.lang.model.element.Element;
 
 import com.sun.javadoc.Tag;
 import com.sun.source.doctree.DocTree;
@@ -87,7 +88,7 @@
             CLASS_NAME + "\\$OldTaglet.*");
 
     final static String OLD_STDDOCLET = "com.sun.tools.doclets.standard.Standard";
-    final static String NEW_STDDOCLET = "jdk.javadoc.doclets.StandardDoclet";
+    final static String NEW_STDDOCLET = "jdk.javadoc.doclet.StandardDoclet";
 
 
     public EnsureNewOldDoclet() throws Exception {
@@ -186,7 +187,7 @@
                 "-tagletpath",
                 testClasses,
                 testSrc.toString());
-        Task.Result tr = task.run(Task.Expect.FAIL, 1);
+        Task.Result tr = task.run(Task.Expect.FAIL, 1).writeAll();
         //Task.Result tr = task.run();
         List<String> out = tr.getOutputLines(Task.OutputKind.STDOUT);
         List<String> err = tr.getOutputLines(Task.OutputKind.STDERR);
@@ -340,7 +341,7 @@
         }
     }
 
-    public static class NewTaglet implements jdk.javadoc.doclet.taglet.Taglet {
+    public static class NewTaglet implements jdk.javadoc.doclet.Taglet {
 
         @Override
         public Set<Location> getAllowedLocations() {
@@ -358,12 +359,7 @@
         }
 
         @Override
-        public String toString(DocTree tag) {
-            return tag.toString();
-        }
-
-        @Override
-        public String toString(List<? extends DocTree> tags) {
+        public String toString(List<? extends DocTree> tags, Element element) {
             return tags.toString();
         }
 
diff --git a/langtools/test/jdk/javadoc/tool/IgnoreSourceErrors.java b/langtools/test/jdk/javadoc/tool/IgnoreSourceErrors.java
new file mode 100644
index 0000000..6c79492
--- /dev/null
+++ b/langtools/test/jdk/javadoc/tool/IgnoreSourceErrors.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8175219
+ * @summary test --ignore-errors works correctly
+ * @modules
+ *      jdk.javadoc/jdk.javadoc.internal.api
+ *      jdk.javadoc/jdk.javadoc.internal.tool
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @library /tools/lib
+ * @build toolbox.ToolBox toolbox.TestRunner
+ * @run main IgnoreSourceErrors
+ */
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.Arrays;
+
+import toolbox.*;
+import toolbox.Task.*;
+
+/**
+ * Dummy javadoc comment.
+ */
+public class IgnoreSourceErrors  extends TestRunner {
+
+    final ToolBox tb;
+    final Path testSrc;
+
+    public IgnoreSourceErrors() throws IOException {
+        super(System.err);
+        tb = new ToolBox();
+        testSrc = Paths.get("Foo.java");
+        emitSample(testSrc);
+    }
+
+    public static void main(String... args) throws Exception {
+        new IgnoreSourceErrors().runTests();
+    }
+
+    @Test
+    public void runIgnoreErrorsOffByDefault() throws Exception {
+        JavadocTask task = new JavadocTask(tb, Task.Mode.CMDLINE);
+        task.options(testSrc.toString());
+        Task.Result result = task.run(Expect.FAIL);
+        String out = result.getOutput(OutputKind.DIRECT);
+        if (!out.contains("modifier static not allowed here")) {
+            throw new Exception("expected string not found \'modifier static not allowed here\'");
+        }
+    }
+
+    @Test
+    public void runIgnoreErrorsOn() throws Exception {
+        JavadocTask task = new JavadocTask(tb, Task.Mode.CMDLINE);
+        task.options("--ignore-source-errors", testSrc.toString());
+        Task.Result result = task.run(Expect.SUCCESS);
+        String out = result.getOutput(OutputKind.DIRECT);
+        if (!out.contains("modifier static not allowed here")) {
+            throw new Exception("expected string not found \'modifier static not allowed here\'");
+        }
+    }
+
+    void emitSample(Path file) throws IOException {
+        String[] contents = {
+            "/** A java file with errors */",
+            "public static class Foo {}"
+        };
+        Files.write(file, Arrays.asList(contents), StandardOpenOption.CREATE);
+    }
+}
diff --git a/langtools/test/jdk/javadoc/tool/ReleaseOption.java b/langtools/test/jdk/javadoc/tool/ReleaseOption.java
index b2f07b1..766d198 100644
--- a/langtools/test/jdk/javadoc/tool/ReleaseOption.java
+++ b/langtools/test/jdk/javadoc/tool/ReleaseOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
     }
 
     void run() {
-        doRunTest(OK, out -> out.contains("compiler.err.doesnt.exist: java.util.stream"), "--release", "7");
+        doRunTest(ERROR, out -> out.contains("compiler.err.doesnt.exist: java.util.stream"), "--release", "7");
         doRunTest(OK, out -> !out.contains("compiler.err.doesnt.exist: java.util.stream"), "--release", "8");
         doRunTest(CMDERR, out -> true, "--release", "7", "-source", "7");
         doRunTest(CMDERR, out -> true, "--release", "7", "-bootclasspath", "any");
diff --git a/langtools/test/jdk/javadoc/tool/T6551367.java b/langtools/test/jdk/javadoc/tool/T6551367.java
index 2504750..025dffe 100644
--- a/langtools/test/jdk/javadoc/tool/T6551367.java
+++ b/langtools/test/jdk/javadoc/tool/T6551367.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,8 +37,6 @@
 
 import jdk.javadoc.doclet.DocletEnvironment;
 
-import static jdk.javadoc.internal.tool.Main.execute;
-
 public class T6551367 {
     public T6551367() {}
     public boolean run(DocletEnvironment root) {
@@ -59,7 +57,7 @@
                 destDir.getAbsolutePath()
             };
 
-            int rc = execute(array);
+            int rc = jdk.javadoc.internal.tool.Main.execute(array);
             if (rc != 0)
                 throw new Error("unexpected exit from javadoc: " + rc);
         }
diff --git a/langtools/test/jdk/javadoc/tool/api/basic/AddModulesTest.java b/langtools/test/jdk/javadoc/tool/api/basic/AddModulesTest.java
new file mode 100644
index 0000000..fcc71da
--- /dev/null
+++ b/langtools/test/jdk/javadoc/tool/api/basic/AddModulesTest.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173596
+ * @summary DocumentationTool.DocumentationTask should support addModules
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.main
+ * @library /tools/lib
+ * @build APITest toolbox.JavacTask toolbox.ToolBox
+ * @run main AddModulesTest
+ */
+
+import java.io.StringWriter;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+
+import javax.tools.DocumentationTool;
+import javax.tools.DocumentationTool.DocumentationTask;
+import javax.tools.DocumentationTool.Location;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
+import toolbox.Assert;
+import toolbox.JavacTask;
+import toolbox.ToolBox;
+
+/**
+ * Tests for DocumentationTask.addModules method.
+ */
+public class AddModulesTest extends APITest {
+    public static void main(String... args) throws Exception {
+        new AddModulesTest().run();
+    }
+
+    private final ToolBox tb = new ToolBox();
+
+    /**
+     * Verify that addModules works as expected.
+     */
+    @Test
+    public void testAddModules() throws Exception {
+        Path base = Paths.get("testAddModules");
+        Path src = base.resolve("src");
+
+        // setup some utility modules
+        Path src_m1 = src.resolve("m1x");
+        tb.writeJavaFiles(src_m1,
+                          "module m1x { exports p1; }",
+                          "package p1; public class C1 { }");
+        Path src_m2 = src.resolve("m2x");
+        tb.writeJavaFiles(src_m2,
+                          "module m2x { exports p2; }",
+                          "package p2; public class C2 { }");
+        Path modules = base.resolve("modules");
+        tb.createDirectories(modules);
+
+        new JavacTask(tb)
+                .options("--module-source-path", src.toString())
+                .outdir(modules)
+                .files(tb.findJavaFiles(src))
+                .run()
+                .writeAll();
+
+        // now test access to the modules
+        Path src2 = base.resolve("src2");
+        tb.writeJavaFiles(src2,
+                          "public class Dummy { p1.C1 c1; p2.C2 c2; }");
+        Path api = base.resolve("api");
+        tb.createDirectories(api);
+
+        DocumentationTool tool = ToolProvider.getSystemDocumentationTool();
+        try (StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null)) {
+            fm.setLocationFromPaths(StandardLocation.MODULE_PATH, Arrays.asList(modules));
+            fm.setLocationFromPaths(Location.DOCUMENTATION_OUTPUT, Arrays.asList(api));
+            Iterable<? extends JavaFileObject> files = fm.getJavaFileObjects(tb.findJavaFiles(src2));
+
+            for (boolean useOption : new boolean[] { false, true }) {
+                System.err.println("Use --add-modules option: " + useOption);
+                StringWriter sw = new StringWriter();
+                DocumentationTask t = tool.getTask(sw, fm, null, null, null, files);
+                if (useOption) {
+                    t.addModules(Arrays.asList("m1x", "m2x"));
+                }
+                String out;
+                boolean ok;
+                try {
+                    ok = t.call();
+                } finally {
+                    out = sw.toString();
+                    System.err.println(out);
+                }
+                System.err.println("ok: " + ok);
+                boolean expectErrors = !useOption;
+                check(out, "package p1 is not visible", expectErrors);
+                check(out, "package p2 is not visible", expectErrors);
+                System.err.println();
+            }
+        }
+    }
+
+    void check(String out, String text, boolean expected) {
+        System.err.println("Checking for "
+            + (expected ? "expected" : "unexpected")
+            + " text: " + text);
+
+        if (expected) {
+            if (!out.contains(text)) {
+                error("expected text not found: " + text);
+            }
+        } else {
+            if (out.contains(text)) {
+                error("unexpected text found: " + text);
+            }
+        }
+    }
+}
+
diff --git a/langtools/test/jdk/javadoc/tool/api/basic/taglets/UnderlineTaglet.java b/langtools/test/jdk/javadoc/tool/api/basic/taglets/UnderlineTaglet.java
index b641472..0cac9a3 100644
--- a/langtools/test/jdk/javadoc/tool/api/basic/taglets/UnderlineTaglet.java
+++ b/langtools/test/jdk/javadoc/tool/api/basic/taglets/UnderlineTaglet.java
@@ -1,51 +1,37 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
+ * 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.
  *
- * -Redistributions of source code must retain the above copyright
- *  notice, this list of conditions and the following disclaimer.
+ * 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).
  *
- * -Redistribution in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in
- *  the documentation and/or other materials provided with the
- *  distribution.
+ * 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.
  *
- * Neither the name of Oracle nor the names of
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any
- * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
- * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
- * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
- * DAMAGES OR LIABILITIES  SUFFERED BY LICENSEE AS A RESULT OF OR
- * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR
- * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
- * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
- * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
- * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
- * THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that Software is not designed, licensed or
- * intended for use in the design, construction, operation or
- * maintenance of any nuclear facility.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
  */
 
 import java.util.EnumSet;
 import java.util.List;
 import java.util.Set;
+import javax.lang.model.element.Element;
 
 import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.TextTree;
 import com.sun.source.doctree.UnknownBlockTagTree;
 import com.sun.source.doctree.UnknownInlineTagTree;
 import com.sun.source.util.SimpleDocTreeVisitor;
-import jdk.javadoc.doclet.taglet.Taglet;
+import jdk.javadoc.doclet.Taglet;
 
 /**
  * A sample Inline Taglet representing {@underline ...}. This tag can
@@ -85,22 +71,13 @@
     }
 
     /**
-     * Given the <code>Tag</code> representation of this custom
+     * Given the <code>DocTree</code> representation of this custom
      * tag, return its string representation.
-     * @param tag he <code>Tag</code> representation of this custom tag.
+     * @param tags the list of trees representing of this custom tag.
+     * @param element the declaration to which the enclosing comment belongs
      */
-    public String toString(DocTree tag) {
-        return "<u>" + getText(tag) + "</u>";
-    }
-
-    /**
-     * This method should not be called since arrays of inline tags do not
-     * exist.  Method {@link #tostring(Tag)} should be used to convert this
-     * inline tag to a string.
-     * @param tags the array of <code>Tag</code>s representing of this custom tag.
-     */
-    public String toString(List<? extends DocTree> tags) {
-        return null;
+    public String toString(List<? extends DocTree> tags, Element element) {
+        return "<u>" + getText(tags.get(0)) + "</u>";
     }
 
     static String getText(DocTree dt) {
diff --git a/langtools/test/jdk/javadoc/tool/badSuper/BadSuper.java b/langtools/test/jdk/javadoc/tool/badSuper/BadSuper.java
index 4e77bc8..dfb2c45 100644
--- a/langtools/test/jdk/javadoc/tool/badSuper/BadSuper.java
+++ b/langtools/test/jdk/javadoc/tool/badSuper/BadSuper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
         String srcpath = System.getProperty("test.src", ".");
 
         if (jdk.javadoc.internal.tool.Main.execute(
-                new String[] {"-d", "doc", "-sourcepath", srcpath, "p"}) != 0)
-            throw new Error("Javadoc encountered warnings or errors.");
+                new String[] {"-d", "doc", "-sourcepath", srcpath, "p"}) == 0)
+            throw new Error("Javadoc passed unexpectedly");
     }
 }
diff --git a/langtools/test/jdk/javadoc/tool/modules/CommandLineFiles.java b/langtools/test/jdk/javadoc/tool/modules/CommandLineFiles.java
new file mode 100644
index 0000000..006a648
--- /dev/null
+++ b/langtools/test/jdk/javadoc/tool/modules/CommandLineFiles.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8176539
+ * @summary Test use case when all java files are listed
+ * @modules
+ *      jdk.javadoc/jdk.javadoc.internal.api
+ *      jdk.javadoc/jdk.javadoc.internal.tool
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @library /tools/lib
+ * @build toolbox.ToolBox toolbox.TestRunner
+ * @run main CommandLineFiles
+ */
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import toolbox.*;
+
+public class CommandLineFiles extends ModuleTestBase {
+
+    public static void main(String... args) throws Exception {
+        new CommandLineFiles().runTests();
+    }
+
+    @Test
+    public void testExplicitJavaFiles(Path base) throws Exception {
+        Path src = Paths.get(base.toString(), "src");
+        Path mpath = Paths.get(src. toString(), "m");
+
+        tb.writeJavaFiles(mpath,
+                "module m { exports p; }",
+                "package p; public class C { }");
+
+        List<String> cmdList = new ArrayList<>();
+        cmdList.add("--source-path");
+        cmdList.add(mpath.toString());
+        Arrays.asList(tb.findJavaFiles(src)).stream()
+                .map(Path::toString)
+                .collect(Collectors.toCollection(() -> cmdList));
+        execTask(cmdList.toArray(new String[cmdList.size()]));
+        assertMessageNotPresent("warning:");
+    }
+
+}
diff --git a/langtools/test/jdk/javadoc/tool/modules/MissingSourceModules.java b/langtools/test/jdk/javadoc/tool/modules/MissingSourceModules.java
new file mode 100644
index 0000000..9da055a
--- /dev/null
+++ b/langtools/test/jdk/javadoc/tool/modules/MissingSourceModules.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176481
+ * @summary Tests behavior of the tool, when modules are present as
+ *          binaries.
+ * @modules
+ *      jdk.javadoc/jdk.javadoc.internal.api
+ *      jdk.javadoc/jdk.javadoc.internal.tool
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @library /tools/lib
+ * @build toolbox.ToolBox toolbox.TestRunner
+ * @run main MissingSourceModules
+ */
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import toolbox.*;
+
+public class MissingSourceModules extends ModuleTestBase {
+
+    public static void main(String... args) throws Exception {
+        new MissingSourceModules().runTests();
+    }
+
+    @Test
+    public void testExplicitBinaryModuleOnModulePath(Path base) throws Exception {
+        Path modulePath = base.resolve("modules");
+
+        ModuleBuilder ma = new ModuleBuilder(tb, "ma");
+        ma.comment("Module ma.")
+                .exports("pkg1")
+                .classes("package pkg1; /** Class A */ public class A { }")
+                .classes("package pkg1.pkg2; /** Class B */ public class B { }")
+                .build(modulePath);
+
+        execNegativeTask("--module-path", modulePath.toString(),
+                "--module", "ma");
+        assertMessagePresent("module ma not found.");
+    }
+
+    @Test
+    public void testExplicitBinaryModuleOnLegacyPaths(Path base) throws Exception {
+        Path modulePath = base.resolve("modules");
+
+        ModuleBuilder ma = new ModuleBuilder(tb, "ma");
+        ma.comment("Module ma.")
+                .exports("pkg1")
+                .classes("package pkg1; /** Class A */ public class A { }")
+                .classes("package pkg1.pkg2; /** Class B */ public class B { }")
+                .build(modulePath);
+
+        Path mPath = Paths.get(modulePath.toString(), "ma");
+        execNegativeTask("--source-path", mPath.toString(),
+                "--module", "ma");
+        assertMessagePresent("module ma not found.");
+
+        execNegativeTask("--class-path", mPath.toString(),
+                "--module", "ma");
+        assertMessagePresent("module ma not found.");
+    }
+
+    @Test
+    public void testImplicitBinaryRequiresModule(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path modulePath = base.resolve("modules");
+
+        ModuleBuilder mb = new ModuleBuilder(tb, "mb");
+        mb.comment("Module mb.")
+                .exports("pkgb")
+                .classes("package pkgb; /** Class A */ public class A { }")
+                .build(modulePath);
+
+        ModuleBuilder ma = new ModuleBuilder(tb, "ma");
+        ma.comment("Module ma.")
+                .exports("pkga")
+                .requires("mb", modulePath)
+                .classes("package pkga; /** Class A */ public class A { }")
+                .write(src);
+
+        execTask("--module-path", modulePath.toString(),
+                "--module-source-path", src.toString(),
+                "--expand-requires", "all",
+                "--module", "ma");
+        assertMessagePresent("module mb not found.");
+    }
+
+    @Test
+    public void testImplicitBinaryTransitiveModule(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path modulePath = base.resolve("modules");
+
+        ModuleBuilder mb = new ModuleBuilder(tb, "mb");
+        mb.comment("Module mb.")
+                .exports("pkgb")
+                .classes("package pkgb; /** Class A */ public class A { }")
+                .build(modulePath);
+
+        ModuleBuilder ma = new ModuleBuilder(tb, "ma");
+        ma.comment("Module ma.")
+                .exports("pkga")
+                .requiresTransitive("mb", modulePath)
+                .classes("package pkga; /** Class A */ public class A { }")
+                .write(src);
+
+        execTask("--module-path", modulePath.toString(),
+                "--module-source-path", src.toString(),
+                "--expand-requires", "transitive",
+                "--module", "ma");
+        assertMessagePresent("module mb not found.");
+    }
+}
diff --git a/langtools/test/jdk/javadoc/tool/modules/ModuleTestBase.java b/langtools/test/jdk/javadoc/tool/modules/ModuleTestBase.java
index b2fc0ce..ff3cbfc 100644
--- a/langtools/test/jdk/javadoc/tool/modules/ModuleTestBase.java
+++ b/langtools/test/jdk/javadoc/tool/modules/ModuleTestBase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Arrays;
-import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Set;
@@ -158,6 +158,12 @@
         }
     }
 
+    void checkTypesSelected(String... args) throws Exception {
+        for (String arg : args) {
+            checkDocletOutputPresent("Selected", ElementKind.CLASS, arg);
+        }
+    }
+
     void checkMembersSelected(String... args) throws Exception {
         for (String arg : args) {
             checkDocletOutputPresent("Selected", ElementKind.METHOD, arg);
@@ -180,10 +186,14 @@
         assertPresent(regex, STDOUT);
     }
 
-    void assertErrorPresent(String regex) throws Exception {
+    void assertMessagePresent(String regex) throws Exception {
         assertPresent(regex, Task.OutputKind.DIRECT);
     }
 
+    void assertMessageNotPresent(String regex) throws Exception {
+        assertNotPresent(regex, Task.OutputKind.DIRECT);
+    }
+
     void assertPresent(String regex, Task.OutputKind kind) throws Exception {
         List<String> foundList = tb.grep(regex, currentTask.getOutputLines(kind));
         if (foundList.isEmpty()) {
@@ -192,6 +202,14 @@
         }
     }
 
+    void assertNotPresent(String regex, Task.OutputKind kind) throws Exception {
+        List<String> foundList = tb.grep(regex, currentTask.getOutputLines(kind));
+        if (!foundList.isEmpty()) {
+            dumpDocletDiagnostics();
+            throw new Exception(regex + " found in: " + kind);
+        }
+    }
+
     void dumpDocletDiagnostics() {
         for (Task.OutputKind kind : Task.OutputKind.values()) {
             String output = currentTask.getOutput(kind);
@@ -268,6 +286,17 @@
         StringWriter sw = new StringWriter();
         PrintWriter ps = new PrintWriter(sw);
 
+        DocletEnvironment docEnv = null;
+
+        boolean hasDocComments = false;
+
+        String hasDocComments(Element e) {
+            String comment = docEnv.getElementUtils().getDocComment(e);
+            return comment != null && !comment.isEmpty()
+                    ? "hasDocComments"
+                    : "noDocComments";
+        }
+
         // csv style output, for simple regex verification
         void printDataSet(String header, Set<? extends Element> set) {
             for (Element e : set) {
@@ -278,7 +307,12 @@
                         ps.print(FS);
                         ps.print(e.getKind());
                         ps.print(FS);
-                        ps.println(e.getQualifiedName());
+                        ps.print(e.getQualifiedName());
+                        if (hasDocComments) {
+                            ps.print(FS);
+                            ps.print(hasDocComments(e));
+                        }
+                        ps.println();
                         return null;
                     }
 
@@ -287,7 +321,12 @@
                         ps.print(FS);
                         ps.print(e.getKind());
                         ps.print(FS);
-                        ps.println(e.getQualifiedName());
+                        ps.print(e.getQualifiedName());
+                        if (hasDocComments) {
+                            ps.print(FS);
+                            ps.print(hasDocComments(e));
+                        }
+                        ps.println();
                         return null;
                     }
 
@@ -296,7 +335,12 @@
                         ps.print(FS);
                         ps.print(ElementKind.CLASS);
                         ps.print(FS);
-                        ps.println(e.getQualifiedName());
+                        ps.print(e.getQualifiedName());
+                        if (hasDocComments) {
+                            ps.print(FS);
+                            ps.print(hasDocComments(e));
+                        }
+                        ps.println();
                         return null;
                     }
 
@@ -326,7 +370,12 @@
                         ps.print(FS);
                         ps.print(fqn);
                         ps.print(".");
-                        ps.println(e.getSimpleName());
+                        ps.print(e.getSimpleName());
+                        if (hasDocComments) {
+                            ps.print(FS);
+                            ps.print(hasDocComments(e));
+                        }
+                        ps.println();
                         return null;
                     }
                 }.visit(e);
@@ -335,6 +384,7 @@
 
         @Override
         public boolean run(DocletEnvironment docenv) {
+            this.docEnv = docenv;
             ps.println("ModuleMode" + FS + docenv.getModuleMode());
             printDataSet("Specified", docenv.getSpecifiedElements());
             printDataSet("Included", docenv.getIncludedElements());
@@ -357,7 +407,9 @@
                 addEnclosedElements(docenv, result, me);
             }
             for (PackageElement pe : ElementFilter.packagesIn(elements)) {
-                addEnclosedElements(docenv, result, docenv.getElementUtils().getModuleOf(pe));
+                ModuleElement mdle = docenv.getElementUtils().getModuleOf(pe);
+                if (mdle != null)
+                    addEnclosedElements(docenv, result, mdle);
                 addEnclosedElements(docenv, result, pe);
             }
             for (TypeElement te : ElementFilter.typesIn(elements)) {
@@ -378,7 +430,45 @@
 
         @Override
         public Set<Doclet.Option> getSupportedOptions() {
-            return Collections.emptySet();
+            Option[] options = {
+                new Option() {
+                    private final List<String> someOption = Arrays.asList(
+                            "-hasDocComments"
+                    );
+
+                    @Override
+                    public int getArgumentCount() {
+                        return 0;
+                    }
+
+                    @Override
+                    public String getDescription() {
+                        return "print disposition of doc comments on an element";
+                    }
+
+                    @Override
+                    public Option.Kind getKind() {
+                        return Option.Kind.STANDARD;
+                    }
+
+                    @Override
+                    public List<String> getNames() {
+                        return someOption;
+                    }
+
+                    @Override
+                    public String getParameters() {
+                        return "flag";
+                    }
+
+                    @Override
+                    public boolean process(String opt, List<String> arguments) {
+                        hasDocComments = true;
+                        return true;
+                    }
+                }
+            };
+            return new HashSet<>(Arrays.asList(options));
         }
 
         @Override
diff --git a/langtools/test/jdk/javadoc/tool/modules/Modules.java b/langtools/test/jdk/javadoc/tool/modules/Modules.java
index 2af3ba8..adbe6e6 100644
--- a/langtools/test/jdk/javadoc/tool/modules/Modules.java
+++ b/langtools/test/jdk/javadoc/tool/modules/Modules.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8159305 8166127
+ * @bug 8159305 8166127 8175860 8176481
  * @summary Tests primarily the module graph computations.
  * @modules
  *      jdk.javadoc/jdk.javadoc.internal.api
@@ -38,6 +38,7 @@
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
 
 import toolbox.*;
 import toolbox.Task.Expect;
@@ -93,6 +94,29 @@
     }
 
     @Test
+    public void testMissingModuleWithSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path mod = src.resolve("m1");
+
+        ModuleBuilder mb1 = new ModuleBuilder(tb, "m1");
+        mb1.comment("The first module.")
+                .exports("m1pub")
+                .requires("m2")
+                .classes("package m1pub; /** Class A */ public class A {}")
+                .classes("package m1pro; /** Class B */ public class B {}")
+                .write(src);
+
+        Path javafile = Paths.get(mod.toString(), "m1pub/A.java");
+
+        execNegativeTask("--source-path", mod.toString(),
+                javafile.toString());
+
+        assertMessagePresent("error: cannot access module-info");
+        assertMessageNotPresent("error - fatal error encountered");
+
+    }
+
+    @Test
     public void testMultipleModulesAggregatedModuleOption(Path base) throws Exception {
         Path src = base.resolve("src");
 
@@ -150,7 +174,7 @@
         // no module path
         execNegativeTask("--module-source-path", src.toString(),
                 "--module", "m2");
-        assertErrorPresent("error: module not found: m1");
+        assertMessagePresent("error: module not found: m1");
     }
 
     @Test
@@ -189,7 +213,7 @@
         execNegativeTask("--module-source-path", src.toString(),
                 "--module-path", modulePath.toString(),
                 "--module", "m2");
-        assertErrorPresent("error: cannot find symbol");
+        assertMessagePresent("error: cannot find symbol");
 
         // dependency from module path
         ModuleBuilder mb3 = new ModuleBuilder(tb, "m3");
@@ -202,7 +226,7 @@
                 "--module-path", modulePath.toString(),
                 "--upgrade-module-path", upgradePath.toString(),
                 "--module", "m3");
-        assertErrorPresent("Z.java:1: error: cannot find symbol");
+        assertMessagePresent("Z.java:1: error: cannot find symbol");
     }
 
     @Test
@@ -268,7 +292,7 @@
                 "--module-path", modulePath.toString(),
                 "--limit-modules", "java.base",
                 "--module", "m2");
-        assertErrorPresent("error: module not found: m1");
+        assertMessagePresent("error: module not found: m1");
     }
 
     @Test
@@ -297,38 +321,6 @@
     }
 
     @Test
-    public void testPatchModuleOption(Path base) throws Exception {
-        Path src = base.resolve("src");
-        Path modulePath = base.resolve("modules");
-        Path patchPath = base.resolve("patch");
-
-        ModuleBuilder mb1 = new ModuleBuilder(tb, "m1");
-        mb1.comment("Module on module path.")
-                .exports("pkg1")
-                .classes("package pkg1; /** Class A */ public class A { }")
-                .build(modulePath);
-
-        tb.writeJavaFiles(patchPath, "package pkg1; /** Class A */ public class A { public static int k; }");
-        new JavacTask(tb)
-                .files(patchPath.resolve("pkg1/A.java"))
-                .run();
-
-        ModuleBuilder mb2 = new ModuleBuilder(tb, "m2");
-        mb2.comment("The second module.")
-                .exports("pkg2")
-                .requires("m1")
-                .classes("package pkg2; /** Class B */ public class B { /** Field f */ public int f = pkg1.A.k; }")
-                .write(src);
-        execTask("--module-source-path", src.toString(),
-                "--patch-module", "m1=" + patchPath.toString(),
-                "--module-path", modulePath.toString(),
-                "--module", "m2");
-        checkModulesSpecified("m2");
-        checkPackagesIncluded("pkg2");
-        checkMembersSelected("pkg2.B.f");
-    }
-
-    @Test
     public void testAddReadsOption(Path base) throws Exception {
         Path src = base.resolve("src");
         Path modulePath = base.resolve("modules");
@@ -428,6 +420,7 @@
         checkPackagesIncluded("p");
         checkTypesIncluded("p.Main");
         checkPackagesNotIncluded(".*open.*");
+        assertMessageNotPresent("warning");
     }
 
     @Test
@@ -449,9 +442,46 @@
                 "--expand-requires", "transitive");
 
         checkModulesSpecified("M", "N", "O");
+        checkModulesNotSpecified("java.base");
         checkModulesIncluded("M", "N", "O");
+        checkModulesNotIncluded("java.base");
         checkPackagesIncluded("p", "openN", "openO");
         checkTypesIncluded("p.Main", "openN.N", "openO.O");
+        assertMessageNotPresent("warning");
+    }
+
+    @Test
+    public void testExpandRequiresTransitiveWithMandated(Path base) throws Exception {
+        Path src = base.resolve("src");
+
+        createAuxiliaryModules(src);
+
+        Path patchSrc = Paths.get(src.toString(), "patch");
+
+        new ModuleBuilder(tb, "M")
+                .comment("The M module.")
+                .requiresTransitive("N", src)
+                .requires("L", src)
+                .exports("p")
+                .classes("package p; public class Main { openO.O o; openN.N n; openL.L l; }")
+                .write(src);
+
+        // build the patching module
+        tb.writeJavaFiles(patchSrc, "package pkg1;\n" +
+                "/** Class A */ public class A extends java.util.ArrayList { }");
+        tb.writeJavaFiles(patchSrc, "package pkg1;\n"
+                + "/** Class B */ public class B { }");
+
+        execTask("--module-source-path", src.toString(),
+                "--patch-module", "java.base=" + patchSrc.toString(),
+                "--module", "M",
+                "--expand-requires", "transitive");
+
+        checkModulesSpecified("java.base", "M", "N", "O");
+        checkModulesIncluded("java.base", "M", "N", "O");
+        checkPackagesIncluded("p", "openN", "openO");
+        checkTypesIncluded("p.Main", "openN.N", "openO.O");
+        assertMessageNotPresent("warning");
     }
 
     @Test
@@ -473,13 +503,14 @@
                 "--module", "M",
                 "--expand-requires", "all");
 
-        checkModulesSpecified("M", "java.base", "N", "L", "O");
-        checkModulesIncluded("M", "java.base", "N", "L", "O");
+        checkModulesSpecified("M", "N", "L", "O");
+        checkModulesIncluded("M", "N", "L", "O");
         checkModulesNotIncluded("P", "J", "Q");
         checkPackagesIncluded("p", "openN", "openL", "openO");
         checkPackagesNotIncluded(".*openP.*", ".*openJ.*");
         checkTypesIncluded("p.Main", "openN.N", "openL.L", "openO.O");
         checkTypesNotIncluded(".*openP.*", ".*openJ.*");
+        assertMessageNotPresent("warning");
     }
 
     @Test
@@ -501,7 +532,7 @@
                 "--module", "MIA",
                 "--expand-requires", "all");
 
-        assertErrorPresent("javadoc: error - module MIA not found.");
+        assertMessagePresent("javadoc: error - module MIA not found.");
     }
 
     @Test
@@ -523,7 +554,53 @@
                 "--module", "M,N,L,MIA,O,P",
                 "--expand-requires", "all");
 
-        assertErrorPresent("javadoc: error - module MIA not found");
+        assertMessagePresent("javadoc: error - module MIA not found");
+    }
+
+    @Test
+    public void testSingleModuleOptionWithSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path mod = createSimpleModule(src, "m1");
+        execTask("--source-path", mod.toString(),
+                 "--module", "m1");
+        checkModulesSpecified("m1");
+        checkPackagesIncluded("p");
+        checkTypesIncluded("p.C");
+    }
+
+    @Test
+    public void testSingleModuleOptionWithMissingModuleInSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path mod = createSimpleModule(src, "m1");
+        execNegativeTask("--source-path", mod.toString(),
+                 "--module", "m2");
+        assertMessagePresent("source path does not contain module m2");
+    }
+
+    @Test
+    public void testMultipleModuleOptionWithSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path mod = createSimpleModule(src, "m1");
+        execNegativeTask("--source-path", mod.toString(),
+                 "--module", "m1,m2,m3");
+        assertMessagePresent("cannot use source path for multiple modules m1, m2, m3");
+    }
+
+    @Test
+    public void testSingleModuleOptionWithNoModuleOnSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path mod1 = Paths.get(src.toString(), "m1");
+        execNegativeTask("--source-path", mod1.toString(),
+                 "--module", "m1");
+        assertMessagePresent("module m1 not found on source path");
+    }
+
+    Path createSimpleModule(Path src, String mname) throws IOException {
+        Path mpath = Paths.get(src.toString(), mname);
+        tb.writeJavaFiles(mpath,
+                "module " + mname + " { exports p; }",
+                "package p; public class C { }");
+        return mpath;
     }
 
     void createAuxiliaryModules(Path src) throws IOException {
@@ -538,7 +615,7 @@
         new ModuleBuilder(tb, "L")
                 .comment("The L module.")
                 .exports("openL")
-                . requiresTransitive("P")
+                .requiresTransitive("P")
                 .classes("package openL; /** Class L open */ public class L { }")
                 .classes("package closedL;  /** Class L closed */ public class L { }")
                 .write(src);
@@ -560,7 +637,7 @@
                 .write(src);
 
         new ModuleBuilder(tb, "P")
-                .comment("The O module.")
+                .comment("The P module.")
                 .exports("openP")
                 .requires("J")
                 .classes("package openP; /** Class O open. */ public class O { openJ.J j; }")
diff --git a/langtools/test/jdk/javadoc/tool/modules/PackageOptions.java b/langtools/test/jdk/javadoc/tool/modules/PackageOptions.java
index 6335418..d54a666 100644
--- a/langtools/test/jdk/javadoc/tool/modules/PackageOptions.java
+++ b/langtools/test/jdk/javadoc/tool/modules/PackageOptions.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -180,7 +180,7 @@
                          "--module", "m1",
                          "-subpackages", "m1pub.pub1:pro");
 
-        assertErrorPresent("javadoc: error - No source files for package pro");
+        assertMessagePresent("javadoc: error - No source files for package pro");
     }
 
     @Test
diff --git a/langtools/test/jdk/javadoc/tool/modules/PatchModules.java b/langtools/test/jdk/javadoc/tool/modules/PatchModules.java
new file mode 100644
index 0000000..0cba257
--- /dev/null
+++ b/langtools/test/jdk/javadoc/tool/modules/PatchModules.java
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8175346
+ * @summary Test patch module options
+ * @modules
+ *      jdk.javadoc/jdk.javadoc.internal.api
+ *      jdk.javadoc/jdk.javadoc.internal.tool
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @library /tools/lib
+ * @build toolbox.ToolBox toolbox.TestRunner
+ * @run main PatchModules
+ */
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import toolbox.*;
+
+public class PatchModules extends ModuleTestBase {
+
+    public static void main(String... args) throws Exception {
+        new PatchModules().runTests();
+    }
+
+    // Case A.1, m2 augmenting m1
+    @Test
+    public void testPatchModuleOption(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path modulePath = base.resolve("modules");
+        Path patchPath = base.resolve("patch");
+
+        ModuleBuilder mb1 = new ModuleBuilder(tb, "m1");
+        mb1.comment("Module on module path.")
+                .exports("pkg1")
+                .classes("package pkg1; /** Class A */ public class A { }")
+                .build(modulePath);
+
+        tb.writeJavaFiles(patchPath, "package pkg1; /** Class A */ public class A { public static int k; }");
+        new JavacTask(tb)
+                .files(patchPath.resolve("pkg1/A.java"))
+                .run();
+
+        ModuleBuilder mb2 = new ModuleBuilder(tb, "m2");
+        mb2.comment("The second module.")
+                .exports("pkg2")
+                .requires("m1")
+                .classes("package pkg2; /** Class B */ public class B { /** Field f */ public int f = pkg1.A.k; }")
+                .write(src);
+        execTask("--module-source-path", src.toString(),
+                "--patch-module", "m1=" + patchPath.toString(),
+                "--module-path", modulePath.toString(),
+                "--module", "m2");
+        checkModulesSpecified("m2");
+        checkPackagesIncluded("pkg2");
+        checkMembersSelected("pkg2.B.f");
+    }
+
+    // Case A.2: use package, source form of m1 augmenting binary form of m1
+    @Test
+    public void testPatchModuleWithPackage(Path base)  throws Exception {
+        Path modulePath = base.resolve("modules");
+        Path moduleSrcPath = base.resolve("modulesSrc");
+
+        Path mpath = Paths.get(moduleSrcPath.toString(),  "m1");
+
+        ModuleBuilder mb1 = new ModuleBuilder(tb, "m1");
+        mb1.comment("Module m1.")
+                .exports("pkg1")
+                .classes("package pkg1; /** Class A */ public class A { }")
+                .classes("package pkg1.pkg2; /** Class B */ public class B { }")
+                .build(modulePath);
+
+        execTask("-hasDocComments",
+                "--module-path", modulePath.toString(),
+                "--add-modules", "m1",
+                "--patch-module", "m1=" + mpath.toString(),
+                "pkg1");
+        checkTypesIncluded("pkg1.A hasDocComments");
+    }
+
+     // Case A.2: use subpackages, source form of m1 augmenting binary form of m1
+    @Test
+    public void testPatchModuleWithSubPackages(Path base) throws Exception {
+        Path modulePath = base.resolve("modules");
+        Path moduleSrcPath = base.resolve("modulesSrc");
+
+        Path mpath = Paths.get(moduleSrcPath.toString(),  "m1");
+
+        ModuleBuilder mb1 = new ModuleBuilder(tb, "m1");
+        mb1.comment("Module m1.")
+                .exports("pkg1")
+                .classes("package pkg1; /** Class A */ public class A { }")
+                .classes("package pkg1.pkg2; /** Class B */ public class B { }")
+                .build(modulePath);
+
+        execTask("-hasDocComments",
+                "--module-path", modulePath.toString(),
+                "--add-modules", "m1",
+                "--patch-module", "m1=" + mpath.toString(),
+                "-subpackages", "pkg1");
+        checkTypesIncluded("pkg1.A hasDocComments");
+        checkTypesIncluded("pkg1.pkg2.B hasDocComments");
+    }
+
+    // Case B.1: (jsr166) augment and override system module
+    @Test
+    public void testPatchModuleModifyingSystemModule(Path base) throws Exception {
+        Path patchSrc = base.resolve("patch");
+
+        // build the patching sources
+        tb.writeJavaFiles(patchSrc, "package java.util;\n" +
+                "/** Class Collection */\n" +
+                "public interface Collection<K> {}");
+
+        tb.writeJavaFiles(patchSrc, "package java.util;\n"
+                + "/** Class MyCollection */\n" +
+                "public interface MyCollection<K> extends Collection {}");
+
+        execTask("-hasDocComments", "--patch-module", "java.base=" + patchSrc.toString(),
+                "java.util");
+
+        checkPackagesSpecified("java.util");
+        checkTypesIncluded("java.util.Collection hasDocComments",
+                "java.util.MyCollection hasDocComments");
+    }
+
+    // Case C.1: patch a user module's sources using source path
+    @Test
+    public void testPatchModuleUsingSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path patchSrc = base.resolve("patch");
+
+        ModuleBuilder mb1 = new ModuleBuilder(tb, "m1");
+        mb1.comment("Module m1.")
+                .exports("pkg1")
+                .classes("package pkg1; /** Class A */ public class A { }")
+                .write(src);
+
+        // build the patching module
+        tb.writeJavaFiles(patchSrc, "package pkg1;\n" +
+                "/** Class A */ public class A extends java.util.ArrayList { }");
+        tb.writeJavaFiles(patchSrc, "package pkg1;\n"
+                + "/** Class B */ public class B { }");
+
+        Path m1src = Paths.get(src.toString(), "m1");
+
+        execTask("--source-path", m1src.toString(),
+                "--patch-module", "m1=" + patchSrc.toString(),
+                "pkg1");
+
+        checkPackagesSpecified("pkg1");
+        checkModulesIncluded("m1");
+        checkTypesIncluded("pkg1.A", "pkg1.B");
+    }
+
+    // Case C.2: patch a user module's sources using module source path
+    @Test
+    public void testPatchModuleWithModuleSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path patchSrc = base.resolve("patch");
+
+        ModuleBuilder mb1 = new ModuleBuilder(tb, "m1");
+        mb1.comment("Module on module-source-path.")
+                .exports("pkg1")
+                .classes("package pkg1; /** Class A */ public class A { }")
+                .write(src);
+
+        // build the patching module
+        tb.writeJavaFiles(patchSrc, "package pkg1;\n" +
+                "/** Class A */ public class A extends java.util.ArrayList { }");
+        tb.writeJavaFiles(patchSrc, "package pkg1;\n"
+                + "/** Class B */ public class B { }");
+
+
+        execTask("--module-source-path", src.toString(),
+                "--add-modules", "m1",
+                "--patch-module", "m1=" + patchSrc.toString(),
+                "pkg1");
+
+        checkPackagesSpecified("pkg1");
+        checkModulesIncluded("m1");
+        checkTypesIncluded("pkg1.A", "pkg1.B");
+    }
+
+}
diff --git a/langtools/test/jdk/javadoc/tool/modules/ReleaseOptions.java b/langtools/test/jdk/javadoc/tool/modules/ReleaseOptions.java
new file mode 100644
index 0000000..5d8f903
--- /dev/null
+++ b/langtools/test/jdk/javadoc/tool/modules/ReleaseOptions.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8175346 8175277
+ * @summary Test release option interactions
+ * @modules
+ *      jdk.javadoc/jdk.javadoc.internal.api
+ *      jdk.javadoc/jdk.javadoc.internal.tool
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @library /tools/lib
+ * @build toolbox.ToolBox toolbox.TestRunner
+ * @run main ReleaseOptions
+ */
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import toolbox.*;
+
+public class ReleaseOptions extends ModuleTestBase {
+
+    public static void main(String... args) throws Exception {
+        new ReleaseOptions().runTests();
+    }
+
+    @Test
+    public void testReleaseWithPatchModule(Path base) throws Exception {
+        Path src = Paths.get(base.toString(), "src");
+        Path mpath = Paths.get(src. toString(), "m");
+
+        tb.writeJavaFiles(mpath,
+                "module m { exports p; }",
+                "package p; public class C { }");
+
+        Task.Result result = execNegativeTask("--release", "8",
+                "--patch-module", "m=" + mpath.toString(),
+                "p");
+        assertMessagePresent(".*not allowed with target 1.8.*");
+        assertMessageNotPresent(".*Exception*");
+        assertMessageNotPresent(".java.lang.AssertionError.*");
+    }
+
+    @Test
+    public void testReleaseWithSourcepath(Path base) throws Exception {
+        Path src = Paths.get(base.toString(), "src");
+        Path mpath = Paths.get(src. toString(), "m");
+
+        tb.writeJavaFiles(mpath,
+                "module m { exports p; }",
+                "package p; public class C { }");
+
+        Task.Result result = execNegativeTask("--release", "8",
+                "--source-path", mpath.toString(),
+                "--module", "m");
+        assertMessagePresent(".*(use -source 9 or higher to enable modules).*");
+        assertMessageNotPresent(".*Exception*");
+        assertMessageNotPresent(".java.lang.AssertionError.*");
+    }
+
+    @Test
+    public void testReleaseWithModuleSourcepath(Path base) throws Exception {
+        Path src = Paths.get(base.toString(), "src");
+        Path mpath = Paths.get(src.toString(), "m");
+
+        tb.writeJavaFiles(mpath,
+                "module m { exports p; }",
+                "package p; public class C { }");
+
+        Task.Result result = execNegativeTask("--release", "8",
+                "--module-source-path", src.toString(),
+                "--module", "m");
+        assertMessagePresent(".*not allowed with target 1.8.*");
+        assertMessageNotPresent(".*Exception*");
+        assertMessageNotPresent(".java.lang.AssertionError.*");
+    }
+}
diff --git a/langtools/test/jdk/javadoc/tool/outputRedirect/p/OutputRedirect.java b/langtools/test/jdk/javadoc/tool/outputRedirect/p/OutputRedirect.java
index cbf1b10..c959d91 100644
--- a/langtools/test/jdk/javadoc/tool/outputRedirect/p/OutputRedirect.java
+++ b/langtools/test/jdk/javadoc/tool/outputRedirect/p/OutputRedirect.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
 package p;
 
 import java.io.*;
-import jdk.javadoc.internal.tool.Main;
 
 public class OutputRedirect {
     private static final PrintStream originalOutput = System.err;
@@ -47,9 +46,9 @@
         PrintWriter sink = new PrintWriter(new ByteArrayOutputStream());
 
         // execute javadoc
-        int result = Main.execute(new String[] {"p"}, sink);
+        int result = jdk.javadoc.internal.tool.Main.execute(new String[] {"p"}, sink);
 
-        // test whether javadoc did any output to System.out
+        // tests whether javadoc wrote to System.out
         if (redirectedOutput.toByteArray().length > 0) {
             originalOutput.println("Test failed; here's what javadoc wrote on its standard output:");
             originalOutput.println(redirectedOutput.toString());
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/SampleApi.java b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/SampleApi.java
index e8b4eed..84b0e2e 100644
--- a/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/SampleApi.java
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/SampleApi.java
@@ -20,42 +20,135 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-
 package sampleapi;
 
-import java.io.File;
-import java.io.FilenameFilter;
+import com.sun.source.util.JavacTask;
+import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.api.JavacTool;
+import com.sun.tools.javac.util.Context;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UncheckedIOException;
+import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import static java.util.stream.Collectors.toList;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+import sampleapi.generator.ModuleGenerator;
 
 import sampleapi.generator.PackageGenerator;
 
 public class SampleApi {
 
-    PackageGenerator pkgGen = new PackageGenerator();
+    private final Context ctx;
+    private final List<ModuleGenerator> modules = new ArrayList<>();
 
-    public void generate(File resDir, File outDir) throws Fault {
-        FilenameFilter filter = (dir, name) -> { return name.endsWith(".xml"); };
-        File[] resFiles = resDir.listFiles(filter);
-        for (File resFile : resFiles) {
-            pkgGen.processDataSet(resFile);
-            pkgGen.generate(outDir);
-        }
+    public SampleApi() {
+        JavacTool jt = JavacTool.create();
+        JavacTask task = jt.getTask(null, null, null, null, null, null);
+        ctx = ((JavacTaskImpl) task).getContext();
     }
 
-    public void generate(Path res, Path dir) throws Fault {
-        generate(res.toFile(), dir.toFile());
+    public static SampleApi load(Path resDir)
+            throws ParserConfigurationException, IOException, SAXException {
+        SampleApi result = new SampleApi();
+        System.out.println("Loading resources from " + resDir);
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        Files.list(resDir)
+                .peek(f -> System.out.println(f.getFileName()))
+                .filter(f -> f.getFileName().toString().endsWith(".xml"))
+                .peek(f -> System.out.println(f.getFileName()))
+                .forEach(resFile -> {
+                    try (InputStream is = Files.newInputStream(resFile)) {
+                        Document document = builder.parse(is);
+                        NodeList moduleElements = document.getElementsByTagName("module");
+                        for (int i = 0; i < moduleElements.getLength(); i++) {
+                            result.modules.add(ModuleGenerator
+                                    .load((Element) moduleElements.item(i)));
+                        }
+                    } catch (IOException ex) {
+                        throw new UncheckedIOException(ex);
+                    } catch (SAXException ex) {
+                        throw new RuntimeException(ex);
+                    }
+                });
+        return result;
     }
 
-    public void generate(String res, String dir) throws Fault {
-        generate(new File(res), new File(dir));
+    public Context getContext() {
+        return ctx;
     }
 
-    public static class Fault extends Exception {
-        public Fault(String msg) {
-            super(msg);
+    public List<ModuleGenerator> getModules() {
+        return modules;
+    }
+
+
+    public void generate(Path outDir) {
+        //resolveIDs(modules);
+        modules.forEach(m -> {
+            try {
+                m.generate(outDir, this);
+            } catch (IOException ex) {
+                throw new UncheckedIOException(ex);
+            }
+        });
+    }
+
+    public void generate(String dir)
+            throws ParserConfigurationException, IOException, SAXException {
+        generate(Paths.get(dir));
+    }
+
+    public ModuleGenerator moduleById(String id) {
+        String real_id = getId(id);
+        return modules.stream()
+                            .filter(m -> m.id.equals(real_id))
+                            .findAny().orElseThrow(() -> new IllegalStateException("No module with id: " + real_id));
+    }
+
+    public PackageGenerator packageById(String id) {
+        String real_id = getId(id);
+        return modules.stream()
+                .flatMap(m -> m.packages.stream())
+                .filter(p -> p.id.equals(real_id)).findAny()
+                .orElseThrow(() -> new IllegalStateException("No package with id: " + real_id));
+    }
+
+    public String classById(String id) {
+        String real_id = getId(id);
+        return modules.stream()
+                .flatMap(m -> m.packages.stream())
+                .peek(p -> System.out.println(p.packageName + " " + p.idBases.size()))
+                .flatMap(p -> p.idBases.entrySet().stream()
+                    .filter(e -> e.getKey().equals(real_id))
+                    .map(e -> p.packageName + "." + e.getValue().name.toString())
+                    .peek(System.out::println))
+                .findAny().orElseThrow(() -> new IllegalStateException("No class with id: " + id));
+    }
+
+    public boolean isId(String name) {
+        return name.startsWith("$");
+    }
+
+    public boolean isIdEqual(String name, String id) {
+        return isId(name) && getId(name).equals(id);
+    }
+
+    public String getId(String name) {
+        if(!isId(name)) {
+            throw new IllegalStateException("Not an id: " + name);
         }
-        public Fault(String msg, Throwable th) {
-            super(msg, th);
-        }
+        return name.substring(1);
     }
 }
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/SampleApiDefaultRunner.java b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/SampleApiDefaultRunner.java
index 23459d5..c77664c 100644
--- a/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/SampleApiDefaultRunner.java
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/SampleApiDefaultRunner.java
@@ -23,9 +23,9 @@
 
 package sampleapi;
 
-import java.io.File;
-
-import sampleapi.SampleApi.Fault;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 
 public class SampleApiDefaultRunner {
 
@@ -132,12 +132,12 @@
             return 1;
         }
 
-        File resDir = new File(resDirName);
-        File outDir = new File(outDirName);
-        outDir.mkdirs();
+        Path resDir = Paths.get(resDirName);
+        Path outDir = Paths.get(outDirName);
+        Files.createDirectories(outDir);
         SampleApi apiGen = new SampleApi();
 
-        apiGen.generate(resDir, outDir);
+        apiGen.load(resDir).generate(outDir);
 
         return 0;
     }
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/generator/ModuleGenerator.java b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/generator/ModuleGenerator.java
new file mode 100644
index 0000000..7634563
--- /dev/null
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/generator/ModuleGenerator.java
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sampleapi.generator;
+
+import com.sun.source.tree.ModuleTree.ModuleKind;
+import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.parser.Scanner;
+import com.sun.tools.javac.parser.ScannerFactory;
+import com.sun.tools.javac.parser.Tokens;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCDirective;
+import com.sun.tools.javac.tree.JCTree.JCExpression;
+import com.sun.tools.javac.tree.TreeMaker;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.Names;
+import com.sun.tools.javac.util.ListBuffer;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.ArrayList;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import sampleapi.SampleApi;
+import sampleapi.util.PoorDocCommentTable;
+
+import static com.sun.tools.javac.parser.Tokens.Comment.CommentStyle.JAVADOC;
+
+/**
+ *
+ * This class is responsible for loading module description from an XML and then generating the
+ * <code>module-info.java</code>. It is using {@link PackageGenerator} class for parsing content of the module.
+ */
+public class ModuleGenerator {
+
+    private static final String UNNAMED = "UNNAMED";
+    private static final String MODULE_INFO = "module-info.java";
+
+    public String name;
+    public String id;
+    public ModuleKind kind;
+    public final List<Exports> exportss = new ArrayList<>();
+    public final List<Opens> openss = new ArrayList<>();
+    public final List<Requires> requiress = new ArrayList<>();
+    public final List<Uses> usess = new ArrayList<>();
+    public final List<Provides> providess = new ArrayList<>();
+    public final List<PackageGenerator> packages = new ArrayList<>();
+
+    private ModuleGenerator() {
+    }
+
+    public static ModuleGenerator load(Element rootElement) {
+        ModuleGenerator result = new ModuleGenerator();
+        result.name = rootElement.getAttribute("name");
+        result.id = rootElement.getAttribute("id");
+        String kind = rootElement.getAttribute("kind");
+        result.kind = kind.isEmpty() ? ModuleKind.STRONG :
+                ModuleKind.valueOf(kind.toUpperCase());
+        //exports
+        NodeList exportsList = rootElement.getElementsByTagName("exports");
+        for (int i = 0; i < exportsList.getLength(); i++) {
+            Element exportsEl = (Element) exportsList.item(i);
+            Exports exports = new Exports(exportsEl.getAttribute("package"));
+            NodeList toList = exportsEl.getElementsByTagName("to");
+            for (int j = 0; j < toList.getLength(); j++) {
+                Element toElement = (Element) toList.item(j);
+                exports.modules.add(toElement.getAttribute("module"));
+            }
+            result.exportss.add(exports);
+        }
+        //opens
+        NodeList opensList = rootElement.getElementsByTagName("opens");
+        for (int i = 0; i < opensList.getLength(); i++) {
+            Element opensEl = (Element) opensList.item(i);
+            Opens opens = new Opens(opensEl.getAttribute("package"));
+            NodeList toList = opensEl.getElementsByTagName("to");
+            for (int j = 0; j < toList.getLength(); j++) {
+                Element toElement = (Element) toList.item(j);
+                opens.modules.add(toElement.getAttribute("module"));
+            }
+            result.openss.add(opens);
+        }
+        //requires
+        NodeList requiresList = rootElement.getElementsByTagName("requires");
+        for (int i = 0; i < requiresList.getLength(); i++) {
+            Element requiresEl = (Element) requiresList.item(i);
+            result.requiress.add(new Requires(requiresEl.getAttribute("module"),
+                    Boolean.parseBoolean(requiresEl.getAttribute("transitive")),
+                    Boolean.parseBoolean(requiresEl.getAttribute("static"))));
+        }
+        //uses
+        NodeList usesList = rootElement.getElementsByTagName("uses");
+        for (int i = 0; i < usesList.getLength(); i++) {
+            Element usesEl = (Element) usesList.item(i);
+            result.usess.add(new Uses(usesEl.getAttribute("service")));
+        }
+        //provides
+        NodeList providesList = rootElement.getElementsByTagName("provides");
+        for (int i = 0; i < providesList.getLength(); i++) {
+            Element providesEl = (Element) providesList.item(i);
+            Provides provides = new Provides(providesEl.getAttribute("service"));
+            NodeList implList = providesEl.getElementsByTagName("implementation");
+            for (int j = 0; j < implList.getLength(); j++) {
+                Element implElement = (Element) implList.item(j);
+                provides.implementations.add(implElement.getAttribute("class"));
+            }
+            result.providess.add(provides);
+        }
+        //packages
+        NodeList packagesList = rootElement.getElementsByTagName("package");
+        for (int i = 0; i < packagesList.getLength(); i++) {
+            result.packages.add(PackageGenerator
+                    .processDataSet((Element) packagesList.item(i)));
+        }
+        return result;
+    }
+
+    public void generate(Path outDir, SampleApi api) throws IOException {
+        Files.createDirectories(outDir);
+        Path moduleSourceDir;
+        if (!name.equals(UNNAMED)) {
+            moduleSourceDir = outDir.resolve(name);
+            Files.createDirectory(moduleSourceDir);
+            generateModuleInfo(moduleSourceDir, api);
+        } else {
+            moduleSourceDir = outDir;
+        }
+        packages.forEach(pkg -> pkg.generate(moduleSourceDir));
+    }
+
+    private void generateModuleInfo(Path moduleSourceDir, SampleApi api) throws IOException {
+        TreeMaker make = TreeMaker.instance(api.getContext());
+        Names names = Names.instance(api.getContext());
+        JCTree.JCExpression modQual = make.QualIdent(
+                new Symbol.ModuleSymbol(names.fromString(name), null));
+        ListBuffer<JCDirective> exportsBuffer = new ListBuffer<>();
+        exportss.forEach(e -> {
+            ListBuffer<JCExpression> modulesBuffer = new ListBuffer<>();
+            e.modules.stream()
+                    .map(m -> api.isId(m) ? api.moduleById(m).name : m)
+                    .forEach(m -> {
+                modulesBuffer.add(make.Ident(
+                        names.fromString(m)));
+            });
+            exportsBuffer.add(make.Exports(
+                    make.Ident(names.fromString(api.isId(e.pkg) ?
+                            api.packageById(e.pkg).packageName : e.pkg)),
+                    (modulesBuffer.size() > 0) ? modulesBuffer.toList() : null));
+        });
+        openss.forEach(o -> {
+            ListBuffer<JCExpression> modulesBuffer = new ListBuffer<>();
+            o.modules.stream()
+                    .map(m -> api.isId(m) ? api.moduleById(m).name : m)
+                    .forEach(m -> {
+                modulesBuffer.add(make.Ident(
+                        names.fromString(m)));
+            });
+            exportsBuffer.add(make.Opens(
+                    make.Ident(names.fromString(api.isId(o.pkg) ?
+                            api.packageById(o.pkg).packageName : o.pkg)),
+                    (modulesBuffer.size() > 0) ? modulesBuffer.toList() : null));
+        });
+        ListBuffer<JCDirective> requiresBuffer = new ListBuffer<>();
+        requiress.forEach(r -> requiresBuffer.add(make.Requires(
+                r.transitive, r.statc,
+                make.Ident(names.fromString(api.isId(r.module)
+                        ? api.moduleById(r.module).name : r.module)))));
+        ListBuffer<JCDirective> usesBuffer = new ListBuffer<>();
+        usess.forEach(u -> usesBuffer
+                .add(make.Uses(make.Ident(names.fromString(api.isId(u.service)
+                        ? api.classById(u.service) : u.service)))));
+        ListBuffer<JCDirective> providesBuffer = new ListBuffer<>();
+        providess.forEach(p -> {
+            ListBuffer<JCExpression> implementationsBuffer = new ListBuffer<>();
+            p.implementations.stream()
+                    .map(c -> api.isId(c) ? api.classById(c) : c)
+                    .forEach(i -> {
+                implementationsBuffer.add(make.Ident(names.fromString(i)));
+            });
+            providesBuffer.add(make.Provides(
+                make.Ident(names.fromString(api.isId(p.service) ?
+                        api.classById(p.service) : p.service)),
+                implementationsBuffer.toList()));
+        });
+        ListBuffer<JCDirective> fullList = new ListBuffer<>();
+        fullList.addAll(exportsBuffer.toList());
+        fullList.addAll(requiresBuffer.toList());
+        fullList.addAll(usesBuffer.toList());
+        fullList.addAll(providesBuffer.toList());
+        JCTree.JCModuleDecl mod = make.ModuleDef(
+                make.Modifiers(0), //TODO how to support this?
+                kind, modQual, fullList.toList());
+        ListBuffer<JCTree> top = new ListBuffer<>();
+        top.add(mod);
+        JCTree.JCCompilationUnit compilationUnit = make.TopLevel(top.toList());
+        try (OutputStream module_info = Files.newOutputStream(moduleSourceDir.resolve(MODULE_INFO))) {
+            module_info.write(compilationUnit.toString().getBytes());
+        }
+    }
+
+
+    public static class Requires {
+        public String module;
+        public boolean transitive;
+        public boolean statc;
+
+        private Requires(String module, boolean transitive, boolean statc) {
+            this.module = module;
+            this.transitive = transitive;
+            this.statc = this.statc;
+        }
+    }
+
+    public static class Exports {
+        public final String pkg;
+        public final List<String> modules = new ArrayList<>();
+
+        private Exports(String pkg) {
+            this.pkg = pkg;
+        }
+    }
+
+    public static class Opens {
+        public final String pkg;
+        public final List<String> modules = new ArrayList<>();
+
+        private Opens(String pkg) {
+            this.pkg = pkg;
+        }
+    }
+
+    public static class Uses {
+        public final String service;
+
+        private Uses(String service) {
+            this.service = service;
+        }
+    }
+
+    public static class Provides {
+        public final String service;
+        public final List<String> implementations = new ArrayList<>();
+
+        private Provides(String service) {
+            this.service = service;
+        }
+    }
+}
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/generator/PackageGenerator.java b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/generator/PackageGenerator.java
index cab0ade..a0fcd71 100644
--- a/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/generator/PackageGenerator.java
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/generator/PackageGenerator.java
@@ -25,17 +25,11 @@
 
 import java.io.File;
 import java.io.FileWriter;
-import java.io.InputStream;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
 import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
-import org.xml.sax.SAXException;
-import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -56,18 +50,19 @@
 import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.code.Symbol;
 import com.sun.tools.javac.code.Symtab;
+import java.nio.file.Path;
 
 import sampleapi.util.*;
-import sampleapi.SampleApi.Fault;
 
 public class PackageGenerator {
 
-    String packageName;
+    public String packageName;
     String packageDirName;
+    public String id;
 
     ArrayList<JCCompilationUnit> topLevels;
     Map<String, Integer> nameIndex;
-    Map<String, JCClassDecl> idBases;
+    public Map<String, JCClassDecl> idBases;
     Map<String, JCAnnotation> idAnnos;
 
     TreeMaker make;
@@ -92,48 +87,43 @@
 
     boolean isDataSetProcessed = false;
 
-    public void processDataSet(File dsFile) throws Fault {
-        isDataSetProcessed = true;
-        topLevels = new ArrayList<>();
-        nameIndex = new HashMap<>();
-        idBases =  new HashMap<>();
-        idAnnos =  new HashMap<>();
-        fx = false;
+    public static PackageGenerator processDataSet(Element rootElement) {
+        PackageGenerator result = new PackageGenerator();
+        result.isDataSetProcessed = true;
+        result.topLevels = new ArrayList<>();
+        result.nameIndex = new HashMap<>();
+        result.idBases = new HashMap<>();
+        result.idAnnos = new HashMap<>();
+        result.fx = false;
 
-        try {
-            InputStream is = new FileInputStream(dsFile);
-
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            Document document = builder.parse(is);
-
-            Element rootElement = document.getDocumentElement();
-            if (!rootElement.getTagName().equals("package"))
-                throw new IllegalStateException("Unexpected tag name: "
-                        + rootElement.getTagName());
-            packageName = rootElement.getAttribute("name");
-            fx = "fx".equals(rootElement.getAttribute("style"));
-            packageDirName = packageName.replace('.', '/');
-
-            // process nodes (toplevels)
-            NodeList nodeList = rootElement.getChildNodes();
-            for (int i = 0; i < nodeList.getLength(); i++) {
-                Node node = nodeList.item(i);
-
-                if (!(node instanceof Element))
-                    continue;
-                processTopLevel((Element) node);
-            }
-        } catch (ParserConfigurationException | SAXException | IOException e) {
-            throw new Fault("Error parsing dataset " + dsFile, e);
+        if (!rootElement.getTagName().equals("package")) {
+            throw new IllegalStateException("Unexpected tag name: "
+                    + rootElement.getTagName());
         }
+        result.packageName = rootElement.getAttribute("name");
+        result.id = rootElement.getAttribute("id");
+        result.fx = "fx".equals(rootElement.getAttribute("style"));
+        result.packageDirName = result.packageName.replace('.', '/');
+
+        // process nodes (toplevels)
+        NodeList nodeList = rootElement.getChildNodes();
+        for (int i = 0; i < nodeList.getLength(); i++) {
+            Node node = nodeList.item(i);
+
+            if (!(node instanceof Element)) {
+                continue;
+            }
+            result.processTopLevel((Element) node);
+        }
+        return result;
     }
 
-    public void generate(File outDir) throws Fault {
+    public void generate(Path outDir) {
         if (!isDataSetProcessed)
-            throw new Fault("No Data Set processed");
+            throw new RuntimeException("No Data Set processed");
 
         try {
-            File pkgDir = new File(outDir, packageDirName);
+            File pkgDir = new File(outDir.toFile(), packageDirName);
             pkgDir.mkdirs();
 
             for (JCCompilationUnit decl : topLevels) {
@@ -168,7 +158,7 @@
             writer.flush();
             writer.close();
         } catch (IOException e) {
-            throw new Fault("Error writing output");
+            throw new RuntimeException("Error writing output");
         }
     }
 
@@ -211,6 +201,7 @@
         String baseName = baseTag.getAttribute("basename");
         String typeParam = baseTag.getAttribute("tparam");
         String baseId = baseTag.getAttribute("id");
+        System.out.println("Found class id: " + baseId);
 
         long kindFlag = 0;
         switch (kind) {
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/util/SimpleMultiplier.java b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/util/SimpleMultiplier.java
index 0e9760e..545e671 100644
--- a/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/util/SimpleMultiplier.java
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/lib/sampleapi/util/SimpleMultiplier.java
@@ -72,8 +72,8 @@
     }
 
     public void initIterator() {
+        size = 1;
         if (!valueSpace.isEmpty()) {
-            size = 1;
             for (int i = 0; i < valueSpace.size(); i++)
                 size *= valueSpace.get(i).size();
         }
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/res/fx.xml b/langtools/test/jdk/javadoc/tool/sampleapi/res/fx.xml
index d261772..225df81 100644
--- a/langtools/test/jdk/javadoc/tool/sampleapi/res/fx.xml
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/res/fx.xml
@@ -21,25 +21,27 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
-<package name="sampleapi.fx" style="fx">
-
-    <class basename="FXClass">
-        <modifier>public</modifier>
-        <member>
-            <field basename="id">
+<sampleapi>
+    <module name="UNNAMED">
+        <package name="sampleapi.fx" style="fx">
+            <class basename="FXClass">
                 <modifier>public</modifier>
-                <type>int|boolean</type>
-            </field>
-            <method basename="setProp">
-                <modifier>public|protected|private</modifier>
-                <param>int|String</param>
-                <type>void</type>
-            </method>
-            <method basename="getProp">
-                <modifier>public|protected|private</modifier>
-                <type>int|int|String</type>
-            </method>
-        </member>
-    </class>
-
-</package>
+                <member>
+                    <field basename="id">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </field>
+                    <method basename="setProp">
+                        <modifier>public|protected|private</modifier>
+                        <param>int|String</param>
+                        <type>void</type>
+                    </method>
+                    <method basename="getProp">
+                        <modifier>public|protected|private</modifier>
+                        <type>int|int|String</type>
+                    </method>
+                </member>
+            </class>
+        </package>
+    </module>
+</sampleapi>
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/res/simple.xml b/langtools/test/jdk/javadoc/tool/sampleapi/res/simple.xml
index b5a4915..3d805fd 100644
--- a/langtools/test/jdk/javadoc/tool/sampleapi/res/simple.xml
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/res/simple.xml
@@ -21,509 +21,512 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
-<package name="sampleapi.simple">
-
-    <class basename="SampleClass" id="baseclass">
-        <modifier>public</modifier>
-        <modifier>none|abstract</modifier>
-        <member>
-            <field basename="field">
-                <modifier>none|public</modifier>
-                <modifier>none|static</modifier>
-                <modifier>none|final</modifier>
-                <type>boolean|int|String</type>
-            </field>
-            <field basename="field">
-                <modifier>protected|private</modifier>
-                <type>String</type>
-            </field>
-            <constructor>
+<sampleapi>
+    <module name="UNNAMED">
+        <package name="sampleapi.simple">
+            <class basename="SampleClass" id="baseclass">
                 <modifier>public</modifier>
-                <param>none|int|int,boolean|int,String</param>
-            </constructor>
-            <constructor>
-                <modifier>public</modifier>
-                <param>String</param>
-                <throw>NullPointerException</throw>
-                <throw>SampleException0</throw>
-            </constructor>
-            <method basename="set">
-                <modifier>public</modifier>
-                <type>void</type>
-                <param>int</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>int|boolean|String</type>
-            </method>
-            <method basename="doSomething">
-                <modifier>public</modifier>
-                <type>void|int</type>
-                <param>none|int|Object,int</param>
-                <throw>NullPointerException</throw>
-                <throw>ArithmeticException</throw>
-            </method>
-        </member>
-    </class>
-
-    <class basename="Derived">
-        <modifier>public</modifier>
-        <extend id="baseclass"/>
-        <member>
-            <field basename="myField">
-                <modifier>public</modifier>
-                <type>int|boolean</type>
-            </field>
-            <constructor>
-                <modifier>public</modifier>
-                <param>none|int|int,boolean|int,String</param>
-            </constructor>
-            <method basename="myGet">
-                <modifier>public</modifier>
-                <type>int|boolean</type>
-            </method>
-        </member>
-    </class>
-
-    <class basename="SampleSerial">
-        <import>java.io.Serializable</import>
-        <modifier>public</modifier>
-        <implement ref="Serializable"/>
-        <member>
-            <field basename="specialData">
-                <modifier>private|none|public</modifier>
-                <type>boolean|int|String</type>
-            </field>
-        </member>
-    </class>
-
-    <class basename="SampleSerial">
-        <import>java.io.Serializable</import>
-        <import>java.io.ObjectStreamField</import>
-        <modifier>public</modifier>
-        <implement ref="Serializable"/>
-        <member>
-            <serialfield basename="serialField">String,Long,Boolean</serialfield>
-            <method basename="justToBeHere">
-                <modifier>public</modifier>
-                <type>String|long|boolean</type>
-            </method>
-        </member>
-    </class>
-
-    <class basename="SampleSerial">
-        <import>java.io.Serializable</import>
-        <import>java.io.ObjectOutputStream</import>
-        <import>java.io.ObjectOutput</import>
-        <import>java.io.IOException</import>
-        <import>java.io.ObjectStreamException</import>
-        <modifier>public</modifier>
-        <implement ref="Serializable"/>
-        <member>
-            <method name="writeObject">
-                <modifier>private</modifier>
-                <param>ObjectOutputStream</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-            <method name="writeExternal">
-                <modifier>public</modifier>
-                <param>ObjectOutput</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-            <method name="writeReplace">
-                <modifier>protected</modifier>
-                <param>none</param>
-                <type>Object</type>
-                <throw>ObjectStreamException</throw>
-            </method>
-            <method name="writeSomethingElse">
-                <modifier>public</modifier>
-                <param>Object</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-        </member>
-    </class>
-
-    <class basename="SampleSerial">
-        <import>java.io.Serializable</import>
-        <import>java.io.ObjectInputStream</import>
-        <import>java.io.ObjectInput</import>
-        <import>java.io.IOException</import>
-        <import>java.io.ObjectStreamException</import>
-        <modifier>public</modifier>
-        <implement ref="Serializable"/>
-        <member>
-            <method name="readObject">
-                <modifier>private</modifier>
-                <param>ObjectInputStream</param>
-                <type>void</type>
-                <throw>IOException</throw>
-                <throw>ClassNotFoundException</throw>
-            </method>
-            <method name="readExternal">
-                <modifier>public</modifier>
-                <param>ObjectInput</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-            <method name="readResolve">
-                <modifier>protected</modifier>
-                <param>none</param>
-                <type>Object</type>
-                <throw>ObjectStreamException</throw>
-            </method>
-            <method name="readSomethingElse">
-                <modifier>public</modifier>
-                <param>Object</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-        </member>
-    </class>
-
-    <class basename="Container">
-        <modifier>public</modifier>
-        <member>
-            <class basename="Inner">
-                <modifier>public</modifier>
+                <modifier>none|abstract</modifier>
                 <member>
-                    <field basename="value">
+                    <field basename="field">
+                        <modifier>none|public</modifier>
+                        <modifier>none|static</modifier>
+                        <modifier>none|final</modifier>
+                        <type>boolean|int|String</type>
+                    </field>
+                    <field basename="field">
+                        <modifier>protected|private</modifier>
+                        <type>String</type>
+                    </field>
+                    <constructor>
                         <modifier>public</modifier>
-                        <type>int</type>
+                        <param>none|int|int,boolean|int,String</param>
+                    </constructor>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>String</param>
+                        <throw>NullPointerException</throw>
+                        <throw>SampleException0</throw>
+                    </constructor>
+                    <method basename="set">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>int</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>int|boolean|String</type>
+                    </method>
+                    <method basename="doSomething">
+                        <modifier>public</modifier>
+                        <type>void|int</type>
+                        <param>none|int|Object,int</param>
+                        <throw>NullPointerException</throw>
+                        <throw>ArithmeticException</throw>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="Derived">
+                <modifier>public</modifier>
+                <extend id="baseclass"/>
+                <member>
+                    <field basename="myField">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </field>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>none|int|int,boolean|int,String</param>
+                    </constructor>
+                    <method basename="myGet">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="SampleSerial">
+                <import>java.io.Serializable</import>
+                <modifier>public</modifier>
+                <implement ref="Serializable"/>
+                <member>
+                    <field basename="specialData">
+                        <modifier>private|none|public</modifier>
+                        <type>boolean|int|String</type>
                     </field>
                 </member>
             </class>
-            <class basename="Nested">
+
+            <class basename="SampleSerial">
+                <import>java.io.Serializable</import>
+                <import>java.io.ObjectStreamField</import>
                 <modifier>public</modifier>
-                <modifier>static</modifier>
-            </class>
-            <interface basename="EventListener">
-                <modifier>public</modifier>
-                <modifier>static</modifier>
+                <implement ref="Serializable"/>
                 <member>
-                    <method basename="onEvent">
-                         <modifier>public</modifier>
-                         <type>void</type>
+                    <serialfield basename="serialField">String,Long,Boolean</serialfield>
+                    <method basename="justToBeHere">
+                        <modifier>public</modifier>
+                        <type>String|long|boolean</type>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="SampleSerial">
+                <import>java.io.Serializable</import>
+                <import>java.io.ObjectOutputStream</import>
+                <import>java.io.ObjectOutput</import>
+                <import>java.io.IOException</import>
+                <import>java.io.ObjectStreamException</import>
+                <modifier>public</modifier>
+                <implement ref="Serializable"/>
+                <member>
+                    <method name="writeObject">
+                        <modifier>private</modifier>
+                        <param>ObjectOutputStream</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                    <method name="writeExternal">
+                        <modifier>public</modifier>
+                        <param>ObjectOutput</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                    <method name="writeReplace">
+                        <modifier>protected</modifier>
+                        <param>none</param>
+                        <type>Object</type>
+                        <throw>ObjectStreamException</throw>
+                    </method>
+                    <method name="writeSomethingElse">
+                        <modifier>public</modifier>
+                        <param>Object</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="SampleSerial">
+                <import>java.io.Serializable</import>
+                <import>java.io.ObjectInputStream</import>
+                <import>java.io.ObjectInput</import>
+                <import>java.io.IOException</import>
+                <import>java.io.ObjectStreamException</import>
+                <modifier>public</modifier>
+                <implement ref="Serializable"/>
+                <member>
+                    <method name="readObject">
+                        <modifier>private</modifier>
+                        <param>ObjectInputStream</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                        <throw>ClassNotFoundException</throw>
+                    </method>
+                    <method name="readExternal">
+                        <modifier>public</modifier>
+                        <param>ObjectInput</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                    <method name="readResolve">
+                        <modifier>protected</modifier>
+                        <param>none</param>
+                        <type>Object</type>
+                        <throw>ObjectStreamException</throw>
+                    </method>
+                    <method name="readSomethingElse">
+                        <modifier>public</modifier>
+                        <param>Object</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="Container">
+                <modifier>public</modifier>
+                <member>
+                    <class basename="Inner">
+                        <modifier>public</modifier>
+                        <member>
+                            <field basename="value">
+                                <modifier>public</modifier>
+                                <type>int</type>
+                            </field>
+                        </member>
+                    </class>
+                    <class basename="Nested">
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                    </class>
+                    <interface basename="EventListener">
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                        <member>
+                            <method basename="onEvent">
+                                <modifier>public</modifier>
+                                <type>void</type>
+                            </method>
+                        </member>
+                    </interface>
+                </member> 
+            </class>
+
+            <!-- Errors and exceptions -->
+            <class basename="SampleError">
+                <modifier>public</modifier>
+                <extend ref="java.lang.Error"/>
+                <member>
+                    <field basename="errorInfo">
+                        <modifier>private</modifier>
+                        <type>boolean|int|String</type>
+                    </field>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>String</param>
+                    </constructor>
+                    <method basename="getSampleData">
+                        <modifier>public</modifier>
+                        <type>int|String</type>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="SampleException">
+                <modifier>public</modifier>
+                <extend ref="java.lang.Exception"/>
+                <member>
+                    <field basename="exceptionInfo">
+                        <modifier>private</modifier>
+                        <type>boolean|int|String</type>
+                    </field>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>String</param>
+                    </constructor>
+                    <method basename="getSampleData">
+                        <modifier>public</modifier>
+                        <type>int|String</type>
+                    </method>
+                </member>
+            </class>
+
+            <interface basename="SampleInterface" id="baseinterface">
+                <modifier>public|none</modifier>
+                <member>
+                    <method basename="method">
+                        <modifier>public</modifier>
+                        <type>void|int|Object</type>
                     </method>
                 </member>
             </interface>
-        </member> 
-    </class>
 
-    <!-- Errors and exceptions -->
-    <class basename="SampleError">
-        <modifier>public</modifier>
-        <extend ref="java.lang.Error"/>
-        <member>
-            <field basename="errorInfo">
-                <modifier>private</modifier>
-                <type>boolean|int|String</type>
-            </field>
-            <constructor>
+            <class basename="Implementor">
                 <modifier>public</modifier>
-                <param>String</param>
-            </constructor>
-            <method basename="getSampleData">
-                <modifier>public</modifier>
-                <type>int|String</type>
-            </method>
-        </member>
-    </class>
+                <implement id="baseinterface"/>
+                <member>
+                    <field basename="myField">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </field>
+                    <method basename="myGet">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="SampleException">
-        <modifier>public</modifier>
-        <extend ref="java.lang.Exception"/>
-        <member>
-            <field basename="exceptionInfo">
-                <modifier>private</modifier>
-                <type>boolean|int|String</type>
-            </field>
-            <constructor>
+            <class basename="GenericClass" tparam="T">
+                <import>java.util.List</import>
                 <modifier>public</modifier>
-                <param>String</param>
-            </constructor>
-            <method basename="getSampleData">
-                <modifier>public</modifier>
-                <type>int|String</type>
-            </method>
-        </member>
-    </class>
+                <member>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>T</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>T</type>
+                        <param>int</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>List&lt;T&gt;</type>
+                    </method>
+                </member>
+            </class>
 
-    <interface basename="SampleInterface" id="baseinterface">
-        <modifier>public|none</modifier>
-        <member>
-            <method basename="method">
+            <class basename="GenericClass" tparam="K,V">
+                <import>java.util.Set</import>
+                <import>java.util.List</import>
+                <import>java.util.Map</import>
                 <modifier>public</modifier>
-                <type>void|int|Object</type>
-            </method>
-        </member>
-    </interface>
+                <member>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>K,V</param>
+                    </method>
+                    <method basename="putMap">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>Map&lt;K,V&gt;</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>V</type>
+                        <param>K</param>
+                    </method>
+                    <method basename="getV">
+                        <modifier>public</modifier>
+                        <type>Set&lt;V&gt;|List&lt;V&gt;</type>
+                    </method>
+                    <method basename="getK">
+                        <modifier>public</modifier>
+                        <type>Set&lt;K&gt;|List&lt;K&gt;</type>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="Implementor">
-        <modifier>public</modifier>
-        <implement id="baseinterface"/>
-        <member>
-            <field basename="myField">
+            <class basename="GenericClass" tparam="M,N,O">
+                <import>java.util.Set</import>
+                <import>java.util.List</import>
+                <import>java.util.Map</import>
                 <modifier>public</modifier>
-                <type>int|boolean</type>
-            </field>
-            <method basename="myGet">
-                <modifier>public</modifier>
-                <type>int|boolean</type>
-            </method>
-        </member>
-    </class>
+                <member>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>Set&lt;M&gt;|List&lt;M&gt;</type>
+                        <param>Map&lt;N,O&gt;</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>Set&lt;N&gt;|List&lt;N&gt;</type>
+                        <param>Map&lt;M,O&gt;</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>Set&lt;O&gt;|List&lt;O&gt;</type>
+                        <param>Map&lt;M,N&gt;</param>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="GenericClass" tparam="T">
-        <import>java.util.List</import>
-        <modifier>public</modifier>
-        <member>
-            <method basename="put">
+            <class basename="GenericUtil"> <!-- public static generic methods like Collections -->
+                <import>java.util.Set</import>
+                <import>java.util.List</import>
+                <import>java.util.Map</import>
+                <import>java.util.function.Supplier</import>
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>T</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>T</type>
-                <param>int</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>List&lt;T&gt;</type>
-            </method>
-        </member>
-    </class>
+                <member>
+                    <method tparam="E" basename="getSomething">
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                        <type>Set&lt;? extends E&gt;|List&lt;? extends E&gt;</type>
+                    </method>
+                    <method tparam="V,K" basename="getMore">
+                        <modifier>public|private</modifier>
+                        <modifier>static</modifier>
+                        <type>Map&lt;V,K&gt;</type>
+                    </method>
+                    <method tparam="E" basename="doSomething">
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                        <type>void</type>
+                        <param>E</param>
+                    </method>
+                    <method tparam="X extends Throwable" basename="orElseThrow">
+                        <modifier>public|private</modifier>
+                        <modifier>static</modifier>
+                        <type>X</type>
+                        <param>Supplier&lt;? extends X&gt;</param>
+                        <throw>X</throw>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="GenericClass" tparam="K,V">
-        <import>java.util.Set</import>
-        <import>java.util.List</import>
-        <import>java.util.Map</import>
-        <modifier>public</modifier>
-        <member>
-            <method basename="put">
+            <enum basename="SampleEnum">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>K,V</param>
-            </method>
-            <method basename="putMap">
-                <modifier>public</modifier>
-                <type>void</type>
-                <param>Map&lt;K,V&gt;</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>V</type>
-                <param>K</param>
-            </method>
-            <method basename="getV">
-                <modifier>public</modifier>
-                <type>Set&lt;V&gt;|List&lt;V&gt;</type>
-            </method>
-            <method basename="getK">
-                <modifier>public</modifier>
-                <type>Set&lt;K&gt;|List&lt;K&gt;</type>
-            </method>
-        </member>
-    </class>
-
-    <class basename="GenericClass" tparam="M,N,O">
-        <import>java.util.Set</import>
-        <import>java.util.List</import>
-        <import>java.util.Map</import>
-        <modifier>public</modifier>
-        <member>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>Set&lt;M&gt;|List&lt;M&gt;</type>
-                <param>Map&lt;N,O&gt;</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>Set&lt;N&gt;|List&lt;N&gt;</type>
-                <param>Map&lt;M,O&gt;</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>Set&lt;O&gt;|List&lt;O&gt;</type>
-                <param>Map&lt;M,N&gt;</param>
-            </method>
-        </member>
-    </class>
-
-    <class basename="GenericUtil"> <!-- public static generic methods like Collections -->
-        <import>java.util.Set</import>
-        <import>java.util.List</import>
-        <import>java.util.Map</import>
-        <import>java.util.function.Supplier</import>
-        <modifier>public</modifier>
-        <member>
-            <method tparam="E" basename="getSomething">
-                <modifier>public</modifier>
-                <modifier>static</modifier>
-                <type>Set&lt;? extends E&gt;|List&lt;? extends E&gt;</type>
-            </method>
-            <method tparam="V,K" basename="getMore">
-                <modifier>public|private</modifier>
-                <modifier>static</modifier>
-                <type>Map&lt;V,K&gt;</type>
-            </method>
-            <method tparam="E" basename="doSomething">
-                <modifier>public</modifier>
-                <modifier>static</modifier>
-                <type>void</type>
-                <param>E</param>
-            </method>
-            <method tparam="X extends Throwable" basename="orElseThrow">
-                <modifier>public|private</modifier>
-                <modifier>static</modifier>
-                <type>X</type>
-                <param>Supplier&lt;? extends X&gt;</param>
-                <throw>X</throw>
-            </method>
-        </member>
-    </class>
-
-    <enum basename="SampleEnum">
-        <modifier>public</modifier>
-        <member>
-            <constant basename="VALUE" count="3"/>
-        </member>
-    </enum>
+                <member>
+                    <constant basename="VALUE" count="3"/>
+                </member>
+            </enum>
         
-    <enum basename="SampleEnum">
-        <modifier>public</modifier>
-        <member>
-            <constant basename="VALUE" count="2"/>
-            <constant basename="NOVALUE" count="1"/>
-            <field basename="field">
-                <modifier>private</modifier>
-                <type>int|String</type>
-            </field>
-            <method basename="method">
+            <enum basename="SampleEnum">
                 <modifier>public</modifier>
-                <type>void|String</type>
-            </method>
-        </member>
-    </enum>
+                <member>
+                    <constant basename="VALUE" count="2"/>
+                    <constant basename="NOVALUE" count="1"/>
+                    <field basename="field">
+                        <modifier>private</modifier>
+                        <type>int|String</type>
+                    </field>
+                    <method basename="method">
+                        <modifier>public</modifier>
+                        <type>void|String</type>
+                    </method>
+                </member>
+            </enum>
 
-    <annodecl id="documented">
-        <class>Documented</class>
-    </annodecl>
+            <annodecl id="documented">
+                <class>Documented</class>
+            </annodecl>
 
-    <annodecl id="reten-source">
-        <class>Retention</class>
-        <arg name="value" value="RetentionPolicy.SOURCE"/>
-    </annodecl>
+            <annodecl id="reten-source">
+                <class>Retention</class>
+                <arg name="value" value="RetentionPolicy.SOURCE"/>
+            </annodecl>
 
-    <annodecl id="reten-class">
-        <class>Retention</class>
-        <arg name="value" value="RetentionPolicy.CLASS"/>
-    </annodecl>
+            <annodecl id="reten-class">
+                <class>Retention</class>
+                <arg name="value" value="RetentionPolicy.CLASS"/>
+            </annodecl>
 
-    <annodecl id="reten-runtime">
-        <class>Retention</class>
-        <arg name="value" value="RetentionPolicy.RUNTIME"/>
-    </annodecl>
+            <annodecl id="reten-runtime">
+                <class>Retention</class>
+                <arg name="value" value="RetentionPolicy.RUNTIME"/>
+            </annodecl>
 
-    <annodecl id="target-method">
-        <class>Target</class>
-        <arg value="ElementType.METHOD"/>
-    </annodecl>
+            <annodecl id="target-method">
+                <class>Target</class>
+                <arg value="ElementType.METHOD"/>
+            </annodecl>
 
-    <annodecl id="target-field">
-        <class>Target</class>
-        <arg value="ElementType.FIELD"/>
-    </annodecl>
+            <annodecl id="target-field">
+                <class>Target</class>
+                <arg value="ElementType.FIELD"/>
+            </annodecl>
 
-    <annodecl id="target-type">
-        <class>Target</class>
-        <arg value="{ElementType.TYPE, ElementType.TYPE_USE}"/>
-    </annodecl>
+            <annodecl id="target-type">
+                <class>Target</class>
+                <arg value="{ElementType.TYPE, ElementType.TYPE_USE}"/>
+            </annodecl>
 
-    <annotation basename="AnnotatedAnno">
-        <import>java.lang.annotation.Documented</import>
-        <anno>@documented</anno>
-        <modifier>public</modifier>
-        <member>
-            <method basename="value">
-                <modifier>public</modifier>
-                <type>boolean|String</type>
-            </method>
-        </member>
-    </annotation>
-
-    <annotation basename="AnnotatedAnno">
-        <import>java.lang.annotation.Retention</import>
-        <import>java.lang.annotation.RetentionPolicy</import>
-        <anno>@reten-source|@reten-class|@reten-runtime</anno>
-        <modifier>public</modifier>
-        <member>
-            <method basename="value">
-                <modifier>public</modifier>
-                <type>int</type>
-            </method>
-        </member>
-    </annotation>
-
-    <class basename="AnnoContainer">
-        <import>java.lang.annotation.Retention</import>
-        <import>java.lang.annotation.RetentionPolicy</import>
-        <import>java.lang.annotation.Target</import>
-        <import>java.lang.annotation.ElementType</import>
-        <modifier>public</modifier>
-        <member>
             <annotation basename="AnnotatedAnno">
-                <anno>@reten-source|@reten-class|@reten-runtime</anno>
-                <anno>@target-method|@target-field|@target-type</anno>
+                <import>java.lang.annotation.Documented</import>
+                <anno>@documented</anno>
                 <modifier>public</modifier>
-                <modifier>static</modifier>
                 <member>
                     <method basename="value">
                         <modifier>public</modifier>
-                        <type>String</type>
+                        <type>boolean|String</type>
                     </method>
                 </member>
             </annotation>
-        </member>
-    </class>
 
-    <annodecl id="deprecated">
-        <class>Deprecated</class>
-    </annodecl>
-
-    <annodecl id="safevarargs">
-        <class>SafeVarargs</class>
-    </annodecl>
-
-    <annodecl id="suppresswarnings">
-        <class>SuppressWarnings</class>
-        <arg value="{&quot;unchecked&quot;, &quot;rawtypes&quot;}"/>
-    </annodecl>
-
-    <class basename="AnnotatedClass">
-        <modifier>public</modifier>
-        <member>
-            <method basename="deprecatedMethod">
-                <anno>@deprecated</anno>
+            <annotation basename="AnnotatedAnno">
+                <import>java.lang.annotation.Retention</import>
+                <import>java.lang.annotation.RetentionPolicy</import>
+                <anno>@reten-source|@reten-class|@reten-runtime</anno>
                 <modifier>public</modifier>
-                <type>void</type>
-            </method>
-            <method basename="safeVarargsMethod">
-                <anno>@safevarargs</anno>
+                <member>
+                    <method basename="value">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </method>
+                </member>
+            </annotation>
+
+            <class basename="AnnoContainer">
+                <import>java.lang.annotation.Retention</import>
+                <import>java.lang.annotation.RetentionPolicy</import>
+                <import>java.lang.annotation.Target</import>
+                <import>java.lang.annotation.ElementType</import>
                 <modifier>public</modifier>
-                <type>void|int</type>
-                <param>String...</param>
-            </method>
-            <method basename="suppressWarningsMethod">
-                <anno>@suppresswarnings</anno>
+                <member>
+                    <annotation basename="AnnotatedAnno">
+                        <anno>@reten-source|@reten-class|@reten-runtime</anno>
+                        <anno>@target-method|@target-field|@target-type</anno>
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                        <member>
+                            <method basename="value">
+                                <modifier>public</modifier>
+                                <type>String</type>
+                            </method>
+                        </member>
+                    </annotation>
+                </member>
+            </class>
+
+            <annodecl id="deprecated">
+                <class>Deprecated</class>
+            </annodecl>
+
+            <annodecl id="safevarargs">
+                <class>SafeVarargs</class>
+            </annodecl>
+
+            <annodecl id="suppresswarnings">
+                <class>SuppressWarnings</class>
+                <arg value="{&quot;unchecked&quot;, &quot;rawtypes&quot;}"/>
+            </annodecl>
+
+            <class basename="AnnotatedClass">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>int|Object</param>
-            </method>
-        </member>
-    </class>
-</package>
+                <member>
+                    <method basename="deprecatedMethod">
+                        <anno>@deprecated</anno>
+                        <modifier>public</modifier>
+                        <type>void</type>
+                    </method>
+                    <method basename="safeVarargsMethod">
+                        <anno>@safevarargs</anno>
+                        <modifier>public</modifier>
+                        <type>void|int</type>
+                        <param>String...</param>
+                    </method>
+                    <method basename="suppressWarningsMethod">
+                        <anno>@suppresswarnings</anno>
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>int|Object</param>
+                    </method>
+                </member>
+            </class>
+        </package>
+    </module>
+</sampleapi>
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/res/sub.xml b/langtools/test/jdk/javadoc/tool/sampleapi/res/sub.xml
index ff007c7..875b1ae 100644
--- a/langtools/test/jdk/javadoc/tool/sampleapi/res/sub.xml
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/res/sub.xml
@@ -21,69 +21,72 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
-<package name="sampleapi.simple.sub">
+<sampleapi>
+    <module name="UNNAMED">
+        <package name="sampleapi.simple.sub">
+            <class basename="SClass">
+                <modifier>public</modifier>
+                <modifier>none|abstract</modifier>
+                <implement>SInterface0</implement>
+                <member>
+                    <field basename="id">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </field>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                        <throw>SException0</throw>
+                    </method>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <param>int</param>
+                        <type>void</type>
+                        <throw>SException0</throw>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="SClass">
-        <modifier>public</modifier>
-        <modifier>none|abstract</modifier>
-        <implement>SInterface0</implement>
-        <member>
-            <field basename="id">
+            <class basename="SException">
                 <modifier>public</modifier>
-                <type>int</type>
-            </field>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>int</type>
-                <throw>SException0</throw>
-            </method>
-            <method basename="put">
-                <modifier>public</modifier>
-                <param>int</param>
-                <type>void</type>
-                <throw>SException0</throw>
-            </method>
-        </member>
-    </class>
+                <extend ref="java.lang.Exception"/>
+                <member>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>String</param>
+                    </constructor>
+                </member>
+            </class>
 
-    <class basename="SException">
-        <modifier>public</modifier>
-        <extend ref="java.lang.Exception"/>
-        <member>
-            <constructor>
+            <interface basename="SInterface">
                 <modifier>public</modifier>
-                <param>String</param>
-            </constructor>
-        </member>
-    </class>
+                <member>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>int</param>
+                    </method>
+                </member>
+            </interface>
 
-    <interface basename="SInterface">
-        <modifier>public</modifier>
-        <member>
-            <method basename="put">
+            <enum basename="SEnum">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>int</param>
-            </method>
-        </member>
-    </interface>
+                <member>
+                    <constant basename="ON" count="1"/>
+                    <constant basename="OFF" count="1"/>
+                </member>
+            </enum>
 
-    <enum basename="SEnum">
-        <modifier>public</modifier>
-        <member>
-            <constant basename="ON" count="1"/>
-            <constant basename="OFF" count="1"/>
-        </member>
-    </enum>
-
-    <annotation basename="SAnno">
-        <modifier>public</modifier>
-        <member>
-            <method basename="value">
+            <annotation basename="SAnno">
                 <modifier>public</modifier>
-                <type>boolean</type>
-            </method>
-        </member>
-    </annotation>
+                <member>
+                    <method basename="value">
+                        <modifier>public</modifier>
+                        <type>boolean</type>
+                    </method>
+                </member>
+            </annotation>
         
-</package>
+        </package>
+    </module>
+</sampleapi>
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/res/tiny.xml b/langtools/test/jdk/javadoc/tool/sampleapi/res/tiny.xml
index 1bf631f..1e33f83 100644
--- a/langtools/test/jdk/javadoc/tool/sampleapi/res/tiny.xml
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/res/tiny.xml
@@ -21,51 +21,53 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
-<package name="sampleapi.tiny" module="sat.sampleapi">
-
-    <class basename="TinyClass">
-        <modifier>public</modifier>
-        <modifier>none|abstract</modifier>
-        <member>
-            <field basename="id">
+<sampleapi>
+    <module name="UNNAMED">
+        <package name="sampleapi.tiny" module="sat.sampleapi">
+            <class basename="TinyClass">
                 <modifier>public</modifier>
-                <type>int</type>
-            </field>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>int</type>
-            </method>
-        </member>
-    </class>
+                <modifier>none|abstract</modifier>
+                <member>
+                    <field basename="id">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </field>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </method>
+                </member>
+            </class>
 
-    <interface basename="TinyInterface">
-        <modifier>public</modifier>
-        <member>
-            <method basename="put">
+            <interface basename="TinyInterface">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>int</param>
-            </method>
-        </member>
-    </interface>
+                <member>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>int</param>
+                    </method>
+                </member>
+            </interface>
 
-    <enum basename="TinyEnum">
-        <modifier>public</modifier>
-        <member>
-            <constant basename="YES" count="1"/>
-            <constant basename="NO" count="1"/>
-            <constant basename="MAYBE" count="1"/>
-        </member>
-    </enum>
-
-    <annotation basename="TinyAnno">
-        <modifier>public</modifier>
-        <member>
-            <method basename="value">
+            <enum basename="TinyEnum">
                 <modifier>public</modifier>
-                <type>boolean</type>
-            </method>
-        </member>
-    </annotation>
-        
-</package>
+                <member>
+                    <constant basename="YES" count="1"/>
+                    <constant basename="NO" count="1"/>
+                    <constant basename="MAYBE" count="1"/>
+                </member>
+            </enum>
+
+            <annotation basename="TinyAnno">
+                <modifier>public</modifier>
+                <member>
+                    <method basename="value">
+                        <modifier>public</modifier>
+                        <type>boolean</type>
+                    </method>
+                </member>
+            </annotation>
+        </package>
+    </module>
+</sampleapi>
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/res/tinysub.xml b/langtools/test/jdk/javadoc/tool/sampleapi/res/tinysub.xml
index 99b181f..e4826e2 100644
--- a/langtools/test/jdk/javadoc/tool/sampleapi/res/tinysub.xml
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/res/tinysub.xml
@@ -21,69 +21,71 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
-<package name="sampleapi.tiny.sub" module="sat.sampleapi">
+<sampleapi>
+    <module name="UNNAMED">
+        <package name="sampleapi.tiny.sub" module="sat.sampleapi">
+            <class basename="TSClass">
+                <modifier>public</modifier>
+                <modifier>none|abstract</modifier>
+                <implement>TSInterface0</implement>
+                <member>
+                    <field basename="id">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </field>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                        <throw>TSException0</throw>
+                    </method>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <param>int</param>
+                        <type>void</type>
+                        <throw>TSException0</throw>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="TSClass">
-        <modifier>public</modifier>
-        <modifier>none|abstract</modifier>
-        <implement>TSInterface0</implement>
-        <member>
-            <field basename="id">
+            <class basename="TSException">
                 <modifier>public</modifier>
-                <type>int</type>
-            </field>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>int</type>
-                <throw>TSException0</throw>
-            </method>
-            <method basename="put">
-                <modifier>public</modifier>
-                <param>int</param>
-                <type>void</type>
-                <throw>TSException0</throw>
-            </method>
-        </member>
-    </class>
+                <extend ref="java.lang.Exception"/>
+                <member>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>String</param>
+                    </constructor>
+                </member>
+            </class>
 
-    <class basename="TSException">
-        <modifier>public</modifier>
-        <extend ref="java.lang.Exception"/>
-        <member>
-            <constructor>
+            <interface basename="TSInterface">
                 <modifier>public</modifier>
-                <param>String</param>
-            </constructor>
-        </member>
-    </class>
+                <member>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>int</param>
+                    </method>
+                </member>
+            </interface>
 
-    <interface basename="TSInterface">
-        <modifier>public</modifier>
-        <member>
-            <method basename="put">
+            <enum basename="TSEnum">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>int</param>
-            </method>
-        </member>
-    </interface>
+                <member>
+                    <constant basename="ON" count="1"/>
+                    <constant basename="OFF" count="1"/>
+                </member>
+            </enum>
 
-    <enum basename="TSEnum">
-        <modifier>public</modifier>
-        <member>
-            <constant basename="ON" count="1"/>
-            <constant basename="OFF" count="1"/>
-        </member>
-    </enum>
-
-    <annotation basename="TSAnno">
-        <modifier>public</modifier>
-        <member>
-            <method basename="value">
+            <annotation basename="TSAnno">
                 <modifier>public</modifier>
-                <type>boolean</type>
-            </method>
-        </member>
-    </annotation>
-        
-</package>
+                <member>
+                    <method basename="value">
+                        <modifier>public</modifier>
+                        <type>boolean</type>
+                    </method>
+                </member>
+            </annotation> 
+        </package>
+    </module>
+</sampleapi>
diff --git a/langtools/test/jdk/javadoc/tool/sampleapi/res/transitive.xml b/langtools/test/jdk/javadoc/tool/sampleapi/res/transitive.xml
new file mode 100644
index 0000000..22a79ea
--- /dev/null
+++ b/langtools/test/jdk/javadoc/tool/sampleapi/res/transitive.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ 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.
+-->
+<sampleapi>
+    <module name="my.first.module" id="first">
+        <exports package="$exported"/>
+        <exports package="$exported.to">
+            <to module="$second"/>
+        </exports>
+        <opens package="$internal">
+            <to module="$second"/>
+        </opens>
+        <uses service="$service"/>
+        <package name="sampleapi.exported" id="exported">
+            <class basename="API" id="service">
+                <modifier>public</modifier>
+                <member>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>Object</type>
+                    </method>
+                </member>
+            </class>
+        </package>
+        <package name="sampleapi.exported.to"  id="exported.to">
+            <class basename="API" id="baseclass">
+                <modifier>public</modifier>
+                <member>
+                    <method basename="put">
+                        <param>Object</param>
+                        <type>void</type>
+                    </method>
+                </member>
+            </class>
+        </package>
+        <package name="sampleapi.not.exported" id="internal">
+            <class basename="AnImplementationDetail"/>
+        </package>
+    </module>
+    <module name="my.second.module" id="second" kind="open">
+        <requires module="$first" transitive="true"/>
+        <requires module="java.xml" static="true"/>
+        <provides service="$service">
+            <implementation class="$second.impl"/>
+            <implementation class="$third.impl"/>
+        </provides>
+        <package name="sampleapi.exported.second">
+            <class basename="API" id="second.impl">
+                <extend id="baseclass"/>
+            </class>
+            <class basename="OtherAPI" id="third.impl">
+                <extend id="baseclass"/>
+            </class>
+            <class basename="TClass">
+                <modifier>public</modifier>
+                <modifier>none|abstract</modifier>
+                <implement>SInterface0</implement>
+                <member>
+                    <field basename="id">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </field>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                        <throw>SException0</throw>
+                    </method>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <param>int</param>
+                        <type>void</type>
+                        <throw>SException0</throw>
+                    </method>
+                </member>
+            </class>
+        </package>
+    </module>
+</sampleapi>
diff --git a/langtools/test/jdk/jshell/CommandCompletionTest.java b/langtools/test/jdk/jshell/CommandCompletionTest.java
index 31559d9..4424604 100644
--- a/langtools/test/jdk/jshell/CommandCompletionTest.java
+++ b/langtools/test/jdk/jshell/CommandCompletionTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8144095 8164825 8169818 8153402 8165405
+ * @bug 8144095 8164825 8169818 8153402 8165405 8177079 8178013
  * @summary Test Command Completion
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -173,7 +173,11 @@
                 "/save ", "/set "),
                 a -> assertCompletion(a, "/help /set |", false,
                 "editor", "feedback", "format", "mode", "prompt", "start", "truncation"),
-                a -> assertCompletion(a, "/help /edit |", false)
+                a -> assertCompletion(a, "/help set |", false,
+                "editor", "feedback", "format", "mode", "prompt", "start", "truncation"),
+                a -> assertCompletion(a, "/help /edit |", false),
+                a -> assertCompletion(a, "/help dr|", false,
+                "drop ")
         );
     }
 
diff --git a/langtools/test/jdk/jshell/CompletionSuggestionTest.java b/langtools/test/jdk/jshell/CompletionSuggestionTest.java
index 7873e43..5285d52 100644
--- a/langtools/test/jdk/jshell/CompletionSuggestionTest.java
+++ b/langtools/test/jdk/jshell/CompletionSuggestionTest.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8131025 8141092 8153761 8145263 8131019
+ * @bug 8131025 8141092 8153761 8145263 8131019 8175886 8176184 8176241
  * @summary Test Completion and Documentation
  * @library /tools/lib
  * @modules jdk.compiler/com.sun.tools.javac.api
@@ -295,6 +295,10 @@
                 new HashSet<>(Arrays.asList("class")));
     }
 
+    public void testImportStart() {
+        assertCompletion("import c|", "com");
+    }
+
     public void testBrokenClassFile() throws Exception {
         Compiler compiler = new Compiler();
         Path testOutDir = Paths.get("CompletionTestBrokenClassFile");
diff --git a/langtools/test/jdk/jshell/FileManagerTest.java b/langtools/test/jdk/jshell/FileManagerTest.java
new file mode 100644
index 0000000..9e4f063
--- /dev/null
+++ b/langtools/test/jdk/jshell/FileManagerTest.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test 8173845
+ * @summary test custom file managers
+ * @build KullaTesting TestingInputStream
+ * @run testng FileManagerTest
+ */
+
+
+import java.io.File;
+import java.io.IOException;
+
+import java.util.Set;
+import javax.tools.ForwardingJavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
+import javax.tools.StandardJavaFileManager;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertTrue;
+
+@Test
+public class FileManagerTest extends KullaTesting {
+
+    boolean encountered;
+
+    class MyFileManager extends ForwardingJavaFileManager<StandardJavaFileManager>
+            implements StandardJavaFileManager {
+
+        protected MyFileManager(StandardJavaFileManager fileManager) {
+            super(fileManager);
+        }
+
+        @Override
+        public Iterable<JavaFileObject> list(Location location,
+                String packageName,
+                Set<Kind> kinds,
+                boolean recurse)
+                throws IOException {
+            //System.out.printf("list(%s, %s, %s, %b)\n",
+            //        location, packageName, kinds, recurse);
+            if (packageName.equals("java.lang.reflect")) {
+                encountered = true;
+            }
+            return fileManager.list(location, packageName, kinds, recurse);
+        }
+
+        @Override
+        public Iterable<? extends JavaFileObject> getJavaFileObjectsFromFiles(Iterable<? extends File> files) {
+            return fileManager.getJavaFileObjectsFromFiles(files);
+        }
+
+        @Override
+        public Iterable<? extends JavaFileObject> getJavaFileObjects(File... files) {
+            return fileManager.getJavaFileObjects(files);
+        }
+
+        @Override
+        public Iterable<? extends JavaFileObject> getJavaFileObjectsFromStrings(Iterable<String> names) {
+            return fileManager.getJavaFileObjectsFromStrings(names);
+        }
+
+        @Override
+        public Iterable<? extends JavaFileObject> getJavaFileObjects(String... names) {
+            return fileManager.getJavaFileObjects(names);
+        }
+
+        @Override
+        public void setLocation(Location location, Iterable<? extends File> files) throws IOException {
+            fileManager.setLocation(location, files);
+        }
+
+        @Override
+        public Iterable<? extends File> getLocation(Location location) {
+            return fileManager.getLocation(location);
+        }
+
+    }
+
+    @BeforeMethod
+    @Override
+    public void setUp() {
+        setUp(b -> b.fileManager(fm -> new MyFileManager(fm)));
+    }
+
+    public void testSnippetMemberAssignment() {
+        assertEval("java.lang.reflect.Array.get(new String[1], 0) == null");
+        assertTrue(encountered, "java.lang.reflect not encountered");
+    }
+
+}
diff --git a/langtools/test/jdk/jshell/HistoryUITest.java b/langtools/test/jdk/jshell/HistoryUITest.java
new file mode 100644
index 0000000..3e6f52a
--- /dev/null
+++ b/langtools/test/jdk/jshell/HistoryUITest.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8178077
+ * @summary Check the UI behavior of editing history.
+ * @modules
+ *     jdk.compiler/com.sun.tools.javac.api
+ *     jdk.compiler/com.sun.tools.javac.main
+ *     jdk.jshell/jdk.jshell:open
+ * @library /tools/lib
+ * @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
+ * @build Compiler UITesting
+ * @build HistoryUITest
+ * @run testng HistoryUITest
+ */
+
+import org.testng.annotations.Test;
+
+@Test
+public class HistoryUITest extends UITesting {
+
+    public void testPrevNextSnippet() throws Exception {
+        doRunTest((inputSink, out) -> {
+            inputSink.write("void test1() {\nSystem.err.println(1);\n}\n");
+            waitOutput(out, "\u0005");
+            inputSink.write("void test2() {\nSystem.err.println(2);\n}\n");
+            waitOutput(out, "\u0005");
+            inputSink.write(CTRL_UP);
+            waitOutput(out, "^void test2\\(\\) \\{");
+            inputSink.write(CTRL_UP);
+            waitOutput(out, "^" + clearOut("2() {") + "1\\(\\) \\{");
+            inputSink.write(CTRL_DOWN);
+            waitOutput(out, "^" + clearOut("1() {") + "2\\(\\) \\{");
+            inputSink.write(ENTER);
+            waitOutput(out, "^\n\u0006");
+            inputSink.write(UP);
+            waitOutput(out, "^}");
+            inputSink.write(UP);
+            waitOutput(out, "^" + clearOut("}") + "System.err.println\\(2\\);");
+            inputSink.write(UP);
+            waitOutput(out, "^" + clearOut("System.err.println(2);") + "void test2\\(\\) \\{");
+            inputSink.write(UP);
+            waitOutput(out, "^\u0007");
+            inputSink.write(DOWN);
+            waitOutput(out, "^" + clearOut("void test2() {") + "System.err.println\\(2\\);");
+            inputSink.write(DOWN);
+            waitOutput(out, "^" + clearOut("System.err.println(2);") + "}");
+            inputSink.write(DOWN);
+            waitOutput(out, "^" + clearOut("}"));
+            inputSink.write(DOWN);
+            waitOutput(out, "^\u0007");
+        });
+    }
+    //where:
+        private static final String CTRL_UP = "\033[1;5A";
+        private static final String CTRL_DOWN = "\033[1;5B";
+        private static final String UP = "\033[A";
+        private static final String DOWN = "\033[B";
+        private static final String ENTER = "\n";
+
+}
diff --git a/langtools/test/jdk/jshell/JavadocTest.java b/langtools/test/jdk/jshell/JavadocTest.java
index a43ef91..184921a 100644
--- a/langtools/test/jdk/jshell/JavadocTest.java
+++ b/langtools/test/jdk/jshell/JavadocTest.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8131019 8169561
+ * @bug 8131019 8169561 8174245
  * @summary Test Javadoc
  * @library /tools/lib
  * @modules jdk.compiler/com.sun.tools.javac.api
@@ -107,4 +107,51 @@
         addToClasspath(compiler.getClassDir());
     }
 
+    public void testCollectionsMin() {
+        prepareJavaUtilZip();
+        assertJavadoc("java.util.Collections.min(|",
+                      "T java.util.Collections.<T>min(java.util.Collection<? extends T> coll, java.util.Comparator<? super T> comp)\n" +
+                       " min comparator\n",
+                       "T java.util.Collections.<T extends Object & Comparable<? super T>>min(java.util.Collection<? extends T> coll)\n" +
+                       " min comparable\n");
+    }
+
+    private void prepareJavaUtilZip() {
+        String clazz =
+                "package java.util;\n" +
+                "/**Top level." +
+                " */\n" +
+                "public class Collections {\n" +
+                "    /**\n" +
+                "     * min comparable\n" +
+                "     */\n" +
+                "    public static <T extends Object & Comparable<? super T>> T min(Collection<? extends T> coll) {" +
+                "        return null;\n" +
+                "    }\n" +
+                "    /**\n" +
+                "     * min comparator\n" +
+                "     */\n" +
+                "        public static <T> T min(Collection<? extends T> coll, Comparator<? super T> comp) {\n" +
+                "        return null;\n" +
+                "    }\n" +
+                "}\n";
+
+        Path srcZip = Paths.get("src.zip");
+
+        try (JarOutputStream out = new JarOutputStream(Files.newOutputStream(srcZip))) {
+            out.putNextEntry(new JarEntry("java/util/Collections.java"));
+            out.write(clazz.getBytes());
+        } catch (IOException ex) {
+            throw new IllegalStateException(ex);
+        }
+
+        try {
+            Field availableSources = getAnalysis().getClass().getDeclaredField("availableSources");
+            availableSources.setAccessible(true);
+            availableSources.set(getAnalysis(), Arrays.asList(srcZip));
+        } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException ex) {
+            throw new IllegalStateException(ex);
+        }
+    }
+
 }
diff --git a/langtools/test/jdk/jshell/KullaTesting.java b/langtools/test/jdk/jshell/KullaTesting.java
index 1197d03..a2ea8e1 100644
--- a/langtools/test/jdk/jshell/KullaTesting.java
+++ b/langtools/test/jdk/jshell/KullaTesting.java
@@ -30,7 +30,6 @@
 import java.lang.reflect.Method;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
 import java.nio.file.Paths;
 import java.nio.file.Path;
 import java.util.ArrayList;
@@ -211,11 +210,11 @@
 
     public ClassLoader createAndRunFromModule(String moduleName, Path modPath) {
         ModuleFinder finder = ModuleFinder.of(modPath);
-        Layer parent = Layer.boot();
+        ModuleLayer parent = ModuleLayer.boot();
         Configuration cf = parent.configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of(moduleName));
+                .resolve(finder, ModuleFinder.of(), Set.of(moduleName));
         ClassLoader scl = ClassLoader.getSystemClassLoader();
-        Layer layer = parent.defineModulesWithOneLoader(cf, scl);
+        ModuleLayer layer = parent.defineModulesWithOneLoader(cf, scl);
         ClassLoader loader = layer.findLoader(moduleName);
         ClassLoader ccl = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(loader);
diff --git a/langtools/test/jdk/jshell/MergedTabShiftTabTest.java b/langtools/test/jdk/jshell/MergedTabShiftTabTest.java
new file mode 100644
index 0000000..0ff1aea
--- /dev/null
+++ b/langtools/test/jdk/jshell/MergedTabShiftTabTest.java
@@ -0,0 +1,345 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8177076
+ * @modules
+ *     jdk.compiler/com.sun.tools.javac.api
+ *     jdk.compiler/com.sun.tools.javac.main
+ *     jdk.jshell/jdk.internal.jshell.tool.resources:open
+ *     jdk.jshell/jdk.jshell:open
+ * @library /tools/lib
+ * @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
+ * @build Compiler UITesting
+ * @build MergedTabShiftTabTest
+ * @run testng MergedTabShiftTabTest
+ */
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.text.MessageFormat;
+import java.util.Arrays;
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.regex.Pattern;
+
+import jdk.jshell.JShell;
+import org.testng.annotations.Test;
+
+@Test
+public class MergedTabShiftTabTest extends UITesting {
+
+    public void testCommand() throws Exception {
+        doRunTest((inputSink, out) -> {
+            inputSink.write("1\n");
+            waitOutput(out, "\u0005");
+            inputSink.write("/\011");
+            waitOutput(out, ".*/edit.*/list.*\n\n" + Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n\r\u0005/");
+            inputSink.write("\011");
+            waitOutput(out,   ".*\n/edit\n" + Pattern.quote(getResource("help.edit.summary")) +
+                            "\n.*\n/list\n" + Pattern.quote(getResource("help.list.summary")) +
+                            ".*\n\n" + Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/");
+            inputSink.write("\011");
+            waitOutput(out,  "/!\n" +
+                            Pattern.quote(getResource("help.bang")) + "\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.next.command.doc")) + "\n" +
+                            "\r\u0005/");
+            inputSink.write("\011");
+            waitOutput(out,  "/-<n>\n" +
+                            Pattern.quote(getResource("help.previous")) + "\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.next.command.doc")) + "\n" +
+                            "\r\u0005/");
+
+            inputSink.write("lis\011");
+            waitOutput(out, "list $");
+
+            inputSink.write("\011");
+            waitOutput(out, ".*-all.*" +
+                            "\n\n" + Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n\r\u0005/");
+            inputSink.write("\011");
+            waitOutput(out, Pattern.quote(getResource("help.list.summary")) + "\n\n" +
+                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/list ");
+            inputSink.write("\011");
+            waitOutput(out, Pattern.quote(getResource("help.list").replaceAll("\t", "    ")));
+
+            inputSink.write("\u0003/env \011");
+            waitOutput(out, "\u0005/env -\n" +
+                            "-add-exports    -add-modules    -class-path     -module-path    \n" +
+                            "\r\u0005/env -");
+
+            inputSink.write("\011");
+            waitOutput(out, "-add-exports    -add-modules    -class-path     -module-path    \n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n" +
+                            "\r\u0005/env -");
+
+            inputSink.write("\011");
+            waitOutput(out, Pattern.quote(getResource("help.env.summary")) + "\n\n" +
+                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n" +
+                            "\r\u0005/env -");
+
+            inputSink.write("\011");
+            waitOutput(out, Pattern.quote(getResource("help.env").replaceAll("\t", "    ")) + "\n" +
+                            "\r\u0005/env -");
+
+            inputSink.write("\011");
+            waitOutput(out, "-add-exports    -add-modules    -class-path     -module-path    \n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.synopsis")) + "\n" +
+                            "\r\u0005/env -");
+
+            inputSink.write("\u0003/exit \011");
+            waitOutput(out, Pattern.quote(getResource("help.exit.summary")) + "\n\n" +
+                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/exit ");
+            inputSink.write("\011");
+            waitOutput(out, Pattern.quote(getResource("help.exit")) + "\n" +
+                            "\r\u0005/exit ");
+            inputSink.write("\011");
+            waitOutput(out, Pattern.quote(getResource("help.exit.summary")) + "\n\n" +
+                            Pattern.quote(getResource("jshell.console.see.full.documentation")) + "\n\r\u0005/exit ");
+            inputSink.write("\u0003/doesnotexist\011");
+            waitOutput(out, "\u0005/doesnotexist\n" +
+                            Pattern.quote(getResource("jshell.console.no.such.command")) + "\n" +
+                            "\n" +
+                            "\r\u0005/doesnotexist");
+        });
+    }
+
+    public void testExpression() throws Exception {
+        Path classes = prepareZip();
+        doRunTest((inputSink, out) -> {
+            inputSink.write("/env -class-path " + classes.toString() + "\n");
+            waitOutput(out, Pattern.quote(getResource("jshell.msg.set.restore")) + "\n\u0005");
+            inputSink.write("import jshelltest.*;\n");
+            waitOutput(out, "\n\u0005");
+
+            //-> <tab>
+            inputSink.write("\011");
+            waitOutput(out, getMessage("jshell.console.completion.all.completions.number", "[0-9]+"));
+            inputSink.write("\011");
+            waitOutput(out, ".*String.*StringBuilder.*\n\r\u0005");
+
+            //new JShellTes<tab>
+            inputSink.write("new JShellTes\011");
+            waitOutput(out, "t\nJShellTest\\(      JShellTestAux\\(   \n\r\u0005new JShellTest");
+
+            //new JShellTest<tab>
+            inputSink.write("\011");
+            waitOutput(out, "JShellTest\\(      JShellTestAux\\(   \n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            "jshelltest.JShellTest\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
+                            "\r\u0005new JShellTest");
+            inputSink.write("\011");
+            waitOutput(out, "jshelltest.JShellTest\n" +
+                            "JShellTest 0\n" +
+                            "\r\u0005new JShellTest");
+            inputSink.write("\011");
+            waitOutput(out, "JShellTest\\(      JShellTestAux\\(   \n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            "jshelltest.JShellTest\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
+                            "\r\u0005new JShellTest");
+
+            //new JShellTest(<tab>
+            inputSink.write("(\011");
+            waitOutput(out, "\\(\n" +
+                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            "JShellTest\\(String str\\)\n" +
+                            "JShellTest\\(String str, int i\\)\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
+                            "\r\u0005new JShellTest\\(");
+            inputSink.write("\011");
+            waitOutput(out, "JShellTest\\(String str\\)\n" +
+                            "JShellTest 1\n" +
+                            "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.next.page")) + "\n" +
+                            "\r\u0005new JShellTest\\(");
+            inputSink.write("\011");
+            waitOutput(out, "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.next.javadoc")) + "\n" +
+                            "\r\u0005new JShellTest\\(");
+            inputSink.write("\011");
+            waitOutput(out, "JShellTest\\(String str, int i\\)\n" +
+                            "JShellTest 2\n" +
+                            "\n" +
+                            getMessage("jshell.console.completion.all.completions.number", "[0-9]+") + "\n" +
+                            "\r\u0005new JShellTest\\(");
+            inputSink.write("\011");
+            waitOutput(out, ".*String.*StringBuilder.*\n\r\u0005new JShellTest\\(");
+
+            inputSink.write("\u0003String str = \"\";\nnew JShellTest(");
+            waitOutput(out, "\u0005new JShellTest\\(");
+
+            inputSink.write("\011");
+            waitOutput(out, "\n" +
+                            "str   \n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            "JShellTest\\(String str\\)\n" +
+                            "JShellTest\\(String str, int i\\)\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
+                            "\r\u0005new JShellTest\\(");
+            inputSink.write("\011");
+            waitOutput(out, "JShellTest\\(String str\\)\n" +
+                            "JShellTest 1\n" +
+                            "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.next.page")) + "\n" +
+                            "\r\u0005new JShellTest\\(");
+            inputSink.write("\011");
+            waitOutput(out, "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.next.javadoc")) + "\n" +
+                            "\r\u0005new JShellTest\\(");
+            inputSink.write("\011");
+            waitOutput(out, "JShellTest\\(String str, int i\\)\n" +
+                            "JShellTest 2\n" +
+                            "\n" +
+                            getMessage("jshell.console.completion.all.completions.number", "[0-9]+") + "\n" +
+                            "\r\u0005new JShellTest\\(");
+            inputSink.write("\011");
+            waitOutput(out, ".*String.*StringBuilder.*\n\r\u0005new JShellTest\\(");
+
+            inputSink.write("\u0003JShellTest t = new JShellTest\011");
+            waitOutput(out, "\u0005JShellTest t = new JShellTest\n" +
+                            "JShellTest\\(   \n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.completion.current.signatures")) + "\n" +
+                            "jshelltest.JShellTest\n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.completion.all.completions")) + "\n" +
+                            "\r\u0005JShellTest t = new JShellTest");
+            inputSink.write("\011");
+            waitOutput(out, "JShellTest\\(      JShellTestAux\\(   \n" +
+                            "\n" +
+                            Pattern.quote(getResource("jshell.console.see.documentation")) + "\n" +
+                            "\r\u0005JShellTest t = new JShellTest");
+
+            inputSink.write("\u0003JShellTest t = new \011");
+            waitOutput(out, "\u0005JShellTest t = new \n" +
+                            "JShellTest\\(   \n" +
+                            "\n" +
+                            getMessage("jshell.console.completion.all.completions.number", "[0-9]+") + "\n" +
+                            "\r\u0005JShellTest t = new ");
+            inputSink.write("\011");
+            waitOutput(out, ".*String.*StringBuilder.*\n\r\u0005JShellTest t = new ");
+
+            inputSink.write("\u0003class JShelX{}\n");
+            inputSink.write("new JShel\011");
+            waitOutput(out, "\u0005new JShel\n" +
+                            "JShelX\\(\\)         JShellTest\\(      JShellTestAux\\(   \n" +
+                            "\r\u0005new JShel");
+
+            //no crash:
+            inputSink.write("\u0003new Stringbuil\011");
+            waitOutput(out, "\u0005new Stringbuil\u0007");
+        });
+    }
+
+    private Path prepareZip() {
+        String clazz1 =
+                "package jshelltest;\n" +
+                "/**JShellTest 0" +
+                " */\n" +
+                "public class JShellTest {\n" +
+                "    /**JShellTest 1\n" +
+                "     * <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1\n" +
+                "     * <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1\n" +
+                "     * <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1 <p>1\n" +
+                "     */\n" +
+                "    public JShellTest(String str) {}\n" +
+                "    /**JShellTest 2" +
+                "     */\n" +
+                "    public JShellTest(String str, int i) {}\n" +
+                "}\n";
+
+        String clazz2 =
+                "package jshelltest;\n" +
+                "/**JShellTestAux 0" +
+                " */\n" +
+                "public class JShellTestAux {\n" +
+                "    /**JShellTest 1" +
+                "     */\n" +
+                "    public JShellTestAux(String str) { }\n" +
+                "    /**JShellTest 2" +
+                "     */\n" +
+                "    public JShellTestAux(String str, int i) { }\n" +
+                "}\n";
+
+        Path srcZip = Paths.get("src.zip");
+
+        try (JarOutputStream out = new JarOutputStream(Files.newOutputStream(srcZip))) {
+            out.putNextEntry(new JarEntry("jshelltest/JShellTest.java"));
+            out.write(clazz1.getBytes());
+            out.putNextEntry(new JarEntry("jshelltest/JShellTestAux.java"));
+            out.write(clazz2.getBytes());
+        } catch (IOException ex) {
+            throw new IllegalStateException(ex);
+        }
+
+        compiler.compile(clazz1, clazz2);
+
+        try {
+            Field availableSources = Class.forName("jdk.jshell.SourceCodeAnalysisImpl").getDeclaredField("availableSourcesOverride");
+            availableSources.setAccessible(true);
+            availableSources.set(null, Arrays.asList(srcZip));
+        } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException | ClassNotFoundException ex) {
+            throw new IllegalStateException(ex);
+        }
+
+        return compiler.getClassDir();
+    }
+    //where:
+        private final Compiler compiler = new Compiler();
+
+    private final ResourceBundle resources;
+    {
+        resources = ResourceBundle.getBundle("jdk.internal.jshell.tool.resources.l10n", Locale.US, JShell.class.getModule());
+    }
+
+    private String getResource(String key) {
+        return resources.getString(key);
+    }
+
+    private String getMessage(String key, Object... args) {
+        return MessageFormat.format(resources.getString(key), args);
+    }
+
+}
diff --git a/langtools/test/jdk/jshell/MyExecutionControl.java b/langtools/test/jdk/jshell/MyExecutionControl.java
index 15b0e94..8493638 100644
--- a/langtools/test/jdk/jshell/MyExecutionControl.java
+++ b/langtools/test/jdk/jshell/MyExecutionControl.java
@@ -29,6 +29,7 @@
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -78,7 +79,7 @@
                     + System.getProperty("path.separator")
                     + System.getProperty("user.dir"));
             JdiInitiator jdii = new JdiInitiator(port,
-                    opts, REMOTE_AGENT, true, null, TIMEOUT);
+                    opts, REMOTE_AGENT, true, null, TIMEOUT, Collections.emptyMap());
             VirtualMachine vm = jdii.vm();
             Process process = jdii.process();
 
diff --git a/langtools/test/jdk/jshell/ReplToolTesting.java b/langtools/test/jdk/jshell/ReplToolTesting.java
index 3f776ee..5c31292 100644
--- a/langtools/test/jdk/jshell/ReplToolTesting.java
+++ b/langtools/test/jdk/jshell/ReplToolTesting.java
@@ -72,27 +72,27 @@
     final static List<String> START_UP_CMD_METHOD = Stream.<String>of()
                     .collect(toList());
     final static List<String> PRINTING_CMD_METHOD = Stream.of(
-            "|    print (boolean)void",
-            "|    print (char)void",
-            "|    print (int)void",
-            "|    print (long)void",
-            "|    print (float)void",
-            "|    print (double)void",
-            "|    print (char s[])void",
-            "|    print (String)void",
-            "|    print (Object)void",
-            "|    println ()void",
-            "|    println (boolean)void",
-            "|    println (char)void",
-            "|    println (int)void",
-            "|    println (long)void",
-            "|    println (float)void",
-            "|    println (double)void",
-            "|    println (char s[])void",
-            "|    println (String)void",
-            "|    println (Object)void",
-            "|    printf (Locale,String,Object...)void",
-            "|    printf (String,Object...)void")
+            "|    void print(boolean)",
+            "|    void print(char)",
+            "|    void print(int)",
+            "|    void print(long)",
+            "|    void print(float)",
+            "|    void print(double)",
+            "|    void print(char s[])",
+            "|    void print(String)",
+            "|    void print(Object)",
+            "|    void println()",
+            "|    void println(boolean)",
+            "|    void println(char)",
+            "|    void println(int)",
+            "|    void println(long)",
+            "|    void println(float)",
+            "|    void println(double)",
+            "|    void println(char s[])",
+            "|    void println(String)",
+            "|    void println(Object)",
+            "|    void printf(java.util.Locale,String,Object...)",
+            "|    void printf(String,Object...)")
             .collect(toList());
     final static List<String> START_UP = Collections.unmodifiableList(
             Stream.concat(START_UP_IMPORTS.stream(), START_UP_METHODS.stream())
@@ -152,6 +152,7 @@
         return s -> {
             List<String> lines = Stream.of(s.split("\n"))
                     .filter(l -> !l.isEmpty())
+                    .filter(l -> !l.startsWith("|     ")) // error/unresolved info
                     .collect(Collectors.toList());
             assertEquals(lines.size(), set.size(), message + " : expected: " + set.keySet() + "\ngot:\n" + lines);
             for (String line : lines) {
@@ -664,7 +665,12 @@
 
         @Override
         public String toString() {
-            return String.format("%s %s", name, signature);
+            int i = signature.lastIndexOf(")") + 1;
+            if (i <= 0) {
+                return String.format("%s", name);
+            } else {
+                return String.format("%s %s%s", signature.substring(i), name, signature.substring(0, i));
+            }
         }
     }
 
diff --git a/langtools/test/jdk/jshell/ToolBasicTest.java b/langtools/test/jdk/jshell/ToolBasicTest.java
index 389b3b5..93321fb 100644
--- a/langtools/test/jdk/jshell/ToolBasicTest.java
+++ b/langtools/test/jdk/jshell/ToolBasicTest.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405
+ * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405 8174796 8174797 8175304
  * @summary Tests for Basic tests for REPL tool
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -35,6 +35,7 @@
  * @run testng/timeout=600 ToolBasicTest
  */
 
+import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -272,23 +273,84 @@
         );
     }
 
-    public void testClasspathJar() {
+    public void testEnvInStartUp() {
+        Compiler compiler = new Compiler();
+        Path outDir = Paths.get("testClasspathDirectory");
+        compiler.compile(outDir, "package pkg; public class A { public String toString() { return \"A\"; } }");
+        Path classpath = compiler.getPath(outDir);
+        Path sup = compiler.getPath("startup.jsh");
+        compiler.writeToFile(sup,
+                "int xxx;\n" +
+                "/env -class-path " + classpath + "\n" +
+                "int aaa = 735;\n"
+        );
+        test(
+                (a) -> assertCommand(a, "/set start -retain " + sup, ""),
+                (a) -> assertCommand(a, "/reset",
+                        "|  Resetting state."),
+                (a) -> evaluateExpression(a, "pkg.A", "new pkg.A();", "A"),
+                (a) -> assertCommand(a, "aaa", "aaa ==> 735")
+        );
+        test(
+                (a) -> assertCommandOutputContains(a, "/env", "--class-path"),
+                (a) -> assertCommandOutputContains(a, "xxx", "cannot find symbol", "variable xxx"),
+                (a) -> evaluateExpression(a, "pkg.A", "new pkg.A();", "A"),
+                (a) -> assertCommand(a, "aaa", "aaa ==> 735")
+        );
+    }
+
+    private String makeSimpleJar() {
         Compiler compiler = new Compiler();
         Path outDir = Paths.get("testClasspathJar");
         compiler.compile(outDir, "package pkg; public class A { public String toString() { return \"A\"; } }");
         String jarName = "test.jar";
         compiler.jar(outDir, jarName, "pkg/A.class");
-        Path jarPath = compiler.getPath(outDir).resolve(jarName);
+        return compiler.getPath(outDir).resolve(jarName).toString();
+    }
+
+    public void testClasspathJar() {
+        String jarPath = makeSimpleJar();
         test(
                 (a) -> assertCommand(a, "/env --class-path " + jarPath,
                         "|  Setting new options and restoring state."),
                 (a) -> evaluateExpression(a, "pkg.A", "new pkg.A();", "A")
         );
-        test(new String[] { "--class-path", jarPath.toString() },
+        test(new String[] { "--class-path", jarPath },
                 (a) -> evaluateExpression(a, "pkg.A", "new pkg.A();", "A")
         );
     }
 
+    public void testClasspathUserHomeExpansion() {
+        String jarPath = makeSimpleJar();
+        String tilde = "~" + File.separator;
+        test(
+                (a) -> assertCommand(a, "/env --class-path " + tilde + "forblato",
+                        "|  File '" + System.getProperty("user.home") + File.separator
+                                + "forblato' for '--class-path' is not found."),
+                (a) -> assertCommand(a, "/env --class-path " + jarPath + File.pathSeparator
+                                                            + tilde + "forblato",
+                        "|  File '" + System.getProperty("user.home") + File.separator
+                                + "forblato' for '--class-path' is not found.")
+        );
+    }
+
+    public void testBadClasspath() {
+        String jarPath = makeSimpleJar();
+        Compiler compiler = new Compiler();
+        Path t1 = compiler.getPath("whatever/thing.zip");
+        compiler.writeToFile(t1, "");
+        Path t2 = compiler.getPath("whatever/thing.jmod");
+        compiler.writeToFile(t2, "");
+        test(
+                (a) -> assertCommand(a, "/env --class-path " + t1.toString(),
+                        "|  Invalid '--class-path' argument: " + t1.toString()),
+                (a) -> assertCommand(a, "/env --class-path " + jarPath + File.pathSeparator + t1.toString(),
+                        "|  Invalid '--class-path' argument: " + t1.toString()),
+                (a) -> assertCommand(a, "/env --class-path " + t2.toString(),
+                        "|  Invalid '--class-path' argument: " + t2.toString())
+        );
+    }
+
     public void testModulePath() {
         Compiler compiler = new Compiler();
         Path modsDir = Paths.get("mods");
@@ -304,6 +366,25 @@
         );
     }
 
+    public void testModulePathUserHomeExpansion() {
+        String tilde = "~" + File.separatorChar;
+        test(
+                (a) -> assertCommand(a, "/env --module-path " + tilde + "snardugol",
+                        "|  File '" + System.getProperty("user.home")
+                                + File.separatorChar + "snardugol' for '--module-path' is not found.")
+        );
+    }
+
+    public void testBadModulePath() {
+        Compiler compiler = new Compiler();
+        Path t1 = compiler.getPath("whatever/thing.zip");
+        compiler.writeToFile(t1, "");
+        test(
+                (a) -> assertCommand(a, "/env --module-path " + t1.toString(),
+                        "|  Invalid '--module-path' argument: " + t1.toString())
+        );
+    }
+
     public void testStartupFileOption() {
         Compiler compiler = new Compiler();
         Path startup = compiler.getPath("StartupFileOption/startup.txt");
diff --git a/langtools/test/jdk/jshell/ToolReloadTest.java b/langtools/test/jdk/jshell/ToolReloadTest.java
index 770b01705..f3d008f 100644
--- a/langtools/test/jdk/jshell/ToolReloadTest.java
+++ b/langtools/test/jdk/jshell/ToolReloadTest.java
@@ -92,8 +92,8 @@
         test(false, new String[]{"--no-startup"},
                 a -> assertVariable(a, "int", "a"),
                 a -> dropVariable(a, "/dr 1", "int a = 0", "|  dropped variable a"),
-                a -> assertMethod(a, "int b() { return 0; }", "()I", "b"),
-                a -> dropMethod(a, "/drop b", "b ()I", "|  dropped method b()"),
+                a -> assertMethod(a, "int b() { return 0; }", "()int", "b"),
+                a -> dropMethod(a, "/drop b", "int b()", "|  dropped method b()"),
                 a -> assertClass(a, "class A {}", "class", "A"),
                 a -> dropClass(a, "/dr A", "class A", "|  dropped class A"),
                 a -> assertCommand(a, "/reload",
@@ -115,8 +115,8 @@
         test(false, new String[]{"--no-startup"},
                 a -> assertVariable(a, "int", "a"),
                 a -> dropVariable(a, "/dr 1", "int a = 0", "|  dropped variable a"),
-                a -> assertMethod(a, "int b() { return 0; }", "()I", "b"),
-                a -> dropMethod(a, "/drop b", "b ()I", "|  dropped method b()"),
+                a -> assertMethod(a, "int b() { return 0; }", "()int", "b"),
+                a -> dropMethod(a, "/drop b", "int b()", "|  dropped method b()"),
                 a -> assertClass(a, "class A {}", "class", "A"),
                 a -> dropClass(a, "/dr A", "class A", "|  dropped class A"),
                 a -> assertCommand(a, "/reload -quiet",
diff --git a/langtools/test/jdk/jshell/ToolSimpleTest.java b/langtools/test/jdk/jshell/ToolSimpleTest.java
index ff29a47..909318a 100644
--- a/langtools/test/jdk/jshell/ToolSimpleTest.java
+++ b/langtools/test/jdk/jshell/ToolSimpleTest.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848
+ * @bug 8153716 8143955 8151754 8150382 8153920 8156910 8131024 8160089 8153897 8167128 8154513 8170015 8170368 8172102 8172103  8165405 8173073 8173848 8174041 8173916 8174028 8174262 8174797 8177079
  * @summary Simple jshell tool tests
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -212,6 +212,14 @@
     }
 
     @Test
+    public void testInvalidClassPath() {
+        test(
+                a -> assertCommand(a, "/env --class-path snurgefusal",
+                        "|  File 'snurgefusal' for '--class-path' is not found.")
+        );
+    }
+
+    @Test
     public void testNoArgument() {
         test(
                 (a) -> assertCommand(a, "/save",
@@ -238,8 +246,8 @@
         test(false, new String[]{"--no-startup"},
                 a -> assertVariable(a, "int", "a"),
                 a -> dropVariable(a, "/drop 1", "int a = 0", "|  dropped variable a"),
-                a -> assertMethod(a, "int b() { return 0; }", "()I", "b"),
-                a -> dropMethod(a, "/drop 2", "b ()I", "|  dropped method b()"),
+                a -> assertMethod(a, "int b() { return 0; }", "()int", "b"),
+                a -> dropMethod(a, "/drop 2", "int b()", "|  dropped method b()"),
                 a -> assertClass(a, "class A {}", "class", "A"),
                 a -> dropClass(a, "/drop 3", "class A", "|  dropped class A"),
                 a -> assertImport(a, "import java.util.stream.*;", "", "java.util.stream.*"),
@@ -255,8 +263,8 @@
         test(false, new String[]{"--no-startup"},
                 a -> assertVariable(a, "int", "a"),
                 a -> dropVariable(a, "/drop a", "int a = 0", "|  dropped variable a"),
-                a -> assertMethod(a, "int b() { return 0; }", "()I", "b"),
-                a -> dropMethod(a, "/drop b", "b ()I", "|  dropped method b()"),
+                a -> assertMethod(a, "int b() { return 0; }", "()int", "b"),
+                a -> dropMethod(a, "/drop b", "int b()", "|  dropped method b()"),
                 a -> assertClass(a, "class A {}", "class", "A"),
                 a -> dropClass(a, "/drop A", "class A", "|  dropped class A"),
                 a -> assertCommandCheckOutput(a, "/vars", assertVariables()),
@@ -342,7 +350,9 @@
                 (a) -> assertHelp(a, "/help short", "shortcuts", "<tab>"),
                 (a) -> assertHelp(a, "/? /li", "/list -all", "snippets"),
                 (a) -> assertHelp(a, "/help /set prompt", "optionally contain '%s'", "quoted"),
-                (a) -> assertHelp(a, "/help /help", "/help <command>")
+                (a) -> assertHelp(a, "/help /help", "/help <command>"),
+                (a) -> assertHelp(a, "/help li", "/list -start"),
+                (a) -> assertHelp(a, "/help fe", "/set feedback -retain")
         );
     }
 
@@ -466,10 +476,50 @@
                 a -> assertCommandCheckOutput(a, "/methods print println printf",
                         s -> checkLineToList(s, printingMethodList)),
                 a -> assertCommandOutputStartsWith(a, "/methods g",
-                        "|    g ()void"),
+                        "|    void g()"),
                 a -> assertCommandOutputStartsWith(a, "/methods f",
-                        "|    f ()int\n" +
-                        "|    f (int)void")
+                        "|    int f()\n" +
+                        "|    void f(int)")
+        );
+    }
+
+    @Test
+    public void testMethodsWithErrors() {
+        test(new String[]{"--no-startup"},
+                a -> assertCommand(a, "double m(int x) { return x; }",
+                        "|  created method m(int)"),
+                a -> assertCommand(a, "GARBAGE junk() { return TRASH; }",
+                        "|  created method junk(), however, it cannot be referenced until class GARBAGE, and variable TRASH are declared"),
+                a -> assertCommand(a, "int w = 5;",
+                        "w ==> 5"),
+                a -> assertCommand(a, "int tyer() { return w; }",
+                        "|  created method tyer()"),
+                a -> assertCommand(a, "String w = \"hi\";",
+                        "w ==> \"hi\""),
+                a -> assertCommand(a, "/methods",
+                        "|    double m(int)\n" +
+                        "|    GARBAGE junk()\n" +
+                        "|       which cannot be referenced until class GARBAGE, and variable TRASH are declared\n" +
+                        "|    int tyer()\n" +
+                        "|       which cannot be invoked until this error is corrected: \n" +
+                        "|          incompatible types: java.lang.String cannot be converted to int\n" +
+                        "|          int tyer() { return w; }\n" +
+                        "|                              ^\n")
+        );
+    }
+
+    @Test
+    public void testTypesWithErrors() {
+        test(new String[]{"--no-startup"},
+                a -> assertCommand(a, "class C extends NONE { int x; }",
+                        "|  created class C, however, it cannot be referenced until class NONE is declared"),
+                a -> assertCommand(a, "class D { void m() { System.out.println(nada); } }",
+                        "|  created class D, however, it cannot be instantiated or its methods invoked until variable nada is declared"),
+                a -> assertCommand(a, "/types",
+                        "|    class C\n" +
+                        "|       which cannot be referenced until class NONE is declared\n" +
+                        "|    class D\n" +
+                        "|       which cannot be instantiated or its methods invoked until variable nada is declared\n")
         );
     }
 
diff --git a/langtools/test/jdk/jshell/UITesting.java b/langtools/test/jdk/jshell/UITesting.java
new file mode 100644
index 0000000..fffd54d
--- /dev/null
+++ b/langtools/test/jdk/jshell/UITesting.java
@@ -0,0 +1,272 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import jdk.jshell.tool.JavaShellToolBuilder;
+
+public class UITesting {
+
+    protected void doRunTest(Test test) throws Exception {
+        PipeInputStream input = new PipeInputStream();
+        StringBuilder out = new StringBuilder();
+        PrintStream outS = new PrintStream(new OutputStream() {
+            @Override public void write(int b) throws IOException {
+                synchronized (out) {
+                    System.out.print((char) b);
+                    out.append((char) b);
+                    out.notifyAll();
+                }
+            }
+        });
+        Thread runner = new Thread(() -> {
+            try {
+                JavaShellToolBuilder.builder()
+                        .in(input, input)
+                        .out(outS)
+                        .err(outS)
+                        .promptCapture(true)
+                        .persistence(new HashMap<>())
+                        .locale(Locale.US)
+                        .run("--no-startup");
+            } catch (Exception ex) {
+                throw new IllegalStateException(ex);
+            }
+        });
+
+        Writer inputSink = new OutputStreamWriter(input.createOutput()) {
+            @Override
+            public void write(String str) throws IOException {
+                super.write(str);
+                flush();
+            }
+        };
+
+        runner.start();
+
+        try {
+            waitOutput(out, "\u0005");
+            test.test(inputSink, out);
+        } finally {
+            inputSink.write("\003\003/exit");
+
+            runner.join(1000);
+            if (runner.isAlive()) {
+                runner.stop();
+            }
+        }
+    }
+
+    protected interface Test {
+        public void test(Writer inputSink, StringBuilder out) throws Exception;
+    }
+
+    private static final long TIMEOUT;
+
+    static {
+        long factor;
+
+        try {
+            factor = (long) Double.parseDouble(System.getProperty("test.timeout.factor", "1"));
+        } catch (NumberFormatException ex) {
+            factor = 1;
+        }
+        TIMEOUT = 60_000 * factor;
+    }
+
+    protected void waitOutput(StringBuilder out, String expected) {
+        expected = expected.replaceAll("\n", System.getProperty("line.separator"));
+        Pattern expectedPattern = Pattern.compile(expected, Pattern.DOTALL);
+        synchronized (out) {
+            long s = System.currentTimeMillis();
+
+            while (true) {
+                Matcher m = expectedPattern.matcher(out);
+                if (m.find()) {
+                    out.delete(0, m.end() + 1);
+                    return ;
+                }
+                long e =  System.currentTimeMillis();
+                if ((e - s) > TIMEOUT) {
+                    throw new IllegalStateException("Timeout waiting for: " + quote(expected) + ", actual output so far: " + quote(out.toString()));
+                }
+                try {
+                    out.wait(TIMEOUT);
+                } catch (InterruptedException ex) {
+                    ex.printStackTrace();
+                }
+            }
+        }
+    }
+
+    private String quote(String original) {
+        StringBuilder output = new StringBuilder();
+
+        for (char c : original.toCharArray()) {
+            if (c < 32) {
+                output.append(String.format("\\u%04X", (int) c));
+            } else {
+                output.append(c);
+            }
+        }
+
+        return output.toString();
+    }
+
+    protected String clearOut(String what) {
+        return backspace(what.length()) + space(what.length()) + backspace(what.length());
+    }
+
+    protected String backspace(int n) {
+        return fill(n, '\010');
+    }
+
+    protected String space(int n) {
+        return fill(n, ' ');
+    }
+
+    private String fill(int n, char c) {
+        StringBuilder result = new StringBuilder(n);
+
+        while (n-- > 0)
+            result.append(c);
+
+        return result.toString();
+    }
+
+    private static class PipeInputStream extends InputStream {
+
+        private static final int INITIAL_SIZE = 128;
+        private int[] buffer = new int[INITIAL_SIZE];
+        private int start;
+        private int end;
+        private boolean closed;
+
+        @Override
+        public synchronized int read() throws IOException {
+            if (start == end && !closed) {
+                inputNeeded();
+            }
+            while (start == end) {
+                if (closed) {
+                    return -1;
+                }
+                try {
+                    wait();
+                } catch (InterruptedException ex) {
+                    //ignore
+                }
+            }
+            try {
+                return buffer[start];
+            } finally {
+                start = (start + 1) % buffer.length;
+            }
+        }
+
+        @Override
+        public synchronized int read(byte[] b, int off, int len) throws IOException {
+            if (b == null) {
+                throw new NullPointerException();
+            } else if (off < 0 || len < 0 || len > b.length - off) {
+                throw new IndexOutOfBoundsException();
+            } else if (len == 0) {
+                return 0;
+            }
+
+            int c = read();
+            if (c == -1) {
+                return -1;
+            }
+            b[off] = (byte)c;
+
+            int totalRead = 1;
+            while (totalRead < len && start != end) {
+                int r = read();
+                if (r == (-1))
+                    break;
+                b[off + totalRead++] = (byte) r;
+            }
+            return totalRead;
+        }
+
+        protected void inputNeeded() throws IOException {}
+
+        private synchronized void write(int b) {
+            if (closed) {
+                throw new IllegalStateException("Already closed.");
+            }
+            int newEnd = (end + 1) % buffer.length;
+            if (newEnd == start) {
+                //overflow:
+                int[] newBuffer = new int[buffer.length * 2];
+                int rightPart = (end > start ? end : buffer.length) - start;
+                int leftPart = end > start ? 0 : start - 1;
+                System.arraycopy(buffer, start, newBuffer, 0, rightPart);
+                System.arraycopy(buffer, 0, newBuffer, rightPart, leftPart);
+                buffer = newBuffer;
+                start = 0;
+                end = rightPart + leftPart;
+                newEnd = end + 1;
+            }
+            buffer[end] = b;
+            end = newEnd;
+            notifyAll();
+        }
+
+        @Override
+        public synchronized void close() {
+            closed = true;
+            notifyAll();
+        }
+
+        public OutputStream createOutput() {
+            return new OutputStream() {
+                @Override public void write(int b) throws IOException {
+                    PipeInputStream.this.write(b);
+                }
+                @Override
+                public void write(byte[] b, int off, int len) throws IOException {
+                    for (int i = 0 ; i < len ; i++) {
+                        write(Byte.toUnsignedInt(b[off + i]));
+                    }
+                }
+                @Override
+                public void close() throws IOException {
+                    PipeInputStream.this.close();
+                }
+            };
+        }
+
+    }
+
+}
diff --git a/langtools/test/tools/javac/6410653/T6410653.java b/langtools/test/tools/javac/6410653/T6410653.java
index 338b77f..632574c 100644
--- a/langtools/test/tools/javac/6410653/T6410653.java
+++ b/langtools/test/tools/javac/6410653/T6410653.java
@@ -31,7 +31,6 @@
  */
 
 import java.lang.reflect.Field;
-import java.lang.reflect.Module;
 import java.io.File;
 import java.io.ByteArrayOutputStream;
 import javax.tools.*;
diff --git a/langtools/test/tools/javac/6627362/T6627362.java b/langtools/test/tools/javac/6627362/T6627362.java
index 28d178d..d2d7460 100644
--- a/langtools/test/tools/javac/6627362/T6627362.java
+++ b/langtools/test/tools/javac/6627362/T6627362.java
@@ -68,9 +68,9 @@
         // compile and disassemble E.java, using modified Object.java,
         // check for reference to System.arraycopy
         File x = new File(testSrc, "x");
-        String[] jcArgs = { "-d", ".", "-Xmodule:java.base",
+        String[] jcArgs = { "-d", ".", "--patch-module", "java.base=" + x.getAbsolutePath(),
                             new File(x, "E.java").getPath(),
-                            new File(x, "Object.java").getPath()};
+                            new File(new File(new File(x, "java"), "lang"), "Object.java").getPath()};
         compile(jcArgs);
 
         String[] jpArgs = { "-classpath", ".", "-c", "E" };
diff --git a/langtools/test/tools/javac/6627362/x/Object.java b/langtools/test/tools/javac/6627362/x/java/lang/Object.java
similarity index 100%
rename from langtools/test/tools/javac/6627362/x/Object.java
rename to langtools/test/tools/javac/6627362/x/java/lang/Object.java
diff --git a/langtools/test/tools/javac/T4093617/T4093617.java b/langtools/test/tools/javac/T4093617/T4093617.java
index 5162097..8fa7dfa 100644
--- a/langtools/test/tools/javac/T4093617/T4093617.java
+++ b/langtools/test/tools/javac/T4093617/T4093617.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,6 @@
  * @bug     4093617
  * @summary Object has no superclass
  * @author  Peter von der Ah\u00e9
- * @compile/module=java.base/fail/ref=T4093617.out -XDrawDiagnostics Object.java
+ * @compile/module=java.base/fail/ref=T4093617.out -XDrawDiagnostics java/lang/Object.java
  */
 
diff --git a/langtools/test/tools/javac/T4093617/java.base/Object.java b/langtools/test/tools/javac/T4093617/java.base/java/lang/Object.java
similarity index 100%
rename from langtools/test/tools/javac/T4093617/java.base/Object.java
rename to langtools/test/tools/javac/T4093617/java.base/java/lang/Object.java
diff --git a/langtools/test/tools/javac/T6234077.out b/langtools/test/tools/javac/T6234077.out
index 2a77ac7..930d00d 100644
--- a/langtools/test/tools/javac/T6234077.out
+++ b/langtools/test/tools/javac/T6234077.out
@@ -1,2 +1,2 @@
-T6234077.java:7:8: compiler.err.class.public.should.be.in.file: Foo
+T6234077.java:7:8: compiler.err.class.public.should.be.in.file: kindname.class, Foo
 1 error
diff --git a/langtools/test/tools/javac/T6406771.java b/langtools/test/tools/javac/T6406771.java
index a6ddd05..78d0e2c 100644
--- a/langtools/test/tools/javac/T6406771.java
+++ b/langtools/test/tools/javac/T6406771.java
@@ -11,9 +11,9 @@
 // Editing the imports and other leading text may affect the golden text in the tests field.
 // Also beware of scripts that auto-expand tabs to spaces.
 
+
+
 import java.io.*;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 import javax.annotation.processing.*;
 import javax.lang.model.*;
diff --git a/langtools/test/tools/javac/T8003967/DetectMutableStaticFields.java b/langtools/test/tools/javac/T8003967/DetectMutableStaticFields.java
index a47dd2a..4a4c25d 100644
--- a/langtools/test/tools/javac/T8003967/DetectMutableStaticFields.java
+++ b/langtools/test/tools/javac/T8003967/DetectMutableStaticFields.java
@@ -107,7 +107,7 @@
         // by reflective lookup, to avoid explicit references that are not available
         // when running javac on JDK 8.
         ignore("com/sun/tools/javac/util/JDK9Wrappers$Configuration",
-                "resolveRequiresAndUsesMethod", "configurationClass");
+                "resolveAndBindMethod", "configurationClass");
         ignore("com/sun/tools/javac/util/JDK9Wrappers$Layer",
                 "bootMethod", "defineModulesWithOneLoaderMethod", "configurationMethod", "layerClass");
         ignore("com/sun/tools/javac/util/JDK9Wrappers$Module",
diff --git a/langtools/test/tools/javac/T8173955/MessageForClassTest.java b/langtools/test/tools/javac/T8173955/MessageForClassTest.java
new file mode 100644
index 0000000..5d2e256
--- /dev/null
+++ b/langtools/test/tools/javac/T8173955/MessageForClassTest.java
@@ -0,0 +1,8 @@
+/*
+ * @test  /nodynamiccopyright/
+ * @bug 8174027
+ * @summary error message should adapt to the corresponding top level element
+ * @compile/fail/ref=MessageForClassTest.out -XDrawDiagnostics MessageForClassTest.java
+ */
+
+public class MessageForClassTest_ {}
diff --git a/langtools/test/tools/javac/T8173955/MessageForClassTest.out b/langtools/test/tools/javac/T8173955/MessageForClassTest.out
new file mode 100644
index 0000000..454fca6
--- /dev/null
+++ b/langtools/test/tools/javac/T8173955/MessageForClassTest.out
@@ -0,0 +1,2 @@
+MessageForClassTest.java:8:8: compiler.err.class.public.should.be.in.file: kindname.class, MessageForClassTest_
+1 error
diff --git a/langtools/test/tools/javac/T8173955/MessageForEnumTest.java b/langtools/test/tools/javac/T8173955/MessageForEnumTest.java
new file mode 100644
index 0000000..343ef77
--- /dev/null
+++ b/langtools/test/tools/javac/T8173955/MessageForEnumTest.java
@@ -0,0 +1,8 @@
+/*
+ * @test  /nodynamiccopyright/
+ * @bug 8174027
+ * @summary error message should adapt to the corresponding top level element
+ * @compile/fail/ref=MessageForEnumTest.out -XDrawDiagnostics MessageForEnumTest.java
+ */
+
+public enum MessageForEnumTest_ {}
diff --git a/langtools/test/tools/javac/T8173955/MessageForEnumTest.out b/langtools/test/tools/javac/T8173955/MessageForEnumTest.out
new file mode 100644
index 0000000..ae9f60e
--- /dev/null
+++ b/langtools/test/tools/javac/T8173955/MessageForEnumTest.out
@@ -0,0 +1,2 @@
+MessageForEnumTest.java:8:8: compiler.err.class.public.should.be.in.file: kindname.enum, MessageForEnumTest_
+1 error
diff --git a/langtools/test/tools/javac/T8173955/MessageForInterfaceTest.java b/langtools/test/tools/javac/T8173955/MessageForInterfaceTest.java
new file mode 100644
index 0000000..563c58b
--- /dev/null
+++ b/langtools/test/tools/javac/T8173955/MessageForInterfaceTest.java
@@ -0,0 +1,8 @@
+/*
+ * @test  /nodynamiccopyright/
+ * @bug 8174027
+ * @summary error message should adapt to the corresponding top level element
+ * @compile/fail/ref=MessageForInterfaceTest.out -XDrawDiagnostics MessageForInterfaceTest.java
+ */
+
+public interface MessageForInterfaceTest_ {}
diff --git a/langtools/test/tools/javac/T8173955/MessageForInterfaceTest.out b/langtools/test/tools/javac/T8173955/MessageForInterfaceTest.out
new file mode 100644
index 0000000..88cd9cd
--- /dev/null
+++ b/langtools/test/tools/javac/T8173955/MessageForInterfaceTest.out
@@ -0,0 +1,2 @@
+MessageForInterfaceTest.java:8:8: compiler.err.class.public.should.be.in.file: kindname.interface, MessageForInterfaceTest_
+1 error
diff --git a/langtools/test/tools/javac/T8175198/AnnotationsAndFormalParamsTest.java b/langtools/test/tools/javac/T8175198/AnnotationsAndFormalParamsTest.java
new file mode 100644
index 0000000..2dacafe
--- /dev/null
+++ b/langtools/test/tools/javac/T8175198/AnnotationsAndFormalParamsTest.java
@@ -0,0 +1,11 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8175198
+ * @summary Javac incorrectly allows receiver parameters in annotation methods
+ * @compile/fail/ref=AnnotationsAndFormalParamsTest.out -XDrawDiagnostics -Werror -Xlint:unchecked AnnotationsAndFormalParamsTest.java
+ */
+
+@interface AnnotationsAndFormalParamsTest {
+    int value(int i);
+    int foo(AnnotationsAndFormalParamsTest this);
+}
diff --git a/langtools/test/tools/javac/T8175198/AnnotationsAndFormalParamsTest.out b/langtools/test/tools/javac/T8175198/AnnotationsAndFormalParamsTest.out
new file mode 100644
index 0000000..b0ea335
--- /dev/null
+++ b/langtools/test/tools/javac/T8175198/AnnotationsAndFormalParamsTest.out
@@ -0,0 +1,3 @@
+AnnotationsAndFormalParamsTest.java:9:19: compiler.err.intf.annotation.members.cant.have.params
+AnnotationsAndFormalParamsTest.java:10:44: compiler.err.intf.annotation.members.cant.have.params
+2 errors
diff --git a/langtools/test/tools/javac/T8175235/InferenceRegressionTest01.java b/langtools/test/tools/javac/T8175235/InferenceRegressionTest01.java
new file mode 100644
index 0000000..3f72d45
--- /dev/null
+++ b/langtools/test/tools/javac/T8175235/InferenceRegressionTest01.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8175235
+ * @summary type inference regression after JDK-8046685
+ * @compile InferenceRegressionTest01.java
+ */
+
+import java.util.function.Predicate;
+
+abstract class InferenceRegressionTest01 {
+
+    void f(String r) {
+        a(r, c(o(p(s -> s.isEmpty()))));
+    }
+
+    abstract <U> U o(U u);
+    abstract <E> Predicate<E> c(Predicate<E> xs);
+    abstract <S> void a(S a, Predicate<S> m);
+    abstract <V> Predicate<V> p(Predicate<V> p);
+}
diff --git a/langtools/test/tools/javac/T8175235/InferenceRegressionTest02.java b/langtools/test/tools/javac/T8175235/InferenceRegressionTest02.java
new file mode 100644
index 0000000..dd4e14d
--- /dev/null
+++ b/langtools/test/tools/javac/T8175235/InferenceRegressionTest02.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8175235
+ * @summary type inference regression after JDK-8046685
+ * @library /tools/javac/lib
+ * @modules jdk.compiler/com.sun.source.util
+ *          jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.code
+ *          jdk.compiler/com.sun.tools.javac.file
+ *          jdk.compiler/com.sun.tools.javac.tree
+ *          jdk.compiler/com.sun.tools.javac.util
+ * @build DPrinter
+ * @run main InferenceRegressionTest02
+ */
+
+import java.io.*;
+import java.net.URI;
+import java.util.Arrays;
+
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.Trees;
+import com.sun.tools.javac.api.JavacTrees;
+import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.javac.util.Context;
+
+public class InferenceRegressionTest02 {
+    public static void main(String... args) throws Exception {
+        new InferenceRegressionTest02().run();
+    }
+
+    void run() throws Exception {
+        Context context = new Context();
+        JavacFileManager.preRegister(context);
+        Trees trees = JavacTrees.instance(context);
+        StringWriter strOut = new StringWriter();
+        PrintWriter pw = new PrintWriter(strOut);
+        DPrinter dprinter = new DPrinter(pw, trees);
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        JavacTask ct = (JavacTask)tool.getTask(null, null, null, null, null, Arrays.asList(new JavaSource()));
+        Iterable<? extends CompilationUnitTree> elements = ct.parse();
+        ct.analyze();
+        Assert.check(elements.iterator().hasNext());
+        dprinter.treeTypes(true).printTree("", (JCTree)elements.iterator().next());
+        String output = strOut.toString();
+        Assert.check(!output.contains("java.lang.Object"), "there shouldn't be any type instantiated to Object");
+    }
+
+    static class JavaSource extends SimpleJavaFileObject {
+
+        String source =
+                "import java.util.function.*;\n" +
+                "import java.util.*;\n" +
+                "import java.util.stream.*;\n" +
+
+                "class Foo {\n" +
+                "    void test(List<Map.Entry<Foo, Foo>> ls) {\n" +
+                "        Map<Foo, Set<Foo>> res = ls.stream()\n" +
+                "                .collect(Collectors.groupingBy(Map.Entry::getKey,\n" +
+                "                        HashMap::new,\n" +
+                "                        Collectors.mapping(Map.Entry::getValue, Collectors.toSet())));\n" +
+                "    }\n" +
+                "}";
+
+        public JavaSource() {
+            super(URI.create("myfo:/Foo.java"), JavaFileObject.Kind.SOURCE);
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/T8175790/NPEDueToErroneousLambdaTest.java b/langtools/test/tools/javac/T8175790/NPEDueToErroneousLambdaTest.java
new file mode 100644
index 0000000..a6a02b0
--- /dev/null
+++ b/langtools/test/tools/javac/T8175790/NPEDueToErroneousLambdaTest.java
@@ -0,0 +1,29 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8175790
+ * @summary field JCVariableDecl.vartype can't be null after post attribution analysis
+ * @compile/fail/ref=NPEDueToErroneousLambdaTest.out -XDrawDiagnostics NPEDueToErroneousLambdaTest.java
+ */
+
+import java.util.List;
+import java.util.function.Function;
+
+public abstract class NPEDueToErroneousLambdaTest {
+
+    interface R {}
+    interface A {}
+    interface S {}
+
+    abstract <I, O> Function<I, O> p(final Function<I, O> function);
+    abstract <I, O> List<O> t(Function<? super I, ? extends O> function);
+
+    public void f() {
+        t(p(new Function<A, Object>() {
+            public List<Object> apply(A a) throws Exception {
+                return t((Function<R, S>)input -> {
+                        return t(p((Function<Boolean, S>) i -> null), null);
+                });
+            }
+        }));
+    }
+}
diff --git a/langtools/test/tools/javac/T8175790/NPEDueToErroneousLambdaTest.out b/langtools/test/tools/javac/T8175790/NPEDueToErroneousLambdaTest.out
new file mode 100644
index 0000000..867b3cd
--- /dev/null
+++ b/langtools/test/tools/javac/T8175790/NPEDueToErroneousLambdaTest.out
@@ -0,0 +1,3 @@
+NPEDueToErroneousLambdaTest.java:22:33: compiler.err.override.meth.doesnt.throw: (compiler.misc.cant.implement: apply(NPEDueToErroneousLambdaTest.A), compiler.misc.anonymous.class: NPEDueToErroneousLambdaTest$1, apply(T), java.util.function.Function), java.lang.Exception
+NPEDueToErroneousLambdaTest.java:24:32: compiler.err.cant.apply.symbol: kindname.method, t, java.util.function.Function<? super I,? extends O>, java.util.function.Function<java.lang.Boolean,NPEDueToErroneousLambdaTest.S>,compiler.misc.type.null, kindname.class, NPEDueToErroneousLambdaTest, (compiler.misc.infer.arg.length.mismatch: I,O)
+2 errors
diff --git a/langtools/test/tools/javac/T8176714/FieldOverloadKindNotAssignedTest.java b/langtools/test/tools/javac/T8176714/FieldOverloadKindNotAssignedTest.java
new file mode 100644
index 0000000..e1e7134
--- /dev/null
+++ b/langtools/test/tools/javac/T8176714/FieldOverloadKindNotAssignedTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176714
+ * @summary javac is wrongly assuming that field JCMemberReference.overloadKind has been assigned to
+ * @library /tools/javac/lib
+ * @modules jdk.compiler/com.sun.source.util
+ *          jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.code
+ *          jdk.compiler/com.sun.tools.javac.file
+ *          jdk.compiler/com.sun.tools.javac.tree
+ *          jdk.compiler/com.sun.tools.javac.util
+ * @build DPrinter
+ * @run main FieldOverloadKindNotAssignedTest
+ */
+
+import java.net.URI;
+import java.util.Arrays;
+
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.util.JavacTask;
+import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCMemberReference;
+import com.sun.tools.javac.tree.TreeScanner;
+import com.sun.tools.javac.util.Assert;
+import com.sun.tools.javac.util.Context;
+
+public class FieldOverloadKindNotAssignedTest {
+    public static void main(String... args) throws Exception {
+        new FieldOverloadKindNotAssignedTest().run();
+    }
+
+    void run() throws Exception {
+        Context context = new Context();
+        JavacFileManager.preRegister(context);
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        JavacTask ct = (JavacTask)tool.getTask(null, null, null, null, null, Arrays.asList(new JavaSource()));
+        Iterable<? extends CompilationUnitTree> elements = ct.parse();
+        ct.analyze();
+        Assert.check(elements.iterator().hasNext());
+        JCTree topLevel = (JCTree)elements.iterator().next();
+        new TreeScanner() {
+            @Override
+            public void visitReference(JCMemberReference tree) {
+                Assert.check(tree.getOverloadKind() != null);
+            }
+        }.scan(topLevel);
+    }
+
+    static class JavaSource extends SimpleJavaFileObject {
+
+        String source =
+                "import java.util.function.*;\n" +
+
+                "class Test {\n" +
+                "    void m(Predicate<String> psi) {}\n" +
+                "    void m(Function<String, String> fss) {}\n" +
+
+                "    void foo(boolean b) {\n" +
+                "        m(b ? s -> false : Test::g);\n" +
+                "    }\n" +
+
+                "    static boolean g(String s) { return false; }\n" +
+                "    static boolean g(Integer i) { return false; }\n" +
+                "}";
+
+        public JavaSource() {
+            super(URI.create("myfo:/Foo.java"), JavaFileObject.Kind.SOURCE);
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest01.java b/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest01.java
new file mode 100644
index 0000000..5978b2f
--- /dev/null
+++ b/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest01.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176714
+ * @summary javac is wrongly assuming that field JCMemberReference.overloadKind has been assigned to
+ * @compile TimingOfMReferenceCheckingTest01.java
+ */
+
+import java.util.function.*;
+
+public class TimingOfMReferenceCheckingTest01 {
+    <Z> void g(Consumer<Z> fzr, Z z) {}
+
+    void test(boolean cond) {
+       g(cond ? this::m : this::m, "");
+    }
+
+    void m(String s) {}
+    void m(Integer i) {}
+}
diff --git a/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest02.java b/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest02.java
new file mode 100644
index 0000000..e9e8c9b
--- /dev/null
+++ b/langtools/test/tools/javac/T8176714/TimingOfMReferenceCheckingTest02.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176714
+ * @summary javac is wrongly assuming that field JCMemberReference.overloadKind has been assigned to
+ * @compile TimingOfMReferenceCheckingTest02.java
+ */
+
+import java.util.function.*;
+
+public class TimingOfMReferenceCheckingTest02 {
+    <Z> void g(Consumer<Z> fzr, Z z) {}
+   <T> T f(T t) { return null; }
+
+   void test(boolean cond) {
+        g(cond ?
+            f(cond ?
+                this::m :
+                this::m) :
+            this::m, "");
+    }
+
+    void m(String s) {}
+    void m(Integer i) {}
+}
diff --git a/langtools/test/tools/javac/api/TestClientCodeWrapper.java b/langtools/test/tools/javac/api/TestClientCodeWrapper.java
index 177e621..044225a 100644
--- a/langtools/test/tools/javac/api/TestClientCodeWrapper.java
+++ b/langtools/test/tools/javac/api/TestClientCodeWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -407,9 +407,9 @@
         }
 
         @Override
-        public Location getLocationForModule(Location location, JavaFileObject fo, String pkgName) throws IOException {
+        public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
             throwUserExceptionIfNeeded(fileManagerMethod, "getLocationForModule");
-            return super.getLocationForModule(location, fo, pkgName);
+            return super.getLocationForModule(location, fo);
         }
 
         @Override
diff --git a/langtools/test/tools/javac/defaultMethods/private/PrivateInterfaceMethodProcessorTest.java b/langtools/test/tools/javac/defaultMethods/private/PrivateInterfaceMethodProcessorTest.java
new file mode 100644
index 0000000..f842213
--- /dev/null
+++ b/langtools/test/tools/javac/defaultMethods/private/PrivateInterfaceMethodProcessorTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8175184
+ * @summary Annotation processor observes interface private methods as default methods
+ * @library /tools/javac/lib
+ * @modules java.compiler
+ *          jdk.compiler
+ * @build   JavacTestingAbstractProcessor PrivateInterfaceMethodProcessorTest
+ * @compile/process -processor PrivateInterfaceMethodProcessorTest -proc:only PrivateInterfaceMethodProcessorTest_I
+ */
+
+import java.util.Set;
+import javax.annotation.processing.*;
+import javax.lang.model.element.*;
+import static javax.lang.model.util.ElementFilter.*;
+
+interface PrivateInterfaceMethodProcessorTest_I {
+    private void foo() {}
+}
+
+public class PrivateInterfaceMethodProcessorTest extends JavacTestingAbstractProcessor {
+    public boolean process(Set<? extends TypeElement> annotations,
+                           RoundEnvironment roundEnv) {
+        if (!roundEnv.processingOver()) {
+            for (Element element : roundEnv.getRootElements()) {
+                for (ExecutableElement method : methodsIn(element.getEnclosedElements())) {
+                    if (method.isDefault()) {
+                        throw new AssertionError("Unexpected default method seen");
+                    }
+                }
+            }
+        }
+        return true;
+    }
+}
\ No newline at end of file
diff --git a/langtools/test/tools/javac/diags/CheckExamples.java b/langtools/test/tools/javac/diags/CheckExamples.java
index 0e52111..f27aca4 100644
--- a/langtools/test/tools/javac/diags/CheckExamples.java
+++ b/langtools/test/tools/javac/diags/CheckExamples.java
@@ -39,8 +39,6 @@
  */
 
 import java.io.*;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.nio.file.*;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.*;
@@ -111,7 +109,7 @@
             }
         }
 
-        Module jdk_compiler = Layer.boot().findModule("jdk.compiler").get();
+        Module jdk_compiler = ModuleLayer.boot().findModule("jdk.compiler").get();
         ResourceBundle b =
             ResourceBundle.getBundle("com.sun.tools.javac.resources.compiler", jdk_compiler);
         Set<String> resourceKeys = new TreeSet<String>(b.keySet());
diff --git a/langtools/test/tools/javac/diags/CheckResourceKeys.java b/langtools/test/tools/javac/diags/CheckResourceKeys.java
index 7178856..9ebe1f9 100644
--- a/langtools/test/tools/javac/diags/CheckResourceKeys.java
+++ b/langtools/test/tools/javac/diags/CheckResourceKeys.java
@@ -31,8 +31,6 @@
  */
 
 import java.io.*;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 import javax.tools.*;
 import com.sun.tools.classfile.*;
@@ -395,7 +393,7 @@
      * Get the set of keys from the javac resource bundles.
      */
     Set<String> getResourceKeys() {
-        Module jdk_compiler = Layer.boot().findModule("jdk.compiler").get();
+        Module jdk_compiler = ModuleLayer.boot().findModule("jdk.compiler").get();
         Set<String> results = new TreeSet<String>();
         for (String name : new String[]{"javac", "compiler"}) {
             ResourceBundle b =
diff --git a/langtools/test/tools/javac/diags/Example.java b/langtools/test/tools/javac/diags/Example.java
index 72c4b64..8cadd96 100644
--- a/langtools/test/tools/javac/diags/Example.java
+++ b/langtools/test/tools/javac/diags/Example.java
@@ -24,8 +24,18 @@
 import java.io.*;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.*;
+import java.util.Map.Entry;
+import java.util.jar.JarFile;
+import java.util.jar.JarOutputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import java.util.regex.*;
+import java.util.stream.Collectors;
+import java.util.zip.ZipEntry;
+
 import javax.annotation.processing.Processor;
 import javax.tools.Diagnostic;
 import javax.tools.DiagnosticCollector;
@@ -63,6 +73,7 @@
         procFiles = new ArrayList<File>();
         srcPathFiles = new ArrayList<File>();
         moduleSourcePathFiles = new ArrayList<File>();
+        patchModulePathFiles = new ArrayList<File>();
         modulePathFiles = new ArrayList<File>();
         classPathFiles = new ArrayList<File>();
         additionalFiles = new ArrayList<File>();
@@ -88,6 +99,9 @@
                 } else if (files == srcFiles && c.getName().equals("modulesourcepath")) {
                     moduleSourcePathDir = c;
                     findFiles(c, moduleSourcePathFiles);
+                } else if (files == srcFiles && c.getName().equals("patchmodule")) {
+                    patchModulePathDir = c;
+                    findFiles(c, patchModulePathFiles);
                 } else if (files == srcFiles && c.getName().equals("additional")) {
                     additionalFilesDir = c;
                     findFiles(c, additionalFiles);
@@ -206,9 +220,53 @@
             File modulepathDir = new File(tempDir, "modulepath");
             modulepathDir.mkdirs();
             clean(modulepathDir);
-            List<String> sOpts = Arrays.asList("-d", modulepathDir.getPath(),
-                                               "--module-source-path", new File(file, "modulepath").getAbsolutePath());
-            new Jsr199Compiler(verbose).run(null, null, false, sOpts, modulePathFiles);
+            boolean hasModuleInfo =
+                    modulePathFiles.stream()
+                                   .anyMatch(f -> f.getName().equalsIgnoreCase("module-info.java"));
+            Path modulePath = new File(file, "modulepath").toPath().toAbsolutePath();
+            if (hasModuleInfo) {
+                //ordinary modules
+                List<String> sOpts =
+                        Arrays.asList("-d", modulepathDir.getPath(),
+                                      "--module-source-path", modulePath.toString());
+                new Jsr199Compiler(verbose).run(null, null, false, sOpts, modulePathFiles);
+            } else {
+                //automatic modules:
+                Map<String, List<Path>> module2Files =
+                        modulePathFiles.stream()
+                                       .map(f -> f.toPath())
+                                       .collect(Collectors.groupingBy(p -> modulePath.relativize(p)
+                                                                            .getName(0)
+                                                                            .toString()));
+                for (Entry<String, List<Path>> e : module2Files.entrySet()) {
+                    File scratchDir = new File(tempDir, "scratch");
+                    scratchDir.mkdirs();
+                    clean(scratchDir);
+                    List<String> sOpts =
+                            Arrays.asList("-d", scratchDir.getPath());
+                    new Jsr199Compiler(verbose).run(null,
+                                                    null,
+                                                    false,
+                                                    sOpts,
+                                                    e.getValue().stream()
+                                                                .map(p -> p.toFile())
+                                                                .collect(Collectors.toList()));
+                    try (JarOutputStream jarOut =
+                            new JarOutputStream(new FileOutputStream(new File(modulepathDir, e.getKey() + ".jar")))) {
+                        Files.find(scratchDir.toPath(), Integer.MAX_VALUE, (p, attr) -> attr.isRegularFile())
+                                .forEach(p -> {
+                                    try (InputStream in = Files.newInputStream(p)) {
+                                        jarOut.putNextEntry(new ZipEntry(scratchDir.toPath()
+                                                                                   .relativize(p)
+                                                                                   .toString()));
+                                        jarOut.write(in.readAllBytes());
+                                    } catch (IOException ex) {
+                                        throw new IllegalStateException(ex);
+                                    }
+                                });
+                    }
+                }
+            }
             opts.add("--module-path");
             opts.add(modulepathDir.getAbsolutePath());
         }
@@ -272,6 +330,16 @@
             files.addAll(nonEmptySrcFiles); // srcFiles containing declarations
         }
 
+        if (patchModulePathDir != null) {
+            for (File mod : patchModulePathDir.listFiles()) {
+                opts.add("--patch-module");
+                opts.add(mod.getName() + "=" + mod.getPath());
+            }
+            files = new ArrayList<>();
+            files.addAll(patchModulePathFiles);
+            files.addAll(nonEmptySrcFiles); // srcFiles containing declarations
+        }
+
         if (additionalFiles.size() > 0) {
             List<String> sOpts = Arrays.asList("-d", classesDir.getPath());
             new Jsr199Compiler(verbose).run(null, null, false, sOpts, additionalFiles);
@@ -343,9 +411,11 @@
     List<File> procFiles;
     File srcPathDir;
     File moduleSourcePathDir;
+    File patchModulePathDir;
     File additionalFilesDir;
     List<File> srcPathFiles;
     List<File> moduleSourcePathFiles;
+    List<File> patchModulePathFiles;
     List<File> modulePathFiles;
     List<File> classPathFiles;
     List<File> additionalFiles;
diff --git a/langtools/test/tools/javac/diags/examples.not-yet.txt b/langtools/test/tools/javac/diags/examples.not-yet.txt
index 5f88b42..a34685d 100644
--- a/langtools/test/tools/javac/diags/examples.not-yet.txt
+++ b/langtools/test/tools/javac/diags/examples.not-yet.txt
@@ -5,6 +5,7 @@
 compiler.err.cant.read.file                             # (apt.JavaCompiler?)
 compiler.err.cant.select.static.class.from.param.type
 compiler.err.dc.unterminated.string                     # cannot happen
+compiler.err.file.patched.and.msp                       # needs the same dir on --module-source-path and --patch-module
 compiler.err.illegal.char.for.encoding
 compiler.err.invalid.repeatable.annotation              # should not happen
 compiler.err.invalid.repeatable.annotation.invalid.value # "can't" happen
diff --git a/langtools/test/tools/javac/diags/examples/IllegalArgumentForOption/IllegalArgumentForOption.java b/langtools/test/tools/javac/diags/examples/IllegalArgumentForOption/IllegalArgumentForOption.java
index 90c2c1f..429fe7e 100644
--- a/langtools/test/tools/javac/diags/examples/IllegalArgumentForOption/IllegalArgumentForOption.java
+++ b/langtools/test/tools/javac/diags/examples/IllegalArgumentForOption/IllegalArgumentForOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.err.illegal.argument.for.option
-// options: --module-path doesNotExist
+// options: --module-source-path=abc*def
 // run: simple
 
 class X {}
diff --git a/langtools/test/tools/javac/diags/examples/ModuleInfoWithXModuleSourcePath/Extra.java b/langtools/test/tools/javac/diags/examples/ModuleInfoWithXModuleSourcePath/Extra.java
deleted file mode 100644
index cafc425..0000000
--- a/langtools/test/tools/javac/diags/examples/ModuleInfoWithXModuleSourcePath/Extra.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-// key: compiler.err.module-info.with.xmodule.sourcepath
-// options: -Xmodule:java.compiler
-
-package javax.lang.model.element;
-
-public interface Extra {}
diff --git a/langtools/test/tools/javac/diags/examples/ModuleInfoWithXModuleSourcePath/module-info.java b/langtools/test/tools/javac/diags/examples/ModuleInfoWithXModuleSourcePath/module-info.java
deleted file mode 100644
index 7971526..0000000
--- a/langtools/test/tools/javac/diags/examples/ModuleInfoWithXModuleSourcePath/module-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-module java.compiler {}
diff --git a/langtools/test/tools/javac/diags/examples/ModuleInfoWithXmoduleClasspath/ModuleInfoWithXmoduleClasspath.java b/langtools/test/tools/javac/diags/examples/ModuleInfoWithXmoduleClasspath/ModuleInfoWithXmoduleClasspath.java
deleted file mode 100644
index a9ea819..0000000
--- a/langtools/test/tools/javac/diags/examples/ModuleInfoWithXmoduleClasspath/ModuleInfoWithXmoduleClasspath.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-// key: compiler.err.module-info.with.xmodule.classpath
-// options: -Xmodule:java.compiler
-
-package javax.lang.model.element;
-
-public interface ModuleInfoWithXModuleClasspath {}
diff --git a/langtools/test/tools/javac/diags/examples/ModuleInfoWithXmoduleClasspath/additional/module-info.java b/langtools/test/tools/javac/diags/examples/ModuleInfoWithXmoduleClasspath/additional/module-info.java
deleted file mode 100644
index 6faf7db..0000000
--- a/langtools/test/tools/javac/diags/examples/ModuleInfoWithXmoduleClasspath/additional/module-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-module mod {}
diff --git a/langtools/test/tools/javac/diags/examples/NoJavaLang.java b/langtools/test/tools/javac/diags/examples/NoJavaLang.java
index 5025874..330243d 100644
--- a/langtools/test/tools/javac/diags/examples/NoJavaLang.java
+++ b/langtools/test/tools/javac/diags/examples/NoJavaLang.java
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.misc.fatal.err.no.java.lang
-// options: -source 8 -target 8 -Xbootclasspath:
+// options: -source 8 -target 8 -Xbootclasspath: -classpath .
 // run: backdoor
 
 class NoJavaLang { }
diff --git a/langtools/test/tools/javac/diags/examples/NoSuperclass.java b/langtools/test/tools/javac/diags/examples/NoSuperclass.java
deleted file mode 100644
index 9e86e18..0000000
--- a/langtools/test/tools/javac/diags/examples/NoSuperclass.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-// key: compiler.err.no.superclass
-// options: -Xmodule:java.base
-
-package java.lang;
-
-class Object {
-    public Object() {
-        super();
-    }
-}
diff --git a/langtools/test/tools/javac/diags/examples/NoSuperclass/NoSuperclass.java b/langtools/test/tools/javac/diags/examples/NoSuperclass/NoSuperclass.java
new file mode 100644
index 0000000..9fcc907
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/NoSuperclass/NoSuperclass.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.no.superclass
diff --git a/langtools/test/tools/javac/diags/examples/NoSuperclass/patchmodule/java.base/java/lang/Object.java b/langtools/test/tools/javac/diags/examples/NoSuperclass/patchmodule/java.base/java/lang/Object.java
new file mode 100644
index 0000000..c42ff75
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/NoSuperclass/patchmodule/java.base/java/lang/Object.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang;
+
+class Object {
+    public Object() {
+        super();
+    }
+}
diff --git a/langtools/test/tools/javac/diags/examples/RequiresAutomatic/module-info.java b/langtools/test/tools/javac/diags/examples/RequiresAutomatic/module-info.java
new file mode 100644
index 0000000..349b4f5
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/RequiresAutomatic/module-info.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+//options: -Xlint:requires-automatic
+//key: compiler.warn.requires.automatic
+module RequiresAutomatic {
+    requires a;
+}
diff --git a/langtools/test/tools/javac/diags/examples/RequiresAutomatic/modulepath/a/A.java b/langtools/test/tools/javac/diags/examples/RequiresAutomatic/modulepath/a/A.java
new file mode 100644
index 0000000..45d652e
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/RequiresAutomatic/modulepath/a/A.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public class A {}
diff --git a/langtools/test/tools/javac/diags/examples/RequiresTransitiveAutomatic/module-info.java b/langtools/test/tools/javac/diags/examples/RequiresTransitiveAutomatic/module-info.java
new file mode 100644
index 0000000..9994850
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/RequiresTransitiveAutomatic/module-info.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+//key: compiler.warn.requires.transitive.automatic
+module RequiresTransitiveAutomatic {
+    requires transitive a;
+}
diff --git a/langtools/test/tools/javac/diags/examples/RequiresTransitiveAutomatic/modulepath/a/A.java b/langtools/test/tools/javac/diags/examples/RequiresTransitiveAutomatic/modulepath/a/A.java
new file mode 100644
index 0000000..45d652e
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/RequiresTransitiveAutomatic/modulepath/a/A.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public class A {}
diff --git a/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/ServiceImplNotPublic.java b/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/ServiceImplNotPublic.java
new file mode 100644
index 0000000..e7bdcd8
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/ServiceImplNotPublic.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.not.def.public
diff --git a/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/example/ServiceImpl.java b/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/example/ServiceImpl.java
new file mode 100644
index 0000000..cb1b3b1
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/example/ServiceImpl.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package example;
+class ServiceImpl implements example.SomeService {
+    public ServiceImpl() {}
+    public void foo() {}
+}
diff --git a/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/example/SomeService.java b/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/example/SomeService.java
new file mode 100644
index 0000000..f39627f
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/example/SomeService.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package example;
+public interface SomeService {
+    public void foo();
+}
diff --git a/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/module-info.java b/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/module-info.java
new file mode 100644
index 0000000..ec6405d
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/ServiceImplNotPublic/module-info.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m {
+    exports example;
+    provides example.SomeService with example.ServiceImpl;
+}
diff --git a/langtools/test/tools/javac/diags/examples/TooManyPatchedModules/TooManyPatchedModules.java b/langtools/test/tools/javac/diags/examples/TooManyPatchedModules/TooManyPatchedModules.java
new file mode 100644
index 0000000..f7bb6ee
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/TooManyPatchedModules/TooManyPatchedModules.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.too.many.patched.modules
diff --git a/langtools/test/tools/javac/diags/examples/TooManyPatchedModules/patchmodule/java.compiler/p/C.java b/langtools/test/tools/javac/diags/examples/TooManyPatchedModules/patchmodule/java.compiler/p/C.java
new file mode 100644
index 0000000..a92294c
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/TooManyPatchedModules/patchmodule/java.compiler/p/C.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package p;
+
+class C {}
diff --git a/langtools/test/tools/javac/diags/examples/TooManyPatchedModules/patchmodule/jdk.compiler/p/C.java b/langtools/test/tools/javac/diags/examples/TooManyPatchedModules/patchmodule/jdk.compiler/p/C.java
new file mode 100644
index 0000000..a92294c
--- /dev/null
+++ b/langtools/test/tools/javac/diags/examples/TooManyPatchedModules/patchmodule/jdk.compiler/p/C.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package p;
+
+class C {}
diff --git a/langtools/test/tools/javac/diags/examples/XModuleWithModulePath/XModuleWithModulePath.java b/langtools/test/tools/javac/diags/examples/XModuleWithModulePath/XModuleWithModulePath.java
deleted file mode 100644
index eaffab8..0000000
--- a/langtools/test/tools/javac/diags/examples/XModuleWithModulePath/XModuleWithModulePath.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-// key: compiler.err.xmodule.no.module.sourcepath
-// options: -Xmodule:java.compiler --module-source-path src
-
-class XModuleWithModulePath {}
diff --git a/langtools/test/tools/javac/doclint/NPEDuplicateClassNamesTest.java b/langtools/test/tools/javac/doclint/NPEDuplicateClassNamesTest.java
new file mode 100644
index 0000000..f55bf90
--- /dev/null
+++ b/langtools/test/tools/javac/doclint/NPEDuplicateClassNamesTest.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8174073
+ * @summary NPE caused by link reference to class
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.main
+ * @library /tools/lib
+ * @build toolbox.JavacTask toolbox.TestRunner toolbox.ToolBox
+ * @run main NPEDuplicateClassNamesTest
+ */
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+
+import toolbox.JavacTask;
+import toolbox.Task;
+import toolbox.TestRunner;
+import toolbox.ToolBox;
+
+public class NPEDuplicateClassNamesTest extends TestRunner {
+
+    public static void main(String... args) throws Exception {
+        NPEDuplicateClassNamesTest t = new NPEDuplicateClassNamesTest();
+        t.runTests();
+    }
+
+    private final ToolBox tb = new ToolBox();
+    private final String class1 =
+            "package com;\n" +
+            "/***/\n" +
+            "public class MyClass {}";
+    private final String class2 =
+            "package com;\n" +
+            "/**\n" +
+            " * The following link tag causes a NullPointerException: {@link Requirements}. \n" +
+            " */\n" +
+            "public class MyClass {}";
+
+    NPEDuplicateClassNamesTest() throws IOException {
+        super(System.err);
+    }
+
+    @Test
+    public void testDuplicateClassNames() throws IOException {
+        Path src = Paths.get("src");
+        Path one = src.resolve("one");
+        Path two = src.resolve("two");
+        Path classes = Paths.get("classes");
+        Files.createDirectories(classes);
+        tb.writeJavaFiles(one, class1);
+        tb.writeJavaFiles(two, class2);
+
+        List<String> expected = Arrays.asList(
+                "MyClass.java:5:8: compiler.err.duplicate.class: com.MyClass",
+                "MyClass.java:3:65: compiler.err.proc.messager: reference not found",
+                "2 errors");
+        List<String> output = new JavacTask(tb)
+                  .outdir(classes)
+                  .options("-XDrawDiagnostics", "-Xdoclint:all", "-XDdev")
+                  .files(tb.findJavaFiles(src))
+                  .run(Task.Expect.FAIL)
+                  .writeAll()
+                  .getOutputLines(Task.OutputKind.DIRECT);
+
+        if (!Objects.equals(output, expected)) {
+            throw new IllegalStateException("incorrect output; actual=" + output + "; expected=" + expected);
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/fatalErrors/NoJavaLangTest.java b/langtools/test/tools/javac/fatalErrors/NoJavaLangTest.java
index 6b93de4..b200c4c 100644
--- a/langtools/test/tools/javac/fatalErrors/NoJavaLangTest.java
+++ b/langtools/test/tools/javac/fatalErrors/NoJavaLangTest.java
@@ -74,7 +74,7 @@
 
     // test with bootclasspath, for as long as its around
     void testBootClassPath() {
-        String[] bcpOpts = { "-Xlint:-options", "-source", "8", "-bootclasspath", "." };
+        String[] bcpOpts = { "-Xlint:-options", "-source", "8", "-bootclasspath", ".", "-classpath", "." };
         test(bcpOpts, compilerErrorMessage);
     }
 
diff --git a/langtools/test/tools/javac/file/ModuleAndPackageLocations.java b/langtools/test/tools/javac/file/ModuleAndPackageLocations.java
index 5bd2677..0b06fc2 100644
--- a/langtools/test/tools/javac/file/ModuleAndPackageLocations.java
+++ b/langtools/test/tools/javac/file/ModuleAndPackageLocations.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8171005
+ * @bug 8171005 8175560
  * @summary Verify behavior of JavaFileManager methods w.r.t. module/package oriented locations
  * @library /tools/lib
  * @modules java.compiler
@@ -99,7 +99,7 @@
             Location cOutput = fm.getLocationForModule(StandardLocation.SOURCE_OUTPUT, "c");
             JavaFileObject testFO = fm.getJavaFileForOutput(cOutput, "test.Test", Kind.CLASS, null);
             testFO.openOutputStream().close();
-            Location cOutput2 = fm.getLocationForModule(StandardLocation.SOURCE_OUTPUT, testFO, "test");
+            Location cOutput2 = fm.getLocationForModule(StandardLocation.SOURCE_OUTPUT, testFO);
 
             if (cOutput != cOutput2) {
                 throw new AssertionError("Unexpected location: " + cOutput2 + ", expected: " +cOutput);
@@ -117,7 +117,7 @@
             assertRefused(() -> fm.getJavaFileForOutput(StandardLocation.MODULE_SOURCE_PATH, "", Kind.SOURCE, null));
             assertRefused(() -> fm.getLocationForModule(StandardLocation.SOURCE_PATH, "test"));
             JavaFileObject out = fm.getJavaFileForInput(StandardLocation.CLASS_OUTPUT, "test.Test", Kind.CLASS);
-            assertRefused(() -> fm.getLocationForModule(StandardLocation.SOURCE_PATH, out, "test"));
+            assertRefused(() -> fm.getLocationForModule(StandardLocation.SOURCE_PATH, out));
             assertRefused(() -> fm.inferBinaryName(StandardLocation.MODULE_PATH, out));
             assertRefused(() -> fm.inferModuleName(StandardLocation.MODULE_SOURCE_PATH));
             assertRefused(() -> fm.list(StandardLocation.MODULE_SOURCE_PATH, "test", EnumSet.allOf(Kind.class), false));
@@ -131,10 +131,10 @@
             Path msp1 = msp.resolve("1");
             Path msp2 = msp.resolve("2");
 
-            Files.createDirectories(msp1.resolve("a"));
+            touch(msp1.resolve("a/module-info.java"));
             Files.createDirectories(msp1.resolve("b"));
-            Files.createDirectories(msp2.resolve("b"));
-            Files.createDirectories(msp2.resolve("c"));
+            touch(msp2.resolve("b/module-info.java"));
+            touch(msp2.resolve("c/module-info.java"));
 
             Path mp  = base.resolve("mp");
             Path mp1 = mp.resolve("1");
@@ -210,4 +210,4 @@
     }
 
     JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
-}
\ No newline at end of file
+}
diff --git a/langtools/test/tools/javac/file/SetLocationForModule.java b/langtools/test/tools/javac/file/SetLocationForModule.java
new file mode 100644
index 0000000..02483c9
--- /dev/null
+++ b/langtools/test/tools/javac/file/SetLocationForModule.java
@@ -0,0 +1,328 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8173914
+ * @summary JavaFileManager.setLocationForModule
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.main
+ * @library /tools/lib
+ * @build toolbox.JavacTask toolbox.TestRunner toolbox.ToolBox SetLocationForModule
+ * @run main SetLocationForModule
+ */
+
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileManager.Location;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
+import toolbox.JavacTask;
+import toolbox.TestRunner;
+import toolbox.TestRunner.Test;
+import toolbox.ToolBox;
+
+public class SetLocationForModule extends TestRunner {
+
+    public static void main(String... args) throws Exception {
+        new SetLocationForModule().runTests(m -> new Object[] { Paths.get(m.getName()) });
+    }
+
+    public SetLocationForModule() {
+        super(System.err);
+    }
+
+    private final JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
+    private final ToolBox tb = new ToolBox();
+
+    @Test
+    public void testBasic(Path base) throws IOException {
+        try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
+            Location[] locns = {
+                StandardLocation.SOURCE_PATH,
+                StandardLocation.CLASS_PATH,
+                StandardLocation.PLATFORM_CLASS_PATH,
+            };
+            // set a value
+            Path out = Files.createDirectories(base.resolve("out"));
+            for (Location locn : locns) {
+                checkException("unsupported for location",
+                        IllegalArgumentException.class,
+                        "location is not an output location or a module-oriented location: " + locn,
+                        () -> fm.setLocationForModule(locn, "m", List.of(out)));
+            }
+        }
+    }
+
+    @Test
+    public void testModulePath(Path base) throws IOException {
+        try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
+            Path src = base.resolve("src");
+            Path src_m = src.resolve("m");
+            tb.writeJavaFiles(src_m, "module m { }");
+
+            Location locn = StandardLocation.MODULE_PATH;
+
+            Path modules1 = Files.createDirectories(base.resolve("modules1"));
+            new JavacTask(tb)
+                    .outdir(modules1)
+                    .options("--module-source-path", src.toString())
+                    .files(tb.findJavaFiles(src))
+                    .run();
+            fm.setLocationFromPaths(locn, List.of(modules1));
+
+            Location m = fm.getLocationForModule(locn, "m");
+            checkEqual("default setting",
+                    fm.getLocationAsPaths(m), modules1.resolve("m"));
+
+            Path override1 = Files.createDirectories(base.resolve("override1"));
+            fm.setLocationForModule(locn, "m", List.of(override1));
+            checkEqual("override setting 1",
+                    fm.getLocationAsPaths(m), override1);
+
+            Path override2 = Files.createDirectories(base.resolve("override2"));
+            fm.setLocationFromPaths(m, List.of(override2));
+            checkEqual("override setting 2",
+                    fm.getLocationAsPaths(m), override2);
+
+            Path modules2 = Files.createDirectories(base.resolve("modules2"));
+            fm.setLocationFromPaths(locn, List.of(modules2));
+
+            checkEqual("updated setting",
+                    fm.getLocationAsPaths(m), modules2.resolve("m"));
+        }
+    }
+
+    @Test
+    public void testModuleSourcePath(Path base) throws IOException {
+        try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
+
+            Location locn = StandardLocation.MODULE_SOURCE_PATH;
+
+            Path src1 = Files.createDirectories(base.resolve("src1"));
+            Path src1_m = src1.resolve("m");
+            tb.writeJavaFiles(src1_m, "module m { }");
+//            fm.setLocationFromPaths(locn, List.of(src1));
+            fm.handleOption("--module-source-path", List.of(src1.toString()).iterator());
+
+            Location m = fm.getLocationForModule(locn, "m");
+            checkEqual("default setting",
+                    fm.getLocationAsPaths(m), src1.resolve("m"));
+
+            Path override1 = Files.createDirectories(base.resolve("override1"));
+            tb.writeJavaFiles(override1, "module m { }");
+            fm.setLocationForModule(locn, "m", List.of(override1));
+            checkEqual("override setting 1",
+                    fm.getLocationAsPaths(m), override1);
+
+            Path override2 = Files.createDirectories(base.resolve("override2"));
+            tb.writeJavaFiles(override2, "module m { }");
+            fm.setLocationFromPaths(m, List.of(override2));
+            checkEqual("override setting 2",
+                    fm.getLocationAsPaths(m), override2);
+
+            Path src2 = Files.createDirectories(base.resolve("src2"));
+            Path src2_m = src2.resolve("m");
+            tb.writeJavaFiles(src2_m, "module m { }");
+//            fm.setLocationFromPaths(locn, List.of(src2));
+            fm.handleOption("--module-source-path", List.of(src2.toString()).iterator());
+
+            checkEqual("updated setting",
+                    fm.getLocationAsPaths(m), src2.resolve("m"));
+        }
+    }
+
+    @Test
+    public void testOutput(Path base) throws IOException {
+        try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
+            Location locn = StandardLocation.CLASS_OUTPUT;
+
+            Path out1 = Files.createDirectories(base.resolve("out1"));
+            fm.setLocationFromPaths(locn, List.of(out1));
+
+            Location m = fm.getLocationForModule(locn, "m");
+            checkEqual("default setting",
+                    fm.getLocationAsPaths(m), out1.resolve("m"));
+
+            Path override1 = Files.createDirectories(base.resolve("override1"));
+            fm.setLocationForModule(locn, "m", List.of(override1));
+            checkEqual("override setting 1",
+                    fm.getLocationAsPaths(m), override1);
+
+            Path override2 = Files.createDirectories(base.resolve("override2"));
+            fm.setLocationFromPaths(m, List.of(override2));
+            checkEqual("override setting 2",
+                    fm.getLocationAsPaths(m), override2);
+
+            Path out2 = Files.createDirectories(base.resolve("out2"));
+            fm.setLocationFromPaths(locn, List.of(out2));
+
+            checkEqual("updated setting",
+                    fm.getLocationAsPaths(m), out2.resolve("m"));
+        }
+    }
+
+    @Test
+    public void testOutput_invalid(Path base) throws IOException {
+        try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
+            Location locn = StandardLocation.CLASS_OUTPUT;
+            // set a top default
+            Path out1 = Files.createDirectories(base.resolve("out1"));
+            fm.setLocationFromPaths(locn, List.of(out1));
+            // getLocnForModule
+            Location m = fm.getLocationForModule(locn, "m");
+            checkEqual("default setting",
+                    fm.getLocationAsPaths(m), out1.resolve("m"));
+
+            checkException("empty arg list",
+                    IllegalArgumentException.class, "empty path for directory",
+                    () -> fm.setLocationFromPaths(m, Collections.emptyList()));
+
+            Path out2 = Files.createDirectories(base.resolve("out2"));
+            checkException("empty arg list",
+                    IllegalArgumentException.class, "path too long for directory",
+                    () -> fm.setLocationFromPaths(m, List.of(out2, out2)));
+
+            Path notExist = base.resolve("notExist");
+            checkException("not exist",
+                    FileNotFoundException.class, notExist + ": does not exist",
+                    () -> fm.setLocationFromPaths(m, List.of(notExist)));
+
+            Path file = Files.createFile(base.resolve("file.txt"));
+            checkException("not exist",
+                    IOException.class, file + ": not a directory",
+                    () -> fm.setLocationFromPaths(m, List.of(file)));
+        }
+    }
+
+    @Test
+    public void testOutput_nested(Path base) throws IOException {
+        try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
+            Location locn = StandardLocation.CLASS_OUTPUT;
+
+            Path out1 = Files.createDirectories(base.resolve("out1"));
+            fm.setLocationForModule(locn, "m", List.of(out1));
+
+            Location m = fm.getLocationForModule(locn, "m");
+            checkEqual("initial setting",
+                    fm.getLocationAsPaths(m), out1);
+
+            Path out2 = Files.createDirectories(base.resolve("out2"));
+            checkException("create nested module",
+                    UnsupportedOperationException.class, "not supported for CLASS_OUTPUT[m]",
+                    () -> fm.setLocationForModule(m, "x", List.of(out2)));
+        }
+    }
+
+    @Test
+    public void testSystemModules(Path base) throws IOException {
+        try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
+            Location locn = StandardLocation.SYSTEM_MODULES;
+
+            Location javaCompiler = fm.getLocationForModule(locn, "java.compiler");
+            // cannot easily verify default setting: could be jrt: or exploded image
+
+            Path override1 = Files.createDirectories(base.resolve("override1"));
+            fm.setLocationForModule(locn, "java.compiler", List.of(override1));
+            checkEqual("override setting 1",
+                    fm.getLocationAsPaths(javaCompiler), override1);
+
+            Path override2 = Files.createDirectories(base.resolve("override2"));
+            fm.setLocationFromPaths(javaCompiler, List.of(override2));
+            checkEqual("override setting 2",
+                    fm.getLocationAsPaths(javaCompiler), override2);
+        }
+    }
+
+    @Test
+    public void testTemplate(Path base) {
+        // set a top default
+        // getLocnForModule
+        // set a value
+        // getLocnForModule
+        // reset
+        // getLocationForModule
+    }
+
+    interface RunnableWithException {
+        public void run() throws Exception;
+    }
+
+    void checkException(String message,
+            Class<? extends Throwable> expectedException, String expectedMessage,
+            RunnableWithException r) {
+        try {
+            r.run();
+            error(message + ": expected exception not thrown: " + expectedException);
+        } catch (Exception | Error t) {
+            if (expectedException.isAssignableFrom(t.getClass())) {
+                checkEqual("exception message",
+                        t.getMessage(), expectedMessage);
+
+            } else {
+                error(message + ": unexpected exception\n"
+                        + "expect: " + expectedException + "\n"
+                        + " found: " + t);
+            }
+        }
+    }
+
+    void checkEqual(String message, Iterable<? extends Path> found, Path... expect) {
+        List<Path> fList = asList(found);
+        List<Path> eList = List.of(expect);
+        if (!Objects.equals(fList, fList)) {
+            error(message + ": lists not equal\n"
+                    + "expect: " + eList + "\n"
+                    + " found: " + fList);
+        }
+    }
+
+    void checkEqual(String message, String found, String expect) {
+        if (!Objects.equals(found, expect)) {
+            error(message + ": strings not equal\n"
+                    + "expect: " + expect + "\n"
+                    + " found: " + found);
+        }
+    }
+
+    List<Path> asList(Iterable<? extends Path> a) {
+        List<Path> list = new ArrayList<>();
+        for (Path p : a) {
+            list.add(p);
+        }
+        return list;
+    }
+}
+
diff --git a/langtools/test/tools/javac/generics/inference/8174249/T8174249a.java b/langtools/test/tools/javac/generics/inference/8174249/T8174249a.java
new file mode 100644
index 0000000..80ebfa4
--- /dev/null
+++ b/langtools/test/tools/javac/generics/inference/8174249/T8174249a.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8174249
+ * @summary Regression in generic method unchecked calls
+ * @compile T8174249a.java
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+class T8174249a {
+    static <T> T foo(Class<T> c, Collection<? super T> baz) {
+return null;
+    }
+
+    static void bar(String c) { }
+
+    void test() {
+        // this works
+        bar(foo(String.class, new ArrayList<String>()));
+
+        // this works with a warning
+        String s = foo(String.class, new ArrayList());
+        bar(s);
+
+        // this causes an error on JDK9 but should work
+        bar(foo(String.class, new ArrayList()));
+    }
+}
diff --git a/langtools/test/tools/javac/generics/inference/8174249/T8174249b.java b/langtools/test/tools/javac/generics/inference/8174249/T8174249b.java
new file mode 100644
index 0000000..a7f175f
--- /dev/null
+++ b/langtools/test/tools/javac/generics/inference/8174249/T8174249b.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8174249
+ * @summary Regression in generic method unchecked calls
+ * @compile T8174249b.java
+ */
+
+import java.util.*;
+
+class T8174249b {
+
+    static void cs(Collection<String> cs) {}
+
+    void test1(Collection c) {
+        cs(rawCollection((Class)null));
+        Collection<String> cs1 = rawCollection((Class)null);
+    }
+
+    void test2(Collection c) {
+        cs(rawCollection2((Class)null));
+        Collection<String> cs2 = rawCollection2((Class)null);
+    }
+
+    void test3(Collection c) {
+        cs(rawCollection3((Class)null));
+        Collection<String> cs3 = rawCollection2((Class)null);
+    }
+
+    Collection<Integer> rawCollection(Class<String> cs) { return null; }
+
+    <Z> Collection<Integer> rawCollection2(Class<Z> cs) { return null; }
+
+    <Z> Collection<Z> rawCollection3(Class<Z> cs) { return null; }
+}
diff --git a/langtools/test/tools/javac/generics/inference/8176534/T8176534.java b/langtools/test/tools/javac/generics/inference/8176534/T8176534.java
new file mode 100644
index 0000000..3496c69
--- /dev/null
+++ b/langtools/test/tools/javac/generics/inference/8176534/T8176534.java
@@ -0,0 +1,18 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8176534
+ * @summary Missing check against target-type during applicability inference
+ * @compile/fail/ref=T8176534.out -Werror -Xlint:unchecked -XDrawDiagnostics T8176534.java
+ */
+
+import java.util.*;
+
+abstract class T8176534 {
+    List<String> f(Enumeration e) {
+        return newArrayList(forEnumeration(e));
+    }
+
+    abstract <T> Iterator<T> forEnumeration(Enumeration<T> e);
+    abstract <E> ArrayList<E> newArrayList(Iterator<? extends E> xs);
+    abstract <E> ArrayList<E> newArrayList(Iterable<? extends E> xs);
+}
diff --git a/langtools/test/tools/javac/generics/inference/8176534/T8176534.out b/langtools/test/tools/javac/generics/inference/8176534/T8176534.out
new file mode 100644
index 0000000..4353b75
--- /dev/null
+++ b/langtools/test/tools/javac/generics/inference/8176534/T8176534.out
@@ -0,0 +1,8 @@
+T8176534.java:12:43: compiler.warn.unchecked.meth.invocation.applied: kindname.method, forEnumeration, java.util.Enumeration<T>, java.util.Enumeration, kindname.class, T8176534
+T8176534.java:12:44: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.Enumeration, java.util.Enumeration<T>
+T8176534.java:12:28: compiler.warn.unchecked.meth.invocation.applied: kindname.method, newArrayList, java.util.Iterator<? extends E>, java.util.Iterator, kindname.class, T8176534
+T8176534.java:12:43: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.Iterator, java.util.Iterator<? extends E>
+T8176534.java:12:28: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.ArrayList, java.util.List<java.lang.String>
+- compiler.err.warnings.and.werror
+1 error
+5 warnings
diff --git a/langtools/test/tools/javac/generics/inference/8176534/TestUncheckedCalls.java b/langtools/test/tools/javac/generics/inference/8176534/TestUncheckedCalls.java
new file mode 100644
index 0000000..ef7267c
--- /dev/null
+++ b/langtools/test/tools/javac/generics/inference/8176534/TestUncheckedCalls.java
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import combo.ComboInstance;
+import combo.ComboParameter;
+import combo.ComboTask.Result;
+import combo.ComboTestHelper;
+
+import javax.lang.model.element.Element;
+import java.util.stream.Stream;
+
+/*
+ * @test
+ * @bug 8176534
+ * @summary Missing check against target-type during applicability inference
+ * @library /tools/javac/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.code
+ *          jdk.compiler/com.sun.tools.javac.comp
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.compiler/com.sun.tools.javac.tree
+ *          jdk.compiler/com.sun.tools.javac.util
+ * @build combo.ComboTestHelper
+ *
+ * @run main TestUncheckedCalls
+ */
+public class TestUncheckedCalls extends ComboInstance<TestUncheckedCalls> {
+    enum InputExpressionKind implements ComboParameter {
+        A("(A)null"),
+        A_STRING("(A<String>)null"),
+        B("(B)null"),
+        B_STRING("(B<String>)null");
+
+        String inputExpr;
+
+        InputExpressionKind(String inputExpr) {
+            this.inputExpr = inputExpr;
+        }
+
+
+        @Override
+        public String expand(String optParameter) {
+            return inputExpr;
+        }
+    }
+
+    enum TypeKind implements ComboParameter {
+        Z("Z"),
+        C_T("#C<T>"),
+        C_STRING("#C<String>"),
+        C("#C");
+
+        String typeTemplate;
+
+        TypeKind(String typeTemplate) {
+            this.typeTemplate = typeTemplate;
+        }
+
+        boolean hasTypeVars() {
+            return this == Z || this == C_T;
+        }
+
+        @Override
+        public String expand(String className) {
+            return typeTemplate.replaceAll("#C", className);
+        }
+    }
+
+    enum TypeVarsKind implements ComboParameter {
+        NONE("", "Object"),
+        Z_T("<Z extends #C<T>, T>", "Z");
+
+        String typeVarsTemplate;
+        String paramString;
+
+        TypeVarsKind(String typeVarsTemplate, String paramString) {
+            this.typeVarsTemplate = typeVarsTemplate;
+            this.paramString = paramString;
+        }
+
+
+        @Override
+        public String expand(String className) {
+            if (className.equals("Z")) {
+                return paramString;
+            } else {
+                return typeVarsTemplate.replaceAll("#C", className);
+            }
+        }
+    }
+
+    enum CallKind implements ComboParameter {
+        M("M(#{IN}, #{IN})"),
+        M_G("M(G(#{IN}, #{IN}), #{IN})"),
+        M_G_G("M(G(#{IN}, #{IN}), G(#{IN}, #{IN}))");
+
+        String callExpr;
+
+        CallKind(String callExpr) {
+            this.callExpr = callExpr;
+        }
+
+
+        @Override
+        public String expand(String optParameter) {
+            return callExpr;
+        }
+    }
+
+    enum DeclKind implements ComboParameter {
+        NONE(""),
+        ONE("#{TVARS[#M_IDX].I1} #{RET[#M_IDX].A} #M(#{ARG[#M_IDX].A} x1, #{TVARS[#M_IDX].Z} x2) { return null; }"),
+        TWO("#{TVARS[#M_IDX].I1} #{RET[#M_IDX].A} #M(#{ARG[#M_IDX].A} x1, #{TVARS[#M_IDX].Z} x2) { return null; }\n" +
+        "    #{TVARS[#M_IDX].I2} #{RET[#M_IDX].B} #M(#{ARG[#M_IDX].B} x1, #{TVARS[#M_IDX].Z} x2) { return null; }");
+
+        String declTemplate;
+
+        DeclKind(String declTemplate) {
+            this.declTemplate = declTemplate;
+        }
+
+        @Override
+        public String expand(String methName) {
+            return declTemplate.replaceAll("#M_IDX", methName.equals("M") ? "0" : "1")
+                    .replaceAll("#M", methName);
+
+        }
+    }
+
+    static final String sourceTemplate =
+            "class Test {\n" +
+            "   interface I1<X> { }\n" +
+            "   interface I2<X> { }\n" +
+            "   static class A<X> implements I1<X> { }\n" +
+            "   static class B<X> implements I2<X> { }\n" +
+            "   #{DECL[0].M}\n" +
+            "   #{DECL[1].G}\n" +
+            "   void test() {\n" +
+            "       #{CALL};\n" +
+            "   }\n" +
+            "}\n";
+
+    public static void main(String... args) throws Exception {
+        new ComboTestHelper<TestUncheckedCalls>()
+                .withFilter(TestUncheckedCalls::arityFilter)
+                .withFilter(TestUncheckedCalls::declFilter)
+                .withFilter(TestUncheckedCalls::tvarFilter)
+                .withFilter(TestUncheckedCalls::inputExprFilter)
+                .withDimension("IN", (x, expr) -> x.inputExpressionKind = expr, InputExpressionKind.values())
+                .withDimension("CALL", (x, expr) -> x.callKind = expr, CallKind.values())
+                .withArrayDimension("DECL", (x, decl, idx) -> x.decls[idx] = x.new Decl(decl, idx), 2, DeclKind.values())
+                .withArrayDimension("TVARS", (x, tvars, idx) -> x.typeVarsKinds[idx] = tvars, 2, TypeVarsKind.values())
+                .withArrayDimension("RET", (x, ret, idx) -> x.returnKinds[idx] = ret, 2, TypeKind.values())
+                .withArrayDimension("ARG", (x, arg, idx) -> x.argumentKinds[idx] = arg, 2, TypeKind.values())
+                .run(TestUncheckedCalls::new);
+    }
+
+    class Decl {
+        private DeclKind declKind;
+        private int index;
+
+        Decl(DeclKind declKind, int index) {
+            this.declKind = declKind;
+            this.index = index;
+        }
+
+        boolean hasKind(DeclKind declKind) {
+            return this.declKind == declKind;
+        }
+
+        boolean isGeneric() {
+            return typeVarsKind() == TypeVarsKind.Z_T;
+        }
+
+        TypeKind returnKind() {
+            return returnKinds[index];
+        }
+
+        TypeKind argumentsKind() {
+            return argumentKinds[index];
+        }
+
+        TypeVarsKind typeVarsKind() {
+            return typeVarsKinds[index];
+        }
+    }
+
+    CallKind callKind;
+    InputExpressionKind inputExpressionKind;
+    TypeKind[] returnKinds = new TypeKind[2];
+    TypeKind[] argumentKinds = new TypeKind[2];
+    TypeVarsKind[] typeVarsKinds = new TypeVarsKind[2];
+    Decl[] decls = new Decl[2];
+
+    boolean arityFilter() {
+        return (callKind == CallKind.M || !decls[1].hasKind(DeclKind.NONE)) &&
+                !decls[0].hasKind(DeclKind.NONE);
+    }
+
+    boolean declFilter() {
+        return Stream.of(decls)
+                .filter(d -> d.hasKind(DeclKind.NONE))
+                .flatMap(d -> Stream.of(d.returnKind(), d.argumentsKind(), d.typeVarsKind()))
+                .noneMatch(tk -> tk.ordinal() != 0);
+    }
+
+    boolean tvarFilter() {
+        return Stream.of(decls)
+                .filter(d -> !d.hasKind(DeclKind.NONE))
+                .filter(d -> !d.isGeneric())
+                .flatMap(d -> Stream.of(d.returnKind(), d.argumentsKind()))
+                .noneMatch(TypeKind::hasTypeVars);
+    }
+
+    boolean inputExprFilter() {
+        return (inputExpressionKind != InputExpressionKind.B && inputExpressionKind != InputExpressionKind.B_STRING) ||
+                Stream.of(decls).allMatch(d -> d.declKind == DeclKind.TWO);
+    }
+
+    @Override
+    public void doWork() throws Throwable {
+        check(newCompilationTask()
+                .withSourceFromTemplate(sourceTemplate)
+                .analyze());
+    }
+
+    void check(Result<Iterable<? extends Element>> result) {
+        if (result.hasErrors()) {
+            fail("compiler error:\n" +
+                    result.compilationInfo());
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/generics/inference/8177097/T8177097a.java b/langtools/test/tools/javac/generics/inference/8177097/T8177097a.java
new file mode 100644
index 0000000..98bbd45
--- /dev/null
+++ b/langtools/test/tools/javac/generics/inference/8177097/T8177097a.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8177097
+ * @summary Generic method reference returning wildcard parameterized type does not compile
+ * @compile T8177097a.java
+ */
+
+import java.util.Map;
+
+class T8177097a {
+    interface X<O> {
+        Map<?, O> apply();
+    }
+
+    <O> void go(X<O> x) { }
+
+    static <I> Map<?, Integer> a() {
+        return null;
+    }
+
+    void test() {
+        go(T8177097a::a);
+    }
+}
diff --git a/langtools/test/tools/javac/generics/inference/8177097/T8177097b.java b/langtools/test/tools/javac/generics/inference/8177097/T8177097b.java
new file mode 100644
index 0000000..a7d2b5c
--- /dev/null
+++ b/langtools/test/tools/javac/generics/inference/8177097/T8177097b.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8177097
+ * @summary Generic method reference returning wildcard parameterized type does not compile
+ * @compile T8177097b.java
+ */
+
+import java.util.Map;
+
+class T8177097b {
+    interface X<O> {
+        O apply(Class<Map<Integer, ?>> m2);
+    }
+
+    <O> void go(X<O> x) {}
+
+    static <I> I a(Class<I> c) { return null; }
+
+
+    void test() {
+        go(T8177097b::a);
+    }
+}
diff --git a/langtools/test/tools/javac/lambda/T8175317.java b/langtools/test/tools/javac/lambda/T8175317.java
new file mode 100644
index 0000000..08d3ebe
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/T8175317.java
@@ -0,0 +1,31 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8175317
+ * @summary javac does not issue unchecked warnings when checking method reference return types
+ * @compile/fail/ref=T8175317.out -Werror -Xlint:unchecked -XDrawDiagnostics T8175317.java
+ */
+
+import java.util.function.*;
+import java.util.*;
+
+class T8175317 {
+    void m(Supplier<List<String>> s) { }
+
+    void testMethodLambda(List l) {
+        m(() -> l);
+    }
+
+    void testAssignLambda(List l) {
+        Supplier<List<String>> s = () -> l;
+    }
+
+    void testMethodMref() {
+        m(this::g);
+    }
+
+    void testAssignMref() {
+        Supplier<List<String>> s = this::g;
+    }
+
+    List g() { return null; }
+}
diff --git a/langtools/test/tools/javac/lambda/T8175317.out b/langtools/test/tools/javac/lambda/T8175317.out
new file mode 100644
index 0000000..74cdca6
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/T8175317.out
@@ -0,0 +1,7 @@
+T8175317.java:15:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, java.util.function.Supplier<java.util.List<java.lang.String>>, java.util.function.Supplier<java.util.List<java.lang.String>>, kindname.class, T8175317
+T8175317.java:19:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.List, java.util.List<java.lang.String>
+T8175317.java:23:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, java.util.function.Supplier<java.util.List<java.lang.String>>, java.util.function.Supplier<java.util.List<java.lang.String>>, kindname.class, T8175317
+T8175317.java:27:36: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.List, java.util.List<java.lang.String>
+- compiler.err.warnings.and.werror
+1 error
+4 warnings
diff --git a/langtools/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java b/langtools/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java
index 47eb386..ce7bb16 100644
--- a/langtools/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java
+++ b/langtools/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java
@@ -26,6 +26,7 @@
  * @bug 8002099 8010822
  * @summary Add support for intersection types in cast expression
  * @modules jdk.compiler/com.sun.tools.javac.util
+ * @run main/othervm IntersectionTargetTypeTest
  */
 
 import com.sun.source.util.JavacTask;
diff --git a/langtools/test/tools/javac/lambda/speculative/T8177933.java b/langtools/test/tools/javac/lambda/speculative/T8177933.java
new file mode 100644
index 0000000..d9a1ac2
--- /dev/null
+++ b/langtools/test/tools/javac/lambda/speculative/T8177933.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8177933
+ * @summary Stackoverflow during compilation, starting jdk-9+163
+ *
+ * @library /tools/javac/lib
+ * @requires !(os.family == "solaris")
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.code
+ *          jdk.compiler/com.sun.tools.javac.comp
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.compiler/com.sun.tools.javac.tree
+ *          jdk.compiler/com.sun.tools.javac.util
+ * @build combo.ComboTestHelper
+
+ * @run main/othervm -Xss512K T8177933
+ */
+
+import combo.ComboInstance;
+import combo.ComboParameter;
+import combo.ComboTask.Result;
+import combo.ComboTestHelper;
+
+import javax.lang.model.element.Element;
+
+public class T8177933 extends ComboInstance<T8177933> {
+
+    static final int MAX_DEPTH = 350;
+
+    static class CallExpr implements ComboParameter {
+        @Override
+        public String expand(String optParameter) {
+            Integer n = Integer.parseInt(optParameter);
+            if (n == MAX_DEPTH) {
+                return "m()";
+            } else {
+                return "m().#{CALL." + (n + 1) + "}";
+            }
+        }
+    }
+
+    static final String sourceTemplate =
+            "class Test {\n" +
+            "   Test m() { return null; }\n" +
+            "   void test() {\n" +
+            "       #{CALL.0};\n" +
+            "} }\n";
+
+    public static void main(String[] args) {
+        new ComboTestHelper<T8177933>()
+                .withDimension("CALL", new CallExpr())
+                .run(T8177933::new);
+    }
+
+    @Override
+    protected void doWork() throws Throwable {
+        Result<Iterable<? extends Element>> result = newCompilationTask()
+                    .withOption("-XDdev")
+                    .withSourceFromTemplate(sourceTemplate)
+                    .analyze();
+        if (!result.get().iterator().hasNext()) {
+            fail("Exception occurred when compiling combo. " + result.compilationInfo());
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java b/langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java
index f253356..6509542 100644
--- a/langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java
+++ b/langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java
@@ -21,8 +21,6 @@
  * questions.
  */
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 import javax.annotation.processing.*;
 import javax.lang.model.SourceVersion;
@@ -102,7 +100,7 @@
     protected void addExports(String moduleName, String... packageNames) {
         for (String packageName : packageNames) {
             try {
-                Layer layer = Layer.boot();
+                ModuleLayer layer = ModuleLayer.boot();
                 Optional<Module> m = layer.findModule(moduleName);
                 if (!m.isPresent())
                     throw new Error("module not found: " + moduleName);
diff --git a/langtools/test/tools/javac/lib/combo/ComboTask.java b/langtools/test/tools/javac/lib/combo/ComboTask.java
index ee20f78..568a1ef 100644
--- a/langtools/test/tools/javac/lib/combo/ComboTask.java
+++ b/langtools/test/tools/javac/lib/combo/ComboTask.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
 
 import com.sun.source.tree.CompilationUnitTree;
 import com.sun.source.util.JavacTask;
-import com.sun.source.util.TaskEvent.Kind;
 import com.sun.source.util.TaskListener;
 import com.sun.tools.javac.api.JavacTool;
+import com.sun.tools.javac.util.Assert;
 import com.sun.tools.javac.util.List;
 import combo.ComboParameter.Resolver;
 
@@ -36,11 +36,18 @@
 import javax.tools.DiagnosticListener;
 import javax.tools.JavaFileObject;
 import javax.tools.SimpleJavaFileObject;
+
 import java.io.IOException;
 import java.io.Writer;
 import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.function.Consumer;
+import java.util.function.Function;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Optional;
 import java.util.stream.Collectors;
 import java.util.stream.StreamSupport;
 
@@ -184,6 +191,28 @@
     }
 
     /**
+     * Parse, analyze, perform code generation for the sources associated with this task and finally
+     * executes them
+     */
+    public <Z> Optional<Z> execute(Function<ExecutionTask, Z> executionFunc) throws IOException {
+        Result<Iterable<? extends JavaFileObject>> generationResult = generate();
+        Iterable<? extends JavaFileObject> jfoIterable = generationResult.get();
+        if (generationResult.hasErrors()) {
+            // we have nothing else to do
+            return Optional.empty();
+        }
+        java.util.List<URL> urlList = new ArrayList<>();
+        for (JavaFileObject jfo : jfoIterable) {
+            String urlStr = jfo.toUri().toURL().toString();
+            urlStr = urlStr.substring(0, urlStr.length() - jfo.getName().length());
+            urlList.add(new URL(urlStr));
+        }
+        return Optional.of(
+                executionFunc.apply(
+                        new ExecutionTask(new URLClassLoader(urlList.toArray(new URL[urlList.size()])))));
+    }
+
+    /**
      * Fork a new compilation task; if possible the compilation context from previous executions is
      * retained (see comments in ReusableContext as to when it's safe to do so); otherwise a brand
      * new context is created.
@@ -215,6 +244,80 @@
     }
 
     /**
+     * This class represents an execution task. It allows the execution of one or more classes previously
+     * added to a given class loader. This class uses reflection to execute any given static public method
+     * in any given class. It's not restricted to the execution of the {@code main} method
+     */
+    public class ExecutionTask {
+        private ClassLoader classLoader;
+        private String methodName = "main";
+        private Class<?>[] parameterTypes = new Class<?>[]{String[].class};
+        private Object[] args = new String[0];
+        private Consumer<Throwable> handler;
+        private Class<?> c;
+
+        private ExecutionTask(ClassLoader classLoader) {
+            this.classLoader = classLoader;
+        }
+
+        /**
+         * Set the name of the class to be loaded.
+         */
+        public ExecutionTask withClass(String className) {
+            Assert.check(className != null, "class name value is null, impossible to proceed");
+            try {
+                c = classLoader.loadClass(className);
+            } catch (Throwable t) {
+                throw new IllegalStateException(t);
+            }
+            return this;
+        }
+
+        /**
+         * Set the name of the method to be executed along with the parameter types to
+         * reflectively obtain the method.
+         */
+        public ExecutionTask withMethod(String methodName, Class<?>... parameterTypes) {
+            this.methodName = methodName;
+            this.parameterTypes = parameterTypes;
+            return this;
+        }
+
+        /**
+         * Set the arguments to be passed to the method.
+         */
+        public ExecutionTask withArguments(Object... args) {
+            this.args = args;
+            return this;
+        }
+
+        /**
+         * Set a handler to handle any exception thrown.
+         */
+        public ExecutionTask withHandler(Consumer<Throwable> handler) {
+            this.handler = handler;
+            return this;
+        }
+
+        /**
+         * Executes the given method in the given class. Returns true if the execution was
+         * successful, false otherwise.
+         */
+        public Object run() {
+            try {
+                java.lang.reflect.Method meth = c.getMethod(methodName, parameterTypes);
+                meth.invoke(null, (Object)args);
+                return true;
+            } catch (Throwable t) {
+                if (handler != null) {
+                    handler.accept(t);
+                }
+                return false;
+            }
+        }
+    }
+
+    /**
      * This class is used to help clients accessing the results of a given compilation task.
      * Contains several helper methods to inspect diagnostics generated during the task execution.
      */
diff --git a/langtools/test/tools/javac/main/EnvVariableTest.java b/langtools/test/tools/javac/main/EnvVariableTest.java
new file mode 100644
index 0000000..0d44edc
--- /dev/null
+++ b/langtools/test/tools/javac/main/EnvVariableTest.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173308
+ * @summary Check JDK_JAVA_OPTIONS parsing behavior
+ * @library /tools/lib
+ * @modules jdk.compiler/com.sun.tools.javac.main
+ * @build toolbox.ToolBox toolbox.TestRunner
+ * @run main EnvVariableTest
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.nio.file.Path;
+
+import toolbox.*;
+
+import com.sun.tools.javac.main.CommandLine;
+
+public class EnvVariableTest extends TestRunner {
+    final String testClasses;
+    final ToolBox tb;
+    final Path javaExePath;
+    final ExecTask task;
+    final PrintStream ostream;
+    final ByteArrayOutputStream baos;
+
+    public EnvVariableTest() {
+        super(System.err);
+        ostream = System.err;
+        baos = new ByteArrayOutputStream();
+        testClasses = System.getProperty("test.classes");
+        tb = new ToolBox();
+        javaExePath = tb.getJDKTool("java");
+        task = new ExecTask(tb, javaExePath);
+    }
+
+    public static void main(String... args) throws Exception {
+        EnvVariableTest t = new EnvVariableTest();
+        t.runTests();
+    }
+
+    @Test
+    public void testDoubleQuote() throws Exception {
+        // white space quoted with double quotes
+        test("-version -cp \"c:\\\\java libs\\\\one.jar\" \n",
+                "-version", "-cp", "c:\\\\java libs\\\\one.jar");
+    }
+
+    @Test
+    public void testSingleQuote() throws Exception {
+        // white space quoted with single quotes
+        test("-version -cp \'c:\\\\java libs\\\\one.jar\' \n",
+                "-version", "-cp", "c:\\\\java libs\\\\one.jar");
+    }
+
+    @Test
+    public void testEscapeCharacters() throws Exception {
+        // escaped characters
+        test("escaped chars testing \"\\a\\b\\c\\f\\n\\r\\t\\v\\9\\6\\23\\82\\28\\377\\477\\278\\287\"",
+                "escaped", "chars", "testing", "\\a\\b\\c\\f\\n\\r\\t\\v\\9\\6\\23\\82\\28\\377\\477\\278\\287");
+    }
+
+    @Test
+    public void testMixedQuotes() throws Exception {
+        // more mixing of quote types
+        test("\"mix 'single quote' in double\" 'mix \"double quote\" in single' partial\"quote me\"this",
+                "mix 'single quote' in double", "mix \"double quote\" in single", "partialquote methis");
+    }
+
+    @Test
+    public void testWhiteSpaces() throws Exception {
+        // whitespace tests
+        test("line one #comment\n'line #2' #rest are comment\r\n#comment on line 3\fline 4 #comment to eof",
+                "line", "one", "#comment", "line #2", "#rest", "are", "comment", "#comment", "on", "line",
+                "3", "line", "4", "#comment", "to", "eof");
+    }
+
+    @Test
+    public void testMismatchedDoubleQuote() throws Exception {
+        // mismatched quote
+        test("This is an \"open quote \n    across line\n\t, note for WS.",
+                "Exception: JDK_JAVAC_OPTIONS");
+    }
+
+    @Test
+    public void testMismatchedSingleQuote() throws Exception {
+        // mismatched quote
+        test("This is an \'open quote \n    across line\n\t, note for WS.",
+                "Exception: JDK_JAVAC_OPTIONS");
+    }
+
+    void test(String full, String... expectedArgs) throws Exception {
+        task.envVar("JDK_JAVAC_OPTIONS", full);
+        task.args("--add-exports", "jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
+                "-cp", testClasses, "EnvVariableTest$Tester");
+        Task.Result tr = task.run(Task.Expect.SUCCESS);
+        String expected = Tester.arrayToString(expectedArgs);
+        String in = tr.getOutput(Task.OutputKind.STDOUT);
+        System.err.println("Matching...");
+        System.err.println("Obtained: " + in);
+        System.err.println("Expected: " + expected);
+        if (in.contains(expected)) {
+            System.err.println("....OK");
+            return;
+        }
+        throw new Exception("Expected strings not found");
+    }
+
+    /**
+     * A tester class that is invoked to invoke the CommandLine class, and
+     * print the result.
+     */
+    public static class Tester {
+        private static final String[] EMPTY_ARRAY = new String[0];
+        static String arrayToString(String... args) {
+            return String.join(", ", args);
+        }
+        public static void main(String... args) throws IOException {
+            try {
+                String[] argv = CommandLine.parse("JDK_JAVAC_OPTIONS", EMPTY_ARRAY);
+                System.out.print(arrayToString(argv));
+            } catch (CommandLine.UnmatchedQuote ex) {
+                System.out.print("Exception: " + ex.variableName);
+            }
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/meth/BadPolySig.java b/langtools/test/tools/javac/meth/BadPolySig.java
deleted file mode 100644
index f607f63..0000000
--- a/langtools/test/tools/javac/meth/BadPolySig.java
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * @test
- * @bug 8168774
- * @summary Polymorhic signature method check crashes javac
- * @compile -Xmodule:java.base BadPolySig.java
- */
-
-package java.lang.invoke;
-
-class MethodHandle {
-    native Object m();
-}
diff --git a/langtools/test/tools/javac/meth/BadPolySig/BadPolySig.java b/langtools/test/tools/javac/meth/BadPolySig/BadPolySig.java
new file mode 100644
index 0000000..2d36682
--- /dev/null
+++ b/langtools/test/tools/javac/meth/BadPolySig/BadPolySig.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8168774
+ * @summary Polymorhic signature method check crashes javac
+ * @modules jdk.compiler
+ * @compile/module=java.base java/lang/invoke/MethodHandle.java
+ */
diff --git a/langtools/test/tools/javac/meth/BadPolySig/java.base/java/lang/invoke/MethodHandle.java b/langtools/test/tools/javac/meth/BadPolySig/java.base/java/lang/invoke/MethodHandle.java
new file mode 100644
index 0000000..b748f3e
--- /dev/null
+++ b/langtools/test/tools/javac/meth/BadPolySig/java.base/java/lang/invoke/MethodHandle.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.invoke;
+
+class MethodHandle {
+    native Object m();
+}
diff --git a/langtools/test/tools/javac/modules/AddLimitMods.java b/langtools/test/tools/javac/modules/AddLimitMods.java
index 8c980bb..55b5d82 100644
--- a/langtools/test/tools/javac/modules/AddLimitMods.java
+++ b/langtools/test/tools/javac/modules/AddLimitMods.java
@@ -293,7 +293,7 @@
         }
 
         actual = new JavacTask(tb)
-                   .options("-Xmodule:java.base",
+                   .options("--patch-module", "java.base=" + cpSrc.toString(),
                             "-XDrawDiagnostics",
                             "--add-modules", "ALL-MODULE-PATH")
                    .outdir(cpOut)
@@ -418,13 +418,13 @@
                                       "    public static void main(String... args) throws Exception {\n");
 
                 for (Entry<String, String> e : MODULES_TO_CHECK_TO_SAMPLE_CLASS.entrySet()) {
-                    testClassNamed.append("        System.err.println(\"visible:" + e.getKey() + ":\" + java.lang.reflect.Layer.boot().findModule(\"" + e.getKey() + "\").isPresent());\n");
+                    testClassNamed.append("        System.err.println(\"visible:" + e.getKey() + ":\" + ModuleLayer.boot().findModule(\"" + e.getKey() + "\").isPresent());\n");
                 }
 
                 testClassNamed.append("        Class<?> cp = Class.forName(Test.class.getClassLoader().getUnnamedModule(), \"cp.CP\");\n");
                 testClassNamed.append("        cp.getDeclaredMethod(\"runMe\").invoke(null);\n");
 
-                testClassNamed.append("        Class<?> automatic = Class.forName(java.lang.reflect.Layer.boot().findModule(\"automatic\").get(), \"automatic.Automatic\");\n");
+                testClassNamed.append("        Class<?> automatic = Class.forName(ModuleLayer.boot().findModule(\"automatic\").get(), \"automatic.Automatic\");\n");
                 testClassNamed.append("        automatic.getDeclaredMethod(\"runMe\").invoke(null);\n");
 
                 testClassNamed.append("    }\n" +
diff --git a/langtools/test/tools/javac/modules/AddModulesTest.java b/langtools/test/tools/javac/modules/AddModulesTest.java
index 8aaba8e..8856fc3 100644
--- a/langtools/test/tools/javac/modules/AddModulesTest.java
+++ b/langtools/test/tools/javac/modules/AddModulesTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,17 +23,27 @@
 
 /*
  * @test
+ * @bug 8167975 8173596
  * @summary Test the --add-modules option
  * @library /tools/lib
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
- * @build toolbox.ToolBox toolbox.JavacTask ModuleTestBase
+ * @build toolbox.Assert toolbox.ToolBox toolbox.JavacTask ModuleTestBase
  * @run main AddModulesTest
  */
 
 
 import java.nio.file.Path;
+import java.util.Arrays;
 
+import javax.tools.JavaCompiler;
+import javax.tools.JavaCompiler.CompilationTask;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
+import toolbox.Assert;
 import toolbox.JavacTask;
 import toolbox.Task;
 
@@ -227,5 +237,46 @@
                 .run()
                 .writeAll();
     }
+
+    @Test
+    public void testAddModulesAPI(Path base) throws Exception {
+        Path src = base.resolve("src");
+
+        // setup some utility modules
+        Path src_m1 = src.resolve("m1x");
+        tb.writeJavaFiles(src_m1,
+                          "module m1x { exports p1; }",
+                          "package p1; public class C1 { }");
+        Path src_m2 = src.resolve("m2x");
+        tb.writeJavaFiles(src_m2,
+                          "module m2x { exports p2; }",
+                          "package p2; public class C2 { }");
+        Path modules = base.resolve("modules");
+        tb.createDirectories(modules);
+
+        new JavacTask(tb)
+                .options("--module-source-path", src.toString())
+                .outdir(modules)
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll();
+
+        // now test access to the modules
+        Path src2 = base.resolve("src2");
+        tb.writeJavaFiles(src2,
+                          "class Dummy { p1.C1 c1; p2.C2 c2; }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        JavaCompiler c = ToolProvider.getSystemJavaCompiler();
+        try (StandardJavaFileManager fm = c.getStandardFileManager(null, null, null)) {
+            fm.setLocationFromPaths(StandardLocation.MODULE_PATH, Arrays.asList(modules));
+            fm.setLocationFromPaths(StandardLocation.CLASS_OUTPUT, Arrays.asList(classes));
+            Iterable<? extends JavaFileObject> files = fm.getJavaFileObjects(findJavaFiles(src2));
+            CompilationTask t = c.getTask(null, fm, null, null, null, files);
+            t.addModules(Arrays.asList("m1x", "m2x"));
+            Assert.check(t.call());
+        }
+    }
 }
 
diff --git a/langtools/test/tools/javac/modules/AddReadsTest.java b/langtools/test/tools/javac/modules/AddReadsTest.java
index d03cda6..32d023e 100644
--- a/langtools/test/tools/javac/modules/AddReadsTest.java
+++ b/langtools/test/tools/javac/modules/AddReadsTest.java
@@ -217,7 +217,7 @@
         new JavacTask(tb)
           .options("--class-path", jar.toString(),
                    "--add-reads", "java.base=ALL-UNNAMED",
-                   "-Xmodule:java.base")
+                   "--patch-module", "java.base=" + src)
           .outdir(classes)
           .files(src.resolve("impl").resolve("Impl.java"))
           .run()
@@ -237,7 +237,7 @@
         new JavacTask(tb)
           .options("--add-modules", "java.desktop",
                    "--add-reads", "java.base=java.desktop",
-                   "-Xmodule:java.base")
+                   "--patch-module", "java.base=" + src)
           .outdir(classes)
           .files(findJavaFiles(src))
           .run()
@@ -304,7 +304,7 @@
 
         new JavacTask(tb)
           .options("--add-reads", "m1x=ALL-UNNAMED",
-                   "-Xmodule:m1x",
+                   "--patch-module", "m1x=" + unnamedSrc,
                    "--module-path", classes.toString())
           .outdir(unnamedClasses)
           .files(findJavaFiles(unnamedSrc))
diff --git a/langtools/test/tools/javac/modules/AllDefaultTest.java b/langtools/test/tools/javac/modules/AllDefaultTest.java
index f78b0f1..77241cc 100644
--- a/langtools/test/tools/javac/modules/AllDefaultTest.java
+++ b/langtools/test/tools/javac/modules/AllDefaultTest.java
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 0000000
+ * @bug 8164590 8170691
  * @summary Test use of ALL-DEFAULT token
  * @library /tools/lib
  * @modules
diff --git a/langtools/test/tools/javac/modules/AnnotationProcessing.java b/langtools/test/tools/javac/modules/AnnotationProcessing.java
index 80a3eb8..600d3ad 100644
--- a/langtools/test/tools/javac/modules/AnnotationProcessing.java
+++ b/langtools/test/tools/javac/modules/AnnotationProcessing.java
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8133884 8162711 8133896 8172158 8172262 8173636
+ * @bug 8133884 8162711 8133896 8172158 8172262 8173636 8175119
  * @summary Verify that annotation processing works.
  * @library /tools/lib
  * @modules
@@ -37,10 +37,12 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.Reader;
+import java.io.UncheckedIOException;
 import java.io.Writer;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -49,6 +51,7 @@
 import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.Callable;
+import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -527,53 +530,173 @@
 
         tb.writeJavaFiles(m1,
                           "module m1x { exports api1; }",
-                          "package api1; public class Api { GenApi ga; impl.Impl i; }");
+                          "package api1; public class Api { }",
+                          "package clash; public class C { }");
 
         writeFile("1", m1, "api1", "api");
-        writeFile("1", m1, "impl", "impl");
+        writeFile("2", m1, "clash", "clash");
 
         Path m2 = moduleSrc.resolve("m2x");
 
         tb.writeJavaFiles(m2,
                           "module m2x { requires m1x; exports api2; }",
-                          "package api2; public class Api { api1.GenApi ga1; GenApi qa2; impl.Impl i;}");
+                          "package api2; public class Api { }",
+                          "package clash; public class C { }");
 
-        writeFile("2", m2, "api2", "api");
-        writeFile("2", m2, "impl", "impl");
+        writeFile("3", m2, "api2", "api");
+        writeFile("4", m2, "clash", "api");
 
-        for (FileType fileType : FileType.values()) {
-            if (Files.isDirectory(classes)) {
-                tb.cleanDirectory(classes);
-            } else {
-                Files.createDirectories(classes);
+        //passing testcases:
+        for (String module : Arrays.asList("", "m1x/")) {
+            for (String originating : Arrays.asList("", ", jlObject")) {
+                tb.writeJavaFiles(m1,
+                                  "package test; class Test { api1.Impl i; }");
+
+                //source:
+                runCompiler(base,
+                            moduleSrc,
+                            classes,
+                            "createSource(() -> filer.createSourceFile(\"" + module + "api1.Impl\"" + originating + "), \"api1.Impl\", \"package api1; public class Impl {}\")",
+                            "--module-source-path", moduleSrc.toString());
+                assertFileExists(classes, "m1x", "api1", "Impl.class");
+
+                //class:
+                runCompiler(base,
+                            moduleSrc,
+                            classes,
+                            "createClass(() -> filer.createClassFile(\"" + module + "api1.Impl\"" + originating + "), \"api1.Impl\", \"package api1; public class Impl {}\")",
+                            "--module-source-path", moduleSrc.toString());
+                assertFileExists(classes, "m1x", "api1", "Impl.class");
+
+                Files.delete(m1.resolve("test").resolve("Test.java"));
+
+                //resource class output:
+                runCompiler(base,
+                            moduleSrc,
+                            classes,
+                            "createSource(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, \"" + module + "api1\", \"impl\"" + originating + "), \"impl\", \"impl\")",
+                            "--module-source-path", moduleSrc.toString());
+                assertFileExists(classes, "m1x", "api1", "impl");
             }
-
-            new JavacTask(tb)
-              .options("-processor", MultiModeAPITestAP.class.getName(),
-                       "--module-source-path", moduleSrc.toString(),
-                       "-Afiletype=" + fileType.name())
-              .outdir(classes)
-              .files(findJavaFiles(moduleSrc))
-              .run()
-              .writeAll();
-
-            assertFileExists(classes, "m1x", "api1", "GenApi.class");
-            assertFileExists(classes, "m1x", "impl", "Impl.class");
-            assertFileExists(classes, "m1x", "api1", "gen1");
-            assertFileExists(classes, "m2x", "api2", "GenApi.class");
-            assertFileExists(classes, "m2x", "impl", "Impl.class");
-            assertFileExists(classes, "m2x", "api2", "gen1");
         }
-    }
 
-    enum FileType {
-        SOURCE,
-        CLASS;
+        //get resource module source path:
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "doReadResource(() -> filer.getResource(StandardLocation.MODULE_SOURCE_PATH, \"m1x/api1\", \"api\"), \"1\")",
+                    "--module-source-path", moduleSrc.toString());
+
+        //can generate resources to the single root module:
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "createSource(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, \"m1x/impl\", \"impl\"), \"impl\", \"impl\")",
+                    "--module-source-path", moduleSrc.toString());
+        assertFileExists(classes, "m1x", "impl", "impl");
+
+        //check --default-module-for-created-files option:
+        for (String pack : Arrays.asList("clash", "doesnotexist")) {
+            tb.writeJavaFiles(m1,
+                              "package test; class Test { " + pack + ".Pass i; }");
+            runCompiler(base,
+                        moduleSrc,
+                        classes,
+                        "createSource(() -> filer.createSourceFile(\"" + pack + ".Pass\")," +
+                        "                                          \"" + pack + ".Pass\"," +
+                        "                                          \"package " + pack + ";" +
+                        "                                            public class Pass { }\")",
+                        "--module-source-path", moduleSrc.toString(),
+                        "--default-module-for-created-files=m1x");
+            assertFileExists(classes, "m1x", pack, "Pass.class");
+            assertFileNotExists(classes, "m2x", pack, "Pass.class");
+
+            runCompiler(base,
+                        moduleSrc,
+                        classes,
+                        "createClass(() -> filer.createClassFile(\"" + pack + ".Pass\")," +
+                        "                                        \"" + pack + ".Pass\"," +
+                        "                                        \"package " + pack + ";" +
+                        "                                          public class Pass { }\")",
+                        "--module-source-path", moduleSrc.toString(),
+                        "--default-module-for-created-files=m1x");
+            assertFileExists(classes, "m1x", pack, "Pass.class");
+            assertFileNotExists(classes, "m2x", pack, "Pass.class");
+
+            Files.delete(m1.resolve("test").resolve("Test.java"));
+
+            runCompiler(base,
+                        moduleSrc,
+                        classes,
+                        "createSource(() -> filer.createResource(StandardLocation.CLASS_OUTPUT," +
+                        "                                        \"" + pack + "\", \"impl\"), \"impl\", \"impl\")",
+                        "--module-source-path", moduleSrc.toString(),
+                        "--default-module-for-created-files=m1x");
+            assertFileExists(classes, "m1x", pack, "impl");
+            assertFileNotExists(classes, "m2x", pack, "impl");
+
+            runCompiler(base,
+                        moduleSrc,
+                        classes,
+                        "doReadResource(() -> filer.getResource(StandardLocation.CLASS_OUTPUT," +
+                        "                                       \"" + pack + "\", \"resource\"), \"1\")",
+                        p -> writeFile("1", p.resolve("m1x"), pack, "resource"),
+                        "--module-source-path", moduleSrc.toString(),
+                        "--default-module-for-created-files=m1x");
+        }
+
+        //wrong default module:
+        runCompiler(base,
+                    moduleSrc,
+                    classes,
+                    "expectFilerException(() -> filer.createResource(StandardLocation.CLASS_OUTPUT," +
+                    "                                                \"clash\", \"impl\"))",
+                    "--module-source-path", moduleSrc.toString(),
+                    "--default-module-for-created-files=doesnotexist");
+
+        String[] failingCases = {
+            //must not generate to unnamed package:
+            "expectFilerException(() -> filer.createSourceFile(\"Fail\"))",
+            "expectFilerException(() -> filer.createClassFile(\"Fail\"))",
+            "expectFilerException(() -> filer.createSourceFile(\"m1x/Fail\"))",
+            "expectFilerException(() -> filer.createClassFile(\"m1x/Fail\"))",
+
+            //cannot infer module name, package clash:
+            "expectFilerException(() -> filer.createSourceFile(\"clash.Fail\"))",
+            "expectFilerException(() -> filer.createClassFile(\"clash.Fail\"))",
+            "expectFilerException(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, \"clash\", \"impl\"))",
+            "expectFilerException(() -> filer.getResource(StandardLocation.CLASS_OUTPUT, \"clash\", \"impl\"))",
+
+            //cannot infer module name, package does not exist:
+            "expectFilerException(() -> filer.createSourceFile(\"doesnotexist.Fail\"))",
+            "expectFilerException(() -> filer.createClassFile(\"doesnotexist.Fail\"))",
+            "expectFilerException(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, \"doesnotexist\", \"impl\"))",
+            "expectFilerException(() -> filer.getResource(StandardLocation.CLASS_OUTPUT, \"doesnotexist\", \"impl\"))",
+
+            //cannot generate sources/classes to modules that are not root modules:
+            "expectFilerException(() -> filer.createSourceFile(\"java.base/fail.Fail\"))",
+            "expectFilerException(() -> filer.createClassFile(\"java.base/fail.Fail\"))",
+
+            //cannot read from module locations if module not given and not inferable:
+            "expectFilerException(() -> filer.getResource(StandardLocation.SYSTEM_MODULES, \"fail\", \"Fail\"))",
+
+            //wrong module given:
+            "expectException(() -> filer.getResource(StandardLocation.SYSTEM_MODULES, \"java.compiler/java.lang\", \"Object.class\"))",
+        };
+
+        for (String failingCode : failingCases) {
+            System.err.println("failing code: " + failingCode);
+            runCompiler(base,
+                        moduleSrc,
+                        classes,
+                        failingCode,
+                        "--module-source-path", moduleSrc.toString());
+        }
     }
 
     public static abstract class GeneratingAP extends AbstractProcessor {
 
-        void createSource(CreateFileObject file, String name, String content) {
+        public void createSource(CreateFileObject file, String name, String content) {
             try (Writer out = file.create().openWriter()) {
                 out.write(content);
             } catch (IOException ex) {
@@ -581,7 +704,7 @@
             }
         }
 
-        void createClass(CreateFileObject file, String name, String content) {
+        public void createClass(CreateFileObject file, String name, String content) {
             String fileNameStub = name.replace(".", File.separator);
 
             try (OutputStream out = file.create().openOutputStream()) {
@@ -617,7 +740,7 @@
             }
         }
 
-        void doReadResource(CreateFileObject file, String expectedContent) {
+        public void doReadResource(CreateFileObject file, String expectedContent) {
             try {
                 StringBuilder actualContent = new StringBuilder();
 
@@ -636,11 +759,19 @@
             }
         }
 
+        public void checkResourceExists(CreateFileObject file) {
+            try {
+                file.create().openInputStream().close();
+            } catch (IOException ex) {
+                throw new IllegalStateException(ex);
+            }
+        }
+
         public interface CreateFileObject {
             public FileObject create() throws IOException;
         }
 
-        void expectFilerException(Callable<Object> c) {
+        public void expectFilerException(Callable<Object> c) {
             try {
                 c.call();
                 throw new AssertionError("Expected exception not thrown");
@@ -651,6 +782,17 @@
             }
         }
 
+        public void expectException(Callable<Object> c) {
+            try {
+                c.call();
+                throw new AssertionError("Expected exception not thrown");
+            } catch (IOException ex) {
+                //expected
+            } catch (Exception ex) {
+                throw new IllegalStateException(ex);
+            }
+        }
+
         @Override
         public SourceVersion getSupportedSourceVersion() {
             return SourceVersion.latest();
@@ -658,167 +800,220 @@
 
     }
 
-    @SupportedAnnotationTypes("*")
-    @SupportedOptions({"filetype", "modulename"})
-    public static final class MultiModeAPITestAP extends GeneratingAP {
-
-        int round;
-
-        @Override
-        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-            if (round++ != 0)
-                return false;
-
-            createClass("m1x", "api1.GenApi", "package api1; public class GenApi {}");
-            createClass("m1x", "impl.Impl", "package impl; public class Impl {}");
-            createClass("m2x", "api2.GenApi", "package api2; public class GenApi {}");
-            createClass("m2x", "impl.Impl", "package impl; public class Impl {}");
-
-            createResource("m1x", "api1", "gen1");
-            createResource("m2x", "api2", "gen1");
-
-            readResource("m1x", "api1", "api", "1");
-            readResource("m1x", "impl", "impl", "1");
-            readResource("m2x", "api2", "api", "2");
-            readResource("m2x", "impl", "impl", "2");
-
-            Filer filer = processingEnv.getFiler();
-
-            expectFilerException(() -> filer.createSourceFile("fail.Fail"));
-            expectFilerException(() -> filer.createClassFile("fail.Fail"));
-            expectFilerException(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, "fail", "fail"));
-            expectFilerException(() -> filer.getResource(StandardLocation.MODULE_SOURCE_PATH, "fail", "fail"));
-
-            //must not generate to unnamed package:
-            expectFilerException(() -> filer.createSourceFile("m1/Fail"));
-            expectFilerException(() -> filer.createClassFile("m1/Fail"));
-
-            //cannot generate resources to modules that are not root modules:
-            expectFilerException(() -> filer.createSourceFile("java.base/fail.Fail"));
-            expectFilerException(() -> filer.createClassFile("java.base/fail.Fail"));
-            expectFilerException(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, "java.base/fail", "Fail"));
-
-            return false;
-        }
-
-        void createClass(String expectedModule, String name, String content) {
-            Filer filer = processingEnv.getFiler();
-            FileType filetype = FileType.valueOf(processingEnv.getOptions().getOrDefault("filetype", ""));
-
-            switch (filetype) {
-                case SOURCE:
-                    createSource(() -> filer.createSourceFile(expectedModule + "/" + name), name, content);
-                    break;
-                case CLASS:
-                    createClass(() -> filer.createClassFile(expectedModule + "/" + name), name, content);
-                    break;
-                default:
-                    throw new AssertionError("Unexpected filetype: " + filetype);
-            }
-        }
-
-        void createResource(String expectedModule, String pkg, String relName) {
-            try {
-                Filer filer = processingEnv.getFiler();
-
-                filer.createResource(StandardLocation.CLASS_OUTPUT, expectedModule + "/" + pkg, relName)
-                     .openOutputStream()
-                     .close();
-            } catch (IOException ex) {
-                throw new IllegalStateException(ex);
-            }
-        }
-
-        void readResource(String expectedModule, String pkg, String relName, String expectedContent) {
-            Filer filer = processingEnv.getFiler();
-
-            doReadResource(() -> filer.getResource(StandardLocation.MODULE_SOURCE_PATH, expectedModule + "/" + pkg, relName),
-                           expectedContent);
-        }
-
-    }
-
     @Test
-    public void testGenerateInSingleNameModeAPI(Path base) throws Exception {
+    public void testGenerateSingleModule(Path base) throws Exception {
         Path classes = base.resolve("classes");
 
         Files.createDirectories(classes);
 
-        Path m1 = base.resolve("module-src");
+        Path src = base.resolve("module-src");
+        Path m1 = src.resolve("m1x");
 
         tb.writeJavaFiles(m1,
-                          "module m1x { }");
+                          "module m1x { }",
+                          "package test; class Test { impl.Impl i; }");
+        Path m2 = src.resolve("m2x");
 
-        writeFile("3", m1, "impl", "resource");
+        tb.writeJavaFiles(m2,
+                          "module m2x { }");
 
-        new JavacTask(tb)
-          .options("-processor", SingleNameModeAPITestAP.class.getName(),
-                   "-sourcepath", m1.toString())
-          .outdir(classes)
-          .files(findJavaFiles(m1))
-          .run()
-          .writeAll();
+        for (String[] options : new String[][] {new String[] {"-sourcepath", m1.toString()},
+                                                new String[] {"--module-source-path", src.toString()}}) {
+            String modulePath = options[0].equals("--module-source-path") ? "m1x" : "";
+            //passing testcases:
+            for (String module : Arrays.asList("", "m1x/")) {
+                for (String originating : Arrays.asList("", ", jlObject")) {
+                    tb.writeJavaFiles(m1,
+                                      "package test; class Test { impl.Impl i; }");
 
-        assertFileExists(classes, "impl", "Impl1.class");
-        assertFileExists(classes, "impl", "Impl2.class");
-        assertFileExists(classes, "impl", "Impl3");
-        assertFileExists(classes, "impl", "Impl4.class");
-        assertFileExists(classes, "impl", "Impl5.class");
-        assertFileExists(classes, "impl", "Impl6");
-        assertFileExists(classes, "impl", "Impl7.class");
-        assertFileExists(classes, "impl", "Impl8.class");
-        assertFileExists(classes, "impl", "Impl9");
+                    //source:
+                    runCompiler(base,
+                                m1,
+                                classes,
+                                "createSource(() -> filer.createSourceFile(\"" + module + "impl.Impl\"" + originating + "), \"impl.Impl\", \"package impl; public class Impl {}\")",
+                                options);
+                    assertFileExists(classes, modulePath, "impl", "Impl.class");
+
+                    //class:
+                    runCompiler(base,
+                                m1,
+                                classes,
+                                "createClass(() -> filer.createClassFile(\"" + module + "impl.Impl\"" + originating + "), \"impl.Impl\", \"package impl; public class Impl {}\")",
+                                options);
+                    assertFileExists(classes, modulePath, "impl", "Impl.class");
+
+                    Files.delete(m1.resolve("test").resolve("Test.java"));
+
+                    //resource class output:
+                    runCompiler(base,
+                                m1,
+                                classes,
+                                "createSource(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, \"impl\", \"impl\"" + originating + "), \"impl\", \"impl\")",
+                                options);
+                    assertFileExists(classes, modulePath, "impl", "impl");
+                }
+            }
+        }
+
+        //get resource source path:
+        writeFile("1", m1, "impl", "resource");
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "doReadResource(() -> filer.getResource(StandardLocation.SOURCE_PATH, \"impl\", \"resource\"), \"1\")",
+                    "-sourcepath", m1.toString());
+        //must not specify module when reading non-module oriented locations:
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "expectFilerException(() -> filer.getResource(StandardLocation.SOURCE_PATH, \"m1x/impl\", \"resource\"))",
+                    "-sourcepath", m1.toString());
+
+        Files.delete(m1.resolve("impl").resolve("resource"));
+
+        //can read resources from the system module path if module name given:
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "checkResourceExists(() -> filer.getResource(StandardLocation.SYSTEM_MODULES, \"java.base/java.lang\", \"Object.class\"))",
+                    "-sourcepath", m1.toString());
+
+        //can read resources from the system module path if module inferable:
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "expectFilerException(() -> filer.getResource(StandardLocation.SYSTEM_MODULES, \"java.lang\", \"Object.class\"))",
+                    "-sourcepath", m1.toString());
+
+        //cannot generate resources to modules that are not root modules:
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "expectFilerException(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, \"java.base/fail\", \"Fail\"))",
+                    "--module-source-path", src.toString());
+
+        //can generate resources to the single root module:
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "createSource(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, \"impl\", \"impl\"), \"impl\", \"impl\")",
+                    "--module-source-path", src.toString());
+        assertFileExists(classes, "m1x", "impl", "impl");
+
+        String[] failingCases = {
+            //must not generate to unnamed package:
+            "expectFilerException(() -> filer.createSourceFile(\"Fail\"))",
+            "expectFilerException(() -> filer.createClassFile(\"Fail\"))",
+            "expectFilerException(() -> filer.createSourceFile(\"m1x/Fail\"))",
+            "expectFilerException(() -> filer.createClassFile(\"m1x/Fail\"))",
+
+            //cannot generate sources/classes to modules that are not root modules:
+            "expectFilerException(() -> filer.createSourceFile(\"java.base/fail.Fail\"))",
+            "expectFilerException(() -> filer.createClassFile(\"java.base/fail.Fail\"))",
+
+            //cannot specify module name for class output when not in the multi-module mode:
+            "expectFilerException(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, \"m1x/fail\", \"Fail\"))",
+
+            //cannot read from module locations if module not given:
+            "expectFilerException(() -> filer.getResource(StandardLocation.SYSTEM_MODULES, \"fail\", \"Fail\"))",
+
+            //wrong module given:
+            "expectException(() -> filer.getResource(StandardLocation.SYSTEM_MODULES, \"java.compiler/java.lang\", \"Object.class\"))",
+        };
+
+        for (String failingCode : failingCases) {
+            System.err.println("failing code: " + failingCode);
+            runCompiler(base,
+                        m1,
+                        classes,
+                        failingCode,
+                        "-sourcepath", m1.toString());
+        }
+
+        Files.delete(m1.resolve("module-info.java"));
+        tb.writeJavaFiles(m1,
+                          "package test; class Test { }");
+
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "expectFilerException(() -> filer.createSourceFile(\"m1x/impl.Impl\"))",
+                    "-sourcepath", m1.toString(),
+                    "-source", "8");
+
+        runCompiler(base,
+                    m1,
+                    classes,
+                    "expectFilerException(() -> filer.createClassFile(\"m1x/impl.Impl\"))",
+                    "-sourcepath", m1.toString(),
+                    "-source", "8");
     }
 
+    private void runCompiler(Path base, Path src, Path classes,
+                             String code, String... options) throws IOException {
+        runCompiler(base, src, classes, code, p -> {}, options);
+    }
 
-    @SupportedAnnotationTypes("*")
-    public static final class SingleNameModeAPITestAP extends GeneratingAP {
-
-        int round;
-
-        @Override
-        public synchronized void init(ProcessingEnvironment processingEnv) {
-            super.init(processingEnv);
+    private void runCompiler(Path base, Path src, Path classes,
+                             String code, Consumer<Path> generateToClasses,
+                             String... options) throws IOException {
+        Path apClasses = base.resolve("ap-classes");
+        if (Files.exists(apClasses)) {
+            tb.cleanDirectory(apClasses);
+        } else {
+            Files.createDirectories(apClasses);
         }
-
-        @Override
-        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-            if (round++ != 0)
-                return false;
-
-            Filer filer = processingEnv.getFiler();
-
-            createSource(() -> filer.createSourceFile("impl.Impl1"), "impl.Impl1", "package impl; class Impl1 {}");
-            createClass(() -> filer.createClassFile("impl.Impl2"), "impl.Impl2", "package impl; class Impl2 {}");
-            createSource(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, "impl", "Impl3"), "impl.Impl3", "");
-            doReadResource(() -> filer.getResource(StandardLocation.SOURCE_PATH, "impl", "resource"), "3");
-
-            createSource(() -> filer.createSourceFile("m1x/impl.Impl4"), "impl.Impl4", "package impl; class Impl4 {}");
-            createClass(() -> filer.createClassFile("m1x/impl.Impl5"), "impl.Impl5", "package impl; class Impl5 {}");
-            createSource(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, "m1x/impl", "Impl6"), "impl.Impl6", "");
-            doReadResource(() -> filer.getResource(StandardLocation.SOURCE_PATH, "m1x/impl", "resource"), "3");
-
-            TypeElement jlObject = processingEnv.getElementUtils().getTypeElement("java.lang.Object");
-
-            //"broken" originating element:
-            createSource(() -> filer.createSourceFile("impl.Impl7", jlObject), "impl.Impl7", "package impl; class Impl7 {}");
-            createClass(() -> filer.createClassFile("impl.Impl8", jlObject), "impl.Impl8", "package impl; class Impl8 {}");
-            createSource(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, "impl", "Impl9", jlObject), "impl.Impl9", "");
-
-            //must not generate to unnamed package:
-            expectFilerException(() -> filer.createSourceFile("Fail"));
-            expectFilerException(() -> filer.createClassFile("Fail"));
-            expectFilerException(() -> filer.createSourceFile("m1x/Fail"));
-            expectFilerException(() -> filer.createClassFile("m1x/Fail"));
-
-            //cannot generate resources to modules that are not root modules:
-            expectFilerException(() -> filer.createSourceFile("java.base/fail.Fail"));
-            expectFilerException(() -> filer.createClassFile("java.base/fail.Fail"));
-            expectFilerException(() -> filer.createResource(StandardLocation.CLASS_OUTPUT, "java.base/fail", "Fail"));
-
-            return false;
+        compileAP(apClasses, code);
+        if (Files.exists(classes)) {
+            tb.cleanDirectory(classes);
+        } else {
+            Files.createDirectories(classes);
         }
+        generateToClasses.accept(classes);
+        List<String> opts = new ArrayList<>();
+        opts.addAll(Arrays.asList(options));
+        opts.add("-processorpath");
+        opts.add(System.getProperty("test.class.path") + File.pathSeparator + apClasses.toString());
+        opts.add("-processor");
+        opts.add("AP");
+        new JavacTask(tb)
+          .options(opts)
+          .outdir(classes)
+          .files(findJavaFiles(src))
+          .run()
+          .writeAll();
+    }
 
+    private void compileAP(Path target, String code) {
+        String processorCode =
+            "import java.util.*;\n" +
+            "import javax.annotation.processing.*;\n" +
+            "import javax.lang.model.*;\n" +
+            "import javax.lang.model.element.*;\n" +
+            "import javax.lang.model.type.*;\n" +
+            "import javax.lang.model.util.*;\n" +
+            "import javax.tools.*;\n" +
+            "@SupportedAnnotationTypes(\"*\")\n" +
+            "public final class AP extends AnnotationProcessing.GeneratingAP {\n" +
+            "\n" +
+            "        int round;\n" +
+            "\n" +
+            "        @Override\n" +
+            "        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {\n" +
+            "            if (round++ != 0)\n" +
+            "                return false;\n" +
+            "            Filer filer = processingEnv.getFiler();\n" +
+            "            TypeElement jlObject = processingEnv.getElementUtils().getTypeElement(\"java.lang.Object\");\n" +
+            code + ";\n" +
+            "            return false;\n" +
+            "        }\n" +
+            "    }\n";
+        new JavacTask(tb)
+          .options("-classpath", System.getProperty("test.class.path"))
+          .sources(processorCode)
+          .outdir(target)
+          .run()
+          .writeAll();
     }
 
     @Test
@@ -1089,13 +1284,17 @@
 
     }
 
-    private static void writeFile(String content, Path base, String... pathElements) throws IOException {
-        Path file = resolveFile(base, pathElements);
+    private static void writeFile(String content, Path base, String... pathElements) {
+        try {
+            Path file = resolveFile(base, pathElements);
 
-        Files.createDirectories(file.getParent());
+            Files.createDirectories(file.getParent());
 
-        try (Writer out = Files.newBufferedWriter(file)) {
-            out.append(content);
+            try (Writer out = Files.newBufferedWriter(file)) {
+                out.append(content);
+            }
+        } catch (IOException ex) {
+            throw new UncheckedIOException(ex);
         }
     }
 
@@ -1286,6 +1485,35 @@
 
     }
 
+    @Test
+    public void testWrongDefaultTargetModule(Path base) throws Exception {
+        Path src = base.resolve("src");
+
+        tb.writeJavaFiles(src,
+                          "package test; public class Test { }");
+
+        Path classes = base.resolve("classes");
+
+        Files.createDirectories(classes);
+
+        List<String> log = new JavacTask(tb)
+            .options("--default-module-for-created-files=m!",
+                     "-XDrawDiagnostics")
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run(Task.Expect.FAIL)
+            .writeAll()
+            .getOutputLines(OutputKind.DIRECT);
+
+        List<String> expected = Arrays.asList(
+            "- compiler.err.bad.name.for.option: --default-module-for-created-files, m!"
+        );
+
+        if (!log.equals(expected)) {
+            throw new AssertionError("Expected output not found.");
+        }
+    }
+
     private static void assertNonNull(String msg, Object val) {
         if (val == null) {
             throw new AssertionError(msg);
@@ -1312,6 +1540,14 @@
         }
     }
 
+    private static void assertFileNotExists(Path base, String... pathElements) {
+        Path file = resolveFile(base, pathElements);
+
+        if (Files.exists(file)) {
+            throw new AssertionError("Expected file: " + file + " exist, but it does not.");
+        }
+    }
+
     static Path resolveFile(Path base, String... pathElements) {
         Path file = base;
 
diff --git a/langtools/test/tools/javac/modules/AutomaticModules.java b/langtools/test/tools/javac/modules/AutomaticModules.java
index fa7524d..75b0373 100644
--- a/langtools/test/tools/javac/modules/AutomaticModules.java
+++ b/langtools/test/tools/javac/modules/AutomaticModules.java
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8155026
+ * @bug 8155026 8178011
  * @summary Test automatic modules
  * @library /tools/lib
  * @modules
@@ -300,9 +300,8 @@
                 .writeAll()
                 .getOutputLines(Task.OutputKind.DIRECT);
 
-        expected = Arrays.asList("Impl.java:1:47: compiler.err.package.not.visible: apiB, (compiler.misc.not.def.access.does.not.read: m1x, apiB, automaticB)",
-                                 "Impl.java:1:59: compiler.err.package.not.visible: m2x, (compiler.misc.not.def.access.does.not.read: m1x, m2x, m2x)",
-                                 "2 errors");
+        expected = Arrays.asList("Impl.java:1:59: compiler.err.package.not.visible: m2x, (compiler.misc.not.def.access.does.not.read: m1x, m2x, m2x)",
+                                 "1 error");
 
         if (!expected.equals(log)) {
             throw new Exception("expected output not found: " + log);
@@ -310,7 +309,7 @@
     }
 
     @Test
-    public void testDropTrailingVersion(Path base) throws Exception {
+    public void testWithTrailingVersion(Path base) throws Exception {
         Path legacySrc = base.resolve("legacy-src");
         tb.writeJavaFiles(legacySrc,
                           "package api; public class Api {}");
@@ -348,7 +347,7 @@
         Files.createDirectories(classes);
 
         tb.writeJavaFiles(m,
-                          "module m { requires test; }",
+                          "module m { requires test1; }",
                           "package impl; public class Impl { public void e(api.Api api) { } }");
 
         new JavacTask(tb)
@@ -358,4 +357,261 @@
                 .run()
                 .writeAll();
     }
+
+    @Test
+    public void testMultipleAutomatic(Path base) throws Exception {
+        Path modulePath = base.resolve("module-path");
+
+        Files.createDirectories(modulePath);
+
+        for (char c : new char[] {'A', 'B'}) {
+            Path automaticSrc = base.resolve("automaticSrc" + c);
+            tb.writeJavaFiles(automaticSrc, "package api" + c + "; public class Api {}");
+            Path automaticClasses = base.resolve("automaticClasses" + c);
+            tb.createDirectories(automaticClasses);
+
+            String automaticLog = new JavacTask(tb)
+                                    .outdir(automaticClasses)
+                                    .files(findJavaFiles(automaticSrc))
+                                    .run()
+                                    .writeAll()
+                                    .getOutput(Task.OutputKind.DIRECT);
+
+            if (!automaticLog.isEmpty())
+                throw new Exception("expected output not found: " + automaticLog);
+
+            Path automaticJar = modulePath.resolve("automatic" + c + "-1.0.jar");
+
+            new JarTask(tb, automaticJar)
+              .baseDir(automaticClasses)
+              .files("api" + c + "/Api.class")
+              .run();
+        }
+
+        Path src = base.resolve("src");
+
+        tb.writeJavaFiles(src.resolve("m1x"),
+                          "package impl; public class Impl { apiA.Api a; apiB.Api b; }");
+
+        Path classes = base.resolve("classes");
+
+        Files.createDirectories(classes);
+
+        List<String> log = new JavacTask(tb)
+                .options("--module-path", modulePath.toString(),
+                         "-XDrawDiagnostics")
+                .outdir(classes)
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        List<String> expected = Arrays.asList("Impl.java:1:35: compiler.err.package.not.visible: apiA, (compiler.misc.not.def.access.does.not.read.from.unnamed: apiA, automaticA)",
+                                              "Impl.java:1:47: compiler.err.package.not.visible: apiB, (compiler.misc.not.def.access.does.not.read.from.unnamed: apiB, automaticB)",
+                                              "2 errors");
+
+        if (!expected.equals(log)) {
+            throw new Exception("expected output not found: " + log);
+        }
+
+        new JavacTask(tb)
+                .options("--module-path", modulePath.toString(),
+                         "--add-modules", "automaticA",
+                         "-XDrawDiagnostics")
+                .outdir(classes)
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll();
+    }
+
+    @Test
+    public void testLintRequireAutomatic(Path base) throws Exception {
+        Path modulePath = base.resolve("module-path");
+
+        Files.createDirectories(modulePath);
+
+        for (char c : new char[] {'A', 'B'}) {
+            Path automaticSrc = base.resolve("automaticSrc" + c);
+            tb.writeJavaFiles(automaticSrc, "package api" + c + "; public class Api {}");
+            Path automaticClasses = base.resolve("automaticClasses" + c);
+            tb.createDirectories(automaticClasses);
+
+            String automaticLog = new JavacTask(tb)
+                                    .outdir(automaticClasses)
+                                    .files(findJavaFiles(automaticSrc))
+                                    .run()
+                                    .writeAll()
+                                    .getOutput(Task.OutputKind.DIRECT);
+
+            if (!automaticLog.isEmpty())
+                throw new Exception("expected output not found: " + automaticLog);
+
+            Path automaticJar = modulePath.resolve("automatic" + c + "-1.0.jar");
+
+            new JarTask(tb, automaticJar)
+              .baseDir(automaticClasses)
+              .files("api" + c + "/Api.class")
+              .run();
+        }
+
+        Path src = base.resolve("src");
+
+        tb.writeJavaFiles(src,
+                          "module m1x {\n" +
+                          "    requires transitive automaticA;\n" +
+                          "    requires automaticB;\n" +
+                          "}");
+
+        Path classes = base.resolve("classes");
+
+        Files.createDirectories(classes);
+
+        List<String> expected;
+        List<String> log;
+
+        log = new JavacTask(tb)
+            .options("--source-path", src.toString(),
+                     "--module-path", modulePath.toString(),
+                     "-XDrawDiagnostics",
+                     "-Werror")
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run(Task.Expect.FAIL)
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT);
+
+        expected = Arrays.asList("module-info.java:2:25: compiler.warn.requires.transitive.automatic",
+                                 "- compiler.err.warnings.and.werror",
+                                 "1 error",
+                                 "1 warning");
+
+        if (!expected.equals(log)) {
+            throw new Exception("expected output not found: " + log);
+        }
+
+        log = new JavacTask(tb)
+            .options("--source-path", src.toString(),
+                     "--module-path", modulePath.toString(),
+                     "-Xlint:requires-automatic",
+                     "-XDrawDiagnostics",
+                     "-Werror")
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run(Task.Expect.FAIL)
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT);
+
+        expected = Arrays.asList("module-info.java:2:25: compiler.warn.requires.transitive.automatic",
+                                 "module-info.java:3:14: compiler.warn.requires.automatic",
+                                 "- compiler.err.warnings.and.werror",
+                                 "1 error",
+                                 "2 warnings");
+
+        if (!expected.equals(log)) {
+            throw new Exception("expected output not found: " + log);
+        }
+
+        log = new JavacTask(tb)
+            .options("--source-path", src.toString(),
+                     "--module-path", modulePath.toString(),
+                     "-Xlint:-requires-transitive-automatic,requires-automatic",
+                     "-XDrawDiagnostics",
+                     "-Werror")
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run(Task.Expect.FAIL)
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT);
+
+        expected = Arrays.asList("module-info.java:2:25: compiler.warn.requires.automatic",
+                                 "module-info.java:3:14: compiler.warn.requires.automatic",
+                                 "- compiler.err.warnings.and.werror",
+                                 "1 error",
+                                 "2 warnings");
+
+        if (!expected.equals(log)) {
+            throw new Exception("expected output not found: " + log);
+        }
+
+        new JavacTask(tb)
+            .options("--source-path", src.toString(),
+                     "--module-path", modulePath.toString(),
+                     "-Xlint:-requires-transitive-automatic",
+                     "-XDrawDiagnostics",
+                     "-Werror")
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run(Task.Expect.SUCCESS)
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT);
+
+        tb.writeJavaFiles(src,
+                          "@SuppressWarnings(\"requires-transitive-automatic\")\n" +
+                          "module m1x {\n" +
+                          "    requires transitive automaticA;\n" +
+                          "    requires automaticB;\n" +
+                          "}");
+
+        new JavacTask(tb)
+            .options("--source-path", src.toString(),
+                     "--module-path", modulePath.toString(),
+                     "-XDrawDiagnostics",
+                     "-Werror")
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run(Task.Expect.SUCCESS)
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT);
+
+        log = new JavacTask(tb)
+            .options("--source-path", src.toString(),
+                     "--module-path", modulePath.toString(),
+                     "-Xlint:requires-automatic",
+                     "-XDrawDiagnostics",
+                     "-Werror")
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run(Task.Expect.FAIL)
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT);
+
+        expected = Arrays.asList("module-info.java:3:25: compiler.warn.requires.automatic",
+                                 "module-info.java:4:14: compiler.warn.requires.automatic",
+                                 "- compiler.err.warnings.and.werror",
+                                 "1 error",
+                                 "2 warnings");
+
+        if (!expected.equals(log)) {
+            throw new Exception("expected output not found: " + log);
+        }
+
+        tb.writeJavaFiles(src,
+                          "@SuppressWarnings(\"requires-automatic\")\n" +
+                          "module m1x {\n" +
+                          "    requires transitive automaticA;\n" +
+                          "    requires automaticB;\n" +
+                          "}");
+
+        log = new JavacTask(tb)
+            .options("--source-path", src.toString(),
+                     "--module-path", modulePath.toString(),
+                     "-Xlint:requires-automatic",
+                     "-XDrawDiagnostics",
+                     "-Werror")
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run(Task.Expect.FAIL)
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT);
+
+        expected = Arrays.asList("module-info.java:3:25: compiler.warn.requires.transitive.automatic",
+                                 "- compiler.err.warnings.and.werror",
+                                 "1 error",
+                                 "1 warning");
+
+        if (!expected.equals(log)) {
+            throw new Exception("expected output not found: " + log);
+        }
+    }
+
 }
diff --git a/langtools/test/tools/javac/modules/CompileModulePatchTest.java b/langtools/test/tools/javac/modules/CompileModulePatchTest.java
new file mode 100644
index 0000000..1ff40cd
--- /dev/null
+++ b/langtools/test/tools/javac/modules/CompileModulePatchTest.java
@@ -0,0 +1,590 @@
+/*
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173777
+ * @summary tests for multi-module mode compilation
+ * @library /tools/lib
+ * @modules
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.code
+ *      jdk.compiler/com.sun.tools.javac.main
+ *      jdk.compiler/com.sun.tools.javac.processing
+ * @build toolbox.ToolBox toolbox.JavacTask toolbox.ModuleBuilder ModuleTestBase
+ * @run main CompileModulePatchTest
+ */
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import javax.annotation.processing.AbstractProcessor;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.ModuleElement;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.util.Elements;
+
+import com.sun.tools.javac.code.Symtab;
+import com.sun.tools.javac.processing.JavacProcessingEnvironment;
+import toolbox.JavacTask;
+import toolbox.ModuleBuilder;
+import toolbox.Task;
+import toolbox.Task.Expect;
+
+public class CompileModulePatchTest extends ModuleTestBase {
+
+    public static void main(String... args) throws Exception {
+        new CompileModulePatchTest().runTests();
+    }
+
+    @Test
+    public void testCorrectModulePatch(Path base) throws Exception {
+        //note: avoiding use of java.base, as that gets special handling on some places:
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "package javax.lang.model.element; public interface Extra extends Element { }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        String log = new JavacTask(tb)
+                .options("--patch-module", "java.compiler=" + src.toString())
+                .outdir(classes)
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.isEmpty())
+            throw new Exception("expected output not found: " + log);
+    }
+
+    @Test
+    public void testCorrectModulePatchMultiModule(Path base) throws Exception {
+        //note: avoiding use of java.base, as that gets special handling on some places:
+        Path src = base.resolve("src");
+        Path m1 = src.resolve("m1");
+        tb.writeJavaFiles(m1, "package javax.lang.model.element; public interface Extra extends Element { }");
+        Path m2 = src.resolve("m2");
+        tb.writeJavaFiles(m2, "package com.sun.source.tree; public interface Extra extends Tree { }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        String log = new JavacTask(tb)
+                .options("--patch-module", "java.compiler=" + m1.toString(),
+                         "--patch-module", "jdk.compiler=" + m2.toString(),
+                         "--module-source-path", "dummy")
+                .outdir(classes)
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.isEmpty())
+            throw new Exception("expected output not found: " + log);
+
+        checkFileExists(classes, "java.compiler/javax/lang/model/element/Extra.class");
+        checkFileExists(classes, "jdk.compiler/com/sun/source/tree/Extra.class");
+    }
+
+    @Test
+    public void testCorrectModulePatchMultiModule2(Path base) throws Exception {
+        //note: avoiding use of java.base, as that gets special handling on some places:
+        Path src = base.resolve("src");
+        Path m1 = src.resolve("m1");
+        tb.writeJavaFiles(m1,
+                          "package javax.lang.model.element; public interface Extra extends Element { }");
+        Path m2 = src.resolve("m2");
+        tb.writeJavaFiles(m2,
+                          "package com.sun.source.tree; public interface Extra extends Tree { }");
+        Path msp = base.resolve("msp");
+        Path m3 = msp.resolve("m3x");
+        tb.writeJavaFiles(m3,
+                          "module m3x { }",
+                          "package m3; public class Test { }");
+        Path m4 = msp.resolve("m4x");
+        tb.writeJavaFiles(m4,
+                          "module m4x { }",
+                          "package m4; public class Test { }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        String log = new JavacTask(tb)
+                .options("--patch-module", "java.compiler=" + m1.toString(),
+                         "--patch-module", "jdk.compiler=" + m2.toString(),
+                         "--module-source-path", msp.toString())
+                .outdir(classes)
+                .files(findJavaFiles(src, msp))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.isEmpty())
+            throw new Exception("expected output not found: " + log);
+
+        checkFileExists(classes, "java.compiler/javax/lang/model/element/Extra.class");
+        checkFileExists(classes, "jdk.compiler/com/sun/source/tree/Extra.class");
+        checkFileExists(classes, "m3x/m3/Test.class");
+        checkFileExists(classes, "m4x/m4/Test.class");
+    }
+
+    @Test
+    public void testPatchModuleModuleSourcePathConflict(Path base) throws Exception {
+        //note: avoiding use of java.base, as that gets special handling on some places:
+        Path src = base.resolve("src");
+        Path m1 = src.resolve("m1x");
+        tb.writeJavaFiles(m1,
+                          "module m1x { }",
+                          "package m1; public class Test { }");
+        Path m2 = src.resolve("m2x");
+        tb.writeJavaFiles(m2,
+                          "module m2x { }",
+                          "package m2; public class Test { }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        List<String> log = new JavacTask(tb)
+                .options("--patch-module", "m1x=" + m2.toString(),
+                         "--module-source-path", src.toString(),
+                         "-XDrawDiagnostics")
+                .outdir(classes)
+                .files(findJavaFiles(src.resolve("m1x").resolve("m1"),
+                                     src.resolve("m2x").resolve("m2")))
+                .run(Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        List<String> expectedOut = Arrays.asList(
+                "Test.java:1:1: compiler.err.file.patched.and.msp: m1x, m2x",
+                "module-info.java:1:1: compiler.err.module.name.mismatch: m2x, m1x",
+                "- compiler.err.cant.access: m1x.module-info, (compiler.misc.cant.resolve.modules)",
+                "3 errors"
+        );
+
+        if (!expectedOut.equals(log))
+            throw new Exception("expected output not found: " + log);
+    }
+
+    @Test
+    public void testSourcePath(Path base) throws Exception {
+        //note: avoiding use of java.base, as that gets special handling on some places:
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "package javax.lang.model.element; public interface Extra extends Element, Other { }");
+        Path srcPath = base.resolve("src-path");
+        tb.writeJavaFiles(srcPath, "package javax.lang.model.element; interface Other { }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        List<String> log = new JavacTask(tb)
+                .options("--patch-module", "java.compiler=" + src.toString(),
+                         "-sourcepath", srcPath.toString(),
+                         "-XDrawDiagnostics")
+                .outdir(classes)
+                .files(src.resolve("javax/lang/model/element/Extra.java"))
+                .run(Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        List<String> expectedOut = Arrays.asList(
+                "Extra.java:1:75: compiler.err.cant.resolve: kindname.class, Other, , ",
+                "1 error"
+        );
+
+        if (!expectedOut.equals(log))
+            throw new Exception("expected output not found: " + log);
+    }
+
+    @Test
+    public void testClassPath(Path base) throws Exception {
+        Path cpSrc = base.resolve("cpSrc");
+        tb.writeJavaFiles(cpSrc, "package p; public interface Other { }");
+        Path cpClasses = base.resolve("cpClasses");
+        tb.createDirectories(cpClasses);
+
+        String cpLog = new JavacTask(tb)
+                .outdir(cpClasses)
+                .files(findJavaFiles(cpSrc))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!cpLog.isEmpty())
+            throw new Exception("expected output not found: " + cpLog);
+
+        Path src = base.resolve("src");
+        //note: avoiding use of java.base, as that gets special handling on some places:
+        tb.writeJavaFiles(src, "package javax.lang.model.element; public interface Extra extends Element, p.Other { }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        List<String> log = new JavacTask(tb)
+                .options("--patch-module", "java.compiler=" + src.toString(),
+                         "--class-path", cpClasses.toString(),
+                         "-XDrawDiagnostics")
+                .outdir(classes)
+                .files(src.resolve("javax/lang/model/element/Extra.java"))
+                .run(Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        List<String> expectedOut = Arrays.asList(
+                "Extra.java:1:76: compiler.err.doesnt.exist: p",
+                "1 error"
+        );
+
+        if (!expectedOut.equals(log))
+            throw new Exception("expected output not found: " + log);
+    }
+
+    @Test
+    public void testWithModulePath(Path base) throws Exception {
+        Path modSrc = base.resolve("modSrc");
+        Path modules = base.resolve("modules");
+        new ModuleBuilder(tb, "m1")
+                .classes("package pkg1; public interface E { }")
+                .build(modSrc, modules);
+
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "package p; interface A extends pkg1.E { }");
+
+        new JavacTask(tb, Task.Mode.CMDLINE)
+                .options("--module-path", modules.toString(),
+                        "--patch-module", "m1=" + src.toString())
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll();
+
+        //checks module bounds still exist
+        new ModuleBuilder(tb, "m2")
+                .classes("package pkg2; public interface D { }")
+                .build(modSrc, modules);
+
+        Path src2 = base.resolve("src2");
+        tb.writeJavaFiles(src2, "package p; interface A extends pkg2.D { }");
+
+        List<String> log = new JavacTask(tb, Task.Mode.CMDLINE)
+                .options("-XDrawDiagnostics",
+                        "--module-path", modules.toString(),
+                        "--patch-module", "m1=" + src2.toString())
+                .files(findJavaFiles(src2))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        List<String> expected = Arrays.asList("A.java:1:32: compiler.err.package.not.visible: pkg2, (compiler.misc.not.def.access.does.not.read: m1, pkg2, m2)",
+                "1 error");
+
+        if (!expected.equals(log))
+            throw new Exception("expected output not found: " + log);
+    }
+
+    @Test
+    public void testWithUpgradeModulePath(Path base) throws Exception {
+        Path modSrc = base.resolve("modSrc");
+        Path modules = base.resolve("modules");
+        new ModuleBuilder(tb, "m1")
+                .classes("package pkg1; public interface E { }")
+                .build(modSrc, modules);
+
+        Path upgrSrc = base.resolve("upgradeSrc");
+        Path upgrade = base.resolve("upgrade");
+        new ModuleBuilder(tb, "m1")
+                .classes("package pkg1; public interface D { }")
+                .build(upgrSrc, upgrade);
+
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "package p; interface A extends pkg1.D { }");
+
+        new JavacTask(tb, Task.Mode.CMDLINE)
+                .options("--module-path", modules.toString(),
+                        "--upgrade-module-path", upgrade.toString(),
+                        "--patch-module", "m1=" + src.toString())
+                .files(findJavaFiles(src))
+                .run()
+                .writeAll();
+    }
+
+    @Test
+    public void testUnnamedIsolation(Path base) throws Exception {
+        //note: avoiding use of java.base, as that gets special handling on some places:
+        Path sourcePath = base.resolve("source-path");
+        tb.writeJavaFiles(sourcePath, "package src; public class Src {}");
+
+        Path classPathSrc = base.resolve("class-path-src");
+        tb.writeJavaFiles(classPathSrc, "package cp; public class CP { }");
+        Path classPath = base.resolve("classPath");
+        tb.createDirectories(classPath);
+
+        String cpLog = new JavacTask(tb)
+                .outdir(classPath)
+                .files(findJavaFiles(classPathSrc))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!cpLog.isEmpty())
+            throw new Exception("expected output not found: " + cpLog);
+
+        Path modulePathSrc = base.resolve("module-path-src");
+        tb.writeJavaFiles(modulePathSrc,
+                          "module m {}",
+                          "package m; public class M {}");
+        Path modulePath = base.resolve("modulePath");
+        tb.createDirectories(modulePath.resolve("m"));
+
+        String modLog = new JavacTask(tb)
+                .outdir(modulePath.resolve("m"))
+                .files(findJavaFiles(modulePathSrc))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!modLog.isEmpty())
+            throw new Exception("expected output not found: " + modLog);
+
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "package m; public class Extra { }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        String log = new JavacTask(tb)
+                .options("--patch-module", "m=" + sourcePath.toString(),
+                         "--class-path", classPath.toString(),
+                         "--source-path", sourcePath.toString(),
+                         "--module-path", modulePath.toString(),
+                         "--processor-path", System.getProperty("test.classes"),
+                         "-XDaccessInternalAPI=true",
+                         "-processor", CheckModuleContentProcessing.class.getName())
+                .outdir(classes)
+                .files(findJavaFiles(sourcePath))
+                .run()
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.isEmpty())
+            throw new Exception("expected output not found: " + log);
+    }
+
+    @SupportedAnnotationTypes("*")
+    public static final class CheckModuleContentProcessing extends AbstractProcessor {
+
+        @Override
+        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+            Symtab syms = Symtab.instance(((JavacProcessingEnvironment) processingEnv).getContext());
+            Elements elements = processingEnv.getElementUtils();
+            ModuleElement unnamedModule = syms.unnamedModule;
+            ModuleElement mModule = elements.getModuleElement("m");
+
+            assertNonNull("mModule found", mModule);
+            assertNonNull("src.Src from m", elements.getTypeElement(mModule, "src.Src"));
+            assertNull("cp.CP not from m", elements.getTypeElement(mModule, "cp.CP"));
+            assertNull("src.Src not from unnamed", elements.getTypeElement(unnamedModule, "src.Src"));
+            assertNonNull("cp.CP from unnamed", elements.getTypeElement(unnamedModule, "cp.CP"));
+
+            return false;
+        }
+
+        @Override
+        public SourceVersion getSupportedSourceVersion() {
+            return SourceVersion.latest();
+        }
+
+        private static void assertNonNull(String msg, Object val) {
+            if (val == null) {
+                throw new AssertionError(msg);
+            }
+        }
+
+        private static void assertNull(String msg, Object val) {
+            if (val != null) {
+                throw new AssertionError(msg);
+            }
+        }
+    }
+
+    @Test
+    public void testSingleModeIncremental(Path base) throws Exception {
+        //note: avoiding use of java.base, as that gets special handling on some places:
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "package javax.lang.model.element; public interface Extra extends Element { }",
+                          "package javax.lang.model.element; public interface Extra2 extends Extra { }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        Thread.sleep(2000); //ensure newer timestamps on classfiles:
+
+        new JavacTask(tb)
+            .options("--patch-module", "java.compiler=" + src.toString())
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run()
+            .writeAll()
+            .getOutput(Task.OutputKind.DIRECT);
+
+        List<String> log = new JavacTask(tb)
+            .options("--patch-module", "java.compiler=" + src.toString(),
+                     "-verbose")
+            .outdir(classes)
+            .files(findJavaFiles(src.resolve("javax/lang/model/element/Extra2.java"
+                                    .replace("/", src.getFileSystem().getSeparator()))))
+            .run()
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT)
+            .stream()
+            .filter(l -> l.contains("parsing"))
+            .collect(Collectors.toList());
+
+        boolean parsesExtra2 = log.stream()
+                                  .anyMatch(l -> l.contains("Extra2.java"));
+        boolean parsesExtra = log.stream()
+                              .anyMatch(l -> l.contains("Extra.java"));
+
+        if (!parsesExtra2 || parsesExtra) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+    }
+
+    @Test
+    public void testComplexMSPAndPatch(Path base) throws Exception {
+        //note: avoiding use of java.base, as that gets special handling on some places:
+        Path src1 = base.resolve("src1");
+        Path src1ma = src1.resolve("ma");
+        tb.writeJavaFiles(src1ma,
+                          "module ma { exports ma; }",
+                          "package ma; public class C1 { public static void method() { } }",
+                          "package ma.impl; public class C2 { }");
+        Path src1mb = src1.resolve("mb");
+        tb.writeJavaFiles(src1mb,
+                          "module mb { requires ma; }",
+                          "package mb.impl; public class C2 { public static void method() { } }");
+        Path src1mc = src1.resolve("mc");
+        tb.writeJavaFiles(src1mc,
+                          "module mc { }");
+        Path classes1 = base.resolve("classes1");
+        tb.createDirectories(classes1);
+        tb.cleanDirectory(classes1);
+
+        new JavacTask(tb)
+            .options("--module-source-path", src1.toString())
+            .files(findJavaFiles(src1))
+            .outdir(classes1)
+            .run()
+            .writeAll();
+
+        //patching:
+        Path src2 = base.resolve("src2");
+        Path src2ma = src2.resolve("ma");
+        tb.writeJavaFiles(src2ma,
+                          "package ma.impl; public class C2 { public static void extra() { ma.C1.method(); } }",
+                          "package ma.impl; public class C3 { public void test() { C2.extra(); } }");
+        Path src2mb = src2.resolve("mb");
+        tb.writeJavaFiles(src2mb,
+                          "package mb.impl; public class C3 { public void test() { C2.method(); ma.C1.method(); ma.impl.C2.extra(); } }");
+        Path src2mc = src2.resolve("mc");
+        tb.writeJavaFiles(src2mc,
+                          "package mc.impl; public class C2 { public static void test() { } }",
+                          //will require --add-reads ma:
+                          "package mc.impl; public class C3 { public static void test() { ma.impl.C2.extra(); } }");
+        Path src2mt = src2.resolve("mt");
+        tb.writeJavaFiles(src2mt,
+                          "module mt { requires ma; requires mb; }",
+                          "package mt.impl; public class C2 { public static void test() { mb.impl.C2.method(); ma.impl.C2.extra(); } }",
+                          "package mt.impl; public class C3 { public static void test() { C2.test(); mc.impl.C2.test(); } }");
+        Path classes2 = base.resolve("classes2");
+        tb.createDirectories(classes2);
+        tb.cleanDirectory(classes2);
+
+        Thread.sleep(2000); //ensure newer timestamps on classfiles:
+
+        new JavacTask(tb)
+            .options("--module-path", classes1.toString(),
+                     "--patch-module", "ma=" + src2ma.toString(),
+                     "--patch-module", "mb=" + src2mb.toString(),
+                     "--add-exports", "ma/ma.impl=mb",
+                     "--patch-module", "mc=" + src2mc.toString(),
+                     "--add-reads", "mc=ma",
+                     "--add-exports", "ma/ma.impl=mc",
+                     "--add-exports", "ma/ma.impl=mt",
+                     "--add-exports", "mb/mb.impl=mt",
+                     "--add-exports", "mc/mc.impl=mt",
+                     "--add-reads", "mt=mc",
+                     "--module-source-path", src2.toString())
+            .outdir(classes2)
+            .files(findJavaFiles(src2))
+            .run()
+            .writeAll();
+
+        //incremental compilation (C2 mustn't be compiled, C3 must):
+        tb.writeJavaFiles(src2ma,
+                          "package ma.impl; public class C3 { public void test() { ma.C1.method(); C2.extra(); } }");
+        tb.writeJavaFiles(src2mt,
+                          "package mt.impl; public class C3 { public static void test() { mc.impl.C2.test(); C2.test(); } }");
+
+        List<String> log = new JavacTask(tb)
+            .options("--module-path", classes1.toString(),
+                     "--patch-module", "ma=" + src2ma.toString(),
+                     "--patch-module", "mb=" + src2mb.toString(),
+                     "--add-exports", "ma/ma.impl=mb",
+                     "--patch-module", "mc=" + src2mc.toString(),
+                     "--add-reads", "mc=ma",
+                     "--add-exports", "ma/ma.impl=mc",
+                     "--add-exports", "ma/ma.impl=mt",
+                     "--add-exports", "mb/mb.impl=mt",
+                     "--add-exports", "mc/mc.impl=mt",
+                     "--add-reads", "mt=mc",
+                     "--module-source-path", src2.toString(),
+                     "--add-modules", "mc",
+                     "-verbose")
+            .outdir(classes2)
+            .files(src2ma.resolve("ma").resolve("impl").resolve("C3.java"),
+                   src2mt.resolve("mt").resolve("impl").resolve("C3.java"))
+            .run()
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT)
+            .stream()
+            .filter(l -> l.contains("parsing"))
+            .collect(Collectors.toList());
+
+        boolean parsesC3 = log.stream()
+                              .anyMatch(l -> l.contains("C3.java"));
+        boolean parsesC2 = log.stream()
+                              .anyMatch(l -> l.contains("C2.java"));
+
+        if (!parsesC3 || parsesC2) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
+    }
+
+    private void checkFileExists(Path dir, String path) {
+        Path toCheck = dir.resolve(path.replace("/", dir.getFileSystem().getSeparator()));
+
+        if (!Files.exists(toCheck)) {
+            throw new AssertionError(toCheck.toString() + " does not exist!");
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/modules/ConvenientAccessErrorsTest.java b/langtools/test/tools/javac/modules/ConvenientAccessErrorsTest.java
index 45c2d38..3fed25a 100644
--- a/langtools/test/tools/javac/modules/ConvenientAccessErrorsTest.java
+++ b/langtools/test/tools/javac/modules/ConvenientAccessErrorsTest.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8169197 8172668 8173117
+ * @bug 8169197 8172668 8173117 8175007
  * @summary Check convenient errors are produced for inaccessible classes.
  * @library /tools/lib
  * @modules jdk.compiler/com.sun.tools.javac.api
@@ -704,4 +704,44 @@
             throw new Exception("Expected names not generated: " + actual);
         }
     }
+
+    @Test
+    public void testInaccessibleInVisible(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path src_ma = src.resolve("ma");
+        tb.writeJavaFiles(src_ma,
+                          "module ma { exports ma; }",
+                          "package ma; class NotApi { public static class Inner { } }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        new JavacTask(tb)
+            .outdir(classes)
+            .files(findJavaFiles(src_ma))
+            .run()
+            .writeAll();
+
+        Path src_mb = src.resolve("mb");
+        tb.writeJavaFiles(src_mb,
+                          "module mb { requires ma; }",
+                          "package mb.a; public class Test { ma.NotApi.Inner i1; mb.b.NotApi.Inner i2; }",
+                          "package mb.b; class NotApi { public static class Inner { } }");
+
+        List<String> log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--module-path", classes.toString())
+                .outdir(classes)
+                .files(findJavaFiles(src_mb))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        List<String> expected = Arrays.asList(
+                "Test.java:1:44: compiler.err.not.def.access.class.intf.cant.access: ma.NotApi.Inner, ma.NotApi",
+                "Test.java:1:66: compiler.err.not.def.access.class.intf.cant.access: mb.b.NotApi.Inner, mb.b.NotApi",
+                "2 errors");
+
+        if (!expected.equals(log))
+            throw new Exception("expected output not found; actual: " + log);
+    }
 }
diff --git a/langtools/test/tools/javac/modules/DirectiveVisitorTest.java b/langtools/test/tools/javac/modules/DirectiveVisitorTest.java
new file mode 100644
index 0000000..f288798
--- /dev/null
+++ b/langtools/test/tools/javac/modules/DirectiveVisitorTest.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.PrintStream;
+import java.nio.file.Path;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.lang.model.element.ModuleElement;
+import javax.lang.model.element.ModuleElement.Directive;
+import javax.lang.model.element.ModuleElement.DirectiveKind;
+import javax.lang.model.element.ModuleElement.DirectiveVisitor;
+import javax.lang.model.element.ModuleElement.ExportsDirective;
+import javax.lang.model.element.ModuleElement.OpensDirective;
+import javax.lang.model.element.ModuleElement.ProvidesDirective;
+import javax.lang.model.element.ModuleElement.RequiresDirective;
+import javax.lang.model.element.ModuleElement.UsesDirective;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import com.sun.source.util.JavacTask;
+
+/*
+ * @test
+ * @bug 8175118
+ * @summary Add ModuleElement.DirectiveVisitor
+ * @library /tools/lib
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.compiler/com.sun.tools.javac.util
+ * @build toolbox.ToolBox ModuleTestBase
+ * @run main DirectiveVisitorTest
+ */
+
+public class DirectiveVisitorTest extends ModuleTestBase {
+    public static void main(String... args) throws Exception {
+        new DirectiveVisitorTest().runTests();
+    }
+
+    @Test
+    public void testVisitor(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path src_m1 = src.resolve("m1x");
+        tb.writeJavaFiles(src_m1,
+                          "module m1x { "
+                          + " requires m2x;"
+                          + " exports p1;"
+                          + " opens p2;"
+                          + " uses p1.Service;"
+                          + " provides p1.Service with p2.Impl;"
+                          + "}",
+                          "package p1; public interface Service { }",
+                          "package p2; public class Impl implements p1.Service { }");
+        Path src_m2 = src.resolve("m2x");
+        tb.writeJavaFiles(src_m2,
+                          "module m2x { }");
+
+        Path modules = base.resolve("modules");
+        tb.createDirectories(modules);
+
+        JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
+        try (StandardJavaFileManager fm = javac.getStandardFileManager(null, null, null)) {
+            Iterable<? extends JavaFileObject> files = fm.getJavaFileObjects(findJavaFiles(src));
+            List<String> options = List.of(
+                    "--module-source-path", src.toString(),
+                    "-d", modules.toString()
+            );
+            JavacTask t = (JavacTask) javac.getTask(null, fm, null, options, null, files);
+            t.analyze();
+            ModuleElement e = t.getElements().getModuleElement("m1x");
+            Set<DirectiveKind> kinds = EnumSet.<DirectiveKind>allOf(DirectiveKind.class);
+            Visitor v = new Visitor();
+            v.visit(e, kinds);
+            if (!kinds.equals(EnumSet.<DirectiveKind>noneOf(DirectiveKind.class))) {
+                error("Some kinds not found: " + kinds);
+            }
+        }
+    }
+
+    static class Visitor implements DirectiveVisitor<Void,Set<DirectiveKind>> {
+        private final PrintStream out = System.err;
+
+        public void visit(ModuleElement e, Set<DirectiveKind> kinds) {
+            e.getDirectives().stream().forEach(d -> visit(d, kinds));
+        }
+
+        @Override
+        public Void visitRequires(RequiresDirective d, Set<DirectiveKind> kinds) {
+            visitAny(d, kinds);
+            return null;
+        }
+
+        @Override
+        public Void visitExports(ExportsDirective d, Set<DirectiveKind> kinds) {
+            visitAny(d, kinds);
+            return null;
+        }
+
+        @Override
+        public Void visitOpens(OpensDirective d, Set<DirectiveKind> kinds) {
+            visitAny(d, kinds);
+            return null;
+        }
+
+        @Override
+        public Void visitUses(UsesDirective d, Set<DirectiveKind> kinds) {
+            visitAny(d, kinds);
+            return null;
+        }
+
+        @Override
+        public Void visitProvides(ProvidesDirective d, Set<DirectiveKind> kinds) {
+            visitAny(d, kinds);
+            return null;
+        }
+
+        private void visitAny(Directive d, Set<DirectiveKind> kinds) {
+            out.println("visit: " + d);
+            kinds.remove(d.getKind());
+        }
+    }
+}
+
diff --git a/langtools/test/tools/javac/modules/EdgeCases.java b/langtools/test/tools/javac/modules/EdgeCases.java
index 841a43d..679bc17 100644
--- a/langtools/test/tools/javac/modules/EdgeCases.java
+++ b/langtools/test/tools/javac/modules/EdgeCases.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8154283 8167320 8171098 8172809 8173068 8173117
+ * @bug 8154283 8167320 8171098 8172809 8173068 8173117 8176045 8177311
  * @summary tests for multi-module mode compilation
  * @library /tools/lib
  * @modules
@@ -36,6 +36,7 @@
  * @run main EdgeCases
  */
 
+import java.io.BufferedWriter;
 import java.io.Writer;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -67,10 +68,7 @@
 //import com.sun.source.util.JavacTask; // conflicts with toolbox.JavacTask
 import com.sun.tools.javac.api.JavacTaskImpl;
 import com.sun.tools.javac.code.Symbol.ModuleSymbol;
-import com.sun.tools.javac.code.Symbol.PackageSymbol;
 import com.sun.tools.javac.code.Symtab;
-import com.sun.tools.javac.processing.JavacProcessingEnvironment;
-import com.sun.tools.javac.util.Context;
 
 import toolbox.JarTask;
 import toolbox.JavacTask;
@@ -269,13 +267,22 @@
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
-        new JavacTask(tb)
+        List<String> log = new JavacTask(tb)
                 .options("--source-path", src_m1.toString(),
                          "-XDrawDiagnostics")
                 .outdir(classes)
                 .files(findJavaFiles(src_m1.resolve("test")))
                 .run(Task.Expect.FAIL)
-                .writeAll();
+                .writeAll()
+                .getOutputLines(OutputKind.DIRECT);
+
+        List<String> expected = Arrays.asList(
+                "- compiler.err.cant.access: module-info, (compiler.misc.bad.source.file.header: module-info.java, (compiler.misc.file.does.not.contain.module))",
+                "1 error");
+
+        if (!expected.equals(log)) {
+            throw new AssertionError("Unexpected output: " + log);
+        }
 
         tb.writeJavaFiles(src_m1,
                           "module m1x {}");
@@ -812,4 +819,180 @@
         }
 
     }
+
+    @Test
+    public void testEmptyInExportedPackage(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path m = src.resolve("m");
+        tb.writeJavaFiles(m,
+                          "module m { exports api; }");
+        Path apiFile = m.resolve("api").resolve("Api.java");
+        Files.createDirectories(apiFile.getParent());
+        try (BufferedWriter w = Files.newBufferedWriter(apiFile)) {
+            w.write("//no package decl");
+        }
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        List<String> log;
+        List<String> expected =
+                Arrays.asList("module-info.java:1:20: compiler.err.package.empty.or.not.found: api",
+                              "1 error");
+
+        System.err.println("file explicitly specified:");
+
+        log = new JavacTask(tb)
+            .options("-XDrawDiagnostics",
+                     "--module-source-path", src.toString())
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run(Task.Expect.FAIL)
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT);
+
+        if (!expected.equals(log))
+            throw new Exception("expected output not found: " + log);
+
+        System.err.println("file not specified:");
+
+        tb.cleanDirectory(classes);
+
+        log = new JavacTask(tb)
+            .options("-XDrawDiagnostics",
+                     "--module-source-path", src.toString())
+            .outdir(classes)
+            .files(findJavaFiles(m.resolve("module-info.java")))
+            .run(Task.Expect.FAIL)
+            .writeAll()
+            .getOutputLines(Task.OutputKind.DIRECT);
+
+        if (!expected.equals(log))
+            throw new Exception("expected output not found: " + log);
+    }
+
+    @Test
+    public void testJustPackageInExportedPackage(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path m = src.resolve("m");
+        tb.writeJavaFiles(m,
+                          "module m { exports api; }");
+        Path apiFile = m.resolve("api").resolve("Api.java");
+        Files.createDirectories(apiFile.getParent());
+        try (BufferedWriter w = Files.newBufferedWriter(apiFile)) {
+            w.write("package api;");
+        }
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        System.err.println("file explicitly specified:");
+
+        new JavacTask(tb)
+            .options("-XDrawDiagnostics",
+                     "--module-source-path", src.toString())
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run()
+            .writeAll();
+
+        System.err.println("file not specified:");
+
+        tb.cleanDirectory(classes);
+
+        new JavacTask(tb)
+            .options("-XDrawDiagnostics",
+                     "--module-source-path", src.toString())
+            .outdir(classes)
+            .files(findJavaFiles(m.resolve("module-info.java")))
+            .run()
+            .writeAll();
+    }
+
+    @Test
+    public void testWrongPackageInExportedPackage(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path m = src.resolve("m");
+        tb.writeJavaFiles(m,
+                          "module m { exports api; }");
+        Path apiFile = m.resolve("api").resolve("Api.java");
+        Files.createDirectories(apiFile.getParent());
+        try (BufferedWriter w = Files.newBufferedWriter(apiFile)) {
+            w.write("package impl; public class Api { }");
+        }
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        List<String> log;
+
+        List<String> expected =
+                Arrays.asList("module-info.java:1:20: compiler.err.package.empty.or.not.found: api",
+                              "1 error");
+
+        System.err.println("file explicitly specified:");
+
+        log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--module-source-path", src.toString())
+                .outdir(classes)
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        if (!expected.equals(log))
+            throw new Exception("expected output not found: " + log);
+
+        System.err.println("file not specified:");
+
+        tb.cleanDirectory(classes);
+
+        log = new JavacTask(tb)
+                .options("-XDrawDiagnostics",
+                         "--module-source-path", src.toString())
+                .outdir(classes)
+                .files(findJavaFiles(m.resolve("module-info.java")))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+
+        if (!expected.equals(log))
+            throw new Exception("expected output not found: " + log);
+    }
+
+    @Test
+    public void testDependOnUnnamedAccessibility(Path base) throws Exception {
+        Path unnamedSrc = base.resolve("unnamed-src");
+        tb.writeJavaFiles(unnamedSrc,
+                          "package p1; public class First { public static p2.Second get() { return null; } }",
+                          "package p2; public class Second { public void test() { } }");
+        Path unnamedClasses = base.resolve("unnamed-classes");
+        tb.createDirectories(unnamedClasses);
+
+        System.err.println("compiling unnamed sources:");
+
+        new JavacTask(tb)
+                .outdir(unnamedClasses)
+                .files(findJavaFiles(unnamedSrc))
+                .run()
+                .writeAll();
+
+        //test sources:
+        Path src = base.resolve("src");
+        Path m = src.resolve("m");
+        tb.writeJavaFiles(m,
+                          "module m { }",
+                          "package p; public class Test { { p1.First.get().test(); } }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        System.err.println("compiling test module:");
+
+        new JavacTask(tb)
+            .options("-classpath", unnamedClasses.toString(),
+                     "--add-reads", "m=ALL-UNNAMED")
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run()
+            .writeAll();
+    }
+
 }
diff --git a/langtools/test/tools/javac/modules/EnvVarTest.java b/langtools/test/tools/javac/modules/EnvVarTest.java
index eed5a03..dfa3d78 100644
--- a/langtools/test/tools/javac/modules/EnvVarTest.java
+++ b/langtools/test/tools/javac/modules/EnvVarTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8156962
- * @summary Tests use of _JAVAC_OPTIONS env variable
+ * @summary Tests use of JDK_JAVAC_OPTIONS env variable
  * @library /tools/lib
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -71,7 +71,7 @@
 
         tb.out.println("test that addExports can be provided with env variable");
         new JavacTask(tb, Mode.EXEC)
-                .envVar("_JAVAC_OPTIONS", "--add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED")
+                .envVar("JDK_JAVAC_OPTIONS", "--add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED")
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run(Expect.SUCCESS)
@@ -83,7 +83,7 @@
                 "--add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED");
 
         new JavacTask(tb, Mode.EXEC)
-                .envVar("_JAVAC_OPTIONS", "@" + atFile)
+                .envVar("JDK_JAVAC_OPTIONS", "@" + atFile)
                 .outdir(classes)
                 .files(findJavaFiles(src))
                 .run(Expect.SUCCESS)
diff --git a/langtools/test/tools/javac/modules/IncubatingTest.java b/langtools/test/tools/javac/modules/IncubatingTest.java
index a839237..796d8df 100644
--- a/langtools/test/tools/javac/modules/IncubatingTest.java
+++ b/langtools/test/tools/javac/modules/IncubatingTest.java
@@ -122,14 +122,11 @@
                          "-XDrawDiagnostics")
                 .outdir(testClasses)
                 .files(findJavaFiles(testSrc))
-                .run(Expect.FAIL)
+                .run(Expect.SUCCESS)
                 .writeAll()
                 .getOutputLines(Task.OutputKind.DIRECT);
 
-        expected = Arrays.asList(
-                "T.java:1:11: compiler.err.package.not.visible: api, (compiler.misc.not.def.access.does.not.read.from.unnamed: api, jdk.i)",
-                "1 error"
-        );
+        expected = Arrays.asList("");
 
         if (!expected.equals(log)) {
             throw new AssertionError("Unexpected output: " + log);
diff --git a/langtools/test/tools/javac/modules/InheritRuntimeEnvironmentTest.java b/langtools/test/tools/javac/modules/InheritRuntimeEnvironmentTest.java
index b4766d7..64b534a 100644
--- a/langtools/test/tools/javac/modules/InheritRuntimeEnvironmentTest.java
+++ b/langtools/test/tools/javac/modules/InheritRuntimeEnvironmentTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -177,7 +177,7 @@
         Files.createDirectories(patch);
 
         new JavacTask(tb)
-                .options("-Xmodule:java.base")
+                .options("--patch-module", "java.base=" + patchSrc.toString())
                 .outdir(patch)
                 .sourcepath(patchSrc)
                 .files(findJavaFiles(patchSrc))
@@ -238,7 +238,7 @@
                 Arrays.asList("--add-exports", "jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED");
         List<Path> files = Arrays.asList(findJavaFiles(src));
 
-        String envName = "_JAVAC_OPTIONS";
+        String envName = "JDK_JAVAC_OPTIONS";
         String envValue = String.join(" ", testOpts);
 
         out.println("  javac:");
diff --git a/langtools/test/tools/javac/modules/MOptionTest.java b/langtools/test/tools/javac/modules/MOptionTest.java
index b48aa2f..c6642ca 100644
--- a/langtools/test/tools/javac/modules/MOptionTest.java
+++ b/langtools/test/tools/javac/modules/MOptionTest.java
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8146946
+ * @bug 8146946 8176743
  * @summary implement javac -m option
  * @library /tools/lib
  * @modules
diff --git a/langtools/test/tools/javac/modules/ModuleInfoPatchPath.java b/langtools/test/tools/javac/modules/ModuleInfoPatchPath.java
new file mode 100644
index 0000000..a637fb9
--- /dev/null
+++ b/langtools/test/tools/javac/modules/ModuleInfoPatchPath.java
@@ -0,0 +1,325 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8175057
+ * @summary Verify that having module-info on patch path works correctly.
+ * @library /tools/lib
+ * @modules
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.code
+ *      jdk.compiler/com.sun.tools.javac.main
+ *      jdk.compiler/com.sun.tools.javac.processing
+ *      jdk.compiler/com.sun.tools.javac.util
+ * @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask ModuleTestBase
+ * @run main ModuleInfoPatchPath
+ */
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+
+import toolbox.JavacTask;
+import toolbox.Task.OutputKind;
+
+public class ModuleInfoPatchPath extends ModuleTestBase {
+
+    public static void main(String... args) throws Exception {
+        new ModuleInfoPatchPath().runTests();
+    }
+
+    @Test
+    public void testModuleInfoToModulePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module m { exports api; }",
+                          "package api; public class Api {}");
+        Path patch = base.resolve("patch");
+        tb.writeJavaFiles(patch,
+                          "module m { requires java.compiler; exports api; }",
+                          "package api; public class Api { public static javax.lang.model.element.Element element; }");
+        Path classes = base.resolve("classes");
+        Path mClasses = classes.resolve("m");
+        tb.createDirectories(mClasses);
+
+        System.err.println("Building the vanilla module...");
+
+        new JavacTask(tb)
+            .outdir(mClasses)
+            .files(findJavaFiles(src))
+            .run()
+            .writeAll();
+
+        Path test = base.resolve("test");
+        tb.writeJavaFiles(test,
+                          "module test { requires m; }",
+                          "package test; public class Test { private void test() { api.Api.element = null; } }");
+
+        Path testClasses = classes.resolve("test");
+        tb.createDirectories(testClasses);
+
+        System.err.println("Building patched module...");
+
+        new JavacTask(tb)
+            .options("--module-path", mClasses.toString(),
+                     "--patch-module", "m=" + patch.toString())
+            .outdir(testClasses)
+            .files(findJavaFiles(test))
+            .run()
+            .writeAll();
+
+        Path patchClasses = classes.resolve("patch");
+        tb.createDirectories(patchClasses);
+
+        System.err.println("Building patch...");
+
+        new JavacTask(tb)
+            .outdir(patchClasses)
+            .files(findJavaFiles(patch))
+            .run()
+            .writeAll();
+
+        tb.cleanDirectory(testClasses);
+
+        Files.delete(patch.resolve("module-info.java"));
+        Files.copy(patchClasses.resolve("module-info.class"), patch.resolve("module-info.class"));
+
+        System.err.println("Building patched module against binary patch...");
+
+        new JavacTask(tb)
+            .options("--module-path", mClasses.toString(),
+                     "--patch-module", "m=" + patch.toString())
+            .outdir(testClasses)
+            .files(findJavaFiles(test))
+            .run()
+            .writeAll();
+    }
+
+    @Test
+    public void testModuleInfoToSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module m { exports api; }",
+                          "package api; public class Api {}",
+                          "package test; public class Test { private void test() { api.Api.element = null; } }");
+        Path patch = base.resolve("patch");
+        tb.writeJavaFiles(patch,
+                          "module m { requires java.compiler; exports api; }",
+                          "package api; public class Api { public static javax.lang.model.element.Element element; }");
+        Path classes = base.resolve("classes");
+        Path mClasses = classes.resolve("m");
+        tb.createDirectories(mClasses);
+
+        System.err.println("Building patched module against source patch...");
+
+        new JavacTask(tb)
+            .options("--patch-module", "m=" + patch.toString(),
+                     "-sourcepath", src.toString())
+            .outdir(mClasses)
+            .files(findJavaFiles(src.resolve("test")))
+            .run()
+            .writeAll();
+
+        //incremental compilation:
+        List<String> log;
+
+        System.err.println("Incremental building of patched module against source patch, no module-info...");
+
+        log = new JavacTask(tb)
+                .options("--patch-module", "m=" + patch.toString(),
+                         "-sourcepath", src.toString(),
+                         "-verbose")
+                .outdir(mClasses)
+                .files(findJavaFiles(src.resolve("test")))
+                .run()
+                .writeAll()
+                .getOutputLines(OutputKind.DIRECT);
+
+        if (log.stream().filter(line -> line.contains("[parsing started")).count() != 1) {
+            throw new AssertionError("incorrect number of parsing events.");
+        }
+
+        System.err.println("Incremental building of patched module against source patch, with module-info...");
+
+        log = new JavacTask(tb)
+                .options("--patch-module", "m=" + patch.toString(),
+                         "-sourcepath", src.toString(),
+                         "-verbose")
+                .outdir(mClasses)
+                .files(findJavaFiles(patch.resolve("module-info.java"), src.resolve("test")))
+                .run()
+                .writeAll()
+                .getOutputLines(OutputKind.DIRECT);
+
+        if (log.stream().filter(line -> line.contains("[parsing started")).count() != 2) {
+            throw new AssertionError("incorrect number of parsing events.");
+        }
+
+        tb.cleanDirectory(mClasses);
+
+        System.err.println("Building patched module against source patch with source patch on patch path...");
+
+        new JavacTask(tb)
+            .options("--patch-module", "m=" + patch.toString(),
+                     "-sourcepath", src.toString())
+            .outdir(mClasses)
+            .files(findJavaFiles(src.resolve("test"), patch))
+            .run()
+            .writeAll();
+
+        Path patchClasses = classes.resolve("patch");
+        tb.createDirectories(patchClasses);
+
+        System.err.println("Building patch...");
+
+        new JavacTask(tb)
+            .outdir(patchClasses)
+            .files(findJavaFiles(patch))
+            .run()
+            .writeAll();
+
+        tb.cleanDirectory(mClasses);
+
+        Files.delete(patch.resolve("module-info.java"));
+        Files.copy(patchClasses.resolve("module-info.class"), patch.resolve("module-info.class"));
+
+        System.err.println("Building patched module against binary patch...");
+
+        new JavacTask(tb)
+            .options("--patch-module", "m=" + patch.toString(),
+                     "-sourcepath", src.toString())
+            .outdir(mClasses)
+            .files(findJavaFiles(src.resolve("test")))
+            .run()
+            .writeAll();
+
+        tb.cleanDirectory(mClasses);
+
+        System.err.println("Building patched module against binary patch with source patch on patch path...");
+
+        new JavacTask(tb)
+            .options("--patch-module", "m=" + patch.toString(),
+                     "-sourcepath", src.toString())
+            .outdir(mClasses)
+            .files(findJavaFiles(src.resolve("test"), patch))
+            .run()
+            .writeAll();
+    }
+
+    @Test
+    public void testModuleInfoToModuleSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path m = src.resolve("m");
+        tb.writeJavaFiles(m,
+                          "module m { exports api; }",
+                          "package api; public class Api {}",
+                          "package test; public class Test { private void test() { api.Api.element = null; } }");
+        Path patch = base.resolve("patch");
+        tb.writeJavaFiles(patch,
+                          "module m { requires java.compiler; exports api; }",
+                          "package api; public class Api { public static javax.lang.model.element.Element element; }");
+        Path classes = base.resolve("classes");
+        Path mClasses = classes.resolve("m");
+        tb.createDirectories(mClasses);
+
+        System.err.println("Building patched module against source patch...");
+
+        new JavacTask(tb)
+            .options("--patch-module", "m=" + patch.toString(),
+                     "--module-source-path", src.toString())
+            .outdir(mClasses)
+            .files(findJavaFiles(m.resolve("test")))
+            .run()
+            .writeAll();
+
+        //incremental compilation:
+
+        System.err.println("Incremental building of patched module against source patch...");
+
+        List<String> log = new JavacTask(tb)
+                .options("--patch-module", "m=" + patch.toString(),
+                         "--module-source-path", src.toString(),
+                         "-verbose")
+                .outdir(mClasses)
+                .files(findJavaFiles(m.resolve("test")))
+                .run()
+                .writeAll()
+                .getOutputLines(OutputKind.DIRECT);
+
+        if (log.stream().filter(line -> line.contains("[parsing started")).count() != 1) {
+            throw new AssertionError("incorrect number of parsing events.");
+        }
+
+        tb.cleanDirectory(mClasses);
+
+        System.err.println("Building patched module against source patch with source patch on patch path...");
+
+        new JavacTask(tb)
+            .options("--patch-module", "m=" + patch.toString(),
+                     "--module-source-path", src.toString())
+            .outdir(mClasses)
+            .files(findJavaFiles(m.resolve("test"), patch))
+            .run()
+            .writeAll();
+
+        Path patchClasses = classes.resolve("patch");
+        tb.createDirectories(patchClasses);
+
+        System.err.println("Building patch...");
+
+        new JavacTask(tb)
+            .outdir(patchClasses)
+            .files(findJavaFiles(patch))
+            .run()
+            .writeAll();
+
+        tb.cleanDirectory(mClasses);
+
+        Files.delete(patch.resolve("module-info.java"));
+        Files.copy(patchClasses.resolve("module-info.class"), patch.resolve("module-info.class"));
+
+        System.err.println("Building patched module against binary patch...");
+
+        new JavacTask(tb)
+            .options("--patch-module", "m=" + patch.toString(),
+                     "--module-source-path", src.toString())
+            .outdir(mClasses)
+            .files(findJavaFiles(m.resolve("test")))
+            .run()
+            .writeAll();
+
+        tb.cleanDirectory(mClasses);
+
+        System.err.println("Building patched module against binary patch with source patch on patch path...");
+
+        new JavacTask(tb)
+            .options("--patch-module", "m=" + patch.toString(),
+                     "--module-source-path", src.toString())
+            .outdir(mClasses)
+            .files(findJavaFiles(m.resolve("test"), patch))
+            .run()
+            .writeAll();
+    }
+
+}
diff --git a/langtools/test/tools/javac/modules/ModuleInfoTest.java b/langtools/test/tools/javac/modules/ModuleInfoTest.java
index 3d08be1..6e083f9 100644
--- a/langtools/test/tools/javac/modules/ModuleInfoTest.java
+++ b/langtools/test/tools/javac/modules/ModuleInfoTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,7 @@
                 .writeAll()
                 .getOutput(Task.OutputKind.DIRECT);
 
-        if (!log.contains("module-info.java:1:8: compiler.err.class.public.should.be.in.file: C"))
+        if (!log.contains("module-info.java:1:8: compiler.err.class.public.should.be.in.file: kindname.class, C"))
             throw new Exception("expected output not found");
     }
 
@@ -557,4 +557,187 @@
                 throw new Exception("expected output not found for: " + moduleInfo + "; actual: " + log);
         }
     }
-}
+
+    @Test
+    public void testMalformedModuleNames(Path base) throws Exception {
+        testMalformedName(base, "m1.package", "module-info.java:1:11: compiler.err.expected: token.identifier");
+        testMalformedName(base, "m1/package", "module-info.java:1:10: compiler.err.expected: '{'");
+        testMalformedName(base, "m1->long", "module-info.java:1:10: compiler.err.expected: '{'");
+        testMalformedName(base, "m1::long", "module-info.java:1:10: compiler.err.expected: '{'");
+        testMalformedName(base, "m1&long", "module-info.java:1:10: compiler.err.expected: '{'");
+        testMalformedName(base, "m1%long", "module-info.java:1:10: compiler.err.expected: '{'");
+        testMalformedName(base, "m1@long", "module-info.java:1:10: compiler.err.expected: '{'");
+        testMalformedName(base, "@m1", "module-info.java:1:7: compiler.err.expected: token.identifier");
+        testMalformedName(base, "!", "module-info.java:1:7: compiler.err.expected: token.identifier");
+        testMalformedName(base, "m1#long", "module-info.java:1:10: compiler.err.illegal.char: #");
+        testMalformedName(base, "m1\\long", "module-info.java:1:10: compiler.err.illegal.char: \\");
+        testMalformedName(base, "module.", "module-info.java:1:15: compiler.err.expected: token.identifier");
+        testMalformedName(base, ".module", "module-info.java:1:7: compiler.err.expected: token.identifier");
+        testMalformedName(base, "1module", "module-info.java:1:7: compiler.err.expected: token.identifier");
+        testMalformedName(base, "module module", "module-info.java:1:14: compiler.err.expected: '{'");
+    }
+
+    private void testMalformedName(Path base, String name, String expected) throws Exception {
+        Path src = base.resolve("src");
+        Path src_m1 = src.resolve("m1");
+        tb.writeJavaFiles(src_m1, "module " + name + " { }");
+
+        Path classes = base.resolve("classes");
+        Files.createDirectories(classes);
+
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics", "--module-source-path", src.toString())
+                .outdir(classes)
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains(expected))
+            throw new Exception("expected output not found. Name: " + name + " Expected: " + expected);
+    }
+
+    @Test
+    public void testWrongOpensTransitiveFlag(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "module M { opens transitive p1; }",
+                "package p1; public class A { }");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:28: compiler.err.expected: ';'"))
+            throw new Exception("expected output not found");
+    }
+
+    @Test
+    public void testWrongOpensStaticFlag(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "module M { opens static p1; }",
+                "package p1; public class A { }");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:17: compiler.err.expected: token.identifier"))
+            throw new Exception("expected output not found");
+    }
+
+    @Test
+    public void testSeveralOpensDirectives(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "module M { opens opens p1; }",
+                "package p1; public class A { }");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:23: compiler.err.expected: ';'"))
+            throw new Exception("expected output not found");
+    }
+
+    @Test
+    public void testUnknownDirective(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "module M { boolean p1; }",
+                "package p1; public class A { }");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:11: compiler.err.expected: '}'"))
+            throw new Exception("expected output not found");
+    }
+
+    @Test
+    public void testUnknownModuleFlag(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "private module M { }",
+                "package p1; public class A { }");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:9: compiler.err.mod.not.allowed.here: private"))
+            throw new Exception("expected output not found");
+    }
+
+    @Test
+    public void testDirectiveOnModuleDeclaration(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "opens module M { }",
+                "package p1; public class A { }");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:1: compiler.err.expected.module.or.open"))
+            throw new Exception("expected output not found");
+    }
+
+    @Test
+    public void testTooOpenModule(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "open open module M { }",
+                "package p1; public class A { }");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:6: compiler.err.expected.module"))
+            throw new Exception("expected output not found");
+    }
+
+    @Test
+    public void testEnumAsModuleFlag(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "enum module M { }",
+                "package p1; public class A { }");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:12: compiler.err.expected: '{'"))
+            throw new Exception("expected output not found");
+    }
+
+    @Test
+    public void testClassInModule(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "module M { class B { } }",
+                "package p1; public class A { }");
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("module-info.java:1:11: compiler.err.expected: '}'"))
+            throw new Exception("expected output not found");
+    }
+}
\ No newline at end of file
diff --git a/langtools/test/tools/javac/modules/ModulePathTest.java b/langtools/test/tools/javac/modules/ModulePathTest.java
index 7315ad1..53123b2 100644
--- a/langtools/test/tools/javac/modules/ModulePathTest.java
+++ b/langtools/test/tools/javac/modules/ModulePathTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
 
 /*
  * @test
+ * @bug 8142968 8174104
  * @summary tests for --module-path
  * @library /tools/lib
  * @modules
@@ -57,7 +58,7 @@
     }
 
     @Test
-    public void testNotExistsOnPath(Path base) throws Exception {
+    public void testNotExistsOnPath_noWarn(Path base) throws Exception {
         Path src = base.resolve("src");
         tb.writeJavaFiles(src, "class C { }");
 
@@ -65,11 +66,29 @@
                 .options("-XDrawDiagnostics",
                         "--module-path", "doesNotExist")
                 .files(findJavaFiles(src))
-                .run(Task.Expect.FAIL)
+                .run(Task.Expect.SUCCESS)
                 .writeAll()
                 .getOutput(Task.OutputKind.DIRECT);
 
-        if (!log.contains("- compiler.err.illegal.argument.for.option: --module-path, doesNotExist"))
+        if (!log.isEmpty())
+            throw new Exception("unexpected output");
+    }
+
+    @Test
+    public void testNotExistsOnPath_warn(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src, "class C { }");
+
+        String log = new JavacTask(tb, Task.Mode.CMDLINE)
+                .options("-XDrawDiagnostics",
+                        "-Xlint:path",
+                        "--module-path", "doesNotExist")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.SUCCESS)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+
+        if (!log.contains("- compiler.warn.path.element.not.found: doesNotExist"))
             throw new Exception("expected output not found");
     }
 
diff --git a/langtools/test/tools/javac/modules/ModulesAndModuleSourcePathTest.java b/langtools/test/tools/javac/modules/ModulesAndModuleSourcePathTest.java
index 1edc21d..b4c50d7 100644
--- a/langtools/test/tools/javac/modules/ModulesAndModuleSourcePathTest.java
+++ b/langtools/test/tools/javac/modules/ModulesAndModuleSourcePathTest.java
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8165102
+ * @bug 8165102 8175560
  * @summary incorrect message from javac
  * @library /tools/lib
  * @modules
@@ -50,6 +50,27 @@
     public void testModuleNotInModuleSrcPath(Path base) throws Exception {
         Path src = base.resolve("src");
         Path m = src.resolve("m");
+        Files.createDirectories(m);
+        Path extra = base.resolve("m");
+        tb.writeJavaFiles(extra, "module m {}");
+        Path classes = base.resolve("classes");
+        Files.createDirectories(classes);
+
+        String log = new JavacTask(tb)
+                .options("-XDrawDiagnostics", "--module-source-path", src.toString())
+                .outdir(classes)
+                .files(findJavaFiles(extra))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutput(Task.OutputKind.DIRECT);
+        if (!log.contains("module-info.java:1:1: compiler.err.module.not.found.on.module.source.path"))
+            throw new Exception("expected output not found");
+    }
+
+    @Test
+    public void testModuleNotInPackageHierarchy(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path m = src.resolve("m");
         Path extra = m.resolve("extra");
         tb.writeJavaFiles(extra, "module m {}");
         Path classes = base.resolve("classes");
diff --git a/langtools/test/tools/javac/modules/PatchModulesTest.java b/langtools/test/tools/javac/modules/PatchModulesTest.java
index dde0c53..6543c868 100644
--- a/langtools/test/tools/javac/modules/PatchModulesTest.java
+++ b/langtools/test/tools/javac/modules/PatchModulesTest.java
@@ -28,7 +28,7 @@
  * @library /tools/lib
  * @modules
  *      jdk.compiler/com.sun.tools.javac.api
- *      jdk.compiler/com.sun.tools.javac.file:+open
+ *      jdk.compiler/com.sun.tools.javac.file
  *      jdk.compiler/com.sun.tools.javac.main
  * @build toolbox.ToolBox toolbox.JavacTask toolbox.ModuleBuilder ModuleTestBase
  * @run main PatchModulesTest
@@ -38,21 +38,26 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
-import java.lang.reflect.Field;
+import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.AbstractMap.SimpleEntry;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeMap;
 import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
 
+import javax.tools.JavaFileManager.Location;
 import javax.tools.JavaFileObject;
 import javax.tools.ToolProvider;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
 
 import com.sun.source.util.JavacTask;
 import com.sun.tools.javac.api.JavacTool;
-import com.sun.tools.javac.file.BaseFileManager;
 import com.sun.tools.javac.file.JavacFileManager;
-import com.sun.tools.javac.file.Locations;
 
 import static java.util.Arrays.asList;
 
@@ -115,21 +120,29 @@
     void test(List<String> patches, boolean expectOK, String expect) throws Exception {
         JavacTool tool = (JavacTool) ToolProvider.getSystemJavaCompiler();
         StringWriter sw = new StringWriter();
-        try (PrintWriter pw = new PrintWriter(sw)) {
-            JavacFileManager fm = tool.getStandardFileManager(null, null, null);
+        try (PrintWriter pw = new PrintWriter(sw);
+            JavacFileManager fm = tool.getStandardFileManager(null, null, null)) {
             List<String> opts = patches.stream()
                 .map(p -> "--patch-module=" + p.replace(":", PS))
                 .collect(Collectors.toList());
             Iterable<? extends JavaFileObject> files = fm.getJavaFileObjects("C.java");
             JavacTask task = tool.getTask(pw, fm, null, opts, null, files);
 
-            Field locationsField = BaseFileManager.class.getDeclaredField("locations");
-            locationsField.setAccessible(true);
-            Object locations = locationsField.get(fm);
+            Map<String, List<Location>> mod2Location =
+                    StreamSupport.stream(fm.listLocationsForModules(StandardLocation.PATCH_MODULE_PATH)
+                                           .spliterator(),
+                                        false)
+                                 .flatMap(sl -> sl.stream())
+                                 .collect(Collectors.groupingBy(l -> fm.inferModuleName(l)));
 
-            Field patchMapField = Locations.class.getDeclaredField("patchMap");
-            patchMapField.setAccessible(true);
-            Map<?,?> patchMap = (Map<?,?>) patchMapField.get(locations);
+            Map<String, List<String>> patchMap = mod2Location.entrySet()
+                    .stream()
+                    .map(e -> new SimpleEntry<>(e.getKey(), e.getValue().get(0)))
+                    .map(e -> new SimpleEntry<>(e.getKey(), locationPaths(fm, e.getValue())))
+                    .collect(Collectors.toMap(Entry :: getKey,
+                                              Entry :: getValue,
+                                              (v1, v2) -> {throw new IllegalStateException();},
+                                              TreeMap::new));
             String found = patchMap.toString();
 
             if (!found.equals(expect)) {
@@ -150,5 +163,34 @@
             }
         }
     }
+
+    static List<String> locationPaths(StandardJavaFileManager fm, Location loc) {
+        return StreamSupport.stream(fm.getLocationAsPaths(loc).spliterator(), false)
+                            .map(p -> p.toString())
+                            .collect(Collectors.toList());
+    }
+
+    @Test
+    public void testPatchWithSource(Path base) throws Exception {
+        Path patch = base.resolve("patch");
+        tb.writeJavaFiles(patch, "package javax.lang.model.element; public interface Extra { }");
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                          "module m { requires java.compiler; }",
+                          "package test; public interface Test extends javax.lang.model.element.Extra { }");
+        Path classes = base.resolve("classes");
+        tb.createDirectories(classes);
+
+        new toolbox.JavacTask(tb)
+            .options("--patch-module", "java.compiler=" + patch.toString())
+            .outdir(classes)
+            .files(findJavaFiles(src))
+            .run()
+            .writeAll();
+
+        if (Files.exists(classes.resolve("javax"))) {
+            throw new AssertionError();
+        }
+    }
 }
 
diff --git a/langtools/test/tools/javac/modules/PoorChoiceForModuleNameTest.java b/langtools/test/tools/javac/modules/PoorChoiceForModuleNameTest.java
index 9bb8f15..cf9480c 100644
--- a/langtools/test/tools/javac/modules/PoorChoiceForModuleNameTest.java
+++ b/langtools/test/tools/javac/modules/PoorChoiceForModuleNameTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8160181
+ * @bug 8160181 8176572
  * @summary Add lint warning for digits in module names
  * @library /tools/lib
  * @modules
@@ -63,6 +63,22 @@
         Path src_m3 = src.resolve("mango100");
         tb.writeJavaFiles(src_m3, "@SuppressWarnings(\"module\") module mango100 { }");
 
+        // Check that there is no warning at use site.
+        Path src_m4 = src.resolve("mangouser");
+        tb.writeJavaFiles(src_m4, "module mangouser { requires mango19; }");
+
+        // Check that we warn about component names ending in digit also
+        Path src_m5 = src.resolve("mango1000.mangofruit.mangomodule");
+        tb.writeJavaFiles(src_m5, "module mango1000.mangofruit.mangomodule { }");
+
+        // Check that we warn about component names ending in digit also
+        Path src_m6 = src.resolve("mangofruit.mango1000.mangomodule");
+        tb.writeJavaFiles(src_m6, "module mangofruit.mango1000.mangomodule { }");
+
+        // Check that we warn about component names ending in digit also
+        Path src_m7 = src.resolve("mangomodule.mangofruit.mango1000");
+        tb.writeJavaFiles(src_m7, "module mangomodule.mangofruit.mango1000 { }");
+
         Path classes = base.resolve("classes");
         tb.createDirectories(classes);
 
@@ -78,9 +94,12 @@
                 .getOutput(Task.OutputKind.DIRECT);
 
         if (!log.contains("module-info.java:1:8: compiler.warn.poor.choice.for.module.name: mango19") ||
+            !log.contains("module-info.java:1:8: compiler.warn.poor.choice.for.module.name: mango1000") ||
+            !log.contains("module-info.java:1:18: compiler.warn.poor.choice.for.module.name: mango1000") ||
+            !log.contains("module-info.java:1:30: compiler.warn.poor.choice.for.module.name: mango1000") ||
             !log.contains("- compiler.err.warnings.and.werror") ||
             !log.contains("1 error") ||
-            !log.contains("1 warning"))
+            !log.contains("4 warning"))
             throw new Exception("expected output not found: " + log);
     }
 }
diff --git a/langtools/test/tools/javac/modules/ProvidesTest.java b/langtools/test/tools/javac/modules/ProvidesTest.java
index 0e92bb9..0701798 100644
--- a/langtools/test/tools/javac/modules/ProvidesTest.java
+++ b/langtools/test/tools/javac/modules/ProvidesTest.java
@@ -377,7 +377,7 @@
                 .writeAll()
                 .getOutputLines(Task.OutputKind.DIRECT);
 
-        List<String> expected = Arrays.asList("module-info.java:1:34: compiler.err.not.def.public.cant.access: p2.C2, p2",
+        List<String> expected = Arrays.asList("module-info.java:1:34: compiler.err.not.def.public: p2.C2, p2",
                 "1 error");
         if (!output.containsAll(expected)) {
             throw new Exception("Expected output not found");
diff --git a/langtools/test/tools/javac/modules/SourceInSymlinkTest.java b/langtools/test/tools/javac/modules/SourceInSymlinkTest.java
new file mode 100644
index 0000000..00fcb86
--- /dev/null
+++ b/langtools/test/tools/javac/modules/SourceInSymlinkTest.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8175990
+ * @summary source in symbolic link
+ * @library /tools/lib
+ * @modules
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask ModuleTestBase
+ * @run main SourceInSymlinkTest
+ */
+
+import java.nio.file.*;
+import javax.tools.*;
+
+import toolbox.JarTask;
+import toolbox.JavacTask;
+import toolbox.Task;
+import toolbox.ToolBox;
+
+public class SourceInSymlinkTest extends ModuleTestBase {
+    public static void main(String... args) throws Exception {
+        SourceInSymlinkTest t = new SourceInSymlinkTest();
+        t.runTests();
+    }
+
+    @Test
+    public void testModuleSourcePath(Path base) throws Exception {
+        Path src = base.resolve("src");
+        Path src_m = src.resolve("m");
+        tb.writeFile(src_m.resolve("module-info.java"), "module m { }");
+        tb.writeJavaFiles(src_m, "package p; public class A{}");
+
+        Path classes = base.resolve("classes");
+        Files.createDirectories(classes);
+
+        new JavacTask(tb)
+            .options("--module-source-path", src.toString())
+            .outdir(classes)
+            .files(src_m.resolve("p/A.java"))
+            .run()
+            .writeAll();
+
+        checkFiles(
+            classes.resolve("m/module-info.class"),
+            classes.resolve("m/p/A.class"));
+
+        // ok normal case works, now create a symlink to the source
+        Path lsrc = base.resolve("link");
+        Path lsrc_m = src.resolve("m");
+        Path lclasses = base.resolve("link-out");
+        Files.createDirectories(lclasses);
+        try {
+            Files.createSymbolicLink(lsrc, Paths.get("src"));
+        } catch (FileSystemException fse) {
+            System.err.println("warning: test passes vacuously, sym-link could not be created");
+            System.err.println(fse.getMessage());
+            return;
+        }
+        new JavacTask(tb)
+            .options("--module-source-path", lsrc.toString())
+            .outdir(lclasses)
+            .files(lsrc_m.resolve("p/A.java"))
+            .run()
+            .writeAll();
+
+        checkFiles(
+            lclasses.resolve("m/module-info.class"),
+            lclasses.resolve("m/p/A.class"));
+
+    }
+
+    void checkFiles(Path... files) throws Exception {
+        for (Path f: files) {
+            if (!Files.exists(f))
+                throw new Exception("expected file not found: " + f);
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/modules/WrongErrorMessageForNestedServiceProviderTest.java b/langtools/test/tools/javac/modules/WrongErrorMessageForNestedServiceProviderTest.java
new file mode 100644
index 0000000..096405b
--- /dev/null
+++ b/langtools/test/tools/javac/modules/WrongErrorMessageForNestedServiceProviderTest.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8174243
+ * @summary incorrect error message for nested service provider
+ * @library /tools/lib
+ * @modules
+ *      jdk.compiler/com.sun.tools.javac.api
+ *      jdk.compiler/com.sun.tools.javac.main
+ * @build toolbox.ToolBox toolbox.JavacTask ModuleTestBase
+ * @run main WrongErrorMessageForNestedServiceProviderTest
+ */
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.List;
+
+import toolbox.JavacTask;
+import toolbox.Task;
+import toolbox.ToolBox;
+
+public class WrongErrorMessageForNestedServiceProviderTest extends ModuleTestBase {
+    public static void main(String... args) throws Exception {
+        WrongErrorMessageForNestedServiceProviderTest t = new WrongErrorMessageForNestedServiceProviderTest();
+        t.runTests();
+    }
+
+    private static final String twoServicesModuleDef =
+            "module m {\n" +
+            "    exports example;\n" +
+            "    provides example.SomeService with example.ServiceImpl;\n" +
+            "    provides example.SomeServiceOuter with example.Outer.ServiceImplOuter;\n" +
+            "}";
+
+    private static final String someServiceInt =
+            "package example;\n" +
+            "public interface SomeService {\n" +
+            "    public void foo();\n" +
+            "}";
+
+    private static final String someServiceIntOuter =
+            "package example;\n" +
+            "public interface SomeServiceOuter {\n" +
+            "    public void foo();\n" +
+            "}";
+
+    @Test
+    public void testPositive(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                twoServicesModuleDef,
+                someServiceInt,
+                someServiceIntOuter,
+                "package example;\n" +
+                "public class ServiceImpl implements example.SomeService {\n" +
+                "    public ServiceImpl() {}\n" +
+                "    public void foo() {}\n" +
+                "}",
+
+                "package example;\n" +
+                "class Outer {\n" +
+                "    public static class ServiceImplOuter implements example.SomeServiceOuter {\n" +
+                "        public ServiceImplOuter() {}\n" +
+                "        public void foo() {}\n" +
+                "    }\n" +
+                "}");
+        Path classes = base.resolve("classes");
+        Files.createDirectories(classes);
+
+        List<String> output = new JavacTask(tb)
+                .outdir(classes)
+                .options("-Werror", "-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+        List<String> expected = Arrays.asList("");
+        if (!output.containsAll(expected)) {
+            throw new Exception("Expected output not found");
+        }
+    }
+
+    @Test
+    public void testNegative(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                twoServicesModuleDef,
+                someServiceInt,
+                someServiceIntOuter,
+
+                "package example;\n" +
+                "class ServiceImpl implements example.SomeService {\n" +
+                "    public ServiceImpl() {}\n" +
+                "    public void foo() {}\n" +
+                "}",
+
+                "package example;\n" +
+                "class Outer {\n" +
+                "    static class ServiceImplOuter implements example.SomeServiceOuter {\n" +
+                "        public ServiceImplOuter() {}\n" +
+                "        public void foo() {}\n" +
+                "    }\n" +
+                "}");
+        Path classes = base.resolve("classes");
+        Files.createDirectories(classes);
+
+        List<String> output = new JavacTask(tb)
+                .outdir(classes)
+                .options("-Werror", "-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.FAIL)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+        List<String> expected = Arrays.asList(
+                "module-info.java:3:46: compiler.err.not.def.public: example.ServiceImpl, example",
+                "module-info.java:4:57: compiler.err.not.def.public: example.Outer.ServiceImplOuter, example.Outer",
+                "2 errors");
+        if (!output.containsAll(expected)) {
+            throw new Exception("Expected output not found");
+        }
+    }
+
+    @Test
+    public void testClassWrappedByPrivateClass(Path base) throws Exception {
+        Path src = base.resolve("src");
+        tb.writeJavaFiles(src,
+                "module m {\n" +
+                "    exports example;\n" +
+                "    provides example.SomeServiceOuter with example.Outer1.Outer2.ServiceImplOuter;\n" +
+                "}",
+
+                someServiceIntOuter,
+
+                "package example;\n" +
+                "class Outer1 {\n" +
+                "    static private class Outer2 {\n" +
+                "        public static class ServiceImplOuter implements example.SomeServiceOuter {\n" +
+                "            public ServiceImplOuter() {}\n" +
+                "            public void foo() {}\n" +
+                "        }\n" +
+                "    }\n" +
+                "}");
+        Path classes = base.resolve("classes");
+        Files.createDirectories(classes);
+
+        List<String> output = new JavacTask(tb)
+                .outdir(classes)
+                .options("-Werror", "-XDrawDiagnostics")
+                .files(findJavaFiles(src))
+                .run(Task.Expect.SUCCESS)
+                .writeAll()
+                .getOutputLines(Task.OutputKind.DIRECT);
+        List<String> expected = Arrays.asList("");
+        if (!output.containsAll(expected)) {
+            throw new Exception("Expected output not found");
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/modules/XModuleTest.java b/langtools/test/tools/javac/modules/XModuleTest.java
deleted file mode 100644
index 2ddeacb..0000000
--- a/langtools/test/tools/javac/modules/XModuleTest.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary tests for multi-module mode compilation
- * @library /tools/lib
- * @modules
- *      jdk.compiler/com.sun.tools.javac.api
- *      jdk.compiler/com.sun.tools.javac.code
- *      jdk.compiler/com.sun.tools.javac.main
- *      jdk.compiler/com.sun.tools.javac.processing
- * @build toolbox.ToolBox toolbox.JavacTask toolbox.ModuleBuilder ModuleTestBase
- * @run main XModuleTest
- */
-
-import java.nio.file.Path;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-import javax.annotation.processing.AbstractProcessor;
-import javax.annotation.processing.RoundEnvironment;
-import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.lang.model.SourceVersion;
-import javax.lang.model.element.ModuleElement;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.util.Elements;
-
-import com.sun.tools.javac.code.Symtab;
-import com.sun.tools.javac.processing.JavacProcessingEnvironment;
-import toolbox.JavacTask;
-import toolbox.ModuleBuilder;
-import toolbox.Task;
-import toolbox.Task.Expect;
-
-public class XModuleTest extends ModuleTestBase {
-
-    public static void main(String... args) throws Exception {
-        new XModuleTest().runTests();
-    }
-
-    @Test
-    public void testCorrectXModule(Path base) throws Exception {
-        //note: avoiding use of java.base, as that gets special handling on some places:
-        Path src = base.resolve("src");
-        tb.writeJavaFiles(src, "package javax.lang.model.element; public interface Extra extends Element { }");
-        Path classes = base.resolve("classes");
-        tb.createDirectories(classes);
-
-        String log = new JavacTask(tb)
-                .options("-Xmodule:java.compiler")
-                .outdir(classes)
-                .files(findJavaFiles(src))
-                .run()
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-
-        if (!log.isEmpty())
-            throw new Exception("expected output not found: " + log);
-    }
-
-    @Test
-    public void testSourcePath(Path base) throws Exception {
-        //note: avoiding use of java.base, as that gets special handling on some places:
-        Path src = base.resolve("src");
-        tb.writeJavaFiles(src, "package javax.lang.model.element; public interface Extra extends Element, Other { }", "package javax.lang.model.element; interface Other { }");
-        Path classes = base.resolve("classes");
-        tb.createDirectories(classes);
-
-        String log = new JavacTask(tb)
-                .options("-Xmodule:java.compiler", "-sourcepath", src.toString())
-                .outdir(classes)
-                .files(src.resolve("javax/lang/model/element/Extra.java"))
-                .run()
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-
-        if (!log.isEmpty())
-            throw new Exception("expected output not found: " + log);
-    }
-
-    @Test
-    public void testClassPath(Path base) throws Exception {
-        Path cpSrc = base.resolve("cpSrc");
-        tb.writeJavaFiles(cpSrc, "package p; public interface Other { }");
-        Path cpClasses = base.resolve("cpClasses");
-        tb.createDirectories(cpClasses);
-
-        String cpLog = new JavacTask(tb)
-                .outdir(cpClasses)
-                .files(findJavaFiles(cpSrc))
-                .run()
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-
-        if (!cpLog.isEmpty())
-            throw new Exception("expected output not found: " + cpLog);
-
-        Path src = base.resolve("src");
-        //note: avoiding use of java.base, as that gets special handling on some places:
-        tb.writeJavaFiles(src, "package javax.lang.model.element; public interface Extra extends Element, p.Other { }");
-        Path classes = base.resolve("classes");
-        tb.createDirectories(classes);
-
-        List<String> log = new JavacTask(tb)
-                .options("-Xmodule:java.compiler",
-                         "--class-path", cpClasses.toString(),
-                         "-XDrawDiagnostics")
-                .outdir(classes)
-                .files(src.resolve("javax/lang/model/element/Extra.java"))
-                .run(Expect.FAIL)
-                .writeAll()
-                .getOutputLines(Task.OutputKind.DIRECT);
-
-        List<String> expectedOut = Arrays.asList(
-                "Extra.java:1:76: compiler.err.doesnt.exist: p",
-                "1 error"
-        );
-
-        if (!expectedOut.equals(log))
-            throw new Exception("expected output not found: " + log);
-    }
-
-    @Test
-    public void testNoModuleInfoOnSourcePath(Path base) throws Exception {
-        //note: avoiding use of java.base, as that gets special handling on some places:
-        Path src = base.resolve("src");
-        tb.writeJavaFiles(src,
-                          "module java.compiler {}",
-                          "package javax.lang.model.element; public interface Extra { }");
-        Path classes = base.resolve("classes");
-        tb.createDirectories(classes);
-
-        List<String> log = new JavacTask(tb)
-                .options("-XDrawDiagnostics", "-Xmodule:java.compiler")
-                .outdir(classes)
-                .files(findJavaFiles(src))
-                .run(Task.Expect.FAIL)
-                .writeAll()
-                .getOutputLines(Task.OutputKind.DIRECT);
-
-        List<String> expected = Arrays.asList("Extra.java:1:1: compiler.err.module-info.with.xmodule.sourcepath",
-                                              "1 error");
-
-        if (!expected.equals(log))
-            throw new Exception("expected output not found: " + log);
-    }
-
-    @Test
-    public void testNoModuleInfoInClassOutput(Path base) throws Exception {
-        //note: avoiding use of java.base, as that gets special handling on some places:
-        Path srcMod = base.resolve("src-mod");
-        tb.writeJavaFiles(srcMod,
-                          "module mod {}");
-        Path classes = base.resolve("classes");
-        tb.createDirectories(classes);
-
-        String logMod = new JavacTask(tb)
-                .options()
-                .outdir(classes)
-                .files(findJavaFiles(srcMod))
-                .run()
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-
-        if (!logMod.isEmpty())
-            throw new Exception("unexpected output found: " + logMod);
-
-        Path src = base.resolve("src");
-        tb.writeJavaFiles(src,
-                          "package javax.lang.model.element; public interface Extra { }");
-        tb.createDirectories(classes);
-
-        List<String> log = new JavacTask(tb)
-                .options("-XDrawDiagnostics", "-Xmodule:java.compiler")
-                .outdir(classes)
-                .files(findJavaFiles(src))
-                .run(Task.Expect.FAIL)
-                .writeAll()
-                .getOutputLines(Task.OutputKind.DIRECT);
-
-        List<String> expected = Arrays.asList("Extra.java:1:1: compiler.err.module-info.with.xmodule.classpath",
-                                              "1 error");
-
-        if (!expected.equals(log))
-            throw new Exception("expected output not found: " + log);
-    }
-
-    @Test
-    public void testModuleSourcePathXModule(Path base) throws Exception {
-        //note: avoiding use of java.base, as that gets special handling on some places:
-        Path src = base.resolve("src");
-        tb.writeJavaFiles(src, "package javax.lang.model.element; public interface Extra extends Element { }");
-        Path classes = base.resolve("classes");
-        tb.createDirectories(classes);
-
-        List<String> log = new JavacTask(tb)
-                .options("-XDrawDiagnostics", "-Xmodule:java.compiler", "--module-source-path", src.toString())
-                .outdir(classes)
-                .files(findJavaFiles(src))
-                .run(Task.Expect.FAIL)
-                .writeAll()
-                .getOutputLines(Task.OutputKind.DIRECT);
-
-        List<String> expected = Arrays.asList("- compiler.err.xmodule.no.module.sourcepath");
-
-        if (!expected.equals(log))
-            throw new Exception("expected output not found: " + log);
-    }
-
-    @Test
-    public void testXModuleTooMany(Path base) throws Exception {
-        //note: avoiding use of java.base, as that gets special handling on some places:
-        Path src = base.resolve("src");
-        tb.writeJavaFiles(src, "package javax.lang.model.element; public interface Extra extends Element { }");
-        Path classes = base.resolve("classes");
-        tb.createDirectories(classes);
-
-        List<String> log = new JavacTask(tb, Task.Mode.CMDLINE)
-                .options("-XDrawDiagnostics", "-Xmodule:java.compiler", "-Xmodule:java.compiler")
-                .outdir(classes)
-                .files(findJavaFiles(src))
-                .run(Task.Expect.FAIL)
-                .writeAll()
-                .getOutputLines(Task.OutputKind.DIRECT);
-
-        List<String> expected = Arrays.asList("javac: option -Xmodule: can only be specified once",
-                                              "Usage: javac <options> <source files>",
-                                              "use --help for a list of possible options");
-
-        if (!expected.equals(log))
-            throw new Exception("expected output not found: " + log);
-    }
-
-    @Test
-    public void testWithModulePath(Path base) throws Exception {
-        Path modSrc = base.resolve("modSrc");
-        Path modules = base.resolve("modules");
-        new ModuleBuilder(tb, "m1")
-                .classes("package pkg1; public interface E { }")
-                .build(modSrc, modules);
-
-        Path src = base.resolve("src");
-        tb.writeJavaFiles(src, "package p; interface A extends pkg1.E { }");
-
-        new JavacTask(tb, Task.Mode.CMDLINE)
-                .options("--module-path", modules.toString(),
-                        "-Xmodule:m1")
-                .files(findJavaFiles(src))
-                .run()
-                .writeAll();
-
-        //checks module bounds still exist
-        new ModuleBuilder(tb, "m2")
-                .classes("package pkg2; public interface D { }")
-                .build(modSrc, modules);
-
-        Path src2 = base.resolve("src2");
-        tb.writeJavaFiles(src2, "package p; interface A extends pkg2.D { }");
-
-        List<String> log = new JavacTask(tb, Task.Mode.CMDLINE)
-                .options("-XDrawDiagnostics",
-                        "--module-path", modules.toString(),
-                        "-Xmodule:m1")
-                .files(findJavaFiles(src2))
-                .run(Task.Expect.FAIL)
-                .writeAll()
-                .getOutputLines(Task.OutputKind.DIRECT);
-
-        List<String> expected = Arrays.asList("A.java:1:32: compiler.err.package.not.visible: pkg2, (compiler.misc.not.def.access.does.not.read: m1, pkg2, m2)",
-                "1 error");
-
-        if (!expected.equals(log))
-            throw new Exception("expected output not found: " + log);
-    }
-
-    @Test
-    public void testWithUpgradeModulePath(Path base) throws Exception {
-        Path modSrc = base.resolve("modSrc");
-        Path modules = base.resolve("modules");
-        new ModuleBuilder(tb, "m1")
-                .classes("package pkg1; public interface E { }")
-                .build(modSrc, modules);
-
-        Path upgrSrc = base.resolve("upgradeSrc");
-        Path upgrade = base.resolve("upgrade");
-        new ModuleBuilder(tb, "m1")
-                .classes("package pkg1; public interface D { }")
-                .build(upgrSrc, upgrade);
-
-        Path src = base.resolve("src");
-        tb.writeJavaFiles(src, "package p; interface A extends pkg1.D { }");
-
-        new JavacTask(tb, Task.Mode.CMDLINE)
-                .options("--module-path", modules.toString(),
-                        "--upgrade-module-path", upgrade.toString(),
-                        "-Xmodule:m1")
-                .files(findJavaFiles(src))
-                .run()
-                .writeAll();
-    }
-
-    @Test
-    public void testUnnamedIsolation(Path base) throws Exception {
-        //note: avoiding use of java.base, as that gets special handling on some places:
-        Path sourcePath = base.resolve("source-path");
-        tb.writeJavaFiles(sourcePath, "package src; public class Src {}");
-
-        Path classPathSrc = base.resolve("class-path-src");
-        tb.writeJavaFiles(classPathSrc, "package cp; public class CP { }");
-        Path classPath = base.resolve("classPath");
-        tb.createDirectories(classPath);
-
-        String cpLog = new JavacTask(tb)
-                .outdir(classPath)
-                .files(findJavaFiles(classPathSrc))
-                .run()
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-
-        if (!cpLog.isEmpty())
-            throw new Exception("expected output not found: " + cpLog);
-
-        Path modulePathSrc = base.resolve("module-path-src");
-        tb.writeJavaFiles(modulePathSrc,
-                          "module m {}",
-                          "package m; public class M {}");
-        Path modulePath = base.resolve("modulePath");
-        tb.createDirectories(modulePath.resolve("m"));
-
-        String modLog = new JavacTask(tb)
-                .outdir(modulePath.resolve("m"))
-                .files(findJavaFiles(modulePathSrc))
-                .run()
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-
-        if (!modLog.isEmpty())
-            throw new Exception("expected output not found: " + modLog);
-
-        Path src = base.resolve("src");
-        tb.writeJavaFiles(src, "package m; public class Extra { }");
-        Path classes = base.resolve("classes");
-        tb.createDirectories(classes);
-
-        String log = new JavacTask(tb)
-                .options("-Xmodule:m",
-                         "--class-path", classPath.toString(),
-                         "--source-path", sourcePath.toString(),
-                         "--module-path", modulePath.toString(),
-                         "--processor-path", System.getProperty("test.classes"),
-                         "-XDaccessInternalAPI=true",
-                         "-processor", CheckModuleContentProcessing.class.getName())
-                .outdir(classes)
-                .files(findJavaFiles(sourcePath))
-                .run()
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-
-        if (!log.isEmpty())
-            throw new Exception("expected output not found: " + log);
-    }
-
-    @SupportedAnnotationTypes("*")
-    public static final class CheckModuleContentProcessing extends AbstractProcessor {
-
-        @Override
-        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-            Symtab syms = Symtab.instance(((JavacProcessingEnvironment) processingEnv).getContext());
-            Elements elements = processingEnv.getElementUtils();
-            ModuleElement unnamedModule = syms.unnamedModule;
-            ModuleElement mModule = elements.getModuleElement("m");
-
-            assertNonNull("mModule found", mModule);
-            assertNonNull("src.Src from m", elements.getTypeElement(mModule, "src.Src"));
-            assertNull("cp.CP not from m", elements.getTypeElement(mModule, "cp.CP"));
-            assertNull("src.Src not from unnamed", elements.getTypeElement(unnamedModule, "src.Src"));
-            assertNonNull("cp.CP from unnamed", elements.getTypeElement(unnamedModule, "cp.CP"));
-
-            return false;
-        }
-
-        @Override
-        public SourceVersion getSupportedSourceVersion() {
-            return SourceVersion.latest();
-        }
-
-        private static void assertNonNull(String msg, Object val) {
-            if (val == null) {
-                throw new AssertionError(msg);
-            }
-        }
-
-        private static void assertNull(String msg, Object val) {
-            if (val != null) {
-                throw new AssertionError(msg);
-            }
-        }
-    }
-
-}
diff --git a/langtools/test/tools/javac/overload/T8176265.java b/langtools/test/tools/javac/overload/T8176265.java
new file mode 100644
index 0000000..ecd0147
--- /dev/null
+++ b/langtools/test/tools/javac/overload/T8176265.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176265
+ * @summary Method overload resolution on a covariant base type doesn't work in 9
+ * @compile T8176265.java
+ */
+
+class T8176265<T> {
+    static class Sup<E> { }
+    static class Sub<E> extends Sup<E> { }
+
+    void method(Sup<? super T> f) { }
+    void method(Sub<? super T> f) { }
+
+
+    static <Z> void m(T8176265<? extends Z> test, Sub<Z> sz) {
+        test.method(sz);
+    }
+}
diff --git a/langtools/test/tools/javac/processing/model/util/elements/TestAllFoos.java b/langtools/test/tools/javac/processing/model/util/elements/TestAllFoos.java
new file mode 100644
index 0000000..caff3b8
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/util/elements/TestAllFoos.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173945
+ * @summary Test Elements.getAll{Type, Package, Module}Elements
+ * @library /tools/javac/lib
+ * @modules java.compiler
+ *          jdk.compiler
+ * @build   JavacTestingAbstractProcessor TestAllFoos
+ * @compile -processor TestAllFoos -proc:only --release 8 --source-path modules/m1/pkg  modules/m1/pkg/C.java
+ * @compile -processor TestAllFoos -proc:only --release 8 --source-path modules/m2/pkg  modules/m2/pkg/C.java
+ */
+// @compile -processor TestAllFoos -proc:only             --module-source-path  modules -m m1,m2
+
+import java.util.Set;
+import static java.util.Objects.*;
+import javax.annotation.processing.*;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.element.*;
+import javax.lang.model.util.*;
+
+/**
+ * Test basic workings of Elements.getAll{Type, Package, Module}Elements under
+ * pre- and post-modules.
+ */
+public class TestAllFoos extends JavacTestingAbstractProcessor {
+    public boolean process(Set<? extends TypeElement> annotations,
+                           RoundEnvironment roundEnv) {
+        if (!roundEnv.processingOver()) {
+            boolean expectModules =
+                (processingEnv.getSourceVersion().compareTo(RELEASE_9) >= 0);
+
+            testSetSize(eltUtils.getAllTypeElements("java.lang.String"), 1);
+            testSetSize(eltUtils.getAllTypeElements("example.com"), 0);
+
+            if (!expectModules) {
+                // Expect empty modules set, single package named "pkg" with one type "pkg.C".
+                testSetSize(eltUtils.getAllModuleElements(), 0);
+                testSetSize(eltUtils.getAllPackageElements("pkg"), 1);
+                testSetSize(eltUtils.getAllTypeElements("pkg.C"),  1);
+            } else {
+                Set<? extends ModuleElement> modules =
+                    requireNonNull(eltUtils.getAllModuleElements());
+
+                ModuleElement m1 = requireNonNull(eltUtils.getModuleElement("m1"));
+                ModuleElement m2 = requireNonNull(eltUtils.getModuleElement("m2"));
+
+                if (!modules.contains(m1) ||
+                    !modules.contains(m2) ||
+                    !modules.contains(requireNonNull(eltUtils.getModuleElement("java.base"))))
+                    throw new RuntimeException("Missing modules " + modules);
+
+                // Expect two packages named "pkg" and two types named "pkg.C".
+                testSetSize(eltUtils.getAllPackageElements("pkg"), 2);
+                testSetSize(eltUtils.getAllTypeElements("pkg.C"),  2);
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Check the set argument against null and throw an exception if
+     * the set is not of the expected size.
+     */
+    private static <E> Set<E> testSetSize(Set<E> set, int expectedSize) {
+        requireNonNull(set);
+        if (set.size() != expectedSize)
+            throw new RuntimeException("Unexpected size of set " + set);
+        return set;
+    }
+}
diff --git a/langtools/test/tools/javac/processing/model/util/elements/modules/m1/module-info.java b/langtools/test/tools/javac/processing/model/util/elements/modules/m1/module-info.java
new file mode 100644
index 0000000..6897fc3
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/util/elements/modules/m1/module-info.java
@@ -0,0 +1,4 @@
+/* /nodynamiccopyright/ */
+
+module m1 {
+}
diff --git a/langtools/test/tools/javac/processing/model/util/elements/modules/m1/pkg/C.java b/langtools/test/tools/javac/processing/model/util/elements/modules/m1/pkg/C.java
new file mode 100644
index 0000000..17c3c1a
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/util/elements/modules/m1/pkg/C.java
@@ -0,0 +1,11 @@
+/* /nodynamiccopyright/ */
+
+package pkg;
+
+/**
+ * A lovely description of class C of package pkg in module m1.
+ */
+public class C {
+    public C() {}
+    public static String foo() {return "foo";}
+}
diff --git a/langtools/test/tools/javac/processing/model/util/elements/modules/m1/pkg/package-info.java b/langtools/test/tools/javac/processing/model/util/elements/modules/m1/pkg/package-info.java
new file mode 100644
index 0000000..969f9cf
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/util/elements/modules/m1/pkg/package-info.java
@@ -0,0 +1,6 @@
+/* /nodynamiccopyright/ */
+
+/**
+ * A lovely description of package pkg in module m1.
+ */
+package pkg;
diff --git a/langtools/test/tools/javac/processing/model/util/elements/modules/m2/module-info.java b/langtools/test/tools/javac/processing/model/util/elements/modules/m2/module-info.java
new file mode 100644
index 0000000..aa297e5
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/util/elements/modules/m2/module-info.java
@@ -0,0 +1,4 @@
+/* /nodynamiccopyright/ */
+
+module m2 {
+}
diff --git a/langtools/test/tools/javac/processing/model/util/elements/modules/m2/pkg/C.java b/langtools/test/tools/javac/processing/model/util/elements/modules/m2/pkg/C.java
new file mode 100644
index 0000000..d9f8660
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/util/elements/modules/m2/pkg/C.java
@@ -0,0 +1,11 @@
+/* /nodynamiccopyright/ */
+
+package pkg;
+
+/**
+ * A lovely description of class C of package pkg in module m2.
+ */
+public class C {
+    public C() {}
+    public static String bar() {return "bar";}
+}
diff --git a/langtools/test/tools/javac/processing/model/util/elements/modules/m2/pkg/package-info.java b/langtools/test/tools/javac/processing/model/util/elements/modules/m2/pkg/package-info.java
new file mode 100644
index 0000000..032700b
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/util/elements/modules/m2/pkg/package-info.java
@@ -0,0 +1,6 @@
+/* /nodynamiccopyright/ */
+
+/**
+ * A lovely description of package pkg in module m2.
+ */
+package pkg;
diff --git a/langtools/test/tools/javac/processing/model/util/types/TestPseudoTypeHandling.java b/langtools/test/tools/javac/processing/model/util/types/TestPseudoTypeHandling.java
new file mode 100644
index 0000000..5359d26
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/util/types/TestPseudoTypeHandling.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8175335
+ * @summary Test Types methods on module and package TypeMirrors
+ * @author  Joseph D. Darcy
+ * @library /tools/javac/lib
+ * @modules jdk.compiler
+ * @build   JavacTestingAbstractProcessor TestPseudoTypeHandling
+ * @compile -processor TestPseudoTypeHandling -proc:only TestPseudoTypeHandling.java
+ */
+
+import java.util.*;
+import java.util.function.*;
+import static java.util.Objects.*;
+import javax.annotation.processing.*;
+import javax.lang.model.element.*;
+import javax.lang.model.type.*;
+import javax.lang.model.util.*;
+
+/**
+ * Test basic handling of module type.
+ */
+public class TestPseudoTypeHandling extends JavacTestingAbstractProcessor {
+    public boolean process(Set<? extends TypeElement> annotations,
+                           RoundEnvironment roundEnv) {
+        if (!roundEnv.processingOver()) {
+            TypeMirror objectType  = requireNonNull(eltUtils.getTypeElement("java.lang.Object")).asType();
+
+            List<TypeMirror> typeMirrorsToTest =
+                List.of(requireNonNull(eltUtils.getModuleElement("java.base")).asType(),
+                        requireNonNull(eltUtils.getPackageElement("java.lang")).asType());
+
+            for (TypeMirror type : typeMirrorsToTest) {
+                expectException(t -> typeUtils.isSubtype(t, objectType), type);
+                expectException(t -> typeUtils.isSubtype(objectType, t), type);
+
+                expectException(t -> typeUtils.isAssignable(t, objectType), type);
+                expectException(t -> typeUtils.isAssignable(objectType, t), type);
+
+                expectException(t -> typeUtils.contains(t, objectType), type);
+                expectException(t -> typeUtils.contains(objectType, t), type);
+
+                expectException(t -> typeUtils.capture(t), type);
+                expectException(t -> typeUtils.erasure(t), type);
+
+                expectException(t -> typeUtils.getArrayType(t), type);
+
+                expectException(t -> typeUtils.directSupertypes(t), type);
+            }
+        }
+        return true;
+    }
+
+    void expectException(Consumer<TypeMirror> argument, TypeMirror type) {
+        try {
+            argument.accept(type);
+            throw new RuntimeException("Should not reach " + type.toString());
+        } catch (IllegalArgumentException e) {
+            ; // Expected
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/redefineObject/Object1-test.java b/langtools/test/tools/javac/redefineObject/Object1-test.java
index a654ece..dae9667 100644
--- a/langtools/test/tools/javac/redefineObject/Object1-test.java
+++ b/langtools/test/tools/javac/redefineObject/Object1-test.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,6 @@
  * @summary java.lang.Object can't be redefined without crashing javac
  * @author gafter
  *
- * @compile/module=java.base/fail/ref=Object1.out -XDrawDiagnostics Object1.java
+ * @compile/module=java.base/fail/ref=Object1.out -XDrawDiagnostics java/lang/Object1.java
  */
 
diff --git a/langtools/test/tools/javac/redefineObject/Object2-test.java b/langtools/test/tools/javac/redefineObject/Object2-test.java
index 59eb4b6..8eb033b 100644
--- a/langtools/test/tools/javac/redefineObject/Object2-test.java
+++ b/langtools/test/tools/javac/redefineObject/Object2-test.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,5 +27,5 @@
  * @summary java.lang.Object can't be redefined without crashing javac
  * @author gafter
  *
- * @compile/module=java.base/fail/ref=Object2.out -XDrawDiagnostics  Object2.java
+ * @compile/module=java.base/fail/ref=Object2.out -XDrawDiagnostics java/lang/Object2.java
  */
diff --git a/langtools/test/tools/javac/redefineObject/java.base/Object1.java b/langtools/test/tools/javac/redefineObject/java.base/java/lang/Object1.java
similarity index 100%
rename from langtools/test/tools/javac/redefineObject/java.base/Object1.java
rename to langtools/test/tools/javac/redefineObject/java.base/java/lang/Object1.java
diff --git a/langtools/test/tools/javac/redefineObject/java.base/Object2.java b/langtools/test/tools/javac/redefineObject/java.base/java/lang/Object2.java
similarity index 100%
rename from langtools/test/tools/javac/redefineObject/java.base/Object2.java
rename to langtools/test/tools/javac/redefineObject/java.base/java/lang/Object2.java
diff --git a/langtools/test/tools/javac/synthesize/Main.java b/langtools/test/tools/javac/synthesize/Main.java
index d92cff2..bf430b8 100644
--- a/langtools/test/tools/javac/synthesize/Main.java
+++ b/langtools/test/tools/javac/synthesize/Main.java
@@ -92,12 +92,17 @@
         File empty = new File("empty");
         empty.mkdirs();
 
+        // files to compile are in a separate directory from test to avoid
+        // confusing jtreg
+        File src = new File(testSrc, "src");
+
         List<String> args = new ArrayList<String>();
         args.add("-classpath");
         args.add("empty");
 
         if (stdBootClassPath) {
-            args.add("-Xmodule:java.base");
+            args.add("--patch-module");
+            args.add("java.base=" + testSrc.getAbsolutePath());
         } else {
             args.add("--system");
             args.add("none");
@@ -108,9 +113,6 @@
         args.add("-d");
         args.add(".");
 
-        // files to compile are in a separate directory from test to avoid
-        // confusing jtreg
-        File src = new File(testSrc, "src");
         for (String f: files)
             args.add(new File(src, f).getPath());
 
diff --git a/langtools/test/tools/javac/tree/JavacTreeScannerTest.java b/langtools/test/tools/javac/tree/JavacTreeScannerTest.java
index b111d18..66189f1 100644
--- a/langtools/test/tools/javac/tree/JavacTreeScannerTest.java
+++ b/langtools/test/tools/javac/tree/JavacTreeScannerTest.java
@@ -41,7 +41,7 @@
  *          jdk.compiler/com.sun.tools.javac.tree
  *          jdk.compiler/com.sun.tools.javac.util
  * @build AbstractTreeScannerTest JavacTreeScannerTest
- * @run main JavacTreeScannerTest -q -r .
+ * @run main/othervm JavacTreeScannerTest -q -r .
  */
 
 import java.io.*;
diff --git a/langtools/test/tools/javac/tree/SourceTreeScannerTest.java b/langtools/test/tools/javac/tree/SourceTreeScannerTest.java
index c272425..b08b36b 100644
--- a/langtools/test/tools/javac/tree/SourceTreeScannerTest.java
+++ b/langtools/test/tools/javac/tree/SourceTreeScannerTest.java
@@ -41,7 +41,7 @@
  *          jdk.compiler/com.sun.tools.javac.tree
  *          jdk.compiler/com.sun.tools.javac.util
  * @build AbstractTreeScannerTest SourceTreeScannerTest
- * @run main SourceTreeScannerTest -q -r .
+ * @run main/othervm SourceTreeScannerTest -q -r .
  */
 
 import java.io.*;
diff --git a/langtools/test/tools/javac/tree/TestPrettyDocComment.java b/langtools/test/tools/javac/tree/TestPrettyDocComment.java
new file mode 100644
index 0000000..52b9b0a
--- /dev/null
+++ b/langtools/test/tools/javac/tree/TestPrettyDocComment.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8176470
+ * @summary javac Pretty printer should include doc comment for modules
+ * @modules jdk.compiler
+ * @library /tools/lib
+ * @build toolbox.TestRunner
+ * @run main TestPrettyDocComment
+ */
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.List;
+
+import javax.tools.JavaFileObject;
+import javax.tools.JavaCompiler;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.util.JavacTask;
+
+import toolbox.TestRunner;
+
+public class TestPrettyDocComment extends TestRunner {
+
+    public static void main(String... args) throws Exception {
+        TestPrettyDocComment t = new TestPrettyDocComment();
+        t.runTests();
+    }
+
+    final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+
+    TestPrettyDocComment() {
+        super(System.err);
+    }
+
+    @Test
+    public void testModule() throws IOException {
+        test("module-info.java", "/** This is a module. */ module m { }");
+    }
+
+    @Test
+    public void testPackage() throws IOException {
+        test("package-info.java", "/** This is a package. */ package p;");
+    }
+
+    @Test
+    public void testClass() throws IOException {
+        test("C.java", "/** This is a class. */ class C { }");
+    }
+
+    @Test
+    public void testField() throws IOException {
+        test("C.java", "class C { /** This is a field. */ int f; }");
+    }
+
+    @Test
+    public void testMethod() throws IOException {
+        test("C.java", "class C { /** This is a method. */ void m() { } }");
+    }
+
+    void test(String name, String source) throws IOException {
+        JavaFileObject fo = new JavaSource(name, source);
+        StringWriter log = new StringWriter();
+        JavacTask t = (JavacTask) tool.getTask(log, null, null, null, null, List.of(fo));
+        Iterable<? extends CompilationUnitTree> trees = t.parse();
+        String out = log.toString();
+        if (!out.isEmpty()) {
+            System.err.println(log);
+        }
+        String pretty = trees.iterator().next().toString();
+        System.err.println("Pretty: <<<");
+        System.err.println(pretty);
+        System.err.println(">>>");
+
+        String commentText = source.replaceAll(".*\\Q/**\\E (.*) \\Q*/\\E.*", "$1");
+        if (!pretty.contains(commentText)) {
+            error("expected text not found: " + commentText);
+        }
+    }
+
+    static class JavaSource extends SimpleJavaFileObject {
+        final String source;
+
+        public JavaSource(String name, String source) {
+            super(URI.create("myfo:/" + name), JavaFileObject.Kind.SOURCE);
+            this.source = source;
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/tree/TreePosTest.java b/langtools/test/tools/javac/tree/TreePosTest.java
index 835531f..ffd0190 100644
--- a/langtools/test/tools/javac/tree/TreePosTest.java
+++ b/langtools/test/tools/javac/tree/TreePosTest.java
@@ -108,7 +108,7 @@
  *          jdk.compiler/com.sun.tools.javac.file
  *          jdk.compiler/com.sun.tools.javac.tree
  *          jdk.compiler/com.sun.tools.javac.util
- * @run main TreePosTest -q -r .
+ * @run main/othervm TreePosTest -q -r .
  */
 public class TreePosTest {
     /**
@@ -281,7 +281,7 @@
         JavacTool tool = JavacTool.create();
         r.errors = 0;
         Iterable<? extends JavaFileObject> files = fm.getJavaFileObjects(file);
-        JavacTask task = tool.getTask(pw, fm, r, Collections.<String>emptyList(), null, files);
+        JavacTask task = tool.getTask(pw, fm, r, List.of("-proc:none"), null, files);
         Iterable<? extends CompilationUnitTree> trees = task.parse();
         pw.flush();
         if (r.errors > 0)
diff --git a/langtools/test/tools/javac/treeannotests/TestProcessor.java b/langtools/test/tools/javac/treeannotests/TestProcessor.java
index 99fd780..2bc6d7e 100644
--- a/langtools/test/tools/javac/treeannotests/TestProcessor.java
+++ b/langtools/test/tools/javac/treeannotests/TestProcessor.java
@@ -21,8 +21,6 @@
  * questions.
  */
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.io.*;
 import java.util.*;
 import javax.annotation.processing.*;
diff --git a/langtools/test/tools/javac/varargs/7043922/T7043922.java b/langtools/test/tools/javac/varargs/7043922/T7043922.java
index b9624d0..5fc83af 100644
--- a/langtools/test/tools/javac/varargs/7043922/T7043922.java
+++ b/langtools/test/tools/javac/varargs/7043922/T7043922.java
@@ -28,6 +28,7 @@
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.file
  *          jdk.compiler/com.sun.tools.javac.util
+ * @run main/othervm T7043922
  */
 
 import com.sun.source.util.JavacTask;
diff --git a/langtools/test/tools/javac/warnings/VerifyLintDescriptions.java b/langtools/test/tools/javac/warnings/VerifyLintDescriptions.java
index 04aaa84..54472a3 100644
--- a/langtools/test/tools/javac/warnings/VerifyLintDescriptions.java
+++ b/langtools/test/tools/javac/warnings/VerifyLintDescriptions.java
@@ -30,8 +30,6 @@
  *          jdk.compiler/com.sun.tools.javac.util
  */
 
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
@@ -42,7 +40,7 @@
 
 public class VerifyLintDescriptions {
     public static void main(String... args) {
-        Layer boot = Layer.boot();
+        ModuleLayer boot = ModuleLayer.boot();
         Module jdk_compiler = boot.findModule("jdk.compiler").get();
         ResourceBundle b = ResourceBundle.getBundle("com.sun.tools.javac.resources.javac",
                                                     Locale.US,
diff --git a/langtools/test/tools/javadoc/CheckResourceKeys.java b/langtools/test/tools/javadoc/CheckResourceKeys.java
index 70a705e..aafd039 100644
--- a/langtools/test/tools/javadoc/CheckResourceKeys.java
+++ b/langtools/test/tools/javadoc/CheckResourceKeys.java
@@ -32,8 +32,6 @@
  */
 
 import java.io.*;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
 import java.util.*;
 import javax.tools.*;
 import com.sun.tools.classfile.*;
@@ -229,7 +227,7 @@
      * Get the set of keys from the javadoc resource bundles.
      */
     Set<String> getResourceKeys() {
-        Module jdk_javadoc = Layer.boot().findModule("jdk.javadoc").get();
+        Module jdk_javadoc = ModuleLayer.boot().findModule("jdk.javadoc").get();
         String[] names = {
                 "com.sun.tools.doclets.formats.html.resources.standard",
                 "com.sun.tools.doclets.internal.toolkit.resources.doclets",
diff --git a/langtools/test/tools/javadoc/sampleapi/SampleApiTest.java b/langtools/test/tools/javadoc/sampleapi/SampleApiTest.java
index 149d347c..c344895 100644
--- a/langtools/test/tools/javadoc/sampleapi/SampleApiTest.java
+++ b/langtools/test/tools/javadoc/sampleapi/SampleApiTest.java
@@ -30,6 +30,8 @@
  *          jdk.compiler/com.sun.tools.javac.parser
  *          jdk.compiler/com.sun.tools.javac.tree
  *          jdk.compiler/com.sun.tools.javac.util
+ *          jdk.javadoc/jdk.javadoc.internal.tool
+ * @build sampleapi.SampleApiDefaultRunner
  * @run main SampleApiTest
  */
 
diff --git a/langtools/test/tools/javadoc/sampleapi/res/fx.xml b/langtools/test/tools/javadoc/sampleapi/res/fx.xml
index 3416730..abdbe70 100644
--- a/langtools/test/tools/javadoc/sampleapi/res/fx.xml
+++ b/langtools/test/tools/javadoc/sampleapi/res/fx.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -21,25 +21,29 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
-<package name="sampleapi.fx" style="fx">
-
-    <class basename="FXClass">
-        <modifier>public</modifier>
-        <member>
-            <field basename="id">
+<sampleapi>
+    <module name="UNNAMED">
+        <package name="sampleapi.fx" style="fx">
+            <class basename="FXClass">
                 <modifier>public</modifier>
-                <type>int|boolean</type>
-            </field>
-            <method basename="setProp">
-                <modifier>public|protected|private</modifier>
-                <param>int|String</param>
-                <type>void</type>
-            </method>
-            <method basename="getProp">
-                <modifier>public|protected|private</modifier>
-                <type>int|int|String</type>
-            </method>
-        </member>
-    </class>
+                <member>
+                    <field basename="id">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </field>
+                    <method basename="setProp">
+                        <modifier>public|protected|private</modifier>
+                        <param>int|String</param>
+                        <type>void</type>
+                    </method>
+                    <method basename="getProp">
+                        <modifier>public|protected|private</modifier>
+                        <type>int|int|String</type>
+                    </method>
+                </member>
+            </class>
 
-</package>
+        </package>
+    </module>
+</sampleapi>
+
diff --git a/langtools/test/tools/javadoc/sampleapi/res/simple.xml b/langtools/test/tools/javadoc/sampleapi/res/simple.xml
index b5a4915..1717c1c 100644
--- a/langtools/test/tools/javadoc/sampleapi/res/simple.xml
+++ b/langtools/test/tools/javadoc/sampleapi/res/simple.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -21,509 +21,514 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
-<package name="sampleapi.simple">
+<sampleapi>
+    <module name="UNNAMED">
+        <package name="sampleapi.simple">
 
-    <class basename="SampleClass" id="baseclass">
-        <modifier>public</modifier>
-        <modifier>none|abstract</modifier>
-        <member>
-            <field basename="field">
-                <modifier>none|public</modifier>
-                <modifier>none|static</modifier>
-                <modifier>none|final</modifier>
-                <type>boolean|int|String</type>
-            </field>
-            <field basename="field">
-                <modifier>protected|private</modifier>
-                <type>String</type>
-            </field>
-            <constructor>
+            <class basename="SampleClass" id="baseclass">
                 <modifier>public</modifier>
-                <param>none|int|int,boolean|int,String</param>
-            </constructor>
-            <constructor>
-                <modifier>public</modifier>
-                <param>String</param>
-                <throw>NullPointerException</throw>
-                <throw>SampleException0</throw>
-            </constructor>
-            <method basename="set">
-                <modifier>public</modifier>
-                <type>void</type>
-                <param>int</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>int|boolean|String</type>
-            </method>
-            <method basename="doSomething">
-                <modifier>public</modifier>
-                <type>void|int</type>
-                <param>none|int|Object,int</param>
-                <throw>NullPointerException</throw>
-                <throw>ArithmeticException</throw>
-            </method>
-        </member>
-    </class>
-
-    <class basename="Derived">
-        <modifier>public</modifier>
-        <extend id="baseclass"/>
-        <member>
-            <field basename="myField">
-                <modifier>public</modifier>
-                <type>int|boolean</type>
-            </field>
-            <constructor>
-                <modifier>public</modifier>
-                <param>none|int|int,boolean|int,String</param>
-            </constructor>
-            <method basename="myGet">
-                <modifier>public</modifier>
-                <type>int|boolean</type>
-            </method>
-        </member>
-    </class>
-
-    <class basename="SampleSerial">
-        <import>java.io.Serializable</import>
-        <modifier>public</modifier>
-        <implement ref="Serializable"/>
-        <member>
-            <field basename="specialData">
-                <modifier>private|none|public</modifier>
-                <type>boolean|int|String</type>
-            </field>
-        </member>
-    </class>
-
-    <class basename="SampleSerial">
-        <import>java.io.Serializable</import>
-        <import>java.io.ObjectStreamField</import>
-        <modifier>public</modifier>
-        <implement ref="Serializable"/>
-        <member>
-            <serialfield basename="serialField">String,Long,Boolean</serialfield>
-            <method basename="justToBeHere">
-                <modifier>public</modifier>
-                <type>String|long|boolean</type>
-            </method>
-        </member>
-    </class>
-
-    <class basename="SampleSerial">
-        <import>java.io.Serializable</import>
-        <import>java.io.ObjectOutputStream</import>
-        <import>java.io.ObjectOutput</import>
-        <import>java.io.IOException</import>
-        <import>java.io.ObjectStreamException</import>
-        <modifier>public</modifier>
-        <implement ref="Serializable"/>
-        <member>
-            <method name="writeObject">
-                <modifier>private</modifier>
-                <param>ObjectOutputStream</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-            <method name="writeExternal">
-                <modifier>public</modifier>
-                <param>ObjectOutput</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-            <method name="writeReplace">
-                <modifier>protected</modifier>
-                <param>none</param>
-                <type>Object</type>
-                <throw>ObjectStreamException</throw>
-            </method>
-            <method name="writeSomethingElse">
-                <modifier>public</modifier>
-                <param>Object</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-        </member>
-    </class>
-
-    <class basename="SampleSerial">
-        <import>java.io.Serializable</import>
-        <import>java.io.ObjectInputStream</import>
-        <import>java.io.ObjectInput</import>
-        <import>java.io.IOException</import>
-        <import>java.io.ObjectStreamException</import>
-        <modifier>public</modifier>
-        <implement ref="Serializable"/>
-        <member>
-            <method name="readObject">
-                <modifier>private</modifier>
-                <param>ObjectInputStream</param>
-                <type>void</type>
-                <throw>IOException</throw>
-                <throw>ClassNotFoundException</throw>
-            </method>
-            <method name="readExternal">
-                <modifier>public</modifier>
-                <param>ObjectInput</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-            <method name="readResolve">
-                <modifier>protected</modifier>
-                <param>none</param>
-                <type>Object</type>
-                <throw>ObjectStreamException</throw>
-            </method>
-            <method name="readSomethingElse">
-                <modifier>public</modifier>
-                <param>Object</param>
-                <type>void</type>
-                <throw>IOException</throw>
-            </method>
-        </member>
-    </class>
-
-    <class basename="Container">
-        <modifier>public</modifier>
-        <member>
-            <class basename="Inner">
-                <modifier>public</modifier>
+                <modifier>none|abstract</modifier>
                 <member>
-                    <field basename="value">
+                    <field basename="field">
+                        <modifier>none|public</modifier>
+                        <modifier>none|static</modifier>
+                        <modifier>none|final</modifier>
+                        <type>boolean|int|String</type>
+                    </field>
+                    <field basename="field">
+                        <modifier>protected|private</modifier>
+                        <type>String</type>
+                    </field>
+                    <constructor>
                         <modifier>public</modifier>
-                        <type>int</type>
+                        <param>none|int|int,boolean|int,String</param>
+                    </constructor>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>String</param>
+                        <throw>NullPointerException</throw>
+                        <throw>SampleException0</throw>
+                    </constructor>
+                    <method basename="set">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>int</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>int|boolean|String</type>
+                    </method>
+                    <method basename="doSomething">
+                        <modifier>public</modifier>
+                        <type>void|int</type>
+                        <param>none|int|Object,int</param>
+                        <throw>NullPointerException</throw>
+                        <throw>ArithmeticException</throw>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="Derived">
+                <modifier>public</modifier>
+                <extend id="baseclass"/>
+                <member>
+                    <field basename="myField">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </field>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>none|int|int,boolean|int,String</param>
+                    </constructor>
+                    <method basename="myGet">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="SampleSerial">
+                <import>java.io.Serializable</import>
+                <modifier>public</modifier>
+                <implement ref="Serializable"/>
+                <member>
+                    <field basename="specialData">
+                        <modifier>private|none|public</modifier>
+                        <type>boolean|int|String</type>
                     </field>
                 </member>
             </class>
-            <class basename="Nested">
+
+            <class basename="SampleSerial">
+                <import>java.io.Serializable</import>
+                <import>java.io.ObjectStreamField</import>
                 <modifier>public</modifier>
-                <modifier>static</modifier>
-            </class>
-            <interface basename="EventListener">
-                <modifier>public</modifier>
-                <modifier>static</modifier>
+                <implement ref="Serializable"/>
                 <member>
-                    <method basename="onEvent">
-                         <modifier>public</modifier>
-                         <type>void</type>
+                    <serialfield basename="serialField">String,Long,Boolean</serialfield>
+                    <method basename="justToBeHere">
+                        <modifier>public</modifier>
+                        <type>String|long|boolean</type>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="SampleSerial">
+                <import>java.io.Serializable</import>
+                <import>java.io.ObjectOutputStream</import>
+                <import>java.io.ObjectOutput</import>
+                <import>java.io.IOException</import>
+                <import>java.io.ObjectStreamException</import>
+                <modifier>public</modifier>
+                <implement ref="Serializable"/>
+                <member>
+                    <method name="writeObject">
+                        <modifier>private</modifier>
+                        <param>ObjectOutputStream</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                    <method name="writeExternal">
+                        <modifier>public</modifier>
+                        <param>ObjectOutput</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                    <method name="writeReplace">
+                        <modifier>protected</modifier>
+                        <param>none</param>
+                        <type>Object</type>
+                        <throw>ObjectStreamException</throw>
+                    </method>
+                    <method name="writeSomethingElse">
+                        <modifier>public</modifier>
+                        <param>Object</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="SampleSerial">
+                <import>java.io.Serializable</import>
+                <import>java.io.ObjectInputStream</import>
+                <import>java.io.ObjectInput</import>
+                <import>java.io.IOException</import>
+                <import>java.io.ObjectStreamException</import>
+                <modifier>public</modifier>
+                <implement ref="Serializable"/>
+                <member>
+                    <method name="readObject">
+                        <modifier>private</modifier>
+                        <param>ObjectInputStream</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                        <throw>ClassNotFoundException</throw>
+                    </method>
+                    <method name="readExternal">
+                        <modifier>public</modifier>
+                        <param>ObjectInput</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                    <method name="readResolve">
+                        <modifier>protected</modifier>
+                        <param>none</param>
+                        <type>Object</type>
+                        <throw>ObjectStreamException</throw>
+                    </method>
+                    <method name="readSomethingElse">
+                        <modifier>public</modifier>
+                        <param>Object</param>
+                        <type>void</type>
+                        <throw>IOException</throw>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="Container">
+                <modifier>public</modifier>
+                <member>
+                    <class basename="Inner">
+                        <modifier>public</modifier>
+                        <member>
+                            <field basename="value">
+                                <modifier>public</modifier>
+                                <type>int</type>
+                            </field>
+                        </member>
+                    </class>
+                    <class basename="Nested">
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                    </class>
+                    <interface basename="EventListener">
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                        <member>
+                            <method basename="onEvent">
+                                <modifier>public</modifier>
+                                <type>void</type>
+                            </method>
+                        </member>
+                    </interface>
+                </member>
+            </class>
+
+            <!-- Errors and exceptions -->
+            <class basename="SampleError">
+                <modifier>public</modifier>
+                <extend ref="java.lang.Error"/>
+                <member>
+                    <field basename="errorInfo">
+                        <modifier>private</modifier>
+                        <type>boolean|int|String</type>
+                    </field>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>String</param>
+                    </constructor>
+                    <method basename="getSampleData">
+                        <modifier>public</modifier>
+                        <type>int|String</type>
+                    </method>
+                </member>
+            </class>
+
+            <class basename="SampleException">
+                <modifier>public</modifier>
+                <extend ref="java.lang.Exception"/>
+                <member>
+                    <field basename="exceptionInfo">
+                        <modifier>private</modifier>
+                        <type>boolean|int|String</type>
+                    </field>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>String</param>
+                    </constructor>
+                    <method basename="getSampleData">
+                        <modifier>public</modifier>
+                        <type>int|String</type>
+                    </method>
+                </member>
+            </class>
+
+            <interface basename="SampleInterface" id="baseinterface">
+                <modifier>public|none</modifier>
+                <member>
+                    <method basename="method">
+                        <modifier>public</modifier>
+                        <type>void|int|Object</type>
                     </method>
                 </member>
             </interface>
-        </member> 
-    </class>
 
-    <!-- Errors and exceptions -->
-    <class basename="SampleError">
-        <modifier>public</modifier>
-        <extend ref="java.lang.Error"/>
-        <member>
-            <field basename="errorInfo">
-                <modifier>private</modifier>
-                <type>boolean|int|String</type>
-            </field>
-            <constructor>
+            <class basename="Implementor">
                 <modifier>public</modifier>
-                <param>String</param>
-            </constructor>
-            <method basename="getSampleData">
-                <modifier>public</modifier>
-                <type>int|String</type>
-            </method>
-        </member>
-    </class>
+                <implement id="baseinterface"/>
+                <member>
+                    <field basename="myField">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </field>
+                    <method basename="myGet">
+                        <modifier>public</modifier>
+                        <type>int|boolean</type>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="SampleException">
-        <modifier>public</modifier>
-        <extend ref="java.lang.Exception"/>
-        <member>
-            <field basename="exceptionInfo">
-                <modifier>private</modifier>
-                <type>boolean|int|String</type>
-            </field>
-            <constructor>
+            <class basename="GenericClass" tparam="T">
+                <import>java.util.List</import>
                 <modifier>public</modifier>
-                <param>String</param>
-            </constructor>
-            <method basename="getSampleData">
-                <modifier>public</modifier>
-                <type>int|String</type>
-            </method>
-        </member>
-    </class>
+                <member>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>T</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>T</type>
+                        <param>int</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>List&lt;T&gt;</type>
+                    </method>
+                </member>
+            </class>
 
-    <interface basename="SampleInterface" id="baseinterface">
-        <modifier>public|none</modifier>
-        <member>
-            <method basename="method">
+            <class basename="GenericClass" tparam="K,V">
+                <import>java.util.Set</import>
+                <import>java.util.List</import>
+                <import>java.util.Map</import>
                 <modifier>public</modifier>
-                <type>void|int|Object</type>
-            </method>
-        </member>
-    </interface>
+                <member>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>K,V</param>
+                    </method>
+                    <method basename="putMap">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>Map&lt;K,V&gt;</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>V</type>
+                        <param>K</param>
+                    </method>
+                    <method basename="getV">
+                        <modifier>public</modifier>
+                        <type>Set&lt;V&gt;|List&lt;V&gt;</type>
+                    </method>
+                    <method basename="getK">
+                        <modifier>public</modifier>
+                        <type>Set&lt;K&gt;|List&lt;K&gt;</type>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="Implementor">
-        <modifier>public</modifier>
-        <implement id="baseinterface"/>
-        <member>
-            <field basename="myField">
+            <class basename="GenericClass" tparam="M,N,O">
+                <import>java.util.Set</import>
+                <import>java.util.List</import>
+                <import>java.util.Map</import>
                 <modifier>public</modifier>
-                <type>int|boolean</type>
-            </field>
-            <method basename="myGet">
-                <modifier>public</modifier>
-                <type>int|boolean</type>
-            </method>
-        </member>
-    </class>
+                <member>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>Set&lt;M&gt;|List&lt;M&gt;</type>
+                        <param>Map&lt;N,O&gt;</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>Set&lt;N&gt;|List&lt;N&gt;</type>
+                        <param>Map&lt;M,O&gt;</param>
+                    </method>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>Set&lt;O&gt;|List&lt;O&gt;</type>
+                        <param>Map&lt;M,N&gt;</param>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="GenericClass" tparam="T">
-        <import>java.util.List</import>
-        <modifier>public</modifier>
-        <member>
-            <method basename="put">
+            <class basename="GenericUtil"> <!-- public static generic methods like Collections -->
+                <import>java.util.Set</import>
+                <import>java.util.List</import>
+                <import>java.util.Map</import>
+                <import>java.util.function.Supplier</import>
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>T</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>T</type>
-                <param>int</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>List&lt;T&gt;</type>
-            </method>
-        </member>
-    </class>
+                <member>
+                    <method tparam="E" basename="getSomething">
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                        <type>Set&lt;? extends E&gt;|List&lt;? extends E&gt;</type>
+                    </method>
+                    <method tparam="V,K" basename="getMore">
+                        <modifier>public|private</modifier>
+                        <modifier>static</modifier>
+                        <type>Map&lt;V,K&gt;</type>
+                    </method>
+                    <method tparam="E" basename="doSomething">
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                        <type>void</type>
+                        <param>E</param>
+                    </method>
+                    <method tparam="X extends Throwable" basename="orElseThrow">
+                        <modifier>public|private</modifier>
+                        <modifier>static</modifier>
+                        <type>X</type>
+                        <param>Supplier&lt;? extends X&gt;</param>
+                        <throw>X</throw>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="GenericClass" tparam="K,V">
-        <import>java.util.Set</import>
-        <import>java.util.List</import>
-        <import>java.util.Map</import>
-        <modifier>public</modifier>
-        <member>
-            <method basename="put">
+            <enum basename="SampleEnum">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>K,V</param>
-            </method>
-            <method basename="putMap">
+                <member>
+                    <constant basename="VALUE" count="3"/>
+                </member>
+            </enum>
+
+            <enum basename="SampleEnum">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>Map&lt;K,V&gt;</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>V</type>
-                <param>K</param>
-            </method>
-            <method basename="getV">
-                <modifier>public</modifier>
-                <type>Set&lt;V&gt;|List&lt;V&gt;</type>
-            </method>
-            <method basename="getK">
-                <modifier>public</modifier>
-                <type>Set&lt;K&gt;|List&lt;K&gt;</type>
-            </method>
-        </member>
-    </class>
+                <member>
+                    <constant basename="VALUE" count="2"/>
+                    <constant basename="NOVALUE" count="1"/>
+                    <field basename="field">
+                        <modifier>private</modifier>
+                        <type>int|String</type>
+                    </field>
+                    <method basename="method">
+                        <modifier>public</modifier>
+                        <type>void|String</type>
+                    </method>
+                </member>
+            </enum>
 
-    <class basename="GenericClass" tparam="M,N,O">
-        <import>java.util.Set</import>
-        <import>java.util.List</import>
-        <import>java.util.Map</import>
-        <modifier>public</modifier>
-        <member>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>Set&lt;M&gt;|List&lt;M&gt;</type>
-                <param>Map&lt;N,O&gt;</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>Set&lt;N&gt;|List&lt;N&gt;</type>
-                <param>Map&lt;M,O&gt;</param>
-            </method>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>Set&lt;O&gt;|List&lt;O&gt;</type>
-                <param>Map&lt;M,N&gt;</param>
-            </method>
-        </member>
-    </class>
+            <annodecl id="documented">
+                <class>Documented</class>
+            </annodecl>
 
-    <class basename="GenericUtil"> <!-- public static generic methods like Collections -->
-        <import>java.util.Set</import>
-        <import>java.util.List</import>
-        <import>java.util.Map</import>
-        <import>java.util.function.Supplier</import>
-        <modifier>public</modifier>
-        <member>
-            <method tparam="E" basename="getSomething">
-                <modifier>public</modifier>
-                <modifier>static</modifier>
-                <type>Set&lt;? extends E&gt;|List&lt;? extends E&gt;</type>
-            </method>
-            <method tparam="V,K" basename="getMore">
-                <modifier>public|private</modifier>
-                <modifier>static</modifier>
-                <type>Map&lt;V,K&gt;</type>
-            </method>
-            <method tparam="E" basename="doSomething">
-                <modifier>public</modifier>
-                <modifier>static</modifier>
-                <type>void</type>
-                <param>E</param>
-            </method>
-            <method tparam="X extends Throwable" basename="orElseThrow">
-                <modifier>public|private</modifier>
-                <modifier>static</modifier>
-                <type>X</type>
-                <param>Supplier&lt;? extends X&gt;</param>
-                <throw>X</throw>
-            </method>
-        </member>
-    </class>
+            <annodecl id="reten-source">
+                <class>Retention</class>
+                <arg name="value" value="RetentionPolicy.SOURCE"/>
+            </annodecl>
 
-    <enum basename="SampleEnum">
-        <modifier>public</modifier>
-        <member>
-            <constant basename="VALUE" count="3"/>
-        </member>
-    </enum>
-        
-    <enum basename="SampleEnum">
-        <modifier>public</modifier>
-        <member>
-            <constant basename="VALUE" count="2"/>
-            <constant basename="NOVALUE" count="1"/>
-            <field basename="field">
-                <modifier>private</modifier>
-                <type>int|String</type>
-            </field>
-            <method basename="method">
-                <modifier>public</modifier>
-                <type>void|String</type>
-            </method>
-        </member>
-    </enum>
+            <annodecl id="reten-class">
+                <class>Retention</class>
+                <arg name="value" value="RetentionPolicy.CLASS"/>
+            </annodecl>
 
-    <annodecl id="documented">
-        <class>Documented</class>
-    </annodecl>
+            <annodecl id="reten-runtime">
+                <class>Retention</class>
+                <arg name="value" value="RetentionPolicy.RUNTIME"/>
+            </annodecl>
 
-    <annodecl id="reten-source">
-        <class>Retention</class>
-        <arg name="value" value="RetentionPolicy.SOURCE"/>
-    </annodecl>
+            <annodecl id="target-method">
+                <class>Target</class>
+                <arg value="ElementType.METHOD"/>
+            </annodecl>
 
-    <annodecl id="reten-class">
-        <class>Retention</class>
-        <arg name="value" value="RetentionPolicy.CLASS"/>
-    </annodecl>
+            <annodecl id="target-field">
+                <class>Target</class>
+                <arg value="ElementType.FIELD"/>
+            </annodecl>
 
-    <annodecl id="reten-runtime">
-        <class>Retention</class>
-        <arg name="value" value="RetentionPolicy.RUNTIME"/>
-    </annodecl>
+            <annodecl id="target-type">
+                <class>Target</class>
+                <arg value="{ElementType.TYPE, ElementType.TYPE_USE}"/>
+            </annodecl>
 
-    <annodecl id="target-method">
-        <class>Target</class>
-        <arg value="ElementType.METHOD"/>
-    </annodecl>
-
-    <annodecl id="target-field">
-        <class>Target</class>
-        <arg value="ElementType.FIELD"/>
-    </annodecl>
-
-    <annodecl id="target-type">
-        <class>Target</class>
-        <arg value="{ElementType.TYPE, ElementType.TYPE_USE}"/>
-    </annodecl>
-
-    <annotation basename="AnnotatedAnno">
-        <import>java.lang.annotation.Documented</import>
-        <anno>@documented</anno>
-        <modifier>public</modifier>
-        <member>
-            <method basename="value">
-                <modifier>public</modifier>
-                <type>boolean|String</type>
-            </method>
-        </member>
-    </annotation>
-
-    <annotation basename="AnnotatedAnno">
-        <import>java.lang.annotation.Retention</import>
-        <import>java.lang.annotation.RetentionPolicy</import>
-        <anno>@reten-source|@reten-class|@reten-runtime</anno>
-        <modifier>public</modifier>
-        <member>
-            <method basename="value">
-                <modifier>public</modifier>
-                <type>int</type>
-            </method>
-        </member>
-    </annotation>
-
-    <class basename="AnnoContainer">
-        <import>java.lang.annotation.Retention</import>
-        <import>java.lang.annotation.RetentionPolicy</import>
-        <import>java.lang.annotation.Target</import>
-        <import>java.lang.annotation.ElementType</import>
-        <modifier>public</modifier>
-        <member>
             <annotation basename="AnnotatedAnno">
-                <anno>@reten-source|@reten-class|@reten-runtime</anno>
-                <anno>@target-method|@target-field|@target-type</anno>
+                <import>java.lang.annotation.Documented</import>
+                <anno>@documented</anno>
                 <modifier>public</modifier>
-                <modifier>static</modifier>
                 <member>
                     <method basename="value">
                         <modifier>public</modifier>
-                        <type>String</type>
+                        <type>boolean|String</type>
                     </method>
                 </member>
             </annotation>
-        </member>
-    </class>
 
-    <annodecl id="deprecated">
-        <class>Deprecated</class>
-    </annodecl>
-
-    <annodecl id="safevarargs">
-        <class>SafeVarargs</class>
-    </annodecl>
-
-    <annodecl id="suppresswarnings">
-        <class>SuppressWarnings</class>
-        <arg value="{&quot;unchecked&quot;, &quot;rawtypes&quot;}"/>
-    </annodecl>
-
-    <class basename="AnnotatedClass">
-        <modifier>public</modifier>
-        <member>
-            <method basename="deprecatedMethod">
-                <anno>@deprecated</anno>
+            <annotation basename="AnnotatedAnno">
+                <import>java.lang.annotation.Retention</import>
+                <import>java.lang.annotation.RetentionPolicy</import>
+                <anno>@reten-source|@reten-class|@reten-runtime</anno>
                 <modifier>public</modifier>
-                <type>void</type>
-            </method>
-            <method basename="safeVarargsMethod">
-                <anno>@safevarargs</anno>
+                <member>
+                    <method basename="value">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </method>
+                </member>
+            </annotation>
+
+            <class basename="AnnoContainer">
+                <import>java.lang.annotation.Retention</import>
+                <import>java.lang.annotation.RetentionPolicy</import>
+                <import>java.lang.annotation.Target</import>
+                <import>java.lang.annotation.ElementType</import>
                 <modifier>public</modifier>
-                <type>void|int</type>
-                <param>String...</param>
-            </method>
-            <method basename="suppressWarningsMethod">
-                <anno>@suppresswarnings</anno>
+                <member>
+                    <annotation basename="AnnotatedAnno">
+                        <anno>@reten-source|@reten-class|@reten-runtime</anno>
+                        <anno>@target-method|@target-field|@target-type</anno>
+                        <modifier>public</modifier>
+                        <modifier>static</modifier>
+                        <member>
+                            <method basename="value">
+                                <modifier>public</modifier>
+                                <type>String</type>
+                            </method>
+                        </member>
+                    </annotation>
+                </member>
+            </class>
+
+            <annodecl id="deprecated">
+                <class>Deprecated</class>
+            </annodecl>
+
+            <annodecl id="safevarargs">
+                <class>SafeVarargs</class>
+            </annodecl>
+
+            <annodecl id="suppresswarnings">
+                <class>SuppressWarnings</class>
+                <arg value="{&quot;unchecked&quot;, &quot;rawtypes&quot;}"/>
+            </annodecl>
+
+            <class basename="AnnotatedClass">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>int|Object</param>
-            </method>
-        </member>
-    </class>
-</package>
+                <member>
+                    <method basename="deprecatedMethod">
+                        <anno>@deprecated</anno>
+                        <modifier>public</modifier>
+                        <type>void</type>
+                    </method>
+                    <method basename="safeVarargsMethod">
+                        <anno>@safevarargs</anno>
+                        <modifier>public</modifier>
+                        <type>void|int</type>
+                        <param>String...</param>
+                    </method>
+                    <method basename="suppressWarningsMethod">
+                        <anno>@suppresswarnings</anno>
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>int|Object</param>
+                    </method>
+                </member>
+            </class>
+        </package>
+    </module>
+</sampleapi>
+
diff --git a/langtools/test/tools/javadoc/sampleapi/res/sub.xml b/langtools/test/tools/javadoc/sampleapi/res/sub.xml
index ff007c7..242ea7a 100644
--- a/langtools/test/tools/javadoc/sampleapi/res/sub.xml
+++ b/langtools/test/tools/javadoc/sampleapi/res/sub.xml
@@ -21,69 +21,72 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
-<package name="sampleapi.simple.sub">
+<sampleapi>
+    <module name="UNNAMED">
+        <package name="sampleapi.simple.sub">
+            <class basename="SClass">
+                <modifier>public</modifier>
+                <modifier>none|abstract</modifier>
+                <implement>SInterface0</implement>
+                <member>
+                    <field basename="id">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </field>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                        <throw>SException0</throw>
+                    </method>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <param>int</param>
+                        <type>void</type>
+                        <throw>SException0</throw>
+                    </method>
+                </member>
+            </class>
 
-    <class basename="SClass">
-        <modifier>public</modifier>
-        <modifier>none|abstract</modifier>
-        <implement>SInterface0</implement>
-        <member>
-            <field basename="id">
+            <class basename="SException">
                 <modifier>public</modifier>
-                <type>int</type>
-            </field>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>int</type>
-                <throw>SException0</throw>
-            </method>
-            <method basename="put">
-                <modifier>public</modifier>
-                <param>int</param>
-                <type>void</type>
-                <throw>SException0</throw>
-            </method>
-        </member>
-    </class>
+                <extend ref="java.lang.Exception"/>
+                <member>
+                    <constructor>
+                        <modifier>public</modifier>
+                        <param>String</param>
+                    </constructor>
+                </member>
+            </class>
 
-    <class basename="SException">
-        <modifier>public</modifier>
-        <extend ref="java.lang.Exception"/>
-        <member>
-            <constructor>
+            <interface basename="SInterface">
                 <modifier>public</modifier>
-                <param>String</param>
-            </constructor>
-        </member>
-    </class>
+                <member>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>int</param>
+                    </method>
+                </member>
+            </interface>
 
-    <interface basename="SInterface">
-        <modifier>public</modifier>
-        <member>
-            <method basename="put">
+            <enum basename="SEnum">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>int</param>
-            </method>
-        </member>
-    </interface>
+                <member>
+                    <constant basename="ON" count="1"/>
+                    <constant basename="OFF" count="1"/>
+                </member>
+            </enum>
 
-    <enum basename="SEnum">
-        <modifier>public</modifier>
-        <member>
-            <constant basename="ON" count="1"/>
-            <constant basename="OFF" count="1"/>
-        </member>
-    </enum>
-
-    <annotation basename="SAnno">
-        <modifier>public</modifier>
-        <member>
-            <method basename="value">
+            <annotation basename="SAnno">
                 <modifier>public</modifier>
-                <type>boolean</type>
-            </method>
-        </member>
-    </annotation>
-        
-</package>
+                <member>
+                    <method basename="value">
+                        <modifier>public</modifier>
+                        <type>boolean</type>
+                    </method>
+                </member>
+            </annotation>
+        </package>
+    </module>
+</sampleapi>
+
diff --git a/langtools/test/tools/javadoc/sampleapi/res/tiny.xml b/langtools/test/tools/javadoc/sampleapi/res/tiny.xml
index 9a0f493..66d6a77 100644
--- a/langtools/test/tools/javadoc/sampleapi/res/tiny.xml
+++ b/langtools/test/tools/javadoc/sampleapi/res/tiny.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
- Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -21,51 +21,53 @@
  or visit www.oracle.com if you need additional information or have any
  questions.
 -->
-<package name="sampleapi.tiny">
-
-    <class basename="TinyClass">
-        <modifier>public</modifier>
-        <modifier>none|abstract</modifier>
-        <member>
-            <field basename="id">
+<sampleapi>
+    <module name="UNNAMED">
+        <package name="sampleapi.tiny">
+            <class basename="TinyClass">
                 <modifier>public</modifier>
-                <type>int</type>
-            </field>
-            <method basename="get">
-                <modifier>public</modifier>
-                <type>int</type>
-            </method>
-        </member>
-    </class>
+                <modifier>none|abstract</modifier>
+                <member>
+                    <field basename="id">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </field>
+                    <method basename="get">
+                        <modifier>public</modifier>
+                        <type>int</type>
+                    </method>
+                </member>
+            </class>
 
-    <interface basename="TinyInterface">
-        <modifier>public</modifier>
-        <member>
-            <method basename="put">
+            <interface basename="TinyInterface">
                 <modifier>public</modifier>
-                <type>void</type>
-                <param>int</param>
-            </method>
-        </member>
-    </interface>
+                <member>
+                    <method basename="put">
+                        <modifier>public</modifier>
+                        <type>void</type>
+                        <param>int</param>
+                    </method>
+                </member>
+            </interface>
 
-    <enum basename="TinyEnum">
-        <modifier>public</modifier>
-        <member>
-            <constant basename="YES" count="1"/>
-            <constant basename="NO" count="1"/>
-            <constant basename="MAYBE" count="1"/>
-        </member>
-    </enum>
-
-    <annotation basename="TinyAnno">
-        <modifier>public</modifier>
-        <member>
-            <method basename="value">
+            <enum basename="TinyEnum">
                 <modifier>public</modifier>
-                <type>boolean</type>
-            </method>
-        </member>
-    </annotation>
-        
-</package>
+                <member>
+                    <constant basename="YES" count="1"/>
+                    <constant basename="NO" count="1"/>
+                    <constant basename="MAYBE" count="1"/>
+                </member>
+            </enum>
+
+            <annotation basename="TinyAnno">
+                <modifier>public</modifier>
+                <member>
+                    <method basename="value">
+                        <modifier>public</modifier>
+                        <type>boolean</type>
+                    </method>
+                </member>
+            </annotation>
+        </package>
+    </module>
+</sampleapi>
diff --git a/langtools/test/tools/jdeps/MultiReleaseJar.java b/langtools/test/tools/jdeps/MultiReleaseJar.java
index 0f4fd7c..c1ecb83 100644
--- a/langtools/test/tools/jdeps/MultiReleaseJar.java
+++ b/langtools/test/tools/jdeps/MultiReleaseJar.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8153654
+ * @bug 8153654 8176333
  * @summary Tests for jdeps tool with multi-release jar files
  * @modules jdk.jdeps/com.sun.tools.jdeps
  * @library mrjar mrjar/base mrjar/9 mrjar/10 mrjar/v9 mrjar/v10
@@ -67,7 +67,7 @@
         checkResult(r, false, "Warning: Path does not exist: missing.jar");
 
         r = run("jdeps -v Version.jar");
-        checkResult(r, false, "the --multi-release option is not set");
+        checkResult(r, false, "--multi-release option is not set");
 
         r = run("jdeps --multi-release base  -v Version.jar");
         checkResult(r, true,
@@ -105,7 +105,7 @@
         checkResult(r, false, "Error: invalid argument for option: 9.1");
 
         r = run("jdeps -v -R -cp Version.jar test/Main.class");
-        checkResult(r, false, "the --multi-release option is not set");
+        checkResult(r, false, "--multi-release option is not set");
 
         r = run("jdeps -v -R -cp Version.jar -multi-release 9 test/Main.class");
         checkResult(r, false,
diff --git a/langtools/test/tools/jdeps/jdkinternals/RemovedJDKInternals.java b/langtools/test/tools/jdeps/jdkinternals/RemovedJDKInternals.java
index 6611235..b97c27d 100644
--- a/langtools/test/tools/jdeps/jdkinternals/RemovedJDKInternals.java
+++ b/langtools/test/tools/jdeps/jdkinternals/RemovedJDKInternals.java
@@ -63,7 +63,7 @@
         Path sunMiscSrc = Paths.get(TEST_SRC, "patches", JDK_UNSUPPORTED);
         Path patchDir = PATCHES_DIR.resolve(JDK_UNSUPPORTED);
         assertTrue(CompilerUtils.compile(sunMiscSrc, patchDir,
-                                         "-Xmodule:" + JDK_UNSUPPORTED));
+                                         "--patch-module", JDK_UNSUPPORTED + "=" + sunMiscSrc.toString()));
 
         // compile com.sun.image.codec.jpeg types
         Path codecSrc = Paths.get(TEST_SRC, "patches", "java.desktop");
diff --git a/langtools/test/tools/jdeps/modules/DotFileTest.java b/langtools/test/tools/jdeps/modules/DotFileTest.java
new file mode 100644
index 0000000..9772689
--- /dev/null
+++ b/langtools/test/tools/jdeps/modules/DotFileTest.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8173374
+ * @summary Tests module dot graph
+ * @modules java.desktop
+ *          java.sql
+ *          jdk.jdeps/com.sun.tools.jdeps
+ * @run testng DotFileTest
+ */
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Set;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.spi.ToolProvider;
+import java.util.stream.Collectors;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertEquals;
+
+public class DotFileTest {
+    private static final ToolProvider JDEPS = ToolProvider.findFirst("jdeps")
+        .orElseThrow(() -> new RuntimeException("jdeps not found"));
+
+    private static final Path DOTS_DIR = Paths.get("dots");
+    private static final Path SPEC_DIR = Paths.get("spec");
+
+    @DataProvider(name = "modules")
+    public Object[][] modules() {
+        return new Object[][]{
+            {"java.desktop", Set.of("java.datatransfer -> java.base",
+                                    "java.desktop -> java.datatransfer",
+                                    "java.desktop -> java.prefs",
+                                    "java.prefs -> java.xml",
+                                    "java.xml -> java.base" )
+            },
+            { "java.sql",    Set.of("java.logging -> java.base",
+                                    "java.sql -> java.logging",
+                                    "java.sql -> java.xml",
+                                    "java.xml -> java.base" )
+            }
+        };
+    }
+    @DataProvider(name = "specVersion")
+    public Object[][] specVersion() {
+        return new Object[][]{
+            {"java.desktop", Set.of("java.datatransfer -> java.base",
+                                    "java.desktop -> java.datatransfer",
+                                    "java.desktop -> java.xml",
+                                    "java.xml -> java.base")
+            },
+            { "java.sql",    Set.of("java.logging -> java.base",
+                                    "java.sql -> java.logging",
+                                    "java.sql -> java.xml",
+                                    "java.xml -> java.base" )
+            }
+        };
+    }
+
+    @Test(dataProvider = "modules")
+    public void test(String name, Set<String> edges) throws Exception {
+        String[] options = new String[] {
+            "-dotoutput", DOTS_DIR.toString(),
+            "-s", "-m", name
+        };
+        assertTrue(JDEPS.run(System.out, System.out, options) == 0);
+
+        Path path = DOTS_DIR.resolve(name + ".dot");
+        assertTrue(Files.exists(path));
+        Set<String> lines = Files.readAllLines(path).stream()
+                                 .filter(l -> l.contains(" -> "))
+                                 .map(this::split)
+                                 .collect(Collectors.toSet());
+        assertEquals(lines, edges);
+    }
+
+    @Test(dataProvider = "specVersion")
+    public void testAPIOnly(String name, Set<String> edges) throws Exception {
+        String[] options = new String[]{
+            "-dotoutput", SPEC_DIR.toString(),
+            "-s", "-apionly",
+            "-m", name
+        };
+        assertTrue(JDEPS.run(System.out, System.out, options) == 0);
+
+        Path path = SPEC_DIR.resolve(name + ".dot");
+        assertTrue(Files.exists(path));
+        Set<String> lines = Files.readAllLines(path).stream()
+                                 .filter(l -> l.contains(" -> "))
+                                 .map(this::split)
+                                 .collect(Collectors.toSet());
+        assertEquals(lines, edges);
+    }
+
+    static Pattern PATTERN = Pattern.compile(" *\"(\\S+)\" -> \"(\\S+)\" .*");
+    String split(String line) {
+        Matcher pm = PATTERN.matcher(line);
+        assertTrue(pm.find());
+        return String.format("%s -> %s", pm.group(1), pm.group(2));
+    }
+}
diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk
index 0b54c85..4a8ae81 100644
--- a/make/CompileJavaModules.gmk
+++ b/make/CompileJavaModules.gmk
@@ -85,7 +85,7 @@
 
 ################################################################################
 
-java.compiler_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
+java.compiler_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 
 ################################################################################
 
@@ -247,7 +247,7 @@
 
 ################################################################################
 
-java.management.rmi_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/package:javax.*'
+java.management.rmi_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:javax.*'
 
 ################################################################################
 
@@ -462,13 +462,13 @@
 # JVMCI compilers make use of that information for various sanity checks.
 # Don't use Indy strings concatenation to have good JVMCI startup performance.
 
-jdk.vm.ci_ADD_JAVAC_FLAGS := -parameters -Xlint:-exports -XDstringConcat=inline
+jdk.internal.vm.ci_ADD_JAVAC_FLAGS := -parameters -Xlint:-exports -XDstringConcat=inline
 
 ################################################################################
 
-jdk.vm.compiler_ADD_JAVAC_FLAGS := -parameters -XDstringConcat=inline
+jdk.internal.vm.compiler_ADD_JAVAC_FLAGS := -parameters -XDstringConcat=inline
 
-jdk.vm.compiler_EXCLUDES += \
+jdk.internal.vm.compiler_EXCLUDES += \
     org.graalvm.compiler.core.match.processor \
     org.graalvm.compiler.nodeinfo.processor \
     org.graalvm.compiler.options.processor \
@@ -557,16 +557,16 @@
 # Add imported modules to the modulepath
 MODULEPATH := $(call PathList, $(IMPORT_MODULES_CLASSES))
 
-ifeq ($(MODULE), jdk.vm.ci)
-  ## WORKAROUND jdk.vm.ci source structure issue
+ifeq ($(MODULE), jdk.internal.vm.ci)
+  ## WORKAROUND jdk.internal.vm.ci source structure issue
   JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \
       $(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
-          $(wildcard $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes/*/src)))
+          $(wildcard $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes/*/src)))
   MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))
 endif
 
-ifeq ($(MODULE), jdk.vm.compiler)
-  ## WORKAROUND jdk.vm.compiler source structure issue
+ifeq ($(MODULE), jdk.internal.vm.compiler)
+  ## WORKAROUND jdk.internal.vm.compiler source structure issue
   VM_COMPILER_MODULESOURCEPATH := $(MODULESOURCEPATH) \
       $(subst /$(MODULE)/,/*/, $(filter-out %processor/src %test/src %jtt/src %bench/src %microbenchmarks/src, \
           $(wildcard $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes/*/src)))
diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk
index fd502f1..d0dc9fc 100644
--- a/make/CreateJmods.gmk
+++ b/make/CreateJmods.gmk
@@ -135,11 +135,10 @@
 	$(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@)
 	$(JMOD) create \
             --module-version $(VERSION_SHORT) \
-            --os-name $(REQUIRED_OS_NAME) \
-            --os-arch $(OPENJDK_TARGET_CPU_LEGACY) \
-            --os-version $(REQUIRED_OS_VERSION) \
+            --os-name '$(REQUIRED_OS_NAME)' \
+            --os-arch '$(REQUIRED_OS_ARCH)' \
             --module-path $(JMODS_DIR) \
-	    --exclude '**{_the.*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' \
+	    --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' \
 	    $(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@)
 	$(MV) $(JMODS_TEMPDIR)/$(notdir $@) $@
 
diff --git a/make/GenerateLinkOptData.gmk b/make/GenerateLinkOptData.gmk
index 43e388d..60c80ea 100644
--- a/make/GenerateLinkOptData.gmk
+++ b/make/GenerateLinkOptData.gmk
@@ -49,7 +49,7 @@
 
 LINK_OPT_DIR := $(SUPPORT_OUTPUTDIR)/link_opt
 CLASSLIST_FILE := $(LINK_OPT_DIR)/classlist
-JLI_TRACE_FILE := $(LINK_OPT_DIR)/jli_trace.out
+JLI_TRACE_FILE := $(LINK_OPT_DIR)/default_jli_trace.txt
 
 # If an external buildjdk has been supplied, we don't build a separate interim
 # image, so just use the external build jdk instead.
@@ -69,7 +69,7 @@
 
 # The jli trace is created by the same recipe as classlist. By declaring these
 # dependencies, make will correctly rebuild both jli trace and classlist
-# incrementally using the single recpie above.
+# incrementally using the single recipe above.
 $(CLASSLIST_FILE): $(JLI_TRACE_FILE)
 $(JLI_TRACE_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
 
@@ -83,6 +83,19 @@
 
 TARGETS += $(COPY_CLASSLIST)
 
+# Copy the default_jli_trace.txt file into jdk.jlink
+$(eval $(call SetupCopyFiles, COPY_JLI_TRACE, \
+    FILES := $(JLI_TRACE_FILE), \
+    DEST := $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jlink/internal/plugins, \
+))
+
+# Because of the single recipe for jli trace and classlist above, the
+# COPY_JLI_TRACE rule needs to explicitly add the classlist file as a
+# prerequisite.
+$(COPY_JLI_TRACE): $(CLASSLIST_FILE)
+
+TARGETS += $(COPY_JLI_TRACE)
+
 ################################################################################
 
 all: $(TARGETS)
diff --git a/make/Help.gmk b/make/Help.gmk
index bd10fa2..abf599e 100644
--- a/make/Help.gmk
+++ b/make/Help.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -54,6 +54,8 @@
 	$(info $(_) make reconfigure       # Rerun configure with the same arguments as last time)
 	$(info $(_) make help              # Give some help on using make)
 	$(info $(_) make test              # Run tests, default is all tests (see TEST below))
+	$(info $(_) make run-test-<test>   # Run test, e.g. run-test-tier1)
+	$(info $(_) make run-test TEST=<t> # Run test(s) given by TEST specification)
 	$(info )
 	$(info Targets for cleaning)
 	$(info $(_) make clean             # Remove all files generated by make, but not those)
@@ -95,6 +97,8 @@
 	$(info $(_)                        # method is 'auto', 'ignore' or 'fail' (default))
 	$(info $(_) make test TEST=<test>  # Only run the given test or tests, e.g.)
 	$(info $(_)                        # make test TEST="jdk_lang jdk_net")
+	$(info $(_) JTREG="OPT1=x;OPT2=y"  # Control the JTREG test harness for run-test)
+	$(info $(_) GTEST="OPT1=x;OPT2=y"  # Control the GTEST test harness for run-test)
 	$(info )
 	$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))),\
 	    $(info No configurations were found in $(build_dir).) $(info Run 'bash configure' to create a configuration.))
diff --git a/make/Images.gmk b/make/Images.gmk
index 09740cb..d694dc8 100644
--- a/make/Images.gmk
+++ b/make/Images.gmk
@@ -105,7 +105,7 @@
 JLINK_JLI_CLASSES :=
 ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
   JLINK_ORDER_RESOURCES += @$(SUPPORT_OUTPUTDIR)/link_opt/classlist
-  JLINK_JLI_CLASSES := --generate-jli-classes=@$(SUPPORT_OUTPUTDIR)/link_opt/jli_trace.out
+  JLINK_JLI_CLASSES := --generate-jli-classes=@$(SUPPORT_OUTPUTDIR)/link_opt/default_jli_trace.txt
 endif
 JLINK_ORDER_RESOURCES += \
     /java.base/java/** \
@@ -119,6 +119,7 @@
     --module-path $(IMAGES_OUTPUTDIR)/jmods \
     --endian $(OPENJDK_BUILD_CPU_ENDIAN) \
     --release-info $(BASE_RELEASE_FILE) \
+    --release-info add:OS_VERSION=\"$(REQUIRED_OS_VERSION)\" \
     --order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \
     --dedup-legal-notices=error-if-not-same-content \
     $(JLINK_JLI_CLASSES) \
@@ -310,34 +311,6 @@
 endif # Windows
 
 ################################################################################
-# doc files
-
-JRE_DOC_LOCATION ?= $(JDK_TOPDIR)
-JDK_DOC_LOCATION ?= $(JDK_TOPDIR)
-
-JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/, $(JRE_DOC_FILES))
-JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/, $(JDK_DOC_FILES))
-
-# Processing license files from source area to image area
-# These are modified to have the platform specific EOL chars.
-define process-doc-file
-	$(call LogInfo, Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@))
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	LC_ALL=C $(SED) 's/$$//g' $< > $@
-	$(CHMOD) 444 $@
-endef
-
-$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
-	$(process-doc-file)
-
-$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
-	$(process-doc-file)
-
-JRE_TARGETS += $(JRE_DOC_TARGETS)
-JDK_TARGETS += $(JDK_DOC_TARGETS)
-
-################################################################################
 # src.zip
 
 $(JDK_IMAGE_DIR)/lib/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
diff --git a/make/Init.gmk b/make/Init.gmk
index 15d25b4..0adb842 100644
--- a/make/Init.gmk
+++ b/make/Init.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
 
   # Targets provided by Init.gmk.
   ALL_INIT_TARGETS := print-modules print-targets print-configuration \
-      reconfigure pre-compare-build post-compare-build
+      print-tests reconfigure pre-compare-build post-compare-build
 
   # CALLED_TARGETS is the list of targets that the user provided,
   # or "default" if unspecified.
@@ -66,7 +66,7 @@
   ifeq ($(CALLED_SPEC_TARGETS), )
     ONLY_GLOBAL_TARGETS := true
   endif
-  ifneq ($(findstring qp, $(MAKEFLAGS)),)
+  ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
     ONLY_GLOBAL_TARGETS := true
   endif
 
@@ -251,6 +251,11 @@
 	    $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
 	    NO_RECIPES=true print-targets )
 
+  print-tests:
+	( cd $(TOPDIR) && \
+	    $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
+	    NO_RECIPES=true print-tests )
+
   print-configuration:
 	  $(ECHO) $(CONFIGURE_COMMAND_LINE)
 
@@ -310,6 +315,9 @@
 	    $(call StopGlobalTimer)
 	    $(call ReportBuildTimes)
           endif
+	  if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
+	    exit 1 ; \
+	  fi
 	  $(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE)
         endif
 
diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk
index 92b34d7..9bab7e5 100644
--- a/make/InitSupport.gmk
+++ b/make/InitSupport.gmk
@@ -33,6 +33,11 @@
 _INITSUPPORT_GMK := 1
 
 ifeq ($(HAS_SPEC),)
+
+  # Include the corresponding closed file, if present.
+  # Normal hook mechanism cannot be used since we have no SPEC.
+  -include $(topdir)/closed/make/InitSupport.gmk
+
   ##############################################################################
   # Helper functions for the initial part of Init.gmk, before the spec file is
   # loaded. Most of these functions provide parsing and setting up make options
@@ -40,8 +45,8 @@
   ##############################################################################
 
   # Make control variables, handled by Init.gmk
-  INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
-      COMPARE_BUILD
+  INIT_CONTROL_VARIABLES += LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
+      COMPARE_BUILD JTREG GTEST
 
   # All known make control variables
   MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER
@@ -498,6 +503,7 @@
   define PrepareFailureLogs
 	$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/failure-logs 2> /dev/null && \
 	$(MKDIR) -p $(MAKESUPPORT_OUTPUTDIR)/failure-logs
+	$(RM) $(MAKESUPPORT_OUTPUTDIR)/exit-with-error 2> /dev/null
   endef
 
   # Remove any javac server logs and port files. This
diff --git a/make/Javadoc.gmk b/make/Javadoc.gmk
index aa2a8b9..e8c58ab 100644
--- a/make/Javadoc.gmk
+++ b/make/Javadoc.gmk
@@ -27,6 +27,7 @@
 include $(SPEC)
 include MakeBase.gmk
 include $(JDK_TOPDIR)/make/Tools.gmk
+include $(JDK_TOPDIR)/make/ModuleTools.gmk
 
 ################################################################################
 
@@ -174,6 +175,7 @@
     -tag param \
     -tag return \
     -tag throws \
+    -taglet build.tools.taglet.ModuleGraph \
     -tag since \
     -tag version \
     -tag serialData \
@@ -188,6 +190,13 @@
 DEFAULT_JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
     -serialwarn -encoding ISO-8859-1 -breakiterator --system none
 
+#
+# TODO: this should be set by the configure option.
+#
+ifndef ENABLE_MODULE_GRAPH
+   ENABLE_MODULE_GRAPH=false
+endif
+
 ################################################################################
 # Setup make rules for running javadoc.
 #
@@ -314,14 +323,15 @@
   $1_INDEX_FILE := $$(JAVADOC_OUTPUTDIR)/$$($1_OUTPUT_DIRNAME)/index.html
 
   # Rule for actually running javadoc
-  $$($1_INDEX_FILE): $(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) $$($1_PACKAGE_DEPS) $$($1_DEPS)
+  $$($1_INDEX_FILE): $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) $$($1_PACKAGE_DEPS) $$($1_DEPS)
 	$$(call LogWarn, Generating Javadoc from $$(words $$($1_PACKAGES)) package(s) for $$($1_OUTPUT_DIRNAME))
 	$$(call MakeDir, $$(@D))
         ifneq ($$($1_PACKAGES_FILE), )
 	  $$(eval $$(call ListPathsSafely, $1_PACKAGES, $$($1_PACKAGES_FILE)))
         endif
 	$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1.javadoc, \
-	    $$($1_JAVA) -Djava.awt.headless=true $(NEW_JAVADOC) -d $$(@D) \
+	    $$($1_JAVA) -Djava.awt.headless=true -DenableModuleGraph=$(ENABLE_MODULE_GRAPH) \
+		$(NEW_JAVADOC) -d $$(@D) \
 	        $$(DEFAULT_JAVADOC_TAGS) $$(DEFAULT_JAVADOC_OPTIONS) \
 	        --module-source-path $$(call PathList, $$(JAVADOC_SOURCE_DIRS)) \
 	        $$($1_OPTIONS) $$($1_PACKAGES_ARG))
@@ -357,9 +367,7 @@
 $(eval $(call SetupJavadocGeneration, docletapi, \
     MODULES := jdk.javadoc, \
     PACKAGES := \
-        jdk.javadoc.doclet \
-        jdk.javadoc.doclet.taglet \
-        jdk.javadoc.doclets, \
+        jdk.javadoc.doclet, \
     API_ROOT := jdk, \
     DEST_DIR := javadoc/doclet, \
     TITLE := Doclet API, \
@@ -737,18 +745,34 @@
 ZIP_TARGETS += $(JAVADOC_ARCHIVE)
 
 ################################################################################
+# generate .dot files for module graphs
+
+JAVADOC_MODULE_GRAPHS_DIR := $(SUPPORT_OUTPUTDIR)/docs/module-graphs
+JAVADOC_MODULE_GRAPHS := $(JAVADOC_MODULE_GRAPHS_DIR)/java.se.dot
+JAVADOC_MODULE_GRAPHS_PROPS := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
+
+$(JAVADOC_MODULE_GRAPHS): $(BUILD_JIGSAW_TOOLS) $(JAVADOC_MODULE_GRAPHS_PROPS)
+	$(MKDIR) -p $(@D)
+	$(TOOL_GENGRAPHS) --spec --output $(JAVADOC_MODULE_GRAPHS_DIR) \
+	    --dot-attributes $(JAVADOC_MODULE_GRAPHS_PROPS)
+
+MODULE_GRAPH_TARGETS += $(JAVADOC_MODULE_GRAPHS)
+
+################################################################################
 
 # Hook to include the corresponding custom file, if present.
 $(eval $(call IncludeCustomExtension, , Javadoc.gmk))
 
 ################################################################################
 
-docs-javadoc: $(BUILD_TOOLS_JDK) $(TARGETS)
+docs-module-graphs: $(MODULE_GRAPH_TARGETS) 
+
+docs-javadoc: $(TARGETS)
 
 docs-copy: $(COPY_TARGETS)
 
 docs-zip: $(ZIP_TARGETS)
 
-all: docs-javadoc docs-copy docs-zip
+all: docs-module-graphs docs-javadoc docs-copy docs-zip
 
-.PHONY: default all docs-javadoc docs-copy docs-zip
+.PHONY: default all docs-module-graphs docs-javadoc docs-copy docs-zip
diff --git a/make/Main.gmk b/make/Main.gmk
index 22f43c2..effbc3e 100644
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
 # Load the vital tools for all the makefiles.
 include $(SRC_ROOT)/make/common/MakeBase.gmk
 include $(SRC_ROOT)/make/common/Modules.gmk
+include $(SRC_ROOT)/make/common/FindTests.gmk
 
 # Declare ALL_TARGETS as an immediate variable. This variable is a list of all
 # valid top level targets. It's used to declare them all as PHONY and to
@@ -362,6 +363,9 @@
 ################################################################################
 # Docs targets
 
+docs-module-graphs:
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-module-graphs)
+
 docs-javadoc:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-javadoc)
 
@@ -371,7 +375,10 @@
 docs-zip:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-zip)
 
-ALL_TARGETS += docs-javadoc docs-copy docs-zip
+update-build-docs:
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk)
+
+ALL_TARGETS += docs-module-graphs docs-javadoc docs-copy docs-zip update-build-docs
 
 ################################################################################
 # Cross compilation support
@@ -423,6 +430,22 @@
 ALL_TARGETS += $(INTERIM_JMOD_TARGETS) interim-image generate-link-opt-data
 
 ################################################################################
+# Generate test names for all JTReg test groups
+#
+
+define DeclareRunTestRecipe
+  run-test-$1:
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1")
+
+endef
+
+# ALL_NAMED_TESTS is defined in FindTests.gmk
+$(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t)))
+ALL_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS))
+
+ALL_TARGETS += $(ALL_TEST_TARGETS)
+
+################################################################################
 # Build tests
 #
 
@@ -446,6 +469,9 @@
 	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
 	    test-image-jdk-jtreg-native)
 
+run-test:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)")
+
 ifeq ($(BUILD_GTEST), true)
   test-image-hotspot-gtest:
 	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk)
@@ -474,7 +500,8 @@
 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
     test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
     test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
-    test-failure-handler test-image-failure-handler test-image-hotspot-gtest
+    test-failure-handler test-image-failure-handler test-image-hotspot-gtest \
+    run-test
 
 ################################################################################
 # Run tests
@@ -633,16 +660,16 @@
   # in javadoc.
   java.desktop-gensrc-jdk: java.base-gensrc
 
-  # The annotation processing for jdk.vm.ci and jdk.vm.compiler needs classes
-  # from the current JDK.
-  jdk.vm.ci-gensrc-hotspot: $(addsuffix -java, \
-      $(call FindTransitiveDepsForModule, jdk.vm.ci))
-  jdk.vm.compiler-gensrc-hotspot: $(addsuffix -java, \
-      $(call FindTransitiveDepsForModule, jdk.vm.compiler))
+  # The annotation processing for jdk.internal.vm.ci and jdk.internal.vm.compiler
+  # needs classes from the current JDK.
+  jdk.internal.vm.ci-gensrc-hotspot: $(addsuffix -java, \
+      $(call FindTransitiveDepsForModule, jdk.internal.vm.ci))
+  jdk.internal.vm.compiler-gensrc-hotspot: $(addsuffix -java, \
+      $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler))
 
-  # For jdk.vm.compiler, the gensrc step is generating a module-info.java.extra
+  # For jdk.internal.vm.compiler, the gensrc step is generating a module-info.java.extra
   # file to be processed by the gensrc-moduleinfo target.
-  jdk.vm.compiler-gensrc-moduleinfo: jdk.vm.compiler-gensrc-hotspot
+  jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-hotspot
 
   # Explicitly add dependencies for special targets
   java.base-java: unpack-sec
@@ -654,8 +681,7 @@
   # When creating a BUILDJDK, we don't need to add hashes to java.base, thus
   # we don't need to depend on all other jmods
   ifneq ($(CREATING_BUILDJDK), true)
-    java.base-jmod: jrtfs-jar $(filter-out java.base-jmod \
-        $(addsuffix -jmod, $(call FindAllUpgradeableModules)), $(JMOD_TARGETS))
+    java.base-jmod: jrtfs-jar $(filter-out java.base-jmod, $(JMOD_TARGETS))
   endif
 
   # Building java.base-jmod requires all of hotspot to be built.
@@ -728,7 +754,7 @@
     generate-link-opt-data: buildtools-jdk
 
     # The generated classlist needs to go into java.base-jmod.
-    java.base-jmod jdk-image jre-image: generate-link-opt-data
+    java.base-jmod jdk.jlink-jmod jdk-image jre-image: generate-link-opt-data
   endif
 
   release-file: create-source-revision-tracker
@@ -749,6 +775,8 @@
 
   bootcycle-images: jdk-image
 
+  docs-module-graphs: exploded-image buildtools-modules 
+
   docs-javadoc: $(GENSRC_TARGETS) rmic
 
   # The gensrc step for jdk.jdi creates an html file that is used by docs-copy.
@@ -758,6 +786,11 @@
 
   test: jdk-image test-image
 
+  run-test: jdk-image test-image
+
+  # Declare dependency for all generated test targets
+  $(foreach t, $(ALL_TEST_TARGETS), $(eval $t: jdk-image test-image))
+
   create-buildjdk-copy: jdk.jlink-java java.base-gendata \
       $(addsuffix -java, $(INTERIM_IMAGE_MODULES))
 
@@ -901,7 +934,7 @@
 endif
 
 # This target builds the documentation image
-docs-image: docs-javadoc docs-copy
+docs-image: docs-module-graphs docs-javadoc docs-copy
 
 # This target builds the test image
 test-image: prepare-test-image test-image-hotspot-jtreg-native \
@@ -1032,6 +1065,9 @@
 print-modules:
 	  @$(ECHO) $(sort $(ALL_MODULES))
 
+print-tests:
+	  @$(ECHO) $(sort $(ALL_NAMED_TESTS))
+
 create-main-targets-include:
 	  $(call LogInfo, Generating main target list)
 	  @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
diff --git a/make/RunTests.gmk b/make/RunTests.gmk
new file mode 100644
index 0000000..18e7f48
--- /dev/null
+++ b/make/RunTests.gmk
@@ -0,0 +1,485 @@
+#
+# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include FindTests.gmk
+
+# We will always run multiple tests serially
+.NOTPARALLEL:
+
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, , RunTests.gmk))
+
+TEST_RESULTS_DIR := $(BUILD_OUTPUT)/test-results
+TEST_SUPPORT_DIR := $(BUILD_OUTPUT)/test-support
+
+
+################################################################################
+# Parse control variables
+################################################################################
+
+$(eval $(call ParseKeywordVariable, JTREG, \
+    KEYWORDS := JOBS TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM, \
+    STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \
+))
+
+ifneq ($(JTREG), )
+  # Inform the user
+  $(info Running tests using JTREG control variable '$(JTREG)')
+endif
+
+$(eval $(call ParseKeywordVariable, GTEST, \
+    KEYWORDS := REPEAT, \
+    STRING_KEYWORDS := OPTIONS, \
+))
+
+ifneq ($(GTEST), )
+  # Inform the user
+  $(info Running tests using GTEST control variable '$(GTEST)')
+endif
+
+
+################################################################################
+# Component-specific Jtreg settings
+################################################################################
+
+ifeq ($(TEST_JOBS), 0)
+  # If TEST_JOBS is not specified, hotspot fallback default is
+  # min(num_cores / 2, 12).
+  hotspot_JTREG_JOBS := $(shell $(EXPR) $(NUM_CORES) / 2)
+  ifeq ($(hotspot_JTREG_JOBS), 0)
+    hotspot_JTREG_JOBS := 1
+  else ifeq ($(shell $(EXPR) $(hotspot_JTREG_JOBS) \> 12), 1)
+    hotspot_JTREG_JOBS := 12
+  endif
+endif
+
+hotspot_JTREG_MAX_MEM := 0
+hotspot_JTREG_ASSERT := false
+hotspot_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/hotspot/jtreg/native
+jdk_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/jdk/jtreg/native
+
+
+################################################################################
+# Parse test selection
+#
+# The user has given a test selection in the TEST variable. We must parse it
+# and determine what that means in terms of actual calls to the test framework.
+#
+# The parse functions take as argument a test specification as given by the
+# user, and returns a fully qualified test descriptor if it was a match, or
+# nothing if not. A single test specification can result in multiple test
+# descriptors being returned. A valid test descriptor must always be accepted
+# and returned identically.
+################################################################################
+
+# Helper function to determine if a test specification is a Gtest test
+#
+# It is a Gtest test if it is either "gtest", or "gtest:" followed by an optional
+# test filter string.
+define ParseGtestTestSelection
+  $(if $(filter gtest%, $1), \
+    $(if $(filter gtest, $1), \
+      gtest:all \
+    , \
+      $(if $(filter gtest:, $1), \
+        gtest:all \
+      , \
+        $1 \
+      ) \
+    ) \
+  )
+endef
+
+# Helper function to determine if a test specification is a Jtreg test
+#
+# It is a Jtreg test if it optionally begins with jtreg:, and then is either
+# an unspecified group name (possibly prefixed by :), or a group in a
+# specified <component>/test directory, or a path to a test or test directory,
+# either absolute or relative to TOPDIR.
+define ParseJtregTestSelection
+  $(eval TEST_NAME := $(strip $(patsubst jtreg:%, %, $1))) \
+  $(if $(or $(findstring :, $(TEST_NAME)), $(findstring /, $(TEST_NAME))), , \
+    $(eval TEST_NAME := :$(TEST_NAME)) \
+  ) \
+  $(if $(findstring :, $(TEST_NAME)), \
+    $(if $(filter :%, $(TEST_NAME)), \
+      $(foreach component, $(JTREG_COMPONENTS), \
+        $(if $(filter $(patsubst :%, %, $(TEST_NAME)), \
+            $($(component)_JTREG_TEST_GROUPS)), \
+          jtreg:$(component)/test:$(patsubst :%,%,$(TEST_NAME)) \
+        ) \
+      ) \
+    , \
+      $(eval COMPONENT := $(word 1, $(subst /, $(SPACE), $(TEST_NAME)))) \
+      $(eval GROUP := $(word 2, $(subst :, $(SPACE), $(TEST_NAME)))) \
+      $(if $(filter $(COMPONENT), $(JTREG_COMPONENTS)), \
+        $(if $(filter $(GROUP), $($(COMPONENT)_JTREG_TEST_GROUPS)), \
+          jtreg:$(TEST_NAME) \
+        ) \
+      ) \
+    ) \
+  , \
+    $(if $(filter /%, $(TEST_NAME)), \
+      $(if $(wildcard $(TEST_NAME)), \
+        jtreg:$(TEST_NAME) \
+      ) \
+    , \
+      $(if $(wildcard $(TOPDIR)/$(TEST_NAME)), \
+        jtreg:$(TEST_NAME) \
+      ) \
+    ) \
+  )
+endef
+
+ifeq ($(TEST), )
+  $(info No test selection given in TEST!)
+  $(info Please use e.g. 'run-test TEST=tier1' or 'run-test-tier1')
+  $(info See common/doc/testing.[md|html] for help)
+  $(error Cannot continue)
+endif
+
+# Now intelligently convert the test selection given by the user in TEST
+# into a list of fully qualified test descriptors of the tests to run.
+TESTS_TO_RUN :=
+$(foreach test, $(TEST), \
+  $(eval PARSED_TESTS := $(call ParseCustomTestSelection, $(test))) \
+  $(if $(strip $(PARSED_TESTS)), , \
+    $(eval PARSED_TESTS += $(call ParseGtestTestSelection, $(test))) \
+  ) \
+  $(if $(strip $(PARSED_TESTS)), , \
+    $(eval PARSED_TESTS += $(call ParseJtregTestSelection, $(test))) \
+  ) \
+  $(if $(strip $(PARSED_TESTS)), , \
+    $(eval UNKNOWN_TEST := $(test)) \
+  ) \
+  $(eval TESTS_TO_RUN += $(PARSED_TESTS)) \
+)
+
+ifneq ($(UNKNOWN_TEST), )
+  $(info Unknown test selection: '$(UNKNOWN_TEST)')
+  $(info See common/doc/testing.[md|html] for help)
+  $(error Cannot continue)
+endif
+
+TESTS_TO_RUN := $(strip $(TESTS_TO_RUN))
+
+
+# Present the result of our parsing to the user
+$(info Test selection '$(TEST)', will run:)
+$(foreach test, $(TESTS_TO_RUN), $(info * $(test)))
+
+
+################################################################################
+# Functions for setting up rules for running the selected tests
+#
+# The SetupRun*Test functions all have the same interface:
+#
+# Parameter 1 is the name of the rule. This is the test id, based on the test
+# descriptor, and this is also used as variable prefix, and the targets
+# generated are listed in a variable by that name.
+#
+# Remaining parameters are named arguments. Currently this is only:
+#   TEST -- The properly formatted fully qualified test descriptor
+#
+# After the rule named by the test id has been executed, the following
+# variables will be available:
+# testid_TOTAL - the total number of tests run
+# testid_PASSED - the number of successful tests
+# testid_FAILED - the number of failed tests
+# testid_ERROR - the number of tests was neither successful or failed
+#
+################################################################################
+
+### Rules for Gtest
+
+SetupRunGtestTest = $(NamedParamsMacroTemplate)
+define SetupRunGtestTestBody
+  $1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1
+  $1_TEST_SUPPORT_DIR := $$(TEST_SUPPORT_DIR)/$1
+
+  $1_TEST_NAME := $$(strip $$(patsubst gtest:%, %, $$($1_TEST)))
+  ifneq ($$($1_TEST_NAME), all)
+    $1_GTEST_FILTER := --gtest_filter=$$($1_TEST_NAME)*
+  endif
+
+  ifneq ($$(GTEST_REPEAT), )
+    $1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT)
+  endif
+
+  run-test-$1:
+	$$(call LogWarn)
+	$$(call LogWarn, Running test '$$($1_TEST)')
+	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
+	$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
+	    $$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/server/gtestLauncher \
+	    -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
+	    --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
+	    $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) \
+	    > >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) || true )
+
+  $1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/gtest.txt
+
+  parse-test-$1: run-test-$1
+	$$(call LogWarn, Finished running test '$$($1_TEST)')
+	$$(call LogWarn, Test report is stored in $$(strip \
+	    $$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
+	$$(eval $1_TOTAL := $$(shell $$(AWK) '/==========.* tests? from .* \
+	    test cases? ran/ { print $$$$2 }' $$($1_RESULT_FILE)))
+	$$(eval $1_PASSED := $$(shell $$(AWK) '/\[  PASSED  \] .* tests?./ \
+	    { print $$$$4 }' $$($1_RESULT_FILE)))
+	$$(eval $1_FAILED := $$(shell $$(AWK) '/\[  FAILED  \] .* tests?, \
+	    listed below/ { print $$$$4 }' $$($1_RESULT_FILE)))
+	$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0))
+	$$(eval $1_ERROR := $$(shell \
+	    $$(EXPR) $$($1_TOTAL) - $$($1_PASSED) - $$($1_FAILED)))
+
+  $1: run-test-$1 parse-test-$1
+
+  TARGETS += $1
+endef
+
+################################################################################
+
+### Rules for Jtreg
+
+# Helper function for SetupRunJtregTest. Set a JTREG_* variable from, in order:
+# 1) Specified by user on command line
+# 2) Component-specific default
+# 3) Generic default
+#
+# Note: No spaces are allowed around the arguments.
+# Arg $1 The test ID (i.e. $1 in SetupRunJtregTest)
+# Arg $2 Base variable, e.g. JTREG_JOBS
+# Arg $3 The default value (optional)
+define SetJtregValue
+  ifneq ($$($2), )
+    $1_$2 := $$($2)
+  else
+    ifneq ($$($$($1_COMPONENT)_$2), )
+      $1_$2 := $$($$($1_COMPONENT)_$2)
+    else
+      ifneq ($3, )
+        $1_$2 := $3
+      endif
+    endif
+  endif
+endef
+
+SetupRunJtregTest = $(NamedParamsMacroTemplate)
+define SetupRunJtregTestBody
+  $1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1
+  $1_TEST_SUPPORT_DIR := $$(TEST_SUPPORT_DIR)/$1
+
+  $1_TEST_NAME := $$(strip $$(patsubst jtreg:%, %, $$($1_TEST)))
+  $1_COMPONENT := $$(firstword $$(subst /, $$(SPACE), $$($1_TEST_NAME)))
+
+  # Unfortunately, we need different defaults for some JTREG values,
+  # depending on what component we're running.
+
+  # Convert JTREG_foo into $1_JTREG_foo with a suitable value.
+  $$(eval $$(call SetJtregValue,$1,JTREG_TEST_MODE,agentvm))
+  $$(eval $$(call SetJtregValue,$1,JTREG_ASSERT,true))
+  $$(eval $$(call SetJtregValue,$1,JTREG_MAX_MEM,512m))
+  $$(eval $$(call SetJtregValue,$1,JTREG_NATIVEPATH))
+  $$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
+
+  ifneq ($(TEST_JOBS), 0)
+    # User has specified TEST_JOBS, use that as fallback default
+    $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
+  else
+    # Use JOBS as default (except for hotspot)
+    $$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
+  endif
+
+  ifeq ($$(shell $$(EXPR) $$($1_JTREG_JOBS) \> 50), 1)
+    # Until CODETOOLS-7901892 is fixed, JTreg cannot handle more than 50 jobs
+    $1_JTREG_JOBS := 50
+  endif
+
+  # Make sure MaxRAMFraction is high enough to not cause OOM or swapping since
+  # we may end up with a lot of JVM's
+  $1_JTREG_MAX_RAM_FRACTION := $$(shell $$(EXPR) $$($1_JTREG_JOBS) \* 4)
+
+  JTREG_TIMEOUT ?= 4
+  JTREG_VERBOSE ?= fail,error,summary
+  JTREG_RETAIN ?= fail,error
+
+  ifneq ($$($1_JTREG_MAX_MEM), 0)
+    $1_JTREG_BASIC_OPTIONS += -vmoption:-Xmx$$($1_JTREG_MAX_MEM)
+    $1_JTREG_LAUNCHER_OPTIONS += -Xmx$$($1_JTREG_MAX_MEM)
+  endif
+
+  $1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
+      -verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
+      -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT) \
+      -vmoption:-XX:MaxRAMFraction=$$($1_JTREG_MAX_RAM_FRACTION)
+
+  $1_JTREG_BASIC_OPTIONS += -automatic -keywords:\!ignore -ignore:quiet
+
+  # Some tests needs to find a boot JDK using the JDK8_HOME variable.
+  $1_JTREG_BASIC_OPTIONS += -e:JDK8_HOME=$$(BOOT_JDK)
+
+  $1_JTREG_BASIC_OPTIONS += \
+      $$(addprefix -javaoption:, $$(JTREG_JAVA_OPTIONS)) \
+      $$(addprefix -vmoption:, $$(JTREG_VM_OPTIONS)) \
+      #
+
+  ifeq ($$($1_JTREG_ASSERT), true)
+    $1_JTREG_BASIC_OPTIONS += -ea -esa
+  endif
+
+  ifneq ($$($1_JTREG_NATIVEPATH), )
+    $1_JTREG_BASIC_OPTIONS += -nativepath:$$($1_JTREG_NATIVEPATH)
+  endif
+
+  run-test-$1:
+	$$(call LogWarn)
+	$$(call LogWarn, Running test '$$($1_TEST)')
+	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
+	$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \
+	    $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
+	        -Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
+	        $$($1_JTREG_BASIC_OPTIONS) \
+	        -testjdk:$$(JDK_IMAGE_DIR) \
+	        -dir:$$(TOPDIR) \
+	        -reportDir:$$($1_TEST_RESULTS_DIR) \
+	        -workDir:$$($1_TEST_SUPPORT_DIR) \
+	        $$(JTREG_OPTIONS) \
+	        $$($1_TEST_NAME) || true )
+
+  $1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/text/stats.txt
+
+  parse-test-$1: run-test-$1
+	$$(call LogWarn, Finished running test '$$($1_TEST)')
+	$$(call LogWarn, Test report is stored in $$(strip \
+	    $$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
+	$$(eval $1_PASSED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
+	    for (i=1; i<=NF; i++) { if ($$$$i == "passed:") \
+	    print $$$$(i+1) } }' $$($1_RESULT_FILE)))
+	$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0))
+	$$(eval $1_FAILED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
+	    for (i=1; i<=NF; i++) { if ($$$$i == "failed:") \
+	    print $$$$(i+1) } }' $$($1_RESULT_FILE)))
+	$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0))
+	$$(eval $1_ERROR := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
+	    for (i=1; i<=NF; i++) { if ($$$$i == "error:") \
+	    print $$$$(i+1) } }' $$($1_RESULT_FILE)))
+	$$(if $$($1_ERROR), , $$(eval $1_ERROR := 0))
+	$$(eval $1_TOTAL := $$(shell \
+	    $$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR)))
+
+  $1: run-test-$1 parse-test-$1
+
+  TARGETS += $1
+endef
+
+
+################################################################################
+# Setup and execute make rules for all selected tests
+################################################################################
+
+# Helper function to determine which handler to use for the given test
+UseGtestTestHandler = \
+  $(if $(filter gtest:%, $1), true)
+
+UseJtregTestHandler = \
+  $(if $(filter jtreg:%, $1), true)
+
+# Now process each test to run and setup a proper make rule
+$(foreach test, $(TESTS_TO_RUN), \
+  $(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
+      $(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
+  $(eval ALL_TEST_IDS += $(TEST_ID)) \
+  $(if $(call UseCustomTestHandler, $(test)), \
+    $(eval $(call SetupRunCustomTest, $(TEST_ID), \
+        TEST := $(test), \
+    )) \
+  ) \
+  $(if $(call UseGtestTestHandler, $(test)), \
+    $(eval $(call SetupRunGtestTest, $(TEST_ID), \
+        TEST := $(test), \
+    )) \
+  ) \
+  $(if $(call UseJtregTestHandler, $(test)), \
+    $(eval $(call SetupRunJtregTest, $(TEST_ID), \
+        TEST := $(test), \
+    )) \
+  ) \
+)
+
+# Sort also removes duplicates, so if there is any we'll get fewer words.
+ifneq ($(words $(ALL_TEST_IDS)), $(words $(sort $(ALL_TEST_IDS))))
+  $(error Duplicate test specification)
+endif
+
+
+################################################################################
+# The main target for RunTests.gmk
+################################################################################
+
+# The SetupRun*Test functions have populated TARGETS.
+
+TEST_FAILURE := false
+
+run-test: $(TARGETS)
+        # Print a table of the result of all tests run and their result
+	$(ECHO)
+	$(ECHO) ==============================
+	$(ECHO) Test summary
+	$(ECHO) ==============================
+	$(PRINTF) "%2s %-49s %5s %5s %5s %5s %2s\n" "  " TEST \
+	    TOTAL PASS FAIL ERROR " "
+	$(foreach test, $(TESTS_TO_RUN), \
+	  $(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
+	      $(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
+	  $(if $(filter $($(TEST_ID)_PASSED), $($(TEST_ID)_TOTAL)), \
+	    $(PRINTF) "%2s %-49s %5d %5d %5d %5d %2s\n" "  " "$(test)" \
+	        $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) $($(TEST_ID)_FAILED) \
+	        $($(TEST_ID)_ERROR) "  " $(NEWLINE) \
+	  , \
+	    $(PRINTF) "%2s %-49s %5d %5d %5d %5d %2s\n" ">>" "$(test)" \
+	        $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) $($(TEST_ID)_FAILED) \
+	        $($(TEST_ID)_ERROR) "<<" $(NEWLINE) \
+	    $(eval TEST_FAILURE := true) \
+	  ) \
+	)
+	$(ECHO) ==============================
+	$(if $(filter true, $(TEST_FAILURE)), \
+	  $(ECHO) TEST FAILURE $(NEWLINE) \
+	  $(TOUCH) $(MAKESUPPORT_OUTPUTDIR)/exit-with-error \
+	, \
+	  $(ECHO) TEST SUCCESS \
+	)
+	$(ECHO)
+
+################################################################################
+
+all: run-test
+
+.PHONY: default all run-test $(TARGETS)
diff --git a/make/UpdateBuildDocs.gmk b/make/UpdateBuildDocs.gmk
new file mode 100644
index 0000000..42f5ee0
--- /dev/null
+++ b/make/UpdateBuildDocs.gmk
@@ -0,0 +1,106 @@
+#
+# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+
+################################################################################
+# This makefile updates the generated build html documentation.
+#
+################################################################################
+
+ifeq ($(PANDOC), )
+  $(info No pandoc executable was detected by configure)
+  $(error Cannot continue)
+endif
+
+################################################################################
+# Setup make rules for converting a markdown file to html.
+#
+# Parameter 1 is the name of the rule. This name is used as variable prefix,
+# and the targets generated are listed in a variable by that name.
+#
+# Remaining parameters are named arguments. These include:
+#   SOURCE_FILE  The markdown source file
+#   TARGET_DIR   The directory where to store the generated html file
+#   OPTIONS      Additional options to pandoc
+#
+SetupMarkdownToHtml = $(NamedParamsMacroTemplate)
+define SetupMarkdownToHtmlBody
+  ifeq ($$($1_SOURCE_FILE), )
+    $$(error SOURCE_FILE is missing in SetupMarkdownToHtml $1)
+  endif
+
+  ifeq ($$($1_TARGET_DIR), )
+    $$(error TARGET_DIR is missing in SetupMarkdownToHtml $1)
+  endif
+
+  $1_BASENAME := $$(notdir $$(basename $$($1_SOURCE_FILE)))
+  $1_OUTPUT_FILE := $$($1_TARGET_DIR)/$$($1_BASENAME).html
+
+$$($1_OUTPUT_FILE): $$($1_SOURCE_FILE)
+	$$(call LogInfo, Converting $$(notdir $1) to html)
+	$$(call MakeDir, $$($1_TARGET_DIR) $$(MAKESUPPORT_OUTPUTDIR)/markdown)
+	$$(call ExecuteWithLog, $$(MAKESUPPORT_OUTPUTDIR)/markdown/$1, \
+	    $$(PANDOC) $$($1_OPTIONS) -f markdown -t html --standalone \
+	    --css 'http://openjdk.java.net/page.css' '$$<' -o '$$@')
+	TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
+	if [ "x$$$$TOO_LONG_LINES" != x ]; then \
+	  $$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \
+	  $$(ECHO) "The following lines are longer than 80 characters:" ; \
+	  $$(GREP) -E -n -e '^.{80}.+$$$$' $$< || true ; \
+	fi
+
+  $1 := $$($1_OUTPUT_FILE)
+
+  TARGETS += $$($1)
+endef
+
+################################################################################
+
+DOCS_DIR := $(TOPDIR)/common/doc
+
+$(eval $(call SetupMarkdownToHtml, building, \
+  SOURCE_FILE := $(DOCS_DIR)/building.md, \
+  TARGET_DIR := $(DOCS_DIR), \
+))
+
+$(eval $(call SetupMarkdownToHtml, testing, \
+  SOURCE_FILE := $(DOCS_DIR)/testing.md, \
+  TARGET_DIR := $(DOCS_DIR), \
+  OPTIONS := --toc, \
+))
+
+################################################################################
+
+$(eval $(call IncludeCustomExtension, , UpdateBuildDocs.gmk))
+
+################################################################################
+
+all: $(TARGETS)
+
+.PHONY: all default
diff --git a/make/common/FindTests.gmk b/make/common/FindTests.gmk
new file mode 100644
index 0000000..8394e54
--- /dev/null
+++ b/make/common/FindTests.gmk
@@ -0,0 +1,77 @@
+#
+# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+ifndef _FIND_TESTS_GMK
+_FIND_TESTS_GMK := 1
+
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, , common/FindTests.gmk))
+
+# JTREG_COMPONENTS might have been set by a custom extension
+JTREG_COMPONENTS += hotspot jdk langtools nashorn jaxp
+
+################################################################################
+# Find the Jtreg test groups for the given component.
+#
+# Parameter 1 is the name of the component. This name is used as variable prefix.
+#
+# After this macro has been evaluated, the following variables are defined for
+# the component:
+#   JTREG_TESTROOT - The path to the root of the test directory
+#   JTREG_GROUP_FILES - The file(s) containing the group definitions
+#   JTREG_TEST_GROUPS - The name of the test groups that the component defines
+#
+FindJtregGroups = $(NamedParamsMacroTemplate)
+define FindJtregGroupsBody
+  $1_JTREG_TESTROOT := $$(TOPDIR)/$1/test
+  ifneq ($$(wildcard $$($1_JTREG_TESTROOT)), )
+    $1_JTREG_GROUP_FILENAMES := $$(shell $$(SED) -n -e 's/\[\(.*\)\]/\1/g' \
+        -e 's/^groups\w*=//p' $$($1_JTREG_TESTROOT)/TEST.ROOT)
+    $1_JTREG_GROUP_FILES := $$(addprefix $$($1_JTREG_TESTROOT)/, \
+        $$($1_JTREG_GROUP_FILENAMES))
+    $1_JTREG_TEST_GROUPS := $$(strip $$(shell $$(SED) -n \
+        -e 's/\([^ ]*\)\w*=.*/\1/gp' $$(wildcard $$($1_JTREG_GROUP_FILES)) \
+        | $$(SORT) -u))
+  endif
+endef
+
+# Configure definitions for all available test components
+$(foreach component, $(JTREG_COMPONENTS), \
+    $(eval $(call FindJtregGroups, $(component))))
+
+# Create a list of all available Jtreg test groups in all components
+JTREG_TEST_GROUPS += $(sort $(foreach component, $(JTREG_COMPONENTS), \
+    $($(component)_JTREG_TEST_GROUPS)))
+
+# Add Jtreg test groups to list of named tests (test groups, test list, etc)
+# ALL_NAMED_TESTS might have been set by a custom extension
+ALL_NAMED_TESTS += $(JTREG_TEST_GROUPS)
+
+# Add Gtest
+ALL_NAMED_TESTS += gtest
+
+################################################################################
+
+endif # _FIND_TESTS_GMK
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
index dce01ff..97368dc 100644
--- a/make/common/MakeBase.gmk
+++ b/make/common/MakeBase.gmk
@@ -755,6 +755,55 @@
 endef
 
 ################################################################################
+# Parse a multiple-keyword variable, like FOO="KEYWORD1=val1;KEYWORD2=val2;..."
+# These will be converted into a series of variables like FOO_KEYWORD1=val1,
+# FOO_KEYWORD2=val2, etc. Unknown keywords will cause an error.
+#
+# Parameter 1 is the name of the rule, and is also the name of the variable.
+#
+# Remaining parameters are named arguments. These include:
+#   KEYWORDS          A list of valid keywords
+#   STRING_KEYWORDS   A list of valid keywords, processed as string. This means
+#       that '%20' will be replaced by ' ' to allow for multi-word strings.
+#
+ParseKeywordVariable = $(NamedParamsMacroTemplate)
+define ParseKeywordVariableBody
+  ifneq ($$($1), )
+    # To preserve spaces, substitute them with a hopefully unique pattern
+    # before splitting and then re-substitute spaces back.
+    $1_MANGLED := $$(subst $$(SPACE),||||,$$($1))
+    $$(foreach mangled_part, $$(subst ;, , $$($1_MANGLED)), \
+      $$(eval mangled_part_eval := $$(call DoubleDollar, $$(mangled_part))) \
+      $$(eval part := $$$$(subst ||||,$$$$(SPACE),$$$$(mangled_part_eval))) \
+      $$(eval $1_NO_MATCH := true) \
+      $$(foreach keyword, $$($1_KEYWORDS), \
+        $$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
+        $$(if $$(filter $$(keyword)=%, $$(part)), \
+          $$(eval $(strip $1)_$$$$(keyword_eval) := $$$$(strip $$$$(patsubst $$$$(keyword_eval)=%, %, $$$$(part)))) \
+          $$(eval $1_NO_MATCH := ) \
+        ) \
+      ) \
+      $$(foreach keyword, $$($1_STRING_KEYWORDS), \
+        $$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
+        $$(if $$(filter $$(keyword)=%, $$(part)), \
+          $$(eval $(strip $1)_$$$$(keyword_eval) := $$$$(strip $$$$(subst %20, , $$$$(patsubst $$$$(keyword_eval)=%, %, $$$$(part))))) \
+          $$(eval $1_NO_MATCH := ) \
+        ) \
+      ) \
+      $$(if $$($1_NO_MATCH), \
+        $$(if $$(filter $$(part), $$($1_KEYWORDS) $$($1_STRING_KEYWORDS)), \
+          $$(info Keyword $$(part) for $1 needs to be assigned a value.) \
+        , \
+          $$(info $$(part) is not a valid keyword for $1.) \
+          $$(info Valid keywords: $$($1_KEYWORDS) $$($1_STRING_KEYWORDS).) \
+        ) \
+        $$(error Cannot continue) \
+      ) \
+    )
+  endif
+endef
+
+################################################################################
 # ShellQuote
 #
 # Quotes a string with single quotes and replaces single quotes with '\'' so
@@ -764,6 +813,22 @@
     $(SQUOTE)$(subst $(SQUOTE),$(SQUOTE)\$(SQUOTE)$(SQUOTE),$(strip $1))$(SQUOTE)
 
 ################################################################################
+# FixPath
+#
+# On Windows, converts a path from cygwin/unix style (e.g. /bin/foo) into
+# "mixed mode" (e.g. c:/cygwin/bin/foo). On other platforms, return the path
+# unchanged.
+# This is normally not needed since we use the FIXPATH prefix for command lines,
+# but might be needed in certain circumstances.
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  FixPath = \
+      $(shell $(CYGPATH) -m $1)
+else
+  FixPath = \
+      $1
+endif
+
+################################################################################
 # Write to and read from file
 
 # Param 1 - File to read
diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk
index 4ceb451..8e8b771 100644
--- a/make/common/Modules.gmk
+++ b/make/common/Modules.gmk
@@ -63,7 +63,7 @@
     jdk.net \
     jdk.sctp \
     jdk.unsupported \
-    jdk.vm.ci \
+    jdk.internal.vm.ci \
     #
 
 # to be deprivileged
@@ -107,7 +107,6 @@
     jdk.charsets \
     jdk.crypto.ec \
     jdk.crypto.cryptoki \
-    jdk.desktop \
     jdk.dynalink \
     jdk.jsobject \
     jdk.localedata \
@@ -115,6 +114,7 @@
     jdk.scripting.nashorn \
     jdk.security.auth \
     jdk.security.jgss \
+    jdk.internal.vm.compiler \
     jdk.xml.dom \
     jdk.zipfs \
     #
@@ -147,7 +147,7 @@
 # Filter out Graal specific modules if Graal build is disabled
 
 ifeq ($(INCLUDE_GRAAL), false)
-  MODULES_FILTER += jdk.vm.compiler
+  MODULES_FILTER += jdk.internal.vm.compiler
 endif
 
 ################################################################################
diff --git a/make/common/SetupJavaCompilers.gmk b/make/common/SetupJavaCompilers.gmk
index 5ac4b86..1a80d47 100644
--- a/make/common/SetupJavaCompilers.gmk
+++ b/make/common/SetupJavaCompilers.gmk
@@ -32,7 +32,7 @@
 
 # If warnings needs to be non-fatal for testing purposes use a command like:
 # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
-JAVAC_WARNINGS := -Xlint:all,-removal -Werror
+JAVAC_WARNINGS := -Xlint:all -Werror
 
 # The BOOT_JAVAC setup uses the boot jdk compiler to compile the tools
 # and the interim javac, to be run by the boot jdk.
diff --git a/nashorn/.hgtags b/nashorn/.hgtags
index 22c2840..52a00dd 100644
--- a/nashorn/.hgtags
+++ b/nashorn/.hgtags
@@ -389,3 +389,12 @@
 19aaaf2d02b7d6986538cd9a8c46901ecb50eebf jdk-9+153
 a84b49cfee63716975535abae2865ffef4dd6474 jdk-9+154
 f9bb37a817b3cd3b758a60f3c68258a6554eb382 jdk-9+155
+d577398d31111be4bdaa08008247cf4242eaea94 jdk-9+156
+f6070efba6af0dc003e24ca736426c93e99ee96a jdk-9+157
+13ae2480a4c395026b3aa1739e0f9895dc8b25d9 jdk-9+158
+d75af059cff651c1b5cccfeb4c9ea8d054b28cfd jdk-9+159
+9d4dbb8cbe7ce321c6e9e34dc9e0974760710907 jdk-9+160
+d6ef419af865dccf1e5be8047b0aba09286ffa93 jdk-9+161
+2cd29b339692524de64d049b329873facaff9727 jdk-9+162
+5e5e436543daea0c174d878d5e3ff8dd791e538a jdk-9+163
+b473fab09baab51a06ffba02eb06c7f5ee8578f7 jdk-9+164
diff --git a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CallerSensitiveDynamicMethod.java b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CallerSensitiveDynamicMethod.java
index 0168734..6d12e2f 100644
--- a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CallerSensitiveDynamicMethod.java
+++ b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CallerSensitiveDynamicMethod.java
@@ -92,7 +92,6 @@
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
diff --git a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CheckRestrictedPackage.java b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CheckRestrictedPackage.java
index 2427cc6..22ce67e 100644
--- a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CheckRestrictedPackage.java
+++ b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CheckRestrictedPackage.java
@@ -84,7 +84,6 @@
 package jdk.dynalink.beans;
 
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
diff --git a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Lookup.java b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Lookup.java
index b996821..d9de82e 100644
--- a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Lookup.java
+++ b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Lookup.java
@@ -89,7 +89,6 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Executable;
 import java.lang.reflect.Field;
-import java.lang.reflect.Module;
 import java.lang.reflect.Method;
 
 /**
diff --git a/nashorn/src/jdk.dynalink/share/classes/module-info.java b/nashorn/src/jdk.dynalink/share/classes/module-info.java
index 9e9fcbc..3faffbd 100644
--- a/nashorn/src/jdk.dynalink/share/classes/module-info.java
+++ b/nashorn/src/jdk.dynalink/share/classes/module-info.java
@@ -216,6 +216,9 @@
  * language runtime B gets passed to code from language runtime A, the linker
  * from B will get a chance to link the call site in A when it encounters the
  * object from B.
+ *
+ * @moduleGraph
+ * @since 9
  */
 module jdk.dynalink {
     requires java.logging;
diff --git a/nashorn/src/jdk.scripting.nashorn.shell/share/classes/module-info.java b/nashorn/src/jdk.scripting.nashorn.shell/share/classes/module-info.java
index 790fc62..2ed4857 100644
--- a/nashorn/src/jdk.scripting.nashorn.shell/share/classes/module-info.java
+++ b/nashorn/src/jdk.scripting.nashorn.shell/share/classes/module-info.java
@@ -25,6 +25,8 @@
 
 /**
  * Nashorn shell module
+ *
+ * @since 9
  */
 module jdk.scripting.nashorn.shell {
     requires java.desktop;
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java
index a40ed5f..aeec38c 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java
@@ -51,9 +51,7 @@
 import java.lang.module.ModuleReader;
 import java.lang.module.ModuleReference;
 import java.lang.reflect.Field;
-import java.lang.reflect.Layer;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.file.Path;
@@ -378,7 +376,7 @@
     static final boolean javaSqlFound, javaSqlRowsetFound;
 
     static {
-        final Layer boot = Layer.boot();
+        final ModuleLayer boot = ModuleLayer.boot();
         javaSqlFound = boot.findModule("java.sql").isPresent();
         javaSqlRowsetFound = boot.findModule("java.sql.rowset").isPresent();
     }
@@ -1334,7 +1332,7 @@
      * @return the new Module
      */
     static Module createModuleTrusted(final ModuleDescriptor descriptor, final ClassLoader loader) {
-        return createModuleTrusted(Layer.boot(), descriptor, loader);
+        return createModuleTrusted(ModuleLayer.boot(), descriptor, loader);
     }
 
     /**
@@ -1346,7 +1344,7 @@
      * @param loader the class loader of the module
      * @return the new Module
      */
-    static Module createModuleTrusted(final Layer parent, final ModuleDescriptor descriptor, final ClassLoader loader) {
+    static Module createModuleTrusted(final ModuleLayer parent, final ModuleDescriptor descriptor, final ClassLoader loader) {
         final String mn = descriptor.name();
 
         final ModuleReference mref = new ModuleReference(descriptor, null) {
@@ -1372,10 +1370,10 @@
         };
 
         final Configuration cf = parent.configuration()
-                .resolveRequires(finder, ModuleFinder.of(), Set.of(mn));
+                .resolve(finder, ModuleFinder.of(), Set.of(mn));
 
-        final PrivilegedAction<Layer> pa = () -> parent.defineModules(cf, name -> loader);
-        final Layer layer = AccessController.doPrivileged(pa, GET_LOADER_ACC_CTXT);
+        final PrivilegedAction<ModuleLayer> pa = () -> parent.defineModules(cf, name -> loader);
+        final ModuleLayer layer = AccessController.doPrivileged(pa, GET_LOADER_ACC_CTXT);
 
         final Module m = layer.findModule(mn).get();
         assert m.getLayer() == layer;
@@ -1796,9 +1794,9 @@
                 collect(Collectors.toSet());
         }
 
-        final Layer boot = Layer.boot();
+        final ModuleLayer boot = ModuleLayer.boot();
         final Configuration conf = boot.configuration().
-            resolveRequires(mf, ModuleFinder.of(), rootMods);
+            resolve(mf, ModuleFinder.of(), rootMods);
         final String firstMod = rootMods.iterator().next();
         return boot.defineModulesWithOneLoader(conf, cl).findLoader(firstMod);
     }
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/NashornLoader.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/NashornLoader.java
index c9d4805..cc86b46 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/NashornLoader.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/NashornLoader.java
@@ -34,7 +34,6 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.lang.reflect.Module;
 import java.security.AccessController;
 import java.security.CodeSource;
 import java.security.Permission;
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptLoader.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptLoader.java
index 4a22352..d0e0ca1 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptLoader.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptLoader.java
@@ -26,9 +26,10 @@
 package jdk.nashorn.internal.runtime;
 
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Module;
+import java.lang.module.ModuleDescriptor.Modifier;
 import java.security.CodeSource;
 import java.util.Objects;
+import java.util.Set;
 
 /**
  * Responsible for loading script generated classes.
@@ -69,12 +70,11 @@
     private Module createModule(final String moduleName) {
         final Module structMod = context.getStructLoader().getModule();
         final ModuleDescriptor.Builder builder =
-            ModuleDescriptor.module(moduleName)
-                    .requires("java.base")
+            ModuleDescriptor.newModule(moduleName, Set.of(Modifier.SYNTHETIC))
                     .requires("java.logging")
                     .requires(NASHORN_MODULE.getName())
                     .requires(structMod.getName())
-                    .contains(SCRIPTS_PKG);
+                    .packages(Set.of(SCRIPTS_PKG));
 
         if (Context.javaSqlFound) {
             builder.requires("java.sql");
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptRuntime.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptRuntime.java
index bf34f1f..8a914dd 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptRuntime.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptRuntime.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,8 @@
 import jdk.nashorn.internal.objects.AbstractIterator;
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.objects.NativeObject;
+import jdk.nashorn.internal.objects.NativeJava;
+import jdk.nashorn.internal.objects.NativeArray;
 import jdk.nashorn.internal.parser.Lexer;
 import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
 import jdk.nashorn.internal.runtime.linker.Bootstrap;
@@ -398,6 +400,30 @@
             if (itr != null) {
                 return itr;
             }
+
+        if (obj instanceof Map) {
+            return new Iterator<Object>() {
+                private Iterator<?> iter = ((Map<?,?>)obj).entrySet().iterator();
+
+                @Override
+                public boolean hasNext() {
+                    return iter.hasNext();
+                }
+
+                @Override
+                public Object next() {
+                    Map.Entry<?,?> next = (Map.Entry)iter.next();
+                    Object[] keyvalue = new Object[]{next.getKey(), next.getValue()};
+                    NativeArray array = NativeJava.from(null, keyvalue);
+                    return array;
+                }
+
+                @Override
+                public void remove() {
+                    iter.remove();
+                }
+            };
+        }
         }
 
         final Global global = Global.instance();
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/StructureLoader.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/StructureLoader.java
index 075540a..f1c9ef3 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/StructureLoader.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/StructureLoader.java
@@ -31,8 +31,9 @@
 import static jdk.nashorn.internal.codegen.CompilerConstants.JS_OBJECT_SINGLE_FIELD_PREFIX;
 
 import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Module;
+import java.lang.module.ModuleDescriptor.Modifier;
 import java.security.ProtectionDomain;
+import java.util.Set;
 import jdk.nashorn.internal.codegen.ObjectClassGenerator;
 
 /**
@@ -62,12 +63,11 @@
     }
 
     private Module createModule(final String moduleName) {
-        final ModuleDescriptor descriptor
-                = ModuleDescriptor.module(moduleName)
-                    .requires("java.base")
-                    .requires(NASHORN_MODULE.getName())
-                    .contains(SCRIPTS_PKG)
-                    .build();
+        final ModuleDescriptor descriptor =
+            ModuleDescriptor.newModule(moduleName, Set.of(Modifier.SYNTHETIC))
+                            .requires(NASHORN_MODULE.getName())
+                            .packages(Set.of(SCRIPTS_PKG))
+                            .build();
 
         final Module mod = Context.createModuleTrusted(descriptor, this);
         loadModuleManipulator();
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java
index 6f2ee8c..8b32424 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java
@@ -176,6 +176,8 @@
             final int index = getIndex((Number)key);
             if (index > -1) {
                 return ((JSObject)jsobj).getSlot(index);
+            } else {
+                return ((JSObject)jsobj).getMember(JSType.toString(key));
             }
         } else if (isString(key)) {
             final String name = key.toString();
@@ -193,7 +195,12 @@
         if (key instanceof Integer) {
             ((JSObject)jsobj).setSlot((Integer)key, value);
         } else if (key instanceof Number) {
-            ((JSObject)jsobj).setSlot(getIndex((Number)key), value);
+            final int index = getIndex((Number)key);
+            if (index > -1) {
+                ((JSObject)jsobj).setSlot(index, value);
+            } else {
+                ((JSObject)jsobj).setMember(JSType.toString(key), value);
+            }
         } else if (isString(key)) {
             ((JSObject)jsobj).setMember(key.toString(), value);
         }
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java
index a488e6c..feb4baf 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java
@@ -27,7 +27,6 @@
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/scripts/ModuleGraphManipulator.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/scripts/ModuleGraphManipulator.java
index b3e165a..72e0be1 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/scripts/ModuleGraphManipulator.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/scripts/ModuleGraphManipulator.java
@@ -25,7 +25,6 @@
 
 package jdk.nashorn.internal.scripts;
 
-import java.lang.reflect.Module;
 import jdk.nashorn.api.scripting.JSObject;
 
 /**
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/module-info.java b/nashorn/src/jdk.scripting.nashorn/share/classes/module-info.java
index 83b4189..00aeab1 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/module-info.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/module-info.java
@@ -89,6 +89,9 @@
 <h2>Other non-standard built-in objects</h2>
 In addition to {@code Java}, Nashorn also exposes some other non-standard built-in objects:
 {@code JSAdapter}, {@code JavaImporter}, {@code Packages}
+
+@moduleGraph
+@since 9
  */
 module jdk.scripting.nashorn {
     requires java.logging;
diff --git a/nashorn/test/TEST.ROOT b/nashorn/test/TEST.ROOT
index 08e6c7f..37d8a1c 100644
--- a/nashorn/test/TEST.ROOT
+++ b/nashorn/test/TEST.ROOT
@@ -8,7 +8,7 @@
 groups=TEST.groups
 
 # Minimum jtreg version
-requiredVersion=4.2 b04
+requiredVersion=4.2 b07
 
 # Use new module options
 useNewOptions=true
diff --git a/nashorn/test/script/basic/JDK-8176511.js b/nashorn/test/script/basic/JDK-8176511.js
new file mode 100644
index 0000000..08fbd55
--- /dev/null
+++ b/nashorn/test/script/basic/JDK-8176511.js
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8176511: JSObject property access is broken for numeric keys outside the int range
+ *
+ * @test
+ * @run
+ */
+
+
+var reassignWithNewGlobal = loadWithNewGlobal({
+    script: '(function (o, i) { o[i] = o[i]; })', name: 'internal.js'
+
+});
+
+function test(i) {
+    var o = {};
+    o[i] = true;
+    var before = JSON.stringify(o);
+    reassignWithNewGlobal(o, i);
+    var after = JSON.stringify(o);
+    Assert.assertEquals(before, after);
+}
+
+test(-2147483649);
+test(-2147483648);
+test(2147483647);
+test(2147483648);
+
diff --git a/nashorn/test/script/basic/es6/JDK-8156743.js b/nashorn/test/script/basic/es6/JDK-8156743.js
new file mode 100644
index 0000000..d44b847
--- /dev/null
+++ b/nashorn/test/script/basic/es6/JDK-8156743.js
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8156743: ES6 for..of should work for Java Maps and Sets
+ *
+ * @test
+ * @run
+ * @option --language=es6
+ */
+
+var map = new Map([
+    [1, 'one'],
+    [2, 'two'],
+    [3, 'three']
+]);
+
+var set = new Set(['red', 'green', 'blue']);
+
+var HashMap = Java.type("java.util.HashMap");
+var jmap = new HashMap();
+jmap.put(1, 'one');
+jmap.put(2, 'two');
+jmap.put(3, 'three');
+
+var HashSet = Java.type("java.util.HashSet");
+var jset = new HashSet();
+jset.add('red');
+jset.add('green');
+jset.add('blue');
+
+for(var keyvalue of map){
+    print(keyvalue[0],keyvalue[1]);
+}
+
+for(var keyvalue of jmap){
+    print(keyvalue[0],keyvalue[1]);
+}
+
+for(var keyvalue of map){
+    print(keyvalue);
+}
+
+for(var keyvalue of jmap){
+    print(keyvalue);
+}
+
+for(var element of set){
+    print(element);
+}
+
+for(var element of jset){
+    print(element);
+}
+
diff --git a/nashorn/test/script/basic/es6/JDK-8156743.js.EXPECTED b/nashorn/test/script/basic/es6/JDK-8156743.js.EXPECTED
new file mode 100644
index 0000000..80c8bb7
--- /dev/null
+++ b/nashorn/test/script/basic/es6/JDK-8156743.js.EXPECTED
@@ -0,0 +1,18 @@
+1 one
+2 two
+3 three
+1 one
+2 two
+3 three
+1,one
+2,two
+3,three
+1,one
+2,two
+3,three
+red
+green
+blue
+red
+green
+blue
diff --git a/nashorn/test/src/jdk/nashorn/test/models/Reflector.java b/nashorn/test/src/jdk/nashorn/test/models/Reflector.java
index 9722694..72f2938 100644
--- a/nashorn/test/src/jdk/nashorn/test/models/Reflector.java
+++ b/nashorn/test/src/jdk/nashorn/test/models/Reflector.java
@@ -29,7 +29,6 @@
 import java.lang.reflect.Executable;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.lang.reflect.Module;
 import jdk.nashorn.internal.runtime.Context;
 
 /**
diff --git a/test/TestCommon.gmk b/test/TestCommon.gmk
index 4aecf79..4529d73 100644
--- a/test/TestCommon.gmk
+++ b/test/TestCommon.gmk
@@ -370,7 +370,7 @@
 # Give tests access to JT_JAVA, see JDK-8141609
 JTREG_BASIC_OPTIONS += -e:JDK8_HOME=${JT_JAVA}
 # Set other vm and test options
-JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)
+JTREG_TEST_OPTIONS += $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)
 
 ifeq ($(IGNORE_MARKED_TESTS), true)
   # Option to tell jtreg to not run tests marked with "ignore"
diff --git a/test/lib/jdk/test/lib/apps/LingeredApp.java b/test/lib/jdk/test/lib/apps/LingeredApp.java
index 8632a83..22a123c 100644
--- a/test/lib/jdk/test/lib/apps/LingeredApp.java
+++ b/test/lib/jdk/test/lib/apps/LingeredApp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -143,7 +143,7 @@
         if (appProcess == null) {
             throw new RuntimeException("Process is not alive");
         }
-        return appProcess.getPid();
+        return appProcess.pid();
     }
 
     /**
diff --git a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java
index f794ef3..8c57487 100644
--- a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java
+++ b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java
@@ -199,6 +199,10 @@
             throws Throwable {
         List<String> finalOptions = new ArrayList<>();
         finalOptions.add(CommandLineOptionTest.getVMTypeOption());
+        String extraFlagForEmulated = CommandLineOptionTest.getVMTypeOptionForEmulated();
+        if (extraFlagForEmulated != null) {
+            finalOptions.add(extraFlagForEmulated);
+        }
         Collections.addAll(finalOptions, options);
 
         CommandLineOptionTest.verifyJVMStartup(expectedMessages,
@@ -390,6 +394,10 @@
             String... additionalVMOpts) throws Throwable {
         List<String> finalOptions = new ArrayList<>();
         finalOptions.add(CommandLineOptionTest.getVMTypeOption());
+        String extraFlagForEmulated = CommandLineOptionTest.getVMTypeOptionForEmulated();
+        if (extraFlagForEmulated != null) {
+            finalOptions.add(extraFlagForEmulated);
+        }
         Collections.addAll(finalOptions, additionalVMOpts);
 
         CommandLineOptionTest.verifyOptionValue(optionName, expectedValue,
@@ -497,6 +505,18 @@
         throw new RuntimeException("Unknown VM mode.");
     }
 
+    /**
+     * @return addtional VMoptions(Emulated related) required to start a new VM with the same type as current.
+     */
+    private static String getVMTypeOptionForEmulated() {
+        if (Platform.isServer() && !Platform.isEmulatedClient()) {
+            return "-XX:-NeverActAsServerClassMachine";
+        } else if (Platform.isEmulatedClient()) {
+            return "-XX:+NeverActAsServerClassMachine";
+        }
+        return null;
+    }
+
     private final BooleanSupplier predicate;
 
     /**
diff --git a/test/lib/jdk/test/lib/process/ProcessTools.java b/test/lib/jdk/test/lib/process/ProcessTools.java
index 3f4bbb7..5066efb 100644
--- a/test/lib/jdk/test/lib/process/ProcessTools.java
+++ b/test/lib/jdk/test/lib/process/ProcessTools.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -302,7 +302,7 @@
      * @return Process id
      */
     public static long getProcessId() throws Exception {
-        return ProcessHandle.current().getPid();
+        return ProcessHandle.current().pid();
     }
     /**
      * Gets the array of strings containing input arguments passed to the VM
@@ -580,8 +580,8 @@
         }
 
         @Override
-        public long getPid() {
-            return p.getPid();
+        public long pid() {
+            return p.pid();
         }
 
         @Override
diff --git a/test/make/TestMakeBase.gmk b/test/make/TestMakeBase.gmk
index 0bed3ea..60a7a6a 100644
--- a/test/make/TestMakeBase.gmk
+++ b/test/make/TestMakeBase.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -179,7 +179,7 @@
 	test "some string value1" = "`$(CAT) $(VARDEP_DIR)/target-file`"
 	test -e $(VARDEP_FLAG_FILE)
         #
-        # Make the target file again and verify that the value is updated with 
+        # Make the target file again and verify that the value is updated with
         # the new value
         #
 	$(SLEEP_ON_MAC)
@@ -341,5 +341,60 @@
 ))
 
 ################################################################################
+# Test ParseKeywordVariable
+
+KWBASE := APA=banan;GURKA=tomat;COUNT=1%202%203%204%205;SUM=1+2+3+4+5;MANY_WORDS=I have the best words.
+
+$(eval $(call ParseKeywordVariable, KWBASE, \
+    KEYWORDS := APA GURKA SUM, \
+    STRING_KEYWORDS := COUNT MANY_WORDS, \
+))
+
+$(eval $(call assert-equals, \
+    $(KWBASE_APA), \
+    banan, \
+    ParseKeywordVariable failed to parse APA, \
+))
+
+$(eval $(call assert-equals, \
+    $(KWBASE_COUNT), \
+    1 2 3 4 5, \
+    ParseKeywordVariable failed to parse COUNT, \
+))
+
+$(eval $(call assert-equals, \
+    $(KWBASE_SUM), \
+    1+2+3+4+5, \
+    ParseKeywordVariable failed to parse SUM, \
+))
+
+$(eval $(call assert-equals, \
+    $(KWBASE_MANY_WORDS), \
+    I have the best words., \
+    ParseKeywordVariable failed to parse MANY_WORDS, \
+))
+
+# Simulate variable set from command line by using "override"
+override KWBASE_WEIRD_GURKA := paprika
+KWBASE_WEIRD := ;;APA=banan;;;GURKA=apelsin;APA=skansen;;
+
+$(eval $(call ParseKeywordVariable, KWBASE_WEIRD, \
+    KEYWORDS := APA GURKA SUM, \
+    STRING_KEYWORDS := COUNT, \
+))
+
+$(eval $(call assert-equals, \
+    $(KWBASE_WEIRD_APA), \
+    skansen, \
+    ParseKeywordVariable failed to overwrite APA, \
+))
+
+$(eval $(call assert-equals, \
+    $(KWBASE_WEIRD_GURKA), \
+    paprika, \
+    ParseKeywordVariable failed to preserve GURKA, \
+))
+
+################################################################################
 
 all: $(TEST_TARGETS)